File tree 13 files changed +51
-503
lines changed
13 files changed +51
-503
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,5 @@ node_modules
3
3
dist
4
4
dist-ssr
5
5
* .local
6
- .nuxt
6
+ .nuxt
7
+ .output
Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
- import { NotionRenderer , getPageBlocks } from " vue3-notion"
2
+ import { getPageBlocks } from " vue3-notion"
3
3
import { onMounted , ref } from " vue"
4
4
import { useNuxtApp } from " #app"
5
- const blockMap = ref ()
5
+ import " ../src/style.css"
6
+
7
+ const nuxtApp = useNuxtApp ()
8
+ const { data } = await useAsyncData (" count" , () => getPageBlocks (" 2e22de6b770e4166be301490f6ffd420" ))
6
9
7
10
onMounted (async () => {
8
11
// react-notion tester: 2e22de6b770e4166be301490f6ffd420
9
12
// equation tester: 2a1d5226d68246deba627012081693f9
10
13
// table tester: bd1de400a8b349dc824f4f00e61d0797
11
14
// todo tester: 235057194b954a60ace89c052a65d102
12
- console .log (useNuxtApp ())
13
- blockMap .value = await getPageBlocks (" 2e22de6b770e4166be301490f6ffd420" )
14
15
})
15
16
</script >
16
17
17
18
<template >
18
- <div v-if =" blockMap " >
19
- <NotionRenderer :blockMap =" blockMap " fullPage prism katex todo />
19
+ <div v-if =" data " >
20
+ <NotionRenderer :blockMap =" data " fullPage prism katex todo />
20
21
</div >
21
22
</template >
Original file line number Diff line number Diff line change @@ -14,5 +14,5 @@ export default defineNuxtConfig({
14
14
// build: {
15
15
// transpile: ["vue3-notion"],
16
16
// },
17
- buildModules : [ "vue3-notion /nuxt" ] ,
17
+ buildModules : [ ".. /nuxt" ] ,
18
18
} )
Original file line number Diff line number Diff line change 10
10
},
11
11
"dependencies" : {
12
12
"nuxt3" : " 3.0.0-27274229.29599f0" ,
13
- "vue3-notion" : " ^0.0.8 "
13
+ "vue3-notion" : " ^0.0.9 "
14
14
}
15
15
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "extends" : " ./.nuxt/tsconfig.json" ,
3
+ "compilerOptions" : {
4
+ "target" : " esnext" ,
5
+ "module" : " esnext" ,
6
+ "moduleResolution" : " node" ,
7
+ "strict" : true ,
8
+ "jsx" : " preserve" ,
9
+ "sourceMap" : true ,
10
+ "resolveJsonModule" : true ,
11
+ "esModuleInterop" : true ,
12
+ "allowSyntheticDefaultImports" : true ,
13
+ "lib" : [" esnext" , " dom" ],
14
+ "types" : [" @nuxt/types" ]
15
+ }
16
+ }
Original file line number Diff line number Diff line change @@ -5298,10 +5298,10 @@ vue-style-loader@^4.1.3:
5298
5298
hash-sum "^1.0.2"
5299
5299
loader-utils "^1.0.2"
5300
5300
5301
- vue3-notion@^0.0.8 :
5302
- version "0.0.8 "
5303
- resolved "https://registry.yarnpkg.com/vue3-notion/-/vue3-notion-0.0.%3Cspan%20class="x x-first x-last">8 .tgz#3cfab03a40a00d799f57d74721c8b8db26c0a4e4 "
5304
- integrity sha512-HH0JpvA1GeYAGIivmnid014Q2VkUOmsYACSi5qSl9lZNMDOS4psgE4IGdvGvcC/CKS/rMQE7/4aSpzng6991yQ ==
5301
+ vue3-notion@^0.0.9 :
5302
+ version "0.0.9 "
5303
+ resolved "https://registry.yarnpkg.com/vue3-notion/-/vue3-notion-0.0.%3Cspan%20class="x x-first x-last">9 .tgz#251db1ba123a86aab1f5870ab538bd889ae3ea51 "
5304
+ integrity sha512-zKnuTfVDteoVJ4ZPv9bILZI2CU28WjrlZSPKfsrvF2Kku4OgDryRRi217upJjan2Bcibb15ae5+HgEzOO3gzlA ==
5305
5305
dependencies :
5306
5306
fragment-for-vue "^1.0.1"
5307
5307
katex "^0.15.1"
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ export default defineNuxtModule({
8
8
setup ( options , nuxt ) {
9
9
const filename = fileURLToPath ( import . meta. url )
10
10
const __dirname = dirname ( filename )
11
- console . log ( __dirname )
12
11
addPluginTemplate ( {
13
12
src : resolve ( __dirname , "plugin.ts" ) ,
14
13
filename : "vue3-notion.ts" ,
@@ -22,5 +21,3 @@ export default defineNuxtModule({
22
21
} )
23
22
} ,
24
23
} )
25
-
26
- module . exports . meta = require ( "../package.json" )
Original file line number Diff line number Diff line change 1
1
import VueNotion from "vue3-notion"
2
2
import { getPageBlocks , getPageTable } from "vue3-notion"
3
- import "vue3-notion/dist/style.css"
4
3
5
4
export default ( nuxtApp ) => {
6
5
const notion = { getPageBlocks, getPageTable }
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue3-notion" ,
3
- "version" : " 0.0.9 " ,
3
+ "version" : " 0.0.10 " ,
4
4
"description" : " Vue 3 Unofficial Notion Renderer" ,
5
5
"repository" : " github:zernonia/vue3-notion" ,
6
6
"main" : " dist/library.ts" ,
28
28
"fragment-for-vue" : " ^1.0.1" ,
29
29
"katex" : " ^0.15.1" ,
30
30
"prismjs" : " ^1.25.0" ,
31
- "unbuild" : " ^0.6.7" ,
32
31
"vue" : " ^3.2.26"
33
32
},
34
33
"devDependencies" : {
51
50
"vue-tsc" : " ^0.29.8"
52
51
},
53
52
"peerDependencies" : {
54
- "vue" : " ^3.2.20"
53
+ "vue" : " ^3.2.20" ,
54
+ "fragment-for-vue" : " ^1.0.1" ,
55
+ "katex" : " ^0.15.1" ,
56
+ "prismjs" : " ^1.25.0"
55
57
}
56
58
}
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ const plugins = [
22
22
replace ( {
23
23
"process.env.NODE_ENV" : JSON . stringify ( "production" ) ,
24
24
"process.env.ES_BUILD" : JSON . stringify ( "false" ) ,
25
+ preventAssignment : true ,
25
26
} ) ,
26
27
alias ( {
27
28
entries : {
@@ -40,6 +41,7 @@ export default [
40
41
format : "esm" ,
41
42
name : "Vue3Notion" ,
42
43
file : "dist/library.ts" ,
44
+ exports : "named" ,
43
45
} ,
44
46
] ,
45
47
external,
@@ -53,6 +55,7 @@ export default [
53
55
format : "cjs" ,
54
56
name : "Vue3Notion" ,
55
57
file : "dist/library.ssr.ts" ,
58
+ exports : "named" ,
56
59
globals,
57
60
} ,
58
61
] ,
@@ -67,6 +70,7 @@ export default [
67
70
format : "iife" ,
68
71
name : "Vue3Notion" ,
69
72
file : "dist/min.js" ,
73
+ exports : "named" ,
70
74
globals,
71
75
} ,
72
76
plugins : [ vue ( ) , ...plugins ] ,
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ const langClass = computed(() => {
17
17
})
18
18
19
19
const supported = computed (() => {
20
- return Prism .languages [lang .value ]
20
+ return Prism ? .languages [lang .value ]
21
21
})
22
22
</script >
23
23
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ const props = defineProps({
18
18
})
19
19
20
20
const { code, inline, language } = toRefs (props )
21
- const prismLanguage = Prism .languages [language .value ]
21
+ const prismLanguage = computed (() => Prism ? .languages [language .value ])
22
22
const className = computed (() => ` language-${language .value } ` )
23
23
24
24
const d = computed (() => Prism .highlight (code ?.value , prismLanguage , " en" ))
You can’t perform that action at this time.
0 commit comments