fabric 6.0.0-beta8 → 6.0.0-beta9

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 (98) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/index.js +76 -34
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.min.js +1 -1
  5. package/dist/index.mjs +76 -34
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/index.node.cjs +76 -34
  8. package/dist/index.node.cjs.map +1 -1
  9. package/dist/index.node.mjs +76 -34
  10. package/dist/index.node.mjs.map +1 -1
  11. package/dist/src/Pattern/Pattern.d.ts +4 -3
  12. package/dist/src/canvas/Canvas.d.ts +2 -3
  13. package/dist/src/canvas/SelectableCanvas.d.ts +3 -3
  14. package/dist/src/filters/BaseFilter.d.ts +8 -0
  15. package/dist/src/filters/BlendColor.d.ts +1 -0
  16. package/dist/src/filters/BlendImage.d.ts +1 -0
  17. package/dist/src/filters/Blur.d.ts +1 -0
  18. package/dist/src/filters/Brightness.d.ts +1 -0
  19. package/dist/src/filters/ColorMatrix.d.ts +1 -0
  20. package/dist/src/filters/ColorMatrixFilters.d.ts +8 -0
  21. package/dist/src/filters/Composed.d.ts +1 -0
  22. package/dist/src/filters/Contrast.d.ts +1 -0
  23. package/dist/src/filters/Convolute.d.ts +1 -0
  24. package/dist/src/filters/Gamma.d.ts +1 -0
  25. package/dist/src/filters/Grayscale.d.ts +1 -0
  26. package/dist/src/filters/HueRotation.d.ts +1 -0
  27. package/dist/src/filters/Invert.d.ts +1 -0
  28. package/dist/src/filters/Noise.d.ts +1 -0
  29. package/dist/src/filters/Pixelate.d.ts +1 -0
  30. package/dist/src/filters/RemoveColor.d.ts +1 -0
  31. package/dist/src/filters/Resize.d.ts +1 -0
  32. package/dist/src/filters/Saturation.d.ts +1 -0
  33. package/dist/src/filters/Vibrance.d.ts +1 -0
  34. package/dist/src/gradient/Gradient.d.ts +1 -0
  35. package/dist/src/shapes/ActiveSelection.d.ts +1 -0
  36. package/dist/src/shapes/Circle.d.ts +1 -0
  37. package/dist/src/shapes/Ellipse.d.ts +1 -0
  38. package/dist/src/shapes/Group.d.ts +2 -0
  39. package/dist/src/shapes/IText/IText.d.ts +3 -2
  40. package/dist/src/shapes/Image.d.ts +1 -0
  41. package/dist/src/shapes/Line.d.ts +1 -0
  42. package/dist/src/shapes/Object/InteractiveObject.d.ts +3 -3
  43. package/dist/src/shapes/Object/Object.d.ts +8 -0
  44. package/dist/src/shapes/Path.d.ts +1 -0
  45. package/dist/src/shapes/Polygon.d.ts +1 -0
  46. package/dist/src/shapes/Polyline.d.ts +1 -0
  47. package/dist/src/shapes/Rect.d.ts +1 -0
  48. package/dist/src/shapes/Text/Text.d.ts +1 -0
  49. package/dist/src/shapes/Textbox.d.ts +1 -0
  50. package/dist/src/shapes/Triangle.d.ts +1 -0
  51. package/dist/src/typedefs.d.ts +0 -1
  52. package/lib/aligning_guidelines.js +2 -2
  53. package/package.json +1 -1
  54. package/src/ClassRegistry.ts +3 -3
  55. package/src/Pattern/Pattern.ts +5 -3
  56. package/src/canvas/Canvas.ts +4 -10
  57. package/src/canvas/SelectableCanvas.ts +4 -16
  58. package/src/filters/BaseFilter.ts +10 -1
  59. package/src/filters/BlendColor.ts +2 -0
  60. package/src/filters/BlendImage.ts +2 -0
  61. package/src/filters/Blur.ts +2 -0
  62. package/src/filters/Brightness.ts +2 -0
  63. package/src/filters/ColorMatrix.ts +2 -0
  64. package/src/filters/ColorMatrixFilters.ts +2 -0
  65. package/src/filters/Composed.ts +2 -0
  66. package/src/filters/Contrast.ts +2 -0
  67. package/src/filters/Convolute.ts +2 -0
  68. package/src/filters/Gamma.ts +2 -0
  69. package/src/filters/Grayscale.ts +2 -0
  70. package/src/filters/HueRotation.ts +2 -0
  71. package/src/filters/Invert.ts +2 -0
  72. package/src/filters/Noise.ts +2 -0
  73. package/src/filters/Pixelate.ts +2 -0
  74. package/src/filters/RemoveColor.ts +2 -0
  75. package/src/filters/Resize.ts +2 -0
  76. package/src/filters/Saturation.ts +2 -0
  77. package/src/filters/Vibrance.ts +2 -0
  78. package/src/gradient/Gradient.ts +2 -0
  79. package/src/shapes/ActiveSelection.ts +3 -0
  80. package/src/shapes/Circle.ts +2 -0
  81. package/src/shapes/Ellipse.ts +2 -0
  82. package/src/shapes/Group.ts +2 -0
  83. package/src/shapes/IText/IText.ts +5 -3
  84. package/src/shapes/IText/ITextBehavior.ts +4 -0
  85. package/src/shapes/IText/ITextClickBehavior.ts +6 -1
  86. package/src/shapes/Image.ts +2 -0
  87. package/src/shapes/Line.ts +2 -0
  88. package/src/shapes/Object/InteractiveObject.ts +3 -3
  89. package/src/shapes/Object/Object.ts +16 -4
  90. package/src/shapes/Path.ts +2 -0
  91. package/src/shapes/Polygon.ts +2 -0
  92. package/src/shapes/Polyline.ts +7 -1
  93. package/src/shapes/Rect.ts +2 -0
  94. package/src/shapes/Text/StyledText.ts +7 -16
  95. package/src/shapes/Text/Text.ts +2 -0
  96. package/src/shapes/Textbox.ts +4 -2
  97. package/src/shapes/Triangle.ts +2 -0
  98. package/src/typedefs.ts +0 -2
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## [next]
4
4
 
