@lottiefiles/dotlottie-svelte 0.9.12 → 0.10.0
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/Dotlottie.svelte +279 -209
- package/dist/Dotlottie.svelte.d.ts +20 -37
- package/package.json +22 -13
package/dist/Dotlottie.svelte
CHANGED
|
@@ -1,213 +1,283 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { type Config, DotLottie } from '@lottiefiles/dotlottie-web';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
2
|
+
import { type Config, DotLottie } from '@lottiefiles/dotlottie-web';
|
|
3
|
+
import { untrack } from 'svelte';
|
|
4
|
+
|
|
5
|
+
interface DotLottieSvelteProps {
|
|
6
|
+
autoplay?: Config['autoplay'];
|
|
7
|
+
backgroundColor?: Config['backgroundColor'];
|
|
8
|
+
data?: Config['data'];
|
|
9
|
+
loop?: Config['loop'];
|
|
10
|
+
mode?: Config['mode'];
|
|
11
|
+
renderConfig?: Config['renderConfig'];
|
|
12
|
+
segment?: Config['segment'];
|
|
13
|
+
speed?: Config['speed'];
|
|
14
|
+
src?: Config['src'];
|
|
15
|
+
useFrameInterpolation?: Config['useFrameInterpolation'];
|
|
16
|
+
marker?: Config['marker'];
|
|
17
|
+
layout?: Config['layout'];
|
|
18
|
+
animationId?: Config['animationId'];
|
|
19
|
+
themeId?: Config['themeId'];
|
|
20
|
+
stateMachineId?: Config['stateMachineId'];
|
|
21
|
+
stateMachineConfig?: Config['stateMachineConfig'];
|
|
22
|
+
playOnHover?: boolean;
|
|
23
|
+
themeData?: string;
|
|
24
|
+
dotLottieRefCallback?: (dotLottie: DotLottie) => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let {
|
|
28
|
+
autoplay = false,
|
|
29
|
+
backgroundColor = undefined,
|
|
30
|
+
data = undefined,
|
|
31
|
+
loop = false,
|
|
32
|
+
mode = 'forward',
|
|
33
|
+
renderConfig = undefined,
|
|
34
|
+
segment = undefined,
|
|
35
|
+
speed = 1,
|
|
36
|
+
src = undefined,
|
|
37
|
+
useFrameInterpolation = true,
|
|
38
|
+
marker = undefined,
|
|
39
|
+
layout = undefined,
|
|
40
|
+
animationId = '',
|
|
41
|
+
themeId = '',
|
|
42
|
+
stateMachineId = undefined,
|
|
43
|
+
stateMachineConfig = undefined,
|
|
44
|
+
playOnHover = false,
|
|
45
|
+
themeData = '',
|
|
46
|
+
dotLottieRefCallback = () => {}
|
|
47
|
+
}: DotLottieSvelteProps = $props();
|
|
48
|
+
|
|
49
|
+
let canvas: HTMLCanvasElement;
|
|
50
|
+
let dotLottie: DotLottie | undefined = $state(undefined);
|
|
51
|
+
let prevSrc: Config['src'];
|
|
52
|
+
let prevData: Config['data'];
|
|
53
|
+
|
|
54
|
+
// Initialize DotLottie instance once when canvas is ready.
|
|
55
|
+
// Use untrack() to read initial prop values without establishing reactive dependencies —
|
|
56
|
+
// prop changes are handled by separate $effect blocks below.
|
|
57
|
+
$effect(() => {
|
|
58
|
+
const currentCanvas = canvas;
|
|
59
|
+
if (!currentCanvas) return;
|
|
60
|
+
|
|
61
|
+
const instance = new DotLottie(
|
|
62
|
+
untrack(() => ({
|
|
63
|
+
canvas: currentCanvas,
|
|
64
|
+
src,
|
|
65
|
+
autoplay: autoplay && !playOnHover,
|
|
66
|
+
loop,
|
|
67
|
+
speed,
|
|
68
|
+
data,
|
|
69
|
+
renderConfig,
|
|
70
|
+
segment,
|
|
71
|
+
useFrameInterpolation,
|
|
72
|
+
backgroundColor,
|
|
73
|
+
mode,
|
|
74
|
+
animationId,
|
|
75
|
+
themeId,
|
|
76
|
+
stateMachineId,
|
|
77
|
+
stateMachineConfig
|
|
78
|
+
}))
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
dotLottie = instance;
|
|
82
|
+
untrack(() => dotLottieRefCallback?.(instance));
|
|
83
|
+
|
|
84
|
+
return () => {
|
|
85
|
+
instance.destroy();
|
|
86
|
+
dotLottie = undefined;
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// Hover handler — re-registers listeners whenever playOnHover or dotLottie changes.
|
|
91
|
+
// Capture the canvas element locally so cleanup detaches listeners from the same
|
|
92
|
+
// node we attached to, even if `canvas` rebinds later.
|
|
93
|
+
$effect(() => {
|
|
94
|
+
const currentPlayOnHover = playOnHover;
|
|
95
|
+
const currentDotLottie = dotLottie;
|
|
96
|
+
const currentCanvas = canvas;
|
|
97
|
+
|
|
98
|
+
if (!currentCanvas) return;
|
|
99
|
+
|
|
100
|
+
const handlePlayOnHover = (event: MouseEvent): void => {
|
|
101
|
+
if (!currentPlayOnHover || !currentDotLottie?.isLoaded) return;
|
|
102
|
+
if (event.type === 'mouseenter') {
|
|
103
|
+
currentDotLottie.play();
|
|
104
|
+
} else if (event.type === 'mouseleave') {
|
|
105
|
+
currentDotLottie.pause();
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
currentCanvas.addEventListener('mouseenter', handlePlayOnHover);
|
|
110
|
+
currentCanvas.addEventListener('mouseleave', handlePlayOnHover);
|
|
111
|
+
|
|
112
|
+
return () => {
|
|
113
|
+
currentCanvas.removeEventListener('mouseenter', handlePlayOnHover);
|
|
114
|
+
currentCanvas.removeEventListener('mouseleave', handlePlayOnHover);
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
$effect(() => {
|
|
119
|
+
if (dotLottie && typeof layout === 'object') {
|
|
120
|
+
dotLottie.setLayout(layout);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
$effect(() => {
|
|
125
|
+
if (dotLottie && typeof marker === 'string') {
|
|
126
|
+
dotLottie.setMarker(marker);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
$effect(() => {
|
|
131
|
+
const currentSpeed = speed;
|
|
132
|
+
if (dotLottie && typeof currentSpeed === 'number') {
|
|
133
|
+
dotLottie.setSpeed(currentSpeed);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
$effect(() => {
|
|
138
|
+
const currentUseFrameInterpolation = useFrameInterpolation;
|
|
139
|
+
if (dotLottie && typeof currentUseFrameInterpolation === 'boolean') {
|
|
140
|
+
dotLottie.setUseFrameInterpolation(currentUseFrameInterpolation);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
$effect(() => {
|
|
145
|
+
const currentSegment = segment;
|
|
146
|
+
if (
|
|
147
|
+
dotLottie &&
|
|
148
|
+
Array.isArray(currentSegment) &&
|
|
149
|
+
currentSegment.length === 2 &&
|
|
150
|
+
typeof currentSegment[0] === 'number' &&
|
|
151
|
+
typeof currentSegment[1] === 'number'
|
|
152
|
+
) {
|
|
153
|
+
const [start, end] = currentSegment;
|
|
154
|
+
dotLottie.setSegment(start, end);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
$effect(() => {
|
|
159
|
+
const currentLoop = loop;
|
|
160
|
+
if (dotLottie && typeof currentLoop === 'boolean') {
|
|
161
|
+
dotLottie.setLoop(currentLoop);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
$effect(() => {
|
|
166
|
+
if (dotLottie) {
|
|
167
|
+
dotLottie.setBackgroundColor(backgroundColor || '');
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
$effect(() => {
|
|
172
|
+
const currentMode = mode;
|
|
173
|
+
if (dotLottie && typeof currentMode === 'string') {
|
|
174
|
+
dotLottie.setMode(currentMode);
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
$effect(() => {
|
|
179
|
+
if (dotLottie) {
|
|
180
|
+
dotLottie.setRenderConfig(renderConfig ?? {});
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
$effect(() => {
|
|
185
|
+
if (dotLottie && typeof src === 'string' && src !== prevSrc) {
|
|
186
|
+
prevSrc = src;
|
|
187
|
+
dotLottie.load({
|
|
188
|
+
src,
|
|
189
|
+
...untrack(() => ({
|
|
190
|
+
autoplay,
|
|
191
|
+
loop,
|
|
192
|
+
speed,
|
|
193
|
+
data,
|
|
194
|
+
renderConfig,
|
|
195
|
+
segment,
|
|
196
|
+
useFrameInterpolation,
|
|
197
|
+
backgroundColor,
|
|
198
|
+
mode,
|
|
199
|
+
marker,
|
|
200
|
+
layout,
|
|
201
|
+
animationId,
|
|
202
|
+
themeId,
|
|
203
|
+
stateMachineId,
|
|
204
|
+
stateMachineConfig
|
|
205
|
+
}))
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
$effect(() => {
|
|
211
|
+
if (
|
|
212
|
+
dotLottie &&
|
|
213
|
+
(typeof data === 'string' || typeof data === 'object') &&
|
|
214
|
+
data !== undefined &&
|
|
215
|
+
data !== prevData
|
|
216
|
+
) {
|
|
217
|
+
prevData = data;
|
|
218
|
+
dotLottie.load({
|
|
219
|
+
data,
|
|
220
|
+
...untrack(() => ({
|
|
221
|
+
src,
|
|
222
|
+
autoplay,
|
|
223
|
+
loop,
|
|
224
|
+
speed,
|
|
225
|
+
renderConfig,
|
|
226
|
+
segment,
|
|
227
|
+
useFrameInterpolation,
|
|
228
|
+
backgroundColor,
|
|
229
|
+
mode,
|
|
230
|
+
marker,
|
|
231
|
+
layout,
|
|
232
|
+
animationId,
|
|
233
|
+
themeId,
|
|
234
|
+
stateMachineId,
|
|
235
|
+
stateMachineConfig
|
|
236
|
+
}))
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
$effect(() => {
|
|
242
|
+
const currentAnimationId = animationId;
|
|
243
|
+
if (dotLottie) {
|
|
244
|
+
dotLottie.loadAnimation(currentAnimationId);
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
$effect(() => {
|
|
249
|
+
const currentThemeId = themeId;
|
|
250
|
+
if (dotLottie) {
|
|
251
|
+
dotLottie.setTheme(currentThemeId);
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
$effect(() => {
|
|
256
|
+
const currentThemeData = themeData;
|
|
257
|
+
if (dotLottie) {
|
|
258
|
+
dotLottie.setThemeData(currentThemeData);
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
$effect(() => {
|
|
263
|
+
const currentStateMachineId = stateMachineId;
|
|
264
|
+
if (dotLottie && dotLottie.isLoaded) {
|
|
265
|
+
if (typeof currentStateMachineId === 'string' && currentStateMachineId) {
|
|
266
|
+
const smLoaded = dotLottie.stateMachineLoad(currentStateMachineId);
|
|
267
|
+
if (smLoaded) {
|
|
268
|
+
dotLottie.stateMachineStart();
|
|
269
|
+
}
|
|
270
|
+
} else {
|
|
271
|
+
dotLottie.stateMachineStop();
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
$effect(() => {
|
|
277
|
+
if (dotLottie) {
|
|
278
|
+
dotLottie.stateMachineSetConfig(stateMachineConfig ?? null);
|
|
279
|
+
}
|
|
280
|
+
});
|
|
211
281
|
</script>
|
|
212
282
|
|
|
213
283
|
<div>
|
|
@@ -1,42 +1,25 @@
|
|
|
1
1
|
import { type Config, DotLottie } from '@lottiefiles/dotlottie-web';
|
|
2
|
-
interface
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
data?: Config["data"];
|
|
20
|
-
loop?: Config["loop"];
|
|
21
|
-
mode?: Config["mode"];
|
|
22
|
-
renderConfig?: Config["renderConfig"];
|
|
23
|
-
segment?: Config["segment"];
|
|
24
|
-
speed?: Config["speed"];
|
|
25
|
-
src?: Config["src"];
|
|
26
|
-
useFrameInterpolation?: Config["useFrameInterpolation"];
|
|
27
|
-
marker?: Config["marker"];
|
|
28
|
-
layout?: Config["layout"];
|
|
29
|
-
animationId?: Config["animationId"];
|
|
30
|
-
themeId?: Config["themeId"];
|
|
31
|
-
stateMachineId?: Config["stateMachineId"];
|
|
32
|
-
stateMachineConfig?: Config["stateMachineConfig"];
|
|
2
|
+
interface DotLottieSvelteProps {
|
|
3
|
+
autoplay?: Config['autoplay'];
|
|
4
|
+
backgroundColor?: Config['backgroundColor'];
|
|
5
|
+
data?: Config['data'];
|
|
6
|
+
loop?: Config['loop'];
|
|
7
|
+
mode?: Config['mode'];
|
|
8
|
+
renderConfig?: Config['renderConfig'];
|
|
9
|
+
segment?: Config['segment'];
|
|
10
|
+
speed?: Config['speed'];
|
|
11
|
+
src?: Config['src'];
|
|
12
|
+
useFrameInterpolation?: Config['useFrameInterpolation'];
|
|
13
|
+
marker?: Config['marker'];
|
|
14
|
+
layout?: Config['layout'];
|
|
15
|
+
animationId?: Config['animationId'];
|
|
16
|
+
themeId?: Config['themeId'];
|
|
17
|
+
stateMachineId?: Config['stateMachineId'];
|
|
18
|
+
stateMachineConfig?: Config['stateMachineConfig'];
|
|
33
19
|
playOnHover?: boolean;
|
|
34
20
|
themeData?: string;
|
|
35
21
|
dotLottieRefCallback?: (dotLottie: DotLottie) => void;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
setWasmUrl: (url: string) => void;
|
|
40
|
-
}, string>;
|
|
41
|
-
type Dotlottie = InstanceType<typeof Dotlottie>;
|
|
22
|
+
}
|
|
23
|
+
declare const Dotlottie: import("svelte").Component<DotLottieSvelteProps, {}, "">;
|
|
24
|
+
type Dotlottie = ReturnType<typeof Dotlottie>;
|
|
42
25
|
export default Dotlottie;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lottiefiles/dotlottie-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Svelte component wrapper around the dotlottie-web library to render Lottie and dotLottie animations",
|
|
6
6
|
"repository": {
|
|
@@ -32,23 +32,29 @@
|
|
|
32
32
|
],
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"svelte": "^
|
|
35
|
+
"svelte": "^5.0.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@lottiefiles/dotlottie-web": "0.
|
|
38
|
+
"@lottiefiles/dotlottie-web": "0.72.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@sveltejs/adapter-auto": "^
|
|
42
|
-
"@sveltejs/kit": "^2.
|
|
43
|
-
"@sveltejs/package": "^2.
|
|
44
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
41
|
+
"@sveltejs/adapter-auto": "^7.0.1",
|
|
42
|
+
"@sveltejs/kit": "^2.58.0",
|
|
43
|
+
"@sveltejs/package": "^2.5.7",
|
|
44
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
45
|
+
"@testing-library/user-event": "^14.5.2",
|
|
46
|
+
"@types/node": "^25.6.0",
|
|
47
|
+
"@vitest/browser": "^4.0.18",
|
|
48
|
+
"@vitest/browser-playwright": "^4.0.18",
|
|
49
|
+
"@vitest/coverage-istanbul": "^4.0.18",
|
|
50
|
+
"publint": "^0.3.17",
|
|
51
|
+
"svelte": "^5.55.5",
|
|
52
|
+
"svelte-check": "^4.4.6",
|
|
48
53
|
"tslib": "^2.4.1",
|
|
49
|
-
"typescript": "
|
|
50
|
-
"vite": "^
|
|
51
|
-
"vitest": "^4.0.18"
|
|
54
|
+
"typescript": "6.0.3",
|
|
55
|
+
"vite": "^7.3.1",
|
|
56
|
+
"vitest": "^4.0.18",
|
|
57
|
+
"vitest-browser-svelte": "^2.0.2"
|
|
52
58
|
},
|
|
53
59
|
"sideEffects": false,
|
|
54
60
|
"publishConfig": {
|
|
@@ -65,6 +71,9 @@
|
|
|
65
71
|
"lint": "biome check .",
|
|
66
72
|
"format": "biome check --write .",
|
|
67
73
|
"stats:ts": "tsc -p tsconfig.build.json --extendedDiagnostics",
|
|
74
|
+
"test": "vitest run --browser.headless",
|
|
75
|
+
"test:coverage": "vitest run --browser.headless --coverage",
|
|
76
|
+
"test:watch": "vitest",
|
|
68
77
|
"type-check": "tsc --noEmit"
|
|
69
78
|
}
|
|
70
79
|
}
|