@superdoc-dev/cli 0.8.0-next.76 → 0.8.0-next.78
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/index.js +574 -77
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -65823,7 +65823,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
|
|
|
65823
65823
|
emptyOptions2 = {};
|
|
65824
65824
|
});
|
|
65825
65825
|
|
|
65826
|
-
// ../../packages/superdoc/dist/chunks/SuperConverter-
|
|
65826
|
+
// ../../packages/superdoc/dist/chunks/SuperConverter-BLL9JGke.es.js
|
|
65827
65827
|
function getExtensionConfigField(extension$1, field, context = { name: "" }) {
|
|
65828
65828
|
const fieldValue = extension$1.config[field];
|
|
65829
65829
|
if (typeof fieldValue === "function")
|
|
@@ -109625,13 +109625,14 @@ var isRegExp = (value) => {
|
|
|
109625
109625
|
default:
|
|
109626
109626
|
return null;
|
|
109627
109627
|
}
|
|
109628
|
-
}, SKIP_FIELD_PROCESSING_NODE_NAMES$1, shouldSkipFieldProcessing$1 = (node3) => SKIP_FIELD_PROCESSING_NODE_NAMES$1.has(node3?.name), preProcessNodesForFldChar = (nodes = [], docx) => {
|
|
109628
|
+
}, TRACK_CHANGE_ELEMENT_NAMES, TRANSLATED_TRACK_CHANGE_ELEMENT_NAMES, isTrackChangeElement = (node3) => TRACK_CHANGE_ELEMENT_NAMES.has(node3?.name), isTranslatedTrackChangeElement = (node3) => TRANSLATED_TRACK_CHANGE_ELEMENT_NAMES.has(node3?.name), SKIP_FIELD_PROCESSING_NODE_NAMES$1, shouldSkipFieldProcessing$1 = (node3) => SKIP_FIELD_PROCESSING_NODE_NAMES$1.has(node3?.name), preProcessNodesForFldChar = (nodes = [], docx) => {
|
|
109629
109629
|
const processedNodes = [];
|
|
109630
109630
|
let collectedNodesStack = [];
|
|
109631
109631
|
let rawCollectedNodesStack = [];
|
|
109632
109632
|
let fieldRunRPrStack = [];
|
|
109633
109633
|
let currentFieldStack = [];
|
|
109634
109634
|
let unpairedEnd = null;
|
|
109635
|
+
let unpairedEndPreserveRaw = null;
|
|
109635
109636
|
let collecting = false;
|
|
109636
109637
|
const rawNodeSourceTokens = /* @__PURE__ */ new WeakMap;
|
|
109637
109638
|
const finalizeField = () => {
|
|
@@ -109640,8 +109641,11 @@ var isRegExp = (value) => {
|
|
|
109640
109641
|
const rawCollectedNodes = rawCollectedNodesStack.pop().filter((n) => n !== null);
|
|
109641
109642
|
const fieldRunRPr = fieldRunRPrStack.pop() ?? null;
|
|
109642
109643
|
const currentField = currentFieldStack.pop();
|
|
109643
|
-
|
|
109644
|
-
|
|
109644
|
+
let outputNodes = rawCollectedNodes;
|
|
109645
|
+
if (!currentField.preserveRaw) {
|
|
109646
|
+
const combinedResult = _processCombinedNodesForFldChar(collectedNodes, currentField.instrText.trim(), docx, currentField.instructionTokens, fieldRunRPr);
|
|
109647
|
+
outputNodes = combinedResult.handled ? combinedResult.nodes : rawCollectedNodes;
|
|
109648
|
+
}
|
|
109645
109649
|
if (collectedNodesStack.length === 0)
|
|
109646
109650
|
processedNodes.push(...outputNodes);
|
|
109647
109651
|
else {
|
|
@@ -109749,7 +109753,10 @@ var isRegExp = (value) => {
|
|
|
109749
109753
|
node3.elements = childResult.processedNodes;
|
|
109750
109754
|
if (childResult.unpairedBegin)
|
|
109751
109755
|
childResult.unpairedBegin.forEach((pendingField) => {
|
|
109752
|
-
|
|
109756
|
+
const fieldInfo = { ...pendingField.fieldInfo };
|
|
109757
|
+
if (fieldInfo.preserveRaw || isTrackChangeElement(node3))
|
|
109758
|
+
fieldInfo.preserveRaw = true;
|
|
109759
|
+
currentFieldStack.push(fieldInfo);
|
|
109753
109760
|
collectedNodesStack.push([node3]);
|
|
109754
109761
|
const rawStack = [rawNode];
|
|
109755
109762
|
rawCollectedNodesStack.push(rawStack);
|
|
@@ -109757,6 +109764,16 @@ var isRegExp = (value) => {
|
|
|
109757
109764
|
capturedRawNodes.add(rawNode);
|
|
109758
109765
|
});
|
|
109759
109766
|
else if (childResult.unpairedEnd) {
|
|
109767
|
+
const shouldPreserveRaw = childResult.unpairedEndPreserveRaw || isTrackChangeElement(node3);
|
|
109768
|
+
if (collectedNodesStack.length === 0) {
|
|
109769
|
+
processedNodes.push(shouldPreserveRaw ? rawNode : node3);
|
|
109770
|
+
unpairedEnd = true;
|
|
109771
|
+
if (shouldPreserveRaw)
|
|
109772
|
+
unpairedEndPreserveRaw = true;
|
|
109773
|
+
return;
|
|
109774
|
+
}
|
|
109775
|
+
if (shouldPreserveRaw)
|
|
109776
|
+
currentFieldStack[currentFieldStack.length - 1].preserveRaw = true;
|
|
109760
109777
|
collectedNodesStack[collectedNodesStack.length - 1].push(node3);
|
|
109761
109778
|
captureRawNodeForCurrentField(rawNode, capturedRawNodes, rawSourceToken);
|
|
109762
109779
|
finalizeField();
|
|
@@ -109795,7 +109812,8 @@ var isRegExp = (value) => {
|
|
|
109795
109812
|
return {
|
|
109796
109813
|
processedNodes,
|
|
109797
109814
|
unpairedBegin,
|
|
109798
|
-
unpairedEnd
|
|
109815
|
+
unpairedEnd,
|
|
109816
|
+
unpairedEndPreserveRaw
|
|
109799
109817
|
};
|
|
109800
109818
|
}, _processCombinedNodesForFldChar = (nodesToCombine = [], instrText, docx, instructionTokens, fieldRunRPr) => {
|
|
109801
109819
|
const instructionType = instrText.trim().split(" ")[0];
|
|
@@ -115977,10 +115995,10 @@ var isRegExp = (value) => {
|
|
|
115977
115995
|
}
|
|
115978
115996
|
});
|
|
115979
115997
|
return subs;
|
|
115980
|
-
}, config$5, translator$81,
|
|
115998
|
+
}, config$5, translator$81, unwrapTrackChangeNode = (node3) => {
|
|
115981
115999
|
if (!node3)
|
|
115982
116000
|
return null;
|
|
115983
|
-
if (
|
|
116001
|
+
if (isTranslatedTrackChangeElement(node3))
|
|
115984
116002
|
return node3;
|
|
115985
116003
|
if (node3.name === "w:sdt") {
|
|
115986
116004
|
const content$2 = node3.elements?.find((element) => element.name === "w:sdtContent");
|
|
@@ -117415,11 +117433,11 @@ var isRegExp = (value) => {
|
|
|
117415
117433
|
};
|
|
117416
117434
|
return nodeListHandlerFn;
|
|
117417
117435
|
}, DEFAULT_SECTION_PROPS, importHeadersFooters = (docx, converter, mainEditor, numbering, translatedNumbering, translatedLinkedStyles) => {
|
|
117418
|
-
const
|
|
117436
|
+
const elements = docx["word/_rels/document.xml.rels"]?.elements?.find((el) => el.name === "Relationships")?.elements ?? [];
|
|
117419
117437
|
const headerType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header";
|
|
117420
117438
|
const footerType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";
|
|
117421
|
-
const headers = elements.filter((el) => el.attributes["Type"] === headerType);
|
|
117422
|
-
const footers = elements.filter((el) => el.attributes["Type"] === footerType);
|
|
117439
|
+
const headers = elements.filter((el) => el.attributes?.["Type"] === headerType);
|
|
117440
|
+
const footers = elements.filter((el) => el.attributes?.["Type"] === footerType);
|
|
117423
117441
|
const allSectPrElements = (findSectPr(docx["word/document.xml"]) || []).flatMap((el) => el.elements);
|
|
117424
117442
|
if (!mainEditor)
|
|
117425
117443
|
return;
|
|
@@ -118393,7 +118411,7 @@ var isRegExp = (value) => {
|
|
|
118393
118411
|
state.kern = kernNode.attributes["w:val"];
|
|
118394
118412
|
}
|
|
118395
118413
|
}, SuperConverter;
|
|
118396
|
-
var
|
|
118414
|
+
var init_SuperConverter_BLL9JGke_es = __esm(() => {
|
|
118397
118415
|
init_rolldown_runtime_Bg48TavK_es();
|
|
118398
118416
|
init_jszip_C49i9kUs_es();
|
|
118399
118417
|
init_xml_js_CqGKpaft_es();
|
|
@@ -146303,6 +146321,13 @@ var init_SuperConverter_ing_1fvK_es = __esm(() => {
|
|
|
146303
146321
|
})(UTIF, pako$1);
|
|
146304
146322
|
})();
|
|
146305
146323
|
}))(), 1);
|
|
146324
|
+
TRACK_CHANGE_ELEMENT_NAMES = new Set([
|
|
146325
|
+
"w:del",
|
|
146326
|
+
"w:ins",
|
|
146327
|
+
"w:moveFrom",
|
|
146328
|
+
"w:moveTo"
|
|
146329
|
+
]);
|
|
146330
|
+
TRANSLATED_TRACK_CHANGE_ELEMENT_NAMES = new Set(["w:del", "w:ins"]);
|
|
146306
146331
|
SKIP_FIELD_PROCESSING_NODE_NAMES$1 = new Set(["w:drawing", "w:pict"]);
|
|
146307
146332
|
FIELD_CONTROL_ELEMENT_NAMES = new Set(["w:fldChar"]);
|
|
146308
146333
|
INSTRUCTION_ELEMENT_NAMES = new Set(["w:instrText", "w:tab"]);
|
|
@@ -155994,7 +156019,7 @@ var init_SuperConverter_ing_1fvK_es = __esm(() => {
|
|
|
155994
156019
|
};
|
|
155995
156020
|
});
|
|
155996
156021
|
|
|
155997
|
-
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-
|
|
156022
|
+
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-D7n_Okb2.es.js
|
|
155998
156023
|
function parseSizeUnit(val = "0") {
|
|
155999
156024
|
const length3 = val.toString() || "0";
|
|
156000
156025
|
const value = Number.parseFloat(length3);
|
|
@@ -157704,10 +157729,12 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
|
|
|
157704
157729
|
return null;
|
|
157705
157730
|
superdoc.on("editorCreate", onChange3);
|
|
157706
157731
|
superdoc.on("document-mode-change", onChange3);
|
|
157732
|
+
superdoc.on("formatting-marks-change", onChange3);
|
|
157707
157733
|
superdoc.on("zoomChange", onChange3);
|
|
157708
157734
|
return () => {
|
|
157709
157735
|
superdoc.off?.("editorCreate", onChange3);
|
|
157710
157736
|
superdoc.off?.("document-mode-change", onChange3);
|
|
157737
|
+
superdoc.off?.("formatting-marks-change", onChange3);
|
|
157711
157738
|
superdoc.off?.("zoomChange", onChange3);
|
|
157712
157739
|
};
|
|
157713
157740
|
}, subscribeToEditorEvents = (editor, onChange3) => {
|
|
@@ -157839,6 +157866,11 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
|
|
|
157839
157866
|
active: Boolean(superdoc?.config?.rulers),
|
|
157840
157867
|
disabled: isCommandDisabled(context)
|
|
157841
157868
|
};
|
|
157869
|
+
}, createFormattingMarksStateDeriver = () => ({ superdoc }) => {
|
|
157870
|
+
return {
|
|
157871
|
+
active: Boolean(superdoc?.config?.layoutEngineOptions?.showFormattingMarks),
|
|
157872
|
+
disabled: typeof superdoc?.toggleFormattingMarks !== "function"
|
|
157873
|
+
};
|
|
157842
157874
|
}, createZoomStateDeriver = () => ({ context, superdoc }) => {
|
|
157843
157875
|
return {
|
|
157844
157876
|
active: false,
|
|
@@ -157854,6 +157886,11 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
|
|
|
157854
157886
|
}, createRulerExecute = () => ({ superdoc }) => {
|
|
157855
157887
|
superdoc.toggleRuler?.();
|
|
157856
157888
|
return true;
|
|
157889
|
+
}, createFormattingMarksExecute = () => ({ superdoc }) => {
|
|
157890
|
+
if (typeof superdoc?.toggleFormattingMarks !== "function")
|
|
157891
|
+
return false;
|
|
157892
|
+
superdoc.toggleFormattingMarks();
|
|
157893
|
+
return true;
|
|
157857
157894
|
}, createZoomExecute = () => ({ superdoc, payload }) => {
|
|
157858
157895
|
const normalizedPayload = Number.parseInt(String(payload), 10);
|
|
157859
157896
|
if (!Number.isFinite(normalizedPayload) || normalizedPayload <= 0)
|
|
@@ -158453,6 +158490,11 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
|
|
|
158453
158490
|
state: createRulerStateDeriver(),
|
|
158454
158491
|
execute: createRulerExecute()
|
|
158455
158492
|
},
|
|
158493
|
+
"formatting-marks": {
|
|
158494
|
+
id: "formatting-marks",
|
|
158495
|
+
state: createFormattingMarksStateDeriver(),
|
|
158496
|
+
execute: createFormattingMarksExecute()
|
|
158497
|
+
},
|
|
158456
158498
|
zoom: {
|
|
158457
158499
|
id: "zoom",
|
|
158458
158500
|
state: createZoomStateDeriver(),
|
|
@@ -158630,8 +158672,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
|
|
|
158630
158672
|
}
|
|
158631
158673
|
};
|
|
158632
158674
|
};
|
|
158633
|
-
var
|
|
158634
|
-
|
|
158675
|
+
var init_create_headless_toolbar_D7n_Okb2_es = __esm(() => {
|
|
158676
|
+
init_SuperConverter_BLL9JGke_es();
|
|
158635
158677
|
init_constants_DrU4EASo_es();
|
|
158636
158678
|
init_dist_B8HfvhaK_es();
|
|
158637
158679
|
CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
|
|
@@ -207317,7 +207359,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
207317
207359
|
init_remark_gfm_BhnWr3yf_es();
|
|
207318
207360
|
});
|
|
207319
207361
|
|
|
207320
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
207362
|
+
// ../../packages/superdoc/dist/chunks/src-C4h4xIas.es.js
|
|
207321
207363
|
function deleteProps(obj, propOrProps) {
|
|
207322
207364
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
207323
207365
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -211096,6 +211138,98 @@ function createDropcapPlugin(editor) {
|
|
|
211096
211138
|
} }
|
|
211097
211139
|
});
|
|
211098
211140
|
}
|
|
211141
|
+
function isListParagraph(node3) {
|
|
211142
|
+
return node3?.type?.name === "paragraph" && node3.attrs?.paragraphProperties?.numberingProperties && node3.attrs?.listRendering;
|
|
211143
|
+
}
|
|
211144
|
+
function isRtlParagraph$1(node3) {
|
|
211145
|
+
return node3?.attrs?.paragraphProperties?.rightToLeft === true || node3?.attrs?.direction === "rtl" || node3?.attrs?.rtl === true;
|
|
211146
|
+
}
|
|
211147
|
+
function getParagraphContext$1($pos) {
|
|
211148
|
+
for (let depth = $pos.depth;depth >= 0; depth--) {
|
|
211149
|
+
const node3 = $pos.node(depth);
|
|
211150
|
+
if (node3.type.name !== "paragraph")
|
|
211151
|
+
continue;
|
|
211152
|
+
return {
|
|
211153
|
+
node: node3,
|
|
211154
|
+
pos: depth === 0 ? 0 : $pos.before(depth),
|
|
211155
|
+
start: $pos.start(depth),
|
|
211156
|
+
end: $pos.end(depth)
|
|
211157
|
+
};
|
|
211158
|
+
}
|
|
211159
|
+
return null;
|
|
211160
|
+
}
|
|
211161
|
+
function getParagraphTextBounds2(paragraph2, paragraphStart) {
|
|
211162
|
+
let first$1 = null;
|
|
211163
|
+
let last2 = null;
|
|
211164
|
+
paragraph2.descendants((node3, pos) => {
|
|
211165
|
+
if (!node3.isText || !node3.text?.length)
|
|
211166
|
+
return true;
|
|
211167
|
+
const from$1 = paragraphStart + pos;
|
|
211168
|
+
const to = from$1 + node3.text.length;
|
|
211169
|
+
if (first$1 == null || from$1 < first$1)
|
|
211170
|
+
first$1 = from$1;
|
|
211171
|
+
if (last2 == null || to > last2)
|
|
211172
|
+
last2 = to;
|
|
211173
|
+
return true;
|
|
211174
|
+
});
|
|
211175
|
+
return first$1 == null || last2 == null ? null : {
|
|
211176
|
+
first: first$1,
|
|
211177
|
+
last: last2
|
|
211178
|
+
};
|
|
211179
|
+
}
|
|
211180
|
+
function findAdjacentTextPosition(doc$12, boundary, direction) {
|
|
211181
|
+
let target = null;
|
|
211182
|
+
if (direction < 0) {
|
|
211183
|
+
doc$12.nodesBetween(0, boundary, (node3, pos) => {
|
|
211184
|
+
if (node3.isText && node3.text?.length)
|
|
211185
|
+
target = pos + node3.text.length;
|
|
211186
|
+
return true;
|
|
211187
|
+
});
|
|
211188
|
+
return target;
|
|
211189
|
+
}
|
|
211190
|
+
doc$12.nodesBetween(boundary, doc$12.content.size, (node3, pos) => {
|
|
211191
|
+
if (target != null)
|
|
211192
|
+
return false;
|
|
211193
|
+
if (node3.isText && node3.text?.length) {
|
|
211194
|
+
target = pos;
|
|
211195
|
+
return false;
|
|
211196
|
+
}
|
|
211197
|
+
return true;
|
|
211198
|
+
});
|
|
211199
|
+
return target;
|
|
211200
|
+
}
|
|
211201
|
+
function shouldHandlePlainHorizontalArrow(event) {
|
|
211202
|
+
return (event.key === "ArrowLeft" || event.key === "ArrowRight") && !event.shiftKey && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
211203
|
+
}
|
|
211204
|
+
function createListBoundaryNavigationPlugin() {
|
|
211205
|
+
return new Plugin({ props: { handleKeyDown(view, event) {
|
|
211206
|
+
if (!shouldHandlePlainHorizontalArrow(event))
|
|
211207
|
+
return false;
|
|
211208
|
+
const { state } = view;
|
|
211209
|
+
const { selection } = state;
|
|
211210
|
+
if (!selection.empty)
|
|
211211
|
+
return false;
|
|
211212
|
+
const paragraph2 = getParagraphContext$1(selection.$from);
|
|
211213
|
+
if (!paragraph2 || !isListParagraph(paragraph2.node))
|
|
211214
|
+
return false;
|
|
211215
|
+
if (isRtlParagraph$1(paragraph2.node))
|
|
211216
|
+
return false;
|
|
211217
|
+
const bounds = getParagraphTextBounds2(paragraph2.node, paragraph2.start);
|
|
211218
|
+
if (!bounds)
|
|
211219
|
+
return false;
|
|
211220
|
+
const direction = event.key === "ArrowLeft" ? -1 : 1;
|
|
211221
|
+
const atLeftBoundary = direction < 0 && selection.from <= bounds.first;
|
|
211222
|
+
const atRightBoundary = direction > 0 && selection.from >= bounds.last;
|
|
211223
|
+
if (!atLeftBoundary && !atRightBoundary)
|
|
211224
|
+
return false;
|
|
211225
|
+
const target = findAdjacentTextPosition(state.doc, direction < 0 ? paragraph2.pos : paragraph2.end, direction);
|
|
211226
|
+
if (target == null || target === selection.from)
|
|
211227
|
+
return false;
|
|
211228
|
+
event.preventDefault();
|
|
211229
|
+
view.dispatch(state.tr.setSelection(TextSelection.create(state.doc, target)).scrollIntoView());
|
|
211230
|
+
return true;
|
|
211231
|
+
} } });
|
|
211232
|
+
}
|
|
211099
211233
|
function parseCssLength(value) {
|
|
211100
211234
|
if (!value)
|
|
211101
211235
|
return null;
|
|
@@ -250385,15 +250519,19 @@ function renderListMarker(params$1) {
|
|
|
250385
250519
|
const suffixType = markerLayout?.suffix ?? "tab";
|
|
250386
250520
|
if (suffixType === "tab") {
|
|
250387
250521
|
const tabEl = doc$12.createElement("span");
|
|
250388
|
-
tabEl.
|
|
250522
|
+
tabEl.classList.add("superdoc-tab", "superdoc-marker-suffix-tab");
|
|
250389
250523
|
tabEl.innerHTML = " ";
|
|
250390
250524
|
tabEl.style.display = "inline-block";
|
|
250525
|
+
if (markerLayout?.run?.fontSize != null)
|
|
250526
|
+
tabEl.style.fontSize = `${markerLayout.run.fontSize}px`;
|
|
250391
250527
|
tabEl.style.wordSpacing = "0px";
|
|
250392
250528
|
tabEl.style.width = `${listTabWidth}px`;
|
|
250393
250529
|
lineEl.prepend(tabEl);
|
|
250394
250530
|
} else if (suffixType === "space") {
|
|
250395
250531
|
const spaceEl = doc$12.createElement("span");
|
|
250396
250532
|
spaceEl.classList.add("superdoc-marker-suffix-space");
|
|
250533
|
+
if (markerLayout?.run?.fontSize != null)
|
|
250534
|
+
spaceEl.style.fontSize = `${markerLayout.run.fontSize}px`;
|
|
250397
250535
|
spaceEl.style.wordSpacing = "0px";
|
|
250398
250536
|
spaceEl.textContent = " ";
|
|
250399
250537
|
lineEl.prepend(spaceEl);
|
|
@@ -251279,9 +251417,9 @@ function resolveParagraphContent(fragment2, block, measure) {
|
|
|
251279
251417
|
const paragraphLineIndex = fragment2.fromLine + index2;
|
|
251280
251418
|
const isFirstLineOfPara = paragraphLineIndex === 0;
|
|
251281
251419
|
const firstLineOffsetForCumX = isFirstLineOfPara ? firstLine - hanging : 0;
|
|
251282
|
-
const isListParagraph = Boolean(wordLayout?.marker);
|
|
251420
|
+
const isListParagraph$1 = Boolean(wordLayout?.marker);
|
|
251283
251421
|
const fallbackListTextStartPx = typeof wordLayout?.marker?.textStartX === "number" && Number.isFinite(wordLayout.marker.textStartX) ? wordLayout.marker.textStartX : typeof wordLayout?.textStartPx === "number" && Number.isFinite(wordLayout.textStartPx) ? wordLayout.textStartPx : undefined;
|
|
251284
|
-
const indentOffset = isListParagraph ? isFirstLineOfPara ? (shouldUseResolvedListTextStart ? listFirstLineTextStartPx : undefined) ?? fallbackListTextStartPx ?? indentLeft : indentLeft : indentLeft + firstLineOffsetForCumX;
|
|
251422
|
+
const indentOffset = isListParagraph$1 ? isFirstLineOfPara ? (shouldUseResolvedListTextStart ? listFirstLineTextStartPx : undefined) ?? fallbackListTextStartPx ?? indentLeft : indentLeft : indentLeft + firstLineOffsetForCumX;
|
|
251285
251423
|
return {
|
|
251286
251424
|
line,
|
|
251287
251425
|
lineIndex: paragraphLineIndex,
|
|
@@ -259915,11 +260053,9 @@ function collectClientRectsByLine(doc$12, entries2, sliceFrom, sliceTo) {
|
|
|
259915
260053
|
function setDomRangeStart(range, entry, pos) {
|
|
259916
260054
|
const el = entry.el;
|
|
259917
260055
|
const pmStart = entry.pmStart;
|
|
259918
|
-
const
|
|
259919
|
-
if (
|
|
259920
|
-
|
|
259921
|
-
const charIndex = mapPmPosToCharIndex(pos, pmStart, entry.pmEnd, textNode.length);
|
|
259922
|
-
range.setStart(textNode, charIndex);
|
|
260056
|
+
const boundary = resolveTextBoundaryInElement(el, pos, pmStart, entry.pmEnd, "forward");
|
|
260057
|
+
if (boundary) {
|
|
260058
|
+
range.setStart(boundary.node, boundary.offset);
|
|
259923
260059
|
return true;
|
|
259924
260060
|
}
|
|
259925
260061
|
if (!el.isConnected || !el.parentNode)
|
|
@@ -259934,11 +260070,9 @@ function setDomRangeStart(range, entry, pos) {
|
|
|
259934
260070
|
function setDomRangeEnd(range, entry, pos) {
|
|
259935
260071
|
const el = entry.el;
|
|
259936
260072
|
const pmStart = entry.pmStart;
|
|
259937
|
-
const
|
|
259938
|
-
if (
|
|
259939
|
-
|
|
259940
|
-
const charIndex = mapPmPosToCharIndex(pos, pmStart, entry.pmEnd, textNode.length);
|
|
259941
|
-
range.setEnd(textNode, charIndex);
|
|
260073
|
+
const boundary = resolveTextBoundaryInElement(el, pos, pmStart, entry.pmEnd, "backward");
|
|
260074
|
+
if (boundary) {
|
|
260075
|
+
range.setEnd(boundary.node, boundary.offset);
|
|
259942
260076
|
return true;
|
|
259943
260077
|
}
|
|
259944
260078
|
if (!el.isConnected || !el.parentNode)
|
|
@@ -259968,8 +260102,8 @@ function computeDomCaretPageLocal(options, pos) {
|
|
|
259968
260102
|
return null;
|
|
259969
260103
|
const pageRect = page.getBoundingClientRect();
|
|
259970
260104
|
const zoom = options.zoom;
|
|
259971
|
-
const
|
|
259972
|
-
if (!
|
|
260105
|
+
const boundary = resolveTextBoundaryInElement(targetEl, pos, entry.pmStart, entry.pmEnd, "forward");
|
|
260106
|
+
if (!boundary) {
|
|
259973
260107
|
const elRect = targetEl.getBoundingClientRect();
|
|
259974
260108
|
const atEnd = pos >= entry.pmEnd;
|
|
259975
260109
|
return {
|
|
@@ -259978,10 +260112,9 @@ function computeDomCaretPageLocal(options, pos) {
|
|
|
259978
260112
|
y: (elRect.top - pageRect.top) / zoom
|
|
259979
260113
|
};
|
|
259980
260114
|
}
|
|
259981
|
-
const charIndex = mapPmPosToCharIndex(pos, entry.pmStart, entry.pmEnd, textNode.length);
|
|
259982
260115
|
const range = document.createRange();
|
|
259983
|
-
range.setStart(
|
|
259984
|
-
range.setEnd(
|
|
260116
|
+
range.setStart(boundary.node, boundary.offset);
|
|
260117
|
+
range.setEnd(boundary.node, boundary.offset);
|
|
259985
260118
|
const rangeRect = range.getBoundingClientRect();
|
|
259986
260119
|
const lineRect = targetEl.closest(".superdoc-line")?.getBoundingClientRect() ?? rangeRect;
|
|
259987
260120
|
return {
|
|
@@ -259990,6 +260123,53 @@ function computeDomCaretPageLocal(options, pos) {
|
|
|
259990
260123
|
y: (lineRect.top - pageRect.top) / zoom
|
|
259991
260124
|
};
|
|
259992
260125
|
}
|
|
260126
|
+
function resolveTextBoundaryInElement(element3, pos, pmStart, pmEnd, affinity) {
|
|
260127
|
+
const textLength = element3.textContent?.length ?? 0;
|
|
260128
|
+
if (textLength <= 0)
|
|
260129
|
+
return null;
|
|
260130
|
+
return resolveDescendantTextBoundary(element3, mapPmPosToCharIndex(pos, pmStart, pmEnd, textLength), affinity);
|
|
260131
|
+
}
|
|
260132
|
+
function resolveDescendantTextBoundary(element3, targetOffset, affinity) {
|
|
260133
|
+
const walker = (element3.ownerDocument ?? document).createTreeWalker(element3, NodeFilter.SHOW_TEXT);
|
|
260134
|
+
let consumed = 0;
|
|
260135
|
+
let previous3 = null;
|
|
260136
|
+
let current = walker.nextNode();
|
|
260137
|
+
while (current) {
|
|
260138
|
+
const textNode = current;
|
|
260139
|
+
const textLength = textNode.textContent?.length ?? 0;
|
|
260140
|
+
if (textLength <= 0) {
|
|
260141
|
+
current = walker.nextNode();
|
|
260142
|
+
continue;
|
|
260143
|
+
}
|
|
260144
|
+
const segmentEnd = consumed + textLength;
|
|
260145
|
+
if (targetOffset < segmentEnd)
|
|
260146
|
+
return {
|
|
260147
|
+
node: textNode,
|
|
260148
|
+
offset: Math.max(0, targetOffset - consumed)
|
|
260149
|
+
};
|
|
260150
|
+
if (targetOffset === segmentEnd) {
|
|
260151
|
+
if (affinity === "backward")
|
|
260152
|
+
return {
|
|
260153
|
+
node: textNode,
|
|
260154
|
+
offset: textLength
|
|
260155
|
+
};
|
|
260156
|
+
previous3 = {
|
|
260157
|
+
node: textNode,
|
|
260158
|
+
offset: textLength
|
|
260159
|
+
};
|
|
260160
|
+
consumed = segmentEnd;
|
|
260161
|
+
current = walker.nextNode();
|
|
260162
|
+
continue;
|
|
260163
|
+
}
|
|
260164
|
+
previous3 = {
|
|
260165
|
+
node: textNode,
|
|
260166
|
+
offset: textLength
|
|
260167
|
+
};
|
|
260168
|
+
consumed = segmentEnd;
|
|
260169
|
+
current = walker.nextNode();
|
|
260170
|
+
}
|
|
260171
|
+
return previous3;
|
|
260172
|
+
}
|
|
259993
260173
|
function mapPmPosToCharIndex(pos, pmStart, pmEnd, textLength) {
|
|
259994
260174
|
if (!Number.isFinite(pos) || !Number.isFinite(pmStart) || !Number.isFinite(pmEnd))
|
|
259995
260175
|
return 0;
|
|
@@ -261928,6 +262108,30 @@ function handleDocumentPartObjectNode(node3, context) {
|
|
|
261928
262108
|
}
|
|
261929
262109
|
if (sectionState)
|
|
261930
262110
|
sectionState.currentParagraphIndex++;
|
|
262111
|
+
} else if (child.type === "tableOfContents" && Array.isArray(child.content)) {
|
|
262112
|
+
const metadata = {
|
|
262113
|
+
docPartGallery: docPartGallery ?? "",
|
|
262114
|
+
docPartObjectId,
|
|
262115
|
+
tocInstruction: getNodeInstruction(child) ?? tocInstruction,
|
|
262116
|
+
sdtMetadata: docPartSdtMetadata
|
|
262117
|
+
};
|
|
262118
|
+
const tocContext = {
|
|
262119
|
+
nextBlockId,
|
|
262120
|
+
positions,
|
|
262121
|
+
bookmarks,
|
|
262122
|
+
hyperlinkConfig,
|
|
262123
|
+
enableComments,
|
|
262124
|
+
trackedChangesConfig,
|
|
262125
|
+
themeColors,
|
|
262126
|
+
converters: converters$1,
|
|
262127
|
+
converterContext,
|
|
262128
|
+
sectionState
|
|
262129
|
+
};
|
|
262130
|
+
const output = {
|
|
262131
|
+
blocks: blocks2,
|
|
262132
|
+
recordBlockKind
|
|
262133
|
+
};
|
|
262134
|
+
processTocChildren(child.content, metadata, tocContext, output);
|
|
261931
262135
|
}
|
|
261932
262136
|
}
|
|
261933
262137
|
}
|
|
@@ -281489,6 +281693,16 @@ var Node$13 = class Node$14 {
|
|
|
281489
281693
|
tooltip: toolbarTexts$1.ruler,
|
|
281490
281694
|
attributes: { ariaLabel: "Ruler" }
|
|
281491
281695
|
});
|
|
281696
|
+
const formattingMarks = useToolbarItem({
|
|
281697
|
+
type: "button",
|
|
281698
|
+
name: "formattingMarks",
|
|
281699
|
+
command: "toggleFormattingMarks",
|
|
281700
|
+
allowWithoutEditor: true,
|
|
281701
|
+
icon: toolbarIcons$1.formattingMarks,
|
|
281702
|
+
active: false,
|
|
281703
|
+
tooltip: toolbarTexts$1.formattingMarks,
|
|
281704
|
+
attributes: { ariaLabel: "Formatting marks" }
|
|
281705
|
+
});
|
|
281492
281706
|
const selectedLinkedStyle = exports_vue.ref(null);
|
|
281493
281707
|
const linkedStyles = useToolbarItem({
|
|
281494
281708
|
type: "dropdown",
|
|
@@ -281586,7 +281800,8 @@ var Node$13 = class Node$14 {
|
|
|
281586
281800
|
"linkedStyles",
|
|
281587
281801
|
"clearFormatting",
|
|
281588
281802
|
"copyFormat",
|
|
281589
|
-
"ruler"
|
|
281803
|
+
"ruler",
|
|
281804
|
+
"formattingMarks"
|
|
281590
281805
|
];
|
|
281591
281806
|
const itemsToHideSM = [
|
|
281592
281807
|
"zoom",
|
|
@@ -281637,6 +281852,7 @@ var Node$13 = class Node$14 {
|
|
|
281637
281852
|
linkedStyles,
|
|
281638
281853
|
separator,
|
|
281639
281854
|
ruler,
|
|
281855
|
+
formattingMarks,
|
|
281640
281856
|
copyFormat,
|
|
281641
281857
|
clearFormatting,
|
|
281642
281858
|
aiButton,
|
|
@@ -281652,6 +281868,7 @@ var Node$13 = class Node$14 {
|
|
|
281652
281868
|
toolbarItems.splice(getLinkedStylesIndex - 1, 2);
|
|
281653
281869
|
const filterItems = [
|
|
281654
281870
|
"ruler",
|
|
281871
|
+
"formattingMarks",
|
|
281655
281872
|
"zoom",
|
|
281656
281873
|
"undo",
|
|
281657
281874
|
"redo"
|
|
@@ -285242,6 +285459,82 @@ var Node$13 = class Node$14 {
|
|
|
285242
285459
|
.superdoc-layout .track-format-dec.highlighted.track-change-focused {
|
|
285243
285460
|
background-color: var(--sd-tracked-changes-format-background-focused, #ffd70033);
|
|
285244
285461
|
}
|
|
285462
|
+
`, FORMATTING_MARKS_STYLES = `
|
|
285463
|
+
.superdoc-formatting-space-mark,
|
|
285464
|
+
.superdoc-marker-suffix-space {
|
|
285465
|
+
position: relative;
|
|
285466
|
+
}
|
|
285467
|
+
|
|
285468
|
+
.superdoc-formatting-space-mark {
|
|
285469
|
+
white-space: pre;
|
|
285470
|
+
}
|
|
285471
|
+
|
|
285472
|
+
.superdoc-layout.superdoc-show-formatting-marks .superdoc-tab {
|
|
285473
|
+
position: relative;
|
|
285474
|
+
visibility: visible !important;
|
|
285475
|
+
}
|
|
285476
|
+
|
|
285477
|
+
.superdoc-layout.superdoc-show-formatting-marks .superdoc-tab::after {
|
|
285478
|
+
content: "→";
|
|
285479
|
+
position: absolute;
|
|
285480
|
+
left: 50%;
|
|
285481
|
+
top: 50%;
|
|
285482
|
+
transform: translate(-50%, -50%);
|
|
285483
|
+
color: var(--sd-formatting-mark-color, var(--sd-ui-action, currentColor));
|
|
285484
|
+
font-size: 0.75em;
|
|
285485
|
+
line-height: 1;
|
|
285486
|
+
pointer-events: none;
|
|
285487
|
+
}
|
|
285488
|
+
|
|
285489
|
+
.superdoc-layout.superdoc-show-formatting-marks [dir="rtl"] .superdoc-tab::after {
|
|
285490
|
+
content: "←";
|
|
285491
|
+
}
|
|
285492
|
+
|
|
285493
|
+
.superdoc-layout.superdoc-show-formatting-marks .superdoc-formatting-space-mark::after,
|
|
285494
|
+
.superdoc-layout.superdoc-show-formatting-marks .superdoc-marker-suffix-space::after {
|
|
285495
|
+
content: "·";
|
|
285496
|
+
position: absolute;
|
|
285497
|
+
left: 50%;
|
|
285498
|
+
top: 50%;
|
|
285499
|
+
transform: translate(-50%, -50%);
|
|
285500
|
+
color: var(--sd-formatting-mark-color, var(--sd-ui-action, currentColor));
|
|
285501
|
+
font-size: 0.75em;
|
|
285502
|
+
line-height: 1;
|
|
285503
|
+
pointer-events: none;
|
|
285504
|
+
}
|
|
285505
|
+
|
|
285506
|
+
.superdoc-formatting-paragraph-mark {
|
|
285507
|
+
display: none;
|
|
285508
|
+
position: absolute;
|
|
285509
|
+
top: 0;
|
|
285510
|
+
transform: translateX(var(--sd-formatting-paragraph-mark-gap, 0.2em));
|
|
285511
|
+
color: var(--sd-formatting-mark-color, var(--sd-ui-action, currentColor));
|
|
285512
|
+
pointer-events: none;
|
|
285513
|
+
user-select: none;
|
|
285514
|
+
white-space: pre;
|
|
285515
|
+
z-index: 2;
|
|
285516
|
+
}
|
|
285517
|
+
|
|
285518
|
+
.superdoc-layout.superdoc-show-formatting-marks .superdoc-formatting-paragraph-mark {
|
|
285519
|
+
display: inline;
|
|
285520
|
+
}
|
|
285521
|
+
|
|
285522
|
+
.superdoc-layout.superdoc-show-formatting-marks [dir="rtl"] .superdoc-formatting-paragraph-mark {
|
|
285523
|
+
transform: translateX(calc(-100% - var(--sd-formatting-paragraph-mark-gap, 0.2em)));
|
|
285524
|
+
}
|
|
285525
|
+
|
|
285526
|
+
@media print {
|
|
285527
|
+
.superdoc-layout.superdoc-show-formatting-marks .superdoc-tab::after,
|
|
285528
|
+
.superdoc-layout.superdoc-show-formatting-marks .superdoc-formatting-space-mark::after,
|
|
285529
|
+
.superdoc-layout.superdoc-show-formatting-marks .superdoc-marker-suffix-space::after {
|
|
285530
|
+
content: "";
|
|
285531
|
+
display: none;
|
|
285532
|
+
}
|
|
285533
|
+
|
|
285534
|
+
.superdoc-layout.superdoc-show-formatting-marks .superdoc-formatting-paragraph-mark {
|
|
285535
|
+
display: none;
|
|
285536
|
+
}
|
|
285537
|
+
}
|
|
285245
285538
|
`, SDT_CONTAINER_STYLES = `
|
|
285246
285539
|
/* Document Section - Block-level container with gray border and hover tooltip */
|
|
285247
285540
|
.superdoc-document-section {
|
|
@@ -285613,7 +285906,7 @@ menclose::after {
|
|
|
285613
285906
|
pointer-events: none;
|
|
285614
285907
|
background: var(--sd-menclose-h), var(--sd-menclose-v), var(--sd-menclose-up), var(--sd-menclose-down);
|
|
285615
285908
|
}
|
|
285616
|
-
`, printStylesInjected = false, linkStylesInjected = false, trackChangeStylesInjected = false, sdtContainerStylesInjected = false, fieldAnnotationStylesInjected = false, imageSelectionStylesInjected = false, mathMencloseStylesInjected = false, ensurePrintStyles = (doc$12) => {
|
|
285909
|
+
`, printStylesInjected = false, linkStylesInjected = false, trackChangeStylesInjected = false, formattingMarksStylesInjected = false, sdtContainerStylesInjected = false, fieldAnnotationStylesInjected = false, imageSelectionStylesInjected = false, mathMencloseStylesInjected = false, ensurePrintStyles = (doc$12) => {
|
|
285617
285910
|
if (printStylesInjected || !doc$12)
|
|
285618
285911
|
return;
|
|
285619
285912
|
const styleEl = doc$12.createElement("style");
|
|
@@ -285637,6 +285930,14 @@ menclose::after {
|
|
|
285637
285930
|
styleEl.textContent = TRACK_CHANGE_STYLES;
|
|
285638
285931
|
doc$12.head?.appendChild(styleEl);
|
|
285639
285932
|
trackChangeStylesInjected = true;
|
|
285933
|
+
}, ensureFormattingMarksStyles = (doc$12) => {
|
|
285934
|
+
if (formattingMarksStylesInjected || !doc$12)
|
|
285935
|
+
return;
|
|
285936
|
+
const styleEl = doc$12.createElement("style");
|
|
285937
|
+
styleEl.setAttribute("data-superdoc-formatting-marks-styles", "true");
|
|
285938
|
+
styleEl.textContent = FORMATTING_MARKS_STYLES;
|
|
285939
|
+
doc$12.head?.appendChild(styleEl);
|
|
285940
|
+
formattingMarksStylesInjected = true;
|
|
285640
285941
|
}, ensureSdtContainerStyles = (doc$12) => {
|
|
285641
285942
|
if (sdtContainerStylesInjected || !doc$12)
|
|
285642
285943
|
return;
|
|
@@ -286125,6 +286426,12 @@ menclose::after {
|
|
|
286125
286426
|
if (value != null && value !== "" && key2 in el.style)
|
|
286126
286427
|
el.style[key2] = String(value);
|
|
286127
286428
|
});
|
|
286429
|
+
}, convertParagraphMarkToCellMark = (lineEl) => {
|
|
286430
|
+
const mark2 = lineEl.querySelector(".superdoc-formatting-paragraph-mark");
|
|
286431
|
+
if (!mark2)
|
|
286432
|
+
return;
|
|
286433
|
+
mark2.classList.add("superdoc-formatting-cell-mark");
|
|
286434
|
+
mark2.textContent = "¤";
|
|
286128
286435
|
}, renderEmbeddedTable = (params$1) => {
|
|
286129
286436
|
const { doc: doc$12, table: table2, measure, availableWidth, context, renderLine, captureLineSnapshot, renderDrawingContent, applySdtDataset, fromRow: paramFromRow, toRow: paramToRow, partialRow: paramPartialRow } = params$1;
|
|
286130
286437
|
const effectiveFromRow = paramFromRow ?? 0;
|
|
@@ -286399,6 +286706,7 @@ menclose::after {
|
|
|
286399
286706
|
const paragraphMeasure = blockMeasure;
|
|
286400
286707
|
const lines = paragraphMeasure.lines;
|
|
286401
286708
|
const blockLineCount = lines?.length || 0;
|
|
286709
|
+
const isLastBlockInCell = i4 === Math.min(blockMeasures.length, cellBlocks.length) - 1;
|
|
286402
286710
|
const wordLayout = block.attrs?.wordLayout ?? null;
|
|
286403
286711
|
const markerLayout = wordLayout?.marker;
|
|
286404
286712
|
const markerMeasure = paragraphMeasure.marker;
|
|
@@ -286453,6 +286761,8 @@ menclose::after {
|
|
|
286453
286761
|
...context,
|
|
286454
286762
|
section: "body"
|
|
286455
286763
|
}, lineIdx, isLastLine, lineIdx === 0 && localStartLine === 0 ? listFirstLineTextStartPx : undefined);
|
|
286764
|
+
if (isLastBlockInCell && isLastLine)
|
|
286765
|
+
convertParagraphMarkToCellMark(lineEl);
|
|
286456
286766
|
lineEl.style.paddingLeft = "";
|
|
286457
286767
|
lineEl.style.paddingRight = "";
|
|
286458
286768
|
lineEl.style.textIndent = "";
|
|
@@ -287872,6 +288182,9 @@ menclose::after {
|
|
|
287872
288182
|
},
|
|
287873
288183
|
setScrollContainer(el) {
|
|
287874
288184
|
painter.setScrollContainer(el);
|
|
288185
|
+
},
|
|
288186
|
+
setShowFormattingMarks(showFormattingMarks) {
|
|
288187
|
+
painter.setShowFormattingMarks(showFormattingMarks);
|
|
287875
288188
|
}
|
|
287876
288189
|
};
|
|
287877
288190
|
}, PresentationPaintIndex = class {
|
|
@@ -287955,13 +288268,16 @@ menclose::after {
|
|
|
287955
288268
|
#zoom = 1;
|
|
287956
288269
|
#scrollContainer = null;
|
|
287957
288270
|
#virtualizationPins = [];
|
|
288271
|
+
#showFormattingMarks = false;
|
|
287958
288272
|
get hasPainter() {
|
|
287959
288273
|
return this.#painter !== null;
|
|
287960
288274
|
}
|
|
287961
288275
|
ensurePainter(options) {
|
|
287962
288276
|
if (!this.#painter) {
|
|
288277
|
+
this.#showFormattingMarks = Boolean(options.showFormattingMarks ?? this.#showFormattingMarks);
|
|
287963
288278
|
this.#painter = createDomPainter({
|
|
287964
288279
|
...options,
|
|
288280
|
+
showFormattingMarks: this.#showFormattingMarks,
|
|
287965
288281
|
onPaintSnapshot: (snapshot2) => {
|
|
287966
288282
|
this.#lastPaintSnapshot = snapshot2;
|
|
287967
288283
|
this.#paintIndex.update(snapshot2);
|
|
@@ -287985,6 +288301,13 @@ menclose::after {
|
|
|
287985
288301
|
this.#footerProvider = footer;
|
|
287986
288302
|
this.#applyProviders();
|
|
287987
288303
|
}
|
|
288304
|
+
setShowFormattingMarks(showFormattingMarks) {
|
|
288305
|
+
const next2 = Boolean(showFormattingMarks);
|
|
288306
|
+
if (this.#showFormattingMarks === next2)
|
|
288307
|
+
return;
|
|
288308
|
+
this.#showFormattingMarks = next2;
|
|
288309
|
+
this.#applyShowFormattingMarks();
|
|
288310
|
+
}
|
|
287988
288311
|
setZoom(zoom) {
|
|
287989
288312
|
if (this.#zoom === zoom)
|
|
287990
288313
|
return;
|
|
@@ -288039,6 +288362,7 @@ menclose::after {
|
|
|
288039
288362
|
this.#applyZoom();
|
|
288040
288363
|
this.#applyScrollContainer();
|
|
288041
288364
|
this.#applyVirtualizationPins();
|
|
288365
|
+
this.#applyShowFormattingMarks();
|
|
288042
288366
|
}
|
|
288043
288367
|
#applyProviders() {
|
|
288044
288368
|
this.#painter?.setProviders(this.#headerProvider, this.#footerProvider);
|
|
@@ -288052,6 +288376,9 @@ menclose::after {
|
|
|
288052
288376
|
#applyVirtualizationPins() {
|
|
288053
288377
|
this.#painter?.setVirtualizationPins(this.#virtualizationPins);
|
|
288054
288378
|
}
|
|
288379
|
+
#applyShowFormattingMarks() {
|
|
288380
|
+
this.#painter?.setShowFormattingMarks(this.#showFormattingMarks);
|
|
288381
|
+
}
|
|
288055
288382
|
}, hashParagraphBorder$1 = (border) => {
|
|
288056
288383
|
const parts = [];
|
|
288057
288384
|
if (border.style !== undefined)
|
|
@@ -291203,7 +291530,7 @@ menclose::after {
|
|
|
291203
291530
|
let paraIndentLeft = 0;
|
|
291204
291531
|
let paraIndentRight = 0;
|
|
291205
291532
|
let effectiveLeft = 0;
|
|
291206
|
-
let isListParagraph = false;
|
|
291533
|
+
let isListParagraph$1 = false;
|
|
291207
291534
|
let wl;
|
|
291208
291535
|
if (block.kind === "paragraph") {
|
|
291209
291536
|
const indentLeft = typeof block.attrs?.indent?.left === "number" ? block.attrs.indent.left : 0;
|
|
@@ -291212,8 +291539,8 @@ menclose::after {
|
|
|
291212
291539
|
paraIndentRight = Number.isFinite(indentRight) ? indentRight : 0;
|
|
291213
291540
|
effectiveLeft = paraIndentLeft;
|
|
291214
291541
|
wl = getWordLayoutConfig(block);
|
|
291215
|
-
isListParagraph = Boolean(block.attrs?.numberingProperties) || Boolean(wl?.marker);
|
|
291216
|
-
if (isListParagraph) {
|
|
291542
|
+
isListParagraph$1 = Boolean(block.attrs?.numberingProperties) || Boolean(wl?.marker);
|
|
291543
|
+
if (isListParagraph$1) {
|
|
291217
291544
|
const explicitTextStart = typeof wl?.marker?.textStartX === "number" && Number.isFinite(wl.marker.textStartX) ? wl.marker.textStartX : typeof wl?.textStartPx === "number" && Number.isFinite(wl.textStartPx) ? wl.textStartPx : undefined;
|
|
291218
291545
|
if (typeof explicitTextStart === "number" && explicitTextStart > paraIndentLeft)
|
|
291219
291546
|
effectiveLeft = explicitTextStart;
|
|
@@ -291223,7 +291550,7 @@ menclose::after {
|
|
|
291223
291550
|
let availableWidth = Math.max(0, fragmentWidth - totalIndent);
|
|
291224
291551
|
if (totalIndent > fragmentWidth)
|
|
291225
291552
|
console.warn(`[mapPmToX] Paragraph indents (${totalIndent}px) exceed fragment width (${fragmentWidth}px) for block ${block.id}. This may indicate a layout miscalculation. Available width clamped to 0.`);
|
|
291226
|
-
const hasRenderedMarkerText = isListParagraph && (markerTextWidth ?? 0) > 0;
|
|
291553
|
+
const hasRenderedMarkerText = isListParagraph$1 && (markerTextWidth ?? 0) > 0;
|
|
291227
291554
|
if (isFirstLine && block.kind === "paragraph" && !hasRenderedMarkerText) {
|
|
291228
291555
|
const suppressFLI = block.attrs?.suppressFirstLineIndent === true;
|
|
291229
291556
|
const firstLineOffset = getFirstLineIndentOffset(block.attrs?.indent, suppressFLI);
|
|
@@ -298930,12 +299257,12 @@ menclose::after {
|
|
|
298930
299257
|
return;
|
|
298931
299258
|
console.log(...args$1);
|
|
298932
299259
|
}, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions;
|
|
298933
|
-
var
|
|
299260
|
+
var init_src_C4h4xIas_es = __esm(() => {
|
|
298934
299261
|
init_rolldown_runtime_Bg48TavK_es();
|
|
298935
|
-
|
|
299262
|
+
init_SuperConverter_BLL9JGke_es();
|
|
298936
299263
|
init_jszip_C49i9kUs_es();
|
|
298937
299264
|
init_uuid_qzgm05fK_es();
|
|
298938
|
-
|
|
299265
|
+
init_create_headless_toolbar_D7n_Okb2_es();
|
|
298939
299266
|
init_constants_DrU4EASo_es();
|
|
298940
299267
|
init_dist_B8HfvhaK_es();
|
|
298941
299268
|
init_unified_Dsuw2be5_es();
|
|
@@ -301980,7 +302307,8 @@ ${err.toString()}`);
|
|
|
301980
302307
|
event.preventDefault();
|
|
301981
302308
|
return true;
|
|
301982
302309
|
} } } }),
|
|
301983
|
-
createLeadingCaretPlugin()
|
|
302310
|
+
createLeadingCaretPlugin(),
|
|
302311
|
+
createListBoundaryNavigationPlugin()
|
|
301984
302312
|
];
|
|
301985
302313
|
}
|
|
301986
302314
|
});
|
|
@@ -317730,7 +318058,9 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
317730
318058
|
cut: scissors_solid_default,
|
|
317731
318059
|
copy: copy_solid_default,
|
|
317732
318060
|
paste: paste_solid_default,
|
|
317733
|
-
strikethrough: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M161.3 144c3.2-17.2 14-30.1 33.7-38.6c21.1-9 51.8-12.3 88.6-6.5c11.9 1.9 48.8 9.1 60.1 12c17.1 4.5 34.6-5.6 39.2-22.7s-5.6-34.6-22.7-39.2c-14.3-3.8-53.6-11.4-66.6-13.4c-44.7-7-88.3-4.2-123.7 10.9c-36.5 15.6-64.4 44.8-71.8 87.3c-.1 .6-.2 1.1-.2 1.7c-2.8 23.9 .5 45.6 10.1 64.6c4.5 9 10.2 16.9 16.7 23.9L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-209.9 0-.4-.1-1.1-.3c-36-10.8-65.2-19.6-85.2-33.1c-9.3-6.3-15-12.6-18.2-19.1c-3.1-6.1-5.2-14.6-3.8-27.4zM348.9 337.2c2.7 6.5 4.4 15.8 1.9 30.1c-3 17.6-13.8 30.8-33.9 39.4c-21.1 9-51.7 12.3-88.5 6.5c-18-2.9-49.1-13.5-74.4-22.1c-5.6-1.9-11-3.7-15.9-5.4c-16.8-5.6-34.9 3.5-40.5 20.3s3.5 34.9 20.3 40.5c3.6 1.2 7.9 2.7 12.7 4.3c0 0 0 0 0 0s0 0 0 0c24.9 8.5 63.6 21.7 87.6 25.6c0 0 0 0 0 0l.2 0c44.7 7 88.3 4.2 123.7-10.9c36.5-15.6 64.4-44.8 71.8-87.3c3.6-21 2.7-40.4-3.1-58.1l-75.7 0c7 5.6 11.4 11.2 13.9 17.2z"/></svg>\n'
|
|
318061
|
+
strikethrough: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M161.3 144c3.2-17.2 14-30.1 33.7-38.6c21.1-9 51.8-12.3 88.6-6.5c11.9 1.9 48.8 9.1 60.1 12c17.1 4.5 34.6-5.6 39.2-22.7s-5.6-34.6-22.7-39.2c-14.3-3.8-53.6-11.4-66.6-13.4c-44.7-7-88.3-4.2-123.7 10.9c-36.5 15.6-64.4 44.8-71.8 87.3c-.1 .6-.2 1.1-.2 1.7c-2.8 23.9 .5 45.6 10.1 64.6c4.5 9 10.2 16.9 16.7 23.9L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-209.9 0-.4-.1-1.1-.3c-36-10.8-65.2-19.6-85.2-33.1c-9.3-6.3-15-12.6-18.2-19.1c-3.1-6.1-5.2-14.6-3.8-27.4zM348.9 337.2c2.7 6.5 4.4 15.8 1.9 30.1c-3 17.6-13.8 30.8-33.9 39.4c-21.1 9-51.7 12.3-88.5 6.5c-18-2.9-49.1-13.5-74.4-22.1c-5.6-1.9-11-3.7-15.9-5.4c-16.8-5.6-34.9 3.5-40.5 20.3s3.5 34.9 20.3 40.5c3.6 1.2 7.9 2.7 12.7 4.3c0 0 0 0 0 0s0 0 0 0c24.9 8.5 63.6 21.7 87.6 25.6c0 0 0 0 0 0l.2 0c44.7 7 88.3 4.2 123.7-10.9c36.5-15.6 64.4-44.8 71.8-87.3c3.6-21 2.7-40.4-3.1-58.1l-75.7 0c7 5.6 11.4 11.2 13.9 17.2z"/></svg>\n',
|
|
318062
|
+
formattingMarks: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true"><text x="12" y="18" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="20" font-weight="700" fill="currentColor">¶</text></svg>
|
|
318063
|
+
`
|
|
317734
318064
|
};
|
|
317735
318065
|
_hoisted_1$20 = [
|
|
317736
318066
|
"onClick",
|
|
@@ -318907,6 +319237,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
318907
319237
|
acceptTrackedChangeBySelection: "track-changes-accept-selection",
|
|
318908
319238
|
rejectTrackedChangeOnSelection: "track-changes-reject-selection",
|
|
318909
319239
|
ruler: "ruler",
|
|
319240
|
+
formattingMarks: "formatting-marks",
|
|
318910
319241
|
zoom: "zoom",
|
|
318911
319242
|
documentMode: "document-mode",
|
|
318912
319243
|
link: "link",
|
|
@@ -320394,6 +320725,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
320394
320725
|
lineHeight: "Line height",
|
|
320395
320726
|
formatText: "Format text",
|
|
320396
320727
|
ruler: "Show or hide ruler",
|
|
320728
|
+
formattingMarks: "Show or hide formatting marks",
|
|
320397
320729
|
pageBreak: "Insert page break",
|
|
320398
320730
|
documentEditingMode: "Editing",
|
|
320399
320731
|
documentSuggestingMode: "Suggesting",
|
|
@@ -320773,6 +321105,10 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
320773
321105
|
const currentMode = this.snapshot?.commands?.["document-mode"]?.value || "editing";
|
|
320774
321106
|
if (!this.activeEditor || currentMode === "viewing") {
|
|
320775
321107
|
this.#deactivateAll();
|
|
321108
|
+
this.toolbarItems.forEach((item) => {
|
|
321109
|
+
if (item.allowWithoutEditor?.value)
|
|
321110
|
+
this.#applyHeadlessState(item);
|
|
321111
|
+
});
|
|
320776
321112
|
return;
|
|
320777
321113
|
}
|
|
320778
321114
|
const { state } = this.activeEditor;
|
|
@@ -325368,11 +325704,13 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
325368
325704
|
this.onPaintSnapshotCallback = null;
|
|
325369
325705
|
this.mountedPageIndices = [];
|
|
325370
325706
|
this.resolvedLayout = null;
|
|
325707
|
+
this.showFormattingMarks = false;
|
|
325371
325708
|
this.options = options;
|
|
325372
325709
|
this.layoutMode = options.layoutMode ?? "vertical";
|
|
325373
325710
|
this.isSemanticFlow = (options.flowMode ?? "paginated") === "semantic";
|
|
325374
325711
|
this.headerProvider = options.headerProvider;
|
|
325375
325712
|
this.footerProvider = options.footerProvider;
|
|
325713
|
+
this.showFormattingMarks = options.showFormattingMarks === true;
|
|
325376
325714
|
const defaultGap = this.layoutMode === "horizontal" ? 20 : 24;
|
|
325377
325715
|
this.pageGap = typeof options.pageGap === "number" && Number.isFinite(options.pageGap) ? Math.max(0, options.pageGap) : defaultGap;
|
|
325378
325716
|
if (!this.isSemanticFlow && this.layoutMode === "vertical" && options.virtualization?.enabled) {
|
|
@@ -325389,10 +325727,33 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
325389
325727
|
}
|
|
325390
325728
|
this.onPaintSnapshotCallback = options.onPaintSnapshot ?? null;
|
|
325391
325729
|
}
|
|
325730
|
+
setShowFormattingMarks(showFormattingMarks) {
|
|
325731
|
+
const next2 = showFormattingMarks === true;
|
|
325732
|
+
if (this.showFormattingMarks === next2)
|
|
325733
|
+
return;
|
|
325734
|
+
this.showFormattingMarks = next2;
|
|
325735
|
+
this.applyFormattingMarksClass();
|
|
325736
|
+
this.invalidateRenderedContent();
|
|
325737
|
+
}
|
|
325392
325738
|
setProviders(header, footer) {
|
|
325393
325739
|
this.headerProvider = header;
|
|
325394
325740
|
this.footerProvider = footer;
|
|
325395
325741
|
}
|
|
325742
|
+
applyFormattingMarksClass(mount = this.mount) {
|
|
325743
|
+
mount?.classList.toggle("superdoc-show-formatting-marks", this.showFormattingMarks);
|
|
325744
|
+
}
|
|
325745
|
+
invalidateRenderedContent() {
|
|
325746
|
+
this.pageStates = [];
|
|
325747
|
+
this.currentLayout = null;
|
|
325748
|
+
this.pageIndexToState.clear();
|
|
325749
|
+
this.virtualMountedKey = "";
|
|
325750
|
+
this.clearGapSpacers();
|
|
325751
|
+
this.topSpacerEl = null;
|
|
325752
|
+
this.bottomSpacerEl = null;
|
|
325753
|
+
this.virtualPagesEl = null;
|
|
325754
|
+
this.processedLayoutVersion = -1;
|
|
325755
|
+
this.layoutVersion += 1;
|
|
325756
|
+
}
|
|
325396
325757
|
setVirtualizationPins(pageIndices) {
|
|
325397
325758
|
this.virtualPinnedPages = Array.from(new Set((pageIndices ?? []).filter((n) => Number.isInteger(n)))).sort((a2, b$1) => a2 - b$1);
|
|
325398
325759
|
if (this.virtualEnabled && this.mount)
|
|
@@ -325575,6 +325936,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
325575
325936
|
ensurePrintStyles(doc$12);
|
|
325576
325937
|
ensureLinkStyles(doc$12);
|
|
325577
325938
|
ensureTrackChangeStyles(doc$12);
|
|
325939
|
+
ensureFormattingMarksStyles(doc$12);
|
|
325578
325940
|
ensureFieldAnnotationStyles(doc$12);
|
|
325579
325941
|
ensureSdtContainerStyles(doc$12);
|
|
325580
325942
|
ensureImageSelectionStyles(doc$12);
|
|
@@ -325582,8 +325944,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
325582
325944
|
if (!this.isSemanticFlow && this.options.ruler?.enabled)
|
|
325583
325945
|
ensureRulerStyles(doc$12);
|
|
325584
325946
|
mount.classList.add(CLASS_NAMES$1.container);
|
|
325585
|
-
|
|
325947
|
+
this.applyFormattingMarksClass(mount);
|
|
325948
|
+
if (this.mount && this.mount !== mount) {
|
|
325586
325949
|
this.resetState();
|
|
325950
|
+
this.applyFormattingMarksClass(mount);
|
|
325951
|
+
}
|
|
325587
325952
|
this.layoutVersion += 1;
|
|
325588
325953
|
this.layoutEpoch = resolvedLayout.layoutEpoch ?? 0;
|
|
325589
325954
|
this.mount = mount;
|
|
@@ -326574,7 +326939,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
326574
326939
|
const resolvedMarker = content3.marker;
|
|
326575
326940
|
const expandedRunsForBlock = expandRunsForInlineNewlines(block.runs);
|
|
326576
326941
|
content3.lines.forEach((resolvedLine) => {
|
|
326577
|
-
const
|
|
326942
|
+
const paragraphMarkLeftOffset = this.resolveResolvedListParagraphMarkOffset(resolvedLine.isListFirstLine ? resolvedMarker : undefined, fragment2.markerTextWidth, resolvedLine.indentOffset);
|
|
326943
|
+
const lineEl = this.renderLine(block, resolvedLine.line, context, resolvedLine.availableWidth, resolvedLine.lineIndex, resolvedLine.skipJustify, expandedRunsForBlock, resolvedLine.resolvedListTextStartPx, resolvedLine.indentOffset, paragraphMarkLeftOffset);
|
|
326578
326944
|
if (!resolvedLine.isListFirstLine) {
|
|
326579
326945
|
if (resolvedLine.paddingLeftPx > 0)
|
|
326580
326946
|
lineEl.style.paddingLeft = `${resolvedLine.paddingLeftPx}px`;
|
|
@@ -326619,15 +326985,17 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
326619
326985
|
markerContainer.appendChild(markerEl);
|
|
326620
326986
|
if (resolvedMarker.suffix === "tab") {
|
|
326621
326987
|
const tabEl = this.doc.createElement("span");
|
|
326622
|
-
tabEl.
|
|
326988
|
+
tabEl.classList.add("superdoc-tab", "superdoc-marker-suffix-tab");
|
|
326623
326989
|
tabEl.innerHTML = " ";
|
|
326624
326990
|
tabEl.style.display = "inline-block";
|
|
326991
|
+
tabEl.style.fontSize = `${resolvedMarker.run.fontSize}px`;
|
|
326625
326992
|
tabEl.style.wordSpacing = "0px";
|
|
326626
326993
|
tabEl.style.width = `${resolvedMarker.suffixWidthPx}px`;
|
|
326627
326994
|
lineEl.prepend(tabEl);
|
|
326628
326995
|
} else if (resolvedMarker.suffix === "space") {
|
|
326629
326996
|
const spaceEl = this.doc.createElement("span");
|
|
326630
326997
|
spaceEl.classList.add("superdoc-marker-suffix-space");
|
|
326998
|
+
spaceEl.style.fontSize = `${resolvedMarker.run.fontSize}px`;
|
|
326631
326999
|
spaceEl.style.wordSpacing = "0px";
|
|
326632
327000
|
spaceEl.textContent = " ";
|
|
326633
327001
|
lineEl.prepend(spaceEl);
|
|
@@ -326758,15 +327126,17 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
326758
327126
|
const suffix = marker.suffix ?? "tab";
|
|
326759
327127
|
if (suffix === "tab") {
|
|
326760
327128
|
const tabEl = this.doc.createElement("span");
|
|
326761
|
-
tabEl.
|
|
327129
|
+
tabEl.classList.add("superdoc-tab", "superdoc-marker-suffix-tab");
|
|
326762
327130
|
tabEl.innerHTML = " ";
|
|
326763
327131
|
tabEl.style.display = "inline-block";
|
|
327132
|
+
tabEl.style.fontSize = `${marker.run.fontSize}px`;
|
|
326764
327133
|
tabEl.style.wordSpacing = "0px";
|
|
326765
327134
|
tabEl.style.width = `${listTabWidth}px`;
|
|
326766
327135
|
lineEl.prepend(tabEl);
|
|
326767
327136
|
} else if (suffix === "space") {
|
|
326768
327137
|
const spaceEl = this.doc.createElement("span");
|
|
326769
327138
|
spaceEl.classList.add("superdoc-marker-suffix-space");
|
|
327139
|
+
spaceEl.style.fontSize = `${marker.run.fontSize}px`;
|
|
326770
327140
|
spaceEl.style.wordSpacing = "0px";
|
|
326771
327141
|
spaceEl.textContent = " ";
|
|
326772
327142
|
lineEl.prepend(spaceEl);
|
|
@@ -327978,6 +328348,87 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
327978
328348
|
wrapper.dataset.pmEnd = String(run2.pmEnd);
|
|
327979
328349
|
return wrapper;
|
|
327980
328350
|
}
|
|
328351
|
+
setTextContentWithFormattingSpaceMarks(element3, text5) {
|
|
328352
|
+
if (!this.showFormattingMarks || !text5.includes(" ") || !this.doc) {
|
|
328353
|
+
element3.textContent = text5;
|
|
328354
|
+
return;
|
|
328355
|
+
}
|
|
328356
|
+
element3.textContent = "";
|
|
328357
|
+
let chunkStart = 0;
|
|
328358
|
+
for (let index2 = 0;index2 < text5.length; index2 += 1) {
|
|
328359
|
+
if (text5[index2] !== " ")
|
|
328360
|
+
continue;
|
|
328361
|
+
if (index2 > chunkStart)
|
|
328362
|
+
element3.appendChild(this.doc.createTextNode(text5.slice(chunkStart, index2)));
|
|
328363
|
+
const space = this.doc.createElement("span");
|
|
328364
|
+
space.classList.add("superdoc-formatting-space-mark");
|
|
328365
|
+
space.textContent = " ";
|
|
328366
|
+
element3.appendChild(space);
|
|
328367
|
+
chunkStart = index2 + 1;
|
|
328368
|
+
}
|
|
328369
|
+
if (chunkStart < text5.length)
|
|
328370
|
+
element3.appendChild(this.doc.createTextNode(text5.slice(chunkStart)));
|
|
328371
|
+
}
|
|
328372
|
+
findLastTextRun(runs2) {
|
|
328373
|
+
for (let index2 = runs2.length - 1;index2 >= 0; index2 -= 1) {
|
|
328374
|
+
const run2 = runs2[index2];
|
|
328375
|
+
if (run2 && (run2.kind === "text" || run2.kind === undefined) && "text" in run2)
|
|
328376
|
+
return {
|
|
328377
|
+
run: run2,
|
|
328378
|
+
index: index2
|
|
328379
|
+
};
|
|
328380
|
+
}
|
|
328381
|
+
return null;
|
|
328382
|
+
}
|
|
328383
|
+
appendFormattingParagraphMark(lineEl, line, runs2, leftOffsetPx, availableWidth, hasExplicitPositioning) {
|
|
328384
|
+
if (!this.showFormattingMarks || !this.doc)
|
|
328385
|
+
return;
|
|
328386
|
+
const lastRun = runs2.length > 0 ? runs2[runs2.length - 1] : null;
|
|
328387
|
+
if (lastRun) {
|
|
328388
|
+
const lastRunIndex = runs2.length - 1;
|
|
328389
|
+
if (line.toRun < lastRunIndex)
|
|
328390
|
+
return;
|
|
328391
|
+
if (line.toRun === lastRunIndex && (lastRun.kind === "text" || lastRun.kind === undefined) && "text" in lastRun && line.toChar < lastRun.text.length)
|
|
328392
|
+
return;
|
|
328393
|
+
}
|
|
328394
|
+
const lastTextRun = this.findLastTextRun(runs2);
|
|
328395
|
+
const mark2 = this.doc.createElement("span");
|
|
328396
|
+
mark2.classList.add("superdoc-formatting-paragraph-mark");
|
|
328397
|
+
mark2.setAttribute("aria-hidden", "true");
|
|
328398
|
+
mark2.textContent = "¶";
|
|
328399
|
+
const run2 = lastTextRun?.run;
|
|
328400
|
+
if (run2) {
|
|
328401
|
+
if (run2.fontFamily)
|
|
328402
|
+
mark2.style.fontFamily = toCssFontFamily(run2.fontFamily) ?? run2.fontFamily;
|
|
328403
|
+
if (typeof run2.fontSize === "number")
|
|
328404
|
+
mark2.style.fontSize = `${run2.fontSize}px`;
|
|
328405
|
+
if (run2.bold)
|
|
328406
|
+
mark2.style.fontWeight = "bold";
|
|
328407
|
+
if (run2.italic)
|
|
328408
|
+
mark2.style.fontStyle = "italic";
|
|
328409
|
+
if (run2.letterSpacing != null)
|
|
328410
|
+
mark2.style.letterSpacing = `${run2.letterSpacing}px`;
|
|
328411
|
+
}
|
|
328412
|
+
mark2.style.lineHeight = `${line.lineHeight}px`;
|
|
328413
|
+
const lineWidth = line.naturalWidth ?? line.width ?? 0;
|
|
328414
|
+
const alignmentSlack = Math.max(0, availableWidth - lineWidth);
|
|
328415
|
+
const textAlign = lineEl.style.textAlign;
|
|
328416
|
+
const alignmentOffset = !hasExplicitPositioning && textAlign === "center" ? alignmentSlack / 2 : !hasExplicitPositioning && textAlign === "right" ? alignmentSlack : 0;
|
|
328417
|
+
const visualTextEndOffset = lineEl.dir === "rtl" || lineEl.style.direction === "rtl" ? alignmentOffset : alignmentOffset + lineWidth;
|
|
328418
|
+
mark2.style.left = `${Math.max(0, leftOffsetPx + visualTextEndOffset)}px`;
|
|
328419
|
+
lineEl.appendChild(mark2);
|
|
328420
|
+
}
|
|
328421
|
+
resolveResolvedListParagraphMarkOffset(marker, markerTextWidth, fallbackOffset) {
|
|
328422
|
+
if (typeof fallbackOffset === "number" && Number.isFinite(fallbackOffset) && fallbackOffset > 0)
|
|
328423
|
+
return fallbackOffset;
|
|
328424
|
+
if (!marker || marker.vanish)
|
|
328425
|
+
return fallbackOffset;
|
|
328426
|
+
const paddingLeft = Number.isFinite(marker.firstLinePaddingLeftPx) ? marker.firstLinePaddingLeftPx : 0;
|
|
328427
|
+
const suffixWidth = marker.suffix !== "nothing" && Number.isFinite(marker.suffixWidthPx) ? marker.suffixWidthPx : 0;
|
|
328428
|
+
if (marker.justification === "left")
|
|
328429
|
+
return paddingLeft + (typeof markerTextWidth === "number" && Number.isFinite(markerTextWidth) && markerTextWidth > 0 ? markerTextWidth : 0) + suffixWidth;
|
|
328430
|
+
return paddingLeft + (marker.justification === "center" && Number.isFinite(marker.centerPaddingAdjustPx) ? marker.centerPaddingAdjustPx ?? 0 : 0) + suffixWidth;
|
|
328431
|
+
}
|
|
327981
328432
|
renderRun(run2, context, trackedConfig) {
|
|
327982
328433
|
if (this.isImageRun(run2))
|
|
327983
328434
|
return this.renderImageRun(run2);
|
|
@@ -327995,7 +328446,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
327995
328446
|
const isActiveLink = !!(linkData && !linkData.blocked && linkData.href);
|
|
327996
328447
|
const elem = isActiveLink ? this.doc.createElement("a") : this.doc.createElement("span");
|
|
327997
328448
|
const text5 = resolveRunText(run2, context);
|
|
327998
|
-
elem
|
|
328449
|
+
this.setTextContentWithFormattingSpaceMarks(elem, text5);
|
|
327999
328450
|
if (linkData?.dataset)
|
|
328000
328451
|
applyLinkDataset(elem, linkData.dataset);
|
|
328001
328452
|
if (linkData?.blocked) {
|
|
@@ -328354,7 +328805,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
328354
328805
|
this.applySdtDataset(annotation, run2.sdt);
|
|
328355
328806
|
return annotation;
|
|
328356
328807
|
}
|
|
328357
|
-
renderLine(block, line, context, availableWidthOverride, lineIndex, skipJustify, preExpandedRuns, resolvedListTextStartPx, indentOffsetOverride) {
|
|
328808
|
+
renderLine(block, line, context, availableWidthOverride, lineIndex, skipJustify, preExpandedRuns, resolvedListTextStartPx, indentOffsetOverride, paragraphMarkLeftOffsetOverride) {
|
|
328358
328809
|
if (!this.doc)
|
|
328359
328810
|
throw new Error("DomPainter: document is not available");
|
|
328360
328811
|
const expandedBlock = {
|
|
@@ -328569,25 +329020,27 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
328569
329020
|
spaceCount,
|
|
328570
329021
|
shouldJustify: justifyShouldApply
|
|
328571
329022
|
});
|
|
329023
|
+
const resolveLineIndentOffset = () => {
|
|
329024
|
+
if (indentOffsetOverride != null)
|
|
329025
|
+
return indentOffsetOverride;
|
|
329026
|
+
const paraIndent = block.attrs?.indent;
|
|
329027
|
+
const indentLeft = paraIndent?.left ?? 0;
|
|
329028
|
+
const firstLine = paraIndent?.firstLine ?? 0;
|
|
329029
|
+
const hanging = paraIndent?.hanging ?? 0;
|
|
329030
|
+
const isFirstLineOfPara = lineIndex === 0 || lineIndex === undefined;
|
|
329031
|
+
const firstLineOffsetForCumX = isFirstLineOfPara ? firstLine - hanging : 0;
|
|
329032
|
+
const wordLayoutValue = block.attrs?.wordLayout;
|
|
329033
|
+
const wordLayout = isMinimalWordLayout$1(wordLayoutValue) ? wordLayoutValue : undefined;
|
|
329034
|
+
const isListParagraph$1 = Boolean(wordLayout?.marker);
|
|
329035
|
+
const fallbackListTextStartPx = typeof wordLayout?.marker?.textStartX === "number" && Number.isFinite(wordLayout.marker.textStartX) ? wordLayout.marker.textStartX : typeof wordLayout?.textStartPx === "number" && Number.isFinite(wordLayout.textStartPx) ? wordLayout.textStartPx : undefined;
|
|
329036
|
+
return isListParagraph$1 ? isFirstLineOfPara ? resolvedListTextStartPx ?? fallbackListTextStartPx ?? indentLeft : indentLeft : indentLeft + firstLineOffsetForCumX;
|
|
329037
|
+
};
|
|
329038
|
+
const lineTextStartOffsetPx = paragraphMarkLeftOffsetOverride != null ? paragraphMarkLeftOffsetOverride : resolveLineIndentOffset();
|
|
329039
|
+
const paragraphMarkLeftOffsetPx = lineTextStartOffsetPx;
|
|
328572
329040
|
if (spacingPerSpace !== 0)
|
|
328573
329041
|
el.style.wordSpacing = `${spacingPerSpace}px`;
|
|
328574
329042
|
if (shouldUseSegmentPositioning(hasExplicitPositioning ?? false, Boolean(line.segments), isRtl)) {
|
|
328575
|
-
|
|
328576
|
-
if (indentOffsetOverride != null)
|
|
328577
|
-
indentOffset = indentOffsetOverride;
|
|
328578
|
-
else {
|
|
328579
|
-
const paraIndent = block.attrs?.indent;
|
|
328580
|
-
const indentLeft = paraIndent?.left ?? 0;
|
|
328581
|
-
const firstLine = paraIndent?.firstLine ?? 0;
|
|
328582
|
-
const hanging = paraIndent?.hanging ?? 0;
|
|
328583
|
-
const isFirstLineOfPara = lineIndex === 0 || lineIndex === undefined;
|
|
328584
|
-
const firstLineOffsetForCumX = isFirstLineOfPara ? firstLine - hanging : 0;
|
|
328585
|
-
const wordLayoutValue = block.attrs?.wordLayout;
|
|
328586
|
-
const wordLayout = isMinimalWordLayout$1(wordLayoutValue) ? wordLayoutValue : undefined;
|
|
328587
|
-
const isListParagraph = Boolean(wordLayout?.marker);
|
|
328588
|
-
const fallbackListTextStartPx = typeof wordLayout?.marker?.textStartX === "number" && Number.isFinite(wordLayout.marker.textStartX) ? wordLayout.marker.textStartX : typeof wordLayout?.textStartPx === "number" && Number.isFinite(wordLayout.textStartPx) ? wordLayout.textStartPx : undefined;
|
|
328589
|
-
indentOffset = isListParagraph ? isFirstLineOfPara ? resolvedListTextStartPx ?? fallbackListTextStartPx ?? indentLeft : indentLeft : indentLeft + firstLineOffsetForCumX;
|
|
328590
|
-
}
|
|
329043
|
+
const indentOffset = lineTextStartOffsetPx;
|
|
328591
329044
|
let cumulativeX = 0;
|
|
328592
329045
|
const segments = line.segments;
|
|
328593
329046
|
const segmentsByRun = /* @__PURE__ */ new Map;
|
|
@@ -328833,6 +329286,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
328833
329286
|
});
|
|
328834
329287
|
closeCurrentWrapper();
|
|
328835
329288
|
}
|
|
329289
|
+
this.appendFormattingParagraphMark(el, line, expandedBlock.runs, paragraphMarkLeftOffsetPx, availableWidth, hasExplicitPositioning ?? false);
|
|
328836
329290
|
el.querySelectorAll("a[href]").forEach((anchor) => {
|
|
328837
329291
|
const pendingTooltip = this.pendingTooltips.get(anchor);
|
|
328838
329292
|
if (pendingTooltip) {
|
|
@@ -330464,7 +330918,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
330464
330918
|
emitCommentPositionsInViewing: options.layoutEngineOptions?.emitCommentPositionsInViewing,
|
|
330465
330919
|
enableCommentsInViewing: options.layoutEngineOptions?.enableCommentsInViewing,
|
|
330466
330920
|
presence: validatedPresence,
|
|
330467
|
-
showBookmarks: options.layoutEngineOptions?.showBookmarks ?? false
|
|
330921
|
+
showBookmarks: options.layoutEngineOptions?.showBookmarks ?? false,
|
|
330922
|
+
showFormattingMarks: options.layoutEngineOptions?.showFormattingMarks ?? false
|
|
330468
330923
|
};
|
|
330469
330924
|
this.#trackedChangesOverrides = options.layoutEngineOptions?.trackedChanges;
|
|
330470
330925
|
this.#viewportHost = doc$12.createElement("div");
|
|
@@ -331686,6 +332141,47 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
331686
332141
|
this.#pendingDocChange = true;
|
|
331687
332142
|
this.#scheduleRerender();
|
|
331688
332143
|
}
|
|
332144
|
+
setShowFormattingMarks(showFormattingMarks) {
|
|
332145
|
+
const next2 = !!showFormattingMarks;
|
|
332146
|
+
if (this.#layoutOptions.showFormattingMarks === next2)
|
|
332147
|
+
return;
|
|
332148
|
+
this.#layoutOptions.showFormattingMarks = next2;
|
|
332149
|
+
this.#painterAdapter.setShowFormattingMarks(next2);
|
|
332150
|
+
if (!this.#repaintCurrentLayout()) {
|
|
332151
|
+
this.#pendingDocChange = true;
|
|
332152
|
+
this.#scheduleRerender();
|
|
332153
|
+
}
|
|
332154
|
+
}
|
|
332155
|
+
#repaintCurrentLayout() {
|
|
332156
|
+
const layout = this.#layoutState.layout;
|
|
332157
|
+
if (!layout)
|
|
332158
|
+
return false;
|
|
332159
|
+
const blocks2 = this.#layoutLookupBlocks.length > 0 ? this.#layoutLookupBlocks : this.#layoutState.blocks;
|
|
332160
|
+
const measures = this.#layoutLookupMeasures.length > 0 ? this.#layoutLookupMeasures : this.#layoutState.measures;
|
|
332161
|
+
if (blocks2.length === 0 || blocks2.length !== measures.length)
|
|
332162
|
+
return false;
|
|
332163
|
+
const resolvedLayout = resolveLayout({
|
|
332164
|
+
layout,
|
|
332165
|
+
flowMode: this.#layoutOptions.flowMode ?? "paginated",
|
|
332166
|
+
blocks: blocks2,
|
|
332167
|
+
measures
|
|
332168
|
+
});
|
|
332169
|
+
const isSemanticFlow = this.#layoutOptions.flowMode === "semantic";
|
|
332170
|
+
this.#ensurePainter();
|
|
332171
|
+
if (!isSemanticFlow)
|
|
332172
|
+
this.#painterAdapter.setProviders(this.#headerFooterSession?.headerDecorationProvider, this.#headerFooterSession?.footerDecorationProvider);
|
|
332173
|
+
this.#domIndexObserverManager?.pause();
|
|
332174
|
+
try {
|
|
332175
|
+
this.#painterAdapter.paint({ resolvedLayout }, this.#painterHost);
|
|
332176
|
+
this.#refreshEditorDomAugmentations();
|
|
332177
|
+
} finally {
|
|
332178
|
+
this.#domIndexObserverManager?.resume();
|
|
332179
|
+
}
|
|
332180
|
+
this.#revalidateScrollContainer();
|
|
332181
|
+
this.#updatePermissionOverlay();
|
|
332182
|
+
this.#applyZoom();
|
|
332183
|
+
return true;
|
|
332184
|
+
}
|
|
331689
332185
|
hitTest(clientX, clientY) {
|
|
331690
332186
|
const normalized = this.#normalizeClientPoint(clientX, clientY);
|
|
331691
332187
|
if (!normalized)
|
|
@@ -333821,7 +334317,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
333821
334317
|
headerProvider: this.#headerFooterSession?.headerDecorationProvider,
|
|
333822
334318
|
footerProvider: this.#headerFooterSession?.footerDecorationProvider,
|
|
333823
334319
|
ruler: this.#layoutOptions.ruler,
|
|
333824
|
-
pageGap: this.#layoutState.layout?.pageGap ?? effectiveGap
|
|
334320
|
+
pageGap: this.#layoutState.layout?.pageGap ?? effectiveGap,
|
|
334321
|
+
showFormattingMarks: this.#layoutOptions.showFormattingMarks ?? false
|
|
333825
334322
|
});
|
|
333826
334323
|
const currentZoom = this.#layoutOptions.zoom ?? 1;
|
|
333827
334324
|
if (currentZoom !== 1)
|
|
@@ -336303,11 +336800,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
336303
336800
|
];
|
|
336304
336801
|
});
|
|
336305
336802
|
|
|
336306
|
-
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-
|
|
336803
|
+
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-BTCvkLyW.es.js
|
|
336307
336804
|
var MOD_ALIASES, ALT_ALIASES, CTRL_ALIASES, SHIFT_ALIASES, BUILTIN_CONTEXT_MENU_GROUPS, BUILTIN_GROUP_ORDER, RESERVED_PROXY_PROPERTY_NAMES, ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS;
|
|
336308
|
-
var
|
|
336309
|
-
|
|
336310
|
-
|
|
336805
|
+
var init_create_super_doc_ui_BTCvkLyW_es = __esm(() => {
|
|
336806
|
+
init_SuperConverter_BLL9JGke_es();
|
|
336807
|
+
init_create_headless_toolbar_D7n_Okb2_es();
|
|
336311
336808
|
MOD_ALIASES = new Set([
|
|
336312
336809
|
"Mod",
|
|
336313
336810
|
"Meta",
|
|
@@ -336349,16 +336846,16 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
|
|
|
336349
336846
|
|
|
336350
336847
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
336351
336848
|
var init_super_editor_es = __esm(() => {
|
|
336352
|
-
|
|
336353
|
-
|
|
336849
|
+
init_src_C4h4xIas_es();
|
|
336850
|
+
init_SuperConverter_BLL9JGke_es();
|
|
336354
336851
|
init_jszip_C49i9kUs_es();
|
|
336355
336852
|
init_xml_js_CqGKpaft_es();
|
|
336356
|
-
|
|
336853
|
+
init_create_headless_toolbar_D7n_Okb2_es();
|
|
336357
336854
|
init_constants_DrU4EASo_es();
|
|
336358
336855
|
init_dist_B8HfvhaK_es();
|
|
336359
336856
|
init_unified_Dsuw2be5_es();
|
|
336360
336857
|
init_DocxZipper_CUX64E5K_es();
|
|
336361
|
-
|
|
336858
|
+
init_create_super_doc_ui_BTCvkLyW_es();
|
|
336362
336859
|
init_ui_CGB3qmy3_es();
|
|
336363
336860
|
init_eventemitter3_UwU_CLPU_es();
|
|
336364
336861
|
init_errors_C_DoKMoN_es();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/cli",
|
|
3
|
-
"version": "0.8.0-next.
|
|
3
|
+
"version": "0.8.0-next.78",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superdoc": "./dist/index.js"
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
|
-
"@superdoc-dev/cli-darwin-arm64": "0.8.0-next.
|
|
38
|
-
"@superdoc-dev/cli-darwin-x64": "0.8.0-next.
|
|
39
|
-
"@superdoc-dev/cli-linux-x64": "0.8.0-next.
|
|
40
|
-
"@superdoc-dev/cli-windows-x64": "0.8.0-next.
|
|
41
|
-
"@superdoc-dev/cli-linux-arm64": "0.8.0-next.
|
|
37
|
+
"@superdoc-dev/cli-darwin-arm64": "0.8.0-next.78",
|
|
38
|
+
"@superdoc-dev/cli-darwin-x64": "0.8.0-next.78",
|
|
39
|
+
"@superdoc-dev/cli-linux-x64": "0.8.0-next.78",
|
|
40
|
+
"@superdoc-dev/cli-windows-x64": "0.8.0-next.78",
|
|
41
|
+
"@superdoc-dev/cli-linux-arm64": "0.8.0-next.78"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"predev": "node scripts/ensure-superdoc-build.js",
|