@antv/g 5.0.14 → 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 (305) hide show
  1. package/es/AbstractRenderer.js +1 -3
  2. package/es/Canvas.d.ts +3 -0
  3. package/es/Canvas.js +10 -12
  4. package/es/DisplayObjectPool.js +1 -3
  5. package/es/camera/Camera.d.ts +3 -2
  6. package/es/camera/Camera.js +17 -11
  7. package/es/camera/Landmark.js +1 -3
  8. package/es/canvas-module.js +11 -17
  9. package/es/components/Cullable.js +1 -3
  10. package/es/components/Geometry.js +1 -3
  11. package/es/components/Renderable.js +1 -3
  12. package/es/components/Sortable.js +1 -3
  13. package/es/components/Transform.d.ts +0 -1
  14. package/es/components/Transform.js +1 -4
  15. package/es/display-objects/Circle.d.ts +4 -2
  16. package/es/display-objects/Circle.js +9 -6
  17. package/es/display-objects/CustomElement.d.ts +3 -2
  18. package/es/display-objects/CustomElement.js +10 -9
  19. package/es/display-objects/DisplayObject.d.ts +9 -3
  20. package/es/display-objects/DisplayObject.js +98 -50
  21. package/es/display-objects/Ellipse.d.ts +6 -3
  22. package/es/display-objects/Ellipse.js +9 -6
  23. package/es/display-objects/Group.d.ts +18 -2
  24. package/es/display-objects/Group.js +15 -12
  25. package/es/display-objects/HTML.d.ts +6 -1
  26. package/es/display-objects/HTML.js +8 -6
  27. package/es/display-objects/Image.d.ts +12 -7
  28. package/es/display-objects/Image.js +11 -6
  29. package/es/display-objects/Line.d.ts +1 -1
  30. package/es/display-objects/Line.js +13 -7
  31. package/es/display-objects/Path.d.ts +3 -2
  32. package/es/display-objects/Path.js +11 -8
  33. package/es/display-objects/Polygon.d.ts +1 -1
  34. package/es/display-objects/Polygon.js +10 -6
  35. package/es/display-objects/Polyline.d.ts +1 -1
  36. package/es/display-objects/Polyline.js +11 -8
  37. package/es/display-objects/Rect.d.ts +8 -5
  38. package/es/display-objects/Rect.js +10 -7
  39. package/es/display-objects/TSpan.d.ts +1 -0
  40. package/es/display-objects/TSpan.js +0 -0
  41. package/es/display-objects/Text.d.ts +32 -4
  42. package/es/display-objects/Text.js +71 -14
  43. package/es/dom/Animation.js +2 -4
  44. package/es/dom/AnimationEffectTiming.js +1 -3
  45. package/es/dom/AnimationEvent.js +1 -3
  46. package/es/dom/AnimationTimeline.js +2 -5
  47. package/es/dom/CustomElementRegistry.js +13 -15
  48. package/es/dom/CustomEvent.js +1 -3
  49. package/es/dom/Document.d.ts +2 -1
  50. package/es/dom/Document.js +23 -5
  51. package/es/dom/Element.d.ts +36 -9
  52. package/es/dom/Element.js +103 -15
  53. package/es/dom/EventTarget.d.ts +2 -2
  54. package/es/dom/EventTarget.js +3 -4
  55. package/es/dom/FederatedEvent.d.ts +5 -2
  56. package/es/dom/FederatedEvent.js +1 -3
  57. package/es/dom/FederatedMouseEvent.js +1 -3
  58. package/es/dom/FederatedPointerEvent.js +1 -3
  59. package/es/dom/FederatedWheelEvent.js +1 -3
  60. package/es/dom/KeyframeEffect.js +1 -3
  61. package/es/dom/MutationEvent.d.ts +15 -0
  62. package/es/dom/MutationEvent.js +27 -0
  63. package/es/dom/MutationObserver.d.ts +36 -0
  64. package/es/dom/MutationObserver.js +406 -0
  65. package/es/dom/MutationRecord.d.ts +14 -0
  66. package/es/dom/MutationRecord.js +29 -0
  67. package/es/dom/Node.d.ts +35 -3
  68. package/es/dom/Node.js +185 -20
  69. package/es/dom/index.d.ts +3 -0
  70. package/es/dom/index.js +3 -0
  71. package/es/dom/interfaces.d.ts +36 -8
  72. package/es/dom/interfaces.js +23 -5
  73. package/es/global-module.d.ts +4 -1
  74. package/es/global-module.js +36 -79
  75. package/es/index.d.ts +1 -0
  76. package/es/index.js +1 -0
  77. package/es/plugins/CullingPlugin.d.ts +0 -2
  78. package/es/plugins/CullingPlugin.js +4 -27
  79. package/es/plugins/DirtyCheckPlugin.js +3 -5
  80. package/es/plugins/EventPlugin.d.ts +2 -1
  81. package/es/plugins/EventPlugin.js +16 -8
  82. package/es/plugins/FrustumCullingStrategy.d.ts +1 -0
  83. package/es/plugins/FrustumCullingStrategy.js +40 -35
  84. package/es/plugins/PrepareRendererPlugin.js +22 -8
  85. package/es/property-handlers/aabb.js +22 -24
  86. package/es/property-handlers/anchor.js +2 -1
  87. package/es/property-handlers/color.js +3 -0
  88. package/es/property-handlers/dimension.d.ts +15 -2
  89. package/es/property-handlers/dimension.js +77 -8
  90. package/es/property-handlers/index.d.ts +3 -0
  91. package/es/property-handlers/index.js +4 -1
  92. package/es/property-handlers/inherit.d.ts +6 -0
  93. package/es/property-handlers/inherit.js +25 -0
  94. package/es/property-handlers/interfaces.d.ts +2 -2
  95. package/es/property-handlers/lineDash.d.ts +6 -1
  96. package/es/property-handlers/lineDash.js +23 -4
  97. package/es/property-handlers/offsetDistance.js +2 -2
  98. package/es/property-handlers/path.d.ts +1 -1
  99. package/es/property-handlers/text.d.ts +2 -0
  100. package/es/property-handlers/text.js +3 -0
  101. package/es/property-handlers/textTransform.d.ts +6 -0
  102. package/es/property-handlers/textTransform.js +19 -0
  103. package/es/services/EventService.js +2 -6
  104. package/es/services/RenderingContext.d.ts +5 -8
  105. package/es/services/RenderingContext.js +6 -7
  106. package/es/services/RenderingService.js +3 -11
  107. package/es/services/SceneGraphSelector.d.ts +3 -2
  108. package/es/services/SceneGraphSelector.js +9 -7
  109. package/es/services/SceneGraphService.d.ts +7 -14
  110. package/es/services/SceneGraphService.js +15 -85
  111. package/es/services/aabb/CircleUpdater.d.ts +2 -2
  112. package/es/services/aabb/CircleUpdater.js +22 -14
  113. package/es/services/aabb/EllipseUpdater.d.ts +2 -2
  114. package/es/services/aabb/EllipseUpdater.js +29 -16
  115. package/es/services/aabb/LineUpdater.js +3 -5
  116. package/es/services/aabb/PathUpdater.js +3 -5
  117. package/es/services/aabb/PolylineUpdater.js +4 -6
  118. package/es/services/aabb/RectUpdater.d.ts +2 -2
  119. package/es/services/aabb/RectUpdater.js +32 -21
  120. package/es/services/aabb/TextUpdater.js +20 -13
  121. package/es/services/text/OffscreenCanvasCreator.js +1 -3
  122. package/es/services/text/index.js +18 -22
  123. package/es/shapes/AABB.d.ts +1 -0
  124. package/es/shapes/AABB.js +9 -3
  125. package/es/shapes/BoundingSphere.js +1 -3
  126. package/es/shapes/Frustum.js +1 -3
  127. package/es/shapes/Plane.js +1 -3
  128. package/es/shapes/Point.js +1 -3
  129. package/es/shapes/Polygon.js +1 -3
  130. package/es/shapes/Ray.js +1 -3
  131. package/es/shapes/Rect.js +1 -3
  132. package/es/shapes/Rectangle.js +1 -3
  133. package/es/types.d.ts +48 -26
  134. package/es/types.js +50 -31
  135. package/es/utils/animation.js +1 -1
  136. package/es/utils/event.js +5 -3
  137. package/es/utils/index.d.ts +1 -0
  138. package/es/utils/index.js +2 -1
  139. package/es/utils/interpolation.d.ts +1 -0
  140. package/es/utils/interpolation.js +41 -8
  141. package/es/utils/path.d.ts +1 -1
  142. package/es/utils/path.js +13 -13
  143. package/es/utils/raf.d.ts +1 -1
  144. package/es/utils/raf.js +0 -2
  145. package/es/utils/string.d.ts +1 -0
  146. package/es/utils/string.js +9 -0
  147. package/es/utils/text.js +1 -1
  148. package/lib/AbstractRenderer.js +1 -3
  149. package/lib/Canvas.d.ts +3 -0
  150. package/lib/Canvas.js +9 -11
  151. package/lib/DisplayObjectPool.js +1 -3
  152. package/lib/camera/Camera.d.ts +3 -2
  153. package/lib/camera/Camera.js +21 -13
  154. package/lib/camera/Landmark.js +1 -3
  155. package/lib/canvas-module.js +10 -15
  156. package/lib/components/Cullable.js +2 -4
  157. package/lib/components/Geometry.js +1 -3
  158. package/lib/components/Renderable.js +1 -3
  159. package/lib/components/Sortable.js +1 -3
  160. package/lib/components/Transform.d.ts +0 -1
  161. package/lib/components/Transform.js +1 -4
  162. package/lib/display-objects/Circle.d.ts +4 -2
  163. package/lib/display-objects/Circle.js +8 -5
  164. package/lib/display-objects/CustomElement.d.ts +3 -2
  165. package/lib/display-objects/CustomElement.js +10 -9
  166. package/lib/display-objects/DisplayObject.d.ts +9 -3
  167. package/lib/display-objects/DisplayObject.js +98 -47
  168. package/lib/display-objects/Ellipse.d.ts +6 -3
  169. package/lib/display-objects/Ellipse.js +8 -5
  170. package/lib/display-objects/Group.d.ts +18 -2
  171. package/lib/display-objects/Group.js +14 -12
  172. package/lib/display-objects/HTML.d.ts +6 -1
  173. package/lib/display-objects/HTML.js +7 -5
  174. package/lib/display-objects/Image.d.ts +12 -7
  175. package/lib/display-objects/Image.js +10 -5
  176. package/lib/display-objects/Line.d.ts +1 -1
  177. package/lib/display-objects/Line.js +12 -6
  178. package/lib/display-objects/Path.d.ts +3 -2
  179. package/lib/display-objects/Path.js +10 -7
  180. package/lib/display-objects/Polygon.d.ts +1 -1
  181. package/lib/display-objects/Polygon.js +9 -5
  182. package/lib/display-objects/Polyline.d.ts +1 -1
  183. package/lib/display-objects/Polyline.js +10 -7
  184. package/lib/display-objects/Rect.d.ts +8 -5
  185. package/lib/display-objects/Rect.js +9 -6
  186. package/lib/display-objects/TSpan.d.ts +1 -0
  187. package/lib/display-objects/TSpan.js +1 -0
  188. package/lib/display-objects/Text.d.ts +32 -4
  189. package/lib/display-objects/Text.js +71 -13
  190. package/lib/dom/Animation.js +2 -4
  191. package/lib/dom/AnimationEffectTiming.js +1 -3
  192. package/lib/dom/AnimationEvent.js +1 -3
  193. package/lib/dom/AnimationTimeline.js +3 -6
  194. package/lib/dom/CustomElementRegistry.js +12 -14
  195. package/lib/dom/CustomEvent.js +1 -3
  196. package/lib/dom/Document.d.ts +2 -1
  197. package/lib/dom/Document.js +25 -6
  198. package/lib/dom/Element.d.ts +36 -9
  199. package/lib/dom/Element.js +105 -15
  200. package/lib/dom/EventTarget.d.ts +2 -2
  201. package/lib/dom/EventTarget.js +3 -4
  202. package/lib/dom/FederatedEvent.d.ts +5 -2
  203. package/lib/dom/FederatedEvent.js +1 -3
  204. package/lib/dom/FederatedMouseEvent.js +1 -3
  205. package/lib/dom/FederatedPointerEvent.js +1 -3
  206. package/lib/dom/FederatedWheelEvent.js +1 -3
  207. package/lib/dom/KeyframeEffect.js +2 -4
  208. package/lib/dom/MutationEvent.d.ts +15 -0
  209. package/lib/dom/MutationEvent.js +35 -0
  210. package/lib/dom/MutationObserver.d.ts +36 -0
  211. package/lib/dom/MutationObserver.js +417 -0
  212. package/lib/dom/MutationRecord.d.ts +14 -0
  213. package/lib/dom/MutationRecord.js +36 -0
  214. package/lib/dom/Node.d.ts +35 -3
  215. package/lib/dom/Node.js +186 -19
  216. package/lib/dom/index.d.ts +3 -0
  217. package/lib/dom/index.js +39 -0
  218. package/lib/dom/interfaces.d.ts +36 -8
  219. package/lib/dom/interfaces.js +23 -5
  220. package/lib/global-module.d.ts +4 -1
  221. package/lib/global-module.js +42 -76
  222. package/lib/index.d.ts +1 -0
  223. package/lib/index.js +2 -0
  224. package/lib/plugins/CullingPlugin.d.ts +0 -2
  225. package/lib/plugins/CullingPlugin.js +4 -27
  226. package/lib/plugins/DirtyCheckPlugin.js +2 -4
  227. package/lib/plugins/EventPlugin.d.ts +2 -1
  228. package/lib/plugins/EventPlugin.js +14 -8
  229. package/lib/plugins/FrustumCullingStrategy.d.ts +1 -0
  230. package/lib/plugins/FrustumCullingStrategy.js +41 -35
  231. package/lib/plugins/PrepareRendererPlugin.js +25 -7
  232. package/lib/property-handlers/aabb.js +21 -23
  233. package/lib/property-handlers/anchor.js +3 -1
  234. package/lib/property-handlers/color.js +5 -2
  235. package/lib/property-handlers/dimension.d.ts +15 -2
  236. package/lib/property-handlers/dimension.js +84 -12
  237. package/lib/property-handlers/index.d.ts +3 -0
  238. package/lib/property-handlers/index.js +39 -0
  239. package/lib/property-handlers/inherit.d.ts +6 -0
  240. package/lib/property-handlers/inherit.js +34 -0
  241. package/lib/property-handlers/interfaces.d.ts +2 -2
  242. package/lib/property-handlers/interfaces.js +1 -1
  243. package/lib/property-handlers/lineDash.d.ts +6 -1
  244. package/lib/property-handlers/lineDash.js +25 -4
  245. package/lib/property-handlers/numeric.js +3 -3
  246. package/lib/property-handlers/offsetDistance.js +1 -1
  247. package/lib/property-handlers/path.d.ts +1 -1
  248. package/lib/property-handlers/path.js +1 -1
  249. package/lib/property-handlers/text.d.ts +2 -0
  250. package/lib/property-handlers/text.js +10 -0
  251. package/lib/property-handlers/textTransform.d.ts +6 -0
  252. package/lib/property-handlers/textTransform.js +27 -0
  253. package/lib/property-handlers/transform.js +1 -1
  254. package/lib/services/EventService.js +2 -6
  255. package/lib/services/RenderingContext.d.ts +5 -8
  256. package/lib/services/RenderingContext.js +8 -9
  257. package/lib/services/RenderingService.js +2 -10
  258. package/lib/services/SceneGraphSelector.d.ts +3 -2
  259. package/lib/services/SceneGraphSelector.js +12 -7
  260. package/lib/services/SceneGraphService.d.ts +7 -14
  261. package/lib/services/SceneGraphService.js +18 -87
  262. package/lib/services/aabb/CircleUpdater.d.ts +2 -2
  263. package/lib/services/aabb/CircleUpdater.js +21 -13
  264. package/lib/services/aabb/EllipseUpdater.d.ts +2 -2
  265. package/lib/services/aabb/EllipseUpdater.js +28 -15
  266. package/lib/services/aabb/LineUpdater.js +2 -4
  267. package/lib/services/aabb/PathUpdater.js +2 -4
  268. package/lib/services/aabb/PolylineUpdater.js +3 -5
  269. package/lib/services/aabb/RectUpdater.d.ts +2 -2
  270. package/lib/services/aabb/RectUpdater.js +31 -20
  271. package/lib/services/aabb/TextUpdater.js +19 -12
  272. package/lib/services/aabb/index.js +10 -10
  273. package/lib/services/aabb/interfaces.js +1 -1
  274. package/lib/services/text/OffscreenCanvasCreator.js +1 -3
  275. package/lib/services/text/index.js +18 -22
  276. package/lib/shapes/AABB.d.ts +1 -0
  277. package/lib/shapes/AABB.js +9 -3
  278. package/lib/shapes/BoundingSphere.js +1 -3
  279. package/lib/shapes/Frustum.js +2 -4
  280. package/lib/shapes/Plane.js +1 -3
  281. package/lib/shapes/Point.js +1 -3
  282. package/lib/shapes/Polygon.js +1 -3
  283. package/lib/shapes/Ray.js +1 -3
  284. package/lib/shapes/Rect.js +1 -3
  285. package/lib/shapes/Rectangle.js +1 -3
  286. package/lib/types.d.ts +48 -26
  287. package/lib/types.js +56 -35
  288. package/lib/utils/animation.js +3 -4
  289. package/lib/utils/bezier-easing.js +1 -1
  290. package/lib/utils/custom-easing.js +1 -1
  291. package/lib/utils/event.js +7 -6
  292. package/lib/utils/index.d.ts +1 -0
  293. package/lib/utils/index.js +13 -0
  294. package/lib/utils/interpolation.d.ts +1 -0
  295. package/lib/utils/interpolation.js +43 -7
  296. package/lib/utils/math.js +5 -5
  297. package/lib/utils/path.d.ts +1 -1
  298. package/lib/utils/path.js +15 -15
  299. package/lib/utils/raf.d.ts +1 -1
  300. package/lib/utils/raf.js +1 -4
  301. package/lib/utils/string.d.ts +1 -0
  302. package/lib/utils/string.js +16 -0
  303. package/lib/utils/text.js +1 -1
  304. package/package.json +6 -4
  305. package/dist/index.umd.min.js +0 -15
