@visactor/vrender 0.17.19-alpha.1 → 0.17.20-alpha.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/index.js CHANGED
@@ -2149,15 +2149,15 @@
2149
2149
  };
2150
2150
  var isArray$1 = isArray;
2151
2151
 
2152
- var isNumber$1 = function isNumber(value) {
2152
+ var isNumber = function isNumber(value) {
2153
2153
  var fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
2154
2154
  var type = _typeof(value);
2155
2155
  return fuzzy ? "number" === type : "number" === type || isType$1(value, "Number");
2156
2156
  };
2157
- var isNumber$2 = isNumber$1;
2157
+ var isNumber$1 = isNumber;
2158
2158
 
2159
2159
  var isValidNumber = function isValidNumber(value) {
2160
- return isNumber$2(value) && Number.isFinite(value);
2160
+ return isNumber$1(value) && Number.isFinite(value);
2161
2161
  };
2162
2162
  var isValidNumber$1 = isValidNumber;
2163
2163
 
@@ -2264,12 +2264,12 @@
2264
2264
  }, {
2265
2265
  key: "add",
2266
2266
  value: function add(point) {
2267
- return isNumber$2(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
2267
+ return isNumber$1(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
2268
2268
  }
2269
2269
  }, {
2270
2270
  key: "sub",
2271
2271
  value: function sub(point) {
2272
- return isNumber$2(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
2272
+ return isNumber$1(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
2273
2273
  }
2274
2274
  }, {
2275
2275
  key: "multi",
@@ -2973,10 +2973,10 @@
2973
2973
  return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
2974
2974
  }
2975
2975
  function rgb(value) {
2976
- return isNumber$2(value) ? new RGB(value >> 16, value >> 8 & 255, 255 & value, 1) : isArray$1(value) ? new RGB(value[0], value[1], value[2]) : new RGB(255, 255, 255);
2976
+ return isNumber$1(value) ? new RGB(value >> 16, value >> 8 & 255, 255 & value, 1) : isArray$1(value) ? new RGB(value[0], value[1], value[2]) : new RGB(255, 255, 255);
2977
2977
  }
2978
2978
  function rgba(value) {
2979
- return isNumber$2(value) ? new RGB(value >>> 24, value >>> 16 & 255, value >>> 8 & 255, 255 & value) : isArray$1(value) ? new RGB(value[0], value[1], value[2], value[3]) : new RGB(255, 255, 255, 1);
2979
+ return isNumber$1(value) ? new RGB(value >>> 24, value >>> 16 & 255, value >>> 8 & 255, 255 & value) : isArray$1(value) ? new RGB(value[0], value[1], value[2], value[3]) : new RGB(255, 255, 255, 1);
2980
2980
  }
2981
2981
  function SRGBToLinear(c) {
2982
2982
  return c < .04045 ? .0773993808 * c : Math.pow(.9478672986 * c + .0521327014, 2.4);
@@ -3657,7 +3657,7 @@
3657
3657
  }], [{
3658
3658
  key: "getInstance",
3659
3659
  value: function getInstance(level, method) {
3660
- return Logger._instance && isNumber$2(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
3660
+ return Logger._instance && isNumber$1(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
3661
3661
  }
3662
3662
  }, {
3663
3663
  key: "setInstance",
@@ -5797,9 +5797,6 @@
5797
5797
  function isNotAroundZero(val) {
5798
5798
  return val > EPSILON || val < -EPSILON;
5799
5799
  }
5800
- function isNumber(data) {
5801
- return "number" == typeof data && Number.isFinite(data);
5802
- }
5803
5800
  var _v0 = [0, 0],
5804
5801
  _v1 = [0, 0],
5805
5802
  _v2 = [0, 0];
@@ -6977,10 +6974,7 @@
6977
6974
  value: function removeAllChild() {
6978
6975
  if (!this._idMap) return;
6979
6976
  var child = this._firstChild;
6980
- for (; child;) {
6981
- var next = child._next;
6982
- child.parent = null, child._prev = null, child._next = null, child = next;
6983
- }
6977
+ for (; child;) child.parent = null, child._prev = null, child._next = null, child = child._next;
6984
6978
  this._firstChild = null, this._lastChild = null, this._idMap.clear(), this._structEdit = !0, this.setCount(1 - this._count);
6985
6979
  }
6986
6980
  }, {
@@ -9246,7 +9240,7 @@
9246
9240
  key: "onBind",
9247
9241
  value: function onBind() {
9248
9242
  var _a, _b, _c, _d, _e, _f, _g, _h;
9249
- this.fromNumber = isNumber$2(null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) ? null === (_b = this.from) || void 0 === _b ? void 0 : _b.text : Number.parseFloat(null === (_c = this.from) || void 0 === _c ? void 0 : _c.text), this.toNumber = isNumber$2(null === (_d = this.to) || void 0 === _d ? void 0 : _d.text) ? null === (_e = this.to) || void 0 === _e ? void 0 : _e.text : Number.parseFloat(null === (_f = this.to) || void 0 === _f ? void 0 : _f.text), Number.isFinite(this.toNumber) || (this.fromNumber = 0), Number.isFinite(this.toNumber) || (this.valid = !1), !1 !== this.valid && (this.decimalLength = null !== (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.fixed) && void 0 !== _h ? _h : Math.max(getDecimalPlaces(this.fromNumber), getDecimalPlaces(this.toNumber)));
9243
+ this.fromNumber = isNumber$1(null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) ? null === (_b = this.from) || void 0 === _b ? void 0 : _b.text : Number.parseFloat(null === (_c = this.from) || void 0 === _c ? void 0 : _c.text), this.toNumber = isNumber$1(null === (_d = this.to) || void 0 === _d ? void 0 : _d.text) ? null === (_e = this.to) || void 0 === _e ? void 0 : _e.text : Number.parseFloat(null === (_f = this.to) || void 0 === _f ? void 0 : _f.text), Number.isFinite(this.toNumber) || (this.fromNumber = 0), Number.isFinite(this.toNumber) || (this.valid = !1), !1 !== this.valid && (this.decimalLength = null !== (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.fixed) && void 0 !== _h ? _h : Math.max(getDecimalPlaces(this.fromNumber), getDecimalPlaces(this.toNumber)));
9250
9244
  }
9251
9245
  }, {
9252
9246
  key: "onEnd",
@@ -10657,7 +10651,7 @@
10657
10651
  };
10658
10652
  var samplingPoints = function samplingPoints(points, count) {
10659
10653
  var validatePoints = points.filter(function (point) {
10660
- return !1 !== point.defined && isNumber$2(point.x) && isNumber$2(point.y);
10654
+ return !1 !== point.defined && isNumber$1(point.x) && isNumber$1(point.y);
10661
10655
  });
10662
10656
  if (0 === validatePoints.length) return [];
10663
10657
  if (1 === validatePoints.length) return new Array(count).fill(0).map(function (i) {
@@ -10697,7 +10691,7 @@
10697
10691
  return res.concat(null !== (_a = seg.points) && void 0 !== _a ? _a : []);
10698
10692
  }, []));
10699
10693
  var validatePoints = points.filter(function (point) {
10700
- return !1 !== point.defined && isNumber$2(point.x) && isNumber$2(point.y);
10694
+ return !1 !== point.defined && isNumber$1(point.x) && isNumber$1(point.y);
10701
10695
  });
10702
10696
  if (!validatePoints.length) return [];
10703
10697
  var allPoints = [];
@@ -11364,7 +11358,15 @@
11364
11358
  var data = ResourceLoader.cache.get(url);
11365
11359
  data ? "fail" === data.loadState ? application.global.getRequestAnimationFrame()(function () {
11366
11360
  mark.imageLoadFail(url);
11367
- }) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : ResourceLoader.loadImage(url, mark);
11361
+ }) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : (data = {
11362
+ type: "image",
11363
+ loadState: "init"
11364
+ }, ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise ? (data.waitingMark = [mark], data.dataPromise.then(function (res) {
11365
+ var _a;
11366
+ data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map(function (mark, index) {
11367
+ (null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
11368
+ });
11369
+ })) : (data.loadState = "fail", mark.imageLoadFail(url)));
11368
11370
  }
11369
11371
  }, {
11370
11372
  key: "GetSvg",
@@ -11398,68 +11400,10 @@
11398
11400
  return data.data;
11399
11401
  }));
11400
11402
  }
11401
- }, {
11402
- key: "loading",
11403
- value: function loading() {
11404
- setTimeout(function () {
11405
- if (!ResourceLoader.isLoading && ResourceLoader.toLoadAueue.length) {
11406
- ResourceLoader.isLoading = !0;
11407
- var tasks = ResourceLoader.toLoadAueue.splice(0, 10),
11408
- promises = [];
11409
- tasks.forEach(function (task) {
11410
- var url = task.url,
11411
- marks = task.marks,
11412
- data = {
11413
- type: "image",
11414
- loadState: "init"
11415
- };
11416
- if (ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise) {
11417
- data.waitingMark = marks;
11418
- var end = data.dataPromise.then(function (res) {
11419
- var _a;
11420
- data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map(function (mark, index) {
11421
- (null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
11422
- });
11423
- });
11424
- promises.push(end);
11425
- } else data.loadState = "fail", marks.forEach(function (mark) {
11426
- return mark.imageLoadFail(url);
11427
- });
11428
- }), Promise.all(promises).then(function () {
11429
- ResourceLoader.isLoading = !1, ResourceLoader.loading();
11430
- })["catch"](function (error) {
11431
- console.error(error), ResourceLoader.isLoading = !1, ResourceLoader.loading();
11432
- });
11433
- }
11434
- }, 0);
11435
- }
11436
- }, {
11437
- key: "loadImage",
11438
- value: function loadImage(url, mark) {
11439
- var index = getIndex(url, ResourceLoader.toLoadAueue);
11440
- if (-1 !== index) return ResourceLoader.toLoadAueue[index].marks.push(mark), void ResourceLoader.loading();
11441
- ResourceLoader.toLoadAueue.push({
11442
- url: url,
11443
- marks: [mark]
11444
- }), ResourceLoader.loading();
11445
- }
11446
- }, {
11447
- key: "improveImageLoading",
11448
- value: function improveImageLoading(url) {
11449
- var index = getIndex(url, ResourceLoader.toLoadAueue);
11450
- if (-1 !== index) {
11451
- var elememt = ResourceLoader.toLoadAueue.splice(index, 1);
11452
- ResourceLoader.toLoadAueue.unshift(elememt[0]);
11453
- }
11454
- }
11455
11403
  }]);
11456
11404
  return ResourceLoader;
11457
11405
  }();
11458
- function getIndex(url, arr) {
11459
- for (var i = 0; i < arr.length; i++) if (arr[i].url === url) return i;
11460
- return -1;
11461
- }
11462
- ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [];
11406
+ ResourceLoader.cache = new Map();
11463
11407
 
11464
11408
  var tempMatrix = new Matrix(),
11465
11409
  tempBounds$1 = new AABBBounds();
@@ -11577,7 +11521,7 @@
11577
11521
  if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
11578
11522
  application.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
11579
11523
  var bounds = this.doUpdateAABBBounds(full);
11580
- return this.addUpdateLayoutTag(), application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0), bounds;
11524
+ return application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0), bounds;
11581
11525
  }
11582
11526
  }, {
11583
11527
  key: "combindShadowAABBBounds",
@@ -12245,7 +12189,7 @@
12245
12189
  data: "init",
12246
12190
  state: null
12247
12191
  };
12248
- this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : isObject$1(image) ? (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background) : cache.state = "fail";
12192
+ this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background);
12249
12193
  }
