@antv/g-lite 1.3.0-next.2 → 1.3.0-next.20

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,5 +1,9 @@
1
1
  import type { AABB } from '../shapes';
2
2
  export interface Geometry {
3
+ /**
4
+ * Need re-compute bounds.
5
+ */
6
+ dirty: boolean;
3
7
  /**
4
8
  * excluding all children
5
9
  */
@@ -49,6 +49,6 @@ export declare class DefaultStyleValueRegistry implements StyleValueRegistry {
49
49
  * update geometry when relative props changed,
50
50
  * eg. r of Circle, width/height of Rect
51
51
  */
52
- private updateGeometry;
52
+ updateGeometry(object: DisplayObject): void;
53
53
  private isPropertyInheritable;
54
54
  }
@@ -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) => "em" | "px" | "deg" | "rad" | "grad" | "ms" | "s" | "rem" | "turn" | "" | "%";
27
+ export declare const unitTypeToString: (type: UnitType) => "" | "em" | "px" | "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.
@@ -51,4 +51,4 @@ export declare function convertAngleUnit(value: CSSUnitValue): number;
51
51
  export declare function parseDimensionArrayFormat(string: string | number | (string | number)[], size: number): number[];
52
52
  export declare function parseDimensionArray(string: string | (string | number)[]): CSSUnitValue[];
53
53
  export declare function parseDimensionArrayUnmemoize(string: string | (string | number)[]): CSSUnitValue[];
54
- export declare function convertPercentUnit(valueWithUnit: CSSUnitValue, vec3Index: number, target: DisplayObject): number;
54
+ export declare function convertPercentUnit(valueWithUnit: CSSUnitValue, vec3Index: number, target: DisplayObject, useMin?: boolean): number;
@@ -1,5 +1,5 @@
1
1
  import type { CurveArray, PathArray } from '@antv/util';
2
2
  import type { ParsedPathStyleProps } from '../../display-objects';
3
3
  import type { IElement } from '../../dom';
4
- export declare function parsePath(path: string | PathArray): ParsedPathStyleProps['path'];
5
- export declare function mergePaths(left: ParsedPathStyleProps['path'], right: ParsedPathStyleProps['path'], object?: IElement): [CurveArray, CurveArray, (b: CurveArray) => CurveArray];
4
+ export declare function parsePath(path: string | PathArray): ParsedPathStyleProps['d'];
5
+ export declare function mergePaths(left: ParsedPathStyleProps['d'], right: ParsedPathStyleProps['d'], object?: IElement): [CurveArray, CurveArray, (b: CurveArray) => CurveArray];
@@ -8,7 +8,7 @@ import type { DisplayObject } from '../..';
8
8
  export declare function parsePoints(pointsOrStr: string | [number, number][], object?: DisplayObject): {
9
9
  points: [number, number][];
10
10
  totalLength: number;
11
- segments: [number, number][];
11
+ segments: any[];
12
12
  };
