@antv/g 5.0.23-alpha.0 → 5.0.23-alpha.12

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 (78) hide show
  1. package/dist/index.umd.min.js +2 -2
  2. package/es/css/StyleValueRegistry.d.ts +2 -0
  3. package/es/css/StyleValueRegistry.js +7 -3
  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/numeric.d.ts +1 -1
  12. package/es/css/parser/numeric.js +1 -1
  13. package/es/css/parser/transform-origin.d.ts +1 -1
  14. package/es/css/parser/transform-origin.js +1 -1
  15. package/es/css/parser/transform.d.ts +1 -3
  16. package/es/css/parser/transform.js +9 -8
  17. package/es/css/properties/CSSPropertyTransform.js +2 -2
  18. package/es/plugins/PrepareRendererPlugin.js +2 -2
  19. package/es/services/RenderingService.js +2 -2
  20. package/lib/css/StyleValueRegistry.d.ts +2 -0
  21. package/lib/css/StyleValueRegistry.js +13 -5
  22. package/lib/css/cssom/CSSKeywordValue.d.ts +1 -1
  23. package/lib/css/cssom/CSSNumericSumValue.d.ts +1 -1
  24. package/lib/css/cssom/CSSNumericValue.d.ts +141 -4
  25. package/lib/css/cssom/CSSNumericValue.js +1232 -58
  26. package/lib/css/cssom/CSSTransformValue.d.ts +1 -1
  27. package/lib/css/cssom/index.d.ts +0 -10
  28. package/lib/css/cssom/index.js +0 -130
  29. package/lib/css/parser/numeric.d.ts +1 -1
  30. package/lib/css/parser/numeric.js +4 -4
  31. package/lib/css/parser/transform-origin.d.ts +1 -1
  32. package/lib/css/parser/transform-origin.js +2 -2
  33. package/lib/css/parser/transform.d.ts +1 -3
  34. package/lib/css/parser/transform.js +25 -24
  35. package/lib/css/properties/CSSPropertyTransform.js +18 -18
  36. package/lib/plugins/PrepareRendererPlugin.js +2 -2
  37. package/lib/services/RenderingService.js +2 -2
  38. package/package.json +3 -3
  39. package/es/css/cssom/CSSMathInvert.d.ts +0 -14
  40. package/es/css/cssom/CSSMathInvert.js +0 -84
  41. package/es/css/cssom/CSSMathMax.d.ts +0 -17
  42. package/es/css/cssom/CSSMathMax.js +0 -118
  43. package/es/css/cssom/CSSMathMin.d.ts +0 -17
  44. package/es/css/cssom/CSSMathMin.js +0 -119
  45. package/es/css/cssom/CSSMathNegate.d.ts +0 -14
  46. package/es/css/cssom/CSSMathNegate.js +0 -80
  47. package/es/css/cssom/CSSMathProduct.d.ts +0 -16
  48. package/es/css/cssom/CSSMathProduct.js +0 -109
  49. package/es/css/cssom/CSSMathSum.d.ts +0 -17
  50. package/es/css/cssom/CSSMathSum.js +0 -117
  51. package/es/css/cssom/CSSMathValue.d.ts +0 -11
  52. package/es/css/cssom/CSSMathValue.js +0 -27
  53. package/es/css/cssom/CSSMathVariadic.d.ts +0 -9
  54. package/es/css/cssom/CSSMathVariadic.js +0 -44
  55. package/es/css/cssom/CSSNumericValueType.d.ts +0 -33
  56. package/es/css/cssom/CSSNumericValueType.js +0 -259
  57. package/es/css/cssom/CSSUnitValue.d.ts +0 -33
  58. package/es/css/cssom/CSSUnitValue.js +0 -252
  59. package/lib/css/cssom/CSSMathInvert.d.ts +0 -14
  60. package/lib/css/cssom/CSSMathInvert.js +0 -94
  61. package/lib/css/cssom/CSSMathMax.d.ts +0 -17
  62. package/lib/css/cssom/CSSMathMax.js +0 -128
  63. package/lib/css/cssom/CSSMathMin.d.ts +0 -17
  64. package/lib/css/cssom/CSSMathMin.js +0 -128
  65. package/lib/css/cssom/CSSMathNegate.d.ts +0 -14
  66. package/lib/css/cssom/CSSMathNegate.js +0 -89
  67. package/lib/css/cssom/CSSMathProduct.d.ts +0 -16
  68. package/lib/css/cssom/CSSMathProduct.js +0 -119
  69. package/lib/css/cssom/CSSMathSum.d.ts +0 -17
  70. package/lib/css/cssom/CSSMathSum.js +0 -129
  71. package/lib/css/cssom/CSSMathValue.d.ts +0 -11
  72. package/lib/css/cssom/CSSMathValue.js +0 -35
  73. package/lib/css/cssom/CSSMathVariadic.d.ts +0 -9
  74. package/lib/css/cssom/CSSMathVariadic.js +0 -55
  75. package/lib/css/cssom/CSSNumericValueType.d.ts +0 -33
  76. package/lib/css/cssom/CSSNumericValueType.js +0 -272
  77. package/lib/css/cssom/CSSUnitValue.d.ts +0 -33
  78. 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';
