@antv/g-lite 2.0.11 → 2.1.0-alpha.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/Canvas.d.ts +2 -1
- package/dist/css/CSSProperty.d.ts +2 -10
- package/dist/css/StyleValueRegistry.d.ts +0 -23
- package/dist/css/cssom/CSSColorValue.d.ts +1 -0
- package/dist/css/cssom/CSSStyleValue.d.ts +1 -1
- package/dist/css/cssom/index.d.ts +0 -1
- package/dist/css/cssom/types.d.ts +0 -7
- package/dist/css/interfaces.d.ts +0 -6
- package/dist/css/parser/transform-origin.d.ts +0 -2
- package/dist/css/parser/transform.d.ts +3 -2
- package/dist/css/properties/CSSPropertyAngle.d.ts +0 -6
- package/dist/css/properties/CSSPropertyColor.d.ts +0 -4
- package/dist/css/properties/CSSPropertyFilter.d.ts +0 -2
- package/dist/css/properties/CSSPropertyLengthOrPercentage.d.ts +0 -6
- package/dist/css/properties/CSSPropertyLengthOrPercentage12.d.ts +0 -1
- package/dist/css/properties/CSSPropertyLengthOrPercentage14.d.ts +0 -1
- package/dist/css/properties/CSSPropertyNumber.d.ts +0 -6
- package/dist/css/properties/CSSPropertyOffsetDistance.d.ts +0 -6
- package/dist/css/properties/CSSPropertyOpacity.d.ts +0 -6
- package/dist/css/properties/CSSPropertyPath.d.ts +0 -1
- package/dist/css/properties/CSSPropertyPoints.d.ts +1 -2
- package/dist/css/properties/CSSPropertyTransform.d.ts +2 -4
- package/dist/css/properties/CSSPropertyTransformOrigin.d.ts +0 -5
- package/dist/css/properties/CSSPropertyZIndex.d.ts +0 -5
- package/dist/display-objects/DisplayObject.d.ts +0 -8
- package/dist/display-objects/Fragment.d.ts +13 -0
- package/dist/display-objects/index.d.ts +1 -0
- package/dist/dom/Element.d.ts +2 -2
- package/dist/dom/Node.d.ts +6 -1
- package/dist/dom/interfaces.d.ts +2 -1
- package/dist/global-runtime.d.ts +0 -12
- package/dist/index.esm.js +1400 -2083
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1517 -2199
- 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/plugins/PrepareRendererPlugin.d.ts +2 -4
- package/dist/services/SceneGraphService.d.ts +12 -11
- package/dist/services/interfaces.d.ts +6 -5
- package/dist/types.d.ts +54 -1
- package/dist/utils/assert.d.ts +0 -9
- package/dist/utils/canvas.d.ts +1 -1
- package/dist/utils/fragment.d.ts +2 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/math.d.ts +1 -8
- package/package.json +1 -1
- package/dist/css/cssom/CSSMathOperator.d.ts +0 -11
- package/dist/css/cssom/CSSNumericSumValue.d.ts +0 -7
- package/dist/css/properties/CSSPropertyLocalPosition.d.ts +0 -13
- package/dist/utils/string.d.ts +0 -5
package/dist/Canvas.d.ts
CHANGED
|
@@ -136,7 +136,8 @@ export declare class Canvas extends EventTarget implements ICanvas {
|
|
|
136
136
|
setRenderer(renderer: IRenderer): void;
|
|
137
137
|
setCursor(cursor: Cursor): void;
|
|
138
138
|
unmountChildren(parent: DisplayObject): void;
|
|
139
|
-
mountChildren(
|
|
139
|
+
mountChildren(child: DisplayObject, skipTriggerEvent?: boolean): void;
|
|
140
|
+
mountFragment(child: DisplayObject): void;
|
|
140
141
|
client2Viewport(client: PointLike): PointLike;
|
|
141
142
|
viewport2Client(canvas: PointLike): PointLike;
|
|
142
143
|
viewport2Canvas(viewport: PointLike): PointLike;
|
|
@@ -21,15 +21,7 @@ export interface CSSProperty<Parsed, Used> {
|
|
|
21
21
|
* '10px' -> CSS.px(10)
|
|
22
22
|
* '180deg' -> CSS.deg(180)
|
|
23
23
|
*/
|
|
24
|
-
parser
|
|
25
|
-
/**
|
|
26
|
-
* Don't use memoize, eg. during animation.
|
|
27
|
-
*/
|
|
28
|
-
parserUnmemoize: CSSPropertyParser<Parsed>;
|
|
29
|
-
/**
|
|
30
|
-
* Ignore CSS syntax.
|
|
31
|
-
*/
|
|
32
|
-
parserWithCSSDisabled: CSSPropertyParser<Parsed>;
|
|
24
|
+
parser?: CSSPropertyParser<Parsed>;
|
|
33
25
|
/**
|
|
34
26
|
* convert parsed value to used value.
|
|
35
27
|
* eg. in `lineWidth`, convert [CSSUnitValue] to [CSSUnitValue, CSSUnitValue]
|
|
@@ -45,6 +37,6 @@ export interface CSSProperty<Parsed, Used> {
|
|
|
45
37
|
/**
|
|
46
38
|
* eg. update local position after x/y/z caculated
|
|
47
39
|
*/
|
|
48
|
-
postProcessor: (object: IElement
|
|
40
|
+
postProcessor: (object: IElement) => void;
|
|
49
41
|
}
|
|
50
42
|
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { DisplayObject } from '../display-objects';
|
|
2
2
|
import type { GlobalRuntime } from '../global-runtime';
|
|
3
3
|
import type { BaseStyleProps } from '../types';
|
|
4
|
-
import type { CSSStyleValue } from './cssom';
|
|
5
4
|
import type { PropertyMetadata, PropertyParseOptions, StyleValueRegistry } from './interfaces';
|
|
6
5
|
export type CSSGlobalKeywords = 'unset' | 'initial' | 'inherit' | '';
|
|
7
6
|
/**
|
|
@@ -11,12 +10,8 @@ export declare const BUILT_IN_PROPERTIES: PropertyMetadata[];
|
|
|
11
10
|
export declare const propertyMetadataCache: Record<string, PropertyMetadata>;
|
|
12
11
|
export declare class DefaultStyleValueRegistry implements StyleValueRegistry {
|
|
13
12
|
private runtime;
|
|
14
|
-
/**
|
|
15
|
-
* need recalc later
|
|
16
|
-
*/
|
|
17
13
|
constructor(runtime: GlobalRuntime);
|
|
18
14
|
registerMetadata(metadata: PropertyMetadata): void;
|
|
19
|
-
unregisterMetadata(name: string): void;
|
|
20
15
|
getPropertySyntax(syntax: string): any;
|
|
21
16
|
/**
|
|
22
17
|
* * parse value, eg.
|
|
@@ -28,28 +23,10 @@ export declare class DefaultStyleValueRegistry implements StyleValueRegistry {
|
|
|
28
23
|
* * post process
|
|
29
24
|
*/
|
|
30
25
|
processProperties(object: DisplayObject, attributes: BaseStyleProps, options?: Partial<PropertyParseOptions>): void;
|
|
31
|
-
/**
|
|
32
|
-
* string -> parsed value
|
|
33
|
-
*/
|
|
34
|
-
parseProperty(name: string, value: any, object: DisplayObject, memoized: boolean): CSSStyleValue;
|
|
35
|
-
/**
|
|
36
|
-
* computed value -> used value
|
|
37
|
-
*/
|
|
38
|
-
computeProperty(name: string, computed: CSSStyleValue, object: DisplayObject, memoized: boolean): any;
|
|
39
|
-
postProcessProperty(name: string, object: DisplayObject, attributes: string[]): void;
|
|
40
|
-
/**
|
|
41
|
-
* resolve later
|
|
42
|
-
*/
|
|
43
|
-
addUnresolveProperty(object: DisplayObject, name: string): void;
|
|
44
|
-
tryToResolveProperty(object: DisplayObject, name: string, options?: {
|
|
45
|
-
inherited?: boolean;
|
|
46
|
-
}): any;
|
|
47
|
-
recalc(object: DisplayObject): void;
|
|
48
26
|
/**
|
|
49
27
|
* update geometry when relative props changed,
|
|
50
28
|
* eg. r of Circle, width/height of Rect
|
|
51
29
|
*/
|
|
52
30
|
updateGeometry(object: DisplayObject): void;
|
|
53
31
|
updateSizeAttenuation(node: DisplayObject, zoom: number): void;
|
|
54
|
-
private isPropertyInheritable;
|
|
55
32
|
}
|
|
@@ -24,7 +24,7 @@ export declare const canonicalUnitTypeForCategory: (category: UnitCategory) => U
|
|
|
24
24
|
* @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/css_primitive_value.cc#353
|
|
25
25
|
*/
|
|
26
26
|
export declare const conversionToCanonicalUnitsScaleFactor: (unit_type: UnitType) => number;
|
|
27
|
-
export declare const unitTypeToString: (type: UnitType) => "" | "
|
|
27
|
+
export declare const unitTypeToString: (type: UnitType) => "px" | "" | "em" | "deg" | "rad" | "grad" | "ms" | "s" | "rem" | "turn" | "%";
|
|
28
28
|
/**
|
|
29
29
|
* CSSStyleValue is the base class for all CSS values accessible from Typed OM.
|
|
30
30
|
* Values that are not yet supported as specific types are also returned as base CSSStyleValues.
|
|
@@ -21,13 +21,6 @@ export declare enum UnitCategory {
|
|
|
21
21
|
kUTime = 4,
|
|
22
22
|
kUOther = 5
|
|
23
23
|
}
|
|
24
|
-
export declare enum ValueRange {
|
|
25
|
-
kAll = 0,
|
|
26
|
-
kNonNegative = 1,
|
|
27
|
-
kInteger = 2,
|
|
28
|
-
kNonNegativeInteger = 3,
|
|
29
|
-
kPositiveInteger = 4
|
|
30
|
-
}
|
|
31
24
|
export declare enum Nested {
|
|
32
25
|
kYes = 0,
|
|
33
26
|
kNo = 1
|
package/dist/css/interfaces.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { BaseStyleProps } from '..';
|
|
2
2
|
import type { DisplayObject } from '../display-objects';
|
|
3
|
-
import type { CSSStyleValue } from './cssom';
|
|
4
3
|
import type { CSSProperty } from './CSSProperty';
|
|
5
4
|
/**
|
|
6
5
|
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type
|
|
@@ -121,15 +120,10 @@ export interface PropertyParseOptions {
|
|
|
121
120
|
memoize: boolean;
|
|
122
121
|
}
|
|
123
122
|
export interface StyleValueRegistry {
|
|
124
|
-
recalc: (displayObject: DisplayObject) => void;
|
|
125
123
|
updateSizeAttenuation: (displayObject: DisplayObject, zoom: number) => void;
|
|
126
124
|
registerMetadata: (metadata: PropertyMetadata) => void;
|
|
127
|
-
unregisterMetadata: (name: string) => void;
|
|
128
125
|
getPropertySyntax: (syntax: string) => CSSProperty<any, any>;
|
|
129
|
-
addUnresolveProperty: (object: DisplayObject, name: string) => void;
|
|
130
126
|
processProperties: (object: DisplayObject, attributes: BaseStyleProps, options?: Partial<PropertyParseOptions>) => void;
|
|
131
|
-
parseProperty: (name: string, value: any, object: DisplayObject, memoized: boolean) => CSSStyleValue;
|
|
132
|
-
computeProperty: (name: string, computed: CSSStyleValue, object: DisplayObject, memoized: boolean) => any;
|
|
133
127
|
}
|
|
134
128
|
export interface LayoutRegistry {
|
|
135
129
|
registerLayout: (name: string, ctor: any) => void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { CSSUnitValue } from '../cssom';
|
|
2
1
|
/**
|
|
3
2
|
* @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-origin
|
|
4
3
|
* eg. 'center' 'top left' '50px 50px'
|
|
@@ -7,4 +6,3 @@ export declare const parseTransformOrigin: {
|
|
|
7
6
|
(...args: any[]): any;
|
|
8
7
|
cache: Map<any, any>;
|
|
9
8
|
};
|
|
10
|
-
export declare const parseTransformOriginUnmemoize: (value: string | number[]) => [CSSUnitValue, CSSUnitValue];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DisplayObject } from '../../display-objects';
|
|
2
2
|
import { CSSUnitValue } from '../cssom';
|
|
3
|
+
import type { TransformArray } from '../../types';
|
|
3
4
|
export interface ParsedTransform {
|
|
4
5
|
t: string;
|
|
5
6
|
d: CSSUnitValue[];
|
|
@@ -9,8 +10,8 @@ export interface ParsedTransform {
|
|
|
9
10
|
* scale(1) scale(1, 2)
|
|
10
11
|
* scaleX(1)
|
|
11
12
|
*/
|
|
12
|
-
export declare function parseTransform(
|
|
13
|
-
export declare function parseTransformUnmemoize(
|
|
13
|
+
export declare function parseTransform(transform: string | TransformArray): ParsedTransform[];
|
|
14
|
+
export declare function parseTransformUnmemoize(transform: string | TransformArray): ParsedTransform[];
|
|
14
15
|
export declare function convertItemToMatrix(item: ParsedTransform): number[];
|
|
15
16
|
export declare const composeMatrix: (translate: any, scale: any, skew: any, quat: any, perspective: any) => number[];
|
|
16
17
|
export declare function mergeTransforms(left: ParsedTransform[], right: ParsedTransform[], target: DisplayObject | null): [number[][], number[][], (d: number[][]) => string];
|
|
@@ -3,12 +3,6 @@ import type { CSSUnitValue } from '../cssom';
|
|
|
3
3
|
import type { CSSProperty } from '../CSSProperty';
|
|
4
4
|
import { mergeNumbers } from '../parser';
|
|
5
5
|
export declare class CSSPropertyAngle implements Partial<CSSProperty<CSSUnitValue, number>> {
|
|
6
|
-
parser: {
|
|
7
|
-
(...args: any[]): any;
|
|
8
|
-
cache: Map<any, any>;
|
|
9
|
-
};
|
|
10
|
-
parserUnmemoize: (css: string) => CSSUnitValue;
|
|
11
|
-
parserWithCSSDisabled: any;
|
|
12
6
|
mixer: typeof mergeNumbers;
|
|
13
7
|
calculator(name: string, oldParsed: CSSUnitValue, parsed: CSSUnitValue, object: DisplayObject): number;
|
|
14
8
|
}
|
|
@@ -9,10 +9,6 @@ export declare class CSSPropertyColor implements Partial<CSSProperty<CSSRGB | CS
|
|
|
9
9
|
(...args: any[]): any;
|
|
10
10
|
cache: Map<any, any>;
|
|
11
11
|
};
|
|
12
|
-
parserWithCSSDisabled: {
|
|
13
|
-
(...args: any[]): any;
|
|
14
|
-
cache: Map<any, any>;
|
|
15
|
-
};
|
|
16
12
|
calculator(name: string, oldParsed: CSSRGB | CSSGradientValue[] | CSSKeywordValue | Pattern, parsed: CSSRGB | CSSGradientValue[] | CSSKeywordValue | Pattern, object: DisplayObject): CSSRGB | CSSGradientValue[] | Pattern;
|
|
17
13
|
mixer: typeof mergeColors;
|
|
18
14
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { CSSProperty } from '../CSSProperty';
|
|
2
2
|
import type { ParsedFilterStyleProperty } from '../parser';
|
|
3
|
-
import { parseFilter } from '../parser/filter';
|
|
4
3
|
export declare class CSSPropertyFilter implements Partial<CSSProperty<ParsedFilterStyleProperty[], ParsedFilterStyleProperty[]>> {
|
|
5
|
-
parser: typeof parseFilter;
|
|
6
4
|
calculator(name: string, oldParsed: ParsedFilterStyleProperty[], parsed: ParsedFilterStyleProperty[]): ParsedFilterStyleProperty[];
|
|
7
5
|
}
|
|
@@ -7,12 +7,6 @@ import { mergeNumbers } from '../parser';
|
|
|
7
7
|
* <length> & <percentage>
|
|
8
8
|
*/
|
|
9
9
|
export declare class CSSPropertyLengthOrPercentage implements Partial<CSSProperty<CSSUnitValue, number>> {
|
|
10
|
-
parser: {
|
|
11
|
-
(...args: any[]): any;
|
|
12
|
-
cache: Map<any, any>;
|
|
13
|
-
};
|
|
14
|
-
parserUnmemoize: (css: string) => CSSUnitValue;
|
|
15
|
-
parserWithCSSDisabled: any;
|
|
16
10
|
mixer: typeof mergeNumbers;
|
|
17
11
|
/**
|
|
18
12
|
* according to parent's bounds
|
|
@@ -10,7 +10,6 @@ import { mergeNumberLists } from '../parser';
|
|
|
10
10
|
* rect.style.lineDash = '10 10';
|
|
11
11
|
*/
|
|
12
12
|
export declare class CSSPropertyLengthOrPercentage12 implements Partial<CSSProperty<[CSSUnitValue, CSSUnitValue], [number, number]>> {
|
|
13
|
-
parser(radius: string | number | number[]): [CSSUnitValue, CSSUnitValue];
|
|
14
13
|
calculator(name: string, oldParsed: [CSSUnitValue, CSSUnitValue], computed: [CSSUnitValue, CSSUnitValue]): [number, number];
|
|
15
14
|
mixer: typeof mergeNumberLists;
|
|
16
15
|
}
|
|
@@ -20,7 +20,6 @@ export declare class CSSPropertyLengthOrPercentage14 implements Partial<CSSPrope
|
|
|
20
20
|
number,
|
|
21
21
|
number
|
|
22
22
|
]>> {
|
|
23
|
-
parser(radius: string | number | number[]): [CSSUnitValue, CSSUnitValue, CSSUnitValue, CSSUnitValue];
|
|
24
23
|
calculator(name: string, oldParsed: [CSSUnitValue, CSSUnitValue, CSSUnitValue, CSSUnitValue], computed: [CSSUnitValue, CSSUnitValue, CSSUnitValue, CSSUnitValue]): [number, number, number, number];
|
|
25
24
|
mixer: typeof mergeNumberLists;
|
|
26
25
|
}
|
|
@@ -3,11 +3,5 @@ import type { CSSProperty } from '../CSSProperty';
|
|
|
3
3
|
import { mergeNumbers } from '../parser/numeric';
|
|
4
4
|
export declare class CSSPropertyNumber implements Partial<CSSProperty<CSSUnitValue, number>> {
|
|
5
5
|
mixer: typeof mergeNumbers;
|
|
6
|
-
parser: {
|
|
7
|
-
(...args: any[]): any;
|
|
8
|
-
cache: Map<any, any>;
|
|
9
|
-
};
|
|
10
|
-
parserUnmemoize: (string: string | number) => CSSUnitValue;
|
|
11
|
-
parserWithCSSDisabled: any;
|
|
12
6
|
calculator(name: string, oldParsed: CSSUnitValue, computed: CSSUnitValue): number;
|
|
13
7
|
}
|
|
@@ -2,12 +2,6 @@ import type { 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>> {
|
|
5
|
-
parser: {
|
|
6
|
-
(...args: any[]): any;
|
|
7
|
-
cache: Map<any, any>;
|
|
8
|
-
};
|
|
9
|
-
parserUnmemoize: (string: string | number) => CSSUnitValue;
|
|
10
|
-
parserWithCSSDisabled: any;
|
|
11
5
|
calculator(name: string, oldParsed: CSSUnitValue, computed: CSSUnitValue): number;
|
|
12
6
|
mixer: (left: number, right: number) => [number, number, (i: number) => string];
|
|
13
7
|
postProcessor(object: DisplayObject): void;
|
|
@@ -4,12 +4,6 @@ import type { CSSProperty } from '../CSSProperty';
|
|
|
4
4
|
* opacity
|
|
5
5
|
*/
|
|
6
6
|
export declare class CSSPropertyOpacity implements Partial<CSSProperty<CSSUnitValue, number>> {
|
|
7
|
-
parser: {
|
|
8
|
-
(...args: any[]): any;
|
|
9
|
-
cache: Map<any, any>;
|
|
10
|
-
};
|
|
11
|
-
parserUnmemoize: (string: string | number) => CSSUnitValue;
|
|
12
|
-
parserWithCSSDisabled: any;
|
|
13
7
|
calculator(name: string, oldParsed: CSSUnitValue, computed: CSSUnitValue): number;
|
|
14
8
|
mixer: (left: number, right: number) => [number, number, (i: number) => string];
|
|
15
9
|
}
|
|
@@ -8,7 +8,6 @@ export declare class CSSPropertyPath implements Partial<CSSProperty<ParsedPathSt
|
|
|
8
8
|
* path2Curve
|
|
9
9
|
*/
|
|
10
10
|
parser: typeof parsePath;
|
|
11
|
-
parserWithCSSDisabled: typeof parsePath;
|
|
12
11
|
calculator(name: string, oldParsed: ParsedPathStyleProps['d'], parsed: ParsedPathStyleProps['d']): {
|
|
13
12
|
absolutePath: AbsoluteArray;
|
|
14
13
|
hasArc: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CSSProperty } from '../CSSProperty';
|
|
2
|
-
import {
|
|
2
|
+
import { mergePoints } from '../parser/points';
|
|
3
3
|
export declare class CSSPropertyPoints implements Partial<CSSProperty<{
|
|
4
4
|
points: [number, number][];
|
|
5
5
|
totalLength: number;
|
|
@@ -9,6 +9,5 @@ export declare class CSSPropertyPoints implements Partial<CSSProperty<{
|
|
|
9
9
|
totalLength: number;
|
|
10
10
|
segments: [number, number][];
|
|
11
11
|
}>> {
|
|
12
|
-
parser: typeof parsePoints;
|
|
13
12
|
mixer: typeof mergePoints;
|
|
14
13
|
}
|
|
@@ -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,
|
|
5
|
+
import { mergeTransforms, parseTransformUnmemoize } from '../parser/transform';
|
|
6
6
|
/**
|
|
7
7
|
* @see /zh/docs/api/animation#支持变换的属性
|
|
8
8
|
*
|
|
@@ -34,9 +34,7 @@ import { mergeTransforms, parseTransform, parseTransformUnmemoize } from '../par
|
|
|
34
34
|
* * perspective
|
|
35
35
|
*/
|
|
36
36
|
export declare class CSSPropertyTransform implements Partial<CSSProperty<CSSKeywordValue | ParsedTransform[], ParsedTransform[]>> {
|
|
37
|
-
parser: typeof
|
|
38
|
-
parserUnmemoize: typeof parseTransformUnmemoize;
|
|
39
|
-
parserWithCSSDisabled: typeof parseTransformUnmemoize;
|
|
37
|
+
parser: typeof parseTransformUnmemoize;
|
|
40
38
|
calculator(name: string, oldParsed: CSSKeywordValue | ParsedTransform[], parsed: CSSKeywordValue | ParsedTransform[], object: DisplayObject): ParsedTransform[];
|
|
41
39
|
mixer: typeof mergeTransforms;
|
|
42
40
|
postProcessor(object: DisplayObject): void;
|
|
@@ -7,10 +7,5 @@ import type { CSSProperty } from '../CSSProperty';
|
|
|
7
7
|
* [10px, 10px] [10%, 10%]
|
|
8
8
|
*/
|
|
9
9
|
export declare class CSSPropertyTransformOrigin implements Partial<CSSProperty<[CSSUnitValue, CSSUnitValue], [CSSUnitValue, CSSUnitValue]>> {
|
|
10
|
-
parser: {
|
|
11
|
-
(...args: any[]): any;
|
|
12
|
-
cache: Map<any, any>;
|
|
13
|
-
};
|
|
14
|
-
parserUnmemoize: (value: string | number[]) => [CSSUnitValue, CSSUnitValue];
|
|
15
10
|
postProcessor(object: DisplayObject): void;
|
|
16
11
|
}
|
|
@@ -2,11 +2,6 @@ import type { DisplayObject } from '../../display-objects';
|
|
|
2
2
|
import type { CSSUnitValue } from '../cssom';
|
|
3
3
|
import type { CSSProperty } from '../CSSProperty';
|
|
4
4
|
export declare class CSSPropertyZIndex implements Partial<CSSProperty<CSSUnitValue, number>> {
|
|
5
|
-
parser: {
|
|
6
|
-
(...args: any[]): any;
|
|
7
|
-
cache: Map<any, any>;
|
|
8
|
-
};
|
|
9
|
-
parserUnmemoize: (string: string | number) => CSSUnitValue;
|
|
10
5
|
calculator(name: string, oldParsed: CSSUnitValue, computed: CSSUnitValue, object: DisplayObject): number;
|
|
11
6
|
postProcessor(object: DisplayObject): void;
|
|
12
7
|
}
|
|
@@ -34,14 +34,6 @@ export declare class DisplayObject<StyleProps extends BaseStyleProps = any, Pars
|
|
|
34
34
|
* push to active animations after calling `animate()`
|
|
35
35
|
*/
|
|
36
36
|
private activeAnimations;
|
|
37
|
-
/**
|
|
38
|
-
* Use data-* attribute.
|
|
39
|
-
* @see https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes
|
|
40
|
-
* @example
|
|
41
|
-
* group.dataset.prop1 = 1;
|
|
42
|
-
* group.getAttribute('data-prop1'); // 1
|
|
43
|
-
*/
|
|
44
|
-
dataset: any;
|
|
45
37
|
constructor(config: DisplayObjectConfig<StyleProps>);
|
|
46
38
|
destroy(): void;
|
|
47
39
|
cloneNode(deep?: boolean, customCloneFunc?: (name: string, attribute: any) => any): this;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DisplayObject } from './DisplayObject';
|
|
2
|
+
/**
|
|
3
|
+
* 节点片段,用于包裹多个节点并批量操作
|
|
4
|
+
*
|
|
5
|
+
* 向 Fragment 或者根节点为 Fragment 的节点添加子节点时,不会触发渲染和事件。
|
|
6
|
+
*
|
|
7
|
+
* 当 Fragment 被挂载到 Canvas 中的节点时,其子节点会一次性被渲染,并触发合并事件。
|
|
8
|
+
*
|
|
9
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment
|
|
10
|
+
*/
|
|
11
|
+
export declare class Fragment extends DisplayObject {
|
|
12
|
+
constructor();
|
|
13
|
+
}
|
package/dist/dom/Element.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Cullable, Geometry, RBushNode, Renderable, Sortable, Transform } from '../components';
|
|
2
2
|
import type { AABB, Rectangle } from '../shapes';
|
|
3
|
-
import type
|
|
3
|
+
import { type BaseStyleProps, type ParsedBaseStyleProps } from '../types';
|
|
4
4
|
import { Node } from './Node';
|
|
5
5
|
import type { ICSSStyleDeclaration, IElement, INode } from './interfaces';
|
|
6
6
|
export declare function resetEntityCounter(): void;
|
|
@@ -155,7 +155,7 @@ export declare class Element<StyleProps extends BaseStyleProps = any, ParsedStyl
|
|
|
155
155
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style
|
|
156
156
|
*/
|
|
157
157
|
style: StyleProps & ICSSStyleDeclaration<StyleProps>;
|
|
158
|
-
computedStyle:
|
|
158
|
+
computedStyle: {};
|
|
159
159
|
/**
|
|
160
160
|
* Renderers will use these used values.
|
|
161
161
|
*/
|
package/dist/dom/Node.d.ts
CHANGED
|
@@ -135,5 +135,10 @@ export declare abstract class Node extends EventTarget implements INode {
|
|
|
135
135
|
contain<T extends INode>(other: T | null): boolean;
|
|
136
136
|
contains<T extends INode>(other: T | null): boolean;
|
|
137
137
|
getAncestor(n: number): INode | null;
|
|
138
|
-
|
|
138
|
+
/**
|
|
139
|
+
* iterate current node and its descendants
|
|
140
|
+
* @param callback - callback to execute for each node, return false to break
|
|
141
|
+
* @param assigned - whether to iterate assigned nodes
|
|
142
|
+
*/
|
|
143
|
+
forEach(callback: (o: INode) => void | boolean): void;
|
|
139
144
|
}
|
package/dist/dom/interfaces.d.ts
CHANGED
|
@@ -124,7 +124,7 @@ export interface INode extends IEventTarget {
|
|
|
124
124
|
/**
|
|
125
125
|
* Traverse in sub tree.
|
|
126
126
|
*/
|
|
127
|
-
forEach: (callback: (o: INode) => void | boolean
|
|
127
|
+
forEach: (callback: (o: INode) => void | boolean) => void;
|
|
128
128
|
/**
|
|
129
129
|
* Returns whether node has children.
|
|
130
130
|
*/
|
|
@@ -421,6 +421,7 @@ export interface ICanvas extends IEventTarget {
|
|
|
421
421
|
context: CanvasContext;
|
|
422
422
|
mountChildren: (parent: INode) => void;
|
|
423
423
|
unmountChildren: (parent: INode) => void;
|
|
424
|
+
mountFragment: (fragment: INode) => void;
|
|
424
425
|
getConfig: () => Partial<CanvasConfig>;
|
|
425
426
|
getCamera: () => ICamera;
|
|
426
427
|
getContextService: () => ContextService<unknown>;
|
package/dist/global-runtime.d.ts
CHANGED
|
@@ -21,21 +21,9 @@ export interface GlobalRuntime {
|
|
|
21
21
|
layoutRegistry: LayoutRegistry;
|
|
22
22
|
CSSPropertySyntaxFactory: Record<PropertySyntax, Partial<CSSProperty<any, any>>>;
|
|
23
23
|
globalThis: any;
|
|
24
|
-
enableCSSParsing: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Enable using dataset property.
|
|
27
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset
|
|
28
|
-
*/
|
|
29
|
-
enableDataset: boolean;
|
|
30
24
|
/**
|
|
31
25
|
* circle.style.r = 100;
|
|
32
26
|
*/
|
|
33
27
|
enableStyleSyntax: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Enable using dash-cased attribute.
|
|
36
|
-
* @example
|
|
37
|
-
* circle.setAttribute('stroke-width', '2');
|
|
38
|
-
*/
|
|
39
|
-
enableAttributeDashCased: boolean;
|
|
40
28
|
enableSizeAttenuation: boolean;
|
|
41
29
|
}
|