remove issue demo

This commit is contained in:
Dominik Biedebach 2024-11-30 14:23:41 +01:00
parent d9b6ef5ce2
commit 425332eea9
5 changed files with 0 additions and 89 deletions

View File

@ -1,26 +0,0 @@
import { mergeAttributes, Node } from '@tiptap/core'
export default Node.create({
name: 'foo',
group: 'inline',
inline: true,
parseHTML() {
return [
{
tag: 'span',
getAttrs: node => (node as HTMLElement).hasAttribute('data-foo') && null,
},
]
},
renderHTML({ HTMLAttributes }) {
return ['span', mergeAttributes({ 'data-foo': '', HTMLAttributes }), 'foo']
},
renderText() {
return 'foo'
},
})

View File

@ -1,27 +0,0 @@
import './styles.scss'
import { EditorContent, FloatingMenu, useEditor } from '@tiptap/react'
import StarterKit from '@tiptap/starter-kit'
import React from 'react'
import Foo from './foo.js'
export default () => {
const editor = useEditor({
extensions: [
StarterKit, Foo,
],
content: `
<p><span data-foo=''>foo</span></p>
`,
})
return (
<>
{editor && <FloatingMenu editor={editor} tippyOptions={{ duration: 100 }}>
<div>Hello</div>
</FloatingMenu>}
<EditorContent editor={editor} />
</>
)
}

View File

@ -1,10 +0,0 @@
.tiptap {
> * + * {
margin-top: 0.75em;
}
ul,
ol {
padding: 0 1rem;
}
}

View File

@ -1,26 +0,0 @@
import { mergeAttributes, Node } from '@tiptap/core'
export default Node.create({
name: 'foo',
group: 'inline',
inline: true,
parseHTML() {
return [
{
tag: 'span',
getAttrs: node => (node as HTMLElement).hasAttribute('data-foo') && null,
},
]
},
renderHTML({ HTMLAttributes }) {
return ['span', mergeAttributes({ 'data-foo': '', HTMLAttributes }), 'foo']
},
renderText() {
return 'foo'
},
})