@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
@@ -9,116 +9,436 @@
9
9
  */
10
10
  const EMOJI_CATALOG = [
11
11
  {
12
- id: "faces",
13
- label: "Buźki",
14
- icon: "😊",
12
+ id: 'faces',
13
+ label: 'Buźki',
14
+ icon: '😊',
15
15
  emojis: [
16
- "😀", "😃", "😄", "😁", "😆", "😅", "🤣", "😂", "🙂", "😉", "😊", "😇",
17
- "🥰", "😍", "🤩", "😘", "😗", "😚", "😋", "😛", "😜", "🤪", "😝", "🤑",
18
- "🤗", "🤭", "🤫", "🤔", "😐", "😑", "😶", "🙄", "😏", "😣", "😥", "😮",
19
- "🤐", "😯", "😪", "😫", "🥱", "😴", "🤤", "😌", "😷", "🤒", "🤕", "🤢",
20
- "🤮", "🥵", "🥶", "🥴", "😵", "🤯", "🤠", "🥳", "🥸", "😎", "🤓", "🧐",
21
- "😤", "😡", "🤬", "😈", "👿", "💀", "☠️", "💩", "🤡", "👹", "👻", "👽", "🤖",
16
+ '😀',
17
+ '😃',
18
+ '😄',
19
+ '😁',
20
+ '😆',
21
+ '😅',
22
+ '🤣',
23
+ '😂',
24
+ '🙂',
25
+ '😉',
26
+ '😊',
27
+ '😇',
28
+ '🥰',
29
+ '😍',
30
+ '🤩',
31
+ '😘',
32
+ '😗',
33
+ '😚',
34
+ '😋',
35
+ '😛',
36
+ '😜',
37
+ '🤪',
38
+ '😝',
39
+ '🤑',
40
+ '🤗',
41
+ '🤭',
42
+ '🤫',
43
+ '🤔',
44
+ '😐',
45
+ '😑',
46
+ '😶',
47
+ '🙄',
48
+ '😏',
49
+ '😣',
50
+ '😥',
51
+ '😮',
52
+ '🤐',
53
+ '😯',
54
+ '😪',
55
+ '😫',
56
+ '🥱',
57
+ '😴',
58
+ '🤤',
59
+ '😌',
60
+ '😷',
61
+ '🤒',
62
+ '🤕',
63
+ '🤢',
64
+ '🤮',
65
+ '🥵',
66
+ '🥶',
67
+ '🥴',
68
+ '😵',
69
+ '🤯',
70
+ '🤠',
71
+ '🥳',
72
+ '🥸',
73
+ '😎',
74
+ '🤓',
75
+ '🧐',
76
+ '😤',
77
+ '😡',
78
+ '🤬',
79
+ '😈',
80
+ '👿',
81
+ '💀',
82
+ '☠️',
83
+ '💩',
84
+ '🤡',
85
+ '👹',
86
+ '👻',
87
+ '👽',
88
+ '🤖',
22
89
  ],
23
90
  },
24
91
  {
25
- id: "gestures",
26
- label: "Gesty",
27
- icon: "👍",
92
+ id: 'gestures',
93
+ label: 'Gesty',
94
+ icon: '👍',
28
95
  emojis: [
29
- "👍", "👎", "👊", "✊", "🤛", "🤜", "🤝", "👏", "🙌", "🫶", "👐", "🤲",
30
- "🙏", "✌️", "🤞", "🤟", "🤘", "🤙", "👈", "👉", "👆", "👇", "☝️", "✋",
31
- "🤚", "🖐️", "🖖", "👋", "🤏", "✍️", "💪", "🦾", "🦵", "🦶", "👂", "👃",
32
- "👀", "👁️", "👅", "👄",
96
+ '👍',
97
+ '👎',
98
+ '👊',
99
+ '✊',
100
+ '🤛',
101
+ '🤜',
102
+ '🤝',
103
+ '👏',
104
+ '🙌',
105
+ '🫶',
106
+ '👐',
107
+ '🤲',
108
+ '🙏',
109
+ '✌️',
110
+ '🤞',
111
+ '🤟',
112
+ '🤘',
113
+ '🤙',
114
+ '👈',
115
+ '👉',
116
+ '👆',
117
+ '👇',
118
+ '☝️',
119
+ '✋',
120
+ '🤚',
121
+ '🖐️',
122
+ '🖖',
123
+ '👋',
124
+ '🤏',
125
+ '✍️',
126
+ '💪',
127
+ '🦾',
128
+ '🦵',
129
+ '🦶',
130
+ '👂',
131
+ '👃',
132
+ '👀',
133
+ '👁️',
134
+ '👅',
135
+ '👄',
33
136
  ],
34
137
  },
35
138
  {
36
- id: "hearts",
37
- label: "Serca",
38
- icon: "❤️",
139
+ id: 'hearts',
140
+ label: 'Serca',
141
+ icon: '❤️',
39
142
  emojis: [
40
- "❤️", "🧡", "💛", "💚", "💙", "💜", "🖤", "🤍", "🤎", "❤️‍🔥", "💔", "❣️",
41
- "💕", "💞", "💓", "💗", "💖", "💘", "💝", "💟", "♥️", "💌", "💋", "💍", "💎",
143
+ '❤️',
144
+ '🧡',
145
+ '💛',
146
+ '💚',
147
+ '💙',
148
+ '💜',
149
+ '🖤',
150
+ '🤍',
151
+ '🤎',
152
+ '❤️‍🔥',
153
+ '💔',
154
+ '❣️',
155
+ '💕',
156
+ '💞',
157
+ '💓',
158
+ '💗',
159
+ '💖',
160
+ '💘',
161
+ '💝',
162
+ '💟',
163
+ '♥️',
164
+ '💌',
165
+ '💋',
166
+ '💍',
167
+ '💎',
42
168
  ],
43
169
  },
44
170
  {
45
- id: "animals",
46
- label: "Zwierzki",
47
- icon: "🐶",
171
+ id: 'animals',
172
+ label: 'Zwierzki',
173
+ icon: '🐶',
48
174
  emojis: [
49
- "🐶", "🐱", "🐭", "🐹", "🐰", "🦊", "🐻", "🐼", "🐨", "🐯", "🦁", "🐮",
50
- "🐷", "🐸", "🐵", "🙈", "🙉", "🙊", "🐔", "🐧", "🐦", "🦆", "🦅", "🦉",
51
- "🦋", "🐌", "🐞", "🐙", "🐬", "🐳", "🦈", "🐊", "🐘", "🦒", "🦘", "🐴", "🦄",
175
+ '🐶',
176
+ '🐱',
177
+ '🐭',
178
+ '🐹',
179
+ '🐰',
180
+ '🦊',
181
+ '🐻',
182
+ '🐼',
183
+ '🐨',
184
+ '🐯',
185
+ '🦁',
186
+ '🐮',
187
+ '🐷',
188
+ '🐸',
189
+ '🐵',
190
+ '🙈',
191
+ '🙉',
192
+ '🙊',
193
+ '🐔',
194
+ '🐧',
195
+ '🐦',
196
+ '🦆',
197
+ '🦅',
198
+ '🦉',
199
+ '🦋',
200
+ '🐌',
201
+ '🐞',
202
+ '🐙',
203
+ '🐬',
204
+ '🐳',
205
+ '🦈',
206
+ '🐊',
207
+ '🐘',
208
+ '🦒',
209
+ '🦘',
210
+ '🐴',
211
+ '🦄',
52
212
  ],
53
213
  },
54
214
  {
55
- id: "party",
56
- label: "Impreza",
57
- icon: "🎉",
215
+ id: 'party',
216
+ label: 'Impreza',
217
+ icon: '🎉',
58
218
  emojis: [
59
- "🎉", "🎊", "🎈", "🎁", "🎀", "🎃", "🎄", "🎆", "🎇", "✨", "🏆", "🏅",
60
- "🥇", "🥈", "🥉", "🎪", "🎭", "🎨", "🎬", "🎤", "🎧", "🎼", "🎵", "🎶",
61
- "🎹", "🥁", "🎷", "🎺", "🎸", "🎻", "🎲", "🎯", "🎳", "🕹️", "🎮", "🎰",
219
+ '🎉',
220
+ '🎊',
221
+ '🎈',
222
+ '🎁',
223
+ '🎀',
224
+ '🎃',
225
+ '🎄',
226
+ '🎆',
227
+ '🎇',
228
+ '✨',
229
+ '🏆',
230
+ '🏅',
231
+ '🥇',
232
+ '🥈',
233
+ '🥉',
234
+ '🎪',
235
+ '🎭',
236
+ '🎨',
237
+ '🎬',
238
+ '🎤',
239
+ '🎧',
240
+ '🎼',
241
+ '🎵',
242
+ '🎶',
243
+ '🎹',
244
+ '🥁',
245
+ '🎷',
246
+ '🎺',
247
+ '🎸',
248
+ '🎻',
249
+ '🎲',
250
+ '🎯',
251
+ '🎳',
252
+ '🕹️',
253
+ '🎮',
254
+ '🎰',
62
255
  ],
63
256
  },
64
257
  {
65
- id: "food",
66
- label: "Jedzenie",
67
- icon: "🍕",
258
+ id: 'food',
259
+ label: 'Jedzenie',
260
+ icon: '🍕',
68
261
  emojis: [
69
- "🍏", "🍎", "🍐", "🍊", "🍋", "🍌", "🍉", "🍇", "🍓", "🍒", "🍑", "🥭",
70
- "🍍", "🥝", "🍅", "🥑", "🍆", "🌽", "🌶️", "🍞", "🧀", "🥚", "🍳", "🥓",
71
- "🍗", "🌭", "🍔", "🍟", "🍕", "🌮", "🌯", "🥪", "🍝", "🍜", "🍣", "🍤",
72
- "🍦", "🍰", "🎂", "🍩", "🍪", "🍫", "🍬", "🍭", "🍿", "☕", "🍵", "🍺",
73
- "🍻", "🥂", "🍷", "🍸", "🍹", "🧃", "🍾",
262
+ '🍏',
263
+ '🍎',
264
+ '🍐',
265
+ '🍊',
266
+ '🍋',
267
+ '🍌',
268
+ '🍉',
269
+ '🍇',
270
+ '🍓',
271
+ '🍒',
272
+ '🍑',
273
+ '🥭',
274
+ '🍍',
275
+ '🥝',
276
+ '🍅',
277
+ '🥑',
278
+ '🍆',
279
+ '🌽',
280
+ '🌶️',
281
+ '🍞',
282
+ '🧀',
283
+ '🥚',
284
+ '🍳',
285
+ '🥓',
286
+ '🍗',
287
+ '🌭',
288
+ '🍔',
289
+ '🍟',
290
+ '🍕',
291
+ '🌮',
292
+ '🌯',
293
+ '🥪',
294
+ '🍝',
295
+ '🍜',
296
+ '🍣',
297
+ '🍤',
298
+ '🍦',
299
+ '🍰',
300
+ '🎂',
301
+ '🍩',
302
+ '🍪',
303
+ '🍫',
304
+ '🍬',
305
+ '🍭',
306
+ '🍿',
307
+ '☕',
308
+ '🍵',
309
+ '🍺',
310
+ '🍻',
311
+ '🥂',
312
+ '🍷',
313
+ '🍸',
314
+ '🍹',
315
+ '🧃',
316
+ '🍾',
74
317
  ],
75
318
  },
76
319
  {
77
- id: "nature",
78
- label: "Natura",
79
- icon: "🌸",
320
+ id: 'nature',
321
+ label: 'Natura',
322
+ icon: '🌸',
80
323
  emojis: [
81
- "🌸", "🌺", "🌹", "🌻", "🌼", "💐", "🌷", "🌱", "🪴", "🌲", "🌳", "🌴",
82
- "🌵", "🍀", "☘️", "🌿", "🍃", "🍂", "🍁", "🌊", "🌈", "☀️", "🌤️", "⛅",
83
- "☁️", "🌧️", "⛈️", "🌩️", "❄️", "☃️", "⛄", "🔥", "💧", "💦", "🌏", "🌙",
84
- "🌟", "💫", "✨", "☄️",
324
+ '🌸',
325
+ '🌺',
326
+ '🌹',
327
+ '🌻',
328
+ '🌼',
329
+ '💐',
330
+ '🌷',
331
+ '🌱',
332
+ '🪴',
333
+ '🌲',
334
+ '🌳',
335
+ '🌴',
336
+ '🌵',
337
+ '🍀',
338
+ '☘️',
339
+ '🌿',
340
+ '🍃',
341
+ '🍂',
342
+ '🍁',
343
+ '🌊',
344
+ '🌈',
345
+ '☀️',
346
+ '🌤️',
347
+ '⛅',
348
+ '☁️',
349
+ '🌧️',
350
+ '⛈️',
351
+ '🌩️',
352
+ '❄️',
353
+ '☃️',
354
+ '⛄',
355
+ '🔥',
356
+ '💧',
357
+ '💦',
358
+ '🌏',
359
+ '🌙',
360
+ '🌟',
361
+ '💫',
362
+ '✨',
363
+ '☄️',
85
364
  ],
86
365
  },
87
366
  {
88
- id: "symbols",
89
- label: "Symbole",
90
- icon: "⚡",
367
+ id: 'symbols',
368
+ label: 'Symbole',
369
+ icon: '⚡',
91
370
  emojis: [
92
- "⚡", "💥", "🔥", "✨", "💫", "🌟", "⭐", "💡", "💣", "🧨", "🎯", "♠️",
93
- "♥️", "♦️", "♣️", "🔮", "🧿", "♻️", "⚜️", "⭕", "✅", "❌", "➕", "➖",
94
- "❗", "❓", "‼️", "⁉️", "💯", "🔴", "🟠", "🟡", "🟢", "🔵", "🟣", "⚫",
95
- "⚪", "🔺", "🔻", "🔶", "🔷", "🏳️", "🏴", "🚩", "🏳️‍🌈",
371
+ '⚡',
372
+ '💥',
373
+ '🔥',
374
+ '✨',
375
+ '💫',
376
+ '🌟',
377
+ '⭐',
378
+ '💡',
379
+ '💣',
380
+ '🧨',
381
+ '🎯',
382
+ '♠️',
383
+ '♥️',
384
+ '♦️',
385
+ '♣️',
386
+ '🔮',
387
+ '🧿',
388
+ '♻️',
389
+ '⚜️',
390
+ '⭕',
391
+ '✅',
392
+ '❌',
393
+ '➕',
394
+ '➖',
395
+ '❗',
396
+ '❓',
397
+ '‼️',
398
+ '⁉️',
399
+ '💯',
400
+ '🔴',
401
+ '🟠',
402
+ '🟡',
403
+ '🟢',
404
+ '🔵',
405
+ '🟣',
406
+ '⚫',
407
+ '⚪',
408
+ '🔺',
409
+ '🔻',
410
+ '🔶',
411
+ '🔷',
412
+ '🏳️',
413
+ '🏴',
414
+ '🚩',
415
+ '🏳️‍🌈',
96
416
  ],
97
417
  },
98
418
  ];
99
419
  const SHAPE_CATALOG = [
100
- { id: "rect", label: "Prostokąt", icon: "⬜" },
101
- { id: "circle", label: "Koło", icon: "⭕" },
102
- { id: "triangle", label: "Trójkąt", icon: "🔺" },
103
- { id: "star", label: "Gwiazda", icon: "⭐" },
104
- { id: "heart", label: "Serce", icon: "❤️" },
105
- { id: "arrow", label: "Strzałka", icon: "➡️" },
106
- { id: "diamond", label: "Romb", icon: "💎" },
107
- { id: "hexagon", label: "Sześciokąt", icon: "⬡" },
108
- { id: "cross", label: "Krzyżyk", icon: "✚" },
109
- { id: "lightning", label: "Błyskawica", icon: "⚡" },
420
+ { id: 'rect', label: 'Prostokąt', icon: '⬜' },
421
+ { id: 'circle', label: 'Koło', icon: '⭕' },
422
+ { id: 'triangle', label: 'Trójkąt', icon: '🔺' },
423
+ { id: 'star', label: 'Gwiazda', icon: '⭐' },
424
+ { id: 'heart', label: 'Serce', icon: '❤️' },
425
+ { id: 'arrow', label: 'Strzałka', icon: '➡️' },
426
+ { id: 'diamond', label: 'Romb', icon: '💎' },
427
+ { id: 'hexagon', label: 'Sześciokąt', icon: '⬡' },
428
+ { id: 'cross', label: 'Krzyżyk', icon: '✚' },
429
+ { id: 'lightning', label: 'Błyskawica', icon: '⚡' },
110
430
  ];
111
431
  const FRAME_CATALOG = [
112
- { id: "simple", label: "Prosta", icon: "▪️" },
113
- { id: "double", label: "Podwójna", icon: "◻️" },
114
- { id: "rounded", label: "Zaokrąglona", icon: "⬜" },
115
- { id: "polaroid", label: "Polaroid", icon: "📸" },
116
- { id: "film", label: "Klisza", icon: "🎞️" },
117
- { id: "vintage", label: "Vintage", icon: "🖼️" },
118
- { id: "ornate", label: "Ozdobna", icon: "🏛️" },
119
- { id: "shadow", label: "Cień", icon: "🌑" },
120
- { id: "neon", label: "Neon", icon: "💡" },
121
- { id: "torn", label: "Podarta", icon: "📃" },
432
+ { id: 'simple', label: 'Prosta', icon: '▪️' },
433
+ { id: 'double', label: 'Podwójna', icon: '◻️' },
434
+ { id: 'rounded', label: 'Zaokrąglona', icon: '⬜' },
435
+ { id: 'polaroid', label: 'Polaroid', icon: '📸' },
436
+ { id: 'film', label: 'Klisza', icon: '🎞️' },
437
+ { id: 'vintage', label: 'Vintage', icon: '🖼️' },
438
+ { id: 'ornate', label: 'Ozdobna', icon: '🏛️' },
439
+ { id: 'shadow', label: 'Cień', icon: '🌑' },
440
+ { id: 'neon', label: 'Neon', icon: '💡' },
441
+ { id: 'torn', label: 'Podarta', icon: '📃' },
122
442
  ];
