@harbour-enterprises/superdoc 1.3.0-next.6 → 1.3.0-next.7

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,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-De9wkgLl.cjs");
4
- const superdoc = require("./index-CEDW4NYV.cjs");
5
- const index = require("./index-C4RVDXKX.cjs");
4
+ const superdoc = require("./index-CKi-JNoY.cjs");
5
+ const index = require("./index-CmmcvSxn.cjs");
6
6
  function self(vars) {
7
7
  const {
8
8
  opacityDisabled,
@@ -1,6 +1,6 @@
1
1
  import { d as defineComponent, h, T as Transition, p as process$1, w as watchEffect, c as computed, r as ref, f as onMounted, X as onUnmounted, E as createElementBlock, G as openBlock, K as createBaseVNode, M as createCommentVNode, I as createVNode, v as unref } from "./vue-BnBKJwCW.es.js";
2
- import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-9qGjdWOS.es.js";
3
- import { C as derived, r as c, q as cB, aF as fadeInTransition, y as cM, I as warnOnce, J as useConfig, N as useTheme, aG as pxfy, P as createKey, Q as useThemeClass, aH as useCompitable, ai as _export_sfc } from "./index-CqbujvlE.es.js";
2
+ import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-C0irsRkX.es.js";
3
+ import { C as derived, r as c, q as cB, aF as fadeInTransition, y as cM, I as warnOnce, J as useConfig, N as useTheme, aG as pxfy, P as createKey, Q as useThemeClass, aH as useCompitable, ai as _export_sfc } from "./index-BuT4cwmK.es.js";
4
4
  function self(vars) {
5
5
  const {
6
6
  opacityDisabled,
@@ -30939,7 +30939,7 @@ class SuperConverter {
30939
30939
  static getStoredSuperdocVersion(docx) {
30940
30940
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
30941
30941
  }
30942
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.3.0-next.6") {
30942
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.3.0-next.7") {
30943
30943
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
30944
30944
  }
30945
30945
  /**
@@ -30938,7 +30938,7 @@ class SuperConverter {
30938
30938
  static getStoredSuperdocVersion(docx) {
30939
30939
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
30940
30940
  }
30941
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.3.0-next.6") {
30941
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.3.0-next.7") {
30942
30942
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
30943
30943
  }
30944
30944
  /**
@@ -1,6 +1,6 @@
1
1
  import { B as Buffer$2 } from "./jszip-B1fkPkPJ.es.js";
2
2
  import { t as twipsToInches, i as inchesToTwips, p as ptToTwips, l as linesToTwips, a as twipsToLines, b as pixelsToTwips, h as halfPointToPoints, c as twipsToPixels$2, d as convertSizeToCSS, e as inchesToPixels } from "./helpers-C8e9wR5l.es.js";
3
- import { g as generateDocxRandomId, T as TextSelection$1, o as objectIncludes, w as wrapTextsInRuns, D as DOMParser$1, c as createDocFromMarkdown, a as createDocFromHTML, b as chainableEditorState, d as convertMarkdownToHTML, f as findParentNode, e as findParentNodeClosestToPos, h as generateRandom32BitHex, i as generateRandomSigned32BitIntStrId, P as PluginKey, j as Plugin, M as Mapping, N as NodeSelection, k as Selection, l as Slice, m as DOMSerializer, F as Fragment, n as Mark$1, p as dropPoint, A as AllSelection, q as Schema$1, s as canSplit, t as resolveRunProperties, u as encodeMarksFromRPr, v as liftTarget, x as canJoin, y as joinPoint, z as replaceStep$1, R as ReplaceAroundStep$1, B as htmlHandler, C as ReplaceStep, E as getResolvedParagraphProperties, G as changeListLevel, H as isList$1, I as updateNumberingProperties, L as ListHelpers, J as inputRulesPlugin, K as TrackDeleteMarkName$1, O as TrackInsertMarkName$1, Q as TrackFormatMarkName$1, U as AddMarkStep, V as RemoveMarkStep, W as CommandService, S as SuperConverter, X as EditorState, Y as unflattenListsInHtml, Z as SelectionRange, _ as Transform, $ as createOoxmlResolver, a0 as translator, a1 as translator$1, a2 as resolveDocxFontFamily, a3 as _getReferencedTableStyles, a4 as decodeRPrFromMarks, a5 as calculateResolvedParagraphProperties, a6 as encodeCSSFromPPr, a7 as encodeCSSFromRPr, a8 as generateOrderedListIndex, a9 as docxNumberingHelpers, aa as InputRule, ab as insertNewRelationship, ac as kebabCase$1, ad as getUnderlineCssString } from "./SuperConverter-S9b1fFw5.es.js";
3
+ import { g as generateDocxRandomId, T as TextSelection$1, o as objectIncludes, w as wrapTextsInRuns, D as DOMParser$1, c as createDocFromMarkdown, a as createDocFromHTML, b as chainableEditorState, d as convertMarkdownToHTML, f as findParentNode, e as findParentNodeClosestToPos, h as generateRandom32BitHex, i as generateRandomSigned32BitIntStrId, P as PluginKey, j as Plugin, M as Mapping, N as NodeSelection, k as Selection, l as Slice, m as DOMSerializer, F as Fragment, n as Mark$1, p as dropPoint, A as AllSelection, q as Schema$1, s as canSplit, t as resolveRunProperties, u as encodeMarksFromRPr, v as liftTarget, x as canJoin, y as joinPoint, z as replaceStep$1, R as ReplaceAroundStep$1, B as htmlHandler, C as ReplaceStep, E as getResolvedParagraphProperties, G as changeListLevel, H as isList$1, I as updateNumberingProperties, L as ListHelpers, J as inputRulesPlugin, K as TrackDeleteMarkName$1, O as TrackInsertMarkName$1, Q as TrackFormatMarkName$1, U as AddMarkStep, V as RemoveMarkStep, W as CommandService, S as SuperConverter, X as EditorState, Y as unflattenListsInHtml, Z as SelectionRange, _ as Transform, $ as createOoxmlResolver, a0 as translator, a1 as translator$1, a2 as resolveDocxFontFamily, a3 as _getReferencedTableStyles, a4 as decodeRPrFromMarks, a5 as calculateResolvedParagraphProperties, a6 as encodeCSSFromPPr, a7 as encodeCSSFromRPr, a8 as generateOrderedListIndex, a9 as docxNumberingHelpers, aa as InputRule, ab as insertNewRelationship, ac as kebabCase$1, ad as getUnderlineCssString } from "./SuperConverter-Bc9dM-qO.es.js";
4
4
  import { p as process$1, r as ref, C as global$1, c as computed, E as createElementBlock, F as Fragment$1, S as renderList, O as withModifiers, G as openBlock, P as normalizeClass, M as createCommentVNode, H as toDisplayString, K as createBaseVNode, U as createApp, f as onMounted, X as onUnmounted, R as withDirectives, v as unref, Y as vModelText, y as nextTick, L as normalizeStyle, u as watch, Z as withKeys, _ as createTextVNode, I as createVNode, h, $ as readonly, s as getCurrentInstance, o as onBeforeUnmount, j as reactive, b as onBeforeMount, i as inject, a0 as onActivated, a1 as onDeactivated, a2 as Comment, d as defineComponent, a as provide, g as Teleport, t as toRef, a3 as renderSlot, a4 as isVNode, D as shallowRef, w as watchEffect, T as Transition, a5 as mergeProps, a6 as vShow, a7 as cloneVNode, a8 as Text$2, m as markRaw, N as createBlock, J as withCtx, a9 as useCssVars, V as resolveDynamicComponent, aa as normalizeProps, ab as guardReactiveProps } from "./vue-BnBKJwCW.es.js";
5
5
  import "./jszip.min-DCl8qkFO.es.js";
6
6
  import { E as EventEmitter$1 } from "./eventemitter3-CwrdEv8r.es.js";
@@ -15334,7 +15334,7 @@ const canUseDOM = () => {
15334
15334
  return false;
15335
15335
  }
15336
15336
  };
15337
- const summaryVersion = "1.3.0-next.6";
15337
+ const summaryVersion = "1.3.0-next.7";
15338
15338
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
15339
15339
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
15340
15340
  function mapAttributes(attrs) {
@@ -17967,7 +17967,7 @@ class Editor extends EventEmitter {
17967
17967
  * Process collaboration migrations
17968
17968
  */
17969
17969
  processCollaborationMigrations() {
17970
- console.debug("[checkVersionMigrations] Current editor version", "1.3.0-next.6");
17970
+ console.debug("[checkVersionMigrations] Current editor version", "1.3.0-next.7");
17971
17971
  if (!this.options.ydoc) return;
17972
17972
  const metaMap = this.options.ydoc.getMap("meta");
17973
17973
  let docVersion = metaMap.get("version");
@@ -25551,7 +25551,28 @@ class DomPainter {
25551
25551
  section: kind,
25552
25552
  pageNumberText: page.numberText
25553
25553
  };
25554
- data.fragments.forEach((fragment) => {
25554
+ const behindDocFragments = [];
25555
+ const normalFragments = [];
25556
+ for (const fragment of data.fragments) {
25557
+ const isBehindDoc = (fragment.kind === "image" || fragment.kind === "drawing") && "zIndex" in fragment && fragment.zIndex === 0;
25558
+ if (isBehindDoc) {
25559
+ behindDocFragments.push(fragment);
25560
+ } else {
25561
+ normalFragments.push(fragment);
25562
+ }
25563
+ }
25564
+ const behindDocSelector = `[data-behind-doc-section="${kind}"]`;
25565
+ pageEl.querySelectorAll(behindDocSelector).forEach((el) => el.remove());
25566
+ behindDocFragments.forEach((fragment) => {
25567
+ const fragEl = this.renderFragment(fragment, context);
25568
+ const pageY = effectiveOffset + fragment.y + (kind === "footer" ? footerYOffset : 0);
25569
+ fragEl.style.top = `${pageY}px`;
25570
+ fragEl.style.left = `${marginLeft + fragment.x}px`;
25571
+ fragEl.style.zIndex = "0";
25572
+ fragEl.dataset.behindDocSection = kind;
25573
+ pageEl.insertBefore(fragEl, pageEl.firstChild);
25574
+ });
25575
+ normalFragments.forEach((fragment) => {
25555
25576
  const fragEl = this.renderFragment(fragment, context);
25556
25577
  if (footerYOffset > 0) {
25557
25578
  const currentTop = parseFloat(fragEl.style.top) || fragment.y;
@@ -33879,10 +33900,6 @@ function layoutHeaderFooter(blocks, measures, constraints) {
33879
33900
  if (!Number.isFinite(height) || height <= 0) {
33880
33901
  return { pages: [], height: 0 };
33881
33902
  }
33882
- const overflowBase = typeof constraints.overflowBaseHeight === "number" && Number.isFinite(constraints.overflowBaseHeight) && constraints.overflowBaseHeight > 0 ? constraints.overflowBaseHeight : height;
33883
- const maxBehindDocOverflow = Math.max(192, overflowBase * 4);
33884
- const minBehindDocY = -maxBehindDocOverflow;
33885
- const maxBehindDocY = height + maxBehindDocOverflow;
33886
33903
  const marginLeft = constraints.margins?.left ?? 0;
33887
33904
  const transformedBlocks = marginLeft > 0 ? blocks.map((block) => {
33888
33905
  const hasPageRelativeAnchor = (block.kind === "image" || block.kind === "drawing") && block.anchor?.hRelativeFrom === "page" && block.anchor.offsetH != null;
@@ -33921,7 +33938,7 @@ function layoutHeaderFooter(blocks, measures, constraints) {
33921
33938
  );
33922
33939
  }
33923
33940
  const anchoredBlock = block;
33924
- if (anchoredBlock.anchor?.behindDoc && (fragment.y < minBehindDocY || fragment.y > maxBehindDocY)) {
33941
+ if (anchoredBlock.anchor?.behindDoc) {
33925
33942
  continue;
33926
33943
  }
33927
33944
  }
@@ -1,5 +1,5 @@
1
- import { B as BIT8, M as MAX_SAFE_INTEGER, c as create, a as BITS7, u as utf8TextDecoder, b as create$1, s as setIfUndefined, d as create$2, f as from, e as floor$1, g as equalityDeep, w as writeVarUint, h as writeVarString, t as toUint8Array, i as createEncoder, j as createInjectionKey, k as toString, l as throwError, m as useSsrAdapter, n as configProviderInjectionKey, o as cssrAnchorMetaName, p as globalStyle, q as cB, r as c, v as isMounted, x as commonVariables$2, y as cM, z as cNotM, A as cE, C as derived, D as changeColor, E as insideModal, F as insidePopover, G as resolveWrappedSlot, H as on, I as warnOnce, J as useConfig, K as useMergedState, L as useMemo, N as useTheme, O as useRtl, P as createKey, Q as useThemeClass, R as createId, S as call, T as render, U as messageProviderInjectionKey, V as messageApiInjectionKey, W as fromBase64, X as onChange, Y as varStorage, Z as toBase64, _ as createUint8ArrayFromArrayBuffer, $ as offChange, a0 as writeVarUint8Array, a1 as map, a2 as length, a3 as isNode, a4 as min, a5 as pow, a6 as comments_module_events, a7 as getFileObject, a8 as getTrackChanges, a9 as CommentsPluginKey, aa as TrackChangesBasePluginKey, ab as Editor, ac as getRichTextExtensions, ad as ellipsisVerticalSvg, ae as xmarkIconSvg, af as checkIconSvg, ag as caretDownIconSvg, ah as commentIconSvg, ai as _export_sfc, aj as NDropdown, ak as SuperInput, al as vClickOutside, am as PresentationEditor, an as SuperEditor, ao as AIWriter, ap as NConfigProvider, aq as SuperToolbar } from "./index-CqbujvlE.es.js";
2
- import "./SuperConverter-S9b1fFw5.es.js";
1
+ import { B as BIT8, M as MAX_SAFE_INTEGER, c as create, a as BITS7, u as utf8TextDecoder, b as create$1, s as setIfUndefined, d as create$2, f as from, e as floor$1, g as equalityDeep, w as writeVarUint, h as writeVarString, t as toUint8Array, i as createEncoder, j as createInjectionKey, k as toString, l as throwError, m as useSsrAdapter, n as configProviderInjectionKey, o as cssrAnchorMetaName, p as globalStyle, q as cB, r as c, v as isMounted, x as commonVariables$2, y as cM, z as cNotM, A as cE, C as derived, D as changeColor, E as insideModal, F as insidePopover, G as resolveWrappedSlot, H as on, I as warnOnce, J as useConfig, K as useMergedState, L as useMemo, N as useTheme, O as useRtl, P as createKey, Q as useThemeClass, R as createId, S as call, T as render, U as messageProviderInjectionKey, V as messageApiInjectionKey, W as fromBase64, X as onChange, Y as varStorage, Z as toBase64, _ as createUint8ArrayFromArrayBuffer, $ as offChange, a0 as writeVarUint8Array, a1 as map, a2 as length, a3 as isNode, a4 as min, a5 as pow, a6 as comments_module_events, a7 as getFileObject, a8 as getTrackChanges, a9 as CommentsPluginKey, aa as TrackChangesBasePluginKey, ab as Editor, ac as getRichTextExtensions, ad as ellipsisVerticalSvg, ae as xmarkIconSvg, af as checkIconSvg, ag as caretDownIconSvg, ah as commentIconSvg, ai as _export_sfc, aj as NDropdown, ak as SuperInput, al as vClickOutside, am as PresentationEditor, an as SuperEditor, ao as AIWriter, ap as NConfigProvider, aq as SuperToolbar } from "./index-BuT4cwmK.es.js";
2
+ import "./SuperConverter-Bc9dM-qO.es.js";
3
3
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
4
4
  import { E as EventEmitter } from "./eventemitter3-CwrdEv8r.es.js";
5
5
  import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
@@ -7444,7 +7444,7 @@ const _sfc_main = {
7444
7444
  __name: "SuperDoc",
7445
7445
  emits: ["selection-update"],
7446
7446
  setup(__props, { emit: __emit }) {
7447
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-oYYAvC47.es.js"));
7447
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-CnKGOFjP.es.js"));
7448
7448
  const superdocStore = useSuperdocStore();
7449
7449
  const commentsStore = useCommentsStore();
7450
7450
  const {
@@ -8350,7 +8350,7 @@ class SuperDoc extends EventEmitter {
8350
8350
  this.config.colors = shuffleArray(this.config.colors);
8351
8351
  this.userColorMap = /* @__PURE__ */ new Map();
8352
8352
  this.colorIndex = 0;
8353
- this.version = "1.3.0-next.6";
8353
+ this.version = "1.3.0-next.7";
8354
8354
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
8355
8355
  this.superdocId = config.superdocId || v4();
8356
8356
  this.colors = this.config.colors;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- const index = require("./index-C4RVDXKX.cjs");
3
- require("./SuperConverter-BdOf8skU.cjs");
2
+ const index = require("./index-CmmcvSxn.cjs");
3
+ require("./SuperConverter-BIrkxV37.cjs");
4
4
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
5
5
  const eventemitter3 = require("./eventemitter3-BQuRcMPI.cjs");
6
6
  const provider = require("@hocuspocus/provider");
@@ -7461,7 +7461,7 @@ const _sfc_main = {
7461
7461
  __name: "SuperDoc",
7462
7462
  emits: ["selection-update"],
7463
7463
  setup(__props, { emit: __emit }) {
7464
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-0pJuKd1x.cjs")));
7464
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-BolWPjJ9.cjs")));
7465
7465
  const superdocStore = useSuperdocStore();
7466
7466
  const commentsStore = useCommentsStore();
7467
7467
  const {
@@ -8367,7 +8367,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
8367
8367
  this.config.colors = shuffleArray(this.config.colors);
8368
8368
  this.userColorMap = /* @__PURE__ */ new Map();
8369
8369
  this.colorIndex = 0;
8370
- this.version = "1.3.0-next.6";
8370
+ this.version = "1.3.0-next.7";
8371
8371
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
8372
8372
  this.superdocId = config.superdocId || uuid.v4();
8373
8373
  this.colors = this.config.colors;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const jszip = require("./jszip-C8_CqJxM.cjs");
3
3
  const helpers$1 = require("./helpers-nOdwpmwb.cjs");
4
- const superEditor_converter = require("./SuperConverter-BdOf8skU.cjs");
4
+ const superEditor_converter = require("./SuperConverter-BIrkxV37.cjs");
5
5
  const vue = require("./vue-De9wkgLl.cjs");
6
6
  require("./jszip.min-BPh2MMAa.cjs");
7
7
  const eventemitter3 = require("./eventemitter3-BQuRcMPI.cjs");
@@ -15351,7 +15351,7 @@ const canUseDOM = () => {
15351
15351
  return false;
15352
15352
  }
15353
15353
  };
15354
- const summaryVersion = "1.3.0-next.6";
15354
+ const summaryVersion = "1.3.0-next.7";
15355
15355
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
15356
15356
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
15357
15357
  function mapAttributes(attrs) {
@@ -17984,7 +17984,7 @@ class Editor extends EventEmitter {
17984
17984
  * Process collaboration migrations
17985
17985
  */
17986
17986
  processCollaborationMigrations() {
17987
- console.debug("[checkVersionMigrations] Current editor version", "1.3.0-next.6");
17987
+ console.debug("[checkVersionMigrations] Current editor version", "1.3.0-next.7");
17988
17988
  if (!this.options.ydoc) return;
17989
17989
  const metaMap = this.options.ydoc.getMap("meta");
17990
17990
  let docVersion = metaMap.get("version");
@@ -25568,7 +25568,28 @@ class DomPainter {
25568
25568
  section: kind,
25569
25569
  pageNumberText: page.numberText
25570
25570
  };
25571
- data.fragments.forEach((fragment) => {
25571
+ const behindDocFragments = [];
25572
+ const normalFragments = [];
25573
+ for (const fragment of data.fragments) {
25574
+ const isBehindDoc = (fragment.kind === "image" || fragment.kind === "drawing") && "zIndex" in fragment && fragment.zIndex === 0;
25575
+ if (isBehindDoc) {
25576
+ behindDocFragments.push(fragment);
25577
+ } else {
25578
+ normalFragments.push(fragment);
25579
+ }
25580
+ }
25581
+ const behindDocSelector = `[data-behind-doc-section="${kind}"]`;
25582
+ pageEl.querySelectorAll(behindDocSelector).forEach((el) => el.remove());
25583
+ behindDocFragments.forEach((fragment) => {
25584
+ const fragEl = this.renderFragment(fragment, context);
25585
+ const pageY = effectiveOffset + fragment.y + (kind === "footer" ? footerYOffset : 0);
25586
+ fragEl.style.top = `${pageY}px`;
25587
+ fragEl.style.left = `${marginLeft + fragment.x}px`;
25588
+ fragEl.style.zIndex = "0";
25589
+ fragEl.dataset.behindDocSection = kind;
25590
+ pageEl.insertBefore(fragEl, pageEl.firstChild);
25591
+ });
25592
+ normalFragments.forEach((fragment) => {
25572
25593
  const fragEl = this.renderFragment(fragment, context);
25573
25594
  if (footerYOffset > 0) {
25574
25595
  const currentTop = parseFloat(fragEl.style.top) || fragment.y;
@@ -33896,10 +33917,6 @@ function layoutHeaderFooter(blocks, measures, constraints) {
33896
33917
  if (!Number.isFinite(height) || height <= 0) {
33897
33918
  return { pages: [], height: 0 };
33898
33919
  }
33899
- const overflowBase = typeof constraints.overflowBaseHeight === "number" && Number.isFinite(constraints.overflowBaseHeight) && constraints.overflowBaseHeight > 0 ? constraints.overflowBaseHeight : height;
33900
- const maxBehindDocOverflow = Math.max(192, overflowBase * 4);
33901
- const minBehindDocY = -maxBehindDocOverflow;
33902
- const maxBehindDocY = height + maxBehindDocOverflow;
33903
33920
  const marginLeft = constraints.margins?.left ?? 0;
33904
33921
  const transformedBlocks = marginLeft > 0 ? blocks.map((block) => {
33905
33922
  const hasPageRelativeAnchor = (block.kind === "image" || block.kind === "drawing") && block.anchor?.hRelativeFrom === "page" && block.anchor.offsetH != null;
@@ -33938,7 +33955,7 @@ function layoutHeaderFooter(blocks, measures, constraints) {
33938
33955
  );
33939
33956
  }
33940
33957
  const anchoredBlock = block;
33941
- if (anchoredBlock.anchor?.behindDoc && (fragment.y < minBehindDocY || fragment.y > maxBehindDocY)) {
33958
+ if (anchoredBlock.anchor?.behindDoc) {
33942
33959
  continue;
33943
33960
  }
33944
33961
  }
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("../chunks/jszip-C8_CqJxM.cjs");
4
4
  require("../chunks/helpers-nOdwpmwb.cjs");
5
- const superEditor_converter = require("../chunks/SuperConverter-BdOf8skU.cjs");
5
+ const superEditor_converter = require("../chunks/SuperConverter-BIrkxV37.cjs");
6
6
  require("../chunks/uuid-R7L08bOx.cjs");
7
7
  exports.SuperConverter = superEditor_converter.SuperConverter;
@@ -1,6 +1,6 @@
1
1
  import "../chunks/jszip-B1fkPkPJ.es.js";
2
2
  import "../chunks/helpers-C8e9wR5l.es.js";
3
- import { S } from "../chunks/SuperConverter-S9b1fFw5.es.js";
3
+ import { S } from "../chunks/SuperConverter-Bc9dM-qO.es.js";
4
4
  import "../chunks/uuid-CjlX8hrF.es.js";
5
5
  export {
6
6
  S as SuperConverter
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./chunks/index-C4RVDXKX.cjs");
3
+ const index = require("./chunks/index-CmmcvSxn.cjs");
4
4
  const superEditor_docxZipper = require("./super-editor/docx-zipper.cjs");
5
5
  const superEditor_fileZipper = require("./super-editor/file-zipper.cjs");
6
6
  const vue = require("./chunks/vue-De9wkgLl.cjs");
7
- const superEditor_converter = require("./chunks/SuperConverter-BdOf8skU.cjs");
7
+ const superEditor_converter = require("./chunks/SuperConverter-BIrkxV37.cjs");
8
8
  function isNodeType(node, name) {
9
9
  return node.type.name === name;
10
10
  }
@@ -1,9 +1,9 @@
1
- import { ax as Node, ay as Mark } from "./chunks/index-CqbujvlE.es.js";
2
- import { ao, au, a9, ab, aw, am, av, aA, an, ak, aq, az, aa, as, aC, aE, aB, ac, aD, ar, at } from "./chunks/index-CqbujvlE.es.js";
1
+ import { ax as Node, ay as Mark } from "./chunks/index-BuT4cwmK.es.js";
2
+ import { ao, au, a9, ab, aw, am, av, aA, an, ak, aq, az, aa, as, aC, aE, aB, ac, aD, ar, at } from "./chunks/index-BuT4cwmK.es.js";
3
3
  import { default as default2 } from "./super-editor/docx-zipper.es.js";
4
4
  import { createZip } from "./super-editor/file-zipper.es.js";
5
5
  import { d as defineComponent, E as createElementBlock, G as openBlock, K as createBaseVNode } from "./chunks/vue-BnBKJwCW.es.js";
6
- import { S, r } from "./chunks/SuperConverter-S9b1fFw5.es.js";
6
+ import { S, r } from "./chunks/SuperConverter-Bc9dM-qO.es.js";
7
7
  function isNodeType(node, name) {
8
8
  return node.type.name === name;
9
9
  }
package/dist/superdoc.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./chunks/index-C4RVDXKX.cjs");
4
- const superdoc = require("./chunks/index-CEDW4NYV.cjs");
5
- const superEditor_converter = require("./chunks/SuperConverter-BdOf8skU.cjs");
3
+ const index = require("./chunks/index-CmmcvSxn.cjs");
4
+ const superdoc = require("./chunks/index-CKi-JNoY.cjs");
5
+ const superEditor_converter = require("./chunks/SuperConverter-BIrkxV37.cjs");
6
6
  const blankDocx = require("./chunks/blank-docx-DfW3Eeh2.cjs");
7
7
  require("./chunks/jszip-C8_CqJxM.cjs");
8
8
  require("./chunks/helpers-nOdwpmwb.cjs");
@@ -1,6 +1,6 @@
1
- import { au, ab, aw, av, as, a7, ac, ar, at } from "./chunks/index-CqbujvlE.es.js";
2
- import { D, H, P, S, c } from "./chunks/index-9qGjdWOS.es.js";
3
- import { S as S2, r } from "./chunks/SuperConverter-S9b1fFw5.es.js";
1
+ import { au, ab, aw, av, as, a7, ac, ar, at } from "./chunks/index-BuT4cwmK.es.js";
2
+ import { D, H, P, S, c } from "./chunks/index-C0irsRkX.es.js";
3
+ import { S as S2, r } from "./chunks/SuperConverter-Bc9dM-qO.es.js";
4
4
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
5
5
  import "./chunks/jszip-B1fkPkPJ.es.js";
6
6
  import "./chunks/helpers-C8e9wR5l.es.js";
@@ -36366,7 +36366,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36366
36366
  static getStoredSuperdocVersion(docx) {
36367
36367
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
36368
36368
  }
36369
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.3.0-next.6") {
36369
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.3.0-next.7") {
36370
36370
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
36371
36371
  }
36372
36372
  /**
@@ -62076,7 +62076,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
62076
62076
  return false;
62077
62077
  }
62078
62078
  };
62079
- const summaryVersion = "1.3.0-next.6";
62079
+ const summaryVersion = "1.3.0-next.7";
62080
62080
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
62081
62081
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
62082
62082
  function mapAttributes(attrs) {
@@ -64710,7 +64710,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
64710
64710
  * Process collaboration migrations
64711
64711
  */
64712
64712
  processCollaborationMigrations() {
64713
- console.debug("[checkVersionMigrations] Current editor version", "1.3.0-next.6");
64713
+ console.debug("[checkVersionMigrations] Current editor version", "1.3.0-next.7");
64714
64714
  if (!this.options.ydoc) return;
64715
64715
  const metaMap = this.options.ydoc.getMap("meta");
64716
64716
  let docVersion = metaMap.get("version");
@@ -72296,7 +72296,28 @@ ${l}
72296
72296
  section: kind,
72297
72297
  pageNumberText: page.numberText
72298
72298
  };
72299
- data.fragments.forEach((fragment) => {
72299
+ const behindDocFragments = [];
72300
+ const normalFragments = [];
72301
+ for (const fragment of data.fragments) {
72302
+ const isBehindDoc = (fragment.kind === "image" || fragment.kind === "drawing") && "zIndex" in fragment && fragment.zIndex === 0;
72303
+ if (isBehindDoc) {
72304
+ behindDocFragments.push(fragment);
72305
+ } else {
72306
+ normalFragments.push(fragment);
72307
+ }
72308
+ }
72309
+ const behindDocSelector = `[data-behind-doc-section="${kind}"]`;
72310
+ pageEl.querySelectorAll(behindDocSelector).forEach((el) => el.remove());
72311
+ behindDocFragments.forEach((fragment) => {
72312
+ const fragEl = this.renderFragment(fragment, context);
72313
+ const pageY = effectiveOffset + fragment.y + (kind === "footer" ? footerYOffset : 0);
72314
+ fragEl.style.top = `${pageY}px`;
72315
+ fragEl.style.left = `${marginLeft + fragment.x}px`;
72316
+ fragEl.style.zIndex = "0";
72317
+ fragEl.dataset.behindDocSection = kind;
72318
+ pageEl.insertBefore(fragEl, pageEl.firstChild);
72319
+ });
72320
+ normalFragments.forEach((fragment) => {
72300
72321
  const fragEl = this.renderFragment(fragment, context);
72301
72322
  if (footerYOffset > 0) {
72302
72323
  const currentTop = parseFloat(fragEl.style.top) || fragment.y;
@@ -80623,10 +80644,6 @@ ${l}
80623
80644
  if (!Number.isFinite(height) || height <= 0) {
80624
80645
  return { pages: [], height: 0 };
80625
80646
  }
80626
- const overflowBase = typeof constraints.overflowBaseHeight === "number" && Number.isFinite(constraints.overflowBaseHeight) && constraints.overflowBaseHeight > 0 ? constraints.overflowBaseHeight : height;
80627
- const maxBehindDocOverflow = Math.max(192, overflowBase * 4);
80628
- const minBehindDocY = -maxBehindDocOverflow;
80629
- const maxBehindDocY = height + maxBehindDocOverflow;
80630
80647
  const marginLeft = constraints.margins?.left ?? 0;
80631
80648
  const transformedBlocks = marginLeft > 0 ? blocks2.map((block) => {
80632
80649
  const hasPageRelativeAnchor = (block.kind === "image" || block.kind === "drawing") && block.anchor?.hRelativeFrom === "page" && block.anchor.offsetH != null;
@@ -80665,7 +80682,7 @@ ${l}
80665
80682
  );
80666
80683
  }
80667
80684
  const anchoredBlock = block;
80668
- if (anchoredBlock.anchor?.behindDoc && (fragment.y < minBehindDocY || fragment.y > maxBehindDocY)) {
80685
+ if (anchoredBlock.anchor?.behindDoc) {
80669
80686
  continue;
80670
80687
  }
80671
80688
  }
@@ -144013,7 +144030,7 @@ ${reason}`);
144013
144030
  this.config.colors = shuffleArray(this.config.colors);
144014
144031
  this.userColorMap = /* @__PURE__ */ new Map();
144015
144032
  this.colorIndex = 0;
144016
- this.version = "1.3.0-next.6";
144033
+ this.version = "1.3.0-next.7";
144017
144034
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
144018
144035
  this.superdocId = config2.superdocId || v4();
144019
144036
  this.colors = this.config.colors;