5
+ ## [6.0.0-beta9]
6
+
7
+ - fix(fabric): Fix the serialization and registry dependency from minification [#9009](https://github.com/fabricjs/fabric.js/pull/9009)
8
+ - chore(TS): remove troublesome `AssertKeys` TS construct [#9012](https://github.com/fabricjs/fabric.js/pull/9012)
9
+ - fix(lib): fix aligning_guideline zoom [#8998](https://github.com/fabricjs/fabric.js/pull/8998)
10
+ - fix(IText): support control interaction in text editing mode [#8995](https://github.com/fabricjs/fabric.js/pull/8995)
11
+ - fix(Textbox): `splitByGrapheme` measurements infix length bug [#8990](https://github.com/fabricjs/fabric.js/pull/8990)
12
+ - patch(Text): styles es6 minor patch [#8988](https://github.com/fabricjs/fabric.js/pull/8988)
13
+
5
14
  ## [6.0.0-beta8]
6
15
 
7
16
  - BREAKING fix(IText): detect cursor from proper offsets, remove getLocalPointer from IText class [#8972](https://github.com/fabricjs/fabric.js/pull/8972)
package/dist/index.js CHANGED
@@ -416,7 +416,7 @@
416
416
  }
417
417
  const cache = new Cache();
418
418
 
419
- var version = "6.0.0-beta8";
419
+ var version = "6.0.0-beta9";
420
420
 
421
421
  // use this syntax so babel plugin see this import here
422
422
  const VERSION = version;
@@ -472,17 +472,17 @@
472
472
  if (classType) {
473
473
  this[JSON$1].set(classType, classConstructor);
474
474
  } else {
475
- this[JSON$1].set(classConstructor.name, classConstructor);
475
+ this[JSON$1].set(classConstructor.type, classConstructor);
476
476
  // legacy
477
477
  // @TODO: needs to be removed in fabric 7 or 8
478
- this[JSON$1].set(classConstructor.name.toLowerCase(), classConstructor);
478
+ this[JSON$1].set(classConstructor.type.toLowerCase(), classConstructor);
479
479
  }
480
480
  }
481
481
  getSVGClass(SVGTagName) {
482
482
  return this[SVG].get(SVGTagName);
483
483
  }
484
484
  setSVGClass(classConstructor, SVGTagName) {
485
- this[SVG].set(SVGTagName !== null && SVGTagName !== void 0 ? SVGTagName : classConstructor.name.toLowerCase(), classConstructor);
485
+ this[SVG].set(SVGTagName !== null && SVGTagName !== void 0 ? SVGTagName : classConstructor.type.toLowerCase(), classConstructor);
486
486
  }
487
487
  }
488
488
  const classRegistry = new ClassRegistry();
@@ -7364,6 +7364,14 @@
7364
7364
  return _objectSpread2({}, FabricObject.ownDefaults);
7365
7365
  }
7366
7366
 
7367
+ /**
7368
+ * The class type. Used to identify which class this is.
7369
+ * This is used for serialization purposes and internally it can be used
7370
+ * to identify classes. As a developer you could use `instance of Class`
7371
+ * but to avoid importing all the code and blocking tree shaking we try
7372
+ * to avoid doing that.
7373
+ */
7374
+
7367
7375
  /**
7368
7376
  * Legacy identifier of the class. Prefer using utils like isType or instanceOf
7369
7377
  * Will be removed in fabric 7 or 8.
@@ -7374,7 +7382,7 @@
7374
7382
  * @deprecated
7375
7383
  */
7376
7384
  get type() {
7377
- const name = this.constructor.name;
7385
+ const name = this.constructor.type;
7378
7386
  if (name === 'FabricObject') {
7379
7387
  return 'object';
7380
7388
  }
@@ -7588,7 +7596,7 @@
7588
7596
  absolutePositioned: this.clipPath.absolutePositioned
7589
7597
  }) : null,
7590
7598
  object = _objectSpread2(_objectSpread2({}, pick(this, propertiesToInclude)), {}, {
7591
- type: this.constructor.name,
7599
+ type: this.constructor.type,
7592
7600
  version: VERSION,
7593
7601
  originX: this.originX,
7594
7602
  originY: this.originY,
@@ -7661,7 +7669,7 @@
7661
7669
  * @return {String}
7662
7670
  */
7663
7671
  toString() {
7664
- return "#<".concat(this.constructor.name, ">");
7672
+ return "#<".concat(this.constructor.type, ">");
7665
7673
  }
7666
7674
 
7667
7675
  /**
@@ -8413,7 +8421,7 @@
8413
8421
  for (var _len = arguments.length, types = new Array(_len), _key = 0; _key < _len; _key++) {
8414
8422
  types[_key] = arguments[_key];
8415
8423
  }
8416
- return types.includes(this.constructor.name) || types.includes(this.type);
8424
+ return types.includes(this.constructor.type) || types.includes(this.type);
8417
8425
  }
8418
8426
 
8419
8427
  /**
@@ -8530,6 +8538,7 @@
8530
8538
  _defineProperty(FabricObject$1, "stateProperties", stateProperties);
8531
8539
  _defineProperty(FabricObject$1, "cacheProperties", cacheProperties);
8532
8540
  _defineProperty(FabricObject$1, "ownDefaults", fabricObjectDefaultValues);
8541
+ _defineProperty(FabricObject$1, "type", 'FabricObject');
8533
8542
  classRegistry.setClass(FabricObject$1);
8534
8543
  classRegistry.setClass(FabricObject$1, 'object');
8535
8544
 
@@ -10715,6 +10724,7 @@
10715
10724
 
10716
10725
  /* _FROM_SVG_END_ */
10717
10726
  }
10727
+ _defineProperty(Rect, "type", 'Rect');
10718
10728
  _defineProperty(Rect, "cacheProperties", [...cacheProperties, ...RECT_PROPS]);
10719
10729
  _defineProperty(Rect, "ownDefaults", rectDefaultValues);
10720
10730
  _defineProperty(Rect, "ATTRIBUTE_NAMES", [...SHARED_ATTRIBUTES, 'x', 'y', 'rx', 'ry', 'width', 'height']);
@@ -11596,6 +11606,7 @@
11596
11606
  }
11597
11607
  }
11598
11608
  _defineProperty(Group, "stateProperties", [...FabricObject.stateProperties, 'layout']);
11609
+ _defineProperty(Group, "type", 'Group');
11599
11610
  _defineProperty(Group, "ownDefaults", groupDefaultValues);
11600
11611
  classRegistry.setClass(Group);
11601
11612
 
@@ -11606,8 +11617,7 @@
11606
11617
  * - `selection-order` adds the selected object to the top of the stack,
11607
11618
  * meaning that the stack is ordered by the order in which objects were selected
11608
11619
  * @default `canvas-stacking`
11609
- */
11610
-
11620
+ */ // TODO FIX THIS WITH THE DEFAULTS LOGIC
11611
11621
  constructor(objects, options, objectsRelativeToGroup) {
11612
11622
  super(objects, options, objectsRelativeToGroup);
11613
11623
  _defineProperty(this, "multiSelectionStacking", 'canvas-stacking');
@@ -11768,6 +11778,7 @@
11768
11778
  ctx.restore();
11769
11779
  }
11770
11780
  }
