mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 03:39:01 +08:00
fix: fix imports, fix demos, unpin y-prosemirror
* use @tiptap/pm * unpin y-prosemirror * fix lock file * fix IsolatingClear demo * fix OnUpdateRenderer demo * fix YouTube demo video * update demos * remove unneeded function call
This commit is contained in:
parent
f3cba1e0b0
commit
681aa577bf
29
demos/package-lock.json
generated
29
demos/package-lock.json
generated
@ -18,7 +18,7 @@
|
|||||||
"remixicon": "^2.5.0",
|
"remixicon": "^2.5.0",
|
||||||
"shiki": "^0.10.0",
|
"shiki": "^0.10.0",
|
||||||
"simplify-js": "^1.2.4",
|
"simplify-js": "^1.2.4",
|
||||||
"y-prosemirror": "1.0.20",
|
"y-prosemirror": "^1.2.1",
|
||||||
"y-webrtc": "^10.2.5",
|
"y-webrtc": "^10.2.5",
|
||||||
"yjs": "^13.5.39"
|
"yjs": "^13.5.39"
|
||||||
},
|
},
|
||||||
@ -3874,25 +3874,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/y-prosemirror": {
|
|
||||||
"version": "1.0.20",
|
|
||||||
"resolved": "https://registry.npmjs.org/y-prosemirror/-/y-prosemirror-1.0.20.tgz",
|
|
||||||
"integrity": "sha512-LVMtu3qWo0emeYiP+0jgNcvZkqhzE/otOoro+87q0iVKxy/sMKuiJZnokfJdR4cn9qKx0Un5fIxXqbAlR2bFkA==",
|
|
||||||
"dependencies": {
|
|
||||||
"lib0": "^0.2.42"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "GitHub Sponsors ❤",
|
|
||||||
"url": "https://github.com/sponsors/dmonad"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"prosemirror-model": "^1.7.1",
|
|
||||||
"prosemirror-state": "^1.2.3",
|
|
||||||
"prosemirror-view": "^1.9.10",
|
|
||||||
"y-protocols": "^1.0.1",
|
|
||||||
"yjs": "^13.3.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/y-protocols": {
|
"node_modules/y-protocols": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/y-protocols/-/y-protocols-1.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/y-protocols/-/y-protocols-1.0.5.tgz",
|
||||||
@ -6604,14 +6585,6 @@
|
|||||||
"integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==",
|
"integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==",
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"y-prosemirror": {
|
|
||||||
"version": "1.0.20",
|
|
||||||
"resolved": "https://registry.npmjs.org/y-prosemirror/-/y-prosemirror-1.0.20.tgz",
|
|
||||||
"integrity": "sha512-LVMtu3qWo0emeYiP+0jgNcvZkqhzE/otOoro+87q0iVKxy/sMKuiJZnokfJdR4cn9qKx0Un5fIxXqbAlR2bFkA==",
|
|
||||||
"requires": {
|
|
||||||
"lib0": "^0.2.42"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"y-protocols": {
|
"y-protocols": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/y-protocols/-/y-protocols-1.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/y-protocols/-/y-protocols-1.0.5.tgz",
|
||||||
|
@ -19,9 +19,9 @@
|
|||||||
"remixicon": "^2.5.0",
|
"remixicon": "^2.5.0",
|
||||||
"shiki": "^0.10.0",
|
"shiki": "^0.10.0",
|
||||||
"simplify-js": "^1.2.4",
|
"simplify-js": "^1.2.4",
|
||||||
"y-prosemirror": "1.0.20",
|
"y-prosemirror": "^1.2.2",
|
||||||
"y-webrtc": "^10.2.5",
|
"y-webrtc": "^10.3.0",
|
||||||
"yjs": "^13.5.39"
|
"yjs": "^13.6.11"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.49",
|
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.49",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Plugin, PluginKey } from '@tiptap/pm/state'
|
import { Plugin, PluginKey } from '@tiptap/pm/state'
|
||||||
import { DecorationSet } from 'prosemirror-view'
|
import { DecorationSet } from '@tiptap/pm/view'
|
||||||
import * as Y from 'yjs'
|
import * as Y from 'yjs'
|
||||||
|
|
||||||
import { AnnotationItem } from './AnnotationItem.js'
|
import { AnnotationItem } from './AnnotationItem.js'
|
||||||
|
@ -4,6 +4,7 @@ import { Color } from '@tiptap/extension-color'
|
|||||||
import ListItem from '@tiptap/extension-list-item'
|
import ListItem from '@tiptap/extension-list-item'
|
||||||
import TextStyle from '@tiptap/extension-text-style'
|
import TextStyle from '@tiptap/extension-text-style'
|
||||||
import { EditorContent, Node, useEditor } from '@tiptap/react'
|
import { EditorContent, Node, useEditor } from '@tiptap/react'
|
||||||
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import { content } from '../content.ts'
|
import { content } from '../content.ts'
|
||||||
@ -200,6 +201,7 @@ const MenuBar = ({ editor }) => {
|
|||||||
export default () => {
|
export default () => {
|
||||||
const editor = useEditor({
|
const editor = useEditor({
|
||||||
extensions: [
|
extensions: [
|
||||||
|
StarterKit,
|
||||||
WrapperBlock,
|
WrapperBlock,
|
||||||
Color.configure({ types: [TextStyle.name, ListItem.name] }),
|
Color.configure({ types: [TextStyle.name, ListItem.name] }),
|
||||||
TextStyle.configure({ types: [ListItem.name] }),
|
TextStyle.configure({ types: [ListItem.name] }),
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-2'
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
@ -23,5 +23,4 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -52,7 +52,7 @@ export default () => {
|
|||||||
content: `
|
content: `
|
||||||
<p>Tiptap now supports YouTube embeds! Awesome!</p>
|
<p>Tiptap now supports YouTube embeds! Awesome!</p>
|
||||||
<div data-youtube-video>
|
<div data-youtube-video>
|
||||||
<iframe src="https://www.youtube.com/watch?v=cqHqLQgVCgY"></iframe>
|
<iframe src="https://www.youtube.com/watch?v=3lTUAWOgoHs"></iframe>
|
||||||
</div>
|
</div>
|
||||||
<p>Try adding your own video to this editor!</p>
|
<p>Try adding your own video to this editor!</p>
|
||||||
`,
|
`,
|
||||||
|
@ -54,7 +54,7 @@ export default {
|
|||||||
content: `
|
content: `
|
||||||
<p>Tiptap now supports YouTube embeds! Awesome!</p>
|
<p>Tiptap now supports YouTube embeds! Awesome!</p>
|
||||||
<div data-youtube-video>
|
<div data-youtube-video>
|
||||||
<iframe src="https://www.youtube.com/watch?v=cqHqLQgVCgY"></iframe>
|
<iframe src="https://www.youtube.com/watch?v=3lTUAWOgoHs"></iframe>
|
||||||
</div>
|
</div>
|
||||||
<p>Try adding your own video to this editor!</p>
|
<p>Try adding your own video to this editor!</p>
|
||||||
`,
|
`,
|
||||||
|
115
package-lock.json
generated
115
package-lock.json
generated
@ -64,9 +64,9 @@
|
|||||||
"remixicon": "^2.5.0",
|
"remixicon": "^2.5.0",
|
||||||
"shiki": "^0.10.0",
|
"shiki": "^0.10.0",
|
||||||
"simplify-js": "^1.2.4",
|
"simplify-js": "^1.2.4",
|
||||||
"y-prosemirror": "1.0.20",
|
"y-prosemirror": "^1.2.2",
|
||||||
"y-webrtc": "^10.2.5",
|
"y-webrtc": "^10.3.0",
|
||||||
"yjs": "^13.5.39"
|
"yjs": "^13.6.11"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.49",
|
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.49",
|
||||||
@ -1880,26 +1880,6 @@
|
|||||||
"yjs": "^13.6.8"
|
"yjs": "^13.6.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@hocuspocus/provider/node_modules/ws": {
|
|
||||||
"version": "8.16.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz",
|
|
||||||
"integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10.0.0"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"bufferutil": "^4.0.1",
|
|
||||||
"utf-8-validate": ">=5.0.2"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"bufferutil": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"utf-8-validate": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@humanwhocodes/config-array": {
|
"node_modules/@humanwhocodes/config-array": {
|
||||||
"version": "0.9.5",
|
"version": "0.9.5",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
@ -18854,15 +18834,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ws": {
|
"node_modules/ws": {
|
||||||
"version": "7.5.9",
|
"version": "8.16.0",
|
||||||
"license": "MIT",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz",
|
||||||
"optional": true,
|
"integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8.3.0"
|
"node": ">=10.0.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"bufferutil": "^4.0.1",
|
"bufferutil": "^4.0.1",
|
||||||
"utf-8-validate": "^5.0.2"
|
"utf-8-validate": ">=5.0.2"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
"bufferutil": {
|
"bufferutil": {
|
||||||
@ -18890,11 +18870,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/y-prosemirror": {
|
"node_modules/y-prosemirror": {
|
||||||
"version": "1.0.20",
|
"version": "1.2.2",
|
||||||
"license": "MIT",
|
"resolved": "https://registry.npmjs.org/y-prosemirror/-/y-prosemirror-1.2.2.tgz",
|
||||||
|
"integrity": "sha512-hHdnIAhfa8mIoLWtTkMDb6RBzN3lye1QVkaZwVm58sledAA1zTl+yyEtgkrY/sdH6SaQL0rsLj61zHjgr5D0HQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lib0": "^0.2.42"
|
"lib0": "^0.2.42"
|
||||||
},
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16.0.0",
|
||||||
|
"npm": ">=8.0.0"
|
||||||
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "GitHub Sponsors ❤",
|
"type": "GitHub Sponsors ❤",
|
||||||
"url": "https://github.com/sponsors/dmonad"
|
"url": "https://github.com/sponsors/dmonad"
|
||||||
@ -18904,7 +18889,7 @@
|
|||||||
"prosemirror-state": "^1.2.3",
|
"prosemirror-state": "^1.2.3",
|
||||||
"prosemirror-view": "^1.9.10",
|
"prosemirror-view": "^1.9.10",
|
||||||
"y-protocols": "^1.0.1",
|
"y-protocols": "^1.0.1",
|
||||||
"yjs": "^13.3.2"
|
"yjs": "^13.5.38"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/y-protocols": {
|
"node_modules/y-protocols": {
|
||||||
@ -18927,12 +18912,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/y-webrtc": {
|
"node_modules/y-webrtc": {
|
||||||
"version": "10.2.5",
|
"version": "10.3.0",
|
||||||
"license": "MIT",
|
"resolved": "https://registry.npmjs.org/y-webrtc/-/y-webrtc-10.3.0.tgz",
|
||||||
|
"integrity": "sha512-KalJr7dCgUgyVFxoG3CQYbpS0O2qybegD0vI4bYnYHI0MOwoVbucED3RZ5f2o1a5HZb1qEssUKS0H/Upc6p1lA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lib0": "^0.2.42",
|
"lib0": "^0.2.42",
|
||||||
"simple-peer": "^9.11.0",
|
"simple-peer": "^9.11.0",
|
||||||
"y-protocols": "^1.0.5"
|
"y-protocols": "^1.0.6"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"y-webrtc-signaling": "bin/server.js"
|
"y-webrtc-signaling": "bin/server.js"
|
||||||
@ -18945,7 +18931,10 @@
|
|||||||
"url": "https://github.com/sponsors/dmonad"
|
"url": "https://github.com/sponsors/dmonad"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"ws": "^7.2.0"
|
"ws": "^8.14.2"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"yjs": "^13.6.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/y18n": {
|
"node_modules/y18n": {
|
||||||
@ -19004,9 +18993,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/yjs": {
|
"node_modules/yjs": {
|
||||||
"version": "13.6.10",
|
"version": "13.6.11",
|
||||||
"resolved": "https://registry.npmjs.org/yjs/-/yjs-13.6.10.tgz",
|
"resolved": "https://registry.npmjs.org/yjs/-/yjs-13.6.11.tgz",
|
||||||
"integrity": "sha512-1JcyQek1vaMyrDm7Fqfa+pvHg/DURSbVo4VmeN7wjnTKB/lZrfIPhdCj7d8sboK6zLfRBJXegTjc9JlaDd8/Zw==",
|
"integrity": "sha512-FvRRJKX9u270dOLkllGF/UDCWwmIv2Z+ucM4v1QO1TuxdmoiMnSUXH1HAcOKOrkBEhQtPTkxep7tD2DrQB+l0g==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lib0": "^0.2.86"
|
"lib0": "^0.2.86"
|
||||||
},
|
},
|
||||||
@ -19228,56 +19217,6 @@
|
|||||||
"y-prosemirror": "^1.2.1"
|
"y-prosemirror": "^1.2.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/extension-collaboration-cursor/node_modules/y-prosemirror": {
|
|
||||||
"version": "1.2.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/y-prosemirror/-/y-prosemirror-1.2.1.tgz",
|
|
||||||
"integrity": "sha512-czMBfB1eL2awqmOSxQM8cS/fsUOGE6fjvyPLInrh4crPxFiw67wDpwIW+EGBYKRa04sYbS0ScGj7ZgvWuDrmBQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"lib0": "^0.2.42"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.0.0",
|
|
||||||
"npm": ">=8.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "GitHub Sponsors ❤",
|
|
||||||
"url": "https://github.com/sponsors/dmonad"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"prosemirror-model": "^1.7.1",
|
|
||||||
"prosemirror-state": "^1.2.3",
|
|
||||||
"prosemirror-view": "^1.9.10",
|
|
||||||
"y-protocols": "^1.0.1",
|
|
||||||
"yjs": "^13.5.38"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"packages/extension-collaboration/node_modules/y-prosemirror": {
|
|
||||||
"version": "1.2.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/y-prosemirror/-/y-prosemirror-1.2.1.tgz",
|
|
||||||
"integrity": "sha512-czMBfB1eL2awqmOSxQM8cS/fsUOGE6fjvyPLInrh4crPxFiw67wDpwIW+EGBYKRa04sYbS0ScGj7ZgvWuDrmBQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"lib0": "^0.2.42"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.0.0",
|
|
||||||
"npm": ">=8.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "GitHub Sponsors ❤",
|
|
||||||
"url": "https://github.com/sponsors/dmonad"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"prosemirror-model": "^1.7.1",
|
|
||||||
"prosemirror-state": "^1.2.3",
|
|
||||||
"prosemirror-view": "^1.9.10",
|
|
||||||
"y-protocols": "^1.0.1",
|
|
||||||
"yjs": "^13.5.38"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"packages/extension-color": {
|
"packages/extension-color": {
|
||||||
"name": "@tiptap/extension-color",
|
"name": "@tiptap/extension-color",
|
||||||
"version": "2.2.0-rc.8",
|
"version": "2.2.0-rc.8",
|
||||||
|
@ -20,7 +20,5 @@ export function elementFromString(value: string): HTMLElement {
|
|||||||
|
|
||||||
const html = new window.DOMParser().parseFromString(wrappedValue, 'text/html').body
|
const html = new window.DOMParser().parseFromString(wrappedValue, 'text/html').body
|
||||||
|
|
||||||
removeWhitespaces(html)
|
|
||||||
|
|
||||||
return removeWhitespaces(html)
|
return removeWhitespaces(html)
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Extension } from '@tiptap/core'
|
import { Extension } from '@tiptap/core'
|
||||||
import { DecorationAttrs } from 'prosemirror-view'
|
import { DecorationAttrs } from '@tiptap/pm/view'
|
||||||
import { defaultSelectionBuilder, yCursorPlugin } from 'y-prosemirror'
|
import { defaultSelectionBuilder, yCursorPlugin } from 'y-prosemirror'
|
||||||
|
|
||||||
type CollaborationCursorStorage = {
|
type CollaborationCursorStorage = {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
callOrReturn, getExtensionField, mergeAttributes, Node, ParentConfig,
|
callOrReturn, getExtensionField, mergeAttributes, Node, ParentConfig,
|
||||||
} from '@tiptap/core'
|
} from '@tiptap/core'
|
||||||
|
import { DOMOutputSpec } from '@tiptap/pm/model'
|
||||||
import { TextSelection } from '@tiptap/pm/state'
|
import { TextSelection } from '@tiptap/pm/state'
|
||||||
import {
|
import {
|
||||||
addColumnAfter,
|
addColumnAfter,
|
||||||
@ -22,7 +23,6 @@ import {
|
|||||||
toggleHeaderCell,
|
toggleHeaderCell,
|
||||||
} from '@tiptap/pm/tables'
|
} from '@tiptap/pm/tables'
|
||||||
import { NodeView } from '@tiptap/pm/view'
|
import { NodeView } from '@tiptap/pm/view'
|
||||||
import { DOMOutputSpec } from 'prosemirror-model'
|
|
||||||
|
|
||||||
import { TableView } from './TableView.js'
|
import { TableView } from './TableView.js'
|
||||||
import { createColGroup } from './utilities/createColGroup.js'
|
import { createColGroup } from './utilities/createColGroup.js'
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Node as ProseMirrorNode } from '@tiptap/pm/model'
|
import { DOMOutputSpec, Node as ProseMirrorNode } from '@tiptap/pm/model'
|
||||||
import { DOMOutputSpec } from 'prosemirror-model'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a colgroup element for a table node in ProseMirror.
|
* Creates a colgroup element for a table node in ProseMirror.
|
||||||
|
Loading…
Reference in New Issue
Block a user