@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
package/dist/0~1403.js
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { createOfficeId as createWorkId } from "./1134.js";
|
|
2
|
+
function expandPresentationGroupSelection(elements, selectedIds) {
|
|
3
|
+
const byId = new Map();
|
|
4
|
+
const membersByGroupId = new Map();
|
|
5
|
+
for (const element of elements){
|
|
6
|
+
byId.set(element.id, element);
|
|
7
|
+
const groupId = topPresentationGroupId(element);
|
|
8
|
+
if (!groupId) continue;
|
|
9
|
+
const members = membersByGroupId.get(groupId) ?? [];
|
|
10
|
+
members.push(element);
|
|
11
|
+
membersByGroupId.set(groupId, members);
|
|
12
|
+
}
|
|
13
|
+
const requested = new Set(selectedIds);
|
|
14
|
+
const result = [];
|
|
15
|
+
const seen = new Set();
|
|
16
|
+
for (const selectedId of selectedIds){
|
|
17
|
+
const selected = byId.get(selectedId);
|
|
18
|
+
if (!selected) continue;
|
|
19
|
+
const groupId = topPresentationGroupId(selected);
|
|
20
|
+
const members = groupId ? membersByGroupId.get(groupId) ?? [
|
|
21
|
+
selected
|
|
22
|
+
] : [
|
|
23
|
+
selected
|
|
24
|
+
];
|
|
25
|
+
if (!members.every((member)=>requested.has(member.id))) {
|
|
26
|
+
for (const member of members)if (!(member.id === selectedId || seen.has(member.id))) {
|
|
27
|
+
seen.add(member.id);
|
|
28
|
+
result.push(member.id);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (!seen.has(selectedId)) {
|
|
32
|
+
seen.add(selectedId);
|
|
33
|
+
result.push(selectedId);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
function presentationSelectionUnits(elements, selectedIds) {
|
|
39
|
+
const expanded = new Set(expandPresentationGroupSelection(elements, selectedIds));
|
|
40
|
+
const units = new Map();
|
|
41
|
+
for (const element of elements){
|
|
42
|
+
if (!expanded.has(element.id)) continue;
|
|
43
|
+
const groupId = topPresentationGroupId(element);
|
|
44
|
+
const key = groupId ? `group:${groupId}` : `element:${element.id}`;
|
|
45
|
+
const unit = units.get(key) ?? {
|
|
46
|
+
key,
|
|
47
|
+
groupId,
|
|
48
|
+
elements: [],
|
|
49
|
+
elementIds: []
|
|
50
|
+
};
|
|
51
|
+
unit.elements.push(element);
|
|
52
|
+
unit.elementIds.push(element.id);
|
|
53
|
+
units.set(key, unit);
|
|
54
|
+
}
|
|
55
|
+
return [
|
|
56
|
+
...units.values()
|
|
57
|
+
];
|
|
58
|
+
}
|
|
59
|
+
function presentationSelectionUnitCount(elements, selectedIds) {
|
|
60
|
+
return presentationSelectionUnits(elements, selectedIds).length;
|
|
61
|
+
}
|
|
62
|
+
function canGroupPresentationElements(elements, selectedIds) {
|
|
63
|
+
return presentationSelectionUnitCount(elements, selectedIds) >= 2;
|
|
64
|
+
}
|
|
65
|
+
function canUngroupPresentationElements(elements, selectedIds) {
|
|
66
|
+
const selected = new Set(expandPresentationGroupSelection(elements, selectedIds));
|
|
67
|
+
return elements.some((element)=>selected.has(element.id) && presentationGroupPath(element).length > 0);
|
|
68
|
+
}
|
|
69
|
+
function groupPresentationElements(elements, selectedIds, groupId) {
|
|
70
|
+
const normalizedGroupId = groupId.trim();
|
|
71
|
+
if (!normalizedGroupId || !canGroupPresentationElements(elements, selectedIds)) return [
|
|
72
|
+
...elements
|
|
73
|
+
];
|
|
74
|
+
const selected = new Set(expandPresentationGroupSelection(elements, selectedIds));
|
|
75
|
+
return elements.map((element)=>selected.has(element.id) ? {
|
|
76
|
+
...element,
|
|
77
|
+
groupIds: [
|
|
78
|
+
normalizedGroupId,
|
|
79
|
+
...presentationGroupPath(element)
|
|
80
|
+
]
|
|
81
|
+
} : element);
|
|
82
|
+
}
|
|
83
|
+
function ungroupPresentationElements(elements, selectedIds) {
|
|
84
|
+
const selected = new Set(expandPresentationGroupSelection(elements, selectedIds));
|
|
85
|
+
const selectedGroups = new Set(elements.filter((element)=>selected.has(element.id)).map(topPresentationGroupId).filter((groupId)=>Boolean(groupId)));
|
|
86
|
+
if (!selectedGroups.size) return [
|
|
87
|
+
...elements
|
|
88
|
+
];
|
|
89
|
+
return elements.map((element)=>{
|
|
90
|
+
const path = presentationGroupPath(element);
|
|
91
|
+
if (!path.length || !selectedGroups.has(path[0])) return element;
|
|
92
|
+
const remaining = path.slice(1);
|
|
93
|
+
return {
|
|
94
|
+
...element,
|
|
95
|
+
groupIds: remaining.length ? remaining : void 0
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function remapPresentationGroupPaths(elements) {
|
|
100
|
+
const replacements = new Map();
|
|
101
|
+
return elements.map((element)=>{
|
|
102
|
+
const path = presentationGroupPath(element);
|
|
103
|
+
if (!path.length) return element;
|
|
104
|
+
return {
|
|
105
|
+
...element,
|
|
106
|
+
groupIds: path.map((groupId)=>{
|
|
107
|
+
const replacement = replacements.get(groupId) ?? createWorkId('element-group');
|
|
108
|
+
replacements.set(groupId, replacement);
|
|
109
|
+
return replacement;
|
|
110
|
+
})
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function topPresentationGroupId(element) {
|
|
115
|
+
return presentationGroupPath(element)[0];
|
|
116
|
+
}
|
|
117
|
+
function presentationGroupPath(element) {
|
|
118
|
+
const seen = new Set();
|
|
119
|
+
return (element.groupIds ?? []).map((groupId)=>groupId.trim()).filter((normalized)=>{
|
|
120
|
+
if (!normalized || seen.has(normalized)) return false;
|
|
121
|
+
seen.add(normalized);
|
|
122
|
+
return true;
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
const DEFAULT_PRESENTATION_MASTER_ID = 'presentation-master-default';
|
|
126
|
+
const DEFAULT_PRESENTATION_LAYOUT_ID = 'presentation-layout-default';
|
|
127
|
+
function withPresentationDesign(content) {
|
|
128
|
+
const masters = content.masters?.length ? content.masters : [
|
|
129
|
+
{
|
|
130
|
+
id: DEFAULT_PRESENTATION_MASTER_ID,
|
|
131
|
+
name: 'Default master',
|
|
132
|
+
background: '#ffffff',
|
|
133
|
+
elements: []
|
|
134
|
+
}
|
|
135
|
+
];
|
|
136
|
+
const masterIds = new Set(masters.map((master)=>master.id));
|
|
137
|
+
const firstMasterId = masters[0].id;
|
|
138
|
+
const layouts = content.layouts?.length ? content.layouts.map((layout)=>({
|
|
139
|
+
...layout,
|
|
140
|
+
masterId: masterIds.has(layout.masterId) ? layout.masterId : firstMasterId
|
|
141
|
+
})) : [
|
|
142
|
+
{
|
|
143
|
+
id: DEFAULT_PRESENTATION_LAYOUT_ID,
|
|
144
|
+
name: 'Blank',
|
|
145
|
+
masterId: firstMasterId,
|
|
146
|
+
elements: []
|
|
147
|
+
}
|
|
148
|
+
];
|
|
149
|
+
const layoutIds = new Set(layouts.map((layout)=>layout.id));
|
|
150
|
+
const firstLayoutId = layouts[0].id;
|
|
151
|
+
return {
|
|
152
|
+
...content,
|
|
153
|
+
masters,
|
|
154
|
+
layouts,
|
|
155
|
+
slides: content.slides.map((slide)=>({
|
|
156
|
+
...slide,
|
|
157
|
+
layoutId: slide.layoutId && layoutIds.has(slide.layoutId) ? slide.layoutId : firstLayoutId,
|
|
158
|
+
useLayoutBackground: slide.useLayoutBackground ?? false
|
|
159
|
+
}))
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function presentationSlideView(content, slide) {
|
|
163
|
+
const normalized = withPresentationDesign(content);
|
|
164
|
+
const layout = normalized.layouts?.find((candidate)=>candidate.id === slide.layoutId) ?? normalized.layouts?.[0];
|
|
165
|
+
const master = normalized.masters?.find((candidate)=>candidate.id === layout?.masterId) ?? normalized.masters?.[0];
|
|
166
|
+
const showMasterElements = false !== slide.showMasterElements && layout?.showMasterElements !== false;
|
|
167
|
+
const masterElements = showMasterElements ? master?.elements ?? [] : [];
|
|
168
|
+
const layoutElements = layout?.elements ?? [];
|
|
169
|
+
const placeholderElements = mergedPlaceholders(masterElements, layoutElements);
|
|
170
|
+
return {
|
|
171
|
+
background: true === slide.useLayoutBackground ? layout?.background ?? master?.background ?? slide.background : slide.background,
|
|
172
|
+
inheritedElements: [
|
|
173
|
+
...masterElements,
|
|
174
|
+
...layoutElements
|
|
175
|
+
].filter((element)=>!element.placeholder),
|
|
176
|
+
placeholderElements,
|
|
177
|
+
master,
|
|
178
|
+
layout
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
function applyPresentationLayout(content, slideId, layoutId) {
|
|
182
|
+
const normalized = withPresentationDesign(content);
|
|
183
|
+
const layout = normalized.layouts?.find((candidate)=>candidate.id === layoutId);
|
|
184
|
+
if (!layout) return normalized;
|
|
185
|
+
const definitions = layout.elements.filter((element)=>Boolean(element.placeholder));
|
|
186
|
+
return {
|
|
187
|
+
...normalized,
|
|
188
|
+
slides: normalized.slides.map((slide)=>{
|
|
189
|
+
if (slide.id !== slideId) return slide;
|
|
190
|
+
const matched = new Set();
|
|
191
|
+
const elements = slide.elements.map((element)=>{
|
|
192
|
+
const key = element.placeholder?.key;
|
|
193
|
+
if (!key) return element;
|
|
194
|
+
const definition = definitions.find((candidate)=>candidate.placeholder.key === key);
|
|
195
|
+
if (!definition) return {
|
|
196
|
+
...element,
|
|
197
|
+
placeholder: void 0
|
|
198
|
+
};
|
|
199
|
+
matched.add(key);
|
|
200
|
+
return applyPlaceholderDefinition(element, definition);
|
|
201
|
+
});
|
|
202
|
+
for (const definition of definitions)if (!matched.has(definition.placeholder.key)) elements.push({
|
|
203
|
+
...structuredCopy(definition),
|
|
204
|
+
id: createWorkId('element'),
|
|
205
|
+
text: '',
|
|
206
|
+
textRuns: void 0
|
|
207
|
+
});
|
|
208
|
+
return {
|
|
209
|
+
...slide,
|
|
210
|
+
layoutId,
|
|
211
|
+
elements
|
|
212
|
+
};
|
|
213
|
+
})
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
function mergedPlaceholders(masterElements, layoutElements) {
|
|
217
|
+
const placeholders = new Map();
|
|
218
|
+
for (const element of [
|
|
219
|
+
...masterElements,
|
|
220
|
+
...layoutElements
|
|
221
|
+
])if (element.placeholder) placeholders.set(element.placeholder.key, element);
|
|
222
|
+
return Array.from(placeholders.values());
|
|
223
|
+
}
|
|
224
|
+
function applyPlaceholderDefinition(element, definition) {
|
|
225
|
+
return {
|
|
226
|
+
...structuredCopy(definition),
|
|
227
|
+
id: element.id,
|
|
228
|
+
type: element.type,
|
|
229
|
+
text: element.text,
|
|
230
|
+
textRuns: element.textRuns,
|
|
231
|
+
image: element.image,
|
|
232
|
+
table: element.table,
|
|
233
|
+
chart: element.chart,
|
|
234
|
+
href: element.href,
|
|
235
|
+
altText: element.altText,
|
|
236
|
+
placeholder: definition.placeholder ? {
|
|
237
|
+
...definition.placeholder
|
|
238
|
+
} : element.placeholder
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
function structuredCopy(value) {
|
|
242
|
+
if ('function' == typeof structuredClone) return structuredClone(value);
|
|
243
|
+
return JSON.parse(JSON.stringify(value));
|
|
244
|
+
}
|
|
245
|
+
export { applyPresentationLayout, canGroupPresentationElements, canUngroupPresentationElements, expandPresentationGroupSelection, groupPresentationElements, presentationGroupPath, presentationSelectionUnits, presentationSlideView, remapPresentationGroupPaths, ungroupPresentationElements, withPresentationDesign };
|
package/dist/0~152.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { descendants, attribute } from "./8715.js";
|
|
2
|
+
function docxCaptionSequenceKind(instruction) {
|
|
3
|
+
const identifier = /^\s*SEQ\s+([^\s\\]+)/i.exec(instruction)?.[1]?.toLowerCase();
|
|
4
|
+
if (!identifier) return null;
|
|
5
|
+
if ('table' === identifier || '表' === identifier) return 'table';
|
|
6
|
+
if ('figure' === identifier || 'fig' === identifier || '图' === identifier) return 'figure';
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
function docxCaptionReferenceTarget(instruction) {
|
|
10
|
+
return /^\s*REF\s+([^\s\\]+)/i.exec(instruction)?.[1] ?? null;
|
|
11
|
+
}
|
|
12
|
+
function docxCaptionBookmark(paragraph, field) {
|
|
13
|
+
const bookmarks = descendants(paragraph, 'bookmarkStart').filter((bookmark)=>!/^_(?:GoBack|Toc)/i.test(attribute(bookmark, 'name') ?? ''));
|
|
14
|
+
const enclosing = bookmarks.filter((bookmark)=>bookmarkContains(paragraph, bookmark, field));
|
|
15
|
+
if (enclosing.length) return enclosing.at(-1);
|
|
16
|
+
return bookmarks.filter((bookmark)=>precedes(bookmark, field.start)).at(-1) ?? bookmarks[0];
|
|
17
|
+
}
|
|
18
|
+
function bookmarkContains(paragraph, start, field) {
|
|
19
|
+
const id = attribute(start, 'id');
|
|
20
|
+
if (!id) return false;
|
|
21
|
+
const end = descendants(paragraph, 'bookmarkEnd').find((bookmark)=>attribute(bookmark, 'id') === id);
|
|
22
|
+
return Boolean(end && precedes(start, field.start) && precedes(field.end, end));
|
|
23
|
+
}
|
|
24
|
+
function precedes(candidate, target) {
|
|
25
|
+
return Boolean(candidate.compareDocumentPosition(target) & Node.DOCUMENT_POSITION_FOLLOWING);
|
|
26
|
+
}
|
|
27
|
+
function docxFieldInstructions(root) {
|
|
28
|
+
return docxFieldOccurrences(root).map((field)=>field.instruction);
|
|
29
|
+
}
|
|
30
|
+
function docxFieldOccurrences(root) {
|
|
31
|
+
const fields = descendants(root, 'fldSimple').map((field)=>({
|
|
32
|
+
instruction: attribute(field, 'instr') ?? '',
|
|
33
|
+
start: field,
|
|
34
|
+
end: field
|
|
35
|
+
}));
|
|
36
|
+
const stack = [];
|
|
37
|
+
for (const element of Array.from(root.querySelectorAll('*'))){
|
|
38
|
+
if ('fldChar' === element.localName) {
|
|
39
|
+
const fieldType = attribute(element, 'fldCharType');
|
|
40
|
+
if ('begin' === fieldType) stack.push({
|
|
41
|
+
instruction: '',
|
|
42
|
+
start: element
|
|
43
|
+
});
|
|
44
|
+
else if ('end' === fieldType && stack.length) {
|
|
45
|
+
const field = stack.pop();
|
|
46
|
+
if (field) fields.push({
|
|
47
|
+
...field,
|
|
48
|
+
end: element
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if ('instrText' === element.localName && stack.length) stack[stack.length - 1].instruction += element.textContent ?? '';
|
|
54
|
+
else if ('instrText' === element.localName) fields.push({
|
|
55
|
+
instruction: element.textContent ?? '',
|
|
56
|
+
start: element,
|
|
57
|
+
end: element
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
fields.push(...stack.map((field)=>({
|
|
61
|
+
...field,
|
|
62
|
+
end: field.start
|
|
63
|
+
})));
|
|
64
|
+
return fields.map((field)=>({
|
|
65
|
+
...field,
|
|
66
|
+
instruction: field.instruction.trim()
|
|
67
|
+
})).filter((field)=>Boolean(field.instruction));
|
|
68
|
+
}
|
|
69
|
+
function docxFieldResultText(field) {
|
|
70
|
+
if ('fldSimple' === field.start.localName) return descendants(field.start, 't').map((element)=>element.textContent ?? '').join('');
|
|
71
|
+
const root = closestAncestor(field.start, 'p') ?? field.start.ownerDocument?.documentElement;
|
|
72
|
+
if (!root) return '';
|
|
73
|
+
let inside = false;
|
|
74
|
+
let separated = false;
|
|
75
|
+
const values = [];
|
|
76
|
+
for (const element of Array.from(root.querySelectorAll('*'))){
|
|
77
|
+
if (element === field.start) inside = true;
|
|
78
|
+
if (inside) {
|
|
79
|
+
if ('fldChar' === element.localName && 'separate' === attribute(element, 'fldCharType')) separated = true;
|
|
80
|
+
else if (separated && ('t' === element.localName || 'delText' === element.localName)) values.push(element.textContent ?? '');
|
|
81
|
+
if (element === field.end) break;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return values.join('');
|
|
85
|
+
}
|
|
86
|
+
function closestAncestor(element, localName) {
|
|
87
|
+
let current = element;
|
|
88
|
+
while(current){
|
|
89
|
+
if (current.localName === localName) return current;
|
|
90
|
+
current = current.parentElement;
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
export { docxCaptionBookmark, docxCaptionReferenceTarget, docxCaptionSequenceKind, docxFieldInstructions, docxFieldOccurrences, docxFieldResultText };
|