@onerjs/gui 8.23.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 (354) hide show
  1. package/2D/FrameGraph/guiTask.d.ts +34 -0
  2. package/2D/FrameGraph/guiTask.js +62 -0
  3. package/2D/FrameGraph/guiTask.js.map +1 -0
  4. package/2D/FrameGraph/renderGraphGUIBlock.d.ts +43 -0
  5. package/2D/FrameGraph/renderGraphGUIBlock.js +66 -0
  6. package/2D/FrameGraph/renderGraphGUIBlock.js.map +1 -0
  7. package/2D/adtInstrumentation.d.ts +52 -0
  8. package/2D/adtInstrumentation.js +107 -0
  9. package/2D/adtInstrumentation.js.map +1 -0
  10. package/2D/advancedDynamicTexture.d.ts +548 -0
  11. package/2D/advancedDynamicTexture.js +1522 -0
  12. package/2D/advancedDynamicTexture.js.map +1 -0
  13. package/2D/controls/button.d.ts +109 -0
  14. package/2D/controls/button.js +246 -0
  15. package/2D/controls/button.js.map +1 -0
  16. package/2D/controls/checkbox.d.ts +53 -0
  17. package/2D/controls/checkbox.js +164 -0
  18. package/2D/controls/checkbox.js.map +1 -0
  19. package/2D/controls/colorpicker.d.ts +101 -0
  20. package/2D/controls/colorpicker.js +1396 -0
  21. package/2D/controls/colorpicker.js.map +1 -0
  22. package/2D/controls/container.d.ts +179 -0
  23. package/2D/controls/container.js +616 -0
  24. package/2D/controls/container.js.map +1 -0
  25. package/2D/controls/control.d.ts +943 -0
  26. package/2D/controls/control.js +2460 -0
  27. package/2D/controls/control.js.map +1 -0
  28. package/2D/controls/displayGrid.d.ts +53 -0
  29. package/2D/controls/displayGrid.js +202 -0
  30. package/2D/controls/displayGrid.js.map +1 -0
  31. package/2D/controls/ellipse.d.ts +25 -0
  32. package/2D/controls/ellipse.js +93 -0
  33. package/2D/controls/ellipse.js.map +1 -0
  34. package/2D/controls/focusableButton.d.ts +17 -0
  35. package/2D/controls/focusableButton.js +25 -0
  36. package/2D/controls/focusableButton.js.map +1 -0
  37. package/2D/controls/focusableControl.d.ts +43 -0
  38. package/2D/controls/focusableControl.js +2 -0
  39. package/2D/controls/focusableControl.js.map +1 -0
  40. package/2D/controls/gradient/BaseGradient.d.ts +69 -0
  41. package/2D/controls/gradient/BaseGradient.js +84 -0
  42. package/2D/controls/gradient/BaseGradient.js.map +1 -0
  43. package/2D/controls/gradient/LinearGradient.d.ts +45 -0
  44. package/2D/controls/gradient/LinearGradient.js +73 -0
  45. package/2D/controls/gradient/LinearGradient.js.map +1 -0
  46. package/2D/controls/gradient/RadialGradient.d.ts +53 -0
  47. package/2D/controls/gradient/RadialGradient.js +89 -0
  48. package/2D/controls/gradient/RadialGradient.js.map +1 -0
  49. package/2D/controls/grid.d.ts +151 -0
  50. package/2D/controls/grid.js +528 -0
  51. package/2D/controls/grid.js.map +1 -0
  52. package/2D/controls/image.d.ts +228 -0
  53. package/2D/controls/image.js +915 -0
  54. package/2D/controls/image.js.map +1 -0
  55. package/2D/controls/index.d.ts +34 -0
  56. package/2D/controls/index.js +35 -0
  57. package/2D/controls/index.js.map +1 -0
  58. package/2D/controls/inputPassword.d.ts +9 -0
  59. package/2D/controls/inputPassword.js +22 -0
  60. package/2D/controls/inputPassword.js.map +1 -0
  61. package/2D/controls/inputText.d.ts +197 -0
  62. package/2D/controls/inputText.js +1035 -0
  63. package/2D/controls/inputText.js.map +1 -0
  64. package/2D/controls/inputTextArea.d.ts +142 -0
  65. package/2D/controls/inputTextArea.js +1025 -0
  66. package/2D/controls/inputTextArea.js.map +1 -0
  67. package/2D/controls/line.d.ts +73 -0
  68. package/2D/controls/line.js +227 -0
  69. package/2D/controls/line.js.map +1 -0
  70. package/2D/controls/multiLine.d.ts +75 -0
  71. package/2D/controls/multiLine.js +237 -0
  72. package/2D/controls/multiLine.js.map +1 -0
  73. package/2D/controls/radioButton.d.ts +49 -0
  74. package/2D/controls/radioButton.js +185 -0
  75. package/2D/controls/radioButton.js.map +1 -0
  76. package/2D/controls/rectangle.d.ts +43 -0
  77. package/2D/controls/rectangle.js +204 -0
  78. package/2D/controls/rectangle.js.map +1 -0
  79. package/2D/controls/scrollViewers/scrollViewer.d.ts +178 -0
  80. package/2D/controls/scrollViewers/scrollViewer.js +587 -0
  81. package/2D/controls/scrollViewers/scrollViewer.js.map +1 -0
  82. package/2D/controls/scrollViewers/scrollViewerWindow.d.ts +51 -0
  83. package/2D/controls/scrollViewers/scrollViewerWindow.js +254 -0
  84. package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -0
  85. package/2D/controls/selector.d.ts +237 -0
  86. package/2D/controls/selector.js +579 -0
  87. package/2D/controls/selector.js.map +1 -0
  88. package/2D/controls/sliders/baseSlider.d.ts +80 -0
  89. package/2D/controls/sliders/baseSlider.js +299 -0
  90. package/2D/controls/sliders/baseSlider.js.map +1 -0
  91. package/2D/controls/sliders/imageBasedSlider.d.ts +47 -0
  92. package/2D/controls/sliders/imageBasedSlider.js +168 -0
  93. package/2D/controls/sliders/imageBasedSlider.js.map +1 -0
  94. package/2D/controls/sliders/imageScrollBar.d.ts +67 -0
  95. package/2D/controls/sliders/imageScrollBar.js +248 -0
  96. package/2D/controls/sliders/imageScrollBar.js.map +1 -0
  97. package/2D/controls/sliders/scrollBar.d.ts +50 -0
  98. package/2D/controls/sliders/scrollBar.js +175 -0
  99. package/2D/controls/sliders/scrollBar.js.map +1 -0
  100. package/2D/controls/sliders/slider.d.ts +46 -0
  101. package/2D/controls/sliders/slider.js +281 -0
  102. package/2D/controls/sliders/slider.js.map +1 -0
  103. package/2D/controls/stackPanel.d.ts +64 -0
  104. package/2D/controls/stackPanel.js +244 -0
  105. package/2D/controls/stackPanel.js.map +1 -0
  106. package/2D/controls/statics.d.ts +6 -0
  107. package/2D/controls/statics.js +50 -0
  108. package/2D/controls/statics.js.map +1 -0
  109. package/2D/controls/textBlock.d.ts +219 -0
  110. package/2D/controls/textBlock.js +670 -0
  111. package/2D/controls/textBlock.js.map +1 -0
  112. package/2D/controls/textWrapper.d.ts +13 -0
  113. package/2D/controls/textWrapper.js +88 -0
  114. package/2D/controls/textWrapper.js.map +1 -0
  115. package/2D/controls/toggleButton.d.ts +93 -0
  116. package/2D/controls/toggleButton.js +229 -0
  117. package/2D/controls/toggleButton.js.map +1 -0
  118. package/2D/controls/virtualKeyboard.d.ts +102 -0
  119. package/2D/controls/virtualKeyboard.js +275 -0
  120. package/2D/controls/virtualKeyboard.js.map +1 -0
  121. package/2D/index.d.ts +11 -0
  122. package/2D/index.js +13 -0
  123. package/2D/index.js.map +1 -0
  124. package/2D/math2D.d.ts +136 -0
  125. package/2D/math2D.js +235 -0
  126. package/2D/math2D.js.map +1 -0
  127. package/2D/measure.d.ts +77 -0
  128. package/2D/measure.js +138 -0
  129. package/2D/measure.js.map +1 -0
  130. package/2D/multiLinePoint.d.ts +47 -0
  131. package/2D/multiLinePoint.js +110 -0
  132. package/2D/multiLinePoint.js.map +1 -0
  133. package/2D/style.d.ts +46 -0
  134. package/2D/style.js +80 -0
  135. package/2D/style.js.map +1 -0
  136. package/2D/valueAndUnit.d.ts +89 -0
  137. package/2D/valueAndUnit.js +194 -0
  138. package/2D/valueAndUnit.js.map +1 -0
  139. package/2D/xmlLoader.d.ts +60 -0
  140. package/2D/xmlLoader.js +348 -0
  141. package/2D/xmlLoader.js.map +1 -0
  142. package/3D/behaviors/defaultBehavior.d.ts +73 -0
  143. package/3D/behaviors/defaultBehavior.js +103 -0
  144. package/3D/behaviors/defaultBehavior.js.map +1 -0
  145. package/3D/controls/MRTK3/touchHolographicButton.d.ts +220 -0
  146. package/3D/controls/MRTK3/touchHolographicButton.js +868 -0
  147. package/3D/controls/MRTK3/touchHolographicButton.js.map +1 -0
  148. package/3D/controls/abstractButton3D.d.ts +15 -0
  149. package/3D/controls/abstractButton3D.js +22 -0
  150. package/3D/controls/abstractButton3D.js.map +1 -0
  151. package/3D/controls/button3D.d.ts +51 -0
  152. package/3D/controls/button3D.js +98 -0
  153. package/3D/controls/button3D.js.map +1 -0
  154. package/3D/controls/container3D.d.ts +72 -0
  155. package/3D/controls/container3D.js +126 -0
  156. package/3D/controls/container3D.js.map +1 -0
  157. package/3D/controls/contentDisplay3D.d.ts +42 -0
  158. package/3D/controls/contentDisplay3D.js +81 -0
  159. package/3D/controls/contentDisplay3D.js.map +1 -0
  160. package/3D/controls/control3D.d.ts +183 -0
  161. package/3D/controls/control3D.js +401 -0
  162. package/3D/controls/control3D.js.map +1 -0
  163. package/3D/controls/cylinderPanel.d.ts +17 -0
  164. package/3D/controls/cylinderPanel.js +57 -0
  165. package/3D/controls/cylinderPanel.js.map +1 -0
  166. package/3D/controls/handMenu.d.ts +28 -0
  167. package/3D/controls/handMenu.js +39 -0
  168. package/3D/controls/handMenu.js.map +1 -0
  169. package/3D/controls/holographicBackplate.d.ts +49 -0
  170. package/3D/controls/holographicBackplate.js +104 -0
  171. package/3D/controls/holographicBackplate.js.map +1 -0
  172. package/3D/controls/holographicButton.d.ts +84 -0
  173. package/3D/controls/holographicButton.js +300 -0
  174. package/3D/controls/holographicButton.js.map +1 -0
  175. package/3D/controls/holographicSlate.d.ts +134 -0
  176. package/3D/controls/holographicSlate.js +413 -0
  177. package/3D/controls/holographicSlate.js.map +1 -0
  178. package/3D/controls/index.d.ts +22 -0
  179. package/3D/controls/index.js +24 -0
  180. package/3D/controls/index.js.map +1 -0
  181. package/3D/controls/meshButton3D.d.ts +21 -0
  182. package/3D/controls/meshButton3D.js +58 -0
  183. package/3D/controls/meshButton3D.js.map +1 -0
  184. package/3D/controls/nearMenu.d.ts +44 -0
  185. package/3D/controls/nearMenu.js +103 -0
  186. package/3D/controls/nearMenu.js.map +1 -0
  187. package/3D/controls/planePanel.d.ts +9 -0
  188. package/3D/controls/planePanel.js +30 -0
  189. package/3D/controls/planePanel.js.map +1 -0
  190. package/3D/controls/scatterPanel.d.ts +18 -0
  191. package/3D/controls/scatterPanel.js +98 -0
  192. package/3D/controls/scatterPanel.js.map +1 -0
  193. package/3D/controls/slider3D.d.ts +95 -0
  194. package/3D/controls/slider3D.js +256 -0
  195. package/3D/controls/slider3D.js.map +1 -0
  196. package/3D/controls/spherePanel.d.ts +17 -0
  197. package/3D/controls/spherePanel.js +58 -0
  198. package/3D/controls/spherePanel.js.map +1 -0
  199. package/3D/controls/stackPanel3D.d.ts +22 -0
  200. package/3D/controls/stackPanel3D.js +95 -0
  201. package/3D/controls/stackPanel3D.js.map +1 -0
  202. package/3D/controls/touchButton3D.d.ts +77 -0
  203. package/3D/controls/touchButton3D.js +205 -0
  204. package/3D/controls/touchButton3D.js.map +1 -0
  205. package/3D/controls/touchHolographicButton.d.ts +110 -0
  206. package/3D/controls/touchHolographicButton.js +400 -0
  207. package/3D/controls/touchHolographicButton.js.map +1 -0
  208. package/3D/controls/touchHolographicMenu.d.ts +61 -0
  209. package/3D/controls/touchHolographicMenu.js +139 -0
  210. package/3D/controls/touchHolographicMenu.js.map +1 -0
  211. package/3D/controls/touchMeshButton3D.d.ts +21 -0
  212. package/3D/controls/touchMeshButton3D.js +58 -0
  213. package/3D/controls/touchMeshButton3D.js.map +1 -0
  214. package/3D/controls/volumeBasedPanel.d.ts +53 -0
  215. package/3D/controls/volumeBasedPanel.js +158 -0
  216. package/3D/controls/volumeBasedPanel.js.map +1 -0
  217. package/3D/gizmos/gizmoHandle.d.ts +108 -0
  218. package/3D/gizmos/gizmoHandle.js +175 -0
  219. package/3D/gizmos/gizmoHandle.js.map +1 -0
  220. package/3D/gizmos/index.d.ts +2 -0
  221. package/3D/gizmos/index.js +3 -0
  222. package/3D/gizmos/index.js.map +1 -0
  223. package/3D/gizmos/slateGizmo.d.ts +57 -0
  224. package/3D/gizmos/slateGizmo.js +353 -0
  225. package/3D/gizmos/slateGizmo.js.map +1 -0
  226. package/3D/gui3DManager.d.ts +94 -0
  227. package/3D/gui3DManager.js +233 -0
  228. package/3D/gui3DManager.js.map +1 -0
  229. package/3D/index.d.ts +5 -0
  230. package/3D/index.js +7 -0
  231. package/3D/index.js.map +1 -0
  232. package/3D/materials/fluent/fluentMaterial.d.ts +91 -0
  233. package/3D/materials/fluent/fluentMaterial.js +286 -0
  234. package/3D/materials/fluent/fluentMaterial.js.map +1 -0
  235. package/3D/materials/fluent/index.d.ts +1 -0
  236. package/3D/materials/fluent/index.js +2 -0
  237. package/3D/materials/fluent/index.js.map +1 -0
  238. package/3D/materials/fluent/shaders/fluent.fragment.d.ts +5 -0
  239. package/3D/materials/fluent/shaders/fluent.fragment.js +41 -0
  240. package/3D/materials/fluent/shaders/fluent.fragment.js.map +1 -0
  241. package/3D/materials/fluent/shaders/fluent.vertex.d.ts +5 -0
  242. package/3D/materials/fluent/shaders/fluent.vertex.js +40 -0
  243. package/3D/materials/fluent/shaders/fluent.vertex.js.map +1 -0
  244. package/3D/materials/fluentBackplate/fluentBackplateMaterial.d.ts +155 -0
  245. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +466 -0
  246. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -0
  247. package/3D/materials/fluentBackplate/index.d.ts +1 -0
  248. package/3D/materials/fluentBackplate/index.js +2 -0
  249. package/3D/materials/fluentBackplate/index.js.map +1 -0
  250. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.d.ts +5 -0
  251. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js +60 -0
  252. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js.map +1 -0
  253. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.d.ts +5 -0
  254. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js +127 -0
  255. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js.map +1 -0
  256. package/3D/materials/fluentButton/fluentButtonMaterial.d.ts +190 -0
  257. package/3D/materials/fluentButton/fluentButtonMaterial.js +536 -0
  258. package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -0
  259. package/3D/materials/fluentButton/index.d.ts +1 -0
  260. package/3D/materials/fluentButton/index.js +2 -0
  261. package/3D/materials/fluentButton/index.js.map +1 -0
  262. package/3D/materials/fluentButton/shaders/fluentButton.fragment.d.ts +5 -0
  263. package/3D/materials/fluentButton/shaders/fluentButton.fragment.js +57 -0
  264. package/3D/materials/fluentButton/shaders/fluentButton.fragment.js.map +1 -0
  265. package/3D/materials/fluentButton/shaders/fluentButton.vertex.d.ts +5 -0
  266. package/3D/materials/fluentButton/shaders/fluentButton.vertex.js +162 -0
  267. package/3D/materials/fluentButton/shaders/fluentButton.vertex.js.map +1 -0
  268. package/3D/materials/fluentMaterial.d.ts +4 -0
  269. package/3D/materials/fluentMaterial.js +5 -0
  270. package/3D/materials/fluentMaterial.js.map +1 -0
  271. package/3D/materials/handle/handleMaterial.d.ts +68 -0
  272. package/3D/materials/handle/handleMaterial.js +114 -0
  273. package/3D/materials/handle/handleMaterial.js.map +1 -0
  274. package/3D/materials/handle/index.d.ts +1 -0
  275. package/3D/materials/handle/index.js +2 -0
  276. package/3D/materials/handle/index.js.map +1 -0
  277. package/3D/materials/handle/shaders/handle.fragment.d.ts +5 -0
  278. package/3D/materials/handle/shaders/handle.fragment.js +11 -0
  279. package/3D/materials/handle/shaders/handle.fragment.js.map +1 -0
  280. package/3D/materials/handle/shaders/handle.vertex.d.ts +5 -0
  281. package/3D/materials/handle/shaders/handle.vertex.js +11 -0
  282. package/3D/materials/handle/shaders/handle.vertex.js.map +1 -0
  283. package/3D/materials/index.d.ts +5 -0
  284. package/3D/materials/index.js +7 -0
  285. package/3D/materials/index.js.map +1 -0
  286. package/3D/materials/mrdl/index.d.ts +3 -0
  287. package/3D/materials/mrdl/index.js +4 -0
  288. package/3D/materials/mrdl/index.js.map +1 -0
  289. package/3D/materials/mrdl/mrdlBackglowMaterial.d.ts +87 -0
  290. package/3D/materials/mrdl/mrdlBackglowMaterial.js +302 -0
  291. package/3D/materials/mrdl/mrdlBackglowMaterial.js.map +1 -0
  292. package/3D/materials/mrdl/mrdlBackplateMaterial.d.ts +148 -0
  293. package/3D/materials/mrdl/mrdlBackplateMaterial.js +433 -0
  294. package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -0
  295. package/3D/materials/mrdl/mrdlFrontplateMaterial.d.ts +186 -0
  296. package/3D/materials/mrdl/mrdlFrontplateMaterial.js +532 -0
  297. package/3D/materials/mrdl/mrdlFrontplateMaterial.js.map +1 -0
  298. package/3D/materials/mrdl/mrdlInnerquadMaterial.d.ts +56 -0
  299. package/3D/materials/mrdl/mrdlInnerquadMaterial.js +230 -0
  300. package/3D/materials/mrdl/mrdlInnerquadMaterial.js.map +1 -0
  301. package/3D/materials/mrdl/mrdlSliderBarMaterial.d.ts +337 -0
  302. package/3D/materials/mrdl/mrdlSliderBarMaterial.js +855 -0
  303. package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -0
  304. package/3D/materials/mrdl/mrdlSliderThumbMaterial.d.ts +337 -0
  305. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +855 -0
  306. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -0
  307. package/3D/materials/mrdl/shaders/mrdlBackglow.fragment.d.ts +5 -0
  308. package/3D/materials/mrdl/shaders/mrdlBackglow.fragment.js +25 -0
  309. package/3D/materials/mrdl/shaders/mrdlBackglow.fragment.js.map +1 -0
  310. package/3D/materials/mrdl/shaders/mrdlBackglow.vertex.d.ts +5 -0
  311. package/3D/materials/mrdl/shaders/mrdlBackglow.vertex.js +12 -0
  312. package/3D/materials/mrdl/shaders/mrdlBackglow.vertex.js.map +1 -0
  313. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.d.ts +5 -0
  314. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js +88 -0
  315. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js.map +1 -0
  316. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.d.ts +5 -0
  317. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js +96 -0
  318. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js.map +1 -0
  319. package/3D/materials/mrdl/shaders/mrdlFrontplate.fragment.d.ts +5 -0
  320. package/3D/materials/mrdl/shaders/mrdlFrontplate.fragment.js +48 -0
  321. package/3D/materials/mrdl/shaders/mrdlFrontplate.fragment.js.map +1 -0
  322. package/3D/materials/mrdl/shaders/mrdlFrontplate.vertex.d.ts +5 -0
  323. package/3D/materials/mrdl/shaders/mrdlFrontplate.vertex.js +158 -0
  324. package/3D/materials/mrdl/shaders/mrdlFrontplate.vertex.js.map +1 -0
  325. package/3D/materials/mrdl/shaders/mrdlInnerquad.fragment.d.ts +5 -0
  326. package/3D/materials/mrdl/shaders/mrdlInnerquad.fragment.js +27 -0
  327. package/3D/materials/mrdl/shaders/mrdlInnerquad.fragment.js.map +1 -0
  328. package/3D/materials/mrdl/shaders/mrdlInnerquad.vertex.d.ts +5 -0
  329. package/3D/materials/mrdl/shaders/mrdlInnerquad.vertex.js +13 -0
  330. package/3D/materials/mrdl/shaders/mrdlInnerquad.vertex.js.map +1 -0
  331. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.d.ts +5 -0
  332. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js +236 -0
  333. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js.map +1 -0
  334. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.d.ts +5 -0
  335. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js +137 -0
  336. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js.map +1 -0
  337. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.d.ts +5 -0
  338. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js +236 -0
  339. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js.map +1 -0
  340. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.d.ts +5 -0
  341. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js +137 -0
  342. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js.map +1 -0
  343. package/3D/vector3WithInfo.d.ts +16 -0
  344. package/3D/vector3WithInfo.js +18 -0
  345. package/3D/vector3WithInfo.js.map +1 -0
  346. package/index.d.ts +2 -0
  347. package/index.js +4 -0
  348. package/index.js.map +1 -0
  349. package/legacy/legacy.d.ts +1 -0
  350. package/legacy/legacy.js +17 -0
  351. package/legacy/legacy.js.map +1 -0
  352. package/license.md +71 -0
  353. package/package.json +47 -0
  354. package/readme.md +31 -0
