itty-bitty-little test
This commit is contained in:
parent
1ce57f925f
commit
00dbeb1136
|
@ -45,27 +45,21 @@ type EditorProps = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const yDoc = new Y.Doc()
|
const yDoc = new Y.Doc()
|
||||||
// const persisters: Record<string, IndexeddbPersistence> = {}
|
const persisters: Record<string, IndexeddbPersistence> = {}
|
||||||
// const providers: Record<string, WebrtcProvider> = {}
|
const providers: Record<string, WebrtcProvider> = {}
|
||||||
|
|
||||||
const provider = new WebrtcProvider('tiptap-collaboration-extension', yDoc, {
|
|
||||||
signaling: ['wss://0.0.0.0:4444']
|
|
||||||
})
|
|
||||||
|
|
||||||
export const Editor = (props: EditorProps) => {
|
export const Editor = (props: EditorProps) => {
|
||||||
const { t } = useLocalize()
|
const { t } = useLocalize()
|
||||||
const { user } = useSession()
|
const { user } = useSession()
|
||||||
|
|
||||||
const docName = `shout-${props.shoutId}`
|
const docName = `shout-${props.shoutId}`
|
||||||
// if (!persisters[docName]) {
|
if (!persisters[docName]) {
|
||||||
// persisters[docName] = new IndexeddbPersistence(docName, yDoc)
|
persisters[docName] = new IndexeddbPersistence(docName, yDoc)
|
||||||
// }
|
}
|
||||||
|
|
||||||
// if (!providers[docName]) {
|
if (!providers[docName]) {
|
||||||
// providers[docName] = new WebrtcProvider(docName, yDoc, {
|
providers[docName] = new WebrtcProvider(docName, yDoc)
|
||||||
// signaling: ['wss://y-webrtc-signaling-eu.herokuapp.com', 'wss://y-webrtc-signaling-us.herokuapp.com']
|
}
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|
||||||
const editorElRef: {
|
const editorElRef: {
|
||||||
current: HTMLDivElement
|
current: HTMLDivElement
|
||||||
|
@ -120,20 +114,19 @@ export const Editor = (props: EditorProps) => {
|
||||||
Collaboration.configure({
|
Collaboration.configure({
|
||||||
document: yDoc
|
document: yDoc
|
||||||
}),
|
}),
|
||||||
// CollaborationCursor.configure({
|
CollaborationCursor.configure({
|
||||||
// provider: providers[docName],
|
provider: providers[docName],
|
||||||
// user: {
|
user: {
|
||||||
// name: user().name,
|
name: user().name,
|
||||||
// color: uniqolor(user().slug)
|
color: uniqolor(user().slug)
|
||||||
// }
|
}
|
||||||
// }),
|
}),
|
||||||
Placeholder.configure({
|
Placeholder.configure({
|
||||||
placeholder: t('Short opening')
|
placeholder: t('Short opening')
|
||||||
}),
|
}),
|
||||||
Focus,
|
Focus,
|
||||||
Gapcursor,
|
Gapcursor,
|
||||||
HardBreak,
|
HardBreak,
|
||||||
Heading,
|
|
||||||
Highlight,
|
Highlight,
|
||||||
Image,
|
Image,
|
||||||
Youtube,
|
Youtube,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user