@compass-framework/core 1.2.61 → 1.2.63

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 { RendererBackend } from "../canvas/RendererBackend";
2
- import { CanvaskitPlatformHostConfig } from "../host/CanvaskitPlatformHostConfig";
3
- import { WebPlatformHostConfig } from "../host/WebPlatformHostConfig";
4
- import { NodePlatformHostConfig } from "../host/NodePlatformHostConfig";
2
+ import { CanvaskitPlatformHostConfig } from "../host/backend/CanvaskitPlatformHostConfig";
3
+ import { WebPlatformHostConfig } from "../host/backend/WebPlatformHostConfig";
4
+ import { NodePlatformHostConfig } from "../host/backend/NodePlatformHostConfig";
5
5
 
6
6
  export interface ApplicationCreatorConfig {
7
7
  [RendererBackend.CanvasKit]: CanvaskitPlatformHostConfig,
@@ -0,0 +1,179 @@
1
+ /**
2
+ * EditContext API contract
3
+ *
4
+ * Aligned with W3C EditContext IDL: https://w3c.github.io/edit-context/
5
+ *
6
+ * Portable TypeScript surface for the upcoming cross-platform C++ implementation.
7
+ * Index units are UTF-16 code units. Ranges are [start, end).
8
+ */
9
+
10
+ /* =============================================================================
11
+ * Geometry
12
+ * ============================================================================= */
13
+
14
+ /** Axis-aligned rect in client / viewport coordinates. */
15
+ export interface DOMRectLike {
16
+ x?: number;
17
+ y?: number;
18
+ width?: number;
19
+ height?: number;
20
+ }
21
+
22
+ export type RectInput = DOMRectLike;
23
+
24
+ /* =============================================================================
25
+ * Enums (W3C)
26
+ * ============================================================================= */
27
+
28
+ export type UnderlineStyle = "none" | "solid" | "dotted" | "dashed" | "wavy";
29
+ export type UnderlineThickness = "none" | "thin" | "thick";
30
+
31
+ /* =============================================================================
32
+ * Init dictionaries
33
+ * ============================================================================= */
34
+
35
+ export interface EditContextInit {
36
+ text?: string;
37
+ selectionStart?: number;
38
+ selectionEnd?: number;
39
+ }
40
+
41
+ export interface TextUpdateEventInit {
42
+ updateRangeStart?: number;
43
+ updateRangeEnd?: number;
44
+ text?: string;
45
+ selectionStart?: number;
46
+ selectionEnd?: number;
47
+ }
48
+
49
+ export interface TextFormatInit {
50
+ rangeStart?: number;
51
+ rangeEnd?: number;
52
+ underlineStyle?: UnderlineStyle;
53
+ underlineThickness?: UnderlineThickness;
54
+ }
55
+
56
+ export interface TextFormatUpdateEventInit {
57
+ textFormats?: TextFormat[];
58
+ }
59
+
60
+ export interface CharacterBoundsUpdateEventInit {
61
+ rangeStart?: number;
62
+ rangeEnd?: number;
63
+ }
64
+
65
+ /* =============================================================================
66
+ * Formats & events
67
+ * ============================================================================= */
68
+
69
+ export interface TextFormat {
70
+ readonly rangeStart: number;
71
+ readonly rangeEnd: number;
72
+ readonly underlineStyle: UnderlineStyle;
73
+ readonly underlineThickness: UnderlineThickness;
74
+ }
75
+
76
+ export interface TextUpdateEvent {
77
+ readonly updateRangeStart: number;
78
+ readonly updateRangeEnd: number;
79
+ readonly text: string;
80
+ readonly selectionStart: number;
81
+ readonly selectionEnd: number;
82
+ }
83
+
84
+ export interface TextFormatUpdateEvent {
85
+ getTextFormats(): TextFormat[];
86
+ }
87
+
88
+ export interface CharacterBoundsUpdateEvent {
89
+ readonly rangeStart: number;
90
+ readonly rangeEnd: number;
91
+ }
92
+
93
+ export interface CompositionEvent {
94
+ readonly type: "compositionstart" | "compositionend";
95
+ readonly data: string;
96
+ }
97
+
98
+ export interface EditContextEventMap {
99
+ textupdate: TextUpdateEvent;
100
+ textformatupdate: TextFormatUpdateEvent;
101
+ characterboundsupdate: CharacterBoundsUpdateEvent;
102
+ compositionstart: CompositionEvent;
103
+ compositionend: CompositionEvent;
104
+ }
105
+
106
+ export type EditContextEventType = keyof EditContextEventMap;
107
+
108
+ export type EditContextEventListener<K extends EditContextEventType> = (ev: EditContextEventMap[K],) => void;
109
+
110
+ /* =============================================================================
111
+ * Host element
112
+ * ============================================================================= */
113
+
114
+ export interface EditContextHostElement {
115
+ readonly id?: string;
116
+ }
117
+
118
+ /* =============================================================================
119
+ * EditContext
120
+ * ============================================================================= */
121
+
122
+ export declare class EditContext {
123
+ readonly text: string;
124
+ readonly selectionStart: number;
125
+ readonly selectionEnd: number;
126
+ readonly characterBoundsRangeStart: number;
127
+ readonly isComposing: boolean;
128
+
129
+ startInput(): void;
130
+
131
+ updateText(rangeStart: number, rangeEnd: number, text: string): void;
132
+
133
+ updateSelection(start: number, end: number): void;
134
+
135
+ updateControlBounds(controlBounds: RectInput): void;
136
+
137
+ updateSelectionBounds(selectionBounds: RectInput): void;
138
+
139
+ updateCharacterBounds(rangeStart: number, characterBounds: readonly RectInput[]): void;
140
+
141
+ finishInput(): void;
142
+
143
+ characterBounds(): DOMRectLike[];
144
+
145
+ /** Associated host view(s); empty if not attached. */
146
+ attachedElements(): EditContextHostElement[];
147
+
148
+ addEventListener<K extends EditContextEventType>(type: K, listener: EditContextEventListener<K>): void;
149
+
150
+ removeEventListener<K extends EditContextEventType>(type: K, listener: EditContextEventListener<K>): void;
151
+
152
+ ontextupdate: EditContextEventListener<"textupdate"> | null;
153
+ oncompositionstart: EditContextEventListener<"compositionstart"> | null;
154
+ oncompositionend: EditContextEventListener<"compositionend"> | null;
155
+ ontextformatupdate: EditContextEventListener<"textformatupdate"> | null;
156
+ oncharacterboundsupdate: EditContextEventListener<"characterboundsupdate"> | null;
157
+ }
158
+
159
+ export interface EditContextConstructor {
160
+ new(options?: EditContextInit): EditContext;
161
+ }
162
+
163
+ export type EditContextCompositionPhase =
164
+ | "idle"
165
+ | "composing"
166
+ | "awaiting-character-bounds";
167
+
168
+ /* =============================================================================
169
+ * Virtual Keyboard (mobile companion; optional)
170
+ * ============================================================================= */
171
+
172
+ export interface VirtualKeyboard {
173
+ readonly boundingRect: DOMRectLike;
174
+ overlaysContent: boolean;
175
+ show(): void;
176
+ hide(): void;
177
+ addEventListener(type: "geometrychange", listener: () => void): void;
178
+ removeEventListener(type: "geometrychange", listener: () => void): void;
179
+ }
@@ -0,0 +1,17 @@
1
+ import { CharSequence } from "@compass-framework/library";
2
+ import { Rect } from "../canvas/Rect";
3
+ import { KeyEvent } from "../event/KeyEvent";
4
+
5
+ export interface InputConnection {
6
+ getCursor(flags: number): Rect;
7
+
8
+ setSelection(start: number, end: number): boolean;
9
+
10
+ getInputRect(): Rect;
11
+
12
+ sendKeyEvent(event: KeyEvent): boolean;
13
+
14
+ finishComposingText(): boolean
15
+
16
+ setComposingText(text: CharSequence, newCursorPosition: number): boolean;
17
+ }
@@ -0,0 +1,7 @@
1
+ import { EditContext } from "../host/EditContext";
2
+
3
+ export interface EditorInfo {
4
+ initialSelStart: number
5
+ initialSelEnd: number
6
+ editContext: EditContext;
7
+ }
package/index.d.ts CHANGED
@@ -14,9 +14,8 @@ export * from "./@types/widget/ImageView";
14
14
  export * from "./@types/misc/DoubleClick";
15
15
  export * from "./@types/misc/DoubleClickListener";
16
16
 
17
- export * from "./@types/app/Application";
18
17
  export * from "./@types/text/Editable";
19
- export * from "./@types/shared/ContextUtils";
18
+ export * from "./@types/text/EditorInfo";
20
19
 
21
20
  export * from "./@types/layout/FrameLayout";
22
21
  export * from "./@types/layout/GridLayout";
@@ -25,23 +24,13 @@ export * from "./@types/layout/LinearLayout";
25
24
  export * from "./@types/layout/RelativeLayout";
26
25
  export * from "./@types/layout/GridLayoutAnimationController";
27
26
 
28
- export * from "./@types/drawable/CornersDrawable";
29
- export * from "./@types/drawable/Drawable";
30
- export * from "./@types/drawable/ImageDrawable";
31
- export * from "./@types/drawable/LayerDrawable";
32
- export * from "./@types/drawable/LinearGradientDrawable";
33
- export * from "./@types/drawable/PictureDrawable";
34
- export * from "./@types/drawable/ColorDrawable";
35
-
36
27
  export * from "./@types/content/AttributeSet";
37
28
  export * from "./@types/content/Configuration";
38
29
  export * from "./@types/content/Context";
39
- export * from "./@types/content/DisplayMetrics";
40
- export * from "./@types/evaluate/Environment";
41
- export * from "./@types/content/LayoutInflater";
42
30
  export * from "./@types/content/PixelFormat";
43
- export * from "./@types/evaluate/Resolver";
44
31
  export * from "./@types/content/Resources";
32
+ export * from "./@types/content/DisplayMetrics";
33
+ export * from "./@types/content/LayoutInflater";
45
34
 
46
35
  export * from "./@types/canvas/BlendMode";
47
36
  export * from "./@types/canvas/Canvas";
@@ -72,13 +61,15 @@ export * from "./@types/animation/BounceInterpolator";
72
61
  export * from "./@types/animation/CycleInterpolator";
73
62
  export * from "./@types/animation/DecelerateInterpolator";
74
63
 
64
+ export * from "./@types/imm/InputConnection";
65
+ export * from "./@types/imm/InputMethod";
66
+
75
67
  export * from "./@types/widget/Slot";
76
68
  export * from "./@types/widget/TextView";
77
69
  export * from "./@types/widget/ListAdapter";
78
70
  export * from "./@types/widget/ListView";
79
71
  export * from "./@types/widget/ScrollView";
80
72
 
81
- export * from "./@types/display/SurfaceProvider";
82
73
  export * from "./@types/layout/TableLayout";
83
74
  export * from "./@types/layout/TableRow";
84
75
  export * from "./@types/content/Theme";
@@ -95,6 +86,17 @@ export * from "./@types/animator/ValueAnimator";
95
86
  export * from "./@types/animator/Animator";
96
87
  export * from "./@types/animator/PropertyValuesHolder";
97
88
 
89
+ export * from "./@types/drawable/CornersDrawable";
90
+ export * from "./@types/drawable/Drawable";
91
+ export * from "./@types/drawable/ImageDrawable";
92
+ export * from "./@types/drawable/LayerDrawable";
93
+ export * from "./@types/drawable/LinearGradientDrawable";
94
+ export * from "./@types/drawable/PictureDrawable";
95
+ export * from "./@types/drawable/ColorDrawable";
96
+
97
+ export * from "./@types/evaluate/Resolver";
98
+ export * from "./@types/evaluate/Environment";
99
+
98
100
  export * from "./@types/view/Gravity";
99
101
  export * from "./@types/view/Outline";
100
102
  export * from "./@types/view/View";
@@ -107,12 +109,32 @@ export * from "./@types/view/ViewSlot";
107
109
  export * from "./@types/view/ViewTreeObserver";
108
110
 
109
111
  export * from "./@types/animation/Interpolator";
110
- export * from "./@types/event/KeyEvent";
111
112
  export * from "./@types/animation/LayoutAnimationController";
112
113
  export * from "./@types/animation/LinearInterpolator";
114
+
115
+ export * from "./@types/event/KeyEvent";
113
116
  export * from "./@types/event/MotionEvent";
117
+
114
118
  export * from "./@types/display/MouseCursor";
119
+ export * from "./@types/display/SurfaceProvider";
115
120
 
116
121
  export * from "./@types/window/Window";
117
122
  export * from "./@types/window/PopupWindow";
118
123
  export * from "./@types/window/WindowManager";
124
+
125
+ export * from "./@types/activity/ActivityType";
126
+ export * from "./@types/activity/Activity";
127
+ export * from "./@types/activity/Intent";
128
+ export * from "./@types/activity/ExtraValue";
129
+
130
+ export * from "./@types/host/EditContext";
131
+ export * from "./@types/host/backend/NodePlatformHostConfig";
132
+ export * from "./@types/host/backend/WebPlatformHostConfig";
133
+ export * from "./@types/host/backend/CanvaskitPlatformHostConfig";
134
+
135
+ export * from "./@types/app/ApplicationConfig";
136
+ export * from "./@types/app/Application";
137
+ export * from "./@types/app/ApplicationCreatorConfig";
138
+ export * from "./@types/app/ApplicationCreator";
139
+
140
+ export * from "./@types/shared/ContextUtils";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compass-framework/core",
3
- "version": "1.2.61",
3
+ "version": "1.2.63",
4
4
  "description": "@compass-framework/core public api",
5
5
  "types": "./index.d.ts",
6
6
  "main": "./index.js",