2025-09-06 00:26:50 +00:00
|
|
|
import './style.css';
|
|
|
|
|
import './app.css';
|
|
|
|
|
|
|
|
|
|
import {EditorView, basicSetup} from "codemirror";
|
|
|
|
|
import {keymap} from "@codemirror/view";
|
|
|
|
|
import { Application } from "@hotwired/stimulus";
|
|
|
|
|
|
2025-09-06 01:26:54 +00:00
|
|
|
import { textProcessor } from "./services.js";
|
|
|
|
|
import {CommandsController} from "./controllers/commands_controller.js";
|
2025-09-06 00:26:50 +00:00
|
|
|
|
|
|
|
|
const view = new EditorView({
|
|
|
|
|
parent: document.querySelector("#app"),
|
|
|
|
|
doc: "",
|
|
|
|
|
extensions: [
|
|
|
|
|
basicSetup,
|
|
|
|
|
keymap.of([{
|
|
|
|
|
key: "Cmd-p",
|
|
|
|
|
run: () => {
|
|
|
|
|
let event = new CustomEvent('dq-showcommands');
|
|
|
|
|
window.dispatchEvent(event);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}]),
|
|
|
|
|
]
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
window.Stimulus = Application.start()
|
|
|
|
|
Stimulus.register("commands", CommandsController);
|
|
|
|
|
|
2025-09-06 01:26:54 +00:00
|
|
|
textProcessor.setCodeMirrorEditor(view);
|
|
|
|
|
|
2025-09-06 00:26:50 +00:00
|
|
|
view.focus();
|