Commit 7bddf6db76

7bddf6db76b1ce6975e27e9e723351219afc9b4b

parent: e450ad6a66

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-10-25 17:31 UTC

Update CrossAppSupport.vue

Layout: unified · split

docs/.vitepress/theme/components/crossapp/CrossAppSupport.vue +56 −7
@@ -21,9 +21,15 @@ interface AppEntry {
2121 platforms: string[]
2222 icon: string | null
2323 repos: string[]
24 comp?: string[]
2425 notes: string[]
2526}
2627
28interface OpenRepo extends Repo {
29 id: string
30 comp: boolean
31}
32
2733interface Payload {
2834 version: number
2935 repos: Record<string, Repo>
@@ -53,13 +59,19 @@ const openApp = computed(() =>
5359 apps.value.find(app => app.id === openId.value) ?? null
5460)
5561
56const openRepos = computed(() => {
57 if (!openApp.value || !payload.value) return []
58 return openApp.value.repos
59 .map(id => payload.value!.repos[id])
60 .filter((repo): repo is Repo => Boolean(repo))
62const openRepos = computed<OpenRepo[]>(() => {
63 const app = openApp.value
64 const repos = payload.value?.repos
65 if (!app || !repos) return []
66 const comp = new Set(app.comp ?? [])
67 return app.repos.flatMap(id => {
68 const repo = repos[id]
69 return repo ? [{ ...repo, id, comp: comp.has(id) }] : []
70 })
6171})
6272
73const hasCompRepo = computed(() => openRepos.value.some(repo => repo.comp))
74
6375const openRowEnd = computed(() => {
6476 const app = openApp.value
6577 if (!app) return -1
@@ -294,9 +306,12 @@ onBeforeUnmount(() => resizeObserver?.disconnect())
294306 <component
295307 :is="repo.href ? 'a' : 'div'"
296308 v-for="repo in openRepos"
297 :key="repo.name"
309 :key="repo.id"
298310 class="ca-repo"
299 :class="{ 'is-disabled': !repo.href }"
311 :class="{
312 'is-disabled': !repo.href,
313 'is-comp': repo.comp
314 }"
300315 :href="repo.href ?? undefined"
301316 :title="repo.href ? repo.name : 'No page yet'"
302317 >
@@ -315,6 +330,16 @@ onBeforeUnmount(() => resizeObserver?.disconnect())
315330 <span class="ca-repo-name">{{ repo.name }}</span>
316331 </component>
317332 </div>
333
334 <p v-if="hasCompRepo" class="ca-comp-foot">
335 <span
336 class="i-lucide-square-dashed ca-comp-icon"
337 aria-hidden="true"
338 />
339 <span>
340 App uses an extension as a compatibility layer. All the extensions / features may not work properly.
341 </span>
342 </p>
318343 </section>
319344 </template>
320345 </div>
@@ -571,6 +596,30 @@ onBeforeUnmount(() => resizeObserver?.disconnect())
571596 opacity: 0.55;
572597}
573598
599.ca-repo.is-comp {
600 border-style: dashed;
601}
602
603.ca-comp-foot {
604 display: flex;
605 align-items: flex-start;
606 gap: 6px;
607 margin: 6px 4px 2px;
608 font-size: 10.5px;
609 line-height: 1.4;
610 color: var(--vp-c-text-2);
611}
612
613.ca-comp-icon {
614 flex-shrink: 0;
615 width: 12px;
616 height: 12px;
617 min-width: 0;
618 margin-top: 1px;
619 font-size: 12px;
620 line-height: 1;
621}
622
574623.ca-repo-name {
575624 font-size: 12.5px;
576625 font-weight: 600;