@a3s-lab/office 0.29.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 +117 -3
- package/dist/{0~7043.js → 0~4808.js} +347 -2
- package/dist/0~5050.js +10 -1
- package/dist/{0~5093.js → 0~7240.js} +465 -55
- package/dist/0~document-editor.js +1694 -187
- package/dist/0~spreadsheet-editor.js +183 -34
- package/dist/0~work-docx-export.js +507 -31
- package/dist/0~work-docx-import.js +41 -7
- package/dist/0~work-office-diagnostics.js +146 -5
- package/dist/1544.js +13 -1
- package/dist/4104.js +29 -6
- package/dist/4121.js +2340 -1
- package/dist/6282.js +1072 -1148
- package/dist/internal/features/work/editors/document-command-catalog.d.ts +45 -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-font-dialog-model.d.ts +5 -2
- 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-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-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-references-ribbon.d.ts +19 -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 +6 -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 +5 -0
- package/dist/internal/features/work/work-document-character-formatting.d.ts +8 -0
- package/dist/internal/features/work/work-document-format-changes.d.ts +6 -0
- package/dist/internal/features/work/work-document-highlight.d.ts +9 -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-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-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 +3 -0
- package/dist/internal/features/work/work-docx-field-instructions.d.ts +1 -1
- package/dist/internal/features/work/work-docx-import.d.ts +5 -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/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-formatting-import.d.ts +7 -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 +607 -4
- package/docs/latest/en/browser-editor-architecture.md +64 -1
- package/package.json +15 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import jszip from "jszip";
|
|
2
|
-
import { documentRunBorderDomAttributes, contentTypeForPart,
|
|
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,
|
|
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, 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
|
+
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 { 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';
|
|
@@ -1824,8 +1824,14 @@ 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>`;
|
|
1829
1835
|
const runBorder = resolveDocxRunBorder(propertySources, context.theme).border;
|
|
1830
1836
|
if (runBorder) content = `<span${htmlAttributes(documentRunBorderDomAttributes(runBorder))}>${content}</span>`;
|
|
1831
1837
|
const characterSpacing = docxCharacterSpacingTwipsFromProperties(properties ?? run);
|
|
@@ -1905,6 +1911,14 @@ function resolveDocxPageChromeFontSizePoints(propertySources) {
|
|
|
1905
1911
|
}
|
|
1906
1912
|
return fontSize;
|
|
1907
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
|
+
}
|
|
1908
1922
|
function docxPageChromeFontSizePointsFromProperties(properties) {
|
|
1909
1923
|
const localMatches = directChildren(properties, 'sz');
|
|
1910
1924
|
const nativeMatches = localMatches.filter((element)=>DOCX_WORDPROCESSING_NAMESPACES.has(element.namespaceURI ?? ''));
|
|
@@ -2882,6 +2896,13 @@ async function prepareDocxImport(buffer, sourcePackage) {
|
|
|
2882
2896
|
fieldMarkers: {
|
|
2883
2897
|
fields: []
|
|
2884
2898
|
},
|
|
2899
|
+
tableOfContentsMarkers: {
|
|
2900
|
+
tables: []
|
|
2901
|
+
},
|
|
2902
|
+
indexMarkers: {
|
|
2903
|
+
entries: [],
|
|
2904
|
+
indexes: []
|
|
2905
|
+
},
|
|
2885
2906
|
equationMarkers: {
|
|
2886
2907
|
equations: []
|
|
2887
2908
|
},
|
|
@@ -2947,6 +2968,8 @@ async function prepareDocxImport(buffer, sourcePackage) {
|
|
|
2947
2968
|
};
|
|
2948
2969
|
const document = await archive.xml('word/document.xml');
|
|
2949
2970
|
const pageColor = importDocxPageColor(document);
|
|
2971
|
+
const tableOfContentsMarkers = markDocxTablesOfContents(document);
|
|
2972
|
+
const indexMarkers = markDocxIndexes(document);
|
|
2950
2973
|
const paragraphIdentityMarkers = markDocxParagraphIdentities(document);
|
|
2951
2974
|
const numbering = archive.has('word/numbering.xml') ? await archive.xml('word/numbering.xml') : null;
|
|
2952
2975
|
const commentMarkers = await markDocxComments(document, archive);
|
|
@@ -2991,7 +3014,7 @@ async function prepareDocxImport(buffer, sourcePackage) {
|
|
|
2991
3014
|
const trackChanges = Boolean(settings && firstDescendant(settings, 'trackRevisions')) || changeMarkers.changes.length > 0 || paragraphFormattingChangeMarkers.paragraphs.length > 0 || runFormattingMarkers.runs.some((run)=>Boolean(run.change));
|
|
2992
3015
|
const sectionElements = effectiveSectionProperties(document);
|
|
2993
3016
|
if (!sectionElements.length) return {
|
|
2994
|
-
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,
|
|
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,
|
|
2995
3018
|
sections: [
|
|
2996
3019
|
{
|
|
2997
3020
|
id: 'document-section-1',
|
|
@@ -3004,6 +3027,8 @@ async function prepareDocxImport(buffer, sourcePackage) {
|
|
|
3004
3027
|
changeMarkers,
|
|
3005
3028
|
commentMarkers,
|
|
3006
3029
|
fieldMarkers,
|
|
3030
|
+
tableOfContentsMarkers,
|
|
3031
|
+
indexMarkers,
|
|
3007
3032
|
equationMarkers: equationMarkers.markers,
|
|
3008
3033
|
citationMarkers,
|
|
3009
3034
|
listMarkers,
|
|
@@ -3039,7 +3064,7 @@ async function prepareDocxImport(buffer, sourcePackage) {
|
|
|
3039
3064
|
}
|
|
3040
3065
|
if (sections.length > 1) addSectionMarkers(document, sectionElements);
|
|
3041
3066
|
return {
|
|
3042
|
-
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,
|
|
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,
|
|
3043
3068
|
sections,
|
|
3044
3069
|
pageColor,
|
|
3045
3070
|
captionMarkers,
|
|
@@ -3047,6 +3072,8 @@ async function prepareDocxImport(buffer, sourcePackage) {
|
|
|
3047
3072
|
changeMarkers,
|
|
3048
3073
|
commentMarkers,
|
|
3049
3074
|
fieldMarkers,
|
|
3075
|
+
tableOfContentsMarkers,
|
|
3076
|
+
indexMarkers,
|
|
3050
3077
|
equationMarkers: equationMarkers.markers,
|
|
3051
3078
|
citationMarkers,
|
|
3052
3079
|
listMarkers,
|
|
@@ -3082,6 +3109,11 @@ function applyDocxSectionsToHtml(html, sections, captionMarkers = {
|
|
|
3082
3109
|
ranges: []
|
|
3083
3110
|
}, fieldMarkers = {
|
|
3084
3111
|
fields: []
|
|
3112
|
+
}, tableOfContentsMarkers = {
|
|
3113
|
+
tables: []
|
|
3114
|
+
}, indexMarkers = {
|
|
3115
|
+
entries: [],
|
|
3116
|
+
indexes: []
|
|
3085
3117
|
}, equationMarkers = {
|
|
3086
3118
|
equations: []
|
|
3087
3119
|
}, citationMarkers = {
|
|
@@ -3149,6 +3181,8 @@ function applyDocxSectionsToHtml(html, sections, captionMarkers = {
|
|
|
3149
3181
|
applyImportedDocxChangeMarkers(document, changeMarkers);
|
|
3150
3182
|
applyImportedDocxCommentMarkers(document, commentMarkers);
|
|
3151
3183
|
applyImportedDocxParagraphIdentityMarkers(document, paragraphIdentityMarkers);
|
|
3184
|
+
applyImportedDocxTableOfContentsMarkers(document, tableOfContentsMarkers);
|
|
3185
|
+
applyImportedDocxIndexMarkers(document, indexMarkers);
|
|
3152
3186
|
const notes = extractMammothDocumentNotes(document);
|
|
3153
3187
|
const sourceNodes = Array.from(document.body.childNodes);
|
|
3154
3188
|
document.body.replaceChildren();
|
|
@@ -3173,7 +3207,7 @@ function applyDocxSectionsToHtml(html, sections, captionMarkers = {
|
|
|
3173
3207
|
document.body.append(missing);
|
|
3174
3208
|
}
|
|
3175
3209
|
placeMammothDocumentNotes(document, notes);
|
|
3176
|
-
return normalizeDocumentBookmarkReferencesHtml(normalizeDocumentBookmarksHtml(normalizeDocumentCitationsHtml(normalizeDocumentFieldsHtml(normalizeDocumentCaptionsHtml(normalizeDocumentNotesHtml(document.body.innerHTML))), bibliography)));
|
|
3210
|
+
return normalizeDocumentIndexesHtml(normalizeDocumentBookmarkReferencesHtml(normalizeDocumentBookmarksHtml(normalizeDocumentCitationsHtml(normalizeDocumentTableOfContentsHtml(normalizeDocumentFieldsHtml(normalizeDocumentCaptionsHtml(normalizeDocumentNotesHtml(document.body.innerHTML)))), bibliography))));
|
|
3177
3211
|
}
|
|
3178
3212
|
async function readDocxLayout(buffer) {
|
|
3179
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,
|
|
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, 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~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";
|
|
@@ -92,10 +92,34 @@ 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 indexEntryFields = fields.filter(supportedDocxIndexEntryField);
|
|
97
|
+
const indexFields = fields.filter(supportedDocxIndexField);
|
|
98
|
+
const tableOfContentsContainers = new Set(tableOfContentsFields.flatMap((field)=>{
|
|
99
|
+
const container = closestAncestor(field.start, 'sdt');
|
|
100
|
+
return container ? [
|
|
101
|
+
container
|
|
102
|
+
] : [];
|
|
103
|
+
}));
|
|
104
|
+
const isTableOfContentsField = (field)=>{
|
|
105
|
+
const container = closestAncestor(field.start, 'sdt');
|
|
106
|
+
return Boolean(container && tableOfContentsContainers.has(container));
|
|
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);
|
|
95
119
|
const sequences = fields.filter((field)=>docxCaptionSequenceKind(field.instruction));
|
|
96
120
|
const bodyFields = fields.filter((field)=>'orphan' !== field.syntax && Boolean(docxDocumentFieldKind(field.instruction)));
|
|
97
121
|
const editableBodyFields = bodyFields.filter(docxFieldOccurrenceIsInlineEditable);
|
|
98
|
-
const hasUnsupportedFieldStructure = hasInvalidDocxFieldStructure(document) || bodyFields.some((field)=>!docxFieldOccurrenceIsInlineEditable(field));
|
|
122
|
+
const hasUnsupportedFieldStructure = hasInvalidDocxFieldStructure(document, isSupportedBlockField) || bodyFields.some((field)=>!docxFieldOccurrenceIsInlineEditable(field));
|
|
99
123
|
const bookmarkNames = new Set([
|
|
100
124
|
...captionBookmarkNames(sequences),
|
|
101
125
|
...pairedBookmarkNames(document)
|
|
@@ -118,6 +142,22 @@ function diagnoseDocxCaptions(document) {
|
|
|
118
142
|
severity: 'info'
|
|
119
143
|
}
|
|
120
144
|
] : [],
|
|
145
|
+
...tableOfContentsFields.length ? [
|
|
146
|
+
{
|
|
147
|
+
code: 'docx.tableOfContents',
|
|
148
|
+
feature: 'Table of contents',
|
|
149
|
+
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.',
|
|
150
|
+
severity: 'info'
|
|
151
|
+
}
|
|
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
|
+
] : [],
|
|
121
161
|
...hasUnsupportedFieldStructure ? [
|
|
122
162
|
{
|
|
123
163
|
code: 'docx.fields.structure',
|
|
@@ -127,7 +167,7 @@ function diagnoseDocxCaptions(document) {
|
|
|
127
167
|
}
|
|
128
168
|
] : []
|
|
129
169
|
],
|
|
130
|
-
hasUnsupportedFields: hasUnsupportedFieldStructure || fields.some((field)=>!isSupportedCaptionField(field.instruction, bookmarkNames))
|
|
170
|
+
hasUnsupportedFields: hasUnsupportedFieldStructure || fields.some((field)=>!isSupportedBlockField(field) && !supportedDocxIndexEntryField(field) && !isSupportedCaptionField(field.instruction, bookmarkNames))
|
|
131
171
|
};
|
|
132
172
|
}
|
|
133
173
|
function captionBookmarkNames(fields) {
|
|
@@ -846,6 +886,57 @@ async function diagnoseDocxParagraphShading(archive, document) {
|
|
|
846
886
|
});
|
|
847
887
|
return issues;
|
|
848
888
|
}
|
|
889
|
+
const PROOFING_PART_PATTERN = /^word\/(?:document|styles|header\d*|footer\d*|footnotes|endnotes|comments)\.xml$/i;
|
|
890
|
+
async function diagnoseDocxProofing(archive, document) {
|
|
891
|
+
const parts = [
|
|
892
|
+
document
|
|
893
|
+
];
|
|
894
|
+
for (const path of archive.paths('word/'))if ('word/document.xml' !== path.toLowerCase() && PROOFING_PART_PATTERN.test(path)) parts.push(await archive.xml(path));
|
|
895
|
+
let languageCount = 0;
|
|
896
|
+
let proofingStateCount = 0;
|
|
897
|
+
let excludedCount = 0;
|
|
898
|
+
let checkedCount = 0;
|
|
899
|
+
let invalidCount = 0;
|
|
900
|
+
for (const part of parts){
|
|
901
|
+
for (const properties of descendants(part, 'rPr').filter((element)=>DOCX_WORDPROCESSING_NAMESPACES.has(element.namespaceURI ?? ''))){
|
|
902
|
+
if (directChildren(properties, 'lang').length) {
|
|
903
|
+
const inspection = inspectDocxProofingLanguages(properties);
|
|
904
|
+
if ('valid' === inspection.status) languageCount += 1;
|
|
905
|
+
else invalidCount += 1 + inspection.spoofedCount;
|
|
906
|
+
}
|
|
907
|
+
if (directChildren(properties, 'noProof').length) {
|
|
908
|
+
const inspection = inspectDocxNoProof(properties);
|
|
909
|
+
if ('valid' === inspection.status) {
|
|
910
|
+
proofingStateCount += 1;
|
|
911
|
+
if (inspection.value) excludedCount += 1;
|
|
912
|
+
else checkedCount += 1;
|
|
913
|
+
} else invalidCount += 1 + inspection.spoofedCount;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
for (const name of [
|
|
917
|
+
'lang',
|
|
918
|
+
'noProof'
|
|
919
|
+
])invalidCount += descendants(part, name).filter((element)=>{
|
|
920
|
+
if (!DOCX_WORDPROCESSING_NAMESPACES.has(element.namespaceURI ?? '')) return false;
|
|
921
|
+
const parent = element.parentElement;
|
|
922
|
+
return !parent || 'rPr' !== parent.localName || !DOCX_WORDPROCESSING_NAMESPACES.has(parent.namespaceURI ?? '');
|
|
923
|
+
}).length;
|
|
924
|
+
}
|
|
925
|
+
const issues = [];
|
|
926
|
+
if (languageCount || proofingStateCount) issues.push({
|
|
927
|
+
code: 'docx.proofing-language',
|
|
928
|
+
severity: 'info',
|
|
929
|
+
feature: 'Proofing languages',
|
|
930
|
+
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.`
|
|
931
|
+
});
|
|
932
|
+
if (invalidCount) issues.push({
|
|
933
|
+
code: 'docx.proofing-language.invalid',
|
|
934
|
+
severity: 'warning',
|
|
935
|
+
feature: 'Proofing languages',
|
|
936
|
+
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.`
|
|
937
|
+
});
|
|
938
|
+
return issues;
|
|
939
|
+
}
|
|
849
940
|
const RUN_FONT_DIAGNOSTIC_PART_PATTERN = /^word\/(?:document|styles|header\d*|footer\d*|footnotes|endnotes|comments)\.xml$/i;
|
|
850
941
|
async function diagnoseDocxRunFonts(archive, document) {
|
|
851
942
|
const parts = [
|
|
@@ -945,6 +1036,54 @@ async function diagnoseDocxRunBorders(archive, document) {
|
|
|
945
1036
|
});
|
|
946
1037
|
return issues;
|
|
947
1038
|
}
|
|
1039
|
+
const RUN_SHADING_PART_PATTERN = /^word\/(?:document|styles|header\d*|footer\d*|footnotes|endnotes|comments)\.xml$/i;
|
|
1040
|
+
const VALID_SHADING_PARENTS = new Set([
|
|
1041
|
+
'rPr',
|
|
1042
|
+
'pPr',
|
|
1043
|
+
'tcPr',
|
|
1044
|
+
'tblPr'
|
|
1045
|
+
]);
|
|
1046
|
+
async function diagnoseDocxRunShading(archive, document) {
|
|
1047
|
+
const themePath = archive.paths('word/theme/').find((path)=>/\/theme\d*\.xml$/i.test(path));
|
|
1048
|
+
const themeDocument = themePath ? await archive.xml(themePath) : null;
|
|
1049
|
+
const settingsDocument = archive.has('word/settings.xml') ? await archive.xml('word/settings.xml') : null;
|
|
1050
|
+
const theme = createDocxThemeResolver(themeDocument, settingsDocument);
|
|
1051
|
+
const parts = [
|
|
1052
|
+
document
|
|
1053
|
+
];
|
|
1054
|
+
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));
|
|
1055
|
+
let validCount = 0;
|
|
1056
|
+
let resetCount = 0;
|
|
1057
|
+
let invalidCount = 0;
|
|
1058
|
+
for (const part of parts){
|
|
1059
|
+
for (const properties of descendants(part, 'rPr').filter((element)=>DOCX_WORDPROCESSING_NAMESPACES.has(element.namespaceURI ?? ''))){
|
|
1060
|
+
if (!directChildren(properties, 'shd').length) continue;
|
|
1061
|
+
const inspection = inspectDocxRunShading(properties, theme);
|
|
1062
|
+
if ('valid' === inspection.status) {
|
|
1063
|
+
validCount += 1;
|
|
1064
|
+
if ('nil' === inspection.value.pattern) resetCount += 1;
|
|
1065
|
+
} else invalidCount += 1 + inspection.spoofedCount;
|
|
1066
|
+
}
|
|
1067
|
+
invalidCount += descendants(part, 'shd').filter((element)=>{
|
|
1068
|
+
const parent = element.parentElement;
|
|
1069
|
+
return DOCX_WORDPROCESSING_NAMESPACES.has(element.namespaceURI ?? '') && (!parent || !VALID_SHADING_PARENTS.has(parent.localName));
|
|
1070
|
+
}).length;
|
|
1071
|
+
}
|
|
1072
|
+
const issues = [];
|
|
1073
|
+
if (validCount) issues.push({
|
|
1074
|
+
code: 'docx.run-shading',
|
|
1075
|
+
severity: 'info',
|
|
1076
|
+
feature: 'Character shading',
|
|
1077
|
+
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.`
|
|
1078
|
+
});
|
|
1079
|
+
if (invalidCount) issues.push({
|
|
1080
|
+
code: 'docx.run-shading.invalid',
|
|
1081
|
+
severity: 'warning',
|
|
1082
|
+
feature: 'Character shading',
|
|
1083
|
+
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.`
|
|
1084
|
+
});
|
|
1085
|
+
return issues;
|
|
1086
|
+
}
|
|
948
1087
|
const SUPPORTED_CHART_ELEMENTS = new Set([
|
|
949
1088
|
'barChart',
|
|
950
1089
|
'lineChart',
|
|
@@ -1973,6 +2112,8 @@ async function analyzeDocxCompatibility(file, messages, sourcePackage) {
|
|
|
1973
2112
|
issues.push(...await diagnoseDocxHiddenText(archive, document));
|
|
1974
2113
|
issues.push(...await diagnoseDocxLegacyTextEffects(archive, document));
|
|
1975
2114
|
issues.push(...await diagnoseDocxRunBorders(archive, document));
|
|
2115
|
+
issues.push(...await diagnoseDocxRunShading(archive, document));
|
|
2116
|
+
issues.push(...await diagnoseDocxProofing(archive, document));
|
|
1976
2117
|
issues.push(...await diagnoseDocxRunFonts(archive, document));
|
|
1977
2118
|
}
|
|
1978
2119
|
issues.push(...await diagnoseDocxPageChrome(archive));
|
|
@@ -2004,7 +2145,7 @@ async function analyzeDocxCompatibility(file, messages, sourcePackage) {
|
|
|
2004
2145
|
const supportedRunFormattingRevisionCount = runFormattingRevisions.filter(isSupportedDocxRunFormattingChange).length;
|
|
2005
2146
|
const supportedParagraphFormattingRevisionCount = paragraphFormattingRevisions.filter(isSupportedDocxParagraphFormattingChange).length;
|
|
2006
2147
|
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'));
|
|
2007
|
-
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
|
|
2148
|
+
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'));
|
|
2008
2149
|
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'));
|
|
2009
2150
|
if (textRevisions.some((revision)=>!descendants(revision, 't').length && !descendants(revision, 'delText').length) || supportedRunFormattingRevisionCount !== runFormattingRevisions.length || supportedParagraphFormattingRevisionCount !== paragraphFormattingRevisions.length || [
|
|
2010
2151
|
'moveFrom',
|
package/dist/1544.js
CHANGED
|
@@ -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
|
@@ -5,7 +5,7 @@ import { OFFICE_COLLABORATION_PROTOCOL as WORK_OFFICE_COLLABORATION_PROTOCOL, Of
|
|
|
5
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";
|
|
@@ -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.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),
|
|
@@ -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
|
}
|