11781
+ _defineProperty(ActiveSelection, "type", 'ActiveSelection');
11771
11782
  classRegistry.setClass(ActiveSelection);
11772
11783
  classRegistry.setClass(ActiveSelection, 'activeSelection');
11773
11784
 
@@ -16605,7 +16616,7 @@
16605
16616
  }
16606
16617
  /* _FROM_SVG_END_ */
16607
16618
  }
16608
-
16619
+ _defineProperty(Gradient, "type", 'Gradient');
16609
16620
  classRegistry.setClass(Gradient, 'gradient');
16610
16621
 
16611
16622
  const _excluded$b = ["source"];
@@ -16615,9 +16626,9 @@
16615
16626
  */
16616
16627
  class Pattern {
16617
16628
  /**
16618
- * Legacy identifier of the class. Prefer using this.constructor.name 'Pattern'
16619
- * or utils like isPattern
16620
- * Will be removed in fabric 7 or 8.
16629
+ * Legacy identifier of the class. Prefer using this.constructor.type 'Pattern'
16630
+ * or utils like isPattern, or instance of to indentify a pattern in your code.
16631
+ * Will be removed in future versiones
16621
16632
  * @TODO add sustainable warning message
16622
16633
  * @type string
16623
16634
  * @deprecated
@@ -16778,6 +16789,7 @@
16778
16789
  }));
16779
16790
  }
16780
16791
  }
16792
+ _defineProperty(Pattern, "type", 'Pattern');
16781
16793
  classRegistry.setClass(Pattern);
16782
16794
  // kept for compatibility reason
16783
16795
  classRegistry.setClass(Pattern, 'pattern');
@@ -17243,6 +17255,7 @@
17243
17255
  }));
17244
17256
  }
17245
17257
  }
17258
+ _defineProperty(Path, "type", 'Path');
17246
17259
  _defineProperty(Path, "cacheProperties", [...cacheProperties, 'path', 'fillRule']);
17247
17260
  _defineProperty(Path, "ATTRIBUTE_NAMES", [...SHARED_ATTRIBUTES, 'd']);
17248
17261
  classRegistry.setClass(Path);
@@ -17678,6 +17691,7 @@
17678
17691
  return super._fromObject(object);
17679
17692
  }
17680
17693
  }
17694
+ _defineProperty(Circle, "type", 'Circle');
17681
17695
  _defineProperty(Circle, "cacheProperties", [...cacheProperties, ...CIRCLE_PROPS]);
17682
17696
  _defineProperty(Circle, "ownDefaults", circleDefaultValues);
17683
17697
  _defineProperty(Circle, "ATTRIBUTE_NAMES", ['cx', 'cy', 'r', ...SHARED_ATTRIBUTES]);
@@ -18312,6 +18326,7 @@
18312
18326
  });
18313
18327
  }
18314
18328
  }
18329
+ _defineProperty(Line, "type", 'Line');
18315
18330
  _defineProperty(Line, "cacheProperties", [...cacheProperties, ...coordProps]);
18316
18331
  _defineProperty(Line, "ATTRIBUTE_NAMES", SHARED_ATTRIBUTES.concat(coordProps));
18317
18332
  classRegistry.setClass(Line);
@@ -18353,6 +18368,7 @@
18353
18368
  return ['<polygon ', 'COMMON_PARTS', 'points="', points, '" />'];
18354
18369
  }
18355
18370
  }
18371
+ _defineProperty(Triangle, "type", 'Triangle');
18356
18372
  _defineProperty(Triangle, "ownDefaults", triangleDefaultValues);
18357
18373
  classRegistry.setClass(Triangle);
18358
18374
  classRegistry.setSVGClass(Triangle);
@@ -18472,6 +18488,7 @@
18472
18488
 
18473
18489
  /* _FROM_SVG_END_ */
18474
18490
  }
