@superdoc-dev/cli 0.7.0-next.25 → 0.7.0-next.26

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 +107 -28
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -65501,7 +65501,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
65501
65501
  emptyOptions2 = {};
65502
65502
  });
65503
65503
 
65504
- // ../../packages/superdoc/dist/chunks/SuperConverter-B4pTwmbr.es.js
65504
+ // ../../packages/superdoc/dist/chunks/SuperConverter-CpoUNyba.es.js
65505
65505
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
65506
65506
  const fieldValue = extension$1.config[field];
65507
65507
  if (typeof fieldValue === "function")
@@ -95578,6 +95578,9 @@ function parseColumnGap(gapTwips) {
95578
95578
  const gap = Number(gapTwips);
95579
95579
  return Number.isFinite(gap) ? gap / TWIPS_PER_INCH : DEFAULT_COLUMN_GAP_INCHES;
95580
95580
  }
95581
+ function parseColumnSeparator(rawValue) {
95582
+ return rawValue === "1" || rawValue === "true" || rawValue === "on" || rawValue === 1;
95583
+ }
95581
95584
  function extractNormalizedMargins(attrs) {
95582
95585
  const sectionMargins = attrs.sectionMargins;
95583
95586
  return {
@@ -95668,6 +95671,7 @@ function extractColumns(elements) {
95668
95671
  if (!cols?.attributes)
95669
95672
  return;
95670
95673
  const count2 = parseColumnCount(cols.attributes["w:num"]);
95674
+ const withSeparator = parseColumnSeparator(cols.attributes["w:sep"]);
95671
95675
  const equalWidthRaw = cols.attributes["w:equalWidth"];
95672
95676
  const equalWidth = equalWidthRaw === "0" || equalWidthRaw === 0 || equalWidthRaw === false ? false : equalWidthRaw === "1" || equalWidthRaw === 1 || equalWidthRaw === true ? true : undefined;
95673
95677
  const columnChildren = Array.isArray(cols.elements) ? cols.elements.filter((child) => child?.name === "w:col") : [];
@@ -95676,6 +95680,7 @@ function extractColumns(elements) {
95676
95680
  return {
95677
95681
  count: count2,
95678
95682
  gap: gapInches * PX_PER_INCH,
95683
+ withSeparator,
95679
95684
  ...widths.length > 0 ? { widths } : {},
95680
95685
  ...equalWidth !== undefined ? { equalWidth } : {}
95681
95686
  };
@@ -117250,7 +117255,7 @@ var isRegExp = (value) => {
117250
117255
  state.kern = kernNode.attributes["w:val"];
117251
117256
  }
117252
117257
  }, SuperConverter;
117253
- var init_SuperConverter_B4pTwmbr_es = __esm(() => {
117258
+ var init_SuperConverter_CpoUNyba_es = __esm(() => {
117254
117259
  init_rolldown_runtime_Bg48TavK_es();
117255
117260
  init_jszip_C49i9kUs_es();
117256
117261
  init_xml_js_CqGKpaft_es();
@@ -154530,7 +154535,7 @@ var init_SuperConverter_B4pTwmbr_es = __esm(() => {
154530
154535
  };
154531
154536
  });
154532
154537
 
154533
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-C636gY8A.es.js
154538
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-Dp1bWeQT.es.js
154534
154539
  function parseSizeUnit(val = "0") {
154535
154540
  const length3 = val.toString() || "0";
154536
154541
  const value = Number.parseFloat(length3);
@@ -157122,8 +157127,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
157122
157127
  }
157123
157128
  };
157124
157129
  };
157125
- var init_create_headless_toolbar_C636gY8A_es = __esm(() => {
157126
- init_SuperConverter_B4pTwmbr_es();
157130
+ var init_create_headless_toolbar_Dp1bWeQT_es = __esm(() => {
157131
+ init_SuperConverter_CpoUNyba_es();
157127
157132
  init_constants_CGhJRd87_es();
157128
157133
  init_dist_B8HfvhaK_es();
157129
157134
  CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
@@ -205567,7 +205572,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
205567
205572
  init_remark_gfm_BhnWr3yf_es();
205568
205573
  });
205569
205574
 
205570
- // ../../packages/superdoc/dist/chunks/src-DmdTSOpy.es.js
205575
+ // ../../packages/superdoc/dist/chunks/src-BMZqLwoU.es.js
205571
205576
  function deleteProps(obj, propOrProps) {
205572
205577
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
205573
205578
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -205979,7 +205984,8 @@ function cloneColumnLayout(columns) {
205979
205984
  count: columns.count,
205980
205985
  gap: columns.gap,
205981
205986
  ...Array.isArray(columns.widths) ? { widths: [...columns.widths] } : {},
205982
- ...columns.equalWidth !== undefined ? { equalWidth: columns.equalWidth } : {}
205987
+ ...columns.equalWidth !== undefined ? { equalWidth: columns.equalWidth } : {},
205988
+ ...columns.withSeparator !== undefined ? { withSeparator: columns.withSeparator } : {}
205983
205989
  } : {
205984
205990
  count: 1,
205985
205991
  gap: 0
@@ -206007,13 +206013,15 @@ function normalizeColumnLayout(input2, contentWidth, epsilon = 0.0001) {
206007
206013
  return {
206008
206014
  count: 1,
206009
206015
  gap: 0,
206010
- width: Math.max(0, contentWidth)
206016
+ width: Math.max(0, contentWidth),
206017
+ ...input2?.withSeparator !== undefined ? { withSeparator: input2.withSeparator } : {}
206011
206018
  };
206012
206019
  return {
206013
206020
  count: count2,
206014
206021
  gap,
206015
206022
  ...widths.length > 0 ? { widths } : {},
206016
206023
  ...input2?.equalWidth !== undefined ? { equalWidth: input2.equalWidth } : {},
206024
+ ...input2?.withSeparator !== undefined ? { withSeparator: input2.withSeparator } : {},
206017
206025
  width
206018
206026
  };
206019
206027
  }
@@ -248115,7 +248123,8 @@ function computeNextSectionPropsAtBreak(blocks2) {
248115
248123
  if (source.columns)
248116
248124
  props.columns = {
248117
248125
  count: source.columns.count,
248118
- gap: source.columns.gap
248126
+ gap: source.columns.gap,
248127
+ withSeparator: source.columns.withSeparator
248119
248128
  };
248120
248129
  if (source.orientation)
248121
248130
  props.orientation = source.orientation;
@@ -248136,8 +248145,8 @@ function getColumnConfig(blockColumns) {
248136
248145
  }
248137
248146
  function isColumnConfigChanging(blockColumns, activeColumns) {
248138
248147
  if (blockColumns)
248139
- return blockColumns.count !== activeColumns.count || blockColumns.gap !== activeColumns.gap || blockColumns.equalWidth !== activeColumns.equalWidth || !widthsEqual(blockColumns.widths, activeColumns.widths);
248140
- return activeColumns.count > 1;
248148
+ return blockColumns.count !== activeColumns.count || blockColumns.gap !== activeColumns.gap || Boolean(blockColumns.withSeparator) !== Boolean(activeColumns.withSeparator) || blockColumns.equalWidth !== activeColumns.equalWidth || !widthsEqual(blockColumns.widths, activeColumns.widths);
248149
+ return activeColumns.count > 1 || Boolean(activeColumns.withSeparator);
248141
248150
  }
248142
248151
  function scheduleSectionBreak(block, state, baseMargins, maxHeaderContentHeight = 0, maxFooterContentHeight = 0) {
248143
248152
  const next2 = { ...state };
@@ -250784,7 +250793,7 @@ function layoutDocument(blocks2, measures, options = {}) {
250784
250793
  if (block.orientation)
250785
250794
  next2.pendingOrientation = block.orientation;
250786
250795
  const sectionType = block.type ?? "continuous";
250787
- const isColumnsChanging = block.columns && (block.columns.count !== next2.activeColumns.count || block.columns.gap !== next2.activeColumns.gap || block.columns.equalWidth !== next2.activeColumns.equalWidth || !widthsEqual(block.columns.widths, next2.activeColumns.widths)) || !block.columns && next2.activeColumns.count > 1;
250796
+ const isColumnsChanging = block.columns && (block.columns.count !== next2.activeColumns.count || block.columns.gap !== next2.activeColumns.gap || Boolean(block.columns.withSeparator) !== Boolean(next2.activeColumns.withSeparator) || block.columns.equalWidth !== next2.activeColumns.equalWidth || !widthsEqual(block.columns.widths, next2.activeColumns.widths)) || !block.columns && (next2.activeColumns.count > 1 || Boolean(next2.activeColumns.withSeparator));
250788
250797
  const sectionIndexRaw = block.attrs?.sectionIndex;
250789
250798
  const metadataIndex = typeof sectionIndexRaw === "number" ? sectionIndexRaw : Number(sectionIndexRaw ?? NaN);
250790
250799
  if (Number.isFinite(metadataIndex))
@@ -250873,6 +250882,12 @@ function layoutDocument(blocks2, measures, options = {}) {
250873
250882
  page.size = pageSizeOverride;
250874
250883
  if (activeOrientation)
250875
250884
  page.orientation = activeOrientation;
250885
+ if (activeColumns.count > 1)
250886
+ page.columns = {
250887
+ count: activeColumns.count,
250888
+ gap: activeColumns.gap,
250889
+ withSeparator: activeColumns.withSeparator
250890
+ };
250876
250891
  if (activeVAlign && activeVAlign !== "top") {
250877
250892
  page.vAlign = activeVAlign;
250878
250893
  page.baseMargins = {
@@ -251744,12 +251759,38 @@ function layoutDocument(blocks2, measures, options = {}) {
251744
251759
  }
251745
251760
  }
251746
251761
  }
251762
+ for (const state of states) {
251763
+ const boundaries = state.constraintBoundaries;
251764
+ if (boundaries.length === 0)
251765
+ continue;
251766
+ const regions = [];
251767
+ const firstRegionColumns = state.page.columns ?? {
251768
+ count: 1,
251769
+ gap: 0
251770
+ };
251771
+ regions.push({
251772
+ yStart: state.topMargin,
251773
+ yEnd: boundaries[0].y,
251774
+ columns: firstRegionColumns
251775
+ });
251776
+ for (let i4 = 0;i4 < boundaries.length; i4++) {
251777
+ const start$1 = boundaries[i4];
251778
+ const end$1 = boundaries[i4 + 1];
251779
+ regions.push({
251780
+ yStart: start$1.y,
251781
+ yEnd: end$1 ? end$1.y : state.contentBottom,
251782
+ columns: start$1.columns
251783
+ });
251784
+ }
251785
+ state.page.columnRegions = regions;
251786
+ }
251747
251787
  return {
251748
251788
  pageSize,
251749
251789
  pages,
251750
251790
  columns: activeColumns.count > 1 ? {
251751
251791
  count: activeColumns.count,
251752
- gap: activeColumns.gap
251792
+ gap: activeColumns.gap,
251793
+ withSeparator: activeColumns.withSeparator
251753
251794
  } : undefined
251754
251795
  };
251755
251796
  }
@@ -253444,10 +253485,7 @@ async function incrementalLayout(previousBlocks, _previousLayout, nextBlocks, op
253444
253485
  const marginLeft = normalizeMargin(page.margins.left, normalizeMargin(options.margins?.left, DEFAULT_MARGINS$1.left));
253445
253486
  const marginRight = normalizeMargin(page.margins.right, normalizeMargin(options.margins?.right, DEFAULT_MARGINS$1.right));
253446
253487
  const pageContentWidth = pageSize.w - (marginLeft + marginRight);
253447
- const fallbackColumns = normalizeColumnsForFootnotes(options.columns ?? {
253448
- count: 1,
253449
- gap: 0
253450
- }, pageContentWidth);
253488
+ const fallbackColumns = normalizeColumnsForFootnotes(options.columns ?? SINGLE_COLUMN_DEFAULT, pageContentWidth);
253451
253489
  const columns = pageColumns$1.get(pageIndex) ?? {
253452
253490
  ...fallbackColumns,
253453
253491
  left: marginLeft,
@@ -255514,7 +255552,8 @@ function parseColumns(raw) {
255514
255552
  return;
255515
255553
  return {
255516
255554
  count: Math.max(1, Math.floor(rawCount)),
255517
- gap: inchesToPx(columnSource.space ?? columnSource.gap) ?? 0
255555
+ gap: inchesToPx(columnSource.space ?? columnSource.gap) ?? 0,
255556
+ withSeparator: typeof columnSource.withSeparator === "boolean" ? columnSource.withSeparator : false
255518
255557
  };
255519
255558
  }
255520
255559
  function createLayoutMetrics(perf, startMark, layout, blocks2) {
@@ -281916,10 +281955,7 @@ var Node$13 = class Node$14 {
281916
281955
  const marginRight = normalizeMargin(page.margins?.right, normalizeMargin(options.margins?.right, DEFAULT_MARGINS$1.right));
281917
281956
  const contentWidth = pageSize.w - (marginLeft + marginRight);
281918
281957
  const sectionIndex = page.sectionIndex ?? 0;
281919
- const normalized = normalizeColumnsForFootnotes(sectionColumns.get(sectionIndex) ?? options.columns ?? {
281920
- count: 1,
281921
- gap: 0
281922
- }, contentWidth);
281958
+ const normalized = normalizeColumnsForFootnotes(sectionColumns.get(sectionIndex) ?? options.columns ?? SINGLE_COLUMN_DEFAULT, contentWidth);
281923
281959
  result.set(pageIndex, {
281924
281960
  ...normalized,
281925
281961
  left: marginLeft,
@@ -289539,12 +289575,12 @@ var Node$13 = class Node$14 {
289539
289575
  return;
289540
289576
  console.log(...args$1);
289541
289577
  }, 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;
289542
- var init_src_DmdTSOpy_es = __esm(() => {
289578
+ var init_src_BMZqLwoU_es = __esm(() => {
289543
289579
  init_rolldown_runtime_Bg48TavK_es();
289544
- init_SuperConverter_B4pTwmbr_es();
289580
+ init_SuperConverter_CpoUNyba_es();
289545
289581
  init_jszip_C49i9kUs_es();
289546
289582
  init_uuid_qzgm05fK_es();
289547
- init_create_headless_toolbar_C636gY8A_es();
289583
+ init_create_headless_toolbar_Dp1bWeQT_es();
289548
289584
  init_constants_CGhJRd87_es();
289549
289585
  init_dist_B8HfvhaK_es();
289550
289586
  init_unified_Dsuw2be5_es();
@@ -315994,6 +316030,7 @@ function print() { __p += __j.call(arguments, '') }
315994
316030
  el.appendChild(this.renderFragment(fragment2, contextBase, sdtBoundary, betweenBorderFlags.get(index2), resolvedItem));
315995
316031
  });
315996
316032
  this.renderDecorationsForPage(el, page, pageIndex);
316033
+ this.renderColumnSeparators(el, page, width, height);
315997
316034
  return el;
315998
316035
  }
315999
316036
  renderPageRuler(pageWidthPx, page) {
@@ -316041,6 +316078,47 @@ function print() { __p += __j.call(arguments, '') }
316041
316078
  return null;
316042
316079
  }
316043
316080
  }
316081
+ renderColumnSeparators(pageEl, page, pageWidth, pageHeight) {
316082
+ if (!this.doc)
316083
+ return;
316084
+ if (!page.margins)
316085
+ return;
316086
+ const leftMargin = page.margins.left ?? 0;
316087
+ const rightMargin = page.margins.right ?? 0;
316088
+ const topMargin = page.margins.top ?? 0;
316089
+ const bottomMargin = page.margins.bottom ?? 0;
316090
+ const contentWidth = pageWidth - leftMargin - rightMargin;
316091
+ const regions = page.columnRegions ?? (page.columns ? [{
316092
+ yStart: topMargin,
316093
+ yEnd: pageHeight - bottomMargin,
316094
+ columns: page.columns
316095
+ }] : []);
316096
+ for (const region of regions) {
316097
+ const { columns, yStart, yEnd } = region;
316098
+ if (!columns.withSeparator)
316099
+ continue;
316100
+ if (columns.count <= 1)
316101
+ continue;
316102
+ const columnWidth = (contentWidth - columns.gap * (columns.count - 1)) / columns.count;
316103
+ if (columnWidth <= 1)
316104
+ continue;
316105
+ const regionHeight = yEnd - yStart;
316106
+ if (regionHeight <= 0)
316107
+ continue;
316108
+ for (let i4 = 0;i4 < columns.count - 1; i4++) {
316109
+ const separatorX = leftMargin + (i4 + 1) * columnWidth + i4 * columns.gap + columns.gap / 2;
316110
+ const separatorEl = this.doc.createElement("div");
316111
+ separatorEl.style.position = "absolute";
316112
+ separatorEl.style.left = `${separatorX}px`;
316113
+ separatorEl.style.top = `${yStart}px`;
316114
+ separatorEl.style.height = `${regionHeight}px`;
316115
+ separatorEl.style.width = "1px";
316116
+ separatorEl.style.backgroundColor = "#000000";
316117
+ separatorEl.style.pointerEvents = "none";
316118
+ pageEl.appendChild(separatorEl);
316119
+ }
316120
+ }
316121
+ }
316044
316122
  renderDecorationsForPage(pageEl, page, pageIndex) {
316045
316123
  if (this.isSemanticFlow)
316046
316124
  return;
@@ -316375,6 +316453,7 @@ function print() { __p += __j.call(arguments, '') }
316375
316453
  };
316376
316454
  });
316377
316455
  this.renderDecorationsForPage(el, page, pageIndex);
316456
+ this.renderColumnSeparators(el, page, pageSize.w, pageSize.h);
316378
316457
  return {
316379
316458
  element: el,
316380
316459
  fragments: fragmentStates
@@ -324316,11 +324395,11 @@ var init_zipper_DbkgrypV_es = __esm(() => {
324316
324395
 
324317
324396
  // ../../packages/superdoc/dist/super-editor.es.js
324318
324397
  var init_super_editor_es = __esm(() => {
324319
- init_src_DmdTSOpy_es();
324320
- init_SuperConverter_B4pTwmbr_es();
324398
+ init_src_BMZqLwoU_es();
324399
+ init_SuperConverter_CpoUNyba_es();
324321
324400
  init_jszip_C49i9kUs_es();
324322
324401
  init_xml_js_CqGKpaft_es();
324323
- init_create_headless_toolbar_C636gY8A_es();
324402
+ init_create_headless_toolbar_Dp1bWeQT_es();
324324
324403
  init_constants_CGhJRd87_es();
324325
324404
  init_dist_B8HfvhaK_es();
324326
324405
  init_unified_Dsuw2be5_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.7.0-next.25",
3
+ "version": "0.7.0-next.26",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -24,21 +24,21 @@
24
24
  "@types/node": "22.19.2",
25
25
  "@types/ws": "^8.5.13",
26
26
  "typescript": "^5.9.2",
27
- "@superdoc/pm-adapter": "0.0.0",
27
+ "@superdoc/document-api": "0.0.1",
28
28
  "@superdoc/super-editor": "0.0.1",
29
29
  "superdoc": "1.26.0",
30
- "@superdoc/document-api": "0.0.1"
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.7.0-next.25",
38
- "@superdoc-dev/cli-darwin-x64": "0.7.0-next.25",
39
- "@superdoc-dev/cli-linux-x64": "0.7.0-next.25",
40
- "@superdoc-dev/cli-linux-arm64": "0.7.0-next.25",
41
- "@superdoc-dev/cli-windows-x64": "0.7.0-next.25"
37
+ "@superdoc-dev/cli-darwin-arm64": "0.7.0-next.26",
38
+ "@superdoc-dev/cli-linux-x64": "0.7.0-next.26",
39
+ "@superdoc-dev/cli-darwin-x64": "0.7.0-next.26",
40
+ "@superdoc-dev/cli-windows-x64": "0.7.0-next.26",
41
+ "@superdoc-dev/cli-linux-arm64": "0.7.0-next.26"
42
42
  },
43
43
  "scripts": {
44
44
  "predev": "node scripts/ensure-superdoc-build.js",