Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@antv/g-plugin-dom-interaction

Package Overview
Dependencies
Maintainers
55
Versions
224
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/g-plugin-dom-interaction - npm Package Compare versions

Comparing version 1.0.0-alpha.27 to 1.0.0-alpha.28

es/DOMInteractionPlugin.d.ts

181

dist/index.umd.js

@@ -1,170 +0,15 @@

(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("@antv/g"), require("mana-syringe"));
else if(typeof define === 'function' && define.amd)
define(["@antv/g", "mana-syringe"], factory);
else if(typeof exports === 'object')
exports["DOMInteraction"] = factory(require("@antv/g"), require("mana-syringe"));
else
root["G"] = root["G"] || {}, root["G"]["DOMInteraction"] = factory(root["G"], root["G"]["ManaSyringe"]);
})(window, function(__WEBPACK_EXTERNAL_MODULE__antv_g__, __WEBPACK_EXTERNAL_MODULE_mana_syringe__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./src/index.ts");
/******/ })
/************************************************************************/
/******/ ({
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("mana-syringe"),require("@antv/g")):"function"==typeof define&&define.amd?define(["mana-syringe","@antv/g"],t):"object"==typeof exports?exports.DOMInteraction=t(require("mana-syringe"),require("@antv/g")):(e.G=e.G||{},e.G.DOMInteraction=t(e.G.ManaSyringe,e.G))}(window,(function(e,t){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";n.r(t),n.d(t,"Plugin",(function(){return f}));var o=n(0);
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
/***/ "../../node_modules/tslib/tslib.es6.js":
/*!************************************************************************!*\
!*** /Users/panyuqi/Documents/webgl/g/node_modules/tslib/tslib.es6.js ***!
\************************************************************************/
/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__extends\", function() { return __extends; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__assign\", function() { return __assign; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__rest\", function() { return __rest; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__decorate\", function() { return __decorate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__param\", function() { return __param; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__metadata\", function() { return __metadata; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__awaiter\", function() { return __awaiter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__generator\", function() { return __generator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__createBinding\", function() { return __createBinding; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__exportStar\", function() { return __exportStar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__values\", function() { return __values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__read\", function() { return __read; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__spread\", function() { return __spread; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__spreadArrays\", function() { return __spreadArrays; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__spreadArray\", function() { return __spreadArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__await\", function() { return __await; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__asyncGenerator\", function() { return __asyncGenerator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__asyncDelegator\", function() { return __asyncDelegator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__asyncValues\", function() { return __asyncValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__makeTemplateObject\", function() { return __makeTemplateObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__importStar\", function() { return __importStar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__importDefault\", function() { return __importDefault; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__classPrivateFieldGet\", function() { return __classPrivateFieldGet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__classPrivateFieldSet\", function() { return __classPrivateFieldSet; });\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nfunction __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nfunction __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nfunction __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nvar __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nfunction __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nfunction __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nfunction __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nfunction __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nfunction __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nfunction __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nfunction __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nfunction __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nfunction __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nfunction __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nfunction __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nfunction __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nfunction __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nfunction __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nfunction __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\n\n//# sourceURL=webpack://G.DOMInteraction//Users/panyuqi/Documents/webgl/g/node_modules/tslib/tslib.es6.js?");
/***/ }),
/***/ "./src/DOMInteractionPlugin.ts":
/*!*************************************!*\
!*** ./src/DOMInteractionPlugin.ts ***!
\*************************************/
/*! exports provided: DOMInteractionPlugin */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DOMInteractionPlugin\", function() { return DOMInteractionPlugin; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"../../node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g */ \"@antv/g\");\n/* harmony import */ var _antv_g__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_antv_g__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var mana_syringe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! mana-syringe */ \"mana-syringe\");\n/* harmony import */ var mana_syringe__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(mana_syringe__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ \"./src/utils/index.ts\");\n\n\n\n\n/**\n * listen to mouse/touch/pointer events on DOM wrapper, trigger pointer events\n */\nvar DOMInteractionPlugin = /** @class */ (function () {\n function DOMInteractionPlugin() {\n }\n DOMInteractionPlugin_1 = DOMInteractionPlugin;\n DOMInteractionPlugin.prototype.apply = function (renderingService) {\n var _this = this;\n var onPointerMove = function (ev) {\n renderingService.hooks.pointerMove.call(ev);\n };\n var onPointerUp = function (ev) {\n renderingService.hooks.pointerUp.call(ev);\n };\n var onPointerDown = function (ev) {\n renderingService.hooks.pointerDown.call(ev);\n };\n var onPointerOver = function (ev) {\n renderingService.hooks.pointerOver.call(ev);\n };\n var onPointerOut = function (ev) {\n renderingService.hooks.pointerOut.call(ev);\n };\n var onPointerWheel = function (ev) {\n renderingService.hooks.pointerWheel.call(ev);\n };\n renderingService.hooks.init.tap(DOMInteractionPlugin_1.tag, function () {\n var $el = _this.contextService.getDomElement();\n if (_utils__WEBPACK_IMPORTED_MODULE_3__[\"supportsPointerEvents\"]) {\n self.document.addEventListener('pointermove', onPointerMove, true);\n $el.addEventListener('pointerdown', onPointerDown, true);\n $el.addEventListener('pointerleave', onPointerOut, true);\n $el.addEventListener('pointerover', onPointerOver, true);\n self.addEventListener('pointerup', onPointerUp, true);\n }\n else {\n self.document.addEventListener('mousemove', onPointerMove, true);\n $el.addEventListener('mousedown', onPointerDown, true);\n $el.addEventListener('mouseout', onPointerOut, true);\n $el.addEventListener('mouseover', onPointerOver, true);\n self.addEventListener('mouseup', onPointerUp, true);\n }\n // always look directly for touch events so that we can provide original data\n // In a future version we should change this to being just a fallback and rely solely on\n // PointerEvents whenever available\n if (_utils__WEBPACK_IMPORTED_MODULE_3__[\"supportsTouchEvents\"]) {\n $el.addEventListener('touchstart', onPointerDown, true);\n $el.addEventListener('touchend', onPointerUp, true);\n $el.addEventListener('touchmove', onPointerMove, true);\n }\n // use passive event listeners\n // @see https://zhuanlan.zhihu.com/p/24555031\n $el.addEventListener('wheel', onPointerWheel, {\n passive: true,\n capture: true,\n });\n });\n renderingService.hooks.destroy.tap(DOMInteractionPlugin_1.tag, function () {\n var $el = _this.contextService.getDomElement();\n if (_utils__WEBPACK_IMPORTED_MODULE_3__[\"supportsPointerEvents\"]) {\n self.document.removeEventListener('pointermove', onPointerMove, true);\n $el.removeEventListener('pointerdown', onPointerDown, true);\n $el.removeEventListener('pointerleave', onPointerOut, true);\n $el.removeEventListener('pointerover', onPointerOver, true);\n self.removeEventListener('pointerup', onPointerUp, true);\n }\n else {\n self.document.removeEventListener('mousemove', onPointerMove, true);\n $el.removeEventListener('mousedown', onPointerDown, true);\n $el.removeEventListener('mouseout', onPointerOut, true);\n $el.removeEventListener('mouseover', onPointerOver, true);\n self.removeEventListener('mouseup', onPointerUp, true);\n }\n if (_utils__WEBPACK_IMPORTED_MODULE_3__[\"supportsTouchEvents\"]) {\n $el.removeEventListener('touchstart', onPointerDown, true);\n $el.removeEventListener('touchend', onPointerUp, true);\n $el.removeEventListener('touchmove', onPointerMove, true);\n }\n $el.removeEventListener('wheel', onPointerWheel, true);\n });\n };\n var DOMInteractionPlugin_1;\n DOMInteractionPlugin.tag = 'DOMInteractionPlugin';\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__decorate\"])([\n Object(mana_syringe__WEBPACK_IMPORTED_MODULE_2__[\"inject\"])(_antv_g__WEBPACK_IMPORTED_MODULE_1__[\"ContextService\"]),\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__metadata\"])(\"design:type\", Object)\n ], DOMInteractionPlugin.prototype, \"contextService\", void 0);\n DOMInteractionPlugin = DOMInteractionPlugin_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__decorate\"])([\n Object(mana_syringe__WEBPACK_IMPORTED_MODULE_2__[\"singleton\"])({ contrib: _antv_g__WEBPACK_IMPORTED_MODULE_1__[\"RenderingPluginContribution\"] })\n ], DOMInteractionPlugin);\n return DOMInteractionPlugin;\n}());\n\n\n\n//# sourceURL=webpack://G.DOMInteraction/./src/DOMInteractionPlugin.ts?");
/***/ }),
/***/ "./src/index.ts":
/*!**********************!*\
!*** ./src/index.ts ***!
\**********************/
/*! exports provided: Plugin */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Plugin\", function() { return Plugin; });\n/* harmony import */ var mana_syringe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mana-syringe */ \"mana-syringe\");\n/* harmony import */ var mana_syringe__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(mana_syringe__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _DOMInteractionPlugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DOMInteractionPlugin */ \"./src/DOMInteractionPlugin.ts\");\n\n\nvar containerModule = Object(mana_syringe__WEBPACK_IMPORTED_MODULE_0__[\"Module\"])(function (register) {\n register(_DOMInteractionPlugin__WEBPACK_IMPORTED_MODULE_1__[\"DOMInteractionPlugin\"]);\n});\nvar Plugin = /** @class */ (function () {\n function Plugin() {\n }\n Plugin.prototype.init = function (container) {\n container.load(containerModule);\n };\n Plugin.prototype.destroy = function (container) {\n // @ts-ignore\n // container.container.unload(containerModule);\n // // container.unload(containerModule);\n // container.remove(DOMInteractionPlugin);\n };\n return Plugin;\n}());\n\n\n\n//# sourceURL=webpack://G.DOMInteraction/./src/index.ts?");
/***/ }),
/***/ "./src/utils/index.ts":
/*!****************************!*\
!*** ./src/utils/index.ts ***!
\****************************/
/*! exports provided: supportsTouchEvents, supportsPointerEvents, isTouchEvent, isMouseEvent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"supportsTouchEvents\", function() { return supportsTouchEvents; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"supportsPointerEvents\", function() { return supportsPointerEvents; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isTouchEvent\", function() { return isTouchEvent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isMouseEvent\", function() { return isMouseEvent; });\n// use `self` instead of `window`, account for non-window contexts, such as in Web Workers\n// @see https://developer.mozilla.org/en-US/docs/Web/API/Window/self\nvar supportsTouchEvents = 'ontouchstart' in self;\nvar supportsPointerEvents = !!self.PointerEvent;\nfunction isTouchEvent(event) {\n return supportsTouchEvents && event instanceof TouchEvent;\n}\nfunction isMouseEvent(event) {\n return (!self.MouseEvent ||\n (event instanceof MouseEvent && (!supportsPointerEvents || !(event instanceof self.PointerEvent))));\n}\n\n\n//# sourceURL=webpack://G.DOMInteraction/./src/utils/index.ts?");
/***/ }),
/***/ "@antv/g":
/*!****************************************************************************************!*\
!*** external {"commonjs":"@antv/g","commonjs2":"@antv/g","amd":"@antv/g","root":"G"} ***!
\****************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("module.exports = __WEBPACK_EXTERNAL_MODULE__antv_g__;\n\n//# sourceURL=webpack://G.DOMInteraction/external_%7B%22commonjs%22:%22@antv/g%22,%22commonjs2%22:%22@antv/g%22,%22amd%22:%22@antv/g%22,%22root%22:%22G%22%7D?");
/***/ }),
/***/ "mana-syringe":
/*!***********************************************************************************************************************!*\
!*** external {"commonjs":"mana-syringe","commonjs2":"mana-syringe","amd":"mana-syringe","root":["G","ManaSyringe"]} ***!
\***********************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("module.exports = __WEBPACK_EXTERNAL_MODULE_mana_syringe__;\n\n//# sourceURL=webpack://G.DOMInteraction/external_%7B%22commonjs%22:%22mana-syringe%22,%22commonjs2%22:%22mana-syringe%22,%22amd%22:%22mana-syringe%22,%22root%22:%5B%22G%22,%22ManaSyringe%22%5D%7D?");
/***/ })
/******/ });
});
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function r(e,t,n,o){var r,i=arguments.length,u=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,o);else for(var c=e.length-1;c>=0;c--)(r=e[c])&&(u=(i<3?r(u):i>3?r(t,n,u):r(t,n))||u);return i>3&&u&&Object.defineProperty(t,n,u),u}function i(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}Object.create;Object.create;var u=n(1),c="ontouchstart"in self,s=!!self.PointerEvent;var a=function(){function e(){}var t;return t=e,e.prototype.apply=function(e){var n=this,o=function(t){e.hooks.pointerMove.call(t)},r=function(t){e.hooks.pointerUp.call(t)},i=function(t){e.hooks.pointerDown.call(t)},u=function(t){e.hooks.pointerOver.call(t)},a=function(t){e.hooks.pointerOut.call(t)},v=function(t){e.hooks.pointerWheel.call(t)};e.hooks.init.tap(t.tag,(function(){var e=n.contextService.getDomElement();s?(self.document.addEventListener("pointermove",o,!0),e.addEventListener("pointerdown",i,!0),e.addEventListener("pointerleave",a,!0),e.addEventListener("pointerover",u,!0),self.addEventListener("pointerup",r,!0)):(self.document.addEventListener("mousemove",o,!0),e.addEventListener("mousedown",i,!0),e.addEventListener("mouseout",a,!0),e.addEventListener("mouseover",u,!0),self.addEventListener("mouseup",r,!0)),c&&(e.addEventListener("touchstart",i,!0),e.addEventListener("touchend",r,!0),e.addEventListener("touchmove",o,!0)),e.addEventListener("wheel",v,{passive:!0,capture:!0})})),e.hooks.destroy.tap(t.tag,(function(){var e=n.contextService.getDomElement();s?(self.document.removeEventListener("pointermove",o,!0),e.removeEventListener("pointerdown",i,!0),e.removeEventListener("pointerleave",a,!0),e.removeEventListener("pointerover",u,!0),self.removeEventListener("pointerup",r,!0)):(self.document.removeEventListener("mousemove",o,!0),e.removeEventListener("mousedown",i,!0),e.removeEventListener("mouseout",a,!0),e.removeEventListener("mouseover",u,!0),self.removeEventListener("mouseup",r,!0)),c&&(e.removeEventListener("touchstart",i,!0),e.removeEventListener("touchend",r,!0),e.removeEventListener("touchmove",o,!0)),e.removeEventListener("wheel",v,!0)}))},e.tag="DOMInteractionPlugin",r([Object(o.inject)(u.ContextService),i("design:type",Object)],e.prototype,"contextService",void 0),e=t=r([Object(o.singleton)({contrib:u.RenderingPluginContribution})],e)}(),v=Object(o.Module)((function(e){e(a)})),f=function(){function e(){}return e.prototype.init=function(e){e.load(v,!0)},e.prototype.destroy=function(e){e.remove(a)},e}()}])}));

