@nice2dev/ui-graphics 1.0.0

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 (511) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/LICENSE +21 -0
  3. package/README.md +339 -0
  4. package/dist/cjs/animation/AnimatedPerson.js +153 -0
  5. package/dist/cjs/animation/AnimatedPerson.js.map +1 -0
  6. package/dist/cjs/animation/AnimationEditor.js +106 -0
  7. package/dist/cjs/animation/AnimationEditor.js.map +1 -0
  8. package/dist/cjs/animation/Audience.js +59 -0
  9. package/dist/cjs/animation/Audience.js.map +1 -0
  10. package/dist/cjs/animation/BodyRenderer.js +33 -0
  11. package/dist/cjs/animation/BodyRenderer.js.map +1 -0
  12. package/dist/cjs/animation/animationHelper.js +272 -0
  13. package/dist/cjs/animation/animationHelper.js.map +1 -0
  14. package/dist/cjs/animation/characterTypes.js +75 -0
  15. package/dist/cjs/animation/characterTypes.js.map +1 -0
  16. package/dist/cjs/animation/choreoDSL.js +190 -0
  17. package/dist/cjs/animation/choreoDSL.js.map +1 -0
  18. package/dist/cjs/animation/choreography.js +41 -0
  19. package/dist/cjs/animation/choreography.js.map +1 -0
  20. package/dist/cjs/animation/karaokeIntegration.js +98 -0
  21. package/dist/cjs/animation/karaokeIntegration.js.map +1 -0
  22. package/dist/cjs/animation/lottieExport.js +128 -0
  23. package/dist/cjs/animation/lottieExport.js.map +1 -0
  24. package/dist/cjs/animation/motionPath.js +196 -0
  25. package/dist/cjs/animation/motionPath.js.map +1 -0
  26. package/dist/cjs/animation/physics.js +201 -0
  27. package/dist/cjs/animation/physics.js.map +1 -0
  28. package/dist/cjs/animation/rig/RigPlayer.js +63 -0
  29. package/dist/cjs/animation/rig/RigPlayer.js.map +1 -0
  30. package/dist/cjs/animation/rig/RiggedBody.js +30 -0
  31. package/dist/cjs/animation/rig/RiggedBody.js.map +1 -0
  32. package/dist/cjs/animation/rig/choreoRigBridge.js +63 -0
  33. package/dist/cjs/animation/rig/choreoRigBridge.js.map +1 -0
  34. package/dist/cjs/animation/rig/ik.js +22 -0
  35. package/dist/cjs/animation/rig/ik.js.map +1 -0
  36. package/dist/cjs/animation/rig/poseOps.js +49 -0
  37. package/dist/cjs/animation/rig/poseOps.js.map +1 -0
  38. package/dist/cjs/animation/rig/presets.js +60 -0
  39. package/dist/cjs/animation/rig/presets.js.map +1 -0
  40. package/dist/cjs/animation/rig/rigMath.js +41 -0
  41. package/dist/cjs/animation/rig/rigMath.js.map +1 -0
  42. package/dist/cjs/animation/rig/rigTypes.js +44 -0
  43. package/dist/cjs/animation/rig/rigTypes.js.map +1 -0
  44. package/dist/cjs/animation/shapes/arms.js +15 -0
  45. package/dist/cjs/animation/shapes/arms.js.map +1 -0
  46. package/dist/cjs/animation/shapes/eyes.js +52 -0
  47. package/dist/cjs/animation/shapes/eyes.js.map +1 -0
  48. package/dist/cjs/animation/shapes/hair.js +55 -0
  49. package/dist/cjs/animation/shapes/hair.js.map +1 -0
  50. package/dist/cjs/animation/shapes/heads.js +62 -0
  51. package/dist/cjs/animation/shapes/heads.js.map +1 -0
  52. package/dist/cjs/animation/shapes/headwear.js +44 -0
  53. package/dist/cjs/animation/shapes/headwear.js.map +1 -0
  54. package/dist/cjs/animation/shapes/legs.js +15 -0
  55. package/dist/cjs/animation/shapes/legs.js.map +1 -0
  56. package/dist/cjs/animation/shapes/mouths.js +53 -0
  57. package/dist/cjs/animation/shapes/mouths.js.map +1 -0
  58. package/dist/cjs/animation/shapes/noses.js +31 -0
  59. package/dist/cjs/animation/shapes/noses.js.map +1 -0
  60. package/dist/cjs/animation/shapes/outfits.js +43 -0
  61. package/dist/cjs/animation/shapes/outfits.js.map +1 -0
  62. package/dist/cjs/animation/shapes/torsos.js +13 -0
  63. package/dist/cjs/animation/shapes/torsos.js.map +1 -0
  64. package/dist/cjs/animation/spineExport.js +132 -0
  65. package/dist/cjs/animation/spineExport.js.map +1 -0
  66. package/dist/cjs/core/LocalUI.js +54 -0
  67. package/dist/cjs/core/LocalUI.js.map +1 -0
  68. package/dist/cjs/core/collaboration.js +259 -0
  69. package/dist/cjs/core/collaboration.js.map +1 -0
  70. package/dist/cjs/core/colorBlindness.js +97 -0
  71. package/dist/cjs/core/colorBlindness.js.map +1 -0
  72. package/dist/cjs/core/dragDrop.js +168 -0
  73. package/dist/cjs/core/dragDrop.js.map +1 -0
  74. package/dist/cjs/core/fixes.js +185 -0
  75. package/dist/cjs/core/fixes.js.map +1 -0
  76. package/dist/cjs/core/gridGuides.js +245 -0
  77. package/dist/cjs/core/gridGuides.js.map +1 -0
  78. package/dist/cjs/core/historyVisual.js +124 -0
  79. package/dist/cjs/core/historyVisual.js.map +1 -0
  80. package/dist/cjs/core/i18n.js +16 -0
  81. package/dist/cjs/core/i18n.js.map +1 -0
  82. package/dist/cjs/core/integrations.js +261 -0
  83. package/dist/cjs/core/integrations.js.map +1 -0
  84. package/dist/cjs/core/minimap.js +142 -0
  85. package/dist/cjs/core/minimap.js.map +1 -0
  86. package/dist/cjs/core/plugins.js +129 -0
  87. package/dist/cjs/core/plugins.js.map +1 -0
  88. package/dist/cjs/core/rtl.js +102 -0
  89. package/dist/cjs/core/rtl.js.map +1 -0
  90. package/dist/cjs/core/shortcuts.js +205 -0
  91. package/dist/cjs/core/shortcuts.js.map +1 -0
  92. package/dist/cjs/core/theme.js +171 -0
  93. package/dist/cjs/core/theme.js.map +1 -0
  94. package/dist/cjs/font/NiceFontEditor.js +193 -0
  95. package/dist/cjs/font/NiceFontEditor.js.map +1 -0
  96. package/dist/cjs/game/GameAsset2dEditor.js +371 -0
  97. package/dist/cjs/game/GameAsset2dEditor.js.map +1 -0
  98. package/dist/cjs/game/GameAsset2dEditor.module.css.js +6 -0
  99. package/dist/cjs/game/GameAsset2dEditor.module.css.js.map +1 -0
  100. package/dist/cjs/game/gameAssetTypes.js +20 -0
  101. package/dist/cjs/game/gameAssetTypes.js.map +1 -0
  102. package/dist/cjs/game/gameAssetUtils.js +475 -0
  103. package/dist/cjs/game/gameAssetUtils.js.map +1 -0
  104. package/dist/cjs/game/useGameAssetEditor.js +761 -0
  105. package/dist/cjs/game/useGameAssetEditor.js.map +1 -0
  106. package/dist/cjs/icon/NiceIconEditor.js +249 -0
  107. package/dist/cjs/icon/NiceIconEditor.js.map +1 -0
  108. package/dist/cjs/index.js +264 -0
  109. package/dist/cjs/index.js.map +1 -0
  110. package/dist/cjs/nice2dev-ui/dist/index.js +32070 -0
  111. package/dist/cjs/nice2dev-ui/dist/index.js.map +1 -0
  112. package/dist/cjs/nice2dev-ui-graphics.css +1 -0
  113. package/dist/cjs/photo/FilterThumb.js +29 -0
  114. package/dist/cjs/photo/FilterThumb.js.map +1 -0
  115. package/dist/cjs/photo/PhotoEditor.js +20 -0
  116. package/dist/cjs/photo/PhotoEditor.js.map +1 -0
  117. package/dist/cjs/photo/PhotoEditor.module.css.js +6 -0
  118. package/dist/cjs/photo/PhotoEditor.module.css.js.map +1 -0
  119. package/dist/cjs/photo/PhotoEditorCanvas.js +59 -0
  120. package/dist/cjs/photo/PhotoEditorCanvas.js.map +1 -0
  121. package/dist/cjs/photo/PhotoEditorLeftPanel.js +174 -0
  122. package/dist/cjs/photo/PhotoEditorLeftPanel.js.map +1 -0
  123. package/dist/cjs/photo/PhotoEditorToolbar.js +15 -0
  124. package/dist/cjs/photo/PhotoEditorToolbar.js.map +1 -0
  125. package/dist/cjs/photo/photoEditorActions.js +80 -0
  126. package/dist/cjs/photo/photoEditorActions.js.map +1 -0
  127. package/dist/cjs/photo/photoEditorTypes.js +40 -0
  128. package/dist/cjs/photo/photoEditorTypes.js.map +1 -0
  129. package/dist/cjs/photo/photoFilters.js +880 -0
  130. package/dist/cjs/photo/photoFilters.js.map +1 -0
  131. package/dist/cjs/photo/photoOverlays.js +651 -0
  132. package/dist/cjs/photo/photoOverlays.js.map +1 -0
  133. package/dist/cjs/photo/photoSelection.js +547 -0
  134. package/dist/cjs/photo/photoSelection.js.map +1 -0
  135. package/dist/cjs/photo/usePhotoEditor.js +640 -0
  136. package/dist/cjs/photo/usePhotoEditor.js.map +1 -0
  137. package/dist/cjs/pixel/HSVPicker.js +173 -0
  138. package/dist/cjs/pixel/HSVPicker.js.map +1 -0
  139. package/dist/cjs/pixel/PixelEditor.js +28 -0
  140. package/dist/cjs/pixel/PixelEditor.js.map +1 -0
  141. package/dist/cjs/pixel/PixelEditor.module.css.js +6 -0
  142. package/dist/cjs/pixel/PixelEditor.module.css.js.map +1 -0
  143. package/dist/cjs/pixel/PixelEditorCanvas.js +15 -0
  144. package/dist/cjs/pixel/PixelEditorCanvas.js.map +1 -0
  145. package/dist/cjs/pixel/PixelEditorMenuBar.js +11 -0
  146. package/dist/cjs/pixel/PixelEditorMenuBar.js.map +1 -0
  147. package/dist/cjs/pixel/PixelEditorRightPanel.js +15 -0
  148. package/dist/cjs/pixel/PixelEditorRightPanel.js.map +1 -0
  149. package/dist/cjs/pixel/PixelEditorStatusBar.js +15 -0
  150. package/dist/cjs/pixel/PixelEditorStatusBar.js.map +1 -0
  151. package/dist/cjs/pixel/PixelEditorTimeline.js +11 -0
  152. package/dist/cjs/pixel/PixelEditorTimeline.js.map +1 -0
  153. package/dist/cjs/pixel/PixelEditorToolbar.js +16 -0
  154. package/dist/cjs/pixel/PixelEditorToolbar.js.map +1 -0
  155. package/dist/cjs/pixel/asepriteFormat.js +512 -0
  156. package/dist/cjs/pixel/asepriteFormat.js.map +1 -0
  157. package/dist/cjs/pixel/pixelEditorExports.js +471 -0
  158. package/dist/cjs/pixel/pixelEditorExports.js.map +1 -0
  159. package/dist/cjs/pixel/pixelEditorTypes.js +102 -0
  160. package/dist/cjs/pixel/pixelEditorTypes.js.map +1 -0
  161. package/dist/cjs/pixel/pixelEditorUtils.js +664 -0
  162. package/dist/cjs/pixel/pixelEditorUtils.js.map +1 -0
  163. package/dist/cjs/pixel/usePixelEditor.js +1112 -0
  164. package/dist/cjs/pixel/usePixelEditor.js.map +1 -0
  165. package/dist/cjs/texture/Nice3DTexturePainter.js +236 -0
  166. package/dist/cjs/texture/Nice3DTexturePainter.js.map +1 -0
  167. package/dist/cjs/ui/NiceUIDesigner.js +191 -0
  168. package/dist/cjs/ui/NiceUIDesigner.js.map +1 -0
  169. package/dist/cjs/vector/VectorEditor.js +31 -0
  170. package/dist/cjs/vector/VectorEditor.js.map +1 -0
  171. package/dist/cjs/vector/VectorEditor.module.css.js +6 -0
  172. package/dist/cjs/vector/VectorEditor.module.css.js.map +1 -0
  173. package/dist/cjs/vector/VectorEditorMenuBar.js +16 -0
  174. package/dist/cjs/vector/VectorEditorMenuBar.js.map +1 -0
  175. package/dist/cjs/vector/VectorEditorRightPanel.js +126 -0
  176. package/dist/cjs/vector/VectorEditorRightPanel.js.map +1 -0
  177. package/dist/cjs/vector/VectorEditorShapeRenderer.js +55 -0
  178. package/dist/cjs/vector/VectorEditorShapeRenderer.js.map +1 -0
  179. package/dist/cjs/vector/VectorEditorStatusBar.js +14 -0
  180. package/dist/cjs/vector/VectorEditorStatusBar.js.map +1 -0
  181. package/dist/cjs/vector/useVectorEditor.js +613 -0
  182. package/dist/cjs/vector/useVectorEditor.js.map +1 -0
  183. package/dist/cjs/vector/vectorBooleanOps.js +511 -0
  184. package/dist/cjs/vector/vectorBooleanOps.js.map +1 -0
  185. package/dist/cjs/vector/vectorEditorExport.js +159 -0
  186. package/dist/cjs/vector/vectorEditorExport.js.map +1 -0
  187. package/dist/cjs/vector/vectorEditorImport.js +150 -0
  188. package/dist/cjs/vector/vectorEditorImport.js.map +1 -0
  189. package/dist/cjs/vector/vectorEditorTypes.js +72 -0
  190. package/dist/cjs/vector/vectorEditorTypes.js.map +1 -0
  191. package/dist/cjs/vector/vectorGradients.js +201 -0
  192. package/dist/cjs/vector/vectorGradients.js.map +1 -0
  193. package/dist/esm/animation/AnimatedPerson.js +151 -0
  194. package/dist/esm/animation/AnimatedPerson.js.map +1 -0
  195. package/dist/esm/animation/AnimationEditor.js +104 -0
  196. package/dist/esm/animation/AnimationEditor.js.map +1 -0
  197. package/dist/esm/animation/Audience.js +57 -0
  198. package/dist/esm/animation/Audience.js.map +1 -0
  199. package/dist/esm/animation/BodyRenderer.js +28 -0
  200. package/dist/esm/animation/BodyRenderer.js.map +1 -0
  201. package/dist/esm/animation/animationHelper.js +268 -0
  202. package/dist/esm/animation/animationHelper.js.map +1 -0
  203. package/dist/esm/animation/characterTypes.js +70 -0
  204. package/dist/esm/animation/characterTypes.js.map +1 -0
  205. package/dist/esm/animation/choreoDSL.js +182 -0
  206. package/dist/esm/animation/choreoDSL.js.map +1 -0
  207. package/dist/esm/animation/choreography.js +36 -0
  208. package/dist/esm/animation/choreography.js.map +1 -0
  209. package/dist/esm/animation/karaokeIntegration.js +91 -0
  210. package/dist/esm/animation/karaokeIntegration.js.map +1 -0
  211. package/dist/esm/animation/lottieExport.js +123 -0
  212. package/dist/esm/animation/lottieExport.js.map +1 -0
  213. package/dist/esm/animation/motionPath.js +185 -0
  214. package/dist/esm/animation/motionPath.js.map +1 -0
  215. package/dist/esm/animation/physics.js +192 -0
  216. package/dist/esm/animation/physics.js.map +1 -0
  217. package/dist/esm/animation/rig/RigPlayer.js +61 -0
  218. package/dist/esm/animation/rig/RigPlayer.js.map +1 -0
  219. package/dist/esm/animation/rig/RiggedBody.js +28 -0
  220. package/dist/esm/animation/rig/RiggedBody.js.map +1 -0
  221. package/dist/esm/animation/rig/choreoRigBridge.js +60 -0
  222. package/dist/esm/animation/rig/choreoRigBridge.js.map +1 -0
  223. package/dist/esm/animation/rig/ik.js +20 -0
  224. package/dist/esm/animation/rig/ik.js.map +1 -0
  225. package/dist/esm/animation/rig/poseOps.js +45 -0
  226. package/dist/esm/animation/rig/poseOps.js.map +1 -0
  227. package/dist/esm/animation/rig/presets.js +53 -0
  228. package/dist/esm/animation/rig/presets.js.map +1 -0
  229. package/dist/esm/animation/rig/rigMath.js +37 -0
  230. package/dist/esm/animation/rig/rigMath.js.map +1 -0
  231. package/dist/esm/animation/rig/rigTypes.js +40 -0
  232. package/dist/esm/animation/rig/rigTypes.js.map +1 -0
  233. package/dist/esm/animation/shapes/arms.js +13 -0
  234. package/dist/esm/animation/shapes/arms.js.map +1 -0
  235. package/dist/esm/animation/shapes/eyes.js +45 -0
  236. package/dist/esm/animation/shapes/eyes.js.map +1 -0
  237. package/dist/esm/animation/shapes/hair.js +46 -0
  238. package/dist/esm/animation/shapes/hair.js.map +1 -0
  239. package/dist/esm/animation/shapes/heads.js +52 -0
  240. package/dist/esm/animation/shapes/heads.js.map +1 -0
  241. package/dist/esm/animation/shapes/headwear.js +36 -0
  242. package/dist/esm/animation/shapes/headwear.js.map +1 -0
  243. package/dist/esm/animation/shapes/legs.js +13 -0
  244. package/dist/esm/animation/shapes/legs.js.map +1 -0
  245. package/dist/esm/animation/shapes/mouths.js +45 -0
  246. package/dist/esm/animation/shapes/mouths.js.map +1 -0
  247. package/dist/esm/animation/shapes/noses.js +23 -0
  248. package/dist/esm/animation/shapes/noses.js.map +1 -0
  249. package/dist/esm/animation/shapes/outfits.js +37 -0
  250. package/dist/esm/animation/shapes/outfits.js.map +1 -0
  251. package/dist/esm/animation/shapes/torsos.js +11 -0
  252. package/dist/esm/animation/shapes/torsos.js.map +1 -0
  253. package/dist/esm/animation/spineExport.js +128 -0
  254. package/dist/esm/animation/spineExport.js.map +1 -0
  255. package/dist/esm/core/LocalUI.js +50 -0
  256. package/dist/esm/core/LocalUI.js.map +1 -0
  257. package/dist/esm/core/collaboration.js +252 -0
  258. package/dist/esm/core/collaboration.js.map +1 -0
  259. package/dist/esm/core/colorBlindness.js +90 -0
  260. package/dist/esm/core/colorBlindness.js.map +1 -0
  261. package/dist/esm/core/dragDrop.js +165 -0
  262. package/dist/esm/core/dragDrop.js.map +1 -0
  263. package/dist/esm/core/fixes.js +179 -0
  264. package/dist/esm/core/fixes.js.map +1 -0
  265. package/dist/esm/core/gridGuides.js +232 -0
  266. package/dist/esm/core/gridGuides.js.map +1 -0
  267. package/dist/esm/core/historyVisual.js +121 -0
  268. package/dist/esm/core/historyVisual.js.map +1 -0
  269. package/dist/esm/core/i18n.js +13 -0
  270. package/dist/esm/core/i18n.js.map +1 -0
  271. package/dist/esm/core/integrations.js +254 -0
  272. package/dist/esm/core/integrations.js.map +1 -0
  273. package/dist/esm/core/minimap.js +139 -0
  274. package/dist/esm/core/minimap.js.map +1 -0
  275. package/dist/esm/core/plugins.js +124 -0
  276. package/dist/esm/core/plugins.js.map +1 -0
  277. package/dist/esm/core/rtl.js +95 -0
  278. package/dist/esm/core/rtl.js.map +1 -0
  279. package/dist/esm/core/shortcuts.js +200 -0
  280. package/dist/esm/core/shortcuts.js.map +1 -0
  281. package/dist/esm/core/theme.js +162 -0
  282. package/dist/esm/core/theme.js.map +1 -0
  283. package/dist/esm/font/NiceFontEditor.js +189 -0
  284. package/dist/esm/font/NiceFontEditor.js.map +1 -0
  285. package/dist/esm/game/GameAsset2dEditor.js +369 -0
  286. package/dist/esm/game/GameAsset2dEditor.js.map +1 -0
  287. package/dist/esm/game/GameAsset2dEditor.module.css.js +4 -0
  288. package/dist/esm/game/GameAsset2dEditor.module.css.js.map +1 -0
  289. package/dist/esm/game/gameAssetTypes.js +18 -0
  290. package/dist/esm/game/gameAssetTypes.js.map +1 -0
  291. package/dist/esm/game/gameAssetUtils.js +456 -0
  292. package/dist/esm/game/gameAssetUtils.js.map +1 -0
  293. package/dist/esm/game/useGameAssetEditor.js +759 -0
  294. package/dist/esm/game/useGameAssetEditor.js.map +1 -0
  295. package/dist/esm/icon/NiceIconEditor.js +246 -0
  296. package/dist/esm/icon/NiceIconEditor.js.map +1 -0
  297. package/dist/esm/index.js +59 -0
  298. package/dist/esm/index.js.map +1 -0
  299. package/dist/esm/nice2dev-ui/dist/index.js +31720 -0
  300. package/dist/esm/nice2dev-ui/dist/index.js.map +1 -0
  301. package/dist/esm/nice2dev-ui-graphics.css +1 -0
  302. package/dist/esm/photo/FilterThumb.js +27 -0
  303. package/dist/esm/photo/FilterThumb.js.map +1 -0
  304. package/dist/esm/photo/PhotoEditor.js +18 -0
  305. package/dist/esm/photo/PhotoEditor.js.map +1 -0
  306. package/dist/esm/photo/PhotoEditor.module.css.js +4 -0
  307. package/dist/esm/photo/PhotoEditor.module.css.js.map +1 -0
  308. package/dist/esm/photo/PhotoEditorCanvas.js +57 -0
  309. package/dist/esm/photo/PhotoEditorCanvas.js.map +1 -0
  310. package/dist/esm/photo/PhotoEditorLeftPanel.js +172 -0
  311. package/dist/esm/photo/PhotoEditorLeftPanel.js.map +1 -0
  312. package/dist/esm/photo/PhotoEditorToolbar.js +13 -0
  313. package/dist/esm/photo/PhotoEditorToolbar.js.map +1 -0
  314. package/dist/esm/photo/photoEditorActions.js +75 -0
  315. package/dist/esm/photo/photoEditorActions.js.map +1 -0
  316. package/dist/esm/photo/photoEditorTypes.js +36 -0
  317. package/dist/esm/photo/photoEditorTypes.js.map +1 -0
  318. package/dist/esm/photo/photoFilters.js +871 -0
  319. package/dist/esm/photo/photoFilters.js.map +1 -0
  320. package/dist/esm/photo/photoOverlays.js +636 -0
  321. package/dist/esm/photo/photoOverlays.js.map +1 -0
  322. package/dist/esm/photo/photoSelection.js +535 -0
  323. package/dist/esm/photo/photoSelection.js.map +1 -0
  324. package/dist/esm/photo/usePhotoEditor.js +638 -0
  325. package/dist/esm/photo/usePhotoEditor.js.map +1 -0
  326. package/dist/esm/pixel/HSVPicker.js +171 -0
  327. package/dist/esm/pixel/HSVPicker.js.map +1 -0
  328. package/dist/esm/pixel/PixelEditor.js +26 -0
  329. package/dist/esm/pixel/PixelEditor.js.map +1 -0
  330. package/dist/esm/pixel/PixelEditor.module.css.js +4 -0
  331. package/dist/esm/pixel/PixelEditor.module.css.js.map +1 -0
  332. package/dist/esm/pixel/PixelEditorCanvas.js +13 -0
  333. package/dist/esm/pixel/PixelEditorCanvas.js.map +1 -0
  334. package/dist/esm/pixel/PixelEditorMenuBar.js +9 -0
  335. package/dist/esm/pixel/PixelEditorMenuBar.js.map +1 -0
  336. package/dist/esm/pixel/PixelEditorRightPanel.js +13 -0
  337. package/dist/esm/pixel/PixelEditorRightPanel.js.map +1 -0
  338. package/dist/esm/pixel/PixelEditorStatusBar.js +13 -0
  339. package/dist/esm/pixel/PixelEditorStatusBar.js.map +1 -0
  340. package/dist/esm/pixel/PixelEditorTimeline.js +9 -0
  341. package/dist/esm/pixel/PixelEditorTimeline.js.map +1 -0
  342. package/dist/esm/pixel/PixelEditorToolbar.js +14 -0
  343. package/dist/esm/pixel/PixelEditorToolbar.js.map +1 -0
  344. package/dist/esm/pixel/asepriteFormat.js +505 -0
  345. package/dist/esm/pixel/asepriteFormat.js.map +1 -0
  346. package/dist/esm/pixel/pixelEditorExports.js +461 -0
  347. package/dist/esm/pixel/pixelEditorExports.js.map +1 -0
  348. package/dist/esm/pixel/pixelEditorTypes.js +90 -0
  349. package/dist/esm/pixel/pixelEditorTypes.js.map +1 -0
  350. package/dist/esm/pixel/pixelEditorUtils.js +631 -0
  351. package/dist/esm/pixel/pixelEditorUtils.js.map +1 -0
  352. package/dist/esm/pixel/usePixelEditor.js +1110 -0
  353. package/dist/esm/pixel/usePixelEditor.js.map +1 -0
  354. package/dist/esm/texture/Nice3DTexturePainter.js +233 -0
  355. package/dist/esm/texture/Nice3DTexturePainter.js.map +1 -0
  356. package/dist/esm/ui/NiceUIDesigner.js +187 -0
  357. package/dist/esm/ui/NiceUIDesigner.js.map +1 -0
  358. package/dist/esm/vector/VectorEditor.js +29 -0
  359. package/dist/esm/vector/VectorEditor.js.map +1 -0
  360. package/dist/esm/vector/VectorEditor.module.css.js +4 -0
  361. package/dist/esm/vector/VectorEditor.module.css.js.map +1 -0
  362. package/dist/esm/vector/VectorEditorMenuBar.js +14 -0
  363. package/dist/esm/vector/VectorEditorMenuBar.js.map +1 -0
  364. package/dist/esm/vector/VectorEditorRightPanel.js +124 -0
  365. package/dist/esm/vector/VectorEditorRightPanel.js.map +1 -0
  366. package/dist/esm/vector/VectorEditorShapeRenderer.js +53 -0
  367. package/dist/esm/vector/VectorEditorShapeRenderer.js.map +1 -0
  368. package/dist/esm/vector/VectorEditorStatusBar.js +12 -0
  369. package/dist/esm/vector/VectorEditorStatusBar.js.map +1 -0
  370. package/dist/esm/vector/useVectorEditor.js +611 -0
  371. package/dist/esm/vector/useVectorEditor.js.map +1 -0
  372. package/dist/esm/vector/vectorBooleanOps.js +507 -0
  373. package/dist/esm/vector/vectorBooleanOps.js.map +1 -0
  374. package/dist/esm/vector/vectorEditorExport.js +152 -0
  375. package/dist/esm/vector/vectorEditorExport.js.map +1 -0
  376. package/dist/esm/vector/vectorEditorImport.js +148 -0
  377. package/dist/esm/vector/vectorEditorImport.js.map +1 -0
  378. package/dist/esm/vector/vectorEditorTypes.js +63 -0
  379. package/dist/esm/vector/vectorEditorTypes.js.map +1 -0
  380. package/dist/esm/vector/vectorGradients.js +193 -0
  381. package/dist/esm/vector/vectorGradients.js.map +1 -0
  382. package/dist/types/__benchmarks__/bench.d.ts +13 -0
  383. package/dist/types/__tests__/setup.d.ts +4 -0
  384. package/dist/types/animation/AnimatedPerson.d.ts +14 -0
  385. package/dist/types/animation/AnimationEditor.d.ts +20 -0
  386. package/dist/types/animation/Audience.d.ts +11 -0
  387. package/dist/types/animation/BodyRenderer.d.ts +12 -0
  388. package/dist/types/animation/animationHelper.d.ts +28 -0
  389. package/dist/types/animation/characterTypes.d.ts +37 -0
  390. package/dist/types/animation/choreoDSL.d.ts +88 -0
  391. package/dist/types/animation/choreography.d.ts +8 -0
  392. package/dist/types/animation/karaokeIntegration.d.ts +31 -0
  393. package/dist/types/animation/lottieExport.d.ts +77 -0
  394. package/dist/types/animation/motionPath.d.ts +60 -0
  395. package/dist/types/animation/physics.d.ts +73 -0
  396. package/dist/types/animation/rig/RigPlayer.d.ts +32 -0
  397. package/dist/types/animation/rig/RiggedBody.d.ts +19 -0
  398. package/dist/types/animation/rig/choreoRigBridge.d.ts +9 -0
  399. package/dist/types/animation/rig/ik.d.ts +8 -0
  400. package/dist/types/animation/rig/poseOps.d.ts +14 -0
  401. package/dist/types/animation/rig/presets.d.ts +13 -0
  402. package/dist/types/animation/rig/rigMath.d.ts +7 -0
  403. package/dist/types/animation/rig/rigTypes.d.ts +38 -0
  404. package/dist/types/animation/shapes/arms.d.ts +10 -0
  405. package/dist/types/animation/shapes/eyes.d.ts +17 -0
  406. package/dist/types/animation/shapes/hair.d.ts +17 -0
  407. package/dist/types/animation/shapes/heads.d.ts +18 -0
  408. package/dist/types/animation/shapes/headwear.d.ts +16 -0
  409. package/dist/types/animation/shapes/legs.d.ts +10 -0
  410. package/dist/types/animation/shapes/mouths.d.ts +17 -0
  411. package/dist/types/animation/shapes/noses.d.ts +17 -0
  412. package/dist/types/animation/shapes/outfits.d.ts +14 -0
  413. package/dist/types/animation/shapes/torsos.d.ts +9 -0
  414. package/dist/types/animation/spineExport.d.ts +66 -0
  415. package/dist/types/core/LocalUI.d.ts +21 -0
  416. package/dist/types/core/collaboration.d.ts +164 -0
  417. package/dist/types/core/colorBlindness.d.ts +24 -0
  418. package/dist/types/core/dragDrop.d.ts +46 -0
  419. package/dist/types/core/fixes.d.ts +80 -0
  420. package/dist/types/core/gridGuides.d.ts +70 -0
  421. package/dist/types/core/historyVisual.d.ts +915 -0
  422. package/dist/types/core/i18n.d.ts +27 -0
  423. package/dist/types/core/integrations.d.ts +103 -0
  424. package/dist/types/core/minimap.d.ts +49 -0
  425. package/dist/types/core/plugins.d.ts +111 -0
  426. package/dist/types/core/rtl.d.ts +32 -0
  427. package/dist/types/core/shortcuts.d.ts +150 -0
  428. package/dist/types/core/theme.d.ts +78 -0
  429. package/dist/types/core/useGamepad.d.ts +64 -0
  430. package/dist/types/core/usePointerPressure.d.ts +88 -0
  431. package/dist/types/font/NiceFontEditor.d.ts +62 -0
  432. package/dist/types/game/AnimationPreviewPlayer.d.ts +29 -0
  433. package/dist/types/game/CollisionEditor.d.ts +101 -0
  434. package/dist/types/game/GameAsset2dEditor.d.ts +17 -0
  435. package/dist/types/game/GameAssetExportPanel.d.ts +20 -0
  436. package/dist/types/game/IsometricEditor.d.ts +22 -0
  437. package/dist/types/game/IsometricTilePanel.d.ts +18 -0
  438. package/dist/types/game/gameAssetExport.d.ts +160 -0
  439. package/dist/types/game/gameAssetTypes.d.ts +238 -0
  440. package/dist/types/game/gameAssetUtils.d.ts +23 -0
  441. package/dist/types/game/index.d.ts +8 -0
  442. package/dist/types/game/isometricTiles.d.ts +250 -0
  443. package/dist/types/game/useAnimationPreview.d.ts +63 -0
  444. package/dist/types/game/useCollisionEditor.d.ts +96 -0
  445. package/dist/types/game/useGameAssetEditor.d.ts +79 -0
  446. package/dist/types/game/useGameAssetExport.d.ts +82 -0
  447. package/dist/types/icon/NiceIconEditor.d.ts +79 -0
  448. package/dist/types/index.d.ts +85 -0
  449. package/dist/types/photo/BatchProcessingPanel.d.ts +13 -0
  450. package/dist/types/photo/FaceDetectionPanel.d.ts +18 -0
  451. package/dist/types/photo/FilterThumb.d.ts +14 -0
  452. package/dist/types/photo/PerspectiveCorrectionPanel.d.ts +17 -0
  453. package/dist/types/photo/PhotoEditor.d.ts +2 -0
  454. package/dist/types/photo/PhotoEditorCanvas.d.ts +14 -0
  455. package/dist/types/photo/PhotoEditorLeftPanel.d.ts +13 -0
  456. package/dist/types/photo/PhotoEditorToolbar.d.ts +13 -0
  457. package/dist/types/photo/RawFilePanel.d.ts +14 -0
  458. package/dist/types/photo/StyleTransferPanel.d.ts +15 -0
  459. package/dist/types/photo/aiStyleTransfer.d.ts +58 -0
  460. package/dist/types/photo/batchProcessing.d.ts +95 -0
  461. package/dist/types/photo/faceDetection.d.ts +103 -0
  462. package/dist/types/photo/index.d.ts +17 -0
  463. package/dist/types/photo/perspectiveCorrection.d.ts +134 -0
  464. package/dist/types/photo/photoEditorActions.d.ts +40 -0
  465. package/dist/types/photo/photoEditorTypes.d.ts +34 -0
  466. package/dist/types/photo/photoFilters.d.ts +55 -0
  467. package/dist/types/photo/photoOverlays.d.ts +126 -0
  468. package/dist/types/photo/photoSelection.d.ts +56 -0
  469. package/dist/types/photo/rawFileSupport.d.ts +124 -0
  470. package/dist/types/photo/usePhotoEditor.d.ts +123 -0
  471. package/dist/types/pixel/HSVPicker.d.ts +11 -0
  472. package/dist/types/pixel/PaletteExtractorPanel.d.ts +16 -0
  473. package/dist/types/pixel/PixelEditor.d.ts +17 -0
  474. package/dist/types/pixel/PixelEditorCanvas.d.ts +10 -0
  475. package/dist/types/pixel/PixelEditorMenuBar.d.ts +11 -0
  476. package/dist/types/pixel/PixelEditorRightPanel.d.ts +11 -0
  477. package/dist/types/pixel/PixelEditorStatusBar.d.ts +11 -0
  478. package/dist/types/pixel/PixelEditorTimeline.d.ts +11 -0
  479. package/dist/types/pixel/PixelEditorToolbar.d.ts +11 -0
  480. package/dist/types/pixel/TileMapPanel.d.ts +14 -0
  481. package/dist/types/pixel/asepriteFormat.d.ts +62 -0
  482. package/dist/types/pixel/paletteExtractor.d.ts +73 -0
  483. package/dist/types/pixel/pixelEditorExports.d.ts +31 -0
  484. package/dist/types/pixel/pixelEditorTypes.d.ts +51 -0
  485. package/dist/types/pixel/pixelEditorUtils.d.ts +136 -0
  486. package/dist/types/pixel/tileMapMode.d.ts +122 -0
  487. package/dist/types/pixel/usePixelEditor.d.ts +114 -0
  488. package/dist/types/texture/Nice3DTexturePainter.d.ts +55 -0
  489. package/dist/types/ui/NiceUIDesigner.d.ts +43 -0
  490. package/dist/types/vector/PathSimplificationPanel.d.ts +15 -0
  491. package/dist/types/vector/PdfExportPanel.d.ts +20 -0
  492. package/dist/types/vector/TextOnPathPanel.d.ts +26 -0
  493. package/dist/types/vector/VectorEditor.d.ts +32 -0
  494. package/dist/types/vector/VectorEditorMenuBar.d.ts +8 -0
  495. package/dist/types/vector/VectorEditorRightPanel.d.ts +7 -0
  496. package/dist/types/vector/VectorEditorShapeRenderer.d.ts +9 -0
  497. package/dist/types/vector/VectorEditorStatusBar.d.ts +9 -0
  498. package/dist/types/vector/VectorFilterPanel.d.ts +19 -0
  499. package/dist/types/vector/VectorPatternPanel.d.ts +21 -0
  500. package/dist/types/vector/pathSimplification.d.ts +135 -0
  501. package/dist/types/vector/pdfExport.d.ts +65 -0
  502. package/dist/types/vector/textOnPath.d.ts +145 -0
  503. package/dist/types/vector/useVectorEditor.d.ts +90 -0
  504. package/dist/types/vector/vectorBooleanOps.d.ts +22 -0
  505. package/dist/types/vector/vectorEditorExport.d.ts +8 -0
  506. package/dist/types/vector/vectorEditorImport.d.ts +7 -0
  507. package/dist/types/vector/vectorEditorTypes.d.ts +47 -0
  508. package/dist/types/vector/vectorGradients.d.ts +64 -0
  509. package/dist/types/vector/vectorPatternFills.d.ts +101 -0
  510. package/dist/types/vector/vectorSvgFilters.d.ts +134 -0
  511. package/package.json +93 -0
@@ -0,0 +1,103 @@
1
+ /**
2
+ * faceDetection — Face detection for auto-crop and photo analysis
3
+ *
4
+ * Provides face detection using:
5
+ * 1. Pure JS skin-tone + edge detection heuristics (fast, no deps)
6
+ * 2. Optional face-api.js integration (accurate, requires loading models)
7
+ *
8
+ * Features:
9
+ * - Face region detection
10
+ * - Face count estimation
11
+ * - Auto-crop suggestions
12
+ * - Face landmarks (with face-api.js)
13
+ * - Expression detection (with face-api.js)
14
+ */
15
+ export interface FaceRegion {
16
+ /** Bounding box */
17
+ x: number;
18
+ y: number;
19
+ width: number;
20
+ height: number;
21
+ /** Detection confidence (0-1) */
22
+ confidence: number;
23
+ /** Face landmarks (if available) */
24
+ landmarks?: FaceLandmarks;
25
+ /** Estimated expression (if available) */
26
+ expression?: FaceExpression;
27
+ }
28
+ export interface FaceLandmarks {
29
+ leftEye: {
30
+ x: number;
31
+ y: number;
32
+ };
33
+ rightEye: {
34
+ x: number;
35
+ y: number;
36
+ };
37
+ nose: {
38
+ x: number;
39
+ y: number;
40
+ };
41
+ mouthLeft: {
42
+ x: number;
43
+ y: number;
44
+ };
45
+ mouthRight: {
46
+ x: number;
47
+ y: number;
48
+ };
49
+ jawOutline?: Array<{
50
+ x: number;
51
+ y: number;
52
+ }>;
53
+ }
54
+ export type FaceExpression = 'neutral' | 'happy' | 'sad' | 'angry' | 'fearful' | 'disgusted' | 'surprised';
55
+ export interface FaceDetectionOptions {
56
+ /** Minimum face size (relative to image, 0-1) */
57
+ minFaceSize: number;
58
+ /** Maximum number of faces to detect */
59
+ maxFaces: number;
60
+ /** Detection quality */
61
+ quality: 'fast' | 'accurate';
62
+ /** Include landmarks detection */
63
+ detectLandmarks: boolean;
64
+ /** Include expression detection */
65
+ detectExpressions: boolean;
66
+ }
67
+ export interface FaceDetectionResult {
68
+ /** Detected faces */
69
+ faces: FaceRegion[];
70
+ /** Processing time in ms */
71
+ processingTimeMs: number;
72
+ /** Detection method used */
73
+ method: 'heuristic' | 'neural';
74
+ }
75
+ export interface AutoCropSuggestion {
76
+ /** Suggested crop rectangle */
77
+ x: number;
78
+ y: number;
79
+ width: number;
80
+ height: number;
81
+ /** Aspect ratio used */
82
+ aspectRatio: number;
83
+ /** Crop type */
84
+ type: 'portrait' | 'headshot' | 'group' | 'full';
85
+ }
86
+ export declare const DEFAULT_DETECTION_OPTIONS: FaceDetectionOptions;
87
+ /**
88
+ * Generate auto-crop suggestion based on detected faces
89
+ */
90
+ export declare function generateAutoCropSuggestion(faces: FaceRegion[], imageWidth: number, imageHeight: number, targetAspectRatio?: number): AutoCropSuggestion | null;
91
+ /**
92
+ * Generate multiple crop suggestions for common aspect ratios
93
+ */
94
+ export declare function generateMultipleCropSuggestions(faces: FaceRegion[], imageWidth: number, imageHeight: number): AutoCropSuggestion[];
95
+ /**
96
+ * Detect faces in an image
97
+ */
98
+ export declare function detectFaces(imageData: ImageData, options?: Partial<FaceDetectionOptions>): Promise<FaceDetectionResult>;
99
+ /**
100
+ * Quick face detection (always uses heuristic for speed)
101
+ */
102
+ export declare function detectFacesFast(imageData: ImageData, maxFaces?: number): FaceRegion[];
103
+ export default detectFaces;
@@ -0,0 +1,17 @@
1
+ export { default as PhotoEditor } from './PhotoEditor';
2
+ export { usePhotoEditor } from './usePhotoEditor';
3
+ export type * from './photoEditorTypes';
4
+ export * from './photoFilters';
5
+ export * from './photoOverlays';
6
+ export * from './photoSelection';
7
+ export * from './photoEditorActions';
8
+ export { applyStyleTransfer, generateStylePreviews, downscaleForPreview, upscaleFromPreview, STYLE_PRESETS, DEFAULT_STYLE_OPTIONS, type StylePreset, type StyleTransferOptions, } from './aiStyleTransfer';
9
+ export { StyleTransferPanel } from './StyleTransferPanel';
10
+ export { loadRawFile, extractMetadata, extractPreview, isRawFile, detectFormatFromExtension, detectFormatFromHeader, RAW_EXTENSIONS, ALL_RAW_EXTENSIONS, DEFAULT_RAW_OPTIONS, type RawFormat, type RawMetadata, type RawProcessingOptions, type RawLoadResult } from './rawFileSupport';
11
+ export { RawFilePanel } from './RawFilePanel';
12
+ export { detectFaces, detectFacesFast, generateAutoCropSuggestion, type FaceRegion, type FaceDetectionOptions, type AutoCropSuggestion } from './faceDetection';
13
+ export { FaceDetectionPanel } from './FaceDetectionPanel';
14
+ export { applyPerspectiveTransform, computePerspectiveTransform, detectDocumentEdges, createRectQuad, getQuadBounds, isPointInQuad, getNearestCorner, moveQuadCorner, getQuadArea, identityMatrix, multiplyMatrices, invertMatrix, transformPoint, PERSPECTIVE_PRESETS, type Quad, type Matrix3x3, type PerspectiveSettings, type CornerHandle, type PerspectivePreset, type UsePerspectiveCorrectionOptions, } from './perspectiveCorrection';
15
+ export { PerspectiveCorrectionPanel } from './PerspectiveCorrectionPanel';
16
+ export * from './batchProcessing';
17
+ export { BatchProcessingPanel } from './BatchProcessingPanel';
@@ -0,0 +1,134 @@
1
+ /**
2
+ * perspectiveCorrection.ts
3
+ * Perspective correction and transformation utilities for PhotoEditor
4
+ */
5
+ /** 2D Point */
6
+ export interface Point {
7
+ x: number;
8
+ y: number;
9
+ }
10
+ /** Quad defined by four corners */
11
+ export interface Quad {
12
+ topLeft: Point;
13
+ topRight: Point;
14
+ bottomRight: Point;
15
+ bottomLeft: Point;
16
+ }
17
+ /** 3x3 Transformation matrix */
18
+ export type Matrix3x3 = [
19
+ number,
20
+ number,
21
+ number,
22
+ number,
23
+ number,
24
+ number,
25
+ number,
26
+ number,
27
+ number
28
+ ];
29
+ /** Perspective correction settings */
30
+ export interface PerspectiveSettings {
31
+ /** Source quad corners */
32
+ sourceQuad: Quad;
33
+ /** Target quad corners (usually rectangle) */
34
+ targetQuad: Quad;
35
+ /** Interpolation method */
36
+ interpolation: 'nearest' | 'bilinear' | 'bicubic';
37
+ /** Maintain aspect ratio */
38
+ maintainAspect: boolean;
39
+ /** Output width */
40
+ outputWidth: number;
41
+ /** Output height */
42
+ outputHeight: number;
43
+ }
44
+ /** Corner handle being dragged */
45
+ export type CornerHandle = 'topLeft' | 'topRight' | 'bottomRight' | 'bottomLeft';
46
+ /** Preset perspective correction */
47
+ export interface PerspectivePreset {
48
+ name: string;
49
+ description: string;
50
+ sourceQuad: Quad;
51
+ }
52
+ /**
53
+ * Create identity matrix
54
+ */
55
+ export declare function identityMatrix(): Matrix3x3;
56
+ /**
57
+ * Multiply two 3x3 matrices
58
+ */
59
+ export declare function multiplyMatrices(a: Matrix3x3, b: Matrix3x3): Matrix3x3;
60
+ /**
61
+ * Invert 3x3 matrix
62
+ */
63
+ export declare function invertMatrix(m: Matrix3x3): Matrix3x3 | null;
64
+ /**
65
+ * Transform point using matrix
66
+ */
67
+ export declare function transformPoint(p: Point, m: Matrix3x3): Point;
68
+ /**
69
+ * Calculate perspective transformation matrix from quad to quad
70
+ */
71
+ export declare function computePerspectiveTransform(src: Quad, dst: Quad): Matrix3x3;
72
+ /**
73
+ * Apply perspective transform to image data
74
+ */
75
+ export declare function applyPerspectiveTransform(sourceData: ImageData, settings: PerspectiveSettings): ImageData;
76
+ /**
77
+ * Create rectangle quad
78
+ */
79
+ export declare function createRectQuad(x: number, y: number, width: number, height: number): Quad;
80
+ /**
81
+ * Calculate bounding box of quad
82
+ */
83
+ export declare function getQuadBounds(quad: Quad): {
84
+ x: number;
85
+ y: number;
86
+ width: number;
87
+ height: number;
88
+ };
89
+ /**
90
+ * Check if point is inside quad
91
+ */
92
+ export declare function isPointInQuad(point: Point, quad: Quad): boolean;
93
+ /**
94
+ * Get nearest corner handle to point
95
+ */
96
+ export declare function getNearestCorner(point: Point, quad: Quad, threshold?: number): CornerHandle | null;
97
+ /**
98
+ * Move corner of quad
99
+ */
100
+ export declare function moveQuadCorner(quad: Quad, corner: CornerHandle, newPos: Point): Quad;
101
+ /**
102
+ * Calculate quad area
103
+ */
104
+ export declare function getQuadArea(quad: Quad): number;
105
+ /**
106
+ * Detect document/paper edges in image
107
+ * Returns suggested quad corners
108
+ */
109
+ export declare function detectDocumentEdges(imageData: ImageData, options?: {
110
+ edgeThreshold?: number;
111
+ minArea?: number;
112
+ }): Quad | null;
113
+ /**
114
+ * Perspective correction presets
115
+ */
116
+ export declare const PERSPECTIVE_PRESETS: PerspectivePreset[];
117
+ export interface UsePerspectiveCorrectionOptions {
118
+ imageWidth: number;
119
+ imageHeight: number;
120
+ }
121
+ export declare function usePerspectiveCorrection(options: UsePerspectiveCorrectionOptions): {
122
+ sourceQuad: Quad;
123
+ setSourceQuad: import("react").Dispatch<import("react").SetStateAction<Quad>>;
124
+ interpolation: "nearest" | "bilinear" | "bicubic";
125
+ setInterpolation: import("react").Dispatch<import("react").SetStateAction<"nearest" | "bilinear" | "bicubic">>;
126
+ maintainAspect: boolean;
127
+ setMaintainAspect: import("react").Dispatch<import("react").SetStateAction<boolean>>;
128
+ activeCorner: CornerHandle | null;
129
+ setActiveCorner: import("react").Dispatch<import("react").SetStateAction<CornerHandle | null>>;
130
+ resetQuad: () => void;
131
+ moveCorner: (corner: CornerHandle, newPos: Point) => void;
132
+ applyPreset: (preset: PerspectivePreset) => void;
133
+ getSettings: () => PerspectiveSettings;
134
+ };
@@ -0,0 +1,40 @@
1
+ /**
2
+ * photoEditorActions.ts — Pure helper functions for photo export, download,
3
+ * clipboard copy, and native share in PhotoEditor.
4
+ */
5
+ import { type AdjustmentValues, type FilterParams } from "./photoFilters";
6
+ import { type Overlay } from "./photoOverlays";
7
+ export interface ExportParams {
8
+ image: HTMLImageElement;
9
+ selectedFilter: string;
10
+ filterParams: FilterParams;
11
+ filterIntensity: number;
12
+ adjustments: AdjustmentValues;
13
+ cropRect: {
14
+ x: number;
15
+ y: number;
16
+ w: number;
17
+ h: number;
18
+ } | null;
19
+ rotation: number;
20
+ flipH: boolean;
21
+ flipV: boolean;
22
+ overlays: Overlay[];
23
+ }
24
+ /**
25
+ * Render the current editor state to a JPEG Blob for export.
26
+ */
27
+ export declare function getExportBlob(params: ExportParams): Promise<Blob | null>;
28
+ /**
29
+ * Trigger a browser download of the given Blob as "photo-edited.jpg".
30
+ */
31
+ export declare function handleDownloadBlob(blob: Blob): void;
32
+ /**
33
+ * Copy the current editor output to clipboard as PNG.
34
+ */
35
+ export declare function handleCopyImageToClipboard(params: ExportParams): Promise<void>;
36
+ /**
37
+ * Use the Web Share API to share the exported image.
38
+ * Falls back to download if sharing is not supported.
39
+ */
40
+ export declare function handleNativeShare(blob: Blob): Promise<void>;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * photoEditorTypes.ts — Shared types and constants for PhotoEditor.
3
+ */
4
+ import type { AdjustmentValues } from "./photoFilters";
5
+ export interface PhotoEditorProps {
6
+ /** Image source — File, Blob, or URL string */
7
+ src: File | Blob | string;
8
+ /** Player colour accent */
9
+ playerColor?: string;
10
+ /** Called with the edited File (+ serialised editor state) when user clicks Save */
11
+ onSave: (file: File, editorStateJson?: string) => void;
12
+ /** Called when user cancels editing */
13
+ onCancel: () => void;
14
+ /** Previously stored editor-state JSON to restore (if re-editing) */
15
+ initialState?: string | null;
16
+ }
17
+ export type EditorTab = "filters" | "adjust" | "crop" | "transform" | "stickers" | "text" | "shapes" | "draw";
18
+ export type FilterCategory = "all" | "color" | "light" | "vintage" | "artistic" | "fun";
19
+ export declare const TAB_DEFS: {
20
+ key: EditorTab;
21
+ icon: string;
22
+ label: string;
23
+ }[];
24
+ export declare const ASPECT_RATIOS: {
25
+ label: string;
26
+ value: number | null;
27
+ }[];
28
+ export declare const ADJUSTMENT_SLIDERS: {
29
+ key: keyof AdjustmentValues;
30
+ label: string;
31
+ min: number;
32
+ max: number;
33
+ icon: string;
34
+ }[];
@@ -0,0 +1,55 @@
1
+ /**
2
+ * photoFilters.ts — Canvas-based photo filter engine.
3
+ *
4
+ * Pure functions that operate on ImageData pixel arrays.
5
+ * Each filter takes ImageData + optional params and returns a new ImageData.
6
+ * Composable via `applyFilterChain`.
7
+ */
8
+ export interface FilterParams {
9
+ /** Intensity 0..1 (default 1 = full effect) */
10
+ intensity?: number;
11
+ [key: string]: unknown;
12
+ }
13
+ export interface FilterDefinition {
14
+ id: string;
15
+ name: string;
16
+ /** Category for UI grouping */
17
+ category: 'color' | 'light' | 'artistic' | 'vintage' | 'fun' | 'adjustment';
18
+ /** Emoji icon for quick visual */
19
+ icon: string;
20
+ /** Apply filter to pixel data */
21
+ apply: (data: ImageData, params?: FilterParams) => ImageData;
22
+ /** Default params */
23
+ defaults?: FilterParams;
24
+ }
25
+ export interface AdjustmentValues {
26
+ brightness: number;
27
+ contrast: number;
28
+ saturation: number;
29
+ temperature: number;
30
+ tint: number;
31
+ exposure: number;
32
+ highlights: number;
33
+ shadows: number;
34
+ sharpness: number;
35
+ vignette: number;
36
+ grain: number;
37
+ blur: number;
38
+ }
39
+ export declare const DEFAULT_ADJUSTMENTS: AdjustmentValues;
40
+ export declare function applyVignette(ctx: CanvasRenderingContext2D, w: number, h: number, amount: number): void;
41
+ export declare function applyGrain(ctx: CanvasRenderingContext2D, w: number, h: number, amount: number): void;
42
+ export declare const PHOTO_FILTERS: FilterDefinition[];
43
+ /** Get filter by ID */
44
+ export declare function getFilter(id: string): FilterDefinition | undefined;
45
+ /** Apply adjustments to ImageData */
46
+ export declare function applyAdjustments(data: ImageData, adj: Partial<AdjustmentValues>): ImageData;
47
+ /** Full pipeline: filter + adjustments → canvas, then vignette & grain via context */
48
+ export declare function renderToCanvas(canvas: HTMLCanvasElement, sourceImage: HTMLImageElement, filterId: string, filterParams: FilterParams, adjustments: Partial<AdjustmentValues>, cropRect?: {
49
+ x: number;
50
+ y: number;
51
+ w: number;
52
+ h: number;
53
+ } | null, rotation?: number, flipH?: boolean, flipV?: boolean): void;
54
+ /** Export canvas as File (for upload) */
55
+ export declare function canvasToFile(canvas: HTMLCanvasElement, filename?: string, quality?: number): Promise<File>;
@@ -0,0 +1,126 @@
1
+ /**
2
+ * photoOverlays.ts — Overlay / layer engine for PhotoEditor.
3
+ *
4
+ * Handles emojis, text, shapes, freehand drawing strokes, and decorative frames
5
+ * as positioned layers on top of the base (filtered) image.
6
+ *
7
+ * All positions use **fractional coordinates** (0 … 1) relative to the rendered
8
+ * canvas so overlays survive crop / resize changes.
9
+ */
10
+ import type { AdjustmentValues } from "./photoFilters";
11
+ export type OverlayType = "emoji" | "text" | "shape" | "drawing" | "frame";
12
+ export interface BaseOverlay {
13
+ id: string;
14
+ type: OverlayType;
15
+ /** Centre X as fraction of canvas width (0 … 1) */
16
+ x: number;
17
+ /** Centre Y as fraction of canvas height (0 … 1) */
18
+ y: number;
19
+ scaleX: number;
20
+ scaleY: number;
21
+ /** Degrees */
22
+ rotation: number;
23
+ /** 0 … 1 */
24
+ opacity: number;
25
+ }
26
+ export interface EmojiOverlay extends BaseOverlay {
27
+ type: "emoji";
28
+ emoji: string;
29
+ /** Base font size in px (before scale) */
30
+ fontSize: number;
31
+ }
32
+ export interface TextOverlay extends BaseOverlay {
33
+ type: "text";
34
+ text: string;
35
+ fontFamily: string;
36
+ fontSize: number;
37
+ color: string;
38
+ bold: boolean;
39
+ italic: boolean;
40
+ outlineColor: string | null;
41
+ outlineWidth: number;
42
+ shadow: string | null;
43
+ background: string | null;
44
+ backgroundPadding: number;
45
+ }
46
+ export type ShapeKind = "rect" | "circle" | "triangle" | "star" | "heart" | "arrow" | "diamond" | "hexagon" | "cross" | "lightning";
47
+ export interface ShapeOverlay extends BaseOverlay {
48
+ type: "shape";
49
+ shapeKind: ShapeKind;
50
+ /** Base width / height in px */
51
+ width: number;
52
+ height: number;
53
+ fillColor: string | null;
54
+ strokeColor: string;
55
+ strokeWidth: number;
56
+ }
57
+ export interface DrawingStroke {
58
+ /** Array of [x, y] fractions (0 … 1) */
59
+ points: [number, number][];
60
+ color: string;
61
+ width: number;
62
+ opacity: number;
63
+ }
64
+ export interface DrawingOverlay extends BaseOverlay {
65
+ type: "drawing";
66
+ strokes: DrawingStroke[];
67
+ }
68
+ export type FrameStyleId = "simple" | "double" | "rounded" | "polaroid" | "film" | "vintage" | "ornate" | "shadow" | "neon" | "torn";
69
+ export interface FrameOverlay extends BaseOverlay {
70
+ type: "frame";
71
+ frameStyle: FrameStyleId;
72
+ color: string;
73
+ /** Border thickness as fraction of min(w,h) */
74
+ thickness: number;
75
+ }
76
+ export type Overlay = EmojiOverlay | TextOverlay | ShapeOverlay | DrawingOverlay | FrameOverlay;
77
+ export interface EmojiCategory {
78
+ id: string;
79
+ label: string;
80
+ icon: string;
81
+ emojis: string[];
82
+ }
83
+ export declare const EMOJI_CATALOG: EmojiCategory[];
84
+ export interface ShapeDef {
85
+ id: ShapeKind;
86
+ label: string;
87
+ icon: string;
88
+ }
89
+ export declare const SHAPE_CATALOG: ShapeDef[];
90
+ export interface FrameStyleDef {
91
+ id: FrameStyleId;
92
+ label: string;
93
+ icon: string;
94
+ }
95
+ export declare const FRAME_CATALOG: FrameStyleDef[];
96
+ export declare function generateOverlayId(): string;
97
+ /** Render all overlays to a canvas context. */
98
+ export declare function renderAllOverlays(ctx: CanvasRenderingContext2D, overlays: Overlay[], w: number, h: number): void;
99
+ export declare function renderLiveStroke(ctx: CanvasRenderingContext2D, points: [number, number][], color: string, width: number, canvasW: number, canvasH: number): void;
100
+ /**
101
+ * Returns `true` when the point (px, py) in canvas-fraction space
102
+ * hits the bounding box of the overlay (ignoring rotation).
103
+ */
104
+ export declare function hitTestOverlay(ov: Overlay, px: number, py: number, _w: number, _h: number): boolean;
105
+ export declare function createEmojiOverlay(emoji: string, canvasW: number, canvasH: number): EmojiOverlay;
106
+ export declare function createTextOverlay(text?: string): TextOverlay;
107
+ export declare function createShapeOverlay(kind: ShapeKind): ShapeOverlay;
108
+ export declare function createDrawingOverlay(): DrawingOverlay;
109
+ export declare function createFrameOverlay(style: FrameStyleId, color?: string): FrameOverlay;
110
+ export interface PhotoEditorState {
111
+ filter: string;
112
+ filterIntensity: number;
113
+ adjustments: AdjustmentValues;
114
+ rotation: number;
115
+ flipH: boolean;
116
+ flipV: boolean;
117
+ cropRect: {
118
+ x: number;
119
+ y: number;
120
+ w: number;
121
+ h: number;
122
+ } | null;
123
+ overlays: Overlay[];
124
+ }
125
+ export declare function serializeEditorState(state: PhotoEditorState): string;
126
+ export declare function deserializeEditorState(json: string): PhotoEditorState | null;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Smart selection tools for PhotoEditor
3
+ * Implements magic wand, lasso selection, and healing brush
4
+ */
5
+ export interface SelectionMask {
6
+ width: number;
7
+ height: number;
8
+ data: Uint8Array;
9
+ }
10
+ export interface Point {
11
+ x: number;
12
+ y: number;
13
+ }
14
+ export type SelectionMode = 'replace' | 'add' | 'subtract' | 'intersect';
15
+ export declare function createEmptyMask(width: number, height: number): SelectionMask;
16
+ export declare function createFullMask(width: number, height: number): SelectionMask;
17
+ export declare function invertMask(mask: SelectionMask): SelectionMask;
18
+ export declare function combineMasks(maskA: SelectionMask, maskB: SelectionMask, mode: SelectionMode): SelectionMask;
19
+ export declare function featherMask(mask: SelectionMask, radius: number): SelectionMask;
20
+ export interface MagicWandOptions {
21
+ tolerance: number;
22
+ contiguous: boolean;
23
+ antiAlias: boolean;
24
+ feather: number;
25
+ }
26
+ export declare function magicWandSelect(imageData: ImageData, startX: number, startY: number, options?: Partial<MagicWandOptions>): SelectionMask;
27
+ export interface LassoOptions {
28
+ feather: number;
29
+ antiAlias: boolean;
30
+ }
31
+ export declare function lassoSelect(width: number, height: number, points: Point[], options?: Partial<LassoOptions>): SelectionMask;
32
+ /** Magnetic lasso - snaps to edges in image */
33
+ export declare function magneticLassoPoint(imageData: ImageData, x: number, y: number, searchRadius?: number): Point;
34
+ export interface ColorRangeOptions {
35
+ fuzziness: number;
36
+ feather: number;
37
+ }
38
+ export declare function selectColorRange(imageData: ImageData, targetColor: {
39
+ r: number;
40
+ g: number;
41
+ b: number;
42
+ }, options?: Partial<ColorRangeOptions>): SelectionMask;
43
+ export interface HealingBrushOptions {
44
+ radius: number;
45
+ hardness: number;
46
+ opacity: number;
47
+ mode: 'heal' | 'clone';
48
+ }
49
+ /** Apply healing brush at destination using source area */
50
+ export declare function applyHealingBrush(imageData: ImageData, srcX: number, srcY: number, dstX: number, dstY: number, options?: Partial<HealingBrushOptions>): ImageData;
51
+ /** Simple content-aware fill using surrounding pixels */
52
+ export declare function contentAwareFill(imageData: ImageData, mask: SelectionMask): ImageData;
53
+ /** Render marching ants selection outline */
54
+ export declare function renderSelectionOutline(ctx: CanvasRenderingContext2D, mask: SelectionMask, offset?: number): void;
55
+ /** Apply mask as alpha to ImageData */
56
+ export declare function applyMaskToImageData(imageData: ImageData, mask: SelectionMask, invert?: boolean): ImageData;