@a3s-lab/office 0.1.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/LICENSE +21 -0
- package/README.md +470 -0
- package/THIRD_PARTY_NOTICES.md +33 -0
- package/dist/0~1403.js +245 -0
- package/dist/0~152.js +94 -0
- package/dist/0~3539.js +1856 -0
- package/dist/0~3557.js +179 -0
- package/dist/0~3635.js +302 -0
- package/dist/0~4595.js +1162 -0
- package/dist/0~5050.js +308 -0
- package/dist/0~6552.js +787 -0
- package/dist/0~7048.js +2110 -0
- package/dist/0~7614.js +1037 -0
- package/dist/0~8155.js +299 -0
- package/dist/0~9445.js +283 -0
- package/dist/0~9512.js +743 -0
- package/dist/0~document-editor.js +10967 -0
- package/dist/0~markdown-editor.js +2260 -0
- package/dist/0~pdf-viewer.js +2156 -0
- package/dist/0~presentation-editor.js +8359 -0
- package/dist/0~rslib-runtime.js +27 -0
- package/dist/0~spreadsheet-editor.js +10388 -0
- package/dist/0~use-office-draft.js +46 -0
- package/dist/0~work-document-extensions.js +2470 -0
- package/dist/0~work-document-links.js +14 -0
- package/dist/0~work-document-model-codec.js +42 -0
- package/dist/0~work-document-page-color.js +11 -0
- package/dist/0~work-document-paragraph-formatting.js +425 -0
- package/dist/0~work-docx-bibliography.js +347 -0
- package/dist/0~work-docx-export.js +1151 -0
- package/dist/0~work-docx-import.js +3116 -0
- package/dist/0~work-docx-page-color.js +42 -0
- package/dist/0~work-office-diagnostics.js +1377 -0
- package/dist/0~work-pptx-export.js +1009 -0
- package/dist/0~work-pptx-import.js +1138 -0
- package/dist/0~work-presentation-charts.js +442 -0
- package/dist/0~work-presentation-transition.js +38 -0
- package/dist/0~work-presentation-visual-scale.js +38 -0
- package/dist/0~work-spreadsheet-formula-support.js +9 -0
- package/dist/1134.js +445 -0
- package/dist/4104.js +5786 -0
- package/dist/432.js +211 -0
- package/dist/4704.js +1364 -0
- package/dist/6489.js +182 -0
- package/dist/8715.js +3959 -0
- package/dist/8728.js +723 -0
- package/dist/9356.js +10 -0
- package/dist/core.d.ts +15 -0
- package/dist/core.js +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -0
- package/dist/internal/design-system/primitives/button/button.d.ts +9 -0
- package/dist/internal/design-system/primitives/button/icon-button.d.ts +7 -0
- package/dist/internal/design-system/primitives/dialog/dialog.d.ts +12 -0
- package/dist/internal/design-system/primitives/feedback/collection-state.d.ts +9 -0
- package/dist/internal/design-system/primitives/feedback/inline-notice.d.ts +10 -0
- package/dist/internal/design-system/primitives/feedback/state-view.d.ts +13 -0
- package/dist/internal/design-system/primitives/form/field.d.ts +19 -0
- package/dist/internal/design-system/primitives/index.d.ts +14 -0
- package/dist/internal/design-system/primitives/layout/split-handle.d.ts +17 -0
- package/dist/internal/design-system/primitives/navigation/segmented-control.d.ts +19 -0
- package/dist/internal/design-system/primitives/navigation/tab-navigation.d.ts +13 -0
- package/dist/internal/design-system/primitives/navigation/tabs.d.ts +21 -0
- package/dist/internal/design-system/primitives/overlay/dialog-focus-scope.d.ts +17 -0
- package/dist/internal/design-system/primitives/overlay/popover.d.ts +34 -0
- package/dist/internal/design-system/primitives/overlay/portal-root.d.ts +1 -0
- package/dist/internal/design-system/primitives/status/status-badge.d.ts +6 -0
- package/dist/internal/features/work/components/work-document-pages.d.ts +4 -0
- package/dist/internal/features/work/components/work-editor-agent-menus.d.ts +12 -0
- package/dist/internal/features/work/components/work-editor-loading-state.d.ts +3 -0
- package/dist/internal/features/work/editors/document-changes-panel.d.ts +9 -0
- package/dist/internal/features/work/editors/document-citation-source-form.d.ts +33 -0
- package/dist/internal/features/work/editors/document-citations-panel.d.ts +8 -0
- package/dist/internal/features/work/editors/document-columns-panel.d.ts +5 -0
- package/dist/internal/features/work/editors/document-comment-composer.d.ts +13 -0
- package/dist/internal/features/work/editors/document-comments-panel.d.ts +17 -0
- package/dist/internal/features/work/editors/document-editor-focus.d.ts +1 -0
- package/dist/internal/features/work/editors/document-editor-pagination.d.ts +3 -0
- package/dist/internal/features/work/editors/document-editor-support.d.ts +34 -0
- package/dist/internal/features/work/editors/document-editor.d.ts +20 -0
- package/dist/internal/features/work/editors/document-find-highlight.d.ts +8 -0
- package/dist/internal/features/work/editors/document-find-replace-panel.d.ts +10 -0
- package/dist/internal/features/work/editors/document-formatting-options.d.ts +113 -0
- package/dist/internal/features/work/editors/document-home-ribbon.d.ts +9 -0
- package/dist/internal/features/work/editors/document-layout-panel.d.ts +10 -0
- package/dist/internal/features/work/editors/document-list-gallery.d.ts +4 -0
- package/dist/internal/features/work/editors/document-navigation-panel.d.ts +9 -0
- package/dist/internal/features/work/editors/document-page-chrome-editor.d.ts +39 -0
- package/dist/internal/features/work/editors/document-page-chrome-panel.d.ts +5 -0
- package/dist/internal/features/work/editors/document-page-chrome-ribbon.d.ts +10 -0
- package/dist/internal/features/work/editors/document-page-navigation.d.ts +14 -0
- package/dist/internal/features/work/editors/document-page-stack.d.ts +8 -0
- package/dist/internal/features/work/editors/document-pagination-popover.d.ts +4 -0
- package/dist/internal/features/work/editors/document-paragraph-spacing-popover.d.ts +4 -0
- package/dist/internal/features/work/editors/document-picture-ribbon.d.ts +4 -0
- package/dist/internal/features/work/editors/document-ruler-tab-stops.d.ts +12 -0
- package/dist/internal/features/work/editors/document-ruler.d.ts +15 -0
- package/dist/internal/features/work/editors/document-selection-context-menu.d.ts +22 -0
- package/dist/internal/features/work/editors/document-selection-toolbar.d.ts +8 -0
- package/dist/internal/features/work/editors/document-status-bar.d.ts +19 -0
- package/dist/internal/features/work/editors/document-style-gallery.d.ts +4 -0
- package/dist/internal/features/work/editors/document-table-insert-popover.d.ts +4 -0
- package/dist/internal/features/work/editors/document-table-ribbon.d.ts +7 -0
- package/dist/internal/features/work/editors/document-task-pane.d.ts +11 -0
- package/dist/internal/features/work/editors/document-toolbar.d.ts +100 -0
- package/dist/internal/features/work/editors/document-vertical-ruler.d.ts +6 -0
- package/dist/internal/features/work/editors/markdown-editor-focus.d.ts +2 -0
- package/dist/internal/features/work/editors/markdown-editor.d.ts +16 -0
- package/dist/internal/features/work/editors/markdown-insert-dialog.d.ts +19 -0
- package/dist/internal/features/work/editors/markdown-selection-context-menu.d.ts +14 -0
- package/dist/internal/features/work/editors/markdown-source-commands.d.ts +41 -0
- package/dist/internal/features/work/editors/markdown-status.d.ts +7 -0
- package/dist/internal/features/work/editors/markdown-toolbar.d.ts +22 -0
- package/dist/internal/features/work/editors/markdown-workspace.d.ts +26 -0
- package/dist/internal/features/work/editors/office-checkbox.d.ts +9 -0
- package/dist/internal/features/work/editors/office-color-picker.d.ts +11 -0
- package/dist/internal/features/work/editors/office-controls.d.ts +7 -0
- package/dist/internal/features/work/editors/office-dialog.d.ts +35 -0
- package/dist/internal/features/work/editors/office-editor-extension.d.ts +86 -0
- package/dist/internal/features/work/editors/office-file-data.d.ts +1 -0
- package/dist/internal/features/work/editors/office-font-families.d.ts +187 -0
- package/dist/internal/features/work/editors/office-menu-keyboard.d.ts +2 -0
- package/dist/internal/features/work/editors/office-number-field.d.ts +21 -0
- package/dist/internal/features/work/editors/office-number-normalization.d.ts +9 -0
- package/dist/internal/features/work/editors/office-select.d.ts +19 -0
- package/dist/internal/features/work/editors/office-shortcuts.d.ts +1 -0
- package/dist/internal/features/work/editors/office-slider.d.ts +10 -0
- package/dist/internal/features/work/editors/office-table-dimensions.d.ts +4 -0
- package/dist/internal/features/work/editors/office-table-insert-popover.d.ts +7 -0
- package/dist/internal/features/work/editors/office-task-pane.d.ts +7 -0
- package/dist/internal/features/work/editors/office-text-field.d.ts +20 -0
- package/dist/internal/features/work/editors/office-tiptap-extensions.d.ts +2 -0
- package/dist/internal/features/work/editors/pdf-annotation-controller.d.ts +23 -0
- package/dist/internal/features/work/editors/pdf-editor-extensions.d.ts +36 -0
- package/dist/internal/features/work/editors/pdf-thumbnail-rail.d.ts +26 -0
- package/dist/internal/features/work/editors/pdf-toolbar.d.ts +23 -0
- package/dist/internal/features/work/editors/pdf-viewer-controller.d.ts +48 -0
- package/dist/internal/features/work/editors/pdf-viewer.d.ts +11 -0
- package/dist/internal/features/work/editors/presentation-arrangement-controller.d.ts +19 -0
- package/dist/internal/features/work/editors/presentation-chart-analysis-canvas.d.ts +21 -0
- package/dist/internal/features/work/editors/presentation-chart-axis-canvas.d.ts +33 -0
- package/dist/internal/features/work/editors/presentation-chart-axis-editor.d.ts +5 -0
- package/dist/internal/features/work/editors/presentation-chart-canvas.d.ts +5 -0
- package/dist/internal/features/work/editors/presentation-chart-cartesian-canvas.d.ts +3 -0
- package/dist/internal/features/work/editors/presentation-chart-data-label-editor.d.ts +6 -0
- package/dist/internal/features/work/editors/presentation-chart-data-labels.d.ts +26 -0
- package/dist/internal/features/work/editors/presentation-chart-layout-editor.d.ts +5 -0
- package/dist/internal/features/work/editors/presentation-chart-legend-canvas.d.ts +15 -0
- package/dist/internal/features/work/editors/presentation-chart-panel.d.ts +7 -0
- package/dist/internal/features/work/editors/presentation-chart-series-analysis-editor.d.ts +6 -0
- package/dist/internal/features/work/editors/presentation-chart-series-canvas.d.ts +15 -0
- package/dist/internal/features/work/editors/presentation-command-controller.d.ts +3 -0
- package/dist/internal/features/work/editors/presentation-command-types.d.ts +206 -0
- package/dist/internal/features/work/editors/presentation-comments-panel.d.ts +9 -0
- package/dist/internal/features/work/editors/presentation-context-menu.d.ts +11 -0
- package/dist/internal/features/work/editors/presentation-design-panel.d.ts +13 -0
- package/dist/internal/features/work/editors/presentation-editor-focus.d.ts +12 -0
- package/dist/internal/features/work/editors/presentation-editor-operations.d.ts +10 -0
- package/dist/internal/features/work/editors/presentation-editor-types.d.ts +22 -0
- package/dist/internal/features/work/editors/presentation-editor.d.ts +3 -0
- package/dist/internal/features/work/editors/presentation-keyboard-extension.d.ts +3 -0
- package/dist/internal/features/work/editors/presentation-player.d.ts +7 -0
- package/dist/internal/features/work/editors/presentation-presenter-view.d.ts +15 -0
- package/dist/internal/features/work/editors/presentation-selection.d.ts +21 -0
- package/dist/internal/features/work/editors/presentation-slide-canvas.d.ts +26 -0
- package/dist/internal/features/work/editors/presentation-slide-thumbnail.d.ts +18 -0
- package/dist/internal/features/work/editors/presentation-status-bar.d.ts +10 -0
- package/dist/internal/features/work/editors/presentation-text-editor.d.ts +22 -0
- package/dist/internal/features/work/editors/presentation-text-formatting.d.ts +3 -0
- package/dist/internal/features/work/editors/presentation-thumbnail-rail.d.ts +20 -0
- package/dist/internal/features/work/editors/presentation-toolbar.d.ts +19 -0
- package/dist/internal/features/work/editors/presentation-transition-panel.d.ts +9 -0
- package/dist/internal/features/work/editors/presentation-workspace.d.ts +38 -0
- package/dist/internal/features/work/editors/spreadsheet-calculation-model.d.ts +8 -0
- package/dist/internal/features/work/editors/spreadsheet-calculation-projection.d.ts +32 -0
- package/dist/internal/features/work/editors/spreadsheet-chart-axis-editor.d.ts +9 -0
- package/dist/internal/features/work/editors/spreadsheet-chart-draft.d.ts +17 -0
- package/dist/internal/features/work/editors/spreadsheet-chart-layout-editor.d.ts +13 -0
- package/dist/internal/features/work/editors/spreadsheet-chart-panel.d.ts +10 -0
- package/dist/internal/features/work/editors/spreadsheet-chart-series-style-editor.d.ts +9 -0
- package/dist/internal/features/work/editors/spreadsheet-clipboard-shortcuts.d.ts +9 -0
- package/dist/internal/features/work/editors/spreadsheet-command-controller.d.ts +121 -0
- package/dist/internal/features/work/editors/spreadsheet-conditional-comparison-fields.d.ts +7 -0
- package/dist/internal/features/work/editors/spreadsheet-conditional-format-model.d.ts +72 -0
- package/dist/internal/features/work/editors/spreadsheet-conditional-format-panel.d.ts +7 -0
- package/dist/internal/features/work/editors/spreadsheet-conditional-threshold-fields.d.ts +10 -0
- package/dist/internal/features/work/editors/spreadsheet-context-menu.d.ts +36 -0
- package/dist/internal/features/work/editors/spreadsheet-data-label-editor.d.ts +9 -0
- package/dist/internal/features/work/editors/spreadsheet-editor-ribbon.d.ts +46 -0
- package/dist/internal/features/work/editors/spreadsheet-editor-support.d.ts +31 -0
- package/dist/internal/features/work/editors/spreadsheet-editor.d.ts +16 -0
- package/dist/internal/features/work/editors/spreadsheet-error-bar-editor.d.ts +10 -0
- package/dist/internal/features/work/editors/spreadsheet-find-bar.d.ts +8 -0
- package/dist/internal/features/work/editors/spreadsheet-find.d.ts +9 -0
- package/dist/internal/features/work/editors/spreadsheet-formula-panel.d.ts +10 -0
- package/dist/internal/features/work/editors/spreadsheet-header-footer-fields.d.ts +5 -0
- package/dist/internal/features/work/editors/spreadsheet-keyboard-navigation.d.ts +18 -0
- package/dist/internal/features/work/editors/spreadsheet-number-format.d.ts +11 -0
- package/dist/internal/features/work/editors/spreadsheet-pivot-panel.d.ts +10 -0
- package/dist/internal/features/work/editors/spreadsheet-print-settings-panel.d.ts +6 -0
- package/dist/internal/features/work/editors/spreadsheet-protection-panel.d.ts +7 -0
- package/dist/internal/features/work/editors/spreadsheet-sheet-bar.d.ts +17 -0
- package/dist/internal/features/work/editors/spreadsheet-sheet-model.d.ts +13 -0
- package/dist/internal/features/work/editors/spreadsheet-trendline-editor.d.ts +8 -0
- package/dist/internal/features/work/editors/spreadsheet-workbook-panel.d.ts +16 -0
- package/dist/internal/features/work/editors/use-document-comments.d.ts +26 -0
- package/dist/internal/features/work/editors/use-document-insert-commands.d.ts +19 -0
- package/dist/internal/features/work/editors/use-document-layout-fonts.d.ts +2 -0
- package/dist/internal/features/work/editors/use-document-page-chrome.d.ts +33 -0
- package/dist/internal/features/work/editors/use-document-pagination.d.ts +46 -0
- package/dist/internal/features/work/editors/use-markdown-source-history.d.ts +16 -0
- package/dist/internal/features/work/editors/use-office-draft.d.ts +10 -0
- package/dist/internal/features/work/editors/use-office-editor-keyboard-shortcuts.d.ts +9 -0
- package/dist/internal/features/work/editors/use-office-editor-runtime.d.ts +6 -0
- package/dist/internal/features/work/editors/use-office-editor-wheel-zoom.d.ts +19 -0
- package/dist/internal/features/work/editors/use-office-history.d.ts +10 -0
- package/dist/internal/features/work/editors/use-presentation-clipboard.d.ts +22 -0
- package/dist/internal/features/work/editors/use-presentation-design-commands.d.ts +33 -0
- package/dist/internal/features/work/editors/use-presentation-element-commands.d.ts +29 -0
- package/dist/internal/features/work/editors/use-presentation-geometry.d.ts +17 -0
- package/dist/internal/features/work/editors/use-presentation-history.d.ts +12 -0
- package/dist/internal/features/work/editors/use-presentation-review-commands.d.ts +22 -0
- package/dist/internal/features/work/editors/use-presentation-selection.d.ts +11 -0
- package/dist/internal/features/work/editors/use-presentation-slide-commands.d.ts +18 -0
- package/dist/internal/features/work/editors/use-presentation-thumbnail-visibility.d.ts +4 -0
- package/dist/internal/features/work/editors/use-presentation-thumbnail-window.d.ts +17 -0
- package/dist/internal/features/work/editors/use-presentation-transform.d.ts +53 -0
- package/dist/internal/features/work/editors/use-spreadsheet-calculation.d.ts +17 -0
- package/dist/internal/features/work/editors/use-spreadsheet-workbook-sync.d.ts +10 -0
- package/dist/internal/features/work/editors/work-office-chrome.d.ts +61 -0
- package/dist/internal/features/work/editors/work-office-ribbon-overflow.d.ts +18 -0
- package/dist/internal/features/work/work-agent-proposal-apply.d.ts +8 -0
- package/dist/internal/features/work/work-agent-proposal.d.ts +55 -0
- package/dist/internal/features/work/work-agent-request.d.ts +6 -0
- package/dist/internal/features/work/work-chart-series-analysis-context.d.ts +3 -0
- package/dist/internal/features/work/work-document-caption-nodes.d.ts +13 -0
- package/dist/internal/features/work/work-document-captions.d.ts +14 -0
- package/dist/internal/features/work/work-document-changes.d.ts +35 -0
- package/dist/internal/features/work/work-document-character-formatting.d.ts +13 -0
- package/dist/internal/features/work/work-document-citation-nodes.d.ts +25 -0
- package/dist/internal/features/work/work-document-citations.d.ts +21 -0
- package/dist/internal/features/work/work-document-columns.d.ts +15 -0
- package/dist/internal/features/work/work-document-comments.d.ts +48 -0
- package/dist/internal/features/work/work-document-extensions.d.ts +11 -0
- package/dist/internal/features/work/work-document-field-node.d.ts +12 -0
- package/dist/internal/features/work/work-document-fields.d.ts +15 -0
- package/dist/internal/features/work/work-document-file-io.d.ts +4 -0
- package/dist/internal/features/work/work-document-fonts.d.ts +16 -0
- package/dist/internal/features/work/work-document-image-layout.d.ts +29 -0
- package/dist/internal/features/work/work-document-incremental-layout.d.ts +17 -0
- package/dist/internal/features/work/work-document-layout.d.ts +5 -0
- package/dist/internal/features/work/work-document-line-measurement.d.ts +24 -0
- package/dist/internal/features/work/work-document-links.d.ts +2 -0
- package/dist/internal/features/work/work-document-lists.d.ts +25 -0
- package/dist/internal/features/work/work-document-model-codec.d.ts +3 -0
- package/dist/internal/features/work/work-document-model.d.ts +12 -0
- package/dist/internal/features/work/work-document-note-nodes.d.ts +11 -0
- package/dist/internal/features/work/work-document-notes.d.ts +18 -0
- package/dist/internal/features/work/work-document-outline.d.ts +14 -0
- package/dist/internal/features/work/work-document-page-break.d.ts +2 -0
- package/dist/internal/features/work/work-document-page-chrome-commands.d.ts +15 -0
- package/dist/internal/features/work/work-document-page-chrome.d.ts +19 -0
- package/dist/internal/features/work/work-document-page-color.d.ts +3 -0
- package/dist/internal/features/work/work-document-pages.d.ts +19 -0
- package/dist/internal/features/work/work-document-pagination-decorations.d.ts +3 -0
- package/dist/internal/features/work/work-document-pagination-dom.d.ts +35 -0
- package/dist/internal/features/work/work-document-pagination-measurement.d.ts +9 -0
- package/dist/internal/features/work/work-document-pagination-types.d.ts +88 -0
- package/dist/internal/features/work/work-document-pagination.d.ts +17 -0
- package/dist/internal/features/work/work-document-paragraph-formatting.d.ts +61 -0
- package/dist/internal/features/work/work-document-search.d.ts +11 -0
- package/dist/internal/features/work/work-document-section-editor.d.ts +20 -0
- package/dist/internal/features/work/work-document-section-node.d.ts +13 -0
- package/dist/internal/features/work/work-document-section.d.ts +34 -0
- package/dist/internal/features/work/work-document-selection-menu.d.ts +54 -0
- package/dist/internal/features/work/work-document-tab-node.d.ts +6 -0
- package/dist/internal/features/work/work-document-tab-stops.d.ts +29 -0
- package/dist/internal/features/work/work-document-table-cell-formatting.d.ts +46 -0
- package/dist/internal/features/work/work-document-table-commands.d.ts +17 -0
- package/dist/internal/features/work/work-document-table-pagination.d.ts +5 -0
- package/dist/internal/features/work/work-document-table-row.d.ts +37 -0
- package/dist/internal/features/work/work-document-table-sizing.d.ts +27 -0
- package/dist/internal/features/work/work-document-text-layout.d.ts +14 -0
- package/dist/internal/features/work/work-docx-bibliography.d.ts +12 -0
- package/dist/internal/features/work/work-docx-caption-diagnostics.d.ts +6 -0
- package/dist/internal/features/work/work-docx-caption-export.d.ts +4 -0
- package/dist/internal/features/work/work-docx-caption-fields.d.ts +5 -0
- package/dist/internal/features/work/work-docx-caption-import.d.ts +20 -0
- package/dist/internal/features/work/work-docx-change-import.d.ts +12 -0
- package/dist/internal/features/work/work-docx-citation-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-citation-export.d.ts +3 -0
- package/dist/internal/features/work/work-docx-citation-import.d.ts +23 -0
- package/dist/internal/features/work/work-docx-column-export.d.ts +14 -0
- package/dist/internal/features/work/work-docx-column-import.d.ts +2 -0
- package/dist/internal/features/work/work-docx-comment-import.d.ts +14 -0
- package/dist/internal/features/work/work-docx-export-formatting.d.ts +30 -0
- package/dist/internal/features/work/work-docx-export-image.d.ts +2 -0
- package/dist/internal/features/work/work-docx-export.d.ts +2 -0
- package/dist/internal/features/work/work-docx-field-export.d.ts +2 -0
- package/dist/internal/features/work/work-docx-field-import.d.ts +16 -0
- package/dist/internal/features/work/work-docx-field-instructions.d.ts +8 -0
- package/dist/internal/features/work/work-docx-image-layout-import.d.ts +12 -0
- package/dist/internal/features/work/work-docx-import.d.ts +50 -0
- package/dist/internal/features/work/work-docx-list-import.d.ts +14 -0
- package/dist/internal/features/work/work-docx-note-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-note-import.d.ts +3 -0
- package/dist/internal/features/work/work-docx-page-chrome-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-page-chrome-import.d.ts +11 -0
- package/dist/internal/features/work/work-docx-page-color.d.ts +2 -0
- package/dist/internal/features/work/work-docx-paragraph-alignment-import.d.ts +12 -0
- package/dist/internal/features/work/work-docx-paragraph-direction-import.d.ts +12 -0
- package/dist/internal/features/work/work-docx-paragraph-indent-import.d.ts +12 -0
- package/dist/internal/features/work/work-docx-paragraph-pagination-import.d.ts +12 -0
- package/dist/internal/features/work/work-docx-paragraph-spacing-import.d.ts +12 -0
- package/dist/internal/features/work/work-docx-paragraph-styles.d.ts +18 -0
- package/dist/internal/features/work/work-docx-run-formatting-import.d.ts +19 -0
- package/dist/internal/features/work/work-docx-tab-stop-import.d.ts +13 -0
- package/dist/internal/features/work/work-docx-table-cell-export.d.ts +4 -0
- package/dist/internal/features/work/work-docx-table-cell-import.d.ts +16 -0
- package/dist/internal/features/work/work-docx-table-row-import.d.ts +13 -0
- package/dist/internal/features/work/work-docx-table-sizing-export.d.ts +8 -0
- package/dist/internal/features/work/work-docx-table-sizing-import.d.ts +12 -0
- package/dist/internal/features/work/work-docx-theme.d.ts +9 -0
- package/dist/internal/features/work/work-file-data.d.ts +1 -0
- package/dist/internal/features/work/work-file-download.d.ts +3 -0
- package/dist/internal/features/work/work-file-io.d.ts +8 -0
- package/dist/internal/features/work/work-markdown-extensions.d.ts +19 -0
- package/dist/internal/features/work/work-markdown-file-io.d.ts +3 -0
- package/dist/internal/features/work/work-markdown-selection-menu.d.ts +57 -0
- package/dist/internal/features/work/work-office-diagnostics.d.ts +9 -0
- package/dist/internal/features/work/work-ooxml-package.d.ts +28 -0
- package/dist/internal/features/work/work-pdf-export.d.ts +23 -0
- package/dist/internal/features/work/work-pptx-chart-axes.d.ts +3 -0
- package/dist/internal/features/work/work-pptx-chart-axis-diagnostics.d.ts +5 -0
- package/dist/internal/features/work/work-pptx-chart-data-labels.d.ts +12 -0
- package/dist/internal/features/work/work-pptx-chart-import.d.ts +11 -0
- package/dist/internal/features/work/work-pptx-chart-layout-style.d.ts +15 -0
- package/dist/internal/features/work/work-pptx-chart-series-analysis.d.ts +13 -0
- package/dist/internal/features/work/work-pptx-chart-xy.d.ts +3 -0
- package/dist/internal/features/work/work-pptx-comments.d.ts +17 -0
- package/dist/internal/features/work/work-pptx-export.d.ts +4 -0
- package/dist/internal/features/work/work-pptx-groups.d.ts +19 -0
- package/dist/internal/features/work/work-pptx-import.d.ts +6 -0
- package/dist/internal/features/work/work-pptx-layout-export.d.ts +13 -0
- package/dist/internal/features/work/work-pptx-layout-import.d.ts +30 -0
- package/dist/internal/features/work/work-pptx-style.d.ts +13 -0
- package/dist/internal/features/work/work-pptx-transition.d.ts +13 -0
- package/dist/internal/features/work/work-presentation-agent-context.d.ts +6 -0
- package/dist/internal/features/work/work-presentation-chart-axes.d.ts +14 -0
- package/dist/internal/features/work/work-presentation-charts.d.ts +37 -0
- package/dist/internal/features/work/work-presentation-clipboard.d.ts +26 -0
- package/dist/internal/features/work/work-presentation-file-io.d.ts +15 -0
- package/dist/internal/features/work/work-presentation-groups.d.ts +17 -0
- package/dist/internal/features/work/work-presentation-layouts.d.ts +13 -0
- package/dist/internal/features/work/work-presentation-transition.d.ts +4 -0
- package/dist/internal/features/work/work-presentation-visual-scale.d.ts +2 -0
- package/dist/internal/features/work/work-repository.d.ts +4 -0
- package/dist/internal/features/work/work-spreadsheet-agent-context.d.ts +15 -0
- package/dist/internal/features/work/work-spreadsheet-chart-axis.d.ts +42 -0
- package/dist/internal/features/work/work-spreadsheet-chart-layout.d.ts +29 -0
- package/dist/internal/features/work/work-spreadsheet-chart-legend-svg.d.ts +18 -0
- package/dist/internal/features/work/work-spreadsheet-chart-series-layout.d.ts +24 -0
- package/dist/internal/features/work/work-spreadsheet-chart-series-style.d.ts +29 -0
- package/dist/internal/features/work/work-spreadsheet-chart-svg-utils.d.ts +7 -0
- package/dist/internal/features/work/work-spreadsheet-chart-svg.d.ts +3 -0
- package/dist/internal/features/work/work-spreadsheet-chart-types.d.ts +147 -0
- package/dist/internal/features/work/work-spreadsheet-chart-validation.d.ts +2 -0
- package/dist/internal/features/work/work-spreadsheet-charts.d.ts +17 -0
- package/dist/internal/features/work/work-spreadsheet-combination-chart-svg.d.ts +9 -0
- package/dist/internal/features/work/work-spreadsheet-comments.d.ts +7 -0
- package/dist/internal/features/work/work-spreadsheet-conditional-canvas.d.ts +5 -0
- package/dist/internal/features/work/work-spreadsheet-conditional-colors.d.ts +9 -0
- package/dist/internal/features/work/work-spreadsheet-conditional-comparisons.d.ts +4 -0
- package/dist/internal/features/work/work-spreadsheet-conditional-data-bar.d.ts +8 -0
- package/dist/internal/features/work/work-spreadsheet-conditional-format.d.ts +10 -0
- package/dist/internal/features/work/work-spreadsheet-conditional-icons.d.ts +107 -0
- package/dist/internal/features/work/work-spreadsheet-conditional-values.d.ts +19 -0
- package/dist/internal/features/work/work-spreadsheet-data-label-svg.d.ts +27 -0
- package/dist/internal/features/work/work-spreadsheet-error-bar-svg.d.ts +5 -0
- package/dist/internal/features/work/work-spreadsheet-error-bars.d.ts +8 -0
- package/dist/internal/features/work/work-spreadsheet-formula-analysis.d.ts +30 -0
- package/dist/internal/features/work/work-spreadsheet-formula-support.d.ts +1 -0
- package/dist/internal/features/work/work-spreadsheet-formulas.d.ts +19 -0
- package/dist/internal/features/work/work-spreadsheet-header-footer.d.ts +14 -0
- package/dist/internal/features/work/work-spreadsheet-line-chart-svg.d.ts +10 -0
- package/dist/internal/features/work/work-spreadsheet-page-breaks.d.ts +4 -0
- package/dist/internal/features/work/work-spreadsheet-page-setup.d.ts +26 -0
- package/dist/internal/features/work/work-spreadsheet-pivot-engine.d.ts +21 -0
- package/dist/internal/features/work/work-spreadsheet-pivot-values.d.ts +7 -0
- package/dist/internal/features/work/work-spreadsheet-pivots.d.ts +27 -0
- package/dist/internal/features/work/work-spreadsheet-protection.d.ts +55 -0
- package/dist/internal/features/work/work-spreadsheet-ranges.d.ts +25 -0
- package/dist/internal/features/work/work-spreadsheet-trendline-svg.d.ts +9 -0
- package/dist/internal/features/work/work-spreadsheet-trendlines.d.ts +11 -0
- package/dist/internal/features/work/work-spreadsheet-xy-chart-axes-svg.d.ts +10 -0
- package/dist/internal/features/work/work-templates.d.ts +4 -0
- package/dist/internal/features/work/work-types.d.ts +513 -0
- package/dist/internal/features/work/work-xlsx-chart-axes.d.ts +4 -0
- package/dist/internal/features/work/work-xlsx-chart-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-xlsx-chart-layout.d.ts +16 -0
- package/dist/internal/features/work/work-xlsx-chart-series-style.d.ts +6 -0
- package/dist/internal/features/work/work-xlsx-chart-values.d.ts +10 -0
- package/dist/internal/features/work/work-xlsx-charts.d.ts +32 -0
- package/dist/internal/features/work/work-xlsx-conditional-format-diagnostics.d.ts +6 -0
- package/dist/internal/features/work/work-xlsx-conditional-format-write.d.ts +11 -0
- package/dist/internal/features/work/work-xlsx-conditional-format.d.ts +29 -0
- package/dist/internal/features/work/work-xlsx-defined-names.d.ts +4 -0
- package/dist/internal/features/work/work-xlsx-drawing-geometry.d.ts +27 -0
- package/dist/internal/features/work/work-xlsx-formula-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-xlsx-formulas.d.ts +40 -0
- package/dist/internal/features/work/work-xlsx-header-footer.d.ts +12 -0
- package/dist/internal/features/work/work-xlsx-images.d.ts +17 -0
- package/dist/internal/features/work/work-xlsx-interop.d.ts +39 -0
- package/dist/internal/features/work/work-xlsx-page-breaks.d.ts +7 -0
- package/dist/internal/features/work/work-xlsx-page-setup-diagnostics.d.ts +2 -0
- package/dist/internal/features/work/work-xlsx-page-setup.d.ts +5 -0
- package/dist/internal/features/work/work-xlsx-pivot-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-xlsx-pivot-xml.d.ts +9 -0
- package/dist/internal/features/work/work-xlsx-pivots.d.ts +32 -0
- package/dist/internal/features/work/work-xlsx-protection.d.ts +24 -0
- package/dist/internal/features/workspace/components/workspace-context-menu.d.ts +29 -0
- package/dist/internal/features/workspace/components/workspace-text-control-selection.d.ts +7 -0
- package/dist/internal/kernel/office-kernel-client-types.d.ts +40 -0
- package/dist/internal/kernel/office-kernel-client.d.ts +4 -0
- package/dist/internal/kernel/office-kernel-fallback.d.ts +2 -0
- package/dist/internal/kernel/office-kernel-presentation-fallback.d.ts +2 -0
- package/dist/internal/kernel/office-kernel-protocol.d.ts +229 -0
- package/dist/internal/kernel/office-kernel-spreadsheet-fallback-formula.d.ts +3 -0
- package/dist/internal/kernel/office-kernel-spreadsheet-fallback-validation.d.ts +5 -0
- package/dist/internal/kernel/office-kernel-spreadsheet-fallback-value.d.ts +6 -0
- package/dist/internal/kernel/office-kernel-spreadsheet-fallback.d.ts +2 -0
- package/dist/internal/kernel/office-kernel-spreadsheet-protocol.d.ts +112 -0
- package/dist/internal/kernel/office-kernel-spreadsheet-session-fallback.d.ts +8 -0
- package/dist/internal/kernel/office-kernel-text-fallback.d.ts +10 -0
- package/dist/internal/kernel/office-kernel-version.d.ts +1 -0
- package/dist/internal/kernel/office-kernel.worker.d.ts +1 -0
- package/dist/internal/keyboard-shortcuts.d.ts +2 -0
- package/dist/internal/state/app-state.d.ts +8 -0
- package/dist/noto-naskh-arabic-regular.ttf +0 -0
- package/dist/noto-naskh-arabic.LICENSE.txt +94 -0
- package/dist/noto-sans-hans-regular.otf +0 -0
- package/dist/noto-sans-hans.LICENSE.txt +94 -0
- package/dist/noto-sans-hebrew-regular.ttf +0 -0
- package/dist/noto-sans-hebrew.LICENSE.txt +94 -0
- package/dist/noto-sans-regular.ttf +0 -0
- package/dist/noto-sans.LICENSE.txt +94 -0
- package/dist/office-kernel.wasm +0 -0
- package/dist/office-kernel.worker.js +14605 -0
- package/dist/office-surface.d.ts +10 -0
- package/dist/pdfium.LICENSE.txt +196 -0
- package/dist/pdfium.wasm +0 -0
- package/dist/pptxgen.LICENSE.txt +21 -0
- package/dist/pptxgen.bundle.js +11244 -0
- package/dist/react.d.ts +51 -0
- package/dist/react.js +1 -0
- package/dist/styles.css +17435 -0
- package/dist/styles.js +0 -0
- package/dist/vue.d.ts +282 -0
- package/dist/vue.js +231 -0
- package/dist/web-component.d.ts +98 -0
- package/dist/web-component.js +335 -0
- package/docs/browser-editor-architecture.md +947 -0
- package/package.json +165 -0
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
import { workSpreadsheetChartSupportsErrorBars, normalizeWorkSpreadsheetChartAxes, normalizeWorkSpreadsheetErrorBars, normalizeWorkSpreadsheetChartLayout, workSpreadsheetChartSupportsTrendlines, workSpreadsheetChartSupportsSeriesAnalysis, normalizeWorkSpreadsheetChartSeriesStyle, normalizeWorkSpreadsheetTrendline } from "./8715.js";
|
|
2
|
+
import { createOfficeId as createWorkId } from "./1134.js";
|
|
3
|
+
function chartTypeWithAxes(type) {
|
|
4
|
+
return 'pie' === type || 'doughnut' === type ? 'column' : type;
|
|
5
|
+
}
|
|
6
|
+
function semanticPresentationChartAxes(chart) {
|
|
7
|
+
const sourceType = chartTypeWithAxes(chart.type);
|
|
8
|
+
const normalized = normalizeWorkSpreadsheetChartAxes(chart.axes, sourceType, false);
|
|
9
|
+
const categoryPosition = 'bar' === sourceType ? 'left' : 'bottom';
|
|
10
|
+
const valuePosition = 'bar' === sourceType ? 'bottom' : 'left';
|
|
11
|
+
const legacyCategoryTitle = chart.categoryAxisTitle?.trim();
|
|
12
|
+
const legacyValueTitle = chart.valueAxisTitle?.trim();
|
|
13
|
+
const categoryOrX = mergeLegacyTitle(normalized?.[categoryPosition], legacyCategoryTitle);
|
|
14
|
+
const valueOrY = mergeLegacyTitle(normalized?.[valuePosition], legacyValueTitle);
|
|
15
|
+
return {
|
|
16
|
+
categoryOrX,
|
|
17
|
+
valueOrY
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function mergeLegacyTitle(axis, legacyTitle) {
|
|
21
|
+
if (!legacyTitle || axis?.title?.trim() || axis?.titleReference?.trim()) return axis;
|
|
22
|
+
return {
|
|
23
|
+
...axis,
|
|
24
|
+
title: legacyTitle
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function presentationChartAxes(chart) {
|
|
28
|
+
if ('pie' === chart.type || 'doughnut' === chart.type) return;
|
|
29
|
+
return presentationChartAxesForType(chart, chart.type);
|
|
30
|
+
}
|
|
31
|
+
function presentationChartAxesForType(chart, targetType) {
|
|
32
|
+
const { categoryOrX, valueOrY } = semanticPresentationChartAxes(chart);
|
|
33
|
+
if (!categoryOrX && !valueOrY) return;
|
|
34
|
+
const normalizedTargetType = chartTypeWithAxes(targetType);
|
|
35
|
+
const source = 'bar' === normalizedTargetType ? {
|
|
36
|
+
...valueOrY ? {
|
|
37
|
+
bottom: valueOrY
|
|
38
|
+
} : {},
|
|
39
|
+
...categoryOrX ? {
|
|
40
|
+
left: categoryOrX
|
|
41
|
+
} : {}
|
|
42
|
+
} : {
|
|
43
|
+
...categoryOrX ? {
|
|
44
|
+
bottom: categoryOrX
|
|
45
|
+
} : {},
|
|
46
|
+
...valueOrY ? {
|
|
47
|
+
left: valueOrY
|
|
48
|
+
} : {}
|
|
49
|
+
};
|
|
50
|
+
return normalizeWorkSpreadsheetChartAxes(source, normalizedTargetType, false);
|
|
51
|
+
}
|
|
52
|
+
function withPresentationChartAxes(chart, axes) {
|
|
53
|
+
const { axes: _axes, categoryAxisTitle: _categoryAxisTitle, valueAxisTitle: _valueAxisTitle, ...base } = chart;
|
|
54
|
+
const normalized = normalizeWorkSpreadsheetChartAxes(axes, chartTypeWithAxes(chart.type), false);
|
|
55
|
+
return normalized ? {
|
|
56
|
+
...base,
|
|
57
|
+
axes: normalized
|
|
58
|
+
} : base;
|
|
59
|
+
}
|
|
60
|
+
const MAX_CHART_ITEMS = 256;
|
|
61
|
+
const chartNumberFormatter = new Intl.NumberFormat('zh-CN', {
|
|
62
|
+
maximumFractionDigits: 6
|
|
63
|
+
});
|
|
64
|
+
const chartPercentageFormatter = new Intl.NumberFormat('zh-CN', {
|
|
65
|
+
maximumFractionDigits: 1
|
|
66
|
+
});
|
|
67
|
+
function createPresentationChartElement() {
|
|
68
|
+
return {
|
|
69
|
+
id: createWorkId('element'),
|
|
70
|
+
type: 'chart',
|
|
71
|
+
x: 18,
|
|
72
|
+
y: 20,
|
|
73
|
+
width: 64,
|
|
74
|
+
height: 52,
|
|
75
|
+
text: '',
|
|
76
|
+
fontSize: 14,
|
|
77
|
+
color: '#172033',
|
|
78
|
+
fill: '#ffffff',
|
|
79
|
+
bold: false,
|
|
80
|
+
align: 'center',
|
|
81
|
+
borderColor: '#d9dee8',
|
|
82
|
+
borderWidth: 1,
|
|
83
|
+
altText: '季度数据图表',
|
|
84
|
+
chart: {
|
|
85
|
+
type: 'column',
|
|
86
|
+
title: '季度数据',
|
|
87
|
+
categories: [
|
|
88
|
+
'第一季度',
|
|
89
|
+
'第二季度',
|
|
90
|
+
'第三季度'
|
|
91
|
+
],
|
|
92
|
+
series: [
|
|
93
|
+
{
|
|
94
|
+
name: '系列 1',
|
|
95
|
+
values: [
|
|
96
|
+
32,
|
|
97
|
+
48,
|
|
98
|
+
61
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
showLegend: true,
|
|
103
|
+
legendPosition: 'right'
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function presentationChartTypeLabel(type) {
|
|
108
|
+
if ('bar' === type) return '条形图';
|
|
109
|
+
if ('line' === type) return '折线图';
|
|
110
|
+
if ('pie' === type) return '饼图';
|
|
111
|
+
if ('doughnut' === type) return '圆环图';
|
|
112
|
+
if ('area' === type) return '面积图';
|
|
113
|
+
if ('radar' === type) return '雷达图';
|
|
114
|
+
if ('scatter' === type) return '散点图';
|
|
115
|
+
if ('bubble' === type) return '气泡图';
|
|
116
|
+
return '柱形图';
|
|
117
|
+
}
|
|
118
|
+
function withPresentationChartType(chart, type) {
|
|
119
|
+
const { axes, bubbleScale, bubbleSizeRepresents, categoryAxisTitle, dataLabels, doughnutHoleSize, radarStyle, scatterStyle, series, showNegativeBubbles, valueAxisTitle, ...base } = chart;
|
|
120
|
+
const nextAxes = presentationChartAxesForType({
|
|
121
|
+
...chart,
|
|
122
|
+
axes,
|
|
123
|
+
categoryAxisTitle,
|
|
124
|
+
valueAxisTitle
|
|
125
|
+
}, type);
|
|
126
|
+
const nextDataLabels = dataLabels ? normalizePresentationChartDataLabels(dataLabels, type) : void 0;
|
|
127
|
+
if (nextDataLabels && !presentationChartDataLabelsHaveContent(nextDataLabels)) nextDataLabels.showValue = true;
|
|
128
|
+
const nextCategories = presentationChartUsesNumericXAxis(type) && !presentationChartUsesNumericXAxis(chart.type) ? chart.categories.map((_, index)=>String(index + 1)) : chart.categories;
|
|
129
|
+
const nextSeries = series.map(({ bubbleSizes, errorBars, trendlines, ...current })=>({
|
|
130
|
+
...current,
|
|
131
|
+
...'bubble' === type ? {
|
|
132
|
+
bubbleSizes: bubbleSizes?.map(finitePresentationChartNumber) ?? current.values.map(()=>1)
|
|
133
|
+
} : {},
|
|
134
|
+
...workSpreadsheetChartSupportsErrorBars(type) && errorBars?.length ? {
|
|
135
|
+
errorBars: normalizePresentationChartErrorBars(errorBars, type)
|
|
136
|
+
} : {},
|
|
137
|
+
...workSpreadsheetChartSupportsTrendlines(type) && trendlines?.length ? {
|
|
138
|
+
trendlines: trendlines.map(normalizeWorkSpreadsheetTrendline)
|
|
139
|
+
} : {}
|
|
140
|
+
}));
|
|
141
|
+
return withPresentationChartLayout({
|
|
142
|
+
...base,
|
|
143
|
+
categories: nextCategories,
|
|
144
|
+
series: nextSeries,
|
|
145
|
+
type,
|
|
146
|
+
...nextAxes ? {
|
|
147
|
+
axes: nextAxes
|
|
148
|
+
} : {},
|
|
149
|
+
...nextDataLabels ? {
|
|
150
|
+
dataLabels: nextDataLabels
|
|
151
|
+
} : {},
|
|
152
|
+
...'doughnut' === type ? {
|
|
153
|
+
doughnutHoleSize: normalizeDoughnutHoleSize(doughnutHoleSize)
|
|
154
|
+
} : {},
|
|
155
|
+
...'radar' === type ? {
|
|
156
|
+
radarStyle: normalizeRadarStyle(radarStyle)
|
|
157
|
+
} : {},
|
|
158
|
+
...'scatter' === type ? {
|
|
159
|
+
scatterStyle: normalizePresentationScatterStyle(scatterStyle)
|
|
160
|
+
} : {},
|
|
161
|
+
...'bubble' === type ? {
|
|
162
|
+
bubbleScale: normalizePresentationBubbleScale(bubbleScale),
|
|
163
|
+
showNegativeBubbles: true === showNegativeBubbles,
|
|
164
|
+
bubbleSizeRepresents: normalizePresentationBubbleSizeRepresents(bubbleSizeRepresents)
|
|
165
|
+
} : {}
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function withPresentationChartLayout(chart, change = {}) {
|
|
169
|
+
const source = {
|
|
170
|
+
...chart,
|
|
171
|
+
...change
|
|
172
|
+
};
|
|
173
|
+
const normalized = normalizeWorkSpreadsheetChartLayout(source);
|
|
174
|
+
const supportsAnalysis = workSpreadsheetChartSupportsSeriesAnalysis({
|
|
175
|
+
...source,
|
|
176
|
+
...normalized
|
|
177
|
+
});
|
|
178
|
+
const { gapWidth: _gapWidth, grouping: _grouping, legendOverlay: _legendOverlay, legendPosition: _legendPosition, overlap: _overlap, series: _series, smoothLines: _smoothLines, ...base } = source;
|
|
179
|
+
const series = source.series.map((item)=>{
|
|
180
|
+
const { errorBars, style, trendlines, ...seriesBase } = item;
|
|
181
|
+
const normalizedStyle = normalizePresentationChartSeriesStyle(style, source.type);
|
|
182
|
+
return {
|
|
183
|
+
...seriesBase,
|
|
184
|
+
...normalizedStyle ? {
|
|
185
|
+
style: normalizedStyle
|
|
186
|
+
} : {},
|
|
187
|
+
...supportsAnalysis && workSpreadsheetChartSupportsErrorBars(source.type) && errorBars?.length ? {
|
|
188
|
+
errorBars: normalizePresentationChartErrorBars(errorBars, source.type)
|
|
189
|
+
} : {},
|
|
190
|
+
...supportsAnalysis && workSpreadsheetChartSupportsTrendlines(source.type) && trendlines?.length ? {
|
|
191
|
+
trendlines: trendlines.map(normalizeWorkSpreadsheetTrendline)
|
|
192
|
+
} : {}
|
|
193
|
+
};
|
|
194
|
+
});
|
|
195
|
+
return {
|
|
196
|
+
...base,
|
|
197
|
+
series,
|
|
198
|
+
...void 0 !== source.legendPosition ? {
|
|
199
|
+
legendPosition: normalized.legendPosition
|
|
200
|
+
} : {},
|
|
201
|
+
...void 0 !== source.legendOverlay ? {
|
|
202
|
+
legendOverlay: normalized.legendOverlay
|
|
203
|
+
} : {},
|
|
204
|
+
...void 0 !== normalized.grouping && void 0 !== source.grouping ? {
|
|
205
|
+
grouping: normalized.grouping
|
|
206
|
+
} : {},
|
|
207
|
+
...void 0 !== normalized.gapWidth && void 0 !== source.gapWidth ? {
|
|
208
|
+
gapWidth: normalized.gapWidth
|
|
209
|
+
} : {},
|
|
210
|
+
...void 0 !== normalized.overlap && void 0 !== source.overlap ? {
|
|
211
|
+
overlap: normalized.overlap
|
|
212
|
+
} : {},
|
|
213
|
+
...void 0 !== normalized.smoothLines && void 0 !== source.smoothLines ? {
|
|
214
|
+
smoothLines: normalized.smoothLines
|
|
215
|
+
} : {}
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
function normalizePresentationChartSeriesStyle(style, type) {
|
|
219
|
+
const normalized = normalizeWorkSpreadsheetChartSeriesStyle(style);
|
|
220
|
+
if (!normalized) return;
|
|
221
|
+
if (presentationChartSupportsSeriesMarkers(type)) return normalized;
|
|
222
|
+
const { marker: _marker, ...withoutMarker } = normalized;
|
|
223
|
+
return Object.keys(withoutMarker).length ? withoutMarker : void 0;
|
|
224
|
+
}
|
|
225
|
+
function withPresentationChartSeriesStyle(chart, seriesIndex, style) {
|
|
226
|
+
return withPresentationChartLayout({
|
|
227
|
+
...chart,
|
|
228
|
+
series: chart.series.map((series, index)=>index === seriesIndex ? {
|
|
229
|
+
...series,
|
|
230
|
+
style: normalizePresentationChartSeriesStyle(style, chart.type)
|
|
231
|
+
} : series)
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
function presentationChartSupportsSeriesMarkers(type) {
|
|
235
|
+
return 'line' === type || 'radar' === type || 'scatter' === type;
|
|
236
|
+
}
|
|
237
|
+
function parsePresentationChartCategories(value) {
|
|
238
|
+
return value.split(/\r?\n/).map((item)=>item.trim().slice(0, 255)).filter(Boolean).slice(0, MAX_CHART_ITEMS);
|
|
239
|
+
}
|
|
240
|
+
function parsePresentationChartValueDraft(value) {
|
|
241
|
+
const items = value.split(/[\s,;,;]+/).map((item)=>item.trim()).filter(Boolean).slice(0, MAX_CHART_ITEMS);
|
|
242
|
+
const values = items.map(Number);
|
|
243
|
+
return values.every(Number.isFinite) ? values : null;
|
|
244
|
+
}
|
|
245
|
+
function createPresentationChartSeries(chart) {
|
|
246
|
+
const values = Array.from({
|
|
247
|
+
length: Math.max(1, chart.categories.length)
|
|
248
|
+
}, ()=>0);
|
|
249
|
+
return {
|
|
250
|
+
name: `系列 ${chart.series.length + 1}`,
|
|
251
|
+
values,
|
|
252
|
+
...'bubble' === chart.type ? {
|
|
253
|
+
bubbleSizes: values.map(()=>1)
|
|
254
|
+
} : {}
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
function withPresentationChartSeriesAnalysis(chart, seriesIndex, analysis) {
|
|
258
|
+
return withPresentationChartLayout({
|
|
259
|
+
...chart,
|
|
260
|
+
series: chart.series.map((series, index)=>{
|
|
261
|
+
if (index !== seriesIndex) return series;
|
|
262
|
+
const { errorBars: _errorBars, trendlines: _trendlines, ...base } = series;
|
|
263
|
+
const errorBars = workSpreadsheetChartSupportsErrorBars(chart.type) ? normalizePresentationChartErrorBars(analysis.errorBars ?? [], chart.type) : void 0;
|
|
264
|
+
const trendlines = workSpreadsheetChartSupportsTrendlines(chart.type) ? analysis.trendlines?.map(normalizeWorkSpreadsheetTrendline) : void 0;
|
|
265
|
+
return {
|
|
266
|
+
...base,
|
|
267
|
+
...errorBars?.length ? {
|
|
268
|
+
errorBars
|
|
269
|
+
} : {},
|
|
270
|
+
...trendlines?.length ? {
|
|
271
|
+
trendlines
|
|
272
|
+
} : {}
|
|
273
|
+
};
|
|
274
|
+
})
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
function presentationChartTrendlineCount(chart) {
|
|
278
|
+
if (!workSpreadsheetChartSupportsSeriesAnalysis(chart) || !workSpreadsheetChartSupportsTrendlines(chart.type)) return 0;
|
|
279
|
+
return chart.series.reduce((count, series)=>count + (series.trendlines?.length ?? 0), 0);
|
|
280
|
+
}
|
|
281
|
+
function presentationChartErrorBarCount(chart) {
|
|
282
|
+
if (!workSpreadsheetChartSupportsSeriesAnalysis(chart) || !workSpreadsheetChartSupportsErrorBars(chart.type)) return 0;
|
|
283
|
+
return chart.series.reduce((count, series)=>count + (series.errorBars?.length ?? 0), 0);
|
|
284
|
+
}
|
|
285
|
+
function normalizePresentationChartErrorBars(sources, type) {
|
|
286
|
+
const directions = new Set();
|
|
287
|
+
return sources.flatMap((source)=>{
|
|
288
|
+
const errorBars = normalizeWorkSpreadsheetErrorBars(source, type);
|
|
289
|
+
if (directions.has(errorBars.direction)) return [];
|
|
290
|
+
directions.add(errorBars.direction);
|
|
291
|
+
return [
|
|
292
|
+
errorBars
|
|
293
|
+
];
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
function normalizeDoughnutHoleSize(value) {
|
|
297
|
+
const number = Number(value);
|
|
298
|
+
return Number.isFinite(number) ? Math.min(90, Math.max(10, Math.round(number))) : 50;
|
|
299
|
+
}
|
|
300
|
+
function normalizeRadarStyle(value) {
|
|
301
|
+
return 'marker' === value || 'filled' === value ? value : 'standard';
|
|
302
|
+
}
|
|
303
|
+
function normalizePresentationScatterStyle(value) {
|
|
304
|
+
return 'marker' === value || 'line' === value || 'smooth' === value || 'smoothMarker' === value || 'lineMarker' === value ? value : 'lineMarker';
|
|
305
|
+
}
|
|
306
|
+
function normalizePresentationBubbleScale(value) {
|
|
307
|
+
const number = Number(value);
|
|
308
|
+
return Number.isFinite(number) ? Math.min(300, Math.max(5, Math.round(number))) : 100;
|
|
309
|
+
}
|
|
310
|
+
function normalizePresentationBubbleSizeRepresents(value) {
|
|
311
|
+
return 'width' === value ? 'width' : 'area';
|
|
312
|
+
}
|
|
313
|
+
function presentationChartUsesNumericXAxis(type) {
|
|
314
|
+
return 'scatter' === type || 'bubble' === type;
|
|
315
|
+
}
|
|
316
|
+
function presentationChartXValues(chart) {
|
|
317
|
+
const length = Math.max(chart.categories.length, ...chart.series.map((series)=>series.values.length));
|
|
318
|
+
return Array.from({
|
|
319
|
+
length
|
|
320
|
+
}, (_, index)=>{
|
|
321
|
+
const value = Number(chart.categories[index]);
|
|
322
|
+
return Number.isFinite(value) ? value : index + 1;
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
function presentationChartBubbleSizes(series) {
|
|
326
|
+
return series.values.map((_, index)=>finitePresentationChartNumber(series.bubbleSizes?.[index] ?? 1));
|
|
327
|
+
}
|
|
328
|
+
function normalizePresentationChartLegendPosition(value) {
|
|
329
|
+
return 'left' === value || 'top' === value || 'bottom' === value || 'topRight' === value || 'right' === value ? value : 'right';
|
|
330
|
+
}
|
|
331
|
+
function presentationChartLegendPositionLabel(position) {
|
|
332
|
+
if ('left' === position) return '左侧';
|
|
333
|
+
if ('top' === position) return '顶部';
|
|
334
|
+
if ('bottom' === position) return '底部';
|
|
335
|
+
if ('topRight' === position) return '右上角';
|
|
336
|
+
return '右侧';
|
|
337
|
+
}
|
|
338
|
+
function presentationChartShowsLegend(chart) {
|
|
339
|
+
return chart.showLegend ?? chart.series.length > 1;
|
|
340
|
+
}
|
|
341
|
+
function presentationChartSupportsAxisTitles(chart) {
|
|
342
|
+
return 'pie' !== chart.type && 'doughnut' !== chart.type;
|
|
343
|
+
}
|
|
344
|
+
function presentationChartDataLabelPositions(type) {
|
|
345
|
+
if ('pie' === type || 'doughnut' === type) return [
|
|
346
|
+
'bestFit',
|
|
347
|
+
'center',
|
|
348
|
+
'insideEnd',
|
|
349
|
+
'outsideEnd'
|
|
350
|
+
];
|
|
351
|
+
if ('line' === type || 'radar' === type || 'scatter' === type || 'bubble' === type) return [
|
|
352
|
+
'above',
|
|
353
|
+
'below',
|
|
354
|
+
'left',
|
|
355
|
+
'right',
|
|
356
|
+
'center'
|
|
357
|
+
];
|
|
358
|
+
return [
|
|
359
|
+
'outsideEnd',
|
|
360
|
+
'insideEnd',
|
|
361
|
+
'insideBase',
|
|
362
|
+
'center'
|
|
363
|
+
];
|
|
364
|
+
}
|
|
365
|
+
function normalizePresentationChartDataLabelPosition(value, type) {
|
|
366
|
+
const positions = presentationChartDataLabelPositions(type);
|
|
367
|
+
if ('string' == typeof value && positions.includes(value)) return value;
|
|
368
|
+
if ('pie' === type || 'doughnut' === type) return 'bestFit';
|
|
369
|
+
if ('line' === type || 'radar' === type || 'scatter' === type || 'bubble' === type) return 'above';
|
|
370
|
+
return 'outsideEnd';
|
|
371
|
+
}
|
|
372
|
+
function normalizePresentationChartDataLabels(source, type) {
|
|
373
|
+
const separator = 'string' == typeof source.separator ? source.separator.slice(0, 64) : void 0;
|
|
374
|
+
return {
|
|
375
|
+
...true === source.showValue ? {
|
|
376
|
+
showValue: true
|
|
377
|
+
} : {},
|
|
378
|
+
...true === source.showCategoryName ? {
|
|
379
|
+
showCategoryName: true
|
|
380
|
+
} : {},
|
|
381
|
+
...true === source.showSeriesName ? {
|
|
382
|
+
showSeriesName: true
|
|
383
|
+
} : {},
|
|
384
|
+
...true === source.showPercentage && ('pie' === type || 'doughnut' === type) ? {
|
|
385
|
+
showPercentage: true
|
|
386
|
+
} : {},
|
|
387
|
+
...true === source.showBubbleSize && 'bubble' === type ? {
|
|
388
|
+
showBubbleSize: true
|
|
389
|
+
} : {},
|
|
390
|
+
...void 0 !== separator ? {
|
|
391
|
+
separator
|
|
392
|
+
} : {},
|
|
393
|
+
position: normalizePresentationChartDataLabelPosition(source.position, type)
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
function withPresentationChartDataLabels(chart, dataLabels) {
|
|
397
|
+
const { dataLabels: _current, ...base } = chart;
|
|
398
|
+
return dataLabels ? {
|
|
399
|
+
...base,
|
|
400
|
+
dataLabels: normalizePresentationChartDataLabels(dataLabels, chart.type)
|
|
401
|
+
} : base;
|
|
402
|
+
}
|
|
403
|
+
function presentationChartHasDataLabels(chart) {
|
|
404
|
+
return void 0 !== chart.dataLabels;
|
|
405
|
+
}
|
|
406
|
+
function presentationChartDataLabelPositionLabel(position) {
|
|
407
|
+
if ('center' === position) return '居中';
|
|
408
|
+
if ('insideBase' === position) return '内侧基部';
|
|
409
|
+
if ('insideEnd' === position) return '内侧末端';
|
|
410
|
+
if ('outsideEnd' === position) return '外侧末端';
|
|
411
|
+
if ('left' === position) return '左侧';
|
|
412
|
+
if ('right' === position) return '右侧';
|
|
413
|
+
if ('above' === position) return '上方';
|
|
414
|
+
if ('below' === position) return '下方';
|
|
415
|
+
return '最佳匹配';
|
|
416
|
+
}
|
|
417
|
+
function presentationChartDataLabelText(chart, seriesIndex, pointIndex) {
|
|
418
|
+
const series = chart.series[seriesIndex];
|
|
419
|
+
if (!series || !chart.dataLabels) return '';
|
|
420
|
+
const labels = normalizePresentationChartDataLabels(chart.dataLabels, chart.type);
|
|
421
|
+
const parts = [];
|
|
422
|
+
if (labels.showSeriesName) parts.push(series.name.trim() || `系列 ${seriesIndex + 1}`);
|
|
423
|
+
if (labels.showCategoryName) parts.push(chart.categories[pointIndex]?.trim() || `分类 ${pointIndex + 1}`);
|
|
424
|
+
if (labels.showValue) parts.push(formatPresentationChartNumber(series.values[pointIndex]));
|
|
425
|
+
if (labels.showPercentage) {
|
|
426
|
+
const values = series.values.map((value)=>Math.max(0, finitePresentationChartNumber(value)));
|
|
427
|
+
const total = values.reduce((sum, value)=>sum + value, 0);
|
|
428
|
+
if (total > 0) parts.push(`${chartPercentageFormatter.format(values[pointIndex] / total * 100)}%`);
|
|
429
|
+
}
|
|
430
|
+
if (labels.showBubbleSize) parts.push(formatPresentationChartNumber(series.bubbleSizes?.[pointIndex]));
|
|
431
|
+
return parts.join(labels.separator ?? ', ');
|
|
432
|
+
}
|
|
433
|
+
function presentationChartDataLabelsHaveContent(labels) {
|
|
434
|
+
return Boolean(labels.showValue || labels.showCategoryName || labels.showSeriesName || labels.showPercentage || labels.showBubbleSize);
|
|
435
|
+
}
|
|
436
|
+
function formatPresentationChartNumber(value) {
|
|
437
|
+
return chartNumberFormatter.format(finitePresentationChartNumber(value));
|
|
438
|
+
}
|
|
439
|
+
function finitePresentationChartNumber(value) {
|
|
440
|
+
return Number.isFinite(value) ? Number(value) : 0;
|
|
441
|
+
}
|
|
442
|
+
export { createPresentationChartElement, createPresentationChartSeries, normalizeDoughnutHoleSize, normalizePresentationBubbleScale, normalizePresentationBubbleSizeRepresents, normalizePresentationChartDataLabelPosition, normalizePresentationChartDataLabels, normalizePresentationChartLegendPosition, normalizePresentationChartSeriesStyle, normalizePresentationScatterStyle, normalizeRadarStyle, parsePresentationChartCategories, parsePresentationChartValueDraft, presentationChartAxes, presentationChartBubbleSizes, presentationChartDataLabelPositionLabel, presentationChartDataLabelPositions, presentationChartDataLabelText, presentationChartErrorBarCount, presentationChartHasDataLabels, presentationChartLegendPositionLabel, presentationChartShowsLegend, presentationChartSupportsAxisTitles, presentationChartSupportsSeriesMarkers, presentationChartTrendlineCount, presentationChartTypeLabel, presentationChartUsesNumericXAxis, presentationChartXValues, withPresentationChartAxes, withPresentationChartDataLabels, withPresentationChartLayout, withPresentationChartSeriesAnalysis, withPresentationChartSeriesStyle, withPresentationChartType };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const CARDINAL_DIRECTIONS = new Set([
|
|
2
|
+
'left',
|
|
3
|
+
'right',
|
|
4
|
+
'up',
|
|
5
|
+
'down'
|
|
6
|
+
]);
|
|
7
|
+
const SPLIT_DIRECTIONS = new Set([
|
|
8
|
+
'in',
|
|
9
|
+
'out'
|
|
10
|
+
]);
|
|
11
|
+
function createWorkSlideTransition(type, previous) {
|
|
12
|
+
const common = {
|
|
13
|
+
type,
|
|
14
|
+
speed: previous?.speed ?? 'medium',
|
|
15
|
+
advanceOnClick: previous?.advanceOnClick ?? true,
|
|
16
|
+
advanceAfterMs: previous?.advanceAfterMs
|
|
17
|
+
};
|
|
18
|
+
if ('push' === type || 'wipe' === type) return {
|
|
19
|
+
...common,
|
|
20
|
+
direction: previous?.direction && CARDINAL_DIRECTIONS.has(previous.direction) ? previous.direction : 'left'
|
|
21
|
+
};
|
|
22
|
+
if ('split' === type) return {
|
|
23
|
+
...common,
|
|
24
|
+
direction: previous?.direction && SPLIT_DIRECTIONS.has(previous.direction) ? previous.direction : 'out',
|
|
25
|
+
orientation: previous?.orientation ?? 'horizontal'
|
|
26
|
+
};
|
|
27
|
+
return common;
|
|
28
|
+
}
|
|
29
|
+
function slideTransitionDurationMilliseconds(transition) {
|
|
30
|
+
if (transition?.speed === 'fast') return 500;
|
|
31
|
+
if (transition?.speed === 'slow') return 2000;
|
|
32
|
+
return 1000;
|
|
33
|
+
}
|
|
34
|
+
function workSlideTransitionsEqual(left, right) {
|
|
35
|
+
if (!left || !right) return left === right;
|
|
36
|
+
return left.type === right.type && left.speed === right.speed && left.direction === right.direction && left.orientation === right.orientation && left.advanceOnClick === right.advanceOnClick && left.advanceAfterMs === right.advanceAfterMs;
|
|
37
|
+
}
|
|
38
|
+
export { createWorkSlideTransition, slideTransitionDurationMilliseconds, workSlideTransitionsEqual };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
function scaledPresentationVisuals(element, scale) {
|
|
2
|
+
const fontSize = presentationElementScalesTypography(element) ? scaledPresentationFontSize(element.fontSize, scale) : element.fontSize;
|
|
3
|
+
const borderWidth = void 0 === element.borderWidth ? void 0 : scaledPresentationBorderWidth(element.borderWidth, scale);
|
|
4
|
+
const textRuns = scaledPresentationTextRuns(element, scale);
|
|
5
|
+
return {
|
|
6
|
+
fontSize,
|
|
7
|
+
...void 0 !== borderWidth ? {
|
|
8
|
+
borderWidth
|
|
9
|
+
} : {},
|
|
10
|
+
...textRuns !== element.textRuns ? {
|
|
11
|
+
textRuns
|
|
12
|
+
} : {}
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function presentationElementScalesTypography(element) {
|
|
16
|
+
return 'text' === element.type || 'shape' === element.type || 'table' === element.type || Boolean(element.text || element.textRuns?.length);
|
|
17
|
+
}
|
|
18
|
+
function scaledPresentationTextRuns(element, scale) {
|
|
19
|
+
if (!element.textRuns?.some((run)=>void 0 !== run.fontSize)) return element.textRuns;
|
|
20
|
+
return element.textRuns.map((run)=>void 0 === run.fontSize ? run : {
|
|
21
|
+
...run,
|
|
22
|
+
fontSize: scaledPresentationFontSize(run.fontSize, scale)
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function scaledPresentationFontSize(value, scale) {
|
|
26
|
+
return roundedPresentationMetric(clamp(value * scale, 1, 400));
|
|
27
|
+
}
|
|
28
|
+
function scaledPresentationBorderWidth(value, scale) {
|
|
29
|
+
if (0 === value) return 0;
|
|
30
|
+
return roundedPresentationMetric(Math.max(0.1, value * scale));
|
|
31
|
+
}
|
|
32
|
+
function roundedPresentationMetric(value) {
|
|
33
|
+
return Math.round(1000 * value) / 1000;
|
|
34
|
+
}
|
|
35
|
+
function clamp(value, minimum, maximum) {
|
|
36
|
+
return Math.min(maximum, Math.max(minimum, value));
|
|
37
|
+
}
|
|
38
|
+
export { scaledPresentationVisuals };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { locale } from "@fortune-sheet/core";
|
|
2
|
+
import { spreadsheetFormulaFunctions } from "./8715.js";
|
|
3
|
+
const FORTUNE_SUPPORTED_FUNCTIONS = new Set(locale({
|
|
4
|
+
lang: 'en'
|
|
5
|
+
}).functionlist.map((item)=>item.n.toUpperCase()));
|
|
6
|
+
function unsupportedSpreadsheetFormulaFunctions(formula) {
|
|
7
|
+
return spreadsheetFormulaFunctions(formula).filter((name)=>!FORTUNE_SUPPORTED_FUNCTIONS.has(name));
|
|
8
|
+
}
|
|
9
|
+
export { unsupportedSpreadsheetFormulaFunctions };
|