12250
12194
  }, {
12251
12195
  key: "imageLoadSuccess",
@@ -14563,7 +14507,7 @@
14563
14507
  _createClass(BaseSymbol, [{
14564
14508
  key: "bounds",
14565
14509
  value: function bounds(size, _bounds) {
14566
- if (isNumber$2(size)) {
14510
+ if (isNumber$1(size)) {
14567
14511
  var halfS = size / 2;
14568
14512
  _bounds.x1 = -halfS, _bounds.x2 = halfS, _bounds.y1 = -halfS, _bounds.y2 = halfS;
14569
14513
  } else _bounds.x1 = -size[0] / 2, _bounds.x2 = size[0] / 2, _bounds.y1 = -size[1] / 2, _bounds.y2 = size[1] / 2;
@@ -15250,12 +15194,12 @@
15250
15194
  _createClass(RectSymbol, [{
15251
15195
  key: "draw",
15252
15196
  value: function draw(ctx, size, x, y) {
15253
- return isNumber$2(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
15197
+ return isNumber$1(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
15254
15198
  }
15255
15199
  }, {
15256
15200
  key: "drawOffset",
15257
15201
  value: function drawOffset(ctx, size, x, y, offset) {
15258
- return isNumber$2(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
15202
+ return isNumber$1(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
15259
15203
  }
15260
15204
  }]);
15261
15205
  return RectSymbol;
@@ -15894,16 +15838,7 @@
15894
15838
  deltaY = -height;
15895
15839
  }
15896
15840
  var deltaX = 0;
15897
- switch (this.globalAlign) {
15898
- case "left":
15899
- deltaX = 0;
15900
- break;
15901
- case "center":
15902
- deltaX = -width / 2;
15903
- break;
15904
- case "right":
15905
- deltaX = -width;
15906
- }
15841
+ "right" === this.globalAlign || "end" === this.globalAlign ? deltaX = -width : "center" === this.globalAlign && (deltaX = -width / 2);
15907
15842
  var frameHeight = this[this.directionKey.height];
15908
15843
  this.singleLine && (frameHeight = this.lines[0].height + 1);
15909
15844
  var lastLineTag = !1;
@@ -16056,9 +15991,9 @@
16056
15991
  var direction = this.direction;
16057
15992
  if (this.verticalEllipsis) text = "...", direction = "vertical", baseline -= this.ellipsisWidth / 2;else {
16058
15993
  if ("hide" === this.ellipsis) return;
16059
- if ("add" === this.ellipsis) text += "...", "right" === textAlign && (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
15994
+ if ("add" === this.ellipsis) text += "...", "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
16060
15995
  var index = getStrByWithCanvas(text, ("vertical" === direction ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
16061
- if (text = text.slice(0, index), text += "...", "right" === textAlign) {
15996
+ if (text = text.slice(0, index), text += "...", "right" === textAlign || "end" === textAlign) {
16062
15997
  var _measureTextCanvas3 = measureTextCanvas(this.text.slice(index), this.character),
16063
15998
  width = _measureTextCanvas3.width;
16064
15999
  "vertical" === direction || (left -= this.ellipsisWidth - width);
@@ -16314,17 +16249,7 @@
16314
16249
  maxHeight = this.height;
16315
16250
  var x = this.left,
16316
16251
  spacing = 0;
16317
- if (this.actualWidth < width && !isWidthMax) switch (this.textAlign) {
16318
- case "right":
16319
- x = width - this.actualWidth;
16320
- break;
16321
- case "center":
16322
- x = (width - this.actualWidth) / 2;
16323
- break;
16324
- case "justify":
16325
- this.paragraphs.length < 2 ? x = (width - this.actualWidth) / 2 : spacing = (width - this.actualWidth) / (this.paragraphs.length - 1);
16326
- }
16327
- this.paragraphs.map(function (paragraph) {
16252
+ this.actualWidth < width && !isWidthMax && ("right" === this.textAlign || "end" === this.textAlign ? x = width - this.actualWidth : "center" === this.textAlign ? x = (width - this.actualWidth) / 2 : "justify" === this.textAlign && (this.paragraphs.length < 2 ? x = (width - this.actualWidth) / 2 : spacing = (width - this.actualWidth) / (this.paragraphs.length - 1))), this.paragraphs.map(function (paragraph) {
16328
16253
  paragraph instanceof RichTextIcon ? (paragraph["_" + directionKey.x] = x, x += paragraph[directionKey.width] + spacing, paragraph["_" + directionKey.y] = "top" === paragraph.attribute.textBaseline ? 0 : "bottom" === paragraph.attribute.textBaseline ? maxHeight - paragraph.height : (maxHeight - paragraph.height) / 2) : (paragraph[directionKey.left] = x, x += paragraph[directionKey.width] + spacing);
16329
16254
  });
16330
16255
  }
@@ -16607,7 +16532,7 @@
16607
16532
  }
16608
16533
  } else {
16609
16534
  var richTextConfig = textConfig[i];
16610
- if (isNumber$2(richTextConfig.text) && (richTextConfig.text = "".concat(richTextConfig.text)), richTextConfig.text.includes("\n")) {
16535
+ if (isNumber$1(richTextConfig.text) && (richTextConfig.text = "".concat(richTextConfig.text)), richTextConfig.text.includes("\n")) {
16611
16536
  var textParts = richTextConfig.text.split("\n");
16612
16537
  for (var j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph(textParts[j], 0 !== j, richTextConfig));
16613
16538
  } else paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
@@ -16936,7 +16861,7 @@
16936
16861
  innerRadius = _this$attribute2$inne === void 0 ? arcTheme.innerRadius : _this$attribute2$inne;
16937
16862
  if (0 === cornerRadius || "0%" === cornerRadius) return 0;
16938
16863
  var deltaRadius = Math.abs(outerRadius - innerRadius);
16939
- return Math.min(isNumber$2(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
16864
+ return Math.min(isNumber$1(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
16940
16865
  }
16941
16866
  }, {
16942
16867
  key: "getParsedAngle",
@@ -19187,7 +19112,7 @@
19187
19112
  var halfPi = pi / 2;
19188
19113
  function createRectPath(path, x, y, width, height, rectCornerRadius) {
19189
19114
  var cornerRadius;
19190
- if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$2(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
19115
+ if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$1(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
19191
19116
  var cornerRadiusArr = rectCornerRadius;
19192
19117
  var cr0, cr1;
19193
19118
  switch (cornerRadiusArr.length) {
@@ -19310,7 +19235,7 @@
19310
19235
  y = bounds.y1,
19311
19236
  width = bounds.width(),
19312
19237
  height = bounds.height();
19313
- return isNumber$2(boundsPadding) ? (x += boundsPadding, y += boundsPadding, width -= 2 * boundsPadding, height -= 2 * boundsPadding) : (x += boundsPadding[3], y += boundsPadding[0], width -= boundsPadding[1] + boundsPadding[3], height -= boundsPadding[0] + boundsPadding[2]), {
19238
+ return isNumber$1(boundsPadding) ? (x += boundsPadding, y += boundsPadding, width -= 2 * boundsPadding, height -= 2 * boundsPadding) : (x += boundsPadding[3], y += boundsPadding[0], width -= boundsPadding[1] + boundsPadding[3], height -= boundsPadding[0] + boundsPadding[2]), {
19314
19239
  x: x,
19315
19240
  y: y,
19316
19241
  width: width,
@@ -21252,9 +21177,7 @@
21252
21177
  value: function draw(image, renderService, drawContext) {
21253
21178
  var url = image.attribute.image;
21254
21179
  if (!url || !image.resources) return;
21255
- var res = image.resources.get(url);
21256
- if ("loading" === res.state && isString$1(url)) return void ResourceLoader.improveImageLoading(url);
21257
- if ("success" !== res.state) return;
21180
+ if ("success" !== image.resources.get(url).state) return;
21258
21181
  var context = renderService.drawParams.context;
21259
21182
  if (!context) return;
21260
21183
  var imageAttribute = getTheme(image).image;
@@ -21295,241 +21218,6 @@
21295
21218
  },
21296
21219
  __metadata$$ = undefined && undefined.__metadata || function (k, v) {
21297
21220
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21298
- };
21299
- var DrawItemInterceptor = Symbol["for"]("DrawItemInterceptor");
21300
- var tempDirtyBounds = new AABBBounds();
21301
- var ShadowRootDrawItemInterceptorContribution = /*#__PURE__*/function () {
21302
- function ShadowRootDrawItemInterceptorContribution() {
21303
- _classCallCheck(this, ShadowRootDrawItemInterceptorContribution);
21304
- this.order = 1;
21305
- }
21306
- _createClass(ShadowRootDrawItemInterceptorContribution, [{
21307
- key: "afterDrawItem",
21308
- value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21309
- return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21310
- }
21311
- }, {
21312
- key: "beforeDrawItem",
21313
- value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21314
- return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21315
- }
21316
- }, {
21317
- key: "drawItem",
21318
- value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
21319
- if (!graphic.shadowRoot) return !1;
21320
- var context = drawContext.context;
21321
- if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
21322
- tempDirtyBounds.copy(drawContribution.dirtyBounds);
21323
- var m = graphic.globalTransMatrix.getInverse();
21324
- drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
21325
- }
21326
- return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
21327
- }
21328
- }]);
21329
- return ShadowRootDrawItemInterceptorContribution;
21330
- }();
21331
- var DebugDrawItemInterceptorContribution = /*#__PURE__*/function () {
21332
- function DebugDrawItemInterceptorContribution() {
21333
- _classCallCheck(this, DebugDrawItemInterceptorContribution);
21334
- this.order = 1;
21335
- }
21336
- _createClass(DebugDrawItemInterceptorContribution, [{
21337
- key: "afterDrawItem",
21338
- value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21339
- return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21340
- }
21341
- }, {
21342
- key: "drawItem",
21343
- value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
21344
- if (!graphic.attribute._debug_bounds) return !1;
21345
- var context = drawContext.context;
21346
- context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
21347
- var b = graphic.AABBBounds;
21348
- return !0 !== graphic.attribute._debug_bounds && graphic.attribute._debug_bounds(context, graphic), context.strokeRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore(), !0;
21349
- }
21350
- }]);
21351
- return DebugDrawItemInterceptorContribution;
21352
- }();
21353
- exports.CommonDrawItemInterceptorContribution = /*#__PURE__*/function () {
21354
- function CommonDrawItemInterceptorContribution() {
21355
- _classCallCheck(this, CommonDrawItemInterceptorContribution);
21356
- this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
21357
- }
21358
- _createClass(CommonDrawItemInterceptorContribution, [{
21359
- key: "afterDrawItem",
21360
- value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21361
- for (var i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].afterDrawItem && this.interceptors[i].afterDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
21362
- return !1;
21363
- }
21364
- }, {
21365
- key: "beforeDrawItem",
21366
- value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21367
- if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
21368
- for (var i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].beforeDrawItem && this.interceptors[i].beforeDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
21369
- return !1;
21370
- }
21371
- }]);
21372
- return CommonDrawItemInterceptorContribution;
21373
- }();
21374
- exports.CommonDrawItemInterceptorContribution = __decorate$1j([injectable(), __metadata$$("design:paramtypes", [])], exports.CommonDrawItemInterceptorContribution);
21375
- var InteractiveDrawItemInterceptorContribution = /*#__PURE__*/function () {
21376
- function InteractiveDrawItemInterceptorContribution() {
21377
- _classCallCheck(this, InteractiveDrawItemInterceptorContribution);
21378
- this.order = 1;
21379
- }
21380
- _createClass(InteractiveDrawItemInterceptorContribution, [{
21381
- key: "beforeDrawItem",
21382
- value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21383
- return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
21384
- }
21385
- }, {
21386
- key: "beforeSetInteractive",
21387
- value: function beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
21388
- var interactiveGraphic = graphic.interactiveGraphic;
21389
- if (graphic.attribute.globalZIndex) {
21390
- interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
21391
- globalZIndex: 0,
21392
- zIndex: graphic.attribute.globalZIndex
21393
- }, !1, {
21394
- skipUpdateCallback: !0
21395
- }), drawContext.stage.tryInitInteractiveLayer();
21396
- var interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
21397
- if (interactiveLayer) {
21398
- this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
21399
- }
21400
- return !0;
21401
- }
21402
- if (interactiveGraphic) {
21403
- drawContext.stage.tryInitInteractiveLayer();
21404
- var _interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
21405
- if (_interactiveLayer) {
21406
- this.getShadowRoot(_interactiveLayer).removeChild(interactiveGraphic);
21407
- }
21408
- graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
21409
- }
21410
- return !1;
21411
- }
21412
- }, {
21413
- key: "beforeDrawInteractive",
21414
- value: function beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
21415
- var baseGraphic = graphic.baseGraphic;
21416
- if (baseGraphic) {
21417
- this.processing = !0;
21418
- var context = drawContext.context;
21419
- return context.highPerformanceSave(), context.setTransformFromMatrix(baseGraphic.parent.globalTransMatrix, !0), baseGraphic.isContainer ? drawContribution.renderGroup(baseGraphic, drawContext, baseGraphic.parent.globalTransMatrix) : drawContribution.renderItem(baseGraphic, drawContext), context.highPerformanceRestore(), this.processing = !1, !0;
21420
- }
21421
- return !1;
21422
- }
21423
- }, {
21424
- key: "getShadowRoot",
21425
- value: function getShadowRoot(interactiveLayer) {
21426
- var _a;
21427
- var group = interactiveLayer.getElementById("_interactive_group");
21428
- return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
21429
- }
21430
- }]);
21431
- return InteractiveDrawItemInterceptorContribution;
21432
- }();
21433
- var Canvas3DDrawItemInterceptor = /*#__PURE__*/function () {
21434
- function Canvas3DDrawItemInterceptor() {
21435
- _classCallCheck(this, Canvas3DDrawItemInterceptor);
21436
- this.order = 1;
21437
- }
21438
- _createClass(Canvas3DDrawItemInterceptor, [{
21439
- key: "beforeDrawItem",
21440
- value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21441
- if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
21442
- drawContext.in3dInterceptor = !0;
21443
- var _renderService$drawPa = renderService.drawParams,
21444
- context = _renderService$drawPa.context,
21445
- stage = _renderService$drawPa.stage;
21446
- context.canvas;
21447
- context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
21448
- var m = context.currentMatrix;
21449
- m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
21450
- var matrix = mat4Allocate.allocate();
21451
- mat3Tomat4(matrix, m);
21452
- var lastModelMatrix = context.modelMatrix;
21453
- if (lastModelMatrix) {
21454
- if (matrix) {
21455
- var _m = mat4Allocate.allocate();
21456
- context.modelMatrix = multiplyMat4Mat4(_m, lastModelMatrix, matrix);
21457
- }
21458
- } else context.modelMatrix = matrix;
21459
- if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
21460
- var isPie = !1,
21461
- is3d = !1;
21462
- if (graphic.forEachChildren(function (c) {
21463
- return isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie;
21464
- }), graphic.forEachChildren(function (c) {
21465
- return is3d = !!c.findFace, !is3d;
21466
- }), isPie) {
21467
- var children = graphic.getChildren(),
21468
- sortedChildren = _toConsumableArray(children);
21469
- sortedChildren.sort(function (a, b) {
21470
- var _a, _b, _c, _d;
21471
- var angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
21472
- angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
21473
- for (; angle1 < 0;) angle1 += pi2;
21474
- for (; angle2 < 0;) angle2 += pi2;
21475
- return angle2 - angle1;
21476
- }), sortedChildren.forEach(function (c) {
21477
- c._next = null, c._prev = null;
21478
- }), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(function (c) {
21479
- graphic.appendChild(c);
21480
- });
21481
- var _m2 = graphic.parent.globalTransMatrix;
21482
- drawContext.hack_pieFace = "outside", drawContribution.renderGroup(graphic, drawContext, _m2), drawContext.hack_pieFace = "inside", drawContribution.renderGroup(graphic, drawContext, _m2), drawContext.hack_pieFace = "top", drawContribution.renderGroup(graphic, drawContext, _m2), graphic.removeAllChild(), children.forEach(function (c) {
21483
- c._next = null, c._prev = null;
21484
- }), children.forEach(function (c) {
21485
- graphic.appendChild(c);
21486
- });
21487
- } else if (is3d) {
21488
- var _children = graphic.getChildren(),
21489
- zChildren = _children.map(function (g) {
21490
- return {
21491
- ave_z: g.findFace().vertices.map(function (v) {
21492
- var _a;
21493
- return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
21494
- }).reduce(function (a, b) {
21495
- return a + b;
21496
- }, 0),
21497
- g: g
21498
- };
21499
- });
21500
- zChildren.sort(function (a, b) {
21501
- return b.ave_z - a.ave_z;
21502
- }), graphic.removeAllChild(), zChildren.forEach(function (i) {
21503
- i.g._next = null, i.g._prev = null;
21504
- }), graphic.update(), zChildren.forEach(function (i) {
21505
- graphic.add(i.g);
21506
- }), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), _children.forEach(function (g) {
21507
- g._next = null, g._prev = null;
21508
- }), graphic.update(), _children.forEach(function (g) {
21509
- graphic.add(g);
21510
- });
21511
- } else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
21512
- } else drawContribution.renderItem(graphic, drawContext);
21513
- return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
21514
- }
21515
- }, {
21516
- key: "initCanvasCtx",
21517
- value: function initCanvasCtx(context) {
21518
- context.setTransformForCurrent();
21519
- }
21520
- }]);
21521
- return Canvas3DDrawItemInterceptor;
21522
- }();
21523
-
21524
- var __decorate$1i = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21525
- var d,
21526
- c = arguments.length,
21527
- r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21528
- if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
21529
- return c > 3 && r && Object.defineProperty(target, key, r), r;
21530
- },
21531
- __metadata$_ = undefined && undefined.__metadata || function (k, v) {
21532
- if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21533
21221
  },
21534
21222
  __param$E = undefined && undefined.__param || function (paramIndex, decorator) {
21535
21223
  return function (target, key) {
@@ -21588,7 +21276,7 @@
21588
21276
  }]);
21589
21277
  return DefaultRenderService;
21590
21278
  }();
21591
- exports.DefaultRenderService = __decorate$1i([injectable(), __param$E(0, inject(DrawContribution)), __metadata$_("design:paramtypes", [Object])], exports.DefaultRenderService);
21279
+ exports.DefaultRenderService = __decorate$1j([injectable(), __param$E(0, inject(DrawContribution)), __metadata$$("design:paramtypes", [Object])], exports.DefaultRenderService);
21592
21280
 
21593
21281
  var renderModule$1 = new ContainerModule(function (bind) {
21594
21282
  bind(RenderService).to(exports.DefaultRenderService).inSingletonScope();
@@ -21599,7 +21287,7 @@
21599
21287
  var BoundsPicker = Symbol["for"]("BoundsPicker");
21600
21288
  var GlobalPickerService = Symbol["for"]("GlobalPickerService");
21601
21289
 
21602
- var __decorate$1h = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21290
+ var __decorate$1i = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21603
21291
  var d,
21604
21292
  c = arguments.length,
21605
21293
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
@@ -21640,7 +21328,7 @@
21640
21328
  }]);
21641
21329
  return ShadowRootPickItemInterceptorContribution;
21642
21330
  }();
21643
- exports.ShadowRootPickItemInterceptorContribution = __decorate$1h([injectable()], exports.ShadowRootPickItemInterceptorContribution);
21331
+ exports.ShadowRootPickItemInterceptorContribution = __decorate$1i([injectable()], exports.ShadowRootPickItemInterceptorContribution);
21644
21332
  exports.InteractivePickItemInterceptorContribution = /*#__PURE__*/function () {
21645
21333
  function InteractivePickItemInterceptorContribution() {
21646
21334
  _classCallCheck(this, InteractivePickItemInterceptorContribution);
@@ -21664,7 +21352,7 @@
21664
21352
  }]);
21665
21353
  return InteractivePickItemInterceptorContribution;
21666
21354
  }();
21667
- exports.InteractivePickItemInterceptorContribution = __decorate$1h([injectable()], exports.InteractivePickItemInterceptorContribution);
21355
+ exports.InteractivePickItemInterceptorContribution = __decorate$1i([injectable()], exports.InteractivePickItemInterceptorContribution);
21668
21356
  exports.Canvas3DPickItemInterceptor = /*#__PURE__*/function () {
21669
21357
  function Canvas3DPickItemInterceptor() {
21670
21358
  _classCallCheck(this, Canvas3DPickItemInterceptor);
@@ -21741,7 +21429,7 @@
21741
21429
  }]);
21742
21430
  return Canvas3DPickItemInterceptor;
21743
21431
  }();
