@antv/g 1.0.0-alpha.20 → 1.0.0-alpha.24

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 (293) hide show
  1. package/es/Canvas.d.ts +40 -18
  2. package/es/Canvas.js +121 -65
  3. package/es/DisplayObjectPool.d.ts +2 -1
  4. package/es/DisplayObjectPool.js +4 -0
  5. package/{lib → es/camera}/Camera.d.ts +6 -3
  6. package/es/{Camera.js → camera/Camera.js} +22 -16
  7. package/es/{Landmark.d.ts → camera/Landmark.d.ts} +2 -2
  8. package/es/{Landmark.js → camera/Landmark.js} +1 -1
  9. package/es/camera/index.d.ts +2 -0
  10. package/es/camera/index.js +2 -0
  11. package/es/components/Cullable.js +1 -1
  12. package/es/components/Geometry.d.ts +8 -1
  13. package/es/components/Renderable.d.ts +9 -8
  14. package/es/components/Renderable.js +2 -6
  15. package/es/components/Sortable.d.ts +6 -2
  16. package/es/display-objects/Circle.d.ts +2 -3
  17. package/es/display-objects/Circle.js +2 -5
  18. package/es/{CustomElement.d.ts → display-objects/CustomElement.d.ts} +1 -1
  19. package/es/{CustomElement.js → display-objects/CustomElement.js} +22 -12
  20. package/{lib → es/display-objects}/DisplayObject.d.ts +136 -141
  21. package/es/{DisplayObject.js → display-objects/DisplayObject.js} +408 -292
  22. package/es/display-objects/Ellipse.d.ts +2 -3
  23. package/es/display-objects/Ellipse.js +2 -5
  24. package/es/display-objects/Group.d.ts +2 -1
  25. package/es/display-objects/Group.js +13 -5
  26. package/es/display-objects/HTML.d.ts +2 -2
  27. package/es/display-objects/HTML.js +4 -7
  28. package/es/display-objects/Image.d.ts +2 -2
  29. package/es/display-objects/Image.js +2 -6
  30. package/es/display-objects/Line.d.ts +2 -2
  31. package/es/display-objects/Line.js +8 -8
  32. package/es/display-objects/Path.d.ts +3 -2
  33. package/es/display-objects/Path.js +8 -8
  34. package/es/display-objects/Polygon.d.ts +2 -2
  35. package/es/display-objects/Polygon.js +2 -6
  36. package/es/display-objects/Polyline.d.ts +2 -2
  37. package/es/display-objects/Polyline.js +8 -8
  38. package/es/display-objects/Rect.d.ts +2 -2
  39. package/es/display-objects/Rect.js +2 -6
  40. package/es/display-objects/Text.d.ts +2 -3
  41. package/es/display-objects/Text.js +8 -7
  42. package/es/display-objects/index.d.ts +2 -0
  43. package/es/display-objects/index.js +2 -0
  44. package/es/{Animation.d.ts → dom/Animation.d.ts} +3 -3
  45. package/es/{Animation.js → dom/Animation.js} +2 -3
  46. package/{lib → es/dom}/AnimationEffectTiming.d.ts +2 -0
  47. package/es/{AnimationEffectTiming.js → dom/AnimationEffectTiming.js} +3 -2
  48. package/es/{AnimationEvent.d.ts → dom/AnimationEvent.d.ts} +3 -2
  49. package/es/{AnimationEvent.js → dom/AnimationEvent.js} +1 -1
  50. package/es/{Timeline.d.ts → dom/AnimationTimeline.d.ts} +1 -1
  51. package/es/{Timeline.js → dom/AnimationTimeline.js} +1 -1
  52. package/es/dom/CustomElementRegistry.d.ts +15 -0
  53. package/es/dom/CustomElementRegistry.js +40 -0
  54. package/{lib → es/dom}/CustomEvent.d.ts +1 -1
  55. package/es/{CustomEvent.js → dom/CustomEvent.js} +1 -1
  56. package/es/dom/Document.d.ts +36 -17
  57. package/es/dom/Document.js +98 -14
  58. package/es/dom/Element.d.ts +71 -92
  59. package/es/dom/Element.js +179 -195
  60. package/es/dom/EventTarget.d.ts +11 -6
  61. package/es/dom/EventTarget.js +12 -4
  62. package/es/dom/FederatedEvent.d.ts +15 -7
  63. package/es/dom/FederatedEvent.js +33 -0
  64. package/es/dom/FederatedMouseEvent.d.ts +1 -1
  65. package/es/{KeyframeEffect.d.ts → dom/KeyframeEffect.d.ts} +16 -5
  66. package/es/{KeyframeEffect.js → dom/KeyframeEffect.js} +50 -4
  67. package/es/{KeyframeList.d.ts → dom/KeyframeList.d.ts} +1 -1
  68. package/es/{KeyframeList.js → dom/KeyframeList.js} +0 -0
  69. package/es/dom/Node.d.ts +38 -23
  70. package/es/dom/Node.js +37 -33
  71. package/es/dom/index.d.ts +15 -2
  72. package/es/dom/index.js +16 -3
  73. package/es/dom/interfaces.d.ts +301 -0
  74. package/es/dom/interfaces.js +1 -0
  75. package/es/global-module.d.ts +0 -2
  76. package/es/global-module.js +31 -29
  77. package/es/index.d.ts +7 -14
  78. package/es/index.js +8 -15
  79. package/es/plugins/CullingPlugin.d.ts +2 -2
  80. package/es/plugins/CullingPlugin.js +13 -16
  81. package/es/plugins/DirtyCheckPlugin.d.ts +1 -1
  82. package/es/plugins/DirtyCheckPlugin.js +8 -7
  83. package/es/plugins/EventPlugin.js +52 -31
  84. package/es/plugins/FrustumCullingStrategy.d.ts +1 -1
  85. package/es/plugins/FrustumCullingStrategy.js +5 -4
  86. package/es/plugins/PrepareRendererPlugin.d.ts +0 -1
  87. package/es/plugins/PrepareRendererPlugin.js +42 -38
  88. package/es/property-handlers/aabb.d.ts +2 -3
  89. package/es/property-handlers/aabb.js +29 -21
  90. package/es/property-handlers/anchor.d.ts +3 -0
  91. package/es/property-handlers/anchor.js +21 -0
  92. package/es/property-handlers/clipPath.d.ts +1 -1
  93. package/es/property-handlers/clipPath.js +3 -4
  94. package/es/property-handlers/color.d.ts +1 -1
  95. package/es/property-handlers/dimension.d.ts +1 -1
  96. package/es/property-handlers/dimension.js +6 -9
  97. package/es/property-handlers/filter.d.ts +1 -1
  98. package/es/property-handlers/index.d.ts +5 -4
  99. package/es/property-handlers/index.js +1 -0
  100. package/es/property-handlers/localPosition.d.ts +1 -1
  101. package/es/property-handlers/localPosition.js +1 -6
  102. package/es/property-handlers/offsetDistance.d.ts +1 -1
  103. package/es/property-handlers/offsetPath.d.ts +1 -1
  104. package/es/property-handlers/origin.d.ts +1 -1
  105. package/es/property-handlers/origin.js +9 -2
  106. package/es/property-handlers/path.d.ts +2 -2
  107. package/es/property-handlers/path.js +8 -4
  108. package/es/property-handlers/points.d.ts +1 -1
  109. package/es/property-handlers/transform.d.ts +1 -1
  110. package/es/property-handlers/zIndex.d.ts +1 -1
  111. package/es/services/ContextService.d.ts +3 -2
  112. package/es/services/EventService.d.ts +18 -13
  113. package/es/services/EventService.js +604 -384
  114. package/es/services/RenderingContext.d.ts +1 -1
  115. package/es/services/RenderingService.d.ts +23 -29
  116. package/es/services/RenderingService.js +63 -54
  117. package/es/services/SceneGraphSelector.d.ts +7 -7
  118. package/es/services/SceneGraphSelector.js +10 -6
  119. package/es/services/SceneGraphService.d.ts +73 -78
  120. package/es/services/SceneGraphService.js +165 -78
  121. package/es/services/aabb/PathUpdater.d.ts +1 -1
  122. package/es/services/aabb/RectUpdater.d.ts +2 -2
  123. package/es/services/aabb/interfaces.d.ts +1 -1
  124. package/es/shapes/Point.d.ts +4 -0
  125. package/es/shapes/Polygon.d.ts +9 -0
  126. package/es/shapes/Polygon.js +62 -0
  127. package/es/shapes/index.d.ts +1 -0
  128. package/es/shapes/index.js +2 -1
  129. package/es/types.d.ts +18 -6
  130. package/es/utils/animation.d.ts +1 -2
  131. package/es/utils/animation.js +5 -10
  132. package/es/utils/canvas.d.ts +1 -1
  133. package/es/utils/custom-easing.d.ts +3 -2
  134. package/es/utils/custom-easing.js +12 -6
  135. package/es/utils/event.js +1 -1
  136. package/es/utils/index.d.ts +1 -0
  137. package/es/utils/index.js +2 -1
  138. package/es/utils/interpolation.d.ts +3 -4
  139. package/es/utils/interpolation.js +0 -16
  140. package/es/utils/path.d.ts +2 -2
  141. package/lib/Canvas.d.ts +40 -18
  142. package/lib/Canvas.js +131 -74
  143. package/lib/DisplayObjectPool.d.ts +2 -1
  144. package/lib/DisplayObjectPool.js +4 -0
  145. package/{es → lib/camera}/Camera.d.ts +6 -3
  146. package/lib/{Camera.js → camera/Camera.js} +25 -20
  147. package/lib/{Landmark.d.ts → camera/Landmark.d.ts} +2 -2
  148. package/lib/{Landmark.js → camera/Landmark.js} +2 -3
  149. package/lib/camera/index.d.ts +2 -0
  150. package/lib/camera/index.js +31 -0
  151. package/lib/components/Cullable.js +1 -1
  152. package/lib/components/Geometry.d.ts +8 -1
  153. package/lib/components/Renderable.d.ts +9 -8
  154. package/lib/components/Renderable.js +2 -6
  155. package/lib/components/Sortable.d.ts +6 -2
  156. package/lib/display-objects/Circle.d.ts +2 -3
  157. package/lib/display-objects/Circle.js +3 -6
  158. package/lib/{CustomElement.d.ts → display-objects/CustomElement.d.ts} +1 -1
  159. package/lib/{CustomElement.js → display-objects/CustomElement.js} +22 -12
  160. package/{es → lib/display-objects}/DisplayObject.d.ts +136 -141
  161. package/lib/{DisplayObject.js → display-objects/DisplayObject.js} +418 -299
  162. package/lib/display-objects/Ellipse.d.ts +2 -3
  163. package/lib/display-objects/Ellipse.js +3 -6
  164. package/lib/display-objects/Group.d.ts +2 -1
  165. package/lib/display-objects/Group.js +12 -4
  166. package/lib/display-objects/HTML.d.ts +2 -2
  167. package/lib/display-objects/HTML.js +4 -7
  168. package/lib/display-objects/Image.d.ts +2 -2
  169. package/lib/display-objects/Image.js +2 -6
  170. package/lib/display-objects/Line.d.ts +2 -2
  171. package/lib/display-objects/Line.js +8 -8
  172. package/lib/display-objects/Path.d.ts +3 -2
  173. package/lib/display-objects/Path.js +8 -8
  174. package/lib/display-objects/Polygon.d.ts +2 -2
  175. package/lib/display-objects/Polygon.js +2 -6
  176. package/lib/display-objects/Polyline.d.ts +2 -2
  177. package/lib/display-objects/Polyline.js +8 -8
  178. package/lib/display-objects/Rect.d.ts +2 -2
  179. package/lib/display-objects/Rect.js +2 -6
  180. package/lib/display-objects/Text.d.ts +2 -3
  181. package/lib/display-objects/Text.js +9 -8
  182. package/lib/display-objects/index.d.ts +2 -0
  183. package/lib/display-objects/index.js +26 -0
  184. package/lib/{Animation.d.ts → dom/Animation.d.ts} +3 -3
  185. package/lib/{Animation.js → dom/Animation.js} +2 -3
  186. package/{es → lib/dom}/AnimationEffectTiming.d.ts +2 -0
  187. package/lib/{AnimationEffectTiming.js → dom/AnimationEffectTiming.js} +3 -3
  188. package/lib/{AnimationEvent.d.ts → dom/AnimationEvent.d.ts} +3 -2
  189. package/lib/{AnimationEvent.js → dom/AnimationEvent.js} +1 -1
  190. package/lib/{Timeline.d.ts → dom/AnimationTimeline.d.ts} +1 -1
  191. package/lib/{Timeline.js → dom/AnimationTimeline.js} +1 -1
  192. package/lib/dom/CustomElementRegistry.d.ts +15 -0
  193. package/lib/dom/CustomElementRegistry.js +48 -0
  194. package/{es → lib/dom}/CustomEvent.d.ts +1 -1
  195. package/lib/{CustomEvent.js → dom/CustomEvent.js} +1 -1
  196. package/lib/dom/Document.d.ts +36 -17
  197. package/lib/dom/Document.js +99 -15
  198. package/lib/dom/Element.d.ts +71 -92
  199. package/lib/dom/Element.js +180 -198
  200. package/lib/dom/EventTarget.d.ts +11 -6
  201. package/lib/dom/EventTarget.js +20 -10
  202. package/lib/dom/FederatedEvent.d.ts +15 -7
  203. package/lib/dom/FederatedEvent.js +33 -0
  204. package/lib/dom/FederatedMouseEvent.d.ts +1 -1
  205. package/lib/{KeyframeEffect.d.ts → dom/KeyframeEffect.d.ts} +16 -5
  206. package/lib/{KeyframeEffect.js → dom/KeyframeEffect.js} +50 -4
  207. package/lib/{KeyframeList.d.ts → dom/KeyframeList.d.ts} +1 -1
  208. package/lib/{KeyframeList.js → dom/KeyframeList.js} +0 -0
  209. package/lib/dom/Node.d.ts +38 -23
  210. package/lib/dom/Node.js +37 -33
  211. package/lib/dom/index.d.ts +15 -2
  212. package/lib/dom/index.js +177 -8
  213. package/lib/dom/interfaces.d.ts +301 -0
  214. package/lib/dom/interfaces.js +5 -0
  215. package/lib/global-module.d.ts +0 -2
  216. package/lib/global-module.js +30 -30
  217. package/lib/index.d.ts +7 -14
  218. package/lib/index.js +44 -135
  219. package/lib/plugins/CullingPlugin.d.ts +2 -2
  220. package/lib/plugins/CullingPlugin.js +14 -16
  221. package/lib/plugins/DirtyCheckPlugin.d.ts +1 -1
  222. package/lib/plugins/DirtyCheckPlugin.js +9 -7
  223. package/lib/plugins/EventPlugin.js +52 -30
  224. package/lib/plugins/FrustumCullingStrategy.d.ts +1 -1
  225. package/lib/plugins/FrustumCullingStrategy.js +5 -4
  226. package/lib/plugins/PrepareRendererPlugin.d.ts +0 -1
  227. package/lib/plugins/PrepareRendererPlugin.js +41 -37
  228. package/lib/property-handlers/aabb.d.ts +2 -3
  229. package/lib/property-handlers/aabb.js +28 -22
  230. package/lib/property-handlers/anchor.d.ts +3 -0
  231. package/lib/property-handlers/anchor.js +34 -0
  232. package/lib/property-handlers/clipPath.d.ts +1 -1
  233. package/lib/property-handlers/clipPath.js +3 -4
  234. package/lib/property-handlers/color.d.ts +1 -1
  235. package/lib/property-handlers/dimension.d.ts +1 -1
  236. package/lib/property-handlers/dimension.js +6 -9
  237. package/lib/property-handlers/filter.d.ts +1 -1
  238. package/lib/property-handlers/index.d.ts +5 -4
  239. package/lib/property-handlers/index.js +14 -0
  240. package/lib/property-handlers/localPosition.d.ts +1 -1
  241. package/lib/property-handlers/localPosition.js +1 -7
  242. package/lib/property-handlers/offsetDistance.d.ts +1 -1
  243. package/lib/property-handlers/offsetPath.d.ts +1 -1
  244. package/lib/property-handlers/origin.d.ts +1 -1
  245. package/lib/property-handlers/origin.js +10 -2
  246. package/lib/property-handlers/path.d.ts +2 -2
  247. package/lib/property-handlers/path.js +8 -4
  248. package/lib/property-handlers/points.d.ts +1 -1
  249. package/lib/property-handlers/transform.d.ts +1 -1
  250. package/lib/property-handlers/zIndex.d.ts +1 -1
  251. package/lib/services/ContextService.d.ts +3 -2
  252. package/lib/services/EventService.d.ts +18 -13
  253. package/lib/services/EventService.js +616 -385
  254. package/lib/services/RenderingContext.d.ts +1 -1
  255. package/lib/services/RenderingService.d.ts +23 -29
  256. package/lib/services/RenderingService.js +66 -56
  257. package/lib/services/SceneGraphSelector.d.ts +7 -7
  258. package/lib/services/SceneGraphSelector.js +10 -6
  259. package/lib/services/SceneGraphService.d.ts +73 -78
  260. package/lib/services/SceneGraphService.js +166 -79
  261. package/lib/services/aabb/PathUpdater.d.ts +1 -1
  262. package/lib/services/aabb/RectUpdater.d.ts +2 -2
  263. package/lib/services/aabb/interfaces.d.ts +1 -1
  264. package/lib/shapes/Point.d.ts +4 -0
  265. package/lib/shapes/Polygon.d.ts +9 -0
  266. package/lib/shapes/Polygon.js +69 -0
  267. package/lib/shapes/index.d.ts +1 -0
  268. package/lib/shapes/index.js +13 -0
  269. package/lib/types.d.ts +18 -6
  270. package/lib/utils/animation.d.ts +1 -2
  271. package/lib/utils/animation.js +8 -16
  272. package/lib/utils/canvas.d.ts +1 -1
  273. package/lib/utils/custom-easing.d.ts +3 -2
  274. package/lib/utils/custom-easing.js +16 -8
  275. package/lib/utils/event.js +1 -1
  276. package/lib/utils/index.d.ts +1 -0
  277. package/lib/utils/index.js +13 -0
  278. package/lib/utils/interpolation.d.ts +3 -4
  279. package/lib/utils/interpolation.js +0 -17
  280. package/lib/utils/path.d.ts +2 -2
  281. package/package.json +6 -6
  282. package/es/Batch.d.ts +0 -25
  283. package/es/Batch.js +0 -82
  284. package/es/shapes-type.d.ts +0 -175
  285. package/es/shapes-type.js +0 -18
  286. package/es/utils/matrix-decompose.d.ts +0 -3
  287. package/es/utils/matrix-decompose.js +0 -404
  288. package/lib/Batch.d.ts +0 -25
  289. package/lib/Batch.js +0 -91
  290. package/lib/shapes-type.d.ts +0 -175
  291. package/lib/shapes-type.js +0 -41
  292. package/lib/utils/matrix-decompose.d.ts +0 -3
  293. package/lib/utils/matrix-decompose.js +0 -414