@@ -16,13 +16,16 @@ "use strict";

var Plugin = function () {
var Plugin =
/** @class */
function () {
function Plugin() {}
Plugin.prototype.init = function (container) {
container.load(containerModule);
container.load(containerModule, true);
};
Plugin.prototype.destroy = function (container) {// @ts-ignore
Plugin.prototype.destroy = function (container) {
// @ts-ignore
// container.container.unload(containerModule);
// // container.unload(containerModule);
// container.remove(DOMInteractionPlugin);
container.remove(_DOMInteractionPlugin.DOMInteractionPlugin);
};

@@ -29,0 +32,0 @@

{
"name": "@antv/g-plugin-dom-interaction",
"version": "1.0.0-alpha.27",
"version": "1.0.0-alpha.28",
"description": "A G plugin",

@@ -8,5 +8,8 @@ "main": "lib/index.js",

"types": "es/index.d.ts",
"unpkg": "dist/index.umd.js",
"files": [
"package.json",
"dist",
"es",
"lib",
"LICENSE",

@@ -33,3 +36,3 @@ "README.md"

"dependencies": {
"@antv/g": "^1.0.0-alpha.28",
"@antv/g": "^1.0.0-alpha.29",
"mana-syringe": "^0.2.1"

@@ -51,3 +54,3 @@ },

"homepage": "https://github.com/antvis/g#readme",
"gitHead": "b8af919853fa578b4aa6c5e84715948085ac0170"
"gitHead": "97b0cd921c395a28d0432b33db157723b7967db1"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc