Commit 49f5a2b0f7

49f5a2b0f7205d3ffcd3bf341a5ade946e5917b7

parent: ac25e65ef8

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-07-22 06:56 UTC

echo

Layout: unified · split

docs/.vitepress/theme/components/extrepo/ExtensionRepos.vue +6 −5
@@ -13,6 +13,7 @@ const { tooltip } = provideTooltip()
1313
1414const repoData = data.sites
1515const soraAuthors = data.soraAuthors
16const echoAuthors = data.echoAuthors
1617
1718const props = defineProps<{
1819 repos: Repo[]
@@ -22,7 +23,7 @@ const props = defineProps<{
2223const resolvedRepos = computed<Repo[]>(() => {
2324 const result: Repo[] = []
2425 for (const repo of props.repos) {
25 const authors = soraAuthors[repo.indexUrl]
26 const authors = soraAuthors[repo.indexUrl] ?? echoAuthors[repo.indexUrl]
2627 if (!authors?.length) {
2728 result.push(repo)
2829 continue
@@ -40,7 +41,7 @@ const resolvedRepos = computed<Repo[]>(() => {
4041const query = ref('')
4142const langFilter = ref('')
4243const ratingFilter = ref<RatingFilter>('all')
43const excludedContentTypes = ref<Set<string>>(new Set())
44const contentTypeFilter = ref('')
4445const excludedStreamTypes = ref<Set<string>>(new Set())
4546const excludedQualities = ref<Set<string>>(new Set())
4647const showBroken = ref(false)
@@ -103,7 +104,7 @@ const availableLangs = computed(() => {
103104
104105const isFiltering = computed(() => {
105106 return query.value.trim() !== '' || langFilter.value !== '' || ratingFilter.value !== 'all'
106 || excludedContentTypes.value.size > 0 || excludedStreamTypes.value.size > 0 || excludedQualities.value.size > 0
107 || contentTypeFilter.value !== '' || excludedStreamTypes.value.size > 0 || excludedQualities.value.size > 0
107108})
108109
109110const filteredSites = computed(() => {
@@ -113,7 +114,7 @@ const filteredSites = computed(() => {
113114 if (q && !site.name.toLowerCase().includes(q) && !site.url.toLowerCase().includes(q)) return false
114115 if (langFilter.value && site.lang !== langFilter.value) return false
115116 if (ratingFilter.value !== 'all' && site.rating !== ratingFilter.value) return false
116 if (site.contentType && excludedContentTypes.value.has(site.contentType)) return false
117 if (contentTypeFilter.value && site.contentType !== contentTypeFilter.value) return false
117118 if (site.streamType && excludedStreamTypes.value.has(site.streamType)) return false
118119 if (site.quality && excludedQualities.value.has(site.quality)) return false
119120 return true
@@ -131,7 +132,7 @@ const filteredSites = computed(() => {
131132 <SettingsMenu
132133 v-model:lang-filter="langFilter"
133134 v-model:rating-filter="ratingFilter"
134 v-model:content-type-filter="excludedContentTypes"
135 v-model:content-type-filter="contentTypeFilter"
135136 v-model:stream-type-filter="excludedStreamTypes"
136137 v-model:quality-filter="excludedQualities"
137138 v-model:show-broken="showBroken"
docs/.vitepress/theme/components/extrepo/SettingsMenu.vue +5 −3
@@ -4,6 +4,7 @@ import BrokenFilter from './BrokenFilter.vue'
44import ContentTypeFilter from './ContentTypeFilter.vue'
55import LangSelect from './LangSelect.vue'
66import RatingFilter from './RatingFilter.vue'
7import TypeSelect from './TypeSelect.vue'
78import type { RatingFilter as RatingFilterValue } from './types'
89
910defineProps<{
@@ -13,7 +14,7 @@ defineProps<{
1314 hasMultiLanguage: boolean
1415 hasRatings: boolean
1516 hasSuggestive: boolean
16 contentTypeFilter: Set<string>
17 contentTypeFilter: string
1718 availableContentTypes: string[]
1819 hasContentTypes: boolean
1920 streamTypeFilter: Set<string>
@@ -29,7 +30,7 @@ defineProps<{
2930defineEmits<{
3031 'update:langFilter': [value: string]
3132 'update:ratingFilter': [value: RatingFilterValue]
32 'update:contentTypeFilter': [value: Set<string>]
33 'update:contentTypeFilter': [value: string]
3334 'update:streamTypeFilter': [value: Set<string>]
3435 'update:qualityFilter': [value: Set<string>]
3536 'update:showBroken': [value: boolean]
@@ -110,6 +111,7 @@ onUnmounted(() => {
110111 :style="menuStyle"
111112 >
112113 <LangSelect
114 v-if="availableLangs.length > 0"
113115 :model-value="langFilter"
114116 :available-langs="availableLangs"
115117 :has-multi-language="hasMultiLanguage"
@@ -121,7 +123,7 @@ onUnmounted(() => {
121123 :has-suggestive="hasSuggestive"
122124 @update:model-value="$emit('update:ratingFilter', $event)"
123125 />
124 <ContentTypeFilter
126 <TypeSelect
125127 v-if="hasContentTypes"
126128 :model-value="contentTypeFilter"
127129 :available-types="availableContentTypes"
docs/.vitepress/theme/components/extrepo/TypeSelect.vue added +184
@@ -0,0 +1,184 @@
1<script setup lang="ts">
2import { NuInputHighlight, NuVerticalTransition } from '@nolebase/ui'
3import { onMounted, onUnmounted, ref } from 'vue'
4import { contentTypeLabel } from './helpers'
5import MenuHelp from '../settings/MenuHelp.vue'
6import MenuTitle from '../settings/MenuTitle.vue'
7
8defineProps<{
9 modelValue: string
10 availableTypes: string[]
11}>()
12
13const emit = defineEmits<{
14 'update:modelValue': [value: string]
15}>()
16
17const rootRef = ref<HTMLElement>()
18const open = ref(false)
19const menuTitleElementRef = ref<HTMLDivElement>()
20const isMenuHelpPoppedUp = ref(false)
21
22function select(type: string) {
23 emit('update:modelValue', type)
24 open.value = false
25}
26
27function onDocClick(e: MouseEvent) {
28 if (rootRef.value && !rootRef.value.contains(e.target as Node)) open.value = false
29}
30
31onMounted(() => document.addEventListener('click', onDocClick, true))
32onUnmounted(() => document.removeEventListener('click', onDocClick, true))
33</script>
34
35<template>
36 <div ref="rootRef" class="ext-type-select" :class="{ 'ext-type-select--open': open }">
37 <div ref="menuTitleElementRef" relative flex items-center mb-2>
38 <MenuTitle title="Type" aria-label="Type" flex="1" pr-4>
39 <template #icon>
40 <span i-lucide:tags mr-1 aria-hidden="true" />
41 </template>
42 </MenuTitle>
43 <MenuHelp
44 v-model:is-popped-up="isMenuHelpPoppedUp"
45 :menu-title-element-ref="menuTitleElementRef"
46 >
47 <h4 text-md mb-1 font-semibold>Type</h4>
48 <p text="sm" mb-2 max-w-100>
49 Filters extensions by type.
50 </p>
51 </MenuHelp>
52 </div>
53 <NuInputHighlight :active="isMenuHelpPoppedUp" class="rounded-md">
54 <button
55 type="button"
56 class="ext-type-trigger"
57 aria-haspopup="listbox"
58 :aria-expanded="open"
59 @click="open = !open"
60 >
61 <span class="ext-type-label">{{ modelValue ? contentTypeLabel(modelValue) : 'All types' }}</span>
62 <span class="ext-type-chevron i-lucide:chevron-down" :class="{ 'ext-type-chevron--open': open }" />
63 </button>
64
65 <NuVerticalTransition :duration="200">
66 <div v-show="open" class="ext-type-options" role="listbox">
67 <button
68 type="button"
69 role="option"
70 class="ext-type-option"
71 :class="{ 'ext-type-option--selected': modelValue === '' }"
72 :aria-selected="modelValue === ''"
73 @click="select('')"
74 >
75 <span class="ext-type-option-label">All types</span>
76 </button>
77 <button
78 v-for="type in availableTypes"
79 :key="type"
80 type="button"
81 role="option"
82 class="ext-type-option"
83 :class="{ 'ext-type-option--selected': modelValue === type }"
84 :aria-selected="modelValue === type"
85 @click="select(type)"
86 >
87 <span class="ext-type-option-label">{{ contentTypeLabel(type) }}</span>
88 </button>
89 </div>
90 </NuVerticalTransition>
91 </NuInputHighlight>
92 </div>
93</template>
94
95<style scoped>
96.ext-type-select {
97 position: relative;
98}
99
100.ext-type-trigger {
101 display: flex;
102 align-items: center;
103 gap: 8px;
104 width: 100%;
105 min-height: 44px;
106 padding: 7px 10px;
107 border-radius: 8px;
108 border: 2px solid var(--vp-c-divider);
109 background: var(--wk-c-menu-bg);
110 color: var(--vp-c-text-1);
111 font-size: 13px;
112 cursor: pointer;
113 transition: border-color 0.15s, background-color 0.15s;
114}
115
116.ext-type-trigger:hover,
117.ext-type-select--open .ext-type-trigger {
118 border-color: var(--vp-c-brand-1);
119}
120
121.ext-type-label {
122 flex: 1;
123 text-align: left;
124}
125
126.ext-type-chevron {
127 flex-shrink: 0;
128 color: var(--vp-c-text-2);
129 transition: transform 0.2s ease;
130}
131
132.ext-type-chevron--open {
133 transform: rotate(180deg);
134}
135
136.ext-type-options {
137 margin-top: 6px;
138 max-height: 240px;
139 overflow-y: auto;
140 overscroll-behavior: contain;
141 display: flex;
142 flex-direction: column;
143 gap: 2px;
144 padding: 4px;
145 border-radius: 8px;
146 border: 1px solid var(--vp-c-divider);
147 background: var(--vp-c-bg-elv);
148 box-shadow: var(--vp-shadow-2, 0 4px 16px rgba(0, 0, 0, 0.2));
149}
150
151.ext-type-option {
152 display: flex;
153 align-items: center;
154 gap: 8px;
155 padding: 5px 8px;
156 border-radius: 8px;
157 border: none;
158 background: transparent;
159 cursor: pointer;
160 color: var(--vp-c-text-1);
161 font-size: 13px;
162 text-align: left;
163 width: 100%;
164 transition: background-color 0.15s;
165}
166
167.ext-type-option-label {
168 flex: 1;
169 min-width: 0;
170}
171
172.ext-type-option:hover {
173 background-color: var(--vp-c-bg-soft);
174}
175
176.ext-type-option--selected {
177 background-color: var(--vp-c-brand-soft);
178 font-weight: 600;
179}
180
181.ext-type-option--selected:hover {
182 background-color: var(--vp-c-brand-soft);
183}
184</style>
docs/.vitepress/theme/components/extrepo/install.ts +2 −2
@@ -33,9 +33,9 @@ const INSTALL_URL_BUILDERS: Record<string, (repo: Repo, opts?: InstallOpts) => s
3333const MANUAL_ONLY_SCHEMES = new Set(['manual'])
3434
3535// Schemes with no install or copy action
36const BROWSE_ONLY_SCHEMES = new Set(['kotatsu', 'sora'])
36const BROWSE_ONLY_SCHEMES = new Set(['kotatsu', 'sora', 'echo'])
3737
38const NO_COPY_SCHEMES = new Set(['suwatte'])
38const NO_COPY_SCHEMES = new Set(['suwatte', 'echo'])
3939
4040const COPYABLE_BROWSE_ONLY_SCHEMES = new Set(['sora'])
4141
docs/ext/extensionRepos.data.ts +83 −1
@@ -177,6 +177,21 @@ export interface SoraAuthorRepo {
177177 indexUrl: string
178178}
179179
180interface EchoExtension {
181 id: string
182 type: string
183 name: string
184 subtitle?: string
185 iconUrl?: string
186 updateUrl: string
187}
188
189export interface EchoAuthorRepo {
190 label: string
191 repoUrl?: string
192 indexUrl: string
193}
194
180195const EXT_DIR = dirname(fileURLToPath(import.meta.url))
181196const DOCS_DIR = join(EXT_DIR, '..')
182197const CACHE_DIR = join(EXT_DIR, '../.vitepress/cache/extension-repos')
@@ -574,6 +589,64 @@ async function loadSoraRepoIndex(indexUrl: string, index: SoraRepoIndex): Promis
574589 return { sites, authorRepos, sitesByAuthor }
575590}
576591
592function isEchoExtensionList(json: unknown): json is EchoExtension[] {
593 if (!Array.isArray(json) || json.length === 0) return false
594 const first = json[0] as Record<string, unknown>
595 return typeof first.updateUrl === 'string' && typeof first.subtitle === 'string' && !('lang' in first) && !('baseUrl' in first)
596}
597
598function parseEchoRepo(updateUrl: string): { owner: string; repo: string } | undefined {
599 const match = updateUrl.match(/^https:\/\/api\.github\.com\/repos\/([^/]+)\/([^/]+)\/releases$/)
600 if (!match) return undefined
601 return { owner: match[1], repo: match[2] }
602}
603
604function toRepoDataEchoExtensions(extensions: EchoExtension[]): RepoSite[] {
605 const seen = new Set<string>()
606 const sites: RepoSite[] = []
607
608 for (const ext of extensions) {
609 const key = `${ext.id}::${ext.updateUrl}`
610 if (seen.has(key)) continue
611 seen.add(key)
612 const repo = parseEchoRepo(ext.updateUrl)
613 const repoUrl = repo ? `https://github.com/${repo.owner}/${repo.repo}` : undefined
614 sites.push({
615 name: ext.name,
616 lang: 'all',
617 icon: ext.iconUrl ?? '',
618 url: repoUrl ?? '',
619 rating: 'safe',
620 contentType: ext.type,
621 installUrl: repoUrl
622 })
623 }
624
625 sites.sort((a, b) => a.name.localeCompare(b.name))
626 return sites
627}
628
629function loadEchoExtensionList(indexUrl: string, extensions: EchoExtension[]): { sites: RepoSite[]; authorRepos: EchoAuthorRepo[]; sitesByAuthor: Record<string, RepoData> } {
630 const byAuthor = new Map<string, EchoExtension[]>()
631 for (const ext of extensions) {
632 const owner = parseEchoRepo(ext.updateUrl)?.owner ?? 'Unknown'
633 const bucket = byAuthor.get(owner)
634 if (bucket) bucket.push(ext)
635 else byAuthor.set(owner, [ext])
636 }
637
638 const authorRepos: EchoAuthorRepo[] = []
639 const sitesByAuthor: Record<string, RepoData> = {}
640 for (const [owner, exts] of byAuthor) {
641 const authorIndexUrl = `${indexUrl}#${owner}`
642 sitesByAuthor[authorIndexUrl] = { sites: toRepoDataEchoExtensions(exts) }
643 authorRepos.push({ label: owner, repoUrl: `https://github.com/${owner}`, indexUrl: authorIndexUrl })
644 }
645
646 authorRepos.sort((a, b) => a.label.localeCompare(b.label))
647 return { sites: toRepoDataEchoExtensions(extensions), authorRepos, sitesByAuthor }
648}
649
577650function toRepoDataLNReader(plugins: LNReaderPlugin[]): RepoSite[] {
578651 const seen = new Set<string>()
579652 const sites: RepoSite[] = []
@@ -632,6 +705,7 @@ async function toRepoData(indexUrl: string, json: unknown): Promise<RepoData> {
632705export interface ExtensionRepoData {
633706 sites: Record<string, RepoData>
634707 soraAuthors: Record<string, SoraAuthorRepo[]>
708 echoAuthors: Record<string, EchoAuthorRepo[]>
635709}
636710
637711export declare const data: ExtensionRepoData
@@ -642,6 +716,7 @@ export default {
642716 const urls = collectIndexUrls()
643717 const sites: Record<string, RepoData> = {}
644718 const soraAuthors: Record<string, SoraAuthorRepo[]> = {}
719 const echoAuthors: Record<string, EchoAuthorRepo[]> = {}
645720 await Promise.all(urls.map(async url => {
646721 const json = await fetchIndex(url)
647722 if (isSoraRepoIndex(json)) {
@@ -651,8 +726,15 @@ export default {
651726 Object.assign(sites, result.sitesByAuthor)
652727 return
653728 }
729 if (isEchoExtensionList(json)) {
730 const result = loadEchoExtensionList(url, json)
731 sites[url] = { sites: result.sites }
732 echoAuthors[url] = result.authorRepos
733 Object.assign(sites, result.sitesByAuthor)
734 return
735 }
654736 sites[url] = await toRepoData(url, json)
655737 }))
656 return { sites, soraAuthors }
738 return { sites, soraAuthors, echoAuthors }
657739 }
658740}
docs/ext/misc.md +46
@@ -74,6 +74,52 @@ og:
7474:::
7575
7676
77## Echo
78
79::: extrepo {scheme=echo}
80
81== Extensions
82- url: https://github.com/brahmkshatriya/echo
83- raw: https://raw.githubusercontent.com/itsmechinmoy/echo-extensions/refs/heads/main/echo_extensions.json
84
85:::
86
87<collapsible title="Quick Add via Code or Link">
88
891. **Open the Echo app.**
902. Tap the :material-symbols-stream-rounded: **Extension** icon in the app.
913. Tap :material-symbols-add-circle-outline-rounded: **Add Extension**.
924. Enter a shortcode or paste a URL from the table below.
935. Tap **Add**.
946. A list of available extensions will appear.
957. Select the extensions you want to install.
968. Tap **Add** again.
979. For each extension, the **Extension Installer** will appear. Tap **Install** to complete.
98
99| Extension | Code | Direct Link|
100|-|-|-|
101| All-in-one :s: | `extension` | [All-in-one](https://raw.githubusercontent.com/itsmechinmoy/echo-extensions/main/echo_extensions.json) |
102| EchoDown | `echodown` | [EchoDown](https://gist.githubusercontent.com/LuftVerbot/81f8748205dc7fc419269c59e7cffdb1/raw/993b221af28a01a6380fd36692935b670a18ee43/echo_extensions.json) |
103
104<div class="video_wrapper"><iframe src="https://www.youtube.com/embed/l9WsxYekKfY" frameborder="0" allowfullscreen></iframe></div>
105
106</collapsible>
107
108
109<collapsible title="Manual Install via File">
110
1111. Go to the [Repositories](#extension-repositories) tab below and choose a repository for the extension you want.
1122. Download the latest `.apk` or `.eapk` file from the repository link.
1133. Open the Echo app.
1144. Tap the :material-symbols-stream-rounded: **Extension** icon.
1155. Tap :material-symbols-add-circle-outline-rounded: **Add Extension**, then select **File**.
1166. Tap **Add** and select the downloaded `.apk` or `.eapk` file.
1177. The **Extension Installer** will appear. Tap **Install** to finish.
118
119<div class="video_wrapper"><iframe src="https://www.youtube.com/embed/QTP9PruoH8c" frameborder="0" allowfullscreen></iframe></div>
120
121</collapsible>
122
77123## Hayase
78124
79125::: extrepo {scheme=hayase}