superdoc 1.0.0-beta.28 → 1.0.0-beta.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 (28) hide show
  1. package/dist/chunks/{PdfViewer-B7Hq0aBG.cjs → PdfViewer-DWBkw4lb.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-5NaTJwvl.es.js → PdfViewer-tNr66QJz.es.js} +1 -1
  3. package/dist/chunks/{index-CLV7-rJY-i5JVHTCR.es.js → index-C-fdgXvG-CG001xE6.es.js} +1 -1
  4. package/dist/chunks/{index-CLV7-rJY-C4coR32S.cjs → index-C-fdgXvG-CIkJMNA_.cjs} +1 -1
  5. package/dist/chunks/{index-W4KMCYbF.es.js → index-C6yeAWhT.es.js} +3 -4
  6. package/dist/chunks/{index-CQPftiv3.cjs → index-DDwDzZCu.cjs} +3 -4
  7. package/dist/chunks/{super-editor.es-DR7G4vGz.cjs → super-editor.es-CbWugsqL.cjs} +200 -61
  8. package/dist/chunks/{super-editor.es-D4MMQONw.es.js → super-editor.es-DUQSn16o.es.js} +200 -61
  9. package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
  10. package/dist/super-editor/ai-writer.es.js +2 -2
  11. package/dist/super-editor/chunks/{converter-DCpgxLLA.js → converter-GXPldmlh.js} +1 -1
  12. package/dist/super-editor/chunks/{docx-zipper-BvQShjmj.js → docx-zipper-D7QUJRNp.js} +1 -1
  13. package/dist/super-editor/chunks/{editor-Df43-j5L.js → editor-DaDga3Ye.js} +201 -62
  14. package/dist/super-editor/chunks/{index-CLV7-rJY.js → index-C-fdgXvG.js} +1 -1
  15. package/dist/super-editor/chunks/{toolbar-DCnKrmbU.js → toolbar-DjueghNO.js} +2 -2
  16. package/dist/super-editor/converter.es.js +1 -1
  17. package/dist/super-editor/docx-zipper.es.js +2 -2
  18. package/dist/super-editor/editor.es.js +3 -3
  19. package/dist/super-editor/file-zipper.es.js +1 -1
  20. package/dist/super-editor/super-editor.es.js +6 -6
  21. package/dist/super-editor/toolbar.es.js +2 -2
  22. package/dist/super-editor.cjs +1 -1
  23. package/dist/super-editor.es.js +1 -1
  24. package/dist/superdoc.cjs +2 -2
  25. package/dist/superdoc.es.js +2 -2
  26. package/dist/superdoc.umd.js +202 -64
  27. package/dist/superdoc.umd.js.map +1 -1
  28. package/package.json +1 -1
@@ -41841,7 +41841,7 @@ const _SuperConverter = class _SuperConverter2 {
41841
41841
  static getStoredSuperdocVersion(docx) {
41842
41842
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
41843
41843
  }
41844
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.28") {
41844
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.29") {
41845
41845
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
41846
41846
  }
41847
41847
  /**
@@ -59014,7 +59014,7 @@ const isHeadless = (editor) => {
59014
59014
  const shouldSkipNodeView = (editor) => {
59015
59015
  return isHeadless(editor);
59016
59016
  };
59017
- const summaryVersion = "1.0.0-beta.28";
59017
+ const summaryVersion = "1.0.0-beta.29";
59018
59018
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
59019
59019
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
59020
59020
  function mapAttributes(attrs) {
@@ -59803,7 +59803,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
59803
59803
  { default: remarkStringify },
59804
59804
  { default: remarkGfm }
59805
59805
  ] = await Promise.all([
59806
- import("./index-CLV7-rJY-i5JVHTCR.es.js"),
59806
+ import("./index-C-fdgXvG-CG001xE6.es.js"),
59807
59807
  import("./index-DRCvimau-Cw339678.es.js"),
59808
59808
  import("./index-C_x_N6Uh-DJn8hIEt.es.js"),
59809
59809
  import("./index-D_sWOSiG-DE96TaT5.es.js"),
@@ -60008,7 +60008,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60008
60008
  * Process collaboration migrations
60009
60009
  */
