@antv/g 5.5.0 → 5.5.1

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 (38) hide show
  1. package/dist/css/StyleValueRegistry.d.ts +1 -0
  2. package/dist/css/StyleValueRegistry.d.ts.map +1 -1
  3. package/dist/css/cssom/CSSNumericValue.d.ts +1 -1
  4. package/dist/css/cssom/CSSStyleValue.d.ts +2 -2
  5. package/dist/css/cssom/CSSStyleValue.d.ts.map +1 -1
  6. package/dist/css/layout/LayoutObject.d.ts +2 -2
  7. package/dist/css/layout/LayoutObject.d.ts.map +1 -1
  8. package/dist/css/parser/dimension.d.ts +1 -0
  9. package/dist/css/parser/dimension.d.ts.map +1 -1
  10. package/dist/css/properties/CSSPropertyClipPath.d.ts +1 -0
  11. package/dist/css/properties/CSSPropertyClipPath.d.ts.map +1 -1
  12. package/dist/css/properties/CSSPropertyLengthOrPercentage.d.ts.map +1 -1
  13. package/dist/css/properties/CSSPropertyNumber.d.ts +8 -0
  14. package/dist/css/properties/CSSPropertyNumber.d.ts.map +1 -0
  15. package/dist/css/properties/index.d.ts +1 -0
  16. package/dist/css/properties/index.d.ts.map +1 -1
  17. package/dist/display-objects/DisplayObject.d.ts +1 -0
  18. package/dist/display-objects/DisplayObject.d.ts.map +1 -1
  19. package/dist/display-objects/Line.d.ts.map +1 -1
  20. package/dist/display-objects/Path.d.ts +1 -1
  21. package/dist/display-objects/Path.d.ts.map +1 -1
  22. package/dist/display-objects/Polyline.d.ts.map +1 -1
  23. package/dist/global-module.d.ts.map +1 -1
  24. package/dist/index.esm.js +185 -96
  25. package/dist/index.js +184 -96
  26. package/dist/index.umd.js +184 -96
  27. package/dist/index.umd.min.js +2 -2
  28. package/dist/plugins/DirtyCheckPlugin.d.ts +0 -1
  29. package/dist/plugins/DirtyCheckPlugin.d.ts.map +1 -1
  30. package/dist/plugins/PrepareRendererPlugin.d.ts +1 -0
  31. package/dist/plugins/PrepareRendererPlugin.d.ts.map +1 -1
  32. package/dist/services/RenderingService.d.ts +9 -1
  33. package/dist/services/RenderingService.d.ts.map +1 -1
  34. package/dist/services/SceneGraphService.d.ts +6 -1
  35. package/dist/services/SceneGraphService.d.ts.map +1 -1
  36. package/dist/types.d.ts +2 -0
  37. package/dist/types.d.ts.map +1 -1
  38. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -5169,8 +5169,8 @@ var CSSStyleValue = /*#__PURE__*/function () {
5169
5169
  return exports.UnitType.kPixels;
5170
5170
 
5171
5171
  case exports.UnitCategory.kUPercent:
5172
- return exports.UnitType.kUnknown;
5173
- // Cannot convert between numbers and percent.
5172
+ return exports.UnitType.kPercentage;
5173
+ // return UnitType.kUnknown; // Cannot convert between numbers and percent.
5174
5174
 
5175
5175
  case exports.UnitCategory.kUTime:
5176
5176
  return exports.UnitType.kSeconds;
@@ -8010,6 +8010,10 @@ function parserPercentage(css) {
8010
8010
  */
8011
8011
 
8012
8012
  function parseLengthOrPercentage(css) {
8013
+ if (isNumber(css)) {
8014
+ return new CSSUnitValue(css, 'px');
8015
+ }
8016
+
8013
8017
  return parseDimension(new RegExp('px|%|em|rem', 'g'), css);
8014
8018
  }
8015
8019
  function parseAngle(css) {
@@ -8021,6 +8025,7 @@ function parseAngle(css) {
8021
8025
  * @example
8022
8026
  * 10px + 20px = 30px
8023
8027
  * 10deg + 10rad
8028
+ * 10% + 20% = 30%
8024
8029
  */
8025
8030
 
8026
8031
  function mergeDimensions(left, right, target, nonNegative, index) {
@@ -8030,23 +8035,29 @@ function mergeDimensions(left, right, target, nonNegative, index) {
8030
8035
 
8031
8036
  var unit = '';
8032
8037
  var leftValue = left.value || 0;
8033
- var rightValue = right.value || 0; // const canonicalUnit = CSSUnitValue.toCanonicalUnit(left.unit);
8034
- // const leftCanonicalUnitValue = left.convertTo(canonicalUnit);
8035
- // const rightCanonicalUnitValue = right.convertTo(canonicalUnit);
8036
- // format '%' to 'px'
8037
-
8038
- if (CSSUnitValue.isLength(left.unit) || CSSUnitValue.isLength(right.unit)) {
8039
- leftValue = convertPercentUnit(left, index, target);
8040
- rightValue = convertPercentUnit(right, index, target);
8041
- unit = 'px';
8042
- } // format 'rad' 'turn' to 'deg'
8043
-
8038
+ var rightValue = right.value || 0;
8039
+ var canonicalUnit = CSSUnitValue.toCanonicalUnit(left.unit);
8040
+ var leftCanonicalUnitValue = left.convertTo(canonicalUnit);
8041
+ var rightCanonicalUnitValue = right.convertTo(canonicalUnit);
8042
+
8043
+ if (leftCanonicalUnitValue && rightCanonicalUnitValue) {
8044
+ leftValue = leftCanonicalUnitValue.value;
8045
+ rightValue = rightCanonicalUnitValue.value;
8046
+ unit = CSSUnitValue.unitTypeToString(left.unit);
8047
+ } else {
8048
+ // format '%' to 'px'
8049
+ if (CSSUnitValue.isLength(left.unit) || CSSUnitValue.isLength(right.unit)) {
8050
+ leftValue = convertPercentUnit(left, index, target);
8051
+ rightValue = convertPercentUnit(right, index, target);
8052
+ unit = 'px';
8053
+ }
8054
+ } // // format 'rad' 'turn' to 'deg'
8055
+ // if (CSSUnitValue.isAngle(left.unit) || CSSUnitValue.isAngle(right.unit)) {
8056
+ // leftValue = convertAngleUnit(left);
8057
+ // rightValue = convertAngleUnit(right);
8058
+ // unit = 'deg';
8059
+ // }
8044
8060
 
8045
- if (CSSUnitValue.isAngle(left.unit) || CSSUnitValue.isAngle(right.unit)) {
8046
- leftValue = convertAngleUnit(left);
8047
- rightValue = convertAngleUnit(right);
8048
- unit = 'deg';
8049
- }
8050
8061
 
8051
8062
  return [leftValue, rightValue, function (value) {
8052
8063
  if (nonNegative) {
@@ -11396,6 +11407,7 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
11396
11407
  _this.styleValueRegistry = manaSyringe.GlobalContainer.get(StyleValueRegistry);
11397
11408
  _this.isCustomElement = false;
11398
11409
  _this.activeAnimations = [];
11410
+ _this.mutationEvent = new MutationEvent(exports.ElementEvent.ATTR_MODIFIED, _assertThisInitialized(_this), null, null, null, MutationEvent.MODIFICATION, null, null);
11399
11411
  _this.config = config; // compatible with G 3.0
11400
11412
 
11401
11413
  _this.config.interactive = (_this$config$capture = _this.config.capture) !== null && _this$config$capture !== void 0 ? _this$config$capture : _this.config.interactive; // init scene graph node
@@ -11542,7 +11554,8 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
11542
11554
 
11543
11555
  if (this.parsedStyle.clipPathTargets && this.parsedStyle.clipPathTargets.length) {
11544
11556
  this.parsedStyle.clipPathTargets.forEach(function (target) {
11545
- dirtifyToRoot(target);
11557
+ _this2.sceneGraphService.dirtifyToRoot(target);
11558
+
11546
11559
  target.dispatchEvent(new MutationEvent(exports.ElementEvent.ATTR_MODIFIED, target, _this2, _this2, 'clipPath', MutationEvent.MODIFICATION, _this2, _this2));
11547
11560
 
11548
11561
  if (target.isCustomElement && target.isConnected) {
@@ -11554,8 +11567,15 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
11554
11567
  } // redraw at next frame
11555
11568
 
11556
11569
 
11557
- renderable.dirty = true;
11558
- this.dispatchEvent(new MutationEvent(exports.ElementEvent.ATTR_MODIFIED, this, oldValue, value, name, MutationEvent.MODIFICATION, oldParsedValue, this.parsedStyle[name]));
11570
+ renderable.dirty = true; // trigger later
11571
+ // this.sceneGraphService.pendingEvents.push([ElementEvent.ATTR_MODIFIED, { affectChildren }]);
11572
+
11573
+ this.mutationEvent.prevValue = oldValue;
11574
+ this.mutationEvent.newValue = value;
11575
+ this.mutationEvent.attrName = name;
11576
+ this.mutationEvent.prevParsedValue = oldParsedValue;
11577
+ this.mutationEvent.newParsedValue = this.parsedStyle[name];
11578
+ this.dispatchEvent(this.mutationEvent);
11559
11579
 
11560
11580
  if (this.isCustomElement && this.isConnected) {
11561
11581
  if (this.attributeChangedCallback) {
@@ -12395,9 +12415,17 @@ var Line = /*#__PURE__*/function (_DisplayObject) {
12395
12415
  x1 = _this$parsedStyle.x1,
12396
12416
  y1 = _this$parsedStyle.y1,
12397
12417
  x2 = _this$parsedStyle.x2,
12398
- y2 = _this$parsedStyle.y2;
12399
- var point = gMath.Line.pointAt(x1.value, y1.value, x2.value, y2.value, ratio);
12400
- return new Point(point.x, point.y);
12418
+ y2 = _this$parsedStyle.y2,
12419
+ defX = _this$parsedStyle.defX,
12420
+ defY = _this$parsedStyle.defY;
12421
+
12422
+ var _LineUtil$pointAt = gMath.Line.pointAt(x1.value, y1.value, x2.value, y2.value, ratio),
12423
+ x = _LineUtil$pointAt.x,
12424
+ y = _LineUtil$pointAt.y;
12425
+
12426
+ var transformed = glMatrix.vec3.transformMat4(glMatrix.vec3.create(), glMatrix.vec3.fromValues(x - defX, y - defY, 0), this.getLocalTransform()); // apply local transformation
12427
+
12428
+ return new Point(transformed[0], transformed[1]);
12401
12429
  };
12402
12430
 
12403
12431
  _proto.getTotalLength = function getTotalLength() {
@@ -12442,7 +12470,10 @@ var Path = /*#__PURE__*/function (_DisplayObject) {
12442
12470
  ;
12443
12471
 
12444
12472
  _proto.getPoint = function getPoint(ratio) {
12445
- var _this$parsedStyle$pat = this.parsedStyle.path,
12473
+ var _this$parsedStyle = this.parsedStyle,
12474
+ defX = _this$parsedStyle.defX,
12475
+ defY = _this$parsedStyle.defY,
12476
+ _this$parsedStyle$pat = _this$parsedStyle.path,
12446
12477
  totalLength = _this$parsedStyle$pat.totalLength,
12447
12478
  absolutePath = _this$parsedStyle$pat.absolutePath;
12448
12479
 
@@ -12450,7 +12481,9 @@ var Path = /*#__PURE__*/function (_DisplayObject) {
12450
12481
  x = _getPointAtLength.x,
12451
12482
  y = _getPointAtLength.y;
12452
12483
 
12453
- return new Point(x, y);
12484
+ var transformed = glMatrix.vec3.transformMat4(glMatrix.vec3.create(), glMatrix.vec3.fromValues(x - defX, y - defY, 0), this.getLocalTransform()); // apply local transformation
12485
+
12486
+ return new Point(transformed[0], transformed[1]);
12454
12487
  }
12455
12488
  /**
12456
12489
  * Get start tangent vector
@@ -12555,7 +12588,10 @@ var Polyline = /*#__PURE__*/function (_DisplayObject) {
12555
12588
  };
12556
12589
 
12557
12590
  _proto.getPoint = function getPoint(ratio) {
12558
- var _this$parsedStyle$poi = this.parsedStyle.points,
12591
+ var _this$parsedStyle = this.parsedStyle,
12592
+ defX = _this$parsedStyle.defX,
12593
+ defY = _this$parsedStyle.defY,
12594
+ _this$parsedStyle$poi = _this$parsedStyle.points,
12559
12595
  points = _this$parsedStyle$poi.points,
12560
12596
  segments = _this$parsedStyle$poi.segments;
12561
12597
  var subt = 0;
@@ -12571,7 +12607,9 @@ var Polyline = /*#__PURE__*/function (_DisplayObject) {
12571
12607
  x = _LineUtil$pointAt.x,
12572
12608
  y = _LineUtil$pointAt.y;
12573
12609
 
12574
- return new Point(x, y);
12610
+ var transformed = glMatrix.vec3.transformMat4(glMatrix.vec3.create(), glMatrix.vec3.fromValues(x - defX, y - defY, 0), this.getLocalTransform()); // apply local transformation
12611
+
12612
+ return new Point(transformed[0], transformed[1]);
12575
12613
  };
12576
12614
 
12577
12615
  _proto.getStartTangent = function getStartTangent() {
@@ -14371,29 +14409,6 @@ function sortByZIndex(o1, o2) {
14371
14409
 
14372
14410
  return zIndex1 - zIndex2;
14373
14411
  }
14374
- function dirtifyToRoot(element, affectChildren) {
14375
- if (affectChildren === void 0) {
14376
- affectChildren = false;
14377
- }
14378
-
14379
- var p = element;
14380
-
14381
- while (p) {
14382
- var renderable = p.renderable;
14383
-
14384
- if (renderable) {
14385
- renderable.renderBoundsDirty = true;
14386
- renderable.boundsDirty = true;
14387
- renderable.dirty = true;
14388
- }
14389
-
14390
- p = p.parentNode;
14391
- }
14392
-
14393
- element.dispatchEvent(new CustomEvent(exports.ElementEvent.BOUNDS_CHANGED, {
14394
- affectChildren: affectChildren
14395
- }));
14396
- }
14397
14412
  var SceneGraphService = manaSyringe.Syringe.defineToken('SceneGraphService');
14398
14413
  /**
14399
14414
  * update transform in scene graph
@@ -14406,6 +14421,8 @@ exports.DefaultSceneGraphService = /*#__PURE__*/function () {
14406
14421
  var _this = this;
14407
14422
 
14408
14423
  this.sceneGraphSelectorFactory = void 0;
14424
+ this.pendingEvents = [];
14425
+ this.boundsChangedEvent = new CustomEvent(exports.ElementEvent.BOUNDS_CHANGED);
14409
14426
 
14410
14427
  this.rotate = function () {
14411
14428
  var parentInvertRotation = glMatrix.quat.create();
@@ -14839,7 +14856,60 @@ exports.DefaultSceneGraphService = /*#__PURE__*/function () {
14839
14856
  }
14840
14857
 
14841
14858
  this.dirtifyWorldInternal(element, transform);
14842
- dirtifyToRoot(element, true);
14859
+ this.dirtifyToRoot(element, true);
14860
+ };
14861
+
14862
+ _proto.triggerPendingEvents = function triggerPendingEvents() {
14863
+ var _this2 = this;
14864
+
14865
+ var set = new Set();
14866
+
14867
+ var trigger = function trigger(element, detail) {
14868
+ if (!set.has(element.entity)) {
14869
+ _this2.boundsChangedEvent.detail = detail;
14870
+ element.dispatchEvent(_this2.boundsChangedEvent);
14871
+ set.add(element.entity);
14872
+ }
14873
+ };
14874
+
14875
+ this.pendingEvents.forEach(function (_ref) {
14876
+ var element = _ref[0],
14877
+ detail = _ref[1];
14878
+
14879
+ if (detail.affectChildren) {
14880
+ element.forEach(function (e) {
14881
+ trigger(e, detail);
14882
+ });
14883
+ } else {
14884
+ trigger(element, detail);
14885
+ }
14886
+ });
14887
+ this.pendingEvents = [];
14888
+ };
14889
+
14890
+ _proto.dirtifyToRoot = function dirtifyToRoot(element, affectChildren) {
14891
+ if (affectChildren === void 0) {
14892
+ affectChildren = false;
14893
+ }
14894
+
14895
+ var p = element;
14896
+
14897
+ while (p) {
14898
+ var renderable = p.renderable;
14899
+
14900
+ if (renderable) {
14901
+ renderable.renderBoundsDirty = true;
14902
+ renderable.boundsDirty = true;
14903
+ renderable.dirty = true;
14904
+ }
14905
+
14906
+ p = p.parentNode;
14907
+ } // reuse the same custom event
14908
+
14909
+
14910
+ this.pendingEvents.push([element, {
14911
+ affectChildren: affectChildren
14912
+ }]);
14843
14913
  };
14844
14914
 
14845
14915
  _proto.getPosition = function getPosition(element) {
@@ -14975,7 +15045,7 @@ exports.DefaultSceneGraphService = /*#__PURE__*/function () {
14975
15045
  ;
14976
15046
 
14977
15047
  _proto.getBounds = function getBounds(element, render) {
14978
- var _this2 = this;
15048
+ var _this3 = this;
14979
15049
 
14980
15050
  if (render === void 0) {
14981
15051
  render = false;
@@ -14996,7 +15066,7 @@ exports.DefaultSceneGraphService = /*#__PURE__*/function () {
14996
15066
 
14997
15067
  var children = element.childNodes;
14998
15068
  children.forEach(function (child) {
14999
- var childBounds = _this2.getBounds(child, render);
15069
+ var childBounds = _this3.getBounds(child, render);
15000
15070
 
15001
15071
  if (childBounds) {
15002
15072
  if (!aabb) {
@@ -15008,7 +15078,7 @@ exports.DefaultSceneGraphService = /*#__PURE__*/function () {
15008
15078
  }
15009
15079
  }); // account for clip path
15010
15080
 
15011
- var clipPath = element.style.clipPath;
15081
+ var clipPath = element.parsedStyle.clipPath;
15012
15082
 
15013
15083
  if (clipPath) {
15014
15084
  var clipPathBounds = this.getTransformedGeometryBounds(clipPath, true);
@@ -15099,7 +15169,7 @@ exports.DefaultSceneGraphService = /*#__PURE__*/function () {
15099
15169
  };
15100
15170
 
15101
15171
  _proto.dirtifyWorldInternal = function dirtifyWorldInternal(element, transform) {
15102
- var _this3 = this;
15172
+ var _this4 = this;
15103
15173
 
15104
15174
  if (!transform.dirtyFlag) {
15105
15175
  transform.dirtyFlag = true;
@@ -15108,7 +15178,7 @@ exports.DefaultSceneGraphService = /*#__PURE__*/function () {
15108
15178
  var childTransform = child.transformable;
15109
15179
 
15110
15180
  if (!childTransform.dirtyFlag) {
15111
- _this3.dirtifyWorldInternal(child, childTransform);
15181
+ _this4.dirtifyWorldInternal(child, childTransform);
15112
15182
  }
15113
15183
  });
15114
15184
  var renderable = element.renderable;
@@ -15118,8 +15188,6 @@ exports.DefaultSceneGraphService = /*#__PURE__*/function () {
15118
15188
  renderable.boundsDirty = true;
15119
15189
  renderable.dirty = true;
15120
15190
  }
15121
-
15122
- element.dispatchEvent(new MutationEvent(exports.ElementEvent.ATTR_MODIFIED, element, null, null, 'modelMatrix', MutationEvent.MODIFICATION, null, null));
15123
15191
  }
15124
15192
  };
15125
15193
 
@@ -16357,6 +16425,7 @@ var RenderingPluginContribution = manaSyringe.Syringe.defineToken('RenderingPlug
16357
16425
  exports.RenderingService = /*#__PURE__*/function () {
16358
16426
  function RenderingService() {
16359
16427
  this.renderingPluginProvider = void 0;
16428
+ this.canvasConfig = void 0;
16360
16429
  this.renderingContext = void 0;
16361
16430
  this.sceneGraphService = void 0;
16362
16431
  this.styleValueRegistry = void 0;
@@ -16470,6 +16539,21 @@ exports.RenderingService = /*#__PURE__*/function () {
16470
16539
 
16471
16540
  _proto.getStats = function getStats() {
16472
16541
  return this.stats;
16542
+ }
16543
+ /**
16544
+ * Meet the following conditions:
16545
+ * * disable DirtyRectangleRendering
16546
+ * * camera changed
16547
+ */
16548
+ ;
16549
+
16550
+ _proto.disableDirtyRectangleRendering = function disableDirtyRectangleRendering() {
16551
+ var renderer = this.canvasConfig.renderer;
16552
+
16553
+ var _renderer$getConfig = renderer.getConfig(),
16554
+ enableDirtyRectangleRendering = _renderer$getConfig.enableDirtyRectangleRendering;
16555
+
16556
+ return !enableDirtyRectangleRendering || this.renderingContext.renderReasons.has(exports.RenderReason.CAMERA_CHANGED);
16473
16557
  };
16474
16558
 
16475
16559
  _proto.render = function render(canvasConfig) {
@@ -16479,6 +16563,7 @@ exports.RenderingService = /*#__PURE__*/function () {
16479
16563
  this.stats.rendered = 0;
16480
16564
  this.zIndexCounter = 0;
16481
16565
  this.sceneGraphService.syncHierarchy(this.renderingContext.root);
16566
+ this.sceneGraphService.triggerPendingEvents();
16482
16567
 
16483
16568
  if (this.renderingContext.renderReasons.size && this.inited) {
16484
16569
  this.renderDisplayObject(this.renderingContext.root, canvasConfig);
@@ -16566,6 +16651,8 @@ exports.RenderingService = /*#__PURE__*/function () {
16566
16651
 
16567
16652
  tslib.__decorate([manaSyringe.contrib(RenderingPluginContribution), tslib.__metadata("design:type", Object)], exports.RenderingService.prototype, "renderingPluginProvider", void 0);
16568
16653
 
16654
+ tslib.__decorate([manaSyringe.inject(CanvasConfig), tslib.__metadata("design:type", Object)], exports.RenderingService.prototype, "canvasConfig", void 0);
16655
+
16569
16656
  tslib.__decorate([manaSyringe.inject(RenderingContext), tslib.__metadata("design:type", Object)], exports.RenderingService.prototype, "renderingContext", void 0);
16570
16657
 
16571
16658
  tslib.__decorate([manaSyringe.inject(SceneGraphService), tslib.__metadata("design:type", Object)], exports.RenderingService.prototype, "sceneGraphService", void 0);
@@ -18559,7 +18646,9 @@ exports.PathUpdater = tslib.__decorate([manaSyringe.singleton({
18559
18646
  */
18560
18647
 
18561
18648
  exports.CSSPropertyClipPath = /*#__PURE__*/function () {
18562
- function CSSPropertyClipPath() {}
18649
+ function CSSPropertyClipPath() {
18650
+ this.sceneGraphService = void 0;
18651
+ }
18563
18652
 
18564
18653
  var _proto = CSSPropertyClipPath.prototype;
18565
18654
 
@@ -18583,13 +18672,15 @@ exports.CSSPropertyClipPath = /*#__PURE__*/function () {
18583
18672
  newClipPath.parsedStyle.clipPathTargets.push(object);
18584
18673
  }
18585
18674
 
18586
- dirtifyToRoot(object);
18675
+ this.sceneGraphService.dirtifyToRoot(object);
18587
18676
  return newClipPath;
18588
18677
  };
18589
18678
 
18590
18679
  return CSSPropertyClipPath;
18591
18680
  }();
18592
18681
 
18682
+ tslib.__decorate([manaSyringe.inject(SceneGraphService), tslib.__metadata("design:type", Object)], exports.CSSPropertyClipPath.prototype, "sceneGraphService", void 0);
18683
+
18593
18684
  exports.CSSPropertyClipPath = tslib.__decorate([manaSyringe.singleton({
18594
18685
  token: {
18595
18686
  token: CSSProperty,
@@ -18669,21 +18760,6 @@ exports.CSSPropertyLengthOrPercentage = /*#__PURE__*/function () {
18669
18760
  _proto.calculator = function calculator(name, oldParsed, computed, object, registry) {
18670
18761
  if (CSSUnitValue.isRelativeUnit(computed.unit)) {
18671
18762
  if (computed.unit === exports.UnitType.kPercentage) {
18672
- // try to resolve according to parent's geometry bounds
18673
- // if (object.parentElement) {
18674
- // // registry.registerParentGeometryBoundsChangedHandler(object, name);
18675
- // return this.calculateUsedValueWithParentBounds(object, name);
18676
- // } else {
18677
- // registry.addUnresolveProperty(object, name);
18678
- // // defer calculation after mounted
18679
- // // object.addEventListener(
18680
- // // ElementEvent.MOUNTED,
18681
- // // () => {
18682
- // // registry.registerParentGeometryBoundsChangedHandler(object, name);
18683
- // // },
18684
- // // { once: true },
18685
- // // );
18686
- // }
18687
18763
  return new CSSUnitValue(0, 'px');
18688
18764
  } else if (computed.unit === exports.UnitType.kEms) {
18689
18765
  if (object.parentNode) {
@@ -18717,10 +18793,13 @@ exports.CSSPropertyLengthOrPercentage = /*#__PURE__*/function () {
18717
18793
  }();
18718
18794
 
18719
18795
  exports.CSSPropertyLengthOrPercentage = tslib.__decorate([manaSyringe.singleton({
18720
- token: {
18796
+ token: [{
18721
18797
  token: CSSProperty,
18722
18798
  named: exports.PropertySyntax.LENGTH_PERCENTAGE
18723
- }
18799
+ }, {
18800
+ token: CSSProperty,
18801
+ named: exports.PropertySyntax.LENGTH
18802
+ }]
18724
18803
  })], exports.CSSPropertyLengthOrPercentage);
18725
18804
 
18726
18805
  /**
@@ -18889,6 +18968,18 @@ exports.CSSPropertyLocalPosition = tslib.__decorate([manaSyringe.singleton({
18889
18968
  }
18890
18969
  })], exports.CSSPropertyLocalPosition);
18891
18970
 
18971
+ exports.CSSPropertyNumber = function CSSPropertyNumber() {
18972
+ this.mixer = mergeNumbers;
18973
+ this.parser = parseNumber;
18974
+ };
18975
+
18976
+ exports.CSSPropertyNumber = tslib.__decorate([manaSyringe.singleton({
18977
+ token: {
18978
+ token: CSSProperty,
18979
+ named: exports.PropertySyntax.NUMBER
18980
+ }
18981
+ })], exports.CSSPropertyNumber);
18982
+
18892
18983
  exports.CSSPropertyOffsetDistance = /*#__PURE__*/function () {
18893
18984
  function CSSPropertyOffsetDistance() {
18894
18985
  this.parser = parseNumber;
@@ -19775,6 +19866,7 @@ exports.DefaultStyleValueRegistry = /*#__PURE__*/function () {
19775
19866
  this.cache = {};
19776
19867
  this.unresolvedProperties = {};
19777
19868
  this.propertySyntaxFactory = void 0;
19869
+ this.sceneGraphService = void 0;
19778
19870
  this.cascadeProperties = {};
19779
19871
  }
19780
19872
 
@@ -20220,9 +20312,8 @@ exports.DefaultStyleValueRegistry = /*#__PURE__*/function () {
20220
20312
  var usedOriginYValue = (flipX ? -1 : 1) * convertPercentUnit(transformOrigin[1], 1, object);
20221
20313
  usedOriginXValue = usedOriginXValue - (flipY ? -1 : 1) * (anchor && anchor[0].value || 0) * geometry.contentBounds.halfExtents[0] * 2;
20222
20314
  usedOriginYValue = usedOriginYValue - (flipX ? -1 : 1) * (anchor && anchor[1].value || 0) * geometry.contentBounds.halfExtents[1] * 2;
20223
- object.setOrigin(usedOriginXValue, usedOriginYValue); // object.dispatchEvent(new CustomEvent(ElementEvent.GEOMETRY_BOUNDS_CHANGED));
20224
-
20225
- dirtifyToRoot(object);
20315
+ object.setOrigin(usedOriginXValue, usedOriginYValue);
20316
+ this.sceneGraphService.dirtifyToRoot(object);
20226
20317
  }
20227
20318
  };
20228
20319
 
@@ -20241,6 +20332,8 @@ exports.DefaultStyleValueRegistry = /*#__PURE__*/function () {
20241
20332
 
20242
20333
  tslib.__decorate([manaSyringe.inject(CSSPropertySyntaxFactory), tslib.__metadata("design:type", Function)], exports.DefaultStyleValueRegistry.prototype, "propertySyntaxFactory", void 0);
20243
20334
 
20335
+ tslib.__decorate([manaSyringe.inject(SceneGraphService), tslib.__metadata("design:type", Object)], exports.DefaultStyleValueRegistry.prototype, "sceneGraphService", void 0);
20336
+
20244
20337
  tslib.__decorate([manaSyringe.postConstruct(), tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", []), tslib.__metadata("design:returntype", void 0)], exports.DefaultStyleValueRegistry.prototype, "init", null);
20245
20338
 
20246
20339
  exports.DefaultStyleValueRegistry = tslib.__decorate([manaSyringe.singleton({
@@ -20290,6 +20383,7 @@ var containerModule = manaSyringe.Module(function (register) {
20290
20383
  }
20291
20384
  }); // bind CSS property handlers
20292
20385
 
20386
+ register(exports.CSSPropertyNumber);
20293
20387
  register(exports.CSSPropertyAngle);
20294
20388
  register(exports.CSSPropertyClipPath);
20295
20389
  register(exports.CSSPropertyColor);
@@ -20553,22 +20647,15 @@ var DirtyCheckPlugin_1;
20553
20647
  */
20554
20648
 
20555
20649
  var DirtyCheckPlugin = DirtyCheckPlugin_1 = (_class$2 = /*#__PURE__*/function () {
20556
- function DirtyCheckPlugin() {
20557
- this.renderingContext = void 0;
20558
- }
20650
+ function DirtyCheckPlugin() {}
20559
20651
 
20560
20652
  var _proto = DirtyCheckPlugin.prototype;
20561
20653
 
20562
20654
  _proto.apply = function apply(renderingService) {
20563
- var _this = this;
20564
-
20565
20655
  renderingService.hooks.dirtycheck.tap(DirtyCheckPlugin_1.tag, function (object) {
20566
20656
  if (object) {
20567
20657
  var renderable = object.renderable;
20568
-
20569
- var isCameraDirty = _this.renderingContext.renderReasons.has(exports.RenderReason.CAMERA_CHANGED);
20570
-
20571
- var isDirty = renderable.dirty || isCameraDirty;
20658
+ var isDirty = renderable.dirty || renderingService.disableDirtyRectangleRendering();
20572
20659
 
20573
20660
  if (isDirty) {
20574
20661
  return object;
@@ -20583,9 +20670,6 @@ var DirtyCheckPlugin = DirtyCheckPlugin_1 = (_class$2 = /*#__PURE__*/function ()
20583
20670
 
20584
20671
  return DirtyCheckPlugin;
20585
20672
  }(), _class$2.tag = 'DirtyCheck', _class$2);
20586
-
20587
- tslib.__decorate([manaSyringe.inject(RenderingContext), tslib.__metadata("design:type", Object)], DirtyCheckPlugin.prototype, "renderingContext", void 0);
20588
-
20589
20673
  DirtyCheckPlugin = DirtyCheckPlugin_1 = tslib.__decorate([manaSyringe.singleton({
20590
20674
  contrib: RenderingPluginContribution
20591
20675
  })], DirtyCheckPlugin);
@@ -21010,6 +21094,7 @@ var PrepareRendererPlugin = PrepareRendererPlugin_1 = (_class$4 = /*#__PURE__*/f
21010
21094
  function PrepareRendererPlugin() {
21011
21095
  this.renderingContext = void 0;
21012
21096
  this.styleValueRegistry = void 0;
21097
+ this.sceneGraphService = void 0;
21013
21098
  this.rBush = void 0;
21014
21099
  this.toSync = new Set();
21015
21100
  }
@@ -21056,7 +21141,8 @@ var PrepareRendererPlugin = PrepareRendererPlugin_1 = (_class$4 = /*#__PURE__*/f
21056
21141
 
21057
21142
  _this2.styleValueRegistry.recalc(object);
21058
21143
 
21059
- dirtifyToRoot(object);
21144
+ _this2.sceneGraphService.dirtifyToRoot(object);
21145
+
21060
21146
  renderingService.dirtify();
21061
21147
  };
21062
21148
 
@@ -21070,7 +21156,8 @@ var PrepareRendererPlugin = PrepareRendererPlugin_1 = (_class$4 = /*#__PURE__*/f
21070
21156
  _this2.toSync.delete(object);
21071
21157
  }
21072
21158
 
21073
- dirtifyToRoot(e.target);
21159
+ _this2.sceneGraphService.dirtifyToRoot(e.target);
21160
+
21074
21161
  renderingService.dirtify();
21075
21162
  };
21076
21163
 
@@ -21160,6 +21247,8 @@ tslib.__decorate([manaSyringe.inject(RenderingContext), tslib.__metadata("design
21160
21247
 
21161
21248
  tslib.__decorate([manaSyringe.inject(StyleValueRegistry), tslib.__metadata("design:type", Object)], PrepareRendererPlugin.prototype, "styleValueRegistry", void 0);
21162
21249
 
21250
+ tslib.__decorate([manaSyringe.inject(SceneGraphService), tslib.__metadata("design:type", Object)], PrepareRendererPlugin.prototype, "sceneGraphService", void 0);
21251
+
21163
21252
  tslib.__decorate([manaSyringe.inject(RBushRoot), tslib.__metadata("design:type", RBush__default['default'])], PrepareRendererPlugin.prototype, "rBush", void 0);
21164
21253
 
21165
21254
  PrepareRendererPlugin = PrepareRendererPlugin_1 = tslib.__decorate([manaSyringe.singleton({
@@ -21995,7 +22084,6 @@ exports.createVec3 = createVec3;
21995
22084
  exports.decompose = decompose;
21996
22085
  exports.deg2rad = deg2rad;
21997
22086
  exports.deg2turn = deg2turn;
21998
- exports.dirtifyToRoot = dirtifyToRoot;
21999
22087
  exports.equalSet = equalSet;
22000
22088
  exports.extractPolygons = extractPolygons;
22001
22089
  exports.formatAttribute = formatAttribute;