laymur 0.23.0 → 0.25.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 (316) hide show
  1. package/README.md +1 -1
  2. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts +1 -1
  3. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.js +1 -0
  4. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +3 -3
  5. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +14 -16
  6. package/dist/core/constraints/UIConstraint.d.ts +22 -2
  7. package/dist/core/constraints/UIConstraint.js +26 -3
  8. package/dist/core/constraints/UICustomConstraint.d.ts +4 -4
  9. package/dist/core/constraints/UICustomConstraint.js +15 -15
  10. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts +1 -1
  11. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.js +1 -0
  12. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +3 -3
  13. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +11 -13
  14. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +1 -1
  15. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +1 -3
  16. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +3 -3
  17. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +30 -30
  18. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +1 -1
  19. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +2 -4
  20. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +3 -3
  21. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +40 -39
  22. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts +1 -1
  23. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.js +1 -0
  24. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +3 -3
  25. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +13 -15
  26. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts +3 -3
  27. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.js +1 -0
  28. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +13 -7
  29. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +37 -30
  30. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +1 -1
  31. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +1 -3
  32. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +3 -3
  33. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +30 -30
  34. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +1 -1
  35. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +2 -4
  36. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +3 -3
  37. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +40 -39
  38. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts +1 -1
  39. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.js +1 -0
  40. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +3 -3
  41. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +13 -15
  42. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts +1 -1
  43. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.js +1 -0
  44. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +3 -3
  45. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +11 -13
  46. package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +3 -3
  47. package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +1 -3
  48. package/dist/core/constraints/builders/UIConstraint2DBuilder.d.ts +11 -11
  49. package/dist/core/constraints/builders/UIConstraint2DBuilder.js +10 -13
  50. package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +1 -1
  51. package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +1 -3
  52. package/dist/core/constraints/builders/UICoverConstraintBuilder.d.ts +7 -7
  53. package/dist/core/constraints/builders/UICoverConstraintBuilder.js +10 -13
  54. package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +1 -1
  55. package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +1 -3
  56. package/dist/core/constraints/builders/UIFitConstraintBuilder.d.ts +7 -7
  57. package/dist/core/constraints/builders/UIFitConstraintBuilder.js +10 -13
  58. package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +3 -5
  59. package/dist/core/elements/UIAnchor/UIAnchor.d.ts +23 -5
  60. package/dist/core/elements/UIAnchor/UIAnchor.js +42 -8
  61. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +2 -2
  62. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +4 -6
  63. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.d.ts +10 -10
  64. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +108 -111
  65. package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +4 -4
  66. package/dist/core/elements/UIDummy/UIDummy.Internal.js +5 -8
  67. package/dist/core/elements/UIDummy/UIDummy.d.ts +19 -11
  68. package/dist/core/elements/UIDummy/UIDummy.js +59 -42
  69. package/dist/core/elements/UIElement/UIElement.Internal.d.ts +5 -5
  70. package/dist/core/elements/UIElement/UIElement.Internal.js +9 -12
  71. package/dist/core/elements/UIElement/UIElement.d.ts +11 -11
  72. package/dist/core/elements/UIElement/UIElement.js +57 -60
  73. package/dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts +3 -3
  74. package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +4 -7
  75. package/dist/core/elements/UIGraphics/UIGraphics.d.ts +7 -7
  76. package/dist/core/elements/UIGraphics/UIGraphics.js +44 -47
  77. package/dist/core/elements/UIImage/UIImage.Internal.d.ts +2 -2
  78. package/dist/core/elements/UIImage/UIImage.Internal.js +1 -0
  79. package/dist/core/elements/UIImage/UIImage.d.ts +9 -9
  80. package/dist/core/elements/UIImage/UIImage.js +21 -24
  81. package/dist/core/elements/UINineSlice/UINineSlice.Internal.d.ts +3 -3
  82. package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +3 -5
  83. package/dist/core/elements/UINineSlice/UINineSlice.d.ts +12 -12
  84. package/dist/core/elements/UINineSlice/UINineSlice.js +71 -73
  85. package/dist/core/elements/UIProgress/UIProgress.Internal.d.ts +3 -4
  86. package/dist/core/elements/UIProgress/UIProgress.Internal.js +1 -3
  87. package/dist/core/elements/UIProgress/UIProgress.d.ts +10 -10
  88. package/dist/core/elements/UIProgress/UIProgress.js +59 -62
  89. package/dist/core/elements/UIScene/UIScene.Internal.d.ts +3 -3
  90. package/dist/core/elements/UIScene/UIScene.Internal.js +11 -14
  91. package/dist/core/elements/UIScene/UIScene.d.ts +8 -8
  92. package/dist/core/elements/UIScene/UIScene.js +68 -69
  93. package/dist/core/elements/UIText/UIText.Bidi.d.ts +2 -2
  94. package/dist/core/elements/UIText/UIText.Bidi.js +3 -5
  95. package/dist/core/elements/UIText/UIText.Interfaces.d.ts +6 -2
  96. package/dist/core/elements/UIText/UIText.Interfaces.js +1 -0
  97. package/dist/core/elements/UIText/UIText.Internal.d.ts +4 -4
  98. package/dist/core/elements/UIText/UIText.Internal.js +5 -7
  99. package/dist/core/elements/UIText/UIText.Measuring.d.ts +14 -7
  100. package/dist/core/elements/UIText/UIText.Measuring.js +115 -55
  101. package/dist/core/elements/UIText/UIText.Rendering.d.ts +3 -3
  102. package/dist/core/elements/UIText/UIText.Rendering.js +6 -9
  103. package/dist/core/elements/UIText/UIText.d.ts +28 -14
  104. package/dist/core/elements/UIText/UIText.js +181 -141
  105. package/dist/core/index.d.ts +55 -54
  106. package/dist/core/index.js +53 -0
  107. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts +4 -4
  108. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +2 -5
  109. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.d.ts +4 -4
  110. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +43 -42
  111. package/dist/core/layers/UILayer/UILayer.Internal.d.ts +2 -2
  112. package/dist/core/layers/UILayer/UILayer.Internal.js +4 -7
  113. package/dist/core/layers/UILayer/UILayer.d.ts +19 -4
  114. package/dist/core/layers/UILayer/UILayer.js +125 -62
  115. package/dist/core/miscellaneous/UIBlendMode.js +1 -3
  116. package/dist/core/miscellaneous/UIExpression.js +16 -19
  117. package/dist/core/miscellaneous/UIMode.js +3 -5
  118. package/dist/core/miscellaneous/UIOrientation.js +2 -4
  119. package/dist/core/miscellaneous/UIPriority.js +5 -8
  120. package/dist/core/miscellaneous/UIRelation.js +5 -8
  121. package/dist/core/miscellaneous/UITransparencyMode.js +1 -3
  122. package/dist/core/miscellaneous/area/UIArea.js +1 -3
  123. package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +1 -1
  124. package/dist/core/miscellaneous/area/UIAreaCircle.js +3 -6
  125. package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +2 -2
  126. package/dist/core/miscellaneous/area/UIAreaPolygon.js +3 -6
  127. package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +1 -1
  128. package/dist/core/miscellaneous/area/UIAreaRectangle.js +3 -6
  129. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +1 -1
  130. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +3 -6
  131. package/dist/core/miscellaneous/asserts.d.ts +30 -1
  132. package/dist/core/miscellaneous/asserts.js +87 -19
  133. package/dist/core/miscellaneous/canvas.js +13 -7
  134. package/dist/core/miscellaneous/color/UIColor.Internal.d.ts +1 -1
  135. package/dist/core/miscellaneous/color/UIColor.Internal.js +1 -3
  136. package/dist/core/miscellaneous/color/UIColor.d.ts +1 -1
  137. package/dist/core/miscellaneous/color/UIColor.js +202 -205
  138. package/dist/core/miscellaneous/computeTransform.d.ts +1 -1
  139. package/dist/core/miscellaneous/computeTransform.js +4 -7
  140. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +10 -5
  141. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +63 -58
  142. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Layout.d.ts +52 -0
  143. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Layout.js +110 -0
  144. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +181 -261
  145. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts +3 -3
  146. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.js +1 -0
  147. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +209 -115
  148. package/dist/core/miscellaneous/generic-plane/shared.d.ts +12 -12
  149. package/dist/core/miscellaneous/generic-plane/shared.js +28 -23
  150. package/dist/core/miscellaneous/insets/UIInsets.Internal.js +1 -3
  151. package/dist/core/miscellaneous/insets/UIInsets.d.ts +1 -1
  152. package/dist/core/miscellaneous/insets/UIInsets.js +96 -99
  153. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +1 -3
  154. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +1 -1
  155. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +14 -17
  156. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +2 -2
  157. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +13 -16
  158. package/dist/core/miscellaneous/math.js +3 -5
  159. package/dist/core/miscellaneous/micro/UIMicro.Internal.js +6 -8
  160. package/dist/core/miscellaneous/micro/UIMicro.d.ts +1 -1
  161. package/dist/core/miscellaneous/micro/UIMicro.js +91 -94
  162. package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +1 -3
  163. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +1 -1
  164. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +12 -15
  165. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +1 -1
  166. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +13 -16
  167. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +1 -1
  168. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +13 -16
  169. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +1 -1
  170. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +12 -15
  171. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +1 -1
  172. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +13 -16
  173. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +1 -1
  174. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +13 -16
  175. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +1 -1
  176. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +3 -6
  177. package/dist/core/miscellaneous/shared.d.ts +1 -1
  178. package/dist/core/miscellaneous/shared.js +4 -7
  179. package/dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts +1 -1
  180. package/dist/core/miscellaneous/text-span/UITextSpan.Internal.js +1 -0
  181. package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +2 -2
  182. package/dist/core/miscellaneous/text-span/UITextSpan.js +10 -13
  183. package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +15 -17
  184. package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +13 -2
  185. package/dist/core/miscellaneous/text-style/UITextStyle.js +222 -207
  186. package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +7 -0
  187. package/dist/core/miscellaneous/texture/UITextureView.Internal.js +16 -6
  188. package/dist/core/miscellaneous/texture/UITextureView.d.ts +1 -1
  189. package/dist/core/miscellaneous/texture/UITextureView.js +113 -117
  190. package/dist/core/miscellaneous/webglCapabilities.js +3 -4
  191. package/dist/core/shaders/UIImage.d.ts +9 -0
  192. package/dist/core/shaders/UIImage.js +14 -0
  193. package/dist/core/shaders/UINineSlice.d.ts +11 -0
  194. package/dist/core/shaders/UINineSlice.js +57 -0
  195. package/dist/core/shaders/UIProgress.d.ts +14 -0
  196. package/dist/core/shaders/UIProgress.js +21 -0
  197. package/dist/core/shaders/UIProgressMaskFunctionCircular.d.ts +2 -0
  198. package/dist/core/shaders/UIProgressMaskFunctionCircular.js +16 -0
  199. package/dist/core/shaders/UIProgressMaskFunctionDirectional.d.ts +2 -0
  200. package/dist/core/shaders/UIProgressMaskFunctionDirectional.js +15 -0
  201. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +4 -0
  202. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.js +1 -0
  203. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +7 -1
  204. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +50 -47
  205. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +5 -2
  206. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.js +1 -0
  207. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +11 -3
  208. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +42 -26
  209. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +5 -3
  210. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.js +1 -0
  211. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +20 -4
  212. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +138 -117
  213. package/dist/debug/UIAspectDebug.d.ts +3 -3
  214. package/dist/debug/UIAspectDebug.js +64 -68
  215. package/dist/debug/UIConstraintDebug.d.ts +1 -1
  216. package/dist/debug/UIConstraintDebug.js +1 -0
  217. package/dist/debug/UIHeightDebug.d.ts +3 -3
  218. package/dist/debug/UIHeightDebug.js +63 -67
  219. package/dist/debug/UIHorizontalDistanceDebug.d.ts +3 -3
  220. package/dist/debug/UIHorizontalDistanceDebug.js +76 -81
  221. package/dist/debug/UIHorizontalInterpolationDebug.d.ts +3 -3
  222. package/dist/debug/UIHorizontalInterpolationDebug.js +74 -78
  223. package/dist/debug/UILayerDebug.d.ts +1 -1
  224. package/dist/debug/UILayerDebug.js +55 -64
  225. package/dist/debug/UIVerticalDistanceDebug.d.ts +3 -3
  226. package/dist/debug/UIVerticalDistanceDebug.js +76 -81
  227. package/dist/debug/UIVerticalInterpolationDebug.d.ts +3 -3
  228. package/dist/debug/UIVerticalInterpolationDebug.js +74 -78
  229. package/dist/debug/UIWidthDebug.d.ts +3 -3
  230. package/dist/debug/UIWidthDebug.js +63 -67
  231. package/dist/debug/index.d.ts +8 -8
  232. package/dist/debug/index.js +8 -8
  233. package/dist/debug/miscellaneous.js +8 -11
  234. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +3 -3
  235. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +13 -16
  236. package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +1 -1
  237. package/dist/particles/behaviorModules/UIBehaviorModule.js +1 -3
  238. package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +3 -3
  239. package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +37 -40
  240. package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.d.ts +41 -0
  241. package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.js +87 -0
  242. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +2 -2
  243. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +17 -20
  244. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +2 -2
  245. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +13 -16
  246. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +2 -2
  247. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +21 -24
  248. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +2 -2
  249. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +13 -16
  250. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +2 -2
  251. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +21 -24
  252. package/dist/particles/elements/UIEmitter.Internal.d.ts +2 -2
  253. package/dist/particles/elements/UIEmitter.Internal.js +6 -9
  254. package/dist/particles/elements/UIEmitter.d.ts +17 -11
  255. package/dist/particles/elements/UIEmitter.js +100 -88
  256. package/dist/particles/index.d.ts +20 -18
  257. package/dist/particles/index.js +19 -18
  258. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +1 -1
  259. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +14 -15
  260. package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +4 -1
  261. package/dist/particles/instancedParticle/UIInstancedParticle.js +40 -32
  262. package/dist/particles/miscellaneous/miscellaneous.d.ts +3 -3
  263. package/dist/particles/miscellaneous/miscellaneous.js +26 -27
  264. package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +2 -2
  265. package/dist/particles/renderingModules/UIRenderingColorOverLife.js +5 -8
  266. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +2 -2
  267. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +6 -9
  268. package/dist/particles/renderingModules/UIRenderingModule.js +1 -3
  269. package/dist/particles/renderingModules/UIRenderingTexture.d.ts +2 -2
  270. package/dist/particles/renderingModules/UIRenderingTexture.js +4 -7
  271. package/dist/particles/shaders/UIRenderingColorOverLife.d.ts +2 -0
  272. package/dist/particles/shaders/UIRenderingColorOverLife.js +7 -0
  273. package/dist/particles/shaders/UIRenderingColorOverVelocity.d.ts +9 -0
  274. package/dist/particles/shaders/UIRenderingColorOverVelocity.js +16 -0
  275. package/dist/particles/shaders/UIRenderingTexture.d.ts +2 -0
  276. package/dist/particles/shaders/UIRenderingTexture.js +7 -0
  277. package/dist/particles/spawnModules/UISpawnModule.d.ts +1 -1
  278. package/dist/particles/spawnModules/UISpawnModule.js +1 -3
  279. package/dist/particles/spawnModules/UISpawnOffset.d.ts +3 -3
  280. package/dist/particles/spawnModules/UISpawnOffset.js +12 -15
  281. package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +2 -2
  282. package/dist/particles/spawnModules/UISpawnRandomLifetime.js +13 -16
  283. package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +2 -2
  284. package/dist/particles/spawnModules/UISpawnRandomRotation.js +13 -16
  285. package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +2 -2
  286. package/dist/particles/spawnModules/UISpawnRandomScale.js +19 -22
  287. package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +2 -2
  288. package/dist/particles/spawnModules/UISpawnRandomTorque.js +13 -16
  289. package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +2 -2
  290. package/dist/particles/spawnModules/UISpawnRandomVelocity.js +21 -24
  291. package/dist/particles/spawnModules/UISpawnRectangle.d.ts +3 -3
  292. package/dist/particles/spawnModules/UISpawnRectangle.js +21 -24
  293. package/package.json +13 -17
  294. package/dist/_virtual/2d.js +0 -3
  295. package/dist/_virtual/3d.js +0 -3
  296. package/dist/_virtual/4d.js +0 -3
  297. package/dist/_virtual/mod.js +0 -5
  298. package/dist/_virtual/mod2.js +0 -3
  299. package/dist/core/shaders/UIImage.glsl.js +0 -3
  300. package/dist/core/shaders/UINineSlice.glsl.js +0 -3
  301. package/dist/core/shaders/UIProgress.glsl.js +0 -3
  302. package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +0 -3
  303. package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +0 -3
  304. package/dist/index.js +0 -52
  305. package/dist/node_modules/fast-simplex-noise/lib/2d.js +0 -93
  306. package/dist/node_modules/fast-simplex-noise/lib/3d.js +0 -142
  307. package/dist/node_modules/fast-simplex-noise/lib/4d.js +0 -196
  308. package/dist/node_modules/fast-simplex-noise/lib/mod.js +0 -24
  309. package/dist/node_modules/three/examples/jsm/lines/Line2.js +0 -56
  310. package/dist/node_modules/three/examples/jsm/lines/LineGeometry.js +0 -157
  311. package/dist/node_modules/three/examples/jsm/lines/LineMaterial.js +0 -691
  312. package/dist/node_modules/three/examples/jsm/lines/LineSegments2.js +0 -415
  313. package/dist/node_modules/three/examples/jsm/lines/LineSegmentsGeometry.js +0 -289
  314. package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +0 -3
  315. package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +0 -3
  316. package/dist/particles/shaders/UIRenderingTexture.glsl.js +0 -3
