diff --git a/app/package-lock.json b/app/package-lock.json index 2da2aa5..2d81f06 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -8,21 +8,24 @@ "name": "@quot/app", "version": "0.0.0", "dependencies": { + "@codemirror/commands": "^6.1.0", + "@codemirror/language": "^6.2.1", + "@codemirror/view": "^6.2.3", "@exampledev/new.css": "^1.1.3", "@fastify/http-proxy": "^8.2.2", - "@lexical/history": "^0.4.1", - "@lexical/link": "^0.4.1", - "@lexical/rich-text": "^0.4.1", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.2.3", "@tsconfig/node18-strictest-esm": "^1.0.1", + "codemirror": "^6.0.1", "esbuild": "^0.15.7", "esbuild-register": "^3.3.3", "fastify": "^4.5.3", "jose": "^4.9.2", - "lexical": "^0.4.1", "openid-client": "^5.1.9", "solid-js": "^1.5.4" }, "devDependencies": { + "@lezer/generator": "^1.1.1", "@types/node": "^18.7.15", "typescript": "^4.8.2" }, @@ -30,6 +33,82 @@ "node": "^18.7.0" } }, + "node_modules/@codemirror/autocomplete": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.2.0.tgz", + "integrity": "sha512-yNCm2CEE4kE4L2Sf7WeyCej1Q3951ccaCWfomrlBkoERKCss+TzuEeqGe5VnAJTEybLy1yzf1BdMUY/988bfpg==", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.0.0" + }, + "peerDependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@codemirror/commands": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.1.0.tgz", + "integrity": "sha512-qCj2YqmbBjj0P1iumnlL5lBqZvJPzT+t2UvgjcaXErp5ZvMqFRVgQyrEfdXX6SX5UcvcHKBjXqno+MkUp0aYvQ==", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@codemirror/language": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.2.1.tgz", + "integrity": "sha512-MC3svxuvIj0MRpFlGHxLS6vPyIdbTr2KKPEW46kCoCXw2ktb4NTkpkPBI/lSP/FoNXLCBJ0mrnUi1OoZxtpW1Q==", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.0.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0", + "style-mod": "^4.0.0" + } + }, + "node_modules/@codemirror/lint": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.0.0.tgz", + "integrity": "sha512-nUUXcJW1Xp54kNs+a1ToPLK8MadO0rMTnJB8Zk4Z8gBdrN0kqV7uvUraU/T2yqg+grDNR38Vmy/MrhQN/RgwiA==", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "node_modules/@codemirror/search": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.2.0.tgz", + "integrity": "sha512-FVhpUvPFUJe8lg2EQJTTcF4RNI9d/OC3PVitvOfhv5OuY7ZgtMfJl22o5eMkzOEsUY2Wxe7BKGLpe2UI5Wq3PQ==", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "node_modules/@codemirror/state": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.1.1.tgz", + "integrity": "sha512-2s+aXsxmAwnR3Rd+JDHPG/1lw0YsA9PEwl7Re88gHJHGfxyfEzKBmsN4rr53RyPIR4lzbbhJX0DCq0WlqlBIRw==" + }, + "node_modules/@codemirror/view": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.2.3.tgz", + "integrity": "sha512-cgN9gWS9+kv9+eOgVJWMrGUk4EwYKBZpuFYvxIlu4CmMye3+U+gMzuZhBgtPDOCbCp30hxFIOO0MENhGfnaC/g==", + "dependencies": { + "@codemirror/state": "^6.0.0", + "style-mod": "^4.0.0", + "w3c-keyname": "^2.2.4" + } + }, "node_modules/@esbuild/linux-loong64": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.7.tgz", @@ -101,107 +180,38 @@ "undici": "^5.5.1" } }, - "node_modules/@lexical/clipboard": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@lexical/clipboard/-/clipboard-0.4.1.tgz", - "integrity": "sha512-/BHeh+LaYhNbBbzNcVPcYgSZtNp6HT5z/iHFKJMfhikE+4KKFf3DbLDO5b92AUDyT3s8QQC04Na5ZeRUbK/Jzw==", - "peer": true, + "node_modules/@lezer/common": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.0.1.tgz", + "integrity": "sha512-8TR5++Q/F//tpDsLd5zkrvEX5xxeemafEaek7mUp7Y+bI8cKQXdSqhzTOBaOogETcMOVr0pT3BBPXp13477ciw==" + }, + "node_modules/@lezer/generator": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@lezer/generator/-/generator-1.1.1.tgz", + "integrity": "sha512-GrB5EwOn09yf5YfDk6TcspHcF7PQZP83665moY5VmOURwCmNOx+Qit3mwp7W/EsGpqd4PPRioxNkYwYZii69cw==", + "dev": true, "dependencies": { - "@lexical/html": "0.4.1", - "@lexical/list": "0.4.1", - "@lexical/selection": "0.4.1", - "@lexical/utils": "0.4.1" + "@lezer/common": "^1.0.0", + "@lezer/lr": "^1.0.0" }, - "peerDependencies": { - "lexical": "0.4.1" + "bin": { + "lezer-generator": "dist/lezer-generator.cjs" } }, - "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==", + "node_modules/@lezer/highlight": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.0.0.tgz", + "integrity": "sha512-nsCnNtim90UKsB5YxoX65v3GEIw3iCHw9RM2DtdgkiqAbKh9pCdvi8AWNwkYf10Lu6fxNhXPpkpHbW6mihhvJA==", "dependencies": { - "@lexical/utils": "0.4.1" - }, - "peerDependencies": { - "lexical": "0.4.1" + "@lezer/common": "^1.0.0" } }, - "node_modules/@lexical/html": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@lexical/html/-/html-0.4.1.tgz", - "integrity": "sha512-nErgYUtghdrVTPZLB7Ad7U1m3SBxEZvPeW4FH4COFLCeTIVMEG4dg0PhURCk28xNAkEHszd4kQ3XFDRB5muOiQ==", - "peer": true, + "node_modules/@lezer/lr": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.2.3.tgz", + "integrity": "sha512-qpB7rBzH8f6Mzjv2AVZRahcm+2Cf7nbIH++uXbvVOL1yIRvVWQ3HAM/saeBLCyz/togB7LGo76qdJYL1uKQlqA==", "dependencies": { - "@lexical/selection": "0.4.1" - }, - "peerDependencies": { - "lexical": "0.4.1" - } - }, - "node_modules/@lexical/link": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@lexical/link/-/link-0.4.1.tgz", - "integrity": "sha512-566lQymmuBe3Y7UDyaaTs+VDlElbu1WhnjT9lVDk0BXag7MA8tv/f60XptWnTK1pv/Dobm/CyLmyLae55OuflQ==", - "dependencies": { - "@lexical/utils": "0.4.1" - }, - "peerDependencies": { - "lexical": "0.4.1" - } - }, - "node_modules/@lexical/list": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@lexical/list/-/list-0.4.1.tgz", - "integrity": "sha512-dP6i18qm1UhUoG6FvqLMn7hoj4htE0jYcmMPYqFyH+f1ir9Ybvr87pV3aFhqH6hdHjQ5tMyM0kURSL1t89GesQ==", - "dependencies": { - "@lexical/utils": "0.4.1" - }, - "peerDependencies": { - "lexical": "0.4.1" - } - }, - "node_modules/@lexical/rich-text": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@lexical/rich-text/-/rich-text-0.4.1.tgz", - "integrity": "sha512-EI4ul3y1hqMp0VS/4D8aOyR41ysz1KaYgkm6PyrRXEMyK8uKmVubJP83RkOU2fWkTVtdrMjM6aeT1qX849LetA==", - "peerDependencies": { - "@lexical/clipboard": "0.4.1", - "@lexical/selection": "0.4.1", - "@lexical/utils": "0.4.1", - "lexical": "0.4.1" - } - }, - "node_modules/@lexical/selection": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@lexical/selection/-/selection-0.4.1.tgz", - "integrity": "sha512-lrPaBtdWYp5FGpLA/mw8vVxQx8XM/GGVXFGam68B7mgMbY9xxKy3/MtvS94J+oRPtzNHEW3SyhkDEm9356r73g==", - "peer": true, - "peerDependencies": { - "lexical": "0.4.1" - } - }, - "node_modules/@lexical/table": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@lexical/table/-/table-0.4.1.tgz", - "integrity": "sha512-1BRLB+cYpqXSk0IHk3uHI1Fa6H4rnQ5pySDm+7HSyShjAzQSMBt0BWoX9B0TW/vXysl3p5+vcnU8mGjGyCA0Lg==", - "dependencies": { - "@lexical/utils": "0.4.1" - }, - "peerDependencies": { - "lexical": "0.4.1" - } - }, - "node_modules/@lexical/utils": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@lexical/utils/-/utils-0.4.1.tgz", - "integrity": "sha512-OUYS7qpu1oHv9vhUGhL60ow5gbyqLG449XGFZrzaKUGnz1iWU/rXP8nEljoqdtai3rg4t0Ahxcbe9cVIubK3hQ==", - "dependencies": { - "@lexical/list": "0.4.1", - "@lexical/table": "0.4.1" - }, - "peerDependencies": { - "lexical": "0.4.1" + "@lezer/common": "^1.0.0" } }, "node_modules/@tsconfig/node18-strictest-esm": { @@ -210,9 +220,9 @@ "integrity": "sha512-cHzmAqw7CMbyqROWeBgVhard3F2V6zxOSJnQ4E6SJWruXD5ypuP9/QKekwBdfXQ4oUTaizIICKIwb+v3v33t0w==" }, "node_modules/@types/node": { - "version": "18.7.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.15.tgz", - "integrity": "sha512-XnjpaI8Bgc3eBag2Aw4t2Uj/49lLBSStHWfqKvIuXD7FIrZyMLWp8KuAFHAqxMZYTF9l08N1ctUn9YNybZJVmQ==", + "version": "18.7.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.18.tgz", + "integrity": "sha512-m+6nTEOadJZuTPkKR/SYK3A2d7FZrgElol9UP1Kae90VVU4a6mxnPuLiIW1m4Cq4gZ/nWb9GrdVXJCoCazDAbg==", "dev": true }, "node_modules/abort-controller": { @@ -285,6 +295,20 @@ "fastq": "^1.6.1" } }, + "node_modules/codemirror": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.1.tgz", + "integrity": "sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/commands": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/search": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + } + }, "node_modules/cookie": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", @@ -293,10 +317,15 @@ "node": ">= 0.6" } }, + "node_modules/crelt": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.5.tgz", + "integrity": "sha512-+BO9wPPi+DWTDcNYhr/W90myha8ptzftZT+LwcmUbbok0rcP/fequmFYCw8NMoH7pkAZQzU78b3kYrlua5a9eA==" + }, "node_modules/csstype": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.0.tgz", - "integrity": "sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz", + "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==" }, "node_modules/debug": { "version": "4.3.4", @@ -679,9 +708,9 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "node_modules/fast-json-stringify": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-5.2.0.tgz", - "integrity": "sha512-u5jtrcAK9RINW15iuDKnsuuhqmqre4AmDMp3crRTjUMdAuHMpQUt3IfoMm5wlJm59b74PcajqOl3SjgnC5FPmw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-5.3.0.tgz", + "integrity": "sha512-jTlJV/VAaYMtYl5G41uEL8UQT7/fT5W6LuxKxIS/Lpm6bXxmR+reF3m3WgP/WwxXybH61O+xhWK7n9uAsY6zGA==", "dependencies": { "@fastify/deepmerge": "^1.0.0", "ajv": "^8.10.0", @@ -705,9 +734,9 @@ "integrity": "sha512-qKRta6N7BWEFVlyonVY/V+BMLgFqktCUV0QjT259ekAIlbVrMaFnFLxJ4s/JPl4tou56S1BzPufI60bLe29fHA==" }, "node_modules/fastify": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/fastify/-/fastify-4.5.3.tgz", - "integrity": "sha512-Q8Zvkmg7GnioMCDX1jT2Q7iRqjywlnDZ1735D2Ipf7ashCM/3/bqPKv2Jo1ZF2iDExct2eP1C/tdhcj0GG/OuQ==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/fastify/-/fastify-4.6.0.tgz", + "integrity": "sha512-EgWUvcJNvsql1R4g5/ce866BYk8SgJKjGh6AI0e9BR+NidP7hqX1ObiwHEVbkR15A9XwMtkKd3TE/tFZCjsqnA==", "dependencies": { "@fastify/ajv-compiler": "^3.1.1", "@fastify/error": "^3.0.0", @@ -739,9 +768,9 @@ } }, "node_modules/find-my-way": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-7.0.1.tgz", - "integrity": "sha512-w05SaOPg54KqBof/RDA+75n1R48V7ZZNPL3nR17jJJs5dgZpR3ivfrMWOyx7BVFQgCLhYRG05hfgFCohYvSUXA==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-7.1.0.tgz", + "integrity": "sha512-yQYjxgcZmo6SQ1bRPr9ToMcCyzBOZ3L1cbDYTNCHRq7XfQPLSDhbywUAsQCLWlL3uuOUAKvTxeJ2V2i+Z9YqGA==", "dependencies": { "fast-deep-equal": "^3.1.3", "safe-regex2": "^2.0.0" @@ -767,9 +796,9 @@ } }, "node_modules/jose": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.9.2.tgz", - "integrity": "sha512-EqKvu2PqJCD3Jrg3PvcYZVS7D21qMVLSYMDAFcOdGUEOpJSLNtJO7NjLANvu3SYHVl6pdP2ff7ve6EZW2nX7Nw==", + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.9.3.tgz", + "integrity": "sha512-f8E/z+T3Q0kA9txzH2DKvH/ds2uggcw0m3vVPSB9HrSkrQ7mojjifvS7aR8cw+lQl2Fcmx9npwaHpM/M3GD8UQ==", "funding": { "url": "https://github.com/sponsors/panva" } @@ -779,15 +808,10 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, - "node_modules/lexical": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/lexical/-/lexical-0.4.1.tgz", - "integrity": "sha512-EXcLh/6LbEuwqXlnPkk8MXZXO16yBzznFqklKva91DF+KU8utX2PLoeRSOtWC8P2YbRdiGQewwKjUVeXqxxOaQ==" - }, "node_modules/light-my-request": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.5.1.tgz", - "integrity": "sha512-Zd4oZjF7axSyc5rYQsbB0qsgY4LFFviZSbEywxf7Vi5UE3y3c7tYF/GeheQjBNYY+pQ55BF8UGGJTjneoxOS1w==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.6.1.tgz", + "integrity": "sha512-sbJnC1UBRivi9L1kICr3CESb82pNiPNB3TvtdIrZZqW0Qh8uDXvoywMmWKZlihDcmw952CMICCzM+54LDf+E+g==", "dependencies": { "cookie": "^0.5.0", "process-warning": "^2.0.0", @@ -1020,9 +1044,9 @@ "integrity": "sha512-1jeBGaKNGdEq4FgIrORu/N570dwoPYio8lSoYLWmX7sQ//0JY08Xh9o5pBcgmHQ/MbsYp/aZnOe1s1lIsbLprQ==" }, "node_modules/solid-js": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/solid-js/-/solid-js-1.5.4.tgz", - "integrity": "sha512-+65anSHhH27htkhP5LuC912fviMIckgc7/yN+WWrKhS9Kp3dvtDNl5/m4GWX1lpCvcubjShqJjGt16HET5z5Ig==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/solid-js/-/solid-js-1.5.5.tgz", + "integrity": "sha512-5gXszD7ekhe59IyMa3+AvREJnBWVjwaeC7afL8C3UNPj5gQQCrsMs/cXwI3JRpj6D+3TESTyuQ2sY++m4cYiTg==", "dependencies": { "csstype": "^3.1.0" } @@ -1043,10 +1067,15 @@ "node": ">= 10.x" } }, + "node_modules/style-mod": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.0.0.tgz", + "integrity": "sha512-OPhtyEjyyN9x3nhPsu76f52yUGXiZcgvsrFVtvTkyGRQJ0XK+GPc6ov1z+lRpbeabka+MYEQxOYRnt5nF30aMw==" + }, "node_modules/thread-stream": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.1.0.tgz", - "integrity": "sha512-5+Pf2Ya31CsZyIPYYkhINzdTZ3guL+jHq7D8lkBybgGcSQIKDbid3NJku3SpCKeE/gACWAccDA/rH2B6doC5aA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.2.0.tgz", + "integrity": "sha512-rUkv4/fnb4rqy/gGy7VuqK6wE1+1DOCOWy4RMeaV69ZHMP11tQKZvZSip1yTgrKCMZzEMcCL/bKfHvSfDHx+iQ==", "dependencies": { "real-require": "^0.2.0" } @@ -1060,9 +1089,9 @@ } }, "node_modules/typescript": { - "version": "4.8.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz", - "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==", + "version": "4.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.3.tgz", + "integrity": "sha512-goMHfm00nWPa8UvR/CPSvykqf6dVV8x/dp0c5mFTMTIu0u0FlGWRioyy7Nn0PGAdHxpJZnuO/ut+PpQ8UiHAig==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -1088,6 +1117,11 @@ "punycode": "^2.1.0" } }, + "node_modules/w3c-keyname": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.6.tgz", + "integrity": "sha512-f+fciywl1SJEniZHD6H+kUO8gOnwIr7f4ijKA6+ZvJFjeGi1r4PDLl53Ayud9O/rk64RqgoQine0feoeOU0kXg==" + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -1120,6 +1154,76 @@ } }, "dependencies": { + "@codemirror/autocomplete": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.2.0.tgz", + "integrity": "sha512-yNCm2CEE4kE4L2Sf7WeyCej1Q3951ccaCWfomrlBkoERKCss+TzuEeqGe5VnAJTEybLy1yzf1BdMUY/988bfpg==", + "requires": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.0.0" + } + }, + "@codemirror/commands": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.1.0.tgz", + "integrity": "sha512-qCj2YqmbBjj0P1iumnlL5lBqZvJPzT+t2UvgjcaXErp5ZvMqFRVgQyrEfdXX6SX5UcvcHKBjXqno+MkUp0aYvQ==", + "requires": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.0.0" + } + }, + "@codemirror/language": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.2.1.tgz", + "integrity": "sha512-MC3svxuvIj0MRpFlGHxLS6vPyIdbTr2KKPEW46kCoCXw2ktb4NTkpkPBI/lSP/FoNXLCBJ0mrnUi1OoZxtpW1Q==", + "requires": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.0.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0", + "style-mod": "^4.0.0" + } + }, + "@codemirror/lint": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.0.0.tgz", + "integrity": "sha512-nUUXcJW1Xp54kNs+a1ToPLK8MadO0rMTnJB8Zk4Z8gBdrN0kqV7uvUraU/T2yqg+grDNR38Vmy/MrhQN/RgwiA==", + "requires": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "@codemirror/search": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.2.0.tgz", + "integrity": "sha512-FVhpUvPFUJe8lg2EQJTTcF4RNI9d/OC3PVitvOfhv5OuY7ZgtMfJl22o5eMkzOEsUY2Wxe7BKGLpe2UI5Wq3PQ==", + "requires": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "@codemirror/state": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.1.1.tgz", + "integrity": "sha512-2s+aXsxmAwnR3Rd+JDHPG/1lw0YsA9PEwl7Re88gHJHGfxyfEzKBmsN4rr53RyPIR4lzbbhJX0DCq0WlqlBIRw==" + }, + "@codemirror/view": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.2.3.tgz", + "integrity": "sha512-cgN9gWS9+kv9+eOgVJWMrGUk4EwYKBZpuFYvxIlu4CmMye3+U+gMzuZhBgtPDOCbCp30hxFIOO0MENhGfnaC/g==", + "requires": { + "@codemirror/state": "^6.0.0", + "style-mod": "^4.0.0", + "w3c-keyname": "^2.2.4" + } + }, "@esbuild/linux-loong64": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.7.tgz", @@ -1182,79 +1286,35 @@ "undici": "^5.5.1" } }, - "@lexical/clipboard": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@lexical/clipboard/-/clipboard-0.4.1.tgz", - "integrity": "sha512-/BHeh+LaYhNbBbzNcVPcYgSZtNp6HT5z/iHFKJMfhikE+4KKFf3DbLDO5b92AUDyT3s8QQC04Na5ZeRUbK/Jzw==", - "peer": true, + "@lezer/common": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.0.1.tgz", + "integrity": "sha512-8TR5++Q/F//tpDsLd5zkrvEX5xxeemafEaek7mUp7Y+bI8cKQXdSqhzTOBaOogETcMOVr0pT3BBPXp13477ciw==" + }, + "@lezer/generator": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@lezer/generator/-/generator-1.1.1.tgz", + "integrity": "sha512-GrB5EwOn09yf5YfDk6TcspHcF7PQZP83665moY5VmOURwCmNOx+Qit3mwp7W/EsGpqd4PPRioxNkYwYZii69cw==", + "dev": true, "requires": { - "@lexical/html": "0.4.1", - "@lexical/list": "0.4.1", - "@lexical/selection": "0.4.1", - "@lexical/utils": "0.4.1" + "@lezer/common": "^1.0.0", + "@lezer/lr": "^1.0.0" } }, - "@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==", + "@lezer/highlight": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.0.0.tgz", + "integrity": "sha512-nsCnNtim90UKsB5YxoX65v3GEIw3iCHw9RM2DtdgkiqAbKh9pCdvi8AWNwkYf10Lu6fxNhXPpkpHbW6mihhvJA==", "requires": { - "@lexical/utils": "0.4.1" + "@lezer/common": "^1.0.0" } }, - "@lexical/html": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@lexical/html/-/html-0.4.1.tgz", - "integrity": "sha512-nErgYUtghdrVTPZLB7Ad7U1m3SBxEZvPeW4FH4COFLCeTIVMEG4dg0PhURCk28xNAkEHszd4kQ3XFDRB5muOiQ==", - "peer": true, + "@lezer/lr": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.2.3.tgz", + "integrity": "sha512-qpB7rBzH8f6Mzjv2AVZRahcm+2Cf7nbIH++uXbvVOL1yIRvVWQ3HAM/saeBLCyz/togB7LGo76qdJYL1uKQlqA==", "requires": { - "@lexical/selection": "0.4.1" - } - }, - "@lexical/link": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@lexical/link/-/link-0.4.1.tgz", - "integrity": "sha512-566lQymmuBe3Y7UDyaaTs+VDlElbu1WhnjT9lVDk0BXag7MA8tv/f60XptWnTK1pv/Dobm/CyLmyLae55OuflQ==", - "requires": { - "@lexical/utils": "0.4.1" - } - }, - "@lexical/list": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@lexical/list/-/list-0.4.1.tgz", - "integrity": "sha512-dP6i18qm1UhUoG6FvqLMn7hoj4htE0jYcmMPYqFyH+f1ir9Ybvr87pV3aFhqH6hdHjQ5tMyM0kURSL1t89GesQ==", - "requires": { - "@lexical/utils": "0.4.1" - } - }, - "@lexical/rich-text": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@lexical/rich-text/-/rich-text-0.4.1.tgz", - "integrity": "sha512-EI4ul3y1hqMp0VS/4D8aOyR41ysz1KaYgkm6PyrRXEMyK8uKmVubJP83RkOU2fWkTVtdrMjM6aeT1qX849LetA==", - "requires": {} - }, - "@lexical/selection": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@lexical/selection/-/selection-0.4.1.tgz", - "integrity": "sha512-lrPaBtdWYp5FGpLA/mw8vVxQx8XM/GGVXFGam68B7mgMbY9xxKy3/MtvS94J+oRPtzNHEW3SyhkDEm9356r73g==", - "peer": true, - "requires": {} - }, - "@lexical/table": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@lexical/table/-/table-0.4.1.tgz", - "integrity": "sha512-1BRLB+cYpqXSk0IHk3uHI1Fa6H4rnQ5pySDm+7HSyShjAzQSMBt0BWoX9B0TW/vXysl3p5+vcnU8mGjGyCA0Lg==", - "requires": { - "@lexical/utils": "0.4.1" - } - }, - "@lexical/utils": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@lexical/utils/-/utils-0.4.1.tgz", - "integrity": "sha512-OUYS7qpu1oHv9vhUGhL60ow5gbyqLG449XGFZrzaKUGnz1iWU/rXP8nEljoqdtai3rg4t0Ahxcbe9cVIubK3hQ==", - "requires": { - "@lexical/list": "0.4.1", - "@lexical/table": "0.4.1" + "@lezer/common": "^1.0.0" } }, "@tsconfig/node18-strictest-esm": { @@ -1263,9 +1323,9 @@ "integrity": "sha512-cHzmAqw7CMbyqROWeBgVhard3F2V6zxOSJnQ4E6SJWruXD5ypuP9/QKekwBdfXQ4oUTaizIICKIwb+v3v33t0w==" }, "@types/node": { - "version": "18.7.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.15.tgz", - "integrity": "sha512-XnjpaI8Bgc3eBag2Aw4t2Uj/49lLBSStHWfqKvIuXD7FIrZyMLWp8KuAFHAqxMZYTF9l08N1ctUn9YNybZJVmQ==", + "version": "18.7.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.18.tgz", + "integrity": "sha512-m+6nTEOadJZuTPkKR/SYK3A2d7FZrgElol9UP1Kae90VVU4a6mxnPuLiIW1m4Cq4gZ/nWb9GrdVXJCoCazDAbg==", "dev": true }, "abort-controller": { @@ -1320,15 +1380,34 @@ "fastq": "^1.6.1" } }, + "codemirror": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.1.tgz", + "integrity": "sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==", + "requires": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/commands": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/search": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + } + }, "cookie": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==" }, + "crelt": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.5.tgz", + "integrity": "sha512-+BO9wPPi+DWTDcNYhr/W90myha8ptzftZT+LwcmUbbok0rcP/fequmFYCw8NMoH7pkAZQzU78b3kYrlua5a9eA==" + }, "csstype": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.0.tgz", - "integrity": "sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz", + "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==" }, "debug": { "version": "4.3.4", @@ -1511,9 +1590,9 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "fast-json-stringify": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-5.2.0.tgz", - "integrity": "sha512-u5jtrcAK9RINW15iuDKnsuuhqmqre4AmDMp3crRTjUMdAuHMpQUt3IfoMm5wlJm59b74PcajqOl3SjgnC5FPmw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-5.3.0.tgz", + "integrity": "sha512-jTlJV/VAaYMtYl5G41uEL8UQT7/fT5W6LuxKxIS/Lpm6bXxmR+reF3m3WgP/WwxXybH61O+xhWK7n9uAsY6zGA==", "requires": { "@fastify/deepmerge": "^1.0.0", "ajv": "^8.10.0", @@ -1534,9 +1613,9 @@ "integrity": "sha512-qKRta6N7BWEFVlyonVY/V+BMLgFqktCUV0QjT259ekAIlbVrMaFnFLxJ4s/JPl4tou56S1BzPufI60bLe29fHA==" }, "fastify": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/fastify/-/fastify-4.5.3.tgz", - "integrity": "sha512-Q8Zvkmg7GnioMCDX1jT2Q7iRqjywlnDZ1735D2Ipf7ashCM/3/bqPKv2Jo1ZF2iDExct2eP1C/tdhcj0GG/OuQ==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/fastify/-/fastify-4.6.0.tgz", + "integrity": "sha512-EgWUvcJNvsql1R4g5/ce866BYk8SgJKjGh6AI0e9BR+NidP7hqX1ObiwHEVbkR15A9XwMtkKd3TE/tFZCjsqnA==", "requires": { "@fastify/ajv-compiler": "^3.1.1", "@fastify/error": "^3.0.0", @@ -1568,9 +1647,9 @@ } }, "find-my-way": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-7.0.1.tgz", - "integrity": "sha512-w05SaOPg54KqBof/RDA+75n1R48V7ZZNPL3nR17jJJs5dgZpR3ivfrMWOyx7BVFQgCLhYRG05hfgFCohYvSUXA==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-7.1.0.tgz", + "integrity": "sha512-yQYjxgcZmo6SQ1bRPr9ToMcCyzBOZ3L1cbDYTNCHRq7XfQPLSDhbywUAsQCLWlL3uuOUAKvTxeJ2V2i+Z9YqGA==", "requires": { "fast-deep-equal": "^3.1.3", "safe-regex2": "^2.0.0" @@ -1587,24 +1666,19 @@ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, "jose": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.9.2.tgz", - "integrity": "sha512-EqKvu2PqJCD3Jrg3PvcYZVS7D21qMVLSYMDAFcOdGUEOpJSLNtJO7NjLANvu3SYHVl6pdP2ff7ve6EZW2nX7Nw==" + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.9.3.tgz", + "integrity": "sha512-f8E/z+T3Q0kA9txzH2DKvH/ds2uggcw0m3vVPSB9HrSkrQ7mojjifvS7aR8cw+lQl2Fcmx9npwaHpM/M3GD8UQ==" }, "json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, - "lexical": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/lexical/-/lexical-0.4.1.tgz", - "integrity": "sha512-EXcLh/6LbEuwqXlnPkk8MXZXO16yBzznFqklKva91DF+KU8utX2PLoeRSOtWC8P2YbRdiGQewwKjUVeXqxxOaQ==" - }, "light-my-request": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.5.1.tgz", - "integrity": "sha512-Zd4oZjF7axSyc5rYQsbB0qsgY4LFFviZSbEywxf7Vi5UE3y3c7tYF/GeheQjBNYY+pQ55BF8UGGJTjneoxOS1w==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.6.1.tgz", + "integrity": "sha512-sbJnC1UBRivi9L1kICr3CESb82pNiPNB3TvtdIrZZqW0Qh8uDXvoywMmWKZlihDcmw952CMICCzM+54LDf+E+g==", "requires": { "cookie": "^0.5.0", "process-warning": "^2.0.0", @@ -1788,9 +1862,9 @@ "integrity": "sha512-1jeBGaKNGdEq4FgIrORu/N570dwoPYio8lSoYLWmX7sQ//0JY08Xh9o5pBcgmHQ/MbsYp/aZnOe1s1lIsbLprQ==" }, "solid-js": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/solid-js/-/solid-js-1.5.4.tgz", - "integrity": "sha512-+65anSHhH27htkhP5LuC912fviMIckgc7/yN+WWrKhS9Kp3dvtDNl5/m4GWX1lpCvcubjShqJjGt16HET5z5Ig==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/solid-js/-/solid-js-1.5.5.tgz", + "integrity": "sha512-5gXszD7ekhe59IyMa3+AvREJnBWVjwaeC7afL8C3UNPj5gQQCrsMs/cXwI3JRpj6D+3TESTyuQ2sY++m4cYiTg==", "requires": { "csstype": "^3.1.0" } @@ -1808,10 +1882,15 @@ "resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz", "integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==" }, + "style-mod": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.0.0.tgz", + "integrity": "sha512-OPhtyEjyyN9x3nhPsu76f52yUGXiZcgvsrFVtvTkyGRQJ0XK+GPc6ov1z+lRpbeabka+MYEQxOYRnt5nF30aMw==" + }, "thread-stream": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.1.0.tgz", - "integrity": "sha512-5+Pf2Ya31CsZyIPYYkhINzdTZ3guL+jHq7D8lkBybgGcSQIKDbid3NJku3SpCKeE/gACWAccDA/rH2B6doC5aA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.2.0.tgz", + "integrity": "sha512-rUkv4/fnb4rqy/gGy7VuqK6wE1+1DOCOWy4RMeaV69ZHMP11tQKZvZSip1yTgrKCMZzEMcCL/bKfHvSfDHx+iQ==", "requires": { "real-require": "^0.2.0" } @@ -1822,9 +1901,9 @@ "integrity": "sha512-ApGvZ6vVvTNdsmt676grvCkUCGwzG9IqXma5Z07xJgiC5L7akUMof5U8G2JTI9Rz/ovtVhJBlY6mNhEvtjzOIg==" }, "typescript": { - "version": "4.8.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz", - "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==", + "version": "4.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.3.tgz", + "integrity": "sha512-goMHfm00nWPa8UvR/CPSvykqf6dVV8x/dp0c5mFTMTIu0u0FlGWRioyy7Nn0PGAdHxpJZnuO/ut+PpQ8UiHAig==", "dev": true }, "undici": { @@ -1840,6 +1919,11 @@ "punycode": "^2.1.0" } }, + "w3c-keyname": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.6.tgz", + "integrity": "sha512-f+fciywl1SJEniZHD6H+kUO8gOnwIr7f4ijKA6+ZvJFjeGi1r4PDLl53Ayud9O/rk64RqgoQine0feoeOU0kXg==" + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/app/package.json b/app/package.json index 6ff0bb3..70675e6 100644 --- a/app/package.json +++ b/app/package.json @@ -3,6 +3,7 @@ "version": "0.0.0", "private": true, "scripts": { + "prepare": "lezer-generator --noTerms --output syntax/quot.grammar.js syntax/quot.grammar", "test": "tsc --noEmit", "start": "TS_NODE_DEV=true node -r esbuild-register main.ts" }, @@ -11,21 +12,24 @@ }, "packageManager": "npm@8.19.0", "dependencies": { + "@codemirror/commands": "^6.1.0", + "@codemirror/language": "^6.2.1", + "@codemirror/view": "^6.2.3", "@exampledev/new.css": "^1.1.3", "@fastify/http-proxy": "^8.2.2", - "@lexical/history": "^0.4.1", - "@lexical/link": "^0.4.1", - "@lexical/rich-text": "^0.4.1", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.2.3", "@tsconfig/node18-strictest-esm": "^1.0.1", + "codemirror": "^6.0.1", "esbuild": "^0.15.7", "esbuild-register": "^3.3.3", "fastify": "^4.5.3", "jose": "^4.9.2", - "lexical": "^0.4.1", "openid-client": "^5.1.9", "solid-js": "^1.5.4" }, "devDependencies": { + "@lezer/generator": "^1.1.1", "@types/node": "^18.7.15", "typescript": "^4.8.2" } diff --git a/app/syntax/quot.grammar b/app/syntax/quot.grammar new file mode 100644 index 0000000..ceceb09 --- /dev/null +++ b/app/syntax/quot.grammar @@ -0,0 +1,15 @@ +@top Document { heading line* } + +heading { Heading "\n" } +line { Indent* (AutoLink | Word) (AutoLink | Word | Spaces)* "\n" } + +@tokens { + space { $[ \t] } + letter { ![ \t\n]+ } + Heading { letter+ } + Indent { space } + Spaces { space+ } + AutoLink { ("http" | "https") "://" letter+ } + Word { letter+ } + @precedence { AutoLink, Word } +} diff --git a/app/syntax/quot.grammar.js b/app/syntax/quot.grammar.js new file mode 100644 index 0000000..2cde6a6 --- /dev/null +++ b/app/syntax/quot.grammar.js @@ -0,0 +1,16 @@ +// This file was generated by lezer-generator. You probably shouldn't edit it. +import {LRParser} from "@lezer/lr" +export const parser = LRParser.deserialize({ + version: 14, + states: "#`OQOPOOOVOPOOQ[OQOOOOOO'#Cd'#CdOgOQO'#ChOrOSO'#ChOOOO'#Cc'#CcQ[OQOOOOOO-E6b-E6bO!QOSO,59SOOOO'#Ce'#CeO!QOSO,59SOOOO,59S,59SOOOO-E6a-E6aO!`OSO1G.nOOOO1G.n1G.nOOOO-E6c-E6cOOOO7+$Y7+$Y", + stateData: "!q~OQPO~OZQO~ORROSTOTTO~ORROSXOTXO~OSYOTYOUYOZ[O~OSYOTYOUYOZ_O~OSYOTYOUYOZaO~OST~", + goto: "y]PPPPPPP^dkPPuQVQR]VSSQVRWSQZTQ^XT`Z^TUQV", + nodeNames: "⚠ Document Heading Indent AutoLink Word Spaces", + maxTerm: 12, + skippedNodes: [0], + repeatNodeCount: 3, + tokenData: "&t~RWOXkXY{YZ!eZpkpq{q#[k#[#]!j#]~kVrRQPTUOXkZpkq~kU!SQRQUSXY!Ypq!YS!_QUSXY!Ypq!Y~!jOZ~V!qTQPTUOXkZpkq#hk#h#i#Q#i~kV#XTQPTUOXkZpkq#hk#h#i#h#i~kV#oTQPTUOXkZpkq#dk#d#e$O#e~kV$VVQPTUOXkZpkq![k![!]$l!]#gk#g#h&^#h~kV$sTQPTUOXkZpkq!Pk!P!Q%S!Q~kV%ZTQPTUOXkZpkq!Pk!P!Q%j!Q~kV%qRQPTUOX%zZp%zq~%zV&TRQPSUTUOX%zZp%zq~%zV&eTQPTUOXkZpkq![k![!]$l!]~k", + tokenizers: [0, 1, 2], + topRules: {"Document":[0,1]}, + tokenPrec: 76 +}) diff --git a/app/syntax/quot.ts b/app/syntax/quot.ts new file mode 100644 index 0000000..3a2e639 --- /dev/null +++ b/app/syntax/quot.ts @@ -0,0 +1,42 @@ +import { styleTags, tags as t } from "@lezer/highlight"; +import { + HighlightStyle, + LRLanguage, + syntaxHighlighting, +} from "@codemirror/language"; +import { parser } from "./quot.grammar.js"; + +export const quotLanguage = LRLanguage.define({ + parser: parser.configure({ + props: [ + styleTags({ + Heading: t.heading, + Indent: t.separator, + AutoLink: t.link, + Spaces: t.content, + }), + ], + }), +}); + +export const quotHighlighting = syntaxHighlighting( + HighlightStyle.define([ + { + tag: t.heading, + fontWeight: "bold", + fontSize: "1.25em", + marginBlockEnd: "0.5em", + }, + { + tag: t.separator, + letterSpacing: "1.5em", + }, + { + tag: t.link, + class: "auto-link", + }, + { + tag: t.content, + }, + ]) +); diff --git a/app/views/components/editor.css b/app/views/components/editor.css index 490086e..5d4297c 100644 --- a/app/views/components/editor.css +++ b/app/views/components/editor.css @@ -1,6 +1,5 @@ .editor { padding: 0.75rem; - font-size: 1rem; box-sizing: border-box; background-color: var(--nc-bg-2); color: var(--nc-tx-2); @@ -10,15 +9,29 @@ box-shadow: 0 1px var(--nc-bg-3); } -.editor :is(h1, h2, h3, h4, h5, h6) { - padding: unset; - font-size: 1.25rem; +.editor .cm-editor.cm-focused { + outline: unset; } -.editor p { - margin: unset; +.editor .cm-content { + font-family: "sans-serif"; + font-size: 1rem; } -.editor a:hover { +.editor .cm-line { + display: flex; +} + +.editor .auto-link:hover { + cursor: pointer; +} + +.editor .auto-link { + color: var(--nc-lk-1); + text-decoration: underline; +} + +.editor .auto-link:hover { + color: var(--nc-lk-2); cursor: pointer; } diff --git a/app/views/components/editor.tsx b/app/views/components/editor.tsx index 2c93ee4..ab333cf 100644 --- a/app/views/components/editor.tsx +++ b/app/views/components/editor.tsx @@ -1,27 +1,11 @@ -import { - $createParagraphNode, - $createTextNode, - $getRoot, - $isElementNode, - createEditor, -} from "lexical"; -import { registerHistory, createEmptyHistoryState } from "@lexical/history"; -import { - $createHeadingNode, - HeadingNode, - registerRichText, -} from "@lexical/rich-text"; -import { $createAutoLinkNode, AutoLinkNode } from "@lexical/link"; import { onCleanup, onMount } from "solid-js"; +import { minimalSetup } from "codemirror"; +import { emacsStyleKeymap, indentWithTab } from "@codemirror/commands"; +import { indentUnit } from "@codemirror/language"; +import { EditorView, keymap } from "@codemirror/view"; import type Pages from "../../protocol/pages"; import "./editor.css"; - -const urlMatcher = /https?:\/\/[^\s]+/; -const editor = createEditor({ nodes: [HeadingNode, AutoLinkNode] }); - -function ref(el: HTMLElement) { - editor.setRootElement(el); -} +import { quotHighlighting, quotLanguage } from "../../syntax/quot"; export default (props: { id: number; @@ -29,70 +13,50 @@ export default (props: { text: string; onUpdatePage: (content: Pages.RequestContentPage) => void; }) => { - const initialEditorState = () => { - const root = $getRoot(); - const [title, ...lines] = props.text.split("\n"); - const titleNode = $createHeadingNode("h2"); - titleNode.append($createTextNode(title)); - root.append(titleNode); - for (const line of lines) { - const lineNode = $createParagraphNode(); - const indent = line.match(/^\s*/)?.[0]?.length ?? 0; - lineNode.setIndent(indent); - let text = line.slice(indent); - let match: RegExpMatchArray | null = null; - while ((match = text.match(urlMatcher))) { - const offset = text.slice(0, match.index!); - const input = match[0]!; - const link = $createAutoLinkNode(input); - link.append($createTextNode(match[0])); - lineNode.append($createTextNode(offset), link); - text = text.slice(offset.length + input.length); - } - lineNode.append($createTextNode(text)); - root.append(lineNode); - } - }; - onCleanup(registerRichText(editor, initialEditorState)); - onCleanup(registerHistory(editor, createEmptyHistoryState(), 333)); - onCleanup( - editor.registerUpdateListener(() => - editor.update(() => { - const root = $getRoot(); - const defaultTitle = new Date() - .toLocaleDateString(navigator.language, { - year: "numeric", - month: "2-digit", - day: "2-digit", - }) - .replaceAll("/", "-"); - const [titleNode, ...lineNodes] = root.getChildren(); - const title = - titleNode?.getTextContent().trim() || - (lineNodes.length === 0 ? "" : defaultTitle); - const lines = lineNodes.map((line) => { - const indent = $isElementNode(line) ? line.getIndent() : 0; - return `${" ".repeat(indent)}${line.getTextContent()}`; - }); - const text = [title, ...lines].join("\n"); - if (props.text !== text) { + let ref: HTMLElement; + onMount(() => { + const view = new EditorView({ + doc: props.text, + selection: { anchor: props.text.length }, + parent: ref, + extensions: [ + EditorView.updateListener.of((update) => { + if (!update.docChanged) return; + const defaultTitle = new Date() + .toLocaleDateString(navigator.language, { + year: "numeric", + month: "2-digit", + day: "2-digit", + }) + .replaceAll("/", "-"); + const [heading, ...lines] = update.state.doc.toJSON(); + const title = + heading?.trim() || (lines.length === 0 ? "" : defaultTitle); + const text = [title, ...lines].join("\n"); props.onUpdatePage({ id: props.id, title, text }); - } - }) - ) - ); - onMount(() => editor.focus()); + }), + EditorView.lineWrapping, + indentUnit.of(" "), + keymap.of([indentWithTab, ...emacsStyleKeymap]), + minimalSetup, + quotLanguage, + quotHighlighting, + ], + }); + ref.addEventListener("click", (e) => { + if (!(e.target instanceof HTMLElement)) return; + if (e.target.classList.contains("auto-link") && e.target.textContent) { + window.open(e.target.textContent, "_blank", "noreferrer"); + } + }); + onCleanup(() => view.destroy()); + view.focus(); + }); return (
{ - const el = e.target.parentElement; - if (el instanceof HTMLAnchorElement) { - window.open(el.href, "_blank", "noreferrer"); - } - }} + ref={(el) => (ref = el)} + id={props.id.toString(16)} class="editor" - contenteditable /> ); };