@gct-paas/word 0.1.19 → 0.1.20

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.
@@ -1,7 +1,7 @@
1
1
  import { CommandBase, PostCommandContext } from '../base/CommandBase';
2
2
  import { Doc } from '../../view/Doc';
3
3
  import { Wtc } from '../../model/document';
4
- import { CheckTableRegion, _2DTableRegion, Region } from '../../model/logic';
4
+ import { CheckTableRegion, _2DTableRegion } from '../../model/logic';
5
5
  import { CommandPayloadMap } from '../types';
6
6
  type DataGroup2DSubTableRegion = CheckTableRegion | _2DTableRegion;
7
7
  export declare class SetDataGroup2D extends CommandBase<'setDataGroup2D'> {
@@ -9,17 +9,9 @@ export declare class SetDataGroup2D extends CommandBase<'setDataGroup2D'> {
9
9
  protected execute(): Promise<PostCommandContext>;
10
10
  /**
11
11
  *
12
- * @param startCell
13
- * @param endCell
12
+ * @param cellList
14
13
  * @returns
15
14
  */
16
- protected getSubTableRegion(startCell: Wtc, endCell: Wtc): DataGroup2DSubTableRegion | undefined;
17
- /**
18
- * 获取公共区域
19
- * @param startCell
20
- * @param endCell
21
- * @returns
22
- */
23
- protected getRegion(startCell: Wtc, endCell: Wtc): Region | undefined;
15
+ protected getSubTableRegion(cellList: Wtc[]): DataGroup2DSubTableRegion | undefined;
24
16
  }
25
17
  export {};
@@ -89,6 +89,7 @@ export declare class Wtc extends ModelGroup {
89
89
  * @description 保留第一个段落,删除其他段落,使单元格恢复到初始状态
90
90
  */
91
91
  empty(): void;
92
+ clearFieldRuns(): void;
92
93
  /**
93
94
  * 从 XML JSON 创建单元格(返回数组,因为 colspan 会产生多个单元格)
94
95
  */
@@ -4,6 +4,10 @@ export declare class TextUtil {
4
4
  private static readonly FONT_METRICS_CACHE_LIMIT;
5
5
  /** 布局大小缓存限制 */
6
6
  private static readonly LAYOUT_SIZE_CACHE_LIMIT;
7
+ /** 东亚常见全宽字符块 */
8
+ private static readonly EAST_ASIAN_FULL_WIDTH_REGEX;
9
+ /** 表单/文档中常见的几何符号 */
10
+ private static readonly FULL_WIDTH_SYMBOL_REGEX;
7
11
  private static fontMetricsCache;
8
12
  private static layoutSizeCache;
9
13
  /**
@@ -12,6 +16,19 @@ export declare class TextUtil {
12
16
  * @returns
13
17
  */
14
18
  static isHanChar(char: string): boolean;
19
+ /**
20
+ * 验证是否为应按 1em 处理的全宽单字符
21
+ * @param char
22
+ * @returns
23
+ */
24
+ static isFullWidthChar(char: string): boolean;
25
+ /**
26
+ * 生成文本度量缓存键
27
+ * @param payload
28
+ * @param includeText
29
+ * @returns
30
+ */
31
+ private static getMeasureCacheKey;
15
32
  /**
16
33
  * 计算度量 - 基于 JSON 序列化的缓存(LRU)
17
34
  * 将最终的 config 序列化为缓存键,相同配置直接返回缓存结果