@superdoc-dev/cli 0.8.0-next.12 → 0.8.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 +62 -43
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -65535,7 +65535,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
65535
65535
  emptyOptions2 = {};
65536
65536
  });
65537
65537
 
65538
- // ../../packages/superdoc/dist/chunks/SuperConverter-D54XfHFt.es.js
65538
+ // ../../packages/superdoc/dist/chunks/SuperConverter-aq0iFjuQ.es.js
65539
65539
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
65540
65540
  const fieldValue = extension$1.config[field];
65541
65541
  if (typeof fieldValue === "function")
@@ -95925,6 +95925,19 @@ function shouldRequirePageBoundary(current, next) {
95925
95925
  function hasIntrinsicBoundarySignals(_) {
95926
95926
  return false;
95927
95927
  }
95928
+ function emitPendingSectionBreakForParagraph(args2) {
95929
+ const { sectionState, nextBlockId, blocks, recordBlockKind } = args2;
95930
+ if (!sectionState || sectionState.ranges.length === 0)
95931
+ return;
95932
+ const nextSection = sectionState.ranges[sectionState.currentSectionIndex + 1];
95933
+ if (!nextSection || sectionState.currentParagraphIndex !== nextSection.startParagraphIndex)
95934
+ return;
95935
+ const currentSection = sectionState.ranges[sectionState.currentSectionIndex];
95936
+ const sectionBreak = createSectionBreakBlock(nextSection, nextBlockId, shouldRequirePageBoundary(currentSection, nextSection) || hasIntrinsicBoundarySignals(nextSection) ? { requirePageBoundary: true } : undefined);
95937
+ blocks.push(sectionBreak);
95938
+ recordBlockKind?.(sectionBreak.kind);
95939
+ sectionState.currentSectionIndex++;
95940
+ }
95928
95941
  function shouldIgnoreSectionBreak(paragraph2, index2, total, hasBodySectPr) {
95929
95942
  const paragraphAttrs = paragraph2.attrs ?? {};
95930
95943
  const sectPr = paragraphAttrs?.paragraphProperties?.sectPr;
@@ -95968,7 +95981,7 @@ function findParagraphsWithSectPr(doc$2) {
95968
95981
  paragraphIndex++;
95969
95982
  return;
95970
95983
  }
95971
- if (node3.type === "index" || node3.type === "bibliography" || node3.type === "tableOfAuthorities")
95984
+ if (node3.type === "index" || node3.type === "bibliography" || node3.type === "tableOfAuthorities" || node3.type === "documentPartObject" || node3.type === "tableOfContents")
95972
95985
  getNodeChildren(node3).forEach(visitNode);
95973
95986
  };
95974
95987
  if (doc$2.content)
@@ -117730,7 +117743,7 @@ var isRegExp = (value) => {
117730
117743
  state.kern = kernNode.attributes["w:val"];
117731
117744
  }
117732
117745
  }, SuperConverter;
