@nice2dev/ui-graphics 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/dist/cjs/animation/AnimatedPerson.js +69 -63
  2. package/dist/cjs/animation/AnimatedPerson.js.map +1 -1
  3. package/dist/cjs/animation/AnimationEditor.js +27 -20
  4. package/dist/cjs/animation/AnimationEditor.js.map +1 -1
  5. package/dist/cjs/animation/Audience.js +17 -11
  6. package/dist/cjs/animation/Audience.js.map +1 -1
  7. package/dist/cjs/animation/BodyRenderer.js +7 -7
  8. package/dist/cjs/animation/BodyRenderer.js.map +1 -1
  9. package/dist/cjs/animation/animationHelper.js +83 -52
  10. package/dist/cjs/animation/animationHelper.js.map +1 -1
  11. package/dist/cjs/animation/characterTypes.js +171 -30
  12. package/dist/cjs/animation/characterTypes.js.map +1 -1
  13. package/dist/cjs/animation/choreoDSL.js +114 -62
  14. package/dist/cjs/animation/choreoDSL.js.map +1 -1
  15. package/dist/cjs/animation/karaokeIntegration.js +10 -11
  16. package/dist/cjs/animation/karaokeIntegration.js.map +1 -1
  17. package/dist/cjs/animation/lottieExport.js +15 -9
  18. package/dist/cjs/animation/lottieExport.js.map +1 -1
  19. package/dist/cjs/animation/motionPath.js +125 -30
  20. package/dist/cjs/animation/motionPath.js.map +1 -1
  21. package/dist/cjs/animation/physics.js +157 -57
  22. package/dist/cjs/animation/physics.js.map +1 -1
  23. package/dist/cjs/animation/rig/RigPlayer.js +7 -6
  24. package/dist/cjs/animation/rig/RigPlayer.js.map +1 -1
  25. package/dist/cjs/animation/rig/RiggedBody.js +7 -7
  26. package/dist/cjs/animation/rig/RiggedBody.js.map +1 -1
  27. package/dist/cjs/animation/rig/choreoRigBridge.js +52 -29
  28. package/dist/cjs/animation/rig/choreoRigBridge.js.map +1 -1
  29. package/dist/cjs/animation/rig/poseOps.js +6 -3
  30. package/dist/cjs/animation/rig/poseOps.js.map +1 -1
  31. package/dist/cjs/animation/shapes/arms.js +7 -6
  32. package/dist/cjs/animation/shapes/arms.js.map +1 -1
  33. package/dist/cjs/animation/shapes/eyes.js +31 -18
  34. package/dist/cjs/animation/shapes/eyes.js.map +1 -1
  35. package/dist/cjs/animation/shapes/hair.js +39 -23
  36. package/dist/cjs/animation/shapes/hair.js.map +1 -1
  37. package/dist/cjs/animation/shapes/heads.js +47 -29
  38. package/dist/cjs/animation/shapes/heads.js.map +1 -1
  39. package/dist/cjs/animation/shapes/headwear.js +26 -14
  40. package/dist/cjs/animation/shapes/headwear.js.map +1 -1
  41. package/dist/cjs/animation/shapes/legs.js +7 -6
  42. package/dist/cjs/animation/shapes/legs.js.map +1 -1
  43. package/dist/cjs/animation/shapes/mouths.js +28 -18
  44. package/dist/cjs/animation/shapes/mouths.js.map +1 -1
  45. package/dist/cjs/animation/shapes/noses.js +18 -9
  46. package/dist/cjs/animation/shapes/noses.js.map +1 -1
  47. package/dist/cjs/animation/shapes/outfits.js +25 -14
  48. package/dist/cjs/animation/shapes/outfits.js.map +1 -1
  49. package/dist/cjs/animation/shapes/torsos.js +5 -4
  50. package/dist/cjs/animation/shapes/torsos.js.map +1 -1
  51. package/dist/cjs/animation/spineExport.js +33 -26
  52. package/dist/cjs/animation/spineExport.js.map +1 -1
  53. package/dist/cjs/core/LocalUI.js +16 -16
  54. package/dist/cjs/core/LocalUI.js.map +1 -1
  55. package/dist/cjs/core/NiceBrushEngine.js +205 -69
  56. package/dist/cjs/core/NiceBrushEngine.js.map +1 -1
  57. package/dist/cjs/core/collaboration.js +35 -21
  58. package/dist/cjs/core/collaboration.js.map +1 -1
  59. package/dist/cjs/core/colorBlindness.js +64 -24
  60. package/dist/cjs/core/colorBlindness.js.map +1 -1
  61. package/dist/cjs/core/dragDrop.js +34 -26
  62. package/dist/cjs/core/dragDrop.js.map +1 -1
  63. package/dist/cjs/core/fixes.js +26 -14
  64. package/dist/cjs/core/fixes.js.map +1 -1
  65. package/dist/cjs/core/gridGuides.js +24 -16
  66. package/dist/cjs/core/gridGuides.js.map +1 -1
  67. package/dist/cjs/core/historyVisual.js +42 -23
  68. package/dist/cjs/core/historyVisual.js.map +1 -1
  69. package/dist/cjs/core/integrations.js +65 -48
  70. package/dist/cjs/core/integrations.js.map +1 -1
  71. package/dist/cjs/core/minimap.js +40 -24
  72. package/dist/cjs/core/minimap.js.map +1 -1
  73. package/dist/cjs/core/plugins.js +10 -6
  74. package/dist/cjs/core/plugins.js.map +1 -1
  75. package/dist/cjs/core/rtl.js +32 -27
  76. package/dist/cjs/core/rtl.js.map +1 -1
  77. package/dist/cjs/core/shortcuts.js +77 -39
  78. package/dist/cjs/core/shortcuts.js.map +1 -1
  79. package/dist/cjs/core/theme.js +68 -61
  80. package/dist/cjs/core/theme.js.map +1 -1
  81. package/dist/cjs/core/yjsCollaboration.js +61 -28
  82. package/dist/cjs/core/yjsCollaboration.js.map +1 -1
  83. package/dist/cjs/font/NiceFontEditor.js +160 -57
  84. package/dist/cjs/font/NiceFontEditor.js.map +1 -1
  85. package/dist/cjs/font/fontFormatUtils.js +37 -24
  86. package/dist/cjs/font/fontFormatUtils.js.map +1 -1
  87. package/dist/cjs/game/GameAsset2dEditor.js +73 -60
  88. package/dist/cjs/game/GameAsset2dEditor.js.map +1 -1
  89. package/dist/cjs/game/gameAssetUtils.js +18 -13
  90. package/dist/cjs/game/gameAssetUtils.js.map +1 -1
  91. package/dist/cjs/game/useGameAssetEditor.js +160 -143
  92. package/dist/cjs/game/useGameAssetEditor.js.map +1 -1
  93. package/dist/cjs/icon/NiceIconEditor.js +329 -106
  94. package/dist/cjs/icon/NiceIconEditor.js.map +1 -1
  95. package/dist/cjs/packages/ui/dist/NiceErrorBoundary-D75yr_WE.js +572 -0
  96. package/dist/cjs/packages/ui/dist/NiceErrorBoundary-D75yr_WE.js.map +1 -0
  97. package/dist/cjs/packages/ui/dist/NiceForm-CKoJA6NG.js +4979 -0
  98. package/dist/cjs/packages/ui/dist/NiceForm-CKoJA6NG.js.map +1 -0
  99. package/dist/cjs/packages/ui/dist/NiceModal-1QX7NhyH.js +98 -0
  100. package/dist/cjs/packages/ui/dist/NiceModal-1QX7NhyH.js.map +1 -0
  101. package/dist/cjs/packages/ui/dist/NiceModuleLifecyclePanel-CMrPbSw9.js +5244 -0
  102. package/dist/cjs/packages/ui/dist/NiceModuleLifecyclePanel-CMrPbSw9.js.map +1 -0
  103. package/dist/cjs/packages/ui/dist/NicePagination-DbE-uOkl.js +174 -0
  104. package/dist/cjs/packages/ui/dist/NicePagination-DbE-uOkl.js.map +1 -0
  105. package/dist/cjs/packages/ui/dist/NicePinCodeInput-B8cI8zu8.js +10459 -0
  106. package/dist/cjs/packages/ui/dist/NicePinCodeInput-B8cI8zu8.js.map +1 -0
  107. package/dist/cjs/packages/ui/dist/NiceSavedQueryPanel-CZ5bYOe_.js +6313 -0
  108. package/dist/cjs/packages/ui/dist/NiceSavedQueryPanel-CZ5bYOe_.js.map +1 -0
  109. package/dist/cjs/packages/ui/dist/NiceTabs-DzLHzwuA.js +1639 -0
  110. package/dist/cjs/packages/ui/dist/NiceTabs-DzLHzwuA.js.map +1 -0
  111. package/dist/cjs/packages/ui/dist/NiceWindow-DeC83yfE.js +807 -0
  112. package/dist/cjs/packages/ui/dist/NiceWindow-DeC83yfE.js.map +1 -0
  113. package/dist/cjs/packages/ui/dist/charts-BAS21jkC.js +3833 -0
  114. package/dist/cjs/packages/ui/dist/charts-BAS21jkC.js.map +1 -0
  115. package/dist/cjs/packages/ui/dist/core-Da43q-pO.js +11683 -0
  116. package/dist/cjs/packages/ui/dist/core-Da43q-pO.js.map +1 -0
  117. package/dist/cjs/packages/ui/dist/index-pAuGTbuB.js +28876 -0
  118. package/dist/cjs/packages/ui/dist/index-pAuGTbuB.js.map +1 -0
  119. package/dist/cjs/photo/FilterThumb.js +7 -5
  120. package/dist/cjs/photo/FilterThumb.js.map +1 -1
  121. package/dist/cjs/photo/NiceAITools.js +78 -32
  122. package/dist/cjs/photo/NiceAITools.js.map +1 -1
  123. package/dist/cjs/photo/PhotoEditor.js +4 -4
  124. package/dist/cjs/photo/PhotoEditor.js.map +1 -1
  125. package/dist/cjs/photo/PhotoEditorCanvas.js +56 -22
  126. package/dist/cjs/photo/PhotoEditorCanvas.js.map +1 -1
  127. package/dist/cjs/photo/PhotoEditorLeftPanel.js +106 -48
  128. package/dist/cjs/photo/PhotoEditorLeftPanel.js.map +1 -1
  129. package/dist/cjs/photo/PhotoEditorToolbar.js +2 -2
  130. package/dist/cjs/photo/PhotoEditorToolbar.js.map +1 -1
  131. package/dist/cjs/photo/photoEditorActions.js +27 -18
  132. package/dist/cjs/photo/photoEditorActions.js.map +1 -1
  133. package/dist/cjs/photo/photoFilters.js +316 -81
  134. package/dist/cjs/photo/photoFilters.js.map +1 -1
  135. package/dist/cjs/photo/photoOverlays.js +521 -165
  136. package/dist/cjs/photo/photoOverlays.js.map +1 -1
  137. package/dist/cjs/photo/photoSelection.js +69 -35
  138. package/dist/cjs/photo/photoSelection.js.map +1 -1
  139. package/dist/cjs/photo/usePhotoEditor.js +203 -97
  140. package/dist/cjs/photo/usePhotoEditor.js.map +1 -1
  141. package/dist/cjs/pixel/HSVPicker.js +32 -19
  142. package/dist/cjs/pixel/HSVPicker.js.map +1 -1
  143. package/dist/cjs/pixel/PixelEditor.js +25 -14
  144. package/dist/cjs/pixel/PixelEditor.js.map +1 -1
  145. package/dist/cjs/pixel/PixelEditorCanvas.js +2 -2
  146. package/dist/cjs/pixel/PixelEditorCanvas.js.map +1 -1
  147. package/dist/cjs/pixel/PixelEditorMenuBar.js +3 -3
  148. package/dist/cjs/pixel/PixelEditorMenuBar.js.map +1 -1
  149. package/dist/cjs/pixel/PixelEditorRightPanel.js +28 -8
  150. package/dist/cjs/pixel/PixelEditorRightPanel.js.map +1 -1
  151. package/dist/cjs/pixel/PixelEditorStatusBar.js +2 -2
  152. package/dist/cjs/pixel/PixelEditorStatusBar.js.map +1 -1
  153. package/dist/cjs/pixel/PixelEditorTimeline.js +3 -4
  154. package/dist/cjs/pixel/PixelEditorTimeline.js.map +1 -1
  155. package/dist/cjs/pixel/PixelEditorToolbar.js +3 -3
  156. package/dist/cjs/pixel/PixelEditorToolbar.js.map +1 -1
  157. package/dist/cjs/pixel/SpriteGeneratorPanel.js +136 -54
  158. package/dist/cjs/pixel/SpriteGeneratorPanel.js.map +1 -1
  159. package/dist/cjs/pixel/asepriteFormat.js +122 -38
  160. package/dist/cjs/pixel/asepriteFormat.js.map +1 -1
  161. package/dist/cjs/pixel/characterGeneratorPresets.js +208 -54
  162. package/dist/cjs/pixel/characterGeneratorPresets.js.map +1 -1
  163. package/dist/cjs/pixel/pixelEditorExports.js +42 -35
  164. package/dist/cjs/pixel/pixelEditorExports.js.map +1 -1
  165. package/dist/cjs/pixel/pixelEditorTypes.js +67 -33
  166. package/dist/cjs/pixel/pixelEditorTypes.js.map +1 -1
  167. package/dist/cjs/pixel/pixelEditorUtils.js +62 -38
  168. package/dist/cjs/pixel/pixelEditorUtils.js.map +1 -1
  169. package/dist/cjs/pixel/spriteGeneratorCore.js +47 -24
  170. package/dist/cjs/pixel/spriteGeneratorCore.js.map +1 -1
  171. package/dist/cjs/pixel/usePixelEditor.js +475 -213
  172. package/dist/cjs/pixel/usePixelEditor.js.map +1 -1
  173. package/dist/cjs/texture/Nice3DTexturePainter.js +201 -71
  174. package/dist/cjs/texture/Nice3DTexturePainter.js.map +1 -1
  175. package/dist/cjs/ui/NiceUIDesigner.js +280 -91
  176. package/dist/cjs/ui/NiceUIDesigner.js.map +1 -1
  177. package/dist/cjs/vector/NiceSvgToCode.js +96 -34
  178. package/dist/cjs/vector/NiceSvgToCode.js.map +1 -1
  179. package/dist/cjs/vector/VectorEditor.js +14 -13
  180. package/dist/cjs/vector/VectorEditor.js.map +1 -1
  181. package/dist/cjs/vector/VectorEditorMenuBar.js +7 -6
  182. package/dist/cjs/vector/VectorEditorMenuBar.js.map +1 -1
  183. package/dist/cjs/vector/VectorEditorRightPanel.js +87 -32
  184. package/dist/cjs/vector/VectorEditorRightPanel.js.map +1 -1
  185. package/dist/cjs/vector/VectorEditorShapeRenderer.js +17 -15
  186. package/dist/cjs/vector/VectorEditorShapeRenderer.js.map +1 -1
  187. package/dist/cjs/vector/VectorEditorStatusBar.js.map +1 -1
  188. package/dist/cjs/vector/useVectorEditor.js +312 -122
  189. package/dist/cjs/vector/useVectorEditor.js.map +1 -1
  190. package/dist/cjs/vector/vectorBooleanOps.js +60 -42
  191. package/dist/cjs/vector/vectorBooleanOps.js.map +1 -1
  192. package/dist/cjs/vector/vectorEditorExport.js +40 -34
  193. package/dist/cjs/vector/vectorEditorExport.js.map +1 -1
  194. package/dist/cjs/vector/vectorGradients.js +41 -40
  195. package/dist/cjs/vector/vectorGradients.js.map +1 -1
  196. package/dist/esm/animation/AnimatedPerson.js +69 -63
  197. package/dist/esm/animation/AnimatedPerson.js.map +1 -1
  198. package/dist/esm/animation/AnimationEditor.js +27 -20
  199. package/dist/esm/animation/AnimationEditor.js.map +1 -1
  200. package/dist/esm/animation/Audience.js +17 -11
  201. package/dist/esm/animation/Audience.js.map +1 -1
  202. package/dist/esm/animation/BodyRenderer.js +7 -7
  203. package/dist/esm/animation/BodyRenderer.js.map +1 -1
  204. package/dist/esm/animation/animationHelper.js +83 -52
  205. package/dist/esm/animation/animationHelper.js.map +1 -1
  206. package/dist/esm/animation/characterTypes.js +171 -30
  207. package/dist/esm/animation/characterTypes.js.map +1 -1
  208. package/dist/esm/animation/choreoDSL.js +114 -62
  209. package/dist/esm/animation/choreoDSL.js.map +1 -1
  210. package/dist/esm/animation/karaokeIntegration.js +10 -11
  211. package/dist/esm/animation/karaokeIntegration.js.map +1 -1
  212. package/dist/esm/animation/lottieExport.js +15 -9
  213. package/dist/esm/animation/lottieExport.js.map +1 -1
  214. package/dist/esm/animation/motionPath.js +125 -30
  215. package/dist/esm/animation/motionPath.js.map +1 -1
  216. package/dist/esm/animation/physics.js +157 -57
  217. package/dist/esm/animation/physics.js.map +1 -1
  218. package/dist/esm/animation/rig/RigPlayer.js +7 -6
  219. package/dist/esm/animation/rig/RigPlayer.js.map +1 -1
  220. package/dist/esm/animation/rig/RiggedBody.js +7 -7
  221. package/dist/esm/animation/rig/RiggedBody.js.map +1 -1
  222. package/dist/esm/animation/rig/choreoRigBridge.js +52 -29
  223. package/dist/esm/animation/rig/choreoRigBridge.js.map +1 -1
  224. package/dist/esm/animation/rig/poseOps.js +6 -3
  225. package/dist/esm/animation/rig/poseOps.js.map +1 -1
  226. package/dist/esm/animation/shapes/arms.js +7 -6
  227. package/dist/esm/animation/shapes/arms.js.map +1 -1
  228. package/dist/esm/animation/shapes/eyes.js +31 -18
  229. package/dist/esm/animation/shapes/eyes.js.map +1 -1
  230. package/dist/esm/animation/shapes/hair.js +39 -23
  231. package/dist/esm/animation/shapes/hair.js.map +1 -1
  232. package/dist/esm/animation/shapes/heads.js +47 -29
  233. package/dist/esm/animation/shapes/heads.js.map +1 -1
  234. package/dist/esm/animation/shapes/headwear.js +26 -14
  235. package/dist/esm/animation/shapes/headwear.js.map +1 -1
  236. package/dist/esm/animation/shapes/legs.js +7 -6
  237. package/dist/esm/animation/shapes/legs.js.map +1 -1
  238. package/dist/esm/animation/shapes/mouths.js +28 -18
  239. package/dist/esm/animation/shapes/mouths.js.map +1 -1
  240. package/dist/esm/animation/shapes/noses.js +18 -9
  241. package/dist/esm/animation/shapes/noses.js.map +1 -1
  242. package/dist/esm/animation/shapes/outfits.js +25 -14
  243. package/dist/esm/animation/shapes/outfits.js.map +1 -1
  244. package/dist/esm/animation/shapes/torsos.js +5 -4
  245. package/dist/esm/animation/shapes/torsos.js.map +1 -1
  246. package/dist/esm/animation/spineExport.js +33 -26
  247. package/dist/esm/animation/spineExport.js.map +1 -1
  248. package/dist/esm/core/LocalUI.js +16 -16
  249. package/dist/esm/core/LocalUI.js.map +1 -1
  250. package/dist/esm/core/NiceBrushEngine.js +205 -69
  251. package/dist/esm/core/NiceBrushEngine.js.map +1 -1
  252. package/dist/esm/core/collaboration.js +35 -21
  253. package/dist/esm/core/collaboration.js.map +1 -1
  254. package/dist/esm/core/colorBlindness.js +64 -24
  255. package/dist/esm/core/colorBlindness.js.map +1 -1
  256. package/dist/esm/core/dragDrop.js +34 -26
  257. package/dist/esm/core/dragDrop.js.map +1 -1
  258. package/dist/esm/core/fixes.js +26 -14
  259. package/dist/esm/core/fixes.js.map +1 -1
  260. package/dist/esm/core/gridGuides.js +24 -16
  261. package/dist/esm/core/gridGuides.js.map +1 -1
  262. package/dist/esm/core/historyVisual.js +42 -23
  263. package/dist/esm/core/historyVisual.js.map +1 -1
  264. package/dist/esm/core/integrations.js +65 -48
  265. package/dist/esm/core/integrations.js.map +1 -1
  266. package/dist/esm/core/minimap.js +40 -24
  267. package/dist/esm/core/minimap.js.map +1 -1
  268. package/dist/esm/core/plugins.js +10 -6
  269. package/dist/esm/core/plugins.js.map +1 -1
  270. package/dist/esm/core/rtl.js +32 -27
  271. package/dist/esm/core/rtl.js.map +1 -1
  272. package/dist/esm/core/shortcuts.js +77 -39
  273. package/dist/esm/core/shortcuts.js.map +1 -1
  274. package/dist/esm/core/theme.js +68 -61
  275. package/dist/esm/core/theme.js.map +1 -1
  276. package/dist/esm/core/yjsCollaboration.js +61 -28
  277. package/dist/esm/core/yjsCollaboration.js.map +1 -1
  278. package/dist/esm/font/NiceFontEditor.js +160 -57
  279. package/dist/esm/font/NiceFontEditor.js.map +1 -1
  280. package/dist/esm/font/fontFormatUtils.js +37 -24
  281. package/dist/esm/font/fontFormatUtils.js.map +1 -1
  282. package/dist/esm/game/GameAsset2dEditor.js +73 -60
  283. package/dist/esm/game/GameAsset2dEditor.js.map +1 -1
  284. package/dist/esm/game/gameAssetUtils.js +18 -13
  285. package/dist/esm/game/gameAssetUtils.js.map +1 -1
  286. package/dist/esm/game/useGameAssetEditor.js +160 -143
  287. package/dist/esm/game/useGameAssetEditor.js.map +1 -1
  288. package/dist/esm/icon/NiceIconEditor.js +329 -106
  289. package/dist/esm/icon/NiceIconEditor.js.map +1 -1
  290. package/dist/esm/packages/ui/dist/NiceErrorBoundary-D75yr_WE.js +563 -0
  291. package/dist/esm/packages/ui/dist/NiceErrorBoundary-D75yr_WE.js.map +1 -0
  292. package/dist/esm/packages/ui/dist/NiceForm-CKoJA6NG.js +4960 -0
  293. package/dist/esm/packages/ui/dist/NiceForm-CKoJA6NG.js.map +1 -0
  294. package/dist/esm/packages/ui/dist/NiceModal-1QX7NhyH.js +96 -0
  295. package/dist/esm/packages/ui/dist/NiceModal-1QX7NhyH.js.map +1 -0
  296. package/dist/esm/packages/ui/dist/NiceModuleLifecyclePanel-CMrPbSw9.js +5201 -0
  297. package/dist/esm/packages/ui/dist/NiceModuleLifecyclePanel-CMrPbSw9.js.map +1 -0
  298. package/dist/esm/packages/ui/dist/NicePagination-DbE-uOkl.js +172 -0
  299. package/dist/esm/packages/ui/dist/NicePagination-DbE-uOkl.js.map +1 -0
  300. package/dist/esm/packages/ui/dist/NicePinCodeInput-B8cI8zu8.js +10408 -0
  301. package/dist/esm/packages/ui/dist/NicePinCodeInput-B8cI8zu8.js.map +1 -0
  302. package/dist/esm/packages/ui/dist/NiceSavedQueryPanel-CZ5bYOe_.js +6296 -0
  303. package/dist/esm/packages/ui/dist/NiceSavedQueryPanel-CZ5bYOe_.js.map +1 -0
  304. package/dist/esm/packages/ui/dist/NiceTabs-DzLHzwuA.js +1630 -0
  305. package/dist/esm/packages/ui/dist/NiceTabs-DzLHzwuA.js.map +1 -0
  306. package/dist/esm/packages/ui/dist/NiceWindow-DeC83yfE.js +796 -0
  307. package/dist/esm/packages/ui/dist/NiceWindow-DeC83yfE.js.map +1 -0
  308. package/dist/esm/packages/ui/dist/charts-BAS21jkC.js +3809 -0
  309. package/dist/esm/packages/ui/dist/charts-BAS21jkC.js.map +1 -0
  310. package/dist/esm/packages/ui/dist/core-Da43q-pO.js +11502 -0
  311. package/dist/esm/packages/ui/dist/core-Da43q-pO.js.map +1 -0
  312. package/dist/esm/packages/ui/dist/index-pAuGTbuB.js +28792 -0
  313. package/dist/esm/packages/ui/dist/index-pAuGTbuB.js.map +1 -0
  314. package/dist/esm/photo/FilterThumb.js +7 -5
  315. package/dist/esm/photo/FilterThumb.js.map +1 -1
  316. package/dist/esm/photo/NiceAITools.js +78 -32
  317. package/dist/esm/photo/NiceAITools.js.map +1 -1
  318. package/dist/esm/photo/PhotoEditor.js +4 -4
  319. package/dist/esm/photo/PhotoEditor.js.map +1 -1
  320. package/dist/esm/photo/PhotoEditorCanvas.js +56 -22
  321. package/dist/esm/photo/PhotoEditorCanvas.js.map +1 -1
  322. package/dist/esm/photo/PhotoEditorLeftPanel.js +106 -48
  323. package/dist/esm/photo/PhotoEditorLeftPanel.js.map +1 -1
  324. package/dist/esm/photo/PhotoEditorToolbar.js +2 -2
  325. package/dist/esm/photo/PhotoEditorToolbar.js.map +1 -1
  326. package/dist/esm/photo/photoEditorActions.js +27 -18
  327. package/dist/esm/photo/photoEditorActions.js.map +1 -1
  328. package/dist/esm/photo/photoFilters.js +316 -81
  329. package/dist/esm/photo/photoFilters.js.map +1 -1
  330. package/dist/esm/photo/photoOverlays.js +521 -165
  331. package/dist/esm/photo/photoOverlays.js.map +1 -1
  332. package/dist/esm/photo/photoSelection.js +69 -35
  333. package/dist/esm/photo/photoSelection.js.map +1 -1
  334. package/dist/esm/photo/usePhotoEditor.js +203 -97
  335. package/dist/esm/photo/usePhotoEditor.js.map +1 -1
  336. package/dist/esm/pixel/HSVPicker.js +32 -19
  337. package/dist/esm/pixel/HSVPicker.js.map +1 -1
  338. package/dist/esm/pixel/PixelEditor.js +25 -14
  339. package/dist/esm/pixel/PixelEditor.js.map +1 -1
  340. package/dist/esm/pixel/PixelEditorCanvas.js +2 -2
  341. package/dist/esm/pixel/PixelEditorCanvas.js.map +1 -1
  342. package/dist/esm/pixel/PixelEditorMenuBar.js +3 -3
  343. package/dist/esm/pixel/PixelEditorMenuBar.js.map +1 -1
  344. package/dist/esm/pixel/PixelEditorRightPanel.js +28 -8
  345. package/dist/esm/pixel/PixelEditorRightPanel.js.map +1 -1
  346. package/dist/esm/pixel/PixelEditorStatusBar.js +2 -2
  347. package/dist/esm/pixel/PixelEditorStatusBar.js.map +1 -1
  348. package/dist/esm/pixel/PixelEditorTimeline.js +3 -4
  349. package/dist/esm/pixel/PixelEditorTimeline.js.map +1 -1
  350. package/dist/esm/pixel/PixelEditorToolbar.js +3 -3
  351. package/dist/esm/pixel/PixelEditorToolbar.js.map +1 -1
  352. package/dist/esm/pixel/SpriteGeneratorPanel.js +136 -54
  353. package/dist/esm/pixel/SpriteGeneratorPanel.js.map +1 -1
  354. package/dist/esm/pixel/asepriteFormat.js +122 -38
  355. package/dist/esm/pixel/asepriteFormat.js.map +1 -1
  356. package/dist/esm/pixel/characterGeneratorPresets.js +208 -54
  357. package/dist/esm/pixel/characterGeneratorPresets.js.map +1 -1
  358. package/dist/esm/pixel/pixelEditorExports.js +42 -35
  359. package/dist/esm/pixel/pixelEditorExports.js.map +1 -1
  360. package/dist/esm/pixel/pixelEditorTypes.js +67 -33
  361. package/dist/esm/pixel/pixelEditorTypes.js.map +1 -1
  362. package/dist/esm/pixel/pixelEditorUtils.js +62 -38
  363. package/dist/esm/pixel/pixelEditorUtils.js.map +1 -1
  364. package/dist/esm/pixel/spriteGeneratorCore.js +47 -24
  365. package/dist/esm/pixel/spriteGeneratorCore.js.map +1 -1
  366. package/dist/esm/pixel/usePixelEditor.js +475 -213
  367. package/dist/esm/pixel/usePixelEditor.js.map +1 -1
  368. package/dist/esm/texture/Nice3DTexturePainter.js +201 -71
  369. package/dist/esm/texture/Nice3DTexturePainter.js.map +1 -1
  370. package/dist/esm/ui/NiceUIDesigner.js +280 -91
  371. package/dist/esm/ui/NiceUIDesigner.js.map +1 -1
  372. package/dist/esm/vector/NiceSvgToCode.js +96 -34
  373. package/dist/esm/vector/NiceSvgToCode.js.map +1 -1
  374. package/dist/esm/vector/VectorEditor.js +14 -13
  375. package/dist/esm/vector/VectorEditor.js.map +1 -1
  376. package/dist/esm/vector/VectorEditorMenuBar.js +7 -6
  377. package/dist/esm/vector/VectorEditorMenuBar.js.map +1 -1
  378. package/dist/esm/vector/VectorEditorRightPanel.js +87 -32
  379. package/dist/esm/vector/VectorEditorRightPanel.js.map +1 -1
  380. package/dist/esm/vector/VectorEditorShapeRenderer.js +17 -15
  381. package/dist/esm/vector/VectorEditorShapeRenderer.js.map +1 -1
  382. package/dist/esm/vector/VectorEditorStatusBar.js.map +1 -1
  383. package/dist/esm/vector/useVectorEditor.js +312 -122
  384. package/dist/esm/vector/useVectorEditor.js.map +1 -1
  385. package/dist/esm/vector/vectorBooleanOps.js +60 -42
  386. package/dist/esm/vector/vectorBooleanOps.js.map +1 -1
  387. package/dist/esm/vector/vectorEditorExport.js +40 -34
  388. package/dist/esm/vector/vectorEditorExport.js.map +1 -1
  389. package/dist/esm/vector/vectorGradients.js +41 -40
  390. package/dist/esm/vector/vectorGradients.js.map +1 -1
  391. package/package.json +2 -2
