@harbour-enterprises/superdoc 1.0.0-beta.97 → 1.0.0-beta.99
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-YvkZg201.cjs → PdfViewer-BtuTHUW7.cjs} +1 -1
- package/dist/chunks/{PdfViewer-BHcBfUWj.es.js → PdfViewer-DF-v5Yrr.es.js} +1 -1
- package/dist/chunks/{index-Pvlqsxge-IH3eauKE.cjs → index-BB0msI45-CPU6Ak2R.cjs} +1 -1
- package/dist/chunks/{index-Pvlqsxge-vW641SZt.es.js → index-BB0msI45-DUPBw4Bh.es.js} +1 -1
- package/dist/chunks/{index-DZ_AI-HW.cjs → index-BBu9BBvp.cjs} +5 -14
- package/dist/chunks/{index-DeQfFbTb.es.js → index-CJy3FxL7.es.js} +5 -14
- package/dist/chunks/{super-editor.es-BinyZw4F.es.js → super-editor.es-BiaFIbw-.es.js} +242 -160
- package/dist/chunks/{super-editor.es-BP3PKkwh.cjs → super-editor.es-C04sFzVD.cjs} +242 -160
- package/dist/style.css +6 -6
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-BEVM5t3i.js → converter-B_cVJPnh.js} +1 -1
- package/dist/super-editor/chunks/{docx-zipper-vETk3IMG.js → docx-zipper-fPWx7kV0.js} +1 -1
- package/dist/super-editor/chunks/{editor-B8k1bwD_.js → editor-DS9z42Je.js} +243 -161
- package/dist/super-editor/chunks/{index-Pvlqsxge.js → index-BB0msI45.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-j1GSUGWU.js → toolbar-aIFlIr6h.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/super-editor.es.js +6 -6
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +246 -173
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/superdoc.umd.js
CHANGED
|
@@ -42422,7 +42422,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
42422
42422
|
static getStoredSuperdocVersion(docx) {
|
|
42423
42423
|
return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42424
42424
|
}
|
|
42425
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.
|
|
42425
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.99") {
|
|
42426
42426
|
return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
42427
42427
|
}
|
|
42428
42428
|
/**
|
|
@@ -67497,7 +67497,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
67497
67497
|
const shouldSkipNodeView = (editor) => {
|
|
67498
67498
|
return isHeadless(editor);
|
|
67499
67499
|
};
|
|
67500
|
-
const summaryVersion = "1.0.0-beta.
|
|
67500
|
+
const summaryVersion = "1.0.0-beta.99";
|
|
67501
67501
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
67502
67502
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
67503
67503
|
function mapAttributes(attrs) {
|
|
@@ -68286,7 +68286,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
68286
68286
|
{ default: remarkStringify2 },
|
|
68287
68287
|
{ default: remarkGfm2 }
|
|
68288
68288
|
] = await Promise.all([
|
|
68289
|
-
Promise.resolve().then(() =>
|
|
68289
|
+
Promise.resolve().then(() => indexBB0msI45),
|
|
68290
68290
|
Promise.resolve().then(() => indexDRCvimau),
|
|
68291
68291
|
Promise.resolve().then(() => indexC_x_N6Uh),
|
|
68292
68292
|
Promise.resolve().then(() => indexD_sWOSiG),
|
|
@@ -68491,7 +68491,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
68491
68491
|
* Process collaboration migrations
|
|
68492
68492
|
*/
|
|
68493
68493
|
processCollaborationMigrations() {
|
|
68494
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.
|
|
68494
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.99");
|
|
68495
68495
|
if (!this.options.ydoc) return;
|
|
68496
68496
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
68497
68497
|
let docVersion = metaMap.get("version");
|
|
@@ -70869,14 +70869,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
70869
70869
|
return { pageSizePx, orientation };
|
|
70870
70870
|
}
|
|
70871
70871
|
function extractFallbackMargins(elements, currentHeader, currentFooter) {
|
|
70872
|
-
if (currentHeader !== void 0 && currentFooter !== void 0) {
|
|
70873
|
-
return { headerPx: currentHeader, footerPx: currentFooter };
|
|
70874
|
-
}
|
|
70875
70872
|
const pgMar = elements.find((el) => el?.name === "w:pgMar");
|
|
70876
70873
|
const a2 = pgMar?.attributes || {};
|
|
70877
70874
|
return {
|
|
70878
70875
|
headerPx: currentHeader ?? (a2["w:header"] != null ? twipsToPixels$1(a2["w:header"]) : void 0),
|
|
70879
|
-
footerPx: currentFooter ?? (a2["w:footer"] != null ? twipsToPixels$1(a2["w:footer"]) : void 0)
|
|
70876
|
+
footerPx: currentFooter ?? (a2["w:footer"] != null ? twipsToPixels$1(a2["w:footer"]) : void 0),
|
|
70877
|
+
topPx: a2["w:top"] != null ? twipsToPixels$1(a2["w:top"]) : void 0,
|
|
70878
|
+
rightPx: a2["w:right"] != null ? twipsToPixels$1(a2["w:right"]) : void 0,
|
|
70879
|
+
bottomPx: a2["w:bottom"] != null ? twipsToPixels$1(a2["w:bottom"]) : void 0,
|
|
70880
|
+
leftPx: a2["w:left"] != null ? twipsToPixels$1(a2["w:left"]) : void 0
|
|
70880
70881
|
};
|
|
70881
70882
|
}
|
|
70882
70883
|
function extractHeaderFooterRefs(elements, refName) {
|
|
@@ -70937,7 +70938,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
70937
70938
|
const type2 = extractSectionType(sectPrElements);
|
|
70938
70939
|
const { pageSizePx, orientation } = extractPageSizeAndOrientation(sectPrElements);
|
|
70939
70940
|
const titlePg = sectPrElements.some((el) => el?.name === "w:titlePg");
|
|
70940
|
-
|
|
70941
|
+
const fallbackMargins = extractFallbackMargins(sectPrElements, headerPx, footerPx);
|
|
70942
|
+
headerPx = fallbackMargins.headerPx;
|
|
70943
|
+
footerPx = fallbackMargins.footerPx;
|
|
70944
|
+
const { topPx, rightPx, bottomPx, leftPx } = fallbackMargins;
|
|
70941
70945
|
const headerRefs = extractHeaderFooterRefs(sectPrElements, "w:headerReference");
|
|
70942
70946
|
const footerRefs = extractHeaderFooterRefs(sectPrElements, "w:footerReference");
|
|
70943
70947
|
const numbering = extractPageNumbering(sectPrElements);
|
|
@@ -70946,6 +70950,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
70946
70950
|
return {
|
|
70947
70951
|
headerPx,
|
|
70948
70952
|
footerPx,
|
|
70953
|
+
topPx,
|
|
70954
|
+
rightPx,
|
|
70955
|
+
bottomPx,
|
|
70956
|
+
leftPx,
|
|
70949
70957
|
type: type2,
|
|
70950
70958
|
pageSizePx,
|
|
70951
70959
|
orientation,
|
|
@@ -71057,7 +71065,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
71057
71065
|
startParagraphIndex: currentStart,
|
|
71058
71066
|
endParagraphIndex: item.index,
|
|
71059
71067
|
sectPr,
|
|
71060
|
-
margins: sectionData.headerPx != null || sectionData.footerPx != null ? {
|
|
71068
|
+
margins: sectionData.headerPx != null || sectionData.footerPx != null ? {
|
|
71069
|
+
header: sectionData.headerPx ?? 0,
|
|
71070
|
+
footer: sectionData.footerPx ?? 0,
|
|
71071
|
+
top: sectionData.topPx,
|
|
71072
|
+
right: sectionData.rightPx,
|
|
71073
|
+
bottom: sectionData.bottomPx,
|
|
71074
|
+
left: sectionData.leftPx
|
|
71075
|
+
} : null,
|
|
71061
71076
|
pageSize: sectionData.pageSizePx ?? null,
|
|
71062
71077
|
orientation: sectionData.orientation ?? null,
|
|
71063
71078
|
columns: sectionData.columnsPx ?? null,
|
|
@@ -71099,7 +71114,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
71099
71114
|
startParagraphIndex: currentStart,
|
|
71100
71115
|
endParagraphIndex: totalParagraphs - 1,
|
|
71101
71116
|
sectPr: bodySectPr,
|
|
71102
|
-
margins: bodySectionData.headerPx != null || bodySectionData.footerPx != null ? {
|
|
71117
|
+
margins: bodySectionData.headerPx != null || bodySectionData.footerPx != null ? {
|
|
71118
|
+
header: bodySectionData.headerPx ?? 0,
|
|
71119
|
+
footer: bodySectionData.footerPx ?? 0,
|
|
71120
|
+
top: bodySectionData.topPx,
|
|
71121
|
+
right: bodySectionData.rightPx,
|
|
71122
|
+
bottom: bodySectionData.bottomPx,
|
|
71123
|
+
left: bodySectionData.leftPx
|
|
71124
|
+
} : null,
|
|
71103
71125
|
pageSize: bodySectionData.pageSizePx ?? null,
|
|
71104
71126
|
orientation: bodySectionData.orientation ?? null,
|
|
71105
71127
|
columns: bodySectionData.columnsPx ?? null,
|
|
@@ -77378,41 +77400,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
77378
77400
|
}
|
|
77379
77401
|
}
|
|
77380
77402
|
}
|
|
77381
|
-
try {
|
|
77382
|
-
const blockSummaries = blocks2.map((b2) => {
|
|
77383
|
-
if (b2.kind === "paragraph") {
|
|
77384
|
-
const runs2 = b2.runs ?? [];
|
|
77385
|
-
const attrs = b2.attrs ?? {};
|
|
77386
|
-
return {
|
|
77387
|
-
kind: "paragraph",
|
|
77388
|
-
runKinds: runs2.map((r2) => r2.kind ?? "text"),
|
|
77389
|
-
runCount: runs2.length,
|
|
77390
|
-
runPreview: runs2.map((r2) => {
|
|
77391
|
-
const kind = r2.kind ?? "text";
|
|
77392
|
-
if (kind === "image") {
|
|
77393
|
-
const img2 = r2;
|
|
77394
|
-
return { kind, src: img2.src, width: img2.width, height: img2.height };
|
|
77395
|
-
}
|
|
77396
|
-
return { kind };
|
|
77397
|
-
}),
|
|
77398
|
-
hasNumbering: Boolean(attrs.numberingProperties),
|
|
77399
|
-
markerText: attrs.wordLayout?.marker?.markerText
|
|
77400
|
-
};
|
|
77401
|
-
}
|
|
77402
|
-
return { kind: b2.kind };
|
|
77403
|
-
});
|
|
77404
|
-
console.log(
|
|
77405
|
-
"[tableNodeToBlock.parseTableCell] cell contents",
|
|
77406
|
-
JSON.stringify({
|
|
77407
|
-
cellIndex,
|
|
77408
|
-
rowIndex,
|
|
77409
|
-
cellIdPreview: `cell-${rowIndex}-${cellIndex}`,
|
|
77410
|
-
childTypes: cellNode.content.map((c2) => c2?.type),
|
|
77411
|
-
blocks: blockSummaries
|
|
77412
|
-
})
|
|
77413
|
-
);
|
|
77414
|
-
} catch {
|
|
77415
|
-
}
|
|
77416
77403
|
if (blocks2.length === 0) {
|
|
77417
77404
|
return null;
|
|
77418
77405
|
}
|
|
@@ -81277,20 +81264,6 @@ ${l}
|
|
|
81277
81264
|
}
|
|
81278
81265
|
const cellBlocks = cell2?.blocks ?? (cell2?.paragraph ? [cell2.paragraph] : []);
|
|
81279
81266
|
const blockMeasures = cellMeasure?.blocks ?? (cellMeasure?.paragraph ? [cellMeasure.paragraph] : []);
|
|
81280
|
-
try {
|
|
81281
|
-
console.log(
|
|
81282
|
-
"[DomPainter.renderTableCell] cell render input",
|
|
81283
|
-
JSON.stringify({
|
|
81284
|
-
cellId: cell2?.id,
|
|
81285
|
-
blockKinds: cellBlocks.map((b2) => b2.kind),
|
|
81286
|
-
measureKinds: blockMeasures.map((m2) => m2.kind),
|
|
81287
|
-
width: cellMeasure?.width,
|
|
81288
|
-
height: cellMeasure?.height,
|
|
81289
|
-
rowHeight
|
|
81290
|
-
})
|
|
81291
|
-
);
|
|
81292
|
-
} catch {
|
|
81293
|
-
}
|
|
81294
81267
|
if (cellBlocks.length > 0 && blockMeasures.length > 0) {
|
|
81295
81268
|
const content2 = doc2.createElement("div");
|
|
81296
81269
|
content2.style.position = "relative";
|
|
@@ -81323,15 +81296,6 @@ ${l}
|
|
|
81323
81296
|
const blockMeasure = blockMeasures[i2];
|
|
81324
81297
|
const block = cellBlocks[i2];
|
|
81325
81298
|
if (blockMeasure.kind === "image" && block?.kind === "image") {
|
|
81326
|
-
console.log(
|
|
81327
|
-
"[DomPainter.renderTableCell] rendering image block in cell",
|
|
81328
|
-
JSON.stringify({
|
|
81329
|
-
cellId: cell2?.id,
|
|
81330
|
-
blockId: block.id,
|
|
81331
|
-
width: blockMeasure.width,
|
|
81332
|
-
height: blockMeasure.height
|
|
81333
|
-
})
|
|
81334
|
-
);
|
|
81335
81299
|
const imageWrapper = doc2.createElement("div");
|
|
81336
81300
|
imageWrapper.style.position = "relative";
|
|
81337
81301
|
imageWrapper.style.width = `${blockMeasure.width}px`;
|
|
@@ -81354,16 +81318,6 @@ ${l}
|
|
|
81354
81318
|
continue;
|
|
81355
81319
|
}
|
|
81356
81320
|
if (blockMeasure.kind === "drawing" && block?.kind === "drawing") {
|
|
81357
|
-
console.log(
|
|
81358
|
-
"[DomPainter.renderTableCell] rendering drawing block in cell",
|
|
81359
|
-
JSON.stringify({
|
|
81360
|
-
cellId: cell2?.id,
|
|
81361
|
-
blockId: block.id,
|
|
81362
|
-
drawingKind: block.drawingKind,
|
|
81363
|
-
width: blockMeasure.width,
|
|
81364
|
-
height: blockMeasure.height
|
|
81365
|
-
})
|
|
81366
|
-
);
|
|
81367
81321
|
const drawingWrapper = doc2.createElement("div");
|
|
81368
81322
|
drawingWrapper.style.position = "relative";
|
|
81369
81323
|
drawingWrapper.style.width = `${blockMeasure.width}px`;
|
|
@@ -81406,20 +81360,6 @@ ${l}
|
|
|
81406
81360
|
continue;
|
|
81407
81361
|
}
|
|
81408
81362
|
if (blockMeasure.kind === "paragraph" && block?.kind === "paragraph") {
|
|
81409
|
-
try {
|
|
81410
|
-
const runKinds = (block.runs ?? []).map((r2) => r2.kind ?? "text");
|
|
81411
|
-
const imageRuns = (block.runs ?? []).filter((r2) => r2.kind === "image").map((r2) => ({ src: r2.src }));
|
|
81412
|
-
console.log(
|
|
81413
|
-
"[DomPainter.renderTableCell] rendering paragraph block in cell",
|
|
81414
|
-
JSON.stringify({
|
|
81415
|
-
cellId: cell2?.id,
|
|
81416
|
-
blockId: block.id,
|
|
81417
|
-
runKinds,
|
|
81418
|
-
imageRuns
|
|
81419
|
-
})
|
|
81420
|
-
);
|
|
81421
|
-
} catch {
|
|
81422
|
-
}
|
|
81423
81363
|
const paragraphMeasure = blockMeasure;
|
|
81424
81364
|
const lines = paragraphMeasure.lines;
|
|
81425
81365
|
const blockLineCount = lines?.length || 0;
|
|
@@ -82342,6 +82282,61 @@ ${l}
|
|
|
82342
82282
|
doc2.head?.appendChild(styleEl);
|
|
82343
82283
|
rulerStylesInjected = true;
|
|
82344
82284
|
}
|
|
82285
|
+
const hashParagraphBorder$1 = (border) => {
|
|
82286
|
+
const parts = [];
|
|
82287
|
+
if (border.style !== void 0) parts.push(`s:${border.style}`);
|
|
82288
|
+
if (border.width !== void 0) parts.push(`w:${border.width}`);
|
|
82289
|
+
if (border.color !== void 0) parts.push(`c:${border.color}`);
|
|
82290
|
+
if (border.space !== void 0) parts.push(`sp:${border.space}`);
|
|
82291
|
+
return parts.join(",");
|
|
82292
|
+
};
|
|
82293
|
+
const hashParagraphBorders$1 = (borders) => {
|
|
82294
|
+
const parts = [];
|
|
82295
|
+
if (borders.top) parts.push(`t:[${hashParagraphBorder$1(borders.top)}]`);
|
|
82296
|
+
if (borders.right) parts.push(`r:[${hashParagraphBorder$1(borders.right)}]`);
|
|
82297
|
+
if (borders.bottom) parts.push(`b:[${hashParagraphBorder$1(borders.bottom)}]`);
|
|
82298
|
+
if (borders.left) parts.push(`l:[${hashParagraphBorder$1(borders.left)}]`);
|
|
82299
|
+
return parts.join(";");
|
|
82300
|
+
};
|
|
82301
|
+
const hasStringProp = (run2, prop) => {
|
|
82302
|
+
return prop in run2 && typeof run2[prop] === "string";
|
|
82303
|
+
};
|
|
82304
|
+
const hasNumberProp = (run2, prop) => {
|
|
82305
|
+
return prop in run2 && typeof run2[prop] === "number";
|
|
82306
|
+
};
|
|
82307
|
+
const hasBooleanProp = (run2, prop) => {
|
|
82308
|
+
return prop in run2 && typeof run2[prop] === "boolean";
|
|
82309
|
+
};
|
|
82310
|
+
const getRunStringProp = (run2, prop) => {
|
|
82311
|
+
if (hasStringProp(run2, prop)) {
|
|
82312
|
+
return run2[prop];
|
|
82313
|
+
}
|
|
82314
|
+
return "";
|
|
82315
|
+
};
|
|
82316
|
+
const getRunNumberProp = (run2, prop) => {
|
|
82317
|
+
if (hasNumberProp(run2, prop)) {
|
|
82318
|
+
return run2[prop];
|
|
82319
|
+
}
|
|
82320
|
+
return 0;
|
|
82321
|
+
};
|
|
82322
|
+
const getRunBooleanProp = (run2, prop) => {
|
|
82323
|
+
if (hasBooleanProp(run2, prop)) {
|
|
82324
|
+
return run2[prop];
|
|
82325
|
+
}
|
|
82326
|
+
return false;
|
|
82327
|
+
};
|
|
82328
|
+
const getRunUnderlineStyle = (run2) => {
|
|
82329
|
+
if ("underline" in run2 && run2.underline && typeof run2.underline === "object") {
|
|
82330
|
+
return run2.underline.style ?? "";
|
|
82331
|
+
}
|
|
82332
|
+
return "";
|
|
82333
|
+
};
|
|
82334
|
+
const getRunUnderlineColor = (run2) => {
|
|
82335
|
+
if ("underline" in run2 && run2.underline && typeof run2.underline === "object") {
|
|
82336
|
+
return run2.underline.color ?? "";
|
|
82337
|
+
}
|
|
82338
|
+
return "";
|
|
82339
|
+
};
|
|
82345
82340
|
function isMinimalWordLayout(value) {
|
|
82346
82341
|
if (typeof value !== "object" || value === null) {
|
|
82347
82342
|
return false;
|
|
@@ -83234,7 +83229,9 @@ ${l}
|
|
|
83234
83229
|
const isTocEntry = block.attrs?.isTocEntry;
|
|
83235
83230
|
const hasMarker = !fragment.continuesFromPrev && fragment.markerWidth && wordLayout?.marker;
|
|
83236
83231
|
const hasSdtContainer = block.attrs?.sdt?.type === "documentSection" || block.attrs?.sdt?.type === "structuredContent" || block.attrs?.containerSdt?.type === "documentSection" || block.attrs?.containerSdt?.type === "structuredContent";
|
|
83237
|
-
const
|
|
83232
|
+
const paraIndentForOverflow = block.attrs?.indent;
|
|
83233
|
+
const hasNegativeIndent = (paraIndentForOverflow?.left ?? 0) < 0 || (paraIndentForOverflow?.right ?? 0) < 0;
|
|
83234
|
+
const styles = isTocEntry ? { ...fragmentStyles, whiteSpace: "nowrap" } : hasMarker || hasSdtContainer || hasNegativeIndent ? { ...fragmentStyles, overflow: "visible" } : fragmentStyles;
|
|
83238
83235
|
applyStyles$2(fragmentEl, styles);
|
|
83239
83236
|
this.applyFragmentFrame(fragmentEl, fragment, context.section);
|
|
83240
83237
|
if (isTocEntry) {
|
|
@@ -83263,6 +83260,8 @@ ${l}
|
|
|
83263
83260
|
}
|
|
83264
83261
|
if (fragmentEl.style.paddingLeft) fragmentEl.style.removeProperty("padding-left");
|
|
83265
83262
|
if (fragmentEl.style.paddingRight) fragmentEl.style.removeProperty("padding-right");
|
|
83263
|
+
if (fragmentEl.style.marginLeft) fragmentEl.style.removeProperty("margin-left");
|
|
83264
|
+
if (fragmentEl.style.marginRight) fragmentEl.style.removeProperty("margin-right");
|
|
83266
83265
|
if (fragmentEl.style.textIndent) fragmentEl.style.removeProperty("text-indent");
|
|
83267
83266
|
const paraIndent = block.attrs?.indent;
|
|
83268
83267
|
const paraIndentLeft = paraIndent?.left ?? 0;
|
|
@@ -83291,16 +83290,22 @@ ${l}
|
|
|
83291
83290
|
if (!isListFirstLine) {
|
|
83292
83291
|
if (hasExplicitSegmentPositioning) {
|
|
83293
83292
|
if (isFirstLine && firstLineOffset !== 0) {
|
|
83294
|
-
const
|
|
83295
|
-
|
|
83293
|
+
const effectiveLeftIndent = paraIndentLeft < 0 ? 0 : paraIndentLeft;
|
|
83294
|
+
const adjustedPadding = effectiveLeftIndent + firstLineOffset;
|
|
83295
|
+
if (adjustedPadding > 0) {
|
|
83296
|
+
lineEl.style.paddingLeft = `${adjustedPadding}px`;
|
|
83297
|
+
}
|
|
83296
83298
|
}
|
|
83297
|
-
} else if (paraIndentLeft) {
|
|
83299
|
+
} else if (paraIndentLeft && paraIndentLeft > 0) {
|
|
83298
83300
|
lineEl.style.paddingLeft = `${paraIndentLeft}px`;
|
|
83301
|
+
} else if (!isFirstLine && paraIndent?.hanging && paraIndent.hanging > 0) {
|
|
83302
|
+
lineEl.style.paddingLeft = `${paraIndent.hanging}px`;
|
|
83299
83303
|
}
|
|
83300
83304
|
}
|
|
83301
|
-
if (paraIndentRight) {
|
|
83305
|
+
if (paraIndentRight && paraIndentRight > 0) {
|
|
83302
83306
|
lineEl.style.paddingRight = `${paraIndentRight}px`;
|
|
83303
83307
|
}
|
|
83308
|
+
const hasNegativeLeftIndent = paraIndentLeft != null && paraIndentLeft < 0;
|
|
83304
83309
|
if (!fragment.continuesFromPrev && index2 === 0 && firstLineOffset && !isListFirstLine) {
|
|
83305
83310
|
if (!hasExplicitSegmentPositioning) {
|
|
83306
83311
|
lineEl.style.textIndent = `${firstLineOffset}px`;
|
|
@@ -85411,7 +85416,7 @@ ${l}
|
|
|
85411
85416
|
attrs.indent?.right ?? "",
|
|
85412
85417
|
attrs.indent?.firstLine ?? "",
|
|
85413
85418
|
attrs.indent?.hanging ?? "",
|
|
85414
|
-
attrs.borders ?
|
|
85419
|
+
attrs.borders ? hashParagraphBorders$1(attrs.borders) : "",
|
|
85415
85420
|
attrs.shading?.fill ?? "",
|
|
85416
85421
|
attrs.shading?.color ?? "",
|
|
85417
85422
|
attrs.direction ?? "",
|
|
@@ -85500,14 +85505,43 @@ ${l}
|
|
|
85500
85505
|
for (const cellBlock of cellBlocks) {
|
|
85501
85506
|
hash2 = hashString(hash2, cellBlock?.kind ?? "unknown");
|
|
85502
85507
|
if (cellBlock?.kind === "paragraph") {
|
|
85503
|
-
const
|
|
85508
|
+
const paragraphBlock = cellBlock;
|
|
85509
|
+
const runs2 = paragraphBlock.runs ?? [];
|
|
85504
85510
|
hash2 = hashNumber(hash2, runs2.length);
|
|
85511
|
+
const attrs = paragraphBlock.attrs;
|
|
85512
|
+
if (attrs) {
|
|
85513
|
+
hash2 = hashString(hash2, attrs.alignment ?? "");
|
|
85514
|
+
hash2 = hashNumber(hash2, attrs.spacing?.before ?? 0);
|
|
85515
|
+
hash2 = hashNumber(hash2, attrs.spacing?.after ?? 0);
|
|
85516
|
+
hash2 = hashNumber(hash2, attrs.spacing?.line ?? 0);
|
|
85517
|
+
hash2 = hashString(hash2, attrs.spacing?.lineRule ?? "");
|
|
85518
|
+
hash2 = hashNumber(hash2, attrs.indent?.left ?? 0);
|
|
85519
|
+
hash2 = hashNumber(hash2, attrs.indent?.right ?? 0);
|
|
85520
|
+
hash2 = hashNumber(hash2, attrs.indent?.firstLine ?? 0);
|
|
85521
|
+
hash2 = hashNumber(hash2, attrs.indent?.hanging ?? 0);
|
|
85522
|
+
hash2 = hashString(hash2, attrs.shading?.fill ?? "");
|
|
85523
|
+
hash2 = hashString(hash2, attrs.shading?.color ?? "");
|
|
85524
|
+
hash2 = hashString(hash2, attrs.direction ?? "");
|
|
85525
|
+
hash2 = hashString(hash2, attrs.rtl ? "1" : "");
|
|
85526
|
+
if (attrs.borders) {
|
|
85527
|
+
hash2 = hashString(hash2, hashParagraphBorders$1(attrs.borders));
|
|
85528
|
+
}
|
|
85529
|
+
}
|
|
85505
85530
|
for (const run2 of runs2) {
|
|
85506
85531
|
if ("text" in run2 && typeof run2.text === "string") {
|
|
85507
85532
|
hash2 = hashString(hash2, run2.text);
|
|
85508
85533
|
}
|
|
85509
85534
|
hash2 = hashNumber(hash2, run2.pmStart ?? -1);
|
|
85510
85535
|
hash2 = hashNumber(hash2, run2.pmEnd ?? -1);
|
|
85536
|
+
hash2 = hashString(hash2, getRunStringProp(run2, "color"));
|
|
85537
|
+
hash2 = hashString(hash2, getRunStringProp(run2, "highlight"));
|
|
85538
|
+
hash2 = hashString(hash2, getRunBooleanProp(run2, "bold") ? "1" : "");
|
|
85539
|
+
hash2 = hashString(hash2, getRunBooleanProp(run2, "italic") ? "1" : "");
|
|
85540
|
+
hash2 = hashNumber(hash2, getRunNumberProp(run2, "fontSize"));
|
|
85541
|
+
hash2 = hashString(hash2, getRunStringProp(run2, "fontFamily"));
|
|
85542
|
+
hash2 = hashString(hash2, getRunUnderlineStyle(run2));
|
|
85543
|
+
hash2 = hashString(hash2, getRunUnderlineColor(run2));
|
|
85544
|
+
hash2 = hashString(hash2, getRunBooleanProp(run2, "strike") ? "1" : "");
|
|
85511
85545
|
}
|
|
85512
85546
|
}
|
|
85513
85547
|
}
|
|
@@ -85585,15 +85619,18 @@ ${l}
|
|
|
85585
85619
|
}
|
|
85586
85620
|
const indent2 = attrs.indent;
|
|
85587
85621
|
if (indent2) {
|
|
85588
|
-
if (indent2.left) {
|
|
85622
|
+
if (indent2.left && indent2.left > 0) {
|
|
85589
85623
|
element2.style.paddingLeft = `${indent2.left}px`;
|
|
85590
85624
|
}
|
|
85591
|
-
if (indent2.right) {
|
|
85625
|
+
if (indent2.right && indent2.right > 0) {
|
|
85592
85626
|
element2.style.paddingRight = `${indent2.right}px`;
|
|
85593
85627
|
}
|
|
85594
|
-
const
|
|
85595
|
-
if (
|
|
85596
|
-
|
|
85628
|
+
const hasNegativeLeftIndent = indent2.left != null && indent2.left < 0;
|
|
85629
|
+
if (!hasNegativeLeftIndent) {
|
|
85630
|
+
const textIndent = (indent2.firstLine ?? 0) - (indent2.hanging ?? 0);
|
|
85631
|
+
if (textIndent) {
|
|
85632
|
+
element2.style.textIndent = `${textIndent}px`;
|
|
85633
|
+
}
|
|
85597
85634
|
}
|
|
85598
85635
|
}
|
|
85599
85636
|
applyParagraphBorderStyles(element2, attrs.borders);
|
|
@@ -86955,20 +86992,6 @@ ${l}
|
|
|
86955
86992
|
}
|
|
86956
86993
|
return value;
|
|
86957
86994
|
};
|
|
86958
|
-
function calculateFirstLineIndent(block, measure) {
|
|
86959
|
-
const wordLayout = block.attrs?.wordLayout;
|
|
86960
|
-
if (!wordLayout?.firstLineIndentMode) {
|
|
86961
|
-
return 0;
|
|
86962
|
-
}
|
|
86963
|
-
if (!wordLayout.marker || !measure.marker) {
|
|
86964
|
-
return 0;
|
|
86965
|
-
}
|
|
86966
|
-
const markerWidthRaw = measure.marker.markerWidth ?? wordLayout.marker.markerBoxWidthPx ?? 0;
|
|
86967
|
-
const markerWidth = Number.isFinite(markerWidthRaw) && markerWidthRaw >= 0 ? markerWidthRaw : 0;
|
|
86968
|
-
const gutterWidthRaw = measure.marker.gutterWidth ?? 0;
|
|
86969
|
-
const gutterWidth = Number.isFinite(gutterWidthRaw) && gutterWidthRaw >= 0 ? gutterWidthRaw : 0;
|
|
86970
|
-
return markerWidth + gutterWidth;
|
|
86971
|
-
}
|
|
86972
86995
|
function layoutParagraphBlock(ctx2, anchors) {
|
|
86973
86996
|
const { block, measure, columnWidth, ensurePage, advanceColumn, columnX, floatManager } = ctx2;
|
|
86974
86997
|
const remeasureParagraph2 = ctx2.remeasureParagraph;
|
|
@@ -87090,10 +87113,25 @@ ${l}
|
|
|
87090
87113
|
}
|
|
87091
87114
|
let lines = normalizeLines(measure);
|
|
87092
87115
|
const measurementWidth = lines[0]?.maxWidth;
|
|
87116
|
+
const paraIndent = block.attrs?.indent;
|
|
87117
|
+
const indentLeft = typeof paraIndent?.left === "number" && Number.isFinite(paraIndent.left) ? paraIndent.left : 0;
|
|
87118
|
+
const indentRight = typeof paraIndent?.right === "number" && Number.isFinite(paraIndent.right) ? paraIndent.right : 0;
|
|
87119
|
+
const negativeLeftIndent = indentLeft < 0 ? indentLeft : 0;
|
|
87120
|
+
const negativeRightIndent = indentRight < 0 ? indentRight : 0;
|
|
87121
|
+
const remeasureWidth = Math.max(1, columnWidth - indentLeft - indentRight);
|
|
87093
87122
|
let didRemeasureForColumnWidth = false;
|
|
87094
|
-
if (typeof remeasureParagraph2 === "function" && typeof measurementWidth === "number" && measurementWidth >
|
|
87095
|
-
|
|
87096
|
-
const
|
|
87123
|
+
if (typeof remeasureParagraph2 === "function" && typeof measurementWidth === "number" && measurementWidth > remeasureWidth) {
|
|
87124
|
+
let firstLineIndent = 0;
|
|
87125
|
+
const wordLayout = block.attrs?.wordLayout;
|
|
87126
|
+
if (wordLayout?.marker && measure.marker) {
|
|
87127
|
+
const markerJustification = wordLayout.marker.justification ?? "left";
|
|
87128
|
+
if (markerJustification === "left") {
|
|
87129
|
+
const markerWidth = measure.marker.markerWidth ?? 0;
|
|
87130
|
+
const gutterWidth = measure.marker.gutterWidth ?? wordLayout.marker.gutterWidthPx ?? 0;
|
|
87131
|
+
firstLineIndent = markerWidth + gutterWidth;
|
|
87132
|
+
}
|
|
87133
|
+
}
|
|
87134
|
+
const newMeasure = remeasureParagraph2(block, remeasureWidth, firstLineIndent);
|
|
87097
87135
|
lines = normalizeLines(newMeasure);
|
|
87098
87136
|
didRemeasureForColumnWidth = true;
|
|
87099
87137
|
}
|
|
@@ -87172,9 +87210,19 @@ ${l}
|
|
|
87172
87210
|
}
|
|
87173
87211
|
tempY += lineHeight2;
|
|
87174
87212
|
}
|
|
87175
|
-
|
|
87176
|
-
|
|
87177
|
-
|
|
87213
|
+
const narrowestRemeasureWidth = Math.max(1, narrowestWidth - indentLeft - indentRight);
|
|
87214
|
+
if (narrowestRemeasureWidth < remeasureWidth) {
|
|
87215
|
+
let firstLineIndent = 0;
|
|
87216
|
+
const wordLayout = block.attrs?.wordLayout;
|
|
87217
|
+
if (wordLayout?.marker && measure.marker) {
|
|
87218
|
+
const markerJustification = wordLayout.marker.justification ?? "left";
|
|
87219
|
+
if (markerJustification === "left") {
|
|
87220
|
+
const markerWidth = measure.marker.markerWidth ?? 0;
|
|
87221
|
+
const gutterWidth = measure.marker.gutterWidth ?? wordLayout.marker.gutterWidthPx ?? 0;
|
|
87222
|
+
firstLineIndent = markerWidth + gutterWidth;
|
|
87223
|
+
}
|
|
87224
|
+
}
|
|
87225
|
+
const newMeasure = remeasureParagraph2(block, narrowestRemeasureWidth, firstLineIndent);
|
|
87178
87226
|
lines = normalizeLines(newMeasure);
|
|
87179
87227
|
didRemeasureForFloats = true;
|
|
87180
87228
|
}
|
|
@@ -87228,14 +87276,16 @@ ${l}
|
|
|
87228
87276
|
}
|
|
87229
87277
|
const slice2 = sliceLines(lines, fromLine, state2.contentBottom - state2.cursorY);
|
|
87230
87278
|
const fragmentHeight = slice2.height;
|
|
87279
|
+
const adjustedX = columnX(state2.columnIndex) + offsetX + negativeLeftIndent;
|
|
87280
|
+
const adjustedWidth = effectiveColumnWidth - negativeLeftIndent - negativeRightIndent;
|
|
87231
87281
|
const fragment = {
|
|
87232
87282
|
kind: "para",
|
|
87233
87283
|
blockId: block.id,
|
|
87234
87284
|
fromLine,
|
|
87235
87285
|
toLine: slice2.toLine,
|
|
87236
|
-
x:
|
|
87286
|
+
x: adjustedX,
|
|
87237
87287
|
y: state2.cursorY,
|
|
87238
|
-
width:
|
|
87288
|
+
width: adjustedWidth,
|
|
87239
87289
|
...computeFragmentPmRange(block, lines, fromLine, slice2.toLine)
|
|
87240
87290
|
};
|
|
87241
87291
|
if (didRemeasureForColumnWidth) {
|
|
@@ -89189,10 +89239,6 @@ ${l}
|
|
|
89189
89239
|
}
|
|
89190
89240
|
return attrs.trackedChangesEnabled !== false;
|
|
89191
89241
|
};
|
|
89192
|
-
const MAX_CACHE_SIZE$1 = 1e4;
|
|
89193
|
-
const BYTES_PER_ENTRY_ESTIMATE = 5e3;
|
|
89194
|
-
const NORMALIZED_WHITESPACE = /\s+/g;
|
|
89195
|
-
const normalizeText = (text2) => text2.replace(NORMALIZED_WHITESPACE, " ");
|
|
89196
89242
|
const hashParagraphBorder = (border) => {
|
|
89197
89243
|
const parts = [];
|
|
89198
89244
|
if (border.style !== void 0) parts.push(`s:${border.style}`);
|
|
@@ -89209,6 +89255,10 @@ ${l}
|
|
|
89209
89255
|
if (borders.left) parts.push(`l:[${hashParagraphBorder(borders.left)}]`);
|
|
89210
89256
|
return parts.join(";");
|
|
89211
89257
|
};
|
|
89258
|
+
const MAX_CACHE_SIZE$1 = 1e4;
|
|
89259
|
+
const BYTES_PER_ENTRY_ESTIMATE = 5e3;
|
|
89260
|
+
const NORMALIZED_WHITESPACE = /\s+/g;
|
|
89261
|
+
const normalizeText = (text2) => text2.replace(NORMALIZED_WHITESPACE, " ");
|
|
89212
89262
|
const hashParagraphFrame = (frame) => {
|
|
89213
89263
|
const parts = [];
|
|
89214
89264
|
if (frame.wrap !== void 0) parts.push(`w:${frame.wrap}`);
|
|
@@ -89245,12 +89295,14 @@ ${l}
|
|
|
89245
89295
|
const color2 = "color" in run2 ? run2.color : void 0;
|
|
89246
89296
|
const fontSize2 = "fontSize" in run2 ? run2.fontSize : void 0;
|
|
89247
89297
|
const fontFamily2 = "fontFamily" in run2 ? run2.fontFamily : void 0;
|
|
89298
|
+
const highlight = "highlight" in run2 ? run2.highlight : void 0;
|
|
89248
89299
|
const marks = [
|
|
89249
89300
|
bold ? "b" : "",
|
|
89250
89301
|
italic ? "i" : "",
|
|
89251
89302
|
color2 ?? "",
|
|
89252
89303
|
fontSize2 !== void 0 ? `fs:${fontSize2}` : "",
|
|
89253
|
-
fontFamily2 ? `ff:${fontFamily2}` : ""
|
|
89304
|
+
fontFamily2 ? `ff:${fontFamily2}` : "",
|
|
89305
|
+
highlight ? `hl:${highlight}` : ""
|
|
89254
89306
|
].join("");
|
|
89255
89307
|
let trackedKey = "";
|
|
89256
89308
|
if (hasTrackedChange(run2)) {
|
|
@@ -89261,6 +89313,38 @@ ${l}
|
|
|
89261
89313
|
}
|
|
89262
89314
|
cellHashes.push(`${text2}:${marks}${trackedKey}`);
|
|
89263
89315
|
}
|
|
89316
|
+
if (paragraphBlock.attrs) {
|
|
89317
|
+
const attrs = paragraphBlock.attrs;
|
|
89318
|
+
const parts = [];
|
|
89319
|
+
if (attrs.alignment) parts.push(`al:${attrs.alignment}`);
|
|
89320
|
+
if (attrs.spacing) {
|
|
89321
|
+
const s2 = attrs.spacing;
|
|
89322
|
+
if (s2.before !== void 0) parts.push(`sb:${s2.before}`);
|
|
89323
|
+
if (s2.after !== void 0) parts.push(`sa:${s2.after}`);
|
|
89324
|
+
if (s2.line !== void 0) parts.push(`sl:${s2.line}`);
|
|
89325
|
+
if (s2.lineRule) parts.push(`sr:${s2.lineRule}`);
|
|
89326
|
+
}
|
|
89327
|
+
if (attrs.indent) {
|
|
89328
|
+
const ind = attrs.indent;
|
|
89329
|
+
if (ind.left !== void 0) parts.push(`il:${ind.left}`);
|
|
89330
|
+
if (ind.right !== void 0) parts.push(`ir:${ind.right}`);
|
|
89331
|
+
if (ind.firstLine !== void 0) parts.push(`if:${ind.firstLine}`);
|
|
89332
|
+
if (ind.hanging !== void 0) parts.push(`ih:${ind.hanging}`);
|
|
89333
|
+
}
|
|
89334
|
+
if (attrs.borders) {
|
|
89335
|
+
parts.push(`br:${hashParagraphBorders(attrs.borders)}`);
|
|
89336
|
+
}
|
|
89337
|
+
if (attrs.shading) {
|
|
89338
|
+
const sh = attrs.shading;
|
|
89339
|
+
if (sh.fill) parts.push(`shf:${sh.fill}`);
|
|
89340
|
+
if (sh.color) parts.push(`shc:${sh.color}`);
|
|
89341
|
+
}
|
|
89342
|
+
if (attrs.direction) parts.push(`dir:${attrs.direction}`);
|
|
89343
|
+
if (attrs.rtl) parts.push("rtl");
|
|
89344
|
+
if (parts.length > 0) {
|
|
89345
|
+
cellHashes.push(`pa:${parts.join(":")}`);
|
|
89346
|
+
}
|
|
89347
|
+
}
|
|
89264
89348
|
}
|
|
89265
89349
|
}
|
|
89266
89350
|
}
|
|
@@ -89284,12 +89368,14 @@ ${l}
|
|
|
89284
89368
|
const color2 = "color" in run2 ? run2.color : void 0;
|
|
89285
89369
|
const fontSize2 = "fontSize" in run2 ? run2.fontSize : void 0;
|
|
89286
89370
|
const fontFamily2 = "fontFamily" in run2 ? run2.fontFamily : void 0;
|
|
89371
|
+
const highlight = "highlight" in run2 ? run2.highlight : void 0;
|
|
89287
89372
|
const marks = [
|
|
89288
89373
|
bold ? "b" : "",
|
|
89289
89374
|
italic ? "i" : "",
|
|
89290
89375
|
color2 ?? "",
|
|
89291
89376
|
fontSize2 !== void 0 ? `fs:${fontSize2}` : "",
|
|
89292
|
-
fontFamily2 ? `ff:${fontFamily2}` : ""
|
|
89377
|
+
fontFamily2 ? `ff:${fontFamily2}` : "",
|
|
89378
|
+
highlight ? `hl:${highlight}` : ""
|
|
89293
89379
|
].join("");
|
|
89294
89380
|
let trackedKey = "";
|
|
89295
89381
|
if (hasTrackedChange(run2)) {
|
|
@@ -90416,7 +90502,7 @@ ${l}
|
|
|
90416
90502
|
for (let i2 = 0; i2 < a2.runs.length; i2 += 1) {
|
|
90417
90503
|
const runA = a2.runs[i2];
|
|
90418
90504
|
const runB = b2.runs[i2];
|
|
90419
|
-
if (("src" in runA || runA.kind === "lineBreak" || runA.kind === "break" || runA.kind === "fieldAnnotation" ? "" : runA.text) !== ("src" in runB || runB.kind === "lineBreak" || runB.kind === "break" || runB.kind === "fieldAnnotation" ? "" : runB.text) || ("bold" in runA ? runA.bold : false) !== ("bold" in runB ? runB.bold : false) || ("italic" in runA ? runA.italic : false) !== ("italic" in runB ? runB.italic : false) || ("color" in runA ? runA.color : void 0) !== ("color" in runB ? runB.color : void 0) || ("fontSize" in runA ? runA.fontSize : void 0) !== ("fontSize" in runB ? runB.fontSize : void 0) || ("fontFamily" in runA ? runA.fontFamily : void 0) !== ("fontFamily" in runB ? runB.fontFamily : void 0) || getTrackedChangeKey(runA) !== getTrackedChangeKey(runB)) {
|
|
90505
|
+
if (("src" in runA || runA.kind === "lineBreak" || runA.kind === "break" || runA.kind === "fieldAnnotation" ? "" : runA.text) !== ("src" in runB || runB.kind === "lineBreak" || runB.kind === "break" || runB.kind === "fieldAnnotation" ? "" : runB.text) || ("bold" in runA ? runA.bold : false) !== ("bold" in runB ? runB.bold : false) || ("italic" in runA ? runA.italic : false) !== ("italic" in runB ? runB.italic : false) || ("color" in runA ? runA.color : void 0) !== ("color" in runB ? runB.color : void 0) || ("fontSize" in runA ? runA.fontSize : void 0) !== ("fontSize" in runB ? runB.fontSize : void 0) || ("fontFamily" in runA ? runA.fontFamily : void 0) !== ("fontFamily" in runB ? runB.fontFamily : void 0) || ("highlight" in runA ? runA.highlight : void 0) !== ("highlight" in runB ? runB.highlight : void 0) || getTrackedChangeKey(runA) !== getTrackedChangeKey(runB)) {
|
|
90420
90506
|
return false;
|
|
90421
90507
|
}
|
|
90422
90508
|
}
|
|
@@ -90943,9 +91029,15 @@ ${l}
|
|
|
90943
91029
|
}
|
|
90944
91030
|
const DEFAULT_PAGE_SIZE$1 = { w: 612, h: 792 };
|
|
90945
91031
|
const DEFAULT_MARGINS$1 = { top: 72, right: 72, bottom: 72, left: 72 };
|
|
91032
|
+
const normalizeMargin = (value, fallback) => Number.isFinite(value) ? value : fallback;
|
|
90946
91033
|
function resolveMeasurementConstraints(options) {
|
|
90947
91034
|
const pageSize = options.pageSize ?? DEFAULT_PAGE_SIZE$1;
|
|
90948
|
-
const margins =
|
|
91035
|
+
const margins = {
|
|
91036
|
+
top: normalizeMargin(options.margins?.top, DEFAULT_MARGINS$1.top),
|
|
91037
|
+
right: normalizeMargin(options.margins?.right, DEFAULT_MARGINS$1.right),
|
|
91038
|
+
bottom: normalizeMargin(options.margins?.bottom, DEFAULT_MARGINS$1.bottom),
|
|
91039
|
+
left: normalizeMargin(options.margins?.left, DEFAULT_MARGINS$1.left)
|
|
91040
|
+
};
|
|
90949
91041
|
const contentWidth = pageSize.w - (margins.left + margins.right);
|
|
90950
91042
|
const contentHeight = pageSize.h - (margins.top + margins.bottom);
|
|
90951
91043
|
const columns = options.columns;
|
|
@@ -92483,8 +92575,8 @@ ${l}
|
|
|
92483
92575
|
const lines = [];
|
|
92484
92576
|
const indent2 = block.attrs?.indent;
|
|
92485
92577
|
const spacing = block.attrs?.spacing;
|
|
92486
|
-
const indentLeft =
|
|
92487
|
-
const indentRight =
|
|
92578
|
+
const indentLeft = sanitizeIndent(indent2?.left);
|
|
92579
|
+
const indentRight = sanitizeIndent(indent2?.right);
|
|
92488
92580
|
const firstLine = indent2?.firstLine ?? 0;
|
|
92489
92581
|
const hanging = indent2?.hanging ?? 0;
|
|
92490
92582
|
const isWordLayoutList = Boolean(wordLayout?.marker);
|
|
@@ -92493,10 +92585,10 @@ ${l}
|
|
|
92493
92585
|
const clampedFirstLineOffset = Math.max(0, rawFirstLineOffset);
|
|
92494
92586
|
const firstLineOffset = isWordLayoutList ? 0 : clampedFirstLineOffset;
|
|
92495
92587
|
const contentWidth = Math.max(1, maxWidth - indentLeft - indentRight);
|
|
92588
|
+
const bodyContentWidth = contentWidth;
|
|
92496
92589
|
let initialAvailableWidth;
|
|
92497
92590
|
const textStartPx = wordLayout?.textStartPx;
|
|
92498
|
-
|
|
92499
|
-
if (typeof textStartPx === "number" && textStartPx > indentLeft && !treatAsHanging) {
|
|
92591
|
+
if (typeof textStartPx === "number" && textStartPx > indentLeft) {
|
|
92500
92592
|
initialAvailableWidth = Math.max(1, maxWidth - textStartPx - indentRight);
|
|
92501
92593
|
} else {
|
|
92502
92594
|
initialAvailableWidth = Math.max(1, contentWidth - firstLineOffset);
|
|
@@ -92543,21 +92635,6 @@ ${l}
|
|
|
92543
92635
|
totalHeight: metrics.lineHeight
|
|
92544
92636
|
};
|
|
92545
92637
|
}
|
|
92546
|
-
const isListLike = Boolean(block.attrs?.numId || wordLayout?.marker);
|
|
92547
|
-
if (isListLike) {
|
|
92548
|
-
console.log(
|
|
92549
|
-
"[measureParagraph][list]",
|
|
92550
|
-
JSON.stringify({
|
|
92551
|
-
blockId: block.id,
|
|
92552
|
-
maxWidth,
|
|
92553
|
-
indentLeft,
|
|
92554
|
-
indentRight,
|
|
92555
|
-
textStartPx: textStartPx ?? null,
|
|
92556
|
-
firstLineOffset: firstLineOffset ?? null,
|
|
92557
|
-
initialAvailableWidth
|
|
92558
|
-
})
|
|
92559
|
-
);
|
|
92560
|
-
}
|
|
92561
92638
|
let currentLine = null;
|
|
92562
92639
|
const getEffectiveWidth = (baseWidth) => {
|
|
92563
92640
|
if (dropCapMeasure && lines.length < dropCapMeasure.lines && dropCapMeasure.mode === "drop") {
|
|
@@ -92703,7 +92780,7 @@ ${l}
|
|
|
92703
92780
|
lines.push(emptyLine);
|
|
92704
92781
|
}
|
|
92705
92782
|
const hadPreviousLine = lines.length > 0;
|
|
92706
|
-
const nextLineMaxWidth = hadPreviousLine ? getEffectiveWidth(
|
|
92783
|
+
const nextLineMaxWidth = hadPreviousLine ? getEffectiveWidth(bodyContentWidth) : getEffectiveWidth(initialAvailableWidth);
|
|
92707
92784
|
currentLine = {
|
|
92708
92785
|
fromRun: runIndex,
|
|
92709
92786
|
fromChar: 0,
|
|
@@ -92814,7 +92891,7 @@ ${l}
|
|
|
92814
92891
|
toChar: 1,
|
|
92815
92892
|
width: imageWidth,
|
|
92816
92893
|
maxFontSize: imageHeight,
|
|
92817
|
-
maxWidth: getEffectiveWidth(
|
|
92894
|
+
maxWidth: getEffectiveWidth(bodyContentWidth),
|
|
92818
92895
|
spaceCount: 0,
|
|
92819
92896
|
segments: [
|
|
92820
92897
|
{
|
|
@@ -92903,7 +92980,7 @@ ${l}
|
|
|
92903
92980
|
toChar: 1,
|
|
92904
92981
|
width: annotationWidth,
|
|
92905
92982
|
maxFontSize: annotationHeight,
|
|
92906
|
-
maxWidth: getEffectiveWidth(
|
|
92983
|
+
maxWidth: getEffectiveWidth(bodyContentWidth),
|
|
92907
92984
|
spaceCount: 0,
|
|
92908
92985
|
segments: [
|
|
92909
92986
|
{
|
|
@@ -92985,7 +93062,7 @@ ${l}
|
|
|
92985
93062
|
width: spacesWidth,
|
|
92986
93063
|
maxFontSize: run2.fontSize,
|
|
92987
93064
|
maxFontInfo: getFontInfoFromRun(run2),
|
|
92988
|
-
maxWidth: getEffectiveWidth(
|
|
93065
|
+
maxWidth: getEffectiveWidth(bodyContentWidth),
|
|
92989
93066
|
segments: [{ runIndex, fromChar: spacesStartChar, toChar: spacesEndChar, width: spacesWidth }],
|
|
92990
93067
|
spaceCount: spacesLength
|
|
92991
93068
|
};
|
|
@@ -93048,7 +93125,7 @@ ${l}
|
|
|
93048
93125
|
width: singleSpaceWidth,
|
|
93049
93126
|
maxFontSize: run2.fontSize,
|
|
93050
93127
|
maxFontInfo: getFontInfoFromRun(run2),
|
|
93051
|
-
maxWidth: getEffectiveWidth(
|
|
93128
|
+
maxWidth: getEffectiveWidth(bodyContentWidth),
|
|
93052
93129
|
segments: [{ runIndex, fromChar: spaceStartChar, toChar: spaceEndChar, width: singleSpaceWidth }],
|
|
93053
93130
|
spaceCount: 1
|
|
93054
93131
|
};
|
|
@@ -93241,7 +93318,7 @@ ${l}
|
|
|
93241
93318
|
width: wordOnlyWidth,
|
|
93242
93319
|
maxFontSize: run2.fontSize,
|
|
93243
93320
|
maxFontInfo: getFontInfoFromRun(run2),
|
|
93244
|
-
maxWidth: getEffectiveWidth(
|
|
93321
|
+
maxWidth: getEffectiveWidth(bodyContentWidth),
|
|
93245
93322
|
segments: [{ runIndex, fromChar: wordStartChar, toChar: wordEndNoSpace, width: wordOnlyWidth }],
|
|
93246
93323
|
spaceCount: 0
|
|
93247
93324
|
};
|
|
@@ -93806,6 +93883,7 @@ ${l}
|
|
|
93806
93883
|
return Math.max(baseLineHeight, raw);
|
|
93807
93884
|
};
|
|
93808
93885
|
const sanitizePositive = (value) => typeof value === "number" && Number.isFinite(value) ? Math.max(0, value) : 0;
|
|
93886
|
+
const sanitizeIndent = (value) => typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
93809
93887
|
const sanitizeDecimalSeparator = (value) => {
|
|
93810
93888
|
if (value === ",") return ",";
|
|
93811
93889
|
return DEFAULT_DECIMAL_SEPARATOR;
|
|
@@ -98354,6 +98432,10 @@ ${l}
|
|
|
98354
98432
|
const pageSize = firstSection?.pageSize ?? defaults2.pageSize;
|
|
98355
98433
|
const margins = {
|
|
98356
98434
|
...defaults2.margins,
|
|
98435
|
+
...firstSection?.margins?.top != null ? { top: firstSection.margins.top } : {},
|
|
98436
|
+
...firstSection?.margins?.right != null ? { right: firstSection.margins.right } : {},
|
|
98437
|
+
...firstSection?.margins?.bottom != null ? { bottom: firstSection.margins.bottom } : {},
|
|
98438
|
+
...firstSection?.margins?.left != null ? { left: firstSection.margins.left } : {},
|
|
98357
98439
|
...firstSection?.margins?.header != null ? { header: firstSection.margins.header } : {},
|
|
98358
98440
|
...firstSection?.margins?.footer != null ? { footer: firstSection.margins.footer } : {}
|
|
98359
98441
|
};
|
|
@@ -150496,19 +150578,10 @@ ${style2}
|
|
|
150496
150578
|
measurementTimeoutId.value = null;
|
|
150497
150579
|
}
|
|
150498
150580
|
const totalComments = getFloatingComments.value.length;
|
|
150499
|
-
const measuredComments = renderedSizes.value.length;
|
|
150500
150581
|
if (totalComments === 0) {
|
|
150501
150582
|
return;
|
|
150502
150583
|
}
|
|
150503
|
-
|
|
150504
|
-
nextTick(processLocations);
|
|
150505
|
-
} else if (measuredComments > 0 && !firstGroupRendered.value) {
|
|
150506
|
-
measurementTimeoutId.value = setTimeout(() => {
|
|
150507
|
-
if (!firstGroupRendered.value && renderedSizes.value.length > 0) {
|
|
150508
|
-
processLocations();
|
|
150509
|
-
}
|
|
150510
|
-
}, 100);
|
|
150511
|
-
}
|
|
150584
|
+
nextTick(processLocations);
|
|
150512
150585
|
});
|
|
150513
150586
|
watch(activeComment, (newVal, oldVal) => {
|
|
150514
150587
|
nextTick(() => {
|
|
@@ -150586,7 +150659,7 @@ ${style2}
|
|
|
150586
150659
|
};
|
|
150587
150660
|
}
|
|
150588
150661
|
};
|
|
150589
|
-
const FloatingComments = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-
|
|
150662
|
+
const FloatingComments = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-6905dd07"]]);
|
|
150590
150663
|
const _sfc_main$9 = {
|
|
150591
150664
|
__name: "TextField",
|
|
150592
150665
|
props: {
|
|
@@ -152103,7 +152176,7 @@ ${style2}
|
|
|
152103
152176
|
this.config.colors = shuffleArray(this.config.colors);
|
|
152104
152177
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
152105
152178
|
this.colorIndex = 0;
|
|
152106
|
-
this.version = "1.0.0-beta.
|
|
152179
|
+
this.version = "1.0.0-beta.99";
|
|
152107
152180
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
152108
152181
|
this.superdocId = config2.superdocId || v4();
|
|
152109
152182
|
this.colors = this.config.colors;
|
|
@@ -154575,7 +154648,7 @@ ${style2}
|
|
|
154575
154648
|
value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
|
|
154576
154649
|
);
|
|
154577
154650
|
}
|
|
154578
|
-
const
|
|
154651
|
+
const indexBB0msI45 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
154579
154652
|
__proto__: null,
|
|
154580
154653
|
unified
|
|
154581
154654
|
}, Symbol.toStringTag, { value: "Module" }));
|