fabric 7.0.0-beta1 → 7.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 (503) hide show
  1. package/CHANGELOG.md +56 -1
  2. package/CONTRIBUTING.md +59 -135
  3. package/CONTRIBUTOR_LADDER.md +124 -0
  4. package/LICENSE +7 -1
  5. package/README.md +9 -24
  6. package/SECURITY.md +6 -2
  7. package/dist/extensions/aligning_guidelines/index.d.ts +49 -4
  8. package/dist/extensions/aligning_guidelines/index.d.ts.map +1 -1
  9. package/dist/extensions/aligning_guidelines/typedefs.d.ts +30 -21
  10. package/dist/extensions/aligning_guidelines/typedefs.d.ts.map +1 -1
  11. package/dist/extensions/aligning_guidelines/util/basic.d.ts +7 -1
  12. package/dist/extensions/aligning_guidelines/util/basic.d.ts.map +1 -1
  13. package/dist/extensions/aligning_guidelines/util/collect-line.d.ts +6 -11
  14. package/dist/extensions/aligning_guidelines/util/collect-line.d.ts.map +1 -1
  15. package/dist/extensions/aligning_guidelines/util/collect-point.d.ts +16 -12
  16. package/dist/extensions/aligning_guidelines/util/collect-point.d.ts.map +1 -1
  17. package/dist/extensions/aligning_guidelines/util/draw.d.ts +7 -5
  18. package/dist/extensions/aligning_guidelines/util/draw.d.ts.map +1 -1
  19. package/dist/extensions/index.d.ts +4 -2
  20. package/dist/extensions/index.d.ts.map +1 -1
  21. package/dist/extensions/westures_integration/index.d.ts +16 -0
  22. package/dist/extensions/westures_integration/index.d.ts.map +1 -0
  23. package/dist/index.js +322 -230
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.min.js +1 -1
  26. package/dist/index.min.js.map +1 -1
  27. package/dist/index.min.mjs +1 -1
  28. package/dist/index.min.mjs.map +1 -1
  29. package/dist/index.mjs +322 -230
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/index.node.cjs +322 -230
  32. package/dist/index.node.cjs.map +1 -1
  33. package/dist/index.node.d.ts.map +1 -1
  34. package/dist/index.node.mjs +322 -230
  35. package/dist/index.node.mjs.map +1 -1
  36. package/dist/package.json.min.mjs +1 -1
  37. package/dist/package.json.mjs +1 -1
  38. package/dist/src/EventTypeDefs.d.ts +5 -1
  39. package/dist/src/EventTypeDefs.d.ts.map +1 -1
  40. package/dist/src/Intersection.d.ts +1 -2
  41. package/dist/src/Intersection.d.ts.map +1 -1
  42. package/dist/src/Intersection.min.mjs.map +1 -1
  43. package/dist/src/Intersection.mjs +1 -2
  44. package/dist/src/Intersection.mjs.map +1 -1
  45. package/dist/src/Observable.d.ts +2 -2
  46. package/dist/src/Observable.min.mjs.map +1 -1
  47. package/dist/src/Observable.mjs +2 -2
  48. package/dist/src/Observable.mjs.map +1 -1
  49. package/dist/src/Pattern/Pattern.d.ts +2 -2
  50. package/dist/src/Pattern/Pattern.min.mjs.map +1 -1
  51. package/dist/src/Pattern/Pattern.mjs +2 -2
  52. package/dist/src/Pattern/Pattern.mjs.map +1 -1
  53. package/dist/src/Point.d.ts +0 -10
  54. package/dist/src/Point.d.ts.map +1 -1
  55. package/dist/src/Point.min.mjs.map +1 -1
  56. package/dist/src/Point.mjs +0 -10
  57. package/dist/src/Point.mjs.map +1 -1
  58. package/dist/src/Shadow.d.ts +1 -1
  59. package/dist/src/Shadow.min.mjs.map +1 -1
  60. package/dist/src/Shadow.mjs +1 -1
  61. package/dist/src/Shadow.mjs.map +1 -1
  62. package/dist/src/brushes/BaseBrush.d.ts +1 -1
  63. package/dist/src/brushes/BaseBrush.min.mjs.map +1 -1
  64. package/dist/src/brushes/BaseBrush.mjs +1 -1
  65. package/dist/src/brushes/BaseBrush.mjs.map +1 -1
  66. package/dist/src/cache.d.ts +6 -4
  67. package/dist/src/cache.d.ts.map +1 -1
  68. package/dist/src/cache.min.mjs +1 -1
  69. package/dist/src/cache.min.mjs.map +1 -1
  70. package/dist/src/cache.mjs +16 -14
  71. package/dist/src/cache.mjs.map +1 -1
  72. package/dist/src/canvas/Canvas.d.ts +19 -1
  73. package/dist/src/canvas/Canvas.d.ts.map +1 -1
  74. package/dist/src/canvas/Canvas.min.mjs +1 -1
  75. package/dist/src/canvas/Canvas.min.mjs.map +1 -1
  76. package/dist/src/canvas/Canvas.mjs +65 -20
  77. package/dist/src/canvas/Canvas.mjs.map +1 -1
  78. package/dist/src/canvas/CanvasOptions.d.ts +9 -0
  79. package/dist/src/canvas/CanvasOptions.d.ts.map +1 -1
  80. package/dist/src/canvas/CanvasOptions.min.mjs +1 -1
  81. package/dist/src/canvas/CanvasOptions.min.mjs.map +1 -1
  82. package/dist/src/canvas/CanvasOptions.mjs +3 -3
  83. package/dist/src/canvas/CanvasOptions.mjs.map +1 -1
  84. package/dist/src/canvas/SelectableCanvas.d.ts +4 -4
  85. package/dist/src/canvas/SelectableCanvas.d.ts.map +1 -1
  86. package/dist/src/canvas/SelectableCanvas.min.mjs +1 -1
  87. package/dist/src/canvas/SelectableCanvas.min.mjs.map +1 -1
  88. package/dist/src/canvas/SelectableCanvas.mjs +4 -10
  89. package/dist/src/canvas/SelectableCanvas.mjs.map +1 -1
  90. package/dist/src/canvas/StaticCanvas.d.ts +10 -5
  91. package/dist/src/canvas/StaticCanvas.d.ts.map +1 -1
  92. package/dist/src/canvas/StaticCanvas.min.mjs +1 -1
  93. package/dist/src/canvas/StaticCanvas.min.mjs.map +1 -1
  94. package/dist/src/canvas/StaticCanvas.mjs +13 -7
  95. package/dist/src/canvas/StaticCanvas.mjs.map +1 -1
  96. package/dist/src/canvas/StaticCanvasOptions.d.ts.map +1 -1
  97. package/dist/src/canvas/StaticCanvasOptions.min.mjs +1 -1
  98. package/dist/src/canvas/StaticCanvasOptions.min.mjs.map +1 -1
  99. package/dist/src/canvas/StaticCanvasOptions.mjs +2 -1
  100. package/dist/src/canvas/StaticCanvasOptions.mjs.map +1 -1
  101. package/dist/src/color/Color.d.ts +1 -3
  102. package/dist/src/color/Color.d.ts.map +1 -1
  103. package/dist/src/color/Color.min.mjs +1 -1
  104. package/dist/src/color/Color.min.mjs.map +1 -1
  105. package/dist/src/color/Color.mjs +4 -5
  106. package/dist/src/color/Color.mjs.map +1 -1
  107. package/dist/src/color/constants.d.ts +26 -20
  108. package/dist/src/color/constants.d.ts.map +1 -1
  109. package/dist/src/color/constants.min.mjs +1 -1
  110. package/dist/src/color/constants.min.mjs.map +1 -1
  111. package/dist/src/color/constants.mjs +28 -22
  112. package/dist/src/color/constants.mjs.map +1 -1
  113. package/dist/src/constants.d.ts +3 -0
  114. package/dist/src/constants.d.ts.map +1 -1
  115. package/dist/src/constants.min.mjs +1 -1
  116. package/dist/src/constants.min.mjs.map +1 -1
  117. package/dist/src/constants.mjs +4 -1
  118. package/dist/src/constants.mjs.map +1 -1
  119. package/dist/src/controls/rotate.d.ts.map +1 -1
  120. package/dist/src/controls/rotate.min.mjs +1 -1
  121. package/dist/src/controls/rotate.min.mjs.map +1 -1
  122. package/dist/src/controls/rotate.mjs +1 -1
  123. package/dist/src/controls/rotate.mjs.map +1 -1
  124. package/dist/src/controls/wrapWithFixedAnchor.d.ts.map +1 -1
  125. package/dist/src/controls/wrapWithFixedAnchor.min.mjs +1 -1
  126. package/dist/src/controls/wrapWithFixedAnchor.min.mjs.map +1 -1
  127. package/dist/src/controls/wrapWithFixedAnchor.mjs +1 -2
  128. package/dist/src/controls/wrapWithFixedAnchor.mjs.map +1 -1
  129. package/dist/src/filters/ColorMatrix.d.ts +2 -2
  130. package/dist/src/filters/ColorMatrix.min.mjs.map +1 -1
  131. package/dist/src/filters/ColorMatrix.mjs +2 -2
  132. package/dist/src/filters/ColorMatrix.mjs.map +1 -1
  133. package/dist/src/filters/WebGLFilterBackend.d.ts.map +1 -1
  134. package/dist/src/filters/WebGLFilterBackend.min.mjs.map +1 -1
  135. package/dist/src/filters/WebGLFilterBackend.mjs +2 -0
  136. package/dist/src/filters/WebGLFilterBackend.mjs.map +1 -1
  137. package/dist/src/gradient/Gradient.d.ts +1 -1
  138. package/dist/src/gradient/Gradient.min.mjs.map +1 -1
  139. package/dist/src/gradient/Gradient.mjs +1 -1
  140. package/dist/src/gradient/Gradient.mjs.map +1 -1
  141. package/dist/src/gradient/parser/parseCoords.d.ts.map +1 -1
  142. package/dist/src/gradient/parser/parseCoords.min.mjs +1 -1
  143. package/dist/src/gradient/parser/parseCoords.min.mjs.map +1 -1
  144. package/dist/src/gradient/parser/parseCoords.mjs +5 -4
  145. package/dist/src/gradient/parser/parseCoords.mjs.map +1 -1
  146. package/dist/src/parser/parseFontDeclaration.d.ts +0 -2
  147. package/dist/src/parser/parseFontDeclaration.d.ts.map +1 -1
  148. package/dist/src/parser/parseFontDeclaration.min.mjs +1 -1
  149. package/dist/src/parser/parseFontDeclaration.min.mjs.map +1 -1
  150. package/dist/src/parser/parseFontDeclaration.mjs +2 -3
  151. package/dist/src/parser/parseFontDeclaration.mjs.map +1 -1
  152. package/dist/src/parser/parsePointsAttribute.d.ts +0 -1
  153. package/dist/src/parser/parsePointsAttribute.d.ts.map +1 -1
  154. package/dist/src/parser/parsePointsAttribute.min.mjs.map +1 -1
  155. package/dist/src/parser/parsePointsAttribute.mjs +0 -1
  156. package/dist/src/parser/parsePointsAttribute.mjs.map +1 -1
  157. package/dist/src/parser/parseSVGDocument.d.ts +0 -2
  158. package/dist/src/parser/parseSVGDocument.d.ts.map +1 -1
  159. package/dist/src/parser/parseSVGDocument.min.mjs.map +1 -1
  160. package/dist/src/parser/parseSVGDocument.mjs +0 -2
  161. package/dist/src/parser/parseSVGDocument.mjs.map +1 -1
  162. package/dist/src/parser/parseStyleAttribute.d.ts +0 -1
  163. package/dist/src/parser/parseStyleAttribute.d.ts.map +1 -1
  164. package/dist/src/parser/parseStyleAttribute.min.mjs.map +1 -1
  165. package/dist/src/parser/parseStyleAttribute.mjs +0 -1
  166. package/dist/src/parser/parseStyleAttribute.mjs.map +1 -1
  167. package/dist/src/parser/parseTransformAttribute.d.ts +0 -2
  168. package/dist/src/parser/parseTransformAttribute.d.ts.map +1 -1
  169. package/dist/src/parser/parseTransformAttribute.min.mjs.map +1 -1
  170. package/dist/src/parser/parseTransformAttribute.mjs +0 -2
  171. package/dist/src/parser/parseTransformAttribute.mjs.map +1 -1
  172. package/dist/src/parser/percent.d.ts +7 -2
  173. package/dist/src/parser/percent.d.ts.map +1 -1
  174. package/dist/src/parser/percent.min.mjs +1 -1
  175. package/dist/src/parser/percent.min.mjs.map +1 -1
  176. package/dist/src/parser/percent.mjs +9 -4
  177. package/dist/src/parser/percent.mjs.map +1 -1
  178. package/dist/src/shapes/Group.d.ts.map +1 -1
  179. package/dist/src/shapes/IText/IText.d.ts.map +1 -1
  180. package/dist/src/shapes/IText/IText.min.mjs +1 -1
  181. package/dist/src/shapes/IText/IText.min.mjs.map +1 -1
  182. package/dist/src/shapes/IText/IText.mjs +26 -18
  183. package/dist/src/shapes/IText/IText.mjs.map +1 -1
  184. package/dist/src/shapes/IText/ITextBehavior.d.ts +3 -0
  185. package/dist/src/shapes/IText/ITextBehavior.d.ts.map +1 -1
  186. package/dist/src/shapes/IText/ITextBehavior.min.mjs +1 -1
  187. package/dist/src/shapes/IText/ITextBehavior.min.mjs.map +1 -1
  188. package/dist/src/shapes/IText/ITextBehavior.mjs +22 -6
  189. package/dist/src/shapes/IText/ITextBehavior.mjs.map +1 -1
  190. package/dist/src/shapes/IText/ITextKeyBehavior.d.ts.map +1 -1
  191. package/dist/src/shapes/IText/ITextKeyBehavior.min.mjs +1 -1
  192. package/dist/src/shapes/IText/ITextKeyBehavior.min.mjs.map +1 -1
  193. package/dist/src/shapes/IText/ITextKeyBehavior.mjs +2 -1
  194. package/dist/src/shapes/IText/ITextKeyBehavior.mjs.map +1 -1
  195. package/dist/src/shapes/Image.d.ts +12 -12
  196. package/dist/src/shapes/Image.d.ts.map +1 -1
  197. package/dist/src/shapes/Image.min.mjs.map +1 -1
  198. package/dist/src/shapes/Image.mjs +1 -2
  199. package/dist/src/shapes/Image.mjs.map +1 -1
  200. package/dist/src/shapes/Line.d.ts +0 -1
  201. package/dist/src/shapes/Line.d.ts.map +1 -1
  202. package/dist/src/shapes/Line.min.mjs.map +1 -1
  203. package/dist/src/shapes/Line.mjs +0 -1
  204. package/dist/src/shapes/Line.mjs.map +1 -1
  205. package/dist/src/shapes/Object/InteractiveObject.d.ts +1 -1
  206. package/dist/src/shapes/Object/InteractiveObject.min.mjs.map +1 -1
  207. package/dist/src/shapes/Object/InteractiveObject.mjs +1 -1
  208. package/dist/src/shapes/Object/InteractiveObject.mjs.map +1 -1
  209. package/dist/src/shapes/Object/Object.d.ts +4 -2
  210. package/dist/src/shapes/Object/Object.d.ts.map +1 -1
  211. package/dist/src/shapes/Object/Object.min.mjs +1 -1
  212. package/dist/src/shapes/Object/Object.min.mjs.map +1 -1
  213. package/dist/src/shapes/Object/Object.mjs +5 -3
  214. package/dist/src/shapes/Object/Object.mjs.map +1 -1
  215. package/dist/src/shapes/Object/ObjectGeometry.d.ts +30 -18
  216. package/dist/src/shapes/Object/ObjectGeometry.d.ts.map +1 -1
  217. package/dist/src/shapes/Object/ObjectGeometry.min.mjs +1 -1
  218. package/dist/src/shapes/Object/ObjectGeometry.min.mjs.map +1 -1
  219. package/dist/src/shapes/Object/ObjectGeometry.mjs +37 -19
  220. package/dist/src/shapes/Object/ObjectGeometry.mjs.map +1 -1
  221. package/dist/src/shapes/Object/defaultValues.d.ts.map +1 -1
  222. package/dist/src/shapes/Object/defaultValues.min.mjs +1 -1
  223. package/dist/src/shapes/Object/defaultValues.min.mjs.map +1 -1
  224. package/dist/src/shapes/Object/defaultValues.mjs +3 -3
  225. package/dist/src/shapes/Object/defaultValues.mjs.map +1 -1
  226. package/dist/src/shapes/Object/types/BaseProps.d.ts +2 -2
  227. package/dist/src/shapes/Text/Text.d.ts +20 -7
  228. package/dist/src/shapes/Text/Text.d.ts.map +1 -1
  229. package/dist/src/shapes/Text/Text.min.mjs +1 -1
  230. package/dist/src/shapes/Text/Text.min.mjs.map +1 -1
  231. package/dist/src/shapes/Text/Text.mjs +52 -44
  232. package/dist/src/shapes/Text/Text.mjs.map +1 -1
  233. package/dist/src/shapes/Text/constants.min.mjs +1 -1
  234. package/dist/src/shapes/Text/constants.min.mjs.map +1 -1
  235. package/dist/src/shapes/Text/constants.mjs +4 -4
  236. package/dist/src/shapes/Text/constants.mjs.map +1 -1
  237. package/dist/src/shapes/Textbox.d.ts +0 -1
  238. package/dist/src/shapes/Textbox.d.ts.map +1 -1
  239. package/dist/src/shapes/Textbox.min.mjs.map +1 -1
  240. package/dist/src/shapes/Textbox.mjs +0 -1
  241. package/dist/src/shapes/Textbox.mjs.map +1 -1
  242. package/dist/src/typedefs.d.ts +1 -1
  243. package/dist/src/util/internals/cleanupSvgAttribute.d.ts.map +1 -1
  244. package/dist/src/util/internals/cleanupSvgAttribute.min.mjs +1 -1
  245. package/dist/src/util/internals/cleanupSvgAttribute.min.mjs.map +1 -1
  246. package/dist/src/util/internals/cleanupSvgAttribute.mjs +3 -2
  247. package/dist/src/util/internals/cleanupSvgAttribute.mjs.map +1 -1
  248. package/dist/src/util/internals/normalizeWhiteSpace.d.ts +2 -0
  249. package/dist/src/util/internals/normalizeWhiteSpace.d.ts.map +1 -0
  250. package/dist/src/util/internals/normalizeWhiteSpace.min.mjs +2 -0
  251. package/dist/src/util/internals/normalizeWhiteSpace.min.mjs.map +1 -0
  252. package/dist/src/util/internals/normalizeWhiteSpace.mjs +4 -0
  253. package/dist/src/util/internals/normalizeWhiteSpace.mjs.map +1 -0
  254. package/dist/src/util/misc/groupSVGElements.d.ts +0 -1
  255. package/dist/src/util/misc/groupSVGElements.d.ts.map +1 -1
  256. package/dist/src/util/misc/groupSVGElements.min.mjs.map +1 -1
  257. package/dist/src/util/misc/groupSVGElements.mjs +0 -1
  258. package/dist/src/util/misc/groupSVGElements.mjs.map +1 -1
  259. package/dist/src/util/misc/matrix.d.ts +5 -5
  260. package/dist/src/util/misc/matrix.min.mjs.map +1 -1
  261. package/dist/src/util/misc/matrix.mjs +5 -5
  262. package/dist/src/util/misc/matrix.mjs.map +1 -1
  263. package/dist/src/util/transform_matrix_removal.d.ts +2 -1
  264. package/dist/src/util/transform_matrix_removal.d.ts.map +1 -1
  265. package/dist/src/util/transform_matrix_removal.min.mjs.map +1 -1
  266. package/dist/src/util/transform_matrix_removal.mjs.map +1 -1
  267. package/dist-extensions/_virtual/_rollupPluginBabelHelpers.mjs +25 -0
  268. package/dist-extensions/_virtual/_rollupPluginBabelHelpers.mjs.map +1 -0
  269. package/dist-extensions/aligning_guidelines/index.mjs +201 -108
  270. package/dist-extensions/aligning_guidelines/index.mjs.map +1 -1
  271. package/dist-extensions/aligning_guidelines/util/basic.mjs +45 -5
  272. package/dist-extensions/aligning_guidelines/util/basic.mjs.map +1 -1
  273. package/dist-extensions/aligning_guidelines/util/collect-line.mjs +44 -170
  274. package/dist-extensions/aligning_guidelines/util/collect-line.mjs.map +1 -1
  275. package/dist-extensions/aligning_guidelines/util/collect-point.mjs +76 -67
  276. package/dist-extensions/aligning_guidelines/util/collect-point.mjs.map +1 -1
  277. package/dist-extensions/aligning_guidelines/util/draw.mjs +52 -46
  278. package/dist-extensions/aligning_guidelines/util/draw.mjs.map +1 -1
  279. package/dist-extensions/data_updaters/gradient/index.mjs +13 -2
  280. package/dist-extensions/data_updaters/gradient/index.mjs.map +1 -1
  281. package/dist-extensions/extensions/aligning_guidelines/index.d.ts +49 -4
  282. package/dist-extensions/extensions/aligning_guidelines/index.d.ts.map +1 -1
  283. package/dist-extensions/extensions/aligning_guidelines/typedefs.d.ts +30 -21
  284. package/dist-extensions/extensions/aligning_guidelines/typedefs.d.ts.map +1 -1
  285. package/dist-extensions/extensions/aligning_guidelines/util/basic.d.ts +7 -1
  286. package/dist-extensions/extensions/aligning_guidelines/util/basic.d.ts.map +1 -1
  287. package/dist-extensions/extensions/aligning_guidelines/util/collect-line.d.ts +6 -11
  288. package/dist-extensions/extensions/aligning_guidelines/util/collect-line.d.ts.map +1 -1
  289. package/dist-extensions/extensions/aligning_guidelines/util/collect-point.d.ts +16 -12
  290. package/dist-extensions/extensions/aligning_guidelines/util/collect-point.d.ts.map +1 -1
  291. package/dist-extensions/extensions/aligning_guidelines/util/draw.d.ts +7 -5
  292. package/dist-extensions/extensions/aligning_guidelines/util/draw.d.ts.map +1 -1
  293. package/dist-extensions/extensions/index.d.ts +4 -2
  294. package/dist-extensions/extensions/index.d.ts.map +1 -1
  295. package/dist-extensions/extensions/westures_integration/index.d.ts +16 -0
  296. package/dist-extensions/extensions/westures_integration/index.d.ts.map +1 -0
  297. package/dist-extensions/fabric-extensions.min.js +1 -1
  298. package/dist-extensions/fabric-extensions.min.js.map +1 -1
  299. package/dist-extensions/index.mjs +3 -2
  300. package/dist-extensions/index.mjs.map +1 -1
  301. package/dist-extensions/src/EventTypeDefs.d.ts +5 -1
  302. package/dist-extensions/src/EventTypeDefs.d.ts.map +1 -1
  303. package/dist-extensions/src/Intersection.d.ts +1 -2
  304. package/dist-extensions/src/Intersection.d.ts.map +1 -1
  305. package/dist-extensions/src/Observable.d.ts +2 -2
  306. package/dist-extensions/src/Pattern/Pattern.d.ts +2 -2
  307. package/dist-extensions/src/Point.d.ts +0 -10
  308. package/dist-extensions/src/Point.d.ts.map +1 -1
  309. package/dist-extensions/src/Shadow.d.ts +1 -1
  310. package/dist-extensions/src/brushes/BaseBrush.d.ts +1 -1
  311. package/dist-extensions/src/cache.d.ts +6 -4
  312. package/dist-extensions/src/cache.d.ts.map +1 -1
  313. package/dist-extensions/src/canvas/Canvas.d.ts +19 -1
  314. package/dist-extensions/src/canvas/Canvas.d.ts.map +1 -1
  315. package/dist-extensions/src/canvas/CanvasOptions.d.ts +9 -0
  316. package/dist-extensions/src/canvas/CanvasOptions.d.ts.map +1 -1
  317. package/dist-extensions/src/canvas/SelectableCanvas.d.ts +4 -4
  318. package/dist-extensions/src/canvas/SelectableCanvas.d.ts.map +1 -1
  319. package/dist-extensions/src/canvas/StaticCanvas.d.ts +10 -5
  320. package/dist-extensions/src/canvas/StaticCanvas.d.ts.map +1 -1
  321. package/dist-extensions/src/canvas/StaticCanvasOptions.d.ts.map +1 -1
  322. package/dist-extensions/src/color/Color.d.ts +1 -3
  323. package/dist-extensions/src/color/Color.d.ts.map +1 -1
  324. package/dist-extensions/src/color/constants.d.ts +26 -20
  325. package/dist-extensions/src/color/constants.d.ts.map +1 -1
  326. package/dist-extensions/src/constants.d.ts +3 -0
  327. package/dist-extensions/src/constants.d.ts.map +1 -1
  328. package/dist-extensions/src/controls/rotate.d.ts.map +1 -1
  329. package/dist-extensions/src/controls/wrapWithFixedAnchor.d.ts.map +1 -1
  330. package/dist-extensions/src/filters/ColorMatrix.d.ts +2 -2
  331. package/dist-extensions/src/filters/WebGLFilterBackend.d.ts.map +1 -1
  332. package/dist-extensions/src/gradient/Gradient.d.ts +1 -1
  333. package/dist-extensions/src/gradient/parser/parseCoords.d.ts.map +1 -1
  334. package/dist-extensions/src/parser/parseFontDeclaration.d.ts +0 -2
  335. package/dist-extensions/src/parser/parseFontDeclaration.d.ts.map +1 -1
  336. package/dist-extensions/src/parser/parsePointsAttribute.d.ts +0 -1
  337. package/dist-extensions/src/parser/parsePointsAttribute.d.ts.map +1 -1
  338. package/dist-extensions/src/parser/parseSVGDocument.d.ts +0 -2
  339. package/dist-extensions/src/parser/parseSVGDocument.d.ts.map +1 -1
  340. package/dist-extensions/src/parser/parseStyleAttribute.d.ts +0 -1
  341. package/dist-extensions/src/parser/parseStyleAttribute.d.ts.map +1 -1
  342. package/dist-extensions/src/parser/parseTransformAttribute.d.ts +0 -2
  343. package/dist-extensions/src/parser/parseTransformAttribute.d.ts.map +1 -1
  344. package/dist-extensions/src/parser/percent.d.ts +7 -2
  345. package/dist-extensions/src/parser/percent.d.ts.map +1 -1
  346. package/dist-extensions/src/shapes/Group.d.ts.map +1 -1
  347. package/dist-extensions/src/shapes/IText/IText.d.ts.map +1 -1
  348. package/dist-extensions/src/shapes/IText/ITextBehavior.d.ts +3 -0
  349. package/dist-extensions/src/shapes/IText/ITextBehavior.d.ts.map +1 -1
  350. package/dist-extensions/src/shapes/IText/ITextKeyBehavior.d.ts.map +1 -1
  351. package/dist-extensions/src/shapes/Image.d.ts +12 -12
  352. package/dist-extensions/src/shapes/Image.d.ts.map +1 -1
  353. package/dist-extensions/src/shapes/Line.d.ts +0 -1
  354. package/dist-extensions/src/shapes/Line.d.ts.map +1 -1
  355. package/dist-extensions/src/shapes/Object/InteractiveObject.d.ts +1 -1
  356. package/dist-extensions/src/shapes/Object/Object.d.ts +4 -2
  357. package/dist-extensions/src/shapes/Object/Object.d.ts.map +1 -1
  358. package/dist-extensions/src/shapes/Object/ObjectGeometry.d.ts +30 -18
  359. package/dist-extensions/src/shapes/Object/ObjectGeometry.d.ts.map +1 -1
  360. package/dist-extensions/src/shapes/Object/defaultValues.d.ts.map +1 -1
  361. package/dist-extensions/src/shapes/Object/types/BaseProps.d.ts +2 -2
  362. package/dist-extensions/src/shapes/Text/Text.d.ts +20 -7
  363. package/dist-extensions/src/shapes/Text/Text.d.ts.map +1 -1
  364. package/dist-extensions/src/shapes/Textbox.d.ts +0 -1
  365. package/dist-extensions/src/shapes/Textbox.d.ts.map +1 -1
  366. package/dist-extensions/src/typedefs.d.ts +1 -1
  367. package/dist-extensions/src/util/internals/cleanupSvgAttribute.d.ts.map +1 -1
  368. package/dist-extensions/src/util/internals/normalizeWhiteSpace.d.ts +2 -0
  369. package/dist-extensions/src/util/internals/normalizeWhiteSpace.d.ts.map +1 -0
  370. package/dist-extensions/src/util/misc/groupSVGElements.d.ts +0 -1
  371. package/dist-extensions/src/util/misc/groupSVGElements.d.ts.map +1 -1
  372. package/dist-extensions/src/util/misc/matrix.d.ts +5 -5
  373. package/dist-extensions/src/util/transform_matrix_removal.d.ts +2 -1
  374. package/dist-extensions/src/util/transform_matrix_removal.d.ts.map +1 -1
  375. package/dist-extensions/westures_integration/index.mjs +103 -0
  376. package/dist-extensions/westures_integration/index.mjs.map +1 -0
  377. package/eslint.config.mjs +5 -1
  378. package/extensions/aligning_guidelines/README.MD +160 -4
  379. package/extensions/aligning_guidelines/index.ts +221 -123
  380. package/extensions/aligning_guidelines/typedefs.ts +28 -23
  381. package/extensions/aligning_guidelines/util/basic.spec.ts +77 -19
  382. package/extensions/aligning_guidelines/util/basic.ts +43 -13
  383. package/extensions/aligning_guidelines/util/collect-line.ts +49 -156
  384. package/extensions/aligning_guidelines/util/collect-point.ts +97 -64
  385. package/extensions/aligning_guidelines/util/draw.ts +54 -44
  386. package/extensions/index.ts +12 -5
  387. package/extensions/types.d.ts +1 -0
  388. package/extensions/westures_integration/index.ts +133 -0
  389. package/index.node.ts +2 -3
  390. package/package.json +25 -29
  391. package/playwright.setup.ts +10 -4
  392. package/rollup.config.mjs +11 -4
  393. package/scripts/buildLock.mjs +6 -6
  394. package/scripts/colors.mjs +10 -0
  395. package/scripts/dataUpdater.mjs +350 -0
  396. package/scripts/date-time.mjs +19 -0
  397. package/scripts/dirname.mjs +1 -1
  398. package/scripts/index.mjs +10 -16
  399. package/scripts/sandbox.mjs +10 -11
  400. package/scripts/updater-reference.mjs +66 -0
  401. package/src/Collection.spec.ts +4 -4
  402. package/src/EventTypeDefs.ts +3 -2
  403. package/src/Intersection.ts +1 -2
  404. package/src/LayoutManager/LayoutManager.spec.ts +17 -8
  405. package/src/LayoutManager/__snapshots__/LayoutManager.spec.ts.snap +4 -4
  406. package/src/Observable.ts +2 -2
  407. package/src/Pattern/Pattern.ts +2 -2
  408. package/src/Point.ts +0 -10
  409. package/src/Shadow.ts +1 -1
  410. package/src/brushes/BaseBrush.ts +1 -1
  411. package/src/cache.spec.ts +25 -17
  412. package/src/cache.ts +20 -18
  413. package/src/canvas/Canvas-dispose.spec.ts +4 -2
  414. package/src/canvas/Canvas-events.spec.ts +102 -38
  415. package/src/canvas/Canvas.fixtures.ts +242 -0
  416. package/src/canvas/Canvas.spec.ts +59 -111
  417. package/src/canvas/Canvas.ts +67 -20
  418. package/src/canvas/CanvasOptions.ts +12 -3
  419. package/src/canvas/SelectableCanvas.spec.ts +7 -6
  420. package/src/canvas/SelectableCanvas.ts +5 -5
  421. package/src/canvas/StaticCanvas.fixtures.ts +292 -0
  422. package/src/canvas/StaticCanvas.spec.ts +52 -146
  423. package/src/canvas/StaticCanvas.ts +17 -15
  424. package/src/canvas/StaticCanvasOptions.ts +1 -0
  425. package/src/canvas/__tests__/eventData.test.ts +59 -55
  426. package/src/color/Color.ts +4 -5
  427. package/src/color/constants.ts +28 -22
  428. package/src/constants.ts +5 -0
  429. package/src/controls/Control-cursor.spec.ts +2 -2
  430. package/src/controls/Control-handlers.spec.ts +38 -40
  431. package/src/controls/changeWidth.test.ts +16 -16
  432. package/src/controls/rotate.ts +1 -5
  433. package/src/controls/wrapWithFixedAnchor.ts +1 -2
  434. package/src/filters/ColorMatrix.ts +2 -2
  435. package/src/filters/WebGLFilterBackend.ts +4 -2
  436. package/src/gradient/Gradient.ts +1 -1
  437. package/src/gradient/parser/parseCoords.ts +5 -6
  438. package/src/mixins/eraser_brush.mixin.ts +4 -4
  439. package/src/parser/parseFontDeclaration.ts +2 -3
  440. package/src/parser/parsePointsAttribute.ts +0 -1
  441. package/src/parser/parseSVGDocument.ts +0 -2
  442. package/src/parser/parseStyleAttribute.ts +0 -1
  443. package/src/parser/parseTransformAttribute.ts +0 -2
  444. package/src/parser/percent.ts +10 -6
  445. package/src/shapes/ActiveSelection.spec.ts +23 -23
  446. package/src/shapes/Circle.spec.ts +13 -3
  447. package/src/shapes/Ellipse.spec.ts +46 -13
  448. package/src/shapes/Group.spec.ts +50 -83
  449. package/src/shapes/IText/IText-click-behavior.spec.ts +7 -2
  450. package/src/shapes/IText/IText.test.ts +9 -9
  451. package/src/shapes/IText/IText.ts +25 -29
  452. package/src/shapes/IText/ITextBehavior.ts +25 -9
  453. package/src/shapes/IText/ITextKeyBehavior.test.ts +33 -0
  454. package/src/shapes/IText/ITextKeyBehavior.ts +1 -0
  455. package/src/shapes/Image.spec.ts +23 -16
  456. package/src/shapes/Image.ts +13 -3
  457. package/src/shapes/Line.spec.ts +4 -4
  458. package/src/shapes/Line.ts +0 -1
  459. package/src/shapes/Object/InteractiveObject.ts +1 -1
  460. package/src/shapes/Object/Object-clip-path.spec.ts +2 -2
  461. package/src/shapes/Object/Object-interactivity.spec.ts +6 -6
  462. package/src/shapes/Object/Object.spec.ts +8 -7
  463. package/src/shapes/Object/Object.ts +5 -7
  464. package/src/shapes/Object/ObjectGeometry.spec.ts +176 -176
  465. package/src/shapes/Object/ObjectGeometry.ts +37 -23
  466. package/src/shapes/Object/__snapshots__/InteractiveObject.spec.ts.snap +2 -2
  467. package/src/shapes/Object/__snapshots__/ObjectGeometry.spec.ts.snap +22 -0
  468. package/src/shapes/Object/defaultValues.ts +3 -2
  469. package/src/shapes/Object/types/BaseProps.ts +2 -2
  470. package/src/shapes/Path.spec.ts +9 -9
  471. package/src/shapes/Polygon.spec.ts +14 -14
  472. package/src/shapes/Polyline.spec.ts +20 -20
  473. package/src/shapes/Rect.spec.ts +12 -6
  474. package/src/shapes/Text/Text.spec.ts +32 -7
  475. package/src/shapes/Text/Text.ts +73 -69
  476. package/src/shapes/Text/TextSVGExportMixin.spec.ts +33 -3
  477. package/src/shapes/Text/__snapshots__/Text.spec.ts.snap +2 -2
  478. package/src/shapes/Text/__snapshots__/TextSVGExportMixin.spec.ts.snap +8 -1
  479. package/src/shapes/Text/constants.ts +4 -4
  480. package/src/shapes/Textbox.spec.ts +4 -3
  481. package/src/shapes/Textbox.ts +0 -1
  482. package/src/shapes/__snapshots__/Group.spec.ts.snap +37 -0
  483. package/src/shapes/__snapshots__/Textbox.spec.ts.snap +4 -4
  484. package/src/typedefs.ts +1 -1
  485. package/src/util/internals/cleanupSvgAttribute.ts +7 -5
  486. package/src/util/internals/normalizeWhiteSpace.ts +1 -0
  487. package/src/util/misc/groupSVGElements.ts +0 -1
  488. package/src/util/misc/matrix.ts +5 -5
  489. package/src/util/misc/mergeClipPaths.spec.ts +7 -2
  490. package/src/util/transform_matrix_removal.ts +2 -2
  491. package/tsconfig-extensions.json +1 -1
  492. package/tsconfig.json +1 -0
  493. package/typedoc.config.json +2 -1
  494. package/vitest.config.ts +9 -7
  495. package/vitest.d.ts +1 -1
  496. package/vitest.extend.ts +1 -1
  497. package/dist/extensions/aligning_guidelines/constant.d.ts +0 -3
  498. package/dist/extensions/aligning_guidelines/constant.d.ts.map +0 -1
  499. package/dist-extensions/aligning_guidelines/constant.mjs +0 -11
  500. package/dist-extensions/aligning_guidelines/constant.mjs.map +0 -1
  501. package/dist-extensions/extensions/aligning_guidelines/constant.d.ts +0 -3
  502. package/dist-extensions/extensions/aligning_guidelines/constant.d.ts.map +0 -1
  503. package/extensions/aligning_guidelines/constant.ts +0 -10