@@ -5,56 +5,140 @@ var React = require('react');
5
5
 
6
6
  // ── Component Palette ───────────────────────────────────────────
7
7
  const COMPONENT_DEFS = [
8
- { type: "Container", label: "Container", icon: "📦", defaultProps: {}, defaultStyle: { padding: 16, display: "flex", flexDirection: "column", gap: 8 }, allowChildren: true },
9
- { type: "Row", label: "Row", icon: "↔️", defaultProps: {}, defaultStyle: { display: "flex", flexDirection: "row", gap: 8, alignItems: "center" }, allowChildren: true },
10
- { type: "Column", label: "Column", icon: "↕️", defaultProps: {}, defaultStyle: { display: "flex", flexDirection: "column", gap: 8 }, allowChildren: true },
11
- { type: "Text", label: "Text", icon: "📝", defaultProps: { text: "Text content" }, defaultStyle: { fontSize: 14 }, allowChildren: false },
12
- { type: "Heading", label: "Heading", icon: "🔤", defaultProps: { text: "Heading", level: 2 }, defaultStyle: { fontSize: 24, fontWeight: "bold" }, allowChildren: false },
13
- { type: "Button", label: "Button", icon: "🔘", defaultProps: { text: "Click me", variant: "primary" }, defaultStyle: { padding: "8px 16px", borderRadius: 4, cursor: "pointer" }, allowChildren: false },
14
- { type: "TextInput", label: "Input", icon: "✏️", defaultProps: { placeholder: "Enter text..." }, defaultStyle: { padding: 8, border: "1px solid #ccc", borderRadius: 4 }, allowChildren: false },
15
- { type: "Image", label: "Image", icon: "🖼️", defaultProps: { src: "", alt: "Image" }, defaultStyle: { width: 200, height: 150, objectFit: "cover" }, allowChildren: false },
16
- { type: "Spacer", label: "Spacer", icon: "⬜", defaultProps: {}, defaultStyle: { height: 16 }, allowChildren: false },
17
- { type: "Divider", label: "Divider", icon: "➖", defaultProps: {}, defaultStyle: { height: 1, background: "#dee2e6", width: "100%" }, allowChildren: false },
18
- { type: "Card", label: "Card", icon: "🗂️", defaultProps: {}, defaultStyle: { padding: 16, border: "1px solid #dee2e6", borderRadius: 8, background: "#fff" }, allowChildren: true },
19
- { type: "List", label: "List", icon: "📋", defaultProps: { items: ["Item 1", "Item 2", "Item 3"] }, defaultStyle: { listStyleType: "disc", paddingLeft: 20 }, allowChildren: false },
8
+ {
9
+ type: 'Container',
10
+ label: 'Container',
11
+ icon: '📦',
12
+ defaultProps: {},
13
+ defaultStyle: { padding: 16, display: 'flex', flexDirection: 'column', gap: 8 },
14
+ allowChildren: true,
15
+ },
16
+ {
17
+ type: 'Row',
18
+ label: 'Row',
19
+ icon: '↔️',
20
+ defaultProps: {},
21
+ defaultStyle: { display: 'flex', flexDirection: 'row', gap: 8, alignItems: 'center' },
22
+ allowChildren: true,
23
+ },
24
+ {
25
+ type: 'Column',
26
+ label: 'Column',
27
+ icon: '↕️',
28
+ defaultProps: {},
29
+ defaultStyle: { display: 'flex', flexDirection: 'column', gap: 8 },
30
+ allowChildren: true,
31
+ },
32
+ {
33
+ type: 'Text',
34
+ label: 'Text',
35
+ icon: '📝',
36
+ defaultProps: { text: 'Text content' },
37
+ defaultStyle: { fontSize: 14 },
38
+ allowChildren: false,
39
+ },
40
+ {
41
+ type: 'Heading',
42
+ label: 'Heading',
43
+ icon: '🔤',
44
+ defaultProps: { text: 'Heading', level: 2 },
45
+ defaultStyle: { fontSize: 24, fontWeight: 'bold' },
46
+ allowChildren: false,
47
+ },
48
+ {
49
+ type: 'Button',
50
+ label: 'Button',
51
+ icon: '🔘',
52
+ defaultProps: { text: 'Click me', variant: 'primary' },
53
+ defaultStyle: { padding: '8px 16px', borderRadius: 4, cursor: 'pointer' },
54
+ allowChildren: false,
55
+ },
56
+ {
57
+ type: 'TextInput',
58
+ label: 'Input',
59
+ icon: '✏️',
60
+ defaultProps: { placeholder: 'Enter text...' },
61
+ defaultStyle: { padding: 8, border: '1px solid #ccc', borderRadius: 4 },
62
+ allowChildren: false,
63
+ },
64
+ {
65
+ type: 'Image',
66
+ label: 'Image',
67
+ icon: '🖼️',
68
+ defaultProps: { src: '', alt: 'Image' },
69
+ defaultStyle: { width: 200, height: 150, objectFit: 'cover' },
70
+ allowChildren: false,
71
+ },
72
+ {
73
+ type: 'Spacer',
74
+ label: 'Spacer',
75
+ icon: '⬜',
76
+ defaultProps: {},
77
+ defaultStyle: { height: 16 },
78
+ allowChildren: false,
79
+ },
80
+ {
81
+ type: 'Divider',
82
+ label: 'Divider',
83
+ icon: '➖',
84
+ defaultProps: {},
85
+ defaultStyle: { height: 1, background: '#dee2e6', width: '100%' },
86
+ allowChildren: false,
87
+ },
88
+ {
89
+ type: 'Card',
90
+ label: 'Card',
91
+ icon: '🗂️',
92
+ defaultProps: {},
93
+ defaultStyle: { padding: 16, border: '1px solid #dee2e6', borderRadius: 8, background: '#fff' },
94
+ allowChildren: true,
95
+ },
96
+ {
97
+ type: 'List',
98
+ label: 'List',
99
+ icon: '📋',
100
+ defaultProps: { items: ['Item 1', 'Item 2', 'Item 3'] },
101
+ defaultStyle: { listStyleType: 'disc', paddingLeft: 20 },
102
+ allowChildren: false,
103
+ },
20
104
  ];
