Skip to content

Commit

Permalink
fix paths in preview
Browse files Browse the repository at this point in the history
  • Loading branch information
RodrigoLuglio committed Oct 10, 2024
1 parent 736a2c1 commit 98e46fa
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/components/ThemePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { IGrammarDefinition, Registry, RegistryOptions } from 'monaco-textmate'
import { wireTmGrammars } from 'monaco-editor-textmate'
import { generateSemanticThemeJSON } from '@/lib/generator/export'
import { convertTheme } from '@/lib/utils/convertTheme'
import Color from 'color'

interface ITokenEntry {
name?: string
Expand Down Expand Up @@ -555,7 +554,7 @@ const ThemePreview: React.FC = () => {
if (!editorRef.current) return

if (!isOnigasmInitialized) {
await loadWASM('/onigasm.wasm')
await loadWASM('onigasm.wasm')
setIsOnigasmInitialized(true)
}

Expand All @@ -564,15 +563,15 @@ const ThemePreview: React.FC = () => {
scopeName: string
): Promise<IGrammarDefinition> => {
const grammarMap: { [key: string]: string } = {
'source.tsx': '/TypeScriptReact.tmLanguage.json',
'source.js.jsx': '/JavaScriptReact.tmLanguage.json',
'source.ts': '/TypeScript.tmLanguage.json',
'source.js': '/JavaScript.tmLanguage.json',
'source.css': '/css.tmLanguage.json',
'text.html.markdown': '/markdown.tmLanguage.json',
'text.html.basic': '/html.tmLanguage.json',
'source.python': '/MagicPython.tmLanguage.json',
'source.yaml': '/yaml.tmLanguage.json',
'source.tsx': 'TypeScriptReact.tmLanguage.json',
'source.js.jsx': 'JavaScriptReact.tmLanguage.json',
'source.ts': 'TypeScript.tmLanguage.json',
'source.js': 'JavaScript.tmLanguage.json',
'source.css': 'css.tmLanguage.json',
'text.html.markdown': 'markdown.tmLanguage.json',
'text.html.basic': 'html.tmLanguage.json',
'source.python': 'MagicPython.tmLanguage.json',
'source.yaml': 'yaml.tmLanguage.json',
}

if (scopeName in grammarMap) {
Expand Down

0 comments on commit 98e46fa

Please sign in to comment.