add precommit hook for linting and automatic eslint fixes + update eslint packages (#2862)
* chore: add precommit hook for eslint fixes, fix linting issues * chore: add eslint import sort plugin
This commit is contained in:
@@ -20,6 +20,7 @@ module.exports = {
|
|||||||
'html',
|
'html',
|
||||||
'cypress',
|
'cypress',
|
||||||
'@typescript-eslint',
|
'@typescript-eslint',
|
||||||
|
'simple-import-sort',
|
||||||
],
|
],
|
||||||
env: {
|
env: {
|
||||||
'cypress/globals': true,
|
'cypress/globals': true,
|
||||||
@@ -90,6 +91,8 @@ module.exports = {
|
|||||||
'@typescript-eslint/ban-types': 'off',
|
'@typescript-eslint/ban-types': 'off',
|
||||||
'@typescript-eslint/comma-dangle': ['error', 'always-multiline'],
|
'@typescript-eslint/comma-dangle': ['error', 'always-multiline'],
|
||||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||||
|
'simple-import-sort/imports': 'error',
|
||||||
|
'simple-import-sort/exports': 'error',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
4
.husky/pre-commit
Executable file
4
.husky/pre-commit
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
. "$(dirname -- "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
npm run lint:fix
|
||||||
@@ -87,6 +87,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getDebugJSON } from '@tiptap/core'
|
import { getDebugJSON } from '@tiptap/core'
|
||||||
|
|
||||||
import DemoFrame from './DemoFrame.vue'
|
import DemoFrame from './DemoFrame.vue'
|
||||||
import Shiki from './Shiki.vue'
|
import Shiki from './Shiki.vue'
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Worker from './shiki.worker?worker'
|
|
||||||
// this import is a bugfix
|
// this import is a bugfix
|
||||||
// otherwise the `onig.wasm` file is missing in the dist folder
|
// otherwise the `onig.wasm` file is missing in the dist folder
|
||||||
import 'shiki/dist/onig.wasm?url'
|
import 'shiki/dist/onig.wasm?url'
|
||||||
|
|
||||||
|
import Worker from './shiki.worker?worker'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
code: {
|
code: {
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
|
import 'iframe-resizer/js/iframeResizer.contentWindow'
|
||||||
|
import './style.css'
|
||||||
|
|
||||||
|
import { demos } from '@demos'
|
||||||
|
import iframeResize from 'iframe-resizer/js/iframeResizer'
|
||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue'
|
||||||
import { createRouter, createWebHistory } from 'vue-router'
|
import { createRouter, createWebHistory } from 'vue-router'
|
||||||
import App from './index.vue'
|
|
||||||
import Demo from './Demo.vue'
|
import Demo from './Demo.vue'
|
||||||
import { demos } from '@demos'
|
import App from './index.vue'
|
||||||
import 'iframe-resizer/js/iframeResizer.contentWindow'
|
|
||||||
import iframeResize from 'iframe-resizer/js/iframeResizer'
|
|
||||||
import './style.css'
|
|
||||||
|
|
||||||
const routes = demos
|
const routes = demos
|
||||||
.map(({ name, tabs }) => {
|
.map(({ name, tabs }) => {
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import * as shiki from 'shiki'
|
import * as shiki from 'shiki'
|
||||||
import onigasm from 'shiki/dist/onig.wasm?url'
|
import onigasm from 'shiki/dist/onig.wasm?url'
|
||||||
import theme from 'shiki/themes/material-darker.json'
|
import langCSS from 'shiki/languages/css.tmLanguage.json'
|
||||||
import langHTML from 'shiki/languages/html.tmLanguage.json'
|
import langHTML from 'shiki/languages/html.tmLanguage.json'
|
||||||
import langJS from 'shiki/languages/javascript.tmLanguage.json'
|
import langJS from 'shiki/languages/javascript.tmLanguage.json'
|
||||||
import langJSX from 'shiki/languages/jsx.tmLanguage.json'
|
import langJSX from 'shiki/languages/jsx.tmLanguage.json'
|
||||||
import langTS from 'shiki/languages/typescript.tmLanguage.json'
|
|
||||||
import langTSX from 'shiki/languages/tsx.tmLanguage.json'
|
|
||||||
import langVueHTML from 'shiki/languages/vue-html.tmLanguage.json'
|
|
||||||
import langVue from 'shiki/languages/vue.tmLanguage.json'
|
|
||||||
import langCSS from 'shiki/languages/css.tmLanguage.json'
|
|
||||||
import langSCSS from 'shiki/languages/scss.tmLanguage.json'
|
import langSCSS from 'shiki/languages/scss.tmLanguage.json'
|
||||||
|
import langTSX from 'shiki/languages/tsx.tmLanguage.json'
|
||||||
|
import langTS from 'shiki/languages/typescript.tmLanguage.json'
|
||||||
|
import langVue from 'shiki/languages/vue.tmLanguage.json'
|
||||||
|
import langVueHTML from 'shiki/languages/vue-html.tmLanguage.json'
|
||||||
|
import theme from 'shiki/themes/material-darker.json'
|
||||||
|
|
||||||
let highlighter = null
|
let highlighter = null
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import 'iframe-resizer/js/iframeResizer.contentWindow'
|
import 'iframe-resizer/js/iframeResizer.contentWindow'
|
||||||
import { debug } from './helper'
|
|
||||||
import './style.scss'
|
import './style.scss'
|
||||||
|
|
||||||
|
import { debug } from './helper'
|
||||||
|
|
||||||
export default function init(name: string, source: any) {
|
export default function init(name: string, source: any) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
window.source = source
|
window.source = source
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
|
import 'iframe-resizer/js/iframeResizer.contentWindow'
|
||||||
|
import './style.scss'
|
||||||
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { createRoot } from 'react-dom/client'
|
import { createRoot } from 'react-dom/client'
|
||||||
import 'iframe-resizer/js/iframeResizer.contentWindow'
|
|
||||||
import { debug, splitName } from './helper'
|
import { debug, splitName } from './helper'
|
||||||
import './style.scss'
|
|
||||||
|
|
||||||
export default function init(name: string, source: any) {
|
export default function init(name: string, source: any) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
import { createApp } from 'vue'
|
|
||||||
import 'iframe-resizer/js/iframeResizer.contentWindow'
|
import 'iframe-resizer/js/iframeResizer.contentWindow'
|
||||||
import { debug, splitName } from './helper'
|
|
||||||
import './style.scss'
|
import './style.scss'
|
||||||
|
|
||||||
|
import { createApp } from 'vue'
|
||||||
|
|
||||||
|
import { debug, splitName } from './helper'
|
||||||
|
|
||||||
export default function init(name: string, source: any) {
|
export default function init(name: string, source: any) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
window.source = source
|
window.source = source
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import './styles.scss'
|
import './styles.scss'
|
||||||
|
|
||||||
import React from 'react'
|
|
||||||
|
|
||||||
import Link from '@tiptap/extension-link'
|
import Link from '@tiptap/extension-link'
|
||||||
import { EditorContent, useEditor } from '@tiptap/react'
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const editor = useEditor({
|
const editor = useEditor({
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
|
||||||
import Link from '@tiptap/extension-link'
|
import Link from '@tiptap/extension-link'
|
||||||
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import React from 'react'
|
|
||||||
import { useEditor, EditorContent } from '@tiptap/react'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
|
||||||
import { content } from '../content.js'
|
|
||||||
import './styles.scss'
|
import './styles.scss'
|
||||||
|
|
||||||
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
import { content } from '../content.js'
|
||||||
|
|
||||||
const MenuBar = ({ editor }) => {
|
const MenuBar = ({ editor }) => {
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
return null
|
return null
|
||||||
|
|||||||
@@ -68,8 +68,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
import { content } from '../content.js'
|
import { content } from '../content.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import './styles.scss'
|
import './styles.scss'
|
||||||
|
|
||||||
import React from 'react'
|
|
||||||
|
|
||||||
import { EditorContent, useEditor } from '@tiptap/react'
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
import styles from './index.module.css'
|
import styles from './index.module.css'
|
||||||
|
|
||||||
|
|||||||
@@ -68,8 +68,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
import styles from './index.module.css'
|
import styles from './index.module.css'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import React from 'react'
|
|
||||||
import { NodeViewWrapper, NodeViewContent } from '@tiptap/react'
|
|
||||||
import './CodeBlockComponent.scss'
|
import './CodeBlockComponent.scss'
|
||||||
|
|
||||||
|
import { NodeViewContent, NodeViewWrapper } from '@tiptap/react'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
export default ({ node: { attrs: { language: defaultLanguage } }, updateAttributes, extension }) => (
|
export default ({ node: { attrs: { language: defaultLanguage } }, updateAttributes, extension }) => (
|
||||||
<NodeViewWrapper className="code-block">
|
<NodeViewWrapper className="code-block">
|
||||||
<select contentEditable={false} defaultValue={defaultLanguage} onChange={event => updateAttributes({ language: event.target.value })}>
|
<select contentEditable={false} defaultValue={defaultLanguage} onChange={event => updateAttributes({ language: event.target.value })}>
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
import React from 'react'
|
|
||||||
import { useEditor, EditorContent, ReactNodeViewRenderer } from '@tiptap/react'
|
|
||||||
import Document from '@tiptap/extension-document'
|
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
|
||||||
import Text from '@tiptap/extension-text'
|
|
||||||
import CodeBlockLowlight from '@tiptap/extension-code-block-lowlight'
|
|
||||||
import CodeBlockComponent from './CodeBlockComponent'
|
|
||||||
|
|
||||||
// load all highlight.js languages
|
|
||||||
import lowlight from 'lowlight'
|
|
||||||
|
|
||||||
// load specific languages only
|
// load specific languages only
|
||||||
// import lowlight from 'lowlight/lib/core'
|
// import lowlight from 'lowlight/lib/core'
|
||||||
// import javascript from 'highlight.js/lib/languages/javascript'
|
// import javascript from 'highlight.js/lib/languages/javascript'
|
||||||
// lowlight.registerLanguage('javascript', javascript)
|
// lowlight.registerLanguage('javascript', javascript)
|
||||||
import './styles.scss'
|
import './styles.scss'
|
||||||
|
|
||||||
|
import CodeBlockLowlight from '@tiptap/extension-code-block-lowlight'
|
||||||
|
import Document from '@tiptap/extension-document'
|
||||||
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
|
import Text from '@tiptap/extension-text'
|
||||||
|
import { EditorContent, ReactNodeViewRenderer, useEditor } from '@tiptap/react'
|
||||||
|
// load all highlight.js languages
|
||||||
|
import lowlight from 'lowlight'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
import CodeBlockComponent from './CodeBlockComponent'
|
||||||
|
|
||||||
const MenuBar = ({ editor }) => {
|
const MenuBar = ({ editor }) => {
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
return null
|
return null
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { NodeViewWrapper, NodeViewContent, nodeViewProps } from '@tiptap/vue-3'
|
import { NodeViewContent, nodeViewProps, NodeViewWrapper } from '@tiptap/vue-3'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -8,16 +8,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent, VueNodeViewRenderer } from '@tiptap/vue-3'
|
import CodeBlockLowlight from '@tiptap/extension-code-block-lowlight'
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
import CodeBlockLowlight from '@tiptap/extension-code-block-lowlight'
|
import { Editor, EditorContent, VueNodeViewRenderer } from '@tiptap/vue-3'
|
||||||
import CodeBlockComponent from './CodeBlockComponent.vue'
|
|
||||||
|
|
||||||
// load all highlight.js languages
|
// load all highlight.js languages
|
||||||
import lowlight from 'lowlight'
|
import lowlight from 'lowlight'
|
||||||
|
|
||||||
|
import CodeBlockComponent from './CodeBlockComponent.vue'
|
||||||
|
|
||||||
// load specific languages only
|
// load specific languages only
|
||||||
// import lowlight from 'lowlight/lib/core'
|
// import lowlight from 'lowlight/lib/core'
|
||||||
// import javascript from 'highlight.js/lib/languages/javascript'
|
// import javascript from 'highlight.js/lib/languages/javascript'
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import React, { Fragment } from 'react'
|
|
||||||
import MenuItem from './MenuItem'
|
|
||||||
import './MenuBar.scss'
|
import './MenuBar.scss'
|
||||||
|
|
||||||
|
import React, { Fragment } from 'react'
|
||||||
|
|
||||||
|
import MenuItem from './MenuItem'
|
||||||
|
|
||||||
export default ({ editor }) => {
|
export default ({ editor }) => {
|
||||||
const items = [
|
const items = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react'
|
|
||||||
import './MenuItem.scss'
|
import './MenuItem.scss'
|
||||||
|
|
||||||
|
import React from 'react'
|
||||||
import remixiconUrl from 'remixicon/fonts/remixicon.symbol.svg'
|
import remixiconUrl from 'remixicon/fonts/remixicon.symbol.svg'
|
||||||
|
|
||||||
export default ({
|
export default ({
|
||||||
|
|||||||
@@ -1,18 +1,21 @@
|
|||||||
import React, {
|
import './styles.scss'
|
||||||
useState, useCallback, useEffect,
|
|
||||||
} from 'react'
|
import { HocuspocusProvider } from '@hocuspocus/provider'
|
||||||
import * as Y from 'yjs'
|
|
||||||
import { useEditor, EditorContent } from '@tiptap/react'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
|
||||||
import TaskList from '@tiptap/extension-task-list'
|
|
||||||
import TaskItem from '@tiptap/extension-task-item'
|
|
||||||
import Highlight from '@tiptap/extension-highlight'
|
|
||||||
import CharacterCount from '@tiptap/extension-character-count'
|
import CharacterCount from '@tiptap/extension-character-count'
|
||||||
import Collaboration from '@tiptap/extension-collaboration'
|
import Collaboration from '@tiptap/extension-collaboration'
|
||||||
import CollaborationCursor from '@tiptap/extension-collaboration-cursor'
|
import CollaborationCursor from '@tiptap/extension-collaboration-cursor'
|
||||||
import { HocuspocusProvider } from '@hocuspocus/provider'
|
import Highlight from '@tiptap/extension-highlight'
|
||||||
|
import TaskItem from '@tiptap/extension-task-item'
|
||||||
|
import TaskList from '@tiptap/extension-task-list'
|
||||||
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import React, {
|
||||||
|
useCallback, useEffect,
|
||||||
|
useState,
|
||||||
|
} from 'react'
|
||||||
|
import * as Y from 'yjs'
|
||||||
|
|
||||||
import MenuBar from './MenuBar'
|
import MenuBar from './MenuBar'
|
||||||
import './styles.scss'
|
|
||||||
|
|
||||||
const colors = ['#958DF1', '#F98181', '#FBBC88', '#FAF594', '#70CFF8', '#94FADB', '#B9F18D']
|
const colors = ['#958DF1', '#F98181', '#FBBC88', '#FAF594', '#70CFF8', '#94FADB', '#B9F18D']
|
||||||
const rooms = ['rooms.30', 'rooms.31', 'rooms.32']
|
const rooms = ['rooms.30', 'rooms.31', 'rooms.32']
|
||||||
|
|||||||
@@ -21,16 +21,17 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
import { HocuspocusProvider } from '@hocuspocus/provider'
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import CharacterCount from '@tiptap/extension-character-count'
|
||||||
import Collaboration from '@tiptap/extension-collaboration'
|
import Collaboration from '@tiptap/extension-collaboration'
|
||||||
import CollaborationCursor from '@tiptap/extension-collaboration-cursor'
|
import CollaborationCursor from '@tiptap/extension-collaboration-cursor'
|
||||||
import TaskList from '@tiptap/extension-task-list'
|
|
||||||
import TaskItem from '@tiptap/extension-task-item'
|
|
||||||
import Highlight from '@tiptap/extension-highlight'
|
import Highlight from '@tiptap/extension-highlight'
|
||||||
import CharacterCount from '@tiptap/extension-character-count'
|
import TaskItem from '@tiptap/extension-task-item'
|
||||||
|
import TaskList from '@tiptap/extension-task-list'
|
||||||
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
import * as Y from 'yjs'
|
import * as Y from 'yjs'
|
||||||
import { HocuspocusProvider } from '@hocuspocus/provider'
|
|
||||||
import MenuBar from './MenuBar.vue'
|
import MenuBar from './MenuBar.vue'
|
||||||
|
|
||||||
const getRandomElement = list => {
|
const getRandomElement = list => {
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import React, {
|
|
||||||
useState,
|
|
||||||
useEffect,
|
|
||||||
forwardRef,
|
|
||||||
useImperativeHandle,
|
|
||||||
} from 'react'
|
|
||||||
import './MentionList.scss'
|
import './MentionList.scss'
|
||||||
|
|
||||||
|
import React, {
|
||||||
|
forwardRef,
|
||||||
|
useEffect,
|
||||||
|
useImperativeHandle,
|
||||||
|
useState,
|
||||||
|
} from 'react'
|
||||||
|
|
||||||
export const MentionList = forwardRef((props, ref) => {
|
export const MentionList = forwardRef((props, ref) => {
|
||||||
const [selectedIndex, setSelectedIndex] = useState(0)
|
const [selectedIndex, setSelectedIndex] = useState(0)
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
import React from 'react'
|
import './styles.scss'
|
||||||
import { useEditor, EditorContent } from '@tiptap/react'
|
|
||||||
|
import CharacterCount from '@tiptap/extension-character-count'
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
|
import Mention from '@tiptap/extension-mention'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
import CharacterCount from '@tiptap/extension-character-count'
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
import Mention from '@tiptap/extension-mention'
|
import React from 'react'
|
||||||
|
|
||||||
import suggestion from './suggestion'
|
import suggestion from './suggestion'
|
||||||
import './styles.scss'
|
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const limit = 280
|
const limit = 280
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import tippy from 'tippy.js'
|
|
||||||
|
|
||||||
import { ReactRenderer } from '@tiptap/react'
|
import { ReactRenderer } from '@tiptap/react'
|
||||||
|
import tippy from 'tippy.js'
|
||||||
|
|
||||||
import { MentionList } from './MentionList'
|
import { MentionList } from './MentionList'
|
||||||
|
|
||||||
|
|||||||
@@ -37,12 +37,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
import CharacterCount from '@tiptap/extension-character-count'
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
|
import Mention from '@tiptap/extension-mention'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
import CharacterCount from '@tiptap/extension-character-count'
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
import Mention from '@tiptap/extension-mention'
|
|
||||||
import suggestion from './suggestion'
|
import suggestion from './suggestion'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import tippy from 'tippy.js'
|
|
||||||
|
|
||||||
import { VueRenderer } from '@tiptap/vue-3'
|
import { VueRenderer } from '@tiptap/vue-3'
|
||||||
|
import tippy from 'tippy.js'
|
||||||
|
|
||||||
import MentionList from './MentionList.vue'
|
import MentionList from './MentionList.vue'
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import React from 'react'
|
import './styles.scss'
|
||||||
import { useEditor, EditorContent } from '@tiptap/react'
|
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Placeholder from '@tiptap/extension-placeholder'
|
import Placeholder from '@tiptap/extension-placeholder'
|
||||||
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
import './styles.scss'
|
import React from 'react'
|
||||||
|
|
||||||
const CustomDocument = Document.extend({
|
const CustomDocument = Document.extend({
|
||||||
content: 'heading block*',
|
content: 'heading block*',
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Placeholder from '@tiptap/extension-placeholder'
|
import Placeholder from '@tiptap/extension-placeholder'
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
const CustomDocument = Document.extend({
|
const CustomDocument = Document.extend({
|
||||||
content: 'heading block*',
|
content: 'heading block*',
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import React from 'react'
|
|
||||||
import { useEditor, EditorContent } from '@tiptap/react'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
|
||||||
import './styles.scss'
|
import './styles.scss'
|
||||||
|
|
||||||
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
const MenuBar = ({ editor }) => {
|
const MenuBar = ({ editor }) => {
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
return null
|
return null
|
||||||
|
|||||||
@@ -68,8 +68,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -26,9 +26,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { NodeViewWrapper, nodeViewProps } from '@tiptap/vue-3'
|
import { nodeViewProps, NodeViewWrapper } from '@tiptap/vue-3'
|
||||||
import { v4 as uuid } from 'uuid'
|
|
||||||
import * as d3 from 'd3'
|
import * as d3 from 'd3'
|
||||||
|
import { v4 as uuid } from 'uuid'
|
||||||
|
|
||||||
const getRandomElement = list => {
|
const getRandomElement = list => {
|
||||||
return list[Math.floor(Math.random() * list.length)]
|
return list[Math.floor(Math.random() * list.length)]
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { VueNodeViewRenderer, Node, mergeAttributes } from '@tiptap/vue-3'
|
import { mergeAttributes, Node, VueNodeViewRenderer } from '@tiptap/vue-3'
|
||||||
|
|
||||||
import Component from './Component.vue'
|
import Component from './Component.vue'
|
||||||
|
|
||||||
export default Node.create({
|
export default Node.create({
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
import Paper from './Paper'
|
import Paper from './Paper'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import React from 'react'
|
|
||||||
import { useEditor, EditorContent } from '@tiptap/react'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
|
||||||
import TextAlign from '@tiptap/extension-text-align'
|
|
||||||
import Highlight from '@tiptap/extension-highlight'
|
|
||||||
import './styles.scss'
|
import './styles.scss'
|
||||||
|
|
||||||
|
import Highlight from '@tiptap/extension-highlight'
|
||||||
|
import TextAlign from '@tiptap/extension-text-align'
|
||||||
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
const MenuBar = ({ editor }) => {
|
const MenuBar = ({ editor }) => {
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
return null
|
return null
|
||||||
|
|||||||
@@ -41,10 +41,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
|
||||||
import TextAlign from '@tiptap/extension-text-align'
|
|
||||||
import Highlight from '@tiptap/extension-highlight'
|
import Highlight from '@tiptap/extension-highlight'
|
||||||
|
import TextAlign from '@tiptap/extension-text-align'
|
||||||
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import './styles.scss'
|
import './styles.scss'
|
||||||
|
|
||||||
import React from 'react'
|
|
||||||
|
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Dropcursor from '@tiptap/extension-dropcursor'
|
import Dropcursor from '@tiptap/extension-dropcursor'
|
||||||
import Image from '@tiptap/extension-image'
|
import Image from '@tiptap/extension-image'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
import { EditorContent, useEditor } from '@tiptap/react'
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const editor = useEditor({
|
const editor = useEditor({
|
||||||
|
|||||||
@@ -6,12 +6,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
|
import Dropcursor from '@tiptap/extension-dropcursor'
|
||||||
|
import Image from '@tiptap/extension-image'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
import Image from '@tiptap/extension-image'
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
import Dropcursor from '@tiptap/extension-dropcursor'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react'
|
|
||||||
import { NodeViewWrapper } from '@tiptap/react'
|
import { NodeViewWrapper } from '@tiptap/react'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
export default props => {
|
export default props => {
|
||||||
const increase = () => {
|
const increase = () => {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Node, mergeAttributes } from '@tiptap/core'
|
import { mergeAttributes, Node } from '@tiptap/core'
|
||||||
import { ReactNodeViewRenderer } from '@tiptap/react'
|
import { ReactNodeViewRenderer } from '@tiptap/react'
|
||||||
|
|
||||||
import Component from './Component.jsx'
|
import Component from './Component.jsx'
|
||||||
|
|
||||||
export default Node.create({
|
export default Node.create({
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import React from 'react'
|
|
||||||
import { useEditor, EditorContent } from '@tiptap/react'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
|
||||||
import ReactComponent from './Extension.js'
|
|
||||||
import './styles.scss'
|
import './styles.scss'
|
||||||
|
|
||||||
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
import ReactComponent from './Extension.js'
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const editor = useEditor({
|
const editor = useEditor({
|
||||||
extensions: [
|
extensions: [
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { NodeViewWrapper, nodeViewProps } from '@tiptap/vue-3'
|
import { nodeViewProps, NodeViewWrapper } from '@tiptap/vue-3'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Node, mergeAttributes } from '@tiptap/core'
|
import { mergeAttributes, Node } from '@tiptap/core'
|
||||||
import { VueNodeViewRenderer } from '@tiptap/vue-3'
|
import { VueNodeViewRenderer } from '@tiptap/vue-3'
|
||||||
|
|
||||||
import Component from './Component.vue'
|
import Component from './Component.vue'
|
||||||
|
|
||||||
export default Node.create({
|
export default Node.create({
|
||||||
|
|||||||
@@ -3,8 +3,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
import VueComponent from './Extension.js'
|
import VueComponent from './Extension.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
import { NodeViewContent, NodeViewWrapper } from '@tiptap/react'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { NodeViewWrapper, NodeViewContent } from '@tiptap/react'
|
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Node, mergeAttributes } from '@tiptap/core'
|
import { mergeAttributes, Node } from '@tiptap/core'
|
||||||
import { ReactNodeViewRenderer } from '@tiptap/react'
|
import { ReactNodeViewRenderer } from '@tiptap/react'
|
||||||
|
|
||||||
import Component from './Component.jsx'
|
import Component from './Component.jsx'
|
||||||
|
|
||||||
export default Node.create({
|
export default Node.create({
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import React from 'react'
|
|
||||||
import { useEditor, EditorContent } from '@tiptap/react'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
|
||||||
import ReactComponent from './Extension.js'
|
|
||||||
import './styles.scss'
|
import './styles.scss'
|
||||||
|
|
||||||
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
import ReactComponent from './Extension.js'
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const editor = useEditor({
|
const editor = useEditor({
|
||||||
extensions: [
|
extensions: [
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { NodeViewWrapper, NodeViewContent, nodeViewProps } from '@tiptap/vue-3'
|
import { NodeViewContent, nodeViewProps, NodeViewWrapper } from '@tiptap/vue-3'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Node, mergeAttributes } from '@tiptap/core'
|
import { mergeAttributes, Node } from '@tiptap/core'
|
||||||
import { VueNodeViewRenderer } from '@tiptap/vue-3'
|
import { VueNodeViewRenderer } from '@tiptap/vue-3'
|
||||||
|
|
||||||
import Component from './Component.vue'
|
import Component from './Component.vue'
|
||||||
|
|
||||||
export default Node.create({
|
export default Node.create({
|
||||||
|
|||||||
@@ -3,8 +3,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
import VueComponent from './Extension.js'
|
import VueComponent from './Extension.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import React from 'react'
|
import './styles.scss'
|
||||||
import { useEditor, EditorContent } from '@tiptap/react'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
|
||||||
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 './styles.scss'
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const editor = useEditor({
|
const editor = useEditor({
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
|
||||||
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 StarterKit from '@tiptap/starter-kit'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import React from 'react'
|
import './styles.scss'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useEditor,
|
|
||||||
EditorContent,
|
|
||||||
BubbleMenu,
|
BubbleMenu,
|
||||||
|
EditorContent,
|
||||||
FloatingMenu,
|
FloatingMenu,
|
||||||
|
useEditor,
|
||||||
} from '@tiptap/react'
|
} from '@tiptap/react'
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
import './styles.scss'
|
import React from 'react'
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const editor = useEditor({
|
const editor = useEditor({
|
||||||
|
|||||||
@@ -37,13 +37,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
import {
|
import {
|
||||||
|
BubbleMenu,
|
||||||
Editor,
|
Editor,
|
||||||
EditorContent,
|
EditorContent,
|
||||||
BubbleMenu,
|
|
||||||
FloatingMenu,
|
FloatingMenu,
|
||||||
} from '@tiptap/vue-3'
|
} from '@tiptap/vue-3'
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import React from 'react'
|
import './styles.scss'
|
||||||
import { useEditor, EditorContent } from '@tiptap/react'
|
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
import './styles.scss'
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const editor = useEditor({
|
const editor = useEditor({
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Extension } from '@tiptap/core'
|
import { Extension } from '@tiptap/core'
|
||||||
import { Plugin } from 'prosemirror-state'
|
import { Plugin } from 'prosemirror-state'
|
||||||
|
|
||||||
import findColors from './findColors'
|
import findColors from './findColors'
|
||||||
|
|
||||||
export const ColorHighlighter = Extension.create({
|
export const ColorHighlighter = Extension.create({
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Decoration, DecorationSet } from 'prosemirror-view'
|
|
||||||
import { Node } from 'prosemirror-model'
|
import { Node } from 'prosemirror-model'
|
||||||
|
import { Decoration, DecorationSet } from 'prosemirror-view'
|
||||||
|
|
||||||
export default function (doc: Node): DecorationSet {
|
export default function (doc: Node): DecorationSet {
|
||||||
const hexColor = /(#[0-9a-f]{3,6})\b/gi
|
const hexColor = /(#[0-9a-f]{3,6})\b/gi
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
import React from 'react'
|
import './styles.scss'
|
||||||
import { useEditor, EditorContent } from '@tiptap/react'
|
|
||||||
|
import Code from '@tiptap/extension-code'
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
import Code from '@tiptap/extension-code'
|
|
||||||
import Typography from '@tiptap/extension-typography'
|
import Typography from '@tiptap/extension-typography'
|
||||||
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
import { ColorHighlighter } from './ColorHighlighter'
|
import { ColorHighlighter } from './ColorHighlighter'
|
||||||
import { SmilieReplacer } from './SmilieReplacer'
|
import { SmilieReplacer } from './SmilieReplacer'
|
||||||
import './styles.scss'
|
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const editor = useEditor({
|
const editor = useEditor({
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Extension } from '@tiptap/core'
|
import { Extension } from '@tiptap/core'
|
||||||
import { Plugin } from 'prosemirror-state'
|
import { Plugin } from 'prosemirror-state'
|
||||||
|
|
||||||
import findColors from './findColors'
|
import findColors from './findColors'
|
||||||
|
|
||||||
export const ColorHighlighter = Extension.create({
|
export const ColorHighlighter = Extension.create({
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Decoration, DecorationSet } from 'prosemirror-view'
|
|
||||||
import { Node } from 'prosemirror-model'
|
import { Node } from 'prosemirror-model'
|
||||||
|
import { Decoration, DecorationSet } from 'prosemirror-view'
|
||||||
|
|
||||||
export default function (doc: Node): DecorationSet {
|
export default function (doc: Node): DecorationSet {
|
||||||
const hexColor = /(#[0-9a-f]{3,6})\b/ig
|
const hexColor = /(#[0-9a-f]{3,6})\b/ig
|
||||||
|
|||||||
@@ -3,12 +3,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
import Code from '@tiptap/extension-code'
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
import Code from '@tiptap/extension-code'
|
|
||||||
import Typography from '@tiptap/extension-typography'
|
import Typography from '@tiptap/extension-typography'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
import { ColorHighlighter } from './ColorHighlighter'
|
import { ColorHighlighter } from './ColorHighlighter'
|
||||||
import { SmilieReplacer } from './SmilieReplacer'
|
import { SmilieReplacer } from './SmilieReplacer'
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import React from 'react'
|
import './styles.scss'
|
||||||
import { useEditor, EditorContent } from '@tiptap/react'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
|
||||||
import Table from '@tiptap/extension-table'
|
import Table from '@tiptap/extension-table'
|
||||||
import TableRow from '@tiptap/extension-table-row'
|
|
||||||
import TableCell from '@tiptap/extension-table-cell'
|
import TableCell from '@tiptap/extension-table-cell'
|
||||||
import TableHeader from '@tiptap/extension-table-header'
|
import TableHeader from '@tiptap/extension-table-header'
|
||||||
import './styles.scss'
|
import TableRow from '@tiptap/extension-table-row'
|
||||||
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
const CustomTableCell = TableCell.extend({
|
const CustomTableCell = TableCell.extend({
|
||||||
addAttributes() {
|
addAttributes() {
|
||||||
|
|||||||
@@ -59,12 +59,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
|
||||||
import Table from '@tiptap/extension-table'
|
import Table from '@tiptap/extension-table'
|
||||||
import TableRow from '@tiptap/extension-table-row'
|
|
||||||
import TableCell from '@tiptap/extension-table-cell'
|
import TableCell from '@tiptap/extension-table-cell'
|
||||||
import TableHeader from '@tiptap/extension-table-header'
|
import TableHeader from '@tiptap/extension-table-header'
|
||||||
|
import TableRow from '@tiptap/extension-table-row'
|
||||||
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
const CustomTableCell = TableCell.extend({
|
const CustomTableCell = TableCell.extend({
|
||||||
addAttributes() {
|
addAttributes() {
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import React from 'react'
|
import './styles.scss'
|
||||||
import { useEditor, EditorContent } from '@tiptap/react'
|
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
|
||||||
import TaskList from '@tiptap/extension-task-list'
|
|
||||||
import TaskItem from '@tiptap/extension-task-item'
|
import TaskItem from '@tiptap/extension-task-item'
|
||||||
import './styles.scss'
|
import TaskList from '@tiptap/extension-task-list'
|
||||||
|
import Text from '@tiptap/extension-text'
|
||||||
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
const CustomDocument = Document.extend({
|
const CustomDocument = Document.extend({
|
||||||
content: 'taskList',
|
content: 'taskList',
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
|
||||||
import TaskList from '@tiptap/extension-task-list'
|
|
||||||
import TaskItem from '@tiptap/extension-task-item'
|
import TaskItem from '@tiptap/extension-task-item'
|
||||||
|
import TaskList from '@tiptap/extension-task-list'
|
||||||
|
import Text from '@tiptap/extension-text'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
const CustomDocument = Document.extend({
|
const CustomDocument = Document.extend({
|
||||||
content: 'taskList',
|
content: 'taskList',
|
||||||
|
|||||||
@@ -70,43 +70,42 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import Blockquote from '@tiptap/extension-blockquote'
|
import Blockquote from '@tiptap/extension-blockquote'
|
||||||
import Bold from '@tiptap/extension-bold'
|
import Bold from '@tiptap/extension-bold'
|
||||||
import BulletList from '@tiptap/extension-bullet-list'
|
import BulletList from '@tiptap/extension-bullet-list'
|
||||||
import Code from '@tiptap/extension-code'
|
import Code from '@tiptap/extension-code'
|
||||||
import CodeBlockLowlight from '@tiptap/extension-code-block-lowlight'
|
import CodeBlockLowlight from '@tiptap/extension-code-block-lowlight'
|
||||||
|
import Color from '@tiptap/extension-color'
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Dropcursor from '@tiptap/extension-dropcursor'
|
import Dropcursor from '@tiptap/extension-dropcursor'
|
||||||
import Gapcursor from '@tiptap/extension-gapcursor'
|
import Gapcursor from '@tiptap/extension-gapcursor'
|
||||||
import HardBreak from '@tiptap/extension-hard-break'
|
import HardBreak from '@tiptap/extension-hard-break'
|
||||||
import Heading from '@tiptap/extension-heading'
|
import Heading from '@tiptap/extension-heading'
|
||||||
|
import Highlight from '@tiptap/extension-highlight'
|
||||||
import History from '@tiptap/extension-history'
|
import History from '@tiptap/extension-history'
|
||||||
import HorizontalRule from '@tiptap/extension-horizontal-rule'
|
import HorizontalRule from '@tiptap/extension-horizontal-rule'
|
||||||
|
import Image from '@tiptap/extension-image'
|
||||||
import Italic from '@tiptap/extension-italic'
|
import Italic from '@tiptap/extension-italic'
|
||||||
|
import Link from '@tiptap/extension-link'
|
||||||
import ListItem from '@tiptap/extension-list-item'
|
import ListItem from '@tiptap/extension-list-item'
|
||||||
|
import Mention from '@tiptap/extension-mention'
|
||||||
import OrderedList from '@tiptap/extension-ordered-list'
|
import OrderedList from '@tiptap/extension-ordered-list'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
|
import Placeholder from '@tiptap/extension-placeholder'
|
||||||
import Strike from '@tiptap/extension-strike'
|
import Strike from '@tiptap/extension-strike'
|
||||||
import Text from '@tiptap/extension-text'
|
|
||||||
import Underline from '@tiptap/extension-underline'
|
|
||||||
import Superscript from '@tiptap/extension-superscript'
|
|
||||||
import Subscript from '@tiptap/extension-subscript'
|
import Subscript from '@tiptap/extension-subscript'
|
||||||
import Link from '@tiptap/extension-link'
|
import Superscript from '@tiptap/extension-superscript'
|
||||||
import Mention from '@tiptap/extension-mention'
|
|
||||||
import Table from '@tiptap/extension-table'
|
import Table from '@tiptap/extension-table'
|
||||||
import TableRow from '@tiptap/extension-table-row'
|
|
||||||
import TableCell from '@tiptap/extension-table-cell'
|
import TableCell from '@tiptap/extension-table-cell'
|
||||||
import TableHeader from '@tiptap/extension-table-header'
|
import TableHeader from '@tiptap/extension-table-header'
|
||||||
import Image from '@tiptap/extension-image'
|
import TableRow from '@tiptap/extension-table-row'
|
||||||
import TaskList from '@tiptap/extension-task-list'
|
|
||||||
import TaskItem from '@tiptap/extension-task-item'
|
import TaskItem from '@tiptap/extension-task-item'
|
||||||
import Placeholder from '@tiptap/extension-placeholder'
|
import TaskList from '@tiptap/extension-task-list'
|
||||||
|
import Text from '@tiptap/extension-text'
|
||||||
import TextAlign from '@tiptap/extension-text-align'
|
import TextAlign from '@tiptap/extension-text-align'
|
||||||
import TextStyle from '@tiptap/extension-text-style'
|
import TextStyle from '@tiptap/extension-text-style'
|
||||||
import Color from '@tiptap/extension-color'
|
import Underline from '@tiptap/extension-underline'
|
||||||
import Highlight from '@tiptap/extension-highlight'
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
import lowlight from 'lowlight'
|
import lowlight from 'lowlight'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import * as Y from 'yjs'
|
|
||||||
import { Plugin, PluginKey } from 'prosemirror-state'
|
import { Plugin, PluginKey } from 'prosemirror-state'
|
||||||
|
import * as Y from 'yjs'
|
||||||
|
|
||||||
import { AnnotationState } from './AnnotationState'
|
import { AnnotationState } from './AnnotationState'
|
||||||
|
|
||||||
export const AnnotationPluginKey = new PluginKey('annotation')
|
export const AnnotationPluginKey = new PluginKey('annotation')
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import * as Y from 'yjs'
|
|
||||||
import { EditorState, Transaction } from 'prosemirror-state'
|
import { EditorState, Transaction } from 'prosemirror-state'
|
||||||
import { Decoration, DecorationSet } from 'prosemirror-view'
|
import { Decoration, DecorationSet } from 'prosemirror-view'
|
||||||
import { ySyncPluginKey, relativePositionToAbsolutePosition, absolutePositionToRelativePosition } from 'y-prosemirror'
|
import { absolutePositionToRelativePosition, relativePositionToAbsolutePosition, ySyncPluginKey } from 'y-prosemirror'
|
||||||
import { AddAnnotationAction, DeleteAnnotationAction, UpdateAnnotationAction } from './collaboration-annotation'
|
import * as Y from 'yjs'
|
||||||
import { AnnotationPluginKey } from './AnnotationPlugin'
|
|
||||||
import { AnnotationItem } from './AnnotationItem'
|
import { AnnotationItem } from './AnnotationItem'
|
||||||
|
import { AnnotationPluginKey } from './AnnotationPlugin'
|
||||||
|
import { AddAnnotationAction, DeleteAnnotationAction, UpdateAnnotationAction } from './collaboration-annotation'
|
||||||
|
|
||||||
export interface AnnotationStateOptions {
|
export interface AnnotationStateOptions {
|
||||||
HTMLAttributes: {
|
HTMLAttributes: {
|
||||||
@@ -91,6 +92,7 @@ export class AnnotationState {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line
|
||||||
console.log(`[${this.options.instance}] Decoration.inline()`, from, to, HTMLAttributes, { id, data: annotation.data })
|
console.log(`[${this.options.instance}] Decoration.inline()`, from, to, HTMLAttributes, { id, data: annotation.data })
|
||||||
|
|
||||||
if (from === to) {
|
if (from === to) {
|
||||||
@@ -110,6 +112,7 @@ export class AnnotationState {
|
|||||||
const action = transaction.getMeta(AnnotationPluginKey) as AddAnnotationAction | UpdateAnnotationAction | DeleteAnnotationAction
|
const action = transaction.getMeta(AnnotationPluginKey) as AddAnnotationAction | UpdateAnnotationAction | DeleteAnnotationAction
|
||||||
|
|
||||||
if (action && action.type) {
|
if (action && action.type) {
|
||||||
|
// eslint-disable-next-line
|
||||||
console.log(`[${this.options.instance}] action: ${action.type}`)
|
console.log(`[${this.options.instance}] action: ${action.type}`)
|
||||||
|
|
||||||
if (action.type === 'addAnnotation') {
|
if (action.type === 'addAnnotation') {
|
||||||
@@ -136,6 +139,7 @@ export class AnnotationState {
|
|||||||
const ystate = ySyncPluginKey.getState(state)
|
const ystate = ySyncPluginKey.getState(state)
|
||||||
|
|
||||||
if (ystate.isChangeOrigin) {
|
if (ystate.isChangeOrigin) {
|
||||||
|
// eslint-disable-next-line
|
||||||
console.log(`[${this.options.instance}] isChangeOrigin: true → createDecorations`)
|
console.log(`[${this.options.instance}] isChangeOrigin: true → createDecorations`)
|
||||||
this.createDecorations(state)
|
this.createDecorations(state)
|
||||||
|
|
||||||
@@ -143,6 +147,7 @@ export class AnnotationState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Use ProseMirror to update positions
|
// Use ProseMirror to update positions
|
||||||
|
// eslint-disable-next-line
|
||||||
console.log(`[${this.options.instance}] isChangeOrigin: false → ProseMirror mapping`)
|
console.log(`[${this.options.instance}] isChangeOrigin: false → ProseMirror mapping`)
|
||||||
this.decorations = this.decorations.map(transaction.mapping, transaction.doc)
|
this.decorations = this.decorations.map(transaction.mapping, transaction.doc)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import * as Y from 'yjs'
|
|
||||||
import { Extension } from '@tiptap/core'
|
import { Extension } from '@tiptap/core'
|
||||||
|
import * as Y from 'yjs'
|
||||||
|
|
||||||
import { AnnotationPlugin, AnnotationPluginKey } from './AnnotationPlugin'
|
import { AnnotationPlugin, AnnotationPluginKey } from './AnnotationPlugin'
|
||||||
|
|
||||||
export interface AddAnnotationAction {
|
export interface AddAnnotationAction {
|
||||||
@@ -81,6 +82,7 @@ export const CollaborationAnnotation = Extension.create<AnnotationOptions>({
|
|||||||
const map = getMapFromOptions(this.options)
|
const map = getMapFromOptions(this.options)
|
||||||
|
|
||||||
map.observe(() => {
|
map.observe(() => {
|
||||||
|
// eslint-disable-next-line
|
||||||
console.log(`[${this.options.instance}] map updated → createDecorations`)
|
console.log(`[${this.options.instance}] map updated → createDecorations`)
|
||||||
|
|
||||||
const transaction = this.editor.state.tr.setMeta(AnnotationPluginKey, {
|
const transaction = this.editor.state.tr.setMeta(AnnotationPluginKey, {
|
||||||
|
|||||||
@@ -32,14 +32,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
import Bold from '@tiptap/extension-bold'
|
||||||
|
import Collaboration from '@tiptap/extension-collaboration'
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
|
import Heading from '@tiptap/extension-heading'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
import Collaboration from '@tiptap/extension-collaboration'
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
import Bold from '@tiptap/extension-bold'
|
|
||||||
import Heading from '@tiptap/extension-heading'
|
|
||||||
import * as Y from 'yjs'
|
import * as Y from 'yjs'
|
||||||
|
|
||||||
import CollaborationAnnotation from './extension'
|
import CollaborationAnnotation from './extension'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -5,8 +5,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
import Commands from './commands'
|
import Commands from './commands'
|
||||||
import suggestion from './suggestion'
|
import suggestion from './suggestion'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import tippy from 'tippy.js'
|
|
||||||
|
|
||||||
import { VueRenderer } from '@tiptap/vue-3'
|
import { VueRenderer } from '@tiptap/vue-3'
|
||||||
|
import tippy from 'tippy.js'
|
||||||
|
|
||||||
import CommandsList from './CommandsList.vue'
|
import CommandsList from './CommandsList.vue'
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
import Iframe from './iframe'
|
import Iframe from './iframe'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import React from 'react'
|
import './styles.scss'
|
||||||
import { useEditor, EditorContent } from '@tiptap/react'
|
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
import { CustomExtension } from './CustomExtension'
|
import { CustomExtension } from './CustomExtension'
|
||||||
import './styles.scss'
|
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const editor = useEditor({
|
const editor = useEditor({
|
||||||
|
|||||||
@@ -4,10 +4,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
import { CustomExtension } from './CustomExtension'
|
import { CustomExtension } from './CustomExtension'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
|
findChildrenInRange,
|
||||||
|
mergeAttributes,
|
||||||
Node,
|
Node,
|
||||||
nodeInputRule,
|
nodeInputRule,
|
||||||
mergeAttributes,
|
|
||||||
findChildrenInRange,
|
|
||||||
Tracker,
|
Tracker,
|
||||||
} from '@tiptap/core'
|
} from '@tiptap/core'
|
||||||
|
|
||||||
|
|||||||
@@ -23,9 +23,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
|
||||||
import Image from '@tiptap/extension-image'
|
import Image from '@tiptap/extension-image'
|
||||||
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
import { Figure } from './figure'
|
import { Figure } from './figure'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Node, mergeAttributes } from '@tiptap/core'
|
import { mergeAttributes, Node } from '@tiptap/core'
|
||||||
|
|
||||||
export const Figcaption = Node.create({
|
export const Figcaption = Node.create({
|
||||||
name: 'figcaption',
|
name: 'figcaption',
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Node, mergeAttributes } from '@tiptap/core'
|
import { mergeAttributes, Node } from '@tiptap/core'
|
||||||
import { Plugin } from 'prosemirror-state'
|
import { Plugin } from 'prosemirror-state'
|
||||||
|
|
||||||
export const Figure = Node.create({
|
export const Figure = Node.create({
|
||||||
|
|||||||
@@ -17,15 +17,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
|
||||||
import Image from '@tiptap/extension-image'
|
import Image from '@tiptap/extension-image'
|
||||||
import Table from '@tiptap/extension-table'
|
import Table from '@tiptap/extension-table'
|
||||||
import TableRow from '@tiptap/extension-table-row'
|
|
||||||
import TableCell from '@tiptap/extension-table-cell'
|
import TableCell from '@tiptap/extension-table-cell'
|
||||||
import TableHeader from '@tiptap/extension-table-header'
|
import TableHeader from '@tiptap/extension-table-header'
|
||||||
import { Figure } from './figure'
|
import TableRow from '@tiptap/extension-table-row'
|
||||||
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
import { Figcaption } from './figcaption'
|
import { Figcaption } from './figcaption'
|
||||||
|
import { Figure } from './figure'
|
||||||
|
|
||||||
const ImageFigure = Figure.extend({
|
const ImageFigure = Figure.extend({
|
||||||
name: 'capturedImage',
|
name: 'capturedImage',
|
||||||
|
|||||||
@@ -5,8 +5,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
import DragHandle from './DragHandle.js'
|
import DragHandle from './DragHandle.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -37,6 +38,7 @@ export default {
|
|||||||
<pre>code</pre>
|
<pre>code</pre>
|
||||||
`,
|
`,
|
||||||
onUpdate: () => {
|
onUpdate: () => {
|
||||||
|
// eslint-disable-next-line
|
||||||
console.log(this.editor.getHTML())
|
console.log(this.editor.getHTML())
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { Extension } from '@tiptap/core'
|
import { Extension } from '@tiptap/core'
|
||||||
import { Decoration, DecorationSet } from 'prosemirror-view'
|
|
||||||
import { Plugin, PluginKey, TextSelection } from 'prosemirror-state'
|
|
||||||
import { Node as ProsemirrorNode } from 'prosemirror-model'
|
import { Node as ProsemirrorNode } from 'prosemirror-model'
|
||||||
|
import { Plugin, PluginKey, TextSelection } from 'prosemirror-state'
|
||||||
|
import { Decoration, DecorationSet } from 'prosemirror-view'
|
||||||
|
|
||||||
import LinterPlugin, { Result as Issue } from './LinterPlugin'
|
import LinterPlugin, { Result as Issue } from './LinterPlugin'
|
||||||
|
|
||||||
interface IconDivElement extends HTMLDivElement {
|
interface IconDivElement extends HTMLDivElement {
|
||||||
@@ -26,10 +27,12 @@ function runAllLinterPlugins(doc: ProsemirrorNode, plugins: Array<typeof LinterP
|
|||||||
}).flat()
|
}).flat()
|
||||||
|
|
||||||
results.forEach(issue => {
|
results.forEach(issue => {
|
||||||
decorations.push(Decoration.inline(issue.from, issue.to, {
|
decorations.push(
|
||||||
|
Decoration.inline(issue.from, issue.to, {
|
||||||
class: 'problem',
|
class: 'problem',
|
||||||
}),
|
}),
|
||||||
Decoration.widget(issue.from, renderIcon(issue)))
|
Decoration.widget(issue.from, renderIcon(issue)),
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
return DecorationSet.create(doc, decorations)
|
return DecorationSet.create(doc, decorations)
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ export * from './Linter'
|
|||||||
export default Linter
|
export default Linter
|
||||||
|
|
||||||
export { BadWords } from './plugins/BadWords'
|
export { BadWords } from './plugins/BadWords'
|
||||||
export { Punctuation } from './plugins/Punctuation'
|
|
||||||
export { HeadingLevel } from './plugins/HeadingLevel'
|
export { HeadingLevel } from './plugins/HeadingLevel'
|
||||||
|
export { Punctuation } from './plugins/Punctuation'
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ export class BadWords extends LinterPlugin {
|
|||||||
if (matches) {
|
if (matches) {
|
||||||
this.record(
|
this.record(
|
||||||
`Try not to say '${matches[0]}'`,
|
`Try not to say '${matches[0]}'`,
|
||||||
position + matches.index, position + matches.index + matches[0].length,
|
position + matches.index,
|
||||||
|
position + matches.index + matches[0].length,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { EditorView } from 'prosemirror-view'
|
import { EditorView } from 'prosemirror-view'
|
||||||
|
|
||||||
import LinterPlugin, { Result as Issue } from '../LinterPlugin'
|
import LinterPlugin, { Result as Issue } from '../LinterPlugin'
|
||||||
|
|
||||||
export class HeadingLevel extends LinterPlugin {
|
export class HeadingLevel extends LinterPlugin {
|
||||||
@@ -17,9 +18,12 @@ export class HeadingLevel extends LinterPlugin {
|
|||||||
const { level } = node.attrs
|
const { level } = node.attrs
|
||||||
|
|
||||||
if (lastHeadLevel != null && level > lastHeadLevel + 1) {
|
if (lastHeadLevel != null && level > lastHeadLevel + 1) {
|
||||||
this.record(`Heading too small (${level} under ${lastHeadLevel})`,
|
this.record(
|
||||||
position + 1, position + 1 + node.content.size,
|
`Heading too small (${level} under ${lastHeadLevel})`,
|
||||||
this.fixHeader(lastHeadLevel + 1))
|
position + 1,
|
||||||
|
position + 1 + node.content.size,
|
||||||
|
this.fixHeader(lastHeadLevel + 1),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
lastHeadLevel = level
|
lastHeadLevel = level
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { EditorView } from 'prosemirror-view'
|
import { EditorView } from 'prosemirror-view'
|
||||||
|
|
||||||
import LinterPlugin, { Result as Issue } from '../LinterPlugin'
|
import LinterPlugin, { Result as Issue } from '../LinterPlugin'
|
||||||
|
|
||||||
export class Punctuation extends LinterPlugin {
|
export class Punctuation extends LinterPlugin {
|
||||||
@@ -8,7 +9,8 @@ export class Punctuation extends LinterPlugin {
|
|||||||
return function ({ state, dispatch }: EditorView, issue: Issue) {
|
return function ({ state, dispatch }: EditorView, issue: Issue) {
|
||||||
dispatch(
|
dispatch(
|
||||||
state.tr.replaceWith(
|
state.tr.replaceWith(
|
||||||
issue.from, issue.to,
|
issue.from,
|
||||||
|
issue.to,
|
||||||
state.schema.text(replacement),
|
state.schema.text(replacement),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -30,7 +32,8 @@ export class Punctuation extends LinterPlugin {
|
|||||||
if (matches) {
|
if (matches) {
|
||||||
this.record(
|
this.record(
|
||||||
'Suspicious spacing around punctuation',
|
'Suspicious spacing around punctuation',
|
||||||
position + matches.index, position + matches.index + matches[0].length,
|
position + matches.index,
|
||||||
|
position + matches.index + matches[0].length,
|
||||||
this.fix(`${matches[1]} `),
|
this.fix(`${matches[1]} `),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,12 +5,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Text from '@tiptap/extension-text'
|
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
|
||||||
import Heading from '@tiptap/extension-heading'
|
import Heading from '@tiptap/extension-heading'
|
||||||
import Linter, { BadWords, Punctuation, HeadingLevel } from './extension'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
|
import Text from '@tiptap/extension-text'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
|
import Linter, { BadWords, HeadingLevel, Punctuation } from './extension'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -28,16 +28,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
import Bold from '@tiptap/extension-bold'
|
||||||
|
import Collaboration from '@tiptap/extension-collaboration'
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
|
||||||
import Bold from '@tiptap/extension-bold'
|
|
||||||
import TaskList from '@tiptap/extension-task-list'
|
|
||||||
import TaskItem from '@tiptap/extension-task-item'
|
import TaskItem from '@tiptap/extension-task-item'
|
||||||
import Collaboration from '@tiptap/extension-collaboration'
|
import TaskList from '@tiptap/extension-task-list'
|
||||||
import * as Y from 'yjs'
|
import Text from '@tiptap/extension-text'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
import { yDocToProsemirrorJSON } from 'y-prosemirror'
|
import { yDocToProsemirrorJSON } from 'y-prosemirror'
|
||||||
|
import * as Y from 'yjs'
|
||||||
|
|
||||||
const ParagraphDocument = Document.extend({
|
const ParagraphDocument = Document.extend({
|
||||||
content: 'paragraph',
|
content: 'paragraph',
|
||||||
|
|||||||
@@ -5,8 +5,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
import { TrailingNode } from './trailing-node'
|
import { TrailingNode } from './trailing-node'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Extension } from '@tiptap/core'
|
import { Extension } from '@tiptap/core'
|
||||||
import { PluginKey, Plugin } from 'prosemirror-state'
|
import { Plugin, PluginKey } from 'prosemirror-state'
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
function nodeEqualsType({ types, node }) {
|
function nodeEqualsType({ types, node }) {
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import React from 'react'
|
|
||||||
import { useEditor, EditorContent, BubbleMenu } from '@tiptap/react'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
|
||||||
import './styles.scss'
|
import './styles.scss'
|
||||||
|
|
||||||
|
import { BubbleMenu, EditorContent, useEditor } from '@tiptap/react'
|
||||||
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const editor = useEditor({
|
const editor = useEditor({
|
||||||
extensions: [
|
extensions: [
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent, BubbleMenu } from '@tiptap/vue-3'
|
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
|
import { BubbleMenu, Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import React from 'react'
|
import './styles.scss'
|
||||||
import { useEditor, EditorContent } from '@tiptap/react'
|
|
||||||
|
import CharacterCount from '@tiptap/extension-character-count'
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
import CharacterCount from '@tiptap/extension-character-count'
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
import './styles.scss'
|
import React from 'react'
|
||||||
|
|
||||||
const limit = 280
|
const limit = 280
|
||||||
|
|
||||||
|
|||||||
@@ -11,11 +11,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
import CharacterCount from '@tiptap/extension-character-count'
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
import CharacterCount from '@tiptap/extension-character-count'
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
import React from 'react'
|
import './styles.scss'
|
||||||
import { useEditor, EditorContent } from '@tiptap/react'
|
|
||||||
|
import Collaboration from '@tiptap/extension-collaboration'
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
|
||||||
import Collaboration from '@tiptap/extension-collaboration'
|
|
||||||
import Placeholder from '@tiptap/extension-placeholder'
|
import Placeholder from '@tiptap/extension-placeholder'
|
||||||
import * as Y from 'yjs'
|
import Text from '@tiptap/extension-text'
|
||||||
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
|
import React from 'react'
|
||||||
import { WebrtcProvider } from 'y-webrtc'
|
import { WebrtcProvider } from 'y-webrtc'
|
||||||
import './styles.scss'
|
import * as Y from 'yjs'
|
||||||
|
|
||||||
const ydoc = new Y.Doc()
|
const ydoc = new Y.Doc()
|
||||||
|
|
||||||
|
|||||||
@@ -3,14 +3,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
import Collaboration from '@tiptap/extension-collaboration'
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
|
||||||
import Collaboration from '@tiptap/extension-collaboration'
|
|
||||||
import Placeholder from '@tiptap/extension-placeholder'
|
import Placeholder from '@tiptap/extension-placeholder'
|
||||||
import * as Y from 'yjs'
|
import Text from '@tiptap/extension-text'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
import { WebrtcProvider } from 'y-webrtc'
|
import { WebrtcProvider } from 'y-webrtc'
|
||||||
|
import * as Y from 'yjs'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
import React from 'react'
|
import './styles.scss'
|
||||||
import { useEditor, EditorContent } from '@tiptap/react'
|
|
||||||
import Document from '@tiptap/extension-document'
|
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
|
||||||
import Text from '@tiptap/extension-text'
|
|
||||||
import Collaboration from '@tiptap/extension-collaboration'
|
import Collaboration from '@tiptap/extension-collaboration'
|
||||||
import CollaborationCursor from '@tiptap/extension-collaboration-cursor'
|
import CollaborationCursor from '@tiptap/extension-collaboration-cursor'
|
||||||
import * as Y from 'yjs'
|
import Document from '@tiptap/extension-document'
|
||||||
import { WebrtcProvider } from 'y-webrtc'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Placeholder from '@tiptap/extension-placeholder'
|
import Placeholder from '@tiptap/extension-placeholder'
|
||||||
import './styles.scss'
|
import Text from '@tiptap/extension-text'
|
||||||
|
import { EditorContent, useEditor } from '@tiptap/react'
|
||||||
|
import React from 'react'
|
||||||
|
import { WebrtcProvider } from 'y-webrtc'
|
||||||
|
import * as Y from 'yjs'
|
||||||
|
|
||||||
const ydoc = new Y.Doc()
|
const ydoc = new Y.Doc()
|
||||||
const provider = new WebrtcProvider('tiptap-collaboration-cursor-extension', ydoc)
|
const provider = new WebrtcProvider('tiptap-collaboration-cursor-extension', ydoc)
|
||||||
|
|||||||
@@ -3,15 +3,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
||||||
import Document from '@tiptap/extension-document'
|
|
||||||
import Paragraph from '@tiptap/extension-paragraph'
|
|
||||||
import Text from '@tiptap/extension-text'
|
|
||||||
import Collaboration from '@tiptap/extension-collaboration'
|
import Collaboration from '@tiptap/extension-collaboration'
|
||||||
import CollaborationCursor from '@tiptap/extension-collaboration-cursor'
|
import CollaborationCursor from '@tiptap/extension-collaboration-cursor'
|
||||||
import * as Y from 'yjs'
|
import Document from '@tiptap/extension-document'
|
||||||
import { WebrtcProvider } from 'y-webrtc'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Placeholder from '@tiptap/extension-placeholder'
|
import Placeholder from '@tiptap/extension-placeholder'
|
||||||
|
import Text from '@tiptap/extension-text'
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
import { WebrtcProvider } from 'y-webrtc'
|
||||||
|
import * as Y from 'yjs'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user