@a3s-lab/office 0.10.0 → 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 (28) hide show
  1. package/COLLABORATION_ROADMAP.md +22 -12
  2. package/README.md +17 -14
  3. package/dist/{0~4705.js → 0~5093.js} +959 -10
  4. package/dist/0~document-editor.js +1 -0
  5. package/dist/0~work-docx-export.js +225 -6
  6. package/dist/0~work-docx-import.js +24 -753
  7. package/dist/0~work-office-diagnostics.js +6 -4
  8. package/dist/4104.js +1 -1
  9. package/dist/8928.js +448 -137
  10. package/dist/internal/features/work/work-document-format-change-tracking.d.ts +1 -1
  11. package/dist/internal/features/work/work-document-paragraph-format-change-tracking.d.ts +7 -0
  12. package/dist/internal/features/work/work-document-paragraph-format-changes.d.ts +8 -0
  13. package/dist/internal/features/work/work-docx-import.d.ts +3 -1
  14. package/dist/internal/features/work/work-docx-paragraph-alignment-import.d.ts +1 -0
  15. package/dist/internal/features/work/work-docx-paragraph-borders-import.d.ts +1 -0
  16. package/dist/internal/features/work/work-docx-paragraph-direction-import.d.ts +1 -0
  17. package/dist/internal/features/work/work-docx-paragraph-format-change-export.d.ts +13 -0
  18. package/dist/internal/features/work/work-docx-paragraph-format-change-import.d.ts +17 -0
  19. package/dist/internal/features/work/work-docx-paragraph-indent-import.d.ts +1 -0
  20. package/dist/internal/features/work/work-docx-paragraph-pagination-import.d.ts +1 -0
  21. package/dist/internal/features/work/work-docx-paragraph-shading-import.d.ts +1 -0
  22. package/dist/internal/features/work/work-docx-paragraph-spacing-import.d.ts +1 -0
  23. package/dist/internal/features/work/work-docx-tab-stop-import.d.ts +1 -0
  24. package/dist/internal/features/work/work-types.d.ts +1 -1
  25. package/dist/office-kernel.wasm +0 -0
  26. package/dist/styles.css +8 -0
  27. package/docs/latest/en/browser-editor-architecture.md +18 -0
  28. package/package.json +5 -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, isSupportedDocxRunFormattingChange, docxFieldInstructions, isSupportedDocxEquationPlacement } from "./0~4705.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";
@@ -1691,19 +1691,21 @@ async function analyzeDocxCompatibility(file, messages) {
1691
1691
  ...descendants(document, 'del')
1692
1692
  ];
1693
1693
  const runFormattingRevisions = descendants(document, 'rPrChange');
1694
+ const paragraphFormattingRevisions = descendants(document, 'pPrChange');
1694
1695
  const supportedRunFormattingRevisionCount = runFormattingRevisions.filter(isSupportedDocxRunFormattingChange).length;
1696
+ const supportedParagraphFormattingRevisionCount = paragraphFormattingRevisions.filter(isSupportedDocxParagraphFormattingChange).length;
1695
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'));
1696
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'));
1697
- if (textRevisions.some((revision)=>!descendants(revision, 't').length && !descendants(revision, 'delText').length) || supportedRunFormattingRevisionCount !== runFormattingRevisions.length || [
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 || [
1698
1701
  'moveFrom',
1699
1702
  'moveTo',
1700
- 'pPrChange',
1701
1703
  'tblPrChange',
1702
1704
  'trPrChange',
1703
1705
  'tcPrChange',
1704
1706
  'sectPrChange',
1705
1707
  'numberingChange'
1706
- ].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 the bounded character-formatting subset.'));
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.'));
1707
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.'));
1708
1710
  const sectionProperties = descendants(document, 'sectPr');
1709
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 ? {