@@ -9,46 +9,6 @@ import {
9
9
} from '../../../../../../shared/lib/devtool/app-segment-tree'
10
10
import type { Trie , TrieNode } from '../../../../../../shared/lib/devtool/trie'
11
11
12
- const IconLayout = ( props : React . SVGProps < SVGSVGElement > ) => {
13
- return (
14
- < svg
15
- { ...props }
16
- viewBox = "0 0 16 16"
17
- fill = "none"
18
- xmlns = "http://www.w3.org/2000/svg"
19
- >
20
- < path
21
- d = "M16 12.5L15.9873 12.7559C15.8677 13.9323 14.9323 14.8677 13.7559 14.9873L13.5 15H2.5L2.24414 14.9873C1.06772 14.8677 0.132274 13.9323 0.0126953 12.7559L0 12.5V1H16V12.5ZM1.5 6.25488V12.5C1.5 13.0523 1.94772 13.5 2.5 13.5H4.99512V6.25488H1.5ZM6.24512 6.25488V13.5H13.5C14.0523 13.5 14.5 13.0523 14.5 12.5V6.25488H6.24512ZM1.5 5.00488H14.5V2.5H1.5V5.00488Z"
22
- fill = "currentColor"
23
- />
24
- </ svg >
25
- )
26
- }
27
-
28
- const IconPage = ( props : React . SVGProps < SVGSVGElement > ) => {
29
- return (
30
- < svg
31
- { ...props }
32
- viewBox = "0 0 16 16"
33
- fill = "none"
34
- strokeLinejoin = "round"
35
- xmlns = "http://www.w3.org/2000/svg"
36
- >
37
- < path
38
- fillRule = "evenodd"
39
- clipRule = "evenodd"
40
- d = "M14.5 6.5V13.5C14.5 14.8807 13.3807 16 12 16H4C2.61929 16 1.5 14.8807 1.5 13.5V1.5V0H3H8H9.08579C9.351 0 9.60536 0.105357 9.79289 0.292893L14.2071 4.70711C14.3946 4.89464 14.5 5.149 14.5 5.41421V6.5ZM13 6.5V13.5C13 14.0523 12.5523 14.5 12 14.5H4C3.44772 14.5 3 14.0523 3 13.5V1.5H8V5V6.5H9.5H13ZM9.5 2.12132V5H12.3787L9.5 2.12132Z"
41
- fill = "currentColor"
42
- />
43
- </ svg >
44
- )
45
- }
46
-
47
- const ICONS = {
48
- layout : < IconLayout width = { 16 } /> ,
49
- page : < IconPage width = { 16 } /> ,
50
- }
51
-
52
12
function PageSegmentTree ( { tree } : { tree : Trie < SegmentNode > | undefined } ) {
53
13
if ( ! tree ) {
54
14
return null
@@ -63,6 +23,7 @@ function PageSegmentTree({ tree }: { tree: Trie<SegmentNode> | undefined }) {
63
23
node = { tree . getRoot ( ) }
64
24
level = { 0 }
65
25
segment = ""
26
+ parentSegment = ""
66
27
/>
67
28
</ div >
68
29
)
@@ -71,11 +32,13 @@ function PageSegmentTree({ tree }: { tree: Trie<SegmentNode> | undefined }) {
71
32
function PageSegmentTreeLayerPresentation ( {
72
33
tree,
73
34
segment,
35
+ parentSegment,
74
36
node,
75
37
level,
76
38
} : {
77
39
tree : Trie < SegmentNode >
78
40
segment : string
41
+ parentSegment : string
79
42
node : TrieNode < SegmentNode >
80
43
level : number
81
44
} ) {
@@ -106,31 +69,14 @@ function PageSegmentTreeLayerPresentation({
106
69
< div className = { cx ( 'segment-explorer-item-row' ) } >
107
70
< div className = "segment-explorer-line" >
108
71
< div className = { `segment-explorer-line-text-${ nodeName } ` } >
109
- < span
110
- className = { cx (
111
- 'segment-explorer-line-icon' ,
112
- `segment-explorer-line-icon-${ nodeName } `
113
- ) }
114
- >
115
- { nodeName === 'layout' ? ICONS . layout : ICONS . page }
116
- </ span >
117
- < span className = "segment-explorer-filename-path" > { fileName } </ span >
118
- </ div >
119
- </ div >
120
- </ div >
121
- ) : segment ? (
122
- < div className = { 'segment-explorer-item-row' } >
123
- < div className = "segment-explorer-line" >
124
- < div className = { `segment-explorer-line-text-${ nodeName } ` } >
125
- < span
126
- className = { cx (
127
- 'segment-explorer-line-icon' ,
128
- `segment-explorer-line-icon-${ nodeName } `
129
- ) }
130
- > </ span >
131
- < span className = "segment-explorer-filename-path" >
132
- { `${ segment } /` }
133
- </ span >
72
+ < div className = "segment-explorer-filename" >
73
+ < span className = "segment-explorer-filename--path" >
74
+ { parentSegment }
75
+ </ span >
76
+ < span className = "segment-explorer-filename--name" >
77
+ { fileName }
78
+ </ span >
79
+ </ div >
134
80
</ div >
135
81
</ div >
136
82
</ div >
@@ -147,6 +93,7 @@ function PageSegmentTreeLayerPresentation({
147
93
< PageSegmentTreeLayerPresentation
148
94
key = { childSegment }
149
95
segment = { childSegment }
96
+ parentSegment = { segment }
150
97
tree = { tree }
151
98
node = { child }
152
99
level = { level + 1 }
@@ -189,35 +136,23 @@ export const DEV_TOOLS_INFO_RENDER_FILES_STYLES = css`
189
136
}
190
137
191
138
[data-nextjs-devtool-segment-explorer-level ].segment-explorer-segment-children {
192
- padding-left : 20 px ;
139
+ padding-left : 16 px ;
193
140
}
194
141
[data-nextjs-devtool-segment-explorer-level = '0' ].segment-explorer-segment-children {
195
142
padding-left : 0px ;
196
143
}
197
144
198
- .segment-explorer-filename-path {
199
- display : inline-block;
200
- }
201
-
202
- .segment-explorer-filename-path a {
203
- color : inherit;
204
- text-decoration : inherit;
145
+ .segment-explorer-filename--name {
146
+ margin-left : 8px ;
147
+ color : var (--color-gray-800 );
205
148
}
206
149
207
150
.segment-explorer-line {
208
151
white-space : pre;
209
152
cursor : default;
210
153
}
211
154
212
- .segment-explorer-line-icon {
213
- margin-right : 4px ;
214
- }
215
- .segment-explorer-line-icon-page {
216
- color : inherit;
217
- }
218
-
219
- .segment-explorer-line-text-page {
155
+ .segment-explorer-line {
220
156
color : var (--color-gray-1000 );
221
- font-weight : 500 ;
222
157
}
223
158
`
0 commit comments