-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:ueberdosis/tiptap
- Loading branch information
Showing
77 changed files
with
1,344 additions
and
506 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
|
||
.item { | ||
display: block; | ||
margin: 0; | ||
width: 100%; | ||
text-align: left; | ||
background: transparent; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,57 @@ | ||
context('/src/Examples/BubbleMenu/React/', () => { | ||
context('/src/Examples/Menus/React/', () => { | ||
before(() => { | ||
cy.visit('/src/Examples/BubbleMenu/React/') | ||
cy.visit('/src/Examples/Menus/React/') | ||
}) | ||
|
||
// TODO: Write tests | ||
beforeEach(() => { | ||
cy.get('.ProseMirror').then(([{ editor }]) => { | ||
editor.chain().focus().clearContent().run() | ||
}) | ||
}) | ||
|
||
// TODO: fix test | ||
// it('should show menu when the editor is empty', () => { | ||
// cy.get('#app') | ||
// .find('[data-tippy-root]') | ||
// }) | ||
|
||
it('should show menu when text is selected', () => { | ||
cy.get('.ProseMirror') | ||
.type('Test') | ||
.type('{selectall}') | ||
|
||
cy.get('#app') | ||
.find('[data-tippy-root]') | ||
}) | ||
|
||
const marks = [ | ||
{ | ||
button: 'Bold', | ||
tag: 'strong', | ||
}, | ||
{ | ||
button: 'Italic', | ||
tag: 'em', | ||
}, | ||
{ | ||
button: 'Strike', | ||
tag: 's', | ||
}, | ||
] | ||
|
||
marks.forEach(mark => { | ||
it(`should apply ${mark.button} correctly`, () => { | ||
cy.get('.ProseMirror') | ||
.type('Test') | ||
.type('{selectall}') | ||
|
||
cy.get('#app') | ||
.find('[data-tippy-root]') | ||
.contains(mark.button) | ||
.click() | ||
|
||
cy.get('.ProseMirror') | ||
.find(`p ${mark.tag}`) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,56 @@ | ||
context('/src/Examples/BubbleMenu/Vue/', () => { | ||
context('/src/Examples/Menus/Vue/', () => { | ||
before(() => { | ||
cy.visit('/src/Examples/BubbleMenu/Vue/') | ||
cy.visit('/src/Examples/Menus/Vue/') | ||
}) | ||
|
||
// TODO: Write tests | ||
beforeEach(() => { | ||
cy.get('.ProseMirror').then(([{ editor }]) => { | ||
editor.chain().focus().clearContent().run() | ||
}) | ||
}) | ||
|
||
it('should show menu when the editor is empty', () => { | ||
cy.get('#app') | ||
.find('[data-tippy-root]') | ||
}) | ||
|
||
it('should show menu when text is selected', () => { | ||
cy.get('.ProseMirror') | ||
.type('Test') | ||
.type('{selectall}') | ||
|
||
cy.get('#app') | ||
.find('[data-tippy-root]') | ||
}) | ||
|
||
const marks = [ | ||
{ | ||
button: 'Bold', | ||
tag: 'strong', | ||
}, | ||
{ | ||
button: 'Italic', | ||
tag: 'em', | ||
}, | ||
{ | ||
button: 'Strike', | ||
tag: 's', | ||
}, | ||
] | ||
|
||
marks.forEach(mark => { | ||
it(`should apply ${mark.button} correctly`, () => { | ||
cy.get('.ProseMirror') | ||
.type('Test') | ||
.type('{selectall}') | ||
|
||
cy.get('#app div') | ||
.find('[data-tippy-root]') | ||
.contains(mark.button) | ||
.click() | ||
|
||
cy.get('.ProseMirror') | ||
.find(`p ${mark.tag}`) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
demos/src/Experiments/ExtensionStorage/React/CustomExtension.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Extension } from '@tiptap/core' | ||
|
||
type CustomStorage = { | ||
foo: number, | ||
} | ||
|
||
export const CustomExtension = Extension.create<{}, CustomStorage>({ | ||
name: 'custom', | ||
|
||
addStorage() { | ||
return { | ||
foo: 123, | ||
} | ||
}, | ||
|
||
onUpdate() { | ||
this.storage.foo += 1 | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module"> | ||
import setup from '../../../../setup/react.ts' | ||
import source from '@source' | ||
setup('Experiments/ExtensionStorage', source) | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.