{"_id":"@axure/y-tiptap","_rev":"5-61dde13b4d8bce1e773ee0a25eba025a","name":"@axure/y-tiptap","dist-tags":{"latest":"3.0.2-fork.3"},"versions":{"3.0.0-fork.2":{"name":"@axure/y-tiptap","version":"3.0.0-fork.2","keywords":["Yjs"],"license":"MIT","_id":"@axure/y-tiptap@3.0.0-fork.2","maintainers":[{"name":"martinaxure","email":"martin@axure.com"},{"name":"romansp","email":"rspaulau@gmail.com"}],"homepage":"https://github.com/Axure-Software/y-tiptap#readme","bugs":{"url":"https://github.com/Axure-Software/y-tiptap/issues"},"dist":{"shasum":"d5b6e471caa6468df80f0a79bd1ef98fa5845dbc","tarball":"https://registry.npmjs.org/@axure/y-tiptap/-/y-tiptap-3.0.0-fork.2.tgz","fileCount":14,"integrity":"sha512-gTptew9CxGGYUGNrlkyycLB4lFuA+tCoh1yIHWZV1Dn8nAQWdXmHCtwgGwnpIyT5mmuXdtmOuMrmHb53Vz+xAw==","signatures":[{"sig":"MEQCIFxde6spfJzvJ2qq/wLffLRy1c/7o7aZc8L7vsu9o25eAiB6OEuc3je9Cfm3+gUvoyd0KxMFEx6S6Nm8qEHwgHct9Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":423817},"main":"./dist/y-tiptap.cjs","type":"module","types":"./dist/src/y-tiptap.d.ts","module":"./src/y-tiptap.js","engines":{"npm":">=8.0.0","node":">=16.0.0"},"exports":{".":{"types":"./dist/src/y-tiptap.d.ts","import":"./dist/y-tiptap.js","require":"./dist/y-tiptap.cjs"}},"gitHead":"fccbb7724147baf3268c72b84b7827781a7c00ef","scripts":{"dist":"npm run clean && rollup -c && tsc","lint":"standard && tsc","test":"npm run lint && rollup -c && node dist/test.cjs","clean":"rm -rf dist","debug":"concurrently '0serve -o test.html' 'npm run watch'","start":"concurrently '0serve -o demo/prosemirror.html' 'npm run watch'","watch":"rollup -wc","preversion":"npm run lint && npm run dist && npm run test"},"_npmUser":{"name":"romansp","email":"rspaulau@gmail.com"},"standard":{"ignore":["/dist","/node_modules","/docs"]},"overrides":{"yjs":"npm:@axure/yjs@^13.6.27-fork.2"},"repository":{"url":"git+https://github.com/Axure-Software/y-tiptap.git","type":"git"},"_npmVersion":"11.6.0","description":"Tiptap prosemirror bindings for Yjs","directories":{},"sideEffects":false,"_nodeVersion":"22.17.1","dependencies":{"lib0":"^0.2.100"},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^15.1.1","rollup":"^2.59.0","standard":"^17.0.0","y-webrtc":"^10.2.0","typescript":"^5.4.5","http-server":"^0.12.3","y-protocols":"^1.0.5","concurrently":"^4.1.0","prosemirror-view":"^1.26.2","prosemirror-model":"^1.18.1","prosemirror-state":"^1.4.1","prosemirror-transform":"^1.6.0","@rollup/plugin-commonjs":"^21.0.1","prosemirror-schema-basic":"^1.2.0","prosemirror-example-setup":"^1.2.1","@rollup/plugin-node-resolve":"^13.0.6"},"peerDependencies":{"yjs":"npm:@axure/yjs@^13.6.27-fork.2","y-protocols":"^1.0.1","prosemirror-view":"^1.9.10","prosemirror-model":"^1.7.1","prosemirror-state":"^1.2.3"},"_npmOperationalInternal":{"tmp":"tmp/y-tiptap_3.0.0-fork.2_1758239439183_0.9245317637094876","host":"s3://npm-registry-packages-npm-production"}},"3.0.1-fork.1":{"name":"@axure/y-tiptap","version":"3.0.1-fork.1","keywords":["Yjs"],"license":"MIT","_id":"@axure/y-tiptap@3.0.1-fork.1","maintainers":[{"name":"martinaxure","email":"martin@axure.com"},{"name":"romansp","email":"rspaulau@gmail.com"}],"homepage":"https://github.com/Axure-Software/y-tiptap#readme","bugs":{"url":"https://github.com/Axure-Software/y-tiptap/issues"},"dist":{"shasum":"3d09dde1105a8cb81c0caffbd9b71f363962d506","tarball":"https://registry.npmjs.org/@axure/y-tiptap/-/y-tiptap-3.0.1-fork.1.tgz","fileCount":14,"integrity":"sha512-W+FetNpBGOuI5Vp8RIKqpl939sg8RuKTE/VmQEMgKiapwQ8q2iGEND1kdsWGd8wqvEIEd3yUWChwc2XR7HN0RA==","signatures":[{"sig":"MEUCIQCvReSqkgcTRLdodlepHP43JM/eKkvITxXdqZl+rTVCbQIgVbZDhHUKNAhq06t4vZTTiBQ2VYKF8rit8mdDCkyUbCU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@axure%2fy-tiptap@3.0.1-fork.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":425793},"main":"./dist/y-tiptap.cjs","type":"module","types":"./dist/src/y-tiptap.d.ts","module":"./src/y-tiptap.js","engines":{"npm":">=8.0.0","node":">=16.0.0"},"exports":{".":{"types":"./dist/src/y-tiptap.d.ts","import":"./dist/y-tiptap.js","require":"./dist/y-tiptap.cjs"}},"gitHead":"776bf59a5d0b80ed6cc8de040b20c53af99df454","scripts":{"dist":"npm run clean && rollup -c && tsc","lint":"standard && tsc","test":"npm run lint && rollup -c && node dist/test.cjs","clean":"rm -rf dist","debug":"concurrently '0serve -o test.html' 'npm run watch'","start":"concurrently '0serve -o demo/prosemirror.html' 'npm run watch'","watch":"rollup -wc","preversion":"npm run lint && npm run dist && npm run test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:536736b1-f416-4959-9428-db569252909c"}},"standard":{"ignore":["/dist","/node_modules","/docs"]},"overrides":{"yjs":"npm:@axure/yjs@^13.6.27-fork.2"},"repository":{"url":"git+https://github.com/Axure-Software/y-tiptap.git","type":"git"},"_npmVersion":"11.6.2","description":"Tiptap prosemirror bindings for Yjs","directories":{},"sideEffects":false,"_nodeVersion":"24.11.1","dependencies":{"lib0":"^0.2.100"},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^15.1.1","rollup":"^2.59.0","standard":"^17.0.0","y-webrtc":"^10.2.0","typescript":"^5.4.5","http-server":"^0.12.3","y-protocols":"^1.0.5","concurrently":"^4.1.0","prosemirror-view":"^1.26.2","prosemirror-model":"^1.18.1","prosemirror-state":"^1.4.1","prosemirror-transform":"^1.6.0","@rollup/plugin-commonjs":"^21.0.1","prosemirror-schema-basic":"^1.2.0","prosemirror-example-setup":"^1.2.1","@rollup/plugin-node-resolve":"^13.0.6"},"peerDependencies":{"yjs":"npm:@axure/yjs@^13.6.27-fork.2","y-protocols":"^1.0.1","prosemirror-view":"^1.9.10","prosemirror-model":"^1.7.1","prosemirror-state":"^1.2.3"},"_npmOperationalInternal":{"tmp":"tmp/y-tiptap_3.0.1-fork.1_1765766295027_0.1856460093780139","host":"s3://npm-registry-packages-npm-production"}},"3.0.2-fork.1":{"name":"@axure/y-tiptap","version":"3.0.2-fork.1","keywords":["Yjs"],"license":"MIT","_id":"@axure/y-tiptap@3.0.2-fork.1","maintainers":[{"name":"martinaxure","email":"martin@axure.com"},{"name":"romansp","email":"rspaulau@gmail.com"}],"homepage":"https://github.com/Axure-Software/y-tiptap#readme","bugs":{"url":"https://github.com/Axure-Software/y-tiptap/issues"},"dist":{"shasum":"4379b1c0749fd741d2510e7a592ca75e33354384","tarball":"https://registry.npmjs.org/@axure/y-tiptap/-/y-tiptap-3.0.2-fork.1.tgz","fileCount":14,"integrity":"sha512-b7J55gQ/l7QDp55bxz/CvuiefVq2SQhNG9/IIs49DRmdiZ7scnNJ8hlWLd7P7FHvcAiBjCW/lTUqIQ5cRIa95g==","signatures":[{"sig":"MEUCIQDgenMWh+Cpfrp0Z8PTzaFWva6+gcE1icDWCoNIhiQnzQIgKPEhhPuLlidbrfRktU22EhkhLnov1rT9OQBbF+U1JaU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@axure%2fy-tiptap@3.0.2-fork.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":426767},"main":"./dist/y-tiptap.cjs","type":"module","types":"./dist/src/y-tiptap.d.ts","module":"./src/y-tiptap.js","engines":{"npm":">=8.0.0","node":">=16.0.0"},"exports":{".":{"types":"./dist/src/y-tiptap.d.ts","import":"./dist/y-tiptap.js","require":"./dist/y-tiptap.cjs"}},"gitHead":"c27260bf8f5b4f49b036e9020ccdb17d79e92a5d","scripts":{"dist":"npm run clean && rollup -c && tsc","lint":"standard && tsc","test":"npm run lint && rollup -c && node dist/test.cjs","clean":"rm -rf dist","debug":"concurrently '0serve -o test.html' 'npm run watch'","start":"concurrently '0serve -o demo/prosemirror.html' 'npm run watch'","watch":"rollup -wc","preversion":"npm run lint && npm run dist && npm run test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:536736b1-f416-4959-9428-db569252909c"}},"standard":{"ignore":["/dist","/node_modules","/docs"]},"overrides":{"yjs":"npm:@axure/yjs@^13.6.27-fork.2"},"repository":{"url":"git+https://github.com/Axure-Software/y-tiptap.git","type":"git"},"_npmVersion":"11.6.2","description":"Tiptap prosemirror bindings for Yjs","directories":{},"sideEffects":false,"_nodeVersion":"24.13.0","dependencies":{"lib0":"^0.2.100"},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^15.1.1","rollup":"^2.59.0","standard":"^17.0.0","y-webrtc":"^10.2.0","typescript":"^5.4.5","http-server":"^0.12.3","y-protocols":"^1.0.5","concurrently":"^4.1.0","prosemirror-view":"^1.26.2","prosemirror-model":"^1.18.1","prosemirror-state":"^1.4.1","prosemirror-transform":"^1.6.0","@rollup/plugin-commonjs":"^21.0.1","prosemirror-schema-basic":"^1.2.0","prosemirror-example-setup":"^1.2.1","@rollup/plugin-node-resolve":"^13.0.6"},"peerDependencies":{"yjs":"npm:@axure/yjs@^13.6.27-fork.2","y-protocols":"^1.0.1","prosemirror-view":"^1.9.10","prosemirror-model":"^1.7.1","prosemirror-state":"^1.2.3"},"_npmOperationalInternal":{"tmp":"tmp/y-tiptap_3.0.2-fork.1_1769454623462_0.802941637609834","host":"s3://npm-registry-packages-npm-production"}},"3.0.2-fork.2":{"name":"@axure/y-tiptap","version":"3.0.2-fork.2","keywords":["Yjs"],"license":"MIT","_id":"@axure/y-tiptap@3.0.2-fork.2","maintainers":[{"name":"martinaxure","email":"martin@axure.com"},{"name":"romansp","email":"rspaulau@gmail.com"}],"homepage":"https://github.com/Axure-Software/y-tiptap#readme","bugs":{"url":"https://github.com/Axure-Software/y-tiptap/issues"},"dist":{"shasum":"c57e5006a8b03af459c2937bd429cdb942295646","tarball":"https://registry.npmjs.org/@axure/y-tiptap/-/y-tiptap-3.0.2-fork.2.tgz","fileCount":14,"integrity":"sha512-vWVHrNPDPFn6E+lEi33z8D0GwXmENy4E/y63C/9fJWf2z2CHzkyGl6i3ftzFoULER+VOEG5XbrduJIlVSw2DQg==","signatures":[{"sig":"MEYCIQDCCfGXZ+d0za38h85wkmRGxI+SQMXoyltmHbyCnScB4gIhAJxMI4cfJEKXuus0g48FfG2+pgW7PQRgGDT8NSNDLVNm","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@axure%2fy-tiptap@3.0.2-fork.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":426767},"main":"./dist/y-tiptap.cjs","type":"module","types":"./dist/src/y-tiptap.d.ts","module":"./src/y-tiptap.js","engines":{"npm":">=8.0.0","node":">=16.0.0"},"exports":{".":{"types":"./dist/src/y-tiptap.d.ts","import":"./dist/y-tiptap.js","require":"./dist/y-tiptap.cjs"}},"gitHead":"d7ba009bde1adb93a2173e31c348fe7799008712","scripts":{"dist":"npm run clean && rollup -c && tsc","lint":"standard && tsc","test":"npm run lint && rollup -c && node dist/test.cjs","clean":"rm -rf dist","debug":"concurrently '0serve -o test.html' 'npm run watch'","start":"concurrently '0serve -o demo/prosemirror.html' 'npm run watch'","watch":"rollup -wc","preversion":"npm run lint && npm run dist && npm run test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:536736b1-f416-4959-9428-db569252909c"}},"standard":{"ignore":["/dist","/node_modules","/docs"]},"overrides":{"yjs":"npm:@axure/yjs@^13.6.29-fork.1"},"repository":{"url":"git+https://github.com/Axure-Software/y-tiptap.git","type":"git"},"_npmVersion":"11.6.2","description":"Tiptap prosemirror bindings for Yjs","directories":{},"sideEffects":false,"_nodeVersion":"24.13.0","dependencies":{"lib0":"^0.2.100"},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^15.1.1","rollup":"^2.59.0","standard":"^17.0.0","y-webrtc":"^10.2.0","typescript":"^5.4.5","http-server":"^0.12.3","y-protocols":"^1.0.5","concurrently":"^4.1.0","prosemirror-view":"^1.26.2","prosemirror-model":"^1.18.1","prosemirror-state":"^1.4.1","prosemirror-transform":"^1.6.0","@rollup/plugin-commonjs":"^21.0.1","prosemirror-schema-basic":"^1.2.0","prosemirror-example-setup":"^1.2.1","@rollup/plugin-node-resolve":"^13.0.6"},"peerDependencies":{"yjs":"npm:@axure/yjs@^13.6.29-fork.1","y-protocols":"^1.0.1","prosemirror-view":"^1.9.10","prosemirror-model":"^1.7.1","prosemirror-state":"^1.2.3"},"_npmOperationalInternal":{"tmp":"tmp/y-tiptap_3.0.2-fork.2_1769455609810_0.29629467822655964","host":"s3://npm-registry-packages-npm-production"}},"3.0.2-fork.3":{"name":"@axure/y-tiptap","version":"3.0.2-fork.3","description":"Tiptap prosemirror bindings for Yjs","main":"./dist/y-tiptap.cjs","module":"./src/y-tiptap.js","type":"module","types":"./dist/src/y-tiptap.d.ts","sideEffects":false,"scripts":{"clean":"rm -rf dist","dist":"npm run clean && rollup -c && tsc","test":"npm run lint && rollup -c && node dist/test.cjs","lint":"standard && tsc","watch":"rollup -wc","debug":"concurrently '0serve -o test.html' 'npm run watch'","preversion":"npm run lint && npm run dist && npm run test","start":"concurrently '0serve -o demo/prosemirror.html' 'npm run watch'"},"exports":{".":{"types":"./dist/src/y-tiptap.d.ts","import":"./dist/y-tiptap.js","require":"./dist/y-tiptap.cjs"}},"repository":{"type":"git","url":"git+https://github.com/Axure-Software/y-tiptap.git"},"keywords":["Yjs"],"license":"MIT","standard":{"ignore":["/dist","/node_modules","/docs"]},"dependencies":{"lib0":"^0.2.100"},"peerDependencies":{"prosemirror-model":"^1.7.1","prosemirror-state":"^1.2.3","prosemirror-view":"^1.9.10","y-protocols":"^1.0.1","yjs":"npm:@axure/yjs@^13.6.29-fork.1"},"devDependencies":{"@rollup/plugin-commonjs":"^21.0.1","@rollup/plugin-node-resolve":"^13.0.6","concurrently":"^4.1.0","http-server":"^0.12.3","jsdom":"^15.1.1","prosemirror-example-setup":"^1.2.1","prosemirror-model":"^1.18.1","prosemirror-schema-basic":"^1.2.0","prosemirror-state":"^1.4.1","prosemirror-transform":"^1.6.0","prosemirror-view":"^1.26.2","rollup":"^2.59.0","standard":"^17.0.0","typescript":"^5.4.5","y-protocols":"^1.0.5","y-webrtc":"^10.2.0"},"overrides":{"yjs":"npm:@axure/yjs@^13.6.29-fork.1"},"engines":{"npm":">=8.0.0","node":">=16.0.0"},"gitHead":"70d790273e355ff594cd1a6615ccfd4cc7c36bdb","_id":"@axure/y-tiptap@3.0.2-fork.3","bugs":{"url":"https://github.com/Axure-Software/y-tiptap/issues"},"homepage":"https://github.com/Axure-Software/y-tiptap#readme","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-g6+GPV991FpiIN0mJ7FfwanPbakEXQOCNHNTy2q1HZGfEx7YrXtBbNDQQmXSJ0+DRo30XM9Brm8JBONaEGSCjA==","shasum":"f3c6a6a8e3a4e484784e99ff2a3700d799ba6424","tarball":"https://registry.npmjs.org/@axure/y-tiptap/-/y-tiptap-3.0.2-fork.3.tgz","fileCount":14,"unpackedSize":427497,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@axure%2fy-tiptap@3.0.2-fork.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC+ATf87WNQs8sageMevpSuBGAQjizxwWc1whAv1xjyWQIgeXCJixnTV+Ra71rgfGTu7wahmcNpsYnaYLLAR2zX5Og="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:536736b1-f416-4959-9428-db569252909c"}},"directories":{},"maintainers":[{"name":"martinaxure","email":"martin@axure.com"},{"name":"romansp","email":"rspaulau@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/y-tiptap_3.0.2-fork.3_1770252038079_0.261067785392072"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-18T23:50:39.037Z","modified":"2026-02-05T00:40:38.582Z","3.0.0-fork.2":"2025-09-18T23:50:39.553Z","3.0.1-fork.1":"2025-12-15T02:38:15.242Z","3.0.2-fork.1":"2026-01-26T19:10:23.596Z","3.0.2-fork.2":"2026-01-26T19:26:50.002Z","3.0.2-fork.3":"2026-02-05T00:40:38.288Z"},"bugs":{"url":"https://github.com/Axure-Software/y-tiptap/issues"},"license":"MIT","homepage":"https://github.com/Axure-Software/y-tiptap#readme","keywords":["Yjs"],"repository":{"type":"git","url":"git+https://github.com/Axure-Software/y-tiptap.git"},"description":"Tiptap prosemirror bindings for Yjs","maintainers":[{"name":"martinaxure","email":"martin@axure.com"},{"name":"romansp","email":"rspaulau@gmail.com"}],"readme":"# y-tiptap\n\n> [Tiptap](http://tiptap.dev/) Binding for [Yjs](https://github.com/yjs/yjs)\n\nThis binding maps a Y.XmlFragment to the ProseMirror state.\n\n## Why was this package forked from [y-prosemirror](https://github.com/yjs/y-prosemirror)?\n\nWe forked y-prosemirror to create a Tiptap-specific package with changes we needed for Tiptap-related features. These modifications were too specific to be merged upstream or would have added maintenance overhead for the y-prosemirror maintainers.\n\nWhere feasible, we contribute improvements and fixes back to y-prosemirror to support the broader ecosystem.\n\nThis package is designed for use with Tiptap and is not intended as a general-purpose Yjs binding for ProseMirror.\n\n## Features\n\n* Sync ProseMirror state\n* Shared Cursors\n* Shared Undo / Redo (each client has its own undo-/redo-history)\n* Successfully recovers when concurrents edit result in an invalid document schema\n\n### Example\n\n```js\nimport { ySyncPlugin, yCursorPlugin, yUndoPlugin, undo, redo, initProseMirrorDoc } from '@tiptap/y-tiptap'\nimport { exampleSetup } from 'prosemirror-example-setup'\nimport { keymap } from 'prosemirror-keymap'\n..\n\nconst type = ydocument.get('prosemirror', Y.XmlFragment)\nconst { doc, mapping } = initProseMirrorDoc(type, schema)\n\nconst prosemirrorView = new EditorView(document.querySelector('#editor'), {\n  state: EditorState.create({\n    doc,\n    schema,\n    plugins: [\n        ySyncPlugin(type, { mapping }),\n        yCursorPlugin(provider.awareness),\n        yUndoPlugin(),\n        keymap({\n          'Mod-z': undo,\n          'Mod-y': redo,\n          'Mod-Shift-z': redo\n        })\n      ].concat(exampleSetup({ schema }))\n  })\n})\n```\n\n#### Remote Cursors\n\nThe shared cursors depend on the Awareness instance that is exported by most providers. The [Awareness protocol](https://github.com/yjs/y-protocols#awareness-protocol) handles non-permanent data like the number of users, their user names, their cursor location, and their colors. You can change the name and color of the user like this:\n\n```js\nexample.binding.awareness.setLocalStateField('user', { color: '#008833', name: 'My real name' })\n```\n\nIn order to render cursor information you need to embed custom CSS for the user icon. This is a template that you can use for styling cursor information.\n\n```css\n/* this is a rough fix for the first cursor position when the first paragraph is empty */\n.ProseMirror > .ProseMirror-yjs-cursor:first-child {\n  margin-top: 16px;\n}\n.ProseMirror p:first-child, .ProseMirror h1:first-child, .ProseMirror h2:first-child, .ProseMirror h3:first-child, .ProseMirror h4:first-child, .ProseMirror h5:first-child, .ProseMirror h6:first-child {\n  margin-top: 16px\n}\n/* This gives the remote user caret. The colors are automatically overwritten*/\n.ProseMirror-yjs-cursor {\n  position: relative;\n  margin-left: -1px;\n  margin-right: -1px;\n  border-left: 1px solid black;\n  border-right: 1px solid black;\n  border-color: orange;\n  word-break: normal;\n  pointer-events: none;\n}\n/* This renders the username above the caret */\n.ProseMirror-yjs-cursor > div {\n  position: absolute;\n  top: -1.05em;\n  left: -1px;\n  font-size: 13px;\n  background-color: rgb(250, 129, 0);\n  font-family: serif;\n  font-style: normal;\n  font-weight: normal;\n  line-height: normal;\n  user-select: none;\n  color: white;\n  padding-left: 2px;\n  padding-right: 2px;\n  white-space: nowrap;\n}\n```\n\nYou can also overwrite the default Widget dom by specifying a cursor builder in the yCursorPlugin\n\n```js\n/**\n * This function receives the remote users \"user\" awareness state.\n */\nexport const myCursorBuilder = user => {\n  const cursor = document.createElement('span')\n  cursor.classList.add('ProseMirror-yjs-cursor')\n  cursor.setAttribute('style', `border-color: ${user.color}`)\n  const userDiv = document.createElement('div')\n  userDiv.setAttribute('style', `background-color: ${user.color}`)\n  userDiv.insertBefore(document.createTextNode(user.name), null)\n  cursor.insertBefore(userDiv, null)\n  return cursor\n}\n\nconst prosemirrorView = new EditorView(document.querySelector('#editor'), {\n  state: EditorState.create({\n    schema,\n    plugins: [\n        ySyncPlugin(type),\n        yCursorPlugin(provider.awareness, { cursorBuilder: myCursorBuilder }),\n        yUndoPlugin(),\n        keymap({\n          'Mod-z': undo,\n          'Mod-y': redo,\n          'Mod-Shift-z': redo\n        })\n      ].concat(exampleSetup({ schema }))\n  })\n})\n```\n\n#### Utilities\n\nThe package includes a number of utility methods for converting back and forth between\na Y.Doc and Prosemirror compatible data structures. These can be useful for persisting\nto a datastore or for importing existing documents.\n\n> _Note_: Serializing and deserializing to JSON will not store collaboration history\n> steps and as such should not be used as the primary storage. You will still need\n> to store the Y.Doc binary update format.\n\n```js\nimport { prosemirrorToYDoc } from '@tiptap/y-tiptap'\n\n// Pass JSON previously output from Prosemirror\nconst doc = Node.fromJSON(schema, {\n  type: \"doc\",\n  content: [...]\n})\nconst ydoc = prosemirrorToYDoc(doc)\n```\n\nBecause JSON is a common usecase there is an equivalent method that skips the need\nto create a Prosemirror Node.\n\n```js\nimport { prosemirrorJSONToYDoc } from '@tiptap/y-tiptap'\n\n// Pass JSON previously output from Prosemirror\nconst ydoc = prosemirrorJSONToYDoc(schema, {\n  type: \"doc\",\n  content: [...]\n})\n```\n\n```js\nimport { yDocToProsemirror } from '@tiptap/y-tiptap'\n\n// apply binary updates from elsewhere\nconst ydoc = new Y.Doc()\nydoc.applyUpdate(update)\n\nconst node = yDocToProsemirror(schema, ydoc)\n```\n\nBecause JSON is a common usecase there is an equivalent method that outputs JSON\ndirectly, this method does not require the Prosemirror schema.\n\n```js\nimport { yDocToProsemirrorJSON } from '@tiptap/y-tiptap'\n\n// apply binary updates from elsewhere\nconst ydoc = new Y.Doc()\nydoc.applyUpdate(update)\n\nconst node = yDocToProsemirrorJSON(ydoc)\n```\n\n### Undo/Redo\n\nThe package exports `undo` and `redo` commands which can be used in place of\n[prosemirror-history](https://prosemirror.net/docs/ref/#history) by mapping the\nmod-Z/Y keys - see [ProseMirror](https://github.com/yjs/yjs-demos/blob/main/prosemirror/prosemirror.js#L29)\nand [Tiptap](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-collaboration/src/collaboration.ts)\nexamples.\n\nUndo and redo are be scoped to the local client, so one peer won't undo another's\nchanges. See [Y.UndoManager](https://docs.yjs.dev/api/undo-manager) for more details.\n\nJust like prosemirror-history, you can set a transaction's `addToHistory` meta property\nto false to prevent that transaction from being rolled back by undo. This can be helpful for programmatic\ndocument changes that aren't initiated by the user.\n\n```js\ntr.setMeta(\"addToHistory\", false);\n```\n\n### License\n\n[The MIT License](./LICENSE) ©  Kevin Jahns, Tiptap GmbH\n","readmeFilename":"README.md"}