mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-04 03:29:03 +08:00
remove issue demo
This commit is contained in:
parent
d9b6ef5ce2
commit
425332eea9
@ -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'
|
||||
},
|
||||
})
|
@ -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} />
|
||||
</>
|
||||
)
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
.tiptap {
|
||||
> * + * {
|
||||
margin-top: 0.75em;
|
||||
}
|
||||
|
||||
ul,
|
||||
ol {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
}
|
@ -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'
|
||||
},
|
||||
})
|
Loading…
Reference in New Issue
Block a user