@visactor/vrender 0.16.14-alpha.2 → 0.16.14-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.js +178 -176
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +4 -4
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,5 +21,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
21
21
|
|
|
22
22
|
const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits");
|
|
23
23
|
|
|
24
|
-
exports.version = "0.16.14-alpha.
|
|
24
|
+
exports.version = "0.16.14-alpha.3", (0, vrender_kits_1.loadAllModule)(vrender_core_1.container),
|
|
25
25
|
__exportStar(require("@visactor/vrender-core"), exports), __exportStar(require("@visactor/vrender-kits"), exports);
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAmD;AACnD,yDAAuD;AAG1C,QAAA,OAAO,GAAG,iBAAiB,CAAC;AAEzC,IAAA,4BAAa,EAAC,wBAAS,CAAC,CAAC;AAEzB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import { container } from '@visactor/vrender-core';\nimport { loadAllModule } from '@visactor/vrender-kits';\n\n// 导出版本号\nexport const version = \"0.16.14-alpha.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAmD;AACnD,yDAAuD;AAG1C,QAAA,OAAO,GAAG,iBAAiB,CAAC;AAEzC,IAAA,4BAAa,EAAC,wBAAS,CAAC,CAAC;AAEzB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import { container } from '@visactor/vrender-core';\nimport { loadAllModule } from '@visactor/vrender-kits';\n\n// 导出版本号\nexport const version = \"0.16.14-alpha.3\";\n\nloadAllModule(container);\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
|
package/dist/index.js
CHANGED
|
@@ -7178,6 +7178,158 @@
|
|
|
7178
7178
|
return containPath(commands, lineWidth, !0, x, y);
|
|
7179
7179
|
}
|
|
7180
7180
|
|
|
7181
|
+
exports.Edge = void 0;
|
|
7182
|
+
!function (Edge) {
|
|
7183
|
+
Edge[Edge.Top = 1] = "Top", Edge[Edge.Right = 2] = "Right", Edge[Edge.Bottom = 4] = "Bottom", Edge[Edge.Left = 8] = "Left", Edge[Edge.ALL = 15] = "ALL";
|
|
7184
|
+
}(exports.Edge || (exports.Edge = {}));
|
|
7185
|
+
var _strokeVec4 = [!1, !1, !1, !1];
|
|
7186
|
+
var parseStroke = function parseStroke(stroke) {
|
|
7187
|
+
var _a;
|
|
7188
|
+
var isFullStroke = !0;
|
|
7189
|
+
if (isBoolean$1(stroke, !0)) {
|
|
7190
|
+
for (var i = 0; i < 4; i++) _strokeVec4[i] = stroke, isFullStroke && (isFullStroke = !(null !== (_a = _strokeVec4[i]) && void 0 !== _a && !_a));
|
|
7191
|
+
isFullStroke = stroke;
|
|
7192
|
+
} else if (Array.isArray(stroke)) for (var _i = 0; _i < 4; _i++) _strokeVec4[_i] = !!stroke[_i], isFullStroke && (isFullStroke = !!_strokeVec4[_i]);else _strokeVec4[0] = !1, _strokeVec4[1] = !1, _strokeVec4[2] = !1, _strokeVec4[3] = !1;
|
|
7193
|
+
return {
|
|
7194
|
+
isFullStroke: isFullStroke,
|
|
7195
|
+
stroke: _strokeVec4
|
|
7196
|
+
};
|
|
7197
|
+
};
|
|
7198
|
+
var _paddingVec4 = [0, 0, 0, 0];
|
|
7199
|
+
var parsePadding = function parsePadding(padding) {
|
|
7200
|
+
return padding ? isArray$1(padding) ? 0 === padding.length ? 0 : 1 === padding.length ? padding[0] : 2 === padding.length ? (_paddingVec4[0] = padding[0], _paddingVec4[2] = padding[0], _paddingVec4[1] = padding[1], _paddingVec4[3] = padding[1], _paddingVec4) : padding : padding : 0;
|
|
7201
|
+
};
|
|
7202
|
+
var _coords = [{
|
|
7203
|
+
x: 0,
|
|
7204
|
+
y: 0
|
|
7205
|
+
}, {
|
|
7206
|
+
x: 0,
|
|
7207
|
+
y: 0
|
|
7208
|
+
}, {
|
|
7209
|
+
x: 0,
|
|
7210
|
+
y: 0
|
|
7211
|
+
}, {
|
|
7212
|
+
x: 0,
|
|
7213
|
+
y: 0
|
|
7214
|
+
}],
|
|
7215
|
+
indexList = [1, 2, 3, 0, 1, 2, 3, 0];
|
|
7216
|
+
function circleBounds(startAngle, endAngle, radius, bounds) {
|
|
7217
|
+
for (; startAngle >= pi2;) startAngle -= pi2;
|
|
7218
|
+
for (; startAngle < 0;) startAngle += pi2;
|
|
7219
|
+
for (; startAngle > endAngle;) endAngle += pi2;
|
|
7220
|
+
_coords[0].x = radius, _coords[1].y = radius, _coords[2].x = -radius, _coords[3].y = -radius;
|
|
7221
|
+
var startIdx = Math.ceil(startAngle / halfPi$1) % 4,
|
|
7222
|
+
endIdx = Math.ceil(endAngle / halfPi$1) % 4;
|
|
7223
|
+
if (bounds.add(cos(startAngle) * radius, sin(startAngle) * radius), bounds.add(cos(endAngle) * radius, sin(endAngle) * radius), startIdx !== endIdx || endAngle - startAngle > pi) {
|
|
7224
|
+
var match = !1;
|
|
7225
|
+
for (var i = 0; i < indexList.length; i++) if (match || startIdx !== indexList[i]) {
|
|
7226
|
+
if (match && endIdx === indexList[i]) break;
|
|
7227
|
+
if (match) {
|
|
7228
|
+
var p = _coords[indexList[i]];
|
|
7229
|
+
bounds.add(p.x, p.y);
|
|
7230
|
+
}
|
|
7231
|
+
} else {
|
|
7232
|
+
match = !0;
|
|
7233
|
+
var _p = _coords[startIdx];
|
|
7234
|
+
bounds.add(_p.x, _p.y);
|
|
7235
|
+
}
|
|
7236
|
+
}
|
|
7237
|
+
}
|
|
7238
|
+
function pointsEqual(pointsA, pointsB) {
|
|
7239
|
+
return !(!pointsA || !pointsB) && (Array.isArray(pointsA) && Array.isArray(pointsB) ? pointsA.length === pointsB.length && pointsA.every(function (point, index) {
|
|
7240
|
+
return pointEqual(point, pointsB[index]);
|
|
7241
|
+
}) : !Number.isNaN(pointsA.x + pointsA.y) && pointEqual(pointsA, pointsB));
|
|
7242
|
+
}
|
|
7243
|
+
function pointEqual(pointA, pointB) {
|
|
7244
|
+
return pointA.x === pointB.x && pointA.y === pointB.y && pointA.x1 === pointB.x1 && pointA.y1 === pointB.y1 && pointA.defined === pointB.defined;
|
|
7245
|
+
}
|
|
7246
|
+
function pointInterpolation(pointA, pointB, ratio) {
|
|
7247
|
+
var _pointAt = pointAt(pointA.x, pointA.y, pointB.x, pointB.y, ratio),
|
|
7248
|
+
x = _pointAt.x,
|
|
7249
|
+
y = _pointAt.y,
|
|
7250
|
+
_pointAt2 = pointAt(pointA.x1, pointA.y1, pointB.x1, pointB.y1, ratio),
|
|
7251
|
+
x1 = _pointAt2.x,
|
|
7252
|
+
y1 = _pointAt2.y,
|
|
7253
|
+
point = new Point(x, y, x1, y1);
|
|
7254
|
+
return point.defined = pointB.defined, point;
|
|
7255
|
+
}
|
|
7256
|
+
function pointInterpolationHighPerformance(pointA, pointB, ratio, point) {
|
|
7257
|
+
var _pointAt3 = pointAt(pointA.x, pointA.y, pointB.x, pointB.y, ratio),
|
|
7258
|
+
x = _pointAt3.x,
|
|
7259
|
+
y = _pointAt3.y,
|
|
7260
|
+
_pointAt4 = pointAt(pointA.x1, pointA.y1, pointB.x1, pointB.y1, ratio),
|
|
7261
|
+
x1 = _pointAt4.x,
|
|
7262
|
+
y1 = _pointAt4.y;
|
|
7263
|
+
return point.x = x, point.y = y, point.x1 = x1, point.y1 = y1, point.defined = pointB.defined, point;
|
|
7264
|
+
}
|
|
7265
|
+
function pointsInterpolation(pointsA, pointsB, ratio) {
|
|
7266
|
+
if (!pointsA || !pointsB) return [];
|
|
7267
|
+
Array.isArray(pointsA) || (pointsA = [pointsA]), Array.isArray(pointsB) || (pointsB = [pointsB]);
|
|
7268
|
+
var points = [];
|
|
7269
|
+
if (pointsA.length > pointsB.length) {
|
|
7270
|
+
points = pointsB.map(function (point) {
|
|
7271
|
+
var p = new Point(point.x, point.y, point.x1, point.y1);
|
|
7272
|
+
return p.defined = point.defined, p;
|
|
7273
|
+
});
|
|
7274
|
+
for (var i = 0; i < pointsB.length; i++) points[i] = pointInterpolation(pointsA[i], pointsB[i], ratio);
|
|
7275
|
+
} else {
|
|
7276
|
+
points = pointsB.map(function (point) {
|
|
7277
|
+
var p = new Point(point.x, point.y, point.x1, point.y1);
|
|
7278
|
+
return p.defined = point.defined, p;
|
|
7279
|
+
});
|
|
7280
|
+
for (var _i2 = 0; _i2 < pointsA.length; _i2++) points[_i2] = pointInterpolation(pointsA[_i2], pointsB[_i2], ratio);
|
|
7281
|
+
}
|
|
7282
|
+
return points;
|
|
7283
|
+
}
|
|
7284
|
+
var transformKeys = ["x", "y", "dx", "dy", "scaleX", "scaleY", "angle", "anchor", "postMatrix", "scrollX", "scrollY"];
|
|
7285
|
+
var isTransformKey = function isTransformKey(key) {
|
|
7286
|
+
return transformKeys.includes(key);
|
|
7287
|
+
};
|
|
7288
|
+
function getAttributeFromDefaultAttrList(attr, key) {
|
|
7289
|
+
if (isArray$1(attr)) {
|
|
7290
|
+
var val;
|
|
7291
|
+
for (var i = 0; i < attr.length && void 0 === val; i++) val = attr[i][key];
|
|
7292
|
+
return val;
|
|
7293
|
+
}
|
|
7294
|
+
return attr[key];
|
|
7295
|
+
}
|
|
7296
|
+
var RafBasedSTO = /*#__PURE__*/function () {
|
|
7297
|
+
function RafBasedSTO() {
|
|
7298
|
+
_classCallCheck(this, RafBasedSTO);
|
|
7299
|
+
this.durations = [], this.timeout = RafBasedSTO.TimeOut, this.lastDate = 0, this.durationsListThreshold = 30;
|
|
7300
|
+
}
|
|
7301
|
+
_createClass(RafBasedSTO, [{
|
|
7302
|
+
key: "call",
|
|
7303
|
+
value: function call(cb) {
|
|
7304
|
+
var _this = this;
|
|
7305
|
+
return this.lastDate = Date.now(), setTimeout(function () {
|
|
7306
|
+
_this.appendDuration(Date.now() - _this.lastDate), cb(0);
|
|
7307
|
+
}, this.timeout, !0);
|
|
7308
|
+
}
|
|
7309
|
+
}, {
|
|
7310
|
+
key: "clear",
|
|
7311
|
+
value: function clear(h) {
|
|
7312
|
+
clearTimeout(h);
|
|
7313
|
+
}
|
|
7314
|
+
}, {
|
|
7315
|
+
key: "appendDuration",
|
|
7316
|
+
value: function appendDuration(d) {
|
|
7317
|
+
this.durations.push(d), this.durations.length > this.durationsListThreshold && this.durations.shift(), this.timeout = Math.min(Math.max(this.durations.reduce(function (a, b) {
|
|
7318
|
+
return a + b;
|
|
7319
|
+
}, 0) / this.durations.length, 1e3 / 60), 1e3 / 30);
|
|
7320
|
+
}
|
|
7321
|
+
}]);
|
|
7322
|
+
return RafBasedSTO;
|
|
7323
|
+
}();
|
|
7324
|
+
RafBasedSTO.TimeOut = 1e3 / 60;
|
|
7325
|
+
var rafBasedSto = new RafBasedSTO();
|
|
7326
|
+
var calculateLineHeight = function calculateLineHeight(lineHeight, fontSize) {
|
|
7327
|
+
if (isString$1(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
7328
|
+
return fontSize * (Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100);
|
|
7329
|
+
}
|
|
7330
|
+
return lineHeight;
|
|
7331
|
+
};
|
|
7332
|
+
|
|
7181
7333
|
var __decorate$1P = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
7182
7334
|
var d,
|
|
7183
7335
|
c = arguments.length,
|
|
@@ -7254,7 +7406,9 @@
|
|
|
7254
7406
|
},
|
|
7255
7407
|
getTextBounds: void 0,
|
|
7256
7408
|
specialCharSet: "-/: .,@%'\"~" + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
|
|
7257
|
-
}, null != option ? option : {}), textSpec)
|
|
7409
|
+
}, null != option ? option : {}), Object.assign(Object.assign({}, textSpec), {
|
|
7410
|
+
lineHeight: calculateLineHeight(null == textSpec ? void 0 : textSpec.lineHeight, null == textSpec ? void 0 : textSpec.fontSize)
|
|
7411
|
+
}));
|
|
7258
7412
|
}
|
|
7259
7413
|
}]);
|
|
7260
7414
|
return DefaultGraphicUtil;
|
|
@@ -8389,13 +8543,12 @@
|
|
|
8389
8543
|
}, {
|
|
8390
8544
|
key: "mapEvent",
|
|
8391
8545
|
value: function mapEvent(e) {
|
|
8392
|
-
var _this$_prePointTarget;
|
|
8393
8546
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
8394
8547
|
if (!this.rootTarget) return;
|
|
8395
8548
|
var mappers = this.mappingTable[e.type];
|
|
8396
8549
|
var target;
|
|
8397
8550
|
var cacheKey = "".concat(e.canvasX, "-").concat(e.canvasY);
|
|
8398
|
-
if ((null === (_a = this._prePointTargetCache) || void 0 === _a ? void 0 : _a[cacheKey]) && (null === (_c = null === (_b = this._prePointTargetCache) || void 0 === _b ? void 0 : _b[cacheKey]) || void 0 === _c ? void 0 : _c.stage) && (null === (_e = null === (_d = this._prePointTargetCache) || void 0 === _d ? void 0 : _d[cacheKey]) || void 0 === _e ? void 0 : _e.stage.renderCount) === (null === (_f = this._prePointTargetCache) || void 0 === _f ? void 0 : _f.stageRenderCount) ? target = this._prePointTargetCache[cacheKey] : (target = this.pickTarget(e.canvasX, e.canvasY, e), e.pickParams || (this._prePointTargetCache = (
|
|
8551
|
+
if ((null === (_a = this._prePointTargetCache) || void 0 === _a ? void 0 : _a[cacheKey]) && (null === (_c = null === (_b = this._prePointTargetCache) || void 0 === _b ? void 0 : _b[cacheKey]) || void 0 === _c ? void 0 : _c.stage) && (null === (_e = null === (_d = this._prePointTargetCache) || void 0 === _d ? void 0 : _d[cacheKey]) || void 0 === _e ? void 0 : _e.stage.renderCount) === (null === (_f = this._prePointTargetCache) || void 0 === _f ? void 0 : _f.stageRenderCount) ? target = this._prePointTargetCache[cacheKey] : (target = this.pickTarget(e.canvasX, e.canvasY, e), e.pickParams || (this._prePointTargetCache = _defineProperty(_defineProperty({}, cacheKey, target), "stageRenderCount", null !== (_g = null == target ? void 0 : target.stage.renderCount) && void 0 !== _g ? _g : -1))), mappers) for (var i = 0, j = mappers.length; i < j; i++) mappers[i].fn(e, target);else console.warn("[EventManager]: Event mapping not defined for ".concat(e.type));
|
|
8399
8552
|
}
|
|
8400
8553
|
}, {
|
|
8401
8554
|
key: "propagate",
|
|
@@ -9803,152 +9956,6 @@
|
|
|
9803
9956
|
easing: "quadInOut"
|
|
9804
9957
|
};
|
|
9805
9958
|
|
|
9806
|
-
exports.Edge = void 0;
|
|
9807
|
-
!function (Edge) {
|
|
9808
|
-
Edge[Edge.Top = 1] = "Top", Edge[Edge.Right = 2] = "Right", Edge[Edge.Bottom = 4] = "Bottom", Edge[Edge.Left = 8] = "Left", Edge[Edge.ALL = 15] = "ALL";
|
|
9809
|
-
}(exports.Edge || (exports.Edge = {}));
|
|
9810
|
-
var _strokeVec4 = [!1, !1, !1, !1];
|
|
9811
|
-
var parseStroke = function parseStroke(stroke) {
|
|
9812
|
-
var _a;
|
|
9813
|
-
var isFullStroke = !0;
|
|
9814
|
-
if (isBoolean$1(stroke, !0)) {
|
|
9815
|
-
for (var i = 0; i < 4; i++) _strokeVec4[i] = stroke, isFullStroke && (isFullStroke = !(null !== (_a = _strokeVec4[i]) && void 0 !== _a && !_a));
|
|
9816
|
-
isFullStroke = stroke;
|
|
9817
|
-
} else if (Array.isArray(stroke)) for (var _i = 0; _i < 4; _i++) _strokeVec4[_i] = !!stroke[_i], isFullStroke && (isFullStroke = !!_strokeVec4[_i]);else _strokeVec4[0] = !1, _strokeVec4[1] = !1, _strokeVec4[2] = !1, _strokeVec4[3] = !1;
|
|
9818
|
-
return {
|
|
9819
|
-
isFullStroke: isFullStroke,
|
|
9820
|
-
stroke: _strokeVec4
|
|
9821
|
-
};
|
|
9822
|
-
};
|
|
9823
|
-
var _paddingVec4 = [0, 0, 0, 0];
|
|
9824
|
-
var parsePadding = function parsePadding(padding) {
|
|
9825
|
-
return padding ? isArray$1(padding) ? 0 === padding.length ? 0 : 1 === padding.length ? padding[0] : 2 === padding.length ? (_paddingVec4[0] = padding[0], _paddingVec4[2] = padding[0], _paddingVec4[1] = padding[1], _paddingVec4[3] = padding[1], _paddingVec4) : padding : padding : 0;
|
|
9826
|
-
};
|
|
9827
|
-
var _coords = [{
|
|
9828
|
-
x: 0,
|
|
9829
|
-
y: 0
|
|
9830
|
-
}, {
|
|
9831
|
-
x: 0,
|
|
9832
|
-
y: 0
|
|
9833
|
-
}, {
|
|
9834
|
-
x: 0,
|
|
9835
|
-
y: 0
|
|
9836
|
-
}, {
|
|
9837
|
-
x: 0,
|
|
9838
|
-
y: 0
|
|
9839
|
-
}],
|
|
9840
|
-
indexList = [1, 2, 3, 0, 1, 2, 3, 0];
|
|
9841
|
-
function circleBounds(startAngle, endAngle, radius, bounds) {
|
|
9842
|
-
for (; startAngle >= pi2;) startAngle -= pi2;
|
|
9843
|
-
for (; startAngle < 0;) startAngle += pi2;
|
|
9844
|
-
for (; startAngle > endAngle;) endAngle += pi2;
|
|
9845
|
-
_coords[0].x = radius, _coords[1].y = radius, _coords[2].x = -radius, _coords[3].y = -radius;
|
|
9846
|
-
var startIdx = Math.ceil(startAngle / halfPi$1) % 4,
|
|
9847
|
-
endIdx = Math.ceil(endAngle / halfPi$1) % 4;
|
|
9848
|
-
if (bounds.add(cos(startAngle) * radius, sin(startAngle) * radius), bounds.add(cos(endAngle) * radius, sin(endAngle) * radius), startIdx !== endIdx || endAngle - startAngle > pi) {
|
|
9849
|
-
var match = !1;
|
|
9850
|
-
for (var i = 0; i < indexList.length; i++) if (match || startIdx !== indexList[i]) {
|
|
9851
|
-
if (match && endIdx === indexList[i]) break;
|
|
9852
|
-
if (match) {
|
|
9853
|
-
var p = _coords[indexList[i]];
|
|
9854
|
-
bounds.add(p.x, p.y);
|
|
9855
|
-
}
|
|
9856
|
-
} else {
|
|
9857
|
-
match = !0;
|
|
9858
|
-
var _p = _coords[startIdx];
|
|
9859
|
-
bounds.add(_p.x, _p.y);
|
|
9860
|
-
}
|
|
9861
|
-
}
|
|
9862
|
-
}
|
|
9863
|
-
function pointsEqual(pointsA, pointsB) {
|
|
9864
|
-
return !(!pointsA || !pointsB) && (Array.isArray(pointsA) && Array.isArray(pointsB) ? pointsA.length === pointsB.length && pointsA.every(function (point, index) {
|
|
9865
|
-
return pointEqual(point, pointsB[index]);
|
|
9866
|
-
}) : !Number.isNaN(pointsA.x + pointsA.y) && pointEqual(pointsA, pointsB));
|
|
9867
|
-
}
|
|
9868
|
-
function pointEqual(pointA, pointB) {
|
|
9869
|
-
return pointA.x === pointB.x && pointA.y === pointB.y && pointA.x1 === pointB.x1 && pointA.y1 === pointB.y1 && pointA.defined === pointB.defined;
|
|
9870
|
-
}
|
|
9871
|
-
function pointInterpolation(pointA, pointB, ratio) {
|
|
9872
|
-
var _pointAt = pointAt(pointA.x, pointA.y, pointB.x, pointB.y, ratio),
|
|
9873
|
-
x = _pointAt.x,
|
|
9874
|
-
y = _pointAt.y,
|
|
9875
|
-
_pointAt2 = pointAt(pointA.x1, pointA.y1, pointB.x1, pointB.y1, ratio),
|
|
9876
|
-
x1 = _pointAt2.x,
|
|
9877
|
-
y1 = _pointAt2.y,
|
|
9878
|
-
point = new Point(x, y, x1, y1);
|
|
9879
|
-
return point.defined = pointB.defined, point;
|
|
9880
|
-
}
|
|
9881
|
-
function pointInterpolationHighPerformance(pointA, pointB, ratio, point) {
|
|
9882
|
-
var _pointAt3 = pointAt(pointA.x, pointA.y, pointB.x, pointB.y, ratio),
|
|
9883
|
-
x = _pointAt3.x,
|
|
9884
|
-
y = _pointAt3.y,
|
|
9885
|
-
_pointAt4 = pointAt(pointA.x1, pointA.y1, pointB.x1, pointB.y1, ratio),
|
|
9886
|
-
x1 = _pointAt4.x,
|
|
9887
|
-
y1 = _pointAt4.y;
|
|
9888
|
-
return point.x = x, point.y = y, point.x1 = x1, point.y1 = y1, point.defined = pointB.defined, point;
|
|
9889
|
-
}
|
|
9890
|
-
function pointsInterpolation(pointsA, pointsB, ratio) {
|
|
9891
|
-
if (!pointsA || !pointsB) return [];
|
|
9892
|
-
Array.isArray(pointsA) || (pointsA = [pointsA]), Array.isArray(pointsB) || (pointsB = [pointsB]);
|
|
9893
|
-
var points = [];
|
|
9894
|
-
if (pointsA.length > pointsB.length) {
|
|
9895
|
-
points = pointsB.map(function (point) {
|
|
9896
|
-
var p = new Point(point.x, point.y, point.x1, point.y1);
|
|
9897
|
-
return p.defined = point.defined, p;
|
|
9898
|
-
});
|
|
9899
|
-
for (var i = 0; i < pointsB.length; i++) points[i] = pointInterpolation(pointsA[i], pointsB[i], ratio);
|
|
9900
|
-
} else {
|
|
9901
|
-
points = pointsB.map(function (point) {
|
|
9902
|
-
var p = new Point(point.x, point.y, point.x1, point.y1);
|
|
9903
|
-
return p.defined = point.defined, p;
|
|
9904
|
-
});
|
|
9905
|
-
for (var _i2 = 0; _i2 < pointsA.length; _i2++) points[_i2] = pointInterpolation(pointsA[_i2], pointsB[_i2], ratio);
|
|
9906
|
-
}
|
|
9907
|
-
return points;
|
|
9908
|
-
}
|
|
9909
|
-
var transformKeys = ["x", "y", "dx", "dy", "scaleX", "scaleY", "angle", "anchor", "postMatrix", "scrollX", "scrollY"];
|
|
9910
|
-
var isTransformKey = function isTransformKey(key) {
|
|
9911
|
-
return transformKeys.includes(key);
|
|
9912
|
-
};
|
|
9913
|
-
function getAttributeFromDefaultAttrList(attr, key) {
|
|
9914
|
-
if (isArray$1(attr)) {
|
|
9915
|
-
var val;
|
|
9916
|
-
for (var i = 0; i < attr.length && void 0 === val; i++) val = attr[i][key];
|
|
9917
|
-
return val;
|
|
9918
|
-
}
|
|
9919
|
-
return attr[key];
|
|
9920
|
-
}
|
|
9921
|
-
var RafBasedSTO = /*#__PURE__*/function () {
|
|
9922
|
-
function RafBasedSTO() {
|
|
9923
|
-
_classCallCheck(this, RafBasedSTO);
|
|
9924
|
-
this.durations = [], this.timeout = RafBasedSTO.TimeOut, this.lastDate = 0, this.durationsListThreshold = 30;
|
|
9925
|
-
}
|
|
9926
|
-
_createClass(RafBasedSTO, [{
|
|
9927
|
-
key: "call",
|
|
9928
|
-
value: function call(cb) {
|
|
9929
|
-
var _this = this;
|
|
9930
|
-
return this.lastDate = Date.now(), setTimeout(function () {
|
|
9931
|
-
_this.appendDuration(Date.now() - _this.lastDate), cb(0);
|
|
9932
|
-
}, this.timeout, !0);
|
|
9933
|
-
}
|
|
9934
|
-
}, {
|
|
9935
|
-
key: "clear",
|
|
9936
|
-
value: function clear(h) {
|
|
9937
|
-
clearTimeout(h);
|
|
9938
|
-
}
|
|
9939
|
-
}, {
|
|
9940
|
-
key: "appendDuration",
|
|
9941
|
-
value: function appendDuration(d) {
|
|
9942
|
-
this.durations.push(d), this.durations.length > this.durationsListThreshold && this.durations.shift(), this.timeout = Math.min(Math.max(this.durations.reduce(function (a, b) {
|
|
9943
|
-
return a + b;
|
|
9944
|
-
}, 0) / this.durations.length, 1e3 / 60), 1e3 / 30);
|
|
9945
|
-
}
|
|
9946
|
-
}]);
|
|
9947
|
-
return RafBasedSTO;
|
|
9948
|
-
}();
|
|
9949
|
-
RafBasedSTO.TimeOut = 1e3 / 60;
|
|
9950
|
-
var rafBasedSto = new RafBasedSTO();
|
|
9951
|
-
|
|
9952
9959
|
var IncreaseCount = /*#__PURE__*/function (_ACustomAnimate) {
|
|
9953
9960
|
_inherits(IncreaseCount, _ACustomAnimate);
|
|
9954
9961
|
var _super = _createSuper(IncreaseCount);
|
|
@@ -12863,8 +12870,7 @@
|
|
|
12863
12870
|
}, {
|
|
12864
12871
|
key: "addChild",
|
|
12865
12872
|
value: function addChild(node) {
|
|
12866
|
-
|
|
12867
|
-
"__proto__" === node.tagname && (node.tagname = "#__proto__"), node[":@"] && Object.keys(node[":@"]).length > 0 ? this.child.push((_this$child$push2 = {}, _defineProperty(_this$child$push2, node.tagname, node.child), _defineProperty(_this$child$push2, ":@", node[":@"]), _this$child$push2)) : this.child.push(_defineProperty({}, node.tagname, node.child));
|
|
12873
|
+
"__proto__" === node.tagname && (node.tagname = "#__proto__"), node[":@"] && Object.keys(node[":@"]).length > 0 ? this.child.push(_defineProperty(_defineProperty({}, node.tagname, node.child), ":@", node[":@"])) : this.child.push(_defineProperty({}, node.tagname, node.child));
|
|
12868
12874
|
}
|
|
12869
12875
|
}]);
|
|
12870
12876
|
return XmlNode;
|
|
@@ -14562,7 +14568,7 @@
|
|
|
14562
14568
|
}, {
|
|
14563
14569
|
key: "updateWrapAABBBounds",
|
|
14564
14570
|
value: function updateWrapAABBBounds(text) {
|
|
14565
|
-
var _a, _b, _c;
|
|
14571
|
+
var _a, _b, _c, _d;
|
|
14566
14572
|
var textTheme = getTheme(this).text,
|
|
14567
14573
|
_this$attribute = this.attribute,
|
|
14568
14574
|
_this$attribute$fontF = _this$attribute.fontFamily,
|
|
@@ -14573,8 +14579,6 @@
|
|
|
14573
14579
|
textBaseline = _this$attribute$textB === void 0 ? textTheme.textBaseline : _this$attribute$textB,
|
|
14574
14580
|
_this$attribute$fontS = _this$attribute.fontSize,
|
|
14575
14581
|
fontSize = _this$attribute$fontS === void 0 ? textTheme.fontSize : _this$attribute$fontS,
|
|
14576
|
-
_this$attribute$lineH = _this$attribute.lineHeight,
|
|
14577
|
-
lineHeight = _this$attribute$lineH === void 0 ? this.attribute.lineHeight || this.attribute.fontSize || textTheme.fontSize : _this$attribute$lineH,
|
|
14578
14582
|
_this$attribute$ellip = _this$attribute.ellipsis,
|
|
14579
14583
|
ellipsis = _this$attribute$ellip === void 0 ? textTheme.ellipsis : _this$attribute$ellip,
|
|
14580
14584
|
maxLineWidth = _this$attribute.maxLineWidth,
|
|
@@ -14591,8 +14595,9 @@
|
|
|
14591
14595
|
_this$attribute$heigh = _this$attribute.heightLimit,
|
|
14592
14596
|
heightLimit = _this$attribute$heigh === void 0 ? 0 : _this$attribute$heigh,
|
|
14593
14597
|
lineClamp = _this$attribute.lineClamp,
|
|
14598
|
+
lineHeight = null !== (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize,
|
|
14594
14599
|
buf = ignoreBuf ? 0 : 2;
|
|
14595
|
-
if (!this.shouldUpdateShape() && (null === (
|
|
14600
|
+
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
14596
14601
|
var _bbox = this.cache.layoutData.bbox;
|
|
14597
14602
|
return this._AABBBounds.set(_bbox.xOffset, _bbox.yOffset, _bbox.xOffset + _bbox.width, _bbox.yOffset + _bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14598
14603
|
}
|
|
@@ -14624,7 +14629,7 @@
|
|
|
14624
14629
|
if ("" !== str && "" === clip.str) {
|
|
14625
14630
|
if (ellipsis) {
|
|
14626
14631
|
var clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
14627
|
-
clip.str = null !== (
|
|
14632
|
+
clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
|
|
14628
14633
|
} else clip.str = "", clip.width = 0;
|
|
14629
14634
|
needCut = !1;
|
|
14630
14635
|
}
|
|
@@ -14721,8 +14726,8 @@
|
|
|
14721
14726
|
whiteSpace = _attribute$whiteSpace === void 0 ? textTheme.whiteSpace : _attribute$whiteSpace;
|
|
14722
14727
|
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
14723
14728
|
var buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize),
|
|
14724
|
-
|
|
14725
|
-
lineHeight =
|
|
14729
|
+
textFontSize = attribute.fontSize || textTheme.fontSize,
|
|
14730
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, textFontSize)) && void 0 !== _a ? _a : textFontSize + buf;
|
|
14726
14731
|
if (!this.shouldUpdateShape() && this.cache) {
|
|
14727
14732
|
width = null !== (_b = this.cache.clipedWidth) && void 0 !== _b ? _b : 0;
|
|
14728
14733
|
var _dx = textDrawOffsetX(textAlign, width),
|
|
@@ -14792,12 +14797,11 @@
|
|
|
14792
14797
|
fontFamily = _attribute$fontFamily2 === void 0 ? textTheme.fontFamily : _attribute$fontFamily2,
|
|
14793
14798
|
_attribute$stroke2 = attribute.stroke,
|
|
14794
14799
|
stroke = _attribute$stroke2 === void 0 ? textTheme.stroke : _attribute$stroke2,
|
|
14795
|
-
_attribute$lineHeight2 = attribute.lineHeight,
|
|
14796
|
-
lineHeight = _attribute$lineHeight2 === void 0 ? null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf : _attribute$lineHeight2,
|
|
14797
14800
|
_attribute$lineWidth2 = attribute.lineWidth,
|
|
14798
14801
|
lineWidth = _attribute$lineWidth2 === void 0 ? textTheme.lineWidth : _attribute$lineWidth2,
|
|
14799
14802
|
_attribute$verticalMo = attribute.verticalMode,
|
|
14800
|
-
verticalMode = _attribute$verticalMo === void 0 ? textTheme.verticalMode : _attribute$verticalMo
|
|
14803
|
+
verticalMode = _attribute$verticalMo === void 0 ? textTheme.verticalMode : _attribute$verticalMo,
|
|
14804
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
14801
14805
|
var _attribute$textAlign2 = attribute.textAlign,
|
|
14802
14806
|
textAlign = _attribute$textAlign2 === void 0 ? textTheme.textAlign : _attribute$textAlign2,
|
|
14803
14807
|
_attribute$textBaseli2 = attribute.textBaseline,
|
|
@@ -14847,7 +14851,7 @@
|
|
|
14847
14851
|
}, {
|
|
14848
14852
|
key: "updateHorizontalMultilineAABBBounds",
|
|
14849
14853
|
value: function updateHorizontalMultilineAABBBounds(text) {
|
|
14850
|
-
var _a;
|
|
14854
|
+
var _a, _b;
|
|
14851
14855
|
var textTheme = getTheme(this).text,
|
|
14852
14856
|
attribute = this.attribute,
|
|
14853
14857
|
_attribute$fontFamily3 = attribute.fontFamily,
|
|
@@ -14860,8 +14864,6 @@
|
|
|
14860
14864
|
fontSize = _attribute$fontSize3 === void 0 ? textTheme.fontSize : _attribute$fontSize3,
|
|
14861
14865
|
_attribute$fontWeight3 = attribute.fontWeight,
|
|
14862
14866
|
fontWeight = _attribute$fontWeight3 === void 0 ? textTheme.fontWeight : _attribute$fontWeight3,
|
|
14863
|
-
_attribute$lineHeight3 = attribute.lineHeight,
|
|
14864
|
-
lineHeight = _attribute$lineHeight3 === void 0 ? attribute.lineHeight || attribute.fontSize || textTheme.fontSize : _attribute$lineHeight3,
|
|
14865
14867
|
_attribute$ellipsis3 = attribute.ellipsis,
|
|
14866
14868
|
ellipsis = _attribute$ellipsis3 === void 0 ? textTheme.ellipsis : _attribute$ellipsis3,
|
|
14867
14869
|
maxLineWidth = attribute.maxLineWidth,
|
|
@@ -14870,9 +14872,10 @@
|
|
|
14870
14872
|
_attribute$lineWidth3 = attribute.lineWidth,
|
|
14871
14873
|
lineWidth = _attribute$lineWidth3 === void 0 ? textTheme.lineWidth : _attribute$lineWidth3,
|
|
14872
14874
|
_attribute$whiteSpace2 = attribute.whiteSpace,
|
|
14873
|
-
whiteSpace = _attribute$whiteSpace2 === void 0 ? textTheme.whiteSpace : _attribute$whiteSpace2
|
|
14875
|
+
whiteSpace = _attribute$whiteSpace2 === void 0 ? textTheme.whiteSpace : _attribute$whiteSpace2,
|
|
14876
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize;
|
|
14874
14877
|
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
14875
|
-
if (!this.shouldUpdateShape() && (null === (
|
|
14878
|
+
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
14876
14879
|
var _bbox2 = this.cache.layoutData.bbox;
|
|
14877
14880
|
return this._AABBBounds.set(_bbox2.xOffset, _bbox2.yOffset, _bbox2.xOffset + _bbox2.width, _bbox2.yOffset + _bbox2.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14878
14881
|
}
|
|
@@ -14908,12 +14911,11 @@
|
|
|
14908
14911
|
fontWeight = _attribute$fontWeight4 === void 0 ? textTheme.fontWeight : _attribute$fontWeight4,
|
|
14909
14912
|
_attribute$stroke4 = attribute.stroke,
|
|
14910
14913
|
stroke = _attribute$stroke4 === void 0 ? textTheme.stroke : _attribute$stroke4,
|
|
14911
|
-
_attribute$lineHeight4 = attribute.lineHeight,
|
|
14912
|
-
lineHeight = _attribute$lineHeight4 === void 0 ? null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf : _attribute$lineHeight4,
|
|
14913
14914
|
_attribute$lineWidth4 = attribute.lineWidth,
|
|
14914
14915
|
lineWidth = _attribute$lineWidth4 === void 0 ? textTheme.lineWidth : _attribute$lineWidth4,
|
|
14915
14916
|
_attribute$verticalMo2 = attribute.verticalMode,
|
|
14916
|
-
verticalMode = _attribute$verticalMo2 === void 0 ? textTheme.verticalMode : _attribute$verticalMo2
|
|
14917
|
+
verticalMode = _attribute$verticalMo2 === void 0 ? textTheme.verticalMode : _attribute$verticalMo2,
|
|
14918
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
14917
14919
|
var _attribute$textAlign4 = attribute.textAlign,
|
|
14918
14920
|
textAlign = _attribute$textAlign4 === void 0 ? textTheme.textAlign : _attribute$textAlign4,
|
|
14919
14921
|
_attribute$textBaseli4 = attribute.textBaseline,
|
|
@@ -15046,7 +15048,7 @@
|
|
|
15046
15048
|
}, {
|
|
15047
15049
|
key: "updateMultilineAABBBounds",
|
|
15048
15050
|
value: function updateMultilineAABBBounds(text) {
|
|
15049
|
-
var _a, _b, _c;
|
|
15051
|
+
var _a, _b, _c, _d;
|
|
15050
15052
|
var textTheme = getTheme(this).text,
|
|
15051
15053
|
_this$attribute = this.attribute,
|
|
15052
15054
|
_this$attribute$fontF = _this$attribute.fontFamily,
|
|
@@ -15057,8 +15059,6 @@
|
|
|
15057
15059
|
textBaseline = _this$attribute$textB === void 0 ? textTheme.textBaseline : _this$attribute$textB,
|
|
15058
15060
|
_this$attribute$fontS = _this$attribute.fontSize,
|
|
15059
15061
|
fontSize = _this$attribute$fontS === void 0 ? textTheme.fontSize : _this$attribute$fontS,
|
|
15060
|
-
_this$attribute$lineH = _this$attribute.lineHeight,
|
|
15061
|
-
lineHeight = _this$attribute$lineH === void 0 ? this.attribute.lineHeight || this.attribute.fontSize || textTheme.fontSize : _this$attribute$lineH,
|
|
15062
15062
|
_this$attribute$ellip = _this$attribute.ellipsis,
|
|
15063
15063
|
ellipsis = _this$attribute$ellip === void 0 ? textTheme.ellipsis : _this$attribute$ellip,
|
|
15064
15064
|
maxLineWidth = _this$attribute.maxLineWidth,
|
|
@@ -15075,8 +15075,9 @@
|
|
|
15075
15075
|
_this$attribute$heigh = _this$attribute.heightLimit,
|
|
15076
15076
|
heightLimit = _this$attribute$heigh === void 0 ? 0 : _this$attribute$heigh,
|
|
15077
15077
|
lineClamp = _this$attribute.lineClamp,
|
|
15078
|
+
lineHeight = null !== (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize,
|
|
15078
15079
|
buf = ignoreBuf ? 0 : 2;
|
|
15079
|
-
if (!this.shouldUpdateShape() && (null === (
|
|
15080
|
+
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
15080
15081
|
var _bbox = this.cache.layoutData.bbox;
|
|
15081
15082
|
return this._AABBBounds.set(_bbox.xOffset, _bbox.yOffset, _bbox.xOffset + _bbox.width, _bbox.yOffset + _bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
15082
15083
|
}
|
|
@@ -15108,7 +15109,7 @@
|
|
|
15108
15109
|
if ("" !== str && "" === clip.str) {
|
|
15109
15110
|
if (ellipsis) {
|
|
15110
15111
|
var clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
15111
|
-
clip.str = null !== (
|
|
15112
|
+
clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
|
|
15112
15113
|
} else clip.str = "", clip.width = 0;
|
|
15113
15114
|
needCut = !1;
|
|
15114
15115
|
}
|
|
@@ -20350,7 +20351,7 @@
|
|
|
20350
20351
|
var t = textAlign;
|
|
20351
20352
|
textAlign = null !== (_a = text.getBaselineMapAlign()[textBaseline]) && void 0 !== _a ? _a : "left", textBaseline = null !== (_b = text.getAlignMapBaseline()[t]) && void 0 !== _b ? _b : "top";
|
|
20352
20353
|
}
|
|
20353
|
-
var lineHeight = null !== (_c = text.attribute.lineHeight) && void 0 !== _c ? _c : fontSize,
|
|
20354
|
+
var lineHeight = null !== (_c = calculateLineHeight(text.attribute.lineHeight, fontSize)) && void 0 !== _c ? _c : fontSize,
|
|
20354
20355
|
data = this.valid(text, textAttribute, fillCb, strokeCb);
|
|
20355
20356
|
if (!data) return;
|
|
20356
20357
|
var fVisible = data.fVisible,
|
|
@@ -34626,7 +34627,7 @@
|
|
|
34626
34627
|
|
|
34627
34628
|
var roughModule = _roughModule;
|
|
34628
34629
|
|
|
34629
|
-
const version = "0.16.14-alpha.
|
|
34630
|
+
const version = "0.16.14-alpha.3";
|
|
34630
34631
|
loadAllModule(container);
|
|
34631
34632
|
|
|
34632
34633
|
exports.ACustomAnimate = ACustomAnimate;
|
|
@@ -34859,6 +34860,7 @@
|
|
|
34859
34860
|
exports.builtinSymbols = builtinSymbols;
|
|
34860
34861
|
exports.builtinSymbolsMap = builtinSymbolsMap;
|
|
34861
34862
|
exports.calcLineCache = calcLineCache$1;
|
|
34863
|
+
exports.calculateLineHeight = calculateLineHeight;
|
|
34862
34864
|
exports.centroidOfSubpath = centroidOfSubpath;
|
|
34863
34865
|
exports.circleBounds = circleBounds;
|
|
34864
34866
|
exports.clock = clock;
|