@superdoc-dev/cli 0.5.0-next.33 → 0.5.0-next.34

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 +45 -17
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -172583,7 +172583,7 @@ var init_remark_gfm_CjV8kaUy_es = __esm(() => {
172583
172583
  init_remark_gfm_z_sDF4ss_es();
172584
172584
  });
172585
172585
 
172586
- // ../../packages/superdoc/dist/chunks/src-g1sb-ClT.es.js
172586
+ // ../../packages/superdoc/dist/chunks/src-CGUGTAQU.es.js
172587
172587
  function deleteProps(obj, propOrProps) {
172588
172588
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
172589
172589
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -214530,10 +214530,19 @@ function layoutParagraphBlock(ctx$1, anchors) {
214530
214530
  remeasuredMarkerInfo = newMeasure.marker;
214531
214531
  }
214532
214532
  }
214533
+ const rawBorderExpansion = computeBorderVerticalExpansion(attrs?.borders);
214534
+ const currentBorderHash = hashBorders(attrs?.borders);
214535
+ const inBorderGroup = currentBorderHash != null && currentBorderHash === ensurePage().lastParagraphBorderHash;
214536
+ const borderExpansion = {
214537
+ top: inBorderGroup ? 0 : rawBorderExpansion.top,
214538
+ bottom: rawBorderExpansion.bottom
214539
+ };
214533
214540
  while (fromLine < lines.length) {
214534
214541
  let state = ensurePage();
214535
214542
  if (state.trailingSpacing == null)
214536
214543
  state.trailingSpacing = 0;
214544
+ if (inBorderGroup && fromLine === 0)
214545
+ state.cursorY -= rawBorderExpansion.bottom;
214537
214546
  if (shouldSuppressOwnSpacing(styleId, contextualSpacing, state.lastParagraphStyleId))
214538
214547
  spacingBefore = 0;
214539
214548
  if (shouldSuppressOwnSpacing(state.lastParagraphStyleId, state.lastParagraphContextualSpacing, styleId)) {
@@ -214547,7 +214556,7 @@ function layoutParagraphBlock(ctx$1, anchors) {
214547
214556
  const prevTrailing = state.trailingSpacing ?? 0;
214548
214557
  const neededSpacingBefore = Math.max(spacingBefore - prevTrailing, 0);
214549
214558
  const pageContentHeight = state.contentBottom - state.topMargin;
214550
- const fullHeight = lines.reduce((sum, line) => sum + (line.lineHeight || 0), 0);
214559
+ const fullHeight = lines.reduce((sum, line) => sum + (line.lineHeight || 0), 0) + borderExpansion.top + borderExpansion.bottom;
214551
214560
  const fitsOnBlankPage = fullHeight + baseSpacingBefore <= pageContentHeight;
214552
214561
  const remainingHeightAfterSpacing = state.contentBottom - (state.cursorY + neededSpacingBefore);
214553
214562
  if (fitsOnBlankPage && state.page.fragments.length > 0 && fullHeight > remainingHeightAfterSpacing) {
@@ -214593,7 +214602,9 @@ function layoutParagraphBlock(ctx$1, anchors) {
214593
214602
  effectiveColumnWidth = narrowestWidth;
214594
214603
  offsetX = narrowestOffsetX;
214595
214604
  }
214596
- const slice2 = sliceLines(lines, fromLine, state.contentBottom - state.cursorY);
214605
+ const borderVertical = borderExpansion.top + borderExpansion.bottom;
214606
+ const availableForSlice = Math.max(0, state.contentBottom - state.cursorY - borderVertical);
214607
+ const slice2 = sliceLines(lines, fromLine, availableForSlice);
214597
214608
  const fragmentHeight = slice2.height;
214598
214609
  const adjustedX = columnX(state.columnIndex) + offsetX + negativeLeftIndent;
214599
214610
  const adjustedWidth = effectiveColumnWidth - negativeLeftIndent - negativeRightIndent;
@@ -214603,7 +214614,7 @@ function layoutParagraphBlock(ctx$1, anchors) {
214603
214614
  fromLine,
214604
214615
  toLine: slice2.toLine,
214605
214616
  x: adjustedX,
214606
- y: state.cursorY,
214617
+ y: state.cursorY + borderExpansion.top,
214607
214618
  width: adjustedWidth,
214608
214619
  ...computeFragmentPmRange(block, lines, fromLine, slice2.toLine)
214609
214620
  };
@@ -214634,7 +214645,7 @@ function layoutParagraphBlock(ctx$1, anchors) {
214634
214645
  fragment2.x = columnX(state.columnIndex) + offsetX + (effectiveColumnWidth - maxLineWidth) / 2;
214635
214646
  }
214636
214647
  state.page.fragments.push(fragment2);
214637
- state.cursorY += fragmentHeight;
214648
+ state.cursorY += borderExpansion.top + fragmentHeight + borderExpansion.bottom;
214638
214649
  lastState = state;
214639
214650
  fromLine = slice2.toLine;
214640
214651
  }
@@ -214652,6 +214663,7 @@ function layoutParagraphBlock(ctx$1, anchors) {
214652
214663
  lastState.trailingSpacing = 0;
214653
214664
  lastState.lastParagraphStyleId = styleId;
214654
214665
  lastState.lastParagraphContextualSpacing = contextualSpacing;
214666
+ lastState.lastParagraphBorderHash = currentBorderHash;
214655
214667
  }
214656
214668
  }
214657
214669
  function layoutImageBlock({ block, measure, columns, ensurePage, advanceColumn, columnX }) {
@@ -240470,7 +240482,7 @@ var Node$13 = class Node$14 {
240470
240482
  if (frag.continuesOnNext)
240471
240483
  continue;
240472
240484
  const borders = getFragmentParagraphBorders(frag, blockLookup);
240473
- if (!borders?.between)
240485
+ if (!borders)
240474
240486
  continue;
240475
240487
  const next2 = fragments[i4 + 1];
240476
240488
  if (next2.kind !== "para" && next2.kind !== "list-item")
@@ -240482,7 +240494,7 @@ var Node$13 = class Node$14 {
240482
240494
  if (next2.blockId === frag.blockId && next2.kind === "list-item" && frag.kind === "list-item" && next2.itemId === frag.itemId)
240483
240495
  continue;
240484
240496
  const nextBorders = getFragmentParagraphBorders(next2, blockLookup);
240485
- if (!nextBorders?.between)
240497
+ if (!nextBorders)
240486
240498
  continue;
240487
240499
  if (hashParagraphBorders$1(borders) !== hashParagraphBorders$1(nextBorders))
240488
240500
  continue;
@@ -240523,7 +240535,7 @@ var Node$13 = class Node$14 {
240523
240535
  result.get(i4 + 1).suppressTopBorder = true;
240524
240536
  }
240525
240537
  return result;
240526
- }, PX_PER_PT$12, getParagraphBorderBox = (fragmentWidth, indent2) => {
240538
+ }, PX_PER_PT$2, getParagraphBorderBox = (fragmentWidth, indent2) => {
240527
240539
  const indentLeft = Number.isFinite(indent2?.left) ? indent2.left : 0;
240528
240540
  const indentRight = Number.isFinite(indent2?.right) ? indent2.right : 0;
240529
240541
  const firstLineOffset = (Number.isFinite(indent2?.firstLine) ? indent2.firstLine : 0) - (Number.isFinite(indent2?.hanging) ? indent2.hanging : 0);
@@ -240546,17 +240558,17 @@ var Node$13 = class Node$14 {
240546
240558
  const suppressBottom = betweenInfo?.suppressBottomBorder ?? false;
240547
240559
  const showBetween = betweenInfo?.showBetweenBorder ?? false;
240548
240560
  return {
240549
- top: suppressTop ? borders.between?.space ? borders.between.space * PX_PER_PT$12 : 0 : borders.top?.space ? borders.top.space * PX_PER_PT$12 : 0,
240550
- bottom: !suppressBottom && !showBetween && borders.bottom?.space ? borders.bottom.space * PX_PER_PT$12 : 0,
240551
- left: borders.left?.space ? borders.left.space * PX_PER_PT$12 : 0,
240552
- right: borders.right?.space ? borders.right.space * PX_PER_PT$12 : 0
240561
+ top: suppressTop ? borders.between?.space ? borders.between.space * PX_PER_PT$2 : 0 : borders.top?.space ? borders.top.space * PX_PER_PT$2 : 0,
240562
+ bottom: !suppressBottom && !showBetween && borders.bottom?.space ? borders.bottom.space * PX_PER_PT$2 : 0,
240563
+ left: borders.left?.space ? borders.left.space * PX_PER_PT$2 : 0,
240564
+ right: borders.right?.space ? borders.right.space * PX_PER_PT$2 : 0
240553
240565
  };
240554
240566
  }, createParagraphDecorationLayers = (doc$12, fragmentWidth, attrs, betweenInfo) => {
240555
240567
  if (!attrs?.borders && !attrs?.shading)
240556
240568
  return {};
240557
240569
  const borderBox = getParagraphBorderBox(fragmentWidth, attrs.indent);
240558
240570
  const space = computeBorderSpaceExpansion(attrs.borders, betweenInfo);
240559
- const betweenSpaceBelow = betweenInfo?.showBetweenBorder && attrs.borders?.between?.space ? attrs.borders.between.space * PX_PER_PT$12 : 0;
240571
+ const betweenSpaceBelow = betweenInfo?.showBetweenBorder && attrs.borders?.between?.space ? attrs.borders.between.space * PX_PER_PT$2 : 0;
240560
240572
  const rawGap = betweenInfo?.showBetweenBorder || betweenInfo?.suppressBottomBorder ? betweenInfo.gapBelow : 0;
240561
240573
  const gapExtension = Math.max(0, rawGap - betweenSpaceBelow);
240562
240574
  const bw = computeRenderedBorderWidths(attrs.borders, betweenInfo);
@@ -246346,7 +246358,7 @@ var Node$13 = class Node$14 {
246346
246358
  pmStart: start$1,
246347
246359
  pmEnd: (typeof attrs.pmEnd === "number" ? attrs.pmEnd : undefined) ?? (start$1 != null ? start$1 + 1 : undefined)
246348
246360
  };
246349
- }, getParagraphAttrs = (block) => {
246361
+ }, PX_PER_PT$12, getParagraphAttrs = (block) => {
246350
246362
  if (!block.attrs || typeof block.attrs !== "object")
246351
246363
  return;
246352
246364
  return block.attrs;
@@ -246366,6 +246378,21 @@ var Node$13 = class Node$14 {
246366
246378
  if (!Number.isFinite(value) || value < 0)
246367
246379
  return 0;
246368
246380
  return value;
246381
+ }, hashBorders = (borders) => {
246382
+ if (!borders)
246383
+ return;
246384
+ const side = (b$1) => b$1 ? `${b$1.style ?? ""},${b$1.width ?? 0},${b$1.color ?? ""},${b$1.space ?? 0}` : "";
246385
+ return `${side(borders.top)}|${side(borders.right)}|${side(borders.bottom)}|${side(borders.left)}|${side(borders.between)}`;
246386
+ }, computeBorderVerticalExpansion = (borders) => {
246387
+ if (!borders)
246388
+ return {
246389
+ top: 0,
246390
+ bottom: 0
246391
+ };
246392
+ return {
246393
+ top: (borders.top?.space ?? 0) * PX_PER_PT$12 + (borders.top?.width ?? 0),
246394
+ bottom: (borders.bottom?.space ?? 0) * PX_PER_PT$12 + (borders.bottom?.width ?? 0)
246395
+ };
246369
246396
  }, COLUMN_MIN_WIDTH_PX = 25, COLUMN_MAX_WIDTH_PX = 200, ROW_MIN_HEIGHT_PX = 10, MIN_PARTIAL_ROW_HEIGHT = 20, ROW_HEIGHT_EPSILON = 0.1, DEFAULT_BALANCING_CONFIG, getColumnWidthAt = (columns, columnIndex) => {
246370
246397
  if (Array.isArray(columns.widths) && columns.widths.length > 0)
246371
246398
  return columns.widths[Math.max(0, Math.min(columnIndex, columns.widths.length - 1))] ?? columns.width;
@@ -255285,7 +255312,7 @@ var Node$13 = class Node$14 {
255285
255312
  return;
255286
255313
  console.log(...args$1);
255287
255314
  }, 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;
255288
- var init_src_g1sb_ClT_es = __esm(() => {
255315
+ var init_src_CGUGTAQU_es = __esm(() => {
255289
255316
  init_rolldown_runtime_B2q5OVn9_es();
255290
255317
  init_SuperConverter_B9oNf3OB_es();
255291
255318
  init_jszip_ChlR43oI_es();
@@ -273568,7 +273595,7 @@ function print() { __p += __j.call(arguments, '') }
273568
273595
  outline-offset: 2px;
273569
273596
  }
273570
273597
  `;
273571
- PX_PER_PT$12 = 96 / 72;
273598
+ PX_PER_PT$2 = 96 / 72;
273572
273599
  BORDER_SIDES3 = [
273573
273600
  "top",
273574
273601
  "right",
@@ -284735,6 +284762,7 @@ function print() { __p += __j.call(arguments, '') }
284735
284762
  count: 1,
284736
284763
  gap: 0
284737
284764
  };
284765
+ PX_PER_PT$12 = 96 / 72;
284738
284766
  DEFAULT_BALANCING_CONFIG = {
284739
284767
  enabled: true,
284740
284768
  tolerance: 5,
@@ -289772,7 +289800,7 @@ var init_zipper_YmNpPIyc_es = __esm(() => {
289772
289800
 
289773
289801
  // ../../packages/superdoc/dist/super-editor.es.js
289774
289802
  var init_super_editor_es = __esm(() => {
289775
- init_src_g1sb_ClT_es();
289803
+ init_src_CGUGTAQU_es();
289776
289804
  init_SuperConverter_B9oNf3OB_es();
289777
289805
  init_jszip_ChlR43oI_es();
289778
289806
  init_xml_js_40FWvL78_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.5.0-next.33",
3
+ "version": "0.5.0-next.34",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -25,20 +25,20 @@
25
25
  "@types/ws": "^8.5.13",
26
26
  "typescript": "^5.9.2",
27
27
  "@superdoc/document-api": "0.0.1",
28
- "@superdoc/pm-adapter": "0.0.0",
29
28
  "@superdoc/super-editor": "0.0.1",
30
- "superdoc": "1.23.0"
29
+ "superdoc": "1.23.0",
30
+ "@superdoc/pm-adapter": "0.0.0"
31
31
  },
32
32
  "module": "src/index.ts",
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
36
  "optionalDependencies": {
37
- "@superdoc-dev/cli-darwin-arm64": "0.5.0-next.33",
38
- "@superdoc-dev/cli-linux-x64": "0.5.0-next.33",
39
- "@superdoc-dev/cli-darwin-x64": "0.5.0-next.33",
40
- "@superdoc-dev/cli-windows-x64": "0.5.0-next.33",
41
- "@superdoc-dev/cli-linux-arm64": "0.5.0-next.33"
37
+ "@superdoc-dev/cli-darwin-arm64": "0.5.0-next.34",
38
+ "@superdoc-dev/cli-linux-x64": "0.5.0-next.34",
39
+ "@superdoc-dev/cli-darwin-x64": "0.5.0-next.34",
40
+ "@superdoc-dev/cli-linux-arm64": "0.5.0-next.34",
41
+ "@superdoc-dev/cli-windows-x64": "0.5.0-next.34"
42
42
  },
43
43
  "scripts": {
44
44
  "predev": "node scripts/ensure-superdoc-build.js",