@@ -1,27 +1,28 @@
1
- import { Ferrsign2, Ferrsign3 } from 'ferrsign';
2
- import { assertValidPositiveNumber } from '../../miscellaneous/asserts.js';
3
- import { isUIModeVisible } from '../../miscellaneous/UIMode.js';
4
- import { UIOrientation } from '../../miscellaneous/UIOrientation.js';
5
- import { UIPriority } from '../../miscellaneous/UIPriority.js';
6
- import { UIInputWrapper } from '../../wrappers/UIInputWrapper/UIInputWrapper.js';
7
- import { UISceneWrapper } from '../../wrappers/UISceneWrapper/UISceneWrapper.js';
8
- import { UISolverWrapper } from '../../wrappers/UISolverWrapper/UISolverWrapper.js';
9
- import { LAYER_DEFAULT_SIZE, LAYER_DEFAULT_NAME, LAYER_DEFAULT_MODE } from './UILayer.Internal.js';
10
-
1
+ import { Ferrsign2, Ferrsign3 } from "ferrsign";
2
+ import { assertValidPositiveNumber } from "../../miscellaneous/asserts.js";
3
+ import { isUIModeVisible } from "../../miscellaneous/UIMode.js";
4
+ import { UIOrientation } from "../../miscellaneous/UIOrientation.js";
5
+ import { UIPriority } from "../../miscellaneous/UIPriority.js";
6
+ import { UIInputWrapper } from "../../wrappers/UIInputWrapper/UIInputWrapper.js";
7
+ import { UISceneWrapper } from "../../wrappers/UISceneWrapper/UISceneWrapper.js";
8
+ import { UISolverWrapper } from "../../wrappers/UISolverWrapper/UISolverWrapper.js";
9
+ import { LAYER_DEFAULT_MODE, LAYER_DEFAULT_NAME, LAYER_DEFAULT_SIZE } from "./UILayer.Internal.js";
11
10
  /** Base layer for UI rendering and layout management */
