@breadstone/mosaik-elements-svelte 0.0.49 → 0.0.51
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/index.mjs +51 -40
- package/package.json +3 -3
package/index.mjs
CHANGED
|
@@ -92962,7 +92962,7 @@ ba = ns([
|
|
|
92962
92962
|
vo("design:paramtypes", [])
|
|
92963
92963
|
], ba);
|
|
92964
92964
|
/*!
|
|
92965
|
-
* Signature Pad v5.0.
|
|
92965
|
+
* Signature Pad v5.0.10 | https://github.com/szimek/signature_pad
|
|
92966
92966
|
* (c) 2025 Szymon Nowak | Released under the MIT license
|
|
92967
92967
|
*/
|
|
92968
92968
|
class $b {
|
|
@@ -93043,45 +93043,11 @@ function rV(o, e = 250) {
|
|
|
93043
93043
|
class Tb extends oV {
|
|
93044
93044
|
constructor(e, t = {}) {
|
|
93045
93045
|
var r, n, a;
|
|
93046
|
-
super(), this.canvas = e, this._drawingStroke = !1, this._isEmpty = !0, this._lastPoints = [], this._data = [], this._lastVelocity = 0, this._lastWidth = 0, this._handleMouseDown = (
|
|
93047
|
-
!this._isLeftButtonPressed(i, !0) || this._drawingStroke || this._strokeBegin(this._pointerEventToSignatureEvent(i));
|
|
93048
|
-
}, this._handleMouseMove = (i) => {
|
|
93049
|
-
if (!this._isLeftButtonPressed(i, !0) || !this._drawingStroke) {
|
|
93050
|
-
this._strokeEnd(this._pointerEventToSignatureEvent(i), !1);
|
|
93051
|
-
return;
|
|
93052
|
-
}
|
|
93053
|
-
this._strokeMoveUpdate(this._pointerEventToSignatureEvent(i));
|
|
93054
|
-
}, this._handleMouseUp = (i) => {
|
|
93055
|
-
this._isLeftButtonPressed(i) || this._strokeEnd(this._pointerEventToSignatureEvent(i));
|
|
93056
|
-
}, this._handleTouchStart = (i) => {
|
|
93057
|
-
i.targetTouches.length !== 1 || this._drawingStroke || (i.cancelable && i.preventDefault(), this._strokeBegin(this._touchEventToSignatureEvent(i)));
|
|
93058
|
-
}, this._handleTouchMove = (i) => {
|
|
93059
|
-
if (i.targetTouches.length === 1) {
|
|
93060
|
-
if (i.cancelable && i.preventDefault(), !this._drawingStroke) {
|
|
93061
|
-
this._strokeEnd(this._touchEventToSignatureEvent(i), !1);
|
|
93062
|
-
return;
|
|
93063
|
-
}
|
|
93064
|
-
this._strokeMoveUpdate(this._touchEventToSignatureEvent(i));
|
|
93065
|
-
}
|
|
93066
|
-
}, this._handleTouchEnd = (i) => {
|
|
93067
|
-
i.targetTouches.length === 0 && (i.cancelable && i.preventDefault(), this._strokeEnd(this._touchEventToSignatureEvent(i)));
|
|
93068
|
-
}, this._handlePointerDown = (i) => {
|
|
93069
|
-
!i.isPrimary || !this._isLeftButtonPressed(i) || this._drawingStroke || typeof this._strokePointerId < "u" && this._strokePointerId !== this._getPointerId(i) || (this._strokePointerId = this._getPointerId(i), i.preventDefault(), this._strokeBegin(this._pointerEventToSignatureEvent(i)));
|
|
93070
|
-
}, this._handlePointerMove = (i) => {
|
|
93071
|
-
if (!(!i.isPrimary || this._strokePointerId !== this._getPointerId(i))) {
|
|
93072
|
-
if (!this._isLeftButtonPressed(i, !0) || !this._drawingStroke) {
|
|
93073
|
-
this._strokeEnd(this._pointerEventToSignatureEvent(i), !1);
|
|
93074
|
-
return;
|
|
93075
|
-
}
|
|
93076
|
-
i.preventDefault(), this._strokeMoveUpdate(this._pointerEventToSignatureEvent(i));
|
|
93077
|
-
}
|
|
93078
|
-
}, this._handlePointerUp = (i) => {
|
|
93079
|
-
!i.isPrimary || this._isLeftButtonPressed(i) || this._strokePointerId !== this._getPointerId(i) || (this._strokePointerId = void 0, i.preventDefault(), this._strokeEnd(this._pointerEventToSignatureEvent(i)));
|
|
93080
|
-
}, this.velocityFilterWeight = t.velocityFilterWeight || 0.7, this.minWidth = t.minWidth || 0.5, this.maxWidth = t.maxWidth || 2.5, this.throttle = (r = t.throttle) !== null && r !== void 0 ? r : 16, this.minDistance = (n = t.minDistance) !== null && n !== void 0 ? n : 5, this.dotSize = t.dotSize || 0, this.penColor = t.penColor || "black", this.backgroundColor = t.backgroundColor || "rgba(0,0,0,0)", this.compositeOperation = t.compositeOperation || "source-over", this.canvasContextOptions = (a = t.canvasContextOptions) !== null && a !== void 0 ? a : {}, this._strokeMoveUpdate = this.throttle ? rV(Tb.prototype._strokeUpdate, this.throttle) : Tb.prototype._strokeUpdate, this._ctx = e.getContext("2d", this.canvasContextOptions), this.clear(), this.on();
|
|
93046
|
+
super(), this.canvas = e, this._drawingStroke = !1, this._isEmpty = !0, this._lastPoints = [], this._data = [], this._lastVelocity = 0, this._lastWidth = 0, this.velocityFilterWeight = t.velocityFilterWeight || 0.7, this.minWidth = t.minWidth || 0.5, this.maxWidth = t.maxWidth || 2.5, this.throttle = (r = t.throttle) !== null && r !== void 0 ? r : 16, this.minDistance = (n = t.minDistance) !== null && n !== void 0 ? n : 5, this.dotSize = t.dotSize || 0, this.penColor = t.penColor || "black", this.backgroundColor = t.backgroundColor || "rgba(0,0,0,0)", this.compositeOperation = t.compositeOperation || "source-over", this.canvasContextOptions = (a = t.canvasContextOptions) !== null && a !== void 0 ? a : {}, this._strokeMoveUpdate = this.throttle ? rV(Tb.prototype._strokeUpdate, this.throttle) : Tb.prototype._strokeUpdate, this._handleMouseDown = this._handleMouseDown.bind(this), this._handleMouseMove = this._handleMouseMove.bind(this), this._handleMouseUp = this._handleMouseUp.bind(this), this._handleTouchStart = this._handleTouchStart.bind(this), this._handleTouchMove = this._handleTouchMove.bind(this), this._handleTouchEnd = this._handleTouchEnd.bind(this), this._handlePointerDown = this._handlePointerDown.bind(this), this._handlePointerMove = this._handlePointerMove.bind(this), this._handlePointerUp = this._handlePointerUp.bind(this), this._ctx = e.getContext("2d", this.canvasContextOptions), this.clear(), this.on();
|
|
93081
93047
|
}
|
|
93082
93048
|
clear() {
|
|
93083
93049
|
const { _ctx: e, canvas: t } = this;
|
|
93084
|
-
e.fillStyle = this.backgroundColor, e.clearRect(0, 0, t.width, t.height), e.fillRect(0, 0, t.width, t.height), this._data = [], this._reset(this._getPointGroupOptions()), this._isEmpty = !0;
|
|
93050
|
+
e.fillStyle = this.backgroundColor, e.clearRect(0, 0, t.width, t.height), e.fillRect(0, 0, t.width, t.height), this._data = [], this._reset(this._getPointGroupOptions()), this._isEmpty = !0, this._strokePointerId = void 0;
|
|
93085
93051
|
}
|
|
93086
93052
|
fromDataURL(e, t = {}) {
|
|
93087
93053
|
return new Promise((r, n) => {
|
|
@@ -93152,9 +93118,55 @@ class Tb extends oV {
|
|
|
93152
93118
|
pressure: t.force
|
|
93153
93119
|
};
|
|
93154
93120
|
}
|
|
93121
|
+
_handleMouseDown(e) {
|
|
93122
|
+
!this._isLeftButtonPressed(e, !0) || this._drawingStroke || this._strokeBegin(this._pointerEventToSignatureEvent(e));
|
|
93123
|
+
}
|
|
93124
|
+
_handleMouseMove(e) {
|
|
93125
|
+
if (!this._isLeftButtonPressed(e, !0) || !this._drawingStroke) {
|
|
93126
|
+
this._strokeEnd(this._pointerEventToSignatureEvent(e), !1);
|
|
93127
|
+
return;
|
|
93128
|
+
}
|
|
93129
|
+
this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e));
|
|
93130
|
+
}
|
|
93131
|
+
_handleMouseUp(e) {
|
|
93132
|
+
this._isLeftButtonPressed(e) || this._strokeEnd(this._pointerEventToSignatureEvent(e));
|
|
93133
|
+
}
|
|
93134
|
+
_handleTouchStart(e) {
|
|
93135
|
+
e.targetTouches.length !== 1 || this._drawingStroke || (e.cancelable && e.preventDefault(), this._strokeBegin(this._touchEventToSignatureEvent(e)));
|
|
93136
|
+
}
|
|
93137
|
+
_handleTouchMove(e) {
|
|
93138
|
+
if (e.targetTouches.length === 1) {
|
|
93139
|
+
if (e.cancelable && e.preventDefault(), !this._drawingStroke) {
|
|
93140
|
+
this._strokeEnd(this._touchEventToSignatureEvent(e), !1);
|
|
93141
|
+
return;
|
|
93142
|
+
}
|
|
93143
|
+
this._strokeMoveUpdate(this._touchEventToSignatureEvent(e));
|
|
93144
|
+
}
|
|
93145
|
+
}
|
|
93146
|
+
_handleTouchEnd(e) {
|
|
93147
|
+
e.targetTouches.length === 0 && (e.cancelable && e.preventDefault(), this._strokeEnd(this._touchEventToSignatureEvent(e)));
|
|
93148
|
+
}
|
|
93155
93149
|
_getPointerId(e) {
|
|
93156
93150
|
return e.persistentDeviceId || e.pointerId;
|
|
93157
93151
|
}
|
|
93152
|
+
_allowPointerId(e, t = !1) {
|
|
93153
|
+
return typeof this._strokePointerId > "u" ? t : this._getPointerId(e) === this._strokePointerId;
|
|
93154
|
+
}
|
|
93155
|
+
_handlePointerDown(e) {
|
|
93156
|
+
this._drawingStroke || !this._isLeftButtonPressed(e) || !this._allowPointerId(e, !0) || (this._strokePointerId = this._getPointerId(e), e.preventDefault(), this._strokeBegin(this._pointerEventToSignatureEvent(e)));
|
|
93157
|
+
}
|
|
93158
|
+
_handlePointerMove(e) {
|
|
93159
|
+
if (this._allowPointerId(e)) {
|
|
93160
|
+
if (!this._isLeftButtonPressed(e, !0) || !this._drawingStroke) {
|
|
93161
|
+
this._strokeEnd(this._pointerEventToSignatureEvent(e), !1);
|
|
93162
|
+
return;
|
|
93163
|
+
}
|
|
93164
|
+
e.preventDefault(), this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e));
|
|
93165
|
+
}
|
|
93166
|
+
}
|
|
93167
|
+
_handlePointerUp(e) {
|
|
93168
|
+
this._isLeftButtonPressed(e) || !this._allowPointerId(e) || (e.preventDefault(), this._strokeEnd(this._pointerEventToSignatureEvent(e)));
|
|
93169
|
+
}
|
|
93158
93170
|
_getPointGroupOptions(e) {
|
|
93159
93171
|
return {
|
|
93160
93172
|
penColor: e && "penColor" in e ? e.penColor : this.penColor,
|
|
@@ -93213,7 +93225,7 @@ class Tb extends oV {
|
|
|
93213
93225
|
this.dispatchEvent(new CustomEvent("afterUpdateStroke", { detail: e }));
|
|
93214
93226
|
}
|
|
93215
93227
|
_strokeEnd(e, t = !0) {
|
|
93216
|
-
this._removeMoveUpEventListeners(), this._drawingStroke && (t && this._strokeUpdate(e), this._drawingStroke = !1, this.dispatchEvent(new CustomEvent("endStroke", { detail: e })));
|
|
93228
|
+
this._removeMoveUpEventListeners(), this._drawingStroke && (t && this._strokeUpdate(e), this._drawingStroke = !1, this._strokePointerId = void 0, this.dispatchEvent(new CustomEvent("endStroke", { detail: e })));
|
|
93217
93229
|
}
|
|
93218
93230
|
_handlePointerEvents() {
|
|
93219
93231
|
this._drawingStroke = !1, this.canvas.addEventListener("pointerdown", this._handlePointerDown, {
|
|
@@ -156149,9 +156161,9 @@ function $rt(o) {
|
|
|
156149
156161
|
.dir="${o.dir}"
|
|
156150
156162
|
.fit="${En.Both}"
|
|
156151
156163
|
.hasBackdrop="${o.isMobile}">
|
|
156152
|
-
${O(o.hasNav, () => k`
|
|
156153
156164
|
<mosaik-drawer slot="drawer"
|
|
156154
156165
|
part="drawer"
|
|
156166
|
+
.hidden="${o.hasNav}"
|
|
156155
156167
|
.lang="${o.lang}"
|
|
156156
156168
|
.dir="${o.dir}"
|
|
156157
156169
|
.isOpen="${o.isNavOpen}"
|
|
@@ -156162,7 +156174,6 @@ function $rt(o) {
|
|
|
156162
156174
|
<slot name="nav"></slot>
|
|
156163
156175
|
</nav>
|
|
156164
156176
|
</mosaik-drawer>
|
|
156165
|
-
`)}
|
|
156166
156177
|
<mosaik-drawer-content slot="content"
|
|
156167
156178
|
.lang="${o.lang}"
|
|
156168
156179
|
.dir="${o.dir}">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@breadstone/mosaik-elements-svelte",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.51",
|
|
4
4
|
"description": "Mosaik elements for Svelte.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "andre.wehlert <awehlert@breadstone.de> (https://www.breadstone.de)",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"svelte": "^5.34.7"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@breadstone/mosaik-elements": "^0.0.
|
|
18
|
-
"@breadstone/mosaik-elements-foundation": "^0.0.
|
|
17
|
+
"@breadstone/mosaik-elements": "^0.0.51",
|
|
18
|
+
"@breadstone/mosaik-elements-foundation": "^0.0.51",
|
|
19
19
|
"tslib": "^2.8.1"
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|