MCPcopy Create free account
hub / github.com/docusealco/docuseal / loadCodeMirror

Function loadCodeMirror

app/javascript/elements/email_editor.js:5–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3let loaderPromise = null
4
5function loadCodeMirror () {
6 if (!loaderPromise) {
7 loaderPromise = Promise.all([
8 import(/* webpackChunkName: "email-editor" */ '@codemirror/view'),
9 import(/* webpackChunkName: "email-editor" */ '@codemirror/commands'),
10 import(/* webpackChunkName: "email-editor" */ '@codemirror/language'),
11 import(/* webpackChunkName: "email-editor" */ '@codemirror/lang-html'),
12 import(/* webpackChunkName: "email-editor" */ '@codemirror/lint'),
13 import(/* webpackChunkName: "email-editor" */ '@specious/htmlflow')
14 ]).then(([view, commands, language, html, lint, htmlflow]) => {
15 return {
16 minimalSetup: [
17 commands.history(),
18 language.syntaxHighlighting(language.defaultHighlightStyle, { fallback: true }),
19 view.keymap.of([...commands.defaultKeymap, ...commands.historyKeymap])
20 ],
21 EditorView: view.EditorView,
22 html: html.html,
23 htmlLanguage: html.htmlLanguage,
24 linter: lint.linter,
25 htmlflow: htmlflow.default || htmlflow
26 }
27 })
28 }
29
30 return loaderPromise
31}
32
33export default targetable(class extends HTMLElement {
34 static [target.static] = [

Callers 1

mountMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected