@khanacademy/wonder-blocks-core 11.1.0 → 12.0.0
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/CHANGELOG.md +6 -0
- package/dist/components/text.d.ts +42 -42
- package/dist/es/index.js +10 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +10 -0
- package/dist/util/keys.d.ts +12 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-core
|
|
2
2
|
|
|
3
|
+
## 12.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 0199324d: Fixes keyboard tests in Dropdown and Clickable with specific key events. We now check `event.key` instead of `event.which` or `event.keyCode` to remove deprecated event properties and match the keys returned from Testing Library/userEvent.
|
|
8
|
+
|
|
3
9
|
## 11.1.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -13,54 +13,54 @@ import * as React from "react";
|
|
|
13
13
|
*/
|
|
14
14
|
declare const Text: React.ForwardRefExoticComponent<{
|
|
15
15
|
children?: React.ReactNode;
|
|
16
|
-
style?: import("
|
|
17
|
-
testId?: string
|
|
18
|
-
lang?: string
|
|
19
|
-
className?: string
|
|
20
|
-
htmlFor?: string
|
|
21
|
-
tabIndex?: number
|
|
22
|
-
id?: string
|
|
23
|
-
title?: string
|
|
24
|
-
"data-modal-launcher-portal"?: boolean
|
|
25
|
-
"data-placement"?: string
|
|
16
|
+
style?: import("..").StyleType;
|
|
17
|
+
testId?: string;
|
|
18
|
+
lang?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
htmlFor?: string;
|
|
21
|
+
tabIndex?: number;
|
|
22
|
+
id?: string;
|
|
23
|
+
title?: string;
|
|
24
|
+
"data-modal-launcher-portal"?: boolean;
|
|
25
|
+
"data-placement"?: string;
|
|
26
26
|
} & Readonly<import("..").AriaAttributes> & Readonly<{
|
|
27
|
-
role?: import("..").AriaRole
|
|
27
|
+
role?: import("..").AriaRole;
|
|
28
28
|
}> & {
|
|
29
|
-
onMouseDown?: (
|
|
30
|
-
onMouseUp?: (
|
|
31
|
-
onMouseMove?: (
|
|
32
|
-
onClick?: (
|
|
33
|
-
onDoubleClick?: (
|
|
34
|
-
onMouseEnter?: (
|
|
35
|
-
onMouseLeave?: (
|
|
36
|
-
onMouseOut?: (
|
|
37
|
-
onMouseOver?: (
|
|
38
|
-
onDrag?: (
|
|
39
|
-
onDragEnd?: (
|
|
40
|
-
onDragEnter?: (
|
|
41
|
-
onDragExit?: (
|
|
42
|
-
onDragLeave?: (
|
|
43
|
-
onDragOver?: (
|
|
44
|
-
onDragStart?: (
|
|
45
|
-
onDrop?: (
|
|
29
|
+
onMouseDown?: (e: React.MouseEvent) => unknown;
|
|
30
|
+
onMouseUp?: (e: React.MouseEvent) => unknown;
|
|
31
|
+
onMouseMove?: (e: React.MouseEvent) => unknown;
|
|
32
|
+
onClick?: (e: React.MouseEvent) => unknown;
|
|
33
|
+
onDoubleClick?: (e: React.MouseEvent) => unknown;
|
|
34
|
+
onMouseEnter?: (e: React.MouseEvent) => unknown;
|
|
35
|
+
onMouseLeave?: (e: React.MouseEvent) => unknown;
|
|
36
|
+
onMouseOut?: (e: React.MouseEvent) => unknown;
|
|
37
|
+
onMouseOver?: (e: React.MouseEvent) => unknown;
|
|
38
|
+
onDrag?: (e: React.MouseEvent) => unknown;
|
|
39
|
+
onDragEnd?: (e: React.MouseEvent) => unknown;
|
|
40
|
+
onDragEnter?: (e: React.MouseEvent) => unknown;
|
|
41
|
+
onDragExit?: (e: React.MouseEvent) => unknown;
|
|
42
|
+
onDragLeave?: (e: React.MouseEvent) => unknown;
|
|
43
|
+
onDragOver?: (e: React.MouseEvent) => unknown;
|
|
44
|
+
onDragStart?: (e: React.MouseEvent) => unknown;
|
|
45
|
+
onDrop?: (e: React.MouseEvent) => unknown;
|
|
46
46
|
} & {
|
|
47
|
-
onKeyDown?: (
|
|
48
|
-
onKeyPress?: (
|
|
49
|
-
onKeyUp?: (
|
|
47
|
+
onKeyDown?: (e: React.KeyboardEvent) => unknown;
|
|
48
|
+
onKeyPress?: (e: React.KeyboardEvent) => unknown;
|
|
49
|
+
onKeyUp?: (e: React.KeyboardEvent) => unknown;
|
|
50
50
|
} & {
|
|
51
|
-
onChange?: (
|
|
52
|
-
onInput?: (
|
|
53
|
-
onInvalid?: (
|
|
54
|
-
onSubmit?: (
|
|
51
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
52
|
+
onInput?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
53
|
+
onInvalid?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
54
|
+
onSubmit?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
55
55
|
} & {
|
|
56
|
-
onTouchCancel?: (
|
|
57
|
-
onTouchEnd?: (
|
|
58
|
-
onTouchMove?: (
|
|
59
|
-
onTouchStart?: (
|
|
56
|
+
onTouchCancel?: (e: React.TouchEvent) => unknown;
|
|
57
|
+
onTouchEnd?: (e: React.TouchEvent) => unknown;
|
|
58
|
+
onTouchMove?: (e: React.TouchEvent) => unknown;
|
|
59
|
+
onTouchStart?: (e: React.TouchEvent) => unknown;
|
|
60
60
|
} & {
|
|
61
|
-
onFocus?: (
|
|
62
|
-
onBlur?: (
|
|
61
|
+
onFocus?: (e: React.FocusEvent) => unknown;
|
|
62
|
+
onBlur?: (e: React.FocusEvent) => unknown;
|
|
63
63
|
} & {
|
|
64
|
-
tag?: string
|
|
64
|
+
tag?: string;
|
|
65
65
|
} & React.RefAttributes<unknown>>;
|
|
66
66
|
export default Text;
|
package/dist/es/index.js
CHANGED
|
@@ -355,4 +355,13 @@ const RenderStateRoot = ({
|
|
|
355
355
|
}, children);
|
|
356
356
|
};
|
|
357
357
|
|
|
358
|
-
|
|
358
|
+
const keys = {
|
|
359
|
+
enter: "Enter",
|
|
360
|
+
escape: "Escape",
|
|
361
|
+
tab: "Tab",
|
|
362
|
+
space: " ",
|
|
363
|
+
up: "ArrowUp",
|
|
364
|
+
down: "ArrowDown"
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
export { Id, InitialFallback, RenderState, RenderStateRoot, Server, Text, View, addStyle, keys, useForceUpdate, useIsMounted, useLatestRef, useOnMountEffect, useOnline, usePreHydrationEffect, useRenderState };
|
package/dist/index.d.ts
CHANGED
|
@@ -15,3 +15,4 @@ export { RenderStateRoot } from "./components/render-state-root";
|
|
|
15
15
|
export { RenderState } from "./components/render-state-context";
|
|
16
16
|
export type { AriaRole, AriaAttributes } from "./util/aria-types";
|
|
17
17
|
export type { AriaProps, StyleType, PropsFor } from "./util/types";
|
|
18
|
+
export { keys } from "./util/keys";
|
package/dist/index.js
CHANGED
|
@@ -382,6 +382,15 @@ const RenderStateRoot = ({
|
|
|
382
382
|
}, children);
|
|
383
383
|
};
|
|
384
384
|
|
|
385
|
+
const keys = {
|
|
386
|
+
enter: "Enter",
|
|
387
|
+
escape: "Escape",
|
|
388
|
+
tab: "Tab",
|
|
389
|
+
space: " ",
|
|
390
|
+
up: "ArrowUp",
|
|
391
|
+
down: "ArrowDown"
|
|
392
|
+
};
|
|
393
|
+
|
|
385
394
|
exports.Id = Id;
|
|
386
395
|
exports.InitialFallback = InitialFallback;
|
|
387
396
|
exports.RenderState = RenderState;
|
|
@@ -390,6 +399,7 @@ exports.Server = Server;
|
|
|
390
399
|
exports.Text = Text;
|
|
391
400
|
exports.View = View;
|
|
392
401
|
exports.addStyle = addStyle;
|
|
402
|
+
exports.keys = keys;
|
|
393
403
|
exports.useForceUpdate = useForceUpdate;
|
|
394
404
|
exports.useIsMounted = useIsMounted;
|
|
395
405
|
exports.useLatestRef = useLatestRef;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Key value mapping reference:
|
|
3
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
|
|
4
|
+
*/
|
|
5
|
+
export declare const keys: {
|
|
6
|
+
readonly enter: "Enter";
|
|
7
|
+
readonly escape: "Escape";
|
|
8
|
+
readonly tab: "Tab";
|
|
9
|
+
readonly space: " ";
|
|
10
|
+
readonly up: "ArrowUp";
|
|
11
|
+
readonly down: "ArrowDown";
|
|
12
|
+
};
|