18491
+ _defineProperty(Ellipse, "type", 'Ellipse');
18475
18492
  _defineProperty(Ellipse, "cacheProperties", [...cacheProperties, ...ELLIPSE_PROPS]);
18476
18493
  _defineProperty(Ellipse, "ownDefaults", ellipseDefaultValues);
18477
18494
  _defineProperty(Ellipse, "ATTRIBUTE_NAMES", [...SHARED_ATTRIBUTES, 'cx', 'cy', 'rx', 'ry']);
@@ -18701,7 +18718,7 @@
18701
18718
  for (let i = 0, len = this.points.length; i < len; i++) {
18702
18719
  points.push(toFixed(this.points[i].x - diffX, NUM_FRACTION_DIGITS), ',', toFixed(this.points[i].y - diffY, NUM_FRACTION_DIGITS), ' ');
18703
18720
  }
18704
- return ["<".concat(this.constructor.name.toLowerCase(), " "), 'COMMON_PARTS', "points=\"".concat(points.join(''), "\" />\n")];
18721
+ return ["<".concat(this.constructor.type.toLowerCase(), " "), 'COMMON_PARTS', "points=\"".concat(points.join(''), "\" />\n")];
18705
18722
  }
18706
18723
 
18707
18724
  /**
@@ -18773,6 +18790,7 @@
18773
18790
  }
18774
18791
  }
18775
18792
  _defineProperty(Polyline, "ownDefaults", polylineDefaultValues);
18793
+ _defineProperty(Polyline, "type", 'Polyline');
18776
18794
  _defineProperty(Polyline, "layoutProperties", ['skewX', 'skewY', 'strokeLineCap', 'strokeLineJoin', 'strokeMiterLimit', 'strokeWidth', 'strokeUniform', 'points']);
18777
18795
  _defineProperty(Polyline, "cacheProperties", [...cacheProperties, 'points']);
18778
18796
  _defineProperty(Polyline, "ATTRIBUTE_NAMES", [...SHARED_ATTRIBUTES]);
@@ -18788,6 +18806,7 @@
18788
18806
  }
18789
18807
  }
18790
18808
  _defineProperty(Polygon, "ownDefaults", polylineDefaultValues);
18809
+ _defineProperty(Polygon, "type", 'Polygon');
18791
18810
  classRegistry.setClass(Polygon);
18792
18811
  classRegistry.setSVGClass(Polygon);
18793
18812
 
@@ -19059,10 +19078,7 @@
19059
19078
  */