117733
- var init_SuperConverter_D54XfHFt_es = __esm(() => {
117746
+ var init_SuperConverter_aq0iFjuQ_es = __esm(() => {
117734
117747
  init_rolldown_runtime_Bg48TavK_es();
117735
117748
  init_jszip_C49i9kUs_es();
117736
117749
  init_xml_js_CqGKpaft_es();
@@ -155146,7 +155159,7 @@ var init_SuperConverter_D54XfHFt_es = __esm(() => {
155146
155159
  };
155147
155160
  });
155148
155161
 
155149
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-DrE9IMiD.es.js
155162
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-bhnvM7MP.es.js
155150
155163
  function parseSizeUnit(val = "0") {
155151
155164
  const length3 = val.toString() || "0";
155152
155165
  const value = Number.parseFloat(length3);
@@ -157738,8 +157751,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
157738
157751
  }
157739
157752
  };
157740
157753
  };
157741
- var init_create_headless_toolbar_DrE9IMiD_es = __esm(() => {
157742
- init_SuperConverter_D54XfHFt_es();
157754
+ var init_create_headless_toolbar_bhnvM7MP_es = __esm(() => {
157755
+ init_SuperConverter_aq0iFjuQ_es();
157743
157756
  init_constants_CGhJRd87_es();
157744
157757
  init_dist_B8HfvhaK_es();
157745
157758
  CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
@@ -206426,7 +206439,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
206426
206439
  init_remark_gfm_BhnWr3yf_es();
206427
206440
  });
206428
206441
 
206429
- // ../../packages/superdoc/dist/chunks/src-BFNW1Ck5.es.js
206442
+ // ../../packages/superdoc/dist/chunks/src-1sL7dd0v.es.js
206430
206443
  function deleteProps(obj, propOrProps) {
206431
206444
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
206432
206445
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -258736,7 +258749,7 @@ function applyTocMetadata(blocks2, metadata) {
258736
258749
  if (!block.attrs)
258737
258750
  block.attrs = {};
258738
258751
  block.attrs.isTocEntry = true;
258739
- if (!block.attrs.sdt)
258752
+ if (!block.attrs.sdt && metadata.gallery)
258740
258753
  block.attrs.sdt = {
258741
258754
  type: "docPartObject",
258742
258755
  gallery: metadata.gallery,
@@ -258754,6 +258767,12 @@ function processTocChildren(children, metadata, context, outputArrays) {
258754
258767
  const { blocks: blocks2, recordBlockKind } = outputArrays;
258755
258768
  children.forEach((child) => {
258756
258769
  if (child.type === "paragraph") {
258770
+ emitPendingSectionBreakForParagraph({
258771
+ sectionState: context.sectionState,
258772
+ nextBlockId: context.nextBlockId,
258773
+ blocks: blocks2,
258774
+ recordBlockKind
258775
+ });
258757
258776
  const paragraphBlocks = paragraphConverter({
258758
258777
  para: child,
258759
258778
  nextBlockId: context.nextBlockId,
@@ -258761,6 +258780,7 @@ function processTocChildren(children, metadata, context, outputArrays) {
258761
258780
  trackedChangesConfig: context.trackedChangesConfig,
258762
258781
  bookmarks: context.bookmarks,
258763
258782
  hyperlinkConfig: context.hyperlinkConfig,
258783
+ themeColors: context.themeColors,
258764
258784
  converters: context.converters,
258765
258785
  enableComments: context.enableComments,
258766
258786
  converterContext: context.converterContext
@@ -258775,6 +258795,8 @@ function processTocChildren(children, metadata, context, outputArrays) {
258775
258795
  blocks2.push(block);
258776
258796
  recordBlockKind?.(block.kind);
258777
258797
  });
258798
+ if (context.sectionState)
258799
+ context.sectionState.currentParagraphIndex++;
258778
258800
  } else if (child.type === "tableOfContents" && Array.isArray(child.content)) {
258779
258801
  const finalInstruction = getNodeInstruction(child) ?? tocInstruction;
258780
258802
  processTocChildren(child.content, {
@@ -258789,33 +258811,20 @@ function processTocChildren(children, metadata, context, outputArrays) {
258789
258811
  function handleTableOfContentsNode(node3, context) {
258790
258812
  if (!Array.isArray(node3.content))
258791
258813
  return;
258792
- const { blocks: blocks2, recordBlockKind, nextBlockId, positions, trackedChangesConfig, bookmarks, hyperlinkConfig, converters: converters$1, converterContext, themeColors, enableComments } = context;
258793
- const tocInstruction = getNodeInstruction(node3);
258794
- const paragraphToFlowBlocks$1 = converters$1.paragraphToFlowBlocks;
258795
- node3.content.forEach((child) => {
258796
- if (child.type === "paragraph")
258797
- paragraphToFlowBlocks$1({
258798
- para: child,
258799
- nextBlockId,
258800
- positions,
258801
- trackedChangesConfig,
258802
- bookmarks,
258803
- themeColors,
258804
- hyperlinkConfig,
258805
- converters: converters$1,
258806
- enableComments,
258807
- converterContext
258808
- }).forEach((block) => {
258809
- if (block.kind === "paragraph") {
258810
- if (!block.attrs)
258811
- block.attrs = {};
258812
- block.attrs.isTocEntry = true;
258813
- if (tocInstruction)
258814
- block.attrs.tocInstruction = tocInstruction;
258815
- }
258816
- blocks2.push(block);
258817
- recordBlockKind?.(block.kind);
258818
- });
258814
+ processTocChildren(node3.content, { tocInstruction: getNodeInstruction(node3) }, {
258815
+ nextBlockId: context.nextBlockId,
258816
+ positions: context.positions,
258817
+ bookmarks: context.bookmarks,
258818
+ trackedChangesConfig: context.trackedChangesConfig,
258819
+ hyperlinkConfig: context.hyperlinkConfig,
258820
+ enableComments: context.enableComments,
258821
+ themeColors: context.themeColors,
258822
+ converters: context.converters,
258823
+ converterContext: context.converterContext,
258824
+ sectionState: context.sectionState
258825
+ }, {
258826
+ blocks: context.blocks,
258827
+ recordBlockKind: context.recordBlockKind
258819
258828
  });
258820
258829
  }
258821
258830
  function handleIndexNode(node3, context) {
@@ -259071,7 +259080,7 @@ function handleDocumentSectionNode2(node3, context) {
259071
259080
  function handleDocumentPartObjectNode(node3, context) {
259072
259081
  if (!Array.isArray(node3.content))
259073
259082
  return;
259074
- const { blocks: blocks2, recordBlockKind, nextBlockId, positions, bookmarks, hyperlinkConfig, converters: converters$1, converterContext, enableComments, trackedChangesConfig, themeColors } = context;
259083
+ const { blocks: blocks2, recordBlockKind, nextBlockId, positions, bookmarks, hyperlinkConfig, sectionState, converters: converters$1, converterContext, enableComments, trackedChangesConfig, themeColors } = context;
259075
259084
  const docPartGallery = getDocPartGallery(node3);
259076
259085
  const docPartObjectId = getDocPartObjectId(node3);
259077
259086
  const tocInstruction = getNodeInstruction(node3);
@@ -259090,8 +259099,10 @@ function handleDocumentPartObjectNode(node3, context) {
259090
259099
  hyperlinkConfig,
259091
259100
  enableComments,
259092
259101
  trackedChangesConfig,
259102
+ themeColors,
259093
259103
  converters: converters$1,
259094
- converterContext
259104
+ converterContext,
259105
+ sectionState
259095
259106
  }, {
259096
259107
  blocks: blocks2,
259097
259108
  recordBlockKind
@@ -259099,6 +259110,12 @@ function handleDocumentPartObjectNode(node3, context) {
259099
259110
  else if (paragraphToFlowBlocks$1) {
259100
259111
  for (const child of node3.content)
259101
259112
  if (child.type === "paragraph") {
259113
+ emitPendingSectionBreakForParagraph({
259114
+ sectionState,
259115
+ nextBlockId,
259116
+ blocks: blocks2,
259117
+ recordBlockKind
259118
+ });
259102
259119
  const childBlocks = paragraphToFlowBlocks$1({
259103
259120
  para: child,
259104
259121
  nextBlockId,
@@ -259115,6 +259132,8 @@ function handleDocumentPartObjectNode(node3, context) {
259115
259132
  blocks2.push(block);
259116
259133
  recordBlockKind?.(block.kind);
259117
259134
  }
259135
+ if (sectionState)
259136
+ sectionState.currentParagraphIndex++;
259118
259137
  }
259119
259138
  }
259120
259139
  }
@@ -293606,12 +293625,12 @@ menclose::after {
293606
293625
  return;
293607
293626
  console.log(...args$1);
293608
293627
  }, 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;
293609
- var init_src_BFNW1Ck5_es = __esm(() => {
293628
+ var init_src_1sL7dd0v_es = __esm(() => {
293610
293629
  init_rolldown_runtime_Bg48TavK_es();
293611
- init_SuperConverter_D54XfHFt_es();
293630
+ init_SuperConverter_aq0iFjuQ_es();
293612
293631
  init_jszip_C49i9kUs_es();
293613
293632
  init_uuid_qzgm05fK_es();
293614
- init_create_headless_toolbar_DrE9IMiD_es();
293633
+ init_create_headless_toolbar_bhnvM7MP_es();
293615
293634
  init_constants_CGhJRd87_es();
293616
293635
  init_dist_B8HfvhaK_es();
293617
293636
  init_unified_Dsuw2be5_es();
@@ -329639,11 +329658,11 @@ var init_zipper_DbkgrypV_es = __esm(() => {
329639
329658
 
329640
329659
  // ../../packages/superdoc/dist/super-editor.es.js
329641
329660
  var init_super_editor_es = __esm(() => {
329642
- init_src_BFNW1Ck5_es();
329643
- init_SuperConverter_D54XfHFt_es();
329661
+ init_src_1sL7dd0v_es();
329662
+ init_SuperConverter_aq0iFjuQ_es();
329644
329663
  init_jszip_C49i9kUs_es();
329645
329664
  init_xml_js_CqGKpaft_es();
329646
- init_create_headless_toolbar_DrE9IMiD_es();
329665
+ init_create_headless_toolbar_bhnvM7MP_es();
329647
329666
  init_constants_CGhJRd87_es();
329648
329667
  init_dist_B8HfvhaK_es();
329649
329668
  init_unified_Dsuw2be5_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.8.0-next.12",
3
+ "version": "0.8.0-next.13",
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",
28
+ "@superdoc/pm-adapter": "0.0.0",
29
29
  "superdoc": "1.28.0",
30
- "@superdoc/pm-adapter": "0.0.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.8.0-next.12",
38
- "@superdoc-dev/cli-darwin-x64": "0.8.0-next.12",
39
- "@superdoc-dev/cli-linux-x64": "0.8.0-next.12",
40
- "@superdoc-dev/cli-linux-arm64": "0.8.0-next.12",
41
- "@superdoc-dev/cli-windows-x64": "0.8.0-next.12"
37
+ "@superdoc-dev/cli-darwin-arm64": "0.8.0-next.13",
38
+ "@superdoc-dev/cli-darwin-x64": "0.8.0-next.13",
39
+ "@superdoc-dev/cli-linux-arm64": "0.8.0-next.13",
40
+ "@superdoc-dev/cli-windows-x64": "0.8.0-next.13",
41
+ "@superdoc-dev/cli-linux-x64": "0.8.0-next.13"
42
42
  },
43
43
  "scripts": {
44
44
  "predev": "node scripts/ensure-superdoc-build.js",