the-forest/client/node_modules/jsx-ast-utils/lib/eventHandlers.js
2024-09-17 20:35:18 -04:00

40 lines
1.8 KiB
JavaScript

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.eventHandlersByType = undefined;
var _arrayPrototype = require('array.prototype.flat');
var _arrayPrototype2 = _interopRequireDefault(_arrayPrototype);
var _object = require('object.values');
var _object2 = _interopRequireDefault(_object);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Common event handlers for JSX element event binding.
*/
var eventHandlersByType = {
clipboard: ['onCopy', 'onCut', 'onPaste'],
composition: ['onCompositionEnd', 'onCompositionStart', 'onCompositionUpdate'],
keyboard: ['onKeyDown', 'onKeyPress', 'onKeyUp'],
focus: ['onFocus', 'onBlur'],
form: ['onChange', 'onInput', 'onSubmit'],
mouse: ['onClick', 'onContextMenu', 'onDblClick', 'onDoubleClick', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragExit', 'onDragLeave', 'onDragOver', 'onDragStart', 'onDrop', 'onMouseDown', 'onMouseEnter', 'onMouseLeave', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp'],
selection: ['onSelect'],
touch: ['onTouchCancel', 'onTouchEnd', 'onTouchMove', 'onTouchStart'],
ui: ['onScroll'],
wheel: ['onWheel'],
media: ['onAbort', 'onCanPlay', 'onCanPlayThrough', 'onDurationChange', 'onEmptied', 'onEncrypted', 'onEnded', 'onError', 'onLoadedData', 'onLoadedMetadata', 'onLoadStart', 'onPause', 'onPlay', 'onPlaying', 'onProgress', 'onRateChange', 'onSeeked', 'onSeeking', 'onStalled', 'onSuspend', 'onTimeUpdate', 'onVolumeChange', 'onWaiting'],
image: ['onLoad', 'onError'],
animation: ['onAnimationStart', 'onAnimationEnd', 'onAnimationIteration'],
transition: ['onTransitionEnd']
};
exports.default = (0, _arrayPrototype2.default)((0, _object2.default)(eventHandlersByType));
exports.eventHandlersByType = eventHandlersByType;