21744
- exports.Canvas3DPickItemInterceptor = __decorate$1h([injectable()], exports.Canvas3DPickItemInterceptor);
21432
+ exports.Canvas3DPickItemInterceptor = __decorate$1i([injectable()], exports.Canvas3DPickItemInterceptor);
21745
21433
 
21746
21434
  var pickModule = new ContainerModule(function (bind, unbind, isBound) {
21747
21435
  isBound(PickerService) || (bind(GlobalPickerService).toSelf(), bind(PickerService).toService(GlobalPickerService)), bind(exports.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.Canvas3DPickItemInterceptor), bind(exports.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.ShadowRootPickItemInterceptorContribution), bind(exports.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.InteractivePickItemInterceptorContribution), bindContributionProvider(bind, PickItemInterceptor);
@@ -21754,14 +21442,14 @@
21754
21442
  var AutoEnablePlugins = Symbol["for"]("AutoEnablePlugins");
21755
21443
  var PluginService = Symbol["for"]("PluginService");
21756
21444
 
21757
- var __decorate$1g = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21445
+ var __decorate$1h = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21758
21446
  var d,
21759
21447
  c = arguments.length,
21760
21448
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21761
21449
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
21762
21450
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21763
21451
  },
21764
- __metadata$Z = undefined && undefined.__metadata || function (k, v) {
21452
+ __metadata$_ = undefined && undefined.__metadata || function (k, v) {
21765
21453
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21766
21454
  },
21767
21455
  __param$D = undefined && undefined.__param || function (paramIndex, decorator) {
@@ -21817,7 +21505,7 @@
21817
21505
  }]);
21818
21506
  return DefaultPluginService;
21819
21507
  }();
21820
- DefaultPluginService = __decorate$1g([injectable(), __param$D(0, inject(ContributionProvider)), __param$D(0, named(AutoEnablePlugins)), __metadata$Z("design:paramtypes", [Object])], DefaultPluginService);
21508
+ DefaultPluginService = __decorate$1h([injectable(), __param$D(0, inject(ContributionProvider)), __param$D(0, named(AutoEnablePlugins)), __metadata$_("design:paramtypes", [Object])], DefaultPluginService);
21821
21509
 
