@hailin-zheng/editor-core 1.0.35 → 1.0.38

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.
@@ -69,8 +69,8 @@ export declare class DocumentEvent {
69
69
  */
70
70
  private getTips;
71
71
  /**
72
- * 滚动视图的时候,需要手动触发mousemove
73
- */
72
+ * 滚动视图的时候,需要手动触发mousemove
73
+ */
74
74
  onScrollView(): void;
75
75
  /**
76
76
  * 处理鼠标按下事件
@@ -156,12 +156,12 @@ export declare class DocumentEvent {
156
156
  */
157
157
  private pubHitInfo;
158
158
  /**
159
- * 获取鼠标所在的渲染元素对象
160
- * @param renderObject
161
- * @param parent
162
- * @param position
163
- * @returns
164
- */
159
+ * 获取鼠标所在的渲染元素对象
160
+ * @param renderObject
161
+ * @param parent
162
+ * @param position
163
+ * @returns
164
+ */
165
165
  private getMouseoverRender;
166
166
  /**
167
167
  * 缩放元素
@@ -195,8 +195,8 @@ export declare class DocumentEvent {
195
195
  */
196
196
  private moveCursorToHomeOrEnd;
197
197
  /**
198
- * 向左移动光标
199
- */
198
+ * 向左移动光标
199
+ */
200
200
  moveCursorToLeft(): void;
201
201
  /**
202
202
  * 向右移动光标
@@ -216,6 +216,7 @@ export declare class PageOptions {
216
216
  set height(value: number);
217
217
  }
218
218
  export declare type OrientType = 'landscape' | 'portrait';
219
+ export declare type PageLayoutMode = 'singlePage' | 'multiPage' | 'fit-page';
219
220
  export declare class ViewOptions {
220
221
  copyRightInfo: string;
221
222
  watermark?: string;
@@ -232,6 +233,8 @@ export declare class ViewOptions {
232
233
  viewBackcolor: string;
233
234
  paraSymbolColor: string;
234
235
  dataGroupColor: string;
236
+ trackInsColor: string;
237
+ trackDelColor: string;
235
238
  showLineRect: boolean;
236
239
  showCharRect: boolean;
237
240
  showParaMark: boolean;
@@ -259,7 +262,7 @@ export declare class ViewOptions {
259
262
  };
260
263
  pageNumFormat: string;
261
264
  pageNumOffset: number;
262
- pageLayoutMode: 'singlePage' | 'multiPage' | 'fit-page';
265
+ pageLayoutMode: PageLayoutMode;
263
266
  get contentWidth(): number;
264
267
  /**
265
268
  * 内容区域的高度
@@ -1,8 +1,8 @@
1
1
  import { Element, InlineGroupElement, ViewOptions } from "./element-define";
2
- import { FillNullSpaceRenderObject } from "./impl/decorate/fill-null-space-imple";
3
- import { DocumentElement, DocumentRenderObject } from "./impl/document/doc-impl";
4
- import { ParagraphElement, ParagraphLineRectRenderObject, ParagraphRenderObject } from "./impl/paragraph/p-impl";
5
- import { TextGroupRenderObject } from "./impl/text/text-impl";
2
+ import { FillNullSpaceRenderObject } from "./impl";
3
+ import { DocumentElement, DocumentRenderObject } from "./impl";
4
+ import { ParagraphElement, ParagraphLineRectRenderObject, ParagraphRenderObject } from "./impl";
5
+ import { TextGroupRenderObject } from "./impl";
6
6
  import { RenderContextType } from "./render-context";
7
7
  import { InlineGroupRenderObject, RenderObject } from "./render-define";
8
8
  interface ICutLineData {
@@ -28,6 +28,12 @@ export declare class ElementTrackManage {
28
28
  * 生成留痕的信息
29
29
  */
30
30
  generateTrack(): void;
31
+ /**
32
+ * 合并操作,
33
+ * 合并输入、删除文字在一定周期内的更改
34
+ * @private
35
+ */
36
+ private mergeOps;
31
37
  private getSelection;
32
38
  /**
33
39
  * 执行撤销
@@ -299,9 +299,10 @@ export declare class ElementUtil {
299
299
  * @param currElement
300
300
  * @param inPara 是否在同一段落中寻找
301
301
  * @param forCursor 查找结果是否用于光标定位
302
+ * @param viewOptions
302
303
  * @returns
303
304
  */
304
- static getRecursionPrevSiblingElement(currElement: Element | null, inPara?: boolean, forCursor?: boolean): LeafElement | null;
305
+ static getRecursionPrevSiblingElement(currElement: Element | null, inPara: boolean | undefined, forCursor: boolean | undefined, viewOptions: ViewOptions): LeafElement | null;
305
306
  /**
306
307
  * 循环向前寻找可定位的数据元
307
308
  * @param currElement
@@ -310,7 +311,7 @@ export declare class ElementUtil {
310
311
  /**
311
312
  * 递归向后寻找最近的元素
312
313
  */
313
- static getRecursionNextSiblingElement(currElement: Element | null, inPara?: boolean, forCursor?: boolean): LeafElement | null;
314
+ static getRecursionNextSiblingElement(currElement: Element | null, inPara: boolean | undefined, forCursor: boolean | undefined, viewOptions: ViewOptions): LeafElement | null;
314
315
  /**
315
316
  * 获取行内最大渲染单元格高度,主要处理纵向合并单元格问题
316
317
  * @param row
@@ -33,6 +33,14 @@ export declare class DocumentRenderObject extends BlockContainerRenderObject {
33
33
  headerLine: number;
34
34
  footerLine: number;
35
35
  render(e: IRenderData): void;
36
+ /**
37
+ * 绘制版权信息
38
+ */
39
+ private drawCopyRight;
40
+ /**
41
+ * 绘制文档边距线
42
+ */
43
+ private drawMarginLine;
36
44
  /**
37
45
  * 绘制水印
38
46
  * @param ctx
@@ -0,0 +1,24 @@
1
+ import { ElementFactory, LeafElement, readElementProps, SerializeProps, ViewOptions, Element } from "../../element-define";
2
+ import { RenderContextType } from "../../render-context";
3
+ import { IRenderData, LeafRenderObject, RenderObject } from "../../render-define";
4
+ /**
5
+ * 段落行
6
+ */
7
+ export declare class ParaLineElement extends LeafElement<ParaLineProps> {
8
+ constructor();
9
+ clone(data: boolean): Element;
10
+ createRenderObject(options: ViewOptions, renderCtx: RenderContextType): RenderObject | null;
11
+ serialize(viewOptions: ViewOptions): SerializeProps | null;
12
+ }
13
+ export declare class ParaLineRenderObject extends LeafRenderObject {
14
+ clone(): RenderObject;
15
+ render(e: IRenderData): void;
16
+ }
17
+ export declare class ParaLineElementFactory extends ElementFactory<ParaLineProps> {
18
+ createElement(data: readElementProps<ParaLineProps>, renderCtx: RenderContextType): Element;
19
+ match(type: string): boolean;
20
+ }
21
+ export declare class ParaLineProps {
22
+ lineType: 'solid' | 'dash';
23
+ clone(dest?: ParaLineProps): ParaLineProps;
24
+ }
@@ -1,7 +1,7 @@
1
1
  import { ContentMenuItem } from './framework/element-event-define';
2
2
  import { ElementReader } from './framework/element-reader';
3
3
  import { SelectionState } from './framework/document-selection';
4
- import { BranchElement, Element, ICancelTokenFn, LeafElement, MarginProps, OrientType, Position, Rect, TextAlign, ViewOptions } from './framework/element-define';
4
+ import { BranchElement, Element, ICancelTokenFn, LeafElement, MarginProps, OrientType, PageLayoutMode, Position, Rect, TextAlign, ViewOptions } from './framework/element-define';
5
5
  import { DataElementInlineGroup, DataElementLeaf, DocumentElement } from './framework/impl';
6
6
  import { ParagraphProps, TextProps } from './framework/element-props';
7
7
  import { EditorContext } from './framework/document-context';
@@ -288,6 +288,7 @@ export declare class CanvasTextEditor {
288
288
  showHistory(): void;
289
289
  getControlById(index: number): Element<any> | null;
290
290
  getControlId(ele: Element): number;
291
+ switchPageLayout(mode: PageLayoutMode): void;
291
292
  }
292
293
  export declare type EditorCurrentPos = {
293
294
  pos: Position;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "author": "hailin-zheng",
5
5
  "private": false,
6
6
  "license": "ISC",
7
- "version": "1.0.35",
7
+ "version": "1.0.38",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "bwip-js": "^3.0.5",