123
443
  // ═══════════════════════════════════════════════════════════════
124
444
  // ── ID generation
@@ -132,18 +452,19 @@ function generateOverlayId() {
132
452
  // ═══════════════════════════════════════════════════════════════
133
453
  /** Render all overlays to a canvas context. */
134
454
  function renderAllOverlays(ctx, overlays, w, h) {
135
- for (const ov of overlays)
455
+ for (const ov of overlays) {
136
456
  renderSingleOverlay(ctx, ov, w, h);
457
+ }
137
458
  }
138
459
  function renderSingleOverlay(ctx, ov, w, h) {
139
460
  ctx.save();
140
461
  ctx.globalAlpha = ov.opacity;
141
- if (ov.type === "drawing") {
462
+ if (ov.type === 'drawing') {
142
463
  renderDrawing(ctx, ov, w, h);
143
464
  ctx.restore();
144
465
  return;
145
466
  }
146
- if (ov.type === "frame") {
467
+ if (ov.type === 'frame') {
147
468
  renderFrame(ctx, ov, w, h);
148
469
  ctx.restore();
149
470
  return;
@@ -155,13 +476,13 @@ function renderSingleOverlay(ctx, ov, w, h) {
155
476
  ctx.rotate((ov.rotation * Math.PI) / 180);
156
477
  ctx.scale(ov.scaleX, ov.scaleY);
157
478
  switch (ov.type) {
158
- case "emoji":
479
+ case 'emoji':
159
480
  renderEmoji(ctx, ov);
160
481
  break;
161
- case "text":
482
+ case 'text':
162
483
  renderText(ctx, ov);
163
484
  break;
164
- case "shape":
485
+ case 'shape':
165
486
  renderShape(ctx, ov);
166
487
  break;
167
488
  }
@@ -170,23 +491,23 @@ function renderSingleOverlay(ctx, ov, w, h) {
170
491
  // -- Emoji -------------------------------------------------------
171
492
  function renderEmoji(ctx, ov) {
172
493
  ctx.font = `${ov.fontSize}px "Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",sans-serif`;
173
- ctx.textAlign = "center";
174
- ctx.textBaseline = "middle";
494
+ ctx.textAlign = 'center';
495
+ ctx.textBaseline = 'middle';
175
496
  ctx.fillText(ov.emoji, 0, 0);
176
497
  }
177
498
  // -- Text --------------------------------------------------------
178
499
  function renderText(ctx, ov) {
179
- const style = `${ov.italic ? "italic " : ""}${ov.bold ? "bold " : ""}`;
180
- ctx.font = `${style}${ov.fontSize}px ${ov.fontFamily || "Arial"},sans-serif`;
181
- ctx.textAlign = "center";
182
- ctx.textBaseline = "middle";
183
- const lines = ov.text.split("\n");
500
+ const style = `${ov.italic ? 'italic ' : ''}${ov.bold ? 'bold ' : ''}`;
501
+ ctx.font = `${style}${ov.fontSize}px ${ov.fontFamily || 'Arial'},sans-serif`;
502
+ ctx.textAlign = 'center';
503
+ ctx.textBaseline = 'middle';
504
+ const lines = ov.text.split('\n');
184
505
  const lineH = ov.fontSize * 1.25;
185
506
  const totalH = lineH * lines.length;
186
507
  const startY = -(totalH / 2) + lineH / 2;
187
508
  // Background
188
509
  if (ov.background) {
189
- const maxW = Math.max(...lines.map(l => ctx.measureText(l).width));
510
+ const maxW = Math.max(...lines.map((l) => ctx.measureText(l).width));
190
511
  const pad = ov.backgroundPadding;
191
512
  ctx.fillStyle = ov.background;
192
513
  const rx = -(maxW / 2 + pad);
@@ -206,13 +527,13 @@ function renderText(ctx, ov) {
206
527
  if (ov.outlineColor && ov.outlineWidth > 0) {
207
528
  ctx.strokeStyle = ov.outlineColor;
208
529
  ctx.lineWidth = ov.outlineWidth;
209
- ctx.lineJoin = "round";
530
+ ctx.lineJoin = 'round';
210
531
  ctx.strokeText(lines[i], 0, ly);
211
532
  }
212
533
  ctx.fillStyle = ov.color;
213
534
  ctx.fillText(lines[i], 0, ly);
214
535
  }
215
- ctx.shadowColor = "transparent";
536
+ ctx.shadowColor = 'transparent';
216
537
  }
217
538
  // -- Shape -------------------------------------------------------
218
539
  function renderShape(ctx, ov) {
@@ -231,39 +552,41 @@ function drawShapePath(ctx, kind, w, h) {
231
552
  const hw = w / 2, hh = h / 2;
232
553
  ctx.beginPath();
233
554
  switch (kind) {
234
- case "rect":
555
+ case 'rect':
235
556
  ctx.rect(-hw, -hh, w, h);
236
557
  break;
237
- case "circle":
558
+ case 'circle':
238
559
  ctx.ellipse(0, 0, hw, hh, 0, 0, Math.PI * 2);
239
560
  break;
240
- case "triangle":
561
+ case 'triangle':
241
562
  ctx.moveTo(0, -hh);
242
563
  ctx.lineTo(hw, hh);
243
564
  ctx.lineTo(-hw, hh);
244
565
  ctx.closePath();
245
566
  break;
246
- case "star": {
567
+ case 'star': {
247
568
  const spikes = 5, outer = Math.min(hw, hh), inner = outer * 0.4;
248
569
  for (let i = 0; i < spikes * 2; i++) {
249
570
  const r = i % 2 === 0 ? outer : inner;
250
571
  const a = (Math.PI * i) / spikes - Math.PI / 2;
251
- if (i === 0)
572
+ if (i === 0) {
252
573
  ctx.moveTo(Math.cos(a) * r, Math.sin(a) * r);
253
- else
574
+ }
575
+ else {
254
576
  ctx.lineTo(Math.cos(a) * r, Math.sin(a) * r);
577
+ }
255
578
  }
256
579
  ctx.closePath();
257
580
  break;
258
581
  }
259
- case "heart": {
582
+ case 'heart': {
260
583
  const s = Math.min(hw, hh);
261
584
  ctx.moveTo(0, s * 0.4);
262
585
  ctx.bezierCurveTo(-s, -s * 0.2, -s * 0.6, -s, 0, -s * 0.4);
263
586
  ctx.bezierCurveTo(s * 0.6, -s, s, -s * 0.2, 0, s * 0.4);
264
587
  break;
265
588
  }
266
- case "arrow":
589
+ case 'arrow':
267
590
  ctx.moveTo(-hw, -hh * 0.3);
268
591
  ctx.lineTo(hw * 0.3, -hh * 0.3);
269
592
  ctx.lineTo(hw * 0.3, -hh);
@@ -273,26 +596,28 @@ function drawShapePath(ctx, kind, w, h) {
273
596
  ctx.lineTo(-hw, hh * 0.3);
274
597
  ctx.closePath();
275
598
  break;
276
- case "diamond":
599
+ case 'diamond':
277
600
  ctx.moveTo(0, -hh);
278
601
  ctx.lineTo(hw, 0);
279
602
  ctx.lineTo(0, hh);
280
603
  ctx.lineTo(-hw, 0);
281
604
  ctx.closePath();
282
605
  break;
283
- case "hexagon":
606
+ case 'hexagon':
284
607
  for (let i = 0; i < 6; i++) {
285
608
  const a = (Math.PI * 2 * i) / 6 - Math.PI / 2;
286
609
  const r = Math.min(hw, hh);
287
610
  const px = Math.cos(a) * r, py = Math.sin(a) * r;
288
- if (i === 0)
611
+ if (i === 0) {
289
612
  ctx.moveTo(px, py);
290
- else
613
+ }
614
+ else {
291
615
  ctx.lineTo(px, py);
616
+ }
292
617
  }
293
618
  ctx.closePath();
294
619
  break;
295
- case "cross": {
620
+ case 'cross': {
296
621
  const t = Math.min(hw, hh) * 0.3;
297
622
  ctx.moveTo(-t, -hh);
298
623
  ctx.lineTo(t, -hh);
@@ -309,7 +634,7 @@ function drawShapePath(ctx, kind, w, h) {
309
634
  ctx.closePath();
310
635
  break;
311
636
  }
312
- case "lightning": {
637
+ case 'lightning': {
313
638
  const s = Math.min(hw, hh);
314
639
  ctx.moveTo(-s * 0.1, -s);
315
640
  ctx.lineTo(s * 0.5, -s * 0.1);
@@ -326,13 +651,14 @@ function drawShapePath(ctx, kind, w, h) {
326
651
  // -- Drawing (freehand strokes) ----------------------------------
327
652
  function renderDrawing(ctx, ov, w, h) {
328
653
  for (const stroke of ov.strokes) {
329
- if (stroke.points.length < 2)
654
+ if (stroke.points.length < 2) {
330
655
  continue;
656
+ }
331
657
  ctx.beginPath();
332
658
  ctx.strokeStyle = stroke.color;
333
659
  ctx.lineWidth = stroke.width;
334
- ctx.lineCap = "round";
335
- ctx.lineJoin = "round";
660
+ ctx.lineCap = 'round';
661
+ ctx.lineJoin = 'round';
336
662
  ctx.globalAlpha = stroke.opacity;
337
663
  const [sx, sy] = stroke.points[0];
338
664
  ctx.moveTo(sx * w, sy * h);
@@ -345,14 +671,15 @@ function renderDrawing(ctx, ov, w, h) {
345
671
  }
346
672
  // -- Canvas stroke (draw a live, in-progress stroke) -------------
347
673
  function renderLiveStroke(ctx, points, color, width, canvasW, canvasH) {
348
- if (points.length < 2)
674
+ if (points.length < 2) {
349
675
  return;
676
+ }
350
677
  ctx.save();
351
678
  ctx.beginPath();
352
679
  ctx.strokeStyle = color;
353
680
  ctx.lineWidth = width;
354
- ctx.lineCap = "round";
355
- ctx.lineJoin = "round";
681
+ ctx.lineCap = 'round';
682
+ ctx.lineJoin = 'round';
356
683
  ctx.moveTo(points[0][0] * canvasW, points[0][1] * canvasH);
357
684
  for (let i = 1; i < points.length; i++) {
358
685
  ctx.lineTo(points[i][0] * canvasW, points[i][1] * canvasH);
@@ -366,33 +693,33 @@ function renderFrame(ctx, ov, w, h) {
366
693
  ctx.strokeStyle = ov.color;
367
694
  ctx.fillStyle = ov.color;
368
695
  switch (ov.frameStyle) {
369
- case "simple":
696
+ case 'simple':
370
697
  ctx.lineWidth = t;
371
698
  ctx.strokeRect(t / 2, t / 2, w - t, h - t);
372
699
  break;
373
- case "double":
700
+ case 'double':
374
701
  ctx.lineWidth = t * 0.3;
375
702
  ctx.strokeRect(t * 0.15, t * 0.15, w - t * 0.3, h - t * 0.3);
376
703
  ctx.strokeRect(t * 0.7, t * 0.7, w - t * 1.4, h - t * 1.4);
377
704
  break;
378
- case "rounded":
705
+ case 'rounded':
379
706
  ctx.lineWidth = t;
380
707
  roundRect(ctx, t / 2, t / 2, w - t, h - t, t * 2);
381
708
  ctx.stroke();
382
709
  break;
383
- case "polaroid":
710
+ case 'polaroid':
384
711
  ctx.fillRect(0, 0, w, t);
385
712
  ctx.fillRect(0, 0, t, h);
386
713
  ctx.fillRect(w - t, 0, t, h);
387
714
  ctx.fillRect(0, h - t * 3, w, t * 3);
388
715
  break;
389
- case "film": {
716
+ case 'film': {
390
717
  ctx.fillRect(0, 0, w, t);
391
718
  ctx.fillRect(0, h - t, w, t);
392
719
  const holeW = t * 0.5, holeH = t * 0.7;
393
720
  const count = Math.floor(w / (t * 1.5)) || 1;
394
721
  const spacing = w / (count + 1);
395
- ctx.fillStyle = "#111";
722
+ ctx.fillStyle = '#111';
396
723
  for (let i = 1; i <= count; i++) {
397
724
  const cx = spacing * i;
398
725
  roundRect(ctx, cx - holeW / 2, (t - holeH) / 2, holeW, holeH, 2);
@@ -402,14 +729,19 @@ function renderFrame(ctx, ov, w, h) {
402
729
  }
403
730
  break;
404
731
  }
405
- case "vintage": {
732
+ case 'vintage': {
406
733
  ctx.lineWidth = t * 0.5;
407
734
  ctx.strokeRect(t * 0.25, t * 0.25, w - t * 0.5, h - t * 0.5);
408
735
  ctx.lineWidth = 1;
409
- ctx.strokeStyle = ov.color + "88";
736
+ ctx.strokeStyle = ov.color + '88';
410
737
  ctx.strokeRect(t, t, w - t * 2, h - t * 2);
411
738
  const os = t * 0.8;
412
- for (const [dx, dy] of [[0, 0], [w - os, 0], [0, h - os], [w - os, h - os]]) {
739
+ for (const [dx, dy] of [
740
+ [0, 0],
741
+ [w - os, 0],
742
+ [0, h - os],
743
+ [w - os, h - os],
744
+ ]) {
413
745
  ctx.beginPath();
414
746
  ctx.moveTo(dx + os * 0.2, dy + os * 0.2);
415
747
  ctx.lineTo(dx + os * 0.8, dy + os * 0.2);
@@ -422,13 +754,16 @@ function renderFrame(ctx, ov, w, h) {
422
754
  }
423
755
  break;
424
756
  }
425
- case "ornate": {
757
+ case 'ornate': {
426
758
  ctx.lineWidth = t * 0.4;
427
759
  ctx.strokeRect(t * 0.2, t * 0.2, w - t * 0.4, h - t * 0.4);
428
760
  const cs = t * 1.5;
429
761
  ctx.lineWidth = 2;
430
762
  for (const [ox, oy, sx, sy] of [
431
- [0, 0, 1, 1], [w, 0, -1, 1], [0, h, 1, -1], [w, h, -1, -1],
763
+ [0, 0, 1, 1],
764
+ [w, 0, -1, 1],
765
+ [0, h, 1, -1],
766
+ [w, h, -1, -1],
432
767
  ]) {
433
768
  ctx.save();
434
769
  ctx.translate(ox, oy);
@@ -444,61 +779,65 @@ function renderFrame(ctx, ov, w, h) {
444
779
  }
445
780
  break;
446
781
  }
447
- case "shadow":
448
- ctx.shadowColor = "rgba(0,0,0,0.5)";
782
+ case 'shadow':
783
+ ctx.shadowColor = 'rgba(0,0,0,0.5)';
449
784
  ctx.shadowBlur = t * 2;
450
785
  ctx.shadowOffsetX = t * 0.5;
451
786
  ctx.shadowOffsetY = t * 0.5;
452
787
  ctx.lineWidth = t * 0.3;
453
788
  ctx.strokeRect(t, t, w - t * 2, h - t * 2);
454
- ctx.shadowColor = "transparent";
789
+ ctx.shadowColor = 'transparent';
455
790
  break;
456
- case "neon":
791
+ case 'neon':
457
792
  for (let i = 3; i >= 0; i--) {
458
793
  ctx.shadowColor = ov.color;
459
794
  ctx.shadowBlur = t * (i + 1) * 2;
460
795
  ctx.lineWidth = t * 0.2;
461
- ctx.strokeStyle = i === 0 ? "#fff" : ov.color;
796
+ ctx.strokeStyle = i === 0 ? '#fff' : ov.color;
462
797
  ctx.globalAlpha = i === 0 ? ov.opacity : 0.3 * ov.opacity;
463
798
  ctx.strokeRect(t, t, w - t * 2, h - t * 2);
464
799
  }
465
- ctx.shadowColor = "transparent";
800
+ ctx.shadowColor = 'transparent';
466
801
  break;
467
- case "torn": {
802
+ case 'torn': {
468
803
  const step = 8;
469
804
  const seed = (i) => {
470
805
  const x = Math.sin(i * 127.1 + 311.7) * 43758.5453;
471
- return (x - Math.floor(x)) - 0.5;
806
+ return x - Math.floor(x) - 0.5;
472
807
  };
473
808
  // Top
474
809
  ctx.beginPath();
475
810
  ctx.moveTo(0, 0);
476
- for (let i = 0, x = 0; x <= w; x += step, i++)
811
+ for (let i = 0, x = 0; x <= w; x += step, i++) {
477
812
  ctx.lineTo(x, t + seed(i) * t * 0.8);
813
+ }
478
814
  ctx.lineTo(w, 0);
479
815
  ctx.closePath();
480
816
  ctx.fill();
481
817
  // Bottom
482
818
  ctx.beginPath();
483
819
  ctx.moveTo(0, h);
484
- for (let i = 0, x = 0; x <= w; x += step, i++)
820
+ for (let i = 0, x = 0; x <= w; x += step, i++) {
485
821
  ctx.lineTo(x, h - t - seed(i + 1000) * t * 0.8);
822
+ }
486
823
  ctx.lineTo(w, h);
487
824
  ctx.closePath();
488
825
  ctx.fill();
489
826
  // Left
490
827
  ctx.beginPath();
491
828
  ctx.moveTo(0, 0);
492
- for (let i = 0, y = 0; y <= h; y += step, i++)
829
+ for (let i = 0, y = 0; y <= h; y += step, i++) {
493
830
  ctx.lineTo(t + seed(i + 2000) * t * 0.8, y);
831
+ }
494
832
  ctx.lineTo(0, h);
495
833
  ctx.closePath();
496
834
  ctx.fill();
497
835
  // Right
498
836
  ctx.beginPath();
499
837
  ctx.moveTo(w, 0);
500
- for (let i = 0, y = 0; y <= h; y += step, i++)
838
+ for (let i = 0, y = 0; y <= h; y += step, i++) {
501
839
  ctx.lineTo(w - t - seed(i + 3000) * t * 0.8, y);
840
+ }
502
841
  ctx.lineTo(w, h);
503
842
  ctx.closePath();
504
843
  ctx.fill();
@@ -527,19 +866,20 @@ function roundRect(ctx, x, y, w, h, r) {
527
866
  * hits the bounding box of the overlay (ignoring rotation).
528
867
  */
529
868
  function hitTestOverlay(ov, px, py, _w, _h) {
530
- if (ov.type === "drawing" || ov.type === "frame")
869
+ if (ov.type === 'drawing' || ov.type === 'frame') {
531
870
  return false;
871
+ }
532
872
  let hitW, hitH;
533
873
  switch (ov.type) {
534
- case "emoji":
874
+ case 'emoji':
535
875
  hitW = hitH = (ov.fontSize * ov.scaleX) / _w;
536
876
  break;
537
- case "text": {
877
+ case 'text': {
538
878
  hitW = (ov.text.length * ov.fontSize * 0.55 * ov.scaleX) / _w;
539
879
  hitH = (ov.fontSize * 1.3 * ov.scaleY) / _h;
540
880
  break;
541
881
  }
542
- case "shape":
882
+ case 'shape':
543
883
  hitW = (ov.width * ov.scaleX) / _w;
544
884
  hitH = (ov.height * ov.scaleY) / _h;
545
885
  break;
@@ -555,28 +895,34 @@ function hitTestOverlay(ov, px, py, _w, _h) {
555
895
  function createEmojiOverlay(emoji, canvasW, canvasH) {
556
896
  return {
557
897
  id: generateOverlayId(),
558
- type: "emoji",
559
- x: 0.5, y: 0.5,
560
- scaleX: 1, scaleY: 1,
561
- rotation: 0, opacity: 1,
898
+ type: 'emoji',
899
+ x: 0.5,
900
+ y: 0.5,
901
+ scaleX: 1,
902
+ scaleY: 1,
903
+ rotation: 0,
904
+ opacity: 1,
562
905
  emoji,
563
906
  fontSize: Math.round(Math.min(canvasW, canvasH) * 0.08),
564
907
  };
565
908
  }
566
- function createTextOverlay(text = "Tekst") {
909
+ function createTextOverlay(text = 'Tekst') {
567
910
  return {
568
911
  id: generateOverlayId(),
569
- type: "text",
570
- x: 0.5, y: 0.5,
571
- scaleX: 1, scaleY: 1,
572
- rotation: 0, opacity: 1,
912
+ type: 'text',
913
+ x: 0.5,
914
+ y: 0.5,
915
+ scaleX: 1,
916
+ scaleY: 1,
917
+ rotation: 0,
918
+ opacity: 1,
573
919
  text,
574
- fontFamily: "Arial",
920
+ fontFamily: 'Arial',
575
921
  fontSize: 36,
576
- color: "#ffffff",
922
+ color: '#ffffff',
577
923
  bold: true,
578
924
  italic: false,
579
- outlineColor: "#000000",
925
+ outlineColor: '#000000',
580
926
  outlineWidth: 2,
581
927
  shadow: null,
582
928
  background: null,
@@ -586,34 +932,44 @@ function createTextOverlay(text = "Tekst") {
586
932
  function createShapeOverlay(kind) {
587
933
  return {
588
934
  id: generateOverlayId(),
589
- type: "shape",
590
- x: 0.5, y: 0.5,
591
- scaleX: 1, scaleY: 1,
592
- rotation: 0, opacity: 1,
935
+ type: 'shape',
936
+ x: 0.5,
937
+ y: 0.5,
938
+ scaleX: 1,
939
+ scaleY: 1,
940
+ rotation: 0,
941
+ opacity: 1,
593
942
  shapeKind: kind,
594
- width: 100, height: 100,
943
+ width: 100,
944
+ height: 100,
595
945
  fillColor: null,
596
- strokeColor: "#ffffff",
946
+ strokeColor: '#ffffff',
597
947
  strokeWidth: 3,
598
948
  };
599
949
  }
600
950
  function createDrawingOverlay() {
601
951
  return {
602
952
  id: generateOverlayId(),
603
- type: "drawing",
604
- x: 0, y: 0,
605
- scaleX: 1, scaleY: 1,
606
- rotation: 0, opacity: 1,
953
+ type: 'drawing',
954
+ x: 0,
955
+ y: 0,
956
+ scaleX: 1,
957
+ scaleY: 1,
958
+ rotation: 0,
959
+ opacity: 1,
607
960
  strokes: [],
608
961
  };
609
962
  }
610
- function createFrameOverlay(style, color = "#ffffff") {
963
+ function createFrameOverlay(style, color = '#ffffff') {
611
964
  return {
612
965
  id: generateOverlayId(),
613
- type: "frame",
614
- x: 0, y: 0,
615
- scaleX: 1, scaleY: 1,
616
- rotation: 0, opacity: 1,
966
+ type: 'frame',
967
+ x: 0,
968
+ y: 0,
969
+ scaleX: 1,
970
+ scaleY: 1,
971
+ rotation: 0,
972
+ opacity: 1,
617
973
  frameStyle: style,
618
974
  color,
619
975
  thickness: 0.03,