@hailin-zheng/editor-core 1.0.1 → 1.0.5

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 (216) hide show
  1. package/package.json +1 -1
  2. package/tsconfig.json +1 -1
  3. package/webpack.config.js +0 -1
  4. package/dist/doc-ruler.d.ts +0 -51
  5. package/dist/doc-ruler.js +0 -313
  6. package/dist/doc-ruler.js.map +0 -1
  7. package/dist/framework/common-util.d.ts +0 -63
  8. package/dist/framework/common-util.js +0 -178
  9. package/dist/framework/common-util.js.map +0 -1
  10. package/dist/framework/document-change.d.ts +0 -265
  11. package/dist/framework/document-change.js +0 -1342
  12. package/dist/framework/document-change.js.map +0 -1
  13. package/dist/framework/document-combine.d.ts +0 -24
  14. package/dist/framework/document-combine.js +0 -40
  15. package/dist/framework/document-combine.js.map +0 -1
  16. package/dist/framework/document-comment.d.ts +0 -46
  17. package/dist/framework/document-comment.js +0 -148
  18. package/dist/framework/document-comment.js.map +0 -1
  19. package/dist/framework/document-context.d.ts +0 -149
  20. package/dist/framework/document-context.js +0 -330
  21. package/dist/framework/document-context.js.map +0 -1
  22. package/dist/framework/document-eval-func.d.ts +0 -18
  23. package/dist/framework/document-eval-func.js +0 -48
  24. package/dist/framework/document-eval-func.js.map +0 -1
  25. package/dist/framework/document-event.d.ts +0 -213
  26. package/dist/framework/document-event.js +0 -1054
  27. package/dist/framework/document-event.js.map +0 -1
  28. package/dist/framework/document-history.d.ts +0 -26
  29. package/dist/framework/document-history.js +0 -65
  30. package/dist/framework/document-history.js.map +0 -1
  31. package/dist/framework/document-images-loader.d.ts +0 -16
  32. package/dist/framework/document-images-loader.js +0 -66
  33. package/dist/framework/document-images-loader.js.map +0 -1
  34. package/dist/framework/document-input-cursor.d.ts +0 -78
  35. package/dist/framework/document-input-cursor.js +0 -239
  36. package/dist/framework/document-input-cursor.js.map +0 -1
  37. package/dist/framework/document-paint.d.ts +0 -34
  38. package/dist/framework/document-paint.js +0 -103
  39. package/dist/framework/document-paint.js.map +0 -1
  40. package/dist/framework/document-print-offscreen.d.ts +0 -38
  41. package/dist/framework/document-print-offscreen.js +0 -128
  42. package/dist/framework/document-print-offscreen.js.map +0 -1
  43. package/dist/framework/document-print.d.ts +0 -60
  44. package/dist/framework/document-print.js +0 -203
  45. package/dist/framework/document-print.js.map +0 -1
  46. package/dist/framework/document-segmenter.d.ts +0 -2
  47. package/dist/framework/document-segmenter.js +0 -106
  48. package/dist/framework/document-segmenter.js.map +0 -1
  49. package/dist/framework/document-selection.d.ts +0 -89
  50. package/dist/framework/document-selection.js +0 -358
  51. package/dist/framework/document-selection.js.map +0 -1
  52. package/dist/framework/document-template.d.ts +0 -4
  53. package/dist/framework/document-template.js +0 -20
  54. package/dist/framework/document-template.js.map +0 -1
  55. package/dist/framework/document-textline-mode.d.ts +0 -7
  56. package/dist/framework/document-textline-mode.js +0 -30
  57. package/dist/framework/document-textline-mode.js.map +0 -1
  58. package/dist/framework/element-define.d.ts +0 -319
  59. package/dist/framework/element-define.js +0 -579
  60. package/dist/framework/element-define.js.map +0 -1
  61. package/dist/framework/element-event-define.d.ts +0 -99
  62. package/dist/framework/element-event-define.js +0 -108
  63. package/dist/framework/element-event-define.js.map +0 -1
  64. package/dist/framework/element-measure.d.ts +0 -97
  65. package/dist/framework/element-measure.js +0 -551
  66. package/dist/framework/element-measure.js.map +0 -1
  67. package/dist/framework/element-paint.d.ts +0 -42
  68. package/dist/framework/element-paint.js +0 -170
  69. package/dist/framework/element-paint.js.map +0 -1
  70. package/dist/framework/element-props.d.ts +0 -301
  71. package/dist/framework/element-props.js +0 -809
  72. package/dist/framework/element-props.js.map +0 -1
  73. package/dist/framework/element-reader.d.ts +0 -19
  74. package/dist/framework/element-reader.js +0 -151
  75. package/dist/framework/element-reader.js.map +0 -1
  76. package/dist/framework/element-render-cut.d.ts +0 -55
  77. package/dist/framework/element-render-cut.js +0 -449
  78. package/dist/framework/element-render-cut.js.map +0 -1
  79. package/dist/framework/element-serialize.d.ts +0 -30
  80. package/dist/framework/element-serialize.js +0 -113
  81. package/dist/framework/element-serialize.js.map +0 -1
  82. package/dist/framework/element-util.d.ts +0 -369
  83. package/dist/framework/element-util.js +0 -1463
  84. package/dist/framework/element-util.js.map +0 -1
  85. package/dist/framework/impl/checkbox/checkbox-impl.d.ts +0 -24
  86. package/dist/framework/impl/checkbox/checkbox-impl.js +0 -64
  87. package/dist/framework/impl/checkbox/checkbox-impl.js.map +0 -1
  88. package/dist/framework/impl/comments/comment-content-impl.d.ts +0 -40
  89. package/dist/framework/impl/comments/comment-content-impl.js +0 -105
  90. package/dist/framework/impl/comments/comment-content-impl.js.map +0 -1
  91. package/dist/framework/impl/comments/comment-element-impl.d.ts +0 -21
  92. package/dist/framework/impl/comments/comment-element-impl.js +0 -62
  93. package/dist/framework/impl/comments/comment-element-impl.js.map +0 -1
  94. package/dist/framework/impl/comments/comments-container-impl.d.ts +0 -22
  95. package/dist/framework/impl/comments/comments-container-impl.js +0 -62
  96. package/dist/framework/impl/comments/comments-container-impl.js.map +0 -1
  97. package/dist/framework/impl/comments/comments-util.d.ts +0 -12
  98. package/dist/framework/impl/comments/comments-util.js +0 -67
  99. package/dist/framework/impl/comments/comments-util.js.map +0 -1
  100. package/dist/framework/impl/comments/validate-msg-impl.d.ts +0 -21
  101. package/dist/framework/impl/comments/validate-msg-impl.js +0 -83
  102. package/dist/framework/impl/comments/validate-msg-impl.js.map +0 -1
  103. package/dist/framework/impl/data-element/data-decorate-impl.d.ts +0 -30
  104. package/dist/framework/impl/data-element/data-decorate-impl.js +0 -91
  105. package/dist/framework/impl/data-element/data-decorate-impl.js.map +0 -1
  106. package/dist/framework/impl/data-element/data-element-barcode.d.ts +0 -31
  107. package/dist/framework/impl/data-element/data-element-barcode.js +0 -115
  108. package/dist/framework/impl/data-element/data-element-barcode.js.map +0 -1
  109. package/dist/framework/impl/data-element/data-element-base-impl.d.ts +0 -68
  110. package/dist/framework/impl/data-element/data-element-base-impl.js +0 -205
  111. package/dist/framework/impl/data-element/data-element-base-impl.js.map +0 -1
  112. package/dist/framework/impl/data-element/data-element-check-impl.d.ts +0 -35
  113. package/dist/framework/impl/data-element/data-element-check-impl.js +0 -133
  114. package/dist/framework/impl/data-element/data-element-check-impl.js.map +0 -1
  115. package/dist/framework/impl/data-element/data-element-date-impl.d.ts +0 -23
  116. package/dist/framework/impl/data-element/data-element-date-impl.js +0 -111
  117. package/dist/framework/impl/data-element/data-element-date-impl.js.map +0 -1
  118. package/dist/framework/impl/data-element/data-element-group-impl.d.ts +0 -23
  119. package/dist/framework/impl/data-element/data-element-group-impl.js +0 -130
  120. package/dist/framework/impl/data-element/data-element-group-impl.js.map +0 -1
  121. package/dist/framework/impl/data-element/data-element-image-impl.d.ts +0 -30
  122. package/dist/framework/impl/data-element/data-element-image-impl.js +0 -137
  123. package/dist/framework/impl/data-element/data-element-image-impl.js.map +0 -1
  124. package/dist/framework/impl/data-element/data-element-list-impl.d.ts +0 -22
  125. package/dist/framework/impl/data-element/data-element-list-impl.js +0 -131
  126. package/dist/framework/impl/data-element/data-element-list-impl.js.map +0 -1
  127. package/dist/framework/impl/data-element/data-element-text-impl.d.ts +0 -23
  128. package/dist/framework/impl/data-element/data-element-text-impl.js +0 -103
  129. package/dist/framework/impl/data-element/data-element-text-impl.js.map +0 -1
  130. package/dist/framework/impl/decorate/fill-null-space-imple.d.ts +0 -21
  131. package/dist/framework/impl/decorate/fill-null-space-imple.js +0 -43
  132. package/dist/framework/impl/decorate/fill-null-space-imple.js.map +0 -1
  133. package/dist/framework/impl/document/doc-body-impl.d.ts +0 -27
  134. package/dist/framework/impl/document/doc-body-impl.js +0 -79
  135. package/dist/framework/impl/document/doc-body-impl.js.map +0 -1
  136. package/dist/framework/impl/document/doc-body-part-impl.d.ts +0 -30
  137. package/dist/framework/impl/document/doc-body-part-impl.js +0 -94
  138. package/dist/framework/impl/document/doc-body-part-impl.js.map +0 -1
  139. package/dist/framework/impl/document/doc-container-impl.d.ts +0 -16
  140. package/dist/framework/impl/document/doc-container-impl.js +0 -21
  141. package/dist/framework/impl/document/doc-container-impl.js.map +0 -1
  142. package/dist/framework/impl/document/doc-footer-impl.d.ts +0 -26
  143. package/dist/framework/impl/document/doc-footer-impl.js +0 -77
  144. package/dist/framework/impl/document/doc-footer-impl.js.map +0 -1
  145. package/dist/framework/impl/document/doc-header-impl.d.ts +0 -26
  146. package/dist/framework/impl/document/doc-header-impl.js +0 -83
  147. package/dist/framework/impl/document/doc-header-impl.js.map +0 -1
  148. package/dist/framework/impl/document/doc-impl.d.ts +0 -61
  149. package/dist/framework/impl/document/doc-impl.js +0 -209
  150. package/dist/framework/impl/document/doc-impl.js.map +0 -1
  151. package/dist/framework/impl/media-formula/menstrual-history.d.ts +0 -35
  152. package/dist/framework/impl/media-formula/menstrual-history.js +0 -153
  153. package/dist/framework/impl/media-formula/menstrual-history.js.map +0 -1
  154. package/dist/framework/impl/paragraph/p-impl.d.ts +0 -45
  155. package/dist/framework/impl/paragraph/p-impl.js +0 -156
  156. package/dist/framework/impl/paragraph/p-impl.js.map +0 -1
  157. package/dist/framework/impl/picture/image-impl.d.ts +0 -31
  158. package/dist/framework/impl/picture/image-impl.js +0 -124
  159. package/dist/framework/impl/picture/image-impl.js.map +0 -1
  160. package/dist/framework/impl/radio/radio-impl.d.ts +0 -22
  161. package/dist/framework/impl/radio/radio-impl.js +0 -72
  162. package/dist/framework/impl/radio/radio-impl.js.map +0 -1
  163. package/dist/framework/impl/symbol/br-symbol-impl.d.ts +0 -22
  164. package/dist/framework/impl/symbol/br-symbol-impl.js +0 -54
  165. package/dist/framework/impl/symbol/br-symbol-impl.js.map +0 -1
  166. package/dist/framework/impl/symbol/p-symbol-impl.d.ts +0 -19
  167. package/dist/framework/impl/symbol/p-symbol-impl.js +0 -54
  168. package/dist/framework/impl/symbol/p-symbol-impl.js.map +0 -1
  169. package/dist/framework/impl/table/table-cell-impl.d.ts +0 -37
  170. package/dist/framework/impl/table/table-cell-impl.js +0 -145
  171. package/dist/framework/impl/table/table-cell-impl.js.map +0 -1
  172. package/dist/framework/impl/table/table-impl.d.ts +0 -55
  173. package/dist/framework/impl/table/table-impl.js +0 -363
  174. package/dist/framework/impl/table/table-impl.js.map +0 -1
  175. package/dist/framework/impl/table/table-row-impl.d.ts +0 -26
  176. package/dist/framework/impl/table/table-row-impl.js +0 -75
  177. package/dist/framework/impl/table/table-row-impl.js.map +0 -1
  178. package/dist/framework/impl/table/table-split-cell-patch.d.ts +0 -20
  179. package/dist/framework/impl/table/table-split-cell-patch.js +0 -89
  180. package/dist/framework/impl/table/table-split-cell-patch.js.map +0 -1
  181. package/dist/framework/impl/table/table-split-cell.d.ts +0 -90
  182. package/dist/framework/impl/table/table-split-cell.js +0 -464
  183. package/dist/framework/impl/table/table-split-cell.js.map +0 -1
  184. package/dist/framework/impl/table/table-util.d.ts +0 -150
  185. package/dist/framework/impl/table/table-util.js +0 -678
  186. package/dist/framework/impl/table/table-util.js.map +0 -1
  187. package/dist/framework/impl/text/text-impl.d.ts +0 -32
  188. package/dist/framework/impl/text/text-impl.js +0 -149
  189. package/dist/framework/impl/text/text-impl.js.map +0 -1
  190. package/dist/framework/impl/text/track-run-impl.d.ts +0 -27
  191. package/dist/framework/impl/text/track-run-impl.js +0 -112
  192. package/dist/framework/impl/text/track-run-impl.js.map +0 -1
  193. package/dist/framework/notify.d.ts +0 -13
  194. package/dist/framework/notify.js +0 -116
  195. package/dist/framework/notify.js.map +0 -1
  196. package/dist/framework/range-util.d.ts +0 -40
  197. package/dist/framework/range-util.js +0 -312
  198. package/dist/framework/range-util.js.map +0 -1
  199. package/dist/framework/render-context.d.ts +0 -91
  200. package/dist/framework/render-context.js +0 -384
  201. package/dist/framework/render-context.js.map +0 -1
  202. package/dist/framework/render-define.d.ts +0 -109
  203. package/dist/framework/render-define.js +0 -195
  204. package/dist/framework/render-define.js.map +0 -1
  205. package/dist/framework/selection-overlays.d.ts +0 -30
  206. package/dist/framework/selection-overlays.js +0 -124
  207. package/dist/framework/selection-overlays.js.map +0 -1
  208. package/dist/texteditor.d.ts +0 -318
  209. package/dist/texteditor.js +0 -913
  210. package/dist/texteditor.js.map +0 -1
  211. package/dist/util/subject.d.ts +0 -34
  212. package/dist/util/subject.js +0 -88
  213. package/dist/util/subject.js.map +0 -1
  214. package/dist/util/table-bind.d.ts +0 -5
  215. package/dist/util/table-bind.js +0 -6
  216. package/dist/util/table-bind.js.map +0 -1
