laymur 0.17.0 → 0.17.1

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 (395) hide show
  1. package/{src/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.ts → dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts} +2 -3
  2. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +22 -0
  3. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +41 -0
  4. package/dist/core/constraints/UIConstraint.d.ts +12 -0
  5. package/dist/core/constraints/UIConstraint.js +11 -0
  6. package/dist/core/constraints/UICustomConstraint.d.ts +28 -0
  7. package/dist/core/constraints/UICustomConstraint.js +37 -0
  8. package/{src/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.ts → dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts} +2 -3
  9. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +20 -0
  10. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +34 -0
  11. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +11 -0
  12. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +3 -0
  13. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +36 -0
  14. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +100 -0
  15. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +14 -0
  16. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +4 -0
  17. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +44 -0
  18. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +136 -0
  19. package/{src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.ts → dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts} +2 -3
  20. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +22 -0
  21. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +40 -0
  22. package/{src/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.ts → dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts} +8 -9
  23. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +43 -0
  24. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +71 -0
  25. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +11 -0
  26. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +3 -0
  27. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +32 -0
  28. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +100 -0
  29. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +14 -0
  30. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +4 -0
  31. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +44 -0
  32. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +136 -0
  33. package/{src/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.ts → dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts} +2 -3
  34. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +22 -0
  35. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +40 -0
  36. package/{src/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.ts → dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts} +2 -3
  37. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +20 -0
  38. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +34 -0
  39. package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +64 -0
  40. package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +19 -0
  41. package/dist/core/constraints/builders/UIConstraint2DBuilder.d.ts +46 -0
  42. package/dist/core/constraints/builders/UIConstraint2DBuilder.js +138 -0
  43. package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +13 -0
  44. package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +3 -0
  45. package/dist/core/constraints/builders/UICoverConstraintBuilder.d.ts +29 -0
  46. package/dist/core/constraints/builders/UICoverConstraintBuilder.js +63 -0
  47. package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +13 -0
  48. package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +3 -0
  49. package/dist/core/constraints/builders/UIFitConstraintBuilder.d.ts +29 -0
  50. package/dist/core/constraints/builders/UIFitConstraintBuilder.js +63 -0
  51. package/dist/core/elements/UIAnchor/UIAnchor.Internal.d.ts +12 -0
  52. package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +5 -0
  53. package/dist/core/elements/UIAnchor/UIAnchor.d.ts +32 -0
  54. package/dist/core/elements/UIAnchor/UIAnchor.js +49 -0
  55. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +27 -0
  56. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +15 -0
  57. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.d.ts +77 -0
  58. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +259 -0
  59. package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +30 -0
  60. package/dist/core/elements/UIDummy/UIDummy.Internal.js +8 -0
  61. package/dist/core/elements/UIDummy/UIDummy.d.ts +82 -0
  62. package/dist/core/elements/UIDummy/UIDummy.js +173 -0
  63. package/{src/core/elements/UIElement/UIElement.Internal.ts → dist/core/elements/UIElement/UIElement.Internal.d.ts} +5 -7
  64. package/dist/core/elements/UIElement/UIElement.Internal.js +5 -0
  65. package/dist/core/elements/UIElement/UIElement.d.ts +38 -0
  66. package/dist/core/elements/UIElement/UIElement.js +74 -0
  67. package/{src/core/elements/UIGraphics/UIGraphics.Internal.ts → dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts} +5 -7
  68. package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +7 -0
  69. package/dist/core/elements/UIGraphics/UIGraphics.d.ts +51 -0
  70. package/dist/core/elements/UIGraphics/UIGraphics.js +126 -0
  71. package/{src/core/elements/UIImage/UIImage.Internal.ts → dist/core/elements/UIImage/UIImage.Internal.d.ts} +2 -3
  72. package/dist/core/elements/UIImage/UIImage.d.ts +32 -0
  73. package/dist/core/elements/UIImage/UIImage.js +85 -0
  74. package/dist/core/elements/UINineSlice/UINineSlice.Internal.d.ts +23 -0
  75. package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +12 -0
  76. package/dist/core/elements/UINineSlice/UINineSlice.d.ts +60 -0
  77. package/dist/core/elements/UINineSlice/UINineSlice.js +188 -0
  78. package/dist/core/elements/UIProgress/UIProgress.Internal.d.ts +14 -0
  79. package/dist/core/elements/UIProgress/UIProgress.Internal.js +3 -0
  80. package/dist/core/elements/UIProgress/UIProgress.d.ts +45 -0
  81. package/dist/core/elements/UIProgress/UIProgress.js +165 -0
  82. package/dist/core/elements/UIScene/UIScene.Internal.d.ts +43 -0
  83. package/dist/core/elements/UIScene/UIScene.Internal.js +27 -0
  84. package/dist/core/elements/UIScene/UIScene.d.ts +59 -0
  85. package/dist/core/elements/UIScene/UIScene.js +157 -0
  86. package/{src/core/elements/UIText/UIText.Interfaces.ts → dist/core/elements/UIText/UIText.Interfaces.d.ts} +16 -21
  87. package/dist/core/elements/UIText/UIText.Internal.d.ts +26 -0
  88. package/dist/core/elements/UIText/UIText.Internal.js +12 -0
  89. package/dist/core/elements/UIText/UIText.Measuring.d.ts +50 -0
  90. package/dist/core/elements/UIText/UIText.Measuring.js +153 -0
  91. package/dist/core/elements/UIText/UIText.Rendering.d.ts +20 -0
  92. package/dist/core/elements/UIText/UIText.Rendering.js +61 -0
  93. package/dist/core/elements/UIText/UIText.d.ts +71 -0
  94. package/dist/core/elements/UIText/UIText.js +265 -0
  95. package/{src/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.ts → dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts} +11 -14
  96. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +5 -0
  97. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.d.ts +63 -0
  98. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +147 -0
  99. package/{src/core/layers/UILayer/UILayer.Internal.ts → dist/core/layers/UILayer/UILayer.Internal.d.ts} +11 -15
  100. package/dist/core/layers/UILayer/UILayer.Internal.js +7 -0
  101. package/dist/core/layers/UILayer/UILayer.d.ts +49 -0
  102. package/dist/core/layers/UILayer/UILayer.js +113 -0
  103. package/dist/core/miscellaneous/UIExpression.d.ts +69 -0
  104. package/dist/core/miscellaneous/UIExpression.js +128 -0
  105. package/dist/core/miscellaneous/UIMode.d.ts +23 -0
  106. package/dist/core/miscellaneous/UIMode.js +30 -0
  107. package/dist/core/miscellaneous/UIOrientation.d.ts +15 -0
  108. package/dist/core/miscellaneous/UIOrientation.js +20 -0
  109. package/dist/core/miscellaneous/UIPriority.d.ts +32 -0
  110. package/dist/core/miscellaneous/UIPriority.js +63 -0
  111. package/dist/core/miscellaneous/UIRelation.d.ts +23 -0
  112. package/dist/core/miscellaneous/UIRelation.js +40 -0
  113. package/dist/core/miscellaneous/UITransparencyMode.d.ts +9 -0
  114. package/dist/core/miscellaneous/UITransparencyMode.js +12 -0
  115. package/dist/core/miscellaneous/area/UIArea.d.ts +3 -0
  116. package/dist/core/miscellaneous/area/UIArea.js +5 -0
  117. package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +15 -0
  118. package/dist/core/miscellaneous/area/UIAreaCircle.js +32 -0
  119. package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +12 -0
  120. package/dist/core/miscellaneous/area/UIAreaPolygon.js +40 -0
  121. package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +17 -0
  122. package/dist/core/miscellaneous/area/UIAreaRectangle.js +36 -0
  123. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +21 -0
  124. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +72 -0
  125. package/dist/core/miscellaneous/asserts.d.ts +43 -0
  126. package/dist/core/miscellaneous/asserts.js +163 -0
  127. package/dist/core/miscellaneous/canvas.d.ts +31 -0
  128. package/dist/core/miscellaneous/canvas.js +37 -0
  129. package/dist/core/miscellaneous/color/UIColor.Internal.d.ts +7 -0
  130. package/dist/core/miscellaneous/color/UIColor.Internal.js +42 -0
  131. package/dist/core/miscellaneous/color/UIColor.d.ts +234 -0
  132. package/dist/core/miscellaneous/color/UIColor.js +636 -0
  133. package/dist/core/miscellaneous/computeTransform.d.ts +18 -0
  134. package/dist/core/miscellaneous/computeTransform.js +82 -0
  135. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +19 -0
  136. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +168 -0
  137. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.d.ts +1 -0
  138. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +349 -0
  139. package/{src/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.ts → dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts} +8 -10
  140. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.d.ts +1 -0
  141. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +357 -0
  142. package/dist/core/miscellaneous/generic-plane/shared.d.ts +38 -0
  143. package/dist/core/miscellaneous/generic-plane/shared.js +228 -0
  144. package/dist/core/miscellaneous/insets/UIInsets.Internal.d.ts +11 -0
  145. package/dist/core/miscellaneous/insets/UIInsets.Internal.js +3 -0
  146. package/dist/core/miscellaneous/insets/UIInsets.d.ts +48 -0
  147. package/dist/core/miscellaneous/insets/UIInsets.js +224 -0
  148. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.d.ts +9 -0
  149. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +19 -0
  150. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +21 -0
  151. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +51 -0
  152. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +16 -0
  153. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +48 -0
  154. package/dist/core/miscellaneous/math.d.ts +7 -0
  155. package/dist/core/miscellaneous/math.js +11 -0
  156. package/dist/core/miscellaneous/micro/UIMicro.Internal.d.ts +31 -0
  157. package/dist/core/miscellaneous/micro/UIMicro.Internal.js +15 -0
  158. package/dist/core/miscellaneous/micro/UIMicro.d.ts +59 -0
  159. package/dist/core/miscellaneous/micro/UIMicro.js +181 -0
  160. package/dist/core/miscellaneous/resize-policy/UIResizePolicy.d.ts +3 -0
  161. package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +9 -0
  162. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +22 -0
  163. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +50 -0
  164. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +22 -0
  165. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +52 -0
  166. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +22 -0
  167. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +52 -0
  168. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +22 -0
  169. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +50 -0
  170. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +22 -0
  171. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +52 -0
  172. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +22 -0
  173. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +52 -0
  174. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +5 -0
  175. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +13 -0
  176. package/dist/core/miscellaneous/shared.d.ts +46 -0
  177. package/dist/core/miscellaneous/shared.js +37 -0
  178. package/{src/core/miscellaneous/text-span/UITextSpan.Internal.ts → dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts} +4 -5
  179. package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +14 -0
  180. package/dist/core/miscellaneous/text-span/UITextSpan.js +36 -0
  181. package/dist/core/miscellaneous/text-style/UITextStyle.Internal.d.ts +48 -0
  182. package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +17 -0
  183. package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +85 -0
  184. package/dist/core/miscellaneous/text-style/UITextStyle.js +372 -0
  185. package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +49 -0
  186. package/dist/core/miscellaneous/texture/UITextureView.Internal.js +6 -0
  187. package/dist/core/miscellaneous/texture/UITextureView.d.ts +67 -0
  188. package/dist/core/miscellaneous/texture/UITextureView.js +234 -0
  189. package/dist/core/miscellaneous/webglCapabilities.d.ts +2 -0
  190. package/dist/core/miscellaneous/webglCapabilities.js +103 -0
  191. package/dist/core/shaders/UIImage.glsl.js +3 -0
  192. package/dist/core/shaders/UINineSlice.glsl.js +3 -0
  193. package/dist/core/shaders/UIProgress.glsl.js +3 -0
  194. package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +3 -0
  195. package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +3 -0
  196. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +17 -0
  197. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +13 -0
  198. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +108 -0
  199. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +13 -0
  200. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +20 -0
  201. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +75 -0
  202. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +49 -0
  203. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +215 -0
  204. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +505 -0
  205. package/dist/index.js +51 -0
  206. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +21 -0
  207. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +47 -0
  208. package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +14 -0
  209. package/dist/particles/behaviorModules/UIBehaviorModule.js +9 -0
  210. package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +39 -0
  211. package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +110 -0
  212. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +22 -0
  213. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +66 -0
  214. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +20 -0
  215. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +48 -0
  216. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +26 -0
  217. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +66 -0
  218. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +20 -0
  219. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +49 -0
  220. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +26 -0
  221. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +70 -0
  222. package/dist/particles/elements/UIEmitter.Internal.d.ts +15 -0
  223. package/dist/particles/elements/UIEmitter.Internal.js +11 -0
  224. package/dist/particles/elements/UIEmitter.d.ts +68 -0
  225. package/dist/particles/elements/UIEmitter.js +203 -0
  226. package/dist/particles/index.js +18 -0
  227. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +13 -0
  228. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +211 -0
  229. package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +17 -0
  230. package/dist/particles/instancedParticle/UIInstancedParticle.js +93 -0
  231. package/dist/particles/miscellaneous/miscellaneous.d.ts +32 -0
  232. package/dist/particles/miscellaneous/miscellaneous.js +67 -0
  233. package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +14 -0
  234. package/dist/particles/renderingModules/UIRenderingColorOverLife.js +32 -0
  235. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +15 -0
  236. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +37 -0
  237. package/dist/particles/renderingModules/UIRenderingModule.d.ts +8 -0
  238. package/dist/particles/renderingModules/UIRenderingModule.js +9 -0
  239. package/dist/particles/renderingModules/UIRenderingTexture.d.ts +14 -0
  240. package/dist/particles/renderingModules/UIRenderingTexture.js +26 -0
  241. package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +3 -0
  242. package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +3 -0
  243. package/dist/particles/shaders/UIRenderingTexture.glsl.js +3 -0
  244. package/dist/particles/spawnModules/UISpawnModule.d.ts +9 -0
  245. package/dist/particles/spawnModules/UISpawnModule.js +9 -0
  246. package/dist/particles/spawnModules/UISpawnOffset.d.ts +21 -0
  247. package/dist/particles/spawnModules/UISpawnOffset.js +46 -0
  248. package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +20 -0
  249. package/dist/particles/spawnModules/UISpawnRandomLifetime.js +47 -0
  250. package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +20 -0
  251. package/dist/particles/spawnModules/UISpawnRandomRotation.js +45 -0
  252. package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +26 -0
  253. package/dist/particles/spawnModules/UISpawnRandomScale.js +60 -0
  254. package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +20 -0
  255. package/dist/particles/spawnModules/UISpawnRandomTorque.js +45 -0
  256. package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +26 -0
  257. package/dist/particles/spawnModules/UISpawnRandomVelocity.js +64 -0
  258. package/dist/particles/spawnModules/UISpawnRectangle.d.ts +27 -0
  259. package/dist/particles/spawnModules/UISpawnRectangle.js +62 -0
  260. package/package.json +8 -1
  261. package/.claude/settings.local.json +0 -9
  262. package/.editorconfig +0 -14
  263. package/CLAUDE.md +0 -181
  264. package/assets/logotype.png +0 -0
  265. package/eslint.config.js +0 -111
  266. package/rollup.config.js +0 -52
  267. package/src/core/constraints/UIAspectConstraint/UIAspectConstraint.ts +0 -60
  268. package/src/core/constraints/UIConstraint.ts +0 -20
  269. package/src/core/constraints/UICustomConstraint.ts +0 -62
  270. package/src/core/constraints/UIHeightConstraint/UIHeightConstraint.ts +0 -52
  271. package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.ts +0 -13
  272. package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.ts +0 -139
  273. package/src/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.ts +0 -16
  274. package/src/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.ts +0 -189
  275. package/src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.ts +0 -68
  276. package/src/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.ts +0 -94
  277. package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.ts +0 -13
  278. package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.ts +0 -135
  279. package/src/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.ts +0 -16
  280. package/src/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.ts +0 -189
  281. package/src/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.ts +0 -68
  282. package/src/core/constraints/UIWidthConstraint/UIWidthConstraint.ts +0 -52
  283. package/src/core/constraints/builders/UIConstraint2DBuilder.Internal.ts +0 -84
  284. package/src/core/constraints/builders/UIConstraint2DBuilder.ts +0 -168
  285. package/src/core/constraints/builders/UICoverConstraintBuilder.Internal.ts +0 -15
  286. package/src/core/constraints/builders/UICoverConstraintBuilder.ts +0 -84
  287. package/src/core/constraints/builders/UIFitConstraintBuilder.Internal.ts +0 -15
  288. package/src/core/constraints/builders/UIFitConstraintBuilder.ts +0 -84
  289. package/src/core/elements/UIAnchor/UIAnchor.Internal.ts +0 -13
  290. package/src/core/elements/UIAnchor/UIAnchor.ts +0 -70
  291. package/src/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.ts +0 -30
  292. package/src/core/elements/UIAnimatedImage/UIAnimatedImage.ts +0 -355
  293. package/src/core/elements/UIDummy/UIDummy.Internal.ts +0 -33
  294. package/src/core/elements/UIDummy/UIDummy.ts +0 -244
  295. package/src/core/elements/UIElement/UIElement.ts +0 -127
  296. package/src/core/elements/UIGraphics/UIGraphics.ts +0 -168
  297. package/src/core/elements/UIImage/UIImage.ts +0 -138
  298. package/src/core/elements/UINineSlice/UINineSlice.Internal.ts +0 -26
  299. package/src/core/elements/UINineSlice/UINineSlice.ts +0 -296
  300. package/src/core/elements/UIProgress/UIProgress.Internal.ts +0 -24
  301. package/src/core/elements/UIProgress/UIProgress.ts +0 -259
  302. package/src/core/elements/UIScene/UIScene.Internal.ts +0 -46
  303. package/src/core/elements/UIScene/UIScene.ts +0 -259
  304. package/src/core/elements/UIText/UIText.Internal.ts +0 -29
  305. package/src/core/elements/UIText/UIText.Measuring.ts +0 -183
  306. package/src/core/elements/UIText/UIText.Rendering.ts +0 -83
  307. package/src/core/elements/UIText/UIText.ts +0 -376
  308. package/src/core/layers/UIFullscreenLayer/UIFullscreenLayer.ts +0 -233
  309. package/src/core/layers/UILayer/UILayer.ts +0 -156
  310. package/src/core/miscellaneous/UIExpression.ts +0 -142
  311. package/src/core/miscellaneous/UIMode.ts +0 -29
  312. package/src/core/miscellaneous/UIOrientation.ts +0 -18
  313. package/src/core/miscellaneous/UIPriority.ts +0 -63
  314. package/src/core/miscellaneous/UIRelation.ts +0 -39
  315. package/src/core/miscellaneous/UITransparencyMode.ts +0 -9
  316. package/src/core/miscellaneous/area/UIArea.ts +0 -5
  317. package/src/core/miscellaneous/area/UIAreaCircle.ts +0 -32
  318. package/src/core/miscellaneous/area/UIAreaPolygon.ts +0 -50
  319. package/src/core/miscellaneous/area/UIAreaRectangle.ts +0 -38
  320. package/src/core/miscellaneous/area/UIAreaRoundedRectangle.ts +0 -78
  321. package/src/core/miscellaneous/asserts.ts +0 -187
  322. package/src/core/miscellaneous/canvas.ts +0 -73
  323. package/src/core/miscellaneous/color/UIColor.Internal.ts +0 -89
  324. package/src/core/miscellaneous/color/UIColor.ts +0 -844
  325. package/src/core/miscellaneous/computeTransform.ts +0 -127
  326. package/src/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.ts +0 -235
  327. package/src/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.ts +0 -524
  328. package/src/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.ts +0 -448
  329. package/src/core/miscellaneous/generic-plane/shared.ts +0 -323
  330. package/src/core/miscellaneous/insets/UIInsets.Internal.ts +0 -9
  331. package/src/core/miscellaneous/insets/UIInsets.ts +0 -248
  332. package/src/core/miscellaneous/mask-function/UIProgressMaskFunction.ts +0 -24
  333. package/src/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.ts +0 -58
  334. package/src/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.ts +0 -52
  335. package/src/core/miscellaneous/math.ts +0 -16
  336. package/src/core/miscellaneous/micro/UIMicro.Internal.ts +0 -33
  337. package/src/core/miscellaneous/micro/UIMicro.ts +0 -222
  338. package/src/core/miscellaneous/resize-policy/UIResizePolicy.ts +0 -8
  339. package/src/core/miscellaneous/resize-policy/UIResizePolicyCover.ts +0 -57
  340. package/src/core/miscellaneous/resize-policy/UIResizePolicyCross.ts +0 -65
  341. package/src/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.ts +0 -65
  342. package/src/core/miscellaneous/resize-policy/UIResizePolicyFit.ts +0 -57
  343. package/src/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.ts +0 -65
  344. package/src/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.ts +0 -65
  345. package/src/core/miscellaneous/resize-policy/UIResizePolicyNone.ts +0 -11
  346. package/src/core/miscellaneous/shared.ts +0 -73
  347. package/src/core/miscellaneous/text-span/UITextSpan.ts +0 -43
  348. package/src/core/miscellaneous/text-style/UITextStyle.Internal.ts +0 -52
  349. package/src/core/miscellaneous/text-style/UITextStyle.ts +0 -479
  350. package/src/core/miscellaneous/texture/UITextureView.Internal.ts +0 -55
  351. package/src/core/miscellaneous/texture/UITextureView.ts +0 -308
  352. package/src/core/miscellaneous/webglCapabilities.ts +0 -129
  353. package/src/core/shaders/UIImage.glsl +0 -10
  354. package/src/core/shaders/UINineSlice.glsl +0 -53
  355. package/src/core/shaders/UIProgress.glsl +0 -15
  356. package/src/core/shaders/UIProgressMaskFunctionCircular.glsl +0 -13
  357. package/src/core/shaders/UIProgressMaskFunctionDirectional.glsl +0 -12
  358. package/src/core/shaders/glsl.d.ts +0 -27
  359. package/src/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.ts +0 -23
  360. package/src/core/wrappers/UIInputWrapper/UIInputWrapper.ts +0 -124
  361. package/src/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.ts +0 -22
  362. package/src/core/wrappers/UISceneWrapper/UISceneWrapper.ts +0 -101
  363. package/src/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.ts +0 -58
  364. package/src/core/wrappers/UISolverWrapper/UISolverWrapper.ts +0 -605
  365. package/src/particles/behaviorModules/UIBehaviorDirectionalGravity.ts +0 -70
  366. package/src/particles/behaviorModules/UIBehaviorModule.ts +0 -20
  367. package/src/particles/behaviorModules/UIBehaviorPointGravity.ts +0 -173
  368. package/src/particles/behaviorModules/UIBehaviorScaleOverLife.ts +0 -104
  369. package/src/particles/behaviorModules/UIBehaviorTorqueDamping.ts +0 -75
  370. package/src/particles/behaviorModules/UIBehaviorTorqueNoise.ts +0 -115
  371. package/src/particles/behaviorModules/UIBehaviorVelocityDamping.ts +0 -77
  372. package/src/particles/behaviorModules/UIBehaviorVelocityNoise.ts +0 -118
  373. package/src/particles/elements/UIEmitter.Internal.ts +0 -22
  374. package/src/particles/elements/UIEmitter.ts +0 -313
  375. package/src/particles/instancedParticle/UIInstancedParticle.Internal.ts +0 -263
  376. package/src/particles/instancedParticle/UIInstancedParticle.ts +0 -138
  377. package/src/particles/miscellaneous/miscellaneous.ts +0 -115
  378. package/src/particles/renderingModules/UIRenderingColorOverLife.ts +0 -39
  379. package/src/particles/renderingModules/UIRenderingColorOverVelocity.ts +0 -49
  380. package/src/particles/renderingModules/UIRenderingModule.ts +0 -17
  381. package/src/particles/renderingModules/UIRenderingTexture.ts +0 -30
  382. package/src/particles/shaders/UIRenderingColorOverLife.glsl +0 -4
  383. package/src/particles/shaders/UIRenderingColorOverVelocity.glsl +0 -6
  384. package/src/particles/shaders/UIRenderingTexture.glsl +0 -4
  385. package/src/particles/spawnModules/UISpawnModule.ts +0 -22
  386. package/src/particles/spawnModules/UISpawnOffset.ts +0 -62
  387. package/src/particles/spawnModules/UISpawnRandomLifetime.ts +0 -68
  388. package/src/particles/spawnModules/UISpawnRandomRotation.ts +0 -60
  389. package/src/particles/spawnModules/UISpawnRandomScale.ts +0 -81
  390. package/src/particles/spawnModules/UISpawnRandomTorque.ts +0 -62
  391. package/src/particles/spawnModules/UISpawnRandomVelocity.ts +0 -92
  392. package/src/particles/spawnModules/UISpawnRectangle.ts +0 -81
  393. package/tsconfig.json +0 -29
  394. /package/{src/core/index.ts → dist/core/index.d.ts} +0 -0
  395. /package/{src/particles/index.ts → dist/particles/index.d.ts} +0 -0
