ht-emr 0.7.52 → 0.7.53

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.
@@ -50,6 +50,10 @@ export declare class Cursor {
50
50
  private cursorAgent;
51
51
  /** 闪烁定时器ID */
52
52
  private blinkTimeout;
53
+ /** 延迟聚焦定时器ID */
54
+ private focusTimeout;
55
+ /** 光标可见性检查的画面帧ID */
56
+ private visibilityFrameId;
53
57
  /** 点击行首时的起始索引 */
54
58
  private hitLineStartIndex;
55
59
  /**
@@ -114,6 +118,12 @@ export declare class Cursor {
114
118
  * 在web端允许聚焦以确保键盘事件能够被捕获。
115
119
  */
116
120
  focus(): void;
121
+ private _clearFocusTimeout;
122
+ private _clearVisibilityFrame;
123
+ /**
124
+ * 元素已变更但新布局尚未生成时,取消旧光标的滚动检查。
125
+ */
126
+ cancelPendingVisibilityCheck(): void;
117
127
  /**
118
128
  * 绘制光标
119
129
  *
@@ -72,6 +72,10 @@ export declare class Draw {
72
72
  private pageNo;
73
73
  /** 渲染计数器 */
74
74
  private renderCount;
75
+ /** 连续输入等待合并的渲染帧 */
76
+ private pendingRenderFrameId;
77
+ /** 合并渲染帧使用的最新参数 */
78
+ private pendingRenderOption;
75
79
  /** 页面像素比(用于高清屏适配) */
76
80
  private pagePixelRatio;
77
81
  /** 编辑器模式 */
@@ -566,6 +570,16 @@ export declare class Draw {
566
570
  * @returns 渲染次数计数
567
571
  */
568
572
  getRenderCount(): number;
573
+ /**
574
+ * 将连续输入产生的多次重排合并到下一个画面帧。
575
+ * 数据和选区在调用前已同步更新,这里只延后布局与绘制。
576
+ */
577
+ requestRender(payload?: IDrawOption): void;
578
+ /**
579
+ * 在删除、光标移动或鼠标定位前刷新待绘制的输入。
580
+ */
581
+ flushPendingRender(): void;
582
+ private _cancelPendingRender;
569
583
  /**
570
584
  * 获取Canvas页面元素
571
585
  * @param pageNo - 页码,-1表示当前页
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "ht-emr",
3
3
  "author": "swj",
4
4
  "license": "MIT",
5
- "version": "0.7.52",
5
+ "version": "0.7.53",
6
6
  "description": "rich text editor by canvas/svg",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org/",