@antv/g 1.0.0-alpha.25 → 1.0.0-alpha.26

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.
Files changed (38) hide show
  1. package/dist/AbstractRenderer.d.ts +3 -3
  2. package/dist/Canvas.d.ts +2 -2
  3. package/dist/canvas-module.d.ts +3 -2
  4. package/dist/display-objects/Circle.d.ts +2 -1
  5. package/dist/display-objects/CustomElement.d.ts +1 -1
  6. package/dist/display-objects/DisplayObject.d.ts +3 -2
  7. package/dist/display-objects/Ellipse.d.ts +2 -1
  8. package/dist/display-objects/Text.d.ts +3 -2
  9. package/dist/dom/CustomElementRegistry.d.ts +1 -1
  10. package/dist/dom/Document.d.ts +2 -1
  11. package/dist/dom/Element.d.ts +1 -27
  12. package/dist/dom/EventTarget.d.ts +1 -1
  13. package/dist/dom/KeyframeEffect.d.ts +4 -1
  14. package/dist/dom/interfaces.d.ts +26 -0
  15. package/dist/global-module.d.ts +1 -2
  16. package/dist/index.d.ts +3 -2
  17. package/dist/index.esm.js +4943 -4908
  18. package/dist/index.js +4966 -4924
  19. package/dist/plugins/CullingPlugin.d.ts +4 -3
  20. package/dist/plugins/FrustumCullingStrategy.d.ts +2 -2
  21. package/dist/property-handlers/index.d.ts +1 -20
  22. package/dist/property-handlers/interfaces.d.ts +20 -0
  23. package/dist/services/ContextService.d.ts +2 -1
  24. package/dist/services/RenderingService.d.ts +4 -2
  25. package/dist/services/SceneGraphService.d.ts +2 -2
  26. package/dist/services/aabb/CircleUpdater.d.ts +1 -1
  27. package/dist/services/aabb/EllipseUpdater.d.ts +1 -1
  28. package/dist/services/aabb/LineUpdater.d.ts +1 -1
  29. package/dist/services/aabb/PathUpdater.d.ts +1 -1
  30. package/dist/services/aabb/PolylineUpdater.d.ts +1 -1
  31. package/dist/services/aabb/RectUpdater.d.ts +1 -1
  32. package/dist/services/aabb/TextUpdater.d.ts +1 -1
  33. package/dist/utils/animation.d.ts +1 -4
  34. package/package.json +4 -4
  35. package/dist/contribution-provider.d.ts +0 -13
  36. package/dist/index.umd.js +0 -23613
  37. package/dist/index.umd.min.js +0 -44
  38. package/dist/inversify.config.d.ts +0 -6
@@ -1,7 +1,8 @@
1
+ import { Syringe } from 'mana-syringe';
1
2
  import { DisplayObject } from '../display-objects/DisplayObject';
2
3
  import { RenderingService, RenderingPlugin } from '../services/RenderingService';
