@antv/g-lite 2.2.1 → 2.2.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 (36) hide show
  1. package/dist/index.esm.js +28 -10
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/index.js +28 -10
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.umd.min.js +5 -5
  6. package/dist/index.umd.min.js.map +1 -1
  7. package/package.json +1 -1
  8. package/types/css/StyleValueRegistry.d.ts +1 -1
  9. package/types/css/StyleValueRegistry.d.ts.map +1 -1
  10. package/types/display-objects/Circle.d.ts +1 -0
  11. package/types/display-objects/Circle.d.ts.map +1 -1
  12. package/types/display-objects/CustomElement.d.ts.map +1 -1
  13. package/types/display-objects/DisplayObject.d.ts +1 -0
  14. package/types/display-objects/DisplayObject.d.ts.map +1 -1
  15. package/types/display-objects/Ellipse.d.ts +1 -0
  16. package/types/display-objects/Ellipse.d.ts.map +1 -1
  17. package/types/display-objects/Group.d.ts +1 -0
  18. package/types/display-objects/Group.d.ts.map +1 -1
  19. package/types/display-objects/HTML.d.ts +1 -0
  20. package/types/display-objects/HTML.d.ts.map +1 -1
  21. package/types/display-objects/Image.d.ts +1 -0
  22. package/types/display-objects/Image.d.ts.map +1 -1
  23. package/types/display-objects/Line.d.ts +1 -0
  24. package/types/display-objects/Line.d.ts.map +1 -1
  25. package/types/display-objects/Path.d.ts +1 -0
  26. package/types/display-objects/Path.d.ts.map +1 -1
  27. package/types/display-objects/Polygon.d.ts +1 -0
  28. package/types/display-objects/Polygon.d.ts.map +1 -1
  29. package/types/display-objects/Polyline.d.ts +1 -0
  30. package/types/display-objects/Polyline.d.ts.map +1 -1
  31. package/types/display-objects/Rect.d.ts +1 -0
  32. package/types/display-objects/Rect.d.ts.map +1 -1
  33. package/types/display-objects/Text.d.ts +1 -0
  34. package/types/display-objects/Text.d.ts.map +1 -1
  35. package/types/global-runtime.d.ts +5 -0
  36. package/types/global-runtime.d.ts.map +1 -1
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * @antv/g-lite
3
3
  * @description A core module for rendering engine implements DOM API.
4
- * @version 2.2.1
5
- * @date 11/5/2024, 10:45:58 AM
4
+ * @version 2.2.2
5
+ * @date 11/7/2024, 7:43:00 AM
6
6
  * @author AntVis
7
7
  * @docs https://g.antv.antgroup.com/
8
8
  */
@@ -6392,7 +6392,7 @@ var DefaultStyleValueRegistry = /*#__PURE__*/function () {
6392
6392
  // clipPath
6393
6393
  var oldClipPath = object.parsedStyle.clipPath;
6394
6394
  var oldOffsetPath = object.parsedStyle.offsetPath;
6395
- Object.assign(object.parsedStyle, attributes);
6395
+ assignParsedStyle(object, attributes);
6396
6396
  var needUpdateGeometry = !!options.forceUpdateGeometry;
6397
6397
  if (!needUpdateGeometry) {
6398
6398
  for (var i in attributes) {
@@ -6653,6 +6653,18 @@ var DefaultStyleValueRegistry = /*#__PURE__*/function () {
6653
6653
  }
6654
6654
  }]);
6655
6655
  }();
6656
+ function assignParsedStyle(object, attributes) {
6657
+ if (!runtime.enableMassiveParsedStyleAssignOptimization) {
6658
+ Object.assign(object.parsedStyle, attributes);
6659
+ return;
6660
+ }
6661
+ var list = object.constructor.PARSED_STYLE_LIST;
6662
+ for (var key in attributes) {
6663
+ if (list.has(key)) {
6664
+ object.parsedStyle[key] = attributes[key];
6665
+ }
6666
+ }
6667
+ }
6656
6668
 
6657
6669
  var CSSPropertyAngle = /*#__PURE__*/function () {
6658
6670
  function CSSPropertyAngle() {
@@ -11623,7 +11635,7 @@ var runtime = {};
11623
11635
  var geometryUpdaterFactory = function (_ref) {
11624
11636
  var rectUpdater = new RectUpdater();
11625
11637
  var polylineUpdater = new PolylineUpdater();
11626
- return _ref = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, Shape.CIRCLE, new CircleUpdater()), Shape.ELLIPSE, new EllipseUpdater()), Shape.RECT, rectUpdater), Shape.IMAGE, rectUpdater), Shape.GROUP, new GroupUpdater()), Shape.LINE, new LineUpdater()), Shape.TEXT, new TextUpdater(runtime)), Shape.POLYLINE, polylineUpdater), Shape.POLYGON, polylineUpdater), Shape.PATH, new PathUpdater()), _defineProperty(_defineProperty(_ref, Shape.HTML, new HTMLUpdater()), Shape.MESH, null);
11638
+ return _ref = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, Shape.FRAGMENT, null), Shape.CIRCLE, new CircleUpdater()), Shape.ELLIPSE, new EllipseUpdater()), Shape.RECT, rectUpdater), Shape.IMAGE, rectUpdater), Shape.GROUP, new GroupUpdater()), Shape.LINE, new LineUpdater()), Shape.TEXT, new TextUpdater(runtime)), Shape.POLYLINE, polylineUpdater), Shape.POLYGON, polylineUpdater), _defineProperty(_defineProperty(_defineProperty(_ref, Shape.PATH, new PathUpdater()), Shape.HTML, new HTMLUpdater()), Shape.MESH, null);
11627
11639
  }();
