@antv/g 5.0.22-alpha.5 → 5.0.22-alpha.6

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 (274) hide show
  1. package/dist/index.umd.min.js +30 -0
  2. package/es/AbstractRenderer.js +3 -1
  3. package/es/Canvas.d.ts +1 -1
  4. package/es/Canvas.js +5 -3
  5. package/es/DisplayObjectPool.js +3 -1
  6. package/es/camera/Camera.d.ts +105 -66
  7. package/es/camera/Camera.js +307 -171
  8. package/es/camera/Landmark.d.ts +18 -25
  9. package/es/camera/Landmark.js +1 -72
  10. package/es/canvas-module.js +2 -4
  11. package/es/components/Cullable.js +3 -1
  12. package/es/components/Geometry.js +3 -1
  13. package/es/components/Renderable.js +3 -1
  14. package/es/components/Sortable.js +3 -1
  15. package/es/components/Transform.js +3 -1
  16. package/es/css/LayoutRegistry.js +3 -1
  17. package/es/css/StyleValueRegistry.d.ts +8 -0
  18. package/es/css/StyleValueRegistry.js +24 -19
  19. package/es/css/cssom/CSSColorValue.js +3 -1
  20. package/es/css/cssom/CSSGradientValue.js +8 -6
  21. package/es/css/cssom/CSSKeywordValue.js +3 -1
  22. package/es/css/cssom/CSSMathInvert.js +3 -1
  23. package/es/css/cssom/CSSMathMax.js +3 -1
  24. package/es/css/cssom/CSSMathMin.js +3 -1
  25. package/es/css/cssom/CSSMathNegate.js +3 -1
  26. package/es/css/cssom/CSSMathProduct.js +3 -1
  27. package/es/css/cssom/CSSMathSum.js +3 -1
  28. package/es/css/cssom/CSSMathValue.js +3 -1
  29. package/es/css/cssom/CSSMathVariadic.js +3 -1
  30. package/es/css/cssom/CSSNumericValue.js +3 -1
  31. package/es/css/cssom/CSSNumericValueType.d.ts +1 -1
  32. package/es/css/cssom/CSSNumericValueType.js +3 -1
  33. package/es/css/cssom/CSSRGB.js +4 -2
  34. package/es/css/cssom/CSSStyleValue.d.ts +1 -1
  35. package/es/css/cssom/CSSStyleValue.js +3 -1
  36. package/es/css/cssom/CSSTransformComponent.js +3 -1
  37. package/es/css/cssom/CSSTransformValue.js +3 -1
  38. package/es/css/cssom/CSSTranslate.js +3 -1
  39. package/es/css/cssom/CSSUnitValue.js +4 -2
  40. package/es/css/parser/color.js +2 -2
  41. package/es/css/parser/dimension.d.ts +1 -1
  42. package/es/css/parser/dimension.js +2 -2
  43. package/es/css/parser/numeric.js +1 -1
  44. package/es/css/parser/points.js +1 -1
  45. package/es/css/parser/transform-origin.js +1 -1
  46. package/es/css/properties/CSSPropertyAnchor.js +3 -1
  47. package/es/css/properties/CSSPropertyClipPath.js +3 -1
  48. package/es/css/properties/CSSPropertyColor.js +3 -1
  49. package/es/css/properties/CSSPropertyFilter.js +3 -1
  50. package/es/css/properties/CSSPropertyLengthOrPercentage.js +3 -1
  51. package/es/css/properties/CSSPropertyLineDash.js +3 -1
  52. package/es/css/properties/CSSPropertyLocalPosition.js +3 -1
  53. package/es/css/properties/CSSPropertyOffsetDistance.js +3 -1
  54. package/es/css/properties/CSSPropertyOffsetPath.js +3 -1
  55. package/es/css/properties/CSSPropertyOpacity.js +3 -1
  56. package/es/css/properties/CSSPropertyPath.js +3 -1
  57. package/es/css/properties/CSSPropertyPoints.js +3 -1
  58. package/es/css/properties/CSSPropertyShadowBlur.js +3 -1
  59. package/es/css/properties/CSSPropertyText.d.ts +1 -1
  60. package/es/css/properties/CSSPropertyText.js +4 -2
  61. package/es/css/properties/CSSPropertyTextTransform.d.ts +2 -2
  62. package/es/css/properties/CSSPropertyTextTransform.js +3 -1
  63. package/es/css/properties/CSSPropertyTransform.js +4 -2
  64. package/es/css/properties/CSSPropertyTransformOrigin.js +3 -1
  65. package/es/css/properties/CSSPropertyVisibility.js +3 -1
  66. package/es/css/properties/CSSPropertyZIndex.js +3 -1
  67. package/es/display-objects/Circle.js +3 -1
  68. package/es/display-objects/CustomElement.js +3 -1
  69. package/es/display-objects/DisplayObject.js +7 -4
  70. package/es/display-objects/Ellipse.js +3 -1
  71. package/es/display-objects/Group.js +3 -1
  72. package/es/display-objects/HTML.js +6 -3
  73. package/es/display-objects/Image.js +3 -1
  74. package/es/display-objects/Line.js +3 -1
  75. package/es/display-objects/Path.js +5 -3
  76. package/es/display-objects/Polygon.js +3 -1
  77. package/es/display-objects/Polyline.js +3 -1
  78. package/es/display-objects/Rect.js +3 -1
  79. package/es/display-objects/Text.js +6 -3
  80. package/es/dom/Animation.js +4 -2
  81. package/es/dom/AnimationEffectTiming.js +3 -1
  82. package/es/dom/AnimationEvent.js +3 -1
  83. package/es/dom/AnimationTimeline.js +3 -1
  84. package/es/dom/CustomElementRegistry.js +3 -1
  85. package/es/dom/CustomEvent.js +3 -1
  86. package/es/dom/Document.js +3 -1
  87. package/es/dom/Element.js +7 -5
  88. package/es/dom/EventTarget.js +6 -4
  89. package/es/dom/FederatedEvent.js +3 -1
  90. package/es/dom/FederatedMouseEvent.js +3 -1
  91. package/es/dom/FederatedPointerEvent.js +3 -1
  92. package/es/dom/FederatedTouchEvent.d.ts +13 -0
  93. package/es/dom/FederatedTouchEvent.js +19 -0
  94. package/es/dom/FederatedWheelEvent.js +3 -1
  95. package/es/dom/KeyframeEffect.js +3 -1
  96. package/es/dom/KeyframeList.js +1 -1
  97. package/es/dom/MutationEvent.js +3 -1
  98. package/es/dom/MutationObserver.js +10 -3
  99. package/es/dom/MutationRecord.js +3 -1
  100. package/es/dom/Node.js +4 -2
  101. package/es/plugins/CullingPlugin.js +3 -1
  102. package/es/plugins/DirtyCheckPlugin.js +3 -1
  103. package/es/plugins/EventPlugin.js +4 -2
  104. package/es/plugins/FrustumCullingStrategy.js +3 -1
  105. package/es/plugins/PrepareRendererPlugin.js +3 -1
  106. package/es/services/EventService.js +5 -3
  107. package/es/services/OffscreenCanvasCreator.js +3 -1
  108. package/es/services/RenderingService.js +3 -1
  109. package/es/services/SceneGraphSelector.js +3 -1
  110. package/es/services/SceneGraphService.js +4 -2
  111. package/es/services/TextService.js +5 -3
  112. package/es/services/aabb/CircleUpdater.js +3 -1
  113. package/es/services/aabb/EllipseUpdater.js +3 -1
  114. package/es/services/aabb/LineUpdater.js +3 -1
  115. package/es/services/aabb/PathUpdater.js +3 -1
  116. package/es/services/aabb/PolylineUpdater.js +3 -1
  117. package/es/services/aabb/RectUpdater.js +4 -2
  118. package/es/services/aabb/TextUpdater.js +3 -1
  119. package/es/shapes/AABB.js +3 -1
  120. package/es/shapes/BoundingSphere.js +3 -1
  121. package/es/shapes/Frustum.js +3 -1
  122. package/es/shapes/Plane.js +3 -1
  123. package/es/shapes/Point.js +3 -1
  124. package/es/shapes/Ray.js +3 -1
  125. package/es/shapes/Rectangle.js +3 -1
  126. package/es/types.d.ts +4 -0
  127. package/es/utils/custom-easing.js +1 -1
  128. package/es/utils/math.d.ts +1 -2
  129. package/es/utils/math.js +11 -6
  130. package/es/utils/path.d.ts +1 -1
  131. package/es/utils/path.js +3 -3
  132. package/es/utils/text.js +4 -4
  133. package/lib/AbstractRenderer.js +3 -1
  134. package/lib/Canvas.d.ts +1 -1
  135. package/lib/Canvas.js +5 -3
  136. package/lib/DisplayObjectPool.js +3 -1
  137. package/lib/camera/Camera.d.ts +105 -66
  138. package/lib/camera/Camera.js +314 -179
  139. package/lib/camera/Landmark.d.ts +18 -25
  140. package/lib/camera/Landmark.js +1 -75
  141. package/lib/canvas-module.js +1 -3
  142. package/lib/components/Cullable.js +4 -2
  143. package/lib/components/Geometry.js +3 -1
  144. package/lib/components/Renderable.js +3 -1
  145. package/lib/components/Sortable.js +3 -1
  146. package/lib/components/Transform.js +3 -1
  147. package/lib/css/LayoutRegistry.js +3 -1
  148. package/lib/css/StyleValueRegistry.d.ts +8 -0
  149. package/lib/css/StyleValueRegistry.js +27 -20
  150. package/lib/css/cssom/CSSColorValue.js +3 -1
  151. package/lib/css/cssom/CSSGradientValue.js +9 -7
  152. package/lib/css/cssom/CSSKeywordValue.js +3 -1
  153. package/lib/css/cssom/CSSMathInvert.js +3 -1
  154. package/lib/css/cssom/CSSMathMax.js +3 -1
  155. package/lib/css/cssom/CSSMathMin.js +3 -1
  156. package/lib/css/cssom/CSSMathNegate.js +3 -1
  157. package/lib/css/cssom/CSSMathOperator.js +1 -1
  158. package/lib/css/cssom/CSSMathProduct.js +3 -1
  159. package/lib/css/cssom/CSSMathSum.js +3 -1
  160. package/lib/css/cssom/CSSMathValue.js +3 -1
  161. package/lib/css/cssom/CSSMathVariadic.js +4 -2
  162. package/lib/css/cssom/CSSNumericValue.js +3 -1
  163. package/lib/css/cssom/CSSNumericValueType.d.ts +1 -1
  164. package/lib/css/cssom/CSSNumericValueType.js +5 -3
  165. package/lib/css/cssom/CSSRGB.js +4 -2
  166. package/lib/css/cssom/CSSStyleValue.d.ts +1 -1
  167. package/lib/css/cssom/CSSStyleValue.js +4 -2
  168. package/lib/css/cssom/CSSTransformComponent.js +4 -2
  169. package/lib/css/cssom/CSSTransformValue.js +3 -1
  170. package/lib/css/cssom/CSSTranslate.js +3 -1
  171. package/lib/css/cssom/CSSUnitValue.js +4 -2
  172. package/lib/css/cssom/types.js +1 -1
  173. package/lib/css/parser/color.js +7 -7
  174. package/lib/css/parser/dimension.d.ts +1 -1
  175. package/lib/css/parser/dimension.js +9 -8
  176. package/lib/css/parser/numeric.js +6 -6
  177. package/lib/css/parser/path.js +1 -1
  178. package/lib/css/parser/points.js +2 -2
  179. package/lib/css/parser/transform-origin.js +2 -2
  180. package/lib/css/parser/transform.js +2 -2
  181. package/lib/css/properties/CSSPropertyAnchor.js +3 -1
  182. package/lib/css/properties/CSSPropertyClipPath.js +3 -1
  183. package/lib/css/properties/CSSPropertyColor.js +3 -1
  184. package/lib/css/properties/CSSPropertyFilter.js +3 -1
  185. package/lib/css/properties/CSSPropertyLengthOrPercentage.js +3 -1
  186. package/lib/css/properties/CSSPropertyLineDash.js +3 -1
  187. package/lib/css/properties/CSSPropertyLocalPosition.js +3 -1
  188. package/lib/css/properties/CSSPropertyOffsetDistance.js +3 -1
  189. package/lib/css/properties/CSSPropertyOffsetPath.js +3 -1
  190. package/lib/css/properties/CSSPropertyOpacity.js +3 -1
  191. package/lib/css/properties/CSSPropertyPath.js +3 -1
  192. package/lib/css/properties/CSSPropertyPoints.js +3 -1
  193. package/lib/css/properties/CSSPropertyShadowBlur.js +3 -1
  194. package/lib/css/properties/CSSPropertyText.d.ts +1 -1
  195. package/lib/css/properties/CSSPropertyText.js +4 -2
  196. package/lib/css/properties/CSSPropertyTextTransform.d.ts +2 -2
  197. package/lib/css/properties/CSSPropertyTextTransform.js +3 -1
  198. package/lib/css/properties/CSSPropertyTransform.js +4 -2
  199. package/lib/css/properties/CSSPropertyTransformOrigin.js +3 -1
  200. package/lib/css/properties/CSSPropertyVisibility.js +3 -1
  201. package/lib/css/properties/CSSPropertyZIndex.js +3 -1
  202. package/lib/display-objects/Circle.js +3 -1
  203. package/lib/display-objects/CustomElement.js +3 -1
  204. package/lib/display-objects/DisplayObject.js +14 -11
  205. package/lib/display-objects/Ellipse.js +3 -1
  206. package/lib/display-objects/Group.js +3 -1
  207. package/lib/display-objects/HTML.js +6 -4
  208. package/lib/display-objects/Image.js +3 -1
  209. package/lib/display-objects/Line.js +3 -1
  210. package/lib/display-objects/Path.js +8 -6
  211. package/lib/display-objects/Polygon.js +3 -1
  212. package/lib/display-objects/Polyline.js +3 -1
  213. package/lib/display-objects/Rect.js +3 -1
  214. package/lib/display-objects/Text.js +6 -4
  215. package/lib/dom/Animation.js +4 -2
  216. package/lib/dom/AnimationEffectTiming.js +3 -1
  217. package/lib/dom/AnimationEvent.js +3 -1
  218. package/lib/dom/AnimationTimeline.js +4 -2
  219. package/lib/dom/CustomElementRegistry.js +3 -1
  220. package/lib/dom/CustomEvent.js +3 -1
  221. package/lib/dom/Document.js +3 -1
  222. package/lib/dom/Element.js +8 -6
  223. package/lib/dom/EventTarget.js +13 -11
  224. package/lib/dom/FederatedEvent.js +3 -1
  225. package/lib/dom/FederatedMouseEvent.js +3 -1
  226. package/lib/dom/FederatedPointerEvent.js +3 -1
  227. package/lib/dom/FederatedTouchEvent.d.ts +13 -0
  228. package/lib/dom/FederatedTouchEvent.js +27 -0
  229. package/lib/dom/FederatedWheelEvent.js +3 -1
  230. package/lib/dom/KeyframeEffect.js +4 -2
  231. package/lib/dom/KeyframeList.js +1 -1
  232. package/lib/dom/MutationEvent.js +3 -1
  233. package/lib/dom/MutationObserver.js +11 -4
  234. package/lib/dom/MutationRecord.js +3 -1
  235. package/lib/dom/Node.js +4 -2
  236. package/lib/index.js +1 -1
  237. package/lib/plugins/CullingPlugin.js +4 -2
  238. package/lib/plugins/DirtyCheckPlugin.js +3 -1
  239. package/lib/plugins/EventPlugin.js +26 -24
  240. package/lib/plugins/FrustumCullingStrategy.js +3 -1
  241. package/lib/plugins/PrepareRendererPlugin.js +3 -1
  242. package/lib/services/EventService.js +5 -3
  243. package/lib/services/OffscreenCanvasCreator.js +3 -1
  244. package/lib/services/RenderingService.js +3 -1
  245. package/lib/services/SceneGraphSelector.js +4 -2
  246. package/lib/services/SceneGraphService.js +7 -5
  247. package/lib/services/TextService.js +5 -3
  248. package/lib/services/aabb/CircleUpdater.js +3 -1
  249. package/lib/services/aabb/EllipseUpdater.js +3 -1
  250. package/lib/services/aabb/LineUpdater.js +3 -1
  251. package/lib/services/aabb/PathUpdater.js +3 -1
  252. package/lib/services/aabb/PolylineUpdater.js +3 -1
  253. package/lib/services/aabb/RectUpdater.js +5 -3
  254. package/lib/services/aabb/TextUpdater.js +3 -1
  255. package/lib/services/aabb/index.js +10 -10
  256. package/lib/services/aabb/interfaces.js +1 -1
  257. package/lib/shapes/AABB.js +3 -1
  258. package/lib/shapes/BoundingSphere.js +3 -1
  259. package/lib/shapes/Frustum.js +4 -2
  260. package/lib/shapes/Plane.js +3 -1
  261. package/lib/shapes/Point.js +3 -1
  262. package/lib/shapes/Ray.js +3 -1
  263. package/lib/shapes/Rectangle.js +3 -1
  264. package/lib/types.d.ts +4 -0
  265. package/lib/types.js +1 -1
  266. package/lib/utils/animation.js +3 -2
  267. package/lib/utils/bezier-easing.js +1 -1
  268. package/lib/utils/custom-easing.js +2 -2
  269. package/lib/utils/math.d.ts +1 -2
  270. package/lib/utils/math.js +20 -17
  271. package/lib/utils/path.d.ts +1 -1
  272. package/lib/utils/path.js +6 -6
  273. package/lib/utils/text.js +5 -5
  274. package/package.json +7 -5
