@sveltejs/vite-plugin-svelte 1.0.6 → 1.0.7
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/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/ui/inspector/Inspector.svelte +9 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltejs/vite-plugin-svelte",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "dominikg",
|
|
6
6
|
"files": [
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
"@types/debug": "^4.1.7",
|
|
63
63
|
"@types/diff-match-patch": "^1.0.32",
|
|
64
64
|
"diff-match-patch": "^1.0.5",
|
|
65
|
-
"esbuild": "^0.15.
|
|
65
|
+
"esbuild": "^0.15.8",
|
|
66
66
|
"rollup": "^2.79.0",
|
|
67
|
-
"svelte": "^3.50.
|
|
67
|
+
"svelte": "^3.50.1",
|
|
68
68
|
"tsup": "^6.2.3",
|
|
69
|
-
"vite": "^3.1.
|
|
69
|
+
"vite": "^3.1.2"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"dev": "pnpm build:ci --sourcemap --watch src",
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
let x, y, w;
|
|
26
26
|
|
|
27
27
|
let active_el;
|
|
28
|
-
let toggle_el;
|
|
29
28
|
|
|
30
29
|
let enabled_ts;
|
|
31
30
|
|
|
@@ -79,14 +78,12 @@
|
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
function is_selectable(el) {
|
|
82
|
-
if (el === toggle_el) {
|
|
83
|
-
return false; // toggle is our own
|
|
84
|
-
}
|
|
85
81
|
const file = el?.__svelte_meta?.loc?.file;
|
|
86
82
|
if (!file || file.includes('node_modules/')) {
|
|
87
83
|
return false; // no file or 3rd party
|
|
88
84
|
}
|
|
89
|
-
|
|
85
|
+
const id = el.getAttribute('id');
|
|
86
|
+
if (id === 'svelte-announcer' || id?.startsWith('svelte-inspector-')) {
|
|
90
87
|
return false; // ignore some elements by id that would be selectable from keyboard nav otherwise
|
|
91
88
|
}
|
|
92
89
|
return true;
|
|
@@ -286,21 +283,20 @@
|
|
|
286
283
|
|
|
287
284
|
{#if show_toggle}
|
|
288
285
|
<button
|
|
289
|
-
|
|
286
|
+
id="svelte-inspector-toggle"
|
|
290
287
|
class:enabled
|
|
291
288
|
style={`background-image: var(--svelte-inspector-icon);${options.toggleButtonPos
|
|
292
289
|
.split('-')
|
|
293
290
|
.map((p) => `${p}: 8px;`)
|
|
294
291
|
.join('')}`}
|
|
295
292
|
on:click={() => toggle()}
|
|
296
|
-
bind:this={toggle_el}
|
|
297
293
|
aria-label={`${enabled ? 'disable' : 'enable'} svelte-inspector`}
|
|
298
294
|
/>
|
|
299
295
|
{/if}
|
|
300
296
|
{#if enabled && active_el && file_loc}
|
|
301
297
|
{@const loc = active_el.__svelte_meta.loc}
|
|
302
298
|
<div
|
|
303
|
-
|
|
299
|
+
id="svelte-inspector-overlay"
|
|
304
300
|
style:left="{Math.min(x + 3, document.documentElement.clientWidth - w - 10)}px"
|
|
305
301
|
style:top="{document.documentElement.clientHeight < y + 50 ? y - 30 : y + 30}px"
|
|
306
302
|
bind:offsetWidth={w}
|
|
@@ -320,16 +316,17 @@
|
|
|
320
316
|
outline: 2px dashed #ff3e00 !important;
|
|
321
317
|
}
|
|
322
318
|
|
|
323
|
-
|
|
319
|
+
#svelte-inspector-overlay {
|
|
324
320
|
position: fixed;
|
|
325
321
|
background-color: rgba(0, 0, 0, 0.8);
|
|
326
322
|
color: #fff;
|
|
327
323
|
padding: 2px 4px;
|
|
328
324
|
border-radius: 5px;
|
|
329
325
|
z-index: 999999;
|
|
326
|
+
pointer-events: none;
|
|
330
327
|
}
|
|
331
328
|
|
|
332
|
-
|
|
329
|
+
#svelte-inspector-toggle {
|
|
333
330
|
all: unset;
|
|
334
331
|
border: 1px solid #ff3e00;
|
|
335
332
|
border-radius: 8px;
|
|
@@ -354,10 +351,10 @@
|
|
|
354
351
|
height: 1px;
|
|
355
352
|
}
|
|
356
353
|
|
|
357
|
-
|
|
354
|
+
#svelte-inspector-toggle:not(.enabled) {
|
|
358
355
|
filter: grayscale(1);
|
|
359
356
|
}
|
|
360
|
-
|
|
357
|
+
#svelte-inspector-toggle:hover {
|
|
361
358
|
background-color: #facece;
|
|
362
359
|
}
|
|
363
360
|
</style>
|