@antv/g 5.0.22-alpha.6 → 5.0.23-alpha.10

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 (164) hide show
  1. package/dist/index.umd.min.js +3 -3
  2. package/es/AbstractRenderer.js +5 -0
  3. package/es/camera/Camera.js +2 -2
  4. package/es/css/cssom/CSSKeywordValue.d.ts +1 -1
  5. package/es/css/cssom/CSSNumericSumValue.d.ts +1 -1
  6. package/es/css/cssom/CSSNumericValue.d.ts +141 -4
  7. package/es/css/cssom/CSSNumericValue.js +1166 -5
  8. package/es/css/cssom/CSSTransformValue.d.ts +1 -1
  9. package/es/css/cssom/index.d.ts +0 -10
  10. package/es/css/cssom/index.js +1 -11
  11. package/es/css/parser/color.js +1 -1
  12. package/es/css/parser/dimension.js +1 -2
  13. package/es/css/parser/numeric.d.ts +1 -1
  14. package/es/css/parser/numeric.js +2 -2
  15. package/es/css/parser/path.d.ts +2 -2
  16. package/es/css/parser/path.js +1 -1
  17. package/es/css/parser/points.js +1 -1
  18. package/es/css/parser/transform-origin.d.ts +1 -1
  19. package/es/css/parser/transform-origin.js +2 -2
  20. package/es/css/parser/transform.d.ts +1 -3
  21. package/es/css/parser/transform.js +9 -8
  22. package/es/css/properties/CSSPropertyPath.d.ts +14 -2
  23. package/es/css/properties/CSSPropertyTextTransform.d.ts +2 -2
  24. package/es/css/properties/CSSPropertyTransform.js +3 -4
  25. package/es/display-objects/DisplayObject.js +4 -5
  26. package/es/display-objects/Path.d.ts +15 -15
  27. package/es/display-objects/Path.js +1 -1
  28. package/es/display-objects/Polygon.d.ts +8 -1
  29. package/es/display-objects/Polyline.d.ts +7 -5
  30. package/es/dom/Document.js +2 -2
  31. package/es/dom/Element.js +1 -2
  32. package/es/dom/EventTarget.js +1 -1
  33. package/es/dom/FederatedTouchEvent.d.ts +5 -3
  34. package/es/plugins/CullingPlugin.d.ts +0 -1
  35. package/es/plugins/CullingPlugin.js +3 -8
  36. package/es/plugins/DirtyCheckPlugin.d.ts +1 -1
  37. package/es/plugins/DirtyCheckPlugin.js +9 -8
  38. package/es/plugins/EventPlugin.d.ts +1 -1
  39. package/es/plugins/EventPlugin.js +163 -148
  40. package/es/plugins/PrepareRendererPlugin.d.ts +0 -1
  41. package/es/plugins/PrepareRendererPlugin.js +16 -17
  42. package/es/services/EventService.d.ts +8 -0
  43. package/es/services/EventService.js +274 -20
  44. package/es/services/RenderingService.d.ts +17 -16
  45. package/es/services/RenderingService.js +19 -18
  46. package/es/services/SceneGraphService.js +1 -1
  47. package/es/services/aabb/PathUpdater.d.ts +3 -3
  48. package/es/services/aabb/PolylineUpdater.d.ts +3 -3
  49. package/es/services/aabb/RectUpdater.js +1 -1
  50. package/es/types.d.ts +5 -3
  51. package/es/utils/assert.d.ts +6 -0
  52. package/es/utils/assert.js +18 -0
  53. package/es/utils/event.d.ts +18 -16
  54. package/es/utils/hooks.d.ts +280 -0
  55. package/es/utils/hooks.js +753 -0
  56. package/es/utils/index.d.ts +1 -0
  57. package/es/utils/index.js +2 -1
  58. package/es/utils/math.d.ts +1 -0
  59. package/es/utils/math.js +13 -2
  60. package/es/utils/string.d.ts +1 -0
  61. package/es/utils/string.js +8 -0
  62. package/es/utils/text.js +2 -1
  63. package/lib/AbstractRenderer.js +5 -0
  64. package/lib/camera/Camera.js +4 -4
  65. package/lib/css/cssom/CSSKeywordValue.d.ts +1 -1
  66. package/lib/css/cssom/CSSNumericSumValue.d.ts +1 -1
  67. package/lib/css/cssom/CSSNumericValue.d.ts +141 -4
  68. package/lib/css/cssom/CSSNumericValue.js +1226 -52
  69. package/lib/css/cssom/CSSTransformValue.d.ts +1 -1
  70. package/lib/css/cssom/index.d.ts +0 -10
  71. package/lib/css/cssom/index.js +0 -130
  72. package/lib/css/parser/color.js +5 -5
  73. package/lib/css/parser/dimension.js +1 -3
  74. package/lib/css/parser/numeric.d.ts +1 -1
  75. package/lib/css/parser/numeric.js +7 -7
  76. package/lib/css/parser/path.d.ts +2 -2
  77. package/lib/css/parser/path.js +4 -4
  78. package/lib/css/parser/points.js +2 -2
  79. package/lib/css/parser/transform-origin.d.ts +1 -1
  80. package/lib/css/parser/transform-origin.js +4 -4
  81. package/lib/css/parser/transform.d.ts +1 -3
  82. package/lib/css/parser/transform.js +25 -24
  83. package/lib/css/properties/CSSPropertyPath.d.ts +14 -2
  84. package/lib/css/properties/CSSPropertyTextTransform.d.ts +2 -2
  85. package/lib/css/properties/CSSPropertyTransform.js +18 -20
  86. package/lib/display-objects/DisplayObject.js +7 -9
  87. package/lib/display-objects/Path.d.ts +15 -15
  88. package/lib/display-objects/Path.js +3 -3
  89. package/lib/display-objects/Polygon.d.ts +8 -1
  90. package/lib/display-objects/Polyline.d.ts +7 -5
  91. package/lib/dom/Document.js +2 -2
  92. package/lib/dom/Element.js +1 -3
  93. package/lib/dom/EventTarget.js +9 -9
  94. package/lib/dom/FederatedTouchEvent.d.ts +5 -3
  95. package/lib/plugins/CullingPlugin.d.ts +0 -1
  96. package/lib/plugins/CullingPlugin.js +3 -7
  97. package/lib/plugins/DirtyCheckPlugin.d.ts +1 -1
  98. package/lib/plugins/DirtyCheckPlugin.js +10 -8
  99. package/lib/plugins/EventPlugin.d.ts +1 -1
  100. package/lib/plugins/EventPlugin.js +172 -156
  101. package/lib/plugins/PrepareRendererPlugin.d.ts +0 -1
  102. package/lib/plugins/PrepareRendererPlugin.js +16 -16
  103. package/lib/services/EventService.d.ts +8 -0
  104. package/lib/services/EventService.js +274 -19
  105. package/lib/services/RenderingService.d.ts +17 -16
  106. package/lib/services/RenderingService.js +21 -20
  107. package/lib/services/SceneGraphService.js +3 -3
  108. package/lib/services/aabb/PathUpdater.d.ts +3 -3
  109. package/lib/services/aabb/PolylineUpdater.d.ts +3 -3
  110. package/lib/services/aabb/RectUpdater.js +3 -3
  111. package/lib/types.d.ts +5 -3
  112. package/lib/utils/assert.d.ts +6 -0
  113. package/lib/utils/assert.js +30 -0
  114. package/lib/utils/event.d.ts +18 -16
  115. package/lib/utils/hooks.d.ts +280 -0
  116. package/lib/utils/hooks.js +759 -0
  117. package/lib/utils/index.d.ts +1 -0
  118. package/lib/utils/index.js +13 -0
  119. package/lib/utils/math.d.ts +1 -0
  120. package/lib/utils/math.js +17 -4
  121. package/lib/utils/string.d.ts +1 -0
  122. package/lib/utils/string.js +11 -0
  123. package/lib/utils/text.js +5 -3
  124. package/package.json +4 -7
  125. package/es/css/cssom/CSSMathInvert.d.ts +0 -14
  126. package/es/css/cssom/CSSMathInvert.js +0 -84
  127. package/es/css/cssom/CSSMathMax.d.ts +0 -17
  128. package/es/css/cssom/CSSMathMax.js +0 -118
  129. package/es/css/cssom/CSSMathMin.d.ts +0 -17
  130. package/es/css/cssom/CSSMathMin.js +0 -119
  131. package/es/css/cssom/CSSMathNegate.d.ts +0 -14
  132. package/es/css/cssom/CSSMathNegate.js +0 -80
  133. package/es/css/cssom/CSSMathProduct.d.ts +0 -16
  134. package/es/css/cssom/CSSMathProduct.js +0 -109
  135. package/es/css/cssom/CSSMathSum.d.ts +0 -17
  136. package/es/css/cssom/CSSMathSum.js +0 -117
  137. package/es/css/cssom/CSSMathValue.d.ts +0 -11
  138. package/es/css/cssom/CSSMathValue.js +0 -27
  139. package/es/css/cssom/CSSMathVariadic.d.ts +0 -9
  140. package/es/css/cssom/CSSMathVariadic.js +0 -44
  141. package/es/css/cssom/CSSNumericValueType.d.ts +0 -33
  142. package/es/css/cssom/CSSNumericValueType.js +0 -259
  143. package/es/css/cssom/CSSUnitValue.d.ts +0 -33
  144. package/es/css/cssom/CSSUnitValue.js +0 -252
  145. package/lib/css/cssom/CSSMathInvert.d.ts +0 -14
  146. package/lib/css/cssom/CSSMathInvert.js +0 -94
  147. package/lib/css/cssom/CSSMathMax.d.ts +0 -17
  148. package/lib/css/cssom/CSSMathMax.js +0 -128
  149. package/lib/css/cssom/CSSMathMin.d.ts +0 -17
  150. package/lib/css/cssom/CSSMathMin.js +0 -128
  151. package/lib/css/cssom/CSSMathNegate.d.ts +0 -14
  152. package/lib/css/cssom/CSSMathNegate.js +0 -89
  153. package/lib/css/cssom/CSSMathProduct.d.ts +0 -16
  154. package/lib/css/cssom/CSSMathProduct.js +0 -119
  155. package/lib/css/cssom/CSSMathSum.d.ts +0 -17
  156. package/lib/css/cssom/CSSMathSum.js +0 -129
  157. package/lib/css/cssom/CSSMathValue.d.ts +0 -11
  158. package/lib/css/cssom/CSSMathValue.js +0 -35
  159. package/lib/css/cssom/CSSMathVariadic.d.ts +0 -9
  160. package/lib/css/cssom/CSSMathVariadic.js +0 -55
  161. package/lib/css/cssom/CSSNumericValueType.d.ts +0 -33
  162. package/lib/css/cssom/CSSNumericValueType.js +0 -272
  163. package/lib/css/cssom/CSSUnitValue.d.ts +0 -33
  164. package/lib/css/cssom/CSSUnitValue.js +0 -267
