@tita-agent/dsh-data-table 0.0.0-stage → 0.2.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 +172 -2
- package/cordis.patch.yml +7 -0
- package/lib/client.js +16766 -0
- package/lib/contract-envelope.d.ts +91 -0
- package/lib/contract-envelope.js +106 -0
- package/lib/contract-layout.d.ts +130 -0
- package/lib/contract-layout.js +138 -0
- package/lib/contract-refs.d.ts +39 -0
- package/lib/contract-refs.js +9 -0
- package/lib/contract-version.d.ts +311 -0
- package/lib/contract-version.js +270 -0
- package/lib/contract-wire.d.ts +147 -0
- package/lib/contract-wire.js +99 -0
- package/lib/contracts.d.ts +12 -0
- package/lib/contracts.js +12 -0
- package/lib/types/audit.d.ts +42 -0
- package/lib/types/audit.js +39 -0
- package/lib/types/client/ProjectImportMenu.d.ts +30 -0
- package/lib/types/client/ProjectImportMenu.js +70 -0
- package/lib/types/client/SheetPanel.d.ts +33 -0
- package/lib/types/client/SheetPanel.js +1766 -0
- package/lib/types/client/SheetToggle.d.ts +18 -0
- package/lib/types/client/SheetToggle.js +26 -0
- package/lib/types/client/index.d.ts +15 -0
- package/lib/types/client/index.js +110 -0
- package/lib/types/client/persistence/changes.d.ts +15 -0
- package/lib/types/client/persistence/changes.js +51 -0
- package/lib/types/client/persistence/ids.d.ts +34 -0
- package/lib/types/client/persistence/ids.js +48 -0
- package/lib/types/client/persistence/merge.d.ts +35 -0
- package/lib/types/client/persistence/merge.js +362 -0
- package/lib/types/client/store.d.ts +61 -0
- package/lib/types/client/store.js +152 -0
- package/lib/types/client/surface-context.d.ts +27 -0
- package/lib/types/client/surface-context.js +104 -0
- package/lib/types/client/surface-control.d.ts +2 -0
- package/lib/types/client/surface-control.js +12 -0
- package/lib/types/client/transport/workbookApi.d.ts +159 -0
- package/lib/types/client/transport/workbookApi.js +246 -0
- package/lib/types/client/univer/StandaloneWorkbookPage.d.ts +5 -0
- package/lib/types/client/univer/StandaloneWorkbookPage.js +7 -0
- package/lib/types/client/univer/WorkbookCanvas.d.ts +40 -0
- package/lib/types/client/univer/WorkbookCanvas.js +87 -0
- package/lib/types/client/univer/WorkbookView.d.ts +3 -0
- package/lib/types/client/univer/WorkbookView.js +2 -0
- package/lib/types/client/univer/loader.d.ts +18 -0
- package/lib/types/client/univer/loader.js +81 -0
- package/lib/types/client/univer/standalone-entry.d.ts +1 -0
- package/lib/types/client/univer/standalone-entry.js +19 -0
- package/lib/types/client/versions/VersionChrome.d.ts +33 -0
- package/lib/types/client/versions/VersionChrome.js +21 -0
- package/lib/types/client/versions/inspect.d.ts +70 -0
- package/lib/types/client/versions/inspect.js +88 -0
- package/lib/types/client/versions/preview-decoration.d.ts +11 -0
- package/lib/types/client/versions/preview-decoration.js +54 -0
- package/lib/types/client/versions/records.d.ts +19 -0
- package/lib/types/client/versions/records.js +70 -0
- package/lib/types/client/workspace-host.d.ts +61 -0
- package/lib/types/client/workspace-host.js +124 -0
- package/lib/types/collaboration-hub.d.ts +31 -0
- package/lib/types/collaboration-hub.js +69 -0
- package/lib/types/contract/ids.d.ts +24 -0
- package/lib/types/contract/ids.js +46 -0
- package/lib/types/contract/mutations.d.ts +25 -0
- package/lib/types/contract/mutations.js +782 -0
- package/lib/types/contract/operations.d.ts +54 -0
- package/lib/types/contract/operations.js +203 -0
- package/lib/types/contract/snapshots.d.ts +176 -0
- package/lib/types/contract/snapshots.js +351 -0
- package/lib/types/contract/univer-api-catalog.d.ts +29 -0
- package/lib/types/contract/univer-api-catalog.js +264 -0
- package/lib/types/errors.d.ts +8 -0
- package/lib/types/errors.js +12 -0
- package/lib/types/http/assets-routes.d.ts +3 -0
- package/lib/types/http/assets-routes.js +169 -0
- package/lib/types/http/collaboration.d.ts +10 -0
- package/lib/types/http/collaboration.js +154 -0
- package/lib/types/http/history.d.ts +15 -0
- package/lib/types/http/history.js +134 -0
- package/lib/types/http/project-files.d.ts +79 -0
- package/lib/types/http/project-files.js +206 -0
- package/lib/types/http/project-scope.d.ts +50 -0
- package/lib/types/http/project-scope.js +52 -0
- package/lib/types/http/routes.d.ts +98 -0
- package/lib/types/http/routes.js +323 -0
- package/lib/types/http/standalone.d.ts +9 -0
- package/lib/types/http/standalone.js +31 -0
- package/lib/types/http/trunk.d.ts +10 -0
- package/lib/types/http/trunk.js +322 -0
- package/lib/types/http/worktree.d.ts +9 -0
- package/lib/types/http/worktree.js +145 -0
- package/lib/types/index.d.ts +18 -0
- package/lib/types/index.js +156 -0
- package/lib/types/invariant.d.ts +15 -0
- package/lib/types/invariant.js +15 -0
- package/lib/types/request-params.d.ts +21 -0
- package/lib/types/request-params.js +76 -0
- package/lib/types/store/paths.d.ts +68 -0
- package/lib/types/store/paths.js +148 -0
- package/lib/types/store/project.d.ts +88 -0
- package/lib/types/store/project.js +120 -0
- package/lib/types/store/read.d.ts +110 -0
- package/lib/types/store/read.js +404 -0
- package/lib/types/store/retention.d.ts +27 -0
- package/lib/types/store/retention.js +111 -0
- package/lib/types/store/write.d.ts +22 -0
- package/lib/types/store/write.js +210 -0
- package/lib/types/tools/arguments.d.ts +40 -0
- package/lib/types/tools/arguments.js +130 -0
- package/lib/types/tools/cells.d.ts +50 -0
- package/lib/types/tools/cells.js +298 -0
- package/lib/types/tools/index.d.ts +2 -0
- package/lib/types/tools/index.js +250 -0
- package/lib/types/tools/render.d.ts +47 -0
- package/lib/types/tools/render.js +290 -0
- package/lib/types/tools/univer-api.d.ts +18 -0
- package/lib/types/tools/univer-api.js +198 -0
- package/lib/types/tools/workbook-catalog.d.ts +3 -0
- package/lib/types/tools/workbook-catalog.js +83 -0
- package/lib/types/tools/workbook-edit.d.ts +192 -0
- package/lib/types/tools/workbook-edit.js +912 -0
- package/lib/types/tools/workbook-find.d.ts +11 -0
- package/lib/types/tools/workbook-find.js +89 -0
- package/lib/types/tools/workbook-history.d.ts +2 -0
- package/lib/types/tools/workbook-history.js +59 -0
- package/lib/types/tools/workbook-read.d.ts +21 -0
- package/lib/types/tools/workbook-read.js +204 -0
- package/lib/types/types.d.ts +377 -0
- package/lib/types/types.js +34 -0
- package/lib/types/univer/apply-operation.d.ts +14 -0
- package/lib/types/univer/apply-operation.js +398 -0
- package/lib/types/univer/chunk.d.ts +68 -0
- package/lib/types/univer/chunk.js +16 -0
- package/lib/types/univer/decoration.d.ts +34 -0
- package/lib/types/univer/decoration.js +88 -0
- package/lib/types/univer/diagnostics.d.ts +31 -0
- package/lib/types/univer/diagnostics.js +141 -0
- package/lib/types/univer/engine.d.ts +33 -0
- package/lib/types/univer/engine.js +338 -0
- package/lib/types/univer/entry.d.ts +8 -0
- package/lib/types/univer/entry.js +11 -0
- package/lib/types/univer/facade.d.ts +107 -0
- package/lib/types/univer/facade.js +1 -0
- package/lib/types/univer/fonts.d.ts +202 -0
- package/lib/types/univer/fonts.js +140 -0
- package/lib/types/univer/plugins/collaboration.d.ts +23 -0
- package/lib/types/univer/plugins/collaboration.js +47 -0
- package/lib/types/univer/plugins/export.d.ts +39 -0
- package/lib/types/univer/plugins/export.js +246 -0
- package/lib/types/univer/plugins/history.d.ts +24 -0
- package/lib/types/univer/plugins/history.js +50 -0
- package/lib/types/univer/plugins/version.d.ts +13 -0
- package/lib/types/univer/plugins/version.js +13 -0
- package/lib/types/version/diff.d.ts +36 -0
- package/lib/types/version/diff.js +156 -0
- package/lib/types/version/grouping.d.ts +7 -0
- package/lib/types/version/grouping.js +94 -0
- package/lib/types/version/records.d.ts +17 -0
- package/lib/types/version/records.js +102 -0
- package/lib/types/version/session.d.ts +36 -0
- package/lib/types/version/session.js +89 -0
- package/lib/types/version/summary.d.ts +24 -0
- package/lib/types/version/summary.js +111 -0
- package/lib/types/workbook-manager.d.ts +191 -0
- package/lib/types/workbook-manager.js +935 -0
- package/lib/types/xlsx-export-worker.d.ts +5 -0
- package/lib/types/xlsx-export-worker.js +24 -0
- package/lib/types/xlsx-export.d.ts +21 -0
- package/lib/types/xlsx-export.js +371 -0
- package/lib/types/xlsx-import-worker.d.ts +1 -0
- package/lib/types/xlsx-import-worker.js +19 -0
- package/lib/univer-client.js +690 -0
- package/lib/workbook-page.js +23826 -0
- package/lib/xlsx-export-worker.js +104 -0
- package/lib/xlsx-import-worker.js +46 -0
- package/package.json +106 -3
- package/src/audit.ts +58 -0
- package/src/client/ProjectImportMenu.tsx +100 -0
- package/src/client/SheetPanel.module.css +1578 -0
- package/src/client/SheetPanel.tsx +1934 -0
- package/src/client/SheetToggle.module.css +73 -0
- package/src/client/SheetToggle.tsx +65 -0
- package/src/client/contract.d.ts +19 -0
- package/src/client/index.ts +131 -0
- package/src/client/persistence/changes.ts +58 -0
- package/src/client/persistence/ids.ts +60 -0
- package/src/client/persistence/merge.ts +392 -0
- package/src/client/store.ts +188 -0
- package/src/client/surface-context.ts +123 -0
- package/src/client/surface-control.ts +13 -0
- package/src/client/transport/workbookApi.ts +355 -0
- package/src/client/univer/SheetView.module.css +110 -0
- package/src/client/univer/StandaloneWorkbookPage.module.css +8 -0
- package/src/client/univer/StandaloneWorkbookPage.tsx +15 -0
- package/src/client/univer/WorkbookCanvas.tsx +128 -0
- package/src/client/univer/WorkbookView.module.css +30 -0
- package/src/client/univer/WorkbookView.tsx +3 -0
- package/src/client/univer/loader.ts +90 -0
- package/src/client/univer/react-dom-client.d.ts +10 -0
- package/src/client/univer/standalone-entry.tsx +19 -0
- package/src/client/univer/standalone.css +12 -0
- package/src/client/univer/univer-locales.d.ts +89 -0
- package/src/client/univer/univer-modules.d.ts +26 -0
- package/src/client/versions/VersionChrome.tsx +114 -0
- package/src/client/versions/inspect.ts +138 -0
- package/src/client/versions/preview-decoration.ts +54 -0
- package/src/client/versions/records.ts +78 -0
- package/src/client/workspace-host.ts +147 -0
- package/src/collaboration-hub.ts +83 -0
- package/src/contract/ids.ts +50 -0
- package/src/contract/mutations.ts +791 -0
- package/src/contract/operations.ts +221 -0
- package/src/contract/snapshots.ts +383 -0
- package/src/contract/univer-api-catalog.ts +289 -0
- package/src/css-modules.d.ts +6 -0
- package/src/errors.ts +25 -0
- package/src/http/assets-routes.ts +177 -0
- package/src/http/collaboration.ts +144 -0
- package/src/http/history.ts +151 -0
- package/src/http/project-files.ts +227 -0
- package/src/http/project-scope.ts +77 -0
- package/src/http/routes.ts +364 -0
- package/src/http/standalone.ts +32 -0
- package/src/http/trunk.ts +322 -0
- package/src/http/worktree.ts +119 -0
- package/src/index.ts +165 -0
- package/src/invariant.ts +17 -0
- package/src/request-params.ts +92 -0
- package/src/store/paths.ts +165 -0
- package/src/store/project.ts +137 -0
- package/src/store/read.ts +454 -0
- package/src/store/retention.ts +106 -0
- package/src/store/write.ts +230 -0
- package/src/tools/arguments.ts +128 -0
- package/src/tools/cells.ts +298 -0
- package/src/tools/index.ts +274 -0
- package/src/tools/render.ts +301 -0
- package/src/tools/univer-api.ts +243 -0
- package/src/tools/workbook-catalog.ts +94 -0
- package/src/tools/workbook-edit.ts +987 -0
- package/src/tools/workbook-find.ts +80 -0
- package/src/tools/workbook-history.ts +63 -0
- package/src/tools/workbook-read.ts +210 -0
- package/src/types.ts +432 -0
- package/src/univer/apply-operation.ts +369 -0
- package/src/univer/chunk.ts +77 -0
- package/src/univer/decoration.ts +111 -0
- package/src/univer/diagnostics.ts +136 -0
- package/src/univer/engine.ts +370 -0
- package/src/univer/entry.ts +14 -0
- package/src/univer/facade.ts +91 -0
- package/src/univer/fonts.ts +148 -0
- package/src/univer/overrides.css +33 -0
- package/src/univer/plugins/collaboration.ts +47 -0
- package/src/univer/plugins/export.ts +236 -0
- package/src/univer/plugins/history.ts +49 -0
- package/src/univer/plugins/version.ts +13 -0
- package/src/version/diff.ts +169 -0
- package/src/version/grouping.ts +96 -0
- package/src/version/records.ts +113 -0
- package/src/version/session.ts +90 -0
- package/src/version/summary.ts +117 -0
- package/src/workbook-manager.ts +1111 -0
- package/src/xlsx-export-worker.ts +34 -0
- package/src/xlsx-export.ts +373 -0
- package/src/xlsx-import-worker.ts +30 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
export interface DataSheetFontConfig {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
category: 'sans-serif' | 'serif';
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Additional font families exposed by the Datasheet Univer residency.
|
|
8
|
+
*
|
|
9
|
+
* This is intentionally a candidate list, not a bundled-font list. The
|
|
10
|
+
* browser-side probe below removes entries that are not installed on the
|
|
11
|
+
* current machine, while keeping the dropdown useful across macOS, Windows,
|
|
12
|
+
* Linux and common Chinese-font setups.
|
|
13
|
+
*/
|
|
14
|
+
export declare const DATA_SHEET_CUSTOM_FONT_CONFIGS: readonly [{
|
|
15
|
+
readonly value: "PingFang SC";
|
|
16
|
+
readonly label: "苹方(简体中文)";
|
|
17
|
+
readonly category: "sans-serif";
|
|
18
|
+
}, {
|
|
19
|
+
readonly value: "PingFang TC";
|
|
20
|
+
readonly label: "苹方(繁体中文)";
|
|
21
|
+
readonly category: "sans-serif";
|
|
22
|
+
}, {
|
|
23
|
+
readonly value: "JingDongLangZhengTi";
|
|
24
|
+
readonly label: "京东朗正体";
|
|
25
|
+
readonly category: "sans-serif";
|
|
26
|
+
}, {
|
|
27
|
+
readonly value: "Helvetica";
|
|
28
|
+
readonly label: "Helvetica";
|
|
29
|
+
readonly category: "sans-serif";
|
|
30
|
+
}, {
|
|
31
|
+
readonly value: "Helvetica Neue";
|
|
32
|
+
readonly label: "Helvetica Neue";
|
|
33
|
+
readonly category: "sans-serif";
|
|
34
|
+
}, {
|
|
35
|
+
readonly value: "Segoe UI";
|
|
36
|
+
readonly label: "Segoe UI";
|
|
37
|
+
readonly category: "sans-serif";
|
|
38
|
+
}, {
|
|
39
|
+
readonly value: "Calibri";
|
|
40
|
+
readonly label: "Calibri";
|
|
41
|
+
readonly category: "sans-serif";
|
|
42
|
+
}, {
|
|
43
|
+
readonly value: "Cambria";
|
|
44
|
+
readonly label: "Cambria";
|
|
45
|
+
readonly category: "serif";
|
|
46
|
+
}, {
|
|
47
|
+
readonly value: "Georgia";
|
|
48
|
+
readonly label: "Georgia";
|
|
49
|
+
readonly category: "serif";
|
|
50
|
+
}, {
|
|
51
|
+
readonly value: "Consolas";
|
|
52
|
+
readonly label: "Consolas";
|
|
53
|
+
readonly category: "sans-serif";
|
|
54
|
+
}, {
|
|
55
|
+
readonly value: "Courier New";
|
|
56
|
+
readonly label: "Courier New";
|
|
57
|
+
readonly category: "serif";
|
|
58
|
+
}, {
|
|
59
|
+
readonly value: "Trebuchet MS";
|
|
60
|
+
readonly label: "Trebuchet MS";
|
|
61
|
+
readonly category: "sans-serif";
|
|
62
|
+
}, {
|
|
63
|
+
readonly value: "Gill Sans";
|
|
64
|
+
readonly label: "Gill Sans";
|
|
65
|
+
readonly category: "sans-serif";
|
|
66
|
+
}, {
|
|
67
|
+
readonly value: "Avenir Next";
|
|
68
|
+
readonly label: "Avenir Next";
|
|
69
|
+
readonly category: "sans-serif";
|
|
70
|
+
}, {
|
|
71
|
+
readonly value: "Menlo";
|
|
72
|
+
readonly label: "Menlo";
|
|
73
|
+
readonly category: "sans-serif";
|
|
74
|
+
}, {
|
|
75
|
+
readonly value: "Roboto";
|
|
76
|
+
readonly label: "Roboto";
|
|
77
|
+
readonly category: "sans-serif";
|
|
78
|
+
}, {
|
|
79
|
+
readonly value: "Noto Sans";
|
|
80
|
+
readonly label: "Noto Sans";
|
|
81
|
+
readonly category: "sans-serif";
|
|
82
|
+
}, {
|
|
83
|
+
readonly value: "Noto Sans CJK SC";
|
|
84
|
+
readonly label: "Noto Sans CJK SC";
|
|
85
|
+
readonly category: "sans-serif";
|
|
86
|
+
}, {
|
|
87
|
+
readonly value: "Noto Sans CJK TC";
|
|
88
|
+
readonly label: "Noto Sans CJK TC";
|
|
89
|
+
readonly category: "sans-serif";
|
|
90
|
+
}, {
|
|
91
|
+
readonly value: "Noto Serif CJK SC";
|
|
92
|
+
readonly label: "Noto Serif CJK SC";
|
|
93
|
+
readonly category: "serif";
|
|
94
|
+
}, {
|
|
95
|
+
readonly value: "Noto Serif CJK TC";
|
|
96
|
+
readonly label: "Noto Serif CJK TC";
|
|
97
|
+
readonly category: "serif";
|
|
98
|
+
}, {
|
|
99
|
+
readonly value: "Source Han Sans SC";
|
|
100
|
+
readonly label: "思源黑体(简体中文)";
|
|
101
|
+
readonly category: "sans-serif";
|
|
102
|
+
}, {
|
|
103
|
+
readonly value: "Source Han Sans TC";
|
|
104
|
+
readonly label: "思源黑体(繁体中文)";
|
|
105
|
+
readonly category: "sans-serif";
|
|
106
|
+
}, {
|
|
107
|
+
readonly value: "Source Han Serif SC";
|
|
108
|
+
readonly label: "思源宋体(简体中文)";
|
|
109
|
+
readonly category: "serif";
|
|
110
|
+
}, {
|
|
111
|
+
readonly value: "Source Han Serif TC";
|
|
112
|
+
readonly label: "思源宋体(繁体中文)";
|
|
113
|
+
readonly category: "serif";
|
|
114
|
+
}, {
|
|
115
|
+
readonly value: "WenQuanYi Zen Hei";
|
|
116
|
+
readonly label: "文泉驿正黑";
|
|
117
|
+
readonly category: "sans-serif";
|
|
118
|
+
}, {
|
|
119
|
+
readonly value: "Microsoft JhengHei";
|
|
120
|
+
readonly label: "微软正黑";
|
|
121
|
+
readonly category: "sans-serif";
|
|
122
|
+
}, {
|
|
123
|
+
readonly value: "Microsoft JhengHei UI";
|
|
124
|
+
readonly label: "微软正黑 UI";
|
|
125
|
+
readonly category: "sans-serif";
|
|
126
|
+
}, {
|
|
127
|
+
readonly value: "DengXian";
|
|
128
|
+
readonly label: "等线";
|
|
129
|
+
readonly category: "sans-serif";
|
|
130
|
+
}, {
|
|
131
|
+
readonly value: "STHeiti";
|
|
132
|
+
readonly label: "华文黑体";
|
|
133
|
+
readonly category: "sans-serif";
|
|
134
|
+
}, {
|
|
135
|
+
readonly value: "STSong";
|
|
136
|
+
readonly label: "华文宋体";
|
|
137
|
+
readonly category: "serif";
|
|
138
|
+
}, {
|
|
139
|
+
readonly value: "STKaiti";
|
|
140
|
+
readonly label: "华文楷体";
|
|
141
|
+
readonly category: "serif";
|
|
142
|
+
}, {
|
|
143
|
+
readonly value: "STFangsong";
|
|
144
|
+
readonly label: "华文仿宋";
|
|
145
|
+
readonly category: "serif";
|
|
146
|
+
}, {
|
|
147
|
+
readonly value: "Songti SC";
|
|
148
|
+
readonly label: "宋体 SC";
|
|
149
|
+
readonly category: "serif";
|
|
150
|
+
}, {
|
|
151
|
+
readonly value: "Songti TC";
|
|
152
|
+
readonly label: "宋体 TC";
|
|
153
|
+
readonly category: "serif";
|
|
154
|
+
}, {
|
|
155
|
+
readonly value: "Heiti SC";
|
|
156
|
+
readonly label: "黑体 SC";
|
|
157
|
+
readonly category: "sans-serif";
|
|
158
|
+
}, {
|
|
159
|
+
readonly value: "Hiragino Sans GB";
|
|
160
|
+
readonly label: "冬青黑体简";
|
|
161
|
+
readonly category: "sans-serif";
|
|
162
|
+
}, {
|
|
163
|
+
readonly value: "Hiragino Mincho ProN";
|
|
164
|
+
readonly label: "冬青明朝体";
|
|
165
|
+
readonly category: "serif";
|
|
166
|
+
}, {
|
|
167
|
+
readonly value: "MingLiU";
|
|
168
|
+
readonly label: "细明体";
|
|
169
|
+
readonly category: "serif";
|
|
170
|
+
}, {
|
|
171
|
+
readonly value: "PMingLiU";
|
|
172
|
+
readonly label: "新细明体";
|
|
173
|
+
readonly category: "serif";
|
|
174
|
+
}, {
|
|
175
|
+
readonly value: "Alibaba PuHuiTi 3.0";
|
|
176
|
+
readonly label: "阿里巴巴普惠体 3.0";
|
|
177
|
+
readonly category: "sans-serif";
|
|
178
|
+
}, {
|
|
179
|
+
readonly value: "Alibaba PuHuiTi 2.0";
|
|
180
|
+
readonly label: "阿里巴巴普惠体 2.0";
|
|
181
|
+
readonly category: "sans-serif";
|
|
182
|
+
}];
|
|
183
|
+
/**
|
|
184
|
+
* Univer's built-in list is repeated here so it can be filtered before
|
|
185
|
+
* Univer creates its FontService. Browsers cannot enumerate every system
|
|
186
|
+
* font, so this is a candidate list rather than a system-font API.
|
|
187
|
+
*/
|
|
188
|
+
export declare const DATA_SHEET_FONT_CANDIDATE_CONFIGS: readonly DataSheetFontConfig[];
|
|
189
|
+
/**
|
|
190
|
+
* Filter candidates using the same canvas-metrics check Univer uses for its
|
|
191
|
+
* unsupported-font indicator. This runs before createUniver(), because
|
|
192
|
+
* Univer snapshots the configured list while constructing FontService.
|
|
193
|
+
*/
|
|
194
|
+
export declare function getInstalledFontConfigs(): DataSheetFontConfig[];
|
|
195
|
+
/**
|
|
196
|
+
* Give every sheet the shared default font family.
|
|
197
|
+
*
|
|
198
|
+
* The sheet default is a migration target: this fixes workbooks created before
|
|
199
|
+
* Datasheet switched from Arial to PingFang SC. Cell-level styles stay untouched,
|
|
200
|
+
* so an explicit font choice is still respected.
|
|
201
|
+
*/
|
|
202
|
+
export declare function withDefaultSheetFont(workbookData: object): object;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { DEFAULT_SHEET_FONT_FAMILY } from "../contract/snapshots.js";
|
|
2
|
+
/**
|
|
3
|
+
* Additional font families exposed by the Datasheet Univer residency.
|
|
4
|
+
*
|
|
5
|
+
* This is intentionally a candidate list, not a bundled-font list. The
|
|
6
|
+
* browser-side probe below removes entries that are not installed on the
|
|
7
|
+
* current machine, while keeping the dropdown useful across macOS, Windows,
|
|
8
|
+
* Linux and common Chinese-font setups.
|
|
9
|
+
*/
|
|
10
|
+
export const DATA_SHEET_CUSTOM_FONT_CONFIGS = [
|
|
11
|
+
{
|
|
12
|
+
// macOS family name for Simplified Chinese PingFang.
|
|
13
|
+
value: 'PingFang SC',
|
|
14
|
+
label: '苹方(简体中文)',
|
|
15
|
+
category: 'sans-serif',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
// Keep the Traditional Chinese family available on macOS as well.
|
|
19
|
+
value: 'PingFang TC',
|
|
20
|
+
label: '苹方(繁体中文)',
|
|
21
|
+
category: 'sans-serif',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
// The CSS family name used by the JD Lang Zhengti font files.
|
|
25
|
+
value: 'JingDongLangZhengTi',
|
|
26
|
+
label: '京东朗正体',
|
|
27
|
+
category: 'sans-serif',
|
|
28
|
+
},
|
|
29
|
+
{ value: 'Helvetica', label: 'Helvetica', category: 'sans-serif' },
|
|
30
|
+
{ value: 'Helvetica Neue', label: 'Helvetica Neue', category: 'sans-serif' },
|
|
31
|
+
{ value: 'Segoe UI', label: 'Segoe UI', category: 'sans-serif' },
|
|
32
|
+
{ value: 'Calibri', label: 'Calibri', category: 'sans-serif' },
|
|
33
|
+
{ value: 'Cambria', label: 'Cambria', category: 'serif' },
|
|
34
|
+
{ value: 'Georgia', label: 'Georgia', category: 'serif' },
|
|
35
|
+
{ value: 'Consolas', label: 'Consolas', category: 'sans-serif' },
|
|
36
|
+
{ value: 'Courier New', label: 'Courier New', category: 'serif' },
|
|
37
|
+
{ value: 'Trebuchet MS', label: 'Trebuchet MS', category: 'sans-serif' },
|
|
38
|
+
{ value: 'Gill Sans', label: 'Gill Sans', category: 'sans-serif' },
|
|
39
|
+
{ value: 'Avenir Next', label: 'Avenir Next', category: 'sans-serif' },
|
|
40
|
+
{ value: 'Menlo', label: 'Menlo', category: 'sans-serif' },
|
|
41
|
+
{ value: 'Roboto', label: 'Roboto', category: 'sans-serif' },
|
|
42
|
+
{ value: 'Noto Sans', label: 'Noto Sans', category: 'sans-serif' },
|
|
43
|
+
{ value: 'Noto Sans CJK SC', label: 'Noto Sans CJK SC', category: 'sans-serif' },
|
|
44
|
+
{ value: 'Noto Sans CJK TC', label: 'Noto Sans CJK TC', category: 'sans-serif' },
|
|
45
|
+
{ value: 'Noto Serif CJK SC', label: 'Noto Serif CJK SC', category: 'serif' },
|
|
46
|
+
{ value: 'Noto Serif CJK TC', label: 'Noto Serif CJK TC', category: 'serif' },
|
|
47
|
+
{ value: 'Source Han Sans SC', label: '思源黑体(简体中文)', category: 'sans-serif' },
|
|
48
|
+
{ value: 'Source Han Sans TC', label: '思源黑体(繁体中文)', category: 'sans-serif' },
|
|
49
|
+
{ value: 'Source Han Serif SC', label: '思源宋体(简体中文)', category: 'serif' },
|
|
50
|
+
{ value: 'Source Han Serif TC', label: '思源宋体(繁体中文)', category: 'serif' },
|
|
51
|
+
{ value: 'WenQuanYi Zen Hei', label: '文泉驿正黑', category: 'sans-serif' },
|
|
52
|
+
{ value: 'Microsoft JhengHei', label: '微软正黑', category: 'sans-serif' },
|
|
53
|
+
{ value: 'Microsoft JhengHei UI', label: '微软正黑 UI', category: 'sans-serif' },
|
|
54
|
+
{ value: 'DengXian', label: '等线', category: 'sans-serif' },
|
|
55
|
+
{ value: 'STHeiti', label: '华文黑体', category: 'sans-serif' },
|
|
56
|
+
{ value: 'STSong', label: '华文宋体', category: 'serif' },
|
|
57
|
+
{ value: 'STKaiti', label: '华文楷体', category: 'serif' },
|
|
58
|
+
{ value: 'STFangsong', label: '华文仿宋', category: 'serif' },
|
|
59
|
+
{ value: 'Songti SC', label: '宋体 SC', category: 'serif' },
|
|
60
|
+
{ value: 'Songti TC', label: '宋体 TC', category: 'serif' },
|
|
61
|
+
{ value: 'Heiti SC', label: '黑体 SC', category: 'sans-serif' },
|
|
62
|
+
{ value: 'Hiragino Sans GB', label: '冬青黑体简', category: 'sans-serif' },
|
|
63
|
+
{ value: 'Hiragino Mincho ProN', label: '冬青明朝体', category: 'serif' },
|
|
64
|
+
{ value: 'MingLiU', label: '细明体', category: 'serif' },
|
|
65
|
+
{ value: 'PMingLiU', label: '新细明体', category: 'serif' },
|
|
66
|
+
{ value: 'Alibaba PuHuiTi 3.0', label: '阿里巴巴普惠体 3.0', category: 'sans-serif' },
|
|
67
|
+
{ value: 'Alibaba PuHuiTi 2.0', label: '阿里巴巴普惠体 2.0', category: 'sans-serif' },
|
|
68
|
+
];
|
|
69
|
+
/**
|
|
70
|
+
* Univer's built-in list is repeated here so it can be filtered before
|
|
71
|
+
* Univer creates its FontService. Browsers cannot enumerate every system
|
|
72
|
+
* font, so this is a candidate list rather than a system-font API.
|
|
73
|
+
*/
|
|
74
|
+
export const DATA_SHEET_FONT_CANDIDATE_CONFIGS = [
|
|
75
|
+
{ value: 'Arial', label: 'ui.fontFamily.arial', category: 'sans-serif' },
|
|
76
|
+
{ value: 'Times New Roman', label: 'ui.fontFamily.times-new-roman', category: 'serif' },
|
|
77
|
+
{ value: 'Tahoma', label: 'ui.fontFamily.tahoma', category: 'sans-serif' },
|
|
78
|
+
{ value: 'Verdana', label: 'ui.fontFamily.verdana', category: 'sans-serif' },
|
|
79
|
+
{ value: 'Microsoft YaHei', label: 'ui.fontFamily.microsoft-yahei', category: 'sans-serif' },
|
|
80
|
+
{ value: 'SimSun', label: 'ui.fontFamily.simsun', category: 'serif' },
|
|
81
|
+
{ value: 'SimHei', label: 'ui.fontFamily.simhei', category: 'sans-serif' },
|
|
82
|
+
{ value: 'Kaiti', label: 'ui.fontFamily.kaiti', category: 'serif' },
|
|
83
|
+
{ value: 'FangSong', label: 'ui.fontFamily.fangsong', category: 'serif' },
|
|
84
|
+
{ value: 'NSimSun', label: 'ui.fontFamily.nsimsun', category: 'serif' },
|
|
85
|
+
{ value: 'STXinwei', label: 'ui.fontFamily.stxinwei', category: 'serif' },
|
|
86
|
+
{ value: 'STXingkai', label: 'ui.fontFamily.stxingkai', category: 'serif' },
|
|
87
|
+
{ value: 'STLiti', label: 'ui.fontFamily.stliti', category: 'serif' },
|
|
88
|
+
...DATA_SHEET_CUSTOM_FONT_CONFIGS,
|
|
89
|
+
];
|
|
90
|
+
/**
|
|
91
|
+
* Filter candidates using the same canvas-metrics check Univer uses for its
|
|
92
|
+
* unsupported-font indicator. This runs before createUniver(), because
|
|
93
|
+
* Univer snapshots the configured list while constructing FontService.
|
|
94
|
+
*/
|
|
95
|
+
export function getInstalledFontConfigs() {
|
|
96
|
+
if (typeof document === 'undefined')
|
|
97
|
+
return [...DATA_SHEET_FONT_CANDIDATE_CONFIGS];
|
|
98
|
+
const context = document.createElement('canvas').getContext('2d');
|
|
99
|
+
if (context === null)
|
|
100
|
+
return [];
|
|
101
|
+
// Include CJK glyphs as well as Latin glyphs. Many Chinese fonts share
|
|
102
|
+
// nearly identical Latin metrics, so a Latin-only probe incorrectly hides
|
|
103
|
+
// installed CJK families from the dropdown.
|
|
104
|
+
const sample = 'AaBbMmWw0123456789中文汉字测试東京한글';
|
|
105
|
+
const size = '72px';
|
|
106
|
+
const baseFonts = ['monospace', 'serif', 'sans-serif'];
|
|
107
|
+
const defaultWidths = new Map();
|
|
108
|
+
for (const base of baseFonts) {
|
|
109
|
+
context.font = `${size} ${base}`;
|
|
110
|
+
defaultWidths.set(base, context.measureText(sample).width);
|
|
111
|
+
}
|
|
112
|
+
return DATA_SHEET_FONT_CANDIDATE_CONFIGS.filter(font => baseFonts.some(base => {
|
|
113
|
+
context.font = `${size} "${font.value}", ${base}`;
|
|
114
|
+
return context.measureText(sample).width !== defaultWidths.get(base);
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Give every sheet the shared default font family.
|
|
119
|
+
*
|
|
120
|
+
* The sheet default is a migration target: this fixes workbooks created before
|
|
121
|
+
* Datasheet switched from Arial to PingFang SC. Cell-level styles stay untouched,
|
|
122
|
+
* so an explicit font choice is still respected.
|
|
123
|
+
*/
|
|
124
|
+
export function withDefaultSheetFont(workbookData) {
|
|
125
|
+
const root = workbookData;
|
|
126
|
+
if (root.sheets === undefined || typeof root.sheets !== 'object')
|
|
127
|
+
return workbookData;
|
|
128
|
+
let changed = false;
|
|
129
|
+
const sheets = Object.fromEntries(Object.entries(root.sheets).map(([id, sheet]) => {
|
|
130
|
+
const currentStyle = sheet.defaultStyle;
|
|
131
|
+
const defaultStyle = currentStyle !== null && typeof currentStyle === 'object' && !Array.isArray(currentStyle)
|
|
132
|
+
? currentStyle
|
|
133
|
+
: {};
|
|
134
|
+
if (defaultStyle.ff === DEFAULT_SHEET_FONT_FAMILY)
|
|
135
|
+
return [id, sheet];
|
|
136
|
+
changed = true;
|
|
137
|
+
return [id, { ...sheet, defaultStyle: { ...defaultStyle, ff: DEFAULT_SHEET_FONT_FAMILY } }];
|
|
138
|
+
}));
|
|
139
|
+
return changed ? { ...root, sheets } : workbookData;
|
|
140
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Univer-side collaboration seam used by Datasheet.
|
|
3
|
+
*
|
|
4
|
+
* Univer exposes `onMutationExecutedForCollab` specifically for collaboration
|
|
5
|
+
* implementations. We use that native seam, but keep the transport and
|
|
6
|
+
* persistence outside Univer so the plugin does not depend on Univer Pro.
|
|
7
|
+
*/
|
|
8
|
+
import { IUniverInstanceService, ICommandService, Injector, Plugin, UniverInstanceType, type ICommandInfo, type IExecutionOptions } from '@univerjs/presets';
|
|
9
|
+
export interface DataSheetCollaborationConfig {
|
|
10
|
+
onMutation?: (commandInfo: Readonly<ICommandInfo>, options?: IExecutionOptions) => void;
|
|
11
|
+
}
|
|
12
|
+
/** Connects Univer's native mutation stream to the Datasheet session. */
|
|
13
|
+
export declare class DataSheetCollaborationPlugin extends Plugin {
|
|
14
|
+
private readonly _config;
|
|
15
|
+
protected readonly _injector: Injector;
|
|
16
|
+
private readonly _commandService;
|
|
17
|
+
static pluginName: string;
|
|
18
|
+
static packageName: string;
|
|
19
|
+
static version: string;
|
|
20
|
+
static type: UniverInstanceType;
|
|
21
|
+
constructor(_config: DataSheetCollaborationConfig | undefined, _injector: Injector, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService);
|
|
22
|
+
onStarting(): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Univer-side collaboration seam used by Datasheet.
|
|
3
|
+
*
|
|
4
|
+
* Univer exposes `onMutationExecutedForCollab` specifically for collaboration
|
|
5
|
+
* implementations. We use that native seam, but keep the transport and
|
|
6
|
+
* persistence outside Univer so the plugin does not depend on Univer Pro.
|
|
7
|
+
*/
|
|
8
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
9
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
11
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
12
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13
|
+
};
|
|
14
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
15
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
16
|
+
};
|
|
17
|
+
import { IUniverInstanceService, Inject, ICommandService, Injector, Plugin, UniverInstanceType, } from '@univerjs/presets';
|
|
18
|
+
import { UNIVER_PLUGIN_VERSION } from "./version.js";
|
|
19
|
+
/** Connects Univer's native mutation stream to the Datasheet session. */
|
|
20
|
+
let DataSheetCollaborationPlugin = class DataSheetCollaborationPlugin extends Plugin {
|
|
21
|
+
_config;
|
|
22
|
+
_injector;
|
|
23
|
+
_commandService;
|
|
24
|
+
static pluginName = 'dsh.data-sheet.collaboration';
|
|
25
|
+
static packageName = 'dsh-data-table';
|
|
26
|
+
static version = UNIVER_PLUGIN_VERSION;
|
|
27
|
+
static type = UniverInstanceType.UNIVER_SHEET;
|
|
28
|
+
constructor(_config, _injector, _commandService, _univerInstanceService) {
|
|
29
|
+
super();
|
|
30
|
+
this._config = _config;
|
|
31
|
+
this._injector = _injector;
|
|
32
|
+
this._commandService = _commandService;
|
|
33
|
+
}
|
|
34
|
+
onStarting() {
|
|
35
|
+
this.disposeWithMe(this._commandService.onMutationExecutedForCollab((commandInfo, options) => {
|
|
36
|
+
if (options?.onlyLocal || options?.fromChangeset || options?.fromCollab)
|
|
37
|
+
return;
|
|
38
|
+
this._config?.onMutation?.(commandInfo, options);
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
DataSheetCollaborationPlugin = __decorate([
|
|
43
|
+
__param(1, Inject(Injector)),
|
|
44
|
+
__param(2, ICommandService),
|
|
45
|
+
__param(3, IUniverInstanceService)
|
|
46
|
+
], DataSheetCollaborationPlugin);
|
|
47
|
+
export { DataSheetCollaborationPlugin };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Univer-side export plugin for dsh-data-table.
|
|
3
|
+
*
|
|
4
|
+
* This follows Univer's normal plugin shape: commands are registered with
|
|
5
|
+
* ICommandService. The browser-facing exporter stays a small adapter over
|
|
6
|
+
* the live Workbook model, so menu actions always export the current
|
|
7
|
+
* in-memory edits.
|
|
8
|
+
* @module dsh-data-table/univer-export-plugin
|
|
9
|
+
*/
|
|
10
|
+
import { ICommandService, IUniverInstanceService, Injector, Plugin, UniverInstanceType } from '@univerjs/presets';
|
|
11
|
+
export declare const EXPORT_CSV_COMMAND_ID = "dsh.data-sheet.export-csv";
|
|
12
|
+
export declare const EXPORT_XLSX_COMMAND_ID = "dsh.data-sheet.export-xlsx";
|
|
13
|
+
export declare const IMPORT_XLSX_COMMAND_ID = "dsh.data-sheet.import-xlsx";
|
|
14
|
+
/** Univer plugin that owns the datasheet export commands and DSH menu bridge. */
|
|
15
|
+
export declare class DataSheetExportPlugin extends Plugin {
|
|
16
|
+
protected readonly _injector: Injector;
|
|
17
|
+
private readonly _commandService;
|
|
18
|
+
private readonly _univerInstanceService;
|
|
19
|
+
static pluginName: string;
|
|
20
|
+
static packageName: string;
|
|
21
|
+
static version: string;
|
|
22
|
+
static type: UniverInstanceType;
|
|
23
|
+
constructor(_config: undefined, _injector: Injector, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService);
|
|
24
|
+
onStarting(): void;
|
|
25
|
+
private export;
|
|
26
|
+
private importFile;
|
|
27
|
+
/**
|
|
28
|
+
* Parse one buffer and hand the workbook to the panel.
|
|
29
|
+
*
|
|
30
|
+
* Shared by both ways in — the OS file dialog and the project chooser, which
|
|
31
|
+
* reads the bytes over HTTP because a browser cannot open a path. Everything
|
|
32
|
+
* after the bytes arrive is one pipeline, so the two entry points cannot drift
|
|
33
|
+
* into two imports.
|
|
34
|
+
*
|
|
35
|
+
* @param data - The file's bytes.
|
|
36
|
+
* @param name - The name the panel reports and the worker partly decides from.
|
|
37
|
+
*/
|
|
38
|
+
private importBuffer;
|
|
39
|
+
}
|