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