60010
60010
  processCollaborationMigrations() {
60011
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.28");
60011
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.29");
60012
60012
  if (!this.options.ydoc) return;
60013
60013
  const metaMap = this.options.ydoc.getMap("meta");
60014
60014
  let docVersion = metaMap.get("version");
@@ -60877,7 +60877,8 @@ function publishSectionMetadata(sectionRanges, options) {
60877
60877
  sectionIndex: section.sectionIndex,
60878
60878
  headerRefs: section.headerRefs,
60879
60879
  footerRefs: section.footerRefs,
60880
- numbering: section.numbering
60880
+ numbering: section.numbering,
60881
+ titlePg: section.titlePg
60881
60882
  });
60882
60883
  });
60883
60884
  }
@@ -62036,6 +62037,7 @@ const DEFAULT_HYPERLINK_CONFIG = {
62036
62037
  enableRichHyperlinks: false
62037
62038
  };
62038
62039
  const applyMarksToRun = (run2, marks, hyperlinkConfig = DEFAULT_HYPERLINK_CONFIG, themeColors) => {
62040
+ const isTabRun2 = run2.kind === "tab";
62039
62041
  marks.forEach((mark) => {
62040
62042
  const forwardedDataAttrs = extractDataAttributes(mark.attrs);
62041
62043
  try {
@@ -62068,11 +62070,15 @@ const applyMarksToRun = (run2, marks, hyperlinkConfig = DEFAULT_HYPERLINK_CONFIG
62068
62070
  break;
62069
62071
  }
62070
62072
  case "textStyle":
62071
- applyTextStyleMark(run2, mark.attrs ?? {}, themeColors);
62073
+ if (!isTabRun2) {
62074
+ applyTextStyleMark(run2, mark.attrs ?? {}, themeColors);
62075
+ }
62072
62076
  break;
62073
62077
  case "commentMark":
62074
62078
  case "comment": {
62075
- pushCommentAnnotation(run2, mark.attrs ?? {});
62079
+ if (!isTabRun2) {
62080
+ pushCommentAnnotation(run2, mark.attrs ?? {});
62081
+ }
62076
62082
  break;
62077
62083
  }
62078
62084
  case "underline": {
@@ -62099,31 +62105,33 @@ const applyMarksToRun = (run2, marks, hyperlinkConfig = DEFAULT_HYPERLINK_CONFIG
62099
62105
  run2.highlight = resolveColorFromAttributes(mark.attrs ?? {}, themeColors);
62100
62106
  break;
62101
62107
  case "link": {
62102
- const attrs = mark.attrs ?? {};
62103
- if (hyperlinkConfig.enableRichHyperlinks) {
62104
- try {
62105
- const link = buildFlowRunLink(attrs);
62106
- if (link) {
62107
- run2.link = link;
62108
- }
62109
- } catch (error) {
62110
- if (process$1$1.env.NODE_ENV === "development") {
62111
- console.warn("[PM-Adapter] Failed to build rich hyperlink:", error);
62112
- }
62113
- }
62114
- } else if (typeof attrs.href === "string" && attrs.href.trim()) {
62115
- try {
62116
- const sanitized = sanitizeHref(attrs.href);
62117
- if (sanitized && sanitized.href) {
62118
- const legacyLink = {
62119
- href: sanitized.href,
62120
- title: typeof attrs.title === "string" ? attrs.title : void 0
62121
- };
62122
- run2.link = migrateLegacyLink(legacyLink);
62108
+ if (!isTabRun2) {
62109
+ const attrs = mark.attrs ?? {};
62110
+ if (hyperlinkConfig.enableRichHyperlinks) {
62111
+ try {
62112
+ const link = buildFlowRunLink(attrs);
62113
+ if (link) {
62114
+ run2.link = link;
62115
+ }
62116
+ } catch (error) {
62117
+ if (process$1$1.env.NODE_ENV === "development") {
62118
+ console.warn("[PM-Adapter] Failed to build rich hyperlink:", error);
62119
+ }
62123
62120
  }
62124
- } catch (error) {
62125
- if (process$1$1.env.NODE_ENV === "development") {
62126
- console.warn("[PM-Adapter] Failed to sanitize link href:", error);
62121
+ } else if (typeof attrs.href === "string" && attrs.href.trim()) {
62122
+ try {
62123
+ const sanitized = sanitizeHref(attrs.href);
62124
+ if (sanitized && sanitized.href) {
62125
+ const legacyLink = {
62126
+ href: sanitized.href,
62127
+ title: typeof attrs.title === "string" ? attrs.title : void 0
62128
+ };
62129
+ run2.link = migrateLegacyLink(legacyLink);
62130
+ }
62131
+ } catch (error) {
62132
+ if (process$1$1.env.NODE_ENV === "development") {
62133
+ console.warn("[PM-Adapter] Failed to sanitize link href:", error);
62134
+ }
62127
62135
  }
62128
62136
  }
62129
62137
  }
@@ -62137,7 +62145,7 @@ const applyMarksToRun = (run2, marks, hyperlinkConfig = DEFAULT_HYPERLINK_CONFIG
62137
62145
  console.warn(`[PM-Adapter] Failed to apply mark ${mark.type}:`, error);
62138
62146
  }
62139
62147
  }
62140
- if (forwardedDataAttrs) {
62148
+ if (forwardedDataAttrs && !isTabRun2) {
62141
62149
  run2.dataAttrs = { ...run2.dataAttrs ?? {}, ...forwardedDataAttrs };
62142
62150
  }
62143
62151
  });
@@ -62159,14 +62167,14 @@ function textNodeToRun(textNode, positions, defaultFont, defaultSize, inheritedM
62159
62167
  }
62160
62168
  return run2;
62161
62169
  }
62162
- function tabNodeToRun(node, positions, tabIndex, paragraph) {
62170
+ function tabNodeToRun(node, positions, tabIndex, paragraph, inheritedMarks = []) {
62163
62171
  const pos = positions.get(node);
62164
62172
  if (!pos) return null;
62165
62173
  const paragraphAttrs = paragraph.attrs ?? {};
62166
62174
  const paragraphProps = typeof paragraphAttrs.paragraphProperties === "object" && paragraphAttrs.paragraphProperties !== null ? paragraphAttrs.paragraphProperties : {};
62167
62175
  const tabStops = Array.isArray(paragraphAttrs.tabStops) && paragraphAttrs.tabStops.length ? paragraphAttrs.tabStops : Array.isArray(paragraphProps.tabStops) ? paragraphProps.tabStops : void 0;
62168
62176
  const indent = paragraphAttrs.indent ?? paragraphProps.indent ?? void 0;
62169
- return {
62177
+ const run2 = {
62170
62178
  kind: "tab",
62171
62179
  text: " ",
62172
62180
  pmStart: pos.start,
@@ -62176,6 +62184,11 @@ function tabNodeToRun(node, positions, tabIndex, paragraph) {
62176
62184
  indent,
62177
62185
  leader: node.attrs?.leader ?? null
62178
62186
  };
62187
+ const marks = [...node.marks ?? [], ...inheritedMarks ?? []];
62188
+ if (marks.length > 0) {
62189
+ applyMarksToRun(run2, marks);
62190
+ }
62191
+ return run2;
62179
62192
  }
62180
62193
  function tokenNodeToRun(node, positions, defaultFont, defaultSize, inheritedMarks = [], token, hyperlinkConfig = DEFAULT_HYPERLINK_CONFIG$1, themeColors) {
62181
62194
  const run2 = {
@@ -64002,9 +64015,26 @@ const hydrateParagraphStyleAttrs = (para, context, preResolved) => {
64002
64015
  if (isHeadingStyle && (!resolvedIndent || Object.keys(resolvedIndent).length === 0 || onlyFirstLineIndent)) {
64003
64016
  resolvedIndent = { firstLine: 0, hanging: 0, left: resolvedIndent?.left, right: resolvedIndent?.right };
64004
64017
  }
64018
+ let resolvedSpacing = cloneIfObject(resolvedAsRecord.spacing);
64019
+ const tableStyleParagraphProps = context.tableStyleParagraphProps;
64020
+ if (tableStyleParagraphProps?.spacing) {
64021
+ const tableSpacing = tableStyleParagraphProps.spacing;
64022
+ const paragraphHasExplicitSpacing = Boolean(spacing);
64023
+ if (!paragraphHasExplicitSpacing) {
64024
+ resolvedSpacing = {
64025
+ ...resolvedSpacing,
64026
+ ...tableSpacing
64027
+ };
64028
+ } else {
64029
+ resolvedSpacing = {
64030
+ ...tableSpacing,
64031
+ ...resolvedSpacing
64032
+ };
64033
+ }
64034
+ }
64005
64035
  const hydrated = {
64006
64036
  resolved,
64007
- spacing: cloneIfObject(resolvedAsRecord.spacing),
64037
+ spacing: resolvedSpacing,
64008
64038
  indent: resolvedIndent,
64009
64039
  borders: cloneIfObject(resolvedExtended.borders),
64010
64040
  shading: cloneIfObject(resolvedExtended.shading),
@@ -64903,11 +64933,12 @@ const computeParagraphAttrs = (para, styleContext, listCounterContext, converter
64903
64933
  }
64904
64934
  }
64905
64935
  paragraphAttrs.wordLayout = wordLayout;
64906
- if (enrichedNumberingProps.resolvedLevelIndent && !hasExplicitIndent) {
64936
+ if (enrichedNumberingProps.resolvedLevelIndent) {
64907
64937
  const resolvedIndentPx = convertIndentTwipsToPx(enrichedNumberingProps.resolvedLevelIndent);
64938
+ const baseIndent = resolvedIndentPx ?? enrichedNumberingProps.resolvedLevelIndent;
64908
64939
  paragraphAttrs.indent = {
64909
- ...paragraphAttrs.indent,
64910
- ...resolvedIndentPx ?? enrichedNumberingProps.resolvedLevelIndent
64940
+ ...baseIndent,
64941
+ ...normalizedIndent ?? {}
64911
64942
  };
64912
64943
  }
64913
64944
  }
@@ -65972,7 +66003,7 @@ function paragraphToFlowBlocks$1(para, nextBlockId, positions, defaultFont, defa
65972
66003
  return;
65973
66004
  }
65974
66005
  if (node.type === "tab") {
65975
- const tabRun = tabNodeToRun(node, positions, tabOrdinal, para);
66006
+ const tabRun = tabNodeToRun(node, positions, tabOrdinal, para, inheritedMarks);
65976
66007
  tabOrdinal += 1;
65977
66008
  if (tabRun) {
65978
66009
  currentRuns.push(tabRun);
@@ -66667,6 +66698,10 @@ const hydrateTableStyleAttrs = (tableNode, context) => {
66667
66698
  hydration.justification = referenced.justification;
66668
66699
  }
66669
66700
  }
66701
+ const paragraphProps = extractTableStyleParagraphProps(styleId, context.docx);
66702
+ if (paragraphProps) {
66703
+ hydration.paragraphProps = paragraphProps;
66704
+ }
66670
66705
  }
66671
66706
  if (Object.keys(hydration).length > 0) {
66672
66707
  return hydration;
@@ -66717,6 +66752,51 @@ const normalizeTableWidth = (value) => {
66717
66752
  }
66718
66753
  return { width: raw, type: measurement.type };
66719
66754
  };
66755
+ const extractTableStyleParagraphProps = (styleId, docx) => {
66756
+ try {
66757
+ const stylesXml = docx["word/styles.xml"];
66758
+ if (!stylesXml?.elements?.[0]?.elements) return void 0;
66759
+ const styleElements = stylesXml.elements[0].elements.filter((el) => el.name === "w:style");
66760
+ const styleTag = styleElements.find((el) => el.attributes?.["w:styleId"] === styleId);
66761
+ if (!styleTag?.elements) {
66762
+ return void 0;
66763
+ }
66764
+ const pPr = styleTag.elements.find((el) => el.name === "w:pPr");
66765
+ if (!pPr?.elements) {
66766
+ return void 0;
66767
+ }
66768
+ const spacingEl = pPr.elements.find((el) => el.name === "w:spacing");
66769
+ if (!spacingEl?.attributes) {
66770
+ return void 0;
66771
+ }
66772
+ const attrs = spacingEl.attributes;
66773
+ const spacing = {};
66774
+ const before = parseIntSafe(attrs["w:before"]);
66775
+ const after = parseIntSafe(attrs["w:after"]);
66776
+ const line = parseIntSafe(attrs["w:line"]);
66777
+ const rawLineRule = attrs["w:lineRule"];
66778
+ const lineRule = rawLineRule === "auto" || rawLineRule === "exact" || rawLineRule === "atLeast" ? rawLineRule : void 0;
66779
+ if (before != null) spacing.before = twipsToPx$1(before);
66780
+ if (after != null) spacing.after = twipsToPx$1(after);
66781
+ if (line != null) {
66782
+ if (lineRule === "auto") {
66783
+ spacing.line = line / 240;
66784
+ } else {
66785
+ spacing.line = twipsToPx$1(line);
66786
+ }
66787
+ }
66788
+ if (lineRule) spacing.lineRule = lineRule;
66789
+ const result = Object.keys(spacing).length > 0 ? { spacing } : void 0;
66790
+ return result;
66791
+ } catch (err) {
66792
+ return void 0;
66793
+ }
66794
+ };
66795
+ const parseIntSafe = (value) => {
66796
+ if (value == null) return void 0;
66797
+ const num = typeof value === "number" ? value : parseInt(String(value), 10);
66798
+ return Number.isFinite(num) ? num : void 0;
66799
+ };
66720
66800
  const isTableRowNode = (node) => node.type === "tableRow" || node.type === "table_row";
66721
66801
  const isTableCellNode = (node) => node.type === "tableCell" || node.type === "table_cell" || node.type === "tableHeader" || node.type === "table_header";
66722
66802
  const normalizeRowHeight = (rowProps) => {
@@ -66736,11 +66816,15 @@ const normalizeRowHeight = (rowProps) => {
66736
66816
  };
66737
66817
  };
66738
66818
  const parseTableCell = (args) => {
66739
- const { cellNode, rowIndex, cellIndex, context, defaultCellPadding } = args;
66819
+ const { cellNode, rowIndex, cellIndex, context, defaultCellPadding, tableStyleParagraphProps } = args;
66740
66820
  if (!isTableCellNode(cellNode) || !Array.isArray(cellNode.content)) {
66741
66821
  return null;
66742
66822
  }
66743
66823
  const blocks = [];
66824
+ const cellConverterContext = tableStyleParagraphProps ? {
66825
+ ...context.converterContext,
66826
+ tableStyleParagraphProps
66827
+ } : context.converterContext;
66744
66828
  for (const childNode of cellNode.content) {
66745
66829
  if (childNode.type === "paragraph") {
66746
66830
  const paragraphBlocks = context.paragraphToFlowBlocks(
@@ -66751,11 +66835,13 @@ const parseTableCell = (args) => {
66751
66835
  context.defaultSize,
66752
66836
  context.styleContext,
66753
66837
  void 0,
66838
+ // listCounterContext
66754
66839
  context.trackedChanges,
66755
66840
  context.bookmarks,
66756
66841
  context.hyperlinkConfig,
66757
66842
  context.themeColors,
66758
- context.converterContext
66843
+ cellConverterContext
66844
+ // converterContext at position 12
66759
66845
  );
66760
66846
  const paragraph = paragraphBlocks.find((b2) => b2.kind === "paragraph");
66761
66847
  if (paragraph) {
@@ -66798,7 +66884,7 @@ const parseTableCell = (args) => {
66798
66884
  };
66799
66885
  };
66800
66886
  const parseTableRow = (args) => {
66801
- const { rowNode, rowIndex, context, defaultCellPadding } = args;
66887
+ const { rowNode, rowIndex, context, defaultCellPadding, tableStyleParagraphProps } = args;
66802
66888
  if (!isTableRowNode(rowNode) || !Array.isArray(rowNode.content)) {
66803
66889
  return null;
66804
66890
  }
@@ -66809,7 +66895,8 @@ const parseTableRow = (args) => {
66809
66895
  rowIndex,
66810
66896
  cellIndex,
66811
66897
  context,
66812
- defaultCellPadding
66898
+ defaultCellPadding,
66899
+ tableStyleParagraphProps
66813
66900
  });
66814
66901
  if (parsedCell) {
66815
66902
  cells.push(parsedCell);
@@ -66918,13 +67005,15 @@ function tableNodeToBlock$1(node, nextBlockId, positions, defaultFont, defaultSi
66918
67005
  };
66919
67006
  const hydratedTableStyle = hydrateTableStyleAttrs(node, converterContext);
66920
67007
  const defaultCellPadding = hydratedTableStyle?.cellPadding;
67008
+ const tableStyleParagraphProps = hydratedTableStyle?.paragraphProps;
66921
67009
  const rows = [];
66922
67010
  node.content.forEach((rowNode, rowIndex) => {
66923
67011
  const parsedRow = parseTableRow({
66924
67012
  rowNode,
66925
67013
  rowIndex,
66926
67014
  context: parserDeps,
66927
- defaultCellPadding
67015
+ defaultCellPadding,
67016
+ tableStyleParagraphProps
66928
67017
  });
66929
67018
  if (parsedRow) {
66930
67019
  rows.push(parsedRow);
@@ -67180,7 +67269,7 @@ function toFlowBlocks(pmDoc, options) {
67180
67269
  blocks.push(sectionBreak);
67181
67270
  recordBlockKind(sectionBreak.kind);
67182
67271
  }
67183
- const paragraphConverter = (para, nextBlockId2, positions2, defaultFont2, defaultSize2, context, listCounterContext, trackedChanges, bookmarks2, hyperlinkConfig2) => paragraphToFlowBlocks(
67272
+ const paragraphConverter = (para, nextBlockId2, positions2, defaultFont2, defaultSize2, context, listCounterContext, trackedChanges, bookmarks2, hyperlinkConfig2, themeColorsParam, converterCtx) => paragraphToFlowBlocks(
67184
67273
  para,
67185
67274
  nextBlockId2,
67186
67275
  positions2,
@@ -67191,8 +67280,8 @@ function toFlowBlocks(pmDoc, options) {
67191
67280
  trackedChanges,
67192
67281
  bookmarks2,
67193
67282
  hyperlinkConfig2,
67194
- themeColors,
67195
- converterContext
67283
+ themeColorsParam ?? themeColors,
67284
+ converterCtx ?? converterContext
67196
67285
  );
67197
67286
  const tableConverter = (node, nextBlockId2, positions2, defaultFont2, defaultSize2, context, trackedChanges, bookmarks2, hyperlinkConfig2, themeColorsParam, converterCtx) => tableNodeToBlock(
67198
67287
  node,
@@ -67972,9 +68061,7 @@ function buildMultiSectionIdentifier(sectionMetadata, pageStyles2) {
67972
68061
  odd: section.footerRefs.odd ?? null
67973
68062
  });
67974
68063
  }
67975
- const hasFirstHeader = Boolean(section.headerRefs?.first);
67976
- const hasFirstFooter = Boolean(section.footerRefs?.first);
67977
- if (hasFirstHeader || hasFirstFooter) {
68064
+ if (section.titlePg === true) {
67978
68065
  identifier.sectionTitlePg.set(idx, true);
67979
68066
  }
67980
68067
  }
@@ -69181,14 +69268,35 @@ function layoutTableBlock({
69181
69268
  const headerHeight = headerCount > 0 ? sumRowHeights(measure.rows, 0, headerCount) : 0;
69182
69269
  let state2 = ensurePage();
69183
69270
  const availableHeight = state2.contentBottom - state2.cursorY;
69184
- let minRequiredHeight = 0;
69185
- if (measure.rows.length > 0) {
69186
- minRequiredHeight = sumRowHeights(measure.rows, 0, 1);
69187
- } else if (measure.totalHeight > 0) {
69188
- minRequiredHeight = measure.totalHeight;
69189
- }
69190
- if (minRequiredHeight > availableHeight && state2.page.fragments.length > 0) {
69191
- state2 = advanceColumn(state2);
69271
+ const hasPriorFragments = state2.page.fragments.length > 0;
69272
+ const hasMeasuredRows = measure.rows.length > 0 && block.rows.length > 0;
69273
+ if (hasMeasuredRows && hasPriorFragments) {
69274
+ const firstRowCantSplit = block.rows[0]?.attrs?.tableRowProperties?.cantSplit === true;
69275
+ const firstRowHeight = measure.rows[0]?.height ?? measure.totalHeight ?? 0;
69276
+ if (firstRowCantSplit) {
69277
+ if (firstRowHeight > availableHeight) {
69278
+ state2 = advanceColumn(state2);
69279
+ }
69280
+ } else {
69281
+ const partial = computePartialRow(0, block.rows[0], measure, availableHeight);
69282
+ const madeProgress = partial.toLineByCell.some(
69283
+ (toLine, idx) => toLine > (partial.fromLineByCell[idx] || 0)
69284
+ );
69285
+ const hasRenderableHeight = partial.partialHeight > 0;
69286
+ if (!madeProgress || !hasRenderableHeight) {
69287
+ state2 = advanceColumn(state2);
69288
+ }
69289
+ }
69290
+ } else if (hasPriorFragments) {
69291
+ let minRequiredHeight = 0;
69292
+ if (measure.rows.length > 0) {
69293
+ minRequiredHeight = sumRowHeights(measure.rows, 0, 1);
69294
+ } else if (measure.totalHeight > 0) {
69295
+ minRequiredHeight = measure.totalHeight;
69296
+ }
69297
+ if (minRequiredHeight > availableHeight) {
69298
+ state2 = advanceColumn(state2);
69299
+ }
69192
69300
  }
69193
69301
  let currentRow = 0;
69194
69302
  let isTableContinuation = false;
@@ -69253,7 +69361,7 @@ function layoutTableBlock({
69253
69361
  return fromLine < totalLines;
69254
69362
  });
69255
69363
  const fragmentHeight2 = continuationPartialRow.partialHeight + (repeatHeaderCount > 0 ? headerHeight : 0);
69256
- if (fragmentHeight2 > 0) {
69364
+ if (fragmentHeight2 > 0 && madeProgress) {
69257
69365
  const fragment2 = {
69258
69366
  kind: "table",
69259
69367
  blockId: block.id,
@@ -77762,9 +77870,16 @@ const _DomPainter = class _DomPainter2 {
77762
77870
  tabEl.style.width = `${actualTabWidth}px`;
77763
77871
  tabEl.style.height = `${line.lineHeight}px`;
77764
77872
  tabEl.style.display = "inline-block";
77765
- tabEl.style.visibility = "hidden";
77766
77873
  tabEl.style.pointerEvents = "none";
77767
77874
  tabEl.style.zIndex = "1";
77875
+ if (baseRun.underline) {
77876
+ const underlineStyle = baseRun.underline.style ?? "single";
77877
+ const underlineColor = baseRun.underline.color ?? "#000000";
77878
+ const borderStyle = underlineStyle === "double" ? "double" : "solid";
77879
+ tabEl.style.borderBottom = `1px ${borderStyle} ${underlineColor}`;
77880
+ } else {
77881
+ tabEl.style.visibility = "hidden";
77882
+ }
77768
77883
  if (styleId) {
77769
77884
  tabEl.setAttribute("styleid", styleId);
77770
77885
  }
@@ -77842,6 +77957,28 @@ const _DomPainter = class _DomPainter2 {
77842
77957
  }
77843
77958
  } else {
77844
77959
  runsForLine.forEach((run2) => {
77960
+ if (run2.kind === "tab") {
77961
+ const tabEl = this.doc.createElement("span");
77962
+ tabEl.classList.add("superdoc-tab");
77963
+ const tabWidth = run2.width ?? 48;
77964
+ tabEl.style.display = "inline-block";
77965
+ tabEl.style.width = `${tabWidth}px`;
77966
+ tabEl.style.height = `${line.lineHeight}px`;
77967
+ tabEl.style.verticalAlign = "bottom";
77968
+ if (run2.underline) {
77969
+ const underlineStyle = run2.underline.style ?? "single";
77970
+ const underlineColor = run2.underline.color ?? "#000000";
77971
+ const borderStyle = underlineStyle === "double" ? "double" : "solid";
77972
+ tabEl.style.borderBottom = `1px ${borderStyle} ${underlineColor}`;
77973
+ }
77974
+ if (styleId) {
77975
+ tabEl.setAttribute("styleid", styleId);
77976
+ }
77977
+ if (run2.pmStart != null) tabEl.dataset.pmStart = String(run2.pmStart);
77978
+ if (run2.pmEnd != null) tabEl.dataset.pmEnd = String(run2.pmEnd);
77979
+ el.appendChild(tabEl);
77980
+ return;
77981
+ }
77845
77982
  const elem = this.renderRun(run2, context, trackedConfig);
77846
77983
  if (elem) {
77847
77984
  if (styleId) {
@@ -78930,8 +79067,10 @@ async function measureParagraphBlock(block, maxWidth) {
78930
79067
  const indentRight = sanitizePositive(indent?.right);
78931
79068
  const firstLine = indent?.firstLine ?? 0;
78932
79069
  const hanging = indent?.hanging ?? 0;
79070
+ const isWordLayoutList = Boolean(wordLayout?.marker);
78933
79071
  const suppressFirstLine = block.attrs?.suppressFirstLineIndent === true;
78934
- const firstLineOffset = suppressFirstLine ? 0 : firstLine - hanging;
79072
+ const rawFirstLineOffset = suppressFirstLine ? 0 : firstLine - hanging;
79073
+ const firstLineOffset = isWordLayoutList ? 0 : rawFirstLineOffset;
78935
79074
  const contentWidth = Math.max(1, maxWidth - indentLeft - indentRight);
78936
79075
  const initialAvailableWidth = Math.max(1, contentWidth - firstLineOffset);
78937
79076
  const tabStops = buildTabStopsPx(
@@ -1 +1 @@
1
- {"version":3,"file":"SuperDoc.d.ts","sourceRoot":"","sources":["../../../../../src/core/SuperDoc.js"],"names":[],"mappings":"AAqBA,6CAA6C;AAC7C,mEAAmE;AACnE,qDAAqD;AACrD,mDAAmD;AACnD,iDAAiD;AACjD,6DAA6D;AAC7D,iDAAiD;AACjD,6DAA6D;AAE7D;;;;;;GAMG;AACH;IACE,4BAA4B;IAC5B,qBADW,KAAK,CAAC,MAAM,CAAC,CACgB;IA4ExC;;OAEG;IACH,oBAFW,MAAM,EAKhB;IAhFD,qBAAqB;IACrB,SADW,MAAM,CACT;IAER,qBAAqB;IACrB,OADW,IAAI,EAAE,CACX;IAEN,4CAA4C;IAC5C,MADW,OAAO,KAAK,EAAE,GAAG,GAAG,SAAS,CACnC;IAEL,4EAA4E;IAC5E,UADW,OAAO,sBAAsB,EAAE,kBAAkB,GAAG,SAAS,CAC/D;IAET,qBAAqB;IACrB,QADW,MAAM,CA4Df;IAiDA,wCAA6B;IAC7B,+BAAmB;IAMnB,gBAA+C;IAC/C,6BAAgC;IAchC,yCAA4B;IAE5B,YAAkB;IAElB,2B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QAAQ;sBAC1B,OAAO,SAAS,EAAE,OAAO;qBACzB,OAAO,SAAS,EAAE,MAAM;2BACxB,OAAO,SAAS,EAAE,YAAY;qBAC9B,OAAO,SAAS,EAAE,MAAM;2BACxB,OAAO,SAAS,EAAE,YAAY;6BA1Bf,eAAe;8BAMd,iEAAiE"}
@@ -1,6 +1,6 @@
1
1
  import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
2
- import { T as TextSelection } from "./chunks/converter-DCpgxLLA.js";
3
- import { _ as _export_sfc } from "./chunks/editor-Df43-j5L.js";
2
+ import { T as TextSelection } from "./chunks/converter-GXPldmlh.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-DaDga3Ye.js";
4
4
  const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
5
5
  const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
6
6
  async function baseInsightsFetch(payload, options = {}) {
@@ -42122,7 +42122,7 @@ const _SuperConverter = class _SuperConverter {
42122
42122
  static getStoredSuperdocVersion(docx) {
42123
42123
  return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
42124
42124
  }
42125
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.28") {
42125
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.29") {
42126
42126
  return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
42127
42127
  }
42128
42128
  /**
@@ -1,4 +1,4 @@
1
- import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-DCpgxLLA.js";
1
+ import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-GXPldmlh.js";
2
2
  function commonjsRequire(path) {
3
3
  throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
4
4
  }