3
- export declare const CullingStrategy = "CullingStrategy";
4
- export interface CullingStrategy {
4
+ export declare const CullingStrategyContribution: Syringe.DefinedToken;
5
+ export interface CullingStrategyContribution {
5
6
  isVisible(object: DisplayObject): boolean;
6
7
  }
7
8
  /**
@@ -12,7 +13,7 @@ export interface CullingStrategy {
12
13
  export declare class CullingPlugin implements RenderingPlugin {
13
14
  static tag: string;
14
15
  private canvasConfig;
15
- private strategies;
16
+ private strategyProvider;
16
17
  private renderingContext;
17
18
  apply(renderingService: RenderingService): void;
18
19
  }
@@ -1,6 +1,6 @@
1
- import { CullingStrategy } from './CullingPlugin';
1
+ import { CullingStrategyContribution } from './CullingPlugin';
2
2
  import { DisplayObject } from '../display-objects/DisplayObject';
3
- export declare class FrustumCullingStrategy implements CullingStrategy {
3
+ export declare class FrustumCullingStrategy implements CullingStrategyContribution {
4
4
  private camera;
5
5
  isVisible(object: DisplayObject): boolean;
6
6
  /**
@@ -1,24 +1,5 @@
1
1
  /** handle props in keyframe */
2
- import type { IElement } from '../dom';
3
- import { SceneGraphService } from '../services';
4
- export declare const StylePropertyParser = "StylePropertyParser";
5
- export declare type StylePropertyParser<Original, Parsed> = (value: Original, displayObject: IElement | null) => Parsed;
6
- export declare const StylePropertyParserFactory = "StylePropertyParserFactory";
7
- export declare type StylePropertyParserFactory = <Original, Parsed>(name: string) => StylePropertyParser<Original, Parsed>;
8
- export interface ParsedStyleProperty<T, V, Formatted = string> {
9
- type: T;
10
- value: V;
11
- formatted: Formatted;
12
- }
13
- export declare type Interpolatable = number | boolean | number[] | boolean[];
14
- export declare const StylePropertyUpdater = "StylePropertyUpdater";
15
- export declare type StylePropertyUpdater<Original> = (oldValue: Original, newValue: Original, displayObject: IElement, sceneGraphService: SceneGraphService) => void;
16
- export declare const StylePropertyUpdaterFactory = "StylePropertyUpdaterFactory";
17
- export declare type StylePropertyUpdaterFactory = <Original>(name: string) => StylePropertyUpdater<Original>;
18
- export declare const StylePropertyMerger = "StylePropertyMerger";
19
- export declare type StylePropertyMerger<Parsed, T extends Interpolatable = number> = (left: Parsed, right: Parsed, displayObject: IElement | null) => [T, T, (i: T) => string] | undefined;
20
- export declare const StylePropertyMergerFactory = "StylePropertyMergerFactory";
21
- export declare type StylePropertyMergerFactory = <Parsed>(name: string) => StylePropertyMerger<Parsed>;
2
+ export * from './interfaces';
22
3
  export * from './anchor';
23
4
  export * from './aabb';
24
5
  export * from './localPosition';
@@ -0,0 +1,20 @@
1
+ import type { IElement } from '../dom/interfaces';
2
+ import { SceneGraphService } from '../services/SceneGraphService';
3
+ export declare const StylePropertyParser = "StylePropertyParser";
4
+ export declare type StylePropertyParser<Original, Parsed> = (value: Original, displayObject: IElement | null) => Parsed;
5
+ export declare const StylePropertyParserFactory = "StylePropertyParserFactory";
6
+ export declare type StylePropertyParserFactory = <Original, Parsed>(name: string) => StylePropertyParser<Original, Parsed>;
7
+ export interface ParsedStyleProperty<T, V, Formatted = string> {
8
+ type: T;
9
+ value: V;
10
+ formatted: Formatted;
11
+ }
12
+ export declare type Interpolatable = number | boolean | number[] | boolean[];
13
+ export declare const StylePropertyUpdater = "StylePropertyUpdater";
14
+ export declare type StylePropertyUpdater<Original> = (oldValue: Original, newValue: Original, displayObject: IElement, sceneGraphService: SceneGraphService) => void;
15
+ export declare const StylePropertyUpdaterFactory = "StylePropertyUpdaterFactory";
16
+ export declare type StylePropertyUpdaterFactory = <Original>(name: string) => StylePropertyUpdater<Original>;
17
+ export declare const StylePropertyMerger = "StylePropertyMerger";
18
+ export declare type StylePropertyMerger<Parsed, T extends Interpolatable = number> = (left: Parsed, right: Parsed, displayObject: IElement | null) => [T, T, (i: T) => string] | undefined;
19
+ export declare const StylePropertyMergerFactory = "StylePropertyMergerFactory";
20
+ export declare type StylePropertyMergerFactory = <Parsed>(name: string) => StylePropertyMerger<Parsed>;
@@ -1,4 +1,5 @@
1
- export declare const ContextService = "ContextService";
1
+ import { Syringe } from 'mana-syringe';
2
+ export declare const ContextService: Syringe.DefinedToken;
2
3
  export interface ContextService<Context> {
3
4
  init(): void;
4
5
  destroy(): void;
@@ -1,10 +1,11 @@
1
+ import { Syringe } from 'mana-syringe';
1
2
  import { SyncHook, SyncWaterfallHook, AsyncSeriesHook, AsyncSeriesWaterfallHook } from 'tapable';
2
3
  import { DisplayObject } from '..';
3
4
  import { EventPosition, InteractivePointerEvent } from '../types';
4
5
  export interface RenderingPlugin {
5
6
  apply(renderer: RenderingService): void;
6
7
  }
7
- export declare const RenderingPluginContribution = "RenderingPluginContribution";
8
+ export declare const RenderingPluginContribution: Syringe.DefinedToken;
8
9
  export interface PickingResult {
9
10
  position: EventPosition;
10
11
  picked: DisplayObject | null;
@@ -19,7 +20,7 @@ export interface PickingResult {
19
20
  * * end frame
20
21
  */
21
22
  export declare class RenderingService {
22
- private renderingPluginContribution;
23
+ private renderingPluginProvider;
23
24
  private renderingContext;
24
25
  private inited;
25
26
  hooks: {
@@ -44,6 +45,7 @@ export declare class RenderingService {
44
45
  };
45
46
  init(): Promise<void>;
46
47
  render(): void;
48
+ private renderDisplayObject;
47
49
  destroy(): void;
48
50
  dirtify(): void;
49
51
  }
@@ -1,7 +1,7 @@
1
- import { Transform } from '../components/Transform';
1
+ import { Transform } from '../components';
2
2
  import { mat4, quat, vec2, vec3 } from 'gl-matrix';
3
3
  import { AABB, Rectangle } from '../shapes';
4
- import { IElement, INode, IParentNode } from '../dom/interfaces';
4
+ import type { IElement, INode, IParentNode } from '../dom/interfaces';
5
5
  export declare function sortByZIndex(o1: IElement, o2: IElement): number;
6
6
  export declare function dirtifyRenderable(element: INode, silent?: boolean): void;
7
7
  export declare const SceneGraphService = "SceneGraphService";
@@ -1,4 +1,4 @@
1
- import type { GeometryAABBUpdater } from './interfaces';
1
+ import { GeometryAABBUpdater } from './interfaces';
2
2
  import type { ParsedCircleStyleProps } from '../../display-objects/Circle';
3
3
  export declare class CircleUpdater implements GeometryAABBUpdater<ParsedCircleStyleProps> {
4
4
  update(parsedStyle: ParsedCircleStyleProps): {
@@ -1,4 +1,4 @@
1
- import type { GeometryAABBUpdater } from './interfaces';
1
+ import { GeometryAABBUpdater } from './interfaces';
2
2
  import type { ParsedEllipseStyleProps } from '../../display-objects/Ellipse';
3
3
  export declare class EllipseUpdater implements GeometryAABBUpdater<ParsedEllipseStyleProps> {
4
4
  update(parsedStyle: ParsedEllipseStyleProps): {
@@ -1,4 +1,4 @@
1
- import type { GeometryAABBUpdater } from './interfaces';
1
+ import { GeometryAABBUpdater } from './interfaces';
2
2
  import type { ParsedLineStyleProps } from '../../display-objects/Line';
3
3
  export declare class LineUpdater implements GeometryAABBUpdater<ParsedLineStyleProps> {
4
4
  update(parsedStyle: ParsedLineStyleProps): {
@@ -1,4 +1,4 @@
1
- import type { GeometryAABBUpdater } from './interfaces';
1
+ import { GeometryAABBUpdater } from './interfaces';
2
2
  import type { DisplayObject } from '../../display-objects/DisplayObject';
3
3
  import type { ParsedBaseStyleProps } from '../../types';
4
4
  export declare class PathUpdater implements GeometryAABBUpdater<ParsedBaseStyleProps> {
@@ -1,4 +1,4 @@
1
- import type { GeometryAABBUpdater } from './interfaces';
1
+ import { GeometryAABBUpdater } from './interfaces';
2
2
  import type { ParsedBaseStyleProps } from '../../types';
3
3
  export declare class PolylineUpdater implements GeometryAABBUpdater<ParsedBaseStyleProps> {
4
4
  update(parsedStyle: ParsedBaseStyleProps): {
@@ -1,4 +1,4 @@
1
- import type { GeometryAABBUpdater } from './interfaces';
1
+ import { GeometryAABBUpdater } from './interfaces';
2
2
  import type { ParsedImageStyleProps } from '../../display-objects/Image';
3
3
  export declare class RectUpdater implements GeometryAABBUpdater<ParsedImageStyleProps> {
4
4
  update(attributes: ParsedImageStyleProps): {
@@ -1,4 +1,4 @@
1
- import type { GeometryAABBUpdater } from './interfaces';
1
+ import { GeometryAABBUpdater } from './interfaces';
2
2
  import type { ParsedTextStyleProps } from '../../display-objects/Text';
3
3
  export declare class TextUpdater implements GeometryAABBUpdater<ParsedTextStyleProps> {
4
4
  private textService;
@@ -1,8 +1,5 @@
1
- import { AnimationEffectTiming } from '../dom';
1
+ import type { AnimationEffectTiming } from '../dom/AnimationEffectTiming';
2
2
  export declare const linear: (x: number) => number;
3
- export declare function makeTiming(timingInput: KeyframeEffectOptions, forGroup: boolean): AnimationEffectTiming;
4
- export declare function numericTimingToObject(timingInput: KeyframeEffectOptions | number): KeyframeEffectOptions;
5
- export declare function normalizeTimingInput(timingInput: KeyframeEffectOptions | number | undefined, forGroup: boolean): AnimationEffectTiming;
6
3
  export declare function parseEasingFunction(normalizedEasing: string): import("./custom-easing").TypeEasingFunction;
7
4
  export declare function calculateActiveDuration(timing: EffectTiming): number;
8
5
  export declare function calculateIterationProgress(activeDuration: number, localTime: number, timing: AnimationEffectTiming): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g",
3
- "version": "1.0.0-alpha.25",
3
+ "version": "1.0.0-alpha.26",
4
4
  "description": "A core module including ECS and DI container.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -35,16 +35,16 @@
35
35
  },
36
36
  "homepage": "https://github.com/antvis/g#readme",
37
37
  "dependencies": {
38
- "@antv/g-ecs": "^1.0.0-alpha.9",
38
+ "@antv/g-ecs": "^1.0.0-alpha.10",
39
39
  "@antv/g-math": "^1.0.0-alpha.6",
40
40
  "@antv/path-util": "^2.0.14",
41
41
  "@antv/util": "^2.0.13",
42
42
  "d3-color": "^1.4.0",
43
43
  "eventemitter3": "^4.0.0",
44
44
  "gl-matrix": "^3.1.0",
45
- "inversify": "^5.0.1",
45
+ "mana-syringe": "^0.1.0",
46
46
  "reflect-metadata": "^0.1.13",
47
47
  "tapable": "2.2.1"
48
48
  },
49
- "gitHead": "e2b8bc287c7faa181013d9e5df071ff97d702c94"
49
+ "gitHead": "04974923388e3c1e3c47d591c251380058372376"
50
50
  }
@@ -1,13 +0,0 @@
1
- import { interfaces } from 'inversify';
2
- export declare const ContributionProvider = "ContributionProvider";
3
- export interface ContributionProvider<T extends object> {
4
- /**
5
- * @param recursive `true` if the contributions should be collected from the parent containers as well. Otherwise, `false`. It is `false` by default.
6
- */
7
- getContributions(recursive?: boolean): T[];
8
- }
9
- export declare type Bindable = interfaces.Bind | interfaces.Container;
10
- export declare namespace Bindable {
11
- function isContainer(arg: Bindable): arg is interfaces.Container;
12
- }
13
- export declare function bindContributionProvider(bindable: Bindable, id: symbol | string): void;