13
13
  export declare function mergePoints(left: any, right: any): [
14
14
  [
@@ -3,13 +3,13 @@ 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';
6
- export declare class CSSPropertyPath implements Partial<CSSProperty<ParsedPathStyleProps['path'], ParsedPathStyleProps['path']>> {
6
+ export declare class CSSPropertyPath implements Partial<CSSProperty<ParsedPathStyleProps['d'], ParsedPathStyleProps['d']>> {
7
7
  /**
8
8
  * path2Curve
9
9
  */
10
10
  parser: typeof parsePath;
11
11
  parserWithCSSDisabled: typeof parsePath;
12
- calculator(name: string, oldParsed: ParsedPathStyleProps['path'], parsed: ParsedPathStyleProps['path']): {
12
+ calculator(name: string, oldParsed: ParsedPathStyleProps['d'], parsed: ParsedPathStyleProps['d']): {
13
13
  absolutePath: AbsoluteArray;
14
14
  hasArc: boolean;
15
15
  segments: import("../../display-objects").PathSegment[];
@@ -1,4 +1,5 @@
1
- import type { CSSUnitValue } from '../cssom';
1
+ import { DisplayObject } from '../../display-objects';
2
+ import { type CSSUnitValue } from '../cssom';
2
3
  import type { CSSProperty } from '../CSSProperty';
3
4
  /**
4
5
  * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-origin
@@ -11,4 +12,5 @@ export declare class CSSPropertyTransformOrigin implements Partial<CSSProperty<[
11
12
  cache: Map<any, any>;
12
13
  };
13
14
  parserUnmemoize: (value: string | number[]) => [CSSUnitValue, CSSUnitValue];
15
+ postProcessor(object: DisplayObject): void;
14
16
  }
@@ -36,5 +36,5 @@ export interface ParsedCircleStyleProps extends ParsedBaseStyleProps {
36
36
  isSizeAttenuation?: boolean;
37
37
  }
38
38
  export declare class Circle extends DisplayObject<CircleStyleProps, ParsedCircleStyleProps> {
39
- constructor({ style, ...rest }?: DisplayObjectConfig<CircleStyleProps>);
39
+ constructor(options?: DisplayObjectConfig<CircleStyleProps>);
40
40
  }
@@ -237,16 +237,6 @@ export declare class DisplayObject<StyleProps extends BaseStyleProps = any, Pars
237
237
  * @deprecated
238
238
  */
239
239
  add<T extends IChildNode>(child: T, index?: number): T;
240
- /**
241
- * Use `this.style.clipPath` instead.
242
- * @deprecated
243
- */
244
- setClip(clipPath: DisplayObject | null): void;
245
- /**
246
- * Use `this.style.clipPath` instead.
247
- * @deprecated
248
- */
249
- getClip: () => any;
250
240
  /**
251
241
  * @deprecated
252
242
  */
@@ -18,5 +18,5 @@ export interface ParsedEllipseStyleProps extends ParsedBaseStyleProps {
18
18
  isBillboard?: boolean;
19
19
  }
20
20
  export declare class Ellipse extends DisplayObject<EllipseStyleProps, ParsedEllipseStyleProps> {
21
- constructor({ style, ...rest }?: DisplayObjectConfig<EllipseStyleProps>);
21
+ constructor(options?: DisplayObjectConfig<EllipseStyleProps>);
22
22
  }
@@ -21,5 +21,5 @@ export interface ParsedGroupStyleProps extends ParsedBaseStyleProps {
21
21
  </g>
22
22
  */
23
23
  export declare class Group extends DisplayObject {
24
- constructor({ style, ...rest }?: DisplayObjectConfig<GroupStyleProps>);
24
+ constructor(options?: DisplayObjectConfig<GroupStyleProps>);
25
25
  }
@@ -5,7 +5,6 @@ export interface ImageStyleProps extends BaseStyleProps {
5
5
  x?: number | string;
6
6
  y?: number | string;
7
7
  z?: number;
8
- img?: string | HTMLImageElement;
9
8
  src?: string | HTMLImageElement;
10
9
  width?: number | string;
11
10
  height?: number | string;
@@ -30,7 +29,6 @@ export interface ParsedImageStyleProps extends ParsedBaseStyleProps {
30
29
  x: number;
31
30
  y: number;
32
31
  z?: number;
33
- img?: string | HTMLImageElement;
34
32
  src?: string | HTMLImageElement;
35
33
  width?: number;
36
34
  height?: number;
@@ -40,5 +38,5 @@ export interface ParsedImageStyleProps extends ParsedBaseStyleProps {
40
38
  keepAspectRatio?: boolean;
41
39
  }
42
40
  export declare class Image extends DisplayObject<ImageStyleProps, ParsedImageStyleProps> {
43
- constructor({ style, ...rest }?: DisplayObjectConfig<ImageStyleProps>);
41
+ constructor(options?: DisplayObjectConfig<ImageStyleProps>);
44
42
  }
@@ -5,7 +5,6 @@ import { Rectangle } from '../shapes/Rectangle';
5
5
  import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
6
6
  import { DisplayObject } from './DisplayObject';
7
7
  export interface PathStyleProps extends BaseStyleProps {
8
- path?: string | PathArray;
9
8
  d?: string | PathArray;
10
9
  /**
11
10
  * marker will be positioned at the first point
@@ -69,17 +68,7 @@ export interface PathArcParams {
69
68
  sweepFlag: number;
70
69
  }
71
70
  export interface ParsedPathStyleProps extends ParsedBaseStyleProps {
72
- path: {
73
- absolutePath: AbsoluteArray;
74
- hasArc: boolean;
75
- segments: PathSegment[];
76
- polygons: [number, number][][];
77
- polylines: [number, number][][];
78
- curve: CurveArray;
79
- totalLength: number;
80
- rect: Rectangle;
81
- };
82
- d?: {
71
+ d: {
83
72
  absolutePath: AbsoluteArray;
84
73
  hasArc: boolean;
85
74
  segments: PathSegment[];
@@ -23,5 +23,5 @@ export interface ParsedRectStyleProps extends ParsedBaseStyleProps {
23
23
  radius?: [number, number, number, number];
24
24
  }
25
25
  export declare class Rect extends DisplayObject<RectStyleProps, ParsedRectStyleProps> {
26
- constructor({ style, ...rest }?: DisplayObjectConfig<RectStyleProps>);
26
+ constructor(options?: DisplayObjectConfig<RectStyleProps>);
27
27
  }
@@ -11,6 +11,7 @@ export declare function resetEntityCounter(): void;
11
11
  * * Animation
12
12
  */
13
13
  export declare class Element<StyleProps extends BaseStyleProps = any, ParsedStyleProps extends ParsedBaseStyleProps = any> extends Node implements IElement<StyleProps, ParsedStyleProps> {
14
+ constructor();
14
15
  /**
15
16
  * Unique id.
16
17
  */
@@ -30,6 +30,7 @@ export declare abstract class Node extends EventTarget implements INode {
30
30
  */
31
31
  static DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
32
32
  static isNode(target: IEventTarget | INode): target is INode;
33
+ constructor();
33
34
  shadow: boolean;
34
35
  /**
35
36
  * points to canvas.document
@@ -303,7 +303,7 @@ export interface IElement<StyleProps = any, ParsedStyleProps = any> extends INod
303
303
  /**
304
304
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute
305
305
  */
306
- setAttribute: <Key extends keyof StyleProps>(attributeName: Key, value: StyleProps[Key], force?: boolean) => void;
306
+ setAttribute: <Key extends keyof StyleProps>(attributeName: Key, value: StyleProps[Key], force?: boolean, memoize?: boolean) => void;
307
307
  /**
308
308
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute
309
309
  */
@@ -31,4 +31,10 @@ export interface GlobalRuntime {
31
31
  * circle.style.r = 100;
32
32
  */
33
33
  enableStyleSyntax: boolean;
34
+ /**
35
+ * Enable using dash-cased attribute.
36
+ * @example
37
+ * circle.setAttribute('stroke-width', '2');
38
+ */
39
+ enableAttributeDashCased: boolean;
34
40
  }