@visactor/vrender-core 0.21.5-vstory.1 → 0.21.5-vstory.2
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/animate/custom-animate.js +14 -25
- package/cjs/animate/custom-animate.js.map +1 -1
- package/cjs/animate/easing.js +12 -0
- package/cjs/animate/easing.js.map +1 -1
- package/cjs/common/shape/rect.d.ts +1 -1
- package/cjs/common/shape/rect.js +28 -23
- package/cjs/common/shape/rect.js.map +1 -1
- package/cjs/graphic/config.js +8 -4
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/graphic.js +13 -0
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/interface/graphic/group.d.ts +1 -0
- package/cjs/interface/graphic/group.js.map +1 -1
- package/cjs/interface/graphic/image.d.ts +1 -0
- package/cjs/interface/graphic/image.js.map +1 -1
- package/cjs/interface/graphic/rect.d.ts +1 -0
- package/cjs/interface/graphic/rect.js.map +1 -1
- package/cjs/render/contributions/render/contributions/image-contribution-render.js +1 -1
- package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/rect-contribution-render.js +4 -4
- package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/text-contribution-render.js +1 -1
- package/cjs/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/group-render.js +2 -2
- package/cjs/render/contributions/render/group-render.js.map +1 -1
- package/cjs/render/contributions/render/image-render.js +3 -3
- package/cjs/render/contributions/render/image-render.js.map +1 -1
- package/cjs/render/contributions/render/rect-render.js +2 -2
- package/cjs/render/contributions/render/rect-render.js.map +1 -1
- package/cjs/render/contributions/render/richtext-render.js +1 -1
- package/cjs/render/contributions/render/richtext-render.js.map +1 -1
- package/dist/index.es.js +127 -76
- package/es/animate/custom-animate.js +14 -25
- package/es/animate/custom-animate.js.map +1 -1
- package/es/animate/easing.js +12 -0
- package/es/animate/easing.js.map +1 -1
- package/es/common/shape/rect.d.ts +1 -1
- package/es/common/shape/rect.js +28 -23
- package/es/common/shape/rect.js.map +1 -1
- package/es/graphic/config.js +8 -4
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/graphic.js +13 -0
- package/es/graphic/graphic.js.map +1 -1
- package/es/interface/graphic/group.d.ts +1 -0
- package/es/interface/graphic/group.js.map +1 -1
- package/es/interface/graphic/image.d.ts +1 -0
- package/es/interface/graphic/image.js.map +1 -1
- package/es/interface/graphic/rect.d.ts +1 -0
- package/es/interface/graphic/rect.js.map +1 -1
- package/es/render/contributions/render/contributions/image-contribution-render.js +1 -1
- package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/rect-contribution-render.js +4 -4
- package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/text-contribution-render.js +1 -1
- package/es/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
- package/es/render/contributions/render/group-render.js +2 -2
- package/es/render/contributions/render/group-render.js.map +1 -1
- package/es/render/contributions/render/image-render.js +3 -3
- package/es/render/contributions/render/image-render.js.map +1 -1
- package/es/render/contributions/render/rect-render.js +2 -2
- package/es/render/contributions/render/rect-render.js.map +1 -1
- package/es/render/contributions/render/richtext-render.js +1 -1
- package/es/render/contributions/render/richtext-render.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -3284,19 +3284,19 @@ function rewriteProto(obj, c) {
|
|
|
3284
3284
|
const DefaultArcAttribute = Object.assign(Object.assign({}, DefaultAttribute), { startAngle: 0, endAngle: pi2, innerRadius: 0, outerRadius: 1, innerPadding: 0, outerPadding: 0, cornerRadius: 0, padRadius: 0, padAngle: 0, cap: false, forceShowCap: false });
|
|
3285
3285
|
const DefaultAreaAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultConnectAttribute), { points: [], segments: [], curveType: 'linear', clipRange: 1, closePath: false, curveTension: 1 });
|
|
3286
3286
|
const DefaultCircleAttribute = Object.assign(Object.assign({}, DefaultAttribute), { radius: 1, startAngle: 0, endAngle: pi2 });
|
|
3287
|
-
const DefaultGroupAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, cornerRadius: 0, path: [], clip: false, visibleAll: true, display: 'relative', flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'flex-start', alignItems: 'flex-start', alignContent: 'flex-start', baseOpacity: 1 });
|
|
3287
|
+
const DefaultGroupAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, cornerRadius: 0, path: [], clip: false, visibleAll: true, display: 'relative', flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'flex-start', alignItems: 'flex-start', alignContent: 'flex-start', baseOpacity: 1, cornerType: 'round' });
|
|
3288
3288
|
const DefaultGlyphAttribute = Object.assign(Object.assign({}, DefaultAttribute), { path: '', width: 0, height: 0, cornerRadius: 0, clip: false });
|
|
3289
3289
|
const DefaultLineAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultConnectAttribute), { points: [], segments: [], curveType: 'linear', clipRange: 1, clipRangeByDimension: 'default', closePath: false, curveTension: 1 });
|
|
3290
3290
|
const DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), { path: new CustomPath2D(), fillStrokeOrder: 1, clipRange: 1, customPath: () => {
|
|
3291
3291
|
Logger.getInstance().warn('空函数');
|
|
3292
3292
|
} });
|
|
3293
3293
|
const DefaultPolygonAttribute = Object.assign(Object.assign({}, DefaultAttribute), { points: [], cornerRadius: 0, closePath: true });
|
|
3294
|
-
const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, x1: 0, y1: 0, strokeBoundsBuffer: 0, cornerRadius: 0 });
|
|
3295
|
-
const DefaultRect3dAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, x1: 0, y1: 0, cornerRadius: 0, length: 0 });
|
|
3294
|
+
const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, x1: 0, y1: 0, strokeBoundsBuffer: 0, cornerRadius: 0, cornerType: 'round' });
|
|
3295
|
+
const DefaultRect3dAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, x1: 0, y1: 0, cornerRadius: 0, length: 0, cornerType: 'round' });
|
|
3296
3296
|
const DefaultSymbolAttribute = Object.assign(Object.assign({}, DefaultAttribute), { symbolType: 'circle', size: 10, keepDirIn3d: true, clipRange: 1 });
|
|
3297
3297
|
const DefaultTextAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultTextStyle), { strokeBoundsBuffer: 0, keepDirIn3d: true });
|
|
3298
3298
|
const DefaultRichTextAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultTextStyle), { editable: false, width: 300, height: 300, ellipsis: true, wordBreak: 'break-word', verticalDirection: 'top', textAlign: 'left', textBaseline: 'top', layoutDirection: 'horizontal', textConfig: [], disableAutoWrapLine: false, maxHeight: undefined, maxWidth: undefined, singleLine: false });
|
|
3299
|
-
const DefaultImageAttribute = Object.assign(Object.assign({ repeatX: 'no-repeat', repeatY: 'no-repeat', image: '', width: 0, height: 0 }, DefaultAttribute), { fill: true, cornerRadius: 0 });
|
|
3299
|
+
const DefaultImageAttribute = Object.assign(Object.assign({ repeatX: 'no-repeat', repeatY: 'no-repeat', image: '', width: 0, height: 0 }, DefaultAttribute), { fill: true, cornerRadius: 0, cornerType: 'round' });
|
|
3300
3300
|
const DefaultRichTextIconAttribute = Object.assign(Object.assign({}, DefaultImageAttribute), { backgroundShowMode: 'never', backgroundWidth: 0, backgroundHeight: 0, textAlign: 'left', textBaseline: 'middle', direction: 'horizontal', margin: 0, id: '', width: 20, height: 20, backgroundFill: 'rgba(101, 117, 168, 0.1)', backgroundFillOpacity: 1, backgroundStroke: false, backgroundStrokeOpacity: 1, backgroundRadius: 4, opacity: 1 });
|
|
3301
3301
|
|
|
3302
3302
|
class Application {
|
|
@@ -8077,6 +8077,22 @@ Easing.easeInOutElastic = (x) => {
|
|
|
8077
8077
|
? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2
|
|
8078
8078
|
: (Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5)) / 2 + 1;
|
|
8079
8079
|
};
|
|
8080
|
+
function flicker(t, n) {
|
|
8081
|
+
const step = 1 / n;
|
|
8082
|
+
let flag = 1;
|
|
8083
|
+
while (t > step) {
|
|
8084
|
+
t -= step;
|
|
8085
|
+
flag *= -1;
|
|
8086
|
+
}
|
|
8087
|
+
const v = (flag * t) / step;
|
|
8088
|
+
return v > 0 ? v : 1 + v;
|
|
8089
|
+
}
|
|
8090
|
+
for (let i = 0; i < 10; i++) {
|
|
8091
|
+
Easing[`flicker${i}`] = (t) => flicker(t, i);
|
|
8092
|
+
}
|
|
8093
|
+
for (let i = 2; i < 10; i++) {
|
|
8094
|
+
Easing[`aIn${i}`] = (t) => i * t * t + (1 - i) * t;
|
|
8095
|
+
}
|
|
8080
8096
|
|
|
8081
8097
|
class DefaultTimeline {
|
|
8082
8098
|
constructor() {
|
|
@@ -9271,26 +9287,14 @@ class InputText extends ACustomAnimate {
|
|
|
9271
9287
|
};
|
|
9272
9288
|
}
|
|
9273
9289
|
onBind() {
|
|
9274
|
-
var _a, _b, _c
|
|
9290
|
+
var _a, _b, _c;
|
|
9275
9291
|
this.fromText = (_b = (_a = this.from) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : '';
|
|
9276
|
-
this.toText = (
|
|
9277
|
-
if (!this.toText || isArray(this.toText)) {
|
|
9292
|
+
this.toText = ((_c = this.to) === null || _c === void 0 ? void 0 : _c.text) || '';
|
|
9293
|
+
if (!this.toText || (isArray(this.toText) && this.toText.length === 0)) {
|
|
9278
9294
|
this.valid = false;
|
|
9279
9295
|
}
|
|
9280
|
-
|
|
9281
|
-
this.toText = this.toText.toString();
|
|
9282
|
-
const root = this.target.attachShadow();
|
|
9283
|
-
const line = application.graphicService.creator.line({
|
|
9284
|
-
x: 0,
|
|
9285
|
-
y: 0,
|
|
9286
|
-
points: [
|
|
9287
|
-
{ x: 0, y: 0 },
|
|
9288
|
-
{ x: 0, y: this.target.getComputedAttribute('fontSize') }
|
|
9289
|
-
],
|
|
9290
|
-
stroke: 'black',
|
|
9291
|
-
lineWidth: 1
|
|
9292
|
-
});
|
|
9293
|
-
root.add(line);
|
|
9296
|
+
if (isArray(this.toText)) {
|
|
9297
|
+
this.toText = this.toText.map(item => (item || '').toString());
|
|
9294
9298
|
}
|
|
9295
9299
|
}
|
|
9296
9300
|
onEnd() {
|
|
@@ -9298,17 +9302,32 @@ class InputText extends ACustomAnimate {
|
|
|
9298
9302
|
return;
|
|
9299
9303
|
}
|
|
9300
9304
|
onUpdate(end, ratio, out) {
|
|
9301
|
-
var _a;
|
|
9302
9305
|
if (this.valid === false) {
|
|
9303
9306
|
return;
|
|
9304
9307
|
}
|
|
9305
9308
|
const fromCount = this.fromText.length;
|
|
9306
|
-
const
|
|
9309
|
+
const toTextIsArray = isArray(this.toText);
|
|
9310
|
+
const toCount = toTextIsArray
|
|
9311
|
+
? this.toText.reduce((c, t) => c + (t || '').length, 0)
|
|
9312
|
+
: this.toText.length;
|
|
9307
9313
|
const count = Math.ceil(fromCount + (toCount - fromCount) * ratio);
|
|
9308
|
-
|
|
9309
|
-
|
|
9310
|
-
|
|
9311
|
-
|
|
9314
|
+
if (toTextIsArray) {
|
|
9315
|
+
out.text = [];
|
|
9316
|
+
let len = 0;
|
|
9317
|
+
this.toText.forEach(t => {
|
|
9318
|
+
if (len + t.length > count) {
|
|
9319
|
+
out.text.push(t.substr(0, count - len));
|
|
9320
|
+
len = count;
|
|
9321
|
+
}
|
|
9322
|
+
else {
|
|
9323
|
+
out.text.push(t);
|
|
9324
|
+
len += t.length;
|
|
9325
|
+
}
|
|
9326
|
+
});
|
|
9327
|
+
}
|
|
9328
|
+
else {
|
|
9329
|
+
out.text = this.toText.substr(0, count);
|
|
9330
|
+
}
|
|
9312
9331
|
}
|
|
9313
9332
|
}
|
|
9314
9333
|
class StreamLight extends ACustomAnimate {
|
|
@@ -12756,6 +12775,22 @@ class Graphic extends Node {
|
|
|
12756
12775
|
}
|
|
12757
12776
|
return true;
|
|
12758
12777
|
}
|
|
12778
|
+
else if (Array.isArray(nextStepVal) && nextStepVal.length === lastStepVal.length) {
|
|
12779
|
+
const nextList = [];
|
|
12780
|
+
let valid = true;
|
|
12781
|
+
for (let i = 0; i < nextStepVal.length; i++) {
|
|
12782
|
+
const v = lastStepVal[i];
|
|
12783
|
+
const val = v + (nextStepVal[i] - v) * ratio;
|
|
12784
|
+
if (!Number.isFinite(val)) {
|
|
12785
|
+
valid = false;
|
|
12786
|
+
break;
|
|
12787
|
+
}
|
|
12788
|
+
nextList.push(val);
|
|
12789
|
+
}
|
|
12790
|
+
if (valid) {
|
|
12791
|
+
nextAttributes[key] = nextList;
|
|
12792
|
+
}
|
|
12793
|
+
}
|
|
12759
12794
|
return false;
|
|
12760
12795
|
}
|
|
12761
12796
|
_interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {
|
|
@@ -20296,7 +20331,7 @@ class DefaultGroupBackgroundRenderContribution extends DefaultBaseBackgroundRend
|
|
|
20296
20331
|
const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
|
|
20297
20332
|
|
|
20298
20333
|
const halfPi = pi / 2;
|
|
20299
|
-
function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
|
|
20334
|
+
function createRectPath(path, x, y, width, height, rectCornerRadius, roundCorner, edgeCb) {
|
|
20300
20335
|
if (width < 0) {
|
|
20301
20336
|
x += width;
|
|
20302
20337
|
width = -width;
|
|
@@ -20370,41 +20405,57 @@ function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
|
|
|
20370
20405
|
const leftBottomPoint1 = [leftBottom[0] + _cornerRadius[3], leftBottom[1]];
|
|
20371
20406
|
const leftBottomPoint2 = [leftBottom[0], leftBottom[1] - _cornerRadius[3]];
|
|
20372
20407
|
path.moveTo(leftTopPoint1[0], leftTopPoint1[1]);
|
|
20373
|
-
|
|
20374
|
-
|
|
20375
|
-
|
|
20376
|
-
|
|
20377
|
-
edgeCb && edgeCb[
|
|
20378
|
-
|
|
20379
|
-
|
|
20380
|
-
|
|
20381
|
-
|
|
20382
|
-
|
|
20383
|
-
|
|
20384
|
-
|
|
20385
|
-
|
|
20386
|
-
|
|
20387
|
-
|
|
20388
|
-
edgeCb && edgeCb[
|
|
20389
|
-
|
|
20390
|
-
|
|
20391
|
-
|
|
20392
|
-
|
|
20393
|
-
|
|
20394
|
-
|
|
20395
|
-
|
|
20396
|
-
|
|
20397
|
-
edgeCb && edgeCb[
|
|
20398
|
-
|
|
20399
|
-
|
|
20400
|
-
|
|
20401
|
-
|
|
20402
|
-
|
|
20403
|
-
|
|
20404
|
-
|
|
20405
|
-
|
|
20406
|
-
edgeCb && edgeCb[
|
|
20407
|
-
|
|
20408
|
+
if (!roundCorner) {
|
|
20409
|
+
edgeCb && edgeCb[0]
|
|
20410
|
+
? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1])
|
|
20411
|
+
: path.lineTo(rightTopPoint1[0], rightTopPoint1[1]);
|
|
20412
|
+
edgeCb && edgeCb[1]
|
|
20413
|
+
? edgeCb[1](rightTopPoint1[0], rightTopPoint1[1], rightBottomPoint1[0], rightBottomPoint1[1])
|
|
20414
|
+
: path.lineTo(rightBottomPoint1[0], rightBottomPoint1[1]);
|
|
20415
|
+
edgeCb && edgeCb[2]
|
|
20416
|
+
? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1])
|
|
20417
|
+
: path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]);
|
|
20418
|
+
edgeCb && edgeCb[2]
|
|
20419
|
+
? edgeCb[2](leftBottomPoint1[0], leftBottomPoint1[1], leftTopPoint1[0], leftTopPoint1[1])
|
|
20420
|
+
: path.lineTo(leftTopPoint1[0], leftTopPoint1[1]);
|
|
20421
|
+
}
|
|
20422
|
+
else {
|
|
20423
|
+
edgeCb && edgeCb[0]
|
|
20424
|
+
? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1])
|
|
20425
|
+
: path.lineTo(rightTopPoint1[0], rightTopPoint1[1]);
|
|
20426
|
+
if (!arrayEqual(rightTopPoint1, rightTopPoint2)) {
|
|
20427
|
+
edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
|
|
20428
|
+
const centerX = rightTopPoint1[0];
|
|
20429
|
+
const centerY = rightTopPoint1[1] + _cornerRadius[1];
|
|
20430
|
+
path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, false);
|
|
20431
|
+
}
|
|
20432
|
+
edgeCb && edgeCb[1]
|
|
20433
|
+
? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1])
|
|
20434
|
+
: path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]);
|
|
20435
|
+
if (!arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
|
|
20436
|
+
const centerX = rightBottomPoint2[0] - _cornerRadius[2];
|
|
20437
|
+
const centerY = rightBottomPoint2[1];
|
|
20438
|
+
edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]);
|
|
20439
|
+
path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, false);
|
|
20440
|
+
}
|
|
20441
|
+
edgeCb && edgeCb[2]
|
|
20442
|
+
? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1])
|
|
20443
|
+
: path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]);
|
|
20444
|
+
if (!arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
|
|
20445
|
+
const centerX = leftBottomPoint1[0];
|
|
20446
|
+
const centerY = leftBottomPoint1[1] - _cornerRadius[3];
|
|
20447
|
+
edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]);
|
|
20448
|
+
path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, false);
|
|
20449
|
+
}
|
|
20450
|
+
edgeCb && edgeCb[3]
|
|
20451
|
+
? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1])
|
|
20452
|
+
: path.lineTo(leftTopPoint2[0], leftTopPoint2[1]);
|
|
20453
|
+
if (!arrayEqual(leftTopPoint1, leftTopPoint2)) {
|
|
20454
|
+
const centerX = leftTopPoint1[0];
|
|
20455
|
+
const centerY = leftTopPoint1[1] + _cornerRadius[0];
|
|
20456
|
+
edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]);
|
|
20457
|
+
path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, false);
|
|
20458
|
+
}
|
|
20408
20459
|
}
|
|
20409
20460
|
!edgeCb && path.closePath();
|
|
20410
20461
|
return path;
|
|
@@ -20423,7 +20474,7 @@ class DefaultRectRenderContribution {
|
|
|
20423
20474
|
if (!(doOuterBorder || doInnerBorder)) {
|
|
20424
20475
|
return;
|
|
20425
20476
|
}
|
|
20426
|
-
const { cornerRadius = rectAttribute.cornerRadius, opacity = rectAttribute.opacity, x: originX = rectAttribute.x, y: originY = rectAttribute.y, scaleX = rectAttribute.scaleX, scaleY = rectAttribute.scaleY, x1, y1, keepStrokeScale = rectAttribute.keepStrokeScale } = rect.attribute;
|
|
20477
|
+
const { cornerRadius = rectAttribute.cornerRadius, cornerType = rectAttribute.cornerType, opacity = rectAttribute.opacity, x: originX = rectAttribute.x, y: originY = rectAttribute.y, scaleX = rectAttribute.scaleX, scaleY = rectAttribute.scaleY, x1, y1, keepStrokeScale = rectAttribute.keepStrokeScale } = rect.attribute;
|
|
20427
20478
|
let { width, height } = rect.attribute;
|
|
20428
20479
|
width = (width !== null && width !== void 0 ? width : x1 - x) || 0;
|
|
20429
20480
|
height = (height !== null && height !== void 0 ? height : y1 - y) || 0;
|
|
@@ -20441,7 +20492,7 @@ class DefaultRectRenderContribution {
|
|
|
20441
20492
|
}
|
|
20442
20493
|
else {
|
|
20443
20494
|
context.beginPath();
|
|
20444
|
-
createRectPath(context, nextX, nextY, width - sign * dw, height - sign * dw, cornerRadius);
|
|
20495
|
+
createRectPath(context, nextX, nextY, width - sign * dw, height - sign * dw, cornerRadius, cornerType === 'round');
|
|
20445
20496
|
}
|
|
20446
20497
|
context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute);
|
|
20447
20498
|
if (strokeCb) {
|
|
@@ -20482,7 +20533,7 @@ let SplitRectAfterRenderContribution = class SplitRectAfterRenderContribution {
|
|
|
20482
20533
|
this.order = 0;
|
|
20483
20534
|
}
|
|
20484
20535
|
drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb) {
|
|
20485
|
-
const { x1, y1, x: originX = groupAttribute.x, y: originY = groupAttribute.y, stroke = groupAttribute.stroke, cornerRadius = groupAttribute.cornerRadius } = rect.attribute;
|
|
20536
|
+
const { x1, y1, x: originX = groupAttribute.x, y: originY = groupAttribute.y, stroke = groupAttribute.stroke, cornerRadius = groupAttribute.cornerRadius, cornerType = groupAttribute.cornerType } = rect.attribute;
|
|
20486
20537
|
let { width, height } = rect.attribute;
|
|
20487
20538
|
width = (width !== null && width !== void 0 ? width : x1 - originX) || 0;
|
|
20488
20539
|
height = (height !== null && height !== void 0 ? height : y1 - originY) || 0;
|
|
@@ -20493,7 +20544,7 @@ let SplitRectAfterRenderContribution = class SplitRectAfterRenderContribution {
|
|
|
20493
20544
|
if (!(cornerRadius === 0 || (isArray(cornerRadius) && cornerRadius.every(num => num === 0)))) {
|
|
20494
20545
|
let lastStrokeI = 0;
|
|
20495
20546
|
let lastStroke;
|
|
20496
|
-
createRectPath(context, x, y, width, height, cornerRadius, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
|
|
20547
|
+
createRectPath(context, x, y, width, height, cornerRadius, cornerType === 'round', new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
|
|
20497
20548
|
if (stroke[i]) {
|
|
20498
20549
|
if (!(lastStrokeI === i - 1 && stroke[i] === lastStroke)) {
|
|
20499
20550
|
context.setStrokeStyle(rect, Object.assign(Object.assign({}, rect.attribute), { stroke: stroke[i] }), x, y, groupAttribute);
|
|
@@ -20568,7 +20619,7 @@ class DefaultImageBackgroundRenderContribution extends DefaultBaseBackgroundRend
|
|
|
20568
20619
|
context.beginPath();
|
|
20569
20620
|
const { x, y, width, height } = getActualPosition(graphic);
|
|
20570
20621
|
if (cornerRadius) {
|
|
20571
|
-
createRectPath(context, x - expandX, y - expandY, width + expandX * 2, height + expandY * 2, cornerRadius);
|
|
20622
|
+
createRectPath(context, x - expandX, y - expandY, width + expandX * 2, height + expandY * 2, cornerRadius, true);
|
|
20572
20623
|
}
|
|
20573
20624
|
else {
|
|
20574
20625
|
context.rect(x - expandX, y - expandY, width + expandX * 2, height + expandY * 2);
|
|
@@ -22226,7 +22277,7 @@ let DefaultCanvasRectRender = class DefaultCanvasRectRender extends BaseRender {
|
|
|
22226
22277
|
drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
22227
22278
|
var _a;
|
|
22228
22279
|
const rectAttribute = (_a = this.tempTheme) !== null && _a !== void 0 ? _a : getTheme(rect, params === null || params === void 0 ? void 0 : params.theme).rect;
|
|
22229
|
-
const { fill = rectAttribute.fill, background, stroke = rectAttribute.stroke, cornerRadius = rectAttribute.cornerRadius, opacity = rectAttribute.opacity, fillOpacity = rectAttribute.fillOpacity, lineWidth = rectAttribute.lineWidth, strokeOpacity = rectAttribute.strokeOpacity, visible = rectAttribute.visible, x1, y1, x: originX = rectAttribute.x, y: originY = rectAttribute.y, fillStrokeOrder = rectAttribute.fillStrokeOrder } = rect.attribute;
|
|
22280
|
+
const { fill = rectAttribute.fill, background, stroke = rectAttribute.stroke, cornerRadius = rectAttribute.cornerRadius, cornerType = rectAttribute.cornerType, opacity = rectAttribute.opacity, fillOpacity = rectAttribute.fillOpacity, lineWidth = rectAttribute.lineWidth, strokeOpacity = rectAttribute.strokeOpacity, visible = rectAttribute.visible, x1, y1, x: originX = rectAttribute.x, y: originY = rectAttribute.y, fillStrokeOrder = rectAttribute.fillStrokeOrder } = rect.attribute;
|
|
22230
22281
|
let { width, height } = rect.attribute;
|
|
22231
22282
|
width = (width !== null && width !== void 0 ? width : x1 - originX) || 0;
|
|
22232
22283
|
height = (height !== null && height !== void 0 ? height : y1 - originY) || 0;
|
|
@@ -22249,7 +22300,7 @@ let DefaultCanvasRectRender = class DefaultCanvasRectRender extends BaseRender {
|
|
|
22249
22300
|
}
|
|
22250
22301
|
else {
|
|
22251
22302
|
context.beginPath();
|
|
22252
|
-
createRectPath(context, x, y, width, height, cornerRadius);
|
|
22303
|
+
createRectPath(context, x, y, width, height, cornerRadius, cornerType === 'round');
|
|
22253
22304
|
}
|
|
22254
22305
|
const doFillOrStroke = {
|
|
22255
22306
|
doFill,
|
|
@@ -22549,7 +22600,7 @@ class DefaultTextBackgroundRenderContribution extends DefaultBaseBackgroundRende
|
|
|
22549
22600
|
context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute);
|
|
22550
22601
|
context.fillStyle = background;
|
|
22551
22602
|
if (backgroundCornerRadius) {
|
|
22552
|
-
createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius);
|
|
22603
|
+
createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, true);
|
|
22553
22604
|
context.fill();
|
|
22554
22605
|
}
|
|
22555
22606
|
else {
|
|
@@ -22919,7 +22970,7 @@ let DefaultCanvasGroupRender = class DefaultCanvasGroupRender {
|
|
|
22919
22970
|
}
|
|
22920
22971
|
drawShape(group, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
22921
22972
|
const groupAttribute = getTheme(group, params === null || params === void 0 ? void 0 : params.theme).group;
|
|
22922
|
-
const { fill = groupAttribute.fill, background, stroke = groupAttribute.stroke, opacity = groupAttribute.opacity, width = groupAttribute.width, height = groupAttribute.height, clip = groupAttribute.clip, fillOpacity = groupAttribute.fillOpacity, strokeOpacity = groupAttribute.strokeOpacity, cornerRadius = groupAttribute.cornerRadius, path = groupAttribute.path, lineWidth = groupAttribute.lineWidth, visible = groupAttribute.visible, fillStrokeOrder = groupAttribute.fillStrokeOrder, x: originX = groupAttribute.x, y: originY = groupAttribute.y } = group.attribute;
|
|
22973
|
+
const { fill = groupAttribute.fill, background, stroke = groupAttribute.stroke, opacity = groupAttribute.opacity, width = groupAttribute.width, height = groupAttribute.height, clip = groupAttribute.clip, fillOpacity = groupAttribute.fillOpacity, strokeOpacity = groupAttribute.strokeOpacity, cornerRadius = groupAttribute.cornerRadius, path = groupAttribute.path, lineWidth = groupAttribute.lineWidth, visible = groupAttribute.visible, fillStrokeOrder = groupAttribute.fillStrokeOrder, cornerType = groupAttribute.cornerType, x: originX = groupAttribute.x, y: originY = groupAttribute.y } = group.attribute;
|
|
22923
22974
|
const fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill);
|
|
22924
22975
|
const sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height);
|
|
22925
22976
|
const doFill = runFill(fill, background);
|
|
@@ -22956,7 +23007,7 @@ let DefaultCanvasGroupRender = class DefaultCanvasGroupRender {
|
|
|
22956
23007
|
}
|
|
22957
23008
|
else {
|
|
22958
23009
|
context.beginPath();
|
|
22959
|
-
createRectPath(context, x, y, width, height, cornerRadius);
|
|
23010
|
+
createRectPath(context, x, y, width, height, cornerRadius, cornerType === 'round');
|
|
22960
23011
|
}
|
|
22961
23012
|
if (!this._groupRenderContribitions) {
|
|
22962
23013
|
this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [];
|
|
@@ -23103,7 +23154,7 @@ let DefaultCanvasImageRender = class DefaultCanvasImageRender extends BaseRender
|
|
|
23103
23154
|
}
|
|
23104
23155
|
drawShape(image, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
23105
23156
|
const imageAttribute = getTheme(image).image;
|
|
23106
|
-
const { width = imageAttribute.width, height = imageAttribute.height, repeatX = imageAttribute.repeatX, repeatY = imageAttribute.repeatY, x: originX = imageAttribute.x, y: originY = imageAttribute.y, cornerRadius = imageAttribute.cornerRadius, fillStrokeOrder = imageAttribute.fillStrokeOrder, image: url } = image.attribute;
|
|
23157
|
+
const { width = imageAttribute.width, height = imageAttribute.height, repeatX = imageAttribute.repeatX, repeatY = imageAttribute.repeatY, x: originX = imageAttribute.x, y: originY = imageAttribute.y, cornerRadius = imageAttribute.cornerRadius, fillStrokeOrder = imageAttribute.fillStrokeOrder, cornerType = imageAttribute.cornerType, image: url } = image.attribute;
|
|
23107
23158
|
const data = this.valid(image, imageAttribute, fillCb);
|
|
23108
23159
|
if (!data) {
|
|
23109
23160
|
return;
|
|
@@ -23128,7 +23179,7 @@ let DefaultCanvasImageRender = class DefaultCanvasImageRender extends BaseRender
|
|
|
23128
23179
|
if (cornerRadius === 0 || (isArray(cornerRadius) && cornerRadius.every(num => num === 0))) ;
|
|
23129
23180
|
else {
|
|
23130
23181
|
context.beginPath();
|
|
23131
|
-
createRectPath(context, x, y, width, height, cornerRadius);
|
|
23182
|
+
createRectPath(context, x, y, width, height, cornerRadius, cornerType === 'round');
|
|
23132
23183
|
context.save();
|
|
23133
23184
|
context.clip();
|
|
23134
23185
|
needRestore = true;
|
|
@@ -28035,7 +28086,7 @@ let DefaultCanvasRichTextRender = class DefaultCanvasRichTextRender extends Base
|
|
|
28035
28086
|
}
|
|
28036
28087
|
else {
|
|
28037
28088
|
context.beginPath();
|
|
28038
|
-
createRectPath(context, x - expandX, y - expandY, backgroundWidth, backgroundHeight, backgroundRadius);
|
|
28089
|
+
createRectPath(context, x - expandX, y - expandY, backgroundWidth, backgroundHeight, backgroundRadius, true);
|
|
28039
28090
|
}
|
|
28040
28091
|
if (backgroundFill) {
|
|
28041
28092
|
context.globalAlpha = backgroundFillOpacity;
|
|
@@ -153,37 +153,26 @@ export class InputText extends ACustomAnimate {
|
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
onBind() {
|
|
156
|
-
var _a, _b, _c
|
|
157
|
-
|
|
158
|
-
this.toText =
|
|
159
|
-
!this.toText || isArray(this.toText)) this.valid = !1
|
|
160
|
-
|
|
161
|
-
const root = this.target.attachShadow(), line = application.graphicService.creator.line({
|
|
162
|
-
x: 0,
|
|
163
|
-
y: 0,
|
|
164
|
-
points: [ {
|
|
165
|
-
x: 0,
|
|
166
|
-
y: 0
|
|
167
|
-
}, {
|
|
168
|
-
x: 0,
|
|
169
|
-
y: this.target.getComputedAttribute("fontSize")
|
|
170
|
-
} ],
|
|
171
|
-
stroke: "black",
|
|
172
|
-
lineWidth: 1
|
|
173
|
-
});
|
|
174
|
-
root.add(line);
|
|
175
|
-
}
|
|
156
|
+
var _a, _b, _c;
|
|
157
|
+
this.fromText = null !== (_b = null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) && void 0 !== _b ? _b : "",
|
|
158
|
+
this.toText = (null === (_c = this.to) || void 0 === _c ? void 0 : _c.text) || "",
|
|
159
|
+
(!this.toText || isArray(this.toText) && 0 === this.toText.length) && (this.valid = !1),
|
|
160
|
+
isArray(this.toText) && (this.toText = this.toText.map((item => (item || "").toString())));
|
|
176
161
|
}
|
|
177
162
|
onEnd() {
|
|
178
163
|
this.target.detachShadow();
|
|
179
164
|
}
|
|
180
165
|
onUpdate(end, ratio, out) {
|
|
181
|
-
var _a;
|
|
182
166
|
if (!1 === this.valid) return;
|
|
183
|
-
const fromCount = this.fromText.length, toCount = this.toText.length, count = Math.ceil(fromCount + (toCount - fromCount) * ratio);
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
167
|
+
const fromCount = this.fromText.length, toTextIsArray = isArray(this.toText), toCount = toTextIsArray ? this.toText.reduce(((c, t) => c + (t || "").length), 0) : this.toText.length, count = Math.ceil(fromCount + (toCount - fromCount) * ratio);
|
|
168
|
+
if (toTextIsArray) {
|
|
169
|
+
out.text = [];
|
|
170
|
+
let len = 0;
|
|
171
|
+
this.toText.forEach((t => {
|
|
172
|
+
len + t.length > count ? (out.text.push(t.substr(0, count - len)), len = count) : (out.text.push(t),
|
|
173
|
+
len += t.length);
|
|
174
|
+
}));
|
|
175
|
+
} else out.text = this.toText.substr(0, count);
|
|
187
176
|
}
|
|
188
177
|
}
|
|
189
178
|
|