|
1 | 1 | import fsOperation from "fileSystem"; |
2 | 2 | import sidebarApps from "sidebarApps"; |
| 3 | +import * as cmAutocomplete from "@codemirror/autocomplete"; |
| 4 | +import * as cmCommands from "@codemirror/commands"; |
| 5 | +import * as cmLanguage from "@codemirror/language"; |
3 | 6 | import { HighlightStyle, syntaxHighlighting } from "@codemirror/language"; |
| 7 | +import * as cmLint from "@codemirror/lint"; |
| 8 | +import * as cmSearch from "@codemirror/search"; |
| 9 | +import * as cmState from "@codemirror/state"; |
4 | 10 | import { Compartment, EditorState, Prec, StateEffect } from "@codemirror/state"; |
| 11 | +import * as cmView from "@codemirror/view"; |
5 | 12 | import { EditorView } from "@codemirror/view"; |
6 | 13 | import ajax from "@deadlyjack/ajax"; |
7 | 14 | import { tags } from "@lezer/highlight"; |
@@ -314,6 +321,16 @@ export default class Acode { |
314 | 321 | }, |
315 | 322 | }; |
316 | 323 |
|
| 324 | + const codemirrorModule = Object.freeze({ |
| 325 | + autocomplete: cmAutocomplete, |
| 326 | + commands: cmCommands, |
| 327 | + language: cmLanguage, |
| 328 | + lint: cmLint, |
| 329 | + search: cmSearch, |
| 330 | + state: cmState, |
| 331 | + view: cmView, |
| 332 | + }); |
| 333 | + |
317 | 334 | this.define("Url", Url); |
318 | 335 | this.define("page", Page); |
319 | 336 | this.define("Color", Color); |
@@ -356,6 +373,14 @@ export default class Acode { |
356 | 373 | this.define("selectionMenu", selectionMenu); |
357 | 374 | this.define("sidebarApps", sidebarAppsModule); |
358 | 375 | this.define("terminal", terminalModule); |
| 376 | + this.define("codemirror", codemirrorModule); |
| 377 | + this.define("@codemirror/autocomplete", cmAutocomplete); |
| 378 | + this.define("@codemirror/commands", cmCommands); |
| 379 | + this.define("@codemirror/language", cmLanguage); |
| 380 | + this.define("@codemirror/lint", cmLint); |
| 381 | + this.define("@codemirror/search", cmSearch); |
| 382 | + this.define("@codemirror/state", cmState); |
| 383 | + this.define("@codemirror/view", cmView); |
359 | 384 | this.define("createKeyboardEvent", KeyboardEvent); |
360 | 385 | this.define("toInternalUrl", helpers.toInternalUri); |
361 | 386 | this.define("commands", this.#createCommandApi()); |
|
0 commit comments