@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
@@ -0,0 +1,796 @@
1
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
+ import { W as me, b as Is, h as rl, d as ks } from './core-Da43q-pO.js';
3
+ import { useState, useRef, forwardRef, useCallback, useEffect, createContext } from 'react';
4
+
5
+ const $t = ({
6
+ visible: e,
7
+ onClose: t,
8
+ title: o,
9
+ items: s,
10
+ showCancelButton: u = true,
11
+ cancelText: d,
12
+ className: h,
13
+ style: g
14
+ }) => {
15
+ const { t: p } = me();
16
+ return e ? /* @__PURE__ */ jsxs(Fragment, { children: [
17
+ /* @__PURE__ */ jsx("div", { className: "nice-actionsheet__overlay", onClick: t }),
18
+ /* @__PURE__ */ jsxs("div", { className: `nice-actionsheet ${h || ""}`, style: g, children: [
19
+ o && /* @__PURE__ */ jsx("div", { className: "nice-actionsheet__title", children: o }),
20
+ /* @__PURE__ */ jsx("div", { className: "nice-actionsheet__items", children: s.map((E, r) => /* @__PURE__ */ jsxs(
21
+ "button",
22
+ {
23
+ className: `nice-actionsheet__item ${E.type === "danger" ? "nice-actionsheet__item--danger" : ""}`,
24
+ disabled: E.disabled,
25
+ onClick: () => {
26
+ E.onClick?.(), t();
27
+ },
28
+ children: [
29
+ E.icon && /* @__PURE__ */ jsx("span", { className: "nice-actionsheet__icon", children: E.icon }),
30
+ E.text
31
+ ]
32
+ },
33
+ r
34
+ )) }),
35
+ u && /* @__PURE__ */ jsx("button", { className: "nice-actionsheet__cancel", onClick: t, children: d || p("cancel", "Cancel") })
36
+ ] })
37
+ ] }) : null;
38
+ }, Dt = ({
39
+ visible: e,
40
+ onClose: t,
41
+ targetRef: o,
42
+ position: s = "bottom",
43
+ title: u,
44
+ showArrow: d = true,
45
+ width: h,
46
+ children: g,
47
+ className: p,
48
+ style: E,
49
+ displayStyle: r
50
+ }) => {
51
+ ks("tooltip", r);
52
+ const b = useRef(null), [Y, f] = useState({ top: 0, left: 0 }), L = useCallback(() => {
53
+ const w = o.current, X = b.current;
54
+ if (!w || !X)
55
+ return;
56
+ const n = w.getBoundingClientRect(), v = X.getBoundingClientRect();
57
+ let a = 0, z = 0;
58
+ const T = 8;
59
+ switch (s) {
60
+ case "top":
61
+ a = n.top - v.height - T, z = n.left + (n.width - v.width) / 2;
62
+ break;
63
+ case "bottom":
64
+ a = n.bottom + T, z = n.left + (n.width - v.width) / 2;
65
+ break;
66
+ case "left":
67
+ a = n.top + (n.height - v.height) / 2, z = n.left - v.width - T;
68
+ break;
69
+ case "right":
70
+ a = n.top + (n.height - v.height) / 2, z = n.right + T;
71
+ break;
72
+ }
73
+ f({ top: a + window.scrollY, left: z + window.scrollX });
74
+ }, [o, s]);
75
+ return useEffect(() => {
76
+ if (e) {
77
+ requestAnimationFrame(L);
78
+ const w = (X) => {
79
+ b.current && !b.current.contains(X.target) && o.current && !o.current.contains(X.target) && t();
80
+ };
81
+ return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
82
+ }
83
+ }, [e, L, t, o]), e ? /* @__PURE__ */ jsxs(
84
+ "div",
85
+ {
86
+ ref: b,
87
+ className: `nice-popover nice-popover--${s} ${p || ""}`,
88
+ style: { ...E, position: "absolute", top: Y.top, left: Y.left, width: h },
89
+ children: [
90
+ d && /* @__PURE__ */ jsx("div", { className: `nice-popover__arrow nice-popover__arrow--${s}` }),
91
+ u && /* @__PURE__ */ jsx("div", { className: "nice-popover__title", children: u }),
92
+ /* @__PURE__ */ jsx("div", { className: "nice-popover__content", children: g })
93
+ ]
94
+ }
95
+ ) : null;
96
+ }, Pt = ({
97
+ visible: e,
98
+ message: t,
99
+ container: o,
100
+ showIndicator: s = true,
101
+ shading: u = true,
102
+ className: d,
103
+ style: h
104
+ }) => {
105
+ const { t: g } = me();
106
+ if (!e)
107
+ return null;
108
+ const p = !!o?.current, E = /* @__PURE__ */ jsxs("div", { className: `nice-loadpanel ${d || ""}`, style: h, children: [
109
+ u && /* @__PURE__ */ jsx("div", { className: "nice-loadpanel__shade" }),
110
+ /* @__PURE__ */ jsxs("div", { className: "nice-loadpanel__box", children: [
111
+ s && /* @__PURE__ */ jsx("div", { className: "nice-spinner nice-spinner--md" }),
112
+ /* @__PURE__ */ jsx("span", { className: "nice-loadpanel__text", children: t || g("loading", "Loading...") })
113
+ ] })
114
+ ] });
115
+ if (p && o.current) {
116
+ const r = o.current;
117
+ return r.style.position = r.style.position || "relative", E;
118
+ }
119
+ return E;
120
+ }, Yt = ({
121
+ direction: e = "row",
122
+ align: t,
123
+ justify: o,
124
+ wrap: s,
125
+ gap: u,
126
+ flex: d,
127
+ children: h,
128
+ className: g,
129
+ style: p
130
+ }) => /* @__PURE__ */ jsx(
131
+ "div",
132
+ {
133
+ className: `nice-box ${g || ""}`,
134
+ style: {
135
+ display: "flex",
136
+ flexDirection: e,
137
+ alignItems: t,
138
+ justifyContent: o,
139
+ flexWrap: s ? "wrap" : void 0,
140
+ gap: u,
141
+ flex: d,
142
+ ...p
143
+ },
144
+ children: h
145
+ }
146
+ ), Xt = ({
147
+ direction: e = "row",
148
+ items: t,
149
+ gap: o,
150
+ className: s,
151
+ style: u
152
+ }) => /* @__PURE__ */ jsx(
153
+ "div",
154
+ {
155
+ className: `nice-responsivebox ${s || ""}`,
156
+ style: { display: "flex", flexDirection: e, gap: o, ...u },
157
+ children: t.map((d, h) => /* @__PURE__ */ jsx(
158
+ "div",
159
+ {
160
+ style: { flex: d.ratio ?? 1, flexBasis: d.baseSize, flexShrink: d.shrink ?? 1 },
161
+ children: d.children
162
+ },
163
+ h
164
+ ))
165
+ }
166
+ ), Ot = ({
167
+ width: e = 200,
168
+ height: t = 200,
169
+ minWidth: o = 50,
170
+ minHeight: s = 50,
171
+ maxWidth: u = 1 / 0,
172
+ maxHeight: d = 1 / 0,
173
+ handles: h = ["right", "bottom", "bottomRight"],
174
+ onResize: g,
175
+ children: p,
176
+ className: E,
177
+ style: r
178
+ }) => {
179
+ const [b, Y] = useState({ width: e, height: t }), f = useRef(null), L = (n, v) => {
180
+ v.preventDefault();
181
+ const a = v.clientX, z = v.clientY, T = b.width, W = b.height, _ = (i) => {
182
+ const x = i.clientX - a, S = i.clientY - z;
183
+ let I = T, l = W;
184
+ (n.includes("right") || n === "right") && (I = T + x), (n.includes("bottom") || n === "bottom") && (l = W + S), (n.includes("left") || n === "left") && (I = T - x), (n.includes("top") || n === "top") && (l = W - S), I = Math.max(o, Math.min(u, I)), l = Math.max(s, Math.min(d, l)), Y({ width: I, height: l }), g?.({ width: I, height: l });
185
+ }, D = () => {
186
+ document.removeEventListener("pointermove", _), document.removeEventListener("pointerup", D);
187
+ };
188
+ document.addEventListener("pointermove", _), document.addEventListener("pointerup", D);
189
+ }, w = (n) => {
190
+ switch (n) {
191
+ case "top":
192
+ case "bottom":
193
+ return "ns-resize";
194
+ case "left":
195
+ case "right":
196
+ return "ew-resize";
197
+ case "topLeft":
198
+ case "bottomRight":
199
+ return "nwse-resize";
200
+ case "topRight":
201
+ case "bottomLeft":
202
+ return "nesw-resize";
203
+ default:
204
+ return "default";
205
+ }
206
+ }, X = (n) => {
207
+ const v = { position: "absolute", zIndex: 1 }, a = 8;
208
+ return n === "right" ? {
209
+ ...v,
210
+ top: 0,
211
+ right: -a / 2,
212
+ width: a,
213
+ height: "100%",
214
+ cursor: w(n)
215
+ } : n === "bottom" ? {
216
+ ...v,
217
+ left: 0,
218
+ bottom: -a / 2,
219
+ width: "100%",
220
+ height: a,
221
+ cursor: w(n)
222
+ } : n === "left" ? { ...v, top: 0, left: -a / 2, width: a, height: "100%", cursor: w(n) } : n === "top" ? { ...v, top: -a / 2, left: 0, width: "100%", height: a, cursor: w(n) } : n === "bottomRight" ? {
223
+ ...v,
224
+ bottom: -a / 2,
225
+ right: -a / 2,
226
+ width: a * 2,
227
+ height: a * 2,
228
+ cursor: w(n)
229
+ } : n === "bottomLeft" ? {
230
+ ...v,
231
+ bottom: -a / 2,
232
+ left: -a / 2,
233
+ width: a * 2,
234
+ height: a * 2,
235
+ cursor: w(n)
236
+ } : n === "topRight" ? {
237
+ ...v,
238
+ top: -a / 2,
239
+ right: -a / 2,
240
+ width: a * 2,
241
+ height: a * 2,
242
+ cursor: w(n)
243
+ } : n === "topLeft" ? {
244
+ ...v,
245
+ top: -a / 2,
246
+ left: -a / 2,
247
+ width: a * 2,
248
+ height: a * 2,
249
+ cursor: w(n)
250
+ } : v;
251
+ };
252
+ return /* @__PURE__ */ jsxs(
253
+ "div",
254
+ {
255
+ ref: f,
256
+ className: `nice-resizable ${E || ""}`,
257
+ style: {
258
+ ...r,
259
+ width: b.width,
260
+ height: b.height,
261
+ position: "relative",
262
+ overflow: "hidden"
263
+ },
264
+ children: [
265
+ p,
266
+ h.map((n) => /* @__PURE__ */ jsx("div", { style: X(n), onPointerDown: (v) => L(n, v) }, n))
267
+ ]
268
+ }
269
+ );
270
+ }, qt = ({
271
+ direction: e = "vertical",
272
+ showScrollbar: t = "onInteraction",
273
+ width: o,
274
+ height: s,
275
+ onScroll: u,
276
+ children: d,
277
+ className: h,
278
+ style: g
279
+ }) => {
280
+ const p = e === "horizontal" || e === "both" ? "auto" : "hidden", E = e === "vertical" || e === "both" ? "auto" : "hidden";
281
+ return /* @__PURE__ */ jsx(
282
+ "div",
283
+ {
284
+ className: `nice-scrollview ${t === "never" ? "nice-scrollview--hide-sb" : t === "always" ? "nice-scrollview--show-sb" : ""} ${h || ""}`,
285
+ style: { ...g, width: o, height: s, overflowX: p, overflowY: E },
286
+ onScroll: u,
287
+ children: d
288
+ }
289
+ );
290
+ };
291
+ createContext(null);
292
+ const Nt = forwardRef(
293
+ ({ blocked: e, message: t, children: o, className: s, style: u, id: d }, h) => {
294
+ const g = Is(d);
295
+ return /* @__PURE__ */ jsxs(
296
+ "div",
297
+ {
298
+ ref: h,
299
+ id: g,
300
+ className: `nice-block-ui ${s || ""}`,
301
+ style: { position: "relative", ...u },
302
+ children: [
303
+ o,
304
+ e && /* @__PURE__ */ jsx("div", { className: "nice-block-ui__overlay", "aria-busy": "true", role: "alert", children: t && /* @__PURE__ */ jsx("div", { className: "nice-block-ui__message", children: t }) })
305
+ ]
306
+ }
307
+ );
308
+ }
309
+ );
310
+ Nt.displayName = "NiceBlockUI";
311
+ const kt = forwardRef(
312
+ ({
313
+ windows: e,
314
+ children: t,
315
+ onChange: o,
316
+ onClose: s,
317
+ onFocus: u,
318
+ showTaskbar: d = true,
319
+ size: h = "md",
320
+ className: g,
321
+ style: p,
322
+ id: E,
323
+ ...r
324
+ }, b) => {
325
+ const Y = Is(E), { t: f } = me(), [L, w] = useState(null), X = useRef(null), n = e ?? [], v = Math.max(1, ...n.map((i) => i.zIndex ?? 1)), a = useCallback(
326
+ (i, x) => {
327
+ const S = n.map((I) => I.key === i ? { ...I, ...x } : I);
328
+ o?.(S);
329
+ },
330
+ [n, o]
331
+ ), z = useCallback(
332
+ (i) => {
333
+ a(i, { zIndex: v + 1 }), u?.(i);
334
+ },
335
+ [a, v, u]
336
+ ), T = useCallback(
337
+ (i) => {
338
+ s?.(i), o?.(n.filter((x) => x.key !== i));
339
+ },
340
+ [n, o, s]
341
+ ), W = useCallback(
342
+ (i) => {
343
+ const x = n.find((S) => S.key === i);
344
+ x && a(i, { minimized: !x.minimized, maximized: false });
345
+ },
346
+ [n, a]
347
+ ), _ = useCallback(
348
+ (i) => {
349
+ const x = n.find((S) => S.key === i);
350
+ x && a(i, { maximized: !x.maximized, minimized: false });
351
+ },
352
+ [n, a]
353
+ );
354
+ useEffect(() => {
355
+ if (!L)
356
+ return;
357
+ const i = (S) => {
358
+ const I = n.find((l) => l.key === L.key);
359
+ if (I)
360
+ if (L.mode === "move")
361
+ a(L.key, {
362
+ x: S.clientX - L.offsetX,
363
+ y: S.clientY - L.offsetY
364
+ });
365
+ else {
366
+ const C = X.current?.getBoundingClientRect(), m = C?.left ?? 0, O = C?.top ?? 0;
367
+ a(L.key, {
368
+ width: Math.max(200, S.clientX - m - I.x),
369
+ height: Math.max(100, S.clientY - O - I.y)
370
+ });
371
+ }
372
+ }, x = () => w(null);
373
+ return document.addEventListener("mousemove", i), document.addEventListener("mouseup", x), () => {
374
+ document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", x);
375
+ };
376
+ }, [L, n, a]);
377
+ const D = useCallback(
378
+ (i, x, S) => {
379
+ x.preventDefault();
380
+ const I = n.find((l) => l.key === i);
381
+ I && (z(i), w({
382
+ key: i,
383
+ offsetX: S === "move" ? x.clientX - I.x : 0,
384
+ offsetY: S === "move" ? x.clientY - I.y : 0,
385
+ mode: S
386
+ }));
387
+ },
388
+ [n, z]
389
+ );
390
+ return /* @__PURE__ */ jsxs(
391
+ "div",
392
+ {
393
+ ref: (i) => {
394
+ X.current = i, typeof b == "function" ? b(i) : b && (b.current = i);
395
+ },
396
+ id: Y,
397
+ className: `nice-wm nice-wm--${h} ${g ?? ""}`,
398
+ style: { ...p, position: "relative", overflow: "hidden" },
399
+ ...r,
400
+ children: [
401
+ n.map((i) => {
402
+ if (i.minimized)
403
+ return null;
404
+ const x = i.maximized, S = x ? {
405
+ position: "absolute",
406
+ top: 0,
407
+ left: 0,
408
+ width: "100%",
409
+ height: "100%",
410
+ zIndex: i.zIndex ?? 1
411
+ } : {
412
+ position: "absolute",
413
+ top: i.y,
414
+ left: i.x,
415
+ width: i.width,
416
+ height: i.height,
417
+ zIndex: i.zIndex ?? 1
418
+ };
419
+ return /* @__PURE__ */ jsxs(
420
+ "div",
421
+ {
422
+ className: `nice-wm__window ${x ? "nice-wm__window--maximized" : ""}`,
423
+ style: S,
424
+ onMouseDown: () => z(i.key),
425
+ role: "dialog",
426
+ "aria-label": i.title,
427
+ children: [
428
+ /* @__PURE__ */ jsxs(
429
+ "div",
430
+ {
431
+ className: "nice-wm__titlebar",
432
+ onMouseDown: (I) => !x && D(i.key, I, "move"),
433
+ children: [
434
+ i.icon && /* @__PURE__ */ jsx("span", { className: "nice-wm__icon", children: i.icon }),
435
+ /* @__PURE__ */ jsx("span", { className: "nice-wm__title", children: i.title }),
436
+ /* @__PURE__ */ jsxs("div", { className: "nice-wm__controls", children: [
437
+ (i.minimizable ?? true) && /* @__PURE__ */ jsx(
438
+ "button",
439
+ {
440
+ type: "button",
441
+ className: "nice-wm__ctrl-btn nice-wm__ctrl-btn--min",
442
+ onClick: () => W(i.key),
443
+ title: f("wm.minimize", "Minimize"),
444
+ children: "─"
445
+ }
446
+ ),
447
+ (i.maximizable ?? true) && /* @__PURE__ */ jsx(
448
+ "button",
449
+ {
450
+ type: "button",
451
+ className: "nice-wm__ctrl-btn nice-wm__ctrl-btn--max",
452
+ onClick: () => _(i.key),
453
+ title: f("wm.maximize", "Maximize"),
454
+ children: x ? "❐" : "☐"
455
+ }
456
+ ),
457
+ (i.closable ?? true) && /* @__PURE__ */ jsx(
458
+ "button",
459
+ {
460
+ type: "button",
461
+ className: "nice-wm__ctrl-btn nice-wm__ctrl-btn--close",
462
+ onClick: () => T(i.key),
463
+ title: f("wm.close", "Close"),
464
+ children: "✕"
465
+ }
466
+ )
467
+ ] })
468
+ ]
469
+ }
470
+ ),
471
+ /* @__PURE__ */ jsx("div", { className: "nice-wm__body", children: i.content }),
472
+ (i.resizable ?? true) && !x && /* @__PURE__ */ jsx(
473
+ "div",
474
+ {
475
+ className: "nice-wm__resize-handle",
476
+ onMouseDown: (I) => D(i.key, I, "resize")
477
+ }
478
+ )
479
+ ]
480
+ },
481
+ i.key
482
+ );
483
+ }),
484
+ e === void 0 && t,
485
+ d && /* @__PURE__ */ jsx("div", { className: "nice-wm__taskbar", role: "toolbar", "aria-label": f("wm.taskbar", "Taskbar"), children: n.map((i) => /* @__PURE__ */ jsxs(
486
+ "button",
487
+ {
488
+ type: "button",
489
+ className: `nice-wm__taskbar-btn ${i.minimized ? "nice-wm__taskbar-btn--minimized" : ""}`,
490
+ onClick: () => {
491
+ i.minimized && W(i.key), z(i.key);
492
+ },
493
+ children: [
494
+ i.icon && /* @__PURE__ */ jsx("span", { className: "nice-wm__taskbar-icon", children: i.icon }),
495
+ /* @__PURE__ */ jsx("span", { className: "nice-wm__taskbar-label", children: i.title })
496
+ ]
497
+ },
498
+ i.key
499
+ )) })
500
+ ]
501
+ }
502
+ );
503
+ }
504
+ );
505
+ kt.displayName = "NiceWindowManager";
506
+ createContext({
507
+ startTutorial: () => {
508
+ },
509
+ stopTutorial: () => {
510
+ },
511
+ isActive: false,
512
+ currentStep: 0,
513
+ nextStep: () => {
514
+ },
515
+ prevStep: () => {
516
+ },
517
+ goToStep: () => {
518
+ }
519
+ });
520
+ function It(e, t, o, s, u) {
521
+ const d = e <= u, h = e + u >= o, g = t <= u, p = t + u >= s;
522
+ return g && d ? "top-left" : g && h ? "top-right" : p && d ? "bottom-left" : p && h ? "bottom-right" : d ? "left" : h ? "right" : g ? "top" : p ? "bottom" : "none";
523
+ }
524
+ function Mt(e) {
525
+ switch (e) {
526
+ case "left":
527
+ return { left: 0, top: 0, width: "50%", height: "100%" };
528
+ case "right":
529
+ return { left: "50%", top: 0, width: "50%", height: "100%" };
530
+ case "top":
531
+ return { left: 0, top: 0, width: "100%", height: "50%" };
532
+ case "bottom":
533
+ return { left: 0, top: "50%", width: "100%", height: "50%" };
534
+ case "top-left":
535
+ return { left: 0, top: 0, width: "50%", height: "50%" };
536
+ case "top-right":
537
+ return { left: "50%", top: 0, width: "50%", height: "50%" };
538
+ case "bottom-left":
539
+ return { left: 0, top: "50%", width: "50%", height: "50%" };
540
+ case "bottom-right":
541
+ return { left: "50%", top: "50%", width: "50%", height: "50%" };
542
+ default:
543
+ return null;
544
+ }
545
+ }
546
+ const St = forwardRef(
547
+ ({
548
+ windowKey: e,
549
+ title: t,
550
+ icon: o,
551
+ children: s,
552
+ footer: u,
553
+ x: d,
554
+ y: h,
555
+ defaultPosition: g,
556
+ width: p = 480,
557
+ height: E = 360,
558
+ minWidth: r = 200,
559
+ minHeight: b = 120,
560
+ maxWidth: Y,
561
+ maxHeight: f,
562
+ zIndex: L = 1,
563
+ closable: w = true,
564
+ minimizable: X = true,
565
+ maximizable: n = true,
566
+ fullscreenable: v = false,
567
+ pinnable: a = false,
568
+ resizable: z = true,
569
+ draggable: T = true,
570
+ snappable: W = true,
571
+ snapThreshold: _ = 20,
572
+ minimized: D,
573
+ maximized: i,
574
+ fullscreen: x,
575
+ pinned: S,
576
+ focused: I,
577
+ onClose: l,
578
+ onMinimize: C,
579
+ onMaximize: m,
580
+ onFullscreen: O,
581
+ onPin: R,
582
+ onFocus: Q,
583
+ onMove: le,
584
+ onResize: M,
585
+ onSnap: q,
586
+ onTitleBarDoubleClick: ae,
587
+ size: Oe = "md",
588
+ statusBar: Me,
589
+ titleBarActions: qe,
590
+ className: Ae,
591
+ style: We,
592
+ id: Se,
593
+ accessMode: Be,
594
+ ...Fe
595
+ }, He) => {
596
+ const Ue = Is(Se), Ke = rl(Be, Se), { t: de } = me(), ye = useRef(null);
597
+ ye.current == null && (ye.current = `nice-window-${Math.random().toString(36).slice(2, 10)}`);
598
+ const A = e ?? ye.current, Ge = d ?? g?.x ?? 100, Ve = h ?? g?.y ?? 100;
599
+ if (Ke === "hidden")
600
+ return null;
601
+ const [fe, se] = useState({ x: Ge, y: Ve }), [we, _e] = useState({ width: p, height: E }), [je, Qe] = useState(false), [Ze, Je] = useState(false), [et, tt] = useState(false), [nt, it] = useState(false), [V, be] = useState("none"), ot = D ?? je, G = i ?? Ze, H = x ?? et, ue = S ?? nt, xe = I ?? true, oe = fe.x, ce = fe.y, Z = we.width, J = we.height, ee = useRef(
602
+ null
603
+ ), U = useRef(null), $ = useRef(null), ct = useCallback(() => {
604
+ l?.(A);
605
+ }, [A, l]), st = useCallback(() => {
606
+ Qe(true), C?.(A);
607
+ }, [A, C]), Ne = useCallback(() => {
608
+ const N = !G;
609
+ Je(N), !N && $.current ? (se({ x: $.current.x, y: $.current.y }), _e({ width: $.current.w, height: $.current.h }), $.current = null) : N && ($.current = { x: oe, y: ce, w: Z, h: J }), be("none"), m?.(A, N);
610
+ }, [A, G, oe, ce, Z, J, m]), ke = useCallback(() => {
611
+ const N = !H;
612
+ tt(N), N ? $.current = { x: oe, y: ce, w: Z, h: J } : $.current && (se({ x: $.current.x, y: $.current.y }), _e({ width: $.current.w, height: $.current.h }), $.current = null), O?.(A, N);
613
+ }, [A, H, oe, ce, Z, J, O]), rt = useCallback(() => {
614
+ const N = !ue;
615
+ it(N), R?.(A, N);
616
+ }, [A, ue, R]), me$1 = useCallback(() => {
617
+ Q?.(A);
618
+ }, [A, Q]), lt = useCallback(() => {
619
+ ae ? ae(A) : n && Ne();
620
+ }, [A, n, Ne, ae]);
621
+ useEffect(() => {
622
+ const N = (te) => {
623
+ if (!ee.current)
624
+ return;
625
+ const j = te.clientX - ee.current.startX + ee.current.origX, he = te.clientY - ee.current.startY + ee.current.origY;
626
+ se({ x: j, y: he }), le?.(A, { x: j, y: he });
627
+ }, F = (te) => {
628
+ if (ee.current) {
629
+ if (W) {
630
+ const j = It(
631
+ te.clientX,
632
+ te.clientY,
633
+ window.innerWidth,
634
+ window.innerHeight,
635
+ _
636
+ );
637
+ j !== "none" && ($.current = { x: fe.x, y: fe.y, w: Z, h: J }, be(j), q?.(A, j));
638
+ }
639
+ ee.current = null;
640
+ }
641
+ };
642
+ return document.addEventListener("mousemove", N), document.addEventListener("mouseup", F), () => {
643
+ document.removeEventListener("mousemove", N), document.removeEventListener("mouseup", F);
644
+ };
645
+ });
646
+ const at = useCallback(
647
+ (N) => {
648
+ !T || G || H || (N.preventDefault(), V !== "none" && ($.current && (se({ x: $.current.x, y: $.current.y }), _e({ width: $.current.w, height: $.current.h })), be("none")), me$1(), ee.current = { startX: N.clientX, startY: N.clientY, origX: oe, origY: ce });
649
+ },
650
+ [T, G, H, V, oe, ce, me$1]
651
+ );
652
+ useEffect(() => {
653
+ const N = (te) => {
654
+ if (!U.current)
655
+ return;
656
+ const j = te.clientX - U.current.startX, he = te.clientY - U.current.startY, re = U.current.handle;
657
+ let ne = U.current.origW, ie = U.current.origH;
658
+ if (re.includes("e") && (ne = U.current.origW + j), re.includes("w") && (ne = U.current.origW - j), re.includes("s") && (ie = U.current.origH + he), re.includes("n") && (ie = U.current.origH - he), ne = Math.max(r, Y ? Math.min(Y, ne) : ne), ie = Math.max(b, f ? Math.min(f, ie) : ie), re.includes("w")) {
659
+ const Ee = we.width - ne;
660
+ se((pe) => ({ ...pe, x: pe.x + Ee }));
661
+ }
662
+ if (re.includes("n")) {
663
+ const Ee = we.height - ie;
664
+ se((pe) => ({ ...pe, y: pe.y + Ee }));
665
+ }
666
+ _e({ width: ne, height: ie }), M?.(A, { width: ne, height: ie });
667
+ }, F = () => {
668
+ U.current = null;
669
+ };
670
+ return document.addEventListener("mousemove", N), document.addEventListener("mouseup", F), () => {
671
+ document.removeEventListener("mousemove", N), document.removeEventListener("mouseup", F);
672
+ };
673
+ });
674
+ const dt = useCallback(
675
+ (N, F) => {
676
+ !z || G || H || V !== "none" || (F.preventDefault(), F.stopPropagation(), me$1(), U.current = { startX: F.clientX, startY: F.clientY, origW: Z, origH: J, handle: N });
677
+ },
678
+ [z, G, H, V, Z, J, me$1]
679
+ );
680
+ if (useEffect(() => {
681
+ if (!xe)
682
+ return;
683
+ const N = (F) => {
684
+ F.key === "Escape" && H && ke();
685
+ };
686
+ return document.addEventListener("keydown", N), () => document.removeEventListener("keydown", N);
687
+ }, [xe, H, ke]), ot)
688
+ return null;
689
+ const Re = V !== "none" ? Mt(V) : null, Le = G || H, ut = H ? { position: "fixed", top: 0, left: 0, width: "100vw", height: "100vh", zIndex: 999999 } : G ? { position: "absolute", top: 0, left: 0, width: "100%", height: "100%", zIndex: L } : Re ? { position: "absolute", ...Re, zIndex: L } : { position: "absolute", top: ce, left: oe, width: Z, height: J, zIndex: L }, mt = ["n", "e", "s", "w", "ne", "se", "sw", "nw"], ht = {
690
+ n: "ns-resize",
691
+ s: "ns-resize",
692
+ e: "ew-resize",
693
+ w: "ew-resize",
694
+ ne: "nesw-resize",
695
+ sw: "nesw-resize",
696
+ nw: "nwse-resize",
697
+ se: "nwse-resize"
698
+ };
699
+ return /* @__PURE__ */ jsxs(
700
+ "div",
701
+ {
702
+ ref: He,
703
+ id: Ue,
704
+ className: `nice-window nice-window--${Oe} ${xe ? "nice-window--focused" : ""} ${ue ? "nice-window--pinned" : ""} ${Le ? "nice-window--maximized" : ""} ${V !== "none" ? `nice-window--snapped-${V}` : ""} ${Ae ?? ""}`,
705
+ style: { ...ut, ...We },
706
+ onMouseDown: me$1,
707
+ role: "dialog",
708
+ "aria-label": t,
709
+ ...Fe,
710
+ children: [
711
+ /* @__PURE__ */ jsxs(
712
+ "div",
713
+ {
714
+ className: "nice-window__titlebar",
715
+ onMouseDown: at,
716
+ onDoubleClick: lt,
717
+ children: [
718
+ o && /* @__PURE__ */ jsx("span", { className: "nice-window__icon", children: o }),
719
+ /* @__PURE__ */ jsx("span", { className: "nice-window__title", children: t }),
720
+ /* @__PURE__ */ jsxs("div", { className: "nice-window__actions", children: [
721
+ qe,
722
+ a && /* @__PURE__ */ jsx(
723
+ "button",
724
+ {
725
+ type: "button",
726
+ className: `nice-window__action nice-window__action--pin ${ue ? "nice-window__action--active" : ""}`,
727
+ onClick: rt,
728
+ title: de("window.pin", ue ? "Unpin" : "Pin"),
729
+ children: "📌"
730
+ }
731
+ ),
732
+ X && /* @__PURE__ */ jsx(
733
+ "button",
734
+ {
735
+ type: "button",
736
+ className: "nice-window__action nice-window__action--minimize",
737
+ onClick: st,
738
+ title: de("window.minimize", "Minimize"),
739
+ children: "─"
740
+ }
741
+ ),
742
+ n && /* @__PURE__ */ jsx(
743
+ "button",
744
+ {
745
+ type: "button",
746
+ className: "nice-window__action nice-window__action--maximize",
747
+ onClick: Ne,
748
+ title: de("window.maximize", G ? "Restore" : "Maximize"),
749
+ children: G ? "❐" : "☐"
750
+ }
751
+ ),
752
+ v && /* @__PURE__ */ jsx(
753
+ "button",
754
+ {
755
+ type: "button",
756
+ className: "nice-window__action nice-window__action--fullscreen",
757
+ onClick: ke,
758
+ title: de("window.fullscreen", H ? "Exit Full Screen" : "Full Screen"),
759
+ children: H ? "⇲" : "⇱"
760
+ }
761
+ ),
762
+ w && /* @__PURE__ */ jsx(
763
+ "button",
764
+ {
765
+ type: "button",
766
+ className: "nice-window__action nice-window__action--close",
767
+ onClick: ct,
768
+ title: de("window.close", "Close"),
769
+ children: "✕"
770
+ }
771
+ )
772
+ ] })
773
+ ]
774
+ }
775
+ ),
776
+ /* @__PURE__ */ jsx("div", { className: "nice-window__body", children: s }),
777
+ u && /* @__PURE__ */ jsx("div", { className: "nice-window__footer", children: u }),
778
+ Me && /* @__PURE__ */ jsx("div", { className: "nice-window__statusbar", children: Me }),
779
+ z && !Le && V === "none" && /* @__PURE__ */ jsx(Fragment, { children: mt.map((N) => /* @__PURE__ */ jsx(
780
+ "div",
781
+ {
782
+ className: `nice-window__resize nice-window__resize--${N}`,
783
+ style: { cursor: ht[N] },
784
+ onMouseDown: (F) => dt(N, F)
785
+ },
786
+ N
787
+ )) })
788
+ ]
789
+ }
790
+ );
791
+ }
792
+ );
793
+ St.displayName = "NiceWindow";
794
+
795
+ export { $t as N, Nt as a, Yt as b, Pt as d, Dt as e, Ot as f, Xt as g, qt as h, St as k, kt as l };
796
+ //# sourceMappingURL=NiceWindow-DeC83yfE.js.map