@m2c2kit/addons 0.3.15 → 0.3.16
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.d.ts +267 -48
- package/dist/index.js +869 -412
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import * as _m2c2kit_core from '@m2c2kit/core';
|
|
2
|
+
import { CompositeOptions, Size, RgbaColor, M2Node, Composite, TextOptions, IText, StringInterpolationMap, M2NodeEvent, CallbackOptions, Point, ShapeOptions, CompositeEvent, LabelHorizontalAlignmentMode, Transition, StoryOptions, Story, Scene, SceneOptions } from '@m2c2kit/core';
|
|
1
3
|
import { Canvas } from 'canvaskit-wasm';
|
|
2
|
-
import { CompositeOptions, Size, RgbaColor, Composite, M2Node, GlobalVariables, TextOptions, IText, StringInterpolationMap, M2NodeEvent, CallbackOptions, Point, ShapeOptions, LabelHorizontalAlignmentMode, Transition, StoryOptions, Story, Scene, SceneOptions } from '@m2c2kit/core';
|
|
3
4
|
|
|
4
5
|
interface GridOptions extends CompositeOptions {
|
|
5
6
|
/** Number of rows in the grid. Must be 1 or greater */
|
|
@@ -8,7 +9,7 @@ interface GridOptions extends CompositeOptions {
|
|
|
8
9
|
columns: number;
|
|
9
10
|
/** Size of the grid in pixels */
|
|
10
11
|
size: Size;
|
|
11
|
-
/** Background color of the grid. Default is a transparent
|
|
12
|
+
/** Background color of the grid. Default is a transparent blue */
|
|
12
13
|
backgroundColor?: RgbaColor;
|
|
13
14
|
/** Width of the grid lines. Default is 1 */
|
|
14
15
|
gridLineWidth?: number;
|
|
@@ -20,16 +21,17 @@ interface GridChild {
|
|
|
20
21
|
row: number;
|
|
21
22
|
column: number;
|
|
22
23
|
}
|
|
23
|
-
declare class Grid extends Composite {
|
|
24
|
+
declare class Grid extends Composite implements GridOptions {
|
|
24
25
|
compositeType: string;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
private _rows;
|
|
27
|
+
private _columns;
|
|
28
|
+
private _gridBackgroundColor;
|
|
29
|
+
private _gridLineColor;
|
|
30
|
+
private _gridLineWidth;
|
|
30
31
|
cellWidth: number;
|
|
31
32
|
cellHeight: number;
|
|
32
|
-
|
|
33
|
+
private _gridChildren;
|
|
34
|
+
private cellContainers;
|
|
33
35
|
private _gridBackground?;
|
|
34
36
|
/**
|
|
35
37
|
* A rectangular grid that supports placement of nodes within the grid's
|
|
@@ -42,9 +44,44 @@ declare class Grid extends Composite {
|
|
|
42
44
|
* @param options - {@link GridOptions}
|
|
43
45
|
*/
|
|
44
46
|
constructor(options: GridOptions);
|
|
47
|
+
get completeNodeOptions(): {
|
|
48
|
+
rows: number;
|
|
49
|
+
columns: number;
|
|
50
|
+
size: Size;
|
|
51
|
+
backgroundColor: RgbaColor;
|
|
52
|
+
gridLineWidth: number;
|
|
53
|
+
gridLineColor: RgbaColor;
|
|
54
|
+
anchorPoint?: _m2c2kit_core.Point;
|
|
55
|
+
zPosition?: number;
|
|
56
|
+
name?: string;
|
|
57
|
+
position?: _m2c2kit_core.Point;
|
|
58
|
+
scale?: number;
|
|
59
|
+
alpha?: number;
|
|
60
|
+
zRotation?: number;
|
|
61
|
+
isUserInteractionEnabled?: boolean;
|
|
62
|
+
draggable?: boolean;
|
|
63
|
+
hidden?: boolean;
|
|
64
|
+
layout?: _m2c2kit_core.Layout;
|
|
65
|
+
uuid?: string;
|
|
66
|
+
suppressEvents?: boolean;
|
|
67
|
+
};
|
|
45
68
|
initialize(): void;
|
|
46
69
|
private get gridBackground();
|
|
47
70
|
private set gridBackground(value);
|
|
71
|
+
/**
|
|
72
|
+
* note: below we do not have getter and setter for size because the getter
|
|
73
|
+
* and setter in M2Node will handle it.
|
|
74
|
+
*/
|
|
75
|
+
get rows(): number;
|
|
76
|
+
set rows(rows: number);
|
|
77
|
+
get columns(): number;
|
|
78
|
+
set columns(columns: number);
|
|
79
|
+
get gridBackgroundColor(): RgbaColor;
|
|
80
|
+
set gridBackgroundColor(backgroundColor: RgbaColor);
|
|
81
|
+
get gridLineWidth(): number;
|
|
82
|
+
set gridLineWidth(gridLineWidth: number);
|
|
83
|
+
get gridLineColor(): RgbaColor;
|
|
84
|
+
set gridLineColor(gridLineColor: RgbaColor);
|
|
48
85
|
dispose(): void;
|
|
49
86
|
/**
|
|
50
87
|
* Duplicates a node using deep copy.
|
|
@@ -61,11 +98,23 @@ declare class Grid extends Composite {
|
|
|
61
98
|
draw(canvas: Canvas): void;
|
|
62
99
|
warmup(canvas: Canvas): void;
|
|
63
100
|
/**
|
|
64
|
-
*
|
|
101
|
+
* The child nodes that have been added to the grid.
|
|
102
|
+
*
|
|
103
|
+
* @remarks Do not set this property directly. Use the methods for adding
|
|
104
|
+
* and removing grid children, such as `addAtCell()`, `removeAllAtCell()`,
|
|
105
|
+
* `removeGridChild()`, and `removeAllGridChildren()`.
|
|
106
|
+
*/
|
|
107
|
+
get gridChildren(): Array<GridChild>;
|
|
108
|
+
set gridChildren(gridChildren: Array<GridChild>);
|
|
109
|
+
/**
|
|
110
|
+
* Removes all grid children from the grid.
|
|
111
|
+
*
|
|
112
|
+
* @remarks This retains grid lines and grid appearance.
|
|
65
113
|
*/
|
|
66
|
-
|
|
114
|
+
removeAllGridChildren(): void;
|
|
67
115
|
/**
|
|
68
|
-
* Adds a node to the grid at the specified row and column
|
|
116
|
+
* Adds a node as a grid child to the grid at the specified row and column
|
|
117
|
+
* position.
|
|
69
118
|
*
|
|
70
119
|
* @param node - node to add to the grid
|
|
71
120
|
* @param row - row position within grid to add node; zero-based indexing
|
|
@@ -73,46 +122,44 @@ declare class Grid extends Composite {
|
|
|
73
122
|
*/
|
|
74
123
|
addAtCell(node: M2Node, row: number, column: number): void;
|
|
75
124
|
/**
|
|
76
|
-
* Removes all child nodes at the specified row and column position.
|
|
125
|
+
* Removes all grid child nodes at the specified row and column position.
|
|
77
126
|
*
|
|
78
|
-
* @param row - row position within grid at which to remove children; zero-based indexing
|
|
79
|
-
* @param column - column position within grid at which to remove children; zero-based indexing
|
|
127
|
+
* @param row - row position within grid at which to remove grid children; zero-based indexing
|
|
128
|
+
* @param column - column position within grid at which to remove grid children; zero-based indexing
|
|
80
129
|
*/
|
|
81
130
|
removeAllAtCell(row: number, column: number): void;
|
|
82
131
|
/**
|
|
83
|
-
* Removes the child node from the grid.
|
|
132
|
+
* Removes the grid child node from the grid.
|
|
84
133
|
*
|
|
85
134
|
* @param node - node to remove
|
|
86
135
|
*/
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
136
|
+
removeGridChild(node: M2Node): void;
|
|
137
|
+
addChild(child: M2Node): void;
|
|
138
|
+
removeAllChildren(): void;
|
|
139
|
+
removeChild(child: M2Node): void;
|
|
140
|
+
removeChildren(children: M2Node[]): void;
|
|
92
141
|
}
|
|
93
|
-
//# sourceMappingURL=Globals.d.ts.map
|
|
94
142
|
|
|
95
143
|
interface ButtonOptions extends CompositeOptions, TextOptions {
|
|
96
|
-
/** Size of button */
|
|
144
|
+
/** Size of button. Default is 200 wide by 50 high. */
|
|
97
145
|
size?: Size;
|
|
98
|
-
/** Corner radius of button; can be used to make rounded corners */
|
|
146
|
+
/** Corner radius of button; can be used to make rounded corners. Default is 9 */
|
|
99
147
|
cornerRadius?: number;
|
|
100
|
-
/** Background color of button. Default is WebColors.
|
|
148
|
+
/** Background color of button. Default is WebColors.Black */
|
|
101
149
|
backgroundColor?: RgbaColor;
|
|
102
150
|
/** Color of button text. Default is WebColors.White */
|
|
103
151
|
fontColor?: RgbaColor;
|
|
104
152
|
/** Names of multiple fonts to use for text. For example, if a text font and an emoji font are to be used together. Must have been previously loaded */
|
|
105
153
|
fontNames?: Array<string>;
|
|
154
|
+
/** Size of button text. Default is 20. */
|
|
155
|
+
fontSize?: number;
|
|
106
156
|
}
|
|
107
|
-
declare class Button extends Composite implements IText {
|
|
157
|
+
declare class Button extends Composite implements IText, ButtonOptions {
|
|
108
158
|
compositeType: string;
|
|
159
|
+
isText: boolean;
|
|
109
160
|
private _backgroundColor;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
height: number;
|
|
113
|
-
};
|
|
114
|
-
cornerRadius: number;
|
|
115
|
-
fontSize: number;
|
|
161
|
+
private _cornerRadius;
|
|
162
|
+
private _fontSize;
|
|
116
163
|
private _text;
|
|
117
164
|
private _fontColor;
|
|
118
165
|
private _fontName;
|
|
@@ -130,6 +177,31 @@ declare class Button extends Composite implements IText {
|
|
|
130
177
|
* @param options - {@link ButtonOptions}
|
|
131
178
|
*/
|
|
132
179
|
constructor(options: ButtonOptions);
|
|
180
|
+
get completeNodeOptions(): {
|
|
181
|
+
size: Size;
|
|
182
|
+
cornerRadius: number;
|
|
183
|
+
backgroundColor: RgbaColor;
|
|
184
|
+
fontNames: string[] | undefined;
|
|
185
|
+
text?: string;
|
|
186
|
+
fontName?: string;
|
|
187
|
+
fontColor?: RgbaColor;
|
|
188
|
+
fontSize?: number;
|
|
189
|
+
interpolation?: StringInterpolationMap;
|
|
190
|
+
localize?: boolean;
|
|
191
|
+
anchorPoint?: _m2c2kit_core.Point;
|
|
192
|
+
zPosition?: number;
|
|
193
|
+
name?: string;
|
|
194
|
+
position?: _m2c2kit_core.Point;
|
|
195
|
+
scale?: number;
|
|
196
|
+
alpha?: number;
|
|
197
|
+
zRotation?: number;
|
|
198
|
+
isUserInteractionEnabled?: boolean;
|
|
199
|
+
draggable?: boolean;
|
|
200
|
+
hidden?: boolean;
|
|
201
|
+
layout?: _m2c2kit_core.Layout;
|
|
202
|
+
uuid?: string;
|
|
203
|
+
suppressEvents?: boolean;
|
|
204
|
+
};
|
|
133
205
|
initialize(): void;
|
|
134
206
|
dispose(): void;
|
|
135
207
|
get text(): string;
|
|
@@ -142,6 +214,10 @@ declare class Button extends Composite implements IText {
|
|
|
142
214
|
set fontName(fontName: string | undefined);
|
|
143
215
|
get fontNames(): Array<string> | undefined;
|
|
144
216
|
set fontNames(fontNames: Array<string> | undefined);
|
|
217
|
+
get cornerRadius(): number;
|
|
218
|
+
set cornerRadius(cornerRadius: number);
|
|
219
|
+
get fontSize(): number;
|
|
220
|
+
set fontSize(fontSize: number);
|
|
145
221
|
get interpolation(): StringInterpolationMap;
|
|
146
222
|
set interpolation(interpolation: StringInterpolationMap);
|
|
147
223
|
get localize(): boolean;
|
|
@@ -194,8 +270,6 @@ declare class Dialog extends Composite {
|
|
|
194
270
|
contentText: string;
|
|
195
271
|
positiveButtonText: string;
|
|
196
272
|
negativeButtonText: string;
|
|
197
|
-
zPosition: number;
|
|
198
|
-
hidden: boolean;
|
|
199
273
|
private _fontColor;
|
|
200
274
|
private backgroundPaint?;
|
|
201
275
|
constructor(options?: DialogOptions);
|
|
@@ -206,6 +280,8 @@ declare class Dialog extends Composite {
|
|
|
206
280
|
set backgroundColor(backgroundColor: RgbaColor);
|
|
207
281
|
get fontColor(): RgbaColor;
|
|
208
282
|
set fontColor(fontColor: RgbaColor);
|
|
283
|
+
get hidden(): boolean;
|
|
284
|
+
set hidden(hidden: boolean);
|
|
209
285
|
/**
|
|
210
286
|
* Duplicates a node using deep copy.
|
|
211
287
|
*
|
|
@@ -310,6 +386,7 @@ declare class DrawPad extends Composite {
|
|
|
310
386
|
private isDrawingPointerDown;
|
|
311
387
|
private pointerIsDownAndPointerLeftDrawAreaWhenDown;
|
|
312
388
|
private currentStrokesNotAllowed;
|
|
389
|
+
private originalOptions;
|
|
313
390
|
/** Array of strokes created on the DrawPad, with position and timestamps
|
|
314
391
|
* of all interactions with each DrawPadStroke.
|
|
315
392
|
*/
|
|
@@ -323,6 +400,39 @@ declare class DrawPad extends Composite {
|
|
|
323
400
|
* @param options - {@link DrawPadOptions}
|
|
324
401
|
*/
|
|
325
402
|
constructor(options: DrawPadOptions);
|
|
403
|
+
get completeNodeOptions(): {
|
|
404
|
+
/** Size of the DrawPad */
|
|
405
|
+
size: Size;
|
|
406
|
+
/** Color of drawn lines. Default is red. */
|
|
407
|
+
lineColor?: RgbaColor;
|
|
408
|
+
/** Width of drawn lines. Default is 1 */
|
|
409
|
+
lineWidth?: number;
|
|
410
|
+
/** Background color of the DrawPad. Default is transparent. */
|
|
411
|
+
backgroundColor?: RgbaColor;
|
|
412
|
+
/** Width of the border. Default is 1 */
|
|
413
|
+
borderWidth?: number;
|
|
414
|
+
/** Color of the border. Default is black */
|
|
415
|
+
borderColor?: RgbaColor;
|
|
416
|
+
isUserInteractionEnabled?: boolean;
|
|
417
|
+
/** Should drawing resume when the pointer, in a down state, returns to the DrawPad area after exiting it while drawing? Default is false. */
|
|
418
|
+
resumeDrawingOnReturn?: boolean;
|
|
419
|
+
/** Should the user be permitted to draw only one continuous line? If so, no more drawing is allowed after the first stroke ends. */
|
|
420
|
+
continuousDrawingOnly?: boolean;
|
|
421
|
+
/** If `continuousDrawingOnly`, this is the maximum pixel distance from the last stroke's end point that the user is allowed to continue drawing with a new stroke. */
|
|
422
|
+
continuousDrawingOnlyExceptionDistance?: number;
|
|
423
|
+
name?: string;
|
|
424
|
+
position?: Point;
|
|
425
|
+
scale?: number;
|
|
426
|
+
alpha?: number;
|
|
427
|
+
zRotation?: number;
|
|
428
|
+
draggable?: boolean;
|
|
429
|
+
hidden?: boolean;
|
|
430
|
+
layout?: _m2c2kit_core.Layout;
|
|
431
|
+
uuid?: string;
|
|
432
|
+
suppressEvents?: boolean;
|
|
433
|
+
anchorPoint?: Point;
|
|
434
|
+
zPosition?: number;
|
|
435
|
+
};
|
|
326
436
|
initialize(): void;
|
|
327
437
|
private initializeDrawShape;
|
|
328
438
|
private initializeDrawArea;
|
|
@@ -416,6 +526,12 @@ declare class DrawPad extends Composite {
|
|
|
416
526
|
duplicate(newName?: string): DrawPad;
|
|
417
527
|
}
|
|
418
528
|
|
|
529
|
+
/**
|
|
530
|
+
* Additional, optional properties for a key in the `VirtualKeyboard`.
|
|
531
|
+
*
|
|
532
|
+
* @remarks This is used to define special keys (e.g., Shift, Backspace),
|
|
533
|
+
* keys with icons, and keys of custom size.
|
|
534
|
+
*/
|
|
419
535
|
interface KeyConfiguration {
|
|
420
536
|
/** Width of the key in units of a regular key width. Default is 1. */
|
|
421
537
|
widthRatio?: number;
|
|
@@ -434,7 +550,21 @@ interface KeyConfiguration {
|
|
|
434
550
|
/** ShapeOptions of the optional icon to show on the key. */
|
|
435
551
|
keyIconShapeOptions?: ShapeOptions;
|
|
436
552
|
}
|
|
437
|
-
|
|
553
|
+
/**
|
|
554
|
+
* A row in the `VirtualKeyboard`.
|
|
555
|
+
*
|
|
556
|
+
* @remarks Each row is an array of objects that defines a key, where each
|
|
557
|
+
* object can be one of the following:
|
|
558
|
+
* - a string, e.g., `a`. The string is the key in the keyboard's unshifted
|
|
559
|
+
* state (`a`), and the string's value after applying `toUpperCase()` is the key
|
|
560
|
+
* in the keyboard's shifted state (`A`).
|
|
561
|
+
* - an array of two strings, e.g., `["1", "!"]`. The first string is the key
|
|
562
|
+
* in the keyboard's unshifted state (`1`), and the second string is the key
|
|
563
|
+
* in the keyboard's shifted state (`!`).
|
|
564
|
+
* - A `KeyConfiguration` object, which can be used to further customize the
|
|
565
|
+
* key's appearance and behavior.
|
|
566
|
+
*/
|
|
567
|
+
type VirtualKeyboardRow = Array<string | Array<string> | KeyConfiguration>;
|
|
438
568
|
interface VirtualKeyboardOptions extends CompositeOptions {
|
|
439
569
|
size: Size;
|
|
440
570
|
/** Percent of the keyboard width that should be used for padding on the left and right sides. Default is .02 */
|
|
@@ -468,7 +598,11 @@ interface VirtualKeyboardOptions extends CompositeOptions {
|
|
|
468
598
|
/** If true, a preview of the key that will be pressed will be shown. */
|
|
469
599
|
showKeyDownPreview?: boolean;
|
|
470
600
|
}
|
|
471
|
-
interface VirtualKeyboardEvent extends
|
|
601
|
+
interface VirtualKeyboardEvent extends CompositeEvent {
|
|
602
|
+
type: "Composite";
|
|
603
|
+
compositeType: "VirtualKeyboard";
|
|
604
|
+
compositeEventType: "VirtualKeyboardKeyUp" | "VirtualKeyboardKeyDown" | "VirtualKeyboardKeyLeave";
|
|
605
|
+
target: VirtualKeyboard | string;
|
|
472
606
|
/** String that is generated when key is pressed, with any modifiers (e.g., Shift) applied. */
|
|
473
607
|
key: string;
|
|
474
608
|
/** Code for the key, not taking into account any modifiers. */
|
|
@@ -487,12 +621,12 @@ interface KeyTapMetadata {
|
|
|
487
621
|
buttons: number;
|
|
488
622
|
}
|
|
489
623
|
declare class VirtualKeyboard extends Composite {
|
|
490
|
-
compositeType
|
|
624
|
+
readonly compositeType = "VirtualKeyboard";
|
|
491
625
|
private keyboardHorizontalPaddingPercent;
|
|
492
626
|
private keyboardVerticalPaddingPercent;
|
|
493
627
|
private keyHorizontalPaddingPercent;
|
|
494
628
|
private keyVerticalPaddingPercent;
|
|
495
|
-
private
|
|
629
|
+
private keyboardRows;
|
|
496
630
|
private keysPerRow;
|
|
497
631
|
private fontSize;
|
|
498
632
|
private fontNames;
|
|
@@ -503,16 +637,64 @@ declare class VirtualKeyboard extends Composite {
|
|
|
503
637
|
private specialKeyDownColor;
|
|
504
638
|
private backgroundColor;
|
|
505
639
|
private showKeyDownPreview;
|
|
640
|
+
private originalOptions;
|
|
506
641
|
private shiftActivated;
|
|
507
|
-
private shiftKeyShape;
|
|
508
642
|
private keyShapes;
|
|
509
|
-
|
|
643
|
+
private keyLabels;
|
|
644
|
+
private letterCircle?;
|
|
645
|
+
private letterCircleLabel?;
|
|
510
646
|
/**
|
|
511
647
|
* An on-screen keyboard that can be used to enter text.
|
|
512
648
|
*
|
|
513
649
|
* @param options - {@link VirtualKeyboardOptions}
|
|
514
650
|
*/
|
|
515
651
|
constructor(options: VirtualKeyboardOptions);
|
|
652
|
+
get completeNodeOptions(): {
|
|
653
|
+
size: Size;
|
|
654
|
+
/** Percent of the keyboard width that should be used for padding on the left and right sides. Default is .02 */
|
|
655
|
+
keyboardHorizontalPaddingPercent?: number;
|
|
656
|
+
/** Percent of the keyboard height that should be used for padding on the top and bottom sides. Default is .025 */
|
|
657
|
+
keyboardVerticalPaddingPercent?: number;
|
|
658
|
+
/** Percent of each key's width that should be used for padding on the left and right sides. Default is .10 */
|
|
659
|
+
keyHorizontalPaddingPercent?: number;
|
|
660
|
+
/** Percent of each key's height that should be used for padding on the top and bottom sides. Default is .10 */
|
|
661
|
+
keyVerticalPaddingPercent?: number;
|
|
662
|
+
/** Configuration of keyboard rows. Order is from top to bottom rows. */
|
|
663
|
+
rows?: Array<VirtualKeyboardRow>;
|
|
664
|
+
/** How many regular-sized keys should fit in a row? This is used for scaling purposes. If not provided, it will be inferred from the row configuration. */
|
|
665
|
+
keysPerRow?: number;
|
|
666
|
+
/** Size of font for keys. */
|
|
667
|
+
fontSize?: number;
|
|
668
|
+
/** The fonts for the key labels, if not the default font. */
|
|
669
|
+
fontNames?: Array<string> | undefined;
|
|
670
|
+
/** Comma-separated list of keys to hide. */
|
|
671
|
+
hiddenKeys?: string;
|
|
672
|
+
/** If true, only capital letters will be shown. */
|
|
673
|
+
capitalLettersOnly?: boolean;
|
|
674
|
+
/** Color of keys. */
|
|
675
|
+
keyColor?: RgbaColor;
|
|
676
|
+
/** Color of keys when pressed. */
|
|
677
|
+
keyDownColor?: RgbaColor;
|
|
678
|
+
/** Color of special keys when pressed. */
|
|
679
|
+
specialKeyDownColor?: RgbaColor;
|
|
680
|
+
/** Background color of keyboard. */
|
|
681
|
+
backgroundColor?: RgbaColor;
|
|
682
|
+
/** If true, a preview of the key that will be pressed will be shown. */
|
|
683
|
+
showKeyDownPreview?: boolean;
|
|
684
|
+
name?: string;
|
|
685
|
+
position?: Point;
|
|
686
|
+
scale?: number;
|
|
687
|
+
alpha?: number;
|
|
688
|
+
zRotation?: number;
|
|
689
|
+
isUserInteractionEnabled?: boolean;
|
|
690
|
+
draggable?: boolean;
|
|
691
|
+
hidden?: boolean;
|
|
692
|
+
layout?: _m2c2kit_core.Layout;
|
|
693
|
+
uuid?: string;
|
|
694
|
+
suppressEvents?: boolean;
|
|
695
|
+
anchorPoint?: Point;
|
|
696
|
+
zPosition?: number;
|
|
697
|
+
};
|
|
516
698
|
initialize(): void;
|
|
517
699
|
/**
|
|
518
700
|
* Executes a callback when the user presses down on a key.
|
|
@@ -528,6 +710,45 @@ declare class VirtualKeyboard extends Composite {
|
|
|
528
710
|
* @param options
|
|
529
711
|
*/
|
|
530
712
|
onKeyUp(callback: (virtualKeyboardEvent: VirtualKeyboardEvent) => void, options?: CallbackOptions): void;
|
|
713
|
+
/**
|
|
714
|
+
* Executes a callback when the user has pressed a key with the pointer, but
|
|
715
|
+
* moves the pointer outside the key bounds before releasing the pointer.
|
|
716
|
+
*
|
|
717
|
+
* @remarks Typically, this event will not be used, since it is a user's
|
|
718
|
+
* inaccurate interaction with the keyboard. However, it can be used to
|
|
719
|
+
* provide feedback to the user that they have moved the pointer outside the
|
|
720
|
+
* key bounds, and thus the key stroke will not be registered.
|
|
721
|
+
*
|
|
722
|
+
* @param callback - function to execute
|
|
723
|
+
* @param options
|
|
724
|
+
*/
|
|
725
|
+
onKeyLeave(callback: (virtualKeyboardEvent: VirtualKeyboardEvent) => void, options?: CallbackOptions): void;
|
|
726
|
+
update(): void;
|
|
727
|
+
draw(canvas: Canvas): void;
|
|
728
|
+
warmup(canvas: Canvas): void;
|
|
729
|
+
duplicate(newName?: string | undefined): M2Node;
|
|
730
|
+
private handleKeyShapeTapDown;
|
|
731
|
+
private handleKeyShapeTapUp;
|
|
732
|
+
private handleKeyShapeTapLeave;
|
|
733
|
+
private getKeyAsString;
|
|
734
|
+
/**
|
|
735
|
+
* Converts the keyboard rows to the internal keyboard configuration.
|
|
736
|
+
*
|
|
737
|
+
* @remarks This normalizes the keyboard rows so that each key is a
|
|
738
|
+
* full `KeyConfigurationWithShape` object, instead of a string or array of
|
|
739
|
+
* strings.
|
|
740
|
+
*
|
|
741
|
+
* @param keyboardRows
|
|
742
|
+
* @returns the keyboard for internal use
|
|
743
|
+
*/
|
|
744
|
+
private internalKeyboardRowsToInternalKeyboardConfiguration;
|
|
745
|
+
handleCompositeEvent(event: VirtualKeyboardEvent): void;
|
|
746
|
+
private handleKeyDownEvent;
|
|
747
|
+
private handleKeyUpEvent;
|
|
748
|
+
private handleKeyLeaveEvent;
|
|
749
|
+
private showKeyboardShifted;
|
|
750
|
+
private showKeyboardNotShifted;
|
|
751
|
+
private createDefaultKeyboardRows;
|
|
531
752
|
private addVirtualKeyboardEventListener;
|
|
532
753
|
/**
|
|
533
754
|
* Does the `VirtualKeyboard` respond to user events? Default is true.
|
|
@@ -537,10 +758,6 @@ declare class VirtualKeyboard extends Composite {
|
|
|
537
758
|
* Does the `VirtualKeyboard` respond to user events? Default is true.
|
|
538
759
|
*/
|
|
539
760
|
set isUserInteractionEnabled(isUserInteractionEnabled: boolean);
|
|
540
|
-
update(): void;
|
|
541
|
-
draw(canvas: Canvas): void;
|
|
542
|
-
warmup(canvas: Canvas): void;
|
|
543
|
-
duplicate(newName?: string | undefined): M2Node;
|
|
544
761
|
}
|
|
545
762
|
|
|
546
763
|
interface InstructionScene {
|
|
@@ -756,7 +973,10 @@ interface LocalePickerResult {
|
|
|
756
973
|
/** Locale that was selected. Is undefined if dialog was dismissed. */
|
|
757
974
|
locale?: string;
|
|
758
975
|
}
|
|
759
|
-
interface LocalePickerEvent extends
|
|
976
|
+
interface LocalePickerEvent extends CompositeEvent {
|
|
977
|
+
type: "Composite";
|
|
978
|
+
compositeType: "LocalePicker";
|
|
979
|
+
compositeEventType: "LocalePickerResult";
|
|
760
980
|
result: LocalePickerResult;
|
|
761
981
|
}
|
|
762
982
|
interface LocaleSvg {
|
|
@@ -769,8 +989,7 @@ interface LocaleSvg {
|
|
|
769
989
|
width: number;
|
|
770
990
|
}
|
|
771
991
|
declare class LocalePicker extends Composite {
|
|
772
|
-
compositeType
|
|
773
|
-
zPosition: number;
|
|
992
|
+
readonly compositeType = "LocalePicker";
|
|
774
993
|
private readonly DEFAULT_FONT_SIZE;
|
|
775
994
|
automaticallyChangeLocale: boolean;
|
|
776
995
|
private _localeOptions;
|
|
@@ -862,4 +1081,4 @@ declare class LocalePicker extends Composite {
|
|
|
862
1081
|
duplicate(newName?: string): LocalePicker;
|
|
863
1082
|
}
|
|
864
1083
|
|
|
865
|
-
export { Button, type ButtonOptions, CountdownScene, type CountdownSceneOptions, Dialog, type DialogEvent, type DialogOptions, DialogResult, DrawPad, type DrawPadEvent, DrawPadEventType, type DrawPadItem, type DrawPadItemEvent, DrawPadItemEventType, type DrawPadOptions, type DrawPadStroke, Grid, type GridOptions, type InstructionScene, Instructions, type InstructionsOptions, type KeyConfiguration, type KeyTapMetadata, type LocaleOption, LocalePicker, type LocalePickerEvent, type LocalePickerIcon, type LocalePickerOptions, type LocalePickerResult, type StrokeInteraction, type TimerShape, VirtualKeyboard, type VirtualKeyboardEvent, type VirtualKeyboardOptions, type VirtualKeyboardRow };
|
|
1084
|
+
export { Button, type ButtonOptions, CountdownScene, type CountdownSceneOptions, Dialog, type DialogEvent, type DialogOptions, DialogResult, DrawPad, type DrawPadEvent, DrawPadEventType, type DrawPadItem, type DrawPadItemEvent, DrawPadItemEventType, type DrawPadOptions, type DrawPadStroke, Grid, type GridChild, type GridOptions, type InstructionScene, Instructions, type InstructionsOptions, type KeyConfiguration, type KeyTapMetadata, type LocaleOption, LocalePicker, type LocalePickerEvent, type LocalePickerIcon, type LocalePickerOptions, type LocalePickerResult, type StrokeInteraction, type TimerShape, VirtualKeyboard, type VirtualKeyboardEvent, type VirtualKeyboardOptions, type VirtualKeyboardRow };
|