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