daisy-ui-kit 1.0.7 → 2.0.0
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/components/Accordion.vue +16 -0
- package/components/Alert.vue +6 -8
- package/components/Artboard.vue +1 -1
- package/components/Avatar.vue +8 -23
- package/components/Badge.vue +5 -0
- package/components/BottomNav.vue +2 -4
- package/components/Button.vue +12 -4
- package/components/Card.vue +1 -1
- package/components/Chat.vue +27 -0
- package/components/ChatBubble.vue +34 -0
- package/components/ChatFooter.vue +5 -0
- package/components/ChatHeader.vue +5 -0
- package/components/ChatImage.vue +5 -0
- package/components/Checkbox.vue +12 -4
- package/components/Code.vue +2 -1
- package/components/CodeWrapper.vue +2 -2
- package/components/Collapse.vue +30 -8
- package/components/CountdownTimers.vue +8 -3
- package/components/Divider.vue +1 -1
- package/components/Drawer.vue +35 -11
- package/components/DrawerContent.vue +15 -0
- package/components/DrawerSide.vue +16 -0
- package/components/Dropdown.vue +56 -7
- package/components/DropdownContent.vue +3 -1
- package/components/DropdownTarget.vue +5 -0
- package/components/FileInput.vue +60 -0
- package/components/Flex.vue +3 -89
- package/components/FlexItem.vue +4 -90
- package/components/Footer.vue +1 -1
- package/components/FooterTitle.vue +1 -2
- package/components/Home/AlternatingFeatureSections.vue +10 -12
- package/components/Home/BitoviConsulting.vue +1 -1
- package/components/Home/BitoviOpenSource.vue +5 -5
- package/components/Home/Footer.vue +7 -6
- package/components/Home/GradientFeatureSections.vue +9 -9
- package/components/Home/Header.vue +10 -16
- package/components/Home/Hero.vue +4 -4
- package/components/Home/Testimonial.vue +1 -1
- package/components/{ButtonGroup.vue → Join.vue} +1 -1
- package/components/Link.vue +13 -6
- package/components/LoadingBall.vue +41 -0
- package/components/LoadingBars.vue +41 -0
- package/components/LoadingDots.vue +41 -0
- package/components/LoadingInfinity.vue +41 -0
- package/components/LoadingRing.vue +41 -0
- package/components/LoadingSpinner.vue +41 -0
- package/components/Mask.config.ts +2 -2
- package/components/Menu.vue +14 -6
- package/components/MenuItem.vue +11 -3
- package/components/MenuTitle.vue +1 -10
- package/components/Modal.vue +28 -7
- package/components/Progress.vue +1 -2
- package/components/Prose.vue +6 -8
- package/components/Radio.vue +14 -2
- package/components/RadioGroup.vue +5 -0
- package/components/Range.vue +14 -2
- package/components/RangeMeasure.vue +23 -11
- package/components/RangeMeasureTick.vue +19 -7
- package/components/Rating.vue +52 -36
- package/components/Select.vue +14 -14
- package/components/Step.vue +2 -2
- package/components/Tab.vue +3 -4
- package/components/TabContent.vue +1 -1
- package/components/Tabs.vue +2 -2
- package/components/Text.vue +4 -1
- package/components/TextArea.vue +13 -1
- package/components/TextInput.vue +5 -2
- package/components/Toggle.vue +13 -1
- package/components/content/Badge.ts +3 -0
- package/components/content/ColorBadge.vue +24 -0
- package/components/{DemoExample.vue → content/DemoExample.vue} +1 -1
- package/components/content/DemoExampleResponsive.vue +59 -0
- package/components/content/IframeRenderer.ts +53 -0
- package/components/content/Indent.vue +3 -0
- package/components/content/LocalLinks.vue +31 -0
- package/components/content/NotFound.vue +42 -0
- package/components/content/PageNext.vue +24 -0
- package/components/content/PagePrevious.vue +24 -0
- package/components/content/PrevNext.vue +40 -0
- package/components/content/ProseA.vue +19 -0
- package/components/content/ProseAlert.vue +11 -0
- package/components/content/ProseBlockquote.vue +5 -0
- package/components/content/ProseCode.vue +62 -0
- package/components/content/ProseCodeInline.vue +3 -0
- package/components/content/ProseEm.vue +5 -0
- package/components/content/ProseH1.vue +16 -0
- package/components/content/ProseH2.vue +16 -0
- package/components/content/ProseH3.vue +16 -0
- package/components/content/ProseH4.vue +16 -0
- package/components/content/ProseH5.vue +16 -0
- package/components/content/ProseH6.vue +16 -0
- package/components/content/ProseHr.vue +3 -0
- package/components/content/ProseImg.vue +34 -0
- package/components/content/ProseLi.vue +3 -0
- package/components/content/ProseOl.vue +5 -0
- package/components/content/ProseP.vue +3 -0
- package/components/content/ProseStrong.vue +5 -0
- package/components/content/ProseTable.vue +7 -0
- package/components/content/ProseTbody.vue +5 -0
- package/components/content/ProseTd.vue +5 -0
- package/components/content/ProseTh.vue +5 -0
- package/components/content/ProseThead.vue +5 -0
- package/components/content/ProseTr.vue +5 -0
- package/components/content/ProseUl.vue +5 -0
- package/components/content/Search.vue +160 -0
- package/components/content/Sidebar.vue +65 -0
- package/components/{SidebarMenuSection.vue → content/SidebarMenuSection.vue} +11 -6
- package/components/content/TableOfContents.vue +80 -0
- package/components/content/TypeBadge.vue +17 -0
- package/components/theme/Picker.vue +2 -2
- package/components/theme/Preview.vue +1 -1
- package/components/theme/theme-utils.ts +15 -4
- package/index.ts +105 -96
- package/package.json +27 -24
- package/components/-utils.ts +0 -41
- package/components/Button.config.ts +0 -26
- package/components/DemoElement.vue +0 -32
- package/components/DrawerLayout.vue +0 -37
- package/components/DrawerLayoutContent.vue +0 -19
- package/components/InputGroup.vue +0 -33
- package/components/MobileSidebar.vue +0 -88
- package/components/ModalWrapper.vue +0 -32
- package/components/Sidebar.vue +0 -89
- package/components/drawer-utils.ts +0 -10
- package/components/fixtures.ts +0 -62
- package/components/types.ts +0 -7
- /package/components/{CodePreview.vue → content/CodePreview.vue} +0 -0
- /package/components/{SigninForm.vue → content/SigninForm.vue} +0 -0
- /package/components/{UserMenu.vue → content/UserMenu.vue} +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { createApp, h, onMounted, ref } from 'vue'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
name: 'RenderToIFrame',
|
|
5
|
+
props: {
|
|
6
|
+
classes: { type: String },
|
|
7
|
+
iframeClasses: { type: String },
|
|
8
|
+
theme: { type: String },
|
|
9
|
+
},
|
|
10
|
+
setup(props: any, { slots }: any) {
|
|
11
|
+
const iframeRef = ref()
|
|
12
|
+
const iframeBody = ref()
|
|
13
|
+
const iframeHead = ref()
|
|
14
|
+
const iframeStyle = ref()
|
|
15
|
+
|
|
16
|
+
onMounted(() => {
|
|
17
|
+
iframeBody.value = iframeRef.value.contentDocument.body
|
|
18
|
+
iframeHead.value = iframeRef.value.contentDocument.head
|
|
19
|
+
const el = document.createElement('div')
|
|
20
|
+
iframeBody.value.appendChild(el)
|
|
21
|
+
iframeStyle.value = document.createElement('style')
|
|
22
|
+
iframeStyle.value.innerHTML = props.css
|
|
23
|
+
iframeHead.value.appendChild(iframeStyle.value)
|
|
24
|
+
|
|
25
|
+
createApp({
|
|
26
|
+
name: 'IframeRender',
|
|
27
|
+
setup() {
|
|
28
|
+
const script = iframeRef.value.contentDocument.createElement('script')
|
|
29
|
+
script.type = 'text/javascript'
|
|
30
|
+
// create dynamic script
|
|
31
|
+
script.text = `const oHead = document.getElementsByTagName('head')[0]
|
|
32
|
+
const arrStyleSheets = parent.document.getElementsByTagName('style')
|
|
33
|
+
for (let i = 0; i < arrStyleSheets.length; i++)
|
|
34
|
+
oHead.appendChild(arrStyleSheets[i].cloneNode(true))
|
|
35
|
+
`
|
|
36
|
+
|
|
37
|
+
if (props.iframeClasses.length)
|
|
38
|
+
iframeRef.value.classList.add(props.iframeClasses)
|
|
39
|
+
iframeBody.value.classList.add('p-6')
|
|
40
|
+
iframeHead.value.appendChild(script)
|
|
41
|
+
|
|
42
|
+
watch(() => props.theme, (theme) => {
|
|
43
|
+
iframeBody.value.setAttribute('data-theme', theme)
|
|
44
|
+
}, { immediate: true })
|
|
45
|
+
return () => slots.default()
|
|
46
|
+
},
|
|
47
|
+
}).mount(el)
|
|
48
|
+
})
|
|
49
|
+
return () => h('iframe', {
|
|
50
|
+
ref: iframeRef,
|
|
51
|
+
})
|
|
52
|
+
},
|
|
53
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = defineProps<{
|
|
3
|
+
values: string
|
|
4
|
+
}>()
|
|
5
|
+
const links = computed(() => {
|
|
6
|
+
const values = props.values.split(',').map(name => name.trim())
|
|
7
|
+
return values.map((value) => {
|
|
8
|
+
if (value.includes('#')) {
|
|
9
|
+
const [name, url] = value.split('#')
|
|
10
|
+
return {
|
|
11
|
+
name,
|
|
12
|
+
url: `#${url}`,
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return {
|
|
17
|
+
name: value,
|
|
18
|
+
url: `#${value.toLowerCase()}`,
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
})
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<ul>
|
|
27
|
+
<li v-for="link in links" :key="link.name">
|
|
28
|
+
<a :href="link.url" class="link link-primary">{{ link.name }}</a>
|
|
29
|
+
</li>
|
|
30
|
+
</ul>
|
|
31
|
+
</template>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useFuse } from '@vueuse/integrations/useFuse'
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
error: Object,
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
const route = useRoute()
|
|
9
|
+
const { allLinks } = useNav()
|
|
10
|
+
|
|
11
|
+
const lastPathSegment = computed(() => {
|
|
12
|
+
const segments = route.path.split('/')
|
|
13
|
+
return segments[segments.length - 1]
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const { results } = useFuse(lastPathSegment, allLinks, {
|
|
17
|
+
fuseOptions: { keys: ['label', 'tags'], includeScore: true, distance: 3 },
|
|
18
|
+
resultLimit: 5,
|
|
19
|
+
})
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<Hero class="not-prose h-[32rem]">
|
|
24
|
+
<HeroContent center>
|
|
25
|
+
<div class="max-w-md">
|
|
26
|
+
<Text is="h1" size="5xl" bold class="mb-5">
|
|
27
|
+
404
|
|
28
|
+
</Text>
|
|
29
|
+
<Text is="p" class="mb-5">
|
|
30
|
+
We couldn't find that page. Did you mean one of these pages?
|
|
31
|
+
</Text>
|
|
32
|
+
<Menu class="border border-base-300 rounded-xl">
|
|
33
|
+
<MenuItem v-for="result in results" :key="result.item.label">
|
|
34
|
+
<NuxtLink :to="result.item.to">
|
|
35
|
+
{{ result.item.label }}
|
|
36
|
+
</NuxtLink>
|
|
37
|
+
</MenuItem>
|
|
38
|
+
</Menu>
|
|
39
|
+
</div>
|
|
40
|
+
</HeroContent>
|
|
41
|
+
</Hero>
|
|
42
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps<{
|
|
3
|
+
url: string
|
|
4
|
+
title: string
|
|
5
|
+
}>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<NuxtLink
|
|
10
|
+
:to="url"
|
|
11
|
+
class="btn md:btn-lg gap-2 normal-case lg:gap-3"
|
|
12
|
+
>
|
|
13
|
+
<Flex col items-start>
|
|
14
|
+
<Text class="text-base-content/50 hidden text-xs font-normal md:block">
|
|
15
|
+
Next
|
|
16
|
+
</Text>
|
|
17
|
+
<Text>{{ title }}</Text>
|
|
18
|
+
</Flex>
|
|
19
|
+
|
|
20
|
+
<svg class="h-6 w-6 fill-current md:h-8 md:w-8" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
21
|
+
<path d="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z" />
|
|
22
|
+
</svg>
|
|
23
|
+
</NuxtLink>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps<{
|
|
3
|
+
url: string
|
|
4
|
+
title: string
|
|
5
|
+
}>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<NuxtLink
|
|
10
|
+
:to="url"
|
|
11
|
+
class="btn md:btn-lg gap-2 normal-case lg:gap-3"
|
|
12
|
+
>
|
|
13
|
+
<svg class="h-6 w-6 fill-current md:h-8 md:w-8" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
14
|
+
<path d="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z" />
|
|
15
|
+
</svg>
|
|
16
|
+
|
|
17
|
+
<Flex col items-start>
|
|
18
|
+
<Text class="text-base-content/50 hidden text-xs font-normal md:block">
|
|
19
|
+
Prev
|
|
20
|
+
</Text>
|
|
21
|
+
<Text>{{ title }}</Text>
|
|
22
|
+
</Flex>
|
|
23
|
+
</NuxtLink>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useNav } from '~/composables/use-nav'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<{
|
|
5
|
+
currentPageLabel: string
|
|
6
|
+
}>()
|
|
7
|
+
|
|
8
|
+
const { allLinks: links } = useNav()
|
|
9
|
+
|
|
10
|
+
const current = computed(() => links.find(link => link.label === props.currentPageLabel))
|
|
11
|
+
const prev = computed(() => links[links.indexOf(current.value as any) - 1])
|
|
12
|
+
const next = computed(() => links[links.indexOf(current.value as any) + 1])
|
|
13
|
+
|
|
14
|
+
function toTop() {
|
|
15
|
+
window.scrollTo({
|
|
16
|
+
top: 0,
|
|
17
|
+
behavior: 'smooth',
|
|
18
|
+
})
|
|
19
|
+
setTimeout(() => {
|
|
20
|
+
window.location.hash = ''
|
|
21
|
+
}, 600)
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<div>
|
|
27
|
+
<div class="flex flex-row justify-between mt-16">
|
|
28
|
+
<PagePrevious v-if="prev" :url="prev.to" :title="prev.label" />
|
|
29
|
+
<span v-else />
|
|
30
|
+
|
|
31
|
+
<PageNext v-if="next" :url="next.to" :title="next.label" />
|
|
32
|
+
<span v-else />
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<Button ghost class="mt-6" @click="toTop">
|
|
36
|
+
to top
|
|
37
|
+
<Icon name="feather:arrow-up" class="ml-2" />
|
|
38
|
+
</Button>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps({
|
|
3
|
+
href: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: '',
|
|
6
|
+
},
|
|
7
|
+
target: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: undefined,
|
|
10
|
+
required: false,
|
|
11
|
+
},
|
|
12
|
+
})
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<NuxtLink :href="href" :target="target" class="daisy-link link-primary">
|
|
17
|
+
<slot />
|
|
18
|
+
</NuxtLink>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
code: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: '',
|
|
6
|
+
},
|
|
7
|
+
language: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: null,
|
|
10
|
+
},
|
|
11
|
+
filename: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: null,
|
|
14
|
+
},
|
|
15
|
+
highlights: {
|
|
16
|
+
type: Array as () => number[],
|
|
17
|
+
default: () => [],
|
|
18
|
+
},
|
|
19
|
+
meta: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: null,
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const { copy, copied } = useClipboard({ source: computed(() => props.code) })
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<div>
|
|
30
|
+
<CodeWrapper v-if="meta?.includes('collapse=true')" class="code-wrapper">
|
|
31
|
+
<div class="relative -my-6">
|
|
32
|
+
<div class="absolute flex flex-row items-center top-0 right-0">
|
|
33
|
+
<div v-if="copied" class="pr-2 text-sm text-neutral-content">
|
|
34
|
+
copied
|
|
35
|
+
</div>
|
|
36
|
+
<Button
|
|
37
|
+
ghost sm
|
|
38
|
+
class="text-neutral-content hover:bg-secondary hover:text-secondary-content rounded-tl-none rounded-br-none rounded-tr-md rounded-bl-md"
|
|
39
|
+
@click="() => copy(code)"
|
|
40
|
+
>
|
|
41
|
+
copy
|
|
42
|
+
</Button>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="lg:max-w-[calc(100vw-380px)]">
|
|
45
|
+
<slot />
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</CodeWrapper>
|
|
49
|
+
<slot v-else />
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<style>
|
|
54
|
+
.code-wrapper pre code .line {
|
|
55
|
+
display: block;
|
|
56
|
+
min-height: 1rem;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.code-wrapper pre {
|
|
60
|
+
max-width: calc(100vw - 3.5rem);
|
|
61
|
+
}
|
|
62
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useRuntimeConfig } from '#imports'
|
|
3
|
+
defineProps<{ id?: string }>()
|
|
4
|
+
const heading = 1
|
|
5
|
+
const { anchorLinks } = useRuntimeConfig().public.content
|
|
6
|
+
const generate = anchorLinks?.depth >= heading && !anchorLinks?.exclude.includes(heading)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<h1 :id="id">
|
|
11
|
+
<a v-if="id && generate" :href="`#${id}`">
|
|
12
|
+
<slot />
|
|
13
|
+
</a>
|
|
14
|
+
<slot v-else />
|
|
15
|
+
</h1>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useRuntimeConfig } from '#imports'
|
|
3
|
+
defineProps<{ id?: string }>()
|
|
4
|
+
const heading = 2
|
|
5
|
+
const { anchorLinks } = useRuntimeConfig().public.content
|
|
6
|
+
const generate = anchorLinks?.depth >= heading && !anchorLinks?.exclude.includes(heading)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<h2 :id="id">
|
|
11
|
+
<a v-if="id && generate" :href="`#${id}`">
|
|
12
|
+
<slot />
|
|
13
|
+
</a>
|
|
14
|
+
<slot v-else />
|
|
15
|
+
</h2>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useRuntimeConfig } from '#imports'
|
|
3
|
+
defineProps<{ id?: string }>()
|
|
4
|
+
const heading = 3
|
|
5
|
+
const { anchorLinks } = useRuntimeConfig().public.content
|
|
6
|
+
const generate = anchorLinks?.depth >= heading && !anchorLinks?.exclude.includes(heading)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<h3 :id="id">
|
|
11
|
+
<a v-if="id && generate" :href="`#${id}`">
|
|
12
|
+
<slot />
|
|
13
|
+
</a>
|
|
14
|
+
<slot v-else />
|
|
15
|
+
</h3>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useRuntimeConfig } from '#imports'
|
|
3
|
+
defineProps<{ id?: string }>()
|
|
4
|
+
const heading = 4
|
|
5
|
+
const { anchorLinks } = useRuntimeConfig().public.content
|
|
6
|
+
const generate = anchorLinks?.depth >= heading && !anchorLinks?.exclude.includes(heading)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<h4 :id="id">
|
|
11
|
+
<a v-if="id && generate" :href="`#${id}`">
|
|
12
|
+
<slot />
|
|
13
|
+
</a>
|
|
14
|
+
<slot v-else />
|
|
15
|
+
</h4>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useRuntimeConfig } from '#imports'
|
|
3
|
+
defineProps<{ id?: string }>()
|
|
4
|
+
const heading = 5
|
|
5
|
+
const { anchorLinks } = useRuntimeConfig().public.content
|
|
6
|
+
const generate = anchorLinks?.depth >= heading && !anchorLinks?.exclude.includes(heading)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<h5 :id="id">
|
|
11
|
+
<a v-if="id && generate" :href="`#${id}`">
|
|
12
|
+
<slot />
|
|
13
|
+
</a>
|
|
14
|
+
<slot v-else />
|
|
15
|
+
</h5>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useRuntimeConfig } from '#imports'
|
|
3
|
+
defineProps<{ id?: string }>()
|
|
4
|
+
const heading = 6
|
|
5
|
+
const { anchorLinks } = useRuntimeConfig().public.content
|
|
6
|
+
const generate = anchorLinks?.depth >= heading && !anchorLinks?.exclude.includes(heading)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<h6 :id="id">
|
|
11
|
+
<a v-if="id && generate" :href="`#${id}`">
|
|
12
|
+
<slot />
|
|
13
|
+
</a>
|
|
14
|
+
<slot v-else />
|
|
15
|
+
</h6>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { withBase } from 'ufo'
|
|
3
|
+
import { computed, useRuntimeConfig } from '#imports'
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
src: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: '',
|
|
9
|
+
},
|
|
10
|
+
alt: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: '',
|
|
13
|
+
},
|
|
14
|
+
width: {
|
|
15
|
+
type: [String, Number],
|
|
16
|
+
default: undefined,
|
|
17
|
+
},
|
|
18
|
+
height: {
|
|
19
|
+
type: [String, Number],
|
|
20
|
+
default: undefined,
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const refinedSrc = computed(() => {
|
|
25
|
+
if (props.src?.startsWith('/') && !props.src.startsWith('//'))
|
|
26
|
+
return withBase(props.src, useRuntimeConfig().app.baseURL)
|
|
27
|
+
|
|
28
|
+
return props.src
|
|
29
|
+
})
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<img :src="refinedSrc" :alt="alt" :width="width" :height="height">
|
|
34
|
+
</template>
|