File tree Expand file tree Collapse file tree 4 files changed +47
-1
lines changed Expand file tree Collapse file tree 4 files changed +47
-1
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,10 @@ import Vue from "vue";
22import Dev from "./serve.vue" ;
33
44import VueKatex from "vue-katex" ;
5+ import { NotionRenderer } from "@/entry" ;
56
67Vue . use ( VueKatex ) ;
8+ Vue . component ( "NotionRenderer" , NotionRenderer ) ;
79
810Vue . config . productionTip = false ;
911
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export default {
2222 async created () {
2323 // react-notion tester: 2e22de6b770e4166be301490f6ffd420
2424 // equation tester: 2a1d5226d68246deba627012081693f9
25+ // sync tester: c10e1556bec44f23a20f71497b3d98c4
2526 // table tester: bd1de400a8b349dc824f4f00e61d0797
2627 // todo tester: 235057194b954a60ace89c052a65d102
2728 this .blockMap = await getPageBlocks (" 2e22de6b770e4166be301490f6ffd420" );
Original file line number Diff line number Diff line change 1+ <template >
2+ <NotionRenderer
3+ v-bind =" pass"
4+ :blockMap =" blockMap"
5+ :contentId =" referencePointerId"
6+ />
7+ </template >
8+
9+ <script >
10+ import { Blockable , blockComputed } from " @/lib/blockable" ;
11+
12+ export default {
13+ extends: Blockable,
14+ name: " NotionSyncPointer" ,
15+ computed: {
16+ ... blockComputed,
17+ referencePointerId () {
18+ return this .format ? .transclusion_reference_pointer ? .id ;
19+ },
20+ },
21+ };
22+ < / script>
Original file line number Diff line number Diff line change 4040 v-bind =" pass"
4141 />
4242 <NotionTable v-else-if =" isType('table')" v-bind =" pass" ><slot /></NotionTable >
43+ <NotionSyncPointer
44+ v-else-if =" isRendererRegistered && isType('transclusion_reference')"
45+ v-bind =" pass"
46+ />
47+ <div
48+ v-else-if =" isRendererRegistered && isType('transclusion_container')"
49+ class =" notion-sync-block"
50+ >
51+ <slot />
52+ </div >
4353 <NotionTableRow v-else-if =" isType('table_row')" v-bind =" pass" />
4454 <hr v-else-if =" isType('divider')" class =" notion-hr" />
4555 <div v-else-if =" todo && visible" >
5161</template >
5262
5363<script >
54- import { Blockable } from " @/lib/blockable" ;
64+ import Vue from " vue" ;
65+
66+ import { Blockable , blockComputed } from " @/lib/blockable" ;
5567
5668import NotionBookmark from " @/blocks/bookmark" ;
5769import NotionCallout from " @/blocks/callout" ;
@@ -63,6 +75,7 @@ import NotionHeader from "@/blocks/header";
6375import NotionList from " @/blocks/list" ;
6476import NotionPage from " @/blocks/page" ;
6577import NotionQuote from " @/blocks/quote" ;
78+ import NotionSyncPointer from " @/blocks/sync-pointer" ;
6679import NotionTable from " @/blocks/table" ;
6780import NotionTableRow from " @/blocks/table-row" ;
6881import NotionText from " @/blocks/text" ;
@@ -78,16 +91,24 @@ export default {
7891 NotionCode,
7992 NotionColumn,
8093 NotionEquation,
94+ NotionEquation,
8195 NotionFigure,
8296 NotionHeader,
8397 NotionList,
8498 NotionPage,
8599 NotionQuote,
100+ NotionSyncPointer,
86101 NotionTable,
87102 NotionTableRow,
88103 NotionText,
89104 NotionTodo,
90105 NotionToggle,
91106 },
107+ computed: {
108+ ... blockComputed,
109+ isRendererRegistered () {
110+ return " NotionRenderer" in Vue? .options ? .components ;
111+ },
112+ },
92113};
93114< / script>
You can’t perform that action at this time.
0 commit comments