chore(editor): cleanup
continuous-integration/drone/pr Build is failing
Details
continuous-integration/drone/pr Build is failing
Details
This commit is contained in:
parent
0b2aa723a6
commit
66c37f10e0
|
@ -1,46 +0,0 @@
|
|||
<template>
|
||||
<node-view-wrapper class="code-block">
|
||||
<select contenteditable="false" v-model="selectedLanguage">
|
||||
<option :value="null">
|
||||
auto
|
||||
</option>
|
||||
<option disabled>
|
||||
—
|
||||
</option>
|
||||
<option v-for="(language, index) in languages" :value="language" :key="index">
|
||||
{{ language }}
|
||||
</option>
|
||||
</select>
|
||||
<pre><code><node-view-content /></code></pre>
|
||||
</node-view-wrapper>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref, computed} from 'vue'
|
||||
import {NodeViewContent, nodeViewProps, NodeViewWrapper} from '@tiptap/vue-3'
|
||||
|
||||
const props = defineProps(nodeViewProps)
|
||||
|
||||
const languages = ref(props.extension.options.lowlight.listLanguages())
|
||||
|
||||
const selectedLanguage = computed({
|
||||
get() {
|
||||
return props.node.attrs.language
|
||||
},
|
||||
set(language) {
|
||||
props.updateAttributes({ language })
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.code-block {
|
||||
position: relative;
|
||||
|
||||
select {
|
||||
position: absolute;
|
||||
top: 0.5rem;
|
||||
right: 0.5rem;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -79,7 +79,7 @@ const tiptapRegex = new RegExp(`${TIPTAP_TEXT_VALUE_PREFIX}`, 's')
|
|||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref, watch, computed, onBeforeUnmount, type PropType, nextTick} from 'vue'
|
||||
import {ref, watch, onBeforeUnmount, nextTick} from 'vue'
|
||||
import {marked} from 'marked'
|
||||
import {refDebounced} from '@vueuse/core'
|
||||
|
||||
|
@ -94,16 +94,12 @@ import TableHeader from '@tiptap/extension-table-header'
|
|||
import TableRow from '@tiptap/extension-table-row'
|
||||
import Highlight from '@tiptap/extension-highlight'
|
||||
import Typography from '@tiptap/extension-typography'
|
||||
import Document from '@tiptap/extension-document'
|
||||
import Image from '@tiptap/extension-image'
|
||||
import Underline from '@tiptap/extension-underline'
|
||||
// import Text from '@tiptap/extension-text'
|
||||
|
||||
import TaskItem from '@tiptap/extension-task-item'
|
||||
import TaskList from '@tiptap/extension-task-list'
|
||||
|
||||
import CharacterCount from '@tiptap/extension-character-count'
|
||||
|
||||
import StarterKit from '@tiptap/starter-kit'
|
||||
import {BubbleMenu, EditorContent, useEditor} from '@tiptap/vue-3'
|
||||
|
||||
|
@ -113,7 +109,6 @@ import suggestionSetup from './suggestion'
|
|||
// load all highlight.js languages
|
||||
import {lowlight} from 'lowlight'
|
||||
|
||||
import CodeBlock from './CodeBlock.vue'
|
||||
import type {UploadCallback} from './types'
|
||||
import type {ITask} from '@/modelTypes/ITask'
|
||||
import type {IAttachment} from '@/modelTypes/IAttachment'
|
||||
|
@ -124,14 +119,6 @@ import BaseButton from '@/components/base/BaseButton.vue'
|
|||
|
||||
const {t} = useI18n()
|
||||
|
||||
// const CustomDocument = Document.extend({
|
||||
// content: 'taskList',
|
||||
// })
|
||||
|
||||
const CustomTaskItem = TaskItem.configure({
|
||||
nested: true,
|
||||
})
|
||||
|
||||
const CustomTableCell = TableCell.extend({
|
||||
addAttributes() {
|
||||
return {
|
||||
|
@ -250,18 +237,12 @@ const editor = useEditor({
|
|||
// Custom TableCell with backgroundColor attribute
|
||||
CustomTableCell,
|
||||
|
||||
// // start
|
||||
// Document,
|
||||
// // Text,
|
||||
Image,
|
||||
|
||||
// // Tasks
|
||||
// CustomDocument,
|
||||
TaskList,
|
||||
CustomTaskItem,
|
||||
|
||||
// // character count
|
||||
// CharacterCount,
|
||||
TaskItem.configure({
|
||||
nested: true,
|
||||
}),
|
||||
|
||||
CodeBlockLowlight.configure({
|
||||
lowlight,
|
||||
|
@ -618,26 +599,6 @@ ul[data-type='taskList'] {
|
|||
}
|
||||
}
|
||||
|
||||
// character count
|
||||
.character-count {
|
||||
margin-top: 1rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #68cef8;
|
||||
|
||||
&--warning {
|
||||
color: #fb5151;
|
||||
}
|
||||
|
||||
&__graph {
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
&__text {
|
||||
color: #868e96;
|
||||
}
|
||||
}
|
||||
|
||||
.editor-bubble__wrapper {
|
||||
background: var(--white);
|
||||
border-radius: $radius;
|
||||
|
|
Reference in New Issue