@@ -1,135 +0,0 @@
1
- import { assertValidConstraintArguments, assertValidNumber } from "../../miscellaneous/asserts";
2
- import type { UIPlaneElement, UIPointElement } from "../../miscellaneous/shared";
3
- import { isUIPlaneElement, isUIPointElement } from "../../miscellaneous/shared";
4
- import { UIExpression } from "../../miscellaneous/UIExpression";
5
- import { UISingleParameterConstraint } from "../UISingleParameterConstraint/UISingleParameterConstraint";
6
- import type { UIVerticalDistanceConstraintOptions } from "./UIVerticalDistanceConstraint.Internal";
7
- import { DEFAULT_ANCHOR } from "./UIVerticalDistanceConstraint.Internal";
8
-
9
- /** Maintains vertical distance between elements with configurable anchors */
10
- export class UIVerticalDistanceConstraint extends UISingleParameterConstraint {
11
- protected override readonly constraint: number;
12
-
13
- private anchorAInternal: number;
14
- private anchorBInternal: number;
15
- private distanceInternal: number;
16
-
17
- /**
18
- * @param a First element
19
- * @param b Second element
20
- * @param options Distance configuration
21
- */
22
- constructor(
23
- private readonly a: UIPointElement | UIPlaneElement,
24
- private readonly b: UIPointElement | UIPlaneElement,
25
- options: Partial<UIVerticalDistanceConstraintOptions> = {},
26
- ) {
27
- if (options.anchorA !== undefined) {
28
- assertValidNumber(
29
- options.anchorA,
30
- "UIVerticalDistanceConstraint.constructor.options.anchorA",
31
- );
32
- }
33
- if (options.anchorB !== undefined) {
34
- assertValidNumber(
35
- options.anchorB,
36
- "UIVerticalDistanceConstraint.constructor.options.anchorB",
37
- );
38
- }
39
- if (options.distance !== undefined) {
40
- assertValidNumber(
41
- options.distance,
42
- "UIVerticalDistanceConstraint.constructor.options.distance",
43
- );
44
- }
45
-
46
- super(
47
- assertValidConstraintArguments(a, b, "UIVerticalDistanceConstraint.constructor"),
48
- options,
49
- );
50
-
51
- this.anchorAInternal = options.anchorA ?? DEFAULT_ANCHOR;
52
- this.anchorBInternal = options.anchorB ?? DEFAULT_ANCHOR;
53
- this.distanceInternal = options.distance ?? 0;
54
-
55
- this.constraint = this.solverWrapper.createConstraint(
56
- this.buildLHS(),
57
- new UIExpression(this.distanceInternal),
58
- this.relation,
59
- this.priority,
60
- this.isConstraintEnabled(),
61
- );
62
- }
63
-
64
- /** Current distance in world units */
65
- public get distance(): number {
66
- return this.distanceInternal;
67
- }
68
-
69
- /** Anchor on element A (0 = bottom, 0.5 = center, 1 = top) */
70
- public get anchorA(): number {
71
- return this.anchorAInternal;
72
- }
73
-
74
- /** Anchor on element B (0 = bottom, 0.5 = center, 1 = top) */
75
- public get anchorB(): number {
76
- return this.anchorBInternal;
77
- }
78
-
79
- /** Updates distance */
80
- public set distance(value: number) {
81
- assertValidNumber(value, "UIVerticalDistanceConstraint.distance");
82
- if (this.distanceInternal !== value) {
83
- this.distanceInternal = value;
84
- this.solverWrapper.setConstraintRHS(this.constraint, new UIExpression(this.distanceInternal));
85
- }
86
- }
87
-
88
- /** Updates anchor on element A */
89
- public set anchorA(value: number) {
90
- assertValidNumber(value, "UIVerticalDistanceConstraint.anchorA");
91
- if (this.anchorAInternal !== value) {
92
- this.anchorAInternal = value;
93
- this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());
94
- }
95
- }
96
-
97
- /** Updates anchor on element B */
98
- public set anchorB(value: number) {
99
- assertValidNumber(value, "UIVerticalDistanceConstraint.anchorB");
100
- if (this.anchorBInternal !== value) {
101
- this.anchorBInternal = value;
102
- this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());
103
- }
104
- }
105
-
106
- /** Builds constraint expression for distance between anchored positions */
107
- private buildLHS(): UIExpression {
108
- let aExpression: UIExpression;
109
- let bExpression: UIExpression;
110
-
111
- if (isUIPlaneElement(this.a)) {
112
- aExpression = new UIExpression(0, [
113
- [this.a.yVariable, 1],
114
- [this.a.hVariable, this.anchorAInternal],
115
- ]);
116
- } else if (isUIPointElement(this.a)) {
117
- aExpression = new UIExpression().plus(this.a.yVariable, 1);
118
- } else {
119
- throw new Error("UIVerticalDistanceConstraint.buildLHS.a: invalid element type");
120
- }
121
-
122
- if (isUIPlaneElement(this.b)) {
123
- bExpression = new UIExpression(0, [
124
- [this.b.yVariable, 1],
125
- [this.b.hVariable, this.anchorBInternal],
126
- ]);
127
- } else if (isUIPointElement(this.b)) {
128
- bExpression = new UIExpression().plus(this.b.yVariable, 1);
129
- } else {
130
- throw new Error("UIVerticalDistanceConstraint.buildLHS.b: invalid element type");
131
- }
132
-
133
- return UIExpression.minus(bExpression, aExpression);
134
- }
135
- }
@@ -1,16 +0,0 @@
1
- import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint/UISingleParameterConstraint.Internal";
2
-
3
- export const DEFAULT_ANCHOR = 0.5;
4
- export const DEFAULT_T = 0.5;
5
-
6
- /** Vertical interpolation constraint options */
7
- export interface UIVerticalInterpolationConstraintOptions extends UISingleParameterConstraintOptions {
8
- /** Anchor on element A (0 = bottom, 0.5 = center, 1 = top) */
9
- anchorA: number;
10
- /** Anchor on element B (0 = bottom, 0.5 = center, 1 = top) */
11
- anchorB: number;
12
- /** Anchor on element C (0 = bottom, 0.5 = center, 1 = top) */
13
- anchorC: number;
14
- /** Interpolation factor (0 = A position, 1 = B position) */
15
- t: number;
16
- }
@@ -1,189 +0,0 @@
1
- import {
2
- assertValidInterpolationConstraintArguments,
3
- assertValidNumber,
4
- } from "../../miscellaneous/asserts";
5
- import type { UIPlaneElement, UIPointElement } from "../../miscellaneous/shared";
6
- import { isUIPlaneElement, isUIPointElement } from "../../miscellaneous/shared";
7
- import { UIExpression } from "../../miscellaneous/UIExpression";
8
- import { UISingleParameterConstraint } from "../UISingleParameterConstraint/UISingleParameterConstraint";
9
- import type { UIVerticalInterpolationConstraintOptions } from "./UIVerticalInterpolationConstraint.Internal";
10
- import { DEFAULT_ANCHOR, DEFAULT_T } from "./UIVerticalInterpolationConstraint.Internal";
11
-
12
- /** Positions element C vertically between A and B based on interpolation factor */
13
- export class UIVerticalInterpolationConstraint extends UISingleParameterConstraint {
14
- /** Solver constraint descriptor */
15
- protected override readonly constraint: number;
16
-
17
- /** Anchor on element A */
18
- private anchorAInternal: number;
19
- /** Anchor on element B */
20
- private anchorBInternal: number;
21
- /** Anchor on element C */
22
- private anchorCInternal: number;
23
- /** Interpolation factor */
24
- private tInternal: number;
25
-
26
- /**
27
- * @param a First element
28
- * @param b Second element
29
- * @param c Element to position between A and B
30
- * @param options Interpolation configuration
31
- */
32
- constructor(
33
- private readonly a: UIPointElement | UIPlaneElement,
34
- private readonly b: UIPointElement | UIPlaneElement,
35
- private readonly c: UIPointElement | UIPlaneElement,
36
- options: Partial<UIVerticalInterpolationConstraintOptions> = {},
37
- ) {
38
- if (options.anchorA !== undefined) {
39
- assertValidNumber(
40
- options.anchorA,
41
- "UIVerticalInterpolationConstraint.constructor.options.anchorA",
42
- );
43
- }
44
- if (options.anchorB !== undefined) {
45
- assertValidNumber(
46
- options.anchorB,
47
- "UIVerticalInterpolationConstraint.constructor.options.anchorB",
48
- );
49
- }
50
- if (options.anchorC !== undefined) {
51
- assertValidNumber(
52
- options.anchorC,
53
- "UIVerticalInterpolationConstraint.constructor.options.anchorC",
54
- );
55
- }
56
- if (options.t !== undefined) {
57
- assertValidNumber(options.t, "UIVerticalInterpolationConstraint.constructor.options.t");
58
- }
59
-
60
- const anchorA = options.anchorA ?? DEFAULT_ANCHOR;
61
- const anchorB = options.anchorB ?? DEFAULT_ANCHOR;
62
-
63
- super(
64
- assertValidInterpolationConstraintArguments(
65
- "UIVerticalInterpolationConstraint.constructor",
66
- a,
67
- b,
68
- c,
69
- anchorA,
70
- anchorB,
71
- ),
72
- options,
73
- );
74
-
75
- this.anchorAInternal = anchorA;
76
- this.anchorBInternal = anchorA;
77
- this.anchorCInternal = options.anchorC ?? DEFAULT_ANCHOR;
78
- this.tInternal = options.t ?? DEFAULT_T;
79
-
80
- this.constraint = this.solverWrapper.createConstraint(
81
- this.buildLHS(),
82
- new UIExpression(0),
83
- this.relation,
84
- this.priority,
85
- this.isConstraintEnabled(),
86
- );
87
- }
88
-
89
- /** Interpolation factor (0 = A position, 1 = B position) */
90
- public get t(): number {
91
- return this.tInternal;
92
- }
93
-
94
- /** Anchor on element A (0 = bottom, 0.5 = center, 1 = top) */
95
- public get anchorA(): number {
96
- return this.anchorAInternal;
97
- }
98
-
99
- /** Anchor on element B (0 = bottom, 0.5 = center, 1 = top) */
100
- public get anchorB(): number {
101
- return this.anchorBInternal;
102
- }
103
-
104
- /** Anchor on element C (0 = bottom, 0.5 = center, 1 = top) */
105
- public get anchorC(): number {
106
- return this.anchorCInternal;
107
- }
108
-
109
- /** Updates interpolation factor */
110
- public set t(value: number) {
111
- assertValidNumber(value, "UIVerticalInterpolationConstraint.t");
112
- if (this.tInternal !== value) {
113
- this.tInternal = value;
114
- this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());
115
- }
116
- }
117
-
118
- /** Updates anchor on element A */
119
- public set anchorA(value: number) {
120
- assertValidNumber(value, "UIVerticalInterpolationConstraint.anchorA");
121
- if (this.anchorAInternal !== value) {
122
- this.anchorAInternal = value;
123
- this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());
124
- }
125
- }
126
-
127
- /** Updates anchor on element B */
128
- public set anchorB(value: number) {
129
- assertValidNumber(value, "UIVerticalInterpolationConstraint.anchorB");
130
- if (this.anchorBInternal !== value) {
131
- this.anchorBInternal = value;
132
- this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());
133
- }
134
- }
135
-
136
- /** Updates anchor on element C */
137
- public set anchorC(value: number) {
138
- assertValidNumber(value, "UIVerticalInterpolationConstraint.anchorC");
139
- if (this.anchorCInternal !== value) {
140
- this.anchorCInternal = value;
141
- this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());
142
- }
143
- }
144
-
145
- /** Builds constraint expression: C - A*(1-t) - B*t = 0 */
146
- private buildLHS(): UIExpression {
147
- let aExpression: UIExpression;
148
- let bExpression: UIExpression;
149
- let cExpression: UIExpression;
150
-
151
- if (isUIPlaneElement(this.a)) {
152
- aExpression = new UIExpression(0, [
153
- [this.a.yVariable, 1],
154
- [this.a.hVariable, this.anchorAInternal],
155
- ]);
156
- } else if (isUIPointElement(this.a)) {
157
- aExpression = new UIExpression().plus(this.a.yVariable, 1);
158
- } else {
159
- throw new Error("UIVerticalInterpolationConstraint.buildLHS.a: invalid element type");
160
- }
161
-
162
- if (isUIPlaneElement(this.b)) {
163
- bExpression = new UIExpression(0, [
164
- [this.b.yVariable, 1],
165
- [this.b.hVariable, this.anchorBInternal],
166
- ]);
167
- } else if (isUIPointElement(this.b)) {
168
- bExpression = new UIExpression().plus(this.b.yVariable, 1);
169
- } else {
170
- throw new Error("UIVerticalInterpolationConstraint.buildLHS.b: invalid element type");
171
- }
172
-
173
- if (isUIPlaneElement(this.c)) {
174
- cExpression = new UIExpression(0, [
175
- [this.c.yVariable, 1],
176
- [this.c.hVariable, this.anchorCInternal],
177
- ]);
178
- } else if (isUIPointElement(this.c)) {
179
- cExpression = new UIExpression().plus(this.c.yVariable, 1);
180
- } else {
181
- throw new Error("UIVerticalInterpolationConstraint.buildLHS.c: invalid element type");
182
- }
183
-
184
- // C - A*(1-t) - B*t = 0
185
- const aScaled = aExpression.clone().multiply(1 - this.tInternal);
186
- const bScaled = bExpression.clone().multiply(this.tInternal);
187
- return UIExpression.minus(UIExpression.minus(cExpression, aScaled), bScaled);
188
- }
189
- }
@@ -1,68 +0,0 @@
1
- import {
2
- assertValidConstraintArguments,
3
- assertValidPositiveNumber,
4
- } from "../../miscellaneous/asserts";
5
- import type { UIPlaneElement } from "../../miscellaneous/shared";
6
- import { UIExpression } from "../../miscellaneous/UIExpression";
7
- import { UISingleParameterConstraint } from "../UISingleParameterConstraint/UISingleParameterConstraint";
8
- import type { UIVerticalProportionConstraintOptions } from "./UIVerticalProportionConstraint.Internal";
9
-
10
- /** Maintains proportional height relationship (A.height * proportion = B.height) */
11
- export class UIVerticalProportionConstraint extends UISingleParameterConstraint {
12
- protected override readonly constraint: number;
13
- private proportionInternal: number;
14
-
15
- /**
16
- * @param a First element
17
- * @param b Second element
18
- * @param options Proportion configuration
19
- */
20
- constructor(
21
- private readonly a: UIPlaneElement,
22
- private readonly b: UIPlaneElement,
23
- options: Partial<UIVerticalProportionConstraintOptions> = {},
24
- ) {
25
- if (options.proportion !== undefined) {
26
- assertValidPositiveNumber(
27
- options.proportion,
28
- "UIVerticalProportionConstraint.constructor.options.proportion",
29
- );
30
- }
31
-
32
- super(
33
- assertValidConstraintArguments(a, b, "UIVerticalProportionConstraint.constructor"),
34
- options,
35
- );
36
-
37
- this.proportionInternal = options.proportion ?? 1;
38
- this.constraint = this.solverWrapper.createConstraint(
39
- new UIExpression(0),
40
- this.buildRHS(),
41
- this.relation,
42
- this.priority,
43
- this.isConstraintEnabled(),
44
- );
45
- }
46
-
47
- /** Current proportion multiplier */
48
- public get proportion(): number {
49
- return this.proportionInternal;
50
- }
51
-
52
- /** Updates proportion multiplier */
53
- public set proportion(value: number) {
54
- assertValidPositiveNumber(value, "UIVerticalProportionConstraint.proportion");
55
- if (this.proportionInternal !== value) {
56
- this.proportionInternal = value;
57
- this.solverWrapper.setConstraintRHS(this.constraint, this.buildRHS());
58
- }
59
- }
60
-
61
- /** Builds constraint expression for proportional relationship */
62
- private buildRHS(): UIExpression {
63
- return UIExpression.minus(
64
- new UIExpression(0, [[this.a.hVariable, this.proportionInternal]]),
65
- new UIExpression(0, [[this.b.hVariable, 1]]),
66
- );
67
- }
68
- }
@@ -1,52 +0,0 @@
1
- import { assertValidPositiveNumber } from "../../miscellaneous/asserts";
2
- import type { UILayerElement, UIPlaneElement } from "../../miscellaneous/shared";
3
- import { UIExpression } from "../../miscellaneous/UIExpression";
4
- import { UISingleParameterConstraint } from "../UISingleParameterConstraint/UISingleParameterConstraint";
5
- import type { UIWidthConstraintOptions } from "./UIWidthConstraint.Internal";
6
-
7
- /** Fixes element width to constant value */
8
- export class UIWidthConstraint extends UISingleParameterConstraint {
9
- /** Solver constraint descriptor */
10
- protected override readonly constraint: number;
11
-
12
- /** Current width value */
13
- private widthInternal: number;
14
-
15
- /**
16
- * @param element Element to constrain
17
- * @param options Width configuration. Defaults to element's current width.
18
- */
19
- constructor(
20
- private readonly element: UIPlaneElement & UILayerElement,
21
- options: Partial<UIWidthConstraintOptions> = {},
22
- ) {
23
- if (options.width !== undefined) {
24
- assertValidPositiveNumber(options.width, "UIWidthConstraint.constructor.options.width");
25
- }
26
-
27
- super(element.layer, options);
28
-
29
- this.widthInternal = options.width ?? element.width;
30
- this.constraint = this.solverWrapper.createConstraint(
31
- new UIExpression(0, [[this.element.wVariable, 1]]),
32
- new UIExpression(this.widthInternal),
33
- this.relation,
34
- this.priority,
35
- this.isConstraintEnabled(),
36
- );
37
- }
38
-
39
- /** Current width in world units */
40
- public get width(): number {
41
- return this.widthInternal;
42
- }
43
-
44
- /** Updates width */
45
- public set width(value: number) {
46
- assertValidPositiveNumber(value, "UIWidthConstraint.width");
47
- if (this.widthInternal !== value) {
48
- this.widthInternal = value;
49
- this.solverWrapper.setConstraintRHS(this.constraint, new UIExpression(value));
50
- }
51
- }
52
- }
@@ -1,84 +0,0 @@
1
- import type { UIOrientation } from "../../miscellaneous/UIOrientation";
2
- import type { UIPriority } from "../../miscellaneous/UIPriority";
3
- import type { UIRelation } from "../../miscellaneous/UIRelation";
4
-
5
- /** Horizontal and vertical values object */
6
- export interface UIType2DObject<T> {
7
- /** Horizontal value */
8
- h?: T;
9
- /** Vertical value */
10
- v?: T;
11
- }
12
-
13
- /** Horizontal and vertical values as object, tuple, or single value */
14
- export type UIType2D<T> = UIType2DObject<T> | [T, T] | T;
15
-
16
- /**
17
- * Normalizes UIType2D input to object form.
18
- * @param value Object, tuple, or single value
19
- * @returns Normalized object with h and v properties
20
- */
21
- export function normalizeUIType2D<T>(value: UIType2D<T> | undefined): UIType2DObject<T> {
22
- if (value === undefined) {
23
- return {};
24
- }
25
- if (Array.isArray(value)) {
26
- return { h: value[0], v: value[1] };
27
- }
28
- if (typeof value === "object" && value !== null && ("h" in value || "v" in value)) {
29
- return value;
30
- }
31
- return { h: value as T, v: value as T };
32
- }
33
-
34
- /** Base 2D constraint options */
35
- export interface UIConstraint2DOptions {
36
- /** Priority for each axis */
37
- priority: UIType2D<UIPriority>;
38
- /** Relation for each axis */
39
- relation: UIType2D<UIRelation>;
40
- /** Orientation for each axis */
41
- orientation: UIType2D<UIOrientation>;
42
- }
43
-
44
- /** 2D size constraint options */
45
- export interface UIConstraintSize2DOptions extends UIConstraint2DOptions {
46
- /** Width and height */
47
- size: UIType2D<number>;
48
- }
49
-
50
- /** 2D distance constraint options */
51
- export interface UIConstraintDistance2DOptions extends UIConstraint2DOptions {
52
- /** Anchor on element A for each axis */
53
- anchorA: UIType2D<number>;
54
- /** Anchor on element B for each axis */
55
- anchorB: UIType2D<number>;
56
- /** Distance for each axis */
57
- distance: UIType2D<number>;
58
- }
59
-
60
- /** 2D proportion constraint options */
61
- export interface UIConstraintProportion2DOptions extends UIConstraint2DOptions {
62
- /** Proportion for each axis */
63
- proportion: UIType2D<number>;
64
- }
65
-
66
- /** 2D interpolation constraint options */
67
- export interface UIConstraintInterpolation2DOptions extends UIConstraint2DOptions {
68
- /** Anchor on element A for each axis */
69
- anchorA: UIType2D<number>;
70
- /** Anchor on element B for each axis */
71
- anchorB: UIType2D<number>;
72
- /** Anchor on element C for each axis */
73
- anchorC: UIType2D<number>;
74
- /** Interpolation factor for each axis */
75
- t: UIType2D<number>;
76
- }
77
-
78
- /** Horizontal and vertical constraint pair */
79
- export interface UIConstraint2DResult<TH, TV> {
80
- /** Horizontal constraint */
81
- h: TH;
82
- /** Vertical constraint */
83
- v: TV;
84
- }