@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
|
@@ -25,6 +25,8 @@ var _FederatedPointerEvent = require("../dom/FederatedPointerEvent");
|
|
|
25
25
|
|
|
26
26
|
var _FederatedWheelEvent = require("../dom/FederatedWheelEvent");
|
|
27
27
|
|
|
28
|
+
var _FederatedTouchEvent = require("../dom/FederatedTouchEvent");
|
|
29
|
+
|
|
28
30
|
var _RenderingContext = require("./RenderingContext");
|
|
29
31
|
|
|
30
32
|
var _shapes = require("../shapes");
|
|
@@ -33,7 +35,9 @@ var _ContextService = require("./ContextService");
|
|
|
33
35
|
|
|
34
36
|
var PROPAGATION_LIMIT = 2048;
|
|
35
37
|
|
|
36
|
-
var EventService =
|
|
38
|
+
var EventService =
|
|
39
|
+
/** @class */
|
|
40
|
+
function (_super) {
|
|
37
41
|
(0, _tslib.__extends)(EventService, _super);
|
|
38
42
|
|
|
39
43
|
function EventService() {
|
|
@@ -46,6 +50,148 @@ var EventService = function (_super) {
|
|
|
46
50
|
};
|
|
47
51
|
_this.eventPool = new Map();
|
|
48
52
|
|
|
53
|
+
_this.handleTouchEvent = function (from, name) {
|
|
54
|
+
return (0, _tslib.__awaiter)(_this, void 0, void 0, function () {
|
|
55
|
+
var e, uniqTargets, _a, _b, touch, _loop_1, this_1, uniqTargets_1, uniqTargets_1_1, target;
|
|
56
|
+
|
|
57
|
+
var e_1, _c, e_2, _d;
|
|
58
|
+
|
|
59
|
+
return (0, _tslib.__generator)(this, function (_e) {
|
|
60
|
+
switch (_e.label) {
|
|
61
|
+
case 0:
|
|
62
|
+
return [4
|
|
63
|
+
/*yield*/
|
|
64
|
+
, this.createTouchEvent(from)];
|
|
65
|
+
|
|
66
|
+
case 1:
|
|
67
|
+
e = _e.sent();
|
|
68
|
+
uniqTargets = [];
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
for (_a = (0, _tslib.__values)(e.changedTouches), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
72
|
+
touch = _b.value;
|
|
73
|
+
|
|
74
|
+
if (uniqTargets.indexOf(touch.target) === -1) {
|
|
75
|
+
uniqTargets.push(touch.target);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
} catch (e_1_1) {
|
|
79
|
+
e_1 = {
|
|
80
|
+
error: e_1_1
|
|
81
|
+
};
|
|
82
|
+
} finally {
|
|
83
|
+
try {
|
|
84
|
+
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
85
|
+
} finally {
|
|
86
|
+
if (e_1) throw e_1.error;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
_loop_1 = function _loop_1(target) {
|
|
91
|
+
e.target = target;
|
|
92
|
+
e.targetTouches = e.touches.filter(function (t) {
|
|
93
|
+
return t.target === target;
|
|
94
|
+
});
|
|
95
|
+
this_1.dispatchEvent(e, name);
|
|
96
|
+
this_1.freeEvent(e);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
this_1 = this;
|
|
100
|
+
|
|
101
|
+
try {
|
|
102
|
+
for (uniqTargets_1 = (0, _tslib.__values)(uniqTargets), uniqTargets_1_1 = uniqTargets_1.next(); !uniqTargets_1_1.done; uniqTargets_1_1 = uniqTargets_1.next()) {
|
|
103
|
+
target = uniqTargets_1_1.value;
|
|
104
|
+
|
|
105
|
+
_loop_1(target);
|
|
106
|
+
}
|
|
107
|
+
} catch (e_2_1) {
|
|
108
|
+
e_2 = {
|
|
109
|
+
error: e_2_1
|
|
110
|
+
};
|
|
111
|
+
} finally {
|
|
112
|
+
try {
|
|
113
|
+
if (uniqTargets_1_1 && !uniqTargets_1_1.done && (_d = uniqTargets_1.return)) _d.call(uniqTargets_1);
|
|
114
|
+
} finally {
|
|
115
|
+
if (e_2) throw e_2.error;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return [2
|
|
120
|
+
/*return*/
|
|
121
|
+
];
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
_this.onTouchStart = function (from) {
|
|
128
|
+
return (0, _tslib.__awaiter)(_this, void 0, void 0, function () {
|
|
129
|
+
return (0, _tslib.__generator)(this, function (_a) {
|
|
130
|
+
if (!(from instanceof _FederatedPointerEvent.FederatedPointerEvent)) {
|
|
131
|
+
return [2
|
|
132
|
+
/*return*/
|
|
133
|
+
];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
this.handleTouchEvent(from, 'touchstart');
|
|
137
|
+
return [2
|
|
138
|
+
/*return*/
|
|
139
|
+
];
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
_this.onTouchMove = function (from) {
|
|
145
|
+
return (0, _tslib.__awaiter)(_this, void 0, void 0, function () {
|
|
146
|
+
return (0, _tslib.__generator)(this, function (_a) {
|
|
147
|
+
if (!(from instanceof _FederatedPointerEvent.FederatedPointerEvent)) {
|
|
148
|
+
return [2
|
|
149
|
+
/*return*/
|
|
150
|
+
];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
this.handleTouchEvent(from, 'touchmove');
|
|
154
|
+
return [2
|
|
155
|
+
/*return*/
|
|
156
|
+
];
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
_this.onTouchEnd = function (from) {
|
|
162
|
+
return (0, _tslib.__awaiter)(_this, void 0, void 0, function () {
|
|
163
|
+
return (0, _tslib.__generator)(this, function (_a) {
|
|
164
|
+
if (!(from instanceof _FederatedPointerEvent.FederatedPointerEvent)) {
|
|
165
|
+
return [2
|
|
166
|
+
/*return*/
|
|
167
|
+
];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
this.handleTouchEvent(from, 'touchend');
|
|
171
|
+
return [2
|
|
172
|
+
/*return*/
|
|
173
|
+
];
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
_this.onTouchCancel = function (from) {
|
|
179
|
+
return (0, _tslib.__awaiter)(_this, void 0, void 0, function () {
|
|
180
|
+
return (0, _tslib.__generator)(this, function (_a) {
|
|
181
|
+
if (!(from instanceof _FederatedPointerEvent.FederatedPointerEvent)) {
|
|
182
|
+
return [2
|
|
183
|
+
/*return*/
|
|
184
|
+
];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
this.handleTouchEvent(from, 'touchcancel');
|
|
188
|
+
return [2
|
|
189
|
+
/*return*/
|
|
190
|
+
];
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
};
|
|
194
|
+
|
|
49
195
|
_this.onPointerDown = function (from) {
|
|
50
196
|
return (0, _tslib.__awaiter)(_this, void 0, void 0, function () {
|
|
51
197
|
var e, isRightButton, trackingData;
|
|
@@ -67,9 +213,7 @@ var EventService = function (_super) {
|
|
|
67
213
|
this.dispatchEvent(e, 'pointerdown');
|
|
68
214
|
|
|
69
215
|
if (e.pointerType === 'touch') {
|
|
70
|
-
|
|
71
|
-
// if (e.isLast) {
|
|
72
|
-
this.dispatchEvent(e, 'touchstart'); // }
|
|
216
|
+
this.dispatchEvent(e, 'touchstart');
|
|
73
217
|
} else if (e.pointerType === 'mouse' || e.pointerType === 'pen') {
|
|
74
218
|
isRightButton = e.button === 2;
|
|
75
219
|
this.dispatchEvent(e, isRightButton ? 'rightdown' : 'mousedown');
|
|
@@ -507,6 +651,10 @@ var EventService = function (_super) {
|
|
|
507
651
|
this.addEventMapping('pointerover', this.onPointerOver);
|
|
508
652
|
this.addEventMapping('pointerupoutside', this.onPointerUpOutside);
|
|
509
653
|
this.addEventMapping('wheel', this.onWheel);
|
|
654
|
+
this.addEventMapping('touchstart', this.onTouchStart);
|
|
655
|
+
this.addEventMapping('touchmove', this.onTouchMove);
|
|
656
|
+
this.addEventMapping('touchend', this.onTouchEnd);
|
|
657
|
+
this.addEventMapping('touchcancel', this.onTouchCancel);
|
|
510
658
|
};
|
|
511
659
|
|
|
512
660
|
EventService.prototype.client2Viewport = function (client) {
|
|
@@ -589,7 +737,7 @@ var EventService = function (_super) {
|
|
|
589
737
|
mappers[i].fn(e);
|
|
590
738
|
}
|
|
591
739
|
} else {
|
|
592
|
-
console.warn("[EventService]: Event mapping not defined for "
|
|
740
|
+
console.warn("[EventService]: Event mapping not defined for ".concat(e.type));
|
|
593
741
|
}
|
|
594
742
|
};
|
|
595
743
|
|
|
@@ -716,6 +864,23 @@ var EventService = function (_super) {
|
|
|
716
864
|
return false;
|
|
717
865
|
};
|
|
718
866
|
|
|
867
|
+
EventService.prototype.pickTarget = function (event) {
|
|
868
|
+
return (0, _tslib.__awaiter)(this, void 0, void 0, function () {
|
|
869
|
+
return (0, _tslib.__generator)(this, function (_a) {
|
|
870
|
+
return [2
|
|
871
|
+
/*return*/
|
|
872
|
+
, this.hitTest({
|
|
873
|
+
clientX: event.clientX,
|
|
874
|
+
clientY: event.clientY,
|
|
875
|
+
viewportX: event.viewportX,
|
|
876
|
+
viewportY: event.viewportY,
|
|
877
|
+
x: event.canvasX,
|
|
878
|
+
y: event.canvasY
|
|
879
|
+
})];
|
|
880
|
+
});
|
|
881
|
+
});
|
|
882
|
+
};
|
|
883
|
+
|
|
719
884
|
EventService.prototype.createPointerEvent = function (from, type, target) {
|
|
720
885
|
return (0, _tslib.__awaiter)(this, void 0, void 0, function () {
|
|
721
886
|
var event, isFromCanvas, _a, _b, _c;
|
|
@@ -746,14 +911,7 @@ var EventService = function (_super) {
|
|
|
746
911
|
, 3];
|
|
747
912
|
return [4
|
|
748
913
|
/*yield*/
|
|
749
|
-
, this.
|
|
750
|
-
clientX: event.clientX,
|
|
751
|
-
clientY: event.clientY,
|
|
752
|
-
viewportX: event.viewportX,
|
|
753
|
-
viewportY: event.viewportY,
|
|
754
|
-
x: event.global.x,
|
|
755
|
-
y: event.global.y
|
|
756
|
-
})];
|
|
914
|
+
, this.pickTarget(event)];
|
|
757
915
|
|
|
758
916
|
case 2:
|
|
759
917
|
_c = _d.sent();
|
|
@@ -778,6 +936,97 @@ var EventService = function (_super) {
|
|
|
778
936
|
});
|
|
779
937
|
};
|
|
780
938
|
|
|
939
|
+
EventService.prototype.createTouchEvent = function (from) {
|
|
940
|
+
return (0, _tslib.__awaiter)(this, void 0, void 0, function () {
|
|
941
|
+
var event, i, touch, isFromCanvas, _a, _b, i, touch, isFromCanvas, _c, _d;
|
|
942
|
+
|
|
943
|
+
return (0, _tslib.__generator)(this, function (_e) {
|
|
944
|
+
switch (_e.label) {
|
|
945
|
+
case 0:
|
|
946
|
+
event = this.allocateEvent(_FederatedTouchEvent.FederatedTouchEvent);
|
|
947
|
+
event.isTrusted = from.isTrusted;
|
|
948
|
+
event.timeStamp = performance.now();
|
|
949
|
+
event.type = from.type;
|
|
950
|
+
event.detail = from.detail;
|
|
951
|
+
event.nativeEvent = from.nativeEvent;
|
|
952
|
+
event.originalEvent = from;
|
|
953
|
+
this.copyTouchData(from, event);
|
|
954
|
+
i = 0;
|
|
955
|
+
_e.label = 1;
|
|
956
|
+
|
|
957
|
+
case 1:
|
|
958
|
+
if (!(i < from.changedTouches.length)) return [3
|
|
959
|
+
/*break*/
|
|
960
|
+
, 5];
|
|
961
|
+
touch = from.changedTouches[i];
|
|
962
|
+
isFromCanvas = this.isNativeEventFromCanvas(from);
|
|
963
|
+
_a = touch;
|
|
964
|
+
_b = isFromCanvas;
|
|
965
|
+
if (!_b) return [3
|
|
966
|
+
/*break*/
|
|
967
|
+
, 3];
|
|
968
|
+
return [4
|
|
969
|
+
/*yield*/
|
|
970
|
+
, this.pickTarget(touch)];
|
|
971
|
+
|
|
972
|
+
case 2:
|
|
973
|
+
_b = _e.sent();
|
|
974
|
+
_e.label = 3;
|
|
975
|
+
|
|
976
|
+
case 3:
|
|
977
|
+
_a.target = _b;
|
|
978
|
+
_e.label = 4;
|
|
979
|
+
|
|
980
|
+
case 4:
|
|
981
|
+
i++;
|
|
982
|
+
return [3
|
|
983
|
+
/*break*/
|
|
984
|
+
, 1];
|
|
985
|
+
|
|
986
|
+
case 5:
|
|
987
|
+
i = 0;
|
|
988
|
+
_e.label = 6;
|
|
989
|
+
|
|
990
|
+
case 6:
|
|
991
|
+
if (!(i < from.touches.length)) return [3
|
|
992
|
+
/*break*/
|
|
993
|
+
, 10];
|
|
994
|
+
touch = from.touches[i];
|
|
995
|
+
isFromCanvas = this.isNativeEventFromCanvas(from);
|
|
996
|
+
_c = touch;
|
|
997
|
+
_d = isFromCanvas;
|
|
998
|
+
if (!_d) return [3
|
|
999
|
+
/*break*/
|
|
1000
|
+
, 8];
|
|
1001
|
+
return [4
|
|
1002
|
+
/*yield*/
|
|
1003
|
+
, this.pickTarget(touch)];
|
|
1004
|
+
|
|
1005
|
+
case 7:
|
|
1006
|
+
_d = _e.sent();
|
|
1007
|
+
_e.label = 8;
|
|
1008
|
+
|
|
1009
|
+
case 8:
|
|
1010
|
+
_c.target = _d;
|
|
1011
|
+
_e.label = 9;
|
|
1012
|
+
|
|
1013
|
+
case 9:
|
|
1014
|
+
i++;
|
|
1015
|
+
return [3
|
|
1016
|
+
/*break*/
|
|
1017
|
+
, 6];
|
|
1018
|
+
|
|
1019
|
+
case 10:
|
|
1020
|
+
event.touches = from.touches;
|
|
1021
|
+
event.changedTouches = from.changedTouches;
|
|
1022
|
+
return [2
|
|
1023
|
+
/*return*/
|
|
1024
|
+
, event];
|
|
1025
|
+
}
|
|
1026
|
+
});
|
|
1027
|
+
});
|
|
1028
|
+
};
|
|
1029
|
+
|
|
781
1030
|
EventService.prototype.createWheelEvent = function (from) {
|
|
782
1031
|
return (0, _tslib.__awaiter)(this, void 0, void 0, function () {
|
|
783
1032
|
var event, isFromCanvas, _a, _b;
|
|
@@ -799,14 +1048,7 @@ var EventService = function (_super) {
|
|
|
799
1048
|
, 2];
|
|
800
1049
|
return [4
|
|
801
1050
|
/*yield*/
|
|
802
|
-
, this.
|
|
803
|
-
clientX: event.clientX,
|
|
804
|
-
clientY: event.clientY,
|
|
805
|
-
viewportX: event.viewportX,
|
|
806
|
-
viewportY: event.viewportY,
|
|
807
|
-
x: event.global.x,
|
|
808
|
-
y: event.global.y
|
|
809
|
-
})];
|
|
1051
|
+
, this.pickTarget(event)];
|
|
810
1052
|
|
|
811
1053
|
case 1:
|
|
812
1054
|
_b = _c.sent();
|
|
@@ -868,6 +1110,7 @@ var EventService = function (_super) {
|
|
|
868
1110
|
to.buttons = from.buttons;
|
|
869
1111
|
to.ctrlKey = from.ctrlKey;
|
|
870
1112
|
to.metaKey = from.metaKey;
|
|
1113
|
+
to.shiftKey = from.shiftKey;
|
|
871
1114
|
to.client.copyFrom(from.client);
|
|
872
1115
|
to.movement.copyFrom(from.movement);
|
|
873
1116
|
to.canvas.copyFrom(from.canvas);
|
|
@@ -876,6 +1119,20 @@ var EventService = function (_super) {
|
|
|
876
1119
|
to.offset.copyFrom(from.offset);
|
|
877
1120
|
};
|
|
878
1121
|
|
|
1122
|
+
EventService.prototype.copyTouchData = function (from, to) {
|
|
1123
|
+
return (0, _tslib.__awaiter)(this, void 0, void 0, function () {
|
|
1124
|
+
return (0, _tslib.__generator)(this, function (_a) {
|
|
1125
|
+
to.altKey = from.altKey;
|
|
1126
|
+
to.ctrlKey = from.ctrlKey;
|
|
1127
|
+
to.metaKey = from.metaKey;
|
|
1128
|
+
to.shiftKey = from.shiftKey;
|
|
1129
|
+
return [2
|
|
1130
|
+
/*return*/
|
|
1131
|
+
];
|
|
1132
|
+
});
|
|
1133
|
+
});
|
|
1134
|
+
};
|
|
1135
|
+
|
|
879
1136
|
EventService.prototype.copyWheelData = function (from, to) {
|
|
880
1137
|
to.deltaMode = from.deltaMode;
|
|
881
1138
|
to.deltaX = from.deltaX;
|
|
@@ -921,7 +1178,7 @@ var EventService = function (_super) {
|
|
|
921
1178
|
|
|
922
1179
|
EventService.prototype.notifyTarget = function (e, type) {
|
|
923
1180
|
type = type !== null && type !== void 0 ? type : e.type;
|
|
924
|
-
var key = e.eventPhase === e.CAPTURING_PHASE || e.eventPhase === e.AT_TARGET ? type
|
|
1181
|
+
var key = e.eventPhase === e.CAPTURING_PHASE || e.eventPhase === e.AT_TARGET ? "".concat(type, "capture") : type;
|
|
925
1182
|
this.notifyListeners(e, key);
|
|
926
1183
|
|
|
927
1184
|
if (e.eventPhase === e.AT_TARGET) {
|
|
@@ -15,7 +15,9 @@ var _manaSyringe = require("mana-syringe");
|
|
|
15
15
|
* - g-plugin-canvas-picker `ctx.isPointInPath`
|
|
16
16
|
* - g-plugin-webgl-renderer `ctx.createLinearGradient` and generate texture
|
|
17
17
|
*/
|
|
18
|
-
var OffscreenCanvasCreator =
|
|
18
|
+
var OffscreenCanvasCreator =
|
|
19
|
+
/** @class */
|
|
20
|
+
function () {
|
|
19
21
|
function OffscreenCanvasCreator() {}
|
|
20
22
|
|
|
21
23
|
OffscreenCanvasCreator.prototype.getOrCreateCanvas = function (offscreenCanvas) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Syringe } from 'mana-syringe';
|
|
2
|
-
import { SyncHook, SyncWaterfallHook, AsyncParallelHook, AsyncSeriesWaterfallHook } from '
|
|
2
|
+
import { SyncHook, SyncWaterfallHook, AsyncParallelHook, AsyncSeriesWaterfallHook } from '../utils';
|
|
3
3
|
import type { DisplayObject } from '../display-objects';
|
|
4
4
|
import type { CanvasConfig, EventPosition, InteractivePointerEvent } from '../types';
|
|
5
5
|
export interface RenderingPlugin {
|
|
@@ -38,33 +38,33 @@ export declare class RenderingService {
|
|
|
38
38
|
/**
|
|
39
39
|
* called before any frame rendered
|
|
40
40
|
*/
|
|
41
|
-
init: AsyncParallelHook<[],
|
|
41
|
+
init: AsyncParallelHook<[], void>;
|
|
42
42
|
/**
|
|
43
43
|
* only dirty object which has sth changed will be rendered
|
|
44
44
|
*/
|
|
45
|
-
dirtycheck: SyncWaterfallHook<[DisplayObject<any, any>],
|
|
45
|
+
dirtycheck: SyncWaterfallHook<[DisplayObject<any, any>], DisplayObject<any, any>>;
|
|
46
46
|
/**
|
|
47
47
|
* do culling
|
|
48
48
|
*/
|
|
49
|
-
cull: SyncWaterfallHook<[DisplayObject<any, any>],
|
|
49
|
+
cull: SyncWaterfallHook<[DisplayObject<any, any>], DisplayObject<any, any>>;
|
|
50
50
|
/**
|
|
51
51
|
* called at beginning of each frame, won't get called if nothing to re-render
|
|
52
52
|
*/
|
|
53
|
-
beginFrame: SyncHook<[], void
|
|
53
|
+
beginFrame: SyncHook<[], void>;
|
|
54
54
|
/**
|
|
55
55
|
* called before every dirty object get rendered
|
|
56
56
|
*/
|
|
57
|
-
beforeRender: SyncHook<[DisplayObject<any, any>], void
|
|
57
|
+
beforeRender: SyncHook<[DisplayObject<any, any>], void>;
|
|
58
58
|
/**
|
|
59
59
|
* called when every dirty object rendering even it's culled
|
|
60
60
|
*/
|
|
61
|
-
render: SyncHook<[DisplayObject<any, any>], void
|
|
61
|
+
render: SyncHook<[DisplayObject<any, any>], void>;
|
|
62
62
|
/**
|
|
63
63
|
* called after every dirty object get rendered
|
|
64
64
|
*/
|
|
65
|
-
afterRender: SyncHook<[DisplayObject<any, any>], void
|
|
66
|
-
endFrame: SyncHook<[], void
|
|
67
|
-
destroy: SyncHook<[], void
|
|
65
|
+
afterRender: SyncHook<[DisplayObject<any, any>], void>;
|
|
66
|
+
endFrame: SyncHook<[], void>;
|
|
67
|
+
destroy: SyncHook<[], void>;
|
|
68
68
|
/**
|
|
69
69
|
* use async but faster method such as GPU-based picking in `g-plugin-webgl-renderer`
|
|
70
70
|
*/
|
|
@@ -72,12 +72,13 @@ export declare class RenderingService {
|
|
|
72
72
|
/**
|
|
73
73
|
* used in event system
|
|
74
74
|
*/
|
|
75
|
-
pointerDown: SyncHook<[InteractivePointerEvent], void
|
|
76
|
-
pointerUp: SyncHook<[InteractivePointerEvent], void
|
|
77
|
-
pointerMove: SyncHook<[InteractivePointerEvent], void
|
|
78
|
-
pointerOut: SyncHook<[InteractivePointerEvent], void
|
|
79
|
-
pointerOver: SyncHook<[InteractivePointerEvent], void
|
|
80
|
-
|
|
75
|
+
pointerDown: SyncHook<[InteractivePointerEvent], void>;
|
|
76
|
+
pointerUp: SyncHook<[InteractivePointerEvent], void>;
|
|
77
|
+
pointerMove: SyncHook<[InteractivePointerEvent], void>;
|
|
78
|
+
pointerOut: SyncHook<[InteractivePointerEvent], void>;
|
|
79
|
+
pointerOver: SyncHook<[InteractivePointerEvent], void>;
|
|
80
|
+
pointerCancel: SyncHook<[InteractivePointerEvent], void>;
|
|
81
|
+
pointerWheel: SyncHook<[InteractivePointerEvent], void>;
|
|
81
82
|
};
|
|
82
83
|
init(): Promise<void>;
|
|
83
84
|
getStats(): {
|
|
@@ -9,7 +9,7 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _manaSyringe = require("mana-syringe");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _utils = require("../utils");
|
|
13
13
|
|
|
14
14
|
var _css = require("../css");
|
|
15
15
|
|
|
@@ -33,7 +33,9 @@ var RenderingPluginContribution = _manaSyringe.Syringe.defineToken('RenderingPlu
|
|
|
33
33
|
|
|
34
34
|
exports.RenderingPluginContribution = RenderingPluginContribution;
|
|
35
35
|
|
|
36
|
-
var RenderingService =
|
|
36
|
+
var RenderingService =
|
|
37
|
+
/** @class */
|
|
38
|
+
function () {
|
|
37
39
|
function RenderingService() {
|
|
38
40
|
this.inited = false;
|
|
39
41
|
this.stats = {
|
|
@@ -57,54 +59,55 @@ var RenderingService = function () {
|
|
|
57
59
|
/**
|
|
58
60
|
* called before any frame rendered
|
|
59
61
|
*/
|
|
60
|
-
init: new
|
|
62
|
+
init: new _utils.AsyncParallelHook(),
|
|
61
63
|
|
|
62
64
|
/**
|
|
63
65
|
* only dirty object which has sth changed will be rendered
|
|
64
66
|
*/
|
|
65
|
-
dirtycheck: new
|
|
67
|
+
dirtycheck: new _utils.SyncWaterfallHook(),
|
|
66
68
|
|
|
67
69
|
/**
|
|
68
70
|
* do culling
|
|
69
71
|
*/
|
|
70
|
-
cull: new
|
|
72
|
+
cull: new _utils.SyncWaterfallHook(),
|
|
71
73
|
|
|
72
74
|
/**
|
|
73
75
|
* called at beginning of each frame, won't get called if nothing to re-render
|
|
74
76
|
*/
|
|
75
|
-
beginFrame: new
|
|
77
|
+
beginFrame: new _utils.SyncHook(),
|
|
76
78
|
|
|
77
79
|
/**
|
|
78
80
|
* called before every dirty object get rendered
|
|
79
81
|
*/
|
|
80
|
-
beforeRender: new
|
|
82
|
+
beforeRender: new _utils.SyncHook(),
|
|
81
83
|
|
|
82
84
|
/**
|
|
83
85
|
* called when every dirty object rendering even it's culled
|
|
84
86
|
*/
|
|
85
|
-
render: new
|
|
87
|
+
render: new _utils.SyncHook(),
|
|
86
88
|
|
|
87
89
|
/**
|
|
88
90
|
* called after every dirty object get rendered
|
|
89
91
|
*/
|
|
90
|
-
afterRender: new
|
|
91
|
-
endFrame: new
|
|
92
|
-
destroy: new
|
|
92
|
+
afterRender: new _utils.SyncHook(),
|
|
93
|
+
endFrame: new _utils.SyncHook(),
|
|
94
|
+
destroy: new _utils.SyncHook(),
|
|
93
95
|
|
|
94
96
|
/**
|
|
95
97
|
* use async but faster method such as GPU-based picking in `g-plugin-webgl-renderer`
|
|
96
98
|
*/
|
|
97
|
-
pick: new
|
|
99
|
+
pick: new _utils.AsyncSeriesWaterfallHook(),
|
|
98
100
|
|
|
99
101
|
/**
|
|
100
102
|
* used in event system
|
|
101
103
|
*/
|
|
102
|
-
pointerDown: new
|
|
103
|
-
pointerUp: new
|
|
104
|
-
pointerMove: new
|
|
105
|
-
pointerOut: new
|
|
106
|
-
pointerOver: new
|
|
107
|
-
|
|
104
|
+
pointerDown: new _utils.SyncHook(),
|
|
105
|
+
pointerUp: new _utils.SyncHook(),
|
|
106
|
+
pointerMove: new _utils.SyncHook(),
|
|
107
|
+
pointerOut: new _utils.SyncHook(),
|
|
108
|
+
pointerOver: new _utils.SyncHook(),
|
|
109
|
+
pointerCancel: new _utils.SyncHook(),
|
|
110
|
+
pointerWheel: new _utils.SyncHook()
|
|
108
111
|
};
|
|
109
112
|
}
|
|
110
113
|
|
|
@@ -123,7 +126,7 @@ var RenderingService = function () {
|
|
|
123
126
|
});
|
|
124
127
|
return [4
|
|
125
128
|
/*yield*/
|
|
126
|
-
, this.hooks.init.
|
|
129
|
+
, this.hooks.init.callPromise()];
|
|
127
130
|
|
|
128
131
|
case 1:
|
|
129
132
|
_a.sent();
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.SceneGraphSelectorFactory = exports.SceneGraphSelector = exports.DefaultSceneGraphSelector = void 0;
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
@@ -29,7 +29,9 @@ var NAME_REGEXP = /\[\s*name=(.*)\s*\]/;
|
|
|
29
29
|
* * querySelectorAll
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
|
-
var DefaultSceneGraphSelector =
|
|
32
|
+
var DefaultSceneGraphSelector =
|
|
33
|
+
/** @class */
|
|
34
|
+
function () {
|
|
33
35
|
function DefaultSceneGraphSelector() {}
|
|
34
36
|
|
|
35
37
|
DefaultSceneGraphSelector.prototype.selectOne = function (query, root) {
|
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.SceneGraphService = exports.DefaultSceneGraphService = void 0;
|
|
7
7
|
exports.dirtifyToRoot = dirtifyToRoot;
|
|
8
|
-
exports.
|
|
8
|
+
exports.sortByZIndex = sortByZIndex;
|
|
9
9
|
|
|
10
10
|
var _tslib = require("tslib");
|
|
11
11
|
|
|
12
12
|
var _manaSyringe = require("mana-syringe");
|
|
13
13
|
|
|
14
|
-
var _util = require("@antv/util");
|
|
15
|
-
|
|
16
14
|
var _glMatrix = require("gl-matrix");
|
|
17
15
|
|
|
18
16
|
var _shapes = require("../shapes");
|
|
@@ -23,6 +21,8 @@ var _interfaces = require("../dom/interfaces");
|
|
|
23
21
|
|
|
24
22
|
var _MutationEvent = require("../dom/MutationEvent");
|
|
25
23
|
|
|
24
|
+
var _utils = require("../utils");
|
|
25
|
+
|
|
26
26
|
function sortByZIndex(o1, o2) {
|
|
27
27
|
var zIndex1 = Number(o1.style.zIndex);
|
|
28
28
|
var zIndex2 = Number(o2.style.zIndex);
|
|
@@ -74,7 +74,9 @@ var SceneGraphService = _manaSyringe.Syringe.defineToken('SceneGraphService');
|
|
|
74
74
|
|
|
75
75
|
exports.SceneGraphService = SceneGraphService;
|
|
76
76
|
|
|
77
|
-
var DefaultSceneGraphService =
|
|
77
|
+
var DefaultSceneGraphService =
|
|
78
|
+
/** @class */
|
|
79
|
+
function () {
|
|
78
80
|
function DefaultSceneGraphService() {
|
|
79
81
|
var _this = this;
|
|
80
82
|
/**
|
|
@@ -356,7 +358,7 @@ var DefaultSceneGraphService = function () {
|
|
|
356
358
|
|
|
357
359
|
child.parentNode = parent;
|
|
358
360
|
|
|
359
|
-
if (!(0,
|
|
361
|
+
if (!(0, _utils.isNil)(index)) {
|
|
360
362
|
child.parentNode.childNodes.splice(index, 0, child);
|
|
361
363
|
} else {
|
|
362
364
|
child.parentNode.childNodes.push(child);
|
|
@@ -36,10 +36,12 @@ var regexCannotStartJaJp = /[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾー
|
|
|
36
36
|
var regexCannotEndJaJp = /[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/;
|
|
37
37
|
var regexCannotStartKoKr = /[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/;
|
|
38
38
|
var regexCannotEndKoKr = /[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/;
|
|
39
|
-
var regexCannotStart = new RegExp(regexCannotStartZhCn.source
|
|
40
|
-
var regexCannotEnd = new RegExp(regexCannotEndZhCn.source
|
|
39
|
+
var regexCannotStart = new RegExp("".concat(regexCannotStartZhCn.source, "|").concat(regexCannotStartZhTw.source, "|").concat(regexCannotStartJaJp.source, "|").concat(regexCannotStartKoKr.source));
|
|
40
|
+
var regexCannotEnd = new RegExp("".concat(regexCannotEndZhCn.source, "|").concat(regexCannotEndZhTw.source, "|").concat(regexCannotEndJaJp.source, "|").concat(regexCannotEndKoKr.source));
|
|
41
41
|
|
|
42
|
-
var TextService =
|
|
42
|
+
var TextService =
|
|
43
|
+
/** @class */
|
|
44
|
+
function () {
|
|
43
45
|
function TextService() {
|
|
44
46
|
var _this = this;
|
|
45
47
|
|
|
@@ -13,7 +13,9 @@ var _interfaces = require("./interfaces");
|
|
|
13
13
|
|
|
14
14
|
var _types = require("../../types");
|
|
15
15
|
|
|
16
|
-
var CircleUpdater =
|
|
16
|
+
var CircleUpdater =
|
|
17
|
+
/** @class */
|
|
18
|
+
function () {
|
|
17
19
|
function CircleUpdater() {}
|
|
18
20
|
|
|
19
21
|
CircleUpdater.prototype.update = function (parsedStyle, object) {
|
|
@@ -13,7 +13,9 @@ var _interfaces = require("./interfaces");
|
|
|
13
13
|
|
|
14
14
|
var _types = require("../../types");
|
|
15
15
|
|
|
16
|
-
var EllipseUpdater =
|
|
16
|
+
var EllipseUpdater =
|
|
17
|
+
/** @class */
|
|
18
|
+
function () {
|
|
17
19
|
function EllipseUpdater() {}
|
|
18
20
|
|
|
19
21
|
EllipseUpdater.prototype.update = function (parsedStyle, object) {
|