Skip to content

Commit 7f6e8dc

Browse files
ikushumjohnleiderJ-SekKaelWD
authored
docs: create new homepage (#22225)
Co-authored-by: John Leider <john@vuetifyjs.com> Co-authored-by: J-Sek <J-Sek@users.noreply.github.com> Co-authored-by: Kael <kaelwd@gmail.com>
1 parent 8b802c0 commit 7f6e8dc

40 files changed

Lines changed: 3215 additions & 392 deletions

packages/docs/auto-imports.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ declare global {
172172
export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
173173
import('vue')
174174
// @ts-ignore
175+
export type { CodeSection } from './src/composables/playground'
176+
import('./src/composables/playground')
177+
// @ts-ignore
175178
export type { Category } from './src/stores/app'
176179
import('./src/stores/app')
177180
// @ts-ignore

packages/docs/components.d.ts

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ declare module 'vue' {
100100
DocMadeWithVueAttribution: typeof import('./src/components/doc/MadeWithVueAttribution.vue')['default']
101101
DocMadeWithVuetifyGallery: typeof import('./src/components/doc/MadeWithVuetifyGallery.vue')['default']
102102
DocMadeWithVuetifyLink: typeof import('./src/components/doc/MadeWithVuetifyLink.vue')['default']
103-
DocPremiumThemesGallery: typeof import('./src/components/doc/PremiumThemesGallery.vue')['default']
104103
DocReadyForMore: typeof import('./src/components/doc/ReadyForMore.vue')['default']
105104
DocRelatedPage: typeof import('./src/components/doc/RelatedPage.vue')['default']
106105
DocRelatedPages: typeof import('./src/components/doc/RelatedPages.vue')['default']
@@ -119,14 +118,32 @@ declare module 'vue' {
119118
FeaturesColorPalette: typeof import('./src/components/features/ColorPalette.vue')['default']
120119
FeaturesSassApi: typeof import('./src/components/features/SassApi.vue')['default']
121120
GettingStartedWireframeExamples: typeof import('./src/components/getting-started/WireframeExamples.vue')['default']
122-
HomeActionBtns: typeof import('./src/components/home/ActionBtns.vue')['default']
121+
HomeBlogs: typeof import('./src/components/home/Blogs.vue')['default']
122+
HomeCommonCard: typeof import('./src/components/home/Common/Card.vue')['default']
123+
HomeCommonGradient: typeof import('./src/components/home/Common/Gradient.vue')['default']
124+
HomeCommonMarquee: typeof import('./src/components/home/Common/Marquee.vue')['default']
125+
HomeCommonTitle: typeof import('./src/components/home/Common/Title.vue')['default']
126+
HomeDiscord: typeof import('./src/components/home/Discord.vue')['default']
127+
HomeEcosystem: typeof import('./src/components/home/Ecosystem.vue')['default']
123128
HomeEntry: typeof import('./src/components/home/Entry.vue')['default']
124-
HomeEpicmaxSupport: typeof import('./src/components/home/EpicmaxSupport.vue')['default']
125-
HomeFeatures: typeof import('./src/components/home/Features.vue')['default']
126129
HomeFooter: typeof import('./src/components/home/Footer.vue')['default']
130+
HomeGalleryAnalytics: typeof import('./src/components/home/Gallery/Analytics.vue')['default']
131+
HomeGalleryChatChat: typeof import('./src/components/home/Gallery/Chat/Chat.vue')['default']
132+
HomeGalleryChatDetail: typeof import('./src/components/home/Gallery/Chat/Detail.vue')['default']
133+
HomeGalleryChatList: typeof import('./src/components/home/Gallery/Chat/List.vue')['default']
134+
HomeGalleryComponents: typeof import('./src/components/home/Gallery/Components.vue')['default']
135+
HomeGalleryDashboard: typeof import('./src/components/home/Gallery/Dashboard.vue')['default']
136+
HomeGalleryLogin: typeof import('./src/components/home/Gallery/Login.vue')['default']
137+
HomeGallerySettings: typeof import('./src/components/home/Gallery/Settings.vue')['default']
127138
HomeLogo: typeof import('./src/components/home/Logo.vue')['default']
139+
HomeSnips: typeof import('./src/components/home/Snips.vue')['default']
140+
HomeSnipsExample: typeof import('./src/components/home/SnipsExample.vue')['default']
128141
HomeSpecialSponsor: typeof import('./src/components/home/SpecialSponsor.vue')['default']
129142
HomeSponsors: typeof import('./src/components/home/Sponsors.vue')['default']
143+
HomeStore: typeof import('./src/components/home/Store.vue')['default']
144+
HomeSupport: typeof import('./src/components/home/Support.vue')['default']
145+
HomeTooling: typeof import('./src/components/home/Tooling.vue')['default']
146+
HomeVuetifyOne: typeof import('./src/components/home/VuetifyOne.vue')['default']
130147
IconsChevronDown: typeof import('./src/components/icons/ChevronDown.vue')['default']
131148
IntroductionComparison: typeof import('./src/components/introduction/Comparison.vue')['default']
132149
IntroductionConsultingServices: typeof import('./src/components/introduction/ConsultingServices.vue')['default']

packages/docs/src/components/Alert.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
:border-color="type"
44
:type="type"
55
border="start"
6-
class="v-alert--doc mb-4 border-opacity-100"
6+
class="v-alert--doc my-4 border-opacity-100"
77
variant="tonal"
88
>
99
<template #prepend>

packages/docs/src/components/app/Markup.vue

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@
5353
<v-btn
5454
v-if="isHovering"
5555
:key="icon"
56+
:icon="needsPlaygroundLink ? '$vuetify-play' : '$vuetify-bin'"
5657
class="text-disabled me-12 mt-2 app-markup-btn position-absolute right-0 top-0"
5758
density="comfortable"
58-
icon="$vuetify-bin"
5959
size="small"
6060
v-bind="activatorProps"
6161
variant="text"
62-
@click="bin"
62+
@click="openCode"
6363
/>
6464
</v-fade-transition>
6565
</template>
6666

67-
<span>{{ t('open-in-vuetify-bin') }}</span>
67+
<span>{{ t(needsPlaygroundLink ? 'open-in-playground' : 'open-in-vuetify-bin') }}</span>
6868
</v-tooltip>
6969

7070
<div class="pa-4 pe-12">
@@ -97,7 +97,10 @@
9797
9898
const props = defineProps({
9999
resource: String,
100-
code: null,
100+
code: {
101+
type: [String, Array] as PropType<string | CodeSection[]>,
102+
default: '',
103+
},
101104
inline: Boolean,
102105
language: {
103106
type: String,
@@ -130,16 +133,35 @@
130133
const root = ref<ComponentPublicInstance>()
131134
132135
const highlighted = shallowRef('')
133-
watchEffect(async () => {
134-
highlighted.value = props.code && props.language && Prism.highlight(await props.code, Prism.languages[props.language], props.language)
135-
})
136136
137137
const className = computed(() => `language-${props.language}`)
138138
const icon = computed(() => clicked.value ? 'mdi-check' : 'mdi-clipboard-text-outline')
139139
140-
async function bin () {
140+
const needsPlaygroundLink = computed(() => Array.isArray(props.code))
141+
142+
const displayedCode = computed(() => {
143+
if (typeof props.code === 'string') {
144+
return props.code
145+
}
146+
147+
return props.code.map((section: CodeSection) => section.content).join('\n\n')
148+
})
149+
150+
watchEffect(async () => {
151+
highlighted.value = displayedCode.value && props.language && Prism.highlight(await displayedCode.value, Prism.languages[props.language], props.language)
152+
})
153+
154+
function openCode () {
155+
if (needsPlaygroundLink.value) {
156+
openPlayground()
157+
} else {
158+
openBin()
159+
}
160+
}
161+
162+
async function openBin () {
141163
const el = root.value?.$el.querySelector('code')
142-
const code = props.code || el?.innerText || ''
164+
const code = displayedCode.value || el?.innerText || ''
143165
const language = props.language || 'markdown'
144166
const title = props.resource
145167
@@ -148,10 +170,18 @@
148170
window.open(compressed, '_blank')
149171
}
150172
173+
async function openPlayground () {
174+
if (typeof props.code === 'string') return
175+
176+
const url = usePlayground(props.code)
177+
178+
window.open(url, '_blank')
179+
}
180+
151181
async function copy () {
152182
const el = root.value?.$el.querySelector('code')
153183
154-
await navigator.clipboard.writeText(props.code || el?.innerText || '')
184+
await navigator.clipboard.writeText(displayedCode.value || el?.innerText || '')
155185
156186
clicked.value = true
157187

packages/docs/src/components/app/bar/Bar.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</template>
1919

2020
<template #append>
21-
<div v-if="mdAndUp" class="d-flex ga-1 pe-2">
21+
<div v-if="showExtraLinks" class="d-flex ga-1 pe-2">
2222
<AppBarBlogLink />
2323

2424
<AppBarLearnMenu />
@@ -27,12 +27,12 @@
2727

2828
<AppBarEcosystemMenu />
2929

30-
<AppBarPlaygroundLink v-if="lgAndUp" />
30+
<AppBarPlaygroundLink v-if="showPlaygroundLink" />
3131

32-
<AppBarOneLink />
32+
<AppBarOneLink class="ml-4" />
3333
</div>
3434

35-
<AppVerticalDivider v-if="mdAndUp" />
35+
<AppVerticalDivider v-if="showExtraLinks" />
3636

3737
<div class="d-flex ga-1">
3838
<AppBarStoreLink v-if="smAndUp" />
@@ -49,8 +49,9 @@
4949

5050
<script setup>
5151
const app = useAppStore()
52-
const { smAndUp, lgAndUp, mdAndDown, width } = useDisplay()
52+
const { smAndUp, mdAndDown, width } = useDisplay()
5353
const route = useRoute()
5454
55-
const mdAndUp = computed(() => width.value >= 1077)
55+
const showExtraLinks = computed(() => width.value >= 1052)
56+
const showPlaygroundLink = computed(() => width.value >= 1220)
5657
</script>

packages/docs/src/components/app/bar/OneLink.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<AppBtn
33
:to="rpath('/one/')"
44
color="primary"
5+
rounded="lg"
56
text="one"
67
variant="outlined"
78
@click="sweClick('app-bar', 'one', name)"

packages/docs/src/components/doc/PremiumThemesGallery.vue

Lines changed: 0 additions & 90 deletions
This file was deleted.

packages/docs/src/components/home/ActionBtns.vue

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)