docus 3.0.0-beta.1 → 3.0.0-beta.4

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.
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { classNames, computed } from '#imports'
3
+
2
4
  const props = defineProps({
3
5
  padded: {
4
6
  type: Boolean,
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { computed, useTheme } from '#imports'
3
+
2
4
  const { footer } = useTheme()
3
5
 
4
6
  const icons = computed(() => footer?.icons || [])
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { computed, useTheme } from '#imports'
3
+
2
4
  const theme = useTheme()
3
5
  const hasLogo = computed(() => theme.header.logo)
4
6
  const hasTitle = computed(() => theme.header.title)
@@ -1,5 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { hasProtocol } from 'ufo'
3
+ import { computed } from '#imports'
3
4
 
4
5
  const props = defineProps({
5
6
  href: {
@@ -1,5 +1,6 @@
1
1
  <script lang="ts">
2
2
  import TabsHeader from './TabsHeader.vue'
3
+ import { defineComponent } from '#imports'
3
4
 
4
5
  const isTag = (slot: any, tag: string) => {
5
6
  return slot.type && slot.type.tag && slot.type.tag === tag
@@ -1,5 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import Clipboard from 'clipboard'
3
+ import { onMounted, ref } from '#imports'
3
4
 
4
5
  const copy = ref()
5
6
  const state = ref('init')
@@ -1,5 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { splitByCase, upperFirst } from 'scule'
3
+ import { computed } from '#imports'
3
4
 
4
5
  const props = defineProps({
5
6
  link: {
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { computed, onMounted, ref, useColorMode } from '#imports'
3
+
2
4
  const props = defineProps({
3
5
  src: {
4
6
  type: String,
@@ -1,40 +1,34 @@
1
- <script>
1
+ <script setup lang="ts">
2
2
  import Clipboard from 'clipboard'
3
+ import { nextTick, onMounted, ref } from '#imports'
3
4
 
4
- export default defineComponent({
5
- props: {
6
- snippet: {
7
- type: String,
8
- required: true,
9
- },
5
+ const props = defineProps({
6
+ snippet: {
7
+ type: String,
8
+ required: true,
10
9
  },
11
- setup() {
12
- const copyInstall = ref()
13
- const copied = ref(false)
10
+ })
14
11
 
15
- const setupCopyInstall = () => {
16
- if (!copyInstall.value)
17
- return nextTick(setupCopyInstall)
12
+ const copyInstall = ref()
13
+ const copied = ref(false)
18
14
 
19
- const instance = new Clipboard(copyInstall.value)
15
+ const setupCopyInstall = () => {
16
+ if (!copyInstall.value)
17
+ return nextTick(setupCopyInstall)
20
18
 
21
- instance.on('success', () => {
22
- copied.value = true
19
+ const instance = new Clipboard(copyInstall.value)
23
20
 
24
- setTimeout(() => {
25
- copied.value = false
26
- }, 1000)
27
- })
28
- }
21
+ instance.on('success', () => {
22
+ copied.value = true
29
23
 
30
- onMounted(() => setupCopyInstall())
24
+ setTimeout(() => {
25
+ copied.value = false
26
+ }, 1000)
27
+ })
28
+ }
29
+
30
+ onMounted(() => setupCopyInstall())
31
31
 
32
- return {
33
- copyInstall,
34
- copied,
35
- }
36
- },
37
- })
38
32
  </script>
39
33
 
40
34
  <template>
@@ -1,4 +1,6 @@
1
1
  <script lang="ts" setup>
2
+ import { ref } from '#imports'
3
+
2
4
  const props = defineProps({
3
5
  poster: {
4
6
  type: String,
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { computed, useContent } from '#imports'
3
+
2
4
  const { navigation } = useContent()
3
5
 
4
6
  const tree = computed(() => {
@@ -1,5 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import type { PropType } from 'vue'
3
+ import { reactive, useRoute, useRouter, watch } from '#imports'
3
4
 
4
5
  const props = defineProps({
5
6
  tree: {
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { ref, useContent } from '#imports'
3
+
2
4
  const { page } = useContent()
3
5
 
4
6
  const isOpen = ref(false)
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { useContent, useRoute, useScrollToHeading, useScrollspy, watch } from '#imports'
3
+
2
4
  const route = useRoute()
3
5
 
4
6
  const { activeHeadings, updateHeadings } = useScrollspy()
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
- import { ref, watch } from 'vue'
3
2
  import { Icon } from '@iconify/vue/dist/offline'
4
3
  import { loadIcon } from '@iconify/vue'
4
+ import { ref, watch } from '#imports'
5
5
 
6
6
  const props = defineProps({
7
7
  name: {
@@ -1,6 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import type { PropType } from 'vue'
3
3
 
4
+ import { computed, useColorMode } from '#imports'
5
+
4
6
  export interface NuxtImg {
5
7
  light: string
6
8
  dark: string
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { useTheme } from '#imports'
3
+
2
4
  defineProps({
3
5
  size: {
4
6
  type: String,
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { computed, useColorMode } from '#imports'
3
+
2
4
  const colorMode = useColorMode()
3
5
 
4
6
  type ColorMode = 'light' | 'dark'
@@ -12,9 +14,7 @@ const mode = computed<ColorMode>({
12
14
  },
13
15
  })
14
16
 
15
- const onClick = () => {
16
- mode.value === 'light' ? (mode.value = 'dark') : (mode.value = 'light')
17
- }
17
+ const onClick = () => (mode.value === 'light' ? (mode.value = 'dark') : (mode.value = 'light'))
18
18
  </script>
19
19
 
20
20
  <template>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <hr />
2
+ <hr>
3
3
  </template>
4
4
 
5
5
  <style lang="postcss" scoped>
@@ -1,24 +1,22 @@
1
- <script>
2
- export default {
3
- props: {
4
- src: {
5
- type: String,
6
- default: '',
7
- },
8
- alt: {
9
- type: String,
10
- default: '',
11
- },
12
- width: {
13
- type: [String, Number],
14
- default: undefined,
15
- },
16
- height: {
17
- type: [String, Number],
18
- default: undefined,
19
- },
1
+ <script setup lang="ts">
2
+ defineProps({
3
+ src: {
4
+ type: String,
5
+ default: '',
20
6
  },
21
- }
7
+ alt: {
8
+ type: String,
9
+ default: '',
10
+ },
11
+ width: {
12
+ type: [String, Number],
13
+ default: undefined,
14
+ },
15
+ height: {
16
+ type: [String, Number],
17
+ default: undefined,
18
+ },
19
+ })
22
20
  </script>
23
21
 
24
22
  <template>
@@ -1,5 +1,6 @@
1
1
  import { withoutTrailingSlash } from 'ufo'
2
2
  import type { NavItem, ParsedContent } from '@nuxt/content/dist/runtime/types'
3
+ import { computed, fetchContentNavigation, onBeforeUnmount, onMounted, queryContent, useNuxtApp, useRoute, useState } from '#imports'
3
4
 
4
5
  let closeHook
5
6
 
@@ -1,3 +1,5 @@
1
+ import { useState } from '#imports'
2
+
1
3
  export const useMenu = () => {
2
4
  // Menu visible reference
3
5
  const visible = useState('menu-visible', () => false)
@@ -1,4 +1,5 @@
1
1
  import type { Ref } from 'vue'
2
+ import { onBeforeMount, onBeforeUnmount, ref, watch } from '#imports'
2
3
 
3
4
  /**
4
5
  * Scrollspy allows you to watch visible headings in a specific page.
@@ -1,3 +1,5 @@
1
+ import { useRuntimeConfig } from '#imports'
2
+
1
3
  export const useTheme = () => {
2
4
  const { theme } = useRuntimeConfig()
3
5
 
@@ -1,4 +1,6 @@
1
1
  <script setup>
2
+ import { useContent } from '#imports'
3
+
2
4
  const { page, fetchNavigation } = useContent()
3
5
 
4
6
  await fetchNavigation()
package/nuxt.config.ts CHANGED
@@ -100,7 +100,7 @@ export default defineNuxtConfig({
100
100
  ],
101
101
  tailwindcss: {
102
102
  viewer: false,
103
-
103
+ cssPath: resolveThemeDir('assets/css/tailwind.css'),
104
104
  config: {
105
105
  darkMode: 'class',
106
106
  theme: {
@@ -121,12 +121,12 @@ export default defineNuxtConfig({
121
121
  require('@tailwindcss/aspect-ratio'),
122
122
  ],
123
123
  content: [
124
+ resolveThemeDir('assets/**/*.{mjs,vue,js,ts}'),
124
125
  resolveThemeDir('components/**/*.{mjs,vue,js,ts}'),
125
126
  resolveThemeDir('layouts/**/*.{mjs,vue,js,ts}'),
126
127
  resolveThemeDir('pages/**/*.{mjs,vue,js,ts}'),
127
128
  ],
128
129
  safelist: [24, 36, 48, 60, 72, 84, 96, 108, 120].map(number => `pl-[${number}px]`),
129
- cssPath: resolveThemeDir('assets/css/tailwind.css'),
130
130
  },
131
131
  },
132
132
  content: {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.0.0-beta.1",
2
+ "version": "3.0.0-beta.4",
3
3
  "name": "docus",
4
4
  "scripts": {
5
5
  "build": "nuxi build",
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { useContent, useRouter } from '#imports'
3
+
2
4
  const router = useRouter()
3
5
 
4
6
  const { page, fetchPage } = useContent()