@mistweaverco/mdsvex-shiki 1.0.12
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/LICENSE +21 -0
- package/README.md +125 -0
- package/index.cjs +13908 -0
- package/index.d.ts +31 -0
- package/index.js +13887 -0
- package/package.json +52 -0
- package/styles.css +120 -0
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mistweaverco/mdsvex-shiki",
|
|
3
|
+
"version": "1.0.12",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"module": "./index.js",
|
|
6
|
+
"types": "./index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"styles.css",
|
|
9
|
+
"*.js",
|
|
10
|
+
"*.cjs",
|
|
11
|
+
"*.d.ts"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
15
|
+
"prepublishOnly": "bun run build",
|
|
16
|
+
"clear": "rm -f *.js *.cjs *.d.ts",
|
|
17
|
+
"build": "bun build.ts"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"code",
|
|
21
|
+
"hightlight",
|
|
22
|
+
"hightlights",
|
|
23
|
+
"mdsvex",
|
|
24
|
+
"prismjs",
|
|
25
|
+
"shiki",
|
|
26
|
+
"svelte",
|
|
27
|
+
"sveltekit",
|
|
28
|
+
"syntax"
|
|
29
|
+
],
|
|
30
|
+
"author": "mistweaverco and friends <open-source@mistweaverco.com>",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"description": "Shiki syntax highlighter for mdsvex",
|
|
33
|
+
"private": false,
|
|
34
|
+
"packageManager": "bun@1.3.3",
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@shikijs/transformers": "3.19.0",
|
|
37
|
+
"shiki": "3.19.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@eslint/json": "0.14.0",
|
|
41
|
+
"@eslint/markdown": "7.5.1",
|
|
42
|
+
"@types/bun": "1.3.3",
|
|
43
|
+
"bun-plugin-dts": "0.3.0",
|
|
44
|
+
"eslint": "9.39.1",
|
|
45
|
+
"prettier": "3.7.4",
|
|
46
|
+
"svelte": "5.45.10",
|
|
47
|
+
"typescript-eslint": "8.49.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"typescript": "5.9.3"
|
|
51
|
+
}
|
|
52
|
+
}
|
package/styles.css
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--shiki-dark-bg: #1e1e1e;
|
|
3
|
+
--shiki-dark: #d4d4d4;
|
|
4
|
+
--shiki-dark-accent: #569cd6;
|
|
5
|
+
--shiki-dark-accent-active: #007acc;
|
|
6
|
+
--shiki-dark-border: #333333;
|
|
7
|
+
--shiki-dark-font-style: normal;
|
|
8
|
+
--shiki-dark-font-weight: 400;
|
|
9
|
+
--shiki-dark-text-decoration: none;
|
|
10
|
+
--shiki-copy-success-color: #4caf50;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@media (prefers-color-scheme: light) {
|
|
14
|
+
:root {
|
|
15
|
+
--shiki-dark-bg: #f5f5f5;
|
|
16
|
+
--shiki-dark: #333333;
|
|
17
|
+
--shiki-dark-accent: #0066cc;
|
|
18
|
+
--shiki-dark-accent-active: #004c99;
|
|
19
|
+
--shiki-dark-border: #cccccc;
|
|
20
|
+
--shiki-dark-font-style: normal;
|
|
21
|
+
--shiki-dark-font-weight: 400;
|
|
22
|
+
--shiki-dark-text-decoration: none;
|
|
23
|
+
--shiki-copy-success-color: #4caf50;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.mdsvex-shiki {
|
|
28
|
+
padding: 5px 15px;
|
|
29
|
+
background-color: var(--shiki-dark-bg);
|
|
30
|
+
position: relative;
|
|
31
|
+
border: 1px solid var(--shiki-dark-border);
|
|
32
|
+
border-radius: 5px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.mdsvex-shiki pre {
|
|
36
|
+
position: relative;
|
|
37
|
+
overflow: auto;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.mdsvex-shiki .header {
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 0;
|
|
43
|
+
right: 0;
|
|
44
|
+
z-index: 10;
|
|
45
|
+
background-color: transparent;
|
|
46
|
+
padding: 0.5em 1em;
|
|
47
|
+
pointer-events: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.mdsvex-shiki .header > * {
|
|
51
|
+
pointer-events: auto;
|
|
52
|
+
position: absolute;
|
|
53
|
+
top: 0;
|
|
54
|
+
right: 0;
|
|
55
|
+
transition: opacity 0.2s ease;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.mdsvex-shiki .header .language {
|
|
59
|
+
color: var(--shiki-dark);
|
|
60
|
+
font-size: 0.875em;
|
|
61
|
+
opacity: 0.7;
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: 0.5em;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.mdsvex-shiki .header .language .icon {
|
|
68
|
+
width: 16px;
|
|
69
|
+
height: 16px;
|
|
70
|
+
flex-shrink: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.mdsvex-shiki:hover .header .language,
|
|
74
|
+
.mdsvex-shiki:focus-within .header .language {
|
|
75
|
+
opacity: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.mdsvex-shiki .header .copy {
|
|
79
|
+
color: var(--shiki-dark);
|
|
80
|
+
background-color: transparent;
|
|
81
|
+
border: none;
|
|
82
|
+
padding: 0.25em 0.5em;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
opacity: 0;
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.mdsvex-shiki:hover .header .copy,
|
|
91
|
+
.mdsvex-shiki:focus-within .header .copy {
|
|
92
|
+
opacity: 1;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.mdsvex-shiki .header .copy .icon {
|
|
96
|
+
width: 16px;
|
|
97
|
+
height: 16px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.mdsvex-shiki .header .copy .check-icon {
|
|
101
|
+
display: none;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.mdsvex-shiki .header .copy.copied .copy-icon {
|
|
105
|
+
display: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.mdsvex-shiki .header .copy.copied .check-icon {
|
|
109
|
+
display: block;
|
|
110
|
+
color: var(--shiki-copy-success-color);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.mdsvex-shiki .header .copy:hover {
|
|
114
|
+
color: var(--shiki-dark-accent);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.mdsvex-shiki .header .copy:active {
|
|
118
|
+
color: var(--shiki-dark-accent-active);
|
|
119
|
+
}
|
|
120
|
+
|