@visactor/vrender-core 0.21.2-vstory.1 → 0.21.2-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
|
@@ -3276,19 +3276,19 @@ function rewriteProto(obj, c) {
|
|
|
3276
3276
|
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 });
|
|
3277
3277
|
const DefaultAreaAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultConnectAttribute), { points: [], segments: [], curveType: 'linear', clipRange: 1, closePath: false, curveTension: 1 });
|
|
3278
3278
|
const DefaultCircleAttribute = Object.assign(Object.assign({}, DefaultAttribute), { radius: 1, startAngle: 0, endAngle: pi2 });
|
|
3279
|
-
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 });
|
|
3279
|
+
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' });
|
|
3280
3280
|
const DefaultGlyphAttribute = Object.assign(Object.assign({}, DefaultAttribute), { path: '', width: 0, height: 0, cornerRadius: 0, clip: false });
|
|
3281
3281
|
const DefaultLineAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultConnectAttribute), { points: [], segments: [], curveType: 'linear', clipRange: 1, clipRangeByDimension: 'default', closePath: false, curveTension: 1 });
|
|
3282
3282
|
const DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), { path: new CustomPath2D(), fillStrokeOrder: 1, clipRange: 1, customPath: () => {
|
|
3283
3283
|
Logger.getInstance().warn('空函数');
|
|
3284
3284
|
} });
|
|
3285
3285
|
const DefaultPolygonAttribute = Object.assign(Object.assign({}, DefaultAttribute), { points: [], cornerRadius: 0, closePath: true });
|
|
3286
|
-
const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, x1: 0, y1: 0, strokeBoundsBuffer: 0, cornerRadius: 0 });
|
|
3287
|
-
const DefaultRect3dAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, x1: 0, y1: 0, cornerRadius: 0, length: 0 });
|
|
3286
|
+
const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, x1: 0, y1: 0, strokeBoundsBuffer: 0, cornerRadius: 0, cornerType: 'round' });
|
|
3287
|
+
const DefaultRect3dAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, x1: 0, y1: 0, cornerRadius: 0, length: 0, cornerType: 'round' });
|
|
3288
3288
|
const DefaultSymbolAttribute = Object.assign(Object.assign({}, DefaultAttribute), { symbolType: 'circle', size: 10, keepDirIn3d: true, clipRange: 1 });
|
|
3289
3289
|
const DefaultTextAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultTextStyle), { strokeBoundsBuffer: 0, keepDirIn3d: true });
|
|
3290
3290
|
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 });
|
|
3291
|
-
const DefaultImageAttribute = Object.assign(Object.assign({ repeatX: 'no-repeat', repeatY: 'no-repeat', image: '', width: 0, height: 0 }, DefaultAttribute), { fill: true, cornerRadius: 0 });
|
|
3291
|
+
const DefaultImageAttribute = Object.assign(Object.assign({ repeatX: 'no-repeat', repeatY: 'no-repeat', image: '', width: 0, height: 0 }, DefaultAttribute), { fill: true, cornerRadius: 0, cornerType: 'round' });
|
|
3292
3292
|
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 });
|
|
3293
3293
|
|
|
3294
3294
|
class Application {
|
|
@@ -8069,6 +8069,22 @@ Easing.easeInOutElastic = (x) => {
|
|
|
8069
8069
|
? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2
|
|
8070
8070
|
: (Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5)) / 2 + 1;
|
|
8071
8071
|
};
|
|
8072
|
+
function flicker(t, n) {
|
|
8073
|
+
const step = 1 / n;
|
|
8074
|
+
let flag = 1;
|
|
8075
|
+
while (t > step) {
|
|
8076
|
+
t -= step;
|
|
8077
|
+
flag *= -1;
|
|
8078
|
+
}
|
|
8079
|
+
const v = (flag * t) / step;
|
|
8080
|
+
return v > 0 ? v : 1 + v;
|
|
8081
|
+
}
|
|
8082
|
+
for (let i = 0; i < 10; i++) {
|
|
8083
|
+
Easing[`flicker${i}`] = (t) => flicker(t, i);
|
|
8084
|
+
}
|
|
8085
|
+
for (let i = 2; i < 10; i++) {
|
|
8086
|
+
Easing[`aIn${i}`] = (t) => i * t * t + (1 - i) * t;
|
|
8087
|
+
}
|
|
8072
8088
|
|
|
8073
8089
|
class DefaultTimeline {
|
|
8074
8090
|
constructor() {
|
|
@@ -9263,26 +9279,14 @@ class InputText extends ACustomAnimate {
|
|
|
9263
9279
|
};
|
|
9264
9280
|
}
|
|
9265
9281
|
onBind() {
|
|
9266
|
-
var _a, _b, _c
|
|
9282
|
+
var _a, _b, _c;
|
|
9267
9283
|
this.fromText = (_b = (_a = this.from) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : '';
|
|
9268
|
-
this.toText = (
|
|
9269
|
-
if (!this.toText || isArray(this.toText)) {
|
|
9284
|
+
this.toText = ((_c = this.to) === null || _c === void 0 ? void 0 : _c.text) || '';
|
|
9285
|
+
if (!this.toText || (isArray(this.toText) && this.toText.length === 0)) {
|
|
9270
9286
|
this.valid = false;
|
|
9271
9287
|
}
|
|
9272
|
-
|
|
9273
|
-
this.toText = this.toText.toString();
|
|
9274
|
-
const root = this.target.attachShadow();
|
|
9275
|
-
const line = application.graphicService.creator.line({
|
|
9276
|
-
x: 0,
|
|
9277
|
-
y: 0,
|
|
9278
|
-
points: [
|
|
9279
|
-
{ x: 0, y: 0 },
|
|
9280
|
-
{ x: 0, y: this.target.getComputedAttribute('fontSize') }
|
|
9281
|
-
],
|
|
9282
|
-
stroke: 'black',
|
|
9283
|
-
lineWidth: 1
|
|
9284
|
-
});
|
|
9285
|
-
root.add(line);
|
|
9288
|
+
if (isArray(this.toText)) {
|
|
9289
|
+
this.toText = this.toText.map(item => (item || '').toString());
|
|
9286
9290
|
}
|
|
9287
9291
|
}
|
|
9288
9292
|
onEnd() {
|
|
@@ -9290,17 +9294,32 @@ class InputText extends ACustomAnimate {
|
|
|
9290
9294
|
return;
|
|
9291
9295
|
}
|
|
9292
9296
|
onUpdate(end, ratio, out) {
|
|
9293
|
-
var _a;
|
|
9294
9297
|
if (this.valid === false) {
|
|
9295
9298
|
return;
|
|
9296
9299
|
}
|
|
9297
9300
|
const fromCount = this.fromText.length;
|
|
9298
|
-
const
|
|
9301
|
+
const toTextIsArray = isArray(this.toText);
|
|
9302
|
+
const toCount = toTextIsArray
|
|
9303
|
+
? this.toText.reduce((c, t) => c + (t || '').length, 0)
|
|
9304
|
+
: this.toText.length;
|
|
9299
9305
|
const count = Math.ceil(fromCount + (toCount - fromCount) * ratio);
|
|
9300
|
-
|
|
9301
|
-
|
|
9302
|
-
|
|
9303
|
-
|
|
9306
|
+
if (toTextIsArray) {
|
|
9307
|
+
out.text = [];
|
|
9308
|
+
let len = 0;
|
|
9309
|
+
this.toText.forEach(t => {
|
|
9310
|
+
if (len + t.length > count) {
|
|
9311
|
+
out.text.push(t.substr(0, count - len));
|
|
9312
|
+
len = count;
|
|
9313
|
+
}
|
|
9314
|
+
else {
|
|
9315
|
+
out.text.push(t);
|
|
9316
|
+
len += t.length;
|
|
9317
|
+
}
|
|
9318
|
+
});
|
|
9319
|
+
}
|
|
9320
|
+
else {
|
|
9321
|
+
out.text = this.toText.substr(0, count);
|
|
9322
|
+
}
|
|
9304
9323
|
}
|
|
9305
9324
|
}
|
|
9306
9325
|
class StreamLight extends ACustomAnimate {
|
|
@@ -12748,6 +12767,22 @@ class Graphic extends Node {
|
|
|
12748
12767
|
}
|
|
12749
12768
|
return true;
|
|
12750
12769
|
}
|
|
12770
|
+
else if (Array.isArray(nextStepVal) && nextStepVal.length === lastStepVal.length) {
|
|
12771
|
+
const nextList = [];
|
|
12772
|
+
let valid = true;
|
|
12773
|
+
for (let i = 0; i < nextStepVal.length; i++) {
|
|
12774
|
+
const v = lastStepVal[i];
|
|
12775
|
+
const val = v + (nextStepVal[i] - v) * ratio;
|
|
12776
|
+
if (!Number.isFinite(val)) {
|
|
12777
|
+
valid = false;
|
|
12778
|
+
break;
|
|
12779
|
+
}
|
|
12780
|
+
nextList.push(val);
|
|
12781
|
+
}
|
|
12782
|
+
if (valid) {
|
|
12783
|
+
nextAttributes[key] = nextList;
|
|
12784
|
+
}
|
|
12785
|
+
}
|
|
12751
12786
|
return false;
|
|
12752
12787
|
}
|
|
12753
12788
|
_interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {
|
|
@@ -20288,7 +20323,7 @@ class DefaultGroupBackgroundRenderContribution extends DefaultBaseBackgroundRend
|
|
|
20288
20323
|
const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
|
|
20289
20324
|
|
|
20290
20325
|
const halfPi = pi / 2;
|
|
20291
|
-
function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
|
|
20326
|
+
function createRectPath(path, x, y, width, height, rectCornerRadius, roundCorner, edgeCb) {
|
|
20292
20327
|
if (width < 0) {
|
|
20293
20328
|
x += width;
|
|
20294
20329
|
width = -width;
|
|
@@ -20362,41 +20397,57 @@ function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
|
|
|
20362
20397
|
const leftBottomPoint1 = [leftBottom[0] + _cornerRadius[3], leftBottom[1]];
|
|
20363
20398
|
const leftBottomPoint2 = [leftBottom[0], leftBottom[1] - _cornerRadius[3]];
|
|
20364
20399
|
path.moveTo(leftTopPoint1[0], leftTopPoint1[1]);
|
|
20365
|
-
|
|
20366
|
-
|
|
20367
|
-
|
|
20368
|
-
|
|
20369
|
-
edgeCb && edgeCb[
|
|
20370
|
-
|
|
20371
|
-
|
|
20372
|
-
|
|
20373
|
-
|
|
20374
|
-
|
|
20375
|
-
|
|
20376
|
-
|
|
20377
|
-
|
|
20378
|
-
|
|
20379
|
-
|
|
20380
|
-
edgeCb && edgeCb[
|
|
20381
|
-
|
|
20382
|
-
|
|
20383
|
-
|
|
20384
|
-
|
|
20385
|
-
|
|
20386
|
-
|
|
20387
|
-
|
|
20388
|
-
|
|
20389
|
-
edgeCb && edgeCb[
|
|
20390
|
-
|
|
20391
|
-
|
|
20392
|
-
|
|
20393
|
-
|
|
20394
|
-
|
|
20395
|
-
|
|
20396
|
-
|
|
20397
|
-
|
|
20398
|
-
edgeCb && edgeCb[
|
|
20399
|
-
|
|
20400
|
+
if (!roundCorner) {
|
|
20401
|
+
edgeCb && edgeCb[0]
|
|
20402
|
+
? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1])
|
|
20403
|
+
: path.lineTo(rightTopPoint1[0], rightTopPoint1[1]);
|
|
20404
|
+
edgeCb && edgeCb[1]
|
|
20405
|
+
? edgeCb[1](rightTopPoint1[0], rightTopPoint1[1], rightBottomPoint1[0], rightBottomPoint1[1])
|
|
20406
|
+
: path.lineTo(rightBottomPoint1[0], rightBottomPoint1[1]);
|
|
20407
|
+
edgeCb && edgeCb[2]
|
|
20408
|
+
? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1])
|
|
20409
|
+
: path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]);
|
|
20410
|
+
edgeCb && edgeCb[2]
|
|
20411
|
+
? edgeCb[2](leftBottomPoint1[0], leftBottomPoint1[1], leftTopPoint1[0], leftTopPoint1[1])
|
|
20412
|
+
: path.lineTo(leftTopPoint1[0], leftTopPoint1[1]);
|
|
20413
|
+
}
|
|
20414
|
+
else {
|
|
20415
|
+
edgeCb && edgeCb[0]
|
|
20416
|
+
? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1])
|
|
20417
|
+
: path.lineTo(rightTopPoint1[0], rightTopPoint1[1]);
|
|
20418
|
+
if (!arrayEqual(rightTopPoint1, rightTopPoint2)) {
|
|
20419
|
+
edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
|
|
20420
|
+
const centerX = rightTopPoint1[0];
|
|
20421
|
+
const centerY = rightTopPoint1[1] + _cornerRadius[1];
|
|
20422
|
+
path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, false);
|
|
20423
|
+
}
|
|
20424
|
+
edgeCb && edgeCb[1]
|
|
20425
|
+
? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1])
|
|
20426
|
+
: path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]);
|
|
20427
|
+
if (!arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
|
|
20428
|
+
const centerX = rightBottomPoint2[0] - _cornerRadius[2];
|
|
20429
|
+
const centerY = rightBottomPoint2[1];
|
|
20430
|
+
edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]);
|
|
20431
|
+
path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, false);
|
|
20432
|
+
}
|
|
20433
|
+
edgeCb && edgeCb[2]
|
|
20434
|
+
? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1])
|
|
20435
|
+
: path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]);
|
|
20436
|
+
if (!arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
|
|
20437
|
+
const centerX = leftBottomPoint1[0];
|
|
20438
|
+
const centerY = leftBottomPoint1[1] - _cornerRadius[3];
|
|
20439
|
+
edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]);
|
|
20440
|
+
path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, false);
|
|
20441
|
+
}
|
|
20442
|
+
edgeCb && edgeCb[3]
|
|
20443
|
+
? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1])
|
|
20444
|
+
: path.lineTo(leftTopPoint2[0], leftTopPoint2[1]);
|
|
20445
|
+
if (!arrayEqual(leftTopPoint1, leftTopPoint2)) {
|
|
20446
|
+
const centerX = leftTopPoint1[0];
|
|
20447
|
+
const centerY = leftTopPoint1[1] + _cornerRadius[0];
|
|
20448
|
+
edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]);
|
|
20449
|
+
path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, false);
|
|
20450
|
+
}
|
|
20400
20451
|
}
|
|
20401
20452
|
!edgeCb && path.closePath();
|
|
20402
20453
|
return path;
|
|
@@ -20415,7 +20466,7 @@ class DefaultRectRenderContribution {
|
|
|
20415
20466
|
if (!(doOuterBorder || doInnerBorder)) {
|
|
20416
20467
|
return;
|
|
20417
20468
|
}
|
|
20418
|
-
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;
|
|
20469
|
+
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;
|
|
20419
20470
|
let { width, height } = rect.attribute;
|
|
20420
20471
|
width = (width !== null && width !== void 0 ? width : x1 - x) || 0;
|
|
20421
20472
|
height = (height !== null && height !== void 0 ? height : y1 - y) || 0;
|
|
@@ -20433,7 +20484,7 @@ class DefaultRectRenderContribution {
|
|
|
20433
20484
|
}
|
|
20434
20485
|
else {
|
|
20435
20486
|
context.beginPath();
|
|
20436
|
-
createRectPath(context, nextX, nextY, width - sign * dw, height - sign * dw, cornerRadius);
|
|
20487
|
+
createRectPath(context, nextX, nextY, width - sign * dw, height - sign * dw, cornerRadius, cornerType === 'round');
|
|
20437
20488
|
}
|
|
20438
20489
|
context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute);
|
|
20439
20490
|
if (strokeCb) {
|
|
@@ -20474,7 +20525,7 @@ let SplitRectAfterRenderContribution = class SplitRectAfterRenderContribution {
|
|
|
20474
20525
|
this.order = 0;
|
|
20475
20526
|
}
|
|
20476
20527
|
drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb) {
|
|
20477
|
-
const { x1, y1, x: originX = groupAttribute.x, y: originY = groupAttribute.y, stroke = groupAttribute.stroke, cornerRadius = groupAttribute.cornerRadius } = rect.attribute;
|
|
20528
|
+
const { x1, y1, x: originX = groupAttribute.x, y: originY = groupAttribute.y, stroke = groupAttribute.stroke, cornerRadius = groupAttribute.cornerRadius, cornerType = groupAttribute.cornerType } = rect.attribute;
|
|
20478
20529
|
let { width, height } = rect.attribute;
|
|
20479
20530
|
width = (width !== null && width !== void 0 ? width : x1 - originX) || 0;
|
|
20480
20531
|
height = (height !== null && height !== void 0 ? height : y1 - originY) || 0;
|
|
@@ -20485,7 +20536,7 @@ let SplitRectAfterRenderContribution = class SplitRectAfterRenderContribution {
|
|
|
20485
20536
|
if (!(cornerRadius === 0 || (isArray(cornerRadius) && cornerRadius.every(num => num === 0)))) {
|
|
20486
20537
|
let lastStrokeI = 0;
|
|
20487
20538
|
let lastStroke;
|
|
20488
|
-
createRectPath(context, x, y, width, height, cornerRadius, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
|
|
20539
|
+
createRectPath(context, x, y, width, height, cornerRadius, cornerType === 'round', new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
|
|
20489
20540
|
if (stroke[i]) {
|
|
20490
20541
|
if (!(lastStrokeI === i - 1 && stroke[i] === lastStroke)) {
|
|
20491
20542
|
context.setStrokeStyle(rect, Object.assign(Object.assign({}, rect.attribute), { stroke: stroke[i] }), x, y, groupAttribute);
|
|
@@ -20560,7 +20611,7 @@ class DefaultImageBackgroundRenderContribution extends DefaultBaseBackgroundRend
|
|
|
20560
20611
|
context.beginPath();
|
|
20561
20612
|
const { x, y, width, height } = getActualPosition(graphic);
|
|
20562
20613
|
if (cornerRadius) {
|
|
20563
|
-
createRectPath(context, x - expandX, y - expandY, width + expandX * 2, height + expandY * 2, cornerRadius);
|
|
20614
|
+
createRectPath(context, x - expandX, y - expandY, width + expandX * 2, height + expandY * 2, cornerRadius, true);
|
|
20564
20615
|
}
|
|
20565
20616
|
else {
|
|
20566
20617
|
context.rect(x - expandX, y - expandY, width + expandX * 2, height + expandY * 2);
|
|
@@ -22219,7 +22270,7 @@ let DefaultCanvasRectRender = class DefaultCanvasRectRender extends BaseRender {
|
|
|
22219
22270
|
drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
22220
22271
|
var _a;
|
|
22221
22272
|
const rectAttribute = (_a = this.tempTheme) !== null && _a !== void 0 ? _a : getTheme(rect, params === null || params === void 0 ? void 0 : params.theme).rect;
|
|
22222
|
-
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;
|
|
22273
|
+
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;
|
|
22223
22274
|
let { width, height } = rect.attribute;
|
|
22224
22275
|
width = (width !== null && width !== void 0 ? width : x1 - originX) || 0;
|
|
22225
22276
|
height = (height !== null && height !== void 0 ? height : y1 - originY) || 0;
|
|
@@ -22242,7 +22293,7 @@ let DefaultCanvasRectRender = class DefaultCanvasRectRender extends BaseRender {
|
|
|
22242
22293
|
}
|
|
22243
22294
|
else {
|
|
22244
22295
|
context.beginPath();
|
|
22245
|
-
createRectPath(context, x, y, width, height, cornerRadius);
|
|
22296
|
+
createRectPath(context, x, y, width, height, cornerRadius, cornerType === 'round');
|
|
22246
22297
|
}
|
|
22247
22298
|
const doFillOrStroke = {
|
|
22248
22299
|
doFill,
|
|
@@ -22542,7 +22593,7 @@ class DefaultTextBackgroundRenderContribution extends DefaultBaseBackgroundRende
|
|
|
22542
22593
|
context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute);
|
|
22543
22594
|
context.fillStyle = background;
|
|
22544
22595
|
if (backgroundCornerRadius) {
|
|
22545
|
-
createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius);
|
|
22596
|
+
createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, true);
|
|
22546
22597
|
context.fill();
|
|
22547
22598
|
}
|
|
22548
22599
|
else {
|
|
@@ -22912,7 +22963,7 @@ let DefaultCanvasGroupRender = class DefaultCanvasGroupRender {
|
|
|
22912
22963
|
}
|
|
22913
22964
|
drawShape(group, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
22914
22965
|
const groupAttribute = getTheme(group, params === null || params === void 0 ? void 0 : params.theme).group;
|
|
22915
|
-
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;
|
|
22966
|
+
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;
|
|
22916
22967
|
const fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill);
|
|
22917
22968
|
const sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height);
|
|
22918
22969
|
const doFill = runFill(fill, background);
|
|
@@ -22949,7 +23000,7 @@ let DefaultCanvasGroupRender = class DefaultCanvasGroupRender {
|
|
|
22949
23000
|
}
|
|
22950
23001
|
else {
|
|
22951
23002
|
context.beginPath();
|
|
22952
|
-
createRectPath(context, x, y, width, height, cornerRadius);
|
|
23003
|
+
createRectPath(context, x, y, width, height, cornerRadius, cornerType === 'round');
|
|
22953
23004
|
}
|
|
22954
23005
|
if (!this._groupRenderContribitions) {
|
|
22955
23006
|
this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [];
|
|
@@ -23096,7 +23147,7 @@ let DefaultCanvasImageRender = class DefaultCanvasImageRender extends BaseRender
|
|
|
23096
23147
|
}
|
|
23097
23148
|
drawShape(image, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
23098
23149
|
const imageAttribute = getTheme(image).image;
|
|
23099
|
-
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;
|
|
23150
|
+
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;
|
|
23100
23151
|
const data = this.valid(image, imageAttribute, fillCb);
|
|
23101
23152
|
if (!data) {
|
|
23102
23153
|
return;
|
|
@@ -23121,7 +23172,7 @@ let DefaultCanvasImageRender = class DefaultCanvasImageRender extends BaseRender
|
|
|
23121
23172
|
if (cornerRadius === 0 || (isArray(cornerRadius) && cornerRadius.every(num => num === 0))) ;
|
|
23122
23173
|
else {
|
|
23123
23174
|
context.beginPath();
|
|
23124
|
-
createRectPath(context, x, y, width, height, cornerRadius);
|
|
23175
|
+
createRectPath(context, x, y, width, height, cornerRadius, cornerType === 'round');
|
|
23125
23176
|
context.save();
|
|
23126
23177
|
context.clip();
|
|
23127
23178
|
needRestore = true;
|
|
@@ -28024,7 +28075,7 @@ let DefaultCanvasRichTextRender = class DefaultCanvasRichTextRender extends Base
|
|
|
28024
28075
|
}
|
|
28025
28076
|
else {
|
|
28026
28077
|
context.beginPath();
|
|
28027
|
-
createRectPath(context, x - expandX, y - expandY, backgroundWidth, backgroundHeight, backgroundRadius);
|
|
28078
|
+
createRectPath(context, x - expandX, y - expandY, backgroundWidth, backgroundHeight, backgroundRadius, true);
|
|
28028
28079
|
}
|
|
28029
28080
|
if (backgroundFill) {
|
|
28030
28081
|
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
|
|