21
105
  // ── Code Generation ─────────────────────────────────────────────
22
106
  function nodeToJsx(node, indent = 2) {
23
107
  var _a, _b, _c;
24
- const pad = " ".repeat(indent);
108
+ const pad = ' '.repeat(indent);
25
109
  const styleStr = Object.entries(node.style)
26
- .map(([k, v]) => `${k}: ${typeof v === "string" ? `"${v}"` : v}`)
27
- .join(", ");
110
+ .map(([k, v]) => `${k}: ${typeof v === 'string' ? `"${v}"` : v}`)
111
+ .join(', ');
28
112
  switch (node.type) {
29
- case "Text":
113
+ case 'Text':
30
114
  return `${pad}<p style={{ ${styleStr} }}>${node.props.text}</p>`;
31
- case "Heading":
115
+ case 'Heading':
32
116
  return `${pad}<h${(_a = node.props.level) !== null && _a !== void 0 ? _a : 2} style={{ ${styleStr} }}>${node.props.text}</h${(_b = node.props.level) !== null && _b !== void 0 ? _b : 2}>`;
33
- case "Button":
117
+ case 'Button':
34
118
  return `${pad}<button style={{ ${styleStr} }}>${node.props.text}</button>`;
35
- case "TextInput":
119
+ case 'TextInput':
36
120
  return `${pad}<input placeholder="${node.props.placeholder}" style={{ ${styleStr} }} />`;
37
- case "Image":
121
+ case 'Image':
38
122
  return `${pad}<img src="${node.props.src}" alt="${node.props.alt}" style={{ ${styleStr} }} />`;
39
- case "Spacer":
123
+ case 'Spacer':
40
124
  return `${pad}<div style={{ ${styleStr} }} />`;
41
- case "Divider":
125
+ case 'Divider':
42
126
  return `${pad}<hr style={{ ${styleStr} }} />`;
43
- case "List":
127
+ case 'List':
44
128
  const items = (_c = node.props.items) !== null && _c !== void 0 ? _c : [];
45
- return `${pad}<ul style={{ ${styleStr} }}>\n${items.map((i) => `${pad} <li>${i}</li>`).join("\n")}\n${pad}</ul>`;
129
+ return `${pad}<ul style={{ ${styleStr} }}>\n${items.map((i) => `${pad} <li>${i}</li>`).join('\n')}\n${pad}</ul>`;
46
130
  default: {
47
- const Tag = node.type === "Card" ? "div" : "div";
131
+ const Tag = node.type === 'Card' ? 'div' : 'div';
48
132
  if (node.children.length === 0) {
49
133
  return `${pad}<${Tag} style={{ ${styleStr} }} />`;
50
134
  }
51
- const kids = node.children.map((c) => nodeToJsx(c, indent + 2)).join("\n");
135
+ const kids = node.children.map((c) => nodeToJsx(c, indent + 2)).join('\n');
52
136
  return `${pad}<${Tag} style={{ ${styleStr} }}>\n${kids}\n${pad}</${Tag}>`;
53
137
  }
54
138
  }
55
139
  }
