@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.
- package/dist/css/StyleValueRegistry.d.ts +1 -0
- package/dist/css/StyleValueRegistry.d.ts.map +1 -1
- package/dist/css/cssom/CSSNumericValue.d.ts +1 -1
- package/dist/css/cssom/CSSStyleValue.d.ts +2 -2
- package/dist/css/cssom/CSSStyleValue.d.ts.map +1 -1
- package/dist/css/layout/LayoutObject.d.ts +2 -2
- package/dist/css/layout/LayoutObject.d.ts.map +1 -1
- package/dist/css/parser/dimension.d.ts +1 -0
- package/dist/css/parser/dimension.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyClipPath.d.ts +1 -0
- package/dist/css/properties/CSSPropertyClipPath.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyLengthOrPercentage.d.ts.map +1 -1
- package/dist/css/properties/CSSPropertyNumber.d.ts +8 -0
- package/dist/css/properties/CSSPropertyNumber.d.ts.map +1 -0
- package/dist/css/properties/index.d.ts +1 -0
- package/dist/css/properties/index.d.ts.map +1 -1
- package/dist/display-objects/DisplayObject.d.ts +1 -0
- package/dist/display-objects/DisplayObject.d.ts.map +1 -1
- package/dist/display-objects/Line.d.ts.map +1 -1
- package/dist/display-objects/Path.d.ts +1 -1
- package/dist/display-objects/Path.d.ts.map +1 -1
- package/dist/display-objects/Polyline.d.ts.map +1 -1
- package/dist/global-module.d.ts.map +1 -1
- package/dist/index.esm.js +185 -96
- package/dist/index.js +184 -96
- package/dist/index.umd.js +184 -96
- package/dist/index.umd.min.js +2 -2
- package/dist/plugins/DirtyCheckPlugin.d.ts +0 -1
- package/dist/plugins/DirtyCheckPlugin.d.ts.map +1 -1
- package/dist/plugins/PrepareRendererPlugin.d.ts +1 -0
- package/dist/plugins/PrepareRendererPlugin.d.ts.map +1 -1
- package/dist/services/RenderingService.d.ts +9 -1
- package/dist/services/RenderingService.d.ts.map +1 -1
- package/dist/services/SceneGraphService.d.ts +6 -1
- package/dist/services/SceneGraphService.d.ts.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -5185,8 +5185,8 @@ var CSSStyleValue = /*#__PURE__*/function () {
|
|
|
5185
5185
|
return UnitType.kPixels;
|
|
5186
5186
|
|
|
5187
5187
|
case UnitCategory.kUPercent:
|
|
5188
|
-
return UnitType.
|
|
5189
|
-
// Cannot convert between numbers and percent.
|
|
5188
|
+
return UnitType.kPercentage;
|
|
5189
|
+
// return UnitType.kUnknown; // Cannot convert between numbers and percent.
|
|
5190
5190
|
|
|
5191
5191
|
case UnitCategory.kUTime:
|
|
5192
5192
|
return UnitType.kSeconds;
|
|
@@ -8034,6 +8034,10 @@ function parserPercentage(css) {
|
|
|
8034
8034
|
*/
|
|
8035
8035
|
|
|
8036
8036
|
function parseLengthOrPercentage(css) {
|
|
8037
|
+
if (isNumber(css)) {
|
|
8038
|
+
return new CSSUnitValue(css, 'px');
|
|
8039
|
+
}
|
|
8040
|
+
|
|
8037
8041
|
return parseDimension(new RegExp('px|%|em|rem', 'g'), css);
|
|
8038
8042
|
}
|
|
8039
8043
|
function parseAngle(css) {
|
|
@@ -8045,6 +8049,7 @@ function parseAngle(css) {
|
|
|
8045
8049
|
* @example
|
|
8046
8050
|
* 10px + 20px = 30px
|
|
8047
8051
|
* 10deg + 10rad
|
|
8052
|
+
* 10% + 20% = 30%
|
|
8048
8053
|
*/
|
|
8049
8054
|
|
|
8050
8055
|
function mergeDimensions(left, right, target, nonNegative, index) {
|
|
@@ -8054,23 +8059,29 @@ function mergeDimensions(left, right, target, nonNegative, index) {
|
|
|
8054
8059
|
|
|
8055
8060
|
var unit = '';
|
|
8056
8061
|
var leftValue = left.value || 0;
|
|
8057
|
-
var rightValue = right.value || 0;
|
|
8058
|
-
|
|
8059
|
-
|
|
8060
|
-
|
|
8061
|
-
|
|
8062
|
-
if (
|
|
8063
|
-
leftValue =
|
|
8064
|
-
rightValue =
|
|
8065
|
-
unit =
|
|
8066
|
-
}
|
|
8067
|
-
|
|
8062
|
+
var rightValue = right.value || 0;
|
|
8063
|
+
var canonicalUnit = CSSUnitValue.toCanonicalUnit(left.unit);
|
|
8064
|
+
var leftCanonicalUnitValue = left.convertTo(canonicalUnit);
|
|
8065
|
+
var rightCanonicalUnitValue = right.convertTo(canonicalUnit);
|
|
8066
|
+
|
|
8067
|
+
if (leftCanonicalUnitValue && rightCanonicalUnitValue) {
|
|
8068
|
+
leftValue = leftCanonicalUnitValue.value;
|
|
8069
|
+
rightValue = rightCanonicalUnitValue.value;
|
|
8070
|
+
unit = CSSUnitValue.unitTypeToString(left.unit);
|
|
8071
|
+
} else {
|
|
8072
|
+
// format '%' to 'px'
|
|
8073
|
+
if (CSSUnitValue.isLength(left.unit) || CSSUnitValue.isLength(right.unit)) {
|
|
8074
|
+
leftValue = convertPercentUnit(left, index, target);
|
|
8075
|
+
rightValue = convertPercentUnit(right, index, target);
|
|
8076
|
+
unit = 'px';
|
|
8077
|
+
}
|
|
8078
|
+
} // // format 'rad' 'turn' to 'deg'
|
|
8079
|
+
// if (CSSUnitValue.isAngle(left.unit) || CSSUnitValue.isAngle(right.unit)) {
|
|
8080
|
+
// leftValue = convertAngleUnit(left);
|
|
8081
|
+
// rightValue = convertAngleUnit(right);
|
|
8082
|
+
// unit = 'deg';
|
|
8083
|
+
// }
|
|
8068
8084
|
|
|
8069
|
-
if (CSSUnitValue.isAngle(left.unit) || CSSUnitValue.isAngle(right.unit)) {
|
|
8070
|
-
leftValue = convertAngleUnit(left);
|
|
8071
|
-
rightValue = convertAngleUnit(right);
|
|
8072
|
-
unit = 'deg';
|
|
8073
|
-
}
|
|
8074
8085
|
|
|
8075
8086
|
return [leftValue, rightValue, function (value) {
|
|
8076
8087
|
if (nonNegative) {
|
|
@@ -11422,6 +11433,7 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
|
|
|
11422
11433
|
_this.styleValueRegistry = GlobalContainer.get(StyleValueRegistry);
|
|
11423
11434
|
_this.isCustomElement = false;
|
|
11424
11435
|
_this.activeAnimations = [];
|
|
11436
|
+
_this.mutationEvent = new MutationEvent(ElementEvent.ATTR_MODIFIED, _assertThisInitialized(_this), null, null, null, MutationEvent.MODIFICATION, null, null);
|
|
11425
11437
|
_this.config = config; // compatible with G 3.0
|
|
11426
11438
|
|
|
11427
11439
|
_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
|
|
@@ -11568,7 +11580,8 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
|
|
|
11568
11580
|
|
|
11569
11581
|
if (this.parsedStyle.clipPathTargets && this.parsedStyle.clipPathTargets.length) {
|
|
11570
11582
|
this.parsedStyle.clipPathTargets.forEach(function (target) {
|
|
11571
|
-
dirtifyToRoot(target);
|
|
11583
|
+
_this2.sceneGraphService.dirtifyToRoot(target);
|
|
11584
|
+
|
|
11572
11585
|
target.dispatchEvent(new MutationEvent(ElementEvent.ATTR_MODIFIED, target, _this2, _this2, 'clipPath', MutationEvent.MODIFICATION, _this2, _this2));
|
|
11573
11586
|
|
|
11574
11587
|
if (target.isCustomElement && target.isConnected) {
|
|
@@ -11580,8 +11593,15 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
|
|
|
11580
11593
|
} // redraw at next frame
|
|
11581
11594
|
|
|
11582
11595
|
|
|
11583
|
-
renderable.dirty = true;
|
|
11584
|
-
this.
|
|
11596
|
+
renderable.dirty = true; // trigger later
|
|
11597
|
+
// this.sceneGraphService.pendingEvents.push([ElementEvent.ATTR_MODIFIED, { affectChildren }]);
|
|
11598
|
+
|
|
11599
|
+
this.mutationEvent.prevValue = oldValue;
|
|
11600
|
+
this.mutationEvent.newValue = value;
|
|
11601
|
+
this.mutationEvent.attrName = name;
|
|
11602
|
+
this.mutationEvent.prevParsedValue = oldParsedValue;
|
|
11603
|
+
this.mutationEvent.newParsedValue = this.parsedStyle[name];
|
|
11604
|
+
this.dispatchEvent(this.mutationEvent);
|
|
11585
11605
|
|
|
11586
11606
|
if (this.isCustomElement && this.isConnected) {
|
|
11587
11607
|
if (this.attributeChangedCallback) {
|
|
@@ -12421,9 +12441,17 @@ var Line = /*#__PURE__*/function (_DisplayObject) {
|
|
|
12421
12441
|
x1 = _this$parsedStyle.x1,
|
|
12422
12442
|
y1 = _this$parsedStyle.y1,
|
|
12423
12443
|
x2 = _this$parsedStyle.x2,
|
|
12424
|
-
y2 = _this$parsedStyle.y2
|
|
12425
|
-
|
|
12426
|
-
|
|
12444
|
+
y2 = _this$parsedStyle.y2,
|
|
12445
|
+
defX = _this$parsedStyle.defX,
|
|
12446
|
+
defY = _this$parsedStyle.defY;
|
|
12447
|
+
|
|
12448
|
+
var _LineUtil$pointAt = Line$1.pointAt(x1.value, y1.value, x2.value, y2.value, ratio),
|
|
12449
|
+
x = _LineUtil$pointAt.x,
|
|
12450
|
+
y = _LineUtil$pointAt.y;
|
|
12451
|
+
|
|
12452
|
+
var transformed = vec3.transformMat4(vec3.create(), vec3.fromValues(x - defX, y - defY, 0), this.getLocalTransform()); // apply local transformation
|
|
12453
|
+
|
|
12454
|
+
return new Point(transformed[0], transformed[1]);
|
|
12427
12455
|
};
|
|
12428
12456
|
|
|
12429
12457
|
_proto.getTotalLength = function getTotalLength() {
|
|
@@ -12468,7 +12496,10 @@ var Path = /*#__PURE__*/function (_DisplayObject) {
|
|
|
12468
12496
|
;
|
|
12469
12497
|
|
|
12470
12498
|
_proto.getPoint = function getPoint(ratio) {
|
|
12471
|
-
var _this$parsedStyle
|
|
12499
|
+
var _this$parsedStyle = this.parsedStyle,
|
|
12500
|
+
defX = _this$parsedStyle.defX,
|
|
12501
|
+
defY = _this$parsedStyle.defY,
|
|
12502
|
+
_this$parsedStyle$pat = _this$parsedStyle.path,
|
|
12472
12503
|
totalLength = _this$parsedStyle$pat.totalLength,
|
|
12473
12504
|
absolutePath = _this$parsedStyle$pat.absolutePath;
|
|
12474
12505
|
|
|
@@ -12476,7 +12507,9 @@ var Path = /*#__PURE__*/function (_DisplayObject) {
|
|
|
12476
12507
|
x = _getPointAtLength.x,
|
|
12477
12508
|
y = _getPointAtLength.y;
|
|
12478
12509
|
|
|
12479
|
-
|
|
12510
|
+
var transformed = vec3.transformMat4(vec3.create(), vec3.fromValues(x - defX, y - defY, 0), this.getLocalTransform()); // apply local transformation
|
|
12511
|
+
|
|
12512
|
+
return new Point(transformed[0], transformed[1]);
|
|
12480
12513
|
}
|
|
12481
12514
|
/**
|
|
12482
12515
|
* Get start tangent vector
|
|
@@ -12581,7 +12614,10 @@ var Polyline = /*#__PURE__*/function (_DisplayObject) {
|
|
|
12581
12614
|
};
|
|
12582
12615
|
|
|
12583
12616
|
_proto.getPoint = function getPoint(ratio) {
|
|
12584
|
-
var _this$parsedStyle
|
|
12617
|
+
var _this$parsedStyle = this.parsedStyle,
|
|
12618
|
+
defX = _this$parsedStyle.defX,
|
|
12619
|
+
defY = _this$parsedStyle.defY,
|
|
12620
|
+
_this$parsedStyle$poi = _this$parsedStyle.points,
|
|
12585
12621
|
points = _this$parsedStyle$poi.points,
|
|
12586
12622
|
segments = _this$parsedStyle$poi.segments;
|
|
12587
12623
|
var subt = 0;
|
|
@@ -12597,7 +12633,9 @@ var Polyline = /*#__PURE__*/function (_DisplayObject) {
|
|
|
12597
12633
|
x = _LineUtil$pointAt.x,
|
|
12598
12634
|
y = _LineUtil$pointAt.y;
|
|
12599
12635
|
|
|
12600
|
-
|
|
12636
|
+
var transformed = vec3.transformMat4(vec3.create(), vec3.fromValues(x - defX, y - defY, 0), this.getLocalTransform()); // apply local transformation
|
|
12637
|
+
|
|
12638
|
+
return new Point(transformed[0], transformed[1]);
|
|
12601
12639
|
};
|
|
12602
12640
|
|
|
12603
12641
|
_proto.getStartTangent = function getStartTangent() {
|
|
@@ -14397,29 +14435,6 @@ function sortByZIndex(o1, o2) {
|
|
|
14397
14435
|
|
|
14398
14436
|
return zIndex1 - zIndex2;
|
|
14399
14437
|
}
|
|
14400
|
-
function dirtifyToRoot(element, affectChildren) {
|
|
14401
|
-
if (affectChildren === void 0) {
|
|
14402
|
-
affectChildren = false;
|
|
14403
|
-
}
|
|
14404
|
-
|
|
14405
|
-
var p = element;
|
|
14406
|
-
|
|
14407
|
-
while (p) {
|
|
14408
|
-
var renderable = p.renderable;
|
|
14409
|
-
|
|
14410
|
-
if (renderable) {
|
|
14411
|
-
renderable.renderBoundsDirty = true;
|
|
14412
|
-
renderable.boundsDirty = true;
|
|
14413
|
-
renderable.dirty = true;
|
|
14414
|
-
}
|
|
14415
|
-
|
|
14416
|
-
p = p.parentNode;
|
|
14417
|
-
}
|
|
14418
|
-
|
|
14419
|
-
element.dispatchEvent(new CustomEvent(ElementEvent.BOUNDS_CHANGED, {
|
|
14420
|
-
affectChildren: affectChildren
|
|
14421
|
-
}));
|
|
14422
|
-
}
|
|
14423
14438
|
var SceneGraphService = Syringe.defineToken('SceneGraphService');
|
|
14424
14439
|
/**
|
|
14425
14440
|
* update transform in scene graph
|
|
@@ -14432,6 +14447,8 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
|
|
|
14432
14447
|
var _this = this;
|
|
14433
14448
|
|
|
14434
14449
|
this.sceneGraphSelectorFactory = void 0;
|
|
14450
|
+
this.pendingEvents = [];
|
|
14451
|
+
this.boundsChangedEvent = new CustomEvent(ElementEvent.BOUNDS_CHANGED);
|
|
14435
14452
|
|
|
14436
14453
|
this.rotate = function () {
|
|
14437
14454
|
var parentInvertRotation = quat$1.create();
|
|
@@ -14865,7 +14882,60 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
|
|
|
14865
14882
|
}
|
|
14866
14883
|
|
|
14867
14884
|
this.dirtifyWorldInternal(element, transform);
|
|
14868
|
-
dirtifyToRoot(element, true);
|
|
14885
|
+
this.dirtifyToRoot(element, true);
|
|
14886
|
+
};
|
|
14887
|
+
|
|
14888
|
+
_proto.triggerPendingEvents = function triggerPendingEvents() {
|
|
14889
|
+
var _this2 = this;
|
|
14890
|
+
|
|
14891
|
+
var set = new Set();
|
|
14892
|
+
|
|
14893
|
+
var trigger = function trigger(element, detail) {
|
|
14894
|
+
if (!set.has(element.entity)) {
|
|
14895
|
+
_this2.boundsChangedEvent.detail = detail;
|
|
14896
|
+
element.dispatchEvent(_this2.boundsChangedEvent);
|
|
14897
|
+
set.add(element.entity);
|
|
14898
|
+
}
|
|
14899
|
+
};
|
|
14900
|
+
|
|
14901
|
+
this.pendingEvents.forEach(function (_ref) {
|
|
14902
|
+
var element = _ref[0],
|
|
14903
|
+
detail = _ref[1];
|
|
14904
|
+
|
|
14905
|
+
if (detail.affectChildren) {
|
|
14906
|
+
element.forEach(function (e) {
|
|
14907
|
+
trigger(e, detail);
|
|
14908
|
+
});
|
|
14909
|
+
} else {
|
|
14910
|
+
trigger(element, detail);
|
|
14911
|
+
}
|
|
14912
|
+
});
|
|
14913
|
+
this.pendingEvents = [];
|
|
14914
|
+
};
|
|
14915
|
+
|
|
14916
|
+
_proto.dirtifyToRoot = function dirtifyToRoot(element, affectChildren) {
|
|
14917
|
+
if (affectChildren === void 0) {
|
|
14918
|
+
affectChildren = false;
|
|
14919
|
+
}
|
|
14920
|
+
|
|
14921
|
+
var p = element;
|
|
14922
|
+
|
|
14923
|
+
while (p) {
|
|
14924
|
+
var renderable = p.renderable;
|
|
14925
|
+
|
|
14926
|
+
if (renderable) {
|
|
14927
|
+
renderable.renderBoundsDirty = true;
|
|
14928
|
+
renderable.boundsDirty = true;
|
|
14929
|
+
renderable.dirty = true;
|
|
14930
|
+
}
|
|
14931
|
+
|
|
14932
|
+
p = p.parentNode;
|
|
14933
|
+
} // reuse the same custom event
|
|
14934
|
+
|
|
14935
|
+
|
|
14936
|
+
this.pendingEvents.push([element, {
|
|
14937
|
+
affectChildren: affectChildren
|
|
14938
|
+
}]);
|
|
14869
14939
|
};
|
|
14870
14940
|
|
|
14871
14941
|
_proto.getPosition = function getPosition(element) {
|
|
@@ -15001,7 +15071,7 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
|
|
|
15001
15071
|
;
|
|
15002
15072
|
|
|
15003
15073
|
_proto.getBounds = function getBounds(element, render) {
|
|
15004
|
-
var
|
|
15074
|
+
var _this3 = this;
|
|
15005
15075
|
|
|
15006
15076
|
if (render === void 0) {
|
|
15007
15077
|
render = false;
|
|
@@ -15022,7 +15092,7 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
|
|
|
15022
15092
|
|
|
15023
15093
|
var children = element.childNodes;
|
|
15024
15094
|
children.forEach(function (child) {
|
|
15025
|
-
var childBounds =
|
|
15095
|
+
var childBounds = _this3.getBounds(child, render);
|
|
15026
15096
|
|
|
15027
15097
|
if (childBounds) {
|
|
15028
15098
|
if (!aabb) {
|
|
@@ -15034,7 +15104,7 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
|
|
|
15034
15104
|
}
|
|
15035
15105
|
}); // account for clip path
|
|
15036
15106
|
|
|
15037
|
-
var clipPath = element.
|
|
15107
|
+
var clipPath = element.parsedStyle.clipPath;
|
|
15038
15108
|
|
|
15039
15109
|
if (clipPath) {
|
|
15040
15110
|
var clipPathBounds = this.getTransformedGeometryBounds(clipPath, true);
|
|
@@ -15125,7 +15195,7 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
|
|
|
15125
15195
|
};
|
|
15126
15196
|
|
|
15127
15197
|
_proto.dirtifyWorldInternal = function dirtifyWorldInternal(element, transform) {
|
|
15128
|
-
var
|
|
15198
|
+
var _this4 = this;
|
|
15129
15199
|
|
|
15130
15200
|
if (!transform.dirtyFlag) {
|
|
15131
15201
|
transform.dirtyFlag = true;
|
|
@@ -15134,7 +15204,7 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
|
|
|
15134
15204
|
var childTransform = child.transformable;
|
|
15135
15205
|
|
|
15136
15206
|
if (!childTransform.dirtyFlag) {
|
|
15137
|
-
|
|
15207
|
+
_this4.dirtifyWorldInternal(child, childTransform);
|
|
15138
15208
|
}
|
|
15139
15209
|
});
|
|
15140
15210
|
var renderable = element.renderable;
|
|
@@ -15144,8 +15214,6 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
|
|
|
15144
15214
|
renderable.boundsDirty = true;
|
|
15145
15215
|
renderable.dirty = true;
|
|
15146
15216
|
}
|
|
15147
|
-
|
|
15148
|
-
element.dispatchEvent(new MutationEvent(ElementEvent.ATTR_MODIFIED, element, null, null, 'modelMatrix', MutationEvent.MODIFICATION, null, null));
|
|
15149
15217
|
}
|
|
15150
15218
|
};
|
|
15151
15219
|
|
|
@@ -16398,6 +16466,7 @@ var RenderingPluginContribution = Syringe.defineToken('RenderingPluginContributi
|
|
|
16398
16466
|
var RenderingService = /*#__PURE__*/function () {
|
|
16399
16467
|
function RenderingService() {
|
|
16400
16468
|
this.renderingPluginProvider = void 0;
|
|
16469
|
+
this.canvasConfig = void 0;
|
|
16401
16470
|
this.renderingContext = void 0;
|
|
16402
16471
|
this.sceneGraphService = void 0;
|
|
16403
16472
|
this.styleValueRegistry = void 0;
|
|
@@ -16511,6 +16580,21 @@ var RenderingService = /*#__PURE__*/function () {
|
|
|
16511
16580
|
|
|
16512
16581
|
_proto.getStats = function getStats() {
|
|
16513
16582
|
return this.stats;
|
|
16583
|
+
}
|
|
16584
|
+
/**
|
|
16585
|
+
* Meet the following conditions:
|
|
16586
|
+
* * disable DirtyRectangleRendering
|
|
16587
|
+
* * camera changed
|
|
16588
|
+
*/
|
|
16589
|
+
;
|
|
16590
|
+
|
|
16591
|
+
_proto.disableDirtyRectangleRendering = function disableDirtyRectangleRendering() {
|
|
16592
|
+
var renderer = this.canvasConfig.renderer;
|
|
16593
|
+
|
|
16594
|
+
var _renderer$getConfig = renderer.getConfig(),
|
|
16595
|
+
enableDirtyRectangleRendering = _renderer$getConfig.enableDirtyRectangleRendering;
|
|
16596
|
+
|
|
16597
|
+
return !enableDirtyRectangleRendering || this.renderingContext.renderReasons.has(RenderReason.CAMERA_CHANGED);
|
|
16514
16598
|
};
|
|
16515
16599
|
|
|
16516
16600
|
_proto.render = function render(canvasConfig) {
|
|
@@ -16520,6 +16604,7 @@ var RenderingService = /*#__PURE__*/function () {
|
|
|
16520
16604
|
this.stats.rendered = 0;
|
|
16521
16605
|
this.zIndexCounter = 0;
|
|
16522
16606
|
this.sceneGraphService.syncHierarchy(this.renderingContext.root);
|
|
16607
|
+
this.sceneGraphService.triggerPendingEvents();
|
|
16523
16608
|
|
|
16524
16609
|
if (this.renderingContext.renderReasons.size && this.inited) {
|
|
16525
16610
|
this.renderDisplayObject(this.renderingContext.root, canvasConfig);
|
|
@@ -16607,6 +16692,8 @@ var RenderingService = /*#__PURE__*/function () {
|
|
|
16607
16692
|
|
|
16608
16693
|
__decorate([contrib(RenderingPluginContribution), __metadata("design:type", Object)], RenderingService.prototype, "renderingPluginProvider", void 0);
|
|
16609
16694
|
|
|
16695
|
+
__decorate([inject(CanvasConfig), __metadata("design:type", Object)], RenderingService.prototype, "canvasConfig", void 0);
|
|
16696
|
+
|
|
16610
16697
|
__decorate([inject(RenderingContext), __metadata("design:type", Object)], RenderingService.prototype, "renderingContext", void 0);
|
|
16611
16698
|
|
|
16612
16699
|
__decorate([inject(SceneGraphService), __metadata("design:type", Object)], RenderingService.prototype, "sceneGraphService", void 0);
|
|
@@ -18600,7 +18687,9 @@ PathUpdater = __decorate([singleton({
|
|
|
18600
18687
|
*/
|
|
18601
18688
|
|
|
18602
18689
|
var CSSPropertyClipPath = /*#__PURE__*/function () {
|
|
18603
|
-
function CSSPropertyClipPath() {
|
|
18690
|
+
function CSSPropertyClipPath() {
|
|
18691
|
+
this.sceneGraphService = void 0;
|
|
18692
|
+
}
|
|
18604
18693
|
|
|
18605
18694
|
var _proto = CSSPropertyClipPath.prototype;
|
|
18606
18695
|
|
|
@@ -18624,13 +18713,15 @@ var CSSPropertyClipPath = /*#__PURE__*/function () {
|
|
|
18624
18713
|
newClipPath.parsedStyle.clipPathTargets.push(object);
|
|
18625
18714
|
}
|
|
18626
18715
|
|
|
18627
|
-
dirtifyToRoot(object);
|
|
18716
|
+
this.sceneGraphService.dirtifyToRoot(object);
|
|
18628
18717
|
return newClipPath;
|
|
18629
18718
|
};
|
|
18630
18719
|
|
|
18631
18720
|
return CSSPropertyClipPath;
|
|
18632
18721
|
}();
|
|
18633
18722
|
|
|
18723
|
+
__decorate([inject(SceneGraphService), __metadata("design:type", Object)], CSSPropertyClipPath.prototype, "sceneGraphService", void 0);
|
|
18724
|
+
|
|
18634
18725
|
CSSPropertyClipPath = __decorate([singleton({
|
|
18635
18726
|
token: {
|
|
18636
18727
|
token: CSSProperty,
|
|
@@ -18710,21 +18801,6 @@ var CSSPropertyLengthOrPercentage = /*#__PURE__*/function () {
|
|
|
18710
18801
|
_proto.calculator = function calculator(name, oldParsed, computed, object, registry) {
|
|
18711
18802
|
if (CSSUnitValue.isRelativeUnit(computed.unit)) {
|
|
18712
18803
|
if (computed.unit === UnitType.kPercentage) {
|
|
18713
|
-
// try to resolve according to parent's geometry bounds
|
|
18714
|
-
// if (object.parentElement) {
|
|
18715
|
-
// // registry.registerParentGeometryBoundsChangedHandler(object, name);
|
|
18716
|
-
// return this.calculateUsedValueWithParentBounds(object, name);
|
|
18717
|
-
// } else {
|
|
18718
|
-
// registry.addUnresolveProperty(object, name);
|
|
18719
|
-
// // defer calculation after mounted
|
|
18720
|
-
// // object.addEventListener(
|
|
18721
|
-
// // ElementEvent.MOUNTED,
|
|
18722
|
-
// // () => {
|
|
18723
|
-
// // registry.registerParentGeometryBoundsChangedHandler(object, name);
|
|
18724
|
-
// // },
|
|
18725
|
-
// // { once: true },
|
|
18726
|
-
// // );
|
|
18727
|
-
// }
|
|
18728
18804
|
return new CSSUnitValue(0, 'px');
|
|
18729
18805
|
} else if (computed.unit === UnitType.kEms) {
|
|
18730
18806
|
if (object.parentNode) {
|
|
@@ -18758,10 +18834,13 @@ var CSSPropertyLengthOrPercentage = /*#__PURE__*/function () {
|
|
|
18758
18834
|
}();
|
|
18759
18835
|
|
|
18760
18836
|
CSSPropertyLengthOrPercentage = __decorate([singleton({
|
|
18761
|
-
token: {
|
|
18837
|
+
token: [{
|
|
18762
18838
|
token: CSSProperty,
|
|
18763
18839
|
named: PropertySyntax.LENGTH_PERCENTAGE
|
|
18764
|
-
}
|
|
18840
|
+
}, {
|
|
18841
|
+
token: CSSProperty,
|
|
18842
|
+
named: PropertySyntax.LENGTH
|
|
18843
|
+
}]
|
|
18765
18844
|
})], CSSPropertyLengthOrPercentage);
|
|
18766
18845
|
|
|
18767
18846
|
/**
|
|
@@ -18930,6 +19009,18 @@ CSSPropertyLocalPosition = __decorate([singleton({
|
|
|
18930
19009
|
}
|
|
18931
19010
|
})], CSSPropertyLocalPosition);
|
|
18932
19011
|
|
|
19012
|
+
var CSSPropertyNumber = function CSSPropertyNumber() {
|
|
19013
|
+
this.mixer = mergeNumbers;
|
|
19014
|
+
this.parser = parseNumber;
|
|
19015
|
+
};
|
|
19016
|
+
|
|
19017
|
+
CSSPropertyNumber = __decorate([singleton({
|
|
19018
|
+
token: {
|
|
19019
|
+
token: CSSProperty,
|
|
19020
|
+
named: PropertySyntax.NUMBER
|
|
19021
|
+
}
|
|
19022
|
+
})], CSSPropertyNumber);
|
|
19023
|
+
|
|
18933
19024
|
var CSSPropertyOffsetDistance = /*#__PURE__*/function () {
|
|
18934
19025
|
function CSSPropertyOffsetDistance() {
|
|
18935
19026
|
this.parser = parseNumber;
|
|
@@ -19816,6 +19907,7 @@ var DefaultStyleValueRegistry = /*#__PURE__*/function () {
|
|
|
19816
19907
|
this.cache = {};
|
|
19817
19908
|
this.unresolvedProperties = {};
|
|
19818
19909
|
this.propertySyntaxFactory = void 0;
|
|
19910
|
+
this.sceneGraphService = void 0;
|
|
19819
19911
|
this.cascadeProperties = {};
|
|
19820
19912
|
}
|
|
19821
19913
|
|
|
@@ -20261,9 +20353,8 @@ var DefaultStyleValueRegistry = /*#__PURE__*/function () {
|
|
|
20261
20353
|
var usedOriginYValue = (flipX ? -1 : 1) * convertPercentUnit(transformOrigin[1], 1, object);
|
|
20262
20354
|
usedOriginXValue = usedOriginXValue - (flipY ? -1 : 1) * (anchor && anchor[0].value || 0) * geometry.contentBounds.halfExtents[0] * 2;
|
|
20263
20355
|
usedOriginYValue = usedOriginYValue - (flipX ? -1 : 1) * (anchor && anchor[1].value || 0) * geometry.contentBounds.halfExtents[1] * 2;
|
|
20264
|
-
object.setOrigin(usedOriginXValue, usedOriginYValue);
|
|
20265
|
-
|
|
20266
|
-
dirtifyToRoot(object);
|
|
20356
|
+
object.setOrigin(usedOriginXValue, usedOriginYValue);
|
|
20357
|
+
this.sceneGraphService.dirtifyToRoot(object);
|
|
20267
20358
|
}
|
|
20268
20359
|
};
|
|
20269
20360
|
|
|
@@ -20282,6 +20373,8 @@ var DefaultStyleValueRegistry = /*#__PURE__*/function () {
|
|
|
20282
20373
|
|
|
20283
20374
|
__decorate([inject(CSSPropertySyntaxFactory), __metadata("design:type", Function)], DefaultStyleValueRegistry.prototype, "propertySyntaxFactory", void 0);
|
|
20284
20375
|
|
|
20376
|
+
__decorate([inject(SceneGraphService), __metadata("design:type", Object)], DefaultStyleValueRegistry.prototype, "sceneGraphService", void 0);
|
|
20377
|
+
|
|
20285
20378
|
__decorate([postConstruct(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0)], DefaultStyleValueRegistry.prototype, "init", null);
|
|
20286
20379
|
|
|
20287
20380
|
DefaultStyleValueRegistry = __decorate([singleton({
|
|
@@ -20331,6 +20424,7 @@ var containerModule = Module(function (register) {
|
|
|
20331
20424
|
}
|
|
20332
20425
|
}); // bind CSS property handlers
|
|
20333
20426
|
|
|
20427
|
+
register(CSSPropertyNumber);
|
|
20334
20428
|
register(CSSPropertyAngle);
|
|
20335
20429
|
register(CSSPropertyClipPath);
|
|
20336
20430
|
register(CSSPropertyColor);
|
|
@@ -20594,22 +20688,15 @@ var DirtyCheckPlugin_1;
|
|
|
20594
20688
|
*/
|
|
20595
20689
|
|
|
20596
20690
|
var DirtyCheckPlugin = DirtyCheckPlugin_1 = (_class$2 = /*#__PURE__*/function () {
|
|
20597
|
-
function DirtyCheckPlugin() {
|
|
20598
|
-
this.renderingContext = void 0;
|
|
20599
|
-
}
|
|
20691
|
+
function DirtyCheckPlugin() {}
|
|
20600
20692
|
|
|
20601
20693
|
var _proto = DirtyCheckPlugin.prototype;
|
|
20602
20694
|
|
|
20603
20695
|
_proto.apply = function apply(renderingService) {
|
|
20604
|
-
var _this = this;
|
|
20605
|
-
|
|
20606
20696
|
renderingService.hooks.dirtycheck.tap(DirtyCheckPlugin_1.tag, function (object) {
|
|
20607
20697
|
if (object) {
|
|
20608
20698
|
var renderable = object.renderable;
|
|
20609
|
-
|
|
20610
|
-
var isCameraDirty = _this.renderingContext.renderReasons.has(RenderReason.CAMERA_CHANGED);
|
|
20611
|
-
|
|
20612
|
-
var isDirty = renderable.dirty || isCameraDirty;
|
|
20699
|
+
var isDirty = renderable.dirty || renderingService.disableDirtyRectangleRendering();
|
|
20613
20700
|
|
|
20614
20701
|
if (isDirty) {
|
|
20615
20702
|
return object;
|
|
@@ -20624,9 +20711,6 @@ var DirtyCheckPlugin = DirtyCheckPlugin_1 = (_class$2 = /*#__PURE__*/function ()
|
|
|
20624
20711
|
|
|
20625
20712
|
return DirtyCheckPlugin;
|
|
20626
20713
|
}(), _class$2.tag = 'DirtyCheck', _class$2);
|
|
20627
|
-
|
|
20628
|
-
__decorate([inject(RenderingContext), __metadata("design:type", Object)], DirtyCheckPlugin.prototype, "renderingContext", void 0);
|
|
20629
|
-
|
|
20630
20714
|
DirtyCheckPlugin = DirtyCheckPlugin_1 = __decorate([singleton({
|
|
20631
20715
|
contrib: RenderingPluginContribution
|
|
20632
20716
|
})], DirtyCheckPlugin);
|
|
@@ -21051,6 +21135,7 @@ var PrepareRendererPlugin = PrepareRendererPlugin_1 = (_class$4 = /*#__PURE__*/f
|
|
|
21051
21135
|
function PrepareRendererPlugin() {
|
|
21052
21136
|
this.renderingContext = void 0;
|
|
21053
21137
|
this.styleValueRegistry = void 0;
|
|
21138
|
+
this.sceneGraphService = void 0;
|
|
21054
21139
|
this.rBush = void 0;
|
|
21055
21140
|
this.toSync = new Set();
|
|
21056
21141
|
}
|
|
@@ -21097,7 +21182,8 @@ var PrepareRendererPlugin = PrepareRendererPlugin_1 = (_class$4 = /*#__PURE__*/f
|
|
|
21097
21182
|
|
|
21098
21183
|
_this2.styleValueRegistry.recalc(object);
|
|
21099
21184
|
|
|
21100
|
-
dirtifyToRoot(object);
|
|
21185
|
+
_this2.sceneGraphService.dirtifyToRoot(object);
|
|
21186
|
+
|
|
21101
21187
|
renderingService.dirtify();
|
|
21102
21188
|
};
|
|
21103
21189
|
|
|
@@ -21111,7 +21197,8 @@ var PrepareRendererPlugin = PrepareRendererPlugin_1 = (_class$4 = /*#__PURE__*/f
|
|
|
21111
21197
|
_this2.toSync.delete(object);
|
|
21112
21198
|
}
|
|
21113
21199
|
|
|
21114
|
-
dirtifyToRoot(e.target);
|
|
21200
|
+
_this2.sceneGraphService.dirtifyToRoot(e.target);
|
|
21201
|
+
|
|
21115
21202
|
renderingService.dirtify();
|
|
21116
21203
|
};
|
|
21117
21204
|
|
|
@@ -21201,6 +21288,8 @@ __decorate([inject(RenderingContext), __metadata("design:type", Object)], Prepar
|
|
|
21201
21288
|
|
|
21202
21289
|
__decorate([inject(StyleValueRegistry), __metadata("design:type", Object)], PrepareRendererPlugin.prototype, "styleValueRegistry", void 0);
|
|
21203
21290
|
|
|
21291
|
+
__decorate([inject(SceneGraphService), __metadata("design:type", Object)], PrepareRendererPlugin.prototype, "sceneGraphService", void 0);
|
|
21292
|
+
|
|
21204
21293
|
__decorate([inject(RBushRoot), __metadata("design:type", RBush)], PrepareRendererPlugin.prototype, "rBush", void 0);
|
|
21205
21294
|
|
|
21206
21295
|
PrepareRendererPlugin = PrepareRendererPlugin_1 = __decorate([singleton({
|
|
@@ -21896,4 +21985,4 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
21896
21985
|
GlobalContainer.load(containerModule);
|
|
21897
21986
|
var layoutEngine = GlobalContainer.get(LayoutEngine);
|
|
21898
21987
|
|
|
21899
|
-
export { AABB, AbstractLayoutDefinition, AbstractRenderer, Animation, AnimationEffectTiming, AnimationEvent, AnimationTimeline, AsyncParallelHook, AsyncSeriesWaterfallHook, BUILT_IN_PROPERTIES, BaseType, BoundingSphere, CSS, CSSColorValue, CSSGradientValue, CSSKeywordValue, CSSMathInvert, CSSMathMax, CSSMathMin, CSSMathNegate, CSSMathOperator, CSSMathProduct, CSSMathSum, CSSMathValue, CSSMathVariadic, CSSNumericValue, CSSNumericValueType, CSSProperty, CSSPropertyAngle, CSSPropertyClipPath, CSSPropertyColor, CSSPropertyFilter, CSSPropertyLengthOrPercentage, CSSPropertyLengthOrPercentage12, CSSPropertyLengthOrPercentage14, CSSPropertyLocalPosition, CSSPropertyOffsetDistance, CSSPropertyOffsetPath, CSSPropertyOpacity, CSSPropertyPath, CSSPropertyPoints, CSSPropertyShadowBlur, CSSPropertySyntaxFactory, CSSPropertyText, CSSPropertyTextTransform, CSSPropertyTransform, CSSPropertyTransformOrigin, CSSPropertyZIndex, CSSRGB, CSSStyleValue, CSSStyleValueType, CSSUnitValue, Camera, CameraEvent, CameraProjectionMode, CameraTrackingMode, CameraType, Canvas, CanvasConfig, CanvasEvent, Circle, CircleUpdater, ContextNode, ContextService, Cullable, CustomElement, CustomElementRegistry, CustomEvent, DCHECK, DCHECK_EQ, DCHECK_NE, DELEGATION_SPLITTER, DefaultCamera, DefaultSceneGraphSelector, DefaultSceneGraphService, DefaultStyleValueRegistry, Deferred, DisplayObject, DisplayObjectPool, Document, EasingFunctions, Element, ElementEvent, Ellipse, EllipseUpdater, EventService, EventTarget, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FragmentResult, FragmentResultFactory, FragmentResultOptions, Frustum, Geometry, GeometryAABBUpdater, GeometryUpdaterFactory, GradientType, Group, HTML, Image, KeyframeEffect, LayoutChildren, LayoutChildrenFactory, LayoutChildrenOptions, LayoutContext, LayoutContextFactory, LayoutContextOptions, LayoutEdges, LayoutEdgesFactory, LayoutEdgesOptions, LayoutEngine, LayoutFragment, LayoutFragmentFactory, LayoutFragmentOptions, LayoutObject, LayoutRegistry, LayoutTaskType, Line, LineUpdater, MOUSE_POINTER_ID, Mask, MutationEvent, MutationObserver, MutationRecord, Nested, Node, ObjectTyped, Odeg, OffscreenCanvasCreator, Opx, ParenLess, Path, PathUpdater, Plane, Point, Polygon, Polyline, PolylineUpdater, PropertyName, PropertySyntax, RBushNode, RBushRoot, Ray, Rect, RectUpdater, Rectangle, Registration, RenderReason, Renderable, RenderingContext, RenderingPluginContribution, RenderingService, SceneGraphSelector, SceneGraphSelectorFactory, SceneGraphService, Shape, Sortable, Strategy, StyleValueRegistry, SyncHook, SyncWaterfallHook, TOUCH_TO_POINTER, Text, TextService, TextUpdater, Transform, UnitCategory, UnitType, ValueRange, baseTypeToString, camelCase, clamp, clampedMergeNumbers, cleanExistedCanvas, colorStopToString, compareAnimations, computeLinearGradient, computeRadialGradient, convertAngleUnit, convertEffectInput, convertItemToMatrix, convertPercentUnit, convertToDash, convertToPath, createVec3, decompose, deg2rad, deg2turn,
|
|
21988
|
+
export { AABB, AbstractLayoutDefinition, AbstractRenderer, Animation, AnimationEffectTiming, AnimationEvent, AnimationTimeline, AsyncParallelHook, AsyncSeriesWaterfallHook, BUILT_IN_PROPERTIES, BaseType, BoundingSphere, CSS, CSSColorValue, CSSGradientValue, CSSKeywordValue, CSSMathInvert, CSSMathMax, CSSMathMin, CSSMathNegate, CSSMathOperator, CSSMathProduct, CSSMathSum, CSSMathValue, CSSMathVariadic, CSSNumericValue, CSSNumericValueType, CSSProperty, CSSPropertyAngle, CSSPropertyClipPath, CSSPropertyColor, CSSPropertyFilter, CSSPropertyLengthOrPercentage, CSSPropertyLengthOrPercentage12, CSSPropertyLengthOrPercentage14, CSSPropertyLocalPosition, CSSPropertyNumber, CSSPropertyOffsetDistance, CSSPropertyOffsetPath, CSSPropertyOpacity, CSSPropertyPath, CSSPropertyPoints, CSSPropertyShadowBlur, CSSPropertySyntaxFactory, CSSPropertyText, CSSPropertyTextTransform, CSSPropertyTransform, CSSPropertyTransformOrigin, CSSPropertyZIndex, CSSRGB, CSSStyleValue, CSSStyleValueType, CSSUnitValue, Camera, CameraEvent, CameraProjectionMode, CameraTrackingMode, CameraType, Canvas, CanvasConfig, CanvasEvent, Circle, CircleUpdater, ContextNode, ContextService, Cullable, CustomElement, CustomElementRegistry, CustomEvent, DCHECK, DCHECK_EQ, DCHECK_NE, DELEGATION_SPLITTER, DefaultCamera, DefaultSceneGraphSelector, DefaultSceneGraphService, DefaultStyleValueRegistry, Deferred, DisplayObject, DisplayObjectPool, Document, EasingFunctions, Element, ElementEvent, Ellipse, EllipseUpdater, EventService, EventTarget, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FragmentResult, FragmentResultFactory, FragmentResultOptions, Frustum, Geometry, GeometryAABBUpdater, GeometryUpdaterFactory, GradientType, Group, HTML, Image, KeyframeEffect, LayoutChildren, LayoutChildrenFactory, LayoutChildrenOptions, LayoutContext, LayoutContextFactory, LayoutContextOptions, LayoutEdges, LayoutEdgesFactory, LayoutEdgesOptions, LayoutEngine, LayoutFragment, LayoutFragmentFactory, LayoutFragmentOptions, LayoutObject, LayoutRegistry, LayoutTaskType, Line, LineUpdater, MOUSE_POINTER_ID, Mask, MutationEvent, MutationObserver, MutationRecord, Nested, Node, ObjectTyped, Odeg, OffscreenCanvasCreator, Opx, ParenLess, Path, PathUpdater, Plane, Point, Polygon, Polyline, PolylineUpdater, PropertyName, PropertySyntax, RBushNode, RBushRoot, Ray, Rect, RectUpdater, Rectangle, Registration, RenderReason, Renderable, RenderingContext, RenderingPluginContribution, RenderingService, SceneGraphSelector, SceneGraphSelectorFactory, SceneGraphService, Shape, Sortable, Strategy, StyleValueRegistry, SyncHook, SyncWaterfallHook, TOUCH_TO_POINTER, Text, TextService, TextUpdater, Transform, UnitCategory, UnitType, ValueRange, baseTypeToString, camelCase, clamp, clampedMergeNumbers, cleanExistedCanvas, colorStopToString, compareAnimations, computeLinearGradient, computeRadialGradient, convertAngleUnit, convertEffectInput, convertItemToMatrix, convertPercentUnit, convertToDash, convertToPath, createVec3, decompose, deg2rad, deg2turn, equalSet, extractPolygons, formatAttribute, fromRotationTranslationScale, getAngle, getEasingFunction, getEuler, getHeight, getRotationInRadians, getScaling, getStyle, getTranslation, getWidth, grad2deg, hasArcOrBezier, isBoolean, isBrowser, isComparison, isFunction, isNil, isNumber, isObject, isPattern, isString, isUndefined, layoutEngine, makePerspective, makeQuerablePromise, makeTiming, memoize, mergeColors, mergeDimensionList, mergeDimensions, mergeNumberLists, mergeNumbers, mergePaths, mergeTransforms, normalizeKeyframes, normalizeTimingInput, numberToString, numericTimingToObject, parseAngle, parseColor, parseDimension, parseDimensionArray, parseFilter, parseGradient, parseLength, parseLengthOrPercentage, parseNumber, parseNumberList, parseParam, parsePath, parsePoints, parseTransform, parseTransformOrigin, parserPercentage, path2Segments, rad2deg, setDOMSize, sortByZIndex, toFontString, translatePathToString, turn2deg, typeCheck, unitTypeToBaseType };
|