docus 2.1.0 → 3.0.0-beta.3

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.
Files changed (274) hide show
  1. package/README.md +6 -4
  2. package/app/router.options.ts +18 -0
  3. package/assets/css/fonts.css +84 -0
  4. package/assets/css/main.css +11 -0
  5. package/assets/css/tailwind.css +282 -0
  6. package/components/app/Container.vue +25 -0
  7. package/components/app/Footer.vue +40 -0
  8. package/components/app/Navbar.vue +26 -0
  9. package/components/app/NavbarLogo.vue +33 -0
  10. package/components/app/Page.vue +7 -0
  11. package/components/app/PoweredByDocus.vue +11 -0
  12. package/components/content/Alert.vue +124 -0
  13. package/components/content/BlockHero.vue +54 -0
  14. package/components/content/ButtonLink.vue +45 -0
  15. package/components/content/Card.vue +46 -0
  16. package/components/content/CardGrid.vue +23 -0
  17. package/components/content/CodeBlock.vue +47 -0
  18. package/components/content/CodeGroup.vue +135 -0
  19. package/components/content/CopyButton.vue +49 -0
  20. package/{dist/runtime/app/components/prose/ProseOl.vue → components/content/List.vue} +2 -2
  21. package/components/content/NeedContribution.vue +23 -0
  22. package/components/content/ReadMore.vue +25 -0
  23. package/components/content/Sandbox.vue +102 -0
  24. package/components/content/TabsHeader.vue +44 -0
  25. package/components/content/Terminal.vue +64 -0
  26. package/components/content/VideoPlayer.vue +115 -0
  27. package/components/docs/DocsAside.vue +21 -0
  28. package/components/docs/DocsAsideTree.vue +102 -0
  29. package/components/docs/DocsHero.vue +39 -0
  30. package/components/docs/DocsPage.vue +22 -0
  31. package/components/docs/DocsPageContent.vue +31 -0
  32. package/components/docs/DocsToc.vue +74 -0
  33. package/components/globals/Icon.vue +24 -0
  34. package/{dist/runtime/app/components/prose/ProseHr.vue → components/globals/Logo.vue} +1 -1
  35. package/components/globals/NuxtImg.vue +45 -0
  36. package/components/globals/SocialIcons.vue +45 -0
  37. package/components/globals/ThemeSelect.vue +35 -0
  38. package/components/icons/IconAlgolia.vue +8 -0
  39. package/components/icons/IconArrowLeft.vue +10 -0
  40. package/components/icons/IconArrowRight.vue +10 -0
  41. package/components/icons/IconBadgeCheck.vue +14 -0
  42. package/components/icons/IconCheck.vue +10 -0
  43. package/components/icons/IconCheckCircle.vue +10 -0
  44. package/components/icons/IconChevronRight.vue +12 -0
  45. package/components/icons/IconClipboardCheck.vue +14 -0
  46. package/components/icons/IconClipboardCopy.vue +14 -0
  47. package/components/icons/IconCodeSandbox.vue +8 -0
  48. package/components/icons/IconCopy.vue +17 -0
  49. package/components/icons/IconDots.vue +10 -0
  50. package/components/icons/IconEdit.vue +18 -0
  51. package/components/icons/IconExclamationCircle.vue +12 -0
  52. package/components/icons/IconExclamationTriangle.vue +10 -0
  53. package/components/icons/IconExternalLink.vue +12 -0
  54. package/components/icons/IconGit.vue +7 -0
  55. package/components/icons/IconGitHub.vue +10 -0
  56. package/components/icons/IconHeart.vue +9 -0
  57. package/components/icons/IconInformationCircle.vue +10 -0
  58. package/components/icons/IconLighthouse.vue +83 -0
  59. package/components/icons/IconLine.vue +10 -0
  60. package/components/icons/IconMarkdown.vue +13 -0
  61. package/components/icons/IconMenu.vue +12 -0
  62. package/components/icons/IconMenuAlt.vue +10 -0
  63. package/components/icons/IconMinus.vue +10 -0
  64. package/components/icons/IconMoon.vue +10 -0
  65. package/components/icons/IconNuxt.vue +14 -0
  66. package/components/icons/IconNuxtContent.vue +20 -0
  67. package/components/icons/IconNuxtLabs.vue +21 -0
  68. package/components/icons/IconPlus.vue +10 -0
  69. package/components/icons/IconPuzzle.vue +8 -0
  70. package/components/icons/IconSSG.vue +7 -0
  71. package/components/icons/IconSearch.vue +12 -0
  72. package/components/icons/IconSun.vue +10 -0
  73. package/components/icons/IconTocBack.vue +21 -0
  74. package/components/icons/IconTocCurrent.vue +21 -0
  75. package/components/icons/IconTocNext.vue +8 -0
  76. package/components/icons/IconTranslate.vue +14 -0
  77. package/components/icons/IconTwitter.vue +8 -0
  78. package/components/icons/IconVite.vue +30 -0
  79. package/components/icons/IconVue.vue +6 -0
  80. package/components/icons/IconVueTelescope.vue +11 -0
  81. package/components/icons/IconWindi.vue +17 -0
  82. package/components/icons/IconX.vue +12 -0
  83. package/components/icons/IconXCircle.vue +10 -0
  84. package/components/icons/IconZap.vue +8 -0
  85. package/components/prose/ProseA.vue +66 -0
  86. package/components/prose/ProseBlockquote.vue +21 -0
  87. package/components/prose/ProseCode.vue +68 -0
  88. package/components/prose/ProseCodeInline.vue +38 -0
  89. package/components/prose/ProseEm.vue +11 -0
  90. package/components/prose/ProseH1.vue +22 -0
  91. package/components/prose/ProseH2.vue +22 -0
  92. package/components/prose/ProseH3.vue +24 -0
  93. package/components/prose/ProseH4.vue +24 -0
  94. package/components/prose/ProseHr.vue +13 -0
  95. package/components/prose/ProseImg.vue +30 -0
  96. package/components/prose/ProseLi.vue +31 -0
  97. package/components/prose/ProseOl.vue +16 -0
  98. package/components/prose/ProseP.vue +14 -0
  99. package/components/prose/ProseStrong.vue +14 -0
  100. package/components/prose/ProseTable.vue +13 -0
  101. package/{dist/runtime/app/components → components}/prose/ProseTbody.vue +0 -0
  102. package/components/prose/ProseTd.vue +11 -0
  103. package/components/prose/ProseTh.vue +11 -0
  104. package/components/prose/ProseThead.vue +11 -0
  105. package/components/prose/ProseTr.vue +11 -0
  106. package/components/prose/ProseUl.vue +15 -0
  107. package/composables/useContent.ts +156 -0
  108. package/composables/useMenu.ts +22 -0
  109. package/composables/useScrollToHeading.ts +35 -0
  110. package/composables/useScrollspy.ts +46 -0
  111. package/composables/useTheme.ts +12 -0
  112. package/layouts/default.vue +29 -0
  113. package/layouts/page.vue +11 -0
  114. package/nuxt.config.ts +151 -0
  115. package/package.json +46 -83
  116. package/pages/[...slug].vue +26 -0
  117. package/public/android-chrome-192x192.png +0 -0
  118. package/public/android-chrome-512x512.png +0 -0
  119. package/public/apple-touch-icon.png +0 -0
  120. package/public/favicon-16x16.png +0 -0
  121. package/public/favicon-32x32.png +0 -0
  122. package/public/favicon.ico +0 -0
  123. package/public/site.webmanifest +1 -0
  124. package/LICENSE +0 -21
  125. package/dist/index.cjs +0 -549
  126. package/dist/index.d.ts +0 -25
  127. package/dist/index.mjs +0 -523
  128. package/dist/runtime/app/components/DocusContent.vue +0 -215
  129. package/dist/runtime/app/components/DocusContent.vue.d.ts +0 -25
  130. package/dist/runtime/app/components/Error.vue +0 -19
  131. package/dist/runtime/app/components/Error.vue.d.ts +0 -9
  132. package/dist/runtime/app/components/Markdown.vue +0 -56
  133. package/dist/runtime/app/components/Markdown.vue.d.ts +0 -25
  134. package/dist/runtime/app/components/Page.vue +0 -29
  135. package/dist/runtime/app/components/Page.vue.d.ts +0 -2
  136. package/dist/runtime/app/components/Props.vue +0 -130
  137. package/dist/runtime/app/components/Props.vue.d.ts +0 -80
  138. package/dist/runtime/app/components/prose/ProseA.vue +0 -41
  139. package/dist/runtime/app/components/prose/ProseA.vue.d.ts +0 -23
  140. package/dist/runtime/app/components/prose/ProseBlockquote.vue +0 -5
  141. package/dist/runtime/app/components/prose/ProseCode.vue +0 -5
  142. package/dist/runtime/app/components/prose/ProseCodeInline.vue +0 -5
  143. package/dist/runtime/app/components/prose/ProseEm.vue +0 -5
  144. package/dist/runtime/app/components/prose/ProseH1.vue +0 -3
  145. package/dist/runtime/app/components/prose/ProseH2.vue +0 -3
  146. package/dist/runtime/app/components/prose/ProseH3.vue +0 -3
  147. package/dist/runtime/app/components/prose/ProseH4.vue +0 -3
  148. package/dist/runtime/app/components/prose/ProseH5.vue +0 -3
  149. package/dist/runtime/app/components/prose/ProseH6.vue +0 -3
  150. package/dist/runtime/app/components/prose/ProseImg.vue +0 -32
  151. package/dist/runtime/app/components/prose/ProseImg.vue.d.ts +0 -21
  152. package/dist/runtime/app/components/prose/ProseLi.vue +0 -3
  153. package/dist/runtime/app/components/prose/ProseParagraph.vue +0 -3
  154. package/dist/runtime/app/components/prose/ProseStrong.vue +0 -5
  155. package/dist/runtime/app/components/prose/ProseTable.vue +0 -5
  156. package/dist/runtime/app/components/prose/ProseTd.vue +0 -5
  157. package/dist/runtime/app/components/prose/ProseTh.vue +0 -5
  158. package/dist/runtime/app/components/prose/ProseThead.vue +0 -5
  159. package/dist/runtime/app/components/prose/ProseTr.vue +0 -5
  160. package/dist/runtime/app/components/prose/ProseUl.vue +0 -5
  161. package/dist/runtime/app/composables/helpers.d.ts +0 -4
  162. package/dist/runtime/app/composables/helpers.js +0 -66
  163. package/dist/runtime/app/composables/helpers.mjs +0 -40
  164. package/dist/runtime/app/composables/index.d.ts +0 -90
  165. package/dist/runtime/app/composables/index.js +0 -108
  166. package/dist/runtime/app/composables/index.mjs +0 -63
  167. package/dist/runtime/app/composables/navigation.d.ts +0 -37
  168. package/dist/runtime/app/composables/navigation.js +0 -227
  169. package/dist/runtime/app/composables/navigation.mjs +0 -148
  170. package/dist/runtime/app/composables/store.d.ts +0 -7
  171. package/dist/runtime/app/composables/store.js +0 -52
  172. package/dist/runtime/app/composables/store.mjs +0 -35
  173. package/dist/runtime/app/composables/style.d.ts +0 -11
  174. package/dist/runtime/app/composables/style.js +0 -117
  175. package/dist/runtime/app/composables/style.mjs +0 -71
  176. package/dist/runtime/app/composables/theme-colors.d.ts +0 -30
  177. package/dist/runtime/app/composables/theme-colors.js +0 -80
  178. package/dist/runtime/app/composables/theme-colors.mjs +0 -48
  179. package/dist/runtime/app/composables/websocket.d.ts +0 -3
  180. package/dist/runtime/app/composables/websocket.js +0 -79
  181. package/dist/runtime/app/composables/websocket.mjs +0 -63
  182. package/dist/runtime/app/layouts/default.vue +0 -5
  183. package/dist/runtime/app/layouts/error.vue +0 -33
  184. package/dist/runtime/app/layouts/error.vue.d.ts +0 -21
  185. package/dist/runtime/app/pages/_.vue +0 -222
  186. package/dist/runtime/app/pages/_.vue.d.ts +0 -2
  187. package/dist/runtime/context.d.ts +0 -1
  188. package/dist/runtime/context.js +0 -17
  189. package/dist/runtime/context.mjs +0 -5
  190. package/dist/runtime/database/Query.d.ts +0 -18
  191. package/dist/runtime/database/Query.js +0 -68
  192. package/dist/runtime/database/Query.mjs +0 -49
  193. package/dist/runtime/database/index.d.ts +0 -4
  194. package/dist/runtime/database/index.js +0 -45
  195. package/dist/runtime/database/index.mjs +0 -25
  196. package/dist/runtime/database/providers/local/Query.d.ts +0 -14
  197. package/dist/runtime/database/providers/local/Query.js +0 -85
  198. package/dist/runtime/database/providers/local/Query.mjs +0 -60
  199. package/dist/runtime/database/providers/local/index.d.ts +0 -3
  200. package/dist/runtime/database/providers/local/index.js +0 -63
  201. package/dist/runtime/database/providers/local/index.mjs +0 -39
  202. package/dist/runtime/database/providers/local/operations.d.ts +0 -2
  203. package/dist/runtime/database/providers/local/operations.js +0 -83
  204. package/dist/runtime/database/providers/local/operations.mjs +0 -53
  205. package/dist/runtime/database/providers/local/utils.d.ts +0 -8
  206. package/dist/runtime/database/providers/local/utils.js +0 -28
  207. package/dist/runtime/database/providers/local/utils.mjs +0 -17
  208. package/dist/runtime/index.d.ts +0 -3
  209. package/dist/runtime/index.js +0 -44
  210. package/dist/runtime/index.mjs +0 -3
  211. package/dist/runtime/navigation.d.ts +0 -4
  212. package/dist/runtime/navigation.js +0 -176
  213. package/dist/runtime/navigation.mjs +0 -137
  214. package/dist/runtime/server/api/get.d.ts +0 -10
  215. package/dist/runtime/server/api/get.js +0 -24
  216. package/dist/runtime/server/api/get.mjs +0 -13
  217. package/dist/runtime/server/api/list.d.ts +0 -9
  218. package/dist/runtime/server/api/list.js +0 -34
  219. package/dist/runtime/server/api/list.mjs +0 -18
  220. package/dist/runtime/server/api/navigation.d.ts +0 -7
  221. package/dist/runtime/server/api/navigation.js +0 -20
  222. package/dist/runtime/server/api/navigation.mjs +0 -10
  223. package/dist/runtime/server/api/preview.d.ts +0 -3
  224. package/dist/runtime/server/api/preview.js +0 -54
  225. package/dist/runtime/server/api/preview.mjs +0 -31
  226. package/dist/runtime/server/api/reload.d.ts +0 -6
  227. package/dist/runtime/server/api/reload.js +0 -27
  228. package/dist/runtime/server/api/reload.mjs +0 -11
  229. package/dist/runtime/server/api/search.d.ts +0 -6
  230. package/dist/runtime/server/api/search.js +0 -27
  231. package/dist/runtime/server/api/search.mjs +0 -13
  232. package/dist/runtime/server/content.d.ts +0 -46
  233. package/dist/runtime/server/content.js +0 -175
  234. package/dist/runtime/server/content.mjs +0 -114
  235. package/dist/runtime/server/socket.d.ts +0 -9
  236. package/dist/runtime/server/socket.js +0 -33
  237. package/dist/runtime/server/socket.mjs +0 -20
  238. package/dist/runtime/server/utils/cache.d.ts +0 -19
  239. package/dist/runtime/server/utils/cache.js +0 -110
  240. package/dist/runtime/server/utils/cache.mjs +0 -75
  241. package/dist/runtime/server/utils/index.d.ts +0 -4
  242. package/dist/runtime/server/utils/index.js +0 -18
  243. package/dist/runtime/server/utils/index.mjs +0 -8
  244. package/dist/runtime/transformers/index.d.ts +0 -1
  245. package/dist/runtime/transformers/index.js +0 -26
  246. package/dist/runtime/transformers/index.mjs +0 -11
  247. package/dist/runtime/transformers/json.d.ts +0 -3
  248. package/dist/runtime/transformers/json.js +0 -15
  249. package/dist/runtime/transformers/json.mjs +0 -5
  250. package/dist/runtime/transformers/markdown/index.d.ts +0 -8
  251. package/dist/runtime/transformers/markdown/index.js +0 -25
  252. package/dist/runtime/transformers/markdown/index.mjs +0 -16
  253. package/dist/runtime/transformers/utils/index.d.ts +0 -1
  254. package/dist/runtime/transformers/utils/index.js +0 -18
  255. package/dist/runtime/transformers/utils/index.mjs +0 -1
  256. package/dist/runtime/transformers/utils/path.d.ts +0 -26
  257. package/dist/runtime/transformers/utils/path.js +0 -88
  258. package/dist/runtime/transformers/utils/path.mjs +0 -56
  259. package/dist/runtime/utils/index.d.ts +0 -1
  260. package/dist/runtime/utils/index.js +0 -18
  261. package/dist/runtime/utils/index.mjs +0 -1
  262. package/dist/runtime/utils/log.d.ts +0 -1
  263. package/dist/runtime/utils/log.js +0 -14
  264. package/dist/runtime/utils/log.mjs +0 -2
  265. package/dist/runtime/utils/object.d.ts +0 -9
  266. package/dist/runtime/utils/object.js +0 -22
  267. package/dist/runtime/utils/object.mjs +0 -4
  268. package/dist/templates/content.mjs +0 -50
  269. package/dist/templates/docus.mjs +0 -13
  270. package/dist/templates/hot.mjs +0 -16
  271. package/dist/templates/i18n.mjs +0 -23
  272. package/dist/templates/options.mjs +0 -46
  273. package/shims.d.ts +0 -24
  274. package/types.d.ts +0 -397
