@rokkit/stories 1.0.0-next.124 → 1.0.0-next.127
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/package.json +4 -3
- package/src/Code.svelte +1 -1
- package/src/CodeViewer.svelte +6 -1
- package/src/Notes.svelte +1 -1
- package/src/lib/shiki.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rokkit/stories",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.127",
|
|
4
4
|
"description": "Utilities for building tutorials.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -28,9 +28,10 @@
|
|
|
28
28
|
"build": "bun prepublishOnly"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@vitest/expect": "^
|
|
31
|
+
"@vitest/expect": "^4.0.18",
|
|
32
32
|
"frontmatter": "^0.0.3",
|
|
33
|
-
"ramda": "^0.
|
|
33
|
+
"ramda": "^0.32.0",
|
|
34
|
+
"shiki": "^3.23.0",
|
|
34
35
|
"@rokkit/core": "latest"
|
|
35
36
|
}
|
|
36
37
|
}
|
package/src/Code.svelte
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import CopyToClipboard from './CopyToClipboard.svelte'
|
|
5
5
|
|
|
6
6
|
let { content, language } = $props()
|
|
7
|
-
let theme = $derived(vibe.mode
|
|
7
|
+
let theme = $derived(vibe.mode === 'dark' ? 'github-dark' : 'github-light')
|
|
8
8
|
let highlightedCode = $derived(highlightCode(content, { lang: language, theme }))
|
|
9
9
|
</script>
|
|
10
10
|
|
package/src/CodeViewer.svelte
CHANGED
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
import { Tabs } from '@rokkit/ui'
|
|
3
3
|
import Code from './Code.svelte'
|
|
4
4
|
let { files = [] } = $props()
|
|
5
|
-
let current = $state(
|
|
5
|
+
let current = $state(null)
|
|
6
|
+
$effect(() => {
|
|
7
|
+
if (files.length > 0 && current === null) {
|
|
8
|
+
current = files[0]
|
|
9
|
+
}
|
|
10
|
+
})
|
|
6
11
|
let fields = { text: 'name', icon: 'language' }
|
|
7
12
|
</script>
|
|
8
13
|
|
package/src/Notes.svelte
CHANGED
package/src/lib/shiki.js
CHANGED
|
@@ -70,7 +70,7 @@ export async function preloadHighlighter() {
|
|
|
70
70
|
try {
|
|
71
71
|
await initializeHighlighter()
|
|
72
72
|
} catch (error) {
|
|
73
|
-
console.warn('Failed to preload syntax highlighter:', error.message)
|
|
73
|
+
console.warn('Failed to preload syntax highlighter:', error.message)
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|