@@ -1,369 +0,0 @@
1
- import { EditorContext } from "./document-context";
2
- import { BlockContainerElement, BranchElement, Element, LeafElement, Position, Rect, SelectionContentRange, ViewOptions } from "./element-define";
3
- import { HitRegion } from "./element-event-define";
4
- import { DataEleBaseProps, TextProps } from "./element-props";
5
- import { DataElementInlineGroup } from "./impl/data-element/data-element-base-impl";
6
- import { ParagraphElement, ParagraphLineRectRenderObject } from "./impl/paragraph/p-impl";
7
- import { TableCellRenderObject } from "./impl/table/table-cell-impl";
8
- import { TableElement, TableRenderObject } from "./impl/table/table-impl";
9
- import { TableRowRenderObject } from "./impl/table/table-row-impl";
10
- import { TextGroupElement, TextGroupRenderObject } from "./impl/text/text-impl";
11
- import { TrackRunElement, TrackRunTypeEnum } from "./impl/text/track-run-impl";
12
- import { BlockContainerRenderObject, BlockContentRenderObject, BorderType, BranchRenderObject, CursorType, InlineGroupRenderObject, LeafRenderObject, RenderObject } from "./render-define";
13
- declare type PAIR = {
14
- x: number;
15
- y: number;
16
- };
17
- export declare class ElementUtil {
18
- static setCanvasProps(canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D, viewOptions: {
19
- width: number;
20
- height: number;
21
- }, scale?: number): void;
22
- static getDprNumber(val: number, scale?: number): number;
23
- static readTextProps(dest: TextProps | null, props: TextProps | undefined, options: ViewOptions): TextProps;
24
- static readEleBaseProps(dest: DataEleBaseProps, props: DataEleBaseProps): DataEleBaseProps;
25
- /**
26
- * 获取内容区域最大高度
27
- * @param render
28
- * @param renderHeight
29
- * @returns
30
- */
31
- static innerRectMaxHeight(render: RenderObject, renderHeight: number): number;
32
- /**
33
- * 根据内框内容高度,更新外框框体高度
34
- * @param render
35
- * @param innerRect
36
- */
37
- static updateRenderHeightByInnerRect(render: RenderObject, innerRect: Rect): void;
38
- /**
39
- * 设置块级元素限制尺寸
40
- * @param render
41
- * @param parentLimitRect
42
- */
43
- static setBlockElementLimitSize(render: BlockContainerRenderObject | BlockContentRenderObject, parentLimitRect: Rect): void;
44
- /**
45
- * 克隆框体
46
- * @param rect
47
- * @returns
48
- */
49
- static cloneRect(rect: Rect): Rect;
50
- /**
51
- * 重新限定子元素以及当前高度值,并返回内边框内容高度
52
- * @param render
53
- * @param resetX 测量段落外框时,内框不需要重置x,因为内框已经存在对齐
54
- * @returns
55
- */
56
- static remeasure(render: BlockContainerRenderObject | BlockContentRenderObject, resetX?: boolean): number;
57
- static remeasureTableRow(rowRender: TableRowRenderObject, foreceColIndex?: number): number;
58
- /**
59
- * 获取表格行绘制元素的内容高度,用于缩放行高度时,获取最小内容高度,缩放的高度不能小于内容最小高度
60
- */
61
- static getTableRowRenderContentHeight(rowRender: TableRowRenderObject): number;
62
- /**
63
- * 获取单元格内容高度
64
- * 单元格暂不处理上下margin、padding
65
- * @param cellRender
66
- * @returns
67
- */
68
- static getTableCellRenderContentHeight(cellRender: TableCellRenderObject): number;
69
- /**
70
- * 处理单元格内容纵向对齐
71
- * @param render
72
- */
73
- private static measureCellVAlign;
74
- /**
75
- * 重新测量合并单元格高度
76
- * @param tbRender
77
- * @returns
78
- */
79
- static remeasureTableMerge(tbRender: TableRenderObject): void;
80
- /**
81
- * 获取向下纵向合并的行
82
- * @param render
83
- * @param rowIndex
84
- * @param colIndex
85
- * @returns
86
- */
87
- private static getContinueVMergeRenderRows;
88
- /**
89
- * 根据横向当前被合并的单元格
90
- * @param tb
91
- * @param rowIndex
92
- * @param colIndex
93
- */
94
- static getHorizontalRestartCellIndex(tb: TableElement, rowIndex: number, colIndex: number): number;
95
- /**
96
- * 根据横向当前被合并的单元格
97
- * @param tb
98
- * @param rowIndex
99
- * @param colIndex
100
- */
101
- static getVerticalRestartCellIndex(tb: TableElement, rowIndex: number, colIndex: number): number;
102
- /**
103
- * 获取合并单元格主单元格
104
- * @param tb
105
- * @param rowIndex
106
- * @param colIndex
107
- * @returns
108
- */
109
- static getRestartCellPosition(tb: TableElement, rowIndex: number, colIndex: number): {
110
- rowIndex: number;
111
- colIndex: number;
112
- };
113
- /**
114
- * 调整单元格高度填满整个行的高度
115
- */
116
- private static resizeCellToFillRow;
117
- /**
118
- * 获取元素的全局索引位置
119
- * @param control
120
- * @returns
121
- */
122
- static getControlIndex(control: Element): number;
123
- /**
124
- * 根据全局索引位置获取元素
125
- * @param control
126
- * @param counter
127
- * @returns
128
- */
129
- static getControlByIndex(control: Element, counter: {
130
- currIndex: number;
131
- index: number;
132
- }): Element | null;
133
- /**
134
- * 获取同级紧挨前方的兄弟元素
135
- * @param element
136
- * @returns
137
- */
138
- static getPrevSiblingElement(element: Element): Element | null;
139
- /**
140
- * 获取同级紧挨下方的元素
141
- * @param element
142
- * @returns
143
- */
144
- static getNextSiblingElement(element: Element): Element | null;
145
- static getNextSiblingTrackElement(element: Element, type: TrackRunTypeEnum, userId: string): TrackRunElement | null;
146
- static getPrevSiblingTrackElement(element: Element, type: TrackRunTypeEnum, userId: string): TrackRunElement | null;
147
- /**
148
- * 根据默认配置创建长文本
149
- * @param viewOptions
150
- * @returns
151
- */
152
- static getNewTextGroup(textProps: TextProps): TextGroupElement;
153
- static createTextProps(dest: TextProps | null, viewOptions: ViewOptions): TextProps;
154
- /**
155
- * 获取容器内的最小渲染元素集合
156
- * @param parPos
157
- * @param array
158
- */
159
- static getAvailHitLeafRenderObjects(render: RenderObject, parPos: Position): Array<{
160
- render: LeafRenderObject;
161
- rect: Rect;
162
- }>;
163
- /**
164
- * 获取容器内的最小渲染元素集合
165
- * @param parPos
166
- * @param array
167
- */
168
- static getAvailHitRenderObjects(render: RenderObject, parPos: Position): Array<{
169
- render: RenderObject;
170
- rect: Rect;
171
- }>;
172
- /**
173
- * 获取绘制元素的绝对位置框
174
- */
175
- static getRenderObjectAbsoluteRect(render: RenderObject, parPos: Position): Rect;
176
- /**
177
- * 检查当前绘制元素是否属于有效点击元素
178
- */
179
- static checkAvailHitRender(render: RenderObject): boolean;
180
- /**
181
- * 验证点击可操作性
182
- * 主要限制页眉页脚的编辑模式
183
- */
184
- static verifyHitable(sourceElement: LeafElement | null | undefined): boolean;
185
- /**
186
- * 获取一个点到一个矩形最短的距离
187
- * @param rect
188
- * @param p
189
- * @returns
190
- */
191
- static getDistanceToRect(rect: Rect, p: Position): number;
192
- static minDistance(A: PAIR, B: PAIR, E: PAIR): number;
193
- /**
194
- * 获取父级层级渲染对象
195
- * @param render
196
- * @returns
197
- */
198
- static getParentRenders(render: RenderObject): Array<RenderObject>;
199
- static getRenderMapElements(render: RenderObject): Array<Element>;
200
- static getParentRender<T extends BranchRenderObject>(child: RenderObject, parentType: {
201
- new (...args: any): T;
202
- }): T | null;
203
- static getParentRenderByPredicate(child: RenderObject, predicate: (item: RenderObject) => boolean): RenderObject | null;
204
- /**
205
- * 获取父级层级元素对象
206
- * @param element
207
- * @returns
208
- */
209
- static getParentElements(element: Element | null | undefined): Array<Element>;
210
- /**
211
- * 获取最后一个子元素
212
- * @param element
213
- * @returns
214
- */
215
- static getLastLeafElement(element: Element, predicate?: null | ((item: Element) => boolean)): LeafElement | null;
216
- /**
217
- * 获取第一个子元素
218
- * @param element
219
- * @returns
220
- */
221
- static getFirstLeafElement(element: Element): LeafElement | null;
222
- /**
223
- * 校验两个元素是否在同一个段落中
224
- * @param element1
225
- * @param element2
226
- */
227
- static isInSameParagraph(element1: Element, element2: Element): boolean;
228
- static getBorderCursor(borderType: BorderType): CursorType;
229
- static getParentByType<P extends Element, T>(child: P | null, parentType: {
230
- new (...args: any): T;
231
- }): T | null;
232
- static getParent(child: Element | null, predicate: (item: Element) => boolean): Element | null;
233
- /**
234
- * 修正段落内容
235
- * @returns
236
- */
237
- static fixParagraphContent(control: ParagraphElement): void;
238
- /**
239
- * 修正块级容器内容
240
- * @param control
241
- */
242
- static fixBlockContainer(control: BlockContainerElement): void;
243
- /**
244
- * 获取绘制元素相对于整个画布的绝对位置
245
- * 整个画布绘制的时候不一定从x=0,y=0时绘制的,下拉滚动时,上面从负y坐标开始绘制
246
- * 如果计算某个元素相对画布的左上角的绝对坐标位置,需要childPos的y值减去translateY
247
- * @param render
248
- * @param refPos 参照位置
249
- * @returns
250
- */
251
- static getRenderAbsolutePaintPos(render: RenderObject, refPos?: Position | null): Position;
252
- static getRenderAbsolutePaintRect(render: RenderObject, childPos?: Position | null): Rect;
253
- /**
254
- * 获取选中区域的开始区域
255
- * @param range
256
- * @returns
257
- */
258
- static getFirstSelectedRange(range: SelectionContentRange): SelectionContentRange;
259
- /**
260
- * 获取选中区域的开始区域
261
- * @param range \
262
- * @returns
263
- */
264
- static getLastSelectedRange(range: SelectionContentRange): SelectionContentRange;
265
- /**
266
- * 克隆选区内容
267
- * @param range
268
- * @param isDelete
269
- * @returns
270
- */
271
- static cloneRange(range: SelectionContentRange, isDelete: boolean, cloneMode?: 'clone' | 'source' | 'copy'): Element | null;
272
- /**
273
- * 获取所有的子级元素
274
- * @param branchEle
275
- * @returns
276
- */
277
- static getChildrenElements(branchEle: BranchElement): Array<Element>;
278
- /**
279
- * 递归向前寻找最近的元素
280
- * @param currElement
281
- * @param inPara 是否在同一段落中寻找
282
- * @param forCursor 查找结果是否用于光标定位
283
- * @returns
284
- */
285
- static getRecursionPrevSiblingElement(currElement: Element | null, inPara?: boolean, forCursor?: boolean): LeafElement | null;
286
- /**
287
- * 循环向前寻找可定位的数据元
288
- * @param currElement
289
- */
290
- static getPrevDataElement(ctx: EditorContext, currElement: DataElementInlineGroup): DataElementInlineGroup | null;
291
- /**
292
- * 递归向后寻找最近的元素
293
- */
294
- static getRecursionNextSiblingElement(currElement: Element | null, inPara?: boolean, forCursor?: boolean): LeafElement | null;
295
- /**
296
- * 获取行内最大渲染单元格高度,主要处理纵向合并单元格问题
297
- * @param row
298
- * @returns
299
- */
300
- static getRowMaxCellHeight(row: TableRowRenderObject): number;
301
- /**
302
- * 校验是否为空内容
303
- * @param ele
304
- */
305
- static checkEmptyContent(ele: BranchRenderObject): boolean;
306
- /**
307
- * 测量行内编组元素
308
- * @param render
309
- */
310
- static remeasureInlineGroupRender(render: InlineGroupRenderObject): void;
311
- static getParaLinePos(childRender: RenderObject, childRenderPos: Position): Rect;
312
- static getParentRenderPos(parentRender: RenderObject, childRender: RenderObject, childRenderPos: Position): Rect;
313
- /**
314
- * 获取绘制元素所在的区域
315
- */
316
- static getRenderObjectRegion(render: RenderObject): HitRegion | undefined;
317
- /**
318
- * 获取文档元素所在的区域
319
- * @param element
320
- * @returns
321
- */
322
- static getElementRegion(element: Element): HitRegion | undefined;
323
- static getElementRegionTarget(element: Element | null): {
324
- type: HitRegion;
325
- target: BranchElement;
326
- } | null;
327
- /**
328
- * 根据坐标系统偏移位获取所在的文本偏移位置
329
- * @param textRender
330
- * @param x
331
- * @returns
332
- */
333
- static getTextRenderOffset(textRender: TextGroupRenderObject, x: number): number;
334
- static getHitRenderOffset(render: LeafRenderObject, x: number): number;
335
- static getTextRenderHorX(currRender: TextGroupRenderObject, startOffset: number, endOffset: number): {
336
- startX: number;
337
- endX: number;
338
- };
339
- /**
340
- * 获取一个元素结尾偏移量
341
- * 文本以字符长度进行确定
342
- * @param ele
343
- * @returns
344
- */
345
- static getElementEndOffset(ele: LeafElement): number;
346
- /**
347
- * 判断当前偏移量是否是最终偏移量
348
- * @param ele
349
- * @param offset
350
- */
351
- static isElementEndOffset(ele: LeafElement, offset: number): boolean;
352
- /**
353
- * 获取直接子节点的所有渲染元素
354
- * @param ele
355
- * @returns
356
- */
357
- static getChildRenders<T extends RenderObject>(ele: BranchRenderObject): Array<T>;
358
- /**
359
- * 获取当前单元格内所有的段落行
360
- * @param cell
361
- * @returns
362
- */
363
- static getCellParaLines(cell: TableCellRenderObject): Array<ParagraphLineRectRenderObject>;
364
- static getRandomColor(seed: number): string;
365
- static getSeedRandom(seed: number): number;
366
- static findChildRender(render: BranchRenderObject, predicate: (child: RenderObject) => boolean): RenderObject | null;
367
- static getDataElement(ele: Element): DataElementInlineGroup;
368
- }
369
- export {};