rn-shiki 0.0.4 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/syntax/highlighter/index.ts +21 -21
package/package.json
CHANGED
@@ -1,38 +1,38 @@
|
|
1
1
|
import type { LanguageInput, ThemedToken, ThemeInput } from 'shiki'
|
2
2
|
import type { TokenType } from '../../types'
|
3
3
|
import { createHighlighterCore } from 'shiki/core'
|
4
|
-
import { createJavaScriptRegexEngine } from 'shiki/engine
|
4
|
+
import { createJavaScriptRegexEngine } from 'shiki/engine/javascript'
|
5
5
|
|
6
|
-
// Import
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
// Import languages
|
7
|
+
import css from 'shiki/langs/css.mjs'
|
8
|
+
import html from 'shiki/langs/html.mjs'
|
9
|
+
import javascript from 'shiki/langs/javascript.mjs'
|
10
|
+
import json from 'shiki/langs/json.mjs'
|
11
|
+
import php from 'shiki/langs/php.mjs'
|
12
|
+
import typescript from 'shiki/langs/typescript.mjs'
|
13
13
|
|
14
|
-
// Import
|
15
|
-
|
16
|
-
|
14
|
+
// Import themes
|
15
|
+
import githubDark from 'shiki/themes/github-dark.mjs'
|
16
|
+
import githubLight from 'shiki/themes/github-light.mjs'
|
17
17
|
|
18
18
|
// Define supported languages and themes explicitly
|
19
19
|
export type SupportedLanguage = 'css' | 'html' | 'javascript' | 'json' | 'php' | 'typescript'
|
20
20
|
export type SupportedTheme = 'github-dark' | 'github-light'
|
21
21
|
|
22
|
-
//
|
22
|
+
// Bundled languages mapping - using the imported grammars directly
|
23
23
|
const LANGUAGE_IMPORTS: Record<SupportedLanguage, LanguageInput> = {
|
24
|
-
css
|
25
|
-
html
|
26
|
-
javascript
|
27
|
-
json
|
28
|
-
php
|
29
|
-
typescript
|
24
|
+
css,
|
25
|
+
html,
|
26
|
+
javascript,
|
27
|
+
json,
|
28
|
+
php,
|
29
|
+
typescript,
|
30
30
|
}
|
31
31
|
|
32
|
-
//
|
32
|
+
// Bundled themes mapping
|
33
33
|
const THEME_IMPORTS: Record<SupportedTheme, ThemeInput> = {
|
34
|
-
'github-dark':
|
35
|
-
'github-light':
|
34
|
+
'github-dark': githubDark,
|
35
|
+
'github-light': githubLight,
|
36
36
|
}
|
37
37
|
|
38
38
|
// Singleton highlighter instance with tracking
|