diff --git a/.agents/.claude-plugin/plugin.json b/.agents/.claude-plugin/plugin.json
new file mode 100644
index 0000000..4bd1b21
--- /dev/null
+++ b/.agents/.claude-plugin/plugin.json
@@ -0,0 +1,8 @@
+{
+ "name": "remanso-skills",
+ "version": "1.0.0",
+ "description": "Local skills for the Remanso project",
+ "author": {
+ "name": "julien"
+ }
+}
diff --git a/.oxfmtrc.json b/.oxfmtrc.json
index 2d1b127..62ace94 100644
--- a/.oxfmtrc.json
+++ b/.oxfmtrc.json
@@ -1,7 +1,7 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"semi": false,
- "singleQuote": true,
+ "singleQuote": false,
"trailingComma": "none",
"printWidth": 80,
"sortPackageJson": false,
diff --git a/_scripts/change-theme-dark.ts b/_scripts/change-theme-dark.ts
index 293fa01..65ce595 100644
--- a/_scripts/change-theme-dark.ts
+++ b/_scripts/change-theme-dark.ts
@@ -3,28 +3,28 @@
// Script pour changer facilement le thème sombre de l'application Remanso
// Usage: pnpm run theme:dark [theme-name]
-import { readFileSync, writeFileSync } from 'fs'
-import { join } from 'path'
+import { readFileSync, writeFileSync } from "fs"
+import { join } from "path"
-import { commitTheme } from './change-theme'
+import { commitTheme } from "./change-theme"
// Chemins vers les fichiers
-const themeConfigPath = join(__dirname, '..', 'src', 'theme.config.ts')
-const appCssPath = join(__dirname, '..', 'src', 'styles', 'app.css')
+const themeConfigPath = join(__dirname, "..", "src", "theme.config.ts")
+const appCssPath = join(__dirname, "..", "src", "styles", "app.css")
// Vérifier les arguments
if (process.argv.length < 3) {
- console.log('Usage: pnpm run theme:dark [theme-name]')
- console.log('Exemple: pnpm run theme:dark business')
+ console.log("Usage: pnpm run theme:dark [theme-name]")
+ console.log("Exemple: pnpm run theme:dark business")
process.exit(1)
}
// Mode fixé à dark pour ce script
-const mode = 'dark'
+const mode = "dark"
const newTheme = process.argv[2] // nom du nouveau thème
// Lire le contenu actuel du fichier de configuration
-let themeConfigContent = readFileSync(themeConfigPath, 'utf8')
+let themeConfigContent = readFileSync(themeConfigPath, "utf8")
// Remplacer la valeur du thème sombre
themeConfigContent = themeConfigContent.replace(
@@ -36,7 +36,7 @@ themeConfigContent = themeConfigContent.replace(
writeFileSync(themeConfigPath, themeConfigContent)
// Mettre à jour également le fichier app.css pour le thème --prefersdark
-let appCssContent = readFileSync(appCssPath, 'utf8')
+let appCssContent = readFileSync(appCssPath, "utf8")
appCssContent = appCssContent.replace(
/(\s+)([a-zA-Z0-9-]+)(\s+--prefersdark;)/,
`$1${newTheme}$3`
diff --git a/_scripts/change-theme-light.ts b/_scripts/change-theme-light.ts
index b3d703a..6f9fcb8 100644
--- a/_scripts/change-theme-light.ts
+++ b/_scripts/change-theme-light.ts
@@ -3,29 +3,29 @@
// Script pour changer facilement le thème clair de l'application Remanso
// Usage: pnpm run theme:light [theme-name]
-import { readFileSync, writeFileSync } from 'fs'
-import { join } from 'path'
+import { readFileSync, writeFileSync } from "fs"
+import { join } from "path"
-import { commitTheme } from './change-theme'
+import { commitTheme } from "./change-theme"
// Chemins vers les fichiers
-const themeConfigPath = join(__dirname, '..', 'src', 'theme.config.ts')
-const indexPath = join(__dirname, '..', 'index.html')
-const appCssPath = join(__dirname, '..', 'src', 'styles', 'app.css')
+const themeConfigPath = join(__dirname, "..", "src", "theme.config.ts")
+const indexPath = join(__dirname, "..", "index.html")
+const appCssPath = join(__dirname, "..", "src", "styles", "app.css")
// Vérifier les arguments
if (process.argv.length < 3) {
- console.log('Usage: pnpm run theme:light [theme-name]')
- console.log('Exemple: pnpm run theme:light cupcake')
+ console.log("Usage: pnpm run theme:light [theme-name]")
+ console.log("Exemple: pnpm run theme:light cupcake")
process.exit(1)
}
// Mode fixé à light pour ce script
-const mode = 'light'
+const mode = "light"
const newTheme = process.argv[2] // nom du nouveau thème
// Lire le contenu actuel du fichier de configuration
-let themeConfigContent = readFileSync(themeConfigPath, 'utf8')
+let themeConfigContent = readFileSync(themeConfigPath, "utf8")
// Remplacer la valeur du thème clair
themeConfigContent = themeConfigContent.replace(
@@ -37,7 +37,7 @@ themeConfigContent = themeConfigContent.replace(
writeFileSync(themeConfigPath, themeConfigContent)
// Mettre à jour également le fichier index.html
-let indexContent = readFileSync(indexPath, 'utf8')
+let indexContent = readFileSync(indexPath, "utf8")
indexContent = indexContent.replace(
/data-theme="[^"]*"/,
`data-theme="${newTheme}"`
@@ -45,7 +45,7 @@ indexContent = indexContent.replace(
writeFileSync(indexPath, indexContent)
// Mettre à jour également le fichier app.css pour le thème --default
-let appCssContent = readFileSync(appCssPath, 'utf8')
+let appCssContent = readFileSync(appCssPath, "utf8")
appCssContent = appCssContent.replace(
/(\s+)([a-zA-Z0-9-]+)(\s+--default,)/,
`$1${newTheme}$3`
diff --git a/_scripts/change-theme.ts b/_scripts/change-theme.ts
index 556d263..56be997 100644
--- a/_scripts/change-theme.ts
+++ b/_scripts/change-theme.ts
@@ -1,22 +1,22 @@
-import { execSync } from 'child_process'
+import { execSync } from "child_process"
export const commitTheme = (mode: string, newTheme: string) => {
// Créer un commit avec les changements
try {
// Ajouter tous les fichiers modifiés
- execSync('git add .', { stdio: 'inherit' })
+ execSync("git add .", { stdio: "inherit" })
// Créer le commit avec le message approprié
const commitMessage = `design: change ${mode} theme to ${newTheme}`
- execSync(`git commit -m "${commitMessage}"`, { stdio: 'inherit' })
+ execSync(`git commit -m "${commitMessage}"`, { stdio: "inherit" })
console.log(`Commit créé avec succès: "${commitMessage}"`)
- execSync(`git push`, { stdio: 'inherit' })
+ execSync(`git push`, { stdio: "inherit" })
console.log(`Push sur origin`)
} catch (error) {
- console.error('Erreur lors de la création du commit:', error)
+ console.error("Erreur lors de la création du commit:", error)
process.exit(1)
}
}
diff --git a/babel.config.js b/babel.config.js
index 716b023..db68ff1 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -1,3 +1,3 @@
module.exports = {
- presets: ['@vue/cli-plugin-babel/preset']
+ presets: ["@vue/cli-plugin-babel/preset"]
}
diff --git a/docs/bugs/rolldown-while-in-globalThis.md b/docs/bugs/rolldown-while-in-globalThis.md
index f977cf1..b0b2dd4 100644
--- a/docs/bugs/rolldown-while-in-globalThis.md
+++ b/docs/bugs/rolldown-while-in-globalThis.md
@@ -26,7 +26,7 @@ Rolldown's minifier drops the `while(`/`for(;` keyword when a `while (x in globa
File: `node_modules/@ark/schema/out/shared/registry.js`
```js
-let _registryName = '$ark'
+let _registryName = "$ark"
let suffix = 2
while (_registryName in globalThis) _registryName = `$ark${suffix++}`
export const registryName = _registryName
diff --git a/postcss.config.js b/postcss.config.js
index 375342d..586b12c 100644
--- a/postcss.config.js
+++ b/postcss.config.js
@@ -1,3 +1,3 @@
module.exports = {
- plugins: { '@tailwindcss/postcss': {}, autoprefixer: {} }
+ plugins: { "@tailwindcss/postcss": {}, autoprefixer: {} }
}
diff --git a/pwa-assets.config.ts b/pwa-assets.config.ts
index 145bd5f..d661d2a 100644
--- a/pwa-assets.config.ts
+++ b/pwa-assets.config.ts
@@ -1,9 +1,9 @@
import {
defineConfig,
minimal2023Preset as preset
-} from '@vite-pwa/assets-generator/config'
+} from "@vite-pwa/assets-generator/config"
export default defineConfig({
preset,
- images: ['public/favicon.png']
+ images: ["public/favicon.png"]
})
diff --git a/src/analytics/openpanel.ts b/src/analytics/openpanel.ts
index 241f100..2470997 100644
--- a/src/analytics/openpanel.ts
+++ b/src/analytics/openpanel.ts
@@ -5,5 +5,5 @@ export const op = new OpenPanel({
clientId: "038a6aac-19bb-4a7f-9aae-2d0201fead5b",
trackScreenViews: true,
trackOutgoingLinks: true,
- trackAttributes: true,
+ trackAttributes: true
})
diff --git a/src/bus/backlinkEventBus.ts b/src/bus/backlinkEventBus.ts
index 94b1133..6de6873 100644
--- a/src/bus/backlinkEventBus.ts
+++ b/src/bus/backlinkEventBus.ts
@@ -1,4 +1,4 @@
-import { createEventBus } from 'retrobus'
+import { createEventBus } from "retrobus"
interface EventBusParams {
fileSha: string
diff --git a/src/bus/noteEventBus.ts b/src/bus/noteEventBus.ts
index 0cd507a..62698a4 100644
--- a/src/bus/noteEventBus.ts
+++ b/src/bus/noteEventBus.ts
@@ -1,4 +1,4 @@
-import { createEventBus } from 'retrobus'
+import { createEventBus } from "retrobus"
interface EventBusParams {
user: string
diff --git a/src/components/AuthorizeUser.vue b/src/components/AuthorizeUser.vue
index f46a861..2aed7f0 100644
--- a/src/components/AuthorizeUser.vue
+++ b/src/components/AuthorizeUser.vue
@@ -1,9 +1,9 @@
diff --git a/src/components/BackButton.vue b/src/components/BackButton.vue
index d8e3471..22a385f 100644
--- a/src/components/BackButton.vue
+++ b/src/components/BackButton.vue
@@ -1,9 +1,9 @@
diff --git a/src/components/GoBack.vue b/src/components/GoBack.vue
index 507b691..2ed98c5 100644
--- a/src/components/GoBack.vue
+++ b/src/components/GoBack.vue
@@ -1,11 +1,11 @@
diff --git a/src/components/LoginGithub.vue b/src/components/LoginGithub.vue
index 7fb0371..3ab8551 100644
--- a/src/components/LoginGithub.vue
+++ b/src/components/LoginGithub.vue
@@ -1,8 +1,8 @@
diff --git a/src/components/PublicNoteList.vue b/src/components/PublicNoteList.vue
index 075c245..b68c031 100644
--- a/src/components/PublicNoteList.vue
+++ b/src/components/PublicNoteList.vue
@@ -1,9 +1,10 @@
@@ -91,7 +92,7 @@ watch(
:class="{
[className]: true,
overlay: displayNoteOverlay,
- [`note-${classNameId}`]: true,
+ [`note-${classNameId}`]: true
}"
>
Get started {
if (cached === undefined) {
cached = parseInt(
getComputedStyle(document.documentElement).getPropertyValue(
- "--note-width",
- ),
+ "--note-width"
+ )
)
}
return cached
diff --git a/src/data/DataType.enum.ts b/src/data/DataType.enum.ts
index 5fb4e12..f5fe27b 100644
--- a/src/data/DataType.enum.ts
+++ b/src/data/DataType.enum.ts
@@ -1,11 +1,11 @@
export enum DataType {
- GithubAccessToken = 'GithubAccessToken',
- FavoriteRepo = 'FavoriteRepo',
- SavedRepo = 'SavedRepo',
- Note = 'Note',
- BacklinkNote = 'BacklinkNote',
- RepetitionCard = 'RepetitionCard',
- History = 'History',
- UserSettings = 'UserSettings',
- AtprotoSession = 'AtprotoSession'
+ GithubAccessToken = "GithubAccessToken",
+ FavoriteRepo = "FavoriteRepo",
+ SavedRepo = "SavedRepo",
+ Note = "Note",
+ BacklinkNote = "BacklinkNote",
+ RepetitionCard = "RepetitionCard",
+ History = "History",
+ UserSettings = "UserSettings",
+ AtprotoSession = "AtprotoSession"
}
diff --git a/src/data/data.ts b/src/data/data.ts
index f0dc3b5..0029dd9 100644
--- a/src/data/data.ts
+++ b/src/data/data.ts
@@ -21,7 +21,7 @@ class Data {
constructor() {
try {
this.locale = new PouchDb("remanso", {
- adapter: "indexeddb",
+ adapter: "indexeddb"
})
} catch (error) {
console.warn("data error", error)
@@ -40,7 +40,7 @@ class Data {
}
public async update>(
- model: T,
+ model: T
): Promise {
try {
if (!model._id) {
@@ -71,7 +71,7 @@ class Data {
}
const result = await this.locale?.put({
...doc,
- _deleted: true,
+ _deleted: true
})
return result?.ok ?? false
} catch {
@@ -80,7 +80,7 @@ class Data {
}
public async get>(
- id: string,
+ id: string
): Promise {
try {
return ((await this.locale?.get(id)) as T) || null
@@ -91,7 +91,7 @@ class Data {
public async getOrCreate>(
id: string,
- initialValue: T,
+ initialValue: T
): Promise {
const element = await this.get(id)
@@ -108,7 +108,7 @@ class Data {
prefix,
includeDocs = true,
includeAttachments = false,
- keys = [],
+ keys = []
}: GetAllParams): Promise {
if (!this.locale) {
return []
@@ -118,7 +118,7 @@ class Data {
const response = await this.locale.allDocs({
include_docs: includeDocs,
attachments: includeAttachments,
- keys: keys.map((key) => this.generateId(prefix, key)),
+ keys: keys.map((key) => this.generateId(prefix, key))
})
if (includeDocs) {
@@ -148,7 +148,7 @@ class Data {
include_docs: includeDocs,
attachments: includeAttachments,
startkey: prefix ? prefix : undefined,
- endkey: prefix ? `${prefix}\ufff0` : undefined,
+ endkey: prefix ? `${prefix}\ufff0` : undefined
})
return response.rows.map((row) => row.doc) as T[]
diff --git a/src/data/models/AtprotoSession.ts b/src/data/models/AtprotoSession.ts
index b29a795..e8edbf8 100644
--- a/src/data/models/AtprotoSession.ts
+++ b/src/data/models/AtprotoSession.ts
@@ -1,5 +1,5 @@
-import { DataType } from '@/data/DataType.enum'
-import { Model } from '@/data/models/Model'
+import { DataType } from "@/data/DataType.enum"
+import { Model } from "@/data/models/Model"
export interface AtprotoSession extends Model {
did: string
diff --git a/src/data/models/GithubAccessToken.ts b/src/data/models/GithubAccessToken.ts
index 4e0ebe8..f87f1ce 100644
--- a/src/data/models/GithubAccessToken.ts
+++ b/src/data/models/GithubAccessToken.ts
@@ -1,5 +1,5 @@
-import { DataType } from '@/data/DataType.enum'
-import { Model } from '@/data/models/Model'
+import { DataType } from "@/data/DataType.enum"
+import { Model } from "@/data/models/Model"
export interface GithubAccessToken extends Model {
username: string
diff --git a/src/data/models/History.ts b/src/data/models/History.ts
index 9cdaf1e..d81abfc 100644
--- a/src/data/models/History.ts
+++ b/src/data/models/History.ts
@@ -1,5 +1,5 @@
-import { DataType } from '@/data/DataType.enum'
-import { Model } from '@/data/models/Model'
+import { DataType } from "@/data/DataType.enum"
+import { Model } from "@/data/models/Model"
export interface History extends Model {
repos: ReadonlyArray<{
diff --git a/src/data/models/Model.ts b/src/data/models/Model.ts
index 3a202ab..e40f7f9 100644
--- a/src/data/models/Model.ts
+++ b/src/data/models/Model.ts
@@ -1,4 +1,4 @@
-import { DataType } from '../DataType.enum'
+import { DataType } from "../DataType.enum"
export interface Model {
_id?: string
diff --git a/src/hooks/useATProtoLinks.hook.ts b/src/hooks/useATProtoLinks.hook.ts
index 7a69693..8cb626f 100644
--- a/src/hooks/useATProtoLinks.hook.ts
+++ b/src/hooks/useATProtoLinks.hook.ts
@@ -1,17 +1,17 @@
import { ComputedRef, onUnmounted, Ref, toValue } from "vue"
-import { isExternalLink } from "@/utils/link"
import { useRouteQueryStackedNotes } from "@/hooks/useRouteQueryStackedNotes.hook"
import { parseAtUri } from "@/modules/atproto/parseAtUri"
import { toShortDid } from "@/modules/atproto/shortDid"
import { router } from "@/router/router"
+import { isExternalLink } from "@/utils/link"
export const useATProtoLinks = (
className: ComputedRef | string,
options: {
currentAtUri?: Ref | string | ComputedRef
mainNoteId: Ref | string | ComputedRef
- },
+ }
) => {
const { addStackedNote, scrollToFocusedNote } = useRouteQueryStackedNotes()
const { currentAtUri, mainNoteId } = options
@@ -38,7 +38,7 @@ export const useATProtoLinks = (
if (href.startsWith(window.location.origin)) {
const { params } = router.resolve(
- href.replace(window.location.origin, ""),
+ href.replace(window.location.origin, "")
)
if (!params.shortDid || !params.rkey) {
@@ -57,7 +57,7 @@ export const useATProtoLinks = (
addStackedNote(
toValue(currentAtUri) ?? "",
noteId,
- `${params.shortDid}-${params.rkey}`,
+ `${params.shortDid}-${params.rkey}`
)
return
}
@@ -111,6 +111,6 @@ export const useATProtoLinks = (
})
return {
- listenToClick,
+ listenToClick
}
}
diff --git a/src/hooks/useATProtoLogin.hook.ts b/src/hooks/useATProtoLogin.hook.ts
index 7106592..8d23be6 100644
--- a/src/hooks/useATProtoLogin.hook.ts
+++ b/src/hooks/useATProtoLogin.hook.ts
@@ -1,8 +1,16 @@
-import { computed, ref } from 'vue'
+import { computed, ref } from "vue"
-import { getAuthor } from '@/modules/atproto/getAuthor'
-import { restoreSession, sdkSignOut, signInWithHandle } from '@/modules/atproto/service/atprotoOAuth'
-import { clearSession, loadSession, saveSession } from '@/modules/atproto/service/atprotoSession'
+import { getAuthor } from "@/modules/atproto/getAuthor"
+import {
+ restoreSession,
+ sdkSignOut,
+ signInWithHandle
+} from "@/modules/atproto/service/atprotoOAuth"
+import {
+ clearSession,
+ loadSession,
+ saveSession
+} from "@/modules/atproto/service/atprotoSession"
const did = ref(null)
const handle = ref(null)
@@ -12,20 +20,24 @@ let init = true
const initializeAuth = async () => {
// Load cached session from IndexedDB first (fast, local) so the UI can render immediately
const stored = await loadSession()
- did.value = stored?.did ?? ''
- handle.value = stored?.handle ?? ''
+ did.value = stored?.did ?? ""
+ handle.value = stored?.handle ?? ""
// Then restore OAuth session in the background (may involve network)
const session = await restoreSession()
if (session) {
const author = await getAuthor(session.did)
- const resolvedHandle = author?.handle ?? ''
+ const resolvedHandle = author?.handle ?? ""
did.value = session.did
handle.value = resolvedHandle
await saveSession(session.did, resolvedHandle)
- window.history.replaceState(null, '', window.location.pathname + window.location.search)
+ window.history.replaceState(
+ null,
+ "",
+ window.location.pathname + window.location.search
+ )
}
}
@@ -47,8 +59,8 @@ export const useATProtoLogin = () => {
await sdkSignOut(did.value)
}
await clearSession()
- did.value = ''
- handle.value = ''
+ did.value = ""
+ handle.value = ""
}
return {
@@ -57,6 +69,6 @@ export const useATProtoLogin = () => {
isLoggedIn,
isATProtoReady,
signIn,
- signOut,
+ signOut
}
}
diff --git a/src/hooks/useBacklinks.hook.ts b/src/hooks/useBacklinks.hook.ts
index 31ec0ec..21bccd9 100644
--- a/src/hooks/useBacklinks.hook.ts
+++ b/src/hooks/useBacklinks.hook.ts
@@ -1,10 +1,10 @@
-import { useAsyncState } from '@vueuse/core'
-import { ComputedRef, onUnmounted, toValue } from 'vue'
+import { useAsyncState } from "@vueuse/core"
+import { ComputedRef, onUnmounted, toValue } from "vue"
-import { backlinkEventBus } from '@/bus/backlinkEventBus'
-import { data } from '@/data/data'
-import { DataType } from '@/data/DataType.enum'
-import { BacklinkNote } from '@/modules/note/models/BacklinkNote'
+import { backlinkEventBus } from "@/bus/backlinkEventBus"
+import { data } from "@/data/data"
+import { DataType } from "@/data/DataType.enum"
+import { BacklinkNote } from "@/modules/note/models/BacklinkNote"
export const useBacklinks = (sha: string | ComputedRef) => {
sha = toValue(sha)
diff --git a/src/hooks/useCheckboxCommit.hook.ts b/src/hooks/useCheckboxCommit.hook.ts
index f92ceb5..d69d140 100644
--- a/src/hooks/useCheckboxCommit.hook.ts
+++ b/src/hooks/useCheckboxCommit.hook.ts
@@ -1,5 +1,6 @@
-import { ref, Ref, toValue, onUnmounted } from "vue"
import { useDebounceFn } from "@vueuse/core"
+import { onUnmounted, Ref, ref, toValue } from "vue"
+
import { useGitHubContent } from "@/hooks/useGitHubContent.hook"
const CHECKBOX_PATTERN = /\[([ xX])\]/g
@@ -7,7 +8,7 @@ const CHECKBOX_PATTERN = /\[([ xX])\]/g
const setCheckboxInMarkdown = (
markdown: string,
index: number,
- checked: boolean,
+ checked: boolean
): string => {
let currentIndex = 0
@@ -21,7 +22,7 @@ const setCheckboxInMarkdown = (
const findCheckboxIndex = (
container: Element,
- checkbox: HTMLInputElement,
+ checkbox: HTMLInputElement
): number => {
const allCheckboxes = container.querySelectorAll('input[type="checkbox"]')
return Array.from(allCheckboxes).indexOf(checkbox)
@@ -34,7 +35,7 @@ export const useCheckboxCommit = ({
initialContent,
initialSha,
containerSelector,
- debounceMs = 1000,
+ debounceMs = 1000
}: {
user: string
repo: string
@@ -76,7 +77,7 @@ export const useCheckboxCommit = ({
const newSha = await updateFile({
content: pendingContent.value,
path: pathValue,
- sha: currentSha.value,
+ sha: currentSha.value
})
if (newSha) {
@@ -109,7 +110,7 @@ export const useCheckboxCommit = ({
pendingContent.value = setCheckboxInMarkdown(
pendingContent.value,
index,
- target.checked,
+ target.checked
)
hasPendingChanges.value = true
@@ -142,6 +143,6 @@ export const useCheckboxCommit = ({
isCommitting,
hasPendingChanges,
syncContent,
- listenToCheckboxes,
+ listenToCheckboxes
}
}
diff --git a/src/hooks/useComputeBacklinks.hook.ts b/src/hooks/useComputeBacklinks.hook.ts
index f622c19..6106326 100644
--- a/src/hooks/useComputeBacklinks.hook.ts
+++ b/src/hooks/useComputeBacklinks.hook.ts
@@ -1,18 +1,18 @@
-import { watch } from 'vue'
+import { watch } from "vue"
-import { backlinkEventBus } from '@/bus/backlinkEventBus'
-import { data } from '@/data/data'
-import { DataType } from '@/data/DataType.enum'
-import { useFile } from '@/hooks/useFile.hook'
-import { Backlink } from '@/modules/note/models/Backlink'
-import { BacklinkNote } from '@/modules/note/models/BacklinkNote'
-import { resolvePath } from '@/modules/repo/services/resolvePath'
-import { useUserRepoStore } from '@/modules/repo/store/userRepo.store'
-import { isExternalLink } from '@/utils/link'
-import { filenameToNoteTitle } from '@/utils/noteTitle'
-import { confirmMessage } from '@/utils/notif'
+import { backlinkEventBus } from "@/bus/backlinkEventBus"
+import { data } from "@/data/data"
+import { DataType } from "@/data/DataType.enum"
+import { useFile } from "@/hooks/useFile.hook"
+import { Backlink } from "@/modules/note/models/Backlink"
+import { BacklinkNote } from "@/modules/note/models/BacklinkNote"
+import { resolvePath } from "@/modules/repo/services/resolvePath"
+import { useUserRepoStore } from "@/modules/repo/store/userRepo.store"
+import { isExternalLink } from "@/utils/link"
+import { filenameToNoteTitle } from "@/utils/noteTitle"
+import { confirmMessage } from "@/utils/notif"
-const isMarkdown = (filename?: string) => filename?.endsWith('.md') ?? false
+const isMarkdown = (filename?: string) => filename?.endsWith(".md") ?? false
export const useComputeBacklinks = () => {
const store = useUserRepoStore()
@@ -51,18 +51,18 @@ export const useComputeBacklinks = () => {
}
const parser = new DOMParser()
- const htmlDoc = parser.parseFromString(note, 'text/html')
+ const htmlDoc = parser.parseFromString(note, "text/html")
- const links = htmlDoc.querySelectorAll('a')
+ const links = htmlDoc.querySelectorAll("a")
for (const link of links) {
- const href = link.getAttribute('href') ?? ''
+ const href = link.getAttribute("href") ?? ""
if (isExternalLink(href) || !isMarkdown(href)) {
continue
}
- const path = resolvePath(file.path ?? '', href)
+ const path = resolvePath(file.path ?? "", href)
const backlinkFile = store.files.find((file) => file.path === path)
if (!backlinkFile?.sha || !backlinkFile?.path) {
@@ -77,14 +77,14 @@ export const useComputeBacklinks = () => {
if (!notifiedForComputation) {
notifiedForComputation = true
- confirmMessage('Updating backlinks...')
+ confirmMessage("Updating backlinks...")
}
backlinks.set(backlinkFile.sha, [
...previousBacklinks,
{
sha: file.sha,
- title: filenameToNoteTitle(file.path ?? '')
+ title: filenameToNoteTitle(file.path ?? "")
}
])
}
diff --git a/src/hooks/useEditionMode.ts b/src/hooks/useEditionMode.ts
index b120ec2..8d941d9 100644
--- a/src/hooks/useEditionMode.ts
+++ b/src/hooks/useEditionMode.ts
@@ -1,16 +1,16 @@
-import { useMagicKeys } from '@vueuse/core'
-import { ref, watch } from 'vue'
+import { useMagicKeys } from "@vueuse/core"
+import { ref, watch } from "vue"
export const useEditionMode = () => {
- const mode = ref<'read' | 'edit'>('read')
+ const mode = ref<"read" | "edit">("read")
const toggleMode = () => {
- mode.value = mode.value === 'read' ? 'edit' : 'read'
+ mode.value = mode.value === "read" ? "edit" : "read"
}
const { escape } = useMagicKeys()
watch(escape, () => {
- if (mode.value === 'edit') {
+ if (mode.value === "edit") {
toggleMode()
}
})
diff --git a/src/hooks/useFile.hook.ts b/src/hooks/useFile.hook.ts
index 51b7fa3..4d39d2d 100644
--- a/src/hooks/useFile.hook.ts
+++ b/src/hooks/useFile.hook.ts
@@ -17,18 +17,18 @@ export const useFile = (sha: Ref | string, retrieveContent = true) => {
const {
render,
renderFromUTF8,
- getRawContent: getRawContentFromFile,
+ getRawContent: getRawContentFromFile
} = markdownBuilder(shaValue)
const { getCachedNote, saveCacheNote } = prepareNoteCache(
shaValue,
- toValue(path),
+ toValue(path)
)
const fromCache = ref(false)
const rawContent = ref("")
const content = computed(() =>
- rawContent.value ? renderFromUTF8(rawContent.value) : "",
+ rawContent.value ? renderFromUTF8(rawContent.value) : ""
)
const getEditedSha = async () => {
@@ -55,7 +55,7 @@ export const useFile = (sha: Ref | string, retrieveContent = true) => {
}
saveCacheNote(fileContent)
rawContent.value = getRawContentFromFile(fileContent)
- },
+ }
)
}
@@ -111,6 +111,6 @@ export const useFile = (sha: Ref | string, retrieveContent = true) => {
getCachedFileContent,
getEditedSha,
fromCache,
- saveCacheNote,
+ saveCacheNote
}
}
diff --git a/src/hooks/useFollowingNoteList.hook.ts b/src/hooks/useFollowingNoteList.hook.ts
index 1358d2d..923412f 100644
--- a/src/hooks/useFollowingNoteList.hook.ts
+++ b/src/hooks/useFollowingNoteList.hook.ts
@@ -1,17 +1,18 @@
+import { computedAsync } from "@vueuse/core"
+import { computed, Ref, ref, watch } from "vue"
+
import { Author, getAuthors } from "@/modules/atproto/getAuthor"
import { PublicNoteListItem } from "@/modules/note/models/Note"
-import { computedAsync } from "@vueuse/core"
-import { computed, ref, Ref, watch } from "vue"
export function useFollowingNoteList(
dids: Ref>,
- enabled: Ref,
+ enabled: Ref
) {
const isLoading = ref(false)
const notes = ref([])
const cursor = ref(null)
const canLoadMore = computed(
- () => dids.value.size > 0 && cursor.value !== undefined,
+ () => dids.value.size > 0 && cursor.value !== undefined
)
const onLoadMore = async () => {
@@ -22,7 +23,7 @@ export function useFollowingNoteList(
const body: { dids: string[]; limit: number; cursor?: string } = {
dids: [...dids.value],
- limit: 20,
+ limit: 20
}
if (cursor.value) {
@@ -32,7 +33,7 @@ export function useFollowingNoteList(
const response = await fetch("https://api.remanso.space/notes/feed", {
method: "POST",
headers: { "Content-Type": "application/json" },
- body: JSON.stringify(body),
+ body: JSON.stringify(body)
})
const data: { notes: PublicNoteListItem[]; cursor?: string } =
diff --git a/src/hooks/useFollows.hook.ts b/src/hooks/useFollows.hook.ts
index 6eea25e..1d10e34 100644
--- a/src/hooks/useFollows.hook.ts
+++ b/src/hooks/useFollows.hook.ts
@@ -1,6 +1,6 @@
-import { Ref, ref, watch } from 'vue'
+import { Ref, ref, watch } from "vue"
-import { getFollows } from '@/modules/atproto/service/getFollows'
+import { getFollows } from "@/modules/atproto/service/getFollows"
export const useFollows = (did: Ref) => {
const follows = ref>(new Set())
@@ -14,7 +14,7 @@ export const useFollows = (did: Ref) => {
follows.value = new Set()
}
},
- { immediate: true },
+ { immediate: true }
)
return { follows }
diff --git a/src/hooks/useForm.hook.ts b/src/hooks/useForm.hook.ts
index bdceb24..caf4e93 100644
--- a/src/hooks/useForm.hook.ts
+++ b/src/hooks/useForm.hook.ts
@@ -1,9 +1,9 @@
-import { ref } from 'vue'
-import { useRouter } from 'vue-router'
+import { ref } from "vue"
+import { useRouter } from "vue-router"
export const useForm = () => {
- const userInput = ref('')
- const repoInput = ref('')
+ const userInput = ref("")
+ const repoInput = ref("")
const { push } = useRouter()
const submit = () => {
@@ -12,7 +12,7 @@ export const useForm = () => {
}
push({
- name: 'FluxNoteView',
+ name: "FluxNoteView",
params: {
user: userInput.value,
repo: repoInput.value
diff --git a/src/hooks/useGitHubContent.hook.ts b/src/hooks/useGitHubContent.hook.ts
index bb2852f..68500bc 100644
--- a/src/hooks/useGitHubContent.hook.ts
+++ b/src/hooks/useGitHubContent.hook.ts
@@ -4,7 +4,7 @@ import { confirmMessage, errorMessage } from "@/utils/notif"
export const useGitHubContent = ({
user,
- repo,
+ repo
}: {
user: string
repo: string
@@ -12,7 +12,7 @@ export const useGitHubContent = ({
const putFile = async ({
content,
path,
- sha,
+ sha
}: {
content: string
path: string
@@ -29,8 +29,8 @@ export const useGitHubContent = ({
path,
message: `Updating ${path} from Remanso`,
content: encodeUTF8ToBase64(content),
- sha,
- },
+ sha
+ }
)
confirmMessage("✅ Note saved")
@@ -48,6 +48,6 @@ export const useGitHubContent = ({
updateFile: async (props: { content: string; path: string; sha: string }) =>
putFile(props),
createFile: async (props: { content: string; path: string }) =>
- putFile(props),
+ putFile(props)
}
}
diff --git a/src/hooks/useGitHubLogin.hook.ts b/src/hooks/useGitHubLogin.hook.ts
index 19dbf13..63954b1 100644
--- a/src/hooks/useGitHubLogin.hook.ts
+++ b/src/hooks/useGitHubLogin.hook.ts
@@ -1,8 +1,8 @@
-import { computed, ref } from 'vue'
+import { computed, ref } from "vue"
-import { GithubToken } from '@/modules/user/interfaces/GithubToken'
-import { getAccessToken, saveAccessToken } from '@/modules/user/service/signIn'
-import { confirmMessage } from '@/utils/notif'
+import { GithubToken } from "@/modules/user/interfaces/GithubToken"
+import { getAccessToken, saveAccessToken } from "@/modules/user/service/signIn"
+import { confirmMessage } from "@/utils/notif"
const username = ref(null)
const accessToken = ref(null)
@@ -11,8 +11,8 @@ let init = true
const saveAccessTokenToLocal = async () => {
const response = await getAccessToken()
- username.value = response?.username || ''
- accessToken.value = response?.token || ''
+ username.value = response?.username || ""
+ accessToken.value = response?.token || ""
}
const saveCredentials = async (token: GithubToken): Promise => {
diff --git a/src/hooks/useImages.hook.ts b/src/hooks/useImages.hook.ts
index f5e4612..ebb8cda 100644
--- a/src/hooks/useImages.hook.ts
+++ b/src/hooks/useImages.hook.ts
@@ -1,10 +1,10 @@
-import { computed, watch } from 'vue'
+import { computed, watch } from "vue"
-import { useFile } from '@/hooks/useFile.hook'
-import { resolvePath } from '@/modules/repo/services/resolvePath'
-import { useUserRepoStore } from '@/modules/repo/store/userRepo.store'
+import { useFile } from "@/hooks/useFile.hook"
+import { resolvePath } from "@/modules/repo/services/resolvePath"
+import { useUserRepoStore } from "@/modules/repo/store/userRepo.store"
-const SRC_PREFIX = 'data:image/jpeg;charset=utf-8;base64,'
+const SRC_PREFIX = "data:image/jpeg;charset=utf-8;base64,"
export const useImages = (sha: string) => {
const store = useUserRepoStore()
@@ -23,14 +23,14 @@ export const useImages = (sha: string) => {
const images = document.querySelectorAll(`.note-${sha} img`)
images.forEach(async (image) => {
- const src = image.getAttribute('src')
+ const src = image.getAttribute("src")
if (!src || src.startsWith(SRC_PREFIX)) {
return
}
const imageFilePath = resolvePath(
filePath,
- image.getAttribute('src') ?? ''
+ image.getAttribute("src") ?? ""
)
const imageFile = store.files.find(
@@ -43,7 +43,7 @@ export const useImages = (sha: string) => {
const { getCachedFileContent } = useFile(imageFile.sha, false)
const fileContent = await getCachedFileContent()
- image.setAttribute('src', `${SRC_PREFIX} ${fileContent}`)
+ image.setAttribute("src", `${SRC_PREFIX} ${fileContent}`)
})
},
{ immediate: true }
diff --git a/src/hooks/useLinks.hook.ts b/src/hooks/useLinks.hook.ts
index 34efb4e..62cdcbf 100644
--- a/src/hooks/useLinks.hook.ts
+++ b/src/hooks/useLinks.hook.ts
@@ -6,7 +6,7 @@ import { isExternalLink } from "@/utils/link"
export const useLinks = (
className: ComputedRef | string,
- sha?: Ref | string,
+ sha?: Ref | string
) => {
const store = useUserRepoStore()
@@ -34,7 +34,7 @@ export const useLinks = (
path: href,
currentNoteSHA: toValue(sha),
user: store.user,
- repo: store.repo,
+ repo: store.repo
})
}
@@ -74,6 +74,6 @@ export const useLinks = (
})
return {
- listenToClick,
+ listenToClick
}
}
diff --git a/src/hooks/useMarkdown.hook.ts b/src/hooks/useMarkdown.hook.ts
index 0589909..473ddd8 100644
--- a/src/hooks/useMarkdown.hook.ts
+++ b/src/hooks/useMarkdown.hook.ts
@@ -1,18 +1,18 @@
import markdownItKatex from "@vscode/markdown-it-katex"
import MarkdownIt, { Options } from "markdown-it"
+import Renderer, { type RenderRuleRecord } from "markdown-it/lib/renderer.mjs"
+import type Token from "markdown-it/lib/token.mjs"
import blockEmbedPlugin from "markdown-it-block-embed"
import markdownItCheckbox from "markdown-it-checkbox"
import MarkdownItGitHubAlerts from "markdown-it-github-alerts"
import markdownItIframe from "markdown-it-iframe"
import Shikiji from "markdown-it-shikiji"
+import mermaid from "mermaid"
import { Ref, toValue } from "vue"
import { decodeBase64ToUTF8 } from "@/utils/decodeBase64ToUTF8"
import { html5Media } from "@/utils/markdown/markdown-html5-media"
import { markdownItTablerIcons } from "@/utils/markdown/markdown-it-tabler-icons"
-import mermaid from "mermaid"
-import type Token from "markdown-it/lib/token.mjs"
-import Renderer, { type RenderRuleRecord } from "markdown-it/lib/renderer.mjs"
const markdownItMermaidExtractor = (md: MarkdownIt) => {
const defaultFence =
@@ -22,7 +22,7 @@ const markdownItMermaidExtractor = (md: MarkdownIt) => {
index: number,
options: Options,
_: unknown,
- self: Renderer,
+ self: Renderer
) {
return self.renderToken(tokens, index, options)
}
@@ -32,7 +32,7 @@ const markdownItMermaidExtractor = (md: MarkdownIt) => {
index: number,
options: Options,
env: unknown,
- self: Renderer,
+ self: Renderer
) {
const token = tokens[index]
@@ -47,20 +47,20 @@ const markdownItMermaidExtractor = (md: MarkdownIt) => {
const md = new MarkdownIt({
typographer: true,
- quotes: ["«\xA0", "\xA0»", "‹\xA0", "\xA0›"],
+ quotes: ["«\xA0", "\xA0»", "‹\xA0", "\xA0›"]
})
.use(markdownItMermaidExtractor)
.use(html5Media)
.use(blockEmbedPlugin, {
youtube: {
width: "100%",
- height: 300,
- },
+ height: 300
+ }
})
.use(markdownItCheckbox)
.use(markdownItKatex)
.use(markdownItIframe, {
- width: "100%",
+ width: "100%"
})
.use(MarkdownItGitHubAlerts)
.use(markdownItTablerIcons)
@@ -77,7 +77,7 @@ export const useShikiji = async () => {
await Shikiji({
themes: {
light: "vitesse-light",
- dark: "vitesse-black",
+ dark: "vitesse-black"
},
langs: [
"bash",
@@ -87,9 +87,9 @@ export const useShikiji = async () => {
"mermaid",
"html",
"css",
- "json",
- ],
- }),
+ "json"
+ ]
+ })
)
}
@@ -101,19 +101,19 @@ export const runMermaid = (querySelector: string) => {
mermaid.initialize({
theme: "dark",
startOnLoad: false,
- flowchart: { curve: "natural" },
+ flowchart: { curve: "natural" }
})
}
mermaid.run({
- querySelector,
+ querySelector
})
}
const rules: RenderRuleRecord = {
table_open: () =>
'',
- table_close: () => "
",
+ table_close: () => ""
}
md.renderer.rules = { ...md.renderer.rules, ...rules }
@@ -128,7 +128,7 @@ export const markdownBuilder = (defaultPrefix?: Ref | string) => {
const renderFromUTF8 = (content: string, prefix?: string) => {
return content
? md.render(stripFrontmatter(content), {
- docId: defaultPrefix ? toValue(defaultPrefix) : (prefix ?? ""),
+ docId: defaultPrefix ? toValue(defaultPrefix) : (prefix ?? "")
})
: ""
}
@@ -139,6 +139,6 @@ export const markdownBuilder = (defaultPrefix?: Ref | string) => {
render: (content: string, prefix?: string) =>
renderFromUTF8(decodeBase64ToUTF8(content), prefix),
renderFromUTF8,
- getRawContent,
+ getRawContent
}
}
diff --git a/src/hooks/useNoteOverlay.hook.ts b/src/hooks/useNoteOverlay.hook.ts
index a850e62..69ef956 100644
--- a/src/hooks/useNoteOverlay.hook.ts
+++ b/src/hooks/useNoteOverlay.hook.ts
@@ -1,13 +1,16 @@
import { computed, onMounted, Ref, ref, toValue } from "vue"
-import { BOOKMARK_WIDTH_REM, getBookmarkWidthPx } from "@/constants/bookmark-width"
+import {
+ BOOKMARK_WIDTH_REM,
+ getBookmarkWidthPx
+} from "@/constants/bookmark-width"
import { getNoteWidth } from "@/constants/note-width"
import { useOverlay } from "@/hooks/useOverlay.hook"
import { useRouteQueryStackedNotes } from "@/hooks/useRouteQueryStackedNotes.hook"
export const useNoteOverlay = (
className: string,
- index: Ref | number,
+ index: Ref | number
) => {
const { x, y, isMobile } = useOverlay()
const noteHeight = ref(0)
@@ -18,14 +21,17 @@ export const useNoteOverlay = (
if (isMobile.value) {
return y.value > valueIndex * noteHeight.value
} else {
- return x.value > valueIndex * getNoteWidth() - valueIndex * getBookmarkWidthPx()
+ return (
+ x.value >
+ valueIndex * getNoteWidth() - valueIndex * getBookmarkWidthPx()
+ )
}
})
onMounted(() => {
const { stackedNotes } = useRouteQueryStackedNotes()
const noteElement = document.querySelector(
- `.${className}`,
+ `.${className}`
) satisfies HTMLElement | null
if (!noteElement) {
@@ -40,7 +46,7 @@ export const useNoteOverlay = (
noteElement.style.left = `${(toValue(index) + 1) * BOOKMARK_WIDTH_REM}rem`
const stackedNoteContainers = document.querySelectorAll(
- ".stacked-note",
+ ".stacked-note"
) satisfies NodeListOf
stackedNoteContainers.forEach((stackedNote, ind) => {
@@ -52,6 +58,6 @@ export const useNoteOverlay = (
})
return {
- displayNoteOverlay,
+ displayNoteOverlay
}
}
diff --git a/src/hooks/useNoteView.hook.ts b/src/hooks/useNoteView.hook.ts
index a9a85ab..942905a 100644
--- a/src/hooks/useNoteView.hook.ts
+++ b/src/hooks/useNoteView.hook.ts
@@ -21,13 +21,13 @@ export const useNoteView = () => {
obj[note] = pathToNotePathTitle(filePath)
return obj
- }, {}),
+ }, {})
)
const unsubscribeLink = noteEventBus.addEventBusListener(
({ path, currentNoteSHA }) => {
const currentFile = store.files.find(
- (file) => file.sha === currentNoteSHA,
+ (file) => file.sha === currentNoteSHA
)
const absolutePath = resolvePath(currentFile?.path ?? "", path)
@@ -39,7 +39,7 @@ export const useNoteView = () => {
}
addStackedNote(currentNoteSHA ?? "", file.sha)
- },
+ }
)
onUnmounted(() => {
@@ -47,6 +47,6 @@ export const useNoteView = () => {
})
return {
- titles,
+ titles
}
}
diff --git a/src/hooks/useOfflineNotes.hook.ts b/src/hooks/useOfflineNotes.hook.ts
index c50df12..268e4a7 100644
--- a/src/hooks/useOfflineNotes.hook.ts
+++ b/src/hooks/useOfflineNotes.hook.ts
@@ -1,12 +1,12 @@
-import { useAsyncState } from '@vueuse/core'
-import { computed, ref } from 'vue'
+import { useAsyncState } from "@vueuse/core"
+import { computed, ref } from "vue"
-import { data } from '@/data/data'
-import { DataType } from '@/data/DataType.enum'
-import { prepareNoteCache } from '@/modules/note/cache/prepareNoteCache'
-import { Note } from '@/modules/note/models/Note'
-import { queryFileContent } from '@/modules/repo/services/repo'
-import { useUserRepoStore } from '@/modules/repo/store/userRepo.store'
+import { data } from "@/data/data"
+import { DataType } from "@/data/DataType.enum"
+import { prepareNoteCache } from "@/modules/note/cache/prepareNoteCache"
+import { Note } from "@/modules/note/models/Note"
+import { queryFileContent } from "@/modules/repo/services/repo"
+import { useUserRepoStore } from "@/modules/repo/store/userRepo.store"
export const useOfflineNotes = () => {
const store = useUserRepoStore()
diff --git a/src/hooks/useOverlay.hook.ts b/src/hooks/useOverlay.hook.ts
index 9e35412..d7c4853 100644
--- a/src/hooks/useOverlay.hook.ts
+++ b/src/hooks/useOverlay.hook.ts
@@ -19,11 +19,11 @@ export const useOverlay = (listen = true) => {
}
useEventListener(window, "scroll", updateScroll, {
passive: true,
- capture: false,
+ capture: false
})
useEventListener(document.body, "scroll", updateScroll, {
passive: true,
- capture: false,
+ capture: false
})
}
@@ -47,6 +47,6 @@ export const useOverlay = (listen = true) => {
x,
y,
isMobile,
- scrollToNote,
+ scrollToNote
}
}
diff --git a/src/hooks/usePublicNoteList.hook.ts b/src/hooks/usePublicNoteList.hook.ts
index a2131f4..3ab3944 100644
--- a/src/hooks/usePublicNoteList.hook.ts
+++ b/src/hooks/usePublicNoteList.hook.ts
@@ -1,7 +1,8 @@
+import { computedAsync } from "@vueuse/core"
+import { computed, Ref, ref } from "vue"
+
import { Author, getAuthors } from "@/modules/atproto/getAuthor"
import { PublicNoteListItem } from "@/modules/note/models/Note"
-import { computedAsync } from "@vueuse/core"
-import { computed, ref, Ref } from "vue"
interface UsePublicNoteListOptions {
did?: Ref
@@ -50,6 +51,6 @@ export function usePublicNoteList(options?: UsePublicNoteListOptions) {
canLoadMore,
onLoadMore,
authors,
- getAuthor,
+ getAuthor
}
}
diff --git a/src/hooks/useRepos.hook.ts b/src/hooks/useRepos.hook.ts
index 425aa9a..3b27fb0 100644
--- a/src/hooks/useRepos.hook.ts
+++ b/src/hooks/useRepos.hook.ts
@@ -1,8 +1,8 @@
-import { useAsyncState } from '@vueuse/core'
+import { useAsyncState } from "@vueuse/core"
-import { useGitHubLogin } from '@/hooks/useGitHubLogin.hook'
-import { RepoBase } from '@/modules/repo/interfaces/RepoBase'
-import { getOctokit } from '@/modules/repo/services/octo'
+import { useGitHubLogin } from "@/hooks/useGitHubLogin.hook"
+import { RepoBase } from "@/modules/repo/interfaces/RepoBase"
+import { getOctokit } from "@/modules/repo/services/octo"
export const useRepos = () => {
const { username, accessToken } = useGitHubLogin()
@@ -13,7 +13,7 @@ export const useRepos = () => {
const octokit = await getOctokit()
- const repoList = await octokit.request('GET /search/repositories', {
+ const repoList = await octokit.request("GET /search/repositories", {
q: `user:${username.value}`,
per_page: 100
})
diff --git a/src/hooks/useResizeContainer.hook.ts b/src/hooks/useResizeContainer.hook.ts
index 5f5f8c5..461d5bb 100644
--- a/src/hooks/useResizeContainer.hook.ts
+++ b/src/hooks/useResizeContainer.hook.ts
@@ -1,17 +1,17 @@
-import { onMounted, watch, type Ref } from "vue"
+import { onMounted, type Ref, watch } from "vue"
import { getNoteWidth } from "@/constants/note-width"
import { useOverlay } from "@/hooks/useOverlay.hook"
export const useResizeContainer = (
containerClass: string,
- stackedNotes: Readonly[>,
+ stackedNotes: Readonly][>
) => {
const { isMobile } = useOverlay(false)
const resizeContainer = () => {
const container = document.querySelector(
- `.${containerClass}`,
+ `.${containerClass}`
) as HTMLElement | null
if (!container) {
@@ -32,6 +32,6 @@ export const useResizeContainer = (
})
watch(stackedNotes, resizeContainer, {
- immediate: true,
+ immediate: true
})
}
diff --git a/src/hooks/useRouteQueryStackedNotes.hook.ts b/src/hooks/useRouteQueryStackedNotes.hook.ts
index 0538f04..4808f56 100644
--- a/src/hooks/useRouteQueryStackedNotes.hook.ts
+++ b/src/hooks/useRouteQueryStackedNotes.hook.ts
@@ -14,7 +14,7 @@ export const useRouteQueryStackedNotes = () => {
}
return Array.isArray(value) ? value : [value]
- },
+ }
})
const { height } = useWindowSize()
@@ -22,7 +22,7 @@ export const useRouteQueryStackedNotes = () => {
const scrollToFocusedNote = (
noteId: string | null = null,
- notes: string[] = stackedNotes.value,
+ notes: string[] = stackedNotes.value
) => {
nextTick(() => {
const index = noteId ? notes.findIndex((nid) => nid === noteId) : 0
@@ -31,7 +31,7 @@ export const useRouteQueryStackedNotes = () => {
if (noteId) {
const cleanNoteId = noteId.replaceAll(":", "-")
const element = document.querySelector(
- `.note-${cleanNoteId}`,
+ `.note-${cleanNoteId}`
) as HTMLElement
const top = (index + 1) * (element?.clientHeight ?? height.value)
@@ -53,7 +53,7 @@ export const useRouteQueryStackedNotes = () => {
const addStackedNote = (
currentSha: string,
sha: string,
- selector?: string,
+ selector?: string
) => {
if (stackedNotes.value.includes(sha)) {
scrollToFocusedNote(selector ?? sha)
@@ -70,7 +70,7 @@ export const useRouteQueryStackedNotes = () => {
const newStackedNotes = [
...splittedStackedNotes.replaceAll(";;", ";").split(";"),
currentSha,
- sha,
+ sha
].filter((sha) => !!sha)
stackedNotes.value = newStackedNotes
@@ -82,6 +82,6 @@ export const useRouteQueryStackedNotes = () => {
return {
stackedNotes: readonly(stackedNotes),
addStackedNote,
- scrollToFocusedNote,
+ scrollToFocusedNote
}
}
diff --git a/src/hooks/useTitleNotes.hook.ts b/src/hooks/useTitleNotes.hook.ts
index c2d8634..594f7a7 100644
--- a/src/hooks/useTitleNotes.hook.ts
+++ b/src/hooks/useTitleNotes.hook.ts
@@ -1,19 +1,19 @@
-import { useTitle } from '@vueuse/core'
-import { computed, Ref, toValue, watch } from 'vue'
+import { useTitle } from "@vueuse/core"
+import { computed, Ref, toValue, watch } from "vue"
-import { useRouteQueryStackedNotes } from '@/hooks/useRouteQueryStackedNotes.hook'
-import { useNotes } from '@/modules/note/hooks/useNotes'
-import { pathToNoteTitle } from '@/utils/noteTitle'
+import { useRouteQueryStackedNotes } from "@/hooks/useRouteQueryStackedNotes.hook"
+import { useNotes } from "@/modules/note/hooks/useNotes"
+import { pathToNoteTitle } from "@/utils/noteTitle"
-export const generateTitle = (titles: string[]) => titles.join(' | ')
+export const generateTitle = (titles: string[]) => titles.join(" | ")
export const useTitleNotes = (prefix: Ref | string) => {
const { stackedNotes } = useRouteQueryStackedNotes()
const { notes } = useNotes()
const titleNotes = computed(() =>
notes.value
- .filter((note) => stackedNotes.value.includes(note.sha ?? ''))
- .map((note) => pathToNoteTitle(note.path ?? ''))
+ .filter((note) => stackedNotes.value.includes(note.sha ?? ""))
+ .map((note) => pathToNoteTitle(note.path ?? ""))
)
const title = useTitle(generateTitle([toValue(prefix), ...titleNotes.value]))
diff --git a/src/locales/message.ts b/src/locales/message.ts
index 1032ff9..a1e330b 100644
--- a/src/locales/message.ts
+++ b/src/locales/message.ts
@@ -1,5 +1,5 @@
-import en from './en.json'
-import fr from './fr.json'
+import en from "./en.json"
+import fr from "./fr.json"
export const messages = {
en,
diff --git a/src/main.ts b/src/main.ts
index 441a6fb..4c34d9b 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -1,5 +1,6 @@
import "notyf/notyf.min.css"
import "./styles/app.css"
+import "@/analytics/openpanel"
import { VueQueryPlugin } from "@tanstack/vue-query"
import { createPinia } from "pinia"
@@ -10,11 +11,10 @@ import { messages } from "@/locales/message"
import { router } from "@/router/router"
import App from "./App.vue"
-import "@/analytics/openpanel"
const i18n = createI18n({
locale: "en",
- messages,
+ messages
})
createApp(App)
diff --git a/src/modules/atproto/getAuthor.ts b/src/modules/atproto/getAuthor.ts
index 0a0acc7..6eaade6 100644
--- a/src/modules/atproto/getAuthor.ts
+++ b/src/modules/atproto/getAuthor.ts
@@ -1,4 +1,4 @@
-import { createSchema, createFetch } from "@better-fetch/fetch"
+import { createFetch, createSchema } from "@better-fetch/fetch"
import { type } from "arktype"
export type Author = { handle: string; pds: string }
@@ -12,20 +12,20 @@ const schema = createSchema(
did: "string",
handle: "string",
pds: "string",
- signing_key: "string",
+ signing_key: "string"
}),
query: type({
- identifier: "string",
- }),
- },
+ identifier: "string"
+ })
+ }
},
- { strict: true },
+ { strict: true }
)
const microcosmSlingshot = createFetch({
baseURL: "https://slingshot.microcosm.blue",
// plugins: [logger()],
- schema,
+ schema
})
export const getAuthor = async (did: string): Promise => {
@@ -36,7 +36,7 @@ export const getAuthor = async (did: string): Promise => {
try {
const { data: author } = await microcosmSlingshot(
"/xrpc/blue.microcosm.identity.resolveMiniDoc",
- { query: { identifier: did } },
+ { query: { identifier: did } }
)
if (!author) {
@@ -62,7 +62,7 @@ export const getAuthors = async (dids: Set) => {
const { data: author } = await microcosmSlingshot(
"/xrpc/blue.microcosm.identity.resolveMiniDoc",
- { query: { identifier: did } },
+ { query: { identifier: did } }
)
if (!author) {
@@ -72,7 +72,7 @@ export const getAuthors = async (dids: Set) => {
correspondanceCache.set(did, author)
return [did, author] as [string, Author | null]
- }),
+ })
)
return new Map(correspondance)
diff --git a/src/modules/atproto/service/atprotoOAuth.ts b/src/modules/atproto/service/atprotoOAuth.ts
index 6dcb459..ddba9e3 100644
--- a/src/modules/atproto/service/atprotoOAuth.ts
+++ b/src/modules/atproto/service/atprotoOAuth.ts
@@ -1,6 +1,6 @@
import {
BrowserOAuthClient,
- buildLoopbackClientId,
+ buildLoopbackClientId
} from "@atproto/oauth-client-browser"
const getClientId = () =>
@@ -14,7 +14,7 @@ export const getOAuthClient = (): Promise => {
if (!clientPromise) {
clientPromise = BrowserOAuthClient.load({
clientId: getClientId(),
- handleResolver: "https://bsky.social",
+ handleResolver: "https://bsky.social"
})
}
return clientPromise
diff --git a/src/modules/atproto/service/atprotoSession.ts b/src/modules/atproto/service/atprotoSession.ts
index 0a17290..9923712 100644
--- a/src/modules/atproto/service/atprotoSession.ts
+++ b/src/modules/atproto/service/atprotoSession.ts
@@ -1,6 +1,6 @@
-import { data } from '@/data/data'
-import { DataType } from '@/data/DataType.enum'
-import { AtprotoSession } from '@/data/models/AtprotoSession'
+import { data } from "@/data/data"
+import { DataType } from "@/data/DataType.enum"
+import { AtprotoSession } from "@/data/models/AtprotoSession"
const SESSION_ID = `${DataType.AtprotoSession}-current`
@@ -8,12 +8,15 @@ export const loadSession = (): Promise => {
return data.get(SESSION_ID)
}
-export const saveSession = async (did: string, handle: string): Promise => {
+export const saveSession = async (
+ did: string,
+ handle: string
+): Promise => {
const session: AtprotoSession = {
_id: SESSION_ID,
$type: DataType.AtprotoSession,
did,
- handle,
+ handle
}
await data.update(session)
}
diff --git a/src/modules/atproto/service/getFollows.ts b/src/modules/atproto/service/getFollows.ts
index f202bf7..79e5101 100644
--- a/src/modules/atproto/service/getFollows.ts
+++ b/src/modules/atproto/service/getFollows.ts
@@ -3,15 +3,18 @@ export const getFollows = async (did: string): Promise> => {
let cursor: string | undefined
do {
- const url = new URL('https://public.api.bsky.app/xrpc/app.bsky.graph.getFollows')
- url.searchParams.set('actor', did)
- url.searchParams.set('limit', '100')
+ const url = new URL(
+ "https://public.api.bsky.app/xrpc/app.bsky.graph.getFollows"
+ )
+ url.searchParams.set("actor", did)
+ url.searchParams.set("limit", "100")
if (cursor) {
- url.searchParams.set('cursor', cursor)
+ url.searchParams.set("cursor", cursor)
}
const response = await fetch(url)
- const result: { follows: { did: string }[]; cursor?: string } = await response.json()
+ const result: { follows: { did: string }[]; cursor?: string } =
+ await response.json()
for (const follow of result.follows) {
follows.add(follow.did)
diff --git a/src/modules/atproto/withATProtoImages.ts b/src/modules/atproto/withATProtoImages.ts
index 72053fe..30ea6e5 100644
--- a/src/modules/atproto/withATProtoImages.ts
+++ b/src/modules/atproto/withATProtoImages.ts
@@ -1,6 +1,6 @@
export const withATProtoImages = (
markdown: string,
- { pds, did }: { pds: string; did: string },
+ { pds, did }: { pds: string; did: string }
): string => {
const imageLinkPattern = /!\[([^\]]*)\]\((bafkrei[a-z0-9]+)\)/g
diff --git a/src/modules/card/components/FlipCardList.vue b/src/modules/card/components/FlipCardList.vue
index 86f08e3..f1c9ad6 100644
--- a/src/modules/card/components/FlipCardList.vue
+++ b/src/modules/card/components/FlipCardList.vue
@@ -1,8 +1,8 @@
diff --git a/src/modules/card/hooks/useNeedReviewCards.ts b/src/modules/card/hooks/useNeedReviewCards.ts
index 9fb60e8..3990ad3 100644
--- a/src/modules/card/hooks/useNeedReviewCards.ts
+++ b/src/modules/card/hooks/useNeedReviewCards.ts
@@ -1,8 +1,8 @@
-import { useAsyncState } from '@vueuse/core'
+import { useAsyncState } from "@vueuse/core"
-import { data } from '@/data/data'
-import { DataType } from '@/data/DataType.enum'
-import { RepetitionCard } from '@/modules/card/models/RepetitionCard'
+import { data } from "@/data/data"
+import { DataType } from "@/data/DataType.enum"
+import { RepetitionCard } from "@/modules/card/models/RepetitionCard"
export const useNeedReviewCards = () => {
const { state: cardsToReview, isReady } = useAsyncState(async () => {
diff --git a/src/modules/card/hooks/useSpacedRepetitionCards.ts b/src/modules/card/hooks/useSpacedRepetitionCards.ts
index 6ce6acd..6459ef1 100644
--- a/src/modules/card/hooks/useSpacedRepetitionCards.ts
+++ b/src/modules/card/hooks/useSpacedRepetitionCards.ts
@@ -31,14 +31,14 @@ export const useSpacedRepetitionCards = () => {
(file) =>
file.path !== undefined &&
file.path.startsWith("_cards") &&
- file.path.endsWith(".md"),
- ),
+ file.path.endsWith(".md")
+ )
)
const {
state: cards,
isReady,
- execute,
+ execute
} = useAsyncState(
async () => {
const cards: Repetition[] = []
@@ -55,7 +55,7 @@ export const useSpacedRepetitionCards = () => {
$type: DataType.RepetitionCard,
level: 1,
repeatDate: new Date(),
- needsReview: false,
+ needsReview: false
})
if (
@@ -77,20 +77,20 @@ export const useSpacedRepetitionCards = () => {
card: {
front: toHTML(front),
back: toHTML(back),
- references: toHTML(references),
- },
+ references: toHTML(references)
+ }
})
}
return cards
},
[],
- { immediate: false },
+ { immediate: false }
)
const successRepetition = async (cardId: string) => {
const repetition = await data.get(
- cardId,
+ cardId
)
if (!repetition) {
return
@@ -100,13 +100,13 @@ export const useSpacedRepetitionCards = () => {
...repetition,
needsReview: false,
level: Math.min(repetition.level + 1, MAX_LEVEL),
- repeatDate: addDays(new Date(), 2 ** repetition.level),
+ repeatDate: addDays(new Date(), 2 ** repetition.level)
})
}
const failRepetition = async (cardId: string) => {
const repetition = await data.get(
- cardId,
+ cardId
)
if (!repetition) {
return
@@ -118,13 +118,13 @@ export const useSpacedRepetitionCards = () => {
...repetition,
level,
needsReview: false,
- repeatDate: addDays(new Date(), level),
+ repeatDate: addDays(new Date(), level)
})
}
const needsReview = async (cardId: string) => {
const repetition = await data.get(
- cardId,
+ cardId
)
if (!repetition) {
return
@@ -132,7 +132,7 @@ export const useSpacedRepetitionCards = () => {
await data.update({
...repetition,
- needsReview: true,
+ needsReview: true
})
}
@@ -142,7 +142,7 @@ export const useSpacedRepetitionCards = () => {
nextTick(() => {
listenToClick()
}),
- { immediate: true },
+ { immediate: true }
)
watch(cardFiles, () => execute())
@@ -152,6 +152,6 @@ export const useSpacedRepetitionCards = () => {
successRepetition,
failRepetition,
needsReview,
- isLoading: !isReady,
+ isLoading: !isReady
}
}
diff --git a/src/modules/card/models/RepetitionCard.ts b/src/modules/card/models/RepetitionCard.ts
index 9dd9dc0..598e464 100644
--- a/src/modules/card/models/RepetitionCard.ts
+++ b/src/modules/card/models/RepetitionCard.ts
@@ -1,5 +1,5 @@
-import { DataType } from '@/data/DataType.enum'
-import { Model } from '@/data/models/Model'
+import { DataType } from "@/data/DataType.enum"
+import { Model } from "@/data/models/Model"
export interface RepetitionCard extends Model {
level: number
diff --git a/src/modules/history/components/LastVisited.vue b/src/modules/history/components/LastVisited.vue
index 1655aea..8d1ae83 100644
--- a/src/modules/history/components/LastVisited.vue
+++ b/src/modules/history/components/LastVisited.vue
@@ -1,5 +1,5 @@
diff --git a/src/modules/history/hooks/useLastVisitedRepos.hook.ts b/src/modules/history/hooks/useLastVisitedRepos.hook.ts
index 8dd09d9..5f7a70d 100644
--- a/src/modules/history/hooks/useLastVisitedRepos.hook.ts
+++ b/src/modules/history/hooks/useLastVisitedRepos.hook.ts
@@ -1,17 +1,17 @@
-import { useAsyncState } from '@vueuse/core'
-import { computed } from 'vue'
+import { useAsyncState } from "@vueuse/core"
+import { computed } from "vue"
-import { data } from '@/data/data'
-import { DataType } from '@/data/DataType.enum'
-import { History } from '@/data/models/History'
+import { data } from "@/data/data"
+import { DataType } from "@/data/DataType.enum"
+import { History } from "@/data/models/History"
-const HISTORY_ID = data.generateId(DataType.History, 'history')
+const HISTORY_ID = data.generateId(DataType.History, "history")
export const useLastVisitedRepos = () => {
const history = useAsyncState(
() =>
data.get(
- data.generateId(DataType.History, 'history')
+ data.generateId(DataType.History, "history")
),
null
)
diff --git a/src/modules/history/hooks/useVisitRepo.hook.ts b/src/modules/history/hooks/useVisitRepo.hook.ts
index 33069fa..120876c 100644
--- a/src/modules/history/hooks/useVisitRepo.hook.ts
+++ b/src/modules/history/hooks/useVisitRepo.hook.ts
@@ -1,10 +1,10 @@
-import { Ref, toValue } from 'vue'
+import { Ref, toValue } from "vue"
-import { data } from '@/data/data'
-import { DataType } from '@/data/DataType.enum'
-import { History } from '@/data/models/History'
+import { data } from "@/data/data"
+import { DataType } from "@/data/DataType.enum"
+import { History } from "@/data/models/History"
-const HISTORY_ID = data.generateId(DataType.History, 'history')
+const HISTORY_ID = data.generateId(DataType.History, "history")
const MAX_REPO_HISTORY = 10
export const useVisitRepo = (newRepo: {
diff --git a/src/modules/note/cache/prepareNoteCache.ts b/src/modules/note/cache/prepareNoteCache.ts
index 4ab4fc5..22191d5 100644
--- a/src/modules/note/cache/prepareNoteCache.ts
+++ b/src/modules/note/cache/prepareNoteCache.ts
@@ -1,14 +1,14 @@
-import { data } from '@/data/data'
-import { DataType } from '@/data/DataType.enum'
-import { Note } from '@/modules/note/models/Note'
-import { useUserRepoStore } from '@/modules/repo/store/userRepo.store'
+import { data } from "@/data/data"
+import { DataType } from "@/data/DataType.enum"
+import { Note } from "@/modules/note/models/Note"
+import { useUserRepoStore } from "@/modules/repo/store/userRepo.store"
type NoteCacheResult =
| {
note: Note
- from: 'sha'
+ from: "sha"
}
- | { note: Note; from: 'path' }
+ | { note: Note; from: "path" }
| { note: null; from: null }
export const prepareNoteCache = (sha: string, path?: string) => {
@@ -20,7 +20,7 @@ export const prepareNoteCache = (sha: string, path?: string) => {
const note = await data.get(noteId)
if (note) {
- return { note, from: 'sha' }
+ return { note, from: "sha" }
}
if (notePath) {
@@ -33,7 +33,7 @@ export const prepareNoteCache = (sha: string, path?: string) => {
}
return {
note,
- from: 'path'
+ from: "path"
}
}
diff --git a/src/modules/note/hooks/useFolderNotes.ts b/src/modules/note/hooks/useFolderNotes.ts
index 81b4da5..dd76e76 100644
--- a/src/modules/note/hooks/useFolderNotes.ts
+++ b/src/modules/note/hooks/useFolderNotes.ts
@@ -1,4 +1,5 @@
import { computed } from "vue"
+
import { useUserRepoStore } from "@/modules/repo/store/userRepo.store"
export const useFolderNotes = (folders: string[]) => {
@@ -8,8 +9,8 @@ export const useFolderNotes = (folders: string[]) => {
store.files.filter(
(file) =>
folders.some((folder) => file.path?.startsWith(folder)) &&
- file.path?.endsWith(".md"),
- ),
+ file.path?.endsWith(".md")
+ )
)
const content = computed(() =>
@@ -23,10 +24,10 @@ export const useFolderNotes = (folders: string[]) => {
})`
})
.join("\n")
- : "",
+ : ""
)
return {
- content,
+ content
}
}
diff --git a/src/modules/note/hooks/useNotes.ts b/src/modules/note/hooks/useNotes.ts
index 03dbbaf..6911362 100644
--- a/src/modules/note/hooks/useNotes.ts
+++ b/src/modules/note/hooks/useNotes.ts
@@ -6,10 +6,10 @@ export const useNotes = () => {
const store = useUserRepoStore()
const notes = computed(() =>
- store.files.filter((file) => file.path?.endsWith(".md")),
+ store.files.filter((file) => file.path?.endsWith(".md"))
)
return {
- notes,
+ notes
}
}
diff --git a/src/modules/note/models/BacklinkNote.ts b/src/modules/note/models/BacklinkNote.ts
index f1461eb..4a2e599 100644
--- a/src/modules/note/models/BacklinkNote.ts
+++ b/src/modules/note/models/BacklinkNote.ts
@@ -1,6 +1,6 @@
-import { DataType } from '@/data/DataType.enum'
-import { Model } from '@/data/models/Model'
-import { Backlink } from '@/modules/note/models/Backlink'
+import { DataType } from "@/data/DataType.enum"
+import { Model } from "@/data/models/Model"
+import { Backlink } from "@/modules/note/models/Backlink"
export interface BacklinkNote extends Model {
sha: string
diff --git a/src/modules/post/data/client.ts b/src/modules/post/data/client.ts
index dccc477..b32bfca 100644
--- a/src/modules/post/data/client.ts
+++ b/src/modules/post/data/client.ts
@@ -1,13 +1,13 @@
import { initContract } from "@ts-rest/core"
-import { type } from "arktype"
import { initQueryClient } from "@ts-rest/vue-query"
+import { type } from "arktype"
const PublicNoteListItem = type({
did: "string",
rkey: "string",
title: "string",
publishedAt: "string",
- createdAt: "string",
+ createdAt: "string"
})
export type PublicNoteListItem = typeof PublicNoteListItem.infer
@@ -18,7 +18,7 @@ const PublicNote = type({
title: "string",
content: "string",
publishedAt: "string",
- createdAt: "string",
+ createdAt: "string"
})
export type PublicNote = typeof PublicNote.infer
@@ -31,34 +31,34 @@ export const noteRouter = contract.router({
path: "/notes",
query: type({
cursor: "string | undefined",
- limit: "number | undefined",
+ limit: "number | undefined"
}),
responses: {
200: type({
- notes: PublicNoteListItem.array(),
- }),
+ notes: PublicNoteListItem.array()
+ })
},
- summary: "List all notes",
+ summary: "List all notes"
},
noteListsByDid: {
method: "GET",
path: "/:did/notes",
pathParams: type({
- did: "string",
+ did: "string"
}),
query: type({
cursor: "string | undefined",
- limit: "number | undefined",
+ limit: "number | undefined"
}),
responses: {
200: type({
- notes: PublicNoteListItem.array(),
- }),
+ notes: PublicNoteListItem.array()
+ })
},
- summary: "List all notes",
- },
+ summary: "List all notes"
+ }
})
export const client = initQueryClient(noteRouter, {
- baseUrl: "https://api.remanso.space",
+ baseUrl: "https://api.remanso.space"
})
diff --git a/src/modules/repo/hooks/useFavoriteRepos.hook.ts b/src/modules/repo/hooks/useFavoriteRepos.hook.ts
index 7f99e8d..4c7ea3c 100644
--- a/src/modules/repo/hooks/useFavoriteRepos.hook.ts
+++ b/src/modules/repo/hooks/useFavoriteRepos.hook.ts
@@ -1,10 +1,10 @@
-import { computed, onMounted, ref } from 'vue'
+import { computed, onMounted, ref } from "vue"
-import { data } from '@/data/data'
-import { DataType } from '@/data/DataType.enum'
-import { useRepos } from '@/hooks/useRepos.hook'
-import { RepoBase } from '@/modules/repo/interfaces/RepoBase'
-import { FavoriteRepo } from '@/modules/repo/models/FavoriteRepo'
+import { data } from "@/data/data"
+import { DataType } from "@/data/DataType.enum"
+import { useRepos } from "@/hooks/useRepos.hook"
+import { RepoBase } from "@/modules/repo/interfaces/RepoBase"
+import { FavoriteRepo } from "@/modules/repo/models/FavoriteRepo"
export const useFavoriteRepos = () => {
const { repos } = useRepos()
diff --git a/src/modules/repo/hooks/useRepoList.hook.ts b/src/modules/repo/hooks/useRepoList.hook.ts
index 8cd5452..2eb8619 100644
--- a/src/modules/repo/hooks/useRepoList.hook.ts
+++ b/src/modules/repo/hooks/useRepoList.hook.ts
@@ -1,8 +1,8 @@
-import { computed } from 'vue'
+import { computed } from "vue"
-import { useRepos } from '@/hooks/useRepos.hook'
-import { useFavoriteRepos } from '@/modules/repo/hooks/useFavoriteRepos.hook'
-import { RepoBase } from '@/modules/repo/interfaces/RepoBase'
+import { useRepos } from "@/hooks/useRepos.hook"
+import { useFavoriteRepos } from "@/modules/repo/hooks/useFavoriteRepos.hook"
+import { RepoBase } from "@/modules/repo/interfaces/RepoBase"
export const useRepoList = () => {
const { savedFavoriteRepos, addFavorite, removeFavorite } = useFavoriteRepos()
diff --git a/src/modules/repo/models/FavoriteRepo.ts b/src/modules/repo/models/FavoriteRepo.ts
index b81b588..03a0923 100644
--- a/src/modules/repo/models/FavoriteRepo.ts
+++ b/src/modules/repo/models/FavoriteRepo.ts
@@ -1,5 +1,5 @@
-import { DataType } from '@/data/DataType.enum'
-import { Model } from '@/data/models/Model'
+import { DataType } from "@/data/DataType.enum"
+import { Model } from "@/data/models/Model"
export interface FavoriteRepo extends Model {
isFavorite: boolean
diff --git a/src/modules/repo/models/SavedRepo.ts b/src/modules/repo/models/SavedRepo.ts
index d85b9cd..e89238c 100644
--- a/src/modules/repo/models/SavedRepo.ts
+++ b/src/modules/repo/models/SavedRepo.ts
@@ -1,6 +1,6 @@
-import { DataType } from '@/data/DataType.enum'
-import { Model } from '@/data/models/Model'
-import { RepoFile } from '@/modules/repo/interfaces/RepoFile'
+import { DataType } from "@/data/DataType.enum"
+import { Model } from "@/data/models/Model"
+import { RepoFile } from "@/modules/repo/interfaces/RepoFile"
export interface SavedRepo extends Model {
user: string
diff --git a/src/modules/repo/services/octo.ts b/src/modules/repo/services/octo.ts
index 538fe93..6a205f7 100644
--- a/src/modules/repo/services/octo.ts
+++ b/src/modules/repo/services/octo.ts
@@ -1,11 +1,11 @@
-import { Octokit } from '@octokit/rest'
+import { Octokit } from "@octokit/rest"
-import { getAccessToken } from '@/modules/user/service/signIn'
+import { getAccessToken } from "@/modules/user/service/signIn"
export const getOctokit = async (): Promise => {
const response = await getAccessToken()
return new Octokit({
- auth: response?.token ?? ''
+ auth: response?.token ?? ""
})
}
diff --git a/src/modules/repo/services/repo.ts b/src/modules/repo/services/repo.ts
index 75ac7ac..6d4804a 100644
--- a/src/modules/repo/services/repo.ts
+++ b/src/modules/repo/services/repo.ts
@@ -6,7 +6,7 @@ import { getOctokit } from "@/modules/repo/services/octo"
export const getFiles = async (
owner: string,
- repo: string,
+ repo: string
): Promise => {
if (!owner || !repo) {
return []
@@ -15,7 +15,7 @@ export const getFiles = async (
const commits = await octokit.request("GET /repos/{owner}/{repo}/commits", {
owner,
- repo,
+ repo
})
const lastCommit = commits.data.shift()
@@ -30,8 +30,8 @@ export const getFiles = async (
owner,
repo,
tree_sha: lastCommit.commit.tree.sha,
- recursive: "true",
- },
+ recursive: "true"
+ }
)
return treeResponse?.data.tree.filter((t) => t.type === "blob") ?? []
@@ -60,7 +60,7 @@ export const getMainReadme = async (owner: string, repo: string) => {
const { render } = markdownBuilder()
const { getCachedNote, saveCacheNote } = prepareNoteCache(
- `${owner}-${repo}-README`,
+ `${owner}-${repo}-README`
)
try {
@@ -68,7 +68,7 @@ export const getMainReadme = async (owner: string, repo: string) => {
const README = await octokit.repos.getReadme({
owner,
- repo,
+ repo
})
if (README) {
@@ -90,7 +90,7 @@ export const getMainReadme = async (owner: string, repo: string) => {
export const getUserSettingsContent = async (
user: string,
repo: string,
- files: RepoFile[],
+ files: RepoFile[]
): Promise | null> => {
const configFile = files.find((file) => file.path === ".remanso.json")
@@ -110,7 +110,7 @@ export const getUserSettingsContent = async (
export const queryFileContent = async (
user: string,
repo: string,
- sha: string,
+ sha: string
) => {
const octokit = await getOctokit()
@@ -123,8 +123,8 @@ export const queryFileContent = async (
{
owner: user,
repo: repo,
- file_sha: sha,
- },
+ file_sha: sha
+ }
)
return file?.data.content ?? null
diff --git a/src/modules/repo/services/resolvePath.spec.ts b/src/modules/repo/services/resolvePath.spec.ts
index 8a7ded5..ebfa731 100644
--- a/src/modules/repo/services/resolvePath.spec.ts
+++ b/src/modules/repo/services/resolvePath.spec.ts
@@ -1,43 +1,43 @@
-import { describe, expect, it } from 'vitest'
+import { describe, expect, it } from "vitest"
-import { resolvePath } from './resolvePath'
+import { resolvePath } from "./resolvePath"
-describe('resolve path service', () => {
- it('set the absolute path if path to resolve is empty', () => {
- expect(resolvePath('standard/README.md', '')).toEqual('standard/')
+describe("resolve path service", () => {
+ it("set the absolute path if path to resolve is empty", () => {
+ expect(resolvePath("standard/README.md", "")).toEqual("standard/")
})
- it('returns the path sanitized if there is no absolute path', () => {
- expect(resolvePath('', './here/note.md')).toEqual('here/note.md')
+ it("returns the path sanitized if there is no absolute path", () => {
+ expect(resolvePath("", "./here/note.md")).toEqual("here/note.md")
})
- it('set the absolute path from the current path', () => {
- expect(resolvePath('standard/README.md', './other-note.md')).toEqual(
- 'standard/other-note.md'
+ it("set the absolute path from the current path", () => {
+ expect(resolvePath("standard/README.md", "./other-note.md")).toEqual(
+ "standard/other-note.md"
)
})
- it('set the absolute path from the current path with multiple level', () => {
+ it("set the absolute path from the current path with multiple level", () => {
expect(
- resolvePath('standard/you/are/here/README.md', './other-note.md')
- ).toEqual('standard/you/are/here/other-note.md')
+ resolvePath("standard/you/are/here/README.md", "./other-note.md")
+ ).toEqual("standard/you/are/here/other-note.md")
})
- it('set the absolute path from the current path with a go back in the relative path', () => {
+ it("set the absolute path from the current path with a go back in the relative path", () => {
expect(
- resolvePath('standard/you/are/here/README.md', '../other-note.md')
- ).toEqual('standard/you/are/other-note.md')
+ resolvePath("standard/you/are/here/README.md", "../other-note.md")
+ ).toEqual("standard/you/are/other-note.md")
expect(
- resolvePath('standard/you/are/here/README.md', '../../other-note.md')
- ).toEqual('standard/you/other-note.md')
+ resolvePath("standard/you/are/here/README.md", "../../other-note.md")
+ ).toEqual("standard/you/other-note.md")
expect(
- resolvePath('standard/you/are/here/README.md', './../../other-note.md')
- ).toEqual('standard/you/other-note.md')
+ resolvePath("standard/you/are/here/README.md", "./../../other-note.md")
+ ).toEqual("standard/you/other-note.md")
expect(
- resolvePath('standard/you/are/here/README.md', './../../../other-note.md')
- ).toEqual('standard/other-note.md')
+ resolvePath("standard/you/are/here/README.md", "./../../../other-note.md")
+ ).toEqual("standard/other-note.md")
})
})
diff --git a/src/modules/repo/services/resolvePath.ts b/src/modules/repo/services/resolvePath.ts
index 5aada86..6a77206 100644
--- a/src/modules/repo/services/resolvePath.ts
+++ b/src/modules/repo/services/resolvePath.ts
@@ -1,15 +1,15 @@
const sanitizePath = (path: string) => {
- if (path.startsWith('./')) {
- return decodeURIComponent(path.replace('./', ''))
+ if (path.startsWith("./")) {
+ return decodeURIComponent(path.replace("./", ""))
}
return decodeURIComponent(path)
}
const removeNoteFilename = (pathNote: string) => {
- const path = pathNote.split('/')
+ const path = pathNote.split("/")
path.pop()
- return sanitizePath(path.join('/'))
+ return sanitizePath(path.join("/"))
}
export const resolvePath = (
@@ -19,11 +19,11 @@ export const resolvePath = (
let currentAbsolutePath = removeNoteFilename(currentAbsolutePathNote)
pathToResolve = sanitizePath(pathToResolve)
- while (pathToResolve.startsWith('../')) {
- const adjustedAbsolutePath = currentAbsolutePath.split('/')
+ while (pathToResolve.startsWith("../")) {
+ const adjustedAbsolutePath = currentAbsolutePath.split("/")
adjustedAbsolutePath.pop()
- currentAbsolutePath = adjustedAbsolutePath.join('/')
- pathToResolve = pathToResolve.replace('../', '')
+ currentAbsolutePath = adjustedAbsolutePath.join("/")
+ pathToResolve = pathToResolve.replace("../", "")
}
return currentAbsolutePath
diff --git a/src/modules/repo/store/userRepo.store.ts b/src/modules/repo/store/userRepo.store.ts
index dae3ce4..db325dd 100644
--- a/src/modules/repo/store/userRepo.store.ts
+++ b/src/modules/repo/store/userRepo.store.ts
@@ -9,7 +9,7 @@ import {
getCachedMainReadme,
getFiles,
getMainReadme,
- getUserSettingsContent,
+ getUserSettingsContent
} from "@/modules/repo/services/repo"
import { refreshToken } from "@/modules/user/service/signIn"
@@ -29,7 +29,7 @@ export const useUserRepoStore = defineStore("USER_REPO_STATE", {
files: [],
readme: undefined,
userSettings: undefined,
- needToLogin: false,
+ needToLogin: false
}),
actions: {
async setUserRepo(user: string, repo: string) {
@@ -38,7 +38,7 @@ export const useUserRepoStore = defineStore("USER_REPO_STATE", {
const savedRepoId = data.generateId(DataType.SavedRepo, `${user}-${repo}`)
const cachedSavedRepo = await data.get(
- savedRepoId,
+ savedRepoId
)
if (cachedSavedRepo) {
@@ -68,14 +68,14 @@ export const useUserRepoStore = defineStore("USER_REPO_STATE", {
$type: DataType.SavedRepo,
repo,
user,
- files,
+ files
})
this.files = files
return getUserSettingsContent(user, repo, files)
})
.then((userSettings) => {
const chosenFontFamily = userSettings?.fontFamilies?.find(
- (font) => font === this.userSettings?.chosenFontFamily,
+ (font) => font === this.userSettings?.chosenFontFamily
)
? this.userSettings?.chosenFontFamily
: userSettings?.fontFamily
@@ -94,7 +94,7 @@ export const useUserRepoStore = defineStore("USER_REPO_STATE", {
data.update({
...this.userSettings,
- _id: userSettingsId,
+ _id: userSettingsId
})
})
@@ -116,7 +116,7 @@ export const useUserRepoStore = defineStore("USER_REPO_STATE", {
const savedRepoId = data.generateId(
DataType.SavedRepo,
- `${this.user}-${this.repo}`,
+ `${this.user}-${this.repo}`
)
const newFiles = [...this.files.filter((f) => f.sha !== file.sha), file]
data.update({
@@ -124,7 +124,7 @@ export const useUserRepoStore = defineStore("USER_REPO_STATE", {
$type: DataType.SavedRepo,
repo: this.repo,
user: this.user,
- files: newFiles,
+ files: newFiles
})
this.files = newFiles
},
@@ -147,7 +147,7 @@ export const useUserRepoStore = defineStore("USER_REPO_STATE", {
const userSettingsId = `UserSetting-${this.user}-${this.repo}`
data.update({
...this.userSettings,
- _id: userSettingsId,
+ _id: userSettingsId
})
},
setFontSize(fontSize: string) {
@@ -159,8 +159,8 @@ export const useUserRepoStore = defineStore("USER_REPO_STATE", {
const userSettingsId = `UserSetting-${this.user}-${this.repo}`
data.update({
...this.userSettings,
- _id: userSettingsId,
+ _id: userSettingsId
})
- },
- },
+ }
+ }
})
diff --git a/src/modules/user/interfaces/GithubToken.ts b/src/modules/user/interfaces/GithubToken.ts
index 83919bc..6127f78 100644
--- a/src/modules/user/interfaces/GithubToken.ts
+++ b/src/modules/user/interfaces/GithubToken.ts
@@ -4,5 +4,5 @@ export interface GithubToken {
refresh_token: string
refresh_token_expires_in: number
scope: string
- token_type: 'bearer'
+ token_type: "bearer"
}
diff --git a/src/modules/user/service/signIn.ts b/src/modules/user/service/signIn.ts
index 35aa762..35a3061 100644
--- a/src/modules/user/service/signIn.ts
+++ b/src/modules/user/service/signIn.ts
@@ -11,7 +11,7 @@ const AUTHENTICATION_SERVER = "https://api.remanso.space/auth/github"
const personalTokenId = "token"
export const signIn = async (
- code: string,
+ code: string
): Promise => {
const authenticationServerURL = new URL(AUTHENTICATION_SERVER)
authenticationServerURL.searchParams.set("code", code)
@@ -84,12 +84,12 @@ export const saveAccessToken = async (githubToken: GithubToken) => {
const expirationDate = addSeconds(
new Date(),
- githubToken.expires_in,
+ githubToken.expires_in
).toISOString()
const refreshTokenExpirationDate = addSeconds(
new Date(),
- githubToken.refresh_token_expires_in,
+ githubToken.refresh_token_expires_in
).toISOString()
const accessToken: GithubAccessToken = {
@@ -102,11 +102,11 @@ export const saveAccessToken = async (githubToken: GithubToken) => {
refreshToken: githubToken.refresh_token,
refreshTokenExpiresIn: githubToken.refresh_token_expires_in,
refreshTokenExpirationDate,
- username: "",
+ username: ""
}
const octokit = new Octokit({
- auth: accessToken?.token,
+ auth: accessToken?.token
})
const user = await octokit.request("GET /user")
diff --git a/src/router/router.ts b/src/router/router.ts
index a9b5f97..463374b 100644
--- a/src/router/router.ts
+++ b/src/router/router.ts
@@ -7,98 +7,102 @@ const routes: Array = [
{
path: "/repo-list",
name: "RepoList",
- component: () => import("@/views/RepoList.vue"),
+ component: () => import("@/views/RepoList.vue")
},
{
path: "/:user/:repo",
name: "FluxNoteView",
props: true,
- component: () => import("@/views/FluxNoteView.vue"),
+ component: () => import("@/views/FluxNoteView.vue")
},
{
path: "/tiboudenote",
name: "PublicNoteListView",
- component: () => import("@/views/PublicNoteListView.vue"),
+ component: () => import("@/views/PublicNoteListView.vue")
},
{
path: "/pub",
name: "PublicNoteListView",
- component: () => import("@/views/PublicNoteListView.vue"),
+ component: () => import("@/views/PublicNoteListView.vue")
},
{
path: "/pub/:shortDid",
name: "PublicNoteListByDidView",
props: true,
- component: () => import("@/views/PublicNoteListByDidView.vue"),
+ component: () => import("@/views/PublicNoteListByDidView.vue")
},
{
path: "/pub/:shortDid/:rkey/:slug?",
name: "PublicNoteView",
props: true,
- component: () => import("@/views/PublicNoteView.vue"),
+ component: () => import("@/views/PublicNoteView.vue")
},
{
path: "/:user/:repo/inbox",
name: "FleetingNotes",
props: true,
- component: () => import("@/views/FleetingNotes.vue"),
+ component: () => import("@/views/FleetingNotes.vue")
},
{
path: "/:user/:repo/draft",
name: "DraftNotes",
props: true,
- component: () => import("@/views/DraftNotes.vue"),
+ component: () => import("@/views/DraftNotes.vue")
},
{
path: "/:user/:repo/todo",
name: "TodoNotes",
props: true,
- component: () => import("@/views/TodoNotes.vue"),
+ component: () => import("@/views/TodoNotes.vue")
},
{
path: "/:user/:repo/history",
name: "HistoricNotes",
props: true,
- component: () => import("@/views/HistoricNotes.vue"),
+ component: () => import("@/views/HistoricNotes.vue")
},
{
path: "/:user/:repo/spaced-repetition",
name: "SpacedRepetitionCard",
props: true,
- component: () => import("@/views/SpacedRepetitionCard.vue"),
+ component: () => import("@/views/SpacedRepetitionCard.vue")
},
{
path: "/:user/:repo/need-review-cards",
name: "NeedReviewCards",
props: true,
- component: () => import("@/views/NeedReviewCards.vue"),
+ component: () => import("@/views/NeedReviewCards.vue")
},
{
path: "/about",
name: "About",
- component: () => import("@/views/AboutApp.vue"),
+ component: () => import("@/views/AboutApp.vue")
},
{
path: "/",
name: "Home",
- component: Home,
+ component: Home
},
{
path: "/:catchAll(.*)",
name: "SpaceCowboy",
- component: () => import("@/views/SpaceCowboy.vue"),
- },
+ component: () => import("@/views/SpaceCowboy.vue")
+ }
]
export const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
- routes,
+ routes
})
router.beforeEach(() => {
if (!("startViewTransition" in document)) return
return new Promise((resolve) => {
- ;(document as Document & { startViewTransition: (cb: () => Promise) => void }).startViewTransition(async () => {
+ ;(
+ document as Document & {
+ startViewTransition: (cb: () => Promise) => void
+ }
+ ).startViewTransition(async () => {
resolve()
await nextTick()
})
diff --git a/src/theme.config.ts b/src/theme.config.ts
index 0d237cf..141e6e8 100644
--- a/src/theme.config.ts
+++ b/src/theme.config.ts
@@ -2,6 +2,6 @@
// Update these values to change the light and dark themes
export const themeConfig = {
- light: 'garden',
- dark: 'dim',
+ light: "garden",
+ dark: "dim"
}
diff --git a/src/utils/decodeBase64ToUTF8.ts b/src/utils/decodeBase64ToUTF8.ts
index 7103ef3..00e7319 100644
--- a/src/utils/decodeBase64ToUTF8.ts
+++ b/src/utils/decodeBase64ToUTF8.ts
@@ -1,9 +1,9 @@
export const decodeBase64ToUTF8 = (content: string): string => {
return decodeURIComponent(
atob(content)
- .split('')
- .map((char) => `%${('00' + char.charCodeAt(0).toString(16)).slice(-2)}`)
- .join('')
+ .split("")
+ .map((char) => `%${("00" + char.charCodeAt(0).toString(16)).slice(-2)}`)
+ .join("")
)
}
export const encodeUTF8ToBase64 = (content: string): string => {
diff --git a/src/utils/displayLanguage.ts b/src/utils/displayLanguage.ts
index 42eb422..08d48b3 100644
--- a/src/utils/displayLanguage.ts
+++ b/src/utils/displayLanguage.ts
@@ -6,7 +6,7 @@ export const displayLanguage = (langCode?: string): string | null => {
try {
const locale = navigator.language ?? langCode
const display = new Intl.DisplayNames([locale], {
- type: "language",
+ type: "language"
})
return display.of(langCode) ?? null
diff --git a/src/utils/markdown/markdown-html5-media.ts b/src/utils/markdown/markdown-html5-media.ts
index b979ecd..cbf92e0 100644
--- a/src/utils/markdown/markdown-html5-media.ts
+++ b/src/utils/markdown/markdown-html5-media.ts
@@ -2,11 +2,11 @@
// We can only detect video/audio files from the extension in the URL.
// We ignore MP1 and MP2 (not in active use) and default to video for ambiguous
-import MarkdownIt from 'markdown-it'
+import MarkdownIt from "markdown-it"
// extensions (MPG, MP4)
-const validAudioExtensions = ['aac', 'm4a', 'mp3', 'oga', 'ogg', 'wav']
-const validVideoExtensions = ['mp4', 'm4v', 'ogv', 'webm', 'mpg', 'mpeg']
+const validAudioExtensions = ["aac", "m4a", "mp3", "oga", "ogg", "wav"]
+const validVideoExtensions = ["mp4", "m4v", "ogv", "webm", "mpg", "mpeg"]
/**
* @property {Object} messages
@@ -19,13 +19,13 @@ const validVideoExtensions = ['mp4', 'm4v', 'ogv', 'webm', 'mpg', 'mpeg']
*/
let messages: { [key: string]: any } = {
en: {
- 'html5 video not supported':
- 'Your browser does not support playing HTML5 video.',
- 'html5 audio not supported':
- 'Your browser does not support playing HTML5 audio.',
- 'html5 media fallback link':
+ "html5 video not supported":
+ "Your browser does not support playing HTML5 video.",
+ "html5 audio not supported":
+ "Your browser does not support playing HTML5 audio.",
+ "html5 media fallback link":
'You can download the file instead.',
- 'html5 media description': 'Here is a description of the content: %s'
+ "html5 media description": "Here is a description of the content: %s"
}
}
@@ -37,18 +37,18 @@ let translate = (
// Revert back to English default if no message object, or no translation
// for this language
if (!messages[language] || !messages[language][messageKey]) {
- language = 'en'
+ language = "en"
}
if (!messages[language]) {
- return ''
+ return ""
}
- let message = messages[language][messageKey] || ''
+ let message = messages[language][messageKey] || ""
if (messageParams)
for (const param of messageParams) {
- message = message.replace('%s', param)
+ message = message.replace("%s", param)
}
return message
@@ -96,7 +96,7 @@ function tokenizeImagesAndMedia(
}
): boolean {
let attrs, code, label, pos, ref, res, title, tokens: never[], start
- let href = ''
+ let href = ""
const oldPos = state.pos
const max = state.posMax
@@ -140,7 +140,7 @@ function tokenizeImagesAndMedia(
if (state.md.validateLink(href)) {
pos = res.pos
} else {
- href = ''
+ href = ""
}
}
@@ -166,7 +166,7 @@ function tokenizeImagesAndMedia(
if (!md.utils.isSpace(code) && code !== 0x0a) break
}
} else {
- title = ''
+ title = ""
}
if (pos >= max || state.src.charCodeAt(pos) !== 0x29) {
@@ -179,7 +179,7 @@ function tokenizeImagesAndMedia(
//
// Link reference
//
- if (typeof state.env.references === 'undefined') return false
+ if (typeof state.env.references === "undefined") return false
if (pos < max && state.src.charCodeAt(pos) === 0x5b) {
// Bracket: [
@@ -219,15 +219,15 @@ function tokenizeImagesAndMedia(
state.md.inline.parse(content, state.md, state.env, (tokens = []))
const mediaType = guessMediaType(href)
- const tag = mediaType == 'image' ? 'img' : mediaType
+ const tag = mediaType == "image" ? "img" : mediaType
const token = state.push(mediaType, tag, 0)
- token.attrs = attrs = [['src', href]]
- if (mediaType == 'image') attrs.push(['alt', ''])
+ token.attrs = attrs = [["src", href]]
+ if (mediaType == "image") attrs.push(["alt", ""])
token.children = tokens
token.content = content
- if (title) attrs.push(['title', title])
+ if (title) attrs.push(["title", title])
state.pos = pos
state.posMax = max
@@ -247,13 +247,13 @@ function tokenizeImagesAndMedia(
*/
function guessMediaType(url: string): string {
const extensionMatch = url.match(/\.([^/.]+)$/)
- if (extensionMatch === null) return 'image'
+ if (extensionMatch === null) return "image"
const extension = extensionMatch[1]
if (validAudioExtensions.indexOf(extension.toLowerCase()) != -1)
- return 'audio'
+ return "audio"
else if (validVideoExtensions.indexOf(extension.toLowerCase()) != -1)
- return 'video'
- else return 'image'
+ return "video"
+ else return "image"
}
/**
@@ -283,37 +283,37 @@ function renderMedia(
const token = tokens[idx]
const type = token.type
- if (!token.attrs || (type !== 'video' && type !== 'audio')) {
- return ''
+ if (!token.attrs || (type !== "video" && type !== "audio")) {
+ return ""
}
let attrs = options.html5Media[`${type}Attrs`].trim()
if (attrs) {
- attrs = ' ' + attrs
+ attrs = " " + attrs
}
// We'll always have a URL for non-image media: they are detected by URL
- const url = token.attrs[token.attrIndex('src')][1]
+ const url = token.attrs[token.attrIndex("src")][1]
// Title is set like this: 
const title =
- token.attrIndex('title') != -1
+ token.attrIndex("title") != -1
? ` title="${md.utils.escapeHtml(
- token.attrs[token.attrIndex('title')][1]
+ token.attrs[token.attrIndex("title")][1]
)}"`
- : ''
+ : ""
const fallbackText =
translate(env.language, `html5 ${type} not supported`) +
- '\n' +
- translate(env.language, 'html5 media fallback link', [url])
+ "\n" +
+ translate(env.language, "html5 media fallback link", [url])
const description = token.content
- ? '\n' +
- translate(env.language, 'html5 media description', [
+ ? "\n" +
+ translate(env.language, "html5 media description", [
md.utils.escapeHtml(token.content)
])
- : ''
+ : ""
return (
`<${type} src="${url}"${title}${attrs}>\n` +
@@ -369,7 +369,7 @@ export const html5Media = (
? options.audioAttrs
: 'controls class="html5-audio-player"'
- md.inline.ruler.at('image', (tokens: any, silent: any) =>
+ md.inline.ruler.at("image", (tokens: any, silent: any) =>
tokenizeImagesAndMedia(tokens, silent, md)
)
diff --git a/src/utils/markdown/markdown-it-regexp.ts b/src/utils/markdown/markdown-it-regexp.ts
index cb28b9d..82dba7c 100644
--- a/src/utils/markdown/markdown-it-regexp.ts
+++ b/src/utils/markdown/markdown-it-regexp.ts
@@ -1,4 +1,4 @@
-import MarkdownIt, { PluginSimple } from 'markdown-it'
+import MarkdownIt, { PluginSimple } from "markdown-it"
let counter = 0
@@ -6,14 +6,14 @@ export const markdownItPlugin = (
regex: RegExp,
replacer: (matches: RegExpExecArray[]) => string
): PluginSimple => {
- const id = 'regexp-' + counter
+ const id = "regexp-" + counter
counter++
const flags =
- (regex.global ? 'g' : '') +
- (regex.multiline ? 'm' : '') +
- (regex.ignoreCase ? 'i' : '')
+ (regex.global ? "g" : "") +
+ (regex.multiline ? "m" : "") +
+ (regex.ignoreCase ? "i" : "")
- const regexp = RegExp('^' + regex.source, flags)
+ const regexp = RegExp("^" + regex.source, flags)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const parse = (state: any, silent: boolean): boolean => {
@@ -31,7 +31,7 @@ export const markdownItPlugin = (
return true
}
- const token = state.push(id, '', 0)
+ const token = state.push(id, "", 0)
token.meta = { match }
return true
diff --git a/src/utils/markdown/markdown-it-tabler-icons.ts b/src/utils/markdown/markdown-it-tabler-icons.ts
index ffb345b..1adb917 100644
--- a/src/utils/markdown/markdown-it-tabler-icons.ts
+++ b/src/utils/markdown/markdown-it-tabler-icons.ts
@@ -1,10 +1,7 @@
import { markdownItPlugin } from "./markdown-it-regexp"
// Matches :icon-name: where icon-name is letters, digits, hyphens
-export const markdownItTablerIcons = markdownItPlugin(
- /:([\w-]+):/,
- (match) => {
- const name = match[1]
- return ``
- },
-)
+export const markdownItTablerIcons = markdownItPlugin(/:([\w-]+):/, (match) => {
+ const name = match[1]
+ return ``
+})
diff --git a/src/utils/noteTitle.ts b/src/utils/noteTitle.ts
index 503322c..2822dd1 100644
--- a/src/utils/noteTitle.ts
+++ b/src/utils/noteTitle.ts
@@ -1,18 +1,18 @@
export const filenameToNoteTitle = (title: string) =>
- title.replaceAll('/', ' / ').replaceAll('-', ' ')
+ title.replaceAll("/", " / ").replaceAll("-", " ")
export const pathToNotePathTitle = (path: string) => {
- const fileNames = path.split('.')
+ const fileNames = path.split(".")
fileNames.pop()
return fileNames
- .join('.')
- .split('/')
- .filter((path) => !path.includes('README'))
- .join('/')
- .replaceAll('-', ' ')
+ .join(".")
+ .split("/")
+ .filter((path) => !path.includes("README"))
+ .join("/")
+ .replaceAll("-", " ")
}
export const pathToNoteTitle = (notePathTitle: string) => {
- return pathToNotePathTitle(notePathTitle).split('/').pop()?.trim() ?? ''
+ return pathToNotePathTitle(notePathTitle).split("/").pop()?.trim() ?? ""
}
diff --git a/src/utils/notif.ts b/src/utils/notif.ts
index 69c151b..6558380 100644
--- a/src/utils/notif.ts
+++ b/src/utils/notif.ts
@@ -4,23 +4,23 @@ const notif = new Notyf({
types: [
{
className: "alert alert-success",
- type: "confirm",
+ type: "confirm"
},
{
className: "alert alert-error",
- type: "error",
- },
- ],
+ type: "error"
+ }
+ ]
})
export const confirmMessage = (message: string) =>
notif.open({
type: "confirm",
- message,
+ message
})
export const errorMessage = (message: string) =>
notif.open({
type: "error",
- message,
+ message
})
diff --git a/src/views/FleetingNotes.vue b/src/views/FleetingNotes.vue
index bc04414..284b291 100644
--- a/src/views/FleetingNotes.vue
+++ b/src/views/FleetingNotes.vue
@@ -1,6 +1,7 @@
diff --git a/src/views/NeedReviewCards.vue b/src/views/NeedReviewCards.vue
index 054d333..083d02d 100644
--- a/src/views/NeedReviewCards.vue
+++ b/src/views/NeedReviewCards.vue
@@ -1,9 +1,9 @@
diff --git a/src/views/RepoList.vue b/src/views/RepoList.vue
index d178519..20f9351 100644
--- a/src/views/RepoList.vue
+++ b/src/views/RepoList.vue
@@ -1,8 +1,8 @@
+
diff --git a/src/views/SpacedRepetitionCard.vue b/src/views/SpacedRepetitionCard.vue
index 671d398..78384ce 100644
--- a/src/views/SpacedRepetitionCard.vue
+++ b/src/views/SpacedRepetitionCard.vue
@@ -1,7 +1,7 @@
diff --git a/tailwind.config.js b/tailwind.config.js
index add0deb..7c76ae2 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -1,5 +1,5 @@
/** @type {import('tailwindcss').Config} */
-const dotenv = require('dotenv')
+const dotenv = require("dotenv")
dotenv.config()
@@ -10,54 +10,54 @@ const defaultTitleStyles = Array.from(
(acc, heading) => ({
...acc,
[heading]: {
- 'margin-top': '0',
- 'margin-bottom': '0.5em'
+ "margin-top": "0",
+ "margin-bottom": "0.5em"
}
}),
{}
)
-const BOX_SHADOW = '6px'
+const BOX_SHADOW = "6px"
module.exports = {
- content: ['./src/**/*.{vue,js,ts}'],
+ content: ["./src/**/*.{vue,js,ts}"],
theme: {
extend: {
typography: () => ({
DEFAULT: {
css: {
...defaultTitleStyles,
- 'font-size': '13pt',
- 'font-family': '"Libertinus Serif", serif',
+ "font-size": "13pt",
+ "font-family": '"Libertinus Serif", serif',
p: {
- 'margin-top': '0.8em',
- 'margin-bottom': '0.8em',
- 'text-align': 'left'
+ "margin-top": "0.8em",
+ "margin-bottom": "0.8em",
+ "text-align": "left"
// "text-wrap": "balance",
},
- 'img, video': {
- margin: 'auto',
- 'border-radius': '0.5rem',
- 'box-shadow':
- 'rgba(50, 50, 93, 0.25) 0px 6px 12px -2px, rgba(0, 0, 0, 0.3) 0px 3px 7px -3px',
- 'max-width': `calc(100% - 2 * ${BOX_SHADOW})`
+ "img, video": {
+ margin: "auto",
+ "border-radius": "0.5rem",
+ "box-shadow":
+ "rgba(50, 50, 93, 0.25) 0px 6px 12px -2px, rgba(0, 0, 0, 0.3) 0px 3px 7px -3px",
+ "max-width": `calc(100% - 2 * ${BOX_SHADOW})`
},
a: {
- 'font-weight': 600,
+ "font-weight": 600,
// "text-decoration": "wavy underline var(--color-contrast-content)",
// "text-decoration-thickness": "0.1em",
- 'text-decoration': 'none',
- color: 'var(--color-accent)'
+ "text-decoration": "none",
+ color: "var(--color-accent)"
},
- 'a.btn-primary': {
- color: 'var(--color-secondary-content)'
+ "a.btn-primary": {
+ color: "var(--color-secondary-content)"
},
- 'a:hover': {
- 'text-decoration': 'underline'
+ "a:hover": {
+ "text-decoration": "underline"
},
li: {
- 'margin-top': 0,
- 'margin-bottom': 0
+ "margin-top": 0,
+ "margin-bottom": 0
}
}
}
diff --git a/vite.config.mts b/vite.config.mts
index 3bff4ca..ddec6b7 100644
--- a/vite.config.mts
+++ b/vite.config.mts
@@ -1,68 +1,68 @@
-import vue from '@vitejs/plugin-vue'
-import path from 'path'
-import { defineConfig, type UserConfigExport } from 'vite'
-import { VitePWA } from 'vite-plugin-pwa'
+import vue from "@vitejs/plugin-vue"
+import path from "path"
+import { defineConfig, type UserConfigExport } from "vite"
+import { VitePWA } from "vite-plugin-pwa"
export default defineConfig(({ command }) => {
const config: UserConfigExport = {
build: {
- minify: 'esbuild'
+ minify: "esbuild"
},
plugins: [
vue(),
VitePWA({
- registerType: 'prompt',
+ registerType: "prompt",
includeAssets: [
- 'favicon.ico',
- 'apple-touch-icon.png',
- 'apple-touch-icon-180x180.png',
- 'favicon.png',
- 'pwa-64x64.png',
- 'pwa-192x192.png',
- 'pwa-512x512.png',
- 'masked-icon.png',
- 'maskable-icon-512x512.png',
- 'monochrome-icon.png',
- 'assets/*.svg'
+ "favicon.ico",
+ "apple-touch-icon.png",
+ "apple-touch-icon-180x180.png",
+ "favicon.png",
+ "pwa-64x64.png",
+ "pwa-192x192.png",
+ "pwa-512x512.png",
+ "masked-icon.png",
+ "maskable-icon-512x512.png",
+ "monochrome-icon.png",
+ "assets/*.svg"
],
manifest: {
- name: 'Remanso',
- short_name: 'Remanso',
- description: 'Note taking & sharing app',
- background_color: '#ffa4c0',
- theme_color: '#ffa4c0',
+ name: "Remanso",
+ short_name: "Remanso",
+ description: "Note taking & sharing app",
+ background_color: "#ffa4c0",
+ theme_color: "#ffa4c0",
icons: [
{
- src: 'pwa-64x64.png',
- sizes: '64x64',
- type: 'image/png'
+ src: "pwa-64x64.png",
+ sizes: "64x64",
+ type: "image/png"
},
{
- src: 'pwa-192x192.png',
- sizes: '192x192',
- type: 'image/png'
+ src: "pwa-192x192.png",
+ sizes: "192x192",
+ type: "image/png"
},
{
- src: 'pwa-512x512.png',
- sizes: '512x512',
- type: 'image/png'
+ src: "pwa-512x512.png",
+ sizes: "512x512",
+ type: "image/png"
},
{
- src: 'favicon.png',
- sizes: '1024x1024',
- type: 'image/png'
+ src: "favicon.png",
+ sizes: "1024x1024",
+ type: "image/png"
},
{
- src: 'maskable-icon-512x512.png',
- sizes: '512x512',
- type: 'image/png',
- purpose: 'maskable'
+ src: "maskable-icon-512x512.png",
+ sizes: "512x512",
+ type: "image/png",
+ purpose: "maskable"
},
{
- src: 'monochrome-icon.png',
- sizes: '1024x1024',
- type: 'image/png',
- purpose: 'monochrome'
+ src: "monochrome-icon.png",
+ sizes: "1024x1024",
+ type: "image/png",
+ purpose: "monochrome"
}
]
}
@@ -70,18 +70,18 @@ export default defineConfig(({ command }) => {
],
resolve: {
alias: {
- '@': path.resolve(__dirname, './src'),
- 'node-fetch': 'isomorphic-fetch'
+ "@": path.resolve(__dirname, "./src"),
+ "node-fetch": "isomorphic-fetch"
}
}
}
- if (command === 'serve') {
+ if (command === "serve") {
config.define = {
global: {}
}
config.server = {
- host: '127.0.0.1'
+ host: "127.0.0.1"
}
}
]