@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/lib/dom/Element.js
CHANGED
|
@@ -31,7 +31,9 @@ var entityCounter = 0;
|
|
|
31
31
|
* * Animation
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
|
-
var Element =
|
|
34
|
+
var Element =
|
|
35
|
+
/** @class */
|
|
36
|
+
function (_super) {
|
|
35
37
|
(0, _tslib.__extends)(Element, _super);
|
|
36
38
|
|
|
37
39
|
function Element() {
|
|
@@ -51,6 +53,13 @@ var Element = function (_super) {
|
|
|
51
53
|
_this.namespaceURI = 'g';
|
|
52
54
|
_this.scrollLeft = 0;
|
|
53
55
|
_this.scrollTop = 0;
|
|
56
|
+
/**
|
|
57
|
+
* We don't support border now
|
|
58
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/clientTop
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
_this.clientTop = 0;
|
|
62
|
+
_this.clientLeft = 0;
|
|
54
63
|
/**
|
|
55
64
|
* is destroyed or not
|
|
56
65
|
*/
|
|
@@ -94,7 +103,9 @@ var Element = function (_super) {
|
|
|
94
103
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/classList
|
|
95
104
|
*/
|
|
96
105
|
get: function get() {
|
|
97
|
-
return this.className.split(' ')
|
|
106
|
+
return this.className.split(' ').filter(function (c) {
|
|
107
|
+
return c !== '';
|
|
108
|
+
});
|
|
98
109
|
},
|
|
99
110
|
enumerable: false,
|
|
100
111
|
configurable: true
|
|
@@ -254,15 +265,15 @@ var Element = function (_super) {
|
|
|
254
265
|
};
|
|
255
266
|
|
|
256
267
|
Element.prototype.getElementById = function (id) {
|
|
257
|
-
return this.sceneGraphService.querySelector("#"
|
|
268
|
+
return this.sceneGraphService.querySelector("#".concat(id), this);
|
|
258
269
|
};
|
|
259
270
|
|
|
260
271
|
Element.prototype.getElementsByName = function (name) {
|
|
261
|
-
return this.sceneGraphService.querySelectorAll("[name=\""
|
|
272
|
+
return this.sceneGraphService.querySelectorAll("[name=\"".concat(name, "\"]"), this);
|
|
262
273
|
};
|
|
263
274
|
|
|
264
275
|
Element.prototype.getElementsByClassName = function (className) {
|
|
265
|
-
return this.sceneGraphService.querySelectorAll("."
|
|
276
|
+
return this.sceneGraphService.querySelectorAll(".".concat(className), this);
|
|
266
277
|
};
|
|
267
278
|
|
|
268
279
|
Element.prototype.getElementsByTagName = function (tagName) {
|
package/lib/dom/EventTarget.js
CHANGED
|
@@ -24,7 +24,9 @@ var DELEGATION_SPLITTER = ':';
|
|
|
24
24
|
|
|
25
25
|
exports.DELEGATION_SPLITTER = DELEGATION_SPLITTER;
|
|
26
26
|
|
|
27
|
-
var EventTarget =
|
|
27
|
+
var EventTarget =
|
|
28
|
+
/** @class */
|
|
29
|
+
function () {
|
|
28
30
|
function EventTarget() {
|
|
29
31
|
/**
|
|
30
32
|
* event emitter
|
|
@@ -66,7 +68,7 @@ var EventTarget = function () {
|
|
|
66
68
|
useDelegatedName = true;
|
|
67
69
|
}
|
|
68
70
|
|
|
69
|
-
type = capture ? type
|
|
71
|
+
type = capture ? "".concat(type, "capture") : type;
|
|
70
72
|
listener = (0, _util.isFunction)(listener) ? listener : listener.handleEvent; // compatible with G 3.0
|
|
71
73
|
|
|
72
74
|
if (useDelegatedName) {
|
|
@@ -122,7 +124,7 @@ var EventTarget = function () {
|
|
|
122
124
|
EventTarget.prototype.removeEventListener = function (type, listener, options) {
|
|
123
125
|
var capture = (0, _util.isBoolean)(options) && options || (0, _util.isObject)(options) && options.capture;
|
|
124
126
|
var context = (0, _util.isFunction)(listener) ? undefined : listener;
|
|
125
|
-
type = capture ? type
|
|
127
|
+
type = capture ? "".concat(type, "capture") : type;
|
|
126
128
|
listener = (0, _util.isFunction)(listener) ? listener : listener === null || listener === void 0 ? void 0 : listener.handleEvent;
|
|
127
129
|
this.emitter.off(type, listener, context);
|
|
128
130
|
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
|
|
@@ -11,7 +11,9 @@ var _Point = require("../shapes/Point");
|
|
|
11
11
|
* An DOM-compatible synthetic event implementation that is "forwarded" on behalf of an original
|
|
12
12
|
* FederatedEvent or native {@link https://dom.spec.whatwg.org/#event Event}.
|
|
13
13
|
*/
|
|
14
|
-
var FederatedEvent =
|
|
14
|
+
var FederatedEvent =
|
|
15
|
+
/** @class */
|
|
16
|
+
function () {
|
|
15
17
|
/**
|
|
16
18
|
* The event boundary which manages this event. Propagation can only occur
|
|
17
19
|
* within the boundary's jurisdiction.
|
|
@@ -11,7 +11,9 @@ var _FederatedEvent = require("./FederatedEvent");
|
|
|
11
11
|
|
|
12
12
|
var _Point = require("../shapes/Point");
|
|
13
13
|
|
|
14
|
-
var FederatedMouseEvent =
|
|
14
|
+
var FederatedMouseEvent =
|
|
15
|
+
/** @class */
|
|
16
|
+
function (_super) {
|
|
15
17
|
(0, _tslib.__extends)(FederatedMouseEvent, _super);
|
|
16
18
|
|
|
17
19
|
function FederatedMouseEvent() {
|
|
@@ -9,7 +9,9 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _FederatedMouseEvent = require("./FederatedMouseEvent");
|
|
11
11
|
|
|
12
|
-
var FederatedPointerEvent =
|
|
12
|
+
var FederatedPointerEvent =
|
|
13
|
+
/** @class */
|
|
14
|
+
function (_super) {
|
|
13
15
|
(0, _tslib.__extends)(FederatedPointerEvent, _super);
|
|
14
16
|
|
|
15
17
|
function FederatedPointerEvent() {
|
|
@@ -9,7 +9,9 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _FederatedMouseEvent = require("./FederatedMouseEvent");
|
|
11
11
|
|
|
12
|
-
var FederatedWheelEvent =
|
|
12
|
+
var FederatedWheelEvent =
|
|
13
|
+
/** @class */
|
|
14
|
+
function (_super) {
|
|
13
15
|
(0, _tslib.__extends)(FederatedWheelEvent, _super);
|
|
14
16
|
|
|
15
17
|
function FederatedWheelEvent() {
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.KeyframeEffect = void 0;
|
|
6
7
|
exports.makeTiming = makeTiming;
|
|
7
8
|
exports.normalizeTimingInput = normalizeTimingInput;
|
|
8
9
|
exports.numericTimingToObject = numericTimingToObject;
|
|
9
|
-
exports.KeyframeEffect = void 0;
|
|
10
10
|
|
|
11
11
|
var _animation = require("../utils/animation");
|
|
12
12
|
|
|
@@ -92,7 +92,9 @@ function numericTimingToObject(timingInput) {
|
|
|
92
92
|
*/
|
|
93
93
|
|
|
94
94
|
|
|
95
|
-
var KeyframeEffect =
|
|
95
|
+
var KeyframeEffect =
|
|
96
|
+
/** @class */
|
|
97
|
+
function () {
|
|
96
98
|
function KeyframeEffect(target, effectInput, timingInput) {
|
|
97
99
|
var _this = this;
|
|
98
100
|
|
package/lib/dom/KeyframeList.js
CHANGED
|
@@ -102,7 +102,7 @@ function normalizeKeyframes(effectInput, timing) {
|
|
|
102
102
|
// TODO: Support add & accumulate in KeyframeEffect.composite
|
|
103
103
|
// @see https://developer.mozilla.org/en-US/docs/Web/API/KeyframeEffect/composite
|
|
104
104
|
if (['replace', 'add', 'accumulate', 'auto'].indexOf(memberValue) === -1) {
|
|
105
|
-
throw new Error(memberValue
|
|
105
|
+
throw new Error("".concat(memberValue, " compositing is not supported"));
|
|
106
106
|
}
|
|
107
107
|
} else if (member === 'easing') {// TODO: Validate animation-timing-function
|
|
108
108
|
// @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timing-function
|
package/lib/dom/MutationEvent.js
CHANGED
|
@@ -9,7 +9,9 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _FederatedEvent = require("./FederatedEvent");
|
|
11
11
|
|
|
12
|
-
var MutationEvent =
|
|
12
|
+
var MutationEvent =
|
|
13
|
+
/** @class */
|
|
14
|
+
function (_super) {
|
|
13
15
|
(0, _tslib.__extends)(MutationEvent, _super);
|
|
14
16
|
|
|
15
17
|
function MutationEvent(typeArg, relatedNode, prevValue, newValue, attrName, attrChange, prevParsedValue, newParsedValue) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.Registration = exports.MutationObserver = void 0;
|
|
7
7
|
|
|
8
8
|
require("setimmediate");
|
|
9
9
|
|
|
@@ -16,7 +16,9 @@ var _MutationRecord = require("./MutationRecord");
|
|
|
16
16
|
var uidCounter = 0;
|
|
17
17
|
var registrationsTable = new WeakMap();
|
|
18
18
|
|
|
19
|
-
var Registration =
|
|
19
|
+
var Registration =
|
|
20
|
+
/** @class */
|
|
21
|
+
function () {
|
|
20
22
|
function Registration(observer, target, options) {
|
|
21
23
|
this.observer = observer;
|
|
22
24
|
this.target = target;
|
|
@@ -206,7 +208,9 @@ exports.Registration = Registration;
|
|
|
206
208
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
|
|
207
209
|
* @see https://github.com/googlearchive/MutationObservers/blob/master/MutationObserver.js
|
|
208
210
|
*/
|
|
209
|
-
var MutationObserver =
|
|
211
|
+
var MutationObserver =
|
|
212
|
+
/** @class */
|
|
213
|
+
function () {
|
|
210
214
|
function MutationObserver(callback) {
|
|
211
215
|
this.callback = callback;
|
|
212
216
|
this.nodes = [];
|
|
@@ -216,7 +220,10 @@ var MutationObserver = function () {
|
|
|
216
220
|
|
|
217
221
|
MutationObserver.prototype.observe = function (target, options) {
|
|
218
222
|
// 1.1
|
|
219
|
-
if (!options.childList && !options.attributes && !options.characterData ||
|
|
223
|
+
if (!options.childList && !options.attributes && !options.characterData || // 1.2
|
|
224
|
+
options.attributeOldValue && !options.attributes || // 1.3
|
|
225
|
+
options.attributeFilter && options.attributeFilter.length && !options.attributes || // 1.4
|
|
226
|
+
options.characterDataOldValue && !options.characterData) {
|
|
220
227
|
throw new SyntaxError();
|
|
221
228
|
}
|
|
222
229
|
|
|
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.MutationRecord = void 0;
|
|
7
7
|
|
|
8
|
-
var MutationRecord =
|
|
8
|
+
var MutationRecord =
|
|
9
|
+
/** @class */
|
|
10
|
+
function () {
|
|
9
11
|
function MutationRecord(type, target) {
|
|
10
12
|
this.type = type;
|
|
11
13
|
this.target = target;
|
package/lib/dom/Node.js
CHANGED
|
@@ -16,7 +16,9 @@ var _EventTarget = require("./EventTarget");
|
|
|
16
16
|
/**
|
|
17
17
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Node
|
|
18
18
|
*/
|
|
19
|
-
var Node =
|
|
19
|
+
var Node =
|
|
20
|
+
/** @class */
|
|
21
|
+
function (_super) {
|
|
20
22
|
(0, _tslib.__extends)(Node, _super);
|
|
21
23
|
|
|
22
24
|
function Node() {
|
|
@@ -125,7 +127,7 @@ var Node = function (_super) {
|
|
|
125
127
|
|
|
126
128
|
if (this.nodeName === _.Shape.TEXT) {
|
|
127
129
|
// @ts-ignore
|
|
128
|
-
this.style.text = ""
|
|
130
|
+
this.style.text = "".concat(content);
|
|
129
131
|
} else {// this.appendChild(
|
|
130
132
|
// new Text({
|
|
131
133
|
// style: {
|
package/lib/dom/interfaces.d.ts
CHANGED
|
@@ -303,6 +303,8 @@ export interface IElement<StyleProps = any, ParsedStyleProps = any> extends INod
|
|
|
303
303
|
getElementsByTagName: <E extends IElement = IElement>(tagName: string) => E[];
|
|
304
304
|
scrollLeft: number;
|
|
305
305
|
scrollTop: number;
|
|
306
|
+
clientLeft: number;
|
|
307
|
+
clientTop: number;
|
|
306
308
|
/**
|
|
307
309
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute
|
|
308
310
|
*/
|
|
@@ -315,6 +317,7 @@ export interface IElement<StyleProps = any, ParsedStyleProps = any> extends INod
|
|
|
315
317
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute
|
|
316
318
|
*/
|
|
317
319
|
removeAttribute: (attributeName: keyof StyleProps) => void;
|
|
320
|
+
hasAttribute: (qualifiedName: string) => boolean;
|
|
318
321
|
}
|
|
319
322
|
export interface IDocument extends INode, IParentNode {
|
|
320
323
|
/**
|
package/lib/global-module.js
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.INHERIT_PROPERTIES = void 0;
|
|
7
7
|
exports.addPropertiesHandler = addPropertiesHandler;
|
|
8
|
-
exports.
|
|
8
|
+
exports.addPropertyHandler = addPropertyHandler;
|
|
9
|
+
exports.stylePropertyUpdaterFactory = exports.stylePropertyParserFactory = exports.stylePropertyMergerFactory = exports.globalContainer = exports.containerModule = void 0;
|
|
9
10
|
|
|
10
11
|
var _manaSyringe = require("mana-syringe");
|
|
11
12
|
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.CullingStrategyContribution = exports.CullingPlugin = void 0;
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
@@ -21,7 +21,9 @@ var CullingStrategyContribution = _manaSyringe.Syringe.defineToken('CullingStrat
|
|
|
21
21
|
|
|
22
22
|
exports.CullingStrategyContribution = CullingStrategyContribution;
|
|
23
23
|
|
|
24
|
-
var CullingPlugin =
|
|
24
|
+
var CullingPlugin =
|
|
25
|
+
/** @class */
|
|
26
|
+
function () {
|
|
25
27
|
function CullingPlugin() {}
|
|
26
28
|
|
|
27
29
|
CullingPlugin_1 = CullingPlugin;
|
|
@@ -18,7 +18,9 @@ var _RenderingContext = require("../services/RenderingContext");
|
|
|
18
18
|
/**
|
|
19
19
|
* Filter dirty renderables and calculate the "dirty rectangle" which will be clear when frame began
|
|
20
20
|
*/
|
|
21
|
-
var DirtyCheckPlugin =
|
|
21
|
+
var DirtyCheckPlugin =
|
|
22
|
+
/** @class */
|
|
23
|
+
function () {
|
|
22
24
|
function DirtyCheckPlugin() {}
|
|
23
25
|
|
|
24
26
|
DirtyCheckPlugin_1 = DirtyCheckPlugin;
|
|
@@ -22,10 +22,13 @@ var _ = require("..");
|
|
|
22
22
|
// group is not a 2d shape
|
|
23
23
|
var shape2D = [_.Shape.CIRCLE, _.Shape.ELLIPSE, _.Shape.IMAGE, _.Shape.RECT, _.Shape.LINE, _.Shape.POLYLINE, _.Shape.POLYGON, _.Shape.TEXT, _.Shape.PATH, _.Shape.HTML];
|
|
24
24
|
|
|
25
|
-
var FrustumCullingStrategy =
|
|
25
|
+
var FrustumCullingStrategy =
|
|
26
|
+
/** @class */
|
|
27
|
+
function () {
|
|
26
28
|
function FrustumCullingStrategy() {}
|
|
27
29
|
|
|
28
30
|
FrustumCullingStrategy.prototype.isVisible = function (object) {
|
|
31
|
+
// return true;
|
|
29
32
|
var _a, _b;
|
|
30
33
|
|
|
31
34
|
var cullable = object.cullable;
|
|
@@ -36,7 +39,7 @@ var FrustumCullingStrategy = function () {
|
|
|
36
39
|
|
|
37
40
|
var renderBounds = object.getRenderBounds();
|
|
38
41
|
|
|
39
|
-
if (
|
|
42
|
+
if (_shapes.AABB.isEmpty(renderBounds)) {
|
|
40
43
|
return false;
|
|
41
44
|
} // get VP matrix from camera
|
|
42
45
|
|
|
@@ -19,7 +19,9 @@ var _propertyHandlers = require("../property-handlers");
|
|
|
19
19
|
|
|
20
20
|
var _services = require("../services");
|
|
21
21
|
|
|
22
|
-
var PrepareRendererPlugin =
|
|
22
|
+
var PrepareRendererPlugin =
|
|
23
|
+
/** @class */
|
|
24
|
+
function () {
|
|
23
25
|
function PrepareRendererPlugin() {}
|
|
24
26
|
|
|
25
27
|
PrepareRendererPlugin_1 = PrepareRendererPlugin;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.parseColor = parseColor;
|
|
9
|
-
exports.mergeColors = mergeColors;
|
|
10
8
|
exports.PARSED_COLOR_TYPE = void 0;
|
|
9
|
+
exports.mergeColors = mergeColors;
|
|
10
|
+
exports.parseColor = parseColor;
|
|
11
11
|
|
|
12
12
|
var _tslib = require("tslib");
|
|
13
13
|
|
|
@@ -104,7 +104,7 @@ function parseColor(colorStr) {
|
|
|
104
104
|
return {
|
|
105
105
|
type: PARSED_COLOR_TYPE.Constant,
|
|
106
106
|
value: rgba,
|
|
107
|
-
formatted: color && "rgba("
|
|
107
|
+
formatted: color && "rgba(".concat(color.r, ",").concat(color.g, ",").concat(color.b, ",").concat(color.opacity, ")") || 'rgba(0,0,0,0)'
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -124,7 +124,7 @@ function mergeColors(left, right) {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
rgba[3] = (0, _util.clamp)(rgba[3], 0, 1);
|
|
127
|
-
return "rgba("
|
|
127
|
+
return "rgba(".concat(rgba.join(','), ")");
|
|
128
128
|
}];
|
|
129
129
|
}
|
|
130
130
|
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.convertAngleUnit = convertAngleUnit;
|
|
7
|
+
exports.convertPercentUnit = convertPercentUnit;
|
|
7
8
|
exports.mergeDimensions = mergeDimensions;
|
|
9
|
+
exports.parseAngle = void 0;
|
|
10
|
+
exports.parseDimension = parseDimension;
|
|
11
|
+
exports.parseLengthOrPercent = exports.parseLength = void 0;
|
|
8
12
|
exports.parseLengthOrPercentList = parseLengthOrPercentList;
|
|
9
|
-
exports.convertPercentUnit = convertPercentUnit;
|
|
10
|
-
exports.convertAngleUnit = convertAngleUnit;
|
|
11
|
-
exports.parseAngle = exports.parseLengthOrPercent = exports.parseLength = void 0;
|
|
12
13
|
|
|
13
14
|
var _numeric = require("./numeric");
|
|
14
15
|
|
|
@@ -29,7 +30,7 @@ function isAngleUnit(unit) {
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
function parseDimension(unitRegExp, string, object, name) {
|
|
32
|
-
string =
|
|
33
|
+
string = "".concat(string).trim().toLowerCase();
|
|
33
34
|
|
|
34
35
|
if (string === 'inherit') {
|
|
35
36
|
var computed = (0, _inherit.computeInheritStyleProperty)(object, name);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.StylePropertyUpdaterFactory = exports.StylePropertyUpdater = exports.StylePropertyParserFactory = exports.StylePropertyParser = exports.StylePropertyMergerFactory = exports.StylePropertyMerger = void 0;
|
|
7
7
|
var StylePropertyParser = 'StylePropertyParser';
|
|
8
8
|
exports.StylePropertyParser = StylePropertyParser;
|
|
9
9
|
var StylePropertyParserFactory = 'StylePropertyParserFactory';
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.numberToString = numberToString;
|
|
7
|
-
exports.parseNumber = parseNumber;
|
|
8
|
-
exports.mergeNumbers = mergeNumbers;
|
|
9
6
|
exports.clampedMergeNumbers = clampedMergeNumbers;
|
|
10
7
|
exports.mergeNumberLists = mergeNumberLists;
|
|
8
|
+
exports.mergeNumbers = mergeNumbers;
|
|
9
|
+
exports.numberToString = numberToString;
|
|
10
|
+
exports.parseNumber = parseNumber;
|
|
11
11
|
|
|
12
12
|
var _util = require("@antv/util");
|
|
13
13
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { PathCommand } from '../types';
|
|
2
2
|
import type { ParsedPathStyleProps } from '../display-objects';
|
|
3
3
|
export declare function parsePath(path: string): ParsedPathStyleProps;
|
|
4
|
-
export declare function mergePaths(left: ParsedPathStyleProps, right: ParsedPathStyleProps): ((string[] | ["a" | "A", number, number, number, number, number, number, number] | ["C" | "c", number, number, number, number, number, number] | ["o" | "O", number, number] | ["h" | "H", number] | ["l" | "L", number, number] | ["m" | "M", number, number] | ["r" | "R", number, number, number, number] | ["
|
|
4
|
+
export declare function mergePaths(left: ParsedPathStyleProps, right: ParsedPathStyleProps): ((string[] | ["a" | "A", number, number, number, number, number, number, number] | ["C" | "c", number, number, number, number, number, number] | ["o" | "O", number, number] | ["h" | "H", number] | ["l" | "L", number, number] | ["m" | "M", number, number] | ["r" | "R", number, number, number, number] | ["q" | "Q", number, number, number, number] | ["s" | "S", number, number, number, number, number, number, number] | ["t" | "T", number, number] | ["v" | "V", number] | ["u" | "U", number, number, number])[] | ((pathArray: PathCommand[]) => PathCommand[]))[];
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.parseTransform = parseTransform;
|
|
7
6
|
exports.mergeTransforms = mergeTransforms;
|
|
7
|
+
exports.parseTransform = parseTransform;
|
|
8
8
|
exports.updateTransform = updateTransform;
|
|
9
9
|
|
|
10
10
|
var _tslib = require("tslib");
|
|
@@ -33,7 +33,9 @@ var _glMatrix = require("gl-matrix");
|
|
|
33
33
|
|
|
34
34
|
var PROPAGATION_LIMIT = 2048;
|
|
35
35
|
|
|
36
|
-
var EventService =
|
|
36
|
+
var EventService =
|
|
37
|
+
/** @class */
|
|
38
|
+
function (_super) {
|
|
37
39
|
(0, _tslib.__extends)(EventService, _super);
|
|
38
40
|
|
|
39
41
|
function EventService() {
|
|
@@ -495,6 +497,12 @@ var EventService = function (_super) {
|
|
|
495
497
|
}
|
|
496
498
|
|
|
497
499
|
EventService.prototype.init = function () {
|
|
500
|
+
// this.onPointerDown = this.onPointerDown.bind(this);
|
|
501
|
+
// this.onPointerMove = this.onPointerUp.bind(this);
|
|
502
|
+
// this.onPointerMove = this.onPointerMove.bind(this);
|
|
503
|
+
// this.onPointerUp = this.onPointerUp.bind(this);
|
|
504
|
+
// this.onPointerOut = this.onPointerOut.bind(this);
|
|
505
|
+
// this.onWheel = this.onWheel.bind(this);
|
|
498
506
|
this.rootTarget = this.renderingContext.root.parentNode; // document
|
|
499
507
|
|
|
500
508
|
this.addEventMapping('pointerdown', this.onPointerDown);
|
|
@@ -587,7 +595,7 @@ var EventService = function (_super) {
|
|
|
587
595
|
mappers[i].fn(e);
|
|
588
596
|
}
|
|
589
597
|
} else {
|
|
590
|
-
console.warn("[EventService]: Event mapping not defined for "
|
|
598
|
+
console.warn("[EventService]: Event mapping not defined for ".concat(e.type));
|
|
591
599
|
}
|
|
592
600
|
};
|
|
593
601
|
|
|
@@ -877,7 +885,7 @@ var EventService = function (_super) {
|
|
|
877
885
|
|
|
878
886
|
EventService.prototype.notifyTarget = function (e, type) {
|
|
879
887
|
type = type !== null && type !== void 0 ? type : e.type;
|
|
880
|
-
var key = e.eventPhase === e.CAPTURING_PHASE || e.eventPhase === e.AT_TARGET ? type
|
|
888
|
+
var key = e.eventPhase === e.CAPTURING_PHASE || e.eventPhase === e.AT_TARGET ? "".concat(type, "capture") : type;
|
|
881
889
|
this.notifyListeners(e, key);
|
|
882
890
|
|
|
883
891
|
if (e.eventPhase === e.AT_TARGET) {
|
|
@@ -897,14 +905,14 @@ var EventService = function (_super) {
|
|
|
897
905
|
emitter.removeListener(type, listeners.fn, undefined, true);
|
|
898
906
|
}
|
|
899
907
|
|
|
900
|
-
listeners.fn.call(listeners.context, e);
|
|
908
|
+
listeners.fn.call(e.currentTarget || listeners.context, e); // listeners.fn.call(listeners.context, e);
|
|
901
909
|
} else {
|
|
902
910
|
for (var i = 0; i < listeners.length && !e.propagationImmediatelyStopped; i++) {
|
|
903
911
|
if (listeners[i].once) {
|
|
904
912
|
emitter.removeListener(type, listeners[i].fn, undefined, true);
|
|
905
913
|
}
|
|
906
914
|
|
|
907
|
-
listeners[i].fn.call(listeners[i].context, e);
|
|
915
|
+
listeners[i].fn.call(e.currentTarget || listeners[i].context, e); // listeners[i].fn.call(listeners[i].context, e);
|
|
908
916
|
}
|
|
909
917
|
}
|
|
910
918
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Syringe } from 'mana-syringe';
|
|
2
2
|
import { SyncHook, SyncWaterfallHook, AsyncParallelHook, AsyncSeriesWaterfallHook } from 'tapable';
|
|
3
|
-
import type { DisplayObject } from '..';
|
|
3
|
+
import type { CanvasConfig, DisplayObject } from '..';
|
|
4
4
|
import type { EventPosition, InteractivePointerEvent } from '../types';
|
|
5
5
|
export interface RenderingPlugin {
|
|
6
6
|
apply: (renderer: RenderingService) => void;
|
|
@@ -48,10 +48,20 @@ export declare class RenderingService {
|
|
|
48
48
|
};
|
|
49
49
|
init(): Promise<void>;
|
|
50
50
|
getStats(): {
|
|
51
|
+
/**
|
|
52
|
+
* total display objects in scenegraph
|
|
53
|
+
*/
|
|
51
54
|
total: number;
|
|
55
|
+
/**
|
|
56
|
+
* number of display objects need to render in current frame
|
|
57
|
+
*/
|
|
52
58
|
rendered: number;
|
|
59
|
+
/**
|
|
60
|
+
* number of display objects displayed on screen
|
|
61
|
+
*/
|
|
62
|
+
renderedOnscreen: number;
|
|
53
63
|
};
|
|
54
|
-
render(): void;
|
|
64
|
+
render(canvasConfig: Partial<CanvasConfig>): void;
|
|
55
65
|
private renderDisplayObject;
|
|
56
66
|
destroy(): void;
|
|
57
67
|
dirtify(): void;
|