@antv/g-lite 1.2.20 → 1.3.0-next.0
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.
- package/dist/css/CSSProperty.d.ts +7 -0
- package/dist/css/StyleValueRegistry.d.ts +2 -2
- package/dist/css/interfaces.d.ts +3 -2
- package/dist/css/parser/color.d.ts +2 -2
- package/dist/css/parser/dimension.d.ts +9 -1
- package/dist/css/parser/numeric.d.ts +3 -0
- package/dist/css/parser/transform-origin.d.ts +2 -0
- package/dist/css/parser/transform.d.ts +1 -0
- package/dist/css/properties/CSSPropertyAngle.d.ts +1 -0
- package/dist/css/properties/CSSPropertyLengthOrPercentage.d.ts +5 -1
- package/dist/css/properties/CSSPropertyNumber.d.ts +1 -0
- package/dist/css/properties/CSSPropertyOffsetDistance.d.ts +2 -1
- package/dist/css/properties/CSSPropertyOpacity.d.ts +1 -0
- package/dist/css/properties/CSSPropertyPath.d.ts +1 -5
- package/dist/css/properties/CSSPropertyPoints.d.ts +0 -5
- package/dist/css/properties/CSSPropertyTransform.d.ts +3 -2
- package/dist/css/properties/CSSPropertyTransformOrigin.d.ts +1 -0
- package/dist/css/properties/CSSPropertyZIndex.d.ts +1 -0
- package/dist/css/properties/index.d.ts +0 -1
- package/dist/display-objects/DisplayObject.d.ts +1 -1
- package/dist/display-objects/Line.d.ts +0 -2
- package/dist/index.esm.js +389 -444
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +389 -444
- package/dist/index.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/services/aabb/CircleUpdater.d.ts +4 -2
- package/dist/services/aabb/EllipseUpdater.d.ts +4 -2
- package/dist/services/aabb/LineUpdater.d.ts +4 -2
- package/dist/services/aabb/PathUpdater.d.ts +4 -2
- package/dist/services/aabb/PolylineUpdater.d.ts +4 -2
- package/dist/services/aabb/RectUpdater.d.ts +4 -2
- package/dist/services/aabb/TextUpdater.d.ts +4 -13
- package/dist/services/aabb/interfaces.d.ts +6 -6
- package/dist/types.d.ts +0 -5
- package/dist/utils/gradient.d.ts +2 -2
- package/dist/utils/path.d.ts +1 -1
- package/package.json +1 -1
|
@@ -22,6 +22,13 @@ export interface CSSProperty<Parsed, Used> {
|
|
|
22
22
|
* '180deg' -> CSS.deg(180)
|
|
23
23
|
*/
|
|
24
24
|
parser: CSSPropertyParser<Parsed>;
|
|
25
|
+
/**
|
|
26
|
+
* Don't use memoize, eg. during animation.
|
|
27
|
+
*/
|
|
28
|
+
parserUnmemoize: CSSPropertyParser<Parsed>;
|
|
29
|
+
/**
|
|
30
|
+
* Ignore CSS syntax.
|
|
31
|
+
*/
|
|
25
32
|
parserWithCSSDisabled: CSSPropertyParser<Parsed>;
|
|
26
33
|
/**
|
|
27
34
|
* convert parsed value to used value.
|
|
@@ -31,11 +31,11 @@ export declare class DefaultStyleValueRegistry implements StyleValueRegistry {
|
|
|
31
31
|
/**
|
|
32
32
|
* string -> parsed value
|
|
33
33
|
*/
|
|
34
|
-
parseProperty(name: string, value: any, object: DisplayObject): CSSStyleValue;
|
|
34
|
+
parseProperty(name: string, value: any, object: DisplayObject, memoized: boolean): CSSStyleValue;
|
|
35
35
|
/**
|
|
36
36
|
* computed value -> used value
|
|
37
37
|
*/
|
|
38
|
-
computeProperty(name: string, computed: CSSStyleValue, object: DisplayObject): any;
|
|
38
|
+
computeProperty(name: string, computed: CSSStyleValue, object: DisplayObject, memoized: boolean): any;
|
|
39
39
|
postProcessProperty(name: string, object: DisplayObject, attributes: string[]): void;
|
|
40
40
|
/**
|
|
41
41
|
* resolve later
|
package/dist/css/interfaces.d.ts
CHANGED
|
@@ -118,6 +118,7 @@ export interface PropertyParseOptions {
|
|
|
118
118
|
skipParse: boolean;
|
|
119
119
|
forceUpdateGeometry: boolean;
|
|
120
120
|
usedAttributes: string[];
|
|
121
|
+
memoize: boolean;
|
|
121
122
|
}
|
|
122
123
|
export interface StyleValueRegistry {
|
|
123
124
|
recalc: (displayObject: DisplayObject) => void;
|
|
@@ -126,8 +127,8 @@ export interface StyleValueRegistry {
|
|
|
126
127
|
getPropertySyntax: (syntax: string) => CSSProperty<any, any>;
|
|
127
128
|
addUnresolveProperty: (object: DisplayObject, name: string) => void;
|
|
128
129
|
processProperties: (object: DisplayObject, attributes: BaseStyleProps, options?: Partial<PropertyParseOptions>) => void;
|
|
129
|
-
parseProperty: (name: string, value: any, object: DisplayObject) => CSSStyleValue;
|
|
130
|
-
computeProperty: (name: string, computed: CSSStyleValue, object: DisplayObject) => any;
|
|
130
|
+
parseProperty: (name: string, value: any, object: DisplayObject, memoized: boolean) => CSSStyleValue;
|
|
131
|
+
computeProperty: (name: string, computed: CSSStyleValue, object: DisplayObject, memoized: boolean) => any;
|
|
131
132
|
}
|
|
132
133
|
export interface LayoutRegistry {
|
|
133
134
|
registerLayout: (name: string, ctor: any) => void;
|
|
@@ -6,8 +6,8 @@ import { CSSRGB } from '../cssom';
|
|
|
6
6
|
*/
|
|
7
7
|
export interface Pattern {
|
|
8
8
|
image: string | CanvasImageSource | Rect;
|
|
9
|
-
repetition
|
|
10
|
-
transform
|
|
9
|
+
repetition?: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat';
|
|
10
|
+
transform?: string;
|
|
11
11
|
}
|
|
12
12
|
export declare function isCSSGradientValue(object: any): object is CSSGradientValue;
|
|
13
13
|
export declare function isPattern(object: any): object is Pattern;
|
|
@@ -8,6 +8,7 @@ export declare function parseDimension(unitRegExp: RegExp, string: string): CSSS
|
|
|
8
8
|
* @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/length
|
|
9
9
|
* length with only absolute unit, eg. 1px
|
|
10
10
|
*/
|
|
11
|
+
export declare const parseLengthUnmemoize: (css: string) => CSSStyleValue;
|
|
11
12
|
export declare const parseLength: {
|
|
12
13
|
(...args: any[]): any;
|
|
13
14
|
cache: Map<any, any>;
|
|
@@ -16,6 +17,7 @@ export declare const parseLength: {
|
|
|
16
17
|
* <percentage>
|
|
17
18
|
* @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/percentage
|
|
18
19
|
*/
|
|
20
|
+
export declare const parserPercentageUnmemoize: (css: string) => CSSStyleValue;
|
|
19
21
|
export declare const parserPercentage: {
|
|
20
22
|
(...args: any[]): any;
|
|
21
23
|
cache: Map<any, any>;
|
|
@@ -26,7 +28,12 @@ export declare const parserPercentage: {
|
|
|
26
28
|
*
|
|
27
29
|
* @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/length-percentage
|
|
28
30
|
*/
|
|
29
|
-
export declare const
|
|
31
|
+
export declare const parseLengthOrPercentageUnmemoize: (css: string) => CSSUnitValue;
|
|
32
|
+
export declare const parseLengthOrPercentage: {
|
|
33
|
+
(...args: any[]): any;
|
|
34
|
+
cache: Map<any, any>;
|
|
35
|
+
};
|
|
36
|
+
export declare const parseAngleUnmemoize: (css: string) => CSSUnitValue;
|
|
30
37
|
export declare const parseAngle: {
|
|
31
38
|
(...args: any[]): any;
|
|
32
39
|
cache: Map<any, any>;
|
|
@@ -43,4 +50,5 @@ export declare function mergeDimensions(left: CSSUnitValue, right: CSSUnitValue,
|
|
|
43
50
|
export declare function convertAngleUnit(value: CSSUnitValue): number;
|
|
44
51
|
export declare function parseDimensionArrayFormat(string: string | number | (string | number)[], size: number): number[];
|
|
45
52
|
export declare function parseDimensionArray(string: string | (string | number)[]): CSSUnitValue[];
|
|
53
|
+
export declare function parseDimensionArrayUnmemoize(string: string | (string | number)[]): CSSUnitValue[];
|
|
46
54
|
export declare function convertPercentUnit(valueWithUnit: CSSUnitValue, vec3Index: number, target: DisplayObject): number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CSSUnitValue } from '../cssom';
|
|
1
2
|
export declare function numberToString(x: number): string;
|
|
2
3
|
/**
|
|
3
4
|
* parse string or number to CSSUnitValue(numeric)
|
|
@@ -6,6 +7,7 @@ export declare function numberToString(x: number): string;
|
|
|
6
7
|
* * 0 -> CSSUnitValue(0)
|
|
7
8
|
* * '2' -> CSSUnitValue(2)
|
|
8
9
|
*/
|
|
10
|
+
export declare const parseNumberUnmemoize: (string: string | number) => CSSUnitValue;
|
|
9
11
|
export declare const parseNumber: {
|
|
10
12
|
(...args: any[]): any;
|
|
11
13
|
cache: Map<any, any>;
|
|
@@ -15,6 +17,7 @@ export declare const parseNumber: {
|
|
|
15
17
|
* eg.
|
|
16
18
|
* * [0.5, 0.5] -> [CSSUnitValue, CSSUnitValue]
|
|
17
19
|
*/
|
|
20
|
+
export declare const parseNumberListUnmemoize: (string: string | number[]) => CSSUnitValue[];
|
|
18
21
|
export declare const parseNumberList: {
|
|
19
22
|
(...args: any[]): any;
|
|
20
23
|
cache: Map<any, any>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CSSUnitValue } from '../cssom';
|
|
1
2
|
/**
|
|
2
3
|
* @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-origin
|
|
3
4
|
* eg. 'center' 'top left' '50px 50px'
|
|
@@ -6,3 +7,4 @@ export declare const parseTransformOrigin: {
|
|
|
6
7
|
(...args: any[]): any;
|
|
7
8
|
cache: Map<any, any>;
|
|
8
9
|
};
|
|
10
|
+
export declare const parseTransformOriginUnmemoize: (value: string | number[]) => [CSSUnitValue, CSSUnitValue];
|
|
@@ -10,6 +10,7 @@ export interface ParsedTransform {
|
|
|
10
10
|
* scaleX(1)
|
|
11
11
|
*/
|
|
12
12
|
export declare function parseTransform(string: string): ParsedTransform[];
|
|
13
|
+
export declare function parseTransformUnmemoize(string: string): ParsedTransform[];
|
|
13
14
|
export declare function convertItemToMatrix(item: ParsedTransform): number[];
|
|
14
15
|
export declare const composeMatrix: (translate: any, scale: any, skew: any, quat: any, perspective: any) => number[];
|
|
15
16
|
export declare function mergeTransforms(left: ParsedTransform[], right: ParsedTransform[], target: DisplayObject | null): [number[][], number[][], (d: number[][]) => string];
|
|
@@ -7,6 +7,7 @@ export declare class CSSPropertyAngle implements Partial<CSSProperty<CSSUnitValu
|
|
|
7
7
|
(...args: any[]): any;
|
|
8
8
|
cache: Map<any, any>;
|
|
9
9
|
};
|
|
10
|
+
parserUnmemoize: (css: string) => CSSUnitValue;
|
|
10
11
|
parserWithCSSDisabled: any;
|
|
11
12
|
mixer: typeof mergeNumbers;
|
|
12
13
|
calculator(name: string, oldParsed: CSSUnitValue, parsed: CSSUnitValue, object: DisplayObject): number;
|
|
@@ -7,7 +7,11 @@ import { mergeNumbers } from '../parser';
|
|
|
7
7
|
* <length> & <percentage>
|
|
8
8
|
*/
|
|
9
9
|
export declare class CSSPropertyLengthOrPercentage implements Partial<CSSProperty<CSSUnitValue, number>> {
|
|
10
|
-
parser:
|
|
10
|
+
parser: {
|
|
11
|
+
(...args: any[]): any;
|
|
12
|
+
cache: Map<any, any>;
|
|
13
|
+
};
|
|
14
|
+
parserUnmemoize: (css: string) => CSSUnitValue;
|
|
11
15
|
parserWithCSSDisabled: any;
|
|
12
16
|
mixer: typeof mergeNumbers;
|
|
13
17
|
/**
|
|
@@ -7,6 +7,7 @@ export declare class CSSPropertyNumber implements Partial<CSSProperty<CSSUnitVal
|
|
|
7
7
|
(...args: any[]): any;
|
|
8
8
|
cache: Map<any, any>;
|
|
9
9
|
};
|
|
10
|
+
parserUnmemoize: (string: string | number) => CSSUnitValue;
|
|
10
11
|
parserWithCSSDisabled: any;
|
|
11
12
|
calculator(name: string, oldParsed: CSSUnitValue, computed: CSSUnitValue): number;
|
|
12
13
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { DisplayObject } from '../../display-objects';
|
|
2
2
|
import type { CSSUnitValue } from '../cssom';
|
|
3
3
|
import type { CSSProperty } from '../CSSProperty';
|
|
4
4
|
export declare class CSSPropertyOffsetDistance implements Partial<CSSProperty<CSSUnitValue, number>> {
|
|
@@ -6,6 +6,7 @@ export declare class CSSPropertyOffsetDistance implements Partial<CSSProperty<CS
|
|
|
6
6
|
(...args: any[]): any;
|
|
7
7
|
cache: Map<any, any>;
|
|
8
8
|
};
|
|
9
|
+
parserUnmemoize: (string: string | number) => CSSUnitValue;
|
|
9
10
|
parserWithCSSDisabled: any;
|
|
10
11
|
calculator(name: string, oldParsed: CSSUnitValue, computed: CSSUnitValue): number;
|
|
11
12
|
mixer: (left: number, right: number) => [number, number, (i: number) => string];
|
|
@@ -8,6 +8,7 @@ export declare class CSSPropertyOpacity implements Partial<CSSProperty<CSSUnitVa
|
|
|
8
8
|
(...args: any[]): any;
|
|
9
9
|
cache: Map<any, any>;
|
|
10
10
|
};
|
|
11
|
+
parserUnmemoize: (string: string | number) => CSSUnitValue;
|
|
11
12
|
parserWithCSSDisabled: any;
|
|
12
13
|
calculator(name: string, oldParsed: CSSUnitValue, computed: CSSUnitValue): number;
|
|
13
14
|
mixer: (left: number, right: number) => [number, number, (i: number) => string];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AbsoluteArray } from '@antv/util';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ParsedPathStyleProps } from '../../display-objects';
|
|
3
3
|
import { Rectangle } from '../../shapes';
|
|
4
4
|
import type { CSSProperty } from '../CSSProperty';
|
|
5
5
|
import { mergePaths, parsePath } from '../parser/path';
|
|
@@ -20,8 +20,4 @@ export declare class CSSPropertyPath implements Partial<CSSProperty<ParsedPathSt
|
|
|
20
20
|
rect: Rectangle;
|
|
21
21
|
};
|
|
22
22
|
mixer: typeof mergePaths;
|
|
23
|
-
/**
|
|
24
|
-
* update local position
|
|
25
|
-
*/
|
|
26
|
-
postProcessor(object: DisplayObject, attributes: string[]): void;
|
|
27
23
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { DisplayObject } from '../../display-objects';
|
|
2
1
|
import type { CSSProperty } from '../CSSProperty';
|
|
3
2
|
import { parsePoints, mergePoints } from '../parser/points';
|
|
4
3
|
export declare class CSSPropertyPoints implements Partial<CSSProperty<{
|
|
@@ -11,9 +10,5 @@ export declare class CSSPropertyPoints implements Partial<CSSProperty<{
|
|
|
11
10
|
segments: [number, number][];
|
|
12
11
|
}>> {
|
|
13
12
|
parser: typeof parsePoints;
|
|
14
|
-
/**
|
|
15
|
-
* update local position
|
|
16
|
-
*/
|
|
17
|
-
postProcessor(object: DisplayObject, attributes: string[]): void;
|
|
18
13
|
mixer: typeof mergePoints;
|
|
19
14
|
}
|
|
@@ -2,7 +2,7 @@ import type { DisplayObject } from '../../display-objects';
|
|
|
2
2
|
import { CSSKeywordValue } from '../cssom';
|
|
3
3
|
import type { CSSProperty } from '../CSSProperty';
|
|
4
4
|
import type { ParsedTransform } from '../parser/transform';
|
|
5
|
-
import { mergeTransforms, parseTransform } from '../parser/transform';
|
|
5
|
+
import { mergeTransforms, parseTransform, parseTransformUnmemoize } from '../parser/transform';
|
|
6
6
|
/**
|
|
7
7
|
* @see /zh/docs/api/animation#支持变换的属性
|
|
8
8
|
*
|
|
@@ -35,7 +35,8 @@ import { mergeTransforms, parseTransform } from '../parser/transform';
|
|
|
35
35
|
*/
|
|
36
36
|
export declare class CSSPropertyTransform implements Partial<CSSProperty<CSSKeywordValue | ParsedTransform[], ParsedTransform[]>> {
|
|
37
37
|
parser: typeof parseTransform;
|
|
38
|
-
|
|
38
|
+
parserUnmemoize: typeof parseTransformUnmemoize;
|
|
39
|
+
parserWithCSSDisabled: typeof parseTransformUnmemoize;
|
|
39
40
|
calculator(name: string, oldParsed: CSSKeywordValue | ParsedTransform[], parsed: CSSKeywordValue | ParsedTransform[], object: DisplayObject): ParsedTransform[];
|
|
40
41
|
mixer: typeof mergeTransforms;
|
|
41
42
|
postProcessor(object: DisplayObject): void;
|
|
@@ -6,6 +6,7 @@ export declare class CSSPropertyZIndex implements Partial<CSSProperty<CSSUnitVal
|
|
|
6
6
|
(...args: any[]): any;
|
|
7
7
|
cache: Map<any, any>;
|
|
8
8
|
};
|
|
9
|
+
parserUnmemoize: (string: string | number) => CSSUnitValue;
|
|
9
10
|
calculator(name: string, oldParsed: CSSUnitValue, computed: CSSUnitValue, object: DisplayObject): number;
|
|
10
11
|
postProcessor(object: DisplayObject): void;
|
|
11
12
|
}
|
|
@@ -5,7 +5,6 @@ export * from './CSSPropertyFilter';
|
|
|
5
5
|
export * from './CSSPropertyLengthOrPercentage';
|
|
6
6
|
export * from './CSSPropertyLengthOrPercentage12';
|
|
7
7
|
export * from './CSSPropertyLengthOrPercentage14';
|
|
8
|
-
export * from './CSSPropertyLocalPosition';
|
|
9
8
|
export * from './CSSPropertyMarker';
|
|
10
9
|
export * from './CSSPropertyNumber';
|
|
11
10
|
export * from './CSSPropertyOffsetDistance';
|
|
@@ -46,7 +46,7 @@ export declare class DisplayObject<StyleProps extends BaseStyleProps = any, Pars
|
|
|
46
46
|
destroy(): void;
|
|
47
47
|
cloneNode(deep?: boolean, customCloneFunc?: (name: string, attribute: any) => any): this;
|
|
48
48
|
private initAttributes;
|
|
49
|
-
setAttribute<Key extends keyof StyleProps>(name: Key, value: StyleProps[Key], force?: boolean): void;
|
|
49
|
+
setAttribute<Key extends keyof StyleProps>(name: Key, value: StyleProps[Key], force?: boolean, memoize?: boolean): void;
|
|
50
50
|
/**
|
|
51
51
|
* called when attributes get changed or initialized
|
|
52
52
|
*/
|