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>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<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 {marked} from 'marked'
|
||||||
import {refDebounced} from '@vueuse/core'
|
import {refDebounced} from '@vueuse/core'
|
||||||
|
|
||||||
|
@ -94,16 +94,12 @@ import TableHeader from '@tiptap/extension-table-header'
|
||||||
import TableRow from '@tiptap/extension-table-row'
|
import TableRow from '@tiptap/extension-table-row'
|
||||||
import Highlight from '@tiptap/extension-highlight'
|
import Highlight from '@tiptap/extension-highlight'
|
||||||
import Typography from '@tiptap/extension-typography'
|
import Typography from '@tiptap/extension-typography'
|
||||||
import Document from '@tiptap/extension-document'
|
|
||||||
import Image from '@tiptap/extension-image'
|
import Image from '@tiptap/extension-image'
|
||||||
import Underline from '@tiptap/extension-underline'
|
import Underline from '@tiptap/extension-underline'
|
||||||
// import Text from '@tiptap/extension-text'
|
|
||||||
|
|
||||||
import TaskItem from '@tiptap/extension-task-item'
|
import TaskItem from '@tiptap/extension-task-item'
|
||||||
import TaskList from '@tiptap/extension-task-list'
|
import TaskList from '@tiptap/extension-task-list'
|
||||||
|
|
||||||
import CharacterCount from '@tiptap/extension-character-count'
|
|
||||||
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
import {BubbleMenu, EditorContent, useEditor} from '@tiptap/vue-3'
|
import {BubbleMenu, EditorContent, useEditor} from '@tiptap/vue-3'
|
||||||
|
|
||||||
|
@ -113,7 +109,6 @@ import suggestionSetup from './suggestion'
|
||||||
// load all highlight.js languages
|
// load all highlight.js languages
|
||||||
import {lowlight} from 'lowlight'
|
import {lowlight} from 'lowlight'
|
||||||
|
|
||||||
import CodeBlock from './CodeBlock.vue'
|
|
||||||
import type {UploadCallback} from './types'
|
import type {UploadCallback} from './types'
|
||||||
import type {ITask} from '@/modelTypes/ITask'
|
import type {ITask} from '@/modelTypes/ITask'
|
||||||
import type {IAttachment} from '@/modelTypes/IAttachment'
|
import type {IAttachment} from '@/modelTypes/IAttachment'
|
||||||
|
@ -124,14 +119,6 @@ import BaseButton from '@/components/base/BaseButton.vue'
|
||||||
|
|
||||||
const {t} = useI18n()
|
const {t} = useI18n()
|
||||||
|
|
||||||
// const CustomDocument = Document.extend({
|
|
||||||
// content: 'taskList',
|
|
||||||
// })
|
|
||||||
|
|
||||||
const CustomTaskItem = TaskItem.configure({
|
|
||||||
nested: true,
|
|
||||||
})
|
|
||||||
|
|
||||||
const CustomTableCell = TableCell.extend({
|
const CustomTableCell = TableCell.extend({
|
||||||
addAttributes() {
|
addAttributes() {
|
||||||
return {
|
return {
|
||||||
|
@ -250,18 +237,12 @@ const editor = useEditor({
|
||||||
// Custom TableCell with backgroundColor attribute
|
// Custom TableCell with backgroundColor attribute
|
||||||
CustomTableCell,
|
CustomTableCell,
|
||||||
|
|
||||||
// // start
|
|
||||||
// Document,
|
|
||||||
// // Text,
|
|
||||||
Image,
|
Image,
|
||||||
|
|
||||||
// // Tasks
|
|
||||||
// CustomDocument,
|
|
||||||
TaskList,
|
TaskList,
|
||||||
CustomTaskItem,
|
TaskItem.configure({
|
||||||
|
nested: true,
|
||||||
// // character count
|
}),
|
||||||
// CharacterCount,
|
|
||||||
|
|
||||||
CodeBlockLowlight.configure({
|
CodeBlockLowlight.configure({
|
||||||
lowlight,
|
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 {
|
.editor-bubble__wrapper {
|
||||||
background: var(--white);
|
background: var(--white);
|
||||||
border-radius: $radius;
|
border-radius: $radius;
|
||||||
|
|
Reference in New Issue