@antv/g 5.0.22-alpha.1 → 5.0.22-alpha.4
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/es/AbstractRenderer.js +1 -3
- package/es/Canvas.d.ts +0 -3
- package/es/Canvas.js +1 -3
- package/es/DisplayObjectPool.js +1 -3
- package/es/camera/Camera.js +1 -3
- package/es/camera/Landmark.js +1 -3
- package/es/components/Cullable.js +1 -3
- package/es/components/Geometry.js +1 -3
- package/es/components/Renderable.js +1 -3
- package/es/components/Sortable.js +1 -3
- package/es/components/Transform.js +1 -3
- package/es/css/CSSProperty.d.ts +1 -1
- package/es/css/LayoutRegistry.js +1 -3
- package/es/css/StyleValueRegistry.d.ts +2 -1
- package/es/css/StyleValueRegistry.js +6 -7
- package/es/css/cssom/CSSColorValue.js +1 -3
- package/es/css/cssom/CSSGradientValue.js +6 -8
- package/es/css/cssom/CSSKeywordValue.js +1 -3
- package/es/css/cssom/CSSMathInvert.js +1 -3
- package/es/css/cssom/CSSMathMax.js +1 -3
- package/es/css/cssom/CSSMathMin.js +1 -3
- package/es/css/cssom/CSSMathNegate.js +1 -3
- package/es/css/cssom/CSSMathProduct.js +1 -3
- package/es/css/cssom/CSSMathSum.js +1 -3
- package/es/css/cssom/CSSMathValue.js +1 -3
- package/es/css/cssom/CSSMathVariadic.js +1 -3
- package/es/css/cssom/CSSNumericValue.js +1 -3
- package/es/css/cssom/CSSNumericValueType.d.ts +1 -1
- package/es/css/cssom/CSSNumericValueType.js +1 -3
- package/es/css/cssom/CSSRGB.js +2 -4
- package/es/css/cssom/CSSStyleValue.d.ts +1 -1
- package/es/css/cssom/CSSStyleValue.js +1 -3
- package/es/css/cssom/CSSTransformComponent.js +1 -3
- package/es/css/cssom/CSSTransformValue.js +1 -3
- package/es/css/cssom/CSSTranslate.js +1 -3
- package/es/css/cssom/CSSUnitValue.js +2 -4
- package/es/css/parser/color.js +1 -1
- package/es/css/parser/dimension.js +1 -1
- package/es/css/parser/transform-origin.d.ts +1 -1
- package/es/css/parser/transform-origin.js +2 -2
- package/es/css/parser/transform.d.ts +1 -1
- package/es/css/parser/transform.js +2 -2
- package/es/css/properties/CSSPropertyAnchor.js +1 -3
- package/es/css/properties/CSSPropertyClipPath.js +1 -3
- package/es/css/properties/CSSPropertyColor.js +1 -3
- package/es/css/properties/CSSPropertyFilter.js +1 -3
- package/es/css/properties/CSSPropertyLengthOrPercentage.js +1 -3
- package/es/css/properties/CSSPropertyLineDash.js +1 -3
- package/es/css/properties/CSSPropertyLocalPosition.js +1 -3
- package/es/css/properties/CSSPropertyOffsetDistance.js +1 -3
- package/es/css/properties/CSSPropertyOffsetPath.js +1 -3
- package/es/css/properties/CSSPropertyOpacity.js +1 -3
- package/es/css/properties/CSSPropertyPath.js +1 -3
- package/es/css/properties/CSSPropertyPoints.js +1 -3
- package/es/css/properties/CSSPropertyShadowBlur.js +1 -3
- package/es/css/properties/CSSPropertyText.js +2 -4
- package/es/css/properties/CSSPropertyTextTransform.js +1 -3
- package/es/css/properties/CSSPropertyTransform.js +1 -3
- package/es/css/properties/CSSPropertyTransformOrigin.js +1 -3
- package/es/css/properties/CSSPropertyVisibility.js +1 -3
- package/es/css/properties/CSSPropertyZIndex.js +1 -3
- package/es/display-objects/Circle.js +1 -3
- package/es/display-objects/CustomElement.js +1 -3
- package/es/display-objects/DisplayObject.js +3 -6
- package/es/display-objects/Ellipse.js +1 -3
- package/es/display-objects/Group.js +1 -3
- package/es/display-objects/HTML.js +3 -6
- package/es/display-objects/Image.js +1 -3
- package/es/display-objects/Line.js +1 -3
- package/es/display-objects/Path.js +1 -3
- package/es/display-objects/Polygon.js +1 -3
- package/es/display-objects/Polyline.js +1 -3
- package/es/display-objects/Rect.js +1 -3
- package/es/display-objects/Text.js +3 -6
- package/es/dom/Animation.js +2 -4
- package/es/dom/AnimationEffectTiming.js +1 -3
- package/es/dom/AnimationEvent.js +1 -3
- package/es/dom/AnimationTimeline.js +1 -3
- package/es/dom/CustomElementRegistry.js +1 -3
- package/es/dom/CustomEvent.js +1 -3
- package/es/dom/Document.js +1 -3
- package/es/dom/Element.js +5 -7
- package/es/dom/EventTarget.js +3 -5
- package/es/dom/FederatedEvent.js +1 -3
- package/es/dom/FederatedMouseEvent.js +1 -3
- package/es/dom/FederatedPointerEvent.js +1 -3
- package/es/dom/FederatedWheelEvent.js +1 -3
- package/es/dom/KeyframeEffect.js +1 -3
- package/es/dom/KeyframeList.js +1 -1
- package/es/dom/MutationEvent.d.ts +1 -1
- package/es/dom/MutationEvent.js +1 -3
- package/es/dom/MutationObserver.d.ts +2 -1
- package/es/dom/MutationObserver.js +4 -11
- package/es/dom/MutationRecord.d.ts +1 -1
- package/es/dom/MutationRecord.js +1 -3
- package/es/dom/Node.js +3 -5
- package/es/dom/interfaces.d.ts +2 -1
- package/es/plugins/CullingPlugin.js +1 -3
- package/es/plugins/DirtyCheckPlugin.js +1 -3
- package/es/plugins/EventPlugin.js +1 -3
- package/es/plugins/FrustumCullingStrategy.js +2 -4
- package/es/plugins/PrepareRendererPlugin.d.ts +1 -1
- package/es/plugins/PrepareRendererPlugin.js +1 -3
- package/es/services/EventService.js +3 -5
- package/es/services/OffscreenCanvasCreator.js +1 -3
- package/es/services/RenderingService.d.ts +2 -2
- package/es/services/RenderingService.js +1 -3
- package/es/services/SceneGraphSelector.js +1 -3
- package/es/services/SceneGraphService.js +1 -3
- package/es/services/TextService.d.ts +2 -2
- package/es/services/TextService.js +5 -6
- package/es/services/aabb/CircleUpdater.js +1 -3
- package/es/services/aabb/EllipseUpdater.js +1 -3
- package/es/services/aabb/LineUpdater.js +1 -3
- package/es/services/aabb/PathUpdater.js +1 -3
- package/es/services/aabb/PolylineUpdater.js +1 -3
- package/es/services/aabb/RectUpdater.js +1 -3
- package/es/services/aabb/TextUpdater.js +1 -3
- package/es/shapes/AABB.js +1 -3
- package/es/shapes/BoundingSphere.js +1 -3
- package/es/shapes/Frustum.js +1 -3
- package/es/shapes/Plane.js +1 -3
- package/es/shapes/Point.js +1 -3
- package/es/shapes/Ray.js +1 -3
- package/es/shapes/Rectangle.js +1 -3
- package/es/types.d.ts +1 -2
- package/es/utils/custom-easing.js +1 -1
- package/es/utils/path.d.ts +2 -2
- package/es/utils/path.js +3 -3
- package/es/utils/text.js +3 -3
- package/lib/AbstractRenderer.js +1 -3
- package/lib/Canvas.d.ts +0 -3
- package/lib/Canvas.js +2 -4
- package/lib/DisplayObjectPool.js +1 -3
- package/lib/camera/Camera.js +2 -4
- package/lib/camera/Landmark.js +1 -3
- package/lib/components/Cullable.js +2 -4
- package/lib/components/Geometry.js +1 -3
- package/lib/components/Renderable.js +1 -3
- package/lib/components/Sortable.js +1 -3
- package/lib/components/Transform.js +1 -3
- package/lib/css/CSSProperty.d.ts +1 -1
- package/lib/css/LayoutRegistry.js +1 -3
- package/lib/css/StyleValueRegistry.d.ts +2 -1
- package/lib/css/StyleValueRegistry.js +15 -11
- package/lib/css/cssom/CSSColorValue.js +1 -3
- package/lib/css/cssom/CSSGradientValue.js +7 -9
- package/lib/css/cssom/CSSKeywordValue.js +1 -3
- package/lib/css/cssom/CSSMathInvert.js +1 -3
- package/lib/css/cssom/CSSMathMax.js +1 -3
- package/lib/css/cssom/CSSMathMin.js +1 -3
- package/lib/css/cssom/CSSMathNegate.js +1 -3
- package/lib/css/cssom/CSSMathOperator.js +1 -1
- package/lib/css/cssom/CSSMathProduct.js +1 -3
- package/lib/css/cssom/CSSMathSum.js +1 -3
- package/lib/css/cssom/CSSMathValue.js +1 -3
- package/lib/css/cssom/CSSMathVariadic.js +2 -4
- package/lib/css/cssom/CSSNumericValue.js +1 -3
- package/lib/css/cssom/CSSNumericValueType.d.ts +1 -1
- package/lib/css/cssom/CSSNumericValueType.js +3 -5
- package/lib/css/cssom/CSSRGB.js +2 -4
- package/lib/css/cssom/CSSStyleValue.d.ts +1 -1
- package/lib/css/cssom/CSSStyleValue.js +2 -4
- package/lib/css/cssom/CSSTransformComponent.js +2 -4
- package/lib/css/cssom/CSSTransformValue.js +1 -3
- package/lib/css/cssom/CSSTranslate.js +1 -3
- package/lib/css/cssom/CSSUnitValue.js +2 -4
- package/lib/css/cssom/types.js +1 -1
- package/lib/css/parser/color.js +3 -3
- package/lib/css/parser/dimension.js +6 -7
- package/lib/css/parser/numeric.js +3 -3
- package/lib/css/parser/path.js +1 -1
- package/lib/css/parser/transform-origin.d.ts +1 -1
- package/lib/css/parser/transform-origin.js +5 -3
- package/lib/css/parser/transform.d.ts +1 -1
- package/lib/css/parser/transform.js +11 -11
- package/lib/css/properties/CSSPropertyAnchor.js +1 -3
- package/lib/css/properties/CSSPropertyClipPath.js +1 -3
- package/lib/css/properties/CSSPropertyColor.js +1 -3
- package/lib/css/properties/CSSPropertyFilter.js +1 -3
- package/lib/css/properties/CSSPropertyLengthOrPercentage.js +1 -3
- package/lib/css/properties/CSSPropertyLineDash.js +1 -3
- package/lib/css/properties/CSSPropertyLocalPosition.js +1 -3
- package/lib/css/properties/CSSPropertyOffsetDistance.js +1 -3
- package/lib/css/properties/CSSPropertyOffsetPath.js +1 -3
- package/lib/css/properties/CSSPropertyOpacity.js +1 -3
- package/lib/css/properties/CSSPropertyPath.js +1 -3
- package/lib/css/properties/CSSPropertyPoints.js +1 -3
- package/lib/css/properties/CSSPropertyShadowBlur.js +1 -3
- package/lib/css/properties/CSSPropertyText.js +2 -4
- package/lib/css/properties/CSSPropertyTextTransform.js +1 -3
- package/lib/css/properties/CSSPropertyTransform.js +1 -3
- package/lib/css/properties/CSSPropertyTransformOrigin.js +1 -3
- package/lib/css/properties/CSSPropertyVisibility.js +1 -3
- package/lib/css/properties/CSSPropertyZIndex.js +1 -3
- package/lib/display-objects/Circle.js +1 -3
- package/lib/display-objects/CustomElement.js +1 -3
- package/lib/display-objects/DisplayObject.js +3 -6
- package/lib/display-objects/Ellipse.js +1 -3
- package/lib/display-objects/Group.js +1 -3
- package/lib/display-objects/HTML.js +4 -6
- package/lib/display-objects/Image.js +1 -3
- package/lib/display-objects/Line.js +1 -3
- package/lib/display-objects/Path.js +1 -3
- package/lib/display-objects/Polygon.js +1 -3
- package/lib/display-objects/Polyline.js +1 -3
- package/lib/display-objects/Rect.js +1 -3
- package/lib/display-objects/Text.js +4 -6
- package/lib/dom/Animation.js +2 -4
- package/lib/dom/AnimationEffectTiming.js +1 -3
- package/lib/dom/AnimationEvent.js +1 -3
- package/lib/dom/AnimationTimeline.js +2 -4
- package/lib/dom/CustomElementRegistry.js +1 -3
- package/lib/dom/CustomEvent.js +1 -3
- package/lib/dom/Document.js +1 -3
- package/lib/dom/Element.js +7 -9
- package/lib/dom/EventTarget.js +3 -5
- package/lib/dom/FederatedEvent.js +1 -3
- package/lib/dom/FederatedMouseEvent.js +1 -3
- package/lib/dom/FederatedPointerEvent.js +1 -3
- package/lib/dom/FederatedWheelEvent.js +1 -3
- package/lib/dom/KeyframeEffect.js +2 -4
- package/lib/dom/KeyframeList.js +1 -1
- package/lib/dom/MutationEvent.d.ts +1 -1
- package/lib/dom/MutationEvent.js +1 -3
- package/lib/dom/MutationObserver.d.ts +2 -1
- package/lib/dom/MutationObserver.js +15 -22
- package/lib/dom/MutationRecord.d.ts +1 -1
- package/lib/dom/MutationRecord.js +1 -3
- package/lib/dom/Node.js +6 -8
- package/lib/dom/interfaces.d.ts +2 -1
- package/lib/index.js +1 -1
- package/lib/plugins/CullingPlugin.js +2 -4
- package/lib/plugins/DirtyCheckPlugin.js +1 -3
- package/lib/plugins/EventPlugin.js +1 -3
- package/lib/plugins/FrustumCullingStrategy.js +3 -5
- package/lib/plugins/PrepareRendererPlugin.d.ts +1 -1
- package/lib/plugins/PrepareRendererPlugin.js +1 -3
- package/lib/services/EventService.js +3 -5
- package/lib/services/OffscreenCanvasCreator.js +1 -3
- package/lib/services/RenderingService.d.ts +2 -2
- package/lib/services/RenderingService.js +1 -3
- package/lib/services/SceneGraphSelector.js +2 -4
- package/lib/services/SceneGraphService.js +3 -5
- package/lib/services/TextService.d.ts +2 -2
- package/lib/services/TextService.js +8 -8
- package/lib/services/aabb/CircleUpdater.js +1 -3
- package/lib/services/aabb/EllipseUpdater.js +1 -3
- package/lib/services/aabb/LineUpdater.js +1 -3
- package/lib/services/aabb/PathUpdater.js +1 -3
- package/lib/services/aabb/PolylineUpdater.js +1 -3
- package/lib/services/aabb/RectUpdater.js +1 -3
- package/lib/services/aabb/TextUpdater.js +1 -3
- package/lib/services/aabb/index.js +10 -10
- package/lib/services/aabb/interfaces.js +1 -1
- package/lib/shapes/AABB.js +1 -3
- package/lib/shapes/BoundingSphere.js +1 -3
- package/lib/shapes/Frustum.js +2 -4
- package/lib/shapes/Plane.js +1 -3
- package/lib/shapes/Point.js +1 -3
- package/lib/shapes/Ray.js +1 -3
- package/lib/shapes/Rectangle.js +1 -3
- package/lib/types.d.ts +1 -2
- package/lib/types.js +1 -1
- package/lib/utils/animation.js +2 -3
- package/lib/utils/bezier-easing.js +1 -1
- package/lib/utils/custom-easing.js +2 -2
- package/lib/utils/math.js +9 -9
- package/lib/utils/path.d.ts +2 -2
- package/lib/utils/path.js +6 -6
- package/lib/utils/text.js +3 -3
- package/package.json +1 -1
- package/dist/index.umd.min.js +0 -30
|
@@ -9,9 +9,7 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _FederatedMouseEvent = require("./FederatedMouseEvent");
|
|
11
11
|
|
|
12
|
-
var FederatedPointerEvent =
|
|
13
|
-
/** @class */
|
|
14
|
-
function (_super) {
|
|
12
|
+
var FederatedPointerEvent = function (_super) {
|
|
15
13
|
(0, _tslib.__extends)(FederatedPointerEvent, _super);
|
|
16
14
|
|
|
17
15
|
function FederatedPointerEvent() {
|
|
@@ -9,9 +9,7 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _FederatedMouseEvent = require("./FederatedMouseEvent");
|
|
11
11
|
|
|
12
|
-
var FederatedWheelEvent =
|
|
13
|
-
/** @class */
|
|
14
|
-
function (_super) {
|
|
12
|
+
var FederatedWheelEvent = function (_super) {
|
|
15
13
|
(0, _tslib.__extends)(FederatedWheelEvent, _super);
|
|
16
14
|
|
|
17
15
|
function FederatedWheelEvent() {
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.KeyframeEffect = void 0;
|
|
7
6
|
exports.makeTiming = makeTiming;
|
|
8
7
|
exports.normalizeTimingInput = normalizeTimingInput;
|
|
9
8
|
exports.numericTimingToObject = numericTimingToObject;
|
|
9
|
+
exports.KeyframeEffect = void 0;
|
|
10
10
|
|
|
11
11
|
var _animation = require("../utils/animation");
|
|
12
12
|
|
|
@@ -92,9 +92,7 @@ function numericTimingToObject(timingInput) {
|
|
|
92
92
|
*/
|
|
93
93
|
|
|
94
94
|
|
|
95
|
-
var KeyframeEffect =
|
|
96
|
-
/** @class */
|
|
97
|
-
function () {
|
|
95
|
+
var KeyframeEffect = function () {
|
|
98
96
|
function KeyframeEffect(target, effectInput, timingInput) {
|
|
99
97
|
var _this = this;
|
|
100
98
|
|
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(
|
|
105
|
+
throw new Error(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,9 +9,7 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _FederatedEvent = require("./FederatedEvent");
|
|
11
11
|
|
|
12
|
-
var MutationEvent =
|
|
13
|
-
/** @class */
|
|
14
|
-
function (_super) {
|
|
12
|
+
var MutationEvent = function (_super) {
|
|
15
13
|
(0, _tslib.__extends)(MutationEvent, _super);
|
|
16
14
|
|
|
17
15
|
function MutationEvent(typeArg, relatedNode, prevValue, newValue, attrName, attrChange, prevParsedValue, newParsedValue) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { IElement
|
|
1
|
+
import type { IElement } from './interfaces';
|
|
2
|
+
import type { DisplayObject } from '../display-objects';
|
|
2
3
|
import { MutationEvent } from './MutationEvent';
|
|
3
4
|
import { MutationRecord } from './MutationRecord';
|
|
4
5
|
export declare class Registration {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.MutationObserver = exports.Registration = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _interfaces = require("./interfaces");
|
|
9
9
|
|
|
10
10
|
var _MutationEvent = require("./MutationEvent");
|
|
11
11
|
|
|
@@ -14,9 +14,7 @@ var _MutationRecord = require("./MutationRecord");
|
|
|
14
14
|
var uidCounter = 0;
|
|
15
15
|
var registrationsTable = new WeakMap();
|
|
16
16
|
|
|
17
|
-
var Registration =
|
|
18
|
-
/** @class */
|
|
19
|
-
function () {
|
|
17
|
+
var Registration = function () {
|
|
20
18
|
function Registration(observer, target, options) {
|
|
21
19
|
this.observer = observer;
|
|
22
20
|
this.target = target;
|
|
@@ -52,10 +50,10 @@ function () {
|
|
|
52
50
|
|
|
53
51
|
Registration.prototype.addListeners_ = function (node) {
|
|
54
52
|
var options = this.options;
|
|
55
|
-
if (options.attributes) node.addEventListener(
|
|
53
|
+
if (options.attributes) node.addEventListener(_interfaces.ElementEvent.ATTR_MODIFIED, this, true); // if (options.characterData) node.addEventListener('DOMCharacterDataModified', this, true);
|
|
56
54
|
|
|
57
|
-
if (options.childList) node.addEventListener(
|
|
58
|
-
if (options.childList || options.subtree) node.addEventListener(
|
|
55
|
+
if (options.childList) node.addEventListener(_interfaces.ElementEvent.INSERTED, this, true);
|
|
56
|
+
if (options.childList || options.subtree) node.addEventListener(_interfaces.ElementEvent.REMOVED, this, true);
|
|
59
57
|
};
|
|
60
58
|
|
|
61
59
|
Registration.prototype.removeListeners = function () {
|
|
@@ -64,10 +62,10 @@ function () {
|
|
|
64
62
|
|
|
65
63
|
Registration.prototype.removeListeners_ = function (node) {
|
|
66
64
|
var options = this.options;
|
|
67
|
-
if (options.attributes) node.removeEventListener(
|
|
65
|
+
if (options.attributes) node.removeEventListener(_interfaces.ElementEvent.ATTR_MODIFIED, this, true); // if (options.characterData) node.removeEventListener('DOMCharacterDataModified', this, true);
|
|
68
66
|
|
|
69
|
-
if (options.childList) node.removeEventListener(
|
|
70
|
-
if (options.childList || options.subtree) node.removeEventListener(
|
|
67
|
+
if (options.childList) node.removeEventListener(_interfaces.ElementEvent.INSERTED, this, true);
|
|
68
|
+
if (options.childList || options.subtree) node.removeEventListener(_interfaces.ElementEvent.REMOVED, this, true);
|
|
71
69
|
};
|
|
72
70
|
/**
|
|
73
71
|
* Adds a transient observer on node. The transient observer gets removed
|
|
@@ -115,7 +113,7 @@ function () {
|
|
|
115
113
|
var target;
|
|
116
114
|
|
|
117
115
|
switch (e.type) {
|
|
118
|
-
case
|
|
116
|
+
case _interfaces.ElementEvent.ATTR_MODIFIED:
|
|
119
117
|
// http://dom.spec.whatwg.org/#concept-mo-queue-attributes
|
|
120
118
|
var name_1 = e.attrName; // @ts-ignore
|
|
121
119
|
|
|
@@ -160,17 +158,17 @@ function () {
|
|
|
160
158
|
// });
|
|
161
159
|
// break;
|
|
162
160
|
|
|
163
|
-
case
|
|
161
|
+
case _interfaces.ElementEvent.REMOVED: // this.addTransientObserver(e.target as IElement);
|
|
164
162
|
// Fall through.
|
|
165
163
|
|
|
166
|
-
case
|
|
164
|
+
case _interfaces.ElementEvent.INSERTED:
|
|
167
165
|
// http://dom.spec.whatwg.org/#concept-mo-queue-childlist
|
|
168
166
|
target = e.relatedNode;
|
|
169
167
|
var changedNode = e.target;
|
|
170
168
|
var addedNodes = void 0;
|
|
171
169
|
var removedNodes = void 0;
|
|
172
170
|
|
|
173
|
-
if (e.type ===
|
|
171
|
+
if (e.type === _interfaces.ElementEvent.INSERTED) {
|
|
174
172
|
addedNodes = [changedNode];
|
|
175
173
|
removedNodes = [];
|
|
176
174
|
} else {
|
|
@@ -206,9 +204,7 @@ exports.Registration = Registration;
|
|
|
206
204
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
|
|
207
205
|
* @see https://github.com/googlearchive/MutationObservers/blob/master/MutationObserver.js
|
|
208
206
|
*/
|
|
209
|
-
var MutationObserver =
|
|
210
|
-
/** @class */
|
|
211
|
-
function () {
|
|
207
|
+
var MutationObserver = function () {
|
|
212
208
|
function MutationObserver(callback) {
|
|
213
209
|
this.callback = callback;
|
|
214
210
|
this.nodes = [];
|
|
@@ -218,10 +214,7 @@ function () {
|
|
|
218
214
|
|
|
219
215
|
MutationObserver.prototype.observe = function (target, options) {
|
|
220
216
|
// 1.1
|
|
221
|
-
if (!options.childList && !options.attributes && !options.characterData ||
|
|
222
|
-
options.attributeOldValue && !options.attributes || // 1.3
|
|
223
|
-
options.attributeFilter && options.attributeFilter.length && !options.attributes || // 1.4
|
|
224
|
-
options.characterDataOldValue && !options.characterData) {
|
|
217
|
+
if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {
|
|
225
218
|
throw new SyntaxError();
|
|
226
219
|
}
|
|
227
220
|
|
|
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.MutationRecord = void 0;
|
|
7
7
|
|
|
8
|
-
var MutationRecord =
|
|
9
|
-
/** @class */
|
|
10
|
-
function () {
|
|
8
|
+
var MutationRecord = function () {
|
|
11
9
|
function MutationRecord(type, target) {
|
|
12
10
|
this.type = type;
|
|
13
11
|
this.target = target;
|
package/lib/dom/Node.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.Node = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _types = require("../types");
|
|
11
11
|
|
|
12
12
|
var _EventTarget = require("./EventTarget");
|
|
13
13
|
|
|
@@ -16,9 +16,7 @@ var _EventTarget = require("./EventTarget");
|
|
|
16
16
|
/**
|
|
17
17
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Node
|
|
18
18
|
*/
|
|
19
|
-
var Node =
|
|
20
|
-
/** @class */
|
|
21
|
-
function (_super) {
|
|
19
|
+
var Node = function (_super) {
|
|
22
20
|
(0, _tslib.__extends)(Node, _super);
|
|
23
21
|
|
|
24
22
|
function Node() {
|
|
@@ -88,7 +86,7 @@ function (_super) {
|
|
|
88
86
|
|
|
89
87
|
var out = '';
|
|
90
88
|
|
|
91
|
-
if (this.nodeName ===
|
|
89
|
+
if (this.nodeName === _types.Shape.TEXT) {
|
|
92
90
|
// @ts-ignore
|
|
93
91
|
out += this.style.text;
|
|
94
92
|
}
|
|
@@ -97,7 +95,7 @@ function (_super) {
|
|
|
97
95
|
for (var _b = (0, _tslib.__values)(this.childNodes), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
98
96
|
var child = _c.value;
|
|
99
97
|
|
|
100
|
-
if (child.nodeName ===
|
|
98
|
+
if (child.nodeName === _types.Shape.TEXT) {
|
|
101
99
|
out += child.nodeValue;
|
|
102
100
|
} else {
|
|
103
101
|
out += child.textContent;
|
|
@@ -125,9 +123,9 @@ function (_super) {
|
|
|
125
123
|
_this.removeChild(child, true);
|
|
126
124
|
});
|
|
127
125
|
|
|
128
|
-
if (this.nodeName ===
|
|
126
|
+
if (this.nodeName === _types.Shape.TEXT) {
|
|
129
127
|
// @ts-ignore
|
|
130
|
-
this.style.text = ""
|
|
128
|
+
this.style.text = "" + content;
|
|
131
129
|
} else {// this.appendChild(
|
|
132
130
|
// new Text({
|
|
133
131
|
// style: {
|
package/lib/dom/interfaces.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import type { AnimationTimeline } from './AnimationTimeline';
|
|
|
3
3
|
import type { BaseStyleProps, Shape } from '../types';
|
|
4
4
|
import type { FederatedEvent } from './FederatedEvent';
|
|
5
5
|
import type { CustomElementRegistry } from './CustomElementRegistry';
|
|
6
|
-
import type { CanvasConfig,
|
|
6
|
+
import type { CanvasConfig, InteractivePointerEvent } from '../types';
|
|
7
|
+
import type { DisplayObject } from '../display-objects';
|
|
7
8
|
import type { PointLike } from '../shapes';
|
|
8
9
|
import type { Camera } from '../camera';
|
|
9
10
|
import type { ContextService, EventService, RenderingService } from '../services';
|
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"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.CullingPlugin = exports.CullingStrategyContribution = void 0;
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
@@ -21,9 +21,7 @@ var CullingStrategyContribution = _manaSyringe.Syringe.defineToken('CullingStrat
|
|
|
21
21
|
|
|
22
22
|
exports.CullingStrategyContribution = CullingStrategyContribution;
|
|
23
23
|
|
|
24
|
-
var CullingPlugin =
|
|
25
|
-
/** @class */
|
|
26
|
-
function () {
|
|
24
|
+
var CullingPlugin = function () {
|
|
27
25
|
function CullingPlugin() {}
|
|
28
26
|
|
|
29
27
|
CullingPlugin_1 = CullingPlugin;
|
|
@@ -16,9 +16,7 @@ var _RenderingContext = require("../services/RenderingContext");
|
|
|
16
16
|
/**
|
|
17
17
|
* Filter dirty renderables and calculate the "dirty rectangle" which will be clear when frame began
|
|
18
18
|
*/
|
|
19
|
-
var DirtyCheckPlugin =
|
|
20
|
-
/** @class */
|
|
21
|
-
function () {
|
|
19
|
+
var DirtyCheckPlugin = function () {
|
|
22
20
|
function DirtyCheckPlugin() {}
|
|
23
21
|
|
|
24
22
|
DirtyCheckPlugin_1 = DirtyCheckPlugin;
|
|
@@ -17,14 +17,12 @@ var _shapes = require("../shapes");
|
|
|
17
17
|
|
|
18
18
|
var _Camera = require("../camera/Camera");
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _types = require("../types");
|
|
21
21
|
|
|
22
22
|
// group is not a 2d shape
|
|
23
|
-
var shape2D = [
|
|
23
|
+
var shape2D = [_types.Shape.CIRCLE, _types.Shape.ELLIPSE, _types.Shape.IMAGE, _types.Shape.RECT, _types.Shape.LINE, _types.Shape.POLYLINE, _types.Shape.POLYGON, _types.Shape.TEXT, _types.Shape.PATH, _types.Shape.HTML];
|
|
24
24
|
|
|
25
|
-
var FrustumCullingStrategy =
|
|
26
|
-
/** @class */
|
|
27
|
-
function () {
|
|
25
|
+
var FrustumCullingStrategy = function () {
|
|
28
26
|
function FrustumCullingStrategy() {}
|
|
29
27
|
|
|
30
28
|
FrustumCullingStrategy.prototype.isVisible = function (object) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RenderingService, RenderingPlugin } from '../services
|
|
1
|
+
import type { RenderingService, RenderingPlugin } from '../services';
|
|
2
2
|
export declare class PrepareRendererPlugin implements RenderingPlugin {
|
|
3
3
|
static tag: string;
|
|
4
4
|
private renderingContext;
|
|
@@ -15,9 +15,7 @@ var _dom = require("../dom");
|
|
|
15
15
|
|
|
16
16
|
var _services = require("../services");
|
|
17
17
|
|
|
18
|
-
var PrepareRendererPlugin =
|
|
19
|
-
/** @class */
|
|
20
|
-
function () {
|
|
18
|
+
var PrepareRendererPlugin = function () {
|
|
21
19
|
function PrepareRendererPlugin() {}
|
|
22
20
|
|
|
23
21
|
PrepareRendererPlugin_1 = PrepareRendererPlugin;
|
|
@@ -33,9 +33,7 @@ var _ContextService = require("./ContextService");
|
|
|
33
33
|
|
|
34
34
|
var PROPAGATION_LIMIT = 2048;
|
|
35
35
|
|
|
36
|
-
var EventService =
|
|
37
|
-
/** @class */
|
|
38
|
-
function (_super) {
|
|
36
|
+
var EventService = function (_super) {
|
|
39
37
|
(0, _tslib.__extends)(EventService, _super);
|
|
40
38
|
|
|
41
39
|
function EventService() {
|
|
@@ -591,7 +589,7 @@ function (_super) {
|
|
|
591
589
|
mappers[i].fn(e);
|
|
592
590
|
}
|
|
593
591
|
} else {
|
|
594
|
-
console.warn("[EventService]: Event mapping not defined for "
|
|
592
|
+
console.warn("[EventService]: Event mapping not defined for " + e.type);
|
|
595
593
|
}
|
|
596
594
|
};
|
|
597
595
|
|
|
@@ -923,7 +921,7 @@ function (_super) {
|
|
|
923
921
|
|
|
924
922
|
EventService.prototype.notifyTarget = function (e, type) {
|
|
925
923
|
type = type !== null && type !== void 0 ? type : e.type;
|
|
926
|
-
var key = e.eventPhase === e.CAPTURING_PHASE || e.eventPhase === e.AT_TARGET ?
|
|
924
|
+
var key = e.eventPhase === e.CAPTURING_PHASE || e.eventPhase === e.AT_TARGET ? type + "capture" : type;
|
|
927
925
|
this.notifyListeners(e, key);
|
|
928
926
|
|
|
929
927
|
if (e.eventPhase === e.AT_TARGET) {
|
|
@@ -15,9 +15,7 @@ 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 =
|
|
19
|
-
/** @class */
|
|
20
|
-
function () {
|
|
18
|
+
var OffscreenCanvasCreator = function () {
|
|
21
19
|
function OffscreenCanvasCreator() {}
|
|
22
20
|
|
|
23
21
|
OffscreenCanvasCreator.prototype.getOrCreateCanvas = function (offscreenCanvas) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Syringe } from 'mana-syringe';
|
|
2
2
|
import { SyncHook, SyncWaterfallHook, AsyncParallelHook, AsyncSeriesWaterfallHook } from 'tapable';
|
|
3
|
-
import type {
|
|
4
|
-
import type { EventPosition, InteractivePointerEvent } from '../types';
|
|
3
|
+
import type { DisplayObject } from '../display-objects';
|
|
4
|
+
import type { CanvasConfig, EventPosition, InteractivePointerEvent } from '../types';
|
|
5
5
|
export interface RenderingPlugin {
|
|
6
6
|
apply: (renderer: RenderingService) => void;
|
|
7
7
|
}
|
|
@@ -33,9 +33,7 @@ var RenderingPluginContribution = _manaSyringe.Syringe.defineToken('RenderingPlu
|
|
|
33
33
|
|
|
34
34
|
exports.RenderingPluginContribution = RenderingPluginContribution;
|
|
35
35
|
|
|
36
|
-
var RenderingService =
|
|
37
|
-
/** @class */
|
|
38
|
-
function () {
|
|
36
|
+
var RenderingService = function () {
|
|
39
37
|
function RenderingService() {
|
|
40
38
|
this.inited = false;
|
|
41
39
|
this.stats = {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.DefaultSceneGraphSelector = exports.SceneGraphSelector = exports.SceneGraphSelectorFactory = void 0;
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
@@ -29,9 +29,7 @@ var NAME_REGEXP = /\[\s*name=(.*)\s*\]/;
|
|
|
29
29
|
* * querySelectorAll
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
|
-
var DefaultSceneGraphSelector =
|
|
33
|
-
/** @class */
|
|
34
|
-
function () {
|
|
32
|
+
var DefaultSceneGraphSelector = function () {
|
|
35
33
|
function DefaultSceneGraphSelector() {}
|
|
36
34
|
|
|
37
35
|
DefaultSceneGraphSelector.prototype.selectOne = function (query, root) {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.SceneGraphService = exports.DefaultSceneGraphService = void 0;
|
|
7
|
-
exports.dirtifyToRoot = dirtifyToRoot;
|
|
8
6
|
exports.sortByZIndex = sortByZIndex;
|
|
7
|
+
exports.dirtifyToRoot = dirtifyToRoot;
|
|
8
|
+
exports.DefaultSceneGraphService = exports.SceneGraphService = void 0;
|
|
9
9
|
|
|
10
10
|
var _tslib = require("tslib");
|
|
11
11
|
|
|
@@ -74,9 +74,7 @@ var SceneGraphService = _manaSyringe.Syringe.defineToken('SceneGraphService');
|
|
|
74
74
|
|
|
75
75
|
exports.SceneGraphService = SceneGraphService;
|
|
76
76
|
|
|
77
|
-
var DefaultSceneGraphService =
|
|
78
|
-
/** @class */
|
|
79
|
-
function () {
|
|
77
|
+
var DefaultSceneGraphService = function () {
|
|
80
78
|
function DefaultSceneGraphService() {
|
|
81
79
|
var _this = this;
|
|
82
80
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="offscreencanvas" />
|
|
2
|
-
import type { ParsedTextStyleProps } from '
|
|
3
|
-
import { Rectangle } from '
|
|
2
|
+
import type { ParsedTextStyleProps } from '../display-objects';
|
|
3
|
+
import { Rectangle } from '../shapes';
|
|
4
4
|
export interface TextMetrics {
|
|
5
5
|
font: string;
|
|
6
6
|
width: number;
|
|
@@ -9,7 +9,9 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _manaSyringe = require("mana-syringe");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _utils = require("../utils");
|
|
13
|
+
|
|
14
|
+
var _shapes = require("../shapes");
|
|
13
15
|
|
|
14
16
|
var _OffscreenCanvasCreator = require("./OffscreenCanvasCreator");
|
|
15
17
|
|
|
@@ -34,12 +36,10 @@ var regexCannotStartJaJp = /[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾー
|
|
|
34
36
|
var regexCannotEndJaJp = /[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/;
|
|
35
37
|
var regexCannotStartKoKr = /[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/;
|
|
36
38
|
var regexCannotEndKoKr = /[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/;
|
|
37
|
-
var regexCannotStart = new RegExp(
|
|
38
|
-
var regexCannotEnd = new RegExp(
|
|
39
|
+
var regexCannotStart = new RegExp(regexCannotStartZhCn.source + "|" + regexCannotStartZhTw.source + "|" + regexCannotStartJaJp.source + "|" + regexCannotStartKoKr.source);
|
|
40
|
+
var regexCannotEnd = new RegExp(regexCannotEndZhCn.source + "|" + regexCannotEndZhTw.source + "|" + regexCannotEndJaJp.source + "|" + regexCannotEndKoKr.source);
|
|
39
41
|
|
|
40
|
-
var TextService =
|
|
41
|
-
/** @class */
|
|
42
|
-
function () {
|
|
42
|
+
var TextService = function () {
|
|
43
43
|
function TextService() {
|
|
44
44
|
var _this = this;
|
|
45
45
|
|
|
@@ -165,7 +165,7 @@ function () {
|
|
|
165
165
|
// dropShadow = 0,
|
|
166
166
|
// dropShadowDistance = 0,
|
|
167
167
|
leading = _c === void 0 ? 0 : _c;
|
|
168
|
-
var font = (0,
|
|
168
|
+
var font = (0, _utils.toFontString)(parsedStyle);
|
|
169
169
|
var fontProperties = this.measureFont(font, offscreenCanvas); // fallback in case UA disallow canvas data extraction
|
|
170
170
|
// (toDataURI, getImageData functions)
|
|
171
171
|
|
|
@@ -226,7 +226,7 @@ function () {
|
|
|
226
226
|
offsetX -= width;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
return new
|
|
229
|
+
return new _shapes.Rectangle(offsetX - lineWidth.value / 2, offsetY + i * lineHeight, width + lineWidth.value, lineHeight);
|
|
230
230
|
})
|
|
231
231
|
};
|
|
232
232
|
};
|
|
@@ -13,9 +13,7 @@ var _interfaces = require("./interfaces");
|
|
|
13
13
|
|
|
14
14
|
var _types = require("../../types");
|
|
15
15
|
|
|
16
|
-
var CircleUpdater =
|
|
17
|
-
/** @class */
|
|
18
|
-
function () {
|
|
16
|
+
var CircleUpdater = function () {
|
|
19
17
|
function CircleUpdater() {}
|
|
20
18
|
|
|
21
19
|
CircleUpdater.prototype.update = function (parsedStyle, object) {
|
|
@@ -13,9 +13,7 @@ var _interfaces = require("./interfaces");
|
|
|
13
13
|
|
|
14
14
|
var _types = require("../../types");
|
|
15
15
|
|
|
16
|
-
var EllipseUpdater =
|
|
17
|
-
/** @class */
|
|
18
|
-
function () {
|
|
16
|
+
var EllipseUpdater = function () {
|
|
19
17
|
function EllipseUpdater() {}
|
|
20
18
|
|
|
21
19
|
EllipseUpdater.prototype.update = function (parsedStyle, object) {
|
|
@@ -13,9 +13,7 @@ var _interfaces = require("./interfaces");
|
|
|
13
13
|
|
|
14
14
|
var _types = require("../../types");
|
|
15
15
|
|
|
16
|
-
var LineUpdater =
|
|
17
|
-
/** @class */
|
|
18
|
-
function () {
|
|
16
|
+
var LineUpdater = function () {
|
|
19
17
|
function LineUpdater() {}
|
|
20
18
|
|
|
21
19
|
LineUpdater.prototype.update = function (parsedStyle) {
|
|
@@ -13,9 +13,7 @@ var _interfaces = require("./interfaces");
|
|
|
13
13
|
|
|
14
14
|
var _types = require("../../types");
|
|
15
15
|
|
|
16
|
-
var PathUpdater =
|
|
17
|
-
/** @class */
|
|
18
|
-
function () {
|
|
16
|
+
var PathUpdater = function () {
|
|
19
17
|
function PathUpdater() {}
|
|
20
18
|
|
|
21
19
|
PathUpdater.prototype.update = function (parsedStyle) {
|
|
@@ -13,9 +13,7 @@ var _interfaces = require("./interfaces");
|
|
|
13
13
|
|
|
14
14
|
var _types = require("../../types");
|
|
15
15
|
|
|
16
|
-
var PolylineUpdater =
|
|
17
|
-
/** @class */
|
|
18
|
-
function () {
|
|
16
|
+
var PolylineUpdater = function () {
|
|
19
17
|
function PolylineUpdater() {}
|
|
20
18
|
|
|
21
19
|
PolylineUpdater.prototype.update = function (parsedStyle) {
|
|
@@ -17,9 +17,7 @@ var _types = require("../../types");
|
|
|
17
17
|
|
|
18
18
|
var _css = require("../../css");
|
|
19
19
|
|
|
20
|
-
var RectUpdater =
|
|
21
|
-
/** @class */
|
|
22
|
-
function () {
|
|
20
|
+
var RectUpdater = function () {
|
|
23
21
|
function RectUpdater() {}
|
|
24
22
|
|
|
25
23
|
RectUpdater.prototype.update = function (parsedStyle, object) {
|
|
@@ -19,9 +19,7 @@ var _types = require("../../types");
|
|
|
19
19
|
|
|
20
20
|
var _css = require("../../css");
|
|
21
21
|
|
|
22
|
-
var TextUpdater =
|
|
23
|
-
/** @class */
|
|
24
|
-
function () {
|
|
22
|
+
var TextUpdater = function () {
|
|
25
23
|
function TextUpdater() {}
|
|
26
24
|
|
|
27
25
|
TextUpdater.prototype.isReadyToMeasure = function (parsedStyle, object) {
|