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

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.
@@ -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
1
  import { isString } from '../../utils';
2
- import { CSSUnitValue } from '../cssom';
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,5 +1,5 @@
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[];
@@ -1,4 +1,5 @@
1
- import { UnitType, CSSUnitValue, Opx, Odeg } from '../cssom';
1
+ import { UnitType } from '../cssom/types';
2
+ import { CSSUnitValue, Opx, Odeg } from '../cssom/CSSNumericValue';
2
3
  import { mergeDimensions, parseAngle, parseLength, parseLengthOrPercentage } from './dimension';
3
4
  import { mergeNumbers, parseNumber } from './numeric';
4
5
  var _ = 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'
@@ -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,5 +1,5 @@
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,7 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.mergeTransforms = mergeTransforms;
7
7
  exports.parseTransform = parseTransform;
8
8
 
9
- var _cssom = require("../cssom");
9
+ var _types = require("../cssom/types");
10
+
11
+ var _CSSNumericValue = require("../cssom/CSSNumericValue");
10
12
 
11
13
  var _dimension = require("./dimension");
12
14
 
@@ -38,18 +40,18 @@ var transformFunctions = {
38
40
  rotatez: ['A'],
39
41
  rotate3d: ['NNNA'],
40
42
  // perspective: ['L'],
41
- scale: ['Nn', cast([_, _, new _cssom.CSSUnitValue(1)]), id],
42
- scalex: ['N', cast([_, new _cssom.CSSUnitValue(1), new _cssom.CSSUnitValue(1)]), cast([_, new _cssom.CSSUnitValue(1)])],
43
- scaley: ['N', cast([new _cssom.CSSUnitValue(1), _, new _cssom.CSSUnitValue(1)]), cast([new _cssom.CSSUnitValue(1), _])],
44
- scalez: ['N', cast([new _cssom.CSSUnitValue(1), new _cssom.CSSUnitValue(1), _])],
43
+ scale: ['Nn', cast([_, _, new _CSSNumericValue.CSSUnitValue(1)]), id],
44
+ scalex: ['N', cast([_, new _CSSNumericValue.CSSUnitValue(1), new _CSSNumericValue.CSSUnitValue(1)]), cast([_, new _CSSNumericValue.CSSUnitValue(1)])],
45
+ scaley: ['N', cast([new _CSSNumericValue.CSSUnitValue(1), _, new _CSSNumericValue.CSSUnitValue(1)]), cast([new _CSSNumericValue.CSSUnitValue(1), _])],
46
+ scalez: ['N', cast([new _CSSNumericValue.CSSUnitValue(1), new _CSSNumericValue.CSSUnitValue(1), _])],
45
47
  scale3d: ['NNN', id],
46
48
  // skew: ['Aa', null, id],
47
49
  // skewx: ['A', null, cast([_, Odeg])],
48
50
  // skewy: ['A', null, cast([Odeg, _])],
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, _])],
51
+ translate: ['Tt', cast([_, _, _CSSNumericValue.Opx]), id],
52
+ translatex: ['T', cast([_, _CSSNumericValue.Opx, _CSSNumericValue.Opx]), cast([_, _CSSNumericValue.Opx])],
53
+ translatey: ['T', cast([_CSSNumericValue.Opx, _, _CSSNumericValue.Opx]), cast([_CSSNumericValue.Opx, _])],
54
+ translatez: ['L', cast([_CSSNumericValue.Opx, _CSSNumericValue.Opx, _])],
53
55
  translate3d: ['TTL', id]
54
56
  };
55
57
  /**
@@ -104,15 +106,15 @@ function parseTransform(string) {
104
106
  if (!arg) {
105
107
  // @ts-ignore
106
108
  parsedArg = {
107
- a: _cssom.Odeg,
109
+ a: _CSSNumericValue.Odeg,
108
110
  n: parsedArgs[0],
109
- t: _cssom.Opx
111
+ t: _CSSNumericValue.Opx
110
112
  }[type];
111
113
  } else {
112
114
  // @ts-ignore
113
115
  parsedArg = {
114
116
  A: function A(s) {
115
- return s.trim() === '0' ? _cssom.Odeg : (0, _dimension.parseAngle)(s);
117
+ return s.trim() === '0' ? _CSSNumericValue.Odeg : (0, _dimension.parseAngle)(s);
116
118
  },
117
119
  N: _numeric.parseNumber,
118
120
  T: _dimension.parseLengthOrPercentage,
@@ -200,10 +202,10 @@ function mergeTransforms(left, right, target) {
200
202
  t: type,
201
203
  d: args.map(function (arg) {
202
204
  if (typeof arg === 'number') {
203
- return new _cssom.CSSUnitValue(defaultValue);
205
+ return new _CSSNumericValue.CSSUnitValue(defaultValue);
204
206
  }
205
207
 
206
- return new _cssom.CSSUnitValue(defaultValue, arg.unit); // {
208
+ return new _CSSNumericValue.CSSUnitValue(defaultValue, arg.unit); // {
207
209
  // unit: arg.unit,
208
210
  // value: defaultValue,
209
211
  // };
@@ -267,7 +269,7 @@ function mergeTransforms(left, right, target) {
267
269
  var stringConversions = [];
268
270
 
269
271
  for (var j = 0; j < leftArgs.length; j++) {
270
- var merge = leftArgs[j].unit === _cssom.UnitType.kNumber ? _numeric.mergeNumbers : _dimension.mergeDimensions; // @ts-ignore
272
+ var merge = leftArgs[j].unit === _types.UnitType.kNumber ? _numeric.mergeNumbers : _dimension.mergeDimensions; // @ts-ignore
271
273
 
272
274
  var merged = merge(leftArgs[j], rightArgs[j], target, false, j);
273
275
  leftArgsCopy[j] = merged[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g",
3
- "version": "5.0.23-alpha.7",
3
+ "version": "5.0.23-alpha.8",
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.7",
41
+ "@antv/g-math": "^1.0.20-alpha.8",
42
42
  "@antv/util": "^3.0.0",
43
43
  "@types/offscreencanvas": "^2019.6.4",
44
44
  "d3-color": "^1.4.0",