({
styles,
dark = false,
highlightStyle,
extensions = [],
} = {})
| 158 | }; |
| 159 | |
| 160 | const createTheme = ({ |
| 161 | styles, |
| 162 | dark = false, |
| 163 | highlightStyle, |
| 164 | extensions = [], |
| 165 | } = {}) => { |
| 166 | const ext = []; |
| 167 | |
| 168 | if (styles && typeof styles === "object") { |
| 169 | ext.push(cmView.EditorView.theme(styles, { dark: !!dark })); |
| 170 | } |
| 171 | |
| 172 | const resolvedHighlight = createHighlightStyle(highlightStyle); |
| 173 | if (resolvedHighlight) { |
| 174 | ext.push(cmLanguage.syntaxHighlighting(resolvedHighlight)); |
| 175 | } |
| 176 | |
| 177 | if (Array.isArray(extensions)) { |
| 178 | ext.push(...extensions); |
| 179 | } else if (extensions) { |
| 180 | ext.push(extensions); |
| 181 | } |
| 182 | |
| 183 | return ext; |
| 184 | }; |
| 185 | |
| 186 | const editorThemesModule = { |
| 187 | /** |
nothing calls this directly
no outgoing calls
no test coverage detected