@@ -9,7 +9,7 @@ var _tslib = require("tslib");
9
9
 
10
10
  var _manaSyringe = require("mana-syringe");
11
11
 
12
- var _util = require("@antv/util");
12
+ var _lodashEs = require("lodash-es");
13
13
 
14
14
  var _glMatrix = require("gl-matrix");
15
15
 
@@ -78,14 +78,17 @@ var DEFAULT_STYLE_PROPS = {
78
78
  * * attributeChanged
79
79
  */
80
80
 
81
- var DisplayObject = function (_super) {
81
+ var DisplayObject =
82
+ /** @class */
83
+ function (_super) {
82
84
  (0, _tslib.__extends)(DisplayObject, _super);
83
85
 
84
86
  function DisplayObject(config) {
85
- var _a, _b, _c;
87
+ var _this = this;
86
88
 
87
- var _this = _super.call(this) || this;
89
+ var _a, _b, _c;
88
90
 
91
+ _this = _super.call(this) || this;
89
92
  _this.styleValueRegistry = _manaSyringe.GlobalContainer.get(_StyleValueRegistry.StyleValueRegistry);
90
93
  /**
91
94
  * push to active animations after calling `animate()`
@@ -112,11 +115,11 @@ var DisplayObject = function (_super) {
112
115
  interactive: (_c = _this.config.interactive) !== null && _c !== void 0 ? _c : true
113
116
  }), _this.config.style), _this.config.attrs);
114
117
 
115
- if (!(0, _util.isNil)(_this.config.visible)) {
118
+ if (!(0, _lodashEs.isNil)(_this.config.visible)) {
116
119
  _this.config.style.visibility = _this.config.visible === false ? 'hidden' : 'visible';
117
120
  }
118
121
 
119
- if (!(0, _util.isNil)(_this.config.interactive)) {
122
+ if (!(0, _lodashEs.isNil)(_this.config.interactive)) {
120
123
  _this.config.style.pointerEvents = _this.config.interactive === false ? 'none' : 'auto';
121
124
  }
122
125
 
@@ -210,11 +213,11 @@ var DisplayObject = function (_super) {
210
213
  attributeValue = _a[1]; // ignore undefined value
211
214
 
212
215
 
213
- if ((0, _util.isUndefined)(value)) {
216
+ if ((0, _lodashEs.isUndefined)(value)) {
214
217
  return;
215
218
  }
216
219
 
217
- if (force || !(0, _util.isEqual)(attributeValue, this.attributes[attributeName])) {
220
+ if (force || !(0, _lodashEs.isEqual)(attributeValue, this.attributes[attributeName])) {
218
221
  this.internalSetAttribute(attributeName, attributeValue);
219
222
 
220
223
  _super.prototype.setAttribute.call(this, attributeName, attributeValue);
@@ -473,7 +476,7 @@ var DisplayObject = function (_super) {
473
476
  };
474
477
 
475
478
  DisplayObject.prototype.rotateLocal = function (x, y, z) {
476
- if ((0, _util.isNil)(y) && (0, _util.isNil)(z)) {
479
+ if ((0, _lodashEs.isNil)(y) && (0, _lodashEs.isNil)(z)) {
477
480
  this.sceneGraphService.rotateLocal(this, 0, 0, x);
478
481
  } else {
479
482
  this.sceneGraphService.rotateLocal(this, x, y, z);
@@ -483,7 +486,7 @@ var DisplayObject = function (_super) {
483
486
  };
484
487
 
485
488
  DisplayObject.prototype.rotate = function (x, y, z) {
486
- if ((0, _util.isNil)(y) && (0, _util.isNil)(z)) {
489
+ if ((0, _lodashEs.isNil)(y) && (0, _lodashEs.isNil)(z)) {
487
490
  this.sceneGraphService.rotate(this, 0, 0, x);
488
491
  } else {
489
492
  this.sceneGraphService.rotate(this, x, y, z);
@@ -793,7 +796,7 @@ var DisplayObject = function (_super) {
793
796
  return this.attributes;
794
797
  }
795
798
 
796
- if ((0, _util.isObject)(name)) {
799
+ if ((0, _lodashEs.isObject)(name)) {
797
800
  Object.keys(name).forEach(function (key) {
798
801
  _this.setAttribute(key, name[key]);
799
802
  });
@@ -11,7 +11,9 @@ var _types = require("../types");
11
11
 
12
12
  var _DisplayObject = require("./DisplayObject");
13
13
 
14
- var Ellipse = function (_super) {
14
+ var Ellipse =
15
+ /** @class */
16
+ function (_super) {
15
17
  (0, _tslib.__extends)(Ellipse, _super);
16
18
 
17
19
  function Ellipse(_a) {
@@ -21,7 +21,9 @@ var _DisplayObject = require("./DisplayObject");
21
21
  <circle cx="60" cy="60" r="25" />
22
22
  </g>
23
23
  */
24
- var Group = function (_super) {
24
+ var Group =
25
+ /** @class */
26
+ function (_super) {
25
27
  (0, _tslib.__extends)(Group, _super);
26
28
 
27
29
  function Group(_a) {
@@ -19,7 +19,9 @@ var _glMatrix = require("gl-matrix");
19
19
  * HTML container
20
20
  * @see https://github.com/pmndrs/drei#html
21
21
  */
22
- var HTML = function (_super) {
22
+ var HTML =
23
+ /** @class */
24
+ function (_super) {
23
25
  (0, _tslib.__extends)(HTML, _super);
24
26
 
25
27
  function HTML(_a) {
@@ -27,10 +29,11 @@ var HTML = function (_super) {
27
29
  _a = {};
28
30
  }
29
31
 
32
+ var _this = this;
33
+
30
34
  var style = _a.style,
31
35
  rest = (0, _tslib.__rest)(_a, ["style"]);
32
-
33
- var _this = _super.call(this, (0, _tslib.__assign)({
36
+ _this = _super.call(this, (0, _tslib.__assign)({
34
37
  type: _types.Shape.HTML,
35
38
  style: (0, _tslib.__assign)({
36
39
  innerHTML: '',
@@ -38,7 +41,6 @@ var HTML = function (_super) {
38
41
  style: ''
39
42
  }, style)
40
43
  }, rest)) || this;
41
-
42
44
  _this.cullable.enable = false;
43
45
  return _this;
44
46
  }
@@ -11,7 +11,9 @@ var _types = require("../types");
11
11
 
12
12
  var _DisplayObject = require("./DisplayObject");
13
13
 
14
- var Image = function (_super) {
14
+ var Image =
15
+ /** @class */
16
+ function (_super) {
15
17
  (0, _tslib.__extends)(Image, _super);
16
18
 
17
19
  function Image(_a) {
@@ -15,7 +15,9 @@ var _DisplayObject = require("./DisplayObject");
15
15
 
16
16
  var _shapes = require("../shapes");
17
17
 
18
- var Line = function (_super) {
18
+ var Line =
19
+ /** @class */
20
+ function (_super) {
19
21
  (0, _tslib.__extends)(Line, _super);
20
22
 
21
23
  function Line(_a) {
@@ -7,17 +7,19 @@ exports.Path = void 0;
7
7
 
8
8
  var _tslib = require("tslib");
9
9
 
10
+ var _gMath = require("@antv/g-math");
11
+
12
+ var _lodashEs = require("lodash-es");
13
+
10
14
  var _types = require("../types");
11
15
 
12
16
  var _DisplayObject = require("./DisplayObject");
13
17
 
14
18
  var _shapes = require("../shapes");
15
19
 
16
- var _gMath = require("@antv/g-math");
17
-
18
- var _util = require("@antv/util");
19
-
20
- var Path = function (_super) {
20
+ var Path =
21
+ /** @class */
22
+ function (_super) {
21
23
  (0, _tslib.__extends)(Path, _super);
22
24
 
23
25
  function Path(_a) {
@@ -66,7 +68,7 @@ var Path = function (_super) {
66
68
  });
67
69
  var seg = curve[index];
68
70
 
69
- if ((0, _util.isNil)(seg) || (0, _util.isNil)(index)) {
71
+ if ((0, _lodashEs.isNil)(seg) || (0, _lodashEs.isNil)(index)) {
70
72
  return null;
71
73
  }
72
74
 
@@ -11,7 +11,9 @@ var _types = require("../types");
11
11
 
12
12
  var _DisplayObject = require("./DisplayObject");
13
13
 
14
- var Polygon = function (_super) {
14
+ var Polygon =
15
+ /** @class */
16
+ function (_super) {
15
17
  (0, _tslib.__extends)(Polygon, _super);
16
18
 
17
19
  function Polygon(_a) {
@@ -15,7 +15,9 @@ var _DisplayObject = require("./DisplayObject");
15
15
 
16
16
  var _shapes = require("../shapes");
17
17
 
18
- var Polyline = function (_super) {
18
+ var Polyline =
19
+ /** @class */
20
+ function (_super) {
19
21
  (0, _tslib.__extends)(Polyline, _super);
20
22
 
21
23
  function Polyline(_a) {
@@ -11,7 +11,9 @@ var _types = require("../types");
11
11
 
12
12
  var _DisplayObject = require("./DisplayObject");
13
13
 
14
- var Rect = function (_super) {
14
+ var Rect =
15
+ /** @class */
16
+ function (_super) {
15
17
  (0, _tslib.__extends)(Rect, _super);
16
18
 
17
19
  function Rect(_a) {
@@ -14,7 +14,9 @@ var _DisplayObject = require("./DisplayObject");
14
14
  /**
15
15
  * <text> @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextElement
16
16
  */
17
- var Text = function (_super) {
17
+ var Text =
18
+ /** @class */
19
+ function (_super) {
18
20
  (0, _tslib.__extends)(Text, _super);
19
21
 
20
22
  function Text(_a) {
@@ -22,10 +24,11 @@ var Text = function (_super) {
22
24
  _a = {};
23
25
  }
24
26
 
27
+ var _this = this;
28
+
25
29
  var style = _a.style,
26
30
  rest = (0, _tslib.__rest)(_a, ["style"]);
27
-
28
- var _this = _super.call(this, (0, _tslib.__assign)({
31
+ _this = _super.call(this, (0, _tslib.__assign)({
29
32
  type: _types.Shape.TEXT,
30
33
  style: (0, _tslib.__assign)({
31
34
  text: '',
@@ -61,7 +64,6 @@ var Text = function (_super) {
61
64
  * @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement#constants
62
65
  */
63
66
 
64
-
65
67
  _this.LENGTHADJUST_SPACING = 1;
66
68
  _this.LENGTHADJUST_SPACINGANDGLYPHS = 2;
67
69
  _this.LENGTHADJUST_UNKNOWN = 0;
@@ -12,7 +12,9 @@ var sequenceNumber = 0;
12
12
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/Animation
13
13
  */
14
14
 
15
- var Animation = function () {
15
+ var Animation =
16
+ /** @class */
17
+ function () {
16
18
  function Animation(effect, timeline) {
17
19
  this.currentTimePending = false;
18
20
  /**
@@ -29,7 +31,7 @@ var Animation = function () {
29
31
  this.effect = effect;
30
32
  effect.animation = this;
31
33
  this.timeline = timeline;
32
- this.id = "" + sequenceNumber++;
34
+ this.id = "".concat(sequenceNumber++);
33
35
  this._inEffect = !!this.effect.update(0);
34
36
  this._holdTime = 0;
35
37
  this._paused = false;
@@ -10,7 +10,9 @@ var _animation = require("../utils/animation");
10
10
  /**
11
11
  * @see https://developer.mozilla.org/en-US/docs/Web/API/EffectTiming
12
12
  */
13
- var AnimationEffectTiming = function () {
13
+ var AnimationEffectTiming =
14
+ /** @class */
15
+ function () {
14
16
  function AnimationEffectTiming() {
15
17
  /**
16
18
  * @see https://developer.mozilla.org/en-US/docs/Web/API/EffectTiming/delay
@@ -12,7 +12,9 @@ var _FederatedEvent = require("./FederatedEvent");
12
12
  /**
13
13
  * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationPlaybackEvent
14
14
  */
15
- var AnimationEvent = function (_super) {
15
+ var AnimationEvent =
16
+ /** @class */
17
+ function (_super) {
16
18
  (0, _tslib.__extends)(AnimationEvent, _super);
17
19
 
18
20
  function AnimationEvent(manager, target, currentTime, timelineTime) {
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.compareAnimations = compareAnimations;
7
6
  exports.AnimationTimeline = void 0;
7
+ exports.compareAnimations = compareAnimations;
8
8
 
9
9
  var _tslib = require("tslib");
10
10
 
@@ -18,7 +18,9 @@ function compareAnimations(leftAnimation, rightAnimation) {
18
18
  */
19
19
 
20
20
 
21
- var AnimationTimeline = function () {
21
+ var AnimationTimeline =
22
+ /** @class */
23
+ function () {
22
24
  function AnimationTimeline(document) {
23
25
  var _this = this;
24
26
 
@@ -14,7 +14,9 @@ var _displayObjects = require("../display-objects");
14
14
  *
15
15
  * @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry
16
16
  */
17
- var CustomElementRegistry = function () {
17
+ var CustomElementRegistry =
18
+ /** @class */
19
+ function () {
18
20
  function CustomElementRegistry() {
19
21
  this.registry = {};
20
22
  this.define(_types.Shape.CIRCLE, _displayObjects.Circle);
@@ -21,7 +21,9 @@ var _FederatedEvent = require("./FederatedEvent");
21
21
 
22
22
  circle.dispatchEvent(event);
23
23
  */
24
- var CustomEvent = function (_super) {
24
+ var CustomEvent =
25
+ /** @class */
26
+ function (_super) {
25
27
  (0, _tslib.__extends)(CustomEvent, _super); // eslint-disable-next-line @typescript-eslint/ban-types
26
28
 
27
29
  function CustomEvent(eventName, object) {
@@ -20,7 +20,9 @@ var _css = require("../css");
20
20
  * Document -> Node -> EventTarget
21
21
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Document
22
22
  */
23
- var Document = function (_super) {
23
+ var Document =
24
+ /** @class */
25
+ function (_super) {
24
26
  (0, _tslib.__extends)(Document, _super);
25
27
 
26
28
  function Document() {
@@ -9,7 +9,7 @@ var _tslib = require("tslib");
9
9
 
10
10
  var _manaSyringe = require("mana-syringe");
11
11
 
12
- var _util = require("@antv/util");
12
+ var _lodashEs = require("lodash-es");
13
13
 
14
14
  var _SceneGraphService = require("../services/SceneGraphService");
15
15
 
@@ -31,7 +31,9 @@ var entityCounter = 0;
31
31
  * * Animation
32
32
  */
33
33
 
34
- var Element = function (_super) {
34
+ var Element =
35
+ /** @class */
36
+ function (_super) {
35
37
  (0, _tslib.__extends)(Element, _super);
36
38
 
37
39
  function Element() {
@@ -264,15 +266,15 @@ var Element = function (_super) {
264
266
  };
265
267
 
266
268
  Element.prototype.getElementById = function (id) {
267
- return this.sceneGraphService.querySelector("#" + id, this);
269
+ return this.sceneGraphService.querySelector("#".concat(id), this);
268
270
  };
269
271
 
270
272
  Element.prototype.getElementsByName = function (name) {
271
- return this.sceneGraphService.querySelectorAll("[name=\"" + name + "\"]", this);
273
+ return this.sceneGraphService.querySelectorAll("[name=\"".concat(name, "\"]"), this);
272
274
  };
273
275
 
274
276
  Element.prototype.getElementsByClassName = function (className) {
275
- return this.sceneGraphService.querySelectorAll("." + className, this);
277
+ return this.sceneGraphService.querySelectorAll(".".concat(className), this);
276
278
  };
277
279
 
278
280
  Element.prototype.getElementsByTagName = function (tagName) {
@@ -531,7 +533,7 @@ var Element = function (_super) {
531
533
 
532
534
  var value = this.attributes[attributeName]; // if the given attribute does not exist, the value returned will either be null or ""
533
535
 
534
- return (0, _util.isNil)(value) ? null : value;
536
+ return (0, _lodashEs.isNil)(value) ? null : value;
535
537
  };
536
538
  /**
537
539
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/hasAttribute
@@ -7,7 +7,7 @@ exports.EventTarget = exports.DELEGATION_SPLITTER = void 0;
7
7
 
8
8
  var _tslib = require("tslib");
9
9
 
10
- var _util = require("@antv/util");
10
+ var _lodashEs = require("lodash-es");
11
11
 
12
12
  var _eventemitter = require("eventemitter3");
13
13
 
@@ -24,7 +24,9 @@ var DELEGATION_SPLITTER = ':';
24
24
 
25
25
  exports.DELEGATION_SPLITTER = DELEGATION_SPLITTER;
26
26
 
27
- var EventTarget = function () {
27
+ var EventTarget =
28
+ /** @class */
29
+ function () {
28
30
  function EventTarget() {
29
31
  /**
30
32
  * event emitter
@@ -48,9 +50,9 @@ var EventTarget = function () {
48
50
 
49
51
 
50
52
  EventTarget.prototype.addEventListener = function (type, listener, options) {
51
- var capture = (0, _util.isBoolean)(options) && options || (0, _util.isObject)(options) && options.capture;
52
- var once = (0, _util.isObject)(options) && options.once;
53
- var context = (0, _util.isFunction)(listener) ? undefined : listener; // compatible with G 3.0
53
+ var capture = (0, _lodashEs.isBoolean)(options) && options || (0, _lodashEs.isObject)(options) && options.capture;
54
+ var once = (0, _lodashEs.isObject)(options) && options.once;
55
+ var context = (0, _lodashEs.isFunction)(listener) ? undefined : listener; // compatible with G 3.0
54
56
  // support using delegate name in event type, eg. 'node:click'
55
57
 
56
58
  var useDelegatedName = false;
@@ -66,8 +68,8 @@ var EventTarget = function () {
66
68
  useDelegatedName = true;
67
69
  }
68
70
 
69
- type = capture ? type + "capture" : type;
70
- listener = (0, _util.isFunction)(listener) ? listener : listener.handleEvent; // compatible with G 3.0
71
+ type = capture ? "".concat(type, "capture") : type;
72
+ listener = (0, _lodashEs.isFunction)(listener) ? listener : listener.handleEvent; // compatible with G 3.0
71
73
 
72
74
  if (useDelegatedName) {
73
75
  var originListener_1 = listener;
@@ -120,10 +122,10 @@ var EventTarget = function () {
120
122
  };
121
123
 
122
124
  EventTarget.prototype.removeEventListener = function (type, listener, options) {
123
- var capture = (0, _util.isBoolean)(options) && options || (0, _util.isObject)(options) && options.capture;
124
- var context = (0, _util.isFunction)(listener) ? undefined : listener;
125
- type = capture ? type + "capture" : type;
126
- listener = (0, _util.isFunction)(listener) ? listener : listener === null || listener === void 0 ? void 0 : listener.handleEvent;
125
+ var capture = (0, _lodashEs.isBoolean)(options) && options || (0, _lodashEs.isObject)(options) && options.capture;
126
+ var context = (0, _lodashEs.isFunction)(listener) ? undefined : listener;
127
+ type = capture ? "".concat(type, "capture") : type;
128
+ listener = (0, _lodashEs.isFunction)(listener) ? listener : listener === null || listener === void 0 ? void 0 : listener.handleEvent;
127
129
  this.emitter.off(type, listener, context);
128
130
  return this;
129
131
  };
@@ -11,7 +11,9 @@ var _Point = require("../shapes/Point");
11
11
  * An DOM-compatible synthetic event implementation that is "forwarded" on behalf of an original
12
12
  * FederatedEvent or native {@link https://dom.spec.whatwg.org/#event Event}.
13
13
  */
14
- var FederatedEvent = function () {
14
+ var FederatedEvent =
15
+ /** @class */
16
+ function () {
15
17
  /**
16
18
  * The event boundary which manages this event. Propagation can only occur
17
19
  * within the boundary's jurisdiction.
@@ -11,7 +11,9 @@ var _FederatedEvent = require("./FederatedEvent");
11
11
 
12
12
  var _Point = require("../shapes/Point");
13
13
 
14
- var FederatedMouseEvent = function (_super) {
14
+ var FederatedMouseEvent =
15
+ /** @class */
16
+ function (_super) {
15
17
  (0, _tslib.__extends)(FederatedMouseEvent, _super);
16
18
 
17
19
  function FederatedMouseEvent() {
@@ -9,7 +9,9 @@ var _tslib = require("tslib");
9
9
 
10
10
  var _FederatedMouseEvent = require("./FederatedMouseEvent");
11
11
 
12
- var FederatedPointerEvent = function (_super) {
12
+ var FederatedPointerEvent =
13
+ /** @class */
14
+ function (_super) {
13
15
  (0, _tslib.__extends)(FederatedPointerEvent, _super);
14
16
 
15
17
  function FederatedPointerEvent() {
@@ -0,0 +1,13 @@
1
+ import { FederatedEvent } from './FederatedEvent';
2
+ /**
3
+ * @see https://w3c.github.io/touch-events/#touchevent-interface
4
+ */
5
+ export declare class FederatedTouchEvent extends FederatedEvent<MouseEvent | PointerEvent | TouchEvent> implements TouchEvent {
6
+ altKey: boolean;
7
+ ctrlKey: boolean;
8
+ metaKey: boolean;
9
+ shiftKey: boolean;
10
+ changedTouches: TouchList;
11
+ targetTouches: TouchList;
12
+ touches: TouchList;
13
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.FederatedTouchEvent = void 0;
7
+
8
+ var _tslib = require("tslib");
9
+
10
+ var _FederatedEvent = require("./FederatedEvent");
11
+
12
+ /**
13
+ * @see https://w3c.github.io/touch-events/#touchevent-interface
14
+ */
15
+ var FederatedTouchEvent =
16
+ /** @class */
17
+ function (_super) {
18
+ (0, _tslib.__extends)(FederatedTouchEvent, _super);
19
+
20
+ function FederatedTouchEvent() {
21
+ return _super !== null && _super.apply(this, arguments) || this;
22
+ }
23
+
24
+ return FederatedTouchEvent;
25
+ }(_FederatedEvent.FederatedEvent);
26
+
27
+ exports.FederatedTouchEvent = FederatedTouchEvent;
@@ -9,7 +9,9 @@ var _tslib = require("tslib");
9
9
 
10
10
  var _FederatedMouseEvent = require("./FederatedMouseEvent");
11
11
 
12
- var FederatedWheelEvent = function (_super) {
12
+ var FederatedWheelEvent =
13
+ /** @class */
14
+ function (_super) {
13
15
  (0, _tslib.__extends)(FederatedWheelEvent, _super);
14
16
 
15
17
  function FederatedWheelEvent() {
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.KeyframeEffect = void 0;
6
7
  exports.makeTiming = makeTiming;
7
8
  exports.normalizeTimingInput = normalizeTimingInput;
8
9
  exports.numericTimingToObject = numericTimingToObject;
9
- exports.KeyframeEffect = void 0;
10
10
 
11
11
  var _animation = require("../utils/animation");
12
12
 
@@ -92,7 +92,9 @@ function numericTimingToObject(timingInput) {
92
92
  */
93
93
 
94
94
 
95
- var KeyframeEffect = function () {
95
+ var KeyframeEffect =
96
+ /** @class */
97
+ function () {
96
98
  function KeyframeEffect(target, effectInput, timingInput) {
97
99
  var _this = this;
98
100
 
@@ -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(memberValue + " compositing is not supported");
105
+ throw new Error("".concat(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,7 +9,9 @@ var _tslib = require("tslib");
9
9
 
10
10
  var _FederatedEvent = require("./FederatedEvent");
11
11
 
12
- var MutationEvent = function (_super) {
12
+ var MutationEvent =
13
+ /** @class */
14
+ function (_super) {
13
15
  (0, _tslib.__extends)(MutationEvent, _super);
14
16
 
15
17
  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.MutationObserver = exports.Registration = void 0;
6
+ exports.Registration = exports.MutationObserver = void 0;
7
7
 
8
8
  var _interfaces = require("./interfaces");
9
9
 
@@ -14,7 +14,9 @@ var _MutationRecord = require("./MutationRecord");
14
14
  var uidCounter = 0;
15
15
  var registrationsTable = new WeakMap();
16
16
 
17
- var Registration = function () {
17
+ var Registration =
18
+ /** @class */
19
+ function () {
18
20
  function Registration(observer, target, options) {
19
21
  this.observer = observer;
20
22
  this.target = target;
@@ -204,7 +206,9 @@ exports.Registration = Registration;
204
206
  * @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
205
207
  * @see https://github.com/googlearchive/MutationObservers/blob/master/MutationObserver.js
206
208
  */
207
- var MutationObserver = function () {
209
+ var MutationObserver =
210
+ /** @class */
211
+ function () {
208
212
  function MutationObserver(callback) {
209
213
  this.callback = callback;
210
214
  this.nodes = [];
@@ -214,7 +218,10 @@ var MutationObserver = function () {
214
218
 
215
219
  MutationObserver.prototype.observe = function (target, options) {
216
220
  // 1.1
217
- if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {
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) {
218
225
  throw new SyntaxError();
219
226
  }
220
227