@antv/g 5.0.22-alpha.5 → 5.0.23-alpha.0

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 (319) hide show
  1. package/dist/index.umd.min.js +30 -0
  2. package/es/AbstractRenderer.js +8 -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 +306 -170
  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 -3
  43. package/es/css/parser/numeric.js +1 -1
  44. package/es/css/parser/path.d.ts +2 -2
  45. package/es/css/parser/path.js +1 -1
  46. package/es/css/parser/points.js +1 -1
  47. package/es/css/parser/transform-origin.js +1 -1
  48. package/es/css/properties/CSSPropertyAnchor.js +3 -1
  49. package/es/css/properties/CSSPropertyClipPath.js +3 -1
  50. package/es/css/properties/CSSPropertyColor.js +3 -1
  51. package/es/css/properties/CSSPropertyFilter.js +3 -1
  52. package/es/css/properties/CSSPropertyLengthOrPercentage.js +3 -1
  53. package/es/css/properties/CSSPropertyLineDash.js +3 -1
  54. package/es/css/properties/CSSPropertyLocalPosition.js +3 -1
  55. package/es/css/properties/CSSPropertyOffsetDistance.js +3 -1
  56. package/es/css/properties/CSSPropertyOffsetPath.js +3 -1
  57. package/es/css/properties/CSSPropertyOpacity.js +3 -1
  58. package/es/css/properties/CSSPropertyPath.d.ts +14 -2
  59. package/es/css/properties/CSSPropertyPath.js +3 -1
  60. package/es/css/properties/CSSPropertyPoints.js +3 -1
  61. package/es/css/properties/CSSPropertyShadowBlur.js +3 -1
  62. package/es/css/properties/CSSPropertyText.d.ts +1 -1
  63. package/es/css/properties/CSSPropertyText.js +4 -2
  64. package/es/css/properties/CSSPropertyTextTransform.d.ts +3 -3
  65. package/es/css/properties/CSSPropertyTextTransform.js +3 -1
  66. package/es/css/properties/CSSPropertyTransform.js +4 -3
  67. package/es/css/properties/CSSPropertyTransformOrigin.js +3 -1
  68. package/es/css/properties/CSSPropertyVisibility.js +3 -1
  69. package/es/css/properties/CSSPropertyZIndex.js +3 -1
  70. package/es/display-objects/Circle.js +3 -1
  71. package/es/display-objects/CustomElement.js +3 -1
  72. package/es/display-objects/DisplayObject.js +10 -8
  73. package/es/display-objects/Ellipse.js +3 -1
  74. package/es/display-objects/Group.js +3 -1
  75. package/es/display-objects/HTML.js +6 -3
  76. package/es/display-objects/Image.js +3 -1
  77. package/es/display-objects/Line.js +3 -1
  78. package/es/display-objects/Path.d.ts +15 -15
  79. package/es/display-objects/Path.js +5 -3
  80. package/es/display-objects/Polygon.d.ts +8 -1
  81. package/es/display-objects/Polygon.js +3 -1
  82. package/es/display-objects/Polyline.d.ts +7 -5
  83. package/es/display-objects/Polyline.js +3 -1
  84. package/es/display-objects/Rect.js +3 -1
  85. package/es/display-objects/Text.js +6 -3
  86. package/es/dom/Animation.js +4 -2
  87. package/es/dom/AnimationEffectTiming.js +3 -1
  88. package/es/dom/AnimationEvent.js +3 -1
  89. package/es/dom/AnimationTimeline.js +3 -1
  90. package/es/dom/CustomElementRegistry.js +3 -1
  91. package/es/dom/CustomEvent.js +3 -1
  92. package/es/dom/Document.js +5 -3
  93. package/es/dom/Element.js +7 -6
  94. package/es/dom/EventTarget.js +6 -4
  95. package/es/dom/FederatedEvent.js +3 -1
  96. package/es/dom/FederatedMouseEvent.js +3 -1
  97. package/es/dom/FederatedPointerEvent.js +3 -1
  98. package/es/dom/FederatedTouchEvent.d.ts +15 -0
  99. package/es/dom/FederatedTouchEvent.js +19 -0
  100. package/es/dom/FederatedWheelEvent.js +3 -1
  101. package/es/dom/KeyframeEffect.js +3 -1
  102. package/es/dom/KeyframeList.js +1 -1
  103. package/es/dom/MutationEvent.js +3 -1
  104. package/es/dom/MutationObserver.js +10 -3
  105. package/es/dom/MutationRecord.js +3 -1
  106. package/es/dom/Node.js +4 -2
  107. package/es/plugins/CullingPlugin.d.ts +0 -1
  108. package/es/plugins/CullingPlugin.js +6 -9
  109. package/es/plugins/DirtyCheckPlugin.d.ts +1 -1
  110. package/es/plugins/DirtyCheckPlugin.js +12 -9
  111. package/es/plugins/EventPlugin.d.ts +1 -1
  112. package/es/plugins/EventPlugin.js +166 -149
  113. package/es/plugins/FrustumCullingStrategy.js +3 -1
  114. package/es/plugins/PrepareRendererPlugin.d.ts +0 -1
  115. package/es/plugins/PrepareRendererPlugin.js +18 -17
  116. package/es/services/EventService.d.ts +8 -0
  117. package/es/services/EventService.js +279 -23
  118. package/es/services/OffscreenCanvasCreator.js +3 -1
  119. package/es/services/RenderingService.d.ts +17 -16
  120. package/es/services/RenderingService.js +21 -18
  121. package/es/services/SceneGraphSelector.js +3 -1
  122. package/es/services/SceneGraphService.js +4 -2
  123. package/es/services/TextService.js +5 -3
  124. package/es/services/aabb/CircleUpdater.js +3 -1
  125. package/es/services/aabb/EllipseUpdater.js +3 -1
  126. package/es/services/aabb/LineUpdater.js +3 -1
  127. package/es/services/aabb/PathUpdater.d.ts +3 -3
  128. package/es/services/aabb/PathUpdater.js +3 -1
  129. package/es/services/aabb/PolylineUpdater.d.ts +3 -3
  130. package/es/services/aabb/PolylineUpdater.js +3 -1
  131. package/es/services/aabb/RectUpdater.js +4 -2
  132. package/es/services/aabb/TextUpdater.js +3 -1
  133. package/es/shapes/AABB.js +3 -1
  134. package/es/shapes/BoundingSphere.js +3 -1
  135. package/es/shapes/Frustum.js +3 -1
  136. package/es/shapes/Plane.js +3 -1
  137. package/es/shapes/Point.js +3 -1
  138. package/es/shapes/Ray.js +3 -1
  139. package/es/shapes/Rectangle.js +3 -1
  140. package/es/types.d.ts +9 -3
  141. package/es/utils/assert.d.ts +6 -0
  142. package/es/utils/assert.js +18 -0
  143. package/es/utils/custom-easing.js +1 -1
  144. package/es/utils/event.d.ts +18 -16
  145. package/es/utils/hooks.d.ts +280 -0
  146. package/es/utils/hooks.js +753 -0
  147. package/es/utils/index.d.ts +1 -0
  148. package/es/utils/index.js +2 -1
  149. package/es/utils/math.d.ts +2 -2
  150. package/es/utils/math.js +22 -6
  151. package/es/utils/path.d.ts +1 -1
  152. package/es/utils/path.js +3 -3
  153. package/es/utils/string.d.ts +1 -0
  154. package/es/utils/string.js +8 -0
  155. package/es/utils/text.js +5 -4
  156. package/lib/AbstractRenderer.js +8 -1
  157. package/lib/Canvas.d.ts +1 -1
  158. package/lib/Canvas.js +5 -3
  159. package/lib/DisplayObjectPool.js +3 -1
  160. package/lib/camera/Camera.d.ts +105 -66
  161. package/lib/camera/Camera.js +313 -178
  162. package/lib/camera/Landmark.d.ts +18 -25
  163. package/lib/camera/Landmark.js +1 -75
  164. package/lib/canvas-module.js +1 -3
  165. package/lib/components/Cullable.js +4 -2
  166. package/lib/components/Geometry.js +3 -1
  167. package/lib/components/Renderable.js +3 -1
  168. package/lib/components/Sortable.js +3 -1
  169. package/lib/components/Transform.js +3 -1
  170. package/lib/css/LayoutRegistry.js +3 -1
  171. package/lib/css/StyleValueRegistry.d.ts +8 -0
  172. package/lib/css/StyleValueRegistry.js +27 -20
  173. package/lib/css/cssom/CSSColorValue.js +3 -1
  174. package/lib/css/cssom/CSSGradientValue.js +9 -7
  175. package/lib/css/cssom/CSSKeywordValue.js +3 -1
  176. package/lib/css/cssom/CSSMathInvert.js +3 -1
  177. package/lib/css/cssom/CSSMathMax.js +3 -1
  178. package/lib/css/cssom/CSSMathMin.js +3 -1
  179. package/lib/css/cssom/CSSMathNegate.js +3 -1
  180. package/lib/css/cssom/CSSMathOperator.js +1 -1
  181. package/lib/css/cssom/CSSMathProduct.js +3 -1
  182. package/lib/css/cssom/CSSMathSum.js +3 -1
  183. package/lib/css/cssom/CSSMathValue.js +3 -1
  184. package/lib/css/cssom/CSSMathVariadic.js +4 -2
  185. package/lib/css/cssom/CSSNumericValue.js +3 -1
  186. package/lib/css/cssom/CSSNumericValueType.d.ts +1 -1
  187. package/lib/css/cssom/CSSNumericValueType.js +5 -3
  188. package/lib/css/cssom/CSSRGB.js +4 -2
  189. package/lib/css/cssom/CSSStyleValue.d.ts +1 -1
  190. package/lib/css/cssom/CSSStyleValue.js +4 -2
  191. package/lib/css/cssom/CSSTransformComponent.js +4 -2
  192. package/lib/css/cssom/CSSTransformValue.js +3 -1
  193. package/lib/css/cssom/CSSTranslate.js +3 -1
  194. package/lib/css/cssom/CSSUnitValue.js +4 -2
  195. package/lib/css/cssom/types.js +1 -1
  196. package/lib/css/parser/color.js +8 -8
  197. package/lib/css/parser/dimension.d.ts +1 -1
  198. package/lib/css/parser/dimension.js +8 -9
  199. package/lib/css/parser/numeric.js +6 -6
  200. package/lib/css/parser/path.d.ts +2 -2
  201. package/lib/css/parser/path.js +5 -5
  202. package/lib/css/parser/points.js +2 -2
  203. package/lib/css/parser/transform-origin.js +2 -2
  204. package/lib/css/parser/transform.js +2 -2
  205. package/lib/css/properties/CSSPropertyAnchor.js +3 -1
  206. package/lib/css/properties/CSSPropertyClipPath.js +3 -1
  207. package/lib/css/properties/CSSPropertyColor.js +3 -1
  208. package/lib/css/properties/CSSPropertyFilter.js +3 -1
  209. package/lib/css/properties/CSSPropertyLengthOrPercentage.js +3 -1
  210. package/lib/css/properties/CSSPropertyLineDash.js +3 -1
  211. package/lib/css/properties/CSSPropertyLocalPosition.js +3 -1
  212. package/lib/css/properties/CSSPropertyOffsetDistance.js +3 -1
  213. package/lib/css/properties/CSSPropertyOffsetPath.js +3 -1
  214. package/lib/css/properties/CSSPropertyOpacity.js +3 -1
  215. package/lib/css/properties/CSSPropertyPath.d.ts +14 -2
  216. package/lib/css/properties/CSSPropertyPath.js +3 -1
  217. package/lib/css/properties/CSSPropertyPoints.js +3 -1
  218. package/lib/css/properties/CSSPropertyShadowBlur.js +3 -1
  219. package/lib/css/properties/CSSPropertyText.d.ts +1 -1
  220. package/lib/css/properties/CSSPropertyText.js +4 -2
  221. package/lib/css/properties/CSSPropertyTextTransform.d.ts +3 -3
  222. package/lib/css/properties/CSSPropertyTextTransform.js +3 -1
  223. package/lib/css/properties/CSSPropertyTransform.js +3 -3
  224. package/lib/css/properties/CSSPropertyTransformOrigin.js +3 -1
  225. package/lib/css/properties/CSSPropertyVisibility.js +3 -1
  226. package/lib/css/properties/CSSPropertyZIndex.js +3 -1
  227. package/lib/display-objects/Circle.js +3 -1
  228. package/lib/display-objects/CustomElement.js +3 -1
  229. package/lib/display-objects/DisplayObject.js +13 -12
  230. package/lib/display-objects/Ellipse.js +3 -1
  231. package/lib/display-objects/Group.js +3 -1
  232. package/lib/display-objects/HTML.js +6 -4
  233. package/lib/display-objects/Image.js +3 -1
  234. package/lib/display-objects/Line.js +3 -1
  235. package/lib/display-objects/Path.d.ts +15 -15
  236. package/lib/display-objects/Path.js +7 -5
  237. package/lib/display-objects/Polygon.d.ts +8 -1
  238. package/lib/display-objects/Polygon.js +3 -1
  239. package/lib/display-objects/Polyline.d.ts +7 -5
  240. package/lib/display-objects/Polyline.js +3 -1
  241. package/lib/display-objects/Rect.js +3 -1
  242. package/lib/display-objects/Text.js +6 -4
  243. package/lib/dom/Animation.js +4 -2
  244. package/lib/dom/AnimationEffectTiming.js +3 -1
  245. package/lib/dom/AnimationEvent.js +3 -1
  246. package/lib/dom/AnimationTimeline.js +4 -2
  247. package/lib/dom/CustomElementRegistry.js +3 -1
  248. package/lib/dom/CustomEvent.js +3 -1
  249. package/lib/dom/Document.js +5 -3
  250. package/lib/dom/Element.js +7 -7
  251. package/lib/dom/EventTarget.js +14 -12
  252. package/lib/dom/FederatedEvent.js +3 -1
  253. package/lib/dom/FederatedMouseEvent.js +3 -1
  254. package/lib/dom/FederatedPointerEvent.js +3 -1
  255. package/lib/dom/FederatedTouchEvent.d.ts +15 -0
  256. package/lib/dom/FederatedTouchEvent.js +27 -0
  257. package/lib/dom/FederatedWheelEvent.js +3 -1
  258. package/lib/dom/KeyframeEffect.js +4 -2
  259. package/lib/dom/KeyframeList.js +1 -1
  260. package/lib/dom/MutationEvent.js +3 -1
  261. package/lib/dom/MutationObserver.js +11 -4
  262. package/lib/dom/MutationRecord.js +3 -1
  263. package/lib/dom/Node.js +4 -2
  264. package/lib/index.js +1 -1
  265. package/lib/plugins/CullingPlugin.d.ts +0 -1
  266. package/lib/plugins/CullingPlugin.js +7 -9
  267. package/lib/plugins/DirtyCheckPlugin.d.ts +1 -1
  268. package/lib/plugins/DirtyCheckPlugin.js +13 -9
  269. package/lib/plugins/EventPlugin.d.ts +1 -1
  270. package/lib/plugins/EventPlugin.js +175 -157
  271. package/lib/plugins/FrustumCullingStrategy.js +3 -1
  272. package/lib/plugins/PrepareRendererPlugin.d.ts +0 -1
  273. package/lib/plugins/PrepareRendererPlugin.js +17 -15
  274. package/lib/services/EventService.d.ts +8 -0
  275. package/lib/services/EventService.js +279 -22
  276. package/lib/services/OffscreenCanvasCreator.js +3 -1
  277. package/lib/services/RenderingService.d.ts +17 -16
  278. package/lib/services/RenderingService.js +22 -19
  279. package/lib/services/SceneGraphSelector.js +4 -2
  280. package/lib/services/SceneGraphService.js +8 -6
  281. package/lib/services/TextService.js +5 -3
  282. package/lib/services/aabb/CircleUpdater.js +3 -1
  283. package/lib/services/aabb/EllipseUpdater.js +3 -1
  284. package/lib/services/aabb/LineUpdater.js +3 -1
  285. package/lib/services/aabb/PathUpdater.d.ts +3 -3
  286. package/lib/services/aabb/PathUpdater.js +3 -1
  287. package/lib/services/aabb/PolylineUpdater.d.ts +3 -3
  288. package/lib/services/aabb/PolylineUpdater.js +3 -1
  289. package/lib/services/aabb/RectUpdater.js +6 -4
  290. package/lib/services/aabb/TextUpdater.js +3 -1
  291. package/lib/services/aabb/index.js +10 -10
  292. package/lib/services/aabb/interfaces.js +1 -1
  293. package/lib/shapes/AABB.js +3 -1
  294. package/lib/shapes/BoundingSphere.js +3 -1
  295. package/lib/shapes/Frustum.js +4 -2
  296. package/lib/shapes/Plane.js +3 -1
  297. package/lib/shapes/Point.js +3 -1
  298. package/lib/shapes/Ray.js +3 -1
  299. package/lib/shapes/Rectangle.js +3 -1
  300. package/lib/types.d.ts +9 -3
  301. package/lib/types.js +1 -1
  302. package/lib/utils/animation.js +3 -2
  303. package/lib/utils/assert.d.ts +6 -0
  304. package/lib/utils/assert.js +30 -0
  305. package/lib/utils/bezier-easing.js +1 -1
  306. package/lib/utils/custom-easing.js +2 -2
  307. package/lib/utils/event.d.ts +18 -16
  308. package/lib/utils/hooks.d.ts +280 -0
  309. package/lib/utils/hooks.js +759 -0
  310. package/lib/utils/index.d.ts +1 -0
  311. package/lib/utils/index.js +13 -0
  312. package/lib/utils/math.d.ts +2 -2
  313. package/lib/utils/math.js +34 -18
  314. package/lib/utils/path.d.ts +1 -1
  315. package/lib/utils/path.js +6 -6
  316. package/lib/utils/string.d.ts +1 -0
  317. package/lib/utils/string.js +11 -0
  318. package/lib/utils/text.js +7 -5
  319. package/package.json +5 -6