11628
11640
  var CSSPropertySyntaxFactory = function (_ref2) {
11629
11641
  var color = new CSSPropertyColor();
@@ -12380,9 +12392,6 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
12380
12392
 
12381
12393
  // assign name, id to config
12382
12394
  // eg. group.get('name')
12383
- /**
12384
- * contains style props in constructor's params, eg. fill, stroke...
12385
- */
12386
12395
  _this.isCustomElement = false;
12387
12396
  _this.isMutationObserved = false;
12388
12397
  /**
@@ -13178,6 +13187,7 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
13178
13187
  // #endregion deprecated
13179
13188
  }]);
13180
13189
  }(Element);
13190
+ DisplayObject.PARSED_STYLE_LIST = new Set(['class', 'className', 'clipPath', 'cursor', 'display', 'draggable', 'droppable', 'fill', 'fillOpacity', 'fillRule', 'filter', 'increasedLineWidthForHitTesting', 'lineCap', 'lineDash', 'lineDashOffset', 'lineJoin', 'lineWidth', 'miterLimit', 'hitArea', 'offsetDistance', 'offsetPath', 'offsetX', 'offsetY', 'opacity', 'pointerEvents', 'shadowColor', 'shadowType', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY', 'stroke', 'strokeOpacity', 'strokeWidth', 'strokeLinecap', 'strokeLineJoin', 'strokeDasharray', 'strokeDashoffset', 'transform', 'transformOrigin', 'textTransform', 'visibility', 'zIndex']);
13181
13191
 
13182
13192
  var Circle = /*#__PURE__*/function (_DisplayObject) {
13183
13193
  function Circle() {
@@ -13190,6 +13200,7 @@ var Circle = /*#__PURE__*/function (_DisplayObject) {
13190
13200
  _inherits(Circle, _DisplayObject);
13191
13201
  return _createClass(Circle);
13192
13202
  }(DisplayObject);
13203
+ Circle.PARSED_STYLE_LIST = new Set([].concat(_toConsumableArray(DisplayObject.PARSED_STYLE_LIST), ['cx', 'cy', 'cz', 'r', 'isBillboard', 'isSizeAttenuation']));
13193
13204
 
13194
13205
  var _excluded$6 = ["style"];
13195
13206
  /**
@@ -13208,9 +13219,6 @@ var CustomElement = /*#__PURE__*/function (_DisplayObject) {
13208
13219
  _this = _callSuper(this, CustomElement, [_objectSpread({
13209
13220
  style: style
13210
13221
  }, rest)]);
13211
- // static get observedAttributes(): string[] {
13212
- // return [];
13213
- // }
13214
13222
  _this.isCustomElement = true;
13215
13223
  return _this;
13216
13224
  }
@@ -13233,6 +13241,7 @@ var Ellipse = /*#__PURE__*/function (_DisplayObject) {
13233
13241
  _inherits(Ellipse, _DisplayObject);
13234
13242
  return _createClass(Ellipse);
13235
13243
  }(DisplayObject);
13244
+ Ellipse.PARSED_STYLE_LIST = new Set([].concat(_toConsumableArray(DisplayObject.PARSED_STYLE_LIST), ['cx', 'cy', 'cz', 'rx', 'ry', 'isBillboard', 'isSizeAttenuation']));
13236
13245
 
13237
13246
  /**
13238
13247
  * 节点片段,用于包裹多个节点并批量操作
@@ -13275,6 +13284,7 @@ var Group = /*#__PURE__*/function (_DisplayObject) {
13275
13284
  _inherits(Group, _DisplayObject);
13276
13285
  return _createClass(Group);
13277
13286
  }(DisplayObject);
13287
+ Group.PARSED_STYLE_LIST = new Set([].concat(_toConsumableArray(DisplayObject.PARSED_STYLE_LIST), ['width', 'height']));
13278
13288
 
13279
13289
  var _excluded$5 = ["style"];
13280
13290
  /**
@@ -13361,6 +13371,7 @@ var HTML = /*#__PURE__*/function (_DisplayObject) {
13361
13371
  }
13362
13372
  }]);
13363
13373
  }(DisplayObject);
13374
+ HTML.PARSED_STYLE_LIST = new Set([].concat(_toConsumableArray(DisplayObject.PARSED_STYLE_LIST), ['x', 'y', '$el', 'innerHTML', 'width', 'height']));
13364
13375
 
