@harbour-enterprises/superdoc 1.2.0-next.5 → 1.2.0-next.6

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-1zcZTe7X.cjs");
5
- const index = require("./index-CANjnoRM.cjs");
4
+ const superdoc = require("./index-DPtR8yGc.cjs");
5
+ const index = require("./index-Dxieqftp.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-BaSA-M8A.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-rOfYo70H.es.js";
2
+ import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-D-gl9GKa.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-C18YjNKj.es.js";
4
4
  function self(vars) {
5
5
  const {
6
6
  opacityDisabled,
@@ -30737,7 +30737,7 @@ class SuperConverter {
30737
30737
  static getStoredSuperdocVersion(docx) {
30738
30738
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
30739
30739
  }
30740
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.2.0-next.5") {
30740
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.2.0-next.6") {
30741
30741
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
30742
30742
  }
30743
30743
  /**
@@ -30738,7 +30738,7 @@ class SuperConverter {
30738
30738
  static getStoredSuperdocVersion(docx) {
30739
30739
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
30740
30740
  }
30741
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.2.0-next.5") {
30741
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.2.0-next.6") {
30742
30742
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
30743
30743
  }
30744
30744
  /**
@@ -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, c as twipsToPixels$2, d as convertSizeToCSS, e as inchesToPixels } from "./helpers-CAUq8coh.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 liftTarget, u as canJoin, v as joinPoint, x as replaceStep$1, R as ReplaceAroundStep$1, y as htmlHandler, z as ReplaceStep, B as getResolvedParagraphProperties, C as changeListLevel, E as isList$1, G as updateNumberingProperties, L as ListHelpers, H as inputRulesPlugin, I as TrackDeleteMarkName$1, J as TrackInsertMarkName$1, K as TrackFormatMarkName$1, O as AddMarkStep, Q as RemoveMarkStep, U as CommandService, S as SuperConverter, V as EditorState, W as unflattenListsInHtml, X as SelectionRange, Y as Transform, Z as resolveParagraphProperties, _ as _getReferencedTableStyles, $ as decodeRPrFromMarks, a0 as calculateResolvedParagraphProperties, a1 as resolveRunProperties, a2 as encodeCSSFromPPr, a3 as encodeCSSFromRPr, a4 as generateOrderedListIndex, a5 as docxNumberingHelpers, a6 as InputRule, a7 as insertNewRelationship, a8 as kebabCase$1, a9 as getUnderlineCssString } from "./SuperConverter-CuiRnbJX.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 liftTarget, u as canJoin, v as joinPoint, x as replaceStep$1, R as ReplaceAroundStep$1, y as htmlHandler, z as ReplaceStep, B as getResolvedParagraphProperties, C as changeListLevel, E as isList$1, G as updateNumberingProperties, L as ListHelpers, H as inputRulesPlugin, I as TrackDeleteMarkName$1, J as TrackInsertMarkName$1, K as TrackFormatMarkName$1, O as AddMarkStep, Q as RemoveMarkStep, U as CommandService, S as SuperConverter, V as EditorState, W as unflattenListsInHtml, X as SelectionRange, Y as Transform, Z as resolveParagraphProperties, _ as _getReferencedTableStyles, $ as decodeRPrFromMarks, a0 as calculateResolvedParagraphProperties, a1 as resolveRunProperties, a2 as encodeCSSFromPPr, a3 as encodeCSSFromRPr, a4 as generateOrderedListIndex, a5 as docxNumberingHelpers, a6 as InputRule, a7 as insertNewRelationship, a8 as kebabCase$1, a9 as getUnderlineCssString } from "./SuperConverter-BigfCP5Z.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";
@@ -14898,7 +14898,7 @@ const canUseDOM = () => {
14898
14898
  return false;
14899
14899
  }
14900
14900
  };
14901
- const summaryVersion = "1.2.0-next.5";
14901
+ const summaryVersion = "1.2.0-next.6";
14902
14902
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
14903
14903
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
14904
14904
  function mapAttributes(attrs) {
@@ -17531,7 +17531,7 @@ class Editor extends EventEmitter {
17531
17531
  * Process collaboration migrations
17532
17532
  */
17533
17533
  processCollaborationMigrations() {
17534
- console.debug("[checkVersionMigrations] Current editor version", "1.2.0-next.5");
17534
+ console.debug("[checkVersionMigrations] Current editor version", "1.2.0-next.6");
17535
17535
  if (!this.options.ydoc) return;
17536
17536
  const metaMap = this.options.ydoc.getMap("meta");
17537
17537
  let docVersion = metaMap.get("version");
@@ -30280,9 +30280,7 @@ function buildMultiSectionIdentifier(sectionMetadata, pageStyles2, converterIds)
30280
30280
  odd: section.footerRefs.odd ?? null
30281
30281
  });
30282
30282
  }
30283
- if (section.titlePg === true) {
30284
- identifier.sectionTitlePg.set(idx, true);
30285
- }
30283
+ identifier.sectionTitlePg.set(idx, section.titlePg === true);
30286
30284
  }