12
- class UILayer {
11
+ export class UILayer {
13
12
  constructor(options) {
14
13
  /** Optional layer name */
15
14
  this.name = "";
16
15
  this.inputWrapperInternal = new UIInputWrapper();
17
- this._private_solverWrapperInternal = new UISolverWrapper();
18
- this._private_signalOrientationChangedInternal = new Ferrsign2();
19
- this._private_signalModeChangedInternal = new Ferrsign2();
20
- this._private_signalRenderingInternal = new Ferrsign3();
21
- this._private_signalResizedInternal = new Ferrsign3();
22
- this._private_signalConstraintAddedInternal = new Ferrsign2();
23
- this._private_signalConstraintRemovedInternal = new Ferrsign2();
24
- this._private_constraintRegistryInternal = [];
16
+ this.solverWrapperInternal = new UISolverWrapper();
17
+ this.signalOrientationChangedInternal = new Ferrsign2();
18
+ this.signalModeChangedInternal = new Ferrsign2();
19
+ this.signalRenderingInternal = new Ferrsign3();
20
+ this.signalResizedInternal = new Ferrsign3();
21
+ this.signalConstraintAddedInternal = new Ferrsign2();
22
+ this.signalConstraintRemovedInternal = new Ferrsign2();
23
+ this.constraintRegistryInternal = [];
24
+ this.elementRegistryInternal = [];
25
+ this.destroyedInternal = false;
25
26
  if (options.width !== undefined) {
26
27
  assertValidPositiveNumber(options.width, "UILayer.constructor.options.width");
27
28
  }
@@ -30,22 +31,22 @@ class UILayer {
30
31
  }
31
32
  const width = options.width ?? LAYER_DEFAULT_SIZE;
32
33
  const height = options.height ?? LAYER_DEFAULT_SIZE;
33
- this._private_sceneWrapperInternal = new UISceneWrapper(width, height);
34
+ this.sceneWrapperInternal = new UISceneWrapper(width, height);
34
35
  this.name = options.name ?? LAYER_DEFAULT_NAME;
35
- this._private_modeInternal = options.mode ?? LAYER_DEFAULT_MODE;
36
- this._private_orientationInternal = width > height ? UIOrientation.HORIZONTAL : UIOrientation.VERTICAL;
37
- this.xVariable = this._private_solverWrapperInternal.createVariable(0, UIPriority.P0);
38
- this.yVariable = this._private_solverWrapperInternal.createVariable(0, UIPriority.P0);
39
- this.wVariable = this._private_solverWrapperInternal.createVariable(width, UIPriority.P0);
40
- this.hVariable = this._private_solverWrapperInternal.createVariable(height, UIPriority.P0);
36
+ this.modeInternal = options.mode ?? LAYER_DEFAULT_MODE;
37
+ this.orientationInternal = width > height ? UIOrientation.HORIZONTAL : UIOrientation.VERTICAL;
38
+ this.xVariable = this.solverWrapperInternal.createVariable(0, UIPriority.P0);
39
+ this.yVariable = this.solverWrapperInternal.createVariable(0, UIPriority.P0);
40
+ this.wVariable = this.solverWrapperInternal.createVariable(width, UIPriority.P0);
41
+ this.hVariable = this.solverWrapperInternal.createVariable(height, UIPriority.P0);
41
42
  }
42
43
  /** @internal */
43
44
  get sceneWrapper() {
44
- return this._private_sceneWrapperInternal;
45
+ return this.sceneWrapperInternal;
45
46
  }
46
47
  /** @internal */
47
48
  get solverWrapper() {
48
- return this._private_solverWrapperInternal;
49
+ return this.solverWrapperInternal;
49
50
  }
50
51
  /** @internal */
51
52
  get inputWrapper() {
@@ -53,19 +54,19 @@ class UILayer {
53
54
  }
54
55
  /** X coordinate in world units (always 0 for layers) */
55
56
  get x() {
56
- return this._private_solverWrapperInternal.readVariableValue(this.xVariable);
57
+ return this.solverWrapperInternal.readVariableValue(this.xVariable);
57
58
  }
58
59
  /** Y coordinate in world units (always 0 for layers) */
59
60
  get y() {
60
- return this._private_solverWrapperInternal.readVariableValue(this.yVariable);
61
+ return this.solverWrapperInternal.readVariableValue(this.yVariable);
61
62
  }
62
63
  /** Layer width in world units */
63
64
  get width() {
64
- return this._private_solverWrapperInternal.readVariableValue(this.wVariable);
65
+ return this.solverWrapperInternal.readVariableValue(this.wVariable);
65
66
  }
66
67
  /** Layer height in world units */
67
68
  get height() {
68
- return this._private_solverWrapperInternal.readVariableValue(this.hVariable);
69
+ return this.solverWrapperInternal.readVariableValue(this.hVariable);
69
70
  }
70
71
  /** X coordinate of right edge */
71
72
  get oppositeX() {
@@ -85,83 +86,145 @@ class UILayer {
85
86
  }
86
87
  /** Current visibility and interactivity mode */
87
88
  get mode() {
88
- return this._private_modeInternal;
89
+ return this.modeInternal;
89
90
  }
90
91
  /** Current orientation based on aspect ratio */
91
92
  get orientation() {
92
- return this._private_orientationInternal;
93
+ return this.orientationInternal;
93
94
  }
94
95
  /** Signal fired when orientation changes */
95
96
  get signalOrientationChanged() {
96
- return this._private_signalOrientationChangedInternal;
97
+ return this.signalOrientationChangedInternal;
97
98
  }
98
99
  /** Signal fired when mode changes */
99
100
  get signalModeChanged() {
100
- return this._private_signalModeChangedInternal;
101
+ return this.signalModeChangedInternal;
101
102
  }
102
103
  /** Signal fired during rendering */
103
104
  get signalRendering() {
104
- return this._private_signalRenderingInternal;
105
+ return this.signalRenderingInternal;
105
106
  }
106
107
  /** Signal fired when layer resized */
107
108
  get signalResized() {
108
- return this._private_signalResizedInternal;
109
+ return this.signalResizedInternal;
109
110
  }
110
111
  /** Signal fired when a constraint is added */
111
112
  get signalConstraintAdded() {
112
- return this._private_signalConstraintAddedInternal;
113
+ return this.signalConstraintAddedInternal;
113
114
  }
114
115
  /** Signal fired when a constraint is removed */
115
116
  get signalConstraintRemoved() {
116
- return this._private_signalConstraintRemovedInternal;
117
+ return this.signalConstraintRemovedInternal;
117
118
  }
118
119
  /** Constraint registry */
119
120
  get constraintRegistry() {
120
- return this._private_constraintRegistryInternal;
121
+ return this.constraintRegistryInternal;
122
+ }
123
+ /** Elements created on the layer and not destroyed yet */
124
+ get elementRegistry() {
125
+ return this.elementRegistryInternal;
126
+ }
127
+ /** Whether the layer is destroyed */
128
+ get destroyed() {
129
+ return this.destroyedInternal;
121
130
  }
122
131
  /** Updates visibility and interactivity mode */
123
132
  set mode(value) {
124
- if (value !== this._private_modeInternal) {
125
- this._private_modeInternal = value;
126
- this._private_signalModeChangedInternal.emit(this._private_modeInternal, this);
133
+ if (value !== this.modeInternal) {
134
+ this.modeInternal = value;
135
+ this.signalModeChangedInternal.emit(this.modeInternal, this);
136
+ }
137
+ }
138
+ /**
139
+ * Destroys all elements and constraints of the layer, those snapped to the layer itself
140
+ * included, and frees the GPU resources of the layer. Textures are left to their owners.
141
+ * Does nothing if the layer is already destroyed.
142
+ */
143
+ destroy() {
144
+ if (this.destroyedInternal) {
145
+ return;
146
+ }
147
+ this.destroyedInternal = true;
148
+ for (const element of [...this.elementRegistryInternal]) {
149
+ element.destroy();
150
+ }
151
+ this.destroyConstraints(() => true);
152
+ this.sceneWrapperInternal.destroy();
153
+ }
154
+ /**
155
+ * Destroys the constraints that refer to any of the solver variables, so that an element
156
+ * can remove its variables.
157
+ * @internal
158
+ */
159
+ destroyConstraintsUsingVariables(variables) {
160
+ this.destroyConstraints((constraint) => variables.some((variable) => constraint.isUsingVariable(variable)));
161
+ }
162
+ /** @internal */
163
+ addElement(element) {
164
+ if (this.destroyedInternal) {
165
+ throw new Error(`UILayer.addElement: layer is destroyed`);
127
166
  }
167
+ this.elementRegistryInternal.push(element);
168
+ }
169
+ /** @internal */
170
+ removeElement(element) {
171
+ const index = this.elementRegistryInternal.indexOf(element);
172
+ if (index === -1) {
173
+ throw new Error(`UILayer.removeElement: element is not found in this layer`);
174
+ }
175
+ this.elementRegistryInternal.splice(index, 1);
128
176
  }
129
177
  /** @internal */
130
178
  addConstraint(constraint) {
131
- if (this._private_constraintRegistryInternal.includes(constraint)) {
179
+ if (this.destroyedInternal) {
180
+ throw new Error(`UILayer.addConstraint: layer is destroyed`);
181
+ }
182
+ if (this.constraintRegistryInternal.includes(constraint)) {
132
183
  throw new Error(`UILayer.addConstraint: constraint is already added to this layer`);
133
184
  }
134
- this._private_constraintRegistryInternal.push(constraint);
135
- this._private_signalConstraintAddedInternal.emit(this, constraint);
185
+ this.constraintRegistryInternal.push(constraint);
186
+ this.signalConstraintAddedInternal.emit(this, constraint);
136
187
  }
137
188
  /** @internal */
138
189
  removeConstraint(constraint) {
139
- const index = this._private_constraintRegistryInternal.indexOf(constraint);
190
+ const index = this.constraintRegistryInternal.indexOf(constraint);
140
191
  if (index === -1) {
141
192
  throw new Error(`UILayer.removeConstraint: constraint is not found in this layer`);
142
193
  }
143
- this._private_constraintRegistryInternal.splice(index, 1);
144
- this._private_signalConstraintRemovedInternal.emit(this, constraint);
194
+ this.constraintRegistryInternal.splice(index, 1);
195
+ this.signalConstraintRemovedInternal.emit(this, constraint);
145
196
  }
146
197
  resizeInternal(width, height) {
147
- this._private_solverWrapperInternal.suggestVariableValue(this.wVariable, width);
148
- this._private_solverWrapperInternal.suggestVariableValue(this.hVariable, height);
149
- this._private_sceneWrapperInternal.resize(width, height);
150
- this._private_signalResizedInternal.emit(width, height, this);
198
+ this.solverWrapperInternal.suggestVariableValue(this.wVariable, width);
199
+ this.solverWrapperInternal.suggestVariableValue(this.hVariable, height);
200
+ this.sceneWrapperInternal.resize(width, height);
201
+ this.signalResizedInternal.emit(width, height, this);
151
202
  const orientation = width > height ? UIOrientation.HORIZONTAL : UIOrientation.VERTICAL;
152
- if (orientation !== this._private_orientationInternal) {
153
- this._private_orientationInternal = orientation;
154
- this._private_signalOrientationChangedInternal.emit(this._private_orientationInternal, this);
203
+ if (orientation !== this.orientationInternal) {
204
+ this.orientationInternal = orientation;
205
+ this.signalOrientationChangedInternal.emit(this.orientationInternal, this);
155
206
  }
156
207
  }
157
208
  renderInternal(renderer, deltaTime) {
209
+ if (this.destroyedInternal) {
210
+ return;
211
+ }
158
212
  if (isUIModeVisible(this.mode)) {
159
- this._private_signalRenderingInternal.emit(renderer, deltaTime, this);
160
- this._private_sceneWrapperInternal.render(renderer);
213
+ this.signalRenderingInternal.emit(renderer, deltaTime, this);
214
+ if (this.destroyed) {
215
+ return;
216
+ }
217
+ this.sceneWrapperInternal.render(renderer);
161
218
  }
162
- this._private_solverWrapperInternal.dirty = false;
219
+ this.solverWrapperInternal.dirty = false;
163
220
  this.inputWrapperInternal.dirty = false;
164
221
  }
222
+ /** A removal signal handler may destroy other constraints, so the registry is walked over a copy */
223
+ destroyConstraints(predicate) {
224
+ for (const constraint of [...this.constraintRegistryInternal]) {
225
+ if (!constraint.destroyed && predicate(constraint)) {
226
+ constraint.destroy();
227
+ }
228
+ }
229
+ }
165
230
  }
166
-
167
- export { UILayer };
@@ -1,10 +1,8 @@
1
1
  /** Color blending modes */
2
- var UIBlendMode;
2
+ export var UIBlendMode;
3
3
  (function (UIBlendMode) {
4
4
  /** Standard alpha-over compositing. */
5
5
  UIBlendMode[UIBlendMode["NORMAL"] = 0] = "NORMAL";
6
6
  /** Additive blending (light accumulation). Only affects BLEND transparency. */
7
7
  UIBlendMode[UIBlendMode["ADDITIVE"] = 1] = "ADDITIVE";
8
8
  })(UIBlendMode || (UIBlendMode = {}));
9
-
10
- export { UIBlendMode };
@@ -1,7 +1,6 @@
1
- import { assertValidNumber } from './asserts.js';
2
-
1
+ import { assertValidNumber } from "./asserts.js";
3
2
  /** Linear expression for constraint equations */
4
- class UIExpression {
3
+ export class UIExpression {
5
4
  /**
6
5
  * @param constant Constant term
7
6
  * @param terms Variable-coefficient pairs
@@ -9,7 +8,7 @@ class UIExpression {
9
8
  constructor(constant = 0, terms) {
10
9
  assertValidNumber(constant, "UIExpression.constructor.constant");
11
10
  this.constant = constant;
12
- this._private_terms = terms ? new Map(terms) : new Map();
11
+ this.terms = terms ? new Map(terms) : new Map();
13
12
  if (terms) {
14
13
  for (let i = 0; i < terms.length; i++) {
15
14
  assertValidNumber(terms[i][1], `UIExpression.constructor.terms[${i}][1]`);
@@ -23,8 +22,8 @@ class UIExpression {
23
22
  * @returns Sum of expressions
24
23
  */
25
24
  static plus(a, b) {
26
- const result = new UIExpression(a.constant + b.constant, Array.from(a._private_terms.entries()));
27
- for (const [variableIndex, coefficient] of b._private_terms) {
25
+ const result = new UIExpression(a.constant + b.constant, Array.from(a.terms.entries()));
26
+ for (const [variableIndex, coefficient] of b.terms) {
28
27
  result.plus(variableIndex, coefficient);
29
28
  }
30
29
  return result;
@@ -36,8 +35,8 @@ class UIExpression {
36
35
  * @returns Difference of expressions
37
36
  */
38
37
  static minus(a, b) {
39
- const result = new UIExpression(a.constant - b.constant, Array.from(a._private_terms.entries()));
40
- for (const [variableIndex, coefficient] of b._private_terms) {
38
+ const result = new UIExpression(a.constant - b.constant, Array.from(a.terms.entries()));
39
+ for (const [variableIndex, coefficient] of b.terms) {
41
40
  result.minus(variableIndex, coefficient);
42
41
  }
43
42
  return result;
@@ -50,7 +49,7 @@ class UIExpression {
50
49
  */
51
50
  plus(variableIndex, coefficient) {
52
51
  assertValidNumber(coefficient, "UIExpression.plus.coefficient");
53
- this._private_terms.set(variableIndex, (this._private_terms.get(variableIndex) ?? 0) + coefficient);
52
+ this.terms.set(variableIndex, (this.terms.get(variableIndex) ?? 0) + coefficient);
54
53
  return this;
55
54
  }
56
55
  /**
@@ -70,8 +69,8 @@ class UIExpression {
70
69
  multiply(value) {
71
70
  assertValidNumber(value, "UIExpression.multiply.value");
72
71
  this.constant *= value;
73
- for (const [variableIndex, coefficient] of this._private_terms) {
74
- this._private_terms.set(variableIndex, coefficient * value);
72
+ for (const [variableIndex, coefficient] of this.terms) {
73
+ this.terms.set(variableIndex, coefficient * value);
75
74
  }
76
75
  return this;
77
76
  }
@@ -93,7 +92,7 @@ class UIExpression {
93
92
  * @returns True if variable has term
94
93
  */
95
94
  hasTerm(variableIndex) {
96
- return this._private_terms.has(variableIndex);
95
+ return this.terms.has(variableIndex);
97
96
  }
98
97
  /**
99
98
  * Copies from another expression.
@@ -102,9 +101,9 @@ class UIExpression {
102
101
  */
103
102
  copy(expression) {
104
103
  this.constant = expression.constant;
105
- this._private_terms.clear();
106
- for (const [variableIndex, coefficient] of expression._private_terms) {
107
- this._private_terms.set(variableIndex, coefficient);
104
+ this.terms.clear();
105
+ for (const [variableIndex, coefficient] of expression.terms) {
106
+ this.terms.set(variableIndex, coefficient);
108
107
  }
109
108
  return this;
110
109
  }
@@ -113,7 +112,7 @@ class UIExpression {
113
112
  * @returns New expression with same content
114
113
  */
115
114
  clone() {
116
- return new UIExpression(this.constant, Array.from(this._private_terms.entries()));
115
+ return new UIExpression(this.constant, Array.from(this.terms.entries()));
117
116
  }
118
117
  /**
119
118
  * Prepares terms for solver.
@@ -121,8 +120,6 @@ class UIExpression {
121
120
  * @internal
122
121
  */
123
122
  prepareTerms() {
124
- return Array.from(this._private_terms.entries());
123
+ return Array.from(this.terms.entries());
125
124
  }
126
125
  }
127
-
128
- export { UIExpression };
@@ -1,5 +1,5 @@
1
1
  /** Visibility and interactivity state */
2
- var UIMode;
2
+ export var UIMode;
3
3
  (function (UIMode) {
4
4
  /** Not rendered, no input */
5
5
  UIMode[UIMode["HIDDEN"] = 0] = "HIDDEN";
@@ -15,7 +15,7 @@ var UIMode;
15
15
  * @param mode Mode to check
16
16
  * @returns True if interactive
17
17
  */
18
- function isUIModeInteractive(mode) {
18
+ export function isUIModeInteractive(mode) {
19
19
  return mode === UIMode.INTERACTIVE || mode === UIMode.INTERACTIVE_TRANSPARENT;
20
20
  }
21
21
  /**
@@ -23,8 +23,6 @@ function isUIModeInteractive(mode) {
23
23
  * @param mode Mode to check
24
24
  * @returns True if visible
25
25
  */
26
- function isUIModeVisible(mode) {
26
+ export function isUIModeVisible(mode) {
27
27
  return mode !== UIMode.HIDDEN;
28
28
  }
29
-
30
- export { UIMode, isUIModeInteractive, isUIModeVisible };
@@ -1,5 +1,5 @@
1
1
  /** Screen orientation for conditional constraints */
2
- var UIOrientation;
2
+ export var UIOrientation;
3
3
  (function (UIOrientation) {
4
4
  /** Landscape (width > height) */
5
5
  UIOrientation[UIOrientation["HORIZONTAL"] = 0] = "HORIZONTAL";
@@ -13,8 +13,6 @@ var UIOrientation;
13
13
  * @param orientation Orientation to resolve
14
14
  * @returns Orientation or ALWAYS if undefined
15
15
  */
16
- function resolveOrientation(orientation) {
16
+ export function resolveOrientation(orientation) {
17
17
  return orientation ?? UIOrientation.ALWAYS;
18
18
  }
19
-
20
- export { UIOrientation, resolveOrientation };
@@ -1,10 +1,9 @@
1
- import { Strength } from '@lume/kiwi';
2
-
1
+ import { Strength } from "@lume/kiwi";
3
2
  const HIGH_PRIORITY = 1000;
4
3
  const MEDIUM_PRIORITY = 100;
5
4
  const LOW_PRIORITY = 10;
6
5
  /** Constraint solver priority levels */
7
- var UIPriority;
6
+ export var UIPriority;
8
7
  (function (UIPriority) {
9
8
  /** Highest priority */
10
9
  UIPriority[UIPriority["P0"] = 0] = "P0";
@@ -29,7 +28,7 @@ var UIPriority;
29
28
  * @returns Solver strength value
30
29
  * @throws If priority is invalid
31
30
  */
32
- function convertPriority(priority) {
31
+ export function convertPriority(priority) {
33
32
  switch (priority) {
34
33
  case UIPriority.P0:
35
34
  return Strength.create(HIGH_PRIORITY, HIGH_PRIORITY, HIGH_PRIORITY);
@@ -48,7 +47,7 @@ function convertPriority(priority) {
48
47
  case UIPriority.P7:
49
48
  return Strength.create(0, 0, 1);
50
49
  default:
51
- throw new Error(`convertPriority.priority: invalid priority`);
50
+ throw new Error(`convertPriority.priority: invalid priority ${String(priority)}`);
52
51
  }
53
52
  }
54
53
  /**
@@ -56,8 +55,6 @@ function convertPriority(priority) {
56
55
  * @param priority Priority to resolve
57
56
  * @returns Priority or P0 if undefined
58
57
  */
59
- function resolvePriority(priority) {
58
+ export function resolvePriority(priority) {
60
59
  return priority ?? UIPriority.P0;
61
60
  }
62
-
63
- export { UIPriority, convertPriority, resolvePriority };
@@ -1,7 +1,6 @@
1
- import { Operator } from '@lume/kiwi';
2
-
1
+ import { Operator } from "@lume/kiwi";
3
2
  /** Relational operators for constraints */
4
- var UIRelation;
3
+ export var UIRelation;
5
4
  (function (UIRelation) {
6
5
  /** Equality: LHS = RHS */
7
6
  UIRelation[UIRelation["EQUAL"] = 0] = "EQUAL";
@@ -16,7 +15,7 @@ var UIRelation;
16
15
  * @returns Solver operator
17
16
  * @throws If relation is invalid
18
17
  */
19
- function convertRelation(relation) {
18
+ export function convertRelation(relation) {
20
19
  switch (relation) {
21
20
  case UIRelation.EQUAL:
22
21
  return Operator.Eq;
@@ -25,7 +24,7 @@ function convertRelation(relation) {
25
24
  case UIRelation.GREATER_THAN:
26
25
  return Operator.Ge;
27
26
  default:
28
- throw new Error(`convertRelation.relation: invalid relation`);
27
+ throw new Error(`convertRelation.relation: invalid relation ${String(relation)}`);
29
28
  }
30
29
  }
31
30
  /**
@@ -33,8 +32,6 @@ function convertRelation(relation) {
33
32
  * @param relation Relation to resolve
34
33
  * @returns Relation or EQUAL if undefined
35
34
  */
36
- function resolveRelation(relation) {
35
+ export function resolveRelation(relation) {
37
36
  return relation ?? UIRelation.EQUAL;
38
37
  }
39
-
40
- export { UIRelation, convertRelation, resolveRelation };
@@ -1,10 +1,8 @@
1
1
  /** Transparency rendering modes */
2
- var UITransparencyMode;
2
+ export var UITransparencyMode;
3
3
  (function (UITransparencyMode) {
4
4
  /** Dithered transparency. Good performance. */
5
5
  UITransparencyMode[UITransparencyMode["HASH"] = 0] = "HASH";
6
6
  /** Alpha blending. Best quality. */
7
7
  UITransparencyMode[UITransparencyMode["BLEND"] = 1] = "BLEND";
8
8
  })(UITransparencyMode || (UITransparencyMode = {}));
9
-
10
- export { UITransparencyMode };
@@ -1,5 +1,3 @@
1
1
  /** Base class for interaction area shapes */
2
- class UIArea {
2
+ export class UIArea {
3
3
  }
4
-
5
- export { UIArea };
@@ -1,4 +1,4 @@
1
- import { UIArea } from "./UIArea";
1
+ import { UIArea } from "./UIArea.js";
2
2
  /** Circular interaction area */
3
3
  export declare class UIAreaCircle extends UIArea {
4
4
  centerX: number;
@@ -1,8 +1,7 @@
1
- import { assertValidNonNegativeNumber, assertValidNumber } from '../asserts.js';
2
- import { UIArea } from './UIArea.js';
3
-
1
+ import { assertValidNonNegativeNumber, assertValidNumber } from "../asserts.js";
2
+ import { UIArea } from "./UIArea.js";
4
3
  /** Circular interaction area */
5
- class UIAreaCircle extends UIArea {
4
+ export class UIAreaCircle extends UIArea {
6
5
  /**
7
6
  * Creates circular area.
8
7
  *
@@ -28,5 +27,3 @@ class UIAreaCircle extends UIArea {
28
27
  return deltaX * deltaX + deltaY * deltaY <= this.radius * this.radius;
29
28
  }
30
29
  }
31
-
32
- export { UIAreaCircle };
@@ -1,5 +1,5 @@
1
- import type { Vector2Like } from "../math";
2
- import { UIArea } from "./UIArea";
1
+ import type { Vector2Like } from "../math.js";
2
+ import { UIArea } from "./UIArea.js";
3
3
  /** Polygonal interaction area using ray casting */
4
4
  export declare class UIAreaPolygon extends UIArea {
5
5
  vertices: Vector2Like[];
@@ -1,8 +1,7 @@
1
- import { assertValidNumber } from '../asserts.js';
2
- import { UIArea } from './UIArea.js';
3
-
1
+ import { assertValidNumber } from "../asserts.js";
2
+ import { UIArea } from "./UIArea.js";
4
3
  /** Polygonal interaction area using ray casting */
5
- class UIAreaPolygon extends UIArea {
4
+ export class UIAreaPolygon extends UIArea {
6
5
  /**
7
6
  * Creates polygonal area.
8
7
  *
@@ -36,5 +35,3 @@ class UIAreaPolygon extends UIArea {
36
35
  return inside;
37
36
  }
38
37
  }
39
-
40
- export { UIAreaPolygon };
@@ -1,4 +1,4 @@
1
- import { UIArea } from "./UIArea";
1
+ import { UIArea } from "./UIArea.js";
2
2
  /** Rectangular interaction area */
3
3
  export declare class UIAreaRectangle extends UIArea {
4
4
  x: number;
@@ -1,8 +1,7 @@
1
- import { assertValidNonNegativeNumber, assertValidNumber } from '../asserts.js';
2
- import { UIArea } from './UIArea.js';
3
-
1
+ import { assertValidNonNegativeNumber, assertValidNumber } from "../asserts.js";
2
+ import { UIArea } from "./UIArea.js";
4
3
  /** Rectangular interaction area */
5
- class UIAreaRectangle extends UIArea {
4
+ export class UIAreaRectangle extends UIArea {
6
5
  /**
7
6
  * Creates rectangular area.
8
7
  *
@@ -32,5 +31,3 @@ class UIAreaRectangle extends UIArea {
32
31
  pointY <= this.y + this.height);
33
32
  }
34
33
  }
35
-
36
- export { UIAreaRectangle };
@@ -1,4 +1,4 @@
1
- import { UIArea } from "./UIArea";
1
+ import { UIArea } from "./UIArea.js";
2
2
  /** Rectangular interaction area with rounded corners */
3
3
  export declare class UIAreaRoundedRectangle extends UIArea {
4
4
  x: number;
@@ -1,8 +1,7 @@
1
- import { assertValidNonNegativeNumber, assertValidNumber } from '../asserts.js';
2
- import { UIArea } from './UIArea.js';
3
-
1
+ import { assertValidNonNegativeNumber, assertValidNumber } from "../asserts.js";
2
+ import { UIArea } from "./UIArea.js";
4
3
  /** Rectangular interaction area with rounded corners */
5
- class UIAreaRoundedRectangle extends UIArea {
4
+ export class UIAreaRoundedRectangle extends UIArea {
6
5
  /**
7
6
  * Creates rounded rectangular area.
8
7
  *
@@ -68,5 +67,3 @@ class UIAreaRoundedRectangle extends UIArea {
68
67
  return deltaX * deltaX + deltaY * deltaY <= this.radius * this.radius;
69
68
  }
70
69
  }
71
-
72
- export { UIAreaRoundedRectangle };