@babylonjs/shared-ui-components 9.0.0 → 9.2.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 (353) hide show
  1. package/colorPicker/colorComponentEntry.d.ts +1 -1
  2. package/colorPicker/colorComponentEntry.js.map +1 -1
  3. package/colorPicker/colorPicker.d.ts +1 -1
  4. package/colorPicker/colorPicker.js.map +1 -1
  5. package/colorPicker/hexColor.d.ts +1 -1
  6. package/colorPicker/hexColor.js.map +1 -1
  7. package/components/Button.d.ts +1 -1
  8. package/components/Button.js.map +1 -1
  9. package/components/Label.d.ts +1 -1
  10. package/components/Label.js.map +1 -1
  11. package/components/bars/CommandBarComponent.d.ts +1 -1
  12. package/components/bars/CommandBarComponent.js.map +1 -1
  13. package/components/bars/CommandButton.module.scss +2 -0
  14. package/components/colorPicker/ColorComponentEntry.d.ts +1 -1
  15. package/components/colorPicker/ColorComponentEntry.js.map +1 -1
  16. package/components/colorPicker/ColorPicker.d.ts +1 -1
  17. package/components/colorPicker/ColorPicker.js.map +1 -1
  18. package/components/colorPicker/HexColor.d.ts +1 -1
  19. package/components/colorPicker/HexColor.js.map +1 -1
  20. package/components/layout/DraggableIcon.d.ts +2 -2
  21. package/components/layout/DraggableIcon.js.map +1 -1
  22. package/components/layout/FlexibleColumn.d.ts +1 -1
  23. package/components/layout/FlexibleColumn.js.map +1 -1
  24. package/components/layout/FlexibleDragHandler.d.ts +1 -1
  25. package/components/layout/FlexibleDragHandler.js.map +1 -1
  26. package/components/layout/FlexibleDropZone.d.ts +1 -1
  27. package/components/layout/FlexibleDropZone.js.map +1 -1
  28. package/components/layout/FlexibleGridContainer.d.ts +1 -1
  29. package/components/layout/FlexibleGridContainer.js.map +1 -1
  30. package/components/layout/FlexibleGridLayout.d.ts +2 -2
  31. package/components/layout/FlexibleGridLayout.js.map +1 -1
  32. package/components/layout/FlexibleResizeBar.d.ts +1 -1
  33. package/components/layout/FlexibleResizeBar.js.map +1 -1
  34. package/components/layout/FlexibleTab.d.ts +2 -2
  35. package/components/layout/FlexibleTab.js.map +1 -1
  36. package/components/layout/FlexibleTabsContainer.d.ts +2 -2
  37. package/components/layout/FlexibleTabsContainer.js.map +1 -1
  38. package/components/layout/LayoutContext.d.ts +1 -1
  39. package/components/layout/LayoutContext.js.map +1 -1
  40. package/components/layout/types.d.ts +1 -1
  41. package/components/layout/types.js.map +1 -1
  42. package/components/layout/utils.d.ts +1 -1
  43. package/components/layout/utils.js.map +1 -1
  44. package/components/lines/ColorPickerLineComponent.d.ts +2 -2
  45. package/components/lines/ColorPickerLineComponent.js.map +1 -1
  46. package/components/lines/NumericInputComponent.d.ts +1 -1
  47. package/components/lines/NumericInputComponent.js.map +1 -1
  48. package/components/lines/OptionsLineComponent.js.map +1 -1
  49. package/components/propertyTabComponentBase.d.ts +1 -1
  50. package/components/propertyTabComponentBase.js.map +1 -1
  51. package/components/reactGraphSystem/GraphConnectorHandle.d.ts +1 -1
  52. package/components/reactGraphSystem/GraphConnectorHandle.js.map +1 -1
  53. package/components/reactGraphSystem/GraphContainer.d.ts +1 -1
  54. package/components/reactGraphSystem/GraphContainer.js.map +1 -1
  55. package/components/reactGraphSystem/GraphLine.d.ts +1 -1
  56. package/components/reactGraphSystem/GraphLine.js.map +1 -1
  57. package/components/reactGraphSystem/GraphLinesContainer.d.ts +1 -1
  58. package/components/reactGraphSystem/GraphLinesContainer.js.map +1 -1
  59. package/components/reactGraphSystem/GraphNode.d.ts +1 -1
  60. package/components/reactGraphSystem/GraphNode.js.map +1 -1
  61. package/components/reactGraphSystem/GraphNodesContainer.d.ts +1 -1
  62. package/components/reactGraphSystem/GraphNodesContainer.js.map +1 -1
  63. package/components/reactGraphSystem/NodeRenderer.d.ts +2 -2
  64. package/components/reactGraphSystem/NodeRenderer.js.map +1 -1
  65. package/constToOptionsMaps.js.map +1 -1
  66. package/copyCommandToClipboard.js.map +1 -1
  67. package/fluent/hoc/buttonLine.d.ts +2 -2
  68. package/fluent/hoc/buttonLine.js.map +1 -1
  69. package/fluent/hoc/childWindow.d.ts +1 -1
  70. package/fluent/hoc/childWindow.js +1 -3
  71. package/fluent/hoc/childWindow.js.map +1 -1
  72. package/fluent/hoc/fileUploadLine.d.ts +2 -2
  73. package/fluent/hoc/fileUploadLine.js.map +1 -1
  74. package/fluent/hoc/fluentToolWrapper.d.ts +2 -2
  75. package/fluent/hoc/fluentToolWrapper.js.map +1 -1
  76. package/fluent/hoc/gradientList.d.ts +2 -2
  77. package/fluent/hoc/gradientList.js.map +1 -1
  78. package/fluent/hoc/pane.d.ts +2 -2
  79. package/fluent/hoc/pane.js.map +1 -1
  80. package/fluent/hoc/propertyLines/booleanBadgePropertyLine.d.ts +3 -3
  81. package/fluent/hoc/propertyLines/booleanBadgePropertyLine.js.map +1 -1
  82. package/fluent/hoc/propertyLines/checkboxPropertyLine.d.ts +3 -3
  83. package/fluent/hoc/propertyLines/checkboxPropertyLine.js.map +1 -1
  84. package/fluent/hoc/propertyLines/colorPropertyLine.d.ts +4 -5
  85. package/fluent/hoc/propertyLines/colorPropertyLine.js.map +1 -1
  86. package/fluent/hoc/propertyLines/comboBoxPropertyLine.d.ts +3 -3
  87. package/fluent/hoc/propertyLines/comboBoxPropertyLine.js.map +1 -1
  88. package/fluent/hoc/propertyLines/dropdownPropertyLine.d.ts +3 -3
  89. package/fluent/hoc/propertyLines/dropdownPropertyLine.js.map +1 -1
  90. package/fluent/hoc/propertyLines/entitySelectorPropertyLine.d.ts +12 -12
  91. package/fluent/hoc/propertyLines/entitySelectorPropertyLine.js.map +1 -1
  92. package/fluent/hoc/propertyLines/hexPropertyLine.d.ts +2 -2
  93. package/fluent/hoc/propertyLines/hexPropertyLine.js.map +1 -1
  94. package/fluent/hoc/propertyLines/inputPropertyLine.d.ts +4 -4
  95. package/fluent/hoc/propertyLines/inputPropertyLine.js.map +1 -1
  96. package/fluent/hoc/propertyLines/linkPropertyLine.d.ts +3 -3
  97. package/fluent/hoc/propertyLines/linkPropertyLine.js.map +1 -1
  98. package/fluent/hoc/propertyLines/propertyLine.d.ts +3 -3
  99. package/fluent/hoc/propertyLines/propertyLine.js +2 -4
  100. package/fluent/hoc/propertyLines/propertyLine.js.map +1 -1
  101. package/fluent/hoc/propertyLines/spinButtonPropertyLine.d.ts +3 -3
  102. package/fluent/hoc/propertyLines/spinButtonPropertyLine.js.map +1 -1
  103. package/fluent/hoc/propertyLines/stringifiedPropertyLine.d.ts +3 -3
  104. package/fluent/hoc/propertyLines/stringifiedPropertyLine.js.map +1 -1
  105. package/fluent/hoc/propertyLines/switchPropertyLine.d.ts +3 -3
  106. package/fluent/hoc/propertyLines/switchPropertyLine.js.map +1 -1
  107. package/fluent/hoc/propertyLines/syncedSliderPropertyLine.d.ts +2 -2
  108. package/fluent/hoc/propertyLines/syncedSliderPropertyLine.js.map +1 -1
  109. package/fluent/hoc/propertyLines/textAreaPropertyLine.d.ts +3 -3
  110. package/fluent/hoc/propertyLines/textAreaPropertyLine.js.map +1 -1
  111. package/fluent/hoc/propertyLines/textPropertyLine.d.ts +3 -3
  112. package/fluent/hoc/propertyLines/textPropertyLine.js.map +1 -1
  113. package/fluent/hoc/propertyLines/vectorPropertyLine.d.ts +4 -5
  114. package/fluent/hoc/propertyLines/vectorPropertyLine.js +2 -2
  115. package/fluent/hoc/propertyLines/vectorPropertyLine.js.map +1 -1
  116. package/fluent/hoc/textureUpload.d.ts +3 -3
  117. package/fluent/hoc/textureUpload.js.map +1 -1
  118. package/fluent/hooks/keyboardHooks.d.ts +1 -1
  119. package/fluent/hooks/keyboardHooks.js +1 -1
  120. package/fluent/hooks/keyboardHooks.js.map +1 -1
  121. package/fluent/primitives/accordion.contexts.d.ts +2 -2
  122. package/fluent/primitives/accordion.contexts.js.map +1 -1
  123. package/fluent/primitives/accordion.d.ts +1 -1
  124. package/fluent/primitives/accordion.js +1 -1
  125. package/fluent/primitives/accordion.js.map +1 -1
  126. package/fluent/primitives/button.d.ts +3 -3
  127. package/fluent/primitives/button.js.map +1 -1
  128. package/fluent/primitives/checkbox.d.ts +2 -2
  129. package/fluent/primitives/checkbox.js.map +1 -1
  130. package/fluent/primitives/clusteredLightContainerSelector.d.ts +5 -5
  131. package/fluent/primitives/clusteredLightContainerSelector.js.map +1 -1
  132. package/fluent/primitives/collapse.d.ts +1 -1
  133. package/fluent/primitives/collapse.js.map +1 -1
  134. package/fluent/primitives/colorPicker.d.ts +2 -2
  135. package/fluent/primitives/colorPicker.js +1 -1
  136. package/fluent/primitives/colorPicker.js.map +1 -1
  137. package/fluent/primitives/comboBox.d.ts +1 -1
  138. package/fluent/primitives/comboBox.js.map +1 -1
  139. package/fluent/primitives/contextMenu.d.ts +4 -4
  140. package/fluent/primitives/contextMenu.js +2 -2
  141. package/fluent/primitives/contextMenu.js.map +1 -1
  142. package/fluent/primitives/dropdown.d.ts +2 -2
  143. package/fluent/primitives/dropdown.js.map +1 -1
  144. package/fluent/primitives/entitySelector.d.ts +2 -2
  145. package/fluent/primitives/entitySelector.js +2 -6
  146. package/fluent/primitives/entitySelector.js.map +1 -1
  147. package/fluent/primitives/gradient.d.ts +2 -2
  148. package/fluent/primitives/gradient.js.map +1 -1
  149. package/fluent/primitives/infoLabel.d.ts +1 -1
  150. package/fluent/primitives/infoLabel.js.map +1 -1
  151. package/fluent/primitives/lazyComponent.d.ts +2 -2
  152. package/fluent/primitives/lazyComponent.js.map +1 -1
  153. package/fluent/primitives/link.d.ts +1 -1
  154. package/fluent/primitives/link.js.map +1 -1
  155. package/fluent/primitives/list.d.ts +1 -1
  156. package/fluent/primitives/list.js +1 -1
  157. package/fluent/primitives/list.js.map +1 -1
  158. package/fluent/primitives/materialSelector.d.ts +6 -6
  159. package/fluent/primitives/materialSelector.js.map +1 -1
  160. package/fluent/primitives/messageBar.d.ts +1 -1
  161. package/fluent/primitives/messageBar.js.map +1 -1
  162. package/fluent/primitives/nodeSelector.d.ts +6 -6
  163. package/fluent/primitives/nodeSelector.js.map +1 -1
  164. package/fluent/primitives/popover.d.ts +3 -3
  165. package/fluent/primitives/popover.js +1 -1
  166. package/fluent/primitives/popover.js.map +1 -1
  167. package/fluent/primitives/positionedPopover.d.ts +1 -1
  168. package/fluent/primitives/positionedPopover.js.map +1 -1
  169. package/fluent/primitives/primitive.d.ts +1 -1
  170. package/fluent/primitives/primitive.js.map +1 -1
  171. package/fluent/primitives/searchBar.js.map +1 -1
  172. package/fluent/primitives/searchBox.d.ts +1 -1
  173. package/fluent/primitives/searchBox.js.map +1 -1
  174. package/fluent/primitives/skeletonSelector.d.ts +6 -6
  175. package/fluent/primitives/skeletonSelector.js.map +1 -1
  176. package/fluent/primitives/slider.d.ts +2 -2
  177. package/fluent/primitives/slider.js.map +1 -1
  178. package/fluent/primitives/spinButton.d.ts +1 -1
  179. package/fluent/primitives/spinButton.js +5 -2
  180. package/fluent/primitives/spinButton.js.map +1 -1
  181. package/fluent/primitives/switch.d.ts +2 -2
  182. package/fluent/primitives/switch.js.map +1 -1
  183. package/fluent/primitives/syncedSlider.d.ts +2 -2
  184. package/fluent/primitives/syncedSlider.js +1 -1
  185. package/fluent/primitives/syncedSlider.js.map +1 -1
  186. package/fluent/primitives/textInput.d.ts +2 -2
  187. package/fluent/primitives/textInput.js.map +1 -1
  188. package/fluent/primitives/textarea.d.ts +2 -2
  189. package/fluent/primitives/textarea.js.map +1 -1
  190. package/fluent/primitives/textureSelector.d.ts +6 -6
  191. package/fluent/primitives/textureSelector.js +2 -2
  192. package/fluent/primitives/textureSelector.js.map +1 -1
  193. package/fluent/primitives/toast.d.ts +34 -3
  194. package/fluent/primitives/toast.js +9 -4
  195. package/fluent/primitives/toast.js.map +1 -1
  196. package/fluent/primitives/toggleButton.d.ts +3 -3
  197. package/fluent/primitives/toggleButton.js.map +1 -1
  198. package/fluent/primitives/tooltip.d.ts +2 -2
  199. package/fluent/primitives/tooltip.js.map +1 -1
  200. package/fluent/primitives/uploadButton.d.ts +2 -2
  201. package/fluent/primitives/uploadButton.js.map +1 -1
  202. package/fluent/primitives/utils.d.ts +2 -2
  203. package/fluent/primitives/utils.js.map +1 -1
  204. package/historyStack.d.ts +9 -1
  205. package/historyStack.js +15 -0
  206. package/historyStack.js.map +1 -1
  207. package/lines/booleanLineComponent.js +2 -2
  208. package/lines/checkBoxLineComponent.d.ts +3 -3
  209. package/lines/checkBoxLineComponent.js.map +1 -1
  210. package/lines/color3LineComponent.d.ts +3 -3
  211. package/lines/color3LineComponent.js.map +1 -1
  212. package/lines/color4LineComponent.d.ts +3 -3
  213. package/lines/color4LineComponent.js.map +1 -1
  214. package/lines/colorLineComponent.d.ts +3 -3
  215. package/lines/colorLineComponent.js.map +1 -1
  216. package/lines/colorPickerComponent.d.ts +2 -2
  217. package/lines/colorPickerComponent.js.map +1 -1
  218. package/lines/draggableLineComponent.d.ts +1 -1
  219. package/lines/draggableLineComponent.js.map +1 -1
  220. package/lines/fileButtonLineComponent.js +1 -1
  221. package/lines/floatLineComponent.d.ts +3 -3
  222. package/lines/floatLineComponent.js.map +1 -1
  223. package/lines/hexLineComponent.d.ts +3 -3
  224. package/lines/hexLineComponent.js.map +1 -1
  225. package/lines/lineContainerComponent.d.ts +1 -1
  226. package/lines/lineContainerComponent.js.map +1 -1
  227. package/lines/lineWithFileButtonComponent.js +1 -1
  228. package/lines/lineWithFileButtonComponent.js.map +1 -1
  229. package/lines/linkButtonComponent.d.ts +1 -1
  230. package/lines/linkButtonComponent.js.map +1 -1
  231. package/lines/matrixLineComponent.d.ts +4 -5
  232. package/lines/matrixLineComponent.js.map +1 -1
  233. package/lines/messageLineComponent.d.ts +1 -1
  234. package/lines/messageLineComponent.js.map +1 -1
  235. package/lines/numericInputComponent.d.ts +1 -1
  236. package/lines/numericInputComponent.js.map +1 -1
  237. package/lines/optionsLineComponent.d.ts +3 -3
  238. package/lines/optionsLineComponent.js.map +1 -1
  239. package/lines/radioLineComponent.d.ts +1 -1
  240. package/lines/radioLineComponent.js.map +1 -1
  241. package/lines/sliderLineComponent.d.ts +3 -3
  242. package/lines/sliderLineComponent.js.map +1 -1
  243. package/lines/targetsProxy.d.ts +2 -2
  244. package/lines/targetsProxy.js.map +1 -1
  245. package/lines/textInputLineComponent.d.ts +4 -5
  246. package/lines/textInputLineComponent.js.map +1 -1
  247. package/lines/textureButtonLineComponent.d.ts +2 -2
  248. package/lines/textureButtonLineComponent.js.map +1 -1
  249. package/lines/vector2LineComponent.d.ts +3 -3
  250. package/lines/vector2LineComponent.js.map +1 -1
  251. package/lines/vector3LineComponent.d.ts +3 -3
  252. package/lines/vector3LineComponent.js.map +1 -1
  253. package/lines/vector4LineComponent.d.ts +3 -3
  254. package/lines/vector4LineComponent.js.map +1 -1
  255. package/nodeGraphSystem/automaticProperties.d.ts +2 -2
  256. package/nodeGraphSystem/automaticProperties.js.map +1 -1
  257. package/nodeGraphSystem/common.module.scss +3 -0
  258. package/nodeGraphSystem/frameNodePort.d.ts +6 -6
  259. package/nodeGraphSystem/frameNodePort.js.map +1 -1
  260. package/nodeGraphSystem/graphCanvas.d.ts +43 -6
  261. package/nodeGraphSystem/graphCanvas.js +139 -6
  262. package/nodeGraphSystem/graphCanvas.js.map +1 -1
  263. package/nodeGraphSystem/graphFrame.d.ts +4 -4
  264. package/nodeGraphSystem/graphFrame.js.map +1 -1
  265. package/nodeGraphSystem/graphMinimap.d.ts +79 -0
  266. package/nodeGraphSystem/graphMinimap.js +319 -0
  267. package/nodeGraphSystem/graphMinimap.js.map +1 -0
  268. package/nodeGraphSystem/graphMinimap.module.scss +30 -0
  269. package/nodeGraphSystem/graphNode.d.ts +24 -8
  270. package/nodeGraphSystem/graphNode.js +76 -1
  271. package/nodeGraphSystem/graphNode.js.map +1 -1
  272. package/nodeGraphSystem/graphNode.module.scss +61 -0
  273. package/nodeGraphSystem/graphSearch.d.ts +54 -0
  274. package/nodeGraphSystem/graphSearch.js +181 -0
  275. package/nodeGraphSystem/graphSearch.js.map +1 -0
  276. package/nodeGraphSystem/graphSearch.module.scss +86 -0
  277. package/nodeGraphSystem/graphStickyNote.d.ts +94 -0
  278. package/nodeGraphSystem/graphStickyNote.js +310 -0
  279. package/nodeGraphSystem/graphStickyNote.js.map +1 -0
  280. package/nodeGraphSystem/graphStickyNote.module.scss +87 -0
  281. package/nodeGraphSystem/interfaces/displayManager.d.ts +4 -4
  282. package/nodeGraphSystem/interfaces/displayManager.js.map +1 -1
  283. package/nodeGraphSystem/interfaces/nodeContainer.d.ts +2 -2
  284. package/nodeGraphSystem/interfaces/nodeContainer.js.map +1 -1
  285. package/nodeGraphSystem/interfaces/nodeData.d.ts +4 -2
  286. package/nodeGraphSystem/interfaces/nodeData.js.map +1 -1
  287. package/nodeGraphSystem/interfaces/nodeLocationInfo.d.ts +10 -0
  288. package/nodeGraphSystem/interfaces/nodeLocationInfo.js.map +1 -1
  289. package/nodeGraphSystem/interfaces/portData.d.ts +4 -3
  290. package/nodeGraphSystem/interfaces/portData.js +1 -0
  291. package/nodeGraphSystem/interfaces/portData.js.map +1 -1
  292. package/nodeGraphSystem/interfaces/propertyComponentProps.d.ts +2 -2
  293. package/nodeGraphSystem/interfaces/propertyComponentProps.js.map +1 -1
  294. package/nodeGraphSystem/interfaces/selectionChangedOptions.d.ts +8 -7
  295. package/nodeGraphSystem/interfaces/selectionChangedOptions.js.map +1 -1
  296. package/nodeGraphSystem/nodeLink.d.ts +16 -4
  297. package/nodeGraphSystem/nodeLink.js +77 -0
  298. package/nodeGraphSystem/nodeLink.js.map +1 -1
  299. package/nodeGraphSystem/nodePort.d.ts +8 -8
  300. package/nodeGraphSystem/nodePort.js +26 -1
  301. package/nodeGraphSystem/nodePort.js.map +1 -1
  302. package/nodeGraphSystem/nodePort.module.scss +37 -0
  303. package/nodeGraphSystem/propertyLedger.d.ts +2 -2
  304. package/nodeGraphSystem/propertyLedger.js.map +1 -1
  305. package/nodeGraphSystem/searchBox.d.ts +1 -1
  306. package/nodeGraphSystem/searchBox.js.map +1 -1
  307. package/nodeGraphSystem/stateManager.d.ts +18 -12
  308. package/nodeGraphSystem/stateManager.js +6 -0
  309. package/nodeGraphSystem/stateManager.js.map +1 -1
  310. package/nodeGraphSystem/tools.d.ts +4 -4
  311. package/nodeGraphSystem/tools.js.map +1 -1
  312. package/nodeGraphSystem/typeLedger.d.ts +4 -4
  313. package/nodeGraphSystem/typeLedger.js.map +1 -1
  314. package/nodeGraphSystem/types/framePortData.d.ts +2 -2
  315. package/nodeGraphSystem/types/framePortData.js.map +1 -1
  316. package/package.json +3 -4
  317. package/split/splitContainer.d.ts +1 -1
  318. package/split/splitContainer.js +3 -2
  319. package/split/splitContainer.js.map +1 -1
  320. package/split/splitter.d.ts +1 -1
  321. package/split/splitter.js.map +1 -1
  322. package/tabs/propertyGrids/gui/checkboxPropertyGridComponent.d.ts +4 -4
  323. package/tabs/propertyGrids/gui/checkboxPropertyGridComponent.js.map +1 -1
  324. package/tabs/propertyGrids/gui/colorPickerPropertyGridComponent.d.ts +4 -4
  325. package/tabs/propertyGrids/gui/colorPickerPropertyGridComponent.js.map +1 -1
  326. package/tabs/propertyGrids/gui/commonControlPropertyGridComponent.d.ts +3 -3
  327. package/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js.map +1 -1
  328. package/tabs/propertyGrids/gui/controlPropertyGridComponent.d.ts +4 -4
  329. package/tabs/propertyGrids/gui/controlPropertyGridComponent.js.map +1 -1
  330. package/tabs/propertyGrids/gui/ellipsePropertyGridComponent.d.ts +4 -4
  331. package/tabs/propertyGrids/gui/ellipsePropertyGridComponent.js.map +1 -1
  332. package/tabs/propertyGrids/gui/gridPropertyGridComponent.d.ts +4 -4
  333. package/tabs/propertyGrids/gui/gridPropertyGridComponent.js.map +1 -1
  334. package/tabs/propertyGrids/gui/imageBasedSliderPropertyGridComponent.d.ts +4 -4
  335. package/tabs/propertyGrids/gui/imageBasedSliderPropertyGridComponent.js.map +1 -1
  336. package/tabs/propertyGrids/gui/imagePropertyGridComponent.d.ts +3 -3
  337. package/tabs/propertyGrids/gui/imagePropertyGridComponent.js.map +1 -1
  338. package/tabs/propertyGrids/gui/inputTextPropertyGridComponent.d.ts +4 -4
  339. package/tabs/propertyGrids/gui/inputTextPropertyGridComponent.js.map +1 -1
  340. package/tabs/propertyGrids/gui/linePropertyGridComponent.d.ts +4 -4
  341. package/tabs/propertyGrids/gui/linePropertyGridComponent.js.map +1 -1
  342. package/tabs/propertyGrids/gui/radioButtonPropertyGridComponent.d.ts +4 -4
  343. package/tabs/propertyGrids/gui/radioButtonPropertyGridComponent.js.map +1 -1
  344. package/tabs/propertyGrids/gui/rectanglePropertyGridComponent.d.ts +4 -4
  345. package/tabs/propertyGrids/gui/rectanglePropertyGridComponent.js.map +1 -1
  346. package/tabs/propertyGrids/gui/scrollViewerPropertyGridComponent.d.ts +4 -4
  347. package/tabs/propertyGrids/gui/scrollViewerPropertyGridComponent.js.map +1 -1
  348. package/tabs/propertyGrids/gui/sliderPropertyGridComponent.d.ts +4 -4
  349. package/tabs/propertyGrids/gui/sliderPropertyGridComponent.js.map +1 -1
  350. package/tabs/propertyGrids/gui/stackPanelPropertyGridComponent.d.ts +4 -4
  351. package/tabs/propertyGrids/gui/stackPanelPropertyGridComponent.js.map +1 -1
  352. package/tabs/propertyGrids/gui/textBlockPropertyGridComponent.d.ts +4 -4
  353. package/tabs/propertyGrids/gui/textBlockPropertyGridComponent.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"entitySelectorPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/entitySelectorPropertyLine.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,+BAA+B,EAAE,MAAM,kDAAkD,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAAoC,EAAE,EAAE,CAAC,KAAC,YAAY,OAAK,KAAK,EAAE,QAAQ,EAAE,KAAC,YAAY,OAAK,KAAK,GAAI,GAAI,CAAC;AACrJ,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAAwC,EAAE,EAAE,CAAC,KAAC,YAAY,OAAK,KAAK,EAAE,QAAQ,EAAE,KAAC,gBAAgB,OAAK,KAAK,GAAI,GAAI,CAAC;AACjK,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,KAAuC,EAAE,EAAE,CAAC,KAAC,YAAY,OAAK,KAAK,EAAE,QAAQ,EAAE,KAAC,eAAe,OAAK,KAAK,GAAI,GAAI,CAAC;AAC9J,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAAwC,EAAE,EAAE,CAAC,KAAC,YAAY,OAAK,KAAK,EAAE,QAAQ,EAAE,KAAC,gBAAgB,OAAK,KAAK,GAAI,GAAI,CAAC;AACjK,MAAM,CAAC,MAAM,2CAA2C,GAAG,CAAC,KAAuD,EAAE,EAAE,CAAC,CACpH,KAAC,YAAY,OAAK,KAAK,EAAE,QAAQ,EAAE,KAAC,+BAA+B,OAAK,KAAK,GAAI,GAAI,CACxF,CAAC","sourcesContent":["import type { Skeleton } from \"core/Bones/skeleton\";\r\nimport type { ClusteredLightContainer } from \"core/Lights/Clustered/clusteredLightContainer\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { Node } from \"core/node\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { ClusteredLightContainerSelectorProps } from \"../../primitives/clusteredLightContainerSelector\";\r\nimport type { MaterialSelectorProps } from \"../../primitives/materialSelector\";\r\nimport type { NodeSelectorProps } from \"../../primitives/nodeSelector\";\r\nimport type { SkeletonSelectorProps } from \"../../primitives/skeletonSelector\";\r\nimport type { TextureSelectorProps } from \"../../primitives/textureSelector\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\n\r\nimport { ClusteredLightContainerSelector } from \"../../primitives/clusteredLightContainerSelector\";\r\nimport { MaterialSelector } from \"../../primitives/materialSelector\";\r\nimport { NodeSelector } from \"../../primitives/nodeSelector\";\r\nimport { SkeletonSelector } from \"../../primitives/skeletonSelector\";\r\nimport { TextureSelector } from \"../../primitives/textureSelector\";\r\nimport { PropertyLine } from \"./propertyLine\";\r\n\r\ntype NodeSelectorPropertyLineProps = PropertyLineProps<Nullable<Node>> & NodeSelectorProps;\r\ntype MaterialSelectorPropertyLineProps = PropertyLineProps<Nullable<Material>> & MaterialSelectorProps;\r\ntype TextureSelectorPropertyLineProps = PropertyLineProps<Nullable<BaseTexture>> & TextureSelectorProps;\r\ntype SkeletonSelectorPropertyLineProps = PropertyLineProps<Nullable<Skeleton>> & SkeletonSelectorProps;\r\ntype ClusteredLightContainerSelectorPropertyLineProps = PropertyLineProps<Nullable<ClusteredLightContainer>> & ClusteredLightContainerSelectorProps;\r\n\r\nexport const NodeSelectorPropertyLine = (props: NodeSelectorPropertyLineProps) => <PropertyLine {...props} children={<NodeSelector {...props} />} />;\r\nexport const MaterialSelectorPropertyLine = (props: MaterialSelectorPropertyLineProps) => <PropertyLine {...props} children={<MaterialSelector {...props} />} />;\r\nexport const TextureSelectorPropertyLine = (props: TextureSelectorPropertyLineProps) => <PropertyLine {...props} children={<TextureSelector {...props} />} />;\r\nexport const SkeletonSelectorPropertyLine = (props: SkeletonSelectorPropertyLineProps) => <PropertyLine {...props} children={<SkeletonSelector {...props} />} />;\r\nexport const ClusteredLightContainerSelectorPropertyLine = (props: ClusteredLightContainerSelectorPropertyLineProps) => (\r\n <PropertyLine {...props} children={<ClusteredLightContainerSelector {...props} />} />\r\n);\r\n"]}
1
+ {"version":3,"file":"entitySelectorPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/entitySelectorPropertyLine.tsx"],"names":[],"mappings":";AAMA,OAAO,EAA6C,+BAA+B,EAAE,MAAM,kDAAkD,CAAC;AAC9I,OAAO,EAA8B,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACjG,OAAO,EAA0B,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACrF,OAAO,EAA8B,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACjG,OAAO,EAA6B,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAC9F,OAAO,EAA0B,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQtE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAAoC,EAAE,EAAE,CAAC,KAAC,YAAY,OAAK,KAAK,EAAE,QAAQ,EAAE,KAAC,YAAY,OAAK,KAAK,GAAI,GAAI,CAAC;AACrJ,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAAwC,EAAE,EAAE,CAAC,KAAC,YAAY,OAAK,KAAK,EAAE,QAAQ,EAAE,KAAC,gBAAgB,OAAK,KAAK,GAAI,GAAI,CAAC;AACjK,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,KAAuC,EAAE,EAAE,CAAC,KAAC,YAAY,OAAK,KAAK,EAAE,QAAQ,EAAE,KAAC,eAAe,OAAK,KAAK,GAAI,GAAI,CAAC;AAC9J,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAAwC,EAAE,EAAE,CAAC,KAAC,YAAY,OAAK,KAAK,EAAE,QAAQ,EAAE,KAAC,gBAAgB,OAAK,KAAK,GAAI,GAAI,CAAC;AACjK,MAAM,CAAC,MAAM,2CAA2C,GAAG,CAAC,KAAuD,EAAE,EAAE,CAAC,CACpH,KAAC,YAAY,OAAK,KAAK,EAAE,QAAQ,EAAE,KAAC,+BAA+B,OAAK,KAAK,GAAI,GAAI,CACxF,CAAC","sourcesContent":["import { type Skeleton } from \"core/Bones/skeleton\";\r\nimport { type ClusteredLightContainer } from \"core/Lights/Clustered/clusteredLightContainer\";\r\nimport { type Material } from \"core/Materials/material\";\r\nimport { type BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport { type Node } from \"core/node\";\r\nimport { type Nullable } from \"core/types\";\r\nimport { type ClusteredLightContainerSelectorProps, ClusteredLightContainerSelector } from \"../../primitives/clusteredLightContainerSelector\";\r\nimport { type MaterialSelectorProps, MaterialSelector } from \"../../primitives/materialSelector\";\r\nimport { type NodeSelectorProps, NodeSelector } from \"../../primitives/nodeSelector\";\r\nimport { type SkeletonSelectorProps, SkeletonSelector } from \"../../primitives/skeletonSelector\";\r\nimport { type TextureSelectorProps, TextureSelector } from \"../../primitives/textureSelector\";\r\nimport { type PropertyLineProps, PropertyLine } from \"./propertyLine\";\r\n\r\ntype NodeSelectorPropertyLineProps = PropertyLineProps<Nullable<Node>> & NodeSelectorProps;\r\ntype MaterialSelectorPropertyLineProps = PropertyLineProps<Nullable<Material>> & MaterialSelectorProps;\r\ntype TextureSelectorPropertyLineProps = PropertyLineProps<Nullable<BaseTexture>> & TextureSelectorProps;\r\ntype SkeletonSelectorPropertyLineProps = PropertyLineProps<Nullable<Skeleton>> & SkeletonSelectorProps;\r\ntype ClusteredLightContainerSelectorPropertyLineProps = PropertyLineProps<Nullable<ClusteredLightContainer>> & ClusteredLightContainerSelectorProps;\r\n\r\nexport const NodeSelectorPropertyLine = (props: NodeSelectorPropertyLineProps) => <PropertyLine {...props} children={<NodeSelector {...props} />} />;\r\nexport const MaterialSelectorPropertyLine = (props: MaterialSelectorPropertyLineProps) => <PropertyLine {...props} children={<MaterialSelector {...props} />} />;\r\nexport const TextureSelectorPropertyLine = (props: TextureSelectorPropertyLineProps) => <PropertyLine {...props} children={<TextureSelector {...props} />} />;\r\nexport const SkeletonSelectorPropertyLine = (props: SkeletonSelectorPropertyLineProps) => <PropertyLine {...props} children={<SkeletonSelector {...props} />} />;\r\nexport const ClusteredLightContainerSelectorPropertyLine = (props: ClusteredLightContainerSelectorPropertyLineProps) => (\r\n <PropertyLine {...props} children={<ClusteredLightContainerSelector {...props} />} />\r\n);\r\n"]}
@@ -1,5 +1,5 @@
1
- import type { FunctionComponent } from "react";
2
- import type { NumberInputPropertyLineProps } from "./inputPropertyLine.js";
1
+ import { type FunctionComponent } from "react";
2
+ import { type NumberInputPropertyLineProps } from "./inputPropertyLine.js";
3
3
  export type HexPropertyLineProps = NumberInputPropertyLineProps & {
4
4
  numBits?: 32 | 24 | 16 | 8;
5
5
  };
@@ -1 +1 @@
1
- {"version":3,"file":"hexPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/hexPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAMvD,MAAM,eAAe,GAAG,CAAC,WAAmB,EAAE,EAAE;IAC5C,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;QACtC,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;YACrC,WAAW,GAAG,IAAI,GAAG,WAAW,CAAC;QACrC,CAAC;aAAM,CAAC;YACJ,WAAW,GAAG,IAAI,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAClD,CAAC;IACL,CAAC;IAED,MAAM,WAAW,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC7C,IAAI,WAAW,IAAI,EAAE,IAAI,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,EAAE,CAAC;QACpE,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,IAAI,WAAW,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;I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,SAAS,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/D,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,SAAS,OAAK,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,kBAAkB,EAAE,IAAI,GAAI,GAC5G,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { PropertyLine } from \"./propertyLine\";\r\nimport { useEffect, useState } from \"react\";\r\nimport type { FunctionComponent } from \"react\";\r\nimport type { NumberInputPropertyLineProps } from \"./inputPropertyLine\";\r\nimport { TextInput } from \"../../primitives/textInput\";\r\n\r\nexport type HexPropertyLineProps = NumberInputPropertyLineProps & {\r\n numBits?: 32 | 24 | 16 | 8;\r\n};\r\n\r\nconst MaskValidatorFn = (valueString: string) => {\r\n if (valueString.substring(0, 2) != \"0x\") {\r\n if (valueString.substring(0, 1) != \"0\") {\r\n valueString = \"0x\" + valueString;\r\n } else {\r\n valueString = \"0x\" + valueString.substring(1);\r\n }\r\n }\r\n\r\n const valueSubstr = valueString.substring(2);\r\n if (valueSubstr != \"\" && /^[0-9A-Fa-f]+$/g.test(valueSubstr) == false) {\r\n return false;\r\n }\r\n\r\n if (valueString.length > 10) {\r\n return false;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nconst GetHexValFromNumber = (val: number, numBits?: number): string => {\r\n const numDigits = (numBits ?? 32) >> 2;\r\n let valueAsHex = val.toString(16);\r\n let hex0String = \"\";\r\n for (let i = 0; i < numDigits - valueAsHex.length; i++) {\r\n // padding the '0's\r\n hex0String = \"0\" + hex0String;\r\n }\r\n const finalHexValue = hex0String + valueAsHex;\r\n valueAsHex = \"0x\" + finalHexValue.substring(finalHexValue.length - numDigits);\r\n return valueAsHex;\r\n};\r\n\r\n/**\r\n * Takes a number representing a Hex value and converts it to a hex string then wraps the TextInput in a PropertyLine\r\n * @param props - PropertyLineProps\r\n * @returns property-line wrapped textbox that converts to/from hex number representation\r\n */\r\nexport const HexPropertyLine: FunctionComponent<HexPropertyLineProps> = (props) => {\r\n HexPropertyLine.displayName = \"HexPropertyLine\";\r\n const [hexVal, setHexVal] = useState(GetHexValFromNumber(props.value, props.numBits));\r\n\r\n const onStrValChange = (val: string) => {\r\n const numBits = props.numBits ?? 32;\r\n setHexVal(val);\r\n props.onChange(parseInt(val) & (2 ** numBits - 1));\r\n };\r\n\r\n useEffect(() => {\r\n setHexVal(GetHexValFromNumber(props.value, props.numBits));\r\n }, []);\r\n\r\n return (\r\n <PropertyLine {...props}>\r\n <TextInput {...props} validator={MaskValidatorFn} value={hexVal} onChange={onStrValChange} validateOnlyOnBlur={true} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"hexPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/hexPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAA0B,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAMvD,MAAM,eAAe,GAAG,CAAC,WAAmB,EAAE,EAAE;IAC5C,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;QACtC,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;YACrC,WAAW,GAAG,IAAI,GAAG,WAAW,CAAC;QACrC,CAAC;aAAM,CAAC;YACJ,WAAW,GAAG,IAAI,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAClD,CAAC;IACL,CAAC;IAED,MAAM,WAAW,GAAG,W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AAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC;QACpC,SAAS,CAAC,GAAG,CAAC,CAAC;QACf,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;IACvD,CAAC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACX,SAAS,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/D,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,SAAS,OAAK,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,kBAAkB,EAAE,IAAI,GAAI,GAC5G,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { PropertyLine } from \"./propertyLine\";\r\nimport { useEffect, useState, type FunctionComponent } from \"react\";\r\nimport { type NumberInputPropertyLineProps } from \"./inputPropertyLine\";\r\nimport { TextInput } from \"../../primitives/textInput\";\r\n\r\nexport type HexPropertyLineProps = NumberInputPropertyLineProps & {\r\n numBits?: 32 | 24 | 16 | 8;\r\n};\r\n\r\nconst MaskValidatorFn = (valueString: string) => {\r\n if (valueString.substring(0, 2) != \"0x\") {\r\n if (valueString.substring(0, 1) != \"0\") {\r\n valueString = \"0x\" + valueString;\r\n } else {\r\n valueString = \"0x\" + valueString.substring(1);\r\n }\r\n }\r\n\r\n const valueSubstr = valueString.substring(2);\r\n if (valueSubstr != \"\" && /^[0-9A-Fa-f]+$/g.test(valueSubstr) == false) {\r\n return false;\r\n }\r\n\r\n if (valueString.length > 10) {\r\n return false;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nconst GetHexValFromNumber = (val: number, numBits?: number): string => {\r\n const numDigits = (numBits ?? 32) >> 2;\r\n let valueAsHex = val.toString(16);\r\n let hex0String = \"\";\r\n for (let i = 0; i < numDigits - valueAsHex.length; i++) {\r\n // padding the '0's\r\n hex0String = \"0\" + hex0String;\r\n }\r\n const finalHexValue = hex0String + valueAsHex;\r\n valueAsHex = \"0x\" + finalHexValue.substring(finalHexValue.length - numDigits);\r\n return valueAsHex;\r\n};\r\n\r\n/**\r\n * Takes a number representing a Hex value and converts it to a hex string then wraps the TextInput in a PropertyLine\r\n * @param props - PropertyLineProps\r\n * @returns property-line wrapped textbox that converts to/from hex number representation\r\n */\r\nexport const HexPropertyLine: FunctionComponent<HexPropertyLineProps> = (props) => {\r\n HexPropertyLine.displayName = \"HexPropertyLine\";\r\n const [hexVal, setHexVal] = useState(GetHexValFromNumber(props.value, props.numBits));\r\n\r\n const onStrValChange = (val: string) => {\r\n const numBits = props.numBits ?? 32;\r\n setHexVal(val);\r\n props.onChange(parseInt(val) & (2 ** numBits - 1));\r\n };\r\n\r\n useEffect(() => {\r\n setHexVal(GetHexValFromNumber(props.value, props.numBits));\r\n }, []);\r\n\r\n return (\r\n <PropertyLine {...props}>\r\n <TextInput {...props} validator={MaskValidatorFn} value={hexVal} onChange={onStrValChange} validateOnlyOnBlur={true} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
@@ -1,7 +1,7 @@
1
- import type { PropertyLineProps } from "./propertyLine.js";
2
- import type { FunctionComponent } from "react";
3
- import type { TextInputProps } from "../../primitives/textInput.js";
4
- import type { SpinButtonProps } from "../../primitives/spinButton.js";
1
+ import { type PropertyLineProps } from "./propertyLine.js";
2
+ import { type FunctionComponent } from "react";
3
+ import { type TextInputProps } from "../../primitives/textInput.js";
4
+ import { type SpinButtonProps } from "../../primitives/spinButton.js";
5
5
  /**
6
6
  * Wraps a text input in a property line
7
7
  * @param props - PropertyLineProps and InputProps
@@ -1 +1 @@
1
- {"version":3,"file":"inputPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/inputPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,SAAS,GAAG,UAAU,CAAC;IACzB,YAAY,EAAE;QACV,GAAG,mBAAmB;KACzB;CACJ,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAkE,CAAC,KAAK,EAAE,EAAE;IAC1G,qBAAqB,CAAC,WAAW,GAAG,uBAAuB,CAAC;IAC5D,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;IAC5B,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,SAAS,OAAK,KAAK,EAAE,SAAS,EAAE,YAAY,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,GAAI,GAC7E,CAClB,CAAC;AACN,CAAC,CAAC;AAGF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAoD,CAAC,KAAK,EAAE,EAAE;IAC9F,uBAAuB,CAAC,WAAW,GAAG,yBAAyB,CAAC;IAChE,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;IAC5B,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,UAAU,OAAK,KAAK,EAAE,SAAS,EAAE,YAAY,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,GAAI,GAC9E,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { PropertyLine } from \"./propertyLine\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\nimport type { TextInputProps } from \"../../primitives/textInput\";\r\nimport { TextInput } from \"../../primitives/textInput\";\r\nimport type { SpinButtonProps } from \"../../primitives/spinButton\";\r\nimport { SpinButton } from \"../../primitives/spinButton\";\r\nimport { makeStyles, mergeClasses } from \"@fluentui/react-components\";\r\nimport { UniformWidthStyling } from \"../../primitives/utils\";\r\n\r\nconst useStyles = makeStyles({\r\n uniformWidth: {\r\n ...UniformWidthStyling,\r\n },\r\n});\r\n\r\n/**\r\n * Wraps a text input in a property line\r\n * @param props - PropertyLineProps and InputProps\r\n * @returns property-line wrapped input component\r\n */\r\nexport const TextInputPropertyLine: FunctionComponent<TextInputProps & PropertyLineProps<string>> = (props) => {\r\n TextInputPropertyLine.displayName = \"TextInputPropertyLine\";\r\n const classes = useStyles();\r\n return (\r\n <PropertyLine {...props}>\r\n <TextInput {...props} className={mergeClasses(classes.uniformWidth, props.className)} />\r\n </PropertyLine>\r\n );\r\n};\r\n\r\nexport type NumberInputPropertyLineProps = SpinButtonProps & PropertyLineProps<number>;\r\n/**\r\n * Wraps a number input in a property line\r\n * To force integer values, use forceInt param (this is distinct from the 'step' param, which will still allow submitting an integer value. forceInt will not)\r\n * @param props - PropertyLineProps and InputProps\r\n * @returns property-line wrapped input component\r\n */\r\nexport const NumberInputPropertyLine: FunctionComponent<NumberInputPropertyLineProps> = (props) => {\r\n NumberInputPropertyLine.displayName = \"NumberInputPropertyLine\";\r\n const classes = useStyles();\r\n return (\r\n <PropertyLine {...props}>\r\n <SpinButton {...props} className={mergeClasses(classes.uniformWidth, props.className)} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"inputPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/inputPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EAAuB,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAwB,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,SAAS,GAAG,UAAU,CAAC;IACzB,YAAY,EAAE;QACV,GAAG,mBAAmB;KACzB;CACJ,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAkE,CAAC,KAAK,EAAE,EAAE;IAC1G,qBAAqB,CAAC,WAAW,GAAG,uBAAuB,CAAC;IAC5D,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;IAC5B,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,SAAS,OAAK,KAAK,EAAE,SAAS,EAAE,YAAY,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,GAAI,GAC7E,CAClB,CAAC;AACN,CAAC,CAAC;AAGF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAoD,CAAC,KAAK,EAAE,EAAE;IAC9F,uBAAuB,CAAC,WAAW,GAAG,yBAAyB,CAAC;IAChE,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;IAC5B,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,UAAU,OAAK,KAAK,EAAE,SAAS,EAAE,YAAY,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,GAAI,GAC9E,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { PropertyLine, type PropertyLineProps } from \"./propertyLine\";\r\nimport { type FunctionComponent } from \"react\";\r\nimport { type TextInputProps, TextInput } from \"../../primitives/textInput\";\r\nimport { type SpinButtonProps, SpinButton } from \"../../primitives/spinButton\";\r\nimport { makeStyles, mergeClasses } from \"@fluentui/react-components\";\r\nimport { UniformWidthStyling } from \"../../primitives/utils\";\r\n\r\nconst useStyles = makeStyles({\r\n uniformWidth: {\r\n ...UniformWidthStyling,\r\n },\r\n});\r\n\r\n/**\r\n * Wraps a text input in a property line\r\n * @param props - PropertyLineProps and InputProps\r\n * @returns property-line wrapped input component\r\n */\r\nexport const TextInputPropertyLine: FunctionComponent<TextInputProps & PropertyLineProps<string>> = (props) => {\r\n TextInputPropertyLine.displayName = \"TextInputPropertyLine\";\r\n const classes = useStyles();\r\n return (\r\n <PropertyLine {...props}>\r\n <TextInput {...props} className={mergeClasses(classes.uniformWidth, props.className)} />\r\n </PropertyLine>\r\n );\r\n};\r\n\r\nexport type NumberInputPropertyLineProps = SpinButtonProps & PropertyLineProps<number>;\r\n/**\r\n * Wraps a number input in a property line\r\n * To force integer values, use forceInt param (this is distinct from the 'step' param, which will still allow submitting an integer value. forceInt will not)\r\n * @param props - PropertyLineProps and InputProps\r\n * @returns property-line wrapped input component\r\n */\r\nexport const NumberInputPropertyLine: FunctionComponent<NumberInputPropertyLineProps> = (props) => {\r\n NumberInputPropertyLine.displayName = \"NumberInputPropertyLine\";\r\n const classes = useStyles();\r\n return (\r\n <PropertyLine {...props}>\r\n <SpinButton {...props} className={mergeClasses(classes.uniformWidth, props.className)} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
@@ -1,6 +1,6 @@
1
- import type { LinkProps } from "../../primitives/link.js";
2
- import type { PropertyLineProps } from "./propertyLine.js";
3
- import type { FunctionComponent } from "react";
1
+ import { type PropertyLineProps } from "./propertyLine.js";
2
+ import { type LinkProps } from "../../primitives/link.js";
3
+ import { type FunctionComponent } from "react";
4
4
  /**
5
5
  * Wraps a link in a property line
6
6
  * @param props - PropertyLineProps and LinkProps
@@ -1 +1 @@
1
- {"version":3,"file":"linkPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/linkPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAK7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA6D,CAAC,KAAK,EAAE,EAAE;IAChG,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;IAClD,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,IAAI,OAAK,KAAK,GAAI,GACR,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { PropertyLine } from \"./propertyLine\";\r\nimport { Link } from \"../../primitives/link\";\r\nimport type { LinkProps } from \"../../primitives/link\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\n\r\n/**\r\n * Wraps a link in a property line\r\n * @param props - PropertyLineProps and LinkProps\r\n * @returns property-line wrapped link\r\n */\r\nexport const LinkPropertyLine: FunctionComponent<PropertyLineProps<string> & LinkProps> = (props) => {\r\n LinkPropertyLine.displayName = \"LinkPropertyLine\";\r\n return (\r\n <PropertyLine {...props}>\r\n <Link {...props} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"linkPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/linkPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAkB,MAAM,uBAAuB,CAAC;AAG7D;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA6D,CAAC,KAAK,EAAE,EAAE;IAChG,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;IAClD,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,IAAI,OAAK,KAAK,GAAI,GACR,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { PropertyLine, type PropertyLineProps } from \"./propertyLine\";\r\nimport { Link, type LinkProps } from \"../../primitives/link\";\r\nimport { type FunctionComponent } from \"react\";\r\n\r\n/**\r\n * Wraps a link in a property line\r\n * @param props - PropertyLineProps and LinkProps\r\n * @returns property-line wrapped link\r\n */\r\nexport const LinkPropertyLine: FunctionComponent<PropertyLineProps<string> & LinkProps> = (props) => {\r\n LinkPropertyLine.displayName = \"LinkPropertyLine\";\r\n return (\r\n <PropertyLine {...props}>\r\n <Link {...props} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
@@ -1,6 +1,6 @@
1
- import type { FunctionComponent, HTMLProps, PropsWithChildren } from "react";
2
- import type { AccordionSectionItemProps } from "../../primitives/accordion.js";
3
- import type { PrimitiveProps } from "../../primitives/primitive.js";
1
+ import { type FunctionComponent, type HTMLProps, type PropsWithChildren } from "react";
2
+ import { type AccordionSectionItemProps } from "../../primitives/accordion.js";
3
+ import { type PrimitiveProps } from "../../primitives/primitive.js";
4
4
  type BasePropertyLineProps = {
5
5
  /**
6
6
  * The name of the property to display in the property line.
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Body1, Checkbox, makeStyles, tokens, mergeClasses } from "@fluentui/react-components";
3
3
  import { ChevronCircleDown20Regular, ChevronCircleDown16Regular, ChevronCircleRight16Regular, ChevronCircleRight20Regular, CopyRegular, Copy16Regular, } from "@fluentui/react-icons";
4
+ import { useContext, useState, forwardRef, cloneElement, isValidElement, useRef, useCallback, } from "react";
4
5
  import { AccordionSectionItem } from "../../primitives/accordion.js";
5
- import { useContext, useState, forwardRef, cloneElement, isValidElement, useRef, useCallback } from "react";
6
6
  import { Collapse } from "../../primitives/collapse.js";
7
7
  import { copyCommandToClipboard } from "../../../copyCommandToClipboard.js";
8
8
  import { ToolContext } from "../fluentToolWrapper.js";
@@ -98,9 +98,7 @@ export const PropertyLine = forwardRef((props, ref) => {
98
98
  defaultValue: undefined, // Don't pass defaultValue to children as there is no guarantee how this will be used and we can't mix controlled + uncontrolled state
99
99
  })
100
100
  : children;
101
- return (_jsxs(LineContainer, { ref: ref, uniqueId: uniqueId ?? label, label: label, children: [_jsxs("div", { className: classes.baseLine, children: [_jsx(InfoLabel, { className: classes.infoLabel, htmlFor: "property", info: description, label: label, flexLabel: true, onContextMenu: onCopy ? handleContextMenu : undefined }), _jsxs("div", { className: classes.rightContent, id: "property", children: [expandedContent && (_jsx(ToggleButton, { title: "Expand/Collapse property", appearance: "transparent", checkedIcon: size === "small" ? ChevronCircleDown16Regular : ChevronCircleDown20Regular, uncheckedIcon: size === "small" ? ChevronCircleRight16Regular : ChevronCircleRight20Regular, value: expanded === true, onChange: setExpanded })), nullable && !ignoreNullable && (
102
- // If this is a nullableProperty and ignoreNullable was not sent, display a checkbox used to toggle null ('checked' means 'non null')
103
- _jsx(Tooltip, { content: props.value == null ? "Enable property" : "Disable property (set to null)", children: _jsx(Checkbox, { className: classes.checkbox, indicator: { className: classes.checkboxIndicator }, checked: !(props.value == null), onChange: (_, data) => {
101
+ return (_jsxs(LineContainer, { ref: ref, uniqueId: uniqueId ?? label, label: label, children: [_jsxs("div", { className: classes.baseLine, children: [_jsx(InfoLabel, { className: classes.infoLabel, htmlFor: "property", info: description, label: label, flexLabel: true, onContextMenu: onCopy ? handleContextMenu : undefined }), _jsxs("div", { className: classes.rightContent, id: "property", children: [expandedContent && (_jsx(ToggleButton, { title: "Expand/Collapse property", appearance: "transparent", checkedIcon: size === "small" ? ChevronCircleDown16Regular : ChevronCircleDown20Regular, uncheckedIcon: size === "small" ? ChevronCircleRight16Regular : ChevronCircleRight20Regular, value: expanded === true, onChange: setExpanded })), nullable && !ignoreNullable && (_jsx(Tooltip, { content: props.value == null ? "Enable property" : "Disable property (set to null)", children: _jsx(Checkbox, { className: classes.checkbox, indicator: { className: classes.checkboxIndicator }, checked: !(props.value == null), onChange: (_, data) => {
104
102
  if (data.checked) {
105
103
  // if checked this means we are returning to non-null, use cached value if exists. If no cached value, use default value
106
104
  cachedVal.current != null ? props.onChange(cachedVal.current) : props.onChange(props.defaultValue);
@@ -1 +1 @@
1
- {"version":3,"file":"property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AAmB,YAChC,KAAC,MAAM,IAAC,SAAS,EAAE,OAAO,CAAC,IAAI,EAAE,UAAU,EAAC,aAAa,EAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,EAAE,OAAO,EAAE,MAAM,GAAI,GAC7H,CACb,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAoE,CAAC,KAAK,EAAE,EAAE;IAC9G,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,KAAK,cAAE,KAAK,CAAC,KAAK,GAAS,GACjB,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Body1, Checkbox, makeStyles, tokens, mergeClasses } from \"@fluentui/react-components\";\r\nimport {\r\n ChevronCircleDown20Regular,\r\n ChevronCircleDown16Regular,\r\n ChevronCircleRight16Regular,\r\n ChevronCircleRight20Regular,\r\n CopyRegular,\r\n Copy16Regular,\r\n} from \"@fluentui/react-icons\";\r\nimport type { FunctionComponent, HTMLProps, PropsWithChildren, MouseEvent } from \"react\";\r\nimport type { AccordionSectionItemProps } from \"../../primitives/accordion\";\r\nimport { AccordionSectionItem } from \"../../primitives/accordion\";\r\nimport { useContext, useState, forwardRef, cloneElement, isValidElement, useRef, useCallback } from \"react\";\r\nimport { Collapse } from \"../../primitives/collapse\";\r\nimport { copyCommandToClipboard } from \"../../../copyCommandToClipboard\";\r\nimport { ToolContext } from \"../fluentToolWrapper\";\r\nimport type { PrimitiveProps } from \"../../primitives/primitive\";\r\nimport { Link } from \"../../primitives/link\";\r\nimport { ToggleButton } from \"../../primitives/toggleButton\";\r\nimport { Button } from \"../../primitives/button\";\r\nimport { CustomTokens, TokenMap } from \"../../primitives/utils\";\r\nimport { InfoLabel } from \"../../primitives/infoLabel\";\r\nimport { Tooltip } from \"../../primitives/tooltip\";\r\nimport { useToast } from \"../../primitives/toast\";\r\n\r\nconst usePropertyLineStyles = makeStyles({\r\n baseLine: {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"flex-start\",\r\n width: \"100%\",\r\n },\r\n infoLabel: {\r\n display: \"flex\",\r\n flex: \"1 1 0\", // grow=1, shrink =1, basis = 0 initial size before\r\n minWidth: CustomTokens.labelMinWidth,\r\n overflow: \"hidden\",\r\n textAlign: \"left\",\r\n },\r\n rightContent: {\r\n flex: \"0 1 auto\",\r\n minWidth: 0,\r\n overflow: \"hidden\",\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"flex-end\",\r\n },\r\n childWrapper: {\r\n minWidth: 0,\r\n overflow: \"hidden\",\r\n textOverflow: \"ellipsis\",\r\n whiteSpace: \"nowrap\",\r\n },\r\n infoPopup: {\r\n whiteSpace: \"normal\",\r\n wordBreak: \"break-word\",\r\n },\r\n copy: {\r\n marginRight: CustomTokens.rightAlignOffset, // Accounts for the padding baked into fluent button / ensures propertyLine looks visually aligned at the right\r\n },\r\n expandedContentDiv: {\r\n overflow: \"hidden\",\r\n paddingLeft: tokens.spacingHorizontalM,\r\n },\r\n checkbox: {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n marginRight: tokens.spacingHorizontalXS,\r\n },\r\n checkboxIndicator: {\r\n margin: TokenMap.px2,\r\n width: TokenMap.px12,\r\n height: TokenMap.px12,\r\n },\r\n});\r\n\r\ntype BasePropertyLineProps = {\r\n /**\r\n * The name of the property to display in the property line.\r\n */\r\n label: string;\r\n /**\r\n * The ID of the property line to be used when the label cannot be used as a persistent ID.\r\n *\r\n * Note that when a property line is used within an accordion section, this ID must be unique within that section in order\r\n * for property pinning and filtering to work correctly. If not, error will be shown in console.\r\n */\r\n uniqueId?: string;\r\n /**\r\n * Optional description for the property, shown on hover of the info icon\r\n */\r\n description?: string;\r\n /**\r\n * Optional function returning a string to copy to clipboard.\r\n */\r\n onCopy?: () => string;\r\n /**\r\n * Link to the documentation for this property, available from the info icon either linked from the description (if provided) or default 'docs' text\r\n */\r\n docLink?: string;\r\n};\r\n\r\n// Only require value/onChange/defaultValue props if nullable is true\r\ntype NullableProperty<ValueT> = {\r\n nullable: true;\r\n ignoreNullable: false;\r\n value: ValueT;\r\n onChange: (value: ValueT) => void;\r\n defaultValue?: ValueT;\r\n};\r\n\r\ntype IgnoreNullable<ValueT> = {\r\n ignoreNullable: true;\r\n nullable: false;\r\n value: ValueT;\r\n onChange: (value: ValueT) => void;\r\n defaultValue: ValueT;\r\n};\r\n\r\ntype NonNullableProperty = {\r\n nullable?: false;\r\n ignoreNullable?: false;\r\n};\r\n\r\n// Only expect optional expandByDefault prop if expandedContent is defined\r\ntype ExpandableProperty = {\r\n /**\r\n * If supplied, an 'expand' icon will be shown which, when clicked, renders this component within the property line.\r\n */\r\n expandedContent: JSX.Element;\r\n\r\n /**\r\n * If true, the expanded content will be shown by default.\r\n */\r\n expandByDefault?: boolean;\r\n};\r\n\r\n// If expanded content is undefined, don't expect expandByDefault prop\r\ntype NonExpandableProperty = {\r\n expandedContent?: undefined;\r\n};\r\n\r\nexport type PropertyLineProps<ValueT> = BasePropertyLineProps &\r\n (NullableProperty<ValueT> | NonNullableProperty | IgnoreNullable<ValueT>) &\r\n (ExpandableProperty | NonExpandableProperty);\r\n\r\n/**\r\n * A reusable component that renders a property line with a label and child content, and an optional description, copy button, and expandable section.\r\n *\r\n * @param props - The properties for the PropertyLine component.\r\n * @returns A React element representing the property line.\r\n *\r\n */\r\nexport const PropertyLine = forwardRef<HTMLDivElement, PropsWithChildren<PropertyLineProps<any>>>((props, ref) => {\r\n PropertyLine.displayName = \"PropertyLine\";\r\n const { size } = useContext(ToolContext);\r\n const classes = usePropertyLineStyles();\r\n const { label, uniqueId, onCopy, expandedContent, children, nullable, ignoreNullable } = props;\r\n\r\n const [expanded, setExpanded] = useState(\"expandByDefault\" in props ? props.expandByDefault : false);\r\n const cachedVal = useRef(nullable ? props.value : null);\r\n\r\n const { showToast } = useToast();\r\n\r\n const handleCopy = useCallback(() => {\r\n if (onCopy) {\r\n copyCommandToClipboard(onCopy());\r\n showToast(\"Copied property to clipboard\");\r\n }\r\n }, [onCopy, showToast]);\r\n\r\n const handleContextMenu = useCallback(\r\n (e: MouseEvent) => {\r\n e.preventDefault();\r\n handleCopy();\r\n },\r\n [handleCopy]\r\n );\r\n\r\n const description = props.docLink ? <Link url={props.docLink} value={props.description ?? \"Docs\"} /> : props.description ? <Body1>{props.description}</Body1> : undefined;\r\n\r\n // Process children to handle nullable state -- creating component in disabled state with default value in lieu of null value\r\n const processedChildren =\r\n (nullable || ignoreNullable) && isValidElement(children)\r\n ? cloneElement(children, {\r\n ...children.props,\r\n disabled: children.props.disabled || (nullable && props.value == null),\r\n value: props.value ?? props.defaultValue,\r\n defaultValue: undefined, // Don't pass defaultValue to children as there is no guarantee how this will be used and we can't mix controlled + uncontrolled state\r\n })\r\n : children;\r\n\r\n return (\r\n <LineContainer ref={ref} uniqueId={uniqueId ?? label} label={label}>\r\n <div className={classes.baseLine}>\r\n <InfoLabel className={classes.infoLabel} htmlFor=\"property\" info={description} label={label} flexLabel onContextMenu={onCopy ? handleContextMenu : undefined} />\r\n <div className={classes.rightContent} id=\"property\">\r\n {expandedContent && (\r\n <ToggleButton\r\n title=\"Expand/Collapse property\"\r\n appearance=\"transparent\"\r\n checkedIcon={size === \"small\" ? ChevronCircleDown16Regular : ChevronCircleDown20Regular}\r\n uncheckedIcon={size === \"small\" ? ChevronCircleRight16Regular : ChevronCircleRight20Regular}\r\n value={expanded === true}\r\n onChange={setExpanded}\r\n />\r\n )}\r\n\r\n {nullable && !ignoreNullable && (\r\n // If this is a nullableProperty and ignoreNullable was not sent, display a checkbox used to toggle null ('checked' means 'non null')\r\n <Tooltip content={props.value == null ? \"Enable property\" : \"Disable property (set to null)\"}>\r\n <Checkbox\r\n className={classes.checkbox}\r\n indicator={{ className: classes.checkboxIndicator }}\r\n checked={!(props.value == null)}\r\n onChange={(_, data) => {\r\n if (data.checked) {\r\n // if checked this means we are returning to non-null, use cached value if exists. If no cached value, use default value\r\n cachedVal.current != null ? props.onChange(cachedVal.current) : props.onChange(props.defaultValue);\r\n } else {\r\n // if moving to un-checked state, this means moving to null value. Cache the old value and tell props.onChange(null)\r\n cachedVal.current = props.value;\r\n props.onChange(null);\r\n }\r\n }}\r\n />\r\n </Tooltip>\r\n )}\r\n <div className={classes.childWrapper}>{processedChildren}</div>\r\n {onCopy && <CopyButton onCopy={handleCopy} />}\r\n </div>\r\n </div>\r\n {expandedContent && (\r\n <Collapse visible={!!expanded}>\r\n <div className={classes.expandedContentDiv}>{expandedContent}</div>\r\n </Collapse>\r\n )}\r\n </LineContainer>\r\n );\r\n});\r\n\r\nconst useLineStyles = makeStyles({\r\n container: {\r\n width: \"100%\",\r\n display: \"flex\",\r\n flexDirection: \"column\", // Stack line + expanded content\r\n minHeight: CustomTokens.lineHeight,\r\n boxSizing: \"border-box\",\r\n justifyContent: \"center\",\r\n paddingTop: tokens.spacingVerticalXXS,\r\n paddingBottom: tokens.spacingVerticalXXS,\r\n borderTop: `1px solid transparent`,\r\n borderBottom: `1px solid transparent`,\r\n \":hover\": {\r\n borderTopColor: tokens.colorNeutralStroke2,\r\n borderBottomColor: tokens.colorNeutralStroke2,\r\n },\r\n },\r\n containerSmall: {\r\n minHeight: CustomTokens.lineHeightSmall,\r\n },\r\n});\r\n\r\nexport const LineContainer = forwardRef<HTMLDivElement, PropsWithChildren<HTMLProps<HTMLDivElement> & AccordionSectionItemProps>>((props, ref) => {\r\n const { size } = useContext(ToolContext);\r\n const { children, uniqueId, label, ...rest } = props;\r\n const classes = useLineStyles();\r\n\r\n return (\r\n <AccordionSectionItem uniqueId={uniqueId} label={label}>\r\n <div ref={ref} className={mergeClasses(classes.container, size == \"small\" ? classes.containerSmall : undefined)} {...rest}>\r\n {children}\r\n </div>\r\n </AccordionSectionItem>\r\n );\r\n});\r\n\r\n/**\r\n * Copy button that reads ToolContext at its own position in the tree.\r\n * This allows AccordionSectionItem's ToolContext.Provider override (e.g. ctrl+hover) to control visibility.\r\n * @returns The copy button element.\r\n */\r\nconst CopyButton: FunctionComponent<{ onCopy: () => void }> = ({ onCopy }) => {\r\n const { disableCopy, size } = useContext(ToolContext);\r\n const classes = usePropertyLineStyles();\r\n\r\n if (disableCopy) {\r\n return null;\r\n }\r\n\r\n return (\r\n <Tooltip content=\"Copy to Clipboard\">\r\n <Button className={classes.copy} appearance=\"transparent\" icon={size === \"small\" ? Copy16Regular : CopyRegular} onClick={onCopy} />\r\n </Tooltip>\r\n );\r\n};\r\n\r\nexport const PlaceholderPropertyLine: FunctionComponent<PrimitiveProps<any> & PropertyLineProps<any>> = (props) => {\r\n return (\r\n <PropertyLine {...props}>\r\n <Body1>{props.value}</Body1>\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"propertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/propertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/F,OAAO,EACH,0BAA0B,EAC1B,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,WAAW,EACX,aAAa,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAKH,UAAU,EACV,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,cAAc,EACd,MAAM,EACN,WAAW,GACd,MAAM,OAAO,CAAC;AACf,OAAO,EAAkC,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,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AAO,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,KAAM,IAAI,YACpH,QAAQ,GACP,GACa,CAC1B,CAAC;AACN,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,GAA8C,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;IACzE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IAExC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,CACH,KAAC,OAAO,IAAC,OAAO,EAAC,mBAAmB,YAChC,KAAC,MAAM,IAAC,SAAS,EAAE,OAAO,CAAC,IAAI,EAAE,UAAU,EAAC,aAAa,EAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,EAAE,OAAO,EAAE,MAAM,GAAI,GAC7H,CACb,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAoE,CAAC,KAAK,EAAE,EAAE;IAC9G,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,KAAK,cAAE,KAAK,CAAC,KAAK,GAAS,GACjB,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Body1, Checkbox, makeStyles, tokens, mergeClasses } from \"@fluentui/react-components\";\r\nimport {\r\n ChevronCircleDown20Regular,\r\n ChevronCircleDown16Regular,\r\n ChevronCircleRight16Regular,\r\n ChevronCircleRight20Regular,\r\n CopyRegular,\r\n Copy16Regular,\r\n} from \"@fluentui/react-icons\";\r\nimport {\r\n type FunctionComponent,\r\n type HTMLProps,\r\n type PropsWithChildren,\r\n type MouseEvent,\r\n useContext,\r\n useState,\r\n forwardRef,\r\n cloneElement,\r\n isValidElement,\r\n useRef,\r\n useCallback,\r\n} from \"react\";\r\nimport { type AccordionSectionItemProps, AccordionSectionItem } from \"../../primitives/accordion\";\r\nimport { Collapse } from \"../../primitives/collapse\";\r\nimport { copyCommandToClipboard } from \"../../../copyCommandToClipboard\";\r\nimport { ToolContext } from \"../fluentToolWrapper\";\r\nimport { type PrimitiveProps } from \"../../primitives/primitive\";\r\nimport { Link } from \"../../primitives/link\";\r\nimport { ToggleButton } from \"../../primitives/toggleButton\";\r\nimport { Button } from \"../../primitives/button\";\r\nimport { CustomTokens, TokenMap } from \"../../primitives/utils\";\r\nimport { InfoLabel } from \"../../primitives/infoLabel\";\r\nimport { Tooltip } from \"../../primitives/tooltip\";\r\nimport { useToast } from \"../../primitives/toast\";\r\n\r\nconst usePropertyLineStyles = makeStyles({\r\n baseLine: {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"flex-start\",\r\n width: \"100%\",\r\n },\r\n infoLabel: {\r\n display: \"flex\",\r\n flex: \"1 1 0\", // grow=1, shrink =1, basis = 0 initial size before\r\n minWidth: CustomTokens.labelMinWidth,\r\n overflow: \"hidden\",\r\n textAlign: \"left\",\r\n },\r\n rightContent: {\r\n flex: \"0 1 auto\",\r\n minWidth: 0,\r\n overflow: \"hidden\",\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"flex-end\",\r\n },\r\n childWrapper: {\r\n minWidth: 0,\r\n overflow: \"hidden\",\r\n textOverflow: \"ellipsis\",\r\n whiteSpace: \"nowrap\",\r\n },\r\n infoPopup: {\r\n whiteSpace: \"normal\",\r\n wordBreak: \"break-word\",\r\n },\r\n copy: {\r\n marginRight: CustomTokens.rightAlignOffset, // Accounts for the padding baked into fluent button / ensures propertyLine looks visually aligned at the right\r\n },\r\n expandedContentDiv: {\r\n overflow: \"hidden\",\r\n paddingLeft: tokens.spacingHorizontalM,\r\n },\r\n checkbox: {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n marginRight: tokens.spacingHorizontalXS,\r\n },\r\n checkboxIndicator: {\r\n margin: TokenMap.px2,\r\n width: TokenMap.px12,\r\n height: TokenMap.px12,\r\n },\r\n});\r\n\r\ntype BasePropertyLineProps = {\r\n /**\r\n * The name of the property to display in the property line.\r\n */\r\n label: string;\r\n /**\r\n * The ID of the property line to be used when the label cannot be used as a persistent ID.\r\n *\r\n * Note that when a property line is used within an accordion section, this ID must be unique within that section in order\r\n * for property pinning and filtering to work correctly. If not, error will be shown in console.\r\n */\r\n uniqueId?: string;\r\n /**\r\n * Optional description for the property, shown on hover of the info icon\r\n */\r\n description?: string;\r\n /**\r\n * Optional function returning a string to copy to clipboard.\r\n */\r\n onCopy?: () => string;\r\n /**\r\n * Link to the documentation for this property, available from the info icon either linked from the description (if provided) or default 'docs' text\r\n */\r\n docLink?: string;\r\n};\r\n\r\n// Only require value/onChange/defaultValue props if nullable is true\r\ntype NullableProperty<ValueT> = {\r\n nullable: true;\r\n ignoreNullable: false;\r\n value: ValueT;\r\n onChange: (value: ValueT) => void;\r\n defaultValue?: ValueT;\r\n};\r\n\r\ntype IgnoreNullable<ValueT> = {\r\n ignoreNullable: true;\r\n nullable: false;\r\n value: ValueT;\r\n onChange: (value: ValueT) => void;\r\n defaultValue: ValueT;\r\n};\r\n\r\ntype NonNullableProperty = {\r\n nullable?: false;\r\n ignoreNullable?: false;\r\n};\r\n\r\n// Only expect optional expandByDefault prop if expandedContent is defined\r\ntype ExpandableProperty = {\r\n /**\r\n * If supplied, an 'expand' icon will be shown which, when clicked, renders this component within the property line.\r\n */\r\n expandedContent: JSX.Element;\r\n\r\n /**\r\n * If true, the expanded content will be shown by default.\r\n */\r\n expandByDefault?: boolean;\r\n};\r\n\r\n// If expanded content is undefined, don't expect expandByDefault prop\r\ntype NonExpandableProperty = {\r\n expandedContent?: undefined;\r\n};\r\n\r\nexport type PropertyLineProps<ValueT> = BasePropertyLineProps &\r\n (NullableProperty<ValueT> | NonNullableProperty | IgnoreNullable<ValueT>) &\r\n (ExpandableProperty | NonExpandableProperty);\r\n\r\n/**\r\n * A reusable component that renders a property line with a label and child content, and an optional description, copy button, and expandable section.\r\n *\r\n * @param props - The properties for the PropertyLine component.\r\n * @returns A React element representing the property line.\r\n *\r\n */\r\nexport const PropertyLine = forwardRef<HTMLDivElement, PropsWithChildren<PropertyLineProps<any>>>((props, ref) => {\r\n PropertyLine.displayName = \"PropertyLine\";\r\n const { size } = useContext(ToolContext);\r\n const classes = usePropertyLineStyles();\r\n const { label, uniqueId, onCopy, expandedContent, children, nullable, ignoreNullable } = props;\r\n\r\n const [expanded, setExpanded] = useState(\"expandByDefault\" in props ? props.expandByDefault : false);\r\n const cachedVal = useRef(nullable ? props.value : null);\r\n\r\n const { showToast } = useToast();\r\n\r\n const handleCopy = useCallback(() => {\r\n if (onCopy) {\r\n copyCommandToClipboard(onCopy());\r\n showToast(\"Copied property to clipboard\");\r\n }\r\n }, [onCopy, showToast]);\r\n\r\n const handleContextMenu = useCallback(\r\n (e: MouseEvent) => {\r\n e.preventDefault();\r\n handleCopy();\r\n },\r\n [handleCopy]\r\n );\r\n\r\n const description = props.docLink ? <Link url={props.docLink} value={props.description ?? \"Docs\"} /> : props.description ? <Body1>{props.description}</Body1> : undefined;\r\n\r\n // Process children to handle nullable state -- creating component in disabled state with default value in lieu of null value\r\n const processedChildren =\r\n (nullable || ignoreNullable) && isValidElement(children)\r\n ? cloneElement(children, {\r\n ...children.props,\r\n disabled: children.props.disabled || (nullable && props.value == null),\r\n value: props.value ?? props.defaultValue,\r\n defaultValue: undefined, // Don't pass defaultValue to children as there is no guarantee how this will be used and we can't mix controlled + uncontrolled state\r\n })\r\n : children;\r\n\r\n return (\r\n <LineContainer ref={ref} uniqueId={uniqueId ?? label} label={label}>\r\n <div className={classes.baseLine}>\r\n <InfoLabel className={classes.infoLabel} htmlFor=\"property\" info={description} label={label} flexLabel onContextMenu={onCopy ? handleContextMenu : undefined} />\r\n <div className={classes.rightContent} id=\"property\">\r\n {expandedContent && (\r\n <ToggleButton\r\n title=\"Expand/Collapse property\"\r\n appearance=\"transparent\"\r\n checkedIcon={size === \"small\" ? ChevronCircleDown16Regular : ChevronCircleDown20Regular}\r\n uncheckedIcon={size === \"small\" ? ChevronCircleRight16Regular : ChevronCircleRight20Regular}\r\n value={expanded === true}\r\n onChange={setExpanded}\r\n />\r\n )}\r\n\r\n {nullable && !ignoreNullable && (\r\n // If this is a nullableProperty and ignoreNullable was not sent, display a checkbox used to toggle null ('checked' means 'non null')\r\n <Tooltip content={props.value == null ? \"Enable property\" : \"Disable property (set to null)\"}>\r\n <Checkbox\r\n className={classes.checkbox}\r\n indicator={{ className: classes.checkboxIndicator }}\r\n checked={!(props.value == null)}\r\n onChange={(_, data) => {\r\n if (data.checked) {\r\n // if checked this means we are returning to non-null, use cached value if exists. If no cached value, use default value\r\n cachedVal.current != null ? props.onChange(cachedVal.current) : props.onChange(props.defaultValue);\r\n } else {\r\n // if moving to un-checked state, this means moving to null value. Cache the old value and tell props.onChange(null)\r\n cachedVal.current = props.value;\r\n props.onChange(null);\r\n }\r\n }}\r\n />\r\n </Tooltip>\r\n )}\r\n <div className={classes.childWrapper}>{processedChildren}</div>\r\n {onCopy && <CopyButton onCopy={handleCopy} />}\r\n </div>\r\n </div>\r\n {expandedContent && (\r\n <Collapse visible={!!expanded}>\r\n <div className={classes.expandedContentDiv}>{expandedContent}</div>\r\n </Collapse>\r\n )}\r\n </LineContainer>\r\n );\r\n});\r\n\r\nconst useLineStyles = makeStyles({\r\n container: {\r\n width: \"100%\",\r\n display: \"flex\",\r\n flexDirection: \"column\", // Stack line + expanded content\r\n minHeight: CustomTokens.lineHeight,\r\n boxSizing: \"border-box\",\r\n justifyContent: \"center\",\r\n paddingTop: tokens.spacingVerticalXXS,\r\n paddingBottom: tokens.spacingVerticalXXS,\r\n borderTop: `1px solid transparent`,\r\n borderBottom: `1px solid transparent`,\r\n \":hover\": {\r\n borderTopColor: tokens.colorNeutralStroke2,\r\n borderBottomColor: tokens.colorNeutralStroke2,\r\n },\r\n },\r\n containerSmall: {\r\n minHeight: CustomTokens.lineHeightSmall,\r\n },\r\n});\r\n\r\nexport const LineContainer = forwardRef<HTMLDivElement, PropsWithChildren<HTMLProps<HTMLDivElement> & AccordionSectionItemProps>>((props, ref) => {\r\n const { size } = useContext(ToolContext);\r\n const { children, uniqueId, label, ...rest } = props;\r\n const classes = useLineStyles();\r\n\r\n return (\r\n <AccordionSectionItem uniqueId={uniqueId} label={label}>\r\n <div ref={ref} className={mergeClasses(classes.container, size == \"small\" ? classes.containerSmall : undefined)} {...rest}>\r\n {children}\r\n </div>\r\n </AccordionSectionItem>\r\n );\r\n});\r\n\r\n/**\r\n * Copy button that reads ToolContext at its own position in the tree.\r\n * This allows AccordionSectionItem's ToolContext.Provider override (e.g. ctrl+hover) to control visibility.\r\n * @returns The copy button element.\r\n */\r\nconst CopyButton: FunctionComponent<{ onCopy: () => void }> = ({ onCopy }) => {\r\n const { disableCopy, size } = useContext(ToolContext);\r\n const classes = usePropertyLineStyles();\r\n\r\n if (disableCopy) {\r\n return null;\r\n }\r\n\r\n return (\r\n <Tooltip content=\"Copy to Clipboard\">\r\n <Button className={classes.copy} appearance=\"transparent\" icon={size === \"small\" ? Copy16Regular : CopyRegular} onClick={onCopy} />\r\n </Tooltip>\r\n );\r\n};\r\n\r\nexport const PlaceholderPropertyLine: FunctionComponent<PrimitiveProps<any> & PropertyLineProps<any>> = (props) => {\r\n return (\r\n <PropertyLine {...props}>\r\n <Body1>{props.value}</Body1>\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
@@ -1,4 +1,4 @@
1
- import type { PropertyLineProps } from "./propertyLine.js";
2
- import type { FunctionComponent } from "react";
3
- import type { SpinButtonProps } from "../../primitives/spinButton.js";
1
+ import { type PropertyLineProps } from "./propertyLine.js";
2
+ import { type FunctionComponent } from "react";
3
+ import { type SpinButtonProps } from "../../primitives/spinButton.js";
4
4
  export declare const SpinButtonPropertyLine: FunctionComponent<PropertyLineProps<number> & SpinButtonProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"spinButtonPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/spinButtonPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,SAAS,GAAG,UAAU,CAAC;IACzB,YAAY,EAAE;QACV,GAAG,mBAAmB;KACzB;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAmE,CAAC,KAAK,EAAE,EAAE;IAC5G,sBAAsB,CAAC,WAAW,GAAG,wBAAwB,CAAC;IAC9D,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;IAC5B,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,UAAU,OAAK,KAAK,EAAE,SAAS,EAAE,YAAY,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,GAAI,GAC9E,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { PropertyLine } from \"./propertyLine\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\nimport { SpinButton } from \"../../primitives/spinButton\";\r\nimport type { SpinButtonProps } from \"../../primitives/spinButton\";\r\nimport { makeStyles, mergeClasses } from \"@fluentui/react-components\";\r\nimport { UniformWidthStyling } from \"../../primitives/utils\";\r\n\r\nconst useStyles = makeStyles({\r\n uniformWidth: {\r\n ...UniformWidthStyling,\r\n },\r\n});\r\n\r\nexport const SpinButtonPropertyLine: FunctionComponent<PropertyLineProps<number> & SpinButtonProps> = (props) => {\r\n SpinButtonPropertyLine.displayName = \"SpinButtonPropertyLine\";\r\n const classes = useStyles();\r\n return (\r\n <PropertyLine {...props}>\r\n <SpinButton {...props} className={mergeClasses(classes.uniformWidth, props.className)} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"spinButtonPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/spinButtonPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAwB,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,SAAS,GAAG,UAAU,CAAC;IACzB,YAAY,EAAE;QACV,GAAG,mBAAmB;KACzB;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAmE,CAAC,KAAK,EAAE,EAAE;IAC5G,sBAAsB,CAAC,WAAW,GAAG,wBAAwB,CAAC;IAC9D,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;IAC5B,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,UAAU,OAAK,KAAK,EAAE,SAAS,EAAE,YAAY,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,GAAI,GAC9E,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { PropertyLine, type PropertyLineProps } from \"./propertyLine\";\r\nimport { type FunctionComponent } from \"react\";\r\nimport { SpinButton, type SpinButtonProps } from \"../../primitives/spinButton\";\r\nimport { makeStyles, mergeClasses } from \"@fluentui/react-components\";\r\nimport { UniformWidthStyling } from \"../../primitives/utils\";\r\n\r\nconst useStyles = makeStyles({\r\n uniformWidth: {\r\n ...UniformWidthStyling,\r\n },\r\n});\r\n\r\nexport const SpinButtonPropertyLine: FunctionComponent<PropertyLineProps<number> & SpinButtonProps> = (props) => {\r\n SpinButtonPropertyLine.displayName = \"SpinButtonPropertyLine\";\r\n const classes = useStyles();\r\n return (\r\n <PropertyLine {...props}>\r\n <SpinButton {...props} className={mergeClasses(classes.uniformWidth, props.className)} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
@@ -1,6 +1,6 @@
1
- import type { ImmutablePrimitiveProps } from "../../primitives/primitive.js";
2
- import type { PropertyLineProps } from "./propertyLine.js";
3
- import type { FunctionComponent } from "react";
1
+ import { type ImmutablePrimitiveProps } from "../../primitives/primitive.js";
2
+ import { type PropertyLineProps } from "./propertyLine.js";
3
+ import { type FunctionComponent } from "react";
4
4
  type StringifiedPropertyLineProps = PropertyLineProps<number> & ImmutablePrimitiveProps<number> & {
5
5
  precision?: number;
6
6
  units?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"stringifiedPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/stringifiedPropertyLine.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAQnD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAoD,CAAC,KAAK,EAAE,EAAE;IAC9F,uBAAuB,CAAC,WAAW,GAAG,yBAAyB,CAAC;IAChE,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,cAAc,EAAE,CAAC;IACpH,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IAClE,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,KAAK,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,YAAG,SAAS,IAAI,EAAE,GAAS,GACzC,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import type { ImmutablePrimitiveProps } from \"../../primitives/primitive\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport { PropertyLine } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\nimport { Body1 } from \"@fluentui/react-components\";\r\n\r\ntype StringifiedPropertyLineProps = PropertyLineProps<number> &\r\n ImmutablePrimitiveProps<number> & {\r\n precision?: number;\r\n units?: string;\r\n };\r\n\r\n/**\r\n * Expects a numerical value and converts it toFixed(if precision is supplied) or toLocaleString\r\n * Can pass optional units to be appending to the end of the string\r\n * @param props\r\n * @returns\r\n */\r\nexport const StringifiedPropertyLine: FunctionComponent<StringifiedPropertyLineProps> = (props) => {\r\n StringifiedPropertyLine.displayName = \"StringifiedPropertyLine\";\r\n const value = props.precision !== undefined ? props.value?.toFixed(props.precision) : props.value?.toLocaleString();\r\n const withUnits = props.units ? `${value} ${props.units}` : value;\r\n return (\r\n <PropertyLine {...props}>\r\n <Body1 title={props.title}>{withUnits ?? \"\"}</Body1>\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"stringifiedPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/stringifiedPropertyLine.tsx"],"names":[],"mappings":";AACA,OAAO,EAA0B,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAQnD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAoD,CAAC,KAAK,EAAE,EAAE;IAC9F,uBAAuB,CAAC,WAAW,GAAG,yBAAyB,CAAC;IAChE,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,cAAc,EAAE,CAAC;IACpH,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IAClE,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,KAAK,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,YAAG,SAAS,IAAI,EAAE,GAAS,GACzC,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { type ImmutablePrimitiveProps } from \"../../primitives/primitive\";\r\nimport { type PropertyLineProps, PropertyLine } from \"./propertyLine\";\r\nimport { type FunctionComponent } from \"react\";\r\nimport { Body1 } from \"@fluentui/react-components\";\r\n\r\ntype StringifiedPropertyLineProps = PropertyLineProps<number> &\r\n ImmutablePrimitiveProps<number> & {\r\n precision?: number;\r\n units?: string;\r\n };\r\n\r\n/**\r\n * Expects a numerical value and converts it toFixed(if precision is supplied) or toLocaleString\r\n * Can pass optional units to be appending to the end of the string\r\n * @param props\r\n * @returns\r\n */\r\nexport const StringifiedPropertyLine: FunctionComponent<StringifiedPropertyLineProps> = (props) => {\r\n StringifiedPropertyLine.displayName = \"StringifiedPropertyLine\";\r\n const value = props.precision !== undefined ? props.value?.toFixed(props.precision) : props.value?.toLocaleString();\r\n const withUnits = props.units ? `${value} ${props.units}` : value;\r\n return (\r\n <PropertyLine {...props}>\r\n <Body1 title={props.title}>{withUnits ?? \"\"}</Body1>\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
@@ -1,6 +1,6 @@
1
- import type { PropertyLineProps } from "./propertyLine.js";
2
- import type { FunctionComponent } from "react";
3
- import type { SwitchProps } from "../../primitives/switch.js";
1
+ import { type PropertyLineProps } from "./propertyLine.js";
2
+ import { type FunctionComponent } from "react";
3
+ import { type SwitchProps } from "../../primitives/switch.js";
4
4
  /**
5
5
  * Wraps a switch in a property line
6
6
  * @param props - The properties for the switch and property line
@@ -1 +1 @@
1
- {"version":3,"file":"switchPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/switchPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAgE,CAAC,KAAK,EAAE,EAAE;IACrG,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC;IACtD,6DAA6D;IAC7D,MAAM,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;IACxC,8FAA8F;IAC9F,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,MAAM,OAAK,WAAW,GAAI,GAChB,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { PropertyLine } from \"./propertyLine\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\nimport { Switch } from \"../../primitives/switch\";\r\nimport type { SwitchProps } from \"../../primitives/switch\";\r\n\r\n/**\r\n * Wraps a switch in a property line\r\n * @param props - The properties for the switch and property line\r\n * @returns A React element representing the property line with a switch\r\n */\r\nexport const SwitchPropertyLine: FunctionComponent<PropertyLineProps<boolean> & SwitchProps> = (props) => {\r\n SwitchPropertyLine.displayName = \"SwitchPropertyLine\";\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { label, ...switchProps } = props;\r\n // Ensure the label gets passed to the PropertyLine component and not to the underlying switch\r\n return (\r\n <PropertyLine {...props}>\r\n <Switch {...switchProps} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"switchPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/switchPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EAAE,MAAM,EAAoB,MAAM,yBAAyB,CAAC;AAEnE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAgE,CAAC,KAAK,EAAE,EAAE;IACrG,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC;IACtD,6DAA6D;IAC7D,MAAM,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;IACxC,8FAA8F;IAC9F,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,MAAM,OAAK,WAAW,GAAI,GAChB,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { PropertyLine, type PropertyLineProps } from \"./propertyLine\";\r\nimport { type FunctionComponent } from \"react\";\r\nimport { Switch, type SwitchProps } from \"../../primitives/switch\";\r\n\r\n/**\r\n * Wraps a switch in a property line\r\n * @param props - The properties for the switch and property line\r\n * @returns A React element representing the property line with a switch\r\n */\r\nexport const SwitchPropertyLine: FunctionComponent<PropertyLineProps<boolean> & SwitchProps> = (props) => {\r\n SwitchPropertyLine.displayName = \"SwitchPropertyLine\";\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { label, ...switchProps } = props;\r\n // Ensure the label gets passed to the PropertyLine component and not to the underlying switch\r\n return (\r\n <PropertyLine {...props}>\r\n <Switch {...switchProps} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
@@ -1,5 +1,5 @@
1
- import type { PropertyLineProps } from "./propertyLine.js";
2
- import type { SyncedSliderProps } from "../../primitives/syncedSlider.js";
1
+ import { type PropertyLineProps } from "./propertyLine.js";
2
+ import { type SyncedSliderProps } from "../../primitives/syncedSlider.js";
3
3
  type SyncedSliderPropertyProps = SyncedSliderProps & PropertyLineProps<number>;
4
4
  /**
5
5
  * Renders a simple wrapper around the SyncedSliderInput
@@ -1 +1 @@
1
- {"version":3,"file":"syncedSliderPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/syncedSliderPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,SAAS,GAAG,UAAU,CAAC;IACzB,YAAY,EAAE;QACV,GAAG,mBAAmB;KACzB;CACJ,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,UAAU,CAA4C,CAAC,KAAK,EAAE,GAAG,EAAsB,EAAE;IAC7H,wBAAwB,CAAC,WAAW,GAAG,0BAA0B,CAAC;IAClE,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;IAC5B,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;IACrD,OAAO,CACH,KAAC,YAAY,IAAC,GAAG,EAAE,GAAG,KAAM,KAAK,YAC7B,KAAC,iBAAiB,OAAK,WAAW,EAAE,SAAS,EAAE,YAAY,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,GAAI,GAC3F,CAClB,CAAC;AACN,CAAC,CAAC,CAAC","sourcesContent":["import { PropertyLine } from \"./propertyLine\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport { SyncedSliderInput } from \"../../primitives/syncedSlider\";\r\nimport type { SyncedSliderProps } from \"../../primitives/syncedSlider\";\r\nimport { forwardRef } from \"react\";\r\nimport { makeStyles, mergeClasses } from \"@fluentui/react-components\";\r\nimport { UniformWidthStyling } from \"../../primitives/utils\";\r\n\r\nconst useStyles = makeStyles({\r\n uniformWidth: {\r\n ...UniformWidthStyling,\r\n },\r\n});\r\n\r\ntype SyncedSliderPropertyProps = SyncedSliderProps & PropertyLineProps<number>;\r\n/**\r\n * Renders a simple wrapper around the SyncedSliderInput\r\n * @param props\r\n * @returns\r\n */\r\nexport const SyncedSliderPropertyLine = forwardRef<HTMLDivElement, SyncedSliderPropertyProps>((props, ref): React.ReactElement => {\r\n SyncedSliderPropertyLine.displayName = \"SyncedSliderPropertyLine\";\r\n const classes = useStyles();\r\n const { label, description, ...sliderProps } = props;\r\n return (\r\n <PropertyLine ref={ref} {...props}>\r\n <SyncedSliderInput {...sliderProps} className={mergeClasses(classes.uniformWidth, props.className)} />\r\n </PropertyLine>\r\n );\r\n});\r\n"]}
1
+ {"version":3,"file":"syncedSliderPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/syncedSliderPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAA0B,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,SAAS,GAAG,UAAU,CAAC;IACzB,YAAY,EAAE;QACV,GAAG,mBAAmB;KACzB;CACJ,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,UAAU,CAA4C,CAAC,KAAK,EAAE,GAAG,EAAsB,EAAE;IAC7H,wBAAwB,CAAC,WAAW,GAAG,0BAA0B,CAAC;IAClE,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;IAC5B,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;IACrD,OAAO,CACH,KAAC,YAAY,IAAC,GAAG,EAAE,GAAG,KAAM,KAAK,YAC7B,KAAC,iBAAiB,OAAK,WAAW,EAAE,SAAS,EAAE,YAAY,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,GAAI,GAC3F,CAClB,CAAC;AACN,CAAC,CAAC,CAAC","sourcesContent":["import { PropertyLine, type PropertyLineProps } from \"./propertyLine\";\r\nimport { SyncedSliderInput, type SyncedSliderProps } from \"../../primitives/syncedSlider\";\r\nimport { forwardRef } from \"react\";\r\nimport { makeStyles, mergeClasses } from \"@fluentui/react-components\";\r\nimport { UniformWidthStyling } from \"../../primitives/utils\";\r\n\r\nconst useStyles = makeStyles({\r\n uniformWidth: {\r\n ...UniformWidthStyling,\r\n },\r\n});\r\n\r\ntype SyncedSliderPropertyProps = SyncedSliderProps & PropertyLineProps<number>;\r\n/**\r\n * Renders a simple wrapper around the SyncedSliderInput\r\n * @param props\r\n * @returns\r\n */\r\nexport const SyncedSliderPropertyLine = forwardRef<HTMLDivElement, SyncedSliderPropertyProps>((props, ref): React.ReactElement => {\r\n SyncedSliderPropertyLine.displayName = \"SyncedSliderPropertyLine\";\r\n const classes = useStyles();\r\n const { label, description, ...sliderProps } = props;\r\n return (\r\n <PropertyLine ref={ref} {...props}>\r\n <SyncedSliderInput {...sliderProps} className={mergeClasses(classes.uniformWidth, props.className)} />\r\n </PropertyLine>\r\n );\r\n});\r\n"]}
@@ -1,6 +1,6 @@
1
- import type { PropertyLineProps } from "./propertyLine.js";
2
- import type { FunctionComponent } from "react";
3
- import type { TextareaProps } from "../../primitives/textarea.js";
1
+ import { type PropertyLineProps } from "./propertyLine.js";
2
+ import { type FunctionComponent } from "react";
3
+ import { type TextareaProps } from "../../primitives/textarea.js";
4
4
  /**
5
5
  * Wraps textarea in a property line
6
6
  * @param props - PropertyLineProps and TextProps
@@ -1 +1 @@
1
- {"version":3,"file":"textAreaPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/textAreaPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAiE,CAAC,KAAK,EAAE,EAAE;IACxG,oBAAoB,CAAC,WAAW,GAAG,sBAAsB,CAAC;IAC1D,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,QAAQ,OAAK,KAAK,GAAI,GACZ,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { PropertyLine } from \"./propertyLine\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\nimport { Textarea } from \"../../primitives/textarea\";\r\nimport type { TextareaProps } from \"../../primitives/textarea\";\r\n/**\r\n * Wraps textarea in a property line\r\n * @param props - PropertyLineProps and TextProps\r\n * @returns property-line wrapped text\r\n */\r\nexport const TextAreaPropertyLine: FunctionComponent<PropertyLineProps<string> & TextareaProps> = (props) => {\r\n TextAreaPropertyLine.displayName = \"TextAreaPropertyLine\";\r\n return (\r\n <PropertyLine {...props}>\r\n <Textarea {...props} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"textAreaPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/textAreaPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAsB,MAAM,2BAA2B,CAAC;AACzE;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAiE,CAAC,KAAK,EAAE,EAAE;IACxG,oBAAoB,CAAC,WAAW,GAAG,sBAAsB,CAAC;IAC1D,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,QAAQ,OAAK,KAAK,GAAI,GACZ,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { PropertyLine, type PropertyLineProps } from \"./propertyLine\";\r\nimport { type FunctionComponent } from \"react\";\r\nimport { Textarea, type TextareaProps } from \"../../primitives/textarea\";\r\n/**\r\n * Wraps textarea in a property line\r\n * @param props - PropertyLineProps and TextProps\r\n * @returns property-line wrapped text\r\n */\r\nexport const TextAreaPropertyLine: FunctionComponent<PropertyLineProps<string> & TextareaProps> = (props) => {\r\n TextAreaPropertyLine.displayName = \"TextAreaPropertyLine\";\r\n return (\r\n <PropertyLine {...props}>\r\n <Textarea {...props} />\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
@@ -1,6 +1,6 @@
1
- import type { ImmutablePrimitiveProps } from "../../primitives/primitive.js";
2
- import type { PropertyLineProps } from "./propertyLine.js";
3
- import type { FunctionComponent } from "react";
1
+ import { type PropertyLineProps } from "./propertyLine.js";
2
+ import { type ImmutablePrimitiveProps } from "../../primitives/primitive.js";
3
+ import { type FunctionComponent } from "react";
4
4
  /**
5
5
  * Wraps text in a property line
6
6
  * @param props - PropertyLineProps and TextProps
@@ -1 +1 @@
1
- {"version":3,"file":"textPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/textPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAK9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAmF,CAAC,KAAK,EAAE,EAAE;IACtH,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;IAClD,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAC/B,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,KAAK,IAAC,KAAK,EAAE,KAAK,YAAG,KAAK,IAAI,EAAE,GAAS,GAC/B,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Body1 } from \"@fluentui/react-components\";\r\nimport { PropertyLine } from \"./propertyLine\";\r\nimport type { ImmutablePrimitiveProps } from \"../../primitives/primitive\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\nimport type { FunctionComponent } from \"react\";\r\n\r\n/**\r\n * Wraps text in a property line\r\n * @param props - PropertyLineProps and TextProps\r\n * @returns property-line wrapped text\r\n */\r\nexport const TextPropertyLine: FunctionComponent<PropertyLineProps<string> & ImmutablePrimitiveProps<string>> = (props) => {\r\n TextPropertyLine.displayName = \"TextPropertyLine\";\r\n const { value, title } = props;\r\n return (\r\n <PropertyLine {...props}>\r\n <Body1 title={title}>{value ?? \"\"}</Body1>\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"textPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/textPropertyLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAC;AAItE;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAmF,CAAC,KAAK,EAAE,EAAE;IACtH,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;IAClD,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAC/B,OAAO,CACH,KAAC,YAAY,OAAK,KAAK,YACnB,KAAC,KAAK,IAAC,KAAK,EAAE,KAAK,YAAG,KAAK,IAAI,EAAE,GAAS,GAC/B,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Body1 } from \"@fluentui/react-components\";\r\nimport { PropertyLine, type PropertyLineProps } from \"./propertyLine\";\r\nimport { type ImmutablePrimitiveProps } from \"../../primitives/primitive\";\r\nimport { type FunctionComponent } from \"react\";\r\n\r\n/**\r\n * Wraps text in a property line\r\n * @param props - PropertyLineProps and TextProps\r\n * @returns property-line wrapped text\r\n */\r\nexport const TextPropertyLine: FunctionComponent<PropertyLineProps<string> & ImmutablePrimitiveProps<string>> = (props) => {\r\n TextPropertyLine.displayName = \"TextPropertyLine\";\r\n const { value, title } = props;\r\n return (\r\n <PropertyLine {...props}>\r\n <Body1 title={title}>{value ?? \"\"}</Body1>\r\n </PropertyLine>\r\n );\r\n};\r\n"]}
@@ -1,8 +1,7 @@
1
- import type { FunctionComponent } from "react";
2
- import type { Vector3 } from "@babylonjs/core/Maths/math.vector.js";
3
- import type { PrimitiveProps } from "../../primitives/primitive.js";
4
- import type { PropertyLineProps } from "./propertyLine.js";
5
- import { Quaternion, Vector2, Vector4 } from "@babylonjs/core/Maths/math.vector.js";
1
+ import { type FunctionComponent } from "react";
2
+ import { type Vector3, Quaternion, Vector2, Vector4 } from "@babylonjs/core/Maths/math.vector.js";
3
+ import { type PrimitiveProps } from "../../primitives/primitive.js";
4
+ import { type PropertyLineProps } from "./propertyLine.js";
6
5
  export type TensorPropertyLineProps<V extends Vector2 | Vector3 | Vector4 | Quaternion> = PropertyLineProps<V> & PrimitiveProps<V> & {
7
6
  /**
8
7
  * If passed, all sliders will use this for the min value
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Body1 } from "@fluentui/react-components";
3
2
  import { useEffect, useState } from "react";
4
3
  import { Quaternion, Vector2, Vector4 } from "@babylonjs/core/Maths/math.vector.js";
4
+ import { PropertyLine } from "./propertyLine.js";
5
+ import { Body1 } from "@fluentui/react-components";
5
6
  import { Tools } from "@babylonjs/core/Misc/tools.js";
6
7
  import { CalculatePrecision } from "../../primitives/utils.js";
7
8
  import { NumberInputPropertyLine } from "./inputPropertyLine.js";
8
- import { PropertyLine } from "./propertyLine.js";
9
9
  import { TextPropertyLine } from "./textPropertyLine.js";
10
10
  const HasZ = (vector) => !(vector instanceof Vector2);
11
11
  const HasW = (vector) => vector instanceof Vector4 || vector instanceof Quaternion;
@@ -1 +1 @@
1
- {"version":3,"file":"vectorPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/vectorPropertyLine.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,6CAA+B;AACtE,OAAO,EAAE,KAAK,EAAE,sCAAwB;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAqCtD,MAAM,IAAI,GAAG,CAAC,MAAgD,EAAqB,EAAE,CAAC,CAAC,CAAC,MAAM,YAAY,OAAO,CAAC,CAAC;AACnH,MAAM,IAAI,GAAG,CAAC,MAAgD,EAAqB,EAAE,CAAC,MAAM,YAAY,OAAO,IAAI,MAAM,YAAY,UAAU,CAAC;AAEhJ;;;;;GAKG;AACH,MAAM,kBAAkB,GAAyF,CAAC,KAAK,EAAE,EAAE;IACvH,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC;IACtD,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjG,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,C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3 } from \"core/Maths/math.vector\";\r\nimport type { PrimitiveProps } from \"../../primitives/primitive\";\r\nimport type { PropertyLineProps } from \"./propertyLine\";\r\n\r\nimport { Body1 } from \"@fluentui/react-components\";\r\nimport { useEffect, useState } from \"react\";\r\n\r\nimport { Quaternion, Vector2, Vector4 } from \"core/Maths/math.vector\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport { CalculatePrecision } from \"../../primitives/utils\";\r\nimport { NumberInputPropertyLine } from \"./inputPropertyLine\";\r\nimport { PropertyLine } from \"./propertyLine\";\r\nimport { TextPropertyLine } from \"./textPropertyLine\";\r\n\r\nexport type TensorPropertyLineProps<V extends Vector2 | Vector3 | Vector4 | Quaternion> = PropertyLineProps<V> &\r\n PrimitiveProps<V> & {\r\n /**\r\n * If passed, all sliders will use this for the min value\r\n */\r\n min?: number;\r\n /**\r\n * If passed, all sliders will use this for the max value\r\n */\r\n max?: number;\r\n /**\r\n * Will be displayed in the input UI to indicate the unit of measurement\r\n */\r\n unit?: string;\r\n /**\r\n * Internal spinbutton's step\r\n */\r\n step?: number;\r\n /** Optional fixed precision (number of decimal digits). Overrides the automatically computed display precision. */\r\n precision?: number;\r\n /**\r\n * If passed, the UX will use the conversion functions to display/update values\r\n */\r\n valueConverter?: {\r\n /**\r\n * Will call from(val) before displaying in the UX\r\n */\r\n from: (val: number) => number;\r\n /**\r\n * Will call to(val) before calling onChange\r\n */\r\n to: (val: number) => number;\r\n };\r\n };\r\n\r\nconst HasZ = (vector: Vector2 | Vector3 | Vector4 | Quaternion): vector is Vector3 => !(vector instanceof Vector2);\r\nconst HasW = (vector: Vector2 | Vector3 | Vector4 | Quaternion): vector is Vector4 => vector instanceof Vector4 || vector instanceof Quaternion;\r\n\r\n/**\r\n * Reusable component which renders a vector property line containing a label, vector value, and expandable XYZW values\r\n * The expanded section contains a slider/input box for each component of the vector (x, y, z, w)\r\n * @param props\r\n * @returns\r\n */\r\nconst TensorPropertyLine: FunctionComponent<TensorPropertyLineProps<Vector2 | Vector3 | Vector4 | Quaternion>> = (props) => {\r\n TensorPropertyLine.displayName = \"TensorPropertyLine\";\r\n const converted = (val: number) => (props.valueConverter ? props.valueConverter.from(val) : val);\r\n const formatted = (val: number) => converted(val).toFixed(props.step !== undefined ? Math.max(0, CalculatePrecision(props.step)) : 2);\r\n\r\n const [vector, setVector] = useState(props.value);\r\n const { min, max } = props;\r\n\r\n const onChange = (val: number, key: \"x\" | \"y\" | \"z\" | \"w\") => {\r\n const value = props.valueConverter ? props.valueConverter.to(val) : val;\r\n const newVector = vector.clone();\r\n (newVector as Vector4)[key] = value; // The syncedSlider for 'w' is only rendered when vector is a Vector4, so this is safe\r\n\r\n setVector(newVector);\r\n props.onChange(newVector);\r\n };\r\n\r\n useEffect(() => {\r\n setVector(props.value);\r\n }, [props.value, props.expandedContent]);\r\n\r\n return (\r\n <PropertyLine\r\n {...props}\r\n expandedContent={\r\n <>\r\n {props.expandedContent}\r\n {vector ? (\r\n <VectorSliders\r\n vector={vector}\r\n min={min}\r\n max={max}\r\n unit={props.unit}\r\n step={props.step}\r\n precision={props.precision}\r\n converted={converted}\r\n onChange={onChange}\r\n />\r\n ) : undefined}\r\n </>\r\n }\r\n >\r\n <Body1>{`[${formatted(props.value.x)}, ${formatted(props.value.y)}${HasZ(props.value) ? `, ${formatted(props.value.z)}` : \"\"}${HasW(props.value) ? `, ${formatted(props.value.w)}` : \"\"}]`}</Body1>\r\n </PropertyLine>\r\n );\r\n};\r\n\r\ntype VectorSlidersProps<V extends Vector2 | Vector3 | Vector4 | Quaternion> = {\r\n vector: V;\r\n min?: number;\r\n max?: number;\r\n unit?: string;\r\n step?: number;\r\n precision?: number;\r\n converted: (val: number) => number;\r\n onChange: (val: number, key: \"x\" | \"y\" | \"z\" | \"w\") => void;\r\n};\r\n\r\nconst VectorSliders = <V extends Vector2 | Vector3 | Vector4 | Quaternion>({ vector, min, max, unit, step, precision, converted, onChange }: VectorSlidersProps<V>) => (\r\n <>\r\n <NumberInputPropertyLine label=\"X\" value={converted(vector.x)} min={min} max={max} onChange={(val) => onChange(val, \"x\")} unit={unit} step={step} precision={precision} />\r\n <NumberInputPropertyLine label=\"Y\" value={converted(vector.y)} min={min} max={max} onChange={(val) => onChange(val, \"y\")} unit={unit} step={step} precision={precision} />\r\n {HasZ(vector) && (\r\n <NumberInputPropertyLine\r\n label=\"Z\"\r\n value={converted(vector.z)}\r\n min={min}\r\n max={max}\r\n onChange={(val) => onChange(val, \"z\")}\r\n unit={unit}\r\n step={step}\r\n precision={precision}\r\n />\r\n )}\r\n {HasW(vector) && (\r\n <NumberInputPropertyLine\r\n label=\"W\"\r\n value={converted(vector.w)}\r\n min={min}\r\n max={max}\r\n onChange={(val) => onChange(val, \"w\")}\r\n unit={unit}\r\n step={step}\r\n precision={precision}\r\n />\r\n )}\r\n </>\r\n);\r\n\r\ntype RotationVectorPropertyLineProps = TensorPropertyLineProps<Vector3> & {\r\n /**\r\n * Display angles as degrees instead of radians\r\n */\r\n useDegrees?: boolean;\r\n};\r\n\r\nconst ToDegreesConverter = { from: Tools.ToDegrees, to: Tools.ToRadians };\r\nexport const RotationVectorPropertyLine: FunctionComponent<RotationVectorPropertyLineProps> = (props) => {\r\n RotationVectorPropertyLine.displayName = \"RotationVectorPropertyLine\";\r\n const step = props.useDegrees ? 1 : 0.01;\r\n const precision = props.useDegrees ? 1 : 2;\r\n return (\r\n <Vector3PropertyLine\r\n {...props}\r\n unit={props.useDegrees ? \"°\" : \"rad\"}\r\n valueConverter={props.useDegrees ? ToDegreesConverter : undefined}\r\n step={step}\r\n precision={precision}\r\n />\r\n );\r\n};\r\n\r\ntype QuaternionPropertyLineProps = TensorPropertyLineProps<Quaternion> & {\r\n /**\r\n * Display angles as degrees instead of radians\r\n */\r\n useDegrees?: boolean;\r\n /**\r\n * Display angles as Euler angles instead of quaternions\r\n */\r\n useEuler?: boolean;\r\n};\r\nconst QuaternionPropertyLineInternal = TensorPropertyLine as FunctionComponent<TensorPropertyLineProps<Quaternion>>;\r\nexport const QuaternionPropertyLine: FunctionComponent<QuaternionPropertyLineProps> = (props) => {\r\n QuaternionPropertyLine.displayName = \"QuaternionPropertyLine\";\r\n const step = props.useDegrees ? 1 : 0.01;\r\n const precision = props.useDegrees ? 1 : 2;\r\n const [quat, setQuat] = useState(props.value);\r\n\r\n useEffect(() => {\r\n setQuat(props.value);\r\n }, [props.value]);\r\n\r\n // Extract only the properties that exist on QuaternionPropertyLineProps\r\n const { useEuler, ...restProps } = props;\r\n\r\n const onQuatChange = (val: Quaternion) => {\r\n setQuat(val);\r\n props.onChange(val);\r\n };\r\n\r\n const onEulerChange = (val: Vector3) => {\r\n const quat = Quaternion.FromEulerAngles(val.x, val.y, val.z);\r\n onQuatChange(quat);\r\n };\r\n\r\n return useEuler ? (\r\n <Vector3PropertyLine\r\n {...restProps}\r\n nullable={false}\r\n ignoreNullable={false}\r\n value={quat.toEulerAngles()}\r\n valueConverter={ToDegreesConverter}\r\n onChange={onEulerChange}\r\n unit={props.useDegrees ? \"°\" : \"rad\"}\r\n step={step}\r\n precision={precision}\r\n expandedContent={<TextPropertyLine label=\"Quaternion\" value={`[${quat.x.toFixed(4)}, ${quat.y.toFixed(4)}, ${quat.z.toFixed(4)}, ${quat.w.toFixed(4)}]`} />}\r\n />\r\n ) : (\r\n <QuaternionPropertyLineInternal {...props} nullable={false} value={quat} onChange={onQuatChange} unit={props.useDegrees ? \"°\" : \"rad\"} step={step} precision={precision} />\r\n );\r\n};\r\nexport const Vector2PropertyLine = TensorPropertyLine as FunctionComponent<TensorPropertyLineProps<Vector2>>;\r\nexport const Vector3PropertyLine = TensorPropertyLine as FunctionComponent<TensorPropertyLineProps<Vector3>>;\r\nexport const Vector4PropertyLine = TensorPropertyLine as FunctionComponent<TensorPropertyLineProps<Vector4>>;\r\n"]}
1
+ {"version":3,"file":"vectorPropertyLine.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/fluent/hoc/propertyLines/vectorPropertyLine.tsx"],"names":[],"mappings":";A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f,cAAc,EAAE,KAAK,EACrB,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,EAC3B,cAAc,EAAE,kBAAkB,EAClC,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EACpC,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,KAAC,gBAAgB,IAAC,KAAK,EAAC,YAAY,EAAC,KAAK,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,GAAI,GAC7J,CACL,CAAC,CAAC,CAAC,CACA,KAAC,8BAA8B,OAAK,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,GAAI,CAC9K,CAAC;AACN,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,mBAAmB,GAAG,kBAAyE,CAAC;AAC7G,MAAM,CAAC,MAAM,mBAAmB,GAAG,kBAAyE,CAAC;AAC7G,MAAM,CAAC,MAAM,mBAAmB,GAAG,kBAAyE,CAAC","sourcesContent":["import { type FunctionComponent, useEffect, useState } from \"react\";\r\n\r\nimport { type Vector3, Quaternion, Vector2, Vector4 } from \"core/Maths/math.vector\";\r\nimport { type PrimitiveProps } from \"../../primitives/primitive\";\r\nimport { type PropertyLineProps, PropertyLine } from \"./propertyLine\";\r\n\r\nimport { Body1 } from \"@fluentui/react-components\";\r\n\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport { CalculatePrecision } from \"../../primitives/utils\";\r\nimport { NumberInputPropertyLine } from \"./inputPropertyLine\";\r\nimport { TextPropertyLine } from \"./textPropertyLine\";\r\n\r\nexport type TensorPropertyLineProps<V extends Vector2 | Vector3 | Vector4 | Quaternion> = PropertyLineProps<V> &\r\n PrimitiveProps<V> & {\r\n /**\r\n * If passed, all sliders will use this for the min value\r\n */\r\n min?: number;\r\n /**\r\n * If passed, all sliders will use this for the max value\r\n */\r\n max?: number;\r\n /**\r\n * Will be displayed in the input UI to indicate the unit of measurement\r\n */\r\n unit?: string;\r\n /**\r\n * Internal spinbutton's step\r\n */\r\n step?: number;\r\n /** Optional fixed precision (number of decimal digits). Overrides the automatically computed display precision. */\r\n precision?: number;\r\n /**\r\n * If passed, the UX will use the conversion functions to display/update values\r\n */\r\n valueConverter?: {\r\n /**\r\n * Will call from(val) before displaying in the UX\r\n */\r\n from: (val: number) => number;\r\n /**\r\n * Will call to(val) before calling onChange\r\n */\r\n to: (val: number) => number;\r\n };\r\n };\r\n\r\nconst HasZ = (vector: Vector2 | Vector3 | Vector4 | Quaternion): vector is Vector3 => !(vector instanceof Vector2);\r\nconst HasW = (vector: Vector2 | Vector3 | Vector4 | Quaternion): vector is Vector4 => vector instanceof Vector4 || vector instanceof Quaternion;\r\n\r\n/**\r\n * Reusable component which renders a vector property line containing a label, vector value, and expandable XYZW values\r\n * The expanded section contains a slider/input box for each component of the vector (x, y, z, w)\r\n * @param props\r\n * @returns\r\n */\r\nconst TensorPropertyLine: FunctionComponent<TensorPropertyLineProps<Vector2 | Vector3 | Vector4 | Quaternion>> = (props) => {\r\n TensorPropertyLine.displayName = \"TensorPropertyLine\";\r\n const converted = (val: number) => (props.valueConverter ? props.valueConverter.from(val) : val);\r\n const formatted = (val: number) => converted(val).toFixed(props.step !== undefined ? Math.max(0, CalculatePrecision(props.step)) : 2);\r\n\r\n const [vector, setVector] = useState(props.value);\r\n const { min, max } = props;\r\n\r\n const onChange = (val: number, key: \"x\" | \"y\" | \"z\" | \"w\") => {\r\n const value = props.valueConverter ? props.valueConverter.to(val) : val;\r\n const newVector = vector.clone();\r\n (newVector as Vector4)[key] = value; // The syncedSlider for 'w' is only rendered when vector is a Vector4, so this is safe\r\n\r\n setVector(newVector);\r\n props.onChange(newVector);\r\n };\r\n\r\n useEffect(() => {\r\n setVector(props.value);\r\n }, [props.value, props.expandedContent]);\r\n\r\n return (\r\n <PropertyLine\r\n {...props}\r\n expandedContent={\r\n <>\r\n {props.expandedContent}\r\n {vector ? (\r\n <VectorSliders\r\n vector={vector}\r\n min={min}\r\n max={max}\r\n unit={props.unit}\r\n step={props.step}\r\n precision={props.precision}\r\n converted={converted}\r\n onChange={onChange}\r\n />\r\n ) : undefined}\r\n </>\r\n }\r\n >\r\n <Body1>{`[${formatted(props.value.x)}, ${formatted(props.value.y)}${HasZ(props.value) ? `, ${formatted(props.value.z)}` : \"\"}${HasW(props.value) ? `, ${formatted(props.value.w)}` : \"\"}]`}</Body1>\r\n </PropertyLine>\r\n );\r\n};\r\n\r\ntype VectorSlidersProps<V extends Vector2 | Vector3 | Vector4 | Quaternion> = {\r\n vector: V;\r\n min?: number;\r\n max?: number;\r\n unit?: string;\r\n step?: number;\r\n precision?: number;\r\n converted: (val: number) => number;\r\n onChange: (val: number, key: \"x\" | \"y\" | \"z\" | \"w\") => void;\r\n};\r\n\r\nconst VectorSliders = <V extends Vector2 | Vector3 | Vector4 | Quaternion>({ vector, min, max, unit, step, precision, converted, onChange }: VectorSlidersProps<V>) => (\r\n <>\r\n <NumberInputPropertyLine label=\"X\" value={converted(vector.x)} min={min} max={max} onChange={(val) => onChange(val, \"x\")} unit={unit} step={step} precision={precision} />\r\n <NumberInputPropertyLine label=\"Y\" value={converted(vector.y)} min={min} max={max} onChange={(val) => onChange(val, \"y\")} unit={unit} step={step} precision={precision} />\r\n {HasZ(vector) && (\r\n <NumberInputPropertyLine\r\n label=\"Z\"\r\n value={converted(vector.z)}\r\n min={min}\r\n max={max}\r\n onChange={(val) => onChange(val, \"z\")}\r\n unit={unit}\r\n step={step}\r\n precision={precision}\r\n />\r\n )}\r\n {HasW(vector) && (\r\n <NumberInputPropertyLine\r\n label=\"W\"\r\n value={converted(vector.w)}\r\n min={min}\r\n max={max}\r\n onChange={(val) => onChange(val, \"w\")}\r\n unit={unit}\r\n step={step}\r\n precision={precision}\r\n />\r\n )}\r\n </>\r\n);\r\n\r\ntype RotationVectorPropertyLineProps = TensorPropertyLineProps<Vector3> & {\r\n /**\r\n * Display angles as degrees instead of radians\r\n */\r\n useDegrees?: boolean;\r\n};\r\n\r\nconst ToDegreesConverter = { from: Tools.ToDegrees, to: Tools.ToRadians };\r\nexport const RotationVectorPropertyLine: FunctionComponent<RotationVectorPropertyLineProps> = (props) => {\r\n RotationVectorPropertyLine.displayName = \"RotationVectorPropertyLine\";\r\n const step = props.useDegrees ? 1 : 0.01;\r\n const precision = props.useDegrees ? 1 : 2;\r\n return (\r\n <Vector3PropertyLine\r\n {...props}\r\n unit={props.useDegrees ? \"°\" : \"rad\"}\r\n valueConverter={props.useDegrees ? ToDegreesConverter : undefined}\r\n step={step}\r\n precision={precision}\r\n />\r\n );\r\n};\r\n\r\ntype QuaternionPropertyLineProps = TensorPropertyLineProps<Quaternion> & {\r\n /**\r\n * Display angles as degrees instead of radians\r\n */\r\n useDegrees?: boolean;\r\n /**\r\n * Display angles as Euler angles instead of quaternions\r\n */\r\n useEuler?: boolean;\r\n};\r\nconst QuaternionPropertyLineInternal = TensorPropertyLine as FunctionComponent<TensorPropertyLineProps<Quaternion>>;\r\nexport const QuaternionPropertyLine: FunctionComponent<QuaternionPropertyLineProps> = (props) => {\r\n QuaternionPropertyLine.displayName = \"QuaternionPropertyLine\";\r\n const step = props.useDegrees ? 1 : 0.01;\r\n const precision = props.useDegrees ? 1 : 2;\r\n const [quat, setQuat] = useState(props.value);\r\n\r\n useEffect(() => {\r\n setQuat(props.value);\r\n }, [props.value]);\r\n\r\n // Extract only the properties that exist on QuaternionPropertyLineProps\r\n const { useEuler, ...restProps } = props;\r\n\r\n const onQuatChange = (val: Quaternion) => {\r\n setQuat(val);\r\n props.onChange(val);\r\n };\r\n\r\n const onEulerChange = (val: Vector3) => {\r\n const quat = Quaternion.FromEulerAngles(val.x, val.y, val.z);\r\n onQuatChange(quat);\r\n };\r\n\r\n return useEuler ? (\r\n <Vector3PropertyLine\r\n {...restProps}\r\n nullable={false}\r\n ignoreNullable={false}\r\n value={quat.toEulerAngles()}\r\n valueConverter={ToDegreesConverter}\r\n onChange={onEulerChange}\r\n unit={props.useDegrees ? \"°\" : \"rad\"}\r\n step={step}\r\n precision={precision}\r\n expandedContent={<TextPropertyLine label=\"Quaternion\" value={`[${quat.x.toFixed(4)}, ${quat.y.toFixed(4)}, ${quat.z.toFixed(4)}, ${quat.w.toFixed(4)}]`} />}\r\n />\r\n ) : (\r\n <QuaternionPropertyLineInternal {...props} nullable={false} value={quat} onChange={onQuatChange} unit={props.useDegrees ? \"°\" : \"rad\"} step={step} precision={precision} />\r\n );\r\n};\r\nexport const Vector2PropertyLine = TensorPropertyLine as FunctionComponent<TensorPropertyLineProps<Vector2>>;\r\nexport const Vector3PropertyLine = TensorPropertyLine as FunctionComponent<TensorPropertyLineProps<Vector3>>;\r\nexport const Vector4PropertyLine = TensorPropertyLine as FunctionComponent<TensorPropertyLineProps<Vector4>>;\r\n"]}
@@ -1,6 +1,6 @@
1
- import type { FunctionComponent } from "react";
2
- import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
3
- import type { Scene } from "@babylonjs/core/scene.js";
1
+ import { type FunctionComponent } from "react";
2
+ import { type BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
3
+ import { type Scene } from "@babylonjs/core/scene.js";
4
4
  type TextureUploadUpdateProps = {
5
5
  /**
6
6
  * Existing texture to update via updateURL
@@ -1 +1 @@
1
- {"version":3,"file":"textureUpload.js","sourceRoot":"","sources":["../../../../../dev/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,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;oBACpI,CAAC,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;gBAElE,QAAQ,CAAC,UAAU,CAAC,CAAC;YACzB,CAAC;QACL,CAAC,EACD,SAAS,EACT,IAAI,CACP,CAAC;IACN,CAAC,EACD,CAAC,KAAK,CAAC,CACV,CAAC;IAEF,OAAO,KAAC,YAAY,IAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,GAAI,CAAC;AAC3G,CAAC,CAAC","sourcesContent":["import type { FunctionComponent } from \"react\";\r\nimport { useCallback } from \"react\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\nimport { CubeTexture } from \"core/Materials/Textures/cubeTexture\";\r\nimport { ReadFile } from \"core/Misc/fileTools\";\r\nimport { UploadButton } from \"../primitives/uploadButton\";\r\n\r\ntype TextureUploadUpdateProps = {\r\n /**\r\n * Existing texture to update via updateURL\r\n */\r\n texture: BaseTexture;\r\n /**\r\n * Callback after texture is updated\r\n */\r\n onChange?: (texture: BaseTexture) => void;\r\n scene?: never;\r\n cubeOnly?: never;\r\n};\r\n\r\ntype TextureUploadCreateProps = {\r\n /**\r\n * The scene to create the texture in\r\n */\r\n scene: Scene;\r\n /**\r\n * Callback when a new texture is created\r\n */\r\n onChange: (texture: BaseTexture) => void;\r\n /**\r\n * Whether to create cube textures\r\n */\r\n cubeOnly?: boolean;\r\n texture?: never;\r\n};\r\n\r\ntype TextureUploadProps = TextureUploadUpdateProps | TextureUploadCreateProps;\r\n\r\n/**\r\n * A button that uploads a file and either:\r\n * - Updates an existing Texture or CubeTexture via updateURL (if texture prop is provided)\r\n * - Creates a new Texture or CubeTexture (if scene/onChange props are provided)\r\n * @param props TextureUploadProps\r\n * @returns UploadButton component that handles texture upload\r\n */\r\nexport const TextureUpload: FunctionComponent<TextureUploadProps> = (props) => {\r\n TextureUpload.displayName = \"TextureUpload\";\r\n const label = props.texture ? \"Upload Texture\" : undefined;\r\n // TODO: This should probably be dynamically fetching a list of supported texture extensions\r\n const accept = \".jpg, .png, .tga, .dds, .env, .exr\";\r\n const handleUpload = useCallback(\r\n (files: FileList) => {\r\n const file = files[0];\r\n if (!file) {\r\n return;\r\n }\r\n\r\n ReadFile(\r\n file,\r\n (data) => {\r\n const blob = new Blob([data], { type: \"octet/stream\" });\r\n\r\n // Update existing texture\r\n if (props.texture) {\r\n const { texture, onChange } = props;\r\n const reader = new FileReader();\r\n reader.readAsDataURL(blob);\r\n reader.onloadend = () => {\r\n const base64data = reader.result as string;\r\n\r\n if (texture instanceof CubeTexture) {\r\n let extension: string | undefined = undefined;\r\n if (file.name.toLowerCase().indexOf(\".dds\") > 0) {\r\n extension = \".dds\";\r\n } else if (file.name.toLowerCase().indexOf(\".env\") > 0) {\r\n extension = \".env\";\r\n }\r\n texture.updateURL(base64data, extension, () => onChange?.(texture));\r\n } else if (texture instanceof Texture) {\r\n texture.updateURL(base64data, null, () => onChange?.(texture));\r\n }\r\n };\r\n } else {\r\n // Create new texture\r\n const { scene, cubeOnly, onChange } = props;\r\n const url = URL.createObjectURL(blob);\r\n const extension = file.name.split(\".\").pop()?.toLowerCase();\r\n\r\n // Revoke the object URL after texture loads to prevent memory leak\r\n const revokeUrl = () => URL.revokeObjectURL(url);\r\n\r\n const newTexture = cubeOnly\r\n ? new CubeTexture(url, scene, [], false, undefined, revokeUrl, undefined, undefined, false, extension ? \".\" + extension : undefined)\r\n : new Texture(url, scene, false, false, undefined, revokeUrl);\r\n\r\n onChange(newTexture);\r\n }\r\n },\r\n undefined,\r\n true\r\n );\r\n },\r\n [props]\r\n );\r\n\r\n return <UploadButton onUpload={handleUpload} accept={accept} title={\"Upload Texture\"} label={label} />;\r\n};\r\n"]}
1
+ {"version":3,"file":"textureUpload.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/fluent/hoc/textureUpload.tsx"],"names":[],"mappings":";AAAA,OAAO,EAA0B,WAAW,EAAE,MAAM,OAAO,CAAC;AAG5D,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAiC1D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAA0C,CAAC,KAAK,EAAE,EAAE;IAC1E,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;IAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3D,4FAA4F;IAC5F,MAAM,MAAM,GAAG,oCAAoC,CAAC;IACpD,MAAM,YAAY,GAAG,WAAW,CAC5B,CAAC,KAAe,EAAE,EAAE;QAChB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,OAAO;QACX,CAAC;QAED,QAAQ,CACJ,IAAI,EACJ,CAAC,IAAI,EAAE,EAAE;YACL,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;YAExD,0BAA0B;YAC1B,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;gBAChB,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;gBACpC,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;gBAChC,MAAM,CAAC,a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jD,MAAM,UAAU,GAAG,QAAQ;oBACvB,CAAC,CAAC,IAAI,WAAW,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;oBACpI,CAAC,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;gBAElE,QAAQ,CAAC,UAAU,CAAC,CAAC;YACzB,CAAC;QACL,CAAC,EACD,SAAS,EACT,IAAI,CACP,CAAC;IACN,CAAC,EACD,CAAC,KAAK,CAAC,CACV,CAAC;IAEF,OAAO,KAAC,YAAY,IAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,GAAI,CAAC;AAC3G,CAAC,CAAC","sourcesContent":["import { type FunctionComponent, useCallback } from \"react\";\r\nimport { type BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport { type Scene } from \"core/scene\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\nimport { CubeTexture } from \"core/Materials/Textures/cubeTexture\";\r\nimport { ReadFile } from \"core/Misc/fileTools\";\r\nimport { UploadButton } from \"../primitives/uploadButton\";\r\n\r\ntype TextureUploadUpdateProps = {\r\n /**\r\n * Existing texture to update via updateURL\r\n */\r\n texture: BaseTexture;\r\n /**\r\n * Callback after texture is updated\r\n */\r\n onChange?: (texture: BaseTexture) => void;\r\n scene?: never;\r\n cubeOnly?: never;\r\n};\r\n\r\ntype TextureUploadCreateProps = {\r\n /**\r\n * The scene to create the texture in\r\n */\r\n scene: Scene;\r\n /**\r\n * Callback when a new texture is created\r\n */\r\n onChange: (texture: BaseTexture) => void;\r\n /**\r\n * Whether to create cube textures\r\n */\r\n cubeOnly?: boolean;\r\n texture?: never;\r\n};\r\n\r\ntype TextureUploadProps = TextureUploadUpdateProps | TextureUploadCreateProps;\r\n\r\n/**\r\n * A button that uploads a file and either:\r\n * - Updates an existing Texture or CubeTexture via updateURL (if texture prop is provided)\r\n * - Creates a new Texture or CubeTexture (if scene/onChange props are provided)\r\n * @param props TextureUploadProps\r\n * @returns UploadButton component that handles texture upload\r\n */\r\nexport const TextureUpload: FunctionComponent<TextureUploadProps> = (props) => {\r\n TextureUpload.displayName = \"TextureUpload\";\r\n const label = props.texture ? \"Upload Texture\" : undefined;\r\n // TODO: This should probably be dynamically fetching a list of supported texture extensions\r\n const accept = \".jpg, .png, .tga, .dds, .env, .exr\";\r\n const handleUpload = useCallback(\r\n (files: FileList) => {\r\n const file = files[0];\r\n if (!file) {\r\n return;\r\n }\r\n\r\n ReadFile(\r\n file,\r\n (data) => {\r\n const blob = new Blob([data], { type: \"octet/stream\" });\r\n\r\n // Update existing texture\r\n if (props.texture) {\r\n const { texture, onChange } = props;\r\n const reader = new FileReader();\r\n reader.readAsDataURL(blob);\r\n reader.onloadend = () => {\r\n const base64data = reader.result as string;\r\n\r\n if (texture instanceof CubeTexture) {\r\n let extension: string | undefined = undefined;\r\n if (file.name.toLowerCase().indexOf(\".dds\") > 0) {\r\n extension = \".dds\";\r\n } else if (file.name.toLowerCase().indexOf(\".env\") > 0) {\r\n extension = \".env\";\r\n }\r\n texture.updateURL(base64data, extension, () => onChange?.(texture));\r\n } else if (texture instanceof Texture) {\r\n texture.updateURL(base64data, null, () => onChange?.(texture));\r\n }\r\n };\r\n } else {\r\n // Create new texture\r\n const { scene, cubeOnly, onChange } = props;\r\n const url = URL.createObjectURL(blob);\r\n const extension = file.name.split(\".\").pop()?.toLowerCase();\r\n\r\n // Revoke the object URL after texture loads to prevent memory leak\r\n const revokeUrl = () => URL.revokeObjectURL(url);\r\n\r\n const newTexture = cubeOnly\r\n ? new CubeTexture(url, scene, [], false, undefined, revokeUrl, undefined, undefined, false, extension ? \".\" + extension : undefined)\r\n : new Texture(url, scene, false, false, undefined, revokeUrl);\r\n\r\n onChange(newTexture);\r\n }\r\n },\r\n undefined,\r\n true\r\n );\r\n },\r\n [props]\r\n );\r\n\r\n return <UploadButton onUpload={handleUpload} accept={accept} title={\"Upload Texture\"} label={label} />;\r\n};\r\n"]}
@@ -1,4 +1,4 @@
1
- import type { WindowOptions } from "./eventHooks.js";
1
+ import { type WindowOptions } from "./eventHooks.js";
2
2
  type KeyCallbacks = {
3
3
  onKeyDown?: (e: KeyboardEvent) => void;
4
4
  onKeyUp?: (e: KeyboardEvent) => void;
@@ -1,5 +1,5 @@
1
- import { useCallback, useState } from "react";
2
1
  import { useEventListener } from "./eventHooks.js";
2
+ import { useCallback, useState } from "react";
3
3
  export function useKeyListener(callbacks, options) {
4
4
  const callbackMap = new Map([
5
5
  ["keydown", callbacks.onKeyDown],