@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,27 @@
1
+ /**
2
+ * i18n — Lightweight translation context for @nice2dev/ui-graphics.
3
+ *
4
+ * Drop-in replacement for react-i18next's useTranslation, requires NO
5
+ * external dependencies. Consumers can optionally wrap with NiceI18nProvider
6
+ * to supply their own translation function. Falls back to the default
7
+ * (English key strings) when no provider is present.
8
+ *
9
+ * Usage in components:
10
+ * const { t } = useNiceTranslation();
11
+ * <button>{t('actions.save', 'Save')}</button>
12
+ *
13
+ * Usage in apps:
14
+ * <NiceI18nProvider t={(key, fallback) => myI18n(key) ?? fallback}>
15
+ * <App />
16
+ * </NiceI18nProvider>
17
+ */
18
+ import React from 'react';
19
+ export type NiceTranslateFn = (key: string, defaultValue: string) => string;
20
+ export interface NiceI18nProviderProps {
21
+ t: NiceTranslateFn;
22
+ children: React.ReactNode;
23
+ }
24
+ export declare const NiceI18nProvider: React.FC<NiceI18nProviderProps>;
25
+ export declare function useNiceTranslation(): {
26
+ t: NiceTranslateFn;
27
+ };
@@ -0,0 +1,103 @@
1
+ /**
2
+ * integrations.ts — External service integrations for editors.
3
+ *
4
+ * Stock image pickers (Unsplash/Pexels), Adobe CC connector,
5
+ * Figma import/export, template library, and AI image generation.
6
+ */
7
+ export interface StockImage {
8
+ id: string;
9
+ url: string;
10
+ thumbnailUrl: string;
11
+ author: string;
12
+ source: "unsplash" | "pexels";
13
+ width: number;
14
+ height: number;
15
+ description?: string;
16
+ }
17
+ export interface StockImageSearchOptions {
18
+ query: string;
19
+ page?: number;
20
+ perPage?: number;
21
+ orientation?: "landscape" | "portrait" | "squarish";
22
+ }
23
+ export interface FigmaImportResult {
24
+ nodes: FigmaNode[];
25
+ images: Map<string, Blob>;
26
+ }
27
+ export interface FigmaNode {
28
+ id: string;
29
+ name: string;
30
+ type: string;
31
+ width: number;
32
+ height: number;
33
+ svg?: string;
34
+ imageData?: ImageData;
35
+ }
36
+ export interface AIGenerationOptions {
37
+ prompt: string;
38
+ width?: number;
39
+ height?: number;
40
+ style?: "realistic" | "artistic" | "pixel-art" | "vector" | "sketch";
41
+ provider: "openai" | "stability" | "custom";
42
+ apiKey?: string;
43
+ apiUrl?: string;
44
+ }
45
+ export interface AIGenerationResult {
46
+ imageUrl: string;
47
+ imageBlob: Blob;
48
+ metadata: Record<string, unknown>;
49
+ }
50
+ export interface TemplateItem {
51
+ id: string;
52
+ name: string;
53
+ category: string;
54
+ thumbnailUrl: string;
55
+ width: number;
56
+ height: number;
57
+ data: unknown;
58
+ }
59
+ export declare class UnsplashProvider {
60
+ private accessKey;
61
+ constructor(accessKey: string);
62
+ search(options: StockImageSearchOptions): Promise<StockImage[]>;
63
+ }
64
+ export declare class PexelsProvider {
65
+ private apiKey;
66
+ constructor(apiKey: string);
67
+ search(options: StockImageSearchOptions): Promise<StockImage[]>;
68
+ }
69
+ export interface AdobeCCConfig {
70
+ clientId: string;
71
+ redirectUri: string;
72
+ }
73
+ export declare class AdobeCCConnector {
74
+ private config;
75
+ constructor(config: AdobeCCConfig);
76
+ /** Get the OAuth authorization URL. */
77
+ getAuthUrl(): string;
78
+ /** Import a file from Adobe CC Libraries. */
79
+ importFromLibrary(accessToken: string, assetId: string): Promise<Blob>;
80
+ }
81
+ export declare class FigmaConnector {
82
+ private accessToken;
83
+ constructor(accessToken: string);
84
+ /** Import nodes from a Figma file. */
85
+ importFile(fileKey: string, nodeIds?: string[]): Promise<FigmaImportResult>;
86
+ /** Export a design to Figma (via plugin API—returns Figma plugin code). */
87
+ exportToFigmaPlugin(svg: string, nodeName?: string): string;
88
+ private extractNodes;
89
+ }
90
+ export declare class TemplateLibrary {
91
+ private templates;
92
+ /** Register a template. */
93
+ register(template: TemplateItem): void;
94
+ /** Get all templates. */
95
+ getAll(): TemplateItem[];
96
+ /** Get templates by category. */
97
+ getByCategory(category: string): TemplateItem[];
98
+ /** Get all categories. */
99
+ getCategories(): string[];
100
+ /** Search templates by name. */
101
+ search(query: string): TemplateItem[];
102
+ }
103
+ export declare function generateAIImage(options: AIGenerationOptions): Promise<AIGenerationResult>;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * minimap.ts — Zoom navigator / minimap component for editors.
3
+ *
4
+ * Provides a small overview of the full canvas with a viewport indicator
5
+ * that can be dragged to navigate around the document.
6
+ */
7
+ import React from "react";
8
+ export interface MinimapConfig {
9
+ /** Width of the minimap panel in pixels. */
10
+ width?: number;
11
+ /** Height of the minimap panel in pixels. */
12
+ height?: number;
13
+ /** Show/hide the minimap. */
14
+ visible?: boolean;
15
+ /** Position on screen. */
16
+ position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
17
+ /** Opacity of the minimap. */
18
+ opacity?: number;
19
+ }
20
+ export interface ViewportRect {
21
+ x: number;
22
+ y: number;
23
+ width: number;
24
+ height: number;
25
+ }
26
+ export interface MinimapProps {
27
+ /** The full canvas/document as a data URL or canvas ref. */
28
+ canvasRef?: React.RefObject<HTMLCanvasElement | null>;
29
+ /** Alternative: provide image data directly. */
30
+ imageDataUrl?: string;
31
+ /** Total document dimensions. */
32
+ documentWidth: number;
33
+ documentHeight: number;
34
+ /** Currently visible viewport. */
35
+ viewport: ViewportRect;
36
+ /** Called when user drags the viewport indicator. */
37
+ onViewportChange?: (viewport: ViewportRect) => void;
38
+ /** Configuration. */
39
+ config?: MinimapConfig;
40
+ className?: string;
41
+ }
42
+ /** Zoom navigator / minimap showing a scaled-down view of the full document. */
43
+ export declare const Minimap: React.FC<MinimapProps>;
44
+ /** Hook for managing minimap visibility state. */
45
+ export declare function useMinimap(initialVisible?: boolean): {
46
+ visible: boolean;
47
+ setVisible: React.Dispatch<React.SetStateAction<boolean>>;
48
+ toggle: () => void;
49
+ };
@@ -0,0 +1,111 @@
1
+ /**
2
+ * plugins.ts — Plugin system for @nice2dev/ui-graphics editors.
3
+ *
4
+ * Allows third-party extensions to register custom tools, filters,
5
+ * export formats, and UI panels for any editor.
6
+ */
7
+ export type EditorType = "pixel" | "vector" | "photo" | "animation" | "game";
8
+ export interface PluginTool {
9
+ id: string;
10
+ label: string;
11
+ icon?: string;
12
+ cursor?: string;
13
+ onActivate?: () => void;
14
+ onDeactivate?: () => void;
15
+ onPointerDown?: (x: number, y: number, ctx: CanvasRenderingContext2D) => void;
16
+ onPointerMove?: (x: number, y: number, ctx: CanvasRenderingContext2D) => void;
17
+ onPointerUp?: (x: number, y: number, ctx: CanvasRenderingContext2D) => void;
18
+ }
19
+ export interface PluginFilter {
20
+ id: string;
21
+ label: string;
22
+ category?: string;
23
+ apply: (imageData: ImageData) => ImageData;
24
+ }
25
+ export interface PluginExporter {
26
+ id: string;
27
+ label: string;
28
+ extension: string;
29
+ mimeType: string;
30
+ export: (data: unknown) => Blob | Promise<Blob>;
31
+ }
32
+ export interface PluginPanel {
33
+ id: string;
34
+ label: string;
35
+ position: "left" | "right" | "bottom";
36
+ render: (props: {
37
+ editor: unknown;
38
+ }) => React.ReactNode;
39
+ }
40
+ export interface PluginMenuAction {
41
+ id: string;
42
+ label: string;
43
+ menu: "file" | "edit" | "view" | "tools" | "help";
44
+ shortcut?: string;
45
+ execute: () => void;
46
+ }
47
+ export interface EditorPlugin {
48
+ id: string;
49
+ name: string;
50
+ version: string;
51
+ description?: string;
52
+ /** Which editors this plugin applies to. Empty = all. */
53
+ editors?: EditorType[];
54
+ tools?: PluginTool[];
55
+ filters?: PluginFilter[];
56
+ exporters?: PluginExporter[];
57
+ panels?: PluginPanel[];
58
+ menuActions?: PluginMenuAction[];
59
+ /** Called when plugin is loaded. */
60
+ onInit?: () => void;
61
+ /** Called when plugin is unloaded. */
62
+ onDestroy?: () => void;
63
+ }
64
+ import React from "react";
65
+ type PluginEventHandler = (plugin: EditorPlugin) => void;
66
+ declare class PluginRegistryImpl {
67
+ private plugins;
68
+ private listeners;
69
+ /** Register a plugin. Calls onInit if defined. */
70
+ register(plugin: EditorPlugin): void;
71
+ /** Unregister a plugin. Calls onDestroy if defined. */
72
+ unregister(pluginId: string): void;
73
+ /** Get a registered plugin by ID. */
74
+ get(pluginId: string): EditorPlugin | undefined;
75
+ /** Get all registered plugins. */
76
+ getAll(): EditorPlugin[];
77
+ /** Get plugins for a specific editor type. */
78
+ getForEditor(editor: EditorType): EditorPlugin[];
79
+ /** Get all tools from plugins for a specific editor. */
80
+ getTools(editor: EditorType): PluginTool[];
81
+ /** Get all filters from plugins for a specific editor. */
82
+ getFilters(editor: EditorType): PluginFilter[];
83
+ /** Get all exporters from plugins for a specific editor. */
84
+ getExporters(editor: EditorType): PluginExporter[];
85
+ /** Get all panels from plugins for a specific editor. */
86
+ getPanels(editor: EditorType): PluginPanel[];
87
+ /** Get all menu actions from plugins for a specific editor. */
88
+ getMenuActions(editor: EditorType): PluginMenuAction[];
89
+ /** Subscribe to registry events. */
90
+ on(event: string, handler: PluginEventHandler): () => void;
91
+ private emit;
92
+ /** Clear all plugins. */
93
+ clear(): void;
94
+ }
95
+ /** Global plugin registry singleton. */
96
+ export declare const PluginRegistry: PluginRegistryImpl;
97
+ /** React hook that returns plugins for a specific editor, re-renders on changes. */
98
+ export declare function usePlugins(editor: EditorType): {
99
+ plugins: EditorPlugin[];
100
+ tools: PluginTool[];
101
+ filters: PluginFilter[];
102
+ exporters: PluginExporter[];
103
+ panels: PluginPanel[];
104
+ menuActions: PluginMenuAction[];
105
+ };
106
+ export declare const NicePluginProvider: React.FC<{
107
+ plugins?: EditorPlugin[];
108
+ children: React.ReactNode;
109
+ }>;
110
+ export declare function usePluginRegistry(): PluginRegistryImpl;
111
+ export {};
@@ -0,0 +1,32 @@
1
+ /**
2
+ * rtl.ts — Right-to-left (RTL) UI support for editors.
3
+ *
4
+ * Provides RTL direction context, CSS logical properties,
5
+ * and layout utilities for RTL languages (Arabic, Hebrew, etc.).
6
+ */
7
+ import React from "react";
8
+ export type Direction = "ltr" | "rtl";
9
+ export interface RTLConfig {
10
+ direction: Direction;
11
+ /** Mirror horizontal tool positions. */
12
+ mirrorToolbar: boolean;
13
+ /** Mirror panel positions (left↔right). */
14
+ mirrorPanels: boolean;
15
+ }
16
+ /** Provider for RTL configuration. Wraps editors to enable RTL support. */
17
+ export declare const NiceRTLProvider: React.FC<{
18
+ direction?: Direction;
19
+ mirrorToolbar?: boolean;
20
+ mirrorPanels?: boolean;
21
+ children: React.ReactNode;
22
+ }>;
23
+ /** Hook to access RTL configuration. */
24
+ export declare function useRTL(): RTLConfig;
25
+ /** Hook that returns true if the current direction is RTL. */
26
+ export declare function useIsRTL(): boolean;
27
+ /** Convert physical CSS properties to logical equivalents for RTL awareness. */
28
+ export declare function logicalStyles(direction: Direction, styles: React.CSSProperties): React.CSSProperties;
29
+ /** Get panel flex direction based on RTL. */
30
+ export declare function rtlFlexDirection(direction: Direction): "row" | "row-reverse";
31
+ /** Detect direction from document or browser locale. */
32
+ export declare function detectDirection(): Direction;
@@ -0,0 +1,150 @@
1
+ export interface ShortcutDef {
2
+ id: string;
3
+ label: string;
4
+ category: string;
5
+ /** Default key combo, e.g. "Ctrl+Z", "Shift+Delete". */
6
+ defaultKey: string;
7
+ /** Current (possibly remapped) key combo. */
8
+ currentKey: string;
9
+ /** Action to execute. */
10
+ action: () => void;
11
+ }
12
+ export interface ShortcutConfig {
13
+ /** Map of shortcut ID → custom key combo. */
14
+ overrides: Record<string, string>;
15
+ }
16
+ /** Convert a keyboard event to a key combo string. */
17
+ export declare function eventToKeyCombo(e: KeyboardEvent): string;
18
+ declare class ShortcutRegistryImpl {
19
+ private shortcuts;
20
+ private overrides;
21
+ private listeners;
22
+ /** Register a shortcut. */
23
+ register(def: Omit<ShortcutDef, "currentKey">): void;
24
+ /** Register multiple shortcuts at once. */
25
+ registerAll(defs: Array<Omit<ShortcutDef, "currentKey">>): void;
26
+ /** Unregister a shortcut. */
27
+ unregister(id: string): void;
28
+ /** Remap a shortcut to a new key combo. */
29
+ remap(id: string, newKey: string): void;
30
+ /** Reset a shortcut to its default. */
31
+ resetToDefault(id: string): void;
32
+ /** Reset all shortcuts to defaults. */
33
+ resetAll(): void;
34
+ /** Handle a keyboard event, triggering matching shortcuts. */
35
+ handleKeyEvent(e: KeyboardEvent): boolean;
36
+ /** Get all registered shortcuts. */
37
+ getAll(): ShortcutDef[];
38
+ /** Get shortcuts by category. */
39
+ getByCategory(category: string): ShortcutDef[];
40
+ /** Get all categories. */
41
+ getCategories(): string[];
42
+ /** Export custom overrides as JSON. */
43
+ exportConfig(): ShortcutConfig;
44
+ /** Import custom overrides from JSON. */
45
+ importConfig(config: ShortcutConfig): void;
46
+ /** Save overrides to localStorage. */
47
+ save(storageKey?: string): void;
48
+ /** Load overrides from localStorage. */
49
+ load(storageKey?: string): void;
50
+ /** Subscribe to changes. Returns unsubscribe function. */
51
+ subscribe(fn: () => void): () => void;
52
+ private notify;
53
+ }
54
+ /** Global shortcuts registry singleton. */
55
+ export declare const ShortcutRegistry: ShortcutRegistryImpl;
56
+ export declare const DEFAULT_SHORTCUTS: {
57
+ readonly undo: {
58
+ readonly id: "general.undo";
59
+ readonly label: "Undo";
60
+ readonly category: "General";
61
+ readonly defaultKey: "Ctrl+Z";
62
+ };
63
+ readonly redo: {
64
+ readonly id: "general.redo";
65
+ readonly label: "Redo";
66
+ readonly category: "General";
67
+ readonly defaultKey: "Ctrl+Y";
68
+ };
69
+ readonly copy: {
70
+ readonly id: "general.copy";
71
+ readonly label: "Copy";
72
+ readonly category: "General";
73
+ readonly defaultKey: "Ctrl+C";
74
+ };
75
+ readonly paste: {
76
+ readonly id: "general.paste";
77
+ readonly label: "Paste";
78
+ readonly category: "General";
79
+ readonly defaultKey: "Ctrl+V";
80
+ };
81
+ readonly cut: {
82
+ readonly id: "general.cut";
83
+ readonly label: "Cut";
84
+ readonly category: "General";
85
+ readonly defaultKey: "Ctrl+X";
86
+ };
87
+ readonly delete: {
88
+ readonly id: "general.delete";
89
+ readonly label: "Delete";
90
+ readonly category: "General";
91
+ readonly defaultKey: "Delete";
92
+ };
93
+ readonly selectAll: {
94
+ readonly id: "general.selectAll";
95
+ readonly label: "Select All";
96
+ readonly category: "General";
97
+ readonly defaultKey: "Ctrl+A";
98
+ };
99
+ readonly save: {
100
+ readonly id: "general.save";
101
+ readonly label: "Save";
102
+ readonly category: "General";
103
+ readonly defaultKey: "Ctrl+S";
104
+ };
105
+ readonly duplicate: {
106
+ readonly id: "general.duplicate";
107
+ readonly label: "Duplicate";
108
+ readonly category: "General";
109
+ readonly defaultKey: "Ctrl+D";
110
+ };
111
+ readonly zoomIn: {
112
+ readonly id: "view.zoomIn";
113
+ readonly label: "Zoom In";
114
+ readonly category: "View";
115
+ readonly defaultKey: "Ctrl+=";
116
+ };
117
+ readonly zoomOut: {
118
+ readonly id: "view.zoomOut";
119
+ readonly label: "Zoom Out";
120
+ readonly category: "View";
121
+ readonly defaultKey: "Ctrl+-";
122
+ };
123
+ readonly zoomFit: {
124
+ readonly id: "view.zoomFit";
125
+ readonly label: "Zoom to Fit";
126
+ readonly category: "View";
127
+ readonly defaultKey: "Ctrl+0";
128
+ };
129
+ readonly toggleGrid: {
130
+ readonly id: "view.toggleGrid";
131
+ readonly label: "Toggle Grid";
132
+ readonly category: "View";
133
+ readonly defaultKey: "Ctrl+'";
134
+ };
135
+ readonly toggleRulers: {
136
+ readonly id: "view.toggleRulers";
137
+ readonly label: "Toggle Rulers";
138
+ readonly category: "View";
139
+ readonly defaultKey: "Ctrl+R";
140
+ };
141
+ readonly toggleMinimap: {
142
+ readonly id: "view.toggleMinimap";
143
+ readonly label: "Toggle Minimap";
144
+ readonly category: "View";
145
+ readonly defaultKey: "Ctrl+M";
146
+ };
147
+ };
148
+ /** Hook to use shortcuts in a component. Attaches keyboard listener. */
149
+ export declare function useShortcuts(active?: boolean): ShortcutDef[];
150
+ export {};
@@ -0,0 +1,78 @@
1
+ /**
2
+ * theme.ts — Dark/light theme system for @nice2dev/ui-graphics editors.
3
+ *
4
+ * Provides CSS custom properties, theme context, and auto-detection
5
+ * of system dark mode preference.
6
+ */
7
+ import React from "react";
8
+ export type ThemeMode = "light" | "dark" | "auto";
9
+ export interface EditorTheme {
10
+ mode: "light" | "dark";
11
+ colors: {
12
+ bg: string;
13
+ bgAlt: string;
14
+ surface: string;
15
+ surfaceHover: string;
16
+ border: string;
17
+ text: string;
18
+ textSecondary: string;
19
+ textMuted: string;
20
+ accent: string;
21
+ accentHover: string;
22
+ accentText: string;
23
+ error: string;
24
+ warning: string;
25
+ success: string;
26
+ canvasBg: string;
27
+ toolbarBg: string;
28
+ panelBg: string;
29
+ statusBarBg: string;
30
+ selectionBg: string;
31
+ selectionBorder: string;
32
+ };
33
+ spacing: {
34
+ xs: number;
35
+ sm: number;
36
+ md: number;
37
+ lg: number;
38
+ xl: number;
39
+ };
40
+ radius: {
41
+ sm: number;
42
+ md: number;
43
+ lg: number;
44
+ };
45
+ fontSize: {
46
+ xs: number;
47
+ sm: number;
48
+ md: number;
49
+ lg: number;
50
+ };
51
+ }
52
+ export declare const LIGHT_THEME: EditorTheme;
53
+ export declare const DARK_THEME: EditorTheme;
54
+ /** Generate CSS custom properties from a theme. */
55
+ export declare function themeToCssVars(theme: EditorTheme): Record<string, string>;
56
+ /** Apply theme CSS variables to a DOM element. */
57
+ export declare function applyThemeToElement(element: HTMLElement, theme: EditorTheme): void;
58
+ /** Detect if system prefers dark mode. */
59
+ export declare function systemPrefersDark(): boolean;
60
+ /** Resolve "auto" mode to "light" or "dark". */
61
+ export declare function resolveThemeMode(mode: ThemeMode): "light" | "dark";
62
+ /** Get theme for a given mode. */
63
+ export declare function getTheme(mode: ThemeMode): EditorTheme;
64
+ interface ThemeContextValue {
65
+ theme: EditorTheme;
66
+ mode: ThemeMode;
67
+ setMode: (mode: ThemeMode) => void;
68
+ toggleMode: () => void;
69
+ }
70
+ /** Provider for editor theme. Supports "light", "dark", or "auto". */
71
+ export declare const NiceEditorThemeProvider: React.FC<{
72
+ initialMode?: ThemeMode;
73
+ storageKey?: string;
74
+ children: React.ReactNode;
75
+ }>;
76
+ /** Hook to access editor theme. */
77
+ export declare function useEditorTheme(): ThemeContextValue;
78
+ export {};
@@ -0,0 +1,64 @@
1
+ /**
2
+ * useGamepad — Hook for gamepad/controller support
3
+ *
4
+ * Supports Xbox, PlayStation, and generic controllers.
5
+ * Provides button mapping, axis input, and action binding.
6
+ */
7
+ export type GamepadButton = 'A' | 'B' | 'X' | 'Y' | 'LB' | 'RB' | 'LT' | 'RT' | 'Back' | 'Start' | 'LS' | 'RS' | 'DpadUp' | 'DpadDown' | 'DpadLeft' | 'DpadRight' | 'Home';
8
+ export type GamepadAxis = 'LeftX' | 'LeftY' | 'RightX' | 'RightY';
9
+ export interface GamepadState {
10
+ connected: boolean;
11
+ id: string;
12
+ buttons: Record<GamepadButton, boolean>;
13
+ axes: Record<GamepadAxis, number>;
14
+ leftTrigger: number;
15
+ rightTrigger: number;
16
+ vibrate: (duration: number, weakMagnitude?: number, strongMagnitude?: number) => void;
17
+ }
18
+ export interface GamepadAction {
19
+ button?: GamepadButton;
20
+ buttons?: GamepadButton[];
21
+ axis?: GamepadAxis;
22
+ axisDirection?: 'positive' | 'negative';
23
+ trigger?: 'LT' | 'RT';
24
+ onPress?: () => void;
25
+ onRelease?: () => void;
26
+ onHold?: () => void;
27
+ onAxisChange?: (value: number) => void;
28
+ repeatDelay?: number;
29
+ repeatRate?: number;
30
+ }
31
+ export interface UseGamepadOptions {
32
+ /** Gamepad index to use (default: 0) */
33
+ index?: number;
34
+ /** Deadzone for analog sticks (default: 0.15) */
35
+ deadzone?: number;
36
+ /** Polling rate in ms (default: 16 = ~60fps) */
37
+ pollRate?: number;
38
+ /** Action bindings */
39
+ actions?: Record<string, GamepadAction>;
40
+ /** Enable/disable (default: true) */
41
+ enabled?: boolean;
42
+ }
43
+ export declare const PS_BUTTON_ALIASES: Record<string, GamepadButton>;
44
+ export declare function useGamepad(options?: UseGamepadOptions): GamepadState;
45
+ export interface NavigationActions {
46
+ onNavigateUp?: () => void;
47
+ onNavigateDown?: () => void;
48
+ onNavigateLeft?: () => void;
49
+ onNavigateRight?: () => void;
50
+ onConfirm?: () => void;
51
+ onCancel?: () => void;
52
+ onTabNext?: () => void;
53
+ onTabPrev?: () => void;
54
+ onMenu?: () => void;
55
+ }
56
+ /** Create standard UI navigation action map */
57
+ export declare function createNavigationActions(handlers: NavigationActions): Record<string, GamepadAction>;
58
+ export interface GamepadIndicatorProps {
59
+ connected: boolean;
60
+ id?: string;
61
+ showId?: boolean;
62
+ }
63
+ /** Simple indicator showing gamepad connection status */
64
+ export declare const GamepadIndicator: ({ connected, id, showId }: GamepadIndicatorProps) => import("react/jsx-runtime").JSX.Element | null;