Skip to content

Commit 6346fd9

Browse files
Add 'question' callout type
Signed-off-by: jonathan-berthet <71975170+jonathan-berthet@users.noreply.github.com>
1 parent f729d51 commit 6346fd9

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

src/components/Menu/entries.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
FormatSize,
2727
FormatStrikethrough,
2828
FormatUnderline,
29+
Help,
2930
Info,
3031
LinkIcon,
3132
Paperclip,
@@ -479,6 +480,15 @@ export const getMenuEntries = (isRichWorkspace: boolean): MenuEntry[] => {
479480
return command.toggleCallout({ type: 'error' })
480481
},
481482
},
483+
{
484+
key: 'callout-question',
485+
label: t('text', 'Question callout'),
486+
isActive: { name: 'callout', attributes: { type: 'question' } },
487+
icon: Help,
488+
action: (command) => {
489+
return command.toggleCallout({ type: 'question' })
490+
},
491+
},
482492
],
483493
priority: 3,
484494
},

src/markdownit/callouts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import container from 'markdown-it-container'
77

8-
export const typesAvailable = ['info', 'warn', 'error', 'success']
8+
export const typesAvailable = ['info', 'warn', 'error', 'success', 'question']
99

1010
const buildRender = (type) => (tokens, idx, options, env, slf) => {
1111
const tag = tokens[idx]

src/nodes/Callout.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616

1717
<script>
1818
import { NodeViewContent, NodeViewWrapper } from '@tiptap/vue-2'
19-
import { Danger, Info, Positive, Warn } from '../components/icons.js'
19+
import { Danger, Help, Info, Positive, Warn } from '../components/icons.js'
2020
2121
const ICONS_MAP = {
2222
info: Info,
2323
success: Positive,
2424
error: Danger,
2525
warn: Warn,
26+
question: Help,
2627
}
2728
2829
export default {
@@ -108,5 +109,10 @@ export default {
108109
&--success {
109110
--callout-border: var(--color-element-success);
110111
}
112+
113+
// Question variable
114+
&--question {
115+
--callout-border: #184cbd;
116+
}
111117
}
112118
</style>

0 commit comments

Comments
 (0)