@visactor/vrender 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/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.5-vstory.
|
|
24
|
+
exports.version = "0.21.5-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.5-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.5-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
|
@@ -4225,7 +4225,8 @@ const DefaultGroupAttribute = Object.assign(Object.assign({}, DefaultAttribute),
|
|
|
4225
4225
|
justifyContent: "flex-start",
|
|
4226
4226
|
alignItems: "flex-start",
|
|
4227
4227
|
alignContent: "flex-start",
|
|
4228
|
-
baseOpacity: 1
|
|
4228
|
+
baseOpacity: 1,
|
|
4229
|
+
cornerType: "round"
|
|
4229
4230
|
});
|
|
4230
4231
|
const DefaultGlyphAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
4231
4232
|
path: "",
|
|
@@ -4262,7 +4263,8 @@ const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute),
|
|
|
4262
4263
|
x1: 0,
|
|
4263
4264
|
y1: 0,
|
|
4264
4265
|
strokeBoundsBuffer: 0,
|
|
4265
|
-
cornerRadius: 0
|
|
4266
|
+
cornerRadius: 0,
|
|
4267
|
+
cornerType: "round"
|
|
4266
4268
|
});
|
|
4267
4269
|
const DefaultRect3dAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
4268
4270
|
width: 0,
|
|
@@ -4270,7 +4272,8 @@ const DefaultRect3dAttribute = Object.assign(Object.assign({}, DefaultAttribute)
|
|
|
4270
4272
|
x1: 0,
|
|
4271
4273
|
y1: 0,
|
|
4272
4274
|
cornerRadius: 0,
|
|
4273
|
-
length: 0
|
|
4275
|
+
length: 0,
|
|
4276
|
+
cornerType: "round"
|
|
4274
4277
|
});
|
|
4275
4278
|
const DefaultSymbolAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
4276
4279
|
symbolType: "circle",
|
|
@@ -4306,7 +4309,8 @@ const DefaultImageAttribute = Object.assign(Object.assign({
|
|
|
4306
4309
|
height: 0
|
|
4307
4310
|
}, DefaultAttribute), {
|
|
4308
4311
|
fill: !0,
|
|
4309
|
-
cornerRadius: 0
|
|
4312
|
+
cornerRadius: 0,
|
|
4313
|
+
cornerType: "round"
|
|
4310
4314
|
});
|
|
4311
4315
|
const DefaultRichTextIconAttribute = Object.assign(Object.assign({}, DefaultImageAttribute), {
|
|
4312
4316
|
backgroundShowMode: "never",
|
|
@@ -7265,6 +7269,13 @@ class Easing {
|
|
|
7265
7269
|
Easing[name] = func;
|
|
7266
7270
|
}
|
|
7267
7271
|
}
|
|
7272
|
+
function flicker(t, n) {
|
|
7273
|
+
const step = 1 / n;
|
|
7274
|
+
let flag = 1;
|
|
7275
|
+
for (; t > step;) t -= step, flag *= -1;
|
|
7276
|
+
const v = flag * t / step;
|
|
7277
|
+
return v > 0 ? v : 1 + v;
|
|
7278
|
+
}
|
|
7268
7279
|
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 => {
|
|
7269
7280
|
const c4 = 2 * Math.PI / 3;
|
|
7270
7281
|
return 0 === x ? 0 : 1 === x ? 1 : Math.pow(2, -10 * x) * Math.sin((10 * x - .75) * c4) + 1;
|
|
@@ -7272,6 +7283,8 @@ Easing.quadIn = Easing.getPowIn(2), Easing.quadOut = Easing.getPowOut(2), Easing
|
|
|
7272
7283
|
const c5 = 2 * Math.PI / 4.5;
|
|
7273
7284
|
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;
|
|
7274
7285
|
};
|
|
7286
|
+
for (let i = 0; i < 10; i++) Easing[`flicker${i}`] = t => flicker(t, i);
|
|
7287
|
+
for (let i = 2; i < 10; i++) Easing[`aIn${i}`] = t => i * t * t + (1 - i) * t;
|
|
7275
7288
|
|
|
7276
7289
|
class DefaultTimeline {
|
|
7277
7290
|
constructor() {
|
|
@@ -7953,39 +7966,25 @@ class InputText extends ACustomAnimate {
|
|
|
7953
7966
|
};
|
|
7954
7967
|
}
|
|
7955
7968
|
onBind() {
|
|
7956
|
-
var _a, _b, _c
|
|
7957
|
-
|
|
7958
|
-
this.toText = this.toText.toString();
|
|
7959
|
-
const root = this.target.attachShadow(),
|
|
7960
|
-
line = application.graphicService.creator.line({
|
|
7961
|
-
x: 0,
|
|
7962
|
-
y: 0,
|
|
7963
|
-
points: [{
|
|
7964
|
-
x: 0,
|
|
7965
|
-
y: 0
|
|
7966
|
-
}, {
|
|
7967
|
-
x: 0,
|
|
7968
|
-
y: this.target.getComputedAttribute("fontSize")
|
|
7969
|
-
}],
|
|
7970
|
-
stroke: "black",
|
|
7971
|
-
lineWidth: 1
|
|
7972
|
-
});
|
|
7973
|
-
root.add(line);
|
|
7974
|
-
}
|
|
7969
|
+
var _a, _b, _c;
|
|
7970
|
+
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()));
|
|
7975
7971
|
}
|
|
7976
7972
|
onEnd() {
|
|
7977
7973
|
this.target.detachShadow();
|
|
7978
7974
|
}
|
|
7979
7975
|
onUpdate(end, ratio, out) {
|
|
7980
|
-
var _a;
|
|
7981
7976
|
if (!1 === this.valid) return;
|
|
7982
7977
|
const fromCount = this.fromText.length,
|
|
7983
|
-
|
|
7978
|
+
toTextIsArray = isArray$1(this.toText),
|
|
7979
|
+
toCount = toTextIsArray ? this.toText.reduce((c, t) => c + (t || "").length, 0) : this.toText.length,
|
|
7984
7980
|
count = Math.ceil(fromCount + (toCount - fromCount) * ratio);
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7981
|
+
if (toTextIsArray) {
|
|
7982
|
+
out.text = [];
|
|
7983
|
+
let len = 0;
|
|
7984
|
+
this.toText.forEach(t => {
|
|
7985
|
+
len + t.length > count ? (out.text.push(t.substr(0, count - len)), len = count) : (out.text.push(t), len += t.length);
|
|
7986
|
+
});
|
|
7987
|
+
} else out.text = this.toText.substr(0, count);
|
|
7989
7988
|
}
|
|
7990
7989
|
}
|
|
7991
7990
|
class StreamLight extends ACustomAnimate {
|
|
@@ -10372,6 +10371,20 @@ class Graphic extends Node {
|
|
|
10372
10371
|
});
|
|
10373
10372
|
return color && (nextAttributes[key] = color), !0;
|
|
10374
10373
|
}
|
|
10374
|
+
if (Array.isArray(nextStepVal) && nextStepVal.length === lastStepVal.length) {
|
|
10375
|
+
const nextList = [];
|
|
10376
|
+
let valid = !0;
|
|
10377
|
+
for (let i = 0; i < nextStepVal.length; i++) {
|
|
10378
|
+
const v = lastStepVal[i],
|
|
10379
|
+
val = v + (nextStepVal[i] - v) * ratio;
|
|
10380
|
+
if (!Number.isFinite(val)) {
|
|
10381
|
+
valid = !1;
|
|
10382
|
+
break;
|
|
10383
|
+
}
|
|
10384
|
+
nextList.push(val);
|
|
10385
|
+
}
|
|
10386
|
+
valid && (nextAttributes[key] = nextList);
|
|
10387
|
+
}
|
|
10375
10388
|
return !1;
|
|
10376
10389
|
}
|
|
10377
10390
|
_interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {}
|
|
@@ -15631,7 +15644,7 @@ class DefaultGroupBackgroundRenderContribution extends DefaultBaseBackgroundRend
|
|
|
15631
15644
|
const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
|
|
15632
15645
|
|
|
15633
15646
|
const halfPi = pi / 2;
|
|
15634
|
-
function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
|
|
15647
|
+
function createRectPath(path, x, y, width, height, rectCornerRadius, roundCorner, edgeCb) {
|
|
15635
15648
|
let cornerRadius;
|
|
15636
15649
|
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)) {
|
|
15637
15650
|
const cornerRadiusArr = rectCornerRadius;
|
|
@@ -15663,27 +15676,29 @@ function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
|
|
|
15663
15676
|
rightBottomPoint2 = [rightBottom[0], rightBottom[1] - _cornerRadius[2]],
|
|
15664
15677
|
leftBottomPoint1 = [leftBottom[0] + _cornerRadius[3], leftBottom[1]],
|
|
15665
15678
|
leftBottomPoint2 = [leftBottom[0], leftBottom[1] - _cornerRadius[3]];
|
|
15666
|
-
if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]),
|
|
15667
|
-
edgeCb && edgeCb[0]
|
|
15668
|
-
|
|
15669
|
-
|
|
15670
|
-
|
|
15671
|
-
|
|
15672
|
-
|
|
15673
|
-
|
|
15674
|
-
|
|
15675
|
-
|
|
15676
|
-
|
|
15677
|
-
|
|
15678
|
-
|
|
15679
|
-
|
|
15680
|
-
|
|
15681
|
-
|
|
15682
|
-
|
|
15683
|
-
|
|
15684
|
-
|
|
15685
|
-
|
|
15686
|
-
|
|
15679
|
+
if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), roundCorner) {
|
|
15680
|
+
if (edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
|
|
15681
|
+
edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
|
|
15682
|
+
const centerX = rightTopPoint1[0],
|
|
15683
|
+
centerY = rightTopPoint1[1] + _cornerRadius[1];
|
|
15684
|
+
path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, !1);
|
|
15685
|
+
}
|
|
15686
|
+
if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
|
|
15687
|
+
const centerX = rightBottomPoint2[0] - _cornerRadius[2],
|
|
15688
|
+
centerY = rightBottomPoint2[1];
|
|
15689
|
+
edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]), path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
|
|
15690
|
+
}
|
|
15691
|
+
if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
|
|
15692
|
+
const centerX = leftBottomPoint1[0],
|
|
15693
|
+
centerY = leftBottomPoint1[1] - _cornerRadius[3];
|
|
15694
|
+
edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]), path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, !1);
|
|
15695
|
+
}
|
|
15696
|
+
if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
|
|
15697
|
+
const centerX = leftTopPoint1[0],
|
|
15698
|
+
centerY = leftTopPoint1[1] + _cornerRadius[0];
|
|
15699
|
+
edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]), path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, !1);
|
|
15700
|
+
}
|
|
15701
|
+
} 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]);
|
|
15687
15702
|
return !edgeCb && path.closePath(), path;
|
|
15688
15703
|
}
|
|
15689
15704
|
|
|
@@ -15708,6 +15723,7 @@ class DefaultRectRenderContribution {
|
|
|
15708
15723
|
if (!doOuterBorder && !doInnerBorder) return;
|
|
15709
15724
|
const {
|
|
15710
15725
|
cornerRadius = rectAttribute.cornerRadius,
|
|
15726
|
+
cornerType = rectAttribute.cornerType,
|
|
15711
15727
|
opacity = rectAttribute.opacity,
|
|
15712
15728
|
x: originX = rectAttribute.x,
|
|
15713
15729
|
y: originY = rectAttribute.y,
|
|
@@ -15732,7 +15748,7 @@ class DefaultRectRenderContribution {
|
|
|
15732
15748
|
nextX = x + sign * d,
|
|
15733
15749
|
nextY = y + sign * d,
|
|
15734
15750
|
dw = 2 * d;
|
|
15735
|
-
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) {
|
|
15751
|
+
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) {
|
|
15736
15752
|
const lastOpacity = rectAttribute[key].opacity;
|
|
15737
15753
|
rectAttribute[key].opacity = opacity, context.setStrokeStyle(rect, borderStyle, (originX - x) / scaleX, (originY - y) / scaleY, rectAttribute[key]), rectAttribute[key].opacity = lastOpacity, context.stroke();
|
|
15738
15754
|
}
|
|
@@ -15763,7 +15779,8 @@ let SplitRectAfterRenderContribution = class {
|
|
|
15763
15779
|
x: originX = groupAttribute.x,
|
|
15764
15780
|
y: originY = groupAttribute.y,
|
|
15765
15781
|
stroke = groupAttribute.stroke,
|
|
15766
|
-
cornerRadius = groupAttribute.cornerRadius
|
|
15782
|
+
cornerRadius = groupAttribute.cornerRadius,
|
|
15783
|
+
cornerType = groupAttribute.cornerType
|
|
15767
15784
|
} = rect.attribute;
|
|
15768
15785
|
let {
|
|
15769
15786
|
width: width,
|
|
@@ -15773,7 +15790,7 @@ let SplitRectAfterRenderContribution = class {
|
|
|
15773
15790
|
if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute), !(0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num))) {
|
|
15774
15791
|
let lastStroke,
|
|
15775
15792
|
lastStrokeI = 0;
|
|
15776
|
-
return createRectPath(context, x, y, width, height, cornerRadius, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
|
|
15793
|
+
return createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
|
|
15777
15794
|
stroke[i] && (lastStrokeI === i - 1 && stroke[i] === lastStroke || (context.setStrokeStyle(rect, Object.assign(Object.assign({}, rect.attribute), {
|
|
15778
15795
|
stroke: stroke[i]
|
|
15779
15796
|
}), x, y, groupAttribute), context.beginPath(), context.moveTo(x1, y1), lastStroke = stroke[i]), lastStrokeI = i, context.lineTo(x2, y2), context.stroke(), 3 === i && context.beginPath());
|
|
@@ -15834,7 +15851,7 @@ class DefaultImageBackgroundRenderContribution extends DefaultBaseBackgroundRend
|
|
|
15834
15851
|
width: width,
|
|
15835
15852
|
height: height
|
|
15836
15853
|
} = getActualPosition(graphic);
|
|
15837
|
-
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());
|
|
15854
|
+
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());
|
|
15838
15855
|
} else context.beginPath(), context.rect(x, y, width || 0, height || 0), context.fillStyle = background, context.globalAlpha = 1, context.fill();
|
|
15839
15856
|
}
|
|
15840
15857
|
}
|
|
@@ -16934,6 +16951,7 @@ let DefaultCanvasRectRender = class extends BaseRender {
|
|
|
16934
16951
|
background: background,
|
|
16935
16952
|
stroke = rectAttribute.stroke,
|
|
16936
16953
|
cornerRadius = rectAttribute.cornerRadius,
|
|
16954
|
+
cornerType = rectAttribute.cornerType,
|
|
16937
16955
|
opacity = rectAttribute.opacity,
|
|
16938
16956
|
fillOpacity = rectAttribute.fillOpacity,
|
|
16939
16957
|
lineWidth = rectAttribute.lineWidth,
|
|
@@ -16957,7 +16975,7 @@ let DefaultCanvasRectRender = class extends BaseRender {
|
|
|
16957
16975
|
if (!rect.valid || !visible) return;
|
|
16958
16976
|
if (!doFill && !doStroke) return;
|
|
16959
16977
|
if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
|
|
16960
|
-
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));
|
|
16978
|
+
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));
|
|
16961
16979
|
const doFillOrStroke = {
|
|
16962
16980
|
doFill: doFill,
|
|
16963
16981
|
doStroke: doStroke
|
|
@@ -17135,7 +17153,7 @@ class DefaultTextBackgroundRenderContribution extends DefaultBaseBackgroundRende
|
|
|
17135
17153
|
const {
|
|
17136
17154
|
backgroundCornerRadius: backgroundCornerRadius
|
|
17137
17155
|
} = graphic.attribute;
|
|
17138
|
-
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();
|
|
17156
|
+
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();
|
|
17139
17157
|
}
|
|
17140
17158
|
shouldReCalBounds && boundsAllocate.free(b), restore();
|
|
17141
17159
|
}
|
|
@@ -17446,6 +17464,7 @@ let DefaultCanvasGroupRender = class {
|
|
|
17446
17464
|
lineWidth = groupAttribute.lineWidth,
|
|
17447
17465
|
visible = groupAttribute.visible,
|
|
17448
17466
|
fillStrokeOrder = groupAttribute.fillStrokeOrder,
|
|
17467
|
+
cornerType = groupAttribute.cornerType,
|
|
17449
17468
|
x: originX = groupAttribute.x,
|
|
17450
17469
|
y: originY = groupAttribute.y
|
|
17451
17470
|
} = group.attribute,
|
|
@@ -17465,7 +17484,7 @@ let DefaultCanvasGroupRender = class {
|
|
|
17465
17484
|
context.disableFill = !0, context.disableStroke = !0, context.disableBeginPath = !0, path.forEach(g => {
|
|
17466
17485
|
drawContext.drawContribution.getRenderContribution(g).draw(g, drawContext.renderService, drawContext, params);
|
|
17467
17486
|
}), context.disableFill = disableFill, context.disableStroke = disableStroke, context.disableBeginPath = disableBeginPath;
|
|
17468
|
-
} 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));
|
|
17487
|
+
} 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));
|
|
17469
17488
|
this._groupRenderContribitions || (this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution));
|
|
17470
17489
|
const doFillOrStroke = {
|
|
17471
17490
|
doFill: doFill,
|
|
@@ -17547,6 +17566,7 @@ let DefaultCanvasImageRender = class extends BaseRender {
|
|
|
17547
17566
|
y: originY = imageAttribute.y,
|
|
17548
17567
|
cornerRadius = imageAttribute.cornerRadius,
|
|
17549
17568
|
fillStrokeOrder = imageAttribute.fillStrokeOrder,
|
|
17569
|
+
cornerType = imageAttribute.cornerType,
|
|
17550
17570
|
image: url
|
|
17551
17571
|
} = image.attribute,
|
|
17552
17572
|
data = this.valid(image, imageAttribute, fillCb);
|
|
@@ -17564,7 +17584,7 @@ let DefaultCanvasImageRender = class extends BaseRender {
|
|
|
17564
17584
|
const res = image.resources.get(url);
|
|
17565
17585
|
if ("success" !== res.state) return;
|
|
17566
17586
|
let needRestore = !1;
|
|
17567
|
-
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);
|
|
17587
|
+
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);
|
|
17568
17588
|
let repeat = 0;
|
|
17569
17589
|
if ("repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat) {
|
|
17570
17590
|
const pattern = context.createPattern(res.data, repeatStr[repeat]);
|
|
@@ -20985,7 +21005,7 @@ let DefaultCanvasRichTextRender = class extends BaseRender {
|
|
|
20985
21005
|
if (margin && (x += icon._marginArray[3], y += icon._marginArray[0]), icon._hovered) {
|
|
20986
21006
|
const expandX = (backgroundWidth - width) / 2,
|
|
20987
21007
|
expandY = (backgroundHeight - height) / 2;
|
|
20988
|
-
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());
|
|
21008
|
+
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());
|
|
20989
21009
|
}
|
|
20990
21010
|
const res = url && (null === (_a = null == icon ? void 0 : icon.resources) || void 0 === _a ? void 0 : _a.get(url));
|
|
20991
21011
|
res && "success" === res.state && (context.globalAlpha = opacity, context.drawImage(res.data, x, y, width, height));
|
|
@@ -25009,11 +25029,12 @@ let BrowserContext2d = class {
|
|
|
25009
25029
|
stroke = defaultParams.stroke,
|
|
25010
25030
|
lineJoin = defaultParams.lineJoin,
|
|
25011
25031
|
lineDash = defaultParams.lineDash,
|
|
25032
|
+
lineDashOffset = defaultParams.lineDashOffset,
|
|
25012
25033
|
lineCap = defaultParams.lineCap,
|
|
25013
25034
|
miterLimit = defaultParams.miterLimit,
|
|
25014
25035
|
keepStrokeScale = defaultParams.keepStrokeScale
|
|
25015
25036
|
} = attribute;
|
|
25016
|
-
_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;
|
|
25037
|
+
_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;
|
|
25017
25038
|
}
|
|
25018
25039
|
}
|
|
25019
25040
|
setTextStyleWithoutAlignBaseline(params, defaultParams, z) {
|
|
@@ -26543,9 +26564,10 @@ let LynxContext2d = class extends BrowserContext2d {
|
|
|
26543
26564
|
lineDash = defaultParams.lineDash,
|
|
26544
26565
|
lineCap = defaultParams.lineCap,
|
|
26545
26566
|
miterLimit = defaultParams.miterLimit,
|
|
26546
|
-
keepStrokeScale = defaultParams.keepStrokeScale
|
|
26567
|
+
keepStrokeScale = defaultParams.keepStrokeScale,
|
|
26568
|
+
lineDashOffset = defaultParams.lineDashOffset
|
|
26547
26569
|
} = attribute;
|
|
26548
|
-
_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
|
|
26570
|
+
_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;
|
|
26549
26571
|
}
|
|
26550
26572
|
}
|
|
26551
26573
|
measureText(text) {
|
|
@@ -27172,11 +27194,12 @@ let TaroContext2d = class extends BrowserContext2d {
|
|
|
27172
27194
|
stroke = defaultParams.stroke,
|
|
27173
27195
|
lineJoin = defaultParams.lineJoin,
|
|
27174
27196
|
lineDash = defaultParams.lineDash,
|
|
27197
|
+
lineDashOffset = defaultParams.lineDashOffset,
|
|
27175
27198
|
lineCap = defaultParams.lineCap,
|
|
27176
27199
|
miterLimit = defaultParams.miterLimit,
|
|
27177
27200
|
keepStrokeScale = defaultParams.keepStrokeScale
|
|
27178
27201
|
} = attribute;
|
|
27179
|
-
_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);
|
|
27202
|
+
_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);
|
|
27180
27203
|
}
|
|
27181
27204
|
}
|
|
27182
27205
|
setTextStyleWithoutAlignBaseline(params, defaultParams) {
|
|
@@ -28217,9 +28240,10 @@ let HarmonyContext2d = class extends BrowserContext2d {
|
|
|
28217
28240
|
lineDash = defaultParams.lineDash,
|
|
28218
28241
|
lineCap = defaultParams.lineCap,
|
|
28219
28242
|
miterLimit = defaultParams.miterLimit,
|
|
28220
|
-
keepStrokeScale = defaultParams.keepStrokeScale
|
|
28243
|
+
keepStrokeScale = defaultParams.keepStrokeScale,
|
|
28244
|
+
lineDashOffset = defaultParams.lineDashOffset
|
|
28221
28245
|
} = attribute;
|
|
28222
|
-
_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;
|
|
28246
|
+
_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;
|
|
28223
28247
|
}
|
|
28224
28248
|
}
|
|
28225
28249
|
measureText(text) {
|
|
@@ -29993,7 +30017,7 @@ const registerWrapText = _registerWrapText;
|
|
|
29993
30017
|
|
|
29994
30018
|
const roughModule = _roughModule;
|
|
29995
30019
|
|
|
29996
|
-
const version = "0.21.5-vstory.
|
|
30020
|
+
const version = "0.21.5-vstory.2";
|
|
29997
30021
|
preLoadAllModule();
|
|
29998
30022
|
if (isBrowserEnv()) {
|
|
29999
30023
|
loadBrowserEnv(container);
|