File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed
packages/vite-plugin-svelte-inspector/src/runtime Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @sveltejs/vite-plugin-svelte-inspector ' : patch
3
+ ---
4
+
5
+ fix(inspector): migrate client component to runes and force runes mode"
Original file line number Diff line number Diff line change
1
+ <svelte:options runes ={true } />
2
+
1
3
<script >
2
4
// do not use TS here so that this component works in non-ts projects too
3
5
import { onMount } from ' svelte' ;
8
10
const nav_keys = Object .values (options .navKeys ).map ((k ) => k? .toLowerCase ());
9
11
const open_key = options .openKey ? .toLowerCase ();
10
12
11
- let enabled = false ;
12
- let has_opened = false ;
13
+ let enabled = $state ( false ) ;
14
+ let has_opened = $state ( false ) ;
13
15
14
16
const icon = ` data:image/svg+xml;base64,${ btoa (
15
17
`
24
26
)} ` ;
25
27
26
28
// location of code in file
27
- let file_loc;
29
+ let file_loc = $state () ;
28
30
// cursor pos and width for file_loc overlay positioning
29
- let x, y, w;
31
+ let x = $state (),
32
+ y = $state (),
33
+ w = $state ();
30
34
31
- let active_el;
35
+ let active_el = $state () ;
32
36
33
- let hold_start_ts;
37
+ let hold_start_ts = $state () ;
34
38
35
- $ : show_toggle =
36
- // eslint-disable-next-line svelte/valid-compile
37
- options . showToggleButton === ' always ' || ( options . showToggleButton === ' active ' && enabled );
39
+ const show_toggle = $derived (
40
+ options . showToggleButton === ' always ' || ( options . showToggleButton === ' active ' && enabled)
41
+ );
38
42
39
43
function mousemove (e ) {
40
44
x = e .x ;
You can’t perform that action at this time.
0 commit comments