@nasser-sw/fabric 7.0.1-beta2 → 7.0.1-beta3

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