@movk/nuxt-docs 1.1.2 → 1.2.1

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/app/app.vue CHANGED
@@ -42,7 +42,7 @@ provide('navigation', rootNavigation)
42
42
  <UApp :toaster="appConfig.toaster">
43
43
  <NuxtLoadingIndicator color="var(--ui-primary)" :height="2" />
44
44
 
45
- <div :class="[route.path.startsWith('/docs/') && 'root']">
45
+ <div :class="{ root: route.path.startsWith('/docs/') }">
46
46
  <template v-if="!route.path.startsWith('/examples')">
47
47
  <Header />
48
48
  </template>
@@ -0,0 +1,225 @@
1
+ <script lang="ts" setup>
2
+ /**
3
+ * @credits NuxtLabs <https://nuxtlabs.com/>
4
+ * @see https://github.com/nuxt/nuxt.com/blob/main/components/OgImage/Docs.vue
5
+ */
6
+ import { computed } from 'vue'
7
+
8
+ const props = withDefaults(defineProps<{ title?: string, description?: string, headline?: string }>(), {
9
+ title: 'title',
10
+ description: 'description',
11
+ headline: 'headline'
12
+ })
13
+
14
+ const title = computed(() => (props.title || '').slice(0, 60))
15
+ const description = computed(() => (props.description || '').slice(0, 200))
16
+ </script>
17
+
18
+ <template>
19
+ <div class="w-full h-full flex flex-col justify-center bg-[#020420]">
20
+ <svg
21
+ class="absolute right-0 top-0"
22
+ width="629"
23
+ height="593"
24
+ viewBox="0 0 629 593"
25
+ fill="none"
26
+ xmlns="http://www.w3.org/2000/svg"
27
+ >
28
+ <g filter="url(#filter0_f_199_94966)">
29
+ <path d="M628.5 -578L639.334 -94.4223L806.598 -548.281L659.827 -87.387L965.396 -462.344L676.925 -74.0787L1087.69 -329.501L688.776 -55.9396L1160.22 -164.149L694.095 -34.9354L1175.13 15.7948L692.306 -13.3422L1130.8 190.83L683.602 6.50012L1032.04 341.989L668.927 22.4412L889.557 452.891L649.872 32.7537L718.78 511.519L628.5 36.32L538.22 511.519L607.128 32.7537L367.443 452.891L588.073 22.4412L224.955 341.989L573.398 6.50012L126.198 190.83L564.694 -13.3422L81.8734 15.7948L562.905 -34.9354L96.7839 -164.149L568.224 -55.9396L169.314 -329.501L580.075 -74.0787L291.604 -462.344L597.173 -87.387L450.402 -548.281L617.666 -94.4223L628.5 -578Z" fill="#00DC82" />
30
+ </g>
31
+ <defs>
32
+ <filter
33
+ id="filter0_f_199_94966"
34
+ x="0.873535"
35
+ y="-659"
36
+ width="1255.25"
37
+ height="1251.52"
38
+ filterUnits="userSpaceOnUse"
39
+ color-interpolation-filters="sRGB"
40
+ >
41
+ <feFlood flood-opacity="0" result="BackgroundImageFix" />
42
+ <feBlend
43
+ mode="normal"
44
+ in="SourceGraphic"
45
+ in2="BackgroundImageFix"
46
+ result="shape"
47
+ />
48
+ <feGaussianBlur stdDeviation="40.5" result="effect1_foregroundBlur_199_94966" />
49
+ </filter>
50
+ </defs>
51
+ </svg>
52
+
53
+ <div class="w-[600px] pl-[100px]">
54
+ <p v-if="headline" class="uppercase text-[24px] text-[#00DC82] mb-4 font-semibold">
55
+ {{ headline }}
56
+ </p>
57
+ <h1 v-if="title" class="w-[600px] m-0 text-[75px] font-semibold mb-4 text-white" style="display: block; line-clamp: 2; text-overflow: ellipsis;">
58
+ {{ title }}
59
+ </h1>
60
+ <p v-if="description" class="text-[32px] text-[#E4E4E7] leading-tight" style="display: block; line-clamp: 3; text-overflow: ellipsis;">
61
+ {{ description }}
62
+ </p>
63
+ </div>
64
+ <svg
65
+ class="absolute top-[160px] right-[90px]"
66
+ width="340"
67
+ height="340"
68
+ viewBox="0 0 340 340"
69
+ fill="none"
70
+ xmlns="http://www.w3.org/2000/svg"
71
+ >
72
+ <path d="M86.6286 103.106C88.2099 94.7477 94.7477 88.2099 103.106 86.6286L104.427 86.3788C146.343 78.4485 189.386 78.5576 231.262 86.7002L232.272 86.8967C239.615 88.3244 245.4 93.99 246.981 101.301L247.277 102.671C256.565 145.63 256.438 190.092 246.903 232.997C245.361 239.939 239.939 245.361 232.997 246.903C190.092 256.438 145.63 256.565 102.671 247.277L101.301 246.981C93.99 245.4 88.3244 239.615 86.8967 232.272L86.7002 231.262C78.5576 189.386 78.4485 146.343 86.3788 104.426L86.6286 103.106Z" fill="url(#paint0_linear_199_94959)" />
73
+ <path d="M86.6286 103.106C88.2099 94.7477 94.7477 88.2099 103.106 86.6286L104.427 86.3788C146.343 78.4485 189.386 78.5576 231.262 86.7002L232.272 86.8967C239.615 88.3244 245.4 93.99 246.981 101.301L247.277 102.671C256.565 145.63 256.438 190.092 246.903 232.997C245.361 239.939 239.939 245.361 232.997 246.903C190.092 256.438 145.63 256.565 102.671 247.277L101.301 246.981C93.99 245.4 88.3244 239.615 86.8967 232.272L86.7002 231.262C78.5576 189.386 78.4485 146.343 86.3788 104.426L86.6286 103.106Z" fill="url(#paint1_radial_199_94959)" fill-opacity="0.06" />
74
+ <path
75
+ d="M103.028 86.2151C94.4994 87.8286 87.8286 94.4994 86.2151 103.028L85.9653 104.348C78.0252 146.318 78.1344 189.414 86.2872 231.342L86.4836 232.353C87.9434 239.86 93.7366 245.776 101.212 247.392L102.582 247.688C145.601 256.989 190.124 256.862 233.089 247.314C240.19 245.736 245.736 240.19 247.314 233.089C256.862 190.124 256.989 145.601 247.688 102.582L247.392 101.212C245.776 93.7366 239.86 87.9434 232.353 86.4836L231.342 86.2872C189.414 78.1344 146.318 78.0252 104.348 85.9653L103.028 86.2151Z"
76
+ stroke="url(#paint2_linear_199_94959)"
77
+ stroke-opacity="0.2"
78
+ stroke-width="0.841584"
79
+ />
80
+ <path
81
+ d="M86.5693 66.0418C76.1888 68.0728 68.0728 76.1888 66.0418 86.5693L65.7807 87.9041C55.4495 140.708 55.5631 195.024 66.1151 247.784L66.3095 248.756C68.1871 258.144 75.4486 265.527 84.8039 267.561L86.1767 267.86C140.001 279.561 195.755 279.425 249.525 267.477C258.483 265.486 265.485 258.489 267.475 249.53C279.429 195.737 279.558 139.989 267.852 86.1413L267.553 84.7671C265.524 75.4341 258.158 68.19 248.793 66.3169L247.784 66.1151C195.024 55.5631 140.708 55.4495 87.904 65.7807L86.5693 66.0418Z"
82
+ stroke="url(#paint3_linear_199_94959)"
83
+ stroke-opacity="0.6"
84
+ stroke-width="1.7"
85
+ />
86
+ <path
87
+ d="M66.1749 44.2983C55.2117 46.6476 46.6475 55.2117 44.2983 66.1749L43.1523 71.5228C29.5422 135.037 29.5422 200.713 43.1523 264.227L44.425 270.166C46.7026 280.795 54.917 289.15 65.5055 291.608C132.857 307.243 203.127 307.189 270.477 291.554C280.924 289.129 289.129 280.924 291.554 270.477C307.189 203.127 307.243 132.857 291.608 65.5055C289.15 54.917 280.795 46.7026 270.166 44.425L264.227 43.1523C200.713 29.5422 135.037 29.5422 71.5228 43.1523L66.1749 44.2983Z"
88
+ stroke="url(#paint4_linear_199_94959)"
89
+ stroke-opacity="0.4"
90
+ stroke-width="1.7"
91
+ />
92
+ <path
93
+ d="M47.0949 24.9846C36.0029 27.3375 27.3375 36.0029 24.9846 47.0949L19.3193 73.8027C5.86738 137.219 5.96967 202.762 19.6195 266.137L25.0028 291.131C27.3518 302.037 35.8106 310.592 46.6894 313.064L67.2583 317.739C134.879 333.107 205.098 332.991 272.667 317.398L291.54 313.043C302.229 310.576 310.576 302.229 313.043 291.54L317.398 272.667C332.991 205.098 333.107 134.879 317.739 67.2583L313.064 46.6894C310.592 35.8106 302.037 27.3518 291.131 25.0028L266.137 19.6195C202.762 5.96966 137.219 5.86738 73.8027 19.3193L47.0949 24.9846Z"
94
+ stroke="url(#paint5_linear_199_94959)"
95
+ stroke-opacity="0.2"
96
+ stroke-width="2.125"
97
+ />
98
+ <path d="M174.667 190.325H203.105C204.009 190.325 204.896 190.084 205.678 189.626C206.461 189.168 207.11 188.509 207.561 187.715C208.013 186.921 208.25 186.021 208.25 185.105C208.25 184.188 208.011 183.288 207.559 182.495L188.461 148.938C188.009 148.145 187.36 147.486 186.578 147.028C185.796 146.57 184.909 146.328 184.006 146.328C183.103 146.328 182.215 146.57 181.433 147.028C180.651 147.486 180.002 148.145 179.551 148.938L174.667 157.524L165.119 140.734C164.668 139.941 164.018 139.282 163.236 138.824C162.453 138.366 161.566 138.125 160.663 138.125C159.76 138.125 158.872 138.366 158.09 138.824C157.308 139.282 156.658 139.941 156.206 140.734L132.441 182.495C131.989 183.288 131.75 184.188 131.75 185.105C131.75 186.021 131.987 186.921 132.439 187.715C132.89 188.509 133.539 189.168 134.322 189.626C135.104 190.084 135.991 190.325 136.895 190.325H154.746C161.819 190.325 167.035 187.173 170.624 181.025L179.337 165.717L184.004 157.524L198.011 182.133H179.337L174.667 190.325ZM154.455 182.124L141.997 182.121L160.671 149.312L169.989 165.717L163.75 176.681C161.367 180.671 158.659 182.124 154.455 182.124Z" fill="#00DC82" />
99
+ <path
100
+ d="M176.761 189.109H203.105H203.106C203.792 189.109 204.467 188.926 205.064 188.576C205.66 188.227 206.158 187.723 206.504 187.113L207.561 187.715L206.504 187.113C206.851 186.504 207.034 185.811 207.034 185.105C207.033 184.399 206.85 183.707 206.502 183.098L206.502 183.097L187.404 149.54L187.404 149.54C187.057 148.93 186.56 148.427 185.963 148.077C185.367 147.728 184.692 147.545 184.006 147.545C183.32 147.545 182.645 147.728 182.048 148.077C181.452 148.427 180.954 148.93 180.608 149.539C180.608 149.539 180.608 149.54 180.608 149.54L175.725 158.126L174.667 159.985L173.61 158.125L164.062 141.336L176.761 189.109ZM176.761 189.109L180.044 183.349H198.011H200.103L199.069 181.531L185.061 156.922L184.005 155.066L182.947 156.922L178.28 165.115L178.28 165.115L169.57 180.417C166.187 186.208 161.362 189.109 154.746 189.109H136.895H136.894C136.208 189.109 135.533 188.926 134.936 188.576C134.34 188.227 133.842 187.723 133.496 187.113L132.44 187.714L133.496 187.113C133.149 186.504 132.966 185.811 132.966 185.105C132.967 184.399 133.15 183.707 133.498 183.098L133.498 183.097L157.263 141.336C157.263 141.336 157.263 141.336 157.263 141.336C157.61 140.727 158.108 140.223 158.705 139.874C159.301 139.525 159.976 139.341 160.663 139.341C161.349 139.341 162.025 139.525 162.621 139.874L163.236 138.824L162.621 139.874C163.218 140.223 163.715 140.727 164.062 141.336L176.761 189.109ZM154.454 183.34H154.455C156.699 183.34 158.653 182.952 160.391 181.953C162.126 180.957 163.533 179.417 164.794 177.305L164.801 177.294L164.807 177.283L171.046 166.318L171.388 165.717L171.047 165.116L161.729 148.711L160.672 146.851L159.614 148.71L140.94 181.52L139.905 183.337L141.997 183.338L154.454 183.34Z"
101
+ stroke="url(#paint6_linear_199_94959)"
102
+ stroke-opacity="0.2"
103
+ stroke-width="2.43271"
104
+ />
105
+ <g filter="url(#filter0_f_199_94959)">
106
+ <path d="M174.667 190.325H203.105C204.009 190.325 204.896 190.084 205.678 189.626C206.461 189.168 207.11 188.509 207.561 187.715C208.013 186.921 208.25 186.021 208.25 185.105C208.25 184.188 208.011 183.288 207.559 182.495L188.461 148.938C188.009 148.145 187.36 147.486 186.578 147.028C185.796 146.57 184.909 146.328 184.006 146.328C183.103 146.328 182.215 146.57 181.433 147.028C180.651 147.486 180.002 148.145 179.551 148.938L174.667 157.524L165.119 140.734C164.668 139.941 164.018 139.282 163.236 138.824C162.453 138.366 161.566 138.125 160.663 138.125C159.76 138.125 158.872 138.366 158.09 138.824C157.308 139.282 156.658 139.941 156.206 140.734L132.441 182.495C131.989 183.288 131.75 184.188 131.75 185.105C131.75 186.021 131.987 186.921 132.439 187.715C132.89 188.509 133.539 189.168 134.322 189.626C135.104 190.084 135.991 190.325 136.895 190.325H154.746C161.819 190.325 167.035 187.173 170.624 181.025L179.337 165.717L184.004 157.524L198.011 182.133H179.337L174.667 190.325ZM154.455 182.124L141.997 182.121L160.671 149.312L169.989 165.717L163.75 176.681C161.367 180.671 158.659 182.124 154.455 182.124Z" fill="#00DC82" />
107
+ <path
108
+ d="M176.761 189.109H203.105H203.106C203.792 189.109 204.467 188.926 205.064 188.576C205.66 188.227 206.158 187.723 206.504 187.113L207.561 187.715L206.504 187.113C206.851 186.504 207.034 185.811 207.034 185.105C207.033 184.399 206.85 183.707 206.502 183.098L206.502 183.097L187.404 149.54L187.404 149.54C187.057 148.93 186.56 148.427 185.963 148.077C185.367 147.728 184.692 147.545 184.006 147.545C183.32 147.545 182.645 147.728 182.048 148.077C181.452 148.427 180.954 148.93 180.608 149.539C180.608 149.539 180.608 149.54 180.608 149.54L175.725 158.126L174.667 159.985L173.61 158.125L164.062 141.336L176.761 189.109ZM176.761 189.109L180.044 183.349H198.011H200.103L199.069 181.531L185.061 156.922L184.005 155.066L182.947 156.922L178.28 165.115L178.28 165.115L169.57 180.417C166.187 186.208 161.362 189.109 154.746 189.109H136.895H136.894C136.208 189.109 135.533 188.926 134.936 188.576C134.34 188.227 133.842 187.723 133.496 187.113L132.44 187.714L133.496 187.113C133.149 186.504 132.966 185.811 132.966 185.105C132.967 184.399 133.15 183.707 133.498 183.098L133.498 183.097L157.263 141.336C157.263 141.336 157.263 141.336 157.263 141.336C157.61 140.727 158.108 140.223 158.705 139.874C159.301 139.525 159.976 139.341 160.663 139.341C161.349 139.341 162.025 139.525 162.621 139.874L163.236 138.824L162.621 139.874C163.218 140.223 163.715 140.727 164.062 141.336L176.761 189.109ZM154.454 183.34H154.455C156.699 183.34 158.653 182.952 160.391 181.953C162.126 180.957 163.533 179.417 164.794 177.305L164.801 177.294L164.807 177.283L171.046 166.318L171.388 165.717L171.047 165.116L161.729 148.711L160.672 146.851L159.614 148.71L140.94 181.52L139.905 183.337L141.997 183.338L154.454 183.34Z"
109
+ stroke="url(#paint7_linear_199_94959)"
110
+ stroke-opacity="0.2"
111
+ stroke-width="2.43271"
112
+ />
113
+ </g>
114
+ <defs>
115
+ <filter
116
+ id="filter0_f_199_94959"
117
+ x="124.176"
118
+ y="130.551"
119
+ width="91.6485"
120
+ height="67.3485"
121
+ filterUnits="userSpaceOnUse"
122
+ color-interpolation-filters="sRGB"
123
+ >
124
+ <feFlood flood-opacity="0" result="BackgroundImageFix" />
125
+ <feBlend
126
+ mode="normal"
127
+ in="SourceGraphic"
128
+ in2="BackgroundImageFix"
129
+ result="shape"
130
+ />
131
+ <feGaussianBlur stdDeviation="3.78713" result="effect1_foregroundBlur_199_94959" />
132
+ </filter>
133
+ <linearGradient
134
+ id="paint0_linear_199_94959"
135
+ x1="167.875"
136
+ y1="74.375"
137
+ x2="88"
138
+ y2="261"
139
+ gradientUnits="userSpaceOnUse"
140
+ >
141
+ <stop stop-color="#0F172A" />
142
+ <stop offset="1" stop-color="#0F172A" stop-opacity="0" />
143
+ </linearGradient>
144
+ <radialGradient
145
+ id="paint1_radial_199_94959"
146
+ cx="0"
147
+ cy="0"
148
+ r="1"
149
+ gradientUnits="userSpaceOnUse"
150
+ gradientTransform="translate(167.875 167.875) rotate(-90) scale(100.596 107.502)"
151
+ >
152
+ <stop stop-color="white" />
153
+ <stop offset="1" stop-opacity="0" />
154
+ </radialGradient>
155
+ <linearGradient
156
+ id="paint2_linear_199_94959"
157
+ x1="247.183"
158
+ y1="96.4978"
159
+ x2="194.172"
160
+ y2="229.234"
161
+ gradientUnits="userSpaceOnUse"
162
+ >
163
+ <stop stop-color="white" />
164
+ <stop offset="1" stop-opacity="0" />
165
+ </linearGradient>
166
+ <linearGradient
167
+ id="paint3_linear_199_94959"
168
+ x1="267.01"
169
+ y1="78.6537"
170
+ x2="200.746"
171
+ y2="244.574"
172
+ gradientUnits="userSpaceOnUse"
173
+ >
174
+ <stop stop-color="#00DC82" />
175
+ <stop offset="1" stop-opacity="0" />
176
+ <stop offset="1" stop-opacity="0" />
177
+ </linearGradient>
178
+ <linearGradient
179
+ id="paint4_linear_199_94959"
180
+ x1="292.405"
181
+ y1="57.8159"
182
+ x2="209.877"
183
+ y2="264.463"
184
+ gradientUnits="userSpaceOnUse"
185
+ >
186
+ <stop stop-color="#00DC82" />
187
+ <stop offset="1" stop-opacity="0" />
188
+ </linearGradient>
189
+ <linearGradient
190
+ id="paint5_linear_199_94959"
191
+ x1="314.196"
192
+ y1="40.2232"
193
+ x2="217.813"
194
+ y2="281.562"
195
+ gradientUnits="userSpaceOnUse"
196
+ >
197
+ <stop stop-color="#00DC82" />
198
+ <stop offset="1" stop-opacity="0" />
199
+ </linearGradient>
200
+ <linearGradient
201
+ id="paint6_linear_199_94959"
202
+ x1="202.444"
203
+ y1="144.3"
204
+ x2="191.546"
205
+ y2="184.293"
206
+ gradientUnits="userSpaceOnUse"
207
+ >
208
+ <stop stop-color="white" />
209
+ <stop offset="1" stop-opacity="0" />
210
+ </linearGradient>
211
+ <linearGradient
212
+ id="paint7_linear_199_94959"
213
+ x1="202.444"
214
+ y1="144.3"
215
+ x2="191.546"
216
+ y2="184.293"
217
+ gradientUnits="userSpaceOnUse"
218
+ >
219
+ <stop stop-color="white" />
220
+ <stop offset="1" stop-opacity="0" />
221
+ </linearGradient>
222
+ </defs>
223
+ </svg>
224
+ </div>
225
+ </template>
@@ -167,7 +167,7 @@ const urlSearchParams = computed(() => {
167
167
  <template>
168
168
  <div ref="el" class="my-5" :style="{ '--ui-header-height': '4rem' }">
169
169
  <template v-if="preview">
170
- <div class="border border-muted relative z-[1]" :class="[{ 'border-b-0 rounded-t-md': source, 'rounded-md': !source, 'overflow-hidden': props.overflowHidden }]">
170
+ <div class="border border-muted relative z-1" :class="{ 'border-b-0 rounded-t-md': source, 'rounded-md': !source, 'overflow-hidden': props.overflowHidden }">
171
171
  <div v-if="props.options?.length || !!slots.options" class="flex gap-4 p-4 border-b border-muted">
172
172
  <slot name="options" />
173
173
 
@@ -194,8 +194,8 @@ const urlSearchParams = computed(() => {
194
194
  variant="soft"
195
195
  class="rounded-sm rounded-l-none min-w-12"
196
196
  :multiple="option.multiple"
197
- :class="[option.name.toLowerCase().endsWith('color') && 'pl-6']"
198
- :ui="{ itemLeadingChip: 'size-2' }"
197
+ :class="{ 'pl-6': option.name.toLowerCase().endsWith('color') }"
198
+ :ui="{ itemLeadingChip: 'w-2' }"
199
199
  @update:model-value="set(optionsValues, option.name, $event)"
200
200
  >
201
201
  <template v-if="option.name.toLowerCase().endsWith('color')" #leading="{ modelValue, ui }">
@@ -224,7 +224,7 @@ const urlSearchParams = computed(() => {
224
224
  v-bind="typeof iframe === 'object' ? iframe : {}"
225
225
  :src="`/examples/${name}?${urlSearchParams}`"
226
226
  class="relative w-full"
227
- :class="[props.class, !iframeMobile && 'lg:left-1/2 lg:-translate-x-1/2 lg:w-[1024px]']"
227
+ :class="[props.class, { 'lg:left-1/2 lg:-translate-x-1/2 lg:w-[1024px]': !iframeMobile }]"
228
228
  />
229
229
  <div v-else class="flex justify-center p-4" :class="props.class">
230
230
  <component :is="camelName" v-bind="{ ...componentProps, ...optionsValues }" />
@@ -233,14 +233,14 @@ const urlSearchParams = computed(() => {
233
233
  </template>
234
234
 
235
235
  <template v-if="source">
236
- <div v-if="!!slots.code" class="[&_pre]:!rounded-t-none [&_div.my-5]:!mt-0">
236
+ <div v-if="!!slots.code" class="[&_pre]:rounded-t-none! [&_div.my-5]:mt-0!">
237
237
  <slot name="code" />
238
238
  </div>
239
239
  <MDCRenderer
240
240
  v-else-if="ast"
241
241
  :body="ast.body"
242
242
  :data="ast.data"
243
- class="[&_pre]:!rounded-t-none [&_div.my-5]:!mt-0"
243
+ class="[&_pre]:rounded-t-none! [&_div.my-5]:mt-0!"
244
244
  />
245
245
  </template>
246
246
  </div>
@@ -21,7 +21,7 @@ onMounted(() => {
21
21
  class="absolute w-full -top-px transition-all text-primary shrink-0"
22
22
  :class="[
23
23
  isLoading ? 'animate-pulse' : (appear ? heroBackgroundClass : 'opacity-0'),
24
- appeared ? 'duration-[400ms]' : 'duration-1000'
24
+ appeared ? 'duration-400' : 'duration-1000'
25
25
  ]"
26
26
  >
27
27
  <svg
@@ -1,4 +1,3 @@
1
- <!-- https://github.com/nuxt/ui/blob/v4/docs/app/components/content/HighlightInlineType.vue -->
2
1
  <script setup lang="ts">
3
2
  import { hash } from 'ohash'
4
3
 
@@ -24,16 +23,9 @@ const type = computed(() => {
24
23
  return type
25
24
  })
26
25
 
27
- const { data: ast } = await useAsyncData(`hightlight-inline-code-${hash(type.value).slice(0, 10)}`, () => parseMarkdown(`\`${type.value}\`{lang="ts-type"}`), {
28
- watch: [type]
29
- })
26
+ const { data: ast } = await useAsyncData(`hightlight-inline-code-${hash(type.value).slice(0, 10)}`, () => parseMarkdown(`\`${type.value}\`{lang="ts-type"}`))
30
27
  </script>
31
28
 
32
29
  <template>
33
- <ClientOnly>
34
- <MDCRenderer v-if="ast?.body" :body="ast.body" :data="ast.data || {}" />
35
- <template #fallback>
36
- <ProseCode>{{ type }}</ProseCode>
37
- </template>
38
- </ClientOnly>
30
+ <MDCRenderer v-if="ast" :body="ast.body" :data="ast.data" />
39
31
  </template>
@@ -19,7 +19,7 @@ const slots = defineSlots<{
19
19
  :icon="icon"
20
20
  :label="label"
21
21
  class="capitalize ring-default rounded-sm text-[11px]"
22
- :class="[selected ? 'bg-elevated' : 'hover:bg-elevated/50']"
22
+ :class="selected ? 'bg-elevated' : 'hover:bg-elevated/50'"
23
23
  >
24
24
  <template v-if="chip || !!slots.leading" #leading>
25
25
  <slot name="leading">
package/app/error.vue CHANGED
@@ -44,7 +44,7 @@ provide('navigation', rootNavigation)
44
44
  <UApp>
45
45
  <NuxtLoadingIndicator color="var(--ui-primary)" :height="2" />
46
46
 
47
- <div :class="[route.path.startsWith('/docs/') && 'root']">
47
+ <div :class="{ root: route.path.startsWith('/docs/') }">
48
48
  <Header />
49
49
 
50
50
  <UError :error="error" />
@@ -139,10 +139,10 @@ defineOgImageComponent('Nuxt', {
139
139
  :title="toc?.title"
140
140
  :links="page.body?.toc?.links"
141
141
  highlight
142
- class="z-[2]"
142
+ class="z-2"
143
143
  >
144
144
  <template v-if="toc?.bottom" #bottom>
145
- <div class="hidden lg:block space-y-6" :class="{ '!mt-6': page.body?.toc?.links?.length }">
145
+ <div class="hidden lg:block space-y-6" :class="{ 'mt-6!': page.body?.toc?.links?.length }">
146
146
  <USeparator v-if="page.body?.toc?.links?.length" type="dashed" />
147
147
 
148
148
  <UPageLinks v-if="communityLinks?.length" :title="toc.bottom.title" :links="communityLinks" />
@@ -63,7 +63,7 @@ const { data: versions } = await useFetch(page.value.hero.releases || '', {
63
63
  />
64
64
  </UPageHero>
65
65
 
66
- <UPageSection :ui="{ container: '!py-0' }">
66
+ <UPageSection :ui="{ container: 'py-0!' }">
67
67
  <div class="py-4 md:py-8 lg:py-16 md:border-x border-default">
68
68
  <UContainer class="max-w-5xl">
69
69
  <UChangelogVersions>
@@ -16,6 +16,11 @@ export default defineNuxtModule({
16
16
  delete (slot as any).schema
17
17
  }
18
18
  }
19
+ if (component?.meta?.events) {
20
+ for (const event of component.meta.events) {
21
+ delete (event as any).schema
22
+ }
23
+ }
19
24
  }
20
25
  })
21
26
  }
package/modules/css.ts CHANGED
@@ -14,12 +14,13 @@ export default defineNuxtModule({
14
14
  const contentDir = joinURL(dir, 'content')
15
15
  const uiPath = resolveModulePath('@nuxt/ui', { from: import.meta.url, conditions: ['style'] })
16
16
  const tailwindPath = resolveModulePath('tailwindcss', { from: import.meta.url, conditions: ['style'] })
17
+ const tailwindThemePath = tailwindPath.replace(/index\.css$/, 'theme.css')
17
18
 
18
19
  const cssTemplate = addTemplate({
19
20
  filename: 'movk-nuxt-docs.css',
20
21
  getContents: () => {
21
22
  return `@import ${JSON.stringify(tailwindPath)};
22
- @import ${JSON.stringify(tailwindPath)}/theme.css theme(static);
23
+ @import ${JSON.stringify(tailwindThemePath)} layer(theme) theme(static);
23
24
  @import ${JSON.stringify(uiPath)};
24
25
 
25
26
  @source "${contentDir.replace(/\\/g, '/')}/**/*";
@@ -0,0 +1,27 @@
1
+ import { defineNuxtModule } from '@nuxt/kit'
2
+ import { copyFile } from 'node:fs/promises'
3
+ import { join } from 'node:path'
4
+
5
+ export default defineNuxtModule({
6
+ meta: {
7
+ name: 'llms'
8
+ },
9
+ async setup(_options, nuxt) {
10
+ /**
11
+ * @see https://vercel.com/docs/functions/configuring-functions/advanced-configuration
12
+ * Vercel 会将所有动态路由转为 Serverless Function,导致 500 错误。
13
+ * 访问 '_llms-full.txt' 静态资源以绕过此问题。
14
+ */
15
+ nuxt.hook('nitro:build:public-assets', async ({ options }) => {
16
+ const outputDir = options.output.publicDir
17
+ try {
18
+ const source = join(outputDir, 'llms-full.txt')
19
+ const dest = join(outputDir, '_llms-full.txt')
20
+ await copyFile(source, dest)
21
+ console.log(`✅ Copied: ${source} → ${dest}`)
22
+ } catch (err) {
23
+ console.warn(`⚠️ Failed to process:`, err instanceof Error ? err.message : String(err))
24
+ }
25
+ })
26
+ }
27
+ })
package/nuxt.config.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { createResolver } from '@nuxt/kit'
2
+ import pkg from './package.json'
2
3
 
3
4
  const { resolve } = createResolver(import.meta.url)
4
5
 
@@ -8,6 +9,7 @@ export default defineNuxtConfig({
8
9
  resolve('./modules/css'),
9
10
  resolve('./modules/component-example'),
10
11
  resolve('./modules/component-meta'),
12
+ resolve('./modules/llms'),
11
13
  '@nuxt/ui',
12
14
  '@nuxt/content',
13
15
  '@nuxt/image',
@@ -31,6 +33,21 @@ export default defineNuxtConfig({
31
33
  noApiRoute: false
32
34
  }
33
35
  },
36
+ runtimeConfig: {
37
+ public: {
38
+ version: pkg.version
39
+ }
40
+ },
41
+ routeRules: {
42
+ ...process.env.NODE_ENV === 'development'
43
+ ? {
44
+ '/_llms-full.txt': { proxy: '/llms-full.txt' }
45
+ }
46
+ : {}
47
+ },
48
+ experimental: {
49
+ typescriptPlugin: true
50
+ },
34
51
  compatibilityDate: 'latest',
35
52
  nitro: {
36
53
  prerender: {
@@ -41,17 +58,21 @@ export default defineNuxtConfig({
41
58
  },
42
59
  vite: {
43
60
  optimizeDeps: {
61
+ // See: https://cn.vite.dev/config/dep-optimization-options.html
44
62
  include: [
45
63
  '@nuxt/content > slugify',
46
- 'colortranslator',
47
- 'tailwindcss/colors',
64
+ '@movk/nuxt-docs > @nuxt/content > ',
65
+ 'extend', // unified 所需(用于 @nuxt/content 的 markdown 处理)
66
+ 'debug', // Babel 和开发工具所需
48
67
  'tailwind-variants',
49
- 'ufo',
50
- 'zod',
51
- 'scule',
52
- 'motion-v',
53
- 'ohash'
68
+ 'tailwindcss/colors'
54
69
  ]
70
+ },
71
+ resolve: {
72
+ alias: {
73
+ extend: 'extend/index.js',
74
+ debug: 'debug/src/browser.js'
75
+ }
55
76
  }
56
77
  },
57
78
  icon: {
@@ -66,6 +87,7 @@ export default defineNuxtConfig({
66
87
  }
67
88
  },
68
89
  ogImage: {
90
+ zeroRuntime: true,
69
91
  googleFontMirror: 'fonts.loli.net',
70
92
  fonts: [
71
93
  // 思源黑体 - 支持中文
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@movk/nuxt-docs",
3
3
  "type": "module",
4
- "version": "1.1.2",
4
+ "version": "1.2.1",
5
5
  "private": false,
6
6
  "description": "An elegant documentation theme for Nuxt, powered by Nuxt UI and Nuxt Content.",
7
7
  "author": "YiXuan <mhaibaraai@gmail.com>",
@@ -27,29 +27,29 @@
27
27
  "README.md"
28
28
  ],
29
29
  "dependencies": {
30
- "@iconify-json/lucide": "^1.2.70",
31
- "@iconify-json/simple-icons": "^1.2.54",
32
- "@iconify-json/vscode-icons": "^1.2.32",
30
+ "@iconify-json/lucide": "^1.2.71",
31
+ "@iconify-json/simple-icons": "^1.2.56",
32
+ "@iconify-json/vscode-icons": "^1.2.33",
33
33
  "@movk/core": "^0.0.5",
34
- "@nuxt/content": "^3.7.1",
34
+ "@nuxt/content": "^3.8.0",
35
35
  "@nuxt/image": "^1.11.0",
36
- "@nuxt/kit": "^4.1.3",
37
- "@nuxt/ui": "^4.0.1",
36
+ "@nuxt/kit": "^4.2.0",
37
+ "@nuxt/ui": "^4.1.0",
38
38
  "@nuxtjs/seo": "^3.2.2",
39
- "@vueuse/core": "^13.9.0",
40
- "@vueuse/nuxt": "^13.9.0",
39
+ "@vueuse/core": "^14.0.0",
40
+ "@vueuse/nuxt": "^14.0.0",
41
41
  "defu": "^6.1.4",
42
- "pathe": "^2.0.3",
43
42
  "exsolve": "^1.0.7",
44
43
  "git-url-parse": "^16.1.0",
45
- "motion-v": "^1.7.3",
44
+ "motion-v": "^1.7.4",
46
45
  "nuxt-component-meta": "^0.14.1",
47
- "prettier": "^3.6.2",
48
46
  "nuxt-llms": "^0.1.3",
47
+ "ohash": "^2.0.11",
48
+ "pathe": "^2.0.3",
49
49
  "pkg-types": "^2.3.0",
50
+ "prettier": "^3.6.2",
50
51
  "scule": "^1.3.0",
51
- "tailwindcss": "^4.1.14",
52
- "ohash": "^2.0.11",
52
+ "tailwindcss": "^4.1.16",
53
53
  "ufo": "^1.6.1"
54
54
  }
55
55
  }
@@ -3,7 +3,7 @@ import { queryCollection } from '@nuxt/content/server'
3
3
  import { stringify } from 'minimark/stringify'
4
4
  import { withLeadingSlash } from 'ufo'
5
5
 
6
- export default eventHandler(async (event) => {
6
+ export default defineEventHandler(async (event) => {
7
7
  const slug = getRouterParams(event)['slug.md']
8
8
  if (!slug?.endsWith('.md')) {
9
9
  throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })