@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
|
@@ -9,7 +9,9 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _FederatedMouseEvent = require("./FederatedMouseEvent");
|
|
11
11
|
|
|
12
|
-
var FederatedWheelEvent =
|
|
12
|
+
var FederatedWheelEvent =
|
|
13
|
+
/** @class */
|
|
14
|
+
function (_super) {
|
|
13
15
|
(0, _tslib.__extends)(FederatedWheelEvent, _super);
|
|
14
16
|
|
|
15
17
|
function FederatedWheelEvent() {
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.KeyframeEffect = void 0;
|
|
6
7
|
exports.makeTiming = makeTiming;
|
|
7
8
|
exports.normalizeTimingInput = normalizeTimingInput;
|
|
8
9
|
exports.numericTimingToObject = numericTimingToObject;
|
|
9
|
-
exports.KeyframeEffect = void 0;
|
|
10
10
|
|
|
11
11
|
var _animation = require("../utils/animation");
|
|
12
12
|
|
|
@@ -92,7 +92,9 @@ function numericTimingToObject(timingInput) {
|
|
|
92
92
|
*/
|
|
93
93
|
|
|
94
94
|
|
|
95
|
-
var KeyframeEffect =
|
|
95
|
+
var KeyframeEffect =
|
|
96
|
+
/** @class */
|
|
97
|
+
function () {
|
|
96
98
|
function KeyframeEffect(target, effectInput, timingInput) {
|
|
97
99
|
var _this = this;
|
|
98
100
|
|
package/lib/dom/KeyframeList.js
CHANGED
|
@@ -102,7 +102,7 @@ function normalizeKeyframes(effectInput, timing) {
|
|
|
102
102
|
// TODO: Support add & accumulate in KeyframeEffect.composite
|
|
103
103
|
// @see https://developer.mozilla.org/en-US/docs/Web/API/KeyframeEffect/composite
|
|
104
104
|
if (['replace', 'add', 'accumulate', 'auto'].indexOf(memberValue) === -1) {
|
|
105
|
-
throw new Error(memberValue
|
|
105
|
+
throw new Error("".concat(memberValue, " compositing is not supported"));
|
|
106
106
|
}
|
|
107
107
|
} else if (member === 'easing') {// TODO: Validate animation-timing-function
|
|
108
108
|
// @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timing-function
|
package/lib/dom/MutationEvent.js
CHANGED
|
@@ -9,7 +9,9 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _FederatedEvent = require("./FederatedEvent");
|
|
11
11
|
|
|
12
|
-
var MutationEvent =
|
|
12
|
+
var MutationEvent =
|
|
13
|
+
/** @class */
|
|
14
|
+
function (_super) {
|
|
13
15
|
(0, _tslib.__extends)(MutationEvent, _super);
|
|
14
16
|
|
|
15
17
|
function MutationEvent(typeArg, relatedNode, prevValue, newValue, attrName, attrChange, prevParsedValue, newParsedValue) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.Registration = exports.MutationObserver = void 0;
|
|
7
7
|
|
|
8
8
|
var _interfaces = require("./interfaces");
|
|
9
9
|
|
|
@@ -14,7 +14,9 @@ var _MutationRecord = require("./MutationRecord");
|
|
|
14
14
|
var uidCounter = 0;
|
|
15
15
|
var registrationsTable = new WeakMap();
|
|
16
16
|
|
|
17
|
-
var Registration =
|
|
17
|
+
var Registration =
|
|
18
|
+
/** @class */
|
|
19
|
+
function () {
|
|
18
20
|
function Registration(observer, target, options) {
|
|
19
21
|
this.observer = observer;
|
|
20
22
|
this.target = target;
|
|
@@ -204,7 +206,9 @@ exports.Registration = Registration;
|
|
|
204
206
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
|
|
205
207
|
* @see https://github.com/googlearchive/MutationObservers/blob/master/MutationObserver.js
|
|
206
208
|
*/
|
|
207
|
-
var MutationObserver =
|
|
209
|
+
var MutationObserver =
|
|
210
|
+
/** @class */
|
|
211
|
+
function () {
|
|
208
212
|
function MutationObserver(callback) {
|
|
209
213
|
this.callback = callback;
|
|
210
214
|
this.nodes = [];
|
|
@@ -214,7 +218,10 @@ var MutationObserver = function () {
|
|
|
214
218
|
|
|
215
219
|
MutationObserver.prototype.observe = function (target, options) {
|
|
216
220
|
// 1.1
|
|
217
|
-
if (!options.childList && !options.attributes && !options.characterData ||
|
|
221
|
+
if (!options.childList && !options.attributes && !options.characterData || // 1.2
|
|
222
|
+
options.attributeOldValue && !options.attributes || // 1.3
|
|
223
|
+
options.attributeFilter && options.attributeFilter.length && !options.attributes || // 1.4
|
|
224
|
+
options.characterDataOldValue && !options.characterData) {
|
|
218
225
|
throw new SyntaxError();
|
|
219
226
|
}
|
|
220
227
|
|
|
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.MutationRecord = void 0;
|
|
7
7
|
|
|
8
|
-
var MutationRecord =
|
|
8
|
+
var MutationRecord =
|
|
9
|
+
/** @class */
|
|
10
|
+
function () {
|
|
9
11
|
function MutationRecord(type, target) {
|
|
10
12
|
this.type = type;
|
|
11
13
|
this.target = target;
|
package/lib/dom/Node.js
CHANGED
|
@@ -16,7 +16,9 @@ var _EventTarget = require("./EventTarget");
|
|
|
16
16
|
/**
|
|
17
17
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Node
|
|
18
18
|
*/
|
|
19
|
-
var Node =
|
|
19
|
+
var Node =
|
|
20
|
+
/** @class */
|
|
21
|
+
function (_super) {
|
|
20
22
|
(0, _tslib.__extends)(Node, _super);
|
|
21
23
|
|
|
22
24
|
function Node() {
|
|
@@ -125,7 +127,7 @@ var Node = function (_super) {
|
|
|
125
127
|
|
|
126
128
|
if (this.nodeName === _types.Shape.TEXT) {
|
|
127
129
|
// @ts-ignore
|
|
128
|
-
this.style.text = ""
|
|
130
|
+
this.style.text = "".concat(content);
|
|
129
131
|
} else {// this.appendChild(
|
|
130
132
|
// new Text({
|
|
131
133
|
// style: {
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -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
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.CullingStrategyContribution = exports.CullingPlugin = void 0;
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
@@ -21,14 +21,14 @@ var CullingStrategyContribution = _manaSyringe.Syringe.defineToken('CullingStrat
|
|
|
21
21
|
|
|
22
22
|
exports.CullingStrategyContribution = CullingStrategyContribution;
|
|
23
23
|
|
|
24
|
-
var CullingPlugin =
|
|
24
|
+
var CullingPlugin =
|
|
25
|
+
/** @class */
|
|
26
|
+
function () {
|
|
25
27
|
function CullingPlugin() {}
|
|
26
28
|
|
|
27
|
-
CullingPlugin_1 = CullingPlugin;
|
|
28
|
-
|
|
29
29
|
CullingPlugin.prototype.apply = function (renderingService) {
|
|
30
30
|
var strategies = this.strategyProvider.getContributions();
|
|
31
|
-
renderingService.hooks.cull.tap(
|
|
31
|
+
renderingService.hooks.cull.tap(function (object) {
|
|
32
32
|
if (object) {
|
|
33
33
|
var cullable = object.cullable;
|
|
34
34
|
|
|
@@ -50,15 +50,13 @@ var CullingPlugin = function () {
|
|
|
50
50
|
|
|
51
51
|
return object;
|
|
52
52
|
});
|
|
53
|
-
renderingService.hooks.afterRender.tap(
|
|
53
|
+
renderingService.hooks.afterRender.tap(function (object) {
|
|
54
54
|
object.cullable.visibilityPlaneMask = -1;
|
|
55
55
|
});
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
var CullingPlugin_1;
|
|
59
|
-
CullingPlugin.tag = 'CullingPlugin';
|
|
60
58
|
(0, _tslib.__decorate)([(0, _manaSyringe.contrib)(CullingStrategyContribution), (0, _tslib.__metadata)("design:type", Object)], CullingPlugin.prototype, "strategyProvider", void 0);
|
|
61
|
-
CullingPlugin =
|
|
59
|
+
CullingPlugin = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)({
|
|
62
60
|
contrib: _RenderingService.RenderingPluginContribution
|
|
63
61
|
})], CullingPlugin);
|
|
64
62
|
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
|
}
|
|
@@ -9,6 +9,8 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _manaSyringe = require("mana-syringe");
|
|
11
11
|
|
|
12
|
+
var _types = require("../types");
|
|
13
|
+
|
|
12
14
|
var _RenderingService = require("../services/RenderingService");
|
|
13
15
|
|
|
14
16
|
var _RenderingContext = require("../services/RenderingContext");
|
|
@@ -16,21 +18,24 @@ var _RenderingContext = require("../services/RenderingContext");
|
|
|
16
18
|
/**
|
|
17
19
|
* Filter dirty renderables and calculate the "dirty rectangle" which will be clear when frame began
|
|
18
20
|
*/
|
|
19
|
-
var DirtyCheckPlugin =
|
|
21
|
+
var DirtyCheckPlugin =
|
|
22
|
+
/** @class */
|
|
23
|
+
function () {
|
|
20
24
|
function DirtyCheckPlugin() {}
|
|
21
25
|
|
|
22
|
-
DirtyCheckPlugin_1 = DirtyCheckPlugin;
|
|
23
|
-
|
|
24
26
|
DirtyCheckPlugin.prototype.apply = function (renderingService) {
|
|
25
27
|
var _this = this;
|
|
26
28
|
|
|
27
|
-
renderingService.hooks.dirtycheck.tap(
|
|
29
|
+
renderingService.hooks.dirtycheck.tap(function (object) {
|
|
28
30
|
if (object) {
|
|
29
|
-
|
|
31
|
+
var enableDirtyCheck = _this.canvasConfig.renderer.getConfig().enableDirtyCheck;
|
|
32
|
+
|
|
30
33
|
var renderable = object.renderable;
|
|
31
34
|
|
|
32
|
-
var
|
|
35
|
+
var isCameraDirty = _this.renderingContext.renderReasons.has(_RenderingContext.RenderReason.CAMERA_CHANGED);
|
|
33
36
|
|
|
37
|
+
var isRenderingContextDirty = _this.renderingContext.dirty;
|
|
38
|
+
var isDirty = renderable.dirty || isCameraDirty || (enableDirtyCheck ? false : isRenderingContextDirty);
|
|
34
39
|
|
|
35
40
|
if (isDirty) {
|
|
36
41
|
return object;
|
|
@@ -43,10 +48,9 @@ var DirtyCheckPlugin = function () {
|
|
|
43
48
|
});
|
|
44
49
|
};
|
|
45
50
|
|
|
46
|
-
|
|
47
|
-
DirtyCheckPlugin.tag = 'DirtyCheckPlugin';
|
|
51
|
+
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_types.CanvasConfig), (0, _tslib.__metadata)("design:type", Object)], DirtyCheckPlugin.prototype, "canvasConfig", void 0);
|
|
48
52
|
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_RenderingContext.RenderingContext), (0, _tslib.__metadata)("design:type", Object)], DirtyCheckPlugin.prototype, "renderingContext", void 0);
|
|
49
|
-
DirtyCheckPlugin =
|
|
53
|
+
DirtyCheckPlugin = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)({
|
|
50
54
|
contrib: _RenderingService.RenderingPluginContribution
|
|
51
55
|
})], DirtyCheckPlugin);
|
|
52
56
|
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
|
/**
|