Socket
Socket
Sign inDemoInstall

@antv/g-gesture

Package Overview
Dependencies
Maintainers
58
Versions
153
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/g-gesture - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

343

dist/index.esm.js
import EE from 'eventemitter3';
function _typeof(obj) {
"@babel/helpers - typeof";
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
}, _typeof(obj);
_setPrototypeOf(subClass, superClass);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
Object.defineProperty(subClass, "prototype", {
writable: false
});
if (superClass) _setPrototypeOf(subClass, superClass);
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _setPrototypeOf(o, p) {

@@ -71,15 +18,2 @@ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {

function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
return true;
} catch (e) {
return false;
}
}
function _assertThisInitialized(self) {

@@ -93,32 +27,3 @@ if (self === void 0) {

function _possibleConstructorReturn(self, call) {
if (call && (typeof call === "object" || typeof call === "function")) {
return call;
} else if (call !== void 0) {
throw new TypeError("Derived constructors may only return object or undefined");
}
return _assertThisInitialized(self);
}
function _createSuper(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived),
result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
var clock = (typeof performance === "undefined" ? "undefined" : _typeof(performance)) === 'object' && performance.now ? performance : Date;
var clock = typeof performance === 'object' && performance.now ? performance : Date;
var PRESS_DELAY = 250; // 计算滑动的方向

@@ -154,6 +59,4 @@

var Gesture = /*#__PURE__*/function (_EE) {
_inherits(Gesture, _EE);
_inheritsLoose(Gesture, _EE);
var _super = _createSuper(Gesture);
// 用来记录当前触发的事件

@@ -163,5 +66,3 @@ function Gesture(el) {

_classCallCheck(this, Gesture);
_this = _super.call(this);
_this = _EE.call(this) || this;
_this.el = void 0;

@@ -381,151 +282,141 @@ _this.evCache = [];

_createClass(Gesture, [{
key: "_initEvent",
value: function _initEvent() {
var el = this.el;
el.addEventListener('pointerdown', this._start);
el.addEventListener('pointermove', this._move);
el.addEventListener('pointerup', this._end);
el.addEventListener('pointerupoutside', this._end);
var _proto = Gesture.prototype;
_proto._initEvent = function _initEvent() {
var el = this.el;
el.addEventListener('pointerdown', this._start);
el.addEventListener('pointermove', this._move);
el.addEventListener('pointerup', this._end);
el.addEventListener('pointerupoutside', this._end);
};
_proto.getEventType = function getEventType(point) {
var eventType = this.eventType,
startTime = this.startTime,
startPoints = this.startPoints;
if (eventType) {
return eventType;
}
}, {
key: "getEventType",
value: function getEventType(point) {
var eventType = this.eventType,
startTime = this.startTime,
startPoints = this.startPoints;
if (eventType) {
return eventType;
}
var type; // @ts-ignore
var type; // @ts-ignore
var panEventListeners = this._events.pan; // 如果没有pan事件的监听,默认都是press
var panEventListeners = this._events.pan; // 如果没有pan事件的监听,默认都是press
if (!panEventListeners) {
type = 'press';
} else {
// 如果有pan事件的处理,press则需要停顿250ms, 且移动距离小于10
var now = clock.now();
if (!panEventListeners) {
if (now - startTime > PRESS_DELAY && calcDistance(startPoints[0], point) < 10) {
type = 'press';
} else {
// 如果有pan事件的处理,press则需要停顿250ms, 且移动距离小于10
var now = clock.now();
if (now - startTime > PRESS_DELAY && calcDistance(startPoints[0], point) < 10) {
type = 'press';
} else {
type = 'pan';
}
type = 'pan';
}
}
this.eventType = type;
return type;
this.eventType = type;
return type;
};
_proto.enable = function enable(eventType) {
this.processEvent[eventType] = true;
} // 是否进行中的事件
;
_proto.isProcess = function isProcess(eventType) {
return this.processEvent[eventType];
} // 触发start事件
;
_proto.emitStart = function emitStart(type, ev) {
if (this.isProcess(type)) {
return;
}
}, {
key: "enable",
value: function enable(eventType) {
this.processEvent[eventType] = true;
} // 是否进行中的事件
}, {
key: "isProcess",
value: function isProcess(eventType) {
return this.processEvent[eventType];
} // 触发start事件
this.enable(type);
}, {
key: "emitStart",
value: function emitStart(type, ev) {
if (this.isProcess(type)) {
return;
}
this._emit(type + "start", ev);
} // 触发事件
;
this.enable(type);
_proto._emit = function _emit(type, ev) {
var _el$ownerDocument,
_this2 = this;
this._emit("".concat(type, "start"), ev);
} // 触发事件
// 主要是节流处理
this.pushEvent(type, ev);
var el = this.el,
throttleTimer = this.throttleTimer,
emitThrottles = this.emitThrottles;
}, {
key: "_emit",
value: function _emit(type, ev) {
var _el$ownerDocument,
_this2 = this;
if (throttleTimer) {
return;
}
// 主要是节流处理
this.pushEvent(type, ev);
var el = this.el,
throttleTimer = this.throttleTimer,
emitThrottles = this.emitThrottles;
var global = (_el$ownerDocument = el.ownerDocument) === null || _el$ownerDocument === void 0 ? void 0 : _el$ownerDocument.defaultView;
this.throttleTimer = global.requestAnimationFrame(function () {
for (var i = 0, len = emitThrottles.length; i < len; i++) {
var _emitThrottles$i = emitThrottles[i],
_type = _emitThrottles$i.type,
_ev = _emitThrottles$i.ev;
if (throttleTimer) {
return;
}
_this2.emit(_type, _ev);
} // 清空
var global = (_el$ownerDocument = el.ownerDocument) === null || _el$ownerDocument === void 0 ? void 0 : _el$ownerDocument.defaultView;
this.throttleTimer = global.requestAnimationFrame(function () {
for (var i = 0, len = emitThrottles.length; i < len; i++) {
var _emitThrottles$i = emitThrottles[i],
_type = _emitThrottles$i.type,
_ev = _emitThrottles$i.ev;
_this2.emit(_type, _ev);
} // 清空
_this2.throttleTimer = 0;
_this2.emitThrottles.length = 0;
});
} // 触发end事件
;
_proto.emitEnd = function emitEnd(ev) {
var _this3 = this;
_this2.throttleTimer = 0;
_this2.emitThrottles.length = 0;
});
} // 触发end事件
var processEvent = this.processEvent;
Object.keys(processEvent).forEach(function (type) {
_this3._emit(type + "end", ev);
}, {
key: "emitEnd",
value: function emitEnd(ev) {
var _this3 = this;
delete processEvent[type];
});
};
var processEvent = this.processEvent;
Object.keys(processEvent).forEach(function (type) {
_this3._emit("".concat(type, "end"), ev);
_proto.pushEvent = function pushEvent(type, ev) {
var emitThrottles = this.emitThrottles;
var newEvent = {
type: type,
ev: ev
};
delete processEvent[type];
});
for (var i = 0, len = emitThrottles.length; i < len; i++) {
if (emitThrottles[i].type === type) {
emitThrottles.splice(i, 1, newEvent);
return;
}
}
}, {
key: "pushEvent",
value: function pushEvent(type, ev) {
var emitThrottles = this.emitThrottles;
var newEvent = {
type: type,
ev: ev
};
for (var i = 0, len = emitThrottles.length; i < len; i++) {
if (emitThrottles[i].type === type) {
emitThrottles.splice(i, 1, newEvent);
return;
}
}
emitThrottles.push(newEvent);
};
emitThrottles.push(newEvent);
_proto.clearPressTimeout = function clearPressTimeout() {
if (this.pressTimeout) {
clearTimeout(this.pressTimeout);
this.pressTimeout = null;
}
}, {
key: "clearPressTimeout",
value: function clearPressTimeout() {
if (this.pressTimeout) {
clearTimeout(this.pressTimeout);
this.pressTimeout = null;
}
}
}, {
key: "reset",
value: function reset() {
this.clearPressTimeout();
this.startTime = 0;
this.startDistance = 0;
this.direction = null;
this.eventType = null;
this.prevMoveTime = 0;
this.prevMovePoint = null;
this.lastMoveTime = 0;
this.lastMovePoint = null;
}
}]);
};
_proto.reset = function reset() {
this.clearPressTimeout();
this.startTime = 0;
this.startDistance = 0;
this.direction = null;
this.eventType = null;
this.prevMoveTime = 0;
this.prevMovePoint = null;
this.lastMoveTime = 0;
this.lastMovePoint = null;
};
return Gesture;

@@ -532,0 +423,0 @@ }(EE);

@@ -9,62 +9,9 @@ 'use strict';

function _typeof(obj) {
"@babel/helpers - typeof";
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
}, _typeof(obj);
_setPrototypeOf(subClass, superClass);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
Object.defineProperty(subClass, "prototype", {
writable: false
});
if (superClass) _setPrototypeOf(subClass, superClass);
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _setPrototypeOf(o, p) {

@@ -78,15 +25,2 @@ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {

function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
return true;
} catch (e) {
return false;
}
}
function _assertThisInitialized(self) {

@@ -100,32 +34,3 @@ if (self === void 0) {

function _possibleConstructorReturn(self, call) {
if (call && (typeof call === "object" || typeof call === "function")) {
return call;
} else if (call !== void 0) {
throw new TypeError("Derived constructors may only return object or undefined");
}
return _assertThisInitialized(self);
}
function _createSuper(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived),
result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
var clock = (typeof performance === "undefined" ? "undefined" : _typeof(performance)) === 'object' && performance.now ? performance : Date;
var clock = typeof performance === 'object' && performance.now ? performance : Date;
var PRESS_DELAY = 250; // 计算滑动的方向

@@ -161,6 +66,4 @@

var Gesture = /*#__PURE__*/function (_EE) {
_inherits(Gesture, _EE);
_inheritsLoose(Gesture, _EE);
var _super = _createSuper(Gesture);
// 用来记录当前触发的事件

@@ -170,5 +73,3 @@ function Gesture(el) {

_classCallCheck(this, Gesture);
_this = _super.call(this);
_this = _EE.call(this) || this;
_this.el = void 0;

@@ -388,151 +289,141 @@ _this.evCache = [];

_createClass(Gesture, [{
key: "_initEvent",
value: function _initEvent() {
var el = this.el;
el.addEventListener('pointerdown', this._start);
el.addEventListener('pointermove', this._move);
el.addEventListener('pointerup', this._end);
el.addEventListener('pointerupoutside', this._end);
var _proto = Gesture.prototype;
_proto._initEvent = function _initEvent() {
var el = this.el;
el.addEventListener('pointerdown', this._start);
el.addEventListener('pointermove', this._move);
el.addEventListener('pointerup', this._end);
el.addEventListener('pointerupoutside', this._end);
};
_proto.getEventType = function getEventType(point) {
var eventType = this.eventType,
startTime = this.startTime,
startPoints = this.startPoints;
if (eventType) {
return eventType;
}
}, {
key: "getEventType",
value: function getEventType(point) {
var eventType = this.eventType,
startTime = this.startTime,
startPoints = this.startPoints;
if (eventType) {
return eventType;
}
var type; // @ts-ignore
var type; // @ts-ignore
var panEventListeners = this._events.pan; // 如果没有pan事件的监听,默认都是press
var panEventListeners = this._events.pan; // 如果没有pan事件的监听,默认都是press
if (!panEventListeners) {
type = 'press';
} else {
// 如果有pan事件的处理,press则需要停顿250ms, 且移动距离小于10
var now = clock.now();
if (!panEventListeners) {
if (now - startTime > PRESS_DELAY && calcDistance(startPoints[0], point) < 10) {
type = 'press';
} else {
// 如果有pan事件的处理,press则需要停顿250ms, 且移动距离小于10
var now = clock.now();
if (now - startTime > PRESS_DELAY && calcDistance(startPoints[0], point) < 10) {
type = 'press';
} else {
type = 'pan';
}
type = 'pan';
}
}
this.eventType = type;
return type;
this.eventType = type;
return type;
};
_proto.enable = function enable(eventType) {
this.processEvent[eventType] = true;
} // 是否进行中的事件
;
_proto.isProcess = function isProcess(eventType) {
return this.processEvent[eventType];
} // 触发start事件
;
_proto.emitStart = function emitStart(type, ev) {
if (this.isProcess(type)) {
return;
}
}, {
key: "enable",
value: function enable(eventType) {
this.processEvent[eventType] = true;
} // 是否进行中的事件
}, {
key: "isProcess",
value: function isProcess(eventType) {
return this.processEvent[eventType];
} // 触发start事件
this.enable(type);
}, {
key: "emitStart",
value: function emitStart(type, ev) {
if (this.isProcess(type)) {
return;
}
this._emit(type + "start", ev);
} // 触发事件
;
this.enable(type);
_proto._emit = function _emit(type, ev) {
var _el$ownerDocument,
_this2 = this;
this._emit("".concat(type, "start"), ev);
} // 触发事件
// 主要是节流处理
this.pushEvent(type, ev);
var el = this.el,
throttleTimer = this.throttleTimer,
emitThrottles = this.emitThrottles;
}, {
key: "_emit",
value: function _emit(type, ev) {
var _el$ownerDocument,
_this2 = this;
if (throttleTimer) {
return;
}
// 主要是节流处理
this.pushEvent(type, ev);
var el = this.el,
throttleTimer = this.throttleTimer,
emitThrottles = this.emitThrottles;
var global = (_el$ownerDocument = el.ownerDocument) === null || _el$ownerDocument === void 0 ? void 0 : _el$ownerDocument.defaultView;
this.throttleTimer = global.requestAnimationFrame(function () {
for (var i = 0, len = emitThrottles.length; i < len; i++) {
var _emitThrottles$i = emitThrottles[i],
_type = _emitThrottles$i.type,
_ev = _emitThrottles$i.ev;
if (throttleTimer) {
return;
}
_this2.emit(_type, _ev);
} // 清空
var global = (_el$ownerDocument = el.ownerDocument) === null || _el$ownerDocument === void 0 ? void 0 : _el$ownerDocument.defaultView;
this.throttleTimer = global.requestAnimationFrame(function () {
for (var i = 0, len = emitThrottles.length; i < len; i++) {
var _emitThrottles$i = emitThrottles[i],
_type = _emitThrottles$i.type,
_ev = _emitThrottles$i.ev;
_this2.emit(_type, _ev);
} // 清空
_this2.throttleTimer = 0;
_this2.emitThrottles.length = 0;
});
} // 触发end事件
;
_proto.emitEnd = function emitEnd(ev) {
var _this3 = this;
_this2.throttleTimer = 0;
_this2.emitThrottles.length = 0;
});
} // 触发end事件
var processEvent = this.processEvent;
Object.keys(processEvent).forEach(function (type) {
_this3._emit(type + "end", ev);
}, {
key: "emitEnd",
value: function emitEnd(ev) {
var _this3 = this;
delete processEvent[type];
});
};
var processEvent = this.processEvent;
Object.keys(processEvent).forEach(function (type) {
_this3._emit("".concat(type, "end"), ev);
_proto.pushEvent = function pushEvent(type, ev) {
var emitThrottles = this.emitThrottles;
var newEvent = {
type: type,
ev: ev
};
delete processEvent[type];
});
for (var i = 0, len = emitThrottles.length; i < len; i++) {
if (emitThrottles[i].type === type) {
emitThrottles.splice(i, 1, newEvent);
return;
}
}
}, {
key: "pushEvent",
value: function pushEvent(type, ev) {
var emitThrottles = this.emitThrottles;
var newEvent = {
type: type,
ev: ev
};
for (var i = 0, len = emitThrottles.length; i < len; i++) {
if (emitThrottles[i].type === type) {
emitThrottles.splice(i, 1, newEvent);
return;
}
}
emitThrottles.push(newEvent);
};
emitThrottles.push(newEvent);
_proto.clearPressTimeout = function clearPressTimeout() {
if (this.pressTimeout) {
clearTimeout(this.pressTimeout);
this.pressTimeout = null;
}
}, {
key: "clearPressTimeout",
value: function clearPressTimeout() {
if (this.pressTimeout) {
clearTimeout(this.pressTimeout);
this.pressTimeout = null;
}
}
}, {
key: "reset",
value: function reset() {
this.clearPressTimeout();
this.startTime = 0;
this.startDistance = 0;
this.direction = null;
this.eventType = null;
this.prevMoveTime = 0;
this.prevMovePoint = null;
this.lastMoveTime = 0;
this.lastMovePoint = null;
}
}]);
};
_proto.reset = function reset() {
this.clearPressTimeout();
this.startTime = 0;
this.startDistance = 0;
this.direction = null;
this.eventType = null;
this.prevMoveTime = 0;
this.prevMovePoint = null;
this.lastMoveTime = 0;
this.lastMovePoint = null;
};
return Gesture;

@@ -539,0 +430,0 @@ }(EE__default['default']);

@@ -92,2 +92,3 @@ import type { DisplayObject, RenderingService } from '@antv/g';

observeMaterialChanged(): void;
private shouldMergeColor;
/**

@@ -94,0 +95,0 @@ * should be merged into current InstancedMesh

@@ -1,5 +0,4 @@

import type { DisplayObject, PathCommand } from '@antv/g';
import type { DisplayObject } from '@antv/g';
import type { Options } from 'roughjs/bin/core';
export declare function generateRoughOptions(object: DisplayObject): Options;
export declare function formatPath(value: PathCommand[], x: number, y: number): string;
//# sourceMappingURL=util.d.ts.map

@@ -1,6 +0,5 @@

import type { DisplayObject, PathCommand } from '@antv/g';
import type { DisplayObject } from '@antv/g';
import type { Options } from 'roughjs/bin/core';
export declare const SUPPORTED_ROUGH_OPTIONS: string[];
export declare function generateRoughOptions(object: DisplayObject): Options;
export declare function formatPath(value: PathCommand[], x: number, y: number): string;
//# sourceMappingURL=util.d.ts.map
/// <reference types="@webgpu/types" />
/// <reference types="offscreencanvas" />
import type { SwapChain, Device, Sampler, Buffer, BindingLayoutDescriptor, TextureDescriptor, SamplerDescriptor, RenderTargetDescriptor, RenderTarget, ProgramDescriptorSimple, Program, BindingsDescriptor, Bindings, InputLayoutDescriptor, InputLayout, VertexBufferDescriptor, IndexBufferDescriptor, InputState, RenderPipelineDescriptor, RenderPipeline, Readback, RenderPassDescriptor, RenderPass, DeviceLimits, VendorInfo, DebugGroup, ComputePipelineDescriptor, ComputePipeline, ComputePass, ComputePassDescriptor, BindingLayoutSamplerDescriptor, QueryPool, QueryPoolType, ProgramDescriptor, BufferDescriptor, Resource, Texture } from '@antv/g-plugin-device-renderer';
import { ViewportOrigin, ClipSpaceNearZ, HashMap, Format } from '@antv/g-plugin-device-renderer';
import type { BindGroupLayout, TextureSharedDescriptor, TextureShared_WebGPU, IDevice_WebGPU } from './interfaces';
import type { BindingLayoutDescriptor, BindingLayoutSamplerDescriptor, Bindings, BindingsDescriptor, Buffer, BufferDescriptor, ComputePass, ComputePassDescriptor, ComputePipeline, ComputePipelineDescriptor, DebugGroup, Device, DeviceLimits, IndexBufferDescriptor, InputLayout, InputLayoutDescriptor, InputState, Program, ProgramDescriptor, ProgramDescriptorSimple, QueryPool, QueryPoolType, Readback, RenderPass, RenderPassDescriptor, RenderPipeline, RenderPipelineDescriptor, RenderTarget, RenderTargetDescriptor, Resource, Sampler, SamplerDescriptor, SwapChain, Texture, TextureDescriptor, VendorInfo, VertexBufferDescriptor } from '@antv/g-plugin-device-renderer';
import { ClipSpaceNearZ, Format, HashMap, ViewportOrigin } from '@antv/g-plugin-device-renderer';
import type { glsl_compile as glsl_compile_ } from '../../../../rust/pkg/glsl_wgsl_compiler';
import type { BindGroupLayout, IDevice_WebGPU, TextureSharedDescriptor, TextureShared_WebGPU } from './interfaces';
import { RenderPipeline_WebGPU } from './RenderPipeline';
import type { glsl_compile as glsl_compile_ } from '../../../../rust/pkg/glsl_wgsl_compiler';
export declare class Device_WebGPU implements SwapChain, IDevice_WebGPU {

@@ -9,0 +9,0 @@ private swapChainWidth;

@@ -32,3 +32,3 @@ import { Nested, ParenLess, UnitType, UnitCategory } from './types';

static unitTypeToUnitCategory(type: UnitType): UnitCategory;
static unitTypeToString(type: UnitType): "" | "s" | "em" | "%" | "px" | "rem" | "deg" | "grad" | "rad" | "turn" | "ms";
static unitTypeToString(type: UnitType): "" | "em" | "s" | "%" | "px" | "rem" | "deg" | "grad" | "rad" | "turn" | "ms";
static stringToUnitType(name: string): UnitType;

@@ -35,0 +35,0 @@ static canonicalUnitTypeForCategory(category: UnitCategory): UnitType.kUnknown | UnitType.kNumber | UnitType.kPixels | UnitType.kDegrees | UnitType.kSeconds | UnitType.kHertz | UnitType.kDotsPerPixel;

@@ -0,6 +1,6 @@

import type { CurveArray } from '@antv/util';
import type { DisplayObject, ParsedPathStyleProps } from '../../display-objects';
import type { IElement } from '../../dom';
import type { PathCommand } from '../../types';
export declare function parsePath(path: string, object: DisplayObject): ParsedPathStyleProps['path'];
export declare function mergePaths(left: ParsedPathStyleProps['path'], right: ParsedPathStyleProps['path'], object: IElement): [PathCommand[], PathCommand[], (b: PathCommand[]) => PathCommand[]];
export declare function mergePaths(left: ParsedPathStyleProps['path'], right: ParsedPathStyleProps['path'], object: IElement): [CurveArray, CurveArray, (b: CurveArray) => CurveArray];
//# sourceMappingURL=path.d.ts.map

@@ -0,1 +1,2 @@

import type { AbsoluteArray, CurveArray } from '@antv/util';
import type { DisplayObject, ParsedPathStyleProps } from '../../display-objects';

@@ -11,3 +12,3 @@ import { Rectangle } from '../../shapes';

calculator(name: string, oldParsed: ParsedPathStyleProps['path'], parsed: ParsedPathStyleProps['path']): {
absolutePath: import("../../types").PathCommand[];
absolutePath: AbsoluteArray;
hasArc: boolean;

@@ -17,5 +18,4 @@ segments: import("../../display-objects").PathSegment[];

polylines: [number, number][][];
curve: import("../../types").PathCommand[];
curve: CurveArray;
totalLength: number;
curveSegments: number[][];
zCommandIndexes: number[];

@@ -22,0 +22,0 @@ rect: Rectangle;

@@ -0,12 +1,13 @@

import type { AbsoluteArray, CurveArray, PathArray } from '@antv/util';
import type { DisplayObjectConfig } from '../dom';
import { Point } from '../shapes';
import type { Rectangle } from '../shapes/Rectangle';
import type { BaseStyleProps, ParsedBaseStyleProps, PathCommand } from '../types';
import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
import { DisplayObject } from './DisplayObject';
export interface PathStyleProps extends BaseStyleProps {
path?: string | PathCommand[];
d?: string | PathCommand[];
path?: string | PathArray;
d?: string | PathArray;
}
export interface PathSegment {
command: PathCommand[0];
command: PathArray[0];
currentPoint: [number, number];

@@ -17,7 +18,7 @@ prePoint: [number, number] | null;

endTangent: [number, number] | null;
params: PathCommand;
params: PathArray[0];
}
export interface ParsedPathStyleProps extends ParsedBaseStyleProps {
path: {
absolutePath: PathCommand[];
absolutePath: AbsoluteArray;
hasArc: boolean;

@@ -27,5 +28,4 @@ segments: PathSegment[];

polylines: [number, number][][];
curve: PathCommand[];
curve: CurveArray;
totalLength: number;
curveSegments: number[][];
zCommandIndexes: number[];

@@ -32,0 +32,0 @@ rect: Rectangle;

@@ -0,3 +1,3 @@

import type { ParsedPathStyleProps } from '../../display-objects';
import { GeometryAABBUpdater } from './interfaces';
import type { ParsedPathStyleProps } from '../../display-objects';
export declare class PathUpdater implements GeometryAABBUpdater<ParsedPathStyleProps> {

@@ -4,0 +4,0 @@ update(parsedStyle: ParsedPathStyleProps): {

@@ -260,16 +260,2 @@ import type { vec2, vec3 } from 'gl-matrix';

}
declare type A = ['a' | 'A', number, number, number, number, number, number, number];
declare type C = ['c' | 'C', number, number, number, number, number, number];
declare type O = ['o' | 'O', number, number];
declare type H = ['h' | 'H', number];
declare type L = ['l' | 'L', number, number];
declare type M = ['m' | 'M', number, number];
declare type R = ['r' | 'R', number, number, number, number];
declare type Q = ['q' | 'Q', number, number, number, number];
declare type S = ['s' | 'S', number, number, number, number, number, number, number];
declare type T = ['t' | 'T', number, number];
declare type V = ['v' | 'V', number];
declare type U = ['u' | 'U', number, number, number];
declare type Z = ['z' | 'Z'];
export declare type PathCommand = A | C | O | H | L | M | R | Q | S | T | V | U | Z;
export declare type InteractivePointerEvent = PointerEvent | TouchEvent | MouseEvent | WheelEvent;

@@ -276,0 +262,0 @@ export declare type Tuple4<T> = [T, T, T, T];

@@ -0,9 +1,13 @@

/**
* implements morph animation with cubic splitting
* @see http://thednp.github.io/kute.js/svgCubicMorph.html
*/
import type { AbsoluteArray, CurveArray } from '@antv/util';
import type { Circle, Ellipse, Line, Path, Polygon, Polyline, Rect } from '../display-objects';
import type { PathCommand } from '../types';
export declare function equalizeSegments(path1: PathCommand[], path2: PathCommand[], TL?: number): PathCommand[][];
export declare function getDrawDirection(pathArray: PathCommand[]): boolean;
export declare function getPathArea(pathArray: PathCommand[]): number;
export declare function reverseCurve(pathArray: PathCommand[]): PathCommand[];
export declare function clonePath(pathArray: PathCommand[]): PathCommand[];
export declare function getRotatedCurve(a: PathCommand[], b: PathCommand[]): (string[] | ["a" | "A", number, number, number, number, number, number, number] | ["c" | "C", number, number, number, number, number, number] | ["o" | "O", number, number] | ["h" | "H", number] | ["l" | "L", number, number] | ["m" | "M", number, number] | ["r" | "R", number, number, number, number] | ["q" | "Q", number, number, number, number] | ["s" | "S", number, number, number, number, number, number, number] | ["t" | "T", number, number] | ["v" | "V", number] | ["u" | "U", number, number, number])[];
export declare function hasArcOrBezier(path: AbsoluteArray): boolean;
export declare function extractPolygons(pathArray: AbsoluteArray): {
polygons: [number, number][][];
polylines: [number, number][][];
};
export declare function path2Segments(path: CurveArray): any[];
/**

@@ -10,0 +14,0 @@ * convert object to path, should account for:

{
"name": "@antv/g-gesture",
"version": "0.0.4",
"version": "0.0.5",
"description": "G Gesture",

@@ -34,4 +34,4 @@ "keywords": [

"devDependencies": {
"@antv/g-mobile-canvas": "^0.2.1",
"@antv/g-mobile-canvas-element": "^0.1.1"
"@antv/g-mobile-canvas": "^0.2.2",
"@antv/g-mobile-canvas-element": "^0.1.2"
},

@@ -41,3 +41,3 @@ "publishConfig": {

},
"gitHead": "90eceace1d9a96e36b20926e853b958c03cf3a67"
"gitHead": "f0d3036ed1439859167f135b8a61c84a415582df"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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