Commit 99347c7fd9
Unsigned
Layout: unified · split
docs/.vitepress/theme/components/extrepo/AddonInstallMenu.vue deleted −120
| @@ -1,120 +0,0 @@ | |||
| 1 | <script setup lang="ts"> | ||
| 2 | import { computed } from 'vue' | ||
| 3 | import { stremioSoftwareHref, stremioWebHref } from './install' | ||
| 4 | import type { RepoSite } from './types' | ||
| 5 | |||
| 6 | const props = defineProps<{ | ||
| 7 | site: RepoSite & { repoName?: string } | ||
| 8 | }>() | ||
| 9 | |||
| 10 | const manifestUrl = computed(() => props.site.installUrl ?? '') | ||
| 11 | |||
| 12 | const softwareHref = computed(() => stremioSoftwareHref(manifestUrl.value)) | ||
| 13 | const webHref = computed(() => stremioWebHref(manifestUrl.value)) | ||
| 14 | const configureHref = computed(() => props.site.configureUrl ?? null) | ||
| 15 | </script> | ||
| 16 | |||
| 17 | <template> | ||
| 18 | <VTooltip | ||
| 19 | theme="vp-tooltip" | ||
| 20 | placement="bottom-end" | ||
| 21 | :distance="6" | ||
| 22 | class="ext-addon-install" | ||
| 23 | > | ||
| 24 | <button | ||
| 25 | type="button" | ||
| 26 | class="ext-site-install-btn" | ||
| 27 | aria-haspopup="true" | ||
| 28 | :aria-label="`Install ${site.name}`" | ||
| 29 | > | ||
| 30 | <span class="i-lucide:download" /> | ||
| 31 | </button> | ||
| 32 | <template #popper> | ||
| 33 | <div class="ext-install-menu"> | ||
| 34 | <a class="ext-install-option" :href="softwareHref"> | ||
| 35 | <span class="i-lucide:monitor-down" /> | ||
| 36 | <span class="ext-install-option-label">Software</span> | ||
| 37 | </a> | ||
| 38 | <a | ||
| 39 | class="ext-install-option" | ||
| 40 | :href="webHref" | ||
| 41 | target="_blank" | ||
| 42 | rel="noopener noreferrer" | ||
| 43 | > | ||
| 44 | <span class="i-lucide:globe" /> | ||
| 45 | <span class="ext-install-option-label">Web</span> | ||
| 46 | </a> | ||
| 47 | <a | ||
| 48 | v-if="configureHref" | ||
| 49 | class="ext-install-option" | ||
| 50 | :href="configureHref" | ||
| 51 | target="_blank" | ||
| 52 | rel="noopener noreferrer" | ||
| 53 | > | ||
| 54 | <span class="i-lucide:settings-2" /> | ||
| 55 | <span class="ext-install-option-label">Configure</span> | ||
| 56 | </a> | ||
| 57 | </div> | ||
| 58 | </template> | ||
| 59 | </VTooltip> | ||
| 60 | </template> | ||
| 61 | |||
| 62 | <style scoped> | ||
| 63 | .ext-addon-install { | ||
| 64 | flex-shrink: 0; | ||
| 65 | align-self: stretch; | ||
| 66 | display: flex; | ||
| 67 | } | ||
| 68 | .ext-site-install-btn { | ||
| 69 | flex-shrink: 0; | ||
| 70 | display: flex; | ||
| 71 | align-items: center; | ||
| 72 | justify-content: center; | ||
| 73 | width: 32px; | ||
| 74 | height: 100%; | ||
| 75 | padding: 0; | ||
| 76 | border-radius: 8px; | ||
| 77 | border: 1px solid var(--vp-button-brand-border); | ||
| 78 | background-color: var(--vp-button-brand-bg); | ||
| 79 | color: var(--vp-button-brand-text); | ||
| 80 | cursor: pointer; | ||
| 81 | transition: filter 0.2s, border-color 0.2s; | ||
| 82 | } | ||
| 83 | .ext-site-install-btn:hover { | ||
| 84 | filter: brightness(1.08); | ||
| 85 | border-color: var(--vp-button-brand-hover-border); | ||
| 86 | } | ||
| 87 | .ext-site-install-btn span { | ||
| 88 | font-size: 15px; | ||
| 89 | } | ||
| 90 | .ext-install-menu { | ||
| 91 | display: flex; | ||
| 92 | flex-direction: column; | ||
| 93 | min-width: 150px; | ||
| 94 | padding: 4px; | ||
| 95 | border-radius: 10px; | ||
| 96 | border: 1px solid var(--vp-c-divider); | ||
| 97 | background-color: var(--vp-c-bg-elv); | ||
| 98 | box-shadow: var(--vp-shadow-3, 0 4px 16px rgba(0, 0, 0, 0.3)); | ||
| 99 | } | ||
| 100 | .ext-install-option { | ||
| 101 | display: flex; | ||
| 102 | align-items: center; | ||
| 103 | gap: 8px; | ||
| 104 | padding: 7px 10px; | ||
| 105 | border-radius: 7px; | ||
| 106 | color: var(--vp-c-text-1) !important; | ||
| 107 | font-size: 13px; | ||
| 108 | font-weight: 500; | ||
| 109 | text-decoration: none !important; | ||
| 110 | white-space: nowrap; | ||
| 111 | transition: background-color 0.15s; | ||
| 112 | } | ||
| 113 | .ext-install-option:hover { | ||
| 114 | background-color: var(--vp-c-bg-soft); | ||
| 115 | } | ||
| 116 | .ext-install-option > span:first-child { | ||
| 117 | color: var(--vp-c-brand-1); | ||
| 118 | font-size: 15px; | ||
| 119 | } | ||
| 120 | </style> | ||
docs/.vitepress/theme/components/extrepo/SiteCell.vue +2 −8
| @@ -1,6 +1,5 @@ | |||
| 1 | <script setup lang="ts"> | 1 | <script setup lang="ts"> |
| 2 | import { computed } from 'vue' | 2 | import { computed } from 'vue' |
| 3 | import AddonInstallMenu from './AddonInstallMenu.vue' | ||
| 4 | import { langFlagClass, ratingIcon, ratingTitle } from './helpers' | 3 | import { langFlagClass, ratingIcon, ratingTitle } from './helpers' |
| 5 | import { hasSiteCopyButton } from './install' | 4 | import { hasSiteCopyButton } from './install' |
| 6 | import LazyIcon from './LazyIcon.vue' | 5 | import LazyIcon from './LazyIcon.vue' |
| @@ -22,10 +21,6 @@ const copyTarget = computed(() => { | |||
| 22 | return soraMatch ? soraMatch[1] : value | 21 | return soraMatch ? soraMatch[1] : value |
| 23 | }) | 22 | }) |
| 24 | 23 | ||
| 25 | const isStremioAddon = computed(() => | ||
| 26 | props.scheme === 'stremio' && Boolean(props.site.installUrl) | ||
| 27 | ) | ||
| 28 | |||
| 29 | async function copyInstallUrl() { | 24 | async function copyInstallUrl() { |
| 30 | const value = copyTarget.value | 25 | const value = copyTarget.value |
| 31 | if (!value) return | 26 | if (!value) return |
| @@ -60,7 +55,7 @@ async function copyInstallUrl() { | |||
| 60 | @mouseleave="hideTooltip" | 55 | @mouseleave="hideTooltip" |
| 61 | /> | 56 | /> |
| 62 | <span | 57 | <span |
| 63 | v-if="!isStremioAddon" | 58 | v-if="scheme !== 'stremio'" |
| 64 | class="ext-site-lang" | 59 | class="ext-site-lang" |
| 65 | :class="langFlagClass(site.lang)" | 60 | :class="langFlagClass(site.lang)" |
| 66 | :aria-label="site.lang" | 61 | :aria-label="site.lang" |
| @@ -72,9 +67,8 @@ async function copyInstallUrl() { | |||
| 72 | site.author ?? site.repoName | 67 | site.author ?? site.repoName |
| 73 | }}</span> | 68 | }}</span> |
| 74 | </component> | 69 | </component> |
| 75 | <AddonInstallMenu v-if="isStremioAddon" :site="site" /> | ||
| 76 | <a | 70 | <a |
| 77 | v-else-if="site.installUrl" | 71 | v-if="site.installUrl" |
| 78 | class="ext-site-install-btn" | 72 | class="ext-site-install-btn" |
| 79 | :href="site.installUrl" | 73 | :href="site.installUrl" |
| 80 | :aria-label="`Install ${site.name}`" | 74 | :aria-label="`Install ${site.name}`" |
docs/.vitepress/theme/components/extrepo/install.ts −8
| @@ -94,14 +94,6 @@ export function copyValue(scheme: string, indexUrl: string): string { | |||
| 94 | return indexUrl | 94 | return indexUrl |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | export function stremioSoftwareHref(manifestUrl: string): string { | ||
| 98 | return `stremio://${manifestUrl.replace(/^[a-z]+:\/\//i, '')}` | ||
| 99 | } | ||
| 100 | |||
| 101 | export function stremioWebHref(manifestUrl: string): string { | ||
| 102 | return `https://web.stremio.com/#/addons?addon=${manifestUrl}` | ||
| 103 | } | ||
| 104 | |||
| 105 | export function mangayomiHref(repo: Repo, variant: RepoVariant): string { | 97 | export function mangayomiHref(repo: Repo, variant: RepoVariant): string { |
| 106 | const params: string[] = [] | 98 | const params: string[] = [] |
| 107 | if (repo.repoName) { | 99 | if (repo.repoName) { |
docs/.vitepress/theme/components/extrepo/types.ts −1
| @@ -30,7 +30,6 @@ export interface RepoSite { | |||
| 30 | installUrl?: string | 30 | installUrl?: string |
| 31 | author?: string | 31 | author?: string |
| 32 | copyUrl?: string | 32 | copyUrl?: string |
| 33 | configureUrl?: string | ||
| 34 | } | 33 | } |
| 35 | 34 | ||
| 36 | export interface MatchedSite extends RepoSite { | 35 | export interface MatchedSite extends RepoSite { |
docs/ext/extensionRepos/parsers.ts +3 −6
| @@ -216,9 +216,7 @@ interface StremioAddon { | |||
| 216 | name?: string | 216 | name?: string |
| 217 | icon?: string | null | 217 | icon?: string | null |
| 218 | manifestUrl: string | 218 | manifestUrl: string |
| 219 | configureUrl?: string | null | ||
| 220 | types?: string[] | null | 219 | types?: string[] | null |
| 221 | nsfw?: boolean | ||
| 222 | } | 220 | } |
| 223 | 221 | ||
| 224 | interface StremioCollection { | 222 | interface StremioCollection { |
| @@ -612,13 +610,12 @@ function toRepoDataStremio(index: StremioCollection): RepoSite[] { | |||
| 612 | lang: 'all', | 610 | lang: 'all', |
| 613 | icon: addon.icon ?? '', | 611 | icon: addon.icon ?? '', |
| 614 | url: '', | 612 | url: '', |
| 615 | rating: addon.nsfw ? 'nsfw' : 'safe', | 613 | rating: 'safe', |
| 616 | contentTypes: addon.types?.length | 614 | contentTypes: addon.types?.length |
| 617 | ? [...new Set(addon.types.filter(Boolean))] | 615 | ? [...new Set(addon.types.filter(Boolean))] |
| 618 | : undefined, | 616 | : undefined, |
| 619 | installUrl: addon.manifestUrl, | 617 | installUrl: `stremio://${addon.manifestUrl.replace(/^[a-z]+:\/\//i, '')}`, |
| 620 | copyUrl: addon.manifestUrl, | 618 | copyUrl: addon.manifestUrl |
| 621 | configureUrl: addon.configureUrl ?? undefined | ||
| 622 | })) | 619 | })) |
| 623 | } | 620 | } |
| 624 | 621 | ||