@santi020k/theme 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/shiki.d.ts ADDED
@@ -0,0 +1,57 @@
1
+ export type Santi020kShikiThemeVariant = 'dark' | 'hcDark' | 'hcLight' | 'light'
2
+ export type Santi020kShikiThemeType = 'dark' | 'hc-dark' | 'hc-light' | 'light'
3
+
4
+ export interface Santi020kShikiTokenColor {
5
+ name?: string
6
+ scope?: string | string[]
7
+ settings?: Record<string, string | number | boolean | undefined>
8
+ }
9
+
10
+ export interface Santi020kShikiSemanticTokenColor {
11
+ foreground?: string
12
+ bold?: boolean
13
+ italic?: boolean
14
+ underline?: boolean
15
+ }
16
+
17
+ export interface Santi020kShikiTheme {
18
+ name: string
19
+ type: Santi020kShikiThemeType
20
+ colors: Record<string, string>
21
+ semanticHighlighting?: boolean
22
+ semanticTokenColors?: Record<string, string | Santi020kShikiSemanticTokenColor>
23
+ tokenColors: Santi020kShikiTokenColor[]
24
+ }
25
+
26
+ export declare const santi020kDarkShikiTheme: Santi020kShikiTheme & {
27
+ name: 'santi020k dark'
28
+ type: 'dark'
29
+ }
30
+
31
+ export declare const santi020kHcDarkShikiTheme: Santi020kShikiTheme & {
32
+ name: 'santi020k hc dark'
33
+ type: 'hc-dark'
34
+ }
35
+
36
+ export declare const santi020kHcLightShikiTheme: Santi020kShikiTheme & {
37
+ name: 'santi020k hc light'
38
+ type: 'hc-light'
39
+ }
40
+
41
+ export declare const santi020kLightShikiTheme: Santi020kShikiTheme & {
42
+ name: 'santi020k light'
43
+ type: 'light'
44
+ }
45
+
46
+ export declare const santi020kShikiThemes: {
47
+ dark: typeof santi020kDarkShikiTheme
48
+ hcDark: typeof santi020kHcDarkShikiTheme
49
+ hcLight: typeof santi020kHcLightShikiTheme
50
+ light: typeof santi020kLightShikiTheme
51
+ }
52
+
53
+ export declare const santi020kShikiThemeVariants: readonly Santi020kShikiThemeVariant[]
54
+
55
+ export declare function getSanti020kShikiTheme(
56
+ variant: Santi020kShikiThemeVariant
57
+ ): typeof santi020kShikiThemes[Santi020kShikiThemeVariant]
package/shiki.js ADDED
@@ -0,0 +1,37 @@
1
+ import darkTheme from './shiki/santi020k-dark.json' with { type: 'json' }
2
+ import hcDarkTheme from './shiki/santi020k-hc-dark.json' with { type: 'json' }
3
+ import hcLightTheme from './shiki/santi020k-hc-light.json' with { type: 'json' }
4
+ import lightTheme from './shiki/santi020k-light.json' with { type: 'json' }
5
+
6
+ export const santi020kDarkShikiTheme = darkTheme
7
+ export const santi020kHcDarkShikiTheme = hcDarkTheme
8
+ export const santi020kHcLightShikiTheme = hcLightTheme
9
+ export const santi020kLightShikiTheme = lightTheme
10
+
11
+ export const santi020kShikiThemes = {
12
+ dark: santi020kDarkShikiTheme,
13
+ hcDark: santi020kHcDarkShikiTheme,
14
+ hcLight: santi020kHcLightShikiTheme,
15
+ light: santi020kLightShikiTheme
16
+ }
17
+
18
+ export const santi020kShikiThemeVariants = Object.freeze(['dark', 'hcDark', 'hcLight', 'light'])
19
+
20
+ export const getSanti020kShikiTheme = variant => {
21
+ switch (variant) {
22
+ case 'dark':
23
+ return santi020kDarkShikiTheme
24
+
25
+ case 'hcDark':
26
+ return santi020kHcDarkShikiTheme
27
+
28
+ case 'hcLight':
29
+ return santi020kHcLightShikiTheme
30
+
31
+ case 'light':
32
+ return santi020kLightShikiTheme
33
+
34
+ default:
35
+ throw new Error(`Unknown Santi020k Shiki theme variant: ${variant}`)
36
+ }
37
+ }