@antv/g 5.0.21 → 5.0.22-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/es/AbstractRenderer.js +1 -3
  2. package/es/Canvas.js +7 -11
  3. package/es/DisplayObjectPool.js +1 -3
  4. package/es/camera/Camera.d.ts +12 -7
  5. package/es/camera/Camera.js +54 -24
  6. package/es/camera/Landmark.d.ts +2 -0
  7. package/es/camera/Landmark.js +10 -6
  8. package/es/components/Cullable.js +1 -3
  9. package/es/components/Geometry.js +1 -3
  10. package/es/components/Renderable.js +1 -3
  11. package/es/components/Sortable.js +1 -3
  12. package/es/components/Transform.js +1 -3
  13. package/es/css/LayoutRegistry.js +1 -3
  14. package/es/css/StyleValueRegistry.js +1 -3
  15. package/es/css/cssom/CSSColorValue.js +1 -3
  16. package/es/css/cssom/CSSGradientValue.js +6 -8
  17. package/es/css/cssom/CSSKeywordValue.js +1 -3
  18. package/es/css/cssom/CSSMathInvert.js +1 -3
  19. package/es/css/cssom/CSSMathMax.js +1 -3
  20. package/es/css/cssom/CSSMathMin.js +1 -3
  21. package/es/css/cssom/CSSMathNegate.js +1 -3
  22. package/es/css/cssom/CSSMathProduct.js +1 -3
  23. package/es/css/cssom/CSSMathSum.js +1 -3
  24. package/es/css/cssom/CSSMathValue.js +1 -3
  25. package/es/css/cssom/CSSMathVariadic.js +1 -3
  26. package/es/css/cssom/CSSNumericValue.js +1 -3
  27. package/es/css/cssom/CSSNumericValueType.d.ts +1 -1
  28. package/es/css/cssom/CSSNumericValueType.js +1 -3
  29. package/es/css/cssom/CSSRGB.js +2 -4
  30. package/es/css/cssom/CSSStyleValue.d.ts +2 -2
  31. package/es/css/cssom/CSSStyleValue.js +2 -4
  32. package/es/css/cssom/CSSTransformComponent.js +1 -3
  33. package/es/css/cssom/CSSTransformValue.js +1 -3
  34. package/es/css/cssom/CSSTranslate.js +1 -3
  35. package/es/css/cssom/CSSUnitValue.js +2 -4
  36. package/es/css/parser/color.js +1 -1
  37. package/es/css/parser/dimension.js +1 -1
  38. package/es/css/parser/transform.d.ts +1 -1
  39. package/es/css/parser/transform.js +2 -2
  40. package/es/css/properties/CSSPropertyAnchor.js +1 -3
  41. package/es/css/properties/CSSPropertyClipPath.js +1 -3
  42. package/es/css/properties/CSSPropertyColor.js +1 -3
  43. package/es/css/properties/CSSPropertyFilter.js +1 -3
  44. package/es/css/properties/CSSPropertyLengthOrPercentage.js +1 -3
  45. package/es/css/properties/CSSPropertyLineDash.js +1 -3
  46. package/es/css/properties/CSSPropertyLocalPosition.js +1 -3
  47. package/es/css/properties/CSSPropertyOffsetDistance.js +1 -3
  48. package/es/css/properties/CSSPropertyOffsetPath.js +1 -3
  49. package/es/css/properties/CSSPropertyOpacity.js +1 -3
  50. package/es/css/properties/CSSPropertyPath.js +1 -3
  51. package/es/css/properties/CSSPropertyPoints.js +1 -3
  52. package/es/css/properties/CSSPropertyShadowBlur.js +1 -3
  53. package/es/css/properties/CSSPropertyText.js +2 -4
  54. package/es/css/properties/CSSPropertyTextTransform.js +1 -3
  55. package/es/css/properties/CSSPropertyTransform.js +1 -3
  56. package/es/css/properties/CSSPropertyTransformOrigin.js +1 -3
  57. package/es/css/properties/CSSPropertyVisibility.js +1 -3
  58. package/es/css/properties/CSSPropertyZIndex.js +1 -3
  59. package/es/display-objects/Circle.js +1 -3
  60. package/es/display-objects/CustomElement.js +1 -3
  61. package/es/display-objects/DisplayObject.js +10 -8
  62. package/es/display-objects/Ellipse.js +1 -3
  63. package/es/display-objects/Group.js +1 -3
  64. package/es/display-objects/HTML.js +3 -6
  65. package/es/display-objects/Image.js +1 -3
  66. package/es/display-objects/Line.js +1 -3
  67. package/es/display-objects/Path.js +1 -3
  68. package/es/display-objects/Polygon.js +1 -3
  69. package/es/display-objects/Polyline.js +1 -3
  70. package/es/display-objects/Rect.js +1 -3
  71. package/es/display-objects/Text.js +3 -6
  72. package/es/dom/Animation.js +2 -4
  73. package/es/dom/AnimationEffectTiming.js +1 -3
  74. package/es/dom/AnimationEvent.js +1 -3
  75. package/es/dom/AnimationTimeline.js +1 -3
  76. package/es/dom/CustomElementRegistry.js +1 -3
  77. package/es/dom/CustomEvent.js +1 -3
  78. package/es/dom/Document.js +1 -3
  79. package/es/dom/Element.js +4 -6
  80. package/es/dom/EventTarget.js +3 -5
  81. package/es/dom/FederatedEvent.js +1 -3
  82. package/es/dom/FederatedMouseEvent.js +1 -3
  83. package/es/dom/FederatedPointerEvent.js +1 -3
  84. package/es/dom/FederatedWheelEvent.js +1 -3
  85. package/es/dom/KeyframeEffect.js +1 -3
  86. package/es/dom/KeyframeList.js +1 -1
  87. package/es/dom/MutationEvent.js +1 -3
  88. package/es/dom/MutationObserver.js +3 -10
  89. package/es/dom/MutationRecord.js +1 -3
  90. package/es/dom/Node.js +2 -4
  91. package/es/plugins/CullingPlugin.js +1 -3
  92. package/es/plugins/DirtyCheckPlugin.js +1 -3
  93. package/es/plugins/EventPlugin.js +5 -4
  94. package/es/plugins/FrustumCullingStrategy.js +1 -3
  95. package/es/plugins/PrepareRendererPlugin.js +1 -3
  96. package/es/services/EventService.js +26 -7
  97. package/es/services/OffscreenCanvasCreator.js +1 -3
  98. package/es/services/RenderingContext.d.ts +2 -1
  99. package/es/services/RenderingContext.js +3 -1
  100. package/es/services/RenderingService.js +1 -3
  101. package/es/services/SceneGraphSelector.js +1 -3
  102. package/es/services/SceneGraphService.d.ts +2 -1
  103. package/es/services/SceneGraphService.js +3 -5
  104. package/es/services/TextService.js +3 -5
  105. package/es/services/aabb/CircleUpdater.js +1 -3
  106. package/es/services/aabb/EllipseUpdater.js +1 -3
  107. package/es/services/aabb/LineUpdater.js +1 -3
  108. package/es/services/aabb/PathUpdater.js +1 -3
  109. package/es/services/aabb/PolylineUpdater.js +1 -3
  110. package/es/services/aabb/RectUpdater.js +1 -3
  111. package/es/services/aabb/TextUpdater.js +1 -3
  112. package/es/services/aabb/interfaces.d.ts +3 -2
  113. package/es/services/aabb/interfaces.js +3 -2
  114. package/es/shapes/AABB.js +1 -3
  115. package/es/shapes/BoundingSphere.js +1 -3
  116. package/es/shapes/Frustum.js +1 -3
  117. package/es/shapes/Plane.js +1 -3
  118. package/es/shapes/Point.js +1 -3
  119. package/es/shapes/Ray.js +1 -3
  120. package/es/shapes/Rectangle.js +1 -3
  121. package/es/types.d.ts +2 -1
  122. package/es/types.js +2 -1
  123. package/es/utils/custom-easing.d.ts +0 -9
  124. package/es/utils/custom-easing.js +38 -54
  125. package/es/utils/path.d.ts +1 -1
  126. package/es/utils/path.js +3 -3
  127. package/es/utils/text.js +3 -3
  128. package/lib/AbstractRenderer.js +1 -3
  129. package/lib/Canvas.js +8 -12
  130. package/lib/DisplayObjectPool.js +1 -3
  131. package/lib/camera/Camera.d.ts +12 -7
  132. package/lib/camera/Camera.js +59 -25
  133. package/lib/camera/Landmark.d.ts +2 -0
  134. package/lib/camera/Landmark.js +10 -6
  135. package/lib/components/Cullable.js +2 -4
  136. package/lib/components/Geometry.js +1 -3
  137. package/lib/components/Renderable.js +1 -3
  138. package/lib/components/Sortable.js +1 -3
  139. package/lib/components/Transform.js +1 -3
  140. package/lib/css/LayoutRegistry.js +1 -3
  141. package/lib/css/StyleValueRegistry.js +1 -3
  142. package/lib/css/cssom/CSSColorValue.js +1 -3
  143. package/lib/css/cssom/CSSGradientValue.js +7 -9
  144. package/lib/css/cssom/CSSKeywordValue.js +1 -3
  145. package/lib/css/cssom/CSSMathInvert.js +1 -3
  146. package/lib/css/cssom/CSSMathMax.js +1 -3
  147. package/lib/css/cssom/CSSMathMin.js +1 -3
  148. package/lib/css/cssom/CSSMathNegate.js +1 -3
  149. package/lib/css/cssom/CSSMathOperator.js +1 -1
  150. package/lib/css/cssom/CSSMathProduct.js +1 -3
  151. package/lib/css/cssom/CSSMathSum.js +1 -3
  152. package/lib/css/cssom/CSSMathValue.js +1 -3
  153. package/lib/css/cssom/CSSMathVariadic.js +2 -4
  154. package/lib/css/cssom/CSSNumericValue.js +1 -3
  155. package/lib/css/cssom/CSSNumericValueType.d.ts +1 -1
  156. package/lib/css/cssom/CSSNumericValueType.js +3 -5
  157. package/lib/css/cssom/CSSRGB.js +2 -4
  158. package/lib/css/cssom/CSSStyleValue.d.ts +2 -2
  159. package/lib/css/cssom/CSSStyleValue.js +108 -110
  160. package/lib/css/cssom/CSSTransformComponent.js +2 -4
  161. package/lib/css/cssom/CSSTransformValue.js +1 -3
  162. package/lib/css/cssom/CSSTranslate.js +1 -3
  163. package/lib/css/cssom/CSSUnitValue.js +2 -4
  164. package/lib/css/cssom/types.js +1 -1
  165. package/lib/css/parser/color.js +3 -3
  166. package/lib/css/parser/dimension.js +6 -7
  167. package/lib/css/parser/numeric.js +3 -3
  168. package/lib/css/parser/path.js +1 -1
  169. package/lib/css/parser/transform.d.ts +1 -1
  170. package/lib/css/parser/transform.js +11 -11
  171. package/lib/css/properties/CSSPropertyAnchor.js +1 -3
  172. package/lib/css/properties/CSSPropertyClipPath.js +1 -3
  173. package/lib/css/properties/CSSPropertyColor.js +1 -3
  174. package/lib/css/properties/CSSPropertyFilter.js +1 -3
  175. package/lib/css/properties/CSSPropertyLengthOrPercentage.js +1 -3
  176. package/lib/css/properties/CSSPropertyLineDash.js +1 -3
  177. package/lib/css/properties/CSSPropertyLocalPosition.js +1 -3
  178. package/lib/css/properties/CSSPropertyOffsetDistance.js +1 -3
  179. package/lib/css/properties/CSSPropertyOffsetPath.js +1 -3
  180. package/lib/css/properties/CSSPropertyOpacity.js +1 -3
  181. package/lib/css/properties/CSSPropertyPath.js +1 -3
  182. package/lib/css/properties/CSSPropertyPoints.js +1 -3
  183. package/lib/css/properties/CSSPropertyShadowBlur.js +1 -3
  184. package/lib/css/properties/CSSPropertyText.js +2 -4
  185. package/lib/css/properties/CSSPropertyTextTransform.js +1 -3
  186. package/lib/css/properties/CSSPropertyTransform.js +1 -3
  187. package/lib/css/properties/CSSPropertyTransformOrigin.js +1 -3
  188. package/lib/css/properties/CSSPropertyVisibility.js +1 -3
  189. package/lib/css/properties/CSSPropertyZIndex.js +1 -3
  190. package/lib/display-objects/Circle.js +1 -3
  191. package/lib/display-objects/CustomElement.js +1 -3
  192. package/lib/display-objects/DisplayObject.js +9 -7
  193. package/lib/display-objects/Ellipse.js +1 -3
  194. package/lib/display-objects/Group.js +1 -3
  195. package/lib/display-objects/HTML.js +4 -6
  196. package/lib/display-objects/Image.js +1 -3
  197. package/lib/display-objects/Line.js +1 -3
  198. package/lib/display-objects/Path.js +1 -3
  199. package/lib/display-objects/Polygon.js +1 -3
  200. package/lib/display-objects/Polyline.js +1 -3
  201. package/lib/display-objects/Rect.js +1 -3
  202. package/lib/display-objects/Text.js +4 -6
  203. package/lib/dom/Animation.js +2 -4
  204. package/lib/dom/AnimationEffectTiming.js +1 -3
  205. package/lib/dom/AnimationEvent.js +1 -3
  206. package/lib/dom/AnimationTimeline.js +2 -4
  207. package/lib/dom/CustomElementRegistry.js +1 -3
  208. package/lib/dom/CustomEvent.js +1 -3
  209. package/lib/dom/Document.js +1 -3
  210. package/lib/dom/Element.js +4 -6
  211. package/lib/dom/EventTarget.js +3 -5
  212. package/lib/dom/FederatedEvent.js +1 -3
  213. package/lib/dom/FederatedMouseEvent.js +1 -3
  214. package/lib/dom/FederatedPointerEvent.js +1 -3
  215. package/lib/dom/FederatedWheelEvent.js +1 -3
  216. package/lib/dom/KeyframeEffect.js +2 -4
  217. package/lib/dom/KeyframeList.js +1 -1
  218. package/lib/dom/MutationEvent.js +1 -3
  219. package/lib/dom/MutationObserver.js +4 -11
  220. package/lib/dom/MutationRecord.js +1 -3
  221. package/lib/dom/Node.js +2 -4
  222. package/lib/index.js +1 -1
  223. package/lib/plugins/CullingPlugin.js +2 -4
  224. package/lib/plugins/DirtyCheckPlugin.js +1 -3
  225. package/lib/plugins/EventPlugin.js +5 -4
  226. package/lib/plugins/FrustumCullingStrategy.js +1 -3
  227. package/lib/plugins/PrepareRendererPlugin.js +1 -3
  228. package/lib/services/EventService.js +26 -7
  229. package/lib/services/OffscreenCanvasCreator.js +1 -3
  230. package/lib/services/RenderingContext.d.ts +2 -1
  231. package/lib/services/RenderingContext.js +4 -1
  232. package/lib/services/RenderingService.js +1 -3
  233. package/lib/services/SceneGraphSelector.js +2 -4
  234. package/lib/services/SceneGraphService.d.ts +2 -1
  235. package/lib/services/SceneGraphService.js +5 -6
  236. package/lib/services/TextService.js +3 -5
  237. package/lib/services/aabb/CircleUpdater.js +1 -3
  238. package/lib/services/aabb/EllipseUpdater.js +1 -3
  239. package/lib/services/aabb/LineUpdater.js +1 -3
  240. package/lib/services/aabb/PathUpdater.js +1 -3
  241. package/lib/services/aabb/PolylineUpdater.js +1 -3
  242. package/lib/services/aabb/RectUpdater.js +1 -3
  243. package/lib/services/aabb/TextUpdater.js +1 -3
  244. package/lib/services/aabb/index.js +10 -10
  245. package/lib/services/aabb/interfaces.d.ts +3 -2
  246. package/lib/services/aabb/interfaces.js +9 -3
  247. package/lib/shapes/AABB.js +1 -3
  248. package/lib/shapes/BoundingSphere.js +1 -3
  249. package/lib/shapes/Frustum.js +2 -4
  250. package/lib/shapes/Plane.js +1 -3
  251. package/lib/shapes/Point.js +1 -3
  252. package/lib/shapes/Ray.js +1 -3
  253. package/lib/shapes/Rectangle.js +1 -3
  254. package/lib/types.d.ts +2 -1
  255. package/lib/types.js +6 -2
  256. package/lib/utils/animation.js +2 -3
  257. package/lib/utils/bezier-easing.js +1 -1
  258. package/lib/utils/custom-easing.d.ts +0 -9
  259. package/lib/utils/custom-easing.js +42 -66
  260. package/lib/utils/math.js +9 -9
  261. package/lib/utils/path.d.ts +1 -1
  262. package/lib/utils/path.js +6 -6
  263. package/lib/utils/text.js +3 -3
  264. package/package.json +3 -3
  265. package/dist/index.umd.min.js +0 -30
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.KeyframeEffect = void 0;
7
6
  exports.makeTiming = makeTiming;
