@meta2d/core 1.0.69 → 1.0.71
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/package.json +1 -1
- package/src/canvas/canvas.js +18 -11
- package/src/canvas/canvas.js.map +1 -1
- package/src/canvas/canvasImage.js +1 -1
- package/src/canvas/canvasImage.js.map +1 -1
- package/src/canvas/canvasTemplate.js +1 -1
- package/src/canvas/canvasTemplate.js.map +1 -1
- package/src/core.js +59 -95
- package/src/core.js.map +1 -1
- package/src/pen/model.js +1 -0
- package/src/pen/model.js.map +1 -1
- package/src/pen/render.js +61 -37
- package/src/pen/render.js.map +1 -1
- package/src/pen/text.js +15 -6
- package/src/pen/text.js.map +1 -1
- package/src/store/store.d.ts +2 -2
- package/src/theme.js +2 -0
- package/src/theme.js.map +1 -1
- package/src/utils/jetLinks.d.ts +8 -0
- package/src/utils/jetLinks.js +116 -0
- package/src/utils/jetLinks.js.map +1 -0
- package/src/utils/url.js +3 -0
- package/src/utils/url.js.map +1 -1
package/src/pen/model.js
CHANGED
package/src/pen/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../../packages/core/src/pen/model.ts"],"names":[],"mappings":"AAKA,MAAM,CAAN,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,qCAAI,CAAA;IACJ,qCAAI,CAAA;AACN,CAAC,EAHW,OAAO,KAAP,OAAO,QAGlB;AAED,MAAM,CAAN,IAAY,SAQX;AARD,WAAY,SAAS;IACnB,yCAAI,CAAA;IACJ,uDAAW,CAAA;IACX,uDAAW,CAAA;IACX,yDAAY,CAAA;IACZ,iEAAgB,CAAA;IAChB,iBAAiB;IACjB,gDAAY,CAAA;AACd,CAAC,EARW,SAAS,KAAT,SAAS,QAQpB;AAED,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,iDAAO,CAAA;IACP,uCAAE,CAAA;IACF,yCAAG,CAAA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AAwjBD;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,KAAK;IACL,QAAQ;IACR,OAAO;IACP,SAAS;IACT,YAAY;IACZ,iBAAiB;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../../packages/core/src/pen/model.ts"],"names":[],"mappings":"AAKA,MAAM,CAAN,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,qCAAI,CAAA;IACJ,qCAAI,CAAA;AACN,CAAC,EAHW,OAAO,KAAP,OAAO,QAGlB;AAED,MAAM,CAAN,IAAY,SAQX;AARD,WAAY,SAAS;IACnB,yCAAI,CAAA;IACJ,uDAAW,CAAA;IACX,uDAAW,CAAA;IACX,yDAAY,CAAA;IACZ,iEAAgB,CAAA;IAChB,iBAAiB;IACjB,gDAAY,CAAA;AACd,CAAC,EARW,SAAS,KAAT,SAAS,QAQpB;AAED,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,iDAAO,CAAA;IACP,uCAAE,CAAA;IACF,yCAAG,CAAA;AACL,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAED,MAAM,CAAN,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,uCAAI,CAAA;IACJ,2CAAM,CAAA;IACN,2CAAM,CAAA;AACR,CAAC,EAJW,QAAQ,KAAR,QAAQ,QAInB;AAED,oBAAoB;AACpB,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,iEAAkB,CAAA;IAClB,uEAAiB,CAAA;IACjB,yDAAU,CAAA;IACV,2DAAW,CAAA,CAAC,OAAO;AACrB,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAED,qBAAqB;AACrB,gBAAgB;AAChB,wBAAwB;AACxB,sBAAsB;AACtB,iBAAiB;AACjB,IAAI;AAEJ,wBAAwB;AACxB,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,MAAM;IACN,WAAW;IACX,YAAY;IACZ,UAAU;IACV,SAAS;IACT,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C5B,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC;IAC1B,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC;IAC5B,GAAG,CAAC,OAAO,GAAG,SAAS,CAAC;IACxB,GAAG,CAAC,UAAU,GAAG,SAAS,CAAC;IAC3B,GAAG,CAAC,OAAO,GAAG,SAAS,CAAC;IACxB,GAAG,CAAC,YAAY,GAAG,SAAS,CAAC;IAC7B,GAAG,CAAC,YAAY,GAAG,SAAS,CAAC;IAC7B,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC;IAC5B,GAAG,CAAC,cAAc,GAAG,SAAS,CAAC;IAC/B,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC;IAC1B,GAAG,CAAC,aAAa,GAAG,SAAS,CAAC;IAC9B,GAAG,CAAC,OAAO,GAAG,SAAS,CAAC;IACxB,GAAG,CAAC,OAAO,GAAG,SAAS,CAAC;IACxB,GAAG,CAAC,aAAa,GAAG,SAAS,CAAC;AAChC,CAAC"}
|
package/src/pen/render.js
CHANGED
|
@@ -738,11 +738,11 @@ export function drawImage(ctx, pen) {
|
|
|
738
738
|
*/
|
|
739
739
|
export function getTextColor(pen, store) {
|
|
740
740
|
const { textColor, color } = pen.calculative;
|
|
741
|
-
const {
|
|
741
|
+
const { styles } = store;
|
|
742
742
|
return (textColor ||
|
|
743
743
|
color ||
|
|
744
|
-
|
|
745
|
-
|
|
744
|
+
styles.textColor ||
|
|
745
|
+
styles.color);
|
|
746
746
|
}
|
|
747
747
|
function drawText(ctx, pen) {
|
|
748
748
|
const { fontStyle, fontWeight, fontSize, fontFamily, lineHeight, text, hiddenText, canvas, textHasShadow, textBackground, textType, } = pen.calculative;
|
|
@@ -764,10 +764,10 @@ function drawText(ctx, pen) {
|
|
|
764
764
|
pSBC(0.4, getTextColor(pen, store));
|
|
765
765
|
}
|
|
766
766
|
else if (pen.calculative.hover) {
|
|
767
|
-
fill = pen.hoverTextColor || pen.hoverColor || store.
|
|
767
|
+
fill = pen.hoverTextColor || pen.hoverColor || store.styles.hoverColor;
|
|
768
768
|
}
|
|
769
769
|
else if (pen.calculative.active) {
|
|
770
|
-
fill = pen.activeTextColor || pen.activeColor || store.
|
|
770
|
+
fill = pen.activeTextColor || pen.activeColor || store.styles.activeColor;
|
|
771
771
|
}
|
|
772
772
|
let gradient = undefined;
|
|
773
773
|
if (textType === Gradient.Linear) {
|
|
@@ -877,10 +877,10 @@ function drawFillText(ctx, pen, text) {
|
|
|
877
877
|
ctx.save();
|
|
878
878
|
let fill = undefined;
|
|
879
879
|
if (pen.calculative.hover) {
|
|
880
|
-
fill = pen.hoverTextColor || pen.hoverColor || store.
|
|
880
|
+
fill = pen.hoverTextColor || pen.hoverColor || store.styles.hoverColor;
|
|
881
881
|
}
|
|
882
882
|
else if (pen.calculative.active) {
|
|
883
|
-
fill = pen.activeTextColor || pen.activeColor || store.
|
|
883
|
+
fill = pen.activeTextColor || pen.activeColor || store.styles.activeColor;
|
|
884
884
|
}
|
|
885
885
|
ctx.fillStyle = fill || getTextColor(pen, store);
|
|
886
886
|
ctx.font = getFont({
|
|
@@ -1082,20 +1082,20 @@ export function renderPen(ctx, pen, download) {
|
|
|
1082
1082
|
if (pen.calculative.disabled) {
|
|
1083
1083
|
_stroke =
|
|
1084
1084
|
pen.disabledColor ||
|
|
1085
|
-
store.
|
|
1086
|
-
pSBC(0.4, pen.calculative.color || store.
|
|
1085
|
+
store.styles.disabledColor ||
|
|
1086
|
+
pSBC(0.4, pen.calculative.color || store.styles.color);
|
|
1087
1087
|
fill =
|
|
1088
1088
|
pen.disabledBackground ||
|
|
1089
|
-
store.
|
|
1090
|
-
pSBC(0.4, pen.calculative.background || store.
|
|
1089
|
+
store.styles.disabledBackground ||
|
|
1090
|
+
pSBC(0.4, pen.calculative.background || store.styles.penBackground);
|
|
1091
1091
|
}
|
|
1092
1092
|
else if (pen.mouseDownValid && pen.calculative.mouseDown) {
|
|
1093
1093
|
_stroke =
|
|
1094
1094
|
pen.mouseDownColor ||
|
|
1095
|
-
pSBC(-0.4, pen.calculative.color || store.
|
|
1095
|
+
pSBC(-0.4, pen.calculative.color || store.styles.color);
|
|
1096
1096
|
fill =
|
|
1097
1097
|
pen.mouseDownBackground ||
|
|
1098
|
-
pSBC(-0.4, pen.calculative.background || store.
|
|
1098
|
+
pSBC(-0.4, pen.calculative.background || store.styles.penBackground);
|
|
1099
1099
|
}
|
|
1100
1100
|
else if (pen.switch && pen.calculative.checked) {
|
|
1101
1101
|
if (!pen.calculative.bkType) {
|
|
@@ -1103,23 +1103,23 @@ export function renderPen(ctx, pen, download) {
|
|
|
1103
1103
|
}
|
|
1104
1104
|
}
|
|
1105
1105
|
else if (pen.calculative.hover) {
|
|
1106
|
-
_stroke = pen.hoverColor || store.
|
|
1107
|
-
fill = pen.hoverBackground || store.
|
|
1106
|
+
_stroke = pen.hoverColor || store.styles.hoverColor;
|
|
1107
|
+
fill = pen.hoverBackground || store.styles.hoverBackground;
|
|
1108
1108
|
// ctx.fillStyle = fill;
|
|
1109
1109
|
// fill && (setBack = false);
|
|
1110
1110
|
}
|
|
1111
1111
|
else if (pen.calculative.active) {
|
|
1112
|
-
_stroke = pen.activeColor || store.
|
|
1113
|
-
fill = pen.activeBackground || store.
|
|
1112
|
+
_stroke = pen.activeColor || store.styles.activeColor;
|
|
1113
|
+
fill = pen.activeBackground || store.styles.activeBackground;
|
|
1114
1114
|
// ctx.fillStyle = fill;
|
|
1115
1115
|
// fill && (setBack = false);
|
|
1116
1116
|
}
|
|
1117
1117
|
else if (pen.calculative.isDock) {
|
|
1118
1118
|
if (pen.type === PenType.Line) {
|
|
1119
|
-
_stroke = store.
|
|
1119
|
+
_stroke = store.styles.dockPenColor;
|
|
1120
1120
|
}
|
|
1121
1121
|
else {
|
|
1122
|
-
fill = rgba(store.
|
|
1122
|
+
fill = rgba(store.styles.dockPenColor, 0.2);
|
|
1123
1123
|
// ctx.fillStyle = fill;
|
|
1124
1124
|
// fill && (setBack = false);
|
|
1125
1125
|
}
|
|
@@ -1153,7 +1153,7 @@ export function renderPen(ctx, pen, download) {
|
|
|
1153
1153
|
}
|
|
1154
1154
|
}
|
|
1155
1155
|
else {
|
|
1156
|
-
stroke = pen.calculative.color || (pen.type ? store.data.lineColor : '') || store.
|
|
1156
|
+
stroke = pen.calculative.color || (pen.type ? store.data.lineColor : '') || store.styles.color;
|
|
1157
1157
|
}
|
|
1158
1158
|
ctx.strokeStyle = _stroke || stroke;
|
|
1159
1159
|
}
|
|
@@ -1199,7 +1199,7 @@ export function renderPen(ctx, pen, download) {
|
|
|
1199
1199
|
}
|
|
1200
1200
|
}
|
|
1201
1201
|
else {
|
|
1202
|
-
back = pen.calculative.background || store.
|
|
1202
|
+
back = pen.calculative.background || store.styles.penBackground;
|
|
1203
1203
|
}
|
|
1204
1204
|
ctx.fillStyle = fill || back;
|
|
1205
1205
|
fill = !!back;
|
|
@@ -1324,14 +1324,14 @@ export function renderPenRaw(ctx, pen, rect, download) {
|
|
|
1324
1324
|
}
|
|
1325
1325
|
let fill;
|
|
1326
1326
|
if (pen.calculative.hover) {
|
|
1327
|
-
ctx.strokeStyle = pen.hoverColor || store.
|
|
1328
|
-
ctx.fillStyle = pen.hoverBackground || store.
|
|
1329
|
-
fill = pen.hoverBackground || store.
|
|
1327
|
+
ctx.strokeStyle = pen.hoverColor || store.styles.hoverColor;
|
|
1328
|
+
ctx.fillStyle = pen.hoverBackground || store.styles.hoverBackground;
|
|
1329
|
+
fill = pen.hoverBackground || store.styles.hoverBackground;
|
|
1330
1330
|
}
|
|
1331
1331
|
else if (pen.calculative.active) {
|
|
1332
|
-
ctx.strokeStyle = pen.activeColor || store.
|
|
1333
|
-
ctx.fillStyle = pen.activeBackground || store.
|
|
1334
|
-
fill = pen.activeBackground || store.
|
|
1332
|
+
ctx.strokeStyle = pen.activeColor || store.styles.activeColor;
|
|
1333
|
+
ctx.fillStyle = pen.activeBackground || store.styles.activeBackground;
|
|
1334
|
+
fill = pen.activeBackground || store.styles.activeBackground;
|
|
1335
1335
|
}
|
|
1336
1336
|
else {
|
|
1337
1337
|
if (pen.strokeImage) {
|
|
@@ -1348,7 +1348,7 @@ export function renderPenRaw(ctx, pen, rect, download) {
|
|
|
1348
1348
|
lineGradientFlag = true;
|
|
1349
1349
|
}
|
|
1350
1350
|
else {
|
|
1351
|
-
stroke = pen.calculative.color || store.
|
|
1351
|
+
stroke = pen.calculative.color || store.styles.color; //getGlobalColor(store);
|
|
1352
1352
|
}
|
|
1353
1353
|
ctx.strokeStyle = stroke;
|
|
1354
1354
|
}
|
|
@@ -1689,11 +1689,11 @@ export function ctxDrawLinePath(canUsePath = true, ctx, pen, store) {
|
|
|
1689
1689
|
* 设置线条动画,ctx 的 strokeStyle lineDash 等属性更改
|
|
1690
1690
|
*/
|
|
1691
1691
|
export function setCtxLineAnimate(ctx, pen, store) {
|
|
1692
|
-
ctx.strokeStyle = pen.animateColor || store.
|
|
1692
|
+
ctx.strokeStyle = pen.animateColor || store.styles.animateColor;
|
|
1693
1693
|
if (pen.animateShadow) {
|
|
1694
1694
|
ctx.shadowBlur = pen.animateShadowBlur || pen.animateLineWidth || 6;
|
|
1695
1695
|
ctx.shadowColor =
|
|
1696
|
-
pen.animateShadowColor || pen.animateColor || store.
|
|
1696
|
+
pen.animateShadowColor || pen.animateColor || store.styles.animateColor;
|
|
1697
1697
|
}
|
|
1698
1698
|
pen.calculative.animateLineWidth &&
|
|
1699
1699
|
(ctx.lineWidth = pen.calculative.animateLineWidth * store.data.scale);
|
|
@@ -1734,11 +1734,11 @@ export function setCtxLineAnimate(ctx, pen, store) {
|
|
|
1734
1734
|
ctx.setLineDash([0.1, pen.length]);
|
|
1735
1735
|
break;
|
|
1736
1736
|
case LineAnimateType.Arrow:
|
|
1737
|
-
ctx.fillStyle = pen.animateColor || store.
|
|
1737
|
+
ctx.fillStyle = pen.animateColor || store.styles.animateColor;
|
|
1738
1738
|
ctx.lineWidth = 1;
|
|
1739
1739
|
break;
|
|
1740
1740
|
case LineAnimateType.WaterDrop:
|
|
1741
|
-
ctx.fillStyle = pen.animateColor || store.
|
|
1741
|
+
ctx.fillStyle = pen.animateColor || store.styles.animateColor;
|
|
1742
1742
|
ctx.lineWidth = 1;
|
|
1743
1743
|
break;
|
|
1744
1744
|
default:
|
|
@@ -1770,7 +1770,7 @@ export function renderLineAnchors(ctx, pen) {
|
|
|
1770
1770
|
const store = pen.calculative.canvas.store;
|
|
1771
1771
|
ctx.save();
|
|
1772
1772
|
ctx.lineWidth = 1;
|
|
1773
|
-
ctx.fillStyle = pen.activeColor || store.
|
|
1773
|
+
ctx.fillStyle = pen.activeColor || store.styles.activeColor; //store.options.activeColor;
|
|
1774
1774
|
pen.calculative.worldAnchors.forEach((pt) => {
|
|
1775
1775
|
!pt.hidden && !pt.isTemp && renderAnchor(ctx, pt, pen);
|
|
1776
1776
|
});
|
|
@@ -2483,6 +2483,7 @@ export function setNodeAnimateProcess(pen, process) {
|
|
|
2483
2483
|
process = 1;
|
|
2484
2484
|
}
|
|
2485
2485
|
const frame = pen.frames[pen.calculative.frameIndex];
|
|
2486
|
+
const scale = pen.calculative.canvas.store.data.scale;
|
|
2486
2487
|
for (const k in frame) {
|
|
2487
2488
|
if (k === 'duration') {
|
|
2488
2489
|
continue;
|
|
@@ -2495,7 +2496,7 @@ export function setNodeAnimateProcess(pen, process) {
|
|
|
2495
2496
|
pen.calculative.patchFlags = true;
|
|
2496
2497
|
}
|
|
2497
2498
|
else if (k === 'x') {
|
|
2498
|
-
const lastVal = getFrameValue(pen, k, pen.calculative.frameIndex);
|
|
2499
|
+
const lastVal = getFrameValue(pen, k, pen.calculative.frameIndex) * scale;
|
|
2499
2500
|
pen.calculative.worldRect.x = pen.calculative.initRect.x + lastVal;
|
|
2500
2501
|
pen.calculative.worldRect.ex = pen.calculative.initRect.ex + lastVal;
|
|
2501
2502
|
pen.calculative.worldRect.center.x = pen.calculative.initRect.center.x + lastVal;
|
|
@@ -2503,11 +2504,11 @@ export function setNodeAnimateProcess(pen, process) {
|
|
|
2503
2504
|
pen.calculative.worldRect.pivot.x =
|
|
2504
2505
|
pen.calculative.initRect.pivot?.x + lastVal;
|
|
2505
2506
|
}
|
|
2506
|
-
translateRect(pen.calculative.worldRect, frame[k] * process *
|
|
2507
|
+
translateRect(pen.calculative.worldRect, frame[k] * process * scale, 0);
|
|
2507
2508
|
pen.calculative.patchFlags = true;
|
|
2508
2509
|
}
|
|
2509
2510
|
else if (k === 'y') {
|
|
2510
|
-
const lastVal = getFrameValue(pen, k, pen.calculative.frameIndex);
|
|
2511
|
+
const lastVal = getFrameValue(pen, k, pen.calculative.frameIndex) * scale;
|
|
2511
2512
|
pen.calculative.worldRect.y = pen.calculative.initRect.y + lastVal;
|
|
2512
2513
|
pen.calculative.worldRect.ey = pen.calculative.initRect.ey + lastVal;
|
|
2513
2514
|
pen.calculative.worldRect.center.y =
|
|
@@ -2516,7 +2517,30 @@ export function setNodeAnimateProcess(pen, process) {
|
|
|
2516
2517
|
pen.calculative.worldRect.pivot.y =
|
|
2517
2518
|
pen.calculative.initRect.pivot?.y + lastVal;
|
|
2518
2519
|
}
|
|
2519
|
-
translateRect(pen.calculative.worldRect, 0, frame[k] * process *
|
|
2520
|
+
translateRect(pen.calculative.worldRect, 0, frame[k] * process * scale);
|
|
2521
|
+
pen.calculative.patchFlags = true;
|
|
2522
|
+
}
|
|
2523
|
+
else if (k === 'width') {
|
|
2524
|
+
//仅考虑抽屉效果
|
|
2525
|
+
const lastVal = getFrameValue(pen, k, pen.calculative.frameIndex) * scale;
|
|
2526
|
+
pen.calculative.worldRect.width = pen.calculative.initRect.width + lastVal;
|
|
2527
|
+
pen.calculative.worldRect.ex = pen.calculative.initRect.ex + lastVal;
|
|
2528
|
+
pen.calculative.worldRect.center.x = pen.calculative.initRect.center.x + lastVal;
|
|
2529
|
+
let value = frame[k] * process * scale;
|
|
2530
|
+
pen.calculative.worldRect.width += value;
|
|
2531
|
+
pen.calculative.worldRect.ex += value;
|
|
2532
|
+
pen.calculative.worldRect.center.x += value;
|
|
2533
|
+
pen.calculative.patchFlags = true;
|
|
2534
|
+
}
|
|
2535
|
+
else if (k === 'height') {
|
|
2536
|
+
const lastVal = getFrameValue(pen, k, pen.calculative.frameIndex) * scale;
|
|
2537
|
+
pen.calculative.worldRect.height = pen.calculative.initRect.height + lastVal;
|
|
2538
|
+
pen.calculative.worldRect.ey = pen.calculative.initRect.ey + lastVal;
|
|
2539
|
+
pen.calculative.worldRect.center.y = pen.calculative.initRect.center.y + lastVal;
|
|
2540
|
+
let value = frame[k] * process * scale;
|
|
2541
|
+
pen.calculative.worldRect.height += value;
|
|
2542
|
+
pen.calculative.worldRect.ey += value;
|
|
2543
|
+
pen.calculative.worldRect.center.y += value;
|
|
2520
2544
|
pen.calculative.patchFlags = true;
|
|
2521
2545
|
}
|
|
2522
2546
|
else if (k === 'rotate') {
|