File tree 17 files changed +96
-176
lines changed
17 files changed +96
-176
lines changed Original file line number Diff line number Diff line change 1
- // eslint-disable-next-line @typescript-eslint/no-var-requires
2
- const withBundleAnalyzer = require ( '@next/bundle-analyzer' ) ( {
3
- enabled : process . env . ANALYZE === 'true'
4
- } )
5
-
6
- module . exports = withBundleAnalyzer ( {
1
+ export default {
7
2
staticPageGenerationTimeout : 300 ,
8
3
images : {
9
4
domains : [
@@ -15,4 +10,4 @@ module.exports = withBundleAnalyzer({
15
10
] ,
16
11
formats : [ 'image/avif' , 'image/webp' ]
17
12
}
18
- } )
13
+ }
Original file line number Diff line number Diff line change 7
7
"dev" : " next dev" ,
8
8
"build" : " next build" ,
9
9
"start" : " next start" ,
10
- "analyze" : " cross-env ANALYZE=true next build" ,
11
- "analyze:server" : " cross-env BUNDLE_ANALYZE=server next build" ,
12
- "analyze:browser" : " cross-env BUNDLE_ANALYZE=browser next build" ,
13
10
"deploy" : " vercel deploy" ,
14
11
"test" : " run-s test:*" ,
15
12
"test:lint" : " eslint ."
32
29
"react-tweet-embed" : " ^2.0.0"
33
30
},
34
31
"devDependencies" : {
35
- "@next/bundle-analyzer" : " ^15.0.2" ,
36
32
"cross-env" : " ^7.0.3"
37
33
}
38
34
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "extends" : [" //" ],
3
+ "tasks" : {
4
+ "build" : {
5
+ "outputs" : [" .next/**" , " !.next/cache/**" ]
6
+ }
7
+ }
8
+ }
Original file line number Diff line number Diff line change 1
- // eslint-disable-next-line @typescript-eslint/no-var-requires
2
- const withBundleAnalyzer = require ( '@next/bundle-analyzer' ) ( {
3
- enabled : process . env . ANALYZE === 'true'
4
- } )
5
-
6
- module . exports = withBundleAnalyzer ( {
1
+ export default {
7
2
staticPageGenerationTimeout : 300 ,
8
3
images : {
9
4
domains : [
@@ -14,4 +9,4 @@ module.exports = withBundleAnalyzer({
14
9
] ,
15
10
formats : [ 'image/avif' , 'image/webp' ]
16
11
}
17
- } )
12
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "extends" : [" //" ],
3
+ "tasks" : {
4
+ "build" : {
5
+ "outputs" : [" .next/**" , " !.next/cache/**" ]
6
+ }
7
+ }
8
+ }
Original file line number Diff line number Diff line change 6
6
"repository" : " NotionX/react-notion-x" ,
7
7
"author" :
" Travis Fischer <[email protected] >" ,
8
8
"license" : " MIT" ,
9
+ "main" : " ./build/index.js" ,
10
+ "module" : " ./build/index.js" ,
9
11
"types" : " ./build/index.d.ts" ,
10
12
"sideEffects" : false ,
11
13
"files" : [
Original file line number Diff line number Diff line change 27
27
"dependencies" : {
28
28
"@fisch0920/medium-zoom" : " ^1.0.7" ,
29
29
"@matejmazur/react-katex" : " ^3.1.3" ,
30
- "katex" : " ^0.15.6 " ,
30
+ "katex" : " ^0.16.11 " ,
31
31
"notion-types" : " workspace:*" ,
32
32
"notion-utils" : " workspace:*" ,
33
33
"prismjs" : " ^1.27.0" ,
34
34
"react-fast-compare" : " ^3.2.0" ,
35
- "react-hotkeys-hook" : " ^3.4.7 " ,
35
+ "react-hotkeys-hook" : " ^4.5.1 " ,
36
36
"react-image" : " ^4.0.3" ,
37
37
"react-lazy-images" : " ^1.1.0" ,
38
38
"react-modal" : " ^3.14.3" ,
45
45
"@types/react" : " ^18.3.12" ,
46
46
"@types/react-modal" : " ^3.16.3" ,
47
47
"clipboard-copy" : " ^4.0.1" ,
48
- "date-fns" : " ^2.28 .0" ,
48
+ "date-fns" : " ^2.30 .0" ,
49
49
"format-number" : " ^3.0.0" ,
50
50
"lodash.throttle" : " ^4.1.1"
51
51
},
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ export const AssetWrapper: React.FC<{
62
62
target = {
63
63
captionHostname &&
64
64
captionHostname !== rootDomain &&
65
- ! caption . startsWith ( '/' )
65
+ ! caption ? .startsWith ( '/' )
66
66
? 'blank_'
67
67
: null
68
68
}
Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ export const Asset: React.FC<{
135
135
const src = source
136
136
if ( ! src ) return null
137
137
138
- const id = src . split ( '?' ) [ 0 ] ?. split ( '/' ) . pop ( )
138
+ const id = src . split ( '?' ) ?. [ 0 ] ?. split ( '/' ) . pop ( )
139
139
if ( ! id ) return null
140
140
141
141
content = (
Original file line number Diff line number Diff line change @@ -18,9 +18,9 @@ export const EOI: React.FC<{
18
18
return null
19
19
}
20
20
21
- const title = attributes . find ( ( attr ) => attr . id === 'title' ) ?. values [ 0 ]
22
- let owner = attributes . find ( ( attr ) => attr . id === 'owner' ) ?. values [ 0 ]
23
- const lastUpdatedAt = attributes . find ( ( attr ) => attr . id === 'updated_at' )
21
+ const title = attributes . find ( ( attr : any ) => attr . id === 'title' ) ?. values [ 0 ]
22
+ let owner = attributes . find ( ( attr : any ) => attr . id === 'owner' ) ?. values [ 0 ]
23
+ const lastUpdatedAt = attributes . find ( ( attr : any ) => attr . id === 'updated_at' )
24
24
?. values [ 0 ]
25
25
const lastUpdated = lastUpdatedAt ? formatNotionDateTime ( lastUpdatedAt ) : null
26
26
let externalImage : React . ReactNode
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export const GoogleDrive: React.FC<{
31
31
>
32
32
< div className = 'notion-google-drive-preview' >
33
33
< GracefulImage
34
- src = { mapImageUrl ( properties . thumbnail , block ) }
34
+ src = { mapImageUrl ( properties . thumbnail , block ) ! }
35
35
alt = { properties . title || 'Google Drive Document' }
36
36
loading = 'lazy'
37
37
/>
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ export const LazyImage: React.FC<{
82
82
}
83
83
84
84
return (
85
+ // @ts -expect-error LazyImage types are out-of-date.
85
86
< LazyImageFull src = { src ! } { ...rest } experimentalDecode = { true } >
86
87
{ ( { imageState, ref } ) => {
87
88
const isLoaded = imageState === ImageState . LoadSuccess
Original file line number Diff line number Diff line change 1
1
import type React from 'react'
2
2
3
- function capitalizeFirstLetter ( str ) {
3
+ function capitalizeFirstLetter ( str ?: string ) {
4
+ if ( ! str ) return ''
5
+
4
6
return str . charAt ( 0 ) . toUpperCase ( ) + str . slice ( 1 )
5
7
}
6
8
7
9
export const MentionPreviewCard : React . FC < {
8
10
owner ?: string
9
- lastUpdated ?: string
11
+ lastUpdated ?: string | null
10
12
title : string
11
13
domain : string
12
14
externalImage ?: React . ReactNode
Original file line number Diff line number Diff line change 1
1
import { type Block } from 'notion-types'
2
2
3
3
export const defaultMapImageUrl = (
4
- url : string ,
4
+ url : string | undefined ,
5
5
block : Block
6
6
) : string | undefined => {
7
7
if ( ! url ) {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export type MapPageUrlFn = (
6
6
recordMap ?: types . ExtendedRecordMap | undefined
7
7
) => string
8
8
export type MapImageUrlFn = (
9
- url : string ,
9
+ url : string | undefined ,
10
10
block : types . Block
11
11
) => string | undefined
12
12
export type SearchNotionFn = (
You can’t perform that action at this time.
0 commit comments