8
7
  exports.normalizeTimingInput = normalizeTimingInput;
9
8
  exports.numericTimingToObject = numericTimingToObject;
9
+ exports.KeyframeEffect = void 0;
10
10
 
11
11
  var _animation = require("../utils/animation");
12
12
 
@@ -92,9 +92,7 @@ function numericTimingToObject(timingInput) {
92
92
  */
93
93
 
94
94
 
95
- var KeyframeEffect =
96
- /** @class */
97
- function () {
95
+ var KeyframeEffect = function () {
98
96
  function KeyframeEffect(target, effectInput, timingInput) {
99
97
  var _this = this;
100
98
 
@@ -102,7 +102,7 @@ function normalizeKeyframes(effectInput, timing) {
102
102
  // TODO: Support add & accumulate in KeyframeEffect.composite
103
103
  // @see https://developer.mozilla.org/en-US/docs/Web/API/KeyframeEffect/composite
104
104
  if (['replace', 'add', 'accumulate', 'auto'].indexOf(memberValue) === -1) {
105
- throw new Error("".concat(memberValue, " compositing is not supported"));
105
+ throw new Error(memberValue + " compositing is not supported");
106
106
  }
107
107
  } else if (member === 'easing') {// TODO: Validate animation-timing-function
108
108
  // @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timing-function
@@ -9,9 +9,7 @@ var _tslib = require("tslib");
9
9
 
10
10
  var _FederatedEvent = require("./FederatedEvent");
11
11
 
12
- var MutationEvent =
13
- /** @class */
14
- function (_super) {
12
+ var MutationEvent = function (_super) {
15
13
  (0, _tslib.__extends)(MutationEvent, _super);
16
14
 
17
15
  function MutationEvent(typeArg, relatedNode, prevValue, newValue, attrName, attrChange, prevParsedValue, newParsedValue) {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Registration = exports.MutationObserver = void 0;
6
+ exports.MutationObserver = exports.Registration = void 0;
7
7
 
8
8
  var _ = require("..");
9
9
 
@@ -14,9 +14,7 @@ var _MutationRecord = require("./MutationRecord");
14
14
  var uidCounter = 0;
15
15
  var registrationsTable = new WeakMap();
16
16
 
17
- var Registration =
18
- /** @class */
19
- function () {
17
+ var Registration = function () {
20
18
  function Registration(observer, target, options) {
21
19
  this.observer = observer;
22
20
  this.target = target;
@@ -206,9 +204,7 @@ exports.Registration = Registration;
206
204
  * @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
207
205
  * @see https://github.com/googlearchive/MutationObservers/blob/master/MutationObserver.js
208
206
  */
209
- var MutationObserver =
210
- /** @class */
211
- function () {
207
+ var MutationObserver = function () {
212
208
  function MutationObserver(callback) {
213
209
  this.callback = callback;
214
210
  this.nodes = [];
@@ -218,10 +214,7 @@ function () {
218
214
 
219
215
  MutationObserver.prototype.observe = function (target, options) {
220
216
  // 1.1
221
- if (!options.childList && !options.attributes && !options.characterData || // 1.2
222
- options.attributeOldValue && !options.attributes || // 1.3
223
- options.attributeFilter && options.attributeFilter.length && !options.attributes || // 1.4
224
- options.characterDataOldValue && !options.characterData) {
217
+ if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {
225
218
  throw new SyntaxError();
226
219
  }
227
220
 
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.MutationRecord = void 0;
7
7
 
8
- var MutationRecord =
9
- /** @class */
10
- function () {
8
+ var MutationRecord = function () {
11
9
  function MutationRecord(type, target) {
12
10
  this.type = type;
13
11
  this.target = target;
package/lib/dom/Node.js CHANGED
@@ -16,9 +16,7 @@ var _EventTarget = require("./EventTarget");
16
16
  /**
17
17
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Node
18
18
  */
19
- var Node =
20
- /** @class */
21
- function (_super) {
19
+ var Node = function (_super) {
22
20
  (0, _tslib.__extends)(Node, _super);
23
21
 
24
22
  function Node() {
@@ -127,7 +125,7 @@ function (_super) {
127
125
 
128
126
  if (this.nodeName === _.Shape.TEXT) {
129
127
  // @ts-ignore
130
- this.style.text = "".concat(content);
128
+ this.style.text = "" + content;
131
129
  } else {// this.appendChild(
132
130
  // new Text({
133
131
  // style: {
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; 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); }
3
+ 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); }
4
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.CullingStrategyContribution = exports.CullingPlugin = void 0;
6
+ exports.CullingPlugin = exports.CullingStrategyContribution = void 0;
7
7
 
8
8
  var _tslib = require("tslib");
9
9
 
@@ -21,9 +21,7 @@ var CullingStrategyContribution = _manaSyringe.Syringe.defineToken('CullingStrat
21
21
 
22
22
  exports.CullingStrategyContribution = CullingStrategyContribution;
23
23
 
24
- var CullingPlugin =
25
- /** @class */
26
- function () {
24
+ var CullingPlugin = function () {
27
25
  function CullingPlugin() {}
28
26
 
29
27
  CullingPlugin_1 = CullingPlugin;
@@ -16,9 +16,7 @@ var _RenderingContext = require("../services/RenderingContext");
16
16
  /**
17
17
  * Filter dirty renderables and calculate the "dirty rectangle" which will be clear when frame began
18
18
  */
19
- var DirtyCheckPlugin =
20
- /** @class */
21
- function () {
19
+ var DirtyCheckPlugin = function () {
22
20
  function DirtyCheckPlugin() {}
23
21
 
24
22
  DirtyCheckPlugin_1 = DirtyCheckPlugin;
@@ -29,9 +29,7 @@ var _event = require("../utils/event");
29
29
  *
30
30
  * also provide some extra events such as `drag`
31
31
  */
32
- var EventPlugin =
33
- /** @class */
34
- function () {
32
+ var EventPlugin = function () {
35
33
  function EventPlugin() {
36
34
  var _this = this;
37
35
 
@@ -319,7 +317,10 @@ function () {
319
317
  if ((0, _util.isUndefined)(touch.twist)) touch.twist = 0;
320
318
  if ((0, _util.isUndefined)(touch.tangentialPressure)) touch.tangentialPressure = 0;
321
319
  touch.isNormalized = true;
322
- touch.type = event.type;
320
+ touch.type = event.type; // ref to nativeEvent
321
+ // touch.nativeEvent = event;
322
+ // touch.isLast = event.changedTouches.length - 1 === i;
323
+
323
324
  normalizedEvents.push(touch);
324
325
  }
325
326
  } else if (canvas.isMouseEvent(event)) {
@@ -22,9 +22,7 @@ var _ = require("..");
22
22
  // group is not a 2d shape
23
23
  var shape2D = [_.Shape.CIRCLE, _.Shape.ELLIPSE, _.Shape.IMAGE, _.Shape.RECT, _.Shape.LINE, _.Shape.POLYLINE, _.Shape.POLYGON, _.Shape.TEXT, _.Shape.PATH, _.Shape.HTML];
24
24
 
25
- var FrustumCullingStrategy =
26
- /** @class */
27
- function () {
25
+ var FrustumCullingStrategy = function () {
28
26
  function FrustumCullingStrategy() {}
29
27
 
30
28
  FrustumCullingStrategy.prototype.isVisible = function (object) {
@@ -15,9 +15,7 @@ var _dom = require("../dom");
15
15
 
16
16
  var _services = require("../services");
17
17
 
18
- var PrepareRendererPlugin =
19
- /** @class */
20
- function () {
18
+ var PrepareRendererPlugin = function () {
21
19
  function PrepareRendererPlugin() {}
22
20
 
23
21
  PrepareRendererPlugin_1 = PrepareRendererPlugin;
@@ -33,9 +33,7 @@ var _ContextService = require("./ContextService");
33
33
 
34
34
  var PROPAGATION_LIMIT = 2048;
35
35
 
36
- var EventService =
37
- /** @class */
38
- function (_super) {
36
+ var EventService = function (_super) {
39
37
  (0, _tslib.__extends)(EventService, _super);
40
38
 
41
39
  function EventService() {
@@ -69,7 +67,9 @@ function (_super) {
69
67
  this.dispatchEvent(e, 'pointerdown');
70
68
 
71
69
  if (e.pointerType === 'touch') {
72
- this.dispatchEvent(e, 'touchstart');
70
+ // only the
71
+ // if (e.isLast) {
72
+ this.dispatchEvent(e, 'touchstart'); // }
73
73
  } else if (e.pointerType === 'mouse' || e.pointerType === 'pen') {
74
74
  isRightButton = e.button === 2;
75
75
  this.dispatchEvent(e, isRightButton ? 'rightdown' : 'mousedown');
@@ -589,7 +589,7 @@ function (_super) {
589
589
  mappers[i].fn(e);
590
590
  }
591
591
  } else {
592
- console.warn("[EventService]: Event mapping not defined for ".concat(e.type));
592
+ console.warn("[EventService]: Event mapping not defined for " + e.type);
593
593
  }
594
594
  };
595
595
 
@@ -693,8 +693,27 @@ function (_super) {
693
693
  };
694
694
 
695
695
  EventService.prototype.isNativeEventFromCanvas = function (event) {
696
+ var _a;
697
+
696
698
  var $el = this.contextService.getDomElement();
697
- return event.nativeEvent.composedPath().indexOf($el) > -1;
699
+ var target = (_a = event.nativeEvent) === null || _a === void 0 ? void 0 : _a.target;
700
+
701
+ if (target) {
702
+ if (target === $el) {
703
+ return true;
704
+ }
705
+
706
+ if ($el && $el.contains) {
707
+ return $el.contains(target);
708
+ }
709
+ }
710
+
711
+ if (event.nativeEvent.composedPath) {
712
+ return event.nativeEvent.composedPath().indexOf($el) > -1;
713
+ } // account for Touch
714
+
715
+
716
+ return false;
698
717
  };
699
718
 
700
719
  EventService.prototype.createPointerEvent = function (from, type, target) {
@@ -902,7 +921,7 @@ function (_super) {
902
921
 
903
922
  EventService.prototype.notifyTarget = function (e, type) {
904
923
  type = type !== null && type !== void 0 ? type : e.type;
905
- var key = e.eventPhase === e.CAPTURING_PHASE || e.eventPhase === e.AT_TARGET ? "".concat(type, "capture") : type;
924
+ var key = e.eventPhase === e.CAPTURING_PHASE || e.eventPhase === e.AT_TARGET ? type + "capture" : type;
906
925
  this.notifyListeners(e, key);
907
926
 
908
927
  if (e.eventPhase === e.AT_TARGET) {
@@ -15,9 +15,7 @@ var _manaSyringe = require("mana-syringe");
15
15
  * - g-plugin-canvas-picker `ctx.isPointInPath`
16
16
  * - g-plugin-webgl-renderer `ctx.createLinearGradient` and generate texture
17
17
  */
18
- var OffscreenCanvasCreator =
19
- /** @class */
20
- function () {
18
+ var OffscreenCanvasCreator = function () {
21
19
  function OffscreenCanvasCreator() {}
22
20
 
23
21
  OffscreenCanvasCreator.prototype.getOrCreateCanvas = function (offscreenCanvas) {
@@ -1,3 +1,4 @@
1
+ import { Syringe } from 'mana-syringe';
1
2
  import type { Group } from '../display-objects';
2
3
  /**
3
4
  * why we need re-render
@@ -7,7 +8,7 @@ export declare enum RenderReason {
7
8
  DISPLAY_OBJECT_CHANGED = 1,
8
9
  NONE = 2
9
10
  }
10
- export declare const RenderingContext = "RenderingContext";
11
+ export declare const RenderingContext: Syringe.DefinedToken;
11
12
  export interface RenderingContext {
12
13
  /**
13
14
  * root of scenegraph
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.RenderingContext = exports.RenderReason = void 0;
7
7
 
8
+ var _manaSyringe = require("mana-syringe");
9
+
8
10
  /**
9
11
  * why we need re-render
10
12
  */
@@ -17,5 +19,6 @@ exports.RenderReason = RenderReason;
17
19
  RenderReason[RenderReason["NONE"] = 2] = "NONE";
18
20
  })(RenderReason || (exports.RenderReason = RenderReason = {}));
19
21
 
20
- var RenderingContext = 'RenderingContext';
22
+ var RenderingContext = _manaSyringe.Syringe.defineToken('RenderingContext');
23
+
21
24
  exports.RenderingContext = RenderingContext;
@@ -33,9 +33,7 @@ var RenderingPluginContribution = _manaSyringe.Syringe.defineToken('RenderingPlu
33
33
 
34
34
  exports.RenderingPluginContribution = RenderingPluginContribution;
35
35
 
36
- var RenderingService =
37
- /** @class */
38
- function () {
36
+ var RenderingService = function () {
39
37
  function RenderingService() {
40
38
  this.inited = false;
41
39
  this.stats = {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SceneGraphSelectorFactory = exports.SceneGraphSelector = exports.DefaultSceneGraphSelector = void 0;
6
+ exports.DefaultSceneGraphSelector = exports.SceneGraphSelector = exports.SceneGraphSelectorFactory = void 0;
7
7
 
8
8
  var _tslib = require("tslib");
9
9
 
@@ -29,9 +29,7 @@ var NAME_REGEXP = /\[\s*name=(.*)\s*\]/;
29
29
  * * querySelectorAll
30
30
  */
31
31
 
32
- var DefaultSceneGraphSelector =
33
- /** @class */
34
- function () {
32
+ var DefaultSceneGraphSelector = function () {
35
33
  function DefaultSceneGraphSelector() {}
36
34
 
37
35
  DefaultSceneGraphSelector.prototype.selectOne = function (query, root) {
@@ -1,3 +1,4 @@
1
+ import { Syringe } from 'mana-syringe';
1
2
  import type { Transform } from '../components';
2
3
  import type { vec2 } from 'gl-matrix';
3
4
  import { mat4, quat, vec3 } from 'gl-matrix';
@@ -5,7 +6,7 @@ import { AABB, Rectangle } from '../shapes';
5
6
  import type { IElement, INode, IParentNode } from '../dom/interfaces';
6
7
  export declare function sortByZIndex(o1: IElement, o2: IElement): number;
7
8
  export declare function dirtifyToRoot(element: INode, affectChildren?: boolean): void;
8
- export declare const SceneGraphService = "SceneGraphService";
9
+ export declare const SceneGraphService: Syringe.DefinedToken;
9
10
  export interface SceneGraphService {
10
11
  matches: <T extends IElement>(query: string, root: T) => boolean;
11
12
  querySelector: <R extends IElement, T extends IElement>(query: string, root: R) => T | null;
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SceneGraphService = exports.DefaultSceneGraphService = void 0;
7
- exports.dirtifyToRoot = dirtifyToRoot;
8
6
  exports.sortByZIndex = sortByZIndex;
7
+ exports.dirtifyToRoot = dirtifyToRoot;
8
+ exports.DefaultSceneGraphService = exports.SceneGraphService = void 0;
9
9
 
10
10
  var _tslib = require("tslib");
11
11
 
@@ -64,18 +64,17 @@ function dirtifyToRoot(element, affectChildren) {
64
64
  });
65
65
  }
66
66
 
67
- var SceneGraphService = 'SceneGraphService';
67
+ var SceneGraphService = _manaSyringe.Syringe.defineToken('SceneGraphService');
68
68
  /**
69
69
  * update transform in scene graph
70
70
  *
71
71
  * @see https://community.khronos.org/t/scene-graphs/50542/7
72
72
  */
73
73
 
74
+
74
75
  exports.SceneGraphService = SceneGraphService;
75
76
 
76
- var DefaultSceneGraphService =
77
- /** @class */
78
- function () {
77
+ var DefaultSceneGraphService = function () {
79
78
  function DefaultSceneGraphService() {
80
79
  var _this = this;
81
80
  /**
@@ -34,12 +34,10 @@ var regexCannotStartJaJp = /[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾー
34
34
  var regexCannotEndJaJp = /[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/;
35
35
  var regexCannotStartKoKr = /[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/;
36
36
  var regexCannotEndKoKr = /[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/;
37
- var regexCannotStart = new RegExp("".concat(regexCannotStartZhCn.source, "|").concat(regexCannotStartZhTw.source, "|").concat(regexCannotStartJaJp.source, "|").concat(regexCannotStartKoKr.source));
38
- var regexCannotEnd = new RegExp("".concat(regexCannotEndZhCn.source, "|").concat(regexCannotEndZhTw.source, "|").concat(regexCannotEndJaJp.source, "|").concat(regexCannotEndKoKr.source));
37
+ var regexCannotStart = new RegExp(regexCannotStartZhCn.source + "|" + regexCannotStartZhTw.source + "|" + regexCannotStartJaJp.source + "|" + regexCannotStartKoKr.source);
38
+ var regexCannotEnd = new RegExp(regexCannotEndZhCn.source + "|" + regexCannotEndZhTw.source + "|" + regexCannotEndJaJp.source + "|" + regexCannotEndKoKr.source);
39
39
 
40
- var TextService =
41
- /** @class */
42
- function () {
40
+ var TextService = function () {
43
41
  function TextService() {
44
42
  var _this = this;
45
43
 
@@ -13,9 +13,7 @@ var _interfaces = require("./interfaces");
13
13
 
14
14
  var _types = require("../../types");
15
15
 
16
- var CircleUpdater =
17
- /** @class */
18
- function () {
16
+ var CircleUpdater = function () {
19
17
  function CircleUpdater() {}
20
18
 
21
19
  CircleUpdater.prototype.update = function (parsedStyle, object) {
@@ -13,9 +13,7 @@ var _interfaces = require("./interfaces");
13
13
 
14
14
  var _types = require("../../types");
15
15
 
16
- var EllipseUpdater =
17
- /** @class */
18
- function () {
16
+ var EllipseUpdater = function () {
19
17
  function EllipseUpdater() {}
20
18
 
21
19
  EllipseUpdater.prototype.update = function (parsedStyle, object) {
@@ -13,9 +13,7 @@ var _interfaces = require("./interfaces");
13
13
 
14
14
  var _types = require("../../types");
15
15
 
16
- var LineUpdater =
17
- /** @class */
18
- function () {
16
+ var LineUpdater = function () {
19
17
  function LineUpdater() {}
20
18
 
21
19
  LineUpdater.prototype.update = function (parsedStyle) {
@@ -13,9 +13,7 @@ var _interfaces = require("./interfaces");
13
13
 
14
14
  var _types = require("../../types");
15
15
 
16
- var PathUpdater =
17
- /** @class */
18
- function () {
16
+ var PathUpdater = function () {
19
17
  function PathUpdater() {}
20
18
 
21
19
  PathUpdater.prototype.update = function (parsedStyle) {
@@ -13,9 +13,7 @@ var _interfaces = require("./interfaces");
13
13
 
14
14
  var _types = require("../../types");
15
15
 
16
- var PolylineUpdater =
17
- /** @class */
18
- function () {
16
+ var PolylineUpdater = function () {
19
17
  function PolylineUpdater() {}
20
18
 
21
19
  PolylineUpdater.prototype.update = function (parsedStyle) {
@@ -17,9 +17,7 @@ var _types = require("../../types");
17
17
 
18
18
  var _css = require("../../css");
19
19
 
20
- var RectUpdater =
21
- /** @class */
22
- function () {
20
+ var RectUpdater = function () {
23
21
  function RectUpdater() {}
24
22
 
25
23
  RectUpdater.prototype.update = function (parsedStyle, object) {
@@ -19,9 +19,7 @@ var _types = require("../../types");
19
19
 
20
20
  var _css = require("../../css");
21
21
 
22
- var TextUpdater =
23
- /** @class */
24
- function () {
22
+ var TextUpdater = function () {
25
23
  function TextUpdater() {}
26
24
 
27
25
  TextUpdater.prototype.isReadyToMeasure = function (parsedStyle, object) {
@@ -24,34 +24,34 @@ Object.defineProperty(exports, "EllipseUpdater", {
24
24
  return _EllipseUpdater.EllipseUpdater;
25
25
  }
26
26
  });
27
- Object.defineProperty(exports, "LineUpdater", {
27
+ Object.defineProperty(exports, "RectUpdater", {
28
28
  enumerable: true,
29
29
  get: function get() {
30
- return _LineUpdater.LineUpdater;
30
+ return _RectUpdater.RectUpdater;
31
31
  }
32
32
  });
33
- Object.defineProperty(exports, "PathUpdater", {
33
+ Object.defineProperty(exports, "TextUpdater", {
34
34
  enumerable: true,
35
35
  get: function get() {
36
- return _PathUpdater.PathUpdater;
36
+ return _TextUpdater.TextUpdater;
37
37
  }
38
38
  });
39
- Object.defineProperty(exports, "PolylineUpdater", {
39
+ Object.defineProperty(exports, "LineUpdater", {
40
40
  enumerable: true,
41
41
  get: function get() {
42
- return _PolylineUpdater.PolylineUpdater;
42
+ return _LineUpdater.LineUpdater;
43
43
  }
44
44
  });
45
- Object.defineProperty(exports, "RectUpdater", {
45
+ Object.defineProperty(exports, "PolylineUpdater", {
46
46
  enumerable: true,
47
47
  get: function get() {
48
- return _RectUpdater.RectUpdater;
48
+ return _PolylineUpdater.PolylineUpdater;
49
49
  }
50
50
  });
51
- Object.defineProperty(exports, "TextUpdater", {
51
+ Object.defineProperty(exports, "PathUpdater", {
52
52
  enumerable: true,
53
53
  get: function get() {
54
- return _TextUpdater.TextUpdater;
54
+ return _PathUpdater.PathUpdater;
55
55
  }
56
56
  });
57
57
 
@@ -1,7 +1,8 @@
1
+ import { Syringe } from 'mana-syringe';
1
2
  import type { DisplayObject } from '../../display-objects/DisplayObject';
2
3
  import type { ParsedBaseStyleProps } from '../../types';
3
- export declare const GeometryUpdaterFactory = "GeometryUpdaterFactory";
4
- export declare const GeometryAABBUpdater = "GeometryAABBUpdater";
4
+ export declare const GeometryUpdaterFactory: Syringe.DefinedToken;
5
+ export declare const GeometryAABBUpdater: Syringe.DefinedToken;
5
6
  export interface GeometryAABBUpdater<T extends ParsedBaseStyleProps = any> {
6
7
  update: (parsedStyle: T, object: DisplayObject) => {
7
8
  width: number;
@@ -3,8 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.GeometryUpdaterFactory = exports.GeometryAABBUpdater = void 0;
7
- var GeometryUpdaterFactory = 'GeometryUpdaterFactory';
6
+ exports.GeometryAABBUpdater = exports.GeometryUpdaterFactory = void 0;
7
+
8
+ var _manaSyringe = require("mana-syringe");
9
+
10
+ var GeometryUpdaterFactory = _manaSyringe.Syringe.defineToken('GeometryUpdaterFactory');
11
+
8
12
  exports.GeometryUpdaterFactory = GeometryUpdaterFactory;
9
- var GeometryAABBUpdater = 'GeometryAABBUpdater';
13
+
14
+ var GeometryAABBUpdater = _manaSyringe.Syringe.defineToken('GeometryAABBUpdater');
15
+
10
16
  exports.GeometryAABBUpdater = GeometryAABBUpdater;
@@ -12,9 +12,7 @@ var _glMatrix = require("gl-matrix");
12
12
  * 为了便于后续 Frustum Culling,通过查找表定义 p-vertex 和 n-vertex
13
13
  * @see https://github.com/antvis/GWebGPUEngine/issues/3
14
14
  */
15
- var AABB =
16
- /** @class */
17
- function () {
15
+ var AABB = function () {
18
16
  function AABB(center, halfExtents) {
19
17
  this.min = _glMatrix.vec3.create();
20
18
  this.max = _glMatrix.vec3.create();
@@ -9,9 +9,7 @@ var _glMatrix = require("gl-matrix");
9
9
 
10
10
  var tmpVecA = _glMatrix.vec3.create();
11
11
 
12
- var BoundingSphere =
13
- /** @class */
14
- function () {
12
+ var BoundingSphere = function () {
15
13
  function BoundingSphere(center, radius) {
16
14
  this.center = center || _glMatrix.vec3.create();
17
15
  this.radius = radius || 0.5;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Mask = exports.Frustum = void 0;
6
+ exports.Frustum = exports.Mask = void 0;
7
7
 
8
8
  var _tslib = require("tslib");
9
9
 
@@ -20,9 +20,7 @@ exports.Mask = Mask;
20
20
  Mask[Mask["INDETERMINATE"] = 2147483647] = "INDETERMINATE";
21
21
  })(Mask || (exports.Mask = Mask = {}));
22
22
 
23
- var Frustum =
24
- /** @class */
25
- function () {
23
+ var Frustum = function () {
26
24
  function Frustum(planes) {
27
25
  this.planes = [];
28
26
 
@@ -7,9 +7,7 @@ exports.Plane = void 0;
7
7
 
8
8
  var _glMatrix = require("gl-matrix");
9
9
 
10
- var Plane =
11
- /** @class */
12
- function () {
10
+ var Plane = function () {
13
11
  function Plane(distance, normal) {
14
12
  this.distance = distance || 0;
15
13
  this.normal = normal || _glMatrix.vec3.fromValues(0, 1, 0);
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Point = void 0;
7
7
 
8
- var Point =
9
- /** @class */
10
- function () {
8
+ var Point = function () {
11
9
  function Point(x, y) {
12
10
  if (x === void 0) {
13
11
  x = 0;