@@ -1,6 +1,5 @@
1
- import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
2
- import { DisplayObject } from '../DisplayObject';
3
- import { DisplayObjectConfig } from '../DisplayObject';
1
+ import { DisplayObjectConfig, BaseStyleProps, ParsedBaseStyleProps } from '..';
2
+ import { DisplayObject } from './DisplayObject';
4
3
  export interface EllipseStyleProps extends BaseStyleProps {
5
4
  rx: number;
6
5
  ry: number;
@@ -1,6 +1,6 @@
1
1
  import { __assign, __extends, __rest } from "tslib";
2
- import { SHAPE } from '../types';
3
- import { DisplayObject } from '../DisplayObject';
2
+ import { SHAPE } from '..';
3
+ import { DisplayObject } from './DisplayObject';
4
4
 
5
5
  var Ellipse = function (_super) {
6
6
  __extends(Ellipse, _super);
@@ -14,9 +14,6 @@ var Ellipse = function (_super) {
14
14
  style: __assign({
15
15
  rx: 0,
16
16
  ry: 0,
17
- opacity: 1,
18
- fillOpacity: 1,
19
- strokeOpacity: 1,
20
17
  anchor: [0.5, 0.5]
21
18
  }, style)
22
19
  }, rest)) || this;
@@ -1,5 +1,6 @@
1
1
  import type { BaseStyleProps } from '../types';
