File tree Expand file tree Collapse file tree 5 files changed +33
-31
lines changed Expand file tree Collapse file tree 5 files changed +33
-31
lines changed Original file line number Diff line number Diff line change 32
32
],
33
33
"scripts" : {
34
34
"build" : " rslib build" ,
35
- "dev" : " rslib build -w" ,
35
+ "dev" : " IS_DEV=1 rslib build -w" ,
36
36
"reset" : " rimraf ./**/node_modules"
37
37
},
38
38
"dependencies" : {
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ export default defineConfig({
55
55
} ,
56
56
} ,
57
57
output : {
58
+ cleanDistPath : process . env . IS_DEV === '1' ,
58
59
target : 'web' ,
59
60
externals : COMMON_EXTERNALS ,
60
61
cssModules : {
Original file line number Diff line number Diff line change 1
1
.rp-aside__toc-item {
2
- display : flex ;
3
- line-height : 24px ;
2
+ display : block ;
4
3
justify-content : flex-start ;
5
4
align-items : flex-start ;
6
5
gap : 10px ;
7
6
align-self : stretch ;
8
7
border-radius : 6px ;
9
8
position : relative ;
10
9
color : var (--rp-c-text-2 );
10
+
11
11
font-weight : 400 ;
12
12
font-size : 14px ;
13
+ line-height : 24px ;
14
+
15
+ & __text {
16
+ overflow-wrap : break-word ;
17
+ }
13
18
14
19
& --active {
15
20
color : var (--rp-c-link );
Original file line number Diff line number Diff line change @@ -17,22 +17,20 @@ export const TocItem = ({
17
17
active : boolean ;
18
18
} ) => {
19
19
return (
20
- < li >
21
- < Link
22
- href = { `#${ header . id } ` }
23
- title = { parseInlineMarkdownText ( header . text ) }
24
- className = { clsx ( 'rp-aside__toc-item' , {
25
- 'rp-aside__toc-item--active' : active ,
26
- } ) }
27
- style = { {
28
- paddingLeft : ( header . depth - baseHeaderLevel ) * 12 ,
29
- } }
30
- >
31
- < span
32
- className = "rp-aside__toc-text"
33
- { ...renderInlineMarkdown ( header . text ) }
34
- > </ span >
35
- </ Link >
36
- </ li >
20
+ < Link
21
+ href = { `#${ header . id } ` }
22
+ title = { parseInlineMarkdownText ( header . text ) }
23
+ className = { clsx ( 'rp-aside__toc-item' , {
24
+ 'rp-aside__toc-item--active' : active ,
25
+ } ) }
26
+ style = { {
27
+ paddingLeft : ( header . depth - baseHeaderLevel ) * 12 ,
28
+ } }
29
+ >
30
+ < span
31
+ className = "rp-aside__toc-item__text"
32
+ { ...renderInlineMarkdown ( header . text ) }
33
+ > </ span >
34
+ </ Link >
37
35
) ;
38
36
} ;
Original file line number Diff line number Diff line change @@ -60,17 +60,15 @@ export function Aside() {
60
60
{ outlineTitle }
61
61
< ProgressCircle percent = { readPercent } size = { 14 } strokeWidth = { 2 } />
62
62
</ div >
63
- < nav >
64
- < ul className = "rp-aside__toc" >
65
- { headers . map ( ( header , index ) => (
66
- < TocItem
67
- key = { `${ header . depth } _${ header . text } _${ header . id } _${ index } ` }
68
- baseHeaderLevel = { baseHeaderLevel }
69
- header = { header }
70
- active = { activeAnchorId === header . id }
71
- />
72
- ) ) }
73
- </ ul >
63
+ < nav className = "rp-aside__toc" >
64
+ { headers . map ( ( header , index ) => (
65
+ < TocItem
66
+ key = { `${ header . depth } _${ header . text } _${ header . id } _${ index } ` }
67
+ baseHeaderLevel = { baseHeaderLevel }
68
+ header = { header }
69
+ active = { activeAnchorId === header . id }
70
+ />
71
+ ) ) }
74
72
</ nav >
75
73
76
74
< div style = { { display : readPercent !== 0 ? '' : 'none' } } >
You can’t perform that action at this time.
0 commit comments