@superdoc-dev/cli 0.2.0-next.27 → 0.2.0-next.29

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 +82 -15
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -28319,7 +28319,7 @@ var init_remark_gfm_z_sDF4ss_es = __esm(() => {
28319
28319
  emptyOptions2 = {};
28320
28320
  });
28321
28321
 
28322
- // ../../packages/superdoc/dist/chunks/SuperConverter-DgeVIA0v.es.js
28322
+ // ../../packages/superdoc/dist/chunks/SuperConverter-DhpmwuUN.es.js
28323
28323
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
28324
28324
  const fieldValue = extension$1.config[field];
28325
28325
  if (typeof fieldValue === "function")
@@ -43072,6 +43072,19 @@ function importFootnotePropertiesFromSettings(docx, converter) {
43072
43072
  return;
43073
43073
  converter.footnoteProperties = parseFootnoteProperties(footnotePr, "settings");
43074
43074
  }
43075
+ function importViewSettingFromSettings(docx, converter) {
43076
+ if (!docx || !converter)
43077
+ return;
43078
+ converter.viewSetting = null;
43079
+ const settingsRoot = docx["word/settings.xml"]?.elements?.[0];
43080
+ const viewEl = (Array.isArray(settingsRoot?.elements) ? settingsRoot.elements : []).find((el) => el?.name === "w:view");
43081
+ if (!viewEl)
43082
+ return;
43083
+ converter.viewSetting = {
43084
+ val: viewEl.attributes?.["w:val"] ?? null,
43085
+ originalXml: carbonCopy(viewEl)
43086
+ };
43087
+ }
43075
43088
  function getDocumentStyles(node3, docx, converter, editor, numbering, translatedNumbering, translatedLinkedStyles) {
43076
43089
  const sectPr = node3.elements?.find((n) => n.name === "w:sectPr");
43077
43090
  const styles = {};
@@ -56809,6 +56822,7 @@ var isRegExp = (value) => {
56809
56822
  return null;
56810
56823
  if (converter) {
56811
56824
  importFootnotePropertiesFromSettings(docx, converter);
56825
+ importViewSettingFromSettings(docx, converter);
56812
56826
  converter.documentOrigin = detectDocumentOrigin(docx);
56813
56827
  converter.commentThreadingProfile = detectCommentThreadingProfile(docx);
56814
56828
  }
@@ -57652,6 +57666,25 @@ var isRegExp = (value) => {
57652
57666
  ...convertedXml,
57653
57667
  "word/settings.xml": updatedSettings
57654
57668
  };
57669
+ }, applyViewSettingToSettings = (converter, convertedXml) => {
57670
+ const viewSetting = converter?.viewSetting;
57671
+ if (!viewSetting?.originalXml)
57672
+ return convertedXml;
57673
+ const settingsXml = convertedXml["word/settings.xml"];
57674
+ if (!settingsXml?.elements?.[0])
57675
+ return convertedXml;
57676
+ const updatedSettings = carbonCopy(settingsXml);
57677
+ const updatedRoot = updatedSettings.elements?.[0];
57678
+ if (!updatedRoot)
57679
+ return convertedXml;
57680
+ const elements = Array.isArray(updatedRoot.elements) ? updatedRoot.elements : [];
57681
+ const idx = elements.findIndex((el) => el?.name === "w:view");
57682
+ elements.splice(idx !== -1 ? idx : 0, idx !== -1 ? 1 : 0, carbonCopy(viewSetting.originalXml));
57683
+ updatedRoot.elements = elements;
57684
+ return {
57685
+ ...convertedXml,
57686
+ "word/settings.xml": updatedSettings
57687
+ };
57655
57688
  }, buildFootnotesRelsXml = (converter, convertedXml, relationships) => {
57656
57689
  if (!relationships.length)
57657
57690
  return null;
@@ -57669,6 +57702,7 @@ var isRegExp = (value) => {
57669
57702
  };
57670
57703
  }, prepareFootnotesXmlForExport = ({ footnotes, editor, converter, convertedXml }) => {
57671
57704
  let updatedXml = applyFootnotePropertiesToSettings(converter, convertedXml);
57705
+ updatedXml = applyViewSettingToSettings(converter, updatedXml);
57672
57706
  if (!footnotes || !Array.isArray(footnotes) || footnotes.length === 0)
57673
57707
  return {
57674
57708
  updatedXml,
@@ -57756,7 +57790,7 @@ var isRegExp = (value) => {
57756
57790
  state.kern = kernNode.attributes["w:val"];
57757
57791
  }
57758
57792
  }, SuperConverter;
57759
- var init_SuperConverter_DgeVIA0v_es = __esm(() => {
57793
+ var init_SuperConverter_DhpmwuUN_es = __esm(() => {
57760
57794
  init_rolldown_runtime_B2q5OVn9_es();
57761
57795
  init_jszip_ChlR43oI_es();
57762
57796
  init_xml_js_DLE8mr0n_es();
@@ -74084,6 +74118,7 @@ var init_SuperConverter_DgeVIA0v_es = __esm(() => {
74084
74118
  this.comments = [];
74085
74119
  this.footnotes = [];
74086
74120
  this.footnoteProperties = null;
74121
+ this.viewSetting = null;
74087
74122
  this.inlineDocumentFonts = [];
74088
74123
  this.commentThreadingProfile = null;
74089
74124
  this.exportWarnings = [];
@@ -101168,9 +101203,9 @@ var init_remark_gfm_CQ3Jg4PR_es = __esm(() => {
101168
101203
  init_remark_gfm_z_sDF4ss_es();
101169
101204
  });
101170
101205
 
101171
- // ../../packages/superdoc/dist/chunks/src-DPtHGvLJ.es.js
101172
- var exports_src_DPtHGvLJ_es = {};
101173
- __export(exports_src_DPtHGvLJ_es, {
101206
+ // ../../packages/superdoc/dist/chunks/src-9mQYjRNT.es.js
101207
+ var exports_src_9mQYjRNT_es = {};
101208
+ __export(exports_src_9mQYjRNT_es, {
101174
101209
  zt: () => defineMark,
101175
101210
  z: () => cM,
101176
101211
  yt: () => removeAwarenessStates,
@@ -171383,9 +171418,9 @@ var Node$13 = class Node$14 {
171383
171418
  trackedChanges: context.trackedChanges ?? []
171384
171419
  });
171385
171420
  }, _hoisted_1$6, _hoisted_2$1, _hoisted_3, _hoisted_4, ContextMenu_default, _hoisted_1$5, BasicUpload_default, _hoisted_1$4, MIN_WIDTH = 200, PPI = 96, alignment = "flex-end", Ruler_default, GenericPopover_default, _hoisted_1$3, RESIZE_HANDLE_WIDTH_PX = 9, RESIZE_HANDLE_OFFSET_PX = 4, DRAG_OVERLAY_EXTENSION_PX = 1000, MIN_DRAG_OVERLAY_WIDTH_PX = 2000, THROTTLE_INTERVAL_MS = 16, MIN_RESIZE_DELTA_PX = 1, TableResizeOverlay_default, _hoisted_1$2, OVERLAY_EXPANSION_PX = 2000, RESIZE_HANDLE_SIZE_PX = 12, MOUSE_MOVE_THROTTLE_MS = 16, DIMENSION_CHANGE_THRESHOLD_PX = 1, Z_INDEX_OVERLAY = 10, Z_INDEX_HANDLE = 15, Z_INDEX_GUIDELINE = 20, ImageResizeOverlay_default, LINK_CLICK_DEBOUNCE_MS = 300, CURSOR_UPDATE_TIMEOUT_MS = 10, LinkClickHandler_default, _hoisted_1$1, _hoisted_2, DOCX2 = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", TABLE_RESIZE_HOVER_THRESHOLD = 8, TABLE_RESIZE_THROTTLE_MS = 16, SuperEditor_default, _hoisted_1, SuperInput_default, SlashMenu, Extensions;
171386
- var init_src_DPtHGvLJ_es = __esm(() => {
171421
+ var init_src_9mQYjRNT_es = __esm(() => {
171387
171422
  init_rolldown_runtime_B2q5OVn9_es();
171388
- init_SuperConverter_DgeVIA0v_es();
171423
+ init_SuperConverter_DhpmwuUN_es();
171389
171424
  init_jszip_ChlR43oI_es();
171390
171425
  init_uuid_2IzDu5nl_es();
171391
171426
  init_constants_Dw0kAsLd_es();
@@ -202118,8 +202153,8 @@ function print() { __p += __j.call(arguments, '') }
202118
202153
  return isObjectLike_default(value) && hasOwnProperty$8.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
202119
202154
  };
202120
202155
  stubFalse_default = stubFalse;
202121
- freeExports$2 = typeof exports_src_DPtHGvLJ_es == "object" && exports_src_DPtHGvLJ_es && !exports_src_DPtHGvLJ_es.nodeType && exports_src_DPtHGvLJ_es;
202122
- freeModule$2 = freeExports$2 && typeof module_src_DPtHGvLJ_es == "object" && module_src_DPtHGvLJ_es && !module_src_DPtHGvLJ_es.nodeType && module_src_DPtHGvLJ_es;
202156
+ freeExports$2 = typeof exports_src_9mQYjRNT_es == "object" && exports_src_9mQYjRNT_es && !exports_src_9mQYjRNT_es.nodeType && exports_src_9mQYjRNT_es;
202157
+ freeModule$2 = freeExports$2 && typeof module_src_9mQYjRNT_es == "object" && module_src_9mQYjRNT_es && !module_src_9mQYjRNT_es.nodeType && module_src_9mQYjRNT_es;
202123
202158
  Buffer$1 = freeModule$2 && freeModule$2.exports === freeExports$2 ? _root_default.Buffer : undefined;
202124
202159
  isBuffer_default = (Buffer$1 ? Buffer$1.isBuffer : undefined) || stubFalse_default;
202125
202160
  typedArrayTags = {};
@@ -202127,8 +202162,8 @@ function print() { __p += __j.call(arguments, '') }
202127
202162
  typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag] = typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag$1] = false;
202128
202163
  _baseIsTypedArray_default = baseIsTypedArray;
202129
202164
  _baseUnary_default = baseUnary;
202130
- freeExports$1 = typeof exports_src_DPtHGvLJ_es == "object" && exports_src_DPtHGvLJ_es && !exports_src_DPtHGvLJ_es.nodeType && exports_src_DPtHGvLJ_es;
202131
- freeModule$1 = freeExports$1 && typeof module_src_DPtHGvLJ_es == "object" && module_src_DPtHGvLJ_es && !module_src_DPtHGvLJ_es.nodeType && module_src_DPtHGvLJ_es;
202165
+ freeExports$1 = typeof exports_src_9mQYjRNT_es == "object" && exports_src_9mQYjRNT_es && !exports_src_9mQYjRNT_es.nodeType && exports_src_9mQYjRNT_es;
202166
+ freeModule$1 = freeExports$1 && typeof module_src_9mQYjRNT_es == "object" && module_src_9mQYjRNT_es && !module_src_9mQYjRNT_es.nodeType && module_src_9mQYjRNT_es;
202132
202167
  freeProcess = freeModule$1 && freeModule$1.exports === freeExports$1 && _freeGlobal_default.process;
202133
202168
  _nodeUtil_default = function() {
202134
202169
  try {
@@ -202233,8 +202268,8 @@ function print() { __p += __j.call(arguments, '') }
202233
202268
  Stack.prototype.has = _stackHas_default;
202234
202269
  Stack.prototype.set = _stackSet_default;
202235
202270
  _Stack_default = Stack;
202236
- freeExports = typeof exports_src_DPtHGvLJ_es == "object" && exports_src_DPtHGvLJ_es && !exports_src_DPtHGvLJ_es.nodeType && exports_src_DPtHGvLJ_es;
202237
- freeModule = freeExports && typeof module_src_DPtHGvLJ_es == "object" && module_src_DPtHGvLJ_es && !module_src_DPtHGvLJ_es.nodeType && module_src_DPtHGvLJ_es;
202271
+ freeExports = typeof exports_src_9mQYjRNT_es == "object" && exports_src_9mQYjRNT_es && !exports_src_9mQYjRNT_es.nodeType && exports_src_9mQYjRNT_es;
202272
+ freeModule = freeExports && typeof module_src_9mQYjRNT_es == "object" && module_src_9mQYjRNT_es && !module_src_9mQYjRNT_es.nodeType && module_src_9mQYjRNT_es;
202238
202273
  Buffer4 = freeModule && freeModule.exports === freeExports ? _root_default.Buffer : undefined;
202239
202274
  allocUnsafe = Buffer4 ? Buffer4.allocUnsafe : undefined;
202240
202275
  _cloneBuffer_default = cloneBuffer;
@@ -209886,8 +209921,8 @@ var init_zipper_Cnk_HjM2_es = __esm(() => {
209886
209921
 
209887
209922
  // ../../packages/superdoc/dist/super-editor.es.js
209888
209923
  var init_super_editor_es = __esm(() => {
209889
- init_src_DPtHGvLJ_es();
209890
- init_SuperConverter_DgeVIA0v_es();
209924
+ init_src_9mQYjRNT_es();
209925
+ init_SuperConverter_DhpmwuUN_es();
209891
209926
  init_jszip_ChlR43oI_es();
209892
209927
  init_xml_js_DLE8mr0n_es();
209893
209928
  init_constants_Dw0kAsLd_es();
@@ -258812,6 +258847,18 @@ function importFootnotePropertiesFromSettings2(docx, converter) {
258812
258847
  return;
258813
258848
  converter.footnoteProperties = parseFootnoteProperties2(footnotePr, "settings");
258814
258849
  }
258850
+ function importViewSettingFromSettings2(docx, converter) {
258851
+ if (!docx || !converter)
258852
+ return;
258853
+ converter.viewSetting = null;
258854
+ const settings = docx["word/settings.xml"];
258855
+ const settingsRoot = settings?.elements?.[0];
258856
+ const elements = Array.isArray(settingsRoot?.elements) ? settingsRoot.elements : [];
258857
+ const viewEl = elements.find((el) => el?.name === "w:view");
258858
+ if (!viewEl)
258859
+ return;
258860
+ converter.viewSetting = { val: viewEl.attributes?.["w:val"] ?? null, originalXml: carbonCopy2(viewEl) };
258861
+ }
258815
258862
  function getDocumentStyles2(node4, docx, converter, editor, numbering, translatedNumbering, translatedLinkedStyles) {
258816
258863
  const sectPr = node4.elements?.find((n) => n.name === "w:sectPr");
258817
258864
  const styles = {};
@@ -259330,6 +259377,7 @@ var detectDocumentOrigin2 = (docx) => {
259330
259377
  return null;
259331
259378
  if (converter) {
259332
259379
  importFootnotePropertiesFromSettings2(docx, converter);
259380
+ importViewSettingFromSettings2(docx, converter);
259333
259381
  converter.documentOrigin = detectDocumentOrigin2(docx);
259334
259382
  converter.commentThreadingProfile = detectCommentThreadingProfile2(docx);
259335
259383
  }
@@ -261699,6 +261747,23 @@ var RELS_XMLNS3 = "http://schemas.openxmlformats.org/package/2006/relationships"
261699
261747
  nextElements.push(carbonCopy2(props.originalXml));
261700
261748
  updatedRoot.elements = nextElements;
261701
261749
  return { ...convertedXml, "word/settings.xml": updatedSettings };
261750
+ }, applyViewSettingToSettings2 = (converter, convertedXml) => {
261751
+ const viewSetting = converter?.viewSetting;
261752
+ if (!viewSetting?.originalXml)
261753
+ return convertedXml;
261754
+ const settingsXml = convertedXml["word/settings.xml"];
261755
+ const settingsRoot = settingsXml?.elements?.[0];
261756
+ if (!settingsRoot)
261757
+ return convertedXml;
261758
+ const updatedSettings = carbonCopy2(settingsXml);
261759
+ const updatedRoot = updatedSettings.elements?.[0];
261760
+ if (!updatedRoot)
261761
+ return convertedXml;
261762
+ const elements = Array.isArray(updatedRoot.elements) ? updatedRoot.elements : [];
261763
+ const idx = elements.findIndex((el) => el?.name === "w:view");
261764
+ elements.splice(idx !== -1 ? idx : 0, idx !== -1 ? 1 : 0, carbonCopy2(viewSetting.originalXml));
261765
+ updatedRoot.elements = elements;
261766
+ return { ...convertedXml, "word/settings.xml": updatedSettings };
261702
261767
  }, buildFootnotesRelsXml2 = (converter, convertedXml, relationships) => {
261703
261768
  if (!relationships.length)
261704
261769
  return null;
@@ -261720,6 +261785,7 @@ var RELS_XMLNS3 = "http://schemas.openxmlformats.org/package/2006/relationships"
261720
261785
  return relsXml;
261721
261786
  }, prepareFootnotesXmlForExport2 = ({ footnotes, editor, converter, convertedXml }) => {
261722
261787
  let updatedXml = applyFootnotePropertiesToSettings2(converter, convertedXml);
261788
+ updatedXml = applyViewSettingToSettings2(converter, updatedXml);
261723
261789
  if (!footnotes || !Array.isArray(footnotes) || footnotes.length === 0) {
261724
261790
  return { updatedXml, relationships: [], media: {} };
261725
261791
  }
@@ -261924,6 +261990,7 @@ var init_SuperConverter = __esm(() => {
261924
261990
  this.comments = [];
261925
261991
  this.footnotes = [];
261926
261992
  this.footnoteProperties = null;
261993
+ this.viewSetting = null;
261927
261994
  this.inlineDocumentFonts = [];
261928
261995
  this.commentThreadingProfile = null;
261929
261996
  this.exportWarnings = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.2.0-next.27",
3
+ "version": "0.2.0-next.29",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -20,20 +20,20 @@
20
20
  "@types/node": "22.19.2",
21
21
  "typescript": "^5.9.2",
22
22
  "@superdoc/document-api": "0.0.1",
23
+ "@superdoc/super-editor": "0.0.1",
23
24
  "@superdoc/pm-adapter": "0.0.0",
24
- "superdoc": "1.16.0",
25
- "@superdoc/super-editor": "0.0.1"
25
+ "superdoc": "1.16.0"
26
26
  },
27
27
  "module": "src/index.ts",
28
28
  "publishConfig": {
29
29
  "access": "public"
30
30
  },
31
31
  "optionalDependencies": {
32
- "@superdoc-dev/cli-darwin-arm64": "0.2.0-next.27",
33
- "@superdoc-dev/cli-darwin-x64": "0.2.0-next.27",
34
- "@superdoc-dev/cli-linux-x64": "0.2.0-next.27",
35
- "@superdoc-dev/cli-linux-arm64": "0.2.0-next.27",
36
- "@superdoc-dev/cli-windows-x64": "0.2.0-next.27"
32
+ "@superdoc-dev/cli-darwin-arm64": "0.2.0-next.29",
33
+ "@superdoc-dev/cli-darwin-x64": "0.2.0-next.29",
34
+ "@superdoc-dev/cli-linux-x64": "0.2.0-next.29",
35
+ "@superdoc-dev/cli-windows-x64": "0.2.0-next.29",
36
+ "@superdoc-dev/cli-linux-arm64": "0.2.0-next.29"
37
37
  },
38
38
  "scripts": {
39
39
  "dev": "bun run src/index.ts",