2
- import { DisplayObject, DisplayObjectConfig } from '../DisplayObject';
2
+ import { DisplayObject } from './DisplayObject';
3
+ import { DisplayObjectConfig } from '../dom';
3
4
  export declare class Group extends DisplayObject {
4
5
  constructor(config?: DisplayObjectConfig<BaseStyleProps>);
5
6
  }
@@ -1,14 +1,22 @@
1
- import { __assign, __extends } from "tslib";
1
+ import { __assign, __extends, __rest } from "tslib";
2
2
  import { SHAPE } from '../types';
3
- import { DisplayObject } from '../DisplayObject';
3
+ import { DisplayObject } from './DisplayObject';
4
4
 
5
5
  var Group = function (_super) {
6
6
  __extends(Group, _super);
7
7
 
8
8
  function Group(config) {
9
- return _super.call(this, __assign({
10
- type: SHAPE.Group
11
- }, config)) || this;
9
+ var _this = this;
10
+
11
+ var _a = config || {},
12
+ style = _a.style,
13
+ rest = __rest(_a, ["style"]);
14
+
15
+ _this = _super.call(this, __assign({
16
+ type: SHAPE.Group,
17
+ style: __assign({}, style)
18
+ }, rest)) || this;
19
+ return _this;
12
20
  }
13
21
 
14
22
  return Group;
@@ -1,6 +1,6 @@
1
1
  import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
2
- import { DisplayObject } from '../DisplayObject';
3
- import { DisplayObjectConfig } from '../DisplayObject';
2
+ import { DisplayObject } from './DisplayObject';
3
+ import { DisplayObjectConfig } from '../dom';
4
4
  import { AABB } from '../shapes';
5
5
  export interface HTMLStyleProps extends BaseStyleProps {
6
6
  innerHTML: string | HTMLElement;
@@ -1,6 +1,6 @@
1
1
  import { __assign, __extends, __rest } from "tslib";
2
2
  import { SHAPE } from '../types';
3
- import { DisplayObject } from '../DisplayObject';
3
+ import { DisplayObject } from './DisplayObject';
4
4
  import { Cullable } from '../components';
5
5
  import { AABB } from '../shapes';
6
6
  import { mat4, vec3 } from 'gl-matrix';
@@ -21,15 +21,11 @@ var HTML = function (_super) {
21
21
  style: __assign({
22
22
  innerHTML: '',
23
23
  className: '',
24
- style: '',
25
- opacity: 1,
26
- fillOpacity: 1,
27
- strokeOpacity: 1,
28
- anchor: [0, 0]
24
+ style: ''
29
25
  }, style)
30
26
  }, rest)) || this;