19060
19079
  _getStyleDeclaration(lineIndex, charIndex) {
19061
19080
  const lineStyle = this.styles && this.styles[lineIndex];
19062
- if (!lineStyle) {
19063
- return null;
19064
- }
19065
- return lineStyle[charIndex];
19081
+ return lineStyle ? lineStyle[charIndex] : null;
19066
19082
  }
19067
19083
 
19068
19084
  /**
@@ -19073,15 +19089,7 @@
19073
19089
  * @return {Object} style object
19074
19090
  */
19075
19091
  getCompleteStyleDeclaration(lineIndex, charIndex) {
19076
- const style = this._getStyleDeclaration(lineIndex, charIndex) || {},
19077
- styleObject = {},
19078
- styleProps = this.constructor._styleProperties;
19079
- for (let i = 0; i < styleProps.length; i++) {
19080
- const prop = styleProps[i];
19081
- // @ts-expect-error TS complains even when we serve everything on a silver plate.
19082
- styleObject[prop] = typeof style[prop] === 'undefined' ? this[prop] : style[prop];
19083
- }
19084
- return styleObject;
19092
+ return _objectSpread2(_objectSpread2({}, pick(this, this.constructor._styleProperties)), this._getStyleDeclaration(lineIndex, charIndex) || {});
19085
19093
  }
