@antv/g 5.0.16 → 5.0.17
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.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/display-objects/Circle.js +1 -3
- package/es/display-objects/CustomElement.js +1 -3
- package/es/display-objects/DisplayObject.d.ts +5 -0
- package/es/display-objects/DisplayObject.js +23 -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/TSpan.d.ts +1 -0
- package/es/display-objects/TSpan.js +0 -0
- package/es/display-objects/Text.d.ts +23 -0
- package/es/display-objects/Text.js +56 -4
- package/es/dom/Animation.js +3 -5
- 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.d.ts +1 -1
- package/es/dom/Document.js +3 -5
- package/es/dom/Element.d.ts +22 -0
- package/es/dom/Element.js +68 -6
- package/es/dom/EventTarget.js +3 -5
- package/es/dom/FederatedEvent.d.ts +5 -2
- 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.js +1 -3
- package/es/dom/MutationObserver.js +3 -10
- package/es/dom/MutationRecord.js +1 -3
- package/es/dom/Node.js +2 -4
- package/es/plugins/CullingPlugin.js +1 -3
- package/es/plugins/DirtyCheckPlugin.js +1 -3
- package/es/plugins/EventPlugin.d.ts +2 -1
- package/es/plugins/EventPlugin.js +16 -8
- package/es/plugins/FrustumCullingStrategy.js +1 -3
- package/es/plugins/PrepareRendererPlugin.js +1 -3
- package/es/property-handlers/color.js +2 -2
- package/es/property-handlers/dimension.js +1 -1
- package/es/property-handlers/path.d.ts +1 -1
- package/es/property-handlers/text.js +1 -1
- package/es/services/EventService.js +3 -5
- package/es/services/RenderingService.js +1 -3
- package/es/services/SceneGraphSelector.js +1 -3
- package/es/services/SceneGraphService.js +1 -3
- 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/services/text/OffscreenCanvasCreator.js +1 -3
- package/es/services/text/index.js +3 -5
- 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/Polygon.js +1 -3
- package/es/shapes/Ray.js +1 -3
- package/es/shapes/Rect.js +1 -3
- package/es/shapes/Rectangle.js +1 -3
- package/es/utils/animation.js +1 -1
- package/es/utils/custom-easing.js +1 -1
- package/es/utils/path.d.ts +1 -1
- package/es/utils/path.js +3 -3
- package/es/utils/text.js +3 -3
- package/lib/AbstractRenderer.js +1 -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/display-objects/Circle.js +1 -3
- package/lib/display-objects/CustomElement.js +1 -3
- package/lib/display-objects/DisplayObject.d.ts +5 -0
- package/lib/display-objects/DisplayObject.js +24 -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/TSpan.d.ts +1 -0
- package/lib/display-objects/TSpan.js +1 -0
- package/lib/display-objects/Text.d.ts +23 -0
- package/lib/display-objects/Text.js +57 -4
- package/lib/dom/Animation.js +3 -5
- 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.d.ts +1 -1
- package/lib/dom/Document.js +4 -6
- package/lib/dom/Element.d.ts +22 -0
- package/lib/dom/Element.js +68 -6
- package/lib/dom/EventTarget.js +3 -5
- package/lib/dom/FederatedEvent.d.ts +5 -2
- 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.js +1 -3
- package/lib/dom/MutationObserver.js +4 -11
- package/lib/dom/MutationRecord.js +1 -3
- package/lib/dom/Node.js +2 -4
- package/lib/global-module.js +2 -3
- package/lib/index.js +1 -1
- package/lib/plugins/CullingPlugin.js +2 -4
- package/lib/plugins/DirtyCheckPlugin.js +1 -3
- package/lib/plugins/EventPlugin.d.ts +2 -1
- package/lib/plugins/EventPlugin.js +14 -8
- package/lib/plugins/FrustumCullingStrategy.js +1 -3
- package/lib/plugins/PrepareRendererPlugin.js +1 -3
- package/lib/property-handlers/color.js +5 -5
- package/lib/property-handlers/dimension.js +5 -6
- package/lib/property-handlers/inherit.js +1 -1
- package/lib/property-handlers/interfaces.js +1 -1
- package/lib/property-handlers/numeric.js +3 -3
- package/lib/property-handlers/path.d.ts +1 -1
- package/lib/property-handlers/path.js +1 -1
- package/lib/property-handlers/text.js +1 -1
- package/lib/property-handlers/transform.js +1 -1
- package/lib/services/EventService.js +3 -5
- package/lib/services/RenderingService.js +1 -3
- package/lib/services/SceneGraphSelector.js +2 -4
- package/lib/services/SceneGraphService.js +3 -5
- 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/services/text/OffscreenCanvasCreator.js +1 -3
- package/lib/services/text/index.js +3 -5
- 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/Polygon.js +1 -3
- package/lib/shapes/Ray.js +1 -3
- package/lib/shapes/Rect.js +1 -3
- package/lib/shapes/Rectangle.js +1 -3
- package/lib/types.js +1 -1
- package/lib/utils/animation.js +3 -4
- package/lib/utils/bezier-easing.js +1 -1
- package/lib/utils/custom-easing.js +2 -2
- package/lib/utils/event.js +2 -3
- package/lib/utils/math.js +5 -5
- package/lib/utils/path.d.ts +1 -1
- package/lib/utils/path.js +6 -6
- package/lib/utils/raf.js +1 -2
- package/lib/utils/text.js +3 -3
- package/package.json +2 -2
- package/dist/index.umd.min.js +0 -31
package/es/AbstractRenderer.js
CHANGED
package/es/Canvas.js
CHANGED
package/es/DisplayObjectPool.js
CHANGED
package/es/camera/Camera.js
CHANGED
package/es/camera/Landmark.js
CHANGED
|
@@ -7,9 +7,7 @@ export var Strategy;
|
|
|
7
7
|
Strategy[Strategy["Standard"] = 0] = "Standard";
|
|
8
8
|
})(Strategy || (Strategy = {}));
|
|
9
9
|
|
|
10
|
-
var Cullable =
|
|
11
|
-
/** @class */
|
|
12
|
-
function () {
|
|
10
|
+
var Cullable = function () {
|
|
13
11
|
function Cullable() {
|
|
14
12
|
this.strategy = Strategy.Standard;
|
|
15
13
|
this.visibilityPlaneMask = -1;
|
|
@@ -2,9 +2,7 @@ import { __assign, __extends, __rest } from "tslib";
|
|
|
2
2
|
import { Shape } from '../types';
|
|
3
3
|
import { DisplayObject } from './DisplayObject';
|
|
4
4
|
|
|
5
|
-
var Circle =
|
|
6
|
-
/** @class */
|
|
7
|
-
function (_super) {
|
|
5
|
+
var Circle = function (_super) {
|
|
8
6
|
__extends(Circle, _super);
|
|
9
7
|
|
|
10
8
|
function Circle(_a) {
|
|
@@ -6,9 +6,7 @@ import { ElementEvent } from '../dom/interfaces';
|
|
|
6
6
|
* @see https://yuque.antfin-inc.com/antv/czqvg5/pgqipg
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
var CustomElement =
|
|
10
|
-
/** @class */
|
|
11
|
-
function (_super) {
|
|
9
|
+
var CustomElement = function (_super) {
|
|
12
10
|
__extends(CustomElement, _super); // private shadowNodes: DisplayObject[] = [];
|
|
13
11
|
|
|
14
12
|
|
|
@@ -48,6 +48,11 @@ export declare class DisplayObject<StyleProps extends BaseStyleProps = any, Pars
|
|
|
48
48
|
* called when attributes get changed or initialized
|
|
49
49
|
*/
|
|
50
50
|
private changeAttribute;
|
|
51
|
+
/**
|
|
52
|
+
* returns different values than getBoundingClientRect(), as the latter returns value relative to the viewport
|
|
53
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGGraphicsElement/getBBox
|
|
54
|
+
*/
|
|
55
|
+
getBBox(): DOMRect;
|
|
51
56
|
setOrigin(position: vec3 | vec2 | number, y?: number, z?: number): this;
|
|
52
57
|
getOrigin(): vec3;
|
|
53
58
|
/**
|
|
@@ -10,6 +10,7 @@ import { createVec3, formatAttribute, fromRotationTranslationScale, getEuler, ra
|
|
|
10
10
|
import { globalContainer, stylePropertyParserFactory, stylePropertyUpdaterFactory } from '../global-module';
|
|
11
11
|
import { dirtifyToRoot } from '../services';
|
|
12
12
|
import { MutationEvent } from '../dom/MutationEvent';
|
|
13
|
+
import { Rectangle } from '../shapes';
|
|
13
14
|
var DEFAULT_STYLE_PROPS = {
|
|
14
15
|
anchor: [0, 0, 0],
|
|
15
16
|
origin: [0, 0, 0],
|
|
@@ -38,21 +39,18 @@ var DEFAULT_STYLE_PROPS = {
|
|
|
38
39
|
* * attributeChanged
|
|
39
40
|
*/
|
|
40
41
|
|
|
41
|
-
var DisplayObject =
|
|
42
|
-
/** @class */
|
|
43
|
-
function (_super) {
|
|
42
|
+
var DisplayObject = function (_super) {
|
|
44
43
|
__extends(DisplayObject, _super);
|
|
45
44
|
|
|
46
45
|
function DisplayObject(config) {
|
|
47
|
-
var _this = this;
|
|
48
|
-
|
|
49
46
|
var _a, _b, _c;
|
|
50
47
|
|
|
51
|
-
_this = _super.call(this) || this;
|
|
48
|
+
var _this = _super.call(this) || this;
|
|
52
49
|
/**
|
|
53
50
|
* push to active animations after calling `animate()`
|
|
54
51
|
*/
|
|
55
52
|
|
|
53
|
+
|
|
56
54
|
_this.activeAnimations = []; // assign name, id to config
|
|
57
55
|
// eg. group.get('name')
|
|
58
56
|
|
|
@@ -281,6 +279,25 @@ function (_super) {
|
|
|
281
279
|
// });
|
|
282
280
|
}; // #region transformable
|
|
283
281
|
|
|
282
|
+
/**
|
|
283
|
+
* returns different values than getBoundingClientRect(), as the latter returns value relative to the viewport
|
|
284
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGGraphicsElement/getBBox
|
|
285
|
+
*/
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
DisplayObject.prototype.getBBox = function () {
|
|
289
|
+
var aabb = this.getBounds();
|
|
290
|
+
|
|
291
|
+
var _a = __read(aabb.getMin(), 2),
|
|
292
|
+
left = _a[0],
|
|
293
|
+
top = _a[1];
|
|
294
|
+
|
|
295
|
+
var _b = __read(aabb.getMax(), 2),
|
|
296
|
+
right = _b[0],
|
|
297
|
+
bottom = _b[1];
|
|
298
|
+
|
|
299
|
+
return new Rectangle(left, top, right - left, bottom - top);
|
|
300
|
+
};
|
|
284
301
|
|
|
285
302
|
DisplayObject.prototype.setOrigin = function (position, y, z) {
|
|
286
303
|
if (y === void 0) {
|
|
@@ -2,9 +2,7 @@ import { __assign, __extends, __rest } from "tslib";
|
|
|
2
2
|
import { Shape } from '../types';
|
|
3
3
|
import { DisplayObject } from './DisplayObject';
|
|
4
4
|
|
|
5
|
-
var Ellipse =
|
|
6
|
-
/** @class */
|
|
7
|
-
function (_super) {
|
|
5
|
+
var Ellipse = function (_super) {
|
|
8
6
|
__extends(Ellipse, _super);
|
|
9
7
|
|
|
10
8
|
function Ellipse(_a) {
|
|
@@ -2,9 +2,7 @@ import { __assign, __extends, __rest } from "tslib";
|
|
|
2
2
|
import { Shape } from '../types';
|
|
3
3
|
import { DisplayObject } from './DisplayObject';
|
|
4
4
|
|
|
5
|
-
var Group =
|
|
6
|
-
/** @class */
|
|
7
|
-
function (_super) {
|
|
5
|
+
var Group = function (_super) {
|
|
8
6
|
__extends(Group, _super);
|
|
9
7
|
|
|
10
8
|
function Group(_a) {
|
|
@@ -8,9 +8,7 @@ import { mat4, vec3 } from 'gl-matrix';
|
|
|
8
8
|
* @see https://github.com/pmndrs/drei#html
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
var HTML =
|
|
12
|
-
/** @class */
|
|
13
|
-
function (_super) {
|
|
11
|
+
var HTML = function (_super) {
|
|
14
12
|
__extends(HTML, _super);
|
|
15
13
|
|
|
16
14
|
function HTML(_a) {
|
|
@@ -18,12 +16,10 @@ function (_super) {
|
|
|
18
16
|
_a = {};
|
|
19
17
|
}
|
|
20
18
|
|
|
21
|
-
var _this = this;
|
|
22
|
-
|
|
23
19
|
var style = _a.style,
|
|
24
20
|
rest = __rest(_a, ["style"]);
|
|
25
21
|
|
|
26
|
-
_this = _super.call(this, __assign({
|
|
22
|
+
var _this = _super.call(this, __assign({
|
|
27
23
|
type: Shape.HTML,
|
|
28
24
|
style: __assign({
|
|
29
25
|
innerHTML: '',
|
|
@@ -31,6 +27,7 @@ function (_super) {
|
|
|
31
27
|
style: ''
|
|
32
28
|
}, style)
|
|
33
29
|
}, rest)) || this;
|
|
30
|
+
|
|
34
31
|
_this.cullable.enable = false;
|
|
35
32
|
return _this;
|
|
36
33
|
}
|
|
@@ -2,9 +2,7 @@ import { __assign, __extends, __rest } from "tslib";
|
|
|
2
2
|
import { Shape } from '../types';
|
|
3
3
|
import { DisplayObject } from './DisplayObject';
|
|
4
4
|
|
|
5
|
-
var Image =
|
|
6
|
-
/** @class */
|
|
7
|
-
function (_super) {
|
|
5
|
+
var Image = function (_super) {
|
|
8
6
|
__extends(Image, _super);
|
|
9
7
|
|
|
10
8
|
function Image(_a) {
|
|
@@ -4,9 +4,7 @@ import { Shape, LineCap, LineJoin } from '../types';
|
|
|
4
4
|
import { DisplayObject } from './DisplayObject';
|
|
5
5
|
import { Point } from '../shapes';
|
|
6
6
|
|
|
7
|
-
var Line =
|
|
8
|
-
/** @class */
|
|
9
|
-
function (_super) {
|
|
7
|
+
var Line = function (_super) {
|
|
10
8
|
__extends(Line, _super);
|
|
11
9
|
|
|
12
10
|
function Line(_a) {
|
|
@@ -5,9 +5,7 @@ import { Point } from '../shapes';
|
|
|
5
5
|
import { Cubic as CubicUtil } from '@antv/g-math';
|
|
6
6
|
import { isNil } from '@antv/util';
|
|
7
7
|
|
|
8
|
-
var Path =
|
|
9
|
-
/** @class */
|
|
10
|
-
function (_super) {
|
|
8
|
+
var Path = function (_super) {
|
|
11
9
|
__extends(Path, _super);
|
|
12
10
|
|
|
13
11
|
function Path(_a) {
|
|
@@ -2,9 +2,7 @@ import { __assign, __extends, __rest } from "tslib";
|
|
|
2
2
|
import { Shape } from '../types';
|
|
3
3
|
import { DisplayObject } from './DisplayObject';
|
|
4
4
|
|
|
5
|
-
var Polygon =
|
|
6
|
-
/** @class */
|
|
7
|
-
function (_super) {
|
|
5
|
+
var Polygon = function (_super) {
|
|
8
6
|
__extends(Polygon, _super);
|
|
9
7
|
|
|
10
8
|
function Polygon(_a) {
|
|
@@ -4,9 +4,7 @@ import { Shape, LineCap, LineJoin } from '../types';
|
|
|
4
4
|
import { DisplayObject } from './DisplayObject';
|
|
5
5
|
import { Point } from '../shapes';
|
|
6
6
|
|
|
7
|
-
var Polyline =
|
|
8
|
-
/** @class */
|
|
9
|
-
function (_super) {
|
|
7
|
+
var Polyline = function (_super) {
|
|
10
8
|
__extends(Polyline, _super);
|
|
11
9
|
|
|
12
10
|
function Polyline(_a) {
|
|
@@ -2,9 +2,7 @@ import { __assign, __extends, __rest } from "tslib";
|
|
|
2
2
|
import { Shape } from '../types';
|
|
3
3
|
import { DisplayObject } from './DisplayObject';
|
|
4
4
|
|
|
5
|
-
var Rect =
|
|
6
|
-
/** @class */
|
|
7
|
-
function (_super) {
|
|
5
|
+
var Rect = function (_super) {
|
|
8
6
|
__extends(Rect, _super);
|
|
9
7
|
|
|
10
8
|
function Rect(_a) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
File without changes
|
|
@@ -62,7 +62,30 @@ export interface ParsedTextStyleProps extends ParsedBaseStyleProps {
|
|
|
62
62
|
dx?: ParsedElement;
|
|
63
63
|
dy?: ParsedElement;
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* <text> @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextElement
|
|
67
|
+
*/
|
|
65
68
|
export declare class Text extends DisplayObject<TextStyleProps, ParsedTextStyleProps> {
|
|
69
|
+
/**
|
|
70
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement#constants
|
|
71
|
+
*/
|
|
72
|
+
LENGTHADJUST_SPACING: number;
|
|
73
|
+
LENGTHADJUST_SPACINGANDGLYPHS: number;
|
|
74
|
+
LENGTHADJUST_UNKNOWN: number;
|
|
66
75
|
constructor({ style, ...rest }?: DisplayObjectConfig<TextStyleProps>);
|
|
76
|
+
lengthAdjust: SVGAnimatedEnumeration;
|
|
77
|
+
textLength: SVGAnimatedLength;
|
|
78
|
+
getCharNumAtPosition(point?: DOMPointInit): number;
|
|
79
|
+
/**
|
|
80
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement
|
|
81
|
+
*/
|
|
82
|
+
getComputedTextLength(): number;
|
|
83
|
+
getEndPositionOfChar(charnum: number): DOMPoint;
|
|
84
|
+
getExtentOfChar(charnum: number): DOMRect;
|
|
85
|
+
getNumberOfChars(): number;
|
|
86
|
+
getRotationOfChar(charnum: number): number;
|
|
87
|
+
getStartPositionOfChar(charnum: number): DOMPoint;
|
|
88
|
+
getSubStringLength(charnum: number, nchars: number): number;
|
|
89
|
+
selectSubString(charnum: number, nchars: number): void;
|
|
67
90
|
getLineBoundingRects(): import("..").Rectangle[];
|
|
68
91
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { __assign, __extends, __rest } from "tslib";
|
|
2
2
|
import { Shape, LineJoin, LineCap } from '../types';
|
|
3
3
|
import { DisplayObject } from './DisplayObject';
|
|
4
|
+
/**
|
|
5
|
+
* <text> @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextElement
|
|
6
|
+
*/
|
|
4
7
|
|
|
5
|
-
var Text =
|
|
6
|
-
/** @class */
|
|
7
|
-
function (_super) {
|
|
8
|
+
var Text = function (_super) {
|
|
8
9
|
__extends(Text, _super);
|
|
9
10
|
|
|
10
11
|
function Text(_a) {
|
|
@@ -15,7 +16,7 @@ function (_super) {
|
|
|
15
16
|
var style = _a.style,
|
|
16
17
|
rest = __rest(_a, ["style"]);
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
var _this = _super.call(this, __assign({
|
|
19
20
|
type: Shape.TEXT,
|
|
20
21
|
style: __assign({
|
|
21
22
|
text: '',
|
|
@@ -48,8 +49,59 @@ function (_super) {
|
|
|
48
49
|
dy: 0
|
|
49
50
|
}, style)
|
|
50
51
|
}, rest)) || this;
|
|
52
|
+
/**
|
|
53
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement#constants
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
_this.LENGTHADJUST_SPACING = 1;
|
|
58
|
+
_this.LENGTHADJUST_SPACINGANDGLYPHS = 2;
|
|
59
|
+
_this.LENGTHADJUST_UNKNOWN = 0;
|
|
60
|
+
return _this;
|
|
51
61
|
}
|
|
52
62
|
|
|
63
|
+
Text.prototype.getCharNumAtPosition = function (point) {
|
|
64
|
+
throw new Error('Method not implemented.');
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
Text.prototype.getComputedTextLength = function () {
|
|
72
|
+
var _a;
|
|
73
|
+
|
|
74
|
+
return ((_a = this.parsedStyle.metrics) === null || _a === void 0 ? void 0 : _a.maxLineWidth) || 0;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
Text.prototype.getEndPositionOfChar = function (charnum) {
|
|
78
|
+
throw new Error('Method not implemented.');
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
Text.prototype.getExtentOfChar = function (charnum) {
|
|
82
|
+
throw new Error('Method not implemented.');
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
Text.prototype.getNumberOfChars = function () {
|
|
86
|
+
throw new Error('Method not implemented.');
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
Text.prototype.getRotationOfChar = function (charnum) {
|
|
90
|
+
throw new Error('Method not implemented.');
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
Text.prototype.getStartPositionOfChar = function (charnum) {
|
|
94
|
+
throw new Error('Method not implemented.');
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
Text.prototype.getSubStringLength = function (charnum, nchars) {
|
|
98
|
+
throw new Error('Method not implemented.');
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
Text.prototype.selectSubString = function (charnum, nchars) {
|
|
102
|
+
throw new Error('Method not implemented.');
|
|
103
|
+
};
|
|
104
|
+
|
|
53
105
|
Text.prototype.getLineBoundingRects = function () {
|
|
54
106
|
var _a;
|
|
55
107
|
|
package/es/dom/Animation.js
CHANGED
|
@@ -4,9 +4,7 @@ var sequenceNumber = 0;
|
|
|
4
4
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/Animation
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
var Animation =
|
|
8
|
-
/** @class */
|
|
9
|
-
function () {
|
|
7
|
+
var Animation = function () {
|
|
10
8
|
function Animation(effect, timeline) {
|
|
11
9
|
this.currentTimePending = false;
|
|
12
10
|
/**
|
|
@@ -23,7 +21,7 @@ function () {
|
|
|
23
21
|
this.effect = effect;
|
|
24
22
|
effect.animation = this;
|
|
25
23
|
this.timeline = timeline;
|
|
26
|
-
this.id = ""
|
|
24
|
+
this.id = "" + sequenceNumber++;
|
|
27
25
|
this._inEffect = !!this.effect.update(0);
|
|
28
26
|
this._holdTime = 0;
|
|
29
27
|
this._paused = false;
|
|
@@ -232,7 +230,7 @@ function () {
|
|
|
232
230
|
get: function get() {
|
|
233
231
|
var _a;
|
|
234
232
|
|
|
235
|
-
return Number((_a = this.effect) === null || _a === void 0 ? void 0 : _a.getComputedTiming().
|
|
233
|
+
return Number((_a = this.effect) === null || _a === void 0 ? void 0 : _a.getComputedTiming().endTime);
|
|
236
234
|
},
|
|
237
235
|
enumerable: false,
|
|
238
236
|
configurable: true
|
|
@@ -3,9 +3,7 @@ import { linear, parseEasingFunction } from '../utils/animation';
|
|
|
3
3
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/EffectTiming
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
var AnimationEffectTiming =
|
|
7
|
-
/** @class */
|
|
8
|
-
function () {
|
|
6
|
+
var AnimationEffectTiming = function () {
|
|
9
7
|
function AnimationEffectTiming() {
|
|
10
8
|
/**
|
|
11
9
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/EffectTiming/delay
|
package/es/dom/AnimationEvent.js
CHANGED
|
@@ -4,9 +4,7 @@ import { FederatedEvent } from './FederatedEvent';
|
|
|
4
4
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationPlaybackEvent
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
var AnimationEvent =
|
|
8
|
-
/** @class */
|
|
9
|
-
function (_super) {
|
|
7
|
+
var AnimationEvent = function (_super) {
|
|
10
8
|
__extends(AnimationEvent, _super);
|
|
11
9
|
|
|
12
10
|
function AnimationEvent(manager, target, currentTime, timelineTime) {
|
|
@@ -8,9 +8,7 @@ export function compareAnimations(leftAnimation, rightAnimation) {
|
|
|
8
8
|
* @see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/web-animations-js/index.d.ts
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
var AnimationTimeline =
|
|
12
|
-
/** @class */
|
|
13
|
-
function () {
|
|
11
|
+
var AnimationTimeline = function () {
|
|
14
12
|
function AnimationTimeline() {
|
|
15
13
|
var _this = this;
|
|
16
14
|
/**
|
|
@@ -6,9 +6,7 @@ import { Ellipse, Circle, Rect, Image, Line, Path, Group, Polygon, Polyline, Tex
|
|
|
6
6
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
var CustomElementRegistry =
|
|
10
|
-
/** @class */
|
|
11
|
-
function () {
|
|
9
|
+
var CustomElementRegistry = function () {
|
|
12
10
|
function CustomElementRegistry() {
|
|
13
11
|
this.registry = {};
|
|
14
12
|
this.define(Shape.CIRCLE, Circle);
|
package/es/dom/CustomEvent.js
CHANGED
|
@@ -13,9 +13,7 @@ import { FederatedEvent } from './FederatedEvent';
|
|
|
13
13
|
circle.dispatchEvent(event);
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
var CustomEvent =
|
|
17
|
-
/** @class */
|
|
18
|
-
function (_super) {
|
|
16
|
+
var CustomEvent = function (_super) {
|
|
19
17
|
__extends(CustomEvent, _super); // eslint-disable-next-line @typescript-eslint/ban-types
|
|
20
18
|
|
|
21
19
|
|
package/es/dom/Document.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Node } from './Node';
|
|
2
2
|
import { AnimationTimeline } from './AnimationTimeline';
|
|
3
|
-
import { Group } from '../display-objects
|
|
3
|
+
import { Group } from '../display-objects';
|
|
4
4
|
import type { DisplayObject } from '../display-objects/DisplayObject';
|
|
5
5
|
import type { IDocument, IElement, INode, ICanvas, DisplayObjectConfig } from './interfaces';
|
|
6
6
|
import type { BaseStyleProps } from '../types';
|
package/es/dom/Document.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __extends } from "tslib";
|
|
2
2
|
import { Node } from './Node';
|
|
3
3
|
import { AnimationTimeline } from './AnimationTimeline';
|
|
4
|
-
import { Group } from '../display-objects
|
|
4
|
+
import { Group, Text } from '../display-objects';
|
|
5
5
|
import { TextAlign } from '../types';
|
|
6
6
|
/**
|
|
7
7
|
* the entry of DOM tree
|
|
@@ -9,9 +9,7 @@ import { TextAlign } from '../types';
|
|
|
9
9
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
var Document =
|
|
13
|
-
/** @class */
|
|
14
|
-
function (_super) {
|
|
12
|
+
var Document = function (_super) {
|
|
15
13
|
__extends(Document, _super);
|
|
16
14
|
|
|
17
15
|
function Document() {
|
|
@@ -83,7 +81,7 @@ function (_super) {
|
|
|
83
81
|
|
|
84
82
|
if (!clazz) {
|
|
85
83
|
console.warn('Unsupported tagName: ', tagName);
|
|
86
|
-
clazz = Group;
|
|
84
|
+
clazz = tagName === 'tspan' ? Text : Group;
|
|
87
85
|
}
|
|
88
86
|
|
|
89
87
|
return new clazz(options);
|
package/es/dom/Element.d.ts
CHANGED
|
@@ -138,10 +138,22 @@ export declare class Element<StyleProps extends BaseStyleProps = any, ParsedStyl
|
|
|
138
138
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/attributes
|
|
139
139
|
*/
|
|
140
140
|
readonly attributes: StyleProps;
|
|
141
|
+
/**
|
|
142
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNames
|
|
143
|
+
*/
|
|
144
|
+
getAttributeNames(): string[];
|
|
141
145
|
/**
|
|
142
146
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute
|
|
143
147
|
*/
|
|
144
148
|
getAttribute(name: keyof StyleProps): any;
|
|
149
|
+
/**
|
|
150
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/hasAttribute
|
|
151
|
+
*/
|
|
152
|
+
hasAttribute(qualifiedName: string): boolean;
|
|
153
|
+
/**
|
|
154
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/hasAttributes
|
|
155
|
+
*/
|
|
156
|
+
hasAttributes(): boolean;
|
|
145
157
|
/**
|
|
146
158
|
* should use removeAttribute() instead of setting the attribute value to null either directly or using setAttribute(). Many attributes will not behave as expected if you set them to null.
|
|
147
159
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute
|
|
@@ -151,4 +163,14 @@ export declare class Element<StyleProps extends BaseStyleProps = any, ParsedStyl
|
|
|
151
163
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute
|
|
152
164
|
*/
|
|
153
165
|
setAttribute<Key extends keyof StyleProps>(attributeName: Key, value: StyleProps[Key], force?: boolean): void;
|
|
166
|
+
getAttributeNS(namespace: string, localName: string): string;
|
|
167
|
+
getAttributeNode(qualifiedName: string): Attr;
|
|
168
|
+
getAttributeNodeNS(namespace: string, localName: string): Attr;
|
|
169
|
+
hasAttributeNS(namespace: string, localName: string): boolean;
|
|
170
|
+
removeAttributeNS(namespace: string, localName: string): void;
|
|
171
|
+
removeAttributeNode(attr: Attr): Attr;
|
|
172
|
+
setAttributeNS(namespace: string, qualifiedName: string, value: string): void;
|
|
173
|
+
setAttributeNode(attr: Attr): Attr;
|
|
174
|
+
setAttributeNodeNS(attr: Attr): Attr;
|
|
175
|
+
toggleAttribute(qualifiedName: string, force?: boolean): boolean;
|
|
154
176
|
}
|