@@ -1,4 +1,4 @@
1
- import type { Nested, ParenLess } from '.';
1
+ import type { Nested, ParenLess } from './types';
2
2
  import { CSSStyleValue, CSSStyleValueType } from './CSSStyleValue';
3
3
  import type { CSSTransformComponent } from './CSSTransformComponent';
4
4
  /**
@@ -10,20 +10,10 @@ export * from './types';
10
10
  export * from './CSSColorValue';
11
11
  export * from './CSSKeywordValue';
12
12
  export * from './CSSMathOperator';
13
- export * from './CSSMathInvert';
14
- export * from './CSSMathMax';
15
- export * from './CSSMathMin';
16
- export * from './CSSMathNegate';
17
- export * from './CSSMathProduct';
18
- export * from './CSSMathSum';
19
- export * from './CSSMathValue';
20
- export * from './CSSMathVariadic';
21
13
  export * from './CSSNumericSumValue';
22
14
  export * from './CSSNumericValue';
23
- export * from './CSSNumericValueType';
24
15
  export * from './CSSRGB';
25
16
  export * from './CSSGradientValue';
26
17
  export * from './CSSStyleValue';
27
18
  export * from './CSSTransformValue';
28
19
  export * from './CSSTranslate';
29
- export * from './CSSUnitValue';
@@ -10,20 +10,10 @@ export * from './types';
10
10
  export * from './CSSColorValue';
11
11
  export * from './CSSKeywordValue';
12
12
  export * from './CSSMathOperator';
13
- export * from './CSSMathInvert';
14
- export * from './CSSMathMax';
15
- export * from './CSSMathMin';
16
- export * from './CSSMathNegate';
17
- export * from './CSSMathProduct';
18
- export * from './CSSMathSum';
19
- export * from './CSSMathValue';
20
- export * from './CSSMathVariadic';
21
13
  export * from './CSSNumericSumValue';
22
14
  export * from './CSSNumericValue';
23
- export * from './CSSNumericValueType';
24
15
  export * from './CSSRGB';
25
16
  export * from './CSSGradientValue';
26
17
  export * from './CSSStyleValue';
27
18
  export * from './CSSTransformValue';
28
- export * from './CSSTranslate';
29
- export * from './CSSUnitValue';
19
+ export * from './CSSTranslate';
@@ -1,7 +1,7 @@
1
1
  import { __read, __spreadArray } from "tslib";
2
2
  import * as d3 from 'd3-color';
3
- import { clamp, isString } from 'lodash-es';
4
3
  import { CSSRGB, CSSGradientValue, GradientPatternType } from '../cssom';
4
+ import { clamp, isString } from '../../utils';
5
5
  var regexLG = /^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i;
6
6
  var regexRG = /^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i;
7
7
  var regexPR = /^p\s*\(\s*([axyn])\s*\)\s*(.*)/i;
@@ -1,6 +1,5 @@
1
- import { isString } from 'lodash-es';
2
1
  import { AABB } from '../../shapes';
3
- import { rad2deg, turn2deg } from '../../utils';
2
+ import { isString, rad2deg, turn2deg } from '../../utils';
4
3
  import { UnitType } from '../cssom';
5
4
  import { CSSUnitValue } from '../cssom';
6
5
  export function parseDimension(unitRegExp, string) {
@@ -1,4 +1,4 @@
1
- import { CSSUnitValue } from '../cssom';
1
+ import { CSSUnitValue } from '../cssom/CSSNumericValue';
2
2
  export declare function numberToString(x: number): string;
3
3
  /**
4
4
  * parse string or number to CSSUnitValue(numeric)
@@ -1,5 +1,5 @@
1
- import { clamp, isString } from 'lodash-es';
2
- import { CSSUnitValue } from '../cssom';
1
+ import { clamp, isString } from '../../utils';
2
+ import { CSSUnitValue } from '../cssom/CSSNumericValue';
3
3
  export function numberToString(x) {
4
4
  // scale(0.00000001) -> scale(0)
5
5
  // return x.toFixed(6).replace(/0+$/, '').replace(/\.$/, '');
@@ -1,5 +1,5 @@
1
1
  import type { PathCommand } from '../../types';
2
2
  import type { ParsedPathStyleProps } from '../../display-objects';
3
3
  import type { IElement } from '../../dom';
4
- export declare function parsePath(path: string): ParsedPathStyleProps;
5
- export declare function mergePaths(left: ParsedPathStyleProps, right: ParsedPathStyleProps, object: IElement): [PathCommand[], PathCommand[], (b: PathCommand[]) => PathCommand[]];
4
+ export declare function parsePath(path: string): ParsedPathStyleProps['path'];
5
+ export declare function mergePaths(left: ParsedPathStyleProps['path'], right: ParsedPathStyleProps['path'], object: IElement): [PathCommand[], PathCommand[], (b: PathCommand[]) => PathCommand[]];
@@ -1,5 +1,5 @@
1
1
  import { __read, __spreadArray } from "tslib";
2
- import { path2Absolute, path2Segments, path2Curve } from '@antv/path-util';
2
+ import { path2Absolute, path2Segments, path2Curve } from '@antv/util';
3
3
  import { Cubic as CubicUtil } from '@antv/g-math';
4
4
  import { clonePath, equalizeSegments, getDrawDirection, getRotatedCurve, reverseCurve } from '../../utils/path';
5
5
  import { Rectangle } from '../../shapes/Rectangle';
@@ -1,5 +1,5 @@
1
1
  import { Line as LineUtil, Polyline as PolylineUtil } from '@antv/g-math';
2
- import { isString } from 'lodash-es';
2
+ import { isString } from '../../utils';
3
3
  export function parsePoints(points) {
4
4
  if (isString(points)) {
5
5
  return null;
@@ -1,4 +1,4 @@
1
- import { CSSUnitValue } from '../cssom';
1
+ import { CSSUnitValue } from '../cssom/CSSNumericValue';
2
2
  /**
3
3
  * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-origin
4
4
  * eg. 'center' 'top left' '50px 50px'
@@ -1,5 +1,5 @@
1
- import { isString } from 'lodash-es';
2
- import { CSSUnitValue } from '../cssom';
1
+ import { isString } from '../../utils';
2
+ import { CSSUnitValue } from '../cssom/CSSNumericValue';
3
3
  import { parseLengthOrPercentage } from './dimension';
4
4
  /**
5
5
  * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-origin
@@ -1,11 +1,9 @@
1
1
  import type { DisplayObject } from '../../display-objects/DisplayObject';
2
- import { CSSUnitValue } from '../cssom';
2
+ import { CSSUnitValue } from '../cssom/CSSNumericValue';
3
3
  export interface ParsedTransform {
4
4
  t: string;
5
5
  d: CSSUnitValue[];
6
6
  }
7
- export declare const Opx: CSSUnitValue;
8
- export declare const Odeg: CSSUnitValue;
9
7
  /**
10
8
  * none
11
9
  * scale(1) scale(1, 2)
@@ -1,8 +1,9 @@
1
- import { parseNumber, mergeNumbers, parseAngle, parseLength, parseLengthOrPercentage, mergeDimensions } from './';
2
- import { UnitType, CSSUnitValue } from '../cssom';
1
+ import { UnitType } from '../cssom/types';
2
+ import { CSSUnitValue, Opx, Odeg } from '../cssom/CSSNumericValue';
3
+ import { mergeDimensions, parseAngle, parseLength, parseLengthOrPercentage } from './dimension';
4
+ import { mergeNumbers, parseNumber } from './numeric';
5
+ import { CSS } from '../CSS';
3
6
  var _ = null;
4
- export var Opx = new CSSUnitValue(0, 'px');
5
- export var Odeg = new CSSUnitValue(0, 'deg');
6
7
 
7
8
  function cast(pattern) {
8
9
  return function (contents) {
@@ -28,10 +29,10 @@ var transformFunctions = {
28
29
  rotatez: ['A'],
29
30
  rotate3d: ['NNNA'],
30
31
  // perspective: ['L'],
31
- scale: ['Nn', cast([_, _, new CSSUnitValue(1)]), id],
32
- scalex: ['N', cast([_, new CSSUnitValue(1), new CSSUnitValue(1)]), cast([_, new CSSUnitValue(1)])],
33
- scaley: ['N', cast([new CSSUnitValue(1), _, new CSSUnitValue(1)]), cast([new CSSUnitValue(1), _])],
34
- scalez: ['N', cast([new CSSUnitValue(1), new CSSUnitValue(1), _])],
32
+ scale: ['Nn', cast([_, _, CSS.number(1)]), id],
33
+ scalex: ['N', cast([_, CSS.number(1), CSS.number(1)]), cast([_, CSS.number(1)])],
34
+ scaley: ['N', cast([CSS.number(1), _, CSS.number(1)]), cast([CSS.number(1), _])],
35
+ scalez: ['N', cast([CSS.number(1), CSS.number(1), _])],
35
36
  scale3d: ['NNN', id],
36
37
  // skew: ['Aa', null, id],
37
38
  // skewx: ['A', null, cast([_, Odeg])],
@@ -1,12 +1,24 @@
1
1
  import type { DisplayObject, ParsedPathStyleProps } from '../../display-objects';
2
+ import { Rectangle } from '../../shapes';
2
3
  import type { CSSProperty } from '../CSSProperty';
3
4
  import { parsePath, mergePaths } from '../parser';
4
- export declare class CSSPropertyPath implements Partial<CSSProperty<ParsedPathStyleProps, ParsedPathStyleProps>> {
5
+ export declare class CSSPropertyPath implements Partial<CSSProperty<ParsedPathStyleProps['path'], ParsedPathStyleProps['path']>> {
5
6
  /**
6
7
  * path2Curve
7
8
  */
