@antv/g 5.0.22-alpha.6 → 5.0.23-alpha.10
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/index.umd.min.js +3 -3
- package/es/AbstractRenderer.js +5 -0
- package/es/camera/Camera.js +2 -2
- package/es/css/cssom/CSSKeywordValue.d.ts +1 -1
- package/es/css/cssom/CSSNumericSumValue.d.ts +1 -1
- package/es/css/cssom/CSSNumericValue.d.ts +141 -4
- package/es/css/cssom/CSSNumericValue.js +1166 -5
- package/es/css/cssom/CSSTransformValue.d.ts +1 -1
- package/es/css/cssom/index.d.ts +0 -10
- package/es/css/cssom/index.js +1 -11
- package/es/css/parser/color.js +1 -1
- package/es/css/parser/dimension.js +1 -2
- package/es/css/parser/numeric.d.ts +1 -1
- package/es/css/parser/numeric.js +2 -2
- package/es/css/parser/path.d.ts +2 -2
- package/es/css/parser/path.js +1 -1
- package/es/css/parser/points.js +1 -1
- package/es/css/parser/transform-origin.d.ts +1 -1
- package/es/css/parser/transform-origin.js +2 -2
- package/es/css/parser/transform.d.ts +1 -3
- package/es/css/parser/transform.js +9 -8
- package/es/css/properties/CSSPropertyPath.d.ts +14 -2
- package/es/css/properties/CSSPropertyTextTransform.d.ts +2 -2
- package/es/css/properties/CSSPropertyTransform.js +3 -4
- package/es/display-objects/DisplayObject.js +4 -5
- package/es/display-objects/Path.d.ts +15 -15
- package/es/display-objects/Path.js +1 -1
- package/es/display-objects/Polygon.d.ts +8 -1
- package/es/display-objects/Polyline.d.ts +7 -5
- package/es/dom/Document.js +2 -2
- package/es/dom/Element.js +1 -2
- package/es/dom/EventTarget.js +1 -1
- package/es/dom/FederatedTouchEvent.d.ts +5 -3
- package/es/plugins/CullingPlugin.d.ts +0 -1
- package/es/plugins/CullingPlugin.js +3 -8
- package/es/plugins/DirtyCheckPlugin.d.ts +1 -1
- package/es/plugins/DirtyCheckPlugin.js +9 -8
- package/es/plugins/EventPlugin.d.ts +1 -1
- package/es/plugins/EventPlugin.js +163 -148
- package/es/plugins/PrepareRendererPlugin.d.ts +0 -1
- package/es/plugins/PrepareRendererPlugin.js +16 -17
- package/es/services/EventService.d.ts +8 -0
- package/es/services/EventService.js +274 -20
- package/es/services/RenderingService.d.ts +17 -16
- package/es/services/RenderingService.js +19 -18
- package/es/services/SceneGraphService.js +1 -1
- package/es/services/aabb/PathUpdater.d.ts +3 -3
- package/es/services/aabb/PolylineUpdater.d.ts +3 -3
- package/es/services/aabb/RectUpdater.js +1 -1
- package/es/types.d.ts +5 -3
- package/es/utils/assert.d.ts +6 -0
- package/es/utils/assert.js +18 -0
- package/es/utils/event.d.ts +18 -16
- package/es/utils/hooks.d.ts +280 -0
- package/es/utils/hooks.js +753 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +2 -1
- package/es/utils/math.d.ts +1 -0
- package/es/utils/math.js +13 -2
- package/es/utils/string.d.ts +1 -0
- package/es/utils/string.js +8 -0
- package/es/utils/text.js +2 -1
- package/lib/AbstractRenderer.js +5 -0
- package/lib/camera/Camera.js +4 -4
- package/lib/css/cssom/CSSKeywordValue.d.ts +1 -1
- package/lib/css/cssom/CSSNumericSumValue.d.ts +1 -1
- package/lib/css/cssom/CSSNumericValue.d.ts +141 -4
- package/lib/css/cssom/CSSNumericValue.js +1226 -52
- package/lib/css/cssom/CSSTransformValue.d.ts +1 -1
- package/lib/css/cssom/index.d.ts +0 -10
- package/lib/css/cssom/index.js +0 -130
- package/lib/css/parser/color.js +5 -5
- package/lib/css/parser/dimension.js +1 -3
- package/lib/css/parser/numeric.d.ts +1 -1
- package/lib/css/parser/numeric.js +7 -7
- package/lib/css/parser/path.d.ts +2 -2
- package/lib/css/parser/path.js +4 -4
- package/lib/css/parser/points.js +2 -2
- package/lib/css/parser/transform-origin.d.ts +1 -1
- package/lib/css/parser/transform-origin.js +4 -4
- package/lib/css/parser/transform.d.ts +1 -3
- package/lib/css/parser/transform.js +25 -24
- package/lib/css/properties/CSSPropertyPath.d.ts +14 -2
- package/lib/css/properties/CSSPropertyTextTransform.d.ts +2 -2
- package/lib/css/properties/CSSPropertyTransform.js +18 -20
- package/lib/display-objects/DisplayObject.js +7 -9
- package/lib/display-objects/Path.d.ts +15 -15
- package/lib/display-objects/Path.js +3 -3
- package/lib/display-objects/Polygon.d.ts +8 -1
- package/lib/display-objects/Polyline.d.ts +7 -5
- package/lib/dom/Document.js +2 -2
- package/lib/dom/Element.js +1 -3
- package/lib/dom/EventTarget.js +9 -9
- package/lib/dom/FederatedTouchEvent.d.ts +5 -3
- package/lib/plugins/CullingPlugin.d.ts +0 -1
- package/lib/plugins/CullingPlugin.js +3 -7
- package/lib/plugins/DirtyCheckPlugin.d.ts +1 -1
- package/lib/plugins/DirtyCheckPlugin.js +10 -8
- package/lib/plugins/EventPlugin.d.ts +1 -1
- package/lib/plugins/EventPlugin.js +172 -156
- package/lib/plugins/PrepareRendererPlugin.d.ts +0 -1
- package/lib/plugins/PrepareRendererPlugin.js +16 -16
- package/lib/services/EventService.d.ts +8 -0
- package/lib/services/EventService.js +274 -19
- package/lib/services/RenderingService.d.ts +17 -16
- package/lib/services/RenderingService.js +21 -20
- package/lib/services/SceneGraphService.js +3 -3
- package/lib/services/aabb/PathUpdater.d.ts +3 -3
- package/lib/services/aabb/PolylineUpdater.d.ts +3 -3
- package/lib/services/aabb/RectUpdater.js +3 -3
- package/lib/types.d.ts +5 -3
- package/lib/utils/assert.d.ts +6 -0
- package/lib/utils/assert.js +30 -0
- package/lib/utils/event.d.ts +18 -16
- package/lib/utils/hooks.d.ts +280 -0
- package/lib/utils/hooks.js +759 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +13 -0
- package/lib/utils/math.d.ts +1 -0
- package/lib/utils/math.js +17 -4
- package/lib/utils/string.d.ts +1 -0
- package/lib/utils/string.js +11 -0
- package/lib/utils/text.js +5 -3
- package/package.json +4 -7
- package/es/css/cssom/CSSMathInvert.d.ts +0 -14
- package/es/css/cssom/CSSMathInvert.js +0 -84
- package/es/css/cssom/CSSMathMax.d.ts +0 -17
- package/es/css/cssom/CSSMathMax.js +0 -118
- package/es/css/cssom/CSSMathMin.d.ts +0 -17
- package/es/css/cssom/CSSMathMin.js +0 -119
- package/es/css/cssom/CSSMathNegate.d.ts +0 -14
- package/es/css/cssom/CSSMathNegate.js +0 -80
- package/es/css/cssom/CSSMathProduct.d.ts +0 -16
- package/es/css/cssom/CSSMathProduct.js +0 -109
- package/es/css/cssom/CSSMathSum.d.ts +0 -17
- package/es/css/cssom/CSSMathSum.js +0 -117
- package/es/css/cssom/CSSMathValue.d.ts +0 -11
- package/es/css/cssom/CSSMathValue.js +0 -27
- package/es/css/cssom/CSSMathVariadic.d.ts +0 -9
- package/es/css/cssom/CSSMathVariadic.js +0 -44
- package/es/css/cssom/CSSNumericValueType.d.ts +0 -33
- package/es/css/cssom/CSSNumericValueType.js +0 -259
- package/es/css/cssom/CSSUnitValue.d.ts +0 -33
- package/es/css/cssom/CSSUnitValue.js +0 -252
- package/lib/css/cssom/CSSMathInvert.d.ts +0 -14
- package/lib/css/cssom/CSSMathInvert.js +0 -94
- package/lib/css/cssom/CSSMathMax.d.ts +0 -17
- package/lib/css/cssom/CSSMathMax.js +0 -128
- package/lib/css/cssom/CSSMathMin.d.ts +0 -17
- package/lib/css/cssom/CSSMathMin.js +0 -128
- package/lib/css/cssom/CSSMathNegate.d.ts +0 -14
- package/lib/css/cssom/CSSMathNegate.js +0 -89
- package/lib/css/cssom/CSSMathProduct.d.ts +0 -16
- package/lib/css/cssom/CSSMathProduct.js +0 -119
- package/lib/css/cssom/CSSMathSum.d.ts +0 -17
- package/lib/css/cssom/CSSMathSum.js +0 -129
- package/lib/css/cssom/CSSMathValue.d.ts +0 -11
- package/lib/css/cssom/CSSMathValue.js +0 -35
- package/lib/css/cssom/CSSMathVariadic.d.ts +0 -9
- package/lib/css/cssom/CSSMathVariadic.js +0 -55
- package/lib/css/cssom/CSSNumericValueType.d.ts +0 -33
- package/lib/css/cssom/CSSNumericValueType.js +0 -272
- package/lib/css/cssom/CSSUnitValue.d.ts +0 -33
- package/lib/css/cssom/CSSUnitValue.js +0 -267
package/es/css/cssom/index.d.ts
CHANGED
|
@@ -10,20 +10,10 @@ export * from './types';
|
|
|
10
10
|
export * from './CSSColorValue';
|
|
11
11
|
export * from './CSSKeywordValue';
|
|
12
12
|
export * from './CSSMathOperator';
|
|
13
|
-
export * from './CSSMathInvert';
|
|
14
|
-
export * from './CSSMathMax';
|
|
15
|
-
export * from './CSSMathMin';
|
|
16
|
-
export * from './CSSMathNegate';
|
|
17
|
-
export * from './CSSMathProduct';
|
|
18
|
-
export * from './CSSMathSum';
|
|
19
|
-
export * from './CSSMathValue';
|
|
20
|
-
export * from './CSSMathVariadic';
|
|
21
13
|
export * from './CSSNumericSumValue';
|
|
22
14
|
export * from './CSSNumericValue';
|
|
23
|
-
export * from './CSSNumericValueType';
|
|
24
15
|
export * from './CSSRGB';
|
|
25
16
|
export * from './CSSGradientValue';
|
|
26
17
|
export * from './CSSStyleValue';
|
|
27
18
|
export * from './CSSTransformValue';
|
|
28
19
|
export * from './CSSTranslate';
|
|
29
|
-
export * from './CSSUnitValue';
|
package/es/css/cssom/index.js
CHANGED
|
@@ -10,20 +10,10 @@ export * from './types';
|
|
|
10
10
|
export * from './CSSColorValue';
|
|
11
11
|
export * from './CSSKeywordValue';
|
|
12
12
|
export * from './CSSMathOperator';
|
|
13
|
-
export * from './CSSMathInvert';
|
|
14
|
-
export * from './CSSMathMax';
|
|
15
|
-
export * from './CSSMathMin';
|
|
16
|
-
export * from './CSSMathNegate';
|
|
17
|
-
export * from './CSSMathProduct';
|
|
18
|
-
export * from './CSSMathSum';
|
|
19
|
-
export * from './CSSMathValue';
|
|
20
|
-
export * from './CSSMathVariadic';
|
|
21
13
|
export * from './CSSNumericSumValue';
|
|
22
14
|
export * from './CSSNumericValue';
|
|
23
|
-
export * from './CSSNumericValueType';
|
|
24
15
|
export * from './CSSRGB';
|
|
25
16
|
export * from './CSSGradientValue';
|
|
26
17
|
export * from './CSSStyleValue';
|
|
27
18
|
export * from './CSSTransformValue';
|
|
28
|
-
export * from './CSSTranslate';
|
|
29
|
-
export * from './CSSUnitValue';
|
|
19
|
+
export * from './CSSTranslate';
|
package/es/css/parser/color.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __read, __spreadArray } from "tslib";
|
|
2
2
|
import * as d3 from 'd3-color';
|
|
3
|
-
import { clamp, isString } from 'lodash-es';
|
|
4
3
|
import { CSSRGB, CSSGradientValue, GradientPatternType } from '../cssom';
|
|
4
|
+
import { clamp, isString } from '../../utils';
|
|
5
5
|
var regexLG = /^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i;
|
|
6
6
|
var regexRG = /^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i;
|
|
7
7
|
var regexPR = /^p\s*\(\s*([axyn])\s*\)\s*(.*)/i;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { isString } from 'lodash-es';
|
|
2
1
|
import { AABB } from '../../shapes';
|
|
3
|
-
import { rad2deg, turn2deg } from '../../utils';
|
|
2
|
+
import { isString, rad2deg, turn2deg } from '../../utils';
|
|
4
3
|
import { UnitType } from '../cssom';
|
|
5
4
|
import { CSSUnitValue } from '../cssom';
|
|
6
5
|
export function parseDimension(unitRegExp, string) {
|
package/es/css/parser/numeric.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { clamp, isString } from '
|
|
2
|
-
import { CSSUnitValue } from '../cssom';
|
|
1
|
+
import { clamp, isString } from '../../utils';
|
|
2
|
+
import { CSSUnitValue } from '../cssom/CSSNumericValue';
|
|
3
3
|
export function numberToString(x) {
|
|
4
4
|
// scale(0.00000001) -> scale(0)
|
|
5
5
|
// return x.toFixed(6).replace(/0+$/, '').replace(/\.$/, '');
|
package/es/css/parser/path.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PathCommand } from '../../types';
|
|
2
2
|
import type { ParsedPathStyleProps } from '../../display-objects';
|
|
3
3
|
import type { IElement } from '../../dom';
|
|
4
|
-
export declare function parsePath(path: string): ParsedPathStyleProps;
|
|
5
|
-
export declare function mergePaths(left: ParsedPathStyleProps, right: ParsedPathStyleProps, object: IElement): [PathCommand[], PathCommand[], (b: PathCommand[]) => PathCommand[]];
|
|
4
|
+
export declare function parsePath(path: string): ParsedPathStyleProps['path'];
|
|
5
|
+
export declare function mergePaths(left: ParsedPathStyleProps['path'], right: ParsedPathStyleProps['path'], object: IElement): [PathCommand[], PathCommand[], (b: PathCommand[]) => PathCommand[]];
|
package/es/css/parser/path.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __read, __spreadArray } from "tslib";
|
|
2
|
-
import { path2Absolute, path2Segments, path2Curve } from '@antv/
|
|
2
|
+
import { path2Absolute, path2Segments, path2Curve } from '@antv/util';
|
|
3
3
|
import { Cubic as CubicUtil } from '@antv/g-math';
|
|
4
4
|
import { clonePath, equalizeSegments, getDrawDirection, getRotatedCurve, reverseCurve } from '../../utils/path';
|
|
5
5
|
import { Rectangle } from '../../shapes/Rectangle';
|
package/es/css/parser/points.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isString } from '
|
|
2
|
-
import { CSSUnitValue } from '../cssom';
|
|
1
|
+
import { isString } from '../../utils';
|
|
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,11 +1,9 @@
|
|
|
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
6
|
}
|
|
7
|
-
export declare const Opx: CSSUnitValue;
|
|
8
|
-
export declare const Odeg: CSSUnitValue;
|
|
9
7
|
/**
|
|
10
8
|
* none
|
|
11
9
|
* scale(1) scale(1, 2)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { UnitType } from '../cssom/types';
|
|
2
|
+
import { CSSUnitValue, Opx, Odeg } from '../cssom/CSSNumericValue';
|
|
3
|
+
import { mergeDimensions, parseAngle, parseLength, parseLengthOrPercentage } from './dimension';
|
|
4
|
+
import { mergeNumbers, parseNumber } from './numeric';
|
|
5
|
+
import { CSS } from '../CSS';
|
|
3
6
|
var _ = null;
|
|
4
|
-
export var Opx = new CSSUnitValue(0, 'px');
|
|
5
|
-
export var Odeg = new CSSUnitValue(0, 'deg');
|
|
6
7
|
|
|
7
8
|
function cast(pattern) {
|
|
8
9
|
return function (contents) {
|
|
@@ -28,10 +29,10 @@ var transformFunctions = {
|
|
|
28
29
|
rotatez: ['A'],
|
|
29
30
|
rotate3d: ['NNNA'],
|
|
30
31
|
// perspective: ['L'],
|
|
31
|
-
scale: ['Nn', cast([_, _,
|
|
32
|
-
scalex: ['N', cast([_,
|
|
33
|
-
scaley: ['N', cast([
|
|
34
|
-
scalez: ['N', cast([
|
|
32
|
+
scale: ['Nn', cast([_, _, CSS.number(1)]), id],
|
|
33
|
+
scalex: ['N', cast([_, CSS.number(1), CSS.number(1)]), cast([_, CSS.number(1)])],
|
|
34
|
+
scaley: ['N', cast([CSS.number(1), _, CSS.number(1)]), cast([CSS.number(1), _])],
|
|
35
|
+
scalez: ['N', cast([CSS.number(1), CSS.number(1), _])],
|
|
35
36
|
scale3d: ['NNN', id],
|
|
36
37
|
// skew: ['Aa', null, id],
|
|
37
38
|
// skewx: ['A', null, cast([_, Odeg])],
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import type { DisplayObject, ParsedPathStyleProps } from '../../display-objects';
|
|
2
|
+
import { Rectangle } from '../../shapes';
|
|
2
3
|
import type { CSSProperty } from '../CSSProperty';
|
|
3
4
|
import { parsePath, mergePaths } from '../parser';
|
|
4
|
-
export declare class CSSPropertyPath implements Partial<CSSProperty<ParsedPathStyleProps, ParsedPathStyleProps>> {
|
|
5
|
+
export declare class CSSPropertyPath implements Partial<CSSProperty<ParsedPathStyleProps['path'], ParsedPathStyleProps['path']>> {
|
|
5
6
|
/**
|
|
6
7
|
* path2Curve
|
|
7
8
|
*/
|
|
8
9
|
parser: typeof parsePath;
|
|
9
|
-
calculator(name: string, oldParsed: ParsedPathStyleProps, parsed: ParsedPathStyleProps):
|
|
10
|
+
calculator(name: string, oldParsed: ParsedPathStyleProps['path'], parsed: ParsedPathStyleProps['path']): {
|
|
11
|
+
absolutePath: import("../../types").PathCommand[];
|
|
12
|
+
hasArc: boolean;
|
|
13
|
+
segments: import("../../display-objects").PathSegment[];
|
|
14
|
+
polygons: [number, number][][];
|
|
15
|
+
polylines: [number, number][][];
|
|
16
|
+
curve: import("../../types").PathCommand[];
|
|
17
|
+
totalLength: number;
|
|
18
|
+
curveSegments: number[][];
|
|
19
|
+
zCommandIndexes: number[];
|
|
20
|
+
rect: Rectangle;
|
|
21
|
+
};
|
|
10
22
|
mixer: typeof mergePaths;
|
|
11
23
|
/**
|
|
12
24
|
* update local position
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CSSProperty } from '../CSSProperty';
|
|
2
|
-
import type { DisplayObject
|
|
3
|
-
export declare class CSSPropertyTextTransform implements Partial<CSSProperty<
|
|
2
|
+
import type { DisplayObject } from '../../display-objects';
|
|
3
|
+
export declare class CSSPropertyTextTransform implements Partial<CSSProperty<any, any>> {
|
|
4
4
|
postProcessor(o: DisplayObject): void;
|
|
5
5
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
|
|
1
|
+
import { __decorate } from "tslib";
|
|
3
2
|
import { singleton } from 'mana-syringe';
|
|
4
|
-
import { CSSKeywordValue } from '../cssom';
|
|
5
|
-
import {
|
|
3
|
+
import { CSSKeywordValue, Opx, Odeg } from '../cssom';
|
|
4
|
+
import { parseTransform, mergeTransforms } from '../parser';
|
|
6
5
|
/**
|
|
7
6
|
* @see /zh/docs/api/animation#支持变换的属性
|
|
8
7
|
*
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { __assign, __extends, __read, __spreadArray } from "tslib";
|
|
2
2
|
import { GlobalContainer } from 'mana-syringe';
|
|
3
|
-
import { isEqual, isNil, isObject, isUndefined } from 'lodash-es';
|
|
4
3
|
import { mat4, quat, vec3 } from 'gl-matrix';
|
|
5
4
|
import { DisplayObjectPool } from '../DisplayObjectPool';
|
|
6
5
|
import { KeyframeEffect } from '../dom/KeyframeEffect';
|
|
7
6
|
import { Element } from '../dom/Element';
|
|
8
7
|
import { ElementEvent } from '../dom/interfaces';
|
|
9
8
|
import { Shape } from '../types';
|
|
10
|
-
import { createVec3, decompose, formatAttribute, fromRotationTranslationScale, getEuler, rad2deg } from '../utils';
|
|
9
|
+
import { createVec3, decompose, formatAttribute, fromRotationTranslationScale, getEuler, isNil, isObject, isUndefined, rad2deg } from '../utils';
|
|
11
10
|
import { dirtifyToRoot } from '../services';
|
|
12
11
|
import { MutationEvent } from '../dom/MutationEvent';
|
|
13
12
|
import { Rectangle } from '../shapes';
|
|
@@ -93,11 +92,11 @@ function (_super) {
|
|
|
93
92
|
interactive: (_c = _this.config.interactive) !== null && _c !== void 0 ? _c : true
|
|
94
93
|
}), _this.config.style), _this.config.attrs);
|
|
95
94
|
|
|
96
|
-
if (
|
|
95
|
+
if (_this.config.visible != null) {
|
|
97
96
|
_this.config.style.visibility = _this.config.visible === false ? 'hidden' : 'visible';
|
|
98
97
|
}
|
|
99
98
|
|
|
100
|
-
if (
|
|
99
|
+
if (_this.config.interactive != null) {
|
|
101
100
|
_this.config.style.pointerEvents = _this.config.interactive === false ? 'none' : 'auto';
|
|
102
101
|
}
|
|
103
102
|
|
|
@@ -193,7 +192,7 @@ function (_super) {
|
|
|
193
192
|
return;
|
|
194
193
|
}
|
|
195
194
|
|
|
196
|
-
if (force ||
|
|
195
|
+
if (force || attributeValue != this.attributes[attributeName]) {
|
|
197
196
|
this.internalSetAttribute(attributeName, attributeValue);
|
|
198
197
|
|
|
199
198
|
_super.prototype.setAttribute.call(this, attributeName, attributeValue);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseStyleProps, PathCommand } from '../types';
|
|
1
|
+
import type { BaseStyleProps, PathCommand, ParsedBaseStyleProps } from '../types';
|
|
2
2
|
import { DisplayObject } from './DisplayObject';
|
|
3
3
|
import type { DisplayObjectConfig } from '../dom';
|
|
4
4
|
import { Point } from '../shapes';
|
|
@@ -16,21 +16,21 @@ export interface PathSegment {
|
|
|
16
16
|
endTangent: [number, number] | null;
|
|
17
17
|
params: PathCommand;
|
|
18
18
|
}
|
|
19
|
-
export interface ParsedPathStyleProps {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
export interface ParsedPathStyleProps extends ParsedBaseStyleProps {
|
|
20
|
+
path: {
|
|
21
|
+
absolutePath: PathCommand[];
|
|
22
|
+
hasArc: boolean;
|
|
23
|
+
segments: PathSegment[];
|
|
24
|
+
polygons: [number, number][][];
|
|
25
|
+
polylines: [number, number][][];
|
|
26
|
+
curve: PathCommand[];
|
|
27
|
+
totalLength: number;
|
|
28
|
+
curveSegments: number[][];
|
|
29
|
+
zCommandIndexes: number[];
|
|
30
|
+
rect: Rectangle;
|
|
31
|
+
};
|
|
30
32
|
}
|
|
31
|
-
export declare class Path extends DisplayObject<PathStyleProps, {
|
|
32
|
-
path: ParsedPathStyleProps;
|
|
33
|
-
}> {
|
|
33
|
+
export declare class Path extends DisplayObject<PathStyleProps, ParsedPathStyleProps> {
|
|
34
34
|
constructor({ style, ...rest }?: DisplayObjectConfig<PathStyleProps>);
|
|
35
35
|
getTotalLength(): number;
|
|
36
36
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __assign, __extends, __rest } from "tslib";
|
|
2
2
|
import { Cubic as CubicUtil } from '@antv/g-math';
|
|
3
|
-
import { isNil } from 'lodash-es';
|
|
4
3
|
import { Shape } from '../types';
|
|
5
4
|
import { DisplayObject } from './DisplayObject';
|
|
6
5
|
import { Point } from '../shapes';
|
|
6
|
+
import { isNil } from '../utils';
|
|
7
7
|
|
|
8
8
|
var Path =
|
|
9
9
|
/** @class */
|
|
@@ -4,6 +4,13 @@ import type { DisplayObjectConfig } from '../dom';
|
|
|
4
4
|
export interface PolygonStyleProps extends BaseStyleProps {
|
|
5
5
|
points: [number, number][];
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export interface ParsedPolygonStyleProps extends ParsedBaseStyleProps {
|
|
8
|
+
points: {
|
|
9
|
+
points: [number, number][];
|
|
10
|
+
segments: [number, number][];
|
|
11
|
+
totalLength: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare class Polygon extends DisplayObject<PolygonStyleProps, ParsedPolygonStyleProps> {
|
|
8
15
|
constructor({ style, ...rest }?: DisplayObjectConfig<PolygonStyleProps>);
|
|
9
16
|
}
|
|
@@ -5,12 +5,14 @@ import { Point } from '../shapes';
|
|
|
5
5
|
export interface PolylineStyleProps extends BaseStyleProps {
|
|
6
6
|
points: [number, number][];
|
|
7
7
|
}
|
|
8
|
-
export interface ParsedPolylineStyleProps {
|
|
9
|
-
points:
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
export interface ParsedPolylineStyleProps extends ParsedBaseStyleProps {
|
|
9
|
+
points: {
|
|
10
|
+
points: [number, number][];
|
|
11
|
+
segments: [number, number][];
|
|
12
|
+
totalLength: number;
|
|
13
|
+
};
|
|
12
14
|
}
|
|
13
|
-
export declare class Polyline extends DisplayObject<PolylineStyleProps,
|
|
15
|
+
export declare class Polyline extends DisplayObject<PolylineStyleProps, ParsedPolylineStyleProps> {
|
|
14
16
|
constructor({ style, ...rest }?: DisplayObjectConfig<PolylineStyleProps>);
|
|
15
17
|
getTotalLength(): number;
|
|
16
18
|
getPoint(ratio: number): Point;
|
package/es/dom/Document.js
CHANGED
|
@@ -146,7 +146,7 @@ function (_super) {
|
|
|
146
146
|
}), clientX = _c.x, clientY = _c.y;
|
|
147
147
|
return [4
|
|
148
148
|
/*yield*/
|
|
149
|
-
, this.defaultView.getRenderingService().hooks.pick.
|
|
149
|
+
, this.defaultView.getRenderingService().hooks.pick.callPromise({
|
|
150
150
|
topmost: true,
|
|
151
151
|
position: {
|
|
152
152
|
x: x,
|
|
@@ -200,7 +200,7 @@ function (_super) {
|
|
|
200
200
|
}), clientX = _c.x, clientY = _c.y;
|
|
201
201
|
return [4
|
|
202
202
|
/*yield*/
|
|
203
|
-
, this.defaultView.getRenderingService().hooks.pick.
|
|
203
|
+
, this.defaultView.getRenderingService().hooks.pick.callPromise({
|
|
204
204
|
topmost: false,
|
|
205
205
|
position: {
|
|
206
206
|
x: x,
|
package/es/dom/Element.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { __extends, __read, __spreadArray } from "tslib";
|
|
2
2
|
import { GlobalContainer } from 'mana-syringe';
|
|
3
|
-
import { isNil } from 'lodash-es';
|
|
4
3
|
import { SceneGraphService } from '../services/SceneGraphService';
|
|
5
4
|
import { Cullable, Geometry, Renderable, Transform, Sortable } from '../components';
|
|
6
5
|
import { Node } from './Node';
|
|
7
6
|
import { ElementEvent } from './interfaces';
|
|
8
|
-
import { formatAttribute } from '../utils';
|
|
7
|
+
import { formatAttribute, isNil } from '../utils';
|
|
9
8
|
import { MutationEvent } from './MutationEvent';
|
|
10
9
|
var entityCounter = 0;
|
|
11
10
|
/**
|
package/es/dom/EventTarget.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __read, __spreadArray } from "tslib";
|
|
2
|
-
import { isBoolean, isFunction, isObject } from 'lodash-es';
|
|
3
2
|
import { EventEmitter } from 'eventemitter3';
|
|
4
3
|
import { CustomEvent } from './CustomEvent';
|
|
5
4
|
import { FederatedEvent } from './FederatedEvent';
|
|
5
|
+
import { isFunction, isBoolean, isObject } from '../utils';
|
|
6
6
|
export var DELEGATION_SPLITTER = ':';
|
|
7
7
|
/**
|
|
8
8
|
* Objects that can receive events and may have listeners for them.
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import type { FormattedTouch } from '../utils';
|
|
1
2
|
import { FederatedEvent } from './FederatedEvent';
|
|
2
3
|
/**
|
|
3
4
|
* @see https://w3c.github.io/touch-events/#touchevent-interface
|
|
4
5
|
*/
|
|
5
6
|
export declare class FederatedTouchEvent extends FederatedEvent<MouseEvent | PointerEvent | TouchEvent> implements TouchEvent {
|
|
7
|
+
pointerType: string;
|
|
6
8
|
altKey: boolean;
|
|
7
9
|
ctrlKey: boolean;
|
|
8
10
|
metaKey: boolean;
|
|
9
11
|
shiftKey: boolean;
|
|
10
|
-
changedTouches:
|
|
11
|
-
targetTouches:
|
|
12
|
-
touches:
|
|
12
|
+
changedTouches: FormattedTouch[];
|
|
13
|
+
targetTouches: FormattedTouch[];
|
|
14
|
+
touches: FormattedTouch[];
|
|
13
15
|
}
|
|
@@ -11,7 +11,6 @@ export interface CullingStrategyContribution {
|
|
|
11
11
|
* 2. other custom culling strategies, eg. frustum culling
|
|
12
12
|
*/
|
|
13
13
|
export declare class CullingPlugin implements RenderingPlugin {
|
|
14
|
-
static tag: string;
|
|
15
14
|
private strategyProvider;
|
|
16
15
|
apply(renderingService: RenderingService): void;
|
|
17
16
|
}
|
|
@@ -13,11 +13,9 @@ var CullingPlugin =
|
|
|
13
13
|
function () {
|
|
14
14
|
function CullingPlugin() {}
|
|
15
15
|
|
|
16
|
-
CullingPlugin_1 = CullingPlugin;
|
|
17
|
-
|
|
18
16
|
CullingPlugin.prototype.apply = function (renderingService) {
|
|
19
17
|
var strategies = this.strategyProvider.getContributions();
|
|
20
|
-
renderingService.hooks.cull.tap(
|
|
18
|
+
renderingService.hooks.cull.tap(function (object) {
|
|
21
19
|
if (object) {
|
|
22
20
|
var cullable = object.cullable;
|
|
23
21
|
|
|
@@ -39,17 +37,14 @@ function () {
|
|
|
39
37
|
|
|
40
38
|
return object;
|
|
41
39
|
});
|
|
42
|
-
renderingService.hooks.afterRender.tap(
|
|
40
|
+
renderingService.hooks.afterRender.tap(function (object) {
|
|
43
41
|
object.cullable.visibilityPlaneMask = -1;
|
|
44
42
|
});
|
|
45
43
|
};
|
|
46
44
|
|
|
47
|
-
var CullingPlugin_1;
|
|
48
|
-
CullingPlugin.tag = 'CullingPlugin';
|
|
49
|
-
|
|
50
45
|
__decorate([contrib(CullingStrategyContribution), __metadata("design:type", Object)], CullingPlugin.prototype, "strategyProvider", void 0);
|
|
51
46
|
|
|
52
|
-
CullingPlugin =
|
|
47
|
+
CullingPlugin = __decorate([singleton({
|
|
53
48
|
contrib: RenderingPluginContribution
|
|
54
49
|
})], CullingPlugin);
|
|
55
50
|
return CullingPlugin;
|
|
@@ -3,7 +3,7 @@ import type { RenderingService, RenderingPlugin } from '../services/RenderingSer
|
|
|
3
3
|
* Filter dirty renderables and calculate the "dirty rectangle" which will be clear when frame began
|
|
4
4
|
*/
|
|
5
5
|
export declare class DirtyCheckPlugin implements RenderingPlugin {
|
|
6
|
-
|
|
6
|
+
private canvasConfig;
|
|
7
7
|
private renderingContext;
|
|
8
8
|
apply(renderingService: RenderingService): void;
|
|
9
9
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import { inject, singleton } from 'mana-syringe';
|
|
3
|
+
import { CanvasConfig } from '../types';
|
|
3
4
|
import { RenderingPluginContribution } from '../services/RenderingService';
|
|
4
5
|
import { RenderingContext, RenderReason } from '../services/RenderingContext';
|
|
5
6
|
/**
|
|
@@ -11,18 +12,19 @@ var DirtyCheckPlugin =
|
|
|
11
12
|
function () {
|
|
12
13
|
function DirtyCheckPlugin() {}
|
|
13
14
|
|
|
14
|
-
DirtyCheckPlugin_1 = DirtyCheckPlugin;
|
|
15
|
-
|
|
16
15
|
DirtyCheckPlugin.prototype.apply = function (renderingService) {
|
|
17
16
|
var _this = this;
|
|
18
17
|
|
|
19
|
-
renderingService.hooks.dirtycheck.tap(
|
|
18
|
+
renderingService.hooks.dirtycheck.tap(function (object) {
|
|
20
19
|
if (object) {
|
|
21
|
-
|
|
20
|
+
var enableDirtyCheck = _this.canvasConfig.renderer.getConfig().enableDirtyCheck;
|
|
21
|
+
|
|
22
22
|
var renderable = object.renderable;
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var isCameraDirty = _this.renderingContext.renderReasons.has(RenderReason.CAMERA_CHANGED);
|
|
25
25
|
|
|
26
|
+
var isRenderingContextDirty = _this.renderingContext.dirty;
|
|
27
|
+
var isDirty = renderable.dirty || isCameraDirty || (enableDirtyCheck ? false : isRenderingContextDirty);
|
|
26
28
|
|
|
27
29
|
if (isDirty) {
|
|
28
30
|
return object;
|
|
@@ -35,12 +37,11 @@ function () {
|
|
|
35
37
|
});
|
|
36
38
|
};
|
|
37
39
|
|
|
38
|
-
|
|
39
|
-
DirtyCheckPlugin.tag = 'DirtyCheckPlugin';
|
|
40
|
+
__decorate([inject(CanvasConfig), __metadata("design:type", Object)], DirtyCheckPlugin.prototype, "canvasConfig", void 0);
|
|
40
41
|
|
|
41
42
|
__decorate([inject(RenderingContext), __metadata("design:type", Object)], DirtyCheckPlugin.prototype, "renderingContext", void 0);
|
|
42
43
|
|
|
43
|
-
DirtyCheckPlugin =
|
|
44
|
+
DirtyCheckPlugin = __decorate([singleton({
|
|
44
45
|
contrib: RenderingPluginContribution
|
|
45
46
|
})], DirtyCheckPlugin);
|
|
46
47
|
return DirtyCheckPlugin;
|
|
@@ -7,7 +7,6 @@ import { RenderingService } from '../services';
|
|
|
7
7
|
* also provide some extra events such as `drag`
|
|
8
8
|
*/
|
|
9
9
|
export declare class EventPlugin implements RenderingPlugin {
|
|
10
|
-
static tag: string;
|
|
11
10
|
private canvasConfig;
|
|
12
11
|
private contextService;
|
|
13
12
|
private renderingService;
|
|
@@ -18,6 +17,7 @@ export declare class EventPlugin implements RenderingPlugin {
|
|
|
18
17
|
private rootWheelEvent;
|
|
19
18
|
apply(renderingService: RenderingService): void;
|
|
20
19
|
private onPointerMove;
|
|
20
|
+
private formatTouch;
|
|
21
21
|
private bootstrapEvent;
|
|
22
22
|
private normalizeWheelEvent;
|
|
23
23
|
/**
|