Skip to content

Commit c20cb3e

Browse files
author
Timothy Johnson
committed
Cleanup
1 parent c461c11 commit c20cb3e

File tree

8 files changed

+61
-59
lines changed

8 files changed

+61
-59
lines changed

dest/devtools/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
chrome.devtools.panels.create(
22
'Svelte',
3-
chrome.devtools.panels.themeName == 'dark' ? '/devtools/svelte-logo-dark.svg' : '/devtools/svelte-logo-light.svg',
3+
chrome.devtools.panels.themeName == 'dark'
4+
? '/devtools/svelte-logo-dark.svg'
5+
: '/devtools/svelte-logo-light.svg',
46
'/devtools/panel.html',
57
panel =>
68
panel.onShown.addListener(() =>

dest/devtools/panel.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
}
1919

2020
body.dark {
21-
color: rgb(177, 177, 179);
2221
background-color: rgb(42, 42, 46);
22+
color: rgb(177, 177, 179);
2323
scrollbar-color: rgb(115, 115, 115) rgb(60, 60, 61);
2424
}
2525

rollup.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ export default [{
1717
svelte({
1818
preprocess: {
1919
markup: input => {
20-
const blocks = {}
2120
const code = input.content
22-
.replace(/<!--block\s+(.+?)\s*-->([^]+?)<!--end-->/g, (_, name, block) => (blocks[name] = block, ''))
23-
.replace(/<!--use\s+(.+?)\s*?-->/g, (_, name) => blocks[name])
2421
.replace(/(>|})\s+(?![^]*?<\/(?:script|style)>|[^<]*?>|[^{]*?})/g, '$1')
2522
.replace(/(?<!<[^>]*?|{[^}]*?)\s+(<|{)(?![^]*<\/(?:script|style)>)/g, '$1')
2623
return { code }

src/nodes/Element.svelte

Lines changed: 3 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script>
22
import Collapse from './Collapse.svelte'
33
import SearchTerm from './SearchTerm.svelte'
4+
import ElementAttributes from './ElementAttributes.svelte'
45
56
export let style
67
export let hasChildren
78
export let hover
89
export let selected
9-
export let highlighted
1010
export let tagName
1111
export let attributes = []
1212
export let listeners = []
@@ -58,59 +58,11 @@
5858
color: rgb(0, 116, 232);
5959
}
6060
61-
.attr-name {
62-
position: relative;
63-
color: rgb(221, 0, 169);
64-
}
65-
66-
.attr-value {
67-
display: inline-block;
68-
overflow: hidden;
69-
max-width: 200px;
70-
color: rgb(0, 62, 170);
71-
vertical-align: bottom;
72-
text-overflow: ellipsis;
73-
white-space: nowrap;
74-
}
75-
7661
:global(.dark) .tag-name {
7762
color: rgb(117, 191, 255);
7863
}
79-
80-
:global(.dark) .attr-name {
81-
color: rgb(255, 125, 233);
82-
}
83-
84-
:global(.dark) .attr-value {
85-
color: rgb(185, 142, 255);
86-
}
8764
</style>
8865

89-
<!--block attributes-->
90-
{#each _attributes as { key, value, isBound, flash } (key)}
91-
&nbsp;
92-
<span class:flash>
93-
<span class="attr-name">
94-
{#if isBound}bind:{/if}
95-
<SearchTerm text={key} />
96-
</span>
97-
=
98-
<span class="attr-value">
99-
<SearchTerm text={value} />
100-
</span>
101-
</span>
102-
{/each}
103-
104-
{#each listeners as { event, handler, modifiers }}
105-
&nbsp;
106-
<span class="attr-name" data-tooltip={handler}>
107-
on:
108-
<SearchTerm text={event} />
109-
{#if modifiers}|{modifiers.join('|')}{/if}
110-
</span>
111-
{/each}
112-
<!--end-->
113-
11466
{#if hasChildren}
11567
<div
11668
class:hover
@@ -122,7 +74,7 @@
12274
<span class="tag-name">
12375
<SearchTerm text={tagName} />
12476
</span>
125-
<!--use attributes-->
77+
<ElementAttributes attributes={_attributes} {listeners} />
12678
&gt;
12779
{#if collapsed}
12880
&hellip;&lt;/
@@ -148,7 +100,7 @@
148100
<span class="tag-name">
149101
<SearchTerm text={tagName} />
150102
</span>
151-
<!--use attributes-->
103+
<ElementAttributes attributes={_attributes} {listeners} />
152104
&nbsp;/&gt;
153105
</div>
154106
{/if}

src/nodes/ElementAttributes.svelte

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<script>
2+
import SearchTerm from './SearchTerm.svelte'
3+
4+
export let attributes
5+
export let listeners
6+
</script>
7+
8+
<style>
9+
.attr-name {
10+
position: relative;
11+
color: rgb(221, 0, 169);
12+
}
13+
14+
.attr-value {
15+
display: inline-block;
16+
overflow: hidden;
17+
max-width: 200px;
18+
color: rgb(0, 62, 170);
19+
vertical-align: bottom;
20+
text-overflow: ellipsis;
21+
white-space: nowrap;
22+
}
23+
24+
:global(.dark) .attr-name {
25+
color: rgb(255, 125, 233);
26+
}
27+
28+
:global(.dark) .attr-value {
29+
color: rgb(185, 142, 255);
30+
}
31+
</style>
32+
33+
{#each attributes as { key, value, isBound, flash } (key)}
34+
&nbsp;
35+
<span class:flash>
36+
<span class="attr-name">
37+
{#if isBound}bind:{/if}
38+
<SearchTerm text={key} />
39+
</span>
40+
=
41+
<span class="attr-value">
42+
<SearchTerm text={value} />
43+
</span>
44+
</span>
45+
{/each}
46+
47+
{#each listeners as { event, handler, modifiers }}
48+
&nbsp;
49+
<span class="attr-name" data-tooltip={handler}>
50+
on:
51+
<SearchTerm text={event} />
52+
{#if modifiers && modifiers.length}|{modifiers.join('|')}{/if}
53+
</span>
54+
{/each}

src/nodes/Iteration.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
export let style
33
export let hover
44
export let selected
5-
export let source
65
</script>
76

87
<style>

src/nodes/Slot.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
export let hover
77
export let selected
88
export let tagName
9-
export let source
109
export let collapsed
1110
</script>
1211

src/profiler/Frame.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script>
22
import Operation from './Operation.svelte'
33
4-
export let type
54
export let children
65
export let duration
76
</script>

0 commit comments

Comments
 (0)