21822
21510
  var pluginModule = new ContainerModule(function (bind) {
21823
21511
  bind(PluginService).to(DefaultPluginService), bindContributionProviderNoSingletonScope(bind, AutoEnablePlugins);
@@ -21831,14 +21519,14 @@
21831
21519
  bind(TextMeasureContribution).to(exports.DefaultTextMeasureContribution).inSingletonScope(), bindContributionProvider(bind, TextMeasureContribution);
21832
21520
  });
21833
21521
 
21834
- var __decorate$1f = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21522
+ var __decorate$1g = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21835
21523
  var d,
21836
21524
  c = arguments.length,
21837
21525
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21838
21526
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
21839
21527
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21840
21528
  },
21841
- __metadata$Y = undefined && undefined.__metadata || function (k, v) {
21529
+ __metadata$Z = undefined && undefined.__metadata || function (k, v) {
21842
21530
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21843
21531
  };
21844
21532
  var CanvasLayerHandlerContribution = /*#__PURE__*/function () {
@@ -21932,16 +21620,16 @@
21932
21620
  }]);
21933
21621
  return CanvasLayerHandlerContribution;
21934
21622
  }();
21935
- CanvasLayerHandlerContribution = __decorate$1f([injectable(), __metadata$Y("design:paramtypes", [])], CanvasLayerHandlerContribution);
21623
+ CanvasLayerHandlerContribution = __decorate$1g([injectable(), __metadata$Z("design:paramtypes", [])], CanvasLayerHandlerContribution);
21936
21624
 
21937
- var __decorate$1e = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21625
+ var __decorate$1f = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21938
21626
  var d,
21939
21627
  c = arguments.length,
21940
21628
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21941
21629
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
21942
21630
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21943
21631
  },
21944
- __metadata$X = undefined && undefined.__metadata || function (k, v) {
21632
+ __metadata$Y = undefined && undefined.__metadata || function (k, v) {
21945
21633
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21946
21634
  };
21947
21635
  var EmptyLayerHandlerContribution = /*#__PURE__*/function () {
@@ -21999,16 +21687,16 @@
21999
21687
  }]);
22000
21688
  return EmptyLayerHandlerContribution;
22001
21689
  }();
22002
- EmptyLayerHandlerContribution = __decorate$1e([injectable(), __metadata$X("design:paramtypes", [])], EmptyLayerHandlerContribution);
21690
+ EmptyLayerHandlerContribution = __decorate$1f([injectable(), __metadata$Y("design:paramtypes", [])], EmptyLayerHandlerContribution);
22003
21691
 
22004
- var __decorate$1d = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21692
+ var __decorate$1e = undefined && undefined.__decorate || function (decorators, target, key, desc) {
22005
21693
  var d,
22006
21694
  c = arguments.length,
22007
21695
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
22008
21696
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
22009
21697
  return c > 3 && r && Object.defineProperty(target, key, r), r;
22010
21698
  },
22011
- __metadata$W = undefined && undefined.__metadata || function (k, v) {
21699
+ __metadata$X = undefined && undefined.__metadata || function (k, v) {
22012
21700
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
22013
21701
  };
22014
21702
  var OffscreenLayerHandlerContribution = /*#__PURE__*/function () {
@@ -22095,7 +21783,7 @@
22095
21783
  }]);
22096
21784
  return OffscreenLayerHandlerContribution;
22097
21785
  }();
22098
- OffscreenLayerHandlerContribution = __decorate$1d([injectable(), __metadata$W("design:paramtypes", [])], OffscreenLayerHandlerContribution);
21786
+ OffscreenLayerHandlerContribution = __decorate$1e([injectable(), __metadata$X("design:paramtypes", [])], OffscreenLayerHandlerContribution);
22099
21787
 
22100
21788
  var layerHandlerModules = new ContainerModule(function (bind) {
22101
21789
  bind(CanvasLayerHandlerContribution).toSelf(), bind(OffscreenLayerHandlerContribution).toSelf(), bind(EmptyLayerHandlerContribution).toSelf(), bind(StaticLayerHandlerContribution).toService(CanvasLayerHandlerContribution), bind(DynamicLayerHandlerContribution).toService(OffscreenLayerHandlerContribution), bind(VirtualLayerHandlerContribution).toService(EmptyLayerHandlerContribution);
@@ -22222,6 +21910,241 @@
22222
21910
  return result;
22223
21911
  }
22224
21912
 
21913
+ var __decorate$1d = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21914
+ var d,
21915
+ c = arguments.length,
21916
+ r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21917
+ if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
21918
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
21919
+ },
21920
+ __metadata$W = undefined && undefined.__metadata || function (k, v) {
21921
+ if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21922
+ };
21923
+ var DrawItemInterceptor = Symbol["for"]("DrawItemInterceptor");
21924
+ var tempDirtyBounds = new AABBBounds();
21925
+ var ShadowRootDrawItemInterceptorContribution = /*#__PURE__*/function () {
21926
+ function ShadowRootDrawItemInterceptorContribution() {
21927
+ _classCallCheck(this, ShadowRootDrawItemInterceptorContribution);
21928
+ this.order = 1;
21929
+ }
21930
+ _createClass(ShadowRootDrawItemInterceptorContribution, [{
21931
+ key: "afterDrawItem",
21932
+ value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21933
+ return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21934
+ }
21935
+ }, {
21936
+ key: "beforeDrawItem",
21937
+ value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21938
+ return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21939
+ }
21940
+ }, {
21941
+ key: "drawItem",
21942
+ value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
21943
+ if (!graphic.shadowRoot) return !1;
21944
+ var context = drawContext.context;
21945
+ if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
21946
+ tempDirtyBounds.copy(drawContribution.dirtyBounds);
21947
+ var m = graphic.globalTransMatrix.getInverse();
21948
+ drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
21949
+ }
21950
+ return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
21951
+ }
21952
+ }]);
21953
+ return ShadowRootDrawItemInterceptorContribution;
21954
+ }();
21955
+ var DebugDrawItemInterceptorContribution = /*#__PURE__*/function () {
21956
+ function DebugDrawItemInterceptorContribution() {
21957
+ _classCallCheck(this, DebugDrawItemInterceptorContribution);
21958
+ this.order = 1;
21959
+ }
21960
+ _createClass(DebugDrawItemInterceptorContribution, [{
21961
+ key: "afterDrawItem",
21962
+ value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21963
+ return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21964
+ }
21965
+ }, {
21966
+ key: "drawItem",
21967
+ value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
21968
+ if (!graphic.attribute._debug_bounds) return !1;
21969
+ var context = drawContext.context;
21970
+ context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
21971
+ var b = graphic.AABBBounds;
21972
+ return !0 !== graphic.attribute._debug_bounds && graphic.attribute._debug_bounds(context, graphic), context.strokeRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore(), !0;
21973
+ }
21974
+ }]);
21975
+ return DebugDrawItemInterceptorContribution;
21976
+ }();
21977
+ var CommonDrawItemInterceptorContribution = /*#__PURE__*/function () {
21978
+ function CommonDrawItemInterceptorContribution() {
21979
+ _classCallCheck(this, CommonDrawItemInterceptorContribution);
21980
+ this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
21981
+ }
21982
+ _createClass(CommonDrawItemInterceptorContribution, [{
21983
+ key: "afterDrawItem",
21984
+ value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21985
+ for (var i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].afterDrawItem && this.interceptors[i].afterDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
21986
+ return !1;
21987
+ }
21988
+ }, {
21989
+ key: "beforeDrawItem",
21990
+ value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21991
+ if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
21992
+ for (var i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].beforeDrawItem && this.interceptors[i].beforeDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
21993
+ return !1;
21994
+ }
21995
+ }]);
21996
+ return CommonDrawItemInterceptorContribution;
21997
+ }();
21998
+ CommonDrawItemInterceptorContribution = __decorate$1d([injectable(), __metadata$W("design:paramtypes", [])], CommonDrawItemInterceptorContribution);
21999
+ var InteractiveDrawItemInterceptorContribution = /*#__PURE__*/function () {
22000
+ function InteractiveDrawItemInterceptorContribution() {
22001
+ _classCallCheck(this, InteractiveDrawItemInterceptorContribution);
22002
+ this.order = 1;
22003
+ }
22004
+ _createClass(InteractiveDrawItemInterceptorContribution, [{
22005
+ key: "beforeDrawItem",
22006
+ value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
22007
+ return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
22008
+ }
22009
+ }, {
22010
+ key: "beforeSetInteractive",
22011
+ value: function beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
22012
+ var interactiveGraphic = graphic.interactiveGraphic;
22013
+ if (graphic.attribute.globalZIndex) {
22014
+ interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
22015
+ globalZIndex: 0,
22016
+ zIndex: graphic.attribute.globalZIndex
22017
+ }, !1, {
22018
+ skipUpdateCallback: !0
22019
+ }), drawContext.stage.tryInitInteractiveLayer();
22020
+ var interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
22021
+ if (interactiveLayer) {
22022
+ this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
22023
+ }
22024
+ return !0;
22025
+ }
22026
+ if (interactiveGraphic) {
22027
+ drawContext.stage.tryInitInteractiveLayer();
22028
+ var _interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
22029
+ if (_interactiveLayer) {
22030
+ this.getShadowRoot(_interactiveLayer).removeChild(interactiveGraphic);
22031
+ }
22032
+ graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
22033
+ }
22034
+ return !1;
22035
+ }
22036
+ }, {
22037
+ key: "beforeDrawInteractive",
22038
+ value: function beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
22039
+ var baseGraphic = graphic.baseGraphic;
22040
+ if (baseGraphic) {
22041
+ this.processing = !0;
22042
+ var context = drawContext.context;
22043
+ return context.highPerformanceSave(), context.setTransformFromMatrix(baseGraphic.parent.globalTransMatrix, !0), baseGraphic.isContainer ? drawContribution.renderGroup(baseGraphic, drawContext, baseGraphic.parent.globalTransMatrix) : drawContribution.renderItem(baseGraphic, drawContext), context.highPerformanceRestore(), this.processing = !1, !0;
22044
+ }
22045
+ return !1;
22046
+ }
22047
+ }, {
22048
+ key: "getShadowRoot",
22049
+ value: function getShadowRoot(interactiveLayer) {
22050
+ var _a;
22051
+ var group = interactiveLayer.getElementById("_interactive_group");
22052
+ return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
22053
+ }
22054
+ }]);
22055
+ return InteractiveDrawItemInterceptorContribution;
22056
+ }();
22057
+ var Canvas3DDrawItemInterceptor = /*#__PURE__*/function () {
22058
+ function Canvas3DDrawItemInterceptor() {
22059
+ _classCallCheck(this, Canvas3DDrawItemInterceptor);
22060
+ this.order = 1;
22061
+ }
22062
+ _createClass(Canvas3DDrawItemInterceptor, [{
22063
+ key: "beforeDrawItem",
22064
+ value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
22065
+ if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
22066
+ drawContext.in3dInterceptor = !0;
22067
+ var _renderService$drawPa = renderService.drawParams,
22068
+ context = _renderService$drawPa.context,
22069
+ stage = _renderService$drawPa.stage;
22070
+ context.canvas;
22071
+ context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
22072
+ var m = context.currentMatrix;
22073
+ m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
22074
+ var matrix = mat4Allocate.allocate();
22075
+ mat3Tomat4(matrix, m);
22076
+ var lastModelMatrix = context.modelMatrix;
22077
+ if (lastModelMatrix) {
22078
+ if (matrix) {
22079
+ var _m = mat4Allocate.allocate();
22080
+ context.modelMatrix = multiplyMat4Mat4(_m, lastModelMatrix, matrix);
22081
+ }
22082
+ } else context.modelMatrix = matrix;
22083
+ if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
22084
+ var isPie = !1,
22085
+ is3d = !1;
22086
+ if (graphic.forEachChildren(function (c) {
22087
+ return isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie;
22088
+ }), graphic.forEachChildren(function (c) {
22089
+ return is3d = !!c.findFace, !is3d;
22090
+ }), isPie) {
22091
+ var children = graphic.getChildren(),
22092
+ sortedChildren = _toConsumableArray(children);
22093
+ sortedChildren.sort(function (a, b) {
22094
+ var _a, _b, _c, _d;
22095
+ var angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
22096
+ angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
22097
+ for (; angle1 < 0;) angle1 += pi2;
22098
+ for (; angle2 < 0;) angle2 += pi2;
22099
+ return angle2 - angle1;
22100
+ }), sortedChildren.forEach(function (c) {
22101
+ c._next = null, c._prev = null;
22102
+ }), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(function (c) {
22103
+ graphic.appendChild(c);
22104
+ });
22105
+ var _m2 = graphic.parent.globalTransMatrix;
22106
+ drawContext.hack_pieFace = "outside", drawContribution.renderGroup(graphic, drawContext, _m2), drawContext.hack_pieFace = "inside", drawContribution.renderGroup(graphic, drawContext, _m2), drawContext.hack_pieFace = "top", drawContribution.renderGroup(graphic, drawContext, _m2), graphic.removeAllChild(), children.forEach(function (c) {
22107
+ c._next = null, c._prev = null;
22108
+ }), children.forEach(function (c) {
22109
+ graphic.appendChild(c);
22110
+ });
22111
+ } else if (is3d) {
22112
+ var _children = graphic.getChildren(),
22113
+ zChildren = _children.map(function (g) {
22114
+ return {
22115
+ ave_z: g.findFace().vertices.map(function (v) {
22116
+ var _a;
22117
+ return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
22118
+ }).reduce(function (a, b) {
22119
+ return a + b;
22120
+ }, 0),
22121
+ g: g
22122
+ };
22123
+ });
22124
+ zChildren.sort(function (a, b) {
22125
+ return b.ave_z - a.ave_z;
22126
+ }), graphic.removeAllChild(), zChildren.forEach(function (i) {
22127
+ i.g._next = null, i.g._prev = null;
22128
+ }), graphic.update(), zChildren.forEach(function (i) {
22129
+ graphic.add(i.g);
22130
+ }), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), _children.forEach(function (g) {
22131
+ g._next = null, g._prev = null;
22132
+ }), graphic.update(), _children.forEach(function (g) {
22133
+ graphic.add(g);
22134
+ });
22135
+ } else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
22136
+ } else drawContribution.renderItem(graphic, drawContext);
22137
+ return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
22138
+ }
22139
+ }, {
22140
+ key: "initCanvasCtx",
22141
+ value: function initCanvasCtx(context) {
22142
+ context.setTransformForCurrent();
22143
+ }
22144
+ }]);
22145
+ return Canvas3DDrawItemInterceptor;
22146
+ }();
22147
+
22225
22148
  var __decorate$1c = undefined && undefined.__decorate || function (decorators, target, key, desc) {
22226
22149
  var d,
22227
22150
  c = arguments.length,
@@ -22274,20 +22197,26 @@
22274
22197
  width = drawContext.width,
22275
22198
  height = drawContext.height;
22276
22199
  if (!context) return;
22200
+ if (drawContext.keepMatrix) {
22201
+ if (context.nativeContext && context.nativeContext.getTransform) {
22202
+ var t = context.nativeContext.getTransform();
22203
+ context.setTransformFromMatrix(t, !0, 1);
22204
+ }
22205
+ } else context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0);
22277
22206
  var dirtyBounds = this.dirtyBounds.setValue(0, 0, width, height);