@@ -0,0 +1,670 @@
1
+ import { __decorate } from "@babylonjs/core/tslib.es6.js";
2
+ import { Observable } from "@babylonjs/core/Misc/observable.js";
3
+ import { ValueAndUnit } from "../valueAndUnit.js";
4
+ import { Control } from "./control.js";
5
+ import { RegisterClass } from "@babylonjs/core/Misc/typeStore.js";
6
+ import { serialize } from "@babylonjs/core/Misc/decorators.js";
7
+ import { EngineStore } from "@babylonjs/core/Engines/engineStore.js";
8
+ /**
9
+ * Enum that determines the text-wrapping mode to use.
10
+ */
11
+ export var TextWrapping;
12
+ (function (TextWrapping) {
13
+ /**
14
+ * Clip the text when it's larger than Control.width; this is the default mode.
15
+ */
16
+ TextWrapping[TextWrapping["Clip"] = 0] = "Clip";
17
+ /**
18
+ * Wrap the text word-wise, i.e. try to add line-breaks at word boundary to fit within Control.width.
19
+ */
20
+ TextWrapping[TextWrapping["WordWrap"] = 1] = "WordWrap";
21
+ /**
22
+ * Ellipsize the text, i.e. shrink with trailing … when text is larger than Control.width.
23
+ */
24
+ TextWrapping[TextWrapping["Ellipsis"] = 2] = "Ellipsis";
25
+ /**
26
+ * Wrap the text word-wise and clip the text when the text's height is larger than the Control.height, and shrink the last line with trailing … .
27
+ */
28
+ TextWrapping[TextWrapping["WordWrapEllipsis"] = 3] = "WordWrapEllipsis";
29
+ /**
30
+ * Use HTML to wrap the text. This is the only mode that supports east-asian languages.
31
+ */
32
+ TextWrapping[TextWrapping["HTML"] = 4] = "HTML";
33
+ })(TextWrapping || (TextWrapping = {}));
34
+ /**
35
+ * Class used to create text block control
36
+ */
37
+ export class TextBlock extends Control {
38
+ /**
39
+ * Return the line list (you may need to use the onLinesReadyObservable to make sure the list is ready)
40
+ */
41
+ get lines() {
42
+ return this._lines;
43
+ }
44
+ /**
45
+ * Gets or sets a boolean indicating that the TextBlock will be resized to fit its content
46
+
47
+ */
48
+ get resizeToFit() {
49
+ return this._resizeToFit;
50
+ }
51
+ /**
52
+ * Gets or sets a boolean indicating that the TextBlock will be resized to fit its content
53
+
54
+ */
55
+ set resizeToFit(value) {
56
+ if (this._resizeToFit === value) {
57
+ return;
58
+ }
59
+ this._resizeToFit = value;
60
+ if (this._resizeToFit) {
61
+ this._width.ignoreAdaptiveScaling = true;
62
+ this._height.ignoreAdaptiveScaling = true;
63
+ }
64
+ this._markAsDirty();
65
+ }
66
+ /**
67
+ * Gets or sets a boolean indicating if text must be wrapped
68
+ */
69
+ get textWrapping() {
70
+ return this._textWrapping;
71
+ }
72
+ /**
73
+ * Gets or sets a boolean indicating if text must be wrapped
74
+ */
75
+ set textWrapping(value) {
76
+ if (this._textWrapping === value) {
77
+ return;
78
+ }
79
+ this._textWrapping = +value;
80
+ this._markAsDirty();
81
+ }
82
+ /**
83
+ * Gets or sets text to display
84
+ */
85
+ get text() {
86
+ return this._text;
87
+ }
88
+ /**
89
+ * Gets or sets text to display
90
+ */
91
+ set text(value) {
92
+ if (this._text === value) {
93
+ return;
94
+ }
95
+ this._text = value + ""; // Making sure it is a text
96
+ this._markAsDirty();
97
+ this.onTextChangedObservable.notifyObservers(this);
98
+ }
99
+ /**
100
+ * Gets or sets text horizontal alignment (BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_CENTER by default)
101
+ */
102
+ get textHorizontalAlignment() {
103
+ return this._textHorizontalAlignment;
104
+ }
105
+ /**
106
+ * Gets or sets text horizontal alignment (BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_CENTER by default)
107
+ */
108
+ set textHorizontalAlignment(value) {
109
+ if (this._textHorizontalAlignment === value) {
110
+ return;
111
+ }
112
+ this._textHorizontalAlignment = value;
113
+ this._markAsDirty();
114
+ }
115
+ /**
116
+ * Gets or sets text vertical alignment (BABYLON.GUI.Control.VERTICAL_ALIGNMENT_CENTER by default)
117
+ */
118
+ get textVerticalAlignment() {
119
+ return this._textVerticalAlignment;
120
+ }
121
+ /**
122
+ * Gets or sets text vertical alignment (BABYLON.GUI.Control.VERTICAL_ALIGNMENT_CENTER by default)
123
+ */
124
+ set textVerticalAlignment(value) {
125
+ if (this._textVerticalAlignment === value) {
126
+ return;
127
+ }
128
+ this._textVerticalAlignment = value;
129
+ this._markAsDirty();
130
+ }
131
+ /**
132
+ * Gets or sets line spacing value
133
+ */
134
+ set lineSpacing(value) {
135
+ if (this._lineSpacing.fromString(value)) {
136
+ this._markAsDirty();
137
+ }
138
+ }
139
+ /**
140
+ * Gets or sets line spacing value
141
+ */
142
+ get lineSpacing() {
143
+ return this._lineSpacing.toString(this._host);
144
+ }
145
+ /**
146
+ * Gets or sets outlineWidth of the text to display
147
+ */
148
+ get outlineWidth() {
149
+ return this._outlineWidth;
150
+ }
151
+ /**
152
+ * Gets or sets outlineWidth of the text to display
153
+ */
154
+ set outlineWidth(value) {
155
+ if (this._outlineWidth === value) {
156
+ return;
157
+ }
158
+ this._outlineWidth = value;
159
+ this._markAsDirty();
160
+ }
161
+ /**
162
+ * Gets or sets a boolean indicating that text must have underline
163
+ */
164
+ get underline() {
165
+ return this._underline;
166
+ }
167
+ /**
168
+ * Gets or sets a boolean indicating that text must have underline
169
+ */
170
+ set underline(value) {
171
+ if (this._underline === value) {
172
+ return;
173
+ }
174
+ this._underline = value;
175
+ this._markAsDirty();
176
+ }
177
+ /**
178
+ * Gets or sets an boolean indicating that text must be crossed out
179
+ */
180
+ get lineThrough() {
181
+ return this._lineThrough;
182
+ }
183
+ /**
184
+ * Gets or sets an boolean indicating that text must be crossed out
185
+ */
186
+ set lineThrough(value) {
187
+ if (this._lineThrough === value) {
188
+ return;
189
+ }
190
+ this._lineThrough = value;
191
+ this._markAsDirty();
192
+ }
193
+ /**
194
+ * If the outline should be applied to the underline/strike-through too. Has different behavior in Edge/Chrome vs Firefox.
195
+ */
196
+ get applyOutlineToUnderline() {
197
+ return this._applyOutlineToUnderline;
198
+ }
199
+ set applyOutlineToUnderline(value) {
200
+ if (this._applyOutlineToUnderline === value) {
201
+ return;
202
+ }
203
+ this._applyOutlineToUnderline = value;
204
+ this._markAsDirty();
205
+ }
206
+ /**
207
+ * Gets or sets outlineColor of the text to display
208
+ */
209
+ get outlineColor() {
210
+ return this._outlineColor;
211
+ }
212
+ /**
213
+ * Gets or sets outlineColor of the text to display
214
+ */
215
+ set outlineColor(value) {
216
+ if (this._outlineColor === value) {
217
+ return;
218
+ }
219
+ this._outlineColor = value;
220
+ this._markAsDirty();
221
+ }
222
+ /**
223
+ * Gets or sets word divider
224
+ */
225
+ get wordDivider() {
226
+ return this._wordDivider;
227
+ }
228
+ /**
229
+ * Gets or sets word divider
230
+ */
231
+ set wordDivider(value) {
232
+ if (this._wordDivider === value) {
233
+ return;
234
+ }
235
+ this._wordDivider = value;
236
+ this._markAsDirty();
237
+ }
238
+ /**
239
+ * By default, if a text block has text wrapping other than Clip, its width
240
+ * is not resized even if resizeToFit = true. This parameter forces the width
241
+ * to be resized.
242
+ */
243
+ get forceResizeWidth() {
244
+ return this._forceResizeWidth;
245
+ }
246
+ set forceResizeWidth(value) {
247
+ if (this._forceResizeWidth === value) {
248
+ return;
249
+ }
250
+ this._forceResizeWidth = value;
251
+ this._markAsDirty();
252
+ }
253
+ /**
254
+ * Creates a new TextBlock object
255
+ * @param name defines the name of the control
256
+ * @param text defines the text to display (empty string by default)
257
+ */
258
+ constructor(
259
+ /**
260
+ * Defines the name of the control
261
+ */
262
+ name, text = "") {
263
+ super(name);
264
+ this.name = name;
265
+ this._text = "";
266
+ this._textWrapping = 0 /* TextWrapping.Clip */;
267
+ this._textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;
268
+ this._textVerticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;
269
+ this._resizeToFit = false;
270
+ this._lineSpacing = new ValueAndUnit(0);
271
+ this._outlineWidth = 0;
272
+ this._outlineColor = "white";
273
+ this._underline = false;
274
+ this._lineThrough = false;
275
+ this._wordDivider = " ";
276
+ this._forceResizeWidth = false;
277
+ this._applyOutlineToUnderline = false;
278
+ /**
279
+ * An event triggered after the text is changed
280
+ */
281
+ this.onTextChangedObservable = new Observable();
282
+ /**
283
+ * An event triggered after the text was broken up into lines
284
+ */
285
+ this.onLinesReadyObservable = new Observable();
286
+ /**
287
+ * Gets or sets a boolean indicating if the HTML element generated for word wrapping should be reused or removed after each wrapping.
288
+ */
289
+ this.reuseHTMLForWordWrapping = false;
290
+ this._linesTemp = [];
291
+ this._htmlElement = null;
292
+ this.text = text;
293
+ }
294
+ _getTypeName() {
295
+ return "TextBlock";
296
+ }
297
+ _processMeasures(parentMeasure, context) {
298
+ if (!this._fontOffset || this.isDirty) {
299
+ this._fontOffset = Control._GetFontOffset(context.font, this._host.getScene()?.getEngine());
300
+ }
301
+ super._processMeasures(parentMeasure, context);
302
+ // Prepare lines
303
+ this._lines = this._breakLines(this._currentMeasure.width, this._currentMeasure.height, context);
304
+ this.onLinesReadyObservable.notifyObservers(this);
305
+ let maxLineWidth = 0;
306
+ for (let i = 0; i < this._lines.length; i++) {
307
+ const line = this._lines[i];
308
+ if (line.width > maxLineWidth) {
309
+ maxLineWidth = line.width;
310
+ }
311
+ }
312
+ if (this._resizeToFit) {
313
+ if (this._textWrapping === 0 /* TextWrapping.Clip */ || this._forceResizeWidth) {
314
+ const newWidth = Math.ceil(this._paddingLeftInPixels) + Math.ceil(this._paddingRightInPixels) + Math.ceil(maxLineWidth);
315
+ if (newWidth !== this._width.getValueInPixel(this._host, this._tempParentMeasure.width)) {
316
+ this._width.updateInPlace(newWidth, ValueAndUnit.UNITMODE_PIXEL);
317
+ this._rebuildLayout = true;
318
+ }
319
+ }
320
+ let newHeight = (this._paddingTopInPixels + this._paddingBottomInPixels + this._fontOffset.height * this._lines.length) | 0;
321
+ if (this._lines.length > 0 && this._lineSpacing.internalValue !== 0) {
322
+ let lineSpacing = 0;
323
+ if (this._lineSpacing.isPixel) {
324
+ lineSpacing = this._lineSpacing.getValue(this._host);
325
+ }
326
+ else {
327
+ lineSpacing = this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);
328
+ }
329
+ newHeight += (this._lines.length - 1) * lineSpacing;
330
+ }
331
+ if (newHeight !== this._height.internalValue) {
332
+ this._height.updateInPlace(newHeight, ValueAndUnit.UNITMODE_PIXEL);
333
+ this._rebuildLayout = true;
334
+ }
335
+ }
336
+ }
337
+ _drawText(text, textWidth, y, context) {
338
+ const width = this._currentMeasure.width;
339
+ let x = 0;
340
+ switch (this._textHorizontalAlignment) {
341
+ case Control.HORIZONTAL_ALIGNMENT_LEFT:
342
+ x = 0;
343
+ break;
344
+ case Control.HORIZONTAL_ALIGNMENT_RIGHT:
345
+ x = width - textWidth;
346
+ break;
347
+ case Control.HORIZONTAL_ALIGNMENT_CENTER:
348
+ x = (width - textWidth) / 2;
349
+ break;
350
+ }
351
+ if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
352
+ context.shadowColor = this.shadowColor;
353
+ context.shadowBlur = this.shadowBlur;
354
+ context.shadowOffsetX = this.shadowOffsetX;
355
+ context.shadowOffsetY = this.shadowOffsetY;
356
+ }
357
+ if (this.outlineWidth) {
358
+ context.strokeText(text, this._currentMeasure.left + x, y);
359
+ }
360
+ context.fillText(text, this._currentMeasure.left + x, y);
361
+ if (this._underline) {
362
+ this._drawLine(this._currentMeasure.left + x, y + 3, this._currentMeasure.left + x + textWidth, y + 3, context);
363
+ }
364
+ if (this._lineThrough) {
365
+ this._drawLine(this._currentMeasure.left + x, y - this.fontSizeInPixels / 3, this._currentMeasure.left + x + textWidth, y - this.fontSizeInPixels / 3, context);
366
+ }
367
+ }
368
+ _drawLine(xFrom, yFrom, xTo, yTo, context) {
369
+ context.beginPath();
370
+ context.lineWidth = Math.round(this.fontSizeInPixels * 0.05);
371
+ context.moveTo(xFrom, yFrom);
372
+ context.lineTo(xTo, yTo);
373
+ if (this.outlineWidth && this.applyOutlineToUnderline) {
374
+ context.stroke();
375
+ context.fill();
376
+ }
377
+ else {
378
+ const currentStroke = context.strokeStyle;
379
+ context.strokeStyle = context.fillStyle;
380
+ context.stroke();
381
+ context.strokeStyle = currentStroke;
382
+ }
383
+ context.closePath();
384
+ }
385
+ /**
386
+ * @internal
387
+ */
388
+ _draw(context) {
389
+ context.save();
390
+ this._applyStates(context);
391
+ // Render lines
392
+ this._renderLines(context);
393
+ context.restore();
394
+ }
395
+ _applyStates(context) {
396
+ super._applyStates(context);
397
+ if (this.outlineWidth) {
398
+ context.lineWidth = this.outlineWidth;
399
+ context.strokeStyle = this.outlineColor;
400
+ context.lineJoin = "miter";
401
+ context.miterLimit = 2;
402
+ }
403
+ }
404
+ _breakLines(refWidth, refHeight, context) {
405
+ this._linesTemp.length = 0;
406
+ const _lines = this._textWrapping === 4 /* TextWrapping.HTML */ ? this._parseHTMLText(refWidth, refHeight, context) : this.text.split("\n");
407
+ switch (this._textWrapping) {
408
+ case 1 /* TextWrapping.WordWrap */:
409
+ for (const _line of _lines) {
410
+ this._linesTemp.push(...this._parseLineWordWrap(_line, refWidth, context));
411
+ }
412
+ break;
413
+ case 2 /* TextWrapping.Ellipsis */:
414
+ for (const _line of _lines) {
415
+ this._linesTemp.push(this._parseLineEllipsis(_line, refWidth, context));
416
+ }
417
+ break;
418
+ case 3 /* TextWrapping.WordWrapEllipsis */:
419
+ for (const _line of _lines) {
420
+ this._linesTemp.push(...this._parseLineWordWrapEllipsis(_line, refWidth, refHeight, context));
421
+ }
422
+ break;
423
+ case 4 /* TextWrapping.HTML */:
424
+ default:
425
+ for (const _line of _lines) {
426
+ this._linesTemp.push(this._parseLine(_line, context));
427
+ }
428
+ break;
429
+ }
430
+ return this._linesTemp;
431
+ }
432
+ _parseHTMLText(refWidth, refHeight, context) {
433
+ const lines = [];
434
+ if (!this._htmlElement) {
435
+ this._htmlElement = document.createElement("div");
436
+ document.body.appendChild(this._htmlElement);
437
+ }
438
+ const htmlElement = this._htmlElement;
439
+ htmlElement.textContent = this.text;
440
+ htmlElement.style.font = context.font;
441
+ htmlElement.style.position = "absolute";
442
+ htmlElement.style.visibility = "hidden";
443
+ htmlElement.style.top = "-1000px";
444
+ htmlElement.style.left = "-1000px";
445
+ this.adjustWordWrappingHTMLElement?.(htmlElement);
446
+ htmlElement.style.width = refWidth + "px";
447
+ htmlElement.style.height = refHeight + "px";
448
+ const textContent = htmlElement.textContent;
449
+ if (!textContent) {
450
+ return lines;
451
+ }
452
+ // get the text node
453
+ const textNode = htmlElement.childNodes[0];
454
+ const range = document.createRange();
455
+ let idx = 0;
456
+ for (const c of textContent) {
457
+ range.setStart(textNode, 0);
458
+ range.setEnd(textNode, idx + 1);
459
+ // "select" text from beginning to this position to determine the line
460
+ const lineIndex = range.getClientRects().length - 1;
461
+ lines[lineIndex] = (lines[lineIndex] || "") + c;
462
+ idx++;
463
+ }
464
+ if (!this.reuseHTMLForWordWrapping) {
465
+ htmlElement.remove();
466
+ this._htmlElement = null;
467
+ }
468
+ return lines;
469
+ }
470
+ _parseLine(line = "", context) {
471
+ return { text: line, width: this._getTextMetricsWidth(context.measureText(line)) };
472
+ }
473
+ //Calculate how many characters approximately we need to remove
474
+ _getCharsToRemove(lineWidth, width, lineLength) {
475
+ const diff = lineWidth > width ? lineWidth - width : 0;
476
+ // This isn't exact unless the font is monospaced
477
+ const charWidth = lineWidth / lineLength;
478
+ const removeChars = Math.max(Math.floor(diff / charWidth), 1);
479
+ return removeChars;
480
+ }
481
+ _parseLineEllipsis(line = "", width, context) {
482
+ let lineWidth = this._getTextMetricsWidth(context.measureText(line));
483
+ let removeChars = this._getCharsToRemove(lineWidth, width, line.length);
484
+ // unicode support. split('') does not work with unicode!
485
+ // make sure Array.from is available
486
+ const characters = Array.from && Array.from(line);
487
+ if (!characters) {
488
+ // no array.from, use the old method
489
+ while (line.length > 2 && lineWidth > width) {
490
+ line = line.slice(0, -removeChars);
491
+ lineWidth = this._getTextMetricsWidth(context.measureText(line + "…"));
492
+ removeChars = this._getCharsToRemove(lineWidth, width, line.length);
493
+ }
494
+ // Add on the end
495
+ line += "…";
496
+ }
497
+ else {
498
+ while (characters.length && lineWidth > width) {
499
+ characters.splice(characters.length - removeChars, removeChars);
500
+ line = `${characters.join("")}…`;
501
+ lineWidth = this._getTextMetricsWidth(context.measureText(line));
502
+ removeChars = this._getCharsToRemove(lineWidth, width, line.length);
503
+ }
504
+ }
505
+ return { text: line, width: lineWidth };
506
+ }
507
+ _getTextMetricsWidth(textMetrics) {
508
+ if (textMetrics.actualBoundingBoxLeft !== undefined) {
509
+ return Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);
510
+ }
511
+ return textMetrics.width;
512
+ }
513
+ _parseLineWordWrap(line = "", width, context) {
514
+ const lines = [];
515
+ const words = this.wordSplittingFunction ? this.wordSplittingFunction(line) : line.split(this._wordDivider);
516
+ let lineWidth = this._getTextMetricsWidth(context.measureText(line));
517
+ for (let n = 0; n < words.length; n++) {
518
+ const testLine = n > 0 ? line + this._wordDivider + words[n] : words[0];
519
+ const testWidth = this._getTextMetricsWidth(context.measureText(testLine));
520
+ if (testWidth > width && n > 0) {
521
+ lines.push({ text: line, width: lineWidth });
522
+ line = words[n];
523
+ lineWidth = this._getTextMetricsWidth(context.measureText(line));
524
+ }
525
+ else {
526
+ lineWidth = testWidth;
527
+ line = testLine;
528
+ }
529
+ }
530
+ lines.push({ text: line, width: lineWidth });
531
+ return lines;
532
+ }
533
+ _parseLineWordWrapEllipsis(line = "", width, height, context) {
534
+ const lines = this._parseLineWordWrap(line, width, context);
535
+ for (let n = 1; n <= lines.length; n++) {
536
+ const currentHeight = this._computeHeightForLinesOf(n);
537
+ if (currentHeight > height && n > 1) {
538
+ const lastLine = lines[n - 2];
539
+ const currentLine = lines[n - 1];
540
+ lines[n - 2] = this._parseLineEllipsis(lastLine.text + this._wordDivider + currentLine.text, width, context);
541
+ const linesToRemove = lines.length - n + 1;
542
+ for (let i = 0; i < linesToRemove; i++) {
543
+ lines.pop();
544
+ }
545
+ return lines;
546
+ }
547
+ }
548
+ return lines;
549
+ }
550
+ _renderLines(context) {
551
+ if (!this._fontOffset || !this._lines) {
552
+ return;
553
+ }
554
+ const height = this._currentMeasure.height;
555
+ let rootY = 0;
556
+ switch (this._textVerticalAlignment) {
557
+ case Control.VERTICAL_ALIGNMENT_TOP:
558
+ rootY = this._fontOffset.ascent;
559
+ break;
560
+ case Control.VERTICAL_ALIGNMENT_BOTTOM:
561
+ rootY = height - this._fontOffset.height * (this._lines.length - 1) - this._fontOffset.descent;
562
+ break;
563
+ case Control.VERTICAL_ALIGNMENT_CENTER:
564
+ rootY = this._fontOffset.ascent + (height - this._fontOffset.height * this._lines.length) / 2;
565
+ break;
566
+ }
567
+ rootY += this._currentMeasure.top;
568
+ for (let i = 0; i < this._lines.length; i++) {
569
+ const line = this._lines[i];
570
+ if (i !== 0 && this._lineSpacing.internalValue !== 0) {
571
+ if (this._lineSpacing.isPixel) {
572
+ rootY += this._lineSpacing.getValue(this._host);
573
+ }
574
+ else {
575
+ rootY = rootY + this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);
576
+ }
577
+ }
578
+ this._drawText(line.text, line.width, rootY, context);
579
+ rootY += this._fontOffset.height;
580
+ }
581
+ }
582
+ _computeHeightForLinesOf(lineCount) {
583
+ let newHeight = this._paddingTopInPixels + this._paddingBottomInPixels + this._fontOffset.height * lineCount;
584
+ if (lineCount > 0 && this._lineSpacing.internalValue !== 0) {
585
+ let lineSpacing = 0;
586
+ if (this._lineSpacing.isPixel) {
587
+ lineSpacing = this._lineSpacing.getValue(this._host);
588
+ }
589
+ else {
590
+ lineSpacing = this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);
591
+ }
592
+ newHeight += (lineCount - 1) * lineSpacing;
593
+ }
594
+ return newHeight;
595
+ }
596
+ isDimensionFullyDefined(dim) {
597
+ if (this.resizeToFit) {
598
+ return true;
599
+ }
600
+ return super.isDimensionFullyDefined(dim);
601
+ }
602
+ /**
603
+ * Given a width constraint applied on the text block, find the expected height
604
+ * @returns expected height
605
+ */
606
+ computeExpectedHeight() {
607
+ if (this.text && this.widthInPixels) {
608
+ // Should abstract platform instead of using LastCreatedEngine
609
+ const context = EngineStore.LastCreatedEngine?.createCanvas(0, 0).getContext("2d");
610
+ if (context) {
611
+ this._applyStates(context);
612
+ if (!this._fontOffset) {
613
+ this._fontOffset = Control._GetFontOffset(context.font, this._host.getScene()?.getEngine());
614
+ }
615
+ const lines = this._lines
616
+ ? this._lines
617
+ : this._breakLines(this.widthInPixels - this._paddingLeftInPixels - this._paddingRightInPixels, this.heightInPixels - this._paddingTopInPixels - this._paddingBottomInPixels, context);
618
+ return this._computeHeightForLinesOf(lines.length);
619
+ }
620
+ }
621
+ return 0;
622
+ }
623
+ dispose() {
624
+ super.dispose();
625
+ this.onTextChangedObservable.clear();
626
+ this._htmlElement?.remove();
627
+ this._htmlElement = null;
628
+ }
629
+ }
630
+ __decorate([
631
+ serialize()
632
+ ], TextBlock.prototype, "resizeToFit", null);
633
+ __decorate([
634
+ serialize()
635
+ ], TextBlock.prototype, "textWrapping", null);
636
+ __decorate([
637
+ serialize()
638
+ ], TextBlock.prototype, "text", null);
639
+ __decorate([
640
+ serialize()
641
+ ], TextBlock.prototype, "textHorizontalAlignment", null);
642
+ __decorate([
643
+ serialize()
644
+ ], TextBlock.prototype, "textVerticalAlignment", null);
645
+ __decorate([
646
+ serialize()
647
+ ], TextBlock.prototype, "lineSpacing", null);
648
+ __decorate([
649
+ serialize()
650
+ ], TextBlock.prototype, "outlineWidth", null);
651
+ __decorate([
652
+ serialize()
653
+ ], TextBlock.prototype, "underline", null);
654
+ __decorate([
655
+ serialize()
656
+ ], TextBlock.prototype, "lineThrough", null);
657
+ __decorate([
658
+ serialize()
659
+ ], TextBlock.prototype, "applyOutlineToUnderline", null);
660
+ __decorate([
661
+ serialize()
662
+ ], TextBlock.prototype, "outlineColor", null);
663
+ __decorate([
664
+ serialize()
665
+ ], TextBlock.prototype, "wordDivider", null);
666
+ __decorate([
667
+ serialize()
668
+ ], TextBlock.prototype, "forceResizeWidth", null);
669
+ RegisterClass("BABYLON.GUI.TextBlock", TextBlock);
670
+ //# sourceMappingURL=textBlock.js.map