@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
@@ -9,70 +9,74 @@ var _tslib = require("tslib");
9
9
 
10
10
  var _inversify = require("inversify");
11
11
 
12
- var _components = require("../components");
13
-
14
- var _Element = require("../dom/Element");
12
+ var _dom = require("../dom");
15
13
 
16
14
  var _services = require("../services");
17
15
 
18
- var _SceneGraphService = require("../services/SceneGraphService");
16
+ var _RenderingService = require("../services/RenderingService");
19
17
 
20
18
  var PrepareRendererPlugin = function () {
21
19
  function PrepareRendererPlugin() {}
22
20
 
23
- PrepareRendererPlugin_1 = PrepareRendererPlugin;
24
-
25
21
  PrepareRendererPlugin.prototype.apply = function (renderingService) {
26
22
  var _this = this;
27
23
 
28
- var handleAttributeChanged = function handleAttributeChanged(name, oldValue, value, object) {
29
- // need re-render
30
- _this.renderingContext.renderReasons.add(_services.RENDER_REASON.DisplayObjectChanged); // trigger hooks
24
+ var handleAttributeChanged = function handleAttributeChanged(e) {
25
+ _this.renderingContext.renderReasons.add(_services.RENDER_REASON.DisplayObjectChanged);
26
+ };
31
27
 
28
+ var dirtifyToRoot = function dirtifyToRoot(e) {
29
+ (0, _services.dirtifyRenderable)(e.target, true);
30
+ renderingService.dirtify();
31
+ };
32
32
 
33
- renderingService.hooks.attributeChanged.call(object, name, value);
33
+ var handleBoundsChanged = function handleBoundsChanged(e) {
34
+ // const path = e.composedPath().slice(0, -2);
35
+ // path.forEach((node: DisplayObject) => {
36
+ // const parent = node.parentElement as DisplayObject;
37
+ // if (parent && parent.style && parent.style.transformOrigin) {
38
+ // updateTransformOrigin(
39
+ // parent.style.transformOrigin,
40
+ // parent.style.transformOrigin,
41
+ // parent,
42
+ // true,
43
+ // );
44
+ // }
45
+ // });
46
+ renderingService.dirtify();
34
47
  };
35
48
 
36
- var handleAABBChanged = function handleAABBChanged() {
37
- // need re-render
38
- _this.renderingContext.renderReasons.add(_services.RENDER_REASON.DisplayObjectChanged);
49
+ var handleMounted = function handleMounted(e) {
50
+ dirtifyToRoot(e);
39
51
  };
40
52
 
41
- renderingService.hooks.init.tap(PrepareRendererPlugin_1.tag, function () {
42
- _this.sceneGraphService.on(_SceneGraphService.SCENE_GRAPH_EVENT.AABBChanged, handleAABBChanged);
43
- });
44
- renderingService.hooks.destroy.tap(PrepareRendererPlugin_1.tag, function () {
45
- _this.sceneGraphService.off(_SceneGraphService.SCENE_GRAPH_EVENT.AABBChanged, handleAABBChanged);
46
- });
47
- renderingService.hooks.mounted.tap(PrepareRendererPlugin_1.tag, function (object) {
48
- var entity = object.getEntity(); // delegate attribute-changed handler
53
+ var handleUnmounted = function handleUnmounted(e) {
54
+ dirtifyToRoot(e);
55
+ };
49
56
 
50
- object.on(_Element.DISPLAY_OBJECT_EVENT.AttributeChanged, handleAttributeChanged);
51
- var renderable = entity.getComponent(_components.Renderable);
52
- renderable.dirty = true; // need re-render
57
+ renderingService.emitter.on(_RenderingService.RenderingServiceEvent.Init, function () {
58
+ _this.renderingContext.root.addEventListener(_dom.ElementEvent.MOUNTED, handleMounted);
53
59
 
54
- _this.renderingContext.renderReasons.add(_services.RENDER_REASON.DisplayObjectChanged);
60
+ _this.renderingContext.root.addEventListener(_dom.ElementEvent.UNMOUNTED, handleUnmounted);
61
+
62
+ _this.renderingContext.root.addEventListener(_dom.ElementEvent.ATTRIBUTE_CHANGED, handleAttributeChanged);
63
+
64
+ _this.renderingContext.root.addEventListener(_dom.ElementEvent.BOUNDS_CHANGED, handleBoundsChanged);
55
65
  });
56
- renderingService.hooks.unmounted.tap(PrepareRendererPlugin_1.tag, function (object) {
57
- // console.log('unmounted', object);
58
- object.off(_Element.DISPLAY_OBJECT_EVENT.AttributeChanged, handleAttributeChanged);
59
- var entity = object.getEntity();
60
- var renderable = entity.getComponent(_components.Renderable);
66
+ renderingService.emitter.on(_RenderingService.RenderingServiceEvent.Destroy, function () {
67
+ _this.renderingContext.root.removeEventListener(_dom.ElementEvent.MOUNTED, handleMounted);
61
68
 
62
- if (renderable.aabb) {
63
- _this.renderingContext.removedAABBs.push(renderable.aabb);
64
- } // need re-render
69
+ _this.renderingContext.root.removeEventListener(_dom.ElementEvent.UNMOUNTED, handleUnmounted);
65
70
 
71
+ _this.renderingContext.root.removeEventListener(_dom.ElementEvent.ATTRIBUTE_CHANGED, handleAttributeChanged);
66
72
 
67
- _this.renderingContext.renderReasons.add(_services.RENDER_REASON.DisplayObjectChanged);
73
+ _this.renderingContext.root.removeEventListener(_dom.ElementEvent.BOUNDS_CHANGED, handleBoundsChanged);
68
74
  });
69
75
  };
70
76
 
71
- var PrepareRendererPlugin_1;
72
77
  PrepareRendererPlugin.tag = 'PrepareRendererPlugin';
73
- (0, _tslib.__decorate)([(0, _inversify.inject)(_SceneGraphService.SceneGraphService), (0, _tslib.__metadata)("design:type", Object)], PrepareRendererPlugin.prototype, "sceneGraphService", void 0);
74
78
  (0, _tslib.__decorate)([(0, _inversify.inject)(_services.RenderingContext), (0, _tslib.__metadata)("design:type", Object)], PrepareRendererPlugin.prototype, "renderingContext", void 0);
75
- PrepareRendererPlugin = PrepareRendererPlugin_1 = (0, _tslib.__decorate)([(0, _inversify.injectable)()], PrepareRendererPlugin);
79
+ PrepareRendererPlugin = (0, _tslib.__decorate)([(0, _inversify.injectable)()], PrepareRendererPlugin);
76
80
  return PrepareRendererPlugin;
77
81
  }();
78
82
 
@@ -1,3 +1,2 @@
1
- import type { DisplayObject } from '../DisplayObject';
2
- import { SceneGraphService } from '../services';
3
- export declare function updateGeometry(oldValue: number, newValue: number, object: DisplayObject, sceneGraphService: SceneGraphService): void;
1
+ import type { DisplayObject } from '../display-objects/DisplayObject';
2
+ export declare function updateGeometry(oldValue: number, newValue: number, object: DisplayObject): void;
@@ -19,16 +19,20 @@ var _types = require("../types");
19
19
 
20
20
  var _color = require("./color");
21
21
 
22
- function updateGeometry(oldValue, newValue, object, sceneGraphService) {
22
+ function updateGeometry(oldValue, newValue, object) {
23
23
  var geometryUpdaterFactory = _inversify.container.get(_services.GeometryUpdaterFactory);
24
24
 
25
25
  var geometryUpdater = geometryUpdaterFactory(object.nodeName);
26
26
 
27
27
  if (geometryUpdater) {
28
- var geometry_1 = object.getEntity().getComponent(_components.Geometry);
28
+ var geometry_1 = object.entity.getComponent(_components.Geometry);
29
29
 
30
- if (!geometry_1.aabb) {
31
- geometry_1.aabb = new _shapes.AABB();
30
+ if (!geometry_1.contentBounds) {
31
+ geometry_1.contentBounds = new _shapes.AABB();
32
+ }
33
+
34
+ if (!geometry_1.renderBounds) {
35
+ geometry_1.renderBounds = new _shapes.AABB();
32
36
  }
33
37
 
34
38
  var _a = geometryUpdater.update(object.parsedStyle, object),
@@ -71,29 +75,32 @@ function updateGeometry(oldValue, newValue, object, sceneGraphService) {
71
75
  var _h = object.parsedStyle,
72
76
  _j = _h.lineWidth,
73
77
  lineWidth = _j === void 0 ? 0 : _j,
74
- _k = _h.lineAppendWidth,
75
- lineAppendWidth = _k === void 0 ? 0 : _k,
78
+ _k = _h.padding,
79
+ padding = _k === void 0 ? [] : _k,
76
80
  _l = _h.anchor,
77
- anchor = _l === void 0 ? [0.5, 0.5] : _l,
81
+ anchor = _l === void 0 ? [0, 0] : _l,
78
82
  shadowColor = _h.shadowColor,
79
83
  _m = _h.filter,
80
- filter = _m === void 0 ? [] : _m;
81
-
82
- var center = _glMatrix.vec3.fromValues((1 - anchor[0] * 2) * halfExtents[0] + offsetX, (1 - anchor[1] * 2) * halfExtents[1] + offsetY, (1 - (anchor[2] || 0) * 2) * halfExtents[2] + offsetZ); // <Text> use textAlign & textBaseline instead of anchor
83
-
84
+ filter = _m === void 0 ? [] : _m; // <Text> use textAlign & textBaseline instead of anchor
84
85
 
85
86
  if (object.nodeName === _types.SHAPE.Text) {
86
87
  delete object.parsedStyle.anchor;
87
- } // append border
88
+ }
89
+
90
+ var center = _glMatrix.vec3.fromValues((1 - anchor[0] * 2) * halfExtents[0] + offsetX, (1 - anchor[1] * 2) * halfExtents[1] + offsetY, (1 - (anchor[2] || 0) * 2) * halfExtents[2] + offsetZ); // update geometry's AABB
88
91
 
89
92
 
90
- _glMatrix.vec3.add(halfExtents, halfExtents, _glMatrix.vec3.fromValues(lineWidth + lineAppendWidth, lineWidth + lineAppendWidth, 0)); // update geometry's AABB
93
+ geometry_1.contentBounds.update(center, halfExtents);
91
94
 
95
+ if (lineWidth) {
96
+ // append border
97
+ _glMatrix.vec3.add(halfExtents, halfExtents, _glMatrix.vec3.fromValues(lineWidth / 2, lineWidth / 2, 0));
98
+ }
92
99
 
93
- geometry_1.aabb.update(center, halfExtents); // account for shadow, only support constant value now
100
+ geometry_1.renderBounds.update(center, halfExtents); // account for shadow, only support constant value now
94
101
 
95
102
  if (shadowColor && shadowColor.type === _color.PARSED_COLOR_TYPE.Constant) {
96
- var _o = geometry_1.aabb,
103
+ var _o = geometry_1.renderBounds,
97
104
  min = _o.min,
98
105
  max = _o.max;
99
106
  var _p = object.parsedStyle,
@@ -111,7 +118,7 @@ function updateGeometry(oldValue, newValue, object, sceneGraphService) {
111
118
  max[0] = Math.max(max[0], shadowRight);
112
119
  min[1] = Math.min(min[1], shadowTop);
113
120
  max[1] = Math.max(max[1], shadowBottom);
114
- geometry_1.aabb.setMinMax(min, max);
121
+ geometry_1.renderBounds.setMinMax(min, max);
115
122
  } // account for filter, eg. blur(5px), drop-shadow()
116
123
 
117
124
 
@@ -121,12 +128,12 @@ function updateGeometry(oldValue, newValue, object, sceneGraphService) {
121
128
 
122
129
  if (name === 'blur') {
123
130
  var blurRadius = params[0].value;
124
- geometry_1.aabb.update(geometry_1.aabb.center, _glMatrix.vec3.add(geometry_1.aabb.halfExtents, geometry_1.aabb.halfExtents, _glMatrix.vec3.fromValues(blurRadius, blurRadius, 0)));
131
+ geometry_1.renderBounds.update(geometry_1.renderBounds.center, _glMatrix.vec3.add(geometry_1.renderBounds.halfExtents, geometry_1.renderBounds.halfExtents, _glMatrix.vec3.fromValues(blurRadius, blurRadius, 0)));
125
132
  } else if (name === 'drop-shadow') {
126
133
  var shadowOffsetX = params[0].value;
127
134
  var shadowOffsetY = params[1].value;
128
135
  var shadowBlur = params[2].value;
129
- var _b = geometry_1.aabb,
136
+ var _b = geometry_1.renderBounds,
130
137
  min = _b.min,
131
138
  max = _b.max;
132
139
  var shadowLeft = min[0] - shadowBlur + shadowOffsetX;
@@ -137,10 +144,9 @@ function updateGeometry(oldValue, newValue, object, sceneGraphService) {
137
144
  max[0] = Math.max(max[0], shadowRight);
138
145
  min[1] = Math.min(min[1], shadowTop);
139
146
  max[1] = Math.max(max[1], shadowBottom);
140
- geometry_1.aabb.setMinMax(min, max);
147
+ geometry_1.renderBounds.setMinMax(min, max);
141
148
  }
142
- }); // dirtify renderable's AABB
143
-
144
- sceneGraphService.dirtifyAABBToRoot(object);
149
+ });
150
+ (0, _services.dirtifyRenderable)(object);
145
151
  }
146
152
  }
@@ -0,0 +1,3 @@
1
+ import { vec2, vec3 } from 'gl-matrix';
2
+ import type { DisplayObject } from '../display-objects/DisplayObject';
3
+ export declare function updateAnchor(oldValue: vec2 | vec3, newValue: vec2 | vec3, object: DisplayObject): void;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.updateAnchor = updateAnchor;
7
+
8
+ var _tslib = require("tslib");
9
+
10
+ var _glMatrix = require("gl-matrix");
11
+
12
+ var _components = require("../components");
13
+
14
+ var _services = require("../services");
15
+
16
+ var _utils = require("../utils");
17
+
18
+ function updateAnchor(oldValue, newValue, object) {
19
+ var bounds = object.getGeometryBounds();
20
+
21
+ if (bounds) {
22
+ var geometry = object.entity.getComponent(_components.Geometry);
23
+
24
+ if (geometry && geometry.contentBounds) {
25
+ var offset = _glMatrix.vec3.multiply(_glMatrix.vec3.create(), _glMatrix.vec3.fromValues.apply(_glMatrix.vec3, (0, _tslib.__spreadArray)([], (0, _tslib.__read)(bounds.halfExtents.map(function (n) {
26
+ return n * 2;
27
+ })))), _glMatrix.vec3.subtract(_glMatrix.vec3.create(), (0, _utils.createVec3)(newValue || _glMatrix.vec3.create()), (0, _utils.createVec3)(oldValue || _glMatrix.vec3.create())));
28
+
29
+ geometry.contentBounds.update(_glMatrix.vec3.subtract(geometry.contentBounds.center, geometry.contentBounds.center, offset), geometry.contentBounds.halfExtents);
30
+ geometry.renderBounds.update(_glMatrix.vec3.subtract(geometry.renderBounds.center, geometry.renderBounds.center, offset), geometry.renderBounds.halfExtents);
31
+ (0, _services.dirtifyRenderable)(object);
32
+ }
33
+ }
34
+ }
@@ -1,4 +1,4 @@
1
- import type { DisplayObject } from '../DisplayObject';
1
+ import type { DisplayObject } from '../display-objects/DisplayObject';
2
2
  /**
3
3
  * @see /zh/docs/api/basic/display-object#clippath
4
4
  * @example
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.updateClipPath = updateClipPath;
7
7
 
8
- var _Renderable = require("../components/Renderable");
8
+ var _services = require("../services");
9
9
 
10
10
  /**
11
11
  * @see /zh/docs/api/basic/display-object#clippath
@@ -37,8 +37,7 @@ function updateClipPath(oldClipPath, newClipPath, object) {
37
37
  }
38
38
 
39
39
  newClipPath.style.clipPathTargets.push(object);
40
- } // re-calc target's AABB
41
-
40
+ }
42
41
 
43
- object.getEntity().getComponent(_Renderable.Renderable).aabbDirty = true;
42
+ (0, _services.dirtifyRenderable)(object);
44
43
  }
@@ -1,4 +1,4 @@
1
- import type { DisplayObject } from '../DisplayObject';
1
+ import type { DisplayObject } from '../display-objects/DisplayObject';
2
2
  import type { Tuple4Number } from '../types';
3
3
  import { ParsedStyleProperty } from '.';
4
4
  export interface LinearGradient {
@@ -1,4 +1,4 @@
1
- import type { DisplayObject } from '../DisplayObject';
1
+ import type { DisplayObject } from '../display-objects/DisplayObject';
2
2
  export declare type LengthUnit = 'px' | '%';
3
3
  export declare type AngleUnit = 'deg' | 'rad' | 'turn';
4
4
  export declare type Unit = LengthUnit | AngleUnit | '';
@@ -114,17 +114,14 @@ function convertPercentUnit(valueWithUnit, vec3Index, target) {
114
114
  if (valueWithUnit.unit === 'px') {
115
115
  return Number(valueWithUnit.value);
116
116
  } else if (valueWithUnit.unit === '%' && target) {
117
- var _a = target.parsedStyle,
118
- width = _a.width,
119
- height = _a.height; // const bounds = target.getEntity().getComponent(Geometry).aabb;
120
- // can't use bounds
121
- // const bounds = target.getLocalBounds();
117
+ // use bounds
118
+ var bounds = target.getBounds();
119
+ var size = 0;
122
120
 
123
- var size = 0; // if (bounds) {
124
- // size = bounds.halfExtents[vec3Index] * 2;
125
- // }
121
+ if (bounds) {
122
+ size = bounds.halfExtents[vec3Index] * 2;
123
+ }
126
124
 
127
- size = vec3Index === 0 ? width : height;
128
125
  return Number(valueWithUnit.value) / 100 * size;
129
126
  }
130
127
 
@@ -1,4 +1,4 @@
1
- import type { DisplayObject } from '../DisplayObject';
1
+ import type { DisplayObject } from '../display-objects/DisplayObject';
2
2
  import { ParsedColorStyleProperty } from './color';
3
3
  import { ParsedElement } from './dimension';
4
4
  export interface ParsedFilterStyleProperty {
@@ -1,8 +1,8 @@
1
1
  /** handle props in keyframe */
2
- import type { DisplayObject } from '../DisplayObject';
2
+ import type { IElement } from '../dom';
3
3
  import { SceneGraphService } from '../services';
4
4
  export declare const StylePropertyParser = "StylePropertyParser";
5
- export declare type StylePropertyParser<Original, Parsed> = (value: Original, displayObject: DisplayObject | null) => Parsed;
5
+ export declare type StylePropertyParser<Original, Parsed> = (value: Original, displayObject: IElement | null) => Parsed;
6
6
  export declare const StylePropertyParserFactory = "StylePropertyParserFactory";
7
7
  export declare type StylePropertyParserFactory = <Original, Parsed>(name: string) => StylePropertyParser<Original, Parsed>;
8
8
  export interface ParsedStyleProperty<T, V, Formatted = string> {
@@ -12,13 +12,14 @@ export interface ParsedStyleProperty<T, V, Formatted = string> {
12
12
  }
13
13
  export declare type Interpolatable = number | boolean | number[] | boolean[];
14
14
  export declare const StylePropertyUpdater = "StylePropertyUpdater";
15
- export declare type StylePropertyUpdater<Original> = (oldValue: Original, newValue: Original, displayObject: DisplayObject, sceneGraphService: SceneGraphService) => void;
15
+ export declare type StylePropertyUpdater<Original> = (oldValue: Original, newValue: Original, displayObject: IElement, sceneGraphService: SceneGraphService) => void;
16
16
  export declare const StylePropertyUpdaterFactory = "StylePropertyUpdaterFactory";
17
17
  export declare type StylePropertyUpdaterFactory = <Original>(name: string) => StylePropertyUpdater<Original>;
18
18
  export declare const StylePropertyMerger = "StylePropertyMerger";
19
- export declare type StylePropertyMerger<Parsed, T extends Interpolatable = number> = (left: Parsed, right: Parsed, displayObject: DisplayObject | null) => [T, T, (i: T) => string] | undefined;
19
+ export declare type StylePropertyMerger<Parsed, T extends Interpolatable = number> = (left: Parsed, right: Parsed, displayObject: IElement | null) => [T, T, (i: T) => string] | undefined;
20
20
  export declare const StylePropertyMergerFactory = "StylePropertyMergerFactory";
21
21
  export declare type StylePropertyMergerFactory = <Parsed>(name: string) => StylePropertyMerger<Parsed>;
22
+ export * from './anchor';
22
23
  export * from './aabb';
23
24
  export * from './localPosition';
24
25
  export * from './numeric';
@@ -13,6 +13,20 @@ var _exportNames = {
13
13
  };
14
14
  exports.StylePropertyMergerFactory = exports.StylePropertyMerger = exports.StylePropertyUpdaterFactory = exports.StylePropertyUpdater = exports.StylePropertyParserFactory = exports.StylePropertyParser = void 0;
15
15
 
16
+ var _anchor = require("./anchor");
17
+
18
+ Object.keys(_anchor).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
21
+ if (key in exports && exports[key] === _anchor[key]) return;
22
+ Object.defineProperty(exports, key, {
23
+ enumerable: true,
24
+ get: function get() {
25
+ return _anchor[key];
26
+ }
27
+ });
28
+ });
29
+
16
30
  var _aabb = require("./aabb");
17
31
 
18
32
  Object.keys(_aabb).forEach(function (key) {
@@ -1,2 +1,2 @@
1
- import type { DisplayObject } from '../DisplayObject';
1
+ import type { DisplayObject } from '../display-objects';
2
2
  export declare function updateLocalPosition(oldValue: number, newValue: number, object: DisplayObject): void;
@@ -5,18 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.updateLocalPosition = updateLocalPosition;
7
7
 
8
- var _components = require("../components");
9
-
10
8
  function updateLocalPosition(oldValue, newValue, object) {
11
- var renderable = object.getEntity().getComponent(_components.Renderable);
12
9
  var _a = object.parsedStyle,
13
10
  _b = _a.x,
14
11
  x = _b === void 0 ? 0 : _b,
15
12
  _c = _a.y,
16
13
  y = _c === void 0 ? 0 : _c; // update local position when x/y changed
17
14
 
18
- object.setLocalPosition(x, y); // dirtify renderable's AABB
19
-
20
- renderable.aabbDirty = true;
21
- renderable.dirty = true;
15
+ object.setLocalPosition(x, y);
22
16
  }
@@ -1,4 +1,4 @@
1
- import type { DisplayObject } from '../DisplayObject';
1
+ import type { DisplayObject } from '../display-objects/DisplayObject';
2
2
  /**
3
3
  * @see /zh/docs/api/animation#%E8%B7%AF%E5%BE%84%E5%8A%A8%E7%94%BB
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { DisplayObject } from '../DisplayObject';
1
+ import type { DisplayObject } from '../display-objects/DisplayObject';
2
2
  /**
3
3
  * @see /zh/docs/api/animation#%E8%B7%AF%E5%BE%84%E5%8A%A8%E7%94%BB
4
4
  */
@@ -1,5 +1,5 @@
1
- import type { DisplayObject } from '../DisplayObject';
2
1
  import type { vec2, vec3 } from 'gl-matrix';
2
+ import type { DisplayObject } from '../display-objects/DisplayObject';
3
3
  /**
4
4
  * @see /zh/docs/api/animation#%E8%B7%AF%E5%BE%84%E5%8A%A8%E7%94%BB
5
5
  */
@@ -6,9 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.updateOrigin = updateOrigin;
7
7
  exports.updateTransformOrigin = updateTransformOrigin;
8
8
 
9
+ var _util = require("@antv/util");
10
+
9
11
  var _dimension = require("./dimension");
10
12
 
11
- var _util = require("@antv/util");
13
+ // import { Transform } from '../components';
12
14
 
13
15
  /**
14
16
  * @see /zh/docs/api/animation#%E8%B7%AF%E5%BE%84%E5%8A%A8%E7%94%BB
@@ -53,8 +55,14 @@ function updateTransformOrigin(oldValue, value, object) {
53
55
  }
54
56
 
55
57
  if (!(0, _util.isNil)(originX) && !(0, _util.isNil)(originY)) {
58
+ // if (silent) {
59
+ // const transform = object.entity.getComponent(Transform);
60
+ // const originVec = transform.origin;
61
+ // originVec[0] = originX;
62
+ // originVec[1] = originY;
63
+ // } else {
56
64
  // relative to local bounds
57
- object.setOrigin(originX, originY);
65
+ object.setOrigin([originX, originY]); // }
58
66
  }
59
67
  }
60
68
 
@@ -1,5 +1,5 @@
1
- import type { DisplayObject } from '../DisplayObject';
1
+ import type { DisplayObject } from '../display-objects/DisplayObject';
2
2
  import type { PathCommand } from '../types';
3
3
  import type { ParsedPathStyleProps } from '../display-objects';
4
4
  export declare function parsePath(path: string, displayObject: DisplayObject | null): ParsedPathStyleProps;
5
- export declare function mergePaths(left: ParsedPathStyleProps, right: ParsedPathStyleProps, displayObject: DisplayObject | null): ((string[] | ["a" | "A", number, number, number, number, number, number, number] | ["c" | "C", number, number, number, number, number, number] | ["o" | "O", number, number] | ["h" | "H", number] | ["l" | "L", number, number] | ["m" | "M", number, number] | ["r" | "R", number, number, number, number] | ["q" | "Q", number, number, number, number] | ["s" | "S", number, number, number, number, number, number, number] | ["T" | "t", number, number] | ["v" | "V", number] | ["u" | "U", number, number, number])[] | ((pathArray: PathCommand[]) => PathCommand[]))[];
5
+ export declare function mergePaths(left: ParsedPathStyleProps, right: ParsedPathStyleProps, displayObject: DisplayObject | null): ((string[] | ["a" | "A", number, number, number, number, number, number, number] | ["C" | "c", number, number, number, number, number, number] | ["o" | "O", number, number] | ["h" | "H", number] | ["l" | "L", number, number] | ["m" | "M", number, number] | ["r" | "R", number, number, number, number] | ["q" | "Q", number, number, number, number] | ["s" | "S", number, number, number, number, number, number, number] | ["t" | "T", number, number] | ["v" | "V", number] | ["u" | "U", number, number, number])[] | ((pathArray: PathCommand[]) => PathCommand[]))[];
@@ -27,12 +27,15 @@ function parsePath(path, displayObject) {
27
27
  // @see http://thednp.github.io/kute.js/svgCubicMorph.html
28
28
 
29
29
 
30
- var curve = (0, _pathUtil.path2Curve)(clonedAbsolutePath);
30
+ var _b = (0, _tslib.__read)((0, _pathUtil.path2Curve)(clonedAbsolutePath, true), 2),
31
+ curve = _b[0],
32
+ zCommandIndexes = _b[1];
33
+
31
34
  var segments = (0, _pathUtil.path2Segments)(clonedAbsolutePath);
32
35
 
33
- var _b = calcLength(curve),
34
- totalLength = _b.totalLength,
35
- curveSegments = _b.curveSegments;
36
+ var _c = calcLength(curve),
37
+ totalLength = _c.totalLength,
38
+ curveSegments = _c.curveSegments;
36
39
 
37
40
  return {
38
41
  absolutePath: absolutePath,
@@ -43,6 +46,7 @@ function parsePath(path, displayObject) {
43
46
  curve: curve,
44
47
  totalLength: totalLength,
45
48
  curveSegments: curveSegments,
49
+ zCommandIndexes: zCommandIndexes,
46
50
  rect: getPathBBox(curve)
47
51
  };
48
52
  }
@@ -1,4 +1,4 @@
1
- import type { DisplayObject } from '../DisplayObject';
1
+ import type { DisplayObject } from '../display-objects/DisplayObject';
2
2
  export declare function parsePoints(points: [number, number][], displayObject: DisplayObject | null): {
3
3
  points: [number, number][];
4
4
  totalLength: number;
@@ -1,4 +1,4 @@
1
- import type { DisplayObject } from '../DisplayObject';
1
+ import type { DisplayObject } from '../display-objects/DisplayObject';
2
2
  import { ParsedElement } from './dimension';
3
3
  interface ParsedTransform {
4
4
  t: string;
@@ -1,2 +1,2 @@
1
- import type { DisplayObject } from '../DisplayObject';
1
+ import type { DisplayObject } from '../display-objects/DisplayObject';
2
2
  export declare function updateZIndex(oldZIndex: number, newZIndex: number, object: DisplayObject): void;
@@ -1,6 +1,7 @@
1
- import { CanvasService } from '../Canvas';
2
1
  export declare const ContextService = "ContextService";
3
- export interface ContextService<Context> extends CanvasService {
2
+ export interface ContextService<Context> {
3
+ init(): void;
4
+ destroy(): void;
4
5
  getContext(): Context | null;
5
6
  getDomElement(): HTMLElement | null;
6
7
  getDPR(): number;
@@ -2,11 +2,12 @@ import { EventEmitter } from 'eventemitter3';
2
2
  import type { Cursor, EventPosition } from '../types';
3
3
  import { CanvasConfig } from '../types';
4
4
  import type { FederatedEvent } from '../dom/FederatedEvent';
5
- import { EventTarget, Node } from '../dom';
6
- declare type Picker = (position: EventPosition) => Node | null;
7
- export declare const DELEGATION_SPLITTER = ":";
5
+ import { IEventTarget } from '../dom/interfaces';
6
+ import { PointLike } from '../shapes';
7
+ declare type Picker = (position: EventPosition) => Promise<IEventTarget | null>;
8
8
  export declare class EventService extends EventEmitter {
9
9
  private renderingContext;
10
+ private contextService;
10
11
  protected canvasConfig: CanvasConfig;
11
12
  private rootTarget;
12
13
  cursor: Cursor | null;
@@ -15,20 +16,24 @@ export declare class EventService extends EventEmitter {
15
16
  private eventPool;
16
17
  private pickHandler;
17
18
  init(): void;
19
+ client2Viewport(client: PointLike): PointLike;
20
+ viewport2Client(canvas: PointLike): PointLike;
21
+ viewport2Canvas({ x, y }: PointLike): PointLike;
22
+ canvas2Viewport(canvasP: PointLike): PointLike;
18
23
  setPickHandler(pickHandler: Picker): void;
19
- addEventMapping(type: string, fn: (e: FederatedEvent) => void): void;
24
+ addEventMapping(type: string, fn: (e: FederatedEvent) => Promise<void>): void;
20
25
  mapEvent(e: FederatedEvent): void;
21
- onPointerDown: (from: FederatedEvent) => void;
22
- onPointerUp: (from: FederatedEvent) => void;
23
- onPointerMove: (from: FederatedEvent) => void;
24
- onPointerOut: (from: FederatedEvent) => void;
25
- onPointerOver: (from: FederatedEvent) => void;
26
- onPointerUpOutside: (from: FederatedEvent) => void;
27
- onWheel: (from: FederatedEvent) => void;
26
+ onPointerDown: (from: FederatedEvent) => Promise<void>;
27
+ onPointerUp: (from: FederatedEvent) => Promise<void>;
28
+ onPointerMove: (from: FederatedEvent) => Promise<void>;
29
+ onPointerOut: (from: FederatedEvent) => Promise<void>;
30
+ onPointerOver: (from: FederatedEvent) => Promise<void>;
31
+ onPointerUpOutside: (from: FederatedEvent) => Promise<void>;
32
+ onWheel: (from: FederatedEvent) => Promise<void>;
28
33
  dispatchEvent(e: FederatedEvent, type?: string): void;
29
34
  propagate(e: FederatedEvent, type?: string): void;
30
- propagationPath(target: Node): Node[];
31
- hitTest(position: EventPosition): EventTarget | null;
35
+ propagationPath(target: IEventTarget): IEventTarget[];
36
+ hitTest(position: EventPosition): Promise<IEventTarget | null>;
32
37
  private createPointerEvent;
33
38
  private createWheelEvent;
34
39
  private trackingData;