Skip to content

Commit bc5ba95

Browse files
authored
Merge pull request #8698 from jonathan-berthet/main
Add a "question" bloc in addition of Danger, Info, Positive, Warn
2 parents 3805812 + 9fdd586 commit bc5ba95

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
@@ -37,6 +37,7 @@ import {
3737
FormatSize,
3838
FormatStrikethrough,
3939
FormatUnderline,
40+
Help,
4041
Info,
4142
LinkIcon,
4243
Paperclip,
@@ -502,6 +503,15 @@ export function getMenuEntries(isRichWorkspace: boolean): MenuEntry[] {
502503
return command.toggleCallout({ type: 'error' })
503504
},
504505
},
506+
{
507+
key: 'callout-question',
508+
label: t('text', 'Question callout'),
509+
isActive: { name: 'callout', attributes: { type: 'question' } },
510+
icon: Help,
511+
action: (command) => {
512+
return command.toggleCallout({ type: 'question' })
513+
},
514+
},
505515
],
506516
priority: 3,
507517
},

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
/**
1111
*

src/nodes/CalloutView.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-3'
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 {
@@ -111,5 +112,10 @@ export default {
111112
&--success {
112113
--callout-border: var(--color-element-success);
113114
}
115+
116+
// Question variable
117+
&--question {
118+
--callout-border: #184cbd;
119+
}
114120
}
115121
</style>

0 commit comments

Comments
 (0)