30287
30285
  const section0Headers = identifier.sectionHeaderIds.get(0);
30288
30286
  const section0Footers = identifier.sectionFooterIds.get(0);
@@ -30317,11 +30315,13 @@ function getHeaderFooterTypeForSection(pageNumber, sectionIndex, identifier, opt
30317
30315
  const hasEven = Boolean(ids.even);
30318
30316
  const hasOdd = Boolean(ids.odd);
30319
30317
  const hasDefault = Boolean(ids.default);
30320
- const sectionTitlePg = identifier.sectionTitlePg.get(sectionIndex) ?? identifier.titlePg;
30321
- const titlePgEnabled = sectionTitlePg && hasFirst;
30318
+ const sectionTitlePg = identifier.sectionTitlePg.has(sectionIndex) ? identifier.sectionTitlePg.get(sectionIndex) : identifier.titlePg;
30319
+ const titlePgEnabled = sectionTitlePg === true;
30322
30320
  const isFirstPageOfSection = sectionPageNumber === 1;
30323
30321
  if (isFirstPageOfSection && titlePgEnabled) {
30324
- return "first";
30322
+ if (hasFirst) return "first";
30323
+ if (!hasDefault && !hasEven && !hasOdd) return null;
30324
+ return null;
30325
30325
  }
30326
30326
  if (identifier.alternateHeaders) {
30327
30327
  if (pageNumber % 2 === 0 && (hasEven || hasDefault)) {
@@ -31379,6 +31379,18 @@ function applyTableIndent(x, width, indent) {
31379
31379
  width: Math.max(0, width - indent)
31380
31380
  };
31381
31381
  }
31382
+ function resolveTableFrame(baseX, columnWidth, tableWidth, attrs) {
31383
+ const width = Math.min(columnWidth, tableWidth);
31384
+ const justification = typeof attrs?.justification === "string" ? attrs.justification : void 0;
31385
+ if (justification === "center") {
31386
+ return { x: baseX + Math.max(0, (columnWidth - width) / 2), width };
31387
+ }
31388
+ if (justification === "right" || justification === "end") {
31389
+ return { x: baseX + Math.max(0, columnWidth - width), width };
31390
+ }
31391
+ const tableIndent = getTableIndentWidth(attrs);
31392
+ return applyTableIndent(baseX, width, tableIndent);
31393
+ }
31382
31394
  function calculateColumnMinWidth(columnIndex, measure) {
31383
31395
  const DEFAULT_MIN_WIDTH = 25;
31384
31396
  const measuredWidth = measure.columnWidths[columnIndex] || DEFAULT_MIN_WIDTH;
@@ -31681,10 +31693,9 @@ function layoutMonolithicTable(context) {
31681
31693
  columnBoundaries: generateColumnBoundaries(context.measure),
31682
31694
  coordinateSystem: "fragment"
31683
31695
  };
31684
- const tableIndent = getTableIndentWidth(context.block.attrs);
31685
31696
  const baseX = context.columnX(state.columnIndex);
31686
31697
  const baseWidth = Math.min(context.columnWidth, context.measure.totalWidth || context.columnWidth);
31687
- const { x, width } = applyTableIndent(baseX, baseWidth, tableIndent);
31698
+ const { x, width } = resolveTableFrame(baseX, context.columnWidth, baseWidth, context.block.attrs);
31688
31699
  const fragment = {
31689
31700
  kind: "table",
31690
31701
  blockId: context.block.id,
@@ -31760,10 +31771,9 @@ function layoutTableBlock({
31760
31771
  columnBoundaries: generateColumnBoundaries(measure),
31761
31772
  coordinateSystem: "fragment"
31762
31773
  };
31763
- const tableIndent = getTableIndentWidth(block.attrs);
31764
31774
  const baseX = columnX(state.columnIndex);
31765
31775
  const baseWidth = Math.min(columnWidth, measure.totalWidth || columnWidth);
31766
- const { x, width } = applyTableIndent(baseX, baseWidth, tableIndent);
31776
+ const { x, width } = resolveTableFrame(baseX, columnWidth, baseWidth, block.attrs);
31767
31777
  const fragment = {
31768
31778
  kind: "table",
31769
31779
  blockId: block.id,
@@ -31820,10 +31830,9 @@ function layoutTableBlock({
31820
31830
  });
31821
31831
  const fragmentHeight2 = continuationPartialRow.partialHeight + (repeatHeaderCount > 0 ? headerHeight : 0);
31822
31832
  if (fragmentHeight2 > 0 && madeProgress) {
31823
- const tableIndent2 = getTableIndentWidth(block.attrs);
31824
31833
  const baseX2 = columnX(state.columnIndex);
31825
31834
  const baseWidth2 = Math.min(columnWidth, measure.totalWidth || columnWidth);
31826
- const { x: x2, width: width2 } = applyTableIndent(baseX2, baseWidth2, tableIndent2);
31835
+ const { x: x2, width: width2 } = resolveTableFrame(baseX2, columnWidth, baseWidth2, block.attrs);
31827
31836
  const fragment2 = {
31828
31837
  kind: "table",
31829
31838
  blockId: block.id,
@@ -31865,10 +31874,9 @@ function layoutTableBlock({
31865
31874
  const forcedPartialRow = computePartialRow(bodyStartRow, block.rows[bodyStartRow], measure, availableForBody);
31866
31875
  const forcedEndRow = bodyStartRow + 1;
31867
31876
  const fragmentHeight2 = forcedPartialRow.partialHeight + (repeatHeaderCount > 0 ? headerHeight : 0);
31868
- const tableIndent2 = getTableIndentWidth(block.attrs);
31869
31877
  const baseX2 = columnX(state.columnIndex);
31870
31878
  const baseWidth2 = Math.min(columnWidth, measure.totalWidth || columnWidth);
31871
- const { x: x2, width: width2 } = applyTableIndent(baseX2, baseWidth2, tableIndent2);
31879
+ const { x: x2, width: width2 } = resolveTableFrame(baseX2, columnWidth, baseWidth2, block.attrs);
31872
31880
  const fragment2 = {
31873
31881
  kind: "table",
31874
31882
  blockId: block.id,
@@ -31901,10 +31909,9 @@ function layoutTableBlock({
31901
31909
  measure
31902
31910
  );
31903
31911
  }
31904
- const tableIndent = getTableIndentWidth(block.attrs);
31905
31912
  const baseX = columnX(state.columnIndex);
31906
31913
  const baseWidth = Math.min(columnWidth, measure.totalWidth || columnWidth);
31907
- const { x, width } = applyTableIndent(baseX, baseWidth, tableIndent);
31914
+ const { x, width } = resolveTableFrame(baseX, columnWidth, baseWidth, block.attrs);
31908
31915
  const fragment = {
31909
31916
  kind: "table",
31910
31917
  blockId: block.id,
@@ -39318,6 +39325,7 @@ function publishSectionMetadata(sectionRanges, options) {
39318
39325
  });
39319
39326
  }
39320
39327
  function createFinalSectionFromBodySectPr(bodySectPr, currentStart, totalParagraphs, sectionIndex) {
39328
+ const clampedStart = Math.max(0, Math.min(currentStart, Math.max(totalParagraphs - 1, 0)));
39321
39329
  const tempNode = {
39322
39330
  attrs: {
39323
39331
  paragraphProperties: { sectPr: bodySectPr }
@@ -39328,7 +39336,7 @@ function createFinalSectionFromBodySectPr(bodySectPr, currentStart, totalParagra
39328
39336
  const hasAnyMargin = bodySectionData.headerPx != null || bodySectionData.footerPx != null || bodySectionData.topPx != null || bodySectionData.rightPx != null || bodySectionData.bottomPx != null || bodySectionData.leftPx != null;
39329
39337
  return {
39330
39338
  sectionIndex,
39331
- startParagraphIndex: currentStart,
39339
+ startParagraphIndex: clampedStart,
39332
39340
  endParagraphIndex: totalParagraphs - 1,
39333
39341
  sectPr: bodySectPr,
39334
39342
  margins: hasAnyMargin ? {
@@ -39346,6 +39354,7 @@ function createFinalSectionFromBodySectPr(bodySectPr, currentStart, totalParagra
39346
39354
  titlePg: bodySectionData.titlePg ?? false,
39347
39355
  headerRefs: bodySectionData.headerRefs,
39348
39356
  footerRefs: bodySectionData.footerRefs,
39357
+ numbering: bodySectionData.numbering,
39349
39358
  vAlign: bodySectionData.vAlign
39350
39359
  };
39351
39360
  }
@@ -53721,45 +53730,76 @@ class PresentationEditor extends EventEmitter {
53721
53730
  const columns = parseColumns(pageStyles2.columns);
53722
53731
  return { pageSize, margins, columns };
53723
53732
  }
53733
+ /**
53734
+ * Applies zoom transformation to the document viewport and painter hosts.
53735
+ *
53736
+ * Handles documents with varying page sizes (multi-section docs with landscape pages)
53737
+ * by calculating actual dimensions from per-page sizes rather than assuming uniform pages.
53738
+ *
53739
+ * The implementation uses two key concepts:
53740
+ * - **maxWidth/maxHeight**: Maximum dimension across all pages (for viewport sizing)
53741
+ * - **totalWidth/totalHeight**: Sum of all page dimensions + gaps (for full document extent)
53742
+ *
53743
+ * Layout modes:
53744
+ * - Vertical: Uses maxWidth for viewport width, totalHeight for scroll height
53745
+ * - Horizontal: Uses totalWidth for viewport width, maxHeight for scroll height
53746
+ */
53724
53747
  #applyZoom() {
53725
53748
  const zoom = this.#layoutOptions.zoom ?? 1;
53726
53749
  const layoutMode = this.#layoutOptions.layoutMode ?? "vertical";
53727
- const pageWidth = this.#layoutOptions.pageSize?.w ?? DEFAULT_PAGE_SIZE.w;
53728
- const pageHeight = this.#getBodyPageHeight();
53729
53750
  const pages = this.#layoutState.layout?.pages;
53730
- const pageCount = Array.isArray(pages) && pages.length > 0 ? pages.length : 1;
53731
53751
  const pageGap = this.#layoutState.layout?.pageGap ?? this.#getEffectivePageGap();
53752
+ const defaultWidth = this.#layoutOptions.pageSize?.w ?? DEFAULT_PAGE_SIZE.w;
53753
+ const defaultHeight = this.#layoutOptions.pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
53754
+ let maxWidth = defaultWidth;
53755
+ let maxHeight = defaultHeight;
53756
+ let totalWidth = 0;
53757
+ let totalHeight = 0;
53758
+ if (Array.isArray(pages) && pages.length > 0) {
53759
+ pages.forEach((page, index2) => {
53760
+ const pageWidth = page.size && typeof page.size.w === "number" && page.size.w > 0 ? page.size.w : defaultWidth;
53761
+ const pageHeight = page.size && typeof page.size.h === "number" && page.size.h > 0 ? page.size.h : defaultHeight;
53762
+ maxWidth = Math.max(maxWidth, pageWidth);
53763
+ maxHeight = Math.max(maxHeight, pageHeight);
53764
+ totalWidth += pageWidth;
53765
+ totalHeight += pageHeight;
53766
+ if (index2 < pages.length - 1) {
53767
+ totalWidth += pageGap;
53768
+ totalHeight += pageGap;
53769
+ }
53770
+ });
53771
+ } else {
53772
+ totalWidth = defaultWidth;
53773
+ totalHeight = defaultHeight;
53774
+ }
53732
53775
  if (layoutMode === "horizontal") {
53733
- const totalWidth = pageWidth * pageCount + pageGap * Math.max(0, pageCount - 1);
53734
- const totalHeight2 = pageHeight;
53735
53776
  const scaledWidth2 = totalWidth * zoom;
53736
- const scaledHeight2 = totalHeight2 * zoom;
53777
+ const scaledHeight2 = maxHeight * zoom;
53737
53778
  this.#viewportHost.style.width = `${scaledWidth2}px`;
53738
53779
  this.#viewportHost.style.minWidth = `${scaledWidth2}px`;
53739
53780
  this.#viewportHost.style.minHeight = `${scaledHeight2}px`;
53740
53781
  this.#viewportHost.style.transform = "";
53741
53782
  this.#painterHost.style.width = `${totalWidth}px`;
53742
- this.#painterHost.style.minHeight = `${totalHeight2}px`;
53783
+ this.#painterHost.style.minHeight = `${maxHeight}px`;
53743
53784
  this.#painterHost.style.transformOrigin = "top left";
53744
53785
  this.#painterHost.style.transform = zoom === 1 ? "" : `scale(${zoom})`;
53745
53786
  this.#selectionOverlay.style.width = `${totalWidth}px`;
53746
- this.#selectionOverlay.style.height = `${totalHeight2}px`;
53787
+ this.#selectionOverlay.style.height = `${maxHeight}px`;
53747
53788
  this.#selectionOverlay.style.transformOrigin = "top left";
53748
53789
  this.#selectionOverlay.style.transform = zoom === 1 ? "" : `scale(${zoom})`;
53749
53790
  return;
53750
53791
  }
53751
- const totalHeight = pageHeight * pageCount + pageGap * Math.max(0, pageCount - 1);
53752
- const scaledWidth = pageWidth * zoom;
53792
+ const scaledWidth = maxWidth * zoom;
53753
53793
  const scaledHeight = totalHeight * zoom;
53754
53794
  this.#viewportHost.style.width = `${scaledWidth}px`;
53755
53795
  this.#viewportHost.style.minWidth = `${scaledWidth}px`;
53756
53796
  this.#viewportHost.style.minHeight = `${scaledHeight}px`;
53757
53797
  this.#viewportHost.style.transform = "";
53758
- this.#painterHost.style.width = `${pageWidth}px`;
53798
+ this.#painterHost.style.width = `${maxWidth}px`;
53759
53799
  this.#painterHost.style.minHeight = `${totalHeight}px`;
53760
53800
  this.#painterHost.style.transformOrigin = "top left";
53761
53801
  this.#painterHost.style.transform = zoom === 1 ? "" : `scale(${zoom})`;
53762
- this.#selectionOverlay.style.width = `${pageWidth}px`;
53802
+ this.#selectionOverlay.style.width = `${maxWidth}px`;
53763
53803
  this.#selectionOverlay.style.height = `${totalHeight}px`;
53764
53804
  this.#selectionOverlay.style.transformOrigin = "top left";
53765
53805
  this.#selectionOverlay.style.transform = zoom === 1 ? "" : `scale(${zoom})`;
@@ -88530,15 +88570,25 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
88530
88570
  { immediate: true, deep: true }
88531
88571
  );
88532
88572
  const containerStyle = computed(() => {
88533
- let baseWidth = 8.5 * 96;
88573
+ let maxWidth = 8.5 * 96;
88534
88574
  const ed = editor.value;
88535
- if (ed && "getPageStyles" in ed && typeof ed.getPageStyles === "function") {
88575
+ if (ed && "getPages" in ed && typeof ed.getPages === "function") {
88576
+ const pages = ed.getPages();
88577
+ if (Array.isArray(pages) && pages.length > 0) {
88578
+ for (const page of pages) {
88579
+ if (page.size && typeof page.size.w === "number" && page.size.w > 0) {
88580
+ maxWidth = Math.max(maxWidth, page.size.w);
88581
+ }
88582
+ }
88583
+ }
88584
+ }
88585
+ if (maxWidth === 8.5 * 96 && ed && "getPageStyles" in ed && typeof ed.getPageStyles === "function") {
88536
88586
  const styles = ed.getPageStyles();
88537
88587
  if (styles && typeof styles === "object" && styles.pageSize && typeof styles.pageSize === "object" && typeof styles.pageSize.width === "number" && styles.pageSize.width > 0) {
88538
- baseWidth = styles.pageSize.width * 96;
88588
+ maxWidth = styles.pageSize.width * 96;
88539
88589
  }
88540
88590
  }
88541
- const scaledWidth = baseWidth * currentZoom.value;
88591
+ const scaledWidth = maxWidth * currentZoom.value;
88542
88592
  return {
88543
88593
  minWidth: `${scaledWidth}px`
88544
88594
  };
@@ -89106,7 +89156,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
89106
89156
  };
89107
89157
  }
89108
89158
  });
89109
- const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-b430db2d"]]);
89159
+ const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-8dd4cf59"]]);
89110
89160
  const _hoisted_1 = ["innerHTML"];
89111
89161
  const _sfc_main = {
89112
89162
  __name: "SuperInput",
@@ -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-rOfYo70H.es.js";
2
- import "./SuperConverter-CuiRnbJX.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-C18YjNKj.es.js";
2
+ import "./SuperConverter-BigfCP5Z.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-CZq-c1aT.es.js"));
7447
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-Cfz5f-Nx.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.2.0-next.5";
8353
+ this.version = "1.2.0-next.6";
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-CANjnoRM.cjs");
3
- require("./SuperConverter-ClalxgSO.cjs");
2
+ const index = require("./index-Dxieqftp.cjs");
3
+ require("./SuperConverter-C5soSddX.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-DnFGHZzc.cjs")));
7464
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-BP3SAptw.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.2.0-next.5";
8370
+ this.version = "1.2.0-next.6";
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;