31
27
 
32
- var cullable = _this.getEntity().getComponent(Cullable);
28
+ var cullable = _this.entity.getComponent(Cullable);
33
29
 
34
30
  cullable.enable = false;
35
31
  return _this;
@@ -62,6 +58,7 @@ var HTML = function (_super) {
62
58
  var _a, _b;
63
59
 
64
60
  var clientRect = this.getBoundingClientRect(); // calc context's offset
61
+ // @ts-ignore
65
62
 
66
63
  var canvasRect = (_b = (_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) === null || _b === void 0 ? void 0 : _b.getContextService().getBoundingClientRect();
67
64
 
@@ -1,6 +1,6 @@
1
1
  import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
2
- import { DisplayObject } from '../DisplayObject';
3
- import { DisplayObjectConfig } from '../DisplayObject';
2
+ import { DisplayObject } from './DisplayObject';
3
+ import { DisplayObjectConfig } from '../dom';
4
4
  export interface ImageStyleProps extends BaseStyleProps {
5
5
  img: string | HTMLImageElement;
6
6
  width?: number;
@@ -1,6 +1,6 @@
1
1
  import { __assign, __extends, __rest } from "tslib";
2
2
  import { SHAPE } from '../types';
3
- import { DisplayObject } from '../DisplayObject';
3
+ import { DisplayObject } from './DisplayObject';
4
4
 
5
5
  var Image = function (_super) {
6
6
  __extends(Image, _super);
@@ -12,11 +12,7 @@ var Image = function (_super) {
12
12
  return _super.call(this, __assign({
13
13
  type: SHAPE.Image,
14
14
  style: __assign({
15
- img: '',
16
- opacity: 1,
17
- fillOpacity: 1,
18
- strokeOpacity: 1,
19
- anchor: [0, 0]
15
+ img: ''
20
16
  }, style)
21
17
  }, rest)) || this;
22
18
  }
@@ -1,6 +1,6 @@
1
1
  import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
2
- import { DisplayObject } from '../DisplayObject';
3
- import type { DisplayObjectConfig } from '../DisplayObject';
2
+ import { DisplayObject } from './DisplayObject';
3
+ import type { DisplayObjectConfig } from '../dom';
4
4
  import { Point } from '../shapes';
5
5
  export interface LineStyleProps extends BaseStyleProps {
6
6
  x1: number;
@@ -1,7 +1,7 @@
1
1
  import { __assign, __extends, __rest } from "tslib";
2
2
  import { Line as LineUtil } from '@antv/g-math';
3
3
  import { SHAPE } from '../types';
4
- import { DisplayObject } from '../DisplayObject';
4
+ import { DisplayObject } from './DisplayObject';
5
5
  import { Point } from '../shapes';
6
6
 
7
7
  var Line = function (_super) {
@@ -18,13 +18,13 @@ var Line = function (_super) {
18
18
  y1: 0,
19
19
  x2: 0,
20
20
  y2: 0,
21
- opacity: 1,
22
- fillOpacity: 1,
23
- strokeOpacity: 1,
24
- lineJoin: 'miter',
25
- lineCap: 'butt',
26
- lineWidth: 1,
27
- anchor: [0, 0]
21
+ lineJoin: "miter"
22
+ /* Miter */
23
+ ,
24
+ lineCap: "butt"
25
+ /* Butt */
26
+ ,
27
+ lineWidth: 1
28
28
  }, style)
29
29
  }, rest)) || this;
30
30
  }
@@ -1,6 +1,6 @@
1
1
  import type { BaseStyleProps, PathCommand } from '../types';
2
- import { DisplayObject } from '../DisplayObject';
3
- import { DisplayObjectConfig } from '../DisplayObject';
2
+ import { DisplayObject } from './DisplayObject';
3
+ import { DisplayObjectConfig } from '../dom';
4
4
  import { Point } from '../shapes';
5
5
  import type { Rect } from '../shapes/Rect';
6
6
  export interface PathStyleProps extends BaseStyleProps {
@@ -24,6 +24,7 @@ export interface ParsedPathStyleProps {
24
24
  curve: PathCommand[];
25
25
  totalLength: number;
26
26
  curveSegments: number[][];
27
+ zCommandIndexes: number[];
27
28
  rect: Rect;
28
29
  }
29
30
  export declare class Path extends DisplayObject<PathStyleProps, {
@@ -1,6 +1,6 @@
1
1
  import { __assign, __extends, __rest } from "tslib";
2
2
  import { SHAPE } from '../types';
3
- import { DisplayObject } from '../DisplayObject';
3
+ import { DisplayObject } from './DisplayObject';
4
4
  import { Point } from '../shapes';
5
5
  import { Cubic as CubicUtil } from '@antv/g-math';
6
6
  import { isNil } from '@antv/util';
@@ -16,13 +16,13 @@ var Path = function (_super) {
16
16
  type: SHAPE.Path,
17
17
  style: __assign({
18
18
  path: '',
19
- opacity: 1,
20
- fillOpacity: 1,
21
- strokeOpacity: 1,
22
- lineJoin: 'miter',
23
- lineCap: 'butt',
24
- lineWidth: 1,
25
- anchor: [0, 0]
19
+ lineJoin: "miter"
20
+ /* Miter */
21
+ ,
22
+ lineCap: "butt"
23
+ /* Butt */
24
+ ,
25
+ lineWidth: 1
26
26
  }, style)
27
27
  }, rest)) || this;
28
28
  }
