Skip to content

Commit

Permalink
Merge branch 'develop' into fix/simulated-paste-rules
Browse files Browse the repository at this point in the history
  • Loading branch information
nperez0111 authored Oct 24, 2024
2 parents 4123f1e + c206464 commit 61c3717
Show file tree
Hide file tree
Showing 236 changed files with 5,352 additions and 1,616 deletions.
5 changes: 0 additions & 5 deletions .changeset/chatty-pumas-cross.md

This file was deleted.

9 changes: 5 additions & 4 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [
["@tiptap/*"]
],
"fixed": [["@tiptap/*"]],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
"ignore": [],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
}
5 changes: 0 additions & 5 deletions .changeset/fresh-steaks-kneel.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/khaki-tips-judge.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/lovely-bears-wonder.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/mean-pets-unite.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/metal-shrimps-press.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/nine-pianos-move.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/purple-bobcats-grab.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/rare-trainers-reflect.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/rich-waves-study.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/shaggy-dolphins-applaud.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/shaggy-readers-heal.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/slow-lies-promise.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tender-items-visit.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/thirty-islands-cough.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/warm-bananas-call.md

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Load cached dependencies
uses: actions/cache@v4.0.2
uses: actions/cache@v4.1.0
id: cache
with:
path: |
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:

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

- name: Export screenshots (on failure only)
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
if: failure()
with:
name: cypress-screenshots
path: tests/cypress/screenshots
retention-days: 7

- name: Export screen recordings (on failure only)
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
if: failure()
with:
name: cypress-videos
Expand All @@ -147,7 +147,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Load cached dependencies
uses: actions/cache@v4.0.2
uses: actions/cache@v4.1.0
id: cache
with:
path: |
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
registry-url: 'https://registry.npmjs.org/'