8
9
  parser: typeof parsePath;
9
- calculator(name: string, oldParsed: ParsedPathStyleProps, parsed: ParsedPathStyleProps): ParsedPathStyleProps;
10
+ calculator(name: string, oldParsed: ParsedPathStyleProps['path'], parsed: ParsedPathStyleProps['path']): {
11
+ absolutePath: import("../../types").PathCommand[];
12
+ hasArc: boolean;
13
+ segments: import("../../display-objects").PathSegment[];
14
+ polygons: [number, number][][];
15
+ polylines: [number, number][][];
16
+ curve: import("../../types").PathCommand[];
17
+ totalLength: number;
18
+ curveSegments: number[][];
19
+ zCommandIndexes: number[];
20
+ rect: Rectangle;
21
+ };
10
22
  mixer: typeof mergePaths;
11
23
  /**
12
24
  * update local position
@@ -1,5 +1,5 @@
1
1
  import type { CSSProperty } from '../CSSProperty';
2
- import type { DisplayObject, ParsedPathStyleProps } from '../../display-objects';
3
- export declare class CSSPropertyTextTransform implements Partial<CSSProperty<ParsedPathStyleProps, ParsedPathStyleProps>> {
2
+ import type { DisplayObject } from '../../display-objects';
3
+ export declare class CSSPropertyTextTransform implements Partial<CSSProperty<any, any>> {
4
4
  postProcessor(o: DisplayObject): void;
5
5
  }
@@ -1,8 +1,7 @@
1
- import { __decorate } from "tslib"; // import { uniq } from '@lodash-es';
2
-
1
+ import { __decorate } from "tslib";
3
2
  import { singleton } from 'mana-syringe';
4
- import { CSSKeywordValue } from '../cssom';
5
- import { Opx, Odeg, parseTransform, mergeTransforms } from '../parser';
3
+ import { CSSKeywordValue, Opx, Odeg } from '../cssom';
4
+ import { parseTransform, mergeTransforms } from '../parser';
6
5
  /**
7
6
  * @see /zh/docs/api/animation#支持变换的属性
8
7
  *
@@ -1,13 +1,12 @@
1
1
  import { __assign, __extends, __read, __spreadArray } from "tslib";
2
2
  import { GlobalContainer } from 'mana-syringe';
3
- import { isEqual, isNil, isObject, isUndefined } from 'lodash-es';
4
3
  import { mat4, quat, vec3 } from 'gl-matrix';
5
4
  import { DisplayObjectPool } from '../DisplayObjectPool';
6
5
  import { KeyframeEffect } from '../dom/KeyframeEffect';
7
6
  import { Element } from '../dom/Element';
8
7
  import { ElementEvent } from '../dom/interfaces';
9
8
  import { Shape } from '../types';
10
- import { createVec3, decompose, formatAttribute, fromRotationTranslationScale, getEuler, rad2deg } from '../utils';
9
+ import { createVec3, decompose, formatAttribute, fromRotationTranslationScale, getEuler, isNil, isObject, isUndefined, rad2deg } from '../utils';
11
10
  import { dirtifyToRoot } from '../services';
12
11
  import { MutationEvent } from '../dom/MutationEvent';
13
12
  import { Rectangle } from '../shapes';
@@ -93,11 +92,11 @@ function (_super) {
93
92
  interactive: (_c = _this.config.interactive) !== null && _c !== void 0 ? _c : true
94
93
  }), _this.config.style), _this.config.attrs);
95
94
 
96
- if (!isNil(_this.config.visible)) {
95
+ if (_this.config.visible != null) {
97
96
  _this.config.style.visibility = _this.config.visible === false ? 'hidden' : 'visible';
98
97
  }
99
98
 
100
- if (!isNil(_this.config.interactive)) {
99
+ if (_this.config.interactive != null) {
101
100
  _this.config.style.pointerEvents = _this.config.interactive === false ? 'none' : 'auto';
102
101
  }
103
102
 
@@ -193,7 +192,7 @@ function (_super) {
193
192
  return;
194
193
  }
195
194
 
196
- if (force || !isEqual(attributeValue, this.attributes[attributeName])) {
195
+ if (force || attributeValue != this.attributes[attributeName]) {
197
196
  this.internalSetAttribute(attributeName, attributeValue);
198
197
 
199
198
  _super.prototype.setAttribute.call(this, attributeName, attributeValue);
@@ -1,4 +1,4 @@
1
- import type { BaseStyleProps, PathCommand } from '../types';
1
+ import type { BaseStyleProps, PathCommand, ParsedBaseStyleProps } from '../types';
2
2
  import { DisplayObject } from './DisplayObject';
3
3
  import type { DisplayObjectConfig } from '../dom';
4
4
  import { Point } from '../shapes';
@@ -16,21 +16,21 @@ export interface PathSegment {
16
16
  endTangent: [number, number] | null;
17
17
  params: PathCommand;
18
18
  }
19
- export interface ParsedPathStyleProps {
20
- absolutePath: PathCommand[];
21
- hasArc: boolean;
22
- segments: PathSegment[];
23
- polygons: [number, number][][];
24
- polylines: [number, number][][];
25
- curve: PathCommand[];
26
- totalLength: number;
27
- curveSegments: number[][];
28
- zCommandIndexes: number[];
29
- rect: Rectangle;
19
+ export interface ParsedPathStyleProps extends ParsedBaseStyleProps {
20
+ path: {
21
+ absolutePath: PathCommand[];
22
+ hasArc: boolean;
23
+ segments: PathSegment[];
24
+ polygons: [number, number][][];
25
+ polylines: [number, number][][];
26
+ curve: PathCommand[];
27
+ totalLength: number;
28
+ curveSegments: number[][];
29
+ zCommandIndexes: number[];
30
+ rect: Rectangle;
31
+ };
30
32
  }
31
- export declare class Path extends DisplayObject<PathStyleProps, {
32
- path: ParsedPathStyleProps;
33
- }> {
33
+ export declare class Path extends DisplayObject<PathStyleProps, ParsedPathStyleProps> {
34
34
  constructor({ style, ...rest }?: DisplayObjectConfig<PathStyleProps>);
35
35
  getTotalLength(): number;
36
36
  /**
@@ -1,9 +1,9 @@
1
1
  import { __assign, __extends, __rest } from "tslib";
2
2
  import { Cubic as CubicUtil } from '@antv/g-math';
3
- import { isNil } from 'lodash-es';
4
3
  import { Shape } from '../types';
5
4
  import { DisplayObject } from './DisplayObject';
6
5
  import { Point } from '../shapes';
6
+ import { isNil } from '../utils';
7
7
 
8
8
  var Path =
9
9
  /** @class */
