@antv/g 5.1.2 → 5.1.3

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 (957) hide show
  1. package/dist/AbstractRenderer.d.ts +38 -0
  2. package/dist/AbstractRenderer.d.ts.map +1 -0
  3. package/dist/Canvas.d.ts +150 -0
  4. package/dist/Canvas.d.ts.map +1 -0
  5. package/dist/DisplayObjectPool.d.ts +10 -0
  6. package/dist/DisplayObjectPool.d.ts.map +1 -0
  7. package/dist/__tests__/utils.d.ts +2 -0
  8. package/dist/__tests__/utils.d.ts.map +1 -0
  9. package/dist/camera/Camera.d.ts +328 -0
  10. package/dist/camera/Camera.d.ts.map +1 -0
  11. package/dist/camera/Landmark.d.ts +24 -0
  12. package/dist/camera/Landmark.d.ts.map +1 -0
  13. package/dist/camera/index.d.ts +3 -0
  14. package/dist/camera/index.d.ts.map +1 -0
  15. package/dist/canvas-module.d.ts +2 -0
  16. package/dist/canvas-module.d.ts.map +1 -0
  17. package/dist/components/Cullable.d.ts +15 -0
  18. package/dist/components/Cullable.d.ts.map +1 -0
  19. package/dist/components/Geometry.d.ts +13 -0
  20. package/dist/components/Geometry.d.ts.map +1 -0
  21. package/dist/components/Renderable.d.ts +25 -0
  22. package/dist/components/Renderable.d.ts.map +1 -0
  23. package/dist/components/Sortable.d.ts +21 -0
  24. package/dist/components/Sortable.d.ts.map +1 -0
  25. package/dist/components/Transform.d.ts +29 -0
  26. package/dist/components/Transform.d.ts.map +1 -0
  27. package/dist/components/index.d.ts +6 -0
  28. package/dist/components/index.d.ts.map +1 -0
  29. package/dist/css/CSS.d.ts +89 -0
  30. package/dist/css/CSS.d.ts.map +1 -0
  31. package/dist/css/CSSProperty.d.ts +42 -0
  32. package/dist/css/CSSProperty.d.ts.map +1 -0
  33. package/dist/css/StyleValueRegistry.d.ts +124 -0
  34. package/dist/css/StyleValueRegistry.d.ts.map +1 -0
  35. package/dist/css/cssom/CSSColorValue.d.ts +24 -0
  36. package/dist/css/cssom/CSSColorValue.d.ts.map +1 -0
  37. package/dist/css/cssom/CSSGradientValue.d.ts +40 -0
  38. package/dist/css/cssom/CSSGradientValue.d.ts.map +1 -0
  39. package/dist/css/cssom/CSSKeywordValue.d.ts +16 -0
  40. package/dist/css/cssom/CSSKeywordValue.d.ts.map +1 -0
  41. package/dist/css/cssom/CSSMathOperator.d.ts +12 -0
  42. package/dist/css/cssom/CSSMathOperator.d.ts.map +1 -0
  43. package/dist/css/cssom/CSSNumericSumValue.d.ts +8 -0
  44. package/dist/css/cssom/CSSNumericSumValue.d.ts.map +1 -0
  45. package/dist/css/cssom/CSSNumericValue.d.ts +213 -0
  46. package/dist/css/cssom/CSSNumericValue.d.ts.map +1 -0
  47. package/dist/css/cssom/CSSRGB.d.ts +26 -0
  48. package/dist/css/cssom/CSSRGB.d.ts.map +1 -0
  49. package/dist/css/cssom/CSSStyleValue.d.ts +54 -0
  50. package/dist/css/cssom/CSSStyleValue.d.ts.map +1 -0
  51. package/dist/css/cssom/index.d.ts +18 -0
  52. package/dist/css/cssom/index.d.ts.map +1 -0
  53. package/dist/css/cssom/types.d.ts +87 -0
  54. package/dist/css/cssom/types.d.ts.map +1 -0
  55. package/dist/css/index.d.ts +12 -0
  56. package/dist/css/index.d.ts.map +1 -0
  57. package/dist/css/interfaces.d.ts +117 -0
  58. package/dist/css/interfaces.d.ts.map +1 -0
  59. package/dist/css/layout/FragmentResult.d.ts +33 -0
  60. package/dist/css/layout/FragmentResult.d.ts.map +1 -0
  61. package/dist/css/layout/LayoutChildren.d.ts +24 -0
  62. package/dist/css/layout/LayoutChildren.d.ts.map +1 -0
  63. package/dist/css/layout/LayoutContext.d.ts +36 -0
  64. package/dist/css/layout/LayoutContext.d.ts.map +1 -0
  65. package/dist/css/layout/LayoutDefinition.d.ts +21 -0
  66. package/dist/css/layout/LayoutDefinition.d.ts.map +1 -0
  67. package/dist/css/layout/LayoutEdges.d.ts +25 -0
  68. package/dist/css/layout/LayoutEdges.d.ts.map +1 -0
  69. package/dist/css/layout/LayoutEngine.d.ts +42 -0
  70. package/dist/css/layout/LayoutEngine.d.ts.map +1 -0
  71. package/dist/css/layout/LayoutFragment.d.ts +27 -0
  72. package/dist/css/layout/LayoutFragment.d.ts.map +1 -0
  73. package/dist/css/layout/LayoutObject.d.ts +47 -0
  74. package/dist/css/layout/LayoutObject.d.ts.map +1 -0
  75. package/dist/css/layout/LayoutRegistry.d.ts +17 -0
  76. package/dist/css/layout/LayoutRegistry.d.ts.map +1 -0
  77. package/dist/css/layout/LayoutWorkTask.d.ts +15 -0
  78. package/dist/css/layout/LayoutWorkTask.d.ts.map +1 -0
  79. package/dist/css/layout/index.d.ts +12 -0
  80. package/dist/css/layout/index.d.ts.map +1 -0
  81. package/dist/css/layout/types.d.ts +105 -0
  82. package/dist/css/layout/types.d.ts.map +1 -0
  83. package/dist/css/parser/color.d.ts +7 -0
  84. package/dist/css/parser/color.d.ts.map +1 -0
  85. package/dist/css/parser/dimension.d.ts +38 -0
  86. package/dist/css/parser/dimension.d.ts.map +1 -0
  87. package/dist/css/parser/filter.d.ts +8 -0
  88. package/dist/css/parser/filter.d.ts.map +1 -0
  89. package/dist/css/parser/index.d.ts +16 -0
  90. package/dist/css/parser/index.d.ts.map +1 -0
  91. package/dist/css/parser/numeric.d.ts +20 -0
  92. package/dist/css/parser/numeric.d.ts.map +1 -0
  93. package/dist/css/parser/path.d.ts +6 -0
  94. package/dist/css/parser/path.d.ts.map +1 -0
  95. package/dist/css/parser/points.d.ts +13 -0
  96. package/dist/css/parser/points.d.ts.map +1 -0
  97. package/dist/css/parser/transform-origin.d.ts +7 -0
  98. package/dist/css/parser/transform-origin.d.ts.map +1 -0
  99. package/dist/css/parser/transform.d.ts +14 -0
  100. package/dist/css/parser/transform.d.ts.map +1 -0
  101. package/dist/css/parser/types.d.ts +3 -0
  102. package/dist/css/parser/types.d.ts.map +1 -0
  103. package/dist/css/properties/CSSPropertyClipPath.d.ts +21 -0
  104. package/dist/css/properties/CSSPropertyClipPath.d.ts.map +1 -0
  105. package/dist/css/properties/CSSPropertyColor.d.ts +5 -0
  106. package/dist/css/properties/CSSPropertyColor.d.ts.map +1 -0
  107. package/dist/css/properties/CSSPropertyFilter.d.ts +4 -0
  108. package/dist/css/properties/CSSPropertyFilter.d.ts.map +1 -0
  109. package/dist/css/properties/CSSPropertyLengthOrPercentage.d.ts +7 -0
  110. package/dist/css/properties/CSSPropertyLengthOrPercentage.d.ts.map +1 -0
  111. package/dist/css/properties/CSSPropertyLengthOrPercentage12.d.ts +12 -0
  112. package/dist/css/properties/CSSPropertyLengthOrPercentage12.d.ts.map +1 -0
  113. package/dist/css/properties/CSSPropertyLengthOrPercentage14.d.ts +22 -0
  114. package/dist/css/properties/CSSPropertyLengthOrPercentage14.d.ts.map +1 -0
  115. package/dist/css/properties/CSSPropertyLocalPosition.d.ts +7 -0
  116. package/dist/css/properties/CSSPropertyLocalPosition.d.ts.map +1 -0
  117. package/dist/css/properties/CSSPropertyOffsetDistance.d.ts +4 -0
  118. package/dist/css/properties/CSSPropertyOffsetDistance.d.ts.map +1 -0
  119. package/dist/css/properties/CSSPropertyOffsetPath.d.ts +4 -0
  120. package/dist/css/properties/CSSPropertyOffsetPath.d.ts.map +1 -0
  121. package/dist/css/properties/CSSPropertyOpacity.d.ts +7 -0
  122. package/dist/css/properties/CSSPropertyOpacity.d.ts.map +1 -0
  123. package/dist/css/properties/CSSPropertyPath.d.ts +4 -0
  124. package/dist/css/properties/CSSPropertyPath.d.ts.map +1 -0
  125. package/dist/css/properties/CSSPropertyPoints.d.ts +11 -0
  126. package/dist/css/properties/CSSPropertyPoints.d.ts.map +1 -0
  127. package/dist/css/properties/CSSPropertyShadowBlur.d.ts +3 -0
  128. package/dist/css/properties/CSSPropertyShadowBlur.d.ts.map +1 -0
  129. package/dist/css/properties/CSSPropertyText.d.ts +4 -0
  130. package/dist/css/properties/CSSPropertyText.d.ts.map +1 -0
  131. package/dist/css/properties/CSSPropertyTextTransform.d.ts +4 -0
  132. package/dist/css/properties/CSSPropertyTextTransform.d.ts.map +1 -0
  133. package/dist/css/properties/CSSPropertyTransform.d.ts +33 -0
  134. package/dist/css/properties/CSSPropertyTransform.d.ts.map +1 -0
  135. package/dist/css/properties/CSSPropertyTransformOrigin.d.ts +9 -0
  136. package/dist/css/properties/CSSPropertyTransformOrigin.d.ts.map +1 -0
  137. package/dist/css/properties/CSSPropertyZIndex.d.ts +4 -0
  138. package/dist/css/properties/CSSPropertyZIndex.d.ts.map +1 -0
  139. package/dist/css/properties/index.d.ts +19 -0
  140. package/dist/css/properties/index.d.ts.map +1 -0
  141. package/dist/display-objects/Circle.d.ts +18 -0
  142. package/dist/display-objects/Circle.d.ts.map +1 -0
  143. package/dist/display-objects/CustomElement.d.ts +25 -0
  144. package/dist/display-objects/CustomElement.d.ts.map +1 -0
  145. package/dist/display-objects/DisplayObject.d.ts +275 -0
  146. package/dist/display-objects/DisplayObject.d.ts.map +1 -0
  147. package/dist/display-objects/Ellipse.d.ts +20 -0
  148. package/dist/display-objects/Ellipse.d.ts.map +1 -0
  149. package/dist/display-objects/Group.d.ts +30 -0
  150. package/dist/display-objects/Group.d.ts.map +1 -0
  151. package/dist/display-objects/HTML.d.ts +42 -0
  152. package/dist/display-objects/HTML.d.ts.map +1 -0
  153. package/dist/display-objects/Image.d.ts +24 -0
  154. package/dist/display-objects/Image.d.ts.map +1 -0
  155. package/dist/display-objects/Line.d.ts +31 -0
  156. package/dist/display-objects/Line.d.ts.map +1 -0
  157. package/dist/display-objects/Path.d.ts +49 -0
  158. package/dist/display-objects/Path.d.ts.map +1 -0
  159. package/dist/display-objects/Polygon.d.ts +17 -0
  160. package/dist/display-objects/Polygon.d.ts.map +1 -0
  161. package/dist/display-objects/Polyline.d.ts +22 -0
  162. package/dist/display-objects/Polyline.d.ts.map +1 -0
  163. package/dist/display-objects/Rect.d.ts +25 -0
  164. package/dist/display-objects/Rect.d.ts.map +1 -0
  165. package/dist/display-objects/Text.d.ts +92 -0
  166. package/dist/display-objects/Text.d.ts.map +1 -0
  167. package/dist/display-objects/index.d.ts +14 -0
  168. package/dist/display-objects/index.d.ts.map +1 -0
  169. package/dist/dom/Animation.d.ts +133 -0
  170. package/dist/dom/Animation.d.ts.map +1 -0
  171. package/dist/dom/AnimationEffectTiming.d.ts +59 -0
  172. package/dist/dom/AnimationEffectTiming.d.ts.map +1 -0
  173. package/dist/dom/AnimationEvent.d.ts +12 -0
  174. package/dist/dom/AnimationEvent.d.ts.map +1 -0
  175. package/dist/dom/AnimationTimeline.d.ts +41 -0
  176. package/dist/dom/AnimationTimeline.d.ts.map +1 -0
  177. package/dist/dom/CustomElementRegistry.d.ts +16 -0
  178. package/dist/dom/CustomElementRegistry.d.ts.map +1 -0
  179. package/dist/dom/CustomEvent.d.ts +17 -0
  180. package/dist/dom/CustomEvent.d.ts.map +1 -0
  181. package/dist/dom/Document.d.ts +73 -0
  182. package/dist/dom/Document.d.ts.map +1 -0
  183. package/dist/dom/Element.d.ts +188 -0
  184. package/dist/dom/Element.d.ts.map +1 -0
  185. package/dist/dom/EventTarget.d.ts +41 -0
  186. package/dist/dom/EventTarget.d.ts.map +1 -0
  187. package/dist/dom/FederatedEvent.d.ts +146 -0
  188. package/dist/dom/FederatedEvent.d.ts.map +1 -0
  189. package/dist/dom/FederatedMouseEvent.d.ts +53 -0
  190. package/dist/dom/FederatedMouseEvent.d.ts.map +1 -0
  191. package/dist/dom/FederatedPointerEvent.d.ts +76 -0
  192. package/dist/dom/FederatedPointerEvent.d.ts.map +1 -0
  193. package/dist/dom/FederatedWheelEvent.d.ts +21 -0
  194. package/dist/dom/FederatedWheelEvent.d.ts.map +1 -0
  195. package/dist/dom/KeyframeEffect.d.ts +48 -0
  196. package/dist/dom/KeyframeEffect.d.ts.map +1 -0
  197. package/dist/dom/KeyframeList.d.ts +3 -0
  198. package/dist/dom/KeyframeList.d.ts.map +1 -0
  199. package/dist/dom/MutationEvent.d.ts +16 -0
  200. package/dist/dom/MutationEvent.d.ts.map +1 -0
  201. package/dist/dom/MutationObserver.d.ts +37 -0
  202. package/dist/dom/MutationObserver.d.ts.map +1 -0
  203. package/dist/dom/MutationRecord.d.ts +15 -0
  204. package/dist/dom/MutationRecord.d.ts.map +1 -0
  205. package/dist/dom/Node.d.ts +139 -0
  206. package/dist/dom/Node.d.ts.map +1 -0
  207. package/dist/dom/index.d.ts +21 -0
  208. package/dist/dom/index.d.ts.map +1 -0
  209. package/dist/dom/interfaces.d.ts +373 -0
  210. package/dist/dom/interfaces.d.ts.map +1 -0
  211. package/dist/global-module.d.ts +2 -0
  212. package/dist/global-module.d.ts.map +1 -0
  213. package/dist/index.d.ts +19 -0
  214. package/dist/index.d.ts.map +1 -0
  215. package/dist/index.esm.js +20766 -0
  216. package/dist/index.js +20942 -0
  217. package/dist/index.umd.js +29076 -0
  218. package/dist/index.umd.min.js +14 -28
  219. package/dist/plugins/CullingPlugin.d.ts +18 -0
  220. package/dist/plugins/CullingPlugin.d.ts.map +1 -0
  221. package/dist/plugins/DirtyCheckPlugin.d.ts +11 -0
  222. package/dist/plugins/DirtyCheckPlugin.d.ts.map +1 -0
  223. package/dist/plugins/EventPlugin.d.ts +30 -0
  224. package/dist/plugins/EventPlugin.d.ts.map +1 -0
  225. package/dist/plugins/FrustumCullingStrategy.d.ts +22 -0
  226. package/dist/plugins/FrustumCullingStrategy.d.ts.map +1 -0
  227. package/dist/plugins/PrepareRendererPlugin.d.ts +8 -0
  228. package/dist/plugins/PrepareRendererPlugin.d.ts.map +1 -0
  229. package/dist/services/ContextService.d.ts +14 -0
  230. package/dist/services/ContextService.d.ts.map +1 -0
  231. package/dist/services/EventService.d.ts +72 -0
  232. package/dist/services/EventService.d.ts.map +1 -0
  233. package/dist/services/OffscreenCanvasCreator.d.ts +14 -0
  234. package/dist/services/OffscreenCanvasCreator.d.ts.map +1 -0
  235. package/dist/services/RenderingContext.d.ts +27 -0
  236. package/dist/services/RenderingContext.d.ts.map +1 -0
  237. package/dist/services/RenderingService.d.ts +103 -0
  238. package/dist/services/RenderingService.d.ts.map +1 -0
  239. package/dist/services/SceneGraphSelector.d.ts +24 -0
  240. package/dist/services/SceneGraphSelector.d.ts.map +1 -0
  241. package/dist/services/SceneGraphService.d.ts +154 -0
  242. package/dist/services/SceneGraphService.d.ts.map +1 -0
  243. package/dist/services/TextService.d.ts +37 -0
  244. package/dist/services/TextService.d.ts.map +1 -0
  245. package/dist/services/aabb/CircleUpdater.d.ts +9 -0
  246. package/dist/services/aabb/CircleUpdater.d.ts.map +1 -0
  247. package/dist/services/aabb/EllipseUpdater.d.ts +9 -0
  248. package/dist/services/aabb/EllipseUpdater.d.ts.map +1 -0
  249. package/dist/services/aabb/LineUpdater.d.ts +9 -0
  250. package/dist/services/aabb/LineUpdater.d.ts.map +1 -0
  251. package/dist/services/aabb/PathUpdater.d.ts +9 -0
  252. package/dist/services/aabb/PathUpdater.d.ts.map +1 -0
  253. package/dist/services/aabb/PolylineUpdater.d.ts +9 -0
  254. package/dist/services/aabb/PolylineUpdater.d.ts.map +1 -0
  255. package/dist/services/aabb/RectUpdater.d.ts +9 -0
  256. package/dist/services/aabb/RectUpdater.d.ts.map +1 -0
  257. package/dist/services/aabb/TextUpdater.d.ts +22 -0
  258. package/dist/services/aabb/TextUpdater.d.ts.map +1 -0
  259. package/dist/services/aabb/index.d.ts +9 -0
  260. package/dist/services/aabb/index.d.ts.map +1 -0
  261. package/dist/services/aabb/interfaces.d.ts +16 -0
  262. package/dist/services/aabb/interfaces.d.ts.map +1 -0
  263. package/dist/services/index.d.ts +11 -0
  264. package/dist/services/index.d.ts.map +1 -0
  265. package/dist/shapes/AABB.d.ts +36 -0
  266. package/dist/shapes/AABB.d.ts.map +1 -0
  267. package/dist/shapes/BoundingSphere.d.ts +9 -0
  268. package/dist/shapes/BoundingSphere.d.ts.map +1 -0
  269. package/dist/shapes/Frustum.d.ts +17 -0
  270. package/dist/shapes/Frustum.d.ts.map +1 -0
  271. package/dist/shapes/Plane.d.ts +15 -0
  272. package/dist/shapes/Plane.d.ts.map +1 -0
  273. package/dist/shapes/Point.d.ts +12 -0
  274. package/dist/shapes/Point.d.ts.map +1 -0
  275. package/dist/shapes/Ray.d.ts +25 -0
  276. package/dist/shapes/Ray.d.ts.map +1 -0
  277. package/dist/shapes/Rectangle.d.ts +13 -0
  278. package/dist/shapes/Rectangle.d.ts.map +1 -0
  279. package/dist/shapes/index.d.ts +8 -0
  280. package/dist/shapes/index.d.ts.map +1 -0
  281. package/dist/types.d.ts +270 -0
  282. package/dist/types.d.ts.map +1 -0
  283. package/dist/utils/animation.d.ts +16 -0
  284. package/dist/utils/animation.d.ts.map +1 -0
  285. package/dist/utils/assert.d.ts +10 -0
  286. package/dist/utils/assert.d.ts.map +1 -0
  287. package/dist/utils/bezier-easing.d.ts +21 -0
  288. package/dist/utils/bezier-easing.d.ts.map +1 -0
  289. package/dist/utils/canvas.d.ts +7 -0
  290. package/dist/utils/canvas.d.ts.map +1 -0
  291. package/dist/utils/custom-easing.d.ts +16 -0
  292. package/dist/utils/custom-easing.d.ts.map +1 -0
  293. package/dist/utils/deferred.d.ts +44 -0
  294. package/dist/utils/deferred.d.ts.map +1 -0
  295. package/dist/utils/dom.d.ts +3 -0
  296. package/dist/utils/dom.d.ts.map +1 -0
  297. package/dist/utils/event.d.ts +36 -0
  298. package/dist/utils/event.d.ts.map +1 -0
  299. package/dist/utils/index.d.ts +13 -0
  300. package/dist/utils/index.d.ts.map +1 -0
  301. package/dist/utils/interpolation.d.ts +5 -0
  302. package/dist/utils/interpolation.d.ts.map +1 -0
  303. package/dist/utils/math.d.ts +30 -0
  304. package/dist/utils/math.d.ts.map +1 -0
  305. package/dist/utils/path.d.ts +16 -0
  306. package/dist/utils/path.d.ts.map +1 -0
  307. package/dist/utils/string.d.ts +3 -0
  308. package/dist/utils/string.d.ts.map +1 -0
  309. package/dist/utils/tapable/AsyncParallelHook.d.ts +6 -0
  310. package/dist/utils/tapable/AsyncParallelHook.d.ts.map +1 -0
  311. package/dist/utils/tapable/AsyncSeriesWaterfallHook.d.ts +6 -0
  312. package/dist/utils/tapable/AsyncSeriesWaterfallHook.d.ts.map +1 -0
  313. package/dist/utils/tapable/Hook.d.ts +52 -0
  314. package/dist/utils/tapable/Hook.d.ts.map +1 -0
  315. package/dist/utils/tapable/HookCodeFactory.d.ts +47 -0
  316. package/dist/utils/tapable/HookCodeFactory.d.ts.map +1 -0
  317. package/dist/utils/tapable/SyncHook.d.ts +6 -0
  318. package/dist/utils/tapable/SyncHook.d.ts.map +1 -0
  319. package/dist/utils/tapable/SyncWaterfallHook.d.ts +6 -0
  320. package/dist/utils/tapable/SyncWaterfallHook.d.ts.map +1 -0
  321. package/dist/utils/tapable/index.d.ts +5 -0
  322. package/dist/utils/tapable/index.d.ts.map +1 -0
  323. package/dist/utils/text.d.ts +3 -0
  324. package/dist/utils/text.d.ts.map +1 -0
  325. package/package.json +28 -35
  326. package/es/AbstractRenderer.d.ts +0 -37
  327. package/es/AbstractRenderer.js +0 -62
  328. package/es/Canvas.d.ts +0 -149
  329. package/es/Canvas.js +0 -518
  330. package/es/DisplayObjectPool.d.ts +0 -7
  331. package/es/DisplayObjectPool.js +0 -27
  332. package/es/camera/Camera.d.ts +0 -327
  333. package/es/camera/Camera.js +0 -1154
  334. package/es/camera/Landmark.d.ts +0 -23
  335. package/es/camera/Landmark.js +0 -1
  336. package/es/camera/index.d.ts +0 -2
  337. package/es/camera/index.js +0 -2
  338. package/es/canvas-module.d.ts +0 -1
  339. package/es/canvas-module.js +0 -25
  340. package/es/components/Cullable.d.ts +0 -14
  341. package/es/components/Cullable.js +0 -28
  342. package/es/components/Geometry.d.ts +0 -12
  343. package/es/components/Geometry.js +0 -10
  344. package/es/components/Renderable.d.ts +0 -24
  345. package/es/components/Renderable.js +0 -18
  346. package/es/components/Sortable.d.ts +0 -20
  347. package/es/components/Sortable.js +0 -20
  348. package/es/components/Transform.d.ts +0 -28
  349. package/es/components/Transform.js +0 -64
  350. package/es/components/index.d.ts +0 -5
  351. package/es/components/index.js +0 -5
  352. package/es/css/CSS.d.ts +0 -87
  353. package/es/css/CSS.js +0 -121
  354. package/es/css/CSSProperty.d.ts +0 -41
  355. package/es/css/CSSProperty.js +0 -1
  356. package/es/css/StyleValueRegistry.d.ts +0 -92
  357. package/es/css/StyleValueRegistry.js +0 -882
  358. package/es/css/cssom/CSSColorValue.d.ts +0 -23
  359. package/es/css/cssom/CSSColorValue.js +0 -43
  360. package/es/css/cssom/CSSGradientValue.d.ts +0 -39
  361. package/es/css/cssom/CSSGradientValue.js +0 -54
  362. package/es/css/cssom/CSSImageValue.d.ts +0 -1
  363. package/es/css/cssom/CSSImageValue.js +0 -0
  364. package/es/css/cssom/CSSKeywordValue.d.ts +0 -15
  365. package/es/css/cssom/CSSKeywordValue.js +0 -37
  366. package/es/css/cssom/CSSMathOperator.d.ts +0 -11
  367. package/es/css/cssom/CSSMathOperator.js +0 -32
  368. package/es/css/cssom/CSSNumericSumValue.d.ts +0 -7
  369. package/es/css/cssom/CSSNumericSumValue.js +0 -1
  370. package/es/css/cssom/CSSNumericValue.d.ts +0 -212
  371. package/es/css/cssom/CSSNumericValue.js +0 -1661
  372. package/es/css/cssom/CSSRGB.d.ts +0 -25
  373. package/es/css/cssom/CSSRGB.js +0 -48
  374. package/es/css/cssom/CSSStyleValue.d.ts +0 -53
  375. package/es/css/cssom/CSSStyleValue.js +0 -625
  376. package/es/css/cssom/CSSTransformComponent.d.ts +0 -22
  377. package/es/css/cssom/CSSTransformComponent.js +0 -32
  378. package/es/css/cssom/CSSTransformValue.d.ts +0 -30
  379. package/es/css/cssom/CSSTransformValue.js +0 -48
  380. package/es/css/cssom/CSSTranslate.d.ts +0 -15
  381. package/es/css/cssom/CSSTranslate.js +0 -44
  382. package/es/css/cssom/index.d.ts +0 -19
  383. package/es/css/cssom/index.js +0 -19
  384. package/es/css/cssom/types.d.ts +0 -86
  385. package/es/css/cssom/types.js +0 -119
  386. package/es/css/index.d.ts +0 -11
  387. package/es/css/index.js +0 -11
  388. package/es/css/interfaces.d.ts +0 -116
  389. package/es/css/interfaces.js +0 -77
  390. package/es/css/layout/FragmentResult.d.ts +0 -32
  391. package/es/css/layout/FragmentResult.js +0 -32
  392. package/es/css/layout/LayoutChildren.d.ts +0 -23
  393. package/es/css/layout/LayoutChildren.js +0 -55
  394. package/es/css/layout/LayoutContext.d.ts +0 -35
  395. package/es/css/layout/LayoutContext.js +0 -35
  396. package/es/css/layout/LayoutDefinition.d.ts +0 -20
  397. package/es/css/layout/LayoutDefinition.js +0 -9
  398. package/es/css/layout/LayoutEdges.d.ts +0 -24
  399. package/es/css/layout/LayoutEdges.js +0 -41
  400. package/es/css/layout/LayoutEngine.d.ts +0 -41
  401. package/es/css/layout/LayoutEngine.js +0 -332
  402. package/es/css/layout/LayoutFragment.d.ts +0 -26
  403. package/es/css/layout/LayoutFragment.js +0 -28
  404. package/es/css/layout/LayoutObject.d.ts +0 -46
  405. package/es/css/layout/LayoutObject.js +0 -172
  406. package/es/css/layout/LayoutRegistry.d.ts +0 -16
  407. package/es/css/layout/LayoutRegistry.js +0 -78
  408. package/es/css/layout/LayoutWorkTask.d.ts +0 -14
  409. package/es/css/layout/LayoutWorkTask.js +0 -1
  410. package/es/css/layout/index.d.ts +0 -11
  411. package/es/css/layout/index.js +0 -11
  412. package/es/css/layout/types.d.ts +0 -104
  413. package/es/css/layout/types.js +0 -66
  414. package/es/css/parser/color.d.ts +0 -6
  415. package/es/css/parser/color.js +0 -241
  416. package/es/css/parser/dimension.d.ts +0 -37
  417. package/es/css/parser/dimension.js +0 -149
  418. package/es/css/parser/filter.d.ts +0 -7
  419. package/es/css/parser/filter.js +0 -43
  420. package/es/css/parser/index.d.ts +0 -15
  421. package/es/css/parser/index.js +0 -15
  422. package/es/css/parser/numeric.d.ts +0 -19
  423. package/es/css/parser/numeric.js +0 -62
  424. package/es/css/parser/path.d.ts +0 -5
  425. package/es/css/parser/path.js +0 -207
  426. package/es/css/parser/points.d.ts +0 -12
  427. package/es/css/parser/points.js +0 -58
  428. package/es/css/parser/transform-origin.d.ts +0 -6
  429. package/es/css/parser/transform-origin.js +0 -45
  430. package/es/css/parser/transform.d.ts +0 -13
  431. package/es/css/parser/transform.js +0 -289
  432. package/es/css/parser/types.d.ts +0 -2
  433. package/es/css/parser/types.js +0 -1
  434. package/es/css/properties/CSSPropertyClipPath.d.ts +0 -22
  435. package/es/css/properties/CSSPropertyClipPath.js +0 -56
  436. package/es/css/properties/CSSPropertyColor.d.ts +0 -14
  437. package/es/css/properties/CSSPropertyColor.js +0 -30
  438. package/es/css/properties/CSSPropertyFilter.d.ts +0 -6
  439. package/es/css/properties/CSSPropertyFilter.js +0 -16
  440. package/es/css/properties/CSSPropertyLengthOrPercentage.d.ts +0 -20
  441. package/es/css/properties/CSSPropertyLengthOrPercentage.js +0 -95
  442. package/es/css/properties/CSSPropertyLengthOrPercentage12.d.ts +0 -15
  443. package/es/css/properties/CSSPropertyLengthOrPercentage12.js +0 -38
  444. package/es/css/properties/CSSPropertyLengthOrPercentage14.d.ts +0 -25
  445. package/es/css/properties/CSSPropertyLengthOrPercentage14.js +0 -42
  446. package/es/css/properties/CSSPropertyLocalPosition.d.ts +0 -13
  447. package/es/css/properties/CSSPropertyLocalPosition.js +0 -85
  448. package/es/css/properties/CSSPropertyOffsetDistance.d.ts +0 -9
  449. package/es/css/properties/CSSPropertyOffsetDistance.js +0 -34
  450. package/es/css/properties/CSSPropertyOffsetPath.d.ts +0 -5
  451. package/es/css/properties/CSSPropertyOffsetPath.js +0 -31
  452. package/es/css/properties/CSSPropertyOpacity.d.ts +0 -10
  453. package/es/css/properties/CSSPropertyOpacity.js +0 -20
  454. package/es/css/properties/CSSPropertyPath.d.ts +0 -27
  455. package/es/css/properties/CSSPropertyPath.js +0 -58
  456. package/es/css/properties/CSSPropertyPoints.d.ts +0 -18
  457. package/es/css/properties/CSSPropertyPoints.js +0 -30
  458. package/es/css/properties/CSSPropertyShadowBlur.d.ts +0 -4
  459. package/es/css/properties/CSSPropertyShadowBlur.js +0 -22
  460. package/es/css/properties/CSSPropertyText.d.ts +0 -7
  461. package/es/css/properties/CSSPropertyText.js +0 -30
  462. package/es/css/properties/CSSPropertyTextTransform.d.ts +0 -5
  463. package/es/css/properties/CSSPropertyTextTransform.js +0 -29
  464. package/es/css/properties/CSSPropertyTransform.d.ts +0 -38
  465. package/es/css/properties/CSSPropertyTransform.js +0 -128
  466. package/es/css/properties/CSSPropertyTransformOrigin.d.ts +0 -11
  467. package/es/css/properties/CSSPropertyTransformOrigin.js +0 -21
  468. package/es/css/properties/CSSPropertyVisibility.d.ts +0 -13
  469. package/es/css/properties/CSSPropertyVisibility.js +0 -24
  470. package/es/css/properties/CSSPropertyZIndex.d.ts +0 -8
  471. package/es/css/properties/CSSPropertyZIndex.js +0 -33
  472. package/es/css/properties/index.d.ts +0 -18
  473. package/es/css/properties/index.js +0 -18
  474. package/es/display-objects/Circle.d.ts +0 -17
  475. package/es/display-objects/Circle.js +0 -34
  476. package/es/display-objects/CustomElement.d.ts +0 -26
  477. package/es/display-objects/CustomElement.js +0 -102
  478. package/es/display-objects/DisplayObject.d.ts +0 -274
  479. package/es/display-objects/DisplayObject.js +0 -887
  480. package/es/display-objects/Ellipse.d.ts +0 -19
  481. package/es/display-objects/Ellipse.js +0 -35
  482. package/es/display-objects/Group.d.ts +0 -29
  483. package/es/display-objects/Group.js +0 -42
  484. package/es/display-objects/HTML.d.ts +0 -41
  485. package/es/display-objects/HTML.js +0 -100
  486. package/es/display-objects/Image.d.ts +0 -23
  487. package/es/display-objects/Image.js +0 -34
  488. package/es/display-objects/Line.d.ts +0 -30
  489. package/es/display-objects/Line.js +0 -63
  490. package/es/display-objects/Path.d.ts +0 -48
  491. package/es/display-objects/Path.js +0 -131
  492. package/es/display-objects/Polygon.d.ts +0 -16
  493. package/es/display-objects/Polygon.js +0 -31
  494. package/es/display-objects/Polyline.d.ts +0 -21
  495. package/es/display-objects/Polyline.js +0 -74
  496. package/es/display-objects/Rect.d.ts +0 -24
  497. package/es/display-objects/Rect.js +0 -34
  498. package/es/display-objects/Text.d.ts +0 -91
  499. package/es/display-objects/Text.js +0 -118
  500. package/es/display-objects/index.d.ts +0 -13
  501. package/es/display-objects/index.js +0 -13
  502. package/es/dom/Animation.d.ts +0 -132
  503. package/es/dom/Animation.js +0 -503
  504. package/es/dom/AnimationEffectTiming.d.ts +0 -58
  505. package/es/dom/AnimationEffectTiming.js +0 -68
  506. package/es/dom/AnimationEvent.d.ts +0 -11
  507. package/es/dom/AnimationEvent.js +0 -34
  508. package/es/dom/AnimationTimeline.d.ts +0 -40
  509. package/es/dom/AnimationTimeline.js +0 -217
  510. package/es/dom/CustomElementRegistry.d.ts +0 -15
  511. package/es/dom/CustomElementRegistry.js +0 -42
  512. package/es/dom/CustomEvent.d.ts +0 -16
  513. package/es/dom/CustomEvent.js +0 -35
  514. package/es/dom/Document.d.ts +0 -72
  515. package/es/dom/Document.js +0 -316
  516. package/es/dom/Element.d.ts +0 -187
  517. package/es/dom/Element.js +0 -604
  518. package/es/dom/EventTarget.d.ts +0 -40
  519. package/es/dom/EventTarget.js +0 -157
  520. package/es/dom/FederatedEvent.d.ts +0 -145
  521. package/es/dom/FederatedEvent.js +0 -222
  522. package/es/dom/FederatedMouseEvent.d.ts +0 -52
  523. package/es/dom/FederatedMouseEvent.js +0 -124
  524. package/es/dom/FederatedPointerEvent.d.ts +0 -75
  525. package/es/dom/FederatedPointerEvent.js +0 -61
  526. package/es/dom/FederatedTouchEvent.d.ts +0 -15
  527. package/es/dom/FederatedTouchEvent.js +0 -19
  528. package/es/dom/FederatedWheelEvent.d.ts +0 -20
  529. package/es/dom/FederatedWheelEvent.js +0 -27
  530. package/es/dom/KeyframeEffect.d.ts +0 -47
  531. package/es/dom/KeyframeEffect.js +0 -174
  532. package/es/dom/KeyframeList.d.ts +0 -2
  533. package/es/dom/KeyframeList.js +0 -176
  534. package/es/dom/MutationEvent.d.ts +0 -15
  535. package/es/dom/MutationEvent.js +0 -29
  536. package/es/dom/MutationObserver.d.ts +0 -36
  537. package/es/dom/MutationObserver.js +0 -416
  538. package/es/dom/MutationRecord.d.ts +0 -14
  539. package/es/dom/MutationRecord.js +0 -31
  540. package/es/dom/Node.d.ts +0 -138
  541. package/es/dom/Node.js +0 -387
  542. package/es/dom/index.d.ts +0 -20
  543. package/es/dom/index.js +0 -20
  544. package/es/dom/interfaces.d.ts +0 -372
  545. package/es/dom/interfaces.js +0 -56
  546. package/es/global-module.d.ts +0 -1
  547. package/es/global-module.js +0 -155
  548. package/es/index.d.ts +0 -18
  549. package/es/index.js +0 -21
  550. package/es/plugins/CullingPlugin.d.ts +0 -17
  551. package/es/plugins/CullingPlugin.js +0 -58
  552. package/es/plugins/DirtyCheckPlugin.d.ts +0 -10
  553. package/es/plugins/DirtyCheckPlugin.js +0 -55
  554. package/es/plugins/EventPlugin.d.ts +0 -30
  555. package/es/plugins/EventPlugin.js +0 -374
  556. package/es/plugins/FrustumCullingStrategy.d.ts +0 -21
  557. package/es/plugins/FrustumCullingStrategy.js +0 -108
  558. package/es/plugins/PrepareRendererPlugin.d.ts +0 -7
  559. package/es/plugins/PrepareRendererPlugin.js +0 -79
  560. package/es/services/ContextService.d.ts +0 -13
  561. package/es/services/ContextService.js +0 -5
  562. package/es/services/EventService.d.ts +0 -73
  563. package/es/services/EventService.js +0 -1238
  564. package/es/services/OffscreenCanvasCreator.d.ts +0 -13
  565. package/es/services/OffscreenCanvasCreator.js +0 -58
  566. package/es/services/RenderingContext.d.ts +0 -26
  567. package/es/services/RenderingContext.js +0 -14
  568. package/es/services/RenderingService.d.ts +0 -102
  569. package/es/services/RenderingService.js +0 -231
  570. package/es/services/SceneGraphSelector.d.ts +0 -23
  571. package/es/services/SceneGraphSelector.js +0 -100
  572. package/es/services/SceneGraphService.d.ts +0 -153
  573. package/es/services/SceneGraphService.js +0 -819
  574. package/es/services/TextService.d.ts +0 -36
  575. package/es/services/TextService.js +0 -350
  576. package/es/services/aabb/CircleUpdater.d.ts +0 -8
  577. package/es/services/aabb/CircleUpdater.js +0 -30
  578. package/es/services/aabb/EllipseUpdater.d.ts +0 -8
  579. package/es/services/aabb/EllipseUpdater.js +0 -31
  580. package/es/services/aabb/LineUpdater.d.ts +0 -8
  581. package/es/services/aabb/LineUpdater.js +0 -37
  582. package/es/services/aabb/PathUpdater.d.ts +0 -8
  583. package/es/services/aabb/PathUpdater.js +0 -168
  584. package/es/services/aabb/PolylineUpdater.d.ts +0 -8
  585. package/es/services/aabb/PolylineUpdater.js +0 -46
  586. package/es/services/aabb/RectUpdater.d.ts +0 -8
  587. package/es/services/aabb/RectUpdater.js +0 -72
  588. package/es/services/aabb/TextUpdater.d.ts +0 -21
  589. package/es/services/aabb/TextUpdater.js +0 -136
  590. package/es/services/aabb/index.d.ts +0 -8
  591. package/es/services/aabb/index.js +0 -8
  592. package/es/services/aabb/interfaces.d.ts +0 -15
  593. package/es/services/aabb/interfaces.js +0 -3
  594. package/es/services/index.d.ts +0 -10
  595. package/es/services/index.js +0 -10
  596. package/es/shapes/AABB.d.ts +0 -35
  597. package/es/shapes/AABB.js +0 -230
  598. package/es/shapes/BoundingSphere.d.ts +0 -8
  599. package/es/shapes/BoundingSphere.js +0 -31
  600. package/es/shapes/Frustum.d.ts +0 -16
  601. package/es/shapes/Frustum.js +0 -79
  602. package/es/shapes/Plane.d.ts +0 -14
  603. package/es/shapes/Plane.js +0 -42
  604. package/es/shapes/Point.d.ts +0 -11
  605. package/es/shapes/Point.js +0 -31
  606. package/es/shapes/Ray.d.ts +0 -24
  607. package/es/shapes/Ray.js +0 -138
  608. package/es/shapes/Rectangle.d.ts +0 -12
  609. package/es/shapes/Rectangle.js +0 -20
  610. package/es/shapes/index.d.ts +0 -7
  611. package/es/shapes/index.js +0 -7
  612. package/es/types.d.ts +0 -289
  613. package/es/types.js +0 -54
  614. package/es/utils/animation.d.ts +0 -15
  615. package/es/utils/animation.js +0 -251
  616. package/es/utils/assert.d.ts +0 -9
  617. package/es/utils/assert.js +0 -33
  618. package/es/utils/bezier-easing.d.ts +0 -20
  619. package/es/utils/bezier-easing.js +0 -90
  620. package/es/utils/canvas.d.ts +0 -6
  621. package/es/utils/canvas.js +0 -18
  622. package/es/utils/custom-easing.d.ts +0 -64
  623. package/es/utils/custom-easing.js +0 -317
  624. package/es/utils/deferred.d.ts +0 -43
  625. package/es/utils/deferred.js +0 -117
  626. package/es/utils/dom.d.ts +0 -2
  627. package/es/utils/dom.js +0 -8
  628. package/es/utils/event.d.ts +0 -45
  629. package/es/utils/event.js +0 -9
  630. package/es/utils/index.d.ts +0 -10
  631. package/es/utils/index.js +0 -10
  632. package/es/utils/interpolation.d.ts +0 -4
  633. package/es/utils/interpolation.js +0 -212
  634. package/es/utils/math.d.ts +0 -29
  635. package/es/utils/math.js +0 -236
  636. package/es/utils/path.d.ts +0 -15
  637. package/es/utils/path.js +0 -387
  638. package/es/utils/string.d.ts +0 -2
  639. package/es/utils/string.js +0 -17
  640. package/es/utils/text.d.ts +0 -2
  641. package/es/utils/text.js +0 -29
  642. package/lib/AbstractRenderer.d.ts +0 -37
  643. package/lib/AbstractRenderer.js +0 -69
  644. package/lib/Canvas.d.ts +0 -149
  645. package/lib/Canvas.js +0 -540
  646. package/lib/DisplayObjectPool.d.ts +0 -7
  647. package/lib/DisplayObjectPool.js +0 -35
  648. package/lib/camera/Camera.d.ts +0 -327
  649. package/lib/camera/Camera.js +0 -1232
  650. package/lib/camera/Landmark.d.ts +0 -23
  651. package/lib/camera/Landmark.js +0 -5
  652. package/lib/camera/index.d.ts +0 -2
  653. package/lib/camera/index.js +0 -31
  654. package/lib/canvas-module.d.ts +0 -1
  655. package/lib/canvas-module.js +0 -41
  656. package/lib/components/Cullable.d.ts +0 -14
  657. package/lib/components/Cullable.js +0 -36
  658. package/lib/components/Geometry.d.ts +0 -12
  659. package/lib/components/Geometry.js +0 -17
  660. package/lib/components/Renderable.d.ts +0 -24
  661. package/lib/components/Renderable.js +0 -25
  662. package/lib/components/Sortable.d.ts +0 -20
  663. package/lib/components/Sortable.js +0 -27
  664. package/lib/components/Transform.d.ts +0 -28
  665. package/lib/components/Transform.js +0 -71
  666. package/lib/components/index.d.ts +0 -5
  667. package/lib/components/index.js +0 -70
  668. package/lib/css/CSS.d.ts +0 -87
  669. package/lib/css/CSS.js +0 -135
  670. package/lib/css/CSSProperty.d.ts +0 -41
  671. package/lib/css/CSSProperty.js +0 -5
  672. package/lib/css/StyleValueRegistry.d.ts +0 -92
  673. package/lib/css/StyleValueRegistry.js +0 -909
  674. package/lib/css/cssom/CSSColorValue.d.ts +0 -23
  675. package/lib/css/cssom/CSSColorValue.js +0 -51
  676. package/lib/css/cssom/CSSGradientValue.d.ts +0 -39
  677. package/lib/css/cssom/CSSGradientValue.js +0 -64
  678. package/lib/css/cssom/CSSImageValue.d.ts +0 -1
  679. package/lib/css/cssom/CSSImageValue.js +0 -1
  680. package/lib/css/cssom/CSSKeywordValue.d.ts +0 -15
  681. package/lib/css/cssom/CSSKeywordValue.js +0 -45
  682. package/lib/css/cssom/CSSMathOperator.d.ts +0 -11
  683. package/lib/css/cssom/CSSMathOperator.js +0 -40
  684. package/lib/css/cssom/CSSNumericSumValue.d.ts +0 -7
  685. package/lib/css/cssom/CSSNumericSumValue.js +0 -5
  686. package/lib/css/cssom/CSSNumericValue.d.ts +0 -212
  687. package/lib/css/cssom/CSSNumericValue.js +0 -1685
  688. package/lib/css/cssom/CSSRGB.d.ts +0 -25
  689. package/lib/css/cssom/CSSRGB.js +0 -56
  690. package/lib/css/cssom/CSSStyleValue.d.ts +0 -53
  691. package/lib/css/cssom/CSSStyleValue.js +0 -634
  692. package/lib/css/cssom/CSSTransformComponent.d.ts +0 -22
  693. package/lib/css/cssom/CSSTransformComponent.js +0 -39
  694. package/lib/css/cssom/CSSTransformValue.d.ts +0 -30
  695. package/lib/css/cssom/CSSTransformValue.js +0 -56
  696. package/lib/css/cssom/CSSTranslate.d.ts +0 -15
  697. package/lib/css/cssom/CSSTranslate.js +0 -53
  698. package/lib/css/cssom/index.d.ts +0 -19
  699. package/lib/css/cssom/index.js +0 -148
  700. package/lib/css/cssom/types.d.ts +0 -86
  701. package/lib/css/cssom/types.js +0 -130
  702. package/lib/css/index.d.ts +0 -11
  703. package/lib/css/index.js +0 -109
  704. package/lib/css/interfaces.d.ts +0 -116
  705. package/lib/css/interfaces.js +0 -87
  706. package/lib/css/layout/FragmentResult.d.ts +0 -32
  707. package/lib/css/layout/FragmentResult.js +0 -51
  708. package/lib/css/layout/LayoutChildren.d.ts +0 -23
  709. package/lib/css/layout/LayoutChildren.js +0 -72
  710. package/lib/css/layout/LayoutContext.d.ts +0 -35
  711. package/lib/css/layout/LayoutContext.js +0 -49
  712. package/lib/css/layout/LayoutDefinition.d.ts +0 -20
  713. package/lib/css/layout/LayoutDefinition.js +0 -16
  714. package/lib/css/layout/LayoutEdges.d.ts +0 -24
  715. package/lib/css/layout/LayoutEdges.js +0 -56
  716. package/lib/css/layout/LayoutEngine.d.ts +0 -41
  717. package/lib/css/layout/LayoutEngine.js +0 -345
  718. package/lib/css/layout/LayoutFragment.d.ts +0 -26
  719. package/lib/css/layout/LayoutFragment.js +0 -44
  720. package/lib/css/layout/LayoutObject.d.ts +0 -46
  721. package/lib/css/layout/LayoutObject.js +0 -182
  722. package/lib/css/layout/LayoutRegistry.d.ts +0 -16
  723. package/lib/css/layout/LayoutRegistry.js +0 -87
  724. package/lib/css/layout/LayoutWorkTask.d.ts +0 -14
  725. package/lib/css/layout/LayoutWorkTask.js +0 -5
  726. package/lib/css/layout/index.d.ts +0 -11
  727. package/lib/css/layout/index.js +0 -148
  728. package/lib/css/layout/types.d.ts +0 -104
  729. package/lib/css/layout/types.js +0 -74
  730. package/lib/css/parser/color.d.ts +0 -6
  731. package/lib/css/parser/color.js +0 -260
  732. package/lib/css/parser/dimension.d.ts +0 -37
  733. package/lib/css/parser/dimension.js +0 -175
  734. package/lib/css/parser/filter.d.ts +0 -7
  735. package/lib/css/parser/filter.js +0 -56
  736. package/lib/css/parser/index.d.ts +0 -15
  737. package/lib/css/parser/index.js +0 -122
  738. package/lib/css/parser/numeric.d.ts +0 -19
  739. package/lib/css/parser/numeric.js +0 -81
  740. package/lib/css/parser/path.d.ts +0 -5
  741. package/lib/css/parser/path.js +0 -221
  742. package/lib/css/parser/points.d.ts +0 -12
  743. package/lib/css/parser/points.js +0 -69
  744. package/lib/css/parser/transform-origin.d.ts +0 -6
  745. package/lib/css/parser/transform-origin.js +0 -54
  746. package/lib/css/parser/transform.d.ts +0 -13
  747. package/lib/css/parser/transform.js +0 -303
  748. package/lib/css/parser/types.d.ts +0 -2
  749. package/lib/css/parser/types.js +0 -5
  750. package/lib/css/properties/CSSPropertyClipPath.d.ts +0 -22
  751. package/lib/css/properties/CSSPropertyClipPath.js +0 -66
  752. package/lib/css/properties/CSSPropertyColor.d.ts +0 -14
  753. package/lib/css/properties/CSSPropertyColor.js +0 -40
  754. package/lib/css/properties/CSSPropertyFilter.d.ts +0 -6
  755. package/lib/css/properties/CSSPropertyFilter.js +0 -25
  756. package/lib/css/properties/CSSPropertyLengthOrPercentage.d.ts +0 -20
  757. package/lib/css/properties/CSSPropertyLengthOrPercentage.js +0 -105
  758. package/lib/css/properties/CSSPropertyLengthOrPercentage12.d.ts +0 -15
  759. package/lib/css/properties/CSSPropertyLengthOrPercentage12.js +0 -48
  760. package/lib/css/properties/CSSPropertyLengthOrPercentage14.d.ts +0 -25
  761. package/lib/css/properties/CSSPropertyLengthOrPercentage14.js +0 -52
  762. package/lib/css/properties/CSSPropertyLocalPosition.d.ts +0 -13
  763. package/lib/css/properties/CSSPropertyLocalPosition.js +0 -96
  764. package/lib/css/properties/CSSPropertyOffsetDistance.d.ts +0 -9
  765. package/lib/css/properties/CSSPropertyOffsetDistance.js +0 -44
  766. package/lib/css/properties/CSSPropertyOffsetPath.d.ts +0 -5
  767. package/lib/css/properties/CSSPropertyOffsetPath.js +0 -39
  768. package/lib/css/properties/CSSPropertyOpacity.d.ts +0 -10
  769. package/lib/css/properties/CSSPropertyOpacity.js +0 -29
  770. package/lib/css/properties/CSSPropertyPath.d.ts +0 -27
  771. package/lib/css/properties/CSSPropertyPath.js +0 -70
  772. package/lib/css/properties/CSSPropertyPoints.d.ts +0 -18
  773. package/lib/css/properties/CSSPropertyPoints.js +0 -40
  774. package/lib/css/properties/CSSPropertyShadowBlur.d.ts +0 -4
  775. package/lib/css/properties/CSSPropertyShadowBlur.js +0 -32
  776. package/lib/css/properties/CSSPropertyText.d.ts +0 -7
  777. package/lib/css/properties/CSSPropertyText.js +0 -39
  778. package/lib/css/properties/CSSPropertyTextTransform.d.ts +0 -5
  779. package/lib/css/properties/CSSPropertyTextTransform.js +0 -38
  780. package/lib/css/properties/CSSPropertyTransform.d.ts +0 -38
  781. package/lib/css/properties/CSSPropertyTransform.js +0 -138
  782. package/lib/css/properties/CSSPropertyTransformOrigin.d.ts +0 -11
  783. package/lib/css/properties/CSSPropertyTransformOrigin.js +0 -30
  784. package/lib/css/properties/CSSPropertyVisibility.d.ts +0 -13
  785. package/lib/css/properties/CSSPropertyVisibility.js +0 -32
  786. package/lib/css/properties/CSSPropertyZIndex.d.ts +0 -8
  787. package/lib/css/properties/CSSPropertyZIndex.js +0 -42
  788. package/lib/css/properties/index.d.ts +0 -18
  789. package/lib/css/properties/index.js +0 -239
  790. package/lib/display-objects/Circle.d.ts +0 -17
  791. package/lib/display-objects/Circle.js +0 -42
  792. package/lib/display-objects/CustomElement.d.ts +0 -26
  793. package/lib/display-objects/CustomElement.js +0 -109
  794. package/lib/display-objects/DisplayObject.d.ts +0 -274
  795. package/lib/display-objects/DisplayObject.js +0 -910
  796. package/lib/display-objects/Ellipse.d.ts +0 -19
  797. package/lib/display-objects/Ellipse.js +0 -43
  798. package/lib/display-objects/Group.d.ts +0 -29
  799. package/lib/display-objects/Group.js +0 -50
  800. package/lib/display-objects/HTML.d.ts +0 -41
  801. package/lib/display-objects/HTML.js +0 -111
  802. package/lib/display-objects/Image.d.ts +0 -23
  803. package/lib/display-objects/Image.js +0 -42
  804. package/lib/display-objects/Line.d.ts +0 -30
  805. package/lib/display-objects/Line.js +0 -75
  806. package/lib/display-objects/Path.d.ts +0 -48
  807. package/lib/display-objects/Path.js +0 -142
  808. package/lib/display-objects/Polygon.d.ts +0 -16
  809. package/lib/display-objects/Polygon.js +0 -39
  810. package/lib/display-objects/Polyline.d.ts +0 -21
  811. package/lib/display-objects/Polyline.js +0 -84
  812. package/lib/display-objects/Rect.d.ts +0 -24
  813. package/lib/display-objects/Rect.js +0 -42
  814. package/lib/display-objects/Text.d.ts +0 -91
  815. package/lib/display-objects/Text.js +0 -126
  816. package/lib/display-objects/index.d.ts +0 -13
  817. package/lib/display-objects/index.js +0 -174
  818. package/lib/dom/Animation.d.ts +0 -132
  819. package/lib/dom/Animation.js +0 -511
  820. package/lib/dom/AnimationEffectTiming.d.ts +0 -58
  821. package/lib/dom/AnimationEffectTiming.js +0 -75
  822. package/lib/dom/AnimationEvent.d.ts +0 -11
  823. package/lib/dom/AnimationEvent.js +0 -42
  824. package/lib/dom/AnimationTimeline.d.ts +0 -40
  825. package/lib/dom/AnimationTimeline.js +0 -228
  826. package/lib/dom/CustomElementRegistry.d.ts +0 -15
  827. package/lib/dom/CustomElementRegistry.js +0 -50
  828. package/lib/dom/CustomEvent.d.ts +0 -16
  829. package/lib/dom/CustomEvent.js +0 -42
  830. package/lib/dom/Document.d.ts +0 -72
  831. package/lib/dom/Document.js +0 -329
  832. package/lib/dom/Element.d.ts +0 -187
  833. package/lib/dom/Element.js +0 -619
  834. package/lib/dom/EventTarget.d.ts +0 -40
  835. package/lib/dom/EventTarget.js +0 -171
  836. package/lib/dom/FederatedEvent.d.ts +0 -145
  837. package/lib/dom/FederatedEvent.js +0 -229
  838. package/lib/dom/FederatedMouseEvent.d.ts +0 -52
  839. package/lib/dom/FederatedMouseEvent.js +0 -133
  840. package/lib/dom/FederatedPointerEvent.d.ts +0 -75
  841. package/lib/dom/FederatedPointerEvent.js +0 -69
  842. package/lib/dom/FederatedTouchEvent.d.ts +0 -15
  843. package/lib/dom/FederatedTouchEvent.js +0 -27
  844. package/lib/dom/FederatedWheelEvent.d.ts +0 -20
  845. package/lib/dom/FederatedWheelEvent.js +0 -35
  846. package/lib/dom/KeyframeEffect.d.ts +0 -47
  847. package/lib/dom/KeyframeEffect.js +0 -192
  848. package/lib/dom/KeyframeList.d.ts +0 -2
  849. package/lib/dom/KeyframeList.js +0 -183
  850. package/lib/dom/MutationEvent.d.ts +0 -15
  851. package/lib/dom/MutationEvent.js +0 -37
  852. package/lib/dom/MutationObserver.d.ts +0 -36
  853. package/lib/dom/MutationObserver.js +0 -426
  854. package/lib/dom/MutationRecord.d.ts +0 -14
  855. package/lib/dom/MutationRecord.js +0 -38
  856. package/lib/dom/Node.d.ts +0 -138
  857. package/lib/dom/Node.js +0 -397
  858. package/lib/dom/index.d.ts +0 -20
  859. package/lib/dom/index.js +0 -265
  860. package/lib/dom/interfaces.d.ts +0 -372
  861. package/lib/dom/interfaces.js +0 -64
  862. package/lib/global-module.d.ts +0 -1
  863. package/lib/global-module.js +0 -170
  864. package/lib/index.d.ts +0 -18
  865. package/lib/index.js +0 -198
  866. package/lib/plugins/CullingPlugin.d.ts +0 -17
  867. package/lib/plugins/CullingPlugin.js +0 -69
  868. package/lib/plugins/DirtyCheckPlugin.d.ts +0 -10
  869. package/lib/plugins/DirtyCheckPlugin.js +0 -63
  870. package/lib/plugins/EventPlugin.d.ts +0 -30
  871. package/lib/plugins/EventPlugin.js +0 -382
  872. package/lib/plugins/FrustumCullingStrategy.d.ts +0 -21
  873. package/lib/plugins/FrustumCullingStrategy.js +0 -121
  874. package/lib/plugins/PrepareRendererPlugin.d.ts +0 -7
  875. package/lib/plugins/PrepareRendererPlugin.js +0 -87
  876. package/lib/services/ContextService.d.ts +0 -13
  877. package/lib/services/ContextService.js +0 -15
  878. package/lib/services/EventService.d.ts +0 -73
  879. package/lib/services/EventService.js +0 -1263
  880. package/lib/services/OffscreenCanvasCreator.d.ts +0 -13
  881. package/lib/services/OffscreenCanvasCreator.js +0 -66
  882. package/lib/services/RenderingContext.d.ts +0 -26
  883. package/lib/services/RenderingContext.js +0 -24
  884. package/lib/services/RenderingService.d.ts +0 -102
  885. package/lib/services/RenderingService.js +0 -244
  886. package/lib/services/SceneGraphSelector.d.ts +0 -23
  887. package/lib/services/SceneGraphSelector.js +0 -114
  888. package/lib/services/SceneGraphService.d.ts +0 -153
  889. package/lib/services/SceneGraphService.js +0 -875
  890. package/lib/services/TextService.d.ts +0 -36
  891. package/lib/services/TextService.js +0 -359
  892. package/lib/services/aabb/CircleUpdater.d.ts +0 -8
  893. package/lib/services/aabb/CircleUpdater.js +0 -40
  894. package/lib/services/aabb/EllipseUpdater.d.ts +0 -8
  895. package/lib/services/aabb/EllipseUpdater.js +0 -41
  896. package/lib/services/aabb/LineUpdater.d.ts +0 -8
  897. package/lib/services/aabb/LineUpdater.js +0 -47
  898. package/lib/services/aabb/PathUpdater.d.ts +0 -8
  899. package/lib/services/aabb/PathUpdater.js +0 -179
  900. package/lib/services/aabb/PolylineUpdater.d.ts +0 -8
  901. package/lib/services/aabb/PolylineUpdater.js +0 -56
  902. package/lib/services/aabb/RectUpdater.d.ts +0 -8
  903. package/lib/services/aabb/RectUpdater.js +0 -84
  904. package/lib/services/aabb/TextUpdater.d.ts +0 -21
  905. package/lib/services/aabb/TextUpdater.js +0 -149
  906. package/lib/services/aabb/index.d.ts +0 -8
  907. package/lib/services/aabb/index.js +0 -84
  908. package/lib/services/aabb/interfaces.d.ts +0 -15
  909. package/lib/services/aabb/interfaces.js +0 -16
  910. package/lib/services/index.d.ts +0 -10
  911. package/lib/services/index.js +0 -122
  912. package/lib/shapes/AABB.d.ts +0 -35
  913. package/lib/shapes/AABB.js +0 -248
  914. package/lib/shapes/BoundingSphere.d.ts +0 -8
  915. package/lib/shapes/BoundingSphere.js +0 -41
  916. package/lib/shapes/Frustum.d.ts +0 -16
  917. package/lib/shapes/Frustum.js +0 -96
  918. package/lib/shapes/Plane.d.ts +0 -14
  919. package/lib/shapes/Plane.js +0 -51
  920. package/lib/shapes/Point.d.ts +0 -11
  921. package/lib/shapes/Point.js +0 -38
  922. package/lib/shapes/Ray.d.ts +0 -24
  923. package/lib/shapes/Ray.js +0 -169
  924. package/lib/shapes/Rectangle.d.ts +0 -12
  925. package/lib/shapes/Rectangle.js +0 -27
  926. package/lib/shapes/index.d.ts +0 -7
  927. package/lib/shapes/index.js +0 -96
  928. package/lib/types.d.ts +0 -289
  929. package/lib/types.js +0 -69
  930. package/lib/utils/animation.d.ts +0 -15
  931. package/lib/utils/animation.js +0 -275
  932. package/lib/utils/assert.d.ts +0 -9
  933. package/lib/utils/assert.js +0 -56
  934. package/lib/utils/bezier-easing.d.ts +0 -20
  935. package/lib/utils/bezier-easing.js +0 -128
  936. package/lib/utils/canvas.d.ts +0 -6
  937. package/lib/utils/canvas.js +0 -27
  938. package/lib/utils/custom-easing.d.ts +0 -64
  939. package/lib/utils/custom-easing.js +0 -392
  940. package/lib/utils/deferred.d.ts +0 -43
  941. package/lib/utils/deferred.js +0 -131
  942. package/lib/utils/dom.d.ts +0 -2
  943. package/lib/utils/dom.js +0 -17
  944. package/lib/utils/event.d.ts +0 -45
  945. package/lib/utils/event.js +0 -17
  946. package/lib/utils/index.d.ts +0 -10
  947. package/lib/utils/index.js +0 -135
  948. package/lib/utils/interpolation.d.ts +0 -4
  949. package/lib/utils/interpolation.js +0 -229
  950. package/lib/utils/math.d.ts +0 -29
  951. package/lib/utils/math.js +0 -273
  952. package/lib/utils/path.d.ts +0 -15
  953. package/lib/utils/path.js +0 -409
  954. package/lib/utils/string.d.ts +0 -2
  955. package/lib/utils/string.js +0 -27
  956. package/lib/utils/text.d.ts +0 -2
  957. package/lib/utils/text.js +0 -39
