@hailin-zheng/editor-core 2.2.42 → 2.2.43

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.
Files changed (95) hide show
  1. package/editor.css +679 -679
  2. package/index-cjs.d.ts +32 -32
  3. package/index-cjs.js +24462 -24462
  4. package/index-cjs.js.map +1 -1
  5. package/index.d.ts +32 -32
  6. package/index.js +24462 -24462
  7. package/index.js.map +1 -1
  8. package/med_editor/doc-editor.d.ts +547 -547
  9. package/med_editor/doc-rule.d.ts +174 -174
  10. package/med_editor/editor-core.d.ts +18 -18
  11. package/med_editor/framework/code-interpreter/ast-parser.d.ts +4 -4
  12. package/med_editor/framework/code-interpreter/document-eval-func.d.ts +18 -18
  13. package/med_editor/framework/code-interpreter/dynamic-execute.d.ts +42 -42
  14. package/med_editor/framework/doc-layout/document-arrange.d.ts +95 -95
  15. package/med_editor/framework/doc-layout/paragraph-arrange.d.ts +110 -110
  16. package/med_editor/framework/document-change.d.ts +346 -346
  17. package/med_editor/framework/document-combine.d.ts +24 -24
  18. package/med_editor/framework/document-comment.d.ts +38 -38
  19. package/med_editor/framework/document-context.d.ts +162 -162
  20. package/med_editor/framework/document-event.d.ts +261 -261
  21. package/med_editor/framework/document-input-cursor.d.ts +32 -32
  22. package/med_editor/framework/document-paginator.d.ts +46 -46
  23. package/med_editor/framework/document-svg.d.ts +36 -36
  24. package/med_editor/framework/document-template.d.ts +13 -13
  25. package/med_editor/framework/document-textline-mode.d.ts +6 -6
  26. package/med_editor/framework/element-define.d.ts +440 -440
  27. package/med_editor/framework/element-event-define.d.ts +102 -102
  28. package/med_editor/framework/element-props.d.ts +344 -344
  29. package/med_editor/framework/element-reader.d.ts +20 -20
  30. package/med_editor/framework/element-serialize.d.ts +39 -39
  31. package/med_editor/framework/element-type-handler.d.ts +8 -8
  32. package/med_editor/framework/history/element-trace-manage.d.ts +107 -107
  33. package/med_editor/framework/history/element-trace-tracking.d.ts +89 -89
  34. package/med_editor/framework/impl/checkbox/checkbox-impl.d.ts +19 -19
  35. package/med_editor/framework/impl/comments/comment-content-impl.d.ts +39 -39
  36. package/med_editor/framework/impl/comments/comment-element-impl.d.ts +24 -24
  37. package/med_editor/framework/impl/comments/comments-container-impl.d.ts +19 -19
  38. package/med_editor/framework/impl/comments/validate-msg-impl.d.ts +19 -19
  39. package/med_editor/framework/impl/data-element/data-container-impl.d.ts +25 -25
  40. package/med_editor/framework/impl/data-element/data-decorate-impl.d.ts +16 -16
  41. package/med_editor/framework/impl/data-element/data-element-barcode.d.ts +32 -32
  42. package/med_editor/framework/impl/data-element/data-element-base-impl.d.ts +122 -122
  43. package/med_editor/framework/impl/data-element/data-element-check-impl.d.ts +26 -26
  44. package/med_editor/framework/impl/data-element/data-element-date-impl.d.ts +23 -23
  45. package/med_editor/framework/impl/data-element/data-element-group-impl.d.ts +28 -28
  46. package/med_editor/framework/impl/data-element/data-element-image-impl.d.ts +23 -23
  47. package/med_editor/framework/impl/data-element/data-element-list-impl.d.ts +21 -21
  48. package/med_editor/framework/impl/data-element/data-element-text-impl.d.ts +22 -22
  49. package/med_editor/framework/impl/data-element/qrcode.d.ts +93 -93
  50. package/med_editor/framework/impl/decorate/fill-null-space-imple.d.ts +16 -16
  51. package/med_editor/framework/impl/document/doc-body-impl.d.ts +19 -19
  52. package/med_editor/framework/impl/document/doc-body-part-impl.d.ts +22 -22
  53. package/med_editor/framework/impl/document/doc-container-impl.d.ts +7 -7
  54. package/med_editor/framework/impl/document/doc-footer-impl.d.ts +19 -19
  55. package/med_editor/framework/impl/document/doc-header-impl.d.ts +19 -19
  56. package/med_editor/framework/impl/document/doc-impl.d.ts +85 -85
  57. package/med_editor/framework/impl/index.d.ts +41 -41
  58. package/med_editor/framework/impl/media-formula/menstrual-history.d.ts +31 -31
  59. package/med_editor/framework/impl/media-formula/permanent-teeth.d.ts +34 -34
  60. package/med_editor/framework/impl/paragraph/p-impl.d.ts +38 -38
  61. package/med_editor/framework/impl/picture/RectEle.d.ts +44 -44
  62. package/med_editor/framework/impl/picture/image-impl.d.ts +24 -24
  63. package/med_editor/framework/impl/radio/radio-impl.d.ts +17 -17
  64. package/med_editor/framework/impl/shape/line-impl.d.ts +31 -31
  65. package/med_editor/framework/impl/svg/svg-impl.d.ts +20 -20
  66. package/med_editor/framework/impl/symbol/br-symbol-impl.d.ts +18 -18
  67. package/med_editor/framework/impl/symbol/p-symbol-impl.d.ts +16 -16
  68. package/med_editor/framework/impl/symbol/page-br-symbol-impl.d.ts +20 -20
  69. package/med_editor/framework/impl/symbol/tab-symbol-impl.d.ts +15 -15
  70. package/med_editor/framework/impl/table/table-cell-impl.d.ts +34 -34
  71. package/med_editor/framework/impl/table/table-impl.d.ts +49 -49
  72. package/med_editor/framework/impl/table/table-row-impl.d.ts +27 -27
  73. package/med_editor/framework/impl/table/table-split-cell-patch.d.ts +20 -20
  74. package/med_editor/framework/impl/table/table-split-cell.d.ts +93 -93
  75. package/med_editor/framework/impl/table/table-util.d.ts +180 -180
  76. package/med_editor/framework/impl/text/text-impl.d.ts +34 -34
  77. package/med_editor/framework/impl/text/track-run-impl.d.ts +27 -27
  78. package/med_editor/framework/infrastructure/event-subject.d.ts +57 -57
  79. package/med_editor/framework/infrastructure/notify.d.ts +13 -13
  80. package/med_editor/framework/print/document-print-offscreen.d.ts +59 -59
  81. package/med_editor/framework/print/document-print.d.ts +19 -19
  82. package/med_editor/framework/render-context.d.ts +111 -111
  83. package/med_editor/framework/render-define.d.ts +169 -169
  84. package/med_editor/framework/search/search-panel.d.ts +31 -31
  85. package/med_editor/framework/selection/document-selection.d.ts +92 -92
  86. package/med_editor/framework/selection/range-util.d.ts +36 -36
  87. package/med_editor/framework/selection/selection-overlays.d.ts +36 -36
  88. package/med_editor/framework/suggestions/input-suggestions.d.ts +29 -29
  89. package/med_editor/framework/util/adjust-viewport-elements.d.ts +12 -12
  90. package/med_editor/framework/util/common-util.d.ts +78 -78
  91. package/med_editor/framework/util/document-segmenter.d.ts +2 -2
  92. package/med_editor/framework/util/element-util.d.ts +417 -417
  93. package/med_editor/framework/vnode/editor-calendar-vnode.d.ts +44 -44
  94. package/med_editor/framework/vnode/editor-list-vnode.d.ts +18 -18
  95. package/package.json +18 -18
