11<template >
2- <span v-if =" decorators.length === 0" >{{ text }}</span >
2+ <a
3+ v-if =" isPageLink"
4+ class =" notion-link"
5+ target =" _blank"
6+ :href =" decoratorValue"
7+ >{{ pageLinkTitle }}</a
8+ >
9+ <span v-else-if =" decorators.length === 0" >{{ text }}</span >
310 <span v-else-if =" decoratorKey === 'h'" :class =" 'notion-' + decoratorValue"
4- ><NotionDecorator :content =" nextContent" />
11+ ><NotionDecorator :content =" nextContent" v-bind = " pass " />
512 </span >
613 <code v-else-if =" decoratorKey === 'c'" class =" notion-inline-code" >
7- <NotionDecorator :content =" nextContent" />
14+ <NotionDecorator :content =" nextContent" v-bind = " pass " />
815 </code >
916 <b v-else-if =" decoratorKey === 'b'" >
10- <NotionDecorator :content =" nextContent" />
17+ <NotionDecorator :content =" nextContent" v-bind = " pass " />
1118 </b >
1219 <em v-else-if =" decoratorKey === 'i'" >
13- <NotionDecorator :content =" nextContent" />
20+ <NotionDecorator :content =" nextContent" v-bind = " pass " />
1421 </em >
1522 <s v-else-if =" decoratorKey === 's'" >
16- <NotionDecorator :content =" nextContent" />
23+ <NotionDecorator :content =" nextContent" v-bind = " pass " />
1724 </s >
25+ <s v-else-if =" decoratorKey === '‣'" > TEST </s >
1826 <a
1927 v-else-if =" decoratorKey === 'a'"
2028 class =" notion-link"
2129 target =" _blank"
2230 :href =" decoratorValue"
2331 >
24- <NotionDecorator :content =" nextContent" />
32+ <NotionDecorator :content =" nextContent" v-bind = " pass " />
2533 </a >
26- <NotionDecorator v-else :content =" nextContent" />
34+ <NotionDecorator v-else :content =" nextContent" v-bind = " pass " />
2735</template >
2836
2937<script >
38+ import Blockable , { blockProps } from " @/lib/blockable" ;
39+ import NotionTextRenderer from " @/blocks/helpers/text-renderer" ;
40+
3041export default {
42+ extends: Blockable,
3143 name: " NotionDecorator" ,
32- props: [" content" ],
44+ components: { NotionTextRenderer },
45+ props: { ... blockProps, content: Array },
3346 computed: {
3447 text () {
3548 return this .content ? .[0 ];
@@ -53,6 +66,15 @@ export default {
5366 nextContent () {
5467 return [this .text , this .unappliedDecorators ];
5568 },
69+ isPageLink () {
70+ return this .text === " ‣" ;
71+ },
72+ pageLinkTitle () {
73+ return (
74+ this .blockMap ? .[this .decoratorValue ]? .value ? .properties
75+ ? .title ? .[0 ]? .[0 ] || " this"
76+ );
77+ },
5678 },
5779};
5880< / script>
0 commit comments