chore: lint and fmt
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<script lang="ts" setup>
|
||||
import { onBeforeMount, ref } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { onBeforeMount, ref } from "vue"
|
||||
import { useRoute, useRouter } from "vue-router"
|
||||
|
||||
import { useGitHubLogin } from '@/hooks/useGitHubLogin.hook'
|
||||
import { signIn } from '@/modules/user/service/signIn'
|
||||
import { useGitHubLogin } from "@/hooks/useGitHubLogin.hook"
|
||||
import { signIn } from "@/modules/user/service/signIn"
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
@@ -16,14 +16,14 @@ onBeforeMount(async () => {
|
||||
if (code) {
|
||||
const token = await signIn(code.toString())
|
||||
|
||||
if ('error' in token) {
|
||||
if ("error" in token) {
|
||||
hasError.value = true
|
||||
} else {
|
||||
token.access_token
|
||||
saveCredentials(token)
|
||||
}
|
||||
|
||||
router.replace({ name: 'Home' })
|
||||
router.replace({ name: "Home" })
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { useRouter, type RouteLocationRaw } from "vue-router"
|
||||
import { type RouteLocationRaw, useRouter } from "vue-router"
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{ fallback?: RouteLocationRaw; preferFallback?: boolean }>(),
|
||||
{ preferFallback: true },
|
||||
{ preferFallback: true }
|
||||
)
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
@@ -6,9 +6,10 @@ import {
|
||||
onMounted,
|
||||
onUnmounted,
|
||||
toRefs,
|
||||
watch,
|
||||
watch
|
||||
} from "vue"
|
||||
|
||||
import SkeletonLoader from "@/components/SkeletonLoader.vue"
|
||||
import StackedNote from "@/components/StackedNote.vue"
|
||||
import { useLinks } from "@/hooks/useLinks.hook"
|
||||
import { markdownBuilder } from "@/hooks/useMarkdown.hook"
|
||||
@@ -19,10 +20,9 @@ import { useVisitRepo } from "@/modules/history/hooks/useVisitRepo.hook"
|
||||
import CacheAllNotes from "@/modules/note/components/CacheAllNote.vue"
|
||||
import { useUserRepoStore } from "@/modules/repo/store/userRepo.store"
|
||||
import { useUserSettings } from "@/modules/user/hooks/useUserSettings.hook"
|
||||
import SkeletonLoader from "@/components/SkeletonLoader.vue"
|
||||
|
||||
const HeaderNote = defineAsyncComponent(
|
||||
() => import("@/components/HeaderNote.vue"),
|
||||
() => import("@/components/HeaderNote.vue")
|
||||
)
|
||||
|
||||
const props = withDefaults(
|
||||
@@ -38,8 +38,8 @@ const props = withDefaults(
|
||||
content: null,
|
||||
parseContent: true,
|
||||
withContent: true,
|
||||
withHeader: true,
|
||||
},
|
||||
withHeader: true
|
||||
}
|
||||
)
|
||||
|
||||
const user = computed(() => props.user)
|
||||
@@ -61,7 +61,7 @@ const renderedContent = computed(() =>
|
||||
? props.parseContent
|
||||
? toHTML(props.content)
|
||||
: props.content
|
||||
: store.readme,
|
||||
: store.readme
|
||||
)
|
||||
|
||||
const isLoading = computed(() => renderedContent.value === undefined)
|
||||
@@ -73,7 +73,7 @@ watch(
|
||||
await nextTick()
|
||||
listenToClick()
|
||||
},
|
||||
{ immediate: true },
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
watch(
|
||||
@@ -81,7 +81,7 @@ watch(
|
||||
() => {
|
||||
store.setUserRepo(props.user, props.repo)
|
||||
},
|
||||
{ immediate: true },
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
onMounted(() => visitRepo())
|
||||
|
||||
@@ -9,7 +9,7 @@ const store = useUserRepoStore()
|
||||
|
||||
const fontFamilies = computed(() => store.userSettings?.fontFamilies ?? [])
|
||||
const sortedFontFamilies = computed(() =>
|
||||
[...fontFamilies.value].sort((a, b) => a.localeCompare(b)),
|
||||
[...fontFamilies.value].sort((a, b) => a.localeCompare(b))
|
||||
)
|
||||
const fontSizes = Array.from({ length: 7 }, (_, i) => `${9 + i * 2}pt`)
|
||||
</script>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script lang="ts" setup>
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useRouter } from "vue-router"
|
||||
|
||||
const { push } = useRouter()
|
||||
|
||||
const back = () =>
|
||||
push({
|
||||
name: 'Home'
|
||||
name: "Home"
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script lang="ts" setup>
|
||||
const url = new URL('https://github.com/login/oauth/authorize')
|
||||
url.searchParams.append('client_id', 'Iv1.87be14adcc912fa0')
|
||||
url.searchParams.append('redirect_uri', location.href)
|
||||
url.searchParams.append('scope', 'repo')
|
||||
const url = new URL("https://github.com/login/oauth/authorize")
|
||||
url.searchParams.append("client_id", "Iv1.87be14adcc912fa0")
|
||||
url.searchParams.append("redirect_uri", location.href)
|
||||
url.searchParams.append("scope", "repo")
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { PublicNoteListItem } from "@/modules/note/models/Note"
|
||||
import { toShortDid } from "@/modules/atproto/shortDid"
|
||||
import { slugify } from "@/utils/slugify"
|
||||
import { vInfiniteScroll } from "@vueuse/components"
|
||||
|
||||
import { toShortDid } from "@/modules/atproto/shortDid"
|
||||
import { PublicNoteListItem } from "@/modules/note/models/Note"
|
||||
import { slugify } from "@/utils/slugify"
|
||||
|
||||
defineProps<{
|
||||
notes: PublicNoteListItem[]
|
||||
canLoadMore: boolean
|
||||
@@ -28,8 +29,8 @@ defineSlots<{
|
||||
params: {
|
||||
shortDid: toShortDid(note.did),
|
||||
rkey: note.rkey,
|
||||
slug: slugify(note.title),
|
||||
},
|
||||
slug: slugify(note.title)
|
||||
}
|
||||
}"
|
||||
class="btn btn-link"
|
||||
>{{ note.title }}</router-link
|
||||
|
||||
@@ -26,8 +26,8 @@ const getStyle = (seed: string) => {
|
||||
name: 'FluxNoteView',
|
||||
params: {
|
||||
user: username,
|
||||
repo: favoriteRepo.name,
|
||||
},
|
||||
repo: favoriteRepo.name
|
||||
}
|
||||
}"
|
||||
class="btn"
|
||||
:style="getStyle(`${favoriteRepo.name}-${username}`)"
|
||||
|
||||
@@ -3,15 +3,16 @@ import { ref } from "vue"
|
||||
|
||||
import { useATProtoLogin } from "@/hooks/useATProtoLogin.hook"
|
||||
|
||||
const { handle, isLoggedIn, isATProtoReady, signIn, signOut } = useATProtoLogin()
|
||||
const { handle, isLoggedIn, isATProtoReady, signIn, signOut } =
|
||||
useATProtoLogin()
|
||||
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
withSignOut?: boolean
|
||||
}>(),
|
||||
{
|
||||
withSignOut: true,
|
||||
},
|
||||
withSignOut: true
|
||||
}
|
||||
)
|
||||
|
||||
const inputHandle = ref("")
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
nextTick,
|
||||
onMounted,
|
||||
ref,
|
||||
watch,
|
||||
watch
|
||||
} from "vue"
|
||||
|
||||
import { useEditionMode } from "@/hooks/useEditionMode"
|
||||
@@ -13,20 +13,20 @@ import { useFile } from "@/hooks/useFile.hook"
|
||||
import { useGitHubContent } from "@/hooks/useGitHubContent.hook"
|
||||
import { useImages } from "@/hooks/useImages.hook"
|
||||
import { useLinks } from "@/hooks/useLinks.hook"
|
||||
import { runMermaid, useShikiji } from "@/hooks/useMarkdown.hook"
|
||||
import { useNoteOverlay } from "@/hooks/useNoteOverlay.hook"
|
||||
import { useRouteQueryStackedNotes } from "@/hooks/useRouteQueryStackedNotes.hook"
|
||||
import { useTitleNotes } from "@/hooks/useTitleNotes.hook"
|
||||
import { useUserRepoStore } from "@/modules/repo/store/userRepo.store"
|
||||
import { encodeUTF8ToBase64 } from "@/utils/decodeBase64ToUTF8"
|
||||
import { filenameToNoteTitle } from "@/utils/noteTitle"
|
||||
import { runMermaid, useShikiji } from "@/hooks/useMarkdown.hook"
|
||||
|
||||
const LinkedNotes = defineAsyncComponent(
|
||||
() => import("@/components/LinkedNotes.vue"),
|
||||
() => import("@/components/LinkedNotes.vue")
|
||||
)
|
||||
|
||||
const EditNote = defineAsyncComponent(
|
||||
() => import("@/modules/note/components/EditNote.vue"),
|
||||
() => import("@/modules/note/components/EditNote.vue")
|
||||
)
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -50,7 +50,7 @@ const {
|
||||
rawContent,
|
||||
getRawContent,
|
||||
saveCacheNote,
|
||||
getEditedSha,
|
||||
getEditedSha
|
||||
} = useFile(sha)
|
||||
const initialRawContent = ref<string | null>(null)
|
||||
const className = computed(() => `stacked-note-${props.index}`)
|
||||
@@ -67,7 +67,7 @@ const breadcrumbs = computed(() => displayedTitle.value.split(" / "))
|
||||
|
||||
const { updateFile } = useGitHubContent({
|
||||
user: user.value,
|
||||
repo: repo.value,
|
||||
repo: repo.value
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
@@ -115,7 +115,7 @@ watch(mode, async (newMode) => {
|
||||
const newSha = await updateFile({
|
||||
content: rawContent.value,
|
||||
path: path.value,
|
||||
sha: editedSha,
|
||||
sha: editedSha
|
||||
})
|
||||
|
||||
if (!newSha) {
|
||||
@@ -125,7 +125,7 @@ watch(mode, async (newMode) => {
|
||||
}
|
||||
|
||||
await saveCacheNote(encodeUTF8ToBase64(rawContent.value), {
|
||||
editedSha: newSha,
|
||||
editedSha: newSha
|
||||
})
|
||||
initialRawContent.value = rawContent.value
|
||||
})
|
||||
@@ -137,7 +137,7 @@ watch(mode, async (newMode) => {
|
||||
:class="{
|
||||
[className]: true,
|
||||
overlay: displayNoteOverlay,
|
||||
[`note-${sha}`]: true,
|
||||
[`note-${sha}`]: true
|
||||
}"
|
||||
>
|
||||
<a
|
||||
@@ -198,7 +198,9 @@ watch(mode, async (newMode) => {
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||
<path d="M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2" />
|
||||
<path
|
||||
d="M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2"
|
||||
/>
|
||||
<path d="M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" />
|
||||
<path d="M14 4l0 4l-6 0l0 -4" />
|
||||
</svg>
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
<script lang="ts" setup>
|
||||
import { computedAsync } from "@vueuse/core"
|
||||
import { computed, nextTick, ref, watch } from "vue"
|
||||
import { useRoute } from "vue-router"
|
||||
import { errorMessage } from "@/utils/notif"
|
||||
|
||||
import SkeletonLoader from "@/components/SkeletonLoader.vue"
|
||||
import { useATProtoLinks } from "@/hooks/useATProtoLinks.hook"
|
||||
import { markdownBuilder } from "@/hooks/useMarkdown.hook"
|
||||
import { useNoteOverlay } from "@/hooks/useNoteOverlay.hook"
|
||||
import { useRouteQueryStackedNotes } from "@/hooks/useRouteQueryStackedNotes.hook"
|
||||
import { markdownBuilder } from "@/hooks/useMarkdown.hook"
|
||||
import { computedAsync } from "@vueuse/core"
|
||||
import { getUrl } from "@/modules/atproto/getUrl"
|
||||
import { withATProtoImages } from "@/modules/atproto/withATProtoImages"
|
||||
import { getAuthor } from "@/modules/atproto/getAuthor"
|
||||
import { fromShortDid } from "@/modules/atproto/shortDid"
|
||||
import { getUrl } from "@/modules/atproto/getUrl"
|
||||
import { PublicNoteRecord } from "@/modules/atproto/publicNote.types"
|
||||
import SkeletonLoader from "@/components/SkeletonLoader.vue"
|
||||
import { fromShortDid } from "@/modules/atproto/shortDid"
|
||||
import { withATProtoImages } from "@/modules/atproto/withATProtoImages"
|
||||
import { errorMessage } from "@/utils/notif"
|
||||
|
||||
const props = defineProps<{
|
||||
didrkey: string
|
||||
@@ -28,7 +29,7 @@ const index = computed(() => props.index)
|
||||
|
||||
const author = computedAsync(async () => getAuthor(did.value))
|
||||
const url = computedAsync(async () =>
|
||||
getUrl({ did: did.value, rkey: rkey.value }),
|
||||
getUrl({ did: did.value, rkey: rkey.value })
|
||||
)
|
||||
|
||||
const className = computed(() => `stacked-note-${props.index}`)
|
||||
@@ -36,13 +37,13 @@ const titleClassName = computed(() => `title-${className.value}`)
|
||||
|
||||
const route = useRoute()
|
||||
const mainNoteId = computed(
|
||||
() => `${route.params.shortDid}-${route.params.rkey}`,
|
||||
() => `${route.params.shortDid}-${route.params.rkey}`
|
||||
)
|
||||
|
||||
const { scrollToFocusedNote } = useRouteQueryStackedNotes()
|
||||
const { listenToClick } = useATProtoLinks(className.value, {
|
||||
currentAtUri: didrkey,
|
||||
mainNoteId,
|
||||
mainNoteId
|
||||
})
|
||||
const { displayNoteOverlay } = useNoteOverlay(className.value, index)
|
||||
|
||||
@@ -69,10 +70,10 @@ const content = computed(() =>
|
||||
? toHTML(
|
||||
withATProtoImages(noteRecord.value.value.content, {
|
||||
pds: author.value.pds,
|
||||
did: did.value,
|
||||
}),
|
||||
did: did.value
|
||||
})
|
||||
)
|
||||
: "",
|
||||
: ""
|
||||
)
|
||||
|
||||
watch(
|
||||
@@ -81,7 +82,7 @@ watch(
|
||||
await nextTick()
|
||||
listenToClick()
|
||||
},
|
||||
{ immediate: true },
|
||||
{ immediate: true }
|
||||
)
|
||||
</script>
|
||||
|
||||
@@ -91,7 +92,7 @@ watch(
|
||||
:class="{
|
||||
[className]: true,
|
||||
overlay: displayNoteOverlay,
|
||||
[`note-${classNameId}`]: true,
|
||||
[`note-${classNameId}`]: true
|
||||
}"
|
||||
>
|
||||
<a
|
||||
|
||||
@@ -77,7 +77,7 @@ const { userInput, repoInput, submit } = useForm()
|
||||
<router-link
|
||||
:to="{
|
||||
name: 'FluxNoteView',
|
||||
params: { user: 'remanso-space', repo: 'getting-started' },
|
||||
params: { user: 'remanso-space', repo: 'getting-started' }
|
||||
}"
|
||||
class="btn btn-sm"
|
||||
>Get started</router-link
|
||||
|
||||
Reference in New Issue
Block a user