Merge branch 'main' of github.com:ueberdosis/tiptap-next into main
This commit is contained in:
@@ -145,7 +145,6 @@ export default {
|
||||
background-color: white;
|
||||
border: 1px solid rgba(black, 0.1);
|
||||
border-radius: 0.5rem;
|
||||
margin-bottom: 1rem;
|
||||
|
||||
&__menu {
|
||||
display: flex;
|
||||
@@ -157,7 +156,9 @@ export default {
|
||||
&__content {
|
||||
padding: 1rem;
|
||||
max-height: 30rem;
|
||||
overflow: auto;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(black, 0.1);
|
||||
@@ -183,7 +184,6 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-radius: 5px;
|
||||
margin-top: 1rem;
|
||||
|
||||
&::before {
|
||||
content: ' ';
|
||||
|
||||
@@ -87,7 +87,9 @@ export default {
|
||||
|
||||
mounted() {
|
||||
this.editor = new Editor({
|
||||
extensions: defaultExtensions(),
|
||||
extensions: [
|
||||
...defaultExtensions(),
|
||||
],
|
||||
content: `
|
||||
<h2>
|
||||
Hi there,
|
||||
|
||||
@@ -13,7 +13,7 @@ context('/demos/Extensions/History', () => {
|
||||
cy.get('.ProseMirror')
|
||||
.should('contain', 'Mistake')
|
||||
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -30,13 +30,13 @@ context('/demos/Extensions/History', () => {
|
||||
cy.get('.ProseMirror')
|
||||
.should('contain', 'Mistake')
|
||||
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
.should('not.contain', 'Mistake')
|
||||
|
||||
cy.get('.demo__preview button:nth-child(2)')
|
||||
cy.get('button:nth-child(2)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
|
||||
@@ -38,7 +38,7 @@ context('/demos/Extensions/TextAlign', () => {
|
||||
})
|
||||
|
||||
it('aligns the text left on the 1st button', () => {
|
||||
cy.get('.demo__preview button:nth-child(1)')
|
||||
cy.get('button:nth-child(1)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -47,7 +47,7 @@ context('/demos/Extensions/TextAlign', () => {
|
||||
})
|
||||
|
||||
it('aligns the text center on the 2nd button', () => {
|
||||
cy.get('.demo__preview button:nth-child(2)')
|
||||
cy.get('button:nth-child(2)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -56,7 +56,7 @@ context('/demos/Extensions/TextAlign', () => {
|
||||
})
|
||||
|
||||
it('aligns the text right on the 3rd button', () => {
|
||||
cy.get('.demo__preview button:nth-child(3)')
|
||||
cy.get('button:nth-child(3)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -65,7 +65,7 @@ context('/demos/Extensions/TextAlign', () => {
|
||||
})
|
||||
|
||||
it('aligns the text justified on the 4th button', () => {
|
||||
cy.get('.demo__preview button:nth-child(4)')
|
||||
cy.get('button:nth-child(4)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -74,7 +74,7 @@ context('/demos/Extensions/TextAlign', () => {
|
||||
})
|
||||
|
||||
it('aligns the text default on the 5th button', () => {
|
||||
cy.get('.demo__preview button:nth-child(5)')
|
||||
cy.get('button:nth-child(5)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
|
||||
@@ -41,7 +41,7 @@ context('/demos/Marks/Bold', () => {
|
||||
})
|
||||
|
||||
it('the button should make the selected text bold', () => {
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -50,9 +50,9 @@ context('/demos/Marks/Bold', () => {
|
||||
})
|
||||
|
||||
it('the button should toggle the selected text bold', () => {
|
||||
cy.get('.demo__preview button:first').click()
|
||||
cy.get('button:first').click()
|
||||
cy.get('.ProseMirror').type('{selectall}')
|
||||
cy.get('.demo__preview button:first').click()
|
||||
cy.get('button:first').click()
|
||||
cy.get('.ProseMirror strong').should('not.exist')
|
||||
})
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ context('/demos/Marks/Code', () => {
|
||||
})
|
||||
|
||||
it('should mark the selected text as inline code', () => {
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -30,13 +30,13 @@ context('/demos/Marks/Code', () => {
|
||||
})
|
||||
|
||||
it('should toggle the selected text as inline code', () => {
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
.type('{selectall}')
|
||||
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror code')
|
||||
|
||||
@@ -14,7 +14,7 @@ context('/demos/Marks/Highlight', () => {
|
||||
})
|
||||
|
||||
it('the button should highlight the selected text', () => {
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -108,13 +108,13 @@ context('/demos/Marks/Highlight', () => {
|
||||
})
|
||||
|
||||
it('the button should toggle the selected text highlighted', () => {
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
.type('{selectall}')
|
||||
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
|
||||
@@ -32,7 +32,7 @@ context('/demos/Marks/Italic', () => {
|
||||
})
|
||||
|
||||
it('the button should make the selected text italic', () => {
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -41,13 +41,13 @@ context('/demos/Marks/Italic', () => {
|
||||
})
|
||||
|
||||
it('the button should toggle the selected text italic', () => {
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
.type('{selectall}')
|
||||
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror em')
|
||||
|
||||
@@ -35,7 +35,7 @@ context('/demos/Marks/Link', () => {
|
||||
cy.window().then(win => {
|
||||
cy.stub(win, 'prompt').returns('https://tiptap.dev')
|
||||
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.window().its('prompt').should('be.called')
|
||||
|
||||
@@ -39,7 +39,7 @@ context('/demos/Marks/Strike', () => {
|
||||
})
|
||||
|
||||
it('the button should strike the selected text', () => {
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -48,13 +48,13 @@ context('/demos/Marks/Strike', () => {
|
||||
})
|
||||
|
||||
it('the button should toggle the selected text striked', () => {
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
.type('{selectall}')
|
||||
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
|
||||
@@ -25,7 +25,7 @@ context('/demos/Marks/Underline', () => {
|
||||
})
|
||||
|
||||
it('the button should underline the selected text', () => {
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -34,13 +34,13 @@ context('/demos/Marks/Underline', () => {
|
||||
})
|
||||
|
||||
it('the button should toggle the selected text underline', () => {
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
.type('{selectall}')
|
||||
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
|
||||
@@ -28,7 +28,7 @@ context('/demos/Nodes/Blockquote', () => {
|
||||
cy.get('.ProseMirror blockquote')
|
||||
.should('not.exist')
|
||||
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -42,7 +42,7 @@ context('/demos/Nodes/Blockquote', () => {
|
||||
cy.get('.ProseMirror').type('{selectall}')
|
||||
})
|
||||
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -54,7 +54,7 @@ context('/demos/Nodes/Blockquote', () => {
|
||||
cy.get('.ProseMirror blockquote')
|
||||
.should('not.exist')
|
||||
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -64,7 +64,7 @@ context('/demos/Nodes/Blockquote', () => {
|
||||
cy.get('.ProseMirror')
|
||||
.type('{selectall}')
|
||||
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror blockquote')
|
||||
|
||||
@@ -31,7 +31,7 @@ context('/demos/Nodes/BulletList', () => {
|
||||
cy.get('.ProseMirror ul li')
|
||||
.should('not.exist')
|
||||
|
||||
cy.get('.demo__preview button:nth-child(1)')
|
||||
cy.get('button:nth-child(1)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -47,14 +47,14 @@ context('/demos/Nodes/BulletList', () => {
|
||||
cy.get('.ProseMirror ul')
|
||||
.should('not.exist')
|
||||
|
||||
cy.get('.demo__preview button:nth-child(1)')
|
||||
cy.get('button:nth-child(1)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
.find('ul')
|
||||
.should('contain', 'Example Text')
|
||||
|
||||
cy.get('.demo__preview button:nth-child(1)')
|
||||
cy.get('button:nth-child(1)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror ul')
|
||||
|
||||
@@ -25,7 +25,7 @@ context('/demos/Nodes/CodeBlock', () => {
|
||||
})
|
||||
|
||||
it('the button should make the selected line a code block', () => {
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -34,7 +34,7 @@ context('/demos/Nodes/CodeBlock', () => {
|
||||
})
|
||||
|
||||
it('the button should toggle the code block', () => {
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -44,7 +44,7 @@ context('/demos/Nodes/CodeBlock', () => {
|
||||
cy.get('.ProseMirror')
|
||||
.type('{selectall}')
|
||||
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror pre')
|
||||
|
||||
@@ -27,7 +27,7 @@ context('/demos/Nodes/HardBreak', () => {
|
||||
cy.get('.ProseMirror br')
|
||||
.should('not.exist')
|
||||
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror br')
|
||||
|
||||
@@ -36,7 +36,7 @@ context('/demos/Nodes/Heading', () => {
|
||||
cy.get('.ProseMirror h1')
|
||||
.should('not.exist')
|
||||
|
||||
cy.get('.demo__preview button:nth-child(1)')
|
||||
cy.get('button:nth-child(1)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -48,7 +48,7 @@ context('/demos/Nodes/Heading', () => {
|
||||
cy.get('.ProseMirror h2')
|
||||
.should('not.exist')
|
||||
|
||||
cy.get('.demo__preview button:nth-child(2)')
|
||||
cy.get('button:nth-child(2)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -60,7 +60,7 @@ context('/demos/Nodes/Heading', () => {
|
||||
cy.get('.ProseMirror h3')
|
||||
.should('not.exist')
|
||||
|
||||
cy.get('.demo__preview button:nth-child(3)')
|
||||
cy.get('button:nth-child(3)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -72,14 +72,14 @@ context('/demos/Nodes/Heading', () => {
|
||||
cy.get('.ProseMirror h1')
|
||||
.should('not.exist')
|
||||
|
||||
cy.get('.demo__preview button:nth-child(1)')
|
||||
cy.get('button:nth-child(1)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
.find('h1')
|
||||
.should('contain', 'Example Text')
|
||||
|
||||
cy.get('.demo__preview button:nth-child(1)')
|
||||
cy.get('button:nth-child(1)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror h1')
|
||||
|
||||
@@ -27,7 +27,7 @@ context('/demos/Nodes/HorizontalRule', () => {
|
||||
cy.get('.ProseMirror hr')
|
||||
.should('not.exist')
|
||||
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror hr')
|
||||
|
||||
@@ -14,7 +14,7 @@ context('/demos/Nodes/Image', () => {
|
||||
cy.window().then(win => {
|
||||
cy.stub(win, 'prompt').returns('foobar.png')
|
||||
|
||||
cy.get('.demo__preview button:first')
|
||||
cy.get('button:first')
|
||||
.click()
|
||||
|
||||
cy.window().its('prompt').should('be.called')
|
||||
|
||||
@@ -31,7 +31,7 @@ context('/demos/Nodes/OrderedList', () => {
|
||||
cy.get('.ProseMirror ol li')
|
||||
.should('not.exist')
|
||||
|
||||
cy.get('.demo__preview button:nth-child(1)')
|
||||
cy.get('button:nth-child(1)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -47,14 +47,14 @@ context('/demos/Nodes/OrderedList', () => {
|
||||
cy.get('.ProseMirror ol')
|
||||
.should('not.exist')
|
||||
|
||||
cy.get('.demo__preview button:nth-child(1)')
|
||||
cy.get('button:nth-child(1)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
.find('ol')
|
||||
.should('contain', 'Example Text')
|
||||
|
||||
cy.get('.demo__preview button:nth-child(1)')
|
||||
cy.get('button:nth-child(1)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror ol')
|
||||
|
||||
@@ -31,7 +31,7 @@ context('/demos/Nodes/TaskList', () => {
|
||||
cy.get('.ProseMirror ul li')
|
||||
.should('not.exist')
|
||||
|
||||
cy.get('.demo__preview button:nth-child(1)')
|
||||
cy.get('button:nth-child(1)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
@@ -47,14 +47,14 @@ context('/demos/Nodes/TaskList', () => {
|
||||
cy.get('.ProseMirror ul')
|
||||
.should('not.exist')
|
||||
|
||||
cy.get('.demo__preview button:nth-child(1)')
|
||||
cy.get('button:nth-child(1)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror')
|
||||
.find('ul[data-type="taskList"]')
|
||||
.should('contain', 'Example Text')
|
||||
|
||||
cy.get('.demo__preview button:nth-child(1)')
|
||||
cy.get('button:nth-child(1)')
|
||||
.click()
|
||||
|
||||
cy.get('.ProseMirror ul')
|
||||
|
||||
Reference in New Issue
Block a user