@@ -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) {
@@ -186,19 +82,6 @@ Object.keys(_CSSNumericValue).forEach(function (key) {
186
82
  });
187
83
  });
188
84
 
189
- var _CSSNumericValueType = require("./CSSNumericValueType");
190
-
191
- Object.keys(_CSSNumericValueType).forEach(function (key) {
192
- if (key === "default" || key === "__esModule") return;
193
- if (key in exports && exports[key] === _CSSNumericValueType[key]) return;
194
- Object.defineProperty(exports, key, {
195
- enumerable: true,
196
- get: function get() {
197
- return _CSSNumericValueType[key];
198
- }
199
- });
200
- });
201
-
202
85
  var _CSSRGB = require("./CSSRGB");
203
86
 
204
87
  Object.keys(_CSSRGB).forEach(function (key) {
@@ -262,17 +145,4 @@ Object.keys(_CSSTranslate).forEach(function (key) {
262
145
  return _CSSTranslate[key];
263
146
  }
264
147
  });
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
148
  });
@@ -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)
@@ -12,7 +12,7 @@ exports.parseNumberList = parseNumberList;
12
12
 
13
13
  var _utils = require("../../utils");
14
14
 
15
- var _cssom = require("../cssom");
15
+ var _CSSNumericValue = require("../cssom/CSSNumericValue");
16
16
 
