@textbus/platform-browser 5.4.3 → 5.4.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.
- package/dist/_utils/uikit.d.ts +57 -0
- package/dist/index.esm.js +477 -115
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +481 -114
- package/dist/index.js.map +1 -1
- package/dist/magic-input.d.ts +17 -1
- package/dist/types.d.ts +1 -0
- package/package.json +3 -3
package/dist/_utils/uikit.d.ts
CHANGED
|
@@ -7,6 +7,63 @@ export interface Rect {
|
|
|
7
7
|
width: number;
|
|
8
8
|
height: number;
|
|
9
9
|
}
|
|
10
|
+
export interface OverflowClipAncestor {
|
|
11
|
+
element: Element;
|
|
12
|
+
clipX: boolean;
|
|
13
|
+
clipY: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface OverflowClipContext {
|
|
16
|
+
/** 自内而外 */
|
|
17
|
+
clipAncestors: OverflowClipAncestor[];
|
|
18
|
+
scrollContainers: Element[];
|
|
19
|
+
/** 嵌套滚动时最近的 overflow 容器 */
|
|
20
|
+
firstScrollContainer: Element;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 一次遍历祖先链:缓存 overflow 轴信息,并收集滚动监听目标。
|
|
24
|
+
*/
|
|
25
|
+
export declare function getOverflowClipContext(anchor: Node, extraRoot?: Element): OverflowClipContext;
|
|
26
|
+
export interface CaretBoxLayout {
|
|
27
|
+
boxHeight: number;
|
|
28
|
+
rectTop: number;
|
|
29
|
+
}
|
|
30
|
+
/** 根据行高与内容矩形计算光标盒高度与顶部(视口坐标) */
|
|
31
|
+
export declare function measureCaretBoxLayout(contentRect: Rect, style: CSSStyleDeclaration): CaretBoxLayout;
|
|
32
|
+
/** 测量行内旋转角度(writing-mode 继承) */
|
|
33
|
+
export declare function measureInlineCaretRotate(node: HTMLElement, initialRotate: number, writingMode: string): number;
|
|
34
|
+
export interface CaretPresentation {
|
|
35
|
+
outOfView: boolean;
|
|
36
|
+
clipPath: string;
|
|
37
|
+
layoutElRect: Rect;
|
|
38
|
+
position: {
|
|
39
|
+
left: number;
|
|
40
|
+
top: number;
|
|
41
|
+
height: number;
|
|
42
|
+
};
|
|
43
|
+
caretColor: string;
|
|
44
|
+
style: {
|
|
45
|
+
height: string;
|
|
46
|
+
lineHeight: string;
|
|
47
|
+
fontSize: string;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export interface ComputeCaretPresentationOptions {
|
|
51
|
+
anchor: HTMLElement;
|
|
52
|
+
maskRect: Rect;
|
|
53
|
+
clipAncestors: OverflowClipAncestor[];
|
|
54
|
+
maskLeft: number;
|
|
55
|
+
maskTop: number;
|
|
56
|
+
boxHeight: number;
|
|
57
|
+
rectTop: number;
|
|
58
|
+
contentRect: Rect;
|
|
59
|
+
fontSize: string;
|
|
60
|
+
color: string;
|
|
61
|
+
measureElementRect: () => Rect;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* 在 element 样式已写入后调用:计算裁剪、是否移出视口及对外事件数据。
|
|
65
|
+
*/
|
|
66
|
+
export declare function computeCaretPresentation(options: ComputeCaretPresentationOptions): CaretPresentation;
|
|
10
67
|
export interface UIElementParams {
|
|
11
68
|
classes?: string[];
|
|
12
69
|
attrs?: {
|