@a3s-lab/office 0.9.2 → 0.11.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.
Files changed (31) hide show
  1. package/COLLABORATION_ROADMAP.md +29 -5
  2. package/README.md +19 -6
  3. package/dist/{0~7754.js → 0~5093.js} +1449 -3
  4. package/dist/0~document-editor.js +8 -1
  5. package/dist/0~work-docx-export.js +482 -16
  6. package/dist/0~work-docx-import.js +31 -1142
  7. package/dist/0~work-office-diagnostics.js +9 -5
  8. package/dist/4104.js +1 -1
  9. package/dist/8928.js +763 -149
  10. package/dist/internal/features/work/work-document-format-change-tracking.d.ts +9 -0
  11. package/dist/internal/features/work/work-document-format-changes.d.ts +28 -0
  12. package/dist/internal/features/work/work-document-paragraph-format-change-tracking.d.ts +7 -0
  13. package/dist/internal/features/work/work-document-paragraph-format-changes.d.ts +8 -0
  14. package/dist/internal/features/work/work-docx-format-change-export.d.ts +17 -0
  15. package/dist/internal/features/work/work-docx-import.d.ts +3 -1
  16. package/dist/internal/features/work/work-docx-paragraph-alignment-import.d.ts +1 -0
  17. package/dist/internal/features/work/work-docx-paragraph-borders-import.d.ts +1 -0
  18. package/dist/internal/features/work/work-docx-paragraph-direction-import.d.ts +1 -0
  19. package/dist/internal/features/work/work-docx-paragraph-format-change-export.d.ts +13 -0
  20. package/dist/internal/features/work/work-docx-paragraph-format-change-import.d.ts +17 -0
  21. package/dist/internal/features/work/work-docx-paragraph-indent-import.d.ts +1 -0
  22. package/dist/internal/features/work/work-docx-paragraph-pagination-import.d.ts +1 -0
  23. package/dist/internal/features/work/work-docx-paragraph-shading-import.d.ts +1 -0
  24. package/dist/internal/features/work/work-docx-paragraph-spacing-import.d.ts +1 -0
  25. package/dist/internal/features/work/work-docx-run-formatting-import.d.ts +10 -0
  26. package/dist/internal/features/work/work-docx-tab-stop-import.d.ts +1 -0
  27. package/dist/internal/features/work/work-types.d.ts +1 -1
  28. package/dist/office-kernel.wasm +0 -0
  29. package/dist/styles.css +28 -0
  30. package/docs/latest/en/browser-editor-architecture.md +18 -0
  31. package/package.json +7 -3
@@ -1,6 +1,6 @@
1
1
  import { descendants, directChildren, directChild, OoxmlPackage, attribute, firstDescendant, contentTypeForPart } from "./5184.js";
2
2
  import { normalizeDocumentBookmarkName, docxBookmarkReferenceTarget, normalizeDocumentBookmarkNativeId, isDocumentParagraphArtBorderStyle, supportedDocxBookmarkReferenceInstruction, documentCitationTagsFromInstruction, docxDocumentFieldKind } from "./8928.js";
3
- import { markDocxParagraphShading, inspectDocxPageSize, docxCaptionBookmark, hasInvalidDocxFieldStructure, inspectDocxPageMargins, inspectDocxPaperSource, createDocxParagraphStyleResolver, createDocxTableStyleResolver, docxFieldOccurrences, inspectDocxEquation, inspectDocxPageMarginSettings, markDocxParagraphBorders, docxFieldOccurrenceIsInlineEditable, docxCaptionSequenceKind, inspectDocxPageBorders, docxFieldInstructions, isSupportedDocxEquationPlacement } from "./0~7754.js";
3
+ import { markDocxParagraphShading, inspectDocxPageSize, docxCaptionBookmark, hasInvalidDocxFieldStructure, inspectDocxPageMargins, inspectDocxPaperSource, createDocxParagraphStyleResolver, createDocxTableStyleResolver, docxFieldOccurrences, inspectDocxEquation, inspectDocxPageMarginSettings, markDocxParagraphBorders, isSupportedDocxParagraphFormattingChange, docxFieldOccurrenceIsInlineEditable, docxCaptionSequenceKind, inspectDocxPageBorders, isSupportedDocxRunFormattingChange, docxFieldInstructions, isSupportedDocxEquationPlacement } from "./0~5093.js";
4
4
  import { normalizeDocumentHref } from "./0~work-document-links.js";
