laymur 0.22.0 → 0.25.0

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 (314) 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 +25 -17
  72. package/dist/core/elements/UIElement/UIElement.js +76 -69
  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 -8
  88. package/dist/core/elements/UIProgress/UIProgress.js +60 -58
  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 +20 -1
  132. package/dist/core/miscellaneous/asserts.js +71 -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 +2 -2
  141. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +13 -16
  142. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +115 -118
  143. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts +3 -3
  144. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.js +1 -0
  145. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +208 -114
  146. package/dist/core/miscellaneous/generic-plane/shared.d.ts +2 -2
  147. package/dist/core/miscellaneous/generic-plane/shared.js +16 -19
  148. package/dist/core/miscellaneous/insets/UIInsets.Internal.js +1 -3
  149. package/dist/core/miscellaneous/insets/UIInsets.d.ts +1 -1
  150. package/dist/core/miscellaneous/insets/UIInsets.js +96 -99
  151. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +1 -3
  152. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +1 -1
  153. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +14 -17
  154. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +2 -2
  155. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +14 -17
  156. package/dist/core/miscellaneous/math.js +3 -5
  157. package/dist/core/miscellaneous/micro/UIMicro.Internal.js +6 -8
  158. package/dist/core/miscellaneous/micro/UIMicro.d.ts +1 -1
  159. package/dist/core/miscellaneous/micro/UIMicro.js +91 -94
  160. package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +1 -3
  161. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +1 -1
  162. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +12 -15
  163. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +1 -1
  164. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +13 -16
  165. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +1 -1
  166. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +13 -16
  167. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +1 -1
  168. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +12 -15
  169. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +1 -1
  170. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +13 -16
  171. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +1 -1
  172. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +13 -16
  173. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +1 -1
  174. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +3 -6
  175. package/dist/core/miscellaneous/shared.d.ts +1 -1
  176. package/dist/core/miscellaneous/shared.js +4 -7
  177. package/dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts +1 -1
  178. package/dist/core/miscellaneous/text-span/UITextSpan.Internal.js +1 -0
  179. package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +2 -2
  180. package/dist/core/miscellaneous/text-span/UITextSpan.js +10 -13
  181. package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +15 -17
  182. package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +13 -2
  183. package/dist/core/miscellaneous/text-style/UITextStyle.js +222 -207
  184. package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +7 -0
  185. package/dist/core/miscellaneous/texture/UITextureView.Internal.js +16 -6
  186. package/dist/core/miscellaneous/texture/UITextureView.d.ts +3 -3
  187. package/dist/core/miscellaneous/texture/UITextureView.js +114 -118
  188. package/dist/core/miscellaneous/webglCapabilities.js +3 -4
  189. package/dist/core/shaders/UIImage.d.ts +9 -0
  190. package/dist/core/shaders/UIImage.js +14 -0
  191. package/dist/core/shaders/UINineSlice.d.ts +11 -0
  192. package/dist/core/shaders/UINineSlice.js +57 -0
  193. package/dist/core/shaders/UIProgress.d.ts +14 -0
  194. package/dist/core/shaders/UIProgress.js +21 -0
  195. package/dist/core/shaders/UIProgressMaskFunctionCircular.d.ts +2 -0
  196. package/dist/core/shaders/UIProgressMaskFunctionCircular.js +16 -0
  197. package/dist/core/shaders/UIProgressMaskFunctionDirectional.d.ts +2 -0
  198. package/dist/core/shaders/UIProgressMaskFunctionDirectional.js +15 -0
  199. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +4 -0
  200. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.js +1 -0
  201. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +7 -1
  202. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +50 -47
  203. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +5 -2
  204. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.js +1 -0
  205. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +11 -3
  206. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +42 -26
  207. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +5 -3
  208. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.js +1 -0
  209. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +27 -4
  210. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +162 -123
  211. package/dist/debug/UIAspectDebug.d.ts +3 -3
  212. package/dist/debug/UIAspectDebug.js +64 -68
  213. package/dist/debug/UIConstraintDebug.d.ts +1 -1
  214. package/dist/debug/UIConstraintDebug.js +1 -0
  215. package/dist/debug/UIHeightDebug.d.ts +3 -3
  216. package/dist/debug/UIHeightDebug.js +63 -67
  217. package/dist/debug/UIHorizontalDistanceDebug.d.ts +3 -3
  218. package/dist/debug/UIHorizontalDistanceDebug.js +76 -81
  219. package/dist/debug/UIHorizontalInterpolationDebug.d.ts +3 -3
  220. package/dist/debug/UIHorizontalInterpolationDebug.js +74 -78
  221. package/dist/debug/UILayerDebug.d.ts +1 -1
  222. package/dist/debug/UILayerDebug.js +55 -64
  223. package/dist/debug/UIVerticalDistanceDebug.d.ts +3 -3
  224. package/dist/debug/UIVerticalDistanceDebug.js +76 -81
  225. package/dist/debug/UIVerticalInterpolationDebug.d.ts +3 -3
  226. package/dist/debug/UIVerticalInterpolationDebug.js +74 -78
  227. package/dist/debug/UIWidthDebug.d.ts +3 -3
  228. package/dist/debug/UIWidthDebug.js +63 -67
  229. package/dist/debug/index.d.ts +8 -8
  230. package/dist/debug/index.js +8 -8
  231. package/dist/debug/miscellaneous.js +8 -11
  232. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +3 -3
  233. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +13 -16
  234. package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +1 -1
  235. package/dist/particles/behaviorModules/UIBehaviorModule.js +1 -3
  236. package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +3 -3
  237. package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +37 -40
  238. package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.d.ts +41 -0
  239. package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.js +87 -0
  240. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +2 -2
  241. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +17 -20
  242. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +2 -2
  243. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +13 -16
  244. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +2 -2
  245. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +21 -24
  246. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +2 -2
  247. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +13 -16
  248. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +2 -2
  249. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +21 -24
  250. package/dist/particles/elements/UIEmitter.Internal.d.ts +2 -2
  251. package/dist/particles/elements/UIEmitter.Internal.js +6 -9
  252. package/dist/particles/elements/UIEmitter.d.ts +17 -11
  253. package/dist/particles/elements/UIEmitter.js +100 -88
  254. package/dist/particles/index.d.ts +20 -18
  255. package/dist/particles/index.js +19 -18
  256. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +1 -1
  257. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +14 -15
  258. package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +1 -1
  259. package/dist/particles/instancedParticle/UIInstancedParticle.js +29 -32
  260. package/dist/particles/miscellaneous/miscellaneous.d.ts +3 -3
  261. package/dist/particles/miscellaneous/miscellaneous.js +26 -27
  262. package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +2 -2
  263. package/dist/particles/renderingModules/UIRenderingColorOverLife.js +5 -8
  264. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +2 -2
  265. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +6 -9
  266. package/dist/particles/renderingModules/UIRenderingModule.js +1 -3
  267. package/dist/particles/renderingModules/UIRenderingTexture.d.ts +2 -2
  268. package/dist/particles/renderingModules/UIRenderingTexture.js +4 -7
  269. package/dist/particles/shaders/UIRenderingColorOverLife.d.ts +2 -0
  270. package/dist/particles/shaders/UIRenderingColorOverLife.js +7 -0
  271. package/dist/particles/shaders/UIRenderingColorOverVelocity.d.ts +9 -0
  272. package/dist/particles/shaders/UIRenderingColorOverVelocity.js +16 -0
  273. package/dist/particles/shaders/UIRenderingTexture.d.ts +2 -0
  274. package/dist/particles/shaders/UIRenderingTexture.js +7 -0
  275. package/dist/particles/spawnModules/UISpawnModule.d.ts +1 -1
  276. package/dist/particles/spawnModules/UISpawnModule.js +1 -3
  277. package/dist/particles/spawnModules/UISpawnOffset.d.ts +3 -3
  278. package/dist/particles/spawnModules/UISpawnOffset.js +12 -15
  279. package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +2 -2
  280. package/dist/particles/spawnModules/UISpawnRandomLifetime.js +13 -16
  281. package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +2 -2
  282. package/dist/particles/spawnModules/UISpawnRandomRotation.js +13 -16
  283. package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +2 -2
  284. package/dist/particles/spawnModules/UISpawnRandomScale.js +19 -22
  285. package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +2 -2
  286. package/dist/particles/spawnModules/UISpawnRandomTorque.js +13 -16
  287. package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +2 -2
  288. package/dist/particles/spawnModules/UISpawnRandomVelocity.js +21 -24
  289. package/dist/particles/spawnModules/UISpawnRectangle.d.ts +3 -3
  290. package/dist/particles/spawnModules/UISpawnRectangle.js +21 -24
  291. package/package.json +13 -17
  292. package/dist/_virtual/2d.js +0 -3
  293. package/dist/_virtual/3d.js +0 -3
  294. package/dist/_virtual/4d.js +0 -3
  295. package/dist/_virtual/mod.js +0 -5
  296. package/dist/_virtual/mod2.js +0 -3
  297. package/dist/core/shaders/UIImage.glsl.js +0 -3
  298. package/dist/core/shaders/UINineSlice.glsl.js +0 -3
  299. package/dist/core/shaders/UIProgress.glsl.js +0 -3
  300. package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +0 -3
  301. package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +0 -3
  302. package/dist/index.js +0 -52
  303. package/dist/node_modules/fast-simplex-noise/lib/2d.js +0 -93
  304. package/dist/node_modules/fast-simplex-noise/lib/3d.js +0 -142
  305. package/dist/node_modules/fast-simplex-noise/lib/4d.js +0 -196
  306. package/dist/node_modules/fast-simplex-noise/lib/mod.js +0 -24
  307. package/dist/node_modules/three/examples/jsm/lines/Line2.js +0 -56
  308. package/dist/node_modules/three/examples/jsm/lines/LineGeometry.js +0 -157
  309. package/dist/node_modules/three/examples/jsm/lines/LineMaterial.js +0 -691
  310. package/dist/node_modules/three/examples/jsm/lines/LineSegments2.js +0 -415
  311. package/dist/node_modules/three/examples/jsm/lines/LineSegmentsGeometry.js +0 -289
  312. package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +0 -3
  313. package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +0 -3
  314. package/dist/particles/shaders/UIRenderingTexture.glsl.js +0 -3
