Merge pull request #27 from pastebinrun/codemirror6
Bump codemirror to 6
This commit is contained in:
commit
729c7bba58
|
@ -14,7 +14,7 @@
|
|||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
import { EditorView, EditorState, basicSetup } from "@codemirror/basic-setup";
|
||||
import { EditorView, basicSetup } from "codemirror";
|
||||
import { indentWithTab } from "@codemirror/commands";
|
||||
import { indentUnit } from "@codemirror/language";
|
||||
import { Compartment } from "@codemirror/state";
|
||||
|
@ -60,23 +60,21 @@ export default function CodeMirrorEditor({
|
|||
let avoidChangeNotifications = false;
|
||||
const labelId = createUniqueId();
|
||||
let view = new EditorView({
|
||||
state: EditorState.create({
|
||||
doc: code(),
|
||||
extensions: [
|
||||
EditorView.contentAttributes.of({ "aria-labelledby": labelId }),
|
||||
tabIndentation.of(getTabIndentationExtension()),
|
||||
keymap.of([{ key: "Ctrl-Enter", run: () => true }]),
|
||||
basicSetup,
|
||||
EditorView.updateListener.of((v) => {
|
||||
if (v.docChanged && !avoidChangeNotifications) {
|
||||
onInput();
|
||||
}
|
||||
}),
|
||||
EditorView.lineWrapping,
|
||||
indentUnit.of(" ".repeat(4)),
|
||||
language.of([]),
|
||||
],
|
||||
}),
|
||||
doc: code(),
|
||||
extensions: [
|
||||
EditorView.contentAttributes.of({ "aria-labelledby": labelId }),
|
||||
tabIndentation.of(getTabIndentationExtension()),
|
||||
keymap.of([{ key: "Ctrl-Enter", run: () => true }]),
|
||||
basicSetup,
|
||||
EditorView.updateListener.of((v) => {
|
||||
if (v.docChanged && !avoidChangeNotifications) {
|
||||
onInput();
|
||||
}
|
||||
}),
|
||||
EditorView.lineWrapping,
|
||||
indentUnit.of(" ".repeat(4)),
|
||||
language.of([]),
|
||||
],
|
||||
});
|
||||
createEffect(() => {
|
||||
view.dispatch({
|
||||
|
|
1022
package-lock.json
generated
1022
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
32
package.json
32
package.json
|
@ -3,24 +3,24 @@
|
|||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@codemirror/basic-setup": "^0.20.0",
|
||||
"@codemirror/commands": "^0.20.0",
|
||||
"@codemirror/lang-cpp": "^0.20.0",
|
||||
"@codemirror/lang-html": "^0.20.0",
|
||||
"@codemirror/lang-java": "^0.20.1",
|
||||
"@codemirror/lang-javascript": "^0.20.1",
|
||||
"@codemirror/lang-markdown": "^0.20.1",
|
||||
"@codemirror/lang-php": "^0.20.0",
|
||||
"@codemirror/lang-python": "^0.20.0",
|
||||
"@codemirror/lang-rust": "^0.20.0",
|
||||
"@codemirror/lang-sql": "^0.20.4",
|
||||
"@codemirror/language": "^0.20.2",
|
||||
"@codemirror/language-data": "^0.20.0",
|
||||
"@codemirror/legacy-modes": "^0.20.0",
|
||||
"@codemirror/view": "^0.20.7",
|
||||
"@replit/codemirror-lang-nix": "^0.20.0",
|
||||
"@codemirror/commands": "^6.0.0",
|
||||
"@codemirror/lang-cpp": "^6.0.1",
|
||||
"@codemirror/lang-html": "^6.1.0",
|
||||
"@codemirror/lang-java": "^6.0.0",
|
||||
"@codemirror/lang-javascript": "^6.0.0",
|
||||
"@codemirror/lang-markdown": "^6.0.0",
|
||||
"@codemirror/lang-php": "^6.0.0",
|
||||
"@codemirror/lang-python": "^6.0.0",
|
||||
"@codemirror/lang-rust": "^6.0.0",
|
||||
"@codemirror/lang-sql": "^6.0.0",
|
||||
"@codemirror/language": "^6.1.0",
|
||||
"@codemirror/language-data": "^6.1.0",
|
||||
"@codemirror/legacy-modes": "^6.1.0",
|
||||
"@codemirror/view": "^6.0.2",
|
||||
"@replit/codemirror-lang-nix": "^6.0.0",
|
||||
"@types/babel__core": "^7.1.19",
|
||||
"@types/node": "^17.0.41",
|
||||
"codemirror": "^6.0.0",
|
||||
"prettier": "^2.6.2",
|
||||
"solid-js": "^1.4.3",
|
||||
"typescript": "4.7.3",
|
||||
|
|
Loading…
Reference in New Issue
Block a user