@yudaocode/univer-docs-ui 0.0.0-stage → 1.6.205
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 +190 -0
- package/README.md +26 -2
- package/lib/cjs/index.js +7686 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/locale/en-US.js +96 -0
- package/lib/cjs/locale/en-US.js.map +1 -0
- package/lib/cjs/locale/zh-CN.js +96 -0
- package/lib/cjs/locale/zh-CN.js.map +1 -0
- package/lib/es/chunk-BRKEJJFQ.js +17 -0
- package/lib/es/chunk-BRKEJJFQ.js.map +1 -0
- package/lib/es/chunk-RM43V5T5.js +76 -0
- package/lib/es/chunk-RM43V5T5.js.map +1 -0
- package/lib/es/chunk-XZHTILHI.js +76 -0
- package/lib/es/chunk-XZHTILHI.js.map +1 -0
- package/lib/es/index.js +7691 -0
- package/lib/es/index.js.map +1 -0
- package/lib/es/locale/en-US.js +8 -0
- package/lib/es/locale/en-US.js.map +1 -0
- package/lib/es/locale/zh-CN.js +8 -0
- package/lib/es/locale/zh-CN.js.map +1 -0
- package/lib/index.css +346 -0
- package/lib/types/index.d.ts +167 -0
- package/lib/types/locale/en-US.d.ts +5 -0
- package/lib/types/locale/zh-CN.d.ts +73 -0
- package/package.json +82 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/lib/index.css
ADDED
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
/* @yudaocode/univer-docs-ui stylesheet — aligned with @univerjs/themes defaultTheme */
|
|
2
|
+
.yudao-doc-left-panel {
|
|
3
|
+
width: 224px;
|
|
4
|
+
height: 100%;
|
|
5
|
+
background: #ffffff;
|
|
6
|
+
border-right: 1px solid #e3e5ea;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
|
|
10
|
+
color: #1b1c1f;
|
|
11
|
+
user-select: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.yudao-doc-left-tabs {
|
|
15
|
+
display: flex;
|
|
16
|
+
border-bottom: 1px solid #e3e5ea;
|
|
17
|
+
background: #f9fafb;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.yudao-doc-left-tab {
|
|
21
|
+
flex: 1;
|
|
22
|
+
border: none;
|
|
23
|
+
background: transparent;
|
|
24
|
+
padding: 9px 6px;
|
|
25
|
+
font-size: 12px;
|
|
26
|
+
font-weight: 500;
|
|
27
|
+
color: #4e5565;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
border-bottom: 2px solid transparent;
|
|
30
|
+
transition: color 0.14s ease, background 0.14s ease;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.yudao-doc-left-tab:hover {
|
|
34
|
+
color: #1b1c1f;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.yudao-doc-left-tab.is-active {
|
|
38
|
+
color: #2c53f1;
|
|
39
|
+
font-weight: 600;
|
|
40
|
+
border-bottom-color: #2c53f1;
|
|
41
|
+
background: #ffffff;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.yudao-doc-left-body {
|
|
45
|
+
flex: 1;
|
|
46
|
+
overflow-y: auto;
|
|
47
|
+
padding: 10px;
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
gap: 8px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.yudao-doc-quick-grid {
|
|
54
|
+
display: grid;
|
|
55
|
+
grid-template-columns: 1fr 1fr;
|
|
56
|
+
gap: 6px;
|
|
57
|
+
margin-bottom: 4px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.yudao-doc-mini-btn {
|
|
61
|
+
border: 1px solid #e3e5ea;
|
|
62
|
+
background: #ffffff;
|
|
63
|
+
color: #31363f;
|
|
64
|
+
border-radius: 6px;
|
|
65
|
+
padding: 5px 8px;
|
|
66
|
+
font-size: 11.5px;
|
|
67
|
+
font-weight: 500;
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
transition: all 0.14s ease;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.yudao-doc-mini-btn:hover {
|
|
73
|
+
border-color: #2c53f1;
|
|
74
|
+
color: #2c53f1;
|
|
75
|
+
background: #f3f5ff;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.yudao-doc-mini-btn:disabled {
|
|
79
|
+
opacity: 0.55;
|
|
80
|
+
cursor: not-allowed;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.yudao-doc-mini-btn.is-primary {
|
|
84
|
+
background: #2c53f1;
|
|
85
|
+
border-color: #2c53f1;
|
|
86
|
+
color: #ffffff;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.yudao-doc-mini-btn.is-primary:hover {
|
|
90
|
+
background: #143ee3;
|
|
91
|
+
border-color: #143ee3;
|
|
92
|
+
color: #ffffff;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.yudao-doc-mini-btn.is-soft-primary {
|
|
96
|
+
background: #f3f5ff;
|
|
97
|
+
border-color: #d2dafa;
|
|
98
|
+
color: #2c53f1;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.yudao-doc-mini-btn.is-soft-primary:hover {
|
|
102
|
+
background: #e9edff;
|
|
103
|
+
border-color: #2c53f1;
|
|
104
|
+
color: #143ee3;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.yudao-doc-mini-btn.is-danger {
|
|
108
|
+
background: #ffffff;
|
|
109
|
+
border-color: #e3e5ea;
|
|
110
|
+
color: #4e5565;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.yudao-doc-mini-btn.is-danger:hover {
|
|
114
|
+
background: #ffffff;
|
|
115
|
+
border-color: #d93025;
|
|
116
|
+
color: #d93025;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.yudao-doc-export-btn {
|
|
120
|
+
height: 32px;
|
|
121
|
+
border-radius: 6px;
|
|
122
|
+
padding: 0 12px;
|
|
123
|
+
display: inline-flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
justify-content: center;
|
|
126
|
+
box-sizing: border-box;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.yudao-doc-segmented {
|
|
130
|
+
display: grid;
|
|
131
|
+
grid-template-columns: 1fr 1fr;
|
|
132
|
+
gap: 2px;
|
|
133
|
+
background: #eeeff1;
|
|
134
|
+
padding: 2px;
|
|
135
|
+
border-radius: 6px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.yudao-doc-segmented-btn {
|
|
139
|
+
border: none;
|
|
140
|
+
background: transparent;
|
|
141
|
+
color: #4e5565;
|
|
142
|
+
border-radius: 4px;
|
|
143
|
+
padding: 5px 8px;
|
|
144
|
+
font-size: 11.5px;
|
|
145
|
+
font-weight: 500;
|
|
146
|
+
cursor: pointer;
|
|
147
|
+
transition: all 0.14s ease;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.yudao-doc-segmented-btn:hover {
|
|
151
|
+
color: #1b1c1f;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.yudao-doc-segmented-btn.is-active {
|
|
155
|
+
background: #ffffff;
|
|
156
|
+
color: #2c53f1;
|
|
157
|
+
font-weight: 600;
|
|
158
|
+
box-shadow: 0 1px 2px rgba(27, 28, 31, 0.08);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.yudao-doc-ctrl-card {
|
|
162
|
+
border: 1px solid #e3e5ea;
|
|
163
|
+
border-radius: 6px;
|
|
164
|
+
padding: 8px 10px;
|
|
165
|
+
background: #ffffff;
|
|
166
|
+
cursor: pointer;
|
|
167
|
+
transition: border-color 0.14s ease, background 0.14s ease;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.yudao-doc-ctrl-card:hover {
|
|
171
|
+
border-color: #d2dafa;
|
|
172
|
+
background: #f9fafb;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.yudao-doc-ctrl-card.is-active {
|
|
176
|
+
border-color: #2c53f1;
|
|
177
|
+
background: #f3f5ff;
|
|
178
|
+
box-shadow: none;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.yudao-doc-inspector {
|
|
182
|
+
padding: 12px 14px;
|
|
183
|
+
display: flex;
|
|
184
|
+
flex-direction: column;
|
|
185
|
+
gap: 12px;
|
|
186
|
+
font-size: 12px;
|
|
187
|
+
color: #1b1c1f;
|
|
188
|
+
background: #ffffff;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.yudao-doc-section {
|
|
192
|
+
border: 1px solid #e3e5ea;
|
|
193
|
+
border-radius: 8px;
|
|
194
|
+
padding: 10px 12px;
|
|
195
|
+
background: #f9fafb;
|
|
196
|
+
display: flex;
|
|
197
|
+
flex-direction: column;
|
|
198
|
+
gap: 8px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.yudao-doc-section-title {
|
|
202
|
+
font-size: 12px;
|
|
203
|
+
font-weight: 600;
|
|
204
|
+
color: #1b1c1f;
|
|
205
|
+
display: flex;
|
|
206
|
+
align-items: center;
|
|
207
|
+
justify-content: space-between;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.yudao-doc-field-row {
|
|
211
|
+
display: flex;
|
|
212
|
+
flex-direction: column;
|
|
213
|
+
gap: 4px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.yudao-doc-field-row > span {
|
|
217
|
+
font-size: 11px;
|
|
218
|
+
color: #4e5565;
|
|
219
|
+
font-weight: 500;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.yudao-doc-field-row input[type='text'],
|
|
223
|
+
.yudao-doc-field-row input[type='number'],
|
|
224
|
+
.yudao-doc-field-row input[type='date'],
|
|
225
|
+
.yudao-doc-field-row select,
|
|
226
|
+
.yudao-doc-field-row textarea {
|
|
227
|
+
border: 1px solid #e3e5ea;
|
|
228
|
+
border-radius: 6px;
|
|
229
|
+
padding: 5px 8px;
|
|
230
|
+
font-size: 12px;
|
|
231
|
+
background: #ffffff;
|
|
232
|
+
color: #1b1c1f;
|
|
233
|
+
outline: none;
|
|
234
|
+
transition: border-color 0.14s ease;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.yudao-doc-field-row input:focus,
|
|
238
|
+
.yudao-doc-field-row select:focus,
|
|
239
|
+
.yudao-doc-field-row textarea:focus {
|
|
240
|
+
border-color: #2c53f1;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/* Floating Canvas SDT Popover */
|
|
244
|
+
.yudao-doc-sdt-popover {
|
|
245
|
+
position: fixed;
|
|
246
|
+
z-index: 9990;
|
|
247
|
+
min-width: 240px;
|
|
248
|
+
max-width: 310px;
|
|
249
|
+
background: #ffffff;
|
|
250
|
+
border: 1px solid #e3e5ea;
|
|
251
|
+
border-radius: 8px;
|
|
252
|
+
box-shadow: 0 8px 24px rgba(27, 28, 31, 0.12);
|
|
253
|
+
padding: 10px 12px;
|
|
254
|
+
display: flex;
|
|
255
|
+
flex-direction: column;
|
|
256
|
+
gap: 8px;
|
|
257
|
+
font-size: 12px;
|
|
258
|
+
color: #1b1c1f;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/* Modal */
|
|
262
|
+
.yudao-doc-modal-backdrop {
|
|
263
|
+
position: fixed;
|
|
264
|
+
inset: 0;
|
|
265
|
+
z-index: 9995;
|
|
266
|
+
background: rgba(27, 28, 31, 0.45);
|
|
267
|
+
display: flex;
|
|
268
|
+
align-items: center;
|
|
269
|
+
justify-content: center;
|
|
270
|
+
padding: 24px;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.yudao-doc-modal-card {
|
|
274
|
+
width: min(1080px, 94vw);
|
|
275
|
+
height: min(740px, 88vh);
|
|
276
|
+
background: #ffffff;
|
|
277
|
+
border: 1px solid #e3e5ea;
|
|
278
|
+
border-radius: 10px;
|
|
279
|
+
box-shadow: 0 20px 48px rgba(27, 28, 31, 0.2);
|
|
280
|
+
display: flex;
|
|
281
|
+
flex-direction: column;
|
|
282
|
+
overflow: hidden;
|
|
283
|
+
color: #1b1c1f;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.yudao-doc-modal-header {
|
|
287
|
+
padding: 10px 16px;
|
|
288
|
+
background: #f9fafb;
|
|
289
|
+
border-bottom: 1px solid #e3e5ea;
|
|
290
|
+
display: flex;
|
|
291
|
+
align-items: center;
|
|
292
|
+
justify-content: space-between;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.yudao-doc-modal-tabs {
|
|
296
|
+
display: flex;
|
|
297
|
+
gap: 4px;
|
|
298
|
+
background: #eeeff1;
|
|
299
|
+
padding: 2px;
|
|
300
|
+
border-radius: 6px;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.yudao-doc-modal-tab {
|
|
304
|
+
border: none;
|
|
305
|
+
background: transparent;
|
|
306
|
+
padding: 5px 12px;
|
|
307
|
+
border-radius: 4px;
|
|
308
|
+
font-size: 12px;
|
|
309
|
+
font-weight: 500;
|
|
310
|
+
color: #4e5565;
|
|
311
|
+
cursor: pointer;
|
|
312
|
+
transition: all 0.14s ease;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.yudao-doc-modal-tab:hover {
|
|
316
|
+
color: #1b1c1f;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.yudao-doc-modal-tab.is-active {
|
|
320
|
+
background: #ffffff;
|
|
321
|
+
color: #2c53f1;
|
|
322
|
+
font-weight: 600;
|
|
323
|
+
box-shadow: 0 1px 2px rgba(27, 28, 31, 0.08);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.yudao-doc-code-area {
|
|
327
|
+
flex: 1;
|
|
328
|
+
width: 100%;
|
|
329
|
+
box-sizing: border-box;
|
|
330
|
+
border: 1px solid #e3e5ea;
|
|
331
|
+
border-radius: 6px;
|
|
332
|
+
padding: 10px;
|
|
333
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
334
|
+
font-size: 12px;
|
|
335
|
+
line-height: 1.5;
|
|
336
|
+
color: #1b1c1f;
|
|
337
|
+
background: #f9fafb;
|
|
338
|
+
resize: none;
|
|
339
|
+
outline: none;
|
|
340
|
+
transition: border-color 0.14s ease, background 0.14s ease;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.yudao-doc-code-area:focus {
|
|
344
|
+
border-color: #2c53f1;
|
|
345
|
+
background: #ffffff;
|
|
346
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import * as _univerjs_core from '@univerjs/core';
|
|
2
|
+
import { Disposable, Injector, ICommandService, LocaleService, IOperation, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
3
|
+
import { IMenuManagerService, IUIPartsService, ISidebarService, ComponentManager, IconManager, IShortcutService } from '@univerjs/ui';
|
|
4
|
+
import { DocSdtKind, DocIoTarget, IDocPdfExportOptions, DocSdtControlKind, IDocSdtControlSpec, IDocDatasetGroup } from '@yudaocode/univer-docs';
|
|
5
|
+
import { Observable } from 'rxjs';
|
|
6
|
+
export { default as enUS } from './locale/en-US.js';
|
|
7
|
+
export { IDocsUILocale, default as zhCN } from './locale/zh-CN.js';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
|
|
10
|
+
type DocModalTabMode = 'preview' | 'form' | 'json';
|
|
11
|
+
interface IUniverDocsUIFeatures {
|
|
12
|
+
/** Enable structured SDT form controls (text/date/select/cascader/checkbox/lock). Default: `false` */
|
|
13
|
+
sdtControls?: boolean;
|
|
14
|
+
/** Enable business dataset tree & variable binding for contract/EMR templates. Default: `false` */
|
|
15
|
+
datasetBinding?: boolean;
|
|
16
|
+
/** Enable standalone Document Outline & Word Count left sidebar even when `sdtControls` / `datasetBinding` are disabled. Default: `false` */
|
|
17
|
+
outlineSidebar?: boolean;
|
|
18
|
+
/** Enable print headers/footers & pagination helper shortcuts. Default: `false` */
|
|
19
|
+
printPagination?: boolean;
|
|
20
|
+
/** Show one-click sample dataset fill button in dataset sidebar. Default: `true` */
|
|
21
|
+
sampleFill?: boolean;
|
|
22
|
+
/** Allow HTML5 drag-and-drop of dataset fields onto document canvas. Default: `true` */
|
|
23
|
+
fieldDrag?: boolean;
|
|
24
|
+
/** Enable built-in preview & IO modal. Default: `true` */
|
|
25
|
+
builtinPreviewModal?: boolean;
|
|
26
|
+
/** Show table formula (`SUM`/`CNMONEY`) evaluation entry in inspector. Default: `true` */
|
|
27
|
+
tableFormulas?: boolean;
|
|
28
|
+
/** Show inline data formula (`IDocInlineFormula`) card in inspector. Default: `true` */
|
|
29
|
+
inlineFormulas?: boolean;
|
|
30
|
+
/** Show track changes (`修订留痕`) card in inspector. Default: `true` */
|
|
31
|
+
trackChanges?: boolean;
|
|
32
|
+
/** Show AI contract risk audit & clause copilot card in inspector. Default: `true` */
|
|
33
|
+
aiCopilot?: boolean;
|
|
34
|
+
/** Show version snapshot history card in inspector. Default: `true` */
|
|
35
|
+
versionHistory?: boolean;
|
|
36
|
+
/** Show multi-party co-signing role (`activeRole` / `editableRoles`) controls. Default: `true` */
|
|
37
|
+
coSigningRoles?: boolean;
|
|
38
|
+
/** Show medical formula / code block / QR & barcode quick insert section. Default: `true` */
|
|
39
|
+
specialBlocks?: boolean;
|
|
40
|
+
/** Show typesetting blocks / LaTeX / chart / shape / SmartArt / TOC quick insert section. Default: `true` */
|
|
41
|
+
v204Blocks?: boolean;
|
|
42
|
+
/** Show `computedExpr` / `visibleIf` / risk highlight rules section on SDT inspector. Default: `true` */
|
|
43
|
+
controlComputedAndVisibleIf?: boolean;
|
|
44
|
+
/** Show `visualChrome` / `prefix` / `postfix` / `preText` / `postText` section on SDT inspector. Default: `true` */
|
|
45
|
+
controlVisualChrome?: boolean;
|
|
46
|
+
/** Show format validator presets & length/precision/date bounds on SDT inspector. Default: `true` */
|
|
47
|
+
controlValidator?: boolean;
|
|
48
|
+
/** Optional allow-list of permitted SDT control kinds (all kinds allowed when omitted) */
|
|
49
|
+
allowedSdtKinds?: DocSdtKind[];
|
|
50
|
+
}
|
|
51
|
+
type IResolvedDocsUIFeatures = Required<Omit<IUniverDocsUIFeatures, 'allowedSdtKinds'>> & {
|
|
52
|
+
allowedSdtKinds?: DocSdtKind[];
|
|
53
|
+
};
|
|
54
|
+
declare function isDocSdtKindAllowed(features: Pick<IUniverDocsUIFeatures, 'allowedSdtKinds'> | undefined, kind: DocSdtKind): boolean;
|
|
55
|
+
declare function resolveDocsUIFeatures(raw?: IUniverDocsUIFeatures): IResolvedDocsUIFeatures;
|
|
56
|
+
interface IDocsUIFeatureService {
|
|
57
|
+
readonly features$: Observable<IResolvedDocsUIFeatures>;
|
|
58
|
+
readonly modalOpen$: Observable<boolean>;
|
|
59
|
+
readonly modalTab$: Observable<DocModalTabMode>;
|
|
60
|
+
getFeatures(): IResolvedDocsUIFeatures;
|
|
61
|
+
setFeatures(features: IUniverDocsUIFeatures): void;
|
|
62
|
+
patchFeatures(patch: Partial<IResolvedDocsUIFeatures>): void;
|
|
63
|
+
isModalOpen(): boolean;
|
|
64
|
+
getModalTab(): DocModalTabMode;
|
|
65
|
+
openModal(tab?: DocModalTabMode): void;
|
|
66
|
+
closeModal(): void;
|
|
67
|
+
setModalTab(tab: DocModalTabMode): void;
|
|
68
|
+
}
|
|
69
|
+
declare const IDocsUIFeatureService: _univerjs_core.IdentifierDecorator<IDocsUIFeatureService>;
|
|
70
|
+
declare class DocsUIFeatureService extends Disposable implements IDocsUIFeatureService {
|
|
71
|
+
private readonly _features$;
|
|
72
|
+
private readonly _modalOpen$;
|
|
73
|
+
private readonly _modalTab$;
|
|
74
|
+
readonly features$: Observable<IResolvedDocsUIFeatures>;
|
|
75
|
+
readonly modalOpen$: Observable<boolean>;
|
|
76
|
+
readonly modalTab$: Observable<DocModalTabMode>;
|
|
77
|
+
constructor(initial?: IUniverDocsUIFeatures);
|
|
78
|
+
getFeatures(): IResolvedDocsUIFeatures;
|
|
79
|
+
setFeatures(features: IUniverDocsUIFeatures): void;
|
|
80
|
+
patchFeatures(patch: Partial<IResolvedDocsUIFeatures>): void;
|
|
81
|
+
isModalOpen(): boolean;
|
|
82
|
+
getModalTab(): DocModalTabMode;
|
|
83
|
+
openModal(tab?: DocModalTabMode): void;
|
|
84
|
+
closeModal(): void;
|
|
85
|
+
setModalTab(tab: DocModalTabMode): void;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
interface IUniverDocsExtUIConfig {
|
|
89
|
+
/** Whether to open the right SDT inspector sidebar on startup when `sdtControls` is enabled */
|
|
90
|
+
defaultOpenInspector?: boolean;
|
|
91
|
+
/** On-demand enterprise structured form & dataset features (all `false` by default) */
|
|
92
|
+
features?: IUniverDocsUIFeatures;
|
|
93
|
+
}
|
|
94
|
+
declare class DocsExtUIController extends Disposable {
|
|
95
|
+
private readonly _config;
|
|
96
|
+
private readonly _injector;
|
|
97
|
+
private readonly _commandService;
|
|
98
|
+
private readonly _menuManagerService;
|
|
99
|
+
private readonly _uiPartsService;
|
|
100
|
+
private readonly _sidebarService;
|
|
101
|
+
private readonly _componentManager;
|
|
102
|
+
private readonly _iconManager;
|
|
103
|
+
private readonly _localeService?;
|
|
104
|
+
private readonly _shortcutService?;
|
|
105
|
+
constructor(_config: Partial<IUniverDocsExtUIConfig>, _injector: Injector, _commandService: ICommandService, _menuManagerService: IMenuManagerService, _uiPartsService: IUIPartsService, _sidebarService: ISidebarService, _componentManager: ComponentManager, _iconManager: IconManager, _localeService?: LocaleService | undefined, _shortcutService?: IShortcutService | undefined);
|
|
106
|
+
private _initLocales;
|
|
107
|
+
private _initIcons;
|
|
108
|
+
private _initComponents;
|
|
109
|
+
private _initOperations;
|
|
110
|
+
private _initShortcuts;
|
|
111
|
+
private _initMenus;
|
|
112
|
+
private _initWorkbenchParts;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
declare const DOC_INSPECTOR_SIDEBAR_ID = "yudao.docs.inspector.sidebar";
|
|
116
|
+
declare const DOC_INSPECTOR_COMPONENT_KEY = "yudao.docs.inspector.component";
|
|
117
|
+
declare function openDocInspectorSidebar(sidebarService: ISidebarService): void;
|
|
118
|
+
declare const ToggleDocInspectorOperation: IOperation;
|
|
119
|
+
declare const OpenDocModalOperation: IOperation<{
|
|
120
|
+
tab?: DocModalTabMode;
|
|
121
|
+
}>;
|
|
122
|
+
declare const PrintDocOperation: IOperation<{
|
|
123
|
+
unitId?: string;
|
|
124
|
+
options?: IDocPdfExportOptions;
|
|
125
|
+
}>;
|
|
126
|
+
declare const ImportDocFileOperation: IOperation<{
|
|
127
|
+
target?: DocIoTarget;
|
|
128
|
+
}>;
|
|
129
|
+
declare const QuickInsertDocSdtOperation: IOperation<{
|
|
130
|
+
kind: DocSdtControlKind;
|
|
131
|
+
}>;
|
|
132
|
+
declare const FillDocSampleDatasetOperation: IOperation;
|
|
133
|
+
declare const UpdateDocsUIFeaturesOperation: IOperation<{
|
|
134
|
+
features?: IUniverDocsUIFeatures;
|
|
135
|
+
patch?: Partial<IResolvedDocsUIFeatures>;
|
|
136
|
+
}>;
|
|
137
|
+
|
|
138
|
+
declare const UNIVER_DOCS_EXT_UI_PLUGIN_NAME = "YUDAO_UNIVER_DOCS_EXT_UI_PLUGIN";
|
|
139
|
+
declare class UniverDocsExtUIPlugin extends Plugin {
|
|
140
|
+
private readonly _config;
|
|
141
|
+
protected readonly _injector: Injector;
|
|
142
|
+
static pluginName: string;
|
|
143
|
+
static packageName: string;
|
|
144
|
+
static type: UniverInstanceType;
|
|
145
|
+
constructor(_config: Partial<IUniverDocsExtUIConfig> | undefined, _injector: Injector);
|
|
146
|
+
onStarting(): void;
|
|
147
|
+
getResolvedFeatures(): IResolvedDocsUIFeatures;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
declare function resolveEffectiveSdtDatasetBinding(ctrl: Pick<IDocSdtControlSpec, 'bindingPath' | 'tag'>, datasets?: IDocDatasetGroup[]): {
|
|
151
|
+
effectiveBindingPath: string;
|
|
152
|
+
matchedByTagFallback: boolean;
|
|
153
|
+
options: Array<{
|
|
154
|
+
value: string;
|
|
155
|
+
label: string;
|
|
156
|
+
}>;
|
|
157
|
+
};
|
|
158
|
+
declare const DocInspectorPanel: React.FC;
|
|
159
|
+
|
|
160
|
+
declare const YUDAO_DOC_FIELD_DND_MIME = "application/x-yudao-doc-field";
|
|
161
|
+
declare const DocLeftSidebar: React.FC;
|
|
162
|
+
|
|
163
|
+
declare const DocPreviewAndIoModal: React.FC;
|
|
164
|
+
|
|
165
|
+
declare const DocSdtCanvasPopupHost: React.FC;
|
|
166
|
+
|
|
167
|
+
export { DOC_INSPECTOR_COMPONENT_KEY, DOC_INSPECTOR_SIDEBAR_ID, DocInspectorPanel, DocLeftSidebar, type DocModalTabMode, DocPreviewAndIoModal, DocSdtCanvasPopupHost, DocsExtUIController, DocsUIFeatureService, FillDocSampleDatasetOperation, IDocsUIFeatureService, type IResolvedDocsUIFeatures, type IUniverDocsExtUIConfig, type IUniverDocsUIFeatures, ImportDocFileOperation, OpenDocModalOperation, PrintDocOperation, QuickInsertDocSdtOperation, ToggleDocInspectorOperation, UNIVER_DOCS_EXT_UI_PLUGIN_NAME, UniverDocsExtUIPlugin, UpdateDocsUIFeaturesOperation, YUDAO_DOC_FIELD_DND_MIME, isDocSdtKindAllowed, openDocInspectorSidebar, resolveDocsUIFeatures, resolveEffectiveSdtDatasetBinding };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
declare const zhCN: {
|
|
2
|
+
yudaoDocs: {
|
|
3
|
+
ribbon: {
|
|
4
|
+
importDocx: string;
|
|
5
|
+
importDocxTip: string;
|
|
6
|
+
previewExport: string;
|
|
7
|
+
previewExportTip: string;
|
|
8
|
+
printDoc: string;
|
|
9
|
+
printDocTip: string;
|
|
10
|
+
sdtText: string;
|
|
11
|
+
sdtTextTip: string;
|
|
12
|
+
sdtDate: string;
|
|
13
|
+
sdtDateTip: string;
|
|
14
|
+
sdtSelect: string;
|
|
15
|
+
sdtSelectTip: string;
|
|
16
|
+
sdtCheckbox: string;
|
|
17
|
+
sdtCheckboxTip: string;
|
|
18
|
+
formCheck: string;
|
|
19
|
+
formCheckTip: string;
|
|
20
|
+
fillSample: string;
|
|
21
|
+
fillSampleTip: string;
|
|
22
|
+
inspector: string;
|
|
23
|
+
inspectorTip: string;
|
|
24
|
+
};
|
|
25
|
+
sidebar: {
|
|
26
|
+
inspectorTitle: string;
|
|
27
|
+
tabControls: string;
|
|
28
|
+
tabDatasets: string;
|
|
29
|
+
tabOutline: string;
|
|
30
|
+
wordCountLabel: string;
|
|
31
|
+
charUnit: string;
|
|
32
|
+
requiredLabel: string;
|
|
33
|
+
insertAutoToc: string;
|
|
34
|
+
refreshToc: string;
|
|
35
|
+
removeToc: string;
|
|
36
|
+
outlineGuide: string;
|
|
37
|
+
outlineEmpty: string;
|
|
38
|
+
expand: string;
|
|
39
|
+
collapse: string;
|
|
40
|
+
pagePrefix: string;
|
|
41
|
+
pageSuffix: string;
|
|
42
|
+
};
|
|
43
|
+
hyperlinkBar: {
|
|
44
|
+
open: string;
|
|
45
|
+
edit: string;
|
|
46
|
+
copy: string;
|
|
47
|
+
copied: string;
|
|
48
|
+
unlink: string;
|
|
49
|
+
save: string;
|
|
50
|
+
cancel: string;
|
|
51
|
+
urlPlaceholder: string;
|
|
52
|
+
};
|
|
53
|
+
blockToolbar: {
|
|
54
|
+
edit: string;
|
|
55
|
+
save: string;
|
|
56
|
+
cancel: string;
|
|
57
|
+
resize50: string;
|
|
58
|
+
resize75: string;
|
|
59
|
+
resize100: string;
|
|
60
|
+
wrapInline: string;
|
|
61
|
+
wrapSquare: string;
|
|
62
|
+
wrapTopBottom: string;
|
|
63
|
+
addCaption: string;
|
|
64
|
+
};
|
|
65
|
+
contextMenu: {
|
|
66
|
+
empty: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
type IDocsUILocale = typeof zhCN;
|
|
72
|
+
|
|
73
|
+
export { type IDocsUILocale, zhCN as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,85 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yudaocode/univer-docs-ui",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.6.205",
|
|
4
|
+
"description": "Univer Docs UI enhancement plugin: on-demand SDT structured controls, table row loop binding, per-instance canvas popups, and DOCX/HTML/PDF IO modal",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"homepage": "https://github.com/yudaocode/yudao-univer#readme",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/yudaocode/yudao-univer.git",
|
|
10
|
+
"directory": "packages/docs-ui"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/yudaocode/yudao-univer/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"univer",
|
|
17
|
+
"yudao",
|
|
18
|
+
"docs",
|
|
19
|
+
"word",
|
|
20
|
+
"docx",
|
|
21
|
+
"editor",
|
|
22
|
+
"ui",
|
|
23
|
+
"plugin"
|
|
24
|
+
],
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public",
|
|
27
|
+
"registry": "https://registry.npmjs.org/"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"lib"
|
|
31
|
+
],
|
|
32
|
+
"main": "./lib/cjs/index.js",
|
|
33
|
+
"module": "./lib/es/index.js",
|
|
34
|
+
"types": "./lib/types/index.d.ts",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./lib/types/index.d.ts",
|
|
38
|
+
"import": "./lib/es/index.js",
|
|
39
|
+
"require": "./lib/cjs/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./locale/zh-CN": {
|
|
42
|
+
"types": "./lib/types/locale/zh-CN.d.ts",
|
|
43
|
+
"import": "./lib/es/locale/zh-CN.js",
|
|
44
|
+
"require": "./lib/cjs/locale/zh-CN.js"
|
|
45
|
+
},
|
|
46
|
+
"./locale/en-US": {
|
|
47
|
+
"types": "./lib/types/locale/en-US.d.ts",
|
|
48
|
+
"import": "./lib/es/locale/en-US.js",
|
|
49
|
+
"require": "./lib/cjs/locale/en-US.js"
|
|
50
|
+
},
|
|
51
|
+
"./lib/index.css": "./lib/index.css",
|
|
52
|
+
"./styles.css": "./lib/index.css",
|
|
53
|
+
"./package.json": "./package.json"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"@univerjs/core": "^1.6.2",
|
|
57
|
+
"@univerjs/design": "^1.6.2",
|
|
58
|
+
"@univerjs/docs": "^1.6.2",
|
|
59
|
+
"@univerjs/docs-ui": "^1.6.2",
|
|
60
|
+
"@univerjs/engine-render": "^1.6.2",
|
|
61
|
+
"@univerjs/ui": "^1.6.2",
|
|
62
|
+
"react": ">=18.0.0",
|
|
63
|
+
"react-dom": ">=18.0.0",
|
|
64
|
+
"rxjs": ">=7.0.0",
|
|
65
|
+
"@yudaocode/univer-docs": "^1.6.205"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@univerjs/core": "1.6.2",
|
|
69
|
+
"@univerjs/design": "1.6.2",
|
|
70
|
+
"@univerjs/docs": "1.6.2",
|
|
71
|
+
"@univerjs/docs-ui": "1.6.2",
|
|
72
|
+
"@univerjs/engine-render": "1.6.2",
|
|
73
|
+
"@univerjs/icons": "^1.50.3",
|
|
74
|
+
"@univerjs/ui": "1.6.2",
|
|
75
|
+
"react": "^18.3.1",
|
|
76
|
+
"react-dom": "^18.3.1",
|
|
77
|
+
"rxjs": "^7.8.2",
|
|
78
|
+
"@yudaocode/univer-docs": "1.6.205"
|
|
79
|
+
},
|
|
80
|
+
"scripts": {
|
|
81
|
+
"build": "tsup",
|
|
82
|
+
"test": "vitest run",
|
|
83
|
+
"typecheck": "tsc --noEmit"
|
|
84
|
+
}
|
|
6
85
|
}
|