@antv/g-plugin-dom-interaction
Advanced tools
Comparing version 1.0.14 to 1.0.15
@@ -1,2 +0,2 @@ | ||
!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 v}));var o=n(0); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@antv/g"),require("mana-syringe")):"function"==typeof define&&define.amd?define(["@antv/g","mana-syringe"],t):"object"==typeof exports?exports.DOMInteraction=t(require("@antv/g"),require("mana-syringe")):(e.G=e.G||{},e.G.DOMInteraction=t(e.G,e.G.ManaSyringe))}(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 a}));var o=n(1); | ||
/*! ***************************************************************************** | ||
@@ -15,2 +15,2 @@ Copyright (c) Microsoft Corporation. | ||
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)},f=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",f,{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",f,!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)}(),f=Object(o.Module)((function(e){e(a)})),v=function(){function e(){}return e.prototype.init=function(e){e.load(f,!0)},e.prototype.destroy=function(e){e.unload(f)},e}()}])})); | ||
***************************************************************************** */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(0),c=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)},c=function(t){e.hooks.pointerOver.call(t)},s=function(t){e.hooks.pointerOut.call(t)},a=function(t){e.hooks.pointerWheel.call(t)};e.hooks.init.tap(t.tag,(function(){var e=n.contextService.getDomElement();u.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",o,!0),e.addEventListener("pointerdown",i,!0),e.addEventListener("pointerleave",s,!0),e.addEventListener("pointerover",c,!0),globalThis.addEventListener("pointerup",r,!0)):(globalThis.document.addEventListener("mousemove",o,!0),e.addEventListener("mousedown",i,!0),e.addEventListener("mouseout",s,!0),e.addEventListener("mouseover",c,!0),globalThis.addEventListener("mouseup",r,!0)),u.supportsTouchEvents&&(e.addEventListener("touchstart",i,!0),e.addEventListener("touchend",r,!0),e.addEventListener("touchmove",o,!0)),e.addEventListener("wheel",a,{passive:!0,capture:!0})})),e.hooks.destroy.tap(t.tag,(function(){var e=n.contextService.getDomElement();u.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",o,!0),e.removeEventListener("pointerdown",i,!0),e.removeEventListener("pointerleave",s,!0),e.removeEventListener("pointerover",c,!0),globalThis.removeEventListener("pointerup",r,!0)):(globalThis.document.removeEventListener("mousemove",o,!0),e.removeEventListener("mousedown",i,!0),e.removeEventListener("mouseout",s,!0),e.removeEventListener("mouseover",c,!0),globalThis.removeEventListener("mouseup",r,!0)),u.supportsTouchEvents&&(e.removeEventListener("touchstart",i,!0),e.removeEventListener("touchend",r,!0),e.removeEventListener("touchmove",o,!0)),e.removeEventListener("wheel",a,!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)}(),s=Object(o.Module)((function(e){e(c)})),a=function(){function e(){}return e.prototype.init=function(e){e.load(s,!0)},e.prototype.destroy=function(e){e.unload(s)},e}()}])})); |
import { __decorate, __metadata } from "tslib"; | ||
import { ContextService, RenderingPluginContribution } from '@antv/g'; | ||
import { ContextService, RenderingPluginContribution, supportsPointerEvents, supportsTouchEvents } from '@antv/g'; | ||
import { inject, singleton } from 'mana-syringe'; | ||
import { supportsPointerEvents, supportsTouchEvents } from './utils'; | ||
/** | ||
@@ -47,13 +46,13 @@ * listen to mouse/touch/pointer events on DOM wrapper, trigger pointer events | ||
if (supportsPointerEvents) { | ||
self.document.addEventListener('pointermove', onPointerMove, true); | ||
globalThis.document.addEventListener('pointermove', onPointerMove, true); | ||
$el.addEventListener('pointerdown', onPointerDown, true); | ||
$el.addEventListener('pointerleave', onPointerOut, true); | ||
$el.addEventListener('pointerover', onPointerOver, true); | ||
self.addEventListener('pointerup', onPointerUp, true); | ||
globalThis.addEventListener('pointerup', onPointerUp, true); | ||
} else { | ||
self.document.addEventListener('mousemove', onPointerMove, true); | ||
globalThis.document.addEventListener('mousemove', onPointerMove, true); | ||
$el.addEventListener('mousedown', onPointerDown, true); | ||
$el.addEventListener('mouseout', onPointerOut, true); | ||
$el.addEventListener('mouseover', onPointerOver, true); | ||
self.addEventListener('mouseup', onPointerUp, true); | ||
globalThis.addEventListener('mouseup', onPointerUp, true); | ||
} // always look directly for touch events so that we can provide original data | ||
@@ -81,13 +80,13 @@ // In a future version we should change this to being just a fallback and rely solely on | ||
if (supportsPointerEvents) { | ||
self.document.removeEventListener('pointermove', onPointerMove, true); | ||
globalThis.document.removeEventListener('pointermove', onPointerMove, true); | ||
$el.removeEventListener('pointerdown', onPointerDown, true); | ||
$el.removeEventListener('pointerleave', onPointerOut, true); | ||
$el.removeEventListener('pointerover', onPointerOver, true); | ||
self.removeEventListener('pointerup', onPointerUp, true); | ||
globalThis.removeEventListener('pointerup', onPointerUp, true); | ||
} else { | ||
self.document.removeEventListener('mousemove', onPointerMove, true); | ||
globalThis.document.removeEventListener('mousemove', onPointerMove, true); | ||
$el.removeEventListener('mousedown', onPointerDown, true); | ||
$el.removeEventListener('mouseout', onPointerOut, true); | ||
$el.removeEventListener('mouseover', onPointerOver, true); | ||
self.removeEventListener('mouseup', onPointerUp, true); | ||
globalThis.removeEventListener('mouseup', onPointerUp, true); | ||
} | ||
@@ -94,0 +93,0 @@ |
@@ -14,4 +14,2 @@ "use strict"; | ||
var _utils = require("./utils"); | ||
/** | ||
@@ -57,14 +55,14 @@ * listen to mouse/touch/pointer events on DOM wrapper, trigger pointer events | ||
if (_utils.supportsPointerEvents) { | ||
self.document.addEventListener('pointermove', onPointerMove, true); | ||
if (_g.supportsPointerEvents) { | ||
globalThis.document.addEventListener('pointermove', onPointerMove, true); | ||
$el.addEventListener('pointerdown', onPointerDown, true); | ||
$el.addEventListener('pointerleave', onPointerOut, true); | ||
$el.addEventListener('pointerover', onPointerOver, true); | ||
self.addEventListener('pointerup', onPointerUp, true); | ||
globalThis.addEventListener('pointerup', onPointerUp, true); | ||
} else { | ||
self.document.addEventListener('mousemove', onPointerMove, true); | ||
globalThis.document.addEventListener('mousemove', onPointerMove, true); | ||
$el.addEventListener('mousedown', onPointerDown, true); | ||
$el.addEventListener('mouseout', onPointerOut, true); | ||
$el.addEventListener('mouseover', onPointerOver, true); | ||
self.addEventListener('mouseup', onPointerUp, true); | ||
globalThis.addEventListener('mouseup', onPointerUp, true); | ||
} // always look directly for touch events so that we can provide original data | ||
@@ -75,3 +73,3 @@ // In a future version we should change this to being just a fallback and rely solely on | ||
if (_utils.supportsTouchEvents) { | ||
if (_g.supportsTouchEvents) { | ||
$el.addEventListener('touchstart', onPointerDown, true); | ||
@@ -92,17 +90,17 @@ $el.addEventListener('touchend', onPointerUp, true); | ||
if (_utils.supportsPointerEvents) { | ||
self.document.removeEventListener('pointermove', onPointerMove, true); | ||
if (_g.supportsPointerEvents) { | ||
globalThis.document.removeEventListener('pointermove', onPointerMove, true); | ||
$el.removeEventListener('pointerdown', onPointerDown, true); | ||
$el.removeEventListener('pointerleave', onPointerOut, true); | ||
$el.removeEventListener('pointerover', onPointerOver, true); | ||
self.removeEventListener('pointerup', onPointerUp, true); | ||
globalThis.removeEventListener('pointerup', onPointerUp, true); | ||
} else { | ||
self.document.removeEventListener('mousemove', onPointerMove, true); | ||
globalThis.document.removeEventListener('mousemove', onPointerMove, true); | ||
$el.removeEventListener('mousedown', onPointerDown, true); | ||
$el.removeEventListener('mouseout', onPointerOut, true); | ||
$el.removeEventListener('mouseover', onPointerOver, true); | ||
self.removeEventListener('mouseup', onPointerUp, true); | ||
globalThis.removeEventListener('mouseup', onPointerUp, true); | ||
} | ||
if (_utils.supportsTouchEvents) { | ||
if (_g.supportsTouchEvents) { | ||
$el.removeEventListener('touchstart', onPointerDown, true); | ||
@@ -109,0 +107,0 @@ $el.removeEventListener('touchend', onPointerUp, true); |
{ | ||
"name": "@antv/g-plugin-dom-interaction", | ||
"version": "1.0.14", | ||
"version": "1.0.15", | ||
"description": "A G plugin", | ||
@@ -48,3 +48,3 @@ "main": "lib/index.js", | ||
"homepage": "https://github.com/antvis/g#readme", | ||
"gitHead": "39c05f77bced16f75a3a14fff5bf958c1bf9fa7c" | ||
"gitHead": "c32d65599adc9e7c3d31ca5710fb3968e01bff43" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18167
12
271