@@ -4,6 +4,13 @@ import type { DisplayObjectConfig } from '../dom';
4
4
  export interface PolygonStyleProps extends BaseStyleProps {
5
5
  points: [number, number][];
6
6
  }
7
- export declare class Polygon extends DisplayObject<PolygonStyleProps, ParsedBaseStyleProps> {
7
+ export interface ParsedPolygonStyleProps extends ParsedBaseStyleProps {
8
+ points: {
9
+ points: [number, number][];
10
+ segments: [number, number][];
11
+ totalLength: number;
12
+ };
13
+ }
14
+ export declare class Polygon extends DisplayObject<PolygonStyleProps, ParsedPolygonStyleProps> {
8
15
  constructor({ style, ...rest }?: DisplayObjectConfig<PolygonStyleProps>);
9
16
  }
@@ -5,12 +5,14 @@ import { Point } from '../shapes';
5
5
  export interface PolylineStyleProps extends BaseStyleProps {
6
6
  points: [number, number][];
7
7
  }
8
- export interface ParsedPolylineStyleProps {
9
- points: [number, number][];
10
- segments: [number, number][];
11
- totalLength: number;
8
+ export interface ParsedPolylineStyleProps extends ParsedBaseStyleProps {
9
+ points: {
10
+ points: [number, number][];
11
+ segments: [number, number][];
12
+ totalLength: number;
13
+ };
12
14
  }
13
- export declare class Polyline extends DisplayObject<PolylineStyleProps, ParsedBaseStyleProps> {
15
+ export declare class Polyline extends DisplayObject<PolylineStyleProps, ParsedPolylineStyleProps> {
14
16
  constructor({ style, ...rest }?: DisplayObjectConfig<PolylineStyleProps>);
15
17
  getTotalLength(): number;
16
18
  getPoint(ratio: number): Point;
@@ -146,7 +146,7 @@ function (_super) {
146
146
  }), clientX = _c.x, clientY = _c.y;
147
147
  return [4
148
148
  /*yield*/
149
- , this.defaultView.getRenderingService().hooks.pick.promise({
149
+ , this.defaultView.getRenderingService().hooks.pick.callPromise({
150
150
  topmost: true,
151
151
  position: {
152
152
  x: x,
@@ -200,7 +200,7 @@ function (_super) {
200
200
  }), clientX = _c.x, clientY = _c.y;
201
201
  return [4
202
202
  /*yield*/
203
- , this.defaultView.getRenderingService().hooks.pick.promise({
203
+ , this.defaultView.getRenderingService().hooks.pick.callPromise({
204
204
  topmost: false,
205
205
  position: {
206
206
  x: x,
package/es/dom/Element.js CHANGED
@@ -1,11 +1,10 @@
1
1
  import { __extends, __read, __spreadArray } from "tslib";
2
2
  import { GlobalContainer } from 'mana-syringe';
3
- import { isNil } from 'lodash-es';
4
3
  import { SceneGraphService } from '../services/SceneGraphService';
5
4
  import { Cullable, Geometry, Renderable, Transform, Sortable } from '../components';
6
5
  import { Node } from './Node';
7
6
  import { ElementEvent } from './interfaces';
8
- import { formatAttribute } from '../utils';
7
+ import { formatAttribute, isNil } from '../utils';
9
8
  import { MutationEvent } from './MutationEvent';
10
9
  var entityCounter = 0;
11
10
  /**
@@ -1,8 +1,8 @@
1
1
  import { __read, __spreadArray } from "tslib";
2
- import { isBoolean, isFunction, isObject } from 'lodash-es';
3
2
  import { EventEmitter } from 'eventemitter3';
4
3
  import { CustomEvent } from './CustomEvent';
5
4
  import { FederatedEvent } from './FederatedEvent';
5
+ import { isFunction, isBoolean, isObject } from '../utils';
6
6
  export var DELEGATION_SPLITTER = ':';
7
7
  /**
8
8
  * Objects that can receive events and may have listeners for them.
@@ -1,13 +1,15 @@
1
+ import type { FormattedTouch } from '../utils';
1
2
  import { FederatedEvent } from './FederatedEvent';
2
3
  /**
3
4
  * @see https://w3c.github.io/touch-events/#touchevent-interface
4
5
  */
5
6
  export declare class FederatedTouchEvent extends FederatedEvent<MouseEvent | PointerEvent | TouchEvent> implements TouchEvent {
7
+ pointerType: string;
6
8
  altKey: boolean;
7
9
  ctrlKey: boolean;
8
10
  metaKey: boolean;
9
11
  shiftKey: boolean;
10
- changedTouches: TouchList;
11
- targetTouches: TouchList;
12
- touches: TouchList;
12
+ changedTouches: FormattedTouch[];
13
+ targetTouches: FormattedTouch[];
14
+ touches: FormattedTouch[];
13
15
  }
@@ -11,7 +11,6 @@ export interface CullingStrategyContribution {
11
11
  * 2. other custom culling strategies, eg. frustum culling
12
12
  */
13
13
  export declare class CullingPlugin implements RenderingPlugin {
14
- static tag: string;
15
14
  private strategyProvider;
16
15
  apply(renderingService: RenderingService): void;
17
16
  }
@@ -13,11 +13,9 @@ var CullingPlugin =
13
13
  function () {
14
14
  function CullingPlugin() {}
15
15
 
16
- CullingPlugin_1 = CullingPlugin;
17
-
18
16
  CullingPlugin.prototype.apply = function (renderingService) {
19
17
  var strategies = this.strategyProvider.getContributions();
20
- renderingService.hooks.cull.tap(CullingPlugin_1.tag, function (object) {
18
+ renderingService.hooks.cull.tap(function (object) {
21
19
  if (object) {
22
20
  var cullable = object.cullable;
23
21
 
@@ -39,17 +37,14 @@ function () {
39
37
 
40
38
  return object;
41
39
  });
42
- renderingService.hooks.afterRender.tap(CullingPlugin_1.tag, function (object) {
40
+ renderingService.hooks.afterRender.tap(function (object) {
43
41
  object.cullable.visibilityPlaneMask = -1;
44
42
  });
45
43
  };
46
44
 
47
- var CullingPlugin_1;
48
- CullingPlugin.tag = 'CullingPlugin';
49
-
50
45
  __decorate([contrib(CullingStrategyContribution), __metadata("design:type", Object)], CullingPlugin.prototype, "strategyProvider", void 0);
51
46
 
52
- CullingPlugin = CullingPlugin_1 = __decorate([singleton({
47
+ CullingPlugin = __decorate([singleton({
53
48
  contrib: RenderingPluginContribution
54
49
  })], CullingPlugin);
55
50
  return CullingPlugin;
@@ -3,7 +3,7 @@ import type { RenderingService, RenderingPlugin } from '../services/RenderingSer
3
3
  * Filter dirty renderables and calculate the "dirty rectangle" which will be clear when frame began
4
4
  */
5
5
  export declare class DirtyCheckPlugin implements RenderingPlugin {
6
- static tag: string;
6
+ private canvasConfig;
7
7
  private renderingContext;
8
8
  apply(renderingService: RenderingService): void;
9
9
  }
@@ -1,5 +1,6 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import { inject, singleton } from 'mana-syringe';
3
+ import { CanvasConfig } from '../types';
3
4
  import { RenderingPluginContribution } from '../services/RenderingService';
4
5
  import { RenderingContext, RenderReason } from '../services/RenderingContext';
5
6
  /**
@@ -11,18 +12,19 @@ var DirtyCheckPlugin =
11
12
  function () {
12
13
  function DirtyCheckPlugin() {}
13
14
 
14
- DirtyCheckPlugin_1 = DirtyCheckPlugin;
15
-
16
15
  DirtyCheckPlugin.prototype.apply = function (renderingService) {
17
16
  var _this = this;
18
17
 
19
- renderingService.hooks.dirtycheck.tap(DirtyCheckPlugin_1.tag, function (object) {
18
+ renderingService.hooks.dirtycheck.tap(function (object) {
20
19
  if (object) {
21
- // const { enableDirtyRectangleRendering } = this.canvasConfig.renderer.getConfig();
20
+ var enableDirtyCheck = _this.canvasConfig.renderer.getConfig().enableDirtyCheck;
21
+
22
22
  var renderable = object.renderable;
23
23
 
24
- var isDirty = renderable.dirty || _this.renderingContext.renderReasons.has(RenderReason.CAMERA_CHANGED); // if (isDirty || !enableDirtyRectangleRendering) {
24
+ var isCameraDirty = _this.renderingContext.renderReasons.has(RenderReason.CAMERA_CHANGED);
25
25
 
26
+ var isRenderingContextDirty = _this.renderingContext.dirty;
27
+ var isDirty = renderable.dirty || isCameraDirty || (enableDirtyCheck ? false : isRenderingContextDirty);
26
28
 
27
29
  if (isDirty) {
28
30
  return object;
@@ -35,12 +37,11 @@ function () {
35
37
  });
36
38
  };
37
39
 
38
- var DirtyCheckPlugin_1;
39
- DirtyCheckPlugin.tag = 'DirtyCheckPlugin';
40
+ __decorate([inject(CanvasConfig), __metadata("design:type", Object)], DirtyCheckPlugin.prototype, "canvasConfig", void 0);
40
41
 
41
42
  __decorate([inject(RenderingContext), __metadata("design:type", Object)], DirtyCheckPlugin.prototype, "renderingContext", void 0);
42
43
 
43
- DirtyCheckPlugin = DirtyCheckPlugin_1 = __decorate([singleton({
44
+ DirtyCheckPlugin = __decorate([singleton({
44
45
  contrib: RenderingPluginContribution
45
46
  })], DirtyCheckPlugin);
46
47
  return DirtyCheckPlugin;
@@ -7,7 +7,6 @@ import { RenderingService } from '../services';
7
7
  * also provide some extra events such as `drag`
8
8
  */
9
9
  export declare class EventPlugin implements RenderingPlugin {
10
- static tag: string;
11
10
  private canvasConfig;
12
11
  private contextService;
13
12
  private renderingService;
@@ -18,6 +17,7 @@ export declare class EventPlugin implements RenderingPlugin {
18
17
  private rootWheelEvent;
19
18
  apply(renderingService: RenderingService): void;
20
19
  private onPointerMove;
20
+ private formatTouch;
21
21
  private bootstrapEvent;
22
22
  private normalizeWheelEvent;
23
23
  /**