17
17
  function numberToString(x) {
18
18
  // scale(0.00000001) -> scale(0)
@@ -30,13 +30,13 @@ function numberToString(x) {
30
30
 
31
31
  function parseNumber(string) {
32
32
  if (typeof string === 'number') {
33
- return new _cssom.CSSUnitValue(string);
33
+ return new _CSSNumericValue.CSSUnitValue(string);
34
34
  }
35
35
 
36
36
  if (/^\s*[-+]?(\d*\.)?\d+\s*$/.test(string)) {
37
- return new _cssom.CSSUnitValue(Number(string));
37
+ return new _CSSNumericValue.CSSUnitValue(Number(string));
38
38
  } else {
39
- return new _cssom.CSSUnitValue(0);
39
+ return new _CSSNumericValue.CSSUnitValue(0);
40
40
  }
41
41
  }
42
42
  /**
@@ -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'
@@ -7,7 +7,7 @@ exports.parseTransformOrigin = parseTransformOrigin;
7
7
 
8
8
  var _utils = require("../../utils");
9
9
 
10
- var _cssom = require("../cssom");
10
+ var _CSSNumericValue = require("../cssom/CSSNumericValue");
11
11
 
12
12
  var _dimension = require("./dimension");
13
13
 
@@ -37,7 +37,7 @@ function parseTransformOrigin(value) {
37
37
 
38
38
  return [(0, _dimension.parseLengthOrPercentage)(convertKeyword2Percent(values[0])), (0, _dimension.parseLengthOrPercentage)(convertKeyword2Percent(values[1]))];
39
39
  } else {
40
- return [new _cssom.CSSUnitValue(value[0] || 0, 'px'), new _cssom.CSSUnitValue(value[1] || 0, 'px')];
40
+ return [new _CSSNumericValue.CSSUnitValue(value[0] || 0, 'px'), new _CSSNumericValue.CSSUnitValue(value[1] || 0, 'px')];
41
41
  }
42
42
  }
43
43
 
@@ -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)
@@ -3,19 +3,20 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Opx = exports.Odeg = void 0;
7
6
  exports.mergeTransforms = mergeTransforms;
8
7
  exports.parseTransform = parseTransform;
9
8
 
10
- var _2 = require("./");
9
+ var _types = require("../cssom/types");
11
10
 
12
- var _cssom = require("../cssom");
11
+ var _CSSNumericValue = require("../cssom/CSSNumericValue");
12
+
13
+ var _dimension = require("./dimension");
14
+
15
+ var _numeric = require("./numeric");
16
+
17
+ var _CSS = require("../CSS");
13
18
 
14
19
  var _ = null;
15
- var Opx = new _cssom.CSSUnitValue(0, 'px');
16
- exports.Opx = Opx;
17
- var Odeg = new _cssom.CSSUnitValue(0, 'deg');
18
- exports.Odeg = Odeg;
19
20
 
20
21
  function cast(pattern) {
21
22
  return function (contents) {
@@ -41,18 +42,18 @@ var transformFunctions = {
41
42
  rotatez: ['A'],
42
43
  rotate3d: ['NNNA'],
43
44
  // perspective: ['L'],
44
- scale: ['Nn', cast([_, _, new _cssom.CSSUnitValue(1)]), id],
45
- scalex: ['N', cast([_, new _cssom.CSSUnitValue(1), new _cssom.CSSUnitValue(1)]), cast([_, new _cssom.CSSUnitValue(1)])],
46
- scaley: ['N', cast([new _cssom.CSSUnitValue(1), _, new _cssom.CSSUnitValue(1)]), cast([new _cssom.CSSUnitValue(1), _])],
47
- scalez: ['N', cast([new _cssom.CSSUnitValue(1), new _cssom.CSSUnitValue(1), _])],
45
+ scale: ['Nn', cast([_, _, _CSS.CSS.number(1)]), id],
46
+ scalex: ['N', cast([_, _CSS.CSS.number(1), _CSS.CSS.number(1)]), cast([_, _CSS.CSS.number(1)])],
47
+ scaley: ['N', cast([_CSS.CSS.number(1), _, _CSS.CSS.number(1)]), cast([_CSS.CSS.number(1), _])],
48
+ scalez: ['N', cast([_CSS.CSS.number(1), _CSS.CSS.number(1), _])],
48
49
  scale3d: ['NNN', id],
49
50
  // skew: ['Aa', null, id],
50
51
  // skewx: ['A', null, cast([_, Odeg])],
51
52
  // skewy: ['A', null, cast([Odeg, _])],
52
- translate: ['Tt', cast([_, _, Opx]), id],
53
- translatex: ['T', cast([_, Opx, Opx]), cast([_, Opx])],
54
- translatey: ['T', cast([Opx, _, Opx]), cast([Opx, _])],
55
- translatez: ['L', cast([Opx, Opx, _])],
53
+ translate: ['Tt', cast([_, _, _CSSNumericValue.Opx]), id],
54
+ translatex: ['T', cast([_, _CSSNumericValue.Opx, _CSSNumericValue.Opx]), cast([_, _CSSNumericValue.Opx])],
55
+ translatey: ['T', cast([_CSSNumericValue.Opx, _, _CSSNumericValue.Opx]), cast([_CSSNumericValue.Opx, _])],
56
+ translatez: ['L', cast([_CSSNumericValue.Opx, _CSSNumericValue.Opx, _])],
56
57
  translate3d: ['TTL', id]
57
58
  };
58
59
  /**
@@ -107,19 +108,19 @@ function parseTransform(string) {
107
108
  if (!arg) {
108
109
  // @ts-ignore
109
110
  parsedArg = {
110
- a: Odeg,
111
+ a: _CSSNumericValue.Odeg,
111
112
  n: parsedArgs[0],
112
- t: Opx
113
+ t: _CSSNumericValue.Opx
113
114
  }[type];
114
115
  } else {
115
116
  // @ts-ignore
116
117
  parsedArg = {
117
118
  A: function A(s) {
118
- return s.trim() === '0' ? Odeg : (0, _2.parseAngle)(s);
119
+ return s.trim() === '0' ? _CSSNumericValue.Odeg : (0, _dimension.parseAngle)(s);
119
120
  },
120
- N: _2.parseNumber,
121
- T: _2.parseLengthOrPercentage,
122
- L: _2.parseLength
121
+ N: _numeric.parseNumber,
122
+ T: _dimension.parseLengthOrPercentage,
123
+ L: _dimension.parseLength
123
124
  }[type.toUpperCase()](arg);
124
125
  }
125
126
 
@@ -203,10 +204,10 @@ function mergeTransforms(left, right, target) {
203
204
  t: type,
204
205
  d: args.map(function (arg) {
205
206
  if (typeof arg === 'number') {
206
- return new _cssom.CSSUnitValue(defaultValue);
207
+ return new _CSSNumericValue.CSSUnitValue(defaultValue);
207
208
  }
208
209
 
209
- return new _cssom.CSSUnitValue(defaultValue, arg.unit); // {
210
+ return new _CSSNumericValue.CSSUnitValue(defaultValue, arg.unit); // {
210
211
  // unit: arg.unit,
211
212
  // value: defaultValue,
212
213
  // };
@@ -270,7 +271,7 @@ function mergeTransforms(left, right, target) {
270
271
  var stringConversions = [];
271
272
 
272
273
  for (var j = 0; j < leftArgs.length; j++) {
273
- var merge = leftArgs[j].unit === _cssom.UnitType.kNumber ? _2.mergeNumbers : _2.mergeDimensions; // @ts-ignore
274
+ var merge = leftArgs[j].unit === _types.UnitType.kNumber ? _numeric.mergeNumbers : _dimension.mergeDimensions; // @ts-ignore
274
275
 
275
276
  var merged = merge(leftArgs[j], rightArgs[j], target, false, j);
276
277
  leftArgsCopy[j] = merged[0];
@@ -111,40 +111,40 @@ function () {
111
111
  }) || [1, 1, 1];
112
112
  object.scaleLocal(newScale[0] / oldScale[0], newScale[1] / oldScale[1], newScale[2] / oldScale[2]);
113
113
  } else if (t === 'translate') {
114
- var newTranslation = value && value.d || [_parser.Opx, _parser.Opx];
115
- var oldTranslation = old && old.d || [_parser.Opx, _parser.Opx];
114
+ var newTranslation = value && value.d || [_cssom.Opx, _cssom.Opx];
115
+ var oldTranslation = old && old.d || [_cssom.Opx, _cssom.Opx];
116
116
  object.translateLocal(newTranslation[0].value - oldTranslation[0].value, newTranslation[1].value - oldTranslation[1].value, 0);
117
117
  } else if (t === 'translatex') {
118
- var newTranslation = value && value.d || [_parser.Opx];
119
- var oldTranslation = old && old.d || [_parser.Opx];
118
+ var newTranslation = value && value.d || [_cssom.Opx];
119
+ var oldTranslation = old && old.d || [_cssom.Opx];
120
120
  object.translateLocal(newTranslation[0].value - oldTranslation[0].value, 0, 0);
121
121
  } else if (t === 'translatey') {
122
- var newTranslation = value && value.d || [_parser.Opx];
123
- var oldTranslation = old && old.d || [_parser.Opx];
122
+ var newTranslation = value && value.d || [_cssom.Opx];
123
+ var oldTranslation = old && old.d || [_cssom.Opx];
124
124
  object.translateLocal(0, newTranslation[0].value - oldTranslation[0].value, 0);
125
125
  } else if (t === 'translatez') {
126
- var newTranslation = value && value.d || [_parser.Opx];
127
- var oldTranslation = old && old.d || [_parser.Opx];
126
+ var newTranslation = value && value.d || [_cssom.Opx];
127
+ var oldTranslation = old && old.d || [_cssom.Opx];
128
128
  object.translateLocal(0, 0, newTranslation[0].value - oldTranslation[0].value);
129
129
  } else if (t === 'translate3d') {
130
- var newTranslation = value && value.d || [_parser.Opx, _parser.Opx, _parser.Opx];
131
- var oldTranslation = old && old.d || [_parser.Opx, _parser.Opx, _parser.Opx];
130
+ var newTranslation = value && value.d || [_cssom.Opx, _cssom.Opx, _cssom.Opx];
131
+ var oldTranslation = old && old.d || [_cssom.Opx, _cssom.Opx, _cssom.Opx];
132
132
  object.translateLocal(newTranslation[0].value - oldTranslation[0].value, newTranslation[1].value - oldTranslation[1].value, newTranslation[2].value - oldTranslation[2].value);
133
133
  } else if (t === 'rotate') {
134
- var newAngles = value && value.d || [_parser.Odeg];
135
- var oldAngles = old && old.d || [_parser.Odeg];
134
+ var newAngles = value && value.d || [_cssom.Odeg];
135
+ var oldAngles = old && old.d || [_cssom.Odeg];
136
136
  object.rotateLocal(0, 0, newAngles[0].value - oldAngles[0].value);
137
137
  } else if (t === 'rotatex') {
138
- var newAngles = value && value.d || [_parser.Odeg];
139
- var oldAngles = old && old.d || [_parser.Odeg];
138
+ var newAngles = value && value.d || [_cssom.Odeg];
139
+ var oldAngles = old && old.d || [_cssom.Odeg];
140
140
  object.rotateLocal(newAngles[0].value - oldAngles[0].value, 0, 0);
141
141
  } else if (t === 'rotatey') {
142
- var newAngles = value && value.d || [_parser.Odeg];
143
- var oldAngles = old && old.d || [_parser.Odeg];
142
+ var newAngles = value && value.d || [_cssom.Odeg];
143
+ var oldAngles = old && old.d || [_cssom.Odeg];
144
144
  object.rotateLocal(0, newAngles[0].value - oldAngles[0].value, 0);
145
145
  } else if (t === 'rotatez') {
146
- var newAngles = value && value.d || [_parser.Odeg];
147
- var oldAngles = old && old.d || [_parser.Odeg];
146
+ var newAngles = value && value.d || [_cssom.Odeg];
147
+ var oldAngles = old && old.d || [_cssom.Odeg];
148
148
  object.rotateLocal(0, 0, newAngles[0].value - oldAngles[0].value);
149
149
  } else if (t === 'rotate3d') {// 暂不支持绕指定轴旋转
150
150
  // const newAngles = value && value.d || [Odeg, Odeg, Odeg];
@@ -9,7 +9,7 @@ var _tslib = require("tslib");
9
9
 
10
10
  var _manaSyringe = require("mana-syringe");
11
11
 
12
- var _css = require("../css");
12
+ var _StyleValueRegistry = require("../css/StyleValueRegistry");
13
13
 
14
14
  var _dom = require("../dom");
15
15
 
@@ -73,7 +73,7 @@ function () {
73
73
  };
74
74
 
75
75
  (0, _tslib.__decorate)([(0, _manaSyringe.inject)(_services.RenderingContext), (0, _tslib.__metadata)("design:type", Object)], PrepareRendererPlugin.prototype, "renderingContext", void 0);
76
- (0, _tslib.__decorate)([(0, _manaSyringe.inject)(_css.StyleValueRegistry), (0, _tslib.__metadata)("design:type", _css.StyleValueRegistry)], PrepareRendererPlugin.prototype, "styleValueRegistry", void 0);
76
+ (0, _tslib.__decorate)([(0, _manaSyringe.inject)(_StyleValueRegistry.StyleValueRegistryContribution), (0, _tslib.__metadata)("design:type", Function)], PrepareRendererPlugin.prototype, "styleValueRegistry", void 0);
77
77
  PrepareRendererPlugin = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)({
78
78
  contrib: _services.RenderingPluginContribution
79
79
  })], PrepareRendererPlugin);
@@ -11,7 +11,7 @@ var _manaSyringe = require("mana-syringe");
11
11
 
12
12
  var _utils = require("../utils");
13
13
 
14
- var _css = require("../css");
14
+ var _StyleValueRegistry = require("../css/StyleValueRegistry");
15
15
 
16
16
  var _dom = require("../dom");
17
17
 
@@ -233,7 +233,7 @@ function () {
233
233
  (0, _tslib.__decorate)([(0, _manaSyringe.contrib)(RenderingPluginContribution), (0, _tslib.__metadata)("design:type", Object)], RenderingService.prototype, "renderingPluginProvider", void 0);
234
234
  (0, _tslib.__decorate)([(0, _manaSyringe.inject)(_RenderingContext.RenderingContext), (0, _tslib.__metadata)("design:type", Object)], RenderingService.prototype, "renderingContext", void 0);
235
235
  (0, _tslib.__decorate)([(0, _manaSyringe.inject)(_SceneGraphService.SceneGraphService), (0, _tslib.__metadata)("design:type", Object)], RenderingService.prototype, "sceneGraphService", void 0);
236
- (0, _tslib.__decorate)([(0, _manaSyringe.inject)(_css.StyleValueRegistry), (0, _tslib.__metadata)("design:type", _css.StyleValueRegistry)], RenderingService.prototype, "styleValueRegistry", void 0);
236
+ (0, _tslib.__decorate)([(0, _manaSyringe.inject)(_StyleValueRegistry.StyleValueRegistryContribution), (0, _tslib.__metadata)("design:type", Function)], RenderingService.prototype, "styleValueRegistry", void 0);
237
237
  RenderingService = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)()], RenderingService);
238
238
  return RenderingService;
239
239
  }();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g",
3
- "version": "5.0.23-alpha.0",
3
+ "version": "5.0.23-alpha.12",
4
4
  "description": "A core module including ECS and DI container.",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "homepage": "https://github.com/antvis/g#readme",
40
40
  "dependencies": {
41
- "@antv/g-math": "^1.0.20-alpha.0",
41
+ "@antv/g-math": "^1.0.20-alpha.12",
42
42
  "@antv/util": "^3.0.0",
43
43
  "@types/offscreencanvas": "^2019.6.4",
44
44
  "d3-color": "^1.4.0",
@@ -52,5 +52,5 @@
52
52
  "scripts": {
53
53
  "umd": "webpack"
54
54
  },
55
- "gitHead": "b382a7445d9fa350107dba29d20eb7e6d6da9e79"
55
+ "gitHead": "8c28e04155e41a948c323161a35aeda63c2294a4"
56
56
  }
@@ -1,14 +0,0 @@
1
- import { CSSMathValue } from './CSSMathValue';
2
- import type { CSSNumericSumValue, CSSNumericValue } from '.';
3
- import { CSSNumericValueType, CSSStyleValueType, Nested, ParenLess } from '.';
4
- export declare class CSSMathInvert extends CSSMathValue {
5
- private value;
6
- static create(value: CSSNumericValue): CSSMathInvert;
7
- constructor(value: CSSNumericValue, type: CSSNumericValueType);
8
- operator: string;
9
- clone(): CSSMathInvert;
10
- getType(): CSSStyleValueType;
11
- equals(other: CSSNumericValue): any;
12
- sumValue(): CSSNumericSumValue;
13
- buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
14
- }
@@ -1,84 +0,0 @@
1
- import { __extends } from "tslib";
2
- import { CSSMathValue } from './CSSMathValue';
3
- import { CSSNumericValueType, CSSStyleValueType, Nested, ParenLess } from '.';
4
-
5
- var CSSMathInvert =
6
- /** @class */
7
- function (_super) {
8
- __extends(CSSMathInvert, _super);
9
-
10
- function CSSMathInvert(value, type) {
11
- var _this = _super.call(this, type) || this;
12
-
13
- _this.value = value;
14
- _this.operator = 'invert';
15
- return _this;
16
- }
17
-
18
- CSSMathInvert.create = function (value) {
19
- var type = CSSNumericValueType.negateExponents(value.type_);
20
- return new CSSMathInvert(value, type);
21
- };
22
-
23
- CSSMathInvert.prototype.clone = function () {
24
- return new CSSMathInvert(this.value, this.type_);
25
- };
26
-
27
- CSSMathInvert.prototype.getType = function () {
28
- return CSSStyleValueType.kInvertType;
29
- };
30
-
31
- CSSMathInvert.prototype.equals = function (other) {
32
- if (other.getType() !== CSSStyleValueType.kInvertType) {
33
- return false;
34
- } // We can safely cast here as we know 'other' has the same type as us.
35
-
36
-
37
- var other_invert = other;
38
- return this.value.equals(other_invert.value);
39
- };
40
-
41
- CSSMathInvert.prototype.sumValue = function () {
42
- var sum = this.value.sumValue();
43
-
44
- if (sum.length === 0 || sum.length !== 1 || sum[0].value === 0) {
45
- return null;
46
- }
47
-
48
- Object.keys(sum[0].units).forEach(function (key) {
49
- sum[0].units[key] *= -1;
50
- });
51
- sum[0].value = 1.0 / sum[0].value;
52
- return sum;
53
- }; // toCalcExpressionNode(): CSSMathExpressionNode {
54
- // const right_side = this.value.toCalcExpressionNode();
55
- // if (!right_side) {
56
- // return null;
57
- // }
58
- // // return CSSMathExpressionOperation::CreateArithmeticOperation(
59
- // // CSSMathExpressionNumericLiteral::Create(
60
- // // 1, UnitType.kNumber),
61
- // // right_side, CSSMathOperator.kDivide);
62
- // return null;
63
- // }
64
-
65
-
66
- CSSMathInvert.prototype.buildCSSText = function (nested, paren_less, result) {
67
- if (paren_less == ParenLess.kNo) {
68
- result += nested === Nested.kYes ? '(' : 'calc(';
69
- }
70
-
71
- result += '1 / ';
72
- result = this.value.buildCSSText(Nested.kYes, ParenLess.kNo, result);
73
-
74
- if (paren_less === ParenLess.kNo) {
75
- result += ')';
76
- }
77
-
78
- return result;
79
- };
80
-
81
- return CSSMathInvert;
82
- }(CSSMathValue);
83
-
84
- export { CSSMathInvert };
@@ -1,17 +0,0 @@
1
- /**
2
- * The CSSMathMin interface of the CSS_Object_Model represents the CSS min() function.
3
- * It inherits properties and methods from its parent CSSNumericValue.
4
- * @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_math_min.idl
5
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSMathMax
6
- */
7
- import { CSSMathVariadic } from './CSSMathVariadic';
8
- import type { CSSNumericValue, CSSNumericSumValue } from '.';
9
- import { Nested, ParenLess, CSSStyleValueType } from '.';
10
- export declare class CSSMathMax extends CSSMathVariadic {
11
- static create(values: CSSNumericValue[]): CSSMathMax;
12
- operator: string;
13
- clone(): CSSMathMax;
14
- getType(): CSSStyleValueType;
15
- sumValue(): CSSNumericSumValue;
16
- buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
17
- }