5
5
  import { xmlAttributeLocalName, parseDocxParagraphDefaultCollapsed, readDocxBibliography, DOCX_WORDPROCESSING_NAMESPACES, xmlAttributeNamespace, createDocxThemeResolver } from "./0~2805.js";
6
6
  import { isSupportedXlsxCombinationChartNodes, MAX_XLSX_WORKSHEET_IMAGE_BYTES, inspectXlsxPivotTables, isSupportedXlsxWorksheetImageContentType, isSupportedXlsxChartLegend, isSupportedXlsxChartPlotLayout, xlsxChartNodeUsesStackedGrouping, isSupportedXlsxChartSeriesFormatting, readXlsxFormulaFeaturesFromPackage, inspectXlsxHeaderFooterText, isEditableXlsxPaperSizeCode, diagnoseXlsxProtection, xlsxChartSeriesFormattingShapeProperties } from "./4104.js";
@@ -1690,18 +1690,22 @@ async function analyzeDocxCompatibility(file, messages) {
1690
1690
  ...descendants(document, 'ins'),
1691
1691
  ...descendants(document, 'del')
1692
1692
  ];
1693
+ const runFormattingRevisions = descendants(document, 'rPrChange');
1694
+ const paragraphFormattingRevisions = descendants(document, 'pPrChange');
1695
+ const supportedRunFormattingRevisionCount = runFormattingRevisions.filter(isSupportedDocxRunFormattingChange).length;
1696
+ const supportedParagraphFormattingRevisionCount = paragraphFormattingRevisions.filter(isSupportedDocxParagraphFormattingChange).length;
1693
1697
  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'));
1694
- if (textRevisions.some((revision)=>!descendants(revision, 't').length && !descendants(revision, 'delText').length) || [
1698
+ 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, subscript, superscript, font, size, color, highlight, and grid state. They remain reviewable in Work and round-trip as native w:rPrChange records.`, 'info'));
1699
+ 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'));
1700
+ if (textRevisions.some((revision)=>!descendants(revision, 't').length && !descendants(revision, 'delText').length) || supportedRunFormattingRevisionCount !== runFormattingRevisions.length || supportedParagraphFormattingRevisionCount !== paragraphFormattingRevisions.length || [
1695
1701
  'moveFrom',
1696
1702
  'moveTo',
1697
- 'rPrChange',
1698
- 'pPrChange',
1699
1703
  'tblPrChange',
1700
1704
  'trPrChange',
1701
1705
  'tcPrChange',
1702
1706
  'sectPrChange',
1703
1707
  'numberingChange'
1704
- ].some((name)=>descendants(document, name).length)) issues.push(work_office_diagnostics_issue('docx.revisions.structural', 'Structural revisions', 'Moved content plus formatting, numbering, section, row, cell, and table-property revisions may be normalized; Work currently reviews body-text insertions and deletions.'));
1708
+ ].some((name)=>descendants(document, name).length)) issues.push(work_office_diagnostics_issue('docx.revisions.structural', 'Structural revisions', 'Moved content plus unsupported character formatting, paragraph formatting, numbering, section, row, cell, and table-property revisions may be normalized; Work currently reviews body-text insertions/deletions and bounded character- and paragraph-formatting subsets.'));
1705
1709
  if (captionDiagnostics.hasUnsupportedFields) issues.push(work_office_diagnostics_issue('docx.fields', 'Fields', 'Fields beyond supported body fields, citations, bibliographies, caption SEQ fields, and bookmark or caption REF fields are converted to their current displayed value.'));
1706
1710
  const sectionProperties = descendants(document, 'sectPr');
1707
1711
  const columnProperties = descendants(document, 'cols');
package/dist/4104.js CHANGED
@@ -512,7 +512,7 @@ async function importWorkDocumentFile(file, extension) {
512
512
  "br[type='page'] => hr.work-page-break[data-page-break='true']:fresh"
513
513
  ]
514
514
  });
515
- 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.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;
515
+ 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;
516
516
  const layout = prepared ? {
517
517
  ...documentContentLayoutProperties(prepared.sections[0].layout),
518
518
  ...prepared.pageColor ? {