fabric 7.3.1 → 7.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/CHANGELOG.md +40 -27
  2. package/dist/_virtual/{_@oxc-project_runtime@0.122.0 → _@oxc-project_runtime@0.126.0}/helpers/defineProperty.mjs +1 -1
  3. package/{dist-extensions/_virtual/_@oxc-project_runtime@0.122.0 → dist/_virtual/_@oxc-project_runtime@0.126.0}/helpers/toPrimitive.mjs +1 -1
  4. package/dist/_virtual/{_@oxc-project_runtime@0.122.0 → _@oxc-project_runtime@0.126.0}/helpers/toPropertyKey.mjs +1 -1
  5. package/{dist-extensions/_virtual/_@oxc-project_runtime@0.122.0 → dist/_virtual/_@oxc-project_runtime@0.126.0}/helpers/typeof.mjs +1 -1
  6. package/dist/index.js +88 -66
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.min.js +35 -35
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/index.min.mjs +37 -37
  11. package/dist/index.min.mjs.map +1 -1
  12. package/dist/index.mjs +88 -66
  13. package/dist/index.mjs.map +1 -1
  14. package/dist/index.node.cjs +83 -62
  15. package/dist/index.node.cjs.map +1 -1
  16. package/dist/index.node.mjs +83 -62
  17. package/dist/index.node.mjs.map +1 -1
  18. package/dist/package.min.mjs +1 -1
  19. package/dist/package.mjs +1 -1
  20. package/dist/src/Collection.min.mjs +1 -1
  21. package/dist/src/Collection.mjs +1 -1
  22. package/dist/src/LayoutManager/LayoutManager.min.mjs +1 -1
  23. package/dist/src/LayoutManager/LayoutManager.mjs +1 -1
  24. package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.min.mjs +1 -1
  25. package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.mjs +1 -1
  26. package/dist/src/LayoutManager/LayoutStrategies/FitContentLayout.min.mjs +1 -1
  27. package/dist/src/LayoutManager/LayoutStrategies/FitContentLayout.mjs +1 -1
  28. package/dist/src/LayoutManager/LayoutStrategies/FixedLayout.min.mjs +1 -1
  29. package/dist/src/LayoutManager/LayoutStrategies/FixedLayout.mjs +1 -1
  30. package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.min.mjs +1 -1
  31. package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.mjs +1 -1
  32. package/dist/src/Observable.min.mjs +1 -1
  33. package/dist/src/Observable.mjs +1 -1
  34. package/dist/src/Pattern/Pattern.min.mjs +1 -1
  35. package/dist/src/Pattern/Pattern.mjs +1 -1
  36. package/dist/src/Shadow.min.mjs +1 -1
  37. package/dist/src/Shadow.mjs +1 -1
  38. package/dist/src/brushes/BaseBrush.min.mjs +1 -1
  39. package/dist/src/brushes/BaseBrush.mjs +1 -1
  40. package/dist/src/brushes/CircleBrush.min.mjs +1 -1
  41. package/dist/src/brushes/CircleBrush.mjs +1 -1
  42. package/dist/src/brushes/PencilBrush.min.mjs +1 -1
  43. package/dist/src/brushes/PencilBrush.mjs +1 -1
  44. package/dist/src/brushes/SprayBrush.min.mjs +1 -1
  45. package/dist/src/brushes/SprayBrush.mjs +1 -1
  46. package/dist/src/cache.min.mjs +1 -1
  47. package/dist/src/cache.mjs +1 -1
  48. package/dist/src/canvas/Canvas.min.mjs +1 -1
  49. package/dist/src/canvas/Canvas.mjs +1 -1
  50. package/dist/src/canvas/DOMManagers/CanvasDOMManager.min.mjs +1 -1
  51. package/dist/src/canvas/DOMManagers/CanvasDOMManager.mjs +1 -1
  52. package/dist/src/canvas/DOMManagers/StaticCanvasDOMManager.min.mjs +1 -1
  53. package/dist/src/canvas/DOMManagers/StaticCanvasDOMManager.mjs +1 -1
  54. package/dist/src/canvas/SelectableCanvas.min.mjs +1 -1
  55. package/dist/src/canvas/SelectableCanvas.mjs +1 -1
  56. package/dist/src/canvas/StaticCanvas.d.ts +1 -1
  57. package/dist/src/canvas/StaticCanvas.d.ts.map +1 -1
  58. package/dist/src/canvas/StaticCanvas.min.mjs +5 -5
  59. package/dist/src/canvas/StaticCanvas.min.mjs.map +1 -1
  60. package/dist/src/canvas/StaticCanvas.mjs +4 -4
  61. package/dist/src/canvas/StaticCanvas.mjs.map +1 -1
  62. package/dist/src/canvas/TextEditingManager.min.mjs +1 -1
  63. package/dist/src/canvas/TextEditingManager.mjs +1 -1
  64. package/dist/src/color/Color.min.mjs +1 -1
  65. package/dist/src/color/Color.mjs +1 -1
  66. package/dist/src/config.min.mjs +1 -1
  67. package/dist/src/config.mjs +1 -1
  68. package/dist/src/controls/Control.min.mjs +1 -1
  69. package/dist/src/controls/Control.mjs +1 -1
  70. package/dist/src/filters/BaseFilter.min.mjs +1 -1
  71. package/dist/src/filters/BaseFilter.mjs +1 -1
  72. package/dist/src/filters/BlendColor.min.mjs +1 -1
  73. package/dist/src/filters/BlendColor.mjs +1 -1
  74. package/dist/src/filters/BlendImage.min.mjs +1 -1
  75. package/dist/src/filters/BlendImage.mjs +1 -1
  76. package/dist/src/filters/Blur.min.mjs +1 -1
  77. package/dist/src/filters/Blur.mjs +1 -1
  78. package/dist/src/filters/Brightness.min.mjs +1 -1
  79. package/dist/src/filters/Brightness.mjs +1 -1
  80. package/dist/src/filters/Canvas2dFilterBackend.min.mjs +1 -1
  81. package/dist/src/filters/Canvas2dFilterBackend.mjs +1 -1
  82. package/dist/src/filters/ColorMatrix.min.mjs +1 -1
  83. package/dist/src/filters/ColorMatrix.mjs +1 -1
  84. package/dist/src/filters/ColorMatrixFilters.min.mjs +1 -1
  85. package/dist/src/filters/ColorMatrixFilters.mjs +1 -1
  86. package/dist/src/filters/Composed.min.mjs +1 -1
  87. package/dist/src/filters/Composed.mjs +1 -1
  88. package/dist/src/filters/Contrast.min.mjs +1 -1
  89. package/dist/src/filters/Contrast.mjs +1 -1
  90. package/dist/src/filters/Convolute.min.mjs +1 -1
  91. package/dist/src/filters/Convolute.min.mjs.map +1 -1
  92. package/dist/src/filters/Convolute.mjs +1 -1
  93. package/dist/src/filters/Gamma.min.mjs +1 -1
  94. package/dist/src/filters/Gamma.mjs +1 -1
  95. package/dist/src/filters/Grayscale.min.mjs +1 -1
  96. package/dist/src/filters/Grayscale.mjs +1 -1
  97. package/dist/src/filters/HueRotation.min.mjs +1 -1
  98. package/dist/src/filters/HueRotation.mjs +1 -1
  99. package/dist/src/filters/Invert.min.mjs +1 -1
  100. package/dist/src/filters/Invert.mjs +1 -1
  101. package/dist/src/filters/Noise.min.mjs +1 -1
  102. package/dist/src/filters/Noise.mjs +1 -1
  103. package/dist/src/filters/Pixelate.min.mjs +1 -1
  104. package/dist/src/filters/Pixelate.mjs +1 -1
  105. package/dist/src/filters/RemoveColor.min.mjs +1 -1
  106. package/dist/src/filters/RemoveColor.mjs +1 -1
  107. package/dist/src/filters/Resize.min.mjs +2 -2
  108. package/dist/src/filters/Resize.min.mjs.map +1 -1
  109. package/dist/src/filters/Resize.mjs +2 -2
  110. package/dist/src/filters/Resize.mjs.map +1 -1
  111. package/dist/src/filters/Saturation.min.mjs +1 -1
  112. package/dist/src/filters/Saturation.mjs +1 -1
  113. package/dist/src/filters/Vibrance.min.mjs +1 -1
  114. package/dist/src/filters/Vibrance.mjs +1 -1
  115. package/dist/src/filters/WebGLFilterBackend.min.mjs +1 -1
  116. package/dist/src/filters/WebGLFilterBackend.mjs +1 -1
  117. package/dist/src/gradient/Gradient.d.ts.map +1 -1
  118. package/dist/src/gradient/Gradient.min.mjs +4 -4
  119. package/dist/src/gradient/Gradient.min.mjs.map +1 -1
  120. package/dist/src/gradient/Gradient.mjs +6 -2
  121. package/dist/src/gradient/Gradient.mjs.map +1 -1
  122. package/dist/src/gradient/typedefs.d.ts +7 -7
  123. package/dist/src/parser/applyViewboxTransform.d.ts.map +1 -1
  124. package/dist/src/parser/applyViewboxTransform.min.mjs +1 -1
  125. package/dist/src/parser/applyViewboxTransform.min.mjs.map +1 -1
  126. package/dist/src/parser/applyViewboxTransform.mjs +2 -4
  127. package/dist/src/parser/applyViewboxTransform.mjs.map +1 -1
  128. package/dist/src/shapes/ActiveSelection.min.mjs +1 -1
  129. package/dist/src/shapes/ActiveSelection.mjs +1 -1
  130. package/dist/src/shapes/Circle.min.mjs +2 -2
  131. package/dist/src/shapes/Circle.min.mjs.map +1 -1
  132. package/dist/src/shapes/Circle.mjs +1 -1
  133. package/dist/src/shapes/Ellipse.min.mjs +1 -1
  134. package/dist/src/shapes/Ellipse.mjs +1 -1
  135. package/dist/src/shapes/Group.min.mjs +1 -1
  136. package/dist/src/shapes/Group.mjs +1 -1
  137. package/dist/src/shapes/IText/DraggableTextDelegate.min.mjs +1 -1
  138. package/dist/src/shapes/IText/DraggableTextDelegate.mjs +1 -1
  139. package/dist/src/shapes/IText/IText.d.ts.map +1 -1
  140. package/dist/src/shapes/IText/IText.min.mjs +1 -1
  141. package/dist/src/shapes/IText/IText.min.mjs.map +1 -1
  142. package/dist/src/shapes/IText/IText.mjs +3 -3
  143. package/dist/src/shapes/IText/IText.mjs.map +1 -1
  144. package/dist/src/shapes/IText/ITextBehavior.min.mjs +1 -1
  145. package/dist/src/shapes/IText/ITextBehavior.mjs +1 -1
  146. package/dist/src/shapes/IText/ITextClickBehavior.min.mjs +1 -1
  147. package/dist/src/shapes/IText/ITextClickBehavior.mjs +1 -1
  148. package/dist/src/shapes/Image.min.mjs +1 -1
  149. package/dist/src/shapes/Image.mjs +1 -1
  150. package/dist/src/shapes/Line.min.mjs +1 -1
  151. package/dist/src/shapes/Line.mjs +1 -1
  152. package/dist/src/shapes/Object/FabricObjectSVGExportMixin.d.ts.map +1 -1
  153. package/dist/src/shapes/Object/FabricObjectSVGExportMixin.min.mjs +2 -2
  154. package/dist/src/shapes/Object/FabricObjectSVGExportMixin.min.mjs.map +1 -1
  155. package/dist/src/shapes/Object/FabricObjectSVGExportMixin.mjs +11 -26
  156. package/dist/src/shapes/Object/FabricObjectSVGExportMixin.mjs.map +1 -1
  157. package/dist/src/shapes/Object/InteractiveObject.d.ts.map +1 -1
  158. package/dist/src/shapes/Object/InteractiveObject.min.mjs +1 -1
  159. package/dist/src/shapes/Object/InteractiveObject.min.mjs.map +1 -1
  160. package/dist/src/shapes/Object/InteractiveObject.mjs +7 -6
  161. package/dist/src/shapes/Object/InteractiveObject.mjs.map +1 -1
  162. package/dist/src/shapes/Object/Object.min.mjs +1 -1
  163. package/dist/src/shapes/Object/Object.mjs +1 -1
  164. package/dist/src/shapes/Object/ObjectGeometry.d.ts.map +1 -1
  165. package/dist/src/shapes/Object/ObjectGeometry.min.mjs +1 -1
  166. package/dist/src/shapes/Object/ObjectGeometry.min.mjs.map +1 -1
  167. package/dist/src/shapes/Object/ObjectGeometry.mjs +6 -2
  168. package/dist/src/shapes/Object/ObjectGeometry.mjs.map +1 -1
  169. package/dist/src/shapes/Object/types/FabricObjectProps.d.ts +1 -1
  170. package/dist/src/shapes/Path.min.mjs +1 -1
  171. package/dist/src/shapes/Path.mjs +1 -1
  172. package/dist/src/shapes/Polygon.min.mjs +1 -1
  173. package/dist/src/shapes/Polygon.mjs +1 -1
  174. package/dist/src/shapes/Polyline.min.mjs +1 -1
  175. package/dist/src/shapes/Polyline.mjs +1 -1
  176. package/dist/src/shapes/Rect.min.mjs +1 -1
  177. package/dist/src/shapes/Rect.mjs +1 -1
  178. package/dist/src/shapes/Text/StyledText.min.mjs +1 -1
  179. package/dist/src/shapes/Text/StyledText.mjs +1 -1
  180. package/dist/src/shapes/Text/Text.d.ts +4 -4
  181. package/dist/src/shapes/Text/Text.min.mjs +1 -1
  182. package/dist/src/shapes/Text/Text.min.mjs.map +1 -1
  183. package/dist/src/shapes/Text/Text.mjs +3 -3
  184. package/dist/src/shapes/Text/Text.mjs.map +1 -1
  185. package/dist/src/shapes/Text/TextSVGExportMixin.d.ts.map +1 -1
  186. package/dist/src/shapes/Text/TextSVGExportMixin.min.mjs +2 -2
  187. package/dist/src/shapes/Text/TextSVGExportMixin.min.mjs.map +1 -1
  188. package/dist/src/shapes/Text/TextSVGExportMixin.mjs +14 -7
  189. package/dist/src/shapes/Text/TextSVGExportMixin.mjs.map +1 -1
  190. package/dist/src/shapes/Textbox.d.ts.map +1 -1
  191. package/dist/src/shapes/Textbox.min.mjs +2 -2
  192. package/dist/src/shapes/Textbox.min.mjs.map +1 -1
  193. package/dist/src/shapes/Textbox.mjs +2 -3
  194. package/dist/src/shapes/Textbox.mjs.map +1 -1
  195. package/dist/src/shapes/Triangle.min.mjs +1 -1
  196. package/dist/src/shapes/Triangle.mjs +1 -1
  197. package/dist/src/util/animation/AnimationBase.min.mjs +1 -1
  198. package/dist/src/util/animation/AnimationBase.mjs +1 -1
  199. package/dist/src/util/animation/easing.min.mjs +1 -1
  200. package/dist/src/util/animation/easing.min.mjs.map +1 -1
  201. package/dist/src/util/animation/easing.mjs +1 -1
  202. package/dist/src/util/animation/easing.mjs.map +1 -1
  203. package/dist/src/util/internals/applyCanvasTransform.d.ts +1 -1
  204. package/dist/src/util/internals/applyCanvasTransform.min.mjs.map +1 -1
  205. package/dist/src/util/internals/applyCanvasTransform.mjs +1 -1
  206. package/dist/src/util/internals/applyCanvasTransform.mjs.map +1 -1
  207. package/dist/src/util/internals/svgExportCheck.d.ts +4 -0
  208. package/dist/src/util/internals/svgExportCheck.d.ts.map +1 -0
  209. package/dist/src/util/internals/svgExportCheck.min.mjs +2 -0
  210. package/dist/src/util/internals/svgExportCheck.min.mjs.map +1 -0
  211. package/dist/src/util/internals/svgExportCheck.mjs +12 -0
  212. package/dist/src/util/internals/svgExportCheck.mjs.map +1 -0
  213. package/dist/src/util/misc/matrix.d.ts +14 -0
  214. package/dist/src/util/misc/matrix.d.ts.map +1 -1
  215. package/dist/src/util/misc/matrix.min.mjs +1 -1
  216. package/dist/src/util/misc/matrix.min.mjs.map +1 -1
  217. package/dist/src/util/misc/matrix.mjs +15 -1
  218. package/dist/src/util/misc/matrix.mjs.map +1 -1
  219. package/dist/src/util/misc/mergeClipPaths.d.ts +1 -1
  220. package/dist/src/util/misc/mergeClipPaths.min.mjs.map +1 -1
  221. package/dist/src/util/misc/mergeClipPaths.mjs +1 -1
  222. package/dist/src/util/misc/mergeClipPaths.mjs.map +1 -1
  223. package/dist/src/util/misc/objectEnlive.min.mjs.map +1 -1
  224. package/dist/src/util/misc/objectEnlive.mjs +1 -1
  225. package/dist/src/util/misc/objectEnlive.mjs.map +1 -1
  226. package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.min.mjs +1 -1
  227. package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.min.mjs.map +1 -1
  228. package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.mjs +1 -1
  229. package/dist/src/util/misc/svgParsing.d.ts +2 -2
  230. package/dist/src/util/misc/svgParsing.d.ts.map +1 -1
  231. package/dist/src/util/misc/svgParsing.min.mjs +1 -1
  232. package/dist/src/util/misc/svgParsing.min.mjs.map +1 -1
  233. package/dist/src/util/misc/svgParsing.mjs +8 -3
  234. package/dist/src/util/misc/svgParsing.mjs.map +1 -1
  235. package/dist/src/util/path/index.d.ts.map +1 -1
  236. package/dist/src/util/path/index.min.mjs +1 -1
  237. package/dist/src/util/path/index.min.mjs.map +1 -1
  238. package/dist/src/util/path/index.mjs +2 -1
  239. package/dist/src/util/path/index.mjs.map +1 -1
  240. package/dist/src/util/path/regex.min.mjs.map +1 -1
  241. package/dist/src/util/path/regex.mjs +1 -1
  242. package/dist/src/util/path/regex.mjs.map +1 -1
  243. package/dist-extensions/_virtual/{_@oxc-project_runtime@0.122.0 → _@oxc-project_runtime@0.126.0}/helpers/defineProperty.mjs +1 -1
  244. package/{dist/_virtual/_@oxc-project_runtime@0.122.0 → dist-extensions/_virtual/_@oxc-project_runtime@0.126.0}/helpers/toPrimitive.mjs +1 -1
  245. package/dist-extensions/_virtual/{_@oxc-project_runtime@0.122.0 → _@oxc-project_runtime@0.126.0}/helpers/toPropertyKey.mjs +1 -1
  246. package/{dist/_virtual/_@oxc-project_runtime@0.122.0 → dist-extensions/_virtual/_@oxc-project_runtime@0.126.0}/helpers/typeof.mjs +1 -1
  247. package/dist-extensions/aligning_guidelines/index.mjs +1 -1
  248. package/dist-extensions/cropping_controls/croppingHandlers.mjs +1 -7
  249. package/dist-extensions/cropping_controls/croppingHandlers.mjs.map +1 -1
  250. package/dist-extensions/extensions/cropping_controls/croppingHandlers.d.ts.map +1 -1
  251. package/dist-extensions/fabric-extensions.min.js +1 -1
  252. package/dist-extensions/fabric-extensions.min.js.map +1 -1
  253. package/dist-extensions/src/canvas/StaticCanvas.d.ts +1 -1
  254. package/dist-extensions/src/canvas/StaticCanvas.d.ts.map +1 -1
  255. package/dist-extensions/src/gradient/Gradient.d.ts.map +1 -1
  256. package/dist-extensions/src/gradient/typedefs.d.ts +7 -7
  257. package/dist-extensions/src/parser/applyViewboxTransform.d.ts.map +1 -1
  258. package/dist-extensions/src/shapes/IText/IText.d.ts.map +1 -1
  259. package/dist-extensions/src/shapes/Object/FabricObjectSVGExportMixin.d.ts.map +1 -1
  260. package/dist-extensions/src/shapes/Object/InteractiveObject.d.ts.map +1 -1
  261. package/dist-extensions/src/shapes/Object/ObjectGeometry.d.ts.map +1 -1
  262. package/dist-extensions/src/shapes/Object/types/FabricObjectProps.d.ts +1 -1
  263. package/dist-extensions/src/shapes/Text/Text.d.ts +4 -4
  264. package/dist-extensions/src/shapes/Text/TextSVGExportMixin.d.ts.map +1 -1
  265. package/dist-extensions/src/shapes/Textbox.d.ts.map +1 -1
  266. package/dist-extensions/src/util/internals/applyCanvasTransform.d.ts +1 -1
  267. package/dist-extensions/src/util/internals/svgExportCheck.d.ts +4 -0
  268. package/dist-extensions/src/util/internals/svgExportCheck.d.ts.map +1 -0
  269. package/dist-extensions/src/util/misc/matrix.d.ts +14 -0
  270. package/dist-extensions/src/util/misc/matrix.d.ts.map +1 -1
  271. package/dist-extensions/src/util/misc/mergeClipPaths.d.ts +1 -1
  272. package/dist-extensions/src/util/misc/svgParsing.d.ts +2 -2
  273. package/dist-extensions/src/util/misc/svgParsing.d.ts.map +1 -1
  274. package/dist-extensions/src/util/path/index.d.ts.map +1 -1
  275. package/extensions/cropping_controls/croppingHandlers.ts +13 -19
  276. package/package.json +10 -10
  277. package/src/LayoutManager/README.md +3 -3
  278. package/src/canvas/StaticCanvas.spec.ts +19 -0
  279. package/src/canvas/StaticCanvas.ts +7 -3
  280. package/src/filters/Resize.ts +1 -1
  281. package/src/gradient/Gradient.spec.ts +60 -1
  282. package/src/gradient/Gradient.ts +9 -2
  283. package/src/gradient/typedefs.ts +7 -7
  284. package/src/parser/applyViewboxTransform.ts +2 -4
  285. package/src/shapes/IText/IText.ts +1 -2
  286. package/src/shapes/IText/ITextBehavior.test.ts +6 -6
  287. package/src/shapes/Object/FabricObject.spec.ts +3 -2
  288. package/src/shapes/Object/FabricObjectSVGExportMixin.ts +47 -37
  289. package/src/shapes/Object/InteractiveObject.ts +13 -3
  290. package/src/shapes/Object/Object-interactivity.spec.ts +126 -7
  291. package/src/shapes/Object/ObjectGeometry.spec.ts +10 -1
  292. package/src/shapes/Object/ObjectGeometry.ts +10 -3
  293. package/src/shapes/Object/objectSvgExport.spec.ts +27 -0
  294. package/src/shapes/Object/types/FabricObjectProps.ts +1 -1
  295. package/src/shapes/Text/Text.spec.ts +25 -0
  296. package/src/shapes/Text/Text.ts +5 -5
  297. package/src/shapes/Text/TextSVGExportMixin.ts +25 -11
  298. package/src/shapes/Textbox.ts +1 -2
  299. package/src/util/animation/animations.spec.ts +1 -1
  300. package/src/util/animation/easing.ts +1 -1
  301. package/src/util/internals/applyCanvasTransform.ts +1 -1
  302. package/src/util/internals/svgExportCheck.ts +20 -0
  303. package/src/util/misc/matrix.spec.ts +52 -0
  304. package/src/util/misc/matrix.ts +16 -0
  305. package/src/util/misc/mergeClipPaths.ts +1 -1
  306. package/src/util/misc/objectEnlive.ts +1 -1
  307. package/src/util/misc/svgParsing.ts +22 -10
  308. package/src/util/path/index.ts +3 -2
  309. package/src/util/path/regex.ts +1 -1
  310. package/src/util/typeAssertions.spec.ts +1 -1
  311. /package/dist/_virtual/{_@oxc-project_runtime@0.122.0 → _@oxc-project_runtime@0.126.0}/helpers/defineProperty.min.mjs +0 -0
  312. /package/dist/_virtual/{_@oxc-project_runtime@0.122.0 → _@oxc-project_runtime@0.126.0}/helpers/toPrimitive.min.mjs +0 -0
  313. /package/dist/_virtual/{_@oxc-project_runtime@0.122.0 → _@oxc-project_runtime@0.126.0}/helpers/toPropertyKey.min.mjs +0 -0
  314. /package/dist/_virtual/{_@oxc-project_runtime@0.122.0 → _@oxc-project_runtime@0.126.0}/helpers/typeof.min.mjs +0 -0
