diff --git a/app/package-lock.json b/app/package-lock.json index 4be8915..48b03e9 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@exampledev/new.css": "^1.1.3", "@fastify/http-proxy": "^8.2.2", + "@lexical/history": "^0.4.1", "@lexical/plain-text": "^0.4.1", "esbuild": "^0.15.7", "esbuild-register": "^3.3.3", @@ -114,6 +115,17 @@ "lexical": "0.4.1" } }, + "node_modules/@lexical/history": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@lexical/history/-/history-0.4.1.tgz", + "integrity": "sha512-n7KUYqCN0jj+NmMrT0bGjbSwn5x7EyDYhw9eghm69/fgHI/qHSJDQUQXa2ep4/0y4kPzYafVZSMrBDYXBxWqmw==", + "dependencies": { + "@lexical/utils": "0.4.1" + }, + "peerDependencies": { + "lexical": "0.4.1" + } + }, "node_modules/@lexical/html": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/@lexical/html/-/html-0.4.1.tgz", @@ -130,7 +142,6 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/@lexical/list/-/list-0.4.1.tgz", "integrity": "sha512-dP6i18qm1UhUoG6FvqLMn7hoj4htE0jYcmMPYqFyH+f1ir9Ybvr87pV3aFhqH6hdHjQ5tMyM0kURSL1t89GesQ==", - "peer": true, "dependencies": { "@lexical/utils": "0.4.1" }, @@ -162,7 +173,6 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/@lexical/table/-/table-0.4.1.tgz", "integrity": "sha512-1BRLB+cYpqXSk0IHk3uHI1Fa6H4rnQ5pySDm+7HSyShjAzQSMBt0BWoX9B0TW/vXysl3p5+vcnU8mGjGyCA0Lg==", - "peer": true, "dependencies": { "@lexical/utils": "0.4.1" }, @@ -174,7 +184,6 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/@lexical/utils/-/utils-0.4.1.tgz", "integrity": "sha512-OUYS7qpu1oHv9vhUGhL60ow5gbyqLG449XGFZrzaKUGnz1iWU/rXP8nEljoqdtai3rg4t0Ahxcbe9cVIubK3hQ==", - "peer": true, "dependencies": { "@lexical/list": "0.4.1", "@lexical/table": "0.4.1" @@ -1174,6 +1183,14 @@ "@lexical/utils": "0.4.1" } }, + "@lexical/history": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@lexical/history/-/history-0.4.1.tgz", + "integrity": "sha512-n7KUYqCN0jj+NmMrT0bGjbSwn5x7EyDYhw9eghm69/fgHI/qHSJDQUQXa2ep4/0y4kPzYafVZSMrBDYXBxWqmw==", + "requires": { + "@lexical/utils": "0.4.1" + } + }, "@lexical/html": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/@lexical/html/-/html-0.4.1.tgz", @@ -1187,7 +1204,6 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/@lexical/list/-/list-0.4.1.tgz", "integrity": "sha512-dP6i18qm1UhUoG6FvqLMn7hoj4htE0jYcmMPYqFyH+f1ir9Ybvr87pV3aFhqH6hdHjQ5tMyM0kURSL1t89GesQ==", - "peer": true, "requires": { "@lexical/utils": "0.4.1" } @@ -1209,7 +1225,6 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/@lexical/table/-/table-0.4.1.tgz", "integrity": "sha512-1BRLB+cYpqXSk0IHk3uHI1Fa6H4rnQ5pySDm+7HSyShjAzQSMBt0BWoX9B0TW/vXysl3p5+vcnU8mGjGyCA0Lg==", - "peer": true, "requires": { "@lexical/utils": "0.4.1" } @@ -1218,7 +1233,6 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/@lexical/utils/-/utils-0.4.1.tgz", "integrity": "sha512-OUYS7qpu1oHv9vhUGhL60ow5gbyqLG449XGFZrzaKUGnz1iWU/rXP8nEljoqdtai3rg4t0Ahxcbe9cVIubK3hQ==", - "peer": true, "requires": { "@lexical/list": "0.4.1", "@lexical/table": "0.4.1" diff --git a/app/package.json b/app/package.json index d719b6d..06ad44e 100644 --- a/app/package.json +++ b/app/package.json @@ -13,6 +13,7 @@ "dependencies": { "@exampledev/new.css": "^1.1.3", "@fastify/http-proxy": "^8.2.2", + "@lexical/history": "^0.4.1", "@lexical/plain-text": "^0.4.1", "esbuild": "^0.15.7", "esbuild-register": "^3.3.3", diff --git a/app/views/components/editor.tsx b/app/views/components/editor.tsx index 94539ea..de26253 100644 --- a/app/views/components/editor.tsx +++ b/app/views/components/editor.tsx @@ -5,6 +5,7 @@ import { $getRoot, createEditor, } from "lexical"; +import { registerHistory, createEmptyHistoryState } from "@lexical/history"; import { registerPlainText } from "@lexical/plain-text"; import { onCleanup, onMount } from "solid-js"; import type Pages from "../../protocol/pages"; @@ -34,6 +35,7 @@ export default (props: { root.append(paragraphNode); }; onCleanup(registerPlainText(editor, initialEditorState)); + onCleanup(registerHistory(editor, createEmptyHistoryState(), 333)); onMount(() => { onCleanup( editor.registerTextContentListener((text) => {