@@ -10,19 +10,16 @@ import getVendorPrefixedEventName from './getVendorPrefixedEventName';
1010/**
1111 * Types of raw signals from the browser caught at the top level.
1212 *
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.
1616 */
17- const topLevelTypes = {
18- topAbort : 'abort' ,
17+ export const topLevelTypes = {
1918 topAnimationEnd : getVendorPrefixedEventName ( 'animationend' ) ,
2019 topAnimationIteration : getVendorPrefixedEventName ( 'animationiteration' ) ,
2120 topAnimationStart : getVendorPrefixedEventName ( 'animationstart' ) ,
2221 topBlur : 'blur' ,
2322 topCancel : 'cancel' ,
24- topCanPlay : 'canplay' ,
25- topCanPlayThrough : 'canplaythrough' ,
2623 topChange : 'change' ,
2724 topClick : 'click' ,
2825 topClose : 'close' ,
@@ -41,54 +38,60 @@ const topLevelTypes = {
4138 topDragOver : 'dragover' ,
4239 topDragStart : 'dragstart' ,
4340 topDrop : 'drop' ,
44- topDurationChange : 'durationchange' ,
45- topEmptied : 'emptied' ,
46- topEncrypted : 'encrypted' ,
47- topEnded : 'ended' ,
48- topError : 'error' ,
4941 topFocus : 'focus' ,
5042 topInput : 'input' ,
5143 topKeyDown : 'keydown' ,
5244 topKeyPress : 'keypress' ,
5345 topKeyUp : 'keyup' ,
54- topLoadedData : 'loadeddata' ,
5546 topLoad : 'load' ,
56- topLoadedMetadata : 'loadedmetadata' ,
5747 topLoadStart : 'loadstart' ,
5848 topMouseDown : 'mousedown' ,
5949 topMouseMove : 'mousemove' ,
6050 topMouseOut : 'mouseout' ,
6151 topMouseOver : 'mouseover' ,
6252 topMouseUp : 'mouseup' ,
6353 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' ,
6483 topPause : 'pause' ,
6584 topPlay : 'play' ,
6685 topPlaying : 'playing' ,
6786 topProgress : 'progress' ,
6887 topRateChange : 'ratechange' ,
69- topScroll : 'scroll' ,
7088 topSeeked : 'seeked' ,
7189 topSeeking : 'seeking' ,
72- topSelectionChange : 'selectionchange' ,
7390 topStalled : 'stalled' ,
7491 topSuspend : 'suspend' ,
75- topTextInput : 'textInput' ,
7692 topTimeUpdate : 'timeupdate' ,
77- topToggle : 'toggle' ,
78- topTouchCancel : 'touchcancel' ,
79- topTouchEnd : 'touchend' ,
80- topTouchMove : 'touchmove' ,
81- topTouchStart : 'touchstart' ,
82- topTransitionEnd : getVendorPrefixedEventName ( 'transitionend' ) ,
8393 topVolumeChange : 'volumechange' ,
8494 topWaiting : 'waiting' ,
85- topWheel : 'wheel' ,
8695} ;
8796
8897export type TopLevelTypes = $Enum < typeof topLevelTypes > ;
89-
90- const BrowserEventConstants = {
91- topLevelTypes,
92- } ;
93-
94- export default BrowserEventConstants ;
0 commit comments