@superdoc-dev/cli 0.7.0-next.38 → 0.7.0-next.39

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 +61 -33
  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-D8HLuwGQ.es.js
65504
+ // ../../packages/superdoc/dist/chunks/SuperConverter-BCKO82IW.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")
@@ -116403,12 +116403,19 @@ var isRegExp = (value) => {
116403
116403
  ...attributes ? { attributes } : {},
116404
116404
  elements: []
116405
116405
  };
116406
+ }, ST_ON_OFF_TRUE_VALUES, isStOnOffEnabled = (element) => {
116407
+ if (!element)
116408
+ return false;
116409
+ const rawValue = element.attributes?.["w:val"];
116410
+ if (rawValue == null)
116411
+ return true;
116412
+ return ST_ON_OFF_TRUE_VALUES.has(String(rawValue).trim().toLowerCase());
116406
116413
  }, isAlternatingHeadersOddEven = (docx) => {
116407
116414
  const settings = docx["word/settings.xml"];
116408
116415
  if (!settings || !settings.elements?.length)
116409
116416
  return false;
116410
116417
  const { elements = [] } = settings.elements[0];
116411
- return !!elements.find((el) => el.name === "w:evenAndOddHeaders");
116418
+ return isStOnOffEnabled(elements.find((el) => el.name === "w:evenAndOddHeaders"));
116412
116419
  }, FULL_WIDTH_PT = "468pt", FULL_WIDTH_PT_VALUE = 468, PX_PER_PT = 1.33, XML_NODE_NAME = "w:pict", SD_NODE_NAME, validXmlAttributes, config, translator$28, DEFAULT_SECTION_PROPS_TWIPS, ensureSectionLayoutDefaults = (sectPr, converter) => {
116413
116420
  if (!sectPr)
116414
116421
  return {
@@ -117269,7 +117276,7 @@ var isRegExp = (value) => {
117269
117276
  state.kern = kernNode.attributes["w:val"];
117270
117277
  }
117271
117278
  }, SuperConverter;
117272
- var init_SuperConverter_D8HLuwGQ_es = __esm(() => {
117279
+ var init_SuperConverter_BCKO82IW_es = __esm(() => {
117273
117280
  init_rolldown_runtime_Bg48TavK_es();
117274
117281
  init_jszip_C49i9kUs_es();
117275
117282
  init_xml_js_CqGKpaft_es();
@@ -153208,6 +153215,11 @@ var init_SuperConverter_D8HLuwGQ_es = __esm(() => {
153208
153215
  gutter: "0"
153209
153216
  })
153210
153217
  });
153218
+ ST_ON_OFF_TRUE_VALUES = new Set([
153219
+ "1",
153220
+ "true",
153221
+ "on"
153222
+ ]);
153211
153223
  SD_NODE_NAME = [
153212
153224
  "shapeContainer",
153213
153225
  "contentBlock",
@@ -154550,7 +154562,7 @@ var init_SuperConverter_D8HLuwGQ_es = __esm(() => {
154550
154562
  };
154551
154563
  });
154552
154564
 
154553
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-CbE9_87q.es.js
154565
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-BdA1QhS3.es.js
154554
154566
  function parseSizeUnit(val = "0") {
154555
154567
  const length3 = val.toString() || "0";
154556
154568
  const value = Number.parseFloat(length3);
@@ -157142,8 +157154,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
157142
157154
  }
157143
157155
  };
157144
157156
  };
157145
- var init_create_headless_toolbar_CbE9_87q_es = __esm(() => {
157146
- init_SuperConverter_D8HLuwGQ_es();
157157
+ var init_create_headless_toolbar_BdA1QhS3_es = __esm(() => {
157158
+ init_SuperConverter_BCKO82IW_es();
157147
157159
  init_constants_CGhJRd87_es();
157148
157160
  init_dist_B8HfvhaK_es();
157149
157161
  CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
@@ -205830,7 +205842,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
205830
205842
  init_remark_gfm_BhnWr3yf_es();
205831
205843
  });
205832
205844
 
205833
- // ../../packages/superdoc/dist/chunks/src-_aJt3Hgw.es.js
205845
+ // ../../packages/superdoc/dist/chunks/src-DnUVzELl.es.js
205834
205846
  function deleteProps(obj, propOrProps) {
205835
205847
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
205836
205848
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -248643,11 +248655,7 @@ function computeNextSectionPropsAtBreak(blocks2) {
248643
248655
  h: source.pageSize.h
248644
248656
  };
248645
248657
  if (source.columns)
248646
- props.columns = {
248647
- count: source.columns.count,
248648
- gap: source.columns.gap,
248649
- withSeparator: source.columns.withSeparator
248650
- };
248658
+ props.columns = snapshotColumns(source.columns);
248651
248659
  if (source.orientation)
248652
248660
  props.orientation = source.orientation;
248653
248661
  if (source.vAlign)
@@ -251419,11 +251427,7 @@ function layoutDocument(blocks2, measures, options = {}) {
251419
251427
  if (activeOrientation)
251420
251428
  page.orientation = activeOrientation;
251421
251429
  if (activeColumns.count > 1)
251422
- page.columns = {
251423
- count: activeColumns.count,
251424
- gap: activeColumns.gap,
251425
- withSeparator: activeColumns.withSeparator
251426
- };
251430
+ page.columns = cloneColumnLayout(activeColumns);
251427
251431
  if (activeVAlign && activeVAlign !== "top") {
251428
251432
  page.vAlign = activeVAlign;
251429
251433
  page.baseMargins = {
@@ -252332,11 +252336,7 @@ function layoutDocument(blocks2, measures, options = {}) {
252332
252336
  return {
252333
252337
  pageSize,
252334
252338
  pages,
252335
- columns: activeColumns.count > 1 ? {
252336
- count: activeColumns.count,
252337
- gap: activeColumns.gap,
252338
- withSeparator: activeColumns.withSeparator
252339
- } : undefined
252339
+ columns: activeColumns.count > 1 ? cloneColumnLayout(activeColumns) : undefined
252340
252340
  };
252341
252341
  }
252342
252342
  function computeFragmentBottom(fragment2, block, measure) {
@@ -281253,6 +281253,10 @@ menclose::after {
281253
281253
  #applyVirtualizationPins() {
281254
281254
  this.#painter?.setVirtualizationPins(this.#virtualizationPins);
281255
281255
  }
281256
+ }, snapshotColumns = (columns) => {
281257
+ if (!columns)
281258
+ return;
281259
+ return cloneColumnLayout(columns);
281256
281260
  }, SINGLE_COLUMN_DEFAULT, isTextRun$5 = (run2) => {
281257
281261
  const runWithKind = run2;
281258
281262
  return !runWithKind.kind || runWithKind.kind === "text";
@@ -290539,12 +290543,12 @@ menclose::after {
290539
290543
  return;
290540
290544
  console.log(...args$1);
290541
290545
  }, 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;
290542
- var init_src__aJt3Hgw_es = __esm(() => {
290546
+ var init_src_DnUVzELl_es = __esm(() => {
290543
290547
  init_rolldown_runtime_Bg48TavK_es();
290544
- init_SuperConverter_D8HLuwGQ_es();
290548
+ init_SuperConverter_BCKO82IW_es();
290545
290549
  init_jszip_C49i9kUs_es();
290546
290550
  init_uuid_qzgm05fK_es();
290547
- init_create_headless_toolbar_CbE9_87q_es();
290551
+ init_create_headless_toolbar_BdA1QhS3_es();
290548
290552
  init_constants_CGhJRd87_es();
290549
290553
  init_dist_B8HfvhaK_es();
290550
290554
  init_unified_Dsuw2be5_es();
@@ -317112,14 +317116,13 @@ function print() { __p += __j.call(arguments, '') }
317112
317116
  continue;
317113
317117
  if (columns.count <= 1)
317114
317118
  continue;
317115
- const columnWidth = (contentWidth - columns.gap * (columns.count - 1)) / columns.count;
317116
- if (columnWidth <= 1)
317117
- continue;
317118
317119
  const regionHeight = yEnd - yStart;
317119
317120
  if (regionHeight <= 0)
317120
317121
  continue;
317121
- for (let i4 = 0;i4 < columns.count - 1; i4++) {
317122
- const separatorX = leftMargin + (i4 + 1) * columnWidth + i4 * columns.gap + columns.gap / 2;
317122
+ const separatorPositions = this.getColumnSeparatorPositions(columns, leftMargin, contentWidth);
317123
+ if (separatorPositions.length === 0)
317124
+ continue;
317125
+ for (const separatorX of separatorPositions) {
317123
317126
  const separatorEl = this.doc.createElement("div");
317124
317127
  separatorEl.style.position = "absolute";
317125
317128
  separatorEl.style.left = `${separatorX}px`;
@@ -317132,6 +317135,31 @@ function print() { __p += __j.call(arguments, '') }
317132
317135
  }
317133
317136
  }
317134
317137
  }
317138
+ getColumnSeparatorPositions(columns, leftMargin, contentWidth) {
317139
+ if (!(Array.isArray(columns.widths) && columns.widths.length > 0)) {
317140
+ const equalWidth = (contentWidth - columns.gap * (columns.count - 1)) / columns.count;
317141
+ if (equalWidth <= 1)
317142
+ return [];
317143
+ const separatorPositions$1 = [];
317144
+ for (let index2 = 0;index2 < columns.count - 1; index2 += 1)
317145
+ separatorPositions$1.push(leftMargin + (index2 + 1) * equalWidth + index2 * columns.gap + columns.gap / 2);
317146
+ return separatorPositions$1;
317147
+ }
317148
+ const normalizedColumns = normalizeColumnLayout(columns, contentWidth);
317149
+ if (normalizedColumns.count <= 1)
317150
+ return [];
317151
+ const columnWidths = normalizedColumns.widths ?? Array.from({ length: normalizedColumns.count }, () => normalizedColumns.width);
317152
+ if (columnWidths.some((columnWidth) => columnWidth <= 1))
317153
+ return [];
317154
+ const separatorPositions = [];
317155
+ let cursorX = leftMargin;
317156
+ for (let index2 = 0;index2 < normalizedColumns.count - 1; index2 += 1) {
317157
+ const currentColumnWidth = columnWidths[index2] ?? normalizedColumns.width;
317158
+ separatorPositions.push(cursorX + currentColumnWidth + normalizedColumns.gap / 2);
317159
+ cursorX += currentColumnWidth + normalizedColumns.gap;
317160
+ }
317161
+ return separatorPositions;
317162
+ }
317135
317163
  renderDecorationsForPage(pageEl, page, pageIndex) {
317136
317164
  if (this.isSemanticFlow)
317137
317165
  return;
@@ -325413,11 +325441,11 @@ var init_zipper_DbkgrypV_es = __esm(() => {
325413
325441
 
325414
325442
  // ../../packages/superdoc/dist/super-editor.es.js
325415
325443
  var init_super_editor_es = __esm(() => {
325416
- init_src__aJt3Hgw_es();
325417
- init_SuperConverter_D8HLuwGQ_es();
325444
+ init_src_DnUVzELl_es();
325445
+ init_SuperConverter_BCKO82IW_es();
325418
325446
  init_jszip_C49i9kUs_es();
325419
325447
  init_xml_js_CqGKpaft_es();
325420
- init_create_headless_toolbar_CbE9_87q_es();
325448
+ init_create_headless_toolbar_BdA1QhS3_es();
325421
325449
  init_constants_CGhJRd87_es();
325422
325450
  init_dist_B8HfvhaK_es();
325423
325451
  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.38",
3
+ "version": "0.7.0-next.39",
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/super-editor": "0.0.1",
29
28
  "@superdoc/pm-adapter": "0.0.0",
30
- "superdoc": "1.26.0"
29
+ "superdoc": "1.26.0",
30
+ "@superdoc/super-editor": "0.0.1"
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.38",
38
- "@superdoc-dev/cli-darwin-x64": "0.7.0-next.38",
39
- "@superdoc-dev/cli-windows-x64": "0.7.0-next.38",
40
- "@superdoc-dev/cli-linux-x64": "0.7.0-next.38",
41
- "@superdoc-dev/cli-linux-arm64": "0.7.0-next.38"
37
+ "@superdoc-dev/cli-darwin-arm64": "0.7.0-next.39",
38
+ "@superdoc-dev/cli-darwin-x64": "0.7.0-next.39",
39
+ "@superdoc-dev/cli-linux-x64": "0.7.0-next.39",
40
+ "@superdoc-dev/cli-linux-arm64": "0.7.0-next.39",
41
+ "@superdoc-dev/cli-windows-x64": "0.7.0-next.39"
42
42
  },
43
43
  "scripts": {
44
44
  "predev": "node scripts/ensure-superdoc-build.js",