56
- function exportToReact(tree, componentName = "MyComponent") {
57
- const body = tree.map((n) => nodeToJsx(n, 4)).join("\n");
140
+ function exportToReact(tree, componentName = 'MyComponent') {
141
+ const body = tree.map((n) => nodeToJsx(n, 4)).join('\n');
58
142
  return `import React from "react";\n\nexport const ${componentName}: React.FC = () => {\n return (\n <div>\n${body}\n </div>\n );\n};\n`;
59
143
  }
60
144
  // ── Hook ────────────────────────────────────────────────────────
@@ -66,29 +150,33 @@ function useUIDesigner() {
66
150
  const pushHistory = React.useCallback((newTree) => {
67
151
  const next = historyRef.current.slice(0, historyIdx + 1);
68
152
  next.push(JSON.parse(JSON.stringify(newTree)));
69
- if (next.length > 40)
153
+ if (next.length > 40) {
70
154
  next.shift();
155
+ }
71
156
  historyRef.current = next;
72
157
  setHistoryIdx(next.length - 1);
73
158
  }, [historyIdx]);
74
159
  const undo = React.useCallback(() => {
75
- if (historyIdx <= 0)
160
+ if (historyIdx <= 0) {
76
161
  return;
162
+ }
77
163
  const newIdx = historyIdx - 1;
78
164
  setHistoryIdx(newIdx);
79
165
  setTree(JSON.parse(JSON.stringify(historyRef.current[newIdx])));
80
166
  }, [historyIdx]);
81
167
  const redo = React.useCallback(() => {
82
- if (historyIdx >= historyRef.current.length - 1)
168
+ if (historyIdx >= historyRef.current.length - 1) {
83
169
  return;
170
+ }
84
171
  const newIdx = historyIdx + 1;
85
172
  setHistoryIdx(newIdx);
86
173
  setTree(JSON.parse(JSON.stringify(historyRef.current[newIdx])));
87
174
  }, [historyIdx]);
88
175
  const addNode = React.useCallback((type, parentId) => {
89
176
  const def = COMPONENT_DEFS.find((d) => d.type === type);
90
- if (!def)
177
+ if (!def) {
91
178
  return;
179
+ }
92
180
  const node = {
93
181
  id: `node-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`,
94
182
  type,
@@ -111,8 +199,9 @@ function useUIDesigner() {
111
199
  const newTree = removeFromTree(tree, id);
112
200
  setTree(newTree);
113
201
  pushHistory(newTree);
114
- if (selectedId === id)
202
+ if (selectedId === id) {
115
203
  setSelectedId(null);
204
+ }
116
205
  }, [tree, selectedId, pushHistory]);
117
206
  const updateNode = React.useCallback((id, updates) => {
118
207
  const newTree = updateInTree(tree, id, updates);
@@ -122,8 +211,9 @@ function useUIDesigner() {
122
211
  const moveNode = React.useCallback((id, newParentId, index) => {
123
212
  // Find the node, remove it from current position, insert at new position
124
213
  const node = findInTree(tree, id);
125
- if (!node)
214
+ if (!node) {
126
215
  return;
216
+ }
127
217
  let newTree = removeFromTree(tree, id);
128
218
  if (newParentId) {
129
219
  newTree = addToParent(newTree, newParentId, node, index);
@@ -140,11 +230,17 @@ function useUIDesigner() {
140
230
  pushHistory(newTree);
141
231
  }, [tree, pushHistory]);
142
232
  return {
143
- tree, setTree,
144
- selectedId, setSelectedId,
145
- addNode, removeNode, updateNode, moveNode,
233
+ tree,
234
+ setTree,
235
+ selectedId,
236
+ setSelectedId,
237
+ addNode,
238
+ removeNode,
239
+ updateNode,
240
+ moveNode,
146
241
  exportCode: () => exportToReact(tree),
147
- undo, redo,
242
+ undo,
243
+ redo,
148
244
  canUndo: historyIdx > 0,
149
245
  canRedo: historyIdx < historyRef.current.length - 1,
150
246
  };
@@ -171,11 +267,13 @@ function removeFromTree(nodes, id) {
171
267
  }
172
268
  function findInTree(nodes, id) {
173
269
  for (const n of nodes) {
174
- if (n.id === id)
270
+ if (n.id === id) {
175
271
  return n;
272
+ }
176
273
  const found = findInTree(n.children, id);
177
- if (found)
274
+ if (found) {
178
275
  return found;
276
+ }
179
277
  }
180
278
  return null;
181
279
  }
@@ -193,10 +291,10 @@ function updateInTree(nodes, id, updates) {
193
291
  }
194
292
  // ── Component ───────────────────────────────────────────────────
195
293
  /** Visual drag & drop UI builder that generates React code. */
196
- const NiceUIDesigner = ({ onChange, onExport, className = "", }) => {
294
+ const NiceUIDesigner = ({ onChange, onExport, className = '', }) => {
197
295
  var _a, _b, _c, _d, _e, _f;
198
296
  const designer = useUIDesigner();
199
- const [breakpoint, setBreakpoint] = React.useState("desktop");
297
+ const [breakpoint, setBreakpoint] = React.useState('desktop');
200
298
  const [dragType, setDragType] = React.useState(null);
201
299
  const [showCode, setShowCode] = React.useState(false);
202
300
  React.useEffect(() => {
@@ -205,30 +303,40 @@ const NiceUIDesigner = ({ onChange, onExport, className = "", }) => {
205
303
  // Keyboard shortcuts
206
304
  React.useEffect(() => {
207
305
  const handler = (e) => {
208
- if (e.ctrlKey && e.key === "z") {
306
+ if (e.ctrlKey && e.key === 'z') {
209
307
  e.preventDefault();
210
308
  designer.undo();
211
309
  }
212
- if (e.ctrlKey && e.key === "y") {
310
+ if (e.ctrlKey && e.key === 'y') {
213
311
  e.preventDefault();
214
312
  designer.redo();
215
313
  }
216
- if (e.key === "Delete" && designer.selectedId) {
314
+ if (e.key === 'Delete' && designer.selectedId) {
217
315
  designer.removeNode(designer.selectedId);
218
316
  }
219
317
  };
220
- window.addEventListener("keydown", handler);
221
- return () => window.removeEventListener("keydown", handler);
318
+ window.addEventListener('keydown', handler);
319
+ return () => window.removeEventListener('keydown', handler);
222
320
  }, [designer]);
223
- const canvasWidth = breakpoint === "mobile" ? 375 : breakpoint === "tablet" ? 768 : "100%";
321
+ const canvasWidth = breakpoint === 'mobile' ? 375 : breakpoint === 'tablet' ? 768 : '100%';
224
322
  const selectedNode = designer.selectedId ? findInTree(designer.tree, designer.selectedId) : null;
225
323
  const btnStyle = (active) => ({
226
- padding: "4px 8px", border: "none", borderRadius: 3, cursor: "pointer", fontSize: 11,
227
- background: active ? "#339af0" : "#2c2e33", color: active ? "#fff" : "#c1c2c5",
324
+ padding: '4px 8px',
325
+ border: 'none',
326
+ borderRadius: 3,
327
+ cursor: 'pointer',
328
+ fontSize: 11,
329
+ background: active ? '#339af0' : '#2c2e33',
330
+ color: active ? '#fff' : '#c1c2c5',
228
331
  });
229
332
  const fieldStyle = {
230
- width: "100%", padding: "2px 4px", background: "#2c2e33", color: "#c1c2c5",
231
- border: "1px solid #373a40", borderRadius: 3, fontSize: 10,
333
+ width: '100%',
334
+ padding: '2px 4px',
335
+ background: '#2c2e33',
336
+ color: '#c1c2c5',
337
+ border: '1px solid #373a40',
338
+ borderRadius: 3,
339
+ fontSize: 10,
232
340
  };
233
341
  const handleDrop = (e, parentId) => {
234
342
  e.preventDefault();
@@ -246,56 +354,137 @@ const NiceUIDesigner = ({ onChange, onExport, className = "", }) => {
246
354
  var _a, _b, _c, _d;
247
355
  const isSelected = designer.selectedId === node.id;
248
356
  const def = COMPONENT_DEFS.find((d) => d.type === node.type);
249
- return (jsxRuntime.jsxs("div", { onClick: (e) => { e.stopPropagation(); designer.setSelectedId(node.id); }, onDrop: (e) => (def === null || def === void 0 ? void 0 : def.allowChildren) ? handleDrop(e, node.id) : undefined, onDragOver: (def === null || def === void 0 ? void 0 : def.allowChildren) ? handleDragOver : undefined, style: {
357
+ return (jsxRuntime.jsxs("div", { onClick: (e) => {
358
+ e.stopPropagation();
359
+ designer.setSelectedId(node.id);
360
+ }, onDrop: (e) => ((def === null || def === void 0 ? void 0 : def.allowChildren) ? handleDrop(e, node.id) : undefined), onDragOver: (def === null || def === void 0 ? void 0 : def.allowChildren) ? handleDragOver : undefined, style: {
250
361
  ...node.style,
251
- outline: isSelected ? "2px solid #339af0" : "1px dashed rgba(0,0,0,0.1)",
362
+ outline: isSelected ? '2px solid #339af0' : '1px dashed rgba(0,0,0,0.1)',
252
363
  outlineOffset: 1,
253
364
  minHeight: 24,
254
- position: "relative",
255
- cursor: "pointer",
256
- }, children: [node.type === "Text" || node.type === "Heading"
257
- ? String((_a = node.props.text) !== null && _a !== void 0 ? _a : "")
258
- : node.type === "Button"
259
- ? jsxRuntime.jsx("button", { style: { pointerEvents: "none" }, children: String((_b = node.props.text) !== null && _b !== void 0 ? _b : "Button") })
260
- : node.type === "TextInput"
261
- ? jsxRuntime.jsx("input", { placeholder: String((_c = node.props.placeholder) !== null && _c !== void 0 ? _c : ""), readOnly: true, style: { pointerEvents: "none", ...node.style } })
262
- : node.type === "Image"
263
- ? jsxRuntime.jsx("div", { style: { width: "100%", height: "100%", background: "#e9ecef", display: "flex", alignItems: "center", justifyContent: "center", color: "#868e96", fontSize: 11 }, children: "\uD83D\uDDBC\uFE0F Image" })
264
- : node.type === "List"
265
- ? jsxRuntime.jsx("ul", { style: { margin: 0, ...node.style }, children: ((_d = node.props.items) !== null && _d !== void 0 ? _d : []).map((item, i) => jsxRuntime.jsx("li", { children: item }, i)) })
266
- : node.type === "Divider"
267
- ? jsxRuntime.jsx("hr", { style: { margin: 0, border: "none", borderTop: "1px solid #dee2e6", width: "100%" } })
268
- : node.children.map((c) => renderNode(c, depth + 1)), isSelected && jsxRuntime.jsx("div", { style: { position: "absolute", top: -12, left: 0, fontSize: 9, background: "#339af0", color: "#fff", padding: "0 4px", borderRadius: "2px 2px 0 0" }, children: node.type })] }, node.id));
365
+ position: 'relative',
366
+ cursor: 'pointer',
367
+ }, children: [node.type === 'Text' || node.type === 'Heading' ? (String((_a = node.props.text) !== null && _a !== void 0 ? _a : '')) : node.type === 'Button' ? (jsxRuntime.jsx("button", { style: { pointerEvents: 'none' }, children: String((_b = node.props.text) !== null && _b !== void 0 ? _b : 'Button') })) : node.type === 'TextInput' ? (jsxRuntime.jsx("input", { placeholder: String((_c = node.props.placeholder) !== null && _c !== void 0 ? _c : ''), readOnly: true, style: { pointerEvents: 'none', ...node.style } })) : node.type === 'Image' ? (jsxRuntime.jsx("div", { style: {
368
+ width: '100%',
369
+ height: '100%',
370
+ background: '#e9ecef',
371
+ display: 'flex',
372
+ alignItems: 'center',
373
+ justifyContent: 'center',
374
+ color: '#868e96',
375
+ fontSize: 11,
376
+ }, children: "\uD83D\uDDBC\uFE0F Image" })) : node.type === 'List' ? (jsxRuntime.jsx("ul", { style: { margin: 0, ...node.style }, children: ((_d = node.props.items) !== null && _d !== void 0 ? _d : []).map((item, i) => (jsxRuntime.jsx("li", { children: item }, i))) })) : node.type === 'Divider' ? (jsxRuntime.jsx("hr", { style: { margin: 0, border: 'none', borderTop: '1px solid #dee2e6', width: '100%' } })) : (node.children.map((c) => renderNode(c, depth + 1))), isSelected && (jsxRuntime.jsx("div", { style: {
377
+ position: 'absolute',
378
+ top: -12,
379
+ left: 0,
380
+ fontSize: 9,
381
+ background: '#339af0',
382
+ color: '#fff',
383
+ padding: '0 4px',
384
+ borderRadius: '2px 2px 0 0',
385
+ }, children: node.type }))] }, node.id));
269
386
  };
270
387
  const renderTreeItem = (node, depth = 0) => {
271
388
  const def = COMPONENT_DEFS.find((d) => d.type === node.type);
272
389
  return (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsxs("div", { onClick: () => designer.setSelectedId(node.id), style: {
273
- padding: "2px 4px", paddingLeft: 4 + depth * 12, fontSize: 10,
274
- cursor: "pointer", display: "flex", alignItems: "center", gap: 4,
275
- background: designer.selectedId === node.id ? "rgba(51,154,240,0.2)" : "transparent",
390
+ padding: '2px 4px',
391
+ paddingLeft: 4 + depth * 12,
392
+ fontSize: 10,
393
+ cursor: 'pointer',
394
+ display: 'flex',
395
+ alignItems: 'center',
396
+ gap: 4,
397
+ background: designer.selectedId === node.id ? 'rgba(51,154,240,0.2)' : 'transparent',
276
398
  borderRadius: 2,
277
- }, children: [jsxRuntime.jsx("span", { children: def === null || def === void 0 ? void 0 : def.icon }), jsxRuntime.jsxs("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [node.type, node.props.text ? `: ${String(node.props.text).slice(0, 15)}` : ""] })] }), node.children.map((c) => renderTreeItem(c, depth + 1))] }, node.id));
399
+ }, children: [jsxRuntime.jsx("span", { children: def === null || def === void 0 ? void 0 : def.icon }), jsxRuntime.jsxs("span", { style: { flex: 1, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }, children: [node.type, node.props.text ? `: ${String(node.props.text).slice(0, 15)}` : ''] })] }), node.children.map((c) => renderTreeItem(c, depth + 1))] }, node.id));
278
400
  };
279
- return (jsxRuntime.jsxs("div", { className: `nice-ui-designer ${className}`, style: { display: "flex", gap: 8, height: "100%", background: "#1a1b1e", color: "#c1c2c5", padding: 8, borderRadius: 8 }, children: [jsxRuntime.jsxs("div", { style: { width: 160, display: "flex", flexDirection: "column", gap: 8, fontSize: 11 }, children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("strong", { style: { fontSize: 12, display: "block", marginBottom: 4 }, children: "Components" }), jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: 2 }, children: COMPONENT_DEFS.map((def) => (jsxRuntime.jsxs("button", { draggable: true, onDragStart: () => setDragType(def.type), onDragEnd: () => setDragType(null), onClick: () => { var _a; return designer.addNode(def.type, (_a = designer.selectedId) !== null && _a !== void 0 ? _a : undefined); }, style: {
280
- display: "flex", alignItems: "center", gap: 4, padding: "4px 6px",
281
- background: "#2c2e33", border: "none", borderRadius: 3,
282
- color: "#c1c2c5", cursor: "grab", textAlign: "left", fontSize: 11,
283
- }, children: [def.icon, " ", def.label] }, def.type))) })] }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("strong", { style: { fontSize: 12, display: "block", marginBottom: 4 }, children: "Tree" }), jsxRuntime.jsx("div", { style: { maxHeight: 200, overflowY: "auto" }, children: designer.tree.length === 0
284
- ? jsxRuntime.jsx("div", { style: { color: "#5c5f66", padding: 4 }, children: "Empty" })
285
- : designer.tree.map((n) => renderTreeItem(n)) })] })] }), jsxRuntime.jsxs("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: 4 }, children: [jsxRuntime.jsxs("div", { style: { display: "flex", gap: 4, alignItems: "center", fontSize: 11 }, children: [jsxRuntime.jsx("button", { onClick: () => designer.undo(), disabled: !designer.canUndo, style: { ...btnStyle(false), opacity: designer.canUndo ? 1 : 0.4 }, title: "Undo (Ctrl+Z)", children: "\u21A9" }), jsxRuntime.jsx("button", { onClick: () => designer.redo(), disabled: !designer.canRedo, style: { ...btnStyle(false), opacity: designer.canRedo ? 1 : 0.4 }, title: "Redo (Ctrl+Y)", children: "\u21AA" }), jsxRuntime.jsx("div", { style: { width: 1, height: 16, background: "#373a40" } }), jsxRuntime.jsx("button", { onClick: () => setBreakpoint("desktop"), style: btnStyle(breakpoint === "desktop"), children: "\uD83D\uDDA5 Desktop" }), jsxRuntime.jsx("button", { onClick: () => setBreakpoint("tablet"), style: btnStyle(breakpoint === "tablet"), children: "\uD83D\uDCF1 Tablet" }), jsxRuntime.jsx("button", { onClick: () => setBreakpoint("mobile"), style: btnStyle(breakpoint === "mobile"), children: "\uD83D\uDCF2 Mobile" }), jsxRuntime.jsx("div", { style: { flex: 1 } }), designer.selectedId && (jsxRuntime.jsx("button", { onClick: () => designer.removeNode(designer.selectedId), style: { ...btnStyle(false), color: "#ff6b6b" }, children: "\uD83D\uDDD1 Delete" })), jsxRuntime.jsxs("button", { onClick: () => setShowCode((v) => !v), style: btnStyle(showCode), children: ["</>", " Code"] }), jsxRuntime.jsx("button", { onClick: () => onExport === null || onExport === void 0 ? void 0 : onExport(designer.exportCode()), style: { padding: "4px 8px", background: "#228be6", color: "#fff", border: "none", borderRadius: 3, cursor: "pointer", fontSize: 11 }, children: "Export" })] }), showCode ? (jsxRuntime.jsx("pre", { style: { flex: 1, background: "#141517", borderRadius: 6, padding: 12, margin: 0, overflow: "auto", fontSize: 11, color: "#a6e3a1", fontFamily: "monospace" }, children: designer.exportCode() })) : (jsxRuntime.jsx("div", { style: {
286
- flex: 1, background: "#fff", borderRadius: 6, padding: 16, overflow: "auto", color: "#212529",
287
- maxWidth: canvasWidth, margin: breakpoint !== "desktop" ? "0 auto" : undefined,
288
- border: breakpoint !== "desktop" ? "1px solid #373a40" : undefined,
289
- transition: "max-width 0.2s",
290
- }, onDrop: (e) => handleDrop(e), onDragOver: handleDragOver, children: designer.tree.length === 0
291
- ? jsxRuntime.jsx("div", { style: { textAlign: "center", padding: 40, color: "#868e96" }, children: "Drag or click a component to add it" })
292
- : designer.tree.map((n) => renderNode(n)) }))] }), jsxRuntime.jsxs("div", { style: { width: 200, fontSize: 11, display: "flex", flexDirection: "column", gap: 4, overflowY: "auto" }, children: [jsxRuntime.jsx("strong", { style: { fontSize: 12 }, children: "Properties" }), selectedNode ? (jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [jsxRuntime.jsxs("div", { style: { color: "#868e96" }, children: [(_a = COMPONENT_DEFS.find((d) => d.type === selectedNode.type)) === null || _a === void 0 ? void 0 : _a.icon, " ", selectedNode.type] }), selectedNode.props.text !== undefined && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "Text" }), jsxRuntime.jsx("input", { value: String(selectedNode.props.text), onChange: (e) => designer.updateNode(selectedNode.id, { props: { text: e.target.value } }), style: fieldStyle })] })), selectedNode.props.placeholder !== undefined && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "Placeholder" }), jsxRuntime.jsx("input", { value: String(selectedNode.props.placeholder), onChange: (e) => designer.updateNode(selectedNode.id, { props: { placeholder: e.target.value } }), style: fieldStyle })] })), selectedNode.props.level !== undefined && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "Heading Level" }), jsxRuntime.jsx("select", { value: Number(selectedNode.props.level), onChange: (e) => designer.updateNode(selectedNode.id, { props: { level: Number(e.target.value) } }), style: fieldStyle, children: [1, 2, 3, 4, 5, 6].map((v) => jsxRuntime.jsxs("option", { value: v, children: ["H", v] }, v)) })] })), selectedNode.props.variant !== undefined && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "Variant" }), jsxRuntime.jsx("select", { value: String(selectedNode.props.variant), onChange: (e) => designer.updateNode(selectedNode.id, { props: { variant: e.target.value } }), style: fieldStyle, children: ["primary", "secondary", "outline", "ghost"].map((v) => jsxRuntime.jsx("option", { value: v, children: v }, v)) })] })), selectedNode.props.src !== undefined && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "Image URL" }), jsxRuntime.jsx("input", { value: String(selectedNode.props.src), onChange: (e) => designer.updateNode(selectedNode.id, { props: { src: e.target.value } }), style: fieldStyle })] })), selectedNode.props.alt !== undefined && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "Alt Text" }), jsxRuntime.jsx("input", { value: String(selectedNode.props.alt), onChange: (e) => designer.updateNode(selectedNode.id, { props: { alt: e.target.value } }), style: fieldStyle })] })), jsxRuntime.jsx("hr", { style: { border: "none", borderTop: "1px solid #373a40", margin: "4px 0" } }), jsxRuntime.jsx("strong", { style: { color: "#868e96" }, children: "Style" }), ["padding", "margin", "gap", "borderRadius"].map((prop) => (jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [jsxRuntime.jsx("label", { style: { minWidth: 60 }, children: prop }), jsxRuntime.jsx("input", { type: "number", value: typeof selectedNode.style[prop] === "number" ? selectedNode.style[prop] : 0, onChange: (e) => designer.updateNode(selectedNode.id, { style: { [prop]: Number(e.target.value) } }), style: { ...fieldStyle, width: 50 } })] }, prop))), jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [jsxRuntime.jsx("label", { style: { minWidth: 60 }, children: "fontSize" }), jsxRuntime.jsx("input", { type: "number", value: typeof selectedNode.style.fontSize === "number" ? selectedNode.style.fontSize : 14, onChange: (e) => designer.updateNode(selectedNode.id, { style: { fontSize: Number(e.target.value) } }), style: { ...fieldStyle, width: 50 } })] }), jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [jsxRuntime.jsx("label", { style: { minWidth: 60 }, children: "color" }), jsxRuntime.jsx("input", { type: "color", value: typeof selectedNode.style.color === "string" ? selectedNode.style.color : "#000000", onChange: (e) => designer.updateNode(selectedNode.id, { style: { color: e.target.value } }), style: { width: 24, height: 20, border: "none", cursor: "pointer" } })] }), jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [jsxRuntime.jsx("label", { style: { minWidth: 60 }, children: "bgColor" }), jsxRuntime.jsx("input", { type: "color", value: typeof selectedNode.style.background === "string" ? selectedNode.style.background : "#ffffff", onChange: (e) => designer.updateNode(selectedNode.id, { style: { background: e.target.value } }), style: { width: 24, height: 20, border: "none", cursor: "pointer" } })] }), selectedNode.style.display === "flex" && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [jsxRuntime.jsx("label", { style: { minWidth: 60 }, children: "direction" }), jsxRuntime.jsxs("select", { value: (_b = selectedNode.style.flexDirection) !== null && _b !== void 0 ? _b : "column", onChange: (e) => designer.updateNode(selectedNode.id, { style: { flexDirection: e.target.value } }), style: { ...fieldStyle, width: 80 }, children: [jsxRuntime.jsx("option", { value: "row", children: "row" }), jsxRuntime.jsx("option", { value: "column", children: "column" })] })] }), jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [jsxRuntime.jsx("label", { style: { minWidth: 60 }, children: "align" }), jsxRuntime.jsx("select", { value: (_c = selectedNode.style.alignItems) !== null && _c !== void 0 ? _c : "stretch", onChange: (e) => designer.updateNode(selectedNode.id, { style: { alignItems: e.target.value } }), style: { ...fieldStyle, width: 80 }, children: ["stretch", "center", "flex-start", "flex-end"].map((v) => jsxRuntime.jsx("option", { value: v, children: v }, v)) })] }), jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [jsxRuntime.jsx("label", { style: { minWidth: 60 }, children: "justify" }), jsxRuntime.jsx("select", { value: (_d = selectedNode.style.justifyContent) !== null && _d !== void 0 ? _d : "flex-start", onChange: (e) => designer.updateNode(selectedNode.id, { style: { justifyContent: e.target.value } }), style: { ...fieldStyle, width: 80 }, children: ["flex-start", "center", "flex-end", "space-between", "space-around"].map((v) => jsxRuntime.jsx("option", { value: v, children: v }, v)) })] })] })), jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [jsxRuntime.jsx("label", { style: { minWidth: 60 }, children: "width" }), jsxRuntime.jsx("input", { value: (_e = selectedNode.style.width) !== null && _e !== void 0 ? _e : "", placeholder: "auto", onChange: (e) => {
401
+ return (jsxRuntime.jsxs("div", { className: `nice-ui-designer ${className}`, style: {
402
+ display: 'flex',
403
+ gap: 8,
404
+ height: '100%',
405
+ background: '#1a1b1e',
406
+ color: '#c1c2c5',
407
+ padding: 8,
408
+ borderRadius: 8,
409
+ }, children: [jsxRuntime.jsxs("div", { style: { width: 160, display: 'flex', flexDirection: 'column', gap: 8, fontSize: 11 }, children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("strong", { style: { fontSize: 12, display: 'block', marginBottom: 4 }, children: "Components" }), jsxRuntime.jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: 2 }, children: COMPONENT_DEFS.map((def) => (jsxRuntime.jsxs("button", { draggable: true, onDragStart: () => setDragType(def.type), onDragEnd: () => setDragType(null), onClick: () => { var _a; return designer.addNode(def.type, (_a = designer.selectedId) !== null && _a !== void 0 ? _a : undefined); }, style: {
410
+ display: 'flex',
411
+ alignItems: 'center',
412
+ gap: 4,
413
+ padding: '4px 6px',
414
+ background: '#2c2e33',
415
+ border: 'none',
416
+ borderRadius: 3,
417
+ color: '#c1c2c5',
418
+ cursor: 'grab',
419
+ textAlign: 'left',
420
+ fontSize: 11,
421
+ }, children: [def.icon, " ", def.label] }, def.type))) })] }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("strong", { style: { fontSize: 12, display: 'block', marginBottom: 4 }, children: "Tree" }), jsxRuntime.jsx("div", { style: { maxHeight: 200, overflowY: 'auto' }, children: designer.tree.length === 0 ? (jsxRuntime.jsx("div", { style: { color: '#5c5f66', padding: 4 }, children: "Empty" })) : (designer.tree.map((n) => renderTreeItem(n))) })] })] }), jsxRuntime.jsxs("div", { style: { flex: 1, display: 'flex', flexDirection: 'column', gap: 4 }, children: [jsxRuntime.jsxs("div", { style: { display: 'flex', gap: 4, alignItems: 'center', fontSize: 11 }, children: [jsxRuntime.jsx("button", { onClick: () => designer.undo(), disabled: !designer.canUndo, style: { ...btnStyle(false), opacity: designer.canUndo ? 1 : 0.4 }, title: "Undo (Ctrl+Z)", children: "\u21A9" }), jsxRuntime.jsx("button", { onClick: () => designer.redo(), disabled: !designer.canRedo, style: { ...btnStyle(false), opacity: designer.canRedo ? 1 : 0.4 }, title: "Redo (Ctrl+Y)", children: "\u21AA" }), jsxRuntime.jsx("div", { style: { width: 1, height: 16, background: '#373a40' } }), jsxRuntime.jsx("button", { onClick: () => setBreakpoint('desktop'), style: btnStyle(breakpoint === 'desktop'), children: "\uD83D\uDDA5 Desktop" }), jsxRuntime.jsx("button", { onClick: () => setBreakpoint('tablet'), style: btnStyle(breakpoint === 'tablet'), children: "\uD83D\uDCF1 Tablet" }), jsxRuntime.jsx("button", { onClick: () => setBreakpoint('mobile'), style: btnStyle(breakpoint === 'mobile'), children: "\uD83D\uDCF2 Mobile" }), jsxRuntime.jsx("div", { style: { flex: 1 } }), designer.selectedId && (jsxRuntime.jsx("button", { onClick: () => designer.removeNode(designer.selectedId), style: { ...btnStyle(false), color: '#ff6b6b' }, children: "\uD83D\uDDD1 Delete" })), jsxRuntime.jsxs("button", { onClick: () => setShowCode((v) => !v), style: btnStyle(showCode), children: ['</>', " Code"] }), jsxRuntime.jsx("button", { onClick: () => onExport === null || onExport === void 0 ? void 0 : onExport(designer.exportCode()), style: {
422
+ padding: '4px 8px',
423
+ background: '#228be6',
424
+ color: '#fff',
425
+ border: 'none',
426
+ borderRadius: 3,
427
+ cursor: 'pointer',
428
+ fontSize: 11,
429
+ }, children: "Export" })] }), showCode ? (jsxRuntime.jsx("pre", { style: {
430
+ flex: 1,
431
+ background: '#141517',
432
+ borderRadius: 6,
433
+ padding: 12,
434
+ margin: 0,
435
+ overflow: 'auto',
436
+ fontSize: 11,
437
+ color: '#a6e3a1',
438
+ fontFamily: 'monospace',
439
+ }, children: designer.exportCode() })) : (jsxRuntime.jsx("div", { style: {
440
+ flex: 1,
441
+ background: '#fff',
442
+ borderRadius: 6,
443
+ padding: 16,
444
+ overflow: 'auto',
445
+ color: '#212529',
446
+ maxWidth: canvasWidth,
447
+ margin: breakpoint !== 'desktop' ? '0 auto' : undefined,
448
+ border: breakpoint !== 'desktop' ? '1px solid #373a40' : undefined,
449
+ transition: 'max-width 0.2s',
450
+ }, onDrop: (e) => handleDrop(e), onDragOver: handleDragOver, children: designer.tree.length === 0 ? (jsxRuntime.jsx("div", { style: { textAlign: 'center', padding: 40, color: '#868e96' }, children: "Drag or click a component to add it" })) : (designer.tree.map((n) => renderNode(n))) }))] }), jsxRuntime.jsxs("div", { style: {
451
+ width: 200,
452
+ fontSize: 11,
453
+ display: 'flex',
454
+ flexDirection: 'column',
455
+ gap: 4,
456
+ overflowY: 'auto',
457
+ }, children: [jsxRuntime.jsx("strong", { style: { fontSize: 12 }, children: "Properties" }), selectedNode ? (jsxRuntime.jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 6 }, children: [jsxRuntime.jsxs("div", { style: { color: '#868e96' }, children: [(_a = COMPONENT_DEFS.find((d) => d.type === selectedNode.type)) === null || _a === void 0 ? void 0 : _a.icon, " ", selectedNode.type] }), selectedNode.props.text !== undefined && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "Text" }), jsxRuntime.jsx("input", { value: String(selectedNode.props.text), onChange: (e) => designer.updateNode(selectedNode.id, { props: { text: e.target.value } }), style: fieldStyle })] })), selectedNode.props.placeholder !== undefined && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "Placeholder" }), jsxRuntime.jsx("input", { value: String(selectedNode.props.placeholder), onChange: (e) => designer.updateNode(selectedNode.id, { props: { placeholder: e.target.value } }), style: fieldStyle })] })), selectedNode.props.level !== undefined && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "Heading Level" }), jsxRuntime.jsx("select", { value: Number(selectedNode.props.level), onChange: (e) => designer.updateNode(selectedNode.id, {
458
+ props: { level: Number(e.target.value) },
459
+ }), style: fieldStyle, children: [1, 2, 3, 4, 5, 6].map((v) => (jsxRuntime.jsxs("option", { value: v, children: ["H", v] }, v))) })] })), selectedNode.props.variant !== undefined && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "Variant" }), jsxRuntime.jsx("select", { value: String(selectedNode.props.variant), onChange: (e) => designer.updateNode(selectedNode.id, { props: { variant: e.target.value } }), style: fieldStyle, children: ['primary', 'secondary', 'outline', 'ghost'].map((v) => (jsxRuntime.jsx("option", { value: v, children: v }, v))) })] })), selectedNode.props.src !== undefined && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "Image URL" }), jsxRuntime.jsx("input", { value: String(selectedNode.props.src), onChange: (e) => designer.updateNode(selectedNode.id, { props: { src: e.target.value } }), style: fieldStyle })] })), selectedNode.props.alt !== undefined && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "Alt Text" }), jsxRuntime.jsx("input", { value: String(selectedNode.props.alt), onChange: (e) => designer.updateNode(selectedNode.id, { props: { alt: e.target.value } }), style: fieldStyle })] })), jsxRuntime.jsx("hr", { style: { border: 'none', borderTop: '1px solid #373a40', margin: '4px 0' } }), jsxRuntime.jsx("strong", { style: { color: '#868e96' }, children: "Style" }), ['padding', 'margin', 'gap', 'borderRadius'].map((prop) => (jsxRuntime.jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 4 }, children: [jsxRuntime.jsx("label", { style: { minWidth: 60 }, children: prop }), jsxRuntime.jsx("input", { type: "number", value: typeof selectedNode.style[prop] === 'number'
460
+ ? selectedNode.style[prop]
461
+ : 0, onChange: (e) => designer.updateNode(selectedNode.id, {
462
+ style: { [prop]: Number(e.target.value) },
463
+ }), style: { ...fieldStyle, width: 50 } })] }, prop))), jsxRuntime.jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 4 }, children: [jsxRuntime.jsx("label", { style: { minWidth: 60 }, children: "fontSize" }), jsxRuntime.jsx("input", { type: "number", value: typeof selectedNode.style.fontSize === 'number' ? selectedNode.style.fontSize : 14, onChange: (e) => designer.updateNode(selectedNode.id, {
464
+ style: { fontSize: Number(e.target.value) },
465
+ }), style: { ...fieldStyle, width: 50 } })] }), jsxRuntime.jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 4 }, children: [jsxRuntime.jsx("label", { style: { minWidth: 60 }, children: "color" }), jsxRuntime.jsx("input", { type: "color", value: typeof selectedNode.style.color === 'string'
466
+ ? selectedNode.style.color
467
+ : '#000000', onChange: (e) => designer.updateNode(selectedNode.id, { style: { color: e.target.value } }), style: { width: 24, height: 20, border: 'none', cursor: 'pointer' } })] }), jsxRuntime.jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 4 }, children: [jsxRuntime.jsx("label", { style: { minWidth: 60 }, children: "bgColor" }), jsxRuntime.jsx("input", { type: "color", value: typeof selectedNode.style.background === 'string'
468
+ ? selectedNode.style.background
469
+ : '#ffffff', onChange: (e) => designer.updateNode(selectedNode.id, { style: { background: e.target.value } }), style: { width: 24, height: 20, border: 'none', cursor: 'pointer' } })] }), selectedNode.style.display === 'flex' && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 4 }, children: [jsxRuntime.jsx("label", { style: { minWidth: 60 }, children: "direction" }), jsxRuntime.jsxs("select", { value: (_b = selectedNode.style.flexDirection) !== null && _b !== void 0 ? _b : 'column', onChange: (e) => designer.updateNode(selectedNode.id, {
470
+ style: {
471
+ flexDirection: e.target.value,
472
+ },
473
+ }), style: { ...fieldStyle, width: 80 }, children: [jsxRuntime.jsx("option", { value: "row", children: "row" }), jsxRuntime.jsx("option", { value: "column", children: "column" })] })] }), jsxRuntime.jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 4 }, children: [jsxRuntime.jsx("label", { style: { minWidth: 60 }, children: "align" }), jsxRuntime.jsx("select", { value: (_c = selectedNode.style.alignItems) !== null && _c !== void 0 ? _c : 'stretch', onChange: (e) => designer.updateNode(selectedNode.id, {
474
+ style: { alignItems: e.target.value },
475
+ }), style: { ...fieldStyle, width: 80 }, children: ['stretch', 'center', 'flex-start', 'flex-end'].map((v) => (jsxRuntime.jsx("option", { value: v, children: v }, v))) })] }), jsxRuntime.jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 4 }, children: [jsxRuntime.jsx("label", { style: { minWidth: 60 }, children: "justify" }), jsxRuntime.jsx("select", { value: (_d = selectedNode.style.justifyContent) !== null && _d !== void 0 ? _d : 'flex-start', onChange: (e) => designer.updateNode(selectedNode.id, {
476
+ style: { justifyContent: e.target.value },
477
+ }), style: { ...fieldStyle, width: 80 }, children: ['flex-start', 'center', 'flex-end', 'space-between', 'space-around'].map((v) => (jsxRuntime.jsx("option", { value: v, children: v }, v))) })] })] })), jsxRuntime.jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 4 }, children: [jsxRuntime.jsx("label", { style: { minWidth: 60 }, children: "width" }), jsxRuntime.jsx("input", { value: (_e = selectedNode.style.width) !== null && _e !== void 0 ? _e : '', placeholder: "auto", onChange: (e) => {
293
478
  const v = e.target.value;
294
- designer.updateNode(selectedNode.id, { style: { width: isNaN(Number(v)) ? v : Number(v) } });
295
- }, style: { ...fieldStyle, width: 60 } })] }), jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [jsxRuntime.jsx("label", { style: { minWidth: 60 }, children: "height" }), jsxRuntime.jsx("input", { value: (_f = selectedNode.style.height) !== null && _f !== void 0 ? _f : "", placeholder: "auto", onChange: (e) => {
479
+ designer.updateNode(selectedNode.id, {
480
+ style: { width: isNaN(Number(v)) ? v : Number(v) },
481
+ });
482
+ }, style: { ...fieldStyle, width: 60 } })] }), jsxRuntime.jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 4 }, children: [jsxRuntime.jsx("label", { style: { minWidth: 60 }, children: "height" }), jsxRuntime.jsx("input", { value: (_f = selectedNode.style.height) !== null && _f !== void 0 ? _f : '', placeholder: "auto", onChange: (e) => {
296
483
  const v = e.target.value;
297
- designer.updateNode(selectedNode.id, { style: { height: isNaN(Number(v)) ? v : Number(v) } });
298
- }, style: { ...fieldStyle, width: 60 } })] })] })) : (jsxRuntime.jsx("div", { style: { color: "#5c5f66", padding: 8, textAlign: "center" }, children: "Select an element" }))] })] }));
484
+ designer.updateNode(selectedNode.id, {
485
+ style: { height: isNaN(Number(v)) ? v : Number(v) },
486
+ });
487
+ }, style: { ...fieldStyle, width: 60 } })] })] })) : (jsxRuntime.jsx("div", { style: { color: '#5c5f66', padding: 8, textAlign: 'center' }, children: "Select an element" }))] })] }));
299
488
  };
300
489
 
301
490
  exports.NiceUIDesigner = NiceUIDesigner;