DBA: replace CodeMirror 5 with CodeMirror 6 + Lezer XQuery - #2731
Closed
GuntherRademacher wants to merge 8 commits into
Closed
DBA: replace CodeMirror 5 with CodeMirror 6 + Lezer XQuery#2731GuntherRademacher wants to merge 8 commits into
GuntherRademacher wants to merge 8 commits into
Conversation
Member
|
(merged) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The changes here replace the DBA's CodeMirror 5 editor with CodeMirror 6, driven by the Lezer-based XQuery language pack:
prefers-color-schemeChanges in
basex-api(dba/):add
static/codemirror6/cm6.js- a self-contained IIFE (window.CM6) bundling CM6 + the XQuery language pack + @codemirror/lang-xml + themes + the parse-error gutter. Replaces the CM5 files.static/js.js-loadCodeMirrorrewritten to build CM6 behind a CM5-compatible handle (setValue/getValue/historySize/clearHistory/setCursor/setOption/focus+ a hidden-textarea mirror), soeditor.jsis untouched. Non-resized editors (Users/User) get the fixed 300px height CM5 used; Android/no-CM6 textarea fallback kept.lib/html.xqm- swap the three CM5<script>+ CSS<link>for the singlecm6.js; addimg-src 'self' data:to the CSP (lint markers are inlinedata:SVGs)static/style.css- CM5.CodeMirror*rules replaced by CM6.remove
static/codemirror/*(CM5 assets).cm6.js- the bundle is built outside this repo innuxt-codemirror-lezer/dba-bundleas one IIFE, which is committed here.Licensing: all bundled libraries are MIT; the minified
cm6.jscarries a/*! … */banner with their copyright + MIT notices (as the oldcodemirror.jsdid).