@hailin-zheng/editor-core 2.2.3 → 2.2.5
Sign up to get free protection for your applications and to get access to all the features.
- package/editor.css +694 -610
- package/index-cjs.d.ts +32 -31
- package/index-cjs.js +22649 -22205
- package/index-cjs.js.map +1 -1
- package/index.d.ts +32 -31
- package/index.js +22647 -22207
- package/index.js.map +1 -1
- package/med_editor/doc-editor.d.ts +493 -464
- package/med_editor/doc-rule.d.ts +46 -46
- package/med_editor/editor-core.d.ts +21 -21
- package/med_editor/framework/code-interpreter/ast-parser.d.ts +4 -4
- package/med_editor/framework/code-interpreter/document-eval-func.d.ts +18 -18
- package/med_editor/framework/code-interpreter/dynamic-execute.d.ts +23 -23
- package/med_editor/framework/doc-layout/document-arrange.d.ts +86 -86
- package/med_editor/framework/doc-layout/paragraph-arrange.d.ts +107 -107
- package/med_editor/framework/document-change.d.ts +314 -295
- package/med_editor/framework/document-combine.d.ts +24 -24
- package/med_editor/framework/document-comment.d.ts +38 -38
- package/med_editor/framework/document-context.d.ts +138 -133
- package/med_editor/framework/document-event.d.ts +251 -251
- package/med_editor/framework/document-input-cursor.d.ts +32 -43
- package/med_editor/framework/document-paginator.d.ts +46 -46
- package/med_editor/framework/document-svg.d.ts +36 -36
- package/med_editor/framework/document-template.d.ts +13 -13
- package/med_editor/framework/document-textline-mode.d.ts +6 -6
- package/med_editor/framework/element-define.d.ts +413 -409
- package/med_editor/framework/element-event-define.d.ts +104 -107
- package/med_editor/framework/element-props.d.ts +343 -343
- package/med_editor/framework/element-reader.d.ts +20 -20
- package/med_editor/framework/element-serialize.d.ts +36 -36
- package/med_editor/framework/element-type-handler.d.ts +8 -9
- package/med_editor/framework/history/element-trace-manage.d.ts +107 -107
- package/med_editor/framework/history/element-trace-tracking.d.ts +89 -89
- package/med_editor/framework/impl/checkbox/checkbox-impl.d.ts +19 -19
- package/med_editor/framework/impl/comments/comment-content-impl.d.ts +39 -39
- package/med_editor/framework/impl/comments/comment-element-impl.d.ts +24 -24
- package/med_editor/framework/impl/comments/comments-container-impl.d.ts +19 -19
- package/med_editor/framework/impl/comments/validate-msg-impl.d.ts +19 -19
- package/med_editor/framework/impl/data-element/data-container-impl.d.ts +25 -0
- package/med_editor/framework/impl/data-element/data-decorate-impl.d.ts +15 -15
- package/med_editor/framework/impl/data-element/data-element-barcode.d.ts +32 -32
- package/med_editor/framework/impl/data-element/data-element-base-impl.d.ts +96 -96
- package/med_editor/framework/impl/data-element/data-element-check-impl.d.ts +26 -26
- package/med_editor/framework/impl/data-element/data-element-date-impl.d.ts +23 -23
- package/med_editor/framework/impl/data-element/data-element-group-impl.d.ts +17 -17
- package/med_editor/framework/impl/data-element/data-element-image-impl.d.ts +23 -23
- package/med_editor/framework/impl/data-element/data-element-list-impl.d.ts +21 -21
- package/med_editor/framework/impl/data-element/data-element-text-impl.d.ts +22 -22
- package/med_editor/framework/impl/data-element/qrcode.d.ts +93 -93
- package/med_editor/framework/impl/decorate/fill-null-space-imple.d.ts +16 -16
- package/med_editor/framework/impl/document/doc-body-impl.d.ts +19 -19
- package/med_editor/framework/impl/document/doc-body-part-impl.d.ts +22 -22
- package/med_editor/framework/impl/document/doc-container-impl.d.ts +7 -7
- package/med_editor/framework/impl/document/doc-footer-impl.d.ts +19 -19
- package/med_editor/framework/impl/document/doc-header-impl.d.ts +19 -19
- package/med_editor/framework/impl/document/doc-impl.d.ts +72 -72
- package/med_editor/framework/impl/index.d.ts +40 -39
- package/med_editor/framework/impl/media-formula/menstrual-history.d.ts +31 -31
- package/med_editor/framework/impl/media-formula/permanent-teeth.d.ts +34 -34
- package/med_editor/framework/impl/paragraph/p-impl.d.ts +38 -38
- package/med_editor/framework/impl/picture/RectEle.d.ts +44 -44
- package/med_editor/framework/impl/picture/image-impl.d.ts +24 -24
- package/med_editor/framework/impl/radio/radio-impl.d.ts +17 -17
- package/med_editor/framework/impl/svg/svg-impl.d.ts +20 -20
- package/med_editor/framework/impl/symbol/br-symbol-impl.d.ts +18 -18
- package/med_editor/framework/impl/symbol/p-symbol-impl.d.ts +16 -16
- package/med_editor/framework/impl/symbol/page-br-symbol-impl.d.ts +20 -20
- package/med_editor/framework/impl/symbol/tab-symbol-impl.d.ts +15 -15
- package/med_editor/framework/impl/table/table-cell-impl.d.ts +34 -34
- package/med_editor/framework/impl/table/table-impl.d.ts +49 -49
- package/med_editor/framework/impl/table/table-row-impl.d.ts +27 -27
- package/med_editor/framework/impl/table/table-split-cell-patch.d.ts +20 -20
- package/med_editor/framework/impl/table/table-split-cell.d.ts +93 -92
- package/med_editor/framework/impl/table/table-util.d.ts +180 -180
- package/med_editor/framework/impl/text/text-impl.d.ts +34 -34
- package/med_editor/framework/impl/text/track-run-impl.d.ts +27 -27
- package/med_editor/framework/infrastructure/event-subject.d.ts +57 -56
- package/med_editor/framework/infrastructure/notify.d.ts +13 -13
- package/med_editor/framework/print/document-print-offscreen.d.ts +58 -58
- package/med_editor/framework/print/document-print.d.ts +18 -18
- package/med_editor/framework/render-context.d.ts +111 -111
- package/med_editor/framework/render-define.d.ts +141 -141
- package/med_editor/framework/selection/document-selection.d.ts +92 -91
- package/med_editor/framework/selection/range-util.d.ts +36 -36
- package/med_editor/framework/selection/selection-overlays.d.ts +32 -32
- package/med_editor/framework/suggestions/input-suggestions.d.ts +29 -0
- package/med_editor/framework/util/adjust-viewport-elements.d.ts +12 -12
- package/med_editor/framework/util/common-util.d.ts +76 -76
- package/med_editor/framework/util/document-segmenter.d.ts +2 -2
- package/med_editor/framework/util/element-util.d.ts +410 -410
- package/med_editor/framework/vnode/editor-calendar-vnode.d.ts +42 -42
- package/package.json +19 -19
@@ -1,464 +1,493 @@
|
|
1
|
-
import { ContentMenuItem } from './framework/element-event-define';
|
2
|
-
import { ElementReader } from './framework/element-reader';
|
3
|
-
import { SelectionState } from './framework/selection/document-selection';
|
4
|
-
import { Element, ICancelTokenFn, LeafElement, MarginProps, OrientType, PageLayoutMode, Position, Rect, SerializeProps, ViewOptions } from './framework/element-define';
|
5
|
-
import { DataElementInlineGroup, DataElementLeaf, DocumentElement, ParagraphElement, TableCellElement, TableElement, TableRowElement } from './framework/impl';
|
6
|
-
import { CellDiagonal, ParagraphNumberType, ParagraphProps, TextProps } from './framework/element-props';
|
7
|
-
import { EditorContext } from './framework/document-context';
|
8
|
-
import { ElementTrackManage } from './framework/history/element-trace-manage';
|
9
|
-
import { Subject } from './framework/infrastructure/event-subject';
|
10
|
-
import { init, VNode } from "snabbdom";
|
11
|
-
import { IVNodeRenderFunc } from "./editor-core";
|
12
|
-
import { DocRule } from "./doc-rule";
|
13
|
-
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
private
|
23
|
-
|
24
|
-
private
|
25
|
-
private
|
26
|
-
private
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
private
|
51
|
-
private
|
52
|
-
private
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
/**
|
66
|
-
*
|
67
|
-
* @
|
68
|
-
*/
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
*
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
/**
|
77
|
-
*
|
78
|
-
* @
|
79
|
-
*/
|
80
|
-
private
|
81
|
-
|
82
|
-
|
83
|
-
*
|
84
|
-
*/
|
85
|
-
private
|
86
|
-
|
87
|
-
|
88
|
-
*
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
*
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
/**
|
113
|
-
*
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
*
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
*
|
124
|
-
*/
|
125
|
-
|
126
|
-
/**
|
127
|
-
*
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
*
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
*
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
*
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
*
|
167
|
-
* @
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
*
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
*
|
179
|
-
*/
|
180
|
-
|
181
|
-
/**
|
182
|
-
*
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
/**
|
193
|
-
*
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
*
|
199
|
-
* @param
|
200
|
-
*/
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
*
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
*
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
*
|
216
|
-
*/
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
/**
|
230
|
-
*
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
*
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
*
|
263
|
-
*/
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
/**
|
293
|
-
*
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
*
|
305
|
-
* @param
|
306
|
-
*/
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
*
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
*
|
317
|
-
*/
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
*
|
322
|
-
* @param
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
*
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
*
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
/**
|
426
|
-
*
|
427
|
-
* @private
|
428
|
-
*/
|
429
|
-
private
|
430
|
-
|
431
|
-
/**
|
432
|
-
*
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
*
|
438
|
-
|
439
|
-
|
440
|
-
private
|
441
|
-
private
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
private
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
1
|
+
import { ContentMenuItem } from './framework/element-event-define';
|
2
|
+
import { ElementReader } from './framework/element-reader';
|
3
|
+
import { SelectionState } from './framework/selection/document-selection';
|
4
|
+
import { BlockContainerElement, Element, ICancelTokenFn, LeafElement, MarginProps, OrientType, PageLayoutMode, Position, Rect, SerializeProps, ViewOptions } from './framework/element-define';
|
5
|
+
import { DataElementInlineGroup, DataElementLeaf, DocumentElement, ParagraphElement, TableCellElement, TableElement, TableRowElement } from './framework/impl';
|
6
|
+
import { CellDiagonal, ParagraphNumberType, ParagraphProps, TextProps } from './framework/element-props';
|
7
|
+
import { EditorContext } from './framework/document-context';
|
8
|
+
import { ElementTrackManage } from './framework/history/element-trace-manage';
|
9
|
+
import { Subject } from './framework/infrastructure/event-subject';
|
10
|
+
import { init, VNode } from "snabbdom";
|
11
|
+
import { IVNodeRenderFunc } from "./editor-core";
|
12
|
+
import { DocRule } from "./doc-rule";
|
13
|
+
import { ISuggestionData, ISuggestionProvider } from './framework/suggestions/input-suggestions';
|
14
|
+
export declare class DocEditor {
|
15
|
+
private svgContainer;
|
16
|
+
__v_skip: boolean;
|
17
|
+
private contentCtx;
|
18
|
+
viewOptions: ViewOptions;
|
19
|
+
docCtx: EditorContext;
|
20
|
+
private docComment;
|
21
|
+
private renderContext;
|
22
|
+
private documentPaginator;
|
23
|
+
elementReader: ElementReader;
|
24
|
+
private documentEvent;
|
25
|
+
private documentSelection;
|
26
|
+
private documentInput;
|
27
|
+
private documentChange;
|
28
|
+
private selectionOverlays;
|
29
|
+
historyMange: ElementTrackManage;
|
30
|
+
selectionChanged: Subject<SelectionState>;
|
31
|
+
beforeRenderSubject: Subject<void>;
|
32
|
+
afterRenderSubject: Subject<void>;
|
33
|
+
onBeforeSetCursorSubject: Subject<{
|
34
|
+
result: boolean;
|
35
|
+
ss: SelectionState;
|
36
|
+
}>;
|
37
|
+
contentChanged: Subject<void>;
|
38
|
+
onPatchVNodeSubject: Subject<void>;
|
39
|
+
selectionState: SelectionState;
|
40
|
+
onDblClickEvent: Subject<Event>;
|
41
|
+
onClickEvent: Subject<Event>;
|
42
|
+
onDocChangedEvent: Subject<void>;
|
43
|
+
onBeforeRefreshDocument: Subject<void>;
|
44
|
+
onDocViewSizeChanged: Subject<void>;
|
45
|
+
onDestroy: Subject<void>;
|
46
|
+
beforeNodePatch: Subject<void>;
|
47
|
+
afterNodePatch: Subject<void>;
|
48
|
+
onTextChanged: Subject<void>;
|
49
|
+
onSuggestionsProcess: Subject<ISuggestionProvider>;
|
50
|
+
private eventBus;
|
51
|
+
private editInput;
|
52
|
+
private scrollContainer;
|
53
|
+
onKeyDownEvent: Subject<KeyboardEvent>;
|
54
|
+
constructor(svgContainer: HTMLElement);
|
55
|
+
private createCanvasContext;
|
56
|
+
private renderRoot;
|
57
|
+
private updateViewOption;
|
58
|
+
adjustPageLayout(): void;
|
59
|
+
private destroyDOM;
|
60
|
+
createDocViewer(): void;
|
61
|
+
measureMMToPixs(): number;
|
62
|
+
flushTask: (() => void) | null;
|
63
|
+
private trackChangeState;
|
64
|
+
flushToSchedule(): Promise<void> | null;
|
65
|
+
/**
|
66
|
+
* 触发文档改变事件
|
67
|
+
* @returns
|
68
|
+
*/
|
69
|
+
triggerDocChange(): void;
|
70
|
+
/**
|
71
|
+
* fn函数执行时,不触发onDocChange
|
72
|
+
* @param fn
|
73
|
+
*/
|
74
|
+
noEffectChange(fn: () => void): void;
|
75
|
+
loadDoc(data: any | DocumentElement): void;
|
76
|
+
/**
|
77
|
+
* 刷新文档,重新测量并设置光标等
|
78
|
+
* @returns
|
79
|
+
*/
|
80
|
+
private refreshDocument;
|
81
|
+
/**
|
82
|
+
* 计算选区内容对象
|
83
|
+
* @private
|
84
|
+
*/
|
85
|
+
private updateSelection;
|
86
|
+
/**
|
87
|
+
* 根据当前选区,更新待输入文本字体信息
|
88
|
+
* @private
|
89
|
+
*/
|
90
|
+
private updateInputFont;
|
91
|
+
private hitInfoChanged;
|
92
|
+
/**
|
93
|
+
* 设置光标
|
94
|
+
*/
|
95
|
+
setCursor(): void;
|
96
|
+
private getCursorRect;
|
97
|
+
/**
|
98
|
+
* 设置虚拟光标的可见性
|
99
|
+
* @param visibility
|
100
|
+
*/
|
101
|
+
setCursorVisibility(visibility: boolean): void;
|
102
|
+
hiddenInput(reset?: boolean, pos?: Omit<Rect, 'width'> | null): void;
|
103
|
+
/**
|
104
|
+
* 设置光标位置
|
105
|
+
* @param position
|
106
|
+
*/
|
107
|
+
setCursorPosition(position: {
|
108
|
+
x: number;
|
109
|
+
y: number;
|
110
|
+
height: number;
|
111
|
+
}): void;
|
112
|
+
/**
|
113
|
+
* 判断是否光标可以设置接受编辑
|
114
|
+
* @returns
|
115
|
+
*/
|
116
|
+
private canSetCursor;
|
117
|
+
/**
|
118
|
+
* 修改光标
|
119
|
+
* @param newCursor
|
120
|
+
*/
|
121
|
+
private changeCursor;
|
122
|
+
/**
|
123
|
+
* 文档点击事件
|
124
|
+
*/
|
125
|
+
private docClickHandle;
|
126
|
+
/**
|
127
|
+
* 文档双击事件
|
128
|
+
* 处理全选当前段落
|
129
|
+
*/
|
130
|
+
private docDblClickHandle;
|
131
|
+
/**
|
132
|
+
* 获取当前光标所在的数据元
|
133
|
+
* @returns
|
134
|
+
*/
|
135
|
+
getCurrentDataElement(): DataElementInlineGroup | DataElementLeaf | null;
|
136
|
+
/**
|
137
|
+
* 移动光标到下一个数据元素上
|
138
|
+
*/
|
139
|
+
moveFocusToNextDataElement(): void;
|
140
|
+
/**
|
141
|
+
* 设置当前光标所在的数据元的值
|
142
|
+
* @param val
|
143
|
+
*/
|
144
|
+
setCurrentDataElementValue(val: any): void;
|
145
|
+
/**
|
146
|
+
* 获取数据元位置
|
147
|
+
* @param element
|
148
|
+
* @returns
|
149
|
+
*/
|
150
|
+
getDataElementPosition(element: LeafElement): Omit<Rect, 'width'> | null;
|
151
|
+
/**
|
152
|
+
* 获取文档模型
|
153
|
+
* @returns
|
154
|
+
*/
|
155
|
+
getDocSchema(): any;
|
156
|
+
getDocSchemaJSON(): string;
|
157
|
+
private menusData;
|
158
|
+
/**
|
159
|
+
* 右键菜单
|
160
|
+
* @param evt
|
161
|
+
*/
|
162
|
+
onContextMenu(evt: MouseEvent): void;
|
163
|
+
resetViewer(type?: 'demand' | 'force' | undefined): void;
|
164
|
+
/**
|
165
|
+
* 缩放视图
|
166
|
+
* @param scale
|
167
|
+
* @returns
|
168
|
+
*/
|
169
|
+
scale(scale: number): void;
|
170
|
+
/**
|
171
|
+
* 自适应计算缩放
|
172
|
+
* @private
|
173
|
+
*/
|
174
|
+
private adaptiveScale;
|
175
|
+
/**
|
176
|
+
* 缩放视图
|
177
|
+
* @param scale
|
178
|
+
* @returns
|
179
|
+
*/
|
180
|
+
private _scaleView;
|
181
|
+
/**
|
182
|
+
* 在当前位置插入表格
|
183
|
+
* @param rows
|
184
|
+
* @param cols
|
185
|
+
*/
|
186
|
+
insertTable(rows: number, cols: number): TableElement;
|
187
|
+
insertLayoutContainer(ele: BlockContainerElement): void;
|
188
|
+
/**
|
189
|
+
* 插入软换行符
|
190
|
+
*/
|
191
|
+
insertSoftBr(): void;
|
192
|
+
/**
|
193
|
+
* 清除文档
|
194
|
+
*/
|
195
|
+
clearDoc(): void;
|
196
|
+
/**
|
197
|
+
* 新建文档
|
198
|
+
* @param doc
|
199
|
+
* @param name
|
200
|
+
*/
|
201
|
+
createNewDoc(doc?: DocumentElement | null, name?: string): void;
|
202
|
+
destroy(): void;
|
203
|
+
/**
|
204
|
+
* 将元素序列化为字符串,和serialize方法不同的是,该方法区别在于对留痕信息的处理
|
205
|
+
* @param ele
|
206
|
+
*/
|
207
|
+
serializeString(ele: Element): string;
|
208
|
+
/**
|
209
|
+
* 将元素序列化为JSON对象,可进一步操作该对象序列化为JSON对象
|
210
|
+
* @param ele
|
211
|
+
*/
|
212
|
+
serialize(ele: Element): SerializeProps | null;
|
213
|
+
/**
|
214
|
+
* 获取选区文本属性
|
215
|
+
* @returns
|
216
|
+
*/
|
217
|
+
getSelectionTextGroupProps(): TextProps | null;
|
218
|
+
getSelectionParaProps(): ParagraphProps | null;
|
219
|
+
setTextFormat(newProps: Partial<TextProps>): void;
|
220
|
+
/**
|
221
|
+
* 设置文本格式
|
222
|
+
* @param newProps
|
223
|
+
*/
|
224
|
+
setTextFormatByFn(setterFunc: (textProps: TextProps) => void): void;
|
225
|
+
/**
|
226
|
+
* 开启格式刷
|
227
|
+
*/
|
228
|
+
enableFormatBrush(once?: boolean): ICancelTokenFn | null;
|
229
|
+
/**
|
230
|
+
* 设置段落样式
|
231
|
+
* @param newProps
|
232
|
+
*/
|
233
|
+
setParaStyle(newProps: Partial<ParagraphProps>): void;
|
234
|
+
/**
|
235
|
+
* 设置段落样式
|
236
|
+
* @param setterFunc
|
237
|
+
*/
|
238
|
+
setParaStyleByFn(setterFunc: (paraProps: ParagraphProps) => void): void;
|
239
|
+
combineCell(): void;
|
240
|
+
/**
|
241
|
+
* 切换当前段落项目符号状态
|
242
|
+
*/
|
243
|
+
setParagraphNumberType(numType: ParagraphNumberType): void;
|
244
|
+
/**
|
245
|
+
* 删除当前批注
|
246
|
+
* @param id
|
247
|
+
*/
|
248
|
+
removeComment(id: string): void;
|
249
|
+
/**
|
250
|
+
* 移除焦点所在的批注
|
251
|
+
*/
|
252
|
+
removeCurrentComment(): void;
|
253
|
+
/**
|
254
|
+
* 插入批注
|
255
|
+
*/
|
256
|
+
insertComment(text: string): void;
|
257
|
+
/**
|
258
|
+
* 清除所有批注
|
259
|
+
*/
|
260
|
+
clearAllComments(): void;
|
261
|
+
/**
|
262
|
+
* 插入分页符
|
263
|
+
*/
|
264
|
+
insertPageBreakSymbol(): void;
|
265
|
+
cutTable(): void;
|
266
|
+
/**
|
267
|
+
* 初始化当前文档创建用户信息
|
268
|
+
* 一份文档只需要设置一次
|
269
|
+
*/
|
270
|
+
initCurrentDocUser(userId: string, userName: string, date: string): void;
|
271
|
+
/**
|
272
|
+
* 验证文档内容
|
273
|
+
* @returns
|
274
|
+
*/
|
275
|
+
validate(): boolean;
|
276
|
+
/**
|
277
|
+
* 撤销
|
278
|
+
*/
|
279
|
+
undo(): void;
|
280
|
+
/**
|
281
|
+
* 恢复
|
282
|
+
*/
|
283
|
+
redo(): void;
|
284
|
+
/**
|
285
|
+
* 是否可以撤销
|
286
|
+
*/
|
287
|
+
canUndo(): boolean;
|
288
|
+
/**
|
289
|
+
* 是否可以恢复
|
290
|
+
*/
|
291
|
+
canRedo(): boolean;
|
292
|
+
/**
|
293
|
+
* 切换文档留痕开关
|
294
|
+
*/
|
295
|
+
switchTrackChanges(): void;
|
296
|
+
get trackTipsChanged(): Subject<{
|
297
|
+
pos: Position;
|
298
|
+
tips: import("./framework/element-event-define").ITrackTips;
|
299
|
+
}>;
|
300
|
+
switchFullViewPage(): void;
|
301
|
+
getSelectedJSON(): string;
|
302
|
+
getSelectedText(): string;
|
303
|
+
/**
|
304
|
+
* 执行编辑器内部复制事件
|
305
|
+
* @param evt
|
306
|
+
*/
|
307
|
+
execCopy(evt: ClipboardEvent): void;
|
308
|
+
/**
|
309
|
+
* 设置纸张方向
|
310
|
+
* @param orientation
|
311
|
+
*/
|
312
|
+
setPaperOrient(orientation: OrientType): void;
|
313
|
+
/**
|
314
|
+
* 设置纸张大小,单位为毫米(mm)
|
315
|
+
* @param width
|
316
|
+
* @param height
|
317
|
+
*/
|
318
|
+
setPaperSize(width: string): any;
|
319
|
+
setPaperSize(width: number, height: number): any;
|
320
|
+
/**
|
321
|
+
* 显示当前元素到视图中
|
322
|
+
* @param element
|
323
|
+
*/
|
324
|
+
bringToView(element: Element): void;
|
325
|
+
scrollToPosition(pos: Position): void;
|
326
|
+
/**
|
327
|
+
* 设置当前文档页边距
|
328
|
+
*/
|
329
|
+
setDocumentMargin(pageMargin: Partial<MarginProps>): void;
|
330
|
+
/**
|
331
|
+
* 插入元素
|
332
|
+
* @param targetElement
|
333
|
+
* @param targetOffset
|
334
|
+
* @param destEleArray
|
335
|
+
* @returns
|
336
|
+
*/
|
337
|
+
insertElement(targetElement: Element, targetOffset: number, destEleArray: Array<Element>): Element | null;
|
338
|
+
/**
|
339
|
+
* 插入新元素
|
340
|
+
* @param ele
|
341
|
+
*/
|
342
|
+
insertNewElement(ele: Element): void;
|
343
|
+
switchPageLayout(mode: PageLayoutMode): void;
|
344
|
+
/**
|
345
|
+
* 获取当前光标位置所在的段落
|
346
|
+
*/
|
347
|
+
getParagraphAtCursor(): ParagraphElement | null;
|
348
|
+
/**
|
349
|
+
* 获取当前光标位置的表格
|
350
|
+
*/
|
351
|
+
getTableAtCursor(): TableElement | null;
|
352
|
+
/**
|
353
|
+
* 获取当前光标位置的表格行
|
354
|
+
*/
|
355
|
+
getTableRowAtCursor(): TableRowElement | null;
|
356
|
+
/**
|
357
|
+
* 获取当前光标位置的单元格
|
358
|
+
*/
|
359
|
+
getTableCellAtCursor(): TableCellElement | null;
|
360
|
+
/**
|
361
|
+
* 当前光标处上方插入新行
|
362
|
+
*/
|
363
|
+
insertRowAboveAtCursor(): void;
|
364
|
+
/**
|
365
|
+
* 当前光标处下方插入新行
|
366
|
+
*/
|
367
|
+
insertRowBelowAtCursor(): void;
|
368
|
+
/**
|
369
|
+
* 当前光标处右方插入新列
|
370
|
+
*/
|
371
|
+
insertColToRightAtCursor(): void;
|
372
|
+
/**
|
373
|
+
* 当前光标处左方插入新列
|
374
|
+
*/
|
375
|
+
insertColToLeftAtCursor(): void;
|
376
|
+
/**
|
377
|
+
* 移除当前光标处的行
|
378
|
+
*/
|
379
|
+
removeCurrRowAtCursor(): void;
|
380
|
+
/**
|
381
|
+
* 移除当前光标处的列
|
382
|
+
*/
|
383
|
+
removeCurrColAtCursor(): void;
|
384
|
+
/**
|
385
|
+
* 合并单元格
|
386
|
+
*/
|
387
|
+
mergeCellsBySelection(): void;
|
388
|
+
/**
|
389
|
+
* 拆分单元格
|
390
|
+
* @param rows
|
391
|
+
* @param cols
|
392
|
+
*/
|
393
|
+
splitCell(rows: number, cols: number): void;
|
394
|
+
/**
|
395
|
+
* 删除当前光标所在的表格
|
396
|
+
*/
|
397
|
+
removeTableAtCursor(): void;
|
398
|
+
/**
|
399
|
+
* 设置单元格对角线
|
400
|
+
* @param diagonal
|
401
|
+
*/
|
402
|
+
setCellDiagonal(diagonal: CellDiagonal): void;
|
403
|
+
/**
|
404
|
+
* 设置选区范围内的单元格背景颜色
|
405
|
+
*/
|
406
|
+
setTableCellBgColorAtSelection(color: string): void;
|
407
|
+
/**
|
408
|
+
* 还原光标处已合并的单元格
|
409
|
+
*/
|
410
|
+
restoreMergeCellsAtCursor(): void;
|
411
|
+
/**
|
412
|
+
* 表格在指定位置插入新行
|
413
|
+
* @param tb
|
414
|
+
* @param insertRowIndex
|
415
|
+
*/
|
416
|
+
insertNewRow(tb: TableElement, insertRowIndex: number): TableRowElement;
|
417
|
+
/**
|
418
|
+
* 开启打印区域
|
419
|
+
*/
|
420
|
+
startPrintArea(): void;
|
421
|
+
onChange(): void;
|
422
|
+
nodePatch: ReturnType<typeof init>;
|
423
|
+
vNodeDocContent: VNode;
|
424
|
+
createPatch(): void;
|
425
|
+
/**
|
426
|
+
* 留痕提示的容器框,用于渲染后重新计算纵向位置
|
427
|
+
* @private
|
428
|
+
*/
|
429
|
+
private tipContainer;
|
430
|
+
getVNode(): IVNodeRenderFunc;
|
431
|
+
/**
|
432
|
+
* 更新提示区域布局宽度,根据渲染的节点,判断是否需要设置提示区域宽度
|
433
|
+
* @private
|
434
|
+
*/
|
435
|
+
private updateTipLayoutWidth;
|
436
|
+
/**
|
437
|
+
* 更新留痕提示框位置在文档渲染后
|
438
|
+
* @private
|
439
|
+
*/
|
440
|
+
private updateTipLayoutAfterPatch;
|
441
|
+
private createChangeTipContainer;
|
442
|
+
/**
|
443
|
+
* 设置光标在数据元内容末尾
|
444
|
+
*/
|
445
|
+
setDataElemEndFocus(ele: DataElementInlineGroup): void;
|
446
|
+
/**
|
447
|
+
* 渲染下拉框数据元
|
448
|
+
* @private
|
449
|
+
*/
|
450
|
+
private renderDataListVNode;
|
451
|
+
private resizePosition;
|
452
|
+
private renderCalendar;
|
453
|
+
private renderContextmenu;
|
454
|
+
/**
|
455
|
+
* 设置标尺
|
456
|
+
*/
|
457
|
+
refreshDocRule(rule: DocRule): void;
|
458
|
+
version(): string;
|
459
|
+
switchPageHeaderEditor(): void;
|
460
|
+
getTextContent(): string;
|
461
|
+
emit(event: string, args: any): void;
|
462
|
+
createResizableElement(): VNode;
|
463
|
+
private readDocChangeLog;
|
464
|
+
/**
|
465
|
+
* 处理候选词
|
466
|
+
* @private
|
467
|
+
*/
|
468
|
+
private processSuggestionsHandle;
|
469
|
+
createAutoCompleteOptions(): void;
|
470
|
+
private processKeyDownEvent;
|
471
|
+
/**
|
472
|
+
* 处理候选词,键盘选择定位
|
473
|
+
* @private
|
474
|
+
*/
|
475
|
+
private onSuggestionsKeydown;
|
476
|
+
/**
|
477
|
+
* 渲染联想、候选词
|
478
|
+
* @private
|
479
|
+
*/
|
480
|
+
private renderSuggestions;
|
481
|
+
insertSuggestion(suggestion: ISuggestionData): void;
|
482
|
+
}
|
483
|
+
export interface IReaderManager {
|
484
|
+
}
|
485
|
+
export declare type EditorCurrentPos = {
|
486
|
+
pos: Position;
|
487
|
+
};
|
488
|
+
export declare type EditorContextProps = {
|
489
|
+
menus: Array<ContentMenuItem>;
|
490
|
+
} & EditorCurrentPos;
|
491
|
+
export declare type EditorPanelProps = {
|
492
|
+
type: string;
|
493
|
+
} & EditorCurrentPos;
|