fabric 6.0.0 → 6.0.2

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 (269) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +8 -18
  3. package/dist/fabric.d.ts +4 -0
  4. package/dist/fabric.d.ts.map +1 -1
  5. package/dist/fabric.min.mjs +1 -1
  6. package/dist/fabric.mjs +1 -0
  7. package/dist/fabric.mjs.map +1 -1
  8. package/dist/index.js +146 -107
  9. package/dist/index.js.map +1 -1
  10. package/dist/index.min.js +1 -1
  11. package/dist/index.min.js.map +1 -1
  12. package/dist/index.min.mjs +1 -1
  13. package/dist/index.min.mjs.map +1 -1
  14. package/dist/index.mjs +146 -108
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/index.node.cjs +146 -107
  17. package/dist/index.node.cjs.map +1 -1
  18. package/dist/index.node.mjs +146 -108
  19. package/dist/index.node.mjs.map +1 -1
  20. package/dist/package.json.min.mjs +1 -1
  21. package/dist/package.json.mjs +1 -1
  22. package/dist/src/EventTypeDefs.d.ts +2 -1
  23. package/dist/src/EventTypeDefs.d.ts.map +1 -1
  24. package/dist/src/LayoutManager/LayoutManager.d.ts.map +1 -1
  25. package/dist/src/LayoutManager/LayoutManager.min.mjs +1 -1
  26. package/dist/src/LayoutManager/LayoutManager.min.mjs.map +1 -1
  27. package/dist/src/LayoutManager/LayoutManager.mjs +13 -8
  28. package/dist/src/LayoutManager/LayoutManager.mjs.map +1 -1
  29. package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.min.mjs +1 -1
  30. package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.min.mjs.map +1 -1
  31. package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.mjs +3 -3
  32. package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.mjs.map +1 -1
  33. package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.d.ts +1 -1
  34. package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.d.ts.map +1 -1
  35. package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.min.mjs +1 -1
  36. package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.min.mjs.map +1 -1
  37. package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.mjs +15 -9
  38. package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.mjs.map +1 -1
  39. package/dist/src/Observable.d.ts +8 -0
  40. package/dist/src/Observable.d.ts.map +1 -1
  41. package/dist/src/Observable.min.mjs.map +1 -1
  42. package/dist/src/Observable.mjs +8 -0
  43. package/dist/src/Observable.mjs.map +1 -1
  44. package/dist/src/canvas/SelectableCanvas.d.ts.map +1 -1
  45. package/dist/src/canvas/SelectableCanvas.min.mjs +1 -1
  46. package/dist/src/canvas/SelectableCanvas.min.mjs.map +1 -1
  47. package/dist/src/canvas/SelectableCanvas.mjs +5 -5
  48. package/dist/src/canvas/SelectableCanvas.mjs.map +1 -1
  49. package/dist/src/canvas/StaticCanvas.d.ts +1 -1
  50. package/dist/src/constants.d.ts +16 -0
  51. package/dist/src/constants.d.ts.map +1 -1
  52. package/dist/src/constants.min.mjs +1 -1
  53. package/dist/src/constants.min.mjs.map +1 -1
  54. package/dist/src/constants.mjs +17 -1
  55. package/dist/src/constants.mjs.map +1 -1
  56. package/dist/src/controls/Control.d.ts.map +1 -1
  57. package/dist/src/controls/Control.min.mjs +1 -1
  58. package/dist/src/controls/Control.min.mjs.map +1 -1
  59. package/dist/src/controls/Control.mjs +2 -1
  60. package/dist/src/controls/Control.mjs.map +1 -1
  61. package/dist/src/controls/changeWidth.min.mjs +1 -1
  62. package/dist/src/controls/changeWidth.min.mjs.map +1 -1
  63. package/dist/src/controls/changeWidth.mjs +2 -2
  64. package/dist/src/controls/changeWidth.mjs.map +1 -1
  65. package/dist/src/controls/commonControls.d.ts.map +1 -1
  66. package/dist/src/controls/commonControls.min.mjs +1 -1
  67. package/dist/src/controls/commonControls.min.mjs.map +1 -1
  68. package/dist/src/controls/commonControls.mjs +4 -3
  69. package/dist/src/controls/commonControls.mjs.map +1 -1
  70. package/dist/src/controls/controlRendering.min.mjs +1 -1
  71. package/dist/src/controls/controlRendering.min.mjs.map +1 -1
  72. package/dist/src/controls/controlRendering.mjs +3 -3
  73. package/dist/src/controls/controlRendering.mjs.map +1 -1
  74. package/dist/src/controls/drag.min.mjs +1 -1
  75. package/dist/src/controls/drag.min.mjs.map +1 -1
  76. package/dist/src/controls/drag.mjs +2 -2
  77. package/dist/src/controls/drag.mjs.map +1 -1
  78. package/dist/src/controls/polyControl.d.ts.map +1 -1
  79. package/dist/src/controls/polyControl.min.mjs +1 -1
  80. package/dist/src/controls/polyControl.min.mjs.map +1 -1
  81. package/dist/src/controls/polyControl.mjs +2 -1
  82. package/dist/src/controls/polyControl.mjs.map +1 -1
  83. package/dist/src/controls/rotate.d.ts.map +1 -1
  84. package/dist/src/controls/rotate.min.mjs +1 -1
  85. package/dist/src/controls/rotate.min.mjs.map +1 -1
  86. package/dist/src/controls/rotate.mjs +2 -1
  87. package/dist/src/controls/rotate.mjs.map +1 -1
  88. package/dist/src/controls/scale.d.ts.map +1 -1
  89. package/dist/src/controls/scale.min.mjs +1 -1
  90. package/dist/src/controls/scale.min.mjs.map +1 -1
  91. package/dist/src/controls/scale.mjs +8 -7
  92. package/dist/src/controls/scale.mjs.map +1 -1
  93. package/dist/src/controls/scaleSkew.d.ts.map +1 -1
  94. package/dist/src/controls/scaleSkew.min.mjs +1 -1
  95. package/dist/src/controls/scaleSkew.min.mjs.map +1 -1
  96. package/dist/src/controls/scaleSkew.mjs +3 -2
  97. package/dist/src/controls/scaleSkew.mjs.map +1 -1
  98. package/dist/src/controls/skew.d.ts.map +1 -1
  99. package/dist/src/controls/skew.min.mjs +1 -1
  100. package/dist/src/controls/skew.min.mjs.map +1 -1
  101. package/dist/src/controls/skew.mjs +7 -7
  102. package/dist/src/controls/skew.mjs.map +1 -1
  103. package/dist/src/filters/Blur.min.mjs +1 -1
  104. package/dist/src/filters/Blur.min.mjs.map +1 -1
  105. package/dist/src/filters/Blur.mjs +1 -1
  106. package/dist/src/filters/Blur.mjs.map +1 -1
  107. package/dist/src/filters/Pixelate.min.mjs +1 -1
  108. package/dist/src/filters/Pixelate.min.mjs.map +1 -1
  109. package/dist/src/filters/Pixelate.mjs +1 -1
  110. package/dist/src/filters/Pixelate.mjs.map +1 -1
  111. package/dist/src/parser/attributes.d.ts.map +1 -1
  112. package/dist/src/parser/attributes.min.mjs +1 -1
  113. package/dist/src/parser/attributes.min.mjs.map +1 -1
  114. package/dist/src/parser/attributes.mjs +3 -1
  115. package/dist/src/parser/attributes.mjs.map +1 -1
  116. package/dist/src/parser/elements_parser.min.mjs +1 -1
  117. package/dist/src/parser/elements_parser.min.mjs.map +1 -1
  118. package/dist/src/parser/elements_parser.mjs +3 -3
  119. package/dist/src/parser/elements_parser.mjs.map +1 -1
  120. package/dist/src/parser/normalizeValue.min.mjs +1 -1
  121. package/dist/src/parser/normalizeValue.min.mjs.map +1 -1
  122. package/dist/src/parser/normalizeValue.mjs +7 -7
  123. package/dist/src/parser/normalizeValue.mjs.map +1 -1
  124. package/dist/src/parser/parseTransformAttribute.min.mjs +1 -1
  125. package/dist/src/parser/parseTransformAttribute.min.mjs.map +1 -1
  126. package/dist/src/parser/parseTransformAttribute.mjs +5 -5
  127. package/dist/src/parser/parseTransformAttribute.mjs.map +1 -1
  128. package/dist/src/shapes/Circle.d.ts.map +1 -1
  129. package/dist/src/shapes/Circle.min.mjs +1 -1
  130. package/dist/src/shapes/Circle.min.mjs.map +1 -1
  131. package/dist/src/shapes/Circle.mjs +3 -2
  132. package/dist/src/shapes/Circle.mjs.map +1 -1
  133. package/dist/src/shapes/Ellipse.min.mjs +1 -1
  134. package/dist/src/shapes/Ellipse.min.mjs.map +1 -1
  135. package/dist/src/shapes/Ellipse.mjs +3 -3
  136. package/dist/src/shapes/Ellipse.mjs.map +1 -1
  137. package/dist/src/shapes/IText/DraggableTextDelegate.min.mjs +1 -1
  138. package/dist/src/shapes/IText/DraggableTextDelegate.min.mjs.map +1 -1
  139. package/dist/src/shapes/IText/DraggableTextDelegate.mjs +3 -3
  140. package/dist/src/shapes/IText/DraggableTextDelegate.mjs.map +1 -1
  141. package/dist/src/shapes/IText/IText.min.mjs +1 -1
  142. package/dist/src/shapes/IText/IText.min.mjs.map +1 -1
  143. package/dist/src/shapes/IText/IText.mjs +3 -3
  144. package/dist/src/shapes/IText/IText.mjs.map +1 -1
  145. package/dist/src/shapes/IText/ITextBehavior.min.mjs +1 -1
  146. package/dist/src/shapes/IText/ITextBehavior.min.mjs.map +1 -1
  147. package/dist/src/shapes/IText/ITextBehavior.mjs +2 -2
  148. package/dist/src/shapes/IText/ITextBehavior.mjs.map +1 -1
  149. package/dist/src/shapes/IText/ITextKeyBehavior.min.mjs +1 -1
  150. package/dist/src/shapes/IText/ITextKeyBehavior.min.mjs.map +1 -1
  151. package/dist/src/shapes/IText/ITextKeyBehavior.mjs +2 -2
  152. package/dist/src/shapes/IText/ITextKeyBehavior.mjs.map +1 -1
  153. package/dist/src/shapes/Image.min.mjs +1 -1
  154. package/dist/src/shapes/Image.min.mjs.map +1 -1
  155. package/dist/src/shapes/Image.mjs +2 -2
  156. package/dist/src/shapes/Image.mjs.map +1 -1
  157. package/dist/src/shapes/Object/AnimatableObject.d.ts.map +1 -1
  158. package/dist/src/shapes/Object/AnimatableObject.min.mjs +1 -1
  159. package/dist/src/shapes/Object/AnimatableObject.min.mjs.map +1 -1
  160. package/dist/src/shapes/Object/AnimatableObject.mjs +2 -1
  161. package/dist/src/shapes/Object/AnimatableObject.mjs.map +1 -1
  162. package/dist/src/shapes/Object/FabricObjectSVGExportMixin.d.ts.map +1 -1
  163. package/dist/src/shapes/Object/FabricObjectSVGExportMixin.min.mjs +1 -1
  164. package/dist/src/shapes/Object/FabricObjectSVGExportMixin.min.mjs.map +1 -1
  165. package/dist/src/shapes/Object/FabricObjectSVGExportMixin.mjs +4 -4
  166. package/dist/src/shapes/Object/FabricObjectSVGExportMixin.mjs.map +1 -1
  167. package/dist/src/shapes/Object/InteractiveObject.d.ts.map +1 -1
  168. package/dist/src/shapes/Object/InteractiveObject.min.mjs +1 -1
  169. package/dist/src/shapes/Object/InteractiveObject.min.mjs.map +1 -1
  170. package/dist/src/shapes/Object/InteractiveObject.mjs +2 -1
  171. package/dist/src/shapes/Object/InteractiveObject.mjs.map +1 -1
  172. package/dist/src/shapes/Object/Object.d.ts +9 -7
  173. package/dist/src/shapes/Object/Object.d.ts.map +1 -1
  174. package/dist/src/shapes/Object/Object.min.mjs +1 -1
  175. package/dist/src/shapes/Object/Object.min.mjs.map +1 -1
  176. package/dist/src/shapes/Object/Object.mjs +14 -12
  177. package/dist/src/shapes/Object/Object.mjs.map +1 -1
  178. package/dist/src/shapes/Object/ObjectGeometry.min.mjs +1 -1
  179. package/dist/src/shapes/Object/ObjectGeometry.min.mjs.map +1 -1
  180. package/dist/src/shapes/Object/ObjectGeometry.mjs +3 -3
  181. package/dist/src/shapes/Object/ObjectGeometry.mjs.map +1 -1
  182. package/dist/src/shapes/Object/defaultValues.d.ts.map +1 -1
  183. package/dist/src/shapes/Object/defaultValues.min.mjs +1 -1
  184. package/dist/src/shapes/Object/defaultValues.min.mjs.map +1 -1
  185. package/dist/src/shapes/Object/defaultValues.mjs +4 -4
  186. package/dist/src/shapes/Object/defaultValues.mjs.map +1 -1
  187. package/dist/src/shapes/Object/types/ControlProps.d.ts +4 -3
  188. package/dist/src/shapes/Object/types/ControlProps.d.ts.map +1 -1
  189. package/dist/src/shapes/Polyline.d.ts.map +1 -1
  190. package/dist/src/shapes/Polyline.min.mjs +1 -1
  191. package/dist/src/shapes/Polyline.min.mjs.map +1 -1
  192. package/dist/src/shapes/Polyline.mjs +3 -3
  193. package/dist/src/shapes/Polyline.mjs.map +1 -1
  194. package/dist/src/shapes/Text/Text.d.ts +2 -2
  195. package/dist/src/shapes/Text/Text.d.ts.map +1 -1
  196. package/dist/src/shapes/Text/Text.min.mjs +1 -1
  197. package/dist/src/shapes/Text/Text.min.mjs.map +1 -1
  198. package/dist/src/shapes/Text/Text.mjs +5 -5
  199. package/dist/src/shapes/Text/Text.mjs.map +1 -1
  200. package/dist/src/shapes/Text/TextSVGExportMixin.d.ts.map +1 -1
  201. package/dist/src/shapes/Text/TextSVGExportMixin.min.mjs +1 -1
  202. package/dist/src/shapes/Text/TextSVGExportMixin.min.mjs.map +1 -1
  203. package/dist/src/shapes/Text/TextSVGExportMixin.mjs +2 -1
  204. package/dist/src/shapes/Text/TextSVGExportMixin.mjs.map +1 -1
  205. package/dist/src/shapes/Text/constants.min.mjs +1 -1
  206. package/dist/src/shapes/Text/constants.min.mjs.map +1 -1
  207. package/dist/src/shapes/Text/constants.mjs +2 -2
  208. package/dist/src/shapes/Text/constants.mjs.map +1 -1
  209. package/dist/src/util/misc/objectEnlive.d.ts +1 -0
  210. package/dist/src/util/misc/objectEnlive.d.ts.map +1 -1
  211. package/dist/src/util/misc/objectEnlive.min.mjs.map +1 -1
  212. package/dist/src/util/misc/objectEnlive.mjs +1 -0
  213. package/dist/src/util/misc/objectEnlive.mjs.map +1 -1
  214. package/dist/src/util/misc/svgParsing.min.mjs +1 -1
  215. package/dist/src/util/misc/svgParsing.min.mjs.map +1 -1
  216. package/dist/src/util/misc/svgParsing.mjs +2 -2
  217. package/dist/src/util/misc/svgParsing.mjs.map +1 -1
  218. package/dist/src/util/transform_matrix_removal.min.mjs +1 -1
  219. package/dist/src/util/transform_matrix_removal.min.mjs.map +1 -1
  220. package/dist/src/util/transform_matrix_removal.mjs +3 -3
  221. package/dist/src/util/transform_matrix_removal.mjs.map +1 -1
  222. package/fabric.ts +4 -0
  223. package/package.json +1 -1
  224. package/src/EventTypeDefs.ts +14 -6
  225. package/src/LayoutManager/LayoutManager.ts +28 -19
  226. package/src/LayoutManager/LayoutStrategies/ClipPathLayout.ts +2 -2
  227. package/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts +7 -7
  228. package/src/Observable.ts +8 -0
  229. package/src/canvas/SelectableCanvas.ts +25 -11
  230. package/src/canvas/canvas_gestures.mixin.ts +6 -5
  231. package/src/constants.ts +17 -0
  232. package/src/controls/Control.ts +2 -1
  233. package/src/controls/changeWidth.ts +2 -2
  234. package/src/controls/commonControls.ts +4 -3
  235. package/src/controls/controlRendering.ts +3 -3
  236. package/src/controls/drag.ts +2 -2
  237. package/src/controls/polyControl.ts +2 -1
  238. package/src/controls/rotate.ts +2 -1
  239. package/src/controls/scale.ts +8 -7
  240. package/src/controls/scaleSkew.ts +3 -2
  241. package/src/controls/skew.ts +14 -7
  242. package/src/filters/Blur.ts +1 -1
  243. package/src/filters/Pixelate.ts +1 -1
  244. package/src/parser/attributes.ts +4 -2
  245. package/src/parser/elements_parser.ts +3 -3
  246. package/src/parser/normalizeValue.ts +7 -7
  247. package/src/parser/parseTransformAttribute.ts +5 -5
  248. package/src/shapes/Circle.ts +3 -2
  249. package/src/shapes/Ellipse.ts +3 -3
  250. package/src/shapes/IText/DraggableTextDelegate.ts +3 -3
  251. package/src/shapes/IText/IText.ts +3 -3
  252. package/src/shapes/IText/ITextBehavior.ts +2 -2
  253. package/src/shapes/IText/ITextKeyBehavior.ts +2 -2
  254. package/src/shapes/Image.ts +2 -2
  255. package/src/shapes/Object/AnimatableObject.ts +2 -1
  256. package/src/shapes/Object/FabricObjectSVGExportMixin.ts +4 -6
  257. package/src/shapes/Object/InteractiveObject.ts +2 -1
  258. package/src/shapes/Object/Object.ts +16 -11
  259. package/src/shapes/Object/ObjectGeometry.ts +3 -3
  260. package/src/shapes/Object/defaultValues.ts +17 -8
  261. package/src/shapes/Object/types/ControlProps.ts +4 -3
  262. package/src/shapes/Polyline.spec.ts +0 -1
  263. package/src/shapes/Polyline.ts +12 -4
  264. package/src/shapes/Text/Text.ts +7 -7
  265. package/src/shapes/Text/TextSVGExportMixin.ts +3 -2
  266. package/src/shapes/Text/constants.ts +3 -3
  267. package/src/util/misc/objectEnlive.ts +1 -0
  268. package/src/util/misc/svgParsing.ts +2 -2
  269. package/src/util/transform_matrix_removal.ts +3 -3