19086
19094
 
19087
19095
  /**
@@ -20767,6 +20775,7 @@
20767
20775
  _defineProperty(Text, "textLayoutProperties", textLayoutProperties);
20768
20776
  _defineProperty(Text, "cacheProperties", [...cacheProperties, ...additionalProps]);
20769
20777
  _defineProperty(Text, "ownDefaults", textDefaultValues);
20778
+ _defineProperty(Text, "type", 'Text');
20770
20779
  _defineProperty(Text, "genericFonts", ['sans-serif', 'serif', 'cursive', 'fantasy', 'monospace']);
20771
20780
  _defineProperty(Text, "ATTRIBUTE_NAMES", SHARED_ATTRIBUTES.concat('x', 'y', 'dx', 'dy', 'font-family', 'font-style', 'font-weight', 'font-size', 'letter-spacing', 'text-decoration', 'text-anchor'));
20772
20781
  applyMixins(Text, [TextSVGExportMixin]);
@@ -21410,6 +21419,9 @@
21410
21419
  * called by {@link canvas#textEditingManager}
21411
21420
  */
21412
21421
  updateSelectionOnMouseMove(e) {
21422
+ if (this.__corner) {
21423
+ return;
21424
+ }
21413
21425
  const el = this.hiddenTextarea;
21414
21426
  // regain focus
21415
21427
  getDocumentFromElement(el).activeElement !== el && el.focus();
@@ -22665,7 +22677,7 @@
22665
22677
  let {
22666
22678
  e
22667
22679
  } = _ref;
22668
- if (!this.canvas || !this.editable || notALeftClick(e)) {
22680
+ if (!this.canvas || !this.editable || notALeftClick(e) || this.__corner) {
22669
22681
  return;
22670
22682
  }
22671
22683
  if (this.draggableTextDelegate.start(e)) {
@@ -23424,6 +23436,7 @@
23424
23436
  }
23425
23437
  }
23426
23438
  _defineProperty(IText, "ownDefaults", iTextDefaultValues);
23439
+ _defineProperty(IText, "type", 'IText');
23427
23440
  classRegistry.setClass(IText);
23428
23441
  // legacy
23429
23442
  classRegistry.setClass(IText, 'i-text');
@@ -23743,10 +23756,10 @@
23743
23756
  word = splitByGrapheme ? word : this.graphemeSplit(word);
23744
23757
  const width = this._measureWord(word, lineIndex, offset);
23745
23758
  largestWordWidth = Math.max(width, largestWordWidth);
23746
- offset += word.length + 1;
23759
+ offset += word.length + infix.length;
23747
23760
  return {
23748
- word: word,
23749
- width: width
23761
+ word,
23762
+ width
23750
23763
  };
23751
23764
  });
23752
23765
  const maxWidth = Math.max(desiredWidth, largestWordWidth, this.dynamicMinWidth);
@@ -23856,6 +23869,7 @@
23856
23869
  return super.toObject(['minWidth', 'splitByGrapheme'].concat(propertiesToInclude));
23857
23870
  }
23858
23871
  }
23872
+ _defineProperty(Textbox, "type", 'Textbox');
23859
23873
  _defineProperty(Textbox, "textLayoutProperties", [...IText.textLayoutProperties, 'width']);
23860
23874
  _defineProperty(Textbox, "ownDefaults", textboxDefaultValues);
23861
23875
  classRegistry.setClass(Textbox);
@@ -24990,6 +25004,7 @@
24990
25004
  });
24991
25005
  }
24992
25006
  }
25007
+ _defineProperty(Image, "type", 'Image');
24993
25008
  _defineProperty(Image, "cacheProperties", [...cacheProperties, ...IMAGE_PROPS]);
24994
25009
  _defineProperty(Image, "ownDefaults", imageDefaultValues);
24995
25010
  _defineProperty(Image, "CSS_CANVAS", 'canvas-img');
@@ -25696,9 +25711,17 @@
25696
25711
  * @default
25697
25712
  */
25698
25713
  get type() {
25699
- return this.constructor.name;
25714
+ return this.constructor.type;
25700
25715
  }
25701
25716
 
