@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rokkit/stories",
3
- "version": "1.0.0-next.124",
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": "^3.2.4",
31
+ "@vitest/expect": "^4.0.18",
32
32
  "frontmatter": "^0.0.3",
33
- "ramda": "^0.31.3",
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 == 'dark' ? 'github-dark' : 'github-light')
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
 
@@ -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(files[0])
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
@@ -12,7 +12,7 @@
12
12
  */
13
13
  async function gotoPage(route) {
14
14
  if (route) {
15
- const location = '/' + page.params.segment + '/' + route
15
+ const location = `/${ page.params.segment }/${ route}`
16
16
  await goto(location)
17
17
  }
18
18
  }
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