@antv/g 5.0.23-alpha.6 → 5.0.23-alpha.7

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.
@@ -207,4 +207,6 @@ export declare class CSSMathProduct extends CSSMathVariadic {
207
207
  sumValue(): CSSNumericSumValue;
208
208
  buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
209
209
  }
210
+ export declare const Opx: CSSUnitValue;
211
+ export declare const Odeg: CSSUnitValue;
210
212
  export {};
@@ -1656,4 +1656,6 @@ function (_super) {
1656
1656
  return CSSMathProduct;
1657
1657
  }(CSSMathVariadic);
1658
1658
 
1659
- export { CSSMathProduct };
1659
+ export { CSSMathProduct };
1660
+ export var Opx = new CSSUnitValue(0, 'px');
1661
+ export var Odeg = new CSSUnitValue(0, 'deg');
@@ -4,8 +4,6 @@ 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,7 @@
1
- import { parseNumber, mergeNumbers, parseAngle, parseLength, parseLengthOrPercentage, mergeDimensions } from './';
2
- import { UnitType, CSSUnitValue } from '../cssom';
1
+ import { UnitType, CSSUnitValue, Opx, Odeg } from '../cssom';
2
+ import { mergeDimensions, parseAngle, parseLength, parseLengthOrPercentage } from './dimension';
3
+ import { mergeNumbers, parseNumber } from './numeric';
3
4
  var _ = null;
4
- export var Opx = new CSSUnitValue(0, 'px');
5
- export var Odeg = new CSSUnitValue(0, 'deg');
6
5
 
7
6
  function cast(pattern) {
8
7
  return function (contents) {
@@ -1,7 +1,7 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { singleton } from 'mana-syringe';
3
- import { CSSKeywordValue } from '../cssom';
4
- import { Opx, Odeg, parseTransform, mergeTransforms } from '../parser';
3
+ import { CSSKeywordValue, Opx, Odeg } from '../cssom';
4
+ import { parseTransform, mergeTransforms } from '../parser';
5
5
  /**
6
6
  * @see /zh/docs/api/animation#支持变换的属性
7
7
  *
@@ -207,4 +207,6 @@ export declare class CSSMathProduct extends CSSMathVariadic {
207
207
  sumValue(): CSSNumericSumValue;
208
208
  buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
209
209
  }
210
+ export declare const Opx: CSSUnitValue;
211
+ export declare const Odeg: CSSUnitValue;
210
212
  export {};
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.CSSUnitValue = exports.CSSNumericValueType = exports.CSSNumericValue = exports.CSSMathVariadic = exports.CSSMathValue = exports.CSSMathSum = exports.CSSMathProduct = exports.CSSMathNegate = exports.CSSMathMin = exports.CSSMathMax = exports.CSSMathInvert = exports.BaseType = void 0;
6
+ exports.Opx = exports.Odeg = exports.CSSUnitValue = exports.CSSNumericValueType = exports.CSSNumericValue = exports.CSSMathVariadic = exports.CSSMathValue = exports.CSSMathSum = exports.CSSMathProduct = exports.CSSMathNegate = exports.CSSMathMin = exports.CSSMathMax = exports.CSSMathInvert = exports.BaseType = void 0;
7
7
  exports.baseTypeToString = baseTypeToString;
8
8
  exports.typeCheck = typeCheck;
9
9
  exports.unitTypeToBaseType = unitTypeToBaseType;
@@ -1678,4 +1678,8 @@ function (_super) {
1678
1678
  return CSSMathProduct;
1679
1679
  }(CSSMathVariadic);
1680
1680
 
1681
- exports.CSSMathProduct = CSSMathProduct;
1681
+ exports.CSSMathProduct = CSSMathProduct;
1682
+ var Opx = new CSSUnitValue(0, 'px');
1683
+ exports.Opx = Opx;
1684
+ var Odeg = new CSSUnitValue(0, 'deg');
1685
+ exports.Odeg = Odeg;
@@ -4,8 +4,6 @@ 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,16 @@
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("./");
11
-
12
9
  var _cssom = require("../cssom");
13
10
 
11
+ var _dimension = require("./dimension");
12
+
13
+ var _numeric = require("./numeric");
14
+
14
15
  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
16
 
20
17
  function cast(pattern) {
21
18
  return function (contents) {
@@ -49,10 +46,10 @@ var transformFunctions = {
49
46
  // skew: ['Aa', null, id],
50
47
  // skewx: ['A', null, cast([_, Odeg])],
51
48
  // 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, _])],
49
+ translate: ['Tt', cast([_, _, _cssom.Opx]), id],
50
+ translatex: ['T', cast([_, _cssom.Opx, _cssom.Opx]), cast([_, _cssom.Opx])],
51
+ translatey: ['T', cast([_cssom.Opx, _, _cssom.Opx]), cast([_cssom.Opx, _])],
52
+ translatez: ['L', cast([_cssom.Opx, _cssom.Opx, _])],
56
53
  translate3d: ['TTL', id]
57
54
  };
58
55
  /**
@@ -107,19 +104,19 @@ function parseTransform(string) {
107
104
  if (!arg) {
108
105
  // @ts-ignore
109
106
  parsedArg = {
110
- a: Odeg,
107
+ a: _cssom.Odeg,
111
108
  n: parsedArgs[0],
112
- t: Opx
109
+ t: _cssom.Opx
113
110
  }[type];
114
111
  } else {
115
112
  // @ts-ignore
116
113
  parsedArg = {
117
114
  A: function A(s) {
118
- return s.trim() === '0' ? Odeg : (0, _2.parseAngle)(s);
115
+ return s.trim() === '0' ? _cssom.Odeg : (0, _dimension.parseAngle)(s);
119
116
  },
120
- N: _2.parseNumber,
121
- T: _2.parseLengthOrPercentage,
122
- L: _2.parseLength
117
+ N: _numeric.parseNumber,
118
+ T: _dimension.parseLengthOrPercentage,
119
+ L: _dimension.parseLength
123
120
  }[type.toUpperCase()](arg);
124
121
  }
125
122
 
@@ -270,7 +267,7 @@ function mergeTransforms(left, right, target) {
270
267
  var stringConversions = [];
271
268
 
272
269
  for (var j = 0; j < leftArgs.length; j++) {
273
- var merge = leftArgs[j].unit === _cssom.UnitType.kNumber ? _2.mergeNumbers : _2.mergeDimensions; // @ts-ignore
270
+ var merge = leftArgs[j].unit === _cssom.UnitType.kNumber ? _numeric.mergeNumbers : _dimension.mergeDimensions; // @ts-ignore
274
271
 
275
272
  var merged = merge(leftArgs[j], rightArgs[j], target, false, j);
276
273
  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];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g",
3
- "version": "5.0.23-alpha.6",
3
+ "version": "5.0.23-alpha.7",
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.6",
41
+ "@antv/g-math": "^1.0.20-alpha.7",
42
42
  "@antv/util": "^3.0.0",
43
43
  "@types/offscreencanvas": "^2019.6.4",
44
44
  "d3-color": "^1.4.0",