diff --git a/package-lock.json b/package-lock.json index e23c1ddd7..8e0ef5284 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7571,20 +7571,39 @@ "dev": true, "license": "MIT" }, + "node_modules/@lexical/a11y": { + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/a11y/-/a11y-0.52.0.tgz", + "integrity": "sha512-FxcKnksrgeoPDxQgwHqTz81Tbv7vZnP2i09m7uU+zusNRt4g1dgbwSEq4Uee9yfLJ9qxM5P9YOGQTe0A6lAuAg==", + "license": "MIT", + "dependencies": { + "@lexical/extension": "0.52.0", + "@lexical/utils": "0.52.0", + "lexical": "0.52.0" + }, + "peerDependencies": { + "typescript": ">=5.2" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/@lexical/clipboard": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/clipboard/-/clipboard-0.46.0.tgz", - "integrity": "sha512-c7lQeORx5+2tfc9+xnHDPBT097t9KdWW3a/kg/ThliokHOkaYz6OeM2z53uID/OOpRGao8FRO5vw9rz5ZAhg+w==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/clipboard/-/clipboard-0.52.0.tgz", + "integrity": "sha512-SwUpKUEzTfl3dZlCXkYZN4CAU6AENzzuO3AtWCgbdtxG1HBnyUtMd6MP1XFUtYh0fhMGXw+QObzp+3+h0g3WTw==", "license": "MIT", "dependencies": { - "@lexical/extension": "0.46.0", - "@lexical/html": "0.46.0", - "@lexical/internal": "0.46.0", - "@lexical/list": "0.46.0", - "@lexical/selection": "0.46.0", - "@lexical/utils": "0.46.0", + "@lexical/extension": "0.52.0", + "@lexical/html": "0.52.0", + "@lexical/internal": "0.52.0", + "@lexical/list": "0.52.0", + "@lexical/selection": "0.52.0", + "@lexical/utils": "0.52.0", "@types/trusted-types": "^2.0.7", - "lexical": "0.46.0" + "lexical": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -7596,16 +7615,36 @@ } }, "node_modules/@lexical/code-core": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/code-core/-/code-core-0.46.0.tgz", - "integrity": "sha512-ljlMBSvjTwKVNV7myEr4xJRGTDsJ3kcjHi6rZuBteZExnd/tD44oSY3TSa1jgy+TqiXkEdUpWQYqmnwMsOJrlQ==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/code-core/-/code-core-0.52.0.tgz", + "integrity": "sha512-4ofNvUXEal2tm6DLGHtjJUc7C1qQP2RHUO4v/RHSSdWEHLKM1kITgIUUvWkf6FHnQNrTvrL2U5vxACv2bo0HVQ==", "license": "MIT", "dependencies": { - "@lexical/extension": "0.46.0", - "@lexical/html": "0.46.0", - "@lexical/internal": "0.46.0", - "@lexical/utils": "0.46.0", - "lexical": "0.46.0" + "@lexical/extension": "0.52.0", + "@lexical/html": "0.52.0", + "@lexical/internal": "0.52.0", + "@lexical/utils": "0.52.0", + "lexical": "0.52.0" + }, + "peerDependencies": { + "typescript": ">=5.2" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@lexical/code-prism": { + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/code-prism/-/code-prism-0.52.0.tgz", + "integrity": "sha512-RRAj+RmY4p9W4LMPNJQqw3N9/myrrevG5ptD7PsIrbPb4pbJkHNP8ol5CS8OQ1zelUqROKUfqBmDJsdzfsChGQ==", + "license": "MIT", + "dependencies": { + "@lexical/code-core": "0.52.0", + "@lexical/extension": "0.52.0", + "lexical": "0.52.0", + "prismjs": "^1.30.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -7617,21 +7656,21 @@ } }, "node_modules/@lexical/devtools-core": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/devtools-core/-/devtools-core-0.46.0.tgz", - "integrity": "sha512-9J5dRO/tZXM/ROeSRvnkfMvfGa4AbOjDQmVFhK1WiuoPNBoC45m4hijE4R3/l/Z6xvjinc804PfAsAxVjgVVnA==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/devtools-core/-/devtools-core-0.52.0.tgz", + "integrity": "sha512-WWnyAMiktdb7hIynOcOVyk2N19Q52kacLHJBnnGrJqR9tlhnAmH3DILfZ9BrCmetvKF1bbnJI6YE2wwxMi2bbQ==", "license": "MIT", "dependencies": { - "@lexical/html": "0.46.0", - "@lexical/link": "0.46.0", - "@lexical/mark": "0.46.0", - "@lexical/table": "0.46.0", - "@lexical/utils": "0.46.0", - "lexical": "0.46.0" + "@lexical/html": "0.52.0", + "@lexical/link": "0.52.0", + "@lexical/mark": "0.52.0", + "@lexical/table": "0.52.0", + "@lexical/utils": "0.52.0", + "lexical": "0.52.0" }, "peerDependencies": { - "react": ">=17.x", - "react-dom": ">=17.x", + "react": ">=18.x", + "react-dom": ">=18.x", "typescript": ">=5.2" }, "peerDependenciesMeta": { @@ -7641,13 +7680,13 @@ } }, "node_modules/@lexical/dragon": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/dragon/-/dragon-0.46.0.tgz", - "integrity": "sha512-/PIjscXlD0jp3Bj5MWJ+y1WZsVxagsqnnzOkqdDStM3033soj/2cI7tysMU/7XAEJtMBk1bTJdDvmDHM/bn/rg==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/dragon/-/dragon-0.52.0.tgz", + "integrity": "sha512-XiNrujvAoywb41GRaRYFhPc/T7jxkFMf/bR9uE8S2t4fMERUFF1xM7Mos6NQ+skdDrF3KfxnLFzLCZ+4Oc9VyA==", "license": "MIT", "dependencies": { - "@lexical/extension": "0.46.0", - "lexical": "0.46.0" + "@lexical/extension": "0.52.0", + "lexical": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -7659,15 +7698,15 @@ } }, "node_modules/@lexical/extension": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/extension/-/extension-0.46.0.tgz", - "integrity": "sha512-bdO/ON5dwVwtqeTes/+My/sRU7vNuH3W8ovJ2yffXRFmAxVtzKr6/6TYJWwtUvncQjvTHEKAo5MqWUoQXp8VMw==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/extension/-/extension-0.52.0.tgz", + "integrity": "sha512-do7uvUxg6mJK0702XlD0Z8UMCtr1Yij4/WpJ7+GY5CL2jKVercMeeYBBEE7cWc/OXQJgzVx3ClNXC7XAHI6Fvw==", "license": "MIT", "dependencies": { - "@lexical/internal": "0.46.0", - "@lexical/utils": "0.46.0", - "@preact/signals-core": "^1.14.1", - "lexical": "0.46.0" + "@lexical/internal": "0.52.0", + "@lexical/utils": "0.52.0", + "@preact/signals-core": "^1.14.4", + "lexical": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -7679,14 +7718,14 @@ } }, "node_modules/@lexical/hashtag": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/hashtag/-/hashtag-0.46.0.tgz", - "integrity": "sha512-6XiL5/KXyCxR+oD7fWjJL3enqsrkn4hgjEa13wAQrBZ5W+avFl/9Cd5bkwcXS+jPjmhk47+zYj76l6uuiFoMoQ==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/hashtag/-/hashtag-0.52.0.tgz", + "integrity": "sha512-y0d7fLhIItJHGdw+bulvzXBNrb0wkppvDkR9jqAp8w0s53zlRLn4egucLkSEWqd0kSAN3jjmSoxcWeC4sF6I0A==", "license": "MIT", "dependencies": { - "@lexical/text": "0.46.0", - "@lexical/utils": "0.46.0", - "lexical": "0.46.0" + "@lexical/text": "0.52.0", + "@lexical/utils": "0.52.0", + "lexical": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -7698,14 +7737,14 @@ } }, "node_modules/@lexical/history": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/history/-/history-0.46.0.tgz", - "integrity": "sha512-PbbyXVfbm/RBS/hkPJrAGd6DYZ8/4E+nyPaiArwo4WGYQBoEXc2dU+dwAcIrhwVVXuOVrkm9Hp0cZYl4hKM8qQ==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/history/-/history-0.52.0.tgz", + "integrity": "sha512-UJWmTcru+4KWkk8YtBSQ4dNLYuOJVCyCMFGsaCp/jVJEobwdY//jCTj9idOfE4b3H39kAixe9yQG/FNNOj4ujg==", "license": "MIT", "dependencies": { - "@lexical/extension": "0.46.0", - "@lexical/utils": "0.46.0", - "lexical": "0.46.0" + "@lexical/extension": "0.52.0", + "@lexical/utils": "0.52.0", + "lexical": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -7717,16 +7756,16 @@ } }, "node_modules/@lexical/html": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/html/-/html-0.46.0.tgz", - "integrity": "sha512-Rvke8FvQkjd+hFBCe39YdQxPQZZ/7W95xilY3qFxmSZaW0zakcA8pItaf7HfueG8Ja6jDu/TOMH4LUeyQPT3HQ==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/html/-/html-0.52.0.tgz", + "integrity": "sha512-lRyntwgHnISsUKZHh3T+g9qU1CwTOH5hlnc1UzWE7/RXrvtnSmJTTcJu+sfFdRCiBAlkiIhKuJBCCYu99LeI7Q==", "license": "MIT", "dependencies": { - "@lexical/extension": "0.46.0", - "@lexical/internal": "0.46.0", - "@lexical/selection": "0.46.0", - "@lexical/utils": "0.46.0", - "lexical": "0.46.0" + "@lexical/extension": "0.52.0", + "@lexical/internal": "0.52.0", + "@lexical/selection": "0.52.0", + "@lexical/utils": "0.52.0", + "lexical": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -7738,9 +7777,9 @@ } }, "node_modules/@lexical/internal": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/internal/-/internal-0.46.0.tgz", - "integrity": "sha512-OV1ePAAnVVd0K+Bq5SX7vOKE/LqJLYcDM4HD4zVCisbgVaznE+pTj/nDB2uWTidwf8o7QhPR65VhEi+KkUtyEw==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/internal/-/internal-0.52.0.tgz", + "integrity": "sha512-Y7jKqeh4Irf/FwNmAqHIk3b05HpMsHv2RyWPQ8+M7FAdEbT9N2mksjc8ZUZ3tHqDMi7FNiLkjZN/DwbdekUb1g==", "license": "MIT", "peerDependencies": { "typescript": ">=5.2" @@ -7752,16 +7791,17 @@ } }, "node_modules/@lexical/link": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/link/-/link-0.46.0.tgz", - "integrity": "sha512-MdGiAOAmqnZKtfaQxKFZv18SC+1zJIOfqB7bR43va/rp4M3u1cVniquUCTALub40WEWTuJgT2XvfSlpKm7FuXA==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/link/-/link-0.52.0.tgz", + "integrity": "sha512-9hl/SxbkK5P0q1Rn4rTnaLHetTnf4zb+zgJjQwHAkqmeS561gLq34RcoO2i1zhibe8b6xk8gyhIe2cOpPeAC7w==", "license": "MIT", "dependencies": { - "@lexical/extension": "0.46.0", - "@lexical/html": "0.46.0", - "@lexical/internal": "0.46.0", - "@lexical/utils": "0.46.0", - "lexical": "0.46.0" + "@lexical/a11y": "0.52.0", + "@lexical/extension": "0.52.0", + "@lexical/html": "0.52.0", + "@lexical/internal": "0.52.0", + "@lexical/utils": "0.52.0", + "lexical": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -7773,16 +7813,16 @@ } }, "node_modules/@lexical/list": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/list/-/list-0.46.0.tgz", - "integrity": "sha512-nIX3k05MFAhWZvVXZBZB7LTS1DhsCF2iCFH2WDYebwJfADTnAqhE/ZCAJax84RRMjYla67JU31br9r+P6KR+hA==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/list/-/list-0.52.0.tgz", + "integrity": "sha512-B3+CdxWsdj6jBKtXiY7v4OSkyXBwotWyiD+75Baw0lvmjvniV33mvuMDgnPEQgEpFcGpBRmiu8M8kQdclQzXmQ==", "license": "MIT", "dependencies": { - "@lexical/extension": "0.46.0", - "@lexical/html": "0.46.0", - "@lexical/internal": "0.46.0", - "@lexical/utils": "0.46.0", - "lexical": "0.46.0" + "@lexical/extension": "0.52.0", + "@lexical/html": "0.52.0", + "@lexical/internal": "0.52.0", + "@lexical/utils": "0.52.0", + "lexical": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -7794,13 +7834,13 @@ } }, "node_modules/@lexical/mark": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/mark/-/mark-0.46.0.tgz", - "integrity": "sha512-WRpMATEhci3LxCgF4wN3mX2IIctTN5Zx8GQZU4rtbVBWHaYRA0azpyzsHeFJlpaaI0FJVMWfNQJ3QBeVIr6Ciw==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/mark/-/mark-0.52.0.tgz", + "integrity": "sha512-nBPNmqKDFZm4REih0nsFbYcecSokXLnDNoZ+CeNOO53OYMljUnnj3gBhoaLdzwlpypqi6yGkGPJUEAtJE7fTyg==", "license": "MIT", "dependencies": { - "@lexical/utils": "0.46.0", - "lexical": "0.46.0" + "@lexical/utils": "0.52.0", + "lexical": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -7812,20 +7852,20 @@ } }, "node_modules/@lexical/markdown": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/markdown/-/markdown-0.46.0.tgz", - "integrity": "sha512-2e/JFuS+7QEPLW4K2SOoYORpLXhdjFBh7l5OxAf8HljuFAvX0x9eFBxlWVG0Y00TFUMnOcUm1QnIo5l2e+0Cjg==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/markdown/-/markdown-0.52.0.tgz", + "integrity": "sha512-ntNi3SdjfcWoH7wi/D6rlO2Hw8MjDRkxuObAAQwJKLzJPvohNPKuzDoqM47uXNSs0XCS/HupI4mWShyrEZkDtA==", "license": "MIT", "dependencies": { - "@lexical/code-core": "0.46.0", - "@lexical/internal": "0.46.0", - "@lexical/link": "0.46.0", - "@lexical/list": "0.46.0", - "@lexical/rich-text": "0.46.0", - "@lexical/selection": "0.46.0", - "@lexical/text": "0.46.0", - "@lexical/utils": "0.46.0", - "lexical": "0.46.0" + "@lexical/code-core": "0.52.0", + "@lexical/internal": "0.52.0", + "@lexical/link": "0.52.0", + "@lexical/list": "0.52.0", + "@lexical/rich-text": "0.52.0", + "@lexical/selection": "0.52.0", + "@lexical/text": "0.52.0", + "@lexical/utils": "0.52.0", + "lexical": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -7837,12 +7877,12 @@ } }, "node_modules/@lexical/overflow": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/overflow/-/overflow-0.46.0.tgz", - "integrity": "sha512-VRa/VovH+FeuL9oyEjqF0zM2Nu4stgPs78Ek0mm9SR3EV1Cq58CoqjMvz/eH+4OsYMksFNfkxBg5f4a7QSAeDQ==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/overflow/-/overflow-0.52.0.tgz", + "integrity": "sha512-GFtXJze8Ypsy271ZxhNrGI0wlbG5fbJcW9dgj1XiWhXVYtPajRaBYyu20kVG7LBkQwngS5B97wO/hKfHtVGDqQ==", "license": "MIT", "dependencies": { - "lexical": "0.46.0" + "lexical": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -7854,17 +7894,17 @@ } }, "node_modules/@lexical/plain-text": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/plain-text/-/plain-text-0.46.0.tgz", - "integrity": "sha512-fH1MYHrilsho6hkpGHnjw2eFBeLaJzz5PY4LT9ZVxtliPB3YRKUYZLcP23fGidzOC2it2xvTkT9D7kFo7zTQug==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/plain-text/-/plain-text-0.52.0.tgz", + "integrity": "sha512-jklUI77tbzDhKEOHhoUCUS3SqMvzZjJ7NNeqsMfvKT8sLWbtKvrPJBJWnfcGu5ADxp7xrOYE9j66uSHkROG2gg==", "license": "MIT", "dependencies": { - "@lexical/clipboard": "0.46.0", - "@lexical/dragon": "0.46.0", - "@lexical/extension": "0.46.0", - "@lexical/selection": "0.46.0", - "@lexical/utils": "0.46.0", - "lexical": "0.46.0" + "@lexical/clipboard": "0.52.0", + "@lexical/dragon": "0.52.0", + "@lexical/extension": "0.52.0", + "@lexical/selection": "0.52.0", + "@lexical/utils": "0.52.0", + "lexical": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -7876,36 +7916,37 @@ } }, "node_modules/@lexical/react": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/react/-/react-0.46.0.tgz", - "integrity": "sha512-yYz09UTTSVFFpU6Zku/m4LLGgg6qjnz83PoPf7rxx7/IuZHcJK6dCaApXZUdilMHf+A1gGG0W4UNXGjWVaX1nw==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/react/-/react-0.52.0.tgz", + "integrity": "sha512-CbwYw0Dtm13QE5yFjlfXcOiiSkESAyreTzuQxanvwdFeQrRrM4llbOawjvXGuisdz8mPT8RcCKnVBQdoNs9DnA==", "license": "MIT", "dependencies": { "@floating-ui/react": "^0.27.19", - "@lexical/devtools-core": "0.46.0", - "@lexical/dragon": "0.46.0", - "@lexical/extension": "0.46.0", - "@lexical/hashtag": "0.46.0", - "@lexical/history": "0.46.0", - "@lexical/internal": "0.46.0", - "@lexical/link": "0.46.0", - "@lexical/list": "0.46.0", - "@lexical/mark": "0.46.0", - "@lexical/markdown": "0.46.0", - "@lexical/overflow": "0.46.0", - "@lexical/plain-text": "0.46.0", - "@lexical/rich-text": "0.46.0", - "@lexical/table": "0.46.0", - "@lexical/text": "0.46.0", - "@lexical/utils": "0.46.0", - "@lexical/yjs": "0.46.0", - "lexical": "0.46.0" - }, - "peerDependencies": { - "react": ">=17.x", - "react-dom": ">=17.x", + "@lexical/a11y": "0.52.0", + "@lexical/devtools-core": "0.52.0", + "@lexical/dragon": "0.52.0", + "@lexical/extension": "0.52.0", + "@lexical/hashtag": "0.52.0", + "@lexical/history": "0.52.0", + "@lexical/internal": "0.52.0", + "@lexical/link": "0.52.0", + "@lexical/list": "0.52.0", + "@lexical/mark": "0.52.0", + "@lexical/markdown": "0.52.0", + "@lexical/overflow": "0.52.0", + "@lexical/plain-text": "0.52.0", + "@lexical/rich-text": "0.52.0", + "@lexical/table": "0.52.0", + "@lexical/text": "0.52.0", + "@lexical/utils": "0.52.0", + "@lexical/yjs": "0.52.0", + "lexical": "0.52.0" + }, + "peerDependencies": { + "react": ">=18.x", + "react-dom": ">=18.x", "typescript": ">=5.2", - "yjs": ">=13.5.22" + "yjs": ">=13.5.37" }, "peerDependenciesMeta": { "typescript": { @@ -7917,18 +7958,19 @@ } }, "node_modules/@lexical/rich-text": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/rich-text/-/rich-text-0.46.0.tgz", - "integrity": "sha512-YwERYF7bOGZOmulxzyHID+gUkxCbTbn73pqow8GyasAdwlbTiiyqKSUp3fXC3prcMftQX8eg+SJNwkijvZk9yA==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/rich-text/-/rich-text-0.52.0.tgz", + "integrity": "sha512-P3Y4SM6JSCBG6uFwLpPVEZiShhfC/GCJA//lQU1ZljxPDnCb4ueVCfWSBBdw0nSejYg8KvDQsijc4Fczyjqqtw==", "license": "MIT", "dependencies": { - "@lexical/clipboard": "0.46.0", - "@lexical/dragon": "0.46.0", - "@lexical/extension": "0.46.0", - "@lexical/html": "0.46.0", - "@lexical/selection": "0.46.0", - "@lexical/utils": "0.46.0", - "lexical": "0.46.0" + "@lexical/a11y": "0.52.0", + "@lexical/clipboard": "0.52.0", + "@lexical/dragon": "0.52.0", + "@lexical/extension": "0.52.0", + "@lexical/html": "0.52.0", + "@lexical/selection": "0.52.0", + "@lexical/utils": "0.52.0", + "lexical": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -7940,13 +7982,13 @@ } }, "node_modules/@lexical/selection": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/selection/-/selection-0.46.0.tgz", - "integrity": "sha512-iWrztXnBl9x7DthlRefUCNHfY8lHU6AzDm7pIr3o7t1hoixDtTuiZ5cCw+PkShC/hZ8v7VuV+FaDNraSaTTkHA==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/selection/-/selection-0.52.0.tgz", + "integrity": "sha512-O1hgwqUvoF/R2DxXIOJJvCqXxNM7kOWq1TBxqnbjT4TXNlDokEdpkO5EpetAWYWZj5UE2BUphfGUZAPQjvcUKQ==", "license": "MIT", "dependencies": { - "@lexical/internal": "0.46.0", - "lexical": "0.46.0" + "@lexical/internal": "0.52.0", + "lexical": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -7958,17 +8000,17 @@ } }, "node_modules/@lexical/table": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/table/-/table-0.46.0.tgz", - "integrity": "sha512-azgbCn+CxyGF2wVFB5Rmcx3wFKR9WKiGvJUUh8YDnMxL9LMWESfFy36XbedR140xUq0QoYTw8ZxBGMHE4ZiIIg==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/table/-/table-0.52.0.tgz", + "integrity": "sha512-zuVGmY37jUqGMT/7pFMPiLOKUD755SJR+yHZ3Jz7P4pdBI/sXHvbM8O7QDXMpDRFZwLQi1iBvgOj0Yv9FrTxQw==", "license": "MIT", "dependencies": { - "@lexical/clipboard": "0.46.0", - "@lexical/extension": "0.46.0", - "@lexical/html": "0.46.0", - "@lexical/internal": "0.46.0", - "@lexical/utils": "0.46.0", - "lexical": "0.46.0" + "@lexical/clipboard": "0.52.0", + "@lexical/extension": "0.52.0", + "@lexical/html": "0.52.0", + "@lexical/internal": "0.52.0", + "@lexical/utils": "0.52.0", + "lexical": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -7980,13 +8022,13 @@ } }, "node_modules/@lexical/text": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/text/-/text-0.46.0.tgz", - "integrity": "sha512-XjH6ry2vYOfTO1JOLdbjlZ8he8LjkFjLbVIk+1I/q+8vp5ADx5GK99KaQfBiPZb0WTJEkuqo4AELWn3sXMvAiw==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/text/-/text-0.52.0.tgz", + "integrity": "sha512-TuXd6a4MO18rQwU0Bl8VHNzWGD4o5pHnf3NKXwTRynImpeMJ8BGumVC6r27cGbh0kgBkvmX8Sb4EEbBQC9BYnQ==", "license": "MIT", "dependencies": { - "@lexical/internal": "0.46.0", - "lexical": "0.46.0" + "@lexical/internal": "0.52.0", + "lexical": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -7998,14 +8040,14 @@ } }, "node_modules/@lexical/utils": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/utils/-/utils-0.46.0.tgz", - "integrity": "sha512-s8XQDoBr1wyPKGqy3qyDeHvi+vMgOiszzcRdHvTd6AqWpXxw2MsDQzMdF3Nr56QHahcOYxMOcv+r7r2nnCcgCA==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/utils/-/utils-0.52.0.tgz", + "integrity": "sha512-3Azoh0EQckRcMd6CGOAuKue/UHDvkorrheXZFu9KpxhCBNQy+ic55jl0WQZFTOv2iO3NWReAMSuOAK0pWR2JPg==", "license": "MIT", "dependencies": { - "@lexical/internal": "0.46.0", - "@lexical/selection": "0.46.0", - "lexical": "0.46.0" + "@lexical/internal": "0.52.0", + "@lexical/selection": "0.52.0", + "lexical": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -8017,18 +8059,18 @@ } }, "node_modules/@lexical/yjs": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@lexical/yjs/-/yjs-0.46.0.tgz", - "integrity": "sha512-CsDD3NpmhoHjqnvbwQoTa3/lDYOCqlpBhRJcE14ERfngZ3PpoNu+YUW6IbhJ5PVFvtub8H3x8V9OjZ1IbHvZjg==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@lexical/yjs/-/yjs-0.52.0.tgz", + "integrity": "sha512-6Qd9/AkMDxDNalsXDs1X7ddLTw2OsqUy42RRvpIWlv0ya1MO4CNedl4NvgwMtYzxtLzOkq0prtspCPvkirYkmA==", "license": "MIT", "dependencies": { - "@lexical/internal": "0.46.0", - "@lexical/selection": "0.46.0", - "lexical": "0.46.0" + "@lexical/internal": "0.52.0", + "@lexical/selection": "0.52.0", + "lexical": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2", - "yjs": ">=13.5.22" + "yjs": ">=13.5.37" }, "peerDependenciesMeta": { "typescript": { @@ -23453,12 +23495,12 @@ } }, "node_modules/lexical": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/lexical/-/lexical-0.46.0.tgz", - "integrity": "sha512-oaE7OLY/FuqGKC7ihaqLJvgn/NvvRveryKBBgOwrSe+UIpBmc9IvyXf6hVcvew9M3Vc0XavHWe/ZAL7qc5DzMw==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/lexical/-/lexical-0.52.0.tgz", + "integrity": "sha512-mePejqwCDaW0GR89IoofJTTlk/EiwwlGhbs1D8qOx/Iw6ieG5D3nh7PSPLv0Csia0UC58HpuV91DilJjqeAWSw==", "license": "MIT", "dependencies": { - "@lexical/internal": "0.46.0" + "@lexical/internal": "0.52.0" }, "peerDependencies": { "typescript": ">=5.2" @@ -23470,9 +23512,9 @@ } }, "node_modules/lib0": { - "version": "0.2.117", - "resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.117.tgz", - "integrity": "sha512-DeXj9X5xDCjgKLU/7RR+/HQEVzuuEUiwldwOGsHK/sfAfELGWEyTcf0x+uOvCvK3O2zPmZePXWL85vtia6GyZw==", + "version": "0.2.119", + "resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.119.tgz", + "integrity": "sha512-vh+TiejVy8Xm+hCdnRfn9BthGNvNUZdEXltNjVZL3TzRIKP3s1lnQh8pWd/Q0wCgY0FPAGVVjFF4ZiHUV3LFgA==", "license": "MIT", "peer": true, "dependencies": { @@ -35401,9 +35443,9 @@ } }, "node_modules/yjs": { - "version": "13.6.31", - "resolved": "https://registry.npmjs.org/yjs/-/yjs-13.6.31.tgz", - "integrity": "sha512-Eq+5BRfbeGyqGVrTJL3bEcr8gKkxPuyuoHmAwpk52fDb8kOVMrfVSTRPd6yiGgX5Fskb96qCRjzjbRjrL4YEnw==", + "version": "13.6.33", + "resolved": "https://registry.npmjs.org/yjs/-/yjs-13.6.33.tgz", + "integrity": "sha512-q/UYvr1gOk4XII+Cu1CW2dINjYqJJFifTzogEaIARznrvX7uOlHsdTEXcnOBMuIsrCGEEKdNxi74kyMLZlKVfw==", "license": "MIT", "peer": true, "dependencies": { @@ -35533,7 +35575,8 @@ "@headless-tree/core": "^1.7.0", "@headless-tree/react": "^1.7.0", "@hookform/resolvers": "^5.2.2", - "@lexical/react": "^0.46.0", + "@lexical/code-prism": "^0.52.0", + "@lexical/react": "^0.52.0", "@msgpack/msgpack": "^3.1.3", "@reduxjs/toolkit": "^2.11.2", "@tanstack/react-virtual": "^3.14.2", @@ -35567,7 +35610,7 @@ "i18next-http-backend": "^3.0.4", "idb-keyval": "^6.2.2", "leviathan-crypto": "^1.4.0", - "lexical": "^0.46.0", + "lexical": "^0.52.0", "libsodium-wrappers-sumo": "^0.8.2", "lodash": "^4.17.23", "lru-cache": "^11.2.7", diff --git a/packages/app/package.json b/packages/app/package.json index 3e1b30fa2..0a9ceae15 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -114,7 +114,8 @@ "@headless-tree/core": "^1.7.0", "@headless-tree/react": "^1.7.0", "@hookform/resolvers": "^5.2.2", - "@lexical/react": "^0.46.0", + "@lexical/code-prism": "^0.52.0", + "@lexical/react": "^0.52.0", "@msgpack/msgpack": "^3.1.3", "@reduxjs/toolkit": "^2.11.2", "@tanstack/react-virtual": "^3.14.2", @@ -148,7 +149,7 @@ "i18next-http-backend": "^3.0.4", "idb-keyval": "^6.2.2", "leviathan-crypto": "^1.4.0", - "lexical": "^0.46.0", + "lexical": "^0.52.0", "libsodium-wrappers-sumo": "^0.8.2", "lodash": "^4.17.23", "lru-cache": "^11.2.7", diff --git a/packages/app/src/features/NoteEditor/RichEditor/RichEditorContent.tsx b/packages/app/src/features/NoteEditor/RichEditor/RichEditorContent.tsx index 35bd6cf8b..59b069a28 100644 --- a/packages/app/src/features/NoteEditor/RichEditor/RichEditorContent.tsx +++ b/packages/app/src/features/NoteEditor/RichEditor/RichEditorContent.tsx @@ -1,11 +1,5 @@ import React, { Ref, useEffect, useImperativeHandle, useMemo } from 'react'; -import { - $createRangeSelection, - $getRoot, - $getSelection, - $setSelection, - LexicalEditor, -} from 'lexical'; +import { $getRoot, $getSelection, LexicalEditor } from 'lexical'; import { Box, useSlotRecipe } from '@chakra-ui/react'; import { CheckListPlugin } from '@lexical/react/LexicalCheckListPlugin'; import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'; @@ -79,12 +73,8 @@ export const RichEditorContent = ({ // Do not change selection if exists if ($getSelection()) return; - // Set cursor at content start - const rootKey = $getRoot().getKey(); - const selection = $createRangeSelection(); - selection.anchor.set(rootKey, 0, 'element'); - selection.focus.set(rootKey, 0, 'element'); - $setSelection(selection); + // Put the cursor at the start of the first leaf/block + $getRoot().selectStart(); }); const rootNode = editor.getRootElement(); diff --git a/packages/app/src/features/NoteEditor/RichEditor/__tests__/spec/codeblock.browser.test.ts b/packages/app/src/features/NoteEditor/RichEditor/__tests__/spec/codeblock.browser.test.ts new file mode 100644 index 000000000..621c4058a --- /dev/null +++ b/packages/app/src/features/NoteEditor/RichEditor/__tests__/spec/codeblock.browser.test.ts @@ -0,0 +1,57 @@ +import { act, createRef } from 'react'; +import { page, userEvent } from 'vitest/browser'; + +import { RichEditorAPI } from '../../RichEditorContent'; + +import { renderRichEditorInDOM } from '../utils/renderEditorInDOM'; + +test('insertion into empty editor creates code block on first paragraph', async () => { + const editorApi = createRef(); + const editor = await renderRichEditorInDOM({ + value: '', + apiRef: editorApi, + }); + + const editorLocator = page.elementLocator(editor.container); + expect(editorLocator.getByRole('paragraph')).toHaveLength(1); + + // Focus on empty editor via editor API + expect(editorApi.current).haveOwnProperty('focus'); + await act(async () => { + editorApi.current?.focus(); + }); + await editor.insert({ type: 'code' }); + + expect(editorLocator.getByRole('code')).toHaveLength(1); + expect(editorLocator.getByRole('paragraph')).toHaveLength(0); +}); + +test('insertion converts paragraph and its content into a code block', async () => { + const editorApi = createRef(); + const editor = await renderRichEditorInDOM({ + value: '', + apiRef: editorApi, + }); + + const editorLocator = page.elementLocator(editor.container); + expect(editorLocator.getByRole('paragraph')).toHaveLength(1); + + // Focus on empty editor via editor API + expect(editorApi.current).haveOwnProperty('focus'); + await act(async () => { + await editorLocator.click(); + }); + + // Add one paragraph + await act(async () => { + await userEvent.keyboard('Some code here'); + }); + expect(editorLocator.getByRole('paragraph')).toHaveTextContent('Some code here'); + + // Convert it + await editor.insert({ type: 'code' }); + + expect(editorLocator.getByRole('code')).toHaveLength(1); + expect(editorLocator.getByRole('code')).toHaveTextContent('Some code here'); + expect(editorLocator.getByRole('paragraph')).toHaveLength(0); +}); diff --git a/packages/app/src/features/NoteEditor/RichEditor/plugins/CodeHighlightPlugin.tsx b/packages/app/src/features/NoteEditor/RichEditor/plugins/CodeHighlightPlugin.tsx index 970e8e76d..5f2c5425d 100644 --- a/packages/app/src/features/NoteEditor/RichEditor/plugins/CodeHighlightPlugin.tsx +++ b/packages/app/src/features/NoteEditor/RichEditor/plugins/CodeHighlightPlugin.tsx @@ -1,13 +1,17 @@ import { useEffect } from 'react'; +import { mergeRegister } from 'lexical'; import { registerCodeIndentation } from '@lexical/code-core'; +import { registerCodeHighlighting } from '@lexical/code-prism'; import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'; export const CodeHighlightPlugin = () => { const [editor] = useLexicalComposerContext(); - // TODO: use registerCodeHighlighting useEffect(() => { - return registerCodeIndentation(editor); + return mergeRegister( + registerCodeIndentation(editor), + registerCodeHighlighting(editor), + ); }, [editor]); return null; diff --git a/packages/app/src/features/NoteEditor/RichEditor/plugins/EditorPanelPlugin/EditorPanelPlugin.tsx b/packages/app/src/features/NoteEditor/RichEditor/plugins/EditorPanelPlugin/EditorPanelPlugin.tsx index 3cb086910..e93e69611 100644 --- a/packages/app/src/features/NoteEditor/RichEditor/plugins/EditorPanelPlugin/EditorPanelPlugin.tsx +++ b/packages/app/src/features/NoteEditor/RichEditor/plugins/EditorPanelPlugin/EditorPanelPlugin.tsx @@ -178,7 +178,7 @@ export const EditorPanelPlugin = () => { code() { editor.update(() => { $wrapNodes((nodes) => { - const code = $createCodeNode(); + const code = $createCodeNode('plain'); const textContent = nodes .map( diff --git a/packages/app/src/features/NoteEditor/RichEditor/theme/RichEditor.css b/packages/app/src/features/NoteEditor/RichEditor/theme/RichEditor.css index abb4f1686..3ba3faa7a 100644 --- a/packages/app/src/features/NoteEditor/RichEditor/theme/RichEditor.css +++ b/packages/app/src/features/NoteEditor/RichEditor/theme/RichEditor.css @@ -199,7 +199,7 @@ white-space: pre; } -.RichEditor__code::before { +.RichEditor__code[data-language][data-highlight-language][data-gutter]::before { display: block; float: left; box-sizing: border-box;