@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __awaiter, __decorate, __extends, __generator, __metadata } from "tslib";
|
|
1
|
+
import { __awaiter, __decorate, __extends, __generator, __metadata, __values } from "tslib";
|
|
2
2
|
import { mat4, vec3 } from 'gl-matrix';
|
|
3
3
|
import { inject, singleton, postConstruct } from 'mana-syringe';
|
|
4
4
|
import { EventEmitter } from 'eventemitter3';
|
|
@@ -8,12 +8,15 @@ import { Node } from '../dom/Node';
|
|
|
8
8
|
import { FederatedMouseEvent } from '../dom/FederatedMouseEvent';
|
|
9
9
|
import { FederatedPointerEvent } from '../dom/FederatedPointerEvent';
|
|
10
10
|
import { FederatedWheelEvent } from '../dom/FederatedWheelEvent';
|
|
11
|
+
import { FederatedTouchEvent } from '../dom/FederatedTouchEvent';
|
|
11
12
|
import { RenderingContext } from './RenderingContext';
|
|
12
13
|
import { Point } from '../shapes';
|
|
13
14
|
import { ContextService } from './ContextService';
|
|
14
15
|
var PROPAGATION_LIMIT = 2048;
|
|
15
16
|
|
|
16
|
-
var EventService =
|
|
17
|
+
var EventService =
|
|
18
|
+
/** @class */
|
|
19
|
+
function (_super) {
|
|
17
20
|
__extends(EventService, _super);
|
|
18
21
|
|
|
19
22
|
function EventService() {
|
|
@@ -26,6 +29,148 @@ var EventService = function (_super) {
|
|
|
26
29
|
};
|
|
27
30
|
_this.eventPool = new Map();
|
|
28
31
|
|
|
32
|
+
_this.handleTouchEvent = function (from, name) {
|
|
33
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
34
|
+
var e, uniqTargets, _a, _b, touch, _loop_1, this_1, uniqTargets_1, uniqTargets_1_1, target;
|
|
35
|
+
|
|
36
|
+
var e_1, _c, e_2, _d;
|
|
37
|
+
|
|
38
|
+
return __generator(this, function (_e) {
|
|
39
|
+
switch (_e.label) {
|
|
40
|
+
case 0:
|
|
41
|
+
return [4
|
|
42
|
+
/*yield*/
|
|
43
|
+
, this.createTouchEvent(from)];
|
|
44
|
+
|
|
45
|
+
case 1:
|
|
46
|
+
e = _e.sent();
|
|
47
|
+
uniqTargets = [];
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
for (_a = __values(e.changedTouches), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
51
|
+
touch = _b.value;
|
|
52
|
+
|
|
53
|
+
if (uniqTargets.indexOf(touch.target) === -1) {
|
|
54
|
+
uniqTargets.push(touch.target);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
} catch (e_1_1) {
|
|
58
|
+
e_1 = {
|
|
59
|
+
error: e_1_1
|
|
60
|
+
};
|
|
61
|
+
} finally {
|
|
62
|
+
try {
|
|
63
|
+
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
64
|
+
} finally {
|
|
65
|
+
if (e_1) throw e_1.error;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
_loop_1 = function _loop_1(target) {
|
|
70
|
+
e.target = target;
|
|
71
|
+
e.targetTouches = e.touches.filter(function (t) {
|
|
72
|
+
return t.target === target;
|
|
73
|
+
});
|
|
74
|
+
this_1.dispatchEvent(e, name);
|
|
75
|
+
this_1.freeEvent(e);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
this_1 = this;
|
|
79
|
+
|
|
80
|
+
try {
|
|
81
|
+
for (uniqTargets_1 = __values(uniqTargets), uniqTargets_1_1 = uniqTargets_1.next(); !uniqTargets_1_1.done; uniqTargets_1_1 = uniqTargets_1.next()) {
|
|
82
|
+
target = uniqTargets_1_1.value;
|
|
83
|
+
|
|
84
|
+
_loop_1(target);
|
|
85
|
+
}
|
|
86
|
+
} catch (e_2_1) {
|
|
87
|
+
e_2 = {
|
|
88
|
+
error: e_2_1
|
|
89
|
+
};
|
|
90
|
+
} finally {
|
|
91
|
+
try {
|
|
92
|
+
if (uniqTargets_1_1 && !uniqTargets_1_1.done && (_d = uniqTargets_1.return)) _d.call(uniqTargets_1);
|
|
93
|
+
} finally {
|
|
94
|
+
if (e_2) throw e_2.error;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return [2
|
|
99
|
+
/*return*/
|
|
100
|
+
];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
_this.onTouchStart = function (from) {
|
|
107
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
108
|
+
return __generator(this, function (_a) {
|
|
109
|
+
if (!(from instanceof FederatedPointerEvent)) {
|
|
110
|
+
return [2
|
|
111
|
+
/*return*/
|
|
112
|
+
];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
this.handleTouchEvent(from, 'touchstart');
|
|
116
|
+
return [2
|
|
117
|
+
/*return*/
|
|
118
|
+
];
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
_this.onTouchMove = function (from) {
|
|
124
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
125
|
+
return __generator(this, function (_a) {
|
|
126
|
+
if (!(from instanceof FederatedPointerEvent)) {
|
|
127
|
+
return [2
|
|
128
|
+
/*return*/
|
|
129
|
+
];
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
this.handleTouchEvent(from, 'touchmove');
|
|
133
|
+
return [2
|
|
134
|
+
/*return*/
|
|
135
|
+
];
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
_this.onTouchEnd = function (from) {
|
|
141
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
142
|
+
return __generator(this, function (_a) {
|
|
143
|
+
if (!(from instanceof FederatedPointerEvent)) {
|
|
144
|
+
return [2
|
|
145
|
+
/*return*/
|
|
146
|
+
];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
this.handleTouchEvent(from, 'touchend');
|
|
150
|
+
return [2
|
|
151
|
+
/*return*/
|
|
152
|
+
];
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
_this.onTouchCancel = function (from) {
|
|
158
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
159
|
+
return __generator(this, function (_a) {
|
|
160
|
+
if (!(from instanceof FederatedPointerEvent)) {
|
|
161
|
+
return [2
|
|
162
|
+
/*return*/
|
|
163
|
+
];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
this.handleTouchEvent(from, 'touchcancel');
|
|
167
|
+
return [2
|
|
168
|
+
/*return*/
|
|
169
|
+
];
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
|
|
29
174
|
_this.onPointerDown = function (from) {
|
|
30
175
|
return __awaiter(_this, void 0, void 0, function () {
|
|
31
176
|
var e, isRightButton, trackingData;
|
|
@@ -47,9 +192,7 @@ var EventService = function (_super) {
|
|
|
47
192
|
this.dispatchEvent(e, 'pointerdown');
|
|
48
193
|
|
|
49
194
|
if (e.pointerType === 'touch') {
|
|
50
|
-
|
|
51
|
-
// if (e.isLast) {
|
|
52
|
-
this.dispatchEvent(e, 'touchstart'); // }
|
|
195
|
+
this.dispatchEvent(e, 'touchstart');
|
|
53
196
|
} else if (e.pointerType === 'mouse' || e.pointerType === 'pen') {
|
|
54
197
|
isRightButton = e.button === 2;
|
|
55
198
|
this.dispatchEvent(e, isRightButton ? 'rightdown' : 'mousedown');
|
|
@@ -487,6 +630,10 @@ var EventService = function (_super) {
|
|
|
487
630
|
this.addEventMapping('pointerover', this.onPointerOver);
|
|
488
631
|
this.addEventMapping('pointerupoutside', this.onPointerUpOutside);
|
|
489
632
|
this.addEventMapping('wheel', this.onWheel);
|
|
633
|
+
this.addEventMapping('touchstart', this.onTouchStart);
|
|
634
|
+
this.addEventMapping('touchmove', this.onTouchMove);
|
|
635
|
+
this.addEventMapping('touchend', this.onTouchEnd);
|
|
636
|
+
this.addEventMapping('touchcancel', this.onTouchCancel);
|
|
490
637
|
};
|
|
491
638
|
|
|
492
639
|
EventService.prototype.client2Viewport = function (client) {
|
|
@@ -561,7 +708,7 @@ var EventService = function (_super) {
|
|
|
561
708
|
mappers[i].fn(e);
|
|
562
709
|
}
|
|
563
710
|
} else {
|
|
564
|
-
console.warn("[EventService]: Event mapping not defined for "
|
|
711
|
+
console.warn("[EventService]: Event mapping not defined for ".concat(e.type));
|
|
565
712
|
}
|
|
566
713
|
};
|
|
567
714
|
|
|
@@ -688,6 +835,23 @@ var EventService = function (_super) {
|
|
|
688
835
|
return false;
|
|
689
836
|
};
|
|
690
837
|
|
|
838
|
+
EventService.prototype.pickTarget = function (event) {
|
|
839
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
840
|
+
return __generator(this, function (_a) {
|
|
841
|
+
return [2
|
|
842
|
+
/*return*/
|
|
843
|
+
, this.hitTest({
|
|
844
|
+
clientX: event.clientX,
|
|
845
|
+
clientY: event.clientY,
|
|
846
|
+
viewportX: event.viewportX,
|
|
847
|
+
viewportY: event.viewportY,
|
|
848
|
+
x: event.canvasX,
|
|
849
|
+
y: event.canvasY
|
|
850
|
+
})];
|
|
851
|
+
});
|
|
852
|
+
});
|
|
853
|
+
};
|
|
854
|
+
|
|
691
855
|
EventService.prototype.createPointerEvent = function (from, type, target) {
|
|
692
856
|
return __awaiter(this, void 0, void 0, function () {
|
|
693
857
|
var event, isFromCanvas, _a, _b, _c;
|
|
@@ -718,14 +882,7 @@ var EventService = function (_super) {
|
|
|
718
882
|
, 3];
|
|
719
883
|
return [4
|
|
720
884
|
/*yield*/
|
|
721
|
-
, this.
|
|
722
|
-
clientX: event.clientX,
|
|
723
|
-
clientY: event.clientY,
|
|
724
|
-
viewportX: event.viewportX,
|
|
725
|
-
viewportY: event.viewportY,
|
|
726
|
-
x: event.global.x,
|
|
727
|
-
y: event.global.y
|
|
728
|
-
})];
|
|
885
|
+
, this.pickTarget(event)];
|
|
729
886
|
|
|
730
887
|
case 2:
|
|
731
888
|
_c = _d.sent();
|
|
@@ -750,6 +907,97 @@ var EventService = function (_super) {
|
|
|
750
907
|
});
|
|
751
908
|
};
|
|
752
909
|
|
|
910
|
+
EventService.prototype.createTouchEvent = function (from) {
|
|
911
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
912
|
+
var event, i, touch, isFromCanvas, _a, _b, i, touch, isFromCanvas, _c, _d;
|
|
913
|
+
|
|
914
|
+
return __generator(this, function (_e) {
|
|
915
|
+
switch (_e.label) {
|
|
916
|
+
case 0:
|
|
917
|
+
event = this.allocateEvent(FederatedTouchEvent);
|
|
918
|
+
event.isTrusted = from.isTrusted;
|
|
919
|
+
event.timeStamp = performance.now();
|
|
920
|
+
event.type = from.type;
|
|
921
|
+
event.detail = from.detail;
|
|
922
|
+
event.nativeEvent = from.nativeEvent;
|
|
923
|
+
event.originalEvent = from;
|
|
924
|
+
this.copyTouchData(from, event);
|
|
925
|
+
i = 0;
|
|
926
|
+
_e.label = 1;
|
|
927
|
+
|
|
928
|
+
case 1:
|
|
929
|
+
if (!(i < from.changedTouches.length)) return [3
|
|
930
|
+
/*break*/
|
|
931
|
+
, 5];
|
|
932
|
+
touch = from.changedTouches[i];
|
|
933
|
+
isFromCanvas = this.isNativeEventFromCanvas(from);
|
|
934
|
+
_a = touch;
|
|
935
|
+
_b = isFromCanvas;
|
|
936
|
+
if (!_b) return [3
|
|
937
|
+
/*break*/
|
|
938
|
+
, 3];
|
|
939
|
+
return [4
|
|
940
|
+
/*yield*/
|
|
941
|
+
, this.pickTarget(touch)];
|
|
942
|
+
|
|
943
|
+
case 2:
|
|
944
|
+
_b = _e.sent();
|
|
945
|
+
_e.label = 3;
|
|
946
|
+
|
|
947
|
+
case 3:
|
|
948
|
+
_a.target = _b;
|
|
949
|
+
_e.label = 4;
|
|
950
|
+
|
|
951
|
+
case 4:
|
|
952
|
+
i++;
|
|
953
|
+
return [3
|
|
954
|
+
/*break*/
|
|
955
|
+
, 1];
|
|
956
|
+
|
|
957
|
+
case 5:
|
|
958
|
+
i = 0;
|
|
959
|
+
_e.label = 6;
|
|
960
|
+
|
|
961
|
+
case 6:
|
|
962
|
+
if (!(i < from.touches.length)) return [3
|
|
963
|
+
/*break*/
|
|
964
|
+
, 10];
|
|
965
|
+
touch = from.touches[i];
|
|
966
|
+
isFromCanvas = this.isNativeEventFromCanvas(from);
|
|
967
|
+
_c = touch;
|
|
968
|
+
_d = isFromCanvas;
|
|
969
|
+
if (!_d) return [3
|
|
970
|
+
/*break*/
|
|
971
|
+
, 8];
|
|
972
|
+
return [4
|
|
973
|
+
/*yield*/
|
|
974
|
+
, this.pickTarget(touch)];
|
|
975
|
+
|
|
976
|
+
case 7:
|
|
977
|
+
_d = _e.sent();
|
|
978
|
+
_e.label = 8;
|
|
979
|
+
|
|
980
|
+
case 8:
|
|
981
|
+
_c.target = _d;
|
|
982
|
+
_e.label = 9;
|
|
983
|
+
|
|
984
|
+
case 9:
|
|
985
|
+
i++;
|
|
986
|
+
return [3
|
|
987
|
+
/*break*/
|
|
988
|
+
, 6];
|
|
989
|
+
|
|
990
|
+
case 10:
|
|
991
|
+
event.touches = from.touches;
|
|
992
|
+
event.changedTouches = from.changedTouches;
|
|
993
|
+
return [2
|
|
994
|
+
/*return*/
|
|
995
|
+
, event];
|
|
996
|
+
}
|
|
997
|
+
});
|
|
998
|
+
});
|
|
999
|
+
};
|
|
1000
|
+
|
|
753
1001
|
EventService.prototype.createWheelEvent = function (from) {
|
|
754
1002
|
return __awaiter(this, void 0, void 0, function () {
|
|
755
1003
|
var event, isFromCanvas, _a, _b;
|
|
@@ -771,14 +1019,7 @@ var EventService = function (_super) {
|
|
|
771
1019
|
, 2];
|
|
772
1020
|
return [4
|
|
773
1021
|
/*yield*/
|
|
774
|
-
, this.
|
|
775
|
-
clientX: event.clientX,
|
|
776
|
-
clientY: event.clientY,
|
|
777
|
-
viewportX: event.viewportX,
|
|
778
|
-
viewportY: event.viewportY,
|
|
779
|
-
x: event.global.x,
|
|
780
|
-
y: event.global.y
|
|
781
|
-
})];
|
|
1022
|
+
, this.pickTarget(event)];
|
|
782
1023
|
|
|
783
1024
|
case 1:
|
|
784
1025
|
_b = _c.sent();
|
|
@@ -840,6 +1081,7 @@ var EventService = function (_super) {
|
|
|
840
1081
|
to.buttons = from.buttons;
|
|
841
1082
|
to.ctrlKey = from.ctrlKey;
|
|
842
1083
|
to.metaKey = from.metaKey;
|
|
1084
|
+
to.shiftKey = from.shiftKey;
|
|
843
1085
|
to.client.copyFrom(from.client);
|
|
844
1086
|
to.movement.copyFrom(from.movement);
|
|
845
1087
|
to.canvas.copyFrom(from.canvas);
|
|
@@ -848,6 +1090,20 @@ var EventService = function (_super) {
|
|
|
848
1090
|
to.offset.copyFrom(from.offset);
|
|
849
1091
|
};
|
|
850
1092
|
|
|
1093
|
+
EventService.prototype.copyTouchData = function (from, to) {
|
|
1094
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1095
|
+
return __generator(this, function (_a) {
|
|
1096
|
+
to.altKey = from.altKey;
|
|
1097
|
+
to.ctrlKey = from.ctrlKey;
|
|
1098
|
+
to.metaKey = from.metaKey;
|
|
1099
|
+
to.shiftKey = from.shiftKey;
|
|
1100
|
+
return [2
|
|
1101
|
+
/*return*/
|
|
1102
|
+
];
|
|
1103
|
+
});
|
|
1104
|
+
});
|
|
1105
|
+
};
|
|
1106
|
+
|
|
851
1107
|
EventService.prototype.copyWheelData = function (from, to) {
|
|
852
1108
|
to.deltaMode = from.deltaMode;
|
|
853
1109
|
to.deltaX = from.deltaX;
|
|
@@ -893,7 +1149,7 @@ var EventService = function (_super) {
|
|
|
893
1149
|
|
|
894
1150
|
EventService.prototype.notifyTarget = function (e, type) {
|
|
895
1151
|
type = type !== null && type !== void 0 ? type : e.type;
|
|
896
|
-
var key = e.eventPhase === e.CAPTURING_PHASE || e.eventPhase === e.AT_TARGET ? type
|
|
1152
|
+
var key = e.eventPhase === e.CAPTURING_PHASE || e.eventPhase === e.AT_TARGET ? "".concat(type, "capture") : type;
|
|
897
1153
|
this.notifyListeners(e, key);
|
|
898
1154
|
|
|
899
1155
|
if (e.eventPhase === e.AT_TARGET) {
|
|
@@ -7,7 +7,9 @@ import { singleton } from 'mana-syringe';
|
|
|
7
7
|
* - g-plugin-webgl-renderer `ctx.createLinearGradient` and generate texture
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
var OffscreenCanvasCreator =
|
|
10
|
+
var OffscreenCanvasCreator =
|
|
11
|
+
/** @class */
|
|
12
|
+
function () {
|
|
11
13
|
function OffscreenCanvasCreator() {}
|
|
12
14
|
|
|
13
15
|
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(): {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __awaiter, __decorate, __generator, __metadata } from "tslib";
|
|
2
2
|
import { inject, singleton, contrib, Syringe, Contribution } from 'mana-syringe';
|
|
3
|
-
import { SyncHook, SyncWaterfallHook, AsyncParallelHook, AsyncSeriesWaterfallHook } from '
|
|
3
|
+
import { SyncHook, SyncWaterfallHook, AsyncParallelHook, AsyncSeriesWaterfallHook } from '../utils';
|
|
4
4
|
import { StyleValueRegistry } from '../css';
|
|
5
5
|
import { ElementEvent } from '../dom';
|
|
6
6
|
import { RenderingContext, RenderReason } from './RenderingContext';
|
|
@@ -16,7 +16,9 @@ export var RenderingPluginContribution = Syringe.defineToken('RenderingPluginCon
|
|
|
16
16
|
* * end frame
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
var RenderingService =
|
|
19
|
+
var RenderingService =
|
|
20
|
+
/** @class */
|
|
21
|
+
function () {
|
|
20
22
|
function RenderingService() {
|
|
21
23
|
this.inited = false;
|
|
22
24
|
this.stats = {
|
|
@@ -45,49 +47,50 @@ var RenderingService = function () {
|
|
|
45
47
|
/**
|
|
46
48
|
* only dirty object which has sth changed will be rendered
|
|
47
49
|
*/
|
|
48
|
-
dirtycheck: new SyncWaterfallHook(
|
|
50
|
+
dirtycheck: new SyncWaterfallHook(),
|
|
49
51
|
|
|
50
52
|
/**
|
|
51
53
|
* do culling
|
|
52
54
|
*/
|
|
53
|
-
cull: new SyncWaterfallHook(
|
|
55
|
+
cull: new SyncWaterfallHook(),
|
|
54
56
|
|
|
55
57
|
/**
|
|
56
58
|
* called at beginning of each frame, won't get called if nothing to re-render
|
|
57
59
|
*/
|
|
58
|
-
beginFrame: new SyncHook(
|
|
60
|
+
beginFrame: new SyncHook(),
|
|
59
61
|
|
|
60
62
|
/**
|
|
61
63
|
* called before every dirty object get rendered
|
|
62
64
|
*/
|
|
63
|
-
beforeRender: new SyncHook(
|
|
65
|
+
beforeRender: new SyncHook(),
|
|
64
66
|
|
|
65
67
|
/**
|
|
66
68
|
* called when every dirty object rendering even it's culled
|
|
67
69
|
*/
|
|
68
|
-
render: new SyncHook(
|
|
70
|
+
render: new SyncHook(),
|
|
69
71
|
|
|
70
72
|
/**
|
|
71
73
|
* called after every dirty object get rendered
|
|
72
74
|
*/
|
|
73
|
-
afterRender: new SyncHook(
|
|
74
|
-
endFrame: new SyncHook(
|
|
75
|
-
destroy: new SyncHook(
|
|
75
|
+
afterRender: new SyncHook(),
|
|
76
|
+
endFrame: new SyncHook(),
|
|
77
|
+
destroy: new SyncHook(),
|
|
76
78
|
|
|
77
79
|
/**
|
|
78
80
|
* use async but faster method such as GPU-based picking in `g-plugin-webgl-renderer`
|
|
79
81
|
*/
|
|
80
|
-
pick: new AsyncSeriesWaterfallHook(
|
|
82
|
+
pick: new AsyncSeriesWaterfallHook(),
|
|
81
83
|
|
|
82
84
|
/**
|
|
83
85
|
* used in event system
|
|
84
86
|
*/
|
|
85
|
-
pointerDown: new SyncHook(
|
|
86
|
-
pointerUp: new SyncHook(
|
|
87
|
-
pointerMove: new SyncHook(
|
|
88
|
-
pointerOut: new SyncHook(
|
|
89
|
-
pointerOver: new SyncHook(
|
|
90
|
-
|
|
87
|
+
pointerDown: new SyncHook(),
|
|
88
|
+
pointerUp: new SyncHook(),
|
|
89
|
+
pointerMove: new SyncHook(),
|
|
90
|
+
pointerOut: new SyncHook(),
|
|
91
|
+
pointerOver: new SyncHook(),
|
|
92
|
+
pointerCancel: new SyncHook(),
|
|
93
|
+
pointerWheel: new SyncHook()
|
|
91
94
|
};
|
|
92
95
|
}
|
|
93
96
|
|
|
@@ -106,7 +109,7 @@ var RenderingService = function () {
|
|
|
106
109
|
});
|
|
107
110
|
return [4
|
|
108
111
|
/*yield*/
|
|
109
|
-
, this.hooks.init.
|
|
112
|
+
, this.hooks.init.callPromise()];
|
|
110
113
|
|
|
111
114
|
case 1:
|
|
112
115
|
_a.sent();
|
|
@@ -15,7 +15,9 @@ var NAME_REGEXP = /\[\s*name=(.*)\s*\]/;
|
|
|
15
15
|
* * querySelectorAll
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
var DefaultSceneGraphSelector =
|
|
18
|
+
var DefaultSceneGraphSelector =
|
|
19
|
+
/** @class */
|
|
20
|
+
function () {
|
|
19
21
|
function DefaultSceneGraphSelector() {}
|
|
20
22
|
|
|
21
23
|
DefaultSceneGraphSelector.prototype.selectOne = function (query, root) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __decorate, __metadata, __read } from "tslib";
|
|
2
2
|
import { inject, singleton, Syringe } from 'mana-syringe';
|
|
3
|
-
import { isNil } from '@antv/util';
|
|
4
3
|
import { mat4, quat, vec3 } from 'gl-matrix';
|
|
5
4
|
import { AABB, Rectangle } from '../shapes';
|
|
6
5
|
import { SceneGraphSelectorFactory } from './SceneGraphSelector';
|
|
7
6
|
import { ElementEvent } from '../dom/interfaces';
|
|
8
7
|
import { MutationEvent } from '../dom/MutationEvent';
|
|
8
|
+
import { isNil } from '../utils';
|
|
9
9
|
export function sortByZIndex(o1, o2) {
|
|
10
10
|
var zIndex1 = Number(o1.style.zIndex);
|
|
11
11
|
var zIndex2 = Number(o2.style.zIndex);
|
|
@@ -52,7 +52,9 @@ export var SceneGraphService = Syringe.defineToken('SceneGraphService');
|
|
|
52
52
|
* @see https://community.khronos.org/t/scene-graphs/50542/7
|
|
53
53
|
*/
|
|
54
54
|
|
|
55
|
-
var DefaultSceneGraphService =
|
|
55
|
+
var DefaultSceneGraphService =
|
|
56
|
+
/** @class */
|
|
57
|
+
function () {
|
|
56
58
|
function DefaultSceneGraphService() {
|
|
57
59
|
var _this = this;
|
|
58
60
|
/**
|
|
@@ -24,10 +24,12 @@ var regexCannotStartJaJp = /[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾー
|
|
|
24
24
|
var regexCannotEndJaJp = /[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/;
|
|
25
25
|
var regexCannotStartKoKr = /[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/;
|
|
26
26
|
var regexCannotEndKoKr = /[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/;
|
|
27
|
-
var regexCannotStart = new RegExp(regexCannotStartZhCn.source
|
|
28
|
-
var regexCannotEnd = new RegExp(regexCannotEndZhCn.source
|
|
27
|
+
var regexCannotStart = new RegExp("".concat(regexCannotStartZhCn.source, "|").concat(regexCannotStartZhTw.source, "|").concat(regexCannotStartJaJp.source, "|").concat(regexCannotStartKoKr.source));
|
|
28
|
+
var regexCannotEnd = new RegExp("".concat(regexCannotEndZhCn.source, "|").concat(regexCannotEndZhTw.source, "|").concat(regexCannotEndJaJp.source, "|").concat(regexCannotEndKoKr.source));
|
|
29
29
|
|
|
30
|
-
var TextService =
|
|
30
|
+
var TextService =
|
|
31
|
+
/** @class */
|
|
32
|
+
function () {
|
|
31
33
|
function TextService() {
|
|
32
34
|
var _this = this;
|
|
33
35
|
|
|
@@ -3,7 +3,9 @@ import { singleton } from 'mana-syringe';
|
|
|
3
3
|
import { GeometryAABBUpdater } from './interfaces';
|
|
4
4
|
import { Shape } from '../../types';
|
|
5
5
|
|
|
6
|
-
var CircleUpdater =
|
|
6
|
+
var CircleUpdater =
|
|
7
|
+
/** @class */
|
|
8
|
+
function () {
|
|
7
9
|
function CircleUpdater() {}
|
|
8
10
|
|
|
9
11
|
CircleUpdater.prototype.update = function (parsedStyle, object) {
|
|
@@ -3,7 +3,9 @@ import { singleton } from 'mana-syringe';
|
|
|
3
3
|
import { GeometryAABBUpdater } from './interfaces';
|
|
4
4
|
import { Shape } from '../../types';
|
|
5
5
|
|
|
6
|
-
var EllipseUpdater =
|
|
6
|
+
var EllipseUpdater =
|
|
7
|
+
/** @class */
|
|
8
|
+
function () {
|
|
7
9
|
function EllipseUpdater() {}
|
|
8
10
|
|
|
9
11
|
EllipseUpdater.prototype.update = function (parsedStyle, object) {
|
|
@@ -3,7 +3,9 @@ import { singleton } from 'mana-syringe';
|
|
|
3
3
|
import { GeometryAABBUpdater } from './interfaces';
|
|
4
4
|
import { Shape } from '../../types';
|
|
5
5
|
|
|
6
|
-
var LineUpdater =
|
|
6
|
+
var LineUpdater =
|
|
7
|
+
/** @class */
|
|
8
|
+
function () {
|
|
7
9
|
function LineUpdater() {}
|
|
8
10
|
|
|
9
11
|
LineUpdater.prototype.update = function (parsedStyle) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GeometryAABBUpdater } from './interfaces';
|
|
2
|
-
import type {
|
|
3
|
-
export declare class PathUpdater implements GeometryAABBUpdater<
|
|
4
|
-
update(parsedStyle:
|
|
2
|
+
import type { ParsedPathStyleProps } from '../../display-objects';
|
|
3
|
+
export declare class PathUpdater implements GeometryAABBUpdater<ParsedPathStyleProps> {
|
|
4
|
+
update(parsedStyle: ParsedPathStyleProps): {
|
|
5
5
|
width: number;
|
|
6
6
|
height: number;
|
|
7
7
|
x: number;
|
|
@@ -3,7 +3,9 @@ import { singleton } from 'mana-syringe';
|
|
|
3
3
|
import { GeometryAABBUpdater } from './interfaces';
|
|
4
4
|
import { Shape } from '../../types';
|
|
5
5
|
|
|
6
|
-
var PathUpdater =
|
|
6
|
+
var PathUpdater =
|
|
7
|
+
/** @class */
|
|
8
|
+
function () {
|
|
7
9
|
function PathUpdater() {}
|
|
8
10
|
|
|
9
11
|
PathUpdater.prototype.update = function (parsedStyle) {
|