From 849e6be1902ebc93d84e6fcbf2d526de5f8eee7b Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Fri, 11 Oct 2024 09:47:28 -0500 Subject: [PATCH] Add Mojolicious template support. This will be used for achievement notification editing. --- package-lock.json | 19 +++++++++++++++++-- package.json | 3 ++- public/index.html | 2 ++ src/pg-codemirror-editor.ts | 8 +++++++- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index ed45f46..d52cae9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@openwebwork/pg-codemirror-editor", - "version": "0.0.1-beta.7", + "version": "0.0.1-beta.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@openwebwork/pg-codemirror-editor", - "version": "0.0.1-beta.7", + "version": "0.0.1-beta.8", "license": "MIT", "dependencies": { "@codemirror/lang-html": "^6.4.9", @@ -24,6 +24,7 @@ "cm6-theme-solarized-dark": "^0.2.0", "cm6-theme-solarized-light": "^0.2.0", "codemirror": "^6.0.1", + "codemirror-lang-mt": "^0.0.1", "codemirror-lang-perl": "^0.1.5-beta.1", "thememirror": "^2.0.1" }, @@ -2067,6 +2068,20 @@ "@codemirror/view": "^6.0.0" } }, + "node_modules/codemirror-lang-mt": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/codemirror-lang-mt/-/codemirror-lang-mt-0.0.1.tgz", + "integrity": "sha512-s93iO1ZrbwHRHPZZiYcCaWt/eTHnrqeyWbWl+fVivAL+3eVahqBwdAlCQMrWU+QVfXfM6iFXF84S5BTyucPOIw==", + "license": "MIT", + "dependencies": { + "@codemirror/lang-css": "^6.3.0", + "@codemirror/lang-html": "^6.4.9", + "@codemirror/lang-javascript": "^6.2.2", + "@codemirror/language": "^6.10.2", + "@lezer/highlight": "^1.2.1", + "@lezer/lr": "^1.4.2" + } + }, "node_modules/codemirror-lang-perl": { "version": "0.1.5-beta.1", "resolved": "https://registry.npmjs.org/codemirror-lang-perl/-/codemirror-lang-perl-0.1.5-beta.1.tgz", diff --git a/package.json b/package.json index f7b70ce..082a4d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openwebwork/pg-codemirror-editor", - "version": "0.0.1-beta.7", + "version": "0.0.1-beta.8", "description": "PG CodeMirror Editor", "author": "The WeBWorK Project", "license": "MIT", @@ -39,6 +39,7 @@ "cm6-theme-solarized-dark": "^0.2.0", "cm6-theme-solarized-light": "^0.2.0", "codemirror": "^6.0.1", + "codemirror-lang-mt": "^0.0.1", "codemirror-lang-perl": "^0.1.5-beta.1", "thememirror": "^2.0.1" }, diff --git a/public/index.html b/public/index.html index 3d5cd32..1d32586 100644 --- a/public/index.html +++ b/public/index.html @@ -28,6 +28,8 @@

PG CodeMirror Editor Playground

+ + diff --git a/src/pg-codemirror-editor.ts b/src/pg-codemirror-editor.ts index 20abdce..f2f8257 100644 --- a/src/pg-codemirror-editor.ts +++ b/src/pg-codemirror-editor.ts @@ -142,7 +142,13 @@ export class View { ['pg', async () => (await import(/* webpackChunkName: 'pg' */ '@openwebwork/codemirror-lang-pg')).pg()], ['perl', async () => (await import(/* webpackChunkName: 'perl' */ 'codemirror-lang-perl')).perl()], ['html', async () => (await import(/* webpackChunkName: 'html' */ '@codemirror/lang-html')).html()], - ['xml', async () => (await import(/* webpackChunkName: 'xml' */ '@codemirror/lang-xml')).xml()] + ['xml', async () => (await import(/* webpackChunkName: 'xml' */ '@codemirror/lang-xml')).xml()], + ['xml', async () => (await import(/* webpackChunkName: 'xml' */ '@codemirror/lang-xml')).xml()], + ['mt-html', async () => (await import(/* webpackChunkName: 'mt' */ 'codemirror-lang-mt')).mt()], + [ + 'mt-text', + async () => (await import(/* webpackChunkName: 'mt' */ 'codemirror-lang-mt')).mt({ baseLanguage: null }) + ] ]); private currentKeyMap = 'Default';