{"_id":"y-codemirror.jh","_rev":"1-4f3831a90d9f87cac1172925f227856b","name":"y-codemirror.jh","dist-tags":{"latest":"0.3.5-joel-fork"},"versions":{"0.3.2-joel-fork":{"name":"y-codemirror.jh","version":"0.3.2-joel-fork","keywords":["Yjs"],"author":{"name":"Kevin Jahns","email":"kevin.jahns@protonmail.com"},"_id":"y-codemirror.jh@0.3.2-joel-fork","maintainers":[{"name":"joelhooks","email":"joelhooks@gmail.com"}],"homepage":"https://github.com/yjs/y-codemirror.next#readme","bugs":{"url":"https://github.com/yjs/y-codemirror.next/issues"},"dist":{"shasum":"291515f2acf41c3f5e892ef508fee839bc3cd43b","tarball":"https://registry.npmjs.org/y-codemirror.jh/-/y-codemirror.jh-0.3.2-joel-fork.tgz","fileCount":21,"integrity":"sha512-lEi5ZCtfXJpxNAu3x++/ssXPE5pJkGP9Y659fzu2nBPBFtP1EKtQUrXIy23PUI4NTvQ6vzSNFjhjGsKIPw/6DQ==","signatures":[{"sig":"MEYCIQDEQ0hRFfHTNlZoKLX7CMQlG4b3CI9vPwZbzuXmGjjr6AIhANJfFoIATQ/YRwqju0oBleL0ymoofN1CJXv7LJvM30Ah","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12319164},"main":"./dist/y-codemirror.cjs","type":"module","types":"./dist/src/index.d.ts","module":"./src/index.js","exports":{".":{"types":"./dist/src/index.d.ts","import":"./src/index.js","module":"./src/index.js","require":"./dist/y-codemirror.cjs"},"./package.json":"./package.json"},"funding":{"url":"https://github.com/sponsors/dmonad","type":"GitHub Sponsors ❤"},"gitHead":"31c353bfd5ecd4f360d0eedb84682bde15a82ae4","scripts":{"dist":"npm run clean && rollup -c && tsc","lint":"standard && tsc","test":"npm run dist && node test/test.node.cjs","clean":"rm -rf dist","debug":"concurrently 'http-server -o test.html' 'npm run watch'","start":"concurrently 'http-server -o demo/index.html' 'npm run watch'","watch":"rollup -wc","preversion":"npm run lint && npm run test-extensive && npm run dist","test-extensive":"npm run dist && node test/test.node.cjs --production --repetition-time 10000"},"_npmUser":{"name":"joelhooks","email":"joelhooks@gmail.com"},"repository":{"url":"git+https://github.com/yjs/y-codemirror.next.git","type":"git"},"_npmVersion":"10.0.0","description":"CodeMirror6 binding for Yjs","directories":{},"sideEffects":false,"_nodeVersion":"20.5.1","dependencies":{"lib0":"^0.2.42"},"_hasShrinkwrap":false,"devDependencies":{"yjs":"^13.5.13","jsdom":"^16.7.0","rollup":"^2.58.0","standard":"^14.3.4","y-webrtc":"^10.2.0","codemirror":"^6.0.0","typescript":"^3.9.10","http-server":"^14.1.0","concurrently":"^5.3.0","@codemirror/view":"^6.0.0","@codemirror/state":"^6.0.0","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^17.0.0","@codemirror/lang-javascript":"^6.0.0","@rollup/plugin-node-resolve":"^11.0.1"},"peerDependencies":{"yjs":"^13.5.6","@codemirror/view":"^6.0.0","@codemirror/state":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/y-codemirror.jh_0.3.2-joel-fork_1709504257284_0.7442696897928718","host":"s3://npm-registry-packages"}},"0.3.5-joel-fork":{"name":"y-codemirror.jh","version":"0.3.5-joel-fork","description":"CodeMirror6 binding for Yjs","main":"./dist/y-codemirror.cjs","types":"./dist/src/index.d.ts","module":"./src/index.js","type":"module","sideEffects":false,"funding":{"type":"GitHub Sponsors ❤","url":"https://github.com/sponsors/dmonad"},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./src/index.js","module":"./src/index.js","require":"./dist/y-codemirror.cjs"},"./package.json":"./package.json"},"scripts":{"clean":"rm -rf dist","dist":"npm run clean && rollup -c && tsc","watch":"rollup -wc","test":"npm run dist && node test/test.node.cjs","test-extensive":"npm run dist && node test/test.node.cjs --production --repetition-time 10000","lint":"standard && tsc","preversion":"npm run lint && npm run test-extensive && npm run dist","debug":"concurrently 'http-server -o test.html' 'npm run watch'","start":"concurrently 'http-server -o demo/index.html' 'npm run watch'"},"repository":{"type":"git","url":"git+https://github.com/yjs/y-codemirror.next.git"},"keywords":["Yjs"],"author":{"name":"Kevin Jahns","email":"kevin.jahns@protonmail.com"},"email":"kevin.jahns@protonmail.com","license":"MIT","bugs":{"url":"https://github.com/yjs/y-codemirror.next/issues"},"homepage":"https://github.com/yjs/y-codemirror.next#readme","peerDependencies":{"@codemirror/state":"^6.0.0","@codemirror/view":"^6.0.0","yjs":"^13.5.6"},"dependencies":{"lib0":"^0.2.42"},"devDependencies":{"codemirror":"^6.0.0","@codemirror/lang-javascript":"^6.0.0","@codemirror/state":"^6.0.0","@codemirror/view":"^6.0.0","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-node-resolve":"^11.0.1","concurrently":"^5.3.0","http-server":"^14.1.0","jsdom":"^16.7.0","rollup":"^2.58.0","rollup-plugin-terser":"^7.0.2","standard":"^14.3.4","typescript":"^3.9.10","y-webrtc":"^10.2.0","yjs":"^13.5.13"},"_id":"y-codemirror.jh@0.3.5-joel-fork","gitHead":"287fdb7768a830b6b6375aedbc8eb6c0e0a14e65","_nodeVersion":"20.12.0","_npmVersion":"10.5.0","dist":{"integrity":"sha512-qDU0oo2S7Cnd7z8KUqwRfdznfgqvxRreYJXnz5fFoUrtkKCGZOgp3zULF3ZQ3D9tHYRnztlYxbmEqAETLN4oiQ==","shasum":"548fa79c4ff1e477faad3adfd2fc22a44d70899a","tarball":"https://registry.npmjs.org/y-codemirror.jh/-/y-codemirror.jh-0.3.5-joel-fork.tgz","fileCount":22,"unpackedSize":12322674,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqMf1akuqQrN4tvGOaLTyxfrVHwGlSCUjjDD0JqxGp4QIgMVysLWWnD+XoTZWn3nuk495oEB3AWqBlnnLzoADNw+g="}]},"_npmUser":{"name":"joelhooks","email":"joelhooks@gmail.com"},"directories":{},"maintainers":[{"name":"joelhooks","email":"joelhooks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/y-codemirror.jh_0.3.5-joel-fork_1735783308607_0.44134937739617475"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-03T22:17:37.283Z","modified":"2025-01-02T02:01:49.093Z","0.3.2-joel-fork":"2024-03-03T22:17:37.460Z","0.3.5-joel-fork":"2025-01-02T02:01:48.902Z"},"bugs":{"url":"https://github.com/yjs/y-codemirror.next/issues"},"author":{"name":"Kevin Jahns","email":"kevin.jahns@protonmail.com"},"homepage":"https://github.com/yjs/y-codemirror.next#readme","keywords":["Yjs"],"repository":{"type":"git","url":"git+https://github.com/yjs/y-codemirror.next.git"},"description":"CodeMirror6 binding for Yjs","maintainers":[{"name":"joelhooks","email":"joelhooks@gmail.com"}],"readme":"# y-codemirror.next\n\n> [CodeMirror 6](https://codemirror.net/) editor binding for [Yjs](https://github.com/yjs/yjs) - [Demo](https://demos.yjs.dev/codemirror.next/codemirror.next.html)\n\nThis binding binds a [Y.Text](https://docs.yjs.dev/api/shared-types/y.text) to a CodeMirror editor.\n\n## Features\n\n* Sync CodeMirror 6 editor\n* Awareness: Render remote selection ranges and cursors - as a separate plugin\n* Shared Undo / Redo (each client has its own undo-/redo-history) - as a separate plugin\n\n![CodeMirror Yjs Demo](https://user-images.githubusercontent.com/5553757/79250004-5ed1ac80-7e7e-11ea-81b8-9f833e2d8e66.gif)\n\n### Example\n\n```js\n/* eslint-env browser */\n\nimport * as Y from 'yjs'\n// @ts-ignore\nimport { yCollab } from 'y-codemirror.next'\nimport { WebrtcProvider } from 'y-webrtc'\n\nimport { EditorView, basicSetup } from \"codemirror\";\nimport { EditorState } from \"@codemirror/state\";\nimport { javascript } from '@codemirror/lang-javascript'\n\nimport * as random from 'lib0/random'\n\nexport const usercolors = [\n  { color: '#30bced', light: '#30bced33' },\n  { color: '#6eeb83', light: '#6eeb8333' },\n  { color: '#ffbc42', light: '#ffbc4233' },\n  { color: '#ecd444', light: '#ecd44433' },\n  { color: '#ee6352', light: '#ee635233' },\n  { color: '#9ac2c9', light: '#9ac2c933' },\n  { color: '#8acb88', light: '#8acb8833' },\n  { color: '#1be7ff', light: '#1be7ff33' }\n]\n\n// select a random color for this user\nexport const userColor = usercolors[random.uint32() % usercolors.length]\n\nconst ydoc = new Y.Doc()\nconst provider = new WebrtcProvider('codemirror6-demo-room', ydoc)\nconst ytext = ydoc.getText('codemirror')\n\nconst undoManager = new Y.UndoManager(ytext)\n\nprovider.awareness.setLocalStateField('user', {\n  name: 'Anonymous ' + Math.floor(Math.random() * 100),\n  color: userColor.color,\n  colorLight: userColor.light\n})\n\nconst state = EditorState.create({\n  doc: ytext.toString(),\n  extensions: [\n    basicSetup,\n    javascript(),\n    yCollab(ytext, provider.awareness, { undoManager })\n  ]\n})\n\nconst view = new EditorView({ state, parent: /** @type {HTMLElement} */ (document.querySelector('#editor')) })\n\n```\n\n## API\n\n..\n\n## License\n\n[The MIT License](./LICENSE) © Kevin Jahns\n","readmeFilename":"README.md","license":"MIT"}