Skip to content

Commit 14afcad

Browse files
committed
Merge branch 'develop' into next
2 parents e9ff069 + 112d149 commit 14afcad

File tree

67 files changed

+2014
-4594
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2014
-4594
lines changed

.changeset/config.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
33
"changelog": "@changesets/cli/changelog",
44
"commit": false,
5-
"fixed": [
6-
["@tiptap/*"]
7-
],
5+
"fixed": [["@tiptap/*"]],
86
"linked": [],
97
"access": "public",
108
"baseBranch": "main",
119
"updateInternalDependencies": "patch",
12-
"ignore": []
10+
"ignore": [],
11+
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
12+
"onlyUpdatePeerDependentsWhenOutOfRange": true
13+
}
1314
}

.changeset/pink-bobcats-grin.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103

104104
- name: Test ${{ matrix.test-spec.name }}
105105
id: cypress
106-
uses: cypress-io/[email protected].2
106+
uses: cypress-io/[email protected].6
107107
with:
108108
cache-key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
109109
start: npm run serve
@@ -114,15 +114,15 @@ jobs:
114114
quiet: true
115115

116116
- name: Export screenshots (on failure only)
117-
uses: actions/upload-artifact@v4.3.6
117+
uses: actions/upload-artifact@v4.4.0
118118
if: failure()
119119
with:
120120
name: cypress-screenshots
121121
path: tests/cypress/screenshots
122122
retention-days: 7
123123

