@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
@@ -7,30 +7,31 @@ var React = require('react');
7
7
  const DEFAULT_ICON_CONFIG = {
8
8
  viewBox: 24,
9
9
  strokeWidth: 2,
10
- strokeLinecap: "round",
11
- strokeLinejoin: "round",
12
- fill: "none",
13
- stroke: "currentColor",
14
- variant: "outline",
10
+ strokeLinecap: 'round',
11
+ strokeLinejoin: 'round',
12
+ fill: 'none',
13
+ stroke: 'currentColor',
14
+ variant: 'outline',
15
15
  };
16
16
  // ── Hook ────────────────────────────────────────────────────────
17
17
  function useIconEditor(initialSvg) {
18
18
  const [config, setConfig] = React.useState(DEFAULT_ICON_CONFIG);
19
19
  const [shapes, setShapes] = React.useState([]);
20
20
  const [selectedId, setSelectedId] = React.useState(null);
21
- const [tool, setTool] = React.useState("select");
21
+ const [tool, setTool] = React.useState('select');
22
22
  const [snapToGrid, setSnapToGrid] = React.useState(true);
23
23
  const [historyIdx, setHistoryIdx] = React.useState(0);
24
24
  const historyRef = React.useRef([[]]);
25
25
  // Parse initial SVG
26
26
  React.useEffect(() => {
27
- if (!initialSvg)
27
+ if (!initialSvg) {
28
28
  return;
29
+ }
29
30
  const pathMatches = initialSvg.matchAll(/<path[^>]*d="([^"]*)"[^>]*\/?>/g);
30
31
  const parsed = [];
31
32
  let id = 0;
32
33
  for (const match of pathMatches) {
33
- parsed.push({ id: `shape-${id++}`, type: "path", d: match[1] });
34
+ parsed.push({ id: `shape-${id++}`, type: 'path', d: match[1] });
34
35
  }
35
36
  if (parsed.length > 0) {
36
37
  setShapes(parsed);
@@ -42,20 +43,23 @@ function useIconEditor(initialSvg) {
42
43
  const snap = JSON.parse(JSON.stringify(newShapes));
43
44
  historyRef.current = historyRef.current.slice(0, historyIdx + 1);
44
45
  historyRef.current.push(snap);
45
- if (historyRef.current.length > 50)
46
+ if (historyRef.current.length > 50) {
46
47
  historyRef.current.shift();
48
+ }
47
49
  setHistoryIdx(historyRef.current.length - 1);
48
50
  }, [historyIdx]);
49
51
  const undo = React.useCallback(() => {
50
- if (historyIdx <= 0)
52
+ if (historyIdx <= 0) {
51
53
  return;
54
+ }
52
55
  const newIdx = historyIdx - 1;
53
56
  setHistoryIdx(newIdx);
54
57
  setShapes(JSON.parse(JSON.stringify(historyRef.current[newIdx])));
55
58
  }, [historyIdx]);
56
59
  const redo = React.useCallback(() => {
57
- if (historyIdx >= historyRef.current.length - 1)
60
+ if (historyIdx >= historyRef.current.length - 1) {
58
61
  return;
62
+ }
59
63
  const newIdx = historyIdx + 1;
60
64
  setHistoryIdx(newIdx);
61
65
  setShapes(JSON.parse(JSON.stringify(historyRef.current[newIdx])));
@@ -75,61 +79,73 @@ function useIconEditor(initialSvg) {
75
79
  const deleteShape = React.useCallback((id) => {
76
80
  const newShapes = shapes.filter((s) => s.id !== id);
77
81
  setShapes(newShapes);
78
- if (selectedId === id)
82
+ if (selectedId === id) {
79
83
  setSelectedId(null);
84
+ }
80
85
  pushHistory(newShapes);
81
86
  }, [shapes, selectedId, pushHistory]);
82
87
  const toSvg = React.useCallback(() => {
83
88
  const vb = config.viewBox;
84
- const children = shapes.map((s) => {
89
+ const children = shapes
90
+ .map((s) => {
85
91
  var _a, _b, _c;
86
92
  const fill = (_a = s.fill) !== null && _a !== void 0 ? _a : config.fill;
87
93
  const stroke = (_b = s.stroke) !== null && _b !== void 0 ? _b : config.stroke;
88
94
  const sw = (_c = s.strokeWidth) !== null && _c !== void 0 ? _c : config.strokeWidth;
89
95
  switch (s.type) {
90
- case "path":
96
+ case 'path':
91
97
  return ` <path d="${s.d}" fill="${fill}" stroke="${stroke}" stroke-width="${sw}" stroke-linecap="${config.strokeLinecap}" stroke-linejoin="${config.strokeLinejoin}" />`;
92
- case "circle":
98
+ case 'circle':
93
99
  return ` <circle cx="${s.cx}" cy="${s.cy}" r="${s.r}" fill="${fill}" stroke="${stroke}" stroke-width="${sw}" />`;
94
- case "rect":
100
+ case 'rect':
95
101
  return ` <rect x="${s.x}" y="${s.y}" width="${s.width}" height="${s.height}" fill="${fill}" stroke="${stroke}" stroke-width="${sw}" rx="1" />`;
96
- case "line":
102
+ case 'line':
97
103
  return ` <line x1="${s.x1}" y1="${s.y1}" x2="${s.x2}" y2="${s.y2}" stroke="${stroke}" stroke-width="${sw}" stroke-linecap="${config.strokeLinecap}" />`;
98
104
  default:
99
- return "";
105
+ return '';
100
106
  }
101
- }).join("\n");
107
+ })
108
+ .join('\n');
102
109
  return `<svg xmlns="http://www.w3.org/2000/svg" width="${vb}" height="${vb}" viewBox="0 0 ${vb} ${vb}" fill="${config.fill}" stroke="${config.stroke}" stroke-width="${config.strokeWidth}" stroke-linecap="${config.strokeLinecap}" stroke-linejoin="${config.strokeLinejoin}">\n${children}\n</svg>`;
103
110
  }, [shapes, config]);
104
111
  const toReactComponent = React.useCallback((name) => {
105
112
  const svg = toSvg();
106
113
  const inner = svg
107
- .replace(/<svg[^>]*>/, "")
108
- .replace(/<\/svg>/, "")
114
+ .replace(/<svg[^>]*>/, '')
115
+ .replace(/<\/svg>/, '')
109
116
  .trim()
110
- .replace(/stroke-width/g, "strokeWidth")
111
- .replace(/stroke-linecap/g, "strokeLinecap")
112
- .replace(/stroke-linejoin/g, "strokeLinejoin")
113
- .replace(/fill-rule/g, "fillRule")
114
- .replace(/clip-rule/g, "clipRule");
117
+ .replace(/stroke-width/g, 'strokeWidth')
118
+ .replace(/stroke-linecap/g, 'strokeLinecap')
119
+ .replace(/stroke-linejoin/g, 'strokeLinejoin')
120
+ .replace(/fill-rule/g, 'fillRule')
121
+ .replace(/clip-rule/g, 'clipRule');
115
122
  return `import React from "react";\n\nexport const ${name}: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 ${config.viewBox} ${config.viewBox}" fill="${config.fill}" stroke="${config.stroke}" strokeWidth="${config.strokeWidth}" strokeLinecap="${config.strokeLinecap}" strokeLinejoin="${config.strokeLinejoin}" {...props}>\n ${inner}\n </svg>\n);\n`;
116
123
  }, [toSvg, config]);
117
124
  return {
118
- config, setConfig,
119
- shapes, setShapes,
120
- selectedId, setSelectedId,
121
- tool, setTool,
122
- addShape, updateShape, deleteShape,
123
- toSvg, toReactComponent,
124
- undo, redo,
125
+ config,
126
+ setConfig,
127
+ shapes,
128
+ setShapes,
129
+ selectedId,
130
+ setSelectedId,
131
+ tool,
132
+ setTool,
133
+ addShape,
134
+ updateShape,
135
+ deleteShape,
136
+ toSvg,
137
+ toReactComponent,
138
+ undo,
139
+ redo,
125
140
  canUndo: historyIdx > 0,
126
141
  canRedo: historyIdx < historyRef.current.length - 1,
127
- snapToGrid, setSnapToGrid,
142
+ snapToGrid,
143
+ setSnapToGrid,
128
144
  };
129
145
  }
130
146
  // ── Component ───────────────────────────────────────────────────
131
147
  /** SVG icon editor with grid, snap, drawing, and export capabilities. */
132
- const NiceIconEditor = ({ initialSvg, gridSize = 24, onSave, onExport, className = "", }) => {
148
+ const NiceIconEditor = ({ initialSvg, gridSize = 24, onSave, onExport, className = '', }) => {
133
149
  const editor = useIconEditor(initialSvg);
134
150
  const svgRef = React.useRef(null);
135
151
  const drawing = React.useRef(false);
@@ -141,47 +157,56 @@ const NiceIconEditor = ({ initialSvg, gridSize = 24, onSave, onExport, className
141
157
  // Keyboard shortcuts
142
158
  React.useEffect(() => {
143
159
  const handler = (e) => {
144
- if (e.key === "Delete" && editor.selectedId) {
160
+ if (e.key === 'Delete' && editor.selectedId) {
145
161
  editor.deleteShape(editor.selectedId);
146
162
  return;
147
163
  }
148
- if (e.ctrlKey && e.key === "z") {
164
+ if (e.ctrlKey && e.key === 'z') {
149
165
  e.preventDefault();
150
166
  editor.undo();
151
167
  return;
152
168
  }
153
- if (e.ctrlKey && e.key === "y") {
169
+ if (e.ctrlKey && e.key === 'y') {
154
170
  e.preventDefault();
155
171
  editor.redo();
156
172
  return;
157
173
  }
158
- if (e.key === "v" && !e.ctrlKey)
159
- editor.setTool("select");
160
- if (e.key === "c" && !e.ctrlKey)
161
- editor.setTool("circle");
162
- if (e.key === "r" && !e.ctrlKey)
163
- editor.setTool("rect");
164
- if (e.key === "l" && !e.ctrlKey)
165
- editor.setTool("line");
166
- if (e.key === "p" && !e.ctrlKey)
167
- editor.setTool("path");
168
- if (e.key === "g" && !e.ctrlKey)
169
- editor.setSnapToGrid(s => !s);
170
- if (e.key === "Escape")
174
+ if (e.key === 'v' && !e.ctrlKey) {
175
+ editor.setTool('select');
176
+ }
177
+ if (e.key === 'c' && !e.ctrlKey) {
178
+ editor.setTool('circle');
179
+ }
180
+ if (e.key === 'r' && !e.ctrlKey) {
181
+ editor.setTool('rect');
182
+ }
183
+ if (e.key === 'l' && !e.ctrlKey) {
184
+ editor.setTool('line');
185
+ }
186
+ if (e.key === 'p' && !e.ctrlKey) {
187
+ editor.setTool('path');
188
+ }
189
+ if (e.key === 'g' && !e.ctrlKey) {
190
+ editor.setSnapToGrid((s) => !s);
191
+ }
192
+ if (e.key === 'Escape') {
171
193
  editor.setSelectedId(null);
194
+ }
172
195
  };
173
- window.addEventListener("keydown", handler);
174
- return () => window.removeEventListener("keydown", handler);
196
+ window.addEventListener('keydown', handler);
197
+ return () => window.removeEventListener('keydown', handler);
175
198
  }, [editor]);
176
199
  const snapCoord = (v) => {
177
- if (!editor.snapToGrid)
200
+ if (!editor.snapToGrid) {
178
201
  return v;
202
+ }
179
203
  return Math.round(v * 2) / 2; // snap to 0.5 grid
180
204
  };
181
205
  const getSvgCoord = (e) => {
182
206
  const svg = svgRef.current;
183
- if (!svg)
207
+ if (!svg) {
184
208
  return { x: 0, y: 0 };
209
+ }
185
210
  const rect = svg.getBoundingClientRect();
186
211
  return {
187
212
  x: snapCoord(((e.clientX - rect.left) / rect.width) * vb),
@@ -190,14 +215,19 @@ const NiceIconEditor = ({ initialSvg, gridSize = 24, onSave, onExport, className
190
215
  };
191
216
  const handleMouseDown = (e) => {
192
217
  const { x, y } = getSvgCoord(e);
193
- if (editor.tool === "select") {
218
+ if (editor.tool === 'select') {
194
219
  // Check if clicking on a shape for drag
195
- const hit = editor.shapes.find(s => {
220
+ const hit = editor.shapes.find((s) => {
196
221
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
197
- if (s.type === "rect")
198
- return x >= ((_a = s.x) !== null && _a !== void 0 ? _a : 0) && x <= ((_b = s.x) !== null && _b !== void 0 ? _b : 0) + ((_c = s.width) !== null && _c !== void 0 ? _c : 0) && y >= ((_d = s.y) !== null && _d !== void 0 ? _d : 0) && y <= ((_e = s.y) !== null && _e !== void 0 ? _e : 0) + ((_f = s.height) !== null && _f !== void 0 ? _f : 0);
199
- if (s.type === "circle")
222
+ if (s.type === 'rect') {
223
+ return (x >= ((_a = s.x) !== null && _a !== void 0 ? _a : 0) &&
224
+ x <= ((_b = s.x) !== null && _b !== void 0 ? _b : 0) + ((_c = s.width) !== null && _c !== void 0 ? _c : 0) &&
225
+ y >= ((_d = s.y) !== null && _d !== void 0 ? _d : 0) &&
226
+ y <= ((_e = s.y) !== null && _e !== void 0 ? _e : 0) + ((_f = s.height) !== null && _f !== void 0 ? _f : 0));
227
+ }
228
+ if (s.type === 'circle') {
200
229
  return Math.hypot(x - ((_g = s.cx) !== null && _g !== void 0 ? _g : 0), y - ((_h = s.cy) !== null && _h !== void 0 ? _h : 0)) <= ((_j = s.r) !== null && _j !== void 0 ? _j : 0);
230
+ }
201
231
  return false;
202
232
  });
203
233
  if (hit) {
@@ -212,14 +242,14 @@ const NiceIconEditor = ({ initialSvg, gridSize = 24, onSave, onExport, className
212
242
  }
213
243
  drawing.current = true;
214
244
  drawStart.current = { x, y };
215
- if (editor.tool === "circle") {
216
- setPendingShape({ id: "pending", type: "circle", cx: x, cy: y, r: 0 });
245
+ if (editor.tool === 'circle') {
246
+ setPendingShape({ id: 'pending', type: 'circle', cx: x, cy: y, r: 0 });
217
247
  }
218
- else if (editor.tool === "rect") {
219
- setPendingShape({ id: "pending", type: "rect", x, y, width: 0, height: 0 });
248
+ else if (editor.tool === 'rect') {
249
+ setPendingShape({ id: 'pending', type: 'rect', x, y, width: 0, height: 0 });
220
250
  }
221
- else if (editor.tool === "line") {
222
- setPendingShape({ id: "pending", type: "line", x1: x, y1: y, x2: x, y2: y });
251
+ else if (editor.tool === 'line') {
252
+ setPendingShape({ id: 'pending', type: 'line', x1: x, y1: y, x2: x, y2: y });
223
253
  }
224
254
  };
225
255
  const handleMouseMove = (e) => {
@@ -229,27 +259,43 @@ const NiceIconEditor = ({ initialSvg, gridSize = 24, onSave, onExport, className
229
259
  if (draggingShape.current) {
230
260
  const dx = x - dragStart.current.x;
231
261
  const dy = y - dragStart.current.y;
232
- const shape = editor.shapes.find(s => s.id === draggingShape.current);
262
+ const shape = editor.shapes.find((s) => s.id === draggingShape.current);
233
263
  if (shape) {
234
- if (shape.type === "rect")
264
+ if (shape.type === 'rect') {
235
265
  editor.updateShape(shape.id, { x: ((_a = shape.x) !== null && _a !== void 0 ? _a : 0) + dx, y: ((_b = shape.y) !== null && _b !== void 0 ? _b : 0) + dy });
236
- if (shape.type === "circle")
266
+ }
267
+ if (shape.type === 'circle') {
237
268
  editor.updateShape(shape.id, { cx: ((_c = shape.cx) !== null && _c !== void 0 ? _c : 0) + dx, cy: ((_d = shape.cy) !== null && _d !== void 0 ? _d : 0) + dy });
269
+ }
238
270
  dragStart.current = { x, y };
239
271
  }
240
272
  return;
241
273
  }
242
- if (!drawing.current)
274
+ if (!drawing.current) {
243
275
  return;
276
+ }
244
277
  const sx = drawStart.current.x, sy = drawStart.current.y;
245
- if (editor.tool === "circle") {
246
- setPendingShape({ id: "pending", type: "circle", cx: sx, cy: sy, r: Math.hypot(x - sx, y - sy) });
278
+ if (editor.tool === 'circle') {
279
+ setPendingShape({
280
+ id: 'pending',
281
+ type: 'circle',
282
+ cx: sx,
283
+ cy: sy,
284
+ r: Math.hypot(x - sx, y - sy),
285
+ });
247
286
  }
248
- else if (editor.tool === "rect") {
249
- setPendingShape({ id: "pending", type: "rect", x: Math.min(sx, x), y: Math.min(sy, y), width: Math.abs(x - sx), height: Math.abs(y - sy) });
287
+ else if (editor.tool === 'rect') {
288
+ setPendingShape({
289
+ id: 'pending',
290
+ type: 'rect',
291
+ x: Math.min(sx, x),
292
+ y: Math.min(sy, y),
293
+ width: Math.abs(x - sx),
294
+ height: Math.abs(y - sy),
295
+ });
250
296
  }
251
- else if (editor.tool === "line") {
252
- setPendingShape({ id: "pending", type: "line", x1: sx, y1: sy, x2: x, y2: y });
297
+ else if (editor.tool === 'line') {
298
+ setPendingShape({ id: 'pending', type: 'line', x1: sx, y1: sy, x2: x, y2: y });
253
299
  }
254
300
  };
255
301
  const handleMouseUp = () => {
@@ -262,17 +308,20 @@ const NiceIconEditor = ({ initialSvg, gridSize = 24, onSave, onExport, className
262
308
  drawing.current = false;
263
309
  // Only add if shape has non-zero size
264
310
  const { id: _, ...shapeData } = pendingShape;
265
- if (pendingShape.type === "circle" && ((_a = pendingShape.r) !== null && _a !== void 0 ? _a : 0) > 0.2) {
311
+ if (pendingShape.type === 'circle' && ((_a = pendingShape.r) !== null && _a !== void 0 ? _a : 0) > 0.2) {
266
312
  editor.addShape(shapeData);
267
313
  }
268
- else if (pendingShape.type === "rect" && ((_b = pendingShape.width) !== null && _b !== void 0 ? _b : 0) > 0.2 && ((_c = pendingShape.height) !== null && _c !== void 0 ? _c : 0) > 0.2) {
314
+ else if (pendingShape.type === 'rect' &&
315
+ ((_b = pendingShape.width) !== null && _b !== void 0 ? _b : 0) > 0.2 &&
316
+ ((_c = pendingShape.height) !== null && _c !== void 0 ? _c : 0) > 0.2) {
269
317
  editor.addShape(shapeData);
270
318
  }
271
- else if (pendingShape.type === "line") {
319
+ else if (pendingShape.type === 'line') {
272
320
  const dx = ((_d = pendingShape.x2) !== null && _d !== void 0 ? _d : 0) - ((_e = pendingShape.x1) !== null && _e !== void 0 ? _e : 0);
273
321
  const dy = ((_f = pendingShape.y2) !== null && _f !== void 0 ? _f : 0) - ((_g = pendingShape.y1) !== null && _g !== void 0 ? _g : 0);
274
- if (Math.hypot(dx, dy) > 0.2)
322
+ if (Math.hypot(dx, dy) > 0.2) {
275
323
  editor.addShape(shapeData);
324
+ }
276
325
  }
277
326
  setPendingShape(null);
278
327
  };
@@ -281,20 +330,28 @@ const NiceIconEditor = ({ initialSvg, gridSize = 24, onSave, onExport, className
281
330
  const svg = editor.toSvg();
282
331
  const pngSizes = new Map();
283
332
  for (const size of sizes) {
284
- const canvas = document.createElement("canvas");
333
+ const canvas = document.createElement('canvas');
285
334
  canvas.width = size;
286
335
  canvas.height = size;
287
- const ctx = canvas.getContext("2d");
336
+ const ctx = canvas.getContext('2d');
288
337
  const img = new Image();
289
- const blob = new Blob([svg], { type: "image/svg+xml" });
338
+ const blob = new Blob([svg], { type: 'image/svg+xml' });
290
339
  const url = URL.createObjectURL(blob);
291
340
  await new Promise((resolve) => {
292
- img.onload = () => { ctx.drawImage(img, 0, 0, size, size); canvas.toBlob((b) => { if (b)
293
- pngSizes.set(size, b); URL.revokeObjectURL(url); resolve(); }, "image/png"); };
341
+ img.onload = () => {
342
+ ctx.drawImage(img, 0, 0, size, size);
343
+ canvas.toBlob((b) => {
344
+ if (b) {
345
+ pngSizes.set(size, b);
346
+ }
347
+ URL.revokeObjectURL(url);
348
+ resolve();
349
+ }, 'image/png');
350
+ };
294
351
  img.src = url;
295
352
  });
296
353
  }
297
- onExport === null || onExport === void 0 ? void 0 : onExport({ svg, reactComponent: editor.toReactComponent("MyIcon"), pngSizes });
354
+ onExport === null || onExport === void 0 ? void 0 : onExport({ svg, reactComponent: editor.toReactComponent('MyIcon'), pngSizes });
298
355
  };
299
356
  const renderShape = (s, isPending = false) => {
300
357
  var _a, _b, _c;
@@ -302,31 +359,197 @@ const NiceIconEditor = ({ initialSvg, gridSize = 24, onSave, onExport, className
302
359
  const stroke = (_b = s.stroke) !== null && _b !== void 0 ? _b : editor.config.stroke;
303
360
  const sw = (_c = s.strokeWidth) !== null && _c !== void 0 ? _c : editor.config.strokeWidth;
304
361
  const isSelected = !isPending && s.id === editor.selectedId;
305
- const selProps = isSelected ? { strokeDasharray: "0.5 0.3" } : {};
306
- const evtProps = isPending ? {} : { onClick: (e) => { e.stopPropagation(); editor.setSelectedId(s.id); }, style: { cursor: "pointer" } };
362
+ const selProps = isSelected ? { strokeDasharray: '0.5 0.3' } : {};
363
+ const evtProps = isPending
364
+ ? {}
365
+ : {
366
+ onClick: (e) => {
367
+ e.stopPropagation();
368
+ editor.setSelectedId(s.id);
369
+ },
370
+ style: { cursor: 'pointer' },
371
+ };
307
372
  switch (s.type) {
308
- case "path": return jsxRuntime.jsx("path", { d: s.d, fill: fill, stroke: isSelected ? "#339af0" : stroke, strokeWidth: sw * (vb / 400), strokeLinecap: editor.config.strokeLinecap, strokeLinejoin: editor.config.strokeLinejoin, ...evtProps }, s.id);
309
- case "circle": return jsxRuntime.jsx("circle", { cx: s.cx, cy: s.cy, r: s.r, fill: isPending ? "rgba(51,154,240,0.15)" : fill, stroke: isSelected ? "#339af0" : (isPending ? "#339af0" : stroke), strokeWidth: sw * (vb / 400), ...selProps, ...evtProps }, s.id);
310
- case "rect": return jsxRuntime.jsx("rect", { x: s.x, y: s.y, width: s.width, height: s.height, fill: isPending ? "rgba(51,154,240,0.15)" : fill, stroke: isSelected ? "#339af0" : (isPending ? "#339af0" : stroke), strokeWidth: sw * (vb / 400), rx: 0.3, ...selProps, ...evtProps }, s.id);
311
- case "line": return jsxRuntime.jsx("line", { x1: s.x1, y1: s.y1, x2: s.x2, y2: s.y2, stroke: isSelected ? "#339af0" : (isPending ? "#339af0" : stroke), strokeWidth: sw * (vb / 400), strokeLinecap: editor.config.strokeLinecap, ...selProps, ...evtProps }, s.id);
312
- default: return null;
373
+ case 'path':
374
+ return (jsxRuntime.jsx("path", { d: s.d, fill: fill, stroke: isSelected ? '#339af0' : stroke, strokeWidth: sw * (vb / 400), strokeLinecap: editor.config.strokeLinecap, strokeLinejoin: editor.config.strokeLinejoin, ...evtProps }, s.id));
375
+ case 'circle':
376
+ return (jsxRuntime.jsx("circle", { cx: s.cx, cy: s.cy, r: s.r, fill: isPending ? 'rgba(51,154,240,0.15)' : fill, stroke: isSelected ? '#339af0' : isPending ? '#339af0' : stroke, strokeWidth: sw * (vb / 400), ...selProps, ...evtProps }, s.id));
377
+ case 'rect':
378
+ return (jsxRuntime.jsx("rect", { x: s.x, y: s.y, width: s.width, height: s.height, fill: isPending ? 'rgba(51,154,240,0.15)' : fill, stroke: isSelected ? '#339af0' : isPending ? '#339af0' : stroke, strokeWidth: sw * (vb / 400), rx: 0.3, ...selProps, ...evtProps }, s.id));
379
+ case 'line':
380
+ return (jsxRuntime.jsx("line", { x1: s.x1, y1: s.y1, x2: s.x2, y2: s.y2, stroke: isSelected ? '#339af0' : isPending ? '#339af0' : stroke, strokeWidth: sw * (vb / 400), strokeLinecap: editor.config.strokeLinecap, ...selProps, ...evtProps }, s.id));
381
+ default:
382
+ return null;
313
383
  }
314
384
  };
315
385
  const toolBtnStyle = (active) => ({
316
- padding: "4px 8px", borderRadius: 4, border: "none", cursor: "pointer",
317
- background: active ? "#339af0" : "#2c2e33", color: active ? "#fff" : "#c1c2c5", fontSize: 11,
386
+ padding: '4px 8px',
387
+ borderRadius: 4,
388
+ border: 'none',
389
+ cursor: 'pointer',
390
+ background: active ? '#339af0' : '#2c2e33',
391
+ color: active ? '#fff' : '#c1c2c5',
392
+ fontSize: 11,
318
393
  });
319
- return (jsxRuntime.jsxs("div", { className: `nice-icon-editor ${className}`, style: { display: "flex", flexDirection: "column", gap: 8, background: "#1a1b1e", color: "#c1c2c5", padding: 12, borderRadius: 8 }, children: [jsxRuntime.jsxs("div", { style: { display: "flex", gap: 4, fontSize: 12, alignItems: "center", flexWrap: "wrap" }, children: [["select", "path", "circle", "rect", "line"].map((t) => (jsxRuntime.jsxs("button", { onClick: () => editor.setTool(t), style: toolBtnStyle(editor.tool === t), children: [t, " (", t[0], ")"] }, t))), jsxRuntime.jsx("div", { style: { width: 1, height: 20, background: "#373a40" } }), jsxRuntime.jsx("button", { onClick: editor.undo, disabled: !editor.canUndo, style: toolBtnStyle(false), title: "Undo (Ctrl+Z)", children: "\u21A9" }), jsxRuntime.jsx("button", { onClick: editor.redo, disabled: !editor.canRedo, style: toolBtnStyle(false), title: "Redo (Ctrl+Y)", children: "\u21AA" }), jsxRuntime.jsx("div", { style: { width: 1, height: 20, background: "#373a40" } }), jsxRuntime.jsx("button", { onClick: () => editor.setSnapToGrid(s => !s), style: toolBtnStyle(editor.snapToGrid), title: "Snap to Grid (G)", children: "\u229E" }), editor.selectedId && jsxRuntime.jsx("button", { onClick: () => editor.deleteShape(editor.selectedId), style: { ...toolBtnStyle(false), color: "#ff6b6b" }, title: "Delete (Del)", children: "\u2715" }), jsxRuntime.jsx("div", { style: { flex: 1 } }), jsxRuntime.jsx("button", { onClick: handleSave, style: { padding: "4px 12px", borderRadius: 4, border: "none", cursor: "pointer", background: "#2f9e44", color: "#fff", fontSize: 11 }, children: "Save SVG" }), jsxRuntime.jsx("button", { onClick: () => handleExportPng(), style: { padding: "4px 12px", borderRadius: 4, border: "none", cursor: "pointer", background: "#228be6", color: "#fff", fontSize: 11 }, children: "Export PNG" })] }), jsxRuntime.jsxs("div", { style: { display: "flex", gap: 12 }, children: [jsxRuntime.jsx("div", { style: { width: 400, height: 400, background: "#141517", borderRadius: 6, position: "relative", overflow: "hidden" }, children: jsxRuntime.jsxs("svg", { ref: svgRef, width: 400, height: 400, viewBox: `0 0 ${vb} ${vb}`, style: { position: "absolute", inset: 0, cursor: editor.tool === "select" ? "default" : "crosshair" }, onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, children: [Array.from({ length: vb + 1 }, (_, i) => (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx("line", { x1: i, y1: 0, x2: i, y2: vb, stroke: "rgba(255,255,255,0.08)", strokeWidth: 0.05 }), jsxRuntime.jsx("line", { x1: 0, y1: i, x2: vb, y2: i, stroke: "rgba(255,255,255,0.08)", strokeWidth: 0.05 })] }, `g${i}`))), jsxRuntime.jsx("line", { x1: vb / 2, y1: 0, x2: vb / 2, y2: vb, stroke: "rgba(255,255,255,0.15)", strokeWidth: 0.05 }), jsxRuntime.jsx("line", { x1: 0, y1: vb / 2, x2: vb, y2: vb / 2, stroke: "rgba(255,255,255,0.15)", strokeWidth: 0.05 }), editor.shapes.map(s => renderShape(s)), pendingShape && renderShape(pendingShape, true)] }) }), jsxRuntime.jsxs("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: 8, fontSize: 12 }, children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "Grid Size: " }), jsxRuntime.jsxs("select", { value: editor.config.viewBox, onChange: e => editor.setConfig({ ...editor.config, viewBox: Number(e.target.value) }), style: { background: "#2c2e33", color: "#c1c2c5", border: "1px solid #373a40", borderRadius: 3, padding: 2 }, children: [jsxRuntime.jsx("option", { value: 16, children: "16\u00D716" }), jsxRuntime.jsx("option", { value: 24, children: "24\u00D724" }), jsxRuntime.jsx("option", { value: 32, children: "32\u00D732" }), jsxRuntime.jsx("option", { value: 48, children: "48\u00D748" })] })] }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "Stroke Width: " }), jsxRuntime.jsx("input", { type: "range", min: 0.5, max: 4, step: 0.25, value: editor.config.strokeWidth, onChange: e => editor.setConfig({ ...editor.config, strokeWidth: Number(e.target.value) }), style: { width: 100 } }), jsxRuntime.jsxs("span", { children: [" ", editor.config.strokeWidth] })] }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "Variant: " }), ["outline", "filled", "duotone"].map(v => (jsxRuntime.jsx("button", { onClick: () => editor.setConfig({ ...editor.config, variant: v }), style: { padding: "2px 6px", marginLeft: 2, borderRadius: 3, border: "none", cursor: "pointer",
320
- background: editor.config.variant === v ? "#339af0" : "#2c2e33",
321
- color: editor.config.variant === v ? "#fff" : "#c1c2c5", fontSize: 11 }, children: v }, v)))] }), editor.selectedId && (() => {
322
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
323
- const sel = editor.shapes.find(s => s.id === editor.selectedId);
324
- if (!sel)
325
- return null;
326
- return (jsxRuntime.jsxs("div", { style: { borderTop: "1px solid #373a40", paddingTop: 8 }, children: [jsxRuntime.jsxs("strong", { children: ["Selected: ", sel.type] }), sel.type === "rect" && (jsxRuntime.jsxs("div", { style: { display: "grid", gridTemplateColumns: "60px 1fr", gap: 2, marginTop: 4, fontSize: 11 }, children: [jsxRuntime.jsx("span", { children: "X:" }), jsxRuntime.jsx("input", { type: "number", value: (_a = sel.x) !== null && _a !== void 0 ? _a : 0, step: 0.5, onChange: e => editor.updateShape(sel.id, { x: Number(e.target.value) }), style: { background: "#2c2e33", color: "#c1c2c5", border: "1px solid #373a40", borderRadius: 2, padding: 1, fontSize: 10 } }), jsxRuntime.jsx("span", { children: "Y:" }), jsxRuntime.jsx("input", { type: "number", value: (_b = sel.y) !== null && _b !== void 0 ? _b : 0, step: 0.5, onChange: e => editor.updateShape(sel.id, { y: Number(e.target.value) }), style: { background: "#2c2e33", color: "#c1c2c5", border: "1px solid #373a40", borderRadius: 2, padding: 1, fontSize: 10 } }), jsxRuntime.jsx("span", { children: "Width:" }), jsxRuntime.jsx("input", { type: "number", value: (_c = sel.width) !== null && _c !== void 0 ? _c : 0, step: 0.5, onChange: e => editor.updateShape(sel.id, { width: Number(e.target.value) }), style: { background: "#2c2e33", color: "#c1c2c5", border: "1px solid #373a40", borderRadius: 2, padding: 1, fontSize: 10 } }), jsxRuntime.jsx("span", { children: "Height:" }), jsxRuntime.jsx("input", { type: "number", value: (_d = sel.height) !== null && _d !== void 0 ? _d : 0, step: 0.5, onChange: e => editor.updateShape(sel.id, { height: Number(e.target.value) }), style: { background: "#2c2e33", color: "#c1c2c5", border: "1px solid #373a40", borderRadius: 2, padding: 1, fontSize: 10 } })] })), sel.type === "circle" && (jsxRuntime.jsxs("div", { style: { display: "grid", gridTemplateColumns: "60px 1fr", gap: 2, marginTop: 4, fontSize: 11 }, children: [jsxRuntime.jsx("span", { children: "CX:" }), jsxRuntime.jsx("input", { type: "number", value: (_e = sel.cx) !== null && _e !== void 0 ? _e : 0, step: 0.5, onChange: e => editor.updateShape(sel.id, { cx: Number(e.target.value) }), style: { background: "#2c2e33", color: "#c1c2c5", border: "1px solid #373a40", borderRadius: 2, padding: 1, fontSize: 10 } }), jsxRuntime.jsx("span", { children: "CY:" }), jsxRuntime.jsx("input", { type: "number", value: (_f = sel.cy) !== null && _f !== void 0 ? _f : 0, step: 0.5, onChange: e => editor.updateShape(sel.id, { cy: Number(e.target.value) }), style: { background: "#2c2e33", color: "#c1c2c5", border: "1px solid #373a40", borderRadius: 2, padding: 1, fontSize: 10 } }), jsxRuntime.jsx("span", { children: "Radius:" }), jsxRuntime.jsx("input", { type: "number", value: (_g = sel.r) !== null && _g !== void 0 ? _g : 0, step: 0.5, onChange: e => editor.updateShape(sel.id, { r: Number(e.target.value) }), style: { background: "#2c2e33", color: "#c1c2c5", border: "1px solid #373a40", borderRadius: 2, padding: 1, fontSize: 10 } })] })), sel.type === "path" && (jsxRuntime.jsxs("div", { style: { marginTop: 4 }, children: [jsxRuntime.jsx("label", { style: { fontSize: 10 }, children: "SVG Path:" }), jsxRuntime.jsx("textarea", { value: (_h = sel.d) !== null && _h !== void 0 ? _h : "", onChange: e => editor.updateShape(sel.id, { d: e.target.value }), rows: 3, style: { width: "100%", background: "#2c2e33", color: "#c1c2c5", border: "1px solid #373a40", borderRadius: 3, padding: 4, fontSize: 10, fontFamily: "monospace", resize: "vertical" } })] })), jsxRuntime.jsxs("div", { style: { marginTop: 4, display: "flex", gap: 4, alignItems: "center" }, children: [jsxRuntime.jsx("span", { style: { fontSize: 10 }, children: "Fill:" }), jsxRuntime.jsx("input", { type: "color", value: (_j = sel.fill) !== null && _j !== void 0 ? _j : "#000000", onChange: e => editor.updateShape(sel.id, { fill: e.target.value }), style: { width: 24, height: 18, border: "none", padding: 0, cursor: "pointer" } }), jsxRuntime.jsx("span", { style: { fontSize: 10 }, children: "Stroke:" }), jsxRuntime.jsx("input", { type: "color", value: (_k = sel.stroke) !== null && _k !== void 0 ? _k : "#000000", onChange: e => editor.updateShape(sel.id, { stroke: e.target.value }), style: { width: 24, height: 18, border: "none", padding: 0, cursor: "pointer" } })] })] }));
327
- })(), jsxRuntime.jsxs("div", { style: { borderTop: "1px solid #373a40", paddingTop: 8 }, children: [jsxRuntime.jsxs("strong", { children: ["Shapes (", editor.shapes.length, ")"] }), jsxRuntime.jsx("div", { style: { marginTop: 4, maxHeight: 120, overflowY: "auto" }, children: editor.shapes.map(s => (jsxRuntime.jsxs("div", { onClick: () => editor.setSelectedId(s.id), style: { padding: "2px 4px", cursor: "pointer", borderRadius: 2, fontSize: 11,
328
- background: editor.selectedId === s.id ? "#339af0" : "transparent",
329
- color: editor.selectedId === s.id ? "#fff" : "#c1c2c5" }, children: [s.type, " ", s.id.slice(-4)] }, s.id))) })] }), jsxRuntime.jsxs("div", { style: { borderTop: "1px solid #373a40", paddingTop: 8 }, children: [jsxRuntime.jsx("strong", { children: "Preview" }), jsxRuntime.jsx("div", { style: { display: "flex", gap: 8, marginTop: 8, alignItems: "end" }, children: [16, 24, 32, 48].map(size => (jsxRuntime.jsxs("div", { style: { textAlign: "center", fontSize: 10, color: "#868e96" }, children: [jsxRuntime.jsx("div", { style: { background: "#fff", display: "inline-block", padding: 4, borderRadius: 3 }, dangerouslySetInnerHTML: { __html: editor.toSvg().replace(/width="\d+"/, `width="${size}"`).replace(/height="\d+"/, `height="${size}"`) } }), jsxRuntime.jsxs("div", { children: [size, "px"] })] }, size))) })] })] })] })] }));
394
+ return (jsxRuntime.jsxs("div", { className: `nice-icon-editor ${className}`, style: {
395
+ display: 'flex',
396
+ flexDirection: 'column',
397
+ gap: 8,
398
+ background: '#1a1b1e',
399
+ color: '#c1c2c5',
400
+ padding: 12,
401
+ borderRadius: 8,
402
+ }, children: [jsxRuntime.jsxs("div", { style: { display: 'flex', gap: 4, fontSize: 12, alignItems: 'center', flexWrap: 'wrap' }, children: [['select', 'path', 'circle', 'rect', 'line'].map((t) => (jsxRuntime.jsxs("button", { onClick: () => editor.setTool(t), style: toolBtnStyle(editor.tool === t), children: [t, " (", t[0], ")"] }, t))), jsxRuntime.jsx("div", { style: { width: 1, height: 20, background: '#373a40' } }), jsxRuntime.jsx("button", { onClick: editor.undo, disabled: !editor.canUndo, style: toolBtnStyle(false), title: "Undo (Ctrl+Z)", children: "\u21A9" }), jsxRuntime.jsx("button", { onClick: editor.redo, disabled: !editor.canRedo, style: toolBtnStyle(false), title: "Redo (Ctrl+Y)", children: "\u21AA" }), jsxRuntime.jsx("div", { style: { width: 1, height: 20, background: '#373a40' } }), jsxRuntime.jsx("button", { onClick: () => editor.setSnapToGrid((s) => !s), style: toolBtnStyle(editor.snapToGrid), title: "Snap to Grid (G)", children: "\u229E" }), editor.selectedId && (jsxRuntime.jsx("button", { onClick: () => editor.deleteShape(editor.selectedId), style: { ...toolBtnStyle(false), color: '#ff6b6b' }, title: "Delete (Del)", children: "\u2715" })), jsxRuntime.jsx("div", { style: { flex: 1 } }), jsxRuntime.jsx("button", { onClick: handleSave, style: {
403
+ padding: '4px 12px',
404
+ borderRadius: 4,
405
+ border: 'none',
406
+ cursor: 'pointer',
407
+ background: '#2f9e44',
408
+ color: '#fff',
409
+ fontSize: 11,
410
+ }, children: "Save SVG" }), jsxRuntime.jsx("button", { onClick: () => handleExportPng(), style: {
411
+ padding: '4px 12px',
412
+ borderRadius: 4,
413
+ border: 'none',
414
+ cursor: 'pointer',
415
+ background: '#228be6',
416
+ color: '#fff',
417
+ fontSize: 11,
418
+ }, children: "Export PNG" })] }), jsxRuntime.jsxs("div", { style: { display: 'flex', gap: 12 }, children: [jsxRuntime.jsx("div", { style: {
419
+ width: 400,
420
+ height: 400,
421
+ background: '#141517',
422
+ borderRadius: 6,
423
+ position: 'relative',
424
+ overflow: 'hidden',
425
+ }, children: jsxRuntime.jsxs("svg", { ref: svgRef, width: 400, height: 400, viewBox: `0 0 ${vb} ${vb}`, style: {
426
+ position: 'absolute',
427
+ inset: 0,
428
+ cursor: editor.tool === 'select' ? 'default' : 'crosshair',
429
+ }, onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, children: [Array.from({ length: vb + 1 }, (_, i) => (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx("line", { x1: i, y1: 0, x2: i, y2: vb, stroke: "rgba(255,255,255,0.08)", strokeWidth: 0.05 }), jsxRuntime.jsx("line", { x1: 0, y1: i, x2: vb, y2: i, stroke: "rgba(255,255,255,0.08)", strokeWidth: 0.05 })] }, `g${i}`))), jsxRuntime.jsx("line", { x1: vb / 2, y1: 0, x2: vb / 2, y2: vb, stroke: "rgba(255,255,255,0.15)", strokeWidth: 0.05 }), jsxRuntime.jsx("line", { x1: 0, y1: vb / 2, x2: vb, y2: vb / 2, stroke: "rgba(255,255,255,0.15)", strokeWidth: 0.05 }), editor.shapes.map((s) => renderShape(s)), pendingShape && renderShape(pendingShape, true)] }) }), jsxRuntime.jsxs("div", { style: { flex: 1, display: 'flex', flexDirection: 'column', gap: 8, fontSize: 12 }, children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "Grid Size: " }), jsxRuntime.jsxs("select", { value: editor.config.viewBox, onChange: (e) => editor.setConfig({ ...editor.config, viewBox: Number(e.target.value) }), style: {
430
+ background: '#2c2e33',
431
+ color: '#c1c2c5',
432
+ border: '1px solid #373a40',
433
+ borderRadius: 3,
434
+ padding: 2,
435
+ }, children: [jsxRuntime.jsx("option", { value: 16, children: "16\u00D716" }), jsxRuntime.jsx("option", { value: 24, children: "24\u00D724" }), jsxRuntime.jsx("option", { value: 32, children: "32\u00D732" }), jsxRuntime.jsx("option", { value: 48, children: "48\u00D748" })] })] }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "Stroke Width: " }), jsxRuntime.jsx("input", { type: "range", min: 0.5, max: 4, step: 0.25, value: editor.config.strokeWidth, onChange: (e) => editor.setConfig({ ...editor.config, strokeWidth: Number(e.target.value) }), style: { width: 100 } }), jsxRuntime.jsxs("span", { children: [" ", editor.config.strokeWidth] })] }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("label", { children: "Variant: " }), ['outline', 'filled', 'duotone'].map((v) => (jsxRuntime.jsx("button", { onClick: () => editor.setConfig({ ...editor.config, variant: v }), style: {
436
+ padding: '2px 6px',
437
+ marginLeft: 2,
438
+ borderRadius: 3,
439
+ border: 'none',
440
+ cursor: 'pointer',
441
+ background: editor.config.variant === v ? '#339af0' : '#2c2e33',
442
+ color: editor.config.variant === v ? '#fff' : '#c1c2c5',
443
+ fontSize: 11,
444
+ }, children: v }, v)))] }), editor.selectedId &&
445
+ (() => {
446
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
447
+ const sel = editor.shapes.find((s) => s.id === editor.selectedId);
448
+ if (!sel) {
449
+ return null;
450
+ }
451
+ return (jsxRuntime.jsxs("div", { style: { borderTop: '1px solid #373a40', paddingTop: 8 }, children: [jsxRuntime.jsxs("strong", { children: ["Selected: ", sel.type] }), sel.type === 'rect' && (jsxRuntime.jsxs("div", { style: {
452
+ display: 'grid',
453
+ gridTemplateColumns: '60px 1fr',
454
+ gap: 2,
455
+ marginTop: 4,
456
+ fontSize: 11,
457
+ }, children: [jsxRuntime.jsx("span", { children: "X:" }), jsxRuntime.jsx("input", { type: "number", value: (_a = sel.x) !== null && _a !== void 0 ? _a : 0, step: 0.5, onChange: (e) => editor.updateShape(sel.id, { x: Number(e.target.value) }), style: {
458
+ background: '#2c2e33',
459
+ color: '#c1c2c5',
460
+ border: '1px solid #373a40',
461
+ borderRadius: 2,
462
+ padding: 1,
463
+ fontSize: 10,
464
+ } }), jsxRuntime.jsx("span", { children: "Y:" }), jsxRuntime.jsx("input", { type: "number", value: (_b = sel.y) !== null && _b !== void 0 ? _b : 0, step: 0.5, onChange: (e) => editor.updateShape(sel.id, { y: Number(e.target.value) }), style: {
465
+ background: '#2c2e33',
466
+ color: '#c1c2c5',
467
+ border: '1px solid #373a40',
468
+ borderRadius: 2,
469
+ padding: 1,
470
+ fontSize: 10,
471
+ } }), jsxRuntime.jsx("span", { children: "Width:" }), jsxRuntime.jsx("input", { type: "number", value: (_c = sel.width) !== null && _c !== void 0 ? _c : 0, step: 0.5, onChange: (e) => editor.updateShape(sel.id, { width: Number(e.target.value) }), style: {
472
+ background: '#2c2e33',
473
+ color: '#c1c2c5',
474
+ border: '1px solid #373a40',
475
+ borderRadius: 2,
476
+ padding: 1,
477
+ fontSize: 10,
478
+ } }), jsxRuntime.jsx("span", { children: "Height:" }), jsxRuntime.jsx("input", { type: "number", value: (_d = sel.height) !== null && _d !== void 0 ? _d : 0, step: 0.5, onChange: (e) => editor.updateShape(sel.id, { height: Number(e.target.value) }), style: {
479
+ background: '#2c2e33',
480
+ color: '#c1c2c5',
481
+ border: '1px solid #373a40',
482
+ borderRadius: 2,
483
+ padding: 1,
484
+ fontSize: 10,
485
+ } })] })), sel.type === 'circle' && (jsxRuntime.jsxs("div", { style: {
486
+ display: 'grid',
487
+ gridTemplateColumns: '60px 1fr',
488
+ gap: 2,
489
+ marginTop: 4,
490
+ fontSize: 11,
491
+ }, children: [jsxRuntime.jsx("span", { children: "CX:" }), jsxRuntime.jsx("input", { type: "number", value: (_e = sel.cx) !== null && _e !== void 0 ? _e : 0, step: 0.5, onChange: (e) => editor.updateShape(sel.id, { cx: Number(e.target.value) }), style: {
492
+ background: '#2c2e33',
493
+ color: '#c1c2c5',
494
+ border: '1px solid #373a40',
495
+ borderRadius: 2,
496
+ padding: 1,
497
+ fontSize: 10,
498
+ } }), jsxRuntime.jsx("span", { children: "CY:" }), jsxRuntime.jsx("input", { type: "number", value: (_f = sel.cy) !== null && _f !== void 0 ? _f : 0, step: 0.5, onChange: (e) => editor.updateShape(sel.id, { cy: Number(e.target.value) }), style: {
499
+ background: '#2c2e33',
500
+ color: '#c1c2c5',
501
+ border: '1px solid #373a40',
502
+ borderRadius: 2,
503
+ padding: 1,
504
+ fontSize: 10,
505
+ } }), jsxRuntime.jsx("span", { children: "Radius:" }), jsxRuntime.jsx("input", { type: "number", value: (_g = sel.r) !== null && _g !== void 0 ? _g : 0, step: 0.5, onChange: (e) => editor.updateShape(sel.id, { r: Number(e.target.value) }), style: {
506
+ background: '#2c2e33',
507
+ color: '#c1c2c5',
508
+ border: '1px solid #373a40',
509
+ borderRadius: 2,
510
+ padding: 1,
511
+ fontSize: 10,
512
+ } })] })), sel.type === 'path' && (jsxRuntime.jsxs("div", { style: { marginTop: 4 }, children: [jsxRuntime.jsx("label", { style: { fontSize: 10 }, children: "SVG Path:" }), jsxRuntime.jsx("textarea", { value: (_h = sel.d) !== null && _h !== void 0 ? _h : '', onChange: (e) => editor.updateShape(sel.id, { d: e.target.value }), rows: 3, style: {
513
+ width: '100%',
514
+ background: '#2c2e33',
515
+ color: '#c1c2c5',
516
+ border: '1px solid #373a40',
517
+ borderRadius: 3,
518
+ padding: 4,
519
+ fontSize: 10,
520
+ fontFamily: 'monospace',
521
+ resize: 'vertical',
522
+ } })] })), jsxRuntime.jsxs("div", { style: { marginTop: 4, display: 'flex', gap: 4, alignItems: 'center' }, children: [jsxRuntime.jsx("span", { style: { fontSize: 10 }, children: "Fill:" }), jsxRuntime.jsx("input", { type: "color", value: (_j = sel.fill) !== null && _j !== void 0 ? _j : '#000000', onChange: (e) => editor.updateShape(sel.id, { fill: e.target.value }), style: {
523
+ width: 24,
524
+ height: 18,
525
+ border: 'none',
526
+ padding: 0,
527
+ cursor: 'pointer',
528
+ } }), jsxRuntime.jsx("span", { style: { fontSize: 10 }, children: "Stroke:" }), jsxRuntime.jsx("input", { type: "color", value: (_k = sel.stroke) !== null && _k !== void 0 ? _k : '#000000', onChange: (e) => editor.updateShape(sel.id, { stroke: e.target.value }), style: {
529
+ width: 24,
530
+ height: 18,
531
+ border: 'none',
532
+ padding: 0,
533
+ cursor: 'pointer',
534
+ } })] })] }));
535
+ })(), jsxRuntime.jsxs("div", { style: { borderTop: '1px solid #373a40', paddingTop: 8 }, children: [jsxRuntime.jsxs("strong", { children: ["Shapes (", editor.shapes.length, ")"] }), jsxRuntime.jsx("div", { style: { marginTop: 4, maxHeight: 120, overflowY: 'auto' }, children: editor.shapes.map((s) => (jsxRuntime.jsxs("div", { onClick: () => editor.setSelectedId(s.id), style: {
536
+ padding: '2px 4px',
537
+ cursor: 'pointer',
538
+ borderRadius: 2,
539
+ fontSize: 11,
540
+ background: editor.selectedId === s.id ? '#339af0' : 'transparent',
541
+ color: editor.selectedId === s.id ? '#fff' : '#c1c2c5',
542
+ }, children: [s.type, " ", s.id.slice(-4)] }, s.id))) })] }), jsxRuntime.jsxs("div", { style: { borderTop: '1px solid #373a40', paddingTop: 8 }, children: [jsxRuntime.jsx("strong", { children: "Preview" }), jsxRuntime.jsx("div", { style: { display: 'flex', gap: 8, marginTop: 8, alignItems: 'end' }, children: [16, 24, 32, 48].map((size) => (jsxRuntime.jsxs("div", { style: { textAlign: 'center', fontSize: 10, color: '#868e96' }, children: [jsxRuntime.jsx("div", { style: {
543
+ background: '#fff',
544
+ display: 'inline-block',
545
+ padding: 4,
546
+ borderRadius: 3,
547
+ }, dangerouslySetInnerHTML: {
548
+ __html: editor
549
+ .toSvg()
550
+ .replace(/width="\d+"/, `width="${size}"`)
551
+ .replace(/height="\d+"/, `height="${size}"`),
552
+ } }), jsxRuntime.jsxs("div", { children: [size, "px"] })] }, size))) })] })] })] })] }));
330
553
  };
331
554
 
332
555
  exports.NiceIconEditor = NiceIconEditor;