@hailin-zheng/editor-core 2.2.14 → 2.2.16
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/index-cjs.js +340 -103
- package/index-cjs.js.map +1 -1
- package/index.js +338 -103
- package/index.js.map +1 -1
- package/med_editor/doc-editor.d.ts +1 -0
- package/med_editor/editor-core.d.ts +4 -7
- package/med_editor/framework/doc-layout/document-arrange.d.ts +2 -0
- package/med_editor/framework/document-context.d.ts +12 -1
- package/med_editor/framework/element-define.d.ts +9 -6
- package/med_editor/framework/element-event-define.d.ts +0 -2
- package/med_editor/framework/impl/data-element/data-decorate-impl.d.ts +1 -0
- package/med_editor/framework/impl/data-element/data-element-base-impl.d.ts +2 -1
- package/med_editor/framework/impl/data-element/data-element-group-impl.d.ts +2 -1
- package/med_editor/framework/impl/document/doc-impl.d.ts +3 -1
- package/package.json +2 -2
@@ -1,19 +1,16 @@
|
|
1
1
|
import { EditorVNodeObject } from "./framework/render-define";
|
2
2
|
import { SelectionState } from "./framework/selection/document-selection";
|
3
|
-
export declare type
|
3
|
+
export declare type IActiveEditorContext = {
|
4
4
|
onChange: () => void;
|
5
5
|
emit: (event: string, ...args: any[]) => void;
|
6
6
|
selectionState: SelectionState;
|
7
7
|
};
|
8
|
-
export declare let activeEditorContext:
|
9
|
-
export declare function setActiveEditorContext(ctx:
|
10
|
-
export declare function getActiveEditorContext():
|
8
|
+
export declare let activeEditorContext: IActiveEditorContext | null;
|
9
|
+
export declare function setActiveEditorContext(ctx: IActiveEditorContext | null): void;
|
10
|
+
export declare function getActiveEditorContext(): IActiveEditorContext | null;
|
11
11
|
export declare type IVNodeRenderFunc = {
|
12
12
|
render: () => EditorVNodeObject | null;
|
13
13
|
};
|
14
|
-
export interface EditorFuncComp {
|
15
|
-
(...args: any): IVNodeRenderFunc;
|
16
|
-
}
|
17
14
|
export interface ISignal<T> {
|
18
15
|
value: T;
|
19
16
|
onChange: () => void;
|
@@ -83,4 +83,6 @@ export declare class DocumentArrange {
|
|
83
83
|
cacheRenders(renderTree: BranchRenderObject): void;
|
84
84
|
endMeasures(ele: Element): void;
|
85
85
|
createDefaultPara(): ParagraphElement;
|
86
|
+
patchParagraph(): boolean;
|
87
|
+
fastPatchReset(docRenders: Array<DocumentRenderObject>): void;
|
86
88
|
}
|
@@ -4,6 +4,7 @@ import { ElementEvent, EventTypes } from "./element-event-define";
|
|
4
4
|
import { DataElementValueStruct } from "./element-serialize";
|
5
5
|
import { DataElementCheck, DataElementInlineGroup, DataElementLeaf, DocumentElement, TrackRunElement, TrackRunTypeEnum } from "./impl";
|
6
6
|
import { DocumentChange } from "./document-change";
|
7
|
+
import { opsTrackModel } from "./history/element-trace-tracking";
|
7
8
|
import { Subject } from "./infrastructure/event-subject";
|
8
9
|
import { DocInputSuggestions } from "./suggestions/input-suggestions";
|
9
10
|
/**
|
@@ -24,7 +25,15 @@ export declare class EditorContext {
|
|
24
25
|
suggestions: DocInputSuggestions;
|
25
26
|
onKeyDownEvent: Subject<KeyboardEvent>;
|
26
27
|
constructor(selectionState: SelectionState, viewOptions: ViewOptions);
|
27
|
-
|
28
|
+
/**
|
29
|
+
* 刷新视图
|
30
|
+
*/
|
31
|
+
refreshView(): void;
|
32
|
+
/**
|
33
|
+
* 编辑器文档刷新后回调(DOM渲染完成后回调)
|
34
|
+
* @param cb
|
35
|
+
*/
|
36
|
+
onNextView(cb?: (() => void)): void;
|
28
37
|
get document(): DocumentElement;
|
29
38
|
set document(value: DocumentElement);
|
30
39
|
clear(): void;
|
@@ -46,6 +55,7 @@ export declare class EditorContext {
|
|
46
55
|
*/
|
47
56
|
replaceDataElement(oldDataElement: DataElementLeaf | DataElementInlineGroup, newElement: DataElementLeaf | DataElementInlineGroup, ss: SelectionState): void;
|
48
57
|
currentRefreshType: RefreshType | null;
|
58
|
+
currentOpsLog: Array<opsTrackModel>;
|
49
59
|
get refreshType(): RefreshType | null;
|
50
60
|
adaptiveScale(): number;
|
51
61
|
}
|
@@ -140,4 +150,5 @@ interface TrackBlockData {
|
|
140
150
|
content: string;
|
141
151
|
id: string;
|
142
152
|
}
|
153
|
+
export declare function refreshEditor(ele: Element): void;
|
143
154
|
export {};
|
@@ -56,7 +56,6 @@ export declare abstract class Element<P extends object = any> {
|
|
56
56
|
modifyFlag: ModifyFlag;
|
57
57
|
isMouseenter: boolean;
|
58
58
|
private _eventMap;
|
59
|
-
private _refreshEvent;
|
60
59
|
protected _onChangeEvent: Subject<void>;
|
61
60
|
private observers;
|
62
61
|
paintRenders: Array<RenderObject>;
|
@@ -98,7 +97,6 @@ export declare abstract class Element<P extends object = any> {
|
|
98
97
|
beginMeasure(data: IBeginMeasureData): void;
|
99
98
|
endMeasure(): void;
|
100
99
|
getIndex(): number;
|
101
|
-
get refreshSubject(): Subject<void>;
|
102
100
|
get onChangeSubject(): Subject<void>;
|
103
101
|
refreshView(): void;
|
104
102
|
abstract pubOnChange(selfChange: pubChangeType): void;
|
@@ -255,9 +253,9 @@ export declare class ViewOptions {
|
|
255
253
|
currentFontSize: number;
|
256
254
|
currentFontName: string;
|
257
255
|
selectionColor: string;
|
258
|
-
|
259
|
-
|
260
|
-
|
256
|
+
dataEleDecoratorNormalColor: string;
|
257
|
+
dataEleDecoratorMouseEnterColor: string;
|
258
|
+
dataEleDecoratorFocusedColor: string;
|
261
259
|
dataDecoratorWidth: number;
|
262
260
|
showDataEleDecorator: boolean;
|
263
261
|
dataEleEmptyBgColor: string;
|
@@ -266,7 +264,11 @@ export declare class ViewOptions {
|
|
266
264
|
dataEleFocusedBgColor: string;
|
267
265
|
dataEleNormalBgColor: string;
|
268
266
|
dataEleErrorBgColor: string;
|
269
|
-
|
267
|
+
dataGroupDecoratorNormalColor: string;
|
268
|
+
dataGroupDecoratorMouseEnterColor: string;
|
269
|
+
dataGroupDecoratorFocusedColor: string;
|
270
|
+
dataGroupNormalBgColor: string;
|
271
|
+
dataGroupEmptyBgColor: string;
|
270
272
|
dataGroupMouseEnterBgColor: string;
|
271
273
|
dataGroupFocusedBgColor: string;
|
272
274
|
viewBackcolor: string;
|
@@ -300,6 +302,7 @@ export declare class ViewOptions {
|
|
300
302
|
showEnterSymbol: boolean;
|
301
303
|
enableVisibleExpression: boolean;
|
302
304
|
shapeRendering: string;
|
305
|
+
enableFastMeasure: boolean;
|
303
306
|
get fullPageView(): boolean;
|
304
307
|
set fullPageView(value: boolean);
|
305
308
|
mmToPixelsRatio: number;
|
@@ -12,4 +12,5 @@ export declare class DataDecorateElement extends LeafElement<any> {
|
|
12
12
|
export declare class DataDecorateRenderObject extends LeafRenderObject<DataDecorateElement> {
|
13
13
|
clone(cloneData?: boolean): RenderObject;
|
14
14
|
exportSVG(event: IEditorVNodeOptions): any;
|
15
|
+
exportDataGroupSVG(event: IEditorVNodeOptions): any;
|
15
16
|
}
|
@@ -101,7 +101,7 @@ export declare abstract class DataElementBaseFactory<T = null> extends ElementFa
|
|
101
101
|
* @param event
|
102
102
|
* @param r
|
103
103
|
*/
|
104
|
-
export declare function
|
104
|
+
export declare function exportDataEleDecoratorSVG(event: IEditorVNodeOptions, r: InlineGroupRenderObject): any;
|
105
105
|
/**
|
106
106
|
* 渲染数据源验证错误提示框
|
107
107
|
*/
|
@@ -110,3 +110,4 @@ export declare function renderErrorTip(event: IEditorVNodeOptions, r: InlineGrou
|
|
110
110
|
* 渲染底部波浪线
|
111
111
|
*/
|
112
112
|
export declare function renderUnderWavyLine(event: IEditorVNodeOptions, r: InlineGroupRenderObject, color: string): void;
|
113
|
+
export declare function renderUnderline(event: IEditorVNodeOptions, render: RenderObject): void;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { DataElementBaseFactory, InlineGroupInputElement } from "./data-element-base-impl";
|
2
|
-
import { InlineGroupRenderObject, RenderObject } from "../../render-define";
|
2
|
+
import { IEditorVNodeOptions, InlineGroupRenderObject, RenderObject } from "../../render-define";
|
3
3
|
import { SerializeProps, ViewOptions, Element, LeafElement } from "../../element-define";
|
4
4
|
import { DataElementGroupProps } from "../../element-props";
|
5
5
|
export declare class DataElementGroupElement extends InlineGroupInputElement<DataElementGroupProps> {
|
@@ -12,6 +12,7 @@ export declare class DataElementGroupElement extends InlineGroupInputElement<Dat
|
|
12
12
|
}
|
13
13
|
export declare class DataElementGroupRenderObject extends InlineGroupRenderObject<DataElementGroupElement> {
|
14
14
|
clone(): RenderObject;
|
15
|
+
exportSVG(event: IEditorVNodeOptions): any;
|
15
16
|
}
|
16
17
|
export declare class DataElementGroupFactory extends DataElementBaseFactory<DataElementGroupProps> {
|
17
18
|
match(type: string): boolean;
|
@@ -6,16 +6,18 @@ import { BlockContainerRenderObject, IEditorVNodeOptions, RenderObject } from ".
|
|
6
6
|
import { DocumentFooterElement } from "./doc-footer-impl";
|
7
7
|
import { SelectionState } from "../../selection/document-selection";
|
8
8
|
import { CommentElement } from "../comments/comment-element-impl";
|
9
|
+
import { EditorContext } from "../../document-context";
|
9
10
|
export declare class DocumentElement extends BlockContainerElement<DocumentProps> {
|
10
11
|
viewOptions: ViewOptions;
|
11
12
|
bodyElement: DocumentBodyElement;
|
12
13
|
headerElement: DocumentHeaderElement;
|
13
14
|
footerElement: DocumentFooterElement;
|
14
15
|
headerEditState: boolean;
|
16
|
+
editorContext: EditorContext | null;
|
15
17
|
constructor();
|
16
18
|
createRenderObject(): DocumentRenderObject;
|
17
19
|
serialize(): SerializeProps;
|
18
|
-
clone(): DocumentElement;
|
20
|
+
clone(data: boolean): DocumentElement;
|
19
21
|
/**
|
20
22
|
* 更新页边距
|
21
23
|
* @param marginProps
|
package/package.json
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
"author": "hailin-zheng",
|
5
5
|
"private": false,
|
6
6
|
"license": "ISC",
|
7
|
-
"version": "2.2.
|
7
|
+
"version": "2.2.16",
|
8
8
|
"scripts": {},
|
9
9
|
"dependencies": {
|
10
10
|
"moment": "^2.29.3",
|
@@ -16,4 +16,4 @@
|
|
16
16
|
"snabbdom-to-html": "^7.1.0",
|
17
17
|
"jsbarcode": "^3.11.5"
|
18
18
|
}
|
19
|
-
}
|
19
|
+
}
|