@@ -13,7 +13,9 @@ var _interfaces = require("./interfaces");
13
13
 
14
14
  var _types = require("../../types");
15
15
 
16
- var LineUpdater = function () {
16
+ var LineUpdater =
17
+ /** @class */
18
+ function () {
17
19
  function LineUpdater() {}
18
20
 
19
21
  LineUpdater.prototype.update = function (parsedStyle) {
@@ -1,7 +1,7 @@
1
1
  import { GeometryAABBUpdater } from './interfaces';
2
- import type { ParsedBaseStyleProps } from '../../types';
3
- export declare class PathUpdater implements GeometryAABBUpdater<ParsedBaseStyleProps> {
4
- update(parsedStyle: ParsedBaseStyleProps): {
2
+ import type { ParsedPathStyleProps } from '../../display-objects';
3
+ export declare class PathUpdater implements GeometryAABBUpdater<ParsedPathStyleProps> {
4
+ update(parsedStyle: ParsedPathStyleProps): {
5
5
  width: number;
6
6
  height: number;
7
7
  x: number;
@@ -13,7 +13,9 @@ var _interfaces = require("./interfaces");
13
13
 
14
14
  var _types = require("../../types");
15
15
 
16
- var PathUpdater = function () {
16
+ var PathUpdater =
17
+ /** @class */
18
+ function () {
17
19
  function PathUpdater() {}
18
20
 
19
21
  PathUpdater.prototype.update = function (parsedStyle) {
@@ -1,7 +1,7 @@
1
1
  import { GeometryAABBUpdater } from './interfaces';
2
- import type { ParsedBaseStyleProps } from '../../types';
3
- export declare class PolylineUpdater implements GeometryAABBUpdater<ParsedBaseStyleProps> {
4
- update(parsedStyle: ParsedBaseStyleProps): {
2
+ import type { ParsedPolylineStyleProps } from '../../display-objects';
3
+ export declare class PolylineUpdater implements GeometryAABBUpdater<ParsedPolylineStyleProps> {
4
+ update(parsedStyle: ParsedPolylineStyleProps): {
5
5
  width: number;
6
6
  height: number;
7
7
  x: number;
@@ -13,7 +13,9 @@ var _interfaces = require("./interfaces");
13
13
 
14
14
  var _types = require("../../types");
15
15
 
16
- var PolylineUpdater = function () {
16
+ var PolylineUpdater =
17
+ /** @class */
18
+ function () {
17
19
  function PolylineUpdater() {}
18
20
 
19
21
  PolylineUpdater.prototype.update = function (parsedStyle) {
@@ -9,15 +9,17 @@ var _tslib = require("tslib");
9
9
 
10
10
  var _manaSyringe = require("mana-syringe");
11
11
 
12
- var _util = require("@antv/util");
13
-
14
12
  var _interfaces = require("./interfaces");
15
13
 
16
14
  var _types = require("../../types");
17
15
 
18
16
  var _css = require("../../css");
19
17
 
20
- var RectUpdater = function () {
18
+ var _utils = require("../../utils");
19
+
20
+ var RectUpdater =
21
+ /** @class */
22
+ function () {
21
23
  function RectUpdater() {}
22
24
 
23
25
  RectUpdater.prototype.update = function (parsedStyle, object) {
@@ -42,7 +44,7 @@ var RectUpdater = function () {
42
44
  } // resize with HTMLImageElement's size
43
45
 
44
46
 
45
- if (img && !(0, _util.isString)(img)) {
47
+ if (img && !(0, _utils.isString)(img)) {
46
48
  if (!contentWidth) {
47
49
  contentWidth = img.width;
48
50
  }
@@ -19,7 +19,9 @@ var _types = require("../../types");
19
19
 
20
20
  var _css = require("../../css");
21
21
 
22
- var TextUpdater = function () {
22
+ var TextUpdater =
23
+ /** @class */
24
+ function () {
23
25
  function TextUpdater() {}
24
26
 
25
27
  TextUpdater.prototype.isReadyToMeasure = function (parsedStyle, object) {
@@ -24,34 +24,34 @@ Object.defineProperty(exports, "EllipseUpdater", {
24
24
  return _EllipseUpdater.EllipseUpdater;
25
25
  }
26
26
  });
27
- Object.defineProperty(exports, "RectUpdater", {
27
+ Object.defineProperty(exports, "LineUpdater", {
28
28
  enumerable: true,
29
29
  get: function get() {
30
- return _RectUpdater.RectUpdater;
30
+ return _LineUpdater.LineUpdater;
31
31
  }
32
32
  });
33
- Object.defineProperty(exports, "TextUpdater", {
33
+ Object.defineProperty(exports, "PathUpdater", {
34
34
  enumerable: true,
35
35
  get: function get() {
36
- return _TextUpdater.TextUpdater;
36
+ return _PathUpdater.PathUpdater;
37
37
  }
38
38
  });
39
- Object.defineProperty(exports, "LineUpdater", {
39
+ Object.defineProperty(exports, "PolylineUpdater", {
40
40
  enumerable: true,
41
41
  get: function get() {
42
- return _LineUpdater.LineUpdater;
42
+ return _PolylineUpdater.PolylineUpdater;
43
43
  }
44
44
  });
45
- Object.defineProperty(exports, "PolylineUpdater", {
45
+ Object.defineProperty(exports, "RectUpdater", {
46
46
  enumerable: true,
47
47
  get: function get() {
48
- return _PolylineUpdater.PolylineUpdater;
48
+ return _RectUpdater.RectUpdater;
49
49
  }
50
50
  });
51
- Object.defineProperty(exports, "PathUpdater", {
51
+ Object.defineProperty(exports, "TextUpdater", {
52
52
  enumerable: true,
53
53
  get: function get() {
54
- return _PathUpdater.PathUpdater;
54
+ return _TextUpdater.TextUpdater;
55
55
  }
56
56
  });
57
57
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.GeometryAABBUpdater = exports.GeometryUpdaterFactory = void 0;
6
+ exports.GeometryUpdaterFactory = exports.GeometryAABBUpdater = void 0;
7
7
 
8
8
  var _manaSyringe = require("mana-syringe");
9
9
 
@@ -12,7 +12,9 @@ var _glMatrix = require("gl-matrix");
12
12
  * 为了便于后续 Frustum Culling,通过查找表定义 p-vertex 和 n-vertex
13
13
  * @see https://github.com/antvis/GWebGPUEngine/issues/3
14
14
  */
15
- var AABB = function () {
15
+ var AABB =
16
+ /** @class */
17
+ function () {
16
18
  function AABB(center, halfExtents) {
17
19
  this.min = _glMatrix.vec3.create();
18
20
  this.max = _glMatrix.vec3.create();
@@ -9,7 +9,9 @@ var _glMatrix = require("gl-matrix");
9
9
 
10
10
  var tmpVecA = _glMatrix.vec3.create();
11
11
 
12
- var BoundingSphere = function () {
12
+ var BoundingSphere =
13
+ /** @class */
14
+ function () {
13
15
  function BoundingSphere(center, radius) {
14
16
  this.center = center || _glMatrix.vec3.create();
15
17
  this.radius = radius || 0.5;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Frustum = exports.Mask = void 0;
6
+ exports.Mask = exports.Frustum = void 0;
7
7
 
8
8
  var _tslib = require("tslib");
9
9
 
@@ -20,7 +20,9 @@ exports.Mask = Mask;
20
20
  Mask[Mask["INDETERMINATE"] = 2147483647] = "INDETERMINATE";
21
21
  })(Mask || (exports.Mask = Mask = {}));
22
22
 
23
- var Frustum = function () {
23
+ var Frustum =
24
+ /** @class */
25
+ function () {
24
26
  function Frustum(planes) {
25
27
  this.planes = [];
26
28
 
@@ -7,7 +7,9 @@ exports.Plane = void 0;
7
7
 
8
8
  var _glMatrix = require("gl-matrix");
9
9
 
10
- var Plane = function () {
10
+ var Plane =
11
+ /** @class */
12
+ function () {
11
13
  function Plane(distance, normal) {
12
14
  this.distance = distance || 0;
13
15
  this.normal = normal || _glMatrix.vec3.fromValues(0, 1, 0);
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Point = void 0;
7
7
 
8
- var Point = function () {
8
+ var Point =
9
+ /** @class */
10
+ function () {
9
11
  function Point(x, y) {
10
12
  if (x === void 0) {
11
13
  x = 0;
package/lib/shapes/Ray.js CHANGED
@@ -24,7 +24,9 @@ var tmpVecE = _glMatrix.vec3.create();
24
24
  */
25
25
 
26
26
 
27
- var Ray = function () {
27
+ var Ray =
28
+ /** @class */
29
+ function () {
28
30
  function Ray(origin, direction) {
29
31
  this.origin = origin || _glMatrix.vec3.create();
30
32
  this.direction = direction || _glMatrix.vec3.fromValues(0, 0, -1);
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Rectangle = void 0;
7
7
 
8
- var Rectangle = function () {
8
+ var Rectangle =
9
+ /** @class */
10
+ function () {
9
11
  function Rectangle(x, y, width, height) {
10
12
  this.x = x;
11
13
  this.y = y;
package/lib/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="offscreencanvas" />
2
2
  import type { vec2, vec3 } from 'gl-matrix';
3
- import type { DisplayObject, ParsedPathStyleProps, ParsedPolylineStyleProps } from './display-objects';
3
+ import type { DisplayObject } from './display-objects';
4
4
  import type { IRenderer } from './AbstractRenderer';
5
5
  import type { CSSGlobalKeywords, CSSGradientValue, CSSKeywordValue, CSSRGB, CSSUnitValue } from './css';
6
6
  import { Syringe } from 'mana-syringe';
@@ -120,6 +120,10 @@ export interface BaseStyleProps {
120
120
  opacity?: number;
121
121
  /** 线宽 */
122
122
  lineWidth?: string | number;
123
+ /**
124
+ * 交互区域
125
+ */
126
+ hitArea?: DisplayObject | null;
123
127
  /** 指定如何绘制每一条线段末端 */
124
128
  lineCap?: CanvasLineCap;
125
129
  /** 用来设置2个长度不为0的相连部分(线段,圆弧,曲线)如何连接在一起的属性(长度为0的变形部分,其指定的末端和控制点在同一位置,会被忽略) */
@@ -167,8 +171,6 @@ export interface ParsedBaseStyleProps extends Omit<BaseStyleProps, 'anchor' | 'x
167
171
  lineCap?: CSSKeywordValue;
168
172
  lineJoin?: CSSKeywordValue;
169
173
  lineDashOffset?: CSSUnitValue;
170
- path?: ParsedPathStyleProps;
171
- points?: ParsedPolylineStyleProps;
172
174
  anchor?: [CSSUnitValue, CSSUnitValue, CSSUnitValue];
173
175
  transformOrigin?: [CSSUnitValue, CSSUnitValue, CSSUnitValue];
174
176
  x?: CSSUnitValue;
@@ -195,6 +197,10 @@ export interface ParsedBaseStyleProps extends Omit<BaseStyleProps, 'anchor' | 'x
195
197
  }
196
198
  export declare type Cursor = 'auto' | 'default' | 'none' | 'context-menu' | 'help' | 'pointer' | 'progress' | 'wait' | 'cell' | 'crosshair' | 'text' | 'vertical-text' | 'alias' | 'copy' | 'move' | 'no-drop' | 'not-allowed' | 'grab' | 'grabbing' | 'all-scroll' | 'col-resize' | 'row-resize' | 'n-resize' | 'e-resize' | 's-resize' | 'w-resize' | 'ne-resize' | 'nw-resize' | 'se-resize' | 'sw-resize' | 'ew-resize' | 'ns-resize' | 'nesw-resize' | 'nwse-resize' | 'zoom-in' | 'zoom-out';
197
199
  export interface RendererConfig {
200
+ /**
201
+ * enable dirty check for displayobject
202
+ */
203
+ enableDirtyCheck: boolean;
198
204
  /**
199
205
  * enable dirty rectangle rendering
200
206
  */
package/lib/types.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.CanvasConfig = exports.TextAlign = exports.TextTransform = exports.LineJoin = exports.LineCap = exports.Shape = void 0;
6
+ exports.TextTransform = exports.TextAlign = exports.Shape = exports.LineJoin = exports.LineCap = exports.CanvasConfig = void 0;
7
7
 
8
8
  var _manaSyringe = require("mana-syringe");
9
9
 
@@ -3,10 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.parseEasingFunction = parseEasingFunction;
6
+ exports.EasingKeys = exports.EASINGS = void 0;
7
7
  exports.calculateActiveDuration = calculateActiveDuration;
8
8
  exports.calculateIterationProgress = calculateIterationProgress;
9
- exports.getEase = exports.EasingKeys = exports.EASINGS = exports.linear = void 0;
9
+ exports.linear = exports.getEase = void 0;
10
+ exports.parseEasingFunction = parseEasingFunction;
10
11
 
11
12
  var _tslib = require("tslib");
12
13
 
@@ -1,3 +1,9 @@
1
1
  export declare function DCHECK(bool: boolean): void;
2
2
  export declare function DCHECK_EQ(a: any, b: any): void;
3
3
  export declare function DCHECK_NE(a: any, b: any): void;
4
+ export declare function isUndefined(a: any): boolean;
5
+ export declare function isNil(a: any): boolean;
6
+ export declare function isNumber(value: any): value is number;
7
+ export declare function isFunction(value: any): value is Function;
8
+ export declare function isBoolean(value: any): value is boolean;
9
+ export declare function isObject(value: any): value is object;
@@ -6,6 +6,12 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.DCHECK = DCHECK;
7
7
  exports.DCHECK_EQ = DCHECK_EQ;
8
8
  exports.DCHECK_NE = DCHECK_NE;
9
+ exports.isBoolean = isBoolean;
10
+ exports.isFunction = isFunction;
11
+ exports.isNil = isNil;
12
+ exports.isNumber = isNumber;
13
+ exports.isObject = isObject;
14
+ exports.isUndefined = isUndefined;
9
15
 
10
16
  function DCHECK(bool) {
11
17
  if (!bool) {
@@ -23,4 +29,28 @@ function DCHECK_NE(a, b) {
23
29
  if (a === b) {
24
30
  throw new Error();
25
31
  }
32
+ }
33
+
34
+ function isUndefined(a) {
35
+ return typeof a === 'undefined';
36
+ }
37
+
38
+ function isNil(a) {
39
+ return a == null;
40
+ }
41
+
42
+ function isNumber(value) {
43
+ return typeof value === 'number';
44
+ }
45
+
46
+ function isFunction(value) {
47
+ return typeof value === 'function';
48
+ }
49
+
50
+ function isBoolean(value) {
51
+ return typeof value === 'boolean';
52
+ }
53
+
54
+ function isObject(value) {
55
+ return Object.prototype.toString.call(value) === '[object Object]';
26
56
  }
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.bezier = exports.newtonRaphsonIterate = exports.binarySubdivide = exports.getSlope = exports.calcBezier = exports.C = exports.B = exports.A = exports.float32ArraySupported = exports.kSampleStepSize = exports.kSplineTableSize = exports.SUBDIVISION_MAX_ITERATIONS = exports.SUBDIVISION_PRECISION = exports.NEWTON_MIN_SLOPE = exports.NEWTON_ITERATIONS = void 0;
6
+ exports.newtonRaphsonIterate = exports.kSplineTableSize = exports.kSampleStepSize = exports.getSlope = exports.float32ArraySupported = exports.calcBezier = exports.binarySubdivide = exports.bezier = exports.SUBDIVISION_PRECISION = exports.SUBDIVISION_MAX_ITERATIONS = exports.NEWTON_MIN_SLOPE = exports.NEWTON_ITERATIONS = exports.C = exports.B = exports.A = void 0;
7
7
 
8
8
  /**
9
9
  * https://github.com/gre/bezier-easing
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getEasingFunction = exports.complexEasingSyntax = exports.EasingFunctions = exports.EaseOutIn = exports.EaseInOut = exports.EaseOut = exports.easein = exports.Bezier = exports.Steps = exports.parseEasingParameters = exports.INTINITE_LOOP_LIMIT = exports.EasingDurationCache = exports.Spring = exports.Elastic = exports.Bounce = exports.Back = exports.Circ = exports.Sine = exports.Expo = exports.Quint = exports.Quart = exports.Cubic = exports.Quad = exports.limit = exports.convertToDash = void 0;
6
+ exports.parseEasingParameters = exports.limit = exports.getEasingFunction = exports.easein = exports.convertToDash = exports.complexEasingSyntax = exports.Steps = exports.Spring = exports.Sine = exports.Quint = exports.Quart = exports.Quad = exports.INTINITE_LOOP_LIMIT = exports.Expo = exports.Elastic = exports.EasingFunctions = exports.EasingDurationCache = exports.EaseOutIn = exports.EaseOut = exports.EaseInOut = exports.Cubic = exports.Circ = exports.Bounce = exports.Bezier = exports.Back = void 0;
7
7
 
8
8
  var _tslib = require("tslib");
9
9
 
@@ -14,7 +14,7 @@ var _bezierEasing = require("./bezier-easing");
14
14
  */
15
15
  var convertToDash = function convertToDash(str) {
16
16
  str = str.replace(/([A-Z])/g, function (letter) {
17
- return "-" + letter.toLowerCase();
17
+ return "-".concat(letter.toLowerCase());
18
18
  }); // Remove first dash
19
19
 
20
20
  return str.charAt(0) === '-' ? str.substr(1) : str;
@@ -1,3 +1,4 @@
1
+ import type { IEventTarget } from '../dom';
1
2
  export declare const MOUSE_POINTER_ID = 1;
2
3
  export declare const TOUCH_TO_POINTER: Record<string, string>;
3
4
  export interface FormattedPointerEvent extends PointerEvent {
@@ -14,25 +15,12 @@ export interface FormattedPointerEvent extends PointerEvent {
14
15
  isNormalized: boolean;
15
16
  type: string;
16
17
  }
17
- export interface FormattedTouch extends Touch {
18
- button: number;
19
- buttons: number;
20
- isPrimary: boolean;
21
- width: number;
22
- height: number;
23
- tiltX: number;
24
- tiltY: number;
25
- pointerType: string;
26
- pointerId: number;
27
- pressure: number;
28
- twist: number;
29
- tangentialPressure: number;
30
- layerY: number;
31
- offsetX: number;
32
- offsetY: number;
18
+ export interface FormattedTouchEvent {
33
19
  isNormalized: boolean;
34
20
  type: string;
35
21
  /**
22
+ * we don't implement TouchList here
23
+ *
36
24
  * @see https://developer.mozilla.org/zh-CN/docs/Web/API/TouchEvent/changedTouches
37
25
  */
38
26
  changedTouches: FormattedTouch[];
@@ -40,4 +28,18 @@ export interface FormattedTouch extends Touch {
40
28
  * @see https://developer.mozilla.org/zh-CN/docs/Web/API/TouchEvent/touches
41
29
  */
42
30
  touches: FormattedTouch[];
31
+ /**
32
+ * @see https://developer.mozilla.org/zh-CN/docs/Web/API/TouchEvent/targetTouches
33
+ */
34
+ targetTouches: FormattedTouch[];
35
+ }
36
+ export interface FormattedTouch extends Touch {
37
+ x: number;
38
+ y: number;
39
+ canvasX: number;
40
+ canvasY: number;
41
+ viewportX: number;
42
+ viewportY: number;
43
+ target: IEventTarget | null;
44
+ nativeTouch: Touch;
43
45
  }