superdoc 1.3.0-next.1 → 1.3.0-next.2
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-BAoRLNIo.cjs → PdfViewer-BEZc2jzN.cjs} +2 -2
- package/dist/chunks/{PdfViewer-CkOzQzPk.es.js → PdfViewer-BpbDm_Oh.es.js} +2 -2
- package/dist/chunks/{SuperConverter-BXP6NikG.es.js → SuperConverter-ClzyObj7.es.js} +1 -1
- package/dist/chunks/{SuperConverter-Dy0-KTCc.cjs → SuperConverter-DOTz2R8L.cjs} +1 -1
- package/dist/chunks/{index-BNpbdx2a.cjs → index-C2XLSjq0.cjs} +110 -96
- package/dist/chunks/{index-C31VY_46.es.js → index-CMxyLpsU.es.js} +4 -4
- package/dist/chunks/{index-wwGlJ58Z.es.js → index-D5tN0eME.es.js} +110 -96
- package/dist/chunks/{index-BbvMtiJY.cjs → index-sykfrKvQ.cjs} +4 -4
- 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 +111 -97
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +3 -3
|
@@ -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-sykfrKvQ.cjs");
|
|
5
|
+
const index = require("./index-C2XLSjq0.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-
|
|
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-CMxyLpsU.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-D5tN0eME.es.js";
|
|
4
4
|
function self(vars) {
|
|
5
5
|
const {
|
|
6
6
|
opacityDisabled,
|
|
@@ -30839,7 +30839,7 @@ class SuperConverter {
|
|
|
30839
30839
|
static getStoredSuperdocVersion(docx) {
|
|
30840
30840
|
return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
30841
30841
|
}
|
|
30842
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.3.0-next.
|
|
30842
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.3.0-next.2") {
|
|
30843
30843
|
return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
30844
30844
|
}
|
|
30845
30845
|
/**
|
|
@@ -30840,7 +30840,7 @@ class SuperConverter {
|
|
|
30840
30840
|
static getStoredSuperdocVersion(docx) {
|
|
30841
30841
|
return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
30842
30842
|
}
|
|
30843
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.3.0-next.
|
|
30843
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.3.0-next.2") {
|
|
30844
30844
|
return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
30845
30845
|
}
|
|
30846
30846
|
/**
|
|
@@ -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-
|
|
4
|
+
const superEditor_converter = require("./SuperConverter-DOTz2R8L.cjs");
|
|
5
5
|
const vue = require("./vue-De9wkgLl.cjs");
|
|
6
6
|
require("./jszip.min-BPh2MMAa.cjs");
|
|
7
7
|
const eventemitter3 = require("./eventemitter3-BQuRcMPI.cjs");
|
|
@@ -14915,7 +14915,7 @@ const canUseDOM = () => {
|
|
|
14915
14915
|
return false;
|
|
14916
14916
|
}
|
|
14917
14917
|
};
|
|
14918
|
-
const summaryVersion = "1.3.0-next.
|
|
14918
|
+
const summaryVersion = "1.3.0-next.2";
|
|
14919
14919
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
14920
14920
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
14921
14921
|
function mapAttributes(attrs) {
|
|
@@ -17548,7 +17548,7 @@ class Editor extends EventEmitter {
|
|
|
17548
17548
|
* Process collaboration migrations
|
|
17549
17549
|
*/
|
|
17550
17550
|
processCollaborationMigrations() {
|
|
17551
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.3.0-next.
|
|
17551
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.3.0-next.2");
|
|
17552
17552
|
if (!this.options.ydoc) return;
|
|
17553
17553
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
17554
17554
|
let docVersion = metaMap.get("version");
|
|
@@ -19968,18 +19968,18 @@ function formatNumber(num, format) {
|
|
|
19968
19968
|
case "decimal":
|
|
19969
19969
|
return num.toString();
|
|
19970
19970
|
case "lowerLetter":
|
|
19971
|
-
return toLetter
|
|
19971
|
+
return toLetter(num, false);
|
|
19972
19972
|
case "upperLetter":
|
|
19973
|
-
return toLetter
|
|
19973
|
+
return toLetter(num, true);
|
|
19974
19974
|
case "lowerRoman":
|
|
19975
|
-
return toRoman$
|
|
19975
|
+
return toRoman$1(num).toLowerCase();
|
|
19976
19976
|
case "upperRoman":
|
|
19977
|
-
return toRoman$
|
|
19977
|
+
return toRoman$1(num);
|
|
19978
19978
|
default:
|
|
19979
19979
|
return num.toString();
|
|
19980
19980
|
}
|
|
19981
19981
|
}
|
|
19982
|
-
function toLetter
|
|
19982
|
+
function toLetter(num, uppercase) {
|
|
19983
19983
|
let result = "";
|
|
19984
19984
|
let n = num;
|
|
19985
19985
|
while (n > 0) {
|
|
@@ -19990,7 +19990,7 @@ function toLetter$1(num, uppercase) {
|
|
|
19990
19990
|
}
|
|
19991
19991
|
return result || (uppercase ? "A" : "a");
|
|
19992
19992
|
}
|
|
19993
|
-
function toRoman$
|
|
19993
|
+
function toRoman$1(num) {
|
|
19994
19994
|
const lookup = [
|
|
19995
19995
|
[1e3, "M"],
|
|
19996
19996
|
[900, "CM"],
|
|
@@ -25392,7 +25392,14 @@ class DomPainter {
|
|
|
25392
25392
|
fragmentEl.dataset.continuesOnNext = "true";
|
|
25393
25393
|
}
|
|
25394
25394
|
const lines = fragment.lines ?? measure.lines.slice(fragment.fromLine, fragment.toLine);
|
|
25395
|
-
applyParagraphBlockStyles(fragmentEl, block.attrs);
|
|
25395
|
+
applyParagraphBlockStyles(fragmentEl, block.attrs, { includeBorders: false, includeShading: false });
|
|
25396
|
+
const { shadingLayer, borderLayer } = createParagraphDecorationLayers(this.doc, fragment.width, block.attrs);
|
|
25397
|
+
if (shadingLayer) {
|
|
25398
|
+
fragmentEl.appendChild(shadingLayer);
|
|
25399
|
+
}
|
|
25400
|
+
if (borderLayer) {
|
|
25401
|
+
fragmentEl.appendChild(borderLayer);
|
|
25402
|
+
}
|
|
25396
25403
|
if (block.attrs?.styleId) {
|
|
25397
25404
|
fragmentEl.dataset.styleId = block.attrs.styleId;
|
|
25398
25405
|
fragmentEl.setAttribute("styleid", block.attrs.styleId);
|
|
@@ -25776,10 +25783,18 @@ class DomPainter {
|
|
|
25776
25783
|
contentEl.classList.add("superdoc-list-content");
|
|
25777
25784
|
this.applySdtDataset(contentEl, paragraphMetadata);
|
|
25778
25785
|
contentEl.style.display = "inline-block";
|
|
25786
|
+
contentEl.style.position = "relative";
|
|
25779
25787
|
contentEl.style.width = `${fragment.width}px`;
|
|
25780
25788
|
const lines = itemMeasure.paragraph.lines.slice(fragment.fromLine, fragment.toLine);
|
|
25781
25789
|
const contentAttrs = wordLayout ? item.paragraph.attrs : stripListIndent(item.paragraph.attrs);
|
|
25782
|
-
applyParagraphBlockStyles(contentEl, contentAttrs);
|
|
25790
|
+
applyParagraphBlockStyles(contentEl, contentAttrs, { includeBorders: false, includeShading: false });
|
|
25791
|
+
const { shadingLayer, borderLayer } = createParagraphDecorationLayers(this.doc, fragment.width, contentAttrs);
|
|
25792
|
+
if (shadingLayer) {
|
|
25793
|
+
contentEl.appendChild(shadingLayer);
|
|
25794
|
+
}
|
|
25795
|
+
if (borderLayer) {
|
|
25796
|
+
contentEl.appendChild(borderLayer);
|
|
25797
|
+
}
|
|
25783
25798
|
contentEl.style.textAlign = "left";
|
|
25784
25799
|
const paraForList = {
|
|
25785
25800
|
...item.paragraph,
|
|
@@ -28006,7 +28021,7 @@ const applyRunDataAttributes = (element, dataAttrs) => {
|
|
|
28006
28021
|
}
|
|
28007
28022
|
});
|
|
28008
28023
|
};
|
|
28009
|
-
const applyParagraphBlockStyles = (element, attrs) => {
|
|
28024
|
+
const applyParagraphBlockStyles = (element, attrs, options = {}) => {
|
|
28010
28025
|
if (!attrs) return;
|
|
28011
28026
|
if (attrs.styleId) {
|
|
28012
28027
|
element.setAttribute("styleid", attrs.styleId);
|
|
@@ -28033,8 +28048,55 @@ const applyParagraphBlockStyles = (element, attrs) => {
|
|
|
28033
28048
|
}
|
|
28034
28049
|
}
|
|
28035
28050
|
}
|
|
28036
|
-
|
|
28037
|
-
|
|
28051
|
+
if (options.includeBorders ?? true) {
|
|
28052
|
+
applyParagraphBorderStyles(element, attrs.borders);
|
|
28053
|
+
}
|
|
28054
|
+
if (options.includeShading ?? true) {
|
|
28055
|
+
applyParagraphShadingStyles(element, attrs.shading);
|
|
28056
|
+
}
|
|
28057
|
+
};
|
|
28058
|
+
const getParagraphBorderBox = (fragmentWidth, indent) => {
|
|
28059
|
+
const indentLeft = Number.isFinite(indent?.left) ? indent.left : 0;
|
|
28060
|
+
const indentRight = Number.isFinite(indent?.right) ? indent.right : 0;
|
|
28061
|
+
const firstLine = Number.isFinite(indent?.firstLine) ? indent.firstLine : 0;
|
|
28062
|
+
const hanging = Number.isFinite(indent?.hanging) ? indent.hanging : 0;
|
|
28063
|
+
const firstLineOffset = firstLine - hanging;
|
|
28064
|
+
const minLeftInset = Math.min(indentLeft, indentLeft + firstLineOffset);
|
|
28065
|
+
const leftInset = Math.max(0, minLeftInset);
|
|
28066
|
+
const rightInset = Math.max(0, indentRight);
|
|
28067
|
+
return {
|
|
28068
|
+
leftInset,
|
|
28069
|
+
width: Math.max(0, fragmentWidth - leftInset - rightInset)
|
|
28070
|
+
};
|
|
28071
|
+
};
|
|
28072
|
+
const createParagraphDecorationLayers = (doc2, fragmentWidth, attrs) => {
|
|
28073
|
+
if (!attrs?.borders && !attrs?.shading) return {};
|
|
28074
|
+
const borderBox = getParagraphBorderBox(fragmentWidth, attrs.indent);
|
|
28075
|
+
const baseStyles = {
|
|
28076
|
+
position: "absolute",
|
|
28077
|
+
top: "0px",
|
|
28078
|
+
bottom: "0px",
|
|
28079
|
+
left: `${borderBox.leftInset}px`,
|
|
28080
|
+
width: `${borderBox.width}px`,
|
|
28081
|
+
pointerEvents: "none",
|
|
28082
|
+
boxSizing: "border-box"
|
|
28083
|
+
};
|
|
28084
|
+
let shadingLayer;
|
|
28085
|
+
if (attrs.shading) {
|
|
28086
|
+
shadingLayer = doc2.createElement("div");
|
|
28087
|
+
shadingLayer.classList.add("superdoc-paragraph-shading");
|
|
28088
|
+
Object.assign(shadingLayer.style, baseStyles);
|
|
28089
|
+
applyParagraphShadingStyles(shadingLayer, attrs.shading);
|
|
28090
|
+
}
|
|
28091
|
+
let borderLayer;
|
|
28092
|
+
if (attrs.borders) {
|
|
28093
|
+
borderLayer = doc2.createElement("div");
|
|
28094
|
+
borderLayer.classList.add("superdoc-paragraph-border");
|
|
28095
|
+
Object.assign(borderLayer.style, baseStyles);
|
|
28096
|
+
borderLayer.style.zIndex = "1";
|
|
28097
|
+
applyParagraphBorderStyles(borderLayer, attrs.borders);
|
|
28098
|
+
}
|
|
28099
|
+
return { shadingLayer, borderLayer };
|
|
28038
28100
|
};
|
|
28039
28101
|
const BORDER_SIDES = ["top", "right", "bottom", "left"];
|
|
28040
28102
|
const applyParagraphBorderStyles = (element, borders) => {
|
|
@@ -31684,33 +31746,13 @@ function computePartialRow(rowIndex, blockRow, measure, availableHeight, fromLin
|
|
|
31684
31746
|
toLineByCell.push(cutLine);
|
|
31685
31747
|
heightByCell.push(cumulativeHeight);
|
|
31686
31748
|
}
|
|
31687
|
-
const allCellsCompleteInFirstPass = toLineByCell.every((cutLine, idx) => {
|
|
31688
|
-
const totalLines = getCellTotalLines(row.cells[idx]);
|
|
31689
|
-
return cutLine >= totalLines;
|
|
31690
|
-
});
|
|
31691
|
-
const lineAdvancements = toLineByCell.map((cutLine, idx) => cutLine - (startLines[idx] || 0));
|
|
31692
|
-
const positiveAdvancements = lineAdvancements.filter((adv) => adv > 0);
|
|
31693
|
-
const minLineAdvancement = positiveAdvancements.length > 0 ? Math.min(...positiveAdvancements) : 0;
|
|
31694
31749
|
let actualPartialHeight = 0;
|
|
31695
31750
|
let maxPaddingTotal = 0;
|
|
31696
31751
|
for (let cellIdx = 0; cellIdx < cellCount; cellIdx++) {
|
|
31697
|
-
const cell = row.cells[cellIdx];
|
|
31698
|
-
const startLine = startLines[cellIdx] || 0;
|
|
31699
|
-
const lines = getCellLines(cell);
|
|
31700
31752
|
const cellPadding = cellPaddings[cellIdx];
|
|
31701
31753
|
const paddingTotal = cellPadding.top + cellPadding.bottom;
|
|
31702
31754
|
maxPaddingTotal = Math.max(maxPaddingTotal, paddingTotal);
|
|
31703
|
-
|
|
31704
|
-
actualPartialHeight = Math.max(actualPartialHeight, heightByCell[cellIdx] + paddingTotal);
|
|
31705
|
-
} else {
|
|
31706
|
-
const targetLine = Math.min(startLine + minLineAdvancement, lines.length);
|
|
31707
|
-
let cumulativeHeight = 0;
|
|
31708
|
-
for (let i = startLine; i < targetLine; i++) {
|
|
31709
|
-
cumulativeHeight += lines[i].lineHeight || 0;
|
|
31710
|
-
}
|
|
31711
|
-
toLineByCell[cellIdx] = targetLine;
|
|
31712
|
-
actualPartialHeight = Math.max(actualPartialHeight, cumulativeHeight + paddingTotal);
|
|
31713
|
-
}
|
|
31755
|
+
actualPartialHeight = Math.max(actualPartialHeight, heightByCell[cellIdx] + paddingTotal);
|
|
31714
31756
|
}
|
|
31715
31757
|
const madeProgress = toLineByCell.some((cutLine, idx) => cutLine > (startLines[idx] || 0));
|
|
31716
31758
|
const isFirstPart = startLines.every((l) => l === 0);
|
|
@@ -32263,7 +32305,7 @@ function toUpperLetter(num) {
|
|
|
32263
32305
|
function toLowerLetter(num) {
|
|
32264
32306
|
return toUpperLetter(num).toLowerCase();
|
|
32265
32307
|
}
|
|
32266
|
-
function formatPageNumber
|
|
32308
|
+
function formatPageNumber(pageNumber, format) {
|
|
32267
32309
|
const num = Math.max(1, pageNumber);
|
|
32268
32310
|
switch (format) {
|
|
32269
32311
|
case "decimal":
|
|
@@ -32276,6 +32318,8 @@ function formatPageNumber$1(pageNumber, format) {
|
|
|
32276
32318
|
return toUpperLetter(num);
|
|
32277
32319
|
case "lowerLetter":
|
|
32278
32320
|
return toLowerLetter(num);
|
|
32321
|
+
case "numberInDash":
|
|
32322
|
+
return `-${num}-`;
|
|
32279
32323
|
default:
|
|
32280
32324
|
return String(num);
|
|
32281
32325
|
}
|
|
@@ -32304,7 +32348,7 @@ function computeDisplayPageNumber(pages, sections) {
|
|
|
32304
32348
|
const sectionMetadata = sectionMap.get(pageSectionIndex);
|
|
32305
32349
|
const format = sectionMetadata?.numbering?.format ?? "decimal";
|
|
32306
32350
|
const displayNumber = runningCounter;
|
|
32307
|
-
const displayText = formatPageNumber
|
|
32351
|
+
const displayText = formatPageNumber(displayNumber, format);
|
|
32308
32352
|
result.push({
|
|
32309
32353
|
physicalPage: page.number,
|
|
32310
32354
|
displayNumber,
|
|
@@ -32439,59 +32483,6 @@ const layoutLog = (...args) => {
|
|
|
32439
32483
|
if (!layoutDebugEnabled$1) return;
|
|
32440
32484
|
console.log(...args);
|
|
32441
32485
|
};
|
|
32442
|
-
function formatPageNumber(num, format) {
|
|
32443
|
-
switch (format) {
|
|
32444
|
-
case "decimal":
|
|
32445
|
-
return String(num);
|
|
32446
|
-
case "lowerLetter":
|
|
32447
|
-
return toLetter(num, false);
|
|
32448
|
-
case "upperLetter":
|
|
32449
|
-
return toLetter(num, true);
|
|
32450
|
-
case "lowerRoman":
|
|
32451
|
-
return toRoman$1(num).toLowerCase();
|
|
32452
|
-
case "upperRoman":
|
|
32453
|
-
return toRoman$1(num);
|
|
32454
|
-
default:
|
|
32455
|
-
return String(num);
|
|
32456
|
-
}
|
|
32457
|
-
}
|
|
32458
|
-
function toLetter(num, uppercase) {
|
|
32459
|
-
let result = "";
|
|
32460
|
-
let n = Math.max(1, Math.floor(num));
|
|
32461
|
-
while (n > 0) {
|
|
32462
|
-
const remainder = (n - 1) % 26;
|
|
32463
|
-
const char = String.fromCharCode((uppercase ? 65 : 97) + remainder);
|
|
32464
|
-
result = char + result;
|
|
32465
|
-
n = Math.floor((n - 1) / 26);
|
|
32466
|
-
}
|
|
32467
|
-
return result;
|
|
32468
|
-
}
|
|
32469
|
-
function toRoman$1(num) {
|
|
32470
|
-
const lookup = [
|
|
32471
|
-
[1e3, "M"],
|
|
32472
|
-
[900, "CM"],
|
|
32473
|
-
[500, "D"],
|
|
32474
|
-
[400, "CD"],
|
|
32475
|
-
[100, "C"],
|
|
32476
|
-
[90, "XC"],
|
|
32477
|
-
[50, "L"],
|
|
32478
|
-
[40, "XL"],
|
|
32479
|
-
[10, "X"],
|
|
32480
|
-
[9, "IX"],
|
|
32481
|
-
[5, "V"],
|
|
32482
|
-
[4, "IV"],
|
|
32483
|
-
[1, "I"]
|
|
32484
|
-
];
|
|
32485
|
-
let result = "";
|
|
32486
|
-
let n = Math.max(1, Math.floor(num));
|
|
32487
|
-
for (const [value, numeral] of lookup) {
|
|
32488
|
-
while (n >= value) {
|
|
32489
|
-
result += numeral;
|
|
32490
|
-
n -= value;
|
|
32491
|
-
}
|
|
32492
|
-
}
|
|
32493
|
-
return result;
|
|
32494
|
-
}
|
|
32495
32486
|
function layoutDocument(blocks, measures, options = {}) {
|
|
32496
32487
|
if (blocks.length !== measures.length) {
|
|
32497
32488
|
throw new Error(
|
|
@@ -33947,7 +33938,7 @@ class MeasureCache {
|
|
|
33947
33938
|
return `${block.id}@${safeWidth}x${safeHeight}:${hash2}`;
|
|
33948
33939
|
}
|
|
33949
33940
|
}
|
|
33950
|
-
function resolveHeaderFooterTokens(blocks, pageNumber, totalPages) {
|
|
33941
|
+
function resolveHeaderFooterTokens(blocks, pageNumber, totalPages, pageNumberText) {
|
|
33951
33942
|
if (!blocks || blocks.length === 0) {
|
|
33952
33943
|
return;
|
|
33953
33944
|
}
|
|
@@ -33959,7 +33950,7 @@ function resolveHeaderFooterTokens(blocks, pageNumber, totalPages) {
|
|
|
33959
33950
|
console.warn("[resolveHeaderFooterTokens] Invalid totalPages:", totalPages, "- using 1 as fallback");
|
|
33960
33951
|
totalPages = 1;
|
|
33961
33952
|
}
|
|
33962
|
-
const pageNumberStr = String(pageNumber);
|
|
33953
|
+
const pageNumberStr = pageNumberText ?? String(pageNumber);
|
|
33963
33954
|
const totalPagesStr = String(totalPages);
|
|
33964
33955
|
for (const block of blocks) {
|
|
33965
33956
|
if (block.kind !== "paragraph") continue;
|
|
@@ -34382,15 +34373,31 @@ async function layoutHeaderFooterWithCache(sections, constraints, measureBlock2,
|
|
|
34382
34373
|
for (const pageNum of pagesToLayout) {
|
|
34383
34374
|
const clonedBlocks = cloneHeaderFooterBlocks(blocks);
|
|
34384
34375
|
const { displayText, totalPages: totalPagesForPage } = pageResolver(pageNum);
|
|
34385
|
-
|
|
34386
|
-
resolveHeaderFooterTokens(clonedBlocks, resolvedPageNum, totalPagesForPage);
|
|
34376
|
+
resolveHeaderFooterTokens(clonedBlocks, pageNum, totalPagesForPage, displayText);
|
|
34387
34377
|
const measures = await cache2.measureBlocks(clonedBlocks, constraints, measureBlock2);
|
|
34388
34378
|
const pageLayout = layoutHeaderFooter(clonedBlocks, measures, constraints);
|
|
34379
|
+
const measuresById = /* @__PURE__ */ new Map();
|
|
34380
|
+
for (let i = 0; i < clonedBlocks.length; i += 1) {
|
|
34381
|
+
measuresById.set(clonedBlocks[i].id, measures[i]);
|
|
34382
|
+
}
|
|
34383
|
+
const fragmentsWithLines = pageLayout.pages[0]?.fragments.map((fragment) => {
|
|
34384
|
+
if (fragment.kind !== "para") {
|
|
34385
|
+
return fragment;
|
|
34386
|
+
}
|
|
34387
|
+
const measure = measuresById.get(fragment.blockId);
|
|
34388
|
+
if (!measure || measure.kind !== "paragraph") {
|
|
34389
|
+
return fragment;
|
|
34390
|
+
}
|
|
34391
|
+
return {
|
|
34392
|
+
...fragment,
|
|
34393
|
+
lines: measure.lines.slice(fragment.fromLine, fragment.toLine)
|
|
34394
|
+
};
|
|
34395
|
+
}) ?? [];
|
|
34389
34396
|
pages.push({
|
|
34390
34397
|
number: pageNum,
|
|
34391
34398
|
blocks: clonedBlocks,
|
|
34392
34399
|
measures,
|
|
34393
|
-
fragments:
|
|
34400
|
+
fragments: fragmentsWithLines
|
|
34394
34401
|
});
|
|
34395
34402
|
}
|
|
34396
34403
|
const firstPageLayout = pages[0] ? layoutHeaderFooter(pages[0].blocks, pages[0].measures, constraints) : { height: 0 };
|
|
@@ -39277,7 +39284,14 @@ function extractPageNumbering(elements) {
|
|
|
39277
39284
|
const pgNumType = elements.find((el) => el?.name === "w:pgNumType");
|
|
39278
39285
|
if (!pgNumType?.attributes) return void 0;
|
|
39279
39286
|
const fmtRaw = pgNumType.attributes["w:fmt"];
|
|
39280
|
-
const validFormats = [
|
|
39287
|
+
const validFormats = [
|
|
39288
|
+
"decimal",
|
|
39289
|
+
"lowerLetter",
|
|
39290
|
+
"upperLetter",
|
|
39291
|
+
"lowerRoman",
|
|
39292
|
+
"upperRoman",
|
|
39293
|
+
"numberInDash"
|
|
39294
|
+
];
|
|
39281
39295
|
const fmt = validFormats.includes(fmtRaw) ? fmtRaw : void 0;
|
|
39282
39296
|
const startRaw = pgNumType.attributes["w:start"];
|
|
39283
39297
|
const startNum = startRaw != null ? Number(startRaw) : void 0;
|
|
@@ -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-D5tN0eME.es.js";
|
|
2
|
+
import "./SuperConverter-ClzyObj7.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-BpbDm_Oh.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.
|
|
8353
|
+
this.version = "1.3.0-next.2";
|
|
8354
8354
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
8355
8355
|
this.superdocId = config.superdocId || v4();
|
|
8356
8356
|
this.colors = this.config.colors;
|