@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
@@ -1,4 +1,4 @@
1
- import { UnitType } from '.';
1
+ import { UnitType } from './types';
2
2
  export declare enum BaseType {
3
3
  kLength = 0,
4
4
  kAngle = 1,
@@ -9,7 +9,7 @@ exports.unitTypeToBaseType = unitTypeToBaseType;
9
9
 
10
10
  var _utils = require("../../utils");
11
11
 
12
- var _ = require(".");
12
+ var _types = require("./types");
13
13
 
14
14
  // https://drafts.css-houdini.org/css-typed-om/#enumdef-cssnumericbasetype
15
15
  var BaseType;
@@ -27,76 +27,76 @@ exports.BaseType = BaseType;
27
27
  })(BaseType || (exports.BaseType = BaseType = {}));
28
28
 
29
29
  function unitTypeToBaseType(unit) {
30
- (0, _utils.DCHECK_NE)(unit, _.UnitType.kNumber);
30
+ (0, _utils.DCHECK_NE)(unit, _types.UnitType.kNumber);
31
31
 
32
32
  switch (unit) {
33
- case _.UnitType.kEms:
34
- case _.UnitType.kExs:
35
- case _.UnitType.kPixels:
36
- case _.UnitType.kCentimeters:
37
- case _.UnitType.kMillimeters:
38
- case _.UnitType.kQuarterMillimeters:
39
- case _.UnitType.kInches:
40
- case _.UnitType.kPoints:
41
- case _.UnitType.kPicas:
42
- case _.UnitType.kUserUnits:
43
- case _.UnitType.kViewportWidth:
44
- case _.UnitType.kViewportHeight:
45
- case _.UnitType.kViewportInlineSize:
46
- case _.UnitType.kViewportBlockSize:
47
- case _.UnitType.kViewportMin:
48
- case _.UnitType.kViewportMax:
49
- case _.UnitType.kSmallViewportWidth:
50
- case _.UnitType.kSmallViewportHeight:
51
- case _.UnitType.kSmallViewportInlineSize:
52
- case _.UnitType.kSmallViewportBlockSize:
53
- case _.UnitType.kSmallViewportMin:
54
- case _.UnitType.kSmallViewportMax:
55
- case _.UnitType.kLargeViewportWidth:
56
- case _.UnitType.kLargeViewportHeight:
57
- case _.UnitType.kLargeViewportInlineSize:
58
- case _.UnitType.kLargeViewportBlockSize:
59
- case _.UnitType.kLargeViewportMin:
60
- case _.UnitType.kLargeViewportMax:
61
- case _.UnitType.kDynamicViewportWidth:
62
- case _.UnitType.kDynamicViewportHeight:
63
- case _.UnitType.kDynamicViewportInlineSize:
64
- case _.UnitType.kDynamicViewportBlockSize:
65
- case _.UnitType.kDynamicViewportMin:
66
- case _.UnitType.kDynamicViewportMax:
67
- case _.UnitType.kContainerWidth:
68
- case _.UnitType.kContainerHeight:
69
- case _.UnitType.kContainerInlineSize:
70
- case _.UnitType.kContainerBlockSize:
71
- case _.UnitType.kContainerMin:
72
- case _.UnitType.kContainerMax:
73
- case _.UnitType.kRems:
74
- case _.UnitType.kChs:
33
+ case _types.UnitType.kEms:
34
+ case _types.UnitType.kExs:
35
+ case _types.UnitType.kPixels:
36
+ case _types.UnitType.kCentimeters:
37
+ case _types.UnitType.kMillimeters:
38
+ case _types.UnitType.kQuarterMillimeters:
39
+ case _types.UnitType.kInches:
40
+ case _types.UnitType.kPoints:
41
+ case _types.UnitType.kPicas:
42
+ case _types.UnitType.kUserUnits:
43
+ case _types.UnitType.kViewportWidth:
44
+ case _types.UnitType.kViewportHeight:
45
+ case _types.UnitType.kViewportInlineSize:
46
+ case _types.UnitType.kViewportBlockSize:
47
+ case _types.UnitType.kViewportMin:
48
+ case _types.UnitType.kViewportMax:
49
+ case _types.UnitType.kSmallViewportWidth:
50
+ case _types.UnitType.kSmallViewportHeight:
51
+ case _types.UnitType.kSmallViewportInlineSize:
52
+ case _types.UnitType.kSmallViewportBlockSize:
53
+ case _types.UnitType.kSmallViewportMin:
54
+ case _types.UnitType.kSmallViewportMax:
55
+ case _types.UnitType.kLargeViewportWidth:
56
+ case _types.UnitType.kLargeViewportHeight:
57
+ case _types.UnitType.kLargeViewportInlineSize:
58
+ case _types.UnitType.kLargeViewportBlockSize:
59
+ case _types.UnitType.kLargeViewportMin:
60
+ case _types.UnitType.kLargeViewportMax:
61
+ case _types.UnitType.kDynamicViewportWidth:
62
+ case _types.UnitType.kDynamicViewportHeight:
63
+ case _types.UnitType.kDynamicViewportInlineSize:
64
+ case _types.UnitType.kDynamicViewportBlockSize:
65
+ case _types.UnitType.kDynamicViewportMin:
66
+ case _types.UnitType.kDynamicViewportMax:
67
+ case _types.UnitType.kContainerWidth:
68
+ case _types.UnitType.kContainerHeight:
69
+ case _types.UnitType.kContainerInlineSize:
70
+ case _types.UnitType.kContainerBlockSize:
71
+ case _types.UnitType.kContainerMin:
72
+ case _types.UnitType.kContainerMax:
73
+ case _types.UnitType.kRems:
74
+ case _types.UnitType.kChs:
75
75
  return BaseType.kLength;
76
76
 
77
- case _.UnitType.kMilliseconds:
78
- case _.UnitType.kSeconds:
77
+ case _types.UnitType.kMilliseconds:
78
+ case _types.UnitType.kSeconds:
79
79
  return BaseType.kTime;
80
80
 
81
- case _.UnitType.kDegrees:
82
- case _.UnitType.kRadians:
83
- case _.UnitType.kGradians:
84
- case _.UnitType.kTurns:
81
+ case _types.UnitType.kDegrees:
82
+ case _types.UnitType.kRadians:
83
+ case _types.UnitType.kGradians:
84
+ case _types.UnitType.kTurns:
85
85
  return BaseType.kAngle;
86
86
 
87
- case _.UnitType.kHertz:
88
- case _.UnitType.kKilohertz:
87
+ case _types.UnitType.kHertz:
88
+ case _types.UnitType.kKilohertz:
89
89
  return BaseType.kFrequency;
90
90
 
91
- case _.UnitType.kDotsPerPixel:
92
- case _.UnitType.kDotsPerInch:
93
- case _.UnitType.kDotsPerCentimeter:
91
+ case _types.UnitType.kDotsPerPixel:
92
+ case _types.UnitType.kDotsPerInch:
93
+ case _types.UnitType.kDotsPerCentimeter:
94
94
  return BaseType.kResolution;
95
95
 
96
- case _.UnitType.kFraction:
96
+ case _types.UnitType.kFraction:
97
97
  return BaseType.kFlex;
98
98
 
99
- case _.UnitType.kPercentage:
99
+ case _types.UnitType.kPercentage:
100
100
  return BaseType.kPercent;
101
101
 
102
102
  default:
@@ -139,7 +139,7 @@ var CSSNumericValueType =
139
139
  function () {
140
140
  function CSSNumericValueType(unit, exponent) {
141
141
  if (unit === void 0) {
142
- unit = _.UnitType.kNumber;
142
+ unit = _types.UnitType.kNumber;
143
143
  }
144
144
 
145
145
  if (exponent === void 0) {
@@ -152,7 +152,7 @@ function () {
152
152
  this.hasPercentHint = false;
153
153
  this.exponents = new Array(BaseType.kNumBaseTypes).fill(0);
154
154
 
155
- if (unit !== _.UnitType.kNumber) {
155
+ if (unit !== _types.UnitType.kNumber) {
156
156
  this.setExponent(unitTypeToBaseType(unit), exponent);
157
157
  }
158
158
  }
@@ -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,14 +10,6 @@ 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
15
  export * from './CSSNumericValueType';
@@ -26,4 +18,3 @@ export * from './CSSGradientValue';
26
18
  export * from './CSSStyleValue';
27
19
  export * from './CSSTransformValue';
28
20
  export * from './CSSTranslate';
29
- export * from './CSSUnitValue';
@@ -56,110 +56,6 @@ Object.keys(_CSSMathOperator).forEach(function (key) {
56
56
  });
57
57
  });
58
58
 
59
- var _CSSMathInvert = require("./CSSMathInvert");
60
-
61
- Object.keys(_CSSMathInvert).forEach(function (key) {
62
- if (key === "default" || key === "__esModule") return;
63
- if (key in exports && exports[key] === _CSSMathInvert[key]) return;
64
- Object.defineProperty(exports, key, {
65
- enumerable: true,
66
- get: function get() {
67
- return _CSSMathInvert[key];
68
- }
69
- });
70
- });
71
-
72
- var _CSSMathMax = require("./CSSMathMax");
73
-
74
- Object.keys(_CSSMathMax).forEach(function (key) {
75
- if (key === "default" || key === "__esModule") return;
76
- if (key in exports && exports[key] === _CSSMathMax[key]) return;
77
- Object.defineProperty(exports, key, {
78
- enumerable: true,
79
- get: function get() {
80
- return _CSSMathMax[key];
81
- }
82
- });
83
- });
84
-
85
- var _CSSMathMin = require("./CSSMathMin");
86
-
87
- Object.keys(_CSSMathMin).forEach(function (key) {
88
- if (key === "default" || key === "__esModule") return;
89
- if (key in exports && exports[key] === _CSSMathMin[key]) return;
90
- Object.defineProperty(exports, key, {
91
- enumerable: true,
92
- get: function get() {
93
- return _CSSMathMin[key];
94
- }
95
- });
96
- });
97
-
98
- var _CSSMathNegate = require("./CSSMathNegate");
99
-
100
- Object.keys(_CSSMathNegate).forEach(function (key) {
101
- if (key === "default" || key === "__esModule") return;
102
- if (key in exports && exports[key] === _CSSMathNegate[key]) return;
103
- Object.defineProperty(exports, key, {
104
- enumerable: true,
105
- get: function get() {
106
- return _CSSMathNegate[key];
107
- }
108
- });
109
- });
110
-
111
- var _CSSMathProduct = require("./CSSMathProduct");
112
-
113
- Object.keys(_CSSMathProduct).forEach(function (key) {
114
- if (key === "default" || key === "__esModule") return;
115
- if (key in exports && exports[key] === _CSSMathProduct[key]) return;
116
- Object.defineProperty(exports, key, {
117
- enumerable: true,
118
- get: function get() {
119
- return _CSSMathProduct[key];
120
- }
121
- });
122
- });
123
-
124
- var _CSSMathSum = require("./CSSMathSum");
125
-
126
- Object.keys(_CSSMathSum).forEach(function (key) {
127
- if (key === "default" || key === "__esModule") return;
128
- if (key in exports && exports[key] === _CSSMathSum[key]) return;
129
- Object.defineProperty(exports, key, {
130
- enumerable: true,
131
- get: function get() {
132
- return _CSSMathSum[key];
133
- }
134
- });
135
- });
136
-
137
- var _CSSMathValue = require("./CSSMathValue");
138
-
139
- Object.keys(_CSSMathValue).forEach(function (key) {
140
- if (key === "default" || key === "__esModule") return;
141
- if (key in exports && exports[key] === _CSSMathValue[key]) return;
142
- Object.defineProperty(exports, key, {
143
- enumerable: true,
144
- get: function get() {
145
- return _CSSMathValue[key];
146
- }
147
- });
148
- });
149
-
150
- var _CSSMathVariadic = require("./CSSMathVariadic");
151
-
152
- Object.keys(_CSSMathVariadic).forEach(function (key) {
153
- if (key === "default" || key === "__esModule") return;
154
- if (key in exports && exports[key] === _CSSMathVariadic[key]) return;
155
- Object.defineProperty(exports, key, {
156
- enumerable: true,
157
- get: function get() {
158
- return _CSSMathVariadic[key];
159
- }
160
- });
161
- });
162
-
163
59
  var _CSSNumericSumValue = require("./CSSNumericSumValue");
164
60
 
165
61
  Object.keys(_CSSNumericSumValue).forEach(function (key) {
@@ -262,17 +158,4 @@ Object.keys(_CSSTranslate).forEach(function (key) {
262
158
  return _CSSTranslate[key];
263
159
  }
264
160
  });
265
- });
266
-
267
- var _CSSUnitValue = require("./CSSUnitValue");
268
-
269
- Object.keys(_CSSUnitValue).forEach(function (key) {
270
- if (key === "default" || key === "__esModule") return;
271
- if (key in exports && exports[key] === _CSSUnitValue[key]) return;
272
- Object.defineProperty(exports, key, {
273
- enumerable: true,
274
- get: function get() {
275
- return _CSSUnitValue[key];
276
- }
277
- });
278
161
  });
@@ -12,10 +12,10 @@ var _tslib = require("tslib");
12
12
 
13
13
  var d3 = _interopRequireWildcard(require("d3-color"));
14
14
 
15
- var _lodashEs = require("lodash-es");
16
-
17
15
  var _cssom = require("../cssom");
18
16
 
17
+ var _utils = require("../../utils");
18
+
19
19
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
20
 
21
21
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -54,7 +54,7 @@ function parseColor(colorStr) {
54
54
  var parsedRadialGradient = parseRadialGradient(colorStr);
55
55
 
56
56
  if (parsedRadialGradient) {
57
- if ((0, _lodashEs.isString)(parsedRadialGradient)) {
57
+ if ((0, _utils.isString)(parsedRadialGradient)) {
58
58
  colorStr = parsedRadialGradient;
59
59
  } else {
60
60
  return new _cssom.CSSGradientValue(_cssom.GradientPatternType.RadialGradient, parsedRadialGradient);
@@ -102,11 +102,11 @@ function mergeColors(left, right) {
102
102
 
103
103
  if (rgba[3]) {
104
104
  for (var i = 0; i < 3; i++) {
105
- rgba[i] = Math.round((0, _lodashEs.clamp)(rgba[i], 0, 255));
105
+ rgba[i] = Math.round((0, _utils.clamp)(rgba[i], 0, 255));
106
106
  }
107
107
  }
108
108
 
109
- rgba[3] = (0, _lodashEs.clamp)(rgba[3], 0, 1);
109
+ rgba[3] = (0, _utils.clamp)(rgba[3], 0, 1);
110
110
  return "rgba(".concat(rgba.join(','), ")");
111
111
  }];
112
112
  }
@@ -12,8 +12,6 @@ exports.parseDimension = parseDimension;
12
12
  exports.parseDimensionArray = parseDimensionArray;
13
13
  exports.parserPercentage = exports.parseLengthOrPercentage = exports.parseLength = void 0;
14
14
 
15
- var _lodashEs = require("lodash-es");
16
-
17
15
  var _shapes = require("../../shapes");
18
16
 
19
17
  var _utils = require("../../utils");
@@ -124,7 +122,7 @@ function convertAngleUnit(value) {
124
122
  }
125
123
 
126
124
  function parseDimensionArray(string) {
127
- if ((0, _lodashEs.isString)(string)) {
125
+ if ((0, _utils.isString)(string)) {
128
126
  // "1px 2px 3px"
129
127
  return string.split(' ').map(function (segment) {
130
128
  return parseLengthOrPercentage(segment);
@@ -10,7 +10,7 @@ exports.numberToString = numberToString;
10
10
  exports.parseNumber = parseNumber;
11
11
  exports.parseNumberList = parseNumberList;
12
12
 
13
- var _lodashEs = require("lodash-es");
13
+ var _utils = require("../../utils");
14
14
 
15
15
  var _cssom = require("../cssom");
16
16
 
@@ -47,7 +47,7 @@ function parseNumber(string) {
47
47
 
48
48
 
49
49
  function parseNumberList(string) {
50
- if ((0, _lodashEs.isString)(string)) {
50
+ if ((0, _utils.isString)(string)) {
51
51
  return string.split(' ').map(parseNumber);
52
52
  } else {
53
53
  return string.map(parseNumber);
@@ -61,7 +61,7 @@ function mergeNumbers(left, right) {
61
61
  function clampedMergeNumbers(min, max) {
62
62
  return function (left, right) {
63
63
  return [left.value, right.value, function (x) {
64
- return numberToString((0, _lodashEs.clamp)(x, min, max));
64
+ return numberToString((0, _utils.clamp)(x, min, max));
65
65
  }];
66
66
  };
67
67
  }
@@ -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[]];
@@ -8,7 +8,7 @@ exports.parsePath = parsePath;
8
8
 
9
9
  var _tslib = require("tslib");
10
10
 
11
- var _pathUtil = require("@antv/path-util");
11
+ var _util = require("@antv/util");
12
12
 
13
13
  var _gMath = require("@antv/g-math");
14
14
 
@@ -17,7 +17,7 @@ var _path = require("../../utils/path");
17
17
  var _Rectangle = require("../../shapes/Rectangle");
18
18
 
19
19
  function parsePath(path) {
20
- var absolutePath = (0, _pathUtil.path2Absolute)(path);
20
+ var absolutePath = (0, _util.path2Absolute)(path);
21
21
  var hasArc = hasArcOrBezier(absolutePath);
22
22
  var clonedAbsolutePath = absolutePath.slice();
23
23
 
@@ -27,11 +27,11 @@ function parsePath(path) {
27
27
  // @see http://thednp.github.io/kute.js/svgCubicMorph.html
28
28
 
29
29
 
30
- var _b = (0, _tslib.__read)((0, _pathUtil.path2Curve)(clonedAbsolutePath, true), 2),
30
+ var _b = (0, _tslib.__read)((0, _util.path2Curve)(clonedAbsolutePath, true), 2),
31
31
  curve = _b[0],
32
32
  zCommandIndexes = _b[1];
33
33
 
34
- var segments = (0, _pathUtil.path2Segments)(clonedAbsolutePath);
34
+ var segments = (0, _util.path2Segments)(clonedAbsolutePath);
35
35
 
36
36
  var _c = calcLength(curve),
37
37
  totalLength = _c.totalLength,
@@ -7,10 +7,10 @@ exports.parsePoints = parsePoints;
7
7
 
8
8
  var _gMath = require("@antv/g-math");
9
9
 
10
- var _lodashEs = require("lodash-es");
10
+ var _utils = require("../../utils");
11
11
 
12
12
  function parsePoints(points) {
13
- if ((0, _lodashEs.isString)(points)) {
13
+ if ((0, _utils.isString)(points)) {
14
14
  return null;
15
15
  }
16
16
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.parseTransformOrigin = parseTransformOrigin;
7
7
 
8
- var _lodashEs = require("lodash-es");
8
+ var _utils = require("../../utils");
9
9
 
10
10
  var _cssom = require("../cssom");
11
11
 
@@ -16,7 +16,7 @@ var _dimension = require("./dimension");
16
16
  * eg. 'center' 'top left' '50px 50px'
17
17
  */
18
18
  function parseTransformOrigin(value) {
19
- if ((0, _lodashEs.isString)(value)) {
19
+ if ((0, _utils.isString)(value)) {
20
20
  var values = value.split(' ');
21
21
 
22
22
  if (values.length === 1) {
@@ -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
  }
@@ -13,8 +13,6 @@ var _cssom = require("../cssom");
13
13
 
14
14
  var _parser = require("../parser");
15
15
 
16
- // import { uniq } from '@lodash-es';
17
-
18
16
  /**
19
17
  * @see /zh/docs/api/animation#支持变换的属性
20
18
  *
@@ -9,8 +9,6 @@ var _tslib = require("tslib");
9
9
 
10
10
  var _manaSyringe = require("mana-syringe");
11
11
 
12
- var _lodashEs = require("lodash-es");
13
-
14
12
  var _glMatrix = require("gl-matrix");
15
13
 
16
14
  var _DisplayObjectPool = require("../DisplayObjectPool");
@@ -115,11 +113,11 @@ function (_super) {
115
113
  interactive: (_c = _this.config.interactive) !== null && _c !== void 0 ? _c : true
116
114
  }), _this.config.style), _this.config.attrs);
117
115
 
118
- if (!(0, _lodashEs.isNil)(_this.config.visible)) {
116
+ if (_this.config.visible != null) {
119
117
  _this.config.style.visibility = _this.config.visible === false ? 'hidden' : 'visible';
120
118
  }
121
119
 
122
- if (!(0, _lodashEs.isNil)(_this.config.interactive)) {
120
+ if (_this.config.interactive != null) {
123
121
  _this.config.style.pointerEvents = _this.config.interactive === false ? 'none' : 'auto';
124
122
  }
125
123
 
@@ -213,11 +211,11 @@ function (_super) {
213
211
  attributeValue = _a[1]; // ignore undefined value
214
212
 
215
213
 
216
- if ((0, _lodashEs.isUndefined)(value)) {
214
+ if ((0, _utils.isUndefined)(value)) {
217
215
  return;
218
216
  }
219
217
 
220
- if (force || !(0, _lodashEs.isEqual)(attributeValue, this.attributes[attributeName])) {
218
+ if (force || attributeValue != this.attributes[attributeName]) {
221
219
  this.internalSetAttribute(attributeName, attributeValue);
222
220
 
223
221
  _super.prototype.setAttribute.call(this, attributeName, attributeValue);
@@ -476,7 +474,7 @@ function (_super) {
476
474
  };
477
475
 
478
476
  DisplayObject.prototype.rotateLocal = function (x, y, z) {
479
- if ((0, _lodashEs.isNil)(y) && (0, _lodashEs.isNil)(z)) {
477
+ if ((0, _utils.isNil)(y) && (0, _utils.isNil)(z)) {
480
478
  this.sceneGraphService.rotateLocal(this, 0, 0, x);
481
479
  } else {
482
480
  this.sceneGraphService.rotateLocal(this, x, y, z);
@@ -486,7 +484,7 @@ function (_super) {
486
484
  };
487
485
 
488
486
  DisplayObject.prototype.rotate = function (x, y, z) {
489
- if ((0, _lodashEs.isNil)(y) && (0, _lodashEs.isNil)(z)) {
487
+ if ((0, _utils.isNil)(y) && (0, _utils.isNil)(z)) {
490
488
  this.sceneGraphService.rotate(this, 0, 0, x);
491
489
  } else {
492
490
  this.sceneGraphService.rotate(this, x, y, z);
@@ -796,7 +794,7 @@ function (_super) {
796
794
  return this.attributes;
797
795
  }
798
796
 
799
- if ((0, _lodashEs.isObject)(name)) {
797
+ if ((0, _utils.isObject)(name)) {
800
798
  Object.keys(name).forEach(function (key) {
801
799
  _this.setAttribute(key, name[key]);
802
800
  });
@@ -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
  /**
@@ -9,14 +9,14 @@ var _tslib = require("tslib");
9
9
 
10
10
  var _gMath = require("@antv/g-math");
11
11
 
12
- var _lodashEs = require("lodash-es");
13
-
14
12
  var _types = require("../types");
15
13
 
16
14
  var _DisplayObject = require("./DisplayObject");
17
15
 
18
16
  var _shapes = require("../shapes");
19
17
 
18
+ var _utils = require("../utils");
19
+
20
20
  var Path =
21
21
  /** @class */
22
22
  function (_super) {
@@ -68,7 +68,7 @@ function (_super) {
68
68
  });
69
69
  var seg = curve[index];
70
70
 
71
- if ((0, _lodashEs.isNil)(seg) || (0, _lodashEs.isNil)(index)) {
71
+ if ((0, _utils.isNil)(seg) || (0, _utils.isNil)(index)) {
72
72
  return null;
73
73
  }
74
74