1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
<script>
import { NodeViewWrapper } from '@tiptap/vue-2';
import { GlLabel } from '@gitlab/ui';
import { isScopedLabel } from '~/lib/utils/common_utils';
export default {
name: 'DetailsWrapper',
components: {
NodeViewWrapper,
GlLabel,
},
props: {
node: {
type: Object,
required: true,
},
selected: {
type: Boolean,
required: false,
default: false,
},
},
computed: {
isScopedLabel() {
return isScopedLabel({ title: this.node.attrs.originalText || this.node.attrs.text });
},
},
fallbackLabelBackgroundColor: '#ccc',
};
</script>
<template>
<node-view-wrapper as="span" :class="{ 'ProseMirror-selectednode': selected }">
<gl-label
size="sm"
:scoped="isScopedLabel"
:background-color="node.attrs.color || $options.fallbackLabelBackgroundColor"
:title="node.attrs.text"
class="gl-pointer-events-none"
/>
</node-view-wrapper>
</template>
|