@@ -1,6 +1,6 @@
1
1
  import type { BaseStyleProps } from '../types';
2
- import { DisplayObject } from '../DisplayObject';
3
- import { DisplayObjectConfig } from '../DisplayObject';
2
+ import { DisplayObject } from './DisplayObject';
3
+ import { DisplayObjectConfig } from '../dom';
4
4
  import type { ParsedPolylineStyleProps } from './Polyline';
5
5
  export interface PolygonStyleProps extends BaseStyleProps {
6
6
  points: [number, number][];
@@ -1,6 +1,6 @@
1
1
  import { __assign, __extends, __rest } from "tslib";
2
2
  import { SHAPE } from '../types';
3
- import { DisplayObject } from '../DisplayObject';
3
+ import { DisplayObject } from './DisplayObject';
4
4
 
5
5
  var Polygon = function (_super) {
6
6
  __extends(Polygon, _super);
@@ -12,11 +12,7 @@ var Polygon = function (_super) {
12
12
  return _super.call(this, __assign({
13
13
  type: SHAPE.Polygon,
14
14
  style: __assign({
15
- points: [],
16
- opacity: 1,
17
- fillOpacity: 1,
18
- strokeOpacity: 1,
19
- anchor: [0, 0]
15
+ points: []
20
16
  }, style)
21
17
  }, rest)) || this;
22
18
  }
@@ -1,6 +1,6 @@
1
1
  import type { BaseStyleProps } from '../types';
2
- import { DisplayObject } from '../DisplayObject';
3
- import { DisplayObjectConfig } from '../DisplayObject';
2
+ import { DisplayObject } from './DisplayObject';
3
+ import { DisplayObjectConfig } from '../dom';
4
4
  import { Point } from '../shapes';
5
5
  export interface PolylineStyleProps extends BaseStyleProps {
6
6
  points: [number, number][];
@@ -1,6 +1,6 @@
1
1
  import { __assign, __extends, __rest } from "tslib";
2
2
  import { SHAPE } from '../types';
3
- import { DisplayObject } from '../DisplayObject';
3
+ import { DisplayObject } from './DisplayObject';
4
4
  import { Line as LineUtil } from '@antv/g-math';
5
5
  import { Point } from '../shapes';
6
6
 
@@ -15,13 +15,13 @@ var Polyline = function (_super) {
15
15
  type: SHAPE.Polyline,
16
16
  style: __assign({
17
17
  points: [],
18
- opacity: 1,
19
- fillOpacity: 1,
20
- strokeOpacity: 1,
21
- lineJoin: 'miter',
22
- lineCap: 'butt',
23
- lineWidth: 1,
24
- anchor: [0, 0]
18
+ lineJoin: "miter"
19
+ /* Miter */
20
+ ,
21
+ lineCap: "butt"
22
+ /* Butt */
23
+ ,
24
+ lineWidth: 1
25
25
  }, style)
26
26
  }, rest)) || this;
27
27
  }
