@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.
Files changed (188) hide show
  1. package/es/AbstractRenderer.js +1 -3
  2. package/es/Canvas.js +1 -3
  3. package/es/DisplayObjectPool.js +1 -3
  4. package/es/camera/Camera.js +1 -3
  5. package/es/camera/Landmark.js +1 -3
  6. package/es/components/Cullable.js +1 -3
  7. package/es/components/Geometry.js +1 -3
  8. package/es/components/Renderable.js +1 -3
  9. package/es/components/Sortable.js +1 -3
  10. package/es/components/Transform.js +1 -3
  11. package/es/display-objects/Circle.js +1 -3
  12. package/es/display-objects/CustomElement.js +1 -3
  13. package/es/display-objects/DisplayObject.d.ts +5 -0
  14. package/es/display-objects/DisplayObject.js +23 -6
  15. package/es/display-objects/Ellipse.js +1 -3
  16. package/es/display-objects/Group.js +1 -3
  17. package/es/display-objects/HTML.js +3 -6
  18. package/es/display-objects/Image.js +1 -3
  19. package/es/display-objects/Line.js +1 -3
  20. package/es/display-objects/Path.js +1 -3
  21. package/es/display-objects/Polygon.js +1 -3
  22. package/es/display-objects/Polyline.js +1 -3
  23. package/es/display-objects/Rect.js +1 -3
  24. package/es/display-objects/TSpan.d.ts +1 -0
  25. package/es/display-objects/TSpan.js +0 -0
  26. package/es/display-objects/Text.d.ts +23 -0
  27. package/es/display-objects/Text.js +56 -4
  28. package/es/dom/Animation.js +3 -5
  29. package/es/dom/AnimationEffectTiming.js +1 -3
  30. package/es/dom/AnimationEvent.js +1 -3
  31. package/es/dom/AnimationTimeline.js +1 -3
  32. package/es/dom/CustomElementRegistry.js +1 -3
  33. package/es/dom/CustomEvent.js +1 -3
  34. package/es/dom/Document.d.ts +1 -1
  35. package/es/dom/Document.js +3 -5
  36. package/es/dom/Element.d.ts +22 -0
  37. package/es/dom/Element.js +68 -6
  38. package/es/dom/EventTarget.js +3 -5
  39. package/es/dom/FederatedEvent.d.ts +5 -2
  40. package/es/dom/FederatedEvent.js +1 -3
  41. package/es/dom/FederatedMouseEvent.js +1 -3
  42. package/es/dom/FederatedPointerEvent.js +1 -3
  43. package/es/dom/FederatedWheelEvent.js +1 -3
  44. package/es/dom/KeyframeEffect.js +1 -3
  45. package/es/dom/KeyframeList.js +1 -1
  46. package/es/dom/MutationEvent.js +1 -3
  47. package/es/dom/MutationObserver.js +3 -10
  48. package/es/dom/MutationRecord.js +1 -3
  49. package/es/dom/Node.js +2 -4
  50. package/es/plugins/CullingPlugin.js +1 -3
  51. package/es/plugins/DirtyCheckPlugin.js +1 -3
  52. package/es/plugins/EventPlugin.d.ts +2 -1
  53. package/es/plugins/EventPlugin.js +16 -8
  54. package/es/plugins/FrustumCullingStrategy.js +1 -3
  55. package/es/plugins/PrepareRendererPlugin.js +1 -3
  56. package/es/property-handlers/color.js +2 -2
  57. package/es/property-handlers/dimension.js +1 -1
  58. package/es/property-handlers/path.d.ts +1 -1
  59. package/es/property-handlers/text.js +1 -1
  60. package/es/services/EventService.js +3 -5
  61. package/es/services/RenderingService.js +1 -3
  62. package/es/services/SceneGraphSelector.js +1 -3
  63. package/es/services/SceneGraphService.js +1 -3
  64. package/es/services/aabb/CircleUpdater.js +1 -3
  65. package/es/services/aabb/EllipseUpdater.js +1 -3
  66. package/es/services/aabb/LineUpdater.js +1 -3
  67. package/es/services/aabb/PathUpdater.js +1 -3
  68. package/es/services/aabb/PolylineUpdater.js +1 -3
  69. package/es/services/aabb/RectUpdater.js +1 -3
  70. package/es/services/aabb/TextUpdater.js +1 -3
  71. package/es/services/text/OffscreenCanvasCreator.js +1 -3
  72. package/es/services/text/index.js +3 -5
  73. package/es/shapes/AABB.js +1 -3
  74. package/es/shapes/BoundingSphere.js +1 -3
  75. package/es/shapes/Frustum.js +1 -3
  76. package/es/shapes/Plane.js +1 -3
  77. package/es/shapes/Point.js +1 -3
  78. package/es/shapes/Polygon.js +1 -3
  79. package/es/shapes/Ray.js +1 -3
  80. package/es/shapes/Rect.js +1 -3
  81. package/es/shapes/Rectangle.js +1 -3
  82. package/es/utils/animation.js +1 -1
  83. package/es/utils/custom-easing.js +1 -1
  84. package/es/utils/path.d.ts +1 -1
  85. package/es/utils/path.js +3 -3
  86. package/es/utils/text.js +3 -3
  87. package/lib/AbstractRenderer.js +1 -3
  88. package/lib/Canvas.js +2 -4
  89. package/lib/DisplayObjectPool.js +1 -3
  90. package/lib/camera/Camera.js +2 -4
  91. package/lib/camera/Landmark.js +1 -3
  92. package/lib/components/Cullable.js +2 -4
  93. package/lib/components/Geometry.js +1 -3
  94. package/lib/components/Renderable.js +1 -3
  95. package/lib/components/Sortable.js +1 -3
  96. package/lib/components/Transform.js +1 -3
  97. package/lib/display-objects/Circle.js +1 -3
  98. package/lib/display-objects/CustomElement.js +1 -3
  99. package/lib/display-objects/DisplayObject.d.ts +5 -0
  100. package/lib/display-objects/DisplayObject.js +24 -6
  101. package/lib/display-objects/Ellipse.js +1 -3
  102. package/lib/display-objects/Group.js +1 -3
  103. package/lib/display-objects/HTML.js +4 -6
  104. package/lib/display-objects/Image.js +1 -3
  105. package/lib/display-objects/Line.js +1 -3
  106. package/lib/display-objects/Path.js +1 -3
  107. package/lib/display-objects/Polygon.js +1 -3
  108. package/lib/display-objects/Polyline.js +1 -3
  109. package/lib/display-objects/Rect.js +1 -3
  110. package/lib/display-objects/TSpan.d.ts +1 -0
  111. package/lib/display-objects/TSpan.js +1 -0
  112. package/lib/display-objects/Text.d.ts +23 -0
  113. package/lib/display-objects/Text.js +57 -4
  114. package/lib/dom/Animation.js +3 -5
  115. package/lib/dom/AnimationEffectTiming.js +1 -3
  116. package/lib/dom/AnimationEvent.js +1 -3
  117. package/lib/dom/AnimationTimeline.js +2 -4
  118. package/lib/dom/CustomElementRegistry.js +1 -3
  119. package/lib/dom/CustomEvent.js +1 -3
  120. package/lib/dom/Document.d.ts +1 -1
  121. package/lib/dom/Document.js +4 -6
  122. package/lib/dom/Element.d.ts +22 -0
  123. package/lib/dom/Element.js +68 -6
  124. package/lib/dom/EventTarget.js +3 -5
  125. package/lib/dom/FederatedEvent.d.ts +5 -2
  126. package/lib/dom/FederatedEvent.js +1 -3
  127. package/lib/dom/FederatedMouseEvent.js +1 -3
  128. package/lib/dom/FederatedPointerEvent.js +1 -3
  129. package/lib/dom/FederatedWheelEvent.js +1 -3
  130. package/lib/dom/KeyframeEffect.js +2 -4
  131. package/lib/dom/KeyframeList.js +1 -1
  132. package/lib/dom/MutationEvent.js +1 -3
  133. package/lib/dom/MutationObserver.js +4 -11
  134. package/lib/dom/MutationRecord.js +1 -3
  135. package/lib/dom/Node.js +2 -4
  136. package/lib/global-module.js +2 -3
  137. package/lib/index.js +1 -1
  138. package/lib/plugins/CullingPlugin.js +2 -4
  139. package/lib/plugins/DirtyCheckPlugin.js +1 -3
  140. package/lib/plugins/EventPlugin.d.ts +2 -1
  141. package/lib/plugins/EventPlugin.js +14 -8
  142. package/lib/plugins/FrustumCullingStrategy.js +1 -3
  143. package/lib/plugins/PrepareRendererPlugin.js +1 -3
  144. package/lib/property-handlers/color.js +5 -5
  145. package/lib/property-handlers/dimension.js +5 -6
  146. package/lib/property-handlers/inherit.js +1 -1
  147. package/lib/property-handlers/interfaces.js +1 -1
  148. package/lib/property-handlers/numeric.js +3 -3
  149. package/lib/property-handlers/path.d.ts +1 -1
  150. package/lib/property-handlers/path.js +1 -1
  151. package/lib/property-handlers/text.js +1 -1
  152. package/lib/property-handlers/transform.js +1 -1
  153. package/lib/services/EventService.js +3 -5
  154. package/lib/services/RenderingService.js +1 -3
  155. package/lib/services/SceneGraphSelector.js +2 -4
  156. package/lib/services/SceneGraphService.js +3 -5
  157. package/lib/services/aabb/CircleUpdater.js +1 -3
  158. package/lib/services/aabb/EllipseUpdater.js +1 -3
  159. package/lib/services/aabb/LineUpdater.js +1 -3
  160. package/lib/services/aabb/PathUpdater.js +1 -3
  161. package/lib/services/aabb/PolylineUpdater.js +1 -3
  162. package/lib/services/aabb/RectUpdater.js +1 -3
  163. package/lib/services/aabb/TextUpdater.js +1 -3
  164. package/lib/services/aabb/index.js +10 -10
  165. package/lib/services/aabb/interfaces.js +1 -1
  166. package/lib/services/text/OffscreenCanvasCreator.js +1 -3
  167. package/lib/services/text/index.js +3 -5
  168. package/lib/shapes/AABB.js +1 -3
  169. package/lib/shapes/BoundingSphere.js +1 -3
  170. package/lib/shapes/Frustum.js +2 -4
  171. package/lib/shapes/Plane.js +1 -3
  172. package/lib/shapes/Point.js +1 -3
  173. package/lib/shapes/Polygon.js +1 -3
  174. package/lib/shapes/Ray.js +1 -3
  175. package/lib/shapes/Rect.js +1 -3
  176. package/lib/shapes/Rectangle.js +1 -3
  177. package/lib/types.js +1 -1
  178. package/lib/utils/animation.js +3 -4
  179. package/lib/utils/bezier-easing.js +1 -1
  180. package/lib/utils/custom-easing.js +2 -2
  181. package/lib/utils/event.js +2 -3
  182. package/lib/utils/math.js +5 -5
  183. package/lib/utils/path.d.ts +1 -1
  184. package/lib/utils/path.js +6 -6
  185. package/lib/utils/raf.js +1 -2
  186. package/lib/utils/text.js +3 -3
  187. package/package.json +2 -2
  188. package/dist/index.umd.min.js +0 -31