25717
+ /**
25718
+ * The class type. Used to identify which class this is.
25719
+ * This is used for serialization purposes and internally it can be used
25720
+ * to identify classes. As a developer you could use `instance of Class`
25721
+ * but to avoid importing all the code and blocking tree shaking we try
25722
+ * to avoid doing that.
25723
+ */
25724
+
25702
25725
  /**
25703
25726
  * Array of attributes to send with buffers. do not modify
25704
25727
  * @private
@@ -26013,6 +26036,7 @@
26013
26036
  return new this(filterOptions);
26014
26037
  }
26015
26038
  }
26039
+ _defineProperty(BaseFilter, "type", 'BaseFilter');
26016
26040
 
26017
26041
  const blendColorFragmentSource = {
26018
26042
  multiply: 'gl_FragColor.rgb *= uColor.rgb;\n',
@@ -26194,6 +26218,7 @@
26194
26218
  }
26195
26219
  }
26196
26220
  _defineProperty(BlendColor, "defaults", blendColorDefaultValues);
26221
+ _defineProperty(BlendColor, "type", 'BlendColor');
26197
26222
  classRegistry.setClass(BlendColor);
26198
26223
 
26199
26224
  const fragmentSource$c = {
@@ -26380,6 +26405,7 @@
26380
26405
  })));
26381
26406
  }
26382
26407
  }
26408
+ _defineProperty(BlendImage, "type", 'BlendImage');
26383
26409
  _defineProperty(BlendImage, "defaults", blendImageDefaultValues);
26384
26410
  classRegistry.setClass(BlendImage);
26385
26411
 
@@ -26540,6 +26566,7 @@
26540
26566
  return delta;
26541
26567
  }
26542
26568
  }
26569
+ _defineProperty(Blur, "type", 'Blur');
26543
26570
  _defineProperty(Blur, "defaults", blurDefaultValues);
26544
26571
  classRegistry.setClass(Blur);
26545
26572
 
@@ -26617,6 +26644,7 @@
26617
26644
  gl.uniform1f(uniformLocations.uBrightness, this.brightness);
26618
26645
  }
26619
26646
  }
26647
+ _defineProperty(Brightness, "type", 'Brightness');
26620
26648
  _defineProperty(Brightness, "defaults", brightnessDefaultValues);
26621
26649
  classRegistry.setClass(Brightness);
26622
26650
 
@@ -26733,6 +26761,7 @@
26733
26761
  gl.uniform4fv(uniformLocations.uConstants, constants);
26734
26762
  }
26735
26763
  }
26764
+ _defineProperty(ColorMatrix, "type", 'ColorMatrix');
26736
26765
  _defineProperty(ColorMatrix, "defaults", colorMatrixDefaultValues);
26737
26766
  classRegistry.setClass(ColorMatrix);
26738
26767
 
@@ -26742,7 +26771,7 @@
26742
26771
  get type() {
26743
26772
  return key;
26744
26773
  }
26745
- }, _defineProperty(_class, "defaults", _objectSpread2(_objectSpread2({}, colorMatrixDefaultValues), {}, {
26774
+ }, _defineProperty(_class, "type", key), _defineProperty(_class, "defaults", _objectSpread2(_objectSpread2({}, colorMatrixDefaultValues), {}, {
26746
26775
  /**
26747
26776
  * Lock the matrix export for this kind of static, parameter less filters.
26748
26777
  */
@@ -26823,6 +26852,7 @@
26823
26852
  }));
26824
26853
  }
26825
26854
  }
26855
+ _defineProperty(Composed, "type", 'Composed');
26826
26856
  classRegistry.setClass(Composed);
26827
26857
 
26828
26858
  const fragmentSource$8 = "\n precision highp float;\n uniform sampler2D uTexture;\n uniform float uContrast;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n float contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));\n color.rgb = contrastF * (color.rgb - 0.5) + 0.5;\n gl_FragColor = color;\n }";
@@ -26897,6 +26927,7 @@
26897
26927
  gl.uniform1f(uniformLocations.uContrast, this.contrast);
26898
26928
  }
26899
26929
  }
26930
+ _defineProperty(Contrast, "type", 'Contrast');
26900
26931
  _defineProperty(Contrast, "defaults", contrastDefaultValues);
26901
26932
  classRegistry.setClass(Contrast);
26902
26933
 
