@a3s-lab/office 0.28.0 → 0.30.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 +126 -3
- package/dist/0~1403.js +1 -1
- package/dist/0~4980.js +1 -1
- package/dist/0~7048.js +1 -1
- package/dist/{0~7043.js → 0~7231.js} +400 -242
- package/dist/{0~5093.js → 0~7360.js} +293 -53
- package/dist/0~7614.js +1 -1
- package/dist/0~document-editor.js +1535 -102
- package/dist/0~presentation-editor.js +1 -1
- package/dist/0~spreadsheet-editor.js +184 -36
- package/dist/0~work-docx-export.js +437 -11
- package/dist/0~work-docx-import.js +32 -7
- package/dist/0~work-office-diagnostics.js +170 -7
- package/dist/0~work-pptx-export.js +1 -1
- package/dist/0~work-pptx-import.js +1 -1
- package/dist/0~work-presentation-charts.js +1 -1
- package/dist/1544.js +14 -2
- package/dist/4104.js +31 -8
- package/dist/4121.js +3448 -0
- package/dist/6282.js +558 -1688
- package/dist/8715.js +1 -1
- package/dist/core.js +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/features/work/editors/document-command-catalog.d.ts +27 -0
- package/dist/internal/features/work/editors/document-font-dialog-model.d.ts +8 -2
- package/dist/internal/features/work/editors/document-font-dialog-run-border-model.d.ts +24 -0
- package/dist/internal/features/work/editors/document-font-dialog-run-border-section.d.ts +10 -0
- package/dist/internal/features/work/editors/document-font-dialog-run-shading-model.d.ts +23 -0
- package/dist/internal/features/work/editors/document-font-dialog-run-shading-section.d.ts +8 -0
- package/dist/internal/features/work/editors/document-page-chrome-ribbon.d.ts +2 -1
- package/dist/internal/features/work/editors/document-proofing-dialog-model.d.ts +22 -0
- package/dist/internal/features/work/editors/document-proofing-dialog.d.ts +7 -0
- package/dist/internal/features/work/editors/document-table-of-contents-dialog.d.ts +10 -0
- package/dist/internal/features/work/editors/document-toolbar.d.ts +3 -1
- package/dist/internal/features/work/editors/spreadsheet-data-validation.d.ts +7 -1
- package/dist/internal/features/work/editors/use-document-insert-commands.d.ts +2 -0
- package/dist/internal/features/work/work-document-character-formatting.d.ts +12 -0
- package/dist/internal/features/work/work-document-format-changes.d.ts +7 -0
- package/dist/internal/features/work/work-document-highlight.d.ts +9 -0
- package/dist/internal/features/work/work-document-outline.d.ts +1 -0
- package/dist/internal/features/work/work-document-paragraph-shading.d.ts +6 -0
- package/dist/internal/features/work/work-document-proofing.d.ts +19 -0
- package/dist/internal/features/work/work-document-run-border.d.ts +11 -0
- package/dist/internal/features/work/work-document-run-shading.d.ts +12 -0
- package/dist/internal/features/work/work-document-table-of-contents-node.d.ts +18 -0
- package/dist/internal/features/work/work-document-table-of-contents.d.ts +51 -0
- package/dist/internal/features/work/work-document-word-line-metrics.d.ts +4 -0
- package/dist/internal/features/work/work-docx-field-instructions.d.ts +1 -1
- package/dist/internal/features/work/work-docx-import.d.ts +3 -1
- package/dist/internal/features/work/work-docx-proofing-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-proofing.d.ts +38 -0
- package/dist/internal/features/work/work-docx-run-border-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-run-border-export.d.ts +17 -0
- package/dist/internal/features/work/work-docx-run-border.d.ts +20 -0
- package/dist/internal/features/work/work-docx-run-formatting-import.d.ts +9 -0
- package/dist/internal/features/work/work-docx-run-shading-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-run-shading-export.d.ts +17 -0
- package/dist/internal/features/work/work-docx-run-shading.d.ts +20 -0
- package/dist/internal/features/work/work-docx-table-of-contents-export.d.ts +11 -0
- package/dist/internal/features/work/work-docx-table-of-contents-import.d.ts +15 -0
- package/dist/internal/features/work/work-spreadsheet-data-validation.d.ts +7 -0
- package/dist/internal/features/work/work-types.d.ts +9 -0
- package/dist/internal/kernel/office-kernel-protocol.d.ts +1 -0
- package/dist/office-kernel.wasm +0 -0
- package/dist/styles.css +339 -1
- package/docs/latest/en/browser-editor-architecture.md +72 -1
- package/package.json +15 -2
- package/dist/5184.js +0 -662
- package/dist/9424.js +0 -16
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import jszip from "jszip";
|
|
2
|
-
import {
|
|
3
|
-
import { normalizeDocumentBookmarkName, renderDocumentTableCellMarginOverrides, applyDocumentImageIdentityToElement, documentCharacterPositionDomAttributes, createDocumentImageIdentityRegistry, normalizeDocumentColumns, documentStrikeDomAttributes, normalizeDocumentImageWrapContour, DOCUMENT_TABLE_ROW_ID_ATTRIBUTE, normalizeDocumentBookmarksHtml, applyDocumentTableRowIdentityToElement, normalizeDocumentCaptionsHtml, documentCharacterSpacingDomAttributes, normalizeDocumentImageAlignment,
|
|
4
|
-
import { markDocxRunFormattingIntoState, applyImportedDocxParagraphSpacingMarkers, hasImportedDocxParagraphDirectionMarkers, hasImportedDocxParagraphIndentMarkers, resolveDocxParagraphBordersForParagraph, applyImportedDocxParagraphShadingMarkers, markDocxParagraphSpacing, docxCaptionBookmark, docxFieldResultText, createDocxParagraphStyleResolver, docxTableCellStyleLayers, createImportedDocxRunFormattingMarkerState, parseDocxPaperSource, resolveDocxLegacyTextEffects, hasImportedDocxParagraphSpacingMarkers, docxTablePropertySources, parseDocxPageMargins, parseDirectDocxParagraphShading, markDocxPackageEquations, parseDocxPageGeometry, markDocxParagraphIndents, docxCaptionReferenceTarget, applyImportedDocxEquationMarkers, hasImportedDocxParagraphPaginationMarkers, createDocxTableStyleResolver, hasImportedDocxParagraphShadingMarkers, isDocxEquationLikeRoot, importedDocxStrike, docxTableRunPropertySources, inspectDocxPageMarginSettings, hasImportedDocxRunFormattingMarkers, applyImportedDocxParagraphFormattingChangeMarkers, hasImportedDocxParagraphTabStopMarkers, docxCaptionSequenceKind, applyImportedDocxRunFormattingMarkers, markDocxParagraphAlignments, markDocxParagraphDirections, hasImportedDocxParagraphBorderMarkers, hasImportedDocxParagraphFormattingChangeMarkers, resolveDocxHiddenText, docxEquationHtml, docxFieldOccurrences, hasImportedDocxParagraphAlignmentMarkers, markDocxParagraphTabStops, applyImportedDocxParagraphIndentMarkers, resolveDocxTableStyleResolver,
|
|
5
|
-
import { readDocxBibliography, XMLNS_NAMESPACE, docxCharacterScalePercentFromProperties, docxCharacterSpacingTwipsFromProperties, parseBoundedDocxInteger, xmlAttributeLocalName, resolveDocxEmphasisMark, createDocxThemeResolver, docxCharacterPositionHalfPointsFromProperties, docxThemeColor, parseDocxParagraphDefaultCollapsed, resolveDocxKerningThresholdHalfPoints, resolveDocxThemeResolver, DOCX_WORDPROCESSING_NAMESPACES, xmlAttributeNamespace } from "./0~
|
|
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";
|
|
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, docxTablePropertySources, applyImportedDocxTableOfContentsMarkers, parseDocxPageMargins, parseDirectDocxParagraphShading, markDocxPackageEquations, parseDocxPageGeometry, markDocxParagraphIndents, resolveDocxRunBorder, 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~7360.js";
|
|
5
|
+
import { readDocxBibliography, resolveDocxProofing, XMLNS_NAMESPACE, docxCharacterScalePercentFromProperties, docxCharacterSpacingTwipsFromProperties, parseBoundedDocxInteger, xmlAttributeLocalName, resolveDocxEmphasisMark, createDocxThemeResolver, docxCharacterPositionHalfPointsFromProperties, docxThemeColor, parseDocxParagraphDefaultCollapsed, resolveDocxKerningThresholdHalfPoints, resolveDocxThemeResolver, DOCX_WORDPROCESSING_NAMESPACES, xmlAttributeNamespace } from "./0~7231.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';
|
|
@@ -1824,8 +1824,16 @@ async function runHtml(run, field, context) {
|
|
|
1824
1824
|
if (void 0 !== emphasisMark) content = `<span${htmlAttributes(documentEmphasisMarkDomAttributes(emphasisMark))}>${content}</span>`;
|
|
1825
1825
|
const hiddenText = resolveDocxHiddenText(propertySources);
|
|
1826
1826
|
if (void 0 !== hiddenText) content = `<span${htmlAttributes(documentHiddenTextDomAttributes(hiddenText))}>${content}</span>`;
|
|
1827
|
+
const proofing = resolveDocxProofing(propertySources);
|
|
1828
|
+
if (proofing.languages || void 0 !== proofing.noProof) content = `<span${htmlAttributes(documentProofingDomAttributes(proofing.languages, proofing.noProof, documentScriptFontSegments(run.textContent ?? '')[0]?.slot))}>${content}</span>`;
|
|
1827
1829
|
const legacyTextEffects = resolveDocxLegacyTextEffects(propertySources);
|
|
1828
1830
|
if (legacyTextEffects) content = `<span${htmlAttributes(documentLegacyTextEffectsDomAttributes(legacyTextEffects))}>${content}</span>`;
|
|
1831
|
+
const highlight = resolvePageChromeHighlight(propertySources);
|
|
1832
|
+
if (highlight) content = `<span${htmlAttributes(documentHighlightDomAttributes(highlight))}>${content}</span>`;
|
|
1833
|
+
const runShading = resolveDocxRunShading(propertySources, context.theme).shading;
|
|
1834
|
+
if (runShading) content = `<span${htmlAttributes(documentRunShadingDomAttributes(runShading))}>${content}</span>`;
|
|
1835
|
+
const runBorder = resolveDocxRunBorder(propertySources, context.theme).border;
|
|
1836
|
+
if (runBorder) content = `<span${htmlAttributes(documentRunBorderDomAttributes(runBorder))}>${content}</span>`;
|
|
1829
1837
|
const characterSpacing = docxCharacterSpacingTwipsFromProperties(properties ?? run);
|
|
1830
1838
|
if (void 0 !== characterSpacing) content = `<span${htmlAttributes(documentCharacterSpacingDomAttributes(characterSpacing))}>${content}</span>`;
|
|
1831
1839
|
const color = work_ooxml_package_attribute(directChild(properties ?? run, 'color') ?? run, 'val');
|
|
@@ -1903,6 +1911,14 @@ function resolveDocxPageChromeFontSizePoints(propertySources) {
|
|
|
1903
1911
|
}
|
|
1904
1912
|
return fontSize;
|
|
1905
1913
|
}
|
|
1914
|
+
function resolvePageChromeHighlight(propertySources) {
|
|
1915
|
+
let highlight = null;
|
|
1916
|
+
for (const properties of propertySources){
|
|
1917
|
+
const element = directChild(properties, 'highlight');
|
|
1918
|
+
if (element) highlight = documentHighlightFromDocxValue(work_ooxml_package_attribute(element, 'val'));
|
|
1919
|
+
}
|
|
1920
|
+
return highlight;
|
|
1921
|
+
}
|
|
1906
1922
|
function docxPageChromeFontSizePointsFromProperties(properties) {
|
|
1907
1923
|
const localMatches = directChildren(properties, 'sz');
|
|
1908
1924
|
const nativeMatches = localMatches.filter((element)=>DOCX_WORDPROCESSING_NAMESPACES.has(element.namespaceURI ?? ''));
|
|
@@ -2880,6 +2896,9 @@ async function prepareDocxImport(buffer, sourcePackage) {
|
|
|
2880
2896
|
fieldMarkers: {
|
|
2881
2897
|
fields: []
|
|
2882
2898
|
},
|
|
2899
|
+
tableOfContentsMarkers: {
|
|
2900
|
+
tables: []
|
|
2901
|
+
},
|
|
2883
2902
|
equationMarkers: {
|
|
2884
2903
|
equations: []
|
|
2885
2904
|
},
|
|
@@ -2945,6 +2964,7 @@ async function prepareDocxImport(buffer, sourcePackage) {
|
|
|
2945
2964
|
};
|
|
2946
2965
|
const document = await archive.xml('word/document.xml');
|
|
2947
2966
|
const pageColor = importDocxPageColor(document);
|
|
2967
|
+
const tableOfContentsMarkers = markDocxTablesOfContents(document);
|
|
2948
2968
|
const paragraphIdentityMarkers = markDocxParagraphIdentities(document);
|
|
2949
2969
|
const numbering = archive.has('word/numbering.xml') ? await archive.xml('word/numbering.xml') : null;
|
|
2950
2970
|
const commentMarkers = await markDocxComments(document, archive);
|
|
@@ -2989,7 +3009,7 @@ async function prepareDocxImport(buffer, sourcePackage) {
|
|
|
2989
3009
|
const trackChanges = Boolean(settings && firstDescendant(settings, 'trackRevisions')) || changeMarkers.changes.length > 0 || paragraphFormattingChangeMarkers.paragraphs.length > 0 || runFormattingMarkers.runs.some((run)=>Boolean(run.change));
|
|
2990
3010
|
const sectionElements = effectiveSectionProperties(document);
|
|
2991
3011
|
if (!sectionElements.length) return {
|
|
2992
|
-
conversionBuffer: hasImportedDocxCaptionMarkers(captionMarkers) || hasImportedDocxBookmarkMarkers(bookmarkMarkers) || hasImportedDocxChangeMarkers(changeMarkers) || hasImportedDocxCommentMarkers(commentMarkers) || hasImportedDocxCitationMarkers(citationMarkers) || hasImportedDocxFieldMarkers(fieldMarkers) || 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,
|
|
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,
|
|
2993
3013
|
sections: [
|
|
2994
3014
|
{
|
|
2995
3015
|
id: 'document-section-1',
|
|
@@ -3002,6 +3022,7 @@ async function prepareDocxImport(buffer, sourcePackage) {
|
|
|
3002
3022
|
changeMarkers,
|
|
3003
3023
|
commentMarkers,
|
|
3004
3024
|
fieldMarkers,
|
|
3025
|
+
tableOfContentsMarkers,
|
|
3005
3026
|
equationMarkers: equationMarkers.markers,
|
|
3006
3027
|
citationMarkers,
|
|
3007
3028
|
listMarkers,
|
|
@@ -3037,7 +3058,7 @@ async function prepareDocxImport(buffer, sourcePackage) {
|
|
|
3037
3058
|
}
|
|
3038
3059
|
if (sections.length > 1) addSectionMarkers(document, sectionElements);
|
|
3039
3060
|
return {
|
|
3040
|
-
conversionBuffer: sections.length > 1 || hasImportedDocxCaptionMarkers(captionMarkers) || hasImportedDocxBookmarkMarkers(bookmarkMarkers) || hasImportedDocxChangeMarkers(changeMarkers) || hasImportedDocxCommentMarkers(commentMarkers) || hasImportedDocxCitationMarkers(citationMarkers) || hasImportedDocxFieldMarkers(fieldMarkers) || 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,
|
|
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,
|
|
3041
3062
|
sections,
|
|
3042
3063
|
pageColor,
|
|
3043
3064
|
captionMarkers,
|
|
@@ -3045,6 +3066,7 @@ async function prepareDocxImport(buffer, sourcePackage) {
|
|
|
3045
3066
|
changeMarkers,
|
|
3046
3067
|
commentMarkers,
|
|
3047
3068
|
fieldMarkers,
|
|
3069
|
+
tableOfContentsMarkers,
|
|
3048
3070
|
equationMarkers: equationMarkers.markers,
|
|
3049
3071
|
citationMarkers,
|
|
3050
3072
|
listMarkers,
|
|
@@ -3080,6 +3102,8 @@ function applyDocxSectionsToHtml(html, sections, captionMarkers = {
|
|
|
3080
3102
|
ranges: []
|
|
3081
3103
|
}, fieldMarkers = {
|
|
3082
3104
|
fields: []
|
|
3105
|
+
}, tableOfContentsMarkers = {
|
|
3106
|
+
tables: []
|
|
3083
3107
|
}, equationMarkers = {
|
|
3084
3108
|
equations: []
|
|
3085
3109
|
}, citationMarkers = {
|
|
@@ -3147,6 +3171,7 @@ function applyDocxSectionsToHtml(html, sections, captionMarkers = {
|
|
|
3147
3171
|
applyImportedDocxChangeMarkers(document, changeMarkers);
|
|
3148
3172
|
applyImportedDocxCommentMarkers(document, commentMarkers);
|
|
3149
3173
|
applyImportedDocxParagraphIdentityMarkers(document, paragraphIdentityMarkers);
|
|
3174
|
+
applyImportedDocxTableOfContentsMarkers(document, tableOfContentsMarkers);
|
|
3150
3175
|
const notes = extractMammothDocumentNotes(document);
|
|
3151
3176
|
const sourceNodes = Array.from(document.body.childNodes);
|
|
3152
3177
|
document.body.replaceChildren();
|
|
@@ -3171,7 +3196,7 @@ function applyDocxSectionsToHtml(html, sections, captionMarkers = {
|
|
|
3171
3196
|
document.body.append(missing);
|
|
3172
3197
|
}
|
|
3173
3198
|
placeMammothDocumentNotes(document, notes);
|
|
3174
|
-
return normalizeDocumentBookmarkReferencesHtml(normalizeDocumentBookmarksHtml(normalizeDocumentCitationsHtml(normalizeDocumentFieldsHtml(normalizeDocumentCaptionsHtml(normalizeDocumentNotesHtml(document.body.innerHTML))), bibliography)));
|
|
3199
|
+
return normalizeDocumentBookmarkReferencesHtml(normalizeDocumentBookmarksHtml(normalizeDocumentCitationsHtml(normalizeDocumentTableOfContentsHtml(normalizeDocumentFieldsHtml(normalizeDocumentCaptionsHtml(normalizeDocumentNotesHtml(document.body.innerHTML)))), bibliography)));
|
|
3175
3200
|
}
|
|
3176
3201
|
async function readDocxLayout(buffer) {
|
|
3177
3202
|
const prepared = await prepareDocxImport(buffer);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __webpack_require__ } from "./0~rslib-runtime.js";
|
|
2
|
-
import { contentTypeForPart, directChildren, OoxmlPackage, parseXml, firstDescendant, descendants, directChild, xmlContainsAnyElement, attribute } from "./
|
|
3
|
-
import { normalizeDocumentBookmarkName, docxBookmarkReferenceTarget,
|
|
4
|
-
import { markDocxParagraphShading, inspectDocxPageSize, docxCaptionBookmark, hasInvalidDocxFieldStructure, inspectDocxLegacyTextEffects, inspectDocxPageMargins, inspectDocxPaperSource, createDocxParagraphStyleResolver,
|
|
2
|
+
import { contentTypeForPart, directChildren, OoxmlPackage, parseXml, firstDescendant, isDocumentParagraphArtBorderStyle, descendants, directChild, xmlContainsAnyElement, attribute, documentRunBorderIsVisible } from "./4121.js";
|
|
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, createDocxTableStyleResolver, inspectDocxRunFonts, inspectDocxEquation, inspectDocxPageMarginSettings, inspectDocxRunBorder, inspectDocxRunShading, markDocxParagraphBorders, isSupportedDocxParagraphFormattingChange, docxFieldOccurrenceIsInlineEditable, inspectDocxHiddenText, docxCaptionSequenceKind, inspectDocxPageBorders, isSupportedDocxRunFormattingChange, docxFieldInstructions, isSupportedDocxEquationPlacement } from "./0~7360.js";
|
|
5
5
|
import { normalizeDocumentHref } from "./0~work-document-links.js";
|
|
6
|
-
import { xmlAttributeLocalName, readDocxBibliography, inspectDocxEmphasisMark, createDocxThemeResolver, parseDocxParagraphDefaultCollapsed, DOCX_WORDPROCESSING_NAMESPACES, xmlAttributeNamespace, inspectDocxKerningThresholdHalfPoints } from "./0~
|
|
6
|
+
import { xmlAttributeLocalName, inspectDocxProofingLanguages, readDocxBibliography, inspectDocxEmphasisMark, createDocxThemeResolver, inspectDocxNoProof, parseDocxParagraphDefaultCollapsed, DOCX_WORDPROCESSING_NAMESPACES, xmlAttributeNamespace, inspectDocxKerningThresholdHalfPoints } from "./0~7231.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";
|
|
@@ -92,10 +92,21 @@ function bookmarkIssue(code, message, severity = 'warning') {
|
|
|
92
92
|
}
|
|
93
93
|
function diagnoseDocxCaptions(document) {
|
|
94
94
|
const fields = docxFieldOccurrences(document);
|
|
95
|
+
const tableOfContentsFields = fields.filter(supportedDocxTableOfContentsField);
|
|
96
|
+
const tableOfContentsContainers = new Set(tableOfContentsFields.flatMap((field)=>{
|
|
97
|
+
const container = closestAncestor(field.start, 'sdt');
|
|
98
|
+
return container ? [
|
|
99
|
+
container
|
|
100
|
+
] : [];
|
|
101
|
+
}));
|
|
102
|
+
const isTableOfContentsField = (field)=>{
|
|
103
|
+
const container = closestAncestor(field.start, 'sdt');
|
|
104
|
+
return Boolean(container && tableOfContentsContainers.has(container));
|
|
105
|
+
};
|
|
95
106
|
const sequences = fields.filter((field)=>docxCaptionSequenceKind(field.instruction));
|
|
96
107
|
const bodyFields = fields.filter((field)=>'orphan' !== field.syntax && Boolean(docxDocumentFieldKind(field.instruction)));
|
|
97
108
|
const editableBodyFields = bodyFields.filter(docxFieldOccurrenceIsInlineEditable);
|
|
98
|
-
const hasUnsupportedFieldStructure = hasInvalidDocxFieldStructure(document) || bodyFields.some((field)=>!docxFieldOccurrenceIsInlineEditable(field));
|
|
109
|
+
const hasUnsupportedFieldStructure = hasInvalidDocxFieldStructure(document, isTableOfContentsField) || bodyFields.some((field)=>!docxFieldOccurrenceIsInlineEditable(field));
|
|
99
110
|
const bookmarkNames = new Set([
|
|
100
111
|
...captionBookmarkNames(sequences),
|
|
101
112
|
...pairedBookmarkNames(document)
|
|
@@ -118,6 +129,14 @@ function diagnoseDocxCaptions(document) {
|
|
|
118
129
|
severity: 'info'
|
|
119
130
|
}
|
|
120
131
|
] : [],
|
|
132
|
+
...tableOfContentsFields.length ? [
|
|
133
|
+
{
|
|
134
|
+
code: 'docx.tableOfContents',
|
|
135
|
+
feature: 'Table of contents',
|
|
136
|
+
message: 'Heading ranges, hyperlinks, page-number visibility and alignment, leader styles, cached entries, and refreshable native TOC fields remain editable and round-trip in DOCX output.',
|
|
137
|
+
severity: 'info'
|
|
138
|
+
}
|
|
139
|
+
] : [],
|
|
121
140
|
...hasUnsupportedFieldStructure ? [
|
|
122
141
|
{
|
|
123
142
|
code: 'docx.fields.structure',
|
|
@@ -127,7 +146,7 @@ function diagnoseDocxCaptions(document) {
|
|
|
127
146
|
}
|
|
128
147
|
] : []
|
|
129
148
|
],
|
|
130
|
-
hasUnsupportedFields: hasUnsupportedFieldStructure || fields.some((field)=>!isSupportedCaptionField(field.instruction, bookmarkNames))
|
|
149
|
+
hasUnsupportedFields: hasUnsupportedFieldStructure || fields.some((field)=>!isTableOfContentsField(field) && !isSupportedCaptionField(field.instruction, bookmarkNames))
|
|
131
150
|
};
|
|
132
151
|
}
|
|
133
152
|
function captionBookmarkNames(fields) {
|
|
@@ -846,6 +865,57 @@ async function diagnoseDocxParagraphShading(archive, document) {
|
|
|
846
865
|
});
|
|
847
866
|
return issues;
|
|
848
867
|
}
|
|
868
|
+
const PROOFING_PART_PATTERN = /^word\/(?:document|styles|header\d*|footer\d*|footnotes|endnotes|comments)\.xml$/i;
|
|
869
|
+
async function diagnoseDocxProofing(archive, document) {
|
|
870
|
+
const parts = [
|
|
871
|
+
document
|
|
872
|
+
];
|
|
873
|
+
for (const path of archive.paths('word/'))if ('word/document.xml' !== path.toLowerCase() && PROOFING_PART_PATTERN.test(path)) parts.push(await archive.xml(path));
|
|
874
|
+
let languageCount = 0;
|
|
875
|
+
let proofingStateCount = 0;
|
|
876
|
+
let excludedCount = 0;
|
|
877
|
+
let checkedCount = 0;
|
|
878
|
+
let invalidCount = 0;
|
|
879
|
+
for (const part of parts){
|
|
880
|
+
for (const properties of descendants(part, 'rPr').filter((element)=>DOCX_WORDPROCESSING_NAMESPACES.has(element.namespaceURI ?? ''))){
|
|
881
|
+
if (directChildren(properties, 'lang').length) {
|
|
882
|
+
const inspection = inspectDocxProofingLanguages(properties);
|
|
883
|
+
if ('valid' === inspection.status) languageCount += 1;
|
|
884
|
+
else invalidCount += 1 + inspection.spoofedCount;
|
|
885
|
+
}
|
|
886
|
+
if (directChildren(properties, 'noProof').length) {
|
|
887
|
+
const inspection = inspectDocxNoProof(properties);
|
|
888
|
+
if ('valid' === inspection.status) {
|
|
889
|
+
proofingStateCount += 1;
|
|
890
|
+
if (inspection.value) excludedCount += 1;
|
|
891
|
+
else checkedCount += 1;
|
|
892
|
+
} else invalidCount += 1 + inspection.spoofedCount;
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
for (const name of [
|
|
896
|
+
'lang',
|
|
897
|
+
'noProof'
|
|
898
|
+
])invalidCount += descendants(part, name).filter((element)=>{
|
|
899
|
+
if (!DOCX_WORDPROCESSING_NAMESPACES.has(element.namespaceURI ?? '')) return false;
|
|
900
|
+
const parent = element.parentElement;
|
|
901
|
+
return !parent || 'rPr' !== parent.localName || !DOCX_WORDPROCESSING_NAMESPACES.has(parent.namespaceURI ?? '');
|
|
902
|
+
}).length;
|
|
903
|
+
}
|
|
904
|
+
const issues = [];
|
|
905
|
+
if (languageCount || proofingStateCount) issues.push({
|
|
906
|
+
code: 'docx.proofing-language',
|
|
907
|
+
severity: 'info',
|
|
908
|
+
feature: 'Proofing languages',
|
|
909
|
+
message: `${languageCount} native language declaration(s) and ${proofingStateCount} explicit proofing state(s), including ${excludedCount} excluded and ${checkedCount} explicitly checked state(s), were detected across document defaults, styles, body, page chrome, notes, comments, and formatting revisions. Writer preserves independent Latin, East Asian, and bidi language slots plus native w:noProof true or false semantics through mixed-selection editing, one-step Undo, tracked formatting revisions, and exact DOCX export.`
|
|
910
|
+
});
|
|
911
|
+
if (invalidCount) issues.push({
|
|
912
|
+
code: 'docx.proofing-language.invalid',
|
|
913
|
+
severity: 'warning',
|
|
914
|
+
feature: 'Proofing languages',
|
|
915
|
+
message: `${invalidCount} malformed, duplicated, misplaced, namespace-spoofed, text-bearing, child-bearing, extra-attribute, invalid-language-tag, or invalid on/off proofing value(s) are ignored instead of enabling untrusted language metadata or inheriting stale proofing state.`
|
|
916
|
+
});
|
|
917
|
+
return issues;
|
|
918
|
+
}
|
|
849
919
|
const RUN_FONT_DIAGNOSTIC_PART_PATTERN = /^word\/(?:document|styles|header\d*|footer\d*|footnotes|endnotes|comments)\.xml$/i;
|
|
850
920
|
async function diagnoseDocxRunFonts(archive, document) {
|
|
851
921
|
const parts = [
|
|
@@ -903,6 +973,96 @@ async function diagnoseDocxRunFonts(archive, document) {
|
|
|
903
973
|
});
|
|
904
974
|
return issues;
|
|
905
975
|
}
|
|
976
|
+
const RUN_BORDER_PART_PATTERN = /^word\/(?:document|styles|header\d*|footer\d*|footnotes|endnotes|comments)\.xml$/i;
|
|
977
|
+
async function diagnoseDocxRunBorders(archive, document) {
|
|
978
|
+
const themePath = archive.paths('word/theme/').find((path)=>/\/theme\d*\.xml$/i.test(path));
|
|
979
|
+
const themeDocument = themePath ? await archive.xml(themePath) : null;
|
|
980
|
+
const settingsDocument = archive.has('word/settings.xml') ? await archive.xml('word/settings.xml') : null;
|
|
981
|
+
const theme = createDocxThemeResolver(themeDocument, settingsDocument);
|
|
982
|
+
const parts = [
|
|
983
|
+
document
|
|
984
|
+
];
|
|
985
|
+
for (const path of archive.paths('word/'))if ('word/document.xml' !== path.toLowerCase() && RUN_BORDER_PART_PATTERN.test(path)) parts.push(await archive.xml(path));
|
|
986
|
+
let validCount = 0;
|
|
987
|
+
let resetCount = 0;
|
|
988
|
+
let invalidCount = 0;
|
|
989
|
+
for (const part of parts){
|
|
990
|
+
for (const properties of descendants(part, 'rPr').filter((element)=>DOCX_WORDPROCESSING_NAMESPACES.has(element.namespaceURI ?? ''))){
|
|
991
|
+
if (!directChildren(properties, 'bdr').length) continue;
|
|
992
|
+
const inspection = inspectDocxRunBorder(properties, theme);
|
|
993
|
+
if ('valid' === inspection.status) {
|
|
994
|
+
validCount += 1;
|
|
995
|
+
if (!documentRunBorderIsVisible(inspection.value)) resetCount += 1;
|
|
996
|
+
} else invalidCount += 1 + inspection.spoofedCount;
|
|
997
|
+
}
|
|
998
|
+
invalidCount += descendants(part, 'bdr').filter((element)=>{
|
|
999
|
+
const parent = element.parentElement;
|
|
1000
|
+
return !parent || 'rPr' !== parent.localName || !DOCX_WORDPROCESSING_NAMESPACES.has(parent.namespaceURI ?? '');
|
|
1001
|
+
}).length;
|
|
1002
|
+
}
|
|
1003
|
+
const issues = [];
|
|
1004
|
+
if (validCount) issues.push({
|
|
1005
|
+
code: 'docx.run-borders',
|
|
1006
|
+
severity: 'info',
|
|
1007
|
+
feature: 'Character borders',
|
|
1008
|
+
message: `${validCount} native character border(s), including ${resetCount} explicit reset(s), were detected across document defaults, styles, body, page chrome, notes, comments, and formatting revisions. Writer preserves all 25 visible Word line styles plus nil and none, direct and theme colors, eighth-point widths, spacing, shadow, and frame semantics through editing, Format Painter, one-step Undo, and exact DOCX export. The browser and PDF paint is a bounded CSS approximation, and no non-standard shortcut is invented.`
|
|
1009
|
+
});
|
|
1010
|
+
if (invalidCount) issues.push({
|
|
1011
|
+
code: 'docx.run-borders.invalid',
|
|
1012
|
+
severity: 'warning',
|
|
1013
|
+
feature: 'Character borders',
|
|
1014
|
+
message: `${invalidCount} malformed, duplicated, misplaced, namespace-spoofed, text-bearing, child-bearing, extra-attribute, art-style, out-of-range, or unresolved-theme character border value(s) are normalized to explicit nil resets instead of enabling untrusted paint or inheriting stale formatting.`
|
|
1015
|
+
});
|
|
1016
|
+
return issues;
|
|
1017
|
+
}
|
|
1018
|
+
const RUN_SHADING_PART_PATTERN = /^word\/(?:document|styles|header\d*|footer\d*|footnotes|endnotes|comments)\.xml$/i;
|
|
1019
|
+
const VALID_SHADING_PARENTS = new Set([
|
|
1020
|
+
'rPr',
|
|
1021
|
+
'pPr',
|
|
1022
|
+
'tcPr',
|
|
1023
|
+
'tblPr'
|
|
1024
|
+
]);
|
|
1025
|
+
async function diagnoseDocxRunShading(archive, document) {
|
|
1026
|
+
const themePath = archive.paths('word/theme/').find((path)=>/\/theme\d*\.xml$/i.test(path));
|
|
1027
|
+
const themeDocument = themePath ? await archive.xml(themePath) : null;
|
|
1028
|
+
const settingsDocument = archive.has('word/settings.xml') ? await archive.xml('word/settings.xml') : null;
|
|
1029
|
+
const theme = createDocxThemeResolver(themeDocument, settingsDocument);
|
|
1030
|
+
const parts = [
|
|
1031
|
+
document
|
|
1032
|
+
];
|
|
1033
|
+
for (const path of archive.paths('word/'))if ('word/document.xml' !== path.toLowerCase() && RUN_SHADING_PART_PATTERN.test(path)) parts.push(await archive.xml(path));
|
|
1034
|
+
let validCount = 0;
|
|
1035
|
+
let resetCount = 0;
|
|
1036
|
+
let invalidCount = 0;
|
|
1037
|
+
for (const part of parts){
|
|
1038
|
+
for (const properties of descendants(part, 'rPr').filter((element)=>DOCX_WORDPROCESSING_NAMESPACES.has(element.namespaceURI ?? ''))){
|
|
1039
|
+
if (!directChildren(properties, 'shd').length) continue;
|
|
1040
|
+
const inspection = inspectDocxRunShading(properties, theme);
|
|
1041
|
+
if ('valid' === inspection.status) {
|
|
1042
|
+
validCount += 1;
|
|
1043
|
+
if ('nil' === inspection.value.pattern) resetCount += 1;
|
|
1044
|
+
} else invalidCount += 1 + inspection.spoofedCount;
|
|
1045
|
+
}
|
|
1046
|
+
invalidCount += descendants(part, 'shd').filter((element)=>{
|
|
1047
|
+
const parent = element.parentElement;
|
|
1048
|
+
return DOCX_WORDPROCESSING_NAMESPACES.has(element.namespaceURI ?? '') && (!parent || !VALID_SHADING_PARENTS.has(parent.localName));
|
|
1049
|
+
}).length;
|
|
1050
|
+
}
|
|
1051
|
+
const issues = [];
|
|
1052
|
+
if (validCount) issues.push({
|
|
1053
|
+
code: 'docx.run-shading',
|
|
1054
|
+
severity: 'info',
|
|
1055
|
+
feature: 'Character shading',
|
|
1056
|
+
message: `${validCount} native character shading value(s), including ${resetCount} explicit reset(s), were detected across document defaults, styles, body, page chrome, notes, comments, and formatting revisions. Writer preserves every Word pattern mask, direct or automatic foreground and background colors, independently tinted or shaded theme references, and explicit nil semantics through editing, Format Painter, one-step Undo, and exact DOCX export. Native highlight remains independent and takes display precedence.`
|
|
1057
|
+
});
|
|
1058
|
+
if (invalidCount) issues.push({
|
|
1059
|
+
code: 'docx.run-shading.invalid',
|
|
1060
|
+
severity: 'warning',
|
|
1061
|
+
feature: 'Character shading',
|
|
1062
|
+
message: `${invalidCount} malformed, duplicated, misplaced, namespace-spoofed, text-bearing, child-bearing, extra-attribute, or unresolved-theme character shading value(s) are normalized to explicit nil resets instead of enabling untrusted paint or inheriting stale formatting.`
|
|
1063
|
+
});
|
|
1064
|
+
return issues;
|
|
1065
|
+
}
|
|
906
1066
|
const SUPPORTED_CHART_ELEMENTS = new Set([
|
|
907
1067
|
'barChart',
|
|
908
1068
|
'lineChart',
|
|
@@ -1930,6 +2090,9 @@ async function analyzeDocxCompatibility(file, messages, sourcePackage) {
|
|
|
1930
2090
|
issues.push(...await diagnoseDocxEmphasisMarks(archive, document));
|
|
1931
2091
|
issues.push(...await diagnoseDocxHiddenText(archive, document));
|
|
1932
2092
|
issues.push(...await diagnoseDocxLegacyTextEffects(archive, document));
|
|
2093
|
+
issues.push(...await diagnoseDocxRunBorders(archive, document));
|
|
2094
|
+
issues.push(...await diagnoseDocxRunShading(archive, document));
|
|
2095
|
+
issues.push(...await diagnoseDocxProofing(archive, document));
|
|
1933
2096
|
issues.push(...await diagnoseDocxRunFonts(archive, document));
|
|
1934
2097
|
}
|
|
1935
2098
|
issues.push(...await diagnoseDocxPageChrome(archive));
|
|
@@ -1961,7 +2124,7 @@ async function analyzeDocxCompatibility(file, messages, sourcePackage) {
|
|
|
1961
2124
|
const supportedRunFormattingRevisionCount = runFormattingRevisions.filter(isSupportedDocxRunFormattingChange).length;
|
|
1962
2125
|
const supportedParagraphFormattingRevisionCount = paragraphFormattingRevisions.filter(isSupportedDocxParagraphFormattingChange).length;
|
|
1963
2126
|
if (textRevisions.some((revision)=>descendants(revision, 't').length || descendants(revision, 'delText').length)) issues.push(work_office_diagnostics_issue('docx.revisions', 'Tracked changes', 'Body-text insertions and deletions preserve their author and date, remain reviewable in Work, and round-trip as native DOCX revisions.', 'info'));
|
|
1964
|
-
if (supportedRunFormattingRevisionCount) issues.push(work_office_diagnostics_issue('docx.revisions.formatting', 'Character-formatting revisions', `${supportedRunFormattingRevisionCount} bounded character-formatting revision(s) preserve author, date, current formatting, and prior bold, italic, underline, strike, text case, hidden text, outline, shadow, emboss, imprint, subscript, superscript, font, size, color, highlight, character scale, spacing, kerning threshold, emphasis mark, baseline position, and
|
|
2127
|
+
if (supportedRunFormattingRevisionCount) issues.push(work_office_diagnostics_issue('docx.revisions.formatting', 'Character-formatting revisions', `${supportedRunFormattingRevisionCount} bounded character-formatting revision(s) preserve author, date, current formatting, and prior bold, italic, underline, strike, text case, hidden text, outline, shadow, emboss, imprint, subscript, superscript, font, size, color, highlight, character borders, character shading, character scale, spacing, kerning threshold, emphasis mark, baseline position, grid state, proofing languages, and explicit proofing state. They remain reviewable in Work and round-trip as native w:rPrChange records.`, 'info'));
|
|
1965
2128
|
if (supportedParagraphFormattingRevisionCount) issues.push(work_office_diagnostics_issue('docx.revisions.paragraph-formatting', 'Paragraph-formatting revisions', `${supportedParagraphFormattingRevisionCount} bounded paragraph-formatting revision(s) preserve author, date, current formatting, and prior alignment, direction, indentation, spacing, pagination, outline, tab-stop, border, shading, and collapsed state. They remain reviewable in Work and round-trip as native w:pPrChange records.`, 'info'));
|
|
1966
2129
|
if (textRevisions.some((revision)=>!descendants(revision, 't').length && !descendants(revision, 'delText').length) || supportedRunFormattingRevisionCount !== runFormattingRevisions.length || supportedParagraphFormattingRevisionCount !== paragraphFormattingRevisions.length || [
|
|
1967
2130
|
'moveFrom',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import jszip from "jszip";
|
|
2
2
|
import { normalizeRadarStyle, presentationChartShowsLegend, presentationChartAxes, presentationChartBubbleSizes, normalizePresentationBubbleScale, presentationChartUsesNumericXAxis, normalizePresentationBubbleSizeRepresents, normalizePresentationChartLegendPosition, presentationChartXValues, normalizeDoughnutHoleSize, presentationChartSupportsAxisTitles, normalizePresentationScatterStyle } from "./0~work-presentation-charts.js";
|
|
3
|
-
import { directChildren, xmlNamespacePrefix, parseXml, firstDescendant, directChild, descendants, childPath, attribute } from "./
|
|
3
|
+
import { directChildren, xmlNamespacePrefix, parseXml, firstDescendant, directChild, descendants, childPath, attribute } from "./4121.js";
|
|
4
4
|
import { workSpreadsheetChartAxisShowsMajorGridlinesByDefault, workSpreadsheetChartAxisDefaultLabelPosition, workSpreadsheetChartAxisIsCategoryAxis, workSpreadsheetChartAxisIsValueAxis } from "./8715.js";
|
|
5
5
|
import { presentationGroupPath, withPresentationDesign } from "./0~1403.js";
|
|
6
6
|
import { patchPptxChartLayoutAndSeriesStyles, patchPptxTransitions, patchPptxComments, patchPptxChartDataLabels, patchPptxChartSeriesAnalysis } from "./0~7614.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { contentTypeForPart, directChildren, bytesToDataUrl, OoxmlPackage, firstDescendant, descendants, directChild, childPath, attribute, createOfficeId as createWorkId } from "./
|
|
1
|
+
import { contentTypeForPart, directChildren, bytesToDataUrl, OoxmlPackage, firstDescendant, descendants, directChild, childPath, attribute, createOfficeId as createWorkId } from "./4121.js";
|
|
2
2
|
import { normalizeRadarStyle, normalizePresentationChartLegendPosition, presentationChartUsesNumericXAxis, normalizePresentationBubbleScale, normalizePresentationBubbleSizeRepresents, withPresentationChartLayout, normalizeDoughnutHoleSize, normalizePresentationScatterStyle } from "./0~work-presentation-charts.js";
|
|
3
3
|
import { loadPptxCommentAuthors, readPptxSlideComments, readPptxChartLayoutAndSeriesStyles, readPptxTransition, readPptxChartSeriesAnalysis, readPptxChartDataLabels } from "./0~7614.js";
|
|
4
4
|
import { parseXlsxChartAxes } from "./4104.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { workSpreadsheetChartSupportsErrorBars, normalizeWorkSpreadsheetChartAxes, normalizeWorkSpreadsheetErrorBars, normalizeWorkSpreadsheetChartLayout, workSpreadsheetChartSupportsTrendlines, workSpreadsheetChartSupportsSeriesAnalysis, normalizeWorkSpreadsheetChartSeriesStyle, normalizeWorkSpreadsheetTrendline } from "./8715.js";
|
|
2
|
-
import { createOfficeId as createWorkId } from "./
|
|
2
|
+
import { createOfficeId as createWorkId } from "./4121.js";
|
|
3
3
|
function chartTypeWithAxes(type) {
|
|
4
4
|
return 'pie' === type || 'doughnut' === type ? 'column' : type;
|
|
5
5
|
}
|
package/dist/1544.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { workOfficeCollaborationJsonEqual, canonicalWorkOfficeCollaborationJson, isWorkOfficeCollaborationRecord, cloneWorkOfficeCollaborationJson } from "./4650.js";
|
|
2
2
|
import { initializeWorkOfficeCollaborationMetadata, assertWorkOfficeCollaborationEditable, OfficeCollaborationError as WorkOfficeCollaborationError, readOfficeCollaborationMetadata as readWorkOfficeCollaborationMetadata, registerWorkOfficeCollaborationInitializer, markWorkOfficeCollaborationInitialized, assertWorkOfficeCollaborationOrigin } from "./9787.js";
|
|
3
|
-
import { directChild, directChildren, descendants, OFFICE_KERNEL_SPREADSHEET_MAX_ROWS, attribute, firstDescendant } from "./
|
|
3
|
+
import { directChild, directChildren, descendants, OFFICE_KERNEL_SPREADSHEET_MAX_ROWS, attribute, firstDescendant } from "./4121.js";
|
|
4
4
|
import { sparseMatrixColumnCount, cloneSparseMatrix, sparseArrayEntries as spreadsheet_sparse_sparseArrayEntries, formatSpreadsheetCellRanges, isValidSpreadsheetDefinedName, parseSpreadsheetCellRanges as work_spreadsheet_ranges_parseSpreadsheetCellRanges, sparseArrayIndexes } from "./8715.js";
|
|
5
5
|
import { patchWorkOfficeCollaborationFlatJsonMap, readWorkOfficeCollaborationFlatJsonMap } from "./7060.js";
|
|
6
6
|
import * as __rspack_external_yjs from "yjs";
|
|
@@ -2974,6 +2974,18 @@ function stringRecord(value) {
|
|
|
2974
2974
|
return entries.length ? Object.fromEntries(entries) : void 0;
|
|
2975
2975
|
}
|
|
2976
2976
|
const MILLISECONDS_PER_DAY = 86400000;
|
|
2977
|
+
const SPREADSHEET_DATA_VALIDATION_ERROR_STYLES = [
|
|
2978
|
+
'stop',
|
|
2979
|
+
'warning',
|
|
2980
|
+
'information'
|
|
2981
|
+
];
|
|
2982
|
+
function normalizeSpreadsheetDataValidationErrorStyle(value) {
|
|
2983
|
+
return SPREADSHEET_DATA_VALIDATION_ERROR_STYLES.includes(value) ? value : 'stop';
|
|
2984
|
+
}
|
|
2985
|
+
function boundedSpreadsheetDataValidationText(value, limit) {
|
|
2986
|
+
if ('string' != typeof value || !Number.isSafeInteger(limit) || limit < 0) return '';
|
|
2987
|
+
return Array.from(value.trim()).slice(0, limit).join('');
|
|
2988
|
+
}
|
|
2977
2989
|
function normalizeSpreadsheetDateValidationBoundary(value, uses1904DateSystem = false) {
|
|
2978
2990
|
const trimmed = value.trim().replace(/^=/, '');
|
|
2979
2991
|
const iso = normalizeIsoDate(trimmed);
|
|
@@ -4217,4 +4229,4 @@ function work_xlsx_rich_text_nonNegativeInteger(value) {
|
|
|
4217
4229
|
function work_xlsx_rich_text_isRecord(value) {
|
|
4218
4230
|
return 'object' == typeof value && null !== value && !Array.isArray(value);
|
|
4219
4231
|
}
|
|
4220
|
-
export { DEFAULT_PROTECTION_HINT, SPREADSHEET_CONDITIONAL_COMPARISON_OPERATORS, SPREADSHEET_CONDITIONAL_ICON_SETS, activeXlsxNativeFill, activeXlsxSemanticColorOrigin, applyImportedXlsxRichText, applyXlsxSemanticColorOrigin, attachSpreadsheetShownCommentCells, coalesceXlsxRichTextRuns, createWorkOfficeSpreadsheetCollaborationBinding as createOfficeSpreadsheetCollaborationBinding, createXlsxColorResolver, createXlsxRichTextReadContext, defaultSpreadsheetColorScaleThresholds, defaultSpreadsheetConditionalIconThresholds, defaultSpreadsheetDataBarOptions, defaultXlsxBorder, defaultXlsxFill, deleteXlsxNativeFills, directXlsxAlignment, directXlsxFontStyle, drawSpreadsheetConditionalIcon, editableRangeCellCount, editableRangeRequiresCredentials, effectiveSpreadsheetPageSetup, ensureXlsxStyleCollection, freezeImportedSpreadsheetCell, hasXlsxDirectFontStyle, importedSheetProtectionAuthority, initializeWorkOfficeSpreadsheetCollaboration as initializeOfficeSpreadsheetCollaboration, isHighSurrogate, isLowSurrogate, isSpreadsheetConditionalComparisonOperator, isSpreadsheetConditionalIconSetName, isSpreadsheetTextOrientationId, isSpreadsheetUnderlineStyle, normalizeSheetProtectionAuthority, normalizeSpreadsheetConditionalIconSetFormat, normalizeSpreadsheetConditionalVisualOptions, normalizeSpreadsheetDateValidationBoundary, normalizeSpreadsheetPaperSize, normalizeXlsxGradientFill, normalizeXlsxPatternFill, normalizeXlsxRichTextCell, normalizeXlsxRichTextColor, normalizeXlsxRichTextEditSource, normalizeXlsxRichTextRun, normalizeXlsxSemanticColorOrigin, patchSpreadsheetRichTextFontRuns, prepareXlsxSemanticPalette, protectedSheetCount, readWorkOfficeSpreadsheetCollaboration as readOfficeSpreadsheetCollaboration, readXlsxGradientFill, readXlsxPatternFill, readXlsxRichTextCells, readXlsxSemanticColorOrigin, registerDerivedSpreadsheetMatrix, registerImportedSpreadsheetMatrix, replaceWorkOfficeSpreadsheetCollaboration as replaceOfficeSpreadsheetCollaboration, resolveXlsxColor, sameSpreadsheetHistoryValue, sameXlsxRichTextRunStyle, setXlsxBorderLine, setXlsxColorChild, setXlsxToggleChild, setXlsxUnderlineChild, setXlsxValueChild, sheetHasProtectionState, sheetHasXlsxRichTextCells, sheetProtectionAuthority, spreadsheetCellValueWithDiagonalBorder, spreadsheetConditionalComparisonNeedsUpperValue, spreadsheetConditionalIconForValue, spreadsheetConditionalIconSetCount, spreadsheetConditionalThresholdValue, spreadsheetConditionalThresholdsEqual, spreadsheetDateValidationFormula, spreadsheetDiagonalBorderFromCellValue, spreadsheetExplicitTextOrientationFromCell, spreadsheetMatrixProfile, spreadsheetProtectionKey, spreadsheetTextOrientationCellStyle, spreadsheetTextOrientationChoiceFromCell, spreadsheetTextOrientationFromAngle, spreadsheetTextOrientationFromCell, spreadsheetTextOrientationFromChoice, spreadsheetTextOrientationFromXlsx, spreadsheetUnderlineCellValue, spreadsheetUnderlineCellValueFromSheetJs, spreadsheetUnderlineCellValueFromXlsx, spreadsheetUnderlineStyle, spreadsheetVisibleTextRotationFromCell, unlockedCellCount, validXlsxRichText, withEditableRange, withSheetProtection, withSheetSelectionPermissions, withXlsxCellStyleOrigin, withXlsxGradientFill, withXlsxPatternFill, withoutEditableRange, work_xlsx_cell_style_values_xlsxBooleanAttribute, writeXlsxAlignment, writeXlsxRichTextCells, xlsxAlignmentMatches, xlsxBorderLineMatches, xlsxCellStyleOrigin, xlsxCellStyleOriginSemanticColors, xlsxColorElementMatchesOrigin, xlsxColorMatches, xlsxGradientFillFallbackColor, xlsxGradientFillKey, xlsxNativeFillCellKeys, xlsxNativeFillKey, xlsxNativeFillSemanticColors, xlsxPatternFillTypes, xlsxRgbColor, xlsxRichTextCellText, xlsxRichTextStyleOrigins, xlsxSemanticColorMatchesValue, xlsxSemanticColorOriginKey, xlsxStyleCollectionIndex, xlsxToggleEnabled, xlsxUnderlineStyle, xlsxWorksheetCellEntries };
|
|
4232
|
+
export { DEFAULT_PROTECTION_HINT, SPREADSHEET_CONDITIONAL_COMPARISON_OPERATORS, SPREADSHEET_CONDITIONAL_ICON_SETS, activeXlsxNativeFill, activeXlsxSemanticColorOrigin, applyImportedXlsxRichText, applyXlsxSemanticColorOrigin, attachSpreadsheetShownCommentCells, boundedSpreadsheetDataValidationText, coalesceXlsxRichTextRuns, createWorkOfficeSpreadsheetCollaborationBinding as createOfficeSpreadsheetCollaborationBinding, createXlsxColorResolver, createXlsxRichTextReadContext, defaultSpreadsheetColorScaleThresholds, defaultSpreadsheetConditionalIconThresholds, defaultSpreadsheetDataBarOptions, defaultXlsxBorder, defaultXlsxFill, deleteXlsxNativeFills, directXlsxAlignment, directXlsxFontStyle, drawSpreadsheetConditionalIcon, editableRangeCellCount, editableRangeRequiresCredentials, effectiveSpreadsheetPageSetup, ensureXlsxStyleCollection, freezeImportedSpreadsheetCell, hasXlsxDirectFontStyle, importedSheetProtectionAuthority, initializeWorkOfficeSpreadsheetCollaboration as initializeOfficeSpreadsheetCollaboration, isHighSurrogate, isLowSurrogate, isSpreadsheetConditionalComparisonOperator, isSpreadsheetConditionalIconSetName, isSpreadsheetTextOrientationId, isSpreadsheetUnderlineStyle, normalizeSheetProtectionAuthority, normalizeSpreadsheetConditionalIconSetFormat, normalizeSpreadsheetConditionalVisualOptions, normalizeSpreadsheetDataValidationErrorStyle, normalizeSpreadsheetDateValidationBoundary, normalizeSpreadsheetPaperSize, normalizeXlsxGradientFill, normalizeXlsxPatternFill, normalizeXlsxRichTextCell, normalizeXlsxRichTextColor, normalizeXlsxRichTextEditSource, normalizeXlsxRichTextRun, normalizeXlsxSemanticColorOrigin, patchSpreadsheetRichTextFontRuns, prepareXlsxSemanticPalette, protectedSheetCount, readWorkOfficeSpreadsheetCollaboration as readOfficeSpreadsheetCollaboration, readXlsxGradientFill, readXlsxPatternFill, readXlsxRichTextCells, readXlsxSemanticColorOrigin, registerDerivedSpreadsheetMatrix, registerImportedSpreadsheetMatrix, replaceWorkOfficeSpreadsheetCollaboration as replaceOfficeSpreadsheetCollaboration, resolveXlsxColor, sameSpreadsheetHistoryValue, sameXlsxRichTextRunStyle, setXlsxBorderLine, setXlsxColorChild, setXlsxToggleChild, setXlsxUnderlineChild, setXlsxValueChild, sheetHasProtectionState, sheetHasXlsxRichTextCells, sheetProtectionAuthority, spreadsheetCellValueWithDiagonalBorder, spreadsheetConditionalComparisonNeedsUpperValue, spreadsheetConditionalIconForValue, spreadsheetConditionalIconSetCount, spreadsheetConditionalThresholdValue, spreadsheetConditionalThresholdsEqual, spreadsheetDateValidationFormula, spreadsheetDiagonalBorderFromCellValue, spreadsheetExplicitTextOrientationFromCell, spreadsheetMatrixProfile, spreadsheetProtectionKey, spreadsheetTextOrientationCellStyle, spreadsheetTextOrientationChoiceFromCell, spreadsheetTextOrientationFromAngle, spreadsheetTextOrientationFromCell, spreadsheetTextOrientationFromChoice, spreadsheetTextOrientationFromXlsx, spreadsheetUnderlineCellValue, spreadsheetUnderlineCellValueFromSheetJs, spreadsheetUnderlineCellValueFromXlsx, spreadsheetUnderlineStyle, spreadsheetVisibleTextRotationFromCell, unlockedCellCount, validXlsxRichText, withEditableRange, withSheetProtection, withSheetSelectionPermissions, withXlsxCellStyleOrigin, withXlsxGradientFill, withXlsxPatternFill, withoutEditableRange, work_xlsx_cell_style_values_xlsxBooleanAttribute, writeXlsxAlignment, writeXlsxRichTextCells, xlsxAlignmentMatches, xlsxBorderLineMatches, xlsxCellStyleOrigin, xlsxCellStyleOriginSemanticColors, xlsxColorElementMatchesOrigin, xlsxColorMatches, xlsxGradientFillFallbackColor, xlsxGradientFillKey, xlsxNativeFillCellKeys, xlsxNativeFillKey, xlsxNativeFillSemanticColors, xlsxPatternFillTypes, xlsxRgbColor, xlsxRichTextCellText, xlsxRichTextStyleOrigins, xlsxSemanticColorMatchesValue, xlsxSemanticColorOriginKey, xlsxStyleCollectionIndex, xlsxToggleEnabled, xlsxUnderlineStyle, xlsxWorksheetCellEntries };
|
package/dist/4104.js
CHANGED
|
@@ -2,10 +2,10 @@ import jszip from "jszip";
|
|
|
2
2
|
import { MarkdownManager } from "@tiptap/markdown";
|
|
3
3
|
import { getSchema } from "@tiptap/core";
|
|
4
4
|
import { OFFICE_COLLABORATION_PROTOCOL as WORK_OFFICE_COLLABORATION_PROTOCOL, OfficeCollaborationError as WorkOfficeCollaborationError, assertWorkOfficeCollaborationOrigin } from "./9787.js";
|
|
5
|
-
import { contentTypeForPart, directChildren, bytesToDataUrl, OoxmlPackage as work_ooxml_package_OoxmlPackage, parseXml, firstDescendant, xmlNamespacePrefix, descendants, directChild, createArtifact as createWorkArtifact, xmlContainsAnyElement, createOfficeId as createWorkId, attribute as work_ooxml_package_attribute } from "./
|
|
5
|
+
import { contentTypeForPart, directChildren, bytesToDataUrl, OoxmlPackage as work_ooxml_package_OoxmlPackage, parseXml, firstDescendant, xmlNamespacePrefix, descendants, directChild, createArtifact as createWorkArtifact, xmlContainsAnyElement, createOfficeId as createWorkId, attribute as work_ooxml_package_attribute } from "./4121.js";
|
|
6
6
|
import { mountWorkLiveDocumentCapture, materializeWorkDocumentContent as work_document_model_codec_materializeWorkDocumentContent, documentPageSurfaceGeometryForElement, createWorkDocumentModel, documentContentLayoutProperties, documentModelForContent, createWorkDocumentExtensions, positionWorkLiveDocumentCapture } from "./6282.js";
|
|
7
7
|
import { normalizeWorkSpreadsheetDataLabels, workSpreadsheetChartSupportsGrouping, normalizeSpreadsheetPrintArea, normalizeWorkSpreadsheetChartLegendPosition, formatSpreadsheetCellRanges, spreadsheetCellAddress, normalizeWorkSpreadsheetChartSmoothLines, spreadsheetFormulaRangeForCell, normalizeWorkSpreadsheetChartColor, readXlsxDrawingAnchor, sparseArrayEntries, qualifySpreadsheetRange, normalizeWorkSpreadsheetBubbleScale, normalizeWorkSpreadsheetChartSeriesStyle, normalizeSpreadsheetPrintTitleRows, normalizeSpreadsheetPrintTitleColumns, spreadsheetPivotFilterValueKey, normalizeWorkSpreadsheetErrorBars, normalizeWorkSpreadsheetBubbleSizeRepresents, workSpreadsheetChartSupportsTrendlines, stripSpreadsheetSheetQualifier, normalizeWorkSpreadsheetChartLegendOverlay, normalizeWorkSpreadsheetChartGapWidth, normalizeWorkSpreadsheetChartGrouping, workSpreadsheetChartSupportsBarSpacing, workSpreadsheetChartSupportsSmoothLines, workSpreadsheetChartGroupingIsStacked, xlsxDrawingAnchorToBounds, xlsxTwoCellAnchorMarkers, workSpreadsheetChartSupportsErrorBars, sparseMatrixColumnCount, refreshSpreadsheetPivotTables, normalizeWorkSpreadsheetChartAxisGroup, isValidSpreadsheetDefinedName, normalizeWorkSpreadsheetScatterStyle, workSpreadsheetChartAxisDefaultLabelPosition, spreadsheetPivotValidation, resolveSpreadsheetChart, parseSpreadsheetCellRanges, workSpreadsheetChartAxisIsCategoryAxis, spreadsheetPivotFields, normalizeWorkSpreadsheetDoughnutHoleSize, normalizeWorkSpreadsheetChartAxes, parseSpreadsheetPrintTitles, spreadsheetFormulaRangeConflict, spreadsheetFormulaForXlsx, editableSpreadsheetFormula, workSpreadsheetChartUsesNumericXAxis, normalizeWorkSpreadsheetChartOverlap, workSpreadsheetChartSupportsAxes, workSpreadsheetChartAxisShowsMajorGridlinesByDefault, normalizeWorkSpreadsheetCombinationSeriesType, effectiveSpreadsheetCalculationSettings, normalizeWorkSpreadsheetTrendline, normalizeWorkSpreadsheetRadarStyle } from "./8715.js";
|
|
8
|
-
import { freezeImportedSpreadsheetCell, readXlsxGradientFill, withXlsxPatternFill, xlsxCellStyleOriginSemanticColors, setXlsxToggleChild, work_xlsx_cell_style_values_xlsxBooleanAttribute, spreadsheetCellValueWithDiagonalBorder, xlsxRichTextCellText, xlsxColorElementMatchesOrigin, ensureXlsxStyleCollection, xlsxSemanticColorOriginKey, applyImportedXlsxRichText, hasXlsxDirectFontStyle, isSpreadsheetConditionalComparisonOperator, xlsxStyleCollectionIndex, spreadsheetExplicitTextOrientationFromCell, readXlsxSemanticColorOrigin, activeXlsxNativeFill, defaultSpreadsheetConditionalIconThresholds, DEFAULT_PROTECTION_HINT, sheetHasXlsxRichTextCells, normalizeSpreadsheetDateValidationBoundary, createXlsxColorResolver, resolveXlsxColor, setXlsxBorderLine, xlsxAlignmentMatches, xlsxBorderLineMatches, xlsxNativeFillKey, defaultXlsxBorder, editableRangeRequiresCredentials, spreadsheetDateValidationFormula, defaultSpreadsheetColorScaleThresholds, writeXlsxAlignment, xlsxGradientFillKey, applyXlsxSemanticColorOrigin, spreadsheetUnderlineCellValueFromXlsx, xlsxWorksheetCellEntries, defaultXlsxFill, spreadsheetConditionalThresholdsEqual, spreadsheetUnderlineCellValueFromSheetJs, xlsxColorMatches, withXlsxCellStyleOrigin, normalizeSpreadsheetPaperSize, normalizeSpreadsheetConditionalVisualOptions, xlsxRichTextStyleOrigins, withXlsxGradientFill, xlsxCellStyleOrigin, directXlsxAlignment, readXlsxPatternFill, spreadsheetTextOrientationFromXlsx, directXlsxFontStyle, registerImportedSpreadsheetMatrix, setXlsxUnderlineChild, readXlsxRichTextCells, xlsxGradientFillFallbackColor, setXlsxColorChild, createXlsxRichTextReadContext, spreadsheetTextOrientationCellStyle, normalizeSpreadsheetConditionalIconSetFormat, defaultSpreadsheetDataBarOptions, prepareXlsxSemanticPalette, normalizeSheetProtectionAuthority, importedSheetProtectionAuthority, spreadsheetDiagonalBorderFromCellValue, xlsxRgbColor, xlsxUnderlineStyle, sheetHasProtectionState, spreadsheetConditionalComparisonNeedsUpperValue, xlsxToggleEnabled, writeXlsxRichTextCells, activeXlsxSemanticColorOrigin, xlsxNativeFillSemanticColors, isSpreadsheetConditionalIconSetName, setXlsxValueChild, spreadsheetConditionalIconSetCount } from "./1544.js";
|
|
8
|
+
import { freezeImportedSpreadsheetCell, readXlsxGradientFill, withXlsxPatternFill, xlsxCellStyleOriginSemanticColors, setXlsxToggleChild, work_xlsx_cell_style_values_xlsxBooleanAttribute, spreadsheetCellValueWithDiagonalBorder, xlsxRichTextCellText, xlsxColorElementMatchesOrigin, ensureXlsxStyleCollection, xlsxSemanticColorOriginKey, applyImportedXlsxRichText, hasXlsxDirectFontStyle, isSpreadsheetConditionalComparisonOperator, xlsxStyleCollectionIndex, spreadsheetExplicitTextOrientationFromCell, readXlsxSemanticColorOrigin, activeXlsxNativeFill, defaultSpreadsheetConditionalIconThresholds, DEFAULT_PROTECTION_HINT, sheetHasXlsxRichTextCells, normalizeSpreadsheetDateValidationBoundary, createXlsxColorResolver, resolveXlsxColor, setXlsxBorderLine, xlsxAlignmentMatches, xlsxBorderLineMatches, xlsxNativeFillKey, defaultXlsxBorder, editableRangeRequiresCredentials, spreadsheetDateValidationFormula, defaultSpreadsheetColorScaleThresholds, writeXlsxAlignment, xlsxGradientFillKey, applyXlsxSemanticColorOrigin, spreadsheetUnderlineCellValueFromXlsx, xlsxWorksheetCellEntries, defaultXlsxFill, spreadsheetConditionalThresholdsEqual, spreadsheetUnderlineCellValueFromSheetJs, xlsxColorMatches, withXlsxCellStyleOrigin, normalizeSpreadsheetPaperSize, normalizeSpreadsheetConditionalVisualOptions, xlsxRichTextStyleOrigins, withXlsxGradientFill, normalizeSpreadsheetDataValidationErrorStyle, xlsxCellStyleOrigin, directXlsxAlignment, readXlsxPatternFill, spreadsheetTextOrientationFromXlsx, directXlsxFontStyle, registerImportedSpreadsheetMatrix, boundedSpreadsheetDataValidationText, setXlsxUnderlineChild, readXlsxRichTextCells, xlsxGradientFillFallbackColor, setXlsxColorChild, createXlsxRichTextReadContext, spreadsheetTextOrientationCellStyle, normalizeSpreadsheetConditionalIconSetFormat, defaultSpreadsheetDataBarOptions, prepareXlsxSemanticPalette, normalizeSheetProtectionAuthority, importedSheetProtectionAuthority, spreadsheetDiagonalBorderFromCellValue, xlsxRgbColor, xlsxUnderlineStyle, sheetHasProtectionState, spreadsheetConditionalComparisonNeedsUpperValue, xlsxToggleEnabled, writeXlsxRichTextCells, activeXlsxSemanticColorOrigin, xlsxNativeFillSemanticColors, isSpreadsheetConditionalIconSetName, setXlsxValueChild, spreadsheetConditionalIconSetCount } from "./1544.js";
|
|
9
9
|
import { WorkFileImportController, materializeWorkFileSource } from "./9356.js";
|
|
10
10
|
import "./2591.js";
|
|
11
11
|
import "./3818.js";
|
|
@@ -509,7 +509,7 @@ async function importWorkDocumentFile(file, extension, context) {
|
|
|
509
509
|
const importStartedAt = documentImportNow();
|
|
510
510
|
const arrayBuffer = context?.bytes ?? await file.arrayBuffer();
|
|
511
511
|
context?.controller.report('parsing', 0.1);
|
|
512
|
-
const { OoxmlPackage } = await import("./
|
|
512
|
+
const { OoxmlPackage } = await import("./4121.js");
|
|
513
513
|
const packageStartedAt = documentImportNow();
|
|
514
514
|
const sourcePackage = await OoxmlPackage.load(arrayBuffer).catch(()=>null);
|
|
515
515
|
recordDocumentImportMeasure('a3s-office.document.package', packageStartedAt, documentImportNow());
|
|
@@ -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.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.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),
|
|
@@ -6295,9 +6295,15 @@ function parseDataValidations(document1, uses1904DateSystem) {
|
|
|
6295
6295
|
value2: 'date' === type ? normalizeSpreadsheetDateValidationBoundary(formula2, uses1904DateSystem) ?? formula2 : formula2,
|
|
6296
6296
|
validity: '',
|
|
6297
6297
|
remote: false,
|
|
6298
|
+
allowBlank: work_xlsx_interop_booleanAttribute(element, 'allowBlank'),
|
|
6299
|
+
showDropdownArrow: 'dropdown' === type ? !work_xlsx_interop_booleanAttribute(element, 'showDropDown') : true,
|
|
6298
6300
|
prohibitInput: work_xlsx_interop_booleanAttribute(element, 'showErrorMessage'),
|
|
6301
|
+
errorStyle: normalizeSpreadsheetDataValidationErrorStyle(work_ooxml_package_attribute(element, 'errorStyle')),
|
|
6302
|
+
errorTitle: boundedSpreadsheetDataValidationText(work_ooxml_package_attribute(element, 'errorTitle'), 32),
|
|
6303
|
+
errorMessage: boundedSpreadsheetDataValidationText(work_ooxml_package_attribute(element, 'error'), 225),
|
|
6299
6304
|
hintShow: work_xlsx_interop_booleanAttribute(element, 'showInputMessage'),
|
|
6300
|
-
|
|
6305
|
+
hintTitle: boundedSpreadsheetDataValidationText(work_ooxml_package_attribute(element, 'promptTitle'), 32),
|
|
6306
|
+
hintValue: boundedSpreadsheetDataValidationText(work_ooxml_package_attribute(element, 'prompt'), 255),
|
|
6301
6307
|
checked: false
|
|
6302
6308
|
};
|
|
6303
6309
|
return [
|
|
@@ -6323,10 +6329,15 @@ function writeDataValidations(document1, source, compact, namedListSources) {
|
|
|
6323
6329
|
element.setAttribute('type', validationType);
|
|
6324
6330
|
const operator = xlsxValidationOperator(item.type2);
|
|
6325
6331
|
if (operator && 'list' !== validationType) element.setAttribute('operator', operator);
|
|
6326
|
-
element.setAttribute('allowBlank', '1');
|
|
6332
|
+
element.setAttribute('allowBlank', item.allowBlank ? '1' : '0');
|
|
6333
|
+
if ('list' === validationType) element.setAttribute('showDropDown', item.showDropdownArrow ? '0' : '1');
|
|
6327
6334
|
element.setAttribute('showErrorMessage', item.prohibitInput ? '1' : '0');
|
|
6335
|
+
element.setAttribute('errorStyle', item.errorStyle ?? 'stop');
|
|
6336
|
+
if (item.errorTitle) element.setAttribute('errorTitle', boundedSpreadsheetDataValidationText(item.errorTitle, 32));
|
|
6337
|
+
if (item.errorMessage) element.setAttribute('error', boundedSpreadsheetDataValidationText(item.errorMessage, 225));
|
|
6328
6338
|
element.setAttribute('showInputMessage', item.hintShow ? '1' : '0');
|
|
6329
|
-
if (item.
|
|
6339
|
+
if (item.hintTitle) element.setAttribute('promptTitle', boundedSpreadsheetDataValidationText(item.hintTitle, 32));
|
|
6340
|
+
if (item.hintValue) element.setAttribute('prompt', boundedSpreadsheetDataValidationText(item.hintValue, 255));
|
|
6330
6341
|
element.setAttribute('sqref', references.join(' '));
|
|
6331
6342
|
work_xlsx_interop_appendFormula(document1, element, 'formula1', xlsxValidationFormula(item, item.value1, namedListSources));
|
|
6332
6343
|
if (item.value2) work_xlsx_interop_appendFormula(document1, element, 'formula2', xlsxValidationFormula(item, item.value2, namedListSources));
|
|
@@ -6378,8 +6389,14 @@ function validationSignature(item) {
|
|
|
6378
6389
|
type2: item.type2,
|
|
6379
6390
|
value1: item.value1,
|
|
6380
6391
|
value2: item.value2,
|
|
6392
|
+
allowBlank: item.allowBlank,
|
|
6393
|
+
showDropdownArrow: item.showDropdownArrow,
|
|
6381
6394
|
prohibitInput: item.prohibitInput,
|
|
6395
|
+
errorStyle: item.errorStyle,
|
|
6396
|
+
errorTitle: item.errorTitle,
|
|
6397
|
+
errorMessage: item.errorMessage,
|
|
6382
6398
|
hintShow: item.hintShow,
|
|
6399
|
+
hintTitle: item.hintTitle,
|
|
6383
6400
|
hintValue: item.hintValue
|
|
6384
6401
|
});
|
|
6385
6402
|
}
|
|
@@ -6395,9 +6412,15 @@ function fortuneDataValidationItem(value) {
|
|
|
6395
6412
|
value2: 'string' == typeof item.value2 ? item.value2 : String(item.value2 ?? ''),
|
|
6396
6413
|
validity: 'string' == typeof item.validity ? item.validity : '',
|
|
6397
6414
|
remote: Boolean(item.remote),
|
|
6415
|
+
allowBlank: 'boolean' == typeof item.allowBlank ? item.allowBlank : true,
|
|
6416
|
+
showDropdownArrow: 'boolean' == typeof item.showDropdownArrow ? item.showDropdownArrow : true,
|
|
6398
6417
|
prohibitInput: Boolean(item.prohibitInput),
|
|
6418
|
+
errorStyle: normalizeSpreadsheetDataValidationErrorStyle(item.errorStyle),
|
|
6419
|
+
errorTitle: boundedSpreadsheetDataValidationText(item.errorTitle, 32),
|
|
6420
|
+
errorMessage: boundedSpreadsheetDataValidationText(item.errorMessage, 225),
|
|
6399
6421
|
hintShow: Boolean(item.hintShow),
|
|
6400
|
-
|
|
6422
|
+
hintTitle: boundedSpreadsheetDataValidationText(item.hintTitle, 32),
|
|
6423
|
+
hintValue: boundedSpreadsheetDataValidationText(item.hintValue, 255),
|
|
6401
6424
|
checked: Boolean(item.checked)
|
|
6402
6425
|
};
|
|
6403
6426
|
}
|