@a3s-lab/office 0.30.0 → 0.32.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 +25 -5
- package/dist/{0~7231.js → 0~4808.js} +190 -3
- package/dist/0~4980.js +1 -1
- package/dist/0~5050.js +10 -1
- package/dist/{0~7360.js → 0~7240.js} +245 -16
- package/dist/0~7614.js +1 -1
- package/dist/0~document-editor.js +1756 -178
- package/dist/0~spreadsheet-editor.js +2 -1
- package/dist/0~work-docx-export.js +215 -27
- package/dist/0~work-docx-import.js +27 -33
- package/dist/0~work-docx-large-document-import.js +1 -1
- package/dist/0~work-office-diagnostics.js +28 -7
- package/dist/0~work-pptx-import.js +1 -1
- package/dist/{1544.js → 3266.js} +17 -1862
- package/dist/4121.js +425 -11
- package/dist/4166.js +3848 -0
- package/dist/{6282.js → 4174.js} +812 -10
- package/dist/9333.js +1849 -0
- package/dist/core.js +5259 -4
- package/dist/index.js +3 -3
- package/dist/internal/features/work/editors/document-command-catalog.d.ts +27 -0
- package/dist/internal/features/work/editors/document-compare-dialog.d.ts +14 -0
- package/dist/internal/features/work/editors/document-dom-selection.d.ts +7 -0
- package/dist/internal/features/work/editors/document-editor-support.d.ts +1 -0
- package/dist/internal/features/work/editors/document-index-dialog.d.ts +10 -0
- package/dist/internal/features/work/editors/document-index-entry-dialog.d.ts +10 -0
- package/dist/internal/features/work/editors/document-references-ribbon.d.ts +19 -0
- package/dist/internal/features/work/editors/document-toolbar.d.ts +6 -1
- package/dist/internal/features/work/editors/use-document-comparison.d.ts +9 -0
- package/dist/internal/features/work/editors/use-document-insert-commands.d.ts +3 -0
- package/dist/internal/features/work/work-document-changes.d.ts +5 -0
- package/dist/internal/features/work/work-document-compare-diff.d.ts +38 -0
- package/dist/internal/features/work/work-document-compare-stability.d.ts +5 -0
- package/dist/internal/features/work/work-document-compare.d.ts +27 -0
- package/dist/internal/features/work/work-document-index-fields.d.ts +19 -0
- package/dist/internal/features/work/work-document-index-nodes.d.ts +32 -0
- package/dist/internal/features/work/work-document-index.d.ts +63 -0
- package/dist/internal/features/work/work-docx-import.d.ts +3 -1
- package/dist/internal/features/work/work-docx-index-export.d.ts +14 -0
- package/dist/internal/features/work/work-docx-index-import.d.ts +23 -0
- package/dist/office-kernel.wasm +0 -0
- package/dist/styles.css +490 -0
- package/docs/latest/en/browser-editor-architecture.md +37 -0
- package/package.json +9 -3
- package/dist/4104.js +0 -9336
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { documentSectionDomAttributes, applyDocumentPageGeometry, documentPaperSizeForGeometry, windowDocumentModel } from "./
|
|
1
|
+
import { documentSectionDomAttributes, applyDocumentPageGeometry, documentPaperSizeForGeometry, windowDocumentModel } from "./4174.js";
|
|
2
2
|
const LARGE_SIMPLE_DOCX_MINIMUM_LOGICAL_BLOCKS = 20000;
|
|
3
3
|
const WORD_TWIPS_PER_MILLIMETER = 1440 / 25.4;
|
|
4
4
|
const UNSUPPORTED_SIMPLE_WORD_ELEMENT = /<(?:\/)?(?!w:(?:t(?:bl(?:Grid|Layout|Pr|W)?|c(?:Pr|W)?|r)?|p(?:g(?:Mar|Sz))?|r|sectPr|body|document|gridCol)(?=[\s/>]))[A-Za-z_][\w.-]*:[A-Za-z_][\w.-]*(?=[\s/>])/;
|
|
@@ -1,11 +1,11 @@
|
|
|
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
|
-
import { normalizeDocumentBookmarkName, docxBookmarkReferenceTarget, normalizeDocumentBookmarkNativeId, DOCUMENT_LEGACY_TEXT_EFFECT_NAMES, supportedDocxBookmarkReferenceInstruction, documentCitationTagsFromInstruction, docxDocumentFieldKind } from "./
|
|
4
|
-
import { markDocxParagraphShading, inspectDocxPageSize, docxCaptionBookmark, hasInvalidDocxFieldStructure, inspectDocxLegacyTextEffects, inspectDocxPageMargins, inspectDocxPaperSource, createDocxParagraphStyleResolver, supportedDocxTableOfContentsField, docxFieldOccurrences,
|
|
3
|
+
import { normalizeDocumentBookmarkName, docxBookmarkReferenceTarget, normalizeDocumentBookmarkNativeId, DOCUMENT_LEGACY_TEXT_EFFECT_NAMES, supportedDocxBookmarkReferenceInstruction, documentCitationTagsFromInstruction, docxDocumentFieldKind } from "./4174.js";
|
|
4
|
+
import { markDocxParagraphShading, inspectDocxPageSize, docxCaptionBookmark, hasInvalidDocxFieldStructure, inspectDocxLegacyTextEffects, inspectDocxPageMargins, inspectDocxPaperSource, createDocxParagraphStyleResolver, supportedDocxTableOfContentsField, docxFieldOccurrences, supportedDocxIndexEntryField, createDocxTableStyleResolver, inspectDocxEquation, inspectDocxPageMarginSettings, inspectDocxRunFonts, inspectDocxRunBorder, inspectDocxRunShading, markDocxParagraphBorders, isSupportedDocxParagraphFormattingChange, docxFieldOccurrenceIsInlineEditable, supportedDocxIndexField, docxCaptionSequenceKind, inspectDocxHiddenText, inspectDocxPageBorders, isSupportedDocxRunFormattingChange, docxFieldInstructions, isSupportedDocxEquationPlacement } from "./0~7240.js";
|
|
5
5
|
import { normalizeDocumentHref } from "./0~work-document-links.js";
|
|
6
|
-
import { xmlAttributeLocalName, inspectDocxProofingLanguages, readDocxBibliography, inspectDocxEmphasisMark, createDocxThemeResolver, inspectDocxNoProof, parseDocxParagraphDefaultCollapsed, DOCX_WORDPROCESSING_NAMESPACES, xmlAttributeNamespace, inspectDocxKerningThresholdHalfPoints } from "./0~
|
|
7
|
-
import { updateSpreadsheetWorksheetCompatibilitySummary, inspectXlsxPivotTables, isSupportedXlsxChartLegend, isSupportedXlsxChartPlotLayout, xlsxChartNodeUsesStackedGrouping, isSupportedXlsxChartSeriesFormatting, readXlsxFormulaFeaturesFromPackage, inspectXlsxHeaderFooterText, emptySpreadsheetWorksheetCompatibilitySummary, isSupportedXlsxWorksheetImageContentType, MAX_XLSX_WORKSHEET_IMAGE_BYTES, xlsxChartSeriesFormattingShapeProperties, diagnoseXlsxProtection, isEditableXlsxPaperSizeCode, isSupportedXlsxCombinationChartNodes } from "./
|
|
8
|
-
import { spreadsheetConditionalComparisonNeedsUpperValue, isSpreadsheetConditionalIconSetName, isSpreadsheetConditionalComparisonOperator, spreadsheetConditionalIconSetCount, xlsxWorksheetCellEntries } from "./
|
|
6
|
+
import { xmlAttributeLocalName, inspectDocxProofingLanguages, readDocxBibliography, inspectDocxEmphasisMark, createDocxThemeResolver, inspectDocxNoProof, parseDocxParagraphDefaultCollapsed, DOCX_WORDPROCESSING_NAMESPACES, xmlAttributeNamespace, inspectDocxKerningThresholdHalfPoints } from "./0~4808.js";
|
|
7
|
+
import { updateSpreadsheetWorksheetCompatibilitySummary, inspectXlsxPivotTables, isSupportedXlsxChartLegend, isSupportedXlsxChartPlotLayout, xlsxChartNodeUsesStackedGrouping, isSupportedXlsxChartSeriesFormatting, readXlsxFormulaFeaturesFromPackage, inspectXlsxHeaderFooterText, emptySpreadsheetWorksheetCompatibilitySummary, isSupportedXlsxWorksheetImageContentType, MAX_XLSX_WORKSHEET_IMAGE_BYTES, xlsxChartSeriesFormattingShapeProperties, diagnoseXlsxProtection, isEditableXlsxPaperSizeCode, isSupportedXlsxCombinationChartNodes } from "./4166.js";
|
|
8
|
+
import { spreadsheetConditionalComparisonNeedsUpperValue, isSpreadsheetConditionalIconSetName, isSpreadsheetConditionalComparisonOperator, spreadsheetConditionalIconSetCount, xlsxWorksheetCellEntries } from "./9333.js";
|
|
9
9
|
import { formulaHasStructuredReference, formulaHasExternalReference, parseSpreadsheetPrintTitles, volatileSpreadsheetFormulaFunctions, stripSpreadsheetSheetQualifier } from "./8715.js";
|
|
10
10
|
import { unsupportedSpreadsheetFormulaFunctions } from "./0~work-spreadsheet-formula-support.js";
|
|
11
11
|
var work_office_diagnostics_namespaceObject = {};
|
|
@@ -93,6 +93,8 @@ function bookmarkIssue(code, message, severity = 'warning') {
|
|
|
93
93
|
function diagnoseDocxCaptions(document) {
|
|
94
94
|
const fields = docxFieldOccurrences(document);
|
|
95
95
|
const tableOfContentsFields = fields.filter(supportedDocxTableOfContentsField);
|
|
96
|
+
const indexEntryFields = fields.filter(supportedDocxIndexEntryField);
|
|
97
|
+
const indexFields = fields.filter(supportedDocxIndexField);
|
|
96
98
|
const tableOfContentsContainers = new Set(tableOfContentsFields.flatMap((field)=>{
|
|
97
99
|
const container = closestAncestor(field.start, 'sdt');
|
|
98
100
|
return container ? [
|
|
@@ -103,10 +105,21 @@ function diagnoseDocxCaptions(document) {
|
|
|
103
105
|
const container = closestAncestor(field.start, 'sdt');
|
|
104
106
|
return Boolean(container && tableOfContentsContainers.has(container));
|
|
105
107
|
};
|
|
108
|
+
const indexContainers = new Set(indexFields.flatMap((field)=>{
|
|
109
|
+
const container = closestAncestor(field.start, 'sdt');
|
|
110
|
+
return container ? [
|
|
111
|
+
container
|
|
112
|
+
] : [];
|
|
113
|
+
}));
|
|
114
|
+
const isIndexField = (field)=>{
|
|
115
|
+
const container = closestAncestor(field.start, 'sdt');
|
|
116
|
+
return Boolean(container && indexContainers.has(container));
|
|
117
|
+
};
|
|
118
|
+
const isSupportedBlockField = (field)=>isTableOfContentsField(field) || isIndexField(field);
|
|
106
119
|
const sequences = fields.filter((field)=>docxCaptionSequenceKind(field.instruction));
|
|
107
120
|
const bodyFields = fields.filter((field)=>'orphan' !== field.syntax && Boolean(docxDocumentFieldKind(field.instruction)));
|
|
108
121
|
const editableBodyFields = bodyFields.filter(docxFieldOccurrenceIsInlineEditable);
|
|
109
|
-
const hasUnsupportedFieldStructure = hasInvalidDocxFieldStructure(document,
|
|
122
|
+
const hasUnsupportedFieldStructure = hasInvalidDocxFieldStructure(document, isSupportedBlockField) || bodyFields.some((field)=>!docxFieldOccurrenceIsInlineEditable(field));
|
|
110
123
|
const bookmarkNames = new Set([
|
|
111
124
|
...captionBookmarkNames(sequences),
|
|
112
125
|
...pairedBookmarkNames(document)
|
|
@@ -137,6 +150,14 @@ function diagnoseDocxCaptions(document) {
|
|
|
137
150
|
severity: 'info'
|
|
138
151
|
}
|
|
139
152
|
] : [],
|
|
153
|
+
...indexEntryFields.length || indexFields.length ? [
|
|
154
|
+
{
|
|
155
|
+
code: 'docx.index',
|
|
156
|
+
feature: 'Index',
|
|
157
|
+
message: 'Native XE entries, primary and secondary terms, cross-references, page emphasis, cached INDEX rows, columns, and leader styles remain editable and round-trip in DOCX output.',
|
|
158
|
+
severity: 'info'
|
|
159
|
+
}
|
|
160
|
+
] : [],
|
|
140
161
|
...hasUnsupportedFieldStructure ? [
|
|
141
162
|
{
|
|
142
163
|
code: 'docx.fields.structure',
|
|
@@ -146,7 +167,7 @@ function diagnoseDocxCaptions(document) {
|
|
|
146
167
|
}
|
|
147
168
|
] : []
|
|
148
169
|
],
|
|
149
|
-
hasUnsupportedFields: hasUnsupportedFieldStructure || fields.some((field)=>!
|
|
170
|
+
hasUnsupportedFields: hasUnsupportedFieldStructure || fields.some((field)=>!isSupportedBlockField(field) && !supportedDocxIndexEntryField(field) && !isSupportedCaptionField(field.instruction, bookmarkNames))
|
|
150
171
|
};
|
|
151
172
|
}
|
|
152
173
|
function captionBookmarkNames(fields) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
-
import { parseXlsxChartAxes } from "./
|
|
4
|
+
import { parseXlsxChartAxes } from "./4166.js";
|
|
5
5
|
import { scaledPresentationVisuals } from "./0~work-presentation-visual-scale.js";
|
|
6
6
|
async function loadPptxTheme(archive, presentationRelationships) {
|
|
7
7
|
const defaults = {
|