UNPKG

alignment.js

Version:

A suite of reusable [React](http://reactjs.org/) components for creating a variety of visualizations involving [multiple sequence alignments](https://en.wikipedia.org/wiki/Multiple_sequence_alignment). [View the live demo here](http://alignment.hyphy.org/

62 lines (49 loc) 2.98 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = _default; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } /* Temporary fix for a breaking change in Chrome to React * See https://github.com/facebook/react/issues/14856 */ function _default(document) { var EVENTS_TO_MODIFY = ["touchstart", "touchmove", "touchend", "touchcancel", "wheel"]; var originalAddEventListener = document.addEventListener.bind(); document.addEventListener = function (type, listener, options, wantsUntrusted) { var modOptions = options; if (EVENTS_TO_MODIFY.includes(type)) { if (typeof options === "boolean") { modOptions = { capture: options, passive: false }; } else if (_typeof(options) === "object") { modOptions = _objectSpread({}, options, { passive: false }); } } return originalAddEventListener(type, listener, modOptions, wantsUntrusted); }; var originalRemoveEventListener = document.removeEventListener.bind(); document.removeEventListener = function (type, listener, options) { var modOptions = options; if (EVENTS_TO_MODIFY.includes(type)) { if (typeof options === "boolean") { modOptions = { capture: options, passive: false }; } else if (_typeof(options) === "object") { modOptions = _objectSpread({}, options, { passive: false }); } } return originalRemoveEventListener(type, listener, modOptions); }; }