package/dist/index.mjs CHANGED
@@ -10,7 +10,7 @@ var __exportAll = (all, no_symbols) => {
10
10
  return target;
11
11
  };
12
12
  //#endregion
13
- //#region \0@oxc-project+runtime@0.122.0/helpers/typeof.js
13
+ //#region \0@oxc-project+runtime@0.126.0/helpers/typeof.js
14
14
  function _typeof(o) {
15
15
  "@babel/helpers - typeof";
16
16
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -20,7 +20,7 @@ function _typeof(o) {
20
20
  }, _typeof(o);
21
21
  }
22
22
  //#endregion
23
- //#region \0@oxc-project+runtime@0.122.0/helpers/toPrimitive.js
23
+ //#region \0@oxc-project+runtime@0.126.0/helpers/toPrimitive.js
24
24
  function toPrimitive(t, r) {
25
25
  if ("object" != _typeof(t) || !t) return t;
26
26
  var e = t[Symbol.toPrimitive];
@@ -32,13 +32,13 @@ function toPrimitive(t, r) {
32
32
  return ("string" === r ? String : Number)(t);
33
33
  }
34
34
  //#endregion
35
- //#region \0@oxc-project+runtime@0.122.0/helpers/toPropertyKey.js
35
+ //#region \0@oxc-project+runtime@0.126.0/helpers/toPropertyKey.js
36
36
  function toPropertyKey(t) {
37
37
  var i = toPrimitive(t, "string");
38
38
  return "symbol" == _typeof(i) ? i : i + "";
39
39
  }
40
40
  //#endregion
41
- //#region \0@oxc-project+runtime@0.122.0/helpers/defineProperty.js
41
+ //#region \0@oxc-project+runtime@0.126.0/helpers/defineProperty.js
42
42
  function _defineProperty(e, r, t) {
43
43
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
44
44
  value: t,
@@ -405,7 +405,7 @@ var Cache = class {
405
405
  const cache = new Cache();
406
406
  //#endregion
407
407
  //#region src/constants.ts
408
- const VERSION = "7.3.1";
408
+ const VERSION = "7.4.0";
409
409
  function noop() {}
410
410
  const halfPI = Math.PI / 2;
411
411
  const quarterPI = Math.PI / 4;
@@ -1391,6 +1391,20 @@ const multiplyTransformMatrices = (a, b, is2x2) => [
1391
1391
  const multiplyTransformMatrixArray = (matrices, is2x2) => matrices.reduceRight((product, curr) => curr && product ? multiplyTransformMatrices(curr, product, is2x2) : curr || product, void 0) || iMatrix.concat();
1392
1392
  const calcPlaneRotation = ([a, b]) => Math.atan2(b, a);
1393
1393
  /**
1394
+ * Returns the uniform scale (zoom) magnitude of a 2D affine matrix,
1395
+ * computed as the length of the image of the unit X basis vector.
1396
+ */
1397
+ const calcPlaneZoom = ([a, b]) => Math.sqrt(a * a + b * b);
1398
+ /**
1399
+ * Returns the Y-axis scale magnitude of a 2D affine matrix,
1400
+ * computed as the length of the image of the unit Y basis vector.
1401
+ * We do not support non uniform zooming on the viewport but to make things work
1402
+ * we need to have a function that can return the value on Y axis.
1403
+ * Bug reports and features will be planned with zoom being just a number
1404
+ * that is the same for both axis
1405
+ */
1406
+ const calcPlaneScaleY = ([, , c, d]) => Math.sqrt(c * c + d * d);
1407
+ /**
1394
1408
  * Decomposes standard 2x3 matrix into transform components
1395
1409
  * @param {TMat2D} a transformMatrix
1396
1410
  * @return {Object} Components of transform
@@ -1649,7 +1663,7 @@ const enlivenObjectEnlivables = (serializedObject, { signal } = {}) => new Promi
1649
1663
  /**
1650
1664
  * clipPath or shadow or gradient or text on a path or a pattern,
1651
1665
  * or the backgroundImage or overlayImage of canvas
1652
- * If we have a type and there is a classe registered for it, we enlive it.
1666
+ * If we have a type and there is a class registered for it, we enlive it.
1653
1667
  * If there is no class registered for it we return the value as is
1654
1668
  * */
1655
1669
  if (value.type && classRegistry.has(value.type)) return enlivenObjects([value], { signal }).then(([enlived]) => {
@@ -2080,11 +2094,11 @@ var StaticCanvas = class StaticCanvas extends createCollectionMixin(CommonMethod
2080
2094
  if (!options || !options.cssOnly) this.requestRenderAll();
2081
2095
  }
2082
2096
  /**
2083
- * Returns canvas zoom level
2097
+ * Returns the canvas zoom level as the magnitude of the viewport scale.
2084
2098
  * @return {Number}
2085
2099
  */
2086
2100
  getZoom() {
2087
- return this.viewportTransform[0];
2101
+ return calcPlaneZoom(this.viewportTransform);
2088
2102
  }
2089
2103
  /**
2090
2104
  * Sets viewport transformation of this canvas instance
@@ -3223,6 +3237,15 @@ function getLocalPoint({ target, corner }, originX, originY, x, y) {
3223
3237
  return localPoint;
3224
3238
  }
3225
3239
  //#endregion
3240
+ //#region src/util/internals/svgExportCheck.ts
3241
+ const unsafeSvgStyleValueRegex = new RegExp(String.raw`[\0-\x1F\x7F;<>\\]|\/\*|\*\/|url\s*\(|expression\s*\(|(?:java|vb)script\s*:|data\s*:|@import\b`, "iu");
3242
+ const isSafeSvgStyleValue = (value) => typeof value === "string" && value.trim().length > 0 && !unsafeSvgStyleValueRegex.test(value);
3243
+ const getSafeSvgStyleNumber = (value, fallback = "") => {
3244
+ const numeric = Number(value);
3245
+ return Number.isFinite(numeric) ? `${numeric}` : fallback;
3246
+ };
3247
+ const getSafeSvgStyleToken = (value, fallback = "") => typeof value === "string" && isSafeSvgStyleValue(value) ? value : fallback;
3248
+ //#endregion
3226
3249
  //#region src/util/internals/normalizeWhiteSpace.ts
3227
3250
  const normalizeWs = (value) => value.replace(/\s+/g, " ");
3228
3251
  //#endregion
@@ -3951,9 +3974,13 @@ const colorPropToSVG = (prop, value, inlineStyle = true) => {
3951
3974
  if (!value) colorValue = "none";
3952
3975
  else if (value.toLive) colorValue = `url(#SVGID_${escapeXml(value.id)})`;
3953
3976
  else {
3954
- const color = new Color(value), opacity = color.getAlpha();
3955
- colorValue = color.toRgb();
3956
- if (opacity !== 1) opacityValue = opacity.toString();
3977
+ const rawValue = String(value);
3978
+ if (!isSafeSvgStyleValue(rawValue)) colorValue = new Color("black").toRgb();
3979
+ else {
3980
+ const color = new Color(rawValue), opacity = color.getAlpha();
3981
+ colorValue = color.toRgb();
3982
+ if (opacity !== 1) opacityValue = opacity.toString();
3983
+ }
3957
3984
  }
3958
3985
  if (inlineStyle) return `${prop}: ${colorValue}; ${opacityValue ? `${prop}-opacity: ${opacityValue}; ` : ""}`;
3959
3986
  else return `${prop}="${colorValue}" ${opacityValue ? `${prop}-opacity="${opacityValue}" ` : ""}`;
@@ -3977,34 +4004,18 @@ var FabricObjectSVGExportMixin = class {
3977
4004
  * @return {String}
3978
4005
  */
3979
4006
  getSvgStyles(skipShadow) {
3980
- const fillRule = this.fillRule ? this.fillRule : "nonzero", strokeWidth = this.strokeWidth ? this.strokeWidth : "0", strokeDashArray = this.strokeDashArray ? this.strokeDashArray.join(" ") : NONE, strokeDashOffset = this.strokeDashOffset ? this.strokeDashOffset : "0", strokeLineCap = this.strokeLineCap ? this.strokeLineCap : "butt", strokeLineJoin = this.strokeLineJoin ? this.strokeLineJoin : "miter", strokeMiterLimit = this.strokeMiterLimit ? this.strokeMiterLimit : "4", opacity = typeof this.opacity !== "undefined" ? this.opacity : "1", visibility = this.visible ? "" : " visibility: hidden;", filter = skipShadow ? "" : this.getSvgFilter(), fill = colorPropToSVG(FILL, this.fill);
4007
+ const fillRule = this.fillRule == null ? "nonzero" : getSafeSvgStyleToken(this.fillRule), strokeWidth = this.strokeWidth == null ? "0" : getSafeSvgStyleNumber(this.strokeWidth), strokeDashArray = this.strokeDashArray == null ? NONE : this.strokeDashArray.every((value) => Number.isFinite(Number(value))) ? this.strokeDashArray.join(" ") : "", strokeDashOffset = this.strokeDashOffset == null ? "0" : getSafeSvgStyleNumber(this.strokeDashOffset), strokeLineCap = this.strokeLineCap == null ? "butt" : getSafeSvgStyleToken(this.strokeLineCap), strokeLineJoin = this.strokeLineJoin == null ? "miter" : getSafeSvgStyleToken(this.strokeLineJoin), strokeMiterLimit = this.strokeMiterLimit == null ? "4" : getSafeSvgStyleNumber(this.strokeMiterLimit), opacity = this.opacity == null ? "1" : getSafeSvgStyleNumber(this.opacity), visibility = this.visible ? "" : " visibility: hidden;", filter = skipShadow ? "" : this.getSvgFilter(), fill = colorPropToSVG(FILL, this.fill);
3981
4008
  return [
3982
4009
  colorPropToSVG(STROKE, this.stroke),
3983
- "stroke-width: ",
3984
- strokeWidth,
3985
- "; ",
3986
- "stroke-dasharray: ",
3987
- strokeDashArray,
3988
- "; ",
3989
- "stroke-linecap: ",
3990
- strokeLineCap,
3991
- "; ",
3992
- "stroke-dashoffset: ",
3993
- strokeDashOffset,
3994
- "; ",
3995
- "stroke-linejoin: ",
3996
- strokeLineJoin,
3997
- "; ",
3998
- "stroke-miterlimit: ",
3999
- strokeMiterLimit,
4000
- "; ",
4010
+ strokeWidth ? `stroke-width: ${strokeWidth}; ` : "",
4011
+ strokeDashArray ? `stroke-dasharray: ${strokeDashArray}; ` : "",
4012
+ strokeLineCap ? `stroke-linecap: ${strokeLineCap}; ` : "",
4013
+ strokeDashOffset ? `stroke-dashoffset: ${strokeDashOffset}; ` : "",
4014
+ strokeLineJoin ? `stroke-linejoin: ${strokeLineJoin}; ` : "",
4015
+ strokeMiterLimit ? `stroke-miterlimit: ${strokeMiterLimit}; ` : "",
4001
4016
  fill,
4002
- "fill-rule: ",
4003
- fillRule,
4004
- "; ",
4005
- "opacity: ",
4006
- opacity,
4007
- ";",
4017
+ fillRule ? `fill-rule: ${fillRule}; ` : "",
4018
+ opacity ? `opacity: ${opacity};` : "",
4008
4019
  filter,
4009
4020
  visibility
4010
4021
  ].map((v) => escapeXml(v)).join("");
@@ -4021,7 +4032,7 @@ var FabricObjectSVGExportMixin = class {
4021
4032
  * @return {String}
4022
4033
  */
4023
4034
  getSvgCommons() {
4024
- return [this.id ? `id="${escapeXml(String(this.id))}" ` : "", this.clipPath ? `clip-path="url(#${this.clipPath.clipPathId})" ` : ""].join("");
4035
+ return [this.id ? `id="${escapeXml(String(this.id))}" ` : "", this.clipPath ? `clip-path="url(#${escapeXml(this.clipPath.clipPathId)})" ` : ""].join("");
4025
4036
  }
4026
4037
  /**
4027
4038
  * Returns transform-string for svg-export
@@ -4619,7 +4630,7 @@ const easeInOutExpo = (t, b, c, d) => {
4619
4630
  if (t === d) return b + c;
4620
4631
  t /= d / 2;
4621
4632
  if (t < 1) return c / 2 * 2 ** (10 * (t - 1)) + b;
4622
- return c / 2 * -(2 ** (-10 * --t) + 2) + b;
4633
+ return c / 2 * -(2 ** (-10 * (t - 1)) + 2) + b;
4623
4634
  };
4624
4635
  /**
4625
4636
  * Circular easing in
@@ -5432,7 +5443,11 @@ var ObjectGeometry = class extends CommonMethods {
5432
5443
  * @returns {Point} dimensions
5433
5444
  */
5434
5445
  _calculateCurrentDimensions(options) {
5435
- return this._getTransformedDimensions(options).transform(this.getViewportTransform(), true).scalarAdd(2 * this.padding);
5446
+ var _this$canvas3;
5447
+ const vpt = (_this$canvas3 = this.canvas) === null || _this$canvas3 === void 0 ? void 0 : _this$canvas3.viewportTransform;
5448
+ const dim = this._getTransformedDimensions(options);
5449
+ if (vpt) return dim.multiply(new Point(calcPlaneZoom(vpt), calcPlaneScaleY(vpt))).scalarAdd(2 * this.padding);
5450
+ return dim.scalarAdd(2 * this.padding);
5436
5451
  }
5437
5452
  /**
5438
5453
  * Calculate object bounding box dimensions from its properties scale, skew.
@@ -7637,11 +7652,11 @@ var InteractiveFabricObject = class InteractiveFabricObject extends FabricObject
7637
7652
  * @return {Record<string, TOCoord>}
7638
7653
  */
7639
7654
  calcOCoords() {
7640
- const vpt = this.getViewportTransform(), center = this.getCenterPoint(), finalMatrix = multiplyTransformMatrices(multiplyTransformMatrices(vpt, multiplyTransformMatrices(createTranslateMatrix(center.x, center.y), createRotateMatrix({ angle: this.getTotalAngle() - (!!this.group && this.flipX ? 180 : 0) }))), [
7641
- 1 / vpt[0],
7655
+ const vpt = this.getViewportTransform(), vptScaleX = calcPlaneZoom(vpt), vptScaleY = calcPlaneScaleY(vpt), center = this.getCenterPoint(), finalMatrix = multiplyTransformMatrices(multiplyTransformMatrices(vpt, multiplyTransformMatrices(createTranslateMatrix(center.x, center.y), createRotateMatrix({ angle: this.getTotalAngle() - (!!this.group && this.flipX ? 180 : 0) }))), [
7656
+ 1 / vptScaleX,
7642
7657
  0,
7643
7658
  0,
7644
- 1 / vpt[3],
7659
+ 1 / vptScaleY,
7645
7660
  0,
7646
7661
  0
7647
7662
  ]), transformOptions = this.group ? qrDecompose(this.calcTransformMatrix()) : void 0;
@@ -7757,7 +7772,8 @@ var InteractiveFabricObject = class InteractiveFabricObject extends FabricObject
7757
7772
  ctx.lineWidth = this.borderScaleFactor;
7758
7773
  if (this.group === this.parent) ctx.globalAlpha = this.isMoving ? this.borderOpacityWhenMoving : 1;
7759
7774
  if (this.flipX) options.angle -= 180;
7760
- ctx.rotate(degreesToRadians(this.group ? options.angle : this.angle));
7775
+ const vptAngle = calcPlaneRotation(vpt);
7776
+ ctx.rotate(this.group ? degreesToRadians(options.angle) : degreesToRadians(this.angle) + vptAngle);
7761
7777
  shouldDrawBorders && this.drawBorders(ctx, options, styleOverride);
7762
7778
  shouldDrawControls && this.drawControls(ctx, styleOverride);
7763
7779
  ctx.restore();
@@ -9599,7 +9615,7 @@ const commaWsp = `\\s*,?\\s*`;
9599
9615
  /**
9600
9616
  * p for param
9601
9617
  * using "bad naming" here because it makes the regex much easier to read
9602
- * p is a number that is preceded by an arbitary number of spaces, maybe 0,
9618
+ * p is a number that is preceded by an arbitrary number of spaces, maybe 0,
9603
9619
  * a comma or not, and then possibly more spaces or not.
9604
9620
  */
9605
9621
  const p = `${commaWsp}(${reNum})`;
@@ -10164,7 +10180,8 @@ const parsePath = (pathString) => {
10164
10180
  let paramArr = [];
10165
10181
  if (commandLetter === "a" || commandLetter === "A") {
10166
10182
  regExpArcCommandPoints.lastIndex = 0;
10167
- for (let out = null; out = regExpArcCommandPoints.exec(matchStr);) paramArr.push(...out.slice(1));
10183
+ let out;
10184
+ while (out = regExpArcCommandPoints.exec(matchStr)) paramArr.push(...out.slice(1));
10168
10185
  } else paramArr = matchStr.match(reMyNum) || [];
10169
10186
  for (let i = 0; i < paramArr.length; i += commandLength) {
10170
10187
  const newCommand = new Array(commandLength);
@@ -10293,7 +10310,7 @@ const joinPath = (pathData, fractionDigits) => pathData.map((segment) => {
10293
10310
  * Merges 2 clip paths into one visually equal clip path
10294
10311
  *
10295
10312
  * **IMPORTANT**:\
10296
- * Does **NOT** clone the arguments, clone them proir if necessary.
10313
+ * Does **NOT** clone the arguments, clone them prior if necessary.
10297
10314
  *
10298
10315
  * Creates a wrapper (group) that contains one clip path and is clipped by the other so content is kept where both overlap.
10299
10316
  * Use this method if both the clip paths may have nested clip paths of their own, so assigning one to the other's clip path property is not possible.
@@ -13013,7 +13030,9 @@ var Gradient = class {
13013
13030
  }
13014
13031
  }
13015
13032
  colorStops.forEach(({ color, offset }) => {
13016
- markup.push(`<stop offset="${offset * 100}%" style="stop-color:${color};"/>\n`);
13033
+ const rawColor = String(color);
13034
+ const serializedColor = isSafeSvgStyleValue(rawColor) ? rawColor : new Color(rawColor).toRgba();
13035
+ markup.push(`<stop offset="${offset * 100}%" style="stop-color:${escapeXml(serializedColor)};"/>\n`);
13017
13036
  });
13018
13037
  markup.push(this.type === "linear" ? "</linearGradient>" : "</radialGradient>", "\n");
13019
13038
  return markup.join("");
@@ -15284,7 +15303,7 @@ var TextSVGExportMixin = class extends FabricObjectSVGExportMixin {
15284
15303
  * @return {String}
15285
15304
  */
15286
15305
  getSvgStyles(skipShadow) {
15287
- const objectLevelTextDecorationColor = this["textDecorationColor"] ? ` text-decoration-color: ${escapeXml(this[TEXT_DECORATION_COLOR])};` : "";
15306
+ const objectLevelTextDecorationColor = isSafeSvgStyleValue(this["textDecorationColor"]) ? ` text-decoration-color: ${escapeXml(this[TEXT_DECORATION_COLOR])};` : "";
15288
15307
  return `${super.getSvgStyles(skipShadow)} text-decoration-thickness: ${toFixed(this.textDecorationThickness * this.getObjectScaling().y / 10, config.NUM_FRACTION_DIGITS)}%;${objectLevelTextDecorationColor} white-space: pre;`;
15289
15308
  }
15290
15309
  /**
@@ -15302,14 +15321,20 @@ var TextSVGExportMixin = class extends FabricObjectSVGExportMixin {
15302
15321
  });
15303
15322
  const thickness = textDecorationThickness || this["textDecorationThickness"];
15304
15323
  const decorationColor = textDecorationColor || this["textDecorationColor"];
15324
+ const safeStrokeWidth = getSafeSvgStyleNumber(strokeWidth);
15325
+ const safeFontFamily = getSafeSvgStyleToken(fontFamily);
15326
+ const safeFontSize = getSafeSvgStyleNumber(fontSize);
15327
+ const safeFontStyle = getSafeSvgStyleToken(fontStyle);
15328
+ const safeFontWeight = getSafeSvgStyleNumber(fontWeight) || getSafeSvgStyleToken(fontWeight);
15329
+ const safeDecorationColor = getSafeSvgStyleToken(decorationColor);
15305
15330
  return [
15306
15331
  stroke ? colorPropToSVG(STROKE, stroke) : "",
15307
- strokeWidth ? `stroke-width: ${escapeXml(strokeWidth)}; ` : "",
15308
- fontFamily ? `font-family: ${!fontFamily.includes("'") && !fontFamily.includes("\"") ? `'${escapeXml(fontFamily)}'` : escapeXml(fontFamily)}; ` : "",
15309
- fontSize ? `font-size: ${escapeXml(fontSize)}px; ` : "",
15310
- fontStyle ? `font-style: ${escapeXml(fontStyle)}; ` : "",
15311
- fontWeight ? `font-weight: ${escapeXml(fontWeight)}; ` : "",
15312
- textDecoration ? `text-decoration: ${textDecoration}; text-decoration-thickness: ${toFixed(thickness * this.getObjectScaling().y / 10, config.NUM_FRACTION_DIGITS)}%;${decorationColor ? ` text-decoration-color: ${escapeXml(decorationColor)};` : ""} ` : "",
15332
+ safeStrokeWidth ? `stroke-width: ${escapeXml(safeStrokeWidth)}; ` : "",
15333
+ safeFontFamily ? `font-family: ${!safeFontFamily.includes("'") && !safeFontFamily.includes("\"") ? `'${escapeXml(safeFontFamily)}'` : escapeXml(safeFontFamily)}; ` : "",
15334
+ safeFontSize ? `font-size: ${escapeXml(safeFontSize)}px; ` : "",
15335
+ safeFontStyle ? `font-style: ${escapeXml(safeFontStyle)}; ` : "",
15336
+ safeFontWeight ? `font-weight: ${escapeXml(safeFontWeight)}; ` : "",
15337
+ textDecoration ? `text-decoration: ${textDecoration}; text-decoration-thickness: ${toFixed(thickness * this.getObjectScaling().y / 10, config.NUM_FRACTION_DIGITS)}%;${safeDecorationColor ? ` text-decoration-color: ${escapeXml(safeDecorationColor)};` : ""} ` : "",
15313
15338
  fill ? colorPropToSVG(FILL, fill) : "",
15314
15339
  useWhiteSpace ? "white-space: pre; " : ""
15315
15340
  ].join("");
@@ -15866,7 +15891,7 @@ var FabricText = class FabricText extends StyledText {
15866
15891
  * @private
15867
15892
  * @param {String} method fillText or strokeText.
15868
15893
  * @param {CanvasRenderingContext2D} ctx Context to render on
15869
- * @param {Array} line Content of the line, splitted in an array by grapheme
15894
+ * @param {Array} line Content of the line, split in an array by grapheme
15870
15895
  * @param {Number} left
15871
15896
  * @param {Number} top
15872
15897
  * @param {Number} lineIndex
@@ -16136,7 +16161,7 @@ var FabricText = class FabricText extends StyledText {
16136
16161
  let lastDecorationColor = this.getValueOfPropertyAt(i, 0, "textDecorationColor") || lastFill;
16137
16162
  let lastTickness = this.getValueOfPropertyAt(i, 0, TEXT_DECORATION_THICKNESS);
16138
16163
  let currentDecoration = lastDecoration;
16139
- let currentFill = lastFill;
16164
+ let currentFill;
16140
16165
  let currentDecorationColor = lastDecorationColor;
16141
16166
  let currentTickness = lastTickness;
16142
16167
  const top = topOffset + maxHeight * (1 - this._fontSizeFraction);
@@ -17903,7 +17928,7 @@ const ctrlKeysMapDown = { 65: "cmdAll" };
17903
17928
  * Set the transform of the passed context to the same of a specific Canvas or StaticCanvas.
17904
17929
  * setTransform is used since this utility will RESET the ctx transform to the basic value
17905
17930
  * of retina scaling and viewport transform
17906
- * It is not meant to be added to other transforms, it is used internally to preapre canvases to draw
17931
+ * It is not meant to be added to other transforms, it is used internally to prepare canvases to draw
17907
17932
  * @param ctx
17908
17933
  * @param canvas
17909
17934
  */
@@ -18301,7 +18326,7 @@ var IText = class IText extends ITextClickBehavior {
18301
18326
  const selectionStart = selection.selectionStart, selectionEnd = selection.selectionEnd, isJustify = textAlign.includes(JUSTIFY), start = this.get2DCursorLocation(selectionStart), end = this.get2DCursorLocation(selectionEnd), startLine = start.lineIndex, endLine = end.lineIndex, startChar = start.charIndex < 0 ? 0 : start.charIndex, endChar = end.charIndex < 0 ? 0 : end.charIndex;
18302
18327
  for (let i = startLine; i <= endLine; i++) {
18303
18328
  const lineOffset = this._getLineLeftOffset(i) || 0;
18304
- let lineHeight = this.getHeightOfLine(i), realLineHeight = 0, boxStart = 0, boxEnd = 0;
18329
+ let lineHeight = this.getHeightOfLine(i), boxStart = 0, boxEnd = 0;
18305
18330
  if (i === startLine) boxStart = this.__charBounds[startLine][startChar].left;
18306
18331
  if (i >= startLine && i < endLine) boxEnd = isJustify && !this.isEndOfWrapping(i) ? this.width : this.getLineWidth(i) || 5;
18307
18332
  else if (i === endLine) if (endChar === 0) boxEnd = this.__charBounds[endLine][endChar].left;
@@ -18309,7 +18334,7 @@ var IText = class IText extends ITextClickBehavior {
18309
18334
  const charSpacing = this._getWidthOfCharSpacing();
18310
18335
  boxEnd = this.__charBounds[endLine][endChar - 1].left + this.__charBounds[endLine][endChar - 1].width - charSpacing;
18311
18336
  }
18312
- realLineHeight = lineHeight;
18337
+ const realLineHeight = lineHeight;
18313
18338
  if (this.lineHeight < 1 || i === endLine && this.lineHeight > 1) lineHeight /= this.lineHeight;
18314
18339
  let drawStart = boundaries.left + lineOffset + boxStart, drawHeight = lineHeight, extraTop = 0;
18315
18340
  const drawWidth = boxEnd - boxStart;
@@ -18476,7 +18501,7 @@ var Textbox = class Textbox extends IText {
18476
18501
  */
18477
18502
  isEmptyStyles(lineIndex) {
18478
18503
  if (!this.styles) return true;
18479
- let offset = 0, nextLineIndex = lineIndex + 1, nextOffset, shouldLimit = false;
18504
+ let offset = 0, nextLineIndex, nextOffset, shouldLimit = false;
18480
18505
  const map = this._styleMap[lineIndex], mapNextLine = this._styleMap[lineIndex + 1];
18481
18506
  if (map) {
18482
18507
  lineIndex = map.line;
@@ -18647,7 +18672,6 @@ var Textbox = class Textbox extends IText {
18647
18672
  desiredWidth -= reservedSpace;
18648
18673
  const maxWidth = Math.max(desiredWidth, largestWordWidth, this.dynamicMinWidth);
18649
18674
  const data = wordsData[lineIndex];
18650
- offset = 0;
18651
18675
  let i;
18652
18676
  for (i = 0; i < data.length; i++) {
18653
18677
  const { word, width: wordWidth } = data[i];
@@ -19782,8 +19806,6 @@ function applyViewboxTransform(element) {
19782
19806
  const viewBoxAttr = element.getAttribute("viewBox");
19783
19807
  let scaleX = 1;
19784
19808
  let scaleY = 1;
19785
- let minX = 0;
19786
- let minY = 0;
19787
19809
  let matrix;
19788
19810
  let el;
19789
19811
  const widthAttr = element.getAttribute("width");
@@ -19818,8 +19840,8 @@ function applyViewboxTransform(element) {
19818
19840
  return parsedDim;
19819
19841
  }
19820
19842
  const pasedViewBox = viewBoxAttr.match(reViewBoxAttrValue);
19821
- minX = -parseFloat(pasedViewBox[1]);
19822
- minY = -parseFloat(pasedViewBox[2]);
19843
+ const minX = -parseFloat(pasedViewBox[1]);
19844
+ const minY = -parseFloat(pasedViewBox[2]);
19823
19845
  const viewBoxWidth = parseFloat(pasedViewBox[3]);
19824
19846
  const viewBoxHeight = parseFloat(pasedViewBox[4]);
19825
19847
  parsedDim.minX = minX;
@@ -22635,7 +22657,7 @@ var Resize = class extends BaseFilter {
22635
22657
  const ratioW = this.rcpScaleX, ratioH = this.rcpScaleY, ratioWHalf = Math.ceil(ratioW / 2), ratioHHalf = Math.ceil(ratioH / 2), data = options.imageData.data, img2 = options.ctx.createImageData(dW, dH), data2 = img2.data;
22636
22658
  for (let j = 0; j < dH; j++) for (let i = 0; i < dW; i++) {
22637
22659
  const x2 = (i + j * dW) * 4;
22638
- let weight = 0;
22660
+ let weight;
22639
22661
  let weights = 0;
22640
22662
  let weightsAlpha = 0;
22641
22663
  let gxR = 0;