@@ -1,64 +1,73 @@
1
- class UIInputWrapper {
1
+ export class UIInputWrapper {
2
2
  constructor() {
3
3
  /** @internal */
4
4
  this.dirty = false;
5
- this._private_zIndicesDirty = false;
6
- this._private_catchers = [];
7
- this._private_lastHandler = 0;
5
+ this.zIndicesDirty = false;
6
+ this.catchers = [];
7
+ this.lastHandler = 0;
8
8
  }
9
9
  createInputCatcher(catchPointerDown, catchPointerMove, catchPointerUp, zIndex) {
10
- const handler = this._private_lastHandler++;
11
- this._private_catchers.push({
10
+ const handler = this.lastHandler++;
11
+ this.catchers.push({
12
12
  handler,
13
13
  catchPointerDown,
14
14
  catchPointerMove,
15
15
  catchPointerUp,
16
16
  zIndex,
17
+ depth: 0,
17
18
  active: true,
18
19
  });
19
- this._private_zIndicesDirty = true;
20
+ this.zIndicesDirty = true;
20
21
  this.dirty = true;
21
22
  return handler;
22
23
  }
23
24
  destroyInputCatcher(handler) {
24
- const index = this._private_catchers.findIndex((item) => item.handler === handler);
25
+ const index = this.catchers.findIndex((item) => item.handler === handler);
25
26
  if (index === -1) {
26
- throw new Error("UIInputWrapper.destroyInputCatcher.handler: handler not found");
27
+ throw new Error(`UIInputWrapper.destroyInputCatcher.handler: handler ${handler} not found; its element may be destroyed`);
27
28
  }
28
- this._private_catchers.splice(index, 1);
29
- this._private_zIndicesDirty = true;
29
+ this.catchers[index].active = false;
30
+ this.catchers.splice(index, 1);
31
+ this.zIndicesDirty = true;
30
32
  this.dirty = true;
31
33
  }
32
34
  getZIndex(handler) {
33
- this._private_ensureSorted();
34
- const found = this._private_catchers.find((item) => item.handler === handler);
35
+ const found = this.catchers.find((item) => item.handler === handler);
35
36
  if (!found) {
36
- throw new Error("UIInputWrapper.getZIndex.handler: handler not found");
37
+ throw new Error(`UIInputWrapper.getZIndex.handler: handler ${handler} not found; its element may be destroyed`);
37
38
  }
38
39
  return found.zIndex;
39
40
  }
41
+ getDepth(handler) {
42
+ this.ensureSorted();
43
+ const found = this.catchers.find((item) => item.handler === handler);
44
+ if (!found) {
45
+ throw new Error(`UIInputWrapper.getDepth.handler: handler ${handler} not found; its element may be destroyed`);
46
+ }
47
+ return found.depth;
48
+ }
40
49
  setZIndex(handler, zIndex) {
41
- const found = this._private_catchers.find((item) => item.handler === handler);
50
+ const found = this.catchers.find((item) => item.handler === handler);
42
51
  if (!found) {
43
- throw new Error("UIInputWrapper.setZIndex.handler: handler not found");
52
+ throw new Error(`UIInputWrapper.setZIndex.handler: handler ${handler} not found; its element may be destroyed`);
44
53
  }
45
54
  if (found.zIndex !== zIndex) {
46
55
  found.zIndex = zIndex;
47
- this._private_zIndicesDirty = true;
56
+ this.zIndicesDirty = true;
48
57
  this.dirty = true;
49
58
  }
50
59
  }
51
60
  getActive(handler) {
52
- const found = this._private_catchers.find((item) => item.handler === handler);
61
+ const found = this.catchers.find((item) => item.handler === handler);
53
62
  if (!found) {
54
- throw new Error("UIInputWrapper.getActive.handler: handler not found");
63
+ throw new Error(`UIInputWrapper.getActive.handler: handler ${handler} not found; its element may be destroyed`);
55
64
  }
56
65
  return found.active;
57
66
  }
58
67
  setActive(handler, active) {
59
- const found = this._private_catchers.find((item) => item.handler === handler);
68
+ const found = this.catchers.find((item) => item.handler === handler);
60
69
  if (!found) {
61
- throw new Error("UIInputWrapper.setActive.handler: handler not found");
70
+ throw new Error(`UIInputWrapper.setActive.handler: handler ${handler} not found; its element may be destroyed`);
62
71
  }
63
72
  if (found.active !== active) {
64
73
  found.active = active;
@@ -66,45 +75,39 @@ class UIInputWrapper {
66
75
  }
67
76
  /** @internal */
68
77
  onPointerDown(x, y, identifier) {
69
- this._private_ensureSorted();
70
- for (let index = this._private_catchers.length - 1; index >= 0; index--) {
71
- const item = this._private_catchers[index];
72
- if (item.active && item.catchPointerDown(x, y, identifier)) {
73
- break;
74
- }
75
- }
78
+ this.dispatch(x, y, identifier, "catchPointerDown");
76
79
  }
77
80
  /** @internal */
78
81
  onPointerMove(x, y, identifier) {
79
- this._private_ensureSorted();
80
- for (let index = this._private_catchers.length - 1; index >= 0; index--) {
81
- const item = this._private_catchers[index];
82
- if (item.active && item.catchPointerMove(x, y, identifier)) {
83
- break;
84
- }
85
- }
82
+ this.dispatch(x, y, identifier, "catchPointerMove");
86
83
  }
87
84
  /** @internal */
88
85
  onPointerUp(x, y, identifier) {
89
- this._private_ensureSorted();
90
- for (let index = this._private_catchers.length - 1; index >= 0; index--) {
91
- const item = this._private_catchers[index];
92
- if (item.active && item.catchPointerUp(x, y, identifier)) {
86
+ this.dispatch(x, y, identifier, "catchPointerUp");
87
+ }
88
+ /**
89
+ * Passes a pointer event from the top catcher down until one catches it. A handler may
90
+ * destroy elements, so the catchers are walked over a copy and a destroyed one is skipped.
91
+ */
92
+ dispatch(x, y, identifier, name) {
93
+ this.ensureSorted();
94
+ const catchers = this.catchers.slice();
95
+ for (let index = catchers.length - 1; index >= 0; index--) {
96
+ const item = catchers[index];
97
+ if (item.active && item[name](x, y, identifier)) {
93
98
  break;
94
99
  }
95
100
  }
96
101
  }
97
- _private_ensureSorted() {
98
- if (this._private_zIndicesDirty) {
99
- this._private_catchers.sort((a, b) => a.zIndex - b.zIndex);
100
- const count = this._private_catchers.length;
102
+ ensureSorted() {
103
+ if (this.zIndicesDirty) {
104
+ this.catchers.sort((a, b) => a.zIndex - b.zIndex || a.handler - b.handler);
105
+ const count = this.catchers.length;
101
106
  const step = count < 1024 ? 1 : 1024 / count;
102
107
  for (let index = 0; index < count; index++) {
103
- this._private_catchers[index].zIndex = index * step;
108
+ this.catchers[index].depth = index * step;
104
109
  }
105
- this._private_zIndicesDirty = false;
110
+ this.zIndicesDirty = false;
106
111
  }
107
112
  }
108
113
  }
109
-
110
- export { UIInputWrapper };
@@ -1,6 +1,6 @@
1
1
  import type { Matrix4, Object3D } from "three";
2
- import type { UITransparencyMode } from "../../miscellaneous/UITransparencyMode";
3
- import type { HSLAdjustment, UIProperty } from "../../miscellaneous/generic-plane/shared";
2
+ import type { UITransparencyMode } from "../../miscellaneous/UITransparencyMode.js";
3
+ import type { HSLAdjustment, UIProperty } from "../../miscellaneous/generic-plane/shared.js";
4
4
  export interface UISceneWrapperView {
5
5
  createPlane(source: string, properties: Record<string, UIProperty>, transform: Matrix4, visibility: boolean, transparency: UITransparencyMode, blend: number, hsl: HSLAdjustment): number;
6
6
  destroyPlane(handler: number): void;
@@ -10,6 +10,9 @@ export interface UISceneWrapperView {
10
10
  setTransparency(handler: number, transparency: UITransparencyMode): void;
11
11
  setBlend(handler: number, blend: number): void;
12
12
  setHSL(handler: number, hsl: HSLAdjustment): void;
13
+ insertOrderedObject(object: Object3D, depth: number): void;
14
+ setOrderedObjectDepth(object: Object3D, depth: number): void;
15
+ removeOrderedObject(object: Object3D): void;
13
16
  insertCustomObject(object: Object3D): void;
14
17
  removeCustomObject(object: Object3D): void;
15
18
  }
@@ -1,7 +1,7 @@
1
1
  import type { Matrix4, Object3D, WebGLRenderer } from "three";
2
- import type { HSLAdjustment, UIProperty } from "../../miscellaneous/generic-plane/shared";
3
- import type { UITransparencyMode } from "../../miscellaneous/UITransparencyMode";
4
- import type { UISceneWrapperView } from "./UISceneWrapper.Internal";
2
+ import type { HSLAdjustment, UIProperty } from "../../miscellaneous/generic-plane/shared.js";
3
+ import type { UITransparencyMode } from "../../miscellaneous/UITransparencyMode.js";
4
+ import type { UISceneWrapperView } from "./UISceneWrapper.Internal.js";
5
5
  export declare class UISceneWrapper implements UISceneWrapperView {
6
6
  private readonly scene;
7
7
  private readonly camera;
@@ -15,8 +15,16 @@ export declare class UISceneWrapper implements UISceneWrapperView {
15
15
  setTransparency(handler: number, transparency: UITransparencyMode): void;
16
16
  setBlend(handler: number, blend: number): void;
17
17
  setHSL(handler: number, hsl: HSLAdjustment): void;
18
+ /** Adds an object drawn between planes by depth, on the same scale as plane zIndex */
19
+ insertOrderedObject(object: Object3D, depth: number): this;
20
+ /** Moves an ordered object to the given depth */
21
+ setOrderedObjectDepth(object: Object3D, depth: number): this;
22
+ /** Removes an ordered object */
23
+ removeOrderedObject(object: Object3D): this;
18
24
  insertCustomObject(object: Object3D): this;
19
25
  removeCustomObject(object: Object3D): this;
26
+ /** Frees the GPU resources of all planes; custom and ordered objects are left to their owners */
27
+ destroy(): void;
20
28
  resize(width: number, height: number): this;
21
29
  render(renderer: WebGLRenderer): this;
22
30
  }
@@ -1,60 +1,78 @@
1
- import { Color, Scene, OrthographicCamera } from 'three';
2
- import { UIPlaneRegistry } from '../../miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js';
3
-
1
+ import { Color, OrthographicCamera, Scene } from "three";
2
+ import { UIPlaneRegistry } from "../../miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js";
4
3
  let originalClearColor = new Color();
5
4
  let originalClearAlpha = 0;
6
5
  let originalAutoClear = false;
7
6
  let originalAutoClearColor = false;
8
7
  let originalAutoClearDepth = false;
9
8
  let originalAutoClearStencil = false;
10
- class UISceneWrapper {
9
+ export class UISceneWrapper {
11
10
  constructor(width, height) {
12
- this._private_scene = new Scene();
13
- this._private_planeRegistry = new UIPlaneRegistry(this._private_scene);
14
- this._private_camera = new OrthographicCamera(0, width, height, 0, -1024, 1024);
15
- this._private_camera.matrixAutoUpdate = false;
16
- this._private_camera.matrixWorldAutoUpdate = false;
11
+ this.scene = new Scene();
12
+ this.planeRegistry = new UIPlaneRegistry(this.scene);
13
+ this.camera = new OrthographicCamera(0, width, height, 0, -1024, 1024);
14
+ this.camera.matrixAutoUpdate = false;
15
+ this.camera.matrixWorldAutoUpdate = false;
17
16
  }
18
17
  createPlane(source, properties, transform, visibility, transparency, blend, hsl) {
19
- return this._private_planeRegistry.createPlane(source, properties, transform, visibility, transparency, blend, hsl);
18
+ return this.planeRegistry.createPlane(source, properties, transform, visibility, transparency, blend, hsl);
20
19
  }
21
20
  destroyPlane(handler) {
22
- this._private_planeRegistry.destroyPlane(handler);
21
+ this.planeRegistry.destroyPlane(handler);
23
22
  }
24
23
  setTransform(handler, transform) {
25
- this._private_planeRegistry.setTransform(handler, transform);
24
+ this.planeRegistry.setTransform(handler, transform);
26
25
  }
27
26
  setProperties(handler, properties) {
28
- this._private_planeRegistry.setProperties(handler, properties);
27
+ this.planeRegistry.setProperties(handler, properties);
29
28
  }
30
29
  setVisibility(handler, visible) {
31
- this._private_planeRegistry.setVisibility(handler, visible);
30
+ this.planeRegistry.setVisibility(handler, visible);
32
31
  }
33
32
  setTransparency(handler, transparency) {
34
- this._private_planeRegistry.setTransparency(handler, transparency);
33
+ this.planeRegistry.setTransparency(handler, transparency);
35
34
  }
36
35
  setBlend(handler, blend) {
37
- this._private_planeRegistry.setBlend(handler, blend);
36
+ this.planeRegistry.setBlend(handler, blend);
38
37
  }
39
38
  setHSL(handler, hsl) {
40
- this._private_planeRegistry.setHSL(handler, hsl);
39
+ this.planeRegistry.setHSL(handler, hsl);
40
+ }
41
+ /** Adds an object drawn between planes by depth, on the same scale as plane zIndex */
42
+ insertOrderedObject(object, depth) {
43
+ this.planeRegistry.insertOrderedObject(object, depth);
44
+ return this;
45
+ }
46
+ /** Moves an ordered object to the given depth */
47
+ setOrderedObjectDepth(object, depth) {
48
+ this.planeRegistry.setOrderedObjectDepth(object, depth);
49
+ return this;
50
+ }
51
+ /** Removes an ordered object */
52
+ removeOrderedObject(object) {
53
+ this.planeRegistry.removeOrderedObject(object);
54
+ return this;
41
55
  }
42
56
  insertCustomObject(object) {
43
- this._private_scene.add(object);
57
+ this.scene.add(object);
44
58
  return this;
45
59
  }
46
60
  removeCustomObject(object) {
47
- this._private_scene.remove(object);
61
+ this.scene.remove(object);
48
62
  return this;
49
63
  }
64
+ /** Frees the GPU resources of all planes; custom and ordered objects are left to their owners */
65
+ destroy() {
66
+ this.planeRegistry.destroy();
67
+ }
50
68
  resize(width, height) {
51
- this._private_camera.right = width;
52
- this._private_camera.top = height;
53
- this._private_camera.updateProjectionMatrix();
69
+ this.camera.right = width;
70
+ this.camera.top = height;
71
+ this.camera.updateProjectionMatrix();
54
72
  return this;
55
73
  }
56
74
  render(renderer) {
57
- this._private_planeRegistry.flush();
75
+ this.planeRegistry.flush();
58
76
  originalClearColor = renderer.getClearColor(originalClearColor);
59
77
  originalClearAlpha = renderer.getClearAlpha();
60
78
  originalAutoClear = renderer.autoClear;
@@ -67,7 +85,7 @@ class UISceneWrapper {
67
85
  renderer.autoClearStencil = false;
68
86
  renderer.setClearColor(0x000000, 1);
69
87
  renderer.clear(false, true, true);
70
- renderer.render(this._private_scene, this._private_camera);
88
+ renderer.render(this.scene, this.camera);
71
89
  renderer.setClearColor(originalClearColor);
72
90
  renderer.setClearAlpha(originalClearAlpha);
73
91
  renderer.autoClear = originalAutoClear;
@@ -77,5 +95,3 @@ class UISceneWrapper {
77
95
  return this;
78
96
  }
79
97
  }
80
-
81
- export { UISceneWrapper };
@@ -1,16 +1,18 @@
1
1
  import type { Constraint, Variable } from "@lume/kiwi";
2
- import type { UIExpression } from "../../miscellaneous/UIExpression";
3
- import type { UIPriority } from "../../miscellaneous/UIPriority";
4
- import type { UIRelation } from "../../miscellaneous/UIRelation";
2
+ import type { UIExpression } from "../../miscellaneous/UIExpression.js";
3
+ import type { UIPriority } from "../../miscellaneous/UIPriority.js";
4
+ import type { UIRelation } from "../../miscellaneous/UIRelation.js";
5
5
  export interface UISolverWrapperView {
6
6
  get dirty(): boolean;
7
7
  createVariable(value: number, priority: UIPriority): number;
8
8
  removeVariable(index: number): void;
9
+ hasVariable(index: number): boolean;
9
10
  suggestVariableValue(index: number, value: number): void;
10
11
  setVariablePriority(index: number, priority: UIPriority): void;
11
12
  readVariableValue(index: number): number;
12
13
  createConstraint(lhs: UIExpression, rhs: UIExpression, relation: UIRelation, priority: UIPriority, enabled: boolean): number;
13
14
  removeConstraint(index: number): void;
15
+ isConstraintUsingVariable(constraintIndex: number, variableIndex: number): boolean;
14
16
  setConstraintLHS(index: number, lhs: UIExpression): void;
15
17
  setConstraintRHS(index: number, rhs: UIExpression): void;
16
18
  setConstraintRelation(index: number, relation: UIRelation): void;
@@ -1,7 +1,7 @@
1
- import { UIExpression } from "../../miscellaneous/UIExpression";
2
- import { UIPriority } from "../../miscellaneous/UIPriority";
3
- import { UIRelation } from "../../miscellaneous/UIRelation";
4
- import type { UISolverWrapperView } from "./UISolverWrapper.Internal";
1
+ import { UIExpression } from "../../miscellaneous/UIExpression.js";
2
+ import { UIPriority } from "../../miscellaneous/UIPriority.js";
3
+ import { UIRelation } from "../../miscellaneous/UIRelation.js";
4
+ import type { UISolverWrapperView } from "./UISolverWrapper.Internal.js";
5
5
  /**
6
6
  * Wrapper around the Kiwi constraint solver providing enhanced UI-specific functionality.
7
7
  *
@@ -57,6 +57,13 @@ export declare class UISolverWrapper implements UISolverWrapperView {
57
57
  * @throws Will throw an error if the variable doesn't exist or is still in use
58
58
  */
59
59
  removeVariable(index: number): void;
60
+ /**
61
+ * Checks whether a variable exists.
62
+ *
63
+ * @param index - Index of the variable
64
+ * @returns True if the variable was created and not removed
65
+ */
66
+ hasVariable(index: number): boolean;
60
67
  /**
61
68
  * Suggests a new value for an existing variable.
62
69
  *
@@ -116,6 +123,15 @@ export declare class UISolverWrapper implements UISolverWrapperView {
116
123
  * @throws Will throw an error if the constraint doesn't exist
117
124
  */
118
125
  removeConstraint(index: number): void;
126
+ /**
127
+ * Checks whether a constraint references a variable in either of its expressions.
128
+ *
129
+ * @param constraintIndex - Index of the constraint to check
130
+ * @param variableIndex - Index of the variable to look for
131
+ * @returns True if the variable is a term of the constraint
132
+ * @throws Will throw an error if the constraint doesn't exist
133
+ */
134
+ isConstraintUsingVariable(constraintIndex: number, variableIndex: number): boolean;
119
135
  /**
120
136
  * Updates the left-hand side expression of an existing constraint.
121
137
  *
@@ -210,6 +226,13 @@ export declare class UISolverWrapper implements UISolverWrapperView {
210
226
  *
211
227
  * Re-adds all variables and constraints to a fresh solver instance.
212
228
  * Used for recovery when the solver enters an invalid state.
229
+ *
230
+ * The solver is normally dropped because some constraint was rejected by kiwi,
231
+ * and that same constraint is still registered here. Replaying it would throw
232
+ * again, so every replay is guarded individually: a constraint kiwi refuses is
233
+ * skipped and stays registered but unapplied, which is exactly the state it was
234
+ * already in. The fresh solver is only published once the replay is complete,
235
+ * so a rejection can never leave a half-built solver in place.
213
236
  */
214
237
  private rebuildSolver;
215
238
  }