@@ -39,9 +39,7 @@ var regexCannotEndKoKr = /[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/;
39
39
  var regexCannotStart = new RegExp(regexCannotStartZhCn.source + "|" + regexCannotStartZhTw.source + "|" + regexCannotStartJaJp.source + "|" + regexCannotStartKoKr.source);
40
40
  var regexCannotEnd = new RegExp(regexCannotEndZhCn.source + "|" + regexCannotEndZhTw.source + "|" + regexCannotEndJaJp.source + "|" + regexCannotEndKoKr.source);
41
41
 
42
- var TextService =
43
- /** @class */
44
- function () {
42
+ var TextService = function () {
45
43
  function TextService() {
46
44
  var _this = this;
47
45
 
@@ -104,7 +102,7 @@ function () {
104
102
  context.textBaseline = 'alphabetic';
105
103
  context.fillStyle = '#000';
106
104
  context.fillText(metricsString, 0, baseline);
107
- var imagedata = context.getImageData(0, 0, width, height).data;
105
+ var imagedata = context.getImageData(0, 0, width || 1, height || 1).data;
108
106
  var pixels = imagedata.length;
109
107
  var line = width * 4;
110
108
  var i = 0;
@@ -152,29 +150,27 @@ function () {
152
150
  };
153
151
 
154
152
  TextService.prototype.measureText = function (text, attributes) {
155
- var _a = attributes.fontSize,
156
- fontSize = _a === void 0 ? 0 : _a,
153
+ var fontSize = attributes.fontSize,
157
154
  wordWrap = attributes.wordWrap,
158
- _b = attributes.lineHeight,
159
- strokeHeight = _b === void 0 ? 0 : _b,
160
- _c = attributes.lineWidth,
161
- lineWidth = _c === void 0 ? 0 : _c,
155
+ _a = attributes.lineHeight,
156
+ strokeHeight = _a === void 0 ? 0 : _a,
157
+ lineWidth = attributes.lineWidth,
162
158
  textBaseline = attributes.textBaseline,
163
159
  textAlign = attributes.textAlign,
164
- _d = attributes.letterSpacing,
165
- letterSpacing = _d === void 0 ? 0 : _d,
160
+ _b = attributes.letterSpacing,
161
+ letterSpacing = _b === void 0 ? 0 : _b,
166
162
  dropShadow = attributes.dropShadow,
167
- _e = attributes.dropShadowDistance,
168
- dropShadowDistance = _e === void 0 ? 0 : _e,
169
- _f = attributes.leading,
170
- leading = _f === void 0 ? 0 : _f;
163
+ _c = attributes.dropShadowDistance,
164
+ dropShadowDistance = _c === void 0 ? 0 : _c,
165
+ _d = attributes.leading,
166
+ leading = _d === void 0 ? 0 : _d;
171
167
  var font = (0, _text.toFontString)(attributes);
172
168
  var fontProperties = this.measureFont(font); // fallback in case UA disallow canvas data extraction
173
169
  // (toDataURI, getImageData functions)
174
170
 
175
171
  if (fontProperties.fontSize === 0) {
176
- fontProperties.fontSize = fontSize;
177
- fontProperties.ascent = fontSize;
172
+ fontProperties.fontSize = fontSize.value;
173
+ fontProperties.ascent = fontSize.value;
178
174
  }
179
175
 
180
176
  var context = this.offscreenCanvas.getOrCreateContext();
@@ -190,14 +186,14 @@ function () {
190
186
  maxLineWidth = Math.max(maxLineWidth, lineWidth_1);
191
187
  }
192
188
 
193
- var width = maxLineWidth + lineWidth;
189
+ var width = maxLineWidth + lineWidth.value;
194
190
 
195
191
  if (dropShadow) {
196
192
  width += dropShadowDistance;
197
193
  }
198
194
 
199
- var lineHeight = strokeHeight || fontProperties.fontSize + lineWidth;
200
- var height = Math.max(lineHeight, fontProperties.fontSize + lineWidth) + (lines.length - 1) * (lineHeight + leading);
195
+ var lineHeight = strokeHeight || fontProperties.fontSize + lineWidth.value;
196
+ var height = Math.max(lineHeight, fontProperties.fontSize + lineWidth.value) + (lines.length - 1) * (lineHeight + leading);
201
197
 
202
198
  if (dropShadow) {
203
199
  height += dropShadowDistance;
@@ -233,7 +229,7 @@ function () {
233
229
  offsetX -= width;
234
230
  }
235
231
 
236
- return new _shapes.Rectangle(offsetX - lineWidth / 2, offsetY + i * lineHeight, width + lineWidth, lineHeight);
232
+ return new _shapes.Rectangle(offsetX - lineWidth.value / 2, offsetY + i * lineHeight, width + lineWidth.value, lineHeight);
237
233
  })
238
234
  };
239
235
  };
@@ -7,6 +7,7 @@ import type { Plane } from './Plane';
7
7
  * @see https://github.com/antvis/GWebGPUEngine/issues/3
8
8
  */
9
9
  export declare class AABB {
10
+ static isEmpty(aabb: AABB): boolean;
10
11
  center: vec3;
11
12
  halfExtents: vec3;
12
13
  min: vec3;
@@ -12,15 +12,17 @@ var _glMatrix = require("gl-matrix");
12
12
  * 为了便于后续 Frustum Culling,通过查找表定义 p-vertex 和 n-vertex
13
13
  * @see https://github.com/antvis/GWebGPUEngine/issues/3
14
14
  */
15
- var AABB =
16
- /** @class */
17
- function () {
15
+ var AABB = function () {
18
16
  function AABB(center, halfExtents) {
19
17
  this.min = _glMatrix.vec3.create();
20
18
  this.max = _glMatrix.vec3.create();
21
19
  this.update(center, halfExtents);
22
20
  }
23
21
 
22
+ AABB.isEmpty = function (aabb) {
23
+ return !aabb || aabb.halfExtents[0] === 0 && aabb.halfExtents[1] === 0 && aabb.halfExtents[2] === 0;
24
+ };
25
+
24
26
  AABB.prototype.update = function (center, halfExtents) {
25
27
  this.center = _glMatrix.vec3.copy(_glMatrix.vec3.create(), center || _glMatrix.vec3.create());
26
28
  this.halfExtents = _glMatrix.vec3.copy(_glMatrix.vec3.create(), halfExtents || _glMatrix.vec3.fromValues(0, 0, 0));
@@ -51,6 +53,10 @@ function () {
51
53
  };
52
54
 
53
55
  AABB.prototype.add = function (aabb) {
56
+ if (AABB.isEmpty(aabb)) {
57
+ return;
58
+ }
59
+
54
60
  var tc = this.center;
55
61
  var tcx = tc[0];
56
62
  var tcy = tc[1];
@@ -9,9 +9,7 @@ var _glMatrix = require("gl-matrix");
9
9
 
10
10
  var tmpVecA = _glMatrix.vec3.create();
11
11
 
12
- var BoundingSphere =
13
- /** @class */
14
- function () {
12
+ var BoundingSphere = function () {
15
13
  function BoundingSphere(center, radius) {
16
14
  this.center = center || _glMatrix.vec3.create();
17
15
  this.radius = radius || 0.5;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Mask = exports.Frustum = void 0;
6
+ exports.Frustum = exports.Mask = void 0;
7
7
 
8
8
  var _tslib = require("tslib");
9
9
 
@@ -20,9 +20,7 @@ exports.Mask = Mask;
20
20
  Mask[Mask["INDETERMINATE"] = 2147483647] = "INDETERMINATE";
21
21
  })(Mask || (exports.Mask = Mask = {}));
22
22
 
23
- var Frustum =
24
- /** @class */
25
- function () {
23
+ var Frustum = function () {
26
24
  function Frustum(planes) {
27
25
  this.planes = [];
28
26
 
@@ -7,9 +7,7 @@ exports.Plane = void 0;
7
7
 
8
8
  var _glMatrix = require("gl-matrix");
9
9
 
10
- var Plane =
11
- /** @class */
12
- function () {
10
+ var Plane = function () {
13
11
  function Plane(distance, normal) {
14
12
  this.distance = distance || 0;
15
13
  this.normal = normal || _glMatrix.vec3.fromValues(0, 1, 0);
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Point = void 0;
7
7
 
8
- var Point =
9
- /** @class */
10
- function () {
8
+ var Point = function () {
11
9
  function Point(x, y) {
12
10
  if (x === void 0) {
13
11
  x = 0;
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.PolygonShape = void 0;
7
7
 
8
- var PolygonShape =
9
- /** @class */
10
- function () {
8
+ var PolygonShape = function () {
11
9
  function PolygonShape() {
12
10
  var points = [];
13
11
 
package/lib/shapes/Ray.js CHANGED
@@ -24,9 +24,7 @@ var tmpVecE = _glMatrix.vec3.create();
24
24
  */
25
25
 
26
26
 
27
- var Ray =
28
- /** @class */
29
- function () {
27
+ var Ray = function () {
30
28
  function Ray(origin, direction) {
31
29
  this.origin = origin || _glMatrix.vec3.create();
32
30
  this.direction = direction || _glMatrix.vec3.fromValues(0, 0, -1);
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Rect = void 0;
7
7
 
8
- var Rect =
9
- /** @class */
10
- function () {
8
+ var Rect = function () {
11
9
  function Rect(x, y, width, height) {
12
10
  this.x = x;
13
11
  this.y = y;
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Rectangle = void 0;
7
7
 
8
- var Rectangle =
9
- /** @class */
10
- function () {
8
+ var Rectangle = function () {
11
9
  function Rectangle(x, y, width, height) {
12
10
  this.x = x;
13
11
  this.y = y;
package/lib/types.d.ts CHANGED
@@ -2,19 +2,19 @@
2
2
  import type { vec2, vec3 } from 'gl-matrix';
3
3
  import type { ParsedPathStyleProps, ParsedPolylineStyleProps } from './display-objects';
4
4
  import type { DisplayObject } from './display-objects';
5
- import type { ParsedColorStyleProperty } from './property-handlers';
5
+ import type { ParsedColorStyleProperty, ParsedElement } from './property-handlers';
6
6
  import type { IRenderer } from './AbstractRenderer';
7
- export declare enum SHAPE {
8
- Group = "group",
9
- Circle = "circle",
10
- Ellipse = "ellipse",
11
- Image = "image",
12
- Rect = "rect",
13
- Line = "line",
14
- Polyline = "polyline",
15
- Polygon = "polygon",
16
- Text = "text",
17
- Path = "path",
7
+ export declare enum Shape {
8
+ GROUP = "g",
9
+ CIRCLE = "circle",
10
+ ELLIPSE = "ellipse",
11
+ IMAGE = "image",
12
+ RECT = "rect",
13
+ LINE = "line",
14
+ POLYLINE = "polyline",
15
+ POLYGON = "polygon",
16
+ TEXT = "text",
17
+ PATH = "path",
18
18
  HTML = "html"
19
19
  }
20
20
  declare type ColorType = string | null;
@@ -26,17 +26,31 @@ export interface EventPosition {
26
26
  x: number;
27
27
  y: number;
28
28
  }
29
- export declare enum LINE_CAP {
30
- Butt = "butt",
31
- Round = "round",
32
- Square = "square"
29
+ export declare enum LineCap {
30
+ BUTT = "butt",
31
+ ROUND = "round",
32
+ SQUARE = "square"
33
33
  }
34
- export declare enum LINE_JOIN {
35
- Bevel = "bevel",
36
- Round = "round",
37
- Miter = "miter"
34
+ export declare enum LineJoin {
35
+ BEVEL = "bevel",
36
+ ROUND = "round",
37
+ MITER = "miter"
38
+ }
39
+ export declare enum TextTransform {
40
+ CAPITALIZE = "capitalize",
41
+ UPPERCASE = "uppercase",
42
+ LOWERCASE = "lowercase",
43
+ NONE = "none"
44
+ }
45
+ export declare enum TextAlign {
46
+ START = "start",
47
+ CENTER = "center",
48
+ END = "end",
49
+ LEFT = "left",
50
+ RIGHT = "right"
38
51
  }
39
52
  export interface BaseStyleProps {
53
+ class?: string;
40
54
  /**
41
55
  * x in local space
42
56
  */
@@ -100,11 +114,11 @@ export interface BaseStyleProps {
100
114
  /** 整体透明度 */
101
115
  opacity?: number;
102
116
  /** 线宽 */
103
- lineWidth?: number;
117
+ lineWidth?: string | number;
104
118
  /** 指定如何绘制每一条线段末端 */
105
- lineCap?: LINE_CAP;
119
+ lineCap?: LineCap;
106
120
  /** 用来设置2个长度不为0的相连部分(线段,圆弧,曲线)如何连接在一起的属性(长度为0的变形部分,其指定的末端和控制点在同一位置,会被忽略) */
107
- lineJoin?: LINE_JOIN;
121
+ lineJoin?: LineJoin;
108
122
  /**
109
123
  * 设置线的虚线样式,可以指定一个数组。一组描述交替绘制线段和间距(坐标空间单位)长度的数字。 如果数组元素的数量是奇数, 数组的元素会被复制并重复。例如, [5, 15, 25] 会变成 [5, 15, 25, 5, 15, 25]。这个属性取决于浏览器是否支持 setLineDash() 函数。
110
124
  */
@@ -126,16 +140,23 @@ export interface BaseStyleProps {
126
140
  * @see https://developer.mozilla.org/en-US/docs/Web/CSS/filter
127
141
  */
128
142
  filter?: string;
143
+ /**
144
+ * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/text-transform
145
+ */
146
+ textTransform?: TextTransform;
147
+ /**
148
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/miterLimit
149
+ */
150
+ miterLimit?: number;
129
151
  }
130
- export interface ParsedBaseStyleProps extends Omit<BaseStyleProps, 'fill' | 'stroke' | 'path' | 'points'> {
152
+ export interface ParsedBaseStyleProps extends Omit<BaseStyleProps, 'fill' | 'stroke' | 'path' | 'points' | 'lineWidth' | 'shadowColor'> {
131
153
  fill?: ParsedColorStyleProperty;
132
154
  stroke?: ParsedColorStyleProperty;
133
155
  path?: ParsedPathStyleProps;
134
156
  points?: ParsedPolylineStyleProps;
135
157
  x?: number;
136
158
  y?: number;
137
- width?: number;
138
- height?: number;
159
+ lineWidth?: ParsedElement;
139
160
  /**
140
161
  * x according to definition, eg. Line's x1/x2, Polyline's points
141
162
  */
@@ -146,6 +167,7 @@ export interface ParsedBaseStyleProps extends Omit<BaseStyleProps, 'fill' | 'str
146
167
  */
147
168
  offsetX?: number;
148
169
  offsetY?: number;
170
+ shadowColor?: ParsedColorStyleProperty;
149
171
  }
150
172
  export declare type Cursor = 'auto' | 'default' | 'none' | 'context-menu' | 'help' | 'pointer' | 'progress' | 'wait' | 'cell' | 'crosshair' | 'text' | 'vertical-text' | 'alias' | 'copy' | 'move' | 'no-drop' | 'not-allowed' | 'grab' | 'grabbing' | 'all-scroll' | 'col-resize' | 'row-resize' | 'n-resize' | 'e-resize' | 's-resize' | 'w-resize' | 'ne-resize' | 'nw-resize' | 'se-resize' | 'sw-resize' | 'ew-resize' | 'ns-resize' | 'nesw-resize' | 'nwse-resize' | 'zoom-in' | 'zoom-out';
151
173
  export interface RendererConfig {
package/lib/types.js CHANGED
@@ -3,41 +3,62 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SHAPE = exports.LINE_JOIN = exports.LINE_CAP = exports.CanvasConfig = void 0;
7
- var SHAPE;
8
- exports.SHAPE = SHAPE;
9
-
10
- (function (SHAPE) {
11
- SHAPE["Group"] = "group";
12
- SHAPE["Circle"] = "circle";
13
- SHAPE["Ellipse"] = "ellipse";
14
- SHAPE["Image"] = "image";
15
- SHAPE["Rect"] = "rect";
16
- SHAPE["Line"] = "line";
17
- SHAPE["Polyline"] = "polyline";
18
- SHAPE["Polygon"] = "polygon";
19
- SHAPE["Text"] = "text";
20
- SHAPE["Path"] = "path";
21
- SHAPE["HTML"] = "html";
22
- })(SHAPE || (exports.SHAPE = SHAPE = {}));
23
-
24
- var LINE_CAP;
25
- exports.LINE_CAP = LINE_CAP;
26
-
27
- (function (LINE_CAP) {
28
- LINE_CAP["Butt"] = "butt";
29
- LINE_CAP["Round"] = "round";
30
- LINE_CAP["Square"] = "square";
31
- })(LINE_CAP || (exports.LINE_CAP = LINE_CAP = {}));
32
-
33
- var LINE_JOIN;
34
- exports.LINE_JOIN = LINE_JOIN;
35
-
36
- (function (LINE_JOIN) {
37
- LINE_JOIN["Bevel"] = "bevel";
38
- LINE_JOIN["Round"] = "round";
39
- LINE_JOIN["Miter"] = "miter";
40
- })(LINE_JOIN || (exports.LINE_JOIN = LINE_JOIN = {}));
6
+ exports.CanvasConfig = exports.TextAlign = exports.TextTransform = exports.LineJoin = exports.LineCap = exports.Shape = void 0;
7
+ var Shape;
8
+ exports.Shape = Shape;
9
+
10
+ (function (Shape) {
11
+ Shape["GROUP"] = "g";
12
+ Shape["CIRCLE"] = "circle";
13
+ Shape["ELLIPSE"] = "ellipse";
14
+ Shape["IMAGE"] = "image";
15
+ Shape["RECT"] = "rect";
16
+ Shape["LINE"] = "line";
17
+ Shape["POLYLINE"] = "polyline";
18
+ Shape["POLYGON"] = "polygon";
19
+ Shape["TEXT"] = "text";
20
+ Shape["PATH"] = "path";
21
+ Shape["HTML"] = "html";
22
+ })(Shape || (exports.Shape = Shape = {}));
23
+
24
+ var LineCap;
25
+ exports.LineCap = LineCap;
26
+
27
+ (function (LineCap) {
28
+ LineCap["BUTT"] = "butt";
29
+ LineCap["ROUND"] = "round";
30
+ LineCap["SQUARE"] = "square";
31
+ })(LineCap || (exports.LineCap = LineCap = {}));
32
+
33
+ var LineJoin;
34
+ exports.LineJoin = LineJoin;
35
+
36
+ (function (LineJoin) {
37
+ LineJoin["BEVEL"] = "bevel";
38
+ LineJoin["ROUND"] = "round";
39
+ LineJoin["MITER"] = "miter";
40
+ })(LineJoin || (exports.LineJoin = LineJoin = {}));
41
+
42
+ var TextTransform;
43
+ exports.TextTransform = TextTransform;
44
+
45
+ (function (TextTransform) {
46
+ TextTransform["CAPITALIZE"] = "capitalize";
47
+ TextTransform["UPPERCASE"] = "uppercase";
48
+ TextTransform["LOWERCASE"] = "lowercase";
49
+ TextTransform["NONE"] = "none";
50
+ })(TextTransform || (exports.TextTransform = TextTransform = {}));
51
+
52
+ var TextAlign;
53
+ exports.TextAlign = TextAlign;
54
+
55
+ (function (TextAlign) {
56
+ TextAlign["START"] = "start";
57
+ TextAlign["CENTER"] = "center";
58
+ TextAlign["END"] = "end";
59
+ TextAlign["LEFT"] = "left";
60
+ TextAlign["RIGHT"] = "right";
61
+ })(TextAlign || (exports.TextAlign = TextAlign = {}));
41
62
 
42
63
  var CanvasConfig = 'CanvasConfig';
43
64
  exports.CanvasConfig = CanvasConfig;
@@ -3,11 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.EasingKeys = exports.EASINGS = void 0;
6
+ exports.parseEasingFunction = parseEasingFunction;
7
7
  exports.calculateActiveDuration = calculateActiveDuration;
8
8
  exports.calculateIterationProgress = calculateIterationProgress;
9
- exports.linear = exports.getEase = void 0;
10
- exports.parseEasingFunction = parseEasingFunction;
9
+ exports.getEase = exports.EasingKeys = exports.EASINGS = exports.linear = void 0;
11
10
 
12
11
  var _tslib = require("tslib");
13
12
 
@@ -100,7 +99,7 @@ function calculatePhase(activeDuration, localTime, timing) {
100
99
  return PhaseNone;
101
100
  }
102
101
 
103
- var endTime = timing.delay + activeDuration + timing.endDelay;
102
+ var endTime = timing.endTime;
104
103
 
105
104
  if (localTime < Math.min(timing.delay, endTime)) {
106
105
  return PhaseBefore;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.newtonRaphsonIterate = exports.kSplineTableSize = exports.kSampleStepSize = exports.getSlope = exports.float32ArraySupported = exports.calcBezier = exports.binarySubdivide = exports.bezier = exports.SUBDIVISION_PRECISION = exports.SUBDIVISION_MAX_ITERATIONS = exports.NEWTON_MIN_SLOPE = exports.NEWTON_ITERATIONS = exports.C = exports.B = exports.A = void 0;
6
+ exports.bezier = exports.newtonRaphsonIterate = exports.binarySubdivide = exports.getSlope = exports.calcBezier = exports.C = exports.B = exports.A = exports.float32ArraySupported = exports.kSampleStepSize = exports.kSplineTableSize = exports.SUBDIVISION_MAX_ITERATIONS = exports.SUBDIVISION_PRECISION = exports.NEWTON_MIN_SLOPE = exports.NEWTON_ITERATIONS = void 0;
7
7
 
8
8
  /**
9
9
  * https://github.com/gre/bezier-easing
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.registerEasingFunctions = exports.registerEasingFunction = exports.parseEasingParameters = exports.limit = exports.getEasingFunction = exports.getEasingDuration = exports.easein = exports.convertToDash = exports.complexEasingSyntax = exports.Steps = exports.Spring = exports.Sine = exports.Quint = exports.Quart = exports.Quad = exports.INTINITE_LOOP_LIMIT = exports.Expo = exports.Elastic = exports.EasingFunctions = exports.EasingDurationCache = exports.EaseOutIn = exports.EaseOut = exports.EaseInOut = exports.Cubic = exports.Circ = exports.Bounce = exports.Bezier = exports.Back = void 0;
6
+ exports.registerEasingFunctions = exports.registerEasingFunction = exports.getEasingFunction = exports.complexEasingSyntax = exports.EasingFunctions = exports.EaseOutIn = exports.EaseInOut = exports.EaseOut = exports.easein = exports.Bezier = exports.Steps = exports.getEasingDuration = exports.parseEasingParameters = exports.INTINITE_LOOP_LIMIT = exports.EasingDurationCache = exports.Spring = exports.Elastic = exports.Bounce = exports.Back = exports.Circ = exports.Sine = exports.Expo = exports.Quint = exports.Quart = exports.Cubic = exports.Quad = exports.limit = exports.convertToDash = void 0;
7
7
 
8
8
  var _tslib = require("tslib");
9
9
 
@@ -3,11 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.TOUCH_TO_POINTER = exports.MOUSE_POINTER_ID = void 0;
7
- exports.isMouseEvent = isMouseEvent;
8
6
  exports.isTouchEvent = isTouchEvent;
7
+ exports.isMouseEvent = isMouseEvent;
9
8
  exports.normalizeToPointerEvent = normalizeToPointerEvent;
10
- exports.supportsTouchEvents = exports.supportsPointerEvents = void 0;
9
+ exports.TOUCH_TO_POINTER = exports.MOUSE_POINTER_ID = exports.supportsPointerEvents = exports.supportsTouchEvents = void 0;
11
10
 
12
11
  var _util = require("@antv/util");
13
12
 
@@ -45,9 +44,11 @@ function normalizeToPointerEvent(event) {
45
44
 
46
45
  if (isTouchEvent(event)) {
47
46
  for (var i = 0; i < event.changedTouches.length; i++) {
48
- var touch = event.changedTouches[i];
49
- if ((0, _util.isUndefined)(touch.button)) touch.button = event.touches.length ? 1 : 0;
50
- if ((0, _util.isUndefined)(touch.buttons)) touch.buttons = event.touches.length ? 1 : 0;
47
+ var touch = event.changedTouches[i]; // use changedTouches instead of touches since touchend has no touches
48
+ // @see https://stackoverflow.com/a/10079076
49
+
50
+ if ((0, _util.isUndefined)(touch.button)) touch.button = event.changedTouches.length ? 1 : 0;
51
+ if ((0, _util.isUndefined)(touch.buttons)) touch.buttons = event.changedTouches.length ? 1 : 0;
51
52
 
52
53
  if ((0, _util.isUndefined)(touch.isPrimary)) {
53
54
  touch.isPrimary = event.touches.length === 1 && event.type === 'touchstart';
@@ -3,3 +3,4 @@ export * from './interpolation';
3
3
  export * from './path';
4
4
  export * from './raf';
5
5
  export * from './text';
6
+ export * from './string';
@@ -67,4 +67,17 @@ Object.keys(_text).forEach(function (key) {
67
67
  return _text[key];
68
68
  }
69
69
  });
70
+ });
71
+
72
+ var _string = require("./string");
73
+
74
+ Object.keys(_string).forEach(function (key) {
75
+ if (key === "default" || key === "__esModule") return;
76
+ if (key in exports && exports[key] === _string[key]) return;
77
+ Object.defineProperty(exports, key, {
78
+ enumerable: true,
79
+ get: function get() {
80
+ return _string[key];
81
+ }
82
+ });
70
83
  });
@@ -1,3 +1,4 @@
1
1
  import type { AnimationEffectTiming } from '../dom';
2
2
  import type { IElement } from '../dom/interfaces';
3
3
  export declare function convertEffectInput(keyframes: ComputedKeyframe[], timing: AnimationEffectTiming, target: IElement | null): (target: IElement, fraction: number) => void;
4
+ export declare function formatAttribute(name: string, value: any): [string, any];
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.convertEffectInput = convertEffectInput;
7
+ exports.formatAttribute = formatAttribute;
7
8
 
8
9
  var _tslib = require("tslib");
9
10
 
@@ -11,10 +12,8 @@ var _globalModule = require("../global-module");
11
12
 
12
13
  var _animation = require("./animation");
13
14
 
14
- // import {
15
- // StylePropertyMergerFactory,
16
- // StylePropertyParserFactory,
17
- // } from '../property-handlers/interfaces';
15
+ var _string = require("./string");
16
+
18
17
  function convertEffectInput(keyframes, timing, target) {
19
18
  var propertySpecificKeyframeGroups = makePropertySpecificKeyframeGroups(keyframes, timing);
20
19
  var interpolations = makeInterpolations(propertySpecificKeyframeGroups, target);
@@ -130,9 +129,9 @@ function propertyInterpolation(property, left, right, target) {
130
129
 
131
130
  if (parser) {
132
131
  // @ts-ignore
133
- parsedLeft = parser(left, target); // @ts-ignore
132
+ parsedLeft = parser(left, target, property); // @ts-ignore
134
133
 
135
- parsedRight = parser(right, target);
134
+ parsedRight = parser(right, target, property);
136
135
  } // merger [left, right, n2string()]
137
136
 
138
137
 
@@ -189,4 +188,41 @@ convertToString) {
189
188
  return function (f) {
190
189
  return convertToString(interpolate(from, to, f));
191
190
  };
192
- };
191
+ };
192
+
193
+ var FORMAT_ATTR_MAP = {
194
+ d: {
195
+ alias: 'path'
196
+ },
197
+ cx: {
198
+ alias: 'x'
199
+ },
200
+ cy: {
201
+ alias: 'y'
202
+ },
203
+ strokeDasharray: {
204
+ alias: 'lineDash'
205
+ },
206
+ strokeWidth: {
207
+ alias: 'lineWidth'
208
+ },
209
+ textAnchor: {
210
+ alias: 'textAlign',
211
+ values: {
212
+ middle: 'center'
213
+ }
214
+ },
215
+ src: {
216
+ alias: 'img'
217
+ }
218
+ };
219
+
220
+ function formatAttribute(name, value) {
221
+ var _a;
222
+
223
+ var attributeName = (0, _string.camelCase)(name);
224
+ var map = FORMAT_ATTR_MAP[attributeName];
225
+ attributeName = (map === null || map === void 0 ? void 0 : map.alias) || attributeName;
226
+ var attributeValue = ((_a = map === null || map === void 0 ? void 0 : map.values) === null || _a === void 0 ? void 0 : _a[value]) || value;
227
+ return [attributeName, attributeValue];
228
+ }
package/lib/utils/math.js CHANGED
@@ -3,16 +3,16 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.getAngle = getAngle;
6
7
  exports.createVec3 = createVec3;
7
8
  exports.deg2rad = deg2rad;
8
- exports.fromRotationTranslationScale = fromRotationTranslationScale;
9
- exports.getAngle = getAngle;
10
- exports.getEuler = getEuler;
11
- exports.getRotationInRadians = getRotationInRadians;
9
+ exports.rad2deg = rad2deg;
12
10
  exports.getScaling = getScaling;
13
11
  exports.getTranslation = getTranslation;
12
+ exports.getRotationInRadians = getRotationInRadians;
13
+ exports.getEuler = getEuler;
14
+ exports.fromRotationTranslationScale = fromRotationTranslationScale;
14
15
  exports.makePerspective = makePerspective;
15
- exports.rad2deg = rad2deg;
16
16
 
17
17
  var _tslib = require("tslib");
18
18