superdoc 1.3.0-next.11 → 1.3.0-next.12

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-CTQjsYpZ.cjs");
5
- const index = require("./index-BClM7AjD.cjs");
4
+ const superdoc = require("./index-BC056HXc.cjs");
5
+ const index = require("./index-CCWqRqAf.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-D2CRfjhH.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-CE0fU2k7.es.js";
2
+ import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-BPi2Cjky.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-BRomAwaA.es.js";
4
4
  function self(vars) {
5
5
  const {
6
6
  opacityDisabled,
@@ -31007,7 +31007,7 @@ class SuperConverter {
31007
31007
  static getStoredSuperdocVersion(docx) {
31008
31008
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
31009
31009
  }
31010
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.3.0-next.11") {
31010
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.3.0-next.12") {
31011
31011
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
31012
31012
  }
31013
31013
  /**
@@ -31685,17 +31685,18 @@ export {
31685
31685
  translator$14 as a0,
31686
31686
  translator$1O as a1,
31687
31687
  resolveDocxFontFamily as a2,
31688
- _getReferencedTableStyles as a3,
31689
- decodeRPrFromMarks as a4,
31690
- calculateResolvedParagraphProperties as a5,
31691
- encodeCSSFromPPr as a6,
31692
- encodeCSSFromRPr as a7,
31693
- generateOrderedListIndex as a8,
31694
- docxNumberingHelpers as a9,
31695
- InputRule as aa,
31696
- insertNewRelationship as ab,
31697
- kebabCase as ac,
31698
- getUnderlineCssString as ad,
31688
+ combineIndentProperties as a3,
31689
+ _getReferencedTableStyles as a4,
31690
+ decodeRPrFromMarks as a5,
31691
+ calculateResolvedParagraphProperties as a6,
31692
+ encodeCSSFromPPr as a7,
31693
+ encodeCSSFromRPr as a8,
31694
+ generateOrderedListIndex as a9,
31695
+ docxNumberingHelpers as aa,
31696
+ InputRule as ab,
31697
+ insertNewRelationship as ac,
31698
+ kebabCase as ad,
31699
+ getUnderlineCssString as ae,
31699
31700
  chainableEditorState as b,
31700
31701
  createDocFromMarkdown as c,
31701
31702
  convertMarkdownToHTML as d,
@@ -31008,7 +31008,7 @@ class SuperConverter {
31008
31008
  static getStoredSuperdocVersion(docx) {
31009
31009
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
31010
31010
  }
31011
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.3.0-next.11") {
31011
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.3.0-next.12") {
31012
31012
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
31013
31013
  }
31014
31014
  /**
@@ -31686,6 +31686,7 @@ exports.canJoin = canJoin;
31686
31686
  exports.canSplit = canSplit;
31687
31687
  exports.chainableEditorState = chainableEditorState;
31688
31688
  exports.changeListLevel = changeListLevel;
31689
+ exports.combineIndentProperties = combineIndentProperties;
31689
31690
  exports.convertMarkdownToHTML = convertMarkdownToHTML;
31690
31691
  exports.createDocFromHTML = createDocFromHTML;
31691
31692
  exports.createDocFromMarkdown = createDocFromMarkdown;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- const index = require("./index-BClM7AjD.cjs");
3
- require("./SuperConverter-DgyRPhnD.cjs");
2
+ const index = require("./index-CCWqRqAf.cjs");
3
+ require("./SuperConverter-BauKfBRr.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");
@@ -7465,7 +7465,7 @@ const _sfc_main = {
7465
7465
  __name: "SuperDoc",
7466
7466
  emits: ["selection-update"],
7467
7467
  setup(__props, { emit: __emit }) {
7468
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-DxthqP0q.cjs")));
7468
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-B4cw8sRa.cjs")));
7469
7469
  const superdocStore = useSuperdocStore();
7470
7470
  const commentsStore = useCommentsStore();
7471
7471
  const {
@@ -8371,7 +8371,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
8371
8371
  this.config.colors = shuffleArray(this.config.colors);
8372
8372
  this.userColorMap = /* @__PURE__ */ new Map();
8373
8373
  this.colorIndex = 0;
8374
- this.version = "1.3.0-next.11";
8374
+ this.version = "1.3.0-next.12";
8375
8375
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
8376
8376
  this.superdocId = config.superdocId || uuid.v4();
8377
8377
  this.colors = this.config.colors;
@@ -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-CE0fU2k7.es.js";
2
- import "./SuperConverter-Caxoktb7.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-BRomAwaA.es.js";
2
+ import "./SuperConverter-BQHQ2WON.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";
@@ -7448,7 +7448,7 @@ const _sfc_main = {
7448
7448
  __name: "SuperDoc",
7449
7449
  emits: ["selection-update"],
7450
7450
  setup(__props, { emit: __emit }) {
7451
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-Dsxwbxdh.es.js"));
7451
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-D4-tXW9I.es.js"));
7452
7452
  const superdocStore = useSuperdocStore();
7453
7453
  const commentsStore = useCommentsStore();
7454
7454
  const {
@@ -8354,7 +8354,7 @@ class SuperDoc extends EventEmitter {
8354
8354
  this.config.colors = shuffleArray(this.config.colors);
8355
8355
  this.userColorMap = /* @__PURE__ */ new Map();
8356
8356
  this.colorIndex = 0;
8357
- this.version = "1.3.0-next.11";
8357
+ this.version = "1.3.0-next.12";
8358
8358
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
8359
8359
  this.superdocId = config.superdocId || v4();
8360
8360
  this.colors = this.config.colors;
@@ -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-Caxoktb7.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 combineIndentProperties, a4 as _getReferencedTableStyles, a5 as decodeRPrFromMarks, a6 as calculateResolvedParagraphProperties, a7 as encodeCSSFromPPr, a8 as encodeCSSFromRPr, a9 as generateOrderedListIndex, aa as docxNumberingHelpers, ab as InputRule, ac as insertNewRelationship, ad as kebabCase$1, ae as getUnderlineCssString } from "./SuperConverter-BQHQ2WON.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";
@@ -10936,6 +10936,105 @@ const setSectionHeaderFooterAtSelection = ({ headerInches, footerInches } = {})
10936
10936
  tr.setNodeMarkup(pos, void 0, nextAttrs, node.marks);
10937
10937
  return true;
10938
10938
  };
10939
+ function findGoverningSectPrParagraph(doc2, selectionPos) {
10940
+ const candidates = [];
10941
+ doc2.descendants((node, nodePos) => {
10942
+ if (node.type?.name === "paragraph" && node.attrs?.paragraphProperties?.sectPr) {
10943
+ candidates.push({ node, pos: nodePos });
10944
+ }
10945
+ });
10946
+ if (!candidates.length) return null;
10947
+ const inside = candidates.find((c2) => selectionPos >= c2.pos && selectionPos < c2.pos + c2.node.nodeSize);
10948
+ if (inside) return inside;
10949
+ const atOrAfter = candidates.find((c2) => c2.pos >= selectionPos);
10950
+ return atOrAfter ?? candidates[candidates.length - 1];
10951
+ }
10952
+ const setSectionPageMarginsAtSelection = ({ topInches, rightInches, bottomInches, leftInches } = {}) => ({ tr, state, editor }) => {
10953
+ if (!state || !editor) {
10954
+ console.warn("[setSectionPageMarginsAtSelection] Missing state or editor");
10955
+ return false;
10956
+ }
10957
+ const hasTop = typeof topInches === "number";
10958
+ const hasRight = typeof rightInches === "number";
10959
+ const hasBottom = typeof bottomInches === "number";
10960
+ const hasLeft = typeof leftInches === "number";
10961
+ if (!hasTop && !hasRight && !hasBottom && !hasLeft) {
10962
+ console.warn("[setSectionPageMarginsAtSelection] No margin values provided");
10963
+ return false;
10964
+ }
10965
+ if (hasTop && topInches < 0 || hasRight && rightInches < 0 || hasBottom && bottomInches < 0 || hasLeft && leftInches < 0) {
10966
+ console.warn("[setSectionPageMarginsAtSelection] Margin values must be >= 0");
10967
+ return false;
10968
+ }
10969
+ const updates = {};
10970
+ if (hasTop) updates.topInches = topInches;
10971
+ if (hasRight) updates.rightInches = rightInches;
10972
+ if (hasBottom) updates.bottomInches = bottomInches;
10973
+ if (hasLeft) updates.leftInches = leftInches;
10974
+ const { from: from3 } = state.selection;
10975
+ const governing = findGoverningSectPrParagraph(state.doc, from3);
10976
+ if (governing) {
10977
+ const { node, pos } = governing;
10978
+ const paraProps = node.attrs?.paragraphProperties || null;
10979
+ const existingSectPr = paraProps?.sectPr || null;
10980
+ if (!existingSectPr) {
10981
+ console.warn("[setSectionPageMarginsAtSelection] Paragraph found but has no sectPr");
10982
+ return false;
10983
+ }
10984
+ const sectPr2 = JSON.parse(JSON.stringify(existingSectPr));
10985
+ try {
10986
+ updateSectionMargins({ type: "sectPr", sectPr: sectPr2 }, updates);
10987
+ } catch (err) {
10988
+ console.error("[setSectionPageMarginsAtSelection] Failed to update sectPr:", err);
10989
+ return false;
10990
+ }
10991
+ const resolved = getSectPrMargins(sectPr2);
10992
+ const normalizedSectionMargins = {
10993
+ top: resolved.top ?? null,
10994
+ right: resolved.right ?? null,
10995
+ bottom: resolved.bottom ?? null,
10996
+ left: resolved.left ?? null,
10997
+ header: resolved.header ?? null,
10998
+ footer: resolved.footer ?? null
10999
+ };
11000
+ const newParagraphProperties = { ...paraProps || {}, sectPr: sectPr2 };
11001
+ const nextAttrs = {
11002
+ ...node.attrs,
11003
+ paragraphProperties: newParagraphProperties,
11004
+ sectionMargins: normalizedSectionMargins
11005
+ };
11006
+ tr.setNodeMarkup(pos, void 0, nextAttrs, node.marks);
11007
+ tr.setMeta("forceUpdatePagination", true);
11008
+ return true;
11009
+ }
11010
+ const docAttrs = state.doc.attrs ?? {};
11011
+ const converter = editor.converter ?? null;
11012
+ const baseBodySectPr = docAttrs.bodySectPr || converter?.bodySectPr || null;
11013
+ const sectPr = baseBodySectPr != null ? JSON.parse(JSON.stringify(baseBodySectPr)) : { type: "element", name: "w:sectPr", elements: [] };
11014
+ try {
11015
+ updateSectionMargins({ type: "sectPr", sectPr }, updates);
11016
+ } catch (err) {
11017
+ console.error("[setSectionPageMarginsAtSelection] Failed to update sectPr:", err);
11018
+ return false;
11019
+ }
11020
+ if (converter) {
11021
+ converter.bodySectPr = sectPr;
11022
+ if (!converter.pageStyles) converter.pageStyles = {};
11023
+ if (!converter.pageStyles.pageMargins) converter.pageStyles.pageMargins = {};
11024
+ const pageMargins = converter.pageStyles.pageMargins;
11025
+ const resolved = getSectPrMargins(sectPr);
11026
+ if (resolved.top != null) pageMargins.top = resolved.top;
11027
+ if (resolved.right != null) pageMargins.right = resolved.right;
11028
+ if (resolved.bottom != null) pageMargins.bottom = resolved.bottom;
11029
+ if (resolved.left != null) pageMargins.left = resolved.left;
11030
+ if (resolved.header != null) pageMargins.header = resolved.header;
11031
+ if (resolved.footer != null) pageMargins.footer = resolved.footer;
11032
+ }
11033
+ const nextDocAttrs = { ...docAttrs, bodySectPr: sectPr };
11034
+ tr.setNodeMarkup(0, void 0, nextDocAttrs);
11035
+ tr.setMeta("forceUpdatePagination", true);
11036
+ return true;
11037
+ };
10939
11038
  const insertSectionBreakAtSelection = ({ headerInches, footerInches } = {}) => ({ tr, state, editor }) => {
10940
11039
  if (!state || !editor) {
10941
11040
  console.warn("[insertSectionBreakAtSelection] Missing state or editor");
@@ -11467,6 +11566,7 @@ const commands$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
11467
11566
  setMeta,
11468
11567
  setNode,
11469
11568
  setSectionHeaderFooterAtSelection,
11569
+ setSectionPageMarginsAtSelection,
11470
11570
  setTextIndentation,
11471
11571
  setTextSelection,
11472
11572
  skipTab,
@@ -15334,7 +15434,7 @@ const canUseDOM = () => {
15334
15434
  return false;
15335
15435
  }
15336
15436
  };
15337
- const summaryVersion = "1.3.0-next.11";
15437
+ const summaryVersion = "1.3.0-next.12";
15338
15438
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
15339
15439
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
15340
15440
  function mapAttributes(attrs) {
@@ -17336,9 +17436,8 @@ class Editor extends EventEmitter {
17336
17436
  try {
17337
17437
  const jsonObj = json;
17338
17438
  const attrs = jsonObj.attrs;
17339
- const hasBody = attrs && "bodySectPr" in attrs;
17340
17439
  const converter = this.converter;
17341
- if (!hasBody && converter && converter.bodySectPr) {
17440
+ if (converter && converter.bodySectPr) {
17342
17441
  jsonObj.attrs = attrs || {};
17343
17442
  jsonObj.attrs.bodySectPr = converter.bodySectPr;
17344
17443
  }
@@ -17967,7 +18066,7 @@ class Editor extends EventEmitter {
17967
18066
  * Process collaboration migrations
17968
18067
  */
17969
18068
  processCollaborationMigrations() {
17970
- console.debug("[checkVersionMigrations] Current editor version", "1.3.0-next.11");
18069
+ console.debug("[checkVersionMigrations] Current editor version", "1.3.0-next.12");
17971
18070
  if (!this.options.ydoc) return;
17972
18071
  const metaMap = this.options.ydoc.getMap("meta");
17973
18072
  let docVersion = metaMap.get("version");
@@ -43338,7 +43437,16 @@ const computeParagraphAttrs = (para, styleContext, listCounterContext, converter
43338
43437
  if (!value || typeof value !== "object") return;
43339
43438
  return normalizePxIndent(value) ?? convertIndentTwipsToPx(value);
43340
43439
  };
43341
- const normalizedIndent = normalizeIndentObject(attrs.indent) ?? convertIndentTwipsToPx(paragraphProps.indent) ?? convertIndentTwipsToPx(hydrated?.indent) ?? normalizeParagraphIndent(attrs.textIndent);
43440
+ const hydratedIndentPx = convertIndentTwipsToPx(hydrated?.indent);
43441
+ const paragraphIndentPx = convertIndentTwipsToPx(paragraphProps.indent);
43442
+ const textIndentPx = normalizeParagraphIndent(attrs.textIndent);
43443
+ const attrsIndentPx = normalizeIndentObject(attrs.indent);
43444
+ const indentChain = [];
43445
+ if (hydratedIndentPx) indentChain.push({ indent: hydratedIndentPx });
43446
+ if (paragraphIndentPx) indentChain.push({ indent: paragraphIndentPx });
43447
+ if (textIndentPx) indentChain.push({ indent: textIndentPx });
43448
+ if (attrsIndentPx) indentChain.push({ indent: attrsIndentPx });
43449
+ const normalizedIndent = indentChain.length ? combineIndentProperties(indentChain).indent : void 0;
43342
43450
  const unwrapTabStops = (tabStops) => {
43343
43451
  if (!Array.isArray(tabStops)) {
43344
43452
  return void 0;
@@ -49594,7 +49702,11 @@ async function measureTableBlock(block, constraints) {
49594
49702
  }
49595
49703
  async function measureImageBlock(block, constraints) {
49596
49704
  const intrinsic = getIntrinsicImageSize(block, constraints.maxWidth);
49597
- const maxWidth = constraints.maxWidth > 0 ? constraints.maxWidth : intrinsic.width;
49705
+ const isBlockBehindDoc = block.anchor?.behindDoc;
49706
+ const isBlockWrapBehindDoc = block.wrap?.type === "None" && block.wrap?.behindDoc;
49707
+ const bypassWidthConstraint = isBlockBehindDoc || isBlockWrapBehindDoc;
49708
+ const isWidthConstraintBypassed = bypassWidthConstraint || constraints.maxWidth <= 0;
49709
+ const maxWidth = isWidthConstraintBypassed ? intrinsic.width : constraints.maxWidth;
49598
49710
  const hasNegativeVerticalPosition = block.anchor?.isAnchored && (typeof block.anchor?.offsetV === "number" && block.anchor.offsetV < 0 || typeof block.margin?.top === "number" && block.margin.top < 0);
49599
49711
  const maxHeight = hasNegativeVerticalPosition || !constraints.maxHeight || constraints.maxHeight <= 0 ? Infinity : constraints.maxHeight;
49600
49712
  const widthScale = maxWidth / intrinsic.width;
@@ -57826,7 +57938,11 @@ const Document = Node$1.create({
57826
57938
  */
57827
57939
  clearDocument: () => ({ commands: commands2 }) => {
57828
57940
  return commands2.setContent("<p></p>");
57829
- }
57941
+ },
57942
+ /**
57943
+ * Set section page margins (top/right/bottom/left) for the section at the current selection.
57944
+ */
57945
+ setSectionPageMarginsAtSelection
57830
57946
  };
57831
57947
  }
57832
57948
  });
@@ -64335,6 +64451,10 @@ const Image = Node$1.create({
64335
64451
  }
64336
64452
  const hasAnchorData = Boolean(anchorData);
64337
64453
  const hasMarginOffsets = marginOffset?.horizontal != null || marginOffset?.top != null;
64454
+ const isWrapBehindDoc = wrap?.attrs?.behindDoc;
64455
+ const isAnchorBehindDoc = anchorData?.behindDoc;
64456
+ const isBehindDocAnchor = wrap?.type === "None" && (isWrapBehindDoc || isAnchorBehindDoc);
64457
+ const isAbsolutelyPositioned = style2.includes("position: absolute;");
64338
64458
  if (hasAnchorData) {
64339
64459
  switch (anchorData.hRelativeFrom) {
64340
64460
  case "page":
@@ -64362,7 +64482,6 @@ const Image = Node$1.create({
64362
64482
  style2 += "float: left;";
64363
64483
  }
64364
64484
  } else if (!anchorData.alignH && marginOffset?.horizontal != null) {
64365
- const isAbsolutelyPositioned = style2.includes("position: absolute;");
64366
64485
  if (isAbsolutelyPositioned) {
64367
64486
  style2 += `left: ${baseHorizontal}px;`;
64368
64487
  style2 += "max-width: none;";
@@ -64376,7 +64495,8 @@ const Image = Node$1.create({
64376
64495
  const relativeFromPageV = anchorData?.vRelativeFrom === "page";
64377
64496
  const relativeFromMarginV = anchorData?.vRelativeFrom === "margin";
64378
64497
  const maxMarginV = 500;
64379
- const baseTop = Math.max(0, marginOffset?.top ?? 0);
64498
+ const allowNegativeTopOffset = isBehindDocAnchor;
64499
+ const baseTop = allowNegativeTopOffset ? marginOffset?.top ?? 0 : Math.max(0, marginOffset?.top ?? 0);
64380
64500
  let rotationHorizontal = 0;
64381
64501
  let rotationTop = 0;
64382
64502
  const { rotation: rotation2 } = transformData ?? {};
@@ -64395,7 +64515,10 @@ const Image = Node$1.create({
64395
64515
  margin.left += horizontal;
64396
64516
  }
64397
64517
  }
64398
- if (top2 && !relativeFromMarginV) {
64518
+ const appliedTopViaStyle = isAbsolutelyPositioned && allowNegativeTopOffset && !relativeFromMarginV;
64519
+ if (appliedTopViaStyle) {
64520
+ style2 += `top: ${top2}px;`;
64521
+ } else if (top2 && !relativeFromMarginV) {
64399
64522
  if (relativeFromPageV && top2 >= maxMarginV) margin.top += maxMarginV;
64400
64523
  else margin.top += top2;
64401
64524
  }
@@ -64408,6 +64531,9 @@ const Image = Node$1.create({
64408
64531
  }
64409
64532
  if (margin.top) style2 += `margin-top: ${margin.top}px;`;
64410
64533
  if (margin.bottom) style2 += `margin-bottom: ${margin.bottom}px;`;
64534
+ if (isBehindDocAnchor) {
64535
+ style2 += "max-width: none;";
64536
+ }
64411
64537
  const finalAttributes = { ...htmlAttributes };
64412
64538
  if (style2) {
64413
64539
  const existingStyle = finalAttributes.style || "";
@@ -90217,10 +90343,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
90217
90343
  const handleMarginChange = ({ side, value }) => {
90218
90344
  const base2 = activeEditor.value;
90219
90345
  if (!base2) return;
90220
- const pageStyles2 = base2.getPageStyles();
90221
- const { pageMargins } = pageStyles2;
90222
- const update = { ...pageMargins, [side]: value };
90223
- base2?.updatePageStyle({ pageMargins: update });
90346
+ const payload = side === "left" ? { leftInches: value } : side === "right" ? { rightInches: value } : side === "top" ? { topInches: value } : side === "bottom" ? { bottomInches: value } : {};
90347
+ const didUpdateSection = typeof base2.commands?.setSectionPageMarginsAtSelection === "function" ? base2.commands.setSectionPageMarginsAtSelection(payload) : false;
90348
+ if (!didUpdateSection) {
90349
+ const pageStyles2 = base2.getPageStyles();
90350
+ const { pageMargins } = pageStyles2;
90351
+ const update = { ...pageMargins, [side]: value };
90352
+ base2?.updatePageStyle({ pageMargins: update });
90353
+ }
90224
90354
  };
90225
90355
  onBeforeUnmount(() => {
90226
90356
  stopPolling();
@@ -90356,7 +90486,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
90356
90486
  };
90357
90487
  }
90358
90488
  });
90359
- const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-8dd4cf59"]]);
90489
+ const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-3e9da07c"]]);
90360
90490
  const _hoisted_1 = ["innerHTML"];
90361
90491
  const _sfc_main = {
90362
90492
  __name: "SuperInput",