@visactor/vstory 0.0.23-alpha.10 → 0.0.23-alpha.12
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 +908 -882
- package/dist/index.min.js +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1327,7 +1327,7 @@
|
|
|
1327
1327
|
var DefaultGlobal$1 = /*#__PURE__*/function () {
|
|
1328
1328
|
function DefaultGlobal(contributions) {
|
|
1329
1329
|
_classCallCheck(this, DefaultGlobal);
|
|
1330
|
-
this.contributions = contributions, this.id = Generator$1.GenAutoIncrementId(), this.hooks = {
|
|
1330
|
+
this.contributions = contributions, this._isImageAnonymous = !0, this.id = Generator$1.GenAutoIncrementId(), this.hooks = {
|
|
1331
1331
|
onSetEnv: new SyncHook$1(["lastEnv", "env", "global"])
|
|
1332
1332
|
}, this.measureTextMethod = "native", this.optimizeVisible = !1;
|
|
1333
1333
|
}
|
|
@@ -1336,6 +1336,14 @@
|
|
|
1336
1336
|
get: function get() {
|
|
1337
1337
|
return this._env;
|
|
1338
1338
|
}
|
|
1339
|
+
}, {
|
|
1340
|
+
key: "isImageAnonymous",
|
|
1341
|
+
get: function get() {
|
|
1342
|
+
return this._isImageAnonymous;
|
|
1343
|
+
},
|
|
1344
|
+
set: function set(isImageAnonymous) {
|
|
1345
|
+
this._isImageAnonymous = isImageAnonymous;
|
|
1346
|
+
}
|
|
1339
1347
|
}, {
|
|
1340
1348
|
key: "devicePixelRatio",
|
|
1341
1349
|
get: function get() {
|
|
@@ -6455,7 +6463,7 @@
|
|
|
6455
6463
|
default:
|
|
6456
6464
|
if (this._t <= 0) this.context.lineTo(this._x, y, !1 !== this._lastDefined && !1 !== p.defined, this.lastPoint), this.context.lineTo(x, y, !1 !== this._lastDefined && !1 !== p.defined, p);else {
|
|
6457
6465
|
var x1 = this._x * (1 - this._t) + x * this._t;
|
|
6458
|
-
this.context.lineTo(x1, this._y, !1 !== this._lastDefined && !1 !== p.defined, this.lastPoint), this.context.lineTo(x1, y, !1 !== this._lastDefined && !1 !== p.defined, p);
|
|
6466
|
+
.5 === this._t ? this.context.lineTo(x1, this._y, !1 !== this._lastDefined, this.lastPoint) : this.context.lineTo(x1, this._y, !1 !== this._lastDefined && !1 !== p.defined, this.lastPoint), this.context.lineTo(x1, y, !1 !== this._lastDefined && !1 !== p.defined, p);
|
|
6459
6467
|
}
|
|
6460
6468
|
}
|
|
6461
6469
|
this._lastDefined = p.defined, this._x = x, this._y = y, this.lastPoint = p;
|
|
@@ -7423,6 +7431,7 @@
|
|
|
7423
7431
|
var DefaultRichTextAttribute$1 = Object.assign(Object.assign(Object.assign({}, DefaultAttribute$1), DefaultTextStyle$1), {
|
|
7424
7432
|
editable: !1,
|
|
7425
7433
|
editOptions: null,
|
|
7434
|
+
ascentDescentMode: "actual",
|
|
7426
7435
|
width: 300,
|
|
7427
7436
|
height: 300,
|
|
7428
7437
|
ellipsis: !0,
|
|
@@ -7891,14 +7900,17 @@
|
|
|
7891
7900
|
return i + 1;
|
|
7892
7901
|
}
|
|
7893
7902
|
function measureTextCanvas$1(text, character) {
|
|
7903
|
+
var mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "actual";
|
|
7894
7904
|
var measurement = application$1.graphicUtil.textMeasure.measureText(text, character),
|
|
7895
7905
|
result = {
|
|
7896
7906
|
ascent: 0,
|
|
7897
7907
|
height: 0,
|
|
7898
7908
|
descent: 0,
|
|
7899
7909
|
width: 0
|
|
7900
|
-
}
|
|
7901
|
-
|
|
7910
|
+
},
|
|
7911
|
+
ascent = "actual" === mode ? measurement.actualBoundingBoxAscent : measurement.fontBoundingBoxAscent,
|
|
7912
|
+
descent = "actual" === mode ? measurement.actualBoundingBoxDescent : measurement.fontBoundingBoxDescent;
|
|
7913
|
+
return "number" != typeof ascent || "number" != typeof descent ? (result.width = Math.floor(measurement.width), result.height = character.fontSize || 0, result.ascent = result.height, result.descent = 0) : (result.width = Math.floor(measurement.width), result.height = Math.floor(ascent + descent), result.ascent = Math.floor(ascent), result.descent = result.height - result.ascent), result;
|
|
7902
7914
|
}
|
|
7903
7915
|
|
|
7904
7916
|
var __decorate$2o = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
@@ -8886,7 +8898,7 @@
|
|
|
8886
8898
|
});
|
|
8887
8899
|
}
|
|
8888
8900
|
var globalThemeObj$1 = newThemeObj$1();
|
|
8889
|
-
var Theme$
|
|
8901
|
+
var Theme$2 = /*#__PURE__*/function () {
|
|
8890
8902
|
function Theme() {
|
|
8891
8903
|
_classCallCheck(this, Theme);
|
|
8892
8904
|
this.initTheme(), this.dirty = !1;
|
|
@@ -8964,7 +8976,7 @@
|
|
|
8964
8976
|
}
|
|
8965
8977
|
}]);
|
|
8966
8978
|
}();
|
|
8967
|
-
var globalTheme$1 = new Theme$
|
|
8979
|
+
var globalTheme$1 = new Theme$2();
|
|
8968
8980
|
function getTheme$2(graphic, theme) {
|
|
8969
8981
|
return graphic.glyphHost ? getTheme$2(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup$1(graphic) || graphic.attachedThemeGraphic && getTheme$2(graphic.attachedThemeGraphic) || globalTheme$1.getTheme();
|
|
8970
8982
|
}
|
|
@@ -10957,7 +10969,7 @@
|
|
|
10957
10969
|
var timeline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTimeline$1;
|
|
10958
10970
|
var slience = arguments.length > 2 ? arguments[2] : undefined;
|
|
10959
10971
|
_classCallCheck(this, Animate);
|
|
10960
|
-
this.id = id, this.timeline = timeline, this.status = AnimateStatus$1.INITIAL, this.tailAnimate = new SubAnimate$1(this), this.subAnimates = [this.tailAnimate], this.timeScale = 1, this.rawPosition = -1, this._startTime = 0, this._duringTime = 0, this.timeline.addAnimate(this), this.slience = slience;
|
|
10972
|
+
this.id = id, this.timeline = timeline || defaultTimeline$1, this.status = AnimateStatus$1.INITIAL, this.tailAnimate = new SubAnimate$1(this), this.subAnimates = [this.tailAnimate], this.timeScale = 1, this.rawPosition = -1, this._startTime = 0, this._duringTime = 0, this.timeline.addAnimate(this), this.slience = slience;
|
|
10961
10973
|
}
|
|
10962
10974
|
return _createClass(Animate, [{
|
|
10963
10975
|
key: "setTimeline",
|
|
@@ -11581,7 +11593,8 @@
|
|
|
11581
11593
|
}, {
|
|
11582
11594
|
key: "onUpdate",
|
|
11583
11595
|
value: function onUpdate(end, ratio, out) {
|
|
11584
|
-
|
|
11596
|
+
var _a;
|
|
11597
|
+
!1 !== this.valid && (out.text = end ? null === (_a = this.to) || void 0 === _a ? void 0 : _a.text : (this.fromNumber + (this.toNumber - this.fromNumber) * ratio).toFixed(this.decimalLength));
|
|
11585
11598
|
}
|
|
11586
11599
|
}]);
|
|
11587
11600
|
}(ACustomAnimate$1);
|
|
@@ -12248,7 +12261,7 @@
|
|
|
12248
12261
|
key: "GetFile",
|
|
12249
12262
|
value: function GetFile(url, type) {
|
|
12250
12263
|
var data = ResourceLoader.cache.get(url);
|
|
12251
|
-
return data ? "
|
|
12264
|
+
return data ? "fail" === data.loadState ? Promise.reject() : "init" === data.loadState || "loading" === data.loadState ? data.dataPromise.then(function (data) {
|
|
12252
12265
|
return data.data;
|
|
12253
12266
|
}) : Promise.resolve(data.data) : (data = {
|
|
12254
12267
|
type: type,
|
|
@@ -13613,12 +13626,12 @@
|
|
|
13613
13626
|
}, {
|
|
13614
13627
|
key: "setTheme",
|
|
13615
13628
|
value: function setTheme(t) {
|
|
13616
|
-
return this.theme || (this.theme = new Theme$
|
|
13629
|
+
return this.theme || (this.theme = new Theme$2()), this.theme.setTheme(t, this);
|
|
13617
13630
|
}
|
|
13618
13631
|
}, {
|
|
13619
13632
|
key: "createTheme",
|
|
13620
13633
|
value: function createTheme() {
|
|
13621
|
-
this.theme || (this.theme = new Theme$
|
|
13634
|
+
this.theme || (this.theme = new Theme$2());
|
|
13622
13635
|
}
|
|
13623
13636
|
}, {
|
|
13624
13637
|
key: "visibleAll",
|
|
@@ -13658,7 +13671,7 @@
|
|
|
13658
13671
|
application$1.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
|
|
13659
13672
|
var selfChange = this.shouldSelfChangeUpdateAABBBounds(),
|
|
13660
13673
|
bounds = this.doUpdateAABBBounds();
|
|
13661
|
-
return this.addUpdateLayoutTag(), application$1.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, selfChange), bounds;
|
|
13674
|
+
return this.addUpdateLayoutTag(), application$1.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, selfChange), "empty" === this.attribute.boundsMode && bounds.clear(), bounds;
|
|
13662
13675
|
}
|
|
13663
13676
|
}, {
|
|
13664
13677
|
key: "doUpdateLocalMatrix",
|
|
@@ -13873,7 +13886,7 @@
|
|
|
13873
13886
|
width: _this.viewWidth,
|
|
13874
13887
|
height: _this.viewHeight,
|
|
13875
13888
|
zIndex: null !== (_a = params.zIndex) && void 0 !== _a ? _a : 0
|
|
13876
|
-
}), _this.layer = _assertThisInitialized(_this), _this.subLayers = new Map(), _this.theme = new Theme$
|
|
13889
|
+
}), _this.layer = _assertThisInitialized(_this), _this.subLayers = new Map(), _this.theme = new Theme$2(), _this.background = "rgba(0, 0, 0, 0)", _this.afterDrawCbs = [];
|
|
13877
13890
|
return _this;
|
|
13878
13891
|
}
|
|
13879
13892
|
_inherits(Layer, _Group);
|
|
@@ -16567,7 +16580,7 @@
|
|
|
16567
16580
|
}, {
|
|
16568
16581
|
key: "drawWithClipRange",
|
|
16569
16582
|
value: function drawWithClipRange(ctx, size, x, y, clipRange, z, cb) {
|
|
16570
|
-
return this.isSvg ? !!this.svgCache && (this.svgCache.forEach(function (item) {
|
|
16583
|
+
return size = this.parseSize(size), this.isSvg ? !!this.svgCache && (this.svgCache.forEach(function (item) {
|
|
16571
16584
|
item.path.drawWithClipRange(ctx, size, x, y, clipRange), cb && cb(item.path, item.attribute);
|
|
16572
16585
|
}), !1) : (this.path.drawWithClipRange(ctx, size, x, y, clipRange), !1);
|
|
16573
16586
|
}
|
|
@@ -16807,7 +16820,7 @@
|
|
|
16807
16820
|
connectedType = attribute.connectedType,
|
|
16808
16821
|
b = aabbBounds;
|
|
16809
16822
|
return points.forEach(function (p) {
|
|
16810
|
-
!1 === p.defined && "
|
|
16823
|
+
!1 === p.defined && "connect" !== connectedType || b.add(p.x, p.y);
|
|
16811
16824
|
}), b;
|
|
16812
16825
|
}
|
|
16813
16826
|
}, {
|
|
@@ -16819,7 +16832,7 @@
|
|
|
16819
16832
|
b = aabbBounds;
|
|
16820
16833
|
return segments.forEach(function (s) {
|
|
16821
16834
|
s.points.forEach(function (p) {
|
|
16822
|
-
!1 === p.defined && "
|
|
16835
|
+
!1 === p.defined && "connect" !== connectedType || b.add(p.x, p.y);
|
|
16823
16836
|
});
|
|
16824
16837
|
}), b;
|
|
16825
16838
|
}
|
|
@@ -17360,12 +17373,12 @@
|
|
|
17360
17373
|
};
|
|
17361
17374
|
}
|
|
17362
17375
|
var Paragraph$1 = /*#__PURE__*/function () {
|
|
17363
|
-
function Paragraph(text, newLine, character) {
|
|
17376
|
+
function Paragraph(text, newLine, character, ascentDescentMode) {
|
|
17364
17377
|
_classCallCheck(this, Paragraph);
|
|
17365
|
-
this.fontSize = character.fontSize || 16, this.textBaseline = character.textBaseline || "alphabetic";
|
|
17378
|
+
this.fontSize = character.fontSize || 16, this.textBaseline = character.textBaseline || "alphabetic", this.ascentDescentMode = ascentDescentMode;
|
|
17366
17379
|
var lineHeight = calculateLineHeight$1(character.lineHeight, this.fontSize);
|
|
17367
17380
|
this.lineHeight = "number" == typeof lineHeight ? lineHeight > this.fontSize ? lineHeight : this.fontSize : Math.floor(1.2 * this.fontSize), this.height = this.lineHeight;
|
|
17368
|
-
var _measureTextCanvas = measureTextCanvas$1(text, character),
|
|
17381
|
+
var _measureTextCanvas = measureTextCanvas$1(text, character, this.ascentDescentMode),
|
|
17369
17382
|
ascent = _measureTextCanvas.ascent,
|
|
17370
17383
|
height = _measureTextCanvas.height,
|
|
17371
17384
|
descent = _measureTextCanvas.descent,
|
|
@@ -17378,7 +17391,7 @@
|
|
|
17378
17391
|
return _createClass(Paragraph, [{
|
|
17379
17392
|
key: "updateWidth",
|
|
17380
17393
|
value: function updateWidth() {
|
|
17381
|
-
var _measureTextCanvas2 = measureTextCanvas$1(this.text, this.character),
|
|
17394
|
+
var _measureTextCanvas2 = measureTextCanvas$1(this.text, this.character, this.ascentDescentMode),
|
|
17382
17395
|
width = _measureTextCanvas2.width;
|
|
17383
17396
|
this.width = width, "vertical" === this.direction && (this.widthOrigin = this.width, this.width = this.heightOrigin, this.height = this.widthOrigin);
|
|
17384
17397
|
}
|
|
@@ -17396,7 +17409,7 @@
|
|
|
17396
17409
|
if ("add" === this.ellipsis) text += this.ellipsisStr, "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
|
|
17397
17410
|
var index = getStrByWithCanvas$1(text, ("vertical" === direction ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
|
|
17398
17411
|
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) {
|
|
17399
|
-
var _measureTextCanvas3 = measureTextCanvas$1(this.text.slice(index), this.character),
|
|
17412
|
+
var _measureTextCanvas3 = measureTextCanvas$1(this.text.slice(index), this.character, this.ascentDescentMode),
|
|
17400
17413
|
width = _measureTextCanvas3.width;
|
|
17401
17414
|
"vertical" === direction || (left -= this.ellipsisWidth - width);
|
|
17402
17415
|
}
|
|
@@ -17429,7 +17442,7 @@
|
|
|
17429
17442
|
if ("add" === this.ellipsis) text += this.ellipsisStr, "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
|
|
17430
17443
|
var index = getStrByWithCanvas$1(text, ("vertical" === direction ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
|
|
17431
17444
|
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) {
|
|
17432
|
-
var _measureTextCanvas4 = measureTextCanvas$1(this.text.slice(index), this.character),
|
|
17445
|
+
var _measureTextCanvas4 = measureTextCanvas$1(this.text.slice(index), this.character, this.ascentDescentMode),
|
|
17433
17446
|
width = _measureTextCanvas4.width;
|
|
17434
17447
|
"vertical" === direction || (left -= this.ellipsisWidth - width);
|
|
17435
17448
|
}
|
|
@@ -17449,21 +17462,21 @@
|
|
|
17449
17462
|
if (this.character.underline) {
|
|
17450
17463
|
var _top = 1 + baseline,
|
|
17451
17464
|
lrtb = getFixedLRTB(left, left + (this.widthOrigin || this.width), _top, _top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1));
|
|
17452
|
-
ctx.fillRect(lrtb.left,
|
|
17465
|
+
ctx.fillRect(lrtb.left, 1 + baseline, lrtb.right - lrtb.left, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
|
|
17453
17466
|
}
|
|
17454
17467
|
if (this.character.lineThrough) {
|
|
17455
17468
|
var _top2 = 1 + baseline - this.ascent / 2,
|
|
17456
17469
|
_lrtb = getFixedLRTB(left, left + (this.widthOrigin || this.width), _top2, _top2 + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1));
|
|
17457
|
-
ctx.fillRect(_lrtb.left,
|
|
17470
|
+
ctx.fillRect(_lrtb.left, 1 + baseline - this.ascent / 2, _lrtb.right - _lrtb.left, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
|
|
17458
17471
|
}
|
|
17459
17472
|
} else if ("underline" === this.character.textDecoration) {
|
|
17460
17473
|
var _top3 = 1 + baseline,
|
|
17461
17474
|
_lrtb2 = getFixedLRTB(left, left + (this.widthOrigin || this.width), _top3, _top3 + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1));
|
|
17462
|
-
ctx.fillRect(_lrtb2.left,
|
|
17475
|
+
ctx.fillRect(_lrtb2.left, 1 + baseline, _lrtb2.right - _lrtb2.left, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
|
|
17463
17476
|
} else if ("line-through" === this.character.textDecoration) {
|
|
17464
17477
|
var _top4 = 1 + baseline - this.ascent / 2,
|
|
17465
17478
|
_lrtb3 = getFixedLRTB(left, left + (this.widthOrigin || this.width), _top4, _top4 + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1));
|
|
17466
|
-
ctx.fillRect(_lrtb3.left,
|
|
17479
|
+
ctx.fillRect(_lrtb3.left, 1 + baseline - this.ascent / 2, _lrtb3.right - _lrtb3.left, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
|
|
17467
17480
|
}
|
|
17468
17481
|
"vertical" === direction && ctx.restore();
|
|
17469
17482
|
}
|
|
@@ -17477,7 +17490,7 @@
|
|
|
17477
17490
|
if ("replace" === this.ellipsis) {
|
|
17478
17491
|
var index = getStrByWithCanvas$1(text, width - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
|
|
17479
17492
|
text = text.slice(0, index), text += this.ellipsisStr;
|
|
17480
|
-
var _measureTextCanvas5 = measureTextCanvas$1(this.text.slice(index), this.character),
|
|
17493
|
+
var _measureTextCanvas5 = measureTextCanvas$1(this.text.slice(index), this.character, this.ascentDescentMode),
|
|
17481
17494
|
measureWidth = _measureTextCanvas5.width;
|
|
17482
17495
|
return width + this.ellipsisWidth - measureWidth;
|
|
17483
17496
|
}
|
|
@@ -17488,7 +17501,7 @@
|
|
|
17488
17501
|
function seperateParagraph$1(paragraph, index) {
|
|
17489
17502
|
var text1 = paragraph.text.slice(0, index),
|
|
17490
17503
|
text2 = paragraph.text.slice(index);
|
|
17491
|
-
return [new Paragraph$1(text1, paragraph.newLine, paragraph.character), new Paragraph$1(text2, !0, paragraph.character)];
|
|
17504
|
+
return [new Paragraph$1(text1, paragraph.newLine, paragraph.character, paragraph.ascentDescentMode), new Paragraph$1(text2, !0, paragraph.character, paragraph.ascentDescentMode)];
|
|
17492
17505
|
}
|
|
17493
17506
|
|
|
17494
17507
|
var IMAGE_UPDATE_TAG_KEY$1 = ["width", "height", "image"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY$1));
|
|
@@ -17739,7 +17752,7 @@
|
|
|
17739
17752
|
}
|
|
17740
17753
|
var ellipsis = !0 === drawEllipsis ? "..." : drawEllipsis || "";
|
|
17741
17754
|
_paragraph.ellipsisStr = ellipsis;
|
|
17742
|
-
var _measureTextCanvas = measureTextCanvas$1(ellipsis, _paragraph.character),
|
|
17755
|
+
var _measureTextCanvas = measureTextCanvas$1(ellipsis, _paragraph.character, _paragraph.ascentDescentMode),
|
|
17743
17756
|
width = _measureTextCanvas.width,
|
|
17744
17757
|
ellipsisWidth = width || 0;
|
|
17745
17758
|
if (ellipsisWidth <= this.blankWidth + otherParagraphWidth) {
|
|
@@ -17777,7 +17790,7 @@
|
|
|
17777
17790
|
for (var i = this.paragraphs.length - 1; i >= 0; i--) {
|
|
17778
17791
|
var paragraph = this.paragraphs[i];
|
|
17779
17792
|
if (paragraph instanceof RichTextIcon$1) break;
|
|
17780
|
-
var _measureTextCanvas2 = measureTextCanvas$1(ellipsis, paragraph.character),
|
|
17793
|
+
var _measureTextCanvas2 = measureTextCanvas$1(ellipsis, paragraph.character, paragraph.ascentDescentMode),
|
|
17781
17794
|
_width = _measureTextCanvas2.width,
|
|
17782
17795
|
ellipsisWidth = _width || 0;
|
|
17783
17796
|
if (ellipsisWidth <= this.blankWidth + otherParagraphWidth) {
|
|
@@ -18079,7 +18092,8 @@
|
|
|
18079
18092
|
layoutDirection = _this$attribute2.layoutDirection,
|
|
18080
18093
|
singleLine = _this$attribute2.singleLine,
|
|
18081
18094
|
disableAutoWrapLine = _this$attribute2.disableAutoWrapLine,
|
|
18082
|
-
editable = _this$attribute2.editable
|
|
18095
|
+
editable = _this$attribute2.editable,
|
|
18096
|
+
ascentDescentMode = _this$attribute2.ascentDescentMode;
|
|
18083
18097
|
var _this$attribute$textC = this.attribute.textConfig,
|
|
18084
18098
|
_tc = _this$attribute$textC === void 0 ? [] : _this$attribute$textC;
|
|
18085
18099
|
editable && _tc.length > 0 && !RichText.AllSingleCharacter(_tc) && (_tc = RichText.TransformTextConfig2SingleCharacter(_tc), this.attribute.textConfig = _tc);
|
|
@@ -18100,8 +18114,8 @@
|
|
|
18100
18114
|
var richTextConfig = this.combinedStyleToCharacter(textConfig[i]);
|
|
18101
18115
|
if (isNumber$4(richTextConfig.text) && (richTextConfig.text = "".concat(richTextConfig.text)), richTextConfig.text && richTextConfig.text.includes("\n")) {
|
|
18102
18116
|
var textParts = richTextConfig.text.split("\n");
|
|
18103
|
-
for (var j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph$1(textParts[j], 0 !== j, richTextConfig));
|
|
18104
|
-
} else richTextConfig.text && paragraphs.push(new Paragraph$1(richTextConfig.text, !1, richTextConfig));
|
|
18117
|
+
for (var j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph$1(textParts[j], 0 !== j, richTextConfig, ascentDescentMode));
|
|
18118
|
+
} else richTextConfig.text && paragraphs.push(new Paragraph$1(richTextConfig.text, !1, richTextConfig, ascentDescentMode));
|
|
18105
18119
|
}
|
|
18106
18120
|
var maxWidthFinite = "number" == typeof maxWidth && Number.isFinite(maxWidth) && maxWidth > 0,
|
|
18107
18121
|
maxHeightFinite = "number" == typeof maxHeight && Number.isFinite(maxHeight) && maxHeight > 0,
|
|
@@ -19905,8 +19919,8 @@
|
|
|
19905
19919
|
_inherits(DefaultImageRenderContribution, _DefaultRectRenderCon);
|
|
19906
19920
|
return _createClass(DefaultImageRenderContribution, [{
|
|
19907
19921
|
key: "drawShape",
|
|
19908
|
-
value: function drawShape(
|
|
19909
|
-
return _superPropGet(DefaultImageRenderContribution, "drawShape", this, 3)([
|
|
19922
|
+
value: function drawShape(image, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb) {
|
|
19923
|
+
return _superPropGet(DefaultImageRenderContribution, "drawShape", this, 3)([image, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb]);
|
|
19910
19924
|
}
|
|
19911
19925
|
}]);
|
|
19912
19926
|
}(DefaultRectRenderContribution$1);
|
|
@@ -20434,7 +20448,7 @@
|
|
|
20434
20448
|
}, {
|
|
20435
20449
|
key: "drawSegmentItem",
|
|
20436
20450
|
value: function drawSegmentItem(context, cache, fill, stroke, fillOpacity, strokeOpacity, attribute, defaultAttribute, clipRange, clipRangeByDimension, offsetX, offsetY, line, fillCb, strokeCb) {
|
|
20437
|
-
var _a
|
|
20451
|
+
var _a;
|
|
20438
20452
|
if (!cache) return;
|
|
20439
20453
|
context.beginPath();
|
|
20440
20454
|
var z = null !== (_a = this.z) && void 0 !== _a ? _a : 0;
|
|
@@ -20449,27 +20463,7 @@
|
|
|
20449
20463
|
originX = _attribute$x === void 0 ? 0 : _attribute$x,
|
|
20450
20464
|
_attribute$x2 = attribute.x,
|
|
20451
20465
|
originY = _attribute$x2 === void 0 ? 0 : _attribute$x2;
|
|
20452
|
-
!1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.stroke()));
|
|
20453
|
-
var connectedType = attribute.connectedType,
|
|
20454
|
-
connectedX = attribute.connectedX,
|
|
20455
|
-
connectedY = attribute.connectedY,
|
|
20456
|
-
connectedStyle = attribute.connectedStyle;
|
|
20457
|
-
if (isArray$3(defaultAttribute) ? (connectedType = null !== (_b = null != connectedType ? connectedType : defaultAttribute[0].connectedType) && void 0 !== _b ? _b : defaultAttribute[1].connectedType, connectedX = null !== (_c = null != connectedX ? connectedX : defaultAttribute[0].connectedX) && void 0 !== _c ? _c : defaultAttribute[1].connectedX, connectedY = null !== (_d = null != connectedY ? connectedY : defaultAttribute[0].connectedY) && void 0 !== _d ? _d : defaultAttribute[1].connectedY, connectedStyle = null !== (_e = null != connectedStyle ? connectedStyle : defaultAttribute[0].connectedStyle) && void 0 !== _e ? _e : defaultAttribute[1].connectedStyle) : (connectedType = null != connectedType ? connectedType : defaultAttribute.connectedType, connectedX = null != connectedX ? connectedX : defaultAttribute.connectedX, connectedY = null != connectedY ? connectedY : defaultAttribute.connectedY, connectedStyle = null != connectedStyle ? connectedStyle : defaultAttribute.connectedStyle), "connect" !== connectedType && "zero" !== connectedType && (connectedType = "none"), "none" !== connectedType) {
|
|
20458
|
-
context.beginPath(), drawSegments$1(context.camera ? context : context.nativeContext, cache, clipRange, clipRangeByDimension, {
|
|
20459
|
-
offsetX: offsetX,
|
|
20460
|
-
offsetY: offsetY,
|
|
20461
|
-
offsetZ: z,
|
|
20462
|
-
drawConnect: !0,
|
|
20463
|
-
mode: connectedType,
|
|
20464
|
-
zeroX: connectedX,
|
|
20465
|
-
zeroY: connectedY
|
|
20466
|
-
});
|
|
20467
|
-
var da = [];
|
|
20468
|
-
isArray$3(defaultAttribute) ? defaultAttribute.forEach(function (i) {
|
|
20469
|
-
return da.push(i);
|
|
20470
|
-
}) : da.push(defaultAttribute), da.push(attribute), !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, connectedStyle, originX - offsetX, originY - offsetY, da), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, connectedStyle, originX - offsetX, originY - offsetY, da), context.stroke()));
|
|
20471
|
-
}
|
|
20472
|
-
return !1;
|
|
20466
|
+
return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.stroke())), !1;
|
|
20473
20467
|
}
|
|
20474
20468
|
}, {
|
|
20475
20469
|
key: "drawLinearLineHighPerformance",
|
|
@@ -20510,7 +20504,9 @@
|
|
|
20510
20504
|
points = _line$attribute2.points,
|
|
20511
20505
|
closePath = _line$attribute2.closePath,
|
|
20512
20506
|
_line$attribute2$curv = _line$attribute2.curveTension,
|
|
20513
|
-
curveTension = _line$attribute2$curv === void 0 ? lineAttribute.curveTension : _line$attribute2$curv
|
|
20507
|
+
curveTension = _line$attribute2$curv === void 0 ? lineAttribute.curveTension : _line$attribute2$curv,
|
|
20508
|
+
_line$attribute2$conn = _line$attribute2.connectedType,
|
|
20509
|
+
connectedType = _line$attribute2$conn === void 0 ? lineAttribute.connectedType : _line$attribute2$conn;
|
|
20514
20510
|
if (!this.valid(line, lineAttribute, fillCb, strokeCb)) return;
|
|
20515
20511
|
var _line$attribute$curve = line.attribute.curveType,
|
|
20516
20512
|
curveType = _line$attribute$curve === void 0 ? lineAttribute.curveType : _line$attribute$curve;
|
|
@@ -20523,6 +20519,11 @@
|
|
|
20523
20519
|
if (1 === clipRange && !segments && !points.some(function (p) {
|
|
20524
20520
|
return !1 === p.defined;
|
|
20525
20521
|
}) && "linear" === curveType) return this.drawLinearLineHighPerformance(line, context, !!fill, !!stroke, fillOpacity, strokeOpacity, x, y, lineAttribute, drawContext, params, fillCb, strokeCb);
|
|
20522
|
+
function parsePoint(points, connectedType) {
|
|
20523
|
+
return "none" === connectedType ? points : points.filter(function (p) {
|
|
20524
|
+
return !1 !== p.defined;
|
|
20525
|
+
});
|
|
20526
|
+
}
|
|
20526
20527
|
if (line.shouldUpdateShape()) {
|
|
20527
20528
|
var _line$attribute4 = line.attribute,
|
|
20528
20529
|
_points2 = _line$attribute4.points,
|
|
@@ -20543,7 +20544,7 @@
|
|
|
20543
20544
|
y: lastSeg.endY,
|
|
20544
20545
|
defined: lastSeg.curves[lastSeg.curves.length - 1].defined
|
|
20545
20546
|
} : index > 1 && (startPoint.x = lastSeg.endX, startPoint.y = lastSeg.endY, startPoint.defined = lastSeg.curves[lastSeg.curves.length - 1].defined);
|
|
20546
|
-
var data = calcLineCache$1(seg.points, curveType, {
|
|
20547
|
+
var data = calcLineCache$1(parsePoint(seg.points, connectedType), curveType, {
|
|
20547
20548
|
startPoint: startPoint,
|
|
20548
20549
|
curveTension: curveTension
|
|
20549
20550
|
});
|
|
@@ -20564,7 +20565,7 @@
|
|
|
20564
20565
|
}
|
|
20565
20566
|
} else {
|
|
20566
20567
|
if (!_points2 || !_points2.length) return line.cache = null, void line.clearUpdateShapeTag();
|
|
20567
|
-
line.cache = calcLineCache$1(_points, curveType, {
|
|
20568
|
+
line.cache = calcLineCache$1(parsePoint(_points, connectedType), curveType, {
|
|
20568
20569
|
curveTension: curveTension
|
|
20569
20570
|
});
|
|
20570
20571
|
}
|
|
@@ -20601,12 +20602,6 @@
|
|
|
20601
20602
|
|
|
20602
20603
|
function drawAreaSegments$1(path, segPath, percent, params) {
|
|
20603
20604
|
var _a;
|
|
20604
|
-
var _ref = params || {},
|
|
20605
|
-
_ref$drawConnect = _ref.drawConnect,
|
|
20606
|
-
drawConnect = _ref$drawConnect === void 0 ? !1 : _ref$drawConnect,
|
|
20607
|
-
_ref$mode = _ref.mode,
|
|
20608
|
-
mode = _ref$mode === void 0 ? "none" : _ref$mode;
|
|
20609
|
-
if (drawConnect && "none" === mode) return;
|
|
20610
20605
|
var top = segPath.top,
|
|
20611
20606
|
bottom = segPath.bottom;
|
|
20612
20607
|
if (top.curves.length !== bottom.curves.length) return;
|
|
@@ -20614,36 +20609,15 @@
|
|
|
20614
20609
|
var _topList = [],
|
|
20615
20610
|
_bottomList = [];
|
|
20616
20611
|
var _lastDefined = !0;
|
|
20617
|
-
|
|
20618
|
-
var
|
|
20619
|
-
|
|
20620
|
-
_defined = !0;
|
|
20621
|
-
var n = top.curves.length;
|
|
20622
|
-
top.curves.forEach(function (curve, i) {
|
|
20623
|
-
var bototmCurve = bottom.curves[n - i - 1];
|
|
20624
|
-
var currentTopCurve = curve,
|
|
20625
|
-
currentBottomCurve = bototmCurve;
|
|
20626
|
-
if (curve.originP1 === curve.originP2) return lastCurve = curve, void (_lastBottomCurve = bototmCurve);
|
|
20627
|
-
if (lastCurve && lastCurve.originP1 === lastCurve.originP2 && (currentTopCurve = lastCurve, currentBottomCurve = _lastBottomCurve), curve.defined) _defined || (_topList.push(currentTopCurve), _bottomList.push(currentBottomCurve), drawAreaConnectBlock$1(path, _topList, _bottomList, params), _topList.length = 0, _bottomList.length = 0, _defined = !_defined);else {
|
|
20628
|
-
var originP1 = curve.originP1,
|
|
20629
|
-
originP2 = curve.originP2;
|
|
20630
|
-
var validTopCurve, validBottomCurve;
|
|
20631
|
-
originP1 && !1 !== originP1.defined ? (validTopCurve = currentTopCurve, validBottomCurve = currentBottomCurve) : originP1 && !1 !== originP2.defined && (validTopCurve = curve, validBottomCurve = bototmCurve), _defined ? (_defined = !_defined, _topList.push(validTopCurve || curve), _bottomList.push(validBottomCurve || bototmCurve)) : validTopCurve && (_defined = !_defined, _topList.push(validTopCurve || curve), _bottomList.push(validBottomCurve || bototmCurve), drawAreaConnectBlock$1(path, _topList, _bottomList, params), _topList.length = 0, _bottomList.length = 0);
|
|
20632
|
-
}
|
|
20633
|
-
lastCurve = curve;
|
|
20634
|
-
}), drawAreaConnectBlock$1(path, _topList, _bottomList, params);
|
|
20635
|
-
} else {
|
|
20636
|
-
for (var i = 0, _n = top.curves.length; i < _n; i++) {
|
|
20637
|
-
var topCurve = top.curves[i];
|
|
20638
|
-
_lastDefined !== topCurve.defined ? (_lastDefined ? (drawAreaBlock$1(path, _topList, _bottomList, params), _topList.length = 0, _bottomList.length = 0) : (_topList.push(topCurve), _bottomList.push(bottom.curves[_n - i - 1])), _lastDefined = !_lastDefined) : _lastDefined && (_topList.push(topCurve), _bottomList.push(bottom.curves[_n - i - 1]));
|
|
20639
|
-
}
|
|
20640
|
-
drawAreaBlock$1(path, _topList, _bottomList, params);
|
|
20612
|
+
for (var i = 0, n = top.curves.length; i < n; i++) {
|
|
20613
|
+
var topCurve = top.curves[i];
|
|
20614
|
+
_lastDefined !== topCurve.defined ? (_lastDefined ? (drawAreaBlock$1(path, _topList, _bottomList, params), _topList.length = 0, _bottomList.length = 0) : (_topList.push(topCurve), _bottomList.push(bottom.curves[n - i - 1])), _lastDefined = !_lastDefined) : _lastDefined && (_topList.push(topCurve), _bottomList.push(bottom.curves[n - i - 1]));
|
|
20641
20615
|
}
|
|
20642
|
-
return;
|
|
20616
|
+
return void drawAreaBlock$1(path, _topList, _bottomList, params);
|
|
20643
20617
|
}
|
|
20644
20618
|
if (percent <= 0) return;
|
|
20645
|
-
var
|
|
20646
|
-
direction =
|
|
20619
|
+
var _ref = params || {},
|
|
20620
|
+
direction = _ref.direction;
|
|
20647
20621
|
var topCurves = top.curves,
|
|
20648
20622
|
endP = null !== (_a = topCurves[topCurves.length - 1].p3) && void 0 !== _a ? _a : topCurves[topCurves.length - 1].p1,
|
|
20649
20623
|
xTotalLength = abs$2(endP.x - topCurves[0].p0.x),
|
|
@@ -20654,61 +20628,26 @@
|
|
|
20654
20628
|
lastDefined = !0;
|
|
20655
20629
|
var topList = [],
|
|
20656
20630
|
bottomList = [];
|
|
20657
|
-
var
|
|
20658
|
-
lastBottomCurve,
|
|
20659
|
-
defined0 = !0;
|
|
20660
|
-
for (var _i = 0, _n2 = top.curves.length; _i < _n2; _i++) {
|
|
20631
|
+
for (var _i = 0, _n = top.curves.length; _i < _n; _i++) {
|
|
20661
20632
|
var _topCurve = top.curves[_i],
|
|
20662
20633
|
curCurveLength = _topCurve.getLength(direction),
|
|
20663
20634
|
_percent = (totalDrawLength - drawedLengthUntilLast) / curCurveLength;
|
|
20664
20635
|
if (_percent < 0) break;
|
|
20665
|
-
|
|
20666
|
-
|
|
20667
|
-
|
|
20668
|
-
|
|
20669
|
-
if (_topCurve.originP1 === _topCurve.originP2) {
|
|
20670
|
-
lastTopCurve = _topCurve, lastBottomCurve = bototmCurve;
|
|
20671
|
-
continue;
|
|
20672
|
-
}
|
|
20673
|
-
if (lastTopCurve && lastTopCurve.originP1 === lastTopCurve.originP2 && (currentTopCurve = lastTopCurve, currentBottomCurve = lastBottomCurve), _topCurve.defined) defined0 || (topList.push(currentTopCurve), bottomList.push(currentBottomCurve), drawAreaConnectBlock$1(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0, defined0 = !defined0);else {
|
|
20674
|
-
var originP1 = _topCurve.originP1,
|
|
20675
|
-
originP2 = _topCurve.originP2;
|
|
20676
|
-
var validTopCurve = void 0,
|
|
20677
|
-
validBottomCurve = void 0;
|
|
20678
|
-
originP1 && !1 !== originP1.defined ? (validTopCurve = currentTopCurve, validBottomCurve = currentBottomCurve) : originP1 && !1 !== originP2.defined && (validTopCurve = _topCurve, validBottomCurve = bototmCurve), defined0 ? (defined0 = !defined0, topList.push(validTopCurve || _topCurve), bottomList.push(validBottomCurve || bototmCurve)) : validTopCurve && (defined0 = !defined0, topList.push(validTopCurve || _topCurve), bottomList.push(validBottomCurve || bototmCurve), drawAreaConnectBlock$1(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0);
|
|
20679
|
-
}
|
|
20680
|
-
lastTopCurve = _topCurve;
|
|
20681
|
-
} else {
|
|
20682
|
-
var tc = null,
|
|
20683
|
-
bc = null;
|
|
20684
|
-
lastDefined !== _topCurve.defined ? (lastDefined ? (drawAreaBlock$1(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0) : (tc = _topCurve, bc = bottom.curves[_n2 - _i - 1]), lastDefined = !lastDefined) : lastDefined && (tc = _topCurve, bc = bottom.curves[_n2 - _i - 1]), tc && bc && (_percent < 1 && (tc = tc.p2 && tc.p3 ? divideCubic$1(tc, _percent)[0] : divideLinear$1(tc, _percent)[0], bc = bc.p2 && bc.p3 ? divideCubic$1(bc, 1 - _percent)[1] : divideLinear$1(bc, 1 - _percent)[1]), tc.defined = lastDefined, bc.defined = lastDefined, topList.push(tc), bottomList.push(bc)), tc = null, bc = null;
|
|
20685
|
-
}
|
|
20636
|
+
drawedLengthUntilLast += curCurveLength;
|
|
20637
|
+
var tc = null,
|
|
20638
|
+
bc = null;
|
|
20639
|
+
lastDefined !== _topCurve.defined ? (lastDefined ? (drawAreaBlock$1(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0) : (tc = _topCurve, bc = bottom.curves[_n - _i - 1]), lastDefined = !lastDefined) : lastDefined && (tc = _topCurve, bc = bottom.curves[_n - _i - 1]), tc && bc && (_percent < 1 && (tc = tc.p2 && tc.p3 ? divideCubic$1(tc, _percent)[0] : divideLinear$1(tc, _percent)[0], bc = bc.p2 && bc.p3 ? divideCubic$1(bc, 1 - _percent)[1] : divideLinear$1(bc, 1 - _percent)[1]), tc.defined = lastDefined, bc.defined = lastDefined, topList.push(tc), bottomList.push(bc)), tc = null, bc = null;
|
|
20686
20640
|
}
|
|
20687
|
-
|
|
20688
|
-
}
|
|
20689
|
-
function drawAreaConnectBlock$1(path, topList, bottomList, params) {
|
|
20690
|
-
if (topList.length < 2) return;
|
|
20691
|
-
var _ref3 = params || {},
|
|
20692
|
-
_ref3$offsetX = _ref3.offsetX,
|
|
20693
|
-
offsetX = _ref3$offsetX === void 0 ? 0 : _ref3$offsetX,
|
|
20694
|
-
_ref3$offsetY = _ref3.offsetY,
|
|
20695
|
-
offsetY = _ref3$offsetY === void 0 ? 0 : _ref3$offsetY,
|
|
20696
|
-
_ref3$offsetZ = _ref3.offsetZ,
|
|
20697
|
-
offsetZ = _ref3$offsetZ === void 0 ? 0 : _ref3$offsetZ;
|
|
20698
|
-
_ref3.mode;
|
|
20699
|
-
var curve = topList[0];
|
|
20700
|
-
path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), curve = topList[topList.length - 1];
|
|
20701
|
-
var end = curve.p3 || curve.p1;
|
|
20702
|
-
path.lineTo(end.x + offsetX, end.y + offsetY, offsetZ), curve = bottomList[bottomList.length - 1], path.lineTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), curve = bottomList[0], end = curve.p3 || curve.p1, path.lineTo(end.x + offsetX, end.y + offsetY, offsetZ), path.closePath();
|
|
20641
|
+
drawAreaBlock$1(path, topList, bottomList, params);
|
|
20703
20642
|
}
|
|
20704
20643
|
function drawAreaBlock$1(path, topList, bottomList, params) {
|
|
20705
|
-
var
|
|
20706
|
-
|
|
20707
|
-
offsetX =
|
|
20708
|
-
|
|
20709
|
-
offsetY =
|
|
20710
|
-
|
|
20711
|
-
offsetZ =
|
|
20644
|
+
var _ref2 = params || {},
|
|
20645
|
+
_ref2$offsetX = _ref2.offsetX,
|
|
20646
|
+
offsetX = _ref2$offsetX === void 0 ? 0 : _ref2$offsetX,
|
|
20647
|
+
_ref2$offsetY = _ref2.offsetY,
|
|
20648
|
+
offsetY = _ref2$offsetY === void 0 ? 0 : _ref2$offsetY,
|
|
20649
|
+
_ref2$offsetZ = _ref2.offsetZ,
|
|
20650
|
+
offsetZ = _ref2$offsetZ === void 0 ? 0 : _ref2$offsetZ;
|
|
20712
20651
|
var needMoveTo = !0;
|
|
20713
20652
|
topList.forEach(function (curve) {
|
|
20714
20653
|
curve.defined ? (needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem$1(path, curve, 1, params), needMoveTo = !1) : needMoveTo = !0;
|
|
@@ -20816,6 +20755,8 @@
|
|
|
20816
20755
|
strokeOpacity = _area$attribute2$stro2 === void 0 ? areaAttribute.strokeOpacity : _area$attribute2$stro2,
|
|
20817
20756
|
_area$attribute2$curv = _area$attribute2.curveTension,
|
|
20818
20757
|
curveTension = _area$attribute2$curv === void 0 ? areaAttribute.curveTension : _area$attribute2$curv,
|
|
20758
|
+
_area$attribute2$conn = _area$attribute2.connectedType,
|
|
20759
|
+
connectedType = _area$attribute2$conn === void 0 ? areaAttribute.connectedType : _area$attribute2$conn,
|
|
20819
20760
|
data = this.valid(area, areaAttribute, fillCb, strokeCb);
|
|
20820
20761
|
if (!data) return;
|
|
20821
20762
|
var doFill = data.doFill,
|
|
@@ -20828,6 +20769,11 @@
|
|
|
20828
20769
|
segments = _area$attribute3.segments;
|
|
20829
20770
|
var _area$attribute$curve = area.attribute.curveType,
|
|
20830
20771
|
curveType = _area$attribute$curve === void 0 ? areaAttribute.curveType : _area$attribute$curve;
|
|
20772
|
+
function parsePoint(points, connectedType) {
|
|
20773
|
+
return "connect" !== connectedType ? points : points.filter(function (p) {
|
|
20774
|
+
return !1 !== p.defined;
|
|
20775
|
+
});
|
|
20776
|
+
}
|
|
20831
20777
|
if (closePath && "linear" === curveType && (curveType = "linearClosed"), 1 === clipRange && !segments && !points.some(function (p) {
|
|
20832
20778
|
return !1 === p.defined;
|
|
20833
20779
|
}) && "linear" === curveType) return this.drawLinearAreaHighPerformance(area, context, !!fill, doStroke, fillOpacity, strokeOpacity, x, y, areaAttribute, drawContext, params, fillCb, strokeCb);
|
|
@@ -20843,7 +20789,7 @@
|
|
|
20843
20789
|
x: lastTopSeg.endX,
|
|
20844
20790
|
y: lastTopSeg.endY
|
|
20845
20791
|
} : index > 1 && (startPoint.x = lastTopSeg.endX, startPoint.y = lastTopSeg.endY);
|
|
20846
|
-
var data = calcLineCache$1(seg.points, curveType, {
|
|
20792
|
+
var data = calcLineCache$1(parsePoint(seg.points, connectedType), curveType, {
|
|
20847
20793
|
startPoint: startPoint,
|
|
20848
20794
|
curveTension: curveTension
|
|
20849
20795
|
});
|
|
@@ -20868,7 +20814,7 @@
|
|
|
20868
20814
|
y: null !== (_d = endPoint.y1) && void 0 !== _d ? _d : endPoint.y
|
|
20869
20815
|
});
|
|
20870
20816
|
}
|
|
20871
|
-
bottomPoints.length > 1 && (lastBottomSeg = calcLineCache$1(bottomPoints, "stepBefore" === curveType ? "stepAfter" : "stepAfter" === curveType ? "stepBefore" : curveType, {
|
|
20817
|
+
bottomPoints.length > 1 && (lastBottomSeg = calcLineCache$1(parsePoint(bottomPoints, connectedType), "stepBefore" === curveType ? "stepAfter" : "stepAfter" === curveType ? "stepBefore" : curveType, {
|
|
20872
20818
|
curveTension: curveTension
|
|
20873
20819
|
}), bottomCaches.unshift(lastBottomSeg));
|
|
20874
20820
|
}
|
|
@@ -20881,11 +20827,11 @@
|
|
|
20881
20827
|
} else {
|
|
20882
20828
|
if (!points || !points.length) return area.cacheArea = null, void area.clearUpdateShapeTag();
|
|
20883
20829
|
{
|
|
20884
|
-
var topPoints = points,
|
|
20830
|
+
var topPoints = parsePoint(points, connectedType),
|
|
20885
20831
|
_bottomPoints = [];
|
|
20886
|
-
for (var _i5 =
|
|
20887
|
-
x: null !== (_e =
|
|
20888
|
-
y: null !== (_f =
|
|
20832
|
+
for (var _i5 = topPoints.length - 1; _i5 >= 0; _i5--) _bottomPoints.push({
|
|
20833
|
+
x: null !== (_e = topPoints[_i5].x1) && void 0 !== _e ? _e : topPoints[_i5].x,
|
|
20834
|
+
y: null !== (_f = topPoints[_i5].y1) && void 0 !== _f ? _f : topPoints[_i5].y
|
|
20889
20835
|
});
|
|
20890
20836
|
var topCache = calcLineCache$1(topPoints, curveType, {
|
|
20891
20837
|
curveTension: curveTension
|
|
@@ -20935,22 +20881,12 @@
|
|
|
20935
20881
|
}, {
|
|
20936
20882
|
key: "drawSegmentItem",
|
|
20937
20883
|
value: function drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb) {
|
|
20938
|
-
|
|
20939
|
-
return ret = ret || this._drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, !1, fillCb, strokeCb), ret = ret || this._drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, !0, fillCb, strokeCb), ret;
|
|
20884
|
+
return this._drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb);
|
|
20940
20885
|
}
|
|
20941
20886
|
}, {
|
|
20942
20887
|
key: "_drawSegmentItem",
|
|
20943
|
-
value: function _drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext,
|
|
20944
|
-
var _a, _b, _c, _d;
|
|
20888
|
+
value: function _drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb) {
|
|
20945
20889
|
if (!(cache && cache.top && cache.bottom && cache.top.curves && cache.top.curves.length && cache.bottom.curves && cache.bottom.curves.length)) return;
|
|
20946
|
-
var connectedType = attribute.connectedType,
|
|
20947
|
-
connectedX = attribute.connectedX,
|
|
20948
|
-
connectedY = attribute.connectedY,
|
|
20949
|
-
connectedStyle = attribute.connectedStyle;
|
|
20950
|
-
var da = [];
|
|
20951
|
-
if (connect && (isArray$3(defaultAttribute) ? (connectedType = null !== (_a = null != connectedType ? connectedType : defaultAttribute[0].connectedType) && void 0 !== _a ? _a : defaultAttribute[1].connectedType, connectedX = null !== (_b = null != connectedX ? connectedX : defaultAttribute[0].connectedX) && void 0 !== _b ? _b : defaultAttribute[1].connectedX, connectedY = null !== (_c = null != connectedY ? connectedY : defaultAttribute[0].connectedY) && void 0 !== _c ? _c : defaultAttribute[1].connectedY, connectedStyle = null !== (_d = null != connectedStyle ? connectedStyle : defaultAttribute[0].connectedStyle) && void 0 !== _d ? _d : defaultAttribute[1].connectedStyle) : (connectedType = null != connectedType ? connectedType : defaultAttribute.connectedType, connectedX = null != connectedX ? connectedX : defaultAttribute.connectedX, connectedY = null != connectedY ? connectedY : defaultAttribute.connectedY, connectedStyle = null != connectedStyle ? connectedStyle : defaultAttribute.connectedStyle), "connect" !== connectedType && "zero" !== connectedType && (connectedType = "none"), isArray$3(defaultAttribute) ? defaultAttribute.forEach(function (i) {
|
|
20952
|
-
return da.push(i);
|
|
20953
|
-
}) : da.push(defaultAttribute), da.push(attribute)), connect && "none" === connectedType) return !1;
|
|
20954
20890
|
context.beginPath();
|
|
20955
20891
|
var _area$attribute4 = area.attribute,
|
|
20956
20892
|
points = _area$attribute4.points,
|
|
@@ -20968,11 +20904,7 @@
|
|
|
20968
20904
|
offsetX: offsetX,
|
|
20969
20905
|
offsetY: offsetY,
|
|
20970
20906
|
offsetZ: offsetZ,
|
|
20971
|
-
direction: direction
|
|
20972
|
-
drawConnect: connect,
|
|
20973
|
-
mode: connectedType,
|
|
20974
|
-
zeroX: connectedX,
|
|
20975
|
-
zeroY: connectedY
|
|
20907
|
+
direction: direction
|
|
20976
20908
|
}), this.beforeRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
|
|
20977
20909
|
attribute: attribute
|
|
20978
20910
|
}), context.setShadowBlendStyle && context.setShadowBlendStyle(area, attribute, defaultAttribute);
|
|
@@ -20980,7 +20912,7 @@
|
|
|
20980
20912
|
originX = _attribute$x === void 0 ? 0 : _attribute$x,
|
|
20981
20913
|
_attribute$x2 = attribute.x,
|
|
20982
20914
|
originY = _attribute$x2 === void 0 ? 0 : _attribute$x2;
|
|
20983
|
-
return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(area,
|
|
20915
|
+
return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
|
|
20984
20916
|
attribute: attribute
|
|
20985
20917
|
}), function () {
|
|
20986
20918
|
if (!1 !== stroke) if (strokeCb) strokeCb(context, attribute, defaultAttribute);else {
|
|
@@ -20989,12 +20921,8 @@
|
|
|
20989
20921
|
isArray$3(_stroke2) && (_stroke2[0] || _stroke2[2]) && !1 === _stroke2[1] && (context.beginPath(), drawSegments$1(context.camera ? context : context.nativeContext, _stroke2[0] ? cache.top : cache.bottom, clipRange, direction === Direction$4.ROW ? "x" : "y", {
|
|
20990
20922
|
offsetX: offsetX,
|
|
20991
20923
|
offsetY: offsetY,
|
|
20992
|
-
offsetZ: offsetZ
|
|
20993
|
-
|
|
20994
|
-
mode: connectedType,
|
|
20995
|
-
zeroX: connectedX,
|
|
20996
|
-
zeroY: connectedY
|
|
20997
|
-
})), context.setStrokeStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.stroke();
|
|
20924
|
+
offsetZ: offsetZ
|
|
20925
|
+
})), context.setStrokeStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.stroke();
|
|
20998
20926
|
}
|
|
20999
20927
|
}(), !1;
|
|
21000
20928
|
}
|
|
@@ -22732,7 +22660,7 @@
|
|
|
22732
22660
|
var _this3 = this;
|
|
22733
22661
|
if (drawContext["break"] || !1 === group.attribute.visibleAll) return;
|
|
22734
22662
|
if (group.incremental && (null == drawContext.startAtId || drawContext.startAtId === group._uid)) return drawContext["break"] = !0, void this._increaseRender(group, drawContext);
|
|
22735
|
-
if (this.useDirtyBounds && !isRectIntersect$1(group.AABBBounds, this.dirtyBounds, !1)) return;
|
|
22663
|
+
if (this.useDirtyBounds && !isRectIntersect$1(group.AABBBounds, this.dirtyBounds, !1) && "empty" !== group.attribute.boundsMode) return;
|
|
22736
22664
|
var tempBounds,
|
|
22737
22665
|
nextM = parentMatrix;
|
|
22738
22666
|
if (this.useDirtyBounds) {
|
|
@@ -23642,7 +23570,7 @@
|
|
|
23642
23570
|
}, _this.afterTickCb = function () {
|
|
23643
23571
|
var _a;
|
|
23644
23572
|
_this.tickedBeforeRender = !0, "performance" === (null === (_a = _this.params.optimize) || void 0 === _a ? void 0 : _a.tickRenderMode) || "rendering" !== _this.state && _this.render();
|
|
23645
|
-
}, _this.params = params, _this.theme = new Theme$
|
|
23573
|
+
}, _this.params = params, _this.theme = new Theme$2(), _this.hooks = {
|
|
23646
23574
|
beforeRender: new SyncHook$1(["stage"]),
|
|
23647
23575
|
afterRender: new SyncHook$1(["stage"])
|
|
23648
23576
|
}, _this.global = application$1.global, !_this.global.env && isBrowserEnv$1() && _this.global.setEnv("browser"), _this.window = container$1.get(VWindow$1), _this.renderService = container$1.get(RenderService$1), _this.pluginService = container$1.get(PluginService$1), _this.layerService = container$1.get(LayerService$1), _this.pluginService.active(_assertThisInitialized(_this), params), _this.window.create({
|
|
@@ -25027,13 +24955,17 @@
|
|
|
25027
24955
|
textConfig = _this$currRt$attribut === void 0 ? [] : _this$currRt$attribut;
|
|
25028
24956
|
if (_this.composingConfigIdx = _this.cursorIndex < 0 ? 0 : findConfigIndexByCursorIdx(textConfig, _this.cursorIndex), _this.cursorIndex < 0) {
|
|
25029
24957
|
var config = textConfig[0];
|
|
25030
|
-
textConfig.unshift(Object.assign(Object.assign(Object.assign({
|
|
24958
|
+
textConfig.unshift(Object.assign(Object.assign(Object.assign({
|
|
24959
|
+
fill: "black"
|
|
24960
|
+
}, getDefaultCharacterConfig(_this.currRt.attribute)), config), {
|
|
25031
24961
|
text: ""
|
|
25032
24962
|
}));
|
|
25033
24963
|
} else {
|
|
25034
24964
|
var configIdx = _this.composingConfigIdx,
|
|
25035
24965
|
lastConfig = textConfig[configIdx] || textConfig[configIdx - 1];
|
|
25036
|
-
textConfig.splice(configIdx, 0, Object.assign(Object.assign({
|
|
24966
|
+
textConfig.splice(configIdx, 0, Object.assign(Object.assign({
|
|
24967
|
+
fill: "black"
|
|
24968
|
+
}, lastConfig), {
|
|
25037
24969
|
text: ""
|
|
25038
24970
|
}));
|
|
25039
24971
|
}
|
|
@@ -25436,18 +25368,16 @@
|
|
|
25436
25368
|
placeholderColor = _editOptions$placehol === void 0 ? "rgba(0, 0, 0, 0.6)" : _editOptions$placehol,
|
|
25437
25369
|
placeholderFontFamily = editOptions.placeholderFontFamily,
|
|
25438
25370
|
placeholderFontSize = editOptions.placeholderFontSize,
|
|
25439
|
-
shadow = this.
|
|
25440
|
-
|
|
25371
|
+
shadow = this.getShadow(this.currRt),
|
|
25372
|
+
textConfigItem = Object.assign(Object.assign({}, getDefaultCharacterConfig(this.currRt.attribute)), {
|
|
25373
|
+
text: placeholder
|
|
25374
|
+
});
|
|
25375
|
+
placeholderColor && (textConfigItem.fill = placeholderColor), placeholderFontFamily && (textConfigItem.fontFamily = placeholderFontFamily), placeholderFontSize && (textConfigItem.fontSize = placeholderFontSize), this.shadowPlaceHolder = createRichText$1(Object.assign(Object.assign({}, this.currRt.attribute), {
|
|
25441
25376
|
x: 0,
|
|
25442
25377
|
y: 0,
|
|
25443
25378
|
angle: 0,
|
|
25444
25379
|
_debug_bounds: !1,
|
|
25445
|
-
textConfig: [
|
|
25446
|
-
text: placeholder,
|
|
25447
|
-
fill: placeholderColor,
|
|
25448
|
-
fontFamily: placeholderFontFamily,
|
|
25449
|
-
fontSize: placeholderFontSize
|
|
25450
|
-
}]
|
|
25380
|
+
textConfig: [textConfigItem]
|
|
25451
25381
|
})), shadow.add(this.shadowPlaceHolder);
|
|
25452
25382
|
}
|
|
25453
25383
|
}, {
|
|
@@ -25473,10 +25403,9 @@
|
|
|
25473
25403
|
fill: !1,
|
|
25474
25404
|
stroke: boundsStrokeWhenInput,
|
|
25475
25405
|
lineWidth: 1,
|
|
25476
|
-
boundsMode: "empty",
|
|
25477
25406
|
zIndex: -1
|
|
25478
25407
|
});
|
|
25479
|
-
|
|
25408
|
+
this.getShadow(this.currRt).add(this.shadowBounds), this.offsetLineBgAndShadowBounds();
|
|
25480
25409
|
}
|
|
25481
25410
|
}, {
|
|
25482
25411
|
key: "trySyncPlaceholderToTextConfig",
|
|
@@ -25502,11 +25431,14 @@
|
|
|
25502
25431
|
}, {
|
|
25503
25432
|
key: "onFocus",
|
|
25504
25433
|
value: function onFocus(e, data) {
|
|
25505
|
-
|
|
25434
|
+
var _this3 = this;
|
|
25435
|
+
this.updateCbs && this.updateCbs.forEach(function (cb) {
|
|
25436
|
+
return cb("beforeOnfocus", _this3);
|
|
25437
|
+
}), this.deFocus(!1), this.focusing = !0;
|
|
25506
25438
|
var target = e.target;
|
|
25507
25439
|
if (!target || "richtext" !== target.type) return;
|
|
25508
25440
|
this.currRt = target, RichTextEditPlugin.tryUpdateRichtext(target);
|
|
25509
|
-
var shadowRoot =
|
|
25441
|
+
var shadowRoot = this.getShadow(target),
|
|
25510
25442
|
cache = target.getFrameCache();
|
|
25511
25443
|
if (cache) {
|
|
25512
25444
|
if (this.computeGlobalDelta(cache), shadowRoot.setAttributes({
|
|
@@ -25519,16 +25451,14 @@
|
|
|
25519
25451
|
x: 0,
|
|
25520
25452
|
y: 0,
|
|
25521
25453
|
lineWidth: 1,
|
|
25522
|
-
stroke: "black"
|
|
25523
|
-
boundsMode: "empty"
|
|
25454
|
+
stroke: "black"
|
|
25524
25455
|
});
|
|
25525
25456
|
this.addAnimateToLine(line), this.editLine = line, this.ticker.start(!0);
|
|
25526
25457
|
var g = createGroup$1({
|
|
25527
25458
|
x: 0,
|
|
25528
25459
|
y: 0,
|
|
25529
25460
|
width: 0,
|
|
25530
|
-
height: 0
|
|
25531
|
-
boundsMode: "empty"
|
|
25461
|
+
height: 0
|
|
25532
25462
|
});
|
|
25533
25463
|
this.editBg = g, shadowRoot.add(this.editLine), shadowRoot.add(this.editBg);
|
|
25534
25464
|
}
|
|
@@ -25581,7 +25511,13 @@
|
|
|
25581
25511
|
}, {
|
|
25582
25512
|
key: "deFocus",
|
|
25583
25513
|
value: function deFocus() {
|
|
25514
|
+
var _this4 = this;
|
|
25584
25515
|
var trulyDeFocus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
25516
|
+
this.updateCbs && this.updateCbs.forEach(function (cb) {
|
|
25517
|
+
return cb("beforeDefocus", _this4, {
|
|
25518
|
+
trulyDeFocus: trulyDeFocus
|
|
25519
|
+
});
|
|
25520
|
+
});
|
|
25585
25521
|
var target = this.currRt;
|
|
25586
25522
|
if (!target) return;
|
|
25587
25523
|
trulyDeFocus && (this.trySyncPlaceholderToTextConfig(), target.detachShadow());
|
|
@@ -25645,7 +25581,7 @@
|
|
|
25645
25581
|
value: function _tryShowSelection(currCursorData, cache) {
|
|
25646
25582
|
var _ref2,
|
|
25647
25583
|
_ref3,
|
|
25648
|
-
|
|
25584
|
+
_this5 = this;
|
|
25649
25585
|
var startCursorPos = this.startCursorPos,
|
|
25650
25586
|
endCursorPos = {
|
|
25651
25587
|
x: currCursorData.x,
|
|
@@ -25712,7 +25648,7 @@
|
|
|
25712
25648
|
}
|
|
25713
25649
|
}
|
|
25714
25650
|
this.setCursorAndTextArea(currCursorData.x, currCursorData.y1, currCursorData.y2, this.currRt), this.triggerRender(), this.updateCbs.forEach(function (cb) {
|
|
25715
|
-
return cb("selection",
|
|
25651
|
+
return cb("selection", _this5);
|
|
25716
25652
|
});
|
|
25717
25653
|
}
|
|
25718
25654
|
}, {
|
|
@@ -25722,6 +25658,14 @@
|
|
|
25722
25658
|
fill: "transparent"
|
|
25723
25659
|
}));
|
|
25724
25660
|
}
|
|
25661
|
+
}, {
|
|
25662
|
+
key: "getShadow",
|
|
25663
|
+
value: function getShadow(rt) {
|
|
25664
|
+
var sr = rt.shadowRoot || rt.attachShadow();
|
|
25665
|
+
return sr.setAttributes({
|
|
25666
|
+
boundsMode: "empty"
|
|
25667
|
+
}), sr;
|
|
25668
|
+
}
|
|
25725
25669
|
}, {
|
|
25726
25670
|
key: "getLineByPoint",
|
|
25727
25671
|
value: function getLineByPoint(cache, p1) {
|
|
@@ -28749,7 +28693,7 @@
|
|
|
28749
28693
|
function createImageElement$1(src) {
|
|
28750
28694
|
var isSvg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
28751
28695
|
var img = document.createElement("img");
|
|
28752
|
-
if (img.crossOrigin = "anonymous", isSvg) {
|
|
28696
|
+
if (application$1.global.isImageAnonymous && (img.crossOrigin = "anonymous"), isSvg) {
|
|
28753
28697
|
var data = new Blob([src], {
|
|
28754
28698
|
type: "image/svg+xml"
|
|
28755
28699
|
});
|
|
@@ -30496,6 +30440,599 @@
|
|
|
30496
30440
|
loadPyramid3dPick || (loadPyramid3dPick = !0, bind(CanvasPyramid3dPicker).to(DefaultCanvasPyramid3dPicker).inSingletonScope(), bind(CanvasPickerContribution$1).toService(CanvasPyramid3dPicker));
|
|
30497
30441
|
});
|
|
30498
30442
|
|
|
30443
|
+
var lib$2 = {};
|
|
30444
|
+
|
|
30445
|
+
var gif = {};
|
|
30446
|
+
|
|
30447
|
+
var lib$1 = {};
|
|
30448
|
+
|
|
30449
|
+
Object.defineProperty(lib$1, "__esModule", {
|
|
30450
|
+
value: true
|
|
30451
|
+
});
|
|
30452
|
+
lib$1.loop = lib$1.conditional = lib$1.parse = void 0;
|
|
30453
|
+
var parse$4 = function parse(stream, schema) {
|
|
30454
|
+
var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
30455
|
+
var parent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : result;
|
|
30456
|
+
if (Array.isArray(schema)) {
|
|
30457
|
+
schema.forEach(function (partSchema) {
|
|
30458
|
+
return parse(stream, partSchema, result, parent);
|
|
30459
|
+
});
|
|
30460
|
+
} else if (typeof schema === 'function') {
|
|
30461
|
+
schema(stream, result, parent, parse);
|
|
30462
|
+
} else {
|
|
30463
|
+
var key = Object.keys(schema)[0];
|
|
30464
|
+
if (Array.isArray(schema[key])) {
|
|
30465
|
+
parent[key] = {};
|
|
30466
|
+
parse(stream, schema[key], result, parent[key]);
|
|
30467
|
+
} else {
|
|
30468
|
+
parent[key] = schema[key](stream, result, parent, parse);
|
|
30469
|
+
}
|
|
30470
|
+
}
|
|
30471
|
+
return result;
|
|
30472
|
+
};
|
|
30473
|
+
lib$1.parse = parse$4;
|
|
30474
|
+
var conditional = function conditional(schema, conditionFunc) {
|
|
30475
|
+
return function (stream, result, parent, parse) {
|
|
30476
|
+
if (conditionFunc(stream, result, parent)) {
|
|
30477
|
+
parse(stream, schema, result, parent);
|
|
30478
|
+
}
|
|
30479
|
+
};
|
|
30480
|
+
};
|
|
30481
|
+
lib$1.conditional = conditional;
|
|
30482
|
+
var loop = function loop(schema, continueFunc) {
|
|
30483
|
+
return function (stream, result, parent, parse) {
|
|
30484
|
+
var arr = [];
|
|
30485
|
+
var lastStreamPos = stream.pos;
|
|
30486
|
+
while (continueFunc(stream, result, parent)) {
|
|
30487
|
+
var newParent = {};
|
|
30488
|
+
parse(stream, schema, result, newParent); // cases when whole file is parsed but no termination is there and stream position is not getting updated as well
|
|
30489
|
+
// it falls into infinite recursion, null check to avoid the same
|
|
30490
|
+
|
|
30491
|
+
if (stream.pos === lastStreamPos) {
|
|
30492
|
+
break;
|
|
30493
|
+
}
|
|
30494
|
+
lastStreamPos = stream.pos;
|
|
30495
|
+
arr.push(newParent);
|
|
30496
|
+
}
|
|
30497
|
+
return arr;
|
|
30498
|
+
};
|
|
30499
|
+
};
|
|
30500
|
+
lib$1.loop = loop;
|
|
30501
|
+
|
|
30502
|
+
var uint8 = {};
|
|
30503
|
+
|
|
30504
|
+
Object.defineProperty(uint8, "__esModule", {
|
|
30505
|
+
value: true
|
|
30506
|
+
});
|
|
30507
|
+
uint8.readBits = uint8.readArray = uint8.readUnsigned = uint8.readString = uint8.peekBytes = uint8.readBytes = uint8.peekByte = uint8.readByte = uint8.buildStream = void 0;
|
|
30508
|
+
|
|
30509
|
+
// Default stream and parsers for Uint8TypedArray data type
|
|
30510
|
+
var buildStream = function buildStream(uint8Data) {
|
|
30511
|
+
return {
|
|
30512
|
+
data: uint8Data,
|
|
30513
|
+
pos: 0
|
|
30514
|
+
};
|
|
30515
|
+
};
|
|
30516
|
+
uint8.buildStream = buildStream;
|
|
30517
|
+
var readByte = function readByte() {
|
|
30518
|
+
return function (stream) {
|
|
30519
|
+
return stream.data[stream.pos++];
|
|
30520
|
+
};
|
|
30521
|
+
};
|
|
30522
|
+
uint8.readByte = readByte;
|
|
30523
|
+
var peekByte = function peekByte() {
|
|
30524
|
+
var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
30525
|
+
return function (stream) {
|
|
30526
|
+
return stream.data[stream.pos + offset];
|
|
30527
|
+
};
|
|
30528
|
+
};
|
|
30529
|
+
uint8.peekByte = peekByte;
|
|
30530
|
+
var readBytes = function readBytes(length) {
|
|
30531
|
+
return function (stream) {
|
|
30532
|
+
return stream.data.subarray(stream.pos, stream.pos += length);
|
|
30533
|
+
};
|
|
30534
|
+
};
|
|
30535
|
+
uint8.readBytes = readBytes;
|
|
30536
|
+
var peekBytes = function peekBytes(length) {
|
|
30537
|
+
return function (stream) {
|
|
30538
|
+
return stream.data.subarray(stream.pos, stream.pos + length);
|
|
30539
|
+
};
|
|
30540
|
+
};
|
|
30541
|
+
uint8.peekBytes = peekBytes;
|
|
30542
|
+
var readString = function readString(length) {
|
|
30543
|
+
return function (stream) {
|
|
30544
|
+
return Array.from(readBytes(length)(stream)).map(function (value) {
|
|
30545
|
+
return String.fromCharCode(value);
|
|
30546
|
+
}).join('');
|
|
30547
|
+
};
|
|
30548
|
+
};
|
|
30549
|
+
uint8.readString = readString;
|
|
30550
|
+
var readUnsigned = function readUnsigned(littleEndian) {
|
|
30551
|
+
return function (stream) {
|
|
30552
|
+
var bytes = readBytes(2)(stream);
|
|
30553
|
+
return littleEndian ? (bytes[1] << 8) + bytes[0] : (bytes[0] << 8) + bytes[1];
|
|
30554
|
+
};
|
|
30555
|
+
};
|
|
30556
|
+
uint8.readUnsigned = readUnsigned;
|
|
30557
|
+
var readArray = function readArray(byteSize, totalOrFunc) {
|
|
30558
|
+
return function (stream, result, parent) {
|
|
30559
|
+
var total = typeof totalOrFunc === 'function' ? totalOrFunc(stream, result, parent) : totalOrFunc;
|
|
30560
|
+
var parser = readBytes(byteSize);
|
|
30561
|
+
var arr = new Array(total);
|
|
30562
|
+
for (var i = 0; i < total; i++) {
|
|
30563
|
+
arr[i] = parser(stream);
|
|
30564
|
+
}
|
|
30565
|
+
return arr;
|
|
30566
|
+
};
|
|
30567
|
+
};
|
|
30568
|
+
uint8.readArray = readArray;
|
|
30569
|
+
var subBitsTotal = function subBitsTotal(bits, startIndex, length) {
|
|
30570
|
+
var result = 0;
|
|
30571
|
+
for (var i = 0; i < length; i++) {
|
|
30572
|
+
result += bits[startIndex + i] && Math.pow(2, length - i - 1);
|
|
30573
|
+
}
|
|
30574
|
+
return result;
|
|
30575
|
+
};
|
|
30576
|
+
var readBits = function readBits(schema) {
|
|
30577
|
+
return function (stream) {
|
|
30578
|
+
var _byte = readByte()(stream); // convert the byte to bit array
|
|
30579
|
+
|
|
30580
|
+
var bits = new Array(8);
|
|
30581
|
+
for (var i = 0; i < 8; i++) {
|
|
30582
|
+
bits[7 - i] = !!(_byte & 1 << i);
|
|
30583
|
+
} // convert the bit array to values based on the schema
|
|
30584
|
+
|
|
30585
|
+
return Object.keys(schema).reduce(function (res, key) {
|
|
30586
|
+
var def = schema[key];
|
|
30587
|
+
if (def.length) {
|
|
30588
|
+
res[key] = subBitsTotal(bits, def.index, def.length);
|
|
30589
|
+
} else {
|
|
30590
|
+
res[key] = bits[def.index];
|
|
30591
|
+
}
|
|
30592
|
+
return res;
|
|
30593
|
+
}, {});
|
|
30594
|
+
};
|
|
30595
|
+
};
|
|
30596
|
+
uint8.readBits = readBits;
|
|
30597
|
+
|
|
30598
|
+
(function (exports) {
|
|
30599
|
+
|
|
30600
|
+
Object.defineProperty(exports, "__esModule", {
|
|
30601
|
+
value: true
|
|
30602
|
+
});
|
|
30603
|
+
exports["default"] = void 0;
|
|
30604
|
+
var _ = lib$1;
|
|
30605
|
+
var _uint = uint8;
|
|
30606
|
+
|
|
30607
|
+
// a set of 0x00 terminated subblocks
|
|
30608
|
+
var subBlocksSchema = {
|
|
30609
|
+
blocks: function blocks(stream) {
|
|
30610
|
+
var terminator = 0x00;
|
|
30611
|
+
var chunks = [];
|
|
30612
|
+
var streamSize = stream.data.length;
|
|
30613
|
+
var total = 0;
|
|
30614
|
+
for (var size = (0, _uint.readByte)()(stream); size !== terminator; size = (0, _uint.readByte)()(stream)) {
|
|
30615
|
+
// size becomes undefined for some case when file is corrupted and terminator is not proper
|
|
30616
|
+
// null check to avoid recursion
|
|
30617
|
+
if (!size) break; // catch corrupted files with no terminator
|
|
30618
|
+
|
|
30619
|
+
if (stream.pos + size >= streamSize) {
|
|
30620
|
+
var availableSize = streamSize - stream.pos;
|
|
30621
|
+
chunks.push((0, _uint.readBytes)(availableSize)(stream));
|
|
30622
|
+
total += availableSize;
|
|
30623
|
+
break;
|
|
30624
|
+
}
|
|
30625
|
+
chunks.push((0, _uint.readBytes)(size)(stream));
|
|
30626
|
+
total += size;
|
|
30627
|
+
}
|
|
30628
|
+
var result = new Uint8Array(total);
|
|
30629
|
+
var offset = 0;
|
|
30630
|
+
for (var i = 0; i < chunks.length; i++) {
|
|
30631
|
+
result.set(chunks[i], offset);
|
|
30632
|
+
offset += chunks[i].length;
|
|
30633
|
+
}
|
|
30634
|
+
return result;
|
|
30635
|
+
}
|
|
30636
|
+
}; // global control extension
|
|
30637
|
+
|
|
30638
|
+
var gceSchema = (0, _.conditional)({
|
|
30639
|
+
gce: [{
|
|
30640
|
+
codes: (0, _uint.readBytes)(2)
|
|
30641
|
+
}, {
|
|
30642
|
+
byteSize: (0, _uint.readByte)()
|
|
30643
|
+
}, {
|
|
30644
|
+
extras: (0, _uint.readBits)({
|
|
30645
|
+
future: {
|
|
30646
|
+
index: 0,
|
|
30647
|
+
length: 3
|
|
30648
|
+
},
|
|
30649
|
+
disposal: {
|
|
30650
|
+
index: 3,
|
|
30651
|
+
length: 3
|
|
30652
|
+
},
|
|
30653
|
+
userInput: {
|
|
30654
|
+
index: 6
|
|
30655
|
+
},
|
|
30656
|
+
transparentColorGiven: {
|
|
30657
|
+
index: 7
|
|
30658
|
+
}
|
|
30659
|
+
})
|
|
30660
|
+
}, {
|
|
30661
|
+
delay: (0, _uint.readUnsigned)(true)
|
|
30662
|
+
}, {
|
|
30663
|
+
transparentColorIndex: (0, _uint.readByte)()
|
|
30664
|
+
}, {
|
|
30665
|
+
terminator: (0, _uint.readByte)()
|
|
30666
|
+
}]
|
|
30667
|
+
}, function (stream) {
|
|
30668
|
+
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
30669
|
+
return codes[0] === 0x21 && codes[1] === 0xf9;
|
|
30670
|
+
}); // image pipeline block
|
|
30671
|
+
|
|
30672
|
+
var imageSchema = (0, _.conditional)({
|
|
30673
|
+
image: [{
|
|
30674
|
+
code: (0, _uint.readByte)()
|
|
30675
|
+
}, {
|
|
30676
|
+
descriptor: [{
|
|
30677
|
+
left: (0, _uint.readUnsigned)(true)
|
|
30678
|
+
}, {
|
|
30679
|
+
top: (0, _uint.readUnsigned)(true)
|
|
30680
|
+
}, {
|
|
30681
|
+
width: (0, _uint.readUnsigned)(true)
|
|
30682
|
+
}, {
|
|
30683
|
+
height: (0, _uint.readUnsigned)(true)
|
|
30684
|
+
}, {
|
|
30685
|
+
lct: (0, _uint.readBits)({
|
|
30686
|
+
exists: {
|
|
30687
|
+
index: 0
|
|
30688
|
+
},
|
|
30689
|
+
interlaced: {
|
|
30690
|
+
index: 1
|
|
30691
|
+
},
|
|
30692
|
+
sort: {
|
|
30693
|
+
index: 2
|
|
30694
|
+
},
|
|
30695
|
+
future: {
|
|
30696
|
+
index: 3,
|
|
30697
|
+
length: 2
|
|
30698
|
+
},
|
|
30699
|
+
size: {
|
|
30700
|
+
index: 5,
|
|
30701
|
+
length: 3
|
|
30702
|
+
}
|
|
30703
|
+
})
|
|
30704
|
+
}]
|
|
30705
|
+
}, (0, _.conditional)({
|
|
30706
|
+
lct: (0, _uint.readArray)(3, function (stream, result, parent) {
|
|
30707
|
+
return Math.pow(2, parent.descriptor.lct.size + 1);
|
|
30708
|
+
})
|
|
30709
|
+
}, function (stream, result, parent) {
|
|
30710
|
+
return parent.descriptor.lct.exists;
|
|
30711
|
+
}), {
|
|
30712
|
+
data: [{
|
|
30713
|
+
minCodeSize: (0, _uint.readByte)()
|
|
30714
|
+
}, subBlocksSchema]
|
|
30715
|
+
}]
|
|
30716
|
+
}, function (stream) {
|
|
30717
|
+
return (0, _uint.peekByte)()(stream) === 0x2c;
|
|
30718
|
+
}); // plain text block
|
|
30719
|
+
|
|
30720
|
+
var textSchema = (0, _.conditional)({
|
|
30721
|
+
text: [{
|
|
30722
|
+
codes: (0, _uint.readBytes)(2)
|
|
30723
|
+
}, {
|
|
30724
|
+
blockSize: (0, _uint.readByte)()
|
|
30725
|
+
}, {
|
|
30726
|
+
preData: function preData(stream, result, parent) {
|
|
30727
|
+
return (0, _uint.readBytes)(parent.text.blockSize)(stream);
|
|
30728
|
+
}
|
|
30729
|
+
}, subBlocksSchema]
|
|
30730
|
+
}, function (stream) {
|
|
30731
|
+
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
30732
|
+
return codes[0] === 0x21 && codes[1] === 0x01;
|
|
30733
|
+
}); // application block
|
|
30734
|
+
|
|
30735
|
+
var applicationSchema = (0, _.conditional)({
|
|
30736
|
+
application: [{
|
|
30737
|
+
codes: (0, _uint.readBytes)(2)
|
|
30738
|
+
}, {
|
|
30739
|
+
blockSize: (0, _uint.readByte)()
|
|
30740
|
+
}, {
|
|
30741
|
+
id: function id(stream, result, parent) {
|
|
30742
|
+
return (0, _uint.readString)(parent.blockSize)(stream);
|
|
30743
|
+
}
|
|
30744
|
+
}, subBlocksSchema]
|
|
30745
|
+
}, function (stream) {
|
|
30746
|
+
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
30747
|
+
return codes[0] === 0x21 && codes[1] === 0xff;
|
|
30748
|
+
}); // comment block
|
|
30749
|
+
|
|
30750
|
+
var commentSchema = (0, _.conditional)({
|
|
30751
|
+
comment: [{
|
|
30752
|
+
codes: (0, _uint.readBytes)(2)
|
|
30753
|
+
}, subBlocksSchema]
|
|
30754
|
+
}, function (stream) {
|
|
30755
|
+
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
30756
|
+
return codes[0] === 0x21 && codes[1] === 0xfe;
|
|
30757
|
+
});
|
|
30758
|
+
var schema = [{
|
|
30759
|
+
header: [{
|
|
30760
|
+
signature: (0, _uint.readString)(3)
|
|
30761
|
+
}, {
|
|
30762
|
+
version: (0, _uint.readString)(3)
|
|
30763
|
+
}]
|
|
30764
|
+
}, {
|
|
30765
|
+
lsd: [{
|
|
30766
|
+
width: (0, _uint.readUnsigned)(true)
|
|
30767
|
+
}, {
|
|
30768
|
+
height: (0, _uint.readUnsigned)(true)
|
|
30769
|
+
}, {
|
|
30770
|
+
gct: (0, _uint.readBits)({
|
|
30771
|
+
exists: {
|
|
30772
|
+
index: 0
|
|
30773
|
+
},
|
|
30774
|
+
resolution: {
|
|
30775
|
+
index: 1,
|
|
30776
|
+
length: 3
|
|
30777
|
+
},
|
|
30778
|
+
sort: {
|
|
30779
|
+
index: 4
|
|
30780
|
+
},
|
|
30781
|
+
size: {
|
|
30782
|
+
index: 5,
|
|
30783
|
+
length: 3
|
|
30784
|
+
}
|
|
30785
|
+
})
|
|
30786
|
+
}, {
|
|
30787
|
+
backgroundColorIndex: (0, _uint.readByte)()
|
|
30788
|
+
}, {
|
|
30789
|
+
pixelAspectRatio: (0, _uint.readByte)()
|
|
30790
|
+
}]
|
|
30791
|
+
}, (0, _.conditional)({
|
|
30792
|
+
gct: (0, _uint.readArray)(3, function (stream, result) {
|
|
30793
|
+
return Math.pow(2, result.lsd.gct.size + 1);
|
|
30794
|
+
})
|
|
30795
|
+
}, function (stream, result) {
|
|
30796
|
+
return result.lsd.gct.exists;
|
|
30797
|
+
}),
|
|
30798
|
+
// content frames
|
|
30799
|
+
{
|
|
30800
|
+
frames: (0, _.loop)([gceSchema, applicationSchema, commentSchema, imageSchema, textSchema], function (stream) {
|
|
30801
|
+
var nextCode = (0, _uint.peekByte)()(stream); // rather than check for a terminator, we should check for the existence
|
|
30802
|
+
// of an ext or image block to avoid infinite loops
|
|
30803
|
+
//var terminator = 0x3B;
|
|
30804
|
+
//return nextCode !== terminator;
|
|
30805
|
+
|
|
30806
|
+
return nextCode === 0x21 || nextCode === 0x2c;
|
|
30807
|
+
})
|
|
30808
|
+
}];
|
|
30809
|
+
var _default = schema;
|
|
30810
|
+
exports["default"] = _default;
|
|
30811
|
+
})(gif);
|
|
30812
|
+
|
|
30813
|
+
var deinterlace$1 = {};
|
|
30814
|
+
|
|
30815
|
+
Object.defineProperty(deinterlace$1, "__esModule", {
|
|
30816
|
+
value: true
|
|
30817
|
+
});
|
|
30818
|
+
deinterlace$1.deinterlace = void 0;
|
|
30819
|
+
|
|
30820
|
+
/**
|
|
30821
|
+
* Deinterlace function from https://github.com/shachaf/jsgif
|
|
30822
|
+
*/
|
|
30823
|
+
var deinterlace = function deinterlace(pixels, width) {
|
|
30824
|
+
var newPixels = new Array(pixels.length);
|
|
30825
|
+
var rows = pixels.length / width;
|
|
30826
|
+
var cpRow = function cpRow(toRow, fromRow) {
|
|
30827
|
+
var fromPixels = pixels.slice(fromRow * width, (fromRow + 1) * width);
|
|
30828
|
+
newPixels.splice.apply(newPixels, [toRow * width, width].concat(fromPixels));
|
|
30829
|
+
}; // See appendix E.
|
|
30830
|
+
|
|
30831
|
+
var offsets = [0, 4, 2, 1];
|
|
30832
|
+
var steps = [8, 8, 4, 2];
|
|
30833
|
+
var fromRow = 0;
|
|
30834
|
+
for (var pass = 0; pass < 4; pass++) {
|
|
30835
|
+
for (var toRow = offsets[pass]; toRow < rows; toRow += steps[pass]) {
|
|
30836
|
+
cpRow(toRow, fromRow);
|
|
30837
|
+
fromRow++;
|
|
30838
|
+
}
|
|
30839
|
+
}
|
|
30840
|
+
return newPixels;
|
|
30841
|
+
};
|
|
30842
|
+
deinterlace$1.deinterlace = deinterlace;
|
|
30843
|
+
|
|
30844
|
+
var lzw$1 = {};
|
|
30845
|
+
|
|
30846
|
+
Object.defineProperty(lzw$1, "__esModule", {
|
|
30847
|
+
value: true
|
|
30848
|
+
});
|
|
30849
|
+
lzw$1.lzw = void 0;
|
|
30850
|
+
|
|
30851
|
+
/**
|
|
30852
|
+
* javascript port of java LZW decompression
|
|
30853
|
+
* Original java author url: https://gist.github.com/devunwired/4479231
|
|
30854
|
+
*/
|
|
30855
|
+
var lzw = function lzw(minCodeSize, data, pixelCount) {
|
|
30856
|
+
var MAX_STACK_SIZE = 4096;
|
|
30857
|
+
var nullCode = -1;
|
|
30858
|
+
var npix = pixelCount;
|
|
30859
|
+
var available, clear, code_mask, code_size, end_of_information, in_code, old_code, bits, code, i, datum, data_size, first, top, bi, pi;
|
|
30860
|
+
var dstPixels = new Array(pixelCount);
|
|
30861
|
+
var prefix = new Array(MAX_STACK_SIZE);
|
|
30862
|
+
var suffix = new Array(MAX_STACK_SIZE);
|
|
30863
|
+
var pixelStack = new Array(MAX_STACK_SIZE + 1); // Initialize GIF data stream decoder.
|
|
30864
|
+
|
|
30865
|
+
data_size = minCodeSize;
|
|
30866
|
+
clear = 1 << data_size;
|
|
30867
|
+
end_of_information = clear + 1;
|
|
30868
|
+
available = clear + 2;
|
|
30869
|
+
old_code = nullCode;
|
|
30870
|
+
code_size = data_size + 1;
|
|
30871
|
+
code_mask = (1 << code_size) - 1;
|
|
30872
|
+
for (code = 0; code < clear; code++) {
|
|
30873
|
+
prefix[code] = 0;
|
|
30874
|
+
suffix[code] = code;
|
|
30875
|
+
} // Decode GIF pixel stream.
|
|
30876
|
+
|
|
30877
|
+
var datum, bits, first, top, pi, bi;
|
|
30878
|
+
datum = bits = first = top = pi = bi = 0;
|
|
30879
|
+
for (i = 0; i < npix;) {
|
|
30880
|
+
if (top === 0) {
|
|
30881
|
+
if (bits < code_size) {
|
|
30882
|
+
// get the next byte
|
|
30883
|
+
datum += data[bi] << bits;
|
|
30884
|
+
bits += 8;
|
|
30885
|
+
bi++;
|
|
30886
|
+
continue;
|
|
30887
|
+
} // Get the next code.
|
|
30888
|
+
|
|
30889
|
+
code = datum & code_mask;
|
|
30890
|
+
datum >>= code_size;
|
|
30891
|
+
bits -= code_size; // Interpret the code
|
|
30892
|
+
|
|
30893
|
+
if (code > available || code == end_of_information) {
|
|
30894
|
+
break;
|
|
30895
|
+
}
|
|
30896
|
+
if (code == clear) {
|
|
30897
|
+
// Reset decoder.
|
|
30898
|
+
code_size = data_size + 1;
|
|
30899
|
+
code_mask = (1 << code_size) - 1;
|
|
30900
|
+
available = clear + 2;
|
|
30901
|
+
old_code = nullCode;
|
|
30902
|
+
continue;
|
|
30903
|
+
}
|
|
30904
|
+
if (old_code == nullCode) {
|
|
30905
|
+
pixelStack[top++] = suffix[code];
|
|
30906
|
+
old_code = code;
|
|
30907
|
+
first = code;
|
|
30908
|
+
continue;
|
|
30909
|
+
}
|
|
30910
|
+
in_code = code;
|
|
30911
|
+
if (code == available) {
|
|
30912
|
+
pixelStack[top++] = first;
|
|
30913
|
+
code = old_code;
|
|
30914
|
+
}
|
|
30915
|
+
while (code > clear) {
|
|
30916
|
+
pixelStack[top++] = suffix[code];
|
|
30917
|
+
code = prefix[code];
|
|
30918
|
+
}
|
|
30919
|
+
first = suffix[code] & 0xff;
|
|
30920
|
+
pixelStack[top++] = first; // add a new string to the table, but only if space is available
|
|
30921
|
+
// if not, just continue with current table until a clear code is found
|
|
30922
|
+
// (deferred clear code implementation as per GIF spec)
|
|
30923
|
+
|
|
30924
|
+
if (available < MAX_STACK_SIZE) {
|
|
30925
|
+
prefix[available] = old_code;
|
|
30926
|
+
suffix[available] = first;
|
|
30927
|
+
available++;
|
|
30928
|
+
if ((available & code_mask) === 0 && available < MAX_STACK_SIZE) {
|
|
30929
|
+
code_size++;
|
|
30930
|
+
code_mask += available;
|
|
30931
|
+
}
|
|
30932
|
+
}
|
|
30933
|
+
old_code = in_code;
|
|
30934
|
+
} // Pop a pixel off the pixel stack.
|
|
30935
|
+
|
|
30936
|
+
top--;
|
|
30937
|
+
dstPixels[pi++] = pixelStack[top];
|
|
30938
|
+
i++;
|
|
30939
|
+
}
|
|
30940
|
+
for (i = pi; i < npix; i++) {
|
|
30941
|
+
dstPixels[i] = 0; // clear missing pixels
|
|
30942
|
+
}
|
|
30943
|
+
return dstPixels;
|
|
30944
|
+
};
|
|
30945
|
+
lzw$1.lzw = lzw;
|
|
30946
|
+
|
|
30947
|
+
Object.defineProperty(lib$2, "__esModule", {
|
|
30948
|
+
value: true
|
|
30949
|
+
});
|
|
30950
|
+
var decompressFrames_1 = lib$2.decompressFrames = lib$2.decompressFrame = parseGIF_1 = lib$2.parseGIF = void 0;
|
|
30951
|
+
var _gif = _interopRequireDefault(gif);
|
|
30952
|
+
var _jsBinarySchemaParser = lib$1;
|
|
30953
|
+
var _uint = uint8;
|
|
30954
|
+
var _deinterlace = deinterlace$1;
|
|
30955
|
+
var _lzw = lzw$1;
|
|
30956
|
+
function _interopRequireDefault(obj) {
|
|
30957
|
+
return obj && obj.__esModule ? obj : {
|
|
30958
|
+
"default": obj
|
|
30959
|
+
};
|
|
30960
|
+
}
|
|
30961
|
+
var parseGIF = function parseGIF(arrayBuffer) {
|
|
30962
|
+
var byteData = new Uint8Array(arrayBuffer);
|
|
30963
|
+
return (0, _jsBinarySchemaParser.parse)((0, _uint.buildStream)(byteData), _gif["default"]);
|
|
30964
|
+
};
|
|
30965
|
+
var parseGIF_1 = lib$2.parseGIF = parseGIF;
|
|
30966
|
+
var generatePatch = function generatePatch(image) {
|
|
30967
|
+
var totalPixels = image.pixels.length;
|
|
30968
|
+
var patchData = new Uint8ClampedArray(totalPixels * 4);
|
|
30969
|
+
for (var i = 0; i < totalPixels; i++) {
|
|
30970
|
+
var pos = i * 4;
|
|
30971
|
+
var colorIndex = image.pixels[i];
|
|
30972
|
+
var color = image.colorTable[colorIndex] || [0, 0, 0];
|
|
30973
|
+
patchData[pos] = color[0];
|
|
30974
|
+
patchData[pos + 1] = color[1];
|
|
30975
|
+
patchData[pos + 2] = color[2];
|
|
30976
|
+
patchData[pos + 3] = colorIndex !== image.transparentIndex ? 255 : 0;
|
|
30977
|
+
}
|
|
30978
|
+
return patchData;
|
|
30979
|
+
};
|
|
30980
|
+
var decompressFrame = function decompressFrame(frame, gct, buildImagePatch) {
|
|
30981
|
+
if (!frame.image) {
|
|
30982
|
+
console.warn('gif frame does not have associated image.');
|
|
30983
|
+
return;
|
|
30984
|
+
}
|
|
30985
|
+
var image = frame.image; // get the number of pixels
|
|
30986
|
+
|
|
30987
|
+
var totalPixels = image.descriptor.width * image.descriptor.height; // do lzw decompression
|
|
30988
|
+
|
|
30989
|
+
var pixels = (0, _lzw.lzw)(image.data.minCodeSize, image.data.blocks, totalPixels); // deal with interlacing if necessary
|
|
30990
|
+
|
|
30991
|
+
if (image.descriptor.lct.interlaced) {
|
|
30992
|
+
pixels = (0, _deinterlace.deinterlace)(pixels, image.descriptor.width);
|
|
30993
|
+
}
|
|
30994
|
+
var resultImage = {
|
|
30995
|
+
pixels: pixels,
|
|
30996
|
+
dims: {
|
|
30997
|
+
top: frame.image.descriptor.top,
|
|
30998
|
+
left: frame.image.descriptor.left,
|
|
30999
|
+
width: frame.image.descriptor.width,
|
|
31000
|
+
height: frame.image.descriptor.height
|
|
31001
|
+
}
|
|
31002
|
+
}; // color table
|
|
31003
|
+
|
|
31004
|
+
if (image.descriptor.lct && image.descriptor.lct.exists) {
|
|
31005
|
+
resultImage.colorTable = image.lct;
|
|
31006
|
+
} else {
|
|
31007
|
+
resultImage.colorTable = gct;
|
|
31008
|
+
} // add per frame relevant gce information
|
|
31009
|
+
|
|
31010
|
+
if (frame.gce) {
|
|
31011
|
+
resultImage.delay = (frame.gce.delay || 10) * 10; // convert to ms
|
|
31012
|
+
|
|
31013
|
+
resultImage.disposalType = frame.gce.extras.disposal; // transparency
|
|
31014
|
+
|
|
31015
|
+
if (frame.gce.extras.transparentColorGiven) {
|
|
31016
|
+
resultImage.transparentIndex = frame.gce.transparentColorIndex;
|
|
31017
|
+
}
|
|
31018
|
+
} // create canvas usable imagedata if desired
|
|
31019
|
+
|
|
31020
|
+
if (buildImagePatch) {
|
|
31021
|
+
resultImage.patch = generatePatch(resultImage);
|
|
31022
|
+
}
|
|
31023
|
+
return resultImage;
|
|
31024
|
+
};
|
|
31025
|
+
lib$2.decompressFrame = decompressFrame;
|
|
31026
|
+
var decompressFrames = function decompressFrames(parsedGif, buildImagePatches) {
|
|
31027
|
+
return parsedGif.frames.filter(function (f) {
|
|
31028
|
+
return f.image;
|
|
31029
|
+
}).map(function (f) {
|
|
31030
|
+
return decompressFrame(f, parsedGif.gct, buildImagePatches);
|
|
31031
|
+
});
|
|
31032
|
+
};
|
|
31033
|
+
decompressFrames_1 = lib$2.decompressFrames = decompressFrames;
|
|
31034
|
+
|
|
31035
|
+
Generator$1.GenAutoIncrementId();
|
|
30499
31036
|
var LOTTIE_NUMBER_TYPE = Generator$1.GenAutoIncrementId();
|
|
30500
31037
|
|
|
30501
31038
|
var lottie = {exports: {}};
|
|
@@ -36777,11 +37314,18 @@
|
|
|
36777
37314
|
height = _this$getScale.height;
|
|
36778
37315
|
this._container && this._initCanvasByContainer(width, height, dpr, background), params.canvas && this._initCanvasByCanvas(canvas, null != width ? width : 500, null != height ? height : 500, dpr, background), this._stage.defaultLayer.setAttributes({
|
|
36779
37316
|
background: layerBackground
|
|
36780
|
-
})
|
|
36781
|
-
|
|
36782
|
-
|
|
36783
|
-
|
|
36784
|
-
|
|
37317
|
+
});
|
|
37318
|
+
var viewBox = layerViewBox || {
|
|
37319
|
+
x1: 0,
|
|
37320
|
+
y1: 0,
|
|
37321
|
+
x2: width,
|
|
37322
|
+
y2: height
|
|
37323
|
+
};
|
|
37324
|
+
this._stage.defaultLayer.setAttributes({
|
|
37325
|
+
x: viewBox.x1,
|
|
37326
|
+
y: viewBox.y1,
|
|
37327
|
+
width: (viewBox.x2 - viewBox.x1) / scaleX,
|
|
37328
|
+
height: (viewBox.y2 - viewBox.y1) / scaleY,
|
|
36785
37329
|
clip: !0
|
|
36786
37330
|
}), this._stage.defaultLayer.scale(scaleX, scaleY);
|
|
36787
37331
|
}
|
|
@@ -36861,8 +37405,31 @@
|
|
|
36861
37405
|
}
|
|
36862
37406
|
}, {
|
|
36863
37407
|
key: "resize",
|
|
36864
|
-
value: function resize(w, h) {
|
|
37408
|
+
value: function resize(w, h, scale) {
|
|
36865
37409
|
this._stage.resize(w, h, !0);
|
|
37410
|
+
var scaleX = 1,
|
|
37411
|
+
scaleY = 1;
|
|
37412
|
+
scale && (scaleX = scale.scaleX, scaleY = scale.scaleY), this._stage.forEachChildren(function (layer) {
|
|
37413
|
+
layer.setAttributes({
|
|
37414
|
+
x: 0,
|
|
37415
|
+
y: 0,
|
|
37416
|
+
width: w / scaleX,
|
|
37417
|
+
height: h / scaleY,
|
|
37418
|
+
scaleX: scaleX,
|
|
37419
|
+
scaleY: scaleY
|
|
37420
|
+
});
|
|
37421
|
+
});
|
|
37422
|
+
}
|
|
37423
|
+
}, {
|
|
37424
|
+
key: "setLayerViewBox",
|
|
37425
|
+
value: function setLayerViewBox(viewBox) {
|
|
37426
|
+
this._stage.defaultLayer.setAttributes({
|
|
37427
|
+
x: viewBox.x1,
|
|
37428
|
+
y: viewBox.y1,
|
|
37429
|
+
width: viewBox.x2 - viewBox.x1,
|
|
37430
|
+
height: viewBox.y2 - viewBox.y1,
|
|
37431
|
+
clip: !0
|
|
37432
|
+
});
|
|
36866
37433
|
}
|
|
36867
37434
|
}, {
|
|
36868
37435
|
key: "getEventDetail",
|
|
@@ -37530,7 +38097,9 @@
|
|
|
37530
38097
|
var _this = this;
|
|
37531
38098
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
37532
38099
|
_classCallCheck(this, Player);
|
|
37533
|
-
this.handlerTick = function (delta) {
|
|
38100
|
+
this._lastFrameTime = -1, this.handlerTick = function (delta) {
|
|
38101
|
+
var time = Date.now();
|
|
38102
|
+
void 0 === delta && (delta = _this._lastFrameTime >= 0 ? time - _this._lastFrameTime : 0), _this._lastFrameTime = time;
|
|
37534
38103
|
var totalTime = _this._scheduler.getTotalTime();
|
|
37535
38104
|
var currTime = _this._currTime;
|
|
37536
38105
|
if (_this._loop > 0) if (totalTime <= 0) currTime = 0;else if (currTime + delta > totalTime) for (currTime += delta; currTime > totalTime;) currTime -= totalTime;
|
|
@@ -40060,10 +40629,10 @@
|
|
|
40060
40629
|
}
|
|
40061
40630
|
return results;
|
|
40062
40631
|
};
|
|
40063
|
-
var lib
|
|
40632
|
+
var lib = _simplifyGeometry;
|
|
40064
40633
|
|
|
40065
40634
|
(function (module) {
|
|
40066
|
-
var simplify = lib
|
|
40635
|
+
var simplify = lib;
|
|
40067
40636
|
module.exports = function (geojson, tolerance, dontClone) {
|
|
40068
40637
|
if (!dontClone) geojson = JSON.parse(JSON.stringify(geojson)); // clone obj
|
|
40069
40638
|
if (geojson.features) return simplifyFeatureCollection(geojson, tolerance);else if (geojson.type && geojson.type === 'Feature') return simplifyFeature(geojson, tolerance);else return new Error('FeatureCollection or individual Feature required');
|
|
@@ -48400,7 +48969,12 @@
|
|
|
48400
48969
|
customLayoutFunc = _this$attribute.customLayoutFunc,
|
|
48401
48970
|
customOverlapFunc = _this$attribute.customOverlapFunc;
|
|
48402
48971
|
var data = this.attribute.data;
|
|
48403
|
-
isFunction$3(dataFilter) && (data = dataFilter(data))
|
|
48972
|
+
if (isFunction$3(dataFilter) && (data = dataFilter(data)), data && data.length) {
|
|
48973
|
+
var seenIds = new Set();
|
|
48974
|
+
data = data.filter(function (d) {
|
|
48975
|
+
return !seenIds.has(d.id) && seenIds.add(d.id);
|
|
48976
|
+
});
|
|
48977
|
+
}
|
|
48404
48978
|
var labels = this._initText(data);
|
|
48405
48979
|
labels = isFunction$3(customLayoutFunc) ? customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? function (d) {
|
|
48406
48980
|
return _this2._idToPoint.get(d.id);
|
|
@@ -52334,23 +52908,12 @@
|
|
|
52334
52908
|
x1 = _this$_area$AABBBound.x1,
|
|
52335
52909
|
x2 = _this$_area$AABBBound.x2,
|
|
52336
52910
|
y1 = _this$_area$AABBBound.y1,
|
|
52337
|
-
y2 = _this$_area$AABBBound.y2
|
|
52338
|
-
|
|
52339
|
-
|
|
52340
|
-
|
|
52341
|
-
|
|
52342
|
-
|
|
52343
|
-
y: (y1 + y2) / 2
|
|
52344
|
-
} : position.includes("top") || position.includes("Top") ? {
|
|
52345
|
-
x: (x1 + x2) / 2,
|
|
52346
|
-
y: y1
|
|
52347
|
-
} : position.includes("bottom") || position.includes("Bottom") ? {
|
|
52348
|
-
x: (x1 + x2) / 2,
|
|
52349
|
-
y: y2
|
|
52350
|
-
} : {
|
|
52351
|
-
x: (x1 + x2) / 2,
|
|
52352
|
-
y: (y1 + y2) / 2
|
|
52353
|
-
};
|
|
52911
|
+
y2 = _this$_area$AABBBound.y2,
|
|
52912
|
+
result = {
|
|
52913
|
+
x: (x1 + x2) / 2,
|
|
52914
|
+
y: (y1 + y2) / 2
|
|
52915
|
+
};
|
|
52916
|
+
return (position.includes("left") || position.includes("Left")) && (result.x = x1), (position.includes("right") || position.includes("Right")) && (result.x = x2), (position.includes("top") || position.includes("Top")) && (result.y = y1), (position.includes("bottom") || position.includes("Bottom")) && (result.y = y2), result;
|
|
52354
52917
|
}
|
|
52355
52918
|
}, {
|
|
52356
52919
|
key: "setLabelPos",
|
|
@@ -55325,7 +55888,7 @@
|
|
|
55325
55888
|
return _createClass(Title, [{
|
|
55326
55889
|
key: "render",
|
|
55327
55890
|
value: function render() {
|
|
55328
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
55891
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
55329
55892
|
var _this$attribute = this.attribute,
|
|
55330
55893
|
textType = _this$attribute.textType,
|
|
55331
55894
|
text = _this$attribute.text,
|
|
@@ -55350,10 +55913,10 @@
|
|
|
55350
55913
|
x: parsedPadding[3],
|
|
55351
55914
|
y: parsedPadding[0],
|
|
55352
55915
|
zIndex: 1
|
|
55353
|
-
}, "group")
|
|
55916
|
+
}, "group"),
|
|
55917
|
+
fixedMainTitleHeight = null !== (_a = textStyle.height) && void 0 !== _a ? _a : height;
|
|
55354
55918
|
if (!1 !== this.attribute.visible && !1 !== textStyle.visible) {
|
|
55355
55919
|
var mainTitleWidth = textStyle.width,
|
|
55356
|
-
mainTitleHeight = textStyle.height,
|
|
55357
55920
|
mainTitleMaxHeight = textStyle.maxHeight,
|
|
55358
55921
|
mainTitleMaxWidth = textStyle.maxWidth,
|
|
55359
55922
|
_textStyle$x = textStyle.x,
|
|
@@ -55370,8 +55933,8 @@
|
|
|
55370
55933
|
var attr = Object.assign({
|
|
55371
55934
|
x: x,
|
|
55372
55935
|
y: y,
|
|
55373
|
-
width: null !== (
|
|
55374
|
-
height: null
|
|
55936
|
+
width: null !== (_b = null != mainTitleWidth ? mainTitleWidth : width) && void 0 !== _b ? _b : 0,
|
|
55937
|
+
height: null != fixedMainTitleHeight ? fixedMainTitleHeight : 0,
|
|
55375
55938
|
ellipsis: null == ellipsis || ellipsis,
|
|
55376
55939
|
wordBreak: null != wordBreak ? wordBreak : "break-word",
|
|
55377
55940
|
maxHeight: null != mainTitleMaxHeight ? mainTitleMaxHeight : maxHeight,
|
|
@@ -55387,7 +55950,7 @@
|
|
|
55387
55950
|
x: x,
|
|
55388
55951
|
y: y,
|
|
55389
55952
|
width: null !== (_d = null != mainTitleWidth ? mainTitleWidth : width) && void 0 !== _d ? _d : 0,
|
|
55390
|
-
height: null
|
|
55953
|
+
height: null != fixedMainTitleHeight ? fixedMainTitleHeight : 0,
|
|
55391
55954
|
ellipsis: ellipsis,
|
|
55392
55955
|
wordBreak: wordBreak,
|
|
55393
55956
|
maxHeight: null != mainTitleMaxHeight ? mainTitleMaxHeight : maxHeight,
|
|
@@ -55399,16 +55962,16 @@
|
|
|
55399
55962
|
text: isArray$3(text) ? text : [text],
|
|
55400
55963
|
whiteSpace: "normal"
|
|
55401
55964
|
}, textStyle), {
|
|
55402
|
-
maxLineWidth: null !== (
|
|
55403
|
-
heightLimit: null
|
|
55965
|
+
maxLineWidth: null !== (_f = null !== (_e = textStyle.maxLineWidth) && void 0 !== _e ? _e : mainTitleWidth) && void 0 !== _f ? _f : width,
|
|
55966
|
+
heightLimit: null !== (_g = textStyle.height) && void 0 !== _g ? _g : maxHeight,
|
|
55404
55967
|
lineClamp: lineClamp,
|
|
55405
55968
|
ellipsis: ellipsis,
|
|
55406
55969
|
x: x,
|
|
55407
55970
|
y: y
|
|
55408
55971
|
}), "text"));
|
|
55409
55972
|
}
|
|
55410
|
-
var
|
|
55411
|
-
|
|
55973
|
+
var mainTextBoundsHeight = this._mainTitle ? this._mainTitle.AABBBounds.height() : 0,
|
|
55974
|
+
mainTextBoundsWidth = this._mainTitle ? this._mainTitle.AABBBounds.width() : 0;
|
|
55412
55975
|
if (!1 !== this.attribute.visible && !1 !== subtextStyle.visible) {
|
|
55413
55976
|
var subTitleWidth = subtextStyle.width,
|
|
55414
55977
|
subTitleHeight = subtextStyle.height,
|
|
@@ -55423,7 +55986,7 @@
|
|
|
55423
55986
|
_subtextStyle$wordBre = subtextStyle.wordBreak,
|
|
55424
55987
|
_wordBreak = _subtextStyle$wordBre === void 0 ? "break-word" : _subtextStyle$wordBre,
|
|
55425
55988
|
_lineClamp = subtextStyle.lineClamp,
|
|
55426
|
-
maxSubTextHeight = Math.max(Number.MIN_VALUE, maxHeight -
|
|
55989
|
+
maxSubTextHeight = Math.max(Number.MIN_VALUE, maxHeight - mainTextBoundsHeight);
|
|
55427
55990
|
if ("rich" === subtextType || isValid$3(subtextStyle.character)) {
|
|
55428
55991
|
var _attr2 = Object.assign({
|
|
55429
55992
|
x: _x,
|
|
@@ -55462,37 +56025,33 @@
|
|
|
55462
56025
|
lineClamp: _lineClamp,
|
|
55463
56026
|
ellipsis: _ellipsis,
|
|
55464
56027
|
x: 0,
|
|
55465
|
-
y:
|
|
56028
|
+
y: mainTextBoundsHeight
|
|
55466
56029
|
}), "text"));
|
|
55467
56030
|
}
|
|
55468
|
-
var
|
|
55469
|
-
|
|
55470
|
-
var
|
|
55471
|
-
|
|
55472
|
-
if (isValid$3(width) && (
|
|
56031
|
+
var subTextBoundsHeight = this._subTitle ? this._subTitle.AABBBounds.height() : 0,
|
|
56032
|
+
subTextBoundsWidth = this._subTitle ? this._subTitle.AABBBounds.width() : 0;
|
|
56033
|
+
var totalWidth = Math.max(mainTextBoundsWidth, subTextBoundsWidth),
|
|
56034
|
+
totalHeight = mainTextBoundsHeight + (null !== (_q = subtextStyle.height) && void 0 !== _q ? _q : subTextBoundsHeight);
|
|
56035
|
+
if (isValid$3(width) && (totalWidth = width), isValid$3(height) && (totalHeight = height), isValid$3(minWidth) && totalWidth < minWidth && (totalWidth = minWidth), isValid$3(maxWidth) && totalWidth > maxWidth && (totalWidth = maxWidth), isValid$3(minHeight) && totalHeight < minHeight && (totalHeight = minHeight), isValid$3(maxHeight) && totalHeight > maxHeight && (totalHeight = maxHeight), group.attribute.width = totalWidth, group.attribute.height = totalHeight, group.attribute.boundsPadding = parsedPadding, this._mainTitle) {
|
|
55473
56036
|
if (isValid$3(align) || isValid$3(textStyle.align)) {
|
|
55474
56037
|
var mainTitleAlign = textStyle.align ? textStyle.align : align,
|
|
55475
|
-
_mainTitleWidth = null !== (_r = textStyle.width) && void 0 !== _r ? _r :
|
|
55476
|
-
"
|
|
55477
|
-
}
|
|
55478
|
-
if (isValid$3(verticalAlign) || isValid$3(textStyle.verticalAlign)) {
|
|
55479
|
-
var mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign,
|
|
55480
|
-
_mainTitleHeight = textStyle.height ? textStyle.height : titleHeight;
|
|
55481
|
-
"top" === mainTitleVerticalAlign ? (this._mainTitle.setAttribute("y", 0), this._mainTitle.setAttribute("textBaseline", "top")) : "middle" === mainTitleVerticalAlign ? (this._mainTitle.setAttribute("y", _mainTitleHeight / 2), this._mainTitle.setAttribute("textBaseline", "middle")) : "bottom" === mainTitleVerticalAlign && (this._mainTitle.setAttribute("y", _mainTitleHeight), this._mainTitle.setAttribute("textBaseline", "bottom"));
|
|
56038
|
+
_mainTitleWidth = null !== (_r = textStyle.width) && void 0 !== _r ? _r : totalWidth;
|
|
56039
|
+
"center" === mainTitleAlign ? (this._mainTitle.setAttribute("x", _mainTitleWidth / 2), this._mainTitle.setAttribute("textAlign", "center")) : "right" === mainTitleAlign ? (this._mainTitle.setAttribute("x", _mainTitleWidth), this._mainTitle.setAttribute("textAlign", "right")) : (this._mainTitle.setAttribute("x", 0), this._mainTitle.setAttribute("textAlign", "left"));
|
|
55482
56040
|
}
|
|
56041
|
+
var mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign,
|
|
56042
|
+
mainTitleHeight = null != fixedMainTitleHeight ? fixedMainTitleHeight : this._mainTitle.AABBBounds.empty() ? 0 : this._mainTitle.AABBBounds.height();
|
|
56043
|
+
"middle" === mainTitleVerticalAlign ? (this._mainTitle.setAttribute("y", mainTitleHeight / 2), this._mainTitle.setAttribute("textBaseline", "middle")) : "bottom" === mainTitleVerticalAlign ? (this._mainTitle.setAttribute("y", mainTitleHeight), this._mainTitle.setAttribute("textBaseline", "bottom")) : (this._mainTitle.setAttribute("y", 0), this._mainTitle.setAttribute("textBaseline", "top"));
|
|
55483
56044
|
}
|
|
55484
56045
|
if (this._subTitle) {
|
|
55485
56046
|
if (isValid$3(align) || isValid$3(subtextStyle.align)) {
|
|
55486
56047
|
var subTitleAlign = subtextStyle.align ? subtextStyle.align : align,
|
|
55487
|
-
_subTitleWidth = null !== (_s = subtextStyle.width) && void 0 !== _s ? _s :
|
|
55488
|
-
"
|
|
55489
|
-
}
|
|
55490
|
-
if (isValid$3(verticalAlign) || isValid$3(textStyle.verticalAlign)) {
|
|
55491
|
-
var subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign,
|
|
55492
|
-
subTitleYStart = maintextHeight,
|
|
55493
|
-
_subTitleHeight = null !== (_t = subtextStyle.height) && void 0 !== _t ? _t : 0;
|
|
55494
|
-
"top" === subTitleVerticalAlign ? (this._subTitle.setAttribute("y", subTitleYStart), this._subTitle.setAttribute("textBaseline", "top")) : "middle" === subTitleVerticalAlign ? (this._subTitle.setAttribute("y", subTitleYStart + _subTitleHeight / 2), this._subTitle.setAttribute("textBaseline", "middle")) : "bottom" === subTitleVerticalAlign && (this._subTitle.setAttribute("y", subTitleYStart + _subTitleHeight), this._subTitle.setAttribute("textBaseline", "bottom"));
|
|
56048
|
+
_subTitleWidth = null !== (_t = null !== (_s = subtextStyle.width) && void 0 !== _s ? _s : textStyle.width) && void 0 !== _t ? _t : totalWidth;
|
|
56049
|
+
"center" === subTitleAlign ? (this._subTitle.setAttribute("x", _subTitleWidth / 2), this._subTitle.setAttribute("textAlign", "center")) : "right" === subTitleAlign ? (this._subTitle.setAttribute("x", _subTitleWidth), this._subTitle.setAttribute("textAlign", "right")) : (this._subTitle.setAttribute("x", 0), this._subTitle.setAttribute("textAlign", "left"));
|
|
55495
56050
|
}
|
|
56051
|
+
var subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign,
|
|
56052
|
+
subTitleYStart = this._mainTitle ? isValid$3(fixedMainTitleHeight) ? this._mainTitle.AABBBounds.y1 + Math.max(this._mainTitle.AABBBounds.empty() ? 0 : this._mainTitle.AABBBounds.height(), fixedMainTitleHeight) : this._mainTitle.AABBBounds.y2 : 0,
|
|
56053
|
+
_subTitleHeight = null !== (_v = null !== (_u = subtextStyle.height) && void 0 !== _u ? _u : height) && void 0 !== _v ? _v : this._subTitle.AABBBounds.empty() ? 0 : this._subTitle.AABBBounds.height();
|
|
56054
|
+
"middle" === subTitleVerticalAlign ? (this._subTitle.setAttribute("y", subTitleYStart + _subTitleHeight / 2), this._subTitle.setAttribute("textBaseline", "middle")) : "bottom" === subTitleVerticalAlign ? (this._subTitle.setAttribute("y", subTitleYStart + _subTitleHeight), this._subTitle.setAttribute("textBaseline", "bottom")) : (this._subTitle.setAttribute("y", subTitleYStart), this._subTitle.setAttribute("textBaseline", "top"));
|
|
55496
56055
|
}
|
|
55497
56056
|
}
|
|
55498
56057
|
}]);
|
|
@@ -119103,7 +119662,7 @@
|
|
|
119103
119662
|
});
|
|
119104
119663
|
var application = new Application();
|
|
119105
119664
|
|
|
119106
|
-
var parse$
|
|
119665
|
+
var parse$3 = function () {
|
|
119107
119666
|
var tokens = {
|
|
119108
119667
|
linearGradient: /^(linear\-gradient)/i,
|
|
119109
119668
|
radialGradient: /^(radial\-gradient)/i,
|
|
@@ -119265,7 +119824,7 @@
|
|
|
119265
119824
|
key: "Parse",
|
|
119266
119825
|
value: function Parse(c) {
|
|
119267
119826
|
if (GradientParser.IsGradientStr(c)) try {
|
|
119268
|
-
var datum = parse$
|
|
119827
|
+
var datum = parse$3(c)[0];
|
|
119269
119828
|
if (datum) {
|
|
119270
119829
|
if ("linear" === datum.type) return GradientParser.ParseLinear(datum);
|
|
119271
119830
|
if ("radial" === datum.type) return GradientParser.ParseRadial(datum);
|
|
@@ -120507,7 +121066,7 @@
|
|
|
120507
121066
|
});
|
|
120508
121067
|
}
|
|
120509
121068
|
var globalThemeObj = newThemeObj();
|
|
120510
|
-
var Theme = /*#__PURE__*/function () {
|
|
121069
|
+
var Theme$1 = /*#__PURE__*/function () {
|
|
120511
121070
|
function Theme() {
|
|
120512
121071
|
_classCallCheck(this, Theme);
|
|
120513
121072
|
this.initTheme(), this.dirty = !1;
|
|
@@ -120585,7 +121144,7 @@
|
|
|
120585
121144
|
}
|
|
120586
121145
|
}]);
|
|
120587
121146
|
}();
|
|
120588
|
-
var globalTheme = new Theme();
|
|
121147
|
+
var globalTheme = new Theme$1();
|
|
120589
121148
|
function getTheme(graphic, theme) {
|
|
120590
121149
|
return graphic.glyphHost ? getTheme(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || graphic.attachedThemeGraphic && getTheme(graphic.attachedThemeGraphic) || globalTheme.getTheme();
|
|
120591
121150
|
}
|
|
@@ -124565,12 +125124,12 @@
|
|
|
124565
125124
|
}, {
|
|
124566
125125
|
key: "setTheme",
|
|
124567
125126
|
value: function setTheme(t) {
|
|
124568
|
-
return this.theme || (this.theme = new Theme()), this.theme.setTheme(t, this);
|
|
125127
|
+
return this.theme || (this.theme = new Theme$1()), this.theme.setTheme(t, this);
|
|
124569
125128
|
}
|
|
124570
125129
|
}, {
|
|
124571
125130
|
key: "createTheme",
|
|
124572
125131
|
value: function createTheme() {
|
|
124573
|
-
this.theme || (this.theme = new Theme());
|
|
125132
|
+
this.theme || (this.theme = new Theme$1());
|
|
124574
125133
|
}
|
|
124575
125134
|
}, {
|
|
124576
125135
|
key: "visibleAll",
|
|
@@ -124825,7 +125384,7 @@
|
|
|
124825
125384
|
width: _this.viewWidth,
|
|
124826
125385
|
height: _this.viewHeight,
|
|
124827
125386
|
zIndex: null !== (_a = params.zIndex) && void 0 !== _a ? _a : 0
|
|
124828
|
-
}), _this.layer = _assertThisInitialized(_this), _this.subLayers = new Map(), _this.theme = new Theme(), _this.background = "rgba(0, 0, 0, 0)", _this.afterDrawCbs = [];
|
|
125387
|
+
}), _this.layer = _assertThisInitialized(_this), _this.subLayers = new Map(), _this.theme = new Theme$1(), _this.background = "rgba(0, 0, 0, 0)", _this.afterDrawCbs = [];
|
|
124829
125388
|
return _this;
|
|
124830
125389
|
}
|
|
124831
125390
|
_inherits(Layer, _Group);
|
|
@@ -133736,7 +134295,7 @@
|
|
|
133736
134295
|
}, _this.afterTickCb = function () {
|
|
133737
134296
|
var _a;
|
|
133738
134297
|
_this.tickedBeforeRender = !0, "performance" === (null === (_a = _this.params.optimize) || void 0 === _a ? void 0 : _a.tickRenderMode) || "rendering" !== _this.state && _this.render();
|
|
133739
|
-
}, _this.params = params, _this.theme = new Theme(), _this.hooks = {
|
|
134298
|
+
}, _this.params = params, _this.theme = new Theme$1(), _this.hooks = {
|
|
133740
134299
|
beforeRender: new SyncHook(["stage"]),
|
|
133741
134300
|
afterRender: new SyncHook(["stage"])
|
|
133742
134301
|
}, _this.global = application.global, !_this.global.env && isBrowserEnv() && _this.global.setEnv("browser"), _this.window = container.get(VWindow), _this.renderService = container.get(RenderService), _this.pluginService = container.get(PluginService), _this.layerService = container.get(LayerService), _this.pluginService.active(_assertThisInitialized(_this), params), _this.window.create({
|
|
@@ -149065,14 +149624,14 @@
|
|
|
149065
149624
|
fantasy: 1,
|
|
149066
149625
|
monospace: 1
|
|
149067
149626
|
};
|
|
149068
|
-
var parse$
|
|
149627
|
+
var parse$1 = cssfontparser.exports = function (str, existing, dpi) {
|
|
149069
149628
|
var cacheKey = str + '-' + (existing || 'null') + '@' + dpi;
|
|
149070
149629
|
dpi = dpi || 96.0;
|
|
149071
149630
|
if (typeof cache[cacheKey] !== 'undefined') {
|
|
149072
149631
|
return cache[cacheKey];
|
|
149073
149632
|
}
|
|
149074
149633
|
if (existing) {
|
|
149075
|
-
existing = parse$
|
|
149634
|
+
existing = parse$1(existing, null, dpi);
|
|
149076
149635
|
}
|
|
149077
149636
|
if (str === 'inherit') {
|
|
149078
149637
|
return existing;
|
|
@@ -149157,10 +149716,10 @@
|
|
|
149157
149716
|
};
|
|
149158
149717
|
cssfontparser.exports.generics = generics;
|
|
149159
149718
|
var cssfontparserExports = cssfontparser.exports;
|
|
149160
|
-
var parse$
|
|
149719
|
+
var parse$2 = /*@__PURE__*/getDefaultExportFromCjs(cssfontparserExports);
|
|
149161
149720
|
|
|
149162
149721
|
function parseFont(font) {
|
|
149163
|
-
return parse$
|
|
149722
|
+
return parse$2(font);
|
|
149164
149723
|
}
|
|
149165
149724
|
|
|
149166
149725
|
function getQuadProps(paddingOrigin) {
|
|
@@ -149335,7 +149894,7 @@
|
|
|
149335
149894
|
for (; stack.length > 1;) stack.push(buildBinaryExpNode(stack));
|
|
149336
149895
|
return stack[0];
|
|
149337
149896
|
}
|
|
149338
|
-
function parse
|
|
149897
|
+
function parse(calcStr) {
|
|
149339
149898
|
return lex(tokenize(calcStr), calcStr);
|
|
149340
149899
|
}
|
|
149341
149900
|
function calcNode(node, context) {
|
|
@@ -149365,7 +149924,7 @@
|
|
|
149365
149924
|
throw new Error("calc error.");
|
|
149366
149925
|
}
|
|
149367
149926
|
function toPxInternal(value, context) {
|
|
149368
|
-
return calcNode(parse
|
|
149927
|
+
return calcNode(parse(value), context);
|
|
149369
149928
|
}
|
|
149370
149929
|
function toPx(value, context) {
|
|
149371
149930
|
return "string" == typeof value ? toPxInternal(value.trim(), context) : value - 0;
|
|
@@ -149615,598 +150174,6 @@
|
|
|
149615
150174
|
return !1;
|
|
149616
150175
|
}
|
|
149617
150176
|
|
|
149618
|
-
var lib$1 = {};
|
|
149619
|
-
|
|
149620
|
-
var gif = {};
|
|
149621
|
-
|
|
149622
|
-
var lib = {};
|
|
149623
|
-
|
|
149624
|
-
Object.defineProperty(lib, "__esModule", {
|
|
149625
|
-
value: true
|
|
149626
|
-
});
|
|
149627
|
-
lib.loop = lib.conditional = lib.parse = void 0;
|
|
149628
|
-
var parse = function parse(stream, schema) {
|
|
149629
|
-
var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
149630
|
-
var parent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : result;
|
|
149631
|
-
if (Array.isArray(schema)) {
|
|
149632
|
-
schema.forEach(function (partSchema) {
|
|
149633
|
-
return parse(stream, partSchema, result, parent);
|
|
149634
|
-
});
|
|
149635
|
-
} else if (typeof schema === 'function') {
|
|
149636
|
-
schema(stream, result, parent, parse);
|
|
149637
|
-
} else {
|
|
149638
|
-
var key = Object.keys(schema)[0];
|
|
149639
|
-
if (Array.isArray(schema[key])) {
|
|
149640
|
-
parent[key] = {};
|
|
149641
|
-
parse(stream, schema[key], result, parent[key]);
|
|
149642
|
-
} else {
|
|
149643
|
-
parent[key] = schema[key](stream, result, parent, parse);
|
|
149644
|
-
}
|
|
149645
|
-
}
|
|
149646
|
-
return result;
|
|
149647
|
-
};
|
|
149648
|
-
lib.parse = parse;
|
|
149649
|
-
var conditional = function conditional(schema, conditionFunc) {
|
|
149650
|
-
return function (stream, result, parent, parse) {
|
|
149651
|
-
if (conditionFunc(stream, result, parent)) {
|
|
149652
|
-
parse(stream, schema, result, parent);
|
|
149653
|
-
}
|
|
149654
|
-
};
|
|
149655
|
-
};
|
|
149656
|
-
lib.conditional = conditional;
|
|
149657
|
-
var loop = function loop(schema, continueFunc) {
|
|
149658
|
-
return function (stream, result, parent, parse) {
|
|
149659
|
-
var arr = [];
|
|
149660
|
-
var lastStreamPos = stream.pos;
|
|
149661
|
-
while (continueFunc(stream, result, parent)) {
|
|
149662
|
-
var newParent = {};
|
|
149663
|
-
parse(stream, schema, result, newParent); // cases when whole file is parsed but no termination is there and stream position is not getting updated as well
|
|
149664
|
-
// it falls into infinite recursion, null check to avoid the same
|
|
149665
|
-
|
|
149666
|
-
if (stream.pos === lastStreamPos) {
|
|
149667
|
-
break;
|
|
149668
|
-
}
|
|
149669
|
-
lastStreamPos = stream.pos;
|
|
149670
|
-
arr.push(newParent);
|
|
149671
|
-
}
|
|
149672
|
-
return arr;
|
|
149673
|
-
};
|
|
149674
|
-
};
|
|
149675
|
-
lib.loop = loop;
|
|
149676
|
-
|
|
149677
|
-
var uint8 = {};
|
|
149678
|
-
|
|
149679
|
-
Object.defineProperty(uint8, "__esModule", {
|
|
149680
|
-
value: true
|
|
149681
|
-
});
|
|
149682
|
-
uint8.readBits = uint8.readArray = uint8.readUnsigned = uint8.readString = uint8.peekBytes = uint8.readBytes = uint8.peekByte = uint8.readByte = uint8.buildStream = void 0;
|
|
149683
|
-
|
|
149684
|
-
// Default stream and parsers for Uint8TypedArray data type
|
|
149685
|
-
var buildStream = function buildStream(uint8Data) {
|
|
149686
|
-
return {
|
|
149687
|
-
data: uint8Data,
|
|
149688
|
-
pos: 0
|
|
149689
|
-
};
|
|
149690
|
-
};
|
|
149691
|
-
uint8.buildStream = buildStream;
|
|
149692
|
-
var readByte = function readByte() {
|
|
149693
|
-
return function (stream) {
|
|
149694
|
-
return stream.data[stream.pos++];
|
|
149695
|
-
};
|
|
149696
|
-
};
|
|
149697
|
-
uint8.readByte = readByte;
|
|
149698
|
-
var peekByte = function peekByte() {
|
|
149699
|
-
var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
149700
|
-
return function (stream) {
|
|
149701
|
-
return stream.data[stream.pos + offset];
|
|
149702
|
-
};
|
|
149703
|
-
};
|
|
149704
|
-
uint8.peekByte = peekByte;
|
|
149705
|
-
var readBytes = function readBytes(length) {
|
|
149706
|
-
return function (stream) {
|
|
149707
|
-
return stream.data.subarray(stream.pos, stream.pos += length);
|
|
149708
|
-
};
|
|
149709
|
-
};
|
|
149710
|
-
uint8.readBytes = readBytes;
|
|
149711
|
-
var peekBytes = function peekBytes(length) {
|
|
149712
|
-
return function (stream) {
|
|
149713
|
-
return stream.data.subarray(stream.pos, stream.pos + length);
|
|
149714
|
-
};
|
|
149715
|
-
};
|
|
149716
|
-
uint8.peekBytes = peekBytes;
|
|
149717
|
-
var readString = function readString(length) {
|
|
149718
|
-
return function (stream) {
|
|
149719
|
-
return Array.from(readBytes(length)(stream)).map(function (value) {
|
|
149720
|
-
return String.fromCharCode(value);
|
|
149721
|
-
}).join('');
|
|
149722
|
-
};
|
|
149723
|
-
};
|
|
149724
|
-
uint8.readString = readString;
|
|
149725
|
-
var readUnsigned = function readUnsigned(littleEndian) {
|
|
149726
|
-
return function (stream) {
|
|
149727
|
-
var bytes = readBytes(2)(stream);
|
|
149728
|
-
return littleEndian ? (bytes[1] << 8) + bytes[0] : (bytes[0] << 8) + bytes[1];
|
|
149729
|
-
};
|
|
149730
|
-
};
|
|
149731
|
-
uint8.readUnsigned = readUnsigned;
|
|
149732
|
-
var readArray = function readArray(byteSize, totalOrFunc) {
|
|
149733
|
-
return function (stream, result, parent) {
|
|
149734
|
-
var total = typeof totalOrFunc === 'function' ? totalOrFunc(stream, result, parent) : totalOrFunc;
|
|
149735
|
-
var parser = readBytes(byteSize);
|
|
149736
|
-
var arr = new Array(total);
|
|
149737
|
-
for (var i = 0; i < total; i++) {
|
|
149738
|
-
arr[i] = parser(stream);
|
|
149739
|
-
}
|
|
149740
|
-
return arr;
|
|
149741
|
-
};
|
|
149742
|
-
};
|
|
149743
|
-
uint8.readArray = readArray;
|
|
149744
|
-
var subBitsTotal = function subBitsTotal(bits, startIndex, length) {
|
|
149745
|
-
var result = 0;
|
|
149746
|
-
for (var i = 0; i < length; i++) {
|
|
149747
|
-
result += bits[startIndex + i] && Math.pow(2, length - i - 1);
|
|
149748
|
-
}
|
|
149749
|
-
return result;
|
|
149750
|
-
};
|
|
149751
|
-
var readBits = function readBits(schema) {
|
|
149752
|
-
return function (stream) {
|
|
149753
|
-
var _byte = readByte()(stream); // convert the byte to bit array
|
|
149754
|
-
|
|
149755
|
-
var bits = new Array(8);
|
|
149756
|
-
for (var i = 0; i < 8; i++) {
|
|
149757
|
-
bits[7 - i] = !!(_byte & 1 << i);
|
|
149758
|
-
} // convert the bit array to values based on the schema
|
|
149759
|
-
|
|
149760
|
-
return Object.keys(schema).reduce(function (res, key) {
|
|
149761
|
-
var def = schema[key];
|
|
149762
|
-
if (def.length) {
|
|
149763
|
-
res[key] = subBitsTotal(bits, def.index, def.length);
|
|
149764
|
-
} else {
|
|
149765
|
-
res[key] = bits[def.index];
|
|
149766
|
-
}
|
|
149767
|
-
return res;
|
|
149768
|
-
}, {});
|
|
149769
|
-
};
|
|
149770
|
-
};
|
|
149771
|
-
uint8.readBits = readBits;
|
|
149772
|
-
|
|
149773
|
-
(function (exports) {
|
|
149774
|
-
|
|
149775
|
-
Object.defineProperty(exports, "__esModule", {
|
|
149776
|
-
value: true
|
|
149777
|
-
});
|
|
149778
|
-
exports["default"] = void 0;
|
|
149779
|
-
var _ = lib;
|
|
149780
|
-
var _uint = uint8;
|
|
149781
|
-
|
|
149782
|
-
// a set of 0x00 terminated subblocks
|
|
149783
|
-
var subBlocksSchema = {
|
|
149784
|
-
blocks: function blocks(stream) {
|
|
149785
|
-
var terminator = 0x00;
|
|
149786
|
-
var chunks = [];
|
|
149787
|
-
var streamSize = stream.data.length;
|
|
149788
|
-
var total = 0;
|
|
149789
|
-
for (var size = (0, _uint.readByte)()(stream); size !== terminator; size = (0, _uint.readByte)()(stream)) {
|
|
149790
|
-
// size becomes undefined for some case when file is corrupted and terminator is not proper
|
|
149791
|
-
// null check to avoid recursion
|
|
149792
|
-
if (!size) break; // catch corrupted files with no terminator
|
|
149793
|
-
|
|
149794
|
-
if (stream.pos + size >= streamSize) {
|
|
149795
|
-
var availableSize = streamSize - stream.pos;
|
|
149796
|
-
chunks.push((0, _uint.readBytes)(availableSize)(stream));
|
|
149797
|
-
total += availableSize;
|
|
149798
|
-
break;
|
|
149799
|
-
}
|
|
149800
|
-
chunks.push((0, _uint.readBytes)(size)(stream));
|
|
149801
|
-
total += size;
|
|
149802
|
-
}
|
|
149803
|
-
var result = new Uint8Array(total);
|
|
149804
|
-
var offset = 0;
|
|
149805
|
-
for (var i = 0; i < chunks.length; i++) {
|
|
149806
|
-
result.set(chunks[i], offset);
|
|
149807
|
-
offset += chunks[i].length;
|
|
149808
|
-
}
|
|
149809
|
-
return result;
|
|
149810
|
-
}
|
|
149811
|
-
}; // global control extension
|
|
149812
|
-
|
|
149813
|
-
var gceSchema = (0, _.conditional)({
|
|
149814
|
-
gce: [{
|
|
149815
|
-
codes: (0, _uint.readBytes)(2)
|
|
149816
|
-
}, {
|
|
149817
|
-
byteSize: (0, _uint.readByte)()
|
|
149818
|
-
}, {
|
|
149819
|
-
extras: (0, _uint.readBits)({
|
|
149820
|
-
future: {
|
|
149821
|
-
index: 0,
|
|
149822
|
-
length: 3
|
|
149823
|
-
},
|
|
149824
|
-
disposal: {
|
|
149825
|
-
index: 3,
|
|
149826
|
-
length: 3
|
|
149827
|
-
},
|
|
149828
|
-
userInput: {
|
|
149829
|
-
index: 6
|
|
149830
|
-
},
|
|
149831
|
-
transparentColorGiven: {
|
|
149832
|
-
index: 7
|
|
149833
|
-
}
|
|
149834
|
-
})
|
|
149835
|
-
}, {
|
|
149836
|
-
delay: (0, _uint.readUnsigned)(true)
|
|
149837
|
-
}, {
|
|
149838
|
-
transparentColorIndex: (0, _uint.readByte)()
|
|
149839
|
-
}, {
|
|
149840
|
-
terminator: (0, _uint.readByte)()
|
|
149841
|
-
}]
|
|
149842
|
-
}, function (stream) {
|
|
149843
|
-
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
149844
|
-
return codes[0] === 0x21 && codes[1] === 0xf9;
|
|
149845
|
-
}); // image pipeline block
|
|
149846
|
-
|
|
149847
|
-
var imageSchema = (0, _.conditional)({
|
|
149848
|
-
image: [{
|
|
149849
|
-
code: (0, _uint.readByte)()
|
|
149850
|
-
}, {
|
|
149851
|
-
descriptor: [{
|
|
149852
|
-
left: (0, _uint.readUnsigned)(true)
|
|
149853
|
-
}, {
|
|
149854
|
-
top: (0, _uint.readUnsigned)(true)
|
|
149855
|
-
}, {
|
|
149856
|
-
width: (0, _uint.readUnsigned)(true)
|
|
149857
|
-
}, {
|
|
149858
|
-
height: (0, _uint.readUnsigned)(true)
|
|
149859
|
-
}, {
|
|
149860
|
-
lct: (0, _uint.readBits)({
|
|
149861
|
-
exists: {
|
|
149862
|
-
index: 0
|
|
149863
|
-
},
|
|
149864
|
-
interlaced: {
|
|
149865
|
-
index: 1
|
|
149866
|
-
},
|
|
149867
|
-
sort: {
|
|
149868
|
-
index: 2
|
|
149869
|
-
},
|
|
149870
|
-
future: {
|
|
149871
|
-
index: 3,
|
|
149872
|
-
length: 2
|
|
149873
|
-
},
|
|
149874
|
-
size: {
|
|
149875
|
-
index: 5,
|
|
149876
|
-
length: 3
|
|
149877
|
-
}
|
|
149878
|
-
})
|
|
149879
|
-
}]
|
|
149880
|
-
}, (0, _.conditional)({
|
|
149881
|
-
lct: (0, _uint.readArray)(3, function (stream, result, parent) {
|
|
149882
|
-
return Math.pow(2, parent.descriptor.lct.size + 1);
|
|
149883
|
-
})
|
|
149884
|
-
}, function (stream, result, parent) {
|
|
149885
|
-
return parent.descriptor.lct.exists;
|
|
149886
|
-
}), {
|
|
149887
|
-
data: [{
|
|
149888
|
-
minCodeSize: (0, _uint.readByte)()
|
|
149889
|
-
}, subBlocksSchema]
|
|
149890
|
-
}]
|
|
149891
|
-
}, function (stream) {
|
|
149892
|
-
return (0, _uint.peekByte)()(stream) === 0x2c;
|
|
149893
|
-
}); // plain text block
|
|
149894
|
-
|
|
149895
|
-
var textSchema = (0, _.conditional)({
|
|
149896
|
-
text: [{
|
|
149897
|
-
codes: (0, _uint.readBytes)(2)
|
|
149898
|
-
}, {
|
|
149899
|
-
blockSize: (0, _uint.readByte)()
|
|
149900
|
-
}, {
|
|
149901
|
-
preData: function preData(stream, result, parent) {
|
|
149902
|
-
return (0, _uint.readBytes)(parent.text.blockSize)(stream);
|
|
149903
|
-
}
|
|
149904
|
-
}, subBlocksSchema]
|
|
149905
|
-
}, function (stream) {
|
|
149906
|
-
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
149907
|
-
return codes[0] === 0x21 && codes[1] === 0x01;
|
|
149908
|
-
}); // application block
|
|
149909
|
-
|
|
149910
|
-
var applicationSchema = (0, _.conditional)({
|
|
149911
|
-
application: [{
|
|
149912
|
-
codes: (0, _uint.readBytes)(2)
|
|
149913
|
-
}, {
|
|
149914
|
-
blockSize: (0, _uint.readByte)()
|
|
149915
|
-
}, {
|
|
149916
|
-
id: function id(stream, result, parent) {
|
|
149917
|
-
return (0, _uint.readString)(parent.blockSize)(stream);
|
|
149918
|
-
}
|
|
149919
|
-
}, subBlocksSchema]
|
|
149920
|
-
}, function (stream) {
|
|
149921
|
-
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
149922
|
-
return codes[0] === 0x21 && codes[1] === 0xff;
|
|
149923
|
-
}); // comment block
|
|
149924
|
-
|
|
149925
|
-
var commentSchema = (0, _.conditional)({
|
|
149926
|
-
comment: [{
|
|
149927
|
-
codes: (0, _uint.readBytes)(2)
|
|
149928
|
-
}, subBlocksSchema]
|
|
149929
|
-
}, function (stream) {
|
|
149930
|
-
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
149931
|
-
return codes[0] === 0x21 && codes[1] === 0xfe;
|
|
149932
|
-
});
|
|
149933
|
-
var schema = [{
|
|
149934
|
-
header: [{
|
|
149935
|
-
signature: (0, _uint.readString)(3)
|
|
149936
|
-
}, {
|
|
149937
|
-
version: (0, _uint.readString)(3)
|
|
149938
|
-
}]
|
|
149939
|
-
}, {
|
|
149940
|
-
lsd: [{
|
|
149941
|
-
width: (0, _uint.readUnsigned)(true)
|
|
149942
|
-
}, {
|
|
149943
|
-
height: (0, _uint.readUnsigned)(true)
|
|
149944
|
-
}, {
|
|
149945
|
-
gct: (0, _uint.readBits)({
|
|
149946
|
-
exists: {
|
|
149947
|
-
index: 0
|
|
149948
|
-
},
|
|
149949
|
-
resolution: {
|
|
149950
|
-
index: 1,
|
|
149951
|
-
length: 3
|
|
149952
|
-
},
|
|
149953
|
-
sort: {
|
|
149954
|
-
index: 4
|
|
149955
|
-
},
|
|
149956
|
-
size: {
|
|
149957
|
-
index: 5,
|
|
149958
|
-
length: 3
|
|
149959
|
-
}
|
|
149960
|
-
})
|
|
149961
|
-
}, {
|
|
149962
|
-
backgroundColorIndex: (0, _uint.readByte)()
|
|
149963
|
-
}, {
|
|
149964
|
-
pixelAspectRatio: (0, _uint.readByte)()
|
|
149965
|
-
}]
|
|
149966
|
-
}, (0, _.conditional)({
|
|
149967
|
-
gct: (0, _uint.readArray)(3, function (stream, result) {
|
|
149968
|
-
return Math.pow(2, result.lsd.gct.size + 1);
|
|
149969
|
-
})
|
|
149970
|
-
}, function (stream, result) {
|
|
149971
|
-
return result.lsd.gct.exists;
|
|
149972
|
-
}),
|
|
149973
|
-
// content frames
|
|
149974
|
-
{
|
|
149975
|
-
frames: (0, _.loop)([gceSchema, applicationSchema, commentSchema, imageSchema, textSchema], function (stream) {
|
|
149976
|
-
var nextCode = (0, _uint.peekByte)()(stream); // rather than check for a terminator, we should check for the existence
|
|
149977
|
-
// of an ext or image block to avoid infinite loops
|
|
149978
|
-
//var terminator = 0x3B;
|
|
149979
|
-
//return nextCode !== terminator;
|
|
149980
|
-
|
|
149981
|
-
return nextCode === 0x21 || nextCode === 0x2c;
|
|
149982
|
-
})
|
|
149983
|
-
}];
|
|
149984
|
-
var _default = schema;
|
|
149985
|
-
exports["default"] = _default;
|
|
149986
|
-
})(gif);
|
|
149987
|
-
|
|
149988
|
-
var deinterlace$1 = {};
|
|
149989
|
-
|
|
149990
|
-
Object.defineProperty(deinterlace$1, "__esModule", {
|
|
149991
|
-
value: true
|
|
149992
|
-
});
|
|
149993
|
-
deinterlace$1.deinterlace = void 0;
|
|
149994
|
-
|
|
149995
|
-
/**
|
|
149996
|
-
* Deinterlace function from https://github.com/shachaf/jsgif
|
|
149997
|
-
*/
|
|
149998
|
-
var deinterlace = function deinterlace(pixels, width) {
|
|
149999
|
-
var newPixels = new Array(pixels.length);
|
|
150000
|
-
var rows = pixels.length / width;
|
|
150001
|
-
var cpRow = function cpRow(toRow, fromRow) {
|
|
150002
|
-
var fromPixels = pixels.slice(fromRow * width, (fromRow + 1) * width);
|
|
150003
|
-
newPixels.splice.apply(newPixels, [toRow * width, width].concat(fromPixels));
|
|
150004
|
-
}; // See appendix E.
|
|
150005
|
-
|
|
150006
|
-
var offsets = [0, 4, 2, 1];
|
|
150007
|
-
var steps = [8, 8, 4, 2];
|
|
150008
|
-
var fromRow = 0;
|
|
150009
|
-
for (var pass = 0; pass < 4; pass++) {
|
|
150010
|
-
for (var toRow = offsets[pass]; toRow < rows; toRow += steps[pass]) {
|
|
150011
|
-
cpRow(toRow, fromRow);
|
|
150012
|
-
fromRow++;
|
|
150013
|
-
}
|
|
150014
|
-
}
|
|
150015
|
-
return newPixels;
|
|
150016
|
-
};
|
|
150017
|
-
deinterlace$1.deinterlace = deinterlace;
|
|
150018
|
-
|
|
150019
|
-
var lzw$1 = {};
|
|
150020
|
-
|
|
150021
|
-
Object.defineProperty(lzw$1, "__esModule", {
|
|
150022
|
-
value: true
|
|
150023
|
-
});
|
|
150024
|
-
lzw$1.lzw = void 0;
|
|
150025
|
-
|
|
150026
|
-
/**
|
|
150027
|
-
* javascript port of java LZW decompression
|
|
150028
|
-
* Original java author url: https://gist.github.com/devunwired/4479231
|
|
150029
|
-
*/
|
|
150030
|
-
var lzw = function lzw(minCodeSize, data, pixelCount) {
|
|
150031
|
-
var MAX_STACK_SIZE = 4096;
|
|
150032
|
-
var nullCode = -1;
|
|
150033
|
-
var npix = pixelCount;
|
|
150034
|
-
var available, clear, code_mask, code_size, end_of_information, in_code, old_code, bits, code, i, datum, data_size, first, top, bi, pi;
|
|
150035
|
-
var dstPixels = new Array(pixelCount);
|
|
150036
|
-
var prefix = new Array(MAX_STACK_SIZE);
|
|
150037
|
-
var suffix = new Array(MAX_STACK_SIZE);
|
|
150038
|
-
var pixelStack = new Array(MAX_STACK_SIZE + 1); // Initialize GIF data stream decoder.
|
|
150039
|
-
|
|
150040
|
-
data_size = minCodeSize;
|
|
150041
|
-
clear = 1 << data_size;
|
|
150042
|
-
end_of_information = clear + 1;
|
|
150043
|
-
available = clear + 2;
|
|
150044
|
-
old_code = nullCode;
|
|
150045
|
-
code_size = data_size + 1;
|
|
150046
|
-
code_mask = (1 << code_size) - 1;
|
|
150047
|
-
for (code = 0; code < clear; code++) {
|
|
150048
|
-
prefix[code] = 0;
|
|
150049
|
-
suffix[code] = code;
|
|
150050
|
-
} // Decode GIF pixel stream.
|
|
150051
|
-
|
|
150052
|
-
var datum, bits, first, top, pi, bi;
|
|
150053
|
-
datum = bits = first = top = pi = bi = 0;
|
|
150054
|
-
for (i = 0; i < npix;) {
|
|
150055
|
-
if (top === 0) {
|
|
150056
|
-
if (bits < code_size) {
|
|
150057
|
-
// get the next byte
|
|
150058
|
-
datum += data[bi] << bits;
|
|
150059
|
-
bits += 8;
|
|
150060
|
-
bi++;
|
|
150061
|
-
continue;
|
|
150062
|
-
} // Get the next code.
|
|
150063
|
-
|
|
150064
|
-
code = datum & code_mask;
|
|
150065
|
-
datum >>= code_size;
|
|
150066
|
-
bits -= code_size; // Interpret the code
|
|
150067
|
-
|
|
150068
|
-
if (code > available || code == end_of_information) {
|
|
150069
|
-
break;
|
|
150070
|
-
}
|
|
150071
|
-
if (code == clear) {
|
|
150072
|
-
// Reset decoder.
|
|
150073
|
-
code_size = data_size + 1;
|
|
150074
|
-
code_mask = (1 << code_size) - 1;
|
|
150075
|
-
available = clear + 2;
|
|
150076
|
-
old_code = nullCode;
|
|
150077
|
-
continue;
|
|
150078
|
-
}
|
|
150079
|
-
if (old_code == nullCode) {
|
|
150080
|
-
pixelStack[top++] = suffix[code];
|
|
150081
|
-
old_code = code;
|
|
150082
|
-
first = code;
|
|
150083
|
-
continue;
|
|
150084
|
-
}
|
|
150085
|
-
in_code = code;
|
|
150086
|
-
if (code == available) {
|
|
150087
|
-
pixelStack[top++] = first;
|
|
150088
|
-
code = old_code;
|
|
150089
|
-
}
|
|
150090
|
-
while (code > clear) {
|
|
150091
|
-
pixelStack[top++] = suffix[code];
|
|
150092
|
-
code = prefix[code];
|
|
150093
|
-
}
|
|
150094
|
-
first = suffix[code] & 0xff;
|
|
150095
|
-
pixelStack[top++] = first; // add a new string to the table, but only if space is available
|
|
150096
|
-
// if not, just continue with current table until a clear code is found
|
|
150097
|
-
// (deferred clear code implementation as per GIF spec)
|
|
150098
|
-
|
|
150099
|
-
if (available < MAX_STACK_SIZE) {
|
|
150100
|
-
prefix[available] = old_code;
|
|
150101
|
-
suffix[available] = first;
|
|
150102
|
-
available++;
|
|
150103
|
-
if ((available & code_mask) === 0 && available < MAX_STACK_SIZE) {
|
|
150104
|
-
code_size++;
|
|
150105
|
-
code_mask += available;
|
|
150106
|
-
}
|
|
150107
|
-
}
|
|
150108
|
-
old_code = in_code;
|
|
150109
|
-
} // Pop a pixel off the pixel stack.
|
|
150110
|
-
|
|
150111
|
-
top--;
|
|
150112
|
-
dstPixels[pi++] = pixelStack[top];
|
|
150113
|
-
i++;
|
|
150114
|
-
}
|
|
150115
|
-
for (i = pi; i < npix; i++) {
|
|
150116
|
-
dstPixels[i] = 0; // clear missing pixels
|
|
150117
|
-
}
|
|
150118
|
-
return dstPixels;
|
|
150119
|
-
};
|
|
150120
|
-
lzw$1.lzw = lzw;
|
|
150121
|
-
|
|
150122
|
-
Object.defineProperty(lib$1, "__esModule", {
|
|
150123
|
-
value: true
|
|
150124
|
-
});
|
|
150125
|
-
var decompressFrames_1 = lib$1.decompressFrames = lib$1.decompressFrame = parseGIF_1 = lib$1.parseGIF = void 0;
|
|
150126
|
-
var _gif = _interopRequireDefault(gif);
|
|
150127
|
-
var _jsBinarySchemaParser = lib;
|
|
150128
|
-
var _uint = uint8;
|
|
150129
|
-
var _deinterlace = deinterlace$1;
|
|
150130
|
-
var _lzw = lzw$1;
|
|
150131
|
-
function _interopRequireDefault(obj) {
|
|
150132
|
-
return obj && obj.__esModule ? obj : {
|
|
150133
|
-
"default": obj
|
|
150134
|
-
};
|
|
150135
|
-
}
|
|
150136
|
-
var parseGIF = function parseGIF(arrayBuffer) {
|
|
150137
|
-
var byteData = new Uint8Array(arrayBuffer);
|
|
150138
|
-
return (0, _jsBinarySchemaParser.parse)((0, _uint.buildStream)(byteData), _gif["default"]);
|
|
150139
|
-
};
|
|
150140
|
-
var parseGIF_1 = lib$1.parseGIF = parseGIF;
|
|
150141
|
-
var generatePatch = function generatePatch(image) {
|
|
150142
|
-
var totalPixels = image.pixels.length;
|
|
150143
|
-
var patchData = new Uint8ClampedArray(totalPixels * 4);
|
|
150144
|
-
for (var i = 0; i < totalPixels; i++) {
|
|
150145
|
-
var pos = i * 4;
|
|
150146
|
-
var colorIndex = image.pixels[i];
|
|
150147
|
-
var color = image.colorTable[colorIndex] || [0, 0, 0];
|
|
150148
|
-
patchData[pos] = color[0];
|
|
150149
|
-
patchData[pos + 1] = color[1];
|
|
150150
|
-
patchData[pos + 2] = color[2];
|
|
150151
|
-
patchData[pos + 3] = colorIndex !== image.transparentIndex ? 255 : 0;
|
|
150152
|
-
}
|
|
150153
|
-
return patchData;
|
|
150154
|
-
};
|
|
150155
|
-
var decompressFrame = function decompressFrame(frame, gct, buildImagePatch) {
|
|
150156
|
-
if (!frame.image) {
|
|
150157
|
-
console.warn('gif frame does not have associated image.');
|
|
150158
|
-
return;
|
|
150159
|
-
}
|
|
150160
|
-
var image = frame.image; // get the number of pixels
|
|
150161
|
-
|
|
150162
|
-
var totalPixels = image.descriptor.width * image.descriptor.height; // do lzw decompression
|
|
150163
|
-
|
|
150164
|
-
var pixels = (0, _lzw.lzw)(image.data.minCodeSize, image.data.blocks, totalPixels); // deal with interlacing if necessary
|
|
150165
|
-
|
|
150166
|
-
if (image.descriptor.lct.interlaced) {
|
|
150167
|
-
pixels = (0, _deinterlace.deinterlace)(pixels, image.descriptor.width);
|
|
150168
|
-
}
|
|
150169
|
-
var resultImage = {
|
|
150170
|
-
pixels: pixels,
|
|
150171
|
-
dims: {
|
|
150172
|
-
top: frame.image.descriptor.top,
|
|
150173
|
-
left: frame.image.descriptor.left,
|
|
150174
|
-
width: frame.image.descriptor.width,
|
|
150175
|
-
height: frame.image.descriptor.height
|
|
150176
|
-
}
|
|
150177
|
-
}; // color table
|
|
150178
|
-
|
|
150179
|
-
if (image.descriptor.lct && image.descriptor.lct.exists) {
|
|
150180
|
-
resultImage.colorTable = image.lct;
|
|
150181
|
-
} else {
|
|
150182
|
-
resultImage.colorTable = gct;
|
|
150183
|
-
} // add per frame relevant gce information
|
|
150184
|
-
|
|
150185
|
-
if (frame.gce) {
|
|
150186
|
-
resultImage.delay = (frame.gce.delay || 10) * 10; // convert to ms
|
|
150187
|
-
|
|
150188
|
-
resultImage.disposalType = frame.gce.extras.disposal; // transparency
|
|
150189
|
-
|
|
150190
|
-
if (frame.gce.extras.transparentColorGiven) {
|
|
150191
|
-
resultImage.transparentIndex = frame.gce.transparentColorIndex;
|
|
150192
|
-
}
|
|
150193
|
-
} // create canvas usable imagedata if desired
|
|
150194
|
-
|
|
150195
|
-
if (buildImagePatch) {
|
|
150196
|
-
resultImage.patch = generatePatch(resultImage);
|
|
150197
|
-
}
|
|
150198
|
-
return resultImage;
|
|
150199
|
-
};
|
|
150200
|
-
lib$1.decompressFrame = decompressFrame;
|
|
150201
|
-
var decompressFrames = function decompressFrames(parsedGif, buildImagePatches) {
|
|
150202
|
-
return parsedGif.frames.filter(function (f) {
|
|
150203
|
-
return f.image;
|
|
150204
|
-
}).map(function (f) {
|
|
150205
|
-
return decompressFrame(f, parsedGif.gct, buildImagePatches);
|
|
150206
|
-
});
|
|
150207
|
-
};
|
|
150208
|
-
decompressFrames_1 = lib$1.decompressFrames = decompressFrames;
|
|
150209
|
-
|
|
150210
150177
|
var Icon$1 = /*#__PURE__*/function (_Image) {
|
|
150211
150178
|
function Icon(params) {
|
|
150212
150179
|
var _this;
|
|
@@ -193069,6 +193036,7 @@
|
|
|
193069
193036
|
registerLabelItemVisibilityAction();
|
|
193070
193037
|
}
|
|
193071
193038
|
|
|
193039
|
+
var SHAPE_SELECT_COLOR$1 = "#3073F2";
|
|
193072
193040
|
var PickEventType = {
|
|
193073
193041
|
pointerup: !0,
|
|
193074
193042
|
click: !0,
|
|
@@ -193199,11 +193167,66 @@
|
|
|
193199
193167
|
}]);
|
|
193200
193168
|
}(EventEmitter);
|
|
193201
193169
|
|
|
193170
|
+
var SHAPE_HOVER_COLOR = "#3073F2";
|
|
193171
|
+
var SHAPE_SELECT_COLOR = "#3073F2";
|
|
193172
|
+
var DRAG_ANCHOR_COLOR = "#fea53e";
|
|
193173
|
+
var MinSize = 20;
|
|
193174
|
+
|
|
193175
|
+
var Theme = /*#__PURE__*/function () {
|
|
193176
|
+
function Theme() {
|
|
193177
|
+
_classCallCheck(this, Theme);
|
|
193178
|
+
this.layoutTransformerControl = {
|
|
193179
|
+
resizeBorder: {
|
|
193180
|
+
stroke: SHAPE_SELECT_COLOR$1,
|
|
193181
|
+
lineWidth: 1
|
|
193182
|
+
},
|
|
193183
|
+
cornerRect: {
|
|
193184
|
+
fill: "white",
|
|
193185
|
+
stroke: SHAPE_SELECT_COLOR$1,
|
|
193186
|
+
lineWidth: 1,
|
|
193187
|
+
width: 8,
|
|
193188
|
+
height: 8,
|
|
193189
|
+
cornerRadius: 2
|
|
193190
|
+
},
|
|
193191
|
+
rotateCircle: {
|
|
193192
|
+
fill: "white",
|
|
193193
|
+
stroke: SHAPE_SELECT_COLOR$1,
|
|
193194
|
+
radius: 10
|
|
193195
|
+
},
|
|
193196
|
+
rotatePath: {
|
|
193197
|
+
fill: "#000000",
|
|
193198
|
+
size: 10,
|
|
193199
|
+
angle: Math.PI,
|
|
193200
|
+
symbolType: "M95.403.22c0 46.312-33.237 85.002-77.109 93.484v25.663l-69.76-40 69.76-40v23.494C45.47 54.991 65.403 29.897 65.403.219c0-35.962-29.258-65.22-65.22-65.22s-65.22 29.258-65.22 65.22c0 9.686 2.068 19.001 6.148 27.688l-27.154 12.754C-92.011 27.954-95.037 14.348-95.037.22-95.036-52.284-52.32-95 .184-95S95.403-52.284 95.403.22z"
|
|
193201
|
+
},
|
|
193202
|
+
handlerLine: {
|
|
193203
|
+
stroke: SHAPE_SELECT_COLOR$1,
|
|
193204
|
+
lineWidth: 1,
|
|
193205
|
+
size: 24
|
|
193206
|
+
},
|
|
193207
|
+
shapeCircle: {
|
|
193208
|
+
fill: "white",
|
|
193209
|
+
lineWidth: 1,
|
|
193210
|
+
radius: 4,
|
|
193211
|
+
stroke: DRAG_ANCHOR_COLOR,
|
|
193212
|
+
startAngle: 0,
|
|
193213
|
+
endAngle: 2 * Math.PI
|
|
193214
|
+
}
|
|
193215
|
+
};
|
|
193216
|
+
}
|
|
193217
|
+
return _createClass(Theme, [{
|
|
193218
|
+
key: "setLayoutTransformerControlTheme",
|
|
193219
|
+
value: function setLayoutTransformerControlTheme(theme) {
|
|
193220
|
+
merge$1(this.layoutTransformerControl, theme);
|
|
193221
|
+
}
|
|
193222
|
+
}]);
|
|
193223
|
+
}();
|
|
193224
|
+
|
|
193202
193225
|
var Edit = /*#__PURE__*/function (_EventEmitter) {
|
|
193203
193226
|
function Edit(story) {
|
|
193204
193227
|
var _this;
|
|
193205
193228
|
_classCallCheck(this, Edit);
|
|
193206
|
-
_this = _callSuper(this, Edit), _this.story = story, _this._selectionMap = {}, _this._editGlobalState = {
|
|
193229
|
+
_this = _callSuper(this, Edit), _this.story = story, _this.theme = new Theme(), _this._selectionMap = {}, _this._editGlobalState = {
|
|
193207
193230
|
seriesMarkMode: SeriesMarkMode.all
|
|
193208
193231
|
}, _this.onStoryEvent = function (event, type) {
|
|
193209
193232
|
var _a;
|
|
@@ -193349,11 +193372,6 @@
|
|
|
193349
193372
|
}(EventEmitter);
|
|
193350
193373
|
Edit.selectionConstructorMap = {};
|
|
193351
193374
|
|
|
193352
|
-
var SHAPE_HOVER_COLOR = "#3073F2";
|
|
193353
|
-
var SHAPE_SELECT_COLOR = "#3073F2";
|
|
193354
|
-
var DRAG_ANCHOR_COLOR = "#fea53e";
|
|
193355
|
-
var MinSize = 20;
|
|
193356
|
-
|
|
193357
193375
|
var DragComponent = /*#__PURE__*/function () {
|
|
193358
193376
|
function DragComponent(stage) {
|
|
193359
193377
|
var _this = this;
|
|
@@ -193473,7 +193491,7 @@
|
|
|
193473
193491
|
var _a, _b;
|
|
193474
193492
|
_this = _callSuper(this, TransformController, [merge$1({
|
|
193475
193493
|
shadowRootIdx: 1
|
|
193476
|
-
}, TransformController.defaultAttributes, attributes)]), _this.type = "transformController", _this.name = "transformController", _this.isDragging = !1, _this.dragStartAngle = 0, _this._snapThreshold = 6, _this._actualSnapBounds = null, _this.minSize = {
|
|
193494
|
+
}, TransformController.defaultAttributes, editSelection.edit.theme.layoutTransformerControl, attributes)]), _this.type = "transformController", _this.name = "transformController", _this.isDragging = !1, _this.dragStartAngle = 0, _this._snapThreshold = 6, _this._actualSnapBounds = null, _this.minSize = {
|
|
193477
193495
|
width: MinSize,
|
|
193478
193496
|
height: MinSize
|
|
193479
193497
|
}, _this.proportionalScaling = !1, _this._setCursor = null, _this._dragElement = function (moveX, moveY) {
|
|
@@ -193812,14 +193830,19 @@
|
|
|
193812
193830
|
cornerRect = _this$attribute.cornerRect,
|
|
193813
193831
|
rotateCircle = _this$attribute.rotateCircle,
|
|
193814
193832
|
rotatePath = _this$attribute.rotatePath,
|
|
193815
|
-
|
|
193833
|
+
_handlerLine = _this$attribute.handlerLine,
|
|
193816
193834
|
shapeCircle = _this$attribute.shapeCircle,
|
|
193817
193835
|
_this$attribute$enabl = _this$attribute.enabledAnchors,
|
|
193818
193836
|
enabledAnchors = _this$attribute$enabl === void 0 ? ["top", "bottom", "left-top", "left-bottom", "right", "left", "right-top", "right-bottom"] : _this$attribute$enabl,
|
|
193819
193837
|
_this$attribute$shape = _this$attribute.shapePoints,
|
|
193820
193838
|
shapePoints = _this$attribute$shape === void 0 ? [] : _this$attribute$shape,
|
|
193821
|
-
isShapePointAbsolute = _this$attribute.isShapePointAbsolute
|
|
193822
|
-
|
|
193839
|
+
isShapePointAbsolute = _this$attribute.isShapePointAbsolute;
|
|
193840
|
+
var scaleX = 1,
|
|
193841
|
+
scaleY = 1;
|
|
193842
|
+
this.layer && (scaleX = this.layer.attribute.scaleX ? 1 / this.layer.attribute.scaleX : scaleX, scaleY = this.layer.attribute.scaleY ? 1 / this.layer.attribute.scaleY : scaleY);
|
|
193843
|
+
var handlerLine = cloneDeep(_handlerLine);
|
|
193844
|
+
handlerLine.size *= (scaleX + scaleY) / 2;
|
|
193845
|
+
var root = this.editBorder.shadowRoot;
|
|
193823
193846
|
if (!root || 1 === this.count) return;
|
|
193824
193847
|
var parsedPadding = normalizePadding$1(padding),
|
|
193825
193848
|
_this$rect$attribute2 = this.rect.attribute,
|
|
@@ -193864,27 +193887,30 @@
|
|
|
193864
193887
|
x: 0,
|
|
193865
193888
|
y: -handlerLine.size
|
|
193866
193889
|
}]
|
|
193867
|
-
}, handlerLine), "line"), root.createOrUpdateChild("rotate-all", Object.assign({
|
|
193890
|
+
}, handlerLine), "line"), root.createOrUpdateChild("rotate-all", Object.assign(Object.assign({
|
|
193868
193891
|
x: minX + width / 2,
|
|
193869
193892
|
y: minY - handlerLine.size - rotateCircle.radius,
|
|
193870
193893
|
cursor: "grab"
|
|
193871
|
-
}, rotateCircle),
|
|
193894
|
+
}, rotateCircle), {
|
|
193895
|
+
radius: rotateCircle.radius * (scaleX + scaleY) / 2
|
|
193896
|
+
}), "circle"), root.createOrUpdateChild("path-rotate", Object.assign(Object.assign({
|
|
193872
193897
|
pickable: !1,
|
|
193873
|
-
x: minX + width / 2
|
|
193874
|
-
y: minY - handlerLine.size
|
|
193875
|
-
|
|
193876
|
-
|
|
193877
|
-
|
|
193878
|
-
|
|
193879
|
-
dy: -.5
|
|
193880
|
-
}, rotatePath), "path")), this._editorConfig.resize && enabledAnchors.forEach(function (anchor) {
|
|
193898
|
+
x: minX + width / 2,
|
|
193899
|
+
y: minY - handlerLine.size - rotateCircle.radius,
|
|
193900
|
+
cursor: "grab"
|
|
193901
|
+
}, rotatePath), {
|
|
193902
|
+
size: rotatePath.size * (scaleX + scaleY) / 2
|
|
193903
|
+
}), "symbol")), this._editorConfig.resize && enabledAnchors.forEach(function (anchor) {
|
|
193881
193904
|
if (!cornerAnchors.includes(anchor)) return;
|
|
193882
193905
|
var item = anchorPositionMap[anchor],
|
|
193883
193906
|
cursor = anchorCursorMap[anchor];
|
|
193884
193907
|
root.createOrUpdateChild("scale-".concat(anchor), Object.assign({
|
|
193885
193908
|
x: minX + item[0] * width - cornerRect.width / 2,
|
|
193886
193909
|
y: minY + item[1] * height - cornerRect.height / 2,
|
|
193887
|
-
cursor: cursor
|
|
193910
|
+
cursor: cursor,
|
|
193911
|
+
scaleX: scaleX,
|
|
193912
|
+
scaleY: scaleY,
|
|
193913
|
+
scaleCenter: ["50%", "50%"]
|
|
193888
193914
|
}, cornerRect), "rect");
|
|
193889
193915
|
}), this._editorConfig.reshape) {
|
|
193890
193916
|
var shapePointsChildren = root.children.filter(function (child) {
|
|
@@ -194155,7 +194181,7 @@
|
|
|
194155
194181
|
fill: "#000000",
|
|
194156
194182
|
size: 12,
|
|
194157
194183
|
angle: Math.PI,
|
|
194158
|
-
|
|
194184
|
+
symbolType: "M95.403.22c0 46.312-33.237 85.002-77.109 93.484v25.663l-69.76-40 69.76-40v23.494C45.47 54.991 65.403 29.897 65.403.219c0-35.962-29.258-65.22-65.22-65.22s-65.22 29.258-65.22 65.22c0 9.686 2.068 19.001 6.148 27.688l-27.154 12.754C-92.011 27.954-95.037 14.348-95.037.22-95.036-52.284-52.32-95 .184-95S95.403-52.284 95.403.22z"
|
|
194159
194185
|
},
|
|
194160
194186
|
handlerLine: {
|
|
194161
194187
|
stroke: SHAPE_SELECT_COLOR,
|
|
@@ -194255,7 +194281,7 @@
|
|
|
194255
194281
|
}, {
|
|
194256
194282
|
key: "startEdit",
|
|
194257
194283
|
value: function startEdit(actionInfo) {
|
|
194258
|
-
var emitEvent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !
|
|
194284
|
+
var emitEvent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
194259
194285
|
this.isEditing || (this.isEditing = !0, this._actionInfo = actionInfo, actionInfo && actionInfo.character && (this._activeCharacter = actionInfo.character), this.activeLayoutController(), emitEvent && this.edit.emitStartEdit({
|
|
194260
194286
|
type: this.type,
|
|
194261
194287
|
actionInfo: actionInfo,
|