@inweb/markup 25.8.7 → 25.8.9
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/dist/markup.js +11 -10
- package/dist/markup.js.map +1 -1
- package/dist/markup.min.js +1 -1
- package/dist/markup.module.js +11 -10
- package/dist/markup.module.js.map +1 -1
- package/lib/markup/Konva/KonvaImage.d.ts +2 -2
- package/package.json +3 -3
- package/src/markup/Konva/KonvaArrow.ts +1 -1
- package/src/markup/Konva/KonvaCloud.ts +1 -1
- package/src/markup/Konva/KonvaEllipse.ts +1 -1
- package/src/markup/Konva/KonvaImage.ts +11 -4
- package/src/markup/Konva/KonvaLine.ts +8 -2
- package/src/markup/Konva/KonvaMarkup.ts +1 -1
- package/src/markup/Konva/KonvaRectangle.ts +1 -1
- package/src/markup/Konva/KonvaText.ts +1 -1
package/dist/markup.js
CHANGED
|
@@ -11571,7 +11571,7 @@
|
|
|
11571
11571
|
this._ref = ref;
|
|
11572
11572
|
return;
|
|
11573
11573
|
}
|
|
11574
|
-
if (!params.points)
|
|
11574
|
+
if (!params || !params.points)
|
|
11575
11575
|
return;
|
|
11576
11576
|
const konvaPoints = [];
|
|
11577
11577
|
params.points.forEach((point) => konvaPoints.push(point.x, point.y));
|
|
@@ -11674,7 +11674,7 @@
|
|
|
11674
11674
|
this._ref = ref;
|
|
11675
11675
|
return;
|
|
11676
11676
|
}
|
|
11677
|
-
if (!params || !params.text)
|
|
11677
|
+
if (!params || !params.position || !params.text)
|
|
11678
11678
|
return;
|
|
11679
11679
|
this._ref = new Konva.Text({
|
|
11680
11680
|
x: params.position.x,
|
|
@@ -11776,7 +11776,7 @@
|
|
|
11776
11776
|
this._ref = ref;
|
|
11777
11777
|
return;
|
|
11778
11778
|
}
|
|
11779
|
-
if (!params.position)
|
|
11779
|
+
if (!params || !params.position)
|
|
11780
11780
|
return;
|
|
11781
11781
|
this._ref = new Konva.Rect({
|
|
11782
11782
|
stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
|
|
@@ -11886,7 +11886,7 @@
|
|
|
11886
11886
|
this._ref = ref;
|
|
11887
11887
|
return;
|
|
11888
11888
|
}
|
|
11889
|
-
if (!params.position)
|
|
11889
|
+
if (!params || !params.position || !params.radius)
|
|
11890
11890
|
return;
|
|
11891
11891
|
this._ref = new Konva.Ellipse({
|
|
11892
11892
|
stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
|
|
@@ -12002,7 +12002,7 @@
|
|
|
12002
12002
|
this._ref = ref;
|
|
12003
12003
|
return;
|
|
12004
12004
|
}
|
|
12005
|
-
if (!params.start || !params.end)
|
|
12005
|
+
if (!params || !params.start || !params.end)
|
|
12006
12006
|
return;
|
|
12007
12007
|
this._ref = new Konva.Arrow({
|
|
12008
12008
|
stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
|
|
@@ -12089,6 +12089,7 @@
|
|
|
12089
12089
|
|
|
12090
12090
|
class KonvaImage {
|
|
12091
12091
|
constructor(params, ref = null) {
|
|
12092
|
+
var _a, _b;
|
|
12092
12093
|
this._ratio = 1;
|
|
12093
12094
|
if (ref) {
|
|
12094
12095
|
if (ref.height() === 0 || ref.width() === 0)
|
|
@@ -12098,15 +12099,15 @@
|
|
|
12098
12099
|
this._ratio = this._ref.height() / this._ref.width();
|
|
12099
12100
|
return;
|
|
12100
12101
|
}
|
|
12101
|
-
if (!params.position || !params.src)
|
|
12102
|
+
if (!params || !params.position || !params.src)
|
|
12102
12103
|
return;
|
|
12103
12104
|
this._canvasImage = new Image();
|
|
12104
12105
|
this._ref = new Konva.Image({
|
|
12105
12106
|
x: params.position.x,
|
|
12106
12107
|
y: params.position.y,
|
|
12107
12108
|
image: this._canvasImage,
|
|
12108
|
-
width: params.width,
|
|
12109
|
-
height: params.height,
|
|
12109
|
+
width: (_a = params.width) !== null && _a !== void 0 ? _a : 0,
|
|
12110
|
+
height: (_b = params.height) !== null && _b !== void 0 ? _b : 0,
|
|
12110
12111
|
draggable: true,
|
|
12111
12112
|
});
|
|
12112
12113
|
this._canvasImage.onload = () => {
|
|
@@ -12215,7 +12216,7 @@
|
|
|
12215
12216
|
this._ref = ref;
|
|
12216
12217
|
return;
|
|
12217
12218
|
}
|
|
12218
|
-
if (!params
|
|
12219
|
+
if (!params || !params.position)
|
|
12219
12220
|
return;
|
|
12220
12221
|
const arcRadius = 16;
|
|
12221
12222
|
this._ref = new Konva.Shape({
|
|
@@ -12410,7 +12411,7 @@
|
|
|
12410
12411
|
},
|
|
12411
12412
|
Cloud: {
|
|
12412
12413
|
name: "Cloud",
|
|
12413
|
-
initializer: (ref) => new KonvaCloud(
|
|
12414
|
+
initializer: (ref, params = null) => new KonvaCloud(params, ref),
|
|
12414
12415
|
zIndex: 1,
|
|
12415
12416
|
},
|
|
12416
12417
|
};
|