@@ -1,6 +1,6 @@
1
1
  import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
2
- import { DisplayObject } from '../DisplayObject';
3
- import type { DisplayObjectConfig } from '../DisplayObject';
2
+ import { DisplayObject } from './DisplayObject';
3
+ import type { DisplayObjectConfig } from '../dom';
4
4
  export interface RectStyleProps extends BaseStyleProps {
5
5
  width: number;
6
6
  height: number;
@@ -1,6 +1,6 @@
1
1
  import { __assign, __extends, __rest } from "tslib";
2
2
  import { SHAPE } from '../types';
3
- import { DisplayObject } from '../DisplayObject';
3
+ import { DisplayObject } from './DisplayObject';
4
4
 
5
5
  var Rect = function (_super) {
6
6
  __extends(Rect, _super);
@@ -13,11 +13,7 @@ var Rect = function (_super) {
13
13
  type: SHAPE.Rect,
14
14
  style: __assign({
15
15
  width: 0,
16
- height: 0,
17
- opacity: 1,
18
- fillOpacity: 1,
19
- strokeOpacity: 1,
20
- anchor: [0, 0]
16
+ height: 0
21
17
  }, style)
22
18
  }, rest)) || this;
23
19
  }
@@ -1,6 +1,5 @@
1
- import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
2
- import { DisplayObject } from '../DisplayObject';
3
- import { DisplayObjectConfig } from '../DisplayObject';
1
+ import { BaseStyleProps, ParsedBaseStyleProps, DisplayObjectConfig } from '..';
2
+ import { DisplayObject } from './DisplayObject';
4
3
  import { TextMetrics } from '../services';
