@antv/g 5.0.17 → 5.0.18
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 +31 -0
- package/es/AbstractRenderer.js +3 -1
- package/es/Canvas.d.ts +4 -1
- package/es/Canvas.js +4 -2
- package/es/DisplayObjectPool.js +3 -1
- package/es/camera/Camera.js +3 -1
- package/es/camera/Landmark.js +3 -1
- package/es/components/Cullable.js +3 -1
- package/es/components/Geometry.js +3 -1
- package/es/components/Renderable.js +3 -1
- package/es/components/Sortable.js +3 -1
- package/es/components/Transform.js +3 -1
- package/es/display-objects/Circle.js +3 -1
- package/es/display-objects/CustomElement.js +3 -1
- package/es/display-objects/DisplayObject.js +6 -3
- package/es/display-objects/Ellipse.js +3 -1
- package/es/display-objects/Group.js +3 -1
- package/es/display-objects/HTML.js +6 -3
- package/es/display-objects/Image.js +3 -1
- package/es/display-objects/Line.js +3 -1
- package/es/display-objects/Path.js +3 -1
- package/es/display-objects/Polygon.js +3 -1
- package/es/display-objects/Polyline.js +3 -1
- package/es/display-objects/Rect.js +3 -1
- package/es/display-objects/Text.js +6 -3
- package/es/dom/Animation.js +4 -2
- package/es/dom/AnimationEffectTiming.js +3 -1
- package/es/dom/AnimationEvent.js +3 -1
- package/es/dom/AnimationTimeline.js +3 -1
- package/es/dom/CustomElementRegistry.js +3 -1
- package/es/dom/CustomEvent.js +3 -1
- package/es/dom/Document.js +3 -1
- package/es/dom/Element.d.ts +6 -0
- package/es/dom/Element.js +16 -5
- package/es/dom/EventTarget.js +5 -3
- package/es/dom/FederatedEvent.d.ts +2 -2
- package/es/dom/FederatedEvent.js +3 -1
- package/es/dom/FederatedMouseEvent.js +3 -1
- package/es/dom/FederatedPointerEvent.js +3 -1
- package/es/dom/FederatedWheelEvent.js +3 -1
- package/es/dom/KeyframeEffect.js +3 -1
- package/es/dom/KeyframeList.js +1 -1
- package/es/dom/MutationEvent.js +3 -1
- package/es/dom/MutationObserver.js +10 -3
- package/es/dom/MutationRecord.js +3 -1
- package/es/dom/Node.js +4 -2
- package/es/dom/interfaces.d.ts +3 -0
- package/es/plugins/CullingPlugin.js +3 -1
- package/es/plugins/DirtyCheckPlugin.js +3 -1
- package/es/plugins/EventPlugin.d.ts +1 -1
- package/es/plugins/EventPlugin.js +3 -1
- package/es/plugins/FrustumCullingStrategy.js +6 -3
- package/es/plugins/PrepareRendererPlugin.js +3 -1
- package/es/property-handlers/color.js +2 -2
- package/es/property-handlers/dimension.js +1 -1
- package/es/property-handlers/path.d.ts +1 -1
- package/es/property-handlers/text.js +1 -1
- package/es/services/EventService.js +13 -5
- package/es/services/RenderingService.d.ts +12 -2
- package/es/services/RenderingService.js +24 -5
- package/es/services/SceneGraphSelector.js +3 -1
- package/es/services/SceneGraphService.js +11 -11
- package/es/services/aabb/CircleUpdater.js +3 -1
- package/es/services/aabb/EllipseUpdater.js +3 -1
- package/es/services/aabb/LineUpdater.js +3 -1
- package/es/services/aabb/PathUpdater.js +3 -1
- package/es/services/aabb/PolylineUpdater.js +3 -1
- package/es/services/aabb/RectUpdater.js +3 -1
- package/es/services/aabb/TextUpdater.js +15 -1
- package/es/services/text/OffscreenCanvasCreator.js +3 -1
- package/es/services/text/index.js +5 -3
- package/es/shapes/AABB.js +8 -1
- package/es/shapes/BoundingSphere.js +3 -1
- package/es/shapes/Frustum.js +3 -1
- package/es/shapes/Plane.js +3 -1
- package/es/shapes/Point.js +3 -1
- package/es/shapes/Polygon.js +3 -1
- package/es/shapes/Ray.js +3 -1
- package/es/shapes/Rect.js +3 -1
- package/es/shapes/Rectangle.js +3 -1
- package/es/utils/custom-easing.js +1 -1
- package/es/utils/event.js +6 -5
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +2 -1
- package/es/utils/path.d.ts +1 -1
- package/es/utils/path.js +3 -3
- package/es/utils/text.js +3 -3
- package/lib/AbstractRenderer.js +3 -1
- package/lib/Canvas.d.ts +4 -1
- package/lib/Canvas.js +5 -3
- package/lib/DisplayObjectPool.js +3 -1
- package/lib/camera/Camera.js +4 -2
- package/lib/camera/Landmark.js +3 -1
- package/lib/components/Cullable.js +4 -2
- package/lib/components/Geometry.js +3 -1
- package/lib/components/Renderable.js +3 -1
- package/lib/components/Sortable.js +3 -1
- package/lib/components/Transform.js +3 -1
- package/lib/display-objects/Circle.js +3 -1
- package/lib/display-objects/CustomElement.js +3 -1
- package/lib/display-objects/DisplayObject.js +6 -3
- package/lib/display-objects/Ellipse.js +3 -1
- package/lib/display-objects/Group.js +3 -1
- package/lib/display-objects/HTML.js +6 -4
- package/lib/display-objects/Image.js +3 -1
- package/lib/display-objects/Line.js +3 -1
- package/lib/display-objects/Path.js +3 -1
- package/lib/display-objects/Polygon.js +3 -1
- package/lib/display-objects/Polyline.js +3 -1
- package/lib/display-objects/Rect.js +3 -1
- package/lib/display-objects/Text.js +6 -4
- package/lib/dom/Animation.js +4 -2
- package/lib/dom/AnimationEffectTiming.js +3 -1
- package/lib/dom/AnimationEvent.js +3 -1
- package/lib/dom/AnimationTimeline.js +4 -2
- package/lib/dom/CustomElementRegistry.js +3 -1
- package/lib/dom/CustomEvent.js +3 -1
- package/lib/dom/Document.js +3 -1
- package/lib/dom/Element.d.ts +6 -0
- package/lib/dom/Element.js +16 -5
- package/lib/dom/EventTarget.js +5 -3
- package/lib/dom/FederatedEvent.d.ts +2 -2
- package/lib/dom/FederatedEvent.js +3 -1
- package/lib/dom/FederatedMouseEvent.js +3 -1
- package/lib/dom/FederatedPointerEvent.js +3 -1
- package/lib/dom/FederatedWheelEvent.js +3 -1
- package/lib/dom/KeyframeEffect.js +4 -2
- package/lib/dom/KeyframeList.js +1 -1
- package/lib/dom/MutationEvent.js +3 -1
- package/lib/dom/MutationObserver.js +11 -4
- package/lib/dom/MutationRecord.js +3 -1
- package/lib/dom/Node.js +4 -2
- package/lib/dom/interfaces.d.ts +3 -0
- package/lib/global-module.js +3 -2
- package/lib/index.js +1 -1
- package/lib/plugins/CullingPlugin.js +4 -2
- package/lib/plugins/DirtyCheckPlugin.js +3 -1
- package/lib/plugins/EventPlugin.d.ts +1 -1
- package/lib/plugins/EventPlugin.js +3 -1
- package/lib/plugins/FrustumCullingStrategy.js +5 -2
- package/lib/plugins/PrepareRendererPlugin.js +3 -1
- package/lib/property-handlers/color.js +5 -5
- package/lib/property-handlers/dimension.js +6 -5
- package/lib/property-handlers/inherit.js +1 -1
- package/lib/property-handlers/interfaces.js +1 -1
- package/lib/property-handlers/numeric.js +3 -3
- package/lib/property-handlers/path.d.ts +1 -1
- package/lib/property-handlers/path.js +1 -1
- package/lib/property-handlers/text.js +1 -1
- package/lib/property-handlers/transform.js +1 -1
- package/lib/services/EventService.js +13 -5
- package/lib/services/RenderingService.d.ts +12 -2
- package/lib/services/RenderingService.js +25 -5
- package/lib/services/SceneGraphSelector.js +4 -2
- package/lib/services/SceneGraphService.js +13 -17
- package/lib/services/aabb/CircleUpdater.js +3 -1
- package/lib/services/aabb/EllipseUpdater.js +3 -1
- package/lib/services/aabb/LineUpdater.js +3 -1
- package/lib/services/aabb/PathUpdater.js +3 -1
- package/lib/services/aabb/PolylineUpdater.js +3 -1
- package/lib/services/aabb/RectUpdater.js +3 -1
- package/lib/services/aabb/TextUpdater.js +15 -1
- package/lib/services/aabb/index.js +10 -10
- package/lib/services/aabb/interfaces.js +1 -1
- package/lib/services/text/OffscreenCanvasCreator.js +3 -1
- package/lib/services/text/index.js +5 -3
- package/lib/shapes/AABB.js +8 -1
- package/lib/shapes/BoundingSphere.js +3 -1
- package/lib/shapes/Frustum.js +4 -2
- package/lib/shapes/Plane.js +3 -1
- package/lib/shapes/Point.js +3 -1
- package/lib/shapes/Polygon.js +3 -1
- package/lib/shapes/Ray.js +3 -1
- package/lib/shapes/Rect.js +3 -1
- package/lib/shapes/Rectangle.js +3 -1
- package/lib/types.js +1 -1
- package/lib/utils/animation.js +3 -2
- package/lib/utils/bezier-easing.js +1 -1
- package/lib/utils/custom-easing.js +2 -2
- package/lib/utils/event.js +9 -7
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +13 -0
- package/lib/utils/math.js +5 -5
- package/lib/utils/path.d.ts +1 -1
- package/lib/utils/path.js +6 -6
- package/lib/utils/raf.js +2 -1
- package/lib/utils/text.js +3 -3
- package/package.json +3 -3
- package/es/display-objects/TSpan.d.ts +0 -1
- package/es/display-objects/TSpan.js +0 -0
- package/lib/display-objects/TSpan.d.ts +0 -1
- package/lib/display-objects/TSpan.js +0 -1
package/es/AbstractRenderer.js
CHANGED
package/es/Canvas.d.ts
CHANGED
|
@@ -71,7 +71,10 @@ export declare class Canvas extends EventTarget implements ICanvas {
|
|
|
71
71
|
getRenderingContext(): RenderingContext;
|
|
72
72
|
getStats(): {
|
|
73
73
|
total: number;
|
|
74
|
-
rendered: number;
|
|
74
|
+
rendered: number; /**
|
|
75
|
+
* window.document
|
|
76
|
+
*/
|
|
77
|
+
renderedOnscreen: number;
|
|
75
78
|
};
|
|
76
79
|
/**
|
|
77
80
|
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Window/getComputedStyle
|
package/es/Canvas.js
CHANGED
|
@@ -29,7 +29,9 @@ export var CanvasEvent;
|
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var Canvas =
|
|
32
|
+
var Canvas =
|
|
33
|
+
/** @class */
|
|
34
|
+
function (_super) {
|
|
33
35
|
__extends(Canvas, _super);
|
|
34
36
|
|
|
35
37
|
function Canvas(config) {
|
|
@@ -301,7 +303,7 @@ var Canvas = function (_super) {
|
|
|
301
303
|
|
|
302
304
|
if (this.container.isBound(RenderingService)) {
|
|
303
305
|
var renderingService = this.container.get(RenderingService);
|
|
304
|
-
renderingService.render();
|
|
306
|
+
renderingService.render(this.getConfig());
|
|
305
307
|
}
|
|
306
308
|
|
|
307
309
|
this.emit(CanvasEvent.AFTER_RENDER, {});
|
package/es/DisplayObjectPool.js
CHANGED
package/es/camera/Camera.js
CHANGED
package/es/camera/Landmark.js
CHANGED
|
@@ -7,7 +7,9 @@ export var Strategy;
|
|
|
7
7
|
Strategy[Strategy["Standard"] = 0] = "Standard";
|
|
8
8
|
})(Strategy || (Strategy = {}));
|
|
9
9
|
|
|
10
|
-
var Cullable =
|
|
10
|
+
var Cullable =
|
|
11
|
+
/** @class */
|
|
12
|
+
function () {
|
|
11
13
|
function Cullable() {
|
|
12
14
|
this.strategy = Strategy.Standard;
|
|
13
15
|
this.visibilityPlaneMask = -1;
|
|
@@ -2,7 +2,9 @@ import { __assign, __extends, __rest } from "tslib";
|
|
|
2
2
|
import { Shape } from '../types';
|
|
3
3
|
import { DisplayObject } from './DisplayObject';
|
|
4
4
|
|
|
5
|
-
var Circle =
|
|
5
|
+
var Circle =
|
|
6
|
+
/** @class */
|
|
7
|
+
function (_super) {
|
|
6
8
|
__extends(Circle, _super);
|
|
7
9
|
|
|
8
10
|
function Circle(_a) {
|
|
@@ -6,7 +6,9 @@ import { ElementEvent } from '../dom/interfaces';
|
|
|
6
6
|
* @see https://yuque.antfin-inc.com/antv/czqvg5/pgqipg
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
var CustomElement =
|
|
9
|
+
var CustomElement =
|
|
10
|
+
/** @class */
|
|
11
|
+
function (_super) {
|
|
10
12
|
__extends(CustomElement, _super); // private shadowNodes: DisplayObject[] = [];
|
|
11
13
|
|
|
12
14
|
|
|
@@ -39,18 +39,21 @@ var DEFAULT_STYLE_PROPS = {
|
|
|
39
39
|
* * attributeChanged
|
|
40
40
|
*/
|
|
41
41
|
|
|
42
|
-
var DisplayObject =
|
|
42
|
+
var DisplayObject =
|
|
43
|
+
/** @class */
|
|
44
|
+
function (_super) {
|
|
43
45
|
__extends(DisplayObject, _super);
|
|
44
46
|
|
|
45
47
|
function DisplayObject(config) {
|
|
48
|
+
var _this = this;
|
|
49
|
+
|
|
46
50
|
var _a, _b, _c;
|
|
47
51
|
|
|
48
|
-
|
|
52
|
+
_this = _super.call(this) || this;
|
|
49
53
|
/**
|
|
50
54
|
* push to active animations after calling `animate()`
|
|
51
55
|
*/
|
|
52
56
|
|
|
53
|
-
|
|
54
57
|
_this.activeAnimations = []; // assign name, id to config
|
|
55
58
|
// eg. group.get('name')
|
|
56
59
|
|
|
@@ -2,7 +2,9 @@ import { __assign, __extends, __rest } from "tslib";
|
|
|
2
2
|
import { Shape } from '../types';
|
|
3
3
|
import { DisplayObject } from './DisplayObject';
|
|
4
4
|
|
|
5
|
-
var Ellipse =
|
|
5
|
+
var Ellipse =
|
|
6
|
+
/** @class */
|
|
7
|
+
function (_super) {
|
|
6
8
|
__extends(Ellipse, _super);
|
|
7
9
|
|
|
8
10
|
function Ellipse(_a) {
|
|
@@ -2,7 +2,9 @@ import { __assign, __extends, __rest } from "tslib";
|
|
|
2
2
|
import { Shape } from '../types';
|
|
3
3
|
import { DisplayObject } from './DisplayObject';
|
|
4
4
|
|
|
5
|
-
var Group =
|
|
5
|
+
var Group =
|
|
6
|
+
/** @class */
|
|
7
|
+
function (_super) {
|
|
6
8
|
__extends(Group, _super);
|
|
7
9
|
|
|
8
10
|
function Group(_a) {
|
|
@@ -8,7 +8,9 @@ import { mat4, vec3 } from 'gl-matrix';
|
|
|
8
8
|
* @see https://github.com/pmndrs/drei#html
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
var HTML =
|
|
11
|
+
var HTML =
|
|
12
|
+
/** @class */
|
|
13
|
+
function (_super) {
|
|
12
14
|
__extends(HTML, _super);
|
|
13
15
|
|
|
14
16
|
function HTML(_a) {
|
|
@@ -16,10 +18,12 @@ var HTML = function (_super) {
|
|
|
16
18
|
_a = {};
|
|
17
19
|
}
|
|
18
20
|
|
|
21
|
+
var _this = this;
|
|
22
|
+
|
|
19
23
|
var style = _a.style,
|
|
20
24
|
rest = __rest(_a, ["style"]);
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
_this = _super.call(this, __assign({
|
|
23
27
|
type: Shape.HTML,
|
|
24
28
|
style: __assign({
|
|
25
29
|
innerHTML: '',
|
|
@@ -27,7 +31,6 @@ var HTML = function (_super) {
|
|
|
27
31
|
style: ''
|
|
28
32
|
}, style)
|
|
29
33
|
}, rest)) || this;
|
|
30
|
-
|
|
31
34
|
_this.cullable.enable = false;
|
|
32
35
|
return _this;
|
|
33
36
|
}
|
|
@@ -2,7 +2,9 @@ import { __assign, __extends, __rest } from "tslib";
|
|
|
2
2
|
import { Shape } from '../types';
|
|
3
3
|
import { DisplayObject } from './DisplayObject';
|
|
4
4
|
|
|
5
|
-
var Image =
|
|
5
|
+
var Image =
|
|
6
|
+
/** @class */
|
|
7
|
+
function (_super) {
|
|
6
8
|
__extends(Image, _super);
|
|
7
9
|
|
|
8
10
|
function Image(_a) {
|
|
@@ -4,7 +4,9 @@ import { Shape, LineCap, LineJoin } from '../types';
|
|
|
4
4
|
import { DisplayObject } from './DisplayObject';
|
|
5
5
|
import { Point } from '../shapes';
|
|
6
6
|
|
|
7
|
-
var Line =
|
|
7
|
+
var Line =
|
|
8
|
+
/** @class */
|
|
9
|
+
function (_super) {
|
|
8
10
|
__extends(Line, _super);
|
|
9
11
|
|
|
10
12
|
function Line(_a) {
|
|
@@ -5,7 +5,9 @@ import { Point } from '../shapes';
|
|
|
5
5
|
import { Cubic as CubicUtil } from '@antv/g-math';
|
|
6
6
|
import { isNil } from '@antv/util';
|
|
7
7
|
|
|
8
|
-
var Path =
|
|
8
|
+
var Path =
|
|
9
|
+
/** @class */
|
|
10
|
+
function (_super) {
|
|
9
11
|
__extends(Path, _super);
|
|
10
12
|
|
|
11
13
|
function Path(_a) {
|
|
@@ -2,7 +2,9 @@ import { __assign, __extends, __rest } from "tslib";
|
|
|
2
2
|
import { Shape } from '../types';
|
|
3
3
|
import { DisplayObject } from './DisplayObject';
|
|
4
4
|
|
|
5
|
-
var Polygon =
|
|
5
|
+
var Polygon =
|
|
6
|
+
/** @class */
|
|
7
|
+
function (_super) {
|
|
6
8
|
__extends(Polygon, _super);
|
|
7
9
|
|
|
8
10
|
function Polygon(_a) {
|
|
@@ -4,7 +4,9 @@ import { Shape, LineCap, LineJoin } from '../types';
|
|
|
4
4
|
import { DisplayObject } from './DisplayObject';
|
|
5
5
|
import { Point } from '../shapes';
|
|
6
6
|
|
|
7
|
-
var Polyline =
|
|
7
|
+
var Polyline =
|
|
8
|
+
/** @class */
|
|
9
|
+
function (_super) {
|
|
8
10
|
__extends(Polyline, _super);
|
|
9
11
|
|
|
10
12
|
function Polyline(_a) {
|
|
@@ -2,7 +2,9 @@ import { __assign, __extends, __rest } from "tslib";
|
|
|
2
2
|
import { Shape } from '../types';
|
|
3
3
|
import { DisplayObject } from './DisplayObject';
|
|
4
4
|
|
|
5
|
-
var Rect =
|
|
5
|
+
var Rect =
|
|
6
|
+
/** @class */
|
|
7
|
+
function (_super) {
|
|
6
8
|
__extends(Rect, _super);
|
|
7
9
|
|
|
8
10
|
function Rect(_a) {
|
|
@@ -5,7 +5,9 @@ import { DisplayObject } from './DisplayObject';
|
|
|
5
5
|
* <text> @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextElement
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
var Text =
|
|
8
|
+
var Text =
|
|
9
|
+
/** @class */
|
|
10
|
+
function (_super) {
|
|
9
11
|
__extends(Text, _super);
|
|
10
12
|
|
|
11
13
|
function Text(_a) {
|
|
@@ -13,10 +15,12 @@ var Text = function (_super) {
|
|
|
13
15
|
_a = {};
|
|
14
16
|
}
|
|
15
17
|
|
|
18
|
+
var _this = this;
|
|
19
|
+
|
|
16
20
|
var style = _a.style,
|
|
17
21
|
rest = __rest(_a, ["style"]);
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
_this = _super.call(this, __assign({
|
|
20
24
|
type: Shape.TEXT,
|
|
21
25
|
style: __assign({
|
|
22
26
|
text: '',
|
|
@@ -53,7 +57,6 @@ var Text = function (_super) {
|
|
|
53
57
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement#constants
|
|
54
58
|
*/
|
|
55
59
|
|
|
56
|
-
|
|
57
60
|
_this.LENGTHADJUST_SPACING = 1;
|
|
58
61
|
_this.LENGTHADJUST_SPACINGANDGLYPHS = 2;
|
|
59
62
|
_this.LENGTHADJUST_UNKNOWN = 0;
|
package/es/dom/Animation.js
CHANGED
|
@@ -4,7 +4,9 @@ var sequenceNumber = 0;
|
|
|
4
4
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/Animation
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
var Animation =
|
|
7
|
+
var Animation =
|
|
8
|
+
/** @class */
|
|
9
|
+
function () {
|
|
8
10
|
function Animation(effect, timeline) {
|
|
9
11
|
this.currentTimePending = false;
|
|
10
12
|
/**
|
|
@@ -21,7 +23,7 @@ var Animation = function () {
|
|
|
21
23
|
this.effect = effect;
|
|
22
24
|
effect.animation = this;
|
|
23
25
|
this.timeline = timeline;
|
|
24
|
-
this.id = ""
|
|
26
|
+
this.id = "".concat(sequenceNumber++);
|
|
25
27
|
this._inEffect = !!this.effect.update(0);
|
|
26
28
|
this._holdTime = 0;
|
|
27
29
|
this._paused = false;
|
|
@@ -3,7 +3,9 @@ import { linear, parseEasingFunction } from '../utils/animation';
|
|
|
3
3
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/EffectTiming
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
var AnimationEffectTiming =
|
|
6
|
+
var AnimationEffectTiming =
|
|
7
|
+
/** @class */
|
|
8
|
+
function () {
|
|
7
9
|
function AnimationEffectTiming() {
|
|
8
10
|
/**
|
|
9
11
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/EffectTiming/delay
|
package/es/dom/AnimationEvent.js
CHANGED
|
@@ -4,7 +4,9 @@ import { FederatedEvent } from './FederatedEvent';
|
|
|
4
4
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationPlaybackEvent
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
var AnimationEvent =
|
|
7
|
+
var AnimationEvent =
|
|
8
|
+
/** @class */
|
|
9
|
+
function (_super) {
|
|
8
10
|
__extends(AnimationEvent, _super);
|
|
9
11
|
|
|
10
12
|
function AnimationEvent(manager, target, currentTime, timelineTime) {
|
|
@@ -8,7 +8,9 @@ export function compareAnimations(leftAnimation, rightAnimation) {
|
|
|
8
8
|
* @see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/web-animations-js/index.d.ts
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
var AnimationTimeline =
|
|
11
|
+
var AnimationTimeline =
|
|
12
|
+
/** @class */
|
|
13
|
+
function () {
|
|
12
14
|
function AnimationTimeline() {
|
|
13
15
|
var _this = this;
|
|
14
16
|
/**
|
|
@@ -6,7 +6,9 @@ import { Ellipse, Circle, Rect, Image, Line, Path, Group, Polygon, Polyline, Tex
|
|
|
6
6
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
var CustomElementRegistry =
|
|
9
|
+
var CustomElementRegistry =
|
|
10
|
+
/** @class */
|
|
11
|
+
function () {
|
|
10
12
|
function CustomElementRegistry() {
|
|
11
13
|
this.registry = {};
|
|
12
14
|
this.define(Shape.CIRCLE, Circle);
|
package/es/dom/CustomEvent.js
CHANGED
|
@@ -13,7 +13,9 @@ import { FederatedEvent } from './FederatedEvent';
|
|
|
13
13
|
circle.dispatchEvent(event);
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
var CustomEvent =
|
|
16
|
+
var CustomEvent =
|
|
17
|
+
/** @class */
|
|
18
|
+
function (_super) {
|
|
17
19
|
__extends(CustomEvent, _super); // eslint-disable-next-line @typescript-eslint/ban-types
|
|
18
20
|
|
|
19
21
|
|
package/es/dom/Document.js
CHANGED
|
@@ -9,7 +9,9 @@ import { TextAlign } from '../types';
|
|
|
9
9
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
var Document =
|
|
12
|
+
var Document =
|
|
13
|
+
/** @class */
|
|
14
|
+
function (_super) {
|
|
13
15
|
__extends(Document, _super);
|
|
14
16
|
|
|
15
17
|
function Document() {
|
package/es/dom/Element.d.ts
CHANGED
|
@@ -46,6 +46,12 @@ export declare class Element<StyleProps extends BaseStyleProps = any, ParsedStyl
|
|
|
46
46
|
interactive: boolean;
|
|
47
47
|
scrollLeft: number;
|
|
48
48
|
scrollTop: number;
|
|
49
|
+
/**
|
|
50
|
+
* We don't support border now
|
|
51
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/clientTop
|
|
52
|
+
*/
|
|
53
|
+
clientTop: number;
|
|
54
|
+
clientLeft: number;
|
|
49
55
|
get tagName(): string;
|
|
50
56
|
get children(): IElement[];
|
|
51
57
|
get childElementCount(): number;
|
package/es/dom/Element.js
CHANGED
|
@@ -15,7 +15,9 @@ var entityCounter = 0;
|
|
|
15
15
|
* * Animation
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
var Element =
|
|
18
|
+
var Element =
|
|
19
|
+
/** @class */
|
|
20
|
+
function (_super) {
|
|
19
21
|
__extends(Element, _super);
|
|
20
22
|
|
|
21
23
|
function Element() {
|
|
@@ -35,6 +37,13 @@ var Element = function (_super) {
|
|
|
35
37
|
_this.namespaceURI = 'g';
|
|
36
38
|
_this.scrollLeft = 0;
|
|
37
39
|
_this.scrollTop = 0;
|
|
40
|
+
/**
|
|
41
|
+
* We don't support border now
|
|
42
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/clientTop
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
_this.clientTop = 0;
|
|
46
|
+
_this.clientLeft = 0;
|
|
38
47
|
/**
|
|
39
48
|
* is destroyed or not
|
|
40
49
|
*/
|
|
@@ -78,7 +87,9 @@ var Element = function (_super) {
|
|
|
78
87
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/classList
|
|
79
88
|
*/
|
|
80
89
|
get: function get() {
|
|
81
|
-
return this.className.split(' ')
|
|
90
|
+
return this.className.split(' ').filter(function (c) {
|
|
91
|
+
return c !== '';
|
|
92
|
+
});
|
|
82
93
|
},
|
|
83
94
|
enumerable: false,
|
|
84
95
|
configurable: true
|
|
@@ -238,15 +249,15 @@ var Element = function (_super) {
|
|
|
238
249
|
};
|
|
239
250
|
|
|
240
251
|
Element.prototype.getElementById = function (id) {
|
|
241
|
-
return this.sceneGraphService.querySelector("#"
|
|
252
|
+
return this.sceneGraphService.querySelector("#".concat(id), this);
|
|
242
253
|
};
|
|
243
254
|
|
|
244
255
|
Element.prototype.getElementsByName = function (name) {
|
|
245
|
-
return this.sceneGraphService.querySelectorAll("[name=\""
|
|
256
|
+
return this.sceneGraphService.querySelectorAll("[name=\"".concat(name, "\"]"), this);
|
|
246
257
|
};
|
|
247
258
|
|
|
248
259
|
Element.prototype.getElementsByClassName = function (className) {
|
|
249
|
-
return this.sceneGraphService.querySelectorAll("."
|
|
260
|
+
return this.sceneGraphService.querySelectorAll(".".concat(className), this);
|
|
250
261
|
};
|
|
251
262
|
|
|
252
263
|
Element.prototype.getElementsByTagName = function (tagName) {
|
package/es/dom/EventTarget.js
CHANGED
|
@@ -10,7 +10,9 @@ export var DELEGATION_SPLITTER = ':';
|
|
|
10
10
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
var EventTarget =
|
|
13
|
+
var EventTarget =
|
|
14
|
+
/** @class */
|
|
15
|
+
function () {
|
|
14
16
|
function EventTarget() {
|
|
15
17
|
/**
|
|
16
18
|
* event emitter
|
|
@@ -52,7 +54,7 @@ var EventTarget = function () {
|
|
|
52
54
|
useDelegatedName = true;
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
type = capture ? type
|
|
57
|
+
type = capture ? "".concat(type, "capture") : type;
|
|
56
58
|
listener = isFunction(listener) ? listener : listener.handleEvent; // compatible with G 3.0
|
|
57
59
|
|
|
58
60
|
if (useDelegatedName) {
|
|
@@ -108,7 +110,7 @@ var EventTarget = function () {
|
|
|
108
110
|
EventTarget.prototype.removeEventListener = function (type, listener, options) {
|
|
109
111
|
var capture = isBoolean(options) && options || isObject(options) && options.capture;
|
|
110
112
|
var context = isFunction(listener) ? undefined : listener;
|
|
111
|
-
type = capture ? type
|
|
113
|
+
type = capture ? "".concat(type, "capture") : type;
|
|
112
114
|
listener = isFunction(listener) ? listener : listener === null || listener === void 0 ? void 0 : listener.handleEvent;
|
|
113
115
|
this.emitter.off(type, listener, context);
|
|
114
116
|
return this;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Point } from '../shapes/Point';
|
|
2
2
|
import type { EventService } from '../services';
|
|
3
|
-
import type { IEventTarget
|
|
3
|
+
import type { IEventTarget } from './interfaces';
|
|
4
4
|
/**
|
|
5
5
|
* An DOM-compatible synthetic event implementation that is "forwarded" on behalf of an original
|
|
6
6
|
* FederatedEvent or native {@link https://dom.spec.whatwg.org/#event Event}.
|
|
@@ -130,7 +130,7 @@ export declare class FederatedEvent<N extends Event = Event, T = any> {
|
|
|
130
130
|
/**
|
|
131
131
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/view
|
|
132
132
|
*/
|
|
133
|
-
view:
|
|
133
|
+
view: any;
|
|
134
134
|
/**
|
|
135
135
|
* added for compatibility with DOM Event,
|
|
136
136
|
* deprecated props and methods
|
package/es/dom/FederatedEvent.js
CHANGED
|
@@ -4,7 +4,9 @@ import { Point } from '../shapes/Point';
|
|
|
4
4
|
* FederatedEvent or native {@link https://dom.spec.whatwg.org/#event Event}.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
var FederatedEvent =
|
|
7
|
+
var FederatedEvent =
|
|
8
|
+
/** @class */
|
|
9
|
+
function () {
|
|
8
10
|
/**
|
|
9
11
|
* The event boundary which manages this event. Propagation can only occur
|
|
10
12
|
* within the boundary's jurisdiction.
|
|
@@ -2,7 +2,9 @@ import { __extends } from "tslib";
|
|
|
2
2
|
import { FederatedEvent } from './FederatedEvent';
|
|
3
3
|
import { Point } from '../shapes/Point';
|
|
4
4
|
|
|
5
|
-
var FederatedMouseEvent =
|
|
5
|
+
var FederatedMouseEvent =
|
|
6
|
+
/** @class */
|
|
7
|
+
function (_super) {
|
|
6
8
|
__extends(FederatedMouseEvent, _super);
|
|
7
9
|
|
|
8
10
|
function FederatedMouseEvent() {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { __extends } from "tslib";
|
|
2
2
|
import { FederatedMouseEvent } from './FederatedMouseEvent';
|
|
3
3
|
|
|
4
|
-
var FederatedPointerEvent =
|
|
4
|
+
var FederatedPointerEvent =
|
|
5
|
+
/** @class */
|
|
6
|
+
function (_super) {
|
|
5
7
|
__extends(FederatedPointerEvent, _super);
|
|
6
8
|
|
|
7
9
|
function FederatedPointerEvent() {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { __extends } from "tslib";
|
|
2
2
|
import { FederatedMouseEvent } from './FederatedMouseEvent';
|
|
3
3
|
|
|
4
|
-
var FederatedWheelEvent =
|
|
4
|
+
var FederatedWheelEvent =
|
|
5
|
+
/** @class */
|
|
6
|
+
function (_super) {
|
|
5
7
|
__extends(FederatedWheelEvent, _super);
|
|
6
8
|
|
|
7
9
|
function FederatedWheelEvent() {
|
package/es/dom/KeyframeEffect.js
CHANGED
package/es/dom/KeyframeList.js
CHANGED
|
@@ -95,7 +95,7 @@ export function normalizeKeyframes(effectInput, timing) {
|
|
|
95
95
|
// TODO: Support add & accumulate in KeyframeEffect.composite
|
|
96
96
|
// @see https://developer.mozilla.org/en-US/docs/Web/API/KeyframeEffect/composite
|
|
97
97
|
if (['replace', 'add', 'accumulate', 'auto'].indexOf(memberValue) === -1) {
|
|
98
|
-
throw new Error(memberValue
|
|
98
|
+
throw new Error("".concat(memberValue, " compositing is not supported"));
|
|
99
99
|
}
|
|
100
100
|
} else if (member === 'easing') {// TODO: Validate animation-timing-function
|
|
101
101
|
// @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timing-function
|
package/es/dom/MutationEvent.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { __extends } from "tslib";
|
|
2
2
|
import { FederatedEvent } from './FederatedEvent';
|
|
3
3
|
|
|
4
|
-
var MutationEvent =
|
|
4
|
+
var MutationEvent =
|
|
5
|
+
/** @class */
|
|
6
|
+
function (_super) {
|
|
5
7
|
__extends(MutationEvent, _super);
|
|
6
8
|
|
|
7
9
|
function MutationEvent(typeArg, relatedNode, prevValue, newValue, attrName, attrChange, prevParsedValue, newParsedValue) {
|