@a3s-lab/office 0.2.2 → 0.4.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/COLLABORATION_ROADMAP.md +426 -0
- package/README.md +649 -10
- package/dist/0~1403.js +1 -1
- package/dist/0~2805.js +1279 -0
- package/dist/{0~use-office-draft.js → 0~345.js} +30 -1
- package/dist/0~3539.js +1 -1
- package/dist/0~3557.js +1 -1
- package/dist/0~3635.js +1 -1
- package/dist/0~4595.js +123 -12
- package/dist/0~4980.js +154 -0
- package/dist/0~5050.js +124 -113
- package/dist/{0~9512.js → 0~6090.js} +540 -3
- package/dist/0~7048.js +92 -66
- package/dist/0~7614.js +2 -1
- package/dist/0~7754.js +5653 -0
- package/dist/0~9445.js +1 -1
- package/dist/0~document-editor.js +4992 -3323
- package/dist/0~markdown-editor.js +250 -44
- package/dist/0~pdf-viewer.js +1016 -24
- package/dist/0~presentation-editor.js +179 -8
- package/dist/0~spreadsheet-editor.js +3371 -578
- package/dist/0~work-docx-export.js +6801 -658
- package/dist/0~work-docx-import.js +1388 -795
- package/dist/0~work-office-diagnostics.js +524 -30
- package/dist/0~work-pptx-export.js +2 -1
- package/dist/0~work-pptx-import.js +1 -2
- package/dist/0~work-presentation-charts.js +1 -1
- package/dist/2591.js +197 -0
- package/dist/3818.js +1090 -0
- package/dist/4104.js +970 -60
- package/dist/432.js +171 -14
- package/dist/4476.js +2008 -0
- package/dist/4560.js +674 -0
- package/dist/4650.js +70 -0
- package/dist/{1134.js → 5184.js} +183 -1
- package/dist/6489.js +18 -18
- package/dist/7060.js +132 -0
- package/dist/8715.js +2 -136
- package/dist/8928.js +16778 -0
- package/dist/9787.js +209 -0
- package/dist/core.d.ts +29 -9
- package/dist/core.js +10 -2
- package/dist/index.js +13 -3
- package/dist/internal/collaboration/office-collaboration-flat-json.d.ts +13 -0
- package/dist/internal/collaboration/office-collaboration-json.d.ts +4 -0
- package/dist/internal/collaboration/office-collaboration-presence.d.ts +86 -0
- package/dist/internal/collaboration/office-collaboration-transport.d.ts +42 -0
- package/dist/internal/collaboration/office-collaboration.d.ts +85 -0
- package/dist/internal/collaboration/office-document-collaboration-bibliography.d.ts +7 -0
- package/dist/internal/collaboration/office-document-collaboration-claims.d.ts +9 -0
- package/dist/internal/collaboration/office-document-collaboration-comments.d.ts +7 -0
- package/dist/internal/collaboration/office-document-collaboration-sidecar-utils.d.ts +27 -0
- package/dist/internal/collaboration/office-document-collaboration-sidecars.d.ts +16 -0
- package/dist/internal/collaboration/office-document-collaboration.d.ts +45 -0
- package/dist/internal/collaboration/office-markdown-collaboration.d.ts +31 -0
- package/dist/internal/collaboration/office-pdf-collaboration-claims.d.ts +4 -0
- package/dist/internal/collaboration/office-pdf-collaboration-conflicts.d.ts +2 -0
- package/dist/internal/collaboration/office-pdf-collaboration-model.d.ts +26 -0
- package/dist/internal/collaboration/office-pdf-collaboration-records.d.ts +21 -0
- package/dist/internal/collaboration/office-pdf-collaboration-types.d.ts +91 -0
- package/dist/internal/collaboration/office-pdf-collaboration-validation.d.ts +4 -0
- package/dist/internal/collaboration/office-pdf-collaboration.d.ts +35 -0
- package/dist/internal/collaboration/office-presentation-collaboration-model.d.ts +25 -0
- package/dist/internal/collaboration/office-presentation-collaboration-records.d.ts +22 -0
- package/dist/internal/collaboration/office-presentation-collaboration-validation.d.ts +4 -0
- package/dist/internal/collaboration/office-presentation-collaboration.d.ts +32 -0
- package/dist/internal/collaboration/office-spreadsheet-collaboration-cells.d.ts +13 -0
- package/dist/internal/collaboration/office-spreadsheet-collaboration-claims.d.ts +4 -0
- package/dist/internal/collaboration/office-spreadsheet-collaboration-conflicts.d.ts +2 -0
- package/dist/internal/collaboration/office-spreadsheet-collaboration-flat-json.d.ts +10 -0
- package/dist/internal/collaboration/office-spreadsheet-collaboration-model.d.ts +31 -0
- package/dist/internal/collaboration/office-spreadsheet-collaboration-records.d.ts +17 -0
- package/dist/internal/collaboration/office-spreadsheet-collaboration-validation.d.ts +4 -0
- package/dist/internal/collaboration/office-spreadsheet-collaboration.d.ts +32 -0
- package/dist/internal/design-system/primitives/navigation/tabs.d.ts +3 -1
- package/dist/internal/features/work/components/work-document-page-border.d.ts +6 -0
- package/dist/internal/features/work/editors/document-command-catalog.d.ts +536 -0
- package/dist/internal/features/work/editors/document-editor-focus.d.ts +1 -1
- package/dist/internal/features/work/editors/document-editor-support.d.ts +7 -3
- package/dist/internal/features/work/editors/document-editor.d.ts +8 -2
- package/dist/internal/features/work/editors/document-external-content.d.ts +14 -0
- package/dist/internal/features/work/editors/document-format-clipboard.d.ts +6 -0
- package/dist/internal/features/work/editors/document-format-tools.d.ts +4 -0
- package/dist/internal/features/work/editors/document-layout-panel.d.ts +4 -1
- package/dist/internal/features/work/editors/document-page-chrome-wps-shortcuts.d.ts +2 -0
- package/dist/internal/features/work/editors/document-page-layout-ribbon.d.ts +14 -0
- package/dist/internal/features/work/editors/document-page-stack.d.ts +10 -1
- package/dist/internal/features/work/editors/document-page-thumbnail.d.ts +2 -0
- package/dist/internal/features/work/editors/document-pagination-run-coordinator.d.ts +26 -0
- package/dist/internal/features/work/editors/document-picture-properties-dialog-model.d.ts +20 -1
- package/dist/internal/features/work/editors/document-review-navigation.d.ts +9 -0
- package/dist/internal/features/work/editors/document-statistics-dialog.d.ts +7 -0
- package/dist/internal/features/work/editors/document-status-bar.d.ts +2 -1
- package/dist/internal/features/work/editors/document-table-properties-dialog-model.d.ts +4 -1
- package/dist/internal/features/work/editors/document-toolbar.d.ts +19 -42
- package/dist/internal/features/work/editors/document-wps-shortcuts.d.ts +12 -0
- package/dist/internal/features/work/editors/document-zoom.d.ts +17 -0
- package/dist/internal/features/work/editors/markdown-editor-focus.d.ts +1 -1
- package/dist/internal/features/work/editors/markdown-editor.d.ts +5 -1
- package/dist/internal/features/work/editors/markdown-toolbar.d.ts +2 -1
- package/dist/internal/features/work/editors/office-collaboration-participants.d.ts +3 -0
- package/dist/internal/features/work/editors/office-collaboration-presence-context.d.ts +17 -0
- package/dist/internal/features/work/editors/office-collaboration-presence-ui.d.ts +25 -0
- package/dist/internal/features/work/editors/office-editor-focus-handoff.d.ts +27 -0
- package/dist/internal/features/work/editors/pdf-annotation-controller.d.ts +5 -0
- package/dist/internal/features/work/editors/pdf-collaboration-presence.d.ts +3 -0
- package/dist/internal/features/work/editors/pdf-collaboration-projection.d.ts +10 -0
- package/dist/internal/features/work/editors/pdf-evidence-contract.d.ts +36 -0
- package/dist/internal/features/work/editors/pdf-evidence-overlay.d.ts +37 -0
- package/dist/internal/features/work/editors/pdf-toolbar.d.ts +2 -1
- package/dist/internal/features/work/editors/pdf-viewer-controller.d.ts +7 -1
- package/dist/internal/features/work/editors/pdf-viewer.d.ts +11 -1
- package/dist/internal/features/work/editors/presentation-collaboration-presence.d.ts +5 -0
- package/dist/internal/features/work/editors/presentation-editor-focus.d.ts +3 -2
- package/dist/internal/features/work/editors/presentation-editor-types.d.ts +3 -0
- package/dist/internal/features/work/editors/presentation-editor.d.ts +1 -1
- package/dist/internal/features/work/editors/spreadsheet-auto-filter.d.ts +9 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-clear.d.ts +3 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-merge.d.ts +12 -0
- package/dist/internal/features/work/editors/spreadsheet-clipboard-shortcuts.d.ts +3 -7
- package/dist/internal/features/work/editors/spreadsheet-collaboration-presence.d.ts +9 -0
- package/dist/internal/features/work/editors/spreadsheet-command-catalog.d.ts +464 -0
- package/dist/internal/features/work/editors/spreadsheet-command-controller.d.ts +45 -9
- package/dist/internal/features/work/editors/spreadsheet-context-menu.d.ts +2 -0
- package/dist/internal/features/work/editors/spreadsheet-editor-ribbon.d.ts +9 -28
- package/dist/internal/features/work/editors/spreadsheet-editor.d.ts +8 -2
- package/dist/internal/features/work/editors/spreadsheet-format-painter.d.ts +27 -0
- package/dist/internal/features/work/editors/spreadsheet-freeze-panes.d.ts +14 -0
- package/dist/internal/features/work/editors/use-document-insert-commands.d.ts +3 -2
- package/dist/internal/features/work/editors/use-document-pagination.d.ts +6 -1
- package/dist/internal/features/work/editors/use-document-review-conflicts.d.ts +28 -0
- package/dist/internal/features/work/editors/use-spreadsheet-auto-filter.d.ts +21 -0
- package/dist/internal/features/work/editors/use-spreadsheet-collaboration.d.ts +27 -0
- package/dist/internal/features/work/editors/use-spreadsheet-format-painter.d.ts +18 -0
- package/dist/internal/features/work/editors/work-office-chrome.d.ts +22 -3
- package/dist/internal/features/work/editors/work-office-ribbon-overflow.d.ts +2 -0
- package/dist/internal/features/work/work-document-bookmark-references.d.ts +37 -0
- package/dist/internal/features/work/work-document-bookmarks.d.ts +29 -0
- package/dist/internal/features/work/work-document-caption-nodes.d.ts +4 -1
- package/dist/internal/features/work/work-document-comments.d.ts +1 -1
- package/dist/internal/features/work/work-document-equations.d.ts +513 -0
- package/dist/internal/features/work/work-document-extensions.d.ts +1 -0
- package/dist/internal/features/work/work-document-field-identity.d.ts +2 -0
- package/dist/internal/features/work/work-document-field-node.d.ts +2 -2
- package/dist/internal/features/work/work-document-fields.d.ts +7 -0
- package/dist/internal/features/work/work-document-image-identity.d.ts +30 -0
- package/dist/internal/features/work/work-document-image-layout.d.ts +46 -1
- package/dist/internal/features/work/work-document-image-wrap-contour.d.ts +16 -0
- package/dist/internal/features/work/work-document-incremental-layout.d.ts +2 -2
- package/dist/internal/features/work/work-document-model-codec.d.ts +4 -1
- package/dist/internal/features/work/work-document-note-integrity.d.ts +2 -0
- package/dist/internal/features/work/work-document-page-borders.d.ts +25 -0
- package/dist/internal/features/work/work-document-page-capture.d.ts +8 -0
- package/dist/internal/features/work/work-document-page-frames.d.ts +15 -0
- package/dist/internal/features/work/work-document-page-margins.d.ts +56 -0
- package/dist/internal/features/work/work-document-page-size.d.ts +47 -0
- package/dist/internal/features/work/work-document-pagination-measurement.d.ts +1 -2
- package/dist/internal/features/work/work-document-pagination-types.d.ts +7 -2
- package/dist/internal/features/work/work-document-pagination.d.ts +2 -2
- package/dist/internal/features/work/work-document-paragraph-borders.d.ts +32 -0
- package/dist/internal/features/work/work-document-paragraph-identity.d.ts +26 -0
- package/dist/internal/features/work/work-document-paragraph-shading.d.ts +18 -0
- package/dist/internal/features/work/work-document-review-conflicts.d.ts +35 -0
- package/dist/internal/features/work/work-document-section.d.ts +4 -0
- package/dist/internal/features/work/work-document-snapshot.d.ts +19 -0
- package/dist/internal/features/work/work-document-source.d.ts +23 -0
- package/dist/internal/features/work/work-document-table-column-widths.d.ts +7 -0
- package/dist/internal/features/work/work-document-table-property-changes.d.ts +3 -0
- package/dist/internal/features/work/work-document-table-row-identity.d.ts +15 -0
- package/dist/internal/features/work/work-document-table-sizing.d.ts +3 -0
- package/dist/internal/features/work/work-document-text-layout.d.ts +3 -1
- package/dist/internal/features/work/work-document-word-line-metrics.d.ts +2 -0
- package/dist/internal/features/work/work-docx-bookmark-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-bookmark-import.d.ts +24 -0
- package/dist/internal/features/work/work-docx-bookmarks.d.ts +17 -0
- package/dist/internal/features/work/work-docx-comment-durable-id-preservation.d.ts +2 -0
- package/dist/internal/features/work/work-docx-comment-export.d.ts +3 -0
- package/dist/internal/features/work/work-docx-comment-metadata.d.ts +2 -0
- package/dist/internal/features/work/work-docx-drawing-extension-preservation.d.ts +4 -0
- package/dist/internal/features/work/work-docx-equation-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-equation-export.d.ts +14 -0
- package/dist/internal/features/work/work-docx-equation-import.d.ts +30 -0
- package/dist/internal/features/work/work-docx-equation-story.d.ts +9 -0
- package/dist/internal/features/work/work-docx-export-formatting.d.ts +3 -1
- package/dist/internal/features/work/work-docx-export-image.d.ts +5 -1
- package/dist/internal/features/work/work-docx-export.d.ts +1 -1
- package/dist/internal/features/work/work-docx-field-instructions.d.ts +8 -0
- package/dist/internal/features/work/work-docx-font-table-preservation.d.ts +3 -0
- package/dist/internal/features/work/work-docx-ignorable-extension-preservation.d.ts +15 -0
- package/dist/internal/features/work/work-docx-image-crop.d.ts +12 -0
- package/dist/internal/features/work/work-docx-image-identity.d.ts +17 -0
- package/dist/internal/features/work/work-docx-image-layer.d.ts +12 -0
- package/dist/internal/features/work/work-docx-image-layout-import.d.ts +14 -2
- package/dist/internal/features/work/work-docx-image-wrap.d.ts +15 -0
- package/dist/internal/features/work/work-docx-import.d.ts +13 -3
- package/dist/internal/features/work/work-docx-list-export.d.ts +18 -0
- package/dist/internal/features/work/work-docx-list-import.d.ts +14 -0
- package/dist/internal/features/work/work-docx-note-comment-content-control-block-preservation.d.ts +18 -0
- package/dist/internal/features/work/work-docx-note-comment-content-control-model.d.ts +47 -0
- package/dist/internal/features/work/work-docx-note-comment-content-control-preservation.d.ts +4 -0
- package/dist/internal/features/work/work-docx-note-comment-content-control-properties.d.ts +17 -0
- package/dist/internal/features/work/work-docx-note-comment-content-control-table-model.d.ts +17 -0
- package/dist/internal/features/work/work-docx-note-comment-content-control-xml.d.ts +14 -0
- package/dist/internal/features/work/work-docx-note-comment-extension-preservation.d.ts +2 -0
- package/dist/internal/features/work/work-docx-note-comment-hyperlink-content.d.ts +40 -0
- package/dist/internal/features/work/work-docx-note-comment-hyperlink-preservation.d.ts +5 -0
- package/dist/internal/features/work/work-docx-note-comment-hyperlink-relationships.d.ts +35 -0
- package/dist/internal/features/work/work-docx-note-comment-identity.d.ts +15 -0
- package/dist/internal/features/work/work-docx-note-comment-run-preservation.d.ts +4 -0
- package/dist/internal/features/work/work-docx-note-comment-run-properties.d.ts +2 -0
- package/dist/internal/features/work/work-docx-note-image-import.d.ts +12 -0
- package/dist/internal/features/work/work-docx-note-image-relationships.d.ts +1 -0
- package/dist/internal/features/work/work-docx-numbering-extension-preservation.d.ts +6 -0
- package/dist/internal/features/work/work-docx-numbering.d.ts +1 -0
- package/dist/internal/features/work/work-docx-page-borders-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-page-borders-import.d.ts +10 -0
- package/dist/internal/features/work/work-docx-page-margins-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-page-margins-import.d.ts +18 -0
- package/dist/internal/features/work/work-docx-page-size-diagnostics.d.ts +2 -0
- package/dist/internal/features/work/work-docx-page-size-import.d.ts +17 -0
- package/dist/internal/features/work/work-docx-paragraph-borders-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-paragraph-borders-export.d.ts +18 -0
- package/dist/internal/features/work/work-docx-paragraph-borders-import.d.ts +24 -0
- package/dist/internal/features/work/work-docx-paragraph-default-collapsed.d.ts +19 -0
- package/dist/internal/features/work/work-docx-paragraph-extension-preservation.d.ts +2 -0
- package/dist/internal/features/work/work-docx-paragraph-identity-import.d.ts +10 -0
- package/dist/internal/features/work/work-docx-paragraph-identity.d.ts +18 -0
- package/dist/internal/features/work/work-docx-paragraph-pagination-import.d.ts +6 -1
- package/dist/internal/features/work/work-docx-paragraph-shading-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-paragraph-shading-export.d.ts +5 -0
- package/dist/internal/features/work/work-docx-paragraph-shading-import.d.ts +18 -0
- package/dist/internal/features/work/work-docx-run-formatting-import.d.ts +3 -0
- package/dist/internal/features/work/work-docx-settings-preservation.d.ts +10 -0
- package/dist/internal/features/work/work-docx-settings-xml.d.ts +16 -0
- package/dist/internal/features/work/work-docx-style-extension-preservation.d.ts +2 -0
- package/dist/internal/features/work/work-docx-table-cell-export.d.ts +2 -1
- package/dist/internal/features/work/work-docx-table-cell-import.d.ts +3 -0
- package/dist/internal/features/work/work-docx-table-extension-preservation.d.ts +2 -0
- package/dist/internal/features/work/work-docx-table-row-import.d.ts +2 -0
- package/dist/internal/features/work/work-docx-table-sizing-import.d.ts +1 -0
- package/dist/internal/features/work/work-docx-theme-reference.d.ts +23 -0
- package/dist/internal/features/work/work-docx-theme.d.ts +4 -1
- package/dist/internal/features/work/work-docx-twips.d.ts +12 -0
- package/dist/internal/features/work/work-file-contract.d.ts +1 -0
- package/dist/internal/features/work/work-file-io.d.ts +1 -1
- package/dist/internal/features/work/work-markdown-extensions.d.ts +4 -1
- package/dist/internal/features/work/work-ooxml-package-preservation.d.ts +12 -0
- package/dist/internal/features/work/work-ooxml-package-security.d.ts +6 -0
- package/dist/internal/features/work/work-ooxml-relationship-preservation.d.ts +10 -0
- package/dist/internal/features/work/work-ooxml-xml.d.ts +2 -0
- package/dist/internal/features/work/work-pdf-export.d.ts +10 -0
- package/dist/internal/features/work/work-repository.d.ts +2 -0
- package/dist/internal/features/work/work-types.d.ts +15 -2
- package/dist/internal/kernel/office-kernel-client-types.d.ts +1 -0
- package/dist/internal/kernel/office-kernel-protocol.d.ts +7 -0
- package/dist/internal/kernel/office-kernel-version.d.ts +1 -1
- package/dist/office-kernel.wasm +0 -0
- package/dist/office-kernel.worker.js +93 -41
- package/dist/react.d.ts +18 -12
- package/dist/react.js +1 -1
- package/dist/styles.css +1367 -16
- package/dist/vue.d.ts +48 -5
- package/dist/vue.js +42 -3
- package/dist/web-component.d.ts +24 -2
- package/dist/web-component.js +101 -2
- package/docs/latest/en/browser-editor-architecture.md +262 -47
- package/package.json +29 -4
- package/dist/0~152.js +0 -94
- package/dist/0~2582.js +0 -485
- package/dist/0~4750.js +0 -939
- package/dist/0~5861.js +0 -596
- package/dist/0~work-document-extensions.js +0 -3045
- package/dist/0~work-document-model-codec.js +0 -42
- package/dist/0~work-docx-bibliography.js +0 -347
- package/dist/0~work-docx-page-color.js +0 -42
- package/dist/2881.js +0 -1455
- package/dist/8728.js +0 -723
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import jszip from "jszip";
|
|
2
2
|
import { normalizeRadarStyle, presentationChartShowsLegend, presentationChartAxes, presentationChartBubbleSizes, normalizePresentationBubbleScale, presentationChartUsesNumericXAxis, normalizePresentationBubbleSizeRepresents, normalizePresentationChartLegendPosition, presentationChartXValues, normalizeDoughnutHoleSize, presentationChartSupportsAxisTitles, normalizePresentationScatterStyle } from "./0~work-presentation-charts.js";
|
|
3
|
-
import { directChildren, xmlNamespacePrefix, parseXml, firstDescendant,
|
|
3
|
+
import { directChildren, xmlNamespacePrefix, parseXml, firstDescendant, directChild, descendants, childPath, attribute } from "./5184.js";
|
|
4
|
+
import { workSpreadsheetChartAxisShowsMajorGridlinesByDefault, workSpreadsheetChartAxisDefaultLabelPosition, workSpreadsheetChartAxisIsCategoryAxis, workSpreadsheetChartAxisIsValueAxis } from "./8715.js";
|
|
4
5
|
import { presentationGroupPath, withPresentationDesign } from "./0~1403.js";
|
|
5
6
|
import { patchPptxChartLayoutAndSeriesStyles, patchPptxTransitions, patchPptxComments, patchPptxChartDataLabels, patchPptxChartSeriesAnalysis } from "./0~7614.js";
|
|
6
7
|
const DRAWING_NAMESPACE = 'http://schemas.openxmlformats.org/drawingml/2006/main';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { contentTypeForPart, directChildren, bytesToDataUrl, OoxmlPackage, firstDescendant, descendants, directChild, childPath, attribute } from "./
|
|
1
|
+
import { contentTypeForPart, directChildren, bytesToDataUrl, OoxmlPackage, firstDescendant, descendants, directChild, childPath, attribute, createOfficeId as createWorkId } from "./5184.js";
|
|
2
2
|
import { normalizeRadarStyle, normalizePresentationChartLegendPosition, presentationChartUsesNumericXAxis, normalizePresentationBubbleScale, normalizePresentationBubbleSizeRepresents, withPresentationChartLayout, normalizeDoughnutHoleSize, normalizePresentationScatterStyle } from "./0~work-presentation-charts.js";
|
|
3
3
|
import { loadPptxCommentAuthors, readPptxSlideComments, readPptxChartLayoutAndSeriesStyles, readPptxTransition, readPptxChartSeriesAnalysis, readPptxChartDataLabels } from "./0~7614.js";
|
|
4
4
|
import { parseXlsxChartAxes } from "./4104.js";
|
|
5
|
-
import { createOfficeId as createWorkId } from "./1134.js";
|
|
6
5
|
import { scaledPresentationVisuals } from "./0~work-presentation-visual-scale.js";
|
|
7
6
|
async function loadPptxTheme(archive, presentationRelationships) {
|
|
8
7
|
const defaults = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { workSpreadsheetChartSupportsErrorBars, normalizeWorkSpreadsheetChartAxes, normalizeWorkSpreadsheetErrorBars, normalizeWorkSpreadsheetChartLayout, workSpreadsheetChartSupportsTrendlines, workSpreadsheetChartSupportsSeriesAnalysis, normalizeWorkSpreadsheetChartSeriesStyle, normalizeWorkSpreadsheetTrendline } from "./8715.js";
|
|
2
|
-
import { createOfficeId as createWorkId } from "./
|
|
2
|
+
import { createOfficeId as createWorkId } from "./5184.js";
|
|
3
3
|
function chartTypeWithAxes(type) {
|
|
4
4
|
return 'pie' === type || 'doughnut' === type ? 'column' : type;
|
|
5
5
|
}
|
package/dist/2591.js
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { initializeWorkOfficeCollaborationMetadata, assertWorkOfficeCollaborationEditable, OfficeCollaborationError as WorkOfficeCollaborationError, readOfficeCollaborationMetadata as readWorkOfficeCollaborationMetadata, registerWorkOfficeCollaborationInitializer, markWorkOfficeCollaborationInitialized, assertWorkOfficeCollaborationOrigin } from "./9787.js";
|
|
2
|
+
import * as __rspack_external_yjs from "yjs";
|
|
3
|
+
const MARKDOWN_SOURCE_ROOT = 'markdown.source';
|
|
4
|
+
function initializeWorkOfficeMarkdownCollaboration(session, content) {
|
|
5
|
+
assertMarkdownSession(session);
|
|
6
|
+
assertWorkOfficeCollaborationEditable(session);
|
|
7
|
+
const initialMarkdown = validatedMarkdown(content);
|
|
8
|
+
const existing = readWorkOfficeCollaborationMetadata(session);
|
|
9
|
+
if (existing?.initialized) return {
|
|
10
|
+
initialized: false,
|
|
11
|
+
content: readWorkOfficeMarkdownCollaboration(session)
|
|
12
|
+
};
|
|
13
|
+
const source = markdownSource(session);
|
|
14
|
+
if (source.length > 0) throw new WorkOfficeCollaborationError('office.collaboration.bootstrap_ambiguous', 'The Markdown collaboration source contains data without initialized metadata.');
|
|
15
|
+
const origin = session.createOrigin('bootstrap');
|
|
16
|
+
session.transact(()=>{
|
|
17
|
+
const metadata = initializeWorkOfficeCollaborationMetadata(session);
|
|
18
|
+
if (metadata.initialized) return;
|
|
19
|
+
registerWorkOfficeCollaborationInitializer(session);
|
|
20
|
+
if (initialMarkdown) source.insert(0, initialMarkdown);
|
|
21
|
+
markWorkOfficeCollaborationInitialized(session);
|
|
22
|
+
}, origin);
|
|
23
|
+
return {
|
|
24
|
+
initialized: true,
|
|
25
|
+
content: readWorkOfficeMarkdownCollaboration(session)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function readWorkOfficeMarkdownCollaboration(session) {
|
|
29
|
+
assertInitializedMarkdownSession(session);
|
|
30
|
+
return {
|
|
31
|
+
type: 'markdown',
|
|
32
|
+
markdown: markdownSource(session).toString()
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function replaceWorkOfficeMarkdownCollaboration(session, markdown, origin = session.localOrigin) {
|
|
36
|
+
assertInitializedMarkdownSession(session);
|
|
37
|
+
assertWorkOfficeCollaborationEditable(session);
|
|
38
|
+
const source = markdownSource(session);
|
|
39
|
+
const current = source.toString();
|
|
40
|
+
if (current === markdown) return false;
|
|
41
|
+
const replacement = markdownReplacement(current, markdown);
|
|
42
|
+
session.transact(()=>{
|
|
43
|
+
if (replacement.deleteLength > 0) source.delete(replacement.index, replacement.deleteLength);
|
|
44
|
+
if (replacement.insert) source.insert(replacement.index, replacement.insert);
|
|
45
|
+
}, origin);
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
function createWorkOfficeMarkdownCollaborationBinding(session, options = {}) {
|
|
49
|
+
assertInitializedMarkdownSession(session);
|
|
50
|
+
return new WorkOfficeMarkdownCollaborationBindingImpl(session, options);
|
|
51
|
+
}
|
|
52
|
+
class WorkOfficeMarkdownCollaborationBindingImpl {
|
|
53
|
+
origin;
|
|
54
|
+
#session;
|
|
55
|
+
#source;
|
|
56
|
+
#undoManager;
|
|
57
|
+
#listeners = new Set();
|
|
58
|
+
#historyListeners = new Set();
|
|
59
|
+
#destroyed = false;
|
|
60
|
+
constructor(session, options){
|
|
61
|
+
this.#session = session;
|
|
62
|
+
this.#source = markdownSource(session);
|
|
63
|
+
this.origin = options.origin ?? session.createOrigin(session.localOrigin.kind);
|
|
64
|
+
assertWorkOfficeCollaborationOrigin(this.origin);
|
|
65
|
+
this.#undoManager = new __rspack_external_yjs.UndoManager(this.#source, {
|
|
66
|
+
captureTimeout: options.captureTimeoutMs ?? 1000,
|
|
67
|
+
trackedOrigins: new Set([
|
|
68
|
+
this.origin
|
|
69
|
+
])
|
|
70
|
+
});
|
|
71
|
+
this.#source.observe(this.#onSourceChange);
|
|
72
|
+
this.#undoManager.on('stack-item-added', this.#onHistoryChange);
|
|
73
|
+
this.#undoManager.on('stack-item-popped', this.#onHistoryChange);
|
|
74
|
+
this.#undoManager.on('stack-item-updated', this.#onHistoryChange);
|
|
75
|
+
}
|
|
76
|
+
content() {
|
|
77
|
+
this.ensureActive();
|
|
78
|
+
return {
|
|
79
|
+
type: 'markdown',
|
|
80
|
+
markdown: this.#source.toString()
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
replace(markdown) {
|
|
84
|
+
this.ensureActive();
|
|
85
|
+
return replaceWorkOfficeMarkdownCollaboration(this.#session, markdown, this.origin);
|
|
86
|
+
}
|
|
87
|
+
canUndo() {
|
|
88
|
+
this.ensureActive();
|
|
89
|
+
return this.#undoManager.undoStack.length > 0;
|
|
90
|
+
}
|
|
91
|
+
canRedo() {
|
|
92
|
+
this.ensureActive();
|
|
93
|
+
return this.#undoManager.redoStack.length > 0;
|
|
94
|
+
}
|
|
95
|
+
undo() {
|
|
96
|
+
this.ensureActive();
|
|
97
|
+
assertWorkOfficeCollaborationEditable(this.#session);
|
|
98
|
+
if (!this.canUndo()) return false;
|
|
99
|
+
this.#undoManager.undo();
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
redo() {
|
|
103
|
+
this.ensureActive();
|
|
104
|
+
assertWorkOfficeCollaborationEditable(this.#session);
|
|
105
|
+
if (!this.canRedo()) return false;
|
|
106
|
+
this.#undoManager.redo();
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
stopCapturing() {
|
|
110
|
+
this.ensureActive();
|
|
111
|
+
this.#undoManager.stopCapturing();
|
|
112
|
+
}
|
|
113
|
+
subscribe(listener) {
|
|
114
|
+
this.ensureActive();
|
|
115
|
+
this.#listeners.add(listener);
|
|
116
|
+
return ()=>this.#listeners.delete(listener);
|
|
117
|
+
}
|
|
118
|
+
subscribeHistory(listener) {
|
|
119
|
+
this.ensureActive();
|
|
120
|
+
this.#historyListeners.add(listener);
|
|
121
|
+
return ()=>this.#historyListeners.delete(listener);
|
|
122
|
+
}
|
|
123
|
+
destroy() {
|
|
124
|
+
if (this.#destroyed) return;
|
|
125
|
+
this.#destroyed = true;
|
|
126
|
+
this.#source.unobserve(this.#onSourceChange);
|
|
127
|
+
this.#undoManager.off('stack-item-added', this.#onHistoryChange);
|
|
128
|
+
this.#undoManager.off('stack-item-popped', this.#onHistoryChange);
|
|
129
|
+
this.#undoManager.off('stack-item-updated', this.#onHistoryChange);
|
|
130
|
+
this.#undoManager.destroy();
|
|
131
|
+
this.#listeners.clear();
|
|
132
|
+
this.#historyListeners.clear();
|
|
133
|
+
}
|
|
134
|
+
#onSourceChange = (event)=>{
|
|
135
|
+
const change = {
|
|
136
|
+
content: {
|
|
137
|
+
type: 'markdown',
|
|
138
|
+
markdown: this.#source.toString()
|
|
139
|
+
},
|
|
140
|
+
local: event.transaction.origin === this.origin,
|
|
141
|
+
origin: event.transaction.origin
|
|
142
|
+
};
|
|
143
|
+
for (const listener of this.#listeners)listener(change);
|
|
144
|
+
};
|
|
145
|
+
#onHistoryChange = ()=>{
|
|
146
|
+
for (const listener of this.#historyListeners)listener();
|
|
147
|
+
};
|
|
148
|
+
ensureActive() {
|
|
149
|
+
if (!this.#destroyed) return;
|
|
150
|
+
throw new WorkOfficeCollaborationError('office.collaboration.binding_destroyed', 'The Markdown collaboration binding has been destroyed.');
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function markdownSource(session) {
|
|
154
|
+
return session.document.getText(session.rootName(MARKDOWN_SOURCE_ROOT));
|
|
155
|
+
}
|
|
156
|
+
function assertMarkdownSession(session) {
|
|
157
|
+
if ('markdown' === session.kind) return;
|
|
158
|
+
throw new WorkOfficeCollaborationError('office.collaboration.kind_mismatch', `A Markdown collaboration binding cannot use a '${session.kind}' session.`);
|
|
159
|
+
}
|
|
160
|
+
function validatedMarkdown(content) {
|
|
161
|
+
if (content?.type === 'markdown' && 'string' == typeof content.markdown) return content.markdown;
|
|
162
|
+
throw new WorkOfficeCollaborationError('office.collaboration.content_invalid', 'Markdown collaboration initialization requires a valid Markdown content value.');
|
|
163
|
+
}
|
|
164
|
+
function assertInitializedMarkdownSession(session) {
|
|
165
|
+
assertMarkdownSession(session);
|
|
166
|
+
const metadata = readWorkOfficeCollaborationMetadata(session);
|
|
167
|
+
if (metadata?.initialized) return;
|
|
168
|
+
throw new WorkOfficeCollaborationError('office.collaboration.not_initialized', 'The Markdown collaboration session has not been initialized.');
|
|
169
|
+
}
|
|
170
|
+
function markdownReplacement(current, next) {
|
|
171
|
+
let prefix = 0;
|
|
172
|
+
const maximumPrefix = Math.min(current.length, next.length);
|
|
173
|
+
while(prefix < maximumPrefix && current[prefix] === next[prefix])prefix += 1;
|
|
174
|
+
prefix = safeUtf16Boundary(current, prefix);
|
|
175
|
+
prefix = safeUtf16Boundary(next, prefix);
|
|
176
|
+
let suffix = 0;
|
|
177
|
+
const maximumSuffix = Math.min(current.length - prefix, next.length - prefix);
|
|
178
|
+
while(suffix < maximumSuffix && current[current.length - suffix - 1] === next[next.length - suffix - 1])suffix += 1;
|
|
179
|
+
const currentEnd = safeUtf16Boundary(current, current.length - suffix);
|
|
180
|
+
const nextEnd = safeUtf16Boundary(next, next.length - suffix);
|
|
181
|
+
return {
|
|
182
|
+
index: prefix,
|
|
183
|
+
deleteLength: Math.max(0, currentEnd - prefix),
|
|
184
|
+
insert: next.slice(prefix, nextEnd)
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
function safeUtf16Boundary(value, index) {
|
|
188
|
+
if (index > 0 && index < value.length && isHighSurrogate(value.charCodeAt(index - 1)) && isLowSurrogate(value.charCodeAt(index))) return index - 1;
|
|
189
|
+
return index;
|
|
190
|
+
}
|
|
191
|
+
function isHighSurrogate(value) {
|
|
192
|
+
return value >= 0xd800 && value <= 0xdbff;
|
|
193
|
+
}
|
|
194
|
+
function isLowSurrogate(value) {
|
|
195
|
+
return value >= 0xdc00 && value <= 0xdfff;
|
|
196
|
+
}
|
|
197
|
+
export { createWorkOfficeMarkdownCollaborationBinding as createOfficeMarkdownCollaborationBinding, initializeWorkOfficeMarkdownCollaboration as initializeOfficeMarkdownCollaboration, readWorkOfficeMarkdownCollaboration as readOfficeMarkdownCollaboration, replaceWorkOfficeMarkdownCollaboration as replaceOfficeMarkdownCollaboration };
|