@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.
@@ -1,4 +1,4 @@
1
- import { B } from "./chunks/converter-C6qhz5ig.js";
1
+ import { B } from "./chunks/converter-C7DcyS0S.js";
2
2
  export {
3
3
  B as SuperConverter
4
4
  };
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-C6qhz5ig.js";
2
- import { D } from "./chunks/docx-zipper-CAVp3vpl.js";
1
+ import "./chunks/converter-C7DcyS0S.js";
2
+ import { D } from "./chunks/docx-zipper-CZsaunAg.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-ClEfFhqx.js";
2
- import "./chunks/converter-C6qhz5ig.js";
3
- import "./chunks/docx-zipper-CAVp3vpl.js";
1
+ import { E } from "./chunks/editor-CnQI8Awl.js";
2
+ import "./chunks/converter-C7DcyS0S.js";
3
+ import "./chunks/docx-zipper-CZsaunAg.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/extensions/pagination/pagination.js"],"names":[],"mappings":"AAWA,6BAgJG"}
1
+ {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/extensions/pagination/pagination.js"],"names":[],"mappings":"AAYA,6BAgJG"}
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-CAVp3vpl.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-CZsaunAg.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -9,13 +9,13 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
11
11
  var _interceptedCommands, _SuperToolbar_instances, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, runCommandWithArgumentOnly_fn;
12
- import { _ as _export_sfc, a as getQuickFormatList, b as generateLinkedStyleString, I as ImagePlaceholderPluginKey, f as findPlaceholder, c as findParentNode, d as getActiveFormatting, i as isInTable, u as undoDepth, r as redoDepth, E as Editor, e as getStarterExtensions, P as Placeholder, h as getRichTextExtensions } from "./chunks/editor-ClEfFhqx.js";
13
- import { k, m, j, l } from "./chunks/editor-ClEfFhqx.js";
14
- import { L as getDefaultExportFromCjs, v as v4, T as TextSelection, Q as vClickOutside } from "./chunks/converter-C6qhz5ig.js";
15
- import { B } from "./chunks/converter-C6qhz5ig.js";
12
+ import { _ as _export_sfc, a as getQuickFormatList, b as generateLinkedStyleString, I as ImagePlaceholderPluginKey, f as findPlaceholder, c as findParentNode, d as getActiveFormatting, i as isInTable, u as undoDepth, r as redoDepth, E as Editor, e as getStarterExtensions, P as Placeholder, h as getRichTextExtensions } from "./chunks/editor-CnQI8Awl.js";
13
+ import { k, m, j, l } from "./chunks/editor-CnQI8Awl.js";
14
+ import { L as getDefaultExportFromCjs, v as v4, T as TextSelection, Q as vClickOutside } from "./chunks/converter-C7DcyS0S.js";
15
+ import { B } from "./chunks/converter-C7DcyS0S.js";
16
16
  import { ref, createElementBlock, openBlock, createElementVNode, unref, getCurrentInstance, computed, watch, onMounted, createCommentVNode, withDirectives, withKeys, normalizeClass, withModifiers, vModelText, createTextVNode, toDisplayString, Fragment, renderList, normalizeStyle, createVNode, h, createApp, reactive, onUnmounted, shallowRef, onBeforeUnmount, createBlock } from "vue";
17
- import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, N as NSkeleton } from "./chunks/toolbar-PeosMC7P.js";
18
- import { D } from "./chunks/docx-zipper-CAVp3vpl.js";
17
+ import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, N as NSkeleton } from "./chunks/toolbar-3FuYSu9a.js";
18
+ import { D } from "./chunks/docx-zipper-CZsaunAg.js";
19
19
  import { createZip } from "./file-zipper.es.js";
20
20
  var eventemitter3 = { exports: {} };
