@visactor/vstory 0.0.23-alpha.11 → 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 +782 -935
- package/dist/index.min.js +1 -1
- package/package.json +9 -9
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) {
|
|
@@ -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,
|
|
@@ -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",
|
|
@@ -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) {
|
|
@@ -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: {}};
|
|
@@ -40092,10 +40629,10 @@
|
|
|
40092
40629
|
}
|
|
40093
40630
|
return results;
|
|
40094
40631
|
};
|
|
40095
|
-
var lib
|
|
40632
|
+
var lib = _simplifyGeometry;
|
|
40096
40633
|
|
|
40097
40634
|
(function (module) {
|
|
40098
|
-
var simplify = lib
|
|
40635
|
+
var simplify = lib;
|
|
40099
40636
|
module.exports = function (geojson, tolerance, dontClone) {
|
|
40100
40637
|
if (!dontClone) geojson = JSON.parse(JSON.stringify(geojson)); // clone obj
|
|
40101
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');
|
|
@@ -48432,7 +48969,12 @@
|
|
|
48432
48969
|
customLayoutFunc = _this$attribute.customLayoutFunc,
|
|
48433
48970
|
customOverlapFunc = _this$attribute.customOverlapFunc;
|
|
48434
48971
|
var data = this.attribute.data;
|
|
48435
|
-
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
|
+
}
|
|
48436
48978
|
var labels = this._initText(data);
|
|
48437
48979
|
labels = isFunction$3(customLayoutFunc) ? customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? function (d) {
|
|
48438
48980
|
return _this2._idToPoint.get(d.id);
|
|
@@ -52366,23 +52908,12 @@
|
|
|
52366
52908
|
x1 = _this$_area$AABBBound.x1,
|
|
52367
52909
|
x2 = _this$_area$AABBBound.x2,
|
|
52368
52910
|
y1 = _this$_area$AABBBound.y1,
|
|
52369
|
-
y2 = _this$_area$AABBBound.y2
|
|
52370
|
-
|
|
52371
|
-
|
|
52372
|
-
|
|
52373
|
-
|
|
52374
|
-
|
|
52375
|
-
y: (y1 + y2) / 2
|
|
52376
|
-
} : position.includes("top") || position.includes("Top") ? {
|
|
52377
|
-
x: (x1 + x2) / 2,
|
|
52378
|
-
y: y1
|
|
52379
|
-
} : position.includes("bottom") || position.includes("Bottom") ? {
|
|
52380
|
-
x: (x1 + x2) / 2,
|
|
52381
|
-
y: y2
|
|
52382
|
-
} : {
|
|
52383
|
-
x: (x1 + x2) / 2,
|
|
52384
|
-
y: (y1 + y2) / 2
|
|
52385
|
-
};
|
|
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;
|
|
52386
52917
|
}
|
|
52387
52918
|
}, {
|
|
52388
52919
|
key: "setLabelPos",
|
|
@@ -55357,7 +55888,7 @@
|
|
|
55357
55888
|
return _createClass(Title, [{
|
|
55358
55889
|
key: "render",
|
|
55359
55890
|
value: function render() {
|
|
55360
|
-
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;
|
|
55361
55892
|
var _this$attribute = this.attribute,
|
|
55362
55893
|
textType = _this$attribute.textType,
|
|
55363
55894
|
text = _this$attribute.text,
|
|
@@ -55382,10 +55913,10 @@
|
|
|
55382
55913
|
x: parsedPadding[3],
|
|
55383
55914
|
y: parsedPadding[0],
|
|
55384
55915
|
zIndex: 1
|
|
55385
|
-
}, "group")
|
|
55916
|
+
}, "group"),
|
|
55917
|
+
fixedMainTitleHeight = null !== (_a = textStyle.height) && void 0 !== _a ? _a : height;
|
|
55386
55918
|
if (!1 !== this.attribute.visible && !1 !== textStyle.visible) {
|
|
55387
55919
|
var mainTitleWidth = textStyle.width,
|
|
55388
|
-
mainTitleHeight = textStyle.height,
|
|
55389
55920
|
mainTitleMaxHeight = textStyle.maxHeight,
|
|
55390
55921
|
mainTitleMaxWidth = textStyle.maxWidth,
|
|
55391
55922
|
_textStyle$x = textStyle.x,
|
|
@@ -55402,8 +55933,8 @@
|
|
|
55402
55933
|
var attr = Object.assign({
|
|
55403
55934
|
x: x,
|
|
55404
55935
|
y: y,
|
|
55405
|
-
width: null !== (
|
|
55406
|
-
height: null
|
|
55936
|
+
width: null !== (_b = null != mainTitleWidth ? mainTitleWidth : width) && void 0 !== _b ? _b : 0,
|
|
55937
|
+
height: null != fixedMainTitleHeight ? fixedMainTitleHeight : 0,
|
|
55407
55938
|
ellipsis: null == ellipsis || ellipsis,
|
|
55408
55939
|
wordBreak: null != wordBreak ? wordBreak : "break-word",
|
|
55409
55940
|
maxHeight: null != mainTitleMaxHeight ? mainTitleMaxHeight : maxHeight,
|
|
@@ -55419,7 +55950,7 @@
|
|
|
55419
55950
|
x: x,
|
|
55420
55951
|
y: y,
|
|
55421
55952
|
width: null !== (_d = null != mainTitleWidth ? mainTitleWidth : width) && void 0 !== _d ? _d : 0,
|
|
55422
|
-
height: null
|
|
55953
|
+
height: null != fixedMainTitleHeight ? fixedMainTitleHeight : 0,
|
|
55423
55954
|
ellipsis: ellipsis,
|
|
55424
55955
|
wordBreak: wordBreak,
|
|
55425
55956
|
maxHeight: null != mainTitleMaxHeight ? mainTitleMaxHeight : maxHeight,
|
|
@@ -55431,16 +55962,16 @@
|
|
|
55431
55962
|
text: isArray$3(text) ? text : [text],
|
|
55432
55963
|
whiteSpace: "normal"
|
|
55433
55964
|
}, textStyle), {
|
|
55434
|
-
maxLineWidth: null !== (
|
|
55435
|
-
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,
|
|
55436
55967
|
lineClamp: lineClamp,
|
|
55437
55968
|
ellipsis: ellipsis,
|
|
55438
55969
|
x: x,
|
|
55439
55970
|
y: y
|
|
55440
55971
|
}), "text"));
|
|
55441
55972
|
}
|
|
55442
|
-
var
|
|
55443
|
-
|
|
55973
|
+
var mainTextBoundsHeight = this._mainTitle ? this._mainTitle.AABBBounds.height() : 0,
|
|
55974
|
+
mainTextBoundsWidth = this._mainTitle ? this._mainTitle.AABBBounds.width() : 0;
|
|
55444
55975
|
if (!1 !== this.attribute.visible && !1 !== subtextStyle.visible) {
|
|
55445
55976
|
var subTitleWidth = subtextStyle.width,
|
|
55446
55977
|
subTitleHeight = subtextStyle.height,
|
|
@@ -55455,7 +55986,7 @@
|
|
|
55455
55986
|
_subtextStyle$wordBre = subtextStyle.wordBreak,
|
|
55456
55987
|
_wordBreak = _subtextStyle$wordBre === void 0 ? "break-word" : _subtextStyle$wordBre,
|
|
55457
55988
|
_lineClamp = subtextStyle.lineClamp,
|
|
55458
|
-
maxSubTextHeight = Math.max(Number.MIN_VALUE, maxHeight -
|
|
55989
|
+
maxSubTextHeight = Math.max(Number.MIN_VALUE, maxHeight - mainTextBoundsHeight);
|
|
55459
55990
|
if ("rich" === subtextType || isValid$3(subtextStyle.character)) {
|
|
55460
55991
|
var _attr2 = Object.assign({
|
|
55461
55992
|
x: _x,
|
|
@@ -55494,37 +56025,33 @@
|
|
|
55494
56025
|
lineClamp: _lineClamp,
|
|
55495
56026
|
ellipsis: _ellipsis,
|
|
55496
56027
|
x: 0,
|
|
55497
|
-
y:
|
|
56028
|
+
y: mainTextBoundsHeight
|
|
55498
56029
|
}), "text"));
|
|
55499
56030
|
}
|
|
55500
|
-
var
|
|
55501
|
-
|
|
55502
|
-
var
|
|
55503
|
-
|
|
55504
|
-
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) {
|
|
55505
56036
|
if (isValid$3(align) || isValid$3(textStyle.align)) {
|
|
55506
56037
|
var mainTitleAlign = textStyle.align ? textStyle.align : align,
|
|
55507
|
-
_mainTitleWidth = null !== (_r = textStyle.width) && void 0 !== _r ? _r :
|
|
55508
|
-
"
|
|
55509
|
-
}
|
|
55510
|
-
if (isValid$3(verticalAlign) || isValid$3(textStyle.verticalAlign)) {
|
|
55511
|
-
var mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign,
|
|
55512
|
-
_mainTitleHeight = textStyle.height ? textStyle.height : titleHeight;
|
|
55513
|
-
"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"));
|
|
55514
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"));
|
|
55515
56044
|
}
|
|
55516
56045
|
if (this._subTitle) {
|
|
55517
56046
|
if (isValid$3(align) || isValid$3(subtextStyle.align)) {
|
|
55518
56047
|
var subTitleAlign = subtextStyle.align ? subtextStyle.align : align,
|
|
55519
|
-
_subTitleWidth = null !== (_s = subtextStyle.width) && void 0 !== _s ? _s :
|
|
55520
|
-
"
|
|
55521
|
-
}
|
|
55522
|
-
if (isValid$3(verticalAlign) || isValid$3(textStyle.verticalAlign)) {
|
|
55523
|
-
var subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign,
|
|
55524
|
-
subTitleYStart = maintextHeight,
|
|
55525
|
-
_subTitleHeight = null !== (_t = subtextStyle.height) && void 0 !== _t ? _t : 0;
|
|
55526
|
-
"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"));
|
|
55527
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"));
|
|
55528
56055
|
}
|
|
55529
56056
|
}
|
|
55530
56057
|
}]);
|
|
@@ -119135,7 +119662,7 @@
|
|
|
119135
119662
|
});
|
|
119136
119663
|
var application = new Application();
|
|
119137
119664
|
|
|
119138
|
-
var parse$
|
|
119665
|
+
var parse$3 = function () {
|
|
119139
119666
|
var tokens = {
|
|
119140
119667
|
linearGradient: /^(linear\-gradient)/i,
|
|
119141
119668
|
radialGradient: /^(radial\-gradient)/i,
|
|
@@ -119297,7 +119824,7 @@
|
|
|
119297
119824
|
key: "Parse",
|
|
119298
119825
|
value: function Parse(c) {
|
|
119299
119826
|
if (GradientParser.IsGradientStr(c)) try {
|
|
119300
|
-
var datum = parse$
|
|
119827
|
+
var datum = parse$3(c)[0];
|
|
119301
119828
|
if (datum) {
|
|
119302
119829
|
if ("linear" === datum.type) return GradientParser.ParseLinear(datum);
|
|
119303
119830
|
if ("radial" === datum.type) return GradientParser.ParseRadial(datum);
|
|
@@ -149097,14 +149624,14 @@
|
|
|
149097
149624
|
fantasy: 1,
|
|
149098
149625
|
monospace: 1
|
|
149099
149626
|
};
|
|
149100
|
-
var parse$
|
|
149627
|
+
var parse$1 = cssfontparser.exports = function (str, existing, dpi) {
|
|
149101
149628
|
var cacheKey = str + '-' + (existing || 'null') + '@' + dpi;
|
|
149102
149629
|
dpi = dpi || 96.0;
|
|
149103
149630
|
if (typeof cache[cacheKey] !== 'undefined') {
|
|
149104
149631
|
return cache[cacheKey];
|
|
149105
149632
|
}
|
|
149106
149633
|
if (existing) {
|
|
149107
|
-
existing = parse$
|
|
149634
|
+
existing = parse$1(existing, null, dpi);
|
|
149108
149635
|
}
|
|
149109
149636
|
if (str === 'inherit') {
|
|
149110
149637
|
return existing;
|
|
@@ -149189,10 +149716,10 @@
|
|
|
149189
149716
|
};
|
|
149190
149717
|
cssfontparser.exports.generics = generics;
|
|
149191
149718
|
var cssfontparserExports = cssfontparser.exports;
|
|
149192
|
-
var parse$
|
|
149719
|
+
var parse$2 = /*@__PURE__*/getDefaultExportFromCjs(cssfontparserExports);
|
|
149193
149720
|
|
|
149194
149721
|
function parseFont(font) {
|
|
149195
|
-
return parse$
|
|
149722
|
+
return parse$2(font);
|
|
149196
149723
|
}
|
|
149197
149724
|
|
|
149198
149725
|
function getQuadProps(paddingOrigin) {
|
|
@@ -149367,7 +149894,7 @@
|
|
|
149367
149894
|
for (; stack.length > 1;) stack.push(buildBinaryExpNode(stack));
|
|
149368
149895
|
return stack[0];
|
|
149369
149896
|
}
|
|
149370
|
-
function parse
|
|
149897
|
+
function parse(calcStr) {
|
|
149371
149898
|
return lex(tokenize(calcStr), calcStr);
|
|
149372
149899
|
}
|
|
149373
149900
|
function calcNode(node, context) {
|
|
@@ -149397,7 +149924,7 @@
|
|
|
149397
149924
|
throw new Error("calc error.");
|
|
149398
149925
|
}
|
|
149399
149926
|
function toPxInternal(value, context) {
|
|
149400
|
-
return calcNode(parse
|
|
149927
|
+
return calcNode(parse(value), context);
|
|
149401
149928
|
}
|
|
149402
149929
|
function toPx(value, context) {
|
|
149403
149930
|
return "string" == typeof value ? toPxInternal(value.trim(), context) : value - 0;
|
|
@@ -149647,598 +150174,6 @@
|
|
|
149647
150174
|
return !1;
|
|
149648
150175
|
}
|
|
149649
150176
|
|
|
149650
|
-
var lib$1 = {};
|
|
149651
|
-
|
|
149652
|
-
var gif = {};
|
|
149653
|
-
|
|
149654
|
-
var lib = {};
|
|
149655
|
-
|
|
149656
|
-
Object.defineProperty(lib, "__esModule", {
|
|
149657
|
-
value: true
|
|
149658
|
-
});
|
|
149659
|
-
lib.loop = lib.conditional = lib.parse = void 0;
|
|
149660
|
-
var parse = function parse(stream, schema) {
|
|
149661
|
-
var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
149662
|
-
var parent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : result;
|
|
149663
|
-
if (Array.isArray(schema)) {
|
|
149664
|
-
schema.forEach(function (partSchema) {
|
|
149665
|
-
return parse(stream, partSchema, result, parent);
|
|
149666
|
-
});
|
|
149667
|
-
} else if (typeof schema === 'function') {
|
|
149668
|
-
schema(stream, result, parent, parse);
|
|
149669
|
-
} else {
|
|
149670
|
-
var key = Object.keys(schema)[0];
|
|
149671
|
-
if (Array.isArray(schema[key])) {
|
|
149672
|
-
parent[key] = {};
|
|
149673
|
-
parse(stream, schema[key], result, parent[key]);
|
|
149674
|
-
} else {
|
|
149675
|
-
parent[key] = schema[key](stream, result, parent, parse);
|
|
149676
|
-
}
|
|
149677
|
-
}
|
|
149678
|
-
return result;
|
|
149679
|
-
};
|
|
149680
|
-
lib.parse = parse;
|
|
149681
|
-
var conditional = function conditional(schema, conditionFunc) {
|
|
149682
|
-
return function (stream, result, parent, parse) {
|
|
149683
|
-
if (conditionFunc(stream, result, parent)) {
|
|
149684
|
-
parse(stream, schema, result, parent);
|
|
149685
|
-
}
|
|
149686
|
-
};
|
|
149687
|
-
};
|
|
149688
|
-
lib.conditional = conditional;
|
|
149689
|
-
var loop = function loop(schema, continueFunc) {
|
|
149690
|
-
return function (stream, result, parent, parse) {
|
|
149691
|
-
var arr = [];
|
|
149692
|
-
var lastStreamPos = stream.pos;
|
|
149693
|
-
while (continueFunc(stream, result, parent)) {
|
|
149694
|
-
var newParent = {};
|
|
149695
|
-
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
|
|
149696
|
-
// it falls into infinite recursion, null check to avoid the same
|
|
149697
|
-
|
|
149698
|
-
if (stream.pos === lastStreamPos) {
|
|
149699
|
-
break;
|
|
149700
|
-
}
|
|
149701
|
-
lastStreamPos = stream.pos;
|
|
149702
|
-
arr.push(newParent);
|
|
149703
|
-
}
|
|
149704
|
-
return arr;
|
|
149705
|
-
};
|
|
149706
|
-
};
|
|
149707
|
-
lib.loop = loop;
|
|
149708
|
-
|
|
149709
|
-
var uint8 = {};
|
|
149710
|
-
|
|
149711
|
-
Object.defineProperty(uint8, "__esModule", {
|
|
149712
|
-
value: true
|
|
149713
|
-
});
|
|
149714
|
-
uint8.readBits = uint8.readArray = uint8.readUnsigned = uint8.readString = uint8.peekBytes = uint8.readBytes = uint8.peekByte = uint8.readByte = uint8.buildStream = void 0;
|
|
149715
|
-
|
|
149716
|
-
// Default stream and parsers for Uint8TypedArray data type
|
|
149717
|
-
var buildStream = function buildStream(uint8Data) {
|
|
149718
|
-
return {
|
|
149719
|
-
data: uint8Data,
|
|
149720
|
-
pos: 0
|
|
149721
|
-
};
|
|
149722
|
-
};
|
|
149723
|
-
uint8.buildStream = buildStream;
|
|
149724
|
-
var readByte = function readByte() {
|
|
149725
|
-
return function (stream) {
|
|
149726
|
-
return stream.data[stream.pos++];
|
|
149727
|
-
};
|
|
149728
|
-
};
|
|
149729
|
-
uint8.readByte = readByte;
|
|
149730
|
-
var peekByte = function peekByte() {
|
|
149731
|
-
var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
149732
|
-
return function (stream) {
|
|
149733
|
-
return stream.data[stream.pos + offset];
|
|
149734
|
-
};
|
|
149735
|
-
};
|
|
149736
|
-
uint8.peekByte = peekByte;
|
|
149737
|
-
var readBytes = function readBytes(length) {
|
|
149738
|
-
return function (stream) {
|
|
149739
|
-
return stream.data.subarray(stream.pos, stream.pos += length);
|
|
149740
|
-
};
|
|
149741
|
-
};
|
|
149742
|
-
uint8.readBytes = readBytes;
|
|
149743
|
-
var peekBytes = function peekBytes(length) {
|
|
149744
|
-
return function (stream) {
|
|
149745
|
-
return stream.data.subarray(stream.pos, stream.pos + length);
|
|
149746
|
-
};
|
|
149747
|
-
};
|
|
149748
|
-
uint8.peekBytes = peekBytes;
|
|
149749
|
-
var readString = function readString(length) {
|
|
149750
|
-
return function (stream) {
|
|
149751
|
-
return Array.from(readBytes(length)(stream)).map(function (value) {
|
|
149752
|
-
return String.fromCharCode(value);
|
|
149753
|
-
}).join('');
|
|
149754
|
-
};
|
|
149755
|
-
};
|
|
149756
|
-
uint8.readString = readString;
|
|
149757
|
-
var readUnsigned = function readUnsigned(littleEndian) {
|
|
149758
|
-
return function (stream) {
|
|
149759
|
-
var bytes = readBytes(2)(stream);
|
|
149760
|
-
return littleEndian ? (bytes[1] << 8) + bytes[0] : (bytes[0] << 8) + bytes[1];
|
|
149761
|
-
};
|
|
149762
|
-
};
|
|
149763
|
-
uint8.readUnsigned = readUnsigned;
|
|
149764
|
-
var readArray = function readArray(byteSize, totalOrFunc) {
|
|
149765
|
-
return function (stream, result, parent) {
|
|
149766
|
-
var total = typeof totalOrFunc === 'function' ? totalOrFunc(stream, result, parent) : totalOrFunc;
|
|
149767
|
-
var parser = readBytes(byteSize);
|
|
149768
|
-
var arr = new Array(total);
|
|
149769
|
-
for (var i = 0; i < total; i++) {
|
|
149770
|
-
arr[i] = parser(stream);
|
|
149771
|
-
}
|
|
149772
|
-
return arr;
|
|
149773
|
-
};
|
|
149774
|
-
};
|
|
149775
|
-
uint8.readArray = readArray;
|
|
149776
|
-
var subBitsTotal = function subBitsTotal(bits, startIndex, length) {
|
|
149777
|
-
var result = 0;
|
|
149778
|
-
for (var i = 0; i < length; i++) {
|
|
149779
|
-
result += bits[startIndex + i] && Math.pow(2, length - i - 1);
|
|
149780
|
-
}
|
|
149781
|
-
return result;
|
|
149782
|
-
};
|
|
149783
|
-
var readBits = function readBits(schema) {
|
|
149784
|
-
return function (stream) {
|
|
149785
|
-
var _byte = readByte()(stream); // convert the byte to bit array
|
|
149786
|
-
|
|
149787
|
-
var bits = new Array(8);
|
|
149788
|
-
for (var i = 0; i < 8; i++) {
|
|
149789
|
-
bits[7 - i] = !!(_byte & 1 << i);
|
|
149790
|
-
} // convert the bit array to values based on the schema
|
|
149791
|
-
|
|
149792
|
-
return Object.keys(schema).reduce(function (res, key) {
|
|
149793
|
-
var def = schema[key];
|
|
149794
|
-
if (def.length) {
|
|
149795
|
-
res[key] = subBitsTotal(bits, def.index, def.length);
|
|
149796
|
-
} else {
|
|
149797
|
-
res[key] = bits[def.index];
|
|
149798
|
-
}
|
|
149799
|
-
return res;
|
|
149800
|
-
}, {});
|
|
149801
|
-
};
|
|
149802
|
-
};
|
|
149803
|
-
uint8.readBits = readBits;
|
|
149804
|
-
|
|
149805
|
-
(function (exports) {
|
|
149806
|
-
|
|
149807
|
-
Object.defineProperty(exports, "__esModule", {
|
|
149808
|
-
value: true
|
|
149809
|
-
});
|
|
149810
|
-
exports["default"] = void 0;
|
|
149811
|
-
var _ = lib;
|
|
149812
|
-
var _uint = uint8;
|
|
149813
|
-
|
|
149814
|
-
// a set of 0x00 terminated subblocks
|
|
149815
|
-
var subBlocksSchema = {
|
|
149816
|
-
blocks: function blocks(stream) {
|
|
149817
|
-
var terminator = 0x00;
|
|
149818
|
-
var chunks = [];
|
|
149819
|
-
var streamSize = stream.data.length;
|
|
149820
|
-
var total = 0;
|
|
149821
|
-
for (var size = (0, _uint.readByte)()(stream); size !== terminator; size = (0, _uint.readByte)()(stream)) {
|
|
149822
|
-
// size becomes undefined for some case when file is corrupted and terminator is not proper
|
|
149823
|
-
// null check to avoid recursion
|
|
149824
|
-
if (!size) break; // catch corrupted files with no terminator
|
|
149825
|
-
|
|
149826
|
-
if (stream.pos + size >= streamSize) {
|
|
149827
|
-
var availableSize = streamSize - stream.pos;
|
|
149828
|
-
chunks.push((0, _uint.readBytes)(availableSize)(stream));
|
|
149829
|
-
total += availableSize;
|
|
149830
|
-
break;
|
|
149831
|
-
}
|
|
149832
|
-
chunks.push((0, _uint.readBytes)(size)(stream));
|
|
149833
|
-
total += size;
|
|
149834
|
-
}
|
|
149835
|
-
var result = new Uint8Array(total);
|
|
149836
|
-
var offset = 0;
|
|
149837
|
-
for (var i = 0; i < chunks.length; i++) {
|
|
149838
|
-
result.set(chunks[i], offset);
|
|
149839
|
-
offset += chunks[i].length;
|
|
149840
|
-
}
|
|
149841
|
-
return result;
|
|
149842
|
-
}
|
|
149843
|
-
}; // global control extension
|
|
149844
|
-
|
|
149845
|
-
var gceSchema = (0, _.conditional)({
|
|
149846
|
-
gce: [{
|
|
149847
|
-
codes: (0, _uint.readBytes)(2)
|
|
149848
|
-
}, {
|
|
149849
|
-
byteSize: (0, _uint.readByte)()
|
|
149850
|
-
}, {
|
|
149851
|
-
extras: (0, _uint.readBits)({
|
|
149852
|
-
future: {
|
|
149853
|
-
index: 0,
|
|
149854
|
-
length: 3
|
|
149855
|
-
},
|
|
149856
|
-
disposal: {
|
|
149857
|
-
index: 3,
|
|
149858
|
-
length: 3
|
|
149859
|
-
},
|
|
149860
|
-
userInput: {
|
|
149861
|
-
index: 6
|
|
149862
|
-
},
|
|
149863
|
-
transparentColorGiven: {
|
|
149864
|
-
index: 7
|
|
149865
|
-
}
|
|
149866
|
-
})
|
|
149867
|
-
}, {
|
|
149868
|
-
delay: (0, _uint.readUnsigned)(true)
|
|
149869
|
-
}, {
|
|
149870
|
-
transparentColorIndex: (0, _uint.readByte)()
|
|
149871
|
-
}, {
|
|
149872
|
-
terminator: (0, _uint.readByte)()
|
|
149873
|
-
}]
|
|
149874
|
-
}, function (stream) {
|
|
149875
|
-
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
149876
|
-
return codes[0] === 0x21 && codes[1] === 0xf9;
|
|
149877
|
-
}); // image pipeline block
|
|
149878
|
-
|
|
149879
|
-
var imageSchema = (0, _.conditional)({
|
|
149880
|
-
image: [{
|
|
149881
|
-
code: (0, _uint.readByte)()
|
|
149882
|
-
}, {
|
|
149883
|
-
descriptor: [{
|
|
149884
|
-
left: (0, _uint.readUnsigned)(true)
|
|
149885
|
-
}, {
|
|
149886
|
-
top: (0, _uint.readUnsigned)(true)
|
|
149887
|
-
}, {
|
|
149888
|
-
width: (0, _uint.readUnsigned)(true)
|
|
149889
|
-
}, {
|
|
149890
|
-
height: (0, _uint.readUnsigned)(true)
|
|
149891
|
-
}, {
|
|
149892
|
-
lct: (0, _uint.readBits)({
|
|
149893
|
-
exists: {
|
|
149894
|
-
index: 0
|
|
149895
|
-
},
|
|
149896
|
-
interlaced: {
|
|
149897
|
-
index: 1
|
|
149898
|
-
},
|
|
149899
|
-
sort: {
|
|
149900
|
-
index: 2
|
|
149901
|
-
},
|
|
149902
|
-
future: {
|
|
149903
|
-
index: 3,
|
|
149904
|
-
length: 2
|
|
149905
|
-
},
|
|
149906
|
-
size: {
|
|
149907
|
-
index: 5,
|
|
149908
|
-
length: 3
|
|
149909
|
-
}
|
|
149910
|
-
})
|
|
149911
|
-
}]
|
|
149912
|
-
}, (0, _.conditional)({
|
|
149913
|
-
lct: (0, _uint.readArray)(3, function (stream, result, parent) {
|
|
149914
|
-
return Math.pow(2, parent.descriptor.lct.size + 1);
|
|
149915
|
-
})
|
|
149916
|
-
}, function (stream, result, parent) {
|
|
149917
|
-
return parent.descriptor.lct.exists;
|
|
149918
|
-
}), {
|
|
149919
|
-
data: [{
|
|
149920
|
-
minCodeSize: (0, _uint.readByte)()
|
|
149921
|
-
}, subBlocksSchema]
|
|
149922
|
-
}]
|
|
149923
|
-
}, function (stream) {
|
|
149924
|
-
return (0, _uint.peekByte)()(stream) === 0x2c;
|
|
149925
|
-
}); // plain text block
|
|
149926
|
-
|
|
149927
|
-
var textSchema = (0, _.conditional)({
|
|
149928
|
-
text: [{
|
|
149929
|
-
codes: (0, _uint.readBytes)(2)
|
|
149930
|
-
}, {
|
|
149931
|
-
blockSize: (0, _uint.readByte)()
|
|
149932
|
-
}, {
|
|
149933
|
-
preData: function preData(stream, result, parent) {
|
|
149934
|
-
return (0, _uint.readBytes)(parent.text.blockSize)(stream);
|
|
149935
|
-
}
|
|
149936
|
-
}, subBlocksSchema]
|
|
149937
|
-
}, function (stream) {
|
|
149938
|
-
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
149939
|
-
return codes[0] === 0x21 && codes[1] === 0x01;
|
|
149940
|
-
}); // application block
|
|
149941
|
-
|
|
149942
|
-
var applicationSchema = (0, _.conditional)({
|
|
149943
|
-
application: [{
|
|
149944
|
-
codes: (0, _uint.readBytes)(2)
|
|
149945
|
-
}, {
|
|
149946
|
-
blockSize: (0, _uint.readByte)()
|
|
149947
|
-
}, {
|
|
149948
|
-
id: function id(stream, result, parent) {
|
|
149949
|
-
return (0, _uint.readString)(parent.blockSize)(stream);
|
|
149950
|
-
}
|
|
149951
|
-
}, subBlocksSchema]
|
|
149952
|
-
}, function (stream) {
|
|
149953
|
-
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
149954
|
-
return codes[0] === 0x21 && codes[1] === 0xff;
|
|
149955
|
-
}); // comment block
|
|
149956
|
-
|
|
149957
|
-
var commentSchema = (0, _.conditional)({
|
|
149958
|
-
comment: [{
|
|
149959
|
-
codes: (0, _uint.readBytes)(2)
|
|
149960
|
-
}, subBlocksSchema]
|
|
149961
|
-
}, function (stream) {
|
|
149962
|
-
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
149963
|
-
return codes[0] === 0x21 && codes[1] === 0xfe;
|
|
149964
|
-
});
|
|
149965
|
-
var schema = [{
|
|
149966
|
-
header: [{
|
|
149967
|
-
signature: (0, _uint.readString)(3)
|
|
149968
|
-
}, {
|
|
149969
|
-
version: (0, _uint.readString)(3)
|
|
149970
|
-
}]
|
|
149971
|
-
}, {
|
|
149972
|
-
lsd: [{
|
|
149973
|
-
width: (0, _uint.readUnsigned)(true)
|
|
149974
|
-
}, {
|
|
149975
|
-
height: (0, _uint.readUnsigned)(true)
|
|
149976
|
-
}, {
|
|
149977
|
-
gct: (0, _uint.readBits)({
|
|
149978
|
-
exists: {
|
|
149979
|
-
index: 0
|
|
149980
|
-
},
|
|
149981
|
-
resolution: {
|
|
149982
|
-
index: 1,
|
|
149983
|
-
length: 3
|
|
149984
|
-
},
|
|
149985
|
-
sort: {
|
|
149986
|
-
index: 4
|
|
149987
|
-
},
|
|
149988
|
-
size: {
|
|
149989
|
-
index: 5,
|
|
149990
|
-
length: 3
|
|
149991
|
-
}
|
|
149992
|
-
})
|
|
149993
|
-
}, {
|
|
149994
|
-
backgroundColorIndex: (0, _uint.readByte)()
|
|
149995
|
-
}, {
|
|
149996
|
-
pixelAspectRatio: (0, _uint.readByte)()
|
|
149997
|
-
}]
|
|
149998
|
-
}, (0, _.conditional)({
|
|
149999
|
-
gct: (0, _uint.readArray)(3, function (stream, result) {
|
|
150000
|
-
return Math.pow(2, result.lsd.gct.size + 1);
|
|
150001
|
-
})
|
|
150002
|
-
}, function (stream, result) {
|
|
150003
|
-
return result.lsd.gct.exists;
|
|
150004
|
-
}),
|
|
150005
|
-
// content frames
|
|
150006
|
-
{
|
|
150007
|
-
frames: (0, _.loop)([gceSchema, applicationSchema, commentSchema, imageSchema, textSchema], function (stream) {
|
|
150008
|
-
var nextCode = (0, _uint.peekByte)()(stream); // rather than check for a terminator, we should check for the existence
|
|
150009
|
-
// of an ext or image block to avoid infinite loops
|
|
150010
|
-
//var terminator = 0x3B;
|
|
150011
|
-
//return nextCode !== terminator;
|
|
150012
|
-
|
|
150013
|
-
return nextCode === 0x21 || nextCode === 0x2c;
|
|
150014
|
-
})
|
|
150015
|
-
}];
|
|
150016
|
-
var _default = schema;
|
|
150017
|
-
exports["default"] = _default;
|
|
150018
|
-
})(gif);
|
|
150019
|
-
|
|
150020
|
-
var deinterlace$1 = {};
|
|
150021
|
-
|
|
150022
|
-
Object.defineProperty(deinterlace$1, "__esModule", {
|
|
150023
|
-
value: true
|
|
150024
|
-
});
|
|
150025
|
-
deinterlace$1.deinterlace = void 0;
|
|
150026
|
-
|
|
150027
|
-
/**
|
|
150028
|
-
* Deinterlace function from https://github.com/shachaf/jsgif
|
|
150029
|
-
*/
|
|
150030
|
-
var deinterlace = function deinterlace(pixels, width) {
|
|
150031
|
-
var newPixels = new Array(pixels.length);
|
|
150032
|
-
var rows = pixels.length / width;
|
|
150033
|
-
var cpRow = function cpRow(toRow, fromRow) {
|
|
150034
|
-
var fromPixels = pixels.slice(fromRow * width, (fromRow + 1) * width);
|
|
150035
|
-
newPixels.splice.apply(newPixels, [toRow * width, width].concat(fromPixels));
|
|
150036
|
-
}; // See appendix E.
|
|
150037
|
-
|
|
150038
|
-
var offsets = [0, 4, 2, 1];
|
|
150039
|
-
var steps = [8, 8, 4, 2];
|
|
150040
|
-
var fromRow = 0;
|
|
150041
|
-
for (var pass = 0; pass < 4; pass++) {
|
|
150042
|
-
for (var toRow = offsets[pass]; toRow < rows; toRow += steps[pass]) {
|
|
150043
|
-
cpRow(toRow, fromRow);
|
|
150044
|
-
fromRow++;
|
|
150045
|
-
}
|
|
150046
|
-
}
|
|
150047
|
-
return newPixels;
|
|
150048
|
-
};
|
|
150049
|
-
deinterlace$1.deinterlace = deinterlace;
|
|
150050
|
-
|
|
150051
|
-
var lzw$1 = {};
|
|
150052
|
-
|
|
150053
|
-
Object.defineProperty(lzw$1, "__esModule", {
|
|
150054
|
-
value: true
|
|
150055
|
-
});
|
|
150056
|
-
lzw$1.lzw = void 0;
|
|
150057
|
-
|
|
150058
|
-
/**
|
|
150059
|
-
* javascript port of java LZW decompression
|
|
150060
|
-
* Original java author url: https://gist.github.com/devunwired/4479231
|
|
150061
|
-
*/
|
|
150062
|
-
var lzw = function lzw(minCodeSize, data, pixelCount) {
|
|
150063
|
-
var MAX_STACK_SIZE = 4096;
|
|
150064
|
-
var nullCode = -1;
|
|
150065
|
-
var npix = pixelCount;
|
|
150066
|
-
var available, clear, code_mask, code_size, end_of_information, in_code, old_code, bits, code, i, datum, data_size, first, top, bi, pi;
|
|
150067
|
-
var dstPixels = new Array(pixelCount);
|
|
150068
|
-
var prefix = new Array(MAX_STACK_SIZE);
|
|
150069
|
-
var suffix = new Array(MAX_STACK_SIZE);
|
|
150070
|
-
var pixelStack = new Array(MAX_STACK_SIZE + 1); // Initialize GIF data stream decoder.
|
|
150071
|
-
|
|
150072
|
-
data_size = minCodeSize;
|
|
150073
|
-
clear = 1 << data_size;
|
|
150074
|
-
end_of_information = clear + 1;
|
|
150075
|
-
available = clear + 2;
|
|
150076
|
-
old_code = nullCode;
|
|
150077
|
-
code_size = data_size + 1;
|
|
150078
|
-
code_mask = (1 << code_size) - 1;
|
|
150079
|
-
for (code = 0; code < clear; code++) {
|
|
150080
|
-
prefix[code] = 0;
|
|
150081
|
-
suffix[code] = code;
|
|
150082
|
-
} // Decode GIF pixel stream.
|
|
150083
|
-
|
|
150084
|
-
var datum, bits, first, top, pi, bi;
|
|
150085
|
-
datum = bits = first = top = pi = bi = 0;
|
|
150086
|
-
for (i = 0; i < npix;) {
|
|
150087
|
-
if (top === 0) {
|
|
150088
|
-
if (bits < code_size) {
|
|
150089
|
-
// get the next byte
|
|
150090
|
-
datum += data[bi] << bits;
|
|
150091
|
-
bits += 8;
|
|
150092
|
-
bi++;
|
|
150093
|
-
continue;
|
|
150094
|
-
} // Get the next code.
|
|
150095
|
-
|
|
150096
|
-
code = datum & code_mask;
|
|
150097
|
-
datum >>= code_size;
|
|
150098
|
-
bits -= code_size; // Interpret the code
|
|
150099
|
-
|
|
150100
|
-
if (code > available || code == end_of_information) {
|
|
150101
|
-
break;
|
|
150102
|
-
}
|
|
150103
|
-
if (code == clear) {
|
|
150104
|
-
// Reset decoder.
|
|
150105
|
-
code_size = data_size + 1;
|
|
150106
|
-
code_mask = (1 << code_size) - 1;
|
|
150107
|
-
available = clear + 2;
|
|
150108
|
-
old_code = nullCode;
|
|
150109
|
-
continue;
|
|
150110
|
-
}
|
|
150111
|
-
if (old_code == nullCode) {
|
|
150112
|
-
pixelStack[top++] = suffix[code];
|
|
150113
|
-
old_code = code;
|
|
150114
|
-
first = code;
|
|
150115
|
-
continue;
|
|
150116
|
-
}
|
|
150117
|
-
in_code = code;
|
|
150118
|
-
if (code == available) {
|
|
150119
|
-
pixelStack[top++] = first;
|
|
150120
|
-
code = old_code;
|
|
150121
|
-
}
|
|
150122
|
-
while (code > clear) {
|
|
150123
|
-
pixelStack[top++] = suffix[code];
|
|
150124
|
-
code = prefix[code];
|
|
150125
|
-
}
|
|
150126
|
-
first = suffix[code] & 0xff;
|
|
150127
|
-
pixelStack[top++] = first; // add a new string to the table, but only if space is available
|
|
150128
|
-
// if not, just continue with current table until a clear code is found
|
|
150129
|
-
// (deferred clear code implementation as per GIF spec)
|
|
150130
|
-
|
|
150131
|
-
if (available < MAX_STACK_SIZE) {
|
|
150132
|
-
prefix[available] = old_code;
|
|
150133
|
-
suffix[available] = first;
|
|
150134
|
-
available++;
|
|
150135
|
-
if ((available & code_mask) === 0 && available < MAX_STACK_SIZE) {
|
|
150136
|
-
code_size++;
|
|
150137
|
-
code_mask += available;
|
|
150138
|
-
}
|
|
150139
|
-
}
|
|
150140
|
-
old_code = in_code;
|
|
150141
|
-
} // Pop a pixel off the pixel stack.
|
|
150142
|
-
|
|
150143
|
-
top--;
|
|
150144
|
-
dstPixels[pi++] = pixelStack[top];
|
|
150145
|
-
i++;
|
|
150146
|
-
}
|
|
150147
|
-
for (i = pi; i < npix; i++) {
|
|
150148
|
-
dstPixels[i] = 0; // clear missing pixels
|
|
150149
|
-
}
|
|
150150
|
-
return dstPixels;
|
|
150151
|
-
};
|
|
150152
|
-
lzw$1.lzw = lzw;
|
|
150153
|
-
|
|
150154
|
-
Object.defineProperty(lib$1, "__esModule", {
|
|
150155
|
-
value: true
|
|
150156
|
-
});
|
|
150157
|
-
var decompressFrames_1 = lib$1.decompressFrames = lib$1.decompressFrame = parseGIF_1 = lib$1.parseGIF = void 0;
|
|
150158
|
-
var _gif = _interopRequireDefault(gif);
|
|
150159
|
-
var _jsBinarySchemaParser = lib;
|
|
150160
|
-
var _uint = uint8;
|
|
150161
|
-
var _deinterlace = deinterlace$1;
|
|
150162
|
-
var _lzw = lzw$1;
|
|
150163
|
-
function _interopRequireDefault(obj) {
|
|
150164
|
-
return obj && obj.__esModule ? obj : {
|
|
150165
|
-
"default": obj
|
|
150166
|
-
};
|
|
150167
|
-
}
|
|
150168
|
-
var parseGIF = function parseGIF(arrayBuffer) {
|
|
150169
|
-
var byteData = new Uint8Array(arrayBuffer);
|
|
150170
|
-
return (0, _jsBinarySchemaParser.parse)((0, _uint.buildStream)(byteData), _gif["default"]);
|
|
150171
|
-
};
|
|
150172
|
-
var parseGIF_1 = lib$1.parseGIF = parseGIF;
|
|
150173
|
-
var generatePatch = function generatePatch(image) {
|
|
150174
|
-
var totalPixels = image.pixels.length;
|
|
150175
|
-
var patchData = new Uint8ClampedArray(totalPixels * 4);
|
|
150176
|
-
for (var i = 0; i < totalPixels; i++) {
|
|
150177
|
-
var pos = i * 4;
|
|
150178
|
-
var colorIndex = image.pixels[i];
|
|
150179
|
-
var color = image.colorTable[colorIndex] || [0, 0, 0];
|
|
150180
|
-
patchData[pos] = color[0];
|
|
150181
|
-
patchData[pos + 1] = color[1];
|
|
150182
|
-
patchData[pos + 2] = color[2];
|
|
150183
|
-
patchData[pos + 3] = colorIndex !== image.transparentIndex ? 255 : 0;
|
|
150184
|
-
}
|
|
150185
|
-
return patchData;
|
|
150186
|
-
};
|
|
150187
|
-
var decompressFrame = function decompressFrame(frame, gct, buildImagePatch) {
|
|
150188
|
-
if (!frame.image) {
|
|
150189
|
-
console.warn('gif frame does not have associated image.');
|
|
150190
|
-
return;
|
|
150191
|
-
}
|
|
150192
|
-
var image = frame.image; // get the number of pixels
|
|
150193
|
-
|
|
150194
|
-
var totalPixels = image.descriptor.width * image.descriptor.height; // do lzw decompression
|
|
150195
|
-
|
|
150196
|
-
var pixels = (0, _lzw.lzw)(image.data.minCodeSize, image.data.blocks, totalPixels); // deal with interlacing if necessary
|
|
150197
|
-
|
|
150198
|
-
if (image.descriptor.lct.interlaced) {
|
|
150199
|
-
pixels = (0, _deinterlace.deinterlace)(pixels, image.descriptor.width);
|
|
150200
|
-
}
|
|
150201
|
-
var resultImage = {
|
|
150202
|
-
pixels: pixels,
|
|
150203
|
-
dims: {
|
|
150204
|
-
top: frame.image.descriptor.top,
|
|
150205
|
-
left: frame.image.descriptor.left,
|
|
150206
|
-
width: frame.image.descriptor.width,
|
|
150207
|
-
height: frame.image.descriptor.height
|
|
150208
|
-
}
|
|
150209
|
-
}; // color table
|
|
150210
|
-
|
|
150211
|
-
if (image.descriptor.lct && image.descriptor.lct.exists) {
|
|
150212
|
-
resultImage.colorTable = image.lct;
|
|
150213
|
-
} else {
|
|
150214
|
-
resultImage.colorTable = gct;
|
|
150215
|
-
} // add per frame relevant gce information
|
|
150216
|
-
|
|
150217
|
-
if (frame.gce) {
|
|
150218
|
-
resultImage.delay = (frame.gce.delay || 10) * 10; // convert to ms
|
|
150219
|
-
|
|
150220
|
-
resultImage.disposalType = frame.gce.extras.disposal; // transparency
|
|
150221
|
-
|
|
150222
|
-
if (frame.gce.extras.transparentColorGiven) {
|
|
150223
|
-
resultImage.transparentIndex = frame.gce.transparentColorIndex;
|
|
150224
|
-
}
|
|
150225
|
-
} // create canvas usable imagedata if desired
|
|
150226
|
-
|
|
150227
|
-
if (buildImagePatch) {
|
|
150228
|
-
resultImage.patch = generatePatch(resultImage);
|
|
150229
|
-
}
|
|
150230
|
-
return resultImage;
|
|
150231
|
-
};
|
|
150232
|
-
lib$1.decompressFrame = decompressFrame;
|
|
150233
|
-
var decompressFrames = function decompressFrames(parsedGif, buildImagePatches) {
|
|
150234
|
-
return parsedGif.frames.filter(function (f) {
|
|
150235
|
-
return f.image;
|
|
150236
|
-
}).map(function (f) {
|
|
150237
|
-
return decompressFrame(f, parsedGif.gct, buildImagePatches);
|
|
150238
|
-
});
|
|
150239
|
-
};
|
|
150240
|
-
decompressFrames_1 = lib$1.decompressFrames = decompressFrames;
|
|
150241
|
-
|
|
150242
150177
|
var Icon$1 = /*#__PURE__*/function (_Image) {
|
|
150243
150178
|
function Icon(params) {
|
|
150244
150179
|
var _this;
|
|
@@ -183123,13 +183058,13 @@
|
|
|
183123
183058
|
}, {
|
|
183124
183059
|
key: "setAttribute",
|
|
183125
183060
|
value: function setAttribute(key, value) {
|
|
183126
|
-
"viewBox" === key
|
|
183061
|
+
"viewBox" === key ? (_superPropGet(VTableGraphic, "setAttribute", this, 3)(["x", value.x1]), _superPropGet(VTableGraphic, "setAttribute", this, 3)(["y", value.y1]), this.updateVTableGraphicViewBox(value)) : _superPropGet(VTableGraphic, "setAttribute", this, 3)([key, value]);
|
|
183127
183062
|
}
|
|
183128
183063
|
}, {
|
|
183129
183064
|
key: "setAttributes",
|
|
183130
183065
|
value: function setAttributes(attrs) {
|
|
183131
183066
|
var lastedViewBox = this.attribute.viewBox;
|
|
183132
|
-
_superPropGet(VTableGraphic, "setAttributes", this, 3)([attrs]), attrs.viewBox && (this.attribute.viewBox = lastedViewBox, this.updateVTableGraphicViewBox(attrs.viewBox))
|
|
183067
|
+
_superPropGet(VTableGraphic, "setAttributes", this, 3)([attrs]), attrs.viewBox && (this.attribute.viewBox = lastedViewBox, this.updateVTableGraphicViewBox(attrs.viewBox));
|
|
183133
183068
|
}
|
|
183134
183069
|
}, {
|
|
183135
183070
|
key: "getVTableActualBounds",
|
|
@@ -183799,7 +183734,7 @@
|
|
|
183799
183734
|
},
|
|
183800
183735
|
Chart: {
|
|
183801
183736
|
runtime: {
|
|
183802
|
-
list: ["ChartCommonSpec", "CommonLayout", "MarkStyle", "LabelStyle", "TotalLabel"
|
|
183737
|
+
list: ["ChartCommonSpec", "CommonLayout", "MarkStyle", "LabelStyle", "TotalLabel"],
|
|
183803
183738
|
functions: {
|
|
183804
183739
|
formatValue: formatValue
|
|
183805
183740
|
}
|
|
@@ -185978,11 +185913,9 @@
|
|
|
185978
185913
|
}, {
|
|
185979
185914
|
key: "getDefaultAttribute",
|
|
185980
185915
|
value: function getDefaultAttribute() {
|
|
185981
|
-
var _a
|
|
185916
|
+
var _a;
|
|
185982
185917
|
return {
|
|
185983
|
-
spec:
|
|
185984
|
-
records: (null !== (_b = null === (_a = this._config.options.spec) || void 0 === _a ? void 0 : _a.records) && void 0 !== _b ? _b : []).slice()
|
|
185985
|
-
}),
|
|
185918
|
+
spec: this._config.options.spec,
|
|
185986
185919
|
dpr: this._canvas.getDpr(),
|
|
185987
185920
|
autoRender: !1,
|
|
185988
185921
|
width: 500,
|
|
@@ -185990,7 +185923,7 @@
|
|
|
185990
185923
|
interactive: !1,
|
|
185991
185924
|
panel: {},
|
|
185992
185925
|
ticker: this._ticker,
|
|
185993
|
-
zIndex: null !== (
|
|
185926
|
+
zIndex: null !== (_a = this._config.zIndex) && void 0 !== _a ? _a : 0,
|
|
185994
185927
|
chartOption: {
|
|
185995
185928
|
disableTriggerEvent: !0,
|
|
185996
185929
|
disableDirtyBounds: !0,
|
|
@@ -186475,16 +186408,6 @@
|
|
|
186475
186408
|
label: CommonLabelStyleMap
|
|
186476
186409
|
}
|
|
186477
186410
|
};
|
|
186478
|
-
var LineSymbolType;
|
|
186479
|
-
!function (LineSymbolType) {
|
|
186480
|
-
LineSymbolType.none = "none", LineSymbolType.arrow = "arrow", LineSymbolType.solidArrow = "solidArrow", LineSymbolType.hollowArrow = "hollowArrow", LineSymbolType.solidCircle = "solidCircle", LineSymbolType.hollowCircle = "hollowCircle";
|
|
186481
|
-
}(LineSymbolType || (LineSymbolType = {}));
|
|
186482
|
-
var lineSymbolPathMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, LineSymbolType.none, ""), LineSymbolType.arrow, "M -1 1 L 0 0 L 1 1"), LineSymbolType.solidArrow, "M -1 1.5 L 0 0 L 1 1.5 Z"), LineSymbolType.hollowArrow, "M -1 1.5 L 0 0 L 1 1.5 Z"), LineSymbolType.solidCircle, "M 1 0 A 1 1 0 1 1 -1 0 A 1 1 0 1 1 1 0"), LineSymbolType.hollowCircle, "M 1 0 A 1 1 0 1 1 -1 0 A 1 1 0 1 1 1 0");
|
|
186483
|
-
var MARKER_NOT_SUPPORT_CHARTS = ["pie", "rose", "radar", "sequence", "map", "circularProgress", "linearProgress", "wordCloud", "wordCloud3d", "funnel", "funnel3d", "boxPlot", "gauge", "sankey", "treemap", "sunburst", "circlePacking", "heatmap", "correlation"];
|
|
186484
|
-
var MarkerTypeEnum;
|
|
186485
|
-
!function (MarkerTypeEnum) {
|
|
186486
|
-
MarkerTypeEnum.horizontalLine = "h-line", MarkerTypeEnum.verticalLine = "v-line", MarkerTypeEnum.horizontalArea = "h-area", MarkerTypeEnum.verticalArea = "v-area", MarkerTypeEnum.growthLine = "growth-line", MarkerTypeEnum.totalDiffLine = "total-diff-line", MarkerTypeEnum.hierarchyDiffLine = "hierarchy-diff-line", MarkerTypeEnum.point = "mark-point", MarkerTypeEnum.trendLine = "trend-line", MarkerTypeEnum.partitionLine = "partition-line", MarkerTypeEnum.partitionArea = "partition-area";
|
|
186487
|
-
}(MarkerTypeEnum || (MarkerTypeEnum = {}));
|
|
186488
186411
|
|
|
186489
186412
|
function GetVChartSeriesWithMatch(vchart, seriesMatch) {
|
|
186490
186413
|
return !isValid$1(seriesMatch.specIndex) && seriesMatch.type ? vchart.getAllSeries().filter(function (s) {
|
|
@@ -186525,48 +186448,6 @@
|
|
|
186525
186448
|
return isSingleMarkMatch(v, series, scaleMap, datum);
|
|
186526
186449
|
}) : null;
|
|
186527
186450
|
}
|
|
186528
|
-
function transformMarkerSymbolAttributeByKey(attr, key) {
|
|
186529
|
-
var _a, _b, _c;
|
|
186530
|
-
if (null === (_a = attr[key]) || void 0 === _a ? void 0 : _a.originSymbolType) {
|
|
186531
|
-
attr[key].symbolType = lineSymbolPathMap[attr[key].originSymbolType], attr[key].refX = 0;
|
|
186532
|
-
var symbolStyle = null !== (_b = attr[key].style) && void 0 !== _b ? _b : {},
|
|
186533
|
-
color = null !== (_c = symbolStyle.color) && void 0 !== _c ? _c : isString$2(symbolStyle.fill) ? symbolStyle.fill : isString$2(symbolStyle.stroke) ? symbolStyle.stroke : "#000";
|
|
186534
|
-
attr[key].originSymbolType === LineSymbolType.arrow ? (attr[key].style = merge$1({}, symbolStyle, {
|
|
186535
|
-
fill: !1,
|
|
186536
|
-
stroke: color,
|
|
186537
|
-
lineWidth: 1,
|
|
186538
|
-
color: color
|
|
186539
|
-
}), attr[key].symbolType = '<svg><path d="M -1 1 L 0 0 L 1 1"/></svg>') : attr[key].originSymbolType === LineSymbolType.solidArrow || attr[key].originSymbolType === LineSymbolType.solidCircle ? attr[key].style = merge$1({}, symbolStyle, {
|
|
186540
|
-
fillOpacity: 1,
|
|
186541
|
-
fill: color,
|
|
186542
|
-
color: color,
|
|
186543
|
-
lineWidth: 0
|
|
186544
|
-
}) : attr[key].originSymbolType !== LineSymbolType.hollowArrow && attr[key].originSymbolType !== LineSymbolType.hollowCircle || (attr[key].style = merge$1({}, symbolStyle, {
|
|
186545
|
-
fillOpacity: 1,
|
|
186546
|
-
fill: "#fff",
|
|
186547
|
-
stroke: color,
|
|
186548
|
-
color: color,
|
|
186549
|
-
lineWidth: 1
|
|
186550
|
-
}));
|
|
186551
|
-
}
|
|
186552
|
-
return attr;
|
|
186553
|
-
}
|
|
186554
|
-
function getChartType(options) {
|
|
186555
|
-
var _a;
|
|
186556
|
-
var chartType = options.chartType,
|
|
186557
|
-
_options$spec = options.spec,
|
|
186558
|
-
spec = _options$spec === void 0 ? {} : _options$spec;
|
|
186559
|
-
if (chartType) return chartType;
|
|
186560
|
-
if (spec.series && spec.series.length) {
|
|
186561
|
-
var seriesTypes = spec.series.map(function (s) {
|
|
186562
|
-
return s.type;
|
|
186563
|
-
});
|
|
186564
|
-
if (seriesTypes.every(function (t) {
|
|
186565
|
-
return t === seriesTypes[0];
|
|
186566
|
-
})) return seriesTypes[0];
|
|
186567
|
-
}
|
|
186568
|
-
return null !== (_a = spec.type) && void 0 !== _a ? _a : "common";
|
|
186569
|
-
}
|
|
186570
186451
|
|
|
186571
186452
|
var StroyAllDataGroup = "_STORY_ALL_DATA_GROUP";
|
|
186572
186453
|
|
|
@@ -187226,7 +187107,7 @@
|
|
|
187226
187107
|
if (options.rowVisible && Object.keys(options.rowVisible).length > 0) {
|
|
187227
187108
|
var records = [],
|
|
187228
187109
|
headerRowVisible = options.rowVisible[-1];
|
|
187229
|
-
spec.showHeader = !1 !== headerRowVisible && !1 !== options.showHeader,
|
|
187110
|
+
spec.showHeader = !1 !== headerRowVisible && !1 !== options.showHeader, spec.records.forEach(function (record, index) {
|
|
187230
187111
|
!1 !== options.rowVisible[index] && records.push(record);
|
|
187231
187112
|
}), spec.records = records;
|
|
187232
187113
|
}
|
|
@@ -187369,46 +187250,12 @@
|
|
|
187369
187250
|
}();
|
|
187370
187251
|
var ContentRowStyleRuntimeInstance = new ContentRowStyleRuntime();
|
|
187371
187252
|
|
|
187372
|
-
var ChartMarkerRuntime = /*#__PURE__*/function () {
|
|
187373
|
-
function ChartMarkerRuntime() {
|
|
187374
|
-
_classCallCheck(this, ChartMarkerRuntime);
|
|
187375
|
-
this.type = "ChartMarker";
|
|
187376
|
-
}
|
|
187377
|
-
return _createClass(ChartMarkerRuntime, [{
|
|
187378
|
-
key: "applyConfigToAttribute",
|
|
187379
|
-
value: function applyConfigToAttribute(character) {
|
|
187380
|
-
var _a;
|
|
187381
|
-
var config = character.getRuntimeConfig().config,
|
|
187382
|
-
marker = null === (_a = config.options) || void 0 === _a ? void 0 : _a.marker,
|
|
187383
|
-
rawAttribute = character.getRuntimeConfig().getAttribute(),
|
|
187384
|
-
spec = rawAttribute.spec,
|
|
187385
|
-
chartType = getChartType(config.options);
|
|
187386
|
-
marker && (Object.keys(marker).forEach(function (key) {
|
|
187387
|
-
var _spec$key;
|
|
187388
|
-
spec[key] ? spec[key] = spec[key].filter(function (s) {
|
|
187389
|
-
return !s.name;
|
|
187390
|
-
}) : spec[key] = [], marker[key] && (_spec$key = spec[key]).push.apply(_spec$key, _toConsumableArray(marker[key]));
|
|
187391
|
-
}), "scatter" !== chartType && spec.markLine && spec.markLine.length && (spec.markLine = spec.markLine.filter(function (spec) {
|
|
187392
|
-
return spec.name !== MarkerTypeEnum.partitionLine;
|
|
187393
|
-
}))), MARKER_NOT_SUPPORT_CHARTS.includes(chartType) && (spec.markArea = [], spec.markLine = []), spec.markLine && spec.markLine.length && spec.markLine.forEach(function (mark) {
|
|
187394
|
-
[MarkerTypeEnum.growthLine, MarkerTypeEnum.hierarchyDiffLine, MarkerTypeEnum.horizontalLine, MarkerTypeEnum.partitionLine, MarkerTypeEnum.totalDiffLine, MarkerTypeEnum.verticalLine].includes(mark.name) && (transformMarkerSymbolAttributeByKey(mark, "startSymbol"), transformMarkerSymbolAttributeByKey(mark, "endSymbol"));
|
|
187395
|
-
}), spec.markPoint && spec.markPoint.length && spec.markPoint.forEach(function (mark) {
|
|
187396
|
-
if (mark.name === MarkerTypeEnum.point) {
|
|
187397
|
-
var itemLine = mark.itemLine;
|
|
187398
|
-
transformMarkerSymbolAttributeByKey(itemLine, "startSymbol"), transformMarkerSymbolAttributeByKey(itemLine, "endSymbol"), itemLine.startSymbol.originSymbolType && ("type-arc" !== itemLine.type && itemLine.startSymbol.originSymbolType === LineSymbolType.arrow ? itemLine.startSymbol.refX = -itemLine.startSymbol.size / 2 : itemLine.startSymbol.refX = 0), itemLine.endSymbol.originSymbolType && ("type-arc" !== itemLine.type && itemLine.endSymbol.originSymbolType === LineSymbolType.arrow ? itemLine.endSymbol.refX = -itemLine.endSymbol.size / 2 : itemLine.endSymbol.refX = 0);
|
|
187399
|
-
}
|
|
187400
|
-
});
|
|
187401
|
-
}
|
|
187402
|
-
}]);
|
|
187403
|
-
}();
|
|
187404
|
-
var ChartMarkerRuntimeInstance = new ChartMarkerRuntime();
|
|
187405
|
-
|
|
187406
187253
|
var _register = !1;
|
|
187407
187254
|
function registerCharacters() {
|
|
187408
187255
|
_register || (_register = !0, StoryFactory.registerCharacter(VChartCharacter.type, VChartCharacter), registerRankingBarTemp(), registerAllVChart(), StoryFactory.registerCharacter(RankingBarCharacter.type, RankingBarCharacter), StoryFactory.registerCharacter(WaveScatterCharacter.type, WaveScatterCharacter), StoryFactory.registerCharacter(ScatterBarCharacter.type, ScatterBarCharacter), StoryFactory.registerCharacter(TextCharacter.type, TextCharacter), StoryFactory.registerCharacter(RectCharacter.type, RectCharacter), StoryFactory.registerCharacter(ImageCharacter.type, ImageCharacter), StoryFactory.registerCharacter(LineCharacter.type, LineCharacter), StoryFactory.registerCharacter(ShapeCharacter.type, ShapeCharacter), StoryFactory.registerCharacter(PolygonCharacter.type, PolygonCharacter), StoryFactory.registerCharacter(ArcCharacter.type, ArcCharacter), StoryFactory.registerCharacter(TimelineCharacter.type, TimelineCharacter), StoryFactory.registerCharacter(UnitCharacter.type, UnitCharacter), StoryFactory.registerCharacter(VTableCharacter.type, VTableCharacter), StoryFactory.registerCharacter(PivotChartCharacter.type, PivotChartCharacter), registerRuntime());
|
|
187409
187256
|
}
|
|
187410
187257
|
function registerRuntime() {
|
|
187411
|
-
RuntimeStore.register(CommonLayoutRuntimeInstance), RuntimeStore.register(CommonSpecRuntimeInstance$1), RuntimeStore.register(SeriesSpecRuntimeInstance), RuntimeStore.register(MarkStyleRuntimeInstance), RuntimeStore.register(LabelStyleRuntimeInstance), RuntimeStore.register(TotalLabelRuntimeInstance), RuntimeStore.register(
|
|
187258
|
+
RuntimeStore.register(CommonLayoutRuntimeInstance), RuntimeStore.register(CommonSpecRuntimeInstance$1), RuntimeStore.register(SeriesSpecRuntimeInstance), RuntimeStore.register(MarkStyleRuntimeInstance), RuntimeStore.register(LabelStyleRuntimeInstance), RuntimeStore.register(TotalLabelRuntimeInstance), RuntimeStore.register(RankingBarRuntimeInstance), RuntimeStore.register(WaveScatterRuntimeInstance), RuntimeStore.register(BaseGraphicRuntimeInstance), RuntimeStore.register(TextRuntimeInstance), RuntimeStore.register(LineRuntimeInstance), RuntimeStore.register(CommonSpecRuntimeInstance), RuntimeStore.register(TableTypeRuntimeInstance), RuntimeStore.register(TableThemeRuntimeInstance), RuntimeStore.register(ShowHeaderRuntimeInstance), RuntimeStore.register(ColWidthRuntimeInstance), RuntimeStore.register(RowHeightRuntimeInstance), RuntimeStore.register(ColVisibleRuntimeInstance), RuntimeStore.register(RowVisibleRuntimeInstance), RuntimeStore.register(ColStyleRuntimeInstance), RuntimeStore.register(RowStyleRuntimeInstance), RuntimeStore.register(ContentColStyleRuntimeInstance), RuntimeStore.register(ContentRowStyleRuntimeInstance), RuntimeStore.register(CellStyleRuntimeInstance);
|
|
187412
187259
|
}
|
|
187413
187260
|
|
|
187414
187261
|
exports.SetConfigMode = void 0;
|