22278
22207
  if (stage.dirtyBounds && !stage.dirtyBounds.empty()) {
22279
22208
  var b = getRectIntersect(dirtyBounds, stage.dirtyBounds, !1);
22280
22209
  dirtyBounds.x1 = Math.floor(b.x1), dirtyBounds.y1 = Math.floor(b.y1), dirtyBounds.x2 = Math.ceil(b.x2), dirtyBounds.y2 = Math.ceil(b.y2);
22281
22210
  }
22282
22211
  var d = context.dpr % 1;
22283
- (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0);
22212
+ (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds);
22284
22213
  var drawInArea = dirtyBounds.width() * context.dpr < context.canvas.width || dirtyBounds.height() * context.dpr < context.canvas.height;
22285
- context.save(), context.translate(x, y, !0), drawInArea && (context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip()), stage.camera && (this.dirtyBounds.clear(), this.backupDirtyBounds.clear()), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
22214
+ context.save(), context.translate(x, y, !0), drawInArea && (context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip()), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
22286
22215
  var _a, _b;
22287
22216
  return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
22288
22217
  }).forEach(function (group) {
22289
22218
  group.isContainer ? _this2.renderGroup(group, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0)) : _this2.renderItem(group, drawContext);
22290
- }), context.restore(), context.restore(), context.draw(), context.inuse = !1;
22219
+ }), context.restore(), context.restore(), context.draw(), drawContext.keepMatrix || (context.inuse = !1);
22291
22220
  }
22292
22221
  }, {
22293
22222
  key: "doRegister",
@@ -22345,7 +22274,7 @@
22345
22274
  }, subLayers.set(group._uid, incrementalLayer));
22346
22275
  var incrementalContext = incrementalLayer.layer.getNativeHandler().getContext(),
22347
22276
  idc = incrementalLayer.drawContribution || container.get(IncrementalDrawContribution);
22348
- idc.dirtyBounds.clear(), idc.backupDirtyBounds.clear(), idc.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), {
22277
+ idc.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), idc.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), idc.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), {
22349
22278
  drawContribution: idc,
22350
22279
  clear: "transparent",
22351
22280
  layer: incrementalLayer.layer,
@@ -22750,7 +22679,7 @@
22750
22679
  value: function draw(renderService, drawContext) {
22751
22680
  return __awaiter$1(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
22752
22681
  var _this2 = this;
22753
- var skipDraw, context, _drawContext$x, x, _drawContext$y, y;
22682
+ var skipDraw, context, _drawContext$x, x, _drawContext$y, y, t;
22754
22683
  return _regeneratorRuntime().wrap(function _callee$(_context) {
22755
22684
  while (1) switch (_context.prev = _context.next) {
22756
22685
  case 0:
@@ -22773,14 +22702,22 @@
22773
22702
  case 8:
22774
22703
  this.currentRenderService = renderService;
22775
22704
  context = drawContext.context, _drawContext$x = drawContext.x, x = _drawContext$x === void 0 ? 0 : _drawContext$x, _drawContext$y = drawContext.y, y = _drawContext$y === void 0 ? 0 : _drawContext$y;
22776
- context && (context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0), context.save(), drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext), context.translate(x, y, !0), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
22777
- var _a, _b;
22778
- return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
22779
- }).forEach(function (group) {
22780
- _this2.renderGroup(group, drawContext);
22781
- }), this.hooks.completeDraw.tap("top-draw", function () {
22782
- context.restore(), context.restore(), context.draw(), context.inuse = !1, _this2.rendering = !1;
22783
- }));
22705
+ if (context) {
22706
+ if (drawContext.keepMatrix) {
22707
+ if (context.nativeContext && context.nativeContext.getTransform) {
22708
+ t = context.nativeContext.getTransform();
22709
+ context.setTransformFromMatrix(t, !0, 1);
22710
+ }
22711
+ } else context.inuse = !0, context.clearMatrix();
22712
+ context.setTransformForCurrent(!0), context.save(), drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext), context.translate(x, y, !0), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
22713
+ var _a, _b;
22714
+ return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
22715
+ }).forEach(function (group) {
22716
+ _this2.renderGroup(group, drawContext);
22717
+ }), this.hooks.completeDraw.tap("top-draw", function () {
22718
+ context.restore(), context.restore(), context.draw(), drawContext.keepMatrix || (context.inuse = !1), _this2.rendering = !1;
22719
+ });
22720
+ }
22784
22721
  case 11:
22785
22722
  case "end":
22786
22723
  return _context.stop();
@@ -23055,7 +22992,7 @@
23055
22992
  DefaultIncrementalDrawContribution = __decorate$18([injectable(), __param$A(0, multiInject(GraphicRender)), __param$A(1, inject(DefaultIncrementalCanvasLineRender)), __param$A(2, inject(DefaultIncrementalCanvasAreaRender)), __param$A(3, inject(ContributionProvider)), __param$A(3, named(DrawItemInterceptor)), __metadata$T("design:paramtypes", [Array, Object, Object, Object])], DefaultIncrementalDrawContribution);
23056
22993
 