5
4
  export interface TextStyleProps extends BaseStyleProps {
6
5
  text: string;
@@ -1,6 +1,6 @@
1
1
  import { __assign, __extends, __rest } from "tslib";
2
- import { SHAPE } from '../types';
3
- import { DisplayObject } from '../DisplayObject';
2
+ import { SHAPE } from '..';
3
+ import { DisplayObject } from './DisplayObject';
4
4
 
5
5
  var Text = function (_super) {
6
6
  __extends(Text, _super);
@@ -12,9 +12,6 @@ var Text = function (_super) {
12
12
  return _super.call(this, __assign({
13
13
  type: SHAPE.Text,
14
14
  style: __assign({
15
- opacity: 1,
16
- fillOpacity: 1,
17
- strokeOpacity: 1,
18
15
  text: '',
19
16
  fontSize: 12,
20
17
  fontFamily: 'sans-serif',
@@ -32,8 +29,12 @@ var Text = function (_super) {
32
29
  fill: '#000',
33
30
  letterSpacing: 0,
34
31
  lineHeight: 0,
35
- lineJoin: 'miter',
36
- lineCap: 'butt',
32
+ lineJoin: "miter"
33
+ /* Miter */
34
+ ,
35
+ lineCap: "butt"
36
+ /* Butt */
37
+ ,
37
38
  lineWidth: 0,
38
39
  miterLimit: 10,
39
40
  padding: 0,
@@ -1,3 +1,5 @@
1
+ export * from './DisplayObject';
2
+ export * from './CustomElement';
1
3
  export * from './Circle';
2
4
  export * from './Ellipse';
3
5
  export * from './Group';
@@ -1,3 +1,5 @@
1
+ export * from './DisplayObject';
2
+ export * from './CustomElement';
1
3
  export * from './Circle';
2
4
  export * from './Ellipse';
3
5
  export * from './Group';
@@ -1,9 +1,9 @@
1
- import { KeyframeEffect } from './KeyframeEffect';
2
- import { AnimationTimeline } from './Timeline';
1
+ import type { KeyframeEffect } from './KeyframeEffect';
2
+ import type { AnimationTimeline } from './AnimationTimeline';
3
3
  /**
4
4
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/Animation
5
5
  */
6
- export declare class Animation implements Animation {
6
+ export declare class Animation {
7
7
  /**
8
8
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/effect
9
9
  */
@@ -19,6 +19,7 @@ var Animation = function () {
19
19
  this._playbackRate = 1;
20
20
  this._inTimeline = true;
21
21
  this.effect = effect;
22
+ effect.animation = this;
22
23
  this.timeline = timeline;
23
24
  this.id = "" + sequenceNumber++;
24
25
  this._inEffect = !!this.effect.update(0);
@@ -367,7 +368,7 @@ var Animation = function () {
367
368
  var _a;
368
369
 
369
370
  var target = (_a = this.effect) === null || _a === void 0 ? void 0 : _a.target;
370
- return target.activeAnimations;
371
+ return target.getAnimations();
371
372
  };
372
373
 
373
374
  Animation.prototype.markTarget = function () {
@@ -471,7 +472,6 @@ var Animation = function () {
471
472
  if (this._isFinished) {
472
473
  if (!this._finishedFlag) {
473
474
  if (this.onfinish) {
474
- // @ts-ignore
475
475
  var event_1 = new AnimationEvent(null, this, this.currentTime, baseTime);
476
476
  setTimeout(function () {
477
477
  _this.onfinish && _this.onfinish(event_1);
@@ -482,7 +482,6 @@ var Animation = function () {
482
482
  }
483
483
  } else {
484
484
  if (this.onframe && this.playState === 'running') {
485
- // @ts-ignore
486
485
  var event_2 = new AnimationEvent(null, this, this.currentTime, baseTime);
487
486
  this.onframe(event_2);
488
487
  }
@@ -53,5 +53,7 @@ export declare class AnimationEffectTiming implements EffectTiming {
53
53
  */
54
54
  activeDuration: number;
55
55
  endTime: number;
56
+ currentIteration: number | null;
57
+ progress: number | null;
56
58
  constructor();
57
59
  }
@@ -1,5 +1,4 @@
1
- /* eslint-disable no-underscore-dangle */
2
- import { linear, parseEasingFunction } from './utils/animation';
1
+ import { linear, parseEasingFunction } from '../utils/animation';
3
2
  /**
4
3
  * @see https://developer.mozilla.org/en-US/docs/Web/API/EffectTiming
5
4
  */
@@ -46,6 +45,8 @@ var AnimationEffectTiming = function () {
46
45
  */
47
46
 
48
47
  this.iterations = 1;
48
+ this.currentIteration = null;
49
+ this.progress = null;
49
50
  }
50
51
 
51
52
  Object.defineProperty(AnimationEffectTiming.prototype, "easing", {
@@ -1,5 +1,6 @@
1
- import { FederatedEvent } from './dom/FederatedEvent';
2
- import type { EventService } from './services';
1
+ import { FederatedEvent } from './FederatedEvent';
2
+ import type { EventService } from '../services';
3
+ import type { Animation } from './Animation';
3
4
  /**
4
5
  * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationPlaybackEvent
5
6
  */
@@ -1,5 +1,5 @@
1
1
  import { __extends } from "tslib";
2
- import { FederatedEvent } from './dom/FederatedEvent';
2
+ import { FederatedEvent } from './FederatedEvent';
3
3
  /**
4
4
  * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationPlaybackEvent
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import { Animation } from './Animation';
2
- import { KeyframeEffect } from './KeyframeEffect';
2
+ import type { KeyframeEffect } from './KeyframeEffect';
3
3
  export declare function compareAnimations(leftAnimation: Animation, rightAnimation: Animation): number;
4
4
  /**
5
5
  * @see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/web-animations-js/index.d.ts
@@ -1,7 +1,7 @@
1
1
  import { __decorate, __read, __spreadArray } from "tslib";
2
2
  import { injectable } from 'inversify';
3
3
  import { Animation } from './Animation';
4
- import { requestAnimationFrame, cancelAnimationFrame } from './utils/raf';
4
+ import { requestAnimationFrame, cancelAnimationFrame } from '../utils/raf';
5
5
  export function compareAnimations(leftAnimation, rightAnimation) {
6
6
  return Number(leftAnimation.id) - Number(rightAnimation.id);
7
7
  }
@@ -0,0 +1,15 @@
1
+ import { DisplayObject } from '..';
2
+ /**
3
+ * canvas.customElements
4
+ *
5
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry
6
+ */
7
+ export declare class CustomElementRegistry {
8
+ private registry;
9
+ constructor();
10
+ define<T extends DisplayObject>(name: string, constructor: new (...args: any[]) => T): void;
11
+ /**
12
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/get
13
+ */
14
+ get<T extends DisplayObject>(name: string): new (...args: any[]) => T;
15
+ }
@@ -0,0 +1,40 @@
1
+ import { SHAPE } from '..';
2
+ import { Ellipse, Circle, Rect, Image, Line, Path, Group, Polygon, Polyline, Text, HTML } from '../display-objects';
3
+ /**
4
+ * canvas.customElements
5
+ *
6
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry
7
+ */
8
+
9
+ var CustomElementRegistry = function () {
10
+ function CustomElementRegistry() {
11
+ this.registry = {};
12
+ this.define(SHAPE.Circle, Circle);
13
+ this.define(SHAPE.Ellipse, Ellipse);
14
+ this.define(SHAPE.Rect, Rect);
15
+ this.define(SHAPE.Image, Image);
16
+ this.define(SHAPE.Line, Line);
17
+ this.define(SHAPE.Group, Group);
18
+ this.define(SHAPE.Path, Path);
19
+ this.define(SHAPE.Polygon, Polygon);
20
+ this.define(SHAPE.Polyline, Polyline);
21
+ this.define(SHAPE.Text, Text);
22
+ this.define(SHAPE.HTML, HTML);
23
+ }
24
+
25
+ CustomElementRegistry.prototype.define = function (name, constructor) {
26
+ this.registry[name] = constructor;
27
+ };
28
+ /**
29
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/get
30
+ */
31
+
32
+
33
+ CustomElementRegistry.prototype.get = function (name) {
34
+ return this.registry[name];
35
+ };
36
+
37
+ return CustomElementRegistry;
38
+ }();
39
+
40
+ export { CustomElementRegistry };
@@ -1,4 +1,4 @@
1
- import { FederatedEvent } from './dom/FederatedEvent';
1
+ import { FederatedEvent } from './FederatedEvent';
2
2
  /**
3
3
  * @see https://developer.mozilla.org/en-US/docs/Web/Events/Creating_and_triggering_events
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import { __extends } from "tslib";
2
- import { FederatedEvent } from './dom/FederatedEvent';
2
+ import { FederatedEvent } from './FederatedEvent';
3
3
  /**
4
4
  * @see https://developer.mozilla.org/en-US/docs/Web/Events/Creating_and_triggering_events
5
5
  *