@harbour-enterprises/superdoc 0.6.79 → 0.6.80

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.
@@ -20601,7 +20601,7 @@ const _SuperConverter = class _SuperConverter2 {
20601
20601
  return;
20602
20602
  }
20603
20603
  }
20604
- static updateDocumentVersion(docx = this.convertedXml, version = "0.6.79") {
20604
+ static updateDocumentVersion(docx = this.convertedXml, version = "0.6.80") {
20605
20605
  const customLocation = "docProps/custom.xml";
20606
20606
  if (!docx[customLocation]) {
20607
20607
  docx[customLocation] = generateCustomXml();
@@ -20865,7 +20865,7 @@ function storeSuperdocVersion(docx) {
20865
20865
  function generateCustomXml() {
20866
20866
  return DEFAULT_CUSTOM_XML;
20867
20867
  }
20868
- function generateSuperdocVersion(pid = 2, version = "0.6.79") {
20868
+ function generateSuperdocVersion(pid = 2, version = "0.6.80") {
20869
20869
  return {
20870
20870
  type: "element",
20871
20871
  name: "property",
@@ -35048,7 +35048,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
35048
35048
  * @returns {Y.Doc | undefined} Updated Y.Doc if any, otherwise undefined
35049
35049
  */
35050
35050
  processCollaborationMigrations() {
35051
- console.debug("[checkVersionMigrations] Current editor version", "0.6.79");
35051
+ console.debug("[checkVersionMigrations] Current editor version", "0.6.80");
35052
35052
  if (!this.options.ydoc) return;
35053
35053
  const metaMap = this.options.ydoc.getMap("meta");
35054
35054
  let docVersion = metaMap.get("version");
@@ -45644,13 +45644,15 @@ function generateInternalPageBreaks(doc2, view, editor, sectionData) {
45644
45644
  let coords = view?.coordsAtPos(doc2.content.size);
45645
45645
  if (!coords) return [];
45646
45646
  doc2.descendants((node2, pos) => {
45647
- coords = view?.coordsAtPos(pos);
45647
+ let currentNode = node2;
45648
+ let currentPos = pos;
45649
+ coords = view?.coordsAtPos(currentPos);
45648
45650
  if (!coords) return;
45649
45651
  let shouldAddPageBreak = coords.bottom > pageHeightThreshold;
45650
- const isHardBreakNode = node2.type.name === "hardBreak";
45651
- if (node2.type.name === "paragraph" && node2.attrs.styleId) {
45652
+ const isHardBreakNode = currentNode.type.name === "hardBreak";
45653
+ if (currentNode.type.name === "paragraph" && currentNode.attrs.styleId) {
45652
45654
  const linkedStyles = LinkedStylesPluginKey.getState(editor.state)?.styles;
45653
- const style2 = linkedStyles?.find((style22) => style22.id === node2.attrs.styleId);
45655
+ const style2 = linkedStyles?.find((style22) => style22.id === currentNode.attrs.styleId);
45654
45656
  if (style2) {
45655
45657
  const { definition = {} } = style2;
45656
45658
  const { pageBreakBefore, pageBreakAfter } = definition.attrs || {};
@@ -45658,11 +45660,17 @@ function generateInternalPageBreaks(doc2, view, editor, sectionData) {
45658
45660
  }
45659
45661
  }
45660
45662
  if (isHardBreakNode || shouldAddPageBreak) {
45663
+ const $currentPos = view.state.doc.resolve(currentPos);
45664
+ const tableRow = findParentNodeClosestToPos($currentPos, (node22) => node22.type.name === "tableRow");
45665
+ if (tableRow) {
45666
+ currentNode = tableRow.node;
45667
+ currentPos = tableRow.pos;
45668
+ }
45661
45669
  const {
45662
45670
  top: actualBreakTop,
45663
45671
  bottom: actualBreakBottom,
45664
45672
  pos: breakPos
45665
- } = getActualBreakCoords(view, pos, pageHeightThreshold);
45673
+ } = getActualBreakCoords(view, currentPos, pageHeightThreshold);
45666
45674
  currentPageNumber++;
45667
45675
  const headerId2 = (currentPageNumber % 2 === 0 ? headerIds.even : headerIds.odd) || headerIds.default;
45668
45676
  const footerId2 = (currentPageNumber % 2 === 0 ? footerIds.even : footerIds.odd) || footerIds.default;
@@ -58525,4 +58533,4 @@ export {
58525
58533
  helpers as k,
58526
58534
  index as l
58527
58535
  };
58528
- //# sourceMappingURL=super-editor.es-B0VUVWBo.js.map
58536
+ //# sourceMappingURL=super-editor.es-8gKNHSEh.js.map