superdoc 1.2.0-next.5 → 1.2.1
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.
- package/dist/chunks/{PdfViewer-CZq-c1aT.es.js → PdfViewer-CfkEojYs.es.js} +2 -2
- package/dist/chunks/{PdfViewer-DnFGHZzc.cjs → PdfViewer-DAuugJGV.cjs} +2 -2
- package/dist/chunks/{SuperConverter-ClalxgSO.cjs → SuperConverter-D7wt-eeZ.cjs} +1 -1
- package/dist/chunks/{SuperConverter-CuiRnbJX.es.js → SuperConverter-DrIt9cvV.es.js} +1 -1
- package/dist/chunks/{index-1zcZTe7X.cjs → index-CQcBu0ln.cjs} +4 -4
- package/dist/chunks/{index-rOfYo70H.es.js → index-DUHBiOz0.es.js} +93 -37
- package/dist/chunks/{index-BaSA-M8A.es.js → index-L4O68_fZ.es.js} +4 -4
- package/dist/chunks/{index-CANjnoRM.cjs → index-MvYBJo1p.cjs} +93 -37
- package/dist/style.css +6 -6
- package/dist/super-editor/converter.cjs +1 -1
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor.cjs +2 -2
- package/dist/super-editor.es.js +3 -3
- package/dist/superdoc.cjs +3 -3
- package/dist/superdoc.es.js +3 -3
- package/dist/superdoc.umd.js +94 -38
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +2 -2
|
@@ -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-
|
|
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-
|
|
2
|
+
import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-L4O68_fZ.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-DUHBiOz0.es.js";
|
|
4
4
|
function self(vars) {
|
|
5
5
|
const {
|
|
6
6
|
opacityDisabled,
|
|
@@ -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-
|
|
5
|
-
const index = require("./index-
|
|
4
|
+
const superdoc = require("./index-CQcBu0ln.cjs");
|
|
5
|
+
const index = require("./index-MvYBJo1p.cjs");
|
|
6
6
|
function self(vars) {
|
|
7
7
|
const {
|
|
8
8
|
opacityDisabled,
|
|
@@ -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.
|
|
30741
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.2.1") {
|
|
30742
30742
|
return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
30743
30743
|
}
|
|
30744
30744
|
/**
|
|
@@ -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.
|
|
30740
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.2.1") {
|
|
30741
30741
|
return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
30742
30742
|
}
|
|
30743
30743
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const index = require("./index-
|
|
3
|
-
require("./SuperConverter-
|
|
2
|
+
const index = require("./index-MvYBJo1p.cjs");
|
|
3
|
+
require("./SuperConverter-D7wt-eeZ.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-
|
|
7464
|
+
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-DAuugJGV.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.
|
|
8370
|
+
this.version = "1.2.1";
|
|
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,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-
|
|
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-DrIt9cvV.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.
|
|
14901
|
+
const summaryVersion = "1.2.1";
|
|
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.
|
|
17534
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.2.1");
|
|
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
|
-
|
|
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);
|
|
@@ -30294,12 +30292,18 @@ function buildMultiSectionIdentifier(sectionMetadata, pageStyles2, converterIds)
|
|
|
30294
30292
|
}
|
|
30295
30293
|
identifier.titlePg = identifier.sectionTitlePg.get(0) ?? false;
|
|
30296
30294
|
if (converterIds?.headerIds) {
|
|
30295
|
+
if (!identifier.titlePg && converterIds.headerIds.titlePg) {
|
|
30296
|
+
identifier.titlePg = true;
|
|
30297
|
+
}
|
|
30297
30298
|
identifier.headerIds.default = identifier.headerIds.default ?? converterIds.headerIds.default ?? null;
|
|
30298
30299
|
identifier.headerIds.first = identifier.headerIds.first ?? converterIds.headerIds.first ?? null;
|
|
30299
30300
|
identifier.headerIds.even = identifier.headerIds.even ?? converterIds.headerIds.even ?? null;
|
|
30300
30301
|
identifier.headerIds.odd = identifier.headerIds.odd ?? converterIds.headerIds.odd ?? null;
|
|
30301
30302
|
}
|
|
30302
30303
|
if (converterIds?.footerIds) {
|
|
30304
|
+
if (!identifier.titlePg && converterIds.footerIds.titlePg) {
|
|
30305
|
+
identifier.titlePg = true;
|
|
30306
|
+
}
|
|
30303
30307
|
identifier.footerIds.default = identifier.footerIds.default ?? converterIds.footerIds.default ?? null;
|
|
30304
30308
|
identifier.footerIds.first = identifier.footerIds.first ?? converterIds.footerIds.first ?? null;
|
|
30305
30309
|
identifier.footerIds.even = identifier.footerIds.even ?? converterIds.footerIds.even ?? null;
|
|
@@ -30317,11 +30321,13 @@ function getHeaderFooterTypeForSection(pageNumber, sectionIndex, identifier, opt
|
|
|
30317
30321
|
const hasEven = Boolean(ids.even);
|
|
30318
30322
|
const hasOdd = Boolean(ids.odd);
|
|
30319
30323
|
const hasDefault = Boolean(ids.default);
|
|
30320
|
-
const sectionTitlePg = identifier.sectionTitlePg.get(sectionIndex)
|
|
30321
|
-
const titlePgEnabled = sectionTitlePg
|
|
30324
|
+
const sectionTitlePg = identifier.sectionTitlePg.has(sectionIndex) ? identifier.sectionTitlePg.get(sectionIndex) : identifier.titlePg;
|
|
30325
|
+
const titlePgEnabled = sectionTitlePg === true;
|
|
30322
30326
|
const isFirstPageOfSection = sectionPageNumber === 1;
|
|
30323
30327
|
if (isFirstPageOfSection && titlePgEnabled) {
|
|
30324
|
-
return "first";
|
|
30328
|
+
if (hasFirst) return "first";
|
|
30329
|
+
if (!hasDefault && !hasEven && !hasOdd) return null;
|
|
30330
|
+
return null;
|
|
30325
30331
|
}
|
|
30326
30332
|
if (identifier.alternateHeaders) {
|
|
30327
30333
|
if (pageNumber % 2 === 0 && (hasEven || hasDefault)) {
|
|
@@ -31379,6 +31385,18 @@ function applyTableIndent(x, width, indent) {
|
|
|
31379
31385
|
width: Math.max(0, width - indent)
|
|
31380
31386
|
};
|
|
31381
31387
|
}
|
|
31388
|
+
function resolveTableFrame(baseX, columnWidth, tableWidth, attrs) {
|
|
31389
|
+
const width = Math.min(columnWidth, tableWidth);
|
|
31390
|
+
const justification = typeof attrs?.justification === "string" ? attrs.justification : void 0;
|
|
31391
|
+
if (justification === "center") {
|
|
31392
|
+
return { x: baseX + Math.max(0, (columnWidth - width) / 2), width };
|
|
31393
|
+
}
|
|
31394
|
+
if (justification === "right" || justification === "end") {
|
|
31395
|
+
return { x: baseX + Math.max(0, columnWidth - width), width };
|
|
31396
|
+
}
|
|
31397
|
+
const tableIndent = getTableIndentWidth(attrs);
|
|
31398
|
+
return applyTableIndent(baseX, width, tableIndent);
|
|
31399
|
+
}
|
|
31382
31400
|
function calculateColumnMinWidth(columnIndex, measure) {
|
|
31383
31401
|
const DEFAULT_MIN_WIDTH = 25;
|
|
31384
31402
|
const measuredWidth = measure.columnWidths[columnIndex] || DEFAULT_MIN_WIDTH;
|
|
@@ -31681,10 +31699,9 @@ function layoutMonolithicTable(context) {
|
|
|
31681
31699
|
columnBoundaries: generateColumnBoundaries(context.measure),
|
|
31682
31700
|
coordinateSystem: "fragment"
|
|
31683
31701
|
};
|
|
31684
|
-
const tableIndent = getTableIndentWidth(context.block.attrs);
|
|
31685
31702
|
const baseX = context.columnX(state.columnIndex);
|
|
31686
31703
|
const baseWidth = Math.min(context.columnWidth, context.measure.totalWidth || context.columnWidth);
|
|
31687
|
-
const { x, width } =
|
|
31704
|
+
const { x, width } = resolveTableFrame(baseX, context.columnWidth, baseWidth, context.block.attrs);
|
|
31688
31705
|
const fragment = {
|
|
31689
31706
|
kind: "table",
|
|
31690
31707
|
blockId: context.block.id,
|
|
@@ -31760,10 +31777,9 @@ function layoutTableBlock({
|
|
|
31760
31777
|
columnBoundaries: generateColumnBoundaries(measure),
|
|
31761
31778
|
coordinateSystem: "fragment"
|
|
31762
31779
|
};
|
|
31763
|
-
const tableIndent = getTableIndentWidth(block.attrs);
|
|
31764
31780
|
const baseX = columnX(state.columnIndex);
|
|
31765
31781
|
const baseWidth = Math.min(columnWidth, measure.totalWidth || columnWidth);
|
|
31766
|
-
const { x, width } =
|
|
31782
|
+
const { x, width } = resolveTableFrame(baseX, columnWidth, baseWidth, block.attrs);
|
|
31767
31783
|
const fragment = {
|
|
31768
31784
|
kind: "table",
|
|
31769
31785
|
blockId: block.id,
|
|
@@ -31820,10 +31836,9 @@ function layoutTableBlock({
|
|
|
31820
31836
|
});
|
|
31821
31837
|
const fragmentHeight2 = continuationPartialRow.partialHeight + (repeatHeaderCount > 0 ? headerHeight : 0);
|
|
31822
31838
|
if (fragmentHeight2 > 0 && madeProgress) {
|
|
31823
|
-
const tableIndent2 = getTableIndentWidth(block.attrs);
|
|
31824
31839
|
const baseX2 = columnX(state.columnIndex);
|
|
31825
31840
|
const baseWidth2 = Math.min(columnWidth, measure.totalWidth || columnWidth);
|
|
31826
|
-
const { x: x2, width: width2 } =
|
|
31841
|
+
const { x: x2, width: width2 } = resolveTableFrame(baseX2, columnWidth, baseWidth2, block.attrs);
|
|
31827
31842
|
const fragment2 = {
|
|
31828
31843
|
kind: "table",
|
|
31829
31844
|
blockId: block.id,
|
|
@@ -31865,10 +31880,9 @@ function layoutTableBlock({
|
|
|
31865
31880
|
const forcedPartialRow = computePartialRow(bodyStartRow, block.rows[bodyStartRow], measure, availableForBody);
|
|
31866
31881
|
const forcedEndRow = bodyStartRow + 1;
|
|
31867
31882
|
const fragmentHeight2 = forcedPartialRow.partialHeight + (repeatHeaderCount > 0 ? headerHeight : 0);
|
|
31868
|
-
const tableIndent2 = getTableIndentWidth(block.attrs);
|
|
31869
31883
|
const baseX2 = columnX(state.columnIndex);
|
|
31870
31884
|
const baseWidth2 = Math.min(columnWidth, measure.totalWidth || columnWidth);
|
|
31871
|
-
const { x: x2, width: width2 } =
|
|
31885
|
+
const { x: x2, width: width2 } = resolveTableFrame(baseX2, columnWidth, baseWidth2, block.attrs);
|
|
31872
31886
|
const fragment2 = {
|
|
31873
31887
|
kind: "table",
|
|
31874
31888
|
blockId: block.id,
|
|
@@ -31901,10 +31915,9 @@ function layoutTableBlock({
|
|
|
31901
31915
|
measure
|
|
31902
31916
|
);
|
|
31903
31917
|
}
|
|
31904
|
-
const tableIndent = getTableIndentWidth(block.attrs);
|
|
31905
31918
|
const baseX = columnX(state.columnIndex);
|
|
31906
31919
|
const baseWidth = Math.min(columnWidth, measure.totalWidth || columnWidth);
|
|
31907
|
-
const { x, width } =
|
|
31920
|
+
const { x, width } = resolveTableFrame(baseX, columnWidth, baseWidth, block.attrs);
|
|
31908
31921
|
const fragment = {
|
|
31909
31922
|
kind: "table",
|
|
31910
31923
|
blockId: block.id,
|
|
@@ -39318,6 +39331,7 @@ function publishSectionMetadata(sectionRanges, options) {
|
|
|
39318
39331
|
});
|
|
39319
39332
|
}
|
|
39320
39333
|
function createFinalSectionFromBodySectPr(bodySectPr, currentStart, totalParagraphs, sectionIndex) {
|
|
39334
|
+
const clampedStart = Math.max(0, Math.min(currentStart, Math.max(totalParagraphs - 1, 0)));
|
|
39321
39335
|
const tempNode = {
|
|
39322
39336
|
attrs: {
|
|
39323
39337
|
paragraphProperties: { sectPr: bodySectPr }
|
|
@@ -39328,7 +39342,7 @@ function createFinalSectionFromBodySectPr(bodySectPr, currentStart, totalParagra
|
|
|
39328
39342
|
const hasAnyMargin = bodySectionData.headerPx != null || bodySectionData.footerPx != null || bodySectionData.topPx != null || bodySectionData.rightPx != null || bodySectionData.bottomPx != null || bodySectionData.leftPx != null;
|
|
39329
39343
|
return {
|
|
39330
39344
|
sectionIndex,
|
|
39331
|
-
startParagraphIndex:
|
|
39345
|
+
startParagraphIndex: clampedStart,
|
|
39332
39346
|
endParagraphIndex: totalParagraphs - 1,
|
|
39333
39347
|
sectPr: bodySectPr,
|
|
39334
39348
|
margins: hasAnyMargin ? {
|
|
@@ -39346,6 +39360,7 @@ function createFinalSectionFromBodySectPr(bodySectPr, currentStart, totalParagra
|
|
|
39346
39360
|
titlePg: bodySectionData.titlePg ?? false,
|
|
39347
39361
|
headerRefs: bodySectionData.headerRefs,
|
|
39348
39362
|
footerRefs: bodySectionData.footerRefs,
|
|
39363
|
+
numbering: bodySectionData.numbering,
|
|
39349
39364
|
vAlign: bodySectionData.vAlign
|
|
39350
39365
|
};
|
|
39351
39366
|
}
|
|
@@ -53721,45 +53736,76 @@ class PresentationEditor extends EventEmitter {
|
|
|
53721
53736
|
const columns = parseColumns(pageStyles2.columns);
|
|
53722
53737
|
return { pageSize, margins, columns };
|
|
53723
53738
|
}
|
|
53739
|
+
/**
|
|
53740
|
+
* Applies zoom transformation to the document viewport and painter hosts.
|
|
53741
|
+
*
|
|
53742
|
+
* Handles documents with varying page sizes (multi-section docs with landscape pages)
|
|
53743
|
+
* by calculating actual dimensions from per-page sizes rather than assuming uniform pages.
|
|
53744
|
+
*
|
|
53745
|
+
* The implementation uses two key concepts:
|
|
53746
|
+
* - **maxWidth/maxHeight**: Maximum dimension across all pages (for viewport sizing)
|
|
53747
|
+
* - **totalWidth/totalHeight**: Sum of all page dimensions + gaps (for full document extent)
|
|
53748
|
+
*
|
|
53749
|
+
* Layout modes:
|
|
53750
|
+
* - Vertical: Uses maxWidth for viewport width, totalHeight for scroll height
|
|
53751
|
+
* - Horizontal: Uses totalWidth for viewport width, maxHeight for scroll height
|
|
53752
|
+
*/
|
|
53724
53753
|
#applyZoom() {
|
|
53725
53754
|
const zoom = this.#layoutOptions.zoom ?? 1;
|
|
53726
53755
|
const layoutMode = this.#layoutOptions.layoutMode ?? "vertical";
|
|
53727
|
-
const pageWidth = this.#layoutOptions.pageSize?.w ?? DEFAULT_PAGE_SIZE.w;
|
|
53728
|
-
const pageHeight = this.#getBodyPageHeight();
|
|
53729
53756
|
const pages = this.#layoutState.layout?.pages;
|
|
53730
|
-
const pageCount = Array.isArray(pages) && pages.length > 0 ? pages.length : 1;
|
|
53731
53757
|
const pageGap = this.#layoutState.layout?.pageGap ?? this.#getEffectivePageGap();
|
|
53758
|
+
const defaultWidth = this.#layoutOptions.pageSize?.w ?? DEFAULT_PAGE_SIZE.w;
|
|
53759
|
+
const defaultHeight = this.#layoutOptions.pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
|
|
53760
|
+
let maxWidth = defaultWidth;
|
|
53761
|
+
let maxHeight = defaultHeight;
|
|
53762
|
+
let totalWidth = 0;
|
|
53763
|
+
let totalHeight = 0;
|
|
53764
|
+
if (Array.isArray(pages) && pages.length > 0) {
|
|
53765
|
+
pages.forEach((page, index2) => {
|
|
53766
|
+
const pageWidth = page.size && typeof page.size.w === "number" && page.size.w > 0 ? page.size.w : defaultWidth;
|
|
53767
|
+
const pageHeight = page.size && typeof page.size.h === "number" && page.size.h > 0 ? page.size.h : defaultHeight;
|
|
53768
|
+
maxWidth = Math.max(maxWidth, pageWidth);
|
|
53769
|
+
maxHeight = Math.max(maxHeight, pageHeight);
|
|
53770
|
+
totalWidth += pageWidth;
|
|
53771
|
+
totalHeight += pageHeight;
|
|
53772
|
+
if (index2 < pages.length - 1) {
|
|
53773
|
+
totalWidth += pageGap;
|
|
53774
|
+
totalHeight += pageGap;
|
|
53775
|
+
}
|
|
53776
|
+
});
|
|
53777
|
+
} else {
|
|
53778
|
+
totalWidth = defaultWidth;
|
|
53779
|
+
totalHeight = defaultHeight;
|
|
53780
|
+
}
|
|
53732
53781
|
if (layoutMode === "horizontal") {
|
|
53733
|
-
const totalWidth = pageWidth * pageCount + pageGap * Math.max(0, pageCount - 1);
|
|
53734
|
-
const totalHeight2 = pageHeight;
|
|
53735
53782
|
const scaledWidth2 = totalWidth * zoom;
|
|
53736
|
-
const scaledHeight2 =
|
|
53783
|
+
const scaledHeight2 = maxHeight * zoom;
|
|
53737
53784
|
this.#viewportHost.style.width = `${scaledWidth2}px`;
|
|
53738
53785
|
this.#viewportHost.style.minWidth = `${scaledWidth2}px`;
|
|
53739
53786
|
this.#viewportHost.style.minHeight = `${scaledHeight2}px`;
|
|
53740
53787
|
this.#viewportHost.style.transform = "";
|
|
53741
53788
|
this.#painterHost.style.width = `${totalWidth}px`;
|
|
53742
|
-
this.#painterHost.style.minHeight = `${
|
|
53789
|
+
this.#painterHost.style.minHeight = `${maxHeight}px`;
|
|
53743
53790
|
this.#painterHost.style.transformOrigin = "top left";
|
|
53744
53791
|
this.#painterHost.style.transform = zoom === 1 ? "" : `scale(${zoom})`;
|
|
53745
53792
|
this.#selectionOverlay.style.width = `${totalWidth}px`;
|
|
53746
|
-
this.#selectionOverlay.style.height = `${
|
|
53793
|
+
this.#selectionOverlay.style.height = `${maxHeight}px`;
|
|
53747
53794
|
this.#selectionOverlay.style.transformOrigin = "top left";
|
|
53748
53795
|
this.#selectionOverlay.style.transform = zoom === 1 ? "" : `scale(${zoom})`;
|
|
53749
53796
|
return;
|
|
53750
53797
|
}
|
|
53751
|
-
const
|
|
53752
|
-
const scaledWidth = pageWidth * zoom;
|
|
53798
|
+
const scaledWidth = maxWidth * zoom;
|
|
53753
53799
|
const scaledHeight = totalHeight * zoom;
|
|
53754
53800
|
this.#viewportHost.style.width = `${scaledWidth}px`;
|
|
53755
53801
|
this.#viewportHost.style.minWidth = `${scaledWidth}px`;
|
|
53756
53802
|
this.#viewportHost.style.minHeight = `${scaledHeight}px`;
|
|
53757
53803
|
this.#viewportHost.style.transform = "";
|
|
53758
|
-
this.#painterHost.style.width = `${
|
|
53804
|
+
this.#painterHost.style.width = `${maxWidth}px`;
|
|
53759
53805
|
this.#painterHost.style.minHeight = `${totalHeight}px`;
|
|
53760
53806
|
this.#painterHost.style.transformOrigin = "top left";
|
|
53761
53807
|
this.#painterHost.style.transform = zoom === 1 ? "" : `scale(${zoom})`;
|
|
53762
|
-
this.#selectionOverlay.style.width = `${
|
|
53808
|
+
this.#selectionOverlay.style.width = `${maxWidth}px`;
|
|
53763
53809
|
this.#selectionOverlay.style.height = `${totalHeight}px`;
|
|
53764
53810
|
this.#selectionOverlay.style.transformOrigin = "top left";
|
|
53765
53811
|
this.#selectionOverlay.style.transform = zoom === 1 ? "" : `scale(${zoom})`;
|
|
@@ -88530,15 +88576,25 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
88530
88576
|
{ immediate: true, deep: true }
|
|
88531
88577
|
);
|
|
88532
88578
|
const containerStyle = computed(() => {
|
|
88533
|
-
let
|
|
88579
|
+
let maxWidth = 8.5 * 96;
|
|
88534
88580
|
const ed = editor.value;
|
|
88535
|
-
if (ed && "
|
|
88581
|
+
if (ed && "getPages" in ed && typeof ed.getPages === "function") {
|
|
88582
|
+
const pages = ed.getPages();
|
|
88583
|
+
if (Array.isArray(pages) && pages.length > 0) {
|
|
88584
|
+
for (const page of pages) {
|
|
88585
|
+
if (page.size && typeof page.size.w === "number" && page.size.w > 0) {
|
|
88586
|
+
maxWidth = Math.max(maxWidth, page.size.w);
|
|
88587
|
+
}
|
|
88588
|
+
}
|
|
88589
|
+
}
|
|
88590
|
+
}
|
|
88591
|
+
if (maxWidth === 8.5 * 96 && ed && "getPageStyles" in ed && typeof ed.getPageStyles === "function") {
|
|
88536
88592
|
const styles = ed.getPageStyles();
|
|
88537
88593
|
if (styles && typeof styles === "object" && styles.pageSize && typeof styles.pageSize === "object" && typeof styles.pageSize.width === "number" && styles.pageSize.width > 0) {
|
|
88538
|
-
|
|
88594
|
+
maxWidth = styles.pageSize.width * 96;
|
|
88539
88595
|
}
|
|
88540
88596
|
}
|
|
88541
|
-
const scaledWidth =
|
|
88597
|
+
const scaledWidth = maxWidth * currentZoom.value;
|
|
88542
88598
|
return {
|
|
88543
88599
|
minWidth: `${scaledWidth}px`
|
|
88544
88600
|
};
|
|
@@ -89106,7 +89162,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
89106
89162
|
};
|
|
89107
89163
|
}
|
|
89108
89164
|
});
|
|
89109
|
-
const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
89165
|
+
const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-8dd4cf59"]]);
|
|
89110
89166
|
const _hoisted_1 = ["innerHTML"];
|
|
89111
89167
|
const _sfc_main = {
|
|
89112
89168
|
__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-
|
|
2
|
-
import "./SuperConverter-
|
|
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-DUHBiOz0.es.js";
|
|
2
|
+
import "./SuperConverter-DrIt9cvV.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-
|
|
7447
|
+
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-CfkEojYs.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.
|
|
8353
|
+
this.version = "1.2.1";
|
|
8354
8354
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
8355
8355
|
this.superdocId = config.superdocId || v4();
|
|
8356
8356
|
this.colors = this.config.colors;
|