@compass-framework/core 1.2.69 → 1.2.71
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.
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { EditText } from "../EditText";
|
|
2
|
+
import { TextDecoration, TextSelection, TextSelectionProvider } from "./RichTextStyleEditor";
|
|
3
|
+
import { Context } from "../../content/Context";
|
|
4
|
+
import { AttributeSet } from "../../content/AttributeSet";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 富文本编辑器,支持 HTML 互转与选区样式操作。
|
|
8
|
+
*/
|
|
9
|
+
export class EditRichText extends EditText implements TextSelectionProvider {
|
|
10
|
+
public constructor(context: Context);
|
|
11
|
+
public constructor(context: Context, attrs: AttributeSet);
|
|
12
|
+
|
|
13
|
+
public fromHTML(html: string): void;
|
|
14
|
+
|
|
15
|
+
public toHTML(): string;
|
|
16
|
+
|
|
17
|
+
/// ////////////////////////////////// bold ////////////////////////////////////////////////////
|
|
18
|
+
|
|
19
|
+
public applyBold(): void;
|
|
20
|
+
|
|
21
|
+
public clearBold(): void;
|
|
22
|
+
|
|
23
|
+
public toggleBold(): void;
|
|
24
|
+
|
|
25
|
+
public isBold(): boolean;
|
|
26
|
+
|
|
27
|
+
/// ////////////////////////////////// italic ////////////////////////////////////////////////////
|
|
28
|
+
|
|
29
|
+
public applyItalic(): void;
|
|
30
|
+
|
|
31
|
+
public clearItalic(): void;
|
|
32
|
+
|
|
33
|
+
public toggleItalic(): void;
|
|
34
|
+
|
|
35
|
+
public isItalic(): boolean;
|
|
36
|
+
|
|
37
|
+
/// ////////////////////////////////// font-color ////////////////////////////////////////////////////
|
|
38
|
+
|
|
39
|
+
public hasColor(): boolean;
|
|
40
|
+
|
|
41
|
+
public clearColor(): void;
|
|
42
|
+
|
|
43
|
+
public applyColor(color: number): void;
|
|
44
|
+
|
|
45
|
+
/// ////////////////////////////////// font-size ////////////////////////////////////////////////////
|
|
46
|
+
|
|
47
|
+
public clearFontSize(): void;
|
|
48
|
+
|
|
49
|
+
public hasFontSize(): boolean;
|
|
50
|
+
|
|
51
|
+
public getFontSize(): number;
|
|
52
|
+
|
|
53
|
+
public applyFontSize(size: number): void;
|
|
54
|
+
|
|
55
|
+
/// ////////////////////////////////// decoration ////////////////////////////////////////////////////
|
|
56
|
+
|
|
57
|
+
public applyDecoration(decoration: TextDecoration): void;
|
|
58
|
+
|
|
59
|
+
public hasDecoration(decoration: TextDecoration): boolean;
|
|
60
|
+
|
|
61
|
+
public clearDecoration(decoration: TextDecoration): void;
|
|
62
|
+
|
|
63
|
+
public toggleDecoration(decoration: TextDecoration): void;
|
|
64
|
+
|
|
65
|
+
/// /////////////////////////////////////////////////////////////////////////////////////////////////
|
|
66
|
+
|
|
67
|
+
public getSelection(): TextSelection;
|
|
68
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export enum TextDecoration {
|
|
2
|
+
UNDERLINE = 0x00000001,
|
|
3
|
+
STRIKE_THROUGH = 0x00000002,
|
|
4
|
+
DOUBLE_UNDERLINE = 0x00000004,
|
|
5
|
+
SUPERSCRIPT = 0x00000008,
|
|
6
|
+
SUBSCRIPT = 0x00000010,
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface TextSelection {
|
|
10
|
+
getStart(): number;
|
|
11
|
+
getEnd(): number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface TextSelectionProvider {
|
|
15
|
+
getSelection(): TextSelection;
|
|
16
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export * from "./@types/widget/Adapter";
|
|
2
2
|
export * from "./@types/widget/Button";
|
|
3
|
-
export * from "./@types/widget/EditRichText";
|
|
4
3
|
export * from "./@types/widget/EditText";
|
|
5
4
|
export * from "./@types/widget/FreezeAbsoluteLayout";
|
|
6
5
|
export * from "./@types/widget/FreezeLayoutViewGroup";
|
|
@@ -8,6 +7,8 @@ export * from "./@types/widget/GridView";
|
|
|
8
7
|
export * from "./@types/widget/HorizontalScrollView";
|
|
9
8
|
export * from "./@types/widget/Image";
|
|
10
9
|
export * from "./@types/widget/ImageView";
|
|
10
|
+
export * from "./@types/widget/edit-rich-text/EditRichText";
|
|
11
|
+
export * from "./@types/widget/edit-rich-text/RichTextStyleEditor";
|
|
11
12
|
|
|
12
13
|
export * from "./@types/misc/DoubleClick";
|
|
13
14
|
export * from "./@types/misc/DoubleClickListener";
|
package/package.json
CHANGED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { FrameLayout } from "../layout/FrameLayout";
|
|
2
|
-
import { Context } from "../content/Context";
|
|
3
|
-
import { AttributeSet } from "../content/AttributeSet";
|
|
4
|
-
import { View } from "../view/View";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 富文本编辑器,支持 HTML 互转与选区样式操作。
|
|
8
|
-
*/
|
|
9
|
-
export class EditRichText extends FrameLayout {
|
|
10
|
-
public static TEXT_DECORATION_UNDERLINE: number;
|
|
11
|
-
public static TEXT_DECORATION_DOUBLE: number;
|
|
12
|
-
public static TEXT_DECORATION_THROUGH: number;
|
|
13
|
-
|
|
14
|
-
public static TEXT_VERTICAL_CENTER: number;
|
|
15
|
-
public static TEXT_VERTICAL_TOP: number;
|
|
16
|
-
public static TEXT_VERTICAL_Bottom : number;
|
|
17
|
-
|
|
18
|
-
public static TEXT_HORIZONTAL_CENTER : number;
|
|
19
|
-
public static TEXT_HORIZONTAL_LEFT : number;
|
|
20
|
-
public static TEXT_HORIZONTAL_RIGHT: number;
|
|
21
|
-
|
|
22
|
-
public constructor(context: Context);
|
|
23
|
-
public constructor(context: Context, attrs: AttributeSet);
|
|
24
|
-
|
|
25
|
-
public formHTML(html: string): void;
|
|
26
|
-
|
|
27
|
-
public toHTML(): string;
|
|
28
|
-
|
|
29
|
-
public requestFocusAndInput(): void;
|
|
30
|
-
|
|
31
|
-
public clearSelectionDecoration(style: number): void;
|
|
32
|
-
|
|
33
|
-
public clearSelectionBold(): void;
|
|
34
|
-
|
|
35
|
-
public clearSelectionItalic(): void;
|
|
36
|
-
|
|
37
|
-
public clearSelectionColor(): void;
|
|
38
|
-
|
|
39
|
-
public applySelectionColor(color: number): void;
|
|
40
|
-
|
|
41
|
-
public applySelectionItalic(): void;
|
|
42
|
-
|
|
43
|
-
public applySelectionBold(): void;
|
|
44
|
-
|
|
45
|
-
public applySelectionDecoration(style: number): void;
|
|
46
|
-
|
|
47
|
-
public toggleSelectionItalic(): void;
|
|
48
|
-
|
|
49
|
-
public toggleSelectionBold(): void;
|
|
50
|
-
|
|
51
|
-
public toggleSelectionDecoration(style: number): void;
|
|
52
|
-
|
|
53
|
-
public selectionContainsBold(): boolean;
|
|
54
|
-
|
|
55
|
-
public selectionContainsItalic(): boolean;
|
|
56
|
-
|
|
57
|
-
public selectionContainsDecoration(style: number): boolean;
|
|
58
|
-
|
|
59
|
-
public getDefaultTextSize(): number;
|
|
60
|
-
|
|
61
|
-
public getSelectionColor(): number;
|
|
62
|
-
|
|
63
|
-
public getEditTextPaddingLeft(): number;
|
|
64
|
-
|
|
65
|
-
public getVerticalAlign(): number;
|
|
66
|
-
|
|
67
|
-
public getHorizontalAlign(): number;
|
|
68
|
-
|
|
69
|
-
public getEditTextPaddingRight(): number;
|
|
70
|
-
|
|
71
|
-
public getEditTextPaddingTop(): number;
|
|
72
|
-
|
|
73
|
-
public getEditTextPaddingBottom(): number;
|
|
74
|
-
|
|
75
|
-
public getEditTextMinimumHeight(): number;
|
|
76
|
-
|
|
77
|
-
public getEditTextMinimumWidth(): number;
|
|
78
|
-
|
|
79
|
-
public setEditTextPadding(left: number, top: number, right: number, bottom: number):void;
|
|
80
|
-
|
|
81
|
-
public setIncludeFontPadding(include: boolean): void;
|
|
82
|
-
|
|
83
|
-
public setOnFocusChangeListener(l: View.OnFocusChangeListener): void;
|
|
84
|
-
|
|
85
|
-
public setDefaultTextSize(textSize: number): void;
|
|
86
|
-
|
|
87
|
-
public setOutsideTouchable(touchable: boolean): void;
|
|
88
|
-
|
|
89
|
-
public setEditTextMinimumWidth(width: number): void;
|
|
90
|
-
|
|
91
|
-
public setEditTextMinimumHeight(height: number): void;
|
|
92
|
-
}
|