@@ -10,19 +10,16 @@ import getVendorPrefixedEventName from './getVendorPrefixedEventName';
10
10
/**
11
11
* Types of raw signals from the browser caught at the top level.
12
12
*
13
- * For events like 'submit' which don't consistently bubble (which we
14
- * trap at a lower node than `document`), binding at `document` would
15
- * cause duplicate events so we don't include them here.
13
+ * For events like 'submit' or audio/video events which don't consistently
14
+ * bubble (which we trap at a lower node than `document`), binding
15
+ * at `document` would cause duplicate events so we don't include them here.
16
16
*/
17
- const topLevelTypes = {
18
- topAbort : 'abort' ,
17
+ export const topLevelTypes = {
19
18
topAnimationEnd : getVendorPrefixedEventName ( 'animationend' ) ,
20
19
topAnimationIteration : getVendorPrefixedEventName ( 'animationiteration' ) ,
21
20
topAnimationStart : getVendorPrefixedEventName ( 'animationstart' ) ,
22
21
topBlur : 'blur' ,
23
22
topCancel : 'cancel' ,
24
- topCanPlay : 'canplay' ,
25
- topCanPlayThrough : 'canplaythrough' ,
26
23
topChange : 'change' ,
27
24
topClick : 'click' ,
28
25
topClose : 'close' ,
@@ -41,54 +38,60 @@ const topLevelTypes = {
41
38
topDragOver : 'dragover' ,
42
39
topDragStart : 'dragstart' ,
43
40
topDrop : 'drop' ,
44
- topDurationChange : 'durationchange' ,
45
- topEmptied : 'emptied' ,
46
- topEncrypted : 'encrypted' ,
47
- topEnded : 'ended' ,
48
- topError : 'error' ,
49
41
topFocus : 'focus' ,
50
42
topInput : 'input' ,
51
43
topKeyDown : 'keydown' ,
52
44
topKeyPress : 'keypress' ,
53
45
topKeyUp : 'keyup' ,
54
- topLoadedData : 'loadeddata' ,
55
46
topLoad : 'load' ,
56
- topLoadedMetadata : 'loadedmetadata' ,
57
47
topLoadStart : 'loadstart' ,
58
48
topMouseDown : 'mousedown' ,
59
49
topMouseMove : 'mousemove' ,
60
50
topMouseOut : 'mouseout' ,
61
51
topMouseOver : 'mouseover' ,
62
52
topMouseUp : 'mouseup' ,
63
53
topPaste : 'paste' ,
54
+ topScroll : 'scroll' ,
55
+ topSelectionChange : 'selectionchange' ,
56
+ topTextInput : 'textInput' ,
57
+ topToggle : 'toggle' ,
58
+ topTouchCancel : 'touchcancel' ,
59
+ topTouchEnd : 'touchend' ,
60
+ topTouchMove : 'touchmove' ,
61
+ topTouchStart : 'touchstart' ,
62
+ topTransitionEnd : getVendorPrefixedEventName ( 'transitionend' ) ,
63
+ topWheel : 'wheel' ,
64
+ } ;
65
+
66
+ // There are so many media events, it makes sense to just
67
+ // maintain a list of them. Note these aren't technically
68
+ // "top-level" since they don't bubble. We should come up
69
+ // with a better naming convention if we come to refactoring
70
+ // the event system.
71
+ export const mediaEventTypes = {
72
+ topAbort : 'abort' ,
73
+ topCanPlay : 'canplay' ,
74
+ topCanPlayThrough : 'canplaythrough' ,
75
+ topDurationChange : 'durationchange' ,
76
+ topEmptied : 'emptied' ,
77
+ topEncrypted : 'encrypted' ,
78
+ topEnded : 'ended' ,
79
+ topError : 'error' ,
80
+ topLoadedData : 'loadeddata' ,
81
+ topLoadedMetadata : 'loadedmetadata' ,
82
+ topLoadStart : 'loadstart' ,
64
83
topPause : 'pause' ,
65
84
topPlay : 'play' ,
66
85
topPlaying : 'playing' ,
67
86
topProgress : 'progress' ,
68
87
topRateChange : 'ratechange' ,
69
- topScroll : 'scroll' ,
70
88
topSeeked : 'seeked' ,
71
89
topSeeking : 'seeking' ,
72
- topSelectionChange : 'selectionchange' ,
73
90
topStalled : 'stalled' ,
74
91
topSuspend : 'suspend' ,
75
- topTextInput : 'textInput' ,
76
92
topTimeUpdate : 'timeupdate' ,
77
- topToggle : 'toggle' ,
78
- topTouchCancel : 'touchcancel' ,
79
- topTouchEnd : 'touchend' ,
80
- topTouchMove : 'touchmove' ,
81
- topTouchStart : 'touchstart' ,
82
- topTransitionEnd : getVendorPrefixedEventName ( 'transitionend' ) ,
83
93
topVolumeChange : 'volumechange' ,
84
94
topWaiting : 'waiting' ,
85
- topWheel : 'wheel' ,
86
95
} ;
87
96
88
97
export type TopLevelTypes = $Enum < typeof topLevelTypes > ;
89
-
90
- const BrowserEventConstants = {
91
- topLevelTypes,
92
- } ;
93
-
94
- export default BrowserEventConstants ;
0 commit comments