23057
22994
  var renderModule = new ContainerModule(function (bind) {
23058
- bind(DefaultBaseBackgroundRenderContribution).toSelf().inSingletonScope(), bind(DefaultBaseTextureRenderContribution).toSelf().inSingletonScope(), bind(DrawContribution).to(DefaultDrawContribution), bind(IncrementalDrawContribution).to(DefaultIncrementalDrawContribution), bind(GroupRender).to(DefaultCanvasGroupRender).inSingletonScope(), bind(GraphicRender).toService(GroupRender), bindContributionProvider(bind, GroupRenderContribution), bind(exports.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(), bindContributionProvider(bind, InteractiveSubRenderContribution), bindContributionProvider(bind, GraphicRender), bind(exports.CommonDrawItemInterceptorContribution).toSelf().inSingletonScope(), bind(DrawItemInterceptor).toService(exports.CommonDrawItemInterceptorContribution), bindContributionProvider(bind, DrawItemInterceptor);
22995
+ bind(DefaultBaseBackgroundRenderContribution).toSelf().inSingletonScope(), bind(DefaultBaseTextureRenderContribution).toSelf().inSingletonScope(), bind(DrawContribution).to(DefaultDrawContribution), bind(IncrementalDrawContribution).to(DefaultIncrementalDrawContribution), bind(GroupRender).to(DefaultCanvasGroupRender).inSingletonScope(), bind(GraphicRender).toService(GroupRender), bindContributionProvider(bind, GroupRenderContribution), bind(exports.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(), bindContributionProvider(bind, InteractiveSubRenderContribution), bindContributionProvider(bind, GraphicRender), bind(CommonDrawItemInterceptorContribution).toSelf().inSingletonScope(), bind(DrawItemInterceptor).toService(CommonDrawItemInterceptorContribution), bindContributionProvider(bind, DrawItemInterceptor);
23059
22996
  });
23060
22997
 
23061
22998
  function load(container) {
@@ -23354,13 +23291,23 @@
23354
23291
  this.name = "FlexLayoutPlugin", this.activeEvent = "onRegister", this.id = Generator.GenAutoIncrementId(), this.key = this.name + this.id, this.tempBounds = new AABBBounds();
23355
23292
  }
23356
23293
  _createClass(FlexLayoutPlugin, [{
23294
+ key: "pauseLayout",
23295
+ value: function pauseLayout(p) {
23296
+ this.pause = p;
23297
+ }
23298
+ }, {
23299
+ key: "tryLayoutChildren",
23300
+ value: function tryLayoutChildren(graphic) {
23301
+ graphic.firstChild && this.tryLayout(graphic.firstChild);
23302
+ }
23303
+ }, {
23357
23304
  key: "tryLayout",
23358
23305
  value: function tryLayout(graphic) {
23359
23306
  var _this = this;
23360
- if (this.layouting) return;
23361
- this.layouting = !0;
23307
+ var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
23308
+ if (this.pause) return;
23362
23309
  var p = graphic.parent;
23363
- if (!p || !graphic.needUpdateLayout()) return;
23310
+ if (!(force || p && graphic.needUpdateLayout())) return;
23364
23311
  var theme = getTheme(p).group,
23365
23312
  _p$attribute$display = p.attribute.display,
23366
23313
  display = _p$attribute$display === void 0 ? theme.display : _p$attribute$display;
@@ -23370,24 +23317,29 @@
23370
23317
  flexDirection = _p$attribute$flexDire === void 0 ? theme.flexDirection : _p$attribute$flexDire,
23371
23318
  _p$attribute$flexWrap = _p$attribute.flexWrap,
23372
23319
  flexWrap = _p$attribute$flexWrap === void 0 ? theme.flexWrap : _p$attribute$flexWrap,
23373
- _p$attribute$justifyC = _p$attribute.justifyContent,
23374
- justifyContent = _p$attribute$justifyC === void 0 ? theme.justifyContent : _p$attribute$justifyC,
23375
23320
  _p$attribute$alignIte = _p$attribute.alignItems,
23376
23321
  alignItems = _p$attribute$alignIte === void 0 ? theme.alignItems : _p$attribute$alignIte,
23377
- _p$attribute$alignCon = _p$attribute.alignContent,
23378
- alignContent = _p$attribute$alignCon === void 0 ? theme.alignContent : _p$attribute$alignCon,
23379
23322
  _p$attribute$clip = _p$attribute.clip,
23380
- clip = _p$attribute$clip === void 0 ? theme.clip : _p$attribute$clip;
23381
- var childrenWidth = 0,
23382
- childrenHeight = 0,
23383
- boundsLegal = 0;
23384
- if (p.forEachChildren(function (child) {
23385
- var bounds = child.AABBBounds;
23386
- "column" === flexDirection || "column-reverse" === flexDirection ? (childrenHeight += bounds.height(), childrenWidth = Math.max(childrenWidth, bounds.width())) : (childrenWidth += bounds.width(), childrenHeight = Math.max(childrenHeight, bounds.height())), boundsLegal += bounds.x1, boundsLegal += bounds.y1, boundsLegal += bounds.x2, boundsLegal += bounds.y2;
23387
- }), !isFinite(boundsLegal)) return;
23388
- var width = p.attribute.width || childrenWidth,
23389
- height = p.attribute.height || childrenHeight;
23390
- p.attribute.width || (p.attribute.width = 0), p.attribute.height || (p.attribute.height = 0), this.tempBounds.copy(p._AABBBounds);
23323
+ clip = _p$attribute$clip === void 0 ? theme.clip : _p$attribute$clip,
23324
+ _p$attribute$alignCon = p.attribute.alignContent,
23325
+ alignContent = _p$attribute$alignCon === void 0 ? null != alignItems ? alignItems : theme.alignContent : _p$attribute$alignCon;
23326
+ var _p$attribute2 = p.attribute,
23327
+ width = _p$attribute2.width,
23328
+ height = _p$attribute2.height,
23329
+ _p$attribute2$justify = _p$attribute2.justifyContent,
23330
+ justifyContent = _p$attribute2$justify === void 0 ? theme.justifyContent : _p$attribute2$justify;
23331
+ var children = p.getChildren();
23332
+ if (null == width || null == height) {
23333
+ var childrenWidth = 0,
23334
+ childrenHeight = 0,
23335
+ boundsLegal = 0;
23336
+ if (children.forEach(function (child) {
23337
+ var bounds = _this.getAABBBounds(child);
23338
+ bounds.empty() || ("column" === flexDirection || "column-reverse" === flexDirection ? (childrenHeight += bounds.height(), childrenWidth = Math.max(childrenWidth, bounds.width())) : (childrenWidth += bounds.width(), childrenHeight = Math.max(childrenHeight, bounds.height())), boundsLegal += bounds.x1, boundsLegal += bounds.y1, boundsLegal += bounds.x2, boundsLegal += bounds.y2);
23339
+ }), !isFinite(boundsLegal)) return;
23340
+ width = childrenWidth, height = childrenHeight;
23341
+ }
23342
+ p.attribute.width = width, p.attribute.height = height, this.tempBounds.copy(p._AABBBounds);
23391
23343
  var result = {
23392
23344
  main: {
23393
23345
  len: width,
@@ -23396,18 +23348,18 @@
23396
23348
  cross: {
23397
23349
  len: height,
23398
23350
  field: "y"
23399
- },
23400
- dir: 1
23351
+ }
23401
23352
  },
23402
23353
  main = result.main,
23403
23354
  cross = result.cross;
23404
- "row-reverse" === flexDirection ? result.dir = -1 : "column" === flexDirection ? (main.len = height, cross.len = width, main.field = "y", cross.field = "x") : "column-reverse" === flexDirection && (main.len = height, cross.len = width, main.field = "y", cross.field = "x", result.dir = -1);
23355
+ "column" !== flexDirection && "column-reverse" !== flexDirection || (main.len = height, cross.len = width, main.field = "y", cross.field = "x"), "row-reverse" !== flexDirection && "column-reverse" !== flexDirection || ("flex-start" === justifyContent ? justifyContent = "flex-end" : "flex-end" === justifyContent ? justifyContent = "flex-start" : children.reverse());
23405
23356
  var mainLen = 0,
23406
23357
  crossLen = 0;
23407
23358
  var mianLenArray = [];
23408
- p.forEachChildren(function (c) {
23409
- var b = c.AABBBounds,
23410
- ml = "x" === main.field ? b.width() : b.height(),
23359
+ children.forEach(function (c) {
23360
+ var b = _this.getAABBBounds(c);
23361
+ if (b.empty()) return;
23362
+ var ml = "x" === main.field ? b.width() : b.height(),
23411
23363
  cl = "x" === cross.field ? b.width() : b.height();
23412
23364
  mianLenArray.push({
23413
23365
  mainLen: ml,
@@ -23440,104 +23392,171 @@
23440
23392
  mainLen: mainLen,
23441
23393
  crossLen: crossLen
23442
23394
  });
23443
- var children = p.getChildren();
23444
23395
  var lastIdx = 0;
23445
23396
  if (mainList.forEach(function (s) {
23446
23397
  _this.layoutMain(p, children, justifyContent, main, mianLenArray, lastIdx, s), lastIdx = s.idx + 1;
23447
23398
  }), crossLen = mainList.reduce(function (a, b) {
23448
23399
  return a + b.crossLen;
23449
23400
  }, 0), 1 === mainList.length) {
23450
- if ("flex-end" === alignItems) {
23451
- var anchorPos = cross.len;
23452
- this.layoutCross(children, alignItems, cross, anchorPos, mianLenArray, mainList[0], 0);
23453
- } else if ("center" === alignItems) {
23454
- var _anchorPos = cross.len / 2;
23455
- this.layoutCross(children, alignItems, cross, _anchorPos, mianLenArray, mainList[0], 0);
23456
- } else children.forEach(function (child) {
23457
- child.attribute[cross.field] = getPadding(child, cross.field);
23458
- });
23401
+ var anchorPosMap = {
23402
+ "flex-start": 0,
23403
+ "flex-end": cross.len,
23404
+ center: cross.len / 2
23405
+ };
23406
+ this.layoutCross(children, alignItems, cross, anchorPosMap, mianLenArray, mainList[0], 0);
23459
23407
  } else if ("flex-start" === alignContent) {
23460
23408
  lastIdx = 0;
23461
- var _anchorPos2 = 0;
23409
+ var anchorPos = 0;
23462
23410
  mainList.forEach(function (s, i) {
23463
- _this.layoutCross(children, "flex-start", cross, _anchorPos2, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, _anchorPos2 += s.crossLen;
23411
+ var anchorPosMap = {
23412
+ "flex-start": anchorPos,
23413
+ "flex-end": anchorPos + s.crossLen,
23414
+ center: anchorPos + s.crossLen / 2
23415
+ };
23416
+ _this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen;
23464
23417
  });
23465
23418
  } else if ("center" === alignContent) {
23466
23419
  lastIdx = 0;
23467
- var _anchorPos3 = Math.max(0, (cross.len - crossLen) / 2);
23420
+ var _anchorPos = Math.max(0, (cross.len - crossLen) / 2);
23468
23421
  mainList.forEach(function (s, i) {
23469
- _this.layoutCross(children, "center", cross, _anchorPos3 + s.crossLen / 2, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, _anchorPos3 += s.crossLen;
23422
+ var anchorPosMap = {
23423
+ "flex-start": _anchorPos,
23424
+ "flex-end": _anchorPos + s.crossLen,
23425
+ center: _anchorPos + s.crossLen / 2
23426
+ };
23427
+ _this.layoutCross(children, "center", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, _anchorPos += s.crossLen;
23470
23428
  });
23471
23429
  } else if ("space-around" === alignContent) {
23472
23430
  lastIdx = 0;
23473
23431
  var padding = Math.max(0, (cross.len - crossLen) / mainList.length / 2);
23474
- var _anchorPos4 = padding;
23432
+ var _anchorPos2 = padding;
23475
23433
  mainList.forEach(function (s, i) {
23476
- _this.layoutCross(children, "flex-start", cross, _anchorPos4, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, _anchorPos4 += s.crossLen + 2 * padding;
23434
+ var anchorPosMap = {
23435
+ "flex-start": _anchorPos2,
23436
+ "flex-end": _anchorPos2 + s.crossLen,
23437
+ center: _anchorPos2 + s.crossLen / 2
23438
+ };
23439
+ _this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, _anchorPos2 += s.crossLen + 2 * padding;
23477
23440
  });
23478
23441
  } else if ("space-between" === alignContent) {
23479
23442
  lastIdx = 0;
23480
23443
  var _padding = Math.max(0, (cross.len - crossLen) / (2 * mainList.length - 2));
23481
- var _anchorPos5 = 0;
23444
+ var _anchorPos3 = 0;
23482
23445
  mainList.forEach(function (s, i) {
23483
- _this.layoutCross(children, "flex-start", cross, _anchorPos5, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, _anchorPos5 += s.crossLen + 2 * _padding;
23446
+ var anchorPosMap = {
23447
+ "flex-start": _anchorPos3,
23448
+ "flex-end": _anchorPos3 + s.crossLen,
23449
+ center: _anchorPos3 + s.crossLen / 2
23450
+ };
23451
+ _this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, _anchorPos3 += s.crossLen + 2 * _padding;
23484
23452
  });
23485
23453
  }
23486
23454
  children.forEach(function (child, idx) {
23487
23455
  child.addUpdateBoundTag(), child.addUpdatePositionTag(), child.clearUpdateLayoutTag();
23488
- }), p.addUpdateLayoutTag(), clip || this.tempBounds.equals(p.AABBBounds) || (this.tryLayout(p), this.layouting = !1);
23456
+ }), p.addUpdateLayoutTag();
23457
+ var b = this.getAABBBounds(p);
23458
+ clip || this.tempBounds.equals(b) || this.tryLayout(p, !1);
23459
+ }
23460
+ }, {
23461
+ key: "getAABBBounds",
23462
+ value: function getAABBBounds(graphic) {
23463
+ this.skipBoundsTrigger = !0;
23464
+ var b = graphic.AABBBounds;
23465
+ return this.skipBoundsTrigger = !1, b;
23466
+ }
23467
+ }, {
23468
+ key: "updateChildPos",
23469
+ value: function updateChildPos(posBaseLeftTop, lastP, lastBP) {
23470
+ return posBaseLeftTop + (null != lastP ? lastP : 0) - lastBP;
23489
23471
  }
23490
23472
  }, {
23491
23473
  key: "layoutMain",
23492
23474
  value: function layoutMain(p, children, justifyContent, main, mianLenArray, lastIdx, currSeg) {
23493
23475
  if ("flex-start" === justifyContent) {
23494
23476
  var pos = 0;
23495
- for (var i = lastIdx; i <= currSeg.idx; i++) children[i].attribute[main.field] = pos + getPadding(children[i], main.field), pos += mianLenArray[i].mainLen;
23477
+ for (var i = lastIdx; i <= currSeg.idx; i++) {
23478
+ var posBaseLeftTop = pos + getPadding(children[i], main.field),
23479
+ b = this.getAABBBounds(children[i]);
23480
+ !b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b["".concat(main.field, "1")])), pos += mianLenArray[i].mainLen;
23481
+ }
23496
23482
  } else if ("flex-end" === justifyContent) {
23497
23483
  var _pos = main.len;
23498
- for (var _i = lastIdx; _i <= currSeg.idx; _i++) _pos -= mianLenArray[_i].mainLen, children[_i].attribute[main.field] = _pos + getPadding(children[_i], main.field);
23484
+ for (var _i = lastIdx; _i <= currSeg.idx; _i++) {
23485
+ _pos -= mianLenArray[_i].mainLen;
23486
+ var _posBaseLeftTop = _pos + getPadding(children[_i], main.field),
23487
+ _b = this.getAABBBounds(children[_i]);
23488
+ !_b.empty() && (children[_i].attribute[main.field] = this.updateChildPos(_posBaseLeftTop, children[_i].attribute[main.field], _b["".concat(main.field, "1")]));
23489
+ }
23499
23490
  } else if ("space-around" === justifyContent) {
23500
23491
  if (currSeg.mainLen >= main.len) {
23501
23492
  var _pos2 = 0;
23502
- for (var _i2 = lastIdx; _i2 <= currSeg.idx; _i2++) children[_i2].attribute[main.field] = _pos2 + getPadding(children[_i2], main.field), _pos2 += mianLenArray[_i2].mainLen;
23493
+ for (var _i2 = lastIdx; _i2 <= currSeg.idx; _i2++) {
23494
+ var _posBaseLeftTop2 = _pos2 + getPadding(children[_i2], main.field),
23495
+ _b2 = this.getAABBBounds(children[_i2]);
23496
+ !_b2.empty() && (children[_i2].attribute[main.field] = this.updateChildPos(_posBaseLeftTop2, children[_i2].attribute[main.field], _b2["".concat(main.field, "1")])), _pos2 += mianLenArray[_i2].mainLen;
23497
+ }
23503
23498
  } else {
23504
23499
  var size = currSeg.idx - lastIdx + 1,
23505
23500
  padding = (main.len - currSeg.mainLen) / size / 2;
23506
23501
  var _pos3 = padding;
23507
- for (var _i3 = lastIdx; _i3 <= currSeg.idx; _i3++) children[_i3].attribute[main.field] = _pos3 + getPadding(children[_i3], main.field), _pos3 += mianLenArray[_i3].mainLen + 2 * padding;
23502
+ for (var _i3 = lastIdx; _i3 <= currSeg.idx; _i3++) {
23503
+ var _posBaseLeftTop3 = _pos3 + getPadding(children[_i3], main.field),
23504
+ _b3 = this.getAABBBounds(children[_i3]);
23505
+ !_b3.empty() && (children[_i3].attribute[main.field] = this.updateChildPos(_posBaseLeftTop3, children[_i3].attribute[main.field], _b3["".concat(main.field, "1")])), _pos3 += mianLenArray[_i3].mainLen + 2 * padding;
23506
+ }
23508
23507
  }
23509
23508
  } else if ("space-between" === justifyContent) {
23510
23509
  if (currSeg.mainLen >= main.len) {
23511
23510
  var _pos4 = 0;
23512
- for (var _i4 = lastIdx; _i4 <= currSeg.idx; _i4++) children[_i4].attribute[main.field] = _pos4 + getPadding(children[_i4], main.field), _pos4 += mianLenArray[_i4].mainLen;
23511
+ for (var _i4 = lastIdx; _i4 <= currSeg.idx; _i4++) {
23512
+ var _posBaseLeftTop4 = _pos4 + getPadding(children[_i4], main.field),
23513
+ _b4 = this.getAABBBounds(children[_i4]);
23514
+ !_b4.empty() && (children[_i4].attribute[main.field] = this.updateChildPos(_posBaseLeftTop4, children[_i4].attribute[main.field], _b4["".concat(main.field, "1")])), _pos4 += mianLenArray[_i4].mainLen;
23515
+ }
23513
23516
  } else {
23514
23517
  var _size = currSeg.idx - lastIdx + 1,
23515
23518
  _padding2 = (main.len - currSeg.mainLen) / (2 * _size - 2);
23516
23519
  var _pos5 = 0;
23517
- for (var _i5 = lastIdx; _i5 <= currSeg.idx; _i5++) children[_i5].attribute[main.field] = _pos5 + getPadding(children[_i5], main.field), _pos5 += mianLenArray[_i5].mainLen + 2 * _padding2;
23520
+ for (var _i5 = lastIdx; _i5 <= currSeg.idx; _i5++) {
23521
+ var _posBaseLeftTop5 = _pos5 + getPadding(children[_i5], main.field),
23522
+ _b5 = this.getAABBBounds(children[_i5]);
23523
+ !_b5.empty() && (children[_i5].attribute[main.field] = this.updateChildPos(_posBaseLeftTop5, children[_i5].attribute[main.field], _b5["".concat(main.field, "1")])), _pos5 += mianLenArray[_i5].mainLen + 2 * _padding2;
23524
+ }
23518
23525
  }
23519
23526
  } else if ("center" === justifyContent) {
23520
23527
  var _pos6 = (main.len - currSeg.mainLen) / 2;
23521
- for (var _i6 = lastIdx; _i6 <= currSeg.idx; _i6++) children[_i6].attribute[main.field] = _pos6 + getPadding(children[_i6], main.field), _pos6 += mianLenArray[_i6].mainLen;
23528
+ for (var _i6 = lastIdx; _i6 <= currSeg.idx; _i6++) {
23529
+ var _posBaseLeftTop6 = _pos6 + getPadding(children[_i6], main.field),
23530
+ _b6 = this.getAABBBounds(children[_i6]);
23531
+ !_b6.empty() && (children[_i6].attribute[main.field] = this.updateChildPos(_posBaseLeftTop6, children[_i6].attribute[main.field], _b6["".concat(main.field, "1")])), _pos6 += mianLenArray[_i6].mainLen;
23532
+ }
23522
23533
  }
23523
23534
  }
23524
23535
  }, {
23525
23536
  key: "layoutCross",
23526
- value: function layoutCross(children, alignItem, cross, anchorPos, lenArray, currSeg, lastIdx) {
23527
- if ("flex-end" === alignItem) for (var i = lastIdx; i <= currSeg.idx; i++) children[i].attribute[cross.field] = anchorPos - lenArray[i].crossLen + getPadding(children[i], cross.field);else if ("center" === alignItem) for (var _i7 = lastIdx; _i7 <= currSeg.idx; _i7++) children[_i7].attribute[cross.field] = anchorPos - lenArray[_i7].crossLen / 2 + getPadding(children[_i7], cross.field);else for (var _i8 = lastIdx; _i8 <= currSeg.idx; _i8++) children[_i8].attribute[cross.field] = anchorPos + getPadding(children[_i8], cross.field);
23537
+ value: function layoutCross(children, alignItem, cross, anchorPosMap, lenArray, currSeg, lastIdx) {
23538
+ var _a;
23539
+ for (var i = lastIdx; i <= currSeg.idx; i++) {
23540
+ var child = children[i];
23541
+ var alignSelf = child.attribute.alignSelf;
23542
+ alignSelf && "auto" !== alignSelf || (alignSelf = alignItem);
23543
+ var b = this.getAABBBounds(child),
23544
+ anchorPos = null !== (_a = anchorPosMap[alignSelf]) && void 0 !== _a ? _a : anchorPosMap["flex-start"];
23545
+ "flex-end" === alignSelf ? !b.empty() && (child.attribute[cross.field] = this.updateChildPos(anchorPos - lenArray[i].crossLen + getPadding(child, cross.field), child.attribute[cross.field], b["".concat(cross.field, "1")])) : "center" === alignSelf ? !b.empty() && (child.attribute[cross.field] = this.updateChildPos(anchorPos - lenArray[i].crossLen / 2 + getPadding(child, cross.field), child.attribute[cross.field], b["".concat(cross.field, "1")])) : !b.empty() && (child.attribute[cross.field] = this.updateChildPos(anchorPos + getPadding(child, cross.field), child.attribute[cross.field], b["".concat(cross.field, "1")]));
23546
+ }
23528
23547
  }
23529
23548
  }, {
23530
23549
  key: "activate",
23531
23550
  value: function activate(context) {
23532
23551
  var _this2 = this;
23533
23552
  this.pluginService = context, application.graphicService.hooks.onAttributeUpdate.tap(this.key, function (graphic) {
23534
- graphic.glyphHost && (graphic = graphic.glyphHost), _this2.tryLayout(graphic), _this2.layouting = !1;
23553
+ graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage && graphic.stage === _this2.pluginService.stage && _this2.tryLayout(graphic, !1);
23535
23554
  }), application.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, function (graphic, stage, willUpdate, bounds) {
23536
- graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === _this2.pluginService.stage && graphic.isContainer && _tempBounds.copy(bounds);
23555
+ graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === _this2.pluginService.stage && graphic.isContainer && !_this2.skipBoundsTrigger && _tempBounds.copy(bounds);
23537
23556
  }), application.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, function (graphic, stage, bounds, params, selfChange) {
23538
- stage && stage === _this2.pluginService.stage && graphic.isContainer && (_tempBounds.equals(bounds) || (_this2.tryLayout(graphic), _this2.layouting = !1));
23557
+ stage && stage === _this2.pluginService.stage && graphic.isContainer && !_this2.skipBoundsTrigger && (_tempBounds.equals(bounds) || _this2.tryLayout(graphic, !1));
23539
23558
  }), application.graphicService.hooks.onSetStage.tap(this.key, function (graphic) {
23540
- graphic.glyphHost && (graphic = graphic.glyphHost), _this2.tryLayout(graphic), _this2.layouting = !1;
23559
+ graphic.glyphHost && (graphic = graphic.glyphHost), _this2.tryLayout(graphic, !1);
23541
23560
  });
23542
23561
  }
23543
23562
  }, {
@@ -23546,6 +23565,10 @@
23546
23565
  var _this3 = this;
23547
23566
  application.graphicService.hooks.onAttributeUpdate.taps = application.graphicService.hooks.onAttributeUpdate.taps.filter(function (item) {
23548
23567
  return item.name !== _this3.key;
23568
+ }), application.graphicService.hooks.beforeUpdateAABBBounds.taps = application.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(function (item) {
23569
+ return item.name !== _this3.key;
23570
+ }), application.graphicService.hooks.afterUpdateAABBBounds.taps = application.graphicService.hooks.afterUpdateAABBBounds.taps.filter(function (item) {
23571
+ return item.name !== _this3.key;
23549
23572
  }), application.graphicService.hooks.onSetStage.taps = application.graphicService.hooks.onSetStage.taps.filter(function (item) {
23550
23573
  return item.name !== _this3.key;
23551
23574
  });
@@ -23554,11 +23577,7 @@
23554
23577
  return FlexLayoutPlugin;
23555
23578
  }();
23556
23579
  function getPadding(graphic, field) {
23557
- if (!graphic.attribute.boundsPadding) return 0;
23558
- if (isNumber(graphic.attribute.boundsPadding)) return graphic.attribute.boundsPadding;
23559
- if (isArray$1(graphic.attribute.boundsPadding) && 1 === graphic.attribute.boundsPadding.length) return graphic.attribute.boundsPadding[0];
23560
- var paddingArray = parsePadding(graphic.attribute.boundsPadding);
23561
- return "x" === field ? paddingArray[3] : "y" === field ? paddingArray[0] : 0;
23580
+ return 0;
23562
23581
  }
23563
23582
 
23564
23583
  var defaultTicker = new DefaultTicker();
@@ -24082,6 +24101,11 @@
24082
24101
  _this7.pluginService.unRegister(plugin);
24083
24102
  }));
24084
24103
  }
24104
+ }, {
24105
+ key: "getPluginsByName",
24106
+ value: function getPluginsByName(name) {
24107
+ return this.pluginService.findPluginsByName(name);
24108
+ }
24085
24109
  }, {
24086
24110
  key: "tryUpdateAABBBounds",
24087
24111
  value: function tryUpdateAABBBounds() {
@@ -24132,7 +24156,7 @@
24132
24156
  value: function render(layers, params) {
24133
24157
  this.ticker.start(), this.timeline.resume();
24134
24158
  var state = this.state;
24135
- this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this.renderLayerList(this.children), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear(), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
24159
+ this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this.renderLayerList(this.children, params), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear(), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
24136
24160
  }
24137
24161
  }, {
24138
24162
  key: "combineLayersToWindow",
@@ -24169,7 +24193,8 @@
24169
24193
  background: layer === _this10.defaultLayer ? _this10.background : void 0,
24170
24194
  updateBounds: !(!_this10.dirtyBounds || _this10.dirtyBounds.empty())
24171
24195
  }, Object.assign({
24172
- renderStyle: _this10.renderStyle
24196
+ renderStyle: _this10.renderStyle,
24197
+ keepMatrix: _this10.params.renderKeepMatrix
24173
24198
  }, params)));
24174
24199
  }), this.interactiveLayer && !layerList.includes(this.interactiveLayer) && this.interactiveLayer.render({
24175
24200
  renderService: this.renderService,
@@ -25071,11 +25096,17 @@
25071
25096
  if (!params.bounds.contains(point.x, point.y)) return result;
25072
25097
  offsetX = params.bounds.x1, offsetY = params.bounds.y1;
25073
25098
  }
25074
- this.pickContext && (this.pickContext.inuse = !0), params.pickContext = this.pickContext, this.pickContext && this.pickContext.clearMatrix(!0, 1);
25099
+ if (this.pickContext) if (params.keepMatrix) {
25100
+ if (this.pickContext.nativeContext && this.pickContext.nativeContext.getTransform) {
25101
+ var t = this.pickContext.nativeContext.getTransform();
25102
+ this.pickContext.setTransformFromMatrix(t, !0, 1);
25103
+ }
25104
+ } else this.pickContext.inuse = !0, this.pickContext.clearMatrix(!0, 1);
25105
+ params.pickContext = this.pickContext;
25075
25106
  var parentMatrix = new Matrix(1, 0, 0, 1, offsetX, offsetY);
25076
25107
  var group;
25077
25108
  for (var i = graphics.length - 1; i >= 0 && (result = graphics[i].isContainer ? this.pickGroup(graphics[i], point, parentMatrix, params) : this.pickItem(graphics[i], point, parentMatrix, params), !result.graphic); i--) group || (group = result.group);
25078
- if (result.graphic || (result.group = group), this.pickContext && (this.pickContext.inuse = !1), result.graphic) {
25109
+ if (result.graphic || (result.group = group), this.pickContext && !params.keepMatrix && (this.pickContext.inuse = !1), result.graphic) {
25079
25110
  var g = result.graphic;
25080
25111
  for (; g.parent;) g = g.parent;
25081
25112
  g.shadowHost && (result.params = {
@@ -28984,9 +29015,9 @@
28984
29015
  }
28985
29016
  children.length && flatten(1 === children.length ? children[0] : children, childrenList);
28986
29017
  var g = "Group" === c.name ? new c(attribute) : c(config);
28987
- return parseToGraphic(g, childrenList, props), stateProxy && (g.stateProxy = stateProxy), g;
29018
+ return parseToGraphic$1(g, childrenList, props), stateProxy && (g.stateProxy = stateProxy), g;
28988
29019
  }
28989
- function parseToGraphic(g, childrenList, props) {
29020
+ function parseToGraphic$1(g, childrenList, props) {
28990
29021
  var out,
28991
29022
  isGraphic = !1;
28992
29023
  switch (g.type) {
@@ -29012,6 +29043,47 @@
29012
29043
  }
29013
29044
  var Fragment = Group;
29014
29045
 
29046
+ function decodeReactDom(dom) {
29047
+ if (!dom || !dom.$$typeof) return dom;
29048
+ var type = dom.type,
29049
+ _dom$props = dom.props,
29050
+ attribute = _dom$props.attribute,
29051
+ children = _dom$props.children,
29052
+ stateProxy = _dom$props.stateProxy,
29053
+ g = type({
29054
+ attribute: attribute
29055
+ }),
29056
+ out = parseToGraphic(g, dom.props, children);
29057
+ return out || (stateProxy && (g.stateProxy = stateProxy), g.id = attribute.id, g.name = attribute.name, isArray$1(children) ? children.forEach(function (item) {
29058
+ var c = decodeReactDom(item);
29059
+ c && c.type && g.add(c);
29060
+ }) : children && g.add(decodeReactDom(children)), g);
29061
+ }
29062
+ function parseToGraphic(g, props, childrenList) {
29063
+ var out,
29064
+ isGraphic = !1;
29065
+ switch (g.type) {
29066
+ case "richtext":
29067
+ break;
29068
+ case "rich/text":
29069
+ out = g.attribute || {}, childrenList && (out.text = childrenList), g.attribute = out;
29070
+ break;
29071
+ case "rich/image":
29072
+ out = g.attribute || {};
29073
+ break;
29074
+ default:
29075
+ isGraphic = !0;
29076
+ }
29077
+ return isGraphic ? Object.keys(props).forEach(function (k) {
29078
+ var en = REACT_TO_CANOPUS_EVENTS[k];
29079
+ en && g.on(en, props[k]);
29080
+ }) : "richtext" === g.type && (g.attribute.textConfig = childrenList.map(function (item) {
29081
+ return decodeReactDom(item);
29082
+ }).filter(function (item) {
29083
+ return item;
29084
+ })), out;
29085
+ }
29086
+
29015
29087
  var DragNDrop = /*#__PURE__*/function () {
29016
29088
  function DragNDrop(rootNode) {
29017
29089
  var _this = this;
@@ -33463,7 +33535,7 @@
33463
33535
  x += _point.x, y += _point.y, pickContext.setTransformForCurrent();
33464
33536
  } else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
33465
33537
  var picked = !0;
33466
- if (!onlyTranslate || rect.shadowRoot || isNumber$2(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(function (num) {
33538
+ if (!onlyTranslate || rect.shadowRoot || isNumber$1(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(function (num) {
33467
33539
  return 0 !== num;
33468
33540
  })) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, function (context, rectAttribute, themeAttribute) {
33469
33541
  return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
@@ -33541,7 +33613,7 @@
33541
33613
  x += _point.x, y += _point.y, pickContext.setTransformForCurrent();
33542
33614
  } else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
33543
33615
  var picked = !0;
33544
- if (!onlyTranslate || isNumber$2(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(function (num) {
33616
+ if (!onlyTranslate || isNumber$1(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(function (num) {
33545
33617
  return 0 !== num;
33546
33618
  })) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, function (context, rectAttribute, themeAttribute) {
33547
33619
  return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
@@ -34908,7 +34980,7 @@
34908
34980
 
34909
34981
  var roughModule = _roughModule;
34910
34982
 
34911
- const version = "0.17.19-alpha.1";
34983
+ const version = "0.17.20-alpha.1";
34912
34984
  preLoadAllModule();
34913
34985
  if (isBrowserEnv()) {
34914
34986
  loadBrowserEnv(container);
@@ -34959,7 +35031,6 @@
34959
35031
  exports.BoundsContext = BoundsContext;
34960
35032
  exports.BoundsPicker = BoundsPicker;
34961
35033
  exports.CIRCLE_NUMBER_TYPE = CIRCLE_NUMBER_TYPE;
34962
- exports.Canvas3DDrawItemInterceptor = Canvas3DDrawItemInterceptor;
34963
35034
  exports.CanvasFactory = CanvasFactory;
34964
35035
  exports.CanvasTextLayout = CanvasTextLayout;
34965
35036
  exports.CbAnimate = CbAnimate;
@@ -34981,7 +35052,6 @@
34981
35052
  exports.CustomEvent = CustomEvent;
34982
35053
  exports.CustomPath2D = CustomPath2D;
34983
35054
  exports.CustomSymbolClass = CustomSymbolClass;
34984
- exports.DebugDrawItemInterceptorContribution = DebugDrawItemInterceptorContribution;
34985
35055
  exports.DefaultArcAllocate = DefaultArcAllocate;
34986
35056
  exports.DefaultArcAttribute = DefaultArcAttribute;
34987
35057
  exports.DefaultArcRenderContribution = DefaultArcRenderContribution;
@@ -35035,7 +35105,6 @@
35035
35105
  exports.DefaultTransform = DefaultTransform;
35036
35106
  exports.DragNDrop = DragNDrop;
35037
35107
  exports.DrawContribution = DrawContribution;
35038
- exports.DrawItemInterceptor = DrawItemInterceptor;
35039
35108
  exports.DynamicLayerHandlerContribution = DynamicLayerHandlerContribution;
35040
35109
  exports.EnvContribution = EnvContribution;
35041
35110
  exports.EventManager = EventManager;
@@ -35074,7 +35143,6 @@
35074
35143
  exports.IncreaseCount = IncreaseCount;
35075
35144
  exports.IncrementalDrawContribution = IncrementalDrawContribution;
35076
35145
  exports.InputText = InputText;
35077
- exports.InteractiveDrawItemInterceptorContribution = InteractiveDrawItemInterceptorContribution;
35078
35146
  exports.InteractiveSubRenderContribution = InteractiveSubRenderContribution;
35079
35147
  exports.LINE_NUMBER_TYPE = LINE_NUMBER_TYPE;
35080
35148
  exports.Layer = Layer;
@@ -35136,7 +35204,6 @@
35136
35204
  exports.SYMBOL_NUMBER_TYPE = SYMBOL_NUMBER_TYPE;
35137
35205
  exports.SegContext = SegContext;
35138
35206
  exports.ShadowRoot = ShadowRoot;
35139
- exports.ShadowRootDrawItemInterceptorContribution = ShadowRootDrawItemInterceptorContribution;
35140
35207
  exports.Stage = Stage;
35141
35208
  exports.StaticLayerHandlerContribution = StaticLayerHandlerContribution;
35142
35209
  exports.Step = Step$1;
@@ -35243,6 +35310,7 @@
35243
35310
  exports.cubicLength = cubicLength;
35244
35311
  exports.cubicPointAt = cubicPointAt;
35245
35312
  exports.cubicSubdivide = cubicSubdivide;
35313
+ exports.decodeReactDom = decodeReactDom;
35246
35314
  exports.defaultArcAllocate = defaultArcAllocate;
35247
35315
  exports.defaultArcBackgroundRenderContribution = defaultArcBackgroundRenderContribution;
35248
35316
  exports.defaultArcRenderContribution = defaultArcRenderContribution;