@a3s-lab/office 0.30.0 → 0.31.0
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/README.md +22 -5
- package/dist/{0~7231.js → 0~4808.js} +189 -2
- package/dist/0~5050.js +10 -1
- package/dist/{0~7360.js → 0~7240.js} +244 -15
- package/dist/0~document-editor.js +622 -125
- package/dist/0~work-docx-export.js +214 -26
- package/dist/0~work-docx-import.js +17 -6
- package/dist/0~work-office-diagnostics.js +25 -4
- package/dist/4104.js +1 -1
- package/dist/4121.js +412 -11
- package/dist/6282.js +431 -2
- package/dist/internal/features/work/editors/document-command-catalog.d.ts +27 -0
- package/dist/internal/features/work/editors/document-dom-selection.d.ts +7 -0
- package/dist/internal/features/work/editors/document-editor-support.d.ts +1 -0
- package/dist/internal/features/work/editors/document-index-dialog.d.ts +10 -0
- package/dist/internal/features/work/editors/document-index-entry-dialog.d.ts +10 -0
- package/dist/internal/features/work/editors/document-references-ribbon.d.ts +19 -0
- package/dist/internal/features/work/editors/document-toolbar.d.ts +4 -1
- package/dist/internal/features/work/editors/use-document-insert-commands.d.ts +3 -0
- package/dist/internal/features/work/work-document-index-fields.d.ts +19 -0
- package/dist/internal/features/work/work-document-index-nodes.d.ts +32 -0
- package/dist/internal/features/work/work-document-index.d.ts +63 -0
- package/dist/internal/features/work/work-docx-import.d.ts +3 -1
- package/dist/internal/features/work/work-docx-index-export.d.ts +14 -0
- package/dist/internal/features/work/work-docx-index-import.d.ts +23 -0
- package/dist/office-kernel.wasm +0 -0
- package/dist/styles.css +296 -0
- package/docs/latest/en/browser-editor-architecture.md +14 -0
- package/package.json +4 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import jszip from "jszip";
|
|
2
2
|
import { normalizeDocumentBookmarkName, normalizeDocumentEmphasisMark, DOCUMENT_STRIKE_STYLE_ATTRIBUTE, applyDocumentImageIdentityToElement, documentEmphasisMarkFromElement, DOCUMENT_PAGE_BORDER_EDGES, DOCUMENT_UNDERLINE_STYLE_ATTRIBUTE, createDocumentImageIdentityRegistry, normalizeDocumentColumns, normalizeDocumentTableVerticalAlign, normalizeDocumentTextCase, documentCharacterSpacingTwipsFromElement, documentCharacterPositionHalfPointsFromElement, documentTableColumnPercentagesFromElement, documentTableCellMarginOverridesFromElement, applyDocumentTableRowIdentityToElement, normalizeDocumentBookmarksHtml, documentImageIdentityFromElement, documentTableGeometryFromElement, normalizeDocumentTableRowHeightRule, documentNoteKey, DOCUMENT_LEGACY_TEXT_EMBOSS_ATTRIBUTE, normalizeDocumentHiddenText, documentLegacyTextEffectsConflict, normalizeDocumentTableBorderWidth, normalizeDocumentCharacterSpacingTwips, documentStrikeFormattingFromElement, normalizeDocumentTableBorderStyle, normalizeDocumentBookmarkReferencesHtml, documentCitationInstruction, documentImageWrapContourFromElement, documentImagePositionFromElement, normalizeDocumentCharacterScalePercent, normalizeDocumentUnderlineStyle, normalizeDocumentPageChrome, documentPageMarginsForLayout, normalizeDocumentImageLayer, documentKerningThresholdHalfPointsFromElement, documentImageCropFromElement, documentBookmarkReferenceInstruction, normalizeDocumentPageBorders, documentImageLayerFromElement, normalizeDocumentLegacyTextEffects, documentCaptionLabel, documentCaptionKind, DOCUMENT_LEGACY_TEXT_IMPRINT_ATTRIBUTE, isContourImageLayout, normalizeDocumentImageIdentity, normalizeTableColor, normalizeDocumentStrikeStyle, documentTableBordersFromElement, documentSections, documentCitationTags, docxDocumentFieldKind, wrapsBesideImage, normalizeDocumentCharacterPositionHalfPoints, normalizeDocumentKerningThresholdHalfPoints, defaultDocumentImageWrapContour, normalizeDocumentPaperSource, DOCUMENT_LEGACY_TEXT_OUTLINE_ATTRIBUTE, documentEquationFromElement, documentLegacyTextEffectsFromElement, parseDocumentCharacterFormatting, documentUnderlineFormattingFromElement, DOCUMENT_LEGACY_TEXT_SHADOW_ATTRIBUTE, normalizeDocumentEquation, parseDocumentParagraphFormatting, documentTableRowIdentityFromElement, normalizeDocumentBookmarkNativeId, collectDocumentNotes, DOCUMENT_PAGE_MARGIN_KEYS, uniqueDocumentImageIdentity, documentHiddenTextFromElement, documentImageLayoutFromElement, documentPageHorizontalMarginTwips, documentPageGeometryForLayout, DOCUMENT_LEGACY_TEXT_EFFECT_NAMES, documentCharacterScalePercentFromElement, normalizeDocumentPageMargins, normalizeDocumentLegacyTextEffect, documentNoteKind } from "./6282.js";
|
|
3
|
-
import { normalizeDocumentRunBorder, parseDocumentScriptFonts,
|
|
3
|
+
import { normalizeDocumentRunBorder, parseDocumentScriptFonts, normalizeDocumentIndexesHtml, parseXml, parseDocumentRunShading, applyDocumentParagraphIdentityToElement, DOCUMENT_RUN_SHADING_ATTRIBUTE, documentScriptFontSlotFromElement, DOCUMENT_HIGHLIGHT_ATTRIBUTE, parseDocxThemeReference, serializeDocumentScriptFonts, attribute as work_ooxml_package_attribute, createDocumentParagraphIdentityRegistry, uniqueDocumentParagraphIdentity, DOCUMENT_NO_PROOF_ATTRIBUTE, documentHighlightForCssColor, directChildren, documentTableOfContentsValueFromElement, DOCUMENT_PROOFING_LANGUAGES_ATTRIBUTE, DocxThemePatchCollector, normalizeDocumentScriptFonts, normalizeDocumentParagraphIdentity, normalizeDocumentHighlight, normalizeDocumentParagraphBorders, serializeUtf8Xml, DOCUMENT_PARAGRAPH_BORDER_EDGES, parseDocumentRunBorder, normalizeDocumentNoProof, decodeXmlBytes, documentParagraphIdentityFromElement, normalizeDocumentParagraphId, documentIndexValueFromElement, descendants, resolvePartTarget, documentProofingLanguagesFromElement, documentScriptFontFamily, parseDocumentRunShadingElement, parseDocumentProofingLanguages, documentHighlightFromElement, parseDocumentParagraphBordersElement, DOCUMENT_RUN_BORDER_ATTRIBUTE, parseDocumentRunBorderElement, xmlNamespacePrefix, documentScriptFontSlotFromHint, documentNoProofFromElement, documentScriptFontsFromElement, normalizeDocumentRunShading, documentIndexEntryFromElement, directChild, normalizeDocumentScriptFontSlot, patchDocxThemeReferences, parseDocumentParagraphShadingElement, documentFontNameFromCssFamily } from "./4121.js";
|
|
4
4
|
import { assignDocxNoteIds, patchDocxPageColor, normalizeDocxCommentId, assignDocxCommentThreads } from "./0~4980.js";
|
|
5
|
-
import { paragraphTabStops, mergeDocxIgnorableExtensionsAtPairs, patchDocxBibliography, docxKerningThresholdValue, docxCharacterPositionValue,
|
|
5
|
+
import { paragraphTabStops, mergeDocxIgnorableExtensionsAtPairs, patchDocxBibliography, docxKerningThresholdValue, docxCharacterPositionValue, documentIndexInstruction, docxCharacterScaleValue, XMLNS_NAMESPACE as work_docx_settings_xml_XMLNS_NAMESPACE, paragraphAlignment, xmlNamespaceUri, paragraphSpacingOptions, docxEmphasisMarkRunOptions, documentIndexEntryInstruction, hasNonWhitespaceXmlText, patchDocxExplicitZeroCharacterSpacing, cloneXmlElement, cssColorToHex, xmlDeclaredPrefix, assertXmlRoot, DOCX_WORDPROCESSING_NAMESPACES, paragraphIndent, domDirection, xmlAttributeNamespace, paragraphBidirectional, XML_NAMESPACE as work_docx_settings_xml_XML_NAMESPACE, mergeDocxIgnorableExtensions, DocxParagraphDefaultCollapsedPatchCollector, dataBoolean, patchDocxParagraphDefaultCollapsed, patchDocxExplicitZeroKerningThresholds, parseDocxColorSchemeMappingElement, paragraphPaginationOptions, DOCX_COLOR_SCHEME_MAPPING_ATTRIBUTES, documentProofingLanguageDocxOptions, xmlAttributeLocalName, cssFontSize, paragraphDirectionOptions, cssFontFamily, docxCharacterSpacingValue } from "./0~4808.js";
|
|
6
6
|
import { normalizeDocumentHref } from "./0~work-document-links.js";
|
|
7
7
|
const WORD_NAMESPACE = 'http://schemas.openxmlformats.org/wordprocessingml/2006/main';
|
|
8
8
|
class DocxBookmarkPatchCollector {
|
|
@@ -2374,6 +2374,185 @@ function docxDocumentFieldRun(element, docx) {
|
|
|
2374
2374
|
if (!docxDocumentFieldKind(instruction)) return new docx.TextRun(display);
|
|
2375
2375
|
return new docx.SimpleField(instruction, display);
|
|
2376
2376
|
}
|
|
2377
|
+
const work_docx_index_export_WORD_NAMESPACE = 'http://schemas.openxmlformats.org/wordprocessingml/2006/main';
|
|
2378
|
+
const work_docx_index_export_XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
|
|
2379
|
+
class DocxIndexPatchCollector {
|
|
2380
|
+
patches = [];
|
|
2381
|
+
add(element) {
|
|
2382
|
+
const value = documentIndexValueFromElement(element);
|
|
2383
|
+
const patch = {
|
|
2384
|
+
marker: `__A3S_WORK_DOCUMENT_INDEX_${this.patches.length + 1}__`,
|
|
2385
|
+
options: value.options,
|
|
2386
|
+
entries: value.entries
|
|
2387
|
+
};
|
|
2388
|
+
this.patches.push(patch);
|
|
2389
|
+
return patch;
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
function docxDocumentIndex(element, docx, collector) {
|
|
2393
|
+
const patch = collector.add(element);
|
|
2394
|
+
return [
|
|
2395
|
+
new docx.Paragraph({
|
|
2396
|
+
children: [
|
|
2397
|
+
new docx.TextRun(patch.marker)
|
|
2398
|
+
]
|
|
2399
|
+
})
|
|
2400
|
+
];
|
|
2401
|
+
}
|
|
2402
|
+
function docxIndexEntryRun(element, docx) {
|
|
2403
|
+
const value = documentIndexEntryFromElement(element);
|
|
2404
|
+
return value ? new docx.SimpleField(documentIndexEntryInstruction(value)) : null;
|
|
2405
|
+
}
|
|
2406
|
+
async function patchDocxIndexes(buffer, patches) {
|
|
2407
|
+
if (!patches.length) return buffer;
|
|
2408
|
+
const archive = await jszip.loadAsync(buffer);
|
|
2409
|
+
const entry = archive.file('word/document.xml');
|
|
2410
|
+
if (!entry) return buffer;
|
|
2411
|
+
const document = parseXml(await entry.async('text'), 'generated DOCX word/document.xml');
|
|
2412
|
+
const paragraphs = descendants(document, 'p');
|
|
2413
|
+
for (const patch of patches){
|
|
2414
|
+
const paragraph = paragraphs.find((candidate)=>descendants(candidate, 't').some((text)=>(text.textContent ?? '').includes(patch.marker)));
|
|
2415
|
+
if (!paragraph) throw new Error(`Generated DOCX did not emit the marker for document index ${patch.marker}.`);
|
|
2416
|
+
paragraph.replaceWith(createIndexContentControl(document, patch));
|
|
2417
|
+
}
|
|
2418
|
+
archive.file('word/document.xml', new XMLSerializer().serializeToString(document));
|
|
2419
|
+
return archive.generateAsync({
|
|
2420
|
+
type: 'arraybuffer'
|
|
2421
|
+
});
|
|
2422
|
+
}
|
|
2423
|
+
function createIndexContentControl(document, patch) {
|
|
2424
|
+
const control = wordElement(document, 'sdt');
|
|
2425
|
+
const properties = wordElement(document, 'sdtPr');
|
|
2426
|
+
const documentPart = wordElement(document, 'docPartObj');
|
|
2427
|
+
const gallery = wordElement(document, 'docPartGallery');
|
|
2428
|
+
work_docx_index_export_setWordAttribute(document, gallery, 'val', 'Indexes');
|
|
2429
|
+
documentPart.append(gallery, wordElement(document, 'docPartUnique'));
|
|
2430
|
+
properties.append(documentPart);
|
|
2431
|
+
const content = wordElement(document, 'sdtContent');
|
|
2432
|
+
const fieldStart = indexFieldStartParagraph(document, patch.options);
|
|
2433
|
+
content.append(fieldStart);
|
|
2434
|
+
const cached = cachedIndexParagraphs(document, patch);
|
|
2435
|
+
if (!cached.length) cached.push(emptyIndexParagraph(document));
|
|
2436
|
+
const last = cached.at(-1);
|
|
2437
|
+
last?.append(fieldCharacterRun(document, 'end'));
|
|
2438
|
+
content.append(...cached);
|
|
2439
|
+
control.append(properties, content);
|
|
2440
|
+
return control;
|
|
2441
|
+
}
|
|
2442
|
+
function indexFieldStartParagraph(document, options) {
|
|
2443
|
+
const paragraph = wordElement(document, 'p');
|
|
2444
|
+
paragraph.append(fieldCharacterRun(document, 'begin'));
|
|
2445
|
+
const instructionRun = wordElement(document, 'r');
|
|
2446
|
+
const instruction = wordElement(document, 'instrText');
|
|
2447
|
+
instruction.setAttributeNS(work_docx_index_export_XML_NAMESPACE, 'xml:space', 'preserve');
|
|
2448
|
+
instruction.textContent = ` ${documentIndexInstruction(options)} `;
|
|
2449
|
+
instructionRun.append(instruction);
|
|
2450
|
+
paragraph.append(instructionRun, fieldCharacterRun(document, 'separate'));
|
|
2451
|
+
return paragraph;
|
|
2452
|
+
}
|
|
2453
|
+
function cachedIndexParagraphs(document, patch) {
|
|
2454
|
+
const paragraphs = [];
|
|
2455
|
+
let currentMain = '';
|
|
2456
|
+
for (const entry of patch.entries){
|
|
2457
|
+
if (entry.subEntry && entry.mainEntry !== currentMain) paragraphs.push(cachedIndexParagraph(document, patch.options, {
|
|
2458
|
+
style: 'Index1',
|
|
2459
|
+
term: entry.mainEntry,
|
|
2460
|
+
crossReference: '',
|
|
2461
|
+
pages: []
|
|
2462
|
+
}));
|
|
2463
|
+
paragraphs.push(cachedIndexParagraph(document, patch.options, {
|
|
2464
|
+
style: entry.subEntry ? 'Index2' : 'Index1',
|
|
2465
|
+
term: entry.subEntry || entry.mainEntry,
|
|
2466
|
+
crossReference: entry.crossReference,
|
|
2467
|
+
pages: entry.pages
|
|
2468
|
+
}));
|
|
2469
|
+
currentMain = entry.mainEntry;
|
|
2470
|
+
}
|
|
2471
|
+
return paragraphs;
|
|
2472
|
+
}
|
|
2473
|
+
function cachedIndexParagraph(document, options, source) {
|
|
2474
|
+
const paragraph = wordElement(document, 'p');
|
|
2475
|
+
const properties = wordElement(document, 'pPr');
|
|
2476
|
+
const style = wordElement(document, 'pStyle');
|
|
2477
|
+
work_docx_index_export_setWordAttribute(document, style, 'val', source.style);
|
|
2478
|
+
properties.append(style);
|
|
2479
|
+
if (source.pages.length && options.rightAlignPageNumbers) {
|
|
2480
|
+
const tabs = wordElement(document, 'tabs');
|
|
2481
|
+
const tab = wordElement(document, 'tab');
|
|
2482
|
+
work_docx_index_export_setWordAttribute(document, tab, 'val', 'right');
|
|
2483
|
+
const leader = docxIndexLeader(options.leader);
|
|
2484
|
+
if (leader) work_docx_index_export_setWordAttribute(document, tab, 'leader', leader);
|
|
2485
|
+
work_docx_index_export_setWordAttribute(document, tab, 'pos', '9360');
|
|
2486
|
+
tabs.append(tab);
|
|
2487
|
+
properties.append(tabs);
|
|
2488
|
+
}
|
|
2489
|
+
paragraph.append(properties, textRun(document, source.term));
|
|
2490
|
+
if (source.crossReference) {
|
|
2491
|
+
paragraph.append(textRun(document, `, See ${source.crossReference}`));
|
|
2492
|
+
return paragraph;
|
|
2493
|
+
}
|
|
2494
|
+
if (!source.pages.length) return paragraph;
|
|
2495
|
+
paragraph.append(options.rightAlignPageNumbers ? tabRun(document) : textRun(document, ', '));
|
|
2496
|
+
for (const [index, page] of source.pages.entries()){
|
|
2497
|
+
if (index > 0) paragraph.append(textRun(document, ', '));
|
|
2498
|
+
paragraph.append(textRun(document, String(page.pageNumber), {
|
|
2499
|
+
bold: page.pageBold,
|
|
2500
|
+
italic: page.pageItalic
|
|
2501
|
+
}));
|
|
2502
|
+
}
|
|
2503
|
+
return paragraph;
|
|
2504
|
+
}
|
|
2505
|
+
function emptyIndexParagraph(document) {
|
|
2506
|
+
const paragraph = wordElement(document, 'p');
|
|
2507
|
+
const properties = wordElement(document, 'pPr');
|
|
2508
|
+
const style = wordElement(document, 'pStyle');
|
|
2509
|
+
work_docx_index_export_setWordAttribute(document, style, 'val', 'Index1');
|
|
2510
|
+
properties.append(style);
|
|
2511
|
+
paragraph.append(properties);
|
|
2512
|
+
return paragraph;
|
|
2513
|
+
}
|
|
2514
|
+
function textRun(document, value, style = {}) {
|
|
2515
|
+
const run = wordElement(document, 'r');
|
|
2516
|
+
if (style.bold || style.italic) {
|
|
2517
|
+
const properties = wordElement(document, 'rPr');
|
|
2518
|
+
if (style.bold) properties.append(wordElement(document, 'b'));
|
|
2519
|
+
if (style.italic) properties.append(wordElement(document, 'i'));
|
|
2520
|
+
run.append(properties);
|
|
2521
|
+
}
|
|
2522
|
+
const text = wordElement(document, 't');
|
|
2523
|
+
if (/^\s|\s$/.test(value)) text.setAttributeNS(work_docx_index_export_XML_NAMESPACE, 'xml:space', 'preserve');
|
|
2524
|
+
text.textContent = value;
|
|
2525
|
+
run.append(text);
|
|
2526
|
+
return run;
|
|
2527
|
+
}
|
|
2528
|
+
function tabRun(document) {
|
|
2529
|
+
const run = wordElement(document, 'r');
|
|
2530
|
+
run.append(wordElement(document, 'tab'));
|
|
2531
|
+
return run;
|
|
2532
|
+
}
|
|
2533
|
+
function fieldCharacterRun(document, type) {
|
|
2534
|
+
const run = wordElement(document, 'r');
|
|
2535
|
+
const character = wordElement(document, 'fldChar');
|
|
2536
|
+
work_docx_index_export_setWordAttribute(document, character, 'fldCharType', type);
|
|
2537
|
+
run.append(character);
|
|
2538
|
+
return run;
|
|
2539
|
+
}
|
|
2540
|
+
function docxIndexLeader(value) {
|
|
2541
|
+
if ('dash' === value) return 'hyphen';
|
|
2542
|
+
if ('underline' === value) return 'underscore';
|
|
2543
|
+
if ('dot' === value) return 'dot';
|
|
2544
|
+
return null;
|
|
2545
|
+
}
|
|
2546
|
+
function wordElement(document, localName) {
|
|
2547
|
+
return document.createElementNS(work_docx_index_export_WORD_NAMESPACE, wordQualifiedName(document.documentElement, localName));
|
|
2548
|
+
}
|
|
2549
|
+
function work_docx_index_export_setWordAttribute(document, element, localName, value) {
|
|
2550
|
+
for (const candidate of Array.from(element.attributes))if (candidate.localName === localName && (candidate.namespaceURI === work_docx_index_export_WORD_NAMESPACE || !candidate.namespaceURI)) element.removeAttributeNode(candidate);
|
|
2551
|
+
element.setAttributeNS(work_docx_index_export_WORD_NAMESPACE, wordQualifiedName(document.documentElement, localName), value);
|
|
2552
|
+
}
|
|
2553
|
+
function wordQualifiedName(root, localName) {
|
|
2554
|
+
return `${xmlNamespacePrefix(root, work_docx_index_export_WORD_NAMESPACE) ?? 'w'}:${localName}`;
|
|
2555
|
+
}
|
|
2377
2556
|
const work_docx_run_shading_export_WORD_NAMESPACE = 'http://schemas.openxmlformats.org/wordprocessingml/2006/main';
|
|
2378
2557
|
class DocxRunShadingPatchCollector {
|
|
2379
2558
|
patches = [];
|
|
@@ -2581,17 +2760,17 @@ function setRunFormattingChange(document, run, patch) {
|
|
|
2581
2760
|
if (existing.length > 1) throw new Error('Generated DOCX run contains duplicate properties.');
|
|
2582
2761
|
const properties = existing[0] ?? insertRunProperties(document, run, wordNamespace, prefix);
|
|
2583
2762
|
if (directChildren(properties, 'rPrChange').some((element)=>element.namespaceURI === wordNamespace)) throw new Error('Generated DOCX run already contains a formatting revision.');
|
|
2584
|
-
const change =
|
|
2763
|
+
const change = work_docx_format_change_export_wordElement(document, wordNamespace, prefix, 'rPrChange');
|
|
2585
2764
|
work_docx_format_change_export_setWordAttribute(change, wordNamespace, prefix, 'id', String(patch.id));
|
|
2586
2765
|
work_docx_format_change_export_setWordAttribute(change, wordNamespace, prefix, 'author', patch.author);
|
|
2587
2766
|
work_docx_format_change_export_setWordAttribute(change, wordNamespace, prefix, 'date', patch.date);
|
|
2588
|
-
const before =
|
|
2767
|
+
const before = work_docx_format_change_export_wordElement(document, wordNamespace, prefix, 'rPr');
|
|
2589
2768
|
appendFormattingProperties(document, before, wordNamespace, prefix, patch.before);
|
|
2590
2769
|
change.append(before);
|
|
2591
2770
|
properties.append(change);
|
|
2592
2771
|
}
|
|
2593
2772
|
function insertRunProperties(document, run, namespace, prefix) {
|
|
2594
|
-
const properties =
|
|
2773
|
+
const properties = work_docx_format_change_export_wordElement(document, namespace, prefix, 'rPr');
|
|
2595
2774
|
run.insertBefore(properties, run.firstChild);
|
|
2596
2775
|
return properties;
|
|
2597
2776
|
}
|
|
@@ -2630,13 +2809,13 @@ function appendFormattingProperties(document, properties, namespace, prefix, ser
|
|
|
2630
2809
|
function appendNoProofProperty(document, properties, namespace, prefix, mark) {
|
|
2631
2810
|
const noProof = normalizeDocumentNoProof(mark?.attrs?.noProof);
|
|
2632
2811
|
if (null === noProof) return;
|
|
2633
|
-
if (noProof) properties.append(
|
|
2812
|
+
if (noProof) properties.append(work_docx_format_change_export_wordElement(document, namespace, prefix, 'noProof'));
|
|
2634
2813
|
else appendValuedProperty(document, properties, namespace, prefix, 'noProof', '0');
|
|
2635
2814
|
}
|
|
2636
2815
|
function appendProofingLanguagesProperty(document, properties, namespace, prefix, mark) {
|
|
2637
2816
|
const languages = parseDocumentProofingLanguages(mark?.attrs?.proofingLanguages);
|
|
2638
2817
|
if (!languages) return;
|
|
2639
|
-
const element =
|
|
2818
|
+
const element = work_docx_format_change_export_wordElement(document, namespace, prefix, 'lang');
|
|
2640
2819
|
if (languages.latin) work_docx_format_change_export_setWordAttribute(element, namespace, prefix, 'val', languages.latin);
|
|
2641
2820
|
if (languages.eastAsia) work_docx_format_change_export_setWordAttribute(element, namespace, prefix, 'eastAsia', languages.eastAsia);
|
|
2642
2821
|
if (languages.bidi) work_docx_format_change_export_setWordAttribute(element, namespace, prefix, 'bidi', languages.bidi);
|
|
@@ -2645,7 +2824,7 @@ function appendProofingLanguagesProperty(document, properties, namespace, prefix
|
|
|
2645
2824
|
function appendRunBorderProperty(document, properties, namespace, prefix, mark) {
|
|
2646
2825
|
const border = parseDocumentRunBorder(mark?.attrs?.runBorder);
|
|
2647
2826
|
if (!border) return;
|
|
2648
|
-
const element =
|
|
2827
|
+
const element = work_docx_format_change_export_wordElement(document, namespace, prefix, 'bdr');
|
|
2649
2828
|
work_docx_format_change_export_setWordAttribute(element, namespace, prefix, 'val', border.style);
|
|
2650
2829
|
if (border.color) {
|
|
2651
2830
|
work_docx_format_change_export_setWordAttribute(element, namespace, prefix, 'color', 'auto' === border.color.value ? 'auto' : border.color.value.slice(1).toUpperCase());
|
|
@@ -2664,7 +2843,7 @@ function appendRunBorderProperty(document, properties, namespace, prefix, mark)
|
|
|
2664
2843
|
function appendRunShadingProperty(document, properties, namespace, prefix, mark) {
|
|
2665
2844
|
const shading = parseDocumentRunShading(mark?.attrs?.runShading);
|
|
2666
2845
|
if (!shading) return;
|
|
2667
|
-
const element =
|
|
2846
|
+
const element = work_docx_format_change_export_wordElement(document, namespace, prefix, 'shd');
|
|
2668
2847
|
if (!setDocxRunShadingAttributes(document, element, shading)) return;
|
|
2669
2848
|
properties.append(element);
|
|
2670
2849
|
}
|
|
@@ -2695,14 +2874,14 @@ function appendLegacyTextEffectsProperties(document, properties, namespace, pref
|
|
|
2695
2874
|
if (documentLegacyTextEffectsConflict(effects)) throw new Error('Document contains conflicting legacy text effects.');
|
|
2696
2875
|
for (const name of DOCUMENT_LEGACY_TEXT_EFFECT_NAMES){
|
|
2697
2876
|
const value = effects[name];
|
|
2698
|
-
if (void 0 !== value) if (value) properties.append(
|
|
2877
|
+
if (void 0 !== value) if (value) properties.append(work_docx_format_change_export_wordElement(document, namespace, prefix, name));
|
|
2699
2878
|
else appendValuedProperty(document, properties, namespace, prefix, name, '0');
|
|
2700
2879
|
}
|
|
2701
2880
|
}
|
|
2702
2881
|
function appendHiddenTextProperty(document, properties, namespace, prefix, mark) {
|
|
2703
2882
|
const hiddenText = normalizeDocumentHiddenText(mark?.attrs?.hiddenText);
|
|
2704
2883
|
if (null === hiddenText) return;
|
|
2705
|
-
if (hiddenText) properties.append(
|
|
2884
|
+
if (hiddenText) properties.append(work_docx_format_change_export_wordElement(document, namespace, prefix, 'vanish'));
|
|
2706
2885
|
else appendValuedProperty(document, properties, namespace, prefix, 'vanish', '0');
|
|
2707
2886
|
}
|
|
2708
2887
|
function appendEmphasisMarkProperty(document, properties, namespace, prefix, mark) {
|
|
@@ -2733,7 +2912,7 @@ function appendCharacterSpacingProperty(document, properties, namespace, prefix,
|
|
|
2733
2912
|
function appendFontProperties(document, properties, namespace, prefix, mark) {
|
|
2734
2913
|
const scriptFonts = parseDocumentScriptFonts('string' == typeof mark?.attrs?.scriptFonts ? mark.attrs.scriptFonts : void 0);
|
|
2735
2914
|
if (scriptFonts) {
|
|
2736
|
-
const fonts =
|
|
2915
|
+
const fonts = work_docx_format_change_export_wordElement(document, namespace, prefix, 'rFonts');
|
|
2737
2916
|
for (const [name, value] of [
|
|
2738
2917
|
[
|
|
2739
2918
|
'ascii',
|
|
@@ -2777,7 +2956,7 @@ function appendFontProperties(document, properties, namespace, prefix, mark) {
|
|
|
2777
2956
|
}
|
|
2778
2957
|
const family = firstFontFamily(mark?.attrs?.fontFamily);
|
|
2779
2958
|
if (!family) return;
|
|
2780
|
-
const fonts =
|
|
2959
|
+
const fonts = work_docx_format_change_export_wordElement(document, namespace, prefix, 'rFonts');
|
|
2781
2960
|
for (const name of [
|
|
2782
2961
|
'ascii',
|
|
2783
2962
|
'hAnsi',
|
|
@@ -2791,7 +2970,7 @@ function appendUnderlineProperty(document, properties, namespace, prefix, mark)
|
|
|
2791
2970
|
const style = normalizeDocumentUnderlineStyle(mark.attrs?.underlineStyle) ?? 'single';
|
|
2792
2971
|
const color = normalizedHex(mark.attrs?.underlineColor);
|
|
2793
2972
|
const theme = themeReference(mark.attrs?.underlineThemeColor);
|
|
2794
|
-
const underline =
|
|
2973
|
+
const underline = work_docx_format_change_export_wordElement(document, namespace, prefix, 'u');
|
|
2795
2974
|
work_docx_format_change_export_setWordAttribute(underline, namespace, prefix, 'val', style);
|
|
2796
2975
|
const resolved = color ?? normalizedHex(theme?.resolved);
|
|
2797
2976
|
if (resolved) work_docx_format_change_export_setWordAttribute(underline, namespace, prefix, 'color', resolved);
|
|
@@ -2799,7 +2978,7 @@ function appendUnderlineProperty(document, properties, namespace, prefix, mark)
|
|
|
2799
2978
|
properties.append(underline);
|
|
2800
2979
|
}
|
|
2801
2980
|
function appendBooleanProperty(document, properties, namespace, prefix, marks, mark, property) {
|
|
2802
|
-
if (marks.has(mark)) properties.append(
|
|
2981
|
+
if (marks.has(mark)) properties.append(work_docx_format_change_export_wordElement(document, namespace, prefix, property));
|
|
2803
2982
|
}
|
|
2804
2983
|
function appendStrikeProperties(document, properties, namespace, prefix, mark) {
|
|
2805
2984
|
if (!mark) return;
|
|
@@ -2808,14 +2987,14 @@ function appendStrikeProperties(document, properties, namespace, prefix, mark) {
|
|
|
2808
2987
|
appendValuedProperty(document, properties, namespace, prefix, 'dstrike', 'double' === style ? '1' : '0');
|
|
2809
2988
|
}
|
|
2810
2989
|
function appendValuedProperty(document, properties, namespace, prefix, property, value) {
|
|
2811
|
-
const element =
|
|
2990
|
+
const element = work_docx_format_change_export_wordElement(document, namespace, prefix, property);
|
|
2812
2991
|
work_docx_format_change_export_setWordAttribute(element, namespace, prefix, 'val', value);
|
|
2813
2992
|
properties.append(element);
|
|
2814
2993
|
}
|
|
2815
2994
|
function appendTextCaseProperties(document, properties, namespace, prefix, mark) {
|
|
2816
2995
|
const textCase = mark?.attrs?.textCase;
|
|
2817
|
-
if ('all-caps' === textCase) properties.append(
|
|
2818
|
-
else if ('small-caps' === textCase) properties.append(
|
|
2996
|
+
if ('all-caps' === textCase) properties.append(work_docx_format_change_export_wordElement(document, namespace, prefix, 'caps'));
|
|
2997
|
+
else if ('small-caps' === textCase) properties.append(work_docx_format_change_export_wordElement(document, namespace, prefix, 'smallCaps'));
|
|
2819
2998
|
else if ('none' === textCase) {
|
|
2820
2999
|
appendValuedProperty(document, properties, namespace, prefix, 'caps', '0');
|
|
2821
3000
|
appendValuedProperty(document, properties, namespace, prefix, 'smallCaps', '0');
|
|
@@ -2825,7 +3004,7 @@ function appendColorProperty(document, properties, namespace, prefix, mark) {
|
|
|
2825
3004
|
const color = normalizedHex(mark?.attrs?.color);
|
|
2826
3005
|
const theme = themeReference(mark?.attrs?.themeColor);
|
|
2827
3006
|
if (!color && !theme) return;
|
|
2828
|
-
const element =
|
|
3007
|
+
const element = work_docx_format_change_export_wordElement(document, namespace, prefix, 'color');
|
|
2829
3008
|
work_docx_format_change_export_setWordAttribute(element, namespace, prefix, 'val', color ?? normalizedHex(theme?.resolved) ?? '000000');
|
|
2830
3009
|
if (theme) setThemeAttributes(element, namespace, prefix, theme, 'themeColor');
|
|
2831
3010
|
properties.append(element);
|
|
@@ -2843,7 +3022,7 @@ function appendHighlightProperty(document, properties, namespace, prefix, mark,
|
|
|
2843
3022
|
const fill = normalizedHex(mark?.attrs?.color);
|
|
2844
3023
|
const theme = themeReference(mark?.attrs?.themeFill);
|
|
2845
3024
|
if (!fill && !theme) return;
|
|
2846
|
-
const shading =
|
|
3025
|
+
const shading = work_docx_format_change_export_wordElement(document, namespace, prefix, 'shd');
|
|
2847
3026
|
work_docx_format_change_export_setWordAttribute(shading, namespace, prefix, 'val', 'clear');
|
|
2848
3027
|
work_docx_format_change_export_setWordAttribute(shading, namespace, prefix, 'color', 'auto');
|
|
2849
3028
|
work_docx_format_change_export_setWordAttribute(shading, namespace, prefix, 'fill', fill ?? normalizedHex(theme?.resolved) ?? 'FFFFFF');
|
|
@@ -2891,7 +3070,7 @@ function normalizedHex(value) {
|
|
|
2891
3070
|
const match = /^#?([0-9a-f]{6})$/i.exec(value.trim());
|
|
2892
3071
|
return match?.[1]?.toUpperCase() ?? null;
|
|
2893
3072
|
}
|
|
2894
|
-
function
|
|
3073
|
+
function work_docx_format_change_export_wordElement(document, namespace, prefix, name) {
|
|
2895
3074
|
return document.createElementNS(namespace, `${prefix}:${name}`);
|
|
2896
3075
|
}
|
|
2897
3076
|
function work_docx_format_change_export_setWordAttribute(element, namespace, prefix, name, value) {
|
|
@@ -3665,10 +3844,10 @@ async function patchDocxNumberingRestartRules(buffer, rules) {
|
|
|
3665
3844
|
if (!definition) continue;
|
|
3666
3845
|
let restart = directChild(definition, 'lvlRestart');
|
|
3667
3846
|
if (!restart) {
|
|
3668
|
-
restart = document.createElementNS(work_docx_numbering_WORD_NAMESPACE,
|
|
3847
|
+
restart = document.createElementNS(work_docx_numbering_WORD_NAMESPACE, work_docx_numbering_wordQualifiedName(document.documentElement, 'lvlRestart'));
|
|
3669
3848
|
definition.insertBefore(restart, directChild(definition, 'pPr') ?? null);
|
|
3670
3849
|
}
|
|
3671
|
-
restart.setAttributeNS(work_docx_numbering_WORD_NAMESPACE,
|
|
3850
|
+
restart.setAttributeNS(work_docx_numbering_WORD_NAMESPACE, work_docx_numbering_wordQualifiedName(document.documentElement, 'val'), String(restartAfterLevel));
|
|
3672
3851
|
}
|
|
3673
3852
|
}
|
|
3674
3853
|
archive.file('word/numbering.xml', new XMLSerializer().serializeToString(document));
|
|
@@ -3676,7 +3855,7 @@ async function patchDocxNumberingRestartRules(buffer, rules) {
|
|
|
3676
3855
|
type: 'arraybuffer'
|
|
3677
3856
|
});
|
|
3678
3857
|
}
|
|
3679
|
-
function
|
|
3858
|
+
function work_docx_numbering_wordQualifiedName(root, localName) {
|
|
3680
3859
|
return `${xmlNamespacePrefix(root, work_docx_numbering_WORD_NAMESPACE) ?? root.prefix ?? 'w'}:${localName}`;
|
|
3681
3860
|
}
|
|
3682
3861
|
const work_docx_paragraph_format_change_export_WORD_NAMESPACE = 'http://schemas.openxmlformats.org/wordprocessingml/2006/main';
|
|
@@ -8212,7 +8391,7 @@ async function createDocxBlob(content, sourcePackage) {
|
|
|
8212
8391
|
const docx = await import("docx");
|
|
8213
8392
|
const normalizedContent = {
|
|
8214
8393
|
...content,
|
|
8215
|
-
html: normalizeDocumentBookmarkReferencesHtml(normalizeDocumentBookmarksHtml(content.html))
|
|
8394
|
+
html: normalizeDocumentIndexesHtml(normalizeDocumentBookmarkReferencesHtml(normalizeDocumentBookmarksHtml(content.html)))
|
|
8216
8395
|
};
|
|
8217
8396
|
const noteCollection = collectDocumentNotes(normalizedContent.html);
|
|
8218
8397
|
const comments = anchoredDocumentComments(normalizedContent);
|
|
@@ -8252,6 +8431,7 @@ async function createDocxBlob(content, sourcePackage) {
|
|
|
8252
8431
|
usedNativeTextEffectMarkers: new Set(),
|
|
8253
8432
|
paragraphFormattingChangePatches: new DocxParagraphFormattingChangePatchCollector(),
|
|
8254
8433
|
tableOfContentsPatches: new DocxTableOfContentsPatchCollector(),
|
|
8434
|
+
indexPatches: new DocxIndexPatchCollector(),
|
|
8255
8435
|
hasExplicitZeroCharacterSpacing: false,
|
|
8256
8436
|
hasExplicitZeroKerningThreshold: false
|
|
8257
8437
|
};
|
|
@@ -8323,7 +8503,8 @@ async function createDocxBlob(content, sourcePackage) {
|
|
|
8323
8503
|
const paragraphDefaultCollapsedPatched = await patchDocxParagraphDefaultCollapsed(bookmarkPatched, noteContext.paragraphDefaultCollapsedPatches.patches);
|
|
8324
8504
|
const paragraphIdentityPatched = await patchDocxParagraphIdentities(paragraphDefaultCollapsedPatched, noteContext.paragraphIdentityPatches.patches);
|
|
8325
8505
|
const tableOfContentsPatched = await patchDocxTableOfContents(paragraphIdentityPatched, noteContext.tableOfContentsPatches.patches);
|
|
8326
|
-
const
|
|
8506
|
+
const indexPatched = await patchDocxIndexes(tableOfContentsPatched, noteContext.indexPatches.patches);
|
|
8507
|
+
const paragraphFormattingChangesPatched = await patchDocxParagraphFormattingChanges(indexPatched, noteContext.paragraphFormattingChangePatches.patches);
|
|
8327
8508
|
const equationPatched = await patchDocxEquations(paragraphFormattingChangesPatched, noteContext.equationPatches.patches);
|
|
8328
8509
|
const patched = await patchDocxPageColor(equationPatched, normalizedContent.pageColor);
|
|
8329
8510
|
const preserved = sourcePackage ? await preserveDocxSourcePackage(patched, sourcePackage, {
|
|
@@ -8497,6 +8678,7 @@ async function blockToFileChildren(element, docx, noteContext) {
|
|
|
8497
8678
|
if (element.hasAttribute('data-document-table-of-contents')) return [
|
|
8498
8679
|
docxTableOfContents(element, docx, noteContext.tableOfContentsPatches)
|
|
8499
8680
|
];
|
|
8681
|
+
if (element.hasAttribute('data-document-index')) return docxDocumentIndex(element, docx, noteContext.indexPatches);
|
|
8500
8682
|
if (element.hasAttribute('data-document-caption')) return [
|
|
8501
8683
|
docxCaptionParagraph(element, await paragraphRuns(element, docx, noteContext), docx, paragraphBidirectional(element))
|
|
8502
8684
|
];
|
|
@@ -8608,6 +8790,12 @@ async function work_docx_export_inlineRuns(root, docx, noteContext) {
|
|
|
8608
8790
|
if (node.hasAttribute('data-document-field')) return [
|
|
8609
8791
|
docxDocumentFieldRun(node, docx)
|
|
8610
8792
|
];
|
|
8793
|
+
if (node.hasAttribute('data-document-index-entry')) {
|
|
8794
|
+
const entry = docxIndexEntryRun(node, docx);
|
|
8795
|
+
return entry ? [
|
|
8796
|
+
entry
|
|
8797
|
+
] : [];
|
|
8798
|
+
}
|
|
8611
8799
|
if (node.hasAttribute('data-document-equation')) {
|
|
8612
8800
|
const equation = noteContext.equationPatches.marker(node);
|
|
8613
8801
|
return [
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import jszip from "jszip";
|
|
2
|
-
import { documentRunBorderDomAttributes, contentTypeForPart, bytesToDataUrl, OoxmlPackage, firstDescendant, normalizeDocumentParagraphId, applyDocumentParagraphIdentityToElement, descendants, documentHighlightDomAttributes, attribute as work_ooxml_package_attribute, documentHighlightFromDocxValue, serializeDocxThemeReference, normalizeDocumentTableOfContentsHtml, directChildren, documentParagraphShadingDomAttributes, documentProofingDomAttributes, documentParagraphBordersDomAttributes, directChild, documentScriptFontSegments, normalizeDocumentParagraphIdentity, documentRunShadingDomAttributes } from "./4121.js";
|
|
2
|
+
import { documentRunBorderDomAttributes, contentTypeForPart, bytesToDataUrl, OoxmlPackage, normalizeDocumentIndexesHtml, firstDescendant, normalizeDocumentParagraphId, applyDocumentParagraphIdentityToElement, descendants, documentHighlightDomAttributes, attribute as work_ooxml_package_attribute, documentHighlightFromDocxValue, serializeDocxThemeReference, normalizeDocumentTableOfContentsHtml, directChildren, documentParagraphShadingDomAttributes, documentProofingDomAttributes, documentParagraphBordersDomAttributes, directChild, documentScriptFontSegments, normalizeDocumentParagraphIdentity, documentRunShadingDomAttributes } from "./4121.js";
|
|
3
3
|
import { normalizeDocumentBookmarkName, renderDocumentTableCellMarginOverrides, applyDocumentImageIdentityToElement, documentCharacterPositionDomAttributes, createDocumentImageIdentityRegistry, normalizeDocumentColumns, documentStrikeDomAttributes, normalizeDocumentImageWrapContour, DOCUMENT_TABLE_ROW_ID_ATTRIBUTE, normalizeDocumentBookmarksHtml, applyDocumentTableRowIdentityToElement, normalizeDocumentCaptionsHtml, documentCharacterSpacingDomAttributes, normalizeDocumentImageAlignment, applyDocumentImageLayerToElement, normalizeDocumentNotesHtml, normalizeDocumentBookmarkReferencesHtml, documentCitationTagsFromInstruction, applyDocumentImageWrapContourToElement, documentUnderlineDomAttributes, documentHiddenTextDomAttributes, normalizeDocumentPageChrome, normalizeDocumentImageLayoutOptions, applyDocumentImageCropToElement, documentPageMarginsForLayout, applyDocumentPageGeometry, createDocumentNoteElement, normalizeDocumentImageLayer, DOCUMENT_TABLE_ROW_TEXT_ID_ATTRIBUTE, documentBookmarkReferenceInstruction, documentInitialSectionLayout, normalizeDocumentFieldsHtml, documentCaptionLabel, documentTableBordersFromElement, isContourImageLayout, normalizeDocumentCitationsHtml, normalizeDocumentImageIdentity, normalizeDocumentImageWrapSide, documentKerningDomAttributes, docxDocumentFieldKind, renderDocumentTableBorders, docxBookmarkReferenceTarget, normalizeDocumentImagePosition, wrapsBesideImage, documentPageChromeLegacyFields, documentCharacterScaleDomAttributes, DEFAULT_DOCUMENT_TABLE_GEOMETRY, documentSectionDomAttributes, DEFAULT_DOCUMENT_TABLE_CELL_MARGINS, documentPageMarginBody, documentLegacyTextEffectsDomAttributes, normalizeDocumentTableRowIdentity, normalizeDocumentBookmarkNativeId, uniqueDocumentImageIdentity, applyDocumentTableGeometryToElement, normalizeDocumentImageCrop, documentContentLayoutProperties, documentEmphasisMarkDomAttributes } from "./6282.js";
|
|
4
|
-
import { markDocxRunFormattingIntoState, applyImportedDocxParagraphSpacingMarkers, hasImportedDocxParagraphDirectionMarkers, hasImportedDocxParagraphIndentMarkers, resolveDocxParagraphBordersForParagraph, applyImportedDocxParagraphShadingMarkers, markDocxParagraphSpacing, docxCaptionBookmark, docxFieldResultText, createDocxParagraphStyleResolver, docxTableCellStyleLayers, createImportedDocxRunFormattingMarkerState, parseDocxPaperSource, resolveDocxLegacyTextEffects, markDocxTablesOfContents, hasImportedDocxParagraphSpacingMarkers,
|
|
5
|
-
import { readDocxBibliography, resolveDocxProofing, XMLNS_NAMESPACE, docxCharacterScalePercentFromProperties, docxCharacterSpacingTwipsFromProperties, parseBoundedDocxInteger, xmlAttributeLocalName, resolveDocxEmphasisMark, createDocxThemeResolver, docxCharacterPositionHalfPointsFromProperties, docxThemeColor, parseDocxParagraphDefaultCollapsed, resolveDocxKerningThresholdHalfPoints, resolveDocxThemeResolver, DOCX_WORDPROCESSING_NAMESPACES, xmlAttributeNamespace } from "./0~
|
|
4
|
+
import { hasImportedDocxIndexMarkers, markDocxRunFormattingIntoState, applyImportedDocxParagraphSpacingMarkers, hasImportedDocxParagraphDirectionMarkers, hasImportedDocxParagraphIndentMarkers, resolveDocxParagraphBordersForParagraph, applyImportedDocxParagraphShadingMarkers, markDocxParagraphSpacing, docxCaptionBookmark, docxFieldResultText, createDocxParagraphStyleResolver, docxTableCellStyleLayers, createImportedDocxRunFormattingMarkerState, parseDocxPaperSource, resolveDocxLegacyTextEffects, markDocxTablesOfContents, hasImportedDocxParagraphSpacingMarkers, applyImportedDocxIndexMarkers, applyImportedDocxTableOfContentsMarkers, markDocxIndexes, parseDocxPageMargins, docxTablePropertySources, parseDirectDocxParagraphShading, markDocxParagraphIndents, markDocxPackageEquations, resolveDocxRunBorder, parseDocxPageGeometry, docxCaptionReferenceTarget, applyImportedDocxEquationMarkers, hasImportedDocxParagraphPaginationMarkers, createDocxTableStyleResolver, hasImportedDocxParagraphShadingMarkers, isDocxEquationLikeRoot, importedDocxStrike, docxTableRunPropertySources, inspectDocxPageMarginSettings, hasImportedDocxRunFormattingMarkers, applyImportedDocxParagraphFormattingChangeMarkers, hasImportedDocxTableOfContentsMarkers, hasImportedDocxParagraphTabStopMarkers, resolveDocxRunShading, docxCaptionSequenceKind, applyImportedDocxRunFormattingMarkers, markDocxParagraphAlignments, markDocxParagraphDirections, hasImportedDocxParagraphBorderMarkers, hasImportedDocxParagraphFormattingChangeMarkers, resolveDocxHiddenText, docxEquationHtml, docxFieldOccurrences, hasImportedDocxParagraphAlignmentMarkers, markDocxParagraphTabStops, applyImportedDocxParagraphIndentMarkers, resolveDocxTableStyleResolver, applyImportedDocxParagraphDirectionMarkers, applyImportedDocxParagraphAlignmentMarkers, markDocxParagraphPagination, importedDocxUnderline, markDocxParagraphBorders, applyImportedDocxParagraphTabStopMarkers, applyImportedDocxParagraphPaginationMarkers, docxFieldOccurrenceIsInlineEditable, applyImportedDocxParagraphBorderMarkers, docxRunPropertySources, markDocxParagraphFormattingChanges, markDocxParagraphShading, parseDocxPageBorders } from "./0~7240.js";
|
|
5
|
+
import { readDocxBibliography, resolveDocxProofing, XMLNS_NAMESPACE, docxCharacterScalePercentFromProperties, docxCharacterSpacingTwipsFromProperties, parseBoundedDocxInteger, xmlAttributeLocalName, resolveDocxEmphasisMark, createDocxThemeResolver, docxCharacterPositionHalfPointsFromProperties, docxThemeColor, parseDocxParagraphDefaultCollapsed, resolveDocxKerningThresholdHalfPoints, resolveDocxThemeResolver, DOCX_WORDPROCESSING_NAMESPACES, xmlAttributeNamespace } from "./0~4808.js";
|
|
6
6
|
import { importDocxPageColor, importedDocumentNoteId } from "./0~4980.js";
|
|
7
7
|
const WORD_NAMESPACE = 'http://schemas.openxmlformats.org/wordprocessingml/2006/main';
|
|
8
8
|
const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
|
|
@@ -2899,6 +2899,10 @@ async function prepareDocxImport(buffer, sourcePackage) {
|
|
|
2899
2899
|
tableOfContentsMarkers: {
|
|
2900
2900
|
tables: []
|
|
2901
2901
|
},
|
|
2902
|
+
indexMarkers: {
|
|
2903
|
+
entries: [],
|
|
2904
|
+
indexes: []
|
|
2905
|
+
},
|
|
2902
2906
|
equationMarkers: {
|
|
2903
2907
|
equations: []
|
|
2904
2908
|
},
|
|
@@ -2965,6 +2969,7 @@ async function prepareDocxImport(buffer, sourcePackage) {
|
|
|
2965
2969
|
const document = await archive.xml('word/document.xml');
|
|
2966
2970
|
const pageColor = importDocxPageColor(document);
|
|
2967
2971
|
const tableOfContentsMarkers = markDocxTablesOfContents(document);
|
|
2972
|
+
const indexMarkers = markDocxIndexes(document);
|
|
2968
2973
|
const paragraphIdentityMarkers = markDocxParagraphIdentities(document);
|
|
2969
2974
|
const numbering = archive.has('word/numbering.xml') ? await archive.xml('word/numbering.xml') : null;
|
|
2970
2975
|
const commentMarkers = await markDocxComments(document, archive);
|
|
@@ -3009,7 +3014,7 @@ async function prepareDocxImport(buffer, sourcePackage) {
|
|
|
3009
3014
|
const trackChanges = Boolean(settings && firstDescendant(settings, 'trackRevisions')) || changeMarkers.changes.length > 0 || paragraphFormattingChangeMarkers.paragraphs.length > 0 || runFormattingMarkers.runs.some((run)=>Boolean(run.change));
|
|
3010
3015
|
const sectionElements = effectiveSectionProperties(document);
|
|
3011
3016
|
if (!sectionElements.length) return {
|
|
3012
|
-
conversionBuffer: hasImportedDocxCaptionMarkers(captionMarkers) || hasImportedDocxBookmarkMarkers(bookmarkMarkers) || hasImportedDocxChangeMarkers(changeMarkers) || hasImportedDocxCommentMarkers(commentMarkers) || hasImportedDocxCitationMarkers(citationMarkers) || hasImportedDocxFieldMarkers(fieldMarkers) || hasImportedDocxTableOfContentsMarkers(tableOfContentsMarkers) || equationMarkers.changed || hasImportedDocxListMarkers(listMarkers) || hasImportedDocxImageLayoutMarkers(imageLayoutMarkers) || hasImportedDocxParagraphIdentityMarkers(paragraphIdentityMarkers) || hasImportedDocxParagraphFormattingChangeMarkers(paragraphFormattingChangeMarkers) || hasImportedDocxParagraphAlignmentMarkers(paragraphAlignmentMarkers) || hasImportedDocxParagraphDirectionMarkers(paragraphDirectionMarkers) || hasImportedDocxParagraphIndentMarkers(paragraphIndentMarkers) || hasImportedDocxParagraphSpacingMarkers(paragraphSpacingMarkers) || hasImportedDocxParagraphBorderMarkers(paragraphBorderMarkers) || hasImportedDocxParagraphShadingMarkers(paragraphShadingMarkers) || hasImportedDocxParagraphPaginationMarkers(paragraphPaginationMarkers) || hasImportedDocxRunFormattingMarkers(runFormattingMarkers) || hasImportedDocxParagraphTabStopMarkers(tabStopMarkers) || hasImportedDocxTableCellMarkers(tableCellMarkers) || hasImportedDocxTableRowMarkers(tableRowMarkers) || hasImportedDocxTableSizingMarkers(tableSizingMarkers) ? await writeDocumentXml(buffer, document, equationMarkers.parts) : buffer,
|
|
3017
|
+
conversionBuffer: hasImportedDocxCaptionMarkers(captionMarkers) || hasImportedDocxBookmarkMarkers(bookmarkMarkers) || hasImportedDocxChangeMarkers(changeMarkers) || hasImportedDocxCommentMarkers(commentMarkers) || hasImportedDocxCitationMarkers(citationMarkers) || hasImportedDocxFieldMarkers(fieldMarkers) || hasImportedDocxTableOfContentsMarkers(tableOfContentsMarkers) || hasImportedDocxIndexMarkers(indexMarkers) || equationMarkers.changed || hasImportedDocxListMarkers(listMarkers) || hasImportedDocxImageLayoutMarkers(imageLayoutMarkers) || hasImportedDocxParagraphIdentityMarkers(paragraphIdentityMarkers) || hasImportedDocxParagraphFormattingChangeMarkers(paragraphFormattingChangeMarkers) || hasImportedDocxParagraphAlignmentMarkers(paragraphAlignmentMarkers) || hasImportedDocxParagraphDirectionMarkers(paragraphDirectionMarkers) || hasImportedDocxParagraphIndentMarkers(paragraphIndentMarkers) || hasImportedDocxParagraphSpacingMarkers(paragraphSpacingMarkers) || hasImportedDocxParagraphBorderMarkers(paragraphBorderMarkers) || hasImportedDocxParagraphShadingMarkers(paragraphShadingMarkers) || hasImportedDocxParagraphPaginationMarkers(paragraphPaginationMarkers) || hasImportedDocxRunFormattingMarkers(runFormattingMarkers) || hasImportedDocxParagraphTabStopMarkers(tabStopMarkers) || hasImportedDocxTableCellMarkers(tableCellMarkers) || hasImportedDocxTableRowMarkers(tableRowMarkers) || hasImportedDocxTableSizingMarkers(tableSizingMarkers) ? await writeDocumentXml(buffer, document, equationMarkers.parts) : buffer,
|
|
3013
3018
|
sections: [
|
|
3014
3019
|
{
|
|
3015
3020
|
id: 'document-section-1',
|
|
@@ -3023,6 +3028,7 @@ async function prepareDocxImport(buffer, sourcePackage) {
|
|
|
3023
3028
|
commentMarkers,
|
|
3024
3029
|
fieldMarkers,
|
|
3025
3030
|
tableOfContentsMarkers,
|
|
3031
|
+
indexMarkers,
|
|
3026
3032
|
equationMarkers: equationMarkers.markers,
|
|
3027
3033
|
citationMarkers,
|
|
3028
3034
|
listMarkers,
|
|
@@ -3058,7 +3064,7 @@ async function prepareDocxImport(buffer, sourcePackage) {
|
|
|
3058
3064
|
}
|
|
3059
3065
|
if (sections.length > 1) addSectionMarkers(document, sectionElements);
|
|
3060
3066
|
return {
|
|
3061
|
-
conversionBuffer: sections.length > 1 || hasImportedDocxCaptionMarkers(captionMarkers) || hasImportedDocxBookmarkMarkers(bookmarkMarkers) || hasImportedDocxChangeMarkers(changeMarkers) || hasImportedDocxCommentMarkers(commentMarkers) || hasImportedDocxCitationMarkers(citationMarkers) || hasImportedDocxFieldMarkers(fieldMarkers) || hasImportedDocxTableOfContentsMarkers(tableOfContentsMarkers) || equationMarkers.changed || hasImportedDocxListMarkers(listMarkers) || hasImportedDocxImageLayoutMarkers(imageLayoutMarkers) || hasImportedDocxParagraphIdentityMarkers(paragraphIdentityMarkers) || hasImportedDocxParagraphFormattingChangeMarkers(paragraphFormattingChangeMarkers) || hasImportedDocxParagraphAlignmentMarkers(paragraphAlignmentMarkers) || hasImportedDocxParagraphDirectionMarkers(paragraphDirectionMarkers) || hasImportedDocxParagraphIndentMarkers(paragraphIndentMarkers) || hasImportedDocxParagraphSpacingMarkers(paragraphSpacingMarkers) || hasImportedDocxParagraphBorderMarkers(paragraphBorderMarkers) || hasImportedDocxParagraphShadingMarkers(paragraphShadingMarkers) || hasImportedDocxParagraphPaginationMarkers(paragraphPaginationMarkers) || hasImportedDocxRunFormattingMarkers(runFormattingMarkers) || hasImportedDocxParagraphTabStopMarkers(tabStopMarkers) || hasImportedDocxTableCellMarkers(tableCellMarkers) || hasImportedDocxTableRowMarkers(tableRowMarkers) || hasImportedDocxTableSizingMarkers(tableSizingMarkers) ? await writeDocumentXml(buffer, document, equationMarkers.parts) : buffer,
|
|
3067
|
+
conversionBuffer: sections.length > 1 || hasImportedDocxCaptionMarkers(captionMarkers) || hasImportedDocxBookmarkMarkers(bookmarkMarkers) || hasImportedDocxChangeMarkers(changeMarkers) || hasImportedDocxCommentMarkers(commentMarkers) || hasImportedDocxCitationMarkers(citationMarkers) || hasImportedDocxFieldMarkers(fieldMarkers) || hasImportedDocxTableOfContentsMarkers(tableOfContentsMarkers) || hasImportedDocxIndexMarkers(indexMarkers) || equationMarkers.changed || hasImportedDocxListMarkers(listMarkers) || hasImportedDocxImageLayoutMarkers(imageLayoutMarkers) || hasImportedDocxParagraphIdentityMarkers(paragraphIdentityMarkers) || hasImportedDocxParagraphFormattingChangeMarkers(paragraphFormattingChangeMarkers) || hasImportedDocxParagraphAlignmentMarkers(paragraphAlignmentMarkers) || hasImportedDocxParagraphDirectionMarkers(paragraphDirectionMarkers) || hasImportedDocxParagraphIndentMarkers(paragraphIndentMarkers) || hasImportedDocxParagraphSpacingMarkers(paragraphSpacingMarkers) || hasImportedDocxParagraphBorderMarkers(paragraphBorderMarkers) || hasImportedDocxParagraphShadingMarkers(paragraphShadingMarkers) || hasImportedDocxParagraphPaginationMarkers(paragraphPaginationMarkers) || hasImportedDocxRunFormattingMarkers(runFormattingMarkers) || hasImportedDocxParagraphTabStopMarkers(tabStopMarkers) || hasImportedDocxTableCellMarkers(tableCellMarkers) || hasImportedDocxTableRowMarkers(tableRowMarkers) || hasImportedDocxTableSizingMarkers(tableSizingMarkers) ? await writeDocumentXml(buffer, document, equationMarkers.parts) : buffer,
|
|
3062
3068
|
sections,
|
|
3063
3069
|
pageColor,
|
|
3064
3070
|
captionMarkers,
|
|
@@ -3067,6 +3073,7 @@ async function prepareDocxImport(buffer, sourcePackage) {
|
|
|
3067
3073
|
commentMarkers,
|
|
3068
3074
|
fieldMarkers,
|
|
3069
3075
|
tableOfContentsMarkers,
|
|
3076
|
+
indexMarkers,
|
|
3070
3077
|
equationMarkers: equationMarkers.markers,
|
|
3071
3078
|
citationMarkers,
|
|
3072
3079
|
listMarkers,
|
|
@@ -3104,6 +3111,9 @@ function applyDocxSectionsToHtml(html, sections, captionMarkers = {
|
|
|
3104
3111
|
fields: []
|
|
3105
3112
|
}, tableOfContentsMarkers = {
|
|
3106
3113
|
tables: []
|
|
3114
|
+
}, indexMarkers = {
|
|
3115
|
+
entries: [],
|
|
3116
|
+
indexes: []
|
|
3107
3117
|
}, equationMarkers = {
|
|
3108
3118
|
equations: []
|
|
3109
3119
|
}, citationMarkers = {
|
|
@@ -3172,6 +3182,7 @@ function applyDocxSectionsToHtml(html, sections, captionMarkers = {
|
|
|
3172
3182
|
applyImportedDocxCommentMarkers(document, commentMarkers);
|
|
3173
3183
|
applyImportedDocxParagraphIdentityMarkers(document, paragraphIdentityMarkers);
|
|
3174
3184
|
applyImportedDocxTableOfContentsMarkers(document, tableOfContentsMarkers);
|
|
3185
|
+
applyImportedDocxIndexMarkers(document, indexMarkers);
|
|
3175
3186
|
const notes = extractMammothDocumentNotes(document);
|
|
3176
3187
|
const sourceNodes = Array.from(document.body.childNodes);
|
|
3177
3188
|
document.body.replaceChildren();
|
|
@@ -3196,7 +3207,7 @@ function applyDocxSectionsToHtml(html, sections, captionMarkers = {
|
|
|
3196
3207
|
document.body.append(missing);
|
|
3197
3208
|
}
|
|
3198
3209
|
placeMammothDocumentNotes(document, notes);
|
|
3199
|
-
return normalizeDocumentBookmarkReferencesHtml(normalizeDocumentBookmarksHtml(normalizeDocumentCitationsHtml(normalizeDocumentTableOfContentsHtml(normalizeDocumentFieldsHtml(normalizeDocumentCaptionsHtml(normalizeDocumentNotesHtml(document.body.innerHTML)))), bibliography)));
|
|
3210
|
+
return normalizeDocumentIndexesHtml(normalizeDocumentBookmarkReferencesHtml(normalizeDocumentBookmarksHtml(normalizeDocumentCitationsHtml(normalizeDocumentTableOfContentsHtml(normalizeDocumentFieldsHtml(normalizeDocumentCaptionsHtml(normalizeDocumentNotesHtml(document.body.innerHTML)))), bibliography))));
|
|
3200
3211
|
}
|
|
3201
3212
|
async function readDocxLayout(buffer) {
|
|
3202
3213
|
const prepared = await prepareDocxImport(buffer);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __webpack_require__ } from "./0~rslib-runtime.js";
|
|
2
2
|
import { contentTypeForPart, directChildren, OoxmlPackage, parseXml, firstDescendant, isDocumentParagraphArtBorderStyle, descendants, directChild, xmlContainsAnyElement, attribute, documentRunBorderIsVisible } from "./4121.js";
|
|
3
3
|
import { normalizeDocumentBookmarkName, docxBookmarkReferenceTarget, normalizeDocumentBookmarkNativeId, DOCUMENT_LEGACY_TEXT_EFFECT_NAMES, supportedDocxBookmarkReferenceInstruction, documentCitationTagsFromInstruction, docxDocumentFieldKind } from "./6282.js";
|
|
4
|
-
import { markDocxParagraphShading, inspectDocxPageSize, docxCaptionBookmark, hasInvalidDocxFieldStructure, inspectDocxLegacyTextEffects, inspectDocxPageMargins, inspectDocxPaperSource, createDocxParagraphStyleResolver, supportedDocxTableOfContentsField, docxFieldOccurrences,
|
|
4
|
+
import { markDocxParagraphShading, inspectDocxPageSize, docxCaptionBookmark, hasInvalidDocxFieldStructure, inspectDocxLegacyTextEffects, inspectDocxPageMargins, inspectDocxPaperSource, createDocxParagraphStyleResolver, supportedDocxTableOfContentsField, docxFieldOccurrences, supportedDocxIndexEntryField, createDocxTableStyleResolver, inspectDocxEquation, inspectDocxPageMarginSettings, inspectDocxRunFonts, inspectDocxRunBorder, inspectDocxRunShading, markDocxParagraphBorders, isSupportedDocxParagraphFormattingChange, docxFieldOccurrenceIsInlineEditable, supportedDocxIndexField, docxCaptionSequenceKind, inspectDocxHiddenText, inspectDocxPageBorders, isSupportedDocxRunFormattingChange, docxFieldInstructions, isSupportedDocxEquationPlacement } from "./0~7240.js";
|
|
5
5
|
import { normalizeDocumentHref } from "./0~work-document-links.js";
|
|
6
|
-
import { xmlAttributeLocalName, inspectDocxProofingLanguages, readDocxBibliography, inspectDocxEmphasisMark, createDocxThemeResolver, inspectDocxNoProof, parseDocxParagraphDefaultCollapsed, DOCX_WORDPROCESSING_NAMESPACES, xmlAttributeNamespace, inspectDocxKerningThresholdHalfPoints } from "./0~
|
|
6
|
+
import { xmlAttributeLocalName, inspectDocxProofingLanguages, readDocxBibliography, inspectDocxEmphasisMark, createDocxThemeResolver, inspectDocxNoProof, parseDocxParagraphDefaultCollapsed, DOCX_WORDPROCESSING_NAMESPACES, xmlAttributeNamespace, inspectDocxKerningThresholdHalfPoints } from "./0~4808.js";
|
|
7
7
|
import { updateSpreadsheetWorksheetCompatibilitySummary, inspectXlsxPivotTables, isSupportedXlsxChartLegend, isSupportedXlsxChartPlotLayout, xlsxChartNodeUsesStackedGrouping, isSupportedXlsxChartSeriesFormatting, readXlsxFormulaFeaturesFromPackage, inspectXlsxHeaderFooterText, emptySpreadsheetWorksheetCompatibilitySummary, isSupportedXlsxWorksheetImageContentType, MAX_XLSX_WORKSHEET_IMAGE_BYTES, xlsxChartSeriesFormattingShapeProperties, diagnoseXlsxProtection, isEditableXlsxPaperSizeCode, isSupportedXlsxCombinationChartNodes } from "./4104.js";
|
|
8
8
|
import { spreadsheetConditionalComparisonNeedsUpperValue, isSpreadsheetConditionalIconSetName, isSpreadsheetConditionalComparisonOperator, spreadsheetConditionalIconSetCount, xlsxWorksheetCellEntries } from "./1544.js";
|
|
9
9
|
import { formulaHasStructuredReference, formulaHasExternalReference, parseSpreadsheetPrintTitles, volatileSpreadsheetFormulaFunctions, stripSpreadsheetSheetQualifier } from "./8715.js";
|
|
@@ -93,6 +93,8 @@ function bookmarkIssue(code, message, severity = 'warning') {
|
|
|
93
93
|
function diagnoseDocxCaptions(document) {
|
|
94
94
|
const fields = docxFieldOccurrences(document);
|
|
95
95
|
const tableOfContentsFields = fields.filter(supportedDocxTableOfContentsField);
|
|
96
|
+
const indexEntryFields = fields.filter(supportedDocxIndexEntryField);
|
|
97
|
+
const indexFields = fields.filter(supportedDocxIndexField);
|
|
96
98
|
const tableOfContentsContainers = new Set(tableOfContentsFields.flatMap((field)=>{
|
|
97
99
|
const container = closestAncestor(field.start, 'sdt');
|
|
98
100
|
return container ? [
|
|
@@ -103,10 +105,21 @@ function diagnoseDocxCaptions(document) {
|
|
|
103
105
|
const container = closestAncestor(field.start, 'sdt');
|
|
104
106
|
return Boolean(container && tableOfContentsContainers.has(container));
|
|
105
107
|
};
|
|
108
|
+
const indexContainers = new Set(indexFields.flatMap((field)=>{
|
|
109
|
+
const container = closestAncestor(field.start, 'sdt');
|
|
110
|
+
return container ? [
|
|
111
|
+
container
|
|
112
|
+
] : [];
|
|
113
|
+
}));
|
|
114
|
+
const isIndexField = (field)=>{
|
|
115
|
+
const container = closestAncestor(field.start, 'sdt');
|
|
116
|
+
return Boolean(container && indexContainers.has(container));
|
|
117
|
+
};
|
|
118
|
+
const isSupportedBlockField = (field)=>isTableOfContentsField(field) || isIndexField(field);
|
|
106
119
|
const sequences = fields.filter((field)=>docxCaptionSequenceKind(field.instruction));
|
|
107
120
|
const bodyFields = fields.filter((field)=>'orphan' !== field.syntax && Boolean(docxDocumentFieldKind(field.instruction)));
|
|
108
121
|
const editableBodyFields = bodyFields.filter(docxFieldOccurrenceIsInlineEditable);
|
|
109
|
-
const hasUnsupportedFieldStructure = hasInvalidDocxFieldStructure(document,
|
|
122
|
+
const hasUnsupportedFieldStructure = hasInvalidDocxFieldStructure(document, isSupportedBlockField) || bodyFields.some((field)=>!docxFieldOccurrenceIsInlineEditable(field));
|
|
110
123
|
const bookmarkNames = new Set([
|
|
111
124
|
...captionBookmarkNames(sequences),
|
|
112
125
|
...pairedBookmarkNames(document)
|
|
@@ -137,6 +150,14 @@ function diagnoseDocxCaptions(document) {
|
|
|
137
150
|
severity: 'info'
|
|
138
151
|
}
|
|
139
152
|
] : [],
|
|
153
|
+
...indexEntryFields.length || indexFields.length ? [
|
|
154
|
+
{
|
|
155
|
+
code: 'docx.index',
|
|
156
|
+
feature: 'Index',
|
|
157
|
+
message: 'Native XE entries, primary and secondary terms, cross-references, page emphasis, cached INDEX rows, columns, and leader styles remain editable and round-trip in DOCX output.',
|
|
158
|
+
severity: 'info'
|
|
159
|
+
}
|
|
160
|
+
] : [],
|
|
140
161
|
...hasUnsupportedFieldStructure ? [
|
|
141
162
|
{
|
|
142
163
|
code: 'docx.fields.structure',
|
|
@@ -146,7 +167,7 @@ function diagnoseDocxCaptions(document) {
|
|
|
146
167
|
}
|
|
147
168
|
] : []
|
|
148
169
|
],
|
|
149
|
-
hasUnsupportedFields: hasUnsupportedFieldStructure || fields.some((field)=>!
|
|
170
|
+
hasUnsupportedFields: hasUnsupportedFieldStructure || fields.some((field)=>!isSupportedBlockField(field) && !supportedDocxIndexEntryField(field) && !isSupportedCaptionField(field.instruction, bookmarkNames))
|
|
150
171
|
};
|
|
151
172
|
}
|
|
152
173
|
function captionBookmarkNames(fields) {
|
package/dist/4104.js
CHANGED
|
@@ -590,7 +590,7 @@ async function importWorkDocumentFile(file, extension, context) {
|
|
|
590
590
|
recordDocumentImportMeasure('a3s-office.document.mammoth', mammothStartedAt, documentImportNow());
|
|
591
591
|
context?.controller.report('parsing', 0.8);
|
|
592
592
|
const markersStartedAt = documentImportNow();
|
|
593
|
-
html = prepared ? applyDocxSectionsToHtml(result.value, prepared.sections, prepared.captionMarkers, prepared.bookmarkMarkers, prepared.changeMarkers, prepared.commentMarkers, prepared.fieldMarkers, prepared.tableOfContentsMarkers, prepared.equationMarkers, prepared.citationMarkers, prepared.listMarkers, prepared.imageLayoutMarkers, prepared.paragraphIdentityMarkers, prepared.paragraphFormattingChangeMarkers, prepared.paragraphAlignmentMarkers, prepared.runFormattingMarkers, prepared.paragraphDirectionMarkers, prepared.paragraphIndentMarkers, prepared.paragraphSpacingMarkers, prepared.paragraphBorderMarkers, prepared.paragraphShadingMarkers, prepared.paragraphPaginationMarkers, prepared.bibliography, prepared.tabStopMarkers, prepared.tableCellMarkers, prepared.tableRowMarkers, prepared.tableSizingMarkers) : result.value;
|
|
593
|
+
html = prepared ? applyDocxSectionsToHtml(result.value, prepared.sections, prepared.captionMarkers, prepared.bookmarkMarkers, prepared.changeMarkers, prepared.commentMarkers, prepared.fieldMarkers, prepared.tableOfContentsMarkers, prepared.indexMarkers, prepared.equationMarkers, prepared.citationMarkers, prepared.listMarkers, prepared.imageLayoutMarkers, prepared.paragraphIdentityMarkers, prepared.paragraphFormattingChangeMarkers, prepared.paragraphAlignmentMarkers, prepared.runFormattingMarkers, prepared.paragraphDirectionMarkers, prepared.paragraphIndentMarkers, prepared.paragraphSpacingMarkers, prepared.paragraphBorderMarkers, prepared.paragraphShadingMarkers, prepared.paragraphPaginationMarkers, prepared.bibliography, prepared.tabStopMarkers, prepared.tableCellMarkers, prepared.tableRowMarkers, prepared.tableSizingMarkers) : result.value;
|
|
594
594
|
recordDocumentImportMeasure('a3s-office.document.markers', markersStartedAt, documentImportNow());
|
|
595
595
|
const layout = prepared ? {
|
|
596
596
|
...documentContentLayoutProperties(prepared.sections[0].layout),
|