- name: Load cached dependencies
uses: actions/cache@v4.0.2
uses: actions/cache@v4.1.0
id: cache
with:
path: |
Expand All @@ -55,6 +55,7 @@ jobs:
with:
createGithubReleases: false
publish: npm run publish
version: npm run version
title: ${{ github.ref_name == 'main' && 'Publish a new stable version' || 'Publish a new pre-release version' }}
commit: >-
${{ github.ref_name == 'main' && 'chore(release): publish a new release version' || 'chore(release): publish a new pre-release version' }}
Expand All @@ -65,7 +66,7 @@ jobs:
- name: Send release notification
if: steps.changesets.outputs.published == 'true'
id: slack
uses: slackapi/slack-github-action@v1.26.0
uses: slackapi/slack-github-action@v1.27.0
with:
payload: |
{
Expand All @@ -77,7 +78,7 @@ jobs:
- name: Send failure notification
if: failure()
id: slack_failure
uses: slackapi/slack-github-action@v1.26.0
uses: slackapi/slack-github-action@v1.27.0
with:
payload: |
{
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ For help, discussion about best practices, or any other conversation that would
<strong>Basewell</strong>
</a>
</td>
<td align="center" width="100">
<a href="https://poggio.io">
<img src="https://unavatar.io/github/poggiolabs" width="25"><br>
<strong>Poggio</strong>
</a>
</td>
</tr>
</table>

Expand Down
6 changes: 6 additions & 0 deletions demos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 2.5.0

### Minor Changes

- 6834a7f: Bundling of packages no longer includes tiptap dependency type definitions

## 2.4.2

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions demos/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tiptap-demos",
"version": "2.4.2",
"version": "2.5.0",
"private": true,
"type": "module",
"scripts": {
Expand Down Expand Up @@ -39,11 +39,11 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"sass": "^1.49.7",
"svelte": "^4.0.0",
"svelte": "^4.2.19",
"tailwindcss": "^3.3.2",
"typescript": "^5.4.5",
"uuid": "^8.3.2",
"vite": "^5.0.0",
"vite": "^5.4.6",
"vite-plugin-checker": "^0.6.4",
"vue": "^3.0.0",
"vue-router": "^4.0.11"
Expand Down
2 changes: 2 additions & 0 deletions demos/src/Commands/InsertContent/React/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import './styles.scss'

import { Color } from '@tiptap/extension-color'
import Link from '@tiptap/extension-link'
import ListItem from '@tiptap/extension-list-item'
import TextStyle from '@tiptap/extension-text-style'
import { EditorProvider, useCurrentEditor } from '@tiptap/react'
Expand Down Expand Up @@ -48,6 +49,7 @@ const MenuBar = () => {
const extensions = [
Color.configure({ types: [TextStyle.name, ListItem.name] }),
TextStyle.configure({ types: [ListItem.name] }),
Link,
StarterKit.configure({
bulletList: {
keepMarks: true,
Expand Down
26 changes: 25 additions & 1 deletion demos/src/Commands/InsertContent/React/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ context('/src/Commands/InsertContent/React/', () => {
cy.get('button[data-test-id="html-content"]').click()

// check if the content html is correct
cy.get('.tiptap').should('contain.html', '<h1>Tiptap</h1><p><strong>Hello World</strong></p><p>This is a paragraph<br>with a break.</p><p>And this is some additional string content.</p>')
cy.get('.tiptap').should('contain.html', '<h1><a target="_blank" rel="noopener noreferrer nofollow" href="https://tiptap.dev/">Tiptap</a></h1><p><strong>Hello World</strong></p><p>This is a paragraph<br>with a break.</p><p>And this is some additional string content.</p>')
})

it('should keep spaces inbetween tags in html content', () => {
Expand Down Expand Up @@ -91,4 +91,28 @@ context('/src/Commands/InsertContent/React/', () => {
})
})

it('should respect editor.options.parseOptions if defined to be `false`', () => {
cy.get('.tiptap').then(([{ editor }]) => {
editor.options.parseOptions = { preserveWhitespace: false }
editor.commands.insertContent('\n<h1>Tiptap</h1><p><strong>Hello\n World</strong>\n</p>\n')
cy.get('.tiptap').should('contain.html', '<h1>Tiptap</h1><p><strong>Hello World</strong></p>')
})
})

it('should respect editor.options.parseOptions if defined to be `full`', () => {
cy.get('.tiptap').then(([{ editor }]) => {
editor.options.parseOptions = { preserveWhitespace: 'full' }
editor.commands.insertContent('\n<h1>Tiptap</h1><p><strong>Hello\n World</strong>\n</p>\n')
cy.get('.tiptap').should('contain.html', '<h1>Tiptap</h1><p><strong>Hello\n World</strong></p>')
})
})

it('should respect editor.options.parseOptions if defined to be `true`', () => {
cy.get('.tiptap').then(([{ editor }]) => {
editor.options.parseOptions = { preserveWhitespace: true }
editor.commands.insertContent('<h1>Tiptap</h1><p><strong>Hello\n World</strong>\n</p>')
cy.get('.tiptap').should('contain.html', '<h1>Tiptap</h1><p><strong>Hello World</strong></p>')
})
})

})
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ context('/src/Commands/InsertContentApplyingRules/React/', () => {
})

beforeEach(() => {
cy.resetEditor()
cy.get('.tiptap').then(([{ editor }]) => {
editor.commands.clearContent()
})
})

it('should apply list InputRule', () => {
Expand Down
33 changes: 21 additions & 12 deletions demos/src/Demos/CollaborationSplitPane/React/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,23 @@ const getRandomColor = () => getRandomElement(colors)
const getRandomName = () => getRandomElement(names)

const getInitialUser = () => {
return (
{
name: getRandomName(),
color: getRandomColor(),
}
)
return {
name: getRandomName(),
color: getRandomColor(),
}
}

const Editor = ({ ydoc, provider, room }) => {
const Editor = ({
ydoc, provider, room,
}) => {
const [status, setStatus] = useState('connecting')
const [currentUser, setCurrentUser] = useState(getInitialUser)

const editor = useEditor({
enableContentCheck: true,
onContentError: ({ disableCollaboration }) => {
disableCollaboration()
},
onCreate: ({ editor: currentEditor }) => {
provider.on('synced', () => {
if (currentEditor.isEmpty) {
Expand All @@ -99,13 +103,13 @@ const Editor = ({ ydoc, provider, room }) => {
Highlight,
TaskList,
TaskItem,
CharacterCount.configure({
CharacterCount.extend().configure({
limit: 10000,
}),
Collaboration.configure({
Collaboration.extend().configure({
document: ydoc,
}),
CollaborationCursor.configure({
CollaborationCursor.extend().configure({
provider,
}),
],
Expand Down Expand Up @@ -183,15 +187,20 @@ const Editor = ({ ydoc, provider, room }) => {

<EditorContent editor={editor} className="main-group" />

<div className="collab-status-group" data-state={status === 'connected' ? 'online' : 'offline'}>
<div
className="collab-status-group"
data-state={status === 'connected' ? 'online' : 'offline'}
>
<label>
{status === 'connected'
? `${editor.storage.collaborationCursor.users.length} user${
editor.storage.collaborationCursor.users.length === 1 ? '' : 's'
} online in ${room}`
: 'offline'}
</label>
<button style={{ '--color': currentUser.color }} onClick={setName}>{currentUser.name}</button>
<button style={{ '--color': currentUser.color }} onClick={setName}>
{currentUser.name}
</button>
</div>
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion demos/src/Demos/CollaborationSplitPane/React/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const appId = '7j9y6m10'
const room = `room.${new Date()
.getFullYear()
.toString()
.slice(-2)}${new Date().getMonth() + 1}${new Date().getDate()}`
.slice(-2)}${new Date().getMonth() + 1}${new Date().getDate()}-ok`

// ydoc and provider for Editor A
const ydocA = new Y.Doc()
Expand Down
Loading

0 comments on commit 61c3717

Please sign in to comment.