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

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 (156) 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 +108 -4
  7. package/es/css/cssom/CSSNumericValue.js +908 -5
  8. package/es/css/cssom/CSSNumericValueType.d.ts +1 -1
  9. package/es/css/cssom/CSSNumericValueType.js +1 -1
  10. package/es/css/cssom/CSSTransformValue.d.ts +1 -1
  11. package/es/css/cssom/index.d.ts +0 -9
  12. package/es/css/cssom/index.js +1 -10
  13. package/es/css/parser/color.js +1 -1
  14. package/es/css/parser/dimension.js +1 -2
  15. package/es/css/parser/numeric.js +1 -1
  16. package/es/css/parser/path.d.ts +2 -2
  17. package/es/css/parser/path.js +1 -1
  18. package/es/css/parser/points.js +1 -1
  19. package/es/css/parser/transform-origin.js +1 -1
  20. package/es/css/properties/CSSPropertyPath.d.ts +14 -2
  21. package/es/css/properties/CSSPropertyTextTransform.d.ts +2 -2
  22. package/es/css/properties/CSSPropertyTransform.js +1 -2
  23. package/es/display-objects/DisplayObject.js +4 -5
  24. package/es/display-objects/Path.d.ts +15 -15
  25. package/es/display-objects/Path.js +1 -1
  26. package/es/display-objects/Polygon.d.ts +8 -1
  27. package/es/display-objects/Polyline.d.ts +7 -5
  28. package/es/dom/Document.js +2 -2
  29. package/es/dom/Element.js +1 -2
  30. package/es/dom/EventTarget.js +1 -1
  31. package/es/dom/FederatedTouchEvent.d.ts +5 -3
  32. package/es/plugins/CullingPlugin.d.ts +0 -1
  33. package/es/plugins/CullingPlugin.js +3 -8
  34. package/es/plugins/DirtyCheckPlugin.d.ts +1 -1
  35. package/es/plugins/DirtyCheckPlugin.js +9 -8
  36. package/es/plugins/EventPlugin.d.ts +1 -1
  37. package/es/plugins/EventPlugin.js +163 -148
  38. package/es/plugins/PrepareRendererPlugin.d.ts +0 -1
  39. package/es/plugins/PrepareRendererPlugin.js +15 -16
  40. package/es/services/EventService.d.ts +8 -0
  41. package/es/services/EventService.js +274 -20
  42. package/es/services/RenderingService.d.ts +17 -16
  43. package/es/services/RenderingService.js +18 -17
  44. package/es/services/SceneGraphService.js +1 -1
  45. package/es/services/aabb/PathUpdater.d.ts +3 -3
  46. package/es/services/aabb/PolylineUpdater.d.ts +3 -3
  47. package/es/services/aabb/RectUpdater.js +1 -1
  48. package/es/types.d.ts +5 -3
  49. package/es/utils/assert.d.ts +6 -0
  50. package/es/utils/assert.js +18 -0
  51. package/es/utils/event.d.ts +18 -16
  52. package/es/utils/hooks.d.ts +280 -0
  53. package/es/utils/hooks.js +753 -0
  54. package/es/utils/index.d.ts +1 -0
  55. package/es/utils/index.js +2 -1
  56. package/es/utils/math.d.ts +1 -0
  57. package/es/utils/math.js +13 -2
  58. package/es/utils/string.d.ts +1 -0
  59. package/es/utils/string.js +8 -0
  60. package/es/utils/text.js +2 -1
  61. package/lib/AbstractRenderer.js +5 -0
  62. package/lib/camera/Camera.js +4 -4
  63. package/lib/css/cssom/CSSKeywordValue.d.ts +1 -1
  64. package/lib/css/cssom/CSSNumericSumValue.d.ts +1 -1
  65. package/lib/css/cssom/CSSNumericValue.d.ts +108 -4
  66. package/lib/css/cssom/CSSNumericValue.js +965 -52
  67. package/lib/css/cssom/CSSNumericValueType.d.ts +1 -1
  68. package/lib/css/cssom/CSSNumericValueType.js +59 -59
  69. package/lib/css/cssom/CSSTransformValue.d.ts +1 -1
  70. package/lib/css/cssom/index.d.ts +0 -9
  71. package/lib/css/cssom/index.js +0 -117
  72. package/lib/css/parser/color.js +5 -5
  73. package/lib/css/parser/dimension.js +1 -3
  74. package/lib/css/parser/numeric.js +3 -3
  75. package/lib/css/parser/path.d.ts +2 -2
  76. package/lib/css/parser/path.js +4 -4
  77. package/lib/css/parser/points.js +2 -2
  78. package/lib/css/parser/transform-origin.js +2 -2
  79. package/lib/css/properties/CSSPropertyPath.d.ts +14 -2
  80. package/lib/css/properties/CSSPropertyTextTransform.d.ts +2 -2
  81. package/lib/css/properties/CSSPropertyTransform.js +0 -2
  82. package/lib/display-objects/DisplayObject.js +7 -9
  83. package/lib/display-objects/Path.d.ts +15 -15
  84. package/lib/display-objects/Path.js +3 -3
  85. package/lib/display-objects/Polygon.d.ts +8 -1
  86. package/lib/display-objects/Polyline.d.ts +7 -5
  87. package/lib/dom/Document.js +2 -2
  88. package/lib/dom/Element.js +1 -3
  89. package/lib/dom/EventTarget.js +9 -9
  90. package/lib/dom/FederatedTouchEvent.d.ts +5 -3
  91. package/lib/plugins/CullingPlugin.d.ts +0 -1
  92. package/lib/plugins/CullingPlugin.js +3 -7
  93. package/lib/plugins/DirtyCheckPlugin.d.ts +1 -1
  94. package/lib/plugins/DirtyCheckPlugin.js +10 -8
  95. package/lib/plugins/EventPlugin.d.ts +1 -1
  96. package/lib/plugins/EventPlugin.js +172 -156
  97. package/lib/plugins/PrepareRendererPlugin.d.ts +0 -1
  98. package/lib/plugins/PrepareRendererPlugin.js +14 -14
  99. package/lib/services/EventService.d.ts +8 -0
  100. package/lib/services/EventService.js +274 -19
  101. package/lib/services/RenderingService.d.ts +17 -16
  102. package/lib/services/RenderingService.js +19 -18
  103. package/lib/services/SceneGraphService.js +3 -3
  104. package/lib/services/aabb/PathUpdater.d.ts +3 -3
  105. package/lib/services/aabb/PolylineUpdater.d.ts +3 -3
  106. package/lib/services/aabb/RectUpdater.js +3 -3
  107. package/lib/types.d.ts +5 -3
  108. package/lib/utils/assert.d.ts +6 -0
  109. package/lib/utils/assert.js +30 -0
  110. package/lib/utils/event.d.ts +18 -16
  111. package/lib/utils/hooks.d.ts +280 -0
  112. package/lib/utils/hooks.js +759 -0
  113. package/lib/utils/index.d.ts +1 -0
  114. package/lib/utils/index.js +13 -0
  115. package/lib/utils/math.d.ts +1 -0
  116. package/lib/utils/math.js +17 -4
  117. package/lib/utils/string.d.ts +1 -0
  118. package/lib/utils/string.js +11 -0
  119. package/lib/utils/text.js +5 -3
  120. package/package.json +4 -7
  121. package/es/css/cssom/CSSMathInvert.d.ts +0 -14
  122. package/es/css/cssom/CSSMathInvert.js +0 -84
  123. package/es/css/cssom/CSSMathMax.d.ts +0 -17
  124. package/es/css/cssom/CSSMathMax.js +0 -118
  125. package/es/css/cssom/CSSMathMin.d.ts +0 -17
  126. package/es/css/cssom/CSSMathMin.js +0 -119
  127. package/es/css/cssom/CSSMathNegate.d.ts +0 -14
  128. package/es/css/cssom/CSSMathNegate.js +0 -80
  129. package/es/css/cssom/CSSMathProduct.d.ts +0 -16
  130. package/es/css/cssom/CSSMathProduct.js +0 -109
  131. package/es/css/cssom/CSSMathSum.d.ts +0 -17
  132. package/es/css/cssom/CSSMathSum.js +0 -117
  133. package/es/css/cssom/CSSMathValue.d.ts +0 -11
  134. package/es/css/cssom/CSSMathValue.js +0 -27
  135. package/es/css/cssom/CSSMathVariadic.d.ts +0 -9
  136. package/es/css/cssom/CSSMathVariadic.js +0 -44
  137. package/es/css/cssom/CSSUnitValue.d.ts +0 -33
  138. package/es/css/cssom/CSSUnitValue.js +0 -252
  139. package/lib/css/cssom/CSSMathInvert.d.ts +0 -14
  140. package/lib/css/cssom/CSSMathInvert.js +0 -94
  141. package/lib/css/cssom/CSSMathMax.d.ts +0 -17
  142. package/lib/css/cssom/CSSMathMax.js +0 -128
  143. package/lib/css/cssom/CSSMathMin.d.ts +0 -17
  144. package/lib/css/cssom/CSSMathMin.js +0 -128
  145. package/lib/css/cssom/CSSMathNegate.d.ts +0 -14
  146. package/lib/css/cssom/CSSMathNegate.js +0 -89
  147. package/lib/css/cssom/CSSMathProduct.d.ts +0 -16
  148. package/lib/css/cssom/CSSMathProduct.js +0 -119
  149. package/lib/css/cssom/CSSMathSum.d.ts +0 -17
  150. package/lib/css/cssom/CSSMathSum.js +0 -129
  151. package/lib/css/cssom/CSSMathValue.d.ts +0 -11
  152. package/lib/css/cssom/CSSMathValue.js +0 -35
  153. package/lib/css/cssom/CSSMathVariadic.d.ts +0 -9
  154. package/lib/css/cssom/CSSMathVariadic.js +0 -55
  155. package/lib/css/cssom/CSSUnitValue.d.ts +0 -33
  156. package/lib/css/cssom/CSSUnitValue.js +0 -267
