@superdoc-dev/cli 0.17.0-next.12 → 0.17.0-next.13

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 +58 -28
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -68327,7 +68327,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
68327
68327
  emptyOptions2 = {};
68328
68328
  });
68329
68329
 
68330
- // ../../packages/superdoc/dist/chunks/SuperConverter-DLdwVEPh.es.js
68330
+ // ../../packages/superdoc/dist/chunks/SuperConverter-d9QeIy9-.es.js
68331
68331
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
68332
68332
  const fieldValue = extension$1.config[field];
68333
68333
  if (typeof fieldValue === "function")
@@ -83894,16 +83894,31 @@ function preProcessXeInstruction(nodesToCombine, instrText, options = {}) {
83894
83894
  }];
83895
83895
  }
83896
83896
  function preProcessTcInstruction(nodesToCombine, instrText, options = {}) {
83897
+ const before2 = [];
83898
+ const after2 = [];
83899
+ const entryElements = [];
83897
83900
  const instructionTokens = options.instructionTokens ?? null;
83898
- return [{
83899
- name: "sd:tableOfContentsEntry",
83900
- type: "element",
83901
- attributes: {
83902
- instruction: instrText,
83903
- ...instructionTokens ? { instructionTokens } : {}
83901
+ let seenContent = false;
83902
+ for (const node3 of nodesToCombine)
83903
+ if (node3?.name === "w:bookmarkStart" || node3?.name === "w:bookmarkEnd")
83904
+ (seenContent ? after2 : before2).push(node3);
83905
+ else {
83906
+ seenContent = true;
83907
+ entryElements.push(node3);
83908
+ }
83909
+ return [
83910
+ ...before2,
83911
+ {
83912
+ name: "sd:tableOfContentsEntry",
83913
+ type: "element",
83914
+ attributes: {
83915
+ instruction: instrText,
83916
+ ...instructionTokens ? { instructionTokens } : {}
83917
+ },
83918
+ elements: entryElements
83904
83919
  },
83905
- elements: nodesToCombine
83906
- }];
83920
+ ...after2
83921
+ ];
83907
83922
  }
83908
83923
  function preProcessRefInstruction(nodesToCombine, instrText, options = {}) {
83909
83924
  return [{
@@ -134312,7 +134327,7 @@ var isRegExp = (value) => {
134312
134327
  state.kern = kernNode.attributes["w:val"];
134313
134328
  }
134314
134329
  }, SuperConverter;
134315
- var init_SuperConverter_DLdwVEPh_es = __esm(() => {
134330
+ var init_SuperConverter_d9QeIy9_es = __esm(() => {
134316
134331
  init_rolldown_runtime_Bg48TavK_es();
134317
134332
  init_jszip_C49i9kUs_es();
134318
134333
  init_xml_js_CqGKpaft_es();
@@ -174432,7 +174447,7 @@ var init_SuperConverter_DLdwVEPh_es = __esm(() => {
174432
174447
  };
174433
174448
  });
174434
174449
 
174435
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-BxKMAAgQ.es.js
174450
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-l5QB6sQY.es.js
174436
174451
  function parseSizeUnit(val = "0") {
174437
174452
  const length3 = val.toString() || "0";
174438
174453
  const value = Number.parseFloat(length3);
@@ -184790,8 +184805,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
184790
184805
  }
184791
184806
  };
184792
184807
  };
184793
- var init_create_headless_toolbar_BxKMAAgQ_es = __esm(() => {
184794
- init_SuperConverter_DLdwVEPh_es();
184808
+ var init_create_headless_toolbar_l5QB6sQY_es = __esm(() => {
184809
+ init_SuperConverter_d9QeIy9_es();
184795
184810
  init_uuid_B2wVPhPi_es();
184796
184811
  init_constants_D9qj59G2_es();
184797
184812
  init_dist_B8HfvhaK_es();
@@ -233954,7 +233969,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
233954
233969
  init_remark_gfm_BhnWr3yf_es();
233955
233970
  });
233956
233971
 
233957
- // ../../packages/superdoc/dist/chunks/src-Bq_Yxqun.es.js
233972
+ // ../../packages/superdoc/dist/chunks/src-LeQVnrcZ.es.js
233958
233973
  function deleteProps(obj, propOrProps) {
233959
233974
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
233960
233975
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -288914,6 +288929,9 @@ async function goToAnchor({ anchor, layout, blocks: blocks2, measures, bookmarks
288914
288929
  let nextFragmentPage = null;
288915
288930
  let nextFragmentStart = null;
288916
288931
  let nextFragmentY = null;
288932
+ let prevFragmentPage = null;
288933
+ let prevFragmentEnd = null;
288934
+ let prevFragmentY = null;
288917
288935
  for (const page of layout.pages) {
288918
288936
  for (const fragment2 of page.fragments) {
288919
288937
  if (fragment2.kind !== "para")
@@ -288932,13 +288950,25 @@ async function goToAnchor({ anchor, layout, blocks: blocks2, measures, bookmarks
288932
288950
  nextFragmentStart = fragStart;
288933
288951
  nextFragmentY = fragment2.y;
288934
288952
  }
288953
+ if (fragEnd <= pmPos && (prevFragmentEnd === null || fragEnd > prevFragmentEnd)) {
288954
+ prevFragmentPage = page.number - 1;
288955
+ prevFragmentEnd = fragEnd;
288956
+ prevFragmentY = fragment2.y;
288957
+ }
288935
288958
  }
288936
288959
  if (pageIndex != null)
288937
288960
  break;
288938
288961
  }
288939
- if (pageIndex == null && nextFragmentPage != null) {
288940
- pageIndex = nextFragmentPage;
288941
- fragmentY = nextFragmentY;
288962
+ if (pageIndex == null) {
288963
+ const prevGap = prevFragmentEnd != null ? pmPos - prevFragmentEnd : Infinity;
288964
+ const nextGap = nextFragmentStart != null ? nextFragmentStart - pmPos : Infinity;
288965
+ if (prevFragmentPage != null && prevGap < nextGap) {
288966
+ pageIndex = prevFragmentPage;
288967
+ fragmentY = prevFragmentY;
288968
+ } else if (nextFragmentPage != null) {
288969
+ pageIndex = nextFragmentPage;
288970
+ fragmentY = nextFragmentY;
288971
+ }
288942
288972
  }
288943
288973
  }
288944
288974
  if (pageIndex == null)
@@ -331545,13 +331575,13 @@ menclose::after {
331545
331575
  return;
331546
331576
  console.log(...args$1);
331547
331577
  }, 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, TRACKED_MARK_NAMES;
331548
- var init_src_Bq_Yxqun_es = __esm(() => {
331578
+ var init_src_LeQVnrcZ_es = __esm(() => {
331549
331579
  init_rolldown_runtime_Bg48TavK_es();
331550
- init_SuperConverter_DLdwVEPh_es();
331580
+ init_SuperConverter_d9QeIy9_es();
331551
331581
  init_jszip_C49i9kUs_es();
331552
331582
  init_xml_js_CqGKpaft_es();
331553
331583
  init_uuid_B2wVPhPi_es();
331554
- init_create_headless_toolbar_BxKMAAgQ_es();
331584
+ init_create_headless_toolbar_l5QB6sQY_es();
331555
331585
  init_constants_D9qj59G2_es();
331556
331586
  init_dist_B8HfvhaK_es();
331557
331587
  init_unified_Dsuw2be5_es();
@@ -366516,11 +366546,11 @@ function print() { __p += __j.call(arguments, '') }
366516
366546
  ]);
366517
366547
  });
366518
366548
 
366519
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-gS4xi9O7.es.js
366549
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-uuXftA9o.es.js
366520
366550
  var headlessToolbarConstants, MOD_ALIASES, ALT_ALIASES, CTRL_ALIASES, SHIFT_ALIASES, BUILTIN_CONTEXT_MENU_GROUPS, BUILTIN_GROUP_ORDER, RESERVED_PROXY_PROPERTY_NAMES, ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS;
366521
- var init_create_super_doc_ui_gS4xi9O7_es = __esm(() => {
366522
- init_SuperConverter_DLdwVEPh_es();
366523
- init_create_headless_toolbar_BxKMAAgQ_es();
366551
+ var init_create_super_doc_ui_uuXftA9o_es = __esm(() => {
366552
+ init_SuperConverter_d9QeIy9_es();
366553
+ init_create_headless_toolbar_l5QB6sQY_es();
366524
366554
  headlessToolbarConstants = {
366525
366555
  DEFAULT_TEXT_ALIGN_OPTIONS: [
366526
366556
  {
@@ -366802,16 +366832,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
366802
366832
 
366803
366833
  // ../../packages/superdoc/dist/super-editor.es.js
366804
366834
  var init_super_editor_es = __esm(() => {
366805
- init_src_Bq_Yxqun_es();
366806
- init_SuperConverter_DLdwVEPh_es();
366835
+ init_src_LeQVnrcZ_es();
366836
+ init_SuperConverter_d9QeIy9_es();
366807
366837
  init_jszip_C49i9kUs_es();
366808
366838
  init_xml_js_CqGKpaft_es();
366809
- init_create_headless_toolbar_BxKMAAgQ_es();
366839
+ init_create_headless_toolbar_l5QB6sQY_es();
366810
366840
  init_constants_D9qj59G2_es();
366811
366841
  init_dist_B8HfvhaK_es();
366812
366842
  init_unified_Dsuw2be5_es();
366813
366843
  init_DocxZipper_FUsfThjV_es();
366814
- init_create_super_doc_ui_gS4xi9O7_es();
366844
+ init_create_super_doc_ui_uuXftA9o_es();
366815
366845
  init_ui_C5PAS9hY_es();
366816
366846
  init_eventemitter3_BnGqBE_Q_es();
366817
366847
  init_errors_CNaD6vcg_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.17.0-next.12",
3
+ "version": "0.17.0-next.13",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -33,11 +33,11 @@
33
33
  "access": "public"
34
34
  },
35
35
  "optionalDependencies": {
36
- "@superdoc-dev/cli-darwin-arm64": "0.17.0-next.12",
37
- "@superdoc-dev/cli-darwin-x64": "0.17.0-next.12",
38
- "@superdoc-dev/cli-linux-x64": "0.17.0-next.12",
39
- "@superdoc-dev/cli-linux-arm64": "0.17.0-next.12",
40
- "@superdoc-dev/cli-windows-x64": "0.17.0-next.12"
36
+ "@superdoc-dev/cli-darwin-arm64": "0.17.0-next.13",
37
+ "@superdoc-dev/cli-darwin-x64": "0.17.0-next.13",
38
+ "@superdoc-dev/cli-linux-x64": "0.17.0-next.13",
39
+ "@superdoc-dev/cli-linux-arm64": "0.17.0-next.13",
40
+ "@superdoc-dev/cli-windows-x64": "0.17.0-next.13"
41
41
  },
42
42
  "scripts": {
43
43
  "predev": "node scripts/ensure-superdoc-build.js",