13365
13376
  var Image = /*#__PURE__*/function (_DisplayObject) {
13366
13377
  function Image() {
@@ -13373,6 +13384,7 @@ var Image = /*#__PURE__*/function (_DisplayObject) {
13373
13384
  _inherits(Image, _DisplayObject);
13374
13385
  return _createClass(Image);
13375
13386
  }(DisplayObject);
13387
+ Image.PARSED_STYLE_LIST = new Set([].concat(_toConsumableArray(DisplayObject.PARSED_STYLE_LIST), ['x', 'y', 'z', 'src', 'width', 'height', 'isBillboard', 'billboardRotation', 'isSizeAttenuation', 'keepAspectRatio']));
13376
13388
 
13377
13389
  var _excluded$4 = ["style"];
13378
13390
  /**
@@ -13528,6 +13540,7 @@ var Line = /*#__PURE__*/function (_DisplayObject) {
13528
13540
  }
13529
13541
  }]);
13530
13542
  }(DisplayObject);
13543
+ Line.PARSED_STYLE_LIST = new Set([].concat(_toConsumableArray(DisplayObject.PARSED_STYLE_LIST), ['x1', 'y1', 'x2', 'y2', 'z1', 'z2', 'isBillboard', 'isSizeAttenuation', 'markerStart', 'markerEnd', 'markerStartOffset', 'markerEndOffset']));
13531
13544
 
13532
13545
  var _excluded$3 = ["style"];
13533
13546
  var Path = /*#__PURE__*/function (_DisplayObject) {
@@ -13766,6 +13779,7 @@ var Path = /*#__PURE__*/function (_DisplayObject) {
13766
13779
  }
13767
13780
  }]);
13768
13781
  }(DisplayObject);
13782
+ Path.PARSED_STYLE_LIST = new Set([].concat(_toConsumableArray(DisplayObject.PARSED_STYLE_LIST), ['d', 'markerStart', 'markerMid', 'markerEnd', 'markerStartOffset', 'markerEndOffset', 'isBillboard', 'isSizeAttenuation']));
13769
13783
 
13770
13784
  var _excluded$2 = ["style"];
13771
13785
  var Polygon = /*#__PURE__*/function (_DisplayObject) {
@@ -13927,6 +13941,7 @@ var Polygon = /*#__PURE__*/function (_DisplayObject) {
13927
13941
  }
13928
13942
  }]);
13929
13943
  }(DisplayObject);
13944
+ Polygon.PARSED_STYLE_LIST = new Set([].concat(_toConsumableArray(DisplayObject.PARSED_STYLE_LIST), ['points', 'markerStart', 'markerMid', 'markerEnd', 'markerStartOffset', 'markerEndOffset', 'isClosed', 'isBillboard', 'isSizeAttenuation']));
13930
13945
 
13931
13946
  var _excluded$1 = ["style"];
13932
13947
  /**
@@ -14024,6 +14039,7 @@ var Polyline = /*#__PURE__*/function (_Polygon) {
14024
14039
  }
14025
14040
  }]);
14026
14041
  }(Polygon);
14042
+ Polyline.PARSED_STYLE_LIST = new Set([].concat(_toConsumableArray(Polygon.PARSED_STYLE_LIST), ['points', 'markerStart', 'markerMid', 'markerEnd', 'markerStartOffset', 'markerEndOffset', 'isBillboard']));
14027
14043
 
14028
14044
  var Rect = /*#__PURE__*/function (_DisplayObject) {
14029
14045
  function Rect() {
@@ -14036,6 +14052,7 @@ var Rect = /*#__PURE__*/function (_DisplayObject) {
14036
14052
  _inherits(Rect, _DisplayObject);
14037
14053
  return _createClass(Rect);
14038
14054
  }(DisplayObject);
14055
+ Rect.PARSED_STYLE_LIST = new Set([].concat(_toConsumableArray(DisplayObject.PARSED_STYLE_LIST), ['x', 'y', 'z', 'width', 'height', 'isBillboard', 'isSizeAttenuation', 'radius']));
14039
14056
 
14040
14057
  var _excluded = ["style"];
14041
14058
  /**
@@ -14088,6 +14105,7 @@ var Text = /*#__PURE__*/function (_DisplayObject) {
14088
14105
  }
14089
14106
  }]);
14090
14107
  }(DisplayObject);
14108
+ Text.PARSED_STYLE_LIST = new Set([].concat(_toConsumableArray(DisplayObject.PARSED_STYLE_LIST), ['x', 'y', 'z', 'isBillboard', 'billboardRotation', 'isSizeAttenuation', 'text', 'textAlign', 'textBaseline', 'fontStyle', 'fontSize', 'fontFamily', 'fontWeight', 'fontVariant', 'lineHeight', 'letterSpacing', 'leading', 'wordWrap', 'wordWrapWidth', 'maxLines', 'textOverflow', 'isOverflowing', 'textPath', 'textDecorationLine', 'textDecorationColor', 'textDecorationStyle', 'textPathSide', 'textPathStartOffset', 'metrics', 'dx', 'dy']));
14091
14109
 
14092
14110
  /**
14093
14111
  * canvas.customElements