@antv/g 1.0.0-alpha.20 → 1.0.0-alpha.24
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/es/Canvas.d.ts +40 -18
- package/es/Canvas.js +121 -65
- package/es/DisplayObjectPool.d.ts +2 -1
- package/es/DisplayObjectPool.js +4 -0
- package/{lib → es/camera}/Camera.d.ts +6 -3
- package/es/{Camera.js → camera/Camera.js} +22 -16
- package/es/{Landmark.d.ts → camera/Landmark.d.ts} +2 -2
- package/es/{Landmark.js → camera/Landmark.js} +1 -1
- package/es/camera/index.d.ts +2 -0
- package/es/camera/index.js +2 -0
- package/es/components/Cullable.js +1 -1
- package/es/components/Geometry.d.ts +8 -1
- package/es/components/Renderable.d.ts +9 -8
- package/es/components/Renderable.js +2 -6
- package/es/components/Sortable.d.ts +6 -2
- package/es/display-objects/Circle.d.ts +2 -3
- package/es/display-objects/Circle.js +2 -5
- package/es/{CustomElement.d.ts → display-objects/CustomElement.d.ts} +1 -1
- package/es/{CustomElement.js → display-objects/CustomElement.js} +22 -12
- package/{lib → es/display-objects}/DisplayObject.d.ts +136 -141
- package/es/{DisplayObject.js → display-objects/DisplayObject.js} +408 -292
- package/es/display-objects/Ellipse.d.ts +2 -3
- package/es/display-objects/Ellipse.js +2 -5
- package/es/display-objects/Group.d.ts +2 -1
- package/es/display-objects/Group.js +13 -5
- package/es/display-objects/HTML.d.ts +2 -2
- package/es/display-objects/HTML.js +4 -7
- package/es/display-objects/Image.d.ts +2 -2
- package/es/display-objects/Image.js +2 -6
- package/es/display-objects/Line.d.ts +2 -2
- package/es/display-objects/Line.js +8 -8
- package/es/display-objects/Path.d.ts +3 -2
- package/es/display-objects/Path.js +8 -8
- package/es/display-objects/Polygon.d.ts +2 -2
- package/es/display-objects/Polygon.js +2 -6
- package/es/display-objects/Polyline.d.ts +2 -2
- package/es/display-objects/Polyline.js +8 -8
- package/es/display-objects/Rect.d.ts +2 -2
- package/es/display-objects/Rect.js +2 -6
- package/es/display-objects/Text.d.ts +2 -3
- package/es/display-objects/Text.js +8 -7
- package/es/display-objects/index.d.ts +2 -0
- package/es/display-objects/index.js +2 -0
- package/es/{Animation.d.ts → dom/Animation.d.ts} +3 -3
- package/es/{Animation.js → dom/Animation.js} +2 -3
- package/{lib → es/dom}/AnimationEffectTiming.d.ts +2 -0
- package/es/{AnimationEffectTiming.js → dom/AnimationEffectTiming.js} +3 -2
- package/es/{AnimationEvent.d.ts → dom/AnimationEvent.d.ts} +3 -2
- package/es/{AnimationEvent.js → dom/AnimationEvent.js} +1 -1
- package/es/{Timeline.d.ts → dom/AnimationTimeline.d.ts} +1 -1
- package/es/{Timeline.js → dom/AnimationTimeline.js} +1 -1
- package/es/dom/CustomElementRegistry.d.ts +15 -0
- package/es/dom/CustomElementRegistry.js +40 -0
- package/{lib → es/dom}/CustomEvent.d.ts +1 -1
- package/es/{CustomEvent.js → dom/CustomEvent.js} +1 -1
- package/es/dom/Document.d.ts +36 -17
- package/es/dom/Document.js +98 -14
- package/es/dom/Element.d.ts +71 -92
- package/es/dom/Element.js +179 -195
- package/es/dom/EventTarget.d.ts +11 -6
- package/es/dom/EventTarget.js +12 -4
- package/es/dom/FederatedEvent.d.ts +15 -7
- package/es/dom/FederatedEvent.js +33 -0
- package/es/dom/FederatedMouseEvent.d.ts +1 -1
- package/es/{KeyframeEffect.d.ts → dom/KeyframeEffect.d.ts} +16 -5
- package/es/{KeyframeEffect.js → dom/KeyframeEffect.js} +50 -4
- package/es/{KeyframeList.d.ts → dom/KeyframeList.d.ts} +1 -1
- package/es/{KeyframeList.js → dom/KeyframeList.js} +0 -0
- package/es/dom/Node.d.ts +38 -23
- package/es/dom/Node.js +37 -33
- package/es/dom/index.d.ts +15 -2
- package/es/dom/index.js +16 -3
- package/es/dom/interfaces.d.ts +301 -0
- package/es/dom/interfaces.js +1 -0
- package/es/global-module.d.ts +0 -2
- package/es/global-module.js +31 -29
- package/es/index.d.ts +7 -14
- package/es/index.js +8 -15
- package/es/plugins/CullingPlugin.d.ts +2 -2
- package/es/plugins/CullingPlugin.js +13 -16
- package/es/plugins/DirtyCheckPlugin.d.ts +1 -1
- package/es/plugins/DirtyCheckPlugin.js +8 -7
- package/es/plugins/EventPlugin.js +52 -31
- package/es/plugins/FrustumCullingStrategy.d.ts +1 -1
- package/es/plugins/FrustumCullingStrategy.js +5 -4
- package/es/plugins/PrepareRendererPlugin.d.ts +0 -1
- package/es/plugins/PrepareRendererPlugin.js +42 -38
- package/es/property-handlers/aabb.d.ts +2 -3
- package/es/property-handlers/aabb.js +29 -21
- package/es/property-handlers/anchor.d.ts +3 -0
- package/es/property-handlers/anchor.js +21 -0
- package/es/property-handlers/clipPath.d.ts +1 -1
- package/es/property-handlers/clipPath.js +3 -4
- package/es/property-handlers/color.d.ts +1 -1
- package/es/property-handlers/dimension.d.ts +1 -1
- package/es/property-handlers/dimension.js +6 -9
- package/es/property-handlers/filter.d.ts +1 -1
- package/es/property-handlers/index.d.ts +5 -4
- package/es/property-handlers/index.js +1 -0
- package/es/property-handlers/localPosition.d.ts +1 -1
- package/es/property-handlers/localPosition.js +1 -6
- package/es/property-handlers/offsetDistance.d.ts +1 -1
- package/es/property-handlers/offsetPath.d.ts +1 -1
- package/es/property-handlers/origin.d.ts +1 -1
- package/es/property-handlers/origin.js +9 -2
- package/es/property-handlers/path.d.ts +2 -2
- package/es/property-handlers/path.js +8 -4
- package/es/property-handlers/points.d.ts +1 -1
- package/es/property-handlers/transform.d.ts +1 -1
- package/es/property-handlers/zIndex.d.ts +1 -1
- package/es/services/ContextService.d.ts +3 -2
- package/es/services/EventService.d.ts +18 -13
- package/es/services/EventService.js +604 -384
- package/es/services/RenderingContext.d.ts +1 -1
- package/es/services/RenderingService.d.ts +23 -29
- package/es/services/RenderingService.js +63 -54
- package/es/services/SceneGraphSelector.d.ts +7 -7
- package/es/services/SceneGraphSelector.js +10 -6
- package/es/services/SceneGraphService.d.ts +73 -78
- package/es/services/SceneGraphService.js +165 -78
- package/es/services/aabb/PathUpdater.d.ts +1 -1
- package/es/services/aabb/RectUpdater.d.ts +2 -2
- package/es/services/aabb/interfaces.d.ts +1 -1
- package/es/shapes/Point.d.ts +4 -0
- package/es/shapes/Polygon.d.ts +9 -0
- package/es/shapes/Polygon.js +62 -0
- package/es/shapes/index.d.ts +1 -0
- package/es/shapes/index.js +2 -1
- package/es/types.d.ts +18 -6
- package/es/utils/animation.d.ts +1 -2
- package/es/utils/animation.js +5 -10
- package/es/utils/canvas.d.ts +1 -1
- package/es/utils/custom-easing.d.ts +3 -2
- package/es/utils/custom-easing.js +12 -6
- package/es/utils/event.js +1 -1
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +2 -1
- package/es/utils/interpolation.d.ts +3 -4
- package/es/utils/interpolation.js +0 -16
- package/es/utils/path.d.ts +2 -2
- package/lib/Canvas.d.ts +40 -18
- package/lib/Canvas.js +131 -74
- package/lib/DisplayObjectPool.d.ts +2 -1
- package/lib/DisplayObjectPool.js +4 -0
- package/{es → lib/camera}/Camera.d.ts +6 -3
- package/lib/{Camera.js → camera/Camera.js} +25 -20
- package/lib/{Landmark.d.ts → camera/Landmark.d.ts} +2 -2
- package/lib/{Landmark.js → camera/Landmark.js} +2 -3
- package/lib/camera/index.d.ts +2 -0
- package/lib/camera/index.js +31 -0
- package/lib/components/Cullable.js +1 -1
- package/lib/components/Geometry.d.ts +8 -1
- package/lib/components/Renderable.d.ts +9 -8
- package/lib/components/Renderable.js +2 -6
- package/lib/components/Sortable.d.ts +6 -2
- package/lib/display-objects/Circle.d.ts +2 -3
- package/lib/display-objects/Circle.js +3 -6
- package/lib/{CustomElement.d.ts → display-objects/CustomElement.d.ts} +1 -1
- package/lib/{CustomElement.js → display-objects/CustomElement.js} +22 -12
- package/{es → lib/display-objects}/DisplayObject.d.ts +136 -141
- package/lib/{DisplayObject.js → display-objects/DisplayObject.js} +418 -299
- package/lib/display-objects/Ellipse.d.ts +2 -3
- package/lib/display-objects/Ellipse.js +3 -6
- package/lib/display-objects/Group.d.ts +2 -1
- package/lib/display-objects/Group.js +12 -4
- package/lib/display-objects/HTML.d.ts +2 -2
- package/lib/display-objects/HTML.js +4 -7
- package/lib/display-objects/Image.d.ts +2 -2
- package/lib/display-objects/Image.js +2 -6
- package/lib/display-objects/Line.d.ts +2 -2
- package/lib/display-objects/Line.js +8 -8
- package/lib/display-objects/Path.d.ts +3 -2
- package/lib/display-objects/Path.js +8 -8
- package/lib/display-objects/Polygon.d.ts +2 -2
- package/lib/display-objects/Polygon.js +2 -6
- package/lib/display-objects/Polyline.d.ts +2 -2
- package/lib/display-objects/Polyline.js +8 -8
- package/lib/display-objects/Rect.d.ts +2 -2
- package/lib/display-objects/Rect.js +2 -6
- package/lib/display-objects/Text.d.ts +2 -3
- package/lib/display-objects/Text.js +9 -8
- package/lib/display-objects/index.d.ts +2 -0
- package/lib/display-objects/index.js +26 -0
- package/lib/{Animation.d.ts → dom/Animation.d.ts} +3 -3
- package/lib/{Animation.js → dom/Animation.js} +2 -3
- package/{es → lib/dom}/AnimationEffectTiming.d.ts +2 -0
- package/lib/{AnimationEffectTiming.js → dom/AnimationEffectTiming.js} +3 -3
- package/lib/{AnimationEvent.d.ts → dom/AnimationEvent.d.ts} +3 -2
- package/lib/{AnimationEvent.js → dom/AnimationEvent.js} +1 -1
- package/lib/{Timeline.d.ts → dom/AnimationTimeline.d.ts} +1 -1
- package/lib/{Timeline.js → dom/AnimationTimeline.js} +1 -1
- package/lib/dom/CustomElementRegistry.d.ts +15 -0
- package/lib/dom/CustomElementRegistry.js +48 -0
- package/{es → lib/dom}/CustomEvent.d.ts +1 -1
- package/lib/{CustomEvent.js → dom/CustomEvent.js} +1 -1
- package/lib/dom/Document.d.ts +36 -17
- package/lib/dom/Document.js +99 -15
- package/lib/dom/Element.d.ts +71 -92
- package/lib/dom/Element.js +180 -198
- package/lib/dom/EventTarget.d.ts +11 -6
- package/lib/dom/EventTarget.js +20 -10
- package/lib/dom/FederatedEvent.d.ts +15 -7
- package/lib/dom/FederatedEvent.js +33 -0
- package/lib/dom/FederatedMouseEvent.d.ts +1 -1
- package/lib/{KeyframeEffect.d.ts → dom/KeyframeEffect.d.ts} +16 -5
- package/lib/{KeyframeEffect.js → dom/KeyframeEffect.js} +50 -4
- package/lib/{KeyframeList.d.ts → dom/KeyframeList.d.ts} +1 -1
- package/lib/{KeyframeList.js → dom/KeyframeList.js} +0 -0
- package/lib/dom/Node.d.ts +38 -23
- package/lib/dom/Node.js +37 -33
- package/lib/dom/index.d.ts +15 -2
- package/lib/dom/index.js +177 -8
- package/lib/dom/interfaces.d.ts +301 -0
- package/lib/dom/interfaces.js +5 -0
- package/lib/global-module.d.ts +0 -2
- package/lib/global-module.js +30 -30
- package/lib/index.d.ts +7 -14
- package/lib/index.js +44 -135
- package/lib/plugins/CullingPlugin.d.ts +2 -2
- package/lib/plugins/CullingPlugin.js +14 -16
- package/lib/plugins/DirtyCheckPlugin.d.ts +1 -1
- package/lib/plugins/DirtyCheckPlugin.js +9 -7
- package/lib/plugins/EventPlugin.js +52 -30
- package/lib/plugins/FrustumCullingStrategy.d.ts +1 -1
- package/lib/plugins/FrustumCullingStrategy.js +5 -4
- package/lib/plugins/PrepareRendererPlugin.d.ts +0 -1
- package/lib/plugins/PrepareRendererPlugin.js +41 -37
- package/lib/property-handlers/aabb.d.ts +2 -3
- package/lib/property-handlers/aabb.js +28 -22
- package/lib/property-handlers/anchor.d.ts +3 -0
- package/lib/property-handlers/anchor.js +34 -0
- package/lib/property-handlers/clipPath.d.ts +1 -1
- package/lib/property-handlers/clipPath.js +3 -4
- package/lib/property-handlers/color.d.ts +1 -1
- package/lib/property-handlers/dimension.d.ts +1 -1
- package/lib/property-handlers/dimension.js +6 -9
- package/lib/property-handlers/filter.d.ts +1 -1
- package/lib/property-handlers/index.d.ts +5 -4
- package/lib/property-handlers/index.js +14 -0
- package/lib/property-handlers/localPosition.d.ts +1 -1
- package/lib/property-handlers/localPosition.js +1 -7
- package/lib/property-handlers/offsetDistance.d.ts +1 -1
- package/lib/property-handlers/offsetPath.d.ts +1 -1
- package/lib/property-handlers/origin.d.ts +1 -1
- package/lib/property-handlers/origin.js +10 -2
- package/lib/property-handlers/path.d.ts +2 -2
- package/lib/property-handlers/path.js +8 -4
- package/lib/property-handlers/points.d.ts +1 -1
- package/lib/property-handlers/transform.d.ts +1 -1
- package/lib/property-handlers/zIndex.d.ts +1 -1
- package/lib/services/ContextService.d.ts +3 -2
- package/lib/services/EventService.d.ts +18 -13
- package/lib/services/EventService.js +616 -385
- package/lib/services/RenderingContext.d.ts +1 -1
- package/lib/services/RenderingService.d.ts +23 -29
- package/lib/services/RenderingService.js +66 -56
- package/lib/services/SceneGraphSelector.d.ts +7 -7
- package/lib/services/SceneGraphSelector.js +10 -6
- package/lib/services/SceneGraphService.d.ts +73 -78
- package/lib/services/SceneGraphService.js +166 -79
- package/lib/services/aabb/PathUpdater.d.ts +1 -1
- package/lib/services/aabb/RectUpdater.d.ts +2 -2
- package/lib/services/aabb/interfaces.d.ts +1 -1
- package/lib/shapes/Point.d.ts +4 -0
- package/lib/shapes/Polygon.d.ts +9 -0
- package/lib/shapes/Polygon.js +69 -0
- package/lib/shapes/index.d.ts +1 -0
- package/lib/shapes/index.js +13 -0
- package/lib/types.d.ts +18 -6
- package/lib/utils/animation.d.ts +1 -2
- package/lib/utils/animation.js +8 -16
- package/lib/utils/canvas.d.ts +1 -1
- package/lib/utils/custom-easing.d.ts +3 -2
- package/lib/utils/custom-easing.js +16 -8
- package/lib/utils/event.js +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +13 -0
- package/lib/utils/interpolation.d.ts +3 -4
- package/lib/utils/interpolation.js +0 -17
- package/lib/utils/path.d.ts +2 -2
- package/package.json +6 -6
- package/es/Batch.d.ts +0 -25
- package/es/Batch.js +0 -82
- package/es/shapes-type.d.ts +0 -175
- package/es/shapes-type.js +0 -18
- package/es/utils/matrix-decompose.d.ts +0 -3
- package/es/utils/matrix-decompose.js +0 -404
- package/lib/Batch.d.ts +0 -25
- package/lib/Batch.js +0 -91
- package/lib/shapes-type.d.ts +0 -175
- package/lib/shapes-type.js +0 -41
- package/lib/utils/matrix-decompose.d.ts +0 -3
- package/lib/utils/matrix-decompose.js +0 -414
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { DisplayObject } from '
|
|
3
|
-
import { DisplayObjectConfig } from '../DisplayObject';
|
|
1
|
+
import { DisplayObjectConfig, BaseStyleProps, ParsedBaseStyleProps } from '..';
|
|
2
|
+
import { DisplayObject } from './DisplayObject';
|
|
4
3
|
export interface EllipseStyleProps extends BaseStyleProps {
|
|
5
4
|
rx: number;
|
|
6
5
|
ry: number;
|
|
@@ -7,9 +7,9 @@ exports.Ellipse = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _ = require("..");
|
|
11
11
|
|
|
12
|
-
var _DisplayObject = require("
|
|
12
|
+
var _DisplayObject = require("./DisplayObject");
|
|
13
13
|
|
|
14
14
|
var Ellipse = function (_super) {
|
|
15
15
|
(0, _tslib.__extends)(Ellipse, _super);
|
|
@@ -18,13 +18,10 @@ var Ellipse = function (_super) {
|
|
|
18
18
|
var style = _a.style,
|
|
19
19
|
rest = (0, _tslib.__rest)(_a, ["style"]);
|
|
20
20
|
return _super.call(this, (0, _tslib.__assign)({
|
|
21
|
-
type:
|
|
21
|
+
type: _.SHAPE.Ellipse,
|
|
22
22
|
style: (0, _tslib.__assign)({
|
|
23
23
|
rx: 0,
|
|
24
24
|
ry: 0,
|
|
25
|
-
opacity: 1,
|
|
26
|
-
fillOpacity: 1,
|
|
27
|
-
strokeOpacity: 1,
|
|
28
25
|
anchor: [0.5, 0.5]
|
|
29
26
|
}, style)
|
|
30
27
|
}, rest)) || this;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BaseStyleProps } from '../types';
|
|
2
|
-
import { DisplayObject
|
|
2
|
+
import { DisplayObject } from './DisplayObject';
|
|
3
|
+
import { DisplayObjectConfig } from '../dom';
|
|
3
4
|
export declare class Group extends DisplayObject {
|
|
4
5
|
constructor(config?: DisplayObjectConfig<BaseStyleProps>);
|
|
5
6
|
}
|
|
@@ -9,15 +9,23 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _types = require("../types");
|
|
11
11
|
|
|
12
|
-
var _DisplayObject = require("
|
|
12
|
+
var _DisplayObject = require("./DisplayObject");
|
|
13
13
|
|
|
14
14
|
var Group = function (_super) {
|
|
15
15
|
(0, _tslib.__extends)(Group, _super);
|
|
16
16
|
|
|
17
17
|
function Group(config) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
var _this = this;
|
|
19
|
+
|
|
20
|
+
var _a = config || {},
|
|
21
|
+
style = _a.style,
|
|
22
|
+
rest = (0, _tslib.__rest)(_a, ["style"]);
|
|
23
|
+
|
|
24
|
+
_this = _super.call(this, (0, _tslib.__assign)({
|
|
25
|
+
type: _types.SHAPE.Group,
|
|
26
|
+
style: (0, _tslib.__assign)({}, style)
|
|
27
|
+
}, rest)) || this;
|
|
28
|
+
return _this;
|
|
21
29
|
}
|
|
22
30
|
|
|
23
31
|
return Group;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
|
|
2
|
-
import { DisplayObject } from '
|
|
3
|
-
import { DisplayObjectConfig } from '../
|
|
2
|
+
import { DisplayObject } from './DisplayObject';
|
|
3
|
+
import { DisplayObjectConfig } from '../dom';
|
|
4
4
|
import { AABB } from '../shapes';
|
|
5
5
|
export interface HTMLStyleProps extends BaseStyleProps {
|
|
6
6
|
innerHTML: string | HTMLElement;
|
|
@@ -9,7 +9,7 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _types = require("../types");
|
|
11
11
|
|
|
12
|
-
var _DisplayObject = require("
|
|
12
|
+
var _DisplayObject = require("./DisplayObject");
|
|
13
13
|
|
|
14
14
|
var _components = require("../components");
|
|
15
15
|
|
|
@@ -33,15 +33,11 @@ var HTML = function (_super) {
|
|
|
33
33
|
style: (0, _tslib.__assign)({
|
|
34
34
|
innerHTML: '',
|
|
35
35
|
className: '',
|
|
36
|
-
style: ''
|
|
37
|
-
opacity: 1,
|
|
38
|
-
fillOpacity: 1,
|
|
39
|
-
strokeOpacity: 1,
|
|
40
|
-
anchor: [0, 0]
|
|
36
|
+
style: ''
|
|
41
37
|
}, style)
|
|
42
38
|
}, rest)) || this;
|
|
43
39
|
|
|
44
|
-
var cullable = _this.
|
|
40
|
+
var cullable = _this.entity.getComponent(_components.Cullable);
|
|
45
41
|
|
|
46
42
|
cullable.enable = false;
|
|
47
43
|
return _this;
|
|
@@ -74,6 +70,7 @@ var HTML = function (_super) {
|
|
|
74
70
|
var _a, _b;
|
|
75
71
|
|
|
76
72
|
var clientRect = this.getBoundingClientRect(); // calc context's offset
|
|
73
|
+
// @ts-ignore
|
|
77
74
|
|
|
78
75
|
var canvasRect = (_b = (_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) === null || _b === void 0 ? void 0 : _b.getContextService().getBoundingClientRect();
|
|
79
76
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
|
|
2
|
-
import { DisplayObject } from '
|
|
3
|
-
import { DisplayObjectConfig } from '../
|
|
2
|
+
import { DisplayObject } from './DisplayObject';
|
|
3
|
+
import { DisplayObjectConfig } from '../dom';
|
|
4
4
|
export interface ImageStyleProps extends BaseStyleProps {
|
|
5
5
|
img: string | HTMLImageElement;
|
|
6
6
|
width?: number;
|
|
@@ -9,7 +9,7 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _types = require("../types");
|
|
11
11
|
|
|
12
|
-
var _DisplayObject = require("
|
|
12
|
+
var _DisplayObject = require("./DisplayObject");
|
|
13
13
|
|
|
14
14
|
var Image = function (_super) {
|
|
15
15
|
(0, _tslib.__extends)(Image, _super);
|
|
@@ -20,11 +20,7 @@ var Image = function (_super) {
|
|
|
20
20
|
return _super.call(this, (0, _tslib.__assign)({
|
|
21
21
|
type: _types.SHAPE.Image,
|
|
22
22
|
style: (0, _tslib.__assign)({
|
|
23
|
-
img: ''
|
|
24
|
-
opacity: 1,
|
|
25
|
-
fillOpacity: 1,
|
|
26
|
-
strokeOpacity: 1,
|
|
27
|
-
anchor: [0, 0]
|
|
23
|
+
img: ''
|
|
28
24
|
}, style)
|
|
29
25
|
}, rest)) || this;
|
|
30
26
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
|
|
2
|
-
import { DisplayObject } from '
|
|
3
|
-
import type { DisplayObjectConfig } from '../
|
|
2
|
+
import { DisplayObject } from './DisplayObject';
|
|
3
|
+
import type { DisplayObjectConfig } from '../dom';
|
|
4
4
|
import { Point } from '../shapes';
|
|
5
5
|
export interface LineStyleProps extends BaseStyleProps {
|
|
6
6
|
x1: number;
|
|
@@ -11,7 +11,7 @@ var _gMath = require("@antv/g-math");
|
|
|
11
11
|
|
|
12
12
|
var _types = require("../types");
|
|
13
13
|
|
|
14
|
-
var _DisplayObject = require("
|
|
14
|
+
var _DisplayObject = require("./DisplayObject");
|
|
15
15
|
|
|
16
16
|
var _shapes = require("../shapes");
|
|
17
17
|
|
|
@@ -28,13 +28,13 @@ var Line = function (_super) {
|
|
|
28
28
|
y1: 0,
|
|
29
29
|
x2: 0,
|
|
30
30
|
y2: 0,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
lineJoin: "miter"
|
|
32
|
+
/* Miter */
|
|
33
|
+
,
|
|
34
|
+
lineCap: "butt"
|
|
35
|
+
/* Butt */
|
|
36
|
+
,
|
|
37
|
+
lineWidth: 1
|
|
38
38
|
}, style)
|
|
39
39
|
}, rest)) || this;
|
|
40
40
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseStyleProps, PathCommand } from '../types';
|
|
2
|
-
import { DisplayObject } from '
|
|
3
|
-
import { DisplayObjectConfig } from '../
|
|
2
|
+
import { DisplayObject } from './DisplayObject';
|
|
3
|
+
import { DisplayObjectConfig } from '../dom';
|
|
4
4
|
import { Point } from '../shapes';
|
|
5
5
|
import type { Rect } from '../shapes/Rect';
|
|
6
6
|
export interface PathStyleProps extends BaseStyleProps {
|
|
@@ -24,6 +24,7 @@ export interface ParsedPathStyleProps {
|
|
|
24
24
|
curve: PathCommand[];
|
|
25
25
|
totalLength: number;
|
|
26
26
|
curveSegments: number[][];
|
|
27
|
+
zCommandIndexes: number[];
|
|
27
28
|
rect: Rect;
|
|
28
29
|
}
|
|
29
30
|
export declare class Path extends DisplayObject<PathStyleProps, {
|
|
@@ -9,7 +9,7 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _types = require("../types");
|
|
11
11
|
|
|
12
|
-
var _DisplayObject = require("
|
|
12
|
+
var _DisplayObject = require("./DisplayObject");
|
|
13
13
|
|
|
14
14
|
var _shapes = require("../shapes");
|
|
15
15
|
|
|
@@ -27,13 +27,13 @@ var Path = function (_super) {
|
|
|
27
27
|
type: _types.SHAPE.Path,
|
|
28
28
|
style: (0, _tslib.__assign)({
|
|
29
29
|
path: '',
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
lineJoin: "miter"
|
|
31
|
+
/* Miter */
|
|
32
|
+
,
|
|
33
|
+
lineCap: "butt"
|
|
34
|
+
/* Butt */
|
|
35
|
+
,
|
|
36
|
+
lineWidth: 1
|
|
37
37
|
}, style)
|
|
38
38
|
}, rest)) || this;
|
|
39
39
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseStyleProps } from '../types';
|
|
2
|
-
import { DisplayObject } from '
|
|
3
|
-
import { DisplayObjectConfig } from '../
|
|
2
|
+
import { DisplayObject } from './DisplayObject';
|
|
3
|
+
import { DisplayObjectConfig } from '../dom';
|
|
4
4
|
import type { ParsedPolylineStyleProps } from './Polyline';
|
|
5
5
|
export interface PolygonStyleProps extends BaseStyleProps {
|
|
6
6
|
points: [number, number][];
|
|
@@ -9,7 +9,7 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _types = require("../types");
|
|
11
11
|
|
|
12
|
-
var _DisplayObject = require("
|
|
12
|
+
var _DisplayObject = require("./DisplayObject");
|
|
13
13
|
|
|
14
14
|
var Polygon = function (_super) {
|
|
15
15
|
(0, _tslib.__extends)(Polygon, _super);
|
|
@@ -20,11 +20,7 @@ var Polygon = function (_super) {
|
|
|
20
20
|
return _super.call(this, (0, _tslib.__assign)({
|
|
21
21
|
type: _types.SHAPE.Polygon,
|
|
22
22
|
style: (0, _tslib.__assign)({
|
|
23
|
-
points: []
|
|
24
|
-
opacity: 1,
|
|
25
|
-
fillOpacity: 1,
|
|
26
|
-
strokeOpacity: 1,
|
|
27
|
-
anchor: [0, 0]
|
|
23
|
+
points: []
|
|
28
24
|
}, style)
|
|
29
25
|
}, rest)) || this;
|
|
30
26
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseStyleProps } from '../types';
|
|
2
|
-
import { DisplayObject } from '
|
|
3
|
-
import { DisplayObjectConfig } from '../
|
|
2
|
+
import { DisplayObject } from './DisplayObject';
|
|
3
|
+
import { DisplayObjectConfig } from '../dom';
|
|
4
4
|
import { Point } from '../shapes';
|
|
5
5
|
export interface PolylineStyleProps extends BaseStyleProps {
|
|
6
6
|
points: [number, number][];
|
|
@@ -9,7 +9,7 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _types = require("../types");
|
|
11
11
|
|
|
12
|
-
var _DisplayObject = require("
|
|
12
|
+
var _DisplayObject = require("./DisplayObject");
|
|
13
13
|
|
|
14
14
|
var _gMath = require("@antv/g-math");
|
|
15
15
|
|
|
@@ -25,13 +25,13 @@ var Polyline = function (_super) {
|
|
|
25
25
|
type: _types.SHAPE.Polyline,
|
|
26
26
|
style: (0, _tslib.__assign)({
|
|
27
27
|
points: [],
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
lineJoin: "miter"
|
|
29
|
+
/* Miter */
|
|
30
|
+
,
|
|
31
|
+
lineCap: "butt"
|
|
32
|
+
/* Butt */
|
|
33
|
+
,
|
|
34
|
+
lineWidth: 1
|
|
35
35
|
}, style)
|
|
36
36
|
}, rest)) || this;
|
|
37
37
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
|
|
2
|
-
import { DisplayObject } from '
|
|
3
|
-
import type { DisplayObjectConfig } from '../
|
|
2
|
+
import { DisplayObject } from './DisplayObject';
|
|
3
|
+
import type { DisplayObjectConfig } from '../dom';
|
|
4
4
|
export interface RectStyleProps extends BaseStyleProps {
|
|
5
5
|
width: number;
|
|
6
6
|
height: number;
|
|
@@ -9,7 +9,7 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _types = require("../types");
|
|
11
11
|
|
|
12
|
-
var _DisplayObject = require("
|
|
12
|
+
var _DisplayObject = require("./DisplayObject");
|
|
13
13
|
|
|
14
14
|
var Rect = function (_super) {
|
|
15
15
|
(0, _tslib.__extends)(Rect, _super);
|
|
@@ -21,11 +21,7 @@ var Rect = function (_super) {
|
|
|
21
21
|
type: _types.SHAPE.Rect,
|
|
22
22
|
style: (0, _tslib.__assign)({
|
|
23
23
|
width: 0,
|
|
24
|
-
height: 0
|
|
25
|
-
opacity: 1,
|
|
26
|
-
fillOpacity: 1,
|
|
27
|
-
strokeOpacity: 1,
|
|
28
|
-
anchor: [0, 0]
|
|
24
|
+
height: 0
|
|
29
25
|
}, style)
|
|
30
26
|
}, rest)) || this;
|
|
31
27
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { DisplayObject } from '
|
|
3
|
-
import { DisplayObjectConfig } from '../DisplayObject';
|
|
1
|
+
import { BaseStyleProps, ParsedBaseStyleProps, DisplayObjectConfig } from '..';
|
|
2
|
+
import { DisplayObject } from './DisplayObject';
|
|
4
3
|
import { TextMetrics } from '../services';
|
|
5
4
|
export interface TextStyleProps extends BaseStyleProps {
|
|
6
5
|
text: string;
|
|
@@ -7,9 +7,9 @@ exports.Text = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _ = require("..");
|
|
11
11
|
|
|
12
|
-
var _DisplayObject = require("
|
|
12
|
+
var _DisplayObject = require("./DisplayObject");
|
|
13
13
|
|
|
14
14
|
var Text = function (_super) {
|
|
15
15
|
(0, _tslib.__extends)(Text, _super);
|
|
@@ -18,11 +18,8 @@ var Text = function (_super) {
|
|
|
18
18
|
var style = _a.style,
|
|
19
19
|
rest = (0, _tslib.__rest)(_a, ["style"]);
|
|
20
20
|
return _super.call(this, (0, _tslib.__assign)({
|
|
21
|
-
type:
|
|
21
|
+
type: _.SHAPE.Text,
|
|
22
22
|
style: (0, _tslib.__assign)({
|
|
23
|
-
opacity: 1,
|
|
24
|
-
fillOpacity: 1,
|
|
25
|
-
strokeOpacity: 1,
|
|
26
23
|
text: '',
|
|
27
24
|
fontSize: 12,
|
|
28
25
|
fontFamily: 'sans-serif',
|
|
@@ -40,8 +37,12 @@ var Text = function (_super) {
|
|
|
40
37
|
fill: '#000',
|
|
41
38
|
letterSpacing: 0,
|
|
42
39
|
lineHeight: 0,
|
|
43
|
-
lineJoin:
|
|
44
|
-
|
|
40
|
+
lineJoin: "miter"
|
|
41
|
+
/* Miter */
|
|
42
|
+
,
|
|
43
|
+
lineCap: "butt"
|
|
44
|
+
/* Butt */
|
|
45
|
+
,
|
|
45
46
|
lineWidth: 0,
|
|
46
47
|
miterLimit: 10,
|
|
47
48
|
padding: 0,
|
|
@@ -4,6 +4,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
+
var _DisplayObject = require("./DisplayObject");
|
|
8
|
+
|
|
9
|
+
Object.keys(_DisplayObject).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _DisplayObject[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _DisplayObject[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _CustomElement = require("./CustomElement");
|
|
21
|
+
|
|
22
|
+
Object.keys(_CustomElement).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _CustomElement[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _CustomElement[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
7
33
|
var _Circle = require("./Circle");
|
|
8
34
|
|
|
9
35
|
Object.keys(_Circle).forEach(function (key) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { KeyframeEffect } from './KeyframeEffect';
|
|
2
|
-
import { AnimationTimeline } from './
|
|
1
|
+
import type { KeyframeEffect } from './KeyframeEffect';
|
|
2
|
+
import type { AnimationTimeline } from './AnimationTimeline';
|
|
3
3
|
/**
|
|
4
4
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/Animation
|
|
5
5
|
*/
|
|
6
|
-
export declare class Animation
|
|
6
|
+
export declare class Animation {
|
|
7
7
|
/**
|
|
8
8
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/effect
|
|
9
9
|
*/
|
|
@@ -27,6 +27,7 @@ var Animation = function () {
|
|
|
27
27
|
this._playbackRate = 1;
|
|
28
28
|
this._inTimeline = true;
|
|
29
29
|
this.effect = effect;
|
|
30
|
+
effect.animation = this;
|
|
30
31
|
this.timeline = timeline;
|
|
31
32
|
this.id = "" + sequenceNumber++;
|
|
32
33
|
this._inEffect = !!this.effect.update(0);
|
|
@@ -375,7 +376,7 @@ var Animation = function () {
|
|
|
375
376
|
var _a;
|
|
376
377
|
|
|
377
378
|
var target = (_a = this.effect) === null || _a === void 0 ? void 0 : _a.target;
|
|
378
|
-
return target.
|
|
379
|
+
return target.getAnimations();
|
|
379
380
|
};
|
|
380
381
|
|
|
381
382
|
Animation.prototype.markTarget = function () {
|
|
@@ -479,7 +480,6 @@ var Animation = function () {
|
|
|
479
480
|
if (this._isFinished) {
|
|
480
481
|
if (!this._finishedFlag) {
|
|
481
482
|
if (this.onfinish) {
|
|
482
|
-
// @ts-ignore
|
|
483
483
|
var event_1 = new _AnimationEvent.AnimationEvent(null, this, this.currentTime, baseTime);
|
|
484
484
|
setTimeout(function () {
|
|
485
485
|
_this.onfinish && _this.onfinish(event_1);
|
|
@@ -490,7 +490,6 @@ var Animation = function () {
|
|
|
490
490
|
}
|
|
491
491
|
} else {
|
|
492
492
|
if (this.onframe && this.playState === 'running') {
|
|
493
|
-
// @ts-ignore
|
|
494
493
|
var event_2 = new _AnimationEvent.AnimationEvent(null, this, this.currentTime, baseTime);
|
|
495
494
|
this.onframe(event_2);
|
|
496
495
|
}
|
|
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.AnimationEffectTiming = void 0;
|
|
7
7
|
|
|
8
|
-
var _animation = require("
|
|
9
|
-
|
|
10
|
-
/* eslint-disable no-underscore-dangle */
|
|
8
|
+
var _animation = require("../utils/animation");
|
|
11
9
|
|
|
12
10
|
/**
|
|
13
11
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/EffectTiming
|
|
@@ -54,6 +52,8 @@ var AnimationEffectTiming = function () {
|
|
|
54
52
|
*/
|
|
55
53
|
|
|
56
54
|
this.iterations = 1;
|
|
55
|
+
this.currentIteration = null;
|
|
56
|
+
this.progress = null;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
Object.defineProperty(AnimationEffectTiming.prototype, "easing", {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { FederatedEvent } from './
|
|
2
|
-
import type { EventService } from '
|
|
1
|
+
import { FederatedEvent } from './FederatedEvent';
|
|
2
|
+
import type { EventService } from '../services';
|
|
3
|
+
import type { Animation } from './Animation';
|
|
3
4
|
/**
|
|
4
5
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationPlaybackEvent
|
|
5
6
|
*/
|
|
@@ -7,7 +7,7 @@ exports.AnimationEvent = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
10
|
-
var _FederatedEvent = require("./
|
|
10
|
+
var _FederatedEvent = require("./FederatedEvent");
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationPlaybackEvent
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Animation } from './Animation';
|
|
2
|
-
import { KeyframeEffect } from './KeyframeEffect';
|
|
2
|
+
import type { KeyframeEffect } from './KeyframeEffect';
|
|
3
3
|
export declare function compareAnimations(leftAnimation: Animation, rightAnimation: Animation): number;
|
|
4
4
|
/**
|
|
5
5
|
* @see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/web-animations-js/index.d.ts
|
|
@@ -12,7 +12,7 @@ var _inversify = require("inversify");
|
|
|
12
12
|
|
|
13
13
|
var _Animation = require("./Animation");
|
|
14
14
|
|
|
15
|
-
var _raf = require("
|
|
15
|
+
var _raf = require("../utils/raf");
|
|
16
16
|
|
|
17
17
|
function compareAnimations(leftAnimation, rightAnimation) {
|
|
18
18
|
return Number(leftAnimation.id) - Number(rightAnimation.id);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DisplayObject } from '..';
|
|
2
|
+
/**
|
|
3
|
+
* canvas.customElements
|
|
4
|
+
*
|
|
5
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry
|
|
6
|
+
*/
|
|
7
|
+
export declare class CustomElementRegistry {
|
|
8
|
+
private registry;
|
|
9
|
+
constructor();
|
|
10
|
+
define<T extends DisplayObject>(name: string, constructor: new (...args: any[]) => T): void;
|
|
11
|
+
/**
|
|
12
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/get
|
|
13
|
+
*/
|
|
14
|
+
get<T extends DisplayObject>(name: string): new (...args: any[]) => T;
|
|
15
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CustomElementRegistry = void 0;
|
|
7
|
+
|
|
8
|
+
var _ = require("..");
|
|
9
|
+
|
|
10
|
+
var _displayObjects = require("../display-objects");
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* canvas.customElements
|
|
14
|
+
*
|
|
15
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry
|
|
16
|
+
*/
|
|
17
|
+
var CustomElementRegistry = function () {
|
|
18
|
+
function CustomElementRegistry() {
|
|
19
|
+
this.registry = {};
|
|
20
|
+
this.define(_.SHAPE.Circle, _displayObjects.Circle);
|
|
21
|
+
this.define(_.SHAPE.Ellipse, _displayObjects.Ellipse);
|
|
22
|
+
this.define(_.SHAPE.Rect, _displayObjects.Rect);
|
|
23
|
+
this.define(_.SHAPE.Image, _displayObjects.Image);
|
|
24
|
+
this.define(_.SHAPE.Line, _displayObjects.Line);
|
|
25
|
+
this.define(_.SHAPE.Group, _displayObjects.Group);
|
|
26
|
+
this.define(_.SHAPE.Path, _displayObjects.Path);
|
|
27
|
+
this.define(_.SHAPE.Polygon, _displayObjects.Polygon);
|
|
28
|
+
this.define(_.SHAPE.Polyline, _displayObjects.Polyline);
|
|
29
|
+
this.define(_.SHAPE.Text, _displayObjects.Text);
|
|
30
|
+
this.define(_.SHAPE.HTML, _displayObjects.HTML);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
CustomElementRegistry.prototype.define = function (name, constructor) {
|
|
34
|
+
this.registry[name] = constructor;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/get
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
CustomElementRegistry.prototype.get = function (name) {
|
|
42
|
+
return this.registry[name];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return CustomElementRegistry;
|
|
46
|
+
}();
|
|
47
|
+
|
|
48
|
+
exports.CustomElementRegistry = CustomElementRegistry;
|
|
@@ -7,7 +7,7 @@ exports.CustomEvent = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
10
|
-
var _FederatedEvent = require("./
|
|
10
|
+
var _FederatedEvent = require("./FederatedEvent");
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @see https://developer.mozilla.org/en-US/docs/Web/Events/Creating_and_triggering_events
|