@antv/g-lite 2.2.3 → 2.2.5

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.
package/dist/index.esm.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.3
5
- * @date 11/14/2024, 8:16:02 AM
4
+ * @version 2.2.5
5
+ * @date 11/25/2024, 6:12:35 AM
6
6
  * @author AntVis
7
7
  * @docs https://g.antv.antgroup.com/
8
8
  */
@@ -6381,67 +6381,68 @@ var DefaultStyleValueRegistry = /*#__PURE__*/function () {
6381
6381
  }
6382
6382
  }
6383
6383
  }
6384
- if (attributes.fill) {
6384
+ var list = getParsedStyleListOf(object);
6385
+ if (list.has('fill') && attributes.fill) {
6385
6386
  object.parsedStyle.fill = parseColor(attributes.fill);
6386
6387
  }
6387
- if (attributes.stroke) {
6388
+ if (list.has('stroke') && attributes.stroke) {
6388
6389
  object.parsedStyle.stroke = parseColor(attributes.stroke);
6389
6390
  }
6390
- if (attributes.shadowColor) {
6391
+ if (list.has('shadowColor') && attributes.shadowColor) {
6391
6392
  object.parsedStyle.shadowColor = parseColor(attributes.shadowColor);
6392
6393
  }
6393
- if (attributes.filter) {
6394
+ if (list.has('filter') && attributes.filter) {
6394
6395
  object.parsedStyle.filter = parseFilter(attributes.filter);
6395
6396
  }
6396
6397
  // Rect
6397
6398
  // @ts-ignore
6398
- if (!isNil(attributes.radius)) {
6399
+ if (list.has('radius') && !isNil(attributes.radius)) {
6399
6400
  // @ts-ignore
6400
6401
  object.parsedStyle.radius = parseDimensionArrayFormat(
6401
6402
  // @ts-ignore
6402
6403
  attributes.radius, 4);
6403
6404
  }
6404
6405
  // Polyline
6405
- if (!isNil(attributes.lineDash)) {
6406
+ if (list.has('lineDash') && !isNil(attributes.lineDash)) {
6406
6407
  object.parsedStyle.lineDash = parseDimensionArrayFormat(attributes.lineDash, 2);
6407
6408
  }
6408
6409
  // @ts-ignore
6409
- if (attributes.points) {
6410
+ if (list.has('points') && attributes.points) {
6410
6411
  // @ts-ignore
6411
6412
  object.parsedStyle.points = parsePoints(attributes.points);
6412
6413
  }
6413
6414
  // Path
6414
6415
  // @ts-ignore
6415
- if (attributes.d === '') {
6416
+ if (list.has('d') && attributes.d === '') {
6416
6417
  object.parsedStyle.d = _objectSpread({}, EMPTY_PARSED_PATH);
6417
6418
  }
6418
6419
  // @ts-ignore
6419
- if (attributes.d) {
6420
+ if (list.has('d') && attributes.d) {
6420
6421
  object.parsedStyle.d = parsePath(
6421
6422
  // @ts-ignore
6422
6423
  attributes.d);
6423
6424
  }
6424
6425
  // Text
6425
- if (attributes.textTransform) {
6426
+ if (list.has('textTransform') && attributes.textTransform) {
6426
6427
  this.runtime.CSSPropertySyntaxFactory[PropertySyntax.TEXT_TRANSFORM].calculator(null, null, {
6427
6428
  value: attributes.textTransform
6428
6429
  }, object, null);
6429
6430
  }
6430
- if (!isUndefined(attributes.clipPath)) {
6431
+ if (list.has('clipPath') && !isUndefined(attributes.clipPath)) {
6431
6432
  this.runtime.CSSPropertySyntaxFactory[PropertySyntax.DEFINED_PATH].calculator('clipPath', oldClipPath, attributes.clipPath, object, this.runtime);
6432
6433
  }
6433
- if (attributes.offsetPath) {
6434
+ if (list.has('offsetPath') && attributes.offsetPath) {
6434
6435
  this.runtime.CSSPropertySyntaxFactory[PropertySyntax.DEFINED_PATH].calculator('offsetPath', oldOffsetPath, attributes.offsetPath, object, this.runtime);
6435
6436
  }
6436
- if (attributes.transform) {
6437
+ if (list.has('transform') && attributes.transform) {
6437
6438
  object.parsedStyle.transform = parseTransform(attributes.transform);
6438
6439
  }
6439
- if (attributes.transformOrigin) {
6440
+ if (list.has('transformOrigin') && attributes.transformOrigin) {
6440
6441
  object.parsedStyle.transformOrigin = parseTransformOrigin(attributes.transformOrigin);
6441
6442
  }
6442
6443
  // Marker
6443
6444
  // @ts-ignore
6444
- if (attributes.markerStart) {
6445
+ if (list.has('markerStart') && attributes.markerStart) {
6445
6446
  object.parsedStyle.markerStart = this.runtime.CSSPropertySyntaxFactory[PropertySyntax.MARKER].calculator(null,
6446
6447
  // @ts-ignore
6447
6448
  attributes.markerStart,
@@ -6449,7 +6450,7 @@ var DefaultStyleValueRegistry = /*#__PURE__*/function () {
6449
6450
  attributes.markerStart, null, null);
6450
6451
  }
6451
6452
  // @ts-ignore
6452
- if (attributes.markerEnd) {
6453
+ if (list.has('markerEnd') && attributes.markerEnd) {
6453
6454
  object.parsedStyle.markerEnd = this.runtime.CSSPropertySyntaxFactory[PropertySyntax.MARKER].calculator(null,
6454
6455
  // @ts-ignore
6455
6456
  attributes.markerEnd,
@@ -6457,23 +6458,23 @@ var DefaultStyleValueRegistry = /*#__PURE__*/function () {
6457
6458
  attributes.markerEnd, null, null);
6458
6459
  }
6459
6460
  // @ts-ignore
6460
- if (attributes.markerMid) {
6461
+ if (list.has('markerMid') && attributes.markerMid) {
6461
6462
  object.parsedStyle.markerMid = this.runtime.CSSPropertySyntaxFactory[PropertySyntax.MARKER].calculator('',
6462
6463
  // @ts-ignore
6463
6464
  attributes.markerMid,
6464
6465
  // @ts-ignore
6465
6466
  attributes.markerMid, null, null);
6466
6467
  }
6467
- if (!isNil(attributes.zIndex)) {
6468
+ if (list.has('zIndex') && !isNil(attributes.zIndex)) {
6468
6469
  this.runtime.CSSPropertySyntaxFactory[PropertySyntax.Z_INDEX].postProcessor(object);
6469
6470
  }
6470
- if (!isNil(attributes.offsetDistance)) {
6471
+ if (list.has('offsetDistance') && !isNil(attributes.offsetDistance)) {
6471
6472
  this.runtime.CSSPropertySyntaxFactory[PropertySyntax.OFFSET_DISTANCE].postProcessor(object);
6472
6473
  }
6473
- if (attributes.transform) {
6474
+ if (list.has('transform') && attributes.transform) {
6474
6475
  this.runtime.CSSPropertySyntaxFactory[PropertySyntax.TRANSFORM].postProcessor(object);
6475
6476
  }
6476
- if (attributes.transformOrigin) {
6477
+ if (list.has('transformOrigin') && attributes.transformOrigin) {
6477
6478
  this.runtime.CSSPropertySyntaxFactory[PropertySyntax.TRANSFORM_ORIGIN].postProcessor(object);
6478
6479
  }
6479
6480
  if (needUpdateGeometry) {
@@ -6637,13 +6638,16 @@ function assignParsedStyle(object, attributes) {
6637
6638
  Object.assign(object.parsedStyle, attributes);
6638
6639
  return;
6639
6640
  }
6640
- var list = object.constructor.PARSED_STYLE_LIST;
6641
+ var list = getParsedStyleListOf(object);
6641
6642
  for (var key in attributes) {
6642
6643
  if (list.has(key)) {
6643
6644
  object.parsedStyle[key] = attributes[key];
6644
6645
  }
6645
6646
  }
6646
6647
  }
6648
+ function getParsedStyleListOf(object) {
6649
+ return object.constructor.PARSED_STYLE_LIST;
6650
+ }
6647
6651
 
6648
6652
  var CSSPropertyAngle = /*#__PURE__*/function () {
6649
6653
  function CSSPropertyAngle() {
@@ -12460,15 +12464,9 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
12460
12464
  clonedStyle[attributeName] = customCloneFunc(attributeName, attribute);
12461
12465
  }
12462
12466
  }
12463
- var cloned = new this.constructor({
12464
- // copy id & name
12465
- // @see https://developer.mozilla.org/en-US/docs/Web/API/Node/cloneNode#notes
12466
- id: this.id,
12467
- name: this.name,
12468
- className: this.name,
12469
- interactive: this.interactive,
12467
+ var cloned = new this.constructor(_objectSpread(_objectSpread({}, this.config), {}, {
12470
12468
  style: clonedStyle
12471
- });
12469
+ }));
12472
12470
 
12473
12471
  // apply transform
12474
12472
  cloned.setLocalTransform(this.getLocalTransform());
@@ -13267,7 +13265,7 @@ var Group = /*#__PURE__*/function (_DisplayObject) {
13267
13265
  _inherits(Group, _DisplayObject);
13268
13266
  return _createClass(Group);
13269
13267
  }(DisplayObject);
13270
- Group.PARSED_STYLE_LIST = new Set([].concat(_toConsumableArray(DisplayObject.PARSED_STYLE_LIST), ['width', 'height']));
13268
+ Group.PARSED_STYLE_LIST = new Set(['class', 'className', 'clipPath', 'cursor', 'draggable', 'droppable', 'opacity', 'pointerEvents', 'transform', 'transformOrigin', 'zIndex', 'visibility']);
13271
13269
 
13272
13270
  var _excluded$5 = ["style"];
13273
13271
  /**