@@ -0,0 +1,115 @@
1
+ <script lang="ts" setup>
2
+ import { ref } from '#imports'
3
+
4
+ const props = defineProps({
5
+ poster: {
6
+ type: String,
7
+ default: '',
8
+ },
9
+ src: {
10
+ type: String,
11
+ default: '',
12
+ },
13
+ sources: {
14
+ type: Array,
15
+ default: () => [],
16
+ },
17
+ })
18
+
19
+ const provider = ref(null)
20
+ const loaded = ref(false)
21
+
22
+ if (!props.src && !props.sources.length)
23
+ throw new Error('VideoPlayer: you need to provide either `src` or `sources` props')
24
+
25
+ const src = props.src || props.sources[0].src
26
+
27
+ if (src && src.includes('youtube.com/watch')) {
28
+ const match = src.match(/\?v=([^&]*)/)
29
+
30
+ provider.value = {
31
+ name: 'youtube',
32
+ src: `https://www.youtube-nocookie.com/embed/${match[1]}?autoplay=1`,
33
+ poster: props.poster || `https://i3.ytimg.com/vi/${match[1]}/hqdefault.jpg`,
34
+ }
35
+ }
36
+ </script>
37
+
38
+ <template>
39
+ <div class="video-player relative my-4 bg-black bg-opacity-25 rounded-sm overflow-hidden" :class="{ loaded }">
40
+ <NuxtImg
41
+ v-if="provider ? provider.poster : poster"
42
+ class="video absolute top-0 left-0 w-full h-full object-cover"
43
+ :src="provider ? provider.poster : poster"
44
+ :width="670"
45
+ :height="377"
46
+ />
47
+ <div v-if="loaded" class="video absolute top-0 left-0 w-full h-full">
48
+ <!-- remote videos -->
49
+ <video v-if="!provider" :poster="poster" controls autoplay>
50
+ <source v-if="src" :src="src">
51
+ <source v-for="source in sources" :key="source.src || source" :src="source.src || source" :type="source.type">
52
+ </video>
53
+ <!-- youtube -->
54
+ <iframe
55
+ v-else-if="provider.name === 'youtube'"
56
+ width="560"
57
+ height="377"
58
+ allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
59
+ allowfullscreen=""
60
+ class="w-full h-full"
61
+ :src="provider.src"
62
+ />
63
+ </div>
64
+ <div v-if="!loaded" class="overlay absolute top-0 left-0 w-full h-full cursor-pointer" @click="loaded = true">
65
+ <button class="play" />
66
+ </div>
67
+ </div>
68
+ </template>
69
+
70
+ <style scoped lang="postcss">
71
+ .video-player {
72
+ &:not(.loaded):before {
73
+ content: ' ';
74
+ display: block;
75
+ position: absolute;
76
+ top: 0;
77
+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==');
78
+ background-position: top;
79
+ background-repeat: repeat-x;
80
+ height: 60px;
81
+ padding-bottom: 50px;
82
+ width: 100%;
83
+ transition: all 0.2s cubic-bezier(0, 0, 0.2, 1);
84
+ z-index: 1;
85
+ }
86
+ &:after {
87
+ content: ' ';
88
+ display: block;
89
+ padding-bottom: 56.25%;
90
+ }
91
+
92
+ .play {
93
+ width: 68px;
94
+ height: 48px;
95
+ position: absolute;
96
+ cursor: pointer;
97
+ transform: translate3d(-50%, -50%, 0);
98
+ top: 50%;
99
+ left: 50%;
100
+ z-index: 1;
101
+ background-color: transparent;
102
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 68 48"><path fill="%23f00" fill-opacity="0.8" d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z"></path><path d="M 45,24 27,14 27,34" fill="%23fff"></path></svg>');
103
+ filter: grayscale(100%);
104
+ transition: filter 0.1s cubic-bezier(0, 0, 0.2, 1);
105
+ border: none;
106
+ }
107
+ &:hover .play {
108
+ filter: none;
109
+ }
110
+ }
111
+
112
+ video {
113
+ @apply w-full;
114
+ }
115
+ </style>
@@ -0,0 +1,21 @@
1
+ <script setup lang="ts">
2
+ import { computed, useContent } from '#imports'
3
+
4
+ const { navigation } = useContent()
5
+
6
+ const tree = computed(() => {
7
+ return navigation.value.filter(
8
+ (item) => {
9
+ if (item.slug === '/' || item.slug === '/templates')
10
+ return false
11
+ return true
12
+ },
13
+ )
14
+ })
15
+ </script>
16
+
17
+ <template>
18
+ <nav>
19
+ <DocsAsideTree :tree="tree" />
20
+ </nav>
21
+ </template>
@@ -0,0 +1,102 @@
1
+ <script setup lang="ts">
2
+ import type { PropType } from 'vue'
3
+ import { reactive, useRoute, useRouter, watch } from '#imports'
4
+
5
+ const props = defineProps({
6
+ tree: {
7
+ type: Array as PropType<any>,
8
+ default: () => [],
9
+ },
10
+ level: {
11
+ type: Number,
12
+ default: 0,
13
+ },
14
+ max: {
15
+ type: Number,
16
+ default: null,
17
+ },
18
+ })
19
+ const emit = defineEmits(['close', 'select'])
20
+
21
+ const route = useRoute()
22
+ const router = useRouter()
23
+
24
+ const isChildOpen = reactive({})
25
+
26
+ function isActive(link) {
27
+ return link.exact ? route.path === link.slug : route.path.startsWith(link.slug)
28
+ }
29
+
30
+ function onClick(link) {
31
+ if (link.children?.length) {
32
+ // Open dir when element is collapsible
33
+ openDir(link.slug)
34
+
35
+ // Select element for mobile nav
36
+ if (props.max !== null && props.level + 1 === props.max)
37
+ emit('select', link)
38
+ }
39
+ else {
40
+ router.push(link.slug)
41
+ emit('close')
42
+ }
43
+ }
44
+
45
+ function openDir(slug, force?) {
46
+ isChildOpen[slug] = force ? true : !isChildOpen[slug]
47
+ }
48
+
49
+ watch(
50
+ () => route.path,
51
+ () => {
52
+ const paths = route.path.split('/')
53
+ for (let i = paths.length - 1; i > 1; i--) {
54
+ paths.pop()
55
+ openDir(paths.join('/'), true)
56
+ }
57
+ },
58
+ { immediate: true },
59
+ )
60
+ </script>
61
+
62
+ <template>
63
+ <ul :class="{ 'pl-4': level > 1 }">
64
+ <li
65
+ v-for="(link, index) in tree"
66
+ :key="link.slug"
67
+ :class="{
68
+ 'border-l-2': level > 0,
69
+ 'border-primary-600': isActive(link),
70
+ 'border-primary-300 hover:border-primary-300': !isActive(link)
71
+ }"
72
+ >
73
+ <NuxtLink
74
+ class="block py-1.5 flex items-center justify-between focus:outline-none cursor-pointer font-semibold"
75
+ :exact="link.exact"
76
+ :class="{
77
+ 'pl-4': level > 0,
78
+ 'text-xl !text-primary': level === 0,
79
+ '!pt-0': level === 0 && index === 0,
80
+ 'text-secondary-active': isActive(link),
81
+ 'text-secondary text-secondary-hover': !isActive(link)
82
+ }"
83
+ @click.stop.prevent="onClick(link)"
84
+ >
85
+ <span>{{ link.title }}</span>
86
+
87
+ <Icon v-if="link.icon" :name="link.icon" class="w-5 h-5 u-text-gray-500" />
88
+ </NuxtLink>
89
+
90
+ <DocsAsideTree
91
+ v-if="link.children?.length && (max === null || ((level + 1) < max))"
92
+ v-show="isChildOpen[link.slug]"
93
+ :tree="link.children"
94
+ :level="level + 1"
95
+ :max="max"
96
+ class="py-2"
97
+ @select="link => $emit('select', link)"
98
+ @close="$emit('close')"
99
+ />
100
+ </li>
101
+ </ul>
102
+ </template>
@@ -0,0 +1,39 @@
1
+ <script setup lang="ts">
2
+ import type { PropType } from 'vue'
3
+
4
+ defineProps({
5
+ buttons: {
6
+ type: Array as PropType<{ label?: string; variant?: string; to?: string; size?: string; icon?: string }[]>,
7
+ default: () => [],
8
+ },
9
+ })
10
+ </script>
11
+
12
+ <template>
13
+ <div class="flex flex-col items-center justify-center pb-48 gap-y-8 pt-36 md:pt-44 lg:pb-56 lg:pt-36 ">
14
+ <div v-if="$slots.badge" class="flex gap-x-2">
15
+ <UBadge rounded label="Warning" />
16
+
17
+ <span class="u-text-gray-500">
18
+ <Markdown unwrap="p" :use="$slots.badge" />
19
+ </span>
20
+ </div>
21
+ <h1 v-if="$slots.title" class="font-bold text-7xl text-center mb-0 u-text-gray-900">
22
+ <Markdown unwrap="p" :use="$slots.title" />
23
+ </h1>
24
+ <p v-if="$slots.description" class="w-1/2 text-lg text-center u-text-gray-500">
25
+ <Markdown unwrap="p" :use="$slots.description" />
26
+ </p>
27
+ <div class="flex gap-x-8">
28
+ <UButton
29
+ v-for="button of buttons"
30
+ :key="button.label"
31
+ :size="button.size || 'xl'"
32
+ :variant="button.variant || 'transparent'"
33
+ :icon="button.icon || undefined"
34
+ :label="button.label || ''"
35
+ :to="button.to || '#'"
36
+ />
37
+ </div>
38
+ </div>
39
+ </template>
@@ -0,0 +1,22 @@
1
+ <template>
2
+ <div class="relative flex-1">
3
+ <slot name="header" />
4
+
5
+ <main class="relative pb-4 sm:pb-6 lg:py-8">
6
+ <Container padded>
7
+ <div class="grid grid-cols-10 gap-8 relative">
8
+ <aside
9
+ v-if="$slots.aside"
10
+ class="pb-8 overflow-x-hidden overflow-y-auto lg:pb-0 hidden lg:block lg:sticky lg:top-16 lg:pt-8 lg:-mt-8 lg:self-start col-span-2 lg:max-h-[calc(100vh-64px)]"
11
+ >
12
+ <slot name="aside" />
13
+ </aside>
14
+
15
+ <div class="relative" :class="{ 'col-span-10 lg:col-span-8': !!$slots.aside, 'col-span-10': !$slots.aside }">
16
+ <slot />
17
+ </div>
18
+ </div>
19
+ </Container>
20
+ </main>
21
+ </div>
22
+ </template>
@@ -0,0 +1,31 @@
1
+ <script setup lang="ts">
2
+ import { ref, useContent } from '#imports'
3
+
4
+ const { page } = useContent()
5
+
6
+ const isOpen = ref(false)
7
+ </script>
8
+
9
+ <template>
10
+ <div class="flex flex-col-reverse lg:grid lg:grid-cols-10 gap-8 relative">
11
+ <div
12
+ class="col-span-10 lg:col-span-8"
13
+ >
14
+ <slot />
15
+ </div>
16
+
17
+ <div
18
+ class="lg:col-span-2 lg:self-start overflow-x-hidden sticky top-16 -mx-4 sm:-mx-6 px-4 sm:px-6 lg:mx-0 lg:px-0 lg:pt-8 lg:-mt-8 backdrop-blur-md lg:max-h-[calc(100vh-64px)]"
19
+ >
20
+ <div class="py-4 lg:py-0">
21
+ <button class="flex lg:hidden items-center gap-3" @click="isOpen = !isOpen">
22
+ <span class="u-text-gray-900 font-semibold text-sm">Table of Contents</span>
23
+
24
+ <Icon name="heroicons-outline:chevron-right" class="w-4 h-4 u-text-gray-400 transition-transform duration-100 transform" :class="[isOpen ? 'rotate-90' : 'rotate-0']" />
25
+ </button>
26
+
27
+ <DocsToc class="mt-4 lg:mt-0" :class="[isOpen ? 'lg:block' : 'hidden lg:block']" />
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </template>
@@ -0,0 +1,74 @@
1
+ <script setup lang="ts">
2
+ import { useContent, useRoute, useScrollToHeading, useScrollspy, watch } from '#imports'
3
+
4
+ const route = useRoute()
5
+
6
+ const { activeHeadings, updateHeadings } = useScrollspy()
7
+
8
+ const { toc, prev, next } = useContent()
9
+
10
+ watch(
11
+ () => route.path,
12
+ () => {
13
+ if (process.client) {
14
+ setTimeout(() => {
15
+ updateHeadings([
16
+ ...document.querySelectorAll('.prose h1'),
17
+ ...document.querySelectorAll('.prose h2'),
18
+ ...document.querySelectorAll('.prose h3'),
19
+ ])
20
+ }, 1000)
21
+ }
22
+ }, {
23
+ immediate: true,
24
+ })
25
+
26
+ function scrollToHeading(id: string, scrollMarginCssVar: string) {
27
+ useScrollToHeading(id, scrollMarginCssVar)
28
+ }
29
+ </script>
30
+
31
+ <template>
32
+ <div class="space-y-2">
33
+ <NuxtLink v-if="prev" :to="prev.slug" class="flex lg:flex-row-reverse items-center text-primary font-semibold group gap-x-3">
34
+ <div class="flex-shrink-0 p-1 rounded-md text-secondary-group-hover transition-base">
35
+ <Icon name="heroicons-solid:chevron-double-left" class="w-6 h-6" />
36
+ </div>
37
+
38
+ <span>Previous page</span>
39
+ </NuxtLink>
40
+
41
+ <template v-if="toc.length">
42
+ <div class="flex lg:flex-row-reverse items-center font-semibold gap-x-3">
43
+ <div class="flex-shrink-0 p-1 rounded-md">
44
+ <Icon name="heroicons-outline:view-grid" class="w-6 h-6" />
45
+ </div>
46
+
47
+ <span>On this page</span>
48
+ </div>
49
+
50
+ <ul class="pl-3 lg:pr-3 mr-1">
51
+ <li v-for="link in toc" :key="link.text" class="group border-l-2 lg:border-r-2 lg:border-l-0 min-w-0 lg:text-right" :class="activeHeadings.includes(link.id) ? 'u-border-gray-900' : 'u-border-gray-300'">
52
+ <a
53
+ :href="`#${link.id}`"
54
+ class="text-secondary text-secondary-group-hover py-1 pl-3 lg:pr-3 block truncate"
55
+ :class="{
56
+ 'text-primary-500 dark:text-primary-400': activeHeadings.includes(link.id),
57
+ }"
58
+ @click.prevent="scrollToHeading(link.id, '--docs-scroll-margin-block')"
59
+ >
60
+ {{ link.text }}
61
+ </a>
62
+ </li>
63
+ </ul>
64
+ </template>
65
+
66
+ <NuxtLink v-if="next" :to="next.slug" class="flex lg:flex-row-reverse items-center text-primary font-semibold group gap-x-3">
67
+ <div class="flex-shrink-0 p-1 rounded-md text-secondary-group-hover transition-base">
68
+ <Icon name="heroicons-solid:chevron-double-right" class="w-6 h-6" />
69
+ </div>
70
+
71
+ <span>Next page</span>
72
+ </NuxtLink>
73
+ </div>
74
+ </template>
@@ -0,0 +1,24 @@
1
+ <script setup>
2
+ import { Icon } from '@iconify/vue/dist/offline'
3
+ import { loadIcon } from '@iconify/vue'
4
+ import { ref, watch } from '#imports'
5
+
6
+ const props = defineProps({
7
+ name: {
8
+ type: [String, Object],
9
+ required: true,
10
+ },
11
+ })
12
+
13
+ const icon = ref(null)
14
+
15
+ icon.value = await loadIcon(props.name)
16
+
17
+ watch(() => props.name, async() => {
18
+ icon.value = await loadIcon(props.name)
19
+ })
20
+ </script>
21
+
22
+ <template>
23
+ <Icon :icon="icon" />
24
+ </template>
@@ -1,3 +1,3 @@
1
1
  <template>
