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

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 +64 -22
  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-XIzWLug0.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);
@@ -241879,7 +241891,7 @@ var Node$13 = class Node$14 {
241879
241891
  }
241880
241892
  element3.style.textAlign = resolveTextAlign(attrs?.alignment, rtl);
241881
241893
  return rtl;
241882
- }, shouldUseSegmentPositioning = (hasExplicitPositioning, hasSegments, isRtl) => hasExplicitPositioning && hasSegments && !isRtl, MATHML_NS$2 = "http://www.w3.org/1998/Math/MathML", OPERATOR_CHARS, convertMathRun = (node3, doc$12) => {
241894
+ }, shouldUseSegmentPositioning = (hasExplicitPositioning, hasSegments, isRtl) => hasExplicitPositioning && hasSegments && !isRtl, MATHML_NS$3 = "http://www.w3.org/1998/Math/MathML", OPERATOR_CHARS, convertMathRun = (node3, doc$12) => {
241883
241895
  const elements = node3.elements ?? [];
241884
241896
  let text5 = "";
241885
241897
  for (const child of elements)
@@ -241893,19 +241905,33 @@ var Node$13 = class Node$14 {
241893
241905
  return null;
241894
241906
  const isNormalText = elements.find((el$1) => el$1.name === "m:rPr")?.elements?.some((el$1) => el$1.name === "m:nor") ?? false;
241895
241907
  const tag = classifyMathText(text5);
241896
- const el = doc$12.createElementNS(MATHML_NS$2, tag);
241908
+ const el = doc$12.createElementNS(MATHML_NS$3, tag);
241897
241909
  el.textContent = text5;
241898
241910
  if (tag === "mi" && isNormalText)
241899
241911
  el.setAttribute("mathvariant", "normal");
241900
241912
  return el;
241901
- }, MATHML_NS$1 = "http://www.w3.org/1998/Math/MathML", convertFraction = (node3, doc$12, convertChildren) => {
241913
+ }, MATHML_NS$2 = "http://www.w3.org/1998/Math/MathML", convertFraction = (node3, doc$12, convertChildren) => {
241902
241914
  const elements = node3.elements ?? [];
241903
241915
  const num = elements.find((e) => e.name === "m:num");
241904
241916
  const den = elements.find((e) => e.name === "m:den");
241905
- const frac = doc$12.createElementNS(MATHML_NS$1, "mfrac");
241917
+ const frac = doc$12.createElementNS(MATHML_NS$2, "mfrac");
241906
241918
  frac.appendChild(convertChildren(num?.elements ?? []));
241907
241919
  frac.appendChild(convertChildren(den?.elements ?? []));
241908
241920
  return frac;
241921
+ }, MATHML_NS$1 = "http://www.w3.org/1998/Math/MathML", convertBar = (node3, doc$12, convertChildren) => {
241922
+ const elements = node3.elements ?? [];
241923
+ const isUnder = elements.find((e) => e.name === "m:barPr")?.elements?.find((e) => e.name === "m:pos")?.attributes?.["m:val"] !== "top";
241924
+ const base5 = elements.find((e) => e.name === "m:e");
241925
+ const wrapper = doc$12.createElementNS(MATHML_NS$1, isUnder ? "munder" : "mover");
241926
+ const baseContent = convertChildren(base5?.elements ?? []);
241927
+ const mrow = doc$12.createElementNS(MATHML_NS$1, "mrow");
241928
+ mrow.appendChild(baseContent);
241929
+ wrapper.appendChild(mrow);
241930
+ const accent = doc$12.createElementNS(MATHML_NS$1, "mo");
241931
+ accent.setAttribute("stretchy", "true");
241932
+ accent.textContent = isUnder ? "̲" : "‾";
241933
+ wrapper.appendChild(accent);
241934
+ return wrapper;
241909
241935
  }, MATHML_NS = "http://www.w3.org/1998/Math/MathML", MATH_OBJECT_REGISTRY, ARGUMENT_ELEMENTS, cssToken = (varName, fallback) => ({
241910
241936
  css: `var(${varName}, ${fallback})`,
241911
241937
  fallback
@@ -246346,7 +246372,7 @@ var Node$13 = class Node$14 {
246346
246372
  pmStart: start$1,
246347
246373
  pmEnd: (typeof attrs.pmEnd === "number" ? attrs.pmEnd : undefined) ?? (start$1 != null ? start$1 + 1 : undefined)
246348
246374
  };
246349
- }, getParagraphAttrs = (block) => {
246375
+ }, PX_PER_PT$12, getParagraphAttrs = (block) => {
246350
246376
  if (!block.attrs || typeof block.attrs !== "object")
246351
246377
  return;
246352
246378
  return block.attrs;
@@ -246366,6 +246392,21 @@ var Node$13 = class Node$14 {
246366
246392
  if (!Number.isFinite(value) || value < 0)
246367
246393
  return 0;
246368
246394
  return value;
246395
+ }, hashBorders = (borders) => {
246396
+ if (!borders)
246397
+ return;
246398
+ const side = (b$1) => b$1 ? `${b$1.style ?? ""},${b$1.width ?? 0},${b$1.color ?? ""},${b$1.space ?? 0}` : "";
246399
+ return `${side(borders.top)}|${side(borders.right)}|${side(borders.bottom)}|${side(borders.left)}|${side(borders.between)}`;
246400
+ }, computeBorderVerticalExpansion = (borders) => {
246401
+ if (!borders)
246402
+ return {
246403
+ top: 0,
246404
+ bottom: 0
246405
+ };
246406
+ return {
246407
+ top: (borders.top?.space ?? 0) * PX_PER_PT$12 + (borders.top?.width ?? 0),
246408
+ bottom: (borders.bottom?.space ?? 0) * PX_PER_PT$12 + (borders.bottom?.width ?? 0)
246409
+ };
246369
246410
  }, 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
246411
  if (Array.isArray(columns.widths) && columns.widths.length > 0)
246371
246412
  return columns.widths[Math.max(0, Math.min(columnIndex, columns.widths.length - 1))] ?? columns.width;
@@ -255285,7 +255326,7 @@ var Node$13 = class Node$14 {
255285
255326
  return;
255286
255327
  console.log(...args$1);
255287
255328
  }, 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(() => {
255329
+ var init_src_XIzWLug0_es = __esm(() => {
255289
255330
  init_rolldown_runtime_B2q5OVn9_es();
255290
255331
  init_SuperConverter_B9oNf3OB_es();
255291
255332
  init_jszip_ChlR43oI_es();
@@ -273568,7 +273609,7 @@ function print() { __p += __j.call(arguments, '') }
273568
273609
  outline-offset: 2px;
273569
273610
  }
273570
273611
  `;
273571
- PX_PER_PT$12 = 96 / 72;
273612
+ PX_PER_PT$2 = 96 / 72;
273572
273613
  BORDER_SIDES3 = [
273573
273614
  "top",
273574
273615
  "right",
@@ -273653,8 +273694,8 @@ function print() { __p += __j.call(arguments, '') }
273653
273694
  ]);
273654
273695
  MATH_OBJECT_REGISTRY = {
273655
273696
  "m:r": convertMathRun,
273697
+ "m:bar": convertBar,
273656
273698
  "m:acc": null,
273657
- "m:bar": null,
273658
273699
  "m:borderBox": null,
273659
273700
  "m:box": null,
273660
273701
  "m:d": null,
@@ -284735,6 +284776,7 @@ function print() { __p += __j.call(arguments, '') }
284735
284776
  count: 1,
284736
284777
  gap: 0
284737
284778
  };
284779
+ PX_PER_PT$12 = 96 / 72;
284738
284780
  DEFAULT_BALANCING_CONFIG = {
284739
284781
  enabled: true,
284740
284782
  tolerance: 5,
@@ -289772,7 +289814,7 @@ var init_zipper_YmNpPIyc_es = __esm(() => {
289772
289814
 
289773
289815
  // ../../packages/superdoc/dist/super-editor.es.js
289774
289816
  var init_super_editor_es = __esm(() => {
289775
- init_src_g1sb_ClT_es();
289817
+ init_src_XIzWLug0_es();
289776
289818
  init_SuperConverter_B9oNf3OB_es();
289777
289819
  init_jszip_ChlR43oI_es();
289778
289820
  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.35",
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.35",
38
+ "@superdoc-dev/cli-darwin-x64": "0.5.0-next.35",
39
+ "@superdoc-dev/cli-linux-x64": "0.5.0-next.35",
40
+ "@superdoc-dev/cli-windows-x64": "0.5.0-next.35",
41
+ "@superdoc-dev/cli-linux-arm64": "0.5.0-next.35"
42
42
  },
43
43
  "scripts": {
44
44
  "predev": "node scripts/ensure-superdoc-build.js",