@@ -5,9 +5,7 @@ import { GeometryAABBUpdater } from './interfaces';
5
5
  import { TextService } from '../text';
6
6
  import { Shape } from '../../types';
7
7
 
8
- var TextUpdater =
9
- /** @class */
10
- function () {
8
+ var TextUpdater = function () {
11
9
  function TextUpdater() {}
12
10
 
13
11
  TextUpdater.prototype.update = function (parsedStyle) {
@@ -1,9 +1,7 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { singleton } from 'mana-syringe';
3
3
 
4
- var OffscreenCanvasCreator =
5
- /** @class */
6
- function () {
4
+ var OffscreenCanvasCreator = function () {
7
5
  function OffscreenCanvasCreator() {}
8
6
 
9
7
  OffscreenCanvasCreator.prototype.getOrCreateCanvas = function () {
@@ -24,12 +24,10 @@ var regexCannotStartJaJp = /[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾー
24
24
  var regexCannotEndJaJp = /[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/;
25
25
  var regexCannotStartKoKr = /[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/;
26
26
  var regexCannotEndKoKr = /[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/;
27
- var regexCannotStart = new RegExp("".concat(regexCannotStartZhCn.source, "|").concat(regexCannotStartZhTw.source, "|").concat(regexCannotStartJaJp.source, "|").concat(regexCannotStartKoKr.source));
28
- var regexCannotEnd = new RegExp("".concat(regexCannotEndZhCn.source, "|").concat(regexCannotEndZhTw.source, "|").concat(regexCannotEndJaJp.source, "|").concat(regexCannotEndKoKr.source));
27
+ var regexCannotStart = new RegExp(regexCannotStartZhCn.source + "|" + regexCannotStartZhTw.source + "|" + regexCannotStartJaJp.source + "|" + regexCannotStartKoKr.source);
28
+ var regexCannotEnd = new RegExp(regexCannotEndZhCn.source + "|" + regexCannotEndZhTw.source + "|" + regexCannotEndJaJp.source + "|" + regexCannotEndKoKr.source);
29
29
 
30
- var TextService =
31
- /** @class */
32
- function () {
30
+ var TextService = function () {
33
31
  function TextService() {
34
32
  var _this = this;
35
33
 
package/es/shapes/AABB.js CHANGED
@@ -5,9 +5,7 @@ import { vec3 } from 'gl-matrix';
5
5
  * @see https://github.com/antvis/GWebGPUEngine/issues/3
6
6
  */
7
7
 
8
- var AABB =
9
- /** @class */
10
- function () {
8
+ var AABB = function () {
11
9
  function AABB(center, halfExtents) {
12
10
  this.min = vec3.create();
13
11
  this.max = vec3.create();
@@ -1,9 +1,7 @@
1
1
  import { vec3 } from 'gl-matrix';
2
2
  var tmpVecA = vec3.create();
3
3
 
4
- var BoundingSphere =
5
- /** @class */
6
- function () {
4
+ var BoundingSphere = function () {
7
5
  function BoundingSphere(center, radius) {
8
6
  this.center = center || vec3.create();
9
7
  this.radius = radius || 0.5;
@@ -9,9 +9,7 @@ export var Mask;
9
9
  Mask[Mask["INDETERMINATE"] = 2147483647] = "INDETERMINATE";
10
10
  })(Mask || (Mask = {}));
11
11
 
12
- var Frustum =
13
- /** @class */
14
- function () {
12
+ var Frustum = function () {
15
13
  function Frustum(planes) {
16
14
  this.planes = [];
17
15
 
@@ -1,8 +1,6 @@
1
1
  import { vec3 } from 'gl-matrix';
2
2
 
3
- var Plane =
4
- /** @class */
5
- function () {
3
+ var Plane = function () {
6
4
  function Plane(distance, normal) {
7
5
  this.distance = distance || 0;
8
6
  this.normal = normal || vec3.fromValues(0, 1, 0);
@@ -1,6 +1,4 @@
1
- var Point =
2
- /** @class */
3
- function () {
1
+ var Point = function () {
4
2
  function Point(x, y) {
5
3
  if (x === void 0) {
6
4
  x = 0;
@@ -1,6 +1,4 @@
1
- var PolygonShape =
2
- /** @class */
3
- function () {
1
+ var PolygonShape = function () {
4
2
  function PolygonShape() {
5
3
  var points = [];
6
4
 
package/es/shapes/Ray.js CHANGED
@@ -11,9 +11,7 @@ var tmpVecE = vec3.create();
11
11
  * @see https://github.com/mrdoob/three.js/blob/dev/src/math/Ray.js
12
12
  */
13
13
 
14
- var Ray =
15
- /** @class */
16
- function () {
14
+ var Ray = function () {
17
15
  function Ray(origin, direction) {
18
16
  this.origin = origin || vec3.create();
19
17
  this.direction = direction || vec3.fromValues(0, 0, -1);
package/es/shapes/Rect.js CHANGED
@@ -1,6 +1,4 @@
1
- var Rect =
2
- /** @class */
3
- function () {
1
+ var Rect = function () {
4
2
  function Rect(x, y, width, height) {
5
3
  this.x = x;
6
4
  this.y = y;
@@ -1,6 +1,4 @@
1
- var Rectangle =
2
- /** @class */
3
- function () {
1
+ var Rectangle = function () {
4
2
  function Rectangle(x, y, width, height) {
5
3
  this.x = x;
6
4
  this.y = y;
@@ -82,7 +82,7 @@ function calculatePhase(activeDuration, localTime, timing) {
82
82
  return PhaseNone;
83
83
  }
84
84
 
85
- var endTime = timing.delay + activeDuration + timing.endDelay;
85
+ var endTime = timing.endTime;
86
86
 
87
87
  if (localTime < Math.min(timing.delay, endTime)) {
88
88
  return PhaseBefore;
@@ -6,7 +6,7 @@ import { __read, __spreadArray } from "tslib";
6
6
  import { bezier } from './bezier-easing';
7
7
  export var convertToDash = function convertToDash(str) {
8
8
  str = str.replace(/([A-Z])/g, function (letter) {
9
- return "-".concat(letter.toLowerCase());
9
+ return "-" + letter.toLowerCase();
10
10
  }); // Remove first dash
11
11
 
12
12
  return str.charAt(0) === '-' ? str.substr(1) : str;
@@ -5,7 +5,7 @@ export declare function getDrawDirection(pathArray: PathCommand[]): boolean;
5
5
  export declare function getPathArea(pathArray: PathCommand[]): number;
6
6
  export declare function reverseCurve(pathArray: PathCommand[]): PathCommand[];
7
7
  export declare function clonePath(pathArray: PathCommand[]): PathCommand[];
8
- export declare function getRotatedCurve(a: PathCommand[], b: PathCommand[]): (string[] | ["a" | "A", number, number, number, number, number, number, number] | ["C" | "c", number, number, number, number, number, number] | ["o" | "O", number, number] | ["h" | "H", number] | ["l" | "L", number, number] | ["m" | "M", number, number] | ["r" | "R", number, number, number, number] | ["q" | "Q", number, number, number, number] | ["s" | "S", number, number, number, number, number, number, number] | ["t" | "T", number, number] | ["v" | "V", number] | ["u" | "U", number, number, number])[];
8
+ export declare function getRotatedCurve(a: PathCommand[], b: PathCommand[]): (string[] | ["a" | "A", number, number, number, number, number, number, number] | ["C" | "c", number, number, number, number, number, number] | ["o" | "O", number, number] | ["h" | "H", number] | ["l" | "L", number, number] | ["m" | "M", number, number] | ["r" | "R", number, number, number, number] | ["Q" | "q", number, number, number, number] | ["s" | "S", number, number, number, number, number, number, number] | ["t" | "T", number, number] | ["v" | "V", number] | ["u" | "U", number, number, number])[];
9
9
  /**
10
10
  * convert object to path, should account for:
11
11
  * * transform & origin
package/es/utils/path.js CHANGED
@@ -214,7 +214,7 @@ function commandsToPathString(commands, localTransform, anchor, parsedStyle) {
214
214
  if (cur[0] === 'M' || cur[0] === 'L') {
215
215
  var p = vec3.fromValues(cur[1] - x, cur[2] - y, 0);
216
216
  vec3.transformMat4(p, p, localTransform);
217
- path = "".concat(cur[0]).concat(p[0], ",").concat(p[1]);
217
+ path = "" + cur[0] + p[0] + "," + p[1];
218
218
  } else if (cur[0] === 'Z') {
219
219
  path = cur[0];
220
220
  } else if (cur[0] === 'C') {
@@ -224,11 +224,11 @@ function commandsToPathString(commands, localTransform, anchor, parsedStyle) {
224
224
  vec3.transformMat4(p1, p1, localTransform);
225
225
  vec3.transformMat4(p2, p2, localTransform);
226
226
  vec3.transformMat4(p3, p3, localTransform);
227
- path = "".concat(cur[0]).concat(p1[0], ",").concat(p1[1], ",").concat(p2[0], ",").concat(p2[1], ",").concat(p3[0], ",").concat(p3[1]);
227
+ path = "" + cur[0] + p1[0] + "," + p1[1] + "," + p2[0] + "," + p2[1] + "," + p3[0] + "," + p3[1];
228
228
  } else if (cur[0] === 'A') {
229
229
  var c = vec3.fromValues(cur[6] - x, cur[7] - y, 0);
230
230
  vec3.transformMat4(c, c, localTransform);
231
- path = "".concat(cur[0]).concat(cur[1], ",").concat(cur[2], ",").concat(cur[3], ",").concat(cur[4], ",").concat(cur[5], ",").concat(c[0], ",").concat(c[1]);
231
+ path = "" + cur[0] + cur[1] + "," + cur[2] + "," + cur[3] + "," + cur[4] + "," + cur[5] + "," + c[0] + "," + c[1];
232
232
  }
233
233
 
234
234
  return prev += path;
package/es/utils/text.js CHANGED
@@ -7,7 +7,7 @@ export function toFontString(attributes) {
7
7
  fontVariant = attributes.fontVariant,
8
8
  fontWeight = attributes.fontWeight; // build canvas api font setting from individual components. Convert a numeric this.fontSize to px
9
9
 
10
- var fontSizeString = isNumber(fontSize) ? "".concat(fontSize, "px") : "".concat(fontSize.value).concat(fontSize.unit || 'px'); // Clean-up fontFamily property by quoting each font name
10
+ var fontSizeString = isNumber(fontSize) ? fontSize + "px" : "" + fontSize.value + (fontSize.unit || 'px'); // Clean-up fontFamily property by quoting each font name
11
11
  // this will support font names with spaces
12
12
  // @ts-ignore
13
13
 
@@ -22,11 +22,11 @@ export function toFontString(attributes) {
22
22
  var fontFamily_1 = fontFamilies[i].trim(); // Check if font already contains strings
23
23
 
24
24
  if (!/([\"\'])[^\'\"]+\1/.test(fontFamily_1) && genericFontFamilies.indexOf(fontFamily_1) < 0) {
25
- fontFamily_1 = "\"".concat(fontFamily_1, "\"");
25
+ fontFamily_1 = "\"" + fontFamily_1 + "\"";
26
26
  }
27
27
 
28
28
  fontFamilies[i] = fontFamily_1;
29
29
  }
30
30
 
31
- return "".concat(fontStyle, " ").concat(fontVariant, " ").concat(fontWeight, " ").concat(fontSizeString, " ").concat(fontFamilies.join(','));
31
+ return fontStyle + " " + fontVariant + " " + fontWeight + " " + fontSizeString + " " + fontFamilies.join(',');
32
32
  }
@@ -7,9 +7,7 @@ exports.AbstractRenderer = void 0;
7
7
 
8
8
  var _tslib = require("tslib");
9
9
 
10
- var AbstractRenderer =
11
- /** @class */
12
- function () {
10
+ var AbstractRenderer = function () {
13
11
  function AbstractRenderer(config) {
14
12
  this.plugins = [];
15
13
  this.config = (0, _tslib.__assign)({
package/lib/Canvas.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.CanvasEvent = exports.Canvas = void 0;
6
+ exports.Canvas = exports.CanvasEvent = void 0;
7
7
 
8
8
  var _tslib = require("tslib");
9
9
 
@@ -51,9 +51,7 @@ exports.CanvasEvent = CanvasEvent;
51
51
  */
52
52
 
53
53
 
54
- var Canvas =
55
- /** @class */
56
- function (_super) {
54
+ var Canvas = function (_super) {
57
55
  (0, _tslib.__extends)(Canvas, _super);
58
56
 
59
57
  function Canvas(config) {
@@ -9,9 +9,7 @@ var _tslib = require("tslib");
9
9
 
10
10
  var _manaSyringe = require("mana-syringe");
11
11
 
12
- var DisplayObjectPool =
13
- /** @class */
14
- function () {
12
+ var DisplayObjectPool = function () {
15
13
  function DisplayObjectPool() {
16
14
  this.pool = {};
17
15
  }
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.DefaultCamera = exports.CameraEvent = exports.Camera = exports.CAMERA_TYPE = exports.CAMERA_TRACKING_MODE = exports.CAMERA_PROJECTION_MODE = void 0;
6
+ exports.Camera = exports.CameraEvent = exports.CAMERA_PROJECTION_MODE = exports.CAMERA_TRACKING_MODE = exports.CAMERA_TYPE = exports.DefaultCamera = void 0;
7
7
 
8
8
  var _tslib = require("tslib");
9
9
 
@@ -63,9 +63,7 @@ var RAD_2_DEG = 180 / Math.PI;
63
63
  * 4. 移动到 Landmark,具有平滑的动画效果,其间禁止其他用户交互
64
64
  */
65
65
 
66
- var Camera =
67
- /** @class */
68
- function (_super) {
66
+ var Camera = function (_super) {
69
67
  (0, _tslib.__extends)(Camera, _super);
70
68
 
71
69
  function Camera() {
@@ -10,9 +10,7 @@ var _glMatrix = require("gl-matrix");
10
10
  /**
11
11
  * 保存相机状态,便于后续在多个 Landmark 间移动
12
12
  */
13
- var Landmark =
14
- /** @class */
15
- function () {
13
+ var Landmark = function () {
16
14
  // private zoom = 1;
17
15
  function Landmark(name, c) {
18
16
  this.azimuth = 0;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Strategy = exports.Cullable = void 0;
6
+ exports.Cullable = exports.Strategy = void 0;
7
7
 
8
8
  /**
9
9
  * @see https://doc.babylonjs.com/how_to/optimizing_your_scene#changing-mesh-culling-strategy
@@ -15,9 +15,7 @@ exports.Strategy = Strategy;
15
15
  Strategy[Strategy["Standard"] = 0] = "Standard";
16
16
  })(Strategy || (exports.Strategy = Strategy = {}));
17
17
 
18
- var Cullable =
19
- /** @class */
20
- function () {
18
+ var Cullable = function () {
21
19
  function Cullable() {
22
20
  this.strategy = Strategy.Standard;
23
21
  this.visibilityPlaneMask = -1;
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Geometry = void 0;
7
7
 
8
- var Geometry =
9
- /** @class */
10
- function () {
8
+ var Geometry = function () {
11
9
  function Geometry() {}
12
10
 
13
11
  Geometry.tag = 'c-geometry';
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Renderable = void 0;
7
7
 
8
- var Renderable =
9
- /** @class */
10
- function () {
8
+ var Renderable = function () {
11
9
  function Renderable() {
12
10
  this.boundsDirty = true;
13
11
  this.renderBoundsDirty = true;
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Sortable = void 0;
7
7
 
8
- var Sortable =
9
- /** @class */
10
- function () {
8
+ var Sortable = function () {
11
9
  function Sortable() {
12
10
  /**
13
11
  * need to re-sort
@@ -10,9 +10,7 @@ var _glMatrix = require("gl-matrix");
10
10
  /**
11
11
  * do RTS transformation for 2D/3D
12
12
  */
13
- var Transform =
14
- /** @class */
15
- function () {
13
+ var Transform = function () {
16
14
  function Transform() {
17
15
  this.dirtyFlag = false;
18
16
  this.localDirtyFlag = false;
@@ -11,9 +11,7 @@ var _types = require("../types");
11
11
 
12
12
  var _DisplayObject = require("./DisplayObject");
13
13
 
14
- var Circle =
15
- /** @class */
16
- function (_super) {
14
+ var Circle = function (_super) {
17
15
  (0, _tslib.__extends)(Circle, _super);
18
16
 
19
17
  function Circle(_a) {
@@ -15,9 +15,7 @@ var _interfaces = require("../dom/interfaces");
15
15
  * shadow root
16
16
  * @see https://yuque.antfin-inc.com/antv/czqvg5/pgqipg
17
17
  */
18
- var CustomElement =
19
- /** @class */
20
- function (_super) {
18
+ var CustomElement = function (_super) {
21
19
  (0, _tslib.__extends)(CustomElement, _super); // private shadowNodes: DisplayObject[] = [];
22
20
 
23
21
  function CustomElement(config) {
@@ -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
  /**
@@ -29,6 +29,8 @@ var _services = require("../services");
29
29
 
30
30
  var _MutationEvent = require("../dom/MutationEvent");
31
31
 
32
+ var _shapes = require("../shapes");
33
+
32
34
  var DEFAULT_STYLE_PROPS = {
33
35
  anchor: [0, 0, 0],
34
36
  origin: [0, 0, 0],
@@ -57,21 +59,18 @@ var DEFAULT_STYLE_PROPS = {
57
59
  * * attributeChanged
58
60
  */
59
61
 
60
- var DisplayObject =
61
- /** @class */
62
- function (_super) {
62
+ var DisplayObject = function (_super) {
63
63
  (0, _tslib.__extends)(DisplayObject, _super);
64
64
 
65
65
  function DisplayObject(config) {
66
- var _this = this;
67
-
68
66
  var _a, _b, _c;
69
67
 
70
- _this = _super.call(this) || this;
68
+ var _this = _super.call(this) || this;
71
69
  /**
72
70
  * push to active animations after calling `animate()`
73
71
  */
74
72
 
73
+
75
74
  _this.activeAnimations = []; // assign name, id to config
76
75
  // eg. group.get('name')
77
76
 
@@ -302,6 +301,25 @@ function (_super) {
302
301
  // });
303
302
  }; // #region transformable
304
303
 
304
+ /**
305
+ * returns different values than getBoundingClientRect(), as the latter returns value relative to the viewport
306
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/SVGGraphicsElement/getBBox
307
+ */
308
+
309
+
310
+ DisplayObject.prototype.getBBox = function () {
311
+ var aabb = this.getBounds();
312
+
313
+ var _a = (0, _tslib.__read)(aabb.getMin(), 2),
314
+ left = _a[0],
315
+ top = _a[1];
316
+
317
+ var _b = (0, _tslib.__read)(aabb.getMax(), 2),
318
+ right = _b[0],
319
+ bottom = _b[1];
320
+
321
+ return new _shapes.Rectangle(left, top, right - left, bottom - top);
322
+ };
305
323
 
306
324
  DisplayObject.prototype.setOrigin = function (position, y, z) {
307
325
  if (y === void 0) {
@@ -11,9 +11,7 @@ var _types = require("../types");
11
11
 
12
12
  var _DisplayObject = require("./DisplayObject");
13
13
 
14
- var Ellipse =
15
- /** @class */
16
- function (_super) {
14
+ var Ellipse = function (_super) {
17
15
  (0, _tslib.__extends)(Ellipse, _super);
18
16
 
19
17
  function Ellipse(_a) {
@@ -11,9 +11,7 @@ var _types = require("../types");
11
11
 
12
12
  var _DisplayObject = require("./DisplayObject");
13
13
 
14
- var Group =
15
- /** @class */
16
- function (_super) {
14
+ var Group = function (_super) {
17
15
  (0, _tslib.__extends)(Group, _super);
18
16
 
19
17
  function Group(_a) {
@@ -19,9 +19,7 @@ var _glMatrix = require("gl-matrix");
19
19
  * HTML container
20
20
  * @see https://github.com/pmndrs/drei#html
21
21
  */
22
- var HTML =
23
- /** @class */
24
- function (_super) {
22
+ var HTML = function (_super) {
25
23
  (0, _tslib.__extends)(HTML, _super);
26
24
 
27
25
  function HTML(_a) {
@@ -29,11 +27,10 @@ function (_super) {
29
27
  _a = {};
30
28
  }
31
29
 
32
- var _this = this;
33
-
34
30
  var style = _a.style,
35
31
  rest = (0, _tslib.__rest)(_a, ["style"]);
36
- _this = _super.call(this, (0, _tslib.__assign)({
32
+
33
+ var _this = _super.call(this, (0, _tslib.__assign)({
37
34
  type: _types.Shape.HTML,
38
35
  style: (0, _tslib.__assign)({
39
36
  innerHTML: '',
@@ -41,6 +38,7 @@ function (_super) {
41
38
  style: ''
42
39
  }, style)
43
40
  }, rest)) || this;
41
+
44
42
  _this.cullable.enable = false;
45
43
  return _this;
46
44
  }
@@ -11,9 +11,7 @@ var _types = require("../types");
11
11
 
12
12
  var _DisplayObject = require("./DisplayObject");
13
13
 
14
- var Image =
15
- /** @class */
16
- function (_super) {
14
+ var Image = function (_super) {
17
15
  (0, _tslib.__extends)(Image, _super);
18
16
 
19
17
  function Image(_a) {
@@ -15,9 +15,7 @@ var _DisplayObject = require("./DisplayObject");
15
15
 
16
16
  var _shapes = require("../shapes");
17
17
 
18
- var Line =
19
- /** @class */
20
- function (_super) {
18
+ var Line = function (_super) {
21
19
  (0, _tslib.__extends)(Line, _super);
22
20
 
23
21
  function Line(_a) {
@@ -17,9 +17,7 @@ var _gMath = require("@antv/g-math");
17
17
 
18
18
  var _util = require("@antv/util");
19
19
 
20
- var Path =
21
- /** @class */
22
- function (_super) {
20
+ var Path = function (_super) {
23
21
  (0, _tslib.__extends)(Path, _super);
24
22
 
25
23
  function Path(_a) {
@@ -11,9 +11,7 @@ var _types = require("../types");
11
11
 
12
12
  var _DisplayObject = require("./DisplayObject");
13
13
 
14
- var Polygon =
15
- /** @class */
16
- function (_super) {
14
+ var Polygon = function (_super) {
17
15
  (0, _tslib.__extends)(Polygon, _super);
18
16
 
19
17
  function Polygon(_a) {
@@ -15,9 +15,7 @@ var _DisplayObject = require("./DisplayObject");
15
15
 
16
16
  var _shapes = require("../shapes");
17
17
 
18
- var Polyline =
19
- /** @class */
20
- function (_super) {
18
+ var Polyline = function (_super) {
21
19
  (0, _tslib.__extends)(Polyline, _super);
22
20
 
23
21
  function Polyline(_a) {
@@ -11,9 +11,7 @@ var _types = require("../types");
11
11
 
12
12
  var _DisplayObject = require("./DisplayObject");
13
13
 
14
- var Rect =
15
- /** @class */
16
- function (_super) {
14
+ var Rect = function (_super) {
17
15
  (0, _tslib.__extends)(Rect, _super);
18
16
 
19
17
  function Rect(_a) {
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+ "use strict";
@@ -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
  }