@@ -27069,6 +27100,7 @@
27069
27100
  });
27070
27101
  }
27071
27102
  }
27103
+ _defineProperty(Convolute, "type", 'Convolute');
27072
27104
  _defineProperty(Convolute, "defaults", convoluteDefaultValues);
27073
27105
  classRegistry.setClass(Convolute);
27074
27106
 
@@ -27170,6 +27202,7 @@
27170
27202
  gl.uniform3fv(uniformLocations.uGamma, this.gamma);
27171
27203
  }
27172
27204
  }
27205
+ _defineProperty(Gamma, "type", 'Gamma');
27173
27206
  _defineProperty(Gamma, "defaults", gammaDefaultValues);
27174
27207
  classRegistry.setClass(Gamma);
27175
27208
 
@@ -27260,6 +27293,7 @@
27260
27293
  return false;
27261
27294
  }
27262
27295
  }
27296
+ _defineProperty(Grayscale, "type", 'Grayscale');
27263
27297
  _defineProperty(Grayscale, "defaults", grayscaleDefaultValues);
27264
27298
  classRegistry.setClass(Grayscale);
27265
27299
 
@@ -27310,6 +27344,7 @@
27310
27344
  super.applyTo(options);
27311
27345
  }
27312
27346
  }
27347
+ _defineProperty(HueRotation, "type", 'HueRotation');
27313
27348
  _defineProperty(HueRotation, "defaults", hueRotationDefaultValues);
27314
27349
  classRegistry.setClass(HueRotation);
27315
27350
 
@@ -27399,6 +27434,7 @@
27399
27434
  gl.uniform1i(uniformLocations.uAlpha, Number(this.alpha));
27400
27435
  }
27401
27436
  }
27437
+ _defineProperty(Invert, "type", 'Invert');
27402
27438
  _defineProperty(Invert, "defaults", invertDefaultValues);
27403
27439
  classRegistry.setClass(Invert);
27404
27440
 
@@ -27488,6 +27524,7 @@
27488
27524
  });
27489
27525
  }
27490
27526
  }
27527
+ _defineProperty(Noise, "type", 'Noise');
27491
27528
  _defineProperty(Noise, "defaults", noiseDefaultValues);
27492
27529
  classRegistry.setClass(Noise);
27493
27530
 
@@ -27576,6 +27613,7 @@
27576
27613
  gl.uniform1f(uniformLocations.uBlocksize, this.blocksize);
27577
27614
  }
27578
27615
  }
27616
+ _defineProperty(Pixelate, "type", 'Pixelate');
27579
27617
  _defineProperty(Pixelate, "defaults", pixelateDefaultValues);
27580
27618
  classRegistry.setClass(Pixelate);
27581
27619
 
@@ -27681,6 +27719,7 @@
27681
27719
  });
27682
27720
  }
27683
27721
  }
27722
+ _defineProperty(RemoveColor, "type", 'RemoveColor');
27684
27723
  _defineProperty(RemoveColor, "defaults", removeColorDefaultValues);
27685
27724
  classRegistry.setClass(RemoveColor);
27686
27725
 
@@ -28129,6 +28168,7 @@
28129
28168
  };
28130
28169
  }
28131
28170
  }
28171
+ _defineProperty(Resize, "type", 'Resize');
28132
28172
  _defineProperty(Resize, "defaults", resizeDefaultValues);
28133
28173
  classRegistry.setClass(Resize);
28134
28174
 
@@ -28208,6 +28248,7 @@
28208
28248
  gl.uniform1f(uniformLocations.uSaturation, -this.saturation);
28209
28249
  }
28210
28250
  }
28251
+ _defineProperty(Saturation, "type", 'Saturation');
28211
28252
  _defineProperty(Saturation, "defaults", saturationDefaultValues);
28212
28253
  classRegistry.setClass(Saturation);
28213
28254
 
@@ -28289,6 +28330,7 @@
28289
28330
  gl.uniform1f(uniformLocations.uVibrance, -this.vibrance);
28290
28331
  }
28291
28332
  }
28333
+ _defineProperty(Vibrance, "type", 'Vibrance');
28292
28334
  _defineProperty(Vibrance, "defaults", vibranceDefaultValues);
28293
28335
  classRegistry.setClass(Vibrance);
28294
28336