@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,511 @@
1
+ 'use strict';
2
+
3
+ var vectorEditorTypes = require('./vectorEditorTypes.js');
4
+
5
+ /**
6
+ * Boolean operations for vector shapes
7
+ * Implements union, difference, intersection, and exclusion operations
8
+ */
9
+ /* ────────────────────────────────────────────────────────────────
10
+ SHAPE TO PATH CONVERSION
11
+ ──────────────────────────────────────────────────────────────── */
12
+ /** Convert VShape to array of points representing its outline */
13
+ function shapeToPolygon(shape, resolution = 32) {
14
+ const cx = shape.x + shape.w / 2;
15
+ const cy = shape.y + shape.h / 2;
16
+ const rx = shape.w / 2;
17
+ const ry = shape.h / 2;
18
+ switch (shape.type) {
19
+ case "rect":
20
+ case "roundrect":
21
+ // For roundrect, we approximate with more points at corners
22
+ if (shape.type === "roundrect" && shape.rx) {
23
+ return roundRectToPolygon(shape.x, shape.y, shape.w, shape.h, shape.rx, resolution);
24
+ }
25
+ return [
26
+ { x: shape.x, y: shape.y },
27
+ { x: shape.x + shape.w, y: shape.y },
28
+ { x: shape.x + shape.w, y: shape.y + shape.h },
29
+ { x: shape.x, y: shape.y + shape.h },
30
+ ];
31
+ case "ellipse":
32
+ const ellipsePts = [];
33
+ for (let i = 0; i < resolution; i++) {
34
+ const angle = (2 * Math.PI * i) / resolution;
35
+ ellipsePts.push({
36
+ x: cx + rx * Math.cos(angle),
37
+ y: cy + ry * Math.sin(angle),
38
+ });
39
+ }
40
+ return ellipsePts;
41
+ case "polygon":
42
+ const sides = shape.sides || 6;
43
+ const polygonPts = [];
44
+ const r = Math.min(rx, ry);
45
+ for (let i = 0; i < sides; i++) {
46
+ const angle = (2 * Math.PI * i) / sides - Math.PI / 2 + (shape.rotation * Math.PI) / 180;
47
+ polygonPts.push({
48
+ x: cx + r * Math.cos(angle),
49
+ y: cy + r * Math.sin(angle),
50
+ });
51
+ }
52
+ return polygonPts;
53
+ case "star":
54
+ const points = shape.sides || 5;
55
+ const innerR = (shape.innerRadius || 0.4) * Math.min(rx, ry);
56
+ const outerR = Math.min(rx, ry);
57
+ const starPts = [];
58
+ for (let i = 0; i < points * 2; i++) {
59
+ const angle = (Math.PI * i) / points - Math.PI / 2 + (shape.rotation * Math.PI) / 180;
60
+ const rad = i % 2 === 0 ? outerR : innerR;
61
+ starPts.push({
62
+ x: cx + rad * Math.cos(angle),
63
+ y: cy + rad * Math.sin(angle),
64
+ });
65
+ }
66
+ return starPts;
67
+ case "polyline":
68
+ return shape.points || [];
69
+ default:
70
+ // For line, arrow, text - return bounding box
71
+ return [
72
+ { x: shape.x, y: shape.y },
73
+ { x: shape.x + shape.w, y: shape.y },
74
+ { x: shape.x + shape.w, y: shape.y + shape.h },
75
+ { x: shape.x, y: shape.y + shape.h },
76
+ ];
77
+ }
78
+ }
79
+ /** Generate rounded rectangle polygon */
80
+ function roundRectToPolygon(x, y, w, h, radius, resolution) {
81
+ const r = Math.min(radius, w / 2, h / 2);
82
+ const pts = [];
83
+ const cornerRes = Math.max(4, Math.floor(resolution / 4));
84
+ // Top-right corner
85
+ for (let i = 0; i <= cornerRes; i++) {
86
+ const angle = -Math.PI / 2 + (Math.PI / 2) * (i / cornerRes);
87
+ pts.push({
88
+ x: x + w - r + r * Math.cos(angle),
89
+ y: y + r + r * Math.sin(angle),
90
+ });
91
+ }
92
+ // Bottom-right corner
93
+ for (let i = 0; i <= cornerRes; i++) {
94
+ const angle = 0 + (Math.PI / 2) * (i / cornerRes);
95
+ pts.push({
96
+ x: x + w - r + r * Math.cos(angle),
97
+ y: y + h - r + r * Math.sin(angle),
98
+ });
99
+ }
100
+ // Bottom-left corner
101
+ for (let i = 0; i <= cornerRes; i++) {
102
+ const angle = Math.PI / 2 + (Math.PI / 2) * (i / cornerRes);
103
+ pts.push({
104
+ x: x + r + r * Math.cos(angle),
105
+ y: y + h - r + r * Math.sin(angle),
106
+ });
107
+ }
108
+ // Top-left corner
109
+ for (let i = 0; i <= cornerRes; i++) {
110
+ const angle = Math.PI + (Math.PI / 2) * (i / cornerRes);
111
+ pts.push({
112
+ x: x + r + r * Math.cos(angle),
113
+ y: y + r + r * Math.sin(angle),
114
+ });
115
+ }
116
+ return pts;
117
+ }
118
+ /* ────────────────────────────────────────────────────────────────
119
+ POLYGON UTILITIES
120
+ ──────────────────────────────────────────────────────────────── */
121
+ /** Check if point is inside polygon using ray casting */
122
+ function pointInPolygon(pt, polygon) {
123
+ let inside = false;
124
+ const n = polygon.length;
125
+ for (let i = 0, j = n - 1; i < n; j = i++) {
126
+ const xi = polygon[i].x, yi = polygon[i].y;
127
+ const xj = polygon[j].x, yj = polygon[j].y;
128
+ if (((yi > pt.y) !== (yj > pt.y)) &&
129
+ (pt.x < (xj - xi) * (pt.y - yi) / (yj - yi) + xi)) {
130
+ inside = !inside;
131
+ }
132
+ }
133
+ return inside;
134
+ }
135
+ /** Get polygon centroid */
136
+ function polygonCentroid(polygon) {
137
+ let cx = 0, cy = 0;
138
+ for (const pt of polygon) {
139
+ cx += pt.x;
140
+ cy += pt.y;
141
+ }
142
+ return { x: cx / polygon.length, y: cy / polygon.length };
143
+ }
144
+ /** Get polygon bounding box */
145
+ function polygonBounds(polygon) {
146
+ let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
147
+ for (const pt of polygon) {
148
+ minX = Math.min(minX, pt.x);
149
+ minY = Math.min(minY, pt.y);
150
+ maxX = Math.max(maxX, pt.x);
151
+ maxY = Math.max(maxY, pt.y);
152
+ }
153
+ return { minX, minY, maxX, maxY };
154
+ }
155
+ /** Calculate polygon area (signed) */
156
+ function polygonArea(polygon) {
157
+ let area = 0;
158
+ const n = polygon.length;
159
+ for (let i = 0; i < n; i++) {
160
+ const j = (i + 1) % n;
161
+ area += polygon[i].x * polygon[j].y;
162
+ area -= polygon[j].x * polygon[i].y;
163
+ }
164
+ return area / 2;
165
+ }
166
+ /** Check if two line segments intersect and return intersection point */
167
+ function lineIntersection(p1, p2, p3, p4) {
168
+ const d = (p4.y - p3.y) * (p2.x - p1.x) - (p4.x - p3.x) * (p2.y - p1.y);
169
+ if (Math.abs(d) < 1e-10)
170
+ return null;
171
+ const ua = ((p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x)) / d;
172
+ const ub = ((p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x)) / d;
173
+ if (ua < 0 || ua > 1 || ub < 0 || ub > 1)
174
+ return null;
175
+ return {
176
+ x: p1.x + ua * (p2.x - p1.x),
177
+ y: p1.y + ua * (p2.y - p1.y),
178
+ };
179
+ }
180
+ /** Find all intersection points between two polygons */
181
+ function findIntersections(polyA, polyB) {
182
+ const intersections = [];
183
+ for (let i = 0; i < polyA.length; i++) {
184
+ const a1 = polyA[i];
185
+ const a2 = polyA[(i + 1) % polyA.length];
186
+ for (let j = 0; j < polyB.length; j++) {
187
+ const b1 = polyB[j];
188
+ const b2 = polyB[(j + 1) % polyB.length];
189
+ const pt = lineIntersection(a1, a2, b1, b2);
190
+ if (pt) {
191
+ intersections.push(pt);
192
+ }
193
+ }
194
+ }
195
+ return intersections;
196
+ }
197
+ /* ────────────────────────────────────────────────────────────────
198
+ SUTHERLAND-HODGMAN CLIPPING (for intersection)
199
+ ──────────────────────────────────────────────────────────────── */
200
+ /** Clip polygon against a single edge using Sutherland-Hodgman */
201
+ function clipPolygonEdge(polygon, edgeStart, edgeEnd) {
202
+ if (polygon.length === 0)
203
+ return [];
204
+ const output = [];
205
+ const n = polygon.length;
206
+ // Check which side of edge a point is on
207
+ const inside = (p) => {
208
+ return (edgeEnd.x - edgeStart.x) * (p.y - edgeStart.y) -
209
+ (edgeEnd.y - edgeStart.y) * (p.x - edgeStart.x) >= 0;
210
+ };
211
+ for (let i = 0; i < n; i++) {
212
+ const curr = polygon[i];
213
+ const prev = polygon[(i + n - 1) % n];
214
+ const currInside = inside(curr);
215
+ const prevInside = inside(prev);
216
+ if (currInside) {
217
+ if (!prevInside) {
218
+ // Entering - add intersection
219
+ const pt = lineIntersection(prev, curr, edgeStart, edgeEnd);
220
+ if (pt)
221
+ output.push(pt);
222
+ }
223
+ output.push(curr);
224
+ }
225
+ else if (prevInside) {
226
+ // Leaving - add intersection
227
+ const pt = lineIntersection(prev, curr, edgeStart, edgeEnd);
228
+ if (pt)
229
+ output.push(pt);
230
+ }
231
+ }
232
+ return output;
233
+ }
234
+ /** Clip subject polygon by clip polygon using Sutherland-Hodgman */
235
+ function clipPolygon(subject, clip) {
236
+ let output = [...subject];
237
+ for (let i = 0; i < clip.length; i++) {
238
+ if (output.length === 0)
239
+ break;
240
+ const edgeStart = clip[i];
241
+ const edgeEnd = clip[(i + 1) % clip.length];
242
+ output = clipPolygonEdge(output, edgeStart, edgeEnd);
243
+ }
244
+ return output;
245
+ }
246
+ /* ────────────────────────────────────────────────────────────────
247
+ BOOLEAN OPERATIONS
248
+ ──────────────────────────────────────────────────────────────── */
249
+ /** Union of two polygons (approximation using convex hull on combined points + edge walking) */
250
+ function unionPolygons(polyA, polyB) {
251
+ // Simple approach: collect vertices from both polygons that are outside the other
252
+ // plus intersection points, then create convex hull or walk the outline
253
+ const result = [];
254
+ // Add points from A that are outside B or on the boundary
255
+ for (const pt of polyA) {
256
+ if (!pointInPolygon(pt, polyB)) {
257
+ result.push(pt);
258
+ }
259
+ }
260
+ // Add points from B that are outside A
261
+ for (const pt of polyB) {
262
+ if (!pointInPolygon(pt, polyA)) {
263
+ result.push(pt);
264
+ }
265
+ }
266
+ // Add intersection points
267
+ result.push(...findIntersections(polyA, polyB));
268
+ if (result.length < 3) {
269
+ // One polygon is inside the other - return the larger one
270
+ const areaA = Math.abs(polygonArea(polyA));
271
+ const areaB = Math.abs(polygonArea(polyB));
272
+ return areaA > areaB ? [...polyA] : [...polyB];
273
+ }
274
+ // Create convex hull of all points
275
+ return convexHull(result);
276
+ }
277
+ /** Intersection of two polygons */
278
+ function intersectPolygons(polyA, polyB) {
279
+ // Use Sutherland-Hodgman clipping
280
+ // Ensure polygons are counterclockwise
281
+ const areaA = polygonArea(polyA);
282
+ const areaB = polygonArea(polyB);
283
+ const normA = areaA < 0 ? [...polyA].reverse() : polyA;
284
+ const normB = areaB < 0 ? [...polyB].reverse() : polyB;
285
+ return clipPolygon(normA, normB);
286
+ }
287
+ /** Difference: A - B */
288
+ function differencePolygons(polyA, polyB) {
289
+ // Simple approach: A minus B
290
+ // Get points from A that are outside B
291
+ const result = [];
292
+ for (const pt of polyA) {
293
+ if (!pointInPolygon(pt, polyB)) {
294
+ result.push(pt);
295
+ }
296
+ }
297
+ // Add intersection points
298
+ const intersections = findIntersections(polyA, polyB);
299
+ result.push(...intersections);
300
+ if (result.length < 3) {
301
+ // B completely covers A
302
+ return [];
303
+ }
304
+ // Sort points to form proper polygon
305
+ return sortPolygonPoints(result);
306
+ }
307
+ /** XOR / Exclusion: (A ∪ B) - (A ∩ B) */
308
+ function exclusionPolygons(polyA, polyB) {
309
+ // Returns potentially multiple polygons
310
+ const intersection = intersectPolygons(polyA, polyB);
311
+ if (intersection.length < 3) {
312
+ // No overlap, return both
313
+ return [polyA, polyB];
314
+ }
315
+ // Return difference of each with intersection
316
+ const diffA = differencePolygons(polyA, polyB);
317
+ const diffB = differencePolygons(polyB, polyA);
318
+ const results = [];
319
+ if (diffA.length >= 3)
320
+ results.push(diffA);
321
+ if (diffB.length >= 3)
322
+ results.push(diffB);
323
+ return results;
324
+ }
325
+ /** Sort polygon points in CCW order around centroid */
326
+ function sortPolygonPoints(points) {
327
+ if (points.length < 3)
328
+ return points;
329
+ const center = polygonCentroid(points);
330
+ return [...points].sort((a, b) => {
331
+ const angleA = Math.atan2(a.y - center.y, a.x - center.x);
332
+ const angleB = Math.atan2(b.y - center.y, b.x - center.x);
333
+ return angleA - angleB;
334
+ });
335
+ }
336
+ /** Compute convex hull using Graham scan */
337
+ function convexHull(points) {
338
+ if (points.length < 3)
339
+ return points;
340
+ // Find bottom-most point
341
+ let start = 0;
342
+ for (let i = 1; i < points.length; i++) {
343
+ if (points[i].y < points[start].y ||
344
+ (points[i].y === points[start].y && points[i].x < points[start].x)) {
345
+ start = i;
346
+ }
347
+ }
348
+ const pivot = points[start];
349
+ // Sort by polar angle
350
+ const sorted = points
351
+ .filter((_, i) => i !== start)
352
+ .map(p => ({
353
+ point: p,
354
+ angle: Math.atan2(p.y - pivot.y, p.x - pivot.x),
355
+ dist: Math.hypot(p.x - pivot.x, p.y - pivot.y),
356
+ }))
357
+ .sort((a, b) => a.angle - b.angle || a.dist - b.dist)
358
+ .map(p => p.point);
359
+ // Graham scan
360
+ const hull = [pivot];
361
+ for (const pt of sorted) {
362
+ while (hull.length > 1) {
363
+ const a = hull[hull.length - 2];
364
+ const b = hull[hull.length - 1];
365
+ const cross = (b.x - a.x) * (pt.y - a.y) - (b.y - a.y) * (pt.x - a.x);
366
+ if (cross > 0)
367
+ break;
368
+ hull.pop();
369
+ }
370
+ hull.push(pt);
371
+ }
372
+ return hull;
373
+ }
374
+ /* ────────────────────────────────────────────────────────────────
375
+ PUBLIC API
376
+ ──────────────────────────────────────────────────────────────── */
377
+ /** Perform boolean operation on two shapes */
378
+ function booleanOperation(shapeA, shapeB, operation) {
379
+ const polyA = shapeToPolygon(shapeA);
380
+ const polyB = shapeToPolygon(shapeB);
381
+ let resultPolygons;
382
+ switch (operation) {
383
+ case "union":
384
+ resultPolygons = [unionPolygons(polyA, polyB)];
385
+ break;
386
+ case "intersection":
387
+ const intersection = intersectPolygons(polyA, polyB);
388
+ if (intersection.length < 3)
389
+ return null;
390
+ resultPolygons = [intersection];
391
+ break;
392
+ case "difference":
393
+ const difference = differencePolygons(polyA, polyB);
394
+ if (difference.length < 3)
395
+ return null;
396
+ resultPolygons = [difference];
397
+ break;
398
+ case "exclusion":
399
+ resultPolygons = exclusionPolygons(polyA, polyB);
400
+ if (resultPolygons.length === 0)
401
+ return null;
402
+ break;
403
+ default:
404
+ return null;
405
+ }
406
+ // Convert resulting polygons back to VShapes
407
+ const shapes = resultPolygons
408
+ .filter(poly => poly.length >= 3)
409
+ .map(poly => polygonToShape(poly, shapeA));
410
+ if (shapes.length === 0)
411
+ return null;
412
+ if (shapes.length === 1)
413
+ return shapes[0];
414
+ return shapes;
415
+ }
416
+ /** Convert polygon points back to a VShape */
417
+ function polygonToShape(polygon, template) {
418
+ const bounds = polygonBounds(polygon);
419
+ return {
420
+ id: vectorEditorTypes.sid(),
421
+ type: "polyline",
422
+ x: bounds.minX,
423
+ y: bounds.minY,
424
+ w: bounds.maxX - bounds.minX,
425
+ h: bounds.maxY - bounds.minY,
426
+ points: polygon.map(pt => ({
427
+ x: pt.x - bounds.minX,
428
+ y: pt.y - bounds.minY,
429
+ })),
430
+ fill: template.fill,
431
+ stroke: template.stroke,
432
+ strokeWidth: template.strokeWidth,
433
+ opacity: template.opacity,
434
+ rotation: 0,
435
+ };
436
+ }
437
+ /** Check if two shapes overlap */
438
+ function shapesOverlap(shapeA, shapeB) {
439
+ const polyA = shapeToPolygon(shapeA);
440
+ const polyB = shapeToPolygon(shapeB);
441
+ // Check if any point of A is inside B
442
+ for (const pt of polyA) {
443
+ if (pointInPolygon(pt, polyB))
444
+ return true;
445
+ }
446
+ // Check if any point of B is inside A
447
+ for (const pt of polyB) {
448
+ if (pointInPolygon(pt, polyA))
449
+ return true;
450
+ }
451
+ // Check for edge intersections
452
+ return findIntersections(polyA, polyB).length > 0;
453
+ }
454
+ /** Flatten a polyline to individual segment shapes (for outline stroke) */
455
+ function flattenToOutline(shape, strokeWidth) {
456
+ const sw = strokeWidth !== null && strokeWidth !== void 0 ? strokeWidth : shape.strokeWidth;
457
+ const points = shape.points || shapeToPolygon(shape);
458
+ // Create offset outline
459
+ const halfW = sw / 2;
460
+ const outer = [];
461
+ const inner = [];
462
+ for (let i = 0; i < points.length; i++) {
463
+ const curr = points[i];
464
+ const prev = points[(i + points.length - 1) % points.length];
465
+ const next = points[(i + 1) % points.length];
466
+ // Calculate perpendicular direction
467
+ const dx1 = curr.x - prev.x;
468
+ const dy1 = curr.y - prev.y;
469
+ const dx2 = next.x - curr.x;
470
+ const dy2 = next.y - curr.y;
471
+ // Average normal
472
+ const len1 = Math.hypot(dx1, dy1) || 1;
473
+ const len2 = Math.hypot(dx2, dy2) || 1;
474
+ const nx = (-dy1 / len1 - dy2 / len2) / 2;
475
+ const ny = (dx1 / len1 + dx2 / len2) / 2;
476
+ const nlen = Math.hypot(nx, ny) || 1;
477
+ outer.push({
478
+ x: curr.x + (nx / nlen) * halfW,
479
+ y: curr.y + (ny / nlen) * halfW,
480
+ });
481
+ inner.push({
482
+ x: curr.x - (nx / nlen) * halfW,
483
+ y: curr.y - (ny / nlen) * halfW,
484
+ });
485
+ }
486
+ // Combine outer + reversed inner
487
+ const outline = [...outer, ...inner.reverse()];
488
+ const bounds = polygonBounds(outline);
489
+ return {
490
+ id: vectorEditorTypes.sid(),
491
+ type: "polyline",
492
+ x: bounds.minX,
493
+ y: bounds.minY,
494
+ w: bounds.maxX - bounds.minX,
495
+ h: bounds.maxY - bounds.minY,
496
+ points: outline.map(pt => ({
497
+ x: pt.x - bounds.minX,
498
+ y: pt.y - bounds.minY,
499
+ })),
500
+ fill: shape.stroke, // Fill with original stroke color
501
+ stroke: "transparent",
502
+ strokeWidth: 0,
503
+ opacity: shape.opacity,
504
+ rotation: 0,
505
+ };
506
+ }
507
+
508
+ exports.booleanOperation = booleanOperation;
509
+ exports.flattenToOutline = flattenToOutline;
510
+ exports.shapesOverlap = shapesOverlap;
511
+ //# sourceMappingURL=vectorBooleanOps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vectorBooleanOps.js","sources":["../../../src/vector/vectorBooleanOps.ts"],"sourcesContent":[null],"names":["sid"],"mappings":";;;;AAAA;;;AAGG;AAcH;;AAEmE;AAEnE;AACA,SAAS,cAAc,CAAC,KAAa,EAAE,aAAqB,EAAE,EAAA;IAC5D,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC;IAChC,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC;AAChC,IAAA,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC;AACtB,IAAA,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC;AAEtB,IAAA,QAAQ,KAAK,CAAC,IAAI;AAChB,QAAA,KAAK,MAAM;AACX,QAAA,KAAK,WAAW;;YAEd,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,IAAI,KAAK,CAAC,EAAE,EAAE;gBAC1C,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,UAAU,CAAC;YACrF;YACA,OAAO;gBACL,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE;AAC1B,gBAAA,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE;AACpC,gBAAA,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,C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