@@ -6,6 +6,11 @@ function () {
6
6
  function AbstractRenderer(config) {
7
7
  this.plugins = [];
8
8
  this.config = __assign({
9
+ /**
10
+ * only dirty object will cause re-render
11
+ */
12
+ enableDirtyCheck: true,
13
+
9
14
  /**
10
15
  * enable auto rendering by default
11
16
  */
@@ -1,11 +1,11 @@
1
1
  import { __extends } from "tslib";
2
- import { isNumber, isString } from 'lodash-es';
3
2
  import { Syringe } from 'mana-syringe';
4
3
  import { EventEmitter } from 'eventemitter3';
5
4
  import { mat3, mat4, quat, vec3, vec4 } from 'gl-matrix';
6
5
  import { Frustum } from '../shapes';
7
6
  import { createVec3, getAngle, makePerspective } from '../utils/math';
8
- import { parseEasingFunction } from '../utils/animation'; // import { DisplayObject } from '../display-objects';
7
+ import { parseEasingFunction } from '../utils/animation';
8
+ import { isNumber, isString } from '../utils'; // import { DisplayObject } from '../display-objects';
9
9
 
10
10
  export var DefaultCamera = Syringe.defineToken('DefaultCamera');
11
11
  export var CameraType;
@@ -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
  /**
4
4
  * CSSKeywordValue represents CSS Values that are specified as keywords
@@ -1,4 +1,4 @@
1
- import type { UnitType } from '.';
1
+ import type { UnitType } from './types';
2
2
  export declare type UnitMap = Record<UnitType, number>;
3
3
  export interface Term {
4
4
  value: number;
@@ -1,7 +1,7 @@
1
- import type { CSSNumericSumValue } from './CSSNumericSumValue';
2
- import type { CSSNumericValueType } from './CSSNumericValueType';
3
- import { CSSStyleValue } from './CSSStyleValue';
4
- import { UnitType, CSSStyleValueType, CSSUnitValue, CSSMathSum } from '.';
1
+ import type { CSSNumericSumValue, UnitMap } from './CSSNumericSumValue';
2
+ import { CSSNumericValueType } from './CSSNumericValueType';
3
+ import { CSSStyleValue, CSSStyleValueType } from './CSSStyleValue';
4
+ import { Nested, ParenLess, UnitType } from './types';
5
5
  export declare type CSSNumberish = number | CSSNumericValue;
6
6
  declare type CSSNumericBaseType = 'length' | 'angle' | 'time' | 'frequency' | 'resolution' | 'flex' | 'percent';
7
7
  interface CSSNumericType {
@@ -72,4 +72,108 @@ export declare abstract class CSSNumericValue extends CSSStyleValue {
72
72
  negate(): CSSNumericValue;
73
73
  invert(): CSSNumericValue;
74
74
  }
75
+ /**
76
+ * Represents numeric values that can be expressed as a single number plus a
77
+ * unit (or a naked number or percentage).
78
+ * @see https://drafts.css-houdini.org/css-typed-om/#cssunitvalue
79
+ */
80
+ export declare class CSSUnitValue extends CSSNumericValue {
81
+ static toCanonicalUnit(unit: UnitType): UnitType.kUnknown | UnitType.kNumber | UnitType.kPixels | UnitType.kDegrees | UnitType.kSeconds | UnitType.kHertz | UnitType.kDotsPerPixel;
82
+ static toCanonicalUnitIfPossible(unit: UnitType): UnitType;
83
+ static formatInfinityOrNaN(number: number, suffix?: string): string;
84
+ static formatNumber(number: number, suffix?: string): string;
85
+ unit: UnitType;
86
+ value: number;
87
+ constructor(value: number, unitOrName?: UnitType | string);
88
+ clone(): CSSUnitValue;
89
+ convertTo(target_unit: UnitType): CSSUnitValue;
90
+ equals(other: CSSNumericValue): boolean;
91
+ getType(): CSSStyleValueType;
92
+ sumValue(): CSSNumericSumValue;
93
+ negate(): CSSUnitValue;
94
+ invert(): CSSUnitValue | CSSMathInvert;
95
+ buildCSSText(n: Nested, p: ParenLess, result: string): string;
96
+ }
97
+ /**
98
+ * The CSSMathValue interface of the CSS_Object_Model a base class for classes representing complex numeric values.
99
+ *
100
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSMathValue
101
+ * @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_math_value.idl
102
+ */
103
+ export declare abstract class CSSMathValue extends CSSNumericValue {
104
+ abstract operator: string;
105
+ isUnitValue(): boolean;
106
+ }
107
+ export declare class CSSMathInvert extends CSSMathValue {
108
+ private value;
109
+ static create(value: CSSNumericValue): CSSMathInvert;
110
+ constructor(value: CSSNumericValue, type: CSSNumericValueType);
111
+ operator: string;
112
+ clone(): CSSMathInvert;
113
+ getType(): CSSStyleValueType;
114
+ equals(other: CSSNumericValue): any;
115
+ sumValue(): CSSNumericSumValue;
116
+ buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
117
+ }
118
+ export declare class CSSMathNegate extends CSSMathValue {
119
+ value: CSSNumericValue;
120
+ static create(value: CSSNumericValue): CSSMathNegate;
121
+ constructor(value: CSSNumericValue, type: CSSNumericValueType);
122
+ operator: string;
123
+ clone(): CSSMathNegate;
124
+ getType(): CSSStyleValueType;
125
+ equals(other: CSSNumericValue): any;
126
+ sumValue(): CSSNumericSumValue;
127
+ buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
128
+ }
129
+ export declare function typeCheck(values: CSSNumericValue[], op: Function, error: boolean): CSSNumericValueType;
130
+ export declare abstract class CSSMathVariadic extends CSSMathValue {
131
+ values: CSSNumericValue[];
132
+ constructor(values: CSSNumericValue[], type: CSSNumericValueType);
133
+ numericValues(): CSSNumericValue[];
134
+ equals(other: CSSNumericValue): any;
135
+ }
136
+ export declare class CSSMathMin extends CSSMathVariadic {
137
+ static create(values: CSSNumericValue[]): CSSMathMin;
138
+ operator: string;
139
+ clone(): CSSMathMin;
140
+ getType(): CSSStyleValueType;
141
+ sumValue(): CSSNumericSumValue;
142
+ buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
143
+ }
144
+ export declare class CSSMathMax extends CSSMathVariadic {
145
+ static create(values: CSSNumericValue[]): CSSMathMax;
146
+ operator: string;
147
+ clone(): CSSMathMax;
148
+ getType(): CSSStyleValueType;
149
+ sumValue(): CSSNumericSumValue;
150
+ buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
151
+ }
152
+ /**
153
+ * Represents the sum of one or more CSSNumericValues.
154
+ * @see https://drafts.css-houdini.org/css-typed-om/#cssmathsum
155
+ */
156
+ export declare class CSSMathSum extends CSSMathVariadic {
157
+ static create(values: CSSNumericValue[]): CSSMathSum;
158
+ static numericTypeFromUnitMap(units: UnitMap): CSSNumericValueType;
159
+ static canCreateNumericTypeFromSumValue(sum: CSSNumericSumValue): boolean;
160
+ operator: string;
161
+ clone(): CSSMathSum;
162
+ getType(): CSSStyleValueType;
163
+ sumValue(): CSSNumericSumValue;
164
+ buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
165
+ }
166
+ /**
167
+ * Represents the product of one or more CSSNumericValues.
168
+ * @see https://drafts.css-houdini.org/css-typed-om/#cssmathproduct
169
+ */
170
+ export declare class CSSMathProduct extends CSSMathVariadic {
171
+ static create(values: CSSNumericValue[]): CSSMathProduct;
172
+ static multiplyUnitMaps(a: UnitMap, b: UnitMap): UnitMap;
173
+ operator: string;
174
+ clone(): CSSMathProduct;
175
+ getType(): CSSStyleValueType;
176
+ sumValue(): CSSNumericSumValue;
177
+ buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
178
+ }
75
179
  export {};