@@ -17,6 +17,7 @@ import {
17
17
  } from './util';
18
18
  import { wrapWithFireEvent } from './wrapWithFireEvent';
19
19
  import { wrapWithFixedAnchor } from './wrapWithFixedAnchor';
20
+ import { SCALE_X, SCALE_Y, SCALING } from '../constants';
20
21
 
21
22
  type ScaleTransform = Transform & {
22
23
  gestureScale?: number;
@@ -206,12 +207,12 @@ function scaleObject(
206
207
  const oldScaleX = target.scaleX,
207
208
  oldScaleY = target.scaleY;
208
209
  if (!by) {
209
- !isLocked(target, 'lockScalingX') && target.set('scaleX', scaleX);
210
- !isLocked(target, 'lockScalingY') && target.set('scaleY', scaleY);
210
+ !isLocked(target, 'lockScalingX') && target.set(SCALE_X, scaleX);
211
+ !isLocked(target, 'lockScalingY') && target.set(SCALE_Y, scaleY);
211
212
  } else {
212
213
  // forbidden cases already handled on top here.
213
- by === 'x' && target.set('scaleX', scaleX);
214
- by === 'y' && target.set('scaleY', scaleY);
214
+ by === 'x' && target.set(SCALE_X, scaleX);
215
+ by === 'y' && target.set(SCALE_Y, scaleY);
215
216
  }
216
217
  return oldScaleX !== target.scaleX || oldScaleY !== target.scaleY;
217
218
  }
@@ -271,16 +272,16 @@ const scaleObjectY: TransformActionHandler<ScaleTransform> = (
271
272
  };
272
273
 
273
274
  export const scalingEqually = wrapWithFireEvent(
274
- 'scaling',
275
+ SCALING,
275
276
  wrapWithFixedAnchor(scaleObjectFromCorner)
276
277
  );
277
278
 
278
279
  export const scalingX = wrapWithFireEvent(
279
- 'scaling',
280
+ SCALING,
280
281
  wrapWithFixedAnchor(scaleObjectX)
281
282
  );
282
283
 
283
284
  export const scalingY = wrapWithFireEvent(
284
- 'scaling',
285
+ SCALING,
285
286
  wrapWithFixedAnchor(scaleObjectY)
286
287
  );
@@ -4,6 +4,7 @@ import type {
4
4
  TPointerEvent,
5
5
  TransformActionHandler,
6
6
  } from '../EventTypeDefs';
7
+ import { SCALE_X, SCALE_Y, SKEW_X, SKEW_Y } from '../constants';
7
8
  import type { FabricObject } from '../shapes/Object/FabricObject';
8
9
  import type { TAxisKey } from '../typedefs';
9
10
  import { scaleCursorStyleHandler, scalingX, scalingY } from './scale';
@@ -26,11 +27,11 @@ export const scaleOrSkewActionName: ControlCallback<
26
27
  const isAlternative = isAltAction(eventData, fabricObject);
27
28
  if (control.x === 0) {
28
29
  // then is scaleY or skewX
29
- return isAlternative ? 'skewX' : 'scaleY';
30
+ return isAlternative ? SKEW_X : SCALE_Y;
30
31
  }
31
32
  if (control.y === 0) {
32
33
  // then is scaleY or skewX
33
- return isAlternative ? 'skewY' : 'scaleX';
34
+ return isAlternative ? SKEW_Y : SCALE_X;
34
35
  }
35
36
  return '';
36
37
  };
