@galacean/effects-core 2.9.1 → 2.9.3
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.
- package/dist/index.js +83 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +81 -21
- package/dist/index.mjs.map +1 -1
- package/dist/plugins/text/index.d.ts +1 -0
- package/dist/plugins/text/line-break.d.ts +29 -0
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 文本换行机会判定:UAX #14 风格的"换行机会"模型。
|
|
3
|
+
*
|
|
4
|
+
* - CJK 表意字 / 假名 / 韩文音节:任意两个字之间都是合法断点(字符级)
|
|
5
|
+
* - 空格 / 制表符 / NBSP:可断,且断行时被吞掉(不留在行尾 / 行首)
|
|
6
|
+
* - 西文字母 / 数字:词内不可断;整体超宽时由调用方退化到字符级断(overflow-wrap)
|
|
7
|
+
*
|
|
8
|
+
* 不含 kinsoku 禁则(句号 / 逗号不进行首等留作后续)。
|
|
9
|
+
*/
|
|
10
|
+
/** 换行机会类型(断点字符之后):决定断点字符归属及断行时是否吞掉 */
|
|
11
|
+
export type BreakAfter = 'swallow' | 'keep' | false;
|
|
12
|
+
/**
|
|
13
|
+
* 是否为可换行断点字符(空格 / 制表符 / NBSP)。
|
|
14
|
+
* 断在此字符之前,且断行时该字符被吞掉(不进旧行也不进新行)。
|
|
15
|
+
* @param ch - 当前字符
|
|
16
|
+
*/
|
|
17
|
+
export declare function isBreakChar(ch: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 是否为 CJK 类字符(中文表意字 / 假名 / 韩文音节)。可在其与相邻字符之间换行。
|
|
20
|
+
* 用码点判定以支持 CJK 扩展 B 等代理对字符(不能用 /u 正则,browserslist 为 iOS 9)。
|
|
21
|
+
* @param ch - 当前字符(须为完整码点,调用方应使用 Array.from 遍历)
|
|
22
|
+
*/
|
|
23
|
+
export declare function isCJKLike(ch: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 计算 prev(已推入的字符)之后是否为换行机会。只看 prev,不看后续字符。
|
|
26
|
+
* @param prev - 前一字符(已推入旧行)
|
|
27
|
+
* @returns 'swallow'=prev 是空格类,断行时吞掉 prev;'keep'=prev 是 CJK,prev 留本行末、下行从其后起;false=不可断
|
|
28
|
+
*/
|
|
29
|
+
export declare function breakOpportunityAfter(prev: string): BreakAfter;
|