@a3s-lab/office 0.1.0 → 0.2.1
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/README.md +98 -24
- package/dist/0~2582.js +485 -0
- package/dist/0~4595.js +14 -7
- package/dist/0~4750.js +939 -0
- package/dist/{0~work-document-paragraph-formatting.js → 0~5861.js} +174 -3
- package/dist/0~7048.js +8 -6
- package/dist/0~9512.js +7 -4
- package/dist/0~document-editor.js +3147 -531
- package/dist/0~markdown-editor.js +26 -1
- package/dist/0~presentation-editor.js +68 -12
- package/dist/0~spreadsheet-editor.js +37 -17
- package/dist/0~work-document-extensions.js +588 -13
- package/dist/0~work-document-model-codec.js +1 -1
- package/dist/0~work-docx-bibliography.js +1 -1
- package/dist/0~work-docx-export.js +116 -55
- package/dist/0~work-docx-import.js +690 -99
- package/dist/0~work-office-diagnostics.js +2 -2
- package/dist/{4704.js → 2881.js} +162 -71
- package/dist/4104.js +2 -62
- package/dist/internal/features/work/editors/document-comment-window.d.ts +37 -0
- package/dist/internal/features/work/editors/document-navigation-panel.d.ts +3 -1
- package/dist/internal/features/work/editors/document-navigation-window.d.ts +64 -0
- package/dist/internal/features/work/editors/document-outline-navigation.d.ts +11 -0
- package/dist/internal/features/work/editors/document-page-navigation.d.ts +11 -1
- package/dist/internal/features/work/editors/document-page-thumbnail.d.ts +31 -0
- package/dist/internal/features/work/editors/document-picture-properties-dialog-model.d.ts +28 -0
- package/dist/internal/features/work/editors/document-picture-properties-dialog.d.ts +4 -0
- package/dist/internal/features/work/editors/document-search-navigation.d.ts +12 -0
- package/dist/internal/features/work/editors/document-table-margins-popover.d.ts +4 -0
- package/dist/internal/features/work/editors/document-table-properties-dialog-model.d.ts +51 -0
- package/dist/internal/features/work/editors/document-table-properties-dialog-sections.d.ts +19 -0
- package/dist/internal/features/work/editors/document-table-properties-dialog.d.ts +8 -0
- package/dist/internal/features/work/editors/office-task-pane.d.ts +1 -1
- package/dist/internal/features/work/editors/presentation-chart-panel.d.ts +2 -1
- package/dist/internal/features/work/editors/presentation-comments-panel.d.ts +2 -1
- package/dist/internal/features/work/editors/spreadsheet-workbook-panel.d.ts +2 -1
- package/dist/internal/features/work/editors/use-document-pagination.d.ts +6 -0
- package/dist/internal/features/work/editors/use-presentation-review-commands.d.ts +1 -1
- package/dist/internal/features/work/work-document-image-layout.d.ts +11 -0
- package/dist/internal/features/work/work-document-page-capture.d.ts +15 -0
- package/dist/internal/features/work/work-document-paragraph-formatting.d.ts +4 -0
- package/dist/internal/features/work/work-document-section.d.ts +3 -1
- package/dist/internal/features/work/work-document-table-borders.d.ts +20 -0
- package/dist/internal/features/work/work-document-table-cell-formatting.d.ts +8 -5
- package/dist/internal/features/work/work-document-table-geometry.d.ts +41 -0
- package/dist/internal/features/work/work-document-table-property-changes.d.ts +25 -0
- package/dist/internal/features/work/work-document-table-sizing.d.ts +15 -2
- package/dist/internal/features/work/work-document-word-line-metrics.d.ts +11 -0
- package/dist/internal/features/work/work-docx-document-layout.d.ts +2 -0
- package/dist/internal/features/work/work-docx-paragraph-alignment-import.d.ts +2 -1
- package/dist/internal/features/work/work-docx-paragraph-direction-import.d.ts +2 -1
- package/dist/internal/features/work/work-docx-paragraph-indent-import.d.ts +2 -1
- package/dist/internal/features/work/work-docx-paragraph-pagination-import.d.ts +2 -1
- package/dist/internal/features/work/work-docx-paragraph-spacing-import.d.ts +3 -2
- package/dist/internal/features/work/work-docx-paragraph-styles.d.ts +2 -2
- package/dist/internal/features/work/work-docx-run-formatting-import.d.ts +8 -1
- package/dist/internal/features/work/work-docx-tab-stop-import.d.ts +2 -1
- package/dist/internal/features/work/work-docx-table-cell-export.d.ts +1 -1
- package/dist/internal/features/work/work-docx-table-cell-import.d.ts +14 -4
- package/dist/internal/features/work/work-docx-table-sizing-export.d.ts +1 -1
- package/dist/internal/features/work/work-docx-table-sizing-import.d.ts +4 -3
- package/dist/internal/features/work/work-docx-table-styles.d.ts +22 -0
- package/dist/internal/features/work/work-types.d.ts +6 -0
- package/dist/office-kernel.wasm +0 -0
- package/dist/styles.css +1288 -233
- package/docs/{browser-editor-architecture.md → latest/en/browser-editor-architecture.md} +144 -35
- package/package.json +9 -5
- package/dist/0~6552.js +0 -787
- package/dist/0~8155.js +0 -299
package/dist/0~4595.js
CHANGED
|
@@ -706,6 +706,7 @@ function WorkOfficeRibbon({ ariaLabel, tabs, defaultTab, activeTab, onTabChange,
|
|
|
706
706
|
const selectedLabel = tabs.find((tab)=>tab.id === selectedTab)?.label ?? tabs[0]?.label ?? '';
|
|
707
707
|
const selectedPanel = panels[selectedTab];
|
|
708
708
|
const hasSelectedPanel = null != selectedPanel;
|
|
709
|
+
const hasRibbonOverflow = ribbonOverflow.backward || ribbonOverflow.forward;
|
|
709
710
|
const updateRibbonOverflow = useCallback(()=>{
|
|
710
711
|
const toolbar = toolbarRef.current;
|
|
711
712
|
if (!toolbar) return;
|
|
@@ -909,10 +910,11 @@ function WorkOfficeRibbon({ ariaLabel, tabs, defaultTab, activeTab, onTabChange,
|
|
|
909
910
|
"aria-labelledby": `${reactId}-tab-${selectedTab}`,
|
|
910
911
|
children: hasSelectedPanel && /*#__PURE__*/ jsxs(jsx_runtime_Fragment, {
|
|
911
912
|
children: [
|
|
912
|
-
|
|
913
|
+
hasRibbonOverflow && /*#__PURE__*/ jsx("button", {
|
|
913
914
|
type: "button",
|
|
914
915
|
className: "work-office-ribbon-scroll previous",
|
|
915
916
|
"aria-label": `向左查看更多${selectedLabel}工具`,
|
|
917
|
+
disabled: !ribbonOverflow.backward,
|
|
916
918
|
onClick: ()=>scrollRibbon(-1),
|
|
917
919
|
children: /*#__PURE__*/ jsx(ChevronLeft, {
|
|
918
920
|
size: 15
|
|
@@ -921,16 +923,17 @@ function WorkOfficeRibbon({ ariaLabel, tabs, defaultTab, activeTab, onTabChange,
|
|
|
921
923
|
/*#__PURE__*/ jsx("div", {
|
|
922
924
|
ref: toolbarRef,
|
|
923
925
|
className: `work-office-toolbar ${toolbarClassName}`.trim(),
|
|
924
|
-
"data-has-overflow":
|
|
926
|
+
"data-has-overflow": hasRibbonOverflow ? 'true' : void 0,
|
|
925
927
|
role: "toolbar",
|
|
926
928
|
"aria-label": `${selectedLabel}工具栏`,
|
|
927
929
|
onScroll: updateRibbonOverflow,
|
|
928
930
|
children: selectedPanel
|
|
929
931
|
}),
|
|
930
|
-
|
|
932
|
+
hasRibbonOverflow && /*#__PURE__*/ jsx("button", {
|
|
931
933
|
type: "button",
|
|
932
934
|
className: "work-office-ribbon-scroll next",
|
|
933
935
|
"aria-label": `向右查看更多${selectedLabel}工具`,
|
|
936
|
+
disabled: !ribbonOverflow.forward,
|
|
934
937
|
onClick: ()=>scrollRibbon(1),
|
|
935
938
|
children: /*#__PURE__*/ jsx(ChevronRight, {
|
|
936
939
|
size: 15
|
|
@@ -944,12 +947,16 @@ function WorkOfficeRibbon({ ariaLabel, tabs, defaultTab, activeTab, onTabChange,
|
|
|
944
947
|
}
|
|
945
948
|
function ribbonItemGeometry(toolbar) {
|
|
946
949
|
return Array.from(toolbar.children).flatMap((element)=>element instanceof HTMLElement ? [
|
|
947
|
-
|
|
948
|
-
left: element.offsetLeft,
|
|
949
|
-
right: element.offsetLeft + element.offsetWidth
|
|
950
|
-
}
|
|
950
|
+
ribbonItemBounds(toolbar, element)
|
|
951
951
|
] : []);
|
|
952
952
|
}
|
|
953
|
+
function ribbonItemBounds(toolbar, element) {
|
|
954
|
+
const left = element.offsetParent === toolbar ? element.offsetLeft : element.offsetLeft - toolbar.offsetLeft;
|
|
955
|
+
return {
|
|
956
|
+
left,
|
|
957
|
+
right: left + element.offsetWidth
|
|
958
|
+
};
|
|
959
|
+
}
|
|
953
960
|
function scrollSelectedRibbonTabIntoView(tabList, selectedTab) {
|
|
954
961
|
const selected = Array.from(tabList.children).find((element)=>element instanceof HTMLElement && element.dataset.tabId === selectedTab);
|
|
955
962
|
if (!selected || tabList.clientWidth <= 0) return;
|