@antv/g 5.0.22-alpha.5 → 5.0.23-alpha.0
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 +30 -0
- package/es/AbstractRenderer.js +8 -1
- package/es/Canvas.d.ts +1 -1
- package/es/Canvas.js +5 -3
- package/es/DisplayObjectPool.js +3 -1
- package/es/camera/Camera.d.ts +105 -66
- package/es/camera/Camera.js +306 -170
- package/es/camera/Landmark.d.ts +18 -25
- package/es/camera/Landmark.js +1 -72
- package/es/canvas-module.js +2 -4
- 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/css/LayoutRegistry.js +3 -1
- package/es/css/StyleValueRegistry.d.ts +8 -0
- package/es/css/StyleValueRegistry.js +24 -19
- package/es/css/cssom/CSSColorValue.js +3 -1
- package/es/css/cssom/CSSGradientValue.js +8 -6
- package/es/css/cssom/CSSKeywordValue.js +3 -1
- package/es/css/cssom/CSSMathInvert.js +3 -1
- package/es/css/cssom/CSSMathMax.js +3 -1
- package/es/css/cssom/CSSMathMin.js +3 -1
- package/es/css/cssom/CSSMathNegate.js +3 -1
- package/es/css/cssom/CSSMathProduct.js +3 -1
- package/es/css/cssom/CSSMathSum.js +3 -1
- package/es/css/cssom/CSSMathValue.js +3 -1
- package/es/css/cssom/CSSMathVariadic.js +3 -1
- package/es/css/cssom/CSSNumericValue.js +3 -1
- package/es/css/cssom/CSSNumericValueType.d.ts +1 -1
- package/es/css/cssom/CSSNumericValueType.js +3 -1
- package/es/css/cssom/CSSRGB.js +4 -2
- package/es/css/cssom/CSSStyleValue.d.ts +1 -1
- package/es/css/cssom/CSSStyleValue.js +3 -1
- package/es/css/cssom/CSSTransformComponent.js +3 -1
- package/es/css/cssom/CSSTransformValue.js +3 -1
- package/es/css/cssom/CSSTranslate.js +3 -1
- package/es/css/cssom/CSSUnitValue.js +4 -2
- package/es/css/parser/color.js +2 -2
- package/es/css/parser/dimension.d.ts +1 -1
- package/es/css/parser/dimension.js +2 -3
- package/es/css/parser/numeric.js +1 -1
- package/es/css/parser/path.d.ts +2 -2
- package/es/css/parser/path.js +1 -1
- package/es/css/parser/points.js +1 -1
- package/es/css/parser/transform-origin.js +1 -1
- package/es/css/properties/CSSPropertyAnchor.js +3 -1
- package/es/css/properties/CSSPropertyClipPath.js +3 -1
- package/es/css/properties/CSSPropertyColor.js +3 -1
- package/es/css/properties/CSSPropertyFilter.js +3 -1
- package/es/css/properties/CSSPropertyLengthOrPercentage.js +3 -1
- package/es/css/properties/CSSPropertyLineDash.js +3 -1
- package/es/css/properties/CSSPropertyLocalPosition.js +3 -1
- package/es/css/properties/CSSPropertyOffsetDistance.js +3 -1
- package/es/css/properties/CSSPropertyOffsetPath.js +3 -1
- package/es/css/properties/CSSPropertyOpacity.js +3 -1
- package/es/css/properties/CSSPropertyPath.d.ts +14 -2
- package/es/css/properties/CSSPropertyPath.js +3 -1
- package/es/css/properties/CSSPropertyPoints.js +3 -1
- package/es/css/properties/CSSPropertyShadowBlur.js +3 -1
- package/es/css/properties/CSSPropertyText.d.ts +1 -1
- package/es/css/properties/CSSPropertyText.js +4 -2
- package/es/css/properties/CSSPropertyTextTransform.d.ts +3 -3
- package/es/css/properties/CSSPropertyTextTransform.js +3 -1
- package/es/css/properties/CSSPropertyTransform.js +4 -3
- package/es/css/properties/CSSPropertyTransformOrigin.js +3 -1
- package/es/css/properties/CSSPropertyVisibility.js +3 -1
- package/es/css/properties/CSSPropertyZIndex.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 +10 -8
- 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.d.ts +15 -15
- package/es/display-objects/Path.js +5 -3
- package/es/display-objects/Polygon.d.ts +8 -1
- package/es/display-objects/Polygon.js +3 -1
- package/es/display-objects/Polyline.d.ts +7 -5
- 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 +5 -3
- package/es/dom/Element.js +7 -6
- package/es/dom/EventTarget.js +6 -4
- package/es/dom/FederatedEvent.js +3 -1
- package/es/dom/FederatedMouseEvent.js +3 -1
- package/es/dom/FederatedPointerEvent.js +3 -1
- package/es/dom/FederatedTouchEvent.d.ts +15 -0
- package/es/dom/FederatedTouchEvent.js +19 -0
- 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/plugins/CullingPlugin.d.ts +0 -1
- package/es/plugins/CullingPlugin.js +6 -9
- package/es/plugins/DirtyCheckPlugin.d.ts +1 -1
- package/es/plugins/DirtyCheckPlugin.js +12 -9
- package/es/plugins/EventPlugin.d.ts +1 -1
- package/es/plugins/EventPlugin.js +166 -149
- package/es/plugins/FrustumCullingStrategy.js +3 -1
- package/es/plugins/PrepareRendererPlugin.d.ts +0 -1
- package/es/plugins/PrepareRendererPlugin.js +18 -17
- package/es/services/EventService.d.ts +8 -0
- package/es/services/EventService.js +279 -23
- package/es/services/OffscreenCanvasCreator.js +3 -1
- package/es/services/RenderingService.d.ts +17 -16
- package/es/services/RenderingService.js +21 -18
- package/es/services/SceneGraphSelector.js +3 -1
- package/es/services/SceneGraphService.js +4 -2
- package/es/services/TextService.js +5 -3
- 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.d.ts +3 -3
- package/es/services/aabb/PathUpdater.js +3 -1
- package/es/services/aabb/PolylineUpdater.d.ts +3 -3
- package/es/services/aabb/PolylineUpdater.js +3 -1
- package/es/services/aabb/RectUpdater.js +4 -2
- package/es/services/aabb/TextUpdater.js +3 -1
- package/es/shapes/AABB.js +3 -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/Ray.js +3 -1
- package/es/shapes/Rectangle.js +3 -1
- package/es/types.d.ts +9 -3
- package/es/utils/assert.d.ts +6 -0
- package/es/utils/assert.js +18 -0
- package/es/utils/custom-easing.js +1 -1
- package/es/utils/event.d.ts +18 -16
- package/es/utils/hooks.d.ts +280 -0
- package/es/utils/hooks.js +753 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +2 -1
- package/es/utils/math.d.ts +2 -2
- package/es/utils/math.js +22 -6
- package/es/utils/path.d.ts +1 -1
- package/es/utils/path.js +3 -3
- package/es/utils/string.d.ts +1 -0
- package/es/utils/string.js +8 -0
- package/es/utils/text.js +5 -4
- package/lib/AbstractRenderer.js +8 -1
- package/lib/Canvas.d.ts +1 -1
- package/lib/Canvas.js +5 -3
- package/lib/DisplayObjectPool.js +3 -1
- package/lib/camera/Camera.d.ts +105 -66
- package/lib/camera/Camera.js +313 -178
- package/lib/camera/Landmark.d.ts +18 -25
- package/lib/camera/Landmark.js +1 -75
- package/lib/canvas-module.js +1 -3
- 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/css/LayoutRegistry.js +3 -1
- package/lib/css/StyleValueRegistry.d.ts +8 -0
- package/lib/css/StyleValueRegistry.js +27 -20
- package/lib/css/cssom/CSSColorValue.js +3 -1
- package/lib/css/cssom/CSSGradientValue.js +9 -7
- package/lib/css/cssom/CSSKeywordValue.js +3 -1
- package/lib/css/cssom/CSSMathInvert.js +3 -1
- package/lib/css/cssom/CSSMathMax.js +3 -1
- package/lib/css/cssom/CSSMathMin.js +3 -1
- package/lib/css/cssom/CSSMathNegate.js +3 -1
- package/lib/css/cssom/CSSMathOperator.js +1 -1
- package/lib/css/cssom/CSSMathProduct.js +3 -1
- package/lib/css/cssom/CSSMathSum.js +3 -1
- package/lib/css/cssom/CSSMathValue.js +3 -1
- package/lib/css/cssom/CSSMathVariadic.js +4 -2
- package/lib/css/cssom/CSSNumericValue.js +3 -1
- package/lib/css/cssom/CSSNumericValueType.d.ts +1 -1
- package/lib/css/cssom/CSSNumericValueType.js +5 -3
- package/lib/css/cssom/CSSRGB.js +4 -2
- package/lib/css/cssom/CSSStyleValue.d.ts +1 -1
- package/lib/css/cssom/CSSStyleValue.js +4 -2
- package/lib/css/cssom/CSSTransformComponent.js +4 -2
- package/lib/css/cssom/CSSTransformValue.js +3 -1
- package/lib/css/cssom/CSSTranslate.js +3 -1
- package/lib/css/cssom/CSSUnitValue.js +4 -2
- package/lib/css/cssom/types.js +1 -1
- package/lib/css/parser/color.js +8 -8
- package/lib/css/parser/dimension.d.ts +1 -1
- package/lib/css/parser/dimension.js +8 -9
- package/lib/css/parser/numeric.js +6 -6
- package/lib/css/parser/path.d.ts +2 -2
- package/lib/css/parser/path.js +5 -5
- package/lib/css/parser/points.js +2 -2
- package/lib/css/parser/transform-origin.js +2 -2
- package/lib/css/parser/transform.js +2 -2
- package/lib/css/properties/CSSPropertyAnchor.js +3 -1
- package/lib/css/properties/CSSPropertyClipPath.js +3 -1
- package/lib/css/properties/CSSPropertyColor.js +3 -1
- package/lib/css/properties/CSSPropertyFilter.js +3 -1
- package/lib/css/properties/CSSPropertyLengthOrPercentage.js +3 -1
- package/lib/css/properties/CSSPropertyLineDash.js +3 -1
- package/lib/css/properties/CSSPropertyLocalPosition.js +3 -1
- package/lib/css/properties/CSSPropertyOffsetDistance.js +3 -1
- package/lib/css/properties/CSSPropertyOffsetPath.js +3 -1
- package/lib/css/properties/CSSPropertyOpacity.js +3 -1
- package/lib/css/properties/CSSPropertyPath.d.ts +14 -2
- package/lib/css/properties/CSSPropertyPath.js +3 -1
- package/lib/css/properties/CSSPropertyPoints.js +3 -1
- package/lib/css/properties/CSSPropertyShadowBlur.js +3 -1
- package/lib/css/properties/CSSPropertyText.d.ts +1 -1
- package/lib/css/properties/CSSPropertyText.js +4 -2
- package/lib/css/properties/CSSPropertyTextTransform.d.ts +3 -3
- package/lib/css/properties/CSSPropertyTextTransform.js +3 -1
- package/lib/css/properties/CSSPropertyTransform.js +3 -3
- package/lib/css/properties/CSSPropertyTransformOrigin.js +3 -1
- package/lib/css/properties/CSSPropertyVisibility.js +3 -1
- package/lib/css/properties/CSSPropertyZIndex.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 +13 -12
- 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.d.ts +15 -15
- package/lib/display-objects/Path.js +7 -5
- package/lib/display-objects/Polygon.d.ts +8 -1
- package/lib/display-objects/Polygon.js +3 -1
- package/lib/display-objects/Polyline.d.ts +7 -5
- 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 +5 -3
- package/lib/dom/Element.js +7 -7
- package/lib/dom/EventTarget.js +14 -12
- package/lib/dom/FederatedEvent.js +3 -1
- package/lib/dom/FederatedMouseEvent.js +3 -1
- package/lib/dom/FederatedPointerEvent.js +3 -1
- package/lib/dom/FederatedTouchEvent.d.ts +15 -0
- package/lib/dom/FederatedTouchEvent.js +27 -0
- 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/index.js +1 -1
- package/lib/plugins/CullingPlugin.d.ts +0 -1
- package/lib/plugins/CullingPlugin.js +7 -9
- package/lib/plugins/DirtyCheckPlugin.d.ts +1 -1
- package/lib/plugins/DirtyCheckPlugin.js +13 -9
- package/lib/plugins/EventPlugin.d.ts +1 -1
- package/lib/plugins/EventPlugin.js +175 -157
- package/lib/plugins/FrustumCullingStrategy.js +3 -1
- package/lib/plugins/PrepareRendererPlugin.d.ts +0 -1
- package/lib/plugins/PrepareRendererPlugin.js +17 -15
- package/lib/services/EventService.d.ts +8 -0
- package/lib/services/EventService.js +279 -22
- package/lib/services/OffscreenCanvasCreator.js +3 -1
- package/lib/services/RenderingService.d.ts +17 -16
- package/lib/services/RenderingService.js +22 -19
- package/lib/services/SceneGraphSelector.js +4 -2
- package/lib/services/SceneGraphService.js +8 -6
- package/lib/services/TextService.js +5 -3
- 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.d.ts +3 -3
- package/lib/services/aabb/PathUpdater.js +3 -1
- package/lib/services/aabb/PolylineUpdater.d.ts +3 -3
- package/lib/services/aabb/PolylineUpdater.js +3 -1
- package/lib/services/aabb/RectUpdater.js +6 -4
- package/lib/services/aabb/TextUpdater.js +3 -1
- package/lib/services/aabb/index.js +10 -10
- package/lib/services/aabb/interfaces.js +1 -1
- package/lib/shapes/AABB.js +3 -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/Ray.js +3 -1
- package/lib/shapes/Rectangle.js +3 -1
- package/lib/types.d.ts +9 -3
- package/lib/types.js +1 -1
- package/lib/utils/animation.js +3 -2
- package/lib/utils/assert.d.ts +6 -0
- package/lib/utils/assert.js +30 -0
- package/lib/utils/bezier-easing.js +1 -1
- package/lib/utils/custom-easing.js +2 -2
- package/lib/utils/event.d.ts +18 -16
- package/lib/utils/hooks.d.ts +280 -0
- package/lib/utils/hooks.js +759 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +13 -0
- package/lib/utils/math.d.ts +2 -2
- package/lib/utils/math.js +34 -18
- package/lib/utils/path.d.ts +1 -1
- package/lib/utils/path.js +6 -6
- package/lib/utils/string.d.ts +1 -0
- package/lib/utils/string.js +11 -0
- package/lib/utils/text.js +7 -5
- package/package.json +5 -6
|
@@ -4,7 +4,9 @@ import { Shape } 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: '',
|
|
@@ -52,7 +56,6 @@ var Text = function (_super) {
|
|
|
52
56
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement#constants
|
|
53
57
|
*/
|
|
54
58
|
|
|
55
|
-
|
|
56
59
|
_this.LENGTHADJUST_SPACING = 1;
|
|
57
60
|
_this.LENGTHADJUST_SPACINGANDGLYPHS = 2;
|
|
58
61
|
_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) {
|
|
@@ -7,7 +7,9 @@ export function compareAnimations(leftAnimation, rightAnimation) {
|
|
|
7
7
|
* @see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/web-animations-js/index.d.ts
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
var AnimationTimeline =
|
|
10
|
+
var AnimationTimeline =
|
|
11
|
+
/** @class */
|
|
12
|
+
function () {
|
|
11
13
|
function AnimationTimeline(document) {
|
|
12
14
|
var _this = this;
|
|
13
15
|
|
|
@@ -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 { BUILT_IN_PROPERTIES } from '../css';
|
|
|
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() {
|
|
@@ -144,7 +146,7 @@ var Document = function (_super) {
|
|
|
144
146
|
}), clientX = _c.x, clientY = _c.y;
|
|
145
147
|
return [4
|
|
146
148
|
/*yield*/
|
|
147
|
-
, this.defaultView.getRenderingService().hooks.pick.
|
|
149
|
+
, this.defaultView.getRenderingService().hooks.pick.callPromise({
|
|
148
150
|
topmost: true,
|
|
149
151
|
position: {
|
|
150
152
|
x: x,
|
|
@@ -198,7 +200,7 @@ var Document = function (_super) {
|
|
|
198
200
|
}), clientX = _c.x, clientY = _c.y;
|
|
199
201
|
return [4
|
|
200
202
|
/*yield*/
|
|
201
|
-
, this.defaultView.getRenderingService().hooks.pick.
|
|
203
|
+
, this.defaultView.getRenderingService().hooks.pick.callPromise({
|
|
202
204
|
topmost: false,
|
|
203
205
|
position: {
|
|
204
206
|
x: x,
|
package/es/dom/Element.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { __extends, __read, __spreadArray } from "tslib";
|
|
2
2
|
import { GlobalContainer } from 'mana-syringe';
|
|
3
|
-
import { isNil } from '@antv/util';
|
|
4
3
|
import { SceneGraphService } from '../services/SceneGraphService';
|
|
5
4
|
import { Cullable, Geometry, Renderable, Transform, Sortable } from '../components';
|
|
6
5
|
import { Node } from './Node';
|
|
7
6
|
import { ElementEvent } from './interfaces';
|
|
8
|
-
import { formatAttribute } from '../utils';
|
|
7
|
+
import { formatAttribute, isNil } from '../utils';
|
|
9
8
|
import { MutationEvent } from './MutationEvent';
|
|
10
9
|
var entityCounter = 0;
|
|
11
10
|
/**
|
|
@@ -15,7 +14,9 @@ var entityCounter = 0;
|
|
|
15
14
|
* * Animation
|
|
16
15
|
*/
|
|
17
16
|
|
|
18
|
-
var Element =
|
|
17
|
+
var Element =
|
|
18
|
+
/** @class */
|
|
19
|
+
function (_super) {
|
|
19
20
|
__extends(Element, _super);
|
|
20
21
|
|
|
21
22
|
function Element() {
|
|
@@ -248,15 +249,15 @@ var Element = function (_super) {
|
|
|
248
249
|
};
|
|
249
250
|
|
|
250
251
|
Element.prototype.getElementById = function (id) {
|
|
251
|
-
return this.sceneGraphService.querySelector("#"
|
|
252
|
+
return this.sceneGraphService.querySelector("#".concat(id), this);
|
|
252
253
|
};
|
|
253
254
|
|
|
254
255
|
Element.prototype.getElementsByName = function (name) {
|
|
255
|
-
return this.sceneGraphService.querySelectorAll("[name=\""
|
|
256
|
+
return this.sceneGraphService.querySelectorAll("[name=\"".concat(name, "\"]"), this);
|
|
256
257
|
};
|
|
257
258
|
|
|
258
259
|
Element.prototype.getElementsByClassName = function (className) {
|
|
259
|
-
return this.sceneGraphService.querySelectorAll("."
|
|
260
|
+
return this.sceneGraphService.querySelectorAll(".".concat(className), this);
|
|
260
261
|
};
|
|
261
262
|
|
|
262
263
|
Element.prototype.getElementsByTagName = function (tagName) {
|
package/es/dom/EventTarget.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __read, __spreadArray } from "tslib";
|
|
2
|
-
import { isBoolean, isFunction, isObject } from '@antv/util';
|
|
3
2
|
import { EventEmitter } from 'eventemitter3';
|
|
4
3
|
import { CustomEvent } from './CustomEvent';
|
|
5
4
|
import { FederatedEvent } from './FederatedEvent';
|
|
5
|
+
import { isFunction, isBoolean, isObject } from '../utils';
|
|
6
6
|
export var DELEGATION_SPLITTER = ':';
|
|
7
7
|
/**
|
|
8
8
|
* Objects that can receive events and may have listeners for them.
|
|
@@ -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;
|
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() {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FormattedTouch } from '../utils';
|
|
2
|
+
import { FederatedEvent } from './FederatedEvent';
|
|
3
|
+
/**
|
|
4
|
+
* @see https://w3c.github.io/touch-events/#touchevent-interface
|
|
5
|
+
*/
|
|
6
|
+
export declare class FederatedTouchEvent extends FederatedEvent<MouseEvent | PointerEvent | TouchEvent> implements TouchEvent {
|
|
7
|
+
pointerType: string;
|
|
8
|
+
altKey: boolean;
|
|
9
|
+
ctrlKey: boolean;
|
|
10
|
+
metaKey: boolean;
|
|
11
|
+
shiftKey: boolean;
|
|
12
|
+
changedTouches: FormattedTouch[];
|
|
13
|
+
targetTouches: FormattedTouch[];
|
|
14
|
+
touches: FormattedTouch[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { FederatedEvent } from './FederatedEvent';
|
|
3
|
+
/**
|
|
4
|
+
* @see https://w3c.github.io/touch-events/#touchevent-interface
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var FederatedTouchEvent =
|
|
8
|
+
/** @class */
|
|
9
|
+
function (_super) {
|
|
10
|
+
__extends(FederatedTouchEvent, _super);
|
|
11
|
+
|
|
12
|
+
function FederatedTouchEvent() {
|
|
13
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return FederatedTouchEvent;
|
|
17
|
+
}(FederatedEvent);
|
|
18
|
+
|
|
19
|
+
export { FederatedTouchEvent };
|
|
@@ -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) {
|
|
@@ -4,7 +4,9 @@ import { MutationRecord } from './MutationRecord';
|
|
|
4
4
|
var uidCounter = 0;
|
|
5
5
|
var registrationsTable = new WeakMap();
|
|
6
6
|
|
|
7
|
-
var Registration =
|
|
7
|
+
var Registration =
|
|
8
|
+
/** @class */
|
|
9
|
+
function () {
|
|
8
10
|
function Registration(observer, target, options) {
|
|
9
11
|
this.observer = observer;
|
|
10
12
|
this.target = target;
|
|
@@ -194,7 +196,9 @@ export { Registration };
|
|
|
194
196
|
* @see https://github.com/googlearchive/MutationObservers/blob/master/MutationObserver.js
|
|
195
197
|
*/
|
|
196
198
|
|
|
197
|
-
var MutationObserver =
|
|
199
|
+
var MutationObserver =
|
|
200
|
+
/** @class */
|
|
201
|
+
function () {
|
|
198
202
|
function MutationObserver(callback) {
|
|
199
203
|
this.callback = callback;
|
|
200
204
|
this.nodes = [];
|
|
@@ -204,7 +208,10 @@ var MutationObserver = function () {
|
|
|
204
208
|
|
|
205
209
|
MutationObserver.prototype.observe = function (target, options) {
|
|
206
210
|
// 1.1
|
|
207
|
-
if (!options.childList && !options.attributes && !options.characterData ||
|
|
211
|
+
if (!options.childList && !options.attributes && !options.characterData || // 1.2
|
|
212
|
+
options.attributeOldValue && !options.attributes || // 1.3
|
|
213
|
+
options.attributeFilter && options.attributeFilter.length && !options.attributes || // 1.4
|
|
214
|
+
options.characterDataOldValue && !options.characterData) {
|
|
208
215
|
throw new SyntaxError();
|
|
209
216
|
}
|
|
210
217
|
|
package/es/dom/MutationRecord.js
CHANGED
package/es/dom/Node.js
CHANGED
|
@@ -6,7 +6,9 @@ import { EventTarget } from './EventTarget';
|
|
|
6
6
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Node
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
var Node =
|
|
9
|
+
var Node =
|
|
10
|
+
/** @class */
|
|
11
|
+
function (_super) {
|
|
10
12
|
__extends(Node, _super);
|
|
11
13
|
|
|
12
14
|
function Node() {
|
|
@@ -115,7 +117,7 @@ var Node = function (_super) {
|
|
|
115
117
|
|
|
116
118
|
if (this.nodeName === Shape.TEXT) {
|
|
117
119
|
// @ts-ignore
|
|
118
|
-
this.style.text = ""
|
|
120
|
+
this.style.text = "".concat(content);
|
|
119
121
|
} else {// this.appendChild(
|
|
120
122
|
// new Text({
|
|
121
123
|
// style: {
|
|
@@ -11,7 +11,6 @@ export interface CullingStrategyContribution {
|
|
|
11
11
|
* 2. other custom culling strategies, eg. frustum culling
|
|
12
12
|
*/
|
|
13
13
|
export declare class CullingPlugin implements RenderingPlugin {
|
|
14
|
-
static tag: string;
|
|
15
14
|
private strategyProvider;
|
|
16
15
|
apply(renderingService: RenderingService): void;
|
|
17
16
|
}
|
|
@@ -8,14 +8,14 @@ export var CullingStrategyContribution = Syringe.defineToken('CullingStrategyCon
|
|
|
8
8
|
* 2. other custom culling strategies, eg. frustum culling
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
var CullingPlugin =
|
|
11
|
+
var CullingPlugin =
|
|
12
|
+
/** @class */
|
|
13
|
+
function () {
|
|
12
14
|
function CullingPlugin() {}
|
|
13
15
|
|
|
14
|
-
CullingPlugin_1 = CullingPlugin;
|
|
15
|
-
|
|
16
16
|
CullingPlugin.prototype.apply = function (renderingService) {
|
|
17
17
|
var strategies = this.strategyProvider.getContributions();
|
|
18
|
-
renderingService.hooks.cull.tap(
|
|
18
|
+
renderingService.hooks.cull.tap(function (object) {
|
|
19
19
|
if (object) {
|
|
20
20
|
var cullable = object.cullable;
|
|
21
21
|
|
|
@@ -37,17 +37,14 @@ var CullingPlugin = function () {
|
|
|
37
37
|
|
|
38
38
|
return object;
|
|
39
39
|
});
|
|
40
|
-
renderingService.hooks.afterRender.tap(
|
|
40
|
+
renderingService.hooks.afterRender.tap(function (object) {
|
|
41
41
|
object.cullable.visibilityPlaneMask = -1;
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
var CullingPlugin_1;
|
|
46
|
-
CullingPlugin.tag = 'CullingPlugin';
|
|
47
|
-
|
|
48
45
|
__decorate([contrib(CullingStrategyContribution), __metadata("design:type", Object)], CullingPlugin.prototype, "strategyProvider", void 0);
|
|
49
46
|
|
|
50
|
-
CullingPlugin =
|
|
47
|
+
CullingPlugin = __decorate([singleton({
|
|
51
48
|
contrib: RenderingPluginContribution
|
|
52
49
|
})], CullingPlugin);
|
|
53
50
|
return CullingPlugin;
|
|
@@ -3,7 +3,7 @@ import type { RenderingService, RenderingPlugin } from '../services/RenderingSer
|
|
|
3
3
|
* Filter dirty renderables and calculate the "dirty rectangle" which will be clear when frame began
|
|
4
4
|
*/
|
|
5
5
|
export declare class DirtyCheckPlugin implements RenderingPlugin {
|
|
6
|
-
|
|
6
|
+
private canvasConfig;
|
|
7
7
|
private renderingContext;
|
|
8
8
|
apply(renderingService: RenderingService): void;
|
|
9
9
|
}
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import { inject, singleton } from 'mana-syringe';
|
|
3
|
+
import { CanvasConfig } from '../types';
|
|
3
4
|
import { RenderingPluginContribution } from '../services/RenderingService';
|
|
4
5
|
import { RenderingContext, RenderReason } from '../services/RenderingContext';
|
|
5
6
|
/**
|
|
6
7
|
* Filter dirty renderables and calculate the "dirty rectangle" which will be clear when frame began
|
|
7
8
|
*/
|
|
8
9
|
|
|
9
|
-
var DirtyCheckPlugin =
|
|
10
|
+
var DirtyCheckPlugin =
|
|
11
|
+
/** @class */
|
|
12
|
+
function () {
|
|
10
13
|
function DirtyCheckPlugin() {}
|
|
11
14
|
|
|
12
|
-
DirtyCheckPlugin_1 = DirtyCheckPlugin;
|
|
13
|
-
|
|
14
15
|
DirtyCheckPlugin.prototype.apply = function (renderingService) {
|
|
15
16
|
var _this = this;
|
|
16
17
|
|
|
17
|
-
renderingService.hooks.dirtycheck.tap(
|
|
18
|
+
renderingService.hooks.dirtycheck.tap(function (object) {
|
|
18
19
|
if (object) {
|
|
19
|
-
|
|
20
|
+
var enableDirtyCheck = _this.canvasConfig.renderer.getConfig().enableDirtyCheck;
|
|
21
|
+
|
|
20
22
|
var renderable = object.renderable;
|
|
21
23
|
|
|
22
|
-
var
|
|
24
|
+
var isCameraDirty = _this.renderingContext.renderReasons.has(RenderReason.CAMERA_CHANGED);
|
|
23
25
|
|
|
26
|
+
var isRenderingContextDirty = _this.renderingContext.dirty;
|
|
27
|
+
var isDirty = renderable.dirty || isCameraDirty || (enableDirtyCheck ? false : isRenderingContextDirty);
|
|
24
28
|
|
|
25
29
|
if (isDirty) {
|
|
26
30
|
return object;
|
|
@@ -33,12 +37,11 @@ var DirtyCheckPlugin = function () {
|
|
|
33
37
|
});
|
|
34
38
|
};
|
|
35
39
|
|
|
36
|
-
|
|
37
|
-
DirtyCheckPlugin.tag = 'DirtyCheckPlugin';
|
|
40
|
+
__decorate([inject(CanvasConfig), __metadata("design:type", Object)], DirtyCheckPlugin.prototype, "canvasConfig", void 0);
|
|
38
41
|
|
|
39
42
|
__decorate([inject(RenderingContext), __metadata("design:type", Object)], DirtyCheckPlugin.prototype, "renderingContext", void 0);
|
|
40
43
|
|
|
41
|
-
DirtyCheckPlugin =
|
|
44
|
+
DirtyCheckPlugin = __decorate([singleton({
|
|
42
45
|
contrib: RenderingPluginContribution
|
|
43
46
|
})], DirtyCheckPlugin);
|
|
44
47
|
return DirtyCheckPlugin;
|
|
@@ -7,7 +7,6 @@ import { RenderingService } from '../services';
|
|
|
7
7
|
* also provide some extra events such as `drag`
|
|
8
8
|
*/
|
|
9
9
|
export declare class EventPlugin implements RenderingPlugin {
|
|
10
|
-
static tag: string;
|
|
11
10
|
private canvasConfig;
|
|
12
11
|
private contextService;
|
|
13
12
|
private renderingService;
|
|
@@ -18,6 +17,7 @@ export declare class EventPlugin implements RenderingPlugin {
|
|
|
18
17
|
private rootWheelEvent;
|
|
19
18
|
apply(renderingService: RenderingService): void;
|
|
20
19
|
private onPointerMove;
|
|
20
|
+
private formatTouch;
|
|
21
21
|
private bootstrapEvent;
|
|
22
22
|
private normalizeWheelEvent;
|
|
23
23
|
/**
|