{"_id":"@dear-rama/prosemirror-suggestion","_rev":"5-18ea042fcfb0cd91e5d2f20c0d283808","name":"@dear-rama/prosemirror-suggestion","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@dear-rama/prosemirror-suggestion","version":"0.1.0","description":"Inline node cursor helper for ProseMirror","author":{"name":"Nakwon CHOI","email":"ch0494@gmail.com"},"license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","keywords":["prosemirror","code"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/DearRAMA/prosemirror-suggestion.git"},"bugs":{"url":"https://github.com/DearRAMA/prosemirror-suggestion/issues"},"homepage":"http://github.com/DearRAMA/prosemirror-suggestion","scripts":{"clean":"shx rm -rf dist","build":"yarn run clean && tsc -p . && shx mv dist/src/* dist && shx rm -r dist/src && shx rm -r dist/demo && shx cp src/suggestion.css dist/suggestion.css","build:demo":"yarn run clean && webpack --config webpack.config.js && shx rm -r dist/src && shx rm -r dist/demo","build:watch":"tsc -w -p .","prepublishOnly":"yarn build","start":"webpack serve --open --config webpack.config.js","test":"jest","test:watch":"jest --watchAll","test:clear":"jest --clearCache","lint":"eslint \"src/**/*.ts\" -c .eslintrc.json","lint:format":"prettier --check \"src/**/*.ts\"","lint:format:fix":"prettier --write \"src/**/*.ts\""},"peerDependencies":{"prosemirror-inputrules":"^1.1.3","prosemirror-model":"^1.15.0","prosemirror-state":"^1.3.4","prosemirror-view":"^1.20.3"},"devDependencies":{"@aeaton/prosemirror-transformers":"^2.0.2","@babel/plugin-proposal-optional-chaining":"^7.14.5","@dear-rama/prosemirror-nodemark":"^0.2.0","@types/jest":"^26.0.24","@types/mocha":"^8.2.3","@types/prosemirror-inputrules":"^1.0.4","@types/prosemirror-model":"^1.13.2","@types/prosemirror-schema-basic":"^1.0.2","@types/prosemirror-state":"^1.2.7","@types/prosemirror-view":"^1.19.1","@typescript-eslint/eslint-plugin":"^4.33.0","@typescript-eslint/parser":"^4.33.0","css-loader":"^6.5.0","date-fns":"^2.25.0","eslint":"^7.32.0","eslint-config-airbnb":"^18.2.1","eslint-config-airbnb-base":"^14.2.1","eslint-config-airbnb-typescript":"^12.3.1","eslint-config-prettier":"^8.3.0","eslint-config-react-app":"^6.0.0","eslint-import-resolver-typescript":"^2.5.0","eslint-plugin-flowtype":"^5.10.0","eslint-plugin-import":"^2.25.2","eslint-plugin-jest":"^24.7.0","eslint-plugin-json":"^3.1.0","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-no-only-tests":"^2.6.0","eslint-plugin-no-skip-tests":"^1.1.0","eslint-plugin-prettier":"^3.4.0","eslint-plugin-react":"^7.26.1","html-webpack-plugin":"^5.5.0","jest":"^26.6.3","prettier":"^2.4.1","prosemirror-example-setup":"^1.1.2","prosemirror-inputrules":"^1.1.3","prosemirror-model":"^1.15.0","prosemirror-schema-basic":"^1.1.2","prosemirror-state":"^1.3.4","prosemirror-view":"^1.20.3","shx":"^0.3.4","style-loader":"^3.3.1","ts-jest":"^26.5.6","ts-loader":"^9.2.3","typescript":"^4.4.4","webpack":"^5.40.0","webpack-cli":"^4.7.2","webpack-dev-server":"^3.11.2"},"gitHead":"57fd27090dc113c8f008d382763ec5ddbe8c1a34","_id":"@dear-rama/prosemirror-suggestion@0.1.0","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"integrity":"sha512-xvNNbkUbgIo4ZmYXE7gQ/VNn9x1XwkXxgpXnbYOWKQreStLNBqRTj5rIJlaaicyEzkvdD3Ab+r8P462F/sbuMw==","shasum":"ad139cc0a27e1ba3454414ab50ec36a74b5ad61b","tarball":"https://registry.npmjs.org/@dear-rama/prosemirror-suggestion/-/prosemirror-suggestion-0.1.0.tgz","fileCount":22,"unpackedSize":54139,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiHDfiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpuHg/9GqvyEVhhpw+eBMqqhpNKv2ogpwx5FRos6BPlOWiNxlxqw+C8\r\nTecfc9JDMq3OPI7hXDpNUVWJHk14sA9kxv23GKYxGmYgpyOrl923jHPOOypX\r\n2Mdk6qqJ6NHyvNR7VVUdhveXd5u8iAbF/rf6FNYVDDANKBJOIIYUooiaI9MB\r\nrUiulpCyWwhAf4/7tpBQmyiWR5qPhooqtXKlUsnYQaBDqJ22dRIR/yL2Dxms\r\ns0yzBLWzTgm0FY51XGvX3+sWByfAESPoEehmZgLYt88rGeRewVOaqNDz7M86\r\nVh4ia80IWArLudek0jbwTmqxykPqRLpCY1BkWiw0+OyuP1gNIms6I404phTY\r\nCTjZa/5rlTkRLMS25sl0ZEx9Y/HHOFAblISQJpSi2HswN7chqDVSmFsP+Tl+\r\nPBtqRNu5miqyc4g8YhaTEzwWjUqIBtGiJm67Ot2te9AhX7jxOp4gv/N0pDbX\r\nSCWNCmUsXI6uY5866Ce4KTbLaHSrU9Ri3WfPVOmaf4nW/1euzLK0yeoS/YXS\r\nqp6kz1ONSPq4+FwotR3i8pAujqLczkcGkGolMbUaeBeD2CVlkQ0yjFUybp+c\r\noepot8V9i0XM4vSfF2T3fZ2UlA0tesOpPKHG34YC5EYfHBemxruS4UQJd6Rx\r\nBJPvJpdz287LkTh+NUNMtYciFuDQcPRpC6Q=\r\n=5duA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGQS+/yJOygsGOTSwPn/R+Bm/E33XCYkUjNtXLOPiVD9AiBOkzAsTwM4ow99sNsLYLjFij/6n+jcVqIdxNF3nk8Zmw=="}]},"_npmUser":{"name":"dmc31a42","email":"ch0494@gmail.com"},"directories":{},"maintainers":[{"name":"dmc31a42","email":"ch0494@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prosemirror-suggestion_0.1.0_1646016481909_0.14288321743312404"},"_hasShrinkwrap":false},"0.1.2":{"name":"@dear-rama/prosemirror-suggestion","version":"0.1.2","description":"Inline node cursor helper for ProseMirror","author":{"name":"Nakwon CHOI","email":"ch0494@gmail.com"},"license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","keywords":["prosemirror","code"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/DearRAMA/prosemirror-suggestion.git"},"bugs":{"url":"https://github.com/DearRAMA/prosemirror-suggestion/issues"},"homepage":"http://github.com/DearRAMA/prosemirror-suggestion","scripts":{"clean":"shx rm -rf dist","build":"yarn run clean && tsc -p . && shx mv dist/src/* dist && shx rm -r dist/src && shx rm -r dist/demo && shx cp src/suggestion.css dist/suggestion.css","build:demo":"yarn run clean && webpack --config webpack.config.js && shx rm -r dist/src && shx rm -r dist/demo","build:watch":"tsc -w -p .","prepublishOnly":"yarn build","start":"webpack serve --open --config webpack.config.js","test":"jest","test:watch":"jest --watchAll","test:clear":"jest --clearCache","lint":"eslint \"src/**/*.ts\" -c .eslintrc.json","lint:format":"prettier --check \"src/**/*.ts\"","lint:format:fix":"prettier --write \"src/**/*.ts\""},"peerDependencies":{"prosemirror-inputrules":"^1.1.3","prosemirror-model":"^1.15.0","prosemirror-state":"^1.3.4","prosemirror-view":"^1.20.3"},"devDependencies":{"@aeaton/prosemirror-transformers":"^2.0.2","@babel/plugin-proposal-optional-chaining":"^7.14.5","@dear-rama/prosemirror-nodemark":"^0.2.0","@types/jest":"^26.0.24","@types/mocha":"^8.2.3","@types/prosemirror-inputrules":"^1.0.4","@types/prosemirror-model":"^1.13.2","@types/prosemirror-schema-basic":"^1.0.2","@types/prosemirror-state":"^1.2.7","@types/prosemirror-view":"^1.19.1","@typescript-eslint/eslint-plugin":"^4.33.0","@typescript-eslint/parser":"^4.33.0","css-loader":"^6.5.0","date-fns":"^2.25.0","eslint":"^7.32.0","eslint-config-airbnb":"^18.2.1","eslint-config-airbnb-base":"^14.2.1","eslint-config-airbnb-typescript":"^12.3.1","eslint-config-prettier":"^8.3.0","eslint-config-react-app":"^6.0.0","eslint-import-resolver-typescript":"^2.5.0","eslint-plugin-flowtype":"^5.10.0","eslint-plugin-import":"^2.25.2","eslint-plugin-jest":"^24.7.0","eslint-plugin-json":"^3.1.0","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-no-only-tests":"^2.6.0","eslint-plugin-no-skip-tests":"^1.1.0","eslint-plugin-prettier":"^3.4.0","eslint-plugin-react":"^7.26.1","html-webpack-plugin":"^5.5.0","jest":"^26.6.3","prettier":"^2.4.1","prosemirror-example-setup":"^1.1.2","prosemirror-inputrules":"^1.1.3","prosemirror-model":"^1.15.0","prosemirror-schema-basic":"^1.1.2","prosemirror-state":"^1.3.4","prosemirror-view":"^1.20.3","shx":"^0.3.4","style-loader":"^3.3.1","ts-jest":"^26.5.6","ts-loader":"^9.2.3","typescript":"^4.4.4","webpack":"^5.40.0","webpack-cli":"^4.7.2","webpack-dev-server":"^3.11.2"},"gitHead":"c00ecb059f2e5942d23ca5febcca1694aefbc52d","_id":"@dear-rama/prosemirror-suggestion@0.1.2","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"integrity":"sha512-1VV706me0X5/G1Aw7XrzpX1eAuUVCNTFFZaq9KCm4KXi/Yt5ZCk+SaBFtXIit7Sm20cNyxgnc3G9a0HxmKMBEA==","shasum":"a32b0652d01c37653db463283d22fb98bb6b43e2","tarball":"https://registry.npmjs.org/@dear-rama/prosemirror-suggestion/-/prosemirror-suggestion-0.1.2.tgz","fileCount":22,"unpackedSize":54892,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJeAkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr5VA/8DomBsbXR66Ry2xF7UofnBbjhq3mC2MgrwEuSRwrEZDATjcCH\r\nszialihm4+dACRsBiSwejNiY5a3Ug0c0vv8+wpRu6sje5NfTWVRe23kTgkgT\r\nhQFiCy14/pfcfZDTmtktAX8/e2K1MJZ0i2ml+650ittF4ZjHUy/c1hOBtACM\r\nzJeZKU7rdNmhJVl4WVxSoDRgLg+/36G2h7ZjfRGhC5JiE59rG6Gdzrn0KsVm\r\nhbBb81YuliXhWYtBTLxSHU8jp6jCVaN0LTZafeYaFaYGgefMVI3yAShIVuTS\r\n9+qeptS3B+VGCWe5fMRXf1ekXmHP5LuE8emQGzl5xn2ZmvSzYsYnncMM4h4b\r\ngo1PicKbhX5ELp7ZU6d5DeedpCDcDAYmqkVGyF35U+4pviEam06Efd5zGmea\r\nJVz0djTGWUitBfOKB+dnIqyws+BoN7S9FlgvGF0rPy8wdMf3VnKSN3U7Bfsx\r\nJAkOISIaMD1mqmCdGc5NRplGn6ON5FwZjXZT/zbH8XG+Ywi3rm21/uoMsf+5\r\nDVxkutS8E2XRayMcO9Mwp46DZkMEsM7ZGQbmezDMdedy+IhAc2t20xDaIK2M\r\ncTUL/GuytSFqK6hJKl9VO1vgoF5kKvk2NsP7E4t5kVVnFvcBL7d1LdaUC1Gs\r\nNRKWdQ9fv3VRMRe0Q5Cv5tGDZ2zLl7Km1KE=\r\n=MKit\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwuTeN4vg3EZulanYisShUOuOQOGL5omfH5sPPisr6fQIgOMUNWNsb5hfT8Q/2gO2cY2o26yZGQFkRVhHhy/t2Wfo="}]},"_npmUser":{"name":"dmc31a42","email":"ch0494@gmail.com"},"directories":{},"maintainers":[{"name":"dmc31a42","email":"ch0494@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prosemirror-suggestion_0.1.2_1646649379956_0.6777239231057588"},"_hasShrinkwrap":false},"0.2.0":{"name":"@dear-rama/prosemirror-suggestion","version":"0.2.0","description":"Inline node cursor helper for ProseMirror","author":{"name":"Nakwon CHOI","email":"ch0494@gmail.com"},"license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","keywords":["prosemirror","code"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/DearRAMA/prosemirror-suggestion.git"},"bugs":{"url":"https://github.com/DearRAMA/prosemirror-suggestion/issues"},"homepage":"http://github.com/DearRAMA/prosemirror-suggestion","scripts":{"clean":"shx rm -rf dist","build":"yarn run clean && tsc -p . && shx mv dist/src/* dist && shx rm -r dist/src && shx rm -r dist/demo && shx cp src/suggestion.css dist/suggestion.css","build:demo":"yarn run clean && webpack --config webpack.config.js && shx rm -r dist/src && shx rm -r dist/demo","build:watch":"tsc -w -p .","prepublishOnly":"yarn build","start":"webpack serve --open --config webpack.config.js","test":"jest","test:watch":"jest --watchAll","test:clear":"jest --clearCache","lint":"eslint \"src/**/*.ts\" -c .eslintrc.json","lint:format":"prettier --check \"src/**/*.ts\"","lint:format:fix":"prettier --write \"src/**/*.ts\""},"peerDependencies":{"prosemirror-inputrules":"^1.1.3","prosemirror-model":"^1.15.0","prosemirror-state":"^1.3.4","prosemirror-view":"^1.20.3"},"devDependencies":{"@aeaton/prosemirror-transformers":"^2.0.2","@babel/plugin-proposal-optional-chaining":"^7.14.5","@dear-rama/prosemirror-nodemark":"^0.2.0","@types/jest":"^26.0.24","@types/mocha":"^8.2.3","@types/prosemirror-inputrules":"^1.0.4","@types/prosemirror-model":"^1.13.2","@types/prosemirror-schema-basic":"^1.0.2","@types/prosemirror-state":"^1.2.7","@types/prosemirror-view":"^1.19.1","@typescript-eslint/eslint-plugin":"^4.33.0","@typescript-eslint/parser":"^4.33.0","css-loader":"^6.5.0","date-fns":"^2.25.0","eslint":"^7.32.0","eslint-config-airbnb":"^18.2.1","eslint-config-airbnb-base":"^14.2.1","eslint-config-airbnb-typescript":"^12.3.1","eslint-config-prettier":"^8.3.0","eslint-config-react-app":"^6.0.0","eslint-import-resolver-typescript":"^2.5.0","eslint-plugin-flowtype":"^5.10.0","eslint-plugin-import":"^2.25.2","eslint-plugin-jest":"^24.7.0","eslint-plugin-json":"^3.1.0","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-no-only-tests":"^2.6.0","eslint-plugin-no-skip-tests":"^1.1.0","eslint-plugin-prettier":"^3.4.0","eslint-plugin-react":"^7.26.1","html-webpack-plugin":"^5.5.0","jest":"^26.6.3","prettier":"^2.4.1","prosemirror-example-setup":"^1.1.2","prosemirror-inputrules":"^1.1.3","prosemirror-model":"^1.15.0","prosemirror-schema-basic":"^1.1.2","prosemirror-state":"^1.3.4","prosemirror-view":"^1.20.3","shx":"^0.3.4","style-loader":"^3.3.1","ts-jest":"^26.5.6","ts-loader":"^9.2.3","typescript":"^4.4.4","webpack":"^5.40.0","webpack-cli":"^4.7.2","webpack-dev-server":"^3.11.2"},"gitHead":"00e1b414ccacf967c36ef8cd641bc4050149d607","_id":"@dear-rama/prosemirror-suggestion@0.2.0","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"integrity":"sha512-rgK9FyLbu0NzOKphj/qKS5vpiKTzDep1OIQTGpTb9XtgnuXpm0InQrr1XuqWDjIi/1CgvfRaZ4dri5PRHPVuMQ==","shasum":"c95190eb9dc97b27322cc23a547d4e91192da70a","tarball":"https://registry.npmjs.org/@dear-rama/prosemirror-suggestion/-/prosemirror-suggestion-0.2.0.tgz","fileCount":22,"unpackedSize":54892,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMeeAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqTyw//UqGFE/TEli67ZM5fm6qX82eCGV8VWKpDx65Ruy+nsuk+5FQk\r\nhNYBhpe1L/CcAl0mYB2ZqurLumoReP36i2KRQh0ns0INZ9Rsk2pgoPYqIJbB\r\nOTAThCJFjf8PoWM/h0mNpdJrm8LxA0NFOk7tRxhjwgAA4GeJWdy7gqTZwXaO\r\n4ue7b2irPVFuWMLC7VrUfdlwslOIEHyfX3tUBb1b5qDuuyvSNcCq1DVQRRme\r\nDIMl24A3dNBevS/67u9QJIpODEWc4fQaxoIWywPVaGsuuTk7ziViR2eO5V84\r\n2hzzvYtXRGiogoWrpfHFe9WOsLeNaV8Fv5qOyLDNLUkAmY4197kPg8NzOK4N\r\nIgso5SR+MJ4reo9NLNppio+BiOJyPwYCzzPc272UxMIuzyeFx+F0ujy7VsUV\r\n0J1Lu5IPYuYfQqFyoog9xbW5IlPzorw6kbYLndBsqVVv4UTBIiu8aKuWvWtk\r\nhaUk3bpEL5X/eKFh2EQy7L2vSVGAG7G7ktGxHKvTMQVPwD8XKtKG7ApCvjhd\r\nwxx16wkbSrTcDsOKafQGO+rg+VAaogxg6Y9Y07kKS750Mof0C++IOQs4O6bF\r\na/hOQsTCNGQJBpjJKLl5yZotqUuuC3SjEwxF2T2rZZzdSsRNNVFaVHpgH1VZ\r\nuEdBa4YKMTFdfbIN3DYTHcDEL3xUwtYyLCM=\r\n=y7n3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHC7OJtsm+8/Xt/Mib9VJQgMkGJAwRu2i2qFqmTn6rRwAiEAsRtq2uG0s0ulnaBltIqh9sMeWHGpjJ7ueGt+etFiY+o="}]},"_npmUser":{"name":"dmc31a42","email":"ch0494@gmail.com"},"directories":{},"maintainers":[{"name":"dmc31a42","email":"ch0494@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prosemirror-suggestion_0.2.0_1647437696369_0.13002152341677786"},"_hasShrinkwrap":false}},"time":{"created":"2022-02-28T02:48:01.832Z","0.1.0":"2022-02-28T02:48:02.119Z","modified":"2022-04-05T03:28:05.476Z","0.1.1":"2022-03-07T10:03:11.152Z","0.1.2":"2022-03-07T10:36:20.093Z","0.2.0":"2022-03-16T13:34:56.562Z"},"maintainers":[{"name":"dmc31a42","email":"ch0494@gmail.com"}],"description":"Inline node cursor helper for ProseMirror","homepage":"http://github.com/DearRAMA/prosemirror-suggestion","keywords":["prosemirror","code"],"repository":{"type":"git","url":"git+https://github.com/DearRAMA/prosemirror-suggestion.git"},"author":{"name":"Nakwon CHOI","email":"ch0494@gmail.com"},"bugs":{"url":"https://github.com/DearRAMA/prosemirror-suggestion/issues"},"license":"MIT","readme":"# `prosemirror-suggestion`\r\n\r\n**This repo is cloned template from [prosemirror-codemark](https://github.com/curvenote/prosemirror-codemark) and concept and code snippet from [prosemirror-mentions](https://github.com/joelewis/prosemirror-mentions)**\r\n\r\n# Below README is just copied from prosemirror-codemark and should be updated.\r\n\r\n\r\n[![prosemirror-suggestion on npm](https://img.shields.io/npm/v/prosemirror-suggestion.svg)](https://www.npmjs.com/package/prosemirror-suggestion)\r\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](github.com/DearRAMA/prosemirror-suggestion/blob/master/LICENSE)\r\n![CI](github.com/DearRAMA/prosemirror-suggestion/workflows/CI/badge.svg)\r\n[![demo](https://img.shields.io/badge/live-demo-blue)](https://dearrama.github.io/prosemirror-suggestion/)\r\n\r\nA plugin for [ProseMirror](https://prosemirror.net/) that handles manipulating and navigating inline code marks.\r\nThe plugin creates a fake cursor as necessary to show you if the next character you type will or will not be marked.\r\n`prosemirror-suggestion` is created and used by [Curvenote](https://curvenote.com).\r\n\r\n[![Codemark](./demo/codemark.gif)](https://dearrama.github.io/prosemirror-suggestion/)\r\n\r\n## Install\r\n\r\n```bash\r\nnpm install prosemirror-suggestion\r\n```\r\n\r\nOr see the [live demo here](https://dearrama.github.io/prosemirror-suggestion/)!\r\n\r\n**Highlights:**\r\n\r\n- Create code matching backwards (simple `InputRule`) and forwards (which is a specialized rule)\r\n- Select a word and hit `` ` ``\r\n- Make sure the next character makes sense (e.g. `removeStoredMarks`)\r\n- Show a visual cursor in the correct location if the next character will or will not be in the inline code\r\n- Allow arrow keys to enter/exit into the inline code\r\n\r\n## Overview & Usage\r\n\r\n`codemark` is a specialized `InputRule` and a `Plugin` to display a fake-cursor as a decoration, which allows you to navigate inside and outside of inline code. This allows the user the ability to navigate out of a code-mark, and also ensures that the text-input `caret` indicates what will happen next. The plugin works with `undoInputRule` from `prosemirror-inputrules` to undo code mark creation.\r\n\r\n### Basic ProseMirror\r\n\r\nTo use the plugins, supply your `MarkType` and use the plugins in your `EditorView`.\r\n\r\n```ts\r\nimport codemark from 'prosemirror-suggestion';\r\nimport 'codemark/dist/codemark.css';\r\n\r\nconst plugins = codemark({ markType: schema.marks.code });\r\n\r\nconst view = new EditorView(editor, {\r\n  state: EditorState.create({\r\n    doc,\r\n    plugins: [...plugins, ...otherPlugins],\r\n  }),\r\n});\r\n```\r\n\r\n### Usage with [TipTap](https://tiptap.dev)\r\n\r\nCreate a [TipTap extention](https://tiptap.dev/api/extensions) and add a custom plugin.\r\nThe schema can be accessed from `this.editor.schema.marks.code`.\r\n\r\n```ts\r\nimport codemark from 'prosemirror-suggestion';\r\nimport 'codemark/dist/codemark.css';\r\n\r\nconst codemarkPlugin = Extension.create({\r\n  name: 'codemarkPlugin',\r\n  addProseMirrorPlugins() {\r\n    return codemark({ markType: this.editor.schema.marks.code });\r\n  },\r\n});\r\n\r\nthis.editor = new Editor({\r\n  extensions: [StarterKit, codemarkPlugin],\r\n  content: `This is a <code>code</code> test!`,\r\n});\r\n```\r\n\r\nThe styles are necessary to show the `.fake-cursor`, they are simple if you want to [override them](./src/codemark.css). It does not provide styles for the `code` specifically. The plugin visually works best if the code mark has a border and a different color than the main text.\r\n\r\n## Why\r\n\r\nOne of the biggest frustrations in using what you see is what you get (WYSIWYG) editors when coming from knowing `Markdown` is how they deal with inline code. In Markdown this is easy, you simply wrap a word in back-ticks (e.g. `` `code` ``). In many ways, the other “marks”, like bold, italic, underline are all easier in applications like Word, Notion, Confluence, etc. because almost everyone knows the shortcut to make something stop being bold/italic/underlined. This is **not the case** for code-marks, which act similarly, however there is no common/shared shortcut to remove a code-mark, and every editor application does something subtly different.\r\n\r\nIf you are using Slack or Notion, try creating a code block and then adding something to the start or end **after** it is created. The behaviour is completely unintuitive, you often have no idea if the next character you type will be inside or outside of the code-mark, and in Notion, for example, this changes based on if you hit backspace!\r\n\r\n![Notion](./demo/notion.gif)\r\n\r\nIn Slack, if you start a message with code, there is literally no way to exit the code at the start without using your mouse, deleting the code-mark completely, or knowing the keyboard shortcut. In Slack, the right arrow key also mysteriously turns into a spacebar at the end of the code-mark or feels like it skips one character ahead.\r\n\r\n![Slack](./demo/slack.gif)\r\n\r\nThe ambiguity of whether the next character you type will be “marked” is something that we tolerate for bold/italics/underline — because we all know the escape hatch and don’t have to leave our keyboards. But if you learn the keyboard shortcut for code in Slack, you might be surprised when you use it in Notion that the developer tools in Chrome pop up. Or say you learn the shortcut in Confluence, and jump over to Slack you will open your Mentions — in Notion, it creates a comment! Notion as far as I can tell, doesn’t even have a shortcut for a code-mark.\r\n\r\nThere are so many other quirks in these applications with regard to how the spacebar, or arrow keys work, how to deal with one-character of code. I have yet to see a WYSIWYG editor actually do it “right”.\r\n\r\nOur goal at [Curvenote](https://curvenote.com) is to make a best-in-class editing experience for technical content, and these are the types of details you either never notice because it just works, or they make people tear their hair out.\r\n\r\n## Why is this hard?\r\n\r\nBrowsers `contenteditable` DOM doesn't distinguish between a cursor positions inside and outside inline tags when it comes to where to insert text. This state is held by the application for what to insert next (in ProseMirror these are `storedMarks`, which can be added or removed). This means that visually distinguishing the first two states in the next figure is not possible.\r\n\r\n![Legend](./demo/legend.png)\r\n\r\nVarious approaches can be taken, and Chrome seems to default to if you are on the left you are outside the mark, if you are on the right you are inside. This can make the default experience quite confusing. Other browsers deal with this differently again.\r\n\r\n## Our Approach\r\n\r\nWe are using ProseMirror and providing two plugins that handle a specialized `InputRule` (forwards and backwards lookup); and a `Decoration` plugin that displays a cursor in the correct location indicating if your next character you type will be marked or not.\r\n\r\nThis is something that can be done a few ways, we tried a `&ZeroWidthSpace;`, but couldn't get that to be reliable as a decoration and did not want to add to the document state when changing selections. Instead, we added a simple `span.fake-cursor` that blinks, has a border, and no-width. For this to work correctly, the `EditorView` briefly makes the default caret transparent when the fake cursor is visible. This cursor is removed when it is not needed.\r\n\r\nThe plugin also provides specialized handling for navigation events (arrows, backspace, etc.), and we have provided a way to exit the code mark using the arrow keys. This defaults to a mental model of the code-mark is wrapped in backticks when you are navigating. The cursor always moves when you press the arrow key, even though the position in the ProseMirror document does not, instead it toggles on/off a `storedMark`.\r\n\r\nWe have also added handlers for jumping between words, to the start & end of line, as well as between lines. These take you outside of the code mark if appropriate.\r\n\r\n# Handled Actions & Selection Events\r\n\r\n## Code mark creation\r\n\r\n- `` `code| → `code`| `` (create remain outside)\r\n- `` |code` → `|code` `` (create remain inside)\r\n- `` ████ → `code` `` (selected and press `` ` ``)\r\n- Inserting `` ` `` around an existing code marks does nothing\r\n\r\n## Enter and Exit\r\n\r\nHolding down the arrow key or word/line modifiers should continue to work as expected.\r\n\r\n### Right Arrow:\r\n\r\n- `` `code|` → `code`| `` (exit)\r\n- `` |`code` → `|code` `` (enter)\r\n- `` `co██|` → `code|` `` (selected remains inside)\r\n- `` ██|`code` → __|`code` `` (selected remains outside)\r\n- `` `code`|$ → `code`$| `` (exit end of line)\r\n- `` |^`code` → ^|`code` `` --> (enter line, remain outside)\r\n\r\n### Left Arrow:\r\n\r\n- `` `code`| → `code|` `` (enter)\r\n- `` `|code` → |`code` `` (exit)\r\n- `` ^`|code` → ^|`code` `` (exit at top of paragraph)\r\n- `` ^|`code` → |^`code` `` (exit line)\r\n- `` `code`|██ → `code`|__ `` (selected remains outside)\r\n- `` `|██de` → `|code` `` (selected remains inside)\r\n- `` `code`$| → `code`|$ `` (enter line, remain outside)\r\n\r\nNote that for arrow modifiers, there is a bit of extra care that needs to happen for single characters of code.\r\n\r\n### Home & End\r\n\r\n- Commands `ctrl-a`, `cmd-left`, and `Home` should jump to start, without mark\r\n- Commands `ctrl-e`, `cmd-right`, and `End` should jump to end, without mark\r\n\r\n### Up & Down\r\n\r\nWhen navigating between lines, default to outside of the codemark if there is a choice.\r\n\r\n### Backspace & Delete:\r\n\r\n- `` `x|` → | `` (delete text, next insertion normal)\r\n- `` `|████` → | `` (delete full mark, next insertion normal)\r\n- `` `|███`█ → | `` (delete full mark, next insertion normal)\r\n\r\n### Clicking\r\n\r\n- Default to outside of the code mark when clicking to a new location in the editor\r\n\r\n## Browser compatibility\r\n\r\nThe plugin works great for Chrome at the moment and is pretty solid in Firefox, Safari has different display for where it puts the cursors before a span, so that needs some work.\r\n\r\n---\r\n\r\n<p style=\"text-align: center; color: #aaa; padding-top: 50px\">\r\n  Made with love by\r\n  <a href=\"https://curvenote.com\" target=\"_blank\" style=\"color: #aaa\">\r\n    <img src=\"https://curvenote.dev/images/icon.png\" style=\"height: 1em\" /> Curvenote\r\n  </a>\r\n</p>\r\n","readmeFilename":"README.md"}