@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.
@@ -12,9 +12,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
12
12
  var _events, _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _commandService, _css, _Editor_instances, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, _FieldAnnotationView_instances, createAnnotation_fn;
13
13
  import * as Y from "yjs";
14
14
  import { UndoManager, Item as Item$1, ContentType, Text as Text$1, XmlElement } from "yjs";
15
- import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, f as Schema$1, g as canSplit, l as liftTarget, h as canJoin, j as joinPoint, r as replaceStep$1, R as ReplaceAroundStep, o as objectIncludes, i as ReplaceStep, k as NodeRange, m as findWrapping, n as TrackDeleteMarkName, q as TrackInsertMarkName, v as v4, s as generateDocxRandomId, t as TrackFormatMarkName, u as comments_module_events, w as AddMarkStep, x as RemoveMarkStep, y as twipsToLines, z as pixelsToTwips, B as SuperConverter, E as EditorState, C as toKebabCase, G as kebabCase, H as SelectionRange, I as Transform } from "./converter-C6qhz5ig.js";
15
+ import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, f as Schema$1, g as canSplit, l as liftTarget, h as canJoin, j as joinPoint, r as replaceStep$1, R as ReplaceAroundStep, o as objectIncludes, i as ReplaceStep, k as NodeRange, m as findWrapping, n as TrackDeleteMarkName, q as TrackInsertMarkName, v as v4, s as generateDocxRandomId, t as TrackFormatMarkName, u as comments_module_events, w as AddMarkStep, x as RemoveMarkStep, y as twipsToLines, z as pixelsToTwips, B as SuperConverter, E as EditorState, C as toKebabCase, G as kebabCase, H as SelectionRange, I as Transform } from "./converter-C7DcyS0S.js";
16
16
  import { ref, computed, createElementBlock, openBlock, withModifiers, Fragment as Fragment$1, renderList, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, createApp } from "vue";
17
- import { D as DocxZipper } from "./docx-zipper-CAVp3vpl.js";
17
+ import { D as DocxZipper } from "./docx-zipper-CZsaunAg.js";
18
18
  function getMarksFromSelection(state) {
19
19
  const { from: from2, to, empty: empty2 } = state.selection;
20
20
  const marks = [];
@@ -11692,7 +11692,7 @@ const _Editor = class _Editor extends EventEmitter {
11692
11692
  * @returns {Y.Doc | undefined} Updated Y.Doc if any, otherwise undefined
11693
11693
  */
11694
11694
  processCollaborationMigrations() {
11695
- console.debug("[checkVersionMigrations] Current editor version", "0.6.79");
11695
+ console.debug("[checkVersionMigrations] Current editor version", "0.6.80");
11696
11696
  if (!this.options.ydoc) return;
11697
11697
  const metaMap = this.options.ydoc.getMap("meta");
11698
11698
  let docVersion = metaMap.get("version");
@@ -22336,13 +22336,15 @@ function generateInternalPageBreaks(doc2, view, editor, sectionData) {
22336
22336
  let coords = view?.coordsAtPos(doc2.content.size);
22337
22337
  if (!coords) return [];
22338
22338
  doc2.descendants((node, pos) => {
22339
- coords = view?.coordsAtPos(pos);
22339
+ let currentNode = node;
22340
+ let currentPos = pos;
22341
+ coords = view?.coordsAtPos(currentPos);
22340
22342
  if (!coords) return;
22341
22343
  let shouldAddPageBreak = coords.bottom > pageHeightThreshold;
22342
- const isHardBreakNode = node.type.name === "hardBreak";
22343
- if (node.type.name === "paragraph" && node.attrs.styleId) {
22344
+ const isHardBreakNode = currentNode.type.name === "hardBreak";
22345
+ if (currentNode.type.name === "paragraph" && currentNode.attrs.styleId) {
22344
22346
  const linkedStyles = LinkedStylesPluginKey.getState(editor.state)?.styles;
22345
- const style = linkedStyles?.find((style2) => style2.id === node.attrs.styleId);
22347
+ const style = linkedStyles?.find((style2) => style2.id === currentNode.attrs.styleId);
22346
22348
  if (style) {
22347
22349
  const { definition = {} } = style;
22348
22350
  const { pageBreakBefore, pageBreakAfter } = definition.attrs || {};
@@ -22350,11 +22352,17 @@ function generateInternalPageBreaks(doc2, view, editor, sectionData) {
22350
22352
  }
22351
22353
  }
22352
22354
  if (isHardBreakNode || shouldAddPageBreak) {
22355
+ const $currentPos = view.state.doc.resolve(currentPos);
22356
+ const tableRow = findParentNodeClosestToPos($currentPos, (node2) => node2.type.name === "tableRow");
22357
+ if (tableRow) {
22358
+ currentNode = tableRow.node;
22359
+ currentPos = tableRow.pos;
22360
+ }
22353
22361
  const {
22354
22362
  top: actualBreakTop,
22355
22363
  bottom: actualBreakBottom,
22356
22364
  pos: breakPos
22357
- } = getActualBreakCoords(view, pos, pageHeightThreshold);
22365
+ } = getActualBreakCoords(view, currentPos, pageHeightThreshold);
22358
22366
  currentPageNumber++;
22359
22367
  const headerId2 = (currentPageNumber % 2 === 0 ? headerIds.even : headerIds.odd) || headerIds.default;
22360
22368
  const footerId2 = (currentPageNumber % 2 === 0 ? footerIds.even : footerIds.odd) || footerIds.default;
@@ -22577,4 +22585,4 @@ export {
22577
22585
  redoDepth as r,
22578
22586
  undoDepth as u
22579
22587
  };
22580
- //# sourceMappingURL=editor-ClEfFhqx.js.map
22588
+ //# sourceMappingURL=editor-CnQI8Awl.js.map