@nasser-sw/fabric 7.0.1-beta1 → 7.0.1-beta11

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 (2520) hide show
  1. package/.babelrc +0 -0
  2. package/.babelrcAlt +0 -0
  3. package/.browserslistrc +0 -0
  4. package/.editorconfig +0 -0
  5. package/.gitattributes +0 -0
  6. package/.gitpod.yml +0 -0
  7. package/.prettierignore +0 -0
  8. package/.prettierrc +0 -0
  9. package/0 +0 -0
  10. package/CHANGELOG.md +0 -0
  11. package/CODE_OF_CONDUCT.md +0 -0
  12. package/CONTRIBUTING.md +0 -0
  13. package/LICENSE +0 -0
  14. package/OVERLAY_EDITOR_MIGRATION.md +0 -0
  15. package/README.md +0 -0
  16. package/SECURITY.md +0 -0
  17. package/debug/konva/CHANGELOG.md +0 -0
  18. package/debug/konva/LICENSE +0 -0
  19. package/debug/konva/README.md +0 -0
  20. package/debug/konva/gulpfile.mjs +0 -0
  21. package/debug/konva/package.json +0 -0
  22. package/debug/konva/release.sh +0 -0
  23. package/debug/konva/resources/doc-includes/ContainerParams.txt +0 -0
  24. package/debug/konva/resources/doc-includes/NodeParams.txt +0 -0
  25. package/debug/konva/resources/doc-includes/ShapeParams.txt +0 -0
  26. package/debug/konva/resources/jsdoc.conf.json +0 -0
  27. package/debug/konva/rollup.config.mjs +0 -0
  28. package/debug/konva/src/Animation.ts +0 -0
  29. package/debug/konva/src/BezierFunctions.ts +0 -0
  30. package/debug/konva/src/Canvas.ts +0 -0
  31. package/debug/konva/src/Container.ts +0 -0
  32. package/debug/konva/src/Context.ts +0 -0
  33. package/debug/konva/src/Core.ts +0 -0
  34. package/debug/konva/src/DragAndDrop.ts +0 -0
  35. package/debug/konva/src/Factory.ts +0 -0
  36. package/debug/konva/src/FastLayer.ts +0 -0
  37. package/debug/konva/src/Global.ts +0 -0
  38. package/debug/konva/src/Group.ts +0 -0
  39. package/debug/konva/src/Layer.ts +0 -0
  40. package/debug/konva/src/Node.ts +0 -0
  41. package/debug/konva/src/PointerEvents.ts +0 -0
  42. package/debug/konva/src/Shape.ts +0 -0
  43. package/debug/konva/src/Stage.ts +0 -0
  44. package/debug/konva/src/Tween.ts +0 -0
  45. package/debug/konva/src/Util.ts +0 -0
  46. package/debug/konva/src/Validators.ts +0 -0
  47. package/debug/konva/src/_CoreInternals.ts +0 -0
  48. package/debug/konva/src/_FullInternals.ts +0 -0
  49. package/debug/konva/src/canvas-backend.ts +0 -0
  50. package/debug/konva/src/filters/Blur.ts +0 -0
  51. package/debug/konva/src/filters/Brighten.ts +0 -0
  52. package/debug/konva/src/filters/Brightness.ts +0 -0
  53. package/debug/konva/src/filters/Contrast.ts +0 -0
  54. package/debug/konva/src/filters/Emboss.ts +0 -0
  55. package/debug/konva/src/filters/Enhance.ts +0 -0
  56. package/debug/konva/src/filters/Grayscale.ts +0 -0
  57. package/debug/konva/src/filters/HSL.ts +0 -0
  58. package/debug/konva/src/filters/HSV.ts +0 -0
  59. package/debug/konva/src/filters/Invert.ts +0 -0
  60. package/debug/konva/src/filters/Kaleidoscope.ts +0 -0
  61. package/debug/konva/src/filters/Mask.ts +0 -0
  62. package/debug/konva/src/filters/Noise.ts +0 -0
  63. package/debug/konva/src/filters/Pixelate.ts +0 -0
  64. package/debug/konva/src/filters/Posterize.ts +0 -0
  65. package/debug/konva/src/filters/RGB.ts +0 -0
  66. package/debug/konva/src/filters/RGBA.ts +0 -0
  67. package/debug/konva/src/filters/Sepia.ts +0 -0
  68. package/debug/konva/src/filters/Solarize.ts +0 -0
  69. package/debug/konva/src/filters/Threshold.ts +0 -0
  70. package/debug/konva/src/index.ts +0 -0
  71. package/debug/konva/src/shapes/Arc.ts +0 -0
  72. package/debug/konva/src/shapes/Arrow.ts +0 -0
  73. package/debug/konva/src/shapes/Circle.ts +0 -0
  74. package/debug/konva/src/shapes/Ellipse.ts +0 -0
  75. package/debug/konva/src/shapes/Image.ts +0 -0
  76. package/debug/konva/src/shapes/Label.ts +0 -0
  77. package/debug/konva/src/shapes/Line.ts +0 -0
  78. package/debug/konva/src/shapes/Path.ts +0 -0
  79. package/debug/konva/src/shapes/Rect.ts +0 -0
  80. package/debug/konva/src/shapes/RegularPolygon.ts +0 -0
  81. package/debug/konva/src/shapes/Ring.ts +0 -0
  82. package/debug/konva/src/shapes/Sprite.ts +0 -0
  83. package/debug/konva/src/shapes/Star.ts +0 -0
  84. package/debug/konva/src/shapes/Text.ts +0 -0
  85. package/debug/konva/src/shapes/TextPath.ts +0 -0
  86. package/debug/konva/src/shapes/Transformer.ts +0 -0
  87. package/debug/konva/src/shapes/Wedge.ts +0 -0
  88. package/debug/konva/src/skia-backend.ts +0 -0
  89. package/debug/konva/src/types.ts +0 -0
  90. package/debug/konva/tsconfig.json +0 -0
  91. package/debug/konva/tsconfig.test.json +0 -0
  92. package/dist/_virtual/_rollupPluginBabelHelpers.min.mjs +0 -0
  93. package/dist/_virtual/_rollupPluginBabelHelpers.min.mjs.map +0 -0
  94. package/dist/_virtual/_rollupPluginBabelHelpers.mjs +0 -0
  95. package/dist/_virtual/_rollupPluginBabelHelpers.mjs.map +0 -0
  96. package/dist/extensions/aligning_guidelines/constant.d.ts +0 -0
  97. package/dist/extensions/aligning_guidelines/constant.d.ts.map +0 -0
  98. package/dist/extensions/aligning_guidelines/index.d.ts +0 -0
  99. package/dist/extensions/aligning_guidelines/index.d.ts.map +0 -0
  100. package/dist/extensions/aligning_guidelines/typedefs.d.ts +0 -0
  101. package/dist/extensions/aligning_guidelines/typedefs.d.ts.map +0 -0
  102. package/dist/extensions/aligning_guidelines/util/basic.d.ts +0 -0
  103. package/dist/extensions/aligning_guidelines/util/basic.d.ts.map +0 -0
  104. package/dist/extensions/aligning_guidelines/util/collect-line.d.ts +0 -0
  105. package/dist/extensions/aligning_guidelines/util/collect-line.d.ts.map +0 -0
  106. package/dist/extensions/aligning_guidelines/util/collect-point.d.ts +0 -0
  107. package/dist/extensions/aligning_guidelines/util/collect-point.d.ts.map +0 -0
  108. package/dist/extensions/aligning_guidelines/util/draw.d.ts +0 -0
  109. package/dist/extensions/aligning_guidelines/util/draw.d.ts.map +0 -0
  110. package/dist/extensions/aligning_guidelines/util/get-objects-by-target.d.ts +0 -0
  111. package/dist/extensions/aligning_guidelines/util/get-objects-by-target.d.ts.map +0 -0
  112. package/dist/extensions/data_updaters/gradient/index.d.ts +0 -0
  113. package/dist/extensions/data_updaters/gradient/index.d.ts.map +0 -0
  114. package/dist/extensions/data_updaters/origins/index.d.ts +0 -0
  115. package/dist/extensions/data_updaters/origins/index.d.ts.map +0 -0
  116. package/dist/extensions/index.d.ts +0 -0
  117. package/dist/extensions/index.d.ts.map +0 -0
  118. package/dist/fabric.d.ts +0 -0
  119. package/dist/fabric.d.ts.map +0 -0
  120. package/dist/fabric.min.mjs +0 -0
  121. package/dist/fabric.min.mjs.map +0 -0
  122. package/dist/fabric.mjs +0 -0
  123. package/dist/fabric.mjs.map +0 -0
  124. package/dist/index.d.ts +0 -0
  125. package/dist/index.d.ts.map +0 -0
  126. package/dist/index.js +2873 -1252
  127. package/dist/index.js.map +1 -1
  128. package/dist/index.min.js +1 -1
  129. package/dist/index.min.js.map +1 -1
  130. package/dist/index.min.mjs +1 -1
  131. package/dist/index.min.mjs.map +1 -1
  132. package/dist/index.mjs +2873 -1252
  133. package/dist/index.mjs.map +1 -1
  134. package/dist/index.node.cjs +2873 -1252
  135. package/dist/index.node.cjs.map +1 -1
  136. package/dist/index.node.d.ts +0 -0
  137. package/dist/index.node.d.ts.map +0 -0
  138. package/dist/index.node.mjs +2873 -1252
  139. package/dist/index.node.mjs.map +1 -1
  140. package/dist/package.json.min.mjs +1 -1
  141. package/dist/package.json.min.mjs.map +0 -0
  142. package/dist/package.json.mjs +1 -1
  143. package/dist/package.json.mjs.map +0 -0
  144. package/dist/src/ClassRegistry.d.ts +0 -0
  145. package/dist/src/ClassRegistry.d.ts.map +0 -0
  146. package/dist/src/ClassRegistry.min.mjs +0 -0
  147. package/dist/src/ClassRegistry.min.mjs.map +0 -0
  148. package/dist/src/ClassRegistry.mjs +0 -0
  149. package/dist/src/ClassRegistry.mjs.map +0 -0
  150. package/dist/src/Collection.d.ts +0 -0
  151. package/dist/src/Collection.d.ts.map +0 -0
  152. package/dist/src/Collection.min.mjs +0 -0
  153. package/dist/src/Collection.min.mjs.map +0 -0
  154. package/dist/src/Collection.mjs +0 -0
  155. package/dist/src/Collection.mjs.map +0 -0
  156. package/dist/src/CommonMethods.d.ts +0 -0
  157. package/dist/src/CommonMethods.d.ts.map +0 -0
  158. package/dist/src/CommonMethods.min.mjs +0 -0
  159. package/dist/src/CommonMethods.min.mjs.map +0 -0
  160. package/dist/src/CommonMethods.mjs +0 -0
  161. package/dist/src/CommonMethods.mjs.map +0 -0
  162. package/dist/src/EventTypeDefs.d.ts +0 -0
  163. package/dist/src/EventTypeDefs.d.ts.map +0 -0
  164. package/dist/src/Intersection.d.ts +0 -0
  165. package/dist/src/Intersection.d.ts.map +0 -0
  166. package/dist/src/Intersection.min.mjs +0 -0
  167. package/dist/src/Intersection.min.mjs.map +0 -0
  168. package/dist/src/Intersection.mjs +0 -0
  169. package/dist/src/Intersection.mjs.map +0 -0
  170. package/dist/src/LayoutManager/ActiveSelectionLayoutManager.d.ts +0 -0
  171. package/dist/src/LayoutManager/ActiveSelectionLayoutManager.d.ts.map +0 -0
  172. package/dist/src/LayoutManager/ActiveSelectionLayoutManager.min.mjs +0 -0
  173. package/dist/src/LayoutManager/ActiveSelectionLayoutManager.min.mjs.map +0 -0
  174. package/dist/src/LayoutManager/ActiveSelectionLayoutManager.mjs +0 -0
  175. package/dist/src/LayoutManager/ActiveSelectionLayoutManager.mjs.map +0 -0
  176. package/dist/src/LayoutManager/LayoutManager.d.ts +0 -0
  177. package/dist/src/LayoutManager/LayoutManager.d.ts.map +0 -0
  178. package/dist/src/LayoutManager/LayoutManager.min.mjs +0 -0
  179. package/dist/src/LayoutManager/LayoutManager.min.mjs.map +0 -0
  180. package/dist/src/LayoutManager/LayoutManager.mjs +0 -0
  181. package/dist/src/LayoutManager/LayoutManager.mjs.map +0 -0
  182. package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.d.ts +0 -0
  183. package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.d.ts.map +0 -0
  184. package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.min.mjs +0 -0
  185. package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.min.mjs.map +0 -0
  186. package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.mjs +0 -0
  187. package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.mjs.map +0 -0
  188. package/dist/src/LayoutManager/LayoutStrategies/FitContentLayout.d.ts +0 -0
  189. package/dist/src/LayoutManager/LayoutStrategies/FitContentLayout.d.ts.map +0 -0
  190. package/dist/src/LayoutManager/LayoutStrategies/FitContentLayout.min.mjs +0 -0
  191. package/dist/src/LayoutManager/LayoutStrategies/FitContentLayout.min.mjs.map +0 -0
  192. package/dist/src/LayoutManager/LayoutStrategies/FitContentLayout.mjs +0 -0
  193. package/dist/src/LayoutManager/LayoutStrategies/FitContentLayout.mjs.map +0 -0
  194. package/dist/src/LayoutManager/LayoutStrategies/FixedLayout.d.ts +0 -0
  195. package/dist/src/LayoutManager/LayoutStrategies/FixedLayout.d.ts.map +0 -0
  196. package/dist/src/LayoutManager/LayoutStrategies/FixedLayout.min.mjs +0 -0
  197. package/dist/src/LayoutManager/LayoutStrategies/FixedLayout.min.mjs.map +0 -0
  198. package/dist/src/LayoutManager/LayoutStrategies/FixedLayout.mjs +0 -0
  199. package/dist/src/LayoutManager/LayoutStrategies/FixedLayout.mjs.map +0 -0
  200. package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.d.ts +0 -0
  201. package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.d.ts.map +0 -0
  202. package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.min.mjs +0 -0
  203. package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.min.mjs.map +0 -0
  204. package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.mjs +0 -0
  205. package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.mjs.map +0 -0
  206. package/dist/src/LayoutManager/LayoutStrategies/utils.d.ts +0 -0
  207. package/dist/src/LayoutManager/LayoutStrategies/utils.d.ts.map +0 -0
  208. package/dist/src/LayoutManager/LayoutStrategies/utils.min.mjs +0 -0
  209. package/dist/src/LayoutManager/LayoutStrategies/utils.min.mjs.map +0 -0
  210. package/dist/src/LayoutManager/LayoutStrategies/utils.mjs +0 -0
  211. package/dist/src/LayoutManager/LayoutStrategies/utils.mjs.map +0 -0
  212. package/dist/src/LayoutManager/constants.d.ts +0 -0
  213. package/dist/src/LayoutManager/constants.d.ts.map +0 -0
  214. package/dist/src/LayoutManager/constants.min.mjs +0 -0
  215. package/dist/src/LayoutManager/constants.min.mjs.map +0 -0
  216. package/dist/src/LayoutManager/constants.mjs +0 -0
  217. package/dist/src/LayoutManager/constants.mjs.map +0 -0
  218. package/dist/src/LayoutManager/index.d.ts +0 -0
  219. package/dist/src/LayoutManager/index.d.ts.map +0 -0
  220. package/dist/src/LayoutManager/types.d.ts +0 -0
  221. package/dist/src/LayoutManager/types.d.ts.map +0 -0
  222. package/dist/src/Observable.d.ts +0 -0
  223. package/dist/src/Observable.d.ts.map +0 -0
  224. package/dist/src/Observable.min.mjs +0 -0
  225. package/dist/src/Observable.min.mjs.map +0 -0
  226. package/dist/src/Observable.mjs +0 -0
  227. package/dist/src/Observable.mjs.map +0 -0
  228. package/dist/src/Pattern/Pattern.d.ts +0 -0
  229. package/dist/src/Pattern/Pattern.d.ts.map +0 -0
  230. package/dist/src/Pattern/Pattern.min.mjs +0 -0
  231. package/dist/src/Pattern/Pattern.min.mjs.map +0 -0
  232. package/dist/src/Pattern/Pattern.mjs +0 -0
  233. package/dist/src/Pattern/Pattern.mjs.map +0 -0
  234. package/dist/src/Pattern/index.d.ts +0 -0
  235. package/dist/src/Pattern/index.d.ts.map +0 -0
  236. package/dist/src/Pattern/types.d.ts +0 -0
  237. package/dist/src/Pattern/types.d.ts.map +0 -0
  238. package/dist/src/Point.d.ts +0 -0
  239. package/dist/src/Point.d.ts.map +0 -0
  240. package/dist/src/Point.min.mjs +0 -0
  241. package/dist/src/Point.min.mjs.map +0 -0
  242. package/dist/src/Point.mjs +0 -0
  243. package/dist/src/Point.mjs.map +0 -0
  244. package/dist/src/Shadow.d.ts +0 -0
  245. package/dist/src/Shadow.d.ts.map +0 -0
  246. package/dist/src/Shadow.min.mjs +0 -0
  247. package/dist/src/Shadow.min.mjs.map +0 -0
  248. package/dist/src/Shadow.mjs +0 -0
  249. package/dist/src/Shadow.mjs.map +0 -0
  250. package/dist/src/brushes/BaseBrush.d.ts +0 -0
  251. package/dist/src/brushes/BaseBrush.d.ts.map +0 -0
  252. package/dist/src/brushes/BaseBrush.min.mjs +0 -0
  253. package/dist/src/brushes/BaseBrush.min.mjs.map +0 -0
  254. package/dist/src/brushes/BaseBrush.mjs +0 -0
  255. package/dist/src/brushes/BaseBrush.mjs.map +0 -0
  256. package/dist/src/brushes/CircleBrush.d.ts +0 -0
  257. package/dist/src/brushes/CircleBrush.d.ts.map +0 -0
  258. package/dist/src/brushes/CircleBrush.min.mjs +0 -0
  259. package/dist/src/brushes/CircleBrush.min.mjs.map +0 -0
  260. package/dist/src/brushes/CircleBrush.mjs +0 -0
  261. package/dist/src/brushes/CircleBrush.mjs.map +0 -0
  262. package/dist/src/brushes/PatternBrush.d.ts +0 -0
  263. package/dist/src/brushes/PatternBrush.d.ts.map +0 -0
  264. package/dist/src/brushes/PatternBrush.min.mjs +0 -0
  265. package/dist/src/brushes/PatternBrush.min.mjs.map +0 -0
  266. package/dist/src/brushes/PatternBrush.mjs +0 -0
  267. package/dist/src/brushes/PatternBrush.mjs.map +0 -0
  268. package/dist/src/brushes/PencilBrush.d.ts +0 -0
  269. package/dist/src/brushes/PencilBrush.d.ts.map +0 -0
  270. package/dist/src/brushes/PencilBrush.min.mjs +0 -0
  271. package/dist/src/brushes/PencilBrush.min.mjs.map +0 -0
  272. package/dist/src/brushes/PencilBrush.mjs +0 -0
  273. package/dist/src/brushes/PencilBrush.mjs.map +0 -0
  274. package/dist/src/brushes/SprayBrush.d.ts +0 -0
  275. package/dist/src/brushes/SprayBrush.d.ts.map +0 -0
  276. package/dist/src/brushes/SprayBrush.min.mjs +0 -0
  277. package/dist/src/brushes/SprayBrush.min.mjs.map +0 -0
  278. package/dist/src/brushes/SprayBrush.mjs +0 -0
  279. package/dist/src/brushes/SprayBrush.mjs.map +0 -0
  280. package/dist/src/brushes/typedefs.d.ts +0 -0
  281. package/dist/src/brushes/typedefs.d.ts.map +0 -0
  282. package/dist/src/cache.d.ts +0 -0
  283. package/dist/src/cache.d.ts.map +0 -0
  284. package/dist/src/cache.min.mjs +0 -0
  285. package/dist/src/cache.min.mjs.map +0 -0
  286. package/dist/src/cache.mjs +0 -0
  287. package/dist/src/cache.mjs.map +0 -0
  288. package/dist/src/canvas/Canvas.d.ts +0 -0
  289. package/dist/src/canvas/Canvas.d.ts.map +0 -0
  290. package/dist/src/canvas/Canvas.min.mjs +0 -0
  291. package/dist/src/canvas/Canvas.min.mjs.map +0 -0
  292. package/dist/src/canvas/Canvas.mjs +0 -0
  293. package/dist/src/canvas/Canvas.mjs.map +0 -0
  294. package/dist/src/canvas/CanvasOptions.d.ts +0 -0
  295. package/dist/src/canvas/CanvasOptions.d.ts.map +0 -0
  296. package/dist/src/canvas/CanvasOptions.min.mjs +0 -0
  297. package/dist/src/canvas/CanvasOptions.min.mjs.map +0 -0
  298. package/dist/src/canvas/CanvasOptions.mjs +0 -0
  299. package/dist/src/canvas/CanvasOptions.mjs.map +0 -0
  300. package/dist/src/canvas/DOMManagers/CanvasDOMManager.d.ts +0 -0
  301. package/dist/src/canvas/DOMManagers/CanvasDOMManager.d.ts.map +0 -0
  302. package/dist/src/canvas/DOMManagers/CanvasDOMManager.min.mjs +0 -0
  303. package/dist/src/canvas/DOMManagers/CanvasDOMManager.min.mjs.map +0 -0
  304. package/dist/src/canvas/DOMManagers/CanvasDOMManager.mjs +0 -0
  305. package/dist/src/canvas/DOMManagers/CanvasDOMManager.mjs.map +0 -0
  306. package/dist/src/canvas/DOMManagers/StaticCanvasDOMManager.d.ts +0 -0
  307. package/dist/src/canvas/DOMManagers/StaticCanvasDOMManager.d.ts.map +0 -0
  308. package/dist/src/canvas/DOMManagers/StaticCanvasDOMManager.min.mjs +0 -0
  309. package/dist/src/canvas/DOMManagers/StaticCanvasDOMManager.min.mjs.map +0 -0
  310. package/dist/src/canvas/DOMManagers/StaticCanvasDOMManager.mjs +0 -0
  311. package/dist/src/canvas/DOMManagers/StaticCanvasDOMManager.mjs.map +0 -0
  312. package/dist/src/canvas/DOMManagers/util.d.ts +0 -0
  313. package/dist/src/canvas/DOMManagers/util.d.ts.map +0 -0
  314. package/dist/src/canvas/DOMManagers/util.min.mjs +0 -0
  315. package/dist/src/canvas/DOMManagers/util.min.mjs.map +0 -0
  316. package/dist/src/canvas/DOMManagers/util.mjs +0 -0
  317. package/dist/src/canvas/DOMManagers/util.mjs.map +0 -0
  318. package/dist/src/canvas/SelectableCanvas.d.ts +0 -0
  319. package/dist/src/canvas/SelectableCanvas.d.ts.map +0 -0
  320. package/dist/src/canvas/SelectableCanvas.min.mjs +0 -0
  321. package/dist/src/canvas/SelectableCanvas.min.mjs.map +0 -0
  322. package/dist/src/canvas/SelectableCanvas.mjs +0 -0
  323. package/dist/src/canvas/SelectableCanvas.mjs.map +0 -0
  324. package/dist/src/canvas/StaticCanvas.d.ts +0 -0
  325. package/dist/src/canvas/StaticCanvas.d.ts.map +0 -0
  326. package/dist/src/canvas/StaticCanvas.min.mjs +0 -0
  327. package/dist/src/canvas/StaticCanvas.min.mjs.map +0 -0
  328. package/dist/src/canvas/StaticCanvas.mjs +0 -0
  329. package/dist/src/canvas/StaticCanvas.mjs.map +0 -0
  330. package/dist/src/canvas/StaticCanvasOptions.d.ts +0 -0
  331. package/dist/src/canvas/StaticCanvasOptions.d.ts.map +0 -0
  332. package/dist/src/canvas/StaticCanvasOptions.min.mjs +0 -0
  333. package/dist/src/canvas/StaticCanvasOptions.min.mjs.map +0 -0
  334. package/dist/src/canvas/StaticCanvasOptions.mjs +0 -0
  335. package/dist/src/canvas/StaticCanvasOptions.mjs.map +0 -0
  336. package/dist/src/canvas/TextEditingManager.d.ts +0 -0
  337. package/dist/src/canvas/TextEditingManager.d.ts.map +0 -0
  338. package/dist/src/canvas/TextEditingManager.min.mjs +0 -0
  339. package/dist/src/canvas/TextEditingManager.min.mjs.map +0 -0
  340. package/dist/src/canvas/TextEditingManager.mjs +0 -0
  341. package/dist/src/canvas/TextEditingManager.mjs.map +0 -0
  342. package/dist/src/canvas/canvas_gestures.mixin.d.ts +0 -0
  343. package/dist/src/canvas/canvas_gestures.mixin.d.ts.map +0 -0
  344. package/dist/src/color/Color.d.ts +0 -0
  345. package/dist/src/color/Color.d.ts.map +0 -0
  346. package/dist/src/color/Color.min.mjs +0 -0
  347. package/dist/src/color/Color.min.mjs.map +0 -0
  348. package/dist/src/color/Color.mjs +0 -0
  349. package/dist/src/color/Color.mjs.map +0 -0
  350. package/dist/src/color/color_map.d.ts +0 -0
  351. package/dist/src/color/color_map.d.ts.map +0 -0
  352. package/dist/src/color/color_map.min.mjs +0 -0
  353. package/dist/src/color/color_map.min.mjs.map +0 -0
  354. package/dist/src/color/color_map.mjs +0 -0
  355. package/dist/src/color/color_map.mjs.map +0 -0
  356. package/dist/src/color/constants.d.ts +0 -0
  357. package/dist/src/color/constants.d.ts.map +0 -0
  358. package/dist/src/color/constants.min.mjs +0 -0
  359. package/dist/src/color/constants.min.mjs.map +0 -0
  360. package/dist/src/color/constants.mjs +0 -0
  361. package/dist/src/color/constants.mjs.map +0 -0
  362. package/dist/src/color/typedefs.d.ts +0 -0
  363. package/dist/src/color/typedefs.d.ts.map +0 -0
  364. package/dist/src/color/util.d.ts +0 -0
  365. package/dist/src/color/util.d.ts.map +0 -0
  366. package/dist/src/color/util.min.mjs +0 -0
  367. package/dist/src/color/util.min.mjs.map +0 -0
  368. package/dist/src/color/util.mjs +0 -0
  369. package/dist/src/color/util.mjs.map +0 -0
  370. package/dist/src/config.d.ts +0 -0
  371. package/dist/src/config.d.ts.map +0 -0
  372. package/dist/src/config.min.mjs +0 -0
  373. package/dist/src/config.min.mjs.map +0 -0
  374. package/dist/src/config.mjs +0 -0
  375. package/dist/src/config.mjs.map +0 -0
  376. package/dist/src/constants.d.ts +0 -0
  377. package/dist/src/constants.d.ts.map +0 -0
  378. package/dist/src/constants.min.mjs +0 -0
  379. package/dist/src/constants.min.mjs.map +0 -0
  380. package/dist/src/constants.mjs +0 -0
  381. package/dist/src/constants.mjs.map +0 -0
  382. package/dist/src/controls/Control.d.ts +0 -0
  383. package/dist/src/controls/Control.d.ts.map +0 -0
  384. package/dist/src/controls/Control.min.mjs +0 -0
  385. package/dist/src/controls/Control.min.mjs.map +0 -0
  386. package/dist/src/controls/Control.mjs +0 -0
  387. package/dist/src/controls/Control.mjs.map +0 -0
  388. package/dist/src/controls/changeHeight.d.ts +0 -0
  389. package/dist/src/controls/changeHeight.d.ts.map +0 -0
  390. package/dist/src/controls/changeHeight.min.mjs +2 -0
  391. package/dist/src/controls/changeHeight.min.mjs.map +1 -0
  392. package/dist/src/controls/changeHeight.mjs +36 -0
  393. package/dist/src/controls/changeHeight.mjs.map +1 -0
  394. package/dist/src/controls/changeWidth.d.ts +0 -0
  395. package/dist/src/controls/changeWidth.d.ts.map +0 -0
  396. package/dist/src/controls/changeWidth.min.mjs +0 -0
  397. package/dist/src/controls/changeWidth.min.mjs.map +0 -0
  398. package/dist/src/controls/changeWidth.mjs +0 -0
  399. package/dist/src/controls/changeWidth.mjs.map +0 -0
  400. package/dist/src/controls/commonControls.d.ts +0 -0
  401. package/dist/src/controls/commonControls.d.ts.map +0 -0
  402. package/dist/src/controls/commonControls.min.mjs +0 -0
  403. package/dist/src/controls/commonControls.min.mjs.map +0 -0
  404. package/dist/src/controls/commonControls.mjs +0 -0
  405. package/dist/src/controls/commonControls.mjs.map +0 -0
  406. package/dist/src/controls/controlRendering.d.ts +0 -0
  407. package/dist/src/controls/controlRendering.d.ts.map +0 -0
  408. package/dist/src/controls/controlRendering.min.mjs +0 -0
  409. package/dist/src/controls/controlRendering.min.mjs.map +0 -0
  410. package/dist/src/controls/controlRendering.mjs +0 -0
  411. package/dist/src/controls/controlRendering.mjs.map +0 -0
  412. package/dist/src/controls/drag.d.ts +0 -0
  413. package/dist/src/controls/drag.d.ts.map +0 -0
  414. package/dist/src/controls/drag.min.mjs +0 -0
  415. package/dist/src/controls/drag.min.mjs.map +0 -0
  416. package/dist/src/controls/drag.mjs +0 -0
  417. package/dist/src/controls/drag.mjs.map +0 -0
  418. package/dist/src/controls/fireEvent.d.ts +0 -0
  419. package/dist/src/controls/fireEvent.d.ts.map +0 -0
  420. package/dist/src/controls/fireEvent.min.mjs +0 -0
  421. package/dist/src/controls/fireEvent.min.mjs.map +0 -0
  422. package/dist/src/controls/fireEvent.mjs +0 -0
  423. package/dist/src/controls/fireEvent.mjs.map +0 -0
  424. package/dist/src/controls/index.d.ts +0 -0
  425. package/dist/src/controls/index.d.ts.map +0 -0
  426. package/dist/src/controls/index.min.mjs +0 -0
  427. package/dist/src/controls/index.min.mjs.map +0 -0
  428. package/dist/src/controls/index.mjs +0 -0
  429. package/dist/src/controls/index.mjs.map +0 -0
  430. package/dist/src/controls/pathControl.d.ts +0 -0
  431. package/dist/src/controls/pathControl.d.ts.map +0 -0
  432. package/dist/src/controls/pathControl.min.mjs +0 -0
  433. package/dist/src/controls/pathControl.min.mjs.map +0 -0
  434. package/dist/src/controls/pathControl.mjs +0 -0
  435. package/dist/src/controls/pathControl.mjs.map +0 -0
  436. package/dist/src/controls/polyControl.d.ts +0 -0
  437. package/dist/src/controls/polyControl.d.ts.map +0 -0
  438. package/dist/src/controls/polyControl.min.mjs +0 -0
  439. package/dist/src/controls/polyControl.min.mjs.map +0 -0
  440. package/dist/src/controls/polyControl.mjs +0 -0
  441. package/dist/src/controls/polyControl.mjs.map +0 -0
  442. package/dist/src/controls/rotate.d.ts +0 -0
  443. package/dist/src/controls/rotate.d.ts.map +0 -0
  444. package/dist/src/controls/rotate.min.mjs +0 -0
  445. package/dist/src/controls/rotate.min.mjs.map +0 -0
  446. package/dist/src/controls/rotate.mjs +0 -0
  447. package/dist/src/controls/rotate.mjs.map +0 -0
  448. package/dist/src/controls/scale.d.ts +0 -0
  449. package/dist/src/controls/scale.d.ts.map +0 -0
  450. package/dist/src/controls/scale.min.mjs +0 -0
  451. package/dist/src/controls/scale.min.mjs.map +0 -0
  452. package/dist/src/controls/scale.mjs +0 -0
  453. package/dist/src/controls/scale.mjs.map +0 -0
  454. package/dist/src/controls/scaleSkew.d.ts +0 -0
  455. package/dist/src/controls/scaleSkew.d.ts.map +0 -0
  456. package/dist/src/controls/scaleSkew.min.mjs +0 -0
  457. package/dist/src/controls/scaleSkew.min.mjs.map +0 -0
  458. package/dist/src/controls/scaleSkew.mjs +0 -0
  459. package/dist/src/controls/scaleSkew.mjs.map +0 -0
  460. package/dist/src/controls/skew.d.ts +0 -0
  461. package/dist/src/controls/skew.d.ts.map +0 -0
  462. package/dist/src/controls/skew.min.mjs +0 -0
  463. package/dist/src/controls/skew.min.mjs.map +0 -0
  464. package/dist/src/controls/skew.mjs +0 -0
  465. package/dist/src/controls/skew.mjs.map +0 -0
  466. package/dist/src/controls/util.d.ts +0 -0
  467. package/dist/src/controls/util.d.ts.map +0 -0
  468. package/dist/src/controls/util.min.mjs +0 -0
  469. package/dist/src/controls/util.min.mjs.map +0 -0
  470. package/dist/src/controls/util.mjs +0 -0
  471. package/dist/src/controls/util.mjs.map +0 -0
  472. package/dist/src/controls/wrapWithFireEvent.d.ts +0 -0
  473. package/dist/src/controls/wrapWithFireEvent.d.ts.map +0 -0
  474. package/dist/src/controls/wrapWithFireEvent.min.mjs +0 -0
  475. package/dist/src/controls/wrapWithFireEvent.min.mjs.map +0 -0
  476. package/dist/src/controls/wrapWithFireEvent.mjs +0 -0
  477. package/dist/src/controls/wrapWithFireEvent.mjs.map +0 -0
  478. package/dist/src/controls/wrapWithFixedAnchor.d.ts +0 -0
  479. package/dist/src/controls/wrapWithFixedAnchor.d.ts.map +0 -0
  480. package/dist/src/controls/wrapWithFixedAnchor.min.mjs +0 -0
  481. package/dist/src/controls/wrapWithFixedAnchor.min.mjs.map +0 -0
  482. package/dist/src/controls/wrapWithFixedAnchor.mjs +0 -0
  483. package/dist/src/controls/wrapWithFixedAnchor.mjs.map +0 -0
  484. package/dist/src/env/browser.d.ts +0 -0
  485. package/dist/src/env/browser.d.ts.map +0 -0
  486. package/dist/src/env/browser.min.mjs +0 -0
  487. package/dist/src/env/browser.min.mjs.map +0 -0
  488. package/dist/src/env/browser.mjs +0 -0
  489. package/dist/src/env/browser.mjs.map +0 -0
  490. package/dist/src/env/index.d.ts +0 -0
  491. package/dist/src/env/index.d.ts.map +0 -0
  492. package/dist/src/env/index.min.mjs +0 -0
  493. package/dist/src/env/index.min.mjs.map +0 -0
  494. package/dist/src/env/index.mjs +0 -0
  495. package/dist/src/env/index.mjs.map +0 -0
  496. package/dist/src/env/node.d.ts +0 -0
  497. package/dist/src/env/node.d.ts.map +0 -0
  498. package/dist/src/env/types.d.ts +0 -0
  499. package/dist/src/env/types.d.ts.map +0 -0
  500. package/dist/src/filters/BaseFilter.d.ts +0 -0
  501. package/dist/src/filters/BaseFilter.d.ts.map +0 -0
  502. package/dist/src/filters/BaseFilter.min.mjs +0 -0
  503. package/dist/src/filters/BaseFilter.min.mjs.map +0 -0
  504. package/dist/src/filters/BaseFilter.mjs +0 -0
  505. package/dist/src/filters/BaseFilter.mjs.map +0 -0
  506. package/dist/src/filters/BlendColor.d.ts +0 -0
  507. package/dist/src/filters/BlendColor.d.ts.map +0 -0
  508. package/dist/src/filters/BlendColor.min.mjs +0 -0
  509. package/dist/src/filters/BlendColor.min.mjs.map +0 -0
  510. package/dist/src/filters/BlendColor.mjs +0 -0
  511. package/dist/src/filters/BlendColor.mjs.map +0 -0
  512. package/dist/src/filters/BlendImage.d.ts +0 -0
  513. package/dist/src/filters/BlendImage.d.ts.map +0 -0
  514. package/dist/src/filters/BlendImage.min.mjs +0 -0
  515. package/dist/src/filters/BlendImage.min.mjs.map +0 -0
  516. package/dist/src/filters/BlendImage.mjs +0 -0
  517. package/dist/src/filters/BlendImage.mjs.map +0 -0
  518. package/dist/src/filters/Blur.d.ts +0 -0
  519. package/dist/src/filters/Blur.d.ts.map +0 -0
  520. package/dist/src/filters/Blur.min.mjs +0 -0
  521. package/dist/src/filters/Blur.min.mjs.map +0 -0
  522. package/dist/src/filters/Blur.mjs +0 -0
  523. package/dist/src/filters/Blur.mjs.map +0 -0
  524. package/dist/src/filters/Boilerplate.d.ts +0 -0
  525. package/dist/src/filters/Boilerplate.d.ts.map +0 -0
  526. package/dist/src/filters/Brightness.d.ts +0 -0
  527. package/dist/src/filters/Brightness.d.ts.map +0 -0
  528. package/dist/src/filters/Brightness.min.mjs +0 -0
  529. package/dist/src/filters/Brightness.min.mjs.map +0 -0
  530. package/dist/src/filters/Brightness.mjs +0 -0
  531. package/dist/src/filters/Brightness.mjs.map +0 -0
  532. package/dist/src/filters/Canvas2dFilterBackend.d.ts +0 -0
  533. package/dist/src/filters/Canvas2dFilterBackend.d.ts.map +0 -0
  534. package/dist/src/filters/Canvas2dFilterBackend.min.mjs +0 -0
  535. package/dist/src/filters/Canvas2dFilterBackend.min.mjs.map +0 -0
  536. package/dist/src/filters/Canvas2dFilterBackend.mjs +0 -0
  537. package/dist/src/filters/Canvas2dFilterBackend.mjs.map +0 -0
  538. package/dist/src/filters/ColorMatrix.d.ts +0 -0
  539. package/dist/src/filters/ColorMatrix.d.ts.map +0 -0
  540. package/dist/src/filters/ColorMatrix.min.mjs +0 -0
  541. package/dist/src/filters/ColorMatrix.min.mjs.map +0 -0
  542. package/dist/src/filters/ColorMatrix.mjs +0 -0
  543. package/dist/src/filters/ColorMatrix.mjs.map +0 -0
  544. package/dist/src/filters/ColorMatrixFilters.d.ts +0 -0
  545. package/dist/src/filters/ColorMatrixFilters.d.ts.map +0 -0
  546. package/dist/src/filters/ColorMatrixFilters.min.mjs +0 -0
  547. package/dist/src/filters/ColorMatrixFilters.min.mjs.map +0 -0
  548. package/dist/src/filters/ColorMatrixFilters.mjs +0 -0
  549. package/dist/src/filters/ColorMatrixFilters.mjs.map +0 -0
  550. package/dist/src/filters/Composed.d.ts +0 -0
  551. package/dist/src/filters/Composed.d.ts.map +0 -0
  552. package/dist/src/filters/Composed.min.mjs +0 -0
  553. package/dist/src/filters/Composed.min.mjs.map +0 -0
  554. package/dist/src/filters/Composed.mjs +0 -0
  555. package/dist/src/filters/Composed.mjs.map +0 -0
  556. package/dist/src/filters/Contrast.d.ts +0 -0
  557. package/dist/src/filters/Contrast.d.ts.map +0 -0
  558. package/dist/src/filters/Contrast.min.mjs +0 -0
  559. package/dist/src/filters/Contrast.min.mjs.map +0 -0
  560. package/dist/src/filters/Contrast.mjs +0 -0
  561. package/dist/src/filters/Contrast.mjs.map +0 -0
  562. package/dist/src/filters/Convolute.d.ts +0 -0
  563. package/dist/src/filters/Convolute.d.ts.map +0 -0
  564. package/dist/src/filters/Convolute.min.mjs +0 -0
  565. package/dist/src/filters/Convolute.min.mjs.map +0 -0
  566. package/dist/src/filters/Convolute.mjs +0 -0
  567. package/dist/src/filters/Convolute.mjs.map +0 -0
  568. package/dist/src/filters/FilterBackend.d.ts +0 -0
  569. package/dist/src/filters/FilterBackend.d.ts.map +0 -0
  570. package/dist/src/filters/FilterBackend.min.mjs +0 -0
  571. package/dist/src/filters/FilterBackend.min.mjs.map +0 -0
  572. package/dist/src/filters/FilterBackend.mjs +0 -0
  573. package/dist/src/filters/FilterBackend.mjs.map +0 -0
  574. package/dist/src/filters/GLProbes/GLProbe.d.ts +0 -0
  575. package/dist/src/filters/GLProbes/GLProbe.d.ts.map +0 -0
  576. package/dist/src/filters/GLProbes/GLProbe.min.mjs +0 -0
  577. package/dist/src/filters/GLProbes/GLProbe.min.mjs.map +0 -0
  578. package/dist/src/filters/GLProbes/GLProbe.mjs +0 -0
  579. package/dist/src/filters/GLProbes/GLProbe.mjs.map +0 -0
  580. package/dist/src/filters/GLProbes/NodeGLProbe.d.ts +0 -0
  581. package/dist/src/filters/GLProbes/NodeGLProbe.d.ts.map +0 -0
  582. package/dist/src/filters/GLProbes/WebGLProbe.d.ts +0 -0
  583. package/dist/src/filters/GLProbes/WebGLProbe.d.ts.map +0 -0
  584. package/dist/src/filters/GLProbes/WebGLProbe.min.mjs +0 -0
  585. package/dist/src/filters/GLProbes/WebGLProbe.min.mjs.map +0 -0
  586. package/dist/src/filters/GLProbes/WebGLProbe.mjs +0 -0
  587. package/dist/src/filters/GLProbes/WebGLProbe.mjs.map +0 -0
  588. package/dist/src/filters/Gamma.d.ts +0 -0
  589. package/dist/src/filters/Gamma.d.ts.map +0 -0
  590. package/dist/src/filters/Gamma.min.mjs +0 -0
  591. package/dist/src/filters/Gamma.min.mjs.map +0 -0
  592. package/dist/src/filters/Gamma.mjs +0 -0
  593. package/dist/src/filters/Gamma.mjs.map +0 -0
  594. package/dist/src/filters/Grayscale.d.ts +0 -0
  595. package/dist/src/filters/Grayscale.d.ts.map +0 -0
  596. package/dist/src/filters/Grayscale.min.mjs +0 -0
  597. package/dist/src/filters/Grayscale.min.mjs.map +0 -0
  598. package/dist/src/filters/Grayscale.mjs +0 -0
  599. package/dist/src/filters/Grayscale.mjs.map +0 -0
  600. package/dist/src/filters/HueRotation.d.ts +0 -0
  601. package/dist/src/filters/HueRotation.d.ts.map +0 -0
  602. package/dist/src/filters/HueRotation.min.mjs +0 -0
  603. package/dist/src/filters/HueRotation.min.mjs.map +0 -0
  604. package/dist/src/filters/HueRotation.mjs +0 -0
  605. package/dist/src/filters/HueRotation.mjs.map +0 -0
  606. package/dist/src/filters/Invert.d.ts +0 -0
  607. package/dist/src/filters/Invert.d.ts.map +0 -0
  608. package/dist/src/filters/Invert.min.mjs +0 -0
  609. package/dist/src/filters/Invert.min.mjs.map +0 -0
  610. package/dist/src/filters/Invert.mjs +0 -0
  611. package/dist/src/filters/Invert.mjs.map +0 -0
  612. package/dist/src/filters/Noise.d.ts +0 -0
  613. package/dist/src/filters/Noise.d.ts.map +0 -0
  614. package/dist/src/filters/Noise.min.mjs +0 -0
  615. package/dist/src/filters/Noise.min.mjs.map +0 -0
  616. package/dist/src/filters/Noise.mjs +0 -0
  617. package/dist/src/filters/Noise.mjs.map +0 -0
  618. package/dist/src/filters/Pixelate.d.ts +0 -0
  619. package/dist/src/filters/Pixelate.d.ts.map +0 -0
  620. package/dist/src/filters/Pixelate.min.mjs +0 -0
  621. package/dist/src/filters/Pixelate.min.mjs.map +0 -0
  622. package/dist/src/filters/Pixelate.mjs +0 -0
  623. package/dist/src/filters/Pixelate.mjs.map +0 -0
  624. package/dist/src/filters/RemoveColor.d.ts +0 -0
  625. package/dist/src/filters/RemoveColor.d.ts.map +0 -0
  626. package/dist/src/filters/RemoveColor.min.mjs +0 -0
  627. package/dist/src/filters/RemoveColor.min.mjs.map +0 -0
  628. package/dist/src/filters/RemoveColor.mjs +0 -0
  629. package/dist/src/filters/RemoveColor.mjs.map +0 -0
  630. package/dist/src/filters/Resize.d.ts +0 -0
  631. package/dist/src/filters/Resize.d.ts.map +0 -0
  632. package/dist/src/filters/Resize.min.mjs +0 -0
  633. package/dist/src/filters/Resize.min.mjs.map +0 -0
  634. package/dist/src/filters/Resize.mjs +0 -0
  635. package/dist/src/filters/Resize.mjs.map +0 -0
  636. package/dist/src/filters/Saturation.d.ts +0 -0
  637. package/dist/src/filters/Saturation.d.ts.map +0 -0
  638. package/dist/src/filters/Saturation.min.mjs +0 -0
  639. package/dist/src/filters/Saturation.min.mjs.map +0 -0
  640. package/dist/src/filters/Saturation.mjs +0 -0
  641. package/dist/src/filters/Saturation.mjs.map +0 -0
  642. package/dist/src/filters/Vibrance.d.ts +0 -0
  643. package/dist/src/filters/Vibrance.d.ts.map +0 -0
  644. package/dist/src/filters/Vibrance.min.mjs +0 -0
  645. package/dist/src/filters/Vibrance.min.mjs.map +0 -0
  646. package/dist/src/filters/Vibrance.mjs +0 -0
  647. package/dist/src/filters/Vibrance.mjs.map +0 -0
  648. package/dist/src/filters/WebGLFilterBackend.d.ts +0 -0
  649. package/dist/src/filters/WebGLFilterBackend.d.ts.map +0 -0
  650. package/dist/src/filters/WebGLFilterBackend.min.mjs +0 -0
  651. package/dist/src/filters/WebGLFilterBackend.min.mjs.map +0 -0
  652. package/dist/src/filters/WebGLFilterBackend.mjs +0 -0
  653. package/dist/src/filters/WebGLFilterBackend.mjs.map +0 -0
  654. package/dist/src/filters/filters.d.ts +0 -0
  655. package/dist/src/filters/filters.d.ts.map +0 -0
  656. package/dist/src/filters/filters.min.mjs +0 -0
  657. package/dist/src/filters/filters.min.mjs.map +0 -0
  658. package/dist/src/filters/filters.mjs +0 -0
  659. package/dist/src/filters/filters.mjs.map +0 -0
  660. package/dist/src/filters/index.d.ts +0 -0
  661. package/dist/src/filters/index.d.ts.map +0 -0
  662. package/dist/src/filters/shaders/baseFilter.d.ts +0 -0
  663. package/dist/src/filters/shaders/baseFilter.d.ts.map +0 -0
  664. package/dist/src/filters/shaders/baseFilter.min.mjs +0 -0
  665. package/dist/src/filters/shaders/baseFilter.min.mjs.map +0 -0
  666. package/dist/src/filters/shaders/baseFilter.mjs +0 -0
  667. package/dist/src/filters/shaders/baseFilter.mjs.map +0 -0
  668. package/dist/src/filters/shaders/blendColor.d.ts +0 -0
  669. package/dist/src/filters/shaders/blendColor.d.ts.map +0 -0
  670. package/dist/src/filters/shaders/blendColor.min.mjs +0 -0
  671. package/dist/src/filters/shaders/blendColor.min.mjs.map +0 -0
  672. package/dist/src/filters/shaders/blendColor.mjs +0 -0
  673. package/dist/src/filters/shaders/blendColor.mjs.map +0 -0
  674. package/dist/src/filters/shaders/blendImage.d.ts +0 -0
  675. package/dist/src/filters/shaders/blendImage.d.ts.map +0 -0
  676. package/dist/src/filters/shaders/blendImage.min.mjs +0 -0
  677. package/dist/src/filters/shaders/blendImage.min.mjs.map +0 -0
  678. package/dist/src/filters/shaders/blendImage.mjs +0 -0
  679. package/dist/src/filters/shaders/blendImage.mjs.map +0 -0
  680. package/dist/src/filters/shaders/blur.d.ts +0 -0
  681. package/dist/src/filters/shaders/blur.d.ts.map +0 -0
  682. package/dist/src/filters/shaders/blur.min.mjs +0 -0
  683. package/dist/src/filters/shaders/blur.min.mjs.map +0 -0
  684. package/dist/src/filters/shaders/blur.mjs +0 -0
  685. package/dist/src/filters/shaders/blur.mjs.map +0 -0
  686. package/dist/src/filters/shaders/brightness.d.ts +0 -0
  687. package/dist/src/filters/shaders/brightness.d.ts.map +0 -0
  688. package/dist/src/filters/shaders/brightness.min.mjs +0 -0
  689. package/dist/src/filters/shaders/brightness.min.mjs.map +0 -0
  690. package/dist/src/filters/shaders/brightness.mjs +0 -0
  691. package/dist/src/filters/shaders/brightness.mjs.map +0 -0
  692. package/dist/src/filters/shaders/colorMatrix.d.ts +0 -0
  693. package/dist/src/filters/shaders/colorMatrix.d.ts.map +0 -0
  694. package/dist/src/filters/shaders/colorMatrix.min.mjs +0 -0
  695. package/dist/src/filters/shaders/colorMatrix.min.mjs.map +0 -0
  696. package/dist/src/filters/shaders/colorMatrix.mjs +0 -0
  697. package/dist/src/filters/shaders/colorMatrix.mjs.map +0 -0
  698. package/dist/src/filters/shaders/constrast.d.ts +0 -0
  699. package/dist/src/filters/shaders/constrast.d.ts.map +0 -0
  700. package/dist/src/filters/shaders/constrast.min.mjs +0 -0
  701. package/dist/src/filters/shaders/constrast.min.mjs.map +0 -0
  702. package/dist/src/filters/shaders/constrast.mjs +0 -0
  703. package/dist/src/filters/shaders/constrast.mjs.map +0 -0
  704. package/dist/src/filters/shaders/convolute.d.ts +0 -0
  705. package/dist/src/filters/shaders/convolute.d.ts.map +0 -0
  706. package/dist/src/filters/shaders/convolute.min.mjs +0 -0
  707. package/dist/src/filters/shaders/convolute.min.mjs.map +0 -0
  708. package/dist/src/filters/shaders/convolute.mjs +0 -0
  709. package/dist/src/filters/shaders/convolute.mjs.map +0 -0
  710. package/dist/src/filters/shaders/gamma.d.ts +0 -0
  711. package/dist/src/filters/shaders/gamma.d.ts.map +0 -0
  712. package/dist/src/filters/shaders/gamma.min.mjs +0 -0
  713. package/dist/src/filters/shaders/gamma.min.mjs.map +0 -0
  714. package/dist/src/filters/shaders/gamma.mjs +0 -0
  715. package/dist/src/filters/shaders/gamma.mjs.map +0 -0
  716. package/dist/src/filters/shaders/grayscale.d.ts +0 -0
  717. package/dist/src/filters/shaders/grayscale.d.ts.map +0 -0
  718. package/dist/src/filters/shaders/grayscale.min.mjs +0 -0
  719. package/dist/src/filters/shaders/grayscale.min.mjs.map +0 -0
  720. package/dist/src/filters/shaders/grayscale.mjs +0 -0
  721. package/dist/src/filters/shaders/grayscale.mjs.map +0 -0
  722. package/dist/src/filters/shaders/invert.d.ts +0 -0
  723. package/dist/src/filters/shaders/invert.d.ts.map +0 -0
  724. package/dist/src/filters/shaders/invert.min.mjs +0 -0
  725. package/dist/src/filters/shaders/invert.min.mjs.map +0 -0
  726. package/dist/src/filters/shaders/invert.mjs +0 -0
  727. package/dist/src/filters/shaders/invert.mjs.map +0 -0
  728. package/dist/src/filters/shaders/noise.d.ts +0 -0
  729. package/dist/src/filters/shaders/noise.d.ts.map +0 -0
  730. package/dist/src/filters/shaders/noise.min.mjs +0 -0
  731. package/dist/src/filters/shaders/noise.min.mjs.map +0 -0
  732. package/dist/src/filters/shaders/noise.mjs +0 -0
  733. package/dist/src/filters/shaders/noise.mjs.map +0 -0
  734. package/dist/src/filters/shaders/pixelate.d.ts +0 -0
  735. package/dist/src/filters/shaders/pixelate.d.ts.map +0 -0
  736. package/dist/src/filters/shaders/pixelate.min.mjs +0 -0
  737. package/dist/src/filters/shaders/pixelate.min.mjs.map +0 -0
  738. package/dist/src/filters/shaders/pixelate.mjs +0 -0
  739. package/dist/src/filters/shaders/pixelate.mjs.map +0 -0
  740. package/dist/src/filters/shaders/removeColor.d.ts +0 -0
  741. package/dist/src/filters/shaders/removeColor.d.ts.map +0 -0
  742. package/dist/src/filters/shaders/removeColor.min.mjs +0 -0
  743. package/dist/src/filters/shaders/removeColor.min.mjs.map +0 -0
  744. package/dist/src/filters/shaders/removeColor.mjs +0 -0
  745. package/dist/src/filters/shaders/removeColor.mjs.map +0 -0
  746. package/dist/src/filters/shaders/saturation.d.ts +0 -0
  747. package/dist/src/filters/shaders/saturation.d.ts.map +0 -0
  748. package/dist/src/filters/shaders/saturation.min.mjs +0 -0
  749. package/dist/src/filters/shaders/saturation.min.mjs.map +0 -0
  750. package/dist/src/filters/shaders/saturation.mjs +0 -0
  751. package/dist/src/filters/shaders/saturation.mjs.map +0 -0
  752. package/dist/src/filters/shaders/vibrance.d.ts +0 -0
  753. package/dist/src/filters/shaders/vibrance.d.ts.map +0 -0
  754. package/dist/src/filters/shaders/vibrance.min.mjs +0 -0
  755. package/dist/src/filters/shaders/vibrance.min.mjs.map +0 -0
  756. package/dist/src/filters/shaders/vibrance.mjs +0 -0
  757. package/dist/src/filters/shaders/vibrance.mjs.map +0 -0
  758. package/dist/src/filters/typedefs.d.ts +0 -0
  759. package/dist/src/filters/typedefs.d.ts.map +0 -0
  760. package/dist/src/filters/utils.d.ts +0 -0
  761. package/dist/src/filters/utils.d.ts.map +0 -0
  762. package/dist/src/filters/utils.min.mjs +0 -0
  763. package/dist/src/filters/utils.min.mjs.map +0 -0
  764. package/dist/src/filters/utils.mjs +0 -0
  765. package/dist/src/filters/utils.mjs.map +0 -0
  766. package/dist/src/gradient/Gradient.d.ts +0 -0
  767. package/dist/src/gradient/Gradient.d.ts.map +0 -0
  768. package/dist/src/gradient/Gradient.min.mjs +0 -0
  769. package/dist/src/gradient/Gradient.min.mjs.map +0 -0
  770. package/dist/src/gradient/Gradient.mjs +0 -0
  771. package/dist/src/gradient/Gradient.mjs.map +0 -0
  772. package/dist/src/gradient/constants.d.ts +0 -0
  773. package/dist/src/gradient/constants.d.ts.map +0 -0
  774. package/dist/src/gradient/constants.min.mjs +0 -0
  775. package/dist/src/gradient/constants.min.mjs.map +0 -0
  776. package/dist/src/gradient/constants.mjs +0 -0
  777. package/dist/src/gradient/constants.mjs.map +0 -0
  778. package/dist/src/gradient/index.d.ts +0 -0
  779. package/dist/src/gradient/index.d.ts.map +0 -0
  780. package/dist/src/gradient/parser/misc.d.ts +0 -0
  781. package/dist/src/gradient/parser/misc.d.ts.map +0 -0
  782. package/dist/src/gradient/parser/misc.min.mjs +0 -0
  783. package/dist/src/gradient/parser/misc.min.mjs.map +0 -0
  784. package/dist/src/gradient/parser/misc.mjs +0 -0
  785. package/dist/src/gradient/parser/misc.mjs.map +0 -0
  786. package/dist/src/gradient/parser/parseColorStops.d.ts +0 -0
  787. package/dist/src/gradient/parser/parseColorStops.d.ts.map +0 -0
  788. package/dist/src/gradient/parser/parseColorStops.min.mjs +0 -0
  789. package/dist/src/gradient/parser/parseColorStops.min.mjs.map +0 -0
  790. package/dist/src/gradient/parser/parseColorStops.mjs +0 -0
  791. package/dist/src/gradient/parser/parseColorStops.mjs.map +0 -0
  792. package/dist/src/gradient/parser/parseCoords.d.ts +0 -0
  793. package/dist/src/gradient/parser/parseCoords.d.ts.map +0 -0
  794. package/dist/src/gradient/parser/parseCoords.min.mjs +0 -0
  795. package/dist/src/gradient/parser/parseCoords.min.mjs.map +0 -0
  796. package/dist/src/gradient/parser/parseCoords.mjs +0 -0
  797. package/dist/src/gradient/parser/parseCoords.mjs.map +0 -0
  798. package/dist/src/gradient/typedefs.d.ts +0 -0
  799. package/dist/src/gradient/typedefs.d.ts.map +0 -0
  800. package/dist/src/mixins/eraser_brush.mixin.d.ts +0 -0
  801. package/dist/src/mixins/eraser_brush.mixin.d.ts.map +0 -0
  802. package/dist/src/parkinglot/canvas_animation.mixin.d.ts +0 -0
  803. package/dist/src/parkinglot/canvas_animation.mixin.d.ts.map +0 -0
  804. package/dist/src/parkinglot/straighten.d.ts +0 -0
  805. package/dist/src/parkinglot/straighten.d.ts.map +0 -0
  806. package/dist/src/parser/applyViewboxTransform.d.ts +0 -0
  807. package/dist/src/parser/applyViewboxTransform.d.ts.map +0 -0
  808. package/dist/src/parser/applyViewboxTransform.min.mjs +0 -0
  809. package/dist/src/parser/applyViewboxTransform.min.mjs.map +0 -0
  810. package/dist/src/parser/applyViewboxTransform.mjs +0 -0
  811. package/dist/src/parser/applyViewboxTransform.mjs.map +0 -0
  812. package/dist/src/parser/attributes.d.ts +0 -0
  813. package/dist/src/parser/attributes.d.ts.map +0 -0
  814. package/dist/src/parser/attributes.min.mjs +0 -0
  815. package/dist/src/parser/attributes.min.mjs.map +0 -0
  816. package/dist/src/parser/attributes.mjs +0 -0
  817. package/dist/src/parser/attributes.mjs.map +0 -0
  818. package/dist/src/parser/constants.d.ts +0 -0
  819. package/dist/src/parser/constants.d.ts.map +0 -0
  820. package/dist/src/parser/constants.min.mjs +0 -0
  821. package/dist/src/parser/constants.min.mjs.map +0 -0
  822. package/dist/src/parser/constants.mjs +0 -0
  823. package/dist/src/parser/constants.mjs.map +0 -0
  824. package/dist/src/parser/doesSomeParentMatch.d.ts +0 -0
  825. package/dist/src/parser/doesSomeParentMatch.d.ts.map +0 -0
  826. package/dist/src/parser/doesSomeParentMatch.min.mjs +0 -0
  827. package/dist/src/parser/doesSomeParentMatch.min.mjs.map +0 -0
  828. package/dist/src/parser/doesSomeParentMatch.mjs +0 -0
  829. package/dist/src/parser/doesSomeParentMatch.mjs.map +0 -0
  830. package/dist/src/parser/elementMatchesRule.d.ts +0 -0
  831. package/dist/src/parser/elementMatchesRule.d.ts.map +0 -0
  832. package/dist/src/parser/elementMatchesRule.min.mjs +0 -0
  833. package/dist/src/parser/elementMatchesRule.min.mjs.map +0 -0
  834. package/dist/src/parser/elementMatchesRule.mjs +0 -0
  835. package/dist/src/parser/elementMatchesRule.mjs.map +0 -0
  836. package/dist/src/parser/elements_parser.d.ts +0 -0
  837. package/dist/src/parser/elements_parser.d.ts.map +0 -0
  838. package/dist/src/parser/elements_parser.min.mjs +0 -0
  839. package/dist/src/parser/elements_parser.min.mjs.map +0 -0
  840. package/dist/src/parser/elements_parser.mjs +0 -0
  841. package/dist/src/parser/elements_parser.mjs.map +0 -0
  842. package/dist/src/parser/getCSSRules.d.ts +0 -0
  843. package/dist/src/parser/getCSSRules.d.ts.map +0 -0
  844. package/dist/src/parser/getCSSRules.min.mjs +0 -0
  845. package/dist/src/parser/getCSSRules.min.mjs.map +0 -0
  846. package/dist/src/parser/getCSSRules.mjs +0 -0
  847. package/dist/src/parser/getCSSRules.mjs.map +0 -0
  848. package/dist/src/parser/getGlobalStylesForElement.d.ts +0 -0
  849. package/dist/src/parser/getGlobalStylesForElement.d.ts.map +0 -0
  850. package/dist/src/parser/getGlobalStylesForElement.min.mjs +0 -0
  851. package/dist/src/parser/getGlobalStylesForElement.min.mjs.map +0 -0
  852. package/dist/src/parser/getGlobalStylesForElement.mjs +0 -0
  853. package/dist/src/parser/getGlobalStylesForElement.mjs.map +0 -0
  854. package/dist/src/parser/getGradientDefs.d.ts +0 -0
  855. package/dist/src/parser/getGradientDefs.d.ts.map +0 -0
  856. package/dist/src/parser/getGradientDefs.min.mjs +0 -0
  857. package/dist/src/parser/getGradientDefs.min.mjs.map +0 -0
  858. package/dist/src/parser/getGradientDefs.mjs +0 -0
  859. package/dist/src/parser/getGradientDefs.mjs.map +0 -0
  860. package/dist/src/parser/getMultipleNodes.d.ts +0 -0
  861. package/dist/src/parser/getMultipleNodes.d.ts.map +0 -0
  862. package/dist/src/parser/getMultipleNodes.min.mjs +0 -0
  863. package/dist/src/parser/getMultipleNodes.min.mjs.map +0 -0
  864. package/dist/src/parser/getMultipleNodes.mjs +0 -0
  865. package/dist/src/parser/getMultipleNodes.mjs.map +0 -0
  866. package/dist/src/parser/getSvgRegex.d.ts +0 -0
  867. package/dist/src/parser/getSvgRegex.d.ts.map +0 -0
  868. package/dist/src/parser/getSvgRegex.min.mjs +0 -0
  869. package/dist/src/parser/getSvgRegex.min.mjs.map +0 -0
  870. package/dist/src/parser/getSvgRegex.mjs +0 -0
  871. package/dist/src/parser/getSvgRegex.mjs.map +0 -0
  872. package/dist/src/parser/getTagName.d.ts +0 -0
  873. package/dist/src/parser/getTagName.d.ts.map +0 -0
  874. package/dist/src/parser/getTagName.min.mjs +0 -0
  875. package/dist/src/parser/getTagName.min.mjs.map +0 -0
  876. package/dist/src/parser/getTagName.mjs +0 -0
  877. package/dist/src/parser/getTagName.mjs.map +0 -0
  878. package/dist/src/parser/hasInvalidAncestor.d.ts +0 -0
  879. package/dist/src/parser/hasInvalidAncestor.d.ts.map +0 -0
  880. package/dist/src/parser/hasInvalidAncestor.min.mjs +0 -0
  881. package/dist/src/parser/hasInvalidAncestor.min.mjs.map +0 -0
  882. package/dist/src/parser/hasInvalidAncestor.mjs +0 -0
  883. package/dist/src/parser/hasInvalidAncestor.mjs.map +0 -0
  884. package/dist/src/parser/loadSVGFromString.d.ts +0 -0
  885. package/dist/src/parser/loadSVGFromString.d.ts.map +0 -0
  886. package/dist/src/parser/loadSVGFromString.min.mjs +0 -0
  887. package/dist/src/parser/loadSVGFromString.min.mjs.map +0 -0
  888. package/dist/src/parser/loadSVGFromString.mjs +0 -0
  889. package/dist/src/parser/loadSVGFromString.mjs.map +0 -0
  890. package/dist/src/parser/loadSVGFromURL.d.ts +0 -0
  891. package/dist/src/parser/loadSVGFromURL.d.ts.map +0 -0
  892. package/dist/src/parser/loadSVGFromURL.min.mjs +0 -0
  893. package/dist/src/parser/loadSVGFromURL.min.mjs.map +0 -0
  894. package/dist/src/parser/loadSVGFromURL.mjs +0 -0
  895. package/dist/src/parser/loadSVGFromURL.mjs.map +0 -0
  896. package/dist/src/parser/normalizeAttr.d.ts +0 -0
  897. package/dist/src/parser/normalizeAttr.d.ts.map +0 -0
  898. package/dist/src/parser/normalizeAttr.min.mjs +0 -0
  899. package/dist/src/parser/normalizeAttr.min.mjs.map +0 -0
  900. package/dist/src/parser/normalizeAttr.mjs +0 -0
  901. package/dist/src/parser/normalizeAttr.mjs.map +0 -0
  902. package/dist/src/parser/normalizeValue.d.ts +0 -0
  903. package/dist/src/parser/normalizeValue.d.ts.map +0 -0
  904. package/dist/src/parser/normalizeValue.min.mjs +0 -0
  905. package/dist/src/parser/normalizeValue.min.mjs.map +0 -0
  906. package/dist/src/parser/normalizeValue.mjs +0 -0
  907. package/dist/src/parser/normalizeValue.mjs.map +0 -0
  908. package/dist/src/parser/parseAttributes.d.ts +0 -0
  909. package/dist/src/parser/parseAttributes.d.ts.map +0 -0
  910. package/dist/src/parser/parseAttributes.min.mjs +0 -0
  911. package/dist/src/parser/parseAttributes.min.mjs.map +0 -0
  912. package/dist/src/parser/parseAttributes.mjs +0 -0
  913. package/dist/src/parser/parseAttributes.mjs.map +0 -0
  914. package/dist/src/parser/parseFontDeclaration.d.ts +0 -0
  915. package/dist/src/parser/parseFontDeclaration.d.ts.map +0 -0
  916. package/dist/src/parser/parseFontDeclaration.min.mjs +0 -0
  917. package/dist/src/parser/parseFontDeclaration.min.mjs.map +0 -0
  918. package/dist/src/parser/parseFontDeclaration.mjs +0 -0
  919. package/dist/src/parser/parseFontDeclaration.mjs.map +0 -0
  920. package/dist/src/parser/parsePointsAttribute.d.ts +0 -0
  921. package/dist/src/parser/parsePointsAttribute.d.ts.map +0 -0
  922. package/dist/src/parser/parsePointsAttribute.min.mjs +0 -0
  923. package/dist/src/parser/parsePointsAttribute.min.mjs.map +0 -0
  924. package/dist/src/parser/parsePointsAttribute.mjs +0 -0
  925. package/dist/src/parser/parsePointsAttribute.mjs.map +0 -0
  926. package/dist/src/parser/parseSVGDocument.d.ts +0 -0
  927. package/dist/src/parser/parseSVGDocument.d.ts.map +0 -0
  928. package/dist/src/parser/parseSVGDocument.min.mjs +0 -0
  929. package/dist/src/parser/parseSVGDocument.min.mjs.map +0 -0
  930. package/dist/src/parser/parseSVGDocument.mjs +0 -0
  931. package/dist/src/parser/parseSVGDocument.mjs.map +0 -0
  932. package/dist/src/parser/parseStyleAttribute.d.ts +0 -0
  933. package/dist/src/parser/parseStyleAttribute.d.ts.map +0 -0
  934. package/dist/src/parser/parseStyleAttribute.min.mjs +0 -0
  935. package/dist/src/parser/parseStyleAttribute.min.mjs.map +0 -0
  936. package/dist/src/parser/parseStyleAttribute.mjs +0 -0
  937. package/dist/src/parser/parseStyleAttribute.mjs.map +0 -0
  938. package/dist/src/parser/parseStyleObject.d.ts +0 -0
  939. package/dist/src/parser/parseStyleObject.d.ts.map +0 -0
  940. package/dist/src/parser/parseStyleObject.min.mjs +0 -0
  941. package/dist/src/parser/parseStyleObject.min.mjs.map +0 -0
  942. package/dist/src/parser/parseStyleObject.mjs +0 -0
  943. package/dist/src/parser/parseStyleObject.mjs.map +0 -0
  944. package/dist/src/parser/parseStyleString.d.ts +0 -0
  945. package/dist/src/parser/parseStyleString.d.ts.map +0 -0
  946. package/dist/src/parser/parseStyleString.min.mjs +0 -0
  947. package/dist/src/parser/parseStyleString.min.mjs.map +0 -0
  948. package/dist/src/parser/parseStyleString.mjs +0 -0
  949. package/dist/src/parser/parseStyleString.mjs.map +0 -0
  950. package/dist/src/parser/parseTransformAttribute.d.ts +0 -0
  951. package/dist/src/parser/parseTransformAttribute.d.ts.map +0 -0
  952. package/dist/src/parser/parseTransformAttribute.min.mjs +0 -0
  953. package/dist/src/parser/parseTransformAttribute.min.mjs.map +0 -0
  954. package/dist/src/parser/parseTransformAttribute.mjs +0 -0
  955. package/dist/src/parser/parseTransformAttribute.mjs.map +0 -0
  956. package/dist/src/parser/parseUseDirectives.d.ts +0 -0
  957. package/dist/src/parser/parseUseDirectives.d.ts.map +0 -0
  958. package/dist/src/parser/parseUseDirectives.min.mjs +0 -0
  959. package/dist/src/parser/parseUseDirectives.min.mjs.map +0 -0
  960. package/dist/src/parser/parseUseDirectives.mjs +0 -0
  961. package/dist/src/parser/parseUseDirectives.mjs.map +0 -0
  962. package/dist/src/parser/percent.d.ts +0 -0
  963. package/dist/src/parser/percent.d.ts.map +0 -0
  964. package/dist/src/parser/percent.min.mjs +0 -0
  965. package/dist/src/parser/percent.min.mjs.map +0 -0
  966. package/dist/src/parser/percent.mjs +0 -0
  967. package/dist/src/parser/percent.mjs.map +0 -0
  968. package/dist/src/parser/recursivelyParseGradientsXlink.d.ts +0 -0
  969. package/dist/src/parser/recursivelyParseGradientsXlink.d.ts.map +0 -0
  970. package/dist/src/parser/recursivelyParseGradientsXlink.min.mjs +0 -0
  971. package/dist/src/parser/recursivelyParseGradientsXlink.min.mjs.map +0 -0
  972. package/dist/src/parser/recursivelyParseGradientsXlink.mjs +0 -0
  973. package/dist/src/parser/recursivelyParseGradientsXlink.mjs.map +0 -0
  974. package/dist/src/parser/selectorMatches.d.ts +0 -0
  975. package/dist/src/parser/selectorMatches.d.ts.map +0 -0
  976. package/dist/src/parser/selectorMatches.min.mjs +0 -0
  977. package/dist/src/parser/selectorMatches.min.mjs.map +0 -0
  978. package/dist/src/parser/selectorMatches.mjs +0 -0
  979. package/dist/src/parser/selectorMatches.mjs.map +0 -0
  980. package/dist/src/parser/setStrokeFillOpacity.d.ts +0 -0
  981. package/dist/src/parser/setStrokeFillOpacity.d.ts.map +0 -0
  982. package/dist/src/parser/setStrokeFillOpacity.min.mjs +0 -0
  983. package/dist/src/parser/setStrokeFillOpacity.min.mjs.map +0 -0
  984. package/dist/src/parser/setStrokeFillOpacity.mjs +0 -0
  985. package/dist/src/parser/setStrokeFillOpacity.mjs.map +0 -0
  986. package/dist/src/parser/typedefs.d.ts +0 -0
  987. package/dist/src/parser/typedefs.d.ts.map +0 -0
  988. package/dist/src/shapes/ActiveSelection.d.ts +0 -0
  989. package/dist/src/shapes/ActiveSelection.d.ts.map +0 -0
  990. package/dist/src/shapes/ActiveSelection.min.mjs +0 -0
  991. package/dist/src/shapes/ActiveSelection.min.mjs.map +0 -0
  992. package/dist/src/shapes/ActiveSelection.mjs +0 -0
  993. package/dist/src/shapes/ActiveSelection.mjs.map +0 -0
  994. package/dist/src/shapes/Circle.d.ts +0 -0
  995. package/dist/src/shapes/Circle.d.ts.map +0 -0
  996. package/dist/src/shapes/Circle.min.mjs +0 -0
  997. package/dist/src/shapes/Circle.min.mjs.map +0 -0
  998. package/dist/src/shapes/Circle.mjs +0 -0
  999. package/dist/src/shapes/Circle.mjs.map +0 -0
  1000. package/dist/src/shapes/Ellipse.d.ts +0 -0
  1001. package/dist/src/shapes/Ellipse.d.ts.map +0 -0
  1002. package/dist/src/shapes/Ellipse.min.mjs +0 -0
  1003. package/dist/src/shapes/Ellipse.min.mjs.map +0 -0
  1004. package/dist/src/shapes/Ellipse.mjs +0 -0
  1005. package/dist/src/shapes/Ellipse.mjs.map +0 -0
  1006. package/dist/src/shapes/Group.d.ts +0 -0
  1007. package/dist/src/shapes/Group.d.ts.map +0 -0
  1008. package/dist/src/shapes/Group.min.mjs +0 -0
  1009. package/dist/src/shapes/Group.min.mjs.map +0 -0
  1010. package/dist/src/shapes/Group.mjs +0 -0
  1011. package/dist/src/shapes/Group.mjs.map +0 -0
  1012. package/dist/src/shapes/IText/DraggableTextDelegate.d.ts +0 -0
  1013. package/dist/src/shapes/IText/DraggableTextDelegate.d.ts.map +0 -0
  1014. package/dist/src/shapes/IText/DraggableTextDelegate.min.mjs +0 -0
  1015. package/dist/src/shapes/IText/DraggableTextDelegate.min.mjs.map +0 -0
  1016. package/dist/src/shapes/IText/DraggableTextDelegate.mjs +0 -0
  1017. package/dist/src/shapes/IText/DraggableTextDelegate.mjs.map +0 -0
  1018. package/dist/src/shapes/IText/IText.d.ts +0 -0
  1019. package/dist/src/shapes/IText/IText.d.ts.map +0 -0
  1020. package/dist/src/shapes/IText/IText.min.mjs +0 -0
  1021. package/dist/src/shapes/IText/IText.min.mjs.map +1 -1
  1022. package/dist/src/shapes/IText/IText.mjs +206 -206
  1023. package/dist/src/shapes/IText/IText.mjs.map +1 -1
  1024. package/dist/src/shapes/IText/ITextBehavior.d.ts +0 -0
  1025. package/dist/src/shapes/IText/ITextBehavior.d.ts.map +1 -1
  1026. package/dist/src/shapes/IText/ITextBehavior.min.mjs +1 -1
  1027. package/dist/src/shapes/IText/ITextBehavior.min.mjs.map +1 -1
  1028. package/dist/src/shapes/IText/ITextBehavior.mjs +162 -152
  1029. package/dist/src/shapes/IText/ITextBehavior.mjs.map +1 -1
  1030. package/dist/src/shapes/IText/ITextClickBehavior.d.ts +0 -0
  1031. package/dist/src/shapes/IText/ITextClickBehavior.d.ts.map +0 -0
  1032. package/dist/src/shapes/IText/ITextClickBehavior.min.mjs +0 -0
  1033. package/dist/src/shapes/IText/ITextClickBehavior.min.mjs.map +1 -1
  1034. package/dist/src/shapes/IText/ITextClickBehavior.mjs +36 -36
  1035. package/dist/src/shapes/IText/ITextClickBehavior.mjs.map +1 -1
  1036. package/dist/src/shapes/IText/ITextKeyBehavior.d.ts +0 -0
  1037. package/dist/src/shapes/IText/ITextKeyBehavior.d.ts.map +1 -1
  1038. package/dist/src/shapes/IText/ITextKeyBehavior.min.mjs +1 -1
  1039. package/dist/src/shapes/IText/ITextKeyBehavior.min.mjs.map +1 -1
  1040. package/dist/src/shapes/IText/ITextKeyBehavior.mjs +47 -1
  1041. package/dist/src/shapes/IText/ITextKeyBehavior.mjs.map +1 -1
  1042. package/dist/src/shapes/IText/constants.d.ts +0 -0
  1043. package/dist/src/shapes/IText/constants.d.ts.map +0 -0
  1044. package/dist/src/shapes/IText/constants.min.mjs +0 -0
  1045. package/dist/src/shapes/IText/constants.min.mjs.map +0 -0
  1046. package/dist/src/shapes/IText/constants.mjs +0 -0
  1047. package/dist/src/shapes/IText/constants.mjs.map +0 -0
  1048. package/dist/src/shapes/Image.d.ts +0 -0
  1049. package/dist/src/shapes/Image.d.ts.map +0 -0
  1050. package/dist/src/shapes/Image.min.mjs +0 -0
  1051. package/dist/src/shapes/Image.min.mjs.map +0 -0
  1052. package/dist/src/shapes/Image.mjs +0 -0
  1053. package/dist/src/shapes/Image.mjs.map +0 -0
  1054. package/dist/src/shapes/Line.d.ts +33 -86
  1055. package/dist/src/shapes/Line.d.ts.map +1 -1
  1056. package/dist/src/shapes/Line.min.mjs +1 -1
  1057. package/dist/src/shapes/Line.min.mjs.map +1 -1
  1058. package/dist/src/shapes/Line.mjs +405 -159
  1059. package/dist/src/shapes/Line.mjs.map +1 -1
  1060. package/dist/src/shapes/Object/FabricObject.d.ts +0 -0
  1061. package/dist/src/shapes/Object/FabricObject.d.ts.map +0 -0
  1062. package/dist/src/shapes/Object/FabricObject.min.mjs +0 -0
  1063. package/dist/src/shapes/Object/FabricObject.min.mjs.map +0 -0
  1064. package/dist/src/shapes/Object/FabricObject.mjs +0 -0
  1065. package/dist/src/shapes/Object/FabricObject.mjs.map +0 -0
  1066. package/dist/src/shapes/Object/FabricObjectSVGExportMixin.d.ts +0 -0
  1067. package/dist/src/shapes/Object/FabricObjectSVGExportMixin.d.ts.map +0 -0
  1068. package/dist/src/shapes/Object/FabricObjectSVGExportMixin.min.mjs +0 -0
  1069. package/dist/src/shapes/Object/FabricObjectSVGExportMixin.min.mjs.map +0 -0
  1070. package/dist/src/shapes/Object/FabricObjectSVGExportMixin.mjs +0 -0
  1071. package/dist/src/shapes/Object/FabricObjectSVGExportMixin.mjs.map +0 -0
  1072. package/dist/src/shapes/Object/InteractiveObject.d.ts +0 -0
  1073. package/dist/src/shapes/Object/InteractiveObject.d.ts.map +0 -0
  1074. package/dist/src/shapes/Object/InteractiveObject.min.mjs +0 -0
  1075. package/dist/src/shapes/Object/InteractiveObject.min.mjs.map +0 -0
  1076. package/dist/src/shapes/Object/InteractiveObject.mjs +0 -0
  1077. package/dist/src/shapes/Object/InteractiveObject.mjs.map +0 -0
  1078. package/dist/src/shapes/Object/Object.d.ts +0 -0
  1079. package/dist/src/shapes/Object/Object.d.ts.map +0 -0
  1080. package/dist/src/shapes/Object/Object.min.mjs +0 -0
  1081. package/dist/src/shapes/Object/Object.min.mjs.map +0 -0
  1082. package/dist/src/shapes/Object/Object.mjs +0 -0
  1083. package/dist/src/shapes/Object/Object.mjs.map +0 -0
  1084. package/dist/src/shapes/Object/ObjectGeometry.d.ts +0 -0
  1085. package/dist/src/shapes/Object/ObjectGeometry.d.ts.map +0 -0
  1086. package/dist/src/shapes/Object/ObjectGeometry.min.mjs +0 -0
  1087. package/dist/src/shapes/Object/ObjectGeometry.min.mjs.map +0 -0
  1088. package/dist/src/shapes/Object/ObjectGeometry.mjs +0 -0
  1089. package/dist/src/shapes/Object/ObjectGeometry.mjs.map +0 -0
  1090. package/dist/src/shapes/Object/defaultValues.d.ts +0 -0
  1091. package/dist/src/shapes/Object/defaultValues.d.ts.map +0 -0
  1092. package/dist/src/shapes/Object/defaultValues.min.mjs +0 -0
  1093. package/dist/src/shapes/Object/defaultValues.min.mjs.map +0 -0
  1094. package/dist/src/shapes/Object/defaultValues.mjs +0 -0
  1095. package/dist/src/shapes/Object/defaultValues.mjs.map +0 -0
  1096. package/dist/src/shapes/Object/types/BaseProps.d.ts +0 -0
  1097. package/dist/src/shapes/Object/types/BaseProps.d.ts.map +0 -0
  1098. package/dist/src/shapes/Object/types/BorderProps.d.ts +0 -0
  1099. package/dist/src/shapes/Object/types/BorderProps.d.ts.map +0 -0
  1100. package/dist/src/shapes/Object/types/ControlProps.d.ts +0 -0
  1101. package/dist/src/shapes/Object/types/ControlProps.d.ts.map +0 -0
  1102. package/dist/src/shapes/Object/types/FabricObjectProps.d.ts +0 -0
  1103. package/dist/src/shapes/Object/types/FabricObjectProps.d.ts.map +0 -0
  1104. package/dist/src/shapes/Object/types/FillStrokeProps.d.ts +0 -0
  1105. package/dist/src/shapes/Object/types/FillStrokeProps.d.ts.map +0 -0
  1106. package/dist/src/shapes/Object/types/LockInteractionProps.d.ts +0 -0
  1107. package/dist/src/shapes/Object/types/LockInteractionProps.d.ts.map +0 -0
  1108. package/dist/src/shapes/Object/types/ObjectProps.d.ts +0 -0
  1109. package/dist/src/shapes/Object/types/ObjectProps.d.ts.map +0 -0
  1110. package/dist/src/shapes/Object/types/ObjectTransformProps.d.ts +0 -0
  1111. package/dist/src/shapes/Object/types/ObjectTransformProps.d.ts.map +0 -0
  1112. package/dist/src/shapes/Object/types/SerializedObjectProps.d.ts +0 -0
  1113. package/dist/src/shapes/Object/types/SerializedObjectProps.d.ts.map +0 -0
  1114. package/dist/src/shapes/Object/types/index.d.ts +0 -0
  1115. package/dist/src/shapes/Object/types/index.d.ts.map +0 -0
  1116. package/dist/src/shapes/Path.d.ts +0 -0
  1117. package/dist/src/shapes/Path.d.ts.map +0 -0
  1118. package/dist/src/shapes/Path.min.mjs +0 -0
  1119. package/dist/src/shapes/Path.min.mjs.map +0 -0
  1120. package/dist/src/shapes/Path.mjs +0 -0
  1121. package/dist/src/shapes/Path.mjs.map +0 -0
  1122. package/dist/src/shapes/Polygon.d.ts +0 -0
  1123. package/dist/src/shapes/Polygon.d.ts.map +0 -0
  1124. package/dist/src/shapes/Polygon.min.mjs +0 -0
  1125. package/dist/src/shapes/Polygon.min.mjs.map +0 -0
  1126. package/dist/src/shapes/Polygon.mjs +0 -0
  1127. package/dist/src/shapes/Polygon.mjs.map +0 -0
  1128. package/dist/src/shapes/Polyline.d.ts +7 -0
  1129. package/dist/src/shapes/Polyline.d.ts.map +1 -1
  1130. package/dist/src/shapes/Polyline.min.mjs +1 -1
  1131. package/dist/src/shapes/Polyline.min.mjs.map +1 -1
  1132. package/dist/src/shapes/Polyline.mjs +48 -16
  1133. package/dist/src/shapes/Polyline.mjs.map +1 -1
  1134. package/dist/src/shapes/Rect.d.ts +0 -0
  1135. package/dist/src/shapes/Rect.d.ts.map +0 -0
  1136. package/dist/src/shapes/Rect.min.mjs +0 -0
  1137. package/dist/src/shapes/Rect.min.mjs.map +0 -0
  1138. package/dist/src/shapes/Rect.mjs +0 -0
  1139. package/dist/src/shapes/Rect.mjs.map +0 -0
  1140. package/dist/src/shapes/Text/StyledText.d.ts +0 -0
  1141. package/dist/src/shapes/Text/StyledText.d.ts.map +0 -0
  1142. package/dist/src/shapes/Text/StyledText.min.mjs +0 -0
  1143. package/dist/src/shapes/Text/StyledText.min.mjs.map +0 -0
  1144. package/dist/src/shapes/Text/StyledText.mjs +0 -0
  1145. package/dist/src/shapes/Text/StyledText.mjs.map +0 -0
  1146. package/dist/src/shapes/Text/Text.d.ts +19 -0
  1147. package/dist/src/shapes/Text/Text.d.ts.map +1 -1
  1148. package/dist/src/shapes/Text/Text.min.mjs +1 -1
  1149. package/dist/src/shapes/Text/Text.min.mjs.map +1 -1
  1150. package/dist/src/shapes/Text/Text.mjs +585 -299
  1151. package/dist/src/shapes/Text/Text.mjs.map +1 -1
  1152. package/dist/src/shapes/Text/TextSVGExportMixin.d.ts +0 -0
  1153. package/dist/src/shapes/Text/TextSVGExportMixin.d.ts.map +0 -0
  1154. package/dist/src/shapes/Text/TextSVGExportMixin.min.mjs +0 -0
  1155. package/dist/src/shapes/Text/TextSVGExportMixin.min.mjs.map +0 -0
  1156. package/dist/src/shapes/Text/TextSVGExportMixin.mjs +0 -0
  1157. package/dist/src/shapes/Text/TextSVGExportMixin.mjs.map +0 -0
  1158. package/dist/src/shapes/Text/constants.d.ts +0 -0
  1159. package/dist/src/shapes/Text/constants.d.ts.map +0 -0
  1160. package/dist/src/shapes/Text/constants.min.mjs +0 -0
  1161. package/dist/src/shapes/Text/constants.min.mjs.map +1 -1
  1162. package/dist/src/shapes/Text/constants.mjs +0 -0
  1163. package/dist/src/shapes/Text/constants.mjs.map +1 -1
  1164. package/dist/src/shapes/Textbox.d.ts +43 -1
  1165. package/dist/src/shapes/Textbox.d.ts.map +1 -1
  1166. package/dist/src/shapes/Textbox.min.mjs +1 -1
  1167. package/dist/src/shapes/Textbox.min.mjs.map +1 -1
  1168. package/dist/src/shapes/Textbox.mjs +668 -214
  1169. package/dist/src/shapes/Textbox.mjs.map +1 -1
  1170. package/dist/src/shapes/Triangle.d.ts +27 -2
  1171. package/dist/src/shapes/Triangle.d.ts.map +1 -1
  1172. package/dist/src/shapes/Triangle.min.mjs +1 -1
  1173. package/dist/src/shapes/Triangle.min.mjs.map +1 -1
  1174. package/dist/src/shapes/Triangle.mjs +72 -12
  1175. package/dist/src/shapes/Triangle.mjs.map +1 -1
  1176. package/dist/src/text/browserLines.d.ts +0 -0
  1177. package/dist/src/text/browserLines.d.ts.map +0 -0
  1178. package/dist/src/text/browserLines.min.mjs +0 -0
  1179. package/dist/src/text/browserLines.min.mjs.map +1 -1
  1180. package/dist/src/text/browserLines.mjs +20 -20
  1181. package/dist/src/text/browserLines.mjs.map +1 -1
  1182. package/dist/src/text/ellipsis.d.ts +0 -0
  1183. package/dist/src/text/ellipsis.d.ts.map +0 -0
  1184. package/dist/src/text/ellipsis.min.mjs +0 -0
  1185. package/dist/src/text/ellipsis.min.mjs.map +1 -1
  1186. package/dist/src/text/ellipsis.mjs +11 -11
  1187. package/dist/src/text/ellipsis.mjs.map +1 -1
  1188. package/dist/src/text/hitTest.d.ts +0 -0
  1189. package/dist/src/text/hitTest.d.ts.map +0 -0
  1190. package/dist/src/text/hitTest.min.mjs +0 -0
  1191. package/dist/src/text/hitTest.min.mjs.map +1 -1
  1192. package/dist/src/text/hitTest.mjs +19 -19
  1193. package/dist/src/text/hitTest.mjs.map +1 -1
  1194. package/dist/src/text/layout.d.ts +0 -0
  1195. package/dist/src/text/layout.d.ts.map +0 -0
  1196. package/dist/src/text/layout.min.mjs +0 -0
  1197. package/dist/src/text/layout.min.mjs.map +1 -1
  1198. package/dist/src/text/layout.mjs +33 -33
  1199. package/dist/src/text/layout.mjs.map +1 -1
  1200. package/dist/src/text/measure.d.ts +9 -0
  1201. package/dist/src/text/measure.d.ts.map +1 -1
  1202. package/dist/src/text/measure.min.mjs +1 -1
  1203. package/dist/src/text/measure.min.mjs.map +1 -1
  1204. package/dist/src/text/measure.mjs +195 -24
  1205. package/dist/src/text/measure.mjs.map +1 -1
  1206. package/dist/src/text/overlayEditor.d.ts +0 -0
  1207. package/dist/src/text/overlayEditor.d.ts.map +1 -1
  1208. package/dist/src/text/overlayEditor.min.mjs +1 -1
  1209. package/dist/src/text/overlayEditor.min.mjs.map +1 -1
  1210. package/dist/src/text/overlayEditor.mjs +188 -42
  1211. package/dist/src/text/overlayEditor.mjs.map +1 -1
  1212. package/dist/src/text/unicode.d.ts +0 -0
  1213. package/dist/src/text/unicode.d.ts.map +0 -0
  1214. package/dist/src/text/unicode.min.mjs +0 -0
  1215. package/dist/src/text/unicode.min.mjs.map +1 -1
  1216. package/dist/src/text/unicode.mjs +8 -8
  1217. package/dist/src/text/unicode.mjs.map +1 -1
  1218. package/dist/src/typedefs.d.ts +0 -0
  1219. package/dist/src/typedefs.d.ts.map +0 -0
  1220. package/dist/src/util/animation/AnimationBase.d.ts +0 -0
  1221. package/dist/src/util/animation/AnimationBase.d.ts.map +0 -0
  1222. package/dist/src/util/animation/AnimationBase.min.mjs +0 -0
  1223. package/dist/src/util/animation/AnimationBase.min.mjs.map +0 -0
  1224. package/dist/src/util/animation/AnimationBase.mjs +0 -0
  1225. package/dist/src/util/animation/AnimationBase.mjs.map +0 -0
  1226. package/dist/src/util/animation/AnimationFrameProvider.d.ts +0 -0
  1227. package/dist/src/util/animation/AnimationFrameProvider.d.ts.map +0 -0
  1228. package/dist/src/util/animation/AnimationFrameProvider.min.mjs +0 -0
  1229. package/dist/src/util/animation/AnimationFrameProvider.min.mjs.map +0 -0
  1230. package/dist/src/util/animation/AnimationFrameProvider.mjs +0 -0
  1231. package/dist/src/util/animation/AnimationFrameProvider.mjs.map +0 -0
  1232. package/dist/src/util/animation/AnimationRegistry.d.ts +0 -0
  1233. package/dist/src/util/animation/AnimationRegistry.d.ts.map +0 -0
  1234. package/dist/src/util/animation/AnimationRegistry.min.mjs +0 -0
  1235. package/dist/src/util/animation/AnimationRegistry.min.mjs.map +0 -0
  1236. package/dist/src/util/animation/AnimationRegistry.mjs +0 -0
  1237. package/dist/src/util/animation/AnimationRegistry.mjs.map +0 -0
  1238. package/dist/src/util/animation/ArrayAnimation.d.ts +0 -0
  1239. package/dist/src/util/animation/ArrayAnimation.d.ts.map +0 -0
  1240. package/dist/src/util/animation/ArrayAnimation.min.mjs +0 -0
  1241. package/dist/src/util/animation/ArrayAnimation.min.mjs.map +0 -0
  1242. package/dist/src/util/animation/ArrayAnimation.mjs +0 -0
  1243. package/dist/src/util/animation/ArrayAnimation.mjs.map +0 -0
  1244. package/dist/src/util/animation/ColorAnimation.d.ts +0 -0
  1245. package/dist/src/util/animation/ColorAnimation.d.ts.map +0 -0
  1246. package/dist/src/util/animation/ColorAnimation.min.mjs +0 -0
  1247. package/dist/src/util/animation/ColorAnimation.min.mjs.map +0 -0
  1248. package/dist/src/util/animation/ColorAnimation.mjs +0 -0
  1249. package/dist/src/util/animation/ColorAnimation.mjs.map +0 -0
  1250. package/dist/src/util/animation/ValueAnimation.d.ts +0 -0
  1251. package/dist/src/util/animation/ValueAnimation.d.ts.map +0 -0
  1252. package/dist/src/util/animation/ValueAnimation.min.mjs +0 -0
  1253. package/dist/src/util/animation/ValueAnimation.min.mjs.map +0 -0
  1254. package/dist/src/util/animation/ValueAnimation.mjs +0 -0
  1255. package/dist/src/util/animation/ValueAnimation.mjs.map +0 -0
  1256. package/dist/src/util/animation/animate.d.ts +0 -0
  1257. package/dist/src/util/animation/animate.d.ts.map +0 -0
  1258. package/dist/src/util/animation/animate.min.mjs +0 -0
  1259. package/dist/src/util/animation/animate.min.mjs.map +0 -0
  1260. package/dist/src/util/animation/animate.mjs +0 -0
  1261. package/dist/src/util/animation/animate.mjs.map +0 -0
  1262. package/dist/src/util/animation/easing.d.ts +0 -0
  1263. package/dist/src/util/animation/easing.d.ts.map +0 -0
  1264. package/dist/src/util/animation/easing.min.mjs +0 -0
  1265. package/dist/src/util/animation/easing.min.mjs.map +0 -0
  1266. package/dist/src/util/animation/easing.mjs +0 -0
  1267. package/dist/src/util/animation/easing.mjs.map +0 -0
  1268. package/dist/src/util/animation/index.d.ts +0 -0
  1269. package/dist/src/util/animation/index.d.ts.map +0 -0
  1270. package/dist/src/util/animation/types.d.ts +0 -0
  1271. package/dist/src/util/animation/types.d.ts.map +0 -0
  1272. package/dist/src/util/applyMixins.d.ts +0 -0
  1273. package/dist/src/util/applyMixins.d.ts.map +0 -0
  1274. package/dist/src/util/applyMixins.min.mjs +0 -0
  1275. package/dist/src/util/applyMixins.min.mjs.map +0 -0
  1276. package/dist/src/util/applyMixins.mjs +0 -0
  1277. package/dist/src/util/applyMixins.mjs.map +0 -0
  1278. package/dist/src/util/dom_event.d.ts +0 -0
  1279. package/dist/src/util/dom_event.d.ts.map +0 -0
  1280. package/dist/src/util/dom_event.min.mjs +0 -0
  1281. package/dist/src/util/dom_event.min.mjs.map +0 -0
  1282. package/dist/src/util/dom_event.mjs +0 -0
  1283. package/dist/src/util/dom_event.mjs.map +0 -0
  1284. package/dist/src/util/dom_misc.d.ts +0 -0
  1285. package/dist/src/util/dom_misc.d.ts.map +0 -0
  1286. package/dist/src/util/dom_misc.min.mjs +0 -0
  1287. package/dist/src/util/dom_misc.min.mjs.map +0 -0
  1288. package/dist/src/util/dom_misc.mjs +0 -0
  1289. package/dist/src/util/dom_misc.mjs.map +0 -0
  1290. package/dist/src/util/index.d.ts +0 -0
  1291. package/dist/src/util/index.d.ts.map +0 -0
  1292. package/dist/src/util/index.min.mjs +0 -0
  1293. package/dist/src/util/index.min.mjs.map +0 -0
  1294. package/dist/src/util/index.mjs +0 -0
  1295. package/dist/src/util/index.mjs.map +0 -0
  1296. package/dist/src/util/internals/applyCanvasTransform.d.ts +0 -0
  1297. package/dist/src/util/internals/applyCanvasTransform.d.ts.map +0 -0
  1298. package/dist/src/util/internals/applyCanvasTransform.min.mjs +0 -0
  1299. package/dist/src/util/internals/applyCanvasTransform.min.mjs.map +0 -0
  1300. package/dist/src/util/internals/applyCanvasTransform.mjs +0 -0
  1301. package/dist/src/util/internals/applyCanvasTransform.mjs.map +0 -0
  1302. package/dist/src/util/internals/cleanupSvgAttribute.d.ts +0 -0
  1303. package/dist/src/util/internals/cleanupSvgAttribute.d.ts.map +0 -0
  1304. package/dist/src/util/internals/cleanupSvgAttribute.min.mjs +0 -0
  1305. package/dist/src/util/internals/cleanupSvgAttribute.min.mjs.map +0 -0
  1306. package/dist/src/util/internals/cleanupSvgAttribute.mjs +0 -0
  1307. package/dist/src/util/internals/cleanupSvgAttribute.mjs.map +0 -0
  1308. package/dist/src/util/internals/cloneStyles.d.ts +0 -0
  1309. package/dist/src/util/internals/cloneStyles.d.ts.map +0 -0
  1310. package/dist/src/util/internals/cloneStyles.min.mjs +0 -0
  1311. package/dist/src/util/internals/cloneStyles.min.mjs.map +0 -0
  1312. package/dist/src/util/internals/cloneStyles.mjs +0 -0
  1313. package/dist/src/util/internals/cloneStyles.mjs.map +0 -0
  1314. package/dist/src/util/internals/console.d.ts +0 -0
  1315. package/dist/src/util/internals/console.d.ts.map +0 -0
  1316. package/dist/src/util/internals/console.min.mjs +0 -0
  1317. package/dist/src/util/internals/console.min.mjs.map +0 -0
  1318. package/dist/src/util/internals/console.mjs +0 -0
  1319. package/dist/src/util/internals/console.mjs.map +0 -0
  1320. package/dist/src/util/internals/dom_style.d.ts +0 -0
  1321. package/dist/src/util/internals/dom_style.d.ts.map +0 -0
  1322. package/dist/src/util/internals/dom_style.min.mjs +0 -0
  1323. package/dist/src/util/internals/dom_style.min.mjs.map +0 -0
  1324. package/dist/src/util/internals/dom_style.mjs +0 -0
  1325. package/dist/src/util/internals/dom_style.mjs.map +0 -0
  1326. package/dist/src/util/internals/findRight.d.ts +0 -0
  1327. package/dist/src/util/internals/findRight.d.ts.map +0 -0
  1328. package/dist/src/util/internals/findRight.min.mjs +0 -0
  1329. package/dist/src/util/internals/findRight.min.mjs.map +0 -0
  1330. package/dist/src/util/internals/findRight.mjs +0 -0
  1331. package/dist/src/util/internals/findRight.mjs.map +0 -0
  1332. package/dist/src/util/internals/getRandomInt.d.ts +0 -0
  1333. package/dist/src/util/internals/getRandomInt.d.ts.map +0 -0
  1334. package/dist/src/util/internals/getRandomInt.min.mjs +0 -0
  1335. package/dist/src/util/internals/getRandomInt.min.mjs.map +0 -0
  1336. package/dist/src/util/internals/getRandomInt.mjs +0 -0
  1337. package/dist/src/util/internals/getRandomInt.mjs.map +0 -0
  1338. package/dist/src/util/internals/ifNaN.d.ts +0 -0
  1339. package/dist/src/util/internals/ifNaN.d.ts.map +0 -0
  1340. package/dist/src/util/internals/ifNaN.min.mjs +0 -0
  1341. package/dist/src/util/internals/ifNaN.min.mjs.map +0 -0
  1342. package/dist/src/util/internals/ifNaN.mjs +0 -0
  1343. package/dist/src/util/internals/ifNaN.mjs.map +0 -0
  1344. package/dist/src/util/internals/removeFromArray.d.ts +0 -0
  1345. package/dist/src/util/internals/removeFromArray.d.ts.map +0 -0
  1346. package/dist/src/util/internals/removeFromArray.min.mjs +0 -0
  1347. package/dist/src/util/internals/removeFromArray.min.mjs.map +0 -0
  1348. package/dist/src/util/internals/removeFromArray.mjs +0 -0
  1349. package/dist/src/util/internals/removeFromArray.mjs.map +0 -0
  1350. package/dist/src/util/internals/uid.d.ts +0 -0
  1351. package/dist/src/util/internals/uid.d.ts.map +0 -0
  1352. package/dist/src/util/internals/uid.min.mjs +0 -0
  1353. package/dist/src/util/internals/uid.min.mjs.map +0 -0
  1354. package/dist/src/util/internals/uid.mjs +0 -0
  1355. package/dist/src/util/internals/uid.mjs.map +0 -0
  1356. package/dist/src/util/lang_string.d.ts +0 -0
  1357. package/dist/src/util/lang_string.d.ts.map +0 -0
  1358. package/dist/src/util/lang_string.min.mjs +0 -0
  1359. package/dist/src/util/lang_string.min.mjs.map +0 -0
  1360. package/dist/src/util/lang_string.mjs +0 -0
  1361. package/dist/src/util/lang_string.mjs.map +0 -0
  1362. package/dist/src/util/misc/boundingBoxFromPoints.d.ts +0 -0
  1363. package/dist/src/util/misc/boundingBoxFromPoints.d.ts.map +0 -0
  1364. package/dist/src/util/misc/boundingBoxFromPoints.min.mjs +0 -0
  1365. package/dist/src/util/misc/boundingBoxFromPoints.min.mjs.map +0 -0
  1366. package/dist/src/util/misc/boundingBoxFromPoints.mjs +0 -0
  1367. package/dist/src/util/misc/boundingBoxFromPoints.mjs.map +0 -0
  1368. package/dist/src/util/misc/capValue.d.ts +0 -0
  1369. package/dist/src/util/misc/capValue.d.ts.map +0 -0
  1370. package/dist/src/util/misc/capValue.min.mjs +0 -0
  1371. package/dist/src/util/misc/capValue.min.mjs.map +0 -0
  1372. package/dist/src/util/misc/capValue.mjs +0 -0
  1373. package/dist/src/util/misc/capValue.mjs.map +0 -0
  1374. package/dist/src/util/misc/cornerRadius.d.ts +70 -0
  1375. package/dist/src/util/misc/cornerRadius.d.ts.map +1 -0
  1376. package/dist/src/util/misc/cornerRadius.min.mjs +2 -0
  1377. package/dist/src/util/misc/cornerRadius.min.mjs.map +1 -0
  1378. package/dist/src/util/misc/cornerRadius.mjs +181 -0
  1379. package/dist/src/util/misc/cornerRadius.mjs.map +1 -0
  1380. package/dist/src/util/misc/cos.d.ts +0 -0
  1381. package/dist/src/util/misc/cos.d.ts.map +0 -0
  1382. package/dist/src/util/misc/cos.min.mjs +0 -0
  1383. package/dist/src/util/misc/cos.min.mjs.map +0 -0
  1384. package/dist/src/util/misc/cos.mjs +0 -0
  1385. package/dist/src/util/misc/cos.mjs.map +0 -0
  1386. package/dist/src/util/misc/dom.d.ts +0 -0
  1387. package/dist/src/util/misc/dom.d.ts.map +0 -0
  1388. package/dist/src/util/misc/dom.min.mjs +0 -0
  1389. package/dist/src/util/misc/dom.min.mjs.map +0 -0
  1390. package/dist/src/util/misc/dom.mjs +0 -0
  1391. package/dist/src/util/misc/dom.mjs.map +0 -0
  1392. package/dist/src/util/misc/findScaleTo.d.ts +0 -0
  1393. package/dist/src/util/misc/findScaleTo.d.ts.map +0 -0
  1394. package/dist/src/util/misc/findScaleTo.min.mjs +0 -0
  1395. package/dist/src/util/misc/findScaleTo.min.mjs.map +0 -0
  1396. package/dist/src/util/misc/findScaleTo.mjs +0 -0
  1397. package/dist/src/util/misc/findScaleTo.mjs.map +0 -0
  1398. package/dist/src/util/misc/groupSVGElements.d.ts +0 -0
  1399. package/dist/src/util/misc/groupSVGElements.d.ts.map +0 -0
  1400. package/dist/src/util/misc/groupSVGElements.min.mjs +0 -0
  1401. package/dist/src/util/misc/groupSVGElements.min.mjs.map +0 -0
  1402. package/dist/src/util/misc/groupSVGElements.mjs +0 -0
  1403. package/dist/src/util/misc/groupSVGElements.mjs.map +0 -0
  1404. package/dist/src/util/misc/isTransparent.d.ts +0 -0
  1405. package/dist/src/util/misc/isTransparent.d.ts.map +0 -0
  1406. package/dist/src/util/misc/isTransparent.min.mjs +0 -0
  1407. package/dist/src/util/misc/isTransparent.min.mjs.map +0 -0
  1408. package/dist/src/util/misc/isTransparent.mjs +0 -0
  1409. package/dist/src/util/misc/isTransparent.mjs.map +0 -0
  1410. package/dist/src/util/misc/matrix.d.ts +0 -0
  1411. package/dist/src/util/misc/matrix.d.ts.map +0 -0
  1412. package/dist/src/util/misc/matrix.min.mjs +0 -0
  1413. package/dist/src/util/misc/matrix.min.mjs.map +0 -0
  1414. package/dist/src/util/misc/matrix.mjs +0 -0
  1415. package/dist/src/util/misc/matrix.mjs.map +0 -0
  1416. package/dist/src/util/misc/mergeClipPaths.d.ts +0 -0
  1417. package/dist/src/util/misc/mergeClipPaths.d.ts.map +0 -0
  1418. package/dist/src/util/misc/mergeClipPaths.min.mjs +0 -0
  1419. package/dist/src/util/misc/mergeClipPaths.min.mjs.map +0 -0
  1420. package/dist/src/util/misc/mergeClipPaths.mjs +0 -0
  1421. package/dist/src/util/misc/mergeClipPaths.mjs.map +0 -0
  1422. package/dist/src/util/misc/objectEnlive.d.ts +0 -0
  1423. package/dist/src/util/misc/objectEnlive.d.ts.map +0 -0
  1424. package/dist/src/util/misc/objectEnlive.min.mjs +0 -0
  1425. package/dist/src/util/misc/objectEnlive.min.mjs.map +0 -0
  1426. package/dist/src/util/misc/objectEnlive.mjs +0 -0
  1427. package/dist/src/util/misc/objectEnlive.mjs.map +0 -0
  1428. package/dist/src/util/misc/objectTransforms.d.ts +0 -0
  1429. package/dist/src/util/misc/objectTransforms.d.ts.map +0 -0
  1430. package/dist/src/util/misc/objectTransforms.min.mjs +0 -0
  1431. package/dist/src/util/misc/objectTransforms.min.mjs.map +0 -0
  1432. package/dist/src/util/misc/objectTransforms.mjs +0 -0
  1433. package/dist/src/util/misc/objectTransforms.mjs.map +0 -0
  1434. package/dist/src/util/misc/pick.d.ts +0 -0
  1435. package/dist/src/util/misc/pick.d.ts.map +0 -0
  1436. package/dist/src/util/misc/pick.min.mjs +0 -0
  1437. package/dist/src/util/misc/pick.min.mjs.map +0 -0
  1438. package/dist/src/util/misc/pick.mjs +0 -0
  1439. package/dist/src/util/misc/pick.mjs.map +0 -0
  1440. package/dist/src/util/misc/planeChange.d.ts +0 -0
  1441. package/dist/src/util/misc/planeChange.d.ts.map +0 -0
  1442. package/dist/src/util/misc/planeChange.min.mjs +0 -0
  1443. package/dist/src/util/misc/planeChange.min.mjs.map +0 -0
  1444. package/dist/src/util/misc/planeChange.mjs +0 -0
  1445. package/dist/src/util/misc/planeChange.mjs.map +0 -0
  1446. package/dist/src/util/misc/projectStroke/StrokeLineCapProjections.d.ts +0 -0
  1447. package/dist/src/util/misc/projectStroke/StrokeLineCapProjections.d.ts.map +0 -0
  1448. package/dist/src/util/misc/projectStroke/StrokeLineCapProjections.min.mjs +0 -0
  1449. package/dist/src/util/misc/projectStroke/StrokeLineCapProjections.min.mjs.map +0 -0
  1450. package/dist/src/util/misc/projectStroke/StrokeLineCapProjections.mjs +0 -0
  1451. package/dist/src/util/misc/projectStroke/StrokeLineCapProjections.mjs.map +0 -0
  1452. package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.d.ts +0 -0
  1453. package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.d.ts.map +0 -0
  1454. package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.min.mjs +0 -0
  1455. package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.min.mjs.map +0 -0
  1456. package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.mjs +0 -0
  1457. package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.mjs.map +0 -0
  1458. package/dist/src/util/misc/projectStroke/StrokeProjectionsBase.d.ts +0 -0
  1459. package/dist/src/util/misc/projectStroke/StrokeProjectionsBase.d.ts.map +0 -0
  1460. package/dist/src/util/misc/projectStroke/StrokeProjectionsBase.min.mjs +0 -0
  1461. package/dist/src/util/misc/projectStroke/StrokeProjectionsBase.min.mjs.map +0 -0
  1462. package/dist/src/util/misc/projectStroke/StrokeProjectionsBase.mjs +0 -0
  1463. package/dist/src/util/misc/projectStroke/StrokeProjectionsBase.mjs.map +0 -0
  1464. package/dist/src/util/misc/projectStroke/index.d.ts +0 -0
  1465. package/dist/src/util/misc/projectStroke/index.d.ts.map +0 -0
  1466. package/dist/src/util/misc/projectStroke/index.min.mjs +0 -0
  1467. package/dist/src/util/misc/projectStroke/index.min.mjs.map +0 -0
  1468. package/dist/src/util/misc/projectStroke/index.mjs +0 -0
  1469. package/dist/src/util/misc/projectStroke/index.mjs.map +0 -0
  1470. package/dist/src/util/misc/projectStroke/types.d.ts +0 -0
  1471. package/dist/src/util/misc/projectStroke/types.d.ts.map +0 -0
  1472. package/dist/src/util/misc/radiansDegreesConversion.d.ts +0 -0
  1473. package/dist/src/util/misc/radiansDegreesConversion.d.ts.map +0 -0
  1474. package/dist/src/util/misc/radiansDegreesConversion.min.mjs +0 -0
  1475. package/dist/src/util/misc/radiansDegreesConversion.min.mjs.map +0 -0
  1476. package/dist/src/util/misc/radiansDegreesConversion.mjs +0 -0
  1477. package/dist/src/util/misc/radiansDegreesConversion.mjs.map +0 -0
  1478. package/dist/src/util/misc/resolveOrigin.d.ts +0 -0
  1479. package/dist/src/util/misc/resolveOrigin.d.ts.map +0 -0
  1480. package/dist/src/util/misc/resolveOrigin.min.mjs +0 -0
  1481. package/dist/src/util/misc/resolveOrigin.min.mjs.map +0 -0
  1482. package/dist/src/util/misc/resolveOrigin.mjs +0 -0
  1483. package/dist/src/util/misc/resolveOrigin.mjs.map +0 -0
  1484. package/dist/src/util/misc/sin.d.ts +0 -0
  1485. package/dist/src/util/misc/sin.d.ts.map +0 -0
  1486. package/dist/src/util/misc/sin.min.mjs +0 -0
  1487. package/dist/src/util/misc/sin.min.mjs.map +0 -0
  1488. package/dist/src/util/misc/sin.mjs +0 -0
  1489. package/dist/src/util/misc/sin.mjs.map +0 -0
  1490. package/dist/src/util/misc/svgExport.d.ts +0 -0
  1491. package/dist/src/util/misc/svgExport.d.ts.map +0 -0
  1492. package/dist/src/util/misc/svgExport.min.mjs +0 -0
  1493. package/dist/src/util/misc/svgExport.min.mjs.map +0 -0
  1494. package/dist/src/util/misc/svgExport.mjs +0 -0
  1495. package/dist/src/util/misc/svgExport.mjs.map +0 -0
  1496. package/dist/src/util/misc/svgParsing.d.ts +0 -0
  1497. package/dist/src/util/misc/svgParsing.d.ts.map +0 -0
  1498. package/dist/src/util/misc/svgParsing.min.mjs +0 -0
  1499. package/dist/src/util/misc/svgParsing.min.mjs.map +0 -0
  1500. package/dist/src/util/misc/svgParsing.mjs +0 -0
  1501. package/dist/src/util/misc/svgParsing.mjs.map +0 -0
  1502. package/dist/src/util/misc/textStyles.d.ts +0 -0
  1503. package/dist/src/util/misc/textStyles.d.ts.map +0 -0
  1504. package/dist/src/util/misc/textStyles.min.mjs +0 -0
  1505. package/dist/src/util/misc/textStyles.min.mjs.map +0 -0
  1506. package/dist/src/util/misc/textStyles.mjs +0 -0
  1507. package/dist/src/util/misc/textStyles.mjs.map +0 -0
  1508. package/dist/src/util/misc/toFixed.d.ts +0 -0
  1509. package/dist/src/util/misc/toFixed.d.ts.map +0 -0
  1510. package/dist/src/util/misc/toFixed.min.mjs +0 -0
  1511. package/dist/src/util/misc/toFixed.min.mjs.map +0 -0
  1512. package/dist/src/util/misc/toFixed.mjs +0 -0
  1513. package/dist/src/util/misc/toFixed.mjs.map +0 -0
  1514. package/dist/src/util/misc/vectors.d.ts +0 -0
  1515. package/dist/src/util/misc/vectors.d.ts.map +0 -0
  1516. package/dist/src/util/misc/vectors.min.mjs +0 -0
  1517. package/dist/src/util/misc/vectors.min.mjs.map +0 -0
  1518. package/dist/src/util/misc/vectors.mjs +0 -0
  1519. package/dist/src/util/misc/vectors.mjs.map +0 -0
  1520. package/dist/src/util/path/index.d.ts +0 -0
  1521. package/dist/src/util/path/index.d.ts.map +0 -0
  1522. package/dist/src/util/path/index.min.mjs +0 -0
  1523. package/dist/src/util/path/index.min.mjs.map +0 -0
  1524. package/dist/src/util/path/index.mjs +0 -0
  1525. package/dist/src/util/path/index.mjs.map +0 -0
  1526. package/dist/src/util/path/regex.d.ts +0 -0
  1527. package/dist/src/util/path/regex.d.ts.map +0 -0
  1528. package/dist/src/util/path/regex.min.mjs +0 -0
  1529. package/dist/src/util/path/regex.min.mjs.map +0 -0
  1530. package/dist/src/util/path/regex.mjs +0 -0
  1531. package/dist/src/util/path/regex.mjs.map +0 -0
  1532. package/dist/src/util/path/typechecks.d.ts +0 -0
  1533. package/dist/src/util/path/typechecks.d.ts.map +0 -0
  1534. package/dist/src/util/path/typedefs.d.ts +0 -0
  1535. package/dist/src/util/path/typedefs.d.ts.map +0 -0
  1536. package/dist/src/util/transform_matrix_removal.d.ts +0 -0
  1537. package/dist/src/util/transform_matrix_removal.d.ts.map +0 -0
  1538. package/dist/src/util/transform_matrix_removal.min.mjs +0 -0
  1539. package/dist/src/util/transform_matrix_removal.min.mjs.map +0 -0
  1540. package/dist/src/util/transform_matrix_removal.mjs +0 -0
  1541. package/dist/src/util/transform_matrix_removal.mjs.map +0 -0
  1542. package/dist/src/util/typeAssertions.d.ts +0 -0
  1543. package/dist/src/util/typeAssertions.d.ts.map +0 -0
  1544. package/dist/src/util/typeAssertions.min.mjs +0 -0
  1545. package/dist/src/util/typeAssertions.min.mjs.map +0 -0
  1546. package/dist/src/util/typeAssertions.mjs +0 -0
  1547. package/dist/src/util/typeAssertions.mjs.map +0 -0
  1548. package/dist-extensions/aligning_guidelines/constant.mjs +0 -0
  1549. package/dist-extensions/aligning_guidelines/constant.mjs.map +0 -0
  1550. package/dist-extensions/aligning_guidelines/index.mjs +0 -0
  1551. package/dist-extensions/aligning_guidelines/index.mjs.map +0 -0
  1552. package/dist-extensions/aligning_guidelines/util/basic.mjs +0 -0
  1553. package/dist-extensions/aligning_guidelines/util/basic.mjs.map +0 -0
  1554. package/dist-extensions/aligning_guidelines/util/collect-line.mjs +0 -0
  1555. package/dist-extensions/aligning_guidelines/util/collect-line.mjs.map +0 -0
  1556. package/dist-extensions/aligning_guidelines/util/collect-point.mjs +0 -0
  1557. package/dist-extensions/aligning_guidelines/util/collect-point.mjs.map +0 -0
  1558. package/dist-extensions/aligning_guidelines/util/draw.mjs +0 -0
  1559. package/dist-extensions/aligning_guidelines/util/draw.mjs.map +0 -0
  1560. package/dist-extensions/aligning_guidelines/util/get-objects-by-target.mjs +0 -0
  1561. package/dist-extensions/aligning_guidelines/util/get-objects-by-target.mjs.map +0 -0
  1562. package/dist-extensions/data_updaters/gradient/index.mjs +0 -0
  1563. package/dist-extensions/data_updaters/gradient/index.mjs.map +0 -0
  1564. package/dist-extensions/data_updaters/origins/index.mjs +0 -0
  1565. package/dist-extensions/data_updaters/origins/index.mjs.map +0 -0
  1566. package/dist-extensions/extensions/aligning_guidelines/constant.d.ts +0 -0
  1567. package/dist-extensions/extensions/aligning_guidelines/constant.d.ts.map +0 -0
  1568. package/dist-extensions/extensions/aligning_guidelines/index.d.ts +0 -0
  1569. package/dist-extensions/extensions/aligning_guidelines/index.d.ts.map +0 -0
  1570. package/dist-extensions/extensions/aligning_guidelines/typedefs.d.ts +0 -0
  1571. package/dist-extensions/extensions/aligning_guidelines/typedefs.d.ts.map +0 -0
  1572. package/dist-extensions/extensions/aligning_guidelines/util/basic.d.ts +0 -0
  1573. package/dist-extensions/extensions/aligning_guidelines/util/basic.d.ts.map +0 -0
  1574. package/dist-extensions/extensions/aligning_guidelines/util/collect-line.d.ts +0 -0
  1575. package/dist-extensions/extensions/aligning_guidelines/util/collect-line.d.ts.map +0 -0
  1576. package/dist-extensions/extensions/aligning_guidelines/util/collect-point.d.ts +0 -0
  1577. package/dist-extensions/extensions/aligning_guidelines/util/collect-point.d.ts.map +0 -0
  1578. package/dist-extensions/extensions/aligning_guidelines/util/draw.d.ts +0 -0
  1579. package/dist-extensions/extensions/aligning_guidelines/util/draw.d.ts.map +0 -0
  1580. package/dist-extensions/extensions/aligning_guidelines/util/get-objects-by-target.d.ts +0 -0
  1581. package/dist-extensions/extensions/aligning_guidelines/util/get-objects-by-target.d.ts.map +0 -0
  1582. package/dist-extensions/extensions/data_updaters/gradient/index.d.ts +0 -0
  1583. package/dist-extensions/extensions/data_updaters/gradient/index.d.ts.map +0 -0
  1584. package/dist-extensions/extensions/data_updaters/origins/index.d.ts +0 -0
  1585. package/dist-extensions/extensions/data_updaters/origins/index.d.ts.map +0 -0
  1586. package/dist-extensions/extensions/index.d.ts +0 -0
  1587. package/dist-extensions/extensions/index.d.ts.map +0 -0
  1588. package/dist-extensions/fabric-extensions.min.js +0 -0
  1589. package/dist-extensions/fabric-extensions.min.js.map +0 -0
  1590. package/dist-extensions/fabric.d.ts +0 -0
  1591. package/dist-extensions/fabric.d.ts.map +0 -0
  1592. package/dist-extensions/index.d.ts +0 -0
  1593. package/dist-extensions/index.d.ts.map +0 -0
  1594. package/dist-extensions/index.mjs +0 -0
  1595. package/dist-extensions/index.mjs.map +0 -0
  1596. package/dist-extensions/src/ClassRegistry.d.ts +0 -0
  1597. package/dist-extensions/src/ClassRegistry.d.ts.map +0 -0
  1598. package/dist-extensions/src/Collection.d.ts +0 -0
  1599. package/dist-extensions/src/Collection.d.ts.map +0 -0
  1600. package/dist-extensions/src/CommonMethods.d.ts +0 -0
  1601. package/dist-extensions/src/CommonMethods.d.ts.map +0 -0
  1602. package/dist-extensions/src/EventTypeDefs.d.ts +0 -0
  1603. package/dist-extensions/src/EventTypeDefs.d.ts.map +0 -0
  1604. package/dist-extensions/src/Intersection.d.ts +0 -0
  1605. package/dist-extensions/src/Intersection.d.ts.map +0 -0
  1606. package/dist-extensions/src/LayoutManager/ActiveSelectionLayoutManager.d.ts +0 -0
  1607. package/dist-extensions/src/LayoutManager/ActiveSelectionLayoutManager.d.ts.map +0 -0
  1608. package/dist-extensions/src/LayoutManager/LayoutManager.d.ts +0 -0
  1609. package/dist-extensions/src/LayoutManager/LayoutManager.d.ts.map +0 -0
  1610. package/dist-extensions/src/LayoutManager/LayoutStrategies/ClipPathLayout.d.ts +0 -0
  1611. package/dist-extensions/src/LayoutManager/LayoutStrategies/ClipPathLayout.d.ts.map +0 -0
  1612. package/dist-extensions/src/LayoutManager/LayoutStrategies/FitContentLayout.d.ts +0 -0
  1613. package/dist-extensions/src/LayoutManager/LayoutStrategies/FitContentLayout.d.ts.map +0 -0
  1614. package/dist-extensions/src/LayoutManager/LayoutStrategies/FixedLayout.d.ts +0 -0
  1615. package/dist-extensions/src/LayoutManager/LayoutStrategies/FixedLayout.d.ts.map +0 -0
  1616. package/dist-extensions/src/LayoutManager/LayoutStrategies/LayoutStrategy.d.ts +0 -0
  1617. package/dist-extensions/src/LayoutManager/LayoutStrategies/LayoutStrategy.d.ts.map +0 -0
  1618. package/dist-extensions/src/LayoutManager/LayoutStrategies/utils.d.ts +0 -0
  1619. package/dist-extensions/src/LayoutManager/LayoutStrategies/utils.d.ts.map +0 -0
  1620. package/dist-extensions/src/LayoutManager/constants.d.ts +0 -0
  1621. package/dist-extensions/src/LayoutManager/constants.d.ts.map +0 -0
  1622. package/dist-extensions/src/LayoutManager/index.d.ts +0 -0
  1623. package/dist-extensions/src/LayoutManager/index.d.ts.map +0 -0
  1624. package/dist-extensions/src/LayoutManager/types.d.ts +0 -0
  1625. package/dist-extensions/src/LayoutManager/types.d.ts.map +0 -0
  1626. package/dist-extensions/src/Observable.d.ts +0 -0
  1627. package/dist-extensions/src/Observable.d.ts.map +0 -0
  1628. package/dist-extensions/src/Pattern/Pattern.d.ts +0 -0
  1629. package/dist-extensions/src/Pattern/Pattern.d.ts.map +0 -0
  1630. package/dist-extensions/src/Pattern/index.d.ts +0 -0
  1631. package/dist-extensions/src/Pattern/index.d.ts.map +0 -0
  1632. package/dist-extensions/src/Pattern/types.d.ts +0 -0
  1633. package/dist-extensions/src/Pattern/types.d.ts.map +0 -0
  1634. package/dist-extensions/src/Point.d.ts +0 -0
  1635. package/dist-extensions/src/Point.d.ts.map +0 -0
  1636. package/dist-extensions/src/Shadow.d.ts +0 -0
  1637. package/dist-extensions/src/Shadow.d.ts.map +0 -0
  1638. package/dist-extensions/src/brushes/BaseBrush.d.ts +0 -0
  1639. package/dist-extensions/src/brushes/BaseBrush.d.ts.map +0 -0
  1640. package/dist-extensions/src/brushes/CircleBrush.d.ts +0 -0
  1641. package/dist-extensions/src/brushes/CircleBrush.d.ts.map +0 -0
  1642. package/dist-extensions/src/brushes/PatternBrush.d.ts +0 -0
  1643. package/dist-extensions/src/brushes/PatternBrush.d.ts.map +0 -0
  1644. package/dist-extensions/src/brushes/PencilBrush.d.ts +0 -0
  1645. package/dist-extensions/src/brushes/PencilBrush.d.ts.map +0 -0
  1646. package/dist-extensions/src/brushes/SprayBrush.d.ts +0 -0
  1647. package/dist-extensions/src/brushes/SprayBrush.d.ts.map +0 -0
  1648. package/dist-extensions/src/brushes/typedefs.d.ts +0 -0
  1649. package/dist-extensions/src/brushes/typedefs.d.ts.map +0 -0
  1650. package/dist-extensions/src/cache.d.ts +0 -0
  1651. package/dist-extensions/src/cache.d.ts.map +0 -0
  1652. package/dist-extensions/src/canvas/Canvas.d.ts +0 -0
  1653. package/dist-extensions/src/canvas/Canvas.d.ts.map +0 -0
  1654. package/dist-extensions/src/canvas/CanvasOptions.d.ts +0 -0
  1655. package/dist-extensions/src/canvas/CanvasOptions.d.ts.map +0 -0
  1656. package/dist-extensions/src/canvas/DOMManagers/CanvasDOMManager.d.ts +0 -0
  1657. package/dist-extensions/src/canvas/DOMManagers/CanvasDOMManager.d.ts.map +0 -0
  1658. package/dist-extensions/src/canvas/DOMManagers/StaticCanvasDOMManager.d.ts +0 -0
  1659. package/dist-extensions/src/canvas/DOMManagers/StaticCanvasDOMManager.d.ts.map +0 -0
  1660. package/dist-extensions/src/canvas/DOMManagers/util.d.ts +0 -0
  1661. package/dist-extensions/src/canvas/DOMManagers/util.d.ts.map +0 -0
  1662. package/dist-extensions/src/canvas/SelectableCanvas.d.ts +0 -0
  1663. package/dist-extensions/src/canvas/SelectableCanvas.d.ts.map +0 -0
  1664. package/dist-extensions/src/canvas/StaticCanvas.d.ts +0 -0
  1665. package/dist-extensions/src/canvas/StaticCanvas.d.ts.map +0 -0
  1666. package/dist-extensions/src/canvas/StaticCanvasOptions.d.ts +0 -0
  1667. package/dist-extensions/src/canvas/StaticCanvasOptions.d.ts.map +0 -0
  1668. package/dist-extensions/src/canvas/TextEditingManager.d.ts +0 -0
  1669. package/dist-extensions/src/canvas/TextEditingManager.d.ts.map +0 -0
  1670. package/dist-extensions/src/color/Color.d.ts +0 -0
  1671. package/dist-extensions/src/color/Color.d.ts.map +0 -0
  1672. package/dist-extensions/src/color/color_map.d.ts +0 -0
  1673. package/dist-extensions/src/color/color_map.d.ts.map +0 -0
  1674. package/dist-extensions/src/color/constants.d.ts +0 -0
  1675. package/dist-extensions/src/color/constants.d.ts.map +0 -0
  1676. package/dist-extensions/src/color/typedefs.d.ts +0 -0
  1677. package/dist-extensions/src/color/typedefs.d.ts.map +0 -0
  1678. package/dist-extensions/src/color/util.d.ts +0 -0
  1679. package/dist-extensions/src/color/util.d.ts.map +0 -0
  1680. package/dist-extensions/src/config.d.ts +0 -0
  1681. package/dist-extensions/src/config.d.ts.map +0 -0
  1682. package/dist-extensions/src/constants.d.ts +0 -0
  1683. package/dist-extensions/src/constants.d.ts.map +0 -0
  1684. package/dist-extensions/src/controls/Control.d.ts +0 -0
  1685. package/dist-extensions/src/controls/Control.d.ts.map +0 -0
  1686. package/dist-extensions/src/controls/changeHeight.d.ts +0 -0
  1687. package/dist-extensions/src/controls/changeHeight.d.ts.map +0 -0
  1688. package/dist-extensions/src/controls/changeWidth.d.ts +0 -0
  1689. package/dist-extensions/src/controls/changeWidth.d.ts.map +0 -0
  1690. package/dist-extensions/src/controls/commonControls.d.ts +0 -0
  1691. package/dist-extensions/src/controls/commonControls.d.ts.map +0 -0
  1692. package/dist-extensions/src/controls/controlRendering.d.ts +0 -0
  1693. package/dist-extensions/src/controls/controlRendering.d.ts.map +0 -0
  1694. package/dist-extensions/src/controls/drag.d.ts +0 -0
  1695. package/dist-extensions/src/controls/drag.d.ts.map +0 -0
  1696. package/dist-extensions/src/controls/fireEvent.d.ts +0 -0
  1697. package/dist-extensions/src/controls/fireEvent.d.ts.map +0 -0
  1698. package/dist-extensions/src/controls/index.d.ts +0 -0
  1699. package/dist-extensions/src/controls/index.d.ts.map +0 -0
  1700. package/dist-extensions/src/controls/pathControl.d.ts +0 -0
  1701. package/dist-extensions/src/controls/pathControl.d.ts.map +0 -0
  1702. package/dist-extensions/src/controls/polyControl.d.ts +0 -0
  1703. package/dist-extensions/src/controls/polyControl.d.ts.map +0 -0
  1704. package/dist-extensions/src/controls/rotate.d.ts +0 -0
  1705. package/dist-extensions/src/controls/rotate.d.ts.map +0 -0
  1706. package/dist-extensions/src/controls/scale.d.ts +0 -0
  1707. package/dist-extensions/src/controls/scale.d.ts.map +0 -0
  1708. package/dist-extensions/src/controls/scaleSkew.d.ts +0 -0
  1709. package/dist-extensions/src/controls/scaleSkew.d.ts.map +0 -0
  1710. package/dist-extensions/src/controls/skew.d.ts +0 -0
  1711. package/dist-extensions/src/controls/skew.d.ts.map +0 -0
  1712. package/dist-extensions/src/controls/util.d.ts +0 -0
  1713. package/dist-extensions/src/controls/util.d.ts.map +0 -0
  1714. package/dist-extensions/src/controls/wrapWithFireEvent.d.ts +0 -0
  1715. package/dist-extensions/src/controls/wrapWithFireEvent.d.ts.map +0 -0
  1716. package/dist-extensions/src/controls/wrapWithFixedAnchor.d.ts +0 -0
  1717. package/dist-extensions/src/controls/wrapWithFixedAnchor.d.ts.map +0 -0
  1718. package/dist-extensions/src/env/browser.d.ts +0 -0
  1719. package/dist-extensions/src/env/browser.d.ts.map +0 -0
  1720. package/dist-extensions/src/env/index.d.ts +0 -0
  1721. package/dist-extensions/src/env/index.d.ts.map +0 -0
  1722. package/dist-extensions/src/env/types.d.ts +0 -0
  1723. package/dist-extensions/src/env/types.d.ts.map +0 -0
  1724. package/dist-extensions/src/filters/BaseFilter.d.ts +0 -0
  1725. package/dist-extensions/src/filters/BaseFilter.d.ts.map +0 -0
  1726. package/dist-extensions/src/filters/BlendColor.d.ts +0 -0
  1727. package/dist-extensions/src/filters/BlendColor.d.ts.map +0 -0
  1728. package/dist-extensions/src/filters/BlendImage.d.ts +0 -0
  1729. package/dist-extensions/src/filters/BlendImage.d.ts.map +0 -0
  1730. package/dist-extensions/src/filters/Blur.d.ts +0 -0
  1731. package/dist-extensions/src/filters/Blur.d.ts.map +0 -0
  1732. package/dist-extensions/src/filters/Brightness.d.ts +0 -0
  1733. package/dist-extensions/src/filters/Brightness.d.ts.map +0 -0
  1734. package/dist-extensions/src/filters/Canvas2dFilterBackend.d.ts +0 -0
  1735. package/dist-extensions/src/filters/Canvas2dFilterBackend.d.ts.map +0 -0
  1736. package/dist-extensions/src/filters/ColorMatrix.d.ts +0 -0
  1737. package/dist-extensions/src/filters/ColorMatrix.d.ts.map +0 -0
  1738. package/dist-extensions/src/filters/ColorMatrixFilters.d.ts +0 -0
  1739. package/dist-extensions/src/filters/ColorMatrixFilters.d.ts.map +0 -0
  1740. package/dist-extensions/src/filters/Composed.d.ts +0 -0
  1741. package/dist-extensions/src/filters/Composed.d.ts.map +0 -0
  1742. package/dist-extensions/src/filters/Contrast.d.ts +0 -0
  1743. package/dist-extensions/src/filters/Contrast.d.ts.map +0 -0
  1744. package/dist-extensions/src/filters/Convolute.d.ts +0 -0
  1745. package/dist-extensions/src/filters/Convolute.d.ts.map +0 -0
  1746. package/dist-extensions/src/filters/FilterBackend.d.ts +0 -0
  1747. package/dist-extensions/src/filters/FilterBackend.d.ts.map +0 -0
  1748. package/dist-extensions/src/filters/GLProbes/GLProbe.d.ts +0 -0
  1749. package/dist-extensions/src/filters/GLProbes/GLProbe.d.ts.map +0 -0
  1750. package/dist-extensions/src/filters/GLProbes/WebGLProbe.d.ts +0 -0
  1751. package/dist-extensions/src/filters/GLProbes/WebGLProbe.d.ts.map +0 -0
  1752. package/dist-extensions/src/filters/Gamma.d.ts +0 -0
  1753. package/dist-extensions/src/filters/Gamma.d.ts.map +0 -0
  1754. package/dist-extensions/src/filters/Grayscale.d.ts +0 -0
  1755. package/dist-extensions/src/filters/Grayscale.d.ts.map +0 -0
  1756. package/dist-extensions/src/filters/HueRotation.d.ts +0 -0
  1757. package/dist-extensions/src/filters/HueRotation.d.ts.map +0 -0
  1758. package/dist-extensions/src/filters/Invert.d.ts +0 -0
  1759. package/dist-extensions/src/filters/Invert.d.ts.map +0 -0
  1760. package/dist-extensions/src/filters/Noise.d.ts +0 -0
  1761. package/dist-extensions/src/filters/Noise.d.ts.map +0 -0
  1762. package/dist-extensions/src/filters/Pixelate.d.ts +0 -0
  1763. package/dist-extensions/src/filters/Pixelate.d.ts.map +0 -0
  1764. package/dist-extensions/src/filters/RemoveColor.d.ts +0 -0
  1765. package/dist-extensions/src/filters/RemoveColor.d.ts.map +0 -0
  1766. package/dist-extensions/src/filters/Resize.d.ts +0 -0
  1767. package/dist-extensions/src/filters/Resize.d.ts.map +0 -0
  1768. package/dist-extensions/src/filters/Saturation.d.ts +0 -0
  1769. package/dist-extensions/src/filters/Saturation.d.ts.map +0 -0
  1770. package/dist-extensions/src/filters/Vibrance.d.ts +0 -0
  1771. package/dist-extensions/src/filters/Vibrance.d.ts.map +0 -0
  1772. package/dist-extensions/src/filters/WebGLFilterBackend.d.ts +0 -0
  1773. package/dist-extensions/src/filters/WebGLFilterBackend.d.ts.map +0 -0
  1774. package/dist-extensions/src/filters/filters.d.ts +0 -0
  1775. package/dist-extensions/src/filters/filters.d.ts.map +0 -0
  1776. package/dist-extensions/src/filters/index.d.ts +0 -0
  1777. package/dist-extensions/src/filters/index.d.ts.map +0 -0
  1778. package/dist-extensions/src/filters/shaders/baseFilter.d.ts +0 -0
  1779. package/dist-extensions/src/filters/shaders/baseFilter.d.ts.map +0 -0
  1780. package/dist-extensions/src/filters/shaders/blendColor.d.ts +0 -0
  1781. package/dist-extensions/src/filters/shaders/blendColor.d.ts.map +0 -0
  1782. package/dist-extensions/src/filters/shaders/blendImage.d.ts +0 -0
  1783. package/dist-extensions/src/filters/shaders/blendImage.d.ts.map +0 -0
  1784. package/dist-extensions/src/filters/shaders/blur.d.ts +0 -0
  1785. package/dist-extensions/src/filters/shaders/blur.d.ts.map +0 -0
  1786. package/dist-extensions/src/filters/shaders/brightness.d.ts +0 -0
  1787. package/dist-extensions/src/filters/shaders/brightness.d.ts.map +0 -0
  1788. package/dist-extensions/src/filters/shaders/colorMatrix.d.ts +0 -0
  1789. package/dist-extensions/src/filters/shaders/colorMatrix.d.ts.map +0 -0
  1790. package/dist-extensions/src/filters/shaders/constrast.d.ts +0 -0
  1791. package/dist-extensions/src/filters/shaders/constrast.d.ts.map +0 -0
  1792. package/dist-extensions/src/filters/shaders/convolute.d.ts +0 -0
  1793. package/dist-extensions/src/filters/shaders/convolute.d.ts.map +0 -0
  1794. package/dist-extensions/src/filters/shaders/gamma.d.ts +0 -0
  1795. package/dist-extensions/src/filters/shaders/gamma.d.ts.map +0 -0
  1796. package/dist-extensions/src/filters/shaders/grayscale.d.ts +0 -0
  1797. package/dist-extensions/src/filters/shaders/grayscale.d.ts.map +0 -0
  1798. package/dist-extensions/src/filters/shaders/invert.d.ts +0 -0
  1799. package/dist-extensions/src/filters/shaders/invert.d.ts.map +0 -0
  1800. package/dist-extensions/src/filters/shaders/noise.d.ts +0 -0
  1801. package/dist-extensions/src/filters/shaders/noise.d.ts.map +0 -0
  1802. package/dist-extensions/src/filters/shaders/pixelate.d.ts +0 -0
  1803. package/dist-extensions/src/filters/shaders/pixelate.d.ts.map +0 -0
  1804. package/dist-extensions/src/filters/shaders/removeColor.d.ts +0 -0
  1805. package/dist-extensions/src/filters/shaders/removeColor.d.ts.map +0 -0
  1806. package/dist-extensions/src/filters/shaders/saturation.d.ts +0 -0
  1807. package/dist-extensions/src/filters/shaders/saturation.d.ts.map +0 -0
  1808. package/dist-extensions/src/filters/shaders/vibrance.d.ts +0 -0
  1809. package/dist-extensions/src/filters/shaders/vibrance.d.ts.map +0 -0
  1810. package/dist-extensions/src/filters/typedefs.d.ts +0 -0
  1811. package/dist-extensions/src/filters/typedefs.d.ts.map +0 -0
  1812. package/dist-extensions/src/filters/utils.d.ts +0 -0
  1813. package/dist-extensions/src/filters/utils.d.ts.map +0 -0
  1814. package/dist-extensions/src/gradient/Gradient.d.ts +0 -0
  1815. package/dist-extensions/src/gradient/Gradient.d.ts.map +0 -0
  1816. package/dist-extensions/src/gradient/constants.d.ts +0 -0
  1817. package/dist-extensions/src/gradient/constants.d.ts.map +0 -0
  1818. package/dist-extensions/src/gradient/index.d.ts +0 -0
  1819. package/dist-extensions/src/gradient/index.d.ts.map +0 -0
  1820. package/dist-extensions/src/gradient/parser/misc.d.ts +0 -0
  1821. package/dist-extensions/src/gradient/parser/misc.d.ts.map +0 -0
  1822. package/dist-extensions/src/gradient/parser/parseColorStops.d.ts +0 -0
  1823. package/dist-extensions/src/gradient/parser/parseColorStops.d.ts.map +0 -0
  1824. package/dist-extensions/src/gradient/parser/parseCoords.d.ts +0 -0
  1825. package/dist-extensions/src/gradient/parser/parseCoords.d.ts.map +0 -0
  1826. package/dist-extensions/src/gradient/typedefs.d.ts +0 -0
  1827. package/dist-extensions/src/gradient/typedefs.d.ts.map +0 -0
  1828. package/dist-extensions/src/parser/applyViewboxTransform.d.ts +0 -0
  1829. package/dist-extensions/src/parser/applyViewboxTransform.d.ts.map +0 -0
  1830. package/dist-extensions/src/parser/attributes.d.ts +0 -0
  1831. package/dist-extensions/src/parser/attributes.d.ts.map +0 -0
  1832. package/dist-extensions/src/parser/constants.d.ts +0 -0
  1833. package/dist-extensions/src/parser/constants.d.ts.map +0 -0
  1834. package/dist-extensions/src/parser/doesSomeParentMatch.d.ts +0 -0
  1835. package/dist-extensions/src/parser/doesSomeParentMatch.d.ts.map +0 -0
  1836. package/dist-extensions/src/parser/elementMatchesRule.d.ts +0 -0
  1837. package/dist-extensions/src/parser/elementMatchesRule.d.ts.map +0 -0
  1838. package/dist-extensions/src/parser/elements_parser.d.ts +0 -0
  1839. package/dist-extensions/src/parser/elements_parser.d.ts.map +0 -0
  1840. package/dist-extensions/src/parser/getCSSRules.d.ts +0 -0
  1841. package/dist-extensions/src/parser/getCSSRules.d.ts.map +0 -0
  1842. package/dist-extensions/src/parser/getGlobalStylesForElement.d.ts +0 -0
  1843. package/dist-extensions/src/parser/getGlobalStylesForElement.d.ts.map +0 -0
  1844. package/dist-extensions/src/parser/getGradientDefs.d.ts +0 -0
  1845. package/dist-extensions/src/parser/getGradientDefs.d.ts.map +0 -0
  1846. package/dist-extensions/src/parser/getMultipleNodes.d.ts +0 -0
  1847. package/dist-extensions/src/parser/getMultipleNodes.d.ts.map +0 -0
  1848. package/dist-extensions/src/parser/getSvgRegex.d.ts +0 -0
  1849. package/dist-extensions/src/parser/getSvgRegex.d.ts.map +0 -0
  1850. package/dist-extensions/src/parser/getTagName.d.ts +0 -0
  1851. package/dist-extensions/src/parser/getTagName.d.ts.map +0 -0
  1852. package/dist-extensions/src/parser/hasInvalidAncestor.d.ts +0 -0
  1853. package/dist-extensions/src/parser/hasInvalidAncestor.d.ts.map +0 -0
  1854. package/dist-extensions/src/parser/loadSVGFromString.d.ts +0 -0
  1855. package/dist-extensions/src/parser/loadSVGFromString.d.ts.map +0 -0
  1856. package/dist-extensions/src/parser/loadSVGFromURL.d.ts +0 -0
  1857. package/dist-extensions/src/parser/loadSVGFromURL.d.ts.map +0 -0
  1858. package/dist-extensions/src/parser/normalizeAttr.d.ts +0 -0
  1859. package/dist-extensions/src/parser/normalizeAttr.d.ts.map +0 -0
  1860. package/dist-extensions/src/parser/normalizeValue.d.ts +0 -0
  1861. package/dist-extensions/src/parser/normalizeValue.d.ts.map +0 -0
  1862. package/dist-extensions/src/parser/parseAttributes.d.ts +0 -0
  1863. package/dist-extensions/src/parser/parseAttributes.d.ts.map +0 -0
  1864. package/dist-extensions/src/parser/parseFontDeclaration.d.ts +0 -0
  1865. package/dist-extensions/src/parser/parseFontDeclaration.d.ts.map +0 -0
  1866. package/dist-extensions/src/parser/parsePointsAttribute.d.ts +0 -0
  1867. package/dist-extensions/src/parser/parsePointsAttribute.d.ts.map +0 -0
  1868. package/dist-extensions/src/parser/parseSVGDocument.d.ts +0 -0
  1869. package/dist-extensions/src/parser/parseSVGDocument.d.ts.map +0 -0
  1870. package/dist-extensions/src/parser/parseStyleAttribute.d.ts +0 -0
  1871. package/dist-extensions/src/parser/parseStyleAttribute.d.ts.map +0 -0
  1872. package/dist-extensions/src/parser/parseStyleObject.d.ts +0 -0
  1873. package/dist-extensions/src/parser/parseStyleObject.d.ts.map +0 -0
  1874. package/dist-extensions/src/parser/parseStyleString.d.ts +0 -0
  1875. package/dist-extensions/src/parser/parseStyleString.d.ts.map +0 -0
  1876. package/dist-extensions/src/parser/parseTransformAttribute.d.ts +0 -0
  1877. package/dist-extensions/src/parser/parseTransformAttribute.d.ts.map +0 -0
  1878. package/dist-extensions/src/parser/parseUseDirectives.d.ts +0 -0
  1879. package/dist-extensions/src/parser/parseUseDirectives.d.ts.map +0 -0
  1880. package/dist-extensions/src/parser/percent.d.ts +0 -0
  1881. package/dist-extensions/src/parser/percent.d.ts.map +0 -0
  1882. package/dist-extensions/src/parser/recursivelyParseGradientsXlink.d.ts +0 -0
  1883. package/dist-extensions/src/parser/recursivelyParseGradientsXlink.d.ts.map +0 -0
  1884. package/dist-extensions/src/parser/selectorMatches.d.ts +0 -0
  1885. package/dist-extensions/src/parser/selectorMatches.d.ts.map +0 -0
  1886. package/dist-extensions/src/parser/setStrokeFillOpacity.d.ts +0 -0
  1887. package/dist-extensions/src/parser/setStrokeFillOpacity.d.ts.map +0 -0
  1888. package/dist-extensions/src/parser/typedefs.d.ts +0 -0
  1889. package/dist-extensions/src/parser/typedefs.d.ts.map +0 -0
  1890. package/dist-extensions/src/shapes/ActiveSelection.d.ts +0 -0
  1891. package/dist-extensions/src/shapes/ActiveSelection.d.ts.map +0 -0
  1892. package/dist-extensions/src/shapes/Circle.d.ts +0 -0
  1893. package/dist-extensions/src/shapes/Circle.d.ts.map +0 -0
  1894. package/dist-extensions/src/shapes/Ellipse.d.ts +0 -0
  1895. package/dist-extensions/src/shapes/Ellipse.d.ts.map +0 -0
  1896. package/dist-extensions/src/shapes/Group.d.ts +0 -0
  1897. package/dist-extensions/src/shapes/Group.d.ts.map +0 -0
  1898. package/dist-extensions/src/shapes/IText/DraggableTextDelegate.d.ts +0 -0
  1899. package/dist-extensions/src/shapes/IText/DraggableTextDelegate.d.ts.map +0 -0
  1900. package/dist-extensions/src/shapes/IText/IText.d.ts +0 -0
  1901. package/dist-extensions/src/shapes/IText/IText.d.ts.map +0 -0
  1902. package/dist-extensions/src/shapes/IText/ITextBehavior.d.ts +0 -0
  1903. package/dist-extensions/src/shapes/IText/ITextBehavior.d.ts.map +1 -1
  1904. package/dist-extensions/src/shapes/IText/ITextClickBehavior.d.ts +0 -0
  1905. package/dist-extensions/src/shapes/IText/ITextClickBehavior.d.ts.map +0 -0
  1906. package/dist-extensions/src/shapes/IText/ITextKeyBehavior.d.ts +0 -0
  1907. package/dist-extensions/src/shapes/IText/ITextKeyBehavior.d.ts.map +1 -1
  1908. package/dist-extensions/src/shapes/IText/constants.d.ts +0 -0
  1909. package/dist-extensions/src/shapes/IText/constants.d.ts.map +0 -0
  1910. package/dist-extensions/src/shapes/Image.d.ts +0 -0
  1911. package/dist-extensions/src/shapes/Image.d.ts.map +0 -0
  1912. package/dist-extensions/src/shapes/Line.d.ts +33 -86
  1913. package/dist-extensions/src/shapes/Line.d.ts.map +1 -1
  1914. package/dist-extensions/src/shapes/Object/FabricObject.d.ts +0 -0
  1915. package/dist-extensions/src/shapes/Object/FabricObject.d.ts.map +0 -0
  1916. package/dist-extensions/src/shapes/Object/FabricObjectSVGExportMixin.d.ts +0 -0
  1917. package/dist-extensions/src/shapes/Object/FabricObjectSVGExportMixin.d.ts.map +0 -0
  1918. package/dist-extensions/src/shapes/Object/InteractiveObject.d.ts +0 -0
  1919. package/dist-extensions/src/shapes/Object/InteractiveObject.d.ts.map +0 -0
  1920. package/dist-extensions/src/shapes/Object/Object.d.ts +0 -0
  1921. package/dist-extensions/src/shapes/Object/Object.d.ts.map +0 -0
  1922. package/dist-extensions/src/shapes/Object/ObjectGeometry.d.ts +0 -0
  1923. package/dist-extensions/src/shapes/Object/ObjectGeometry.d.ts.map +0 -0
  1924. package/dist-extensions/src/shapes/Object/defaultValues.d.ts +0 -0
  1925. package/dist-extensions/src/shapes/Object/defaultValues.d.ts.map +0 -0
  1926. package/dist-extensions/src/shapes/Object/types/BaseProps.d.ts +0 -0
  1927. package/dist-extensions/src/shapes/Object/types/BaseProps.d.ts.map +0 -0
  1928. package/dist-extensions/src/shapes/Object/types/BorderProps.d.ts +0 -0
  1929. package/dist-extensions/src/shapes/Object/types/BorderProps.d.ts.map +0 -0
  1930. package/dist-extensions/src/shapes/Object/types/ControlProps.d.ts +0 -0
  1931. package/dist-extensions/src/shapes/Object/types/ControlProps.d.ts.map +0 -0
  1932. package/dist-extensions/src/shapes/Object/types/FabricObjectProps.d.ts +0 -0
  1933. package/dist-extensions/src/shapes/Object/types/FabricObjectProps.d.ts.map +0 -0
  1934. package/dist-extensions/src/shapes/Object/types/FillStrokeProps.d.ts +0 -0
  1935. package/dist-extensions/src/shapes/Object/types/FillStrokeProps.d.ts.map +0 -0
  1936. package/dist-extensions/src/shapes/Object/types/LockInteractionProps.d.ts +0 -0
  1937. package/dist-extensions/src/shapes/Object/types/LockInteractionProps.d.ts.map +0 -0
  1938. package/dist-extensions/src/shapes/Object/types/ObjectProps.d.ts +0 -0
  1939. package/dist-extensions/src/shapes/Object/types/ObjectProps.d.ts.map +0 -0
  1940. package/dist-extensions/src/shapes/Object/types/ObjectTransformProps.d.ts +0 -0
  1941. package/dist-extensions/src/shapes/Object/types/ObjectTransformProps.d.ts.map +0 -0
  1942. package/dist-extensions/src/shapes/Object/types/SerializedObjectProps.d.ts +0 -0
  1943. package/dist-extensions/src/shapes/Object/types/SerializedObjectProps.d.ts.map +0 -0
  1944. package/dist-extensions/src/shapes/Object/types/index.d.ts +0 -0
  1945. package/dist-extensions/src/shapes/Object/types/index.d.ts.map +0 -0
  1946. package/dist-extensions/src/shapes/Path.d.ts +0 -0
  1947. package/dist-extensions/src/shapes/Path.d.ts.map +0 -0
  1948. package/dist-extensions/src/shapes/Polygon.d.ts +0 -0
  1949. package/dist-extensions/src/shapes/Polygon.d.ts.map +0 -0
  1950. package/dist-extensions/src/shapes/Polyline.d.ts +7 -0
  1951. package/dist-extensions/src/shapes/Polyline.d.ts.map +1 -1
  1952. package/dist-extensions/src/shapes/Rect.d.ts +0 -0
  1953. package/dist-extensions/src/shapes/Rect.d.ts.map +0 -0
  1954. package/dist-extensions/src/shapes/Text/StyledText.d.ts +0 -0
  1955. package/dist-extensions/src/shapes/Text/StyledText.d.ts.map +0 -0
  1956. package/dist-extensions/src/shapes/Text/Text.d.ts +19 -0
  1957. package/dist-extensions/src/shapes/Text/Text.d.ts.map +1 -1
  1958. package/dist-extensions/src/shapes/Text/TextSVGExportMixin.d.ts +0 -0
  1959. package/dist-extensions/src/shapes/Text/TextSVGExportMixin.d.ts.map +0 -0
  1960. package/dist-extensions/src/shapes/Text/constants.d.ts +0 -0
  1961. package/dist-extensions/src/shapes/Text/constants.d.ts.map +0 -0
  1962. package/dist-extensions/src/shapes/Textbox.d.ts +43 -1
  1963. package/dist-extensions/src/shapes/Textbox.d.ts.map +1 -1
  1964. package/dist-extensions/src/shapes/Triangle.d.ts +27 -2
  1965. package/dist-extensions/src/shapes/Triangle.d.ts.map +1 -1
  1966. package/dist-extensions/src/text/browserLines.d.ts +0 -0
  1967. package/dist-extensions/src/text/browserLines.d.ts.map +0 -0
  1968. package/dist-extensions/src/text/ellipsis.d.ts +0 -0
  1969. package/dist-extensions/src/text/ellipsis.d.ts.map +0 -0
  1970. package/dist-extensions/src/text/hitTest.d.ts +0 -0
  1971. package/dist-extensions/src/text/hitTest.d.ts.map +0 -0
  1972. package/dist-extensions/src/text/layout.d.ts +0 -0
  1973. package/dist-extensions/src/text/layout.d.ts.map +0 -0
  1974. package/dist-extensions/src/text/measure.d.ts +9 -0
  1975. package/dist-extensions/src/text/measure.d.ts.map +1 -1
  1976. package/dist-extensions/src/text/overlayEditor.d.ts +0 -0
  1977. package/dist-extensions/src/text/overlayEditor.d.ts.map +1 -1
  1978. package/dist-extensions/src/text/unicode.d.ts +0 -0
  1979. package/dist-extensions/src/text/unicode.d.ts.map +0 -0
  1980. package/dist-extensions/src/typedefs.d.ts +0 -0
  1981. package/dist-extensions/src/typedefs.d.ts.map +0 -0
  1982. package/dist-extensions/src/util/animation/AnimationBase.d.ts +0 -0
  1983. package/dist-extensions/src/util/animation/AnimationBase.d.ts.map +0 -0
  1984. package/dist-extensions/src/util/animation/AnimationFrameProvider.d.ts +0 -0
  1985. package/dist-extensions/src/util/animation/AnimationFrameProvider.d.ts.map +0 -0
  1986. package/dist-extensions/src/util/animation/AnimationRegistry.d.ts +0 -0
  1987. package/dist-extensions/src/util/animation/AnimationRegistry.d.ts.map +0 -0
  1988. package/dist-extensions/src/util/animation/ArrayAnimation.d.ts +0 -0
  1989. package/dist-extensions/src/util/animation/ArrayAnimation.d.ts.map +0 -0
  1990. package/dist-extensions/src/util/animation/ColorAnimation.d.ts +0 -0
  1991. package/dist-extensions/src/util/animation/ColorAnimation.d.ts.map +0 -0
  1992. package/dist-extensions/src/util/animation/ValueAnimation.d.ts +0 -0
  1993. package/dist-extensions/src/util/animation/ValueAnimation.d.ts.map +0 -0
  1994. package/dist-extensions/src/util/animation/animate.d.ts +0 -0
  1995. package/dist-extensions/src/util/animation/animate.d.ts.map +0 -0
  1996. package/dist-extensions/src/util/animation/easing.d.ts +0 -0
  1997. package/dist-extensions/src/util/animation/easing.d.ts.map +0 -0
  1998. package/dist-extensions/src/util/animation/index.d.ts +0 -0
  1999. package/dist-extensions/src/util/animation/index.d.ts.map +0 -0
  2000. package/dist-extensions/src/util/animation/types.d.ts +0 -0
  2001. package/dist-extensions/src/util/animation/types.d.ts.map +0 -0
  2002. package/dist-extensions/src/util/applyMixins.d.ts +0 -0
  2003. package/dist-extensions/src/util/applyMixins.d.ts.map +0 -0
  2004. package/dist-extensions/src/util/dom_event.d.ts +0 -0
  2005. package/dist-extensions/src/util/dom_event.d.ts.map +0 -0
  2006. package/dist-extensions/src/util/dom_misc.d.ts +0 -0
  2007. package/dist-extensions/src/util/dom_misc.d.ts.map +0 -0
  2008. package/dist-extensions/src/util/index.d.ts +0 -0
  2009. package/dist-extensions/src/util/index.d.ts.map +0 -0
  2010. package/dist-extensions/src/util/internals/applyCanvasTransform.d.ts +0 -0
  2011. package/dist-extensions/src/util/internals/applyCanvasTransform.d.ts.map +0 -0
  2012. package/dist-extensions/src/util/internals/cleanupSvgAttribute.d.ts +0 -0
  2013. package/dist-extensions/src/util/internals/cleanupSvgAttribute.d.ts.map +0 -0
  2014. package/dist-extensions/src/util/internals/cloneStyles.d.ts +0 -0
  2015. package/dist-extensions/src/util/internals/cloneStyles.d.ts.map +0 -0
  2016. package/dist-extensions/src/util/internals/console.d.ts +0 -0
  2017. package/dist-extensions/src/util/internals/console.d.ts.map +0 -0
  2018. package/dist-extensions/src/util/internals/dom_style.d.ts +0 -0
  2019. package/dist-extensions/src/util/internals/dom_style.d.ts.map +0 -0
  2020. package/dist-extensions/src/util/internals/findRight.d.ts +0 -0
  2021. package/dist-extensions/src/util/internals/findRight.d.ts.map +0 -0
  2022. package/dist-extensions/src/util/internals/getRandomInt.d.ts +0 -0
  2023. package/dist-extensions/src/util/internals/getRandomInt.d.ts.map +0 -0
  2024. package/dist-extensions/src/util/internals/ifNaN.d.ts +0 -0
  2025. package/dist-extensions/src/util/internals/ifNaN.d.ts.map +0 -0
  2026. package/dist-extensions/src/util/internals/removeFromArray.d.ts +0 -0
  2027. package/dist-extensions/src/util/internals/removeFromArray.d.ts.map +0 -0
  2028. package/dist-extensions/src/util/internals/uid.d.ts +0 -0
  2029. package/dist-extensions/src/util/internals/uid.d.ts.map +0 -0
  2030. package/dist-extensions/src/util/lang_string.d.ts +0 -0
  2031. package/dist-extensions/src/util/lang_string.d.ts.map +0 -0
  2032. package/dist-extensions/src/util/misc/boundingBoxFromPoints.d.ts +0 -0
  2033. package/dist-extensions/src/util/misc/boundingBoxFromPoints.d.ts.map +0 -0
  2034. package/dist-extensions/src/util/misc/capValue.d.ts +0 -0
  2035. package/dist-extensions/src/util/misc/capValue.d.ts.map +0 -0
  2036. package/dist-extensions/src/util/misc/cornerRadius.d.ts +70 -0
  2037. package/dist-extensions/src/util/misc/cornerRadius.d.ts.map +1 -0
  2038. package/dist-extensions/src/util/misc/cos.d.ts +0 -0
  2039. package/dist-extensions/src/util/misc/cos.d.ts.map +0 -0
  2040. package/dist-extensions/src/util/misc/dom.d.ts +0 -0
  2041. package/dist-extensions/src/util/misc/dom.d.ts.map +0 -0
  2042. package/dist-extensions/src/util/misc/findScaleTo.d.ts +0 -0
  2043. package/dist-extensions/src/util/misc/findScaleTo.d.ts.map +0 -0
  2044. package/dist-extensions/src/util/misc/groupSVGElements.d.ts +0 -0
  2045. package/dist-extensions/src/util/misc/groupSVGElements.d.ts.map +0 -0
  2046. package/dist-extensions/src/util/misc/isTransparent.d.ts +0 -0
  2047. package/dist-extensions/src/util/misc/isTransparent.d.ts.map +0 -0
  2048. package/dist-extensions/src/util/misc/matrix.d.ts +0 -0
  2049. package/dist-extensions/src/util/misc/matrix.d.ts.map +0 -0
  2050. package/dist-extensions/src/util/misc/mergeClipPaths.d.ts +0 -0
  2051. package/dist-extensions/src/util/misc/mergeClipPaths.d.ts.map +0 -0
  2052. package/dist-extensions/src/util/misc/objectEnlive.d.ts +0 -0
  2053. package/dist-extensions/src/util/misc/objectEnlive.d.ts.map +0 -0
  2054. package/dist-extensions/src/util/misc/objectTransforms.d.ts +0 -0
  2055. package/dist-extensions/src/util/misc/objectTransforms.d.ts.map +0 -0
  2056. package/dist-extensions/src/util/misc/pick.d.ts +0 -0
  2057. package/dist-extensions/src/util/misc/pick.d.ts.map +0 -0
  2058. package/dist-extensions/src/util/misc/planeChange.d.ts +0 -0
  2059. package/dist-extensions/src/util/misc/planeChange.d.ts.map +0 -0
  2060. package/dist-extensions/src/util/misc/projectStroke/StrokeLineCapProjections.d.ts +0 -0
  2061. package/dist-extensions/src/util/misc/projectStroke/StrokeLineCapProjections.d.ts.map +0 -0
  2062. package/dist-extensions/src/util/misc/projectStroke/StrokeLineJoinProjections.d.ts +0 -0
  2063. package/dist-extensions/src/util/misc/projectStroke/StrokeLineJoinProjections.d.ts.map +0 -0
  2064. package/dist-extensions/src/util/misc/projectStroke/StrokeProjectionsBase.d.ts +0 -0
  2065. package/dist-extensions/src/util/misc/projectStroke/StrokeProjectionsBase.d.ts.map +0 -0
  2066. package/dist-extensions/src/util/misc/projectStroke/index.d.ts +0 -0
  2067. package/dist-extensions/src/util/misc/projectStroke/index.d.ts.map +0 -0
  2068. package/dist-extensions/src/util/misc/projectStroke/types.d.ts +0 -0
  2069. package/dist-extensions/src/util/misc/projectStroke/types.d.ts.map +0 -0
  2070. package/dist-extensions/src/util/misc/radiansDegreesConversion.d.ts +0 -0
  2071. package/dist-extensions/src/util/misc/radiansDegreesConversion.d.ts.map +0 -0
  2072. package/dist-extensions/src/util/misc/resolveOrigin.d.ts +0 -0
  2073. package/dist-extensions/src/util/misc/resolveOrigin.d.ts.map +0 -0
  2074. package/dist-extensions/src/util/misc/sin.d.ts +0 -0
  2075. package/dist-extensions/src/util/misc/sin.d.ts.map +0 -0
  2076. package/dist-extensions/src/util/misc/svgExport.d.ts +0 -0
  2077. package/dist-extensions/src/util/misc/svgExport.d.ts.map +0 -0
  2078. package/dist-extensions/src/util/misc/svgParsing.d.ts +0 -0
  2079. package/dist-extensions/src/util/misc/svgParsing.d.ts.map +0 -0
  2080. package/dist-extensions/src/util/misc/textStyles.d.ts +0 -0
  2081. package/dist-extensions/src/util/misc/textStyles.d.ts.map +0 -0
  2082. package/dist-extensions/src/util/misc/toFixed.d.ts +0 -0
  2083. package/dist-extensions/src/util/misc/toFixed.d.ts.map +0 -0
  2084. package/dist-extensions/src/util/misc/vectors.d.ts +0 -0
  2085. package/dist-extensions/src/util/misc/vectors.d.ts.map +0 -0
  2086. package/dist-extensions/src/util/path/index.d.ts +0 -0
  2087. package/dist-extensions/src/util/path/index.d.ts.map +0 -0
  2088. package/dist-extensions/src/util/path/regex.d.ts +0 -0
  2089. package/dist-extensions/src/util/path/regex.d.ts.map +0 -0
  2090. package/dist-extensions/src/util/path/typedefs.d.ts +0 -0
  2091. package/dist-extensions/src/util/path/typedefs.d.ts.map +0 -0
  2092. package/dist-extensions/src/util/transform_matrix_removal.d.ts +0 -0
  2093. package/dist-extensions/src/util/transform_matrix_removal.d.ts.map +0 -0
  2094. package/dist-extensions/src/util/typeAssertions.d.ts +0 -0
  2095. package/dist-extensions/src/util/typeAssertions.d.ts.map +0 -0
  2096. package/docs/fabric-konva-gap-analysis.md +0 -0
  2097. package/docs/konva-text-behavior-spec.md +0 -0
  2098. package/docs/text-engine-design.md +0 -0
  2099. package/eslint.config.mjs +0 -0
  2100. package/examples/overlay-edit.html +416 -416
  2101. package/extensions/README.MD +0 -0
  2102. package/extensions/aligning_guidelines/README.MD +0 -0
  2103. package/extensions/aligning_guidelines/constant.ts +0 -0
  2104. package/extensions/aligning_guidelines/index.ts +0 -0
  2105. package/extensions/aligning_guidelines/typedefs.ts +0 -0
  2106. package/extensions/aligning_guidelines/util/basic.spec.ts +0 -0
  2107. package/extensions/aligning_guidelines/util/basic.ts +0 -0
  2108. package/extensions/aligning_guidelines/util/collect-line.ts +0 -0
  2109. package/extensions/aligning_guidelines/util/collect-point.ts +0 -0
  2110. package/extensions/aligning_guidelines/util/draw.ts +0 -0
  2111. package/extensions/aligning_guidelines/util/get-objects-by-target.ts +0 -0
  2112. package/extensions/data_updaters/README.md +0 -0
  2113. package/extensions/data_updaters/gradient/__snapshots__/index.spec.ts.snap +0 -0
  2114. package/extensions/data_updaters/gradient/index.spec.ts +0 -0
  2115. package/extensions/data_updaters/gradient/index.ts +0 -0
  2116. package/extensions/data_updaters/origins/README.md +0 -0
  2117. package/extensions/data_updaters/origins/index.spec.ts +0 -0
  2118. package/extensions/data_updaters/origins/index.ts +0 -0
  2119. package/extensions/index.ts +0 -0
  2120. package/fabric.ts +0 -0
  2121. package/index.node.ts +0 -0
  2122. package/index.ts +0 -0
  2123. package/lib/aligning_guidelines.js +0 -0
  2124. package/lib/centering_guidelines.js +0 -0
  2125. package/lib/event.js +0 -0
  2126. package/package.json +1 -1
  2127. package/playwright.config.ts +0 -0
  2128. package/playwright.setup.ts +0 -0
  2129. package/publish-next.js +0 -0
  2130. package/publish.js +0 -0
  2131. package/rollup.config.mjs +0 -0
  2132. package/scripts/bench-text.js +591 -591
  2133. package/scripts/build.mjs +0 -0
  2134. package/scripts/buildLock.mjs +0 -0
  2135. package/scripts/buildReporter.mjs +0 -0
  2136. package/scripts/buildStats.mjs +0 -0
  2137. package/scripts/dirname.mjs +0 -0
  2138. package/scripts/git.mjs +0 -0
  2139. package/scripts/index.mjs +0 -0
  2140. package/scripts/sandbox.mjs +0 -0
  2141. package/src/ClassRegistry.spec.ts +0 -0
  2142. package/src/ClassRegistry.ts +0 -0
  2143. package/src/Collection.spec.ts +0 -0
  2144. package/src/Collection.ts +0 -0
  2145. package/src/CommonMethods.ts +0 -0
  2146. package/src/EventTypeDefs.ts +0 -0
  2147. package/src/Intersection.spec.ts +0 -0
  2148. package/src/Intersection.ts +0 -0
  2149. package/src/LayoutManager/ActiveSelectionLayoutManager.spec.ts +0 -0
  2150. package/src/LayoutManager/ActiveSelectionLayoutManager.ts +0 -0
  2151. package/src/LayoutManager/LayoutManager.spec.ts +0 -0
  2152. package/src/LayoutManager/LayoutManager.ts +0 -0
  2153. package/src/LayoutManager/LayoutStrategies/ClipPathLayout.ts +0 -0
  2154. package/src/LayoutManager/LayoutStrategies/FitContentLayout.ts +0 -0
  2155. package/src/LayoutManager/LayoutStrategies/FixedLayout.ts +0 -0
  2156. package/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts +0 -0
  2157. package/src/LayoutManager/LayoutStrategies/utils.ts +0 -0
  2158. package/src/LayoutManager/README.md +0 -0
  2159. package/src/LayoutManager/__snapshots__/LayoutManager.spec.ts.snap +0 -0
  2160. package/src/LayoutManager/constants.ts +0 -0
  2161. package/src/LayoutManager/index.ts +0 -0
  2162. package/src/LayoutManager/types.ts +0 -0
  2163. package/src/Observable.spec.ts +0 -0
  2164. package/src/Observable.ts +0 -0
  2165. package/src/Pattern/Pattern.spec.ts +0 -0
  2166. package/src/Pattern/Pattern.ts +0 -0
  2167. package/src/Pattern/index.ts +0 -0
  2168. package/src/Pattern/types.ts +0 -0
  2169. package/src/Point.spec.ts +0 -0
  2170. package/src/Point.ts +0 -0
  2171. package/src/Shadow.spec.ts +0 -0
  2172. package/src/Shadow.ts +0 -0
  2173. package/src/__snapshots__/Shadow.spec.ts.snap +0 -0
  2174. package/src/brushes/BaseBrush.spec.ts +0 -0
  2175. package/src/brushes/BaseBrush.ts +0 -0
  2176. package/src/brushes/CircleBrush.test.ts +0 -0
  2177. package/src/brushes/CircleBrush.ts +0 -0
  2178. package/src/brushes/PatternBrush.ts +0 -0
  2179. package/src/brushes/PencilBrush.spec.ts +0 -0
  2180. package/src/brushes/PencilBrush.ts +0 -0
  2181. package/src/brushes/SprayBrush.ts +0 -0
  2182. package/src/brushes/__snapshots__/PencilBrush.spec.ts.snap +0 -0
  2183. package/src/brushes/typedefs.ts +0 -0
  2184. package/src/cache.spec.ts +0 -0
  2185. package/src/cache.ts +0 -0
  2186. package/src/canvas/Canvas-dispose.spec.ts +0 -0
  2187. package/src/canvas/Canvas-events.spec.ts +0 -0
  2188. package/src/canvas/Canvas.spec.ts +0 -0
  2189. package/src/canvas/Canvas.ts +0 -0
  2190. package/src/canvas/CanvasOptions.ts +0 -0
  2191. package/src/canvas/DOMManagers/CanvasDOMManager.ts +0 -0
  2192. package/src/canvas/DOMManagers/StaticCanvasDOMManager.ts +0 -0
  2193. package/src/canvas/DOMManagers/util.spec.ts +0 -0
  2194. package/src/canvas/DOMManagers/util.ts +0 -0
  2195. package/src/canvas/SelectableCanvas.spec.ts +0 -0
  2196. package/src/canvas/SelectableCanvas.ts +0 -0
  2197. package/src/canvas/StaticCanvas.spec.ts +0 -0
  2198. package/src/canvas/StaticCanvas.ts +0 -0
  2199. package/src/canvas/StaticCanvasOptions.ts +0 -0
  2200. package/src/canvas/TextEditingManager.ts +0 -0
  2201. package/src/canvas/__tests__/SelectableCanvas.spec.ts +0 -0
  2202. package/src/canvas/__tests__/__snapshots__/eventData.test.ts.snap +0 -0
  2203. package/src/canvas/__tests__/eventData.test.ts +0 -0
  2204. package/src/canvas/canvas_gestures.mixin.ts +0 -0
  2205. package/src/color/Color.ts +0 -0
  2206. package/src/color/color.test.ts +0 -0
  2207. package/src/color/color_map.ts +0 -0
  2208. package/src/color/constants.ts +0 -0
  2209. package/src/color/typedefs.ts +0 -0
  2210. package/src/color/util.ts +0 -0
  2211. package/src/config.ts +0 -0
  2212. package/src/constants.ts +0 -0
  2213. package/src/controls/Control-cursor.spec.ts +0 -0
  2214. package/src/controls/Control-handlers.spec.ts +0 -0
  2215. package/src/controls/Control.spec.ts +0 -0
  2216. package/src/controls/Control.ts +0 -0
  2217. package/src/controls/changeHeight.ts +0 -0
  2218. package/src/controls/changeWidth.test.ts +0 -0
  2219. package/src/controls/changeWidth.ts +0 -0
  2220. package/src/controls/commonControls.ts +0 -0
  2221. package/src/controls/controlRendering.ts +0 -0
  2222. package/src/controls/drag.ts +0 -0
  2223. package/src/controls/fireEvent.ts +0 -0
  2224. package/src/controls/index.ts +0 -0
  2225. package/src/controls/pathControl.spec.ts +0 -0
  2226. package/src/controls/pathControl.ts +0 -0
  2227. package/src/controls/polyControl.spec.ts +0 -0
  2228. package/src/controls/polyControl.ts +0 -0
  2229. package/src/controls/rotate.ts +0 -0
  2230. package/src/controls/scale.test.ts +0 -0
  2231. package/src/controls/scale.ts +0 -0
  2232. package/src/controls/scaleSkew.ts +0 -0
  2233. package/src/controls/skew.ts +0 -0
  2234. package/src/controls/util.ts +0 -0
  2235. package/src/controls/wrapWithFireEvent.ts +0 -0
  2236. package/src/controls/wrapWithFixedAnchor.spec.ts +0 -0
  2237. package/src/controls/wrapWithFixedAnchor.ts +0 -0
  2238. package/src/env/browser.ts +0 -0
  2239. package/src/env/env.spec.ts +0 -0
  2240. package/src/env/index.ts +0 -0
  2241. package/src/env/node.ts +0 -0
  2242. package/src/env/types.ts +0 -0
  2243. package/src/filters/BaseFilter.spec.ts +0 -0
  2244. package/src/filters/BaseFilter.ts +0 -0
  2245. package/src/filters/BlendColor.ts +0 -0
  2246. package/src/filters/BlendImage.ts +0 -0
  2247. package/src/filters/Blur.ts +0 -0
  2248. package/src/filters/Boilerplate.ts +0 -0
  2249. package/src/filters/Brightness.ts +0 -0
  2250. package/src/filters/Canvas2dFilterBackend.ts +0 -0
  2251. package/src/filters/ColorMatrix.spec.ts +0 -0
  2252. package/src/filters/ColorMatrix.ts +0 -0
  2253. package/src/filters/ColorMatrixFilters.ts +0 -0
  2254. package/src/filters/Composed.ts +0 -0
  2255. package/src/filters/Contrast.ts +0 -0
  2256. package/src/filters/Convolute.ts +0 -0
  2257. package/src/filters/FilterBackend.ts +0 -0
  2258. package/src/filters/GLProbes/GLProbe.ts +0 -0
  2259. package/src/filters/GLProbes/NodeGLProbe.ts +0 -0
  2260. package/src/filters/GLProbes/WebGLProbe.ts +0 -0
  2261. package/src/filters/Gamma.ts +0 -0
  2262. package/src/filters/Grayscale.ts +0 -0
  2263. package/src/filters/HueRotation.ts +0 -0
  2264. package/src/filters/Invert.ts +0 -0
  2265. package/src/filters/Noise.ts +0 -0
  2266. package/src/filters/Pixelate.ts +0 -0
  2267. package/src/filters/RemoveColor.ts +0 -0
  2268. package/src/filters/Resize.ts +0 -0
  2269. package/src/filters/Saturation.ts +0 -0
  2270. package/src/filters/Vibrance.ts +0 -0
  2271. package/src/filters/WebGLFilterBackend.spec.ts +0 -0
  2272. package/src/filters/WebGLFilterBackend.ts +0 -0
  2273. package/src/filters/filters.ts +0 -0
  2274. package/src/filters/index.ts +0 -0
  2275. package/src/filters/shaders/baseFilter.ts +0 -0
  2276. package/src/filters/shaders/blendColor.ts +0 -0
  2277. package/src/filters/shaders/blendImage.ts +0 -0
  2278. package/src/filters/shaders/blur.ts +0 -0
  2279. package/src/filters/shaders/brightness.ts +0 -0
  2280. package/src/filters/shaders/colorMatrix.ts +0 -0
  2281. package/src/filters/shaders/constrast.ts +0 -0
  2282. package/src/filters/shaders/convolute.ts +0 -0
  2283. package/src/filters/shaders/gamma.ts +0 -0
  2284. package/src/filters/shaders/grayscale.ts +0 -0
  2285. package/src/filters/shaders/invert.ts +0 -0
  2286. package/src/filters/shaders/noise.ts +0 -0
  2287. package/src/filters/shaders/pixelate.ts +0 -0
  2288. package/src/filters/shaders/removeColor.ts +0 -0
  2289. package/src/filters/shaders/saturation.ts +0 -0
  2290. package/src/filters/shaders/vibrance.ts +0 -0
  2291. package/src/filters/typedefs.ts +0 -0
  2292. package/src/filters/utils.ts +0 -0
  2293. package/src/gradient/Gradient.spec.ts +0 -0
  2294. package/src/gradient/Gradient.ts +0 -0
  2295. package/src/gradient/constants.ts +0 -0
  2296. package/src/gradient/index.ts +0 -0
  2297. package/src/gradient/parser/misc.ts +0 -0
  2298. package/src/gradient/parser/parseColorStops.ts +0 -0
  2299. package/src/gradient/parser/parseCoords.ts +0 -0
  2300. package/src/gradient/typedefs.ts +0 -0
  2301. package/src/mixins/eraser_brush.mixin.ts +0 -0
  2302. package/src/parkinglot/canvas_animation.mixin.ts +0 -0
  2303. package/src/parkinglot/straighten.ts +0 -0
  2304. package/src/parser/applyViewboxTransform.spec.ts +0 -0
  2305. package/src/parser/applyViewboxTransform.ts +0 -0
  2306. package/src/parser/attributes.ts +0 -0
  2307. package/src/parser/constants.spec.ts +0 -0
  2308. package/src/parser/constants.ts +0 -0
  2309. package/src/parser/doesSomeParentMatch.ts +0 -0
  2310. package/src/parser/elementMatchesRule.ts +0 -0
  2311. package/src/parser/elements_parser.ts +0 -0
  2312. package/src/parser/getCSSRules.spec.ts +0 -0
  2313. package/src/parser/getCSSRules.ts +0 -0
  2314. package/src/parser/getGlobalStylesForElement.ts +0 -0
  2315. package/src/parser/getGradientDefs.ts +0 -0
  2316. package/src/parser/getMultipleNodes.ts +0 -0
  2317. package/src/parser/getSvgRegex.ts +0 -0
  2318. package/src/parser/getTagName.ts +0 -0
  2319. package/src/parser/hasInvalidAncestor.ts +0 -0
  2320. package/src/parser/loadSVGFromString.test.ts +0 -0
  2321. package/src/parser/loadSVGFromString.ts +0 -0
  2322. package/src/parser/loadSVGFromURL.ts +0 -0
  2323. package/src/parser/normalizeAttr.ts +0 -0
  2324. package/src/parser/normalizeValue.ts +0 -0
  2325. package/src/parser/parseAttributes.ts +0 -0
  2326. package/src/parser/parseFontDeclaration.ts +0 -0
  2327. package/src/parser/parsePointsAttribute.ts +0 -0
  2328. package/src/parser/parseSVGDocument.ts +0 -0
  2329. package/src/parser/parseStyleAttribute.ts +0 -0
  2330. package/src/parser/parseStyleObject.ts +0 -0
  2331. package/src/parser/parseStyleString.ts +0 -0
  2332. package/src/parser/parseTransformAttribute.ts +0 -0
  2333. package/src/parser/parseUseDirectives.test.ts +0 -0
  2334. package/src/parser/parseUseDirectives.ts +0 -0
  2335. package/src/parser/parser.spec.ts +0 -0
  2336. package/src/parser/percent.ts +0 -0
  2337. package/src/parser/recursivelyParseGradientsXlink.ts +0 -0
  2338. package/src/parser/selectorMatches.ts +0 -0
  2339. package/src/parser/setStrokeFillOpacity.ts +0 -0
  2340. package/src/parser/typedefs.ts +0 -0
  2341. package/src/shapes/ActiveSelection.spec.ts +0 -0
  2342. package/src/shapes/ActiveSelection.ts +0 -0
  2343. package/src/shapes/Circle.spec.ts +0 -0
  2344. package/src/shapes/Circle.ts +0 -0
  2345. package/src/shapes/Ellipse.spec.ts +0 -0
  2346. package/src/shapes/Ellipse.ts +0 -0
  2347. package/src/shapes/Group.spec.ts +0 -0
  2348. package/src/shapes/Group.ts +0 -0
  2349. package/src/shapes/IText/DraggableTextDelegate.ts +0 -0
  2350. package/src/shapes/IText/IText-click-behavior.spec.ts +0 -0
  2351. package/src/shapes/IText/IText.test.ts +0 -0
  2352. package/src/shapes/IText/IText.ts +846 -846
  2353. package/src/shapes/IText/ITextBehavior.test.ts +0 -0
  2354. package/src/shapes/IText/ITextBehavior.ts +1187 -1176
  2355. package/src/shapes/IText/ITextClickBehavior.ts +254 -254
  2356. package/src/shapes/IText/ITextKeyBehavior.test.ts +0 -0
  2357. package/src/shapes/IText/ITextKeyBehavior.ts +41 -0
  2358. package/src/shapes/IText/__snapshots__/IText.test.ts.snap +0 -0
  2359. package/src/shapes/IText/__snapshots__/ITextBehavior.test.ts.snap +0 -0
  2360. package/src/shapes/IText/constants.ts +0 -0
  2361. package/src/shapes/Image-filters.spec.ts +0 -0
  2362. package/src/shapes/Image.spec.ts +0 -0
  2363. package/src/shapes/Image.ts +0 -0
  2364. package/src/shapes/Line.spec.ts +0 -0
  2365. package/src/shapes/Line.ts +484 -157
  2366. package/src/shapes/Object/FabricObject.spec.ts +0 -0
  2367. package/src/shapes/Object/FabricObject.ts +0 -0
  2368. package/src/shapes/Object/FabricObjectSVGExportMixin.ts +0 -0
  2369. package/src/shapes/Object/InteractiveObject.spec.ts +0 -0
  2370. package/src/shapes/Object/InteractiveObject.ts +0 -0
  2371. package/src/shapes/Object/Object-clip-path.spec.ts +0 -0
  2372. package/src/shapes/Object/Object-interactivity.spec.ts +0 -0
  2373. package/src/shapes/Object/Object.spec.ts +0 -0
  2374. package/src/shapes/Object/Object.ts +0 -0
  2375. package/src/shapes/Object/ObjectGeometry.spec.ts +0 -0
  2376. package/src/shapes/Object/ObjectGeometry.ts +0 -0
  2377. package/src/shapes/Object/ObjectOrigin.spec.ts +0 -0
  2378. package/src/shapes/Object/ObjectSerialization.spec.ts +0 -0
  2379. package/src/shapes/Object/StackedObject.spec.ts +0 -0
  2380. package/src/shapes/Object/__snapshots__/InteractiveObject.spec.ts.snap +0 -0
  2381. package/src/shapes/Object/defaultValues.ts +0 -0
  2382. package/src/shapes/Object/types/BaseProps.ts +0 -0
  2383. package/src/shapes/Object/types/BorderProps.ts +0 -0
  2384. package/src/shapes/Object/types/ControlProps.ts +0 -0
  2385. package/src/shapes/Object/types/FabricObjectProps.ts +0 -0
  2386. package/src/shapes/Object/types/FillStrokeProps.ts +0 -0
  2387. package/src/shapes/Object/types/LockInteractionProps.ts +0 -0
  2388. package/src/shapes/Object/types/ObjectProps.ts +0 -0
  2389. package/src/shapes/Object/types/ObjectTransformProps.ts +0 -0
  2390. package/src/shapes/Object/types/SerializedObjectProps.ts +0 -0
  2391. package/src/shapes/Object/types/index.ts +0 -0
  2392. package/src/shapes/Path.spec.ts +0 -0
  2393. package/src/shapes/Path.ts +0 -0
  2394. package/src/shapes/Polygon.spec.ts +0 -0
  2395. package/src/shapes/Polygon.ts +0 -0
  2396. package/src/shapes/Polyline.spec.ts +0 -0
  2397. package/src/shapes/Polyline.ts +70 -29
  2398. package/src/shapes/Rect.spec.ts +0 -0
  2399. package/src/shapes/Rect.ts +0 -0
  2400. package/src/shapes/Text/StyledText.spec.ts +0 -0
  2401. package/src/shapes/Text/StyledText.ts +0 -0
  2402. package/src/shapes/Text/Text.spec.ts +0 -0
  2403. package/src/shapes/Text/Text.ts +2459 -2161
  2404. package/src/shapes/Text/TextSVGExportMixin.spec.ts +0 -0
  2405. package/src/shapes/Text/TextSVGExportMixin.ts +0 -0
  2406. package/src/shapes/Text/__snapshots__/Text.spec.ts.snap +0 -0
  2407. package/src/shapes/Text/__snapshots__/TextSVGExportMixin.spec.ts.snap +0 -0
  2408. package/src/shapes/Text/constants.ts +134 -134
  2409. package/src/shapes/Textbox.spec.ts +0 -0
  2410. package/src/shapes/Textbox.ts +1320 -788
  2411. package/src/shapes/Triangle.spec.ts +76 -0
  2412. package/src/shapes/Triangle.ts +85 -15
  2413. package/src/shapes/__snapshots__/Image.spec.ts.snap +0 -0
  2414. package/src/shapes/__snapshots__/Textbox.spec.ts.snap +0 -0
  2415. package/src/text/browserLines.ts +233 -233
  2416. package/src/text/ellipsis.ts +516 -516
  2417. package/src/text/hitTest.ts +623 -623
  2418. package/src/text/layout.ts +586 -586
  2419. package/src/text/measure.ts +626 -476
  2420. package/src/text/overlayEditor.ts +1047 -895
  2421. package/src/text/unicode.ts +454 -454
  2422. package/src/typedefs.ts +0 -0
  2423. package/src/util/__snapshots__/index.spec.ts.snap +0 -0
  2424. package/src/util/animation/AnimationBase.ts +0 -0
  2425. package/src/util/animation/AnimationFrameProvider.ts +0 -0
  2426. package/src/util/animation/AnimationRegistry.ts +0 -0
  2427. package/src/util/animation/ArrayAnimation.ts +0 -0
  2428. package/src/util/animation/ColorAnimation.ts +0 -0
  2429. package/src/util/animation/ValueAnimation.ts +0 -0
  2430. package/src/util/animation/__snapshots__/animations.spec.ts.snap +0 -0
  2431. package/src/util/animation/animate.ts +0 -0
  2432. package/src/util/animation/animations.spec.ts +0 -0
  2433. package/src/util/animation/easing.ts +0 -0
  2434. package/src/util/animation/index.ts +0 -0
  2435. package/src/util/animation/types.ts +0 -0
  2436. package/src/util/applyMixins.ts +0 -0
  2437. package/src/util/dom_event.spec.ts +0 -0
  2438. package/src/util/dom_event.ts +0 -0
  2439. package/src/util/dom_misc.ts +0 -0
  2440. package/src/util/index.spec.ts +0 -0
  2441. package/src/util/index.ts +0 -0
  2442. package/src/util/internals/applyCanvasTransform.ts +0 -0
  2443. package/src/util/internals/cleanupSvgAttribute.test.ts +0 -0
  2444. package/src/util/internals/cleanupSvgAttribute.ts +0 -0
  2445. package/src/util/internals/cloneStyles.spec.ts +0 -0
  2446. package/src/util/internals/cloneStyles.ts +0 -0
  2447. package/src/util/internals/console.ts +0 -0
  2448. package/src/util/internals/dom_style.spec.ts +0 -0
  2449. package/src/util/internals/dom_style.ts +0 -0
  2450. package/src/util/internals/findRight.ts +0 -0
  2451. package/src/util/internals/getRandomInt.test.ts +0 -0
  2452. package/src/util/internals/getRandomInt.ts +0 -0
  2453. package/src/util/internals/ifNaN.ts +0 -0
  2454. package/src/util/internals/removeFromArray.spec.ts +0 -0
  2455. package/src/util/internals/removeFromArray.ts +0 -0
  2456. package/src/util/internals/uid.ts +0 -0
  2457. package/src/util/lang_string.spec.ts +0 -0
  2458. package/src/util/lang_string.ts +0 -0
  2459. package/src/util/misc/boundingBoxFromPoints.spec.ts +0 -0
  2460. package/src/util/misc/boundingBoxFromPoints.ts +0 -0
  2461. package/src/util/misc/capValue.spec.ts +0 -0
  2462. package/src/util/misc/capValue.ts +0 -0
  2463. package/src/util/misc/cornerRadius.spec.ts +141 -0
  2464. package/src/util/misc/cornerRadius.ts +269 -0
  2465. package/src/util/misc/cos.spec.ts +0 -0
  2466. package/src/util/misc/cos.ts +0 -0
  2467. package/src/util/misc/dom.spec.ts +0 -0
  2468. package/src/util/misc/dom.ts +0 -0
  2469. package/src/util/misc/findScaleTo.spec.ts +0 -0
  2470. package/src/util/misc/findScaleTo.ts +0 -0
  2471. package/src/util/misc/groupSVGElements.spec.ts +0 -0
  2472. package/src/util/misc/groupSVGElements.ts +0 -0
  2473. package/src/util/misc/isTransparent.ts +0 -0
  2474. package/src/util/misc/matrix.spec.ts +0 -0
  2475. package/src/util/misc/matrix.ts +0 -0
  2476. package/src/util/misc/mergeClipPaths.spec.ts +0 -0
  2477. package/src/util/misc/mergeClipPaths.ts +0 -0
  2478. package/src/util/misc/objectEnlive.spec.ts +0 -0
  2479. package/src/util/misc/objectEnlive.ts +0 -0
  2480. package/src/util/misc/objectTransforms.spec.ts +0 -0
  2481. package/src/util/misc/objectTransforms.ts +0 -0
  2482. package/src/util/misc/pick.spec.ts +0 -0
  2483. package/src/util/misc/pick.ts +0 -0
  2484. package/src/util/misc/planeChange.spec.ts +0 -0
  2485. package/src/util/misc/planeChange.ts +0 -0
  2486. package/src/util/misc/projectStroke/StrokeLineCapProjections.ts +0 -0
  2487. package/src/util/misc/projectStroke/StrokeLineJoinProjections.ts +0 -0
  2488. package/src/util/misc/projectStroke/StrokeProjectionsBase.ts +0 -0
  2489. package/src/util/misc/projectStroke/index.ts +0 -0
  2490. package/src/util/misc/projectStroke/types.ts +0 -0
  2491. package/src/util/misc/radiansDegreesConversion.spec.ts +0 -0
  2492. package/src/util/misc/radiansDegreesConversion.ts +0 -0
  2493. package/src/util/misc/resolveOrigin.ts +0 -0
  2494. package/src/util/misc/sin.ts +0 -0
  2495. package/src/util/misc/svgExport.ts +0 -0
  2496. package/src/util/misc/svgParsing.spec.ts +0 -0
  2497. package/src/util/misc/svgParsing.ts +0 -0
  2498. package/src/util/misc/textStyles.ts +0 -0
  2499. package/src/util/misc/toFixed.spec.ts +0 -0
  2500. package/src/util/misc/toFixed.ts +0 -0
  2501. package/src/util/misc/vectors.spec.ts +0 -0
  2502. package/src/util/misc/vectors.ts +0 -0
  2503. package/src/util/path/__snapshots__/index.spec.ts.snap +0 -0
  2504. package/src/util/path/index.spec.ts +0 -0
  2505. package/src/util/path/index.ts +0 -0
  2506. package/src/util/path/regex.ts +0 -0
  2507. package/src/util/path/typechecks.ts +0 -0
  2508. package/src/util/path/typedefs.ts +0 -0
  2509. package/src/util/transform_matrix_removal.ts +0 -0
  2510. package/src/util/typeAssertions.spec.ts +0 -0
  2511. package/src/util/typeAssertions.ts +0 -0
  2512. package/tsconfig-extensions.json +0 -0
  2513. package/tsconfig.json +0 -0
  2514. package/tsconfig.spec.json +0 -0
  2515. package/typedoc.config.json +0 -0
  2516. package/vitest.config.ts +0 -0
  2517. package/vitest.d.ts +0 -0
  2518. package/vitest.env.d.ts +0 -0
  2519. package/vitest.extend.ts +0 -0
  2520. package/vitest.setup.ts +0 -0
@@ -1,2161 +1,2459 @@
1
- import { cache } from '../../cache';
2
- import { DEFAULT_SVG_FONT_SIZE, FILL, STROKE } from '../../constants';
3
- import type { ObjectEvents } from '../../EventTypeDefs';
4
- import type {
5
- CompleteTextStyleDeclaration,
6
- TextStyle,
7
- TextStyleDeclaration,
8
- } from './StyledText';
9
- import { StyledText } from './StyledText';
10
- import { SHARED_ATTRIBUTES } from '../../parser/attributes';
11
- import { parseAttributes } from '../../parser/parseAttributes';
12
- import type {
13
- Abortable,
14
- TCacheCanvasDimensions,
15
- TClassProperties,
16
- TFiller,
17
- TOptions,
18
- } from '../../typedefs';
19
- import { classRegistry } from '../../ClassRegistry';
20
- import { graphemeSplit } from '../../util/lang_string';
21
- import { createCanvasElementFor } from '../../util/misc/dom';
22
- import { layoutText, type LayoutResult, type TextLayoutOptions } from '../../text/layout';
23
- import { measureGrapheme, measureGraphemeWithKerning } from '../../text/measure';
24
- import { applyEllipsis } from '../../text/ellipsis';
25
- import { segmentGraphemes } from '../../text/unicode';
26
- import type { TextStyleArray } from '../../util/misc/textStyles';
27
- import {
28
- hasStyleChanged,
29
- stylesFromArray,
30
- stylesToArray,
31
- } from '../../util/misc/textStyles';
32
- import { getPathSegmentsInfo, getPointOnPath } from '../../util/path';
33
- import { cacheProperties } from '../Object/FabricObject';
34
- import type { Path } from '../Path';
35
- import { TextSVGExportMixin } from './TextSVGExportMixin';
36
- import { applyMixins } from '../../util/applyMixins';
37
- import type { FabricObjectProps, SerializedObjectProps } from '../Object/types';
38
- import type { StylePropertiesType } from './constants';
39
- import {
40
- additionalProps,
41
- textDefaultValues,
42
- textLayoutProperties,
43
- JUSTIFY,
44
- JUSTIFY_CENTER,
45
- JUSTIFY_LEFT,
46
- JUSTIFY_RIGHT,
47
- TEXT_DECORATION_THICKNESS,
48
- } from './constants';
49
- import { CENTER, LEFT, RIGHT, TOP, BOTTOM } from '../../constants';
50
- import { isFiller } from '../../util/typeAssertions';
51
- import type { Gradient } from '../../gradient/Gradient';
52
- import type { Pattern } from '../../Pattern';
53
- import type { CSSRules } from '../../parser/typedefs';
54
- import { getBrowserLines, clearBrowserLines } from '../../text/browserLines';
55
- import type { BrowserLine } from '../../text/browserLines';
56
-
57
- let measuringContext: CanvasRenderingContext2D | null;
58
-
59
- /**
60
- * Return a context for measurement of text string.
61
- * if created it gets stored for reuse
62
- */
63
- function getMeasuringContext() {
64
- if (!measuringContext) {
65
- const canvas = createCanvasElementFor({
66
- width: 0,
67
- height: 0,
68
- });
69
- measuringContext = canvas.getContext('2d');
70
- }
71
- return measuringContext;
72
- }
73
-
74
- export type TPathSide = 'left' | 'right';
75
-
76
- export type TPathAlign = 'baseline' | 'center' | 'ascender' | 'descender';
77
-
78
- export type TextLinesInfo = {
79
- lines: string[];
80
- graphemeLines: string[][];
81
- graphemeText: string[];
82
- _unwrappedLines: string[][];
83
- };
84
-
85
- /**
86
- * Measure and return the info of a single grapheme.
87
- * needs the the info of previous graphemes already filled
88
- * Override to customize measuring
89
- */
90
- export type GraphemeBBox = {
91
- width: number;
92
- height: number;
93
- kernedWidth: number;
94
- left: number;
95
- deltaY: number;
96
- renderLeft?: number;
97
- renderTop?: number;
98
- angle?: number;
99
- };
100
-
101
- // @TODO this is not complete
102
- interface UniqueTextProps {
103
- charSpacing: number;
104
- lineHeight: number;
105
- fontSize: number;
106
- fontWeight: string | number;
107
- fontFamily: string;
108
- fontStyle: string;
109
- pathSide: TPathSide;
110
- pathAlign: TPathAlign;
111
- underline: boolean;
112
- overline: boolean;
113
- linethrough: boolean;
114
- textAlign: string;
115
- direction: CanvasDirection;
116
- path?: Path;
117
- textDecorationThickness: number;
118
- wrap: 'word' | 'char' | 'none';
119
- ellipsis: boolean | string;
120
- letterSpacing: number;
121
- enableAdvancedLayout: boolean;
122
- verticalAlign: 'top' | 'middle' | 'bottom';
123
- useOverlayEditing: boolean;
124
- }
125
-
126
- export interface SerializedTextProps
127
- extends SerializedObjectProps,
128
- UniqueTextProps {
129
- styles: TextStyleArray | TextStyle;
130
- }
131
-
132
- export interface TextProps extends FabricObjectProps, UniqueTextProps {
133
- styles: TextStyle;
134
- }
135
-
136
- /**
137
- * Text class
138
- * @see {@link http://fabricjs.com/fabric-intro-part-2#text}
139
- */
140
- export class FabricText<
141
- Props extends TOptions<TextProps> = Partial<TextProps>,
142
- SProps extends SerializedTextProps = SerializedTextProps,
143
- EventSpec extends ObjectEvents = ObjectEvents,
144
- >
145
- extends StyledText<Props, SProps, EventSpec>
146
- implements UniqueTextProps
147
- {
148
- /**
149
- * Properties that requires a text layout recalculation when changed
150
- * @type string[]
151
- * @protected
152
- */
153
- static textLayoutProperties: string[] = textLayoutProperties;
154
-
155
- /**
156
- * @private
157
- */
158
- declare _reNewline: RegExp;
159
-
160
- /**
161
- * Use this regular expression to filter for whitespaces that is not a new line.
162
- * Mostly used when text is 'justify' aligned.
163
- * @private
164
- */
165
- declare _reSpacesAndTabs: RegExp;
166
-
167
- /**
168
- * Use this regular expression to filter for whitespace that is not a new line.
169
- * Mostly used when text is 'justify' aligned.
170
- * @private
171
- */
172
- declare _reSpaceAndTab: RegExp;
173
-
174
- /**
175
- * Use this regular expression to filter consecutive groups of non spaces.
176
- * Mostly used when text is 'justify' aligned.
177
- * @private
178
- */
179
- declare _reWords: RegExp;
180
-
181
- declare text: string;
182
-
183
- /**
184
- * Font size (in pixels)
185
- * @type Number
186
- */
187
- declare fontSize: number;
188
-
189
- /**
190
- * Font weight (e.g. bold, normal, 400, 600, 800)
191
- * @type {(Number|String)}
192
- */
193
- declare fontWeight: string | number;
194
-
195
- /**
196
- * Font family
197
- * @type String
198
- */
199
- declare fontFamily: string;
200
-
201
- /**
202
- * Text decoration underline.
203
- * @type Boolean
204
- */
205
- declare underline: boolean;
206
-
207
- /**
208
- * Text decoration overline.
209
- * @type Boolean
210
- */
211
- declare overline: boolean;
212
-
213
- /**
214
- * Text decoration linethrough.
215
- * @type Boolean
216
- */
217
- declare linethrough: boolean;
218
-
219
- /**
220
- * Text alignment. Possible values: "left", "center", "right", "justify",
221
- * "justify-left", "justify-center" or "justify-right".
222
- * @type String
223
- */
224
- declare textAlign: string;
225
-
226
- /**
227
- * Font style . Possible values: "", "normal", "italic" or "oblique".
228
- * @type String
229
- */
230
- declare fontStyle: string;
231
-
232
- /**
233
- * Line height
234
- * @type Number
235
- */
236
- declare lineHeight: number;
237
-
238
- /**
239
- * Superscript schema object (minimum overlap)
240
- */
241
- declare superscript: {
242
- /**
243
- * fontSize factor
244
- * @default 0.6
245
- */
246
- size: number;
247
- /**
248
- * baseline-shift factor (upwards)
249
- * @default -0.35
250
- */
251
- baseline: number;
252
- };
253
-
254
- /**
255
- * Subscript schema object (minimum overlap)
256
- */
257
- declare subscript: {
258
- /**
259
- * fontSize factor
260
- * @default 0.6
261
- */
262
- size: number;
263
- /**
264
- * baseline-shift factor (downwards)
265
- * @default 0.11
266
- */
267
- baseline: number;
268
- };
269
-
270
- /**
271
- * Background color of text lines
272
- * @type String
273
- */
274
- declare textBackgroundColor: string;
275
-
276
- declare styles: TextStyle;
277
-
278
- /**
279
- * Path that the text should follow.
280
- * since 4.6.0 the path will be drawn automatically.
281
- * if you want to make the path visible, give it a stroke and strokeWidth or fill value
282
- * if you want it to be hidden, assign visible = false to the path.
283
- * This feature is in BETA, and SVG import/export is not yet supported.
284
- * @type Path
285
- * @example
286
- * const textPath = new Text('Text on a path', {
287
- * top: 150,
288
- * left: 150,
289
- * textAlign: 'center',
290
- * charSpacing: -50,
291
- * path: new Path('M 0 0 C 50 -100 150 -100 200 0', {
292
- * strokeWidth: 1,
293
- * visible: false
294
- * }),
295
- * pathSide: 'left',
296
- * pathStartOffset: 0
297
- * });
298
- */
299
- declare path?: Path;
300
-
301
- /**
302
- * Text wrapping mode
303
- * @type string
304
- * @default 'word'
305
- */
306
- declare wrap: 'word' | 'char' | 'none';
307
-
308
- /**
309
- * Ellipsis truncation
310
- * @type boolean | string
311
- * @default false
312
- */
313
- declare ellipsis: boolean | string;
314
-
315
- /**
316
- * Letter spacing in pixels (Konva-style)
317
- * @type number
318
- * @default 0
319
- */
320
- declare letterSpacing: number;
321
-
322
- /**
323
- * Enable advanced text layout engine
324
- * @type boolean
325
- * @default false
326
- */
327
- declare enableAdvancedLayout: boolean;
328
-
329
- /**
330
- * Vertical text alignment
331
- * @type string
332
- * @default 'top'
333
- */
334
- declare verticalAlign: 'top' | 'middle' | 'bottom';
335
-
336
- /**
337
- * Use overlay editor for inline text editing instead of hidden textarea.
338
- * @default false
339
- */
340
- declare useOverlayEditing: boolean;
341
-
342
- /**
343
- * The text decoration tickness for underline, overline and strikethrough
344
- * The tickness is expressed in thousandths of fontSize ( em ).
345
- * The original value was 1/15 that translates to 66.6667 thousandths.
346
- * The choice of unit of measure is to align with charSpacing.
347
- * You can slim the tickness without issues, while large underline or overline may end up
348
- * outside the bounding box of the text. In order to fix that a bigger refactor of the code
349
- * is needed and is out of scope for now. If you need such large overline on the first line
350
- * of text or large underline on the last line of text, consider disabling caching as a
351
- * workaround
352
- * @default 66.667
353
- */
354
- declare textDecorationThickness: number;
355
-
356
- /**
357
- * Offset amount for text path starting position
358
- * Only used when text has a path
359
- */
360
- declare pathStartOffset: number;
361
-
362
- /**
363
- * Which side of the path the text should be drawn on.
364
- * Only used when text has a path
365
- * @type {TPathSide} 'left|right'
366
- */
367
- declare pathSide: TPathSide;
368
-
369
- /**
370
- * How text is aligned to the path. This property determines
371
- * the perpendicular position of each character relative to the path.
372
- * (one of "baseline", "center", "ascender", "descender")
373
- * This feature is in BETA, and its behavior may change
374
- * @type TPathAlign
375
- */
376
- declare pathAlign: TPathAlign;
377
-
378
- /**
379
- * @private
380
- */
381
- declare _fontSizeFraction: number;
382
-
383
- /**
384
- * @private
385
- */
386
- declare offsets: { underline: number; linethrough: number; overline: number };
387
-
388
- /**
389
- * Text Line proportion to font Size (in pixels)
390
- * @type Number
391
- */
392
- declare _fontSizeMult: number;
393
-
394
- /**
395
- * additional space between characters
396
- * expressed in thousands of em unit
397
- * @type Number
398
- */
399
- declare charSpacing: number;
400
-
401
- /**
402
- * Baseline shift, styles only, keep at 0 for the main text object
403
- * @type {Number}
404
- */
405
- declare deltaY: number;
406
-
407
- /**
408
- * WARNING: EXPERIMENTAL. NOT SUPPORTED YET
409
- * determine the direction of the text.
410
- * This has to be set manually together with textAlign and originX for proper
411
- * experience.
412
- * some interesting link for the future
413
- * https://www.w3.org/International/questions/qa-bidi-unicode-controls
414
- * @since 4.5.0
415
- * @type {CanvasDirection} 'ltr|rtl'
416
- */
417
- declare direction: CanvasDirection;
418
-
419
- /**
420
- * contains characters bounding boxes
421
- * This variable is considered to be protected.
422
- * But for how mixins are implemented right now, we can't leave it private
423
- * @protected
424
- */
425
- __charBounds: GraphemeBBox[][] = [];
426
-
427
- /**
428
- * use this size when measuring text. To avoid IE11 rounding errors
429
- * @type {Number}
430
- * @readonly
431
- * @private
432
- */
433
- declare CACHE_FONT_SIZE: number;
434
-
435
- /**
436
- * contains the min text width to avoid getting 0
437
- * @type {Number}
438
- */
439
- declare MIN_TEXT_WIDTH: number;
440
-
441
- /**
442
- * contains the the text of the object, divided in lines as they are displayed
443
- * on screen. Wrapping will divide the text independently of line breaks
444
- * @type {string[]}
445
- */
446
- declare textLines: string[];
447
-
448
- /**
449
- * same as textlines, but each line is an array of graphemes as split by splitByGrapheme
450
- * @type {string[]}
451
- */
452
- declare _textLines: string[][];
453
-
454
- declare _unwrappedTextLines: string[][];
455
- declare _text: string[];
456
- declare cursorWidth: number;
457
- declare __lineHeights: number[];
458
- declare __lineWidths: number[];
459
- declare initialized?: true;
460
-
461
- static cacheProperties = [...cacheProperties, ...additionalProps];
462
-
463
- static ownDefaults = textDefaultValues;
464
-
465
- static type = 'Text';
466
-
467
- static getDefaults(): Record<string, any> {
468
- return { ...super.getDefaults(), ...FabricText.ownDefaults };
469
- }
470
-
471
- constructor(text: string, options?: Props) {
472
- super();
473
- Object.assign(this, FabricText.ownDefaults);
474
- this.setOptions(options);
475
- if (!this.styles) {
476
- this.styles = {};
477
- }
478
- this.text = text;
479
- this.initialized = true;
480
- if (this.path) {
481
- this.setPathInfo();
482
- }
483
- this.initDimensions();
484
- this.setCoords();
485
- }
486
-
487
- /**
488
- * If text has a path, it will add the extra information needed
489
- * for path and text calculations
490
- */
491
- setPathInfo() {
492
- const path = this.path;
493
- if (path) {
494
- path.segmentsInfo = getPathSegmentsInfo(path.path);
495
- }
496
- }
497
-
498
- /**
499
- * @private
500
- * Divides text into lines of text and lines of graphemes.
501
- * Uses browser lines when available for pixel-perfect consistency.
502
- */
503
- _splitText(): TextLinesInfo {
504
- // Check if we have valid browser lines and should use them
505
- const browserLines = getBrowserLines(this);
506
- if (browserLines && this.useOverlayEditing) {
507
- return this._splitTextFromBrowserLines(browserLines);
508
- }
509
-
510
- const newLines = this._splitTextIntoLines(this.text);
511
- this.textLines = newLines.lines;
512
- this._textLines = newLines.graphemeLines;
513
- this._unwrappedTextLines = newLines._unwrappedLines;
514
- this._text = newLines.graphemeText;
515
- return newLines;
516
- }
517
-
518
- /**
519
- * Create TextLinesInfo from browser-extracted lines
520
- * @private
521
- */
522
- _splitTextFromBrowserLines(browserLines: BrowserLine[]): TextLinesInfo {
523
- const lines: string[] = [];
524
- const graphemeLines: string[][] = [];
525
- const unwrappedLines: string[][] = [];
526
- let graphemeText: string[] = [];
527
-
528
- for (const browserLine of browserLines) {
529
- lines.push(browserLine.text);
530
- const lineGraphemes = this.graphemeSplit(browserLine.text);
531
- graphemeLines.push(lineGraphemes);
532
- unwrappedLines.push(lineGraphemes);
533
- graphemeText = graphemeText.concat(lineGraphemes);
534
-
535
- // Add newline separator between lines (except for the last line)
536
- if (browserLine !== browserLines[browserLines.length - 1]) {
537
- graphemeText.push('\n');
538
- }
539
- }
540
-
541
- const result: TextLinesInfo = {
542
- lines,
543
- graphemeLines,
544
- graphemeText,
545
- _unwrappedLines: unwrappedLines,
546
- };
547
-
548
- // Update instance properties
549
- this.textLines = result.lines;
550
- this._textLines = result.graphemeLines;
551
- this._unwrappedTextLines = result._unwrappedLines;
552
- this._text = result.graphemeText;
553
-
554
- return result;
555
- }
556
-
557
- /**
558
- * Initialize or update text dimensions.
559
- * Updates this.width and this.height with the proper values.
560
- * Does not return dimensions.
561
- */
562
- initDimensions(): void {
563
- // Use advanced layout if enabled
564
- if (this.enableAdvancedLayout && !this.path) {
565
- return this.initDimensionsAdvanced();
566
- }
567
-
568
- this._splitText();
569
- this._clearCache();
570
- this.dirty = true;
571
- if (this.path) {
572
- this.width = this.path.width;
573
- this.height = this.path.height;
574
- } else {
575
- this.width =
576
- this.calcTextWidth() || this.cursorWidth || this.MIN_TEXT_WIDTH;
577
- this.height = this.calcTextHeight();
578
- }
579
- if (this.textAlign.includes(JUSTIFY)) {
580
- // once text is measured we need to make space fatter to make justified text.
581
- this.enlargeSpaces();
582
- }
583
- }
584
-
585
- /**
586
- * Enlarge space boxes and shift the others
587
- */
588
- enlargeSpaces() {
589
- let diffSpace,
590
- currentLineWidth,
591
- numberOfSpaces,
592
- accumulatedSpace,
593
- line,
594
- charBound,
595
- spaces;
596
- for (let i = 0, len = this._textLines.length; i < len; i++) {
597
- if (
598
- this.textAlign !== JUSTIFY &&
599
- (i === len - 1 || this.isEndOfWrapping(i))
600
- ) {
601
- continue;
602
- }
603
- accumulatedSpace = 0;
604
- line = this._textLines[i];
605
- currentLineWidth = this.getLineWidth(i);
606
- if (
607
- currentLineWidth < this.width &&
608
- (spaces = this.textLines[i].match(this._reSpacesAndTabs))
609
- ) {
610
- numberOfSpaces = spaces.length;
611
- diffSpace = (this.width - currentLineWidth) / numberOfSpaces;
612
- for (let j = 0; j <= line.length; j++) {
613
- charBound = this.__charBounds[i][j];
614
- if (this._reSpaceAndTab.test(line[j])) {
615
- charBound.width += diffSpace;
616
- charBound.kernedWidth += diffSpace;
617
- charBound.left += accumulatedSpace;
618
- accumulatedSpace += diffSpace;
619
- } else {
620
- charBound.left += accumulatedSpace;
621
- }
622
- }
623
- }
624
- }
625
- }
626
-
627
- /**
628
- * Advanced layout using new text engine (Konva-compatible)
629
- * @private
630
- */
631
- _layoutTextAdvanced(): LayoutResult {
632
- const options = this._getAdvancedLayoutOptions();
633
- return layoutText(options);
634
- }
635
-
636
- /**
637
- * Get advanced layout options from current text properties
638
- * @private
639
- */
640
- _getAdvancedLayoutOptions(): TextLayoutOptions {
641
- return {
642
- text: this.text,
643
- width: this.width,
644
- height: this.height,
645
- wrap: this.wrap || 'word',
646
- align: this._mapTextAlignToAlign(this.textAlign),
647
- ellipsis: this.ellipsis || false,
648
- fontSize: this.fontSize,
649
- lineHeight: this.lineHeight,
650
- letterSpacing: this.letterSpacing || 0,
651
- charSpacing: this.charSpacing,
652
- direction: this.direction === 'inherit' ? 'ltr' : this.direction,
653
- fontFamily: this.fontFamily,
654
- fontStyle: this.fontStyle,
655
- fontWeight: this.fontWeight,
656
- verticalAlign: this.verticalAlign || 'top',
657
- };
658
- }
659
-
660
- /**
661
- * Map Fabric textAlign to Konva align format
662
- * @private
663
- */
664
- _mapTextAlignToAlign(textAlign: string): 'left' | 'center' | 'right' | 'justify' {
665
- switch (textAlign) {
666
- case 'center':
667
- case CENTER:
668
- return 'center';
669
- case 'right':
670
- case RIGHT:
671
- return 'right';
672
- case 'justify':
673
- case JUSTIFY:
674
- case JUSTIFY_LEFT:
675
- case JUSTIFY_RIGHT:
676
- case JUSTIFY_CENTER:
677
- return 'justify';
678
- default:
679
- return 'left';
680
- }
681
- }
682
-
683
- /**
684
- * Enhanced initDimensions that uses advanced layout when enabled
685
- */
686
- initDimensionsAdvanced(): void {
687
- if (!this.enableAdvancedLayout) {
688
- return this.initDimensions();
689
- }
690
-
691
- const layout = this._layoutTextAdvanced();
692
-
693
- // Update dimensions from layout
694
- this.width = layout.totalWidth || this.MIN_TEXT_WIDTH;
695
- this.height = layout.totalHeight;
696
-
697
- // Convert layout to legacy format for compatibility
698
- this._convertLayoutToLegacyFormat(layout);
699
-
700
- this.dirty = true;
701
- }
702
-
703
- /**
704
- * Convert new layout format to legacy _textLines and __charBounds format
705
- * @private
706
- */
707
- _convertLayoutToLegacyFormat(layout: LayoutResult): void {
708
- this._textLines = layout.lines.map(line => line.graphemes);
709
- (this as any).textLines = layout.lines.map(line => line.text);
710
-
711
- // Convert bounds to legacy format
712
- this.__charBounds = layout.lines.map(line =>
713
- line.bounds.map(bound => ({
714
- left: bound.left,
715
- top: bound.y,
716
- width: bound.width,
717
- height: bound.height,
718
- kernedWidth: bound.kernedWidth,
719
- deltaY: bound.deltaY || 0,
720
- }))
721
- );
722
-
723
- // Update grapheme info for compatibility
724
- if (layout.lines.length > 0) {
725
- (this as any)._unwrappedTextLines = layout.lines.map(line => line.graphemes);
726
- }
727
- }
728
-
729
- /**
730
- * Detect if the text line is ended with an hard break
731
- * text and itext do not have wrapping, return false
732
- * @return {Boolean}
733
- */
734
- isEndOfWrapping(lineIndex: number): boolean {
735
- return lineIndex === this._textLines.length - 1;
736
- }
737
-
738
- /**
739
- * Detect if a line has a linebreak and so we need to account for it when moving
740
- * and counting style.
741
- * It return always 1 for text and Itext. Textbox has its own implementation
742
- * @return Number
743
- */
744
- missingNewlineOffset(lineIndex: number, skipWrapping?: boolean): 0 | 1;
745
- missingNewlineOffset(_lineIndex: number): 1 {
746
- return 1;
747
- }
748
-
749
- /**
750
- * Returns 2d representation (lineIndex and charIndex) of cursor
751
- * @param {Number} selectionStart
752
- * @param {Boolean} [skipWrapping] consider the location for unwrapped lines. useful to manage styles.
753
- */
754
- get2DCursorLocation(selectionStart: number, skipWrapping?: boolean) {
755
- const lines = skipWrapping ? this._unwrappedTextLines : this._textLines;
756
- let i: number;
757
- for (i = 0; i < lines.length; i++) {
758
- if (selectionStart <= lines[i].length) {
759
- return {
760
- lineIndex: i,
761
- charIndex: selectionStart,
762
- };
763
- }
764
- selectionStart -=
765
- lines[i].length + this.missingNewlineOffset(i, skipWrapping);
766
- }
767
- return {
768
- lineIndex: i - 1,
769
- charIndex:
770
- lines[i - 1].length < selectionStart
771
- ? lines[i - 1].length
772
- : selectionStart,
773
- };
774
- }
775
-
776
- /**
777
- * Returns string representation of an instance
778
- * @return {String} String representation of text object
779
- */
780
- toString(): string {
781
- return `#<Text (${this.complexity()}): { "text": "${
782
- this.text
783
- }", "fontFamily": "${this.fontFamily}" }>`;
784
- }
785
-
786
- /**
787
- * Return the dimension and the zoom level needed to create a cache canvas
788
- * big enough to host the object to be cached.
789
- * @private
790
- * @param {Object} dim.x width of object to be cached
791
- * @param {Object} dim.y height of object to be cached
792
- * @return {Object}.width width of canvas
793
- * @return {Object}.height height of canvas
794
- * @return {Object}.zoomX zoomX zoom value to unscale the canvas before drawing cache
795
- * @return {Object}.zoomY zoomY zoom value to unscale the canvas before drawing cache
796
- */
797
- _getCacheCanvasDimensions(): TCacheCanvasDimensions {
798
- const dims = super._getCacheCanvasDimensions();
799
- const fontSize = this.fontSize;
800
- dims.width += fontSize * dims.zoomX;
801
- dims.height += fontSize * dims.zoomY;
802
- return dims;
803
- }
804
-
805
- /**
806
- * @private
807
- * @param {CanvasRenderingContext2D} ctx Context to render on
808
- */
809
- _render(ctx: CanvasRenderingContext2D) {
810
- const path = this.path;
811
- path && !path.isNotVisible() && path._render(ctx);
812
- this._setTextStyles(ctx);
813
- this._renderTextLinesBackground(ctx);
814
- this._renderTextDecoration(ctx, 'underline');
815
- this._renderText(ctx);
816
- this._renderTextDecoration(ctx, 'overline');
817
- this._renderTextDecoration(ctx, 'linethrough');
818
- }
819
-
820
- /**
821
- * @private
822
- * @param {CanvasRenderingContext2D} ctx Context to render on
823
- */
824
- _renderText(ctx: CanvasRenderingContext2D) {
825
- // Skip text rendering if in overlay editing mode
826
- if ((this as any).__overlayEditor) {
827
- return;
828
- }
829
- if (this.paintFirst === STROKE) {
830
- this._renderTextStroke(ctx);
831
- this._renderTextFill(ctx);
832
- } else {
833
- this._renderTextFill(ctx);
834
- this._renderTextStroke(ctx);
835
- }
836
- }
837
-
838
- /**
839
- * Set the font parameter of the context with the object properties or with charStyle
840
- * @private
841
- * @param {CanvasRenderingContext2D} ctx Context to render on
842
- * @param {Object} [charStyle] object with font style properties
843
- * @param {String} [charStyle.fontFamily] Font Family
844
- * @param {Number} [charStyle.fontSize] Font size in pixels. ( without px suffix )
845
- * @param {String} [charStyle.fontWeight] Font weight
846
- * @param {String} [charStyle.fontStyle] Font style (italic|normal)
847
- */
848
- _setTextStyles(
849
- ctx: CanvasRenderingContext2D,
850
- charStyle?: any,
851
- forMeasuring?: boolean,
852
- ) {
853
- ctx.textBaseline = 'alphabetic';
854
- if (this.path) {
855
- switch (this.pathAlign) {
856
- case CENTER:
857
- ctx.textBaseline = 'middle';
858
- break;
859
- case 'ascender':
860
- ctx.textBaseline = TOP;
861
- break;
862
- case 'descender':
863
- ctx.textBaseline = BOTTOM;
864
- break;
865
- }
866
- }
867
- ctx.font = this._getFontDeclaration(charStyle, forMeasuring);
868
- }
869
-
870
- /**
871
- * calculate and return the text Width measuring each line.
872
- * @private
873
- * @param {CanvasRenderingContext2D} ctx Context to render on
874
- * @return {Number} Maximum width of Text object
875
- */
876
- calcTextWidth(): number {
877
- let maxWidth = this.getLineWidth(0);
878
-
879
- for (let i = 1, len = this._textLines.length; i < len; i++) {
880
- const currentLineWidth = this.getLineWidth(i);
881
- if (currentLineWidth > maxWidth) {
882
- maxWidth = currentLineWidth;
883
- }
884
- }
885
- return maxWidth;
886
- }
887
-
888
- /**
889
- * @private
890
- * @param {String} method Method name ("fillText" or "strokeText")
891
- * @param {CanvasRenderingContext2D} ctx Context to render on
892
- * @param {String} line Text to render
893
- * @param {Number} left Left position of text
894
- * @param {Number} top Top position of text
895
- * @param {Number} lineIndex Index of a line in a text
896
- */
897
- _renderTextLine(
898
- method: 'fillText' | 'strokeText',
899
- ctx: CanvasRenderingContext2D,
900
- line: string[],
901
- left: number,
902
- top: number,
903
- lineIndex: number,
904
- ) {
905
- this._renderChars(method, ctx, line, left, top, lineIndex);
906
- }
907
-
908
- /**
909
- * Renders the text background for lines, taking care of style
910
- * @private
911
- * @param {CanvasRenderingContext2D} ctx Context to render on
912
- */
913
- _renderTextLinesBackground(ctx: CanvasRenderingContext2D) {
914
- if (!this.textBackgroundColor && !this.styleHas('textBackgroundColor')) {
915
- return;
916
- }
917
- const originalFill = ctx.fillStyle,
918
- leftOffset = this._getLeftOffset();
919
- let lineTopOffset = this._getTopOffset();
920
-
921
- for (let i = 0, len = this._textLines.length; i < len; i++) {
922
- const heightOfLine = this.getHeightOfLine(i);
923
- if (
924
- !this.textBackgroundColor &&
925
- !this.styleHas('textBackgroundColor', i)
926
- ) {
927
- lineTopOffset += heightOfLine;
928
- continue;
929
- }
930
- const jlen = this._textLines[i].length;
931
- const lineLeftOffset = this._getLineLeftOffset(i);
932
- let boxWidth = 0;
933
- let boxStart = 0;
934
- let drawStart;
935
- let currentColor;
936
- let lastColor = this.getValueOfPropertyAt(i, 0, 'textBackgroundColor');
937
- for (let j = 0; j < jlen; j++) {
938
- // at this point charbox are either standard or full with pathInfo if there is a path.
939
- const charBox = this.__charBounds[i][j] as Required<GraphemeBBox>;
940
- currentColor = this.getValueOfPropertyAt(i, j, 'textBackgroundColor');
941
- if (this.path) {
942
- ctx.save();
943
- ctx.translate(charBox.renderLeft, charBox.renderTop);
944
- ctx.rotate(charBox.angle);
945
- ctx.fillStyle = currentColor;
946
- currentColor &&
947
- ctx.fillRect(
948
- -charBox.width / 2,
949
- (-heightOfLine / this.lineHeight) * (1 - this._fontSizeFraction),
950
- charBox.width,
951
- heightOfLine / this.lineHeight,
952
- );
953
- ctx.restore();
954
- } else if (currentColor !== lastColor) {
955
- drawStart = leftOffset + lineLeftOffset + boxStart;
956
- if (this.direction === 'rtl') {
957
- drawStart = this.width - drawStart - boxWidth;
958
- }
959
- ctx.fillStyle = lastColor;
960
- lastColor &&
961
- ctx.fillRect(
962
- drawStart,
963
- lineTopOffset,
964
- boxWidth,
965
- heightOfLine / this.lineHeight,
966
- );
967
- boxStart = charBox.left;
968
- boxWidth = charBox.width;
969
- lastColor = currentColor;
970
- } else {
971
- boxWidth += charBox.kernedWidth;
972
- }
973
- }
974
- if (currentColor && !this.path) {
975
- drawStart = leftOffset + lineLeftOffset + boxStart;
976
- if (this.direction === 'rtl') {
977
- drawStart = this.width - drawStart - boxWidth;
978
- }
979
- ctx.fillStyle = currentColor;
980
- ctx.fillRect(
981
- drawStart,
982
- lineTopOffset,
983
- boxWidth,
984
- heightOfLine / this.lineHeight,
985
- );
986
- }
987
- lineTopOffset += heightOfLine;
988
- }
989
- ctx.fillStyle = originalFill;
990
- // if there is text background color no
991
- // other shadows should be casted
992
- this._removeShadow(ctx);
993
- }
994
-
995
- /**
996
- * measure and return the width of a single character.
997
- * possibly overridden to accommodate different measure logic or
998
- * to hook some external lib for character measurement
999
- * @private
1000
- * @param {String} _char, char to be measured
1001
- * @param {Object} charStyle style of char to be measured
1002
- * @param {String} [previousChar] previous char
1003
- * @param {Object} [prevCharStyle] style of previous char
1004
- */
1005
- _measureChar(
1006
- _char: string,
1007
- charStyle: CompleteTextStyleDeclaration,
1008
- previousChar: string | undefined,
1009
- prevCharStyle: CompleteTextStyleDeclaration | Record<string, never>,
1010
- ) {
1011
- const fontCache = cache.getFontCache(charStyle),
1012
- fontDeclaration = this._getFontDeclaration(charStyle),
1013
- couple = previousChar + _char,
1014
- stylesAreEqual =
1015
- previousChar &&
1016
- fontDeclaration === this._getFontDeclaration(prevCharStyle),
1017
- fontMultiplier = charStyle.fontSize / this.CACHE_FONT_SIZE;
1018
- let width: number | undefined,
1019
- coupleWidth: number | undefined,
1020
- previousWidth: number | undefined,
1021
- kernedWidth: number | undefined;
1022
-
1023
- if (previousChar && fontCache[previousChar] !== undefined) {
1024
- previousWidth = fontCache[previousChar];
1025
- }
1026
- if (fontCache[_char] !== undefined) {
1027
- kernedWidth = width = fontCache[_char];
1028
- }
1029
- if (stylesAreEqual && fontCache[couple] !== undefined) {
1030
- coupleWidth = fontCache[couple];
1031
- kernedWidth = coupleWidth - previousWidth!;
1032
- }
1033
- if (
1034
- width === undefined ||
1035
- previousWidth === undefined ||
1036
- coupleWidth === undefined
1037
- ) {
1038
- const ctx = getMeasuringContext()!;
1039
- // send a TRUE to specify measuring font size CACHE_FONT_SIZE
1040
- this._setTextStyles(ctx, charStyle, true);
1041
- if (width === undefined) {
1042
- kernedWidth = width = ctx.measureText(_char).width;
1043
- fontCache[_char] = width;
1044
- }
1045
- if (previousWidth === undefined && stylesAreEqual && previousChar) {
1046
- previousWidth = ctx.measureText(previousChar).width;
1047
- fontCache[previousChar] = previousWidth;
1048
- }
1049
- if (stylesAreEqual && coupleWidth === undefined) {
1050
- // we can measure the kerning couple and subtract the width of the previous character
1051
- coupleWidth = ctx.measureText(couple).width;
1052
- fontCache[couple] = coupleWidth;
1053
- // safe to use the non-null since if undefined we defined it before.
1054
- kernedWidth = coupleWidth - previousWidth!;
1055
- }
1056
- }
1057
- return {
1058
- width: width * fontMultiplier,
1059
- kernedWidth: kernedWidth! * fontMultiplier,
1060
- };
1061
- }
1062
-
1063
- /**
1064
- * Computes height of character at given position
1065
- * @param {Number} line the line index number
1066
- * @param {Number} _char the character index number
1067
- * @return {Number} fontSize of the character
1068
- */
1069
- getHeightOfChar(line: number, _char: number): number {
1070
- return this.getValueOfPropertyAt(line, _char, 'fontSize');
1071
- }
1072
-
1073
- /**
1074
- * measure a text line measuring all characters.
1075
- * @param {Number} lineIndex line number
1076
- */
1077
- measureLine(lineIndex: number) {
1078
- const lineInfo = this._measureLine(lineIndex);
1079
- if (this.charSpacing !== 0) {
1080
- lineInfo.width -= this._getWidthOfCharSpacing();
1081
- }
1082
- if (lineInfo.width < 0) {
1083
- lineInfo.width = 0;
1084
- }
1085
- return lineInfo;
1086
- }
1087
-
1088
- /**
1089
- * measure every grapheme of a line, populating __charBounds
1090
- * @param {Number} lineIndex
1091
- * @return {Object} object.width total width of characters
1092
- * @return {Object} object.numOfSpaces length of chars that match this._reSpacesAndTabs
1093
- */
1094
- _measureLine(lineIndex: number) {
1095
- let width = 0,
1096
- prevGrapheme: string | undefined,
1097
- graphemeInfo: GraphemeBBox | undefined;
1098
-
1099
- const reverse = this.pathSide === RIGHT,
1100
- path = this.path,
1101
- line = this._textLines[lineIndex],
1102
- llength = line.length,
1103
- lineBounds = new Array<GraphemeBBox>(llength);
1104
-
1105
- this.__charBounds[lineIndex] = lineBounds;
1106
- for (let i = 0; i < llength; i++) {
1107
- const grapheme = line[i];
1108
- graphemeInfo = this._getGraphemeBox(grapheme, lineIndex, i, prevGrapheme);
1109
- lineBounds[i] = graphemeInfo;
1110
- width += graphemeInfo.kernedWidth;
1111
- prevGrapheme = grapheme;
1112
- }
1113
- // this latest bound box represent the last character of the line
1114
- // to simplify cursor handling in interactive mode.
1115
- lineBounds[llength] = {
1116
- left: graphemeInfo ? graphemeInfo.left + graphemeInfo.width : 0,
1117
- width: 0,
1118
- kernedWidth: 0,
1119
- height: this.fontSize,
1120
- deltaY: 0,
1121
- } as GraphemeBBox;
1122
- if (path && path.segmentsInfo) {
1123
- let positionInPath = 0;
1124
- const totalPathLength =
1125
- path.segmentsInfo[path.segmentsInfo.length - 1].length;
1126
- switch (this.textAlign) {
1127
- case LEFT:
1128
- positionInPath = reverse ? totalPathLength - width : 0;
1129
- break;
1130
- case CENTER:
1131
- positionInPath = (totalPathLength - width) / 2;
1132
- break;
1133
- case RIGHT:
1134
- positionInPath = reverse ? 0 : totalPathLength - width;
1135
- break;
1136
- //todo - add support for justify
1137
- }
1138
- positionInPath += this.pathStartOffset * (reverse ? -1 : 1);
1139
- for (
1140
- let i = reverse ? llength - 1 : 0;
1141
- reverse ? i >= 0 : i < llength;
1142
- reverse ? i-- : i++
1143
- ) {
1144
- graphemeInfo = lineBounds[i];
1145
- if (positionInPath > totalPathLength) {
1146
- positionInPath %= totalPathLength;
1147
- } else if (positionInPath < 0) {
1148
- positionInPath += totalPathLength;
1149
- }
1150
- // it would probably much faster to send all the grapheme position for a line
1151
- // and calculate path position/angle at once.
1152
- this._setGraphemeOnPath(positionInPath, graphemeInfo);
1153
- positionInPath += graphemeInfo.kernedWidth;
1154
- }
1155
- }
1156
- return { width: width, numOfSpaces: 0 };
1157
- }
1158
-
1159
- /**
1160
- * Calculate the angle and the left,top position of the char that follow a path.
1161
- * It appends it to graphemeInfo to be reused later at rendering
1162
- * @private
1163
- * @param {Number} positionInPath to be measured
1164
- * @param {GraphemeBBox} graphemeInfo current grapheme box information
1165
- * @param {Object} startingPoint position of the point
1166
- */
1167
- _setGraphemeOnPath(positionInPath: number, graphemeInfo: GraphemeBBox) {
1168
- const centerPosition = positionInPath + graphemeInfo.kernedWidth / 2,
1169
- path = this.path!;
1170
-
1171
- // we are at currentPositionOnPath. we want to know what point on the path is.
1172
- const info = getPointOnPath(path.path, centerPosition, path.segmentsInfo)!;
1173
- graphemeInfo.renderLeft = info.x - path.pathOffset.x;
1174
- graphemeInfo.renderTop = info.y - path.pathOffset.y;
1175
- graphemeInfo.angle = info.angle + (this.pathSide === RIGHT ? Math.PI : 0);
1176
- }
1177
-
1178
- /**
1179
- *
1180
- * @param {String} grapheme to be measured
1181
- * @param {Number} lineIndex index of the line where the char is
1182
- * @param {Number} charIndex position in the line
1183
- * @param {String} [prevGrapheme] character preceding the one to be measured
1184
- * @returns {GraphemeBBox} grapheme bbox
1185
- */
1186
- _getGraphemeBox(
1187
- grapheme: string,
1188
- lineIndex: number,
1189
- charIndex: number,
1190
- prevGrapheme?: string,
1191
- skipLeft?: boolean,
1192
- ): GraphemeBBox {
1193
- const style = this.getCompleteStyleDeclaration(lineIndex, charIndex),
1194
- prevStyle = prevGrapheme
1195
- ? this.getCompleteStyleDeclaration(lineIndex, charIndex - 1)
1196
- : {},
1197
- info = this._measureChar(grapheme, style, prevGrapheme, prevStyle);
1198
- let kernedWidth = info.kernedWidth,
1199
- width = info.width,
1200
- charSpacing;
1201
-
1202
- if (this.charSpacing !== 0) {
1203
- charSpacing = this._getWidthOfCharSpacing();
1204
- width += charSpacing;
1205
- kernedWidth += charSpacing;
1206
- }
1207
-
1208
- const box: GraphemeBBox = {
1209
- width,
1210
- left: 0,
1211
- height: style.fontSize,
1212
- kernedWidth,
1213
- deltaY: style.deltaY,
1214
- };
1215
- if (charIndex > 0 && !skipLeft) {
1216
- const previousBox = this.__charBounds[lineIndex][charIndex - 1];
1217
- box.left =
1218
- previousBox.left + previousBox.width + info.kernedWidth - info.width;
1219
- }
1220
- return box;
1221
- }
1222
-
1223
- /**
1224
- * Calculate height of line at 'lineIndex'
1225
- * @param {Number} lineIndex index of line to calculate
1226
- * @return {Number}
1227
- */
1228
- getHeightOfLine(lineIndex: number): number {
1229
- if (this.__lineHeights[lineIndex]) {
1230
- return this.__lineHeights[lineIndex];
1231
- }
1232
-
1233
- // char 0 is measured before the line cycle because it needs to char
1234
- // emptylines
1235
- let maxHeight = this.getHeightOfChar(lineIndex, 0);
1236
- for (let i = 1, len = this._textLines[lineIndex].length; i < len; i++) {
1237
- maxHeight = Math.max(this.getHeightOfChar(lineIndex, i), maxHeight);
1238
- }
1239
-
1240
- return (this.__lineHeights[lineIndex] =
1241
- maxHeight * this.lineHeight * this._fontSizeMult);
1242
- }
1243
-
1244
- /**
1245
- * Calculate text box height
1246
- */
1247
- calcTextHeight() {
1248
- let lineHeight,
1249
- height = 0;
1250
- for (let i = 0, len = this._textLines.length; i < len; i++) {
1251
- lineHeight = this.getHeightOfLine(i);
1252
- height += i === len - 1 ? lineHeight / this.lineHeight : lineHeight;
1253
- }
1254
- return height;
1255
- }
1256
-
1257
- /**
1258
- * @private
1259
- * @return {Number} Left offset
1260
- */
1261
- _getLeftOffset(): number {
1262
- return this.direction === 'ltr' ? -this.width / 2 : this.width / 2;
1263
- }
1264
-
1265
- /**
1266
- * @private
1267
- * @return {Number} Top offset
1268
- */
1269
- _getTopOffset(): number {
1270
- return -this.height / 2;
1271
- }
1272
-
1273
- /**
1274
- * @private
1275
- * @param {CanvasRenderingContext2D} ctx Context to render on
1276
- * @param {String} method Method name ("fillText" or "strokeText")
1277
- */
1278
- _renderTextCommon(
1279
- ctx: CanvasRenderingContext2D,
1280
- method: 'fillText' | 'strokeText',
1281
- ) {
1282
- ctx.save();
1283
- let lineHeights = 0;
1284
- const left = this._getLeftOffset(),
1285
- top = this._getTopOffset();
1286
- for (let i = 0, len = this._textLines.length; i < len; i++) {
1287
- const heightOfLine = this.getHeightOfLine(i),
1288
- maxHeight = heightOfLine / this.lineHeight,
1289
- leftOffset = this._getLineLeftOffset(i);
1290
- this._renderTextLine(
1291
- method,
1292
- ctx,
1293
- this._textLines[i],
1294
- left + leftOffset,
1295
- top + lineHeights + maxHeight,
1296
- i,
1297
- );
1298
- lineHeights += heightOfLine;
1299
- }
1300
- ctx.restore();
1301
- }
1302
-
1303
- /**
1304
- * @private
1305
- * @param {CanvasRenderingContext2D} ctx Context to render on
1306
- */
1307
- _renderTextFill(ctx: CanvasRenderingContext2D) {
1308
- if (!this.fill && !this.styleHas(FILL)) {
1309
- return;
1310
- }
1311
-
1312
- this._renderTextCommon(ctx, 'fillText');
1313
- }
1314
-
1315
- /**
1316
- * @private
1317
- * @param {CanvasRenderingContext2D} ctx Context to render on
1318
- */
1319
- _renderTextStroke(ctx: CanvasRenderingContext2D) {
1320
- if ((!this.stroke || this.strokeWidth === 0) && this.isEmptyStyles()) {
1321
- return;
1322
- }
1323
-
1324
- if (this.shadow && !this.shadow.affectStroke) {
1325
- this._removeShadow(ctx);
1326
- }
1327
-
1328
- ctx.save();
1329
- this._setLineDash(ctx, this.strokeDashArray);
1330
- ctx.beginPath();
1331
- this._renderTextCommon(ctx, 'strokeText');
1332
- ctx.closePath();
1333
- ctx.restore();
1334
- }
1335
-
1336
- /**
1337
- * @private
1338
- * @param {String} method fillText or strokeText.
1339
- * @param {CanvasRenderingContext2D} ctx Context to render on
1340
- * @param {Array} line Content of the line, splitted in an array by grapheme
1341
- * @param {Number} left
1342
- * @param {Number} top
1343
- * @param {Number} lineIndex
1344
- */
1345
- _renderChars(
1346
- method: 'fillText' | 'strokeText',
1347
- ctx: CanvasRenderingContext2D,
1348
- line: Array<any>,
1349
- left: number,
1350
- top: number,
1351
- lineIndex: number,
1352
- ) {
1353
- const lineHeight = this.getHeightOfLine(lineIndex),
1354
- isJustify = this.textAlign.includes(JUSTIFY),
1355
- path = this.path,
1356
- shortCut =
1357
- !isJustify &&
1358
- this.charSpacing === 0 &&
1359
- this.isEmptyStyles(lineIndex) &&
1360
- !path,
1361
- isLtr = this.direction === 'ltr',
1362
- sign = this.direction === 'ltr' ? 1 : -1,
1363
- // this was changed in the PR #7674
1364
- // currentDirection = ctx.canvas.getAttribute('dir');
1365
- currentDirection = ctx.direction;
1366
-
1367
- let actualStyle,
1368
- nextStyle,
1369
- charsToRender = '',
1370
- charBox,
1371
- boxWidth = 0,
1372
- timeToRender,
1373
- drawingLeft;
1374
-
1375
- ctx.save();
1376
- if (currentDirection !== this.direction) {
1377
- ctx.canvas.setAttribute('dir', isLtr ? 'ltr' : 'rtl');
1378
- ctx.direction = isLtr ? 'ltr' : 'rtl';
1379
- ctx.textAlign = isLtr ? LEFT : RIGHT;
1380
- }
1381
- top -= (lineHeight * this._fontSizeFraction) / this.lineHeight;
1382
- if (shortCut) {
1383
- // render all the line in one pass without checking
1384
- // drawingLeft = isLtr ? left : left - this.getLineWidth(lineIndex);
1385
- this._renderChar(method, ctx, lineIndex, 0, line.join(''), left, top);
1386
- ctx.restore();
1387
- return;
1388
- }
1389
- for (let i = 0, len = line.length - 1; i <= len; i++) {
1390
- timeToRender = i === len || this.charSpacing || path;
1391
- charsToRender += line[i];
1392
- charBox = this.__charBounds[lineIndex][i] as Required<GraphemeBBox>;
1393
- if (boxWidth === 0) {
1394
- left += sign * (charBox.kernedWidth - charBox.width);
1395
- boxWidth += charBox.width;
1396
- } else {
1397
- boxWidth += charBox.kernedWidth;
1398
- }
1399
- if (isJustify && !timeToRender) {
1400
- if (this._reSpaceAndTab.test(line[i])) {
1401
- timeToRender = true;
1402
- }
1403
- }
1404
- if (!timeToRender) {
1405
- // if we have charSpacing, we render char by char
1406
- actualStyle =
1407
- actualStyle || this.getCompleteStyleDeclaration(lineIndex, i);
1408
- nextStyle = this.getCompleteStyleDeclaration(lineIndex, i + 1);
1409
- timeToRender = hasStyleChanged(actualStyle, nextStyle, false);
1410
- }
1411
- if (timeToRender) {
1412
- if (path) {
1413
- ctx.save();
1414
- ctx.translate(charBox.renderLeft, charBox.renderTop);
1415
- ctx.rotate(charBox.angle);
1416
- this._renderChar(
1417
- method,
1418
- ctx,
1419
- lineIndex,
1420
- i,
1421
- charsToRender,
1422
- -boxWidth / 2,
1423
- 0,
1424
- );
1425
- ctx.restore();
1426
- } else {
1427
- drawingLeft = left;
1428
- this._renderChar(
1429
- method,
1430
- ctx,
1431
- lineIndex,
1432
- i,
1433
- charsToRender,
1434
- drawingLeft,
1435
- top,
1436
- );
1437
- }
1438
- charsToRender = '';
1439
- actualStyle = nextStyle;
1440
- left += sign * boxWidth;
1441
- boxWidth = 0;
1442
- }
1443
- }
1444
- ctx.restore();
1445
- }
1446
-
1447
- /**
1448
- * This function try to patch the missing gradientTransform on canvas gradients.
1449
- * transforming a context to transform the gradient, is going to transform the stroke too.
1450
- * we want to transform the gradient but not the stroke operation, so we create
1451
- * a transformed gradient on a pattern and then we use the pattern instead of the gradient.
1452
- * this method has drawbacks: is slow, is in low resolution, needs a patch for when the size
1453
- * is limited.
1454
- * @private
1455
- * @param {TFiller} filler a fabric gradient instance
1456
- * @return {CanvasPattern} a pattern to use as fill/stroke style
1457
- */
1458
- _applyPatternGradientTransformText(filler: TFiller) {
1459
- // TODO: verify compatibility with strokeUniform
1460
- const width = this.width + this.strokeWidth,
1461
- height = this.height + this.strokeWidth,
1462
- pCanvas = createCanvasElementFor({
1463
- width,
1464
- height,
1465
- }),
1466
- pCtx = pCanvas.getContext('2d')!;
1467
- pCanvas.width = width;
1468
- pCanvas.height = height;
1469
- pCtx.beginPath();
1470
- pCtx.moveTo(0, 0);
1471
- pCtx.lineTo(width, 0);
1472
- pCtx.lineTo(width, height);
1473
- pCtx.lineTo(0, height);
1474
- pCtx.closePath();
1475
- pCtx.translate(width / 2, height / 2);
1476
- pCtx.fillStyle = filler.toLive(pCtx)!;
1477
- this._applyPatternGradientTransform(pCtx, filler);
1478
- pCtx.fill();
1479
- return pCtx.createPattern(pCanvas, 'no-repeat')!;
1480
- }
1481
-
1482
- handleFiller<T extends 'fill' | 'stroke'>(
1483
- ctx: CanvasRenderingContext2D,
1484
- property: `${T}Style`,
1485
- filler: TFiller | string,
1486
- ): { offsetX: number; offsetY: number } {
1487
- let offsetX: number, offsetY: number;
1488
- if (isFiller(filler)) {
1489
- if (
1490
- (filler as Gradient<'linear'>).gradientUnits === 'percentage' ||
1491
- (filler as Gradient<'linear'>).gradientTransform ||
1492
- (filler as Pattern).patternTransform
1493
- ) {
1494
- // need to transform gradient in a pattern.
1495
- // this is a slow process. If you are hitting this codepath, and the object
1496
- // is not using caching, you should consider switching it on.
1497
- // we need a canvas as big as the current object caching canvas.
1498
- offsetX = -this.width / 2;
1499
- offsetY = -this.height / 2;
1500
- ctx.translate(offsetX, offsetY);
1501
- ctx[property] = this._applyPatternGradientTransformText(filler);
1502
- return { offsetX, offsetY };
1503
- } else {
1504
- // is a simple gradient or pattern
1505
- ctx[property] = filler.toLive(ctx)!;
1506
- return this._applyPatternGradientTransform(ctx, filler);
1507
- }
1508
- } else {
1509
- // is a color
1510
- ctx[property] = filler;
1511
- }
1512
- return { offsetX: 0, offsetY: 0 };
1513
- }
1514
-
1515
- /**
1516
- * This function prepare the canvas for a stroke style, and stroke and strokeWidth
1517
- * need to be sent in as defined
1518
- * @param {CanvasRenderingContext2D} ctx
1519
- * @param {CompleteTextStyleDeclaration} style with stroke and strokeWidth defined
1520
- * @returns
1521
- */
1522
- _setStrokeStyles(
1523
- ctx: CanvasRenderingContext2D,
1524
- {
1525
- stroke,
1526
- strokeWidth,
1527
- }: Pick<CompleteTextStyleDeclaration, 'stroke' | 'strokeWidth'>,
1528
- ) {
1529
- ctx.lineWidth = strokeWidth;
1530
- ctx.lineCap = this.strokeLineCap;
1531
- ctx.lineDashOffset = this.strokeDashOffset;
1532
- ctx.lineJoin = this.strokeLineJoin;
1533
- ctx.miterLimit = this.strokeMiterLimit;
1534
- return this.handleFiller(ctx, 'strokeStyle', stroke!);
1535
- }
1536
-
1537
- /**
1538
- * This function prepare the canvas for a ill style, and fill
1539
- * need to be sent in as defined
1540
- * @param {CanvasRenderingContext2D} ctx
1541
- * @param {CompleteTextStyleDeclaration} style with ill defined
1542
- * @returns
1543
- */
1544
- _setFillStyles(ctx: CanvasRenderingContext2D, { fill }: Pick<this, 'fill'>) {
1545
- return this.handleFiller(ctx, 'fillStyle', fill!);
1546
- }
1547
-
1548
- /**
1549
- * @private
1550
- * @param {String} method
1551
- * @param {CanvasRenderingContext2D} ctx Context to render on
1552
- * @param {Number} lineIndex
1553
- * @param {Number} charIndex
1554
- * @param {String} _char
1555
- * @param {Number} left Left coordinate
1556
- * @param {Number} top Top coordinate
1557
- * @param {Number} lineHeight Height of the line
1558
- */
1559
- _renderChar(
1560
- method: 'fillText' | 'strokeText',
1561
- ctx: CanvasRenderingContext2D,
1562
- lineIndex: number,
1563
- charIndex: number,
1564
- _char: string,
1565
- left: number,
1566
- top: number,
1567
- ) {
1568
- const decl = this._getStyleDeclaration(lineIndex, charIndex),
1569
- fullDecl = this.getCompleteStyleDeclaration(lineIndex, charIndex),
1570
- shouldFill = method === 'fillText' && fullDecl.fill,
1571
- shouldStroke =
1572
- method === 'strokeText' && fullDecl.stroke && fullDecl.strokeWidth;
1573
-
1574
- if (!shouldStroke && !shouldFill) {
1575
- return;
1576
- }
1577
- ctx.save();
1578
-
1579
- ctx.font = this._getFontDeclaration(fullDecl);
1580
-
1581
- if (decl.textBackgroundColor) {
1582
- this._removeShadow(ctx);
1583
- }
1584
- if (decl.deltaY) {
1585
- top += decl.deltaY;
1586
- }
1587
-
1588
- if (shouldFill) {
1589
- const fillOffsets = this._setFillStyles(ctx, fullDecl);
1590
- ctx.fillText(
1591
- _char,
1592
- left - fillOffsets.offsetX,
1593
- top - fillOffsets.offsetY,
1594
- );
1595
- }
1596
-
1597
- if (shouldStroke) {
1598
- const strokeOffsets = this._setStrokeStyles(ctx, fullDecl);
1599
- ctx.strokeText(
1600
- _char,
1601
- left - strokeOffsets.offsetX,
1602
- top - strokeOffsets.offsetY,
1603
- );
1604
- }
1605
-
1606
- ctx.restore();
1607
- }
1608
-
1609
- /**
1610
- * Turns the character into a 'superior figure' (i.e. 'superscript')
1611
- * @param {Number} start selection start
1612
- * @param {Number} end selection end
1613
- */
1614
- setSuperscript(start: number, end: number) {
1615
- this._setScript(start, end, this.superscript);
1616
- }
1617
-
1618
- /**
1619
- * Turns the character into an 'inferior figure' (i.e. 'subscript')
1620
- * @param {Number} start selection start
1621
- * @param {Number} end selection end
1622
- */
1623
- setSubscript(start: number, end: number) {
1624
- this._setScript(start, end, this.subscript);
1625
- }
1626
-
1627
- /**
1628
- * Applies 'schema' at given position
1629
- * @private
1630
- * @param {Number} start selection start
1631
- * @param {Number} end selection end
1632
- * @param {Number} schema
1633
- */
1634
- protected _setScript(
1635
- start: number,
1636
- end: number,
1637
- schema: {
1638
- size: number;
1639
- baseline: number;
1640
- },
1641
- ) {
1642
- const loc = this.get2DCursorLocation(start, true),
1643
- fontSize = this.getValueOfPropertyAt(
1644
- loc.lineIndex,
1645
- loc.charIndex,
1646
- 'fontSize',
1647
- ),
1648
- dy = this.getValueOfPropertyAt(loc.lineIndex, loc.charIndex, 'deltaY'),
1649
- style = {
1650
- fontSize: fontSize * schema.size,
1651
- deltaY: dy + fontSize * schema.baseline,
1652
- };
1653
- this.setSelectionStyles(style, start, end);
1654
- }
1655
-
1656
- /**
1657
- * @private
1658
- * @param {Number} lineIndex index text line
1659
- * @return {Number} Line left offset
1660
- */
1661
- _getLineLeftOffset(lineIndex: number): number {
1662
- const lineWidth = this.getLineWidth(lineIndex),
1663
- lineDiff = this.width - lineWidth,
1664
- textAlign = this.textAlign,
1665
- direction = this.direction,
1666
- isEndOfWrapping = this.isEndOfWrapping(lineIndex);
1667
- let leftOffset = 0;
1668
- if (
1669
- textAlign === JUSTIFY ||
1670
- (textAlign === JUSTIFY_CENTER && !isEndOfWrapping) ||
1671
- (textAlign === JUSTIFY_RIGHT && !isEndOfWrapping) ||
1672
- (textAlign === JUSTIFY_LEFT && !isEndOfWrapping)
1673
- ) {
1674
- return 0;
1675
- }
1676
- if (textAlign === CENTER) {
1677
- leftOffset = lineDiff / 2;
1678
- }
1679
- if (textAlign === RIGHT) {
1680
- leftOffset = lineDiff;
1681
- }
1682
- if (textAlign === JUSTIFY_CENTER) {
1683
- leftOffset = lineDiff / 2;
1684
- }
1685
- if (textAlign === JUSTIFY_RIGHT) {
1686
- leftOffset = lineDiff;
1687
- }
1688
- if (direction === 'rtl') {
1689
- if (
1690
- textAlign === RIGHT ||
1691
- textAlign === JUSTIFY ||
1692
- textAlign === JUSTIFY_RIGHT
1693
- ) {
1694
- leftOffset = 0;
1695
- } else if (textAlign === LEFT || textAlign === JUSTIFY_LEFT) {
1696
- leftOffset = -lineDiff;
1697
- } else if (textAlign === CENTER || textAlign === JUSTIFY_CENTER) {
1698
- leftOffset = -lineDiff / 2;
1699
- }
1700
- }
1701
- return leftOffset;
1702
- }
1703
-
1704
- /**
1705
- * @private
1706
- */
1707
- _clearCache() {
1708
- this._forceClearCache = false;
1709
- this.__lineWidths = [];
1710
- this.__lineHeights = [];
1711
- this.__charBounds = [];
1712
- }
1713
-
1714
- /**
1715
- * Measure a single line given its index. Used to calculate the initial
1716
- * text bounding box. The values are calculated and stored in __lineWidths cache.
1717
- * @private
1718
- * @param {Number} lineIndex line number
1719
- * @return {Number} Line width
1720
- */
1721
- getLineWidth(lineIndex: number): number {
1722
- if (this.__lineWidths[lineIndex] !== undefined) {
1723
- return this.__lineWidths[lineIndex];
1724
- }
1725
-
1726
- const { width } = this.measureLine(lineIndex);
1727
- this.__lineWidths[lineIndex] = width;
1728
- return width;
1729
- }
1730
-
1731
- _getWidthOfCharSpacing() {
1732
- if (this.charSpacing !== 0) {
1733
- return (this.fontSize * this.charSpacing) / 1000;
1734
- }
1735
- return 0;
1736
- }
1737
-
1738
- /**
1739
- * Retrieves the value of property at given character position
1740
- * @param {Number} lineIndex the line number
1741
- * @param {Number} charIndex the character number
1742
- * @param {String} property the property name
1743
- * @returns the value of 'property'
1744
- */
1745
- getValueOfPropertyAt<T extends StylePropertiesType>(
1746
- lineIndex: number,
1747
- charIndex: number,
1748
- property: T,
1749
- ): this[T] {
1750
- const charStyle = this._getStyleDeclaration(lineIndex, charIndex);
1751
- return (charStyle[property] ?? this[property]) as this[T];
1752
- }
1753
-
1754
- /**
1755
- * @private
1756
- * @param {CanvasRenderingContext2D} ctx Context to render on
1757
- */
1758
- _renderTextDecoration(
1759
- ctx: CanvasRenderingContext2D,
1760
- type: 'underline' | 'linethrough' | 'overline',
1761
- ) {
1762
- if (!this[type] && !this.styleHas(type)) {
1763
- return;
1764
- }
1765
- let topOffset = this._getTopOffset();
1766
- const leftOffset = this._getLeftOffset(),
1767
- path = this.path,
1768
- charSpacing = this._getWidthOfCharSpacing(),
1769
- offsetAligner =
1770
- type === 'linethrough' ? 0.5 : type === 'overline' ? 1 : 0,
1771
- offsetY = this.offsets[type];
1772
- for (let i = 0, len = this._textLines.length; i < len; i++) {
1773
- const heightOfLine = this.getHeightOfLine(i);
1774
- if (!this[type] && !this.styleHas(type, i)) {
1775
- topOffset += heightOfLine;
1776
- continue;
1777
- }
1778
- const line = this._textLines[i];
1779
- const maxHeight = heightOfLine / this.lineHeight;
1780
- const lineLeftOffset = this._getLineLeftOffset(i);
1781
- let boxStart = 0;
1782
- let boxWidth = 0;
1783
- let lastDecoration = this.getValueOfPropertyAt(i, 0, type);
1784
- let lastFill = this.getValueOfPropertyAt(i, 0, FILL);
1785
- let lastTickness = this.getValueOfPropertyAt(
1786
- i,
1787
- 0,
1788
- TEXT_DECORATION_THICKNESS,
1789
- );
1790
- let currentDecoration = lastDecoration;
1791
- let currentFill = lastFill;
1792
- let currentTickness = lastTickness;
1793
- const top = topOffset + maxHeight * (1 - this._fontSizeFraction);
1794
- let size = this.getHeightOfChar(i, 0);
1795
- let dy = this.getValueOfPropertyAt(i, 0, 'deltaY');
1796
- for (let j = 0, jlen = line.length; j < jlen; j++) {
1797
- const charBox = this.__charBounds[i][j] as Required<GraphemeBBox>;
1798
- currentDecoration = this.getValueOfPropertyAt(i, j, type);
1799
- currentFill = this.getValueOfPropertyAt(i, j, FILL);
1800
- currentTickness = this.getValueOfPropertyAt(
1801
- i,
1802
- j,
1803
- TEXT_DECORATION_THICKNESS,
1804
- );
1805
- const currentSize = this.getHeightOfChar(i, j);
1806
- const currentDy = this.getValueOfPropertyAt(i, j, 'deltaY');
1807
- if (path && currentDecoration && currentFill) {
1808
- const finalTickness = (this.fontSize * currentTickness) / 1000;
1809
- ctx.save();
1810
- // bug? verify lastFill is a valid fill here.
1811
- ctx.fillStyle = lastFill as string;
1812
- ctx.translate(charBox.renderLeft, charBox.renderTop);
1813
- ctx.rotate(charBox.angle);
1814
- ctx.fillRect(
1815
- -charBox.kernedWidth / 2,
1816
- offsetY * currentSize + currentDy - offsetAligner * finalTickness,
1817
- charBox.kernedWidth,
1818
- finalTickness,
1819
- );
1820
- ctx.restore();
1821
- } else if (
1822
- (currentDecoration !== lastDecoration ||
1823
- currentFill !== lastFill ||
1824
- currentSize !== size ||
1825
- currentTickness !== lastTickness ||
1826
- currentDy !== dy) &&
1827
- boxWidth > 0
1828
- ) {
1829
- const finalTickness = (this.fontSize * lastTickness) / 1000;
1830
- let drawStart = leftOffset + lineLeftOffset + boxStart;
1831
- if (this.direction === 'rtl') {
1832
- drawStart = this.width - drawStart - boxWidth;
1833
- }
1834
- if (lastDecoration && lastFill && lastTickness) {
1835
- // bug? verify lastFill is a valid fill here.
1836
- ctx.fillStyle = lastFill as string;
1837
- ctx.fillRect(
1838
- drawStart,
1839
- top + offsetY * size + dy - offsetAligner * finalTickness,
1840
- boxWidth,
1841
- finalTickness,
1842
- );
1843
- }
1844
- boxStart = charBox.left;
1845
- boxWidth = charBox.width;
1846
- lastDecoration = currentDecoration;
1847
- lastTickness = currentTickness;
1848
- lastFill = currentFill;
1849
- size = currentSize;
1850
- dy = currentDy;
1851
- } else {
1852
- boxWidth += charBox.kernedWidth;
1853
- }
1854
- }
1855
- let drawStart = leftOffset + lineLeftOffset + boxStart;
1856
- if (this.direction === 'rtl') {
1857
- drawStart = this.width - drawStart - boxWidth;
1858
- }
1859
- ctx.fillStyle = currentFill as string;
1860
- const finalTickness = (this.fontSize * currentTickness) / 1000;
1861
- currentDecoration &&
1862
- currentFill &&
1863
- currentTickness &&
1864
- ctx.fillRect(
1865
- drawStart,
1866
- top + offsetY * size + dy - offsetAligner * finalTickness,
1867
- boxWidth - charSpacing,
1868
- finalTickness,
1869
- );
1870
- topOffset += heightOfLine;
1871
- }
1872
- // if there is text background color no
1873
- // other shadows should be casted
1874
- this._removeShadow(ctx);
1875
- }
1876
-
1877
- /**
1878
- * return font declaration string for canvas context
1879
- * @param {Object} [styleObject] object
1880
- * @returns {String} font declaration formatted for canvas context.
1881
- */
1882
- _getFontDeclaration(
1883
- {
1884
- fontFamily = this.fontFamily,
1885
- fontStyle = this.fontStyle,
1886
- fontWeight = this.fontWeight,
1887
- fontSize = this.fontSize,
1888
- }: Partial<
1889
- Pick<
1890
- TextStyleDeclaration,
1891
- 'fontFamily' | 'fontStyle' | 'fontWeight' | 'fontSize'
1892
- >
1893
- > = {},
1894
- forMeasuring?: boolean,
1895
- ): string {
1896
- const parsedFontFamily =
1897
- fontFamily.includes("'") ||
1898
- fontFamily.includes('"') ||
1899
- fontFamily.includes(',') ||
1900
- FabricText.genericFonts.includes(fontFamily.toLowerCase())
1901
- ? fontFamily
1902
- : `"${fontFamily}"`;
1903
- return [
1904
- fontStyle,
1905
- fontWeight,
1906
- `${forMeasuring ? this.CACHE_FONT_SIZE : fontSize}px`,
1907
- parsedFontFamily,
1908
- ].join(' ');
1909
- }
1910
-
1911
- /**
1912
- * Renders text instance on a specified context
1913
- * @param {CanvasRenderingContext2D} ctx Context to render on
1914
- */
1915
- render(ctx: CanvasRenderingContext2D) {
1916
- if (!this.visible) {
1917
- return;
1918
- }
1919
- if (
1920
- this.canvas &&
1921
- this.canvas.skipOffscreen &&
1922
- !this.group &&
1923
- !this.isOnScreen()
1924
- ) {
1925
- return;
1926
- }
1927
- if (this._forceClearCache) {
1928
- this.initDimensions();
1929
- }
1930
- super.render(ctx);
1931
- }
1932
-
1933
- /**
1934
- * Override this method to customize grapheme splitting
1935
- * @todo the util `graphemeSplit` needs to be injectable in some way.
1936
- * is more comfortable to inject the correct util rather than having to override text
1937
- * in the middle of the prototype chain
1938
- * @param {string} value
1939
- * @returns {string[]} array of graphemes
1940
- */
1941
- graphemeSplit(value: string): string[] {
1942
- return graphemeSplit(value);
1943
- }
1944
-
1945
- /**
1946
- * Returns the text as an array of lines.
1947
- * @param {String} text text to split
1948
- * @returns Lines in the text
1949
- */
1950
- _splitTextIntoLines(text: string): TextLinesInfo {
1951
- const lines = text.split(this._reNewline),
1952
- newLines = new Array<string[]>(lines.length),
1953
- newLine = ['\n'];
1954
- let newText: string[] = [];
1955
- for (let i = 0; i < lines.length; i++) {
1956
- newLines[i] = this.graphemeSplit(lines[i]);
1957
- newText = newText.concat(newLines[i], newLine);
1958
- }
1959
- newText.pop();
1960
- return {
1961
- _unwrappedLines: newLines,
1962
- lines: lines,
1963
- graphemeText: newText,
1964
- graphemeLines: newLines,
1965
- };
1966
- }
1967
-
1968
- /**
1969
- * Returns object representation of an instance
1970
- * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output
1971
- * @return {Object} Object representation of an instance
1972
- */
1973
- toObject<
1974
- T extends Omit<Props & TClassProperties<this>, keyof SProps>,
1975
- K extends keyof T = never,
1976
- >(propertiesToInclude: K[] = []): Pick<T, K> & SProps {
1977
- return {
1978
- ...super.toObject([...additionalProps, ...propertiesToInclude] as K[]),
1979
- styles: stylesToArray(this.styles, this.text),
1980
- ...(this.path ? { path: this.path.toObject() } : {}),
1981
- };
1982
- }
1983
-
1984
- set(key: string | any, value?: any) {
1985
- const { textLayoutProperties } = this.constructor as typeof FabricText;
1986
- super.set(key, value);
1987
- let needsDims = false;
1988
- let isAddingPath = false;
1989
- if (typeof key === 'object') {
1990
- for (const _key in key) {
1991
- if (_key === 'path') {
1992
- this.setPathInfo();
1993
- }
1994
- needsDims = needsDims || textLayoutProperties.includes(_key);
1995
- isAddingPath = isAddingPath || _key === 'path';
1996
- }
1997
- } else {
1998
- needsDims = textLayoutProperties.includes(key);
1999
- isAddingPath = key === 'path';
2000
- }
2001
- if (isAddingPath) {
2002
- this.setPathInfo();
2003
- }
2004
- if (needsDims && this.initialized) {
2005
- // Clear browser lines when layout-affecting properties change
2006
- clearBrowserLines(this);
2007
- this.initDimensions();
2008
- this.setCoords();
2009
- }
2010
- return this;
2011
- }
2012
-
2013
- /**
2014
- * Returns complexity of an instance
2015
- * @return {Number} complexity
2016
- */
2017
- complexity(): number {
2018
- return 1;
2019
- }
2020
-
2021
- /**
2022
- * List of generic font families
2023
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name
2024
- */
2025
- static genericFonts = [
2026
- 'serif',
2027
- 'sans-serif',
2028
- 'monospace',
2029
- 'cursive',
2030
- 'fantasy',
2031
- 'system-ui',
2032
- 'ui-serif',
2033
- 'ui-sans-serif',
2034
- 'ui-monospace',
2035
- 'ui-rounded',
2036
- 'math',
2037
- 'emoji',
2038
- 'fangsong',
2039
- ];
2040
-
2041
- /* _FROM_SVG_START_ */
2042
-
2043
- /**
2044
- * List of attribute names to account for when parsing SVG element (used by {@link FabricText.fromElement})
2045
- * @see: http://www.w3.org/TR/SVG/text.html#TextElement
2046
- */
2047
- static ATTRIBUTE_NAMES = SHARED_ATTRIBUTES.concat(
2048
- 'x',
2049
- 'y',
2050
- 'dx',
2051
- 'dy',
2052
- 'font-family',
2053
- 'font-style',
2054
- 'font-weight',
2055
- 'font-size',
2056
- 'letter-spacing',
2057
- 'text-decoration',
2058
- 'text-anchor',
2059
- );
2060
-
2061
- /**
2062
- * Returns FabricText instance from an SVG element (<b>not yet implemented</b>)
2063
- * @param {HTMLElement} element Element to parse
2064
- * @param {Object} [options] Options object
2065
- */
2066
- static async fromElement(
2067
- element: HTMLElement | SVGElement,
2068
- options?: Abortable,
2069
- cssRules?: CSSRules,
2070
- ) {
2071
- const parsedAttributes = parseAttributes(
2072
- element,
2073
- FabricText.ATTRIBUTE_NAMES,
2074
- cssRules,
2075
- );
2076
-
2077
- const {
2078
- textAnchor = LEFT as typeof LEFT | typeof CENTER | typeof RIGHT,
2079
- textDecoration = '',
2080
- dx = 0,
2081
- dy = 0,
2082
- top = 0,
2083
- left = 0,
2084
- fontSize = DEFAULT_SVG_FONT_SIZE,
2085
- strokeWidth = 1,
2086
- ...restOfOptions
2087
- } = { ...options, ...parsedAttributes };
2088
-
2089
- const textContent = (element.textContent || '')
2090
- .replace(/^\s+|\s+$|\n+/g, '')
2091
- .replace(/\s+/g, ' ');
2092
-
2093
- // this code here is probably the usual issue for SVG center find
2094
- // this can later looked at again and probably removed.
2095
-
2096
- const text = new this(textContent, {
2097
- left: left + dx,
2098
- top: top + dy,
2099
- underline: textDecoration.includes('underline'),
2100
- overline: textDecoration.includes('overline'),
2101
- linethrough: textDecoration.includes('line-through'),
2102
- // we initialize this as 0
2103
- strokeWidth: 0,
2104
- fontSize,
2105
- ...restOfOptions,
2106
- }),
2107
- textHeightScaleFactor = text.getScaledHeight() / text.height,
2108
- lineHeightDiff =
2109
- (text.height + text.strokeWidth) * text.lineHeight - text.height,
2110
- scaledDiff = lineHeightDiff * textHeightScaleFactor,
2111
- textHeight = text.getScaledHeight() + scaledDiff;
2112
-
2113
- let offX = 0;
2114
- /*
2115
- Adjust positioning:
2116
- x/y attributes in SVG correspond to the bottom-left corner of text bounding box
2117
- fabric output by default at top, left.
2118
- */
2119
- if (textAnchor === CENTER) {
2120
- offX = text.getScaledWidth() / 2;
2121
- }
2122
- if (textAnchor === RIGHT) {
2123
- offX = text.getScaledWidth();
2124
- }
2125
- text.set({
2126
- left: text.left - offX,
2127
- top:
2128
- text.top -
2129
- (textHeight - text.fontSize * (0.07 + text._fontSizeFraction)) /
2130
- text.lineHeight,
2131
- strokeWidth,
2132
- });
2133
- return text;
2134
- }
2135
-
2136
- /* _FROM_SVG_END_ */
2137
-
2138
- /**
2139
- * Returns FabricText instance from an object representation
2140
- * @param {Object} object plain js Object to create an instance from
2141
- * @returns {Promise<FabricText>}
2142
- */
2143
- static fromObject<
2144
- T extends TOptions<SerializedTextProps>,
2145
- S extends FabricText,
2146
- >(object: T) {
2147
- return this._fromObject<S>(
2148
- {
2149
- ...object,
2150
- styles: stylesFromArray(object.styles || {}, object.text),
2151
- },
2152
- {
2153
- extraParam: 'text',
2154
- },
2155
- );
2156
- }
2157
- }
2158
-
2159
- applyMixins(FabricText, [TextSVGExportMixin]);
2160
- classRegistry.setClass(FabricText);
2161
- classRegistry.setSVGClass(FabricText);
1
+ import { cache } from '../../cache';
2
+ import { DEFAULT_SVG_FONT_SIZE, FILL, STROKE } from '../../constants';
3
+ import type { ObjectEvents } from '../../EventTypeDefs';
4
+ import type {
5
+ CompleteTextStyleDeclaration,
6
+ TextStyle,
7
+ TextStyleDeclaration,
8
+ } from './StyledText';
9
+ import { StyledText } from './StyledText';
10
+ import { SHARED_ATTRIBUTES } from '../../parser/attributes';
11
+ import { parseAttributes } from '../../parser/parseAttributes';
12
+ import type {
13
+ Abortable,
14
+ TCacheCanvasDimensions,
15
+ TClassProperties,
16
+ TFiller,
17
+ TOptions,
18
+ } from '../../typedefs';
19
+ import { classRegistry } from '../../ClassRegistry';
20
+ import { graphemeSplit } from '../../util/lang_string';
21
+ import { createCanvasElementFor } from '../../util/misc/dom';
22
+ import { layoutText, type LayoutResult, type TextLayoutOptions } from '../../text/layout';
23
+ import { measureGrapheme, measureGraphemeWithKerning } from '../../text/measure';
24
+ import { applyEllipsis } from '../../text/ellipsis';
25
+ import { segmentGraphemes } from '../../text/unicode';
26
+ import type { TextStyleArray } from '../../util/misc/textStyles';
27
+ import {
28
+ hasStyleChanged,
29
+ stylesFromArray,
30
+ stylesToArray,
31
+ } from '../../util/misc/textStyles';
32
+ import { getPathSegmentsInfo, getPointOnPath } from '../../util/path';
33
+ import { cacheProperties } from '../Object/FabricObject';
34
+ import type { Path } from '../Path';
35
+ import { TextSVGExportMixin } from './TextSVGExportMixin';
36
+ import { applyMixins } from '../../util/applyMixins';
37
+ import type { FabricObjectProps, SerializedObjectProps } from '../Object/types';
38
+ import type { StylePropertiesType } from './constants';
39
+ import {
40
+ additionalProps,
41
+ textDefaultValues,
42
+ textLayoutProperties,
43
+ JUSTIFY,
44
+ JUSTIFY_CENTER,
45
+ JUSTIFY_LEFT,
46
+ JUSTIFY_RIGHT,
47
+ TEXT_DECORATION_THICKNESS,
48
+ } from './constants';
49
+ import { CENTER, LEFT, RIGHT, TOP, BOTTOM } from '../../constants';
50
+ import { isFiller } from '../../util/typeAssertions';
51
+ import type { Gradient } from '../../gradient/Gradient';
52
+ import type { Pattern } from '../../Pattern';
53
+ import type { CSSRules } from '../../parser/typedefs';
54
+ import { getBrowserLines, clearBrowserLines } from '../../text/browserLines';
55
+ import type { BrowserLine } from '../../text/browserLines';
56
+
57
+ let measuringContext: CanvasRenderingContext2D | null;
58
+
59
+ /**
60
+ * Return a context for measurement of text string.
61
+ * if created it gets stored for reuse
62
+ */
63
+ function getMeasuringContext() {
64
+ if (!measuringContext) {
65
+ const canvas = createCanvasElementFor({
66
+ width: 0,
67
+ height: 0,
68
+ });
69
+ measuringContext = canvas.getContext('2d');
70
+ }
71
+ return measuringContext;
72
+ }
73
+
74
+ export type TPathSide = 'left' | 'right';
75
+
76
+ export type TPathAlign = 'baseline' | 'center' | 'ascender' | 'descender';
77
+
78
+ export type TextLinesInfo = {
79
+ lines: string[];
80
+ graphemeLines: string[][];
81
+ graphemeText: string[];
82
+ _unwrappedLines: string[][];
83
+ };
84
+
85
+ /**
86
+ * Measure and return the info of a single grapheme.
87
+ * needs the the info of previous graphemes already filled
88
+ * Override to customize measuring
89
+ */
90
+ export type GraphemeBBox = {
91
+ width: number;
92
+ height: number;
93
+ kernedWidth: number;
94
+ left: number;
95
+ deltaY: number;
96
+ renderLeft?: number;
97
+ renderTop?: number;
98
+ angle?: number;
99
+ };
100
+
101
+ // @TODO this is not complete
102
+ interface UniqueTextProps {
103
+ charSpacing: number;
104
+ lineHeight: number;
105
+ fontSize: number;
106
+ fontWeight: string | number;
107
+ fontFamily: string;
108
+ fontStyle: string;
109
+ pathSide: TPathSide;
110
+ pathAlign: TPathAlign;
111
+ underline: boolean;
112
+ overline: boolean;
113
+ linethrough: boolean;
114
+ textAlign: string;
115
+ direction: CanvasDirection;
116
+ path?: Path;
117
+ textDecorationThickness: number;
118
+ wrap: 'word' | 'char' | 'none';
119
+ ellipsis: boolean | string;
120
+ letterSpacing: number;
121
+ enableAdvancedLayout: boolean;
122
+ verticalAlign: 'top' | 'middle' | 'bottom';
123
+ useOverlayEditing: boolean;
124
+ }
125
+
126
+ export interface SerializedTextProps
127
+ extends SerializedObjectProps,
128
+ UniqueTextProps {
129
+ styles: TextStyleArray | TextStyle;
130
+ }
131
+
132
+ export interface TextProps extends FabricObjectProps, UniqueTextProps {
133
+ styles: TextStyle;
134
+ }
135
+
136
+ /**
137
+ * Text class
138
+ * @see {@link http://fabricjs.com/fabric-intro-part-2#text}
139
+ */
140
+ export class FabricText<
141
+ Props extends TOptions<TextProps> = Partial<TextProps>,
142
+ SProps extends SerializedTextProps = SerializedTextProps,
143
+ EventSpec extends ObjectEvents = ObjectEvents,
144
+ >
145
+ extends StyledText<Props, SProps, EventSpec>
146
+ implements UniqueTextProps
147
+ {
148
+ /**
149
+ * Properties that requires a text layout recalculation when changed
150
+ * @type string[]
151
+ * @protected
152
+ */
153
+ static textLayoutProperties: string[] = textLayoutProperties;
154
+
155
+ /**
156
+ * @private
157
+ */
158
+ declare _reNewline: RegExp;
159
+
160
+ /**
161
+ * Use this regular expression to filter for whitespaces that is not a new line.
162
+ * Mostly used when text is 'justify' aligned.
163
+ * @private
164
+ */
165
+ declare _reSpacesAndTabs: RegExp;
166
+
167
+ /**
168
+ * Use this regular expression to filter for whitespace that is not a new line.
169
+ * Mostly used when text is 'justify' aligned.
170
+ * @private
171
+ */
172
+ declare _reSpaceAndTab: RegExp;
173
+
174
+ /**
175
+ * Use this regular expression to filter consecutive groups of non spaces.
176
+ * Mostly used when text is 'justify' aligned.
177
+ * @private
178
+ */
179
+ declare _reWords: RegExp;
180
+
181
+ declare text: string;
182
+
183
+ /**
184
+ * Font size (in pixels)
185
+ * @type Number
186
+ */
187
+ declare fontSize: number;
188
+
189
+ /**
190
+ * Font weight (e.g. bold, normal, 400, 600, 800)
191
+ * @type {(Number|String)}
192
+ */
193
+ declare fontWeight: string | number;
194
+
195
+ /**
196
+ * Font family
197
+ * @type String
198
+ */
199
+ declare fontFamily: string;
200
+
201
+ /**
202
+ * Text decoration underline.
203
+ * @type Boolean
204
+ */
205
+ declare underline: boolean;
206
+
207
+ /**
208
+ * Text decoration overline.
209
+ * @type Boolean
210
+ */
211
+ declare overline: boolean;
212
+
213
+ /**
214
+ * Text decoration linethrough.
215
+ * @type Boolean
216
+ */
217
+ declare linethrough: boolean;
218
+
219
+ /**
220
+ * Text alignment. Possible values: "left", "center", "right", "justify",
221
+ * "justify-left", "justify-center" or "justify-right".
222
+ * @type String
223
+ */
224
+ declare textAlign: string;
225
+
226
+ /**
227
+ * Font style . Possible values: "", "normal", "italic" or "oblique".
228
+ * @type String
229
+ */
230
+ declare fontStyle: string;
231
+
232
+ /**
233
+ * Line height
234
+ * @type Number
235
+ */
236
+ declare lineHeight: number;
237
+
238
+ /**
239
+ * Superscript schema object (minimum overlap)
240
+ */
241
+ declare superscript: {
242
+ /**
243
+ * fontSize factor
244
+ * @default 0.6
245
+ */
246
+ size: number;
247
+ /**
248
+ * baseline-shift factor (upwards)
249
+ * @default -0.35
250
+ */
251
+ baseline: number;
252
+ };
253
+
254
+ /**
255
+ * Subscript schema object (minimum overlap)
256
+ */
257
+ declare subscript: {
258
+ /**
259
+ * fontSize factor
260
+ * @default 0.6
261
+ */
262
+ size: number;
263
+ /**
264
+ * baseline-shift factor (downwards)
265
+ * @default 0.11
266
+ */
267
+ baseline: number;
268
+ };
269
+
270
+ /**
271
+ * Background color of text lines
272
+ * @type String
273
+ */
274
+ declare textBackgroundColor: string;
275
+
276
+ declare styles: TextStyle;
277
+
278
+ /**
279
+ * Path that the text should follow.
280
+ * since 4.6.0 the path will be drawn automatically.
281
+ * if you want to make the path visible, give it a stroke and strokeWidth or fill value
282
+ * if you want it to be hidden, assign visible = false to the path.
283
+ * This feature is in BETA, and SVG import/export is not yet supported.
284
+ * @type Path
285
+ * @example
286
+ * const textPath = new Text('Text on a path', {
287
+ * top: 150,
288
+ * left: 150,
289
+ * textAlign: 'center',
290
+ * charSpacing: -50,
291
+ * path: new Path('M 0 0 C 50 -100 150 -100 200 0', {
292
+ * strokeWidth: 1,
293
+ * visible: false
294
+ * }),
295
+ * pathSide: 'left',
296
+ * pathStartOffset: 0
297
+ * });
298
+ */
299
+ declare path?: Path;
300
+
301
+ /**
302
+ * Text wrapping mode
303
+ * @type string
304
+ * @default 'word'
305
+ */
306
+ declare wrap: 'word' | 'char' | 'none';
307
+
308
+ /**
309
+ * Ellipsis truncation
310
+ * @type boolean | string
311
+ * @default false
312
+ */
313
+ declare ellipsis: boolean | string;
314
+
315
+ /**
316
+ * Letter spacing in pixels (Konva-style)
317
+ * @type number
318
+ * @default 0
319
+ */
320
+ declare letterSpacing: number;
321
+
322
+ /**
323
+ * Enable advanced text layout engine
324
+ * @type boolean
325
+ * @default false
326
+ */
327
+ declare enableAdvancedLayout: boolean;
328
+
329
+ /**
330
+ * Vertical text alignment
331
+ * @type string
332
+ * @default 'top'
333
+ */
334
+ declare verticalAlign: 'top' | 'middle' | 'bottom';
335
+
336
+ /**
337
+ * Use overlay editor for inline text editing instead of hidden textarea.
338
+ * @default false
339
+ */
340
+ declare useOverlayEditing: boolean;
341
+
342
+ /**
343
+ * The text decoration tickness for underline, overline and strikethrough
344
+ * The tickness is expressed in thousandths of fontSize ( em ).
345
+ * The original value was 1/15 that translates to 66.6667 thousandths.
346
+ * The choice of unit of measure is to align with charSpacing.
347
+ * You can slim the tickness without issues, while large underline or overline may end up
348
+ * outside the bounding box of the text. In order to fix that a bigger refactor of the code
349
+ * is needed and is out of scope for now. If you need such large overline on the first line
350
+ * of text or large underline on the last line of text, consider disabling caching as a
351
+ * workaround
352
+ * @default 66.667
353
+ */
354
+ declare textDecorationThickness: number;
355
+
356
+ /**
357
+ * Offset amount for text path starting position
358
+ * Only used when text has a path
359
+ */
360
+ declare pathStartOffset: number;
361
+
362
+ /**
363
+ * Which side of the path the text should be drawn on.
364
+ * Only used when text has a path
365
+ * @type {TPathSide} 'left|right'
366
+ */
367
+ declare pathSide: TPathSide;
368
+
369
+ /**
370
+ * How text is aligned to the path. This property determines
371
+ * the perpendicular position of each character relative to the path.
372
+ * (one of "baseline", "center", "ascender", "descender")
373
+ * This feature is in BETA, and its behavior may change
374
+ * @type TPathAlign
375
+ */
376
+ declare pathAlign: TPathAlign;
377
+
378
+ /**
379
+ * @private
380
+ */
381
+ declare _fontSizeFraction: number;
382
+
383
+ /**
384
+ * @private
385
+ */
386
+ declare offsets: { underline: number; linethrough: number; overline: number };
387
+
388
+ /**
389
+ * Text Line proportion to font Size (in pixels)
390
+ * @type Number
391
+ */
392
+ declare _fontSizeMult: number;
393
+
394
+ /**
395
+ * additional space between characters
396
+ * expressed in thousands of em unit
397
+ * @type Number
398
+ */
399
+ declare charSpacing: number;
400
+
401
+ /**
402
+ * Baseline shift, styles only, keep at 0 for the main text object
403
+ * @type {Number}
404
+ */
405
+ declare deltaY: number;
406
+
407
+ /**
408
+ * WARNING: EXPERIMENTAL. NOT SUPPORTED YET
409
+ * determine the direction of the text.
410
+ * This has to be set manually together with textAlign and originX for proper
411
+ * experience.
412
+ * some interesting link for the future
413
+ * https://www.w3.org/International/questions/qa-bidi-unicode-controls
414
+ * @since 4.5.0
415
+ * @type {CanvasDirection} 'ltr|rtl'
416
+ */
417
+ declare direction: CanvasDirection;
418
+
419
+ /**
420
+ * contains characters bounding boxes
421
+ * This variable is considered to be protected.
422
+ * But for how mixins are implemented right now, we can't leave it private
423
+ * @protected
424
+ */
425
+ __charBounds: GraphemeBBox[][] = [];
426
+
427
+ /**
428
+ * use this size when measuring text. To avoid IE11 rounding errors
429
+ * @type {Number}
430
+ * @readonly
431
+ * @private
432
+ */
433
+ declare CACHE_FONT_SIZE: number;
434
+
435
+ /**
436
+ * contains the min text width to avoid getting 0
437
+ * @type {Number}
438
+ */
439
+ declare MIN_TEXT_WIDTH: number;
440
+
441
+ /**
442
+ * contains the the text of the object, divided in lines as they are displayed
443
+ * on screen. Wrapping will divide the text independently of line breaks
444
+ * @type {string[]}
445
+ */
446
+ declare textLines: string[];
447
+
448
+ /**
449
+ * same as textlines, but each line is an array of graphemes as split by splitByGrapheme
450
+ * @type {string[]}
451
+ */
452
+ declare _textLines: string[][];
453
+
454
+ declare _unwrappedTextLines: string[][];
455
+ declare _text: string[];
456
+ declare cursorWidth: number;
457
+ declare __lineHeights: number[];
458
+ declare __lineWidths: number[];
459
+ declare initialized?: true;
460
+
461
+ static cacheProperties = [...cacheProperties, ...additionalProps];
462
+
463
+ static ownDefaults = textDefaultValues;
464
+
465
+ static type = 'Text';
466
+
467
+ static getDefaults(): Record<string, any> {
468
+ return { ...super.getDefaults(), ...FabricText.ownDefaults };
469
+ }
470
+
471
+ constructor(text: string, options?: Props) {
472
+ super();
473
+ Object.assign(this, FabricText.ownDefaults);
474
+ this.setOptions(options);
475
+ if (!this.styles) {
476
+ this.styles = {};
477
+ }
478
+ this.text = text;
479
+ this.initialized = true;
480
+ if (this.path) {
481
+ this.setPathInfo();
482
+ }
483
+ this.initDimensions();
484
+ this.setCoords();
485
+ }
486
+
487
+ /**
488
+ * If text has a path, it will add the extra information needed
489
+ * for path and text calculations
490
+ */
491
+ setPathInfo() {
492
+ const path = this.path;
493
+ if (path) {
494
+ path.segmentsInfo = getPathSegmentsInfo(path.path);
495
+ }
496
+ }
497
+
498
+ /**
499
+ * @private
500
+ * Divides text into lines of text and lines of graphemes.
501
+ * Uses browser lines when available for pixel-perfect consistency.
502
+ */
503
+ _splitText(): TextLinesInfo {
504
+ // Check if we have valid browser lines and should use them
505
+ const browserLines = getBrowserLines(this);
506
+ if (browserLines && this.useOverlayEditing) {
507
+ return this._splitTextFromBrowserLines(browserLines);
508
+ }
509
+
510
+ const newLines = this._splitTextIntoLines(this.text);
511
+ this.textLines = newLines.lines;
512
+ this._textLines = newLines.graphemeLines;
513
+ this._unwrappedTextLines = newLines._unwrappedLines;
514
+ this._text = newLines.graphemeText;
515
+ return newLines;
516
+ }
517
+
518
+ /**
519
+ * Create TextLinesInfo from browser-extracted lines
520
+ * @private
521
+ */
522
+ _splitTextFromBrowserLines(browserLines: BrowserLine[]): TextLinesInfo {
523
+ const lines: string[] = [];
524
+ const graphemeLines: string[][] = [];
525
+ const unwrappedLines: string[][] = [];
526
+ let graphemeText: string[] = [];
527
+
528
+ for (const browserLine of browserLines) {
529
+ lines.push(browserLine.text);
530
+ const lineGraphemes = this.graphemeSplit(browserLine.text);
531
+ graphemeLines.push(lineGraphemes);
532
+ unwrappedLines.push(lineGraphemes);
533
+ graphemeText = graphemeText.concat(lineGraphemes);
534
+
535
+ // Add newline separator between lines (except for the last line)
536
+ if (browserLine !== browserLines[browserLines.length - 1]) {
537
+ graphemeText.push('\n');
538
+ }
539
+ }
540
+
541
+ const result: TextLinesInfo = {
542
+ lines,
543
+ graphemeLines,
544
+ graphemeText,
545
+ _unwrappedLines: unwrappedLines,
546
+ };
547
+
548
+ // Update instance properties
549
+ this.textLines = result.lines;
550
+ this._textLines = result.graphemeLines;
551
+ this._unwrappedTextLines = result._unwrappedLines;
552
+ this._text = result.graphemeText;
553
+
554
+ return result;
555
+ }
556
+
557
+ /**
558
+ * Initialize or update text dimensions.
559
+ * Updates this.width and this.height with the proper values.
560
+ * Does not return dimensions.
561
+ */
562
+ initDimensions(): void {
563
+ // Check if font is ready for accurate measurements
564
+ // Only block initialization if it's a critical font loading situation
565
+ const fontReady = this._isFontReady();
566
+ if (!fontReady && !this.initialized) {
567
+ // Only schedule font loading on first initialization
568
+ this._scheduleInitAfterFontLoad();
569
+ // Continue with fallback measurements for now
570
+ }
571
+
572
+ // Use advanced layout if enabled
573
+ if (this.enableAdvancedLayout && !this.path) {
574
+ return this.initDimensionsAdvanced();
575
+ }
576
+
577
+ this._splitText();
578
+ this._clearCache();
579
+ this.dirty = true;
580
+ if (this.path) {
581
+ this.width = this.path.width;
582
+ this.height = this.path.height;
583
+ } else {
584
+ this.width =
585
+ this.calcTextWidth() || this.cursorWidth || this.MIN_TEXT_WIDTH;
586
+ this.height = this.calcTextHeight();
587
+ }
588
+ if (this.textAlign.includes(JUSTIFY)) {
589
+ // once text is measured we need to make space fatter to make justified text.
590
+ // Ensure __charBounds exists before calling enlargeSpaces
591
+ if (this.__charBounds && this.__charBounds.length > 0) {
592
+ this.enlargeSpaces();
593
+ } else {
594
+ console.warn('⚠️ __charBounds not ready for justify alignment, deferring enlargeSpaces');
595
+ // Defer the justify calculation until the next frame
596
+ setTimeout(() => {
597
+ if (this.__charBounds && this.__charBounds.length > 0 && this.enlargeSpaces) {
598
+ console.log('🔧 Applying deferred justify alignment');
599
+ this.enlargeSpaces();
600
+ this.canvas?.requestRenderAll();
601
+ }
602
+ }, 0);
603
+ }
604
+ }
605
+ }
606
+
607
+ /**
608
+ * Enlarge space boxes and shift the others
609
+ */
610
+ enlargeSpaces() {
611
+ let diffSpace,
612
+ currentLineWidth,
613
+ numberOfSpaces,
614
+ accumulatedSpace,
615
+ line,
616
+ charBound,
617
+ spaces;
618
+ const isRtl = this.direction === 'rtl';
619
+
620
+ for (let i = 0, len = this._textLines.length; i < len; i++) {
621
+ if (
622
+ !this.textAlign.includes('justify') &&
623
+ (i === len - 1 || this.isEndOfWrapping(i))
624
+ ) {
625
+ continue;
626
+ }
627
+ accumulatedSpace = 0;
628
+ line = this._textLines[i];
629
+ currentLineWidth = this.getLineWidth(i);
630
+ if (
631
+ currentLineWidth < this.width &&
632
+ (spaces = this.textLines[i].match(this._reSpacesAndTabs))
633
+ ) {
634
+ numberOfSpaces = spaces.length;
635
+ diffSpace = (this.width - currentLineWidth) / numberOfSpaces;
636
+
637
+ console.log(`🔧 EnlargeSpaces Line ${i}:`);
638
+ console.log(` Current width: ${currentLineWidth}, Target: ${this.width}`);
639
+ console.log(` Spaces: ${numberOfSpaces}, diffSpace: ${diffSpace.toFixed(2)}`);
640
+
641
+ if (isRtl) {
642
+ // For RTL text, we need to redistribute spaces while maintaining correct visual order
643
+ // The key insight is that RTL text is stored in logical order but displayed in visual order
644
+ // We need to adjust bounds to account for the visual positioning
645
+
646
+ // First, collect all space positions
647
+ const spaceIndices = [];
648
+ for (let j = 0; j < line.length; j++) {
649
+ if (this._reSpaceAndTab.test(line[j])) {
650
+ spaceIndices.push(j);
651
+ }
652
+ }
653
+
654
+ // Calculate total expansion
655
+ const totalExpansion = diffSpace * numberOfSpaces;
656
+
657
+ // For RTL, we need to work backwards through the visual positions
658
+ // but still update logical positions correctly
659
+ let spaceCount = 0;
660
+ for (let j = 0; j <= line.length; j++) {
661
+ charBound = this.__charBounds[i][j];
662
+ if (charBound) {
663
+ if (this._reSpaceAndTab.test(line[j])) {
664
+ charBound.width += diffSpace;
665
+ charBound.kernedWidth += diffSpace;
666
+ spaceCount++;
667
+ }
668
+
669
+ // For RTL, shift all characters to the right by the total expansion
670
+ // minus the expansion that comes after this character
671
+ const remainingSpaces = numberOfSpaces - spaceCount;
672
+ const shiftAmount = remainingSpaces * diffSpace;
673
+ charBound.left += shiftAmount;
674
+ }
675
+ }
676
+ } else {
677
+ // LTR processing (original logic)
678
+ for (let j = 0; j <= line.length; j++) {
679
+ charBound = this.__charBounds[i][j];
680
+ if (charBound) {
681
+ if (this._reSpaceAndTab.test(line[j])) {
682
+ charBound.width += diffSpace;
683
+ charBound.kernedWidth += diffSpace;
684
+ charBound.left += accumulatedSpace;
685
+ accumulatedSpace += diffSpace;
686
+ } else {
687
+ charBound.left += accumulatedSpace;
688
+ }
689
+ }
690
+ }
691
+ }
692
+ }
693
+ }
694
+ }
695
+
696
+ /**
697
+ * Advanced layout using new text engine (Konva-compatible)
698
+ * @private
699
+ */
700
+ _layoutTextAdvanced(): LayoutResult {
701
+ const options = this._getAdvancedLayoutOptions();
702
+ return layoutText(options);
703
+ }
704
+
705
+ /**
706
+ * Get advanced layout options from current text properties
707
+ * @private
708
+ */
709
+ _getAdvancedLayoutOptions(): TextLayoutOptions {
710
+ return {
711
+ text: this.text,
712
+ width: this.width,
713
+ height: this.height,
714
+ wrap: this.wrap || 'word',
715
+ align: this._mapTextAlignToAlign(this.textAlign),
716
+ ellipsis: this.ellipsis || false,
717
+ fontSize: this.fontSize,
718
+ lineHeight: this.lineHeight,
719
+ letterSpacing: this.letterSpacing || 0,
720
+ charSpacing: this.charSpacing,
721
+ direction: this.direction === 'inherit' ? 'ltr' : this.direction,
722
+ fontFamily: this.fontFamily,
723
+ fontStyle: this.fontStyle,
724
+ fontWeight: this.fontWeight,
725
+ verticalAlign: this.verticalAlign || 'top',
726
+ };
727
+ }
728
+
729
+ /**
730
+ * Map Fabric textAlign to Konva align format
731
+ * @private
732
+ */
733
+ _mapTextAlignToAlign(textAlign: string): 'left' | 'center' | 'right' | 'justify' {
734
+ switch (textAlign) {
735
+ case 'center':
736
+ case CENTER:
737
+ return 'center';
738
+ case 'right':
739
+ case RIGHT:
740
+ return 'right';
741
+ case 'justify':
742
+ case JUSTIFY:
743
+ case JUSTIFY_LEFT:
744
+ case JUSTIFY_RIGHT:
745
+ case JUSTIFY_CENTER:
746
+ return 'justify';
747
+ default:
748
+ return 'left';
749
+ }
750
+ }
751
+
752
+ /**
753
+ * Enhanced initDimensions that uses advanced layout when enabled
754
+ */
755
+ initDimensionsAdvanced(): void {
756
+ if (!this.enableAdvancedLayout) {
757
+ return this.initDimensions();
758
+ }
759
+
760
+ const layout = this._layoutTextAdvanced();
761
+
762
+ // Update dimensions from layout
763
+ this.width = layout.totalWidth || this.MIN_TEXT_WIDTH;
764
+ this.height = layout.totalHeight;
765
+
766
+ // Convert layout to legacy format for compatibility
767
+ this._convertLayoutToLegacyFormat(layout);
768
+
769
+ // Ensure justify alignment is properly applied for compatibility with legacy rendering
770
+ if (this.textAlign.includes(JUSTIFY)) {
771
+ // Force enlarge spaces after advanced layout calculation
772
+ setTimeout(() => {
773
+ if (this.enlargeSpaces) {
774
+ this.enlargeSpaces();
775
+ this.canvas?.renderAll();
776
+ }
777
+ }, 0);
778
+ }
779
+
780
+ this.dirty = true;
781
+ }
782
+
783
+ /**
784
+ * Convert new layout format to legacy _textLines and __charBounds format
785
+ * @private
786
+ */
787
+ _convertLayoutToLegacyFormat(layout: LayoutResult): void {
788
+ this._textLines = layout.lines.map(line => line.graphemes);
789
+ (this as any).textLines = layout.lines.map(line => line.text);
790
+
791
+ // Convert bounds to legacy format
792
+ this.__charBounds = layout.lines.map(line =>
793
+ line.bounds.map(bound => ({
794
+ left: bound.left,
795
+ top: bound.y,
796
+ width: bound.width,
797
+ height: bound.height,
798
+ kernedWidth: bound.kernedWidth,
799
+ deltaY: bound.deltaY || 0,
800
+ }))
801
+ );
802
+
803
+ // Update grapheme info for compatibility
804
+ if (layout.lines.length > 0) {
805
+ (this as any)._unwrappedTextLines = layout.lines.map(line => line.graphemes);
806
+ }
807
+ }
808
+
809
+ /**
810
+ * Detect if the text line is ended with an hard break
811
+ * text and itext do not have wrapping, return false
812
+ * @return {Boolean}
813
+ */
814
+ isEndOfWrapping(lineIndex: number): boolean {
815
+ return lineIndex === this._textLines.length - 1;
816
+ }
817
+
818
+ /**
819
+ * Detect if a line has a linebreak and so we need to account for it when moving
820
+ * and counting style.
821
+ * It return always 1 for text and Itext. Textbox has its own implementation
822
+ * @return Number
823
+ */
824
+ missingNewlineOffset(lineIndex: number, skipWrapping?: boolean): 0 | 1;
825
+ missingNewlineOffset(_lineIndex: number): 1 {
826
+ return 1;
827
+ }
828
+
829
+ /**
830
+ * Returns 2d representation (lineIndex and charIndex) of cursor
831
+ * @param {Number} selectionStart
832
+ * @param {Boolean} [skipWrapping] consider the location for unwrapped lines. useful to manage styles.
833
+ */
834
+ get2DCursorLocation(selectionStart: number, skipWrapping?: boolean) {
835
+ const lines = skipWrapping ? this._unwrappedTextLines : this._textLines;
836
+ let i: number;
837
+ for (i = 0; i < lines.length; i++) {
838
+ if (selectionStart <= lines[i].length) {
839
+ return {
840
+ lineIndex: i,
841
+ charIndex: selectionStart,
842
+ };
843
+ }
844
+ selectionStart -=
845
+ lines[i].length + this.missingNewlineOffset(i, skipWrapping);
846
+ }
847
+ return {
848
+ lineIndex: i - 1,
849
+ charIndex:
850
+ lines[i - 1].length < selectionStart
851
+ ? lines[i - 1].length
852
+ : selectionStart,
853
+ };
854
+ }
855
+
856
+ /**
857
+ * Returns string representation of an instance
858
+ * @return {String} String representation of text object
859
+ */
860
+ toString(): string {
861
+ return `#<Text (${this.complexity()}): { "text": "${
862
+ this.text
863
+ }", "fontFamily": "${this.fontFamily}" }>`;
864
+ }
865
+
866
+ /**
867
+ * Return the dimension and the zoom level needed to create a cache canvas
868
+ * big enough to host the object to be cached.
869
+ * @private
870
+ * @param {Object} dim.x width of object to be cached
871
+ * @param {Object} dim.y height of object to be cached
872
+ * @return {Object}.width width of canvas
873
+ * @return {Object}.height height of canvas
874
+ * @return {Object}.zoomX zoomX zoom value to unscale the canvas before drawing cache
875
+ * @return {Object}.zoomY zoomY zoom value to unscale the canvas before drawing cache
876
+ */
877
+ _getCacheCanvasDimensions(): TCacheCanvasDimensions {
878
+ const dims = super._getCacheCanvasDimensions();
879
+ const fontSize = this.fontSize;
880
+ dims.width += fontSize * dims.zoomX;
881
+ dims.height += fontSize * dims.zoomY;
882
+ return dims;
883
+ }
884
+
885
+ /**
886
+ * @private
887
+ * @param {CanvasRenderingContext2D} ctx Context to render on
888
+ */
889
+ _render(ctx: CanvasRenderingContext2D) {
890
+ const path = this.path;
891
+ path && !path.isNotVisible() && path._render(ctx);
892
+ this._setTextStyles(ctx);
893
+ this._renderTextLinesBackground(ctx);
894
+ this._renderTextDecoration(ctx, 'underline');
895
+ this._renderText(ctx);
896
+ this._renderTextDecoration(ctx, 'overline');
897
+ this._renderTextDecoration(ctx, 'linethrough');
898
+ }
899
+
900
+ /**
901
+ * @private
902
+ * @param {CanvasRenderingContext2D} ctx Context to render on
903
+ */
904
+ _renderText(ctx: CanvasRenderingContext2D) {
905
+ // Skip text rendering if in overlay editing mode
906
+ if ((this as any).__overlayEditor) {
907
+ return;
908
+ }
909
+ if (this.paintFirst === STROKE) {
910
+ this._renderTextStroke(ctx);
911
+ this._renderTextFill(ctx);
912
+ } else {
913
+ this._renderTextFill(ctx);
914
+ this._renderTextStroke(ctx);
915
+ }
916
+ }
917
+
918
+ /**
919
+ * Set the font parameter of the context with the object properties or with charStyle
920
+ * @private
921
+ * @param {CanvasRenderingContext2D} ctx Context to render on
922
+ * @param {Object} [charStyle] object with font style properties
923
+ * @param {String} [charStyle.fontFamily] Font Family
924
+ * @param {Number} [charStyle.fontSize] Font size in pixels. ( without px suffix )
925
+ * @param {String} [charStyle.fontWeight] Font weight
926
+ * @param {String} [charStyle.fontStyle] Font style (italic|normal)
927
+ */
928
+ _setTextStyles(
929
+ ctx: CanvasRenderingContext2D,
930
+ charStyle?: any,
931
+ forMeasuring?: boolean,
932
+ ) {
933
+ ctx.textBaseline = 'alphabetic';
934
+ if (this.path) {
935
+ switch (this.pathAlign) {
936
+ case CENTER:
937
+ ctx.textBaseline = 'middle';
938
+ break;
939
+ case 'ascender':
940
+ ctx.textBaseline = TOP;
941
+ break;
942
+ case 'descender':
943
+ ctx.textBaseline = BOTTOM;
944
+ break;
945
+ }
946
+ }
947
+ ctx.font = this._getFontDeclaration(charStyle, forMeasuring);
948
+ }
949
+
950
+ /**
951
+ * calculate and return the text Width measuring each line.
952
+ * @private
953
+ * @param {CanvasRenderingContext2D} ctx Context to render on
954
+ * @return {Number} Maximum width of Text object
955
+ */
956
+ calcTextWidth(): number {
957
+ let maxWidth = this.getLineWidth(0);
958
+
959
+ for (let i = 1, len = this._textLines.length; i < len; i++) {
960
+ const currentLineWidth = this.getLineWidth(i);
961
+ if (currentLineWidth > maxWidth) {
962
+ maxWidth = currentLineWidth;
963
+ }
964
+ }
965
+ return maxWidth;
966
+ }
967
+
968
+ /**
969
+ * @private
970
+ * @param {String} method Method name ("fillText" or "strokeText")
971
+ * @param {CanvasRenderingContext2D} ctx Context to render on
972
+ * @param {String} line Text to render
973
+ * @param {Number} left Left position of text
974
+ * @param {Number} top Top position of text
975
+ * @param {Number} lineIndex Index of a line in a text
976
+ */
977
+ _renderTextLine(
978
+ method: 'fillText' | 'strokeText',
979
+ ctx: CanvasRenderingContext2D,
980
+ line: string[],
981
+ left: number,
982
+ top: number,
983
+ lineIndex: number,
984
+ ) {
985
+ this._renderChars(method, ctx, line, left, top, lineIndex);
986
+ }
987
+
988
+ /**
989
+ * Renders the text background for lines, taking care of style
990
+ * @private
991
+ * @param {CanvasRenderingContext2D} ctx Context to render on
992
+ */
993
+ _renderTextLinesBackground(ctx: CanvasRenderingContext2D) {
994
+ if (!this.textBackgroundColor && !this.styleHas('textBackgroundColor')) {
995
+ return;
996
+ }
997
+ const originalFill = ctx.fillStyle,
998
+ leftOffset = this._getLeftOffset();
999
+ let lineTopOffset = this._getTopOffset();
1000
+
1001
+ for (let i = 0, len = this._textLines.length; i < len; i++) {
1002
+ const heightOfLine = this.getHeightOfLine(i);
1003
+ if (
1004
+ !this.textBackgroundColor &&
1005
+ !this.styleHas('textBackgroundColor', i)
1006
+ ) {
1007
+ lineTopOffset += heightOfLine;
1008
+ continue;
1009
+ }
1010
+ const jlen = this._textLines[i].length;
1011
+ const lineLeftOffset = this._getLineLeftOffset(i);
1012
+ let boxWidth = 0;
1013
+ let boxStart = 0;
1014
+ let drawStart;
1015
+ let currentColor;
1016
+ let lastColor = this.getValueOfPropertyAt(i, 0, 'textBackgroundColor');
1017
+ for (let j = 0; j < jlen; j++) {
1018
+ // at this point charbox are either standard or full with pathInfo if there is a path.
1019
+ const charBox = this.__charBounds[i][j] as Required<GraphemeBBox>;
1020
+ currentColor = this.getValueOfPropertyAt(i, j, 'textBackgroundColor');
1021
+ if (this.path) {
1022
+ ctx.save();
1023
+ ctx.translate(charBox.renderLeft, charBox.renderTop);
1024
+ ctx.rotate(charBox.angle);
1025
+ ctx.fillStyle = currentColor;
1026
+ currentColor &&
1027
+ ctx.fillRect(
1028
+ -charBox.width / 2,
1029
+ (-heightOfLine / this.lineHeight) * (1 - this._fontSizeFraction),
1030
+ charBox.width,
1031
+ heightOfLine / this.lineHeight,
1032
+ );
1033
+ ctx.restore();
1034
+ } else if (currentColor !== lastColor) {
1035
+ drawStart = leftOffset + lineLeftOffset + boxStart;
1036
+ if (this.direction === 'rtl') {
1037
+ drawStart = this.width - drawStart - boxWidth;
1038
+ }
1039
+ ctx.fillStyle = lastColor;
1040
+ lastColor &&
1041
+ ctx.fillRect(
1042
+ drawStart,
1043
+ lineTopOffset,
1044
+ boxWidth,
1045
+ heightOfLine / this.lineHeight,
1046
+ );
1047
+ boxStart = charBox.left;
1048
+ boxWidth = charBox.width;
1049
+ lastColor = currentColor;
1050
+ } else {
1051
+ boxWidth += charBox.kernedWidth;
1052
+ }
1053
+ }
1054
+ if (currentColor && !this.path) {
1055
+ drawStart = leftOffset + lineLeftOffset + boxStart;
1056
+ if (this.direction === 'rtl') {
1057
+ drawStart = this.width - drawStart - boxWidth;
1058
+ }
1059
+ ctx.fillStyle = currentColor;
1060
+ ctx.fillRect(
1061
+ drawStart,
1062
+ lineTopOffset,
1063
+ boxWidth,
1064
+ heightOfLine / this.lineHeight,
1065
+ );
1066
+ }
1067
+ lineTopOffset += heightOfLine;
1068
+ }
1069
+ ctx.fillStyle = originalFill;
1070
+ // if there is text background color no
1071
+ // other shadows should be casted
1072
+ this._removeShadow(ctx);
1073
+ }
1074
+
1075
+ /**
1076
+ * measure and return the width of a single character.
1077
+ * possibly overridden to accommodate different measure logic or
1078
+ * to hook some external lib for character measurement
1079
+ * @private
1080
+ * @param {String} _char, char to be measured
1081
+ * @param {Object} charStyle style of char to be measured
1082
+ * @param {String} [previousChar] previous char
1083
+ * @param {Object} [prevCharStyle] style of previous char
1084
+ */
1085
+ _measureChar(
1086
+ _char: string,
1087
+ charStyle: CompleteTextStyleDeclaration,
1088
+ previousChar: string | undefined,
1089
+ prevCharStyle: CompleteTextStyleDeclaration | Record<string, never>,
1090
+ ) {
1091
+ const fontCache = cache.getFontCache(charStyle),
1092
+ fontDeclaration = this._getFontDeclaration(charStyle),
1093
+ couple = previousChar + _char,
1094
+ stylesAreEqual =
1095
+ previousChar &&
1096
+ fontDeclaration === this._getFontDeclaration(prevCharStyle),
1097
+ fontMultiplier = charStyle.fontSize / this.CACHE_FONT_SIZE;
1098
+ let width: number | undefined,
1099
+ coupleWidth: number | undefined,
1100
+ previousWidth: number | undefined,
1101
+ kernedWidth: number | undefined;
1102
+
1103
+ if (previousChar && fontCache[previousChar] !== undefined) {
1104
+ previousWidth = fontCache[previousChar];
1105
+ }
1106
+ if (fontCache[_char] !== undefined) {
1107
+ kernedWidth = width = fontCache[_char];
1108
+ }
1109
+ if (stylesAreEqual && fontCache[couple] !== undefined) {
1110
+ coupleWidth = fontCache[couple];
1111
+ kernedWidth = coupleWidth - previousWidth!;
1112
+ }
1113
+ if (
1114
+ width === undefined ||
1115
+ previousWidth === undefined ||
1116
+ coupleWidth === undefined
1117
+ ) {
1118
+ const ctx = getMeasuringContext()!;
1119
+ // send a TRUE to specify measuring font size CACHE_FONT_SIZE
1120
+ this._setTextStyles(ctx, charStyle, true);
1121
+ if (width === undefined) {
1122
+ kernedWidth = width = ctx.measureText(_char).width;
1123
+ fontCache[_char] = width;
1124
+ }
1125
+ if (previousWidth === undefined && stylesAreEqual && previousChar) {
1126
+ previousWidth = ctx.measureText(previousChar).width;
1127
+ fontCache[previousChar] = previousWidth;
1128
+ }
1129
+ if (stylesAreEqual && coupleWidth === undefined) {
1130
+ // we can measure the kerning couple and subtract the width of the previous character
1131
+ coupleWidth = ctx.measureText(couple).width;
1132
+ fontCache[couple] = coupleWidth;
1133
+ // safe to use the non-null since if undefined we defined it before.
1134
+ kernedWidth = coupleWidth - previousWidth!;
1135
+ }
1136
+ }
1137
+ return {
1138
+ width: width * fontMultiplier,
1139
+ kernedWidth: kernedWidth! * fontMultiplier,
1140
+ };
1141
+ }
1142
+
1143
+ /**
1144
+ * Computes height of character at given position
1145
+ * @param {Number} line the line index number
1146
+ * @param {Number} _char the character index number
1147
+ * @return {Number} fontSize of the character
1148
+ */
1149
+ getHeightOfChar(line: number, _char: number): number {
1150
+ return this.getValueOfPropertyAt(line, _char, 'fontSize');
1151
+ }
1152
+
1153
+ /**
1154
+ * measure a text line measuring all characters.
1155
+ * @param {Number} lineIndex line number
1156
+ */
1157
+ measureLine(lineIndex: number) {
1158
+ const lineInfo = this._measureLine(lineIndex);
1159
+ if (this.charSpacing !== 0) {
1160
+ lineInfo.width -= this._getWidthOfCharSpacing();
1161
+ }
1162
+ if (lineInfo.width < 0) {
1163
+ lineInfo.width = 0;
1164
+ }
1165
+ return lineInfo;
1166
+ }
1167
+
1168
+ /**
1169
+ * measure every grapheme of a line, populating __charBounds
1170
+ * @param {Number} lineIndex
1171
+ * @return {Object} object.width total width of characters
1172
+ * @return {Object} object.numOfSpaces length of chars that match this._reSpacesAndTabs
1173
+ */
1174
+ _measureLine(lineIndex: number) {
1175
+ let width = 0,
1176
+ prevGrapheme: string | undefined,
1177
+ graphemeInfo: GraphemeBBox | undefined;
1178
+
1179
+ const reverse = this.pathSide === RIGHT,
1180
+ path = this.path,
1181
+ line = this._textLines[lineIndex],
1182
+ llength = line.length,
1183
+ lineBounds = new Array<GraphemeBBox>(llength);
1184
+
1185
+ this.__charBounds[lineIndex] = lineBounds;
1186
+ for (let i = 0; i < llength; i++) {
1187
+ const grapheme = line[i];
1188
+ graphemeInfo = this._getGraphemeBox(grapheme, lineIndex, i, prevGrapheme);
1189
+ lineBounds[i] = graphemeInfo;
1190
+ width += graphemeInfo.kernedWidth;
1191
+ prevGrapheme = grapheme;
1192
+ }
1193
+ // this latest bound box represent the last character of the line
1194
+ // to simplify cursor handling in interactive mode.
1195
+ lineBounds[llength] = {
1196
+ left: graphemeInfo ? graphemeInfo.left + graphemeInfo.width : 0,
1197
+ width: 0,
1198
+ kernedWidth: 0,
1199
+ height: this.fontSize,
1200
+ deltaY: 0,
1201
+ } as GraphemeBBox;
1202
+ if (path && path.segmentsInfo) {
1203
+ let positionInPath = 0;
1204
+ const totalPathLength =
1205
+ path.segmentsInfo[path.segmentsInfo.length - 1].length;
1206
+ switch (this.textAlign) {
1207
+ case LEFT:
1208
+ positionInPath = reverse ? totalPathLength - width : 0;
1209
+ break;
1210
+ case CENTER:
1211
+ positionInPath = (totalPathLength - width) / 2;
1212
+ break;
1213
+ case RIGHT:
1214
+ positionInPath = reverse ? 0 : totalPathLength - width;
1215
+ break;
1216
+ //todo - add support for justify
1217
+ }
1218
+ positionInPath += this.pathStartOffset * (reverse ? -1 : 1);
1219
+ for (
1220
+ let i = reverse ? llength - 1 : 0;
1221
+ reverse ? i >= 0 : i < llength;
1222
+ reverse ? i-- : i++
1223
+ ) {
1224
+ graphemeInfo = lineBounds[i];
1225
+ if (positionInPath > totalPathLength) {
1226
+ positionInPath %= totalPathLength;
1227
+ } else if (positionInPath < 0) {
1228
+ positionInPath += totalPathLength;
1229
+ }
1230
+ // it would probably much faster to send all the grapheme position for a line
1231
+ // and calculate path position/angle at once.
1232
+ this._setGraphemeOnPath(positionInPath, graphemeInfo);
1233
+ positionInPath += graphemeInfo.kernedWidth;
1234
+ }
1235
+ }
1236
+ return { width: width, numOfSpaces: 0 };
1237
+ }
1238
+
1239
+ /**
1240
+ * Calculate the angle and the left,top position of the char that follow a path.
1241
+ * It appends it to graphemeInfo to be reused later at rendering
1242
+ * @private
1243
+ * @param {Number} positionInPath to be measured
1244
+ * @param {GraphemeBBox} graphemeInfo current grapheme box information
1245
+ * @param {Object} startingPoint position of the point
1246
+ */
1247
+ _setGraphemeOnPath(positionInPath: number, graphemeInfo: GraphemeBBox) {
1248
+ const centerPosition = positionInPath + graphemeInfo.kernedWidth / 2,
1249
+ path = this.path!;
1250
+
1251
+ // we are at currentPositionOnPath. we want to know what point on the path is.
1252
+ const info = getPointOnPath(path.path, centerPosition, path.segmentsInfo)!;
1253
+ graphemeInfo.renderLeft = info.x - path.pathOffset.x;
1254
+ graphemeInfo.renderTop = info.y - path.pathOffset.y;
1255
+ graphemeInfo.angle = info.angle + (this.pathSide === RIGHT ? Math.PI : 0);
1256
+ }
1257
+
1258
+ /**
1259
+ *
1260
+ * @param {String} grapheme to be measured
1261
+ * @param {Number} lineIndex index of the line where the char is
1262
+ * @param {Number} charIndex position in the line
1263
+ * @param {String} [prevGrapheme] character preceding the one to be measured
1264
+ * @returns {GraphemeBBox} grapheme bbox
1265
+ */
1266
+ _getGraphemeBox(
1267
+ grapheme: string,
1268
+ lineIndex: number,
1269
+ charIndex: number,
1270
+ prevGrapheme?: string,
1271
+ skipLeft?: boolean,
1272
+ ): GraphemeBBox {
1273
+ const style = this.getCompleteStyleDeclaration(lineIndex, charIndex),
1274
+ prevStyle = prevGrapheme
1275
+ ? this.getCompleteStyleDeclaration(lineIndex, charIndex - 1)
1276
+ : {},
1277
+ info = this._measureChar(grapheme, style, prevGrapheme, prevStyle);
1278
+ let kernedWidth = info.kernedWidth,
1279
+ width = info.width,
1280
+ charSpacing;
1281
+
1282
+ if (this.charSpacing !== 0) {
1283
+ charSpacing = this._getWidthOfCharSpacing();
1284
+ width += charSpacing;
1285
+ kernedWidth += charSpacing;
1286
+ }
1287
+
1288
+ const box: GraphemeBBox = {
1289
+ width,
1290
+ left: 0,
1291
+ height: style.fontSize,
1292
+ kernedWidth,
1293
+ deltaY: style.deltaY,
1294
+ };
1295
+ if (charIndex > 0 && !skipLeft) {
1296
+ const previousBox = this.__charBounds[lineIndex][charIndex - 1];
1297
+ box.left =
1298
+ previousBox.left + previousBox.width + info.kernedWidth - info.width;
1299
+ }
1300
+ return box;
1301
+ }
1302
+
1303
+ /**
1304
+ * Calculate height of line at 'lineIndex'
1305
+ * @param {Number} lineIndex index of line to calculate
1306
+ * @return {Number}
1307
+ */
1308
+ getHeightOfLine(lineIndex: number): number {
1309
+ if (this.__lineHeights[lineIndex]) {
1310
+ return this.__lineHeights[lineIndex];
1311
+ }
1312
+
1313
+ // char 0 is measured before the line cycle because it needs to char
1314
+ // emptylines
1315
+ let maxHeight = this.getHeightOfChar(lineIndex, 0);
1316
+ for (let i = 1, len = this._textLines[lineIndex].length; i < len; i++) {
1317
+ maxHeight = Math.max(this.getHeightOfChar(lineIndex, i), maxHeight);
1318
+ }
1319
+
1320
+ return (this.__lineHeights[lineIndex] =
1321
+ maxHeight * this.lineHeight * this._fontSizeMult);
1322
+ }
1323
+
1324
+ /**
1325
+ * Calculate text box height
1326
+ */
1327
+ calcTextHeight() {
1328
+ let lineHeight,
1329
+ height = 0;
1330
+ for (let i = 0, len = this._textLines.length; i < len; i++) {
1331
+ lineHeight = this.getHeightOfLine(i);
1332
+ height += i === len - 1 ? lineHeight / this.lineHeight : lineHeight;
1333
+ }
1334
+ return height;
1335
+ }
1336
+
1337
+ /**
1338
+ * @private
1339
+ * @return {Number} Left offset
1340
+ */
1341
+ _getLeftOffset(): number {
1342
+ return this.direction === 'ltr' ? -this.width / 2 : this.width / 2;
1343
+ }
1344
+
1345
+ /**
1346
+ * @private
1347
+ * @return {Number} Top offset
1348
+ */
1349
+ _getTopOffset(): number {
1350
+ return -this.height / 2;
1351
+ }
1352
+
1353
+ /**
1354
+ * @private
1355
+ * @param {CanvasRenderingContext2D} ctx Context to render on
1356
+ * @param {String} method Method name ("fillText" or "strokeText")
1357
+ */
1358
+ _renderTextCommon(
1359
+ ctx: CanvasRenderingContext2D,
1360
+ method: 'fillText' | 'strokeText',
1361
+ ) {
1362
+ ctx.save();
1363
+ let lineHeights = 0;
1364
+ const left = this._getLeftOffset(),
1365
+ top = this._getTopOffset();
1366
+ for (let i = 0, len = this._textLines.length; i < len; i++) {
1367
+ const heightOfLine = this.getHeightOfLine(i),
1368
+ maxHeight = heightOfLine / this.lineHeight,
1369
+ leftOffset = this._getLineLeftOffset(i);
1370
+ this._renderTextLine(
1371
+ method,
1372
+ ctx,
1373
+ this._textLines[i],
1374
+ left + leftOffset,
1375
+ top + lineHeights + maxHeight,
1376
+ i,
1377
+ );
1378
+ lineHeights += heightOfLine;
1379
+ }
1380
+ ctx.restore();
1381
+ }
1382
+
1383
+ /**
1384
+ * @private
1385
+ * @param {CanvasRenderingContext2D} ctx Context to render on
1386
+ */
1387
+ _renderTextFill(ctx: CanvasRenderingContext2D) {
1388
+ if (!this.fill && !this.styleHas(FILL)) {
1389
+ return;
1390
+ }
1391
+
1392
+ this._renderTextCommon(ctx, 'fillText');
1393
+ }
1394
+
1395
+ /**
1396
+ * @private
1397
+ * @param {CanvasRenderingContext2D} ctx Context to render on
1398
+ */
1399
+ _renderTextStroke(ctx: CanvasRenderingContext2D) {
1400
+ if ((!this.stroke || this.strokeWidth === 0) && this.isEmptyStyles()) {
1401
+ return;
1402
+ }
1403
+
1404
+ if (this.shadow && !this.shadow.affectStroke) {
1405
+ this._removeShadow(ctx);
1406
+ }
1407
+
1408
+ ctx.save();
1409
+ this._setLineDash(ctx, this.strokeDashArray);
1410
+ ctx.beginPath();
1411
+ this._renderTextCommon(ctx, 'strokeText');
1412
+ ctx.closePath();
1413
+ ctx.restore();
1414
+ }
1415
+
1416
+ /**
1417
+ * @private
1418
+ * @param {String} method fillText or strokeText.
1419
+ * @param {CanvasRenderingContext2D} ctx Context to render on
1420
+ * @param {Array} line Content of the line, splitted in an array by grapheme
1421
+ * @param {Number} left
1422
+ * @param {Number} top
1423
+ * @param {Number} lineIndex
1424
+ */
1425
+ _renderChars(
1426
+ method: 'fillText' | 'strokeText',
1427
+ ctx: CanvasRenderingContext2D,
1428
+ line: Array<any>,
1429
+ left: number,
1430
+ top: number,
1431
+ lineIndex: number,
1432
+ ) {
1433
+ const lineHeight = this.getHeightOfLine(lineIndex),
1434
+ isJustify = this.textAlign.includes(JUSTIFY),
1435
+ path = this.path,
1436
+ shortCut =
1437
+ !isJustify &&
1438
+ this.charSpacing === 0 &&
1439
+ this.isEmptyStyles(lineIndex) &&
1440
+ !path,
1441
+ isLtr = this.direction === 'ltr',
1442
+ sign = this.direction === 'ltr' ? 1 : -1,
1443
+ // this was changed in the PR #7674
1444
+ // currentDirection = ctx.canvas.getAttribute('dir');
1445
+ currentDirection = ctx.direction;
1446
+
1447
+ let actualStyle,
1448
+ nextStyle,
1449
+ charsToRender = '',
1450
+ charBox,
1451
+ boxWidth = 0,
1452
+ timeToRender,
1453
+ drawingLeft;
1454
+
1455
+ ctx.save();
1456
+ if (currentDirection !== this.direction) {
1457
+ ctx.canvas.setAttribute('dir', isLtr ? 'ltr' : 'rtl');
1458
+ ctx.direction = isLtr ? 'ltr' : 'rtl';
1459
+
1460
+ // For justify alignments, we need to set the correct canvas text alignment
1461
+ // This is crucial for RTL text to render in the correct order
1462
+ if (isJustify) {
1463
+ // Justify uses LEFT alignment as a base, letting the character positioning handle justification
1464
+ ctx.textAlign = LEFT;
1465
+ } else {
1466
+ ctx.textAlign = isLtr ? LEFT : RIGHT;
1467
+ }
1468
+ }
1469
+ top -= (lineHeight * this._fontSizeFraction) / this.lineHeight;
1470
+ if (shortCut) {
1471
+ // render all the line in one pass without checking
1472
+ // drawingLeft = isLtr ? left : left - this.getLineWidth(lineIndex);
1473
+ this._renderChar(method, ctx, lineIndex, 0, line.join(''), left, top);
1474
+ ctx.restore();
1475
+ return;
1476
+ }
1477
+ for (let i = 0, len = line.length - 1; i <= len; i++) {
1478
+ timeToRender = i === len || this.charSpacing || path;
1479
+ charsToRender += line[i];
1480
+ charBox = this.__charBounds[lineIndex][i] as Required<GraphemeBBox>;
1481
+ if (boxWidth === 0) {
1482
+ left += sign * (charBox.kernedWidth - charBox.width);
1483
+ boxWidth += charBox.width;
1484
+ } else {
1485
+ boxWidth += charBox.kernedWidth;
1486
+ }
1487
+ if (isJustify && !timeToRender) {
1488
+ if (this._reSpaceAndTab.test(line[i])) {
1489
+ timeToRender = true;
1490
+ }
1491
+ }
1492
+ if (!timeToRender) {
1493
+ // if we have charSpacing, we render char by char
1494
+ actualStyle =
1495
+ actualStyle || this.getCompleteStyleDeclaration(lineIndex, i);
1496
+ nextStyle = this.getCompleteStyleDeclaration(lineIndex, i + 1);
1497
+ timeToRender = hasStyleChanged(actualStyle, nextStyle, false);
1498
+ }
1499
+ if (timeToRender) {
1500
+ if (path) {
1501
+ ctx.save();
1502
+ ctx.translate(charBox.renderLeft, charBox.renderTop);
1503
+ ctx.rotate(charBox.angle);
1504
+ this._renderChar(
1505
+ method,
1506
+ ctx,
1507
+ lineIndex,
1508
+ i,
1509
+ charsToRender,
1510
+ -boxWidth / 2,
1511
+ 0,
1512
+ );
1513
+ ctx.restore();
1514
+ } else {
1515
+ drawingLeft = left;
1516
+ this._renderChar(
1517
+ method,
1518
+ ctx,
1519
+ lineIndex,
1520
+ i,
1521
+ charsToRender,
1522
+ drawingLeft,
1523
+ top,
1524
+ );
1525
+ }
1526
+ charsToRender = '';
1527
+ actualStyle = nextStyle;
1528
+ left += sign * boxWidth;
1529
+ boxWidth = 0;
1530
+ }
1531
+ }
1532
+ ctx.restore();
1533
+ }
1534
+
1535
+ /**
1536
+ * This function try to patch the missing gradientTransform on canvas gradients.
1537
+ * transforming a context to transform the gradient, is going to transform the stroke too.
1538
+ * we want to transform the gradient but not the stroke operation, so we create
1539
+ * a transformed gradient on a pattern and then we use the pattern instead of the gradient.
1540
+ * this method has drawbacks: is slow, is in low resolution, needs a patch for when the size
1541
+ * is limited.
1542
+ * @private
1543
+ * @param {TFiller} filler a fabric gradient instance
1544
+ * @return {CanvasPattern} a pattern to use as fill/stroke style
1545
+ */
1546
+ _applyPatternGradientTransformText(filler: TFiller) {
1547
+ // TODO: verify compatibility with strokeUniform
1548
+ const width = this.width + this.strokeWidth,
1549
+ height = this.height + this.strokeWidth,
1550
+ pCanvas = createCanvasElementFor({
1551
+ width,
1552
+ height,
1553
+ }),
1554
+ pCtx = pCanvas.getContext('2d')!;
1555
+ pCanvas.width = width;
1556
+ pCanvas.height = height;
1557
+ pCtx.beginPath();
1558
+ pCtx.moveTo(0, 0);
1559
+ pCtx.lineTo(width, 0);
1560
+ pCtx.lineTo(width, height);
1561
+ pCtx.lineTo(0, height);
1562
+ pCtx.closePath();
1563
+ pCtx.translate(width / 2, height / 2);
1564
+ pCtx.fillStyle = filler.toLive(pCtx)!;
1565
+ this._applyPatternGradientTransform(pCtx, filler);
1566
+ pCtx.fill();
1567
+ return pCtx.createPattern(pCanvas, 'no-repeat')!;
1568
+ }
1569
+
1570
+ handleFiller<T extends 'fill' | 'stroke'>(
1571
+ ctx: CanvasRenderingContext2D,
1572
+ property: `${T}Style`,
1573
+ filler: TFiller | string,
1574
+ ): { offsetX: number; offsetY: number } {
1575
+ let offsetX: number, offsetY: number;
1576
+ if (isFiller(filler)) {
1577
+ if (
1578
+ (filler as Gradient<'linear'>).gradientUnits === 'percentage' ||
1579
+ (filler as Gradient<'linear'>).gradientTransform ||
1580
+ (filler as Pattern).patternTransform
1581
+ ) {
1582
+ // need to transform gradient in a pattern.
1583
+ // this is a slow process. If you are hitting this codepath, and the object
1584
+ // is not using caching, you should consider switching it on.
1585
+ // we need a canvas as big as the current object caching canvas.
1586
+ offsetX = -this.width / 2;
1587
+ offsetY = -this.height / 2;
1588
+ ctx.translate(offsetX, offsetY);
1589
+ ctx[property] = this._applyPatternGradientTransformText(filler);
1590
+ return { offsetX, offsetY };
1591
+ } else {
1592
+ // is a simple gradient or pattern
1593
+ ctx[property] = filler.toLive(ctx)!;
1594
+ return this._applyPatternGradientTransform(ctx, filler);
1595
+ }
1596
+ } else {
1597
+ // is a color
1598
+ ctx[property] = filler;
1599
+ }
1600
+ return { offsetX: 0, offsetY: 0 };
1601
+ }
1602
+
1603
+ /**
1604
+ * This function prepare the canvas for a stroke style, and stroke and strokeWidth
1605
+ * need to be sent in as defined
1606
+ * @param {CanvasRenderingContext2D} ctx
1607
+ * @param {CompleteTextStyleDeclaration} style with stroke and strokeWidth defined
1608
+ * @returns
1609
+ */
1610
+ _setStrokeStyles(
1611
+ ctx: CanvasRenderingContext2D,
1612
+ {
1613
+ stroke,
1614
+ strokeWidth,
1615
+ }: Pick<CompleteTextStyleDeclaration, 'stroke' | 'strokeWidth'>,
1616
+ ) {
1617
+ ctx.lineWidth = strokeWidth;
1618
+ ctx.lineCap = this.strokeLineCap;
1619
+ ctx.lineDashOffset = this.strokeDashOffset;
1620
+ ctx.lineJoin = this.strokeLineJoin;
1621
+ ctx.miterLimit = this.strokeMiterLimit;
1622
+ return this.handleFiller(ctx, 'strokeStyle', stroke!);
1623
+ }
1624
+
1625
+ /**
1626
+ * This function prepare the canvas for a ill style, and fill
1627
+ * need to be sent in as defined
1628
+ * @param {CanvasRenderingContext2D} ctx
1629
+ * @param {CompleteTextStyleDeclaration} style with ill defined
1630
+ * @returns
1631
+ */
1632
+ _setFillStyles(ctx: CanvasRenderingContext2D, { fill }: Pick<this, 'fill'>) {
1633
+ return this.handleFiller(ctx, 'fillStyle', fill!);
1634
+ }
1635
+
1636
+ /**
1637
+ * @private
1638
+ * @param {String} method
1639
+ * @param {CanvasRenderingContext2D} ctx Context to render on
1640
+ * @param {Number} lineIndex
1641
+ * @param {Number} charIndex
1642
+ * @param {String} _char
1643
+ * @param {Number} left Left coordinate
1644
+ * @param {Number} top Top coordinate
1645
+ * @param {Number} lineHeight Height of the line
1646
+ */
1647
+ _renderChar(
1648
+ method: 'fillText' | 'strokeText',
1649
+ ctx: CanvasRenderingContext2D,
1650
+ lineIndex: number,
1651
+ charIndex: number,
1652
+ _char: string,
1653
+ left: number,
1654
+ top: number,
1655
+ ) {
1656
+ const decl = this._getStyleDeclaration(lineIndex, charIndex),
1657
+ fullDecl = this.getCompleteStyleDeclaration(lineIndex, charIndex),
1658
+ shouldFill = method === 'fillText' && fullDecl.fill,
1659
+ shouldStroke =
1660
+ method === 'strokeText' && fullDecl.stroke && fullDecl.strokeWidth;
1661
+
1662
+ if (!shouldStroke && !shouldFill) {
1663
+ return;
1664
+ }
1665
+ ctx.save();
1666
+
1667
+ ctx.font = this._getFontDeclaration(fullDecl);
1668
+
1669
+ if (decl.textBackgroundColor) {
1670
+ this._removeShadow(ctx);
1671
+ }
1672
+ if (decl.deltaY) {
1673
+ top += decl.deltaY;
1674
+ }
1675
+
1676
+ if (shouldFill) {
1677
+ const fillOffsets = this._setFillStyles(ctx, fullDecl);
1678
+ ctx.fillText(
1679
+ _char,
1680
+ left - fillOffsets.offsetX,
1681
+ top - fillOffsets.offsetY,
1682
+ );
1683
+ }
1684
+
1685
+ if (shouldStroke) {
1686
+ const strokeOffsets = this._setStrokeStyles(ctx, fullDecl);
1687
+ ctx.strokeText(
1688
+ _char,
1689
+ left - strokeOffsets.offsetX,
1690
+ top - strokeOffsets.offsetY,
1691
+ );
1692
+ }
1693
+
1694
+ ctx.restore();
1695
+ }
1696
+
1697
+ /**
1698
+ * Turns the character into a 'superior figure' (i.e. 'superscript')
1699
+ * @param {Number} start selection start
1700
+ * @param {Number} end selection end
1701
+ */
1702
+ setSuperscript(start: number, end: number) {
1703
+ this._setScript(start, end, this.superscript);
1704
+ }
1705
+
1706
+ /**
1707
+ * Turns the character into an 'inferior figure' (i.e. 'subscript')
1708
+ * @param {Number} start selection start
1709
+ * @param {Number} end selection end
1710
+ */
1711
+ setSubscript(start: number, end: number) {
1712
+ this._setScript(start, end, this.subscript);
1713
+ }
1714
+
1715
+ /**
1716
+ * Applies 'schema' at given position
1717
+ * @private
1718
+ * @param {Number} start selection start
1719
+ * @param {Number} end selection end
1720
+ * @param {Number} schema
1721
+ */
1722
+ protected _setScript(
1723
+ start: number,
1724
+ end: number,
1725
+ schema: {
1726
+ size: number;
1727
+ baseline: number;
1728
+ },
1729
+ ) {
1730
+ const loc = this.get2DCursorLocation(start, true),
1731
+ fontSize = this.getValueOfPropertyAt(
1732
+ loc.lineIndex,
1733
+ loc.charIndex,
1734
+ 'fontSize',
1735
+ ),
1736
+ dy = this.getValueOfPropertyAt(loc.lineIndex, loc.charIndex, 'deltaY'),
1737
+ style = {
1738
+ fontSize: fontSize * schema.size,
1739
+ deltaY: dy + fontSize * schema.baseline,
1740
+ };
1741
+ this.setSelectionStyles(style, start, end);
1742
+ }
1743
+
1744
+ /**
1745
+ * @private
1746
+ * @param {Number} lineIndex index text line
1747
+ * @return {Number} Line left offset
1748
+ */
1749
+ _getLineLeftOffset(lineIndex: number): number {
1750
+ const lineWidth = this.getLineWidth(lineIndex),
1751
+ lineDiff = this.width - lineWidth,
1752
+ textAlign = this.textAlign,
1753
+ direction = this.direction,
1754
+ isEndOfWrapping = this.isEndOfWrapping(lineIndex);
1755
+ let leftOffset = 0;
1756
+
1757
+ // Handle justify alignments (excluding last lines and wrapped line ends)
1758
+ const isJustifyLine =
1759
+ textAlign === JUSTIFY ||
1760
+ (textAlign === JUSTIFY_CENTER && !isEndOfWrapping) ||
1761
+ (textAlign === JUSTIFY_RIGHT && !isEndOfWrapping) ||
1762
+ (textAlign === JUSTIFY_LEFT && !isEndOfWrapping);
1763
+
1764
+ if (isJustifyLine) {
1765
+ // Justify lines should start at the left edge for LTR and right edge for RTL
1766
+ // The space distribution is handled by enlargeSpaces()
1767
+ if (direction === 'rtl') {
1768
+ // For RTL justify, we need to account for the line being right-aligned
1769
+ return 0;
1770
+ } else {
1771
+ return 0;
1772
+ }
1773
+ }
1774
+
1775
+ // Handle non-justify alignments
1776
+ if (textAlign === CENTER) {
1777
+ leftOffset = lineDiff / 2;
1778
+ }
1779
+ if (textAlign === RIGHT) {
1780
+ leftOffset = lineDiff;
1781
+ }
1782
+ if (textAlign === JUSTIFY_CENTER) {
1783
+ leftOffset = lineDiff / 2;
1784
+ }
1785
+ if (textAlign === JUSTIFY_RIGHT) {
1786
+ leftOffset = lineDiff;
1787
+ }
1788
+
1789
+ // Apply RTL adjustments for non-justify alignments
1790
+ if (direction === 'rtl') {
1791
+ if (
1792
+ textAlign === RIGHT ||
1793
+ textAlign === JUSTIFY ||
1794
+ textAlign === JUSTIFY_RIGHT
1795
+ ) {
1796
+ leftOffset = 0;
1797
+ } else if (textAlign === LEFT || textAlign === JUSTIFY_LEFT) {
1798
+ leftOffset = -lineDiff;
1799
+ } else if (textAlign === CENTER || textAlign === JUSTIFY_CENTER) {
1800
+ leftOffset = -lineDiff / 2;
1801
+ }
1802
+ }
1803
+ return leftOffset;
1804
+ }
1805
+
1806
+ /**
1807
+ * @private
1808
+ */
1809
+ _clearCache() {
1810
+ this._forceClearCache = false;
1811
+ this.__lineWidths = [];
1812
+ this.__lineHeights = [];
1813
+ this.__charBounds = [];
1814
+ }
1815
+
1816
+ /**
1817
+ * Measure a single line given its index. Used to calculate the initial
1818
+ * text bounding box. The values are calculated and stored in __lineWidths cache.
1819
+ * @private
1820
+ * @param {Number} lineIndex line number
1821
+ * @return {Number} Line width
1822
+ */
1823
+ getLineWidth(lineIndex: number): number {
1824
+ if (this.__lineWidths[lineIndex] !== undefined) {
1825
+ return this.__lineWidths[lineIndex];
1826
+ }
1827
+
1828
+ const { width } = this.measureLine(lineIndex);
1829
+ this.__lineWidths[lineIndex] = width;
1830
+ return width;
1831
+ }
1832
+
1833
+ _getWidthOfCharSpacing() {
1834
+ if (this.charSpacing !== 0) {
1835
+ return (this.fontSize * this.charSpacing) / 1000;
1836
+ }
1837
+ return 0;
1838
+ }
1839
+
1840
+ /**
1841
+ * Retrieves the value of property at given character position
1842
+ * @param {Number} lineIndex the line number
1843
+ * @param {Number} charIndex the character number
1844
+ * @param {String} property the property name
1845
+ * @returns the value of 'property'
1846
+ */
1847
+ getValueOfPropertyAt<T extends StylePropertiesType>(
1848
+ lineIndex: number,
1849
+ charIndex: number,
1850
+ property: T,
1851
+ ): this[T] {
1852
+ const charStyle = this._getStyleDeclaration(lineIndex, charIndex);
1853
+ return (charStyle[property] ?? this[property]) as this[T];
1854
+ }
1855
+
1856
+ /**
1857
+ * @private
1858
+ * @param {CanvasRenderingContext2D} ctx Context to render on
1859
+ */
1860
+ _renderTextDecoration(
1861
+ ctx: CanvasRenderingContext2D,
1862
+ type: 'underline' | 'linethrough' | 'overline',
1863
+ ) {
1864
+ if (!this[type] && !this.styleHas(type)) {
1865
+ return;
1866
+ }
1867
+ let topOffset = this._getTopOffset();
1868
+ const leftOffset = this._getLeftOffset(),
1869
+ path = this.path,
1870
+ charSpacing = this._getWidthOfCharSpacing(),
1871
+ offsetAligner =
1872
+ type === 'linethrough' ? 0.5 : type === 'overline' ? 1 : 0,
1873
+ offsetY = this.offsets[type];
1874
+ for (let i = 0, len = this._textLines.length; i < len; i++) {
1875
+ const heightOfLine = this.getHeightOfLine(i);
1876
+ if (!this[type] && !this.styleHas(type, i)) {
1877
+ topOffset += heightOfLine;
1878
+ continue;
1879
+ }
1880
+ const line = this._textLines[i];
1881
+ const maxHeight = heightOfLine / this.lineHeight;
1882
+ const lineLeftOffset = this._getLineLeftOffset(i);
1883
+ let boxStart = 0;
1884
+ let boxWidth = 0;
1885
+ let lastDecoration = this.getValueOfPropertyAt(i, 0, type);
1886
+ let lastFill = this.getValueOfPropertyAt(i, 0, FILL);
1887
+ let lastTickness = this.getValueOfPropertyAt(
1888
+ i,
1889
+ 0,
1890
+ TEXT_DECORATION_THICKNESS,
1891
+ );
1892
+ let currentDecoration = lastDecoration;
1893
+ let currentFill = lastFill;
1894
+ let currentTickness = lastTickness;
1895
+ const top = topOffset + maxHeight * (1 - this._fontSizeFraction);
1896
+ let size = this.getHeightOfChar(i, 0);
1897
+ let dy = this.getValueOfPropertyAt(i, 0, 'deltaY');
1898
+ for (let j = 0, jlen = line.length; j < jlen; j++) {
1899
+ const charBox = this.__charBounds[i][j] as Required<GraphemeBBox>;
1900
+ currentDecoration = this.getValueOfPropertyAt(i, j, type);
1901
+ currentFill = this.getValueOfPropertyAt(i, j, FILL);
1902
+ currentTickness = this.getValueOfPropertyAt(
1903
+ i,
1904
+ j,
1905
+ TEXT_DECORATION_THICKNESS,
1906
+ );
1907
+ const currentSize = this.getHeightOfChar(i, j);
1908
+ const currentDy = this.getValueOfPropertyAt(i, j, 'deltaY');
1909
+ if (path && currentDecoration && currentFill) {
1910
+ const finalTickness = (this.fontSize * currentTickness) / 1000;
1911
+ ctx.save();
1912
+ // bug? verify lastFill is a valid fill here.
1913
+ ctx.fillStyle = lastFill as string;
1914
+ ctx.translate(charBox.renderLeft, charBox.renderTop);
1915
+ ctx.rotate(charBox.angle);
1916
+ ctx.fillRect(
1917
+ -charBox.kernedWidth / 2,
1918
+ offsetY * currentSize + currentDy - offsetAligner * finalTickness,
1919
+ charBox.kernedWidth,
1920
+ finalTickness,
1921
+ );
1922
+ ctx.restore();
1923
+ } else if (
1924
+ (currentDecoration !== lastDecoration ||
1925
+ currentFill !== lastFill ||
1926
+ currentSize !== size ||
1927
+ currentTickness !== lastTickness ||
1928
+ currentDy !== dy) &&
1929
+ boxWidth > 0
1930
+ ) {
1931
+ const finalTickness = (this.fontSize * lastTickness) / 1000;
1932
+ let drawStart = leftOffset + lineLeftOffset + boxStart;
1933
+ if (this.direction === 'rtl') {
1934
+ drawStart = this.width - drawStart - boxWidth;
1935
+ }
1936
+ if (lastDecoration && lastFill && lastTickness) {
1937
+ // bug? verify lastFill is a valid fill here.
1938
+ ctx.fillStyle = lastFill as string;
1939
+ ctx.fillRect(
1940
+ drawStart,
1941
+ top + offsetY * size + dy - offsetAligner * finalTickness,
1942
+ boxWidth,
1943
+ finalTickness,
1944
+ );
1945
+ }
1946
+ boxStart = charBox.left;
1947
+ boxWidth = charBox.width;
1948
+ lastDecoration = currentDecoration;
1949
+ lastTickness = currentTickness;
1950
+ lastFill = currentFill;
1951
+ size = currentSize;
1952
+ dy = currentDy;
1953
+ } else {
1954
+ boxWidth += charBox.kernedWidth;
1955
+ }
1956
+ }
1957
+ let drawStart = leftOffset + lineLeftOffset + boxStart;
1958
+ if (this.direction === 'rtl') {
1959
+ drawStart = this.width - drawStart - boxWidth;
1960
+ }
1961
+ ctx.fillStyle = currentFill as string;
1962
+ const finalTickness = (this.fontSize * currentTickness) / 1000;
1963
+ currentDecoration &&
1964
+ currentFill &&
1965
+ currentTickness &&
1966
+ ctx.fillRect(
1967
+ drawStart,
1968
+ top + offsetY * size + dy - offsetAligner * finalTickness,
1969
+ boxWidth - charSpacing,
1970
+ finalTickness,
1971
+ );
1972
+ topOffset += heightOfLine;
1973
+ }
1974
+ // if there is text background color no
1975
+ // other shadows should be casted
1976
+ this._removeShadow(ctx);
1977
+ }
1978
+
1979
+ /**
1980
+ * return font declaration string for canvas context
1981
+ * @param {Object} [styleObject] object
1982
+ * @returns {String} font declaration formatted for canvas context.
1983
+ */
1984
+ _getFontDeclaration(
1985
+ {
1986
+ fontFamily = this.fontFamily,
1987
+ fontStyle = this.fontStyle,
1988
+ fontWeight = this.fontWeight,
1989
+ fontSize = this.fontSize,
1990
+ }: Partial<
1991
+ Pick<
1992
+ TextStyleDeclaration,
1993
+ 'fontFamily' | 'fontStyle' | 'fontWeight' | 'fontSize'
1994
+ >
1995
+ > = {},
1996
+ forMeasuring?: boolean,
1997
+ ): string {
1998
+ let parsedFontFamily =
1999
+ fontFamily.includes("'") ||
2000
+ fontFamily.includes('"') ||
2001
+ fontFamily.includes(',') ||
2002
+ FabricText.genericFonts.includes(fontFamily.toLowerCase())
2003
+ ? fontFamily
2004
+ : `"${fontFamily}"`;
2005
+
2006
+ // For fonts like STV that don't support English/Latin characters,
2007
+ // add fallback fonts for consistent rendering of unsupported characters
2008
+ // Only add fallbacks during actual rendering, not for measurements
2009
+ if (!forMeasuring && // Only during rendering, not measuring
2010
+ !fontFamily.includes(',') && // Don't add fallbacks if already has them
2011
+ (fontFamily.toLowerCase().includes('stv') ||
2012
+ fontFamily.toLowerCase().includes('arabic') ||
2013
+ fontFamily.toLowerCase().includes('naskh') ||
2014
+ fontFamily.toLowerCase().includes('kufi'))) {
2015
+ // Add fallback fonts for unsupported characters (spaces, punctuation, etc.)
2016
+ parsedFontFamily = `${parsedFontFamily}, "Arial Unicode MS", Arial, sans-serif`;
2017
+ }
2018
+
2019
+ return [
2020
+ fontStyle,
2021
+ fontWeight,
2022
+ `${forMeasuring ? this.CACHE_FONT_SIZE : fontSize}px`,
2023
+ parsedFontFamily,
2024
+ ].join(' ');
2025
+ }
2026
+
2027
+ /**
2028
+ * Renders text instance on a specified context
2029
+ * @param {CanvasRenderingContext2D} ctx Context to render on
2030
+ */
2031
+ render(ctx: CanvasRenderingContext2D) {
2032
+ if (!this.visible) {
2033
+ return;
2034
+ }
2035
+ if (
2036
+ this.canvas &&
2037
+ this.canvas.skipOffscreen &&
2038
+ !this.group &&
2039
+ !this.isOnScreen()
2040
+ ) {
2041
+ return;
2042
+ }
2043
+ if (this._forceClearCache) {
2044
+ this.initDimensions();
2045
+ }
2046
+ super.render(ctx);
2047
+ }
2048
+
2049
+ /**
2050
+ * Override this method to customize grapheme splitting
2051
+ * @todo the util `graphemeSplit` needs to be injectable in some way.
2052
+ * is more comfortable to inject the correct util rather than having to override text
2053
+ * in the middle of the prototype chain
2054
+ * @param {string} value
2055
+ * @returns {string[]} array of graphemes
2056
+ */
2057
+ graphemeSplit(value: string): string[] {
2058
+ return graphemeSplit(value);
2059
+ }
2060
+
2061
+ /**
2062
+ * Returns the text as an array of lines.
2063
+ * @param {String} text text to split
2064
+ * @returns Lines in the text
2065
+ */
2066
+ _splitTextIntoLines(text: string): TextLinesInfo {
2067
+ const lines = text.split(this._reNewline),
2068
+ newLines = new Array<string[]>(lines.length),
2069
+ newLine = ['\n'];
2070
+ let newText: string[] = [];
2071
+ for (let i = 0; i < lines.length; i++) {
2072
+ // Use BiDi-aware grapheme splitting for RTL text
2073
+ if (this.direction === 'rtl' || this._containsArabicText(lines[i])) {
2074
+ newLines[i] = segmentGraphemes(lines[i]);
2075
+ console.log(`🔤 BiDi-aware split line ${i}: "${lines[i]}" -> [${newLines[i].join(', ')}]`);
2076
+ } else {
2077
+ newLines[i] = this.graphemeSplit(lines[i]);
2078
+ }
2079
+ newText = newText.concat(newLines[i], newLine);
2080
+ }
2081
+ newText.pop();
2082
+ return {
2083
+ _unwrappedLines: newLines,
2084
+ lines: lines,
2085
+ graphemeText: newText,
2086
+ graphemeLines: newLines,
2087
+ };
2088
+ }
2089
+
2090
+ /**
2091
+ * Check if text contains Arabic characters
2092
+ * @private
2093
+ */
2094
+ _containsArabicText(text: string): boolean {
2095
+ return /[\u0600-\u06FF\u0750-\u077F\uFB50-\uFDFF\uFE70-\uFEFF]/.test(text);
2096
+ }
2097
+
2098
+ /**
2099
+ * Returns object representation of an instance
2100
+ * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output
2101
+ * @return {Object} Object representation of an instance
2102
+ */
2103
+ toObject<
2104
+ T extends Omit<Props & TClassProperties<this>, keyof SProps>,
2105
+ K extends keyof T = never,
2106
+ >(propertiesToInclude: K[] = []): Pick<T, K> & SProps {
2107
+ return {
2108
+ ...super.toObject([...additionalProps, ...propertiesToInclude] as K[]),
2109
+ styles: stylesToArray(this.styles, this.text),
2110
+ ...(this.path ? { path: this.path.toObject() } : {}),
2111
+ };
2112
+ }
2113
+
2114
+ set(key: string | any, value?: any) {
2115
+ const { textLayoutProperties } = this.constructor as typeof FabricText;
2116
+ super.set(key, value);
2117
+ let needsDims = false;
2118
+ let isAddingPath = false;
2119
+ if (typeof key === 'object') {
2120
+ for (const _key in key) {
2121
+ if (_key === 'path') {
2122
+ this.setPathInfo();
2123
+ }
2124
+ needsDims = needsDims || textLayoutProperties.includes(_key);
2125
+ isAddingPath = isAddingPath || _key === 'path';
2126
+ }
2127
+ } else {
2128
+ needsDims = textLayoutProperties.includes(key);
2129
+ isAddingPath = key === 'path';
2130
+ }
2131
+ if (isAddingPath) {
2132
+ this.setPathInfo();
2133
+ }
2134
+ if (needsDims && this.initialized) {
2135
+ // Clear browser lines when layout-affecting properties change
2136
+ clearBrowserLines(this);
2137
+ this.initDimensions();
2138
+ this.setCoords();
2139
+ }
2140
+ return this;
2141
+ }
2142
+
2143
+ /**
2144
+ * Returns complexity of an instance
2145
+ * @return {Number} complexity
2146
+ */
2147
+ complexity(): number {
2148
+ return 1;
2149
+ }
2150
+
2151
+ /**
2152
+ * List of generic font families
2153
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name
2154
+ */
2155
+ static genericFonts = [
2156
+ 'serif',
2157
+ 'sans-serif',
2158
+ 'monospace',
2159
+ 'cursive',
2160
+ 'fantasy',
2161
+ 'system-ui',
2162
+ 'ui-serif',
2163
+ 'ui-sans-serif',
2164
+ 'ui-monospace',
2165
+ 'ui-rounded',
2166
+ 'math',
2167
+ 'emoji',
2168
+ 'fangsong',
2169
+ ];
2170
+
2171
+ /* _FROM_SVG_START_ */
2172
+
2173
+ /**
2174
+ * List of attribute names to account for when parsing SVG element (used by {@link FabricText.fromElement})
2175
+ * @see: http://www.w3.org/TR/SVG/text.html#TextElement
2176
+ */
2177
+ static ATTRIBUTE_NAMES = SHARED_ATTRIBUTES.concat(
2178
+ 'x',
2179
+ 'y',
2180
+ 'dx',
2181
+ 'dy',
2182
+ 'font-family',
2183
+ 'font-style',
2184
+ 'font-weight',
2185
+ 'font-size',
2186
+ 'letter-spacing',
2187
+ 'text-decoration',
2188
+ 'text-anchor',
2189
+ );
2190
+
2191
+ /**
2192
+ * Returns FabricText instance from an SVG element (<b>not yet implemented</b>)
2193
+ * @param {HTMLElement} element Element to parse
2194
+ * @param {Object} [options] Options object
2195
+ */
2196
+ static async fromElement(
2197
+ element: HTMLElement | SVGElement,
2198
+ options?: Abortable,
2199
+ cssRules?: CSSRules,
2200
+ ) {
2201
+ const parsedAttributes = parseAttributes(
2202
+ element,
2203
+ FabricText.ATTRIBUTE_NAMES,
2204
+ cssRules,
2205
+ );
2206
+
2207
+ const {
2208
+ textAnchor = LEFT as typeof LEFT | typeof CENTER | typeof RIGHT,
2209
+ textDecoration = '',
2210
+ dx = 0,
2211
+ dy = 0,
2212
+ top = 0,
2213
+ left = 0,
2214
+ fontSize = DEFAULT_SVG_FONT_SIZE,
2215
+ strokeWidth = 1,
2216
+ ...restOfOptions
2217
+ } = { ...options, ...parsedAttributes };
2218
+
2219
+ const textContent = (element.textContent || '')
2220
+ .replace(/^\s+|\s+$|\n+/g, '')
2221
+ .replace(/\s+/g, ' ');
2222
+
2223
+ // this code here is probably the usual issue for SVG center find
2224
+ // this can later looked at again and probably removed.
2225
+
2226
+ const text = new this(textContent, {
2227
+ left: left + dx,
2228
+ top: top + dy,
2229
+ underline: textDecoration.includes('underline'),
2230
+ overline: textDecoration.includes('overline'),
2231
+ linethrough: textDecoration.includes('line-through'),
2232
+ // we initialize this as 0
2233
+ strokeWidth: 0,
2234
+ fontSize,
2235
+ ...restOfOptions,
2236
+ }),
2237
+ textHeightScaleFactor = text.getScaledHeight() / text.height,
2238
+ lineHeightDiff =
2239
+ (text.height + text.strokeWidth) * text.lineHeight - text.height,
2240
+ scaledDiff = lineHeightDiff * textHeightScaleFactor,
2241
+ textHeight = text.getScaledHeight() + scaledDiff;
2242
+
2243
+ let offX = 0;
2244
+ /*
2245
+ Adjust positioning:
2246
+ x/y attributes in SVG correspond to the bottom-left corner of text bounding box
2247
+ fabric output by default at top, left.
2248
+ */
2249
+ if (textAnchor === CENTER) {
2250
+ offX = text.getScaledWidth() / 2;
2251
+ }
2252
+ if (textAnchor === RIGHT) {
2253
+ offX = text.getScaledWidth();
2254
+ }
2255
+ text.set({
2256
+ left: text.left - offX,
2257
+ top:
2258
+ text.top -
2259
+ (textHeight - text.fontSize * (0.07 + text._fontSizeFraction)) /
2260
+ text.lineHeight,
2261
+ strokeWidth,
2262
+ });
2263
+ return text;
2264
+ }
2265
+
2266
+ /* _FROM_SVG_END_ */
2267
+
2268
+ /**
2269
+ * Check if the font is ready for accurate measurements
2270
+ * @private
2271
+ */
2272
+ _isFontReady(): boolean {
2273
+ if (typeof document === 'undefined' || !('fonts' in document)) {
2274
+ return true; // Assume ready in non-browser environments
2275
+ }
2276
+
2277
+ try {
2278
+ return document.fonts.check(`${this.fontSize}px ${this.fontFamily}`);
2279
+ } catch (e) {
2280
+ return true; // Fallback to assuming ready if check fails
2281
+ }
2282
+ }
2283
+
2284
+ /**
2285
+ * Schedule re-initialization after font loads
2286
+ * @private
2287
+ */
2288
+ _scheduleInitAfterFontLoad(): void {
2289
+ if (typeof document === 'undefined' || !('fonts' in document)) {
2290
+ return;
2291
+ }
2292
+
2293
+ // Only schedule if not already waiting
2294
+ if ((this as any)._fontLoadScheduled) {
2295
+ return;
2296
+ }
2297
+ (this as any)._fontLoadScheduled = true;
2298
+
2299
+ const fontSpec = `${this.fontSize}px ${this.fontFamily}`;
2300
+ document.fonts.load(fontSpec).then(() => {
2301
+ (this as any)._fontLoadScheduled = false;
2302
+ // Re-initialize dimensions with proper font metrics
2303
+ this.initDimensions();
2304
+
2305
+ // Extra step for justify alignment after font loading
2306
+ if (this.textAlign && this.textAlign.includes(JUSTIFY)) {
2307
+ setTimeout(() => {
2308
+ if (this.enlargeSpaces) {
2309
+ this.enlargeSpaces();
2310
+ }
2311
+ this.canvas?.requestRenderAll();
2312
+ }, 10);
2313
+ } else {
2314
+ this.canvas?.requestRenderAll();
2315
+ }
2316
+ }).catch(() => {
2317
+ (this as any)._fontLoadScheduled = false;
2318
+ });
2319
+ }
2320
+
2321
+ /**
2322
+ * Force complete text re-initialization (useful after JSON loading)
2323
+ */
2324
+ forceTextReinitialization(): void {
2325
+ console.log('🔄 Force reinitializing text object');
2326
+
2327
+ // Clear all caches
2328
+ this._clearCache();
2329
+ this.dirty = true;
2330
+
2331
+ // Force text splitting to rebuild internal structures
2332
+ this._splitText();
2333
+
2334
+ // Re-initialize dimensions
2335
+ this.initDimensions();
2336
+
2337
+ // Special handling for justify alignment
2338
+ if (this.textAlign && this.textAlign.includes(JUSTIFY)) {
2339
+ // Ensure justify is applied after dimensions are set
2340
+ setTimeout(() => {
2341
+ if (this.__charBounds && this.__charBounds.length > 0 && this.enlargeSpaces) {
2342
+ this.enlargeSpaces();
2343
+ this.canvas?.requestRenderAll();
2344
+ }
2345
+ }, 10);
2346
+ }
2347
+ }
2348
+
2349
+ /**
2350
+ * Returns FabricText instance from an object representation
2351
+ * @param {Object} object plain js Object to create an instance from
2352
+ * @returns {Promise<FabricText>}
2353
+ */
2354
+ static fromObject<
2355
+ T extends TOptions<SerializedTextProps>,
2356
+ S extends FabricText,
2357
+ >(object: T) {
2358
+ return this._fromObject<S>(
2359
+ {
2360
+ ...object,
2361
+ styles: stylesFromArray(object.styles || {}, object.text),
2362
+ },
2363
+ {
2364
+ extraParam: 'text',
2365
+ },
2366
+ ).then((textObject: S) => {
2367
+ // Ensure text object is properly initialized after JSON deserialization
2368
+ // This is critical for justify alignment and other text layout features
2369
+ textObject.initialized = true;
2370
+
2371
+ // Force reinitialization to ensure proper layout
2372
+ if (textObject._clearCache) {
2373
+ textObject._clearCache();
2374
+ }
2375
+ textObject.dirty = true;
2376
+
2377
+ // Check if we need to wait for font loading (especially for custom fonts like STV)
2378
+ const fontSpec = `${textObject.fontSize}px ${textObject.fontFamily}`;
2379
+
2380
+ // For custom fonts, ensure they're loaded before initializing dimensions
2381
+ if (typeof document !== 'undefined' && 'fonts' in document && textObject.fontFamily !== 'Arial' && textObject.fontFamily !== 'Times New Roman') {
2382
+ return document.fonts.load(fontSpec).then(() => {
2383
+ console.log(`🔤 Font loaded for JSON object: ${fontSpec}`);
2384
+ // Ensure initialized flag is set again (in case constructor reset it)
2385
+ textObject.initialized = true;
2386
+
2387
+ // Special handling for STV fonts which have measurement issues
2388
+ const isStvFont = textObject.fontFamily?.toLowerCase().includes('stv');
2389
+ if (isStvFont) {
2390
+ console.log(`🔤 STV font detected, using enhanced reinitialization`);
2391
+
2392
+ // Clear all cached state that might interfere with browser wrapping
2393
+ (textObject as any)._browserWrapCache = null;
2394
+ (textObject as any)._lastDimensionState = null;
2395
+ (textObject as any)._browserWrapInitialized = false;
2396
+ console.log(`🔤 STV font: Cleared all cached states for fresh initialization`);
2397
+
2398
+ // Force browser wrapping flag for STV fonts
2399
+ (textObject as any)._usingBrowserWrapping = true;
2400
+ console.log(`🔤 STV font: Forcing browser wrapping flag during JSON load`);
2401
+
2402
+ // Multiple initialization attempts for STV fonts
2403
+ const reinitWithDelay = (attempt: number) => {
2404
+ if ((textObject as any).forceTextReinitialization) {
2405
+ (textObject as any).forceTextReinitialization();
2406
+ } else {
2407
+ textObject.initDimensions();
2408
+ }
2409
+
2410
+ // Check if width is still problematic after initialization
2411
+ if (textObject.width < 50 && attempt < 3) {
2412
+ console.log(`🔤 STV font width still ${textObject.width}px, retrying in ${100 * attempt}ms (attempt ${attempt + 1}/3)`);
2413
+ setTimeout(() => reinitWithDelay(attempt + 1), 100 * attempt);
2414
+ }
2415
+ };
2416
+ reinitWithDelay(0);
2417
+ } else {
2418
+ // Use specialized reinitialization for Textbox objects
2419
+ if ((textObject as any).forceTextReinitialization) {
2420
+ console.log(`🔤 Using Textbox specialized reinitialization`);
2421
+ (textObject as any).forceTextReinitialization();
2422
+ } else {
2423
+ // Reinitialize dimensions with proper font metrics
2424
+ textObject.initDimensions();
2425
+ }
2426
+ }
2427
+ return textObject;
2428
+ }).catch(() => {
2429
+ console.warn(`⚠️ Font loading failed for ${fontSpec}, proceeding with fallback`);
2430
+ // Ensure initialized flag is set again
2431
+ textObject.initialized = true;
2432
+
2433
+ // Still initialize dimensions even if font loading fails
2434
+ if ((textObject as any).forceTextReinitialization) {
2435
+ (textObject as any).forceTextReinitialization();
2436
+ } else {
2437
+ textObject.initDimensions();
2438
+ }
2439
+ return textObject;
2440
+ });
2441
+ } else {
2442
+ // Standard fonts - ensure initialized and use appropriate method
2443
+ textObject.initialized = true;
2444
+
2445
+ if ((textObject as any).forceTextReinitialization) {
2446
+ console.log(`🔤 Using Textbox specialized reinitialization for standard font`);
2447
+ (textObject as any).forceTextReinitialization();
2448
+ } else {
2449
+ textObject.initDimensions();
2450
+ }
2451
+ return textObject;
2452
+ }
2453
+ });
2454
+ }
2455
+ }
2456
+
2457
+ applyMixins(FabricText, [TextSVGExportMixin]);
2458
+ classRegistry.setClass(FabricText);
2459
+ classRegistry.setSVGClass(FabricText);