{"_id":"@ekz/lexical-history","_rev":"2-3818e526b9e89e05742ee33035432dce","name":"@ekz/lexical-history","dist-tags":{"latest":"0.40.1"},"versions":{"0.40.0":{"name":"@ekz/lexical-history","version":"0.40.0","keywords":["lexical","editor","rich-text","history"],"license":"MIT","_id":"@ekz/lexical-history@0.40.0","maintainers":[{"name":"ekz","email":"heitkotter@gmail.com"}],"homepage":"https://github.com/facebook/lexical#readme","bugs":{"url":"https://github.com/facebook/lexical/issues"},"dist":{"shasum":"022b2d2e2ac860b309683bc43ef64a628f34f854","tarball":"https://registry.npmjs.org/@ekz/lexical-history/-/lexical-history-0.40.0.tgz","fileCount":12,"integrity":"sha512-BCaL9Jty8T30nnW7dDaY/OaEg0MBJKrFqpFoA4ZJOX5PQKx7xOuPiVpxhHtoZpgxyC9d1L+xcHu0nbk8JBkxkA==","signatures":[{"sig":"MEQCIHvTmY4vWPrNZu91r332QKQx7h+Mk+Dtey0MTSVTOqrYAiA4V/cREW7Y3roo7y9L4Ga+FeRbccvpqMjObYmY1AwNmA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45779},"main":"LexicalHistory.js","_from":"file:ekz-lexical-history-0.40.0.tgz","types":"index.d.ts","module":"LexicalHistory.mjs","exports":{".":{"import":{"node":"./LexicalHistory.node.mjs","types":"./index.d.ts","default":"./LexicalHistory.mjs","production":"./LexicalHistory.prod.mjs","development":"./LexicalHistory.dev.mjs"},"require":{"types":"./index.d.ts","default":"./LexicalHistory.js","production":"./LexicalHistory.prod.js","development":"./LexicalHistory.dev.js"}}},"_npmUser":{"name":"ekz","email":"heitkotter@gmail.com"},"_resolved":"/private/var/folders/qc/q9g_dsy53kn1r210zcx4956w0000gr/T/107da08e6fa4b431e80b28e96d34d57c/ekz-lexical-history-0.40.0.tgz","_integrity":"sha512-BCaL9Jty8T30nnW7dDaY/OaEg0MBJKrFqpFoA4ZJOX5PQKx7xOuPiVpxhHtoZpgxyC9d1L+xcHu0nbk8JBkxkA==","repository":{"url":"git+https://github.com/facebook/lexical.git","type":"git","directory":"packages/lexical-history"},"_npmVersion":"10.9.4","description":"This package contains selection history helpers for Lexical.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.0","dependencies":{"@ekz/lexical":"0.40.0","@ekz/lexical-utils":"0.40.0","@ekz/lexical-extension":"0.40.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/lexical-history_0.40.0_1770732157871_0.9123368810740773","host":"s3://npm-registry-packages-npm-production"}},"0.40.1":{"name":"@ekz/lexical-history","description":"This package contains selection history helpers for Lexical.","keywords":["lexical","editor","rich-text","history"],"license":"MIT","version":"0.40.1","main":"LexicalHistory.js","types":"index.d.ts","dependencies":{"@ekz/lexical-extension":"0.40.1","@ekz/lexical-utils":"0.40.1","@ekz/lexical":"0.40.1"},"repository":{"type":"git","url":"git+https://github.com/facebook/lexical.git","directory":"packages/lexical-history"},"module":"LexicalHistory.mjs","sideEffects":false,"exports":{".":{"import":{"types":"./index.d.ts","development":"./LexicalHistory.dev.mjs","production":"./LexicalHistory.prod.mjs","node":"./LexicalHistory.node.mjs","default":"./LexicalHistory.mjs"},"require":{"types":"./index.d.ts","development":"./LexicalHistory.dev.js","production":"./LexicalHistory.prod.js","default":"./LexicalHistory.js"}}},"_id":"@ekz/lexical-history@0.40.1","bugs":{"url":"https://github.com/facebook/lexical/issues"},"homepage":"https://github.com/facebook/lexical#readme","_integrity":"sha512-+xFzHNTDK48+E2LvzRMv6uvmYq/XZPgTewKaRIhzOjHh8X9vyJqRtAG2/+UppM81BY2Tcktg1nCzooWoY63emg==","_resolved":"/private/var/folders/qc/q9g_dsy53kn1r210zcx4956w0000gr/T/b94033fb6839615136c298bdc6d6f4cb/ekz-lexical-history-0.40.1.tgz","_from":"file:ekz-lexical-history-0.40.1.tgz","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-+xFzHNTDK48+E2LvzRMv6uvmYq/XZPgTewKaRIhzOjHh8X9vyJqRtAG2/+UppM81BY2Tcktg1nCzooWoY63emg==","shasum":"3c010ef73bf1987a0dfc0fe1f03f9f0eb10f81d9","tarball":"https://registry.npmjs.org/@ekz/lexical-history/-/lexical-history-0.40.1.tgz","fileCount":12,"unpackedSize":45755,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFAovnQ/ej2DWEiuKE5msFKp/VGx1TnbTqS6ij/SNa3FAiEA7vWbBWQDLP4/s2Db/CLfpMFXXE7apfBFtFbm1b2jgEM="}]},"_npmUser":{"name":"ekz","email":"heitkotter@gmail.com"},"directories":{},"maintainers":[{"name":"ekz","email":"heitkotter@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/lexical-history_0.40.1_1770805111867_0.2696106687405393"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-10T14:02:37.808Z","modified":"2026-02-11T10:18:32.127Z","0.40.0":"2026-02-10T14:02:38.023Z","0.40.1":"2026-02-11T10:18:31.996Z"},"bugs":{"url":"https://github.com/facebook/lexical/issues"},"license":"MIT","homepage":"https://github.com/facebook/lexical#readme","keywords":["lexical","editor","rich-text","history"],"repository":{"type":"git","url":"git+https://github.com/facebook/lexical.git","directory":"packages/lexical-history"},"description":"This package contains selection history helpers for Lexical.","maintainers":[{"name":"ekz","email":"heitkotter@gmail.com"}],"readme":"# `@lexical/history`\n\n[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](https://lexical.dev/docs/api/modules/lexical_history)\n\nThis package contains history helpers for Lexical.\n\n### Methods\n\n#### `registerHistory`\n\nRegisters necessary listeners to manage undo/redo history stack and related editor commands. It returns `unregister` callback that cleans up all listeners and should be called on editor unmount.\n\n```js\nfunction registerHistory(\n  editor: LexicalEditor,\n  externalHistoryState: HistoryState,\n  delay: number,\n): () => void\n```\n\n### Commands\n\nHistory package handles `UNDO_COMMAND`, `REDO_COMMAND` and `CLEAR_HISTORY_COMMAND` commands. It also triggers `CAN_UNDO_COMMAND` and `CAN_REDO_COMMAND` commands when history state is changed. These commands could be used to work with history state:\n\n```jsx\nimport {UNDO_COMMAND, REDO_COMMAND} from '@ekz/lexical';\n\n<Toolbar>\n  <Button onClick={() => editor.dispatchCommand(UNDO_COMMAND, undefined)}>Undo</Button>\n  <Button onClick={() => editor.dispatchCommand(REDO_COMMAND, undefined)}>Redo</Button>\n</Toolbar>;\n```\n","readmeFilename":"README.md"}