@antv/g 5.5.0 → 5.5.3
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/parser/path.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/CSSPropertyFilter.d.ts +1 -0
- package/dist/css/properties/CSSPropertyFilter.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/dom/interfaces.d.ts +1 -0
- package/dist/dom/interfaces.d.ts.map +1 -1
- package/dist/global-module.d.ts.map +1 -1
- package/dist/index.esm.js +225 -106
- package/dist/index.js +224 -106
- package/dist/index.umd.js +224 -106
- 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 +13 -1
- package/dist/services/RenderingService.d.ts.map +1 -1
- package/dist/services/SceneGraphSelector.d.ts.map +1 -1
- package/dist/services/SceneGraphService.d.ts +6 -1
- package/dist/services/SceneGraphService.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.umd.js
CHANGED
|
@@ -12215,8 +12215,8 @@
|
|
|
12215
12215
|
return exports.UnitType.kPixels;
|
|
12216
12216
|
|
|
12217
12217
|
case exports.UnitCategory.kUPercent:
|
|
12218
|
-
return exports.UnitType.
|
|
12219
|
-
// Cannot convert between numbers and percent.
|
|
12218
|
+
return exports.UnitType.kPercentage;
|
|
12219
|
+
// return UnitType.kUnknown; // Cannot convert between numbers and percent.
|
|
12220
12220
|
|
|
12221
12221
|
case exports.UnitCategory.kUTime:
|
|
12222
12222
|
return exports.UnitType.kSeconds;
|
|
@@ -15437,6 +15437,10 @@
|
|
|
15437
15437
|
*/
|
|
15438
15438
|
|
|
15439
15439
|
function parseLengthOrPercentage(css) {
|
|
15440
|
+
if (isNumber(css)) {
|
|
15441
|
+
return new CSSUnitValue(css, 'px');
|
|
15442
|
+
}
|
|
15443
|
+
|
|
15440
15444
|
return parseDimension(new RegExp('px|%|em|rem', 'g'), css);
|
|
15441
15445
|
}
|
|
15442
15446
|
function parseAngle(css) {
|
|
@@ -15448,6 +15452,7 @@
|
|
|
15448
15452
|
* @example
|
|
15449
15453
|
* 10px + 20px = 30px
|
|
15450
15454
|
* 10deg + 10rad
|
|
15455
|
+
* 10% + 20% = 30%
|
|
15451
15456
|
*/
|
|
15452
15457
|
|
|
15453
15458
|
function mergeDimensions(left, right, target, nonNegative, index) {
|
|
@@ -15457,23 +15462,29 @@
|
|
|
15457
15462
|
|
|
15458
15463
|
var unit = '';
|
|
15459
15464
|
var leftValue = left.value || 0;
|
|
15460
|
-
var rightValue = right.value || 0;
|
|
15461
|
-
|
|
15462
|
-
|
|
15463
|
-
|
|
15464
|
-
|
|
15465
|
-
if (
|
|
15466
|
-
leftValue =
|
|
15467
|
-
rightValue =
|
|
15468
|
-
unit =
|
|
15469
|
-
}
|
|
15470
|
-
|
|
15465
|
+
var rightValue = right.value || 0;
|
|
15466
|
+
var canonicalUnit = CSSUnitValue.toCanonicalUnit(left.unit);
|
|
15467
|
+
var leftCanonicalUnitValue = left.convertTo(canonicalUnit);
|
|
15468
|
+
var rightCanonicalUnitValue = right.convertTo(canonicalUnit);
|
|
15469
|
+
|
|
15470
|
+
if (leftCanonicalUnitValue && rightCanonicalUnitValue) {
|
|
15471
|
+
leftValue = leftCanonicalUnitValue.value;
|
|
15472
|
+
rightValue = rightCanonicalUnitValue.value;
|
|
15473
|
+
unit = CSSUnitValue.unitTypeToString(left.unit);
|
|
15474
|
+
} else {
|
|
15475
|
+
// format '%' to 'px'
|
|
15476
|
+
if (CSSUnitValue.isLength(left.unit) || CSSUnitValue.isLength(right.unit)) {
|
|
15477
|
+
leftValue = convertPercentUnit(left, index, target);
|
|
15478
|
+
rightValue = convertPercentUnit(right, index, target);
|
|
15479
|
+
unit = 'px';
|
|
15480
|
+
}
|
|
15481
|
+
} // // format 'rad' 'turn' to 'deg'
|
|
15482
|
+
// if (CSSUnitValue.isAngle(left.unit) || CSSUnitValue.isAngle(right.unit)) {
|
|
15483
|
+
// leftValue = convertAngleUnit(left);
|
|
15484
|
+
// rightValue = convertAngleUnit(right);
|
|
15485
|
+
// unit = 'deg';
|
|
15486
|
+
// }
|
|
15471
15487
|
|
|
15472
|
-
if (CSSUnitValue.isAngle(left.unit) || CSSUnitValue.isAngle(right.unit)) {
|
|
15473
|
-
leftValue = convertAngleUnit(left);
|
|
15474
|
-
rightValue = convertAngleUnit(right);
|
|
15475
|
-
unit = 'deg';
|
|
15476
|
-
}
|
|
15477
15488
|
|
|
15478
15489
|
return [leftValue, rightValue, function (value) {
|
|
15479
15490
|
if (nonNegative) {
|
|
@@ -17213,6 +17224,10 @@
|
|
|
17213
17224
|
var absolutePath;
|
|
17214
17225
|
|
|
17215
17226
|
try {
|
|
17227
|
+
if (Array.isArray(path) && path.length === 0) {
|
|
17228
|
+
throw new Error();
|
|
17229
|
+
}
|
|
17230
|
+
|
|
17216
17231
|
absolutePath = normalizePath(path);
|
|
17217
17232
|
} catch (e) {
|
|
17218
17233
|
absolutePath = normalizePath('');
|
|
@@ -17250,7 +17265,7 @@
|
|
|
17250
17265
|
curve: curve,
|
|
17251
17266
|
totalLength: length,
|
|
17252
17267
|
zCommandIndexes: zCommandIndexes,
|
|
17253
|
-
rect: new Rectangle(x, y, width, height)
|
|
17268
|
+
rect: new Rectangle(Number.isFinite(x) ? x : 0, Number.isFinite(y) ? y : 0, Number.isFinite(width) ? width : 0, Number.isFinite(height) ? height : 0)
|
|
17254
17269
|
};
|
|
17255
17270
|
}, function (path) {
|
|
17256
17271
|
return isString(path) ? path : path2String(path);
|
|
@@ -21176,7 +21191,8 @@
|
|
|
21176
21191
|
textAlign: '',
|
|
21177
21192
|
textBaseline: '',
|
|
21178
21193
|
textTransform: '',
|
|
21179
|
-
zIndex: ''
|
|
21194
|
+
zIndex: '',
|
|
21195
|
+
filter: ''
|
|
21180
21196
|
};
|
|
21181
21197
|
/**
|
|
21182
21198
|
* prototype chains: DisplayObject -> Element -> Node -> EventTarget
|
|
@@ -21219,6 +21235,7 @@
|
|
|
21219
21235
|
_this.styleValueRegistry = GlobalContainer$1.get(StyleValueRegistry);
|
|
21220
21236
|
_this.isCustomElement = false;
|
|
21221
21237
|
_this.activeAnimations = [];
|
|
21238
|
+
_this.mutationEvent = new MutationEvent(exports.ElementEvent.ATTR_MODIFIED, _assertThisInitialized(_this), null, null, null, MutationEvent.MODIFICATION, null, null);
|
|
21222
21239
|
_this.config = config; // compatible with G 3.0
|
|
21223
21240
|
|
|
21224
21241
|
_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
|
|
@@ -21365,7 +21382,8 @@
|
|
|
21365
21382
|
|
|
21366
21383
|
if (this.parsedStyle.clipPathTargets && this.parsedStyle.clipPathTargets.length) {
|
|
21367
21384
|
this.parsedStyle.clipPathTargets.forEach(function (target) {
|
|
21368
|
-
dirtifyToRoot(target);
|
|
21385
|
+
_this2.sceneGraphService.dirtifyToRoot(target);
|
|
21386
|
+
|
|
21369
21387
|
target.dispatchEvent(new MutationEvent(exports.ElementEvent.ATTR_MODIFIED, target, _this2, _this2, 'clipPath', MutationEvent.MODIFICATION, _this2, _this2));
|
|
21370
21388
|
|
|
21371
21389
|
if (target.isCustomElement && target.isConnected) {
|
|
@@ -21377,8 +21395,15 @@
|
|
|
21377
21395
|
} // redraw at next frame
|
|
21378
21396
|
|
|
21379
21397
|
|
|
21380
|
-
renderable.dirty = true;
|
|
21381
|
-
this.
|
|
21398
|
+
renderable.dirty = true; // trigger later
|
|
21399
|
+
// this.sceneGraphService.pendingEvents.push([ElementEvent.ATTR_MODIFIED, { affectChildren }]);
|
|
21400
|
+
|
|
21401
|
+
this.mutationEvent.prevValue = oldValue;
|
|
21402
|
+
this.mutationEvent.newValue = value;
|
|
21403
|
+
this.mutationEvent.attrName = name;
|
|
21404
|
+
this.mutationEvent.prevParsedValue = oldParsedValue;
|
|
21405
|
+
this.mutationEvent.newParsedValue = this.parsedStyle[name];
|
|
21406
|
+
this.dispatchEvent(this.mutationEvent);
|
|
21382
21407
|
|
|
21383
21408
|
if (this.isCustomElement && this.isConnected) {
|
|
21384
21409
|
if (this.attributeChangedCallback) {
|
|
@@ -22218,9 +22243,17 @@
|
|
|
22218
22243
|
x1 = _this$parsedStyle.x1,
|
|
22219
22244
|
y1 = _this$parsedStyle.y1,
|
|
22220
22245
|
x2 = _this$parsedStyle.x2,
|
|
22221
|
-
y2 = _this$parsedStyle.y2
|
|
22222
|
-
|
|
22223
|
-
|
|
22246
|
+
y2 = _this$parsedStyle.y2,
|
|
22247
|
+
defX = _this$parsedStyle.defX,
|
|
22248
|
+
defY = _this$parsedStyle.defY;
|
|
22249
|
+
|
|
22250
|
+
var _LineUtil$pointAt = line.pointAt(x1.value, y1.value, x2.value, y2.value, ratio),
|
|
22251
|
+
x = _LineUtil$pointAt.x,
|
|
22252
|
+
y = _LineUtil$pointAt.y;
|
|
22253
|
+
|
|
22254
|
+
var transformed = transformMat4(create$2(), fromValues$1(x - defX, y - defY, 0), this.getLocalTransform()); // apply local transformation
|
|
22255
|
+
|
|
22256
|
+
return new Point(transformed[0], transformed[1]);
|
|
22224
22257
|
};
|
|
22225
22258
|
|
|
22226
22259
|
_proto.getTotalLength = function getTotalLength() {
|
|
@@ -22265,7 +22298,10 @@
|
|
|
22265
22298
|
;
|
|
22266
22299
|
|
|
22267
22300
|
_proto.getPoint = function getPoint(ratio) {
|
|
22268
|
-
var _this$parsedStyle
|
|
22301
|
+
var _this$parsedStyle = this.parsedStyle,
|
|
22302
|
+
defX = _this$parsedStyle.defX,
|
|
22303
|
+
defY = _this$parsedStyle.defY,
|
|
22304
|
+
_this$parsedStyle$pat = _this$parsedStyle.path,
|
|
22269
22305
|
totalLength = _this$parsedStyle$pat.totalLength,
|
|
22270
22306
|
absolutePath = _this$parsedStyle$pat.absolutePath;
|
|
22271
22307
|
|
|
@@ -22273,7 +22309,9 @@
|
|
|
22273
22309
|
x = _getPointAtLength.x,
|
|
22274
22310
|
y = _getPointAtLength.y;
|
|
22275
22311
|
|
|
22276
|
-
|
|
22312
|
+
var transformed = transformMat4(create$2(), fromValues$1(x - defX, y - defY, 0), this.getLocalTransform()); // apply local transformation
|
|
22313
|
+
|
|
22314
|
+
return new Point(transformed[0], transformed[1]);
|
|
22277
22315
|
}
|
|
22278
22316
|
/**
|
|
22279
22317
|
* Get start tangent vector
|
|
@@ -22378,7 +22416,10 @@
|
|
|
22378
22416
|
};
|
|
22379
22417
|
|
|
22380
22418
|
_proto.getPoint = function getPoint(ratio) {
|
|
22381
|
-
var _this$parsedStyle
|
|
22419
|
+
var _this$parsedStyle = this.parsedStyle,
|
|
22420
|
+
defX = _this$parsedStyle.defX,
|
|
22421
|
+
defY = _this$parsedStyle.defY,
|
|
22422
|
+
_this$parsedStyle$poi = _this$parsedStyle.points,
|
|
22382
22423
|
points = _this$parsedStyle$poi.points,
|
|
22383
22424
|
segments = _this$parsedStyle$poi.segments;
|
|
22384
22425
|
var subt = 0;
|
|
@@ -22394,7 +22435,9 @@
|
|
|
22394
22435
|
x = _LineUtil$pointAt.x,
|
|
22395
22436
|
y = _LineUtil$pointAt.y;
|
|
22396
22437
|
|
|
22397
|
-
|
|
22438
|
+
var transformed = transformMat4(create$2(), fromValues$1(x - defX, y - defY, 0), this.getLocalTransform()); // apply local transformation
|
|
22439
|
+
|
|
22440
|
+
return new Point(transformed[0], transformed[1]);
|
|
22398
22441
|
};
|
|
22399
22442
|
|
|
22400
22443
|
_proto.getStartTangent = function getStartTangent() {
|
|
@@ -24051,7 +24094,7 @@
|
|
|
24051
24094
|
if (query.startsWith('.')) {
|
|
24052
24095
|
return root.find(function (node) {
|
|
24053
24096
|
// return !node.shadow && node.id === query.substring(1);
|
|
24054
|
-
return node
|
|
24097
|
+
return ((node === null || node === void 0 ? void 0 : node.classList) || []).indexOf(_this.getIdOrClassname(query)) > -1;
|
|
24055
24098
|
});
|
|
24056
24099
|
} else if (query.startsWith('#')) {
|
|
24057
24100
|
// getElementById('id')
|
|
@@ -24088,7 +24131,7 @@
|
|
|
24088
24131
|
// getElementsByClassName('className');
|
|
24089
24132
|
// should not include itself
|
|
24090
24133
|
return root.findAll(function (node) {
|
|
24091
|
-
return root !== node && node
|
|
24134
|
+
return root !== node && ((node === null || node === void 0 ? void 0 : node.classList) || []).indexOf(_this2.getIdOrClassname(query)) > -1;
|
|
24092
24135
|
});
|
|
24093
24136
|
} else if (query.startsWith('#')) {
|
|
24094
24137
|
return root.findAll(function (node) {
|
|
@@ -24194,29 +24237,6 @@
|
|
|
24194
24237
|
|
|
24195
24238
|
return zIndex1 - zIndex2;
|
|
24196
24239
|
}
|
|
24197
|
-
function dirtifyToRoot(element, affectChildren) {
|
|
24198
|
-
if (affectChildren === void 0) {
|
|
24199
|
-
affectChildren = false;
|
|
24200
|
-
}
|
|
24201
|
-
|
|
24202
|
-
var p = element;
|
|
24203
|
-
|
|
24204
|
-
while (p) {
|
|
24205
|
-
var renderable = p.renderable;
|
|
24206
|
-
|
|
24207
|
-
if (renderable) {
|
|
24208
|
-
renderable.renderBoundsDirty = true;
|
|
24209
|
-
renderable.boundsDirty = true;
|
|
24210
|
-
renderable.dirty = true;
|
|
24211
|
-
}
|
|
24212
|
-
|
|
24213
|
-
p = p.parentNode;
|
|
24214
|
-
}
|
|
24215
|
-
|
|
24216
|
-
element.dispatchEvent(new CustomEvent(exports.ElementEvent.BOUNDS_CHANGED, {
|
|
24217
|
-
affectChildren: affectChildren
|
|
24218
|
-
}));
|
|
24219
|
-
}
|
|
24220
24240
|
var SceneGraphService = exports.Syringe.defineToken('SceneGraphService');
|
|
24221
24241
|
/**
|
|
24222
24242
|
* update transform in scene graph
|
|
@@ -24229,6 +24249,8 @@
|
|
|
24229
24249
|
var _this = this;
|
|
24230
24250
|
|
|
24231
24251
|
this.sceneGraphSelectorFactory = void 0;
|
|
24252
|
+
this.pendingEvents = [];
|
|
24253
|
+
this.boundsChangedEvent = new CustomEvent(exports.ElementEvent.BOUNDS_CHANGED);
|
|
24232
24254
|
|
|
24233
24255
|
this.rotate = function () {
|
|
24234
24256
|
var parentInvertRotation = create$4();
|
|
@@ -24662,7 +24684,63 @@
|
|
|
24662
24684
|
}
|
|
24663
24685
|
|
|
24664
24686
|
this.dirtifyWorldInternal(element, transform);
|
|
24665
|
-
dirtifyToRoot(element, true);
|
|
24687
|
+
this.dirtifyToRoot(element, true);
|
|
24688
|
+
};
|
|
24689
|
+
|
|
24690
|
+
_proto.triggerPendingEvents = function triggerPendingEvents() {
|
|
24691
|
+
var _this2 = this;
|
|
24692
|
+
|
|
24693
|
+
var set = new Set();
|
|
24694
|
+
|
|
24695
|
+
var trigger = function trigger(element, detail) {
|
|
24696
|
+
if (!set.has(element.entity)) {
|
|
24697
|
+
_this2.boundsChangedEvent.detail = detail;
|
|
24698
|
+
element.dispatchEvent(_this2.boundsChangedEvent);
|
|
24699
|
+
set.add(element.entity);
|
|
24700
|
+
}
|
|
24701
|
+
};
|
|
24702
|
+
|
|
24703
|
+
this.pendingEvents.forEach(function (_ref) {
|
|
24704
|
+
var element = _ref[0],
|
|
24705
|
+
detail = _ref[1];
|
|
24706
|
+
|
|
24707
|
+
if (detail.affectChildren) {
|
|
24708
|
+
element.forEach(function (e) {
|
|
24709
|
+
trigger(e, detail);
|
|
24710
|
+
});
|
|
24711
|
+
} else {
|
|
24712
|
+
trigger(element, detail);
|
|
24713
|
+
}
|
|
24714
|
+
});
|
|
24715
|
+
this.pendingEvents = [];
|
|
24716
|
+
};
|
|
24717
|
+
|
|
24718
|
+
_proto.dirtifyToRoot = function dirtifyToRoot(element, affectChildren) {
|
|
24719
|
+
if (affectChildren === void 0) {
|
|
24720
|
+
affectChildren = false;
|
|
24721
|
+
}
|
|
24722
|
+
|
|
24723
|
+
var p = element; // only need to re-render itself
|
|
24724
|
+
|
|
24725
|
+
if (p.renderable) {
|
|
24726
|
+
p.renderable.dirty = true;
|
|
24727
|
+
}
|
|
24728
|
+
|
|
24729
|
+
while (p) {
|
|
24730
|
+
var renderable = p.renderable;
|
|
24731
|
+
|
|
24732
|
+
if (renderable) {
|
|
24733
|
+
renderable.renderBoundsDirty = true;
|
|
24734
|
+
renderable.boundsDirty = true;
|
|
24735
|
+
}
|
|
24736
|
+
|
|
24737
|
+
p = p.parentNode;
|
|
24738
|
+
} // reuse the same custom event
|
|
24739
|
+
|
|
24740
|
+
|
|
24741
|
+
this.pendingEvents.push([element, {
|
|
24742
|
+
affectChildren: affectChildren
|
|
24743
|
+
}]);
|
|
24666
24744
|
};
|
|
24667
24745
|
|
|
24668
24746
|
_proto.getPosition = function getPosition(element) {
|
|
@@ -24798,7 +24876,7 @@
|
|
|
24798
24876
|
;
|
|
24799
24877
|
|
|
24800
24878
|
_proto.getBounds = function getBounds(element, render) {
|
|
24801
|
-
var
|
|
24879
|
+
var _this3 = this;
|
|
24802
24880
|
|
|
24803
24881
|
if (render === void 0) {
|
|
24804
24882
|
render = false;
|
|
@@ -24819,7 +24897,7 @@
|
|
|
24819
24897
|
|
|
24820
24898
|
var children = element.childNodes;
|
|
24821
24899
|
children.forEach(function (child) {
|
|
24822
|
-
var childBounds =
|
|
24900
|
+
var childBounds = _this3.getBounds(child, render);
|
|
24823
24901
|
|
|
24824
24902
|
if (childBounds) {
|
|
24825
24903
|
if (!aabb) {
|
|
@@ -24831,7 +24909,7 @@
|
|
|
24831
24909
|
}
|
|
24832
24910
|
}); // account for clip path
|
|
24833
24911
|
|
|
24834
|
-
var clipPath = element.
|
|
24912
|
+
var clipPath = element.parsedStyle.clipPath;
|
|
24835
24913
|
|
|
24836
24914
|
if (clipPath) {
|
|
24837
24915
|
var clipPathBounds = this.getTransformedGeometryBounds(clipPath, true);
|
|
@@ -24922,7 +25000,7 @@
|
|
|
24922
25000
|
};
|
|
24923
25001
|
|
|
24924
25002
|
_proto.dirtifyWorldInternal = function dirtifyWorldInternal(element, transform) {
|
|
24925
|
-
var
|
|
25003
|
+
var _this4 = this;
|
|
24926
25004
|
|
|
24927
25005
|
if (!transform.dirtyFlag) {
|
|
24928
25006
|
transform.dirtyFlag = true;
|
|
@@ -24931,7 +25009,7 @@
|
|
|
24931
25009
|
var childTransform = child.transformable;
|
|
24932
25010
|
|
|
24933
25011
|
if (!childTransform.dirtyFlag) {
|
|
24934
|
-
|
|
25012
|
+
_this4.dirtifyWorldInternal(child, childTransform);
|
|
24935
25013
|
}
|
|
24936
25014
|
});
|
|
24937
25015
|
var renderable = element.renderable;
|
|
@@ -24941,8 +25019,6 @@
|
|
|
24941
25019
|
renderable.boundsDirty = true;
|
|
24942
25020
|
renderable.dirty = true;
|
|
24943
25021
|
}
|
|
24944
|
-
|
|
24945
|
-
element.dispatchEvent(new MutationEvent(exports.ElementEvent.ATTR_MODIFIED, element, null, null, 'modelMatrix', MutationEvent.MODIFICATION, null, null));
|
|
24946
25022
|
}
|
|
24947
25023
|
};
|
|
24948
25024
|
|
|
@@ -26180,6 +26256,7 @@
|
|
|
26180
26256
|
exports.RenderingService = /*#__PURE__*/function () {
|
|
26181
26257
|
function RenderingService() {
|
|
26182
26258
|
this.renderingPluginProvider = void 0;
|
|
26259
|
+
this.canvasConfig = void 0;
|
|
26183
26260
|
this.renderingContext = void 0;
|
|
26184
26261
|
this.sceneGraphService = void 0;
|
|
26185
26262
|
this.styleValueRegistry = void 0;
|
|
@@ -26197,6 +26274,7 @@
|
|
|
26197
26274
|
rendered: 0
|
|
26198
26275
|
};
|
|
26199
26276
|
this.zIndexCounter = 0;
|
|
26277
|
+
this.renderOrderChangedEvent = new CustomEvent(exports.ElementEvent.RENDER_ORDER_CHANGED);
|
|
26200
26278
|
this.hooks = {
|
|
26201
26279
|
/**
|
|
26202
26280
|
* called before any frame rendered
|
|
@@ -26293,6 +26371,21 @@
|
|
|
26293
26371
|
|
|
26294
26372
|
_proto.getStats = function getStats() {
|
|
26295
26373
|
return this.stats;
|
|
26374
|
+
}
|
|
26375
|
+
/**
|
|
26376
|
+
* Meet the following conditions:
|
|
26377
|
+
* * disable DirtyRectangleRendering
|
|
26378
|
+
* * camera changed
|
|
26379
|
+
*/
|
|
26380
|
+
;
|
|
26381
|
+
|
|
26382
|
+
_proto.disableDirtyRectangleRendering = function disableDirtyRectangleRendering() {
|
|
26383
|
+
var renderer = this.canvasConfig.renderer;
|
|
26384
|
+
|
|
26385
|
+
var _renderer$getConfig = renderer.getConfig(),
|
|
26386
|
+
enableDirtyRectangleRendering = _renderer$getConfig.enableDirtyRectangleRendering;
|
|
26387
|
+
|
|
26388
|
+
return !enableDirtyRectangleRendering || this.renderingContext.renderReasons.has(exports.RenderReason.CAMERA_CHANGED);
|
|
26296
26389
|
};
|
|
26297
26390
|
|
|
26298
26391
|
_proto.render = function render(canvasConfig) {
|
|
@@ -26302,6 +26395,7 @@
|
|
|
26302
26395
|
this.stats.rendered = 0;
|
|
26303
26396
|
this.zIndexCounter = 0;
|
|
26304
26397
|
this.sceneGraphService.syncHierarchy(this.renderingContext.root);
|
|
26398
|
+
this.sceneGraphService.triggerPendingEvents();
|
|
26305
26399
|
|
|
26306
26400
|
if (this.renderingContext.renderReasons.size && this.inited) {
|
|
26307
26401
|
this.renderDisplayObject(this.renderingContext.root, canvasConfig);
|
|
@@ -26367,9 +26461,10 @@
|
|
|
26367
26461
|
|
|
26368
26462
|
if (renderOrderChanged) {
|
|
26369
26463
|
displayObject.forEach(function (child) {
|
|
26370
|
-
|
|
26464
|
+
_this3.renderOrderChangedEvent.detail = {
|
|
26371
26465
|
renderOrder: child.sortable.renderOrder
|
|
26372
|
-
}
|
|
26466
|
+
};
|
|
26467
|
+
child.dispatchEvent(_this3.renderOrderChangedEvent);
|
|
26373
26468
|
});
|
|
26374
26469
|
}
|
|
26375
26470
|
};
|
|
@@ -26389,6 +26484,8 @@
|
|
|
26389
26484
|
|
|
26390
26485
|
__decorate([contrib(RenderingPluginContribution), __metadata("design:type", Object)], exports.RenderingService.prototype, "renderingPluginProvider", void 0);
|
|
26391
26486
|
|
|
26487
|
+
__decorate([inject(CanvasConfig), __metadata("design:type", Object)], exports.RenderingService.prototype, "canvasConfig", void 0);
|
|
26488
|
+
|
|
26392
26489
|
__decorate([inject(RenderingContext), __metadata("design:type", Object)], exports.RenderingService.prototype, "renderingContext", void 0);
|
|
26393
26490
|
|
|
26394
26491
|
__decorate([inject(SceneGraphService), __metadata("design:type", Object)], exports.RenderingService.prototype, "sceneGraphService", void 0);
|
|
@@ -28382,7 +28479,9 @@
|
|
|
28382
28479
|
*/
|
|
28383
28480
|
|
|
28384
28481
|
exports.CSSPropertyClipPath = /*#__PURE__*/function () {
|
|
28385
|
-
function CSSPropertyClipPath() {
|
|
28482
|
+
function CSSPropertyClipPath() {
|
|
28483
|
+
this.sceneGraphService = void 0;
|
|
28484
|
+
}
|
|
28386
28485
|
|
|
28387
28486
|
var _proto = CSSPropertyClipPath.prototype;
|
|
28388
28487
|
|
|
@@ -28406,13 +28505,15 @@
|
|
|
28406
28505
|
newClipPath.parsedStyle.clipPathTargets.push(object);
|
|
28407
28506
|
}
|
|
28408
28507
|
|
|
28409
|
-
dirtifyToRoot(object);
|
|
28508
|
+
this.sceneGraphService.dirtifyToRoot(object);
|
|
28410
28509
|
return newClipPath;
|
|
28411
28510
|
};
|
|
28412
28511
|
|
|
28413
28512
|
return CSSPropertyClipPath;
|
|
28414
28513
|
}();
|
|
28415
28514
|
|
|
28515
|
+
__decorate([inject(SceneGraphService), __metadata("design:type", Object)], exports.CSSPropertyClipPath.prototype, "sceneGraphService", void 0);
|
|
28516
|
+
|
|
28416
28517
|
exports.CSSPropertyClipPath = __decorate([singleton({
|
|
28417
28518
|
token: {
|
|
28418
28519
|
token: CSSProperty,
|
|
@@ -28450,9 +28551,24 @@
|
|
|
28450
28551
|
}]
|
|
28451
28552
|
})], exports.CSSPropertyColor);
|
|
28452
28553
|
|
|
28453
|
-
exports.CSSPropertyFilter = function
|
|
28454
|
-
|
|
28455
|
-
|
|
28554
|
+
exports.CSSPropertyFilter = /*#__PURE__*/function () {
|
|
28555
|
+
function CSSPropertyFilter() {
|
|
28556
|
+
this.parser = parseFilter;
|
|
28557
|
+
}
|
|
28558
|
+
|
|
28559
|
+
var _proto = CSSPropertyFilter.prototype;
|
|
28560
|
+
|
|
28561
|
+
_proto.calculator = function calculator(name, oldParsed, parsed) {
|
|
28562
|
+
// unset or none
|
|
28563
|
+
if (parsed instanceof CSSKeywordValue) {
|
|
28564
|
+
return [];
|
|
28565
|
+
}
|
|
28566
|
+
|
|
28567
|
+
return parsed;
|
|
28568
|
+
};
|
|
28569
|
+
|
|
28570
|
+
return CSSPropertyFilter;
|
|
28571
|
+
}();
|
|
28456
28572
|
|
|
28457
28573
|
exports.CSSPropertyFilter = __decorate([singleton({
|
|
28458
28574
|
token: {
|
|
@@ -28492,21 +28608,6 @@
|
|
|
28492
28608
|
_proto.calculator = function calculator(name, oldParsed, computed, object, registry) {
|
|
28493
28609
|
if (CSSUnitValue.isRelativeUnit(computed.unit)) {
|
|
28494
28610
|
if (computed.unit === exports.UnitType.kPercentage) {
|
|
28495
|
-
// try to resolve according to parent's geometry bounds
|
|
28496
|
-
// if (object.parentElement) {
|
|
28497
|
-
// // registry.registerParentGeometryBoundsChangedHandler(object, name);
|
|
28498
|
-
// return this.calculateUsedValueWithParentBounds(object, name);
|
|
28499
|
-
// } else {
|
|
28500
|
-
// registry.addUnresolveProperty(object, name);
|
|
28501
|
-
// // defer calculation after mounted
|
|
28502
|
-
// // object.addEventListener(
|
|
28503
|
-
// // ElementEvent.MOUNTED,
|
|
28504
|
-
// // () => {
|
|
28505
|
-
// // registry.registerParentGeometryBoundsChangedHandler(object, name);
|
|
28506
|
-
// // },
|
|
28507
|
-
// // { once: true },
|
|
28508
|
-
// // );
|
|
28509
|
-
// }
|
|
28510
28611
|
return new CSSUnitValue(0, 'px');
|
|
28511
28612
|
} else if (computed.unit === exports.UnitType.kEms) {
|
|
28512
28613
|
if (object.parentNode) {
|
|
@@ -28540,10 +28641,13 @@
|
|
|
28540
28641
|
}();
|
|
28541
28642
|
|
|
28542
28643
|
exports.CSSPropertyLengthOrPercentage = __decorate([singleton({
|
|
28543
|
-
token: {
|
|
28644
|
+
token: [{
|
|
28544
28645
|
token: CSSProperty,
|
|
28545
28646
|
named: exports.PropertySyntax.LENGTH_PERCENTAGE
|
|
28546
|
-
}
|
|
28647
|
+
}, {
|
|
28648
|
+
token: CSSProperty,
|
|
28649
|
+
named: exports.PropertySyntax.LENGTH
|
|
28650
|
+
}]
|
|
28547
28651
|
})], exports.CSSPropertyLengthOrPercentage);
|
|
28548
28652
|
|
|
28549
28653
|
/**
|
|
@@ -28712,6 +28816,18 @@
|
|
|
28712
28816
|
}
|
|
28713
28817
|
})], exports.CSSPropertyLocalPosition);
|
|
28714
28818
|
|
|
28819
|
+
exports.CSSPropertyNumber = function CSSPropertyNumber() {
|
|
28820
|
+
this.mixer = mergeNumbers;
|
|
28821
|
+
this.parser = parseNumber;
|
|
28822
|
+
};
|
|
28823
|
+
|
|
28824
|
+
exports.CSSPropertyNumber = __decorate([singleton({
|
|
28825
|
+
token: {
|
|
28826
|
+
token: CSSProperty,
|
|
28827
|
+
named: exports.PropertySyntax.NUMBER
|
|
28828
|
+
}
|
|
28829
|
+
})], exports.CSSPropertyNumber);
|
|
28830
|
+
|
|
28715
28831
|
exports.CSSPropertyOffsetDistance = /*#__PURE__*/function () {
|
|
28716
28832
|
function CSSPropertyOffsetDistance() {
|
|
28717
28833
|
this.parser = parseNumber;
|
|
@@ -29242,16 +29358,19 @@
|
|
|
29242
29358
|
name: 'shadowOffsetX',
|
|
29243
29359
|
interpolable: true,
|
|
29244
29360
|
layoutDependent: true,
|
|
29361
|
+
defaultValue: '0',
|
|
29245
29362
|
syntax: exports.PropertySyntax.LENGTH_PERCENTAGE
|
|
29246
29363
|
}, {
|
|
29247
29364
|
name: 'shadowOffsetY',
|
|
29248
29365
|
interpolable: true,
|
|
29249
29366
|
layoutDependent: true,
|
|
29367
|
+
defaultValue: '0',
|
|
29250
29368
|
syntax: exports.PropertySyntax.LENGTH_PERCENTAGE
|
|
29251
29369
|
}, {
|
|
29252
29370
|
name: 'shadowBlur',
|
|
29253
29371
|
interpolable: true,
|
|
29254
29372
|
layoutDependent: true,
|
|
29373
|
+
defaultValue: '0',
|
|
29255
29374
|
syntax: exports.PropertySyntax.SHADOW_BLUR
|
|
29256
29375
|
}, {
|
|
29257
29376
|
/**
|
|
@@ -29345,6 +29464,8 @@
|
|
|
29345
29464
|
name: 'filter',
|
|
29346
29465
|
independent: true,
|
|
29347
29466
|
layoutDependent: true,
|
|
29467
|
+
keywords: ['none'],
|
|
29468
|
+
defaultValue: 'none',
|
|
29348
29469
|
syntax: exports.PropertySyntax.FILTER
|
|
29349
29470
|
}, {
|
|
29350
29471
|
name: 'clipPath',
|
|
@@ -29598,6 +29719,7 @@
|
|
|
29598
29719
|
this.cache = {};
|
|
29599
29720
|
this.unresolvedProperties = {};
|
|
29600
29721
|
this.propertySyntaxFactory = void 0;
|
|
29722
|
+
this.sceneGraphService = void 0;
|
|
29601
29723
|
this.cascadeProperties = {};
|
|
29602
29724
|
}
|
|
29603
29725
|
|
|
@@ -30043,9 +30165,8 @@
|
|
|
30043
30165
|
var usedOriginYValue = (flipX ? -1 : 1) * convertPercentUnit(transformOrigin[1], 1, object);
|
|
30044
30166
|
usedOriginXValue = usedOriginXValue - (flipY ? -1 : 1) * (anchor && anchor[0].value || 0) * geometry.contentBounds.halfExtents[0] * 2;
|
|
30045
30167
|
usedOriginYValue = usedOriginYValue - (flipX ? -1 : 1) * (anchor && anchor[1].value || 0) * geometry.contentBounds.halfExtents[1] * 2;
|
|
30046
|
-
object.setOrigin(usedOriginXValue, usedOriginYValue);
|
|
30047
|
-
|
|
30048
|
-
dirtifyToRoot(object);
|
|
30168
|
+
object.setOrigin(usedOriginXValue, usedOriginYValue);
|
|
30169
|
+
this.sceneGraphService.dirtifyToRoot(object);
|
|
30049
30170
|
}
|
|
30050
30171
|
};
|
|
30051
30172
|
|
|
@@ -30064,6 +30185,8 @@
|
|
|
30064
30185
|
|
|
30065
30186
|
__decorate([inject(CSSPropertySyntaxFactory), __metadata("design:type", Function)], exports.DefaultStyleValueRegistry.prototype, "propertySyntaxFactory", void 0);
|
|
30066
30187
|
|
|
30188
|
+
__decorate([inject(SceneGraphService), __metadata("design:type", Object)], exports.DefaultStyleValueRegistry.prototype, "sceneGraphService", void 0);
|
|
30189
|
+
|
|
30067
30190
|
__decorate([inversify.postConstruct(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0)], exports.DefaultStyleValueRegistry.prototype, "init", null);
|
|
30068
30191
|
|
|
30069
30192
|
exports.DefaultStyleValueRegistry = __decorate([singleton({
|
|
@@ -30113,6 +30236,7 @@
|
|
|
30113
30236
|
}
|
|
30114
30237
|
}); // bind CSS property handlers
|
|
30115
30238
|
|
|
30239
|
+
register(exports.CSSPropertyNumber);
|
|
30116
30240
|
register(exports.CSSPropertyAngle);
|
|
30117
30241
|
register(exports.CSSPropertyClipPath);
|
|
30118
30242
|
register(exports.CSSPropertyColor);
|
|
@@ -30378,22 +30502,15 @@
|
|
|
30378
30502
|
*/
|
|
30379
30503
|
|
|
30380
30504
|
var DirtyCheckPlugin = DirtyCheckPlugin_1 = (_class$2 = /*#__PURE__*/function () {
|
|
30381
|
-
function DirtyCheckPlugin() {
|
|
30382
|
-
this.renderingContext = void 0;
|
|
30383
|
-
}
|
|
30505
|
+
function DirtyCheckPlugin() {}
|
|
30384
30506
|
|
|
30385
30507
|
var _proto = DirtyCheckPlugin.prototype;
|
|
30386
30508
|
|
|
30387
30509
|
_proto.apply = function apply(renderingService) {
|
|
30388
|
-
var _this = this;
|
|
30389
|
-
|
|
30390
30510
|
renderingService.hooks.dirtycheck.tap(DirtyCheckPlugin_1.tag, function (object) {
|
|
30391
30511
|
if (object) {
|
|
30392
30512
|
var renderable = object.renderable;
|
|
30393
|
-
|
|
30394
|
-
var isCameraDirty = _this.renderingContext.renderReasons.has(exports.RenderReason.CAMERA_CHANGED);
|
|
30395
|
-
|
|
30396
|
-
var isDirty = renderable.dirty || isCameraDirty;
|
|
30513
|
+
var isDirty = renderable.dirty || renderingService.disableDirtyRectangleRendering();
|
|
30397
30514
|
|
|
30398
30515
|
if (isDirty) {
|
|
30399
30516
|
return object;
|
|
@@ -30408,9 +30525,6 @@
|
|
|
30408
30525
|
|
|
30409
30526
|
return DirtyCheckPlugin;
|
|
30410
30527
|
}(), _class$2.tag = 'DirtyCheck', _class$2);
|
|
30411
|
-
|
|
30412
|
-
__decorate([inject(RenderingContext), __metadata("design:type", Object)], DirtyCheckPlugin.prototype, "renderingContext", void 0);
|
|
30413
|
-
|
|
30414
30528
|
DirtyCheckPlugin = DirtyCheckPlugin_1 = __decorate([singleton({
|
|
30415
30529
|
contrib: RenderingPluginContribution
|
|
30416
30530
|
})], DirtyCheckPlugin);
|
|
@@ -30835,6 +30949,7 @@
|
|
|
30835
30949
|
function PrepareRendererPlugin() {
|
|
30836
30950
|
this.renderingContext = void 0;
|
|
30837
30951
|
this.styleValueRegistry = void 0;
|
|
30952
|
+
this.sceneGraphService = void 0;
|
|
30838
30953
|
this.rBush = void 0;
|
|
30839
30954
|
this.toSync = new Set();
|
|
30840
30955
|
}
|
|
@@ -30881,7 +30996,8 @@
|
|
|
30881
30996
|
|
|
30882
30997
|
_this2.styleValueRegistry.recalc(object);
|
|
30883
30998
|
|
|
30884
|
-
dirtifyToRoot(object);
|
|
30999
|
+
_this2.sceneGraphService.dirtifyToRoot(object);
|
|
31000
|
+
|
|
30885
31001
|
renderingService.dirtify();
|
|
30886
31002
|
};
|
|
30887
31003
|
|
|
@@ -30895,7 +31011,8 @@
|
|
|
30895
31011
|
_this2.toSync.delete(object);
|
|
30896
31012
|
}
|
|
30897
31013
|
|
|
30898
|
-
dirtifyToRoot(e.target);
|
|
31014
|
+
_this2.sceneGraphService.dirtifyToRoot(e.target);
|
|
31015
|
+
|
|
30899
31016
|
renderingService.dirtify();
|
|
30900
31017
|
};
|
|
30901
31018
|
|
|
@@ -30985,6 +31102,8 @@
|
|
|
30985
31102
|
|
|
30986
31103
|
__decorate([inject(StyleValueRegistry), __metadata("design:type", Object)], PrepareRendererPlugin.prototype, "styleValueRegistry", void 0);
|
|
30987
31104
|
|
|
31105
|
+
__decorate([inject(SceneGraphService), __metadata("design:type", Object)], PrepareRendererPlugin.prototype, "sceneGraphService", void 0);
|
|
31106
|
+
|
|
30988
31107
|
__decorate([inject(RBushRoot), __metadata("design:type", RBush)], PrepareRendererPlugin.prototype, "rBush", void 0);
|
|
30989
31108
|
|
|
30990
31109
|
PrepareRendererPlugin = PrepareRendererPlugin_1 = __decorate([singleton({
|
|
@@ -31606,7 +31725,7 @@
|
|
|
31606
31725
|
}
|
|
31607
31726
|
});
|
|
31608
31727
|
} else {
|
|
31609
|
-
console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.", 'appended child: ', parent);
|
|
31728
|
+
console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.", 'appended child: ', parent.nodeName);
|
|
31610
31729
|
}
|
|
31611
31730
|
};
|
|
31612
31731
|
|
|
@@ -31816,7 +31935,6 @@
|
|
|
31816
31935
|
exports.decorate = inversify.decorate;
|
|
31817
31936
|
exports.deg2rad = deg2rad;
|
|
31818
31937
|
exports.deg2turn = deg2turn;
|
|
31819
|
-
exports.dirtifyToRoot = dirtifyToRoot;
|
|
31820
31938
|
exports.equalSet = equalSet;
|
|
31821
31939
|
exports.extractPolygons = extractPolygons;
|
|
31822
31940
|
exports.formatAttribute = formatAttribute;
|