@superdoc-dev/cli 0.7.0-next.35 → 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.
Files changed (2) hide show
  1. package/dist/index.js +57 -11
  2. 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-CKSsojHL.es.js
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) => {
@@ -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, maxReserve - usedHeight - overhead - gapBefore), pageIndex, columnIndex, isContinuation, measuresById$1, isFirstSlice && maxReserve > 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 seenReserveKeys = new Set([reserves.join(",")]);
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 (seenReserveKeys.has(nextKey))
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
- seenReserveKeys.add(nextKey);
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
- if (finalReserves.length !== reserves.length || finalReserves.some((h$2, i4) => (reserves[i4] ?? 0) !== h$2) || reserves.some((h$2, i4) => (finalReserves[i4] ?? 0) !== h$2)) {
254192
- layout = relayout(finalReserves);
254193
- reservesAppliedToLayout = finalReserves;
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);
@@ -290307,7 +290353,7 @@ menclose::after {
290307
290353
  return;
290308
290354
  console.log(...args$1);
290309
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;
290310
- var init_src_CKSsojHL_es = __esm(() => {
290356
+ var init_src_nnj_4GhR_es = __esm(() => {
290311
290357
  init_rolldown_runtime_Bg48TavK_es();
290312
290358
  init_SuperConverter_D8HLuwGQ_es();
290313
290359
  init_jszip_C49i9kUs_es();
@@ -325181,7 +325227,7 @@ var init_zipper_DbkgrypV_es = __esm(() => {
325181
325227
 
325182
325228
  // ../../packages/superdoc/dist/super-editor.es.js
325183
325229
  var init_super_editor_es = __esm(() => {
325184
- init_src_CKSsojHL_es();
325230
+ init_src_nnj_4GhR_es();
325185
325231
  init_SuperConverter_D8HLuwGQ_es();
325186
325232
  init_jszip_C49i9kUs_es();
325187
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.35",
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.35",
38
- "@superdoc-dev/cli-darwin-x64": "0.7.0-next.35",
39
- "@superdoc-dev/cli-linux-x64": "0.7.0-next.35",
40
- "@superdoc-dev/cli-linux-arm64": "0.7.0-next.35",
41
- "@superdoc-dev/cli-windows-x64": "0.7.0-next.35"
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",