21
21
  (function(module) {
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-PeosMC7P.js";
3
- import "./chunks/editor-ClEfFhqx.js";
2
+ import { T } from "./chunks/toolbar-3FuYSu9a.js";
3
+ import "./chunks/editor-CnQI8Awl.js";
4
4
  export {
5
5
  T as default
6
6
  };
@@ -1,4 +1,4 @@
1
- import { _, D, E, S, a, b, c, T, d, i, g, e, f, h, j, k, l } from "./chunks/super-editor.es-B0VUVWBo.js";
1
+ import { _, D, E, S, a, b, c, T, d, i, g, e, f, h, j, k, l } from "./chunks/super-editor.es-8gKNHSEh.js";
2
2
  import "./chunks/vue-BjMDYCe1.js";
3
3
  export {
4
4
  _ as BasicUpload,
@@ -1,5 +1,5 @@
1
- import { E as Editor, h as getRichTextExtensions, b as SuperInput, a as SuperEditor, c as SuperToolbar, d as createZip } from "./chunks/super-editor.es-B0VUVWBo.js";
2
- import { S, i, k, l } from "./chunks/super-editor.es-B0VUVWBo.js";
1
+ import { E as Editor, h as getRichTextExtensions, b as SuperInput, a as SuperEditor, c as SuperToolbar, d as createZip } from "./chunks/super-editor.es-8gKNHSEh.js";
2
+ import { S, i, k, l } from "./chunks/super-editor.es-8gKNHSEh.js";
3
3
  import { Y as effectScope, r as ref, Z as markRaw, p as process$1, _ as toRaw, a as computed, $ as isRef, a0 as isReactive, C as toRef, i as inject, q as getCurrentInstance, l as watch, x as unref, a1 as hasInjectionContext, L as reactive, R as nextTick, a2 as getCurrentScope, a3 as onScopeDispose, a4 as toRefs, g as global$1, N as shallowRef, M as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, U as onActivated, s as onDeactivated, z as createTextVNode, F as Fragment, Q as Comment, m as defineComponent, D as provide, G as withDirectives, B as h, V as Teleport, S as renderSlot, W as isVNode, K as watchEffect, O as Transition, E as mergeProps, P as vShow, J as cloneVNode, T as Text, b as createElementBlock, o as openBlock, t as toDisplayString, v as createVNode, y as withCtx, f as createBaseVNode, A as normalizeStyle, e as createCommentVNode, u as createBlock, w as withModifiers, n as normalizeClass, a5 as resolveDirective, d as renderList, c as createApp, a6 as resolveDynamicComponent } from "./chunks/vue-BjMDYCe1.js";
4
4
  import { B as Buffer$2 } from "./chunks/jszip-Df6uKve1.js";
5
5
  import { b } from "./chunks/blank-docx-BagxM198.js";
@@ -45796,7 +45796,7 @@ class SuperDoc extends EventEmitter {
45796
45796
  this.config.colors = shuffleArray(this.config.colors);
45797
45797
  this.userColorMap = /* @__PURE__ */ new Map();
45798
45798
  this.colorIndex = 0;
45799
- this.version = "0.6.79";
45799
+ this.version = "0.6.80";
45800
45800
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
45801
45801
  this.superdocId = config.superdocId || v4();
45802
45802
  this.colors = this.config.colors;
@@ -27938,7 +27938,7 @@
27938
27938
  return;
27939
27939
  }
27940
27940
  }
27941
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.6.79") {
27941
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.6.80") {
27942
27942
  const customLocation = "docProps/custom.xml";
27943
27943
  if (!docx[customLocation]) {
27944
27944
  docx[customLocation] = generateCustomXml();
@@ -28202,7 +28202,7 @@
28202
28202
  function generateCustomXml() {
28203
28203
  return DEFAULT_CUSTOM_XML;
28204
28204
  }
28205
- function generateSuperdocVersion(pid = 2, version2 = "0.6.79") {
28205
+ function generateSuperdocVersion(pid = 2, version2 = "0.6.80") {
28206
28206
  return {
28207
28207
  type: "element",
28208
28208
  name: "property",
@@ -42385,7 +42385,7 @@
42385
42385
  * @returns {Y.Doc | undefined} Updated Y.Doc if any, otherwise undefined
42386
42386
  */
42387
42387
  processCollaborationMigrations() {
42388
- console.debug("[checkVersionMigrations] Current editor version", "0.6.79");
42388
+ console.debug("[checkVersionMigrations] Current editor version", "0.6.80");
42389
42389
  if (!this.options.ydoc) return;
42390
42390
  const metaMap = this.options.ydoc.getMap("meta");
42391
42391
  let docVersion = metaMap.get("version");
@@ -52981,13 +52981,15 @@
52981
52981
  let coords = view?.coordsAtPos(doc2.content.size);
52982
52982
  if (!coords) return [];
52983
52983
  doc2.descendants((node2, pos) => {
52984
- coords = view?.coordsAtPos(pos);
52984
+ let currentNode = node2;
52985
+ let currentPos = pos;
52986
+ coords = view?.coordsAtPos(currentPos);
52985
52987
  if (!coords) return;
52986
52988
  let shouldAddPageBreak = coords.bottom > pageHeightThreshold;
52987
- const isHardBreakNode = node2.type.name === "hardBreak";
52988
- if (node2.type.name === "paragraph" && node2.attrs.styleId) {
52989
+ const isHardBreakNode = currentNode.type.name === "hardBreak";
52990
+ if (currentNode.type.name === "paragraph" && currentNode.attrs.styleId) {
52989
52991
  const linkedStyles = LinkedStylesPluginKey.getState(editor.state)?.styles;
52990
- const style2 = linkedStyles?.find((style22) => style22.id === node2.attrs.styleId);
52992
+ const style2 = linkedStyles?.find((style22) => style22.id === currentNode.attrs.styleId);
52991
52993
  if (style2) {
52992
52994
  const { definition = {} } = style2;
52993
52995
  const { pageBreakBefore, pageBreakAfter } = definition.attrs || {};
@@ -52995,11 +52997,17 @@
52995
52997
  }
52996
52998
  }
52997
52999
  if (isHardBreakNode || shouldAddPageBreak) {
53000
+ const $currentPos = view.state.doc.resolve(currentPos);
53001
+ const tableRow = findParentNodeClosestToPos($currentPos, (node22) => node22.type.name === "tableRow");
53002
+ if (tableRow) {
53003
+ currentNode = tableRow.node;
53004
+ currentPos = tableRow.pos;
53005
+ }
52998
53006
  const {
52999
53007
  top: actualBreakTop,
53000
53008
  bottom: actualBreakBottom,
53001
53009
  pos: breakPos
53002
- } = getActualBreakCoords(view, pos, pageHeightThreshold);
53010
+ } = getActualBreakCoords(view, currentPos, pageHeightThreshold);
53003
53011
  currentPageNumber++;
53004
53012
  const headerId2 = (currentPageNumber % 2 === 0 ? headerIds.even : headerIds.odd) || headerIds.default;
53005
53013
  const footerId2 = (currentPageNumber % 2 === 0 ? footerIds.even : footerIds.odd) || footerIds.default;
@@ -110633,7 +110641,7 @@ ${style2}
110633
110641
  this.config.colors = shuffleArray(this.config.colors);
110634
110642
  this.userColorMap = /* @__PURE__ */ new Map();
110635
110643
  this.colorIndex = 0;
110636
- this.version = "0.6.79";
110644
+ this.version = "0.6.80";
110637
110645
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
110638
110646
  this.superdocId = config.superdocId || v4();
110639
110647
  this.colors = this.config.colors;