package/CHANGELOG.md CHANGED
@@ -1,6 +1,61 @@
1
1
  # Changelog
2
2
 
3
- ## [next]
3
+ ## [7.0.0]
4
+
5
+ - fix(): Fix toDataUrl writing on contextTop [#10820](https://github.com/fabricjs/fabric.js/pull/10820)
6
+ - feat(): Multi touch gesture support with module westures [#10813](https://github.com/fabricjs/fabric.js/pull/10813)
7
+ - fix(): Fix the situation where undefined + char exists when calculating couple [#10816](https://github.com/fabricjs/fabric.js/pull/10816)
8
+ - feat(): Add configuration parameter for patternQuality in node [#10804](https://github.com/fabricjs/fabric.js/pull/10804)
9
+ - fix(): BREAKING Fix text positioning [#10803](https://github.com/fabricjs/fabric.js/pull/10803)
10
+ - fix(AligningGuidelines): Guidelines features updates [#10120] (https://github.com/fabricjs/fabric.js/pull/10120)
11
+ - chore(deps-dev): bump inquirer from 12.9.6 to 12.10.0 [#10789](https://github.com/fabricjs/fabric.js/pull/10789)
12
+ - chore(deps-dev): bump @types/micromatch from 4.0.9 to 4.0.10 [#10788](https://github.com/fabricjs/fabric.js/pull/10788)
13
+ - chore(): update major version of vitest [#10786](https://github.com/fabricjs/fabric.js/pull/10786)
14
+ - fix(): Prototype pollution risk on text char cache [#10782](https://github.com/fabricjs/fabric.js/pull/10782)
15
+ - fix(): fix rendering of text when line height is set to 0 [#10785](https://github.com/fabricjs/fabric.js/pull/10785)
16
+ - chore(): update playwright [#10780](https://github.com/fabricjs/fabric.js/pull/10780)
17
+ - chore(deps-dev): bump es-toolkit from 1.39.10 to 1.40.0 [#10777](https://github.com/fabricjs/fabric.js/pull/10777)
18
+ - BREAKING chore(): Deprecate originX and originY and change their default to center/center [#10715](https://github.com/fabricjs/fabric.js/pull/10715)
19
+ - chore(deps-dev): bump @types/node from 24.7.0 to 24.7.2 [#10778](https://github.com/fabricjs/fabric.js/pull/10778)
20
+ - chore(deps-dev): bump @rollup/plugin-babel from 6.0.4 to 6.1.0 [#10776](https://github.com/fabricjs/fabric.js/pull/10776)
21
+ - chore(): up dev deps [#10773](https://github.com/fabricjs/fabric.js/pull/10773)
22
+ - chore(): up deps [#10771](https://github.com/fabricjs/fabric.js/pull/10771)
23
+ - chore(): remove moment dev dependency [#10770](https://github.com/fabricjs/fabric.js/pull/10770)
24
+ - ci(): Move firefox to headless: false to see if improves passing rate. Renamed config because of deprecation warning [#10769](https://github.com/fabricjs/fabric.js/pull/10769)
25
+ - chore(): remove fs-extra dev dependency [#10767](https://github.com/fabricjs/fabric.js/pull/10767)
26
+ - chore(deps-dev): bump @playwright/test from 1.55.0 to 1.55.1 [#10761](https://github.com/fabricjs/fabric.js/pull/10761)
27
+ - test(): Add new e2e import test for svg preserve aspect ratio [#10766](https://github.com/fabricjs/fabric.js/pull/10766)
28
+ - chore() Revisit and reduce contribution guidelines, try to streamline things [#10759](https://github.com/fabricjs/fabric.js/pull/10759)
29
+ - chore(deps): bump the npm_and_yarn group across 2 directories with 2 updates [#10734](https://github.com/fabricjs/fabric.js/pull/10734)
30
+ - chore(deps-dev): bump @babel/core from 7.28.3 to 7.28.4 [#10753](https://github.com/fabricjs/fabric.js/pull/10753)
31
+ - chore(): remove chalk [#10758](https://github.com/fabricjs/fabric.js/pull/10758)
32
+ - chore(deps-dev): bump commander from 14.0.0 to 14.0.1 [#10754](https://github.com/fabricjs/fabric.js/pull/10754)
33
+ - chore(deps-dev): bump chalk from 5.6.0 to 5.6.2 [#10752](https://github.com/fabricjs/fabric.js/pull/10752)
34
+ - fix(): Fix some weaknesses in the changelog-update action ( various CWE ) [#10747](https://github.com/fabricjs/fabric.js/pull/10747)
35
+ - fix(): CWE-1333 CWE-400 CWE-730 Simplify some regexes in order to avoid slowness with craft bad string [#10746](https://github.com/fabricjs/fabric.js/pull/10746)
36
+ - fix(): CWE-1333 CWE-400 CWE-730 in Text.ts regex [#10745](https://github.com/fabricjs/fabric.js/pull/10745)
37
+ - ci(): fix CWE-829 in action build-stats [#10744](https://github.com/fabricjs/fabric.js/pull/10744)
38
+ - ci(): Fix CWE-829 in the coverage report action [#10743](https://github.com/fabricjs/fabric.js/pull/10743)
39
+ - ci(): Foked the action find-create-update-comment in order to pin sha(s) [#10742](https://github.com/fabricjs/fabric.js/pull/10742)
40
+ - fix(): After executing loadFromJSON, it unexpectedly adds an objects property to the canvas.
41
+ - fix(): Incorrect sha for commenting action
42
+ - fix(IText): A form field element has neither an id nor a name attribute. [#10172](https://github.com/fabricjs/fabric.js/pull/10172)
43
+ - docs(): change CN comment to EN [#10727](https://github.com/fabricjs/fabric.js/pull/10727)
44
+ - chore(): Remove paths for codeQL let it scan all the repo [#10738](https://github.com/fabricjs/fabric.js/pull/10738)
45
+ - chore(): Pin all GitHub Actions to commit SHAs for security compliance [#10739](https://github.com/fabricjs/fabric.js/pull/10739)
46
+ - chore(deps-dev): bump es-toolkit from 1.39.7 to 1.39.10 [#10731](https://github.com/fabricjs/fabric.js/pull/10731)
47
+ - chore(deps-dev): bump serve from 14.2.4 to 14.2.5 [#10730](https://github.com/fabricjs/fabric.js/pull/10730)
48
+ - Update license to include 2016–2025 Fabric.js contributors [#10726](https://github.com/fabricjs/fabric.js/pull/10726)
49
+ - chore(deps-dev): bump @eslint/js from 9.34.0 to 9.35.0 [#10729](https://github.com/fabricjs/fabric.js/pull/10729)
50
+ - chore(): Format dependabot.yml with Prettier to ensure consistent code style [#10733](https://github.com/fabricjs/fabric.js/pull/10733)
51
+ - doc: Repair broken link in docs by targeting all demo and samples pages in old fabric docs. [#10723](https://github.com/fabricjs/fabric.js/pull/10723)
52
+ - Clarify MIT License [#10725](https://github.com/fabricjs/fabric.js/pull/10725)
53
+ - BREAKING(): Deprecate fireRightClick, fireMiddleClick, stopContextMenu and change their default value. [#10720](https://github.com/fabricjs/fabric.js/pull/10720)
54
+ - BREAKING: chore(): Update min node version to 20, add 24 [#10716](https://github.com/fabricjs/fabric.js/pull/10716)
55
+ - fix(): The mouse enter and leave events of child elements will be executed twice. [10698](https://github.com/fabricjs/fabric.js/issues/10698)
56
+ - chore(): Remove mouse wheel console warning by setting default explicitly. [#10712](https://github.com/fabricjs/fabric.js/pull/10712)
57
+ - chore(): Fixes to TypeDoc for compilation [#10709](https://github.com/fabricjs/fabric.js/pull/10709)
58
+ - chore(): Update typescript 5.9, eslint, babel and rollup to latest [#10708](https://github.com/fabricjs/fabric.js/pull/10708)
4
59
 
5
60
  ## [7.0.0-beta1]
6
61
 
package/CONTRIBUTING.md CHANGED
@@ -1,101 +1,87 @@
1
- # 🎉 Contributing to Fabric 🥳
1
+ # Contributing to Fabric
2
+
3
+ First of all thank you for your interest in contributing. 🙏
2
4
 
3
5
  This guide covers all you need to know from the start, for a first time contributor, advancing to the more advanced topics as you continue reading.
4
6
 
5
- ## 🧐 Questions?!?
7
+ ## What is a contribution, who is a contributor
8
+
9
+ A Contributor is anyone who simply adds to the project, without any formal membership. Contributions do not need to be code. Contributions can be code, docs, issue triaging, discussions, ideas.
10
+
11
+ If you are starting your coding journey, contributions are a good way to learn skills, learn development workflows, meet other developers.
6
12
 
7
- Questions are legit but that doesn't make them bug reports...\
13
+ If you find yourself contributing often you may be interested in the [Contributor ladder](CONTRIBUTOR_LADDER.md)
14
+
15
+ ## Asking Questions
16
+
17
+ The place for questions is NOT the [Issue Tracker](#Issue-Tracker)
8
18
  Please refer to available resources (read below) and refrain from opening an issue in such a case.
9
19
 
10
20
  To find an answer, first [search the repository][search_issues]. It contains a lot of useful threads.
11
21
 
12
- Questions might inspire you to [improve the docs](#-improving-docs) 🌈 Please do 🌟.
22
+ If you find an answer in the issue tracker or in the discussions, but not in the docs, you may consider [improving the docs](#improving-docs). Docs contributions are really appreciated above anything else
13
23
 
14
- Demos and examples 🤓 can be found on [fabricjs.com][website], [`jsfiddle`][jsfiddles], [`codepen.io`][codepens] and more.
24
+ Demos and examples can be found on [fabricjs.com][website], [`jsfiddle`][jsfiddles], [`codepen.io`][codepens] and more.
15
25
 
16
- ## 🏷️ Issue Tracker
26
+ ## Issue Tracker
17
27
 
18
28
  - **Before You Begin** 🎬
19
- - 📌 Make sure you didn't fall into a known [**GOTCHA**][gotchas].
20
- - 🔎 [**Searching**][search_issues] for existing issues and discussions is
21
- 🔋 **VITAL** in order to keep the community in a good state, prevent spamming 👎 and become a skilled fabric dev 🦉.
22
- - **Fill out the [🐛 report][bug_report] with care**, it is there for a reason.
29
+ - Make sure you didn't fall into a known [**GOTCHA**][gotchas].
30
+ - [**Searching**][search_issues] for existing issues and discussions is
31
+ **VITAL** in order to keep the community in a good state, prevent spamming and avoid consuming community time.
32
+ If you need to open a new issue then:
33
+ - **Fill out the [bug report][bug_report] with care**, it is there for a reason.
23
34
  - The **Title** must be informative, short and 🧿 to the point.
24
35
  - **Description**
25
36
  - Describe the issue making sure you are very clear.
26
- - Add (📎) logs, screenshots or videos if that makes sense.
27
- - Make an effort explaining yourself!
28
- - A good description has been read at least **3** times **before submitting**.
37
+ - Add logs, screenshots or videos if that makes sense.
38
+ - Make an effort explaining yourself. Maintainers are busy, don't waste on action on your issue for just having them ask for more details. Put them in condition to answer immediately.
39
+ - Re read your description multiple times **before submitting**.
29
40
  - **Test Case**
30
41
  - Create a minimal and immediate test case, reproducing the bug.
31
42
  - Add relevant explanations.
32
43
  - It should be extremely **easy** for someone to understand your bug and **fast** to reproduce it. **Don't leave it to us to do your part**.
33
44
  - Bug templates can be found within a bug report.
34
45
  - Specify which **version** of Fabric.js you are using.
35
- - **Upgrade** to the latest version before proceeding, your 🐛 may have turned into a 🦋.
36
-
37
- **These are minimal requirements. Without them issues shall be ⛔.**
46
+ - Verify your bug also on the latest version before submitting it.
38
47
 
39
- If it's not a bug **OR** if you're unsure, start a 🤠 [discussion][discussions].
48
+ **These are minimal requirements. Without them issues will be closed.**
40
49
 
41
- Check out [**Helping Out**](#%EF%B8%8F-helping-out).
50
+ If it's not a bug **OR** if you're unsure, start a [discussion][discussions].
42
51
 
43
52
  ---
44
53
 
45
- ## 🔦 Fixing typos
54
+ ## Fixing typos is appreciated
46
55
 
47
- Typos are a nasty thing.\
48
- Though it may seem insignificant, typo fixes are appreciated!\
56
+ Typos happens.\
57
+ Though it may seem insignificant, typo fixes are appreciated!
49
58
  It's a good and simple way to start contributing.
50
59
 
51
- ## 🔎 Improving Docs
60
+ ## Improving Docs
52
61
 
53
62
  Improving **DOCS** is **SUPER** important for everyone.\
54
- Even if it's a small fix it is valuable 💎... **don't hesitate**!
63
+ Even if it's a small fix it is valuable **don't hesitate**!
55
64
 
56
- We plan on building a brand new website, stay tuned.
65
+ We have a website that is easy to contribute to.
57
66
 
58
- ## ❤️ Helping Out
67
+ [Adding demos](#Adding Demos) is also a great contribution.
59
68
 
60
- Answering questions and addressing issues, as well as fixing and adding types (see [Pull Requests](#-pull-requests)), are great ways to start contributing to fabric.
69
+ ## Helping Out with other devs issues
70
+
71
+ Answering questions and addressing issues, as well as fixing and adding types (see [Pull Requests](#pull-requests)), are great ways to start contributing to fabric.
61
72
 
62
73
  - [Issues][issues]
63
74
  - [Discussions][discussions]
64
75
 
65
- ### 🎮 Adding a DEMO (currently not possible)
66
-
67
- **New website is under construction. Contributions are welcome.**
68
-
69
- Take a look at an existing [demo file][demo_file].\
70
- Create a new file in the same directory (`posts/demos/_posts`) and follow [**developing the website**](#fabricjscom-deprecated).
71
-
72
- ### ~~`fabricjs.com`~~ (currently not possible)
73
-
74
- To develop fabric's site you need to clone [`fabricjs.com`][website_repo] in the same parent folder of [`fabric.js`][repo], so that `fabric.js` and `fabricjs.com` are siblings.
75
-
76
- To start the dev server run `npm start:dev` inside the `fabricjs.com` directory (after installing dependencies).
76
+ ## Fixing Bugs
77
77
 
78
- If you are working on windows, check out [`jekyll` docs][jekyll] for further instructions or use [WSL][wsl].
78
+ - Open an [issue](#issue-tracker), if there isn't any, addressing the bug.
79
+ - If the issue is labeled as 'bug' then it needs a fix. Do not open a PR before that moment.
80
+ - Once the issue is confirmed as a bug you can fix it, mention in the issue you are working to fix it and check [Developing](#developing).
81
+ - Add [tests](#testing).
82
+ - Open [PR](#pull-requests)
79
83
 
80
- ## 🐛 Fixing Bugs
81
-
82
- - Open an [issue](#-issue-tracker), if there isn't any, addressing the bug.
83
- - Fix the bug, see [Developing](#-developing-).
84
- - Add [tests](#-testing).
85
- - [PR](#-pull-requests)
86
-
87
- ## 🚀 Pull Requests
88
-
89
- Fabric is an open source project 🦄 and as such depends on the **genuine effort** of individuals and the community as a whole.
90
- **Join Us** to make Fabric better 🌺 .
91
-
92
- ### Getting Started
93
-
94
- - Read this section through.
95
- - Take a look at [**GOTCHAS**][gotchas]
96
- - Follow [Developing](#-developing-) and [Testing](#-testing).
97
-
98
- ### ✅ Guidelines
84
+ ### General Guidelines
99
85
 
100
86
  - **Be patient** \
101
87
  Sometimes it takes time to get back to you. Someone eventually will. Having a small, concise and super clear change will make maintainers more prone to handle it quickly.
@@ -105,17 +91,18 @@ Fabric is an open source project 🦄 and as such depends on the **genuine effor
105
91
  If that doesn't work, once the PR is ready run `npm run prettier:write` and commit the changes.
106
92
  Do not reorder imports. Irrelevant changes in a PR that are not created by prettier aren't needed nor welcome.
107
93
  - **Tests** \
108
- PRs must be backed with relevant tests, follow [TESTING](#-testing). If you never wrote a test or you find our tests unclear to extend, just ask for help.
94
+ PRs must be backed with relevant tests, follow [TESTING](#testing). If you never wrote a test or you find our tests unclear to extend, just ask for help.
109
95
  Aim to cover 100% of the changes.
110
96
  - **Docs** \
111
97
  Update guides if necessary.\
112
98
  Add relevant comments to your code using [JSDoc3][jsdoc], [JSDoc reference supported by TS][tsjsdoc].\
113
99
  The generated documentation can be found at [fabricjs.com][docs], see [DOCS](#-improving-docs).
114
100
  - **Changelog**\
115
- Add a concise listing to the [**CHANGELOG**](CHANGELOG.md) describing what has changed or let github actions add the PR title for you.
116
- - **1️⃣ PR per feature/bug** \
101
+ Add a concise listing to the [**CHANGELOG**](CHANGELOG.md) describing what has changed or let github actions add the PR title for you. An action will add a changelog line with the title of the PR. Check the changelog file to understand the format.
102
+ - **One bug one PR, one feature one PR** \
117
103
  Create a new branch for every pull request.\
118
- If you want to do more than one thing, create multiple pull requests 💪.
104
+ Don't create a PR from your fork main branch.\
105
+ If you want to do more than one thing, create multiple pull requests.
119
106
  If your bug fix or feature requires a refactor, don't refactor. Commit the bugfix or the feature with the current code structure, let it sink, give some time to surface issues with the change, then when the bug or the feature seem solid, a refactor or code improvement can be tried
120
107
  - **And there you go!** \
121
108
  If you still have questions we're always happy to help.
@@ -123,11 +110,9 @@ Fabric is an open source project 🦄 and as such depends on the **genuine effor
123
110
  After you open a PR a maintainer will review it.
124
111
  It is more than likely you will be requested to change stuff and refine your work before it is merged into the repo.
125
112
 
126
- ## 🧪 Testing
113
+ ## Testing
127
114
 
128
- [![🩺](../../actions/workflows/build.yml/badge.svg)](../../actions/workflows/build.yml)
129
- [![🧪](../../actions/workflows/tests.yml/badge.svg)](../../actions/workflows/tests.yml)
130
- [![CodeQL](../../actions/workflows/codeql-analysis.yml/badge.svg)](../../actions/workflows/codeql-analysis.yml)
115
+ We use Vitest and Playwright.
131
116
 
132
117
  | Suite | unit (node) | e2e (browser) |
133
118
  | ------------------------------------------------------------------------------------------------------------- | :----------------------------------------------- | :----------------------------------------------------------------------------------- |
@@ -139,74 +124,13 @@ It is more than likely you will be requested to change stuff and refine your wor
139
124
  | Test Spec | | - `index.ts`: built and loaded into the web app<br> - `index.spec.ts`: test spec<br> |
140
125
  | Outputs | Snapshots next to the test file | - Snapshots next to the test file <br>- `e2e/test-report`<br>- `e2e/test-results` |
141
126
 
142
- ### Legacy Test Suite
143
-
144
- We **discourage** writing new tests in the legacy suite and **encourage** migrating failing tests to the new suite.
145
- However, it is not carved in stone.
146
-
147
- The test suites use [`QUnit`][qunit] for assertions and [`testem`][testem] for serving the browser tests.
148
-
149
- - `unit` tests: test logic and state
150
- - `visual` tests: test visual outcome against image refs located at `test/visual/golden`
151
-
152
- #### Getting Started
153
-
154
- - Build and watch for changes
155
- ```bash
156
- npm run build -- -f -w
157
- ```
158
- - Run the _legacy_ test suite on `chrome` (many tests are skipped on `node`)
159
- ```bash
160
- npm test -- -a -c chrome
161
- ```
162
- - Handle failing tests
163
- - Fix logic
164
- - If needed, alter tests with **caution**
165
- - Rerun failing tests
166
- - Save time by rerunning failing tests only
167
- - Select failing test files
168
- ```bash
169
- npm test -- -c chrome
170
- ```
171
- - **OR** launch the browser test suite in _dev mode_ to watch for test changes
172
- ```bash
173
- npm test -- -c chrome --dev -l
174
- ```
175
- - In case of failing visual tests, there are 2 options to view visual diffs (in order to understand what is wrong)
176
- - Testing in _visual debug mode_ is comfortable when using with `Github Desktop` to view the diffs since refs will be overwritten (rerunning tests will use the overwritten refs so be cautious)
177
- ```bash
178
- npm test -- -d -c chrome
179
- ```
180
- - Launching the browser test suite
181
- ```bash
182
- npm test -- -c chrome --dev -l
183
- ```
184
- - Take into account that different environments produce different outputs so it is advised to run both in `chrome` and `node`.
185
- - Committing refs is done **ONLY** with `chrome` output.
186
- - When you are done, rerun the entire test suit to verify all tests pass.
187
- - If you are submitting a PR, visit the PR page on github to see all checks have passed (different platforms and config are covered by the checks).
188
- - Refer to the command docs
189
- ```bash
190
- npm test -- -h
191
- ```
192
-
193
- #### Adding Tests
194
-
195
- Add tests to relevant files or add new files when necessary under `test/unit` or `test/visual`.
196
-
197
- - [`unit` test example][unit_test]
198
- - [`visual` test example][visual_test]
199
-
200
- If you need to change test config ask for guidance.
201
-
202
- ---
203
-
204
- ## 🚧🎢 Developing 💡✨
127
+ ## Developing
205
128
 
206
129
  ### Getting Started
207
130
 
208
- 1. 🍴 Fork and clone 💾 the repository
209
- 1. Install dependencies 🕹️ `npm i --include=dev`
131
+ 0. You need to be comfortable with git
132
+ 1. Fork and clone the repository
133
+ 2. Install dependencies `npm i --include=dev`
210
134
 
211
135
  ### Starting an App
212
136
 
@@ -215,6 +139,8 @@ npm start <template>
215
139
  npm start -- --help
216
140
  ```
217
141
 
142
+ I use `npm start vanilla` for a simple html page with a fabric canvas where i can test some changes.
143
+
218
144
  You can deploy an app to codesandbox via the cli or build an app at a path of your choosing:
219
145
 
220
146
  ```bash
@@ -234,7 +160,7 @@ You can actively develop fabric online using [Github Codespaces][github_codespac
234
160
  `A service is available on port ...` popups will show up.
235
161
  - Codesandbox: _available soon_.
236
162
 
237
- ### 🔮 Symlinking
163
+ ### Symlinking
238
164
 
239
165
  Establish symlinking to work with a local version on separate projects.
240
166
 
@@ -252,7 +178,7 @@ Don't forget to unlink the package once you're done.
252
178
  [bug_report]: ../../issues/new?template=bug_report.md
253
179
  [website_repo]: https://github.com/fabricjs/fabricjs.com
254
180
  [website]: http://fabricjs.com/
255
- [docs]: http://fabricjs.com/docs
181
+ [docs]: http://fabricjs.com/api
256
182
  [demos]: http://fabricjs.com/demos/
257
183
  [gotchas]: https://fabricjs.com/docs/old-docs/gotchas/
258
184
  [demo_file]: https://github.com/fabricjs/fabricjs.com/blob/gh-pages/posts/demos/_posts/2020-2-15-custom-control-render.md
@@ -269,8 +195,6 @@ Don't forget to unlink the package once you're done.
269
195
  [vitest]: https://vitest.dev/
270
196
  [qunit]: https://qunitjs.com/
271
197
  [testem]: https://github.com/testem/testem
272
- [unit_test]: https://github.com/fabricjs/fabric.js/blob/93dd2dcca705a4b481fbc9982da4952ef5b4ed1d/test/unit/point.js#L227-L237
273
- [visual_test]: https://github.com/fabricjs/fabric.js/blob/93dd2dcca705a4b481fbc9982da4952ef5b4ed1d/test/visual/generic_rendering.js#L44-L67
274
198
  [github_codespaces]: https://github.com/codespaces/new?hide_repo_select=true&ref=master&repo=712530
275
199
  [gitpod]: https://gitpod.io/from-referrer/
276
200
  [npm_link]: https://docs.npmjs.com/cli/v8/commands/npm-link
@@ -0,0 +1,124 @@
1
+ # Contributor Ladder
2
+
3
+ Hello! We are excited that you want to learn more about our project contributor ladder! This contributor ladder outlines the different contributor roles within the project, along with the responsibilities and privileges that come with them. Community members generally start at the first levels of the "ladder" and advance up it as their involvement in the project grows. Our project members are happy to help you advance along the contributor ladder.
4
+
5
+ Each of the roles is organized into lists of three types of things. "Responsibilities" are things that a contributor is expected to do. "Requirements" are qualifications a person needs to meet to be in that role, and "Privileges" are things contributors on that level are entitled to.
6
+
7
+ This document has been started September 2025 and will be subjected to changes depending on people feedback.
8
+
9
+ ## Community Participant
10
+
11
+ A Community Participant engages with the project and its community, contributing their time, thoughts, etc. Community participants are usually users who have stopped being anonymous or silent discussion browsers and started being active in project discussions.
12
+
13
+ ### Responsibilities
14
+
15
+ Must follow the [Code of conduct](./CODE_OF_CONDUCT.md)
16
+
17
+ ### How users can get involved with the community
18
+
19
+ Participating in community discussions
20
+ Submitting bug reports
21
+ Commenting on issues
22
+ Trying out new releases
23
+ Reviewing pull requests
24
+
25
+ ## Contributor
26
+
27
+ A Contributor is anyone who simply adds to the project, without any formal membership. Contributions do not have to be code. People at the contributor level may be new contributors, or they may only contribute occasionally.
28
+
29
+ ### Requirements
30
+
31
+ Follow the [Code of conduct](./CODE_OF_CONDUCT.md)
32
+ Follow the [project contributing guide](./CONTRIBUTING.md)
33
+
34
+ ### Responsibilities and privileges
35
+
36
+ Understand the nature of the change they are proposing or issue they are opening
37
+ Respond to questions and feedback from organization members
38
+
39
+ ## Organization Member
40
+
41
+ An Organization Member is an established contributor who regularly participates in the project. Organization Members have privileges in project repositories and discussions around the direction of the project, and as such are expected to act in the interests of the whole project.
42
+
43
+ ### Requirements
44
+
45
+ All the contributor requirements
46
+ Contributes regularly
47
+ Upholds community and code of conduct values
48
+ Enabled secure two-factor authentication on their GitHub account
49
+
50
+ ### Responsibilities and privileges
51
+
52
+ All the contributor responsibilities and privileges
53
+ Organization members can meet regularly in a chat to discuss the project and priorities.
54
+
55
+ Organization member still contribute from forks.
56
+
57
+ FabricJS is a small project, if you want to be an organization member, ask the maintainer via email or in an issue, mention the work you have done, and self nominate you to become a member.
58
+
59
+ ## Triager
60
+
61
+ Triagers assist the maintainer and approvers with issue tracking and backlog. The specific workflows and triage requirements depend on the project, and are set by the project maintainer.
62
+
63
+ Defined by: Triage permissions, with the names of the current Triagers committed to git, either in CONTRIBUTING, CODEOWNERS, or in the README.
64
+
65
+ Triagers may be code contributors, but writing code is not a requirement for becoming a triager. Triagers are encouraged to be active participants in project meetings, chat rooms, and other discussion forums.
66
+
67
+ ### Requirements
68
+
69
+ All the requiremens of a Organization Member
70
+ Consistently contribute in meetings or in issues, PRs or discussions.
71
+
72
+ ### Responsibilities and privileges
73
+
74
+ All the Organization member responsibilities and privileges
75
+ Have a limited understanding of the project goals as outlined by maintainers
76
+ Respond to issues by asking clarifying questions and suggesting labels.
77
+ Respond to pull requests by reviewing code, testing manually, and providing (non-binding) approval or requesting changes
78
+
79
+ ### The process of becoming a Triager
80
+
81
+ Self nominate yourself to be one, ask a maintainer via email or open an issue, explain or reference the work you have done for the project.
82
+
83
+ ## Approver
84
+
85
+ Code approvers are able to both review and approve code contributions, as well as help maintainers triage issues and do project management.
86
+ An Approver is a person that with time learned the project and has interest being involved with it, may it be learning or for fun or for work.
87
+
88
+ While code review is focused on code quality and correctness, approval is focused on holistic acceptance of a contribution including: backwards/forwards compatibility, adhering to API and flag conventions, subtle performance and correctness issues, interactions with other parts of the system, etc.
89
+
90
+ Approver status can be scoped to a part of the codebase. For example, critical core components may have higher bar for becoming an approver.
91
+
92
+ ### Requirements
93
+
94
+ All the Triager requirements
95
+ Has deep knowledge of the codebase
96
+ Reviewer or author of PRs to the codebase, with the definition of substantial subject to the maintainer's discretion (e.g. refactors/adds new functionality rather than one-line pulls).
97
+ Nominated by a maintainer
98
+ With no objections from other maintainers
99
+ Done through PR to update the Community Configuration.
100
+
101
+ ### Responsibilities and privileges
102
+
103
+ Have a robust understanding of the project goals as outlined by maintainers
104
+ Respond to issues by asking clarifying questions and suggesting labels
105
+ Respond to pull requests by reviewing code, testing manually, and providing approval or requesting changes
106
+ Expected to be responsive to review requests (inactivity for more than 1 month may result in falling back to triager until active again)
107
+ Mentor contributors and reviewers
108
+
109
+ ### The process of becoming an Approver
110
+
111
+ If you are a Triager, self nominate yourself.
112
+ As of today ( sept 2025 ) clear project goals and guidelines are not written nor correctly nor in stone, so in practice we are not ready to give anyone the Approver role. There will be an effort to put these down in writing sooner than later.
113
+
114
+ ## Maintainer
115
+
116
+ For now there is one maintainer. Andrea Bogazzi.
117
+ There is also another maintainer that is a dear friend and likely one between the first people to know if something happens to me and we lost the maintainer, but is not actively contributing to the project.
118
+ In the short term I don't plan to add more maintainers, unless my interest in the project diminishes and it is clear that I'm neglecting it.
119
+
120
+ Open source projects that are an hobby may have wave of contributions depending on the particular moment in the life of the project and the life of people contributing to it, if someone feels like to take a break for a period it should be free to do so without too many problems.
121
+
122
+ ### Responsibilities
123
+
124
+ TBD
package/LICENSE CHANGED
@@ -1,4 +1,7 @@
1
+ MIT License
2
+
1
3
  Copyright (c) 2008-2015 Printio (Juriy Zaytsev, Maxim Chernyak)
4
+ Copyright (c) 2016-present Andrea Bogazzi, Shachar Nen and Fabric.js contributors (https://github.com/fabricjs/fabric.js/graphs/contributors)
2
5
 
3
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
7
  of this software and associated documentation files (the "Software"), to deal
@@ -7,9 +10,12 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
10
  copies of the Software, and to permit persons to whom the Software is
8
11
  furnished to do so, subject to the following conditions:
9
12
 
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
10
16
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11
17
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12
- FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13
19
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14
20
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15
21
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Fabric.js
2
2
 
3
- <a href="http://fabricjs.com/kitchensink" target="_blank"><img align="right" src="/lib/screenshot.png" style="width:400px"></a>
3
+ <a href="http://fabricjs.com/kitchensink" target="_blank"><img align="right" src="/lib/screenshot.png" width="400"></a>
4
4
 
5
5
  A **simple and powerful Javascript HTML5 canvas library**.
6
6
 
@@ -9,34 +9,19 @@ A **simple and powerful Javascript HTML5 canvas library**.
9
9
  - [**GOTCHAS**][gotchas]
10
10
  - [**Contributing, Developing and More**](CONTRIBUTING.md)
11
11
 
12
- ---
13
-
14
- <!-- build/coverage status, climate -->
15
-
16
- [![🩺](../../actions/workflows/build.yml/badge.svg)](../../actions/workflows/build.yml)
17
- [![🧪](../../actions/workflows/tests.yml/badge.svg)](../../actions/workflows/tests.yml)
18
- [![CodeQL](../../actions/workflows/codeql-analysis.yml/badge.svg)](../../actions/workflows/codeql-analysis.yml)
19
-
20
- ---
12
+ ## Special Thanks
21
13
 
22
- <!-- npm, bower, CDNJS versions, downloads -->
14
+ Here is a section for recognition of companies or individuals that support fabricJS with a sponsorship
23
15
 
24
- [![cdnjs](https://img.shields.io/cdnjs/v/fabric.js.svg)][cdnjs]
25
- [![jsdelivr](https://data.jsdelivr.com/v1/package/npm/fabric/badge)][jsdelivr]
26
- [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/fabricjs/fabric.js)
16
+ <a href="https://go.warp.dev/fabric">
17
+ <img alt="Warp sponsorship" width="300" src="https://github.com/warpdotdev/brand-assets/blob/main/Github/Sponsor/Warp-Github-LG-01.png">
18
+ </a>
27
19
 
28
- [![NPM](https://badge.fury.io/js/fabric.svg)](http://badge.fury.io/js/fabric)
29
- [![Downloads per month](https://img.shields.io/npm/dm/fabric.svg)](https://www.npmjs.org/package/fabric)
30
- [![Bower](https://badge.fury.io/bo/fabric.svg)](http://badge.fury.io/bo/fabric)
20
+ ### [Warp, built for coding with multiple AI agents](https://go.warp.dev/fabric)
31
21
 
32
- ---
22
+ [Available for MacOS, Linux, & Windows](https://go.warp.dev/fabric)<br>
33
23
 
34
- [![Sponsor asturur](https://img.shields.io/static/v1?label=Sponsor%20asturur&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/asturur)
35
- [![Sponsor melchiar](https://img.shields.io/static/v1?label=Sponsor%20melchiar&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/melchiar)
36
- [![Sponsor ShaMan123](https://img.shields.io/static/v1?label=Sponsor%20ShaMan123&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/ShaMan123)
37
- [![Patreon](https://img.shields.io/static/v1?label=Patreon&message=%F0%9F%91%8D&logo=Patreon&color=blueviolet)](https://www.patreon.com/fabricJS)
38
-
39
- ---
24
+ </div>
40
25
 
41
26
  ## Features
42
27
 
package/SECURITY.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Security Policy
2
2
 
3
- ## Reporting a Vulnerability
3
+ ## Reporting Security Issues
4
4
 
5
- Please report security issues to `andreabogazzi79@gmail.com`
5
+ If you believe you have found a security vulnerability, we encourage you to let us know right away.
6
+
7
+ We will investigate all legitimate reports and do our best to quickly fix the problem.
8
+
9
+ Please report any vulnerabilities in our open source repositories to andreabogazzi79@gmail.com.
@@ -1,5 +1,50 @@
1
- import type { Canvas } from 'fabric';
2
- import type { AligningLineConfig } from './typedefs';
3
- export type { AligningLineConfig } from './typedefs';
4
- export declare function initAligningGuidelines(canvas: Canvas, options?: Partial<AligningLineConfig>): () => void;
1
+ import { type BasicTransformEvent, type Canvas, type FabricObject, type TPointerEvent, type Point } from 'fabric';
2
+ import type { AligningLineConfig, OriginMap } from './typedefs';
3
+ type TransformEvent = BasicTransformEvent<TPointerEvent> & {
4
+ target: FabricObject;
5
+ };
6
+ export declare class AligningGuidelines {
7
+ canvas: Canvas;
8
+ horizontalLines: Set<string>;
9
+ verticalLines: Set<string>;
10
+ cacheMap: Map<string, Point[]>;
11
+ /**
12
+ * When we drag to resize using center points like mt, ml, mb, and mr,
13
+ * we do not need to draw line segments; we only need to draw the target points.
14
+ */
15
+ onlyDrawPoint: boolean;
16
+ /** Alignment method is required when customizing. */
17
+ contraryOriginMap: OriginMap;
18
+ xSize: number;
19
+ lineDash: number[] | undefined;
20
+ /** At what distance from the shape does alignment begin? */
21
+ margin: number;
22
+ /** Aligning line dimensions */
23
+ width: number;
24
+ /** Aligning line color */
25
+ color: string;
26
+ /** Close Vertical line, default false. */
27
+ closeVLine: boolean;
28
+ /** Close horizontal line, default false. */
29
+ closeHLine: boolean;
30
+ constructor(canvas: Canvas, options?: Partial<AligningLineConfig>);
31
+ initBehavior(): void;
32
+ /** Returns shapes that can draw aligning lines, default returns all shapes on the canvas excluding groups. */
33
+ getObjectsByTarget(target: FabricObject): Set<FabricObject<Partial<import("fabric").FabricObjectProps>, import("fabric").SerializedObjectProps, import("fabric").ObjectEvents>>;
34
+ /** When the user customizes the controller, this property is set to enable or disable automatic alignment through point scaling/resizing. */
35
+ getPointMap(target: FabricObject): import("./typedefs").PointMap;
36
+ /** When the user customizes the controller, this property is used to enable or disable alignment positioning through points. */
37
+ getContraryMap(target: FabricObject): import("./typedefs").PointMap;
38
+ /** Users can customize. */
39
+ getCaCheMapValue(object: FabricObject): Point[];
40
+ drawLine(origin: Point, target: Point): void;
41
+ drawX(point: Point, dir: number): void;
42
+ mouseUp(): void;
43
+ scalingOrResizing(e: TransformEvent): void;
44
+ moving(e: TransformEvent): void;
45
+ beforeRender(): void;
46
+ afterRender(): void;
47
+ dispose(): void;
48
+ }
49
+ export {};
5
50
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../extensions/aligning_guidelines/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,MAAM,EAIP,MAAM,QAAQ,CAAC;AAahB,OAAO,KAAK,EACV,kBAAkB,EAGnB,MAAM,YAAY,CAAC;AAOpB,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,OAAO,CAAC,kBAAkB,CAAM,cAmI1C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../extensions/aligning_guidelines/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,KAAK,EAEX,MAAM,QAAQ,CAAC;AAahB,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAIhE,KAAK,cAAc,GAAG,mBAAmB,CAAC,aAAa,CAAC,GAAG;IACzD,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,qBAAa,kBAAkB;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,cAAqB;IACpC,aAAa,cAAqB;IAClC,QAAQ,uBAA8B;IACtC;;;OAGG;IACH,aAAa,UAAS;IACtB,qDAAqD;IACrD,iBAAiB,EAAE,SAAS,CAS1B;IACF,KAAK,SAAO;IACZ,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC/B,4DAA4D;IAC5D,MAAM,SAAK;IACX,+BAA+B;IAC/B,KAAK,SAAK;IACV,0BAA0B;IAC1B,KAAK,SAAuB;IAC5B,0CAA0C;IAC1C,UAAU,UAAS;IACnB,4CAA4C;IAC5C,UAAU,UAAS;gBAEP,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,OAAO,CAAC,kBAAkB,CAAM;IAYrE,YAAY;IAQZ,8GAA8G;IAC9G,kBAAkB,CAAC,MAAM,EAAE,YAAY;IAGvC,6IAA6I;IAC7I,WAAW,CAAC,MAAM,EAAE,YAAY;IAGhC,gIAAgI;IAChI,cAAc,CAAC,MAAM,EAAE,YAAY;IAGnC,2BAA2B;IAC3B,gBAAgB,CAAC,MAAM,EAAE,YAAY;IAarC,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK;IAGrC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM;IAG/B,OAAO;IAOP,iBAAiB,CAAC,CAAC,EAAE,cAAc;IAiGnC,MAAM,CAAC,CAAC,EAAE,cAAc;IAyBxB,YAAY;IAGZ,WAAW;IASX,OAAO;CAQR"}