@@ -19,7 +19,14 @@ import {
19
19
  } from './util';
20
20
  import { wrapWithFireEvent } from './wrapWithFireEvent';
21
21
  import { wrapWithFixedAnchor } from './wrapWithFixedAnchor';
22
- import { CENTER } from '../constants';
22
+ import {
23
+ CENTER,
24
+ SCALE_X,
25
+ SCALE_Y,
26
+ SKEWING,
27
+ SKEW_X,
28
+ SKEW_Y,
29
+ } from '../constants';
23
30
 
24
31
  export type SkewTransform = Transform & { skewingSide: -1 | 1 };
25
32
 
@@ -36,16 +43,16 @@ const AXIS_KEYS: Record<
36
43
  > = {
37
44
  x: {
38
45
  counterAxis: 'y',
39
- scale: 'scaleX',
40
- skew: 'skewX',
46
+ scale: SCALE_X,
47
+ skew: SKEW_X,
41
48
  lockSkewing: 'lockSkewingX',
42
49
  origin: 'originX',
43
50
  flip: 'flipX',
44
51
  },
45
52
  y: {
46
53
  counterAxis: 'x',
47
- scale: 'scaleY',
48
- skew: 'skewY',
54
+ scale: SCALE_Y,
55
+ skew: SKEW_Y,
49
56
  lockSkewing: 'lockSkewingY',
50
57
  origin: 'originY',
51
58
  flip: 'flipY',
@@ -130,7 +137,7 @@ function skewObject(
130
137
  dimAfter = target._getTransformedDimensions(),
131
138
  compensationFactor = skewX !== 0 ? dimBefore.x / dimAfter.x : 1;
132
139
  compensationFactor !== 1 &&
133
- target.set('scaleX', compensationFactor * scaleX);
140
+ target.set(SCALE_X, compensationFactor * scaleX);
134
141
  }
135
142
 
136
143
  return changed;
@@ -188,7 +195,7 @@ function skewHandler(
188
195
  origin = -skewingDirection * 0.5 + 0.5;
189
196
 
190
197
  const finalHandler = wrapWithFireEvent<SkewTransform>(
191
- 'skewing',
198
+ SKEWING,
192
199
  wrapWithFixedAnchor((eventData, transform, x, y) =>
193
200
  skewObject(axis, transform, new Point(x, y))
194
201
  )
@@ -136,7 +136,7 @@ export class Blur extends BaseFilter<'Blur', BlurOwnProps> {
136
136
  uniformLocations: TWebGLUniformLocationMap
137
137
  ) {
138
138
  const delta = this.chooseRightDelta();
139
- gl.uniform2fv(uniformLocations.delta, delta);
139
+ gl.uniform2fv(uniformLocations.uDelta, delta);
140
140
  }
141
141
 
142
142
  isNeutralState() {
@@ -27,7 +27,7 @@ export class Pixelate extends BaseFilter<'Pixelate', PixelateOwnProps> {
27
27
 
28
28
  static defaults = pixelateDefaultValues;
29
29
 
30
- static uniformLocations = ['uBlockSize'];
30
+ static uniformLocations = ['uBlocksize'];
31
31
 
32
32
  /**
33
33
  * Apply the Pixelate operation to a Uint8ClampedArray representing the pixels of an image.
@@ -1,3 +1,5 @@
1
+ import { FILL, STROKE } from '../constants';
2
+
1
3
  /**
2
4
  * Attributes parsed from all SVG elements
3
5
  * @type array
@@ -5,11 +7,11 @@
5
7
  export const SHARED_ATTRIBUTES = [
6
8
  'display',
7
9
  'transform',
8
- 'fill',
10
+ FILL,
9
11
  'fill-opacity',
10
12
  'fill-rule',
11
13
  'opacity',
12
- 'stroke',
14
+ STROKE,
13
15
  'stroke-dasharray',
14
16
  'stroke-linecap',
15
17
  'stroke-dashoffset',
@@ -10,7 +10,7 @@ import {
10
10
  import { removeTransformMatrixForSvgParsing } from '../util/transform_matrix_removal';
11
11
  import type { FabricObject } from '../shapes/Object/FabricObject';
12
12
  import { Point } from '../Point';
13
- import { CENTER } from '../constants';
13
+ import { CENTER, FILL, STROKE } from '../constants';
14
14
  import { getGradientDefs } from './getGradientDefs';
15
15
  import { getCSSRules } from './getCSSRules';
16
16
  import type { LoadImageOptions } from '../util';
@@ -77,8 +77,8 @@ export class ElementsParser {
77
77
  this.options,
78
78
  this.cssRules
79
79
  );
80
- this.resolveGradient(obj, el, 'fill');
81
- this.resolveGradient(obj, el, 'stroke');
80
+ this.resolveGradient(obj, el, FILL);
81
+ this.resolveGradient(obj, el, STROKE);
82
82
  if (obj instanceof FabricImage && obj._originalElement) {
83
83
  removeTransformMatrixForSvgParsing(
84
84
  obj,
@@ -1,7 +1,7 @@
1
1
  import { multiplyTransformMatrices } from '../util/misc/matrix';
2
2
  import { parseUnit } from '../util/misc/svgParsing';
3
3
  import { parseTransformAttribute } from './parseTransformAttribute';
4
- import { CENTER, LEFT, RIGHT, NONE } from '../constants';
4
+ import { CENTER, LEFT, RIGHT, NONE, FILL, STROKE } from '../constants';
5
5
 
6
6
  export function normalizeValue(
7
7
  attr: string,
@@ -12,7 +12,7 @@ export function normalizeValue(
12
12
  const isArray = Array.isArray(value);
13
13
  let parsed: number | number[];
14
14
  let ouputValue: string | null | boolean | number[] | number = value;
15
- if ((attr === 'fill' || attr === 'stroke') && value === NONE) {
15
+ if ((attr === FILL || attr === STROKE) && value === NONE) {
16
16
  ouputValue = '';
17
17
  } else if (attr === 'strokeUniform') {
18
18
  return value === 'non-scaling-stroke';
@@ -48,13 +48,13 @@ export function normalizeValue(
48
48
  // parseUnit returns px and we convert it to em
49
49
  parsed = (parseUnit(value, fontSize) / fontSize) * 1000;
50
50
  } else if (attr === 'paintFirst') {
51
- const fillIndex = value.indexOf('fill');
52
- const strokeIndex = value.indexOf('stroke');
53
- ouputValue = 'fill';
51
+ const fillIndex = value.indexOf(FILL);
52
+ const strokeIndex = value.indexOf(STROKE);
53
+ ouputValue = FILL;
54
54
  if (fillIndex > -1 && strokeIndex > -1 && strokeIndex < fillIndex) {
55
- ouputValue = 'stroke';
55
+ ouputValue = STROKE;
56
56
  } else if (fillIndex === -1 && strokeIndex > -1) {
57
- ouputValue = 'stroke';
57
+ ouputValue = STROKE;
58
58
  }
59
59
  } else if (attr === 'href' || attr === 'xlink:href' || attr === 'font') {
60
60
  return value;
@@ -1,4 +1,4 @@
1
- import { iMatrix } from '../constants';
1
+ import { ROTATE, SCALE, SKEW_X, SKEW_Y, iMatrix } from '../constants';
2
2
  import { reNum } from './constants';
3
3
  import type { TMat2D } from '../typedefs';
4
4
  import { cleanupSvgAttribute } from '../util/internals/cleanupSvgAttribute';
@@ -70,16 +70,16 @@ export function parseTransformAttribute(attributeValue: string): TMat2D {
70
70
  case 'translate':
71
71
  matrix = createTranslateMatrix(arg0, arg1);
72
72
  break;
73
- case 'rotate':
73
+ case ROTATE:
74
74
  matrix = createRotateMatrix({ angle: arg0 }, { x: arg1, y: arg2 });
75
75
  break;
76
- case 'scale':
76
+ case SCALE:
77
77
  matrix = createScaleMatrix(arg0, arg1);
78
78
  break;
79
- case 'skewX':
79
+ case SKEW_X:
80
80
  matrix = createSkewXMatrix(arg0);
81
81
  break;
82
- case 'skewY':
82
+ case SKEW_Y:
83
83
  matrix = createSkewYMatrix(arg0);
84
84
  break;
85
85
  case 'matrix':
@@ -9,6 +9,7 @@ import { FabricObject, cacheProperties } from './Object/FabricObject';
9
9
  import type { Abortable, TClassProperties, TOptions } from '../typedefs';
10
10
  import type { FabricObjectProps, SerializedObjectProps } from './Object/types';
11
11
  import type { CSSRules } from '../parser/typedefs';
12
+ import { SCALE_X, SCALE_Y } from '../constants';
12
13
 
13
14
  interface UniqueCircleProps {
14
15
  /**
@@ -134,7 +135,7 @@ export class Circle<
134
135
  * @return {Number}
135
136
  */
136
137
  getRadiusX(): number {
137
- return this.get('radius') * this.get('scaleX');
138
+ return this.get('radius') * this.get(SCALE_X);
138
139
  }
139
140
 
140
141
  /**
@@ -142,7 +143,7 @@ export class Circle<
142
143
  * @return {Number}
143
144
  */
144
145
  getRadiusY(): number {
145
- return this.get('radius') * this.get('scaleY');
146
+ return this.get('radius') * this.get(SCALE_Y);
146
147
  }
147
148
 
148
149
  /**
@@ -1,4 +1,4 @@
1
- import { twoMathPi } from '../constants';
1
+ import { SCALE_X, SCALE_Y, twoMathPi } from '../constants';
2
2
  import { SHARED_ATTRIBUTES } from '../parser/attributes';
3
3
  import { parseAttributes } from '../parser/parseAttributes';
4
4
  import type { Abortable, TClassProperties, TOptions } from '../typedefs';
@@ -98,7 +98,7 @@ export class Ellipse<
98
98
  * @return {Number}
99
99
  */
100
100
  getRx() {
101
- return this.get('rx') * this.get('scaleX');
101
+ return this.get('rx') * this.get(SCALE_X);
102
102
  }
103
103
 
104
104
  /**
@@ -106,7 +106,7 @@ export class Ellipse<
106
106
  * @return {Number}
107
107
  */
108
108
  getRy() {
109
- return this.get('ry') * this.get('scaleY');
109
+ return this.get('ry') * this.get(SCALE_Y);
110
110
  }
111
111
 
112
112
  /**
@@ -10,7 +10,7 @@ import { setStyle } from '../../util/dom_style';
10
10
  import { cloneDeep } from '../../util/internals/cloneDeep';
11
11
  import type { TextStyleDeclaration } from '../Text/StyledText';
12
12
  import { getDocumentFromElement } from '../../util/dom_misc';
13
- import { NONE } from '../../constants';
13
+ import { CHANGED, NONE } from '../../constants';
14
14
 
15
15
  /**
16
16
  * #### Dragging IText/Textbox Lifecycle
@@ -326,7 +326,7 @@ export class DraggableTextDelegate {
326
326
  target.hiddenTextarea!.value = target.text;
327
327
  target._updateTextarea();
328
328
  target.hiddenTextarea!.focus();
329
- target.fire('changed', {
329
+ target.fire(CHANGED, {
330
330
  index: insertAt + selectionStartOffset,
331
331
  action: 'drop',
332
332
  });
@@ -364,7 +364,7 @@ export class DraggableTextDelegate {
364
364
  target.hiddenTextarea &&
365
365
  (target.hiddenTextarea.value = target.text);
366
366
  target._updateTextarea();
367
- target.fire('changed', {
367
+ target.fire(CHANGED, {
368
368
  index: selectionStart,
369
369
  action: 'dragend',
370
370
  });
@@ -16,7 +16,7 @@ import {
16
16
  JUSTIFY_LEFT,
17
17
  JUSTIFY_RIGHT,
18
18
  } from '../Text/constants';
19
- import { CENTER, LEFT, RIGHT } from '../../constants';
19
+ import { CENTER, FILL, LEFT, RIGHT } from '../../constants';
20
20
  import type { ObjectToCanvasElementOptions } from '../Object/Object';
21
21
 
22
22
  type CursorBoundaries = {
@@ -521,7 +521,7 @@ export class IText<
521
521
  }
522
522
  ctx.fillStyle =
523
523
  this.cursorColor ||
524
- (this.getValueOfPropertyAt(lineIndex, charIndex, 'fill') as string);
524
+ (this.getValueOfPropertyAt(lineIndex, charIndex, FILL) as string);
525
525
  ctx.globalAlpha = this._currentCursorOpacity;
526
526
  ctx.fillRect(
527
527
  boundaries.left + boundaries.leftOffset - cursorWidth / 2,
@@ -677,7 +677,7 @@ export class IText<
677
677
  */
678
678
  getCurrentCharColor(): string | TFiller | null {
679
679
  const cp = this._getCurrentCharIndex();
680
- return this.getValueOfPropertyAt(cp.l, cp.c, 'fill');
680
+ return this.getValueOfPropertyAt(cp.l, cp.c, FILL);
681
681
  }
682
682
 
683
683
  /**
@@ -13,7 +13,7 @@ import type { TextStyleDeclaration } from '../Text/StyledText';
13
13
  import type { SerializedTextProps, TextProps } from '../Text/Text';
14
14
  import type { TOptions } from '../../typedefs';
15
15
  import { getDocumentFromElement } from '../../util/dom_misc';
16
- import { LEFT, RIGHT, reNewline } from '../../constants';
16
+ import { LEFT, MODIFIED, RIGHT, reNewline } from '../../constants';
17
17
  import type { IText } from './IText';
18
18
 
19
19
  /**
@@ -696,7 +696,7 @@ export abstract class ITextBehavior<
696
696
  this.setCoords();
697
697
  }
698
698
  this.fire('editing:exited');
699
- isTextChanged && this.fire('modified');
699
+ isTextChanged && this.fire(MODIFIED);
700
700
  if (this.canvas) {
701
701
  this.canvas.fire('text:editing:exited', {
702
702
  target: this as unknown as IText,
@@ -7,7 +7,7 @@ import type { TKeyMapIText } from './constants';
7
7
  import type { TOptions } from '../../typedefs';
8
8
  import type { TextProps, SerializedTextProps } from '../Text/Text';
9
9
  import { getDocumentFromElement } from '../../util/dom_misc';
10
- import { LEFT, RIGHT } from '../../constants';
10
+ import { CHANGED, LEFT, RIGHT } from '../../constants';
11
11
  import type { IText } from './IText';
12
12
  import type { TextStyleDeclaration } from '../Text/StyledText';
13
13
 
@@ -173,7 +173,7 @@ export abstract class ITextKeyBehavior<
173
173
  }
174
174
  const updateAndFire = () => {
175
175
  this.updateFromTextArea();
176
- this.fire('changed');
176
+ this.fire(CHANGED);
177
177
  if (this.canvas) {
178
178
  this.canvas.fire('text:changed', { target: this as unknown as IText });
179
179
  this.canvas.requestRenderAll();
@@ -25,7 +25,7 @@ import { FabricObject, cacheProperties } from './Object/FabricObject';
25
25
  import type { FabricObjectProps, SerializedObjectProps } from './Object/types';
26
26
  import type { ObjectEvents } from '../EventTypeDefs';
27
27
  import { WebGLFilterBackend } from '../filters/WebGLFilterBackend';
28
- import { NONE } from '../constants';
28
+ import { FILL, NONE } from '../constants';
29
29
  import { getDocumentFromElement } from '../util/dom_misc';
30
30
  import type { CSSRules } from '../parser/typedefs';
31
31
  import type { Resize } from '../filters/Resize';
@@ -419,7 +419,7 @@ export class FabricImage<
419
419
  ];
420
420
  this.fill = origFill;
421
421
  }
422
- if (this.paintFirst !== 'fill') {
422
+ if (this.paintFirst !== FILL) {
423
423
  svgString = svgString.concat(strokeSvg, imageMarkup);
424
424
  } else {
425
425
  svgString = svgString.concat(imageMarkup, strokeSvg);
@@ -1,4 +1,5 @@
1
1
  import type { TColorArg } from '../../color/typedefs';
2
+ import { FILL, STROKE } from '../../constants';
2
3
  import type { ObjectEvents } from '../../EventTypeDefs';
3
4
  import type { TAnimation } from '../../util/animation/animate';
4
5
  import { animate, animateColor } from '../../util/animation/animate';
@@ -17,7 +18,7 @@ export abstract class AnimatableObject<
17
18
  * List of properties to consider for animating colors.
18
19
  * @type String[]
19
20
  */
20
- static colorProperties: string[] = ['fill', 'stroke', 'backgroundColor'];
21
+ static colorProperties: string[] = [FILL, STROKE, 'backgroundColor'];
21
22
 
22
23
  /**
23
24
  * Animates object's properties
@@ -1,7 +1,7 @@
1
1
  import type { TSVGReviver } from '../../typedefs';
2
2
  import { uid } from '../../util/internals/uid';
3
3
  import { colorPropToSVG, matrixToSVG } from '../../util/misc/svgParsing';
4
- import { NONE } from '../../constants';
4
+ import { FILL, NONE, STROKE } from '../../constants';
5
5
  import type { FabricObject } from './FabricObject';
6
6
  import { isFiller } from '../../util/typeAssertions';
7
7
 
@@ -34,8 +34,8 @@ export class FabricObjectSVGExportMixin {
34
34
  opacity = typeof this.opacity !== 'undefined' ? this.opacity : '1',
35
35
  visibility = this.visible ? '' : ' visibility: hidden;',
36
36
  filter = skipShadow ? '' : this.getSvgFilter(),
37
- fill = colorPropToSVG('fill', this.fill),
38
- stroke = colorPropToSVG('stroke', this.stroke);
37
+ fill = colorPropToSVG(FILL, this.fill),
38
+ stroke = colorPropToSVG(STROKE, this.stroke);
39
39
 
40
40
  return [
41
41
  stroke,
@@ -247,8 +247,6 @@ export class FabricObjectSVGExportMixin {
247
247
  }
248
248
 
249
249
  addPaintOrder(this: FabricObjectSVGExportMixin & FabricObject) {
250
- return this.paintFirst !== 'fill'
251
- ? ` paint-order="${this.paintFirst}" `
252
- : '';
250
+ return this.paintFirst !== FILL ? ` paint-order="${this.paintFirst}" ` : '';
253
251
  }
254
252
  }
@@ -19,6 +19,7 @@ import type { FabricObjectProps } from './types/FabricObjectProps';
19
19
  import type { TFabricObjectProps, SerializedObjectProps } from './types';
20
20
  import { createObjectDefaultControls } from '../../controls/commonControls';
21
21
  import { interactiveObjectDefaultValues } from './defaultValues';
22
+ import { SCALE } from '../../constants';
22
23
 
23
24
  export type TOCoord = Point & {
24
25
  corner: TCornerPoint;
@@ -182,7 +183,7 @@ export class InteractiveFabricObject<
182
183
  if (
183
184
  this === (target as unknown as this) &&
184
185
  action &&
185
- action.startsWith('scale')
186
+ action.startsWith(SCALE)
186
187
  ) {
187
188
  return false;
188
189
  }
@@ -5,6 +5,9 @@ import {
5
5
  CENTER,
6
6
  iMatrix,
7
7
  LEFT,
8
+ SCALE_X,
9
+ SCALE_Y,
10
+ STROKE,
8
11
  TOP,
9
12
  VERSION,
10
13
  } from '../../constants';
@@ -282,19 +285,21 @@ export class FabricObject<
282
285
  }
283
286
 
284
287
  /**
285
- * The class type. Used to identify which class this is.
286
- * This is used for serialization purposes and internally it can be used
287
- * to identify classes. As a developer you could use `instance of Class`
288
- * but to avoid importing all the code and blocking tree shaking we try
289
- * to avoid doing that.
288
+ * The class type.
289
+ * This is used for serialization and deserialization purposes and internally it can be used
290
+ * to identify classes.
291
+ * When we transform a class in a plain JS object we need a way to recognize which class it was,
292
+ * and the type is the way we do that. It has no other purposes and you should not give one.
293
+ * Hard to reach on instances and please do not use to drive instance's logic (this.constructor.type).
294
+ * To idenfity a class use instanceof class ( instanceof Rect ).
295
+ * We do not do that in fabricJS code because we want to try to have code splitting possible.
290
296
  */
291
297
  static type = 'FabricObject';
292
298
 
293
299
  /**
294
300
  * Legacy identifier of the class. Prefer using utils like isType or instanceOf
295
301
  * Will be removed in fabric 7 or 8.
296
- * The setter exists because is very hard to catch all the ways in which a type value
297
- * could be set in the instance
302
+ * The setter exists to avoid type errors in old code and possibly current deserialization code.
298
303
  * @TODO add sustainable warning message
299
304
  * @type string
300
305
  * @deprecated
@@ -698,10 +703,10 @@ export class FabricObject<
698
703
  * @param {*} value
699
704
  */
700
705
  _set(key: string, value: any) {
701
- if (key === 'scaleX' || key === 'scaleY') {
706
+ if (key === SCALE_X || key === SCALE_Y) {
702
707
  value = this._constrainScale(value);
703
708
  }
704
- if (key === 'scaleX' && value < 0) {
709
+ if (key === SCALE_X && value < 0) {
705
710
  this.flipX = !this.flipX;
706
711
  value *= -1;
707
712
  } else if (key === 'scaleY' && value < 0) {
@@ -847,7 +852,7 @@ export class FabricObject<
847
852
  */
848
853
  needsItsOwnCache() {
849
854
  if (
850
- this.paintFirst === 'stroke' &&
855
+ this.paintFirst === STROKE &&
851
856
  this.hasFill() &&
852
857
  this.hasStroke() &&
853
858
  !!this.shadow
@@ -1181,7 +1186,7 @@ export class FabricObject<
1181
1186
  * @param {CanvasRenderingContext2D} ctx Context to render on
1182
1187
  */
1183
1188
  _renderPaintInOrder(ctx: CanvasRenderingContext2D) {
1184
- if (this.paintFirst === 'stroke') {
1189
+ if (this.paintFirst === STROKE) {
1185
1190
  this._renderStroke(ctx);
1186
1191
  this._renderFill(ctx);
1187
1192
  } else {
@@ -6,7 +6,7 @@ import type {
6
6
  TOriginX,
7
7
  TOriginY,
8
8
  } from '../../typedefs';
9
- import { iMatrix } from '../../constants';
9
+ import { SCALE_X, SCALE_Y, iMatrix } from '../../constants';
10
10
  import { Intersection } from '../../Intersection';
11
11
  import { Point } from '../../Point';
12
12
  import { makeBoundingBoxFromPoints } from '../../util/misc/boundingBoxFromPoints';
@@ -356,8 +356,8 @@ export class ObjectGeometry<EventSpec extends ObjectEvents = ObjectEvents>
356
356
  * @return {void}
357
357
  */
358
358
  scale(value: number): void {
359
- this._set('scaleX', value);
360
- this._set('scaleY', value);
359
+ this._set(SCALE_X, value);
360
+ this._set(SCALE_Y, value);
361
361
  this.setCoords();
362
362
  }
363
363
 
@@ -1,4 +1,13 @@
1
- import { TOP, LEFT } from '../../constants';
1
+ import {
2
+ TOP,
3
+ LEFT,
4
+ SCALE_Y,
5
+ SCALE_X,
6
+ SKEW_X,
7
+ SKEW_Y,
8
+ FILL,
9
+ STROKE,
10
+ } from '../../constants';
2
11
  import type { TClassProperties } from '../../typedefs';
3
12
  import type { InteractiveFabricObject } from './InteractiveObject';
4
13
  import type { FabricObject } from './Object';
@@ -6,8 +15,8 @@ import type { FabricObject } from './Object';
6
15
  export const stateProperties = [
7
16
  TOP,
8
17
  LEFT,
9
- 'scaleX',
10
- 'scaleY',
18
+ SCALE_X,
19
+ SCALE_Y,
11
20
  'flipX',
12
21
  'flipY',
13
22
  'originX',
@@ -17,13 +26,13 @@ export const stateProperties = [
17
26
  'globalCompositeOperation',
18
27
  'shadow',
19
28
  'visible',
20
- 'skewX',
21
- 'skewY',
29
+ SKEW_X,
30
+ SKEW_Y,
22
31
  ];
23
32
 
24
33
  export const cacheProperties = [
25
- 'fill',
26
- 'stroke',
34
+ FILL,
35
+ STROKE,
27
36
  'strokeWidth',
28
37
  'strokeDashArray',
29
38
  'width',
@@ -60,7 +69,7 @@ export const fabricObjectDefaultValues: Partial<
60
69
  strokeUniform: false,
61
70
  padding: 0,
62
71
  opacity: 1,
63
- paintFirst: 'fill',
72
+ paintFirst: FILL,
64
73
  fill: 'rgb(0,0,0)',
65
74
  fillRule: 'nonzero',
66
75
  stroke: null,
@@ -31,7 +31,7 @@ export interface ControlProps {
31
31
  * Color of controlling corners of an object (when it's active and transparentCorners false)
32
32
  * @since 1.6.2
33
33
  * @type String
34
- * @default null
34
+ * @default ''
35
35
  */
36
36
  cornerStrokeColor: string;
37
37
 
@@ -41,7 +41,7 @@ export interface ControlProps {
41
41
  * And you can swap it with one of the alternative proposed with the control api
42
42
  * @since 1.6.2
43
43
  * @type 'rect' | 'circle'
44
- * @default rect
44
+ * @default 'rect'
45
45
  * @deprecated
46
46
  */
47
47
  cornerStyle: 'rect' | 'circle';
@@ -50,6 +50,7 @@ export interface ControlProps {
50
50
  * Array specifying dash pattern of an object's control (hasBorder must be true)
51
51
  * @since 1.6.2
52
52
  * @type Array | null
53
+ * @default null
53
54
  */
54
55
  cornerDashArray: number[] | null;
55
56
 
@@ -63,7 +64,7 @@ export interface ControlProps {
63
64
  /**
64
65
  * When set to `false`, object's controls are not displayed and can not be used to manipulate object
65
66
  * @type Boolean
66
- * @default
67
+ * @default true
67
68
  */
68
69
  hasControls: boolean;
69
70
  }
@@ -106,7 +106,6 @@ describe('Polyline', () => {
106
106
  });
107
107
  });
108
108
  });
109
-
110
109
  it('should safeguard passing points in options', () => {
111
110
  expect(new Polyline(points, { points: [{ x: 1, y: 1 }] })).toEqual(
112
111
  expect.objectContaining({