124124
- name: Export screen recordings (on failure only)
125-
uses: actions/upload-artifact@v4.3.6
125+
uses: actions/upload-artifact@v4.4.0
126126
if: failure()
127127
with:
128128
name: cypress-videos

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
- name: Send release notification
6767
if: steps.changesets.outputs.published == 'true'
6868
id: slack
69-
uses: slackapi/slack-github-action@v1.26.0
69+
uses: slackapi/slack-github-action@v1.27.0
7070
with:
7171
payload: |
7272
{
@@ -78,7 +78,7 @@ jobs:
7878
- name: Send failure notification
7979
if: failure()
8080
id: slack_failure
81-
uses: slackapi/slack-github-action@v1.26.0
81+
uses: slackapi/slack-github-action@v1.27.0
8282
with:
8383
payload: |
8484
{

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ For help, discussion about best practices, or any other conversation that would
8686
<strong>Basewell</strong>
8787
</a>
8888
</td>
89+
<td align="center" width="100">
90+
<a href="https://poggio.io">
91+
<img src="https://unavatar.io/github/poggiolabs" width="25"><br>
92+
<strong>Poggio</strong>
93+
</a>
94+
</td>
8995
</tr>
9096
</table>
9197

demos/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"react": "^18.0.0",
4040
"react-dom": "^18.0.0",
4141
"sass": "^1.49.7",
42-
"svelte": "^4.0.0",
42+
"svelte": "^4.2.19",
4343
"tailwindcss": "^3.3.2",
4444
"typescript": "^5.4.5",
4545
"uuid": "^8.3.2",

demos/src/Extensions/CollaborationCursor/React/index.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import * as Y from 'yjs'
1414
const ydoc = new Y.Doc()
1515
const provider = new WebrtcProvider('tiptap-collaboration-cursor-extension', ydoc)
1616

17-
export default () => {
17+
function Component() {
1818
const editor = useEditor({
1919
extensions: [
2020
Document,
@@ -39,3 +39,11 @@ export default () => {
3939

4040
return <EditorContent editor={editor} />
4141
}
42+
43+
function App() {
44+
const useStrictMode = true
45+
46+
return useStrictMode ? <React.StrictMode><Component /></React.StrictMode> : <Component />
47+
}
48+
49+
export default App

demos/src/Extensions/CollaborationWithMenus/React/index.html

Whitespace-only changes.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import './styles.scss'
2+
3+
import Bold from '@tiptap/extension-bold'
4+
import Collaboration from '@tiptap/extension-collaboration'
5+
import Document from '@tiptap/extension-document'
6+
import Heading from '@tiptap/extension-heading'
7+
import Paragraph from '@tiptap/extension-paragraph'
8+
import Placeholder from '@tiptap/extension-placeholder'
9+
import Text from '@tiptap/extension-text'
10+
import {
11+
BubbleMenu, EditorContent, FloatingMenu, useEditor,
12+
} from '@tiptap/react'
13+
import React from 'react'
14+
import { WebrtcProvider } from 'y-webrtc'
15+
import * as Y from 'yjs'
16+
17+
const ydoc = new Y.Doc()
18+
19+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
20+
const provider = new WebrtcProvider('tiptap-collaboration-extension', ydoc)
21+
22+
export default () => {
23+
const editor = useEditor({
24+
extensions: [
25+
Document,
26+
Paragraph,
27+
Text,
28+
Heading,
29+
Bold,
30+
Collaboration.configure({
31+
document: ydoc,
32+
}),
33+
Placeholder.configure({
34+
placeholder:
35+
'Write something … It’ll be shared with everyone else looking at this example.',
36+
}),
37+
],
38+
})
39+
40+
return (
41+
<>
42+
{editor && (
43+
<>
44+
<BubbleMenu editor={editor}>
45+
<div className="bubble-menu">
46+
<button
47+
onClick={() => editor.chain().focus().toggleBold().run()}
48+
className={editor.isActive('bold') ? 'is-active' : ''}
49+
>
50+
Bold
51+
</button>
52+
</div>
53+
</BubbleMenu>
54+
<FloatingMenu editor={editor}>
55+
<div className="floating-menu">
56+
<button
57+
onClick={() => editor.chain().focus().toggleHeading({ level: 1 }).run()}
58+
className={editor.isActive('heading', { level: 1 }) ? 'is-active' : ''}
59+
>
60+
H1
61+
</button>
62+
</div>
63+
</FloatingMenu>
64+
</>
65+
)}
66+
<EditorContent editor={editor} />
67+
</>
68+
)
69+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
context('/src/Extensions/CollaborationWithMenus/React/', () => {
2+
before(() => {
3+
cy.visit('/src/Extensions/CollaborationWithMenus/React/')
4+
})
5+
6+
it('should have a working tiptap instance', () => {
7+
cy.get('.tiptap').then(([{ editor }]) => {
8+
// eslint-disable-next-line
9+
expect(editor).to.not.be.null
10+
})
11+
})
12+
13+
it('should have menu plugins initiated', () => {
14+
cy.get('.tiptap').then(([{ editor }]) => {
15+
const bubbleMenuPlugin = editor.view.state.plugins.find(plugin => plugin.spec.key?.key === 'bubbleMenu$')
16+
const floatingMenuPlugin = editor.view.state.plugins.find(plugin => plugin.spec.key?.key === 'floatingMenu$')
17+
const hasBothMenuPluginsLoaded = !!bubbleMenuPlugin && !!floatingMenuPlugin
18+
19+
expect(hasBothMenuPluginsLoaded).to.equal(true)
20+
})
21+
})
22+
23+
it('should have a ydoc', () => {
24+
cy.get('.tiptap').then(([{ editor }]) => {
25+
/**
26+
* @type {import('yjs').Doc}
27+
*/
28+
const yDoc = editor.extensionManager.extensions.find(a => a.name === 'collaboration').options.document
29+
30+
// eslint-disable-next-line
31+
expect(yDoc).to.not.be.null
32+
})
33+
})
34+
})
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/* Basic editor styles */
2+
.tiptap {
3+
:first-child {
4+
margin-top: 0;
5+
}
6+
7+
/* Placeholder (at the top) */
8+
p.is-editor-empty:first-child::before {
9+
color: var(--gray-4);
10+
content: attr(data-placeholder);
11+
float: left;
12+
height: 0;
13+
pointer-events: none;
14+
}
15+
16+
&.ProseMirror-focused p.is-editor-empty:first-child::before {
17+
content: '';
18+
}
19+
}
20+
21+
/* Bubble menu */
22+
.bubble-menu {
23+
background-color: var(--white);
24+
border: 1px solid var(--gray-1);
25+
border-radius: 0.7rem;
26+
box-shadow: var(--shadow);
27+
display: flex;
28+
padding: 0.2rem;
29+
30+
button {
31+
background-color: unset;
32+
33+
&:hover {
34+
background-color: var(--gray-3);
35+
}
36+
37+
&.is-active {
38+
background-color: var(--purple);
39+
40+
&:hover {
41+
background-color: var(--purple-contrast);
42+
}
43+
}
44+
}
45+
}
46+
47+
/* Floating menu */
48+
.floating-menu {
49+
display: flex;
50+
background-color: var(--gray-3);
51+
padding: 0.1rem;
52+
border-radius: 0.5rem;
53+
54+
button {
55+
background-color: unset;
56+
padding: 0.275rem 0.425rem;
57+
border-radius: 0.3rem;
58+
59+
&:hover {
60+
background-color: var(--gray-3);
61+
}
62+
63+
&.is-active {
64+
background-color: var(--white);
65+
color: var(--purple);
66+
67+
&:hover {
68+
color: var(--purple-contrast);
69+
}
70+
}
71+
}
72+
}

demos/src/Extensions/CollaborationWithMenus/Vue/index.html

Whitespace-only changes.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
context('/src/Extensions/CollaborationWithMenus/Vue/', () => {
2+
before(() => {
3+
cy.visit('/src/Extensions/CollaborationWithMenus/Vue/')
4+
})
5+
6+
it('should have a working tiptap instance', () => {
7+
cy.get('.tiptap').then(([{ editor }]) => {
8+
// eslint-disable-next-line
9+
expect(editor).to.not.be.null
10+
})
11+
})
12+
13+
it('should have menu plugins initiated', () => {
14+
cy.get('.tiptap').then(([{ editor }]) => {
15+
const bubbleMenuPlugin = editor.view.state.plugins.find(plugin => plugin.spec.key?.key === 'bubbleMenu$')
16+
const floatingMenuPlugin = editor.view.state.plugins.find(plugin => plugin.spec.key?.key === 'floatingMenu$')
17+
const hasBothMenuPluginsLoaded = !!bubbleMenuPlugin && !!floatingMenuPlugin
18+
19+
expect(hasBothMenuPluginsLoaded).to.equal(true)
20+
})
21+
})
22+
23+
it('should have a ydoc', () => {
24+
cy.get('.tiptap').then(([{ editor }]) => {
25+
/**
26+
* @type {import('yjs').Doc}
27+
*/
28+
const yDoc = editor.extensionManager.extensions.find(a => a.name === 'collaboration').options.document
29+
30+
// eslint-disable-next-line
31+
expect(yDoc).to.not.be.null
32+
})
33+
})
34+
})

0 commit comments

Comments
 (0)