@visactor/vrender 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/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +91 -67
- package/dist/index.js +91 -67
- 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 +5 -5
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,7 +21,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
21
21
|
|
|
22
22
|
const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits"), vrender_kits_2 = require("@visactor/vrender-kits");
|
|
23
23
|
|
|
24
|
-
exports.version = "0.21.2-vstory.
|
|
24
|
+
exports.version = "0.21.2-vstory.2", (0, vrender_core_1.preLoadAllModule)(), (0,
|
|
25
25
|
vrender_core_1.isBrowserEnv)() ? (0, vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0,
|
|
26
26
|
vrender_core_1.isNodeEnv)() && (0, vrender_kits_1.loadNodeEnv)(vrender_core_1.container),
|
|
27
27
|
(0, vrender_kits_2.registerArc)(), (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(),
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,iBAAiB,CAAC;AAEzC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AACtB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"0.21.2-vstory.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,iBAAiB,CAAC;AAEzC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AACtB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"0.21.2-vstory.2\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
|
package/dist/index.es.js
CHANGED
|
@@ -4195,7 +4195,8 @@ const DefaultGroupAttribute = Object.assign(Object.assign({}, DefaultAttribute),
|
|
|
4195
4195
|
justifyContent: "flex-start",
|
|
4196
4196
|
alignItems: "flex-start",
|
|
4197
4197
|
alignContent: "flex-start",
|
|
4198
|
-
baseOpacity: 1
|
|
4198
|
+
baseOpacity: 1,
|
|
4199
|
+
cornerType: "round"
|
|
4199
4200
|
});
|
|
4200
4201
|
const DefaultGlyphAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
4201
4202
|
path: "",
|
|
@@ -4232,7 +4233,8 @@ const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute),
|
|
|
4232
4233
|
x1: 0,
|
|
4233
4234
|
y1: 0,
|
|
4234
4235
|
strokeBoundsBuffer: 0,
|
|
4235
|
-
cornerRadius: 0
|
|
4236
|
+
cornerRadius: 0,
|
|
4237
|
+
cornerType: "round"
|
|
4236
4238
|
});
|
|
4237
4239
|
const DefaultRect3dAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
4238
4240
|
width: 0,
|
|
@@ -4240,7 +4242,8 @@ const DefaultRect3dAttribute = Object.assign(Object.assign({}, DefaultAttribute)
|
|
|
4240
4242
|
x1: 0,
|
|
4241
4243
|
y1: 0,
|
|
4242
4244
|
cornerRadius: 0,
|
|
4243
|
-
length: 0
|
|
4245
|
+
length: 0,
|
|
4246
|
+
cornerType: "round"
|
|
4244
4247
|
});
|
|
4245
4248
|
const DefaultSymbolAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
4246
4249
|
symbolType: "circle",
|
|
@@ -4276,7 +4279,8 @@ const DefaultImageAttribute = Object.assign(Object.assign({
|
|
|
4276
4279
|
height: 0
|
|
4277
4280
|
}, DefaultAttribute), {
|
|
4278
4281
|
fill: !0,
|
|
4279
|
-
cornerRadius: 0
|
|
4282
|
+
cornerRadius: 0,
|
|
4283
|
+
cornerType: "round"
|
|
4280
4284
|
});
|
|
4281
4285
|
const DefaultRichTextIconAttribute = Object.assign(Object.assign({}, DefaultImageAttribute), {
|
|
4282
4286
|
backgroundShowMode: "never",
|
|
@@ -7235,6 +7239,13 @@ class Easing {
|
|
|
7235
7239
|
Easing[name] = func;
|
|
7236
7240
|
}
|
|
7237
7241
|
}
|
|
7242
|
+
function flicker(t, n) {
|
|
7243
|
+
const step = 1 / n;
|
|
7244
|
+
let flag = 1;
|
|
7245
|
+
for (; t > step;) t -= step, flag *= -1;
|
|
7246
|
+
const v = flag * t / step;
|
|
7247
|
+
return v > 0 ? v : 1 + v;
|
|
7248
|
+
}
|
|
7238
7249
|
Easing.quadIn = Easing.getPowIn(2), Easing.quadOut = Easing.getPowOut(2), Easing.quadInOut = Easing.getPowInOut(2), Easing.cubicIn = Easing.getPowIn(3), Easing.cubicOut = Easing.getPowOut(3), Easing.cubicInOut = Easing.getPowInOut(3), Easing.quartIn = Easing.getPowIn(4), Easing.quartOut = Easing.getPowOut(4), Easing.quartInOut = Easing.getPowInOut(4), Easing.quintIn = Easing.getPowIn(5), Easing.quintOut = Easing.getPowOut(5), Easing.quintInOut = Easing.getPowInOut(5), Easing.backIn = Easing.getBackIn(1.7), Easing.backOut = Easing.getBackOut(1.7), Easing.backInOut = Easing.getBackInOut(1.7), Easing.elasticIn = Easing.getElasticIn(1, .3), Easing.elasticOut = Easing.getElasticOut(1, .3), Easing.elasticInOut = Easing.getElasticInOut(1, .3 * 1.5), Easing.easeInOutQuad = t => (t /= .5) < 1 ? .5 * Math.pow(t, 2) : -.5 * ((t -= 2) * t - 2), Easing.easeOutElastic = x => {
|
|
7239
7250
|
const c4 = 2 * Math.PI / 3;
|
|
7240
7251
|
return 0 === x ? 0 : 1 === x ? 1 : Math.pow(2, -10 * x) * Math.sin((10 * x - .75) * c4) + 1;
|
|
@@ -7242,6 +7253,8 @@ Easing.quadIn = Easing.getPowIn(2), Easing.quadOut = Easing.getPowOut(2), Easing
|
|
|
7242
7253
|
const c5 = 2 * Math.PI / 4.5;
|
|
7243
7254
|
return 0 === x ? 0 : 1 === x ? 1 : x < .5 ? -Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5) / 2 : Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5) / 2 + 1;
|
|
7244
7255
|
};
|
|
7256
|
+
for (let i = 0; i < 10; i++) Easing[`flicker${i}`] = t => flicker(t, i);
|
|
7257
|
+
for (let i = 2; i < 10; i++) Easing[`aIn${i}`] = t => i * t * t + (1 - i) * t;
|
|
7245
7258
|
|
|
7246
7259
|
class DefaultTimeline {
|
|
7247
7260
|
constructor() {
|
|
@@ -7923,39 +7936,25 @@ class InputText extends ACustomAnimate {
|
|
|
7923
7936
|
};
|
|
7924
7937
|
}
|
|
7925
7938
|
onBind() {
|
|
7926
|
-
var _a, _b, _c
|
|
7927
|
-
|
|
7928
|
-
this.toText = this.toText.toString();
|
|
7929
|
-
const root = this.target.attachShadow(),
|
|
7930
|
-
line = application.graphicService.creator.line({
|
|
7931
|
-
x: 0,
|
|
7932
|
-
y: 0,
|
|
7933
|
-
points: [{
|
|
7934
|
-
x: 0,
|
|
7935
|
-
y: 0
|
|
7936
|
-
}, {
|
|
7937
|
-
x: 0,
|
|
7938
|
-
y: this.target.getComputedAttribute("fontSize")
|
|
7939
|
-
}],
|
|
7940
|
-
stroke: "black",
|
|
7941
|
-
lineWidth: 1
|
|
7942
|
-
});
|
|
7943
|
-
root.add(line);
|
|
7944
|
-
}
|
|
7939
|
+
var _a, _b, _c;
|
|
7940
|
+
this.fromText = null !== (_b = null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) && void 0 !== _b ? _b : "", this.toText = (null === (_c = this.to) || void 0 === _c ? void 0 : _c.text) || "", (!this.toText || isArray$1(this.toText) && 0 === this.toText.length) && (this.valid = !1), isArray$1(this.toText) && (this.toText = this.toText.map(item => (item || "").toString()));
|
|
7945
7941
|
}
|
|
7946
7942
|
onEnd() {
|
|
7947
7943
|
this.target.detachShadow();
|
|
7948
7944
|
}
|
|
7949
7945
|
onUpdate(end, ratio, out) {
|
|
7950
|
-
var _a;
|
|
7951
7946
|
if (!1 === this.valid) return;
|
|
7952
7947
|
const fromCount = this.fromText.length,
|
|
7953
|
-
|
|
7948
|
+
toTextIsArray = isArray$1(this.toText),
|
|
7949
|
+
toCount = toTextIsArray ? this.toText.reduce((c, t) => c + (t || "").length, 0) : this.toText.length,
|
|
7954
7950
|
count = Math.ceil(fromCount + (toCount - fromCount) * ratio);
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7951
|
+
if (toTextIsArray) {
|
|
7952
|
+
out.text = [];
|
|
7953
|
+
let len = 0;
|
|
7954
|
+
this.toText.forEach(t => {
|
|
7955
|
+
len + t.length > count ? (out.text.push(t.substr(0, count - len)), len = count) : (out.text.push(t), len += t.length);
|
|
7956
|
+
});
|
|
7957
|
+
} else out.text = this.toText.substr(0, count);
|
|
7959
7958
|
}
|
|
7960
7959
|
}
|
|
7961
7960
|
class StreamLight extends ACustomAnimate {
|
|
@@ -10342,6 +10341,20 @@ class Graphic extends Node {
|
|
|
10342
10341
|
});
|
|
10343
10342
|
return color && (nextAttributes[key] = color), !0;
|
|
10344
10343
|
}
|
|
10344
|
+
if (Array.isArray(nextStepVal) && nextStepVal.length === lastStepVal.length) {
|
|
10345
|
+
const nextList = [];
|
|
10346
|
+
let valid = !0;
|
|
10347
|
+
for (let i = 0; i < nextStepVal.length; i++) {
|
|
10348
|
+
const v = lastStepVal[i],
|
|
10349
|
+
val = v + (nextStepVal[i] - v) * ratio;
|
|
10350
|
+
if (!Number.isFinite(val)) {
|
|
10351
|
+
valid = !1;
|
|
10352
|
+
break;
|
|
10353
|
+
}
|
|
10354
|
+
nextList.push(val);
|
|
10355
|
+
}
|
|
10356
|
+
valid && (nextAttributes[key] = nextList);
|
|
10357
|
+
}
|
|
10345
10358
|
return !1;
|
|
10346
10359
|
}
|
|
10347
10360
|
_interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {}
|
|
@@ -15601,7 +15614,7 @@ class DefaultGroupBackgroundRenderContribution extends DefaultBaseBackgroundRend
|
|
|
15601
15614
|
const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
|
|
15602
15615
|
|
|
15603
15616
|
const halfPi = pi / 2;
|
|
15604
|
-
function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
|
|
15617
|
+
function createRectPath(path, x, y, width, height, rectCornerRadius, roundCorner, edgeCb) {
|
|
15605
15618
|
let cornerRadius;
|
|
15606
15619
|
if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$1(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
|
|
15607
15620
|
const cornerRadiusArr = rectCornerRadius;
|
|
@@ -15633,27 +15646,29 @@ function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
|
|
|
15633
15646
|
rightBottomPoint2 = [rightBottom[0], rightBottom[1] - _cornerRadius[2]],
|
|
15634
15647
|
leftBottomPoint1 = [leftBottom[0] + _cornerRadius[3], leftBottom[1]],
|
|
15635
15648
|
leftBottomPoint2 = [leftBottom[0], leftBottom[1] - _cornerRadius[3]];
|
|
15636
|
-
if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]),
|
|
15637
|
-
edgeCb && edgeCb[0]
|
|
15638
|
-
|
|
15639
|
-
|
|
15640
|
-
|
|
15641
|
-
|
|
15642
|
-
|
|
15643
|
-
|
|
15644
|
-
|
|
15645
|
-
|
|
15646
|
-
|
|
15647
|
-
|
|
15648
|
-
|
|
15649
|
-
|
|
15650
|
-
|
|
15651
|
-
|
|
15652
|
-
|
|
15653
|
-
|
|
15654
|
-
|
|
15655
|
-
|
|
15656
|
-
|
|
15649
|
+
if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), roundCorner) {
|
|
15650
|
+
if (edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
|
|
15651
|
+
edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
|
|
15652
|
+
const centerX = rightTopPoint1[0],
|
|
15653
|
+
centerY = rightTopPoint1[1] + _cornerRadius[1];
|
|
15654
|
+
path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, !1);
|
|
15655
|
+
}
|
|
15656
|
+
if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
|
|
15657
|
+
const centerX = rightBottomPoint2[0] - _cornerRadius[2],
|
|
15658
|
+
centerY = rightBottomPoint2[1];
|
|
15659
|
+
edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]), path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
|
|
15660
|
+
}
|
|
15661
|
+
if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
|
|
15662
|
+
const centerX = leftBottomPoint1[0],
|
|
15663
|
+
centerY = leftBottomPoint1[1] - _cornerRadius[3];
|
|
15664
|
+
edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]), path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, !1);
|
|
15665
|
+
}
|
|
15666
|
+
if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
|
|
15667
|
+
const centerX = leftTopPoint1[0],
|
|
15668
|
+
centerY = leftTopPoint1[1] + _cornerRadius[0];
|
|
15669
|
+
edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]), path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, !1);
|
|
15670
|
+
}
|
|
15671
|
+
} else edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint1[0], rightTopPoint1[1], rightBottomPoint1[0], rightBottomPoint1[1]) : path.lineTo(rightBottomPoint1[0], rightBottomPoint1[1]), edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), edgeCb && edgeCb[2] ? edgeCb[2](leftBottomPoint1[0], leftBottomPoint1[1], leftTopPoint1[0], leftTopPoint1[1]) : path.lineTo(leftTopPoint1[0], leftTopPoint1[1]);
|
|
15657
15672
|
return !edgeCb && path.closePath(), path;
|
|
15658
15673
|
}
|
|
15659
15674
|
|
|
@@ -15678,6 +15693,7 @@ class DefaultRectRenderContribution {
|
|
|
15678
15693
|
if (!doOuterBorder && !doInnerBorder) return;
|
|
15679
15694
|
const {
|
|
15680
15695
|
cornerRadius = rectAttribute.cornerRadius,
|
|
15696
|
+
cornerType = rectAttribute.cornerType,
|
|
15681
15697
|
opacity = rectAttribute.opacity,
|
|
15682
15698
|
x: originX = rectAttribute.x,
|
|
15683
15699
|
y: originY = rectAttribute.y,
|
|
@@ -15702,7 +15718,7 @@ class DefaultRectRenderContribution {
|
|
|
15702
15718
|
nextX = x + sign * d,
|
|
15703
15719
|
nextY = y + sign * d,
|
|
15704
15720
|
dw = 2 * d;
|
|
15705
|
-
if (0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(nextX, nextY, width - sign * dw, height - sign * dw)) : (context.beginPath(), createRectPath(context, nextX, nextY, width - sign * dw, height - sign * dw, cornerRadius)), context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), strokeCb) strokeCb(context, borderStyle, rectAttribute[key]);else if (doStroke) {
|
|
15721
|
+
if (0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(nextX, nextY, width - sign * dw, height - sign * dw)) : (context.beginPath(), createRectPath(context, nextX, nextY, width - sign * dw, height - sign * dw, cornerRadius, "round" === cornerType)), context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), strokeCb) strokeCb(context, borderStyle, rectAttribute[key]);else if (doStroke) {
|
|
15706
15722
|
const lastOpacity = rectAttribute[key].opacity;
|
|
15707
15723
|
rectAttribute[key].opacity = opacity, context.setStrokeStyle(rect, borderStyle, (originX - x) / scaleX, (originY - y) / scaleY, rectAttribute[key]), rectAttribute[key].opacity = lastOpacity, context.stroke();
|
|
15708
15724
|
}
|
|
@@ -15733,7 +15749,8 @@ let SplitRectAfterRenderContribution = class {
|
|
|
15733
15749
|
x: originX = groupAttribute.x,
|
|
15734
15750
|
y: originY = groupAttribute.y,
|
|
15735
15751
|
stroke = groupAttribute.stroke,
|
|
15736
|
-
cornerRadius = groupAttribute.cornerRadius
|
|
15752
|
+
cornerRadius = groupAttribute.cornerRadius,
|
|
15753
|
+
cornerType = groupAttribute.cornerType
|
|
15737
15754
|
} = rect.attribute;
|
|
15738
15755
|
let {
|
|
15739
15756
|
width: width,
|
|
@@ -15743,7 +15760,7 @@ let SplitRectAfterRenderContribution = class {
|
|
|
15743
15760
|
if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute), !(0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num))) {
|
|
15744
15761
|
let lastStroke,
|
|
15745
15762
|
lastStrokeI = 0;
|
|
15746
|
-
return createRectPath(context, x, y, width, height, cornerRadius, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
|
|
15763
|
+
return createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
|
|
15747
15764
|
stroke[i] && (lastStrokeI === i - 1 && stroke[i] === lastStroke || (context.setStrokeStyle(rect, Object.assign(Object.assign({}, rect.attribute), {
|
|
15748
15765
|
stroke: stroke[i]
|
|
15749
15766
|
}), x, y, groupAttribute), context.beginPath(), context.moveTo(x1, y1), lastStroke = stroke[i]), lastStrokeI = i, context.lineTo(x2, y2), context.stroke(), 3 === i && context.beginPath());
|
|
@@ -15802,7 +15819,7 @@ class DefaultImageBackgroundRenderContribution extends DefaultBaseBackgroundRend
|
|
|
15802
15819
|
width: width,
|
|
15803
15820
|
height: height
|
|
15804
15821
|
} = getActualPosition(graphic);
|
|
15805
|
-
cornerRadius ? createRectPath(context, x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY, cornerRadius) : context.rect(x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY), context.globalAlpha = 1, fill && (context.fillStyle = fill, context.fill()), stroke && lineWidth > 0 && (context.lineWidth = lineWidth, context.strokeStyle = stroke, context.stroke());
|
|
15822
|
+
cornerRadius ? createRectPath(context, x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY, cornerRadius, !0) : context.rect(x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY), context.globalAlpha = 1, fill && (context.fillStyle = fill, context.fill()), stroke && lineWidth > 0 && (context.lineWidth = lineWidth, context.strokeStyle = stroke, context.stroke());
|
|
15806
15823
|
} else {
|
|
15807
15824
|
context.beginPath();
|
|
15808
15825
|
const b = graphic.AABBBounds;
|
|
@@ -16906,6 +16923,7 @@ let DefaultCanvasRectRender = class extends BaseRender {
|
|
|
16906
16923
|
background: background,
|
|
16907
16924
|
stroke = rectAttribute.stroke,
|
|
16908
16925
|
cornerRadius = rectAttribute.cornerRadius,
|
|
16926
|
+
cornerType = rectAttribute.cornerType,
|
|
16909
16927
|
opacity = rectAttribute.opacity,
|
|
16910
16928
|
fillOpacity = rectAttribute.fillOpacity,
|
|
16911
16929
|
lineWidth = rectAttribute.lineWidth,
|
|
@@ -16929,7 +16947,7 @@ let DefaultCanvasRectRender = class extends BaseRender {
|
|
|
16929
16947
|
if (!rect.valid || !visible) return;
|
|
16930
16948
|
if (!doFill && !doStroke) return;
|
|
16931
16949
|
if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
|
|
16932
|
-
0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius));
|
|
16950
|
+
0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType));
|
|
16933
16951
|
const doFillOrStroke = {
|
|
16934
16952
|
doFill: doFill,
|
|
16935
16953
|
doStroke: doStroke
|
|
@@ -17107,7 +17125,7 @@ class DefaultTextBackgroundRenderContribution extends DefaultBaseBackgroundRende
|
|
|
17107
17125
|
const {
|
|
17108
17126
|
backgroundCornerRadius: backgroundCornerRadius
|
|
17109
17127
|
} = graphic.attribute;
|
|
17110
|
-
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
17128
|
+
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
17111
17129
|
}
|
|
17112
17130
|
shouldReCalBounds && boundsAllocate.free(b), restore();
|
|
17113
17131
|
}
|
|
@@ -17418,6 +17436,7 @@ let DefaultCanvasGroupRender = class {
|
|
|
17418
17436
|
lineWidth = groupAttribute.lineWidth,
|
|
17419
17437
|
visible = groupAttribute.visible,
|
|
17420
17438
|
fillStrokeOrder = groupAttribute.fillStrokeOrder,
|
|
17439
|
+
cornerType = groupAttribute.cornerType,
|
|
17421
17440
|
x: originX = groupAttribute.x,
|
|
17422
17441
|
y: originY = groupAttribute.y
|
|
17423
17442
|
} = group.attribute,
|
|
@@ -17437,7 +17456,7 @@ let DefaultCanvasGroupRender = class {
|
|
|
17437
17456
|
context.disableFill = !0, context.disableStroke = !0, context.disableBeginPath = !0, path.forEach(g => {
|
|
17438
17457
|
drawContext.drawContribution.getRenderContribution(g).draw(g, drawContext.renderService, drawContext, params);
|
|
17439
17458
|
}), context.disableFill = disableFill, context.disableStroke = disableStroke, context.disableBeginPath = disableBeginPath;
|
|
17440
|
-
} else 0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius));
|
|
17459
|
+
} else 0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType));
|
|
17441
17460
|
this._groupRenderContribitions || (this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution));
|
|
17442
17461
|
const doFillOrStroke = {
|
|
17443
17462
|
doFill: doFill,
|
|
@@ -17519,6 +17538,7 @@ let DefaultCanvasImageRender = class extends BaseRender {
|
|
|
17519
17538
|
y: originY = imageAttribute.y,
|
|
17520
17539
|
cornerRadius = imageAttribute.cornerRadius,
|
|
17521
17540
|
fillStrokeOrder = imageAttribute.fillStrokeOrder,
|
|
17541
|
+
cornerType = imageAttribute.cornerType,
|
|
17522
17542
|
image: url
|
|
17523
17543
|
} = image.attribute,
|
|
17524
17544
|
data = this.valid(image, imageAttribute, fillCb);
|
|
@@ -17536,7 +17556,7 @@ let DefaultCanvasImageRender = class extends BaseRender {
|
|
|
17536
17556
|
const res = image.resources.get(url);
|
|
17537
17557
|
if ("success" !== res.state) return;
|
|
17538
17558
|
let needRestore = !1;
|
|
17539
|
-
0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) || (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius), context.save(), context.clip(), needRestore = !0), context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
|
|
17559
|
+
0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) || (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType), context.save(), context.clip(), needRestore = !0), context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
|
|
17540
17560
|
let repeat = 0;
|
|
17541
17561
|
if ("repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat) {
|
|
17542
17562
|
const pattern = context.createPattern(res.data, repeatStr[repeat]);
|
|
@@ -20928,7 +20948,7 @@ let DefaultCanvasRichTextRender = class extends BaseRender {
|
|
|
20928
20948
|
if (margin && (x += icon._marginArray[3], y += icon._marginArray[0]), icon._hovered) {
|
|
20929
20949
|
const expandX = (backgroundWidth - width) / 2,
|
|
20930
20950
|
expandY = (backgroundHeight - height) / 2;
|
|
20931
|
-
0 === backgroundRadius ? (context.beginPath(), context.rect(x - expandX, y - expandY, backgroundWidth, backgroundHeight)) : (context.beginPath(), createRectPath(context, x - expandX, y - expandY, backgroundWidth, backgroundHeight, backgroundRadius)), backgroundFill && (context.globalAlpha = backgroundFillOpacity, context.fillStyle = backgroundFill, context.fill()), backgroundStroke && (context.globalAlpha = backgroundStrokeOpacity, context.strokeStyle = backgroundStroke, context.stroke());
|
|
20951
|
+
0 === backgroundRadius ? (context.beginPath(), context.rect(x - expandX, y - expandY, backgroundWidth, backgroundHeight)) : (context.beginPath(), createRectPath(context, x - expandX, y - expandY, backgroundWidth, backgroundHeight, backgroundRadius, !0)), backgroundFill && (context.globalAlpha = backgroundFillOpacity, context.fillStyle = backgroundFill, context.fill()), backgroundStroke && (context.globalAlpha = backgroundStrokeOpacity, context.strokeStyle = backgroundStroke, context.stroke());
|
|
20932
20952
|
}
|
|
20933
20953
|
const res = url && (null === (_a = null == icon ? void 0 : icon.resources) || void 0 === _a ? void 0 : _a.get(url));
|
|
20934
20954
|
res && "success" === res.state && (context.globalAlpha = opacity, context.drawImage(res.data, x, y, width, height));
|
|
@@ -24938,11 +24958,12 @@ let BrowserContext2d = class {
|
|
|
24938
24958
|
stroke = defaultParams.stroke,
|
|
24939
24959
|
lineJoin = defaultParams.lineJoin,
|
|
24940
24960
|
lineDash = defaultParams.lineDash,
|
|
24961
|
+
lineDashOffset = defaultParams.lineDashOffset,
|
|
24941
24962
|
lineCap = defaultParams.lineCap,
|
|
24942
24963
|
miterLimit = defaultParams.miterLimit,
|
|
24943
24964
|
keepStrokeScale = defaultParams.keepStrokeScale
|
|
24944
24965
|
} = attribute;
|
|
24945
|
-
_context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
24966
|
+
_context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && (_context.setLineDash(lineDash), _context.lineDashOffset = lineDashOffset), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
24946
24967
|
}
|
|
24947
24968
|
}
|
|
24948
24969
|
setTextStyleWithoutAlignBaseline(params, defaultParams, z) {
|
|
@@ -26434,9 +26455,10 @@ let LynxContext2d = class extends BrowserContext2d {
|
|
|
26434
26455
|
lineDash = defaultParams.lineDash,
|
|
26435
26456
|
lineCap = defaultParams.lineCap,
|
|
26436
26457
|
miterLimit = defaultParams.miterLimit,
|
|
26437
|
-
keepStrokeScale = defaultParams.keepStrokeScale
|
|
26458
|
+
keepStrokeScale = defaultParams.keepStrokeScale,
|
|
26459
|
+
lineDashOffset = defaultParams.lineDashOffset
|
|
26438
26460
|
} = attribute;
|
|
26439
|
-
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash
|
|
26461
|
+
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || !lineDash || (_context.setLineDash(lineDash), _context.lineDashOffset = lineDashOffset), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
26440
26462
|
}
|
|
26441
26463
|
}
|
|
26442
26464
|
measureText(text) {
|
|
@@ -27063,11 +27085,12 @@ let TaroContext2d = class extends BrowserContext2d {
|
|
|
27063
27085
|
stroke = defaultParams.stroke,
|
|
27064
27086
|
lineJoin = defaultParams.lineJoin,
|
|
27065
27087
|
lineDash = defaultParams.lineDash,
|
|
27088
|
+
lineDashOffset = defaultParams.lineDashOffset,
|
|
27066
27089
|
lineCap = defaultParams.lineCap,
|
|
27067
27090
|
miterLimit = defaultParams.miterLimit,
|
|
27068
27091
|
keepStrokeScale = defaultParams.keepStrokeScale
|
|
27069
27092
|
} = attribute;
|
|
27070
|
-
_context.setGlobalAlpha(strokeOpacity * opacity), _context.setLineWidth(keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr)), _context.setStrokeStyle(createColor(this, stroke, params, offsetX, offsetY)), _context.setLineJoin(lineJoin), lineDash && _context.setLineDash(lineDash), _context.setLineCap(lineCap), _context.setMiterLimit(miterLimit);
|
|
27093
|
+
_context.setGlobalAlpha(strokeOpacity * opacity), _context.setLineWidth(keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr)), _context.setStrokeStyle(createColor(this, stroke, params, offsetX, offsetY)), _context.setLineJoin(lineJoin), lineDash && (_context.setLineDash(lineDash), _context.lineDashOffset = lineDashOffset), _context.setLineCap(lineCap), _context.setMiterLimit(miterLimit);
|
|
27071
27094
|
}
|
|
27072
27095
|
}
|
|
27073
27096
|
setTextStyleWithoutAlignBaseline(params, defaultParams) {
|
|
@@ -28108,9 +28131,10 @@ let HarmonyContext2d = class extends BrowserContext2d {
|
|
|
28108
28131
|
lineDash = defaultParams.lineDash,
|
|
28109
28132
|
lineCap = defaultParams.lineCap,
|
|
28110
28133
|
miterLimit = defaultParams.miterLimit,
|
|
28111
|
-
keepStrokeScale = defaultParams.keepStrokeScale
|
|
28134
|
+
keepStrokeScale = defaultParams.keepStrokeScale,
|
|
28135
|
+
lineDashOffset = defaultParams.lineDashOffset
|
|
28112
28136
|
} = attribute;
|
|
28113
|
-
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
28137
|
+
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || (lineDash && _context.setLineDash(lineDash), _context.lineDashOffset = lineDashOffset), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
28114
28138
|
}
|
|
28115
28139
|
}
|
|
28116
28140
|
measureText(text) {
|
|
@@ -29884,7 +29908,7 @@ const registerWrapText = _registerWrapText;
|
|
|
29884
29908
|
|
|
29885
29909
|
const roughModule = _roughModule;
|
|
29886
29910
|
|
|
29887
|
-
const version = "0.21.2-vstory.
|
|
29911
|
+
const version = "0.21.2-vstory.2";
|
|
29888
29912
|
preLoadAllModule();
|
|
29889
29913
|
if (isBrowserEnv()) {
|
|
29890
29914
|
loadBrowserEnv(container);
|