@@ -1,1685 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Opx = exports.Odeg = exports.CSSUnitValue = exports.CSSNumericValueType = exports.CSSNumericValue = exports.CSSMathVariadic = exports.CSSMathValue = exports.CSSMathSum = exports.CSSMathProduct = exports.CSSMathNegate = exports.CSSMathMin = exports.CSSMathMax = exports.CSSMathInvert = exports.BaseType = void 0;
7
- exports.baseTypeToString = baseTypeToString;
8
- exports.typeCheck = typeCheck;
9
- exports.unitTypeToBaseType = unitTypeToBaseType;
10
-
11
- var _tslib = require("tslib");
12
-
13
- var _assert = require("../../utils/assert");
14
-
15
- var _CSSMathOperator = require("./CSSMathOperator");
16
-
17
- var _CSSStyleValue = require("./CSSStyleValue");
18
-
19
- var _types = require("./types");
20
-
21
- // https://drafts.css-houdini.org/css-typed-om/#enumdef-cssnumericbasetype
22
- var BaseType;
23
- exports.BaseType = BaseType;
24
-
25
- (function (BaseType) {
26
- BaseType[BaseType["kLength"] = 0] = "kLength";
27
- BaseType[BaseType["kAngle"] = 1] = "kAngle";
28
- BaseType[BaseType["kTime"] = 2] = "kTime";
29
- BaseType[BaseType["kFrequency"] = 3] = "kFrequency";
30
- BaseType[BaseType["kResolution"] = 4] = "kResolution";
31
- BaseType[BaseType["kFlex"] = 5] = "kFlex";
32
- BaseType[BaseType["kPercent"] = 6] = "kPercent";
33
- BaseType[BaseType["kNumBaseTypes"] = 7] = "kNumBaseTypes";
34
- })(BaseType || (exports.BaseType = BaseType = {}));
35
-
36
- function unitTypeToBaseType(unit) {
37
- (0, _assert.DCHECK_NE)(unit, _types.UnitType.kNumber);
38
-
39
- switch (unit) {
40
- case _types.UnitType.kEms:
41
- case _types.UnitType.kExs:
42
- case _types.UnitType.kPixels:
43
- case _types.UnitType.kCentimeters:
44
- case _types.UnitType.kMillimeters:
45
- case _types.UnitType.kQuarterMillimeters:
46
- case _types.UnitType.kInches:
47
- case _types.UnitType.kPoints:
48
- case _types.UnitType.kPicas:
49
- case _types.UnitType.kUserUnits:
50
- case _types.UnitType.kViewportWidth:
51
- case _types.UnitType.kViewportHeight:
52
- case _types.UnitType.kViewportInlineSize:
53
- case _types.UnitType.kViewportBlockSize:
54
- case _types.UnitType.kViewportMin:
55
- case _types.UnitType.kViewportMax:
56
- case _types.UnitType.kSmallViewportWidth:
57
- case _types.UnitType.kSmallViewportHeight:
58
- case _types.UnitType.kSmallViewportInlineSize:
59
- case _types.UnitType.kSmallViewportBlockSize:
60
- case _types.UnitType.kSmallViewportMin:
61
- case _types.UnitType.kSmallViewportMax:
62
- case _types.UnitType.kLargeViewportWidth:
63
- case _types.UnitType.kLargeViewportHeight:
64
- case _types.UnitType.kLargeViewportInlineSize:
65
- case _types.UnitType.kLargeViewportBlockSize:
66
- case _types.UnitType.kLargeViewportMin:
67
- case _types.UnitType.kLargeViewportMax:
68
- case _types.UnitType.kDynamicViewportWidth:
69
- case _types.UnitType.kDynamicViewportHeight:
70
- case _types.UnitType.kDynamicViewportInlineSize:
71
- case _types.UnitType.kDynamicViewportBlockSize:
72
- case _types.UnitType.kDynamicViewportMin:
73
- case _types.UnitType.kDynamicViewportMax:
74
- case _types.UnitType.kContainerWidth:
75
- case _types.UnitType.kContainerHeight:
76
- case _types.UnitType.kContainerInlineSize:
77
- case _types.UnitType.kContainerBlockSize:
78
- case _types.UnitType.kContainerMin:
79
- case _types.UnitType.kContainerMax:
80
- case _types.UnitType.kRems:
81
- case _types.UnitType.kChs:
82
- return BaseType.kLength;
83
-
84
- case _types.UnitType.kMilliseconds:
85
- case _types.UnitType.kSeconds:
86
- return BaseType.kTime;
87
-
88
- case _types.UnitType.kDegrees:
89
- case _types.UnitType.kRadians:
90
- case _types.UnitType.kGradians:
91
- case _types.UnitType.kTurns:
92
- return BaseType.kAngle;
93
-
94
- case _types.UnitType.kHertz:
95
- case _types.UnitType.kKilohertz:
96
- return BaseType.kFrequency;
97
-
98
- case _types.UnitType.kDotsPerPixel:
99
- case _types.UnitType.kDotsPerInch:
100
- case _types.UnitType.kDotsPerCentimeter:
101
- return BaseType.kResolution;
102
-
103
- case _types.UnitType.kFraction:
104
- return BaseType.kFlex;
105
-
106
- case _types.UnitType.kPercentage:
107
- return BaseType.kPercent;
108
-
109
- default:
110
- return BaseType.kLength;
111
- }
112
- }
113
-
114
- function baseTypeToString(baseType) {
115
- switch (baseType) {
116
- case BaseType.kLength:
117
- return 'length';
118
-
119
- case BaseType.kAngle:
120
- return 'angle';
121
-
122
- case BaseType.kTime:
123
- return 'time';
124
-
125
- case BaseType.kFrequency:
126
- return 'frequency';
127
-
128
- case BaseType.kResolution:
129
- return 'resolution';
130
-
131
- case BaseType.kFlex:
132
- return 'flex';
133
-
134
- case BaseType.kPercent:
135
- return 'percent';
136
-
137
- default:
138
- break;
139
- }
140
-
141
- return '';
142
- }
143
-
144
- var CSSNumericValueType =
145
- /** @class */
146
- function () {
147
- function CSSNumericValueType(unit, exponent) {
148
- if (unit === void 0) {
149
- unit = _types.UnitType.kNumber;
150
- }
151
-
152
- if (exponent === void 0) {
153
- exponent = 1;
154
- }
155
-
156
- this.exponents = [];
157
- this.numNonZeroEntries = 0;
158
- this.percentHint = BaseType.kPercent;
159
- this.hasPercentHint = false;
160
- this.exponents = new Array(BaseType.kNumBaseTypes).fill(0);
161
-
162
- if (unit !== _types.UnitType.kNumber) {
163
- this.setExponent(unitTypeToBaseType(unit), exponent);
164
- }
165
- }
166
-
167
- CSSNumericValueType.prototype.applyPercentHint = function (hint) {
168
- (0, _assert.DCHECK_NE)(hint, BaseType.kPercent);
169
- this.setExponent(hint, this.exponent(hint) + this.exponent(BaseType.kPercent));
170
- this.setExponent(BaseType.kPercent, 0);
171
- this.percentHint = hint;
172
- this.hasPercentHint = true;
173
- };
174
-
175
- CSSNumericValueType.prototype.hasNonZeroEntries = function () {
176
- return this.numNonZeroEntries > 0;
177
- };
178
-
179
- CSSNumericValueType.prototype.isOnlyNonZeroEntry = function (baseType, value) {
180
- (0, _assert.DCHECK_NE)(value, 0);
181
- return this.numNonZeroEntries === 1 && this.exponent(baseType) === value;
182
- };
183
-
184
- CSSNumericValueType.prototype.exponent = function (type) {
185
- return this.exponents[type];
186
- };
187
-
188
- CSSNumericValueType.prototype.setExponent = function (type, newValue) {
189
- var oldValue = this.exponents[type];
190
-
191
- if (oldValue == 0 && newValue !== 0) {
192
- this.numNonZeroEntries++;
193
- } else if (oldValue !== 0 && newValue == 0) {
194
- this.numNonZeroEntries--;
195
- }
196
-
197
- this.exponents[type] = newValue;
198
- };
199
-
200
- CSSNumericValueType.negateExponents = function (type) {
201
- type.exponents.forEach(function (v) {
202
- return v *= -1;
203
- });
204
- return type;
205
- };
206
-
207
- CSSNumericValueType.prototype.matchesBaseType = function (baseType) {
208
- (0, _assert.DCHECK_NE)(baseType, BaseType.kPercent);
209
- return this.isOnlyNonZeroEntry(baseType, 1) && !this.hasPercentHint;
210
- };
211
-
212
- CSSNumericValueType.prototype.matchesPercentage = function () {
213
- return this.isOnlyNonZeroEntry(BaseType.kPercent, 1);
214
- };
215
-
216
- CSSNumericValueType.prototype.matchesBaseTypePercentage = function (baseType) {
217
- (0, _assert.DCHECK_NE)(baseType, BaseType.kPercent);
218
- return this.isOnlyNonZeroEntry(baseType, 1) || this.isOnlyNonZeroEntry(BaseType.kPercent, 1);
219
- };
220
-
221
- CSSNumericValueType.prototype.matchesNumber = function () {
222
- return !this.hasNonZeroEntries() && !this.hasPercentHint;
223
- };
224
-
225
- CSSNumericValueType.prototype.matchesNumberPercentage = function () {
226
- return !this.hasNonZeroEntries() || this.isOnlyNonZeroEntry(BaseType.kPercent, 1);
227
- };
228
-
229
- CSSNumericValueType.add = function (type1, type2, error) {
230
- if (type1.hasPercentHint && type2.hasPercentHint && type1.percentHint != type2.percentHint) {
231
- error = true;
232
- return type1;
233
- }
234
-
235
- if (type1.hasPercentHint) type2.applyPercentHint(type1.percentHint);else if (type2.hasPercentHint) type1.applyPercentHint(type2.percentHint);
236
- (0, _assert.DCHECK_EQ)(type1.percentHint, type2.percentHint); // Match up base types. Try to use the percent hint to match up any
237
- // differences.
238
-
239
- for (var i = 0; i < BaseType.kNumBaseTypes; ++i) {
240
- var base_type = i;
241
-
242
- if (type1.exponents[i] !== type2.exponents[i]) {
243
- if (base_type !== BaseType.kPercent) {
244
- type1.applyPercentHint(base_type);
245
- type2.applyPercentHint(base_type);
246
- }
247
-
248
- if (type1.exponents[i] !== type2.exponents[i]) {
249
- error = true;
250
- return type1;
251
- }
252
- }
253
- }
254
-
255
- error = false;
256
- return type1;
257
- };
258
-
259
- CSSNumericValueType.multiply = function (type1, type2, error) {
260
- if (type1.hasPercentHint && type2.hasPercentHint && type1.percentHint != type2.percentHint) {
261
- error = true;
262
- return type1;
263
- }
264
-
265
- if (type1.hasPercentHint) type2.applyPercentHint(type1.percentHint);else if (type2.hasPercentHint) type1.applyPercentHint(type2.percentHint);
266
-
267
- for (var i = 0; i < BaseType.kNumBaseTypes; ++i) {
268
- var base_type = i;
269
- type1.setExponent(base_type, type1.exponent(base_type) + type2.exponent(base_type));
270
- }
271
-
272
- error = false;
273
- return type1;
274
- };
275
-
276
- return CSSNumericValueType;
277
- }();
278
-
279
- exports.CSSNumericValueType = CSSNumericValueType;
280
-
281
- /**
282
- * CSSNumericValue is the base class for numeric and length typed CSS Values.
283
- * @see https://drafts.css-houdini.org/css-typed-om/#numeric-objects
284
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue
285
- * @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_numeric_value.idl
286
- */
287
- var CSSNumericValue =
288
- /** @class */
289
- function (_super) {
290
- (0, _tslib.__extends)(CSSNumericValue, _super);
291
-
292
- function CSSNumericValue(type_) {
293
- var _this = _super.call(this) || this;
294
-
295
- _this.type_ = type_;
296
- return _this;
297
- }
298
- /**
299
- * @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_numeric_value.cc#296
300
- */
301
-
302
-
303
- CSSNumericValue.fromNumberish = function (value) {
304
- if (typeof value === 'number') {
305
- return new CSSUnitValue(value, _types.UnitType.kNumber);
306
- }
307
-
308
- return value;
309
- };
310
-
311
- CSSNumericValue.fromPercentish = function (value) {
312
- if (typeof value === 'number') {
313
- return new CSSUnitValue(value * 100, _types.UnitType.kPercentage);
314
- }
315
-
316
- return value;
317
- };
318
-
319
- CSSNumericValue.prototype.getType = function () {
320
- return _CSSStyleValue.CSSStyleValueType.kUnknownType;
321
- }; // toCSSValue() {
322
- // return null;
323
- // }
324
-
325
- /**
326
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue/equals
327
- */
328
-
329
-
330
- CSSNumericValue.prototype.equals = function () {
331
- var _this = this;
332
-
333
- var numberishes = [];
334
-
335
- for (var _i = 0; _i < arguments.length; _i++) {
336
- numberishes[_i] = arguments[_i];
337
- }
338
-
339
- var values = cssNumberishesToNumericValues(numberishes);
340
- return values.every(function (value) {
341
- return _this.equals(value);
342
- });
343
- };
344
- /**
345
- * @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_numeric_value.cc#439
346
- */
347
-
348
-
349
- CSSNumericValue.prototype.add = function () {
350
- var numberishes = [];
351
-
352
- for (var _i = 0; _i < arguments.length; _i++) {
353
- numberishes[_i] = arguments[_i];
354
- }
355
-
356
- var values = cssNumberishesToNumericValues(numberishes);
357
- prependValueForArithmetic(_CSSStyleValue.CSSStyleValueType.kSumType, values, this); // eg. 1px + 2px = 3px
358
-
359
- var unitValue = maybeSimplifyAsUnitValue(values, _CSSMathOperator.CSSMathOperator.kAdd);
360
-
361
- if (unitValue) {
362
- return unitValue;
363
- }
364
-
365
- return CSSMathSum.create(values);
366
- };
367
- /**
368
- * @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_numeric_value.cc#452
369
- */
370
-
371
-
372
- CSSNumericValue.prototype.sub = function () {
373
- var numberishes = [];
374
-
375
- for (var _i = 0; _i < arguments.length; _i++) {
376
- numberishes[_i] = arguments[_i];
377
- }
378
-
379
- var values = cssNumberishesToNumericValues(numberishes);
380
- values = values.map(function (value) {
381
- return value.negate();
382
- });
383
- prependValueForArithmetic(_CSSStyleValue.CSSStyleValueType.kSumType, values, this); // eg. 3px - 2px = 1px
384
-
385
- var unitValue = maybeSimplifyAsUnitValue(values, _CSSMathOperator.CSSMathOperator.kAdd);
386
-
387
- if (unitValue) {
388
- return unitValue;
389
- }
390
-
391
- return CSSMathSum.create(values);
392
- };
393
- /**
394
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue/mul
395
- */
396
-
397
-
398
- CSSNumericValue.prototype.mul = function () {
399
- var numberishes = [];
400
-
401
- for (var _i = 0; _i < arguments.length; _i++) {
402
- numberishes[_i] = arguments[_i];
403
- }
404
-
405
- var values = cssNumberishesToNumericValues(numberishes);
406
- prependValueForArithmetic(_CSSStyleValue.CSSStyleValueType.kProductType, values, this);
407
- var unitValue = maybeMultiplyAsUnitValue(values);
408
-
409
- if (unitValue) {
410
- return unitValue;
411
- }
412
-
413
- return CSSMathProduct.create(values);
414
- };
415
- /**
416
- * eg. calc(24px / 4%)
417
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue/div
418
- */
419
-
420
-
421
- CSSNumericValue.prototype.div = function () {
422
- var numberishes = [];
423
-
424
- for (var _i = 0; _i < arguments.length; _i++) {
425
- numberishes[_i] = arguments[_i];
426
- }
427
-
428
- var values = cssNumberishesToNumericValues(numberishes);
429
- values = values.map(function (value) {
430
- return value.invert();
431
- });
432
- prependValueForArithmetic(_CSSStyleValue.CSSStyleValueType.kProductType, values, this);
433
- var unitValue = maybeMultiplyAsUnitValue(values);
434
-
435
- if (unitValue) {
436
- return unitValue;
437
- }
438
-
439
- return CSSMathProduct.create(values);
440
- };
441
-
442
- CSSNumericValue.prototype.min = function () {
443
- var numberishes = [];
444
-
445
- for (var _i = 0; _i < arguments.length; _i++) {
446
- numberishes[_i] = arguments[_i];
447
- }
448
-
449
- var values = cssNumberishesToNumericValues(numberishes);
450
- prependValueForArithmetic(_CSSStyleValue.CSSStyleValueType.kMinType, values, this);
451
- var unitValue = maybeSimplifyAsUnitValue(values, _CSSMathOperator.CSSMathOperator.kMin);
452
-
453
- if (unitValue) {
454
- return unitValue;
455
- }
456
-
457
- return CSSMathMin.create(values);
458
- };
459
-
460
- CSSNumericValue.prototype.max = function () {
461
- var numberishes = [];
462
-
463
- for (var _i = 0; _i < arguments.length; _i++) {
464
- numberishes[_i] = arguments[_i];
465
- }
466
-
467
- var values = cssNumberishesToNumericValues(numberishes);
468
- prependValueForArithmetic(_CSSStyleValue.CSSStyleValueType.kMaxType, values, this);
469
- var unitValue = maybeSimplifyAsUnitValue(values, _CSSMathOperator.CSSMathOperator.kMax);
470
-
471
- if (unitValue) {
472
- return unitValue;
473
- }
474
-
475
- return CSSMathMax.create(values);
476
- };
477
- /**
478
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue/to
479
- * @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_numeric_value.cc#331
480
- */
481
-
482
-
483
- CSSNumericValue.prototype.to = function (unitOrName) {
484
- var sum = this.sumValue();
485
- if (sum.length === 0 || sum.length !== 1) return null;
486
- var value = cssNumericSumValueEntryToUnitValue(sum[0]);
487
- if (!value) return null;
488
- var unit;
489
-
490
- if (typeof unitOrName === 'string') {
491
- unit = CSSUnitValue.unitFromName(unitOrName);
492
- } else {
493
- unit = unitOrName;
494
- }
495
-
496
- return value.convertTo(unit);
497
- };
498
- /**
499
- * converts the object's value to a CSSMathSum object to values of the specified unit.
500
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue/toSum
501
- */
502
-
503
-
504
- CSSNumericValue.prototype.toSum = function () {
505
- var e_1, _a, e_2, _b, e_3, _c;
506
-
507
- var unit_strings = [];
508
-
509
- for (var _i = 0; _i < arguments.length; _i++) {
510
- unit_strings[_i] = arguments[_i];
511
- }
512
-
513
- try {
514
- for (var unit_strings_1 = (0, _tslib.__values)(unit_strings), unit_strings_1_1 = unit_strings_1.next(); !unit_strings_1_1.done; unit_strings_1_1 = unit_strings_1.next()) {
515
- var unit_string = unit_strings_1_1.value;
516
-
517
- if (!CSSNumericValue.isValidUnit(CSSNumericValue.unitFromName(unit_string))) {
518
- return null;
519
- }
520
- }
521
- } catch (e_1_1) {
522
- e_1 = {
523
- error: e_1_1
524
- };
525
- } finally {
526
- try {
527
- if (unit_strings_1_1 && !unit_strings_1_1.done && (_a = unit_strings_1.return)) _a.call(unit_strings_1);
528
- } finally {
529
- if (e_1) throw e_1.error;
530
- }
531
- }
532
-
533
- var sum = this.sumValue();
534
-
535
- if (!sum.length) {
536
- return null;
537
- }
538
-
539
- var values = [];
540
-
541
- try {
542
- for (var sum_1 = (0, _tslib.__values)(sum), sum_1_1 = sum_1.next(); !sum_1_1.done; sum_1_1 = sum_1.next()) {
543
- var term = sum_1_1.value;
544
- var value = cssNumericSumValueEntryToUnitValue(term);
545
-
546
- if (!value) {
547
- return null;
548
- }
549
-
550
- values.push(value);
551
- }
552
- } catch (e_2_1) {
553
- e_2 = {
554
- error: e_2_1
555
- };
556
- } finally {
557
- try {
558
- if (sum_1_1 && !sum_1_1.done && (_b = sum_1.return)) _b.call(sum_1);
559
- } finally {
560
- if (e_2) throw e_2.error;
561
- }
562
- }
563
-
564
- if (unit_strings.length === 0) {
565
- values.sort(function (a, b) {
566
- return a.unit - b.unit;
567
- }); // We got 'values' from a sum value, so it must be a valid CSSMathSum.
568
-
569
- var result_1 = CSSMathSum.create(values);
570
- (0, _assert.DCHECK)(!!result_1);
571
- return result_1;
572
- }
573
-
574
- var result = [];
575
-
576
- var _loop_1 = function _loop_1(unit_string) {
577
- var target_unit = CSSNumericValue.unitFromName(unit_string);
578
- (0, _assert.DCHECK)(CSSNumericValue.isValidUnit(target_unit)); // Collect all the terms that are compatible with this unit.
579
- // We mark used terms as null so we don't use them again.
580
-
581
- var total_value = values.reduce(function (cur_sum, value, i) {
582
- if (value) {
583
- var unit_value = value;
584
- var converted_value = unit_value.convertTo(target_unit);
585
-
586
- if (converted_value) {
587
- cur_sum += converted_value.value;
588
- values[i] = null;
589
- }
590
- }
591
-
592
- return cur_sum;
593
- }, 0);
594
- result.push(new CSSUnitValue(total_value, target_unit));
595
- };
596
-
597
- try {
598
- for (var unit_strings_2 = (0, _tslib.__values)(unit_strings), unit_strings_2_1 = unit_strings_2.next(); !unit_strings_2_1.done; unit_strings_2_1 = unit_strings_2.next()) {
599
- var unit_string = unit_strings_2_1.value;
600
-
601
- _loop_1(unit_string);
602
- }
603
- } catch (e_3_1) {
604
- e_3 = {
605
- error: e_3_1
606
- };
607
- } finally {
608
- try {
609
- if (unit_strings_2_1 && !unit_strings_2_1.done && (_c = unit_strings_2.return)) _c.call(unit_strings_2);
610
- } finally {
611
- if (e_3) throw e_3.error;
612
- }
613
- }
614
-
615
- if (values.some(function (v) {
616
- return !!v;
617
- })) {
618
- throw new Error('There were leftover terms that were not converted');
619
- }
620
-
621
- return CSSMathSum.create(result);
622
- };
623
- /**
624
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue/type
625
- * @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_numeric_value.cc#414
626
- */
627
-
628
-
629
- CSSNumericValue.prototype.type = function () {
630
- var type = {
631
- length: 0,
632
- angle: 0,
633
- time: 0,
634
- frequency: 0,
635
- resolution: 0,
636
- flex: 0,
637
- percent: 0,
638
- percentHint: 'length'
639
- };
640
- var exponent = this.type_.exponent(BaseType.kLength);
641
-
642
- if (exponent) {
643
- type.length = exponent;
644
- }
645
-
646
- exponent = this.type_.exponent(BaseType.kAngle);
647
-
648
- if (exponent) {
649
- type.angle = exponent;
650
- }
651
-
652
- exponent = this.type_.exponent(BaseType.kTime);
653
-
654
- if (exponent) {
655
- type.time = exponent;
656
- }
657
-
658
- exponent = this.type_.exponent(BaseType.kFrequency);
659
-
660
- if (exponent) {
661
- type.frequency = exponent;
662
- }
663
-
664
- exponent = this.type_.exponent(BaseType.kResolution);
665
-
666
- if (exponent) {
667
- type.resolution = exponent;
668
- }
669
-
670
- exponent = this.type_.exponent(BaseType.kFlex);
671
-
672
- if (exponent) {
673
- type.flex = exponent;
674
- }
675
-
676
- exponent = this.type_.exponent(BaseType.kPercent);
677
-
678
- if (exponent) {
679
- type.percent = exponent;
680
- }
681
-
682
- if (this.type_.hasPercentHint) {
683
- type.percentHint = baseTypeToString(this.type_.percentHint);
684
- }
685
-
686
- return type;
687
- };
688
-
689
- CSSNumericValue.isValidUnit = function (unit) {
690
- if (unit === _types.UnitType.kUserUnits) return false;
691
- if (unit === _types.UnitType.kNumber || unit == _types.UnitType.kPercentage || this.isLength(unit) || this.isAngle(unit) || this.isTime(unit) || this.isFrequency(unit) || this.isResolution(unit) || this.isFlex(unit)) return true;
692
- return false;
693
- };
694
-
695
- CSSNumericValue.prototype.negate = function () {
696
- return CSSMathNegate.create(this);
697
- };
698
-
699
- CSSNumericValue.prototype.invert = function () {
700
- return CSSMathInvert.create(this);
701
- };
702
-
703
- return CSSNumericValue;
704
- }(_CSSStyleValue.CSSStyleValue);
705
-
706
- exports.CSSNumericValue = CSSNumericValue;
707
-
708
- function cssNumberishesToNumericValues(values) {
709
- return values.map(CSSNumericValue.fromNumberish);
710
- }
711
-
712
- function prependValueForArithmetic(type, values, value) {
713
- (0, _assert.DCHECK)(!!value);
714
-
715
- if (value.getType() === type) {
716
- values.unshift.apply(values, (0, _tslib.__spreadArray)([], (0, _tslib.__read)(value.numericValues()), false));
717
- } else {
718
- values.unshift(value);
719
- }
720
- }
721
-
722
- function cssNumericSumValueEntryToUnitValue(term) {
723
- if (Object.keys(term.units).length === 0) {
724
- return new CSSUnitValue(term.value);
725
- }
726
-
727
- if (Object.keys(term.units).length === 1 && term.units[Object.keys(term.units)[0]] === 1) {
728
- return new CSSUnitValue(term.value, Number(Object.keys(term.units)[0]));
729
- }
730
-
731
- return null;
732
- }
733
-
734
- function maybeSimplifyAsUnitValue(values, operator) {
735
- (0, _assert.DCHECK)(!!values.length);
736
- var first_unit_value = values[0] instanceof CSSUnitValue ? values[0] : null;
737
- if (!first_unit_value) return null;
738
- var final_value = first_unit_value.value;
739
-
740
- for (var i = 1; i < values.length; i++) {
741
- var unit_value = values[i] instanceof CSSUnitValue ? values[i] : null;
742
- if (!unit_value || unit_value.unit !== first_unit_value.unit) return null;
743
-
744
- if (operator === _CSSMathOperator.CSSMathOperator.kAdd) {
745
- final_value += unit_value.value;
746
- } else if (operator === _CSSMathOperator.CSSMathOperator.kMax) {
747
- final_value = Math.max(final_value, unit_value.value);
748
- } else if (operator === _CSSMathOperator.CSSMathOperator.kMin) {
749
- final_value = Math.min(final_value, unit_value.value);
750
- }
751
- }
752
-
753
- return new CSSUnitValue(final_value, first_unit_value.unit);
754
- }
755
-
756
- function maybeMultiplyAsUnitValue(values) {
757
- (0, _assert.DCHECK)(!!values.length); // We are allowed one unit value with type other than kNumber.
758
-
759
- var unit_other_than_number = _types.UnitType.kNumber;
760
- var final_value = 1.0;
761
-
762
- for (var i = 0; i < values.length; i++) {
763
- var unit_value = values[i] instanceof CSSUnitValue ? values[i] : null;
764
- if (!unit_value) return null;
765
-
766
- if (unit_value.unit !== _types.UnitType.kNumber) {
767
- if (unit_other_than_number !== _types.UnitType.kNumber) return null;
768
- unit_other_than_number = unit_value.unit;
769
- }
770
-
771
- final_value *= unit_value.value;
772
- }
773
-
774
- return new CSSUnitValue(final_value, unit_other_than_number);
775
- }
776
- /**
777
- * Represents numeric values that can be expressed as a single number plus a
778
- * unit (or a naked number or percentage).
779
- * @see https://drafts.css-houdini.org/css-typed-om/#cssunitvalue
780
- */
781
-
782
-
783
- var CSSUnitValue =
784
- /** @class */
785
- function (_super) {
786
- (0, _tslib.__extends)(CSSUnitValue, _super);
787
-
788
- function CSSUnitValue(value, unitOrName) {
789
- if (unitOrName === void 0) {
790
- unitOrName = _types.UnitType.kNumber;
791
- }
792
-
793
- var _this = this;
794
-
795
- var unit;
796
-
797
- if (typeof unitOrName === 'string') {
798
- unit = CSSUnitValue.unitFromName(unitOrName);
799
- } else {
800
- unit = unitOrName;
801
- }
802
-
803
- (0, _assert.DCHECK)(CSSUnitValue.isValidUnit(unit));
804
- _this = _super.call(this, new CSSNumericValueType(unit)) || this;
805
- _this.unit = unit;
806
- _this.value = value;
807
- return _this;
808
- } // static fromCSSValue(value: CSSNumericLiteralValue) {
809
- // let unit = value.type;
810
- // if (unit === UnitType.kInteger) unit = UnitType.kNumber;
811
- // if (!this.isValidUnit(unit)) return null;
812
- // return new CSSUnitValue(value.getDoubleValue(), unit);
813
- // }
814
-
815
-
816
- CSSUnitValue.toCanonicalUnit = function (unit) {
817
- return this.canonicalUnitTypeForCategory(this.unitTypeToUnitCategory(unit));
818
- };
819
-
820
- CSSUnitValue.toCanonicalUnitIfPossible = function (unit) {
821
- var canonical_unit = this.toCanonicalUnit(unit);
822
- if (canonical_unit === _types.UnitType.kUnknown) return unit;
823
- return canonical_unit;
824
- };
825
-
826
- CSSUnitValue.formatInfinityOrNaN = function (number, suffix) {
827
- if (suffix === void 0) {
828
- suffix = '';
829
- }
830
-
831
- var result = '';
832
-
833
- if (!Number.isFinite(number)) {
834
- if (number > 0) result = 'infinity';else result = '-infinity';
835
- } else {
836
- (0, _assert.DCHECK)(Number.isNaN(number));
837
- result = 'NaN';
838
- }
839
-
840
- return result += suffix;
841
- };
842
-
843
- CSSUnitValue.formatNumber = function (number, suffix) {
844
- if (suffix === void 0) {
845
- suffix = '';
846
- }
847
-
848
- return number + suffix;
849
- };
850
-
851
- CSSUnitValue.prototype.clone = function () {
852
- return new CSSUnitValue(this.value, this.unit);
853
- };
854
-
855
- CSSUnitValue.prototype.convertTo = function (target_unit) {
856
- if (this.unit === target_unit) {
857
- return new CSSUnitValue(this.value, this.unit);
858
- } // Instead of defining the scale factors for every unit to every other unit,
859
- // we simply convert to the canonical unit and back since we already have
860
- // the scale factors for canonical units.
861
-
862
-
863
- var canonical_unit = CSSUnitValue.toCanonicalUnit(this.unit);
864
-
865
- if (canonical_unit !== CSSUnitValue.toCanonicalUnit(target_unit) || canonical_unit === _types.UnitType.kUnknown) {
866
- return null;
867
- }
868
-
869
- var scale_factor = _CSSStyleValue.CSSStyleValue.conversionToCanonicalUnitsScaleFactor(this.unit) / _CSSStyleValue.CSSStyleValue.conversionToCanonicalUnitsScaleFactor(target_unit);
870
-
871
- return new CSSUnitValue(this.value * scale_factor, target_unit);
872
- };
873
-
874
- CSSUnitValue.prototype.equals = function (other) {
875
- var other_unit_value = other;
876
- return this.value === other_unit_value.value && this.unit === other_unit_value.unit;
877
- };
878
-
879
- CSSUnitValue.prototype.getType = function () {
880
- return _CSSStyleValue.CSSStyleValueType.kUnitType;
881
- }; // toCSSValue() {
882
- // return new CSSNumericLiteralValue(this.value, this.unit);
883
- // }
884
- // // const CSSPrimitiveValue* ToCSSValueWithProperty(CSSPropertyID) const final;
885
- // toCalcExpressionNode() {
886
- // return CSSMathExpressionNumericLiteral.create(
887
- // new CSSNumericLiteralValue(this.value, this.unit),
888
- // );
889
- // }
890
-
891
-
892
- CSSUnitValue.prototype.sumValue = function () {
893
- var sum = [];
894
- var unit_map = {};
895
-
896
- if (this.unit !== _types.UnitType.kNumber) {
897
- unit_map[CSSUnitValue.toCanonicalUnitIfPossible(this.unit)] = 1;
898
- }
899
-
900
- sum.push({
901
- value: this.value * _CSSStyleValue.CSSStyleValue.conversionToCanonicalUnitsScaleFactor(this.unit),
902
- units: unit_map
903
- });
904
- return sum;
905
- };
906
-
907
- CSSUnitValue.prototype.negate = function () {
908
- return new CSSUnitValue(-this.value, this.unit);
909
- };
910
-
911
- CSSUnitValue.prototype.invert = function () {
912
- if (this.unit === _types.UnitType.kNumber) {
913
- if (this.value === 0) return null;
914
- return new CSSUnitValue(1.0 / this.value, this.unit);
915
- }
916
-
917
- return CSSMathInvert.create(this);
918
- };
919
-
920
- CSSUnitValue.prototype.buildCSSText = function (n, p, result) {
921
- var text;
922
-
923
- switch (this.unit) {
924
- case _types.UnitType.kUnknown:
925
- // FIXME
926
- break;
927
-
928
- case _types.UnitType.kInteger:
929
- text = Number(this.value).toFixed(0);
930
- break;
931
-
932
- case _types.UnitType.kNumber:
933
- case _types.UnitType.kPercentage:
934
- case _types.UnitType.kEms:
935
- case _types.UnitType.kQuirkyEms:
936
- case _types.UnitType.kExs:
937
- case _types.UnitType.kRems:
938
- case _types.UnitType.kChs:
939
- case _types.UnitType.kPixels:
940
- case _types.UnitType.kCentimeters:
941
- case _types.UnitType.kDotsPerPixel:
942
- case _types.UnitType.kDotsPerInch:
943
- case _types.UnitType.kDotsPerCentimeter:
944
- case _types.UnitType.kMillimeters:
945
- case _types.UnitType.kQuarterMillimeters:
946
- case _types.UnitType.kInches:
947
- case _types.UnitType.kPoints:
948
- case _types.UnitType.kPicas:
949
- case _types.UnitType.kUserUnits:
950
- case _types.UnitType.kDegrees:
951
- case _types.UnitType.kRadians:
952
- case _types.UnitType.kGradians:
953
- case _types.UnitType.kMilliseconds:
954
- case _types.UnitType.kSeconds:
955
- case _types.UnitType.kHertz:
956
- case _types.UnitType.kKilohertz:
957
- case _types.UnitType.kTurns:
958
- case _types.UnitType.kFraction:
959
- case _types.UnitType.kViewportWidth:
960
- case _types.UnitType.kViewportHeight:
961
- case _types.UnitType.kViewportInlineSize:
962
- case _types.UnitType.kViewportBlockSize:
963
- case _types.UnitType.kViewportMin:
964
- case _types.UnitType.kViewportMax:
965
- case _types.UnitType.kSmallViewportWidth:
966
- case _types.UnitType.kSmallViewportHeight:
967
- case _types.UnitType.kSmallViewportInlineSize:
968
- case _types.UnitType.kSmallViewportBlockSize:
969
- case _types.UnitType.kSmallViewportMin:
970
- case _types.UnitType.kSmallViewportMax:
971
- case _types.UnitType.kLargeViewportWidth:
972
- case _types.UnitType.kLargeViewportHeight:
973
- case _types.UnitType.kLargeViewportInlineSize:
974
- case _types.UnitType.kLargeViewportBlockSize:
975
- case _types.UnitType.kLargeViewportMin:
976
- case _types.UnitType.kLargeViewportMax:
977
- case _types.UnitType.kDynamicViewportWidth:
978
- case _types.UnitType.kDynamicViewportHeight:
979
- case _types.UnitType.kDynamicViewportInlineSize:
980
- case _types.UnitType.kDynamicViewportBlockSize:
981
- case _types.UnitType.kDynamicViewportMin:
982
- case _types.UnitType.kDynamicViewportMax:
983
- case _types.UnitType.kContainerWidth:
984
- case _types.UnitType.kContainerHeight:
985
- case _types.UnitType.kContainerInlineSize:
986
- case _types.UnitType.kContainerBlockSize:
987
- case _types.UnitType.kContainerMin:
988
- case _types.UnitType.kContainerMax:
989
- {
990
- var kMinInteger = -999999;
991
- var kMaxInteger = 999999;
992
- var value = this.value;
993
- var unit = CSSUnitValue.unitTypeToString(this.unit);
994
-
995
- if (value < kMinInteger || value > kMaxInteger) {
996
- var unit_1 = CSSUnitValue.unitTypeToString(this.unit);
997
-
998
- if (!Number.isFinite(value) || Number.isNaN(value)) {
999
- text = CSSUnitValue.formatInfinityOrNaN(value, unit_1);
1000
- } else {
1001
- text = CSSUnitValue.formatNumber(value, unit_1);
1002
- }
1003
- } else {
1004
- text = "".concat(value).concat(unit);
1005
- }
1006
- }
1007
- }
1008
-
1009
- result += text;
1010
- return result;
1011
- };
1012
-
1013
- return CSSUnitValue;
1014
- }(CSSNumericValue);
1015
-
1016
- exports.CSSUnitValue = CSSUnitValue;
1017
-
1018
- /**
1019
- * The CSSMathValue interface of the CSS_Object_Model a base class for classes representing complex numeric values.
1020
- *
1021
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSMathValue
1022
- * @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_math_value.idl
1023
- */
1024
- var CSSMathValue =
1025
- /** @class */
1026
- function (_super) {
1027
- (0, _tslib.__extends)(CSSMathValue, _super);
1028
-
1029
- function CSSMathValue() {
1030
- return _super !== null && _super.apply(this, arguments) || this;
1031
- } // From CSSNumericValue
1032
-
1033
-
1034
- CSSMathValue.prototype.isUnitValue = function () {
1035
- return false;
1036
- };
1037
-
1038
- return CSSMathValue;
1039
- }(CSSNumericValue);
1040
-
1041
- exports.CSSMathValue = CSSMathValue;
1042
-
1043
- var CSSMathInvert =
1044
- /** @class */
1045
- function (_super) {
1046
- (0, _tslib.__extends)(CSSMathInvert, _super);
1047
-
1048
- function CSSMathInvert(value, type) {
1049
- var _this = _super.call(this, type) || this;
1050
-
1051
- _this.value = value;
1052
- _this.operator = 'invert';
1053
- return _this;
1054
- }
1055
-
1056
- CSSMathInvert.create = function (value) {
1057
- var type = CSSNumericValueType.negateExponents(value.type_);
1058
- return new CSSMathInvert(value, type);
1059
- };
1060
-
1061
- CSSMathInvert.prototype.clone = function () {
1062
- return new CSSMathInvert(this.value, this.type_);
1063
- };
1064
-
1065
- CSSMathInvert.prototype.getType = function () {
1066
- return _CSSStyleValue.CSSStyleValueType.kInvertType;
1067
- };
1068
-
1069
- CSSMathInvert.prototype.equals = function (other) {
1070
- if (other.getType() !== _CSSStyleValue.CSSStyleValueType.kInvertType) {
1071
- return false;
1072
- } // We can safely cast here as we know 'other' has the same type as us.
1073
-
1074
-
1075
- var other_invert = other;
1076
- return this.value.equals(other_invert.value);
1077
- };
1078
-
1079
- CSSMathInvert.prototype.sumValue = function () {
1080
- var sum = this.value.sumValue();
1081
-
1082
- if (sum.length === 0 || sum.length !== 1 || sum[0].value === 0) {
1083
- return null;
1084
- }
1085
-
1086
- Object.keys(sum[0].units).forEach(function (key) {
1087
- sum[0].units[key] *= -1;
1088
- });
1089
- sum[0].value = 1.0 / sum[0].value;
1090
- return sum;
1091
- }; // toCalcExpressionNode(): CSSMathExpressionNode {
1092
- // const right_side = this.value.toCalcExpressionNode();
1093
- // if (!right_side) {
1094
- // return null;
1095
- // }
1096
- // // return CSSMathExpressionOperation::CreateArithmeticOperation(
1097
- // // CSSMathExpressionNumericLiteral::Create(
1098
- // // 1, UnitType.kNumber),
1099
- // // right_side, CSSMathOperator.kDivide);
1100
- // return null;
1101
- // }
1102
-
1103
-
1104
- CSSMathInvert.prototype.buildCSSText = function (nested, paren_less, result) {
1105
- if (paren_less == _types.ParenLess.kNo) {
1106
- result += nested === _types.Nested.kYes ? '(' : 'calc(';
1107
- }
1108
-
1109
- result += '1 / ';
1110
- result = this.value.buildCSSText(_types.Nested.kYes, _types.ParenLess.kNo, result);
1111
-
1112
- if (paren_less === _types.ParenLess.kNo) {
1113
- result += ')';
1114
- }
1115
-
1116
- return result;
1117
- };
1118
-
1119
- return CSSMathInvert;
1120
- }(CSSMathValue);
1121
-
1122
- exports.CSSMathInvert = CSSMathInvert;
1123
-
1124
- var CSSMathNegate =
1125
- /** @class */
1126
- function (_super) {
1127
- (0, _tslib.__extends)(CSSMathNegate, _super);
1128
-
1129
- function CSSMathNegate(value, type) {
1130
- var _this = _super.call(this, type) || this;
1131
-
1132
- _this.value = value;
1133
- _this.operator = 'negate';
1134
- return _this;
1135
- }
1136
-
1137
- CSSMathNegate.create = function (value) {
1138
- return new CSSMathNegate(value, value.type_);
1139
- };
1140
-
1141
- CSSMathNegate.prototype.clone = function () {
1142
- return new CSSMathNegate(this.value, this.type_);
1143
- };
1144
-
1145
- CSSMathNegate.prototype.getType = function () {
1146
- return _CSSStyleValue.CSSStyleValueType.kNegateType;
1147
- };
1148
-
1149
- CSSMathNegate.prototype.equals = function (other) {
1150
- if (other.getType() !== _CSSStyleValue.CSSStyleValueType.kNegateType) {
1151
- return false;
1152
- }
1153
-
1154
- var other_invert = other;
1155
- return this.value.equals(other_invert.value);
1156
- };
1157
-
1158
- CSSMathNegate.prototype.sumValue = function () {
1159
- var sum = this.value.sumValue();
1160
-
1161
- if (sum.length === 0) {
1162
- return null;
1163
- }
1164
-
1165
- sum.forEach(function (term) {
1166
- term.value *= -1;
1167
- });
1168
- return sum;
1169
- }; // toCalcExpressionNode(): CSSMathExpressionNode {
1170
- // const right_side = this.value.toCalcExpressionNode();
1171
- // if (!right_side) {
1172
- // return null;
1173
- // }
1174
- // // return CSSMathExpressionOperation::CreateArithmeticOperationSimplified(
1175
- // // CSSMathExpressionNumericLiteral::Create(
1176
- // // -1, CSSPrimitiveValue::UnitType::kNumber),
1177
- // // right_side, CSSMathOperator::kMultiply);
1178
- // }
1179
-
1180
-
1181
- CSSMathNegate.prototype.buildCSSText = function (nested, paren_less, result) {
1182
- if (paren_less == _types.ParenLess.kNo) {
1183
- result += nested === _types.Nested.kYes ? '(' : 'calc(';
1184
- }
1185
-
1186
- result += '-';
1187
- result = this.value.buildCSSText(_types.Nested.kYes, _types.ParenLess.kNo, result);
1188
-
1189
- if (paren_less === _types.ParenLess.kNo) {
1190
- result += ')';
1191
- }
1192
-
1193
- return result;
1194
- };
1195
-
1196
- return CSSMathNegate;
1197
- }(CSSMathValue);
1198
-
1199
- exports.CSSMathNegate = CSSMathNegate;
1200
-
1201
- function typeCheck(values, op, error) {
1202
- error = false;
1203
- var final_type = values[0].type_;
1204
-
1205
- for (var i = 1; i < values.length; i++) {
1206
- final_type = op(final_type, values[i].type_, error);
1207
- if (error) return final_type;
1208
- }
1209
-
1210
- return final_type;
1211
- } // Represents an arithmetic operation with one or more CSSNumericValues.
1212
-
1213
-
1214
- var CSSMathVariadic =
1215
- /** @class */
1216
- function (_super) {
1217
- (0, _tslib.__extends)(CSSMathVariadic, _super);
1218
-
1219
- function CSSMathVariadic(values, type) {
1220
- var _this = _super.call(this, type) || this;
1221
-
1222
- _this.values = values;
1223
- return _this;
1224
- }
1225
-
1226
- CSSMathVariadic.prototype.numericValues = function () {
1227
- return this.values;
1228
- };
1229
-
1230
- CSSMathVariadic.prototype.equals = function (other) {
1231
- if (this.getType() !== other.getType()) {
1232
- return false;
1233
- }
1234
-
1235
- return this.values.every(function (value, i) {
1236
- return value.equals(other.values[i]);
1237
- });
1238
- };
1239
-
1240
- return CSSMathVariadic;
1241
- }(CSSMathValue);
1242
-
1243
- exports.CSSMathVariadic = CSSMathVariadic;
1244
-
1245
- // Represents the minimum of one or more CSSNumericValues.
1246
- // @see https://drafts.css-houdini.org/css-typed-om/#cssmathsum
1247
- var CSSMathMin =
1248
- /** @class */
1249
- function (_super) {
1250
- (0, _tslib.__extends)(CSSMathMin, _super);
1251
-
1252
- function CSSMathMin() {
1253
- var _this = _super !== null && _super.apply(this, arguments) || this;
1254
-
1255
- _this.operator = 'min';
1256
- return _this;
1257
- }
1258
-
1259
- CSSMathMin.create = function (values) {
1260
- var error = false;
1261
- var final_type = typeCheck(values, CSSNumericValueType.add, error);
1262
- return error ? null : new CSSMathMin(values, final_type);
1263
- };
1264
-
1265
- CSSMathMin.prototype.clone = function () {
1266
- return new CSSMathMin(this.values, this.type_);
1267
- };
1268
-
1269
- CSSMathMin.prototype.getType = function () {
1270
- return _CSSStyleValue.CSSStyleValueType.kMinType;
1271
- };
1272
-
1273
- CSSMathMin.prototype.sumValue = function () {
1274
- var e_4, _a;
1275
-
1276
- var cur_min = this.numericValues()[0].sumValue();
1277
-
1278
- if (!cur_min.length) {
1279
- return null;
1280
- }
1281
-
1282
- try {
1283
- for (var _b = (0, _tslib.__values)(this.numericValues()), _c = _b.next(); !_c.done; _c = _b.next()) {
1284
- var value = _c.value;
1285
- var child_sum = value.sumValue();
1286
-
1287
- if (!child_sum.length || JSON.stringify(child_sum[0].units) !== JSON.stringify(cur_min[0].units)) {
1288
- return null;
1289
- }
1290
-
1291
- if (child_sum[0].value < cur_min[0].value) {
1292
- cur_min = child_sum;
1293
- }
1294
- }
1295
- } catch (e_4_1) {
1296
- e_4 = {
1297
- error: e_4_1
1298
- };
1299
- } finally {
1300
- try {
1301
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1302
- } finally {
1303
- if (e_4) throw e_4.error;
1304
- }
1305
- }
1306
-
1307
- return cur_min;
1308
- }; // toCalcExpressionNode() {
1309
- // const operands: CSSMathExpressionOperation[] = [];
1310
- // for (const value of this.numericValues()) {
1311
- // const operand = value.toCalcExpressionNode();
1312
- // if (!operand) {
1313
- // continue;
1314
- // }
1315
- // operands.push(operand as CSSMathExpressionOperation);
1316
- // }
1317
- // return CSSMathExpressionOperation.createComparisonFunction(operands, CSSMathOperator.kMin);
1318
- // }
1319
-
1320
-
1321
- CSSMathMin.prototype.buildCSSText = function (nested, paren_less, result) {
1322
- var e_5, _a;
1323
-
1324
- result += 'min(';
1325
- var first_iteration = true;
1326
-
1327
- try {
1328
- for (var _b = (0, _tslib.__values)(this.numericValues()), _c = _b.next(); !_c.done; _c = _b.next()) {
1329
- var value = _c.value;
1330
- if (!first_iteration) result += ', ';
1331
- first_iteration = false;
1332
- result = value.buildCSSText(_types.Nested.kYes, _types.ParenLess.kYes, result);
1333
- }
1334
- } catch (e_5_1) {
1335
- e_5 = {
1336
- error: e_5_1
1337
- };
1338
- } finally {
1339
- try {
1340
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1341
- } finally {
1342
- if (e_5) throw e_5.error;
1343
- }
1344
- }
1345
-
1346
- result += ')';
1347
- return result;
1348
- };
1349
-
1350
- return CSSMathMin;
1351
- }(CSSMathVariadic);
1352
-
1353
- exports.CSSMathMin = CSSMathMin;
1354
-
1355
- // Represents the maximum of one or more CSSNumericValues.
1356
- // @see https://drafts.css-houdini.org/css-typed-om/#cssmathsum
1357
- var CSSMathMax =
1358
- /** @class */
1359
- function (_super) {
1360
- (0, _tslib.__extends)(CSSMathMax, _super);
1361
-
1362
- function CSSMathMax() {
1363
- var _this = _super !== null && _super.apply(this, arguments) || this;
1364
-
1365
- _this.operator = 'max';
1366
- return _this;
1367
- }
1368
-
1369
- CSSMathMax.create = function (values) {
1370
- var error = false;
1371
- var final_type = typeCheck(values, CSSNumericValueType.add, error);
1372
- return error ? null : new CSSMathMax(values, final_type);
1373
- };
1374
-
1375
- CSSMathMax.prototype.clone = function () {
1376
- return new CSSMathMax(this.values, this.type_);
1377
- };
1378
-
1379
- CSSMathMax.prototype.getType = function () {
1380
- return _CSSStyleValue.CSSStyleValueType.kMaxType;
1381
- };
1382
-
1383
- CSSMathMax.prototype.sumValue = function () {
1384
- var e_6, _a;
1385
-
1386
- var cur_max = this.numericValues()[0].sumValue();
1387
-
1388
- if (!cur_max.length) {
1389
- return null;
1390
- }
1391
-
1392
- try {
1393
- for (var _b = (0, _tslib.__values)(this.numericValues()), _c = _b.next(); !_c.done; _c = _b.next()) {
1394
- var value = _c.value;
1395
- var child_sum = value.sumValue();
1396
-
1397
- if (!child_sum.length || JSON.stringify(child_sum[0].units) !== JSON.stringify(cur_max[0].units)) {
1398
- return null;
1399
- }
1400
-
1401
- if (child_sum[0].value < cur_max[0].value) {
1402
- cur_max = child_sum;
1403
- }
1404
- }
1405
- } catch (e_6_1) {
1406
- e_6 = {
1407
- error: e_6_1
1408
- };
1409
- } finally {
1410
- try {
1411
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1412
- } finally {
1413
- if (e_6) throw e_6.error;
1414
- }
1415
- }
1416
-
1417
- return cur_max;
1418
- }; // toCalcExpressionNode() {
1419
- // const operands: CSSMathExpressionOperation[] = [];
1420
- // for (const value of this.numericValues()) {
1421
- // const operand = value.toCalcExpressionNode();
1422
- // if (!operand) {
1423
- // continue;
1424
- // }
1425
- // operands.push(operand as CSSMathExpressionOperation);
1426
- // }
1427
- // return CSSMathExpressionOperation.createComparisonFunction(operands, CSSMathOperator.kMax);
1428
- // }
1429
-
1430
-
1431
- CSSMathMax.prototype.buildCSSText = function (nested, paren_less, result) {
1432
- var e_7, _a;
1433
-
1434
- result += 'max(';
1435
- var first_iteration = true;
1436
-
1437
- try {
1438
- for (var _b = (0, _tslib.__values)(this.numericValues()), _c = _b.next(); !_c.done; _c = _b.next()) {
1439
- var value = _c.value;
1440
- if (!first_iteration) result += ', ';
1441
- first_iteration = false;
1442
- result = value.buildCSSText(_types.Nested.kYes, _types.ParenLess.kYes, result);
1443
- }
1444
- } catch (e_7_1) {
1445
- e_7 = {
1446
- error: e_7_1
1447
- };
1448
- } finally {
1449
- try {
1450
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1451
- } finally {
1452
- if (e_7) throw e_7.error;
1453
- }
1454
- }
1455
-
1456
- result += ')';
1457
- return result;
1458
- };
1459
-
1460
- return CSSMathMax;
1461
- }(CSSMathVariadic);
1462
-
1463
- exports.CSSMathMax = CSSMathMax;
1464
-
1465
- /**
1466
- * Represents the sum of one or more CSSNumericValues.
1467
- * @see https://drafts.css-houdini.org/css-typed-om/#cssmathsum
1468
- */
1469
- var CSSMathSum =
1470
- /** @class */
1471
- function (_super) {
1472
- (0, _tslib.__extends)(CSSMathSum, _super);
1473
-
1474
- function CSSMathSum() {
1475
- var _this = _super !== null && _super.apply(this, arguments) || this;
1476
-
1477
- _this.operator = 'sum';
1478
- return _this;
1479
- }
1480
-
1481
- CSSMathSum.create = function (values) {
1482
- var error = false;
1483
- var finalType = typeCheck(values, CSSNumericValueType.add, error);
1484
- return error ? null : new CSSMathSum(values, finalType);
1485
- };
1486
-
1487
- CSSMathSum.numericTypeFromUnitMap = function (units) {
1488
- var type = new CSSNumericValueType();
1489
- Object.keys(units).forEach(function (key) {
1490
- var exp = units[key];
1491
- var error = false;
1492
- type = CSSNumericValueType.multiply(type, new CSSNumericValueType(Number(key), exp), error);
1493
- (0, _assert.DCHECK)(!error);
1494
- });
1495
- return type;
1496
- };
1497
-
1498
- CSSMathSum.canCreateNumericTypeFromSumValue = function (sum) {
1499
- var _this = this;
1500
-
1501
- (0, _assert.DCHECK)(!!sum.length);
1502
- var first_type = this.numericTypeFromUnitMap(sum[0].units);
1503
- return sum.every(function (term) {
1504
- var error = false;
1505
- CSSNumericValueType.add(first_type, _this.numericTypeFromUnitMap(term.units), error);
1506
- return !error;
1507
- });
1508
- };
1509
-
1510
- CSSMathSum.prototype.clone = function () {
1511
- return new CSSMathSum(this.values, this.type_);
1512
- };
1513
-
1514
- CSSMathSum.prototype.getType = function () {
1515
- return _CSSStyleValue.CSSStyleValueType.kSumType;
1516
- }; // toCalcExpressionNode() {
1517
- // return this.toCalcExporessionNodeForVariadic(CSSMathOperator.kAdd);
1518
- // }
1519
-
1520
-
1521
- CSSMathSum.prototype.sumValue = function () {
1522
- var sum = [];
1523
- this.numericValues().forEach(function (value) {
1524
- var child_sum = value.sumValue();
1525
-
1526
- if (!child_sum.length) {
1527
- return null;
1528
- }
1529
-
1530
- child_sum.forEach(function (term) {
1531
- var index = sum.findIndex(function (s) {
1532
- return JSON.stringify(s.units) === JSON.stringify(term.units);
1533
- });
1534
-
1535
- if (index === -1) {
1536
- sum.push((0, _tslib.__assign)({}, term));
1537
- } else {
1538
- sum[index].value += term.value;
1539
- }
1540
- });
1541
- });
1542
- if (!CSSMathSum.canCreateNumericTypeFromSumValue(sum)) return null;
1543
- return sum;
1544
- };
1545
-
1546
- CSSMathSum.prototype.buildCSSText = function (nested, paren_less, result) {
1547
- if (paren_less == _types.ParenLess.kNo) {
1548
- result += nested === _types.Nested.kYes ? '(' : 'calc(';
1549
- }
1550
-
1551
- var values = this.numericValues();
1552
- result = values[0].buildCSSText(_types.Nested.kYes, _types.ParenLess.kNo, result);
1553
-
1554
- for (var i = 1; i < values.length; i++) {
1555
- var arg = values[i];
1556
-
1557
- if (arg.getType() === _CSSStyleValue.CSSStyleValueType.kNegateType) {
1558
- result += ' - ';
1559
- result = arg.value.buildCSSText(_types.Nested.kYes, _types.ParenLess.kNo, result);
1560
- } else {
1561
- result += ' + ';
1562
- result = arg.buildCSSText(_types.Nested.kYes, _types.ParenLess.kNo, result);
1563
- }
1564
- }
1565
-
1566
- if (paren_less === _types.ParenLess.kNo) {
1567
- result += ')';
1568
- }
1569
-
1570
- return result;
1571
- };
1572
-
1573
- return CSSMathSum;
1574
- }(CSSMathVariadic);
1575
-
1576
- exports.CSSMathSum = CSSMathSum;
1577
-
1578
- /**
1579
- * Represents the product of one or more CSSNumericValues.
1580
- * @see https://drafts.css-houdini.org/css-typed-om/#cssmathproduct
1581
- */
1582
- var CSSMathProduct =
1583
- /** @class */
1584
- function (_super) {
1585
- (0, _tslib.__extends)(CSSMathProduct, _super);
1586
-
1587
- function CSSMathProduct() {
1588
- var _this = _super !== null && _super.apply(this, arguments) || this;
1589
-
1590
- _this.operator = 'product';
1591
- return _this;
1592
- }
1593
-
1594
- CSSMathProduct.create = function (values) {
1595
- var error = false;
1596
- var finalType = typeCheck(values, CSSNumericValueType.multiply, error);
1597
- return error ? null : new CSSMathProduct(values, finalType);
1598
- };
1599
-
1600
- CSSMathProduct.multiplyUnitMaps = function (a, b) {
1601
- Object.keys(b).forEach(function (key) {
1602
- (0, _assert.DCHECK_NE)(b[key].value, 0);
1603
- var old_value = key in a ? a[key].value : 0;
1604
-
1605
- if (old_value + b[key].value === 0) {
1606
- delete a[key];
1607
- } else {
1608
- a[key] = old_value + b[key].value;
1609
- }
1610
- });
1611
- return a;
1612
- };
1613
-
1614
- CSSMathProduct.prototype.clone = function () {
1615
- return new CSSMathProduct(this.values, this.type_);
1616
- };
1617
-
1618
- CSSMathProduct.prototype.getType = function () {
1619
- return _CSSStyleValue.CSSStyleValueType.kProductType;
1620
- }; // toCalcExpressionNode() {
1621
- // return this.toCalcExporessionNodeForVariadic(CSSMathOperator.kMultiply);
1622
- // }
1623
-
1624
-
1625
- CSSMathProduct.prototype.sumValue = function () {
1626
- var sum = [{
1627
- value: 1,
1628
- units: {}
1629
- }];
1630
- this.numericValues().forEach(function (value) {
1631
- var child_sum = value.sumValue();
1632
-
1633
- if (!child_sum.length) {
1634
- return null;
1635
- }
1636
-
1637
- var new_sum = [];
1638
- sum.forEach(function (a) {
1639
- child_sum.forEach(function (b) {
1640
- new_sum.push({
1641
- value: a.value * b.value,
1642
- units: CSSMathProduct.multiplyUnitMaps(a.units, b.units)
1643
- });
1644
- });
1645
- });
1646
- sum = new_sum;
1647
- });
1648
- return sum;
1649
- };
1650
-
1651
- CSSMathProduct.prototype.buildCSSText = function (nested, paren_less, result) {
1652
- if (paren_less == _types.ParenLess.kNo) {
1653
- result += nested === _types.Nested.kYes ? '(' : 'calc(';
1654
- }
1655
-
1656
- var values = this.numericValues();
1657
- result = values[0].buildCSSText(_types.Nested.kYes, _types.ParenLess.kNo, result);
1658
-
1659
- for (var i = 1; i < values.length; i++) {
1660
- var arg = values[i];
1661
-
1662
- if (arg.getType() === _CSSStyleValue.CSSStyleValueType.kInvertType) {
1663
- result += ' / ';
1664
- result = arg.value.buildCSSText(_types.Nested.kYes, _types.ParenLess.kNo, result);
1665
- } else {
1666
- result += ' * ';
1667
- result = arg.buildCSSText(_types.Nested.kYes, _types.ParenLess.kNo, result);
1668
- }
1669
- }
1670
-
1671
- if (paren_less === _types.ParenLess.kNo) {
1672
- result += ')';
1673
- }
1674
-
1675
- return result;
1676
- };
1677
-
1678
- return CSSMathProduct;
1679
- }(CSSMathVariadic);
1680
-
1681
- exports.CSSMathProduct = CSSMathProduct;
1682
- var Opx = new CSSUnitValue(0, 'px');
1683
- exports.Opx = Opx;
1684
- var Odeg = new CSSUnitValue(0, 'deg');
1685
- exports.Odeg = Odeg;