2
- <hr />
2
+ <IconNuxt />
3
3
  </template>
@@ -0,0 +1,45 @@
1
+ <script setup lang="ts">
2
+ import type { PropType } from 'vue'
3
+
4
+ import { computed, useColorMode } from '#imports'
5
+
6
+ export interface NuxtImg {
7
+ light: string
8
+ dark: string
9
+ }
10
+
11
+ const props = defineProps({
12
+ src: {
13
+ type: [String, Object] as PropType<NuxtImg>,
14
+ default: null,
15
+ },
16
+ })
17
+
18
+ const colorMode = useColorMode()
19
+
20
+ const src = computed(
21
+ () => {
22
+ let src = props.src
23
+
24
+ try {
25
+ src = JSON.parse(src as any)
26
+ }
27
+ catch (e) {
28
+ src = props.src
29
+ }
30
+
31
+ if (typeof src === 'string')
32
+ return props.src
33
+
34
+ if (colorMode.value === 'dark')
35
+ return props.src.dark || props.src.light
36
+
37
+ if (colorMode.value === 'light')
38
+ return props.src.light || props.src.light
39
+ },
40
+ )
41
+ </script>
42
+
43
+ <template>
44
+ <img :src="src">
45
+ </template>
@@ -0,0 +1,45 @@
1
+ <script setup lang="ts">
2
+ import { useTheme } from '#imports'
3
+
4
+ defineProps({
5
+ size: {
6
+ type: String,
7
+ default: 'w-6 h-6',
8
+ },
9
+ padding: {
10
+ type: String,
11
+ default: 'p-0',
12
+ },
13
+ })
14
+
15
+ const theme = useTheme()
16
+ </script>
17
+
18
+ <template>
19
+ <div class="flex">
20
+ <a
21
+ v-if="theme.twitter"
22
+ :href="`https://twitter.com/${theme.twitter}`"
23
+ target="_blank"
24
+ rel="noopener noreferrer"
25
+ title="Twitter"
26
+ name="Twitter"
27
+ class="icon-base"
28
+ :class="[padding]"
29
+ >
30
+ <IconTwitter :class="size" />
31
+ </a>
32
+ <a
33
+ v-if="theme.github"
34
+ :href="`https://github.com/${theme.github}`"
35
+ target="_blank"
36
+ rel="noopener noreferrer"
37
+ title="GitHub"
38
+ name="GitHub"
39
+ class="icon-base"
40
+ :class="[padding]"
41
+ >
42
+ <IconGitHub :class="size" />
43
+ </a>
44
+ </div>
45
+ </template>
@@ -0,0 +1,35 @@
1
+ <script setup lang="ts">
2
+ import { computed, useColorMode } from '#imports'
3
+
4
+ const colorMode = useColorMode()
5
+
6
+ type ColorMode = 'light' | 'dark'
7
+
8
+ const mode = computed<ColorMode>({
9
+ get() {
10
+ return colorMode.value as ColorMode
11
+ },
12
+ set(v: ColorMode) {
13
+ colorMode.preference = v
14
+ },
15
+ })
16
+
17
+ const onClick = () => (mode.value === 'light' ? (mode.value = 'dark') : (mode.value = 'light'))
18
+ </script>
19
+
20
+ <template>
21
+ <button
22
+ class="icon-base w-6 h-6"
23
+ aria-label="Color Mode"
24
+ @click="onClick"
25
+ >
26
+ <ClientOnly>
27
+ <IconSun v-if="mode === 'dark'" />
28
+ <IconMoon v-else />
29
+
30
+ <template #placeholder>
31
+ ...
32
+ </template>
33
+ </ClientOnly>
34
+ </button>
35
+ </template>
@@ -0,0 +1,8 @@
1
+ <template>
2
+ <svg aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
3
+ <path
4
+ fill="currentColor"
5
+ d="M229.3 182.6c-49.3 0-89.2 39.9-89.2 89.2 0 49.3 39.9 89.2 89.2 89.2s89.2-39.9 89.2-89.2c0-49.3-40-89.2-89.2-89.2zm62.7 56.6l-58.9 30.6c-1.8.9-3.8-.4-3.8-2.3V201c0-1.5 1.3-2.7 2.7-2.6 26.2 1 48.9 15.7 61.1 37.1.7 1.3.2 3-1.1 3.7zM389.1 32H58.9C26.4 32 0 58.4 0 90.9V421c0 32.6 26.4 59 58.9 59H389c32.6 0 58.9-26.4 58.9-58.9V90.9C448 58.4 421.6 32 389.1 32zm-202.6 84.7c0-10.8 8.7-19.5 19.5-19.5h45.3c10.8 0 19.5 8.7 19.5 19.5v15.4c0 1.8-1.7 3-3.3 2.5-12.3-3.4-25.1-5.1-38.1-5.1-13.5 0-26.7 1.8-39.4 5.5-1.7.5-3.4-.8-3.4-2.5v-15.8zm-84.4 37l9.2-9.2c7.6-7.6 19.9-7.6 27.5 0l7.7 7.7c1.1 1.1 1 3-.3 4-6.2 4.5-12.1 9.4-17.6 14.9-5.4 5.4-10.4 11.3-14.8 17.4-1 1.3-2.9 1.5-4 .3l-7.7-7.7c-7.6-7.5-7.6-19.8 0-27.4zm127.2 244.8c-70 0-126.6-56.7-126.6-126.6s56.7-126.6 126.6-126.6c70 0 126.6 56.6 126.6 126.6 0 69.8-56.7 126.6-126.6 126.6z"
6
+ />
7
+ </svg>
8
+ </template>
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
3
+ <path
4
+ d="M6.85355 3.14645C7.04882 3.34171 7.04882 3.65829 6.85355 3.85355L3.70711 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H3.70711L6.85355 11.1464C7.04882 11.3417 7.04882 11.6583 6.85355 11.8536C6.65829 12.0488 6.34171 12.0488 6.14645 11.8536L2.14645 7.85355C1.95118 7.65829 1.95118 7.34171 2.14645 7.14645L6.14645 3.14645C6.34171 2.95118 6.65829 2.95118 6.85355 3.14645Z"
5
+ fill="currentColor"
6
+ fill-rule="evenodd"
7
+ clip-rule="evenodd"
8
+ />
9
+ </svg>
10
+ </template>
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
3
+ <path
4
+ d="M8.14645 3.14645C8.34171 2.95118 8.65829 2.95118 8.85355 3.14645L12.8536 7.14645C13.0488 7.34171 13.0488 7.65829 12.8536 7.85355L8.85355 11.8536C8.65829 12.0488 8.34171 12.0488 8.14645 11.8536C7.95118 11.6583 7.95118 11.3417 8.14645 11.1464L11.2929 8H2.5C2.22386 8 2 7.77614 2 7.5C2 7.22386 2.22386 7 2.5 7H11.2929L8.14645 3.85355C7.95118 3.65829 7.95118 3.34171 8.14645 3.14645Z"
5
+ fill="currentColor"
6
+ fill-rule="evenodd"
7
+ clip-rule="evenodd"
8
+ />
9
+ </svg>
10
+ </template>
@@ -0,0 +1,14 @@
1
+ <template>
2
+ <svg
3
+ fill="none"
4
+ stroke-linecap="round"
5
+ stroke-linejoin="round"
6
+ stroke-width="2"
7
+ viewBox="0 0 24 24"
8
+ stroke="currentColor"
9
+ >
10
+ <path
11
+ d="M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z"
12
+ />
13
+ </svg>
14
+ </template>
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
3
+ <path
4
+ d="M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z"
5
+ fill="currentColor"
6
+ fill-rule="evenodd"
7
+ clip-rule="evenodd"
8
+ />
9
+ </svg>
10
+ </template>
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
3
+ <path
4
+ d="M7.49991 0.877045C3.84222 0.877045 0.877075 3.84219 0.877075 7.49988C0.877075 11.1575 3.84222 14.1227 7.49991 14.1227C11.1576 14.1227 14.1227 11.1575 14.1227 7.49988C14.1227 3.84219 11.1576 0.877045 7.49991 0.877045ZM1.82708 7.49988C1.82708 4.36686 4.36689 1.82704 7.49991 1.82704C10.6329 1.82704 13.1727 4.36686 13.1727 7.49988C13.1727 10.6329 10.6329 13.1727 7.49991 13.1727C4.36689 13.1727 1.82708 10.6329 1.82708 7.49988ZM10.1589 5.53774C10.3178 5.31191 10.2636 5.00001 10.0378 4.84109C9.81194 4.68217 9.50004 4.73642 9.34112 4.96225L6.51977 8.97154L5.35681 7.78706C5.16334 7.59002 4.84677 7.58711 4.64973 7.78058C4.45268 7.97404 4.44978 8.29061 4.64325 8.48765L6.22658 10.1003C6.33054 10.2062 6.47617 10.2604 6.62407 10.2483C6.77197 10.2363 6.90686 10.1591 6.99226 10.0377L10.1589 5.53774Z"
5
+ fill="currentColor"
6
+ fill-rule="evenodd"
7
+ clip-rule="evenodd"
8
+ />
9
+ </svg>
10
+ </template>
@@ -0,0 +1,12 @@
1
+ <template>
2
+ <svg
3
+ fill="none"
4
+ stroke-linecap="round"
5
+ stroke-linejoin="round"
6
+ stroke-width="2"
7
+ viewBox="0 0 24 24"
8
+ stroke="currentColor"
9
+ >
10
+ <path d="M9 5l7 7-7 7" />
11
+ </svg>
12
+ </template>
@@ -0,0 +1,14 @@
1
+ <template>
2
+ <svg
3
+ fill="none"
4
+ stroke-linecap="round"
5
+ stroke-linejoin="round"
6
+ stroke-width="2"
7
+ viewBox="0 0 24 24"
8
+ stroke="currentColor"
9
+ >
10
+ <path
11
+ d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"
12
+ />
13
+ </svg>
14
+ </template>