@@ -1,174 +1,174 @@
1
- import { SelectionState } from "./framework/selection/document-selection";
2
- import { ViewOptions } from "./framework/element-define";
3
- import { EditorContext } from "./framework/document-context";
4
- import { IVNodeRenderFunc } from "./editor-core";
5
- interface RuleOptions {
6
- width: number;
7
- pagePL: number;
8
- pagePR: number;
9
- docLeft: number;
10
- }
11
- export declare class DocRule {
12
- private docCtx;
13
- private options;
14
- private ruleHeight;
15
- private thumbWidth;
16
- private thumbX;
17
- private mouseDownPos;
18
- private mouseDownThumbType;
19
- viewOptions: ViewOptions;
20
- ss: SelectionState;
21
- constructor(docCtx: EditorContext);
22
- destroy(): void;
23
- setRuleOptions(options: RuleOptions): void;
24
- refreshRuleSvg(): IVNodeRenderFunc;
25
- getRuleSVG(): any;
26
- private getRuleMarksPos;
27
- private getCurrPara;
28
- private drawCellMark;
29
- /**
30
- * 绘制首行缩进thumb
31
- * @returns
32
- */
33
- createTopThumb(): {
34
- sel: string;
35
- data: {
36
- on: {
37
- mousedown: (evt: any) => void;
38
- };
39
- style: {
40
- left: string;
41
- };
42
- };
43
- children: {
44
- sel: string;
45
- data: {};
46
- children: {
47
- sel: string;
48
- data: {
49
- ns: string;
50
- attrs: {
51
- width: number;
52
- height: number;
53
- viewBox: string;
54
- fill: string;
55
- "stroke-width": number;
56
- };
57
- };
58
- children: ({
59
- sel: string;
60
- data: {
61
- ns: string;
62
- attrs: {
63
- stroke: string;
64
- fill: string;
65
- };
66
- };
67
- children: {
68
- sel: string;
69
- data: {
70
- ns: string;
71
- attrs: {
72
- d: string;
73
- stroke: string;
74
- };
75
- };
76
- }[];
77
- } | {
78
- sel: string;
79
- data: {
80
- ns: string;
81
- attrs: {
82
- stroke: string;
83
- fill: string;
84
- };
85
- };
86
- children: {
87
- sel: string;
88
- data: {
89
- ns: string;
90
- attrs: {
91
- d: string;
92
- fill: string;
93
- "vector-effect": string;
94
- };
95
- };
96
- }[];
97
- })[];
98
- }[];
99
- }[];
100
- };
101
- /**
102
- * 绘制悬挂缩进thumb
103
- * @returns
104
- */
105
- createLeftThumb(): {
106
- sel: string;
107
- data: {
108
- on: {
109
- mousedown: (evt: MouseEvent) => void;
110
- };
111
- style: {
112
- left: string;
113
- };
114
- };
115
- children: {
116
- sel: string;
117
- data: {};
118
- children: {
119
- sel: string;
120
- data: {
121
- ns: string;
122
- attrs: {
123
- width: number;
124
- height: number;
125
- viewBox: string;
126
- fill: string;
127
- "stroke-width": number;
128
- };
129
- };
130
- children: ({
131
- sel: string;
132
- data: {
133
- ns: string;
134
- attrs: {
135
- stroke: string;
136
- fill: string;
137
- };
138
- };
139
- children: {
140
- sel: string;
141
- data: {
142
- ns: string;
143
- attrs: {
144
- d: string;
145
- stroke: string;
146
- };
147
- };
148
- }[];
149
- } | {
150
- sel: string;
151
- data: {
152
- ns: string;
153
- attrs: {
154
- stroke: string;
155
- fill: string;
156
- };
157
- };
158
- children: {
159
- sel: string;
160
- data: {
161
- ns: string;
162
- attrs: {
163
- d: string;
164
- fill: string;
165
- "vector-effect": string;
166
- };
167
- };
168
- }[];
169
- })[];
170
- }[];
171
- }[];
172
- };
173
- }
174
- export {};
1
+ import { SelectionState } from "./framework/selection/document-selection";
2
+ import { ViewOptions } from "./framework/element-define";
3
+ import { EditorContext } from "./framework/document-context";
4
+ import { IVNodeRenderFunc } from "./editor-core";
5
+ interface RuleOptions {
6
+ width: number;
7
+ pagePL: number;
8
+ pagePR: number;
9
+ docLeft: number;
10
+ }
11
+ export declare class DocRule {
12
+ private docCtx;
13
+ private options;
14
+ private ruleHeight;
15
+ private thumbWidth;
16
+ private thumbX;
17
+ private mouseDownPos;
18
+ private mouseDownThumbType;
19
+ viewOptions: ViewOptions;
20
+ ss: SelectionState;
21
+ constructor(docCtx: EditorContext);
22
+ destroy(): void;
23
+ setRuleOptions(options: RuleOptions): void;
24
+ refreshRuleSvg(): IVNodeRenderFunc;
25
+ getRuleSVG(): any;
26
+ private getRuleMarksPos;
27
+ private getCurrPara;
28
+ private drawCellMark;
29
+ /**
30
+ * 绘制首行缩进thumb
31
+ * @returns
32
+ */
33
+ createTopThumb(): {
34
+ sel: string;
35
+ data: {
36
+ on: {
37
+ mousedown: (evt: any) => void;
38
+ };
39
+ style: {
40
+ left: string;
41
+ };
42
+ };
43
+ children: {
44
+ sel: string;
45
+ data: {};
46
+ children: {
47
+ sel: string;
48
+ data: {
49
+ ns: string;
50
+ attrs: {
51
+ width: number;
52
+ height: number;
53
+ viewBox: string;
54
+ fill: string;
55
+ "stroke-width": number;
56
+ };
57
+ };
58
+ children: ({
59
+ sel: string;
60
+ data: {
61
+ ns: string;
62
+ attrs: {
63
+ stroke: string;
64
+ fill: string;
65
+ };
66
+ };
67
+ children: {
68
+ sel: string;
69
+ data: {
70
+ ns: string;
71
+ attrs: {
72
+ d: string;
73
+ stroke: string;
74
+ };
75
+ };
76
+ }[];
77
+ } | {
78
+ sel: string;
79
+ data: {
80
+ ns: string;
81
+ attrs: {
82
+ stroke: string;
83
+ fill: string;
84
+ };
85
+ };
86
+ children: {
87
+ sel: string;
88
+ data: {
89
+ ns: string;
90
+ attrs: {
91
+ d: string;
92
+ fill: string;
93
+ "vector-effect": string;
94
+ };
95
+ };
96
+ }[];
97
+ })[];
98
+ }[];
99
+ }[];
100
+ };
101
+ /**
102
+ * 绘制悬挂缩进thumb
103
+ * @returns
104
+ */
105
+ createLeftThumb(): {
106
+ sel: string;
107
+ data: {
108
+ on: {
109
+ mousedown: (evt: MouseEvent) => void;
110
+ };
111
+ style: {
112
+ left: string;
113
+ };
114
+ };
115
+ children: {
116
+ sel: string;
117
+ data: {};
118
+ children: {
119
+ sel: string;
120
+ data: {
121
+ ns: string;
122
+ attrs: {
123
+ width: number;
124
+ height: number;
125
+ viewBox: string;
126
+ fill: string;
127
+ "stroke-width": number;
128
+ };
129
+ };
130
+ children: ({
131
+ sel: string;
132
+ data: {
133
+ ns: string;
134
+ attrs: {
135
+ stroke: string;
136
+ fill: string;
137
+ };
138
+ };
139
+ children: {
140
+ sel: string;
141
+ data: {
142
+ ns: string;
143
+ attrs: {
144
+ d: string;
145
+ stroke: string;
146
+ };
147
+ };
148
+ }[];
149
+ } | {
150
+ sel: string;
151
+ data: {
152
+ ns: string;
153
+ attrs: {
154
+ stroke: string;
155
+ fill: string;
156
+ };
157
+ };
158
+ children: {
159
+ sel: string;
160
+ data: {
161
+ ns: string;
162
+ attrs: {
163
+ d: string;
164
+ fill: string;
165
+ "vector-effect": string;
166
+ };
167
+ };
168
+ }[];
169
+ })[];
170
+ }[];
171
+ }[];
172
+ };
173
+ }
174
+ export {};
@@ -1,18 +1,18 @@
1
- import { EditorVNodeObject } from "./framework/render-define";
2
- import { SelectionState } from "./framework/selection/document-selection";
3
- export declare type IActiveEditorContext = {
4
- onChange: () => void;
5
- emit: (event: string, ...args: any[]) => void;
6
- selectionState: SelectionState;
7
- };
8
- export declare let activeEditorContext: IActiveEditorContext | null;
9
- export declare function setActiveEditorContext(ctx: IActiveEditorContext | null): void;
10
- export declare function getActiveEditorContext(): IActiveEditorContext | null;
11
- export declare type IVNodeRenderFunc = {
12
- render: () => EditorVNodeObject | null;
13
- };
14
- export interface ISignal<T> {
15
- value: T;
16
- onChange: () => void;
17
- }
18
- export declare function createSignal<T>(state: T): ISignal<T>;
1
+ import { EditorVNodeObject } from "./framework/render-define";
2
+ import { SelectionState } from "./framework/selection/document-selection";
3
+ export declare type IActiveEditorContext = {
4
+ onChange: () => void;
5
+ emit: (event: string, ...args: any[]) => void;
6
+ selectionState: SelectionState;
7
+ };
8
+ export declare let activeEditorContext: IActiveEditorContext | null;
9
+ export declare function setActiveEditorContext(ctx: IActiveEditorContext | null): void;
10
+ export declare function getActiveEditorContext(): IActiveEditorContext | null;
11
+ export declare type IVNodeRenderFunc = {
12
+ render: () => EditorVNodeObject | null;
13
+ };
14
+ export interface ISignal<T> {
15
+ value: T;
16
+ onChange: () => void;
17
+ }
18
+ export declare function createSignal<T>(state: T): ISignal<T>;
@@ -1,4 +1,4 @@
1
- import { Node } from "acorn";
2
- export declare function parser(code: string, objects?: Array<string>): string;
3
- export declare function addReturn(code: string): string;
4
- export declare function getCalleeName(node: Node): string;
1
+ import { Node } from "acorn";
2
+ export declare function parser(code: string, objects?: Array<string>): string;
3
+ export declare function addReturn(code: string): string;
4
+ export declare function getCalleeName(node: Node): string;
@@ -1,18 +1,18 @@
1
- import { EditorContext } from "../document-context";
2
- export declare class DocumentEvalFunc {
3
- docCtx: EditorContext;
4
- constructor(docCtx: EditorContext);
5
- scriptsFunc: (() => void) | null;
6
- /**
7
- * 实例化动态脚本
8
- */
9
- initScripts(scripts: string): void;
10
- /**
11
- * 销毁动态脚本实例
12
- */
13
- destroyScripts(): void;
14
- /**
15
- * 触发动态脚本
16
- */
17
- invokedScripts(): void;
18
- }
1
+ import { EditorContext } from "../document-context";
2
+ export declare class DocumentEvalFunc {
3
+ docCtx: EditorContext;
4
+ constructor(docCtx: EditorContext);
5
+ scriptsFunc: (() => void) | null;
6
+ /**
7
+ * 实例化动态脚本
8
+ */
9
+ initScripts(scripts: string): void;
10
+ /**
11
+ * 销毁动态脚本实例
12
+ */
13
+ destroyScripts(): void;
14
+ /**
15
+ * 触发动态脚本
16
+ */
17
+ invokedScripts(): void;
18
+ }
@@ -1,42 +1,42 @@
1
- import { BranchElement, Element, RefCtxValue } from "../element-define";
2
- import { SelectionState } from "../selection/document-selection";
3
- import { DataCheckEleModel, DataInputEleModel, DataLeafEleModel, DocumentContext } from "../document-context";
4
- import { TableElement, TableRowElement } from "../impl";
5
- export declare class DynamicExecute {
6
- doc: BranchElement;
7
- ss: SelectionState;
8
- current?: Element;
9
- depItems?: Map<string, RefCtxValue>;
10
- constructor(doc: BranchElement, ss: SelectionState);
11
- create(): DynamicExecute;
12
- /**
13
- * 设置当前执行上下文
14
- * 一般情况下为document,但是如果为病程录文档,需要设置为当前病程录part
15
- */
16
- setExecuteCtx(parseEle: Element): BranchElement;
17
- setCurrentCtx(ele: Element, depItems: Map<string, RefCtxValue>): void;
18
- clearCurrentCtx(): void;
19
- cacheList: ReturnType<DocumentContext['getDataElementModelList']>;
20
- getControlById(id: string, options?: {
21
- includeChildren: boolean;
22
- }): DataCheckEleModel | DataInputEleModel | DataLeafEleModel | undefined;
23
- getObject(id: string): RefCtxValue;
24
- AVG(fn: () => Array<number | string>): number;
25
- SUM(fn: () => Array<number | string | Array<string>>): number;
26
- MAX(fn: () => Array<number | string>): number;
27
- MIN(fn: () => Array<number | string>): number;
28
- Float(val: any): number;
29
- IF(condition: () => boolean, truePart: VoidFunction, falsePart: VoidFunction): any;
30
- Number(val: any): number;
31
- TableData(tableId: string, startRow: number, startCol: number, endRow: number, endCol: number): Array<string>;
32
- /**
33
- * 获取元素的父表格行元素。
34
- *
35
- */
36
- CtxRow(ele: Element): TableRowElement;
37
- /**
38
- * 获取元素的父表格行元素。
39
- *
40
- */
41
- CtxTable(ele: Element): TableElement;
42
- }
1
+ import { BranchElement, Element, RefCtxValue } from "../element-define";
2
+ import { SelectionState } from "../selection/document-selection";
3
+ import { DataCheckEleModel, DataInputEleModel, DataLeafEleModel, DocumentContext } from "../document-context";
4
+ import { TableElement, TableRowElement } from "../impl";
5
+ export declare class DynamicExecute {
6
+ doc: BranchElement;
7
+ ss: SelectionState;
8
+ current?: Element;
9
+ depItems?: Map<string, RefCtxValue>;
10
+ constructor(doc: BranchElement, ss: SelectionState);
11
+ create(): DynamicExecute;
12
+ /**
13
+ * 设置当前执行上下文
14
+ * 一般情况下为document,但是如果为病程录文档,需要设置为当前病程录part
15
+ */
16
+ setExecuteCtx(parseEle: Element): BranchElement;
17
+ setCurrentCtx(ele: Element, depItems: Map<string, RefCtxValue>): void;
18
+ clearCurrentCtx(): void;
19
+ cacheList: ReturnType<DocumentContext['getDataElementModelList']>;
20
+ getControlById(id: string, options?: {
21
+ includeChildren: boolean;
22
+ }): DataCheckEleModel | DataInputEleModel | DataLeafEleModel | undefined;
23
+ getObject(id: string): RefCtxValue;
24
+ AVG(fn: () => Array<number | string>): number;
25
+ SUM(fn: () => Array<number | string | Array<string>>): number;
26
+ MAX(fn: () => Array<number | string>): number;
27
+ MIN(fn: () => Array<number | string>): number;
28
+ Float(val: any): number;
29
+ IF(condition: () => boolean, truePart: VoidFunction, falsePart: VoidFunction): any;
30
+ Number(val: any): number;
31
+ TableData(tableId: string, startRow: number, startCol: number, endRow: number, endCol: number): Array<string>;
32
+ /**
33
+ * 获取元素的父表格行元素。
34
+ *
35
+ */
36
+ CtxRow(ele: Element): TableRowElement;
37
+ /**
38
+ * 获取元素的父表格行元素。
39
+ *
40
+ */
41
+ CtxTable(ele: Element): TableElement;
42
+ }