Compare commits
12
Commits
draft
..
26168627b4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26168627b4 | ||
|
|
cc87dde39f | ||
|
|
31cae670c4 | ||
|
|
7e4f1acbf1 | ||
|
|
fcb52ebdc9 | ||
|
|
c0a7f193db | ||
|
|
da9d256b71 | ||
|
|
d03478f81a | ||
|
|
120ce7726f | ||
|
|
bd814e06ce | ||
|
|
cd99d22174 | ||
|
|
128af8a7d5 |
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
public/images/photos/*.jpg filter=lfs diff=lfs merge=lfs -text
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
name: Deploy to GitHub Pages
|
|
||||||
|
|
||||||
on:
|
|
||||||
# Trigger the workflow every time you push to the `main` branch
|
|
||||||
# Using a different branch name? Replace `main` with your branch’s name
|
|
||||||
push:
|
|
||||||
branches: [ main ]
|
|
||||||
# Allows you to run this workflow manually from the Actions tab on GitHub.
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
# Allow this job to clone the repo and create a page deployment
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pages: write
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout your repository using git
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Install, build, and upload your site
|
|
||||||
uses: withastro/action@v3
|
|
||||||
# with:
|
|
||||||
# path: . # The root location of your Astro project inside the repository. (optional)
|
|
||||||
# node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 20. (optional)
|
|
||||||
# package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
environment:
|
|
||||||
name: github-pages
|
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
|
||||||
steps:
|
|
||||||
- name: Deploy to GitHub Pages
|
|
||||||
id: deployment
|
|
||||||
uses: actions/deploy-pages@v4
|
|
||||||
@@ -22,3 +22,8 @@ pnpm-debug.log*
|
|||||||
|
|
||||||
# jetbrains setting folder
|
# jetbrains setting folder
|
||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
|
# Vault CMS / Obsidian
|
||||||
|
.obsidian/workspace.json
|
||||||
|
.obsidian/workspace-mobile.json
|
||||||
|
.ref/
|
||||||
@@ -7,6 +7,9 @@ import sitemap from '@astrojs/sitemap';
|
|||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
vite: {
|
||||||
|
assetsInclude: ['**/*.base', '**/.obsidian/**', '**/_bases/**'],
|
||||||
|
},
|
||||||
site: 'https://pantonius.dev',
|
site: 'https://pantonius.dev',
|
||||||
markdown: {
|
markdown: {
|
||||||
remarkPlugins: [remarkMath],
|
remarkPlugins: [remarkMath],
|
||||||
|
|||||||
@@ -3,4 +3,5 @@ services:
|
|||||||
build: .
|
build: .
|
||||||
ports:
|
ports:
|
||||||
- "4443:80"
|
- "4443:80"
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
Generated
+1210
-2860
File diff suppressed because it is too large.
Load diff
+4
-5
@@ -9,11 +9,10 @@
|
|||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/mdx": "^4.3.5",
|
"@astrojs/mdx": "^5.0.4",
|
||||||
"@astrojs/rss": "^4.0.12",
|
"@astrojs/rss": "^4.0.18",
|
||||||
"@astrojs/sitemap": "^3.5.1",
|
"@astrojs/sitemap": "^3.7.2",
|
||||||
"@astrojs/vue": "^5.1.1",
|
"astro": "^6.1.9",
|
||||||
"astro": "^5.13.7",
|
|
||||||
"rehype-katex": "^7.0.1",
|
"rehype-katex": "^7.0.1",
|
||||||
"remark-math": "^6.0.0"
|
"remark-math": "^6.0.0"
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
|
After Width: | Height: | Size: 3.7 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.7 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.6 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.4 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.3 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.4 MiB |
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
import { getCollection } from 'astro:content';
|
||||||
|
import BlogPost from '../../layouts/BlogPost.astro';
|
||||||
|
import { render } from 'astro:content';
|
||||||
|
import { convertCollectionPost, convertPost, type Post } from '../../models/Post';
|
||||||
|
|
||||||
|
export async function getStaticPaths() {
|
||||||
|
const posts: Post[] = (await getCollection('blog')).map(convertPost);
|
||||||
|
return posts.map((post) => ({
|
||||||
|
params: { slug: post.id },
|
||||||
|
props: post,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
type Props = Post;
|
||||||
|
|
||||||
|
const post: Post = Astro.props;
|
||||||
|
const { Content } = await render(convertCollectionPost(post));
|
||||||
|
---
|
||||||
|
|
||||||
|
<BlogPost {...post}>
|
||||||
|
<Content />
|
||||||
|
</BlogPost>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
import BaseHead from '../../components/BaseHead.astro';
|
||||||
|
import Header from '../../components/Header.astro';
|
||||||
|
import Main from '../../components/Main.astro';
|
||||||
|
import Footer from '../../components/Footer.astro';
|
||||||
|
import { SITE_TITLE, SITE_DESCRIPTION } from '../../consts';
|
||||||
|
import { getCollection } from 'astro:content';
|
||||||
|
import Showcase from '../../components/Showcase.astro';
|
||||||
|
import { convertPost } from '../../models/Post';
|
||||||
|
|
||||||
|
const posts: Post[] = (await getCollection('blog')).map(convertPost).sort(
|
||||||
|
(a, b) => b.pubDate.valueOf() - a.pubDate.valueOf(),
|
||||||
|
);
|
||||||
|
---
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<BaseHead title={SITE_TITLE} description={SITE_DESCRIPTION} />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<Header />
|
||||||
|
<Main>
|
||||||
|
{posts.length === 0 ? (
|
||||||
|
<h1 style="opacity: .5; user-select: none;">No posts yet 😛</h1>
|
||||||
|
) : (
|
||||||
|
<Showcase collection="blog" posts={posts} />
|
||||||
|
)}
|
||||||
|
</Main>
|
||||||
|
<Footer />
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,25 +1,11 @@
|
|||||||
---
|
---
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
|
import Socials from "./Socials.astro";
|
||||||
---
|
---
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
© {today.getFullYear()} <a href="/about">Anton Pogrebnjak</a>. All rights reserved.
|
© {today.getFullYear()} <a href="/about">Anton</a>. All rights reserved.
|
||||||
<div class="social-links">
|
<Socials />
|
||||||
<a href="https://github.com/Pantonius" target="_blank">
|
|
||||||
<span class="sr-only">Go to my GitHub repo</span>
|
|
||||||
<svg
|
|
||||||
viewBox="0 0 16 16"
|
|
||||||
aria-hidden="true"
|
|
||||||
width="32"
|
|
||||||
height="32"
|
|
||||||
astro-icon="social/github"
|
|
||||||
><path
|
|
||||||
fill="currentColor"
|
|
||||||
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"
|
|
||||||
></path></svg
|
|
||||||
>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</footer>
|
</footer>
|
||||||
<style>
|
<style>
|
||||||
footer {
|
footer {
|
||||||
@@ -28,12 +14,6 @@ const today = new Date();
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.social-links {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 1em;
|
|
||||||
margin-top: 1em;
|
|
||||||
}
|
|
||||||
.social-links a {
|
.social-links a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<div id="map" style="height: 400px;">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
let map = L.map('map').setView([47.689749, 9.187857], 16);
|
||||||
|
L.tileLayer('https://sgx.geodatenzentrum.de/wmts_basemapde/tile/1.0.0/de_basemapde_web_raster_grau/default/GLOBAL_WEBMERCATOR/{z}/{y}/{x}.png', {
|
||||||
|
minZoom: 0,
|
||||||
|
maxZoom: 20,
|
||||||
|
attribution: 'Map data: © <a href="http://www.govdata.de/dl-de/by-2-0">dl-de/by-2-0</a>',
|
||||||
|
ext: 'png'
|
||||||
|
}).addTo(map);
|
||||||
|
|
||||||
|
let geojson = await fetch('/geojson/freiraum/uni_konstanz.geojson', {
|
||||||
|
method: 'GET',
|
||||||
|
credentials: 'same-origin',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
|
}).then(res => res.json());
|
||||||
|
|
||||||
|
let geoLayer = L.geoJson(geojson, {
|
||||||
|
style: { fillColor: 'rgba(18, 174, 225, .2)', fillOpacity: 1, stroke: true, color: 'rgba(18, 174, 225, .6)' },
|
||||||
|
}).addTo(map);
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
---
|
||||||
|
import type { Photo } from '../models/Photo.ts';
|
||||||
|
|
||||||
|
const photos: Photo[] = Astro.props.photos;
|
||||||
|
const collection: string = Astro.props.collection;
|
||||||
|
|
||||||
|
const color = Astro.props.color || 'var(--text)';
|
||||||
|
---
|
||||||
|
<section>
|
||||||
|
{
|
||||||
|
photos.map((photo) => (
|
||||||
|
<a href={"/photography/" + photo.id}>
|
||||||
|
<img src={photo.src} />
|
||||||
|
</a>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<style define:vars={{ color }}>
|
||||||
|
section {
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 2px;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
overflow: hidden;
|
||||||
|
min-height: 200px;
|
||||||
|
max-height: 12.5rem;
|
||||||
|
min-width: 200px;
|
||||||
|
max-width: 12.5rem;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
border-radius: 0;
|
||||||
|
|
||||||
|
transition: transform .2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
img:hover {
|
||||||
|
transform: scale(1.2);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+50
-41
@@ -1,34 +1,21 @@
|
|||||||
---
|
---
|
||||||
import { ClientRouter } from "astro:transitions";
|
import { ClientRouter } from "astro:transitions";
|
||||||
import HeaderLink from "./HeaderLink.astro";
|
import HeaderLink from "./HeaderLink.astro";
|
||||||
|
import Socials from "./Socials.astro";
|
||||||
---
|
---
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
<nav>
|
<nav class="head">
|
||||||
<a class="logo" href="/">
|
<a class="logo" href="/">
|
||||||
<img src="/logo.svg" alt="ಠ_ಠ" />
|
<img src="/logo.svg" alt="ಠ_ಠ" />
|
||||||
</a>
|
</a>
|
||||||
<div class="internal-links">
|
<Socials/>
|
||||||
<HeaderLink href="/">Home</HeaderLink>
|
|
||||||
<HeaderLink href="/projects">Projects</HeaderLink>
|
|
||||||
<HeaderLink href="/blog">Blog</HeaderLink>
|
|
||||||
</div>
|
|
||||||
<div class="social-links">
|
|
||||||
<a href="https://github.com/Pantonius" target="_blank">
|
|
||||||
<span class="sr-only">Go to my GitHub repo</span>
|
|
||||||
<svg
|
|
||||||
viewBox="0 0 16 16"
|
|
||||||
aria-hidden="true"
|
|
||||||
width="32"
|
|
||||||
height="32"
|
|
||||||
><path
|
|
||||||
fill="currentColor"
|
|
||||||
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"
|
|
||||||
></path></svg
|
|
||||||
>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</nav>
|
</nav>
|
||||||
|
<nav class="internal-links">
|
||||||
|
<HeaderLink href="/projects">Projects</HeaderLink>
|
||||||
|
<HeaderLink href="/photography">Photography</HeaderLink>
|
||||||
|
<HeaderLink href="/blog">Blog</HeaderLink>
|
||||||
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<ClientRouter />
|
<ClientRouter />
|
||||||
@@ -36,10 +23,22 @@ import HeaderLink from "./HeaderLink.astro";
|
|||||||
<style>
|
<style>
|
||||||
header {
|
header {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0 1em;
|
padding: .5em 1em;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: var(--background-soft);
|
background-color: var(--background-soft);
|
||||||
}
|
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
header .logo {
|
header .logo {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -54,36 +53,46 @@ import HeaderLink from "./HeaderLink.astro";
|
|||||||
height: 24pt;
|
height: 24pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav {
|
.internal-links {
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav a {
|
position: absolute;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.internal-links a {
|
||||||
padding: .4em 0.5em;
|
padding: .4em 0.5em;
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
border-bottom: 4px solid transparent;
|
border-bottom: 4px solid transparent;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav a.active {
|
.internal-links a.active {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
border-bottom-color: var(--primary);
|
border-bottom-color: var(--primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.social-links,
|
@media (max-width: 720px) {
|
||||||
.social-links a {
|
header {
|
||||||
display: flex;
|
flex-direction: column;
|
||||||
}
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 720px) {
|
|
||||||
header .logo img {
|
header .logo img {
|
||||||
height: 18pt;
|
height: 18pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav {
|
nav.head {
|
||||||
font-size: 16px;
|
padding: .5em 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.internal-links {
|
||||||
|
border-top: var(--background) 1px solid;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -15,10 +15,11 @@ const isActive = href === pathname || href === '/' + (subpath?.[0] || '');
|
|||||||
<style>
|
<style>
|
||||||
a {
|
a {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
font-variant-caps: small-caps;
|
||||||
}
|
}
|
||||||
a.active {
|
a.active {
|
||||||
font-weight: bolder;
|
font-weight: bolder;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -28,6 +28,7 @@ import { ClientRouter } from "astro:transitions";
|
|||||||
document.addEventListener("mousemove", (e) => {
|
document.addEventListener("mousemove", (e) => {
|
||||||
mouse.x = e.clientX;
|
mouse.x = e.clientX;
|
||||||
mouse.y = e.clientY;
|
mouse.y = e.clientY;
|
||||||
|
draw();
|
||||||
});
|
});
|
||||||
|
|
||||||
let distanceThreshold = .2;
|
let distanceThreshold = .2;
|
||||||
@@ -66,7 +67,5 @@ import { ClientRouter } from "astro:transitions";
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
setInterval(() => {
|
draw();
|
||||||
draw();
|
|
||||||
}, 1000 / 60);
|
|
||||||
</script>
|
</script>
|
||||||
@@ -15,7 +15,7 @@ const color = Astro.props.color || 'var(--text)';
|
|||||||
<a href={`/${collection}/${post.id}/`}>
|
<a href={`/${collection}/${post.id}/`}>
|
||||||
{
|
{
|
||||||
post.heroImage && (
|
post.heroImage && (
|
||||||
<img class="heroImage" src={post.heroImage} alt="" />
|
<img class="heroImage" src={post.heroImage.src} alt="" />
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@@ -78,6 +78,8 @@ const color = Astro.props.color || 'var(--text)';
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
color: var(--color);
|
color: var(--color);
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
|
font-size: 1em;
|
||||||
|
font-variant-caps: small-caps;
|
||||||
}
|
}
|
||||||
.date {
|
.date {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@@ -101,8 +103,8 @@ const color = Astro.props.color || 'var(--text)';
|
|||||||
ul li:first-child {
|
ul li:first-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
ul li:first-child .title {
|
ul li:first-child .title, ul li .title {
|
||||||
font-size: 1.563em;
|
font-size: 1.2em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<div class="social-links">
|
||||||
|
<a href="https://github.com/Pantonius" target="_blank">
|
||||||
|
<span class="sr-only">Go to my GitHub repo</span>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" width="42" height="42"><!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path fill="currentColor" d="M237.9 461.4C237.9 463.4 235.6 465 232.7 465C229.4 465.3 227.1 463.7 227.1 461.4C227.1 459.4 229.4 457.8 232.3 457.8C235.3 457.5 237.9 459.1 237.9 461.4zM206.8 456.9C206.1 458.9 208.1 461.2 211.1 461.8C213.7 462.8 216.7 461.8 217.3 459.8C217.9 457.8 216 455.5 213 454.6C210.4 453.9 207.5 454.9 206.8 456.9zM251 455.2C248.1 455.9 246.1 457.8 246.4 460.1C246.7 462.1 249.3 463.4 252.3 462.7C255.2 462 257.2 460.1 256.9 458.1C256.6 456.2 253.9 454.9 251 455.2zM316.8 72C178.1 72 72 177.3 72 316C72 426.9 141.8 521.8 241.5 555.2C254.3 557.5 258.8 549.6 258.8 543.1C258.8 536.9 258.5 502.7 258.5 481.7C258.5 481.7 188.5 496.7 173.8 451.9C173.8 451.9 162.4 422.8 146 415.3C146 415.3 123.1 399.6 147.6 399.9C147.6 399.9 172.5 401.9 186.2 425.7C208.1 464.3 244.8 453.2 259.1 446.6C261.4 430.6 267.9 419.5 275.1 412.9C219.2 406.7 162.8 398.6 162.8 302.4C162.8 274.9 170.4 261.1 186.4 243.5C183.8 237 175.3 210.2 189 175.6C209.9 169.1 258 202.6 258 202.6C278 197 299.5 194.1 320.8 194.1C342.1 194.1 363.6 197 383.6 202.6C383.6 202.6 431.7 169 452.6 175.6C466.3 210.3 457.8 237 455.2 243.5C471.2 261.2 481 275 481 302.4C481 398.9 422.1 406.6 366.2 412.9C375.4 420.8 383.2 435.8 383.2 459.3C383.2 493 382.9 534.7 382.9 542.9C382.9 549.4 387.5 557.3 400.2 555C500.2 521.8 568 426.9 568 316C568 177.3 455.5 72 316.8 72zM169.2 416.9C167.9 417.9 168.2 420.2 169.9 422.1C171.5 423.7 173.8 424.4 175.1 423.1C176.4 422.1 176.1 419.8 174.4 417.9C172.8 416.3 170.5 415.6 169.2 416.9zM158.4 408.8C157.7 410.1 158.7 411.7 160.7 412.7C162.3 413.7 164.3 413.4 165 412C165.7 410.7 164.7 409.1 162.7 408.1C160.7 407.5 159.1 407.8 158.4 408.8zM190.8 444.4C189.2 445.7 189.8 448.7 192.1 450.6C194.4 452.9 197.3 453.2 198.6 451.6C199.9 450.3 199.3 447.3 197.3 445.4C195.1 443.1 192.1 442.8 190.8 444.4zM179.4 429.7C177.8 430.7 177.8 433.3 179.4 435.6C181 437.9 183.7 438.9 185 437.9C186.6 436.6 186.6 434 185 431.7C183.6 429.4 181 428.4 179.4 429.7z"/></svg>
|
||||||
|
</a>
|
||||||
|
<a rel="me" href="https://mastodon.social/@pantonius" target="_blank">
|
||||||
|
<span class="sr-only">Go to my Mastodon profile</span>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" width="42" height="42"><!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path fill="currentColor" d="M529 243.1C529 145.9 465.3 117.4 465.3 117.4C402.8 88.7 236.7 89 174.8 117.4C174.8 117.4 111.1 145.9 111.1 243.1C111.1 358.8 104.5 502.5 216.7 532.2C257.2 542.9 292 545.2 320 543.6C370.8 540.8 399.3 525.5 399.3 525.5L397.6 488.6C397.6 488.6 361.3 500 320.5 498.7C280.1 497.3 237.5 494.3 230.9 444.7C230.3 440.1 230 435.4 230 430.8C315.6 451.7 388.7 439.9 408.7 437.5C464.8 430.8 513.7 396.2 519.9 364.6C529.7 314.8 528.9 243.1 528.9 243.1zM453.9 368.3L407.3 368.3L407.3 254.1C407.3 204.4 343.3 202.5 343.3 261L343.3 323.5L297 323.5L297 261C297 202.5 233 204.4 233 254.1L233 368.3L186.3 368.3C186.3 246.2 181.1 220.4 204.7 193.3C230.6 164.4 284.5 162.5 308.5 199.4L320.1 218.9L331.7 199.4C355.8 162.3 409.8 164.6 435.5 193.3C459.2 220.6 453.9 246.3 453.9 368.3L453.9 368.3z"/></svg>
|
||||||
|
</a>
|
||||||
|
<a href="https://instagram.com/kindpanto" target="_blank">
|
||||||
|
<span class="sr-only">Go to my Instgram profile</span>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" width="42" height="42"><!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path fill="currentColor" d="M320.3 205C256.8 204.8 205.2 256.2 205 319.7C204.8 383.2 256.2 434.8 319.7 435C383.2 435.2 434.8 383.8 435 320.3C435.2 256.8 383.8 205.2 320.3 205zM319.7 245.4C360.9 245.2 394.4 278.5 394.6 319.7C394.8 360.9 361.5 394.4 320.3 394.6C279.1 394.8 245.6 361.5 245.4 320.3C245.2 279.1 278.5 245.6 319.7 245.4zM413.1 200.3C413.1 185.5 425.1 173.5 439.9 173.5C454.7 173.5 466.7 185.5 466.7 200.3C466.7 215.1 454.7 227.1 439.9 227.1C425.1 227.1 413.1 215.1 413.1 200.3zM542.8 227.5C541.1 191.6 532.9 159.8 506.6 133.6C480.4 107.4 448.6 99.2 412.7 97.4C375.7 95.3 264.8 95.3 227.8 97.4C192 99.1 160.2 107.3 133.9 133.5C107.6 159.7 99.5 191.5 97.7 227.4C95.6 264.4 95.6 375.3 97.7 412.3C99.4 448.2 107.6 480 133.9 506.2C160.2 532.4 191.9 540.6 227.8 542.4C264.8 544.5 375.7 544.5 412.7 542.4C448.6 540.7 480.4 532.5 506.6 506.2C532.8 480 541 448.2 542.8 412.3C544.9 375.3 544.9 264.5 542.8 227.5zM495 452C487.2 471.6 472.1 486.7 452.4 494.6C422.9 506.3 352.9 503.6 320.3 503.6C287.7 503.6 217.6 506.2 188.2 494.6C168.6 486.8 153.5 471.7 145.6 452C133.9 422.5 136.6 352.5 136.6 319.9C136.6 287.3 134 217.2 145.6 187.8C153.4 168.2 168.5 153.1 188.2 145.2C217.7 133.5 287.7 136.2 320.3 136.2C352.9 136.2 423 133.6 452.4 145.2C472 153 487.1 168.1 495 187.8C506.7 217.3 504 287.3 504 319.9C504 352.5 506.7 422.6 495 452z"/></svg>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.social-links,
|
||||||
|
.social-links a {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+43
-12
@@ -1,34 +1,65 @@
|
|||||||
import { glob } from 'astro/loaders';
|
import { glob, file } from 'astro/loaders';
|
||||||
import { defineCollection, z } from 'astro:content';
|
import { defineCollection, z } from 'astro:content';
|
||||||
|
|
||||||
|
const bachelor = defineCollection({
|
||||||
|
// Load Markdown and MDX files in the `src/content/blog/` directory.
|
||||||
|
loader: glob({ base: './src/content/bachelor', pattern: '**/*.{md,mdx}' }),
|
||||||
|
// Type-check frontmatter using a schema
|
||||||
|
schema: ({ image }) => z.object({
|
||||||
|
title: z.string(),
|
||||||
|
description: z.string(),
|
||||||
|
part: z.number(),
|
||||||
|
// Transform string to Date object
|
||||||
|
pubDate: z.coerce.date(),
|
||||||
|
updatedDate: z.coerce.date().optional(),
|
||||||
|
heroImage: image().optional(),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
const blog = defineCollection({
|
const blog = defineCollection({
|
||||||
// Load Markdown and MDX files in the `src/content/blog/` directory.
|
// Load Markdown and MDX files in the `src/content/blog/` directory.
|
||||||
loader: glob({ base: './src/content/blog', pattern: '**/*.{md,mdx}' }),
|
loader: glob({ base: './src/content/blog', pattern: '**/*.{md,mdx}' }),
|
||||||
// Type-check frontmatter using a schema
|
// Type-check frontmatter using a schema
|
||||||
schema: z.object({
|
schema: ({ image }) => z.object({
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
description: z.string(),
|
description: z.string(),
|
||||||
// Transform string to Date object
|
// Transform string to Date object
|
||||||
pubDate: z.coerce.date(),
|
pubDate: z.coerce.date(),
|
||||||
updatedDate: z.coerce.date().optional(),
|
updatedDate: z.coerce.date().optional(),
|
||||||
heroImage: z.string().optional(),
|
heroImage: image().optional(),
|
||||||
}),
|
}),
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const projects = defineCollection({
|
const photography = defineCollection({
|
||||||
// Load Markdown and MDX files in the `src/content/blog/` directory.
|
// Load Markdown and MDX files in the `src/content/projects/` directory.
|
||||||
loader: glob({
|
loader: file(
|
||||||
base: './src/content/projects', pattern: '**/*.{md,mdx}'
|
'./src/content/photography/index.json'
|
||||||
}),
|
),
|
||||||
// Type-check frontmatter using a schema
|
// Type-check frontmatter using a schema
|
||||||
schema: z.object({
|
schema: z.object({
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
description: z.string(),
|
description: z.string(),
|
||||||
|
src: z.string(),
|
||||||
// Transform string to Date object
|
// Transform string to Date object
|
||||||
pubDate: z.coerce.date(),
|
pubDate: z.coerce.date(),
|
||||||
updatedDate: z.coerce.date().optional(),
|
|
||||||
heroImage: z.string().optional(),
|
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const collections = { blog, projects };
|
const projects = defineCollection({
|
||||||
|
// Load Markdown and MDX files in the `src/content/projects/` directory.
|
||||||
|
loader: glob({
|
||||||
|
base: './src/content/projects', pattern: '**/*.{md,mdx}'
|
||||||
|
}),
|
||||||
|
// Type-check frontmatter using a schema
|
||||||
|
schema: ({ image }) => z.object({
|
||||||
|
title: z.string(),
|
||||||
|
description: z.string(),
|
||||||
|
// Transform string to Date object
|
||||||
|
pubDate: z.coerce.date(),
|
||||||
|
updatedDate: z.coerce.date().optional(),
|
||||||
|
heroImage: image().optional(),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const collections = { bachelor, blog, photography, projects };
|
||||||
Vendored
+47
@@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"showInlineTitle": false,
|
||||||
|
"promptDelete": true,
|
||||||
|
"showIndentGuide": false,
|
||||||
|
"attachmentFolderPath": "attachments",
|
||||||
|
"userIgnoreFilters": [
|
||||||
|
"dist",
|
||||||
|
"node_modules/"
|
||||||
|
],
|
||||||
|
"focusNewTab": false,
|
||||||
|
"mobilePullAction": "command-palette:open",
|
||||||
|
"trashOption": "system",
|
||||||
|
"alwaysUpdateLinks": true,
|
||||||
|
"useMarkdownLinks": true,
|
||||||
|
"mobileToolbarCommands": [
|
||||||
|
"editor:undo",
|
||||||
|
"editor:redo",
|
||||||
|
"editor:insert-wikilink",
|
||||||
|
"editor:insert-embed",
|
||||||
|
"editor:insert-tag",
|
||||||
|
"editor:attach-file",
|
||||||
|
"editor:set-heading",
|
||||||
|
"editor:toggle-bold",
|
||||||
|
"editor:toggle-italics",
|
||||||
|
"editor:toggle-strikethrough",
|
||||||
|
"editor:toggle-highlight",
|
||||||
|
"editor:toggle-code",
|
||||||
|
"editor:toggle-blockquote",
|
||||||
|
"editor:insert-link",
|
||||||
|
"editor:toggle-bullet-list",
|
||||||
|
"editor:toggle-numbered-list",
|
||||||
|
"editor:toggle-checklist-status",
|
||||||
|
"editor:indent-list",
|
||||||
|
"editor:unindent-list",
|
||||||
|
"astro-composer:standardize-properties",
|
||||||
|
"astro-composer:convert-wikilinks-astro",
|
||||||
|
"seo:seo-run-current",
|
||||||
|
"editor:configure-toolbar"
|
||||||
|
],
|
||||||
|
"newFileLocation": "folder",
|
||||||
|
"newFileFolderPath": "blog",
|
||||||
|
"newLinkFormat": "relative",
|
||||||
|
"mobileQuickRibbonItem": "",
|
||||||
|
"vimMode": false,
|
||||||
|
"readableLineLength": true,
|
||||||
|
"defaultViewMode": "source"
|
||||||
|
}
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"cssTheme": "Oxygen",
|
||||||
|
"showViewHeader": true,
|
||||||
|
"showRibbon": false,
|
||||||
|
"enabledCssSnippets": [
|
||||||
|
"astro-modular-styling"
|
||||||
|
],
|
||||||
|
"theme": "moonstone",
|
||||||
|
"accentColor": ""
|
||||||
|
}
|
||||||
Vendored
+3
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"backlinkInDocument": true
|
||||||
|
}
|
||||||
Vendored
+10
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"ctime": 1755331588238,
|
||||||
|
"path": "_formatting-reference.md",
|
||||||
|
"title": "Formatting Reference"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
[
|
||||||
|
"seo",
|
||||||
|
"property-over-file-name",
|
||||||
|
"oxygen-settings",
|
||||||
|
"vault-cms",
|
||||||
|
"astro-composer",
|
||||||
|
"settings-search",
|
||||||
|
"editing-toolbar",
|
||||||
|
"image-manager",
|
||||||
|
"bases-cms",
|
||||||
|
"home-base",
|
||||||
|
"obsidian-git",
|
||||||
|
"zenmode",
|
||||||
|
"tag-wrangler",
|
||||||
|
"explorer-focus",
|
||||||
|
"ui-tweaker",
|
||||||
|
"obsidian42-brat",
|
||||||
|
"omnisearch",
|
||||||
|
"data-files-editor",
|
||||||
|
"file-name-history",
|
||||||
|
"nested-properties",
|
||||||
|
"paste-image-into-property",
|
||||||
|
"homepage",
|
||||||
|
"obsidian-paste-image-rename"
|
||||||
|
]
|
||||||
+33
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"file-explorer": true,
|
||||||
|
"global-search": true,
|
||||||
|
"switcher": true,
|
||||||
|
"graph": false,
|
||||||
|
"backlink": false,
|
||||||
|
"canvas": false,
|
||||||
|
"outgoing-link": false,
|
||||||
|
"tag-pane": true,
|
||||||
|
"footnotes": false,
|
||||||
|
"properties": false,
|
||||||
|
"page-preview": false,
|
||||||
|
"daily-notes": false,
|
||||||
|
"templates": false,
|
||||||
|
"note-composer": false,
|
||||||
|
"command-palette": true,
|
||||||
|
"slash-command": true,
|
||||||
|
"editor-status": true,
|
||||||
|
"bookmarks": true,
|
||||||
|
"markdown-importer": false,
|
||||||
|
"zk-prefixer": false,
|
||||||
|
"random-note": false,
|
||||||
|
"outline": true,
|
||||||
|
"word-count": true,
|
||||||
|
"slides": false,
|
||||||
|
"audio-recorder": false,
|
||||||
|
"workspaces": false,
|
||||||
|
"file-recovery": true,
|
||||||
|
"publish": false,
|
||||||
|
"sync": false,
|
||||||
|
"bases": true,
|
||||||
|
"webviewer": false
|
||||||
|
}
|
||||||
Vendored
+30
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"collapse-filter": true,
|
||||||
|
"search": "path:posts/",
|
||||||
|
"showTags": false,
|
||||||
|
"showAttachments": false,
|
||||||
|
"hideUnresolved": false,
|
||||||
|
"showOrphans": true,
|
||||||
|
"collapse-color-groups": true,
|
||||||
|
"colorGroups": [
|
||||||
|
{
|
||||||
|
"query": "",
|
||||||
|
"color": {
|
||||||
|
"a": 1,
|
||||||
|
"rgb": 14701138
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"collapse-display": true,
|
||||||
|
"showArrow": false,
|
||||||
|
"textFadeMultiplier": 0,
|
||||||
|
"nodeSizeMultiplier": 1,
|
||||||
|
"lineSizeMultiplier": 1,
|
||||||
|
"collapse-forces": true,
|
||||||
|
"centerStrength": 0.518713248970312,
|
||||||
|
"repelStrength": 10,
|
||||||
|
"linkStrength": 1,
|
||||||
|
"linkDistance": 250,
|
||||||
|
"scale": 1.0147822288211785,
|
||||||
|
"close": true
|
||||||
|
}
|
||||||
Vendored
+274
@@ -0,0 +1,274 @@
|
|||||||
|
{
|
||||||
|
"app:go-back": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod",
|
||||||
|
"Alt"
|
||||||
|
],
|
||||||
|
"key": "ArrowLeft"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Alt"
|
||||||
|
],
|
||||||
|
"key": "ArrowLeft"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"app:go-forward": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod",
|
||||||
|
"Alt"
|
||||||
|
],
|
||||||
|
"key": "ArrowRight"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Alt"
|
||||||
|
],
|
||||||
|
"key": "ArrowRight"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"homepage:open-homepage": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod"
|
||||||
|
],
|
||||||
|
"key": "M"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"app:toggle-left-sidebar": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Alt",
|
||||||
|
"Mod"
|
||||||
|
],
|
||||||
|
"key": "Z"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"app:toggle-right-sidebar": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Alt",
|
||||||
|
"Mod"
|
||||||
|
],
|
||||||
|
"key": "X"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"obsidian-git:push": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod",
|
||||||
|
"Shift"
|
||||||
|
],
|
||||||
|
"key": "S"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"insert-unsplash-image:insert": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod"
|
||||||
|
],
|
||||||
|
"key": "'"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"custom-save:save": [],
|
||||||
|
"editor:insert-callout": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod",
|
||||||
|
"Shift"
|
||||||
|
],
|
||||||
|
"key": "C"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"astro-composer:rename-note": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod"
|
||||||
|
],
|
||||||
|
"key": "R"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"astro-composer:rename-content": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod"
|
||||||
|
],
|
||||||
|
"key": "R"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"editor:toggle-fold-properties": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Alt",
|
||||||
|
"Mod"
|
||||||
|
],
|
||||||
|
"key": "P"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"seo:seo-open-global": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod",
|
||||||
|
"Shift"
|
||||||
|
],
|
||||||
|
"key": "A"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"insert-unsplash-image:insert-in-frontmatter": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod",
|
||||||
|
"Shift"
|
||||||
|
],
|
||||||
|
"key": "'"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"astro-modular-settings:open-settings": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod",
|
||||||
|
"Shift"
|
||||||
|
],
|
||||||
|
"key": ","
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"seo:open-global": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod",
|
||||||
|
"Shift"
|
||||||
|
],
|
||||||
|
"key": "A"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"oxygen-settings:toggle-minimal-focus-mode": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Alt",
|
||||||
|
"Mod"
|
||||||
|
],
|
||||||
|
"key": "F"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"zenmode:exit-zen-mode": [],
|
||||||
|
"oxygen-settings:toggle-zen-mode": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod",
|
||||||
|
"Shift"
|
||||||
|
],
|
||||||
|
"key": "Z"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"oxygen-settings:toggle-tab-containers": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Alt",
|
||||||
|
"Mod"
|
||||||
|
],
|
||||||
|
"key": "S"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"app:toggle-ribbon": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Alt",
|
||||||
|
"Mod"
|
||||||
|
],
|
||||||
|
"key": "A"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"zenmode:toggle-zen-mode": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod",
|
||||||
|
"Shift"
|
||||||
|
],
|
||||||
|
"key": "Z"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"app:reload": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod",
|
||||||
|
"Shift"
|
||||||
|
],
|
||||||
|
"key": "R"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"theme:toggle-light-dark": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod",
|
||||||
|
"Shift"
|
||||||
|
],
|
||||||
|
"key": "M"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"astro-composer:open-project-terminal": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod",
|
||||||
|
"Shift"
|
||||||
|
],
|
||||||
|
"key": "D"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"editing-toolbar:workplace-fullscreen-focus": [],
|
||||||
|
"editing-toolbar:fullscreen-focus": [],
|
||||||
|
"editing-toolbar:hide-show-menu": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod",
|
||||||
|
"Shift"
|
||||||
|
],
|
||||||
|
"key": "E"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"astro-composer:edit-astro-config": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod",
|
||||||
|
"Shift"
|
||||||
|
],
|
||||||
|
"key": ","
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"image-manager:search-image": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod"
|
||||||
|
],
|
||||||
|
"key": "'"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"image-manager:insert-remote-image-to-property": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod",
|
||||||
|
"Shift"
|
||||||
|
],
|
||||||
|
"key": "'"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ui-tweaker:toggle-tab-bar": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Alt",
|
||||||
|
"Mod"
|
||||||
|
],
|
||||||
|
"key": "S"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"omnisearch:show-modal": [
|
||||||
|
{
|
||||||
|
"modifiers": [
|
||||||
|
"Mod",
|
||||||
|
"Shift"
|
||||||
|
],
|
||||||
|
"key": "O"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
{
|
||||||
|
"defaultTemplate": "---\ntitle: \"{{title}}\"\npubDate: {{date}}\ndescription: \"\"\nheroImage: \"\"\n---\n",
|
||||||
|
"autoInsertProperties": true,
|
||||||
|
"dateFormat": "YYYY-MM-DD",
|
||||||
|
"enableCopyHeadingLink": true,
|
||||||
|
"copyHeadingLinkFormat": "astro",
|
||||||
|
"addTrailingSlashToLinks": true,
|
||||||
|
"enableOpenTerminalCommand": true,
|
||||||
|
"terminalProjectRootPath": "../..",
|
||||||
|
"terminalApplicationName": "",
|
||||||
|
"enableTerminalDebugLogging": false,
|
||||||
|
"enableTerminalRibbonIcon": true,
|
||||||
|
"enableOpenConfigFileCommand": true,
|
||||||
|
"configFilePath": "../../astro.config.mjs",
|
||||||
|
"enableConfigRibbonIcon": true,
|
||||||
|
"contentTypes": [
|
||||||
|
{
|
||||||
|
"id": "content-type-1775852991942-ai56rw2lw",
|
||||||
|
"name": "Blog",
|
||||||
|
"folder": "blog",
|
||||||
|
"linkBasePath": "/blog/",
|
||||||
|
"template": "---\ntitle: \"{{title}}\"\npubDate: {{date}}\ndescription: \"\"\nheroImage: \"\"\n---\n",
|
||||||
|
"enabled": true,
|
||||||
|
"creationMode": "file",
|
||||||
|
"indexFileName": "index",
|
||||||
|
"ignoreSubfolders": false,
|
||||||
|
"enableUnderscorePrefix": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "content-type-1775852991942-7eiqfk6yj",
|
||||||
|
"name": "Bachelor",
|
||||||
|
"folder": "bachelor",
|
||||||
|
"linkBasePath": "/bachelor/",
|
||||||
|
"template": "---\ntitle: \"{{title}}\"\npubDate: {{date}}\ndescription: \"\"\nheroImage: \"\"\npart: 1\n---\n",
|
||||||
|
"enabled": true,
|
||||||
|
"creationMode": "file",
|
||||||
|
"indexFileName": "index",
|
||||||
|
"ignoreSubfolders": false,
|
||||||
|
"enableUnderscorePrefix": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "content-type-1775852991942-gvtf8m5h6",
|
||||||
|
"name": "Projects",
|
||||||
|
"folder": "projects",
|
||||||
|
"linkBasePath": "/projects/",
|
||||||
|
"template": "---\ntitle: \"{{title}}\"\npubDate: {{date}}\ndescription: \"\"\nheroImage: \"\"\n---\n",
|
||||||
|
"enabled": true,
|
||||||
|
"creationMode": "file",
|
||||||
|
"indexFileName": "index",
|
||||||
|
"ignoreSubfolders": false,
|
||||||
|
"enableUnderscorePrefix": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"migrationCompleted": true,
|
||||||
|
"helpButtonReplacement": {
|
||||||
|
"enabled": true,
|
||||||
|
"commandId": "astro-composer:edit-astro-config",
|
||||||
|
"iconId": "rocket"
|
||||||
|
},
|
||||||
|
"showMdxFilesInExplorer": true,
|
||||||
|
"processBackgroundFileChanges": true,
|
||||||
|
"syncDraftDate": false,
|
||||||
|
"draftDetectionMode": "property",
|
||||||
|
"draftProperty": "",
|
||||||
|
"draftLogic": "true-is-draft",
|
||||||
|
"publishDateField": "pubDate",
|
||||||
|
"renameOnTitleClick": false,
|
||||||
|
"updateModifiedDate": false,
|
||||||
|
"modifiedDateField": ""
|
||||||
|
}
|
||||||
+4467
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
|||||||
|
{"id":"astro-composer","name":"Astro Composer","version":"0.12.0","minAppVersion":"1.11.0","description":"Turn your notes into posts and pages for your Astro blog with automated content management features.","author":"David V. Kimball","authorUrl":"https://davidvkimball.com","fundingUrl":"https://patreon.com/davidvkimball","isDesktopOnly":false}
|
||||||
@@ -0,0 +1,372 @@
|
|||||||
|
.astro-composer-title-input {
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-button-container {
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
justify-content: flex-end;
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure all buttons in the button container use default cursor */
|
||||||
|
.astro-composer-button-container button {
|
||||||
|
cursor: default !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-button-container button:hover {
|
||||||
|
cursor: default !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-cancel-button,
|
||||||
|
.astro-composer-create-button {
|
||||||
|
padding: 6px 12px;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: default !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-cancel-button:hover,
|
||||||
|
.astro-composer-create-button:hover {
|
||||||
|
cursor: default !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-create-button.mod-cta {
|
||||||
|
background-color: var(--interactive-accent);
|
||||||
|
color: var(--text-on-accent);
|
||||||
|
cursor: default !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-create-button.mod-cta:hover {
|
||||||
|
background-color: var(--interactive-accent-hover);
|
||||||
|
cursor: default !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-template-textarea {
|
||||||
|
height: 300px; /* Adjusted for 5-10 lines of properties */
|
||||||
|
width: 100%;
|
||||||
|
padding: 8px;
|
||||||
|
resize: vertical; /* Allow vertical resizing */
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-modal {
|
||||||
|
padding: 20px;
|
||||||
|
max-width: 500px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-modal h2 {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Custom Content Types Styling */
|
||||||
|
.custom-content-types-container {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-content-type-item {
|
||||||
|
border: 1px solid var(--background-modifier-border);
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 16px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
background-color: var(--background-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-content-type-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-content-type-header .setting-item {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-content-type-header .setting-item-name {
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--text-normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-content-type-item .setting-item {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-content-type-item .setting-item:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add spacing between settings in custom content types since we removed dividers */
|
||||||
|
.custom-content-type-settings > div {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-content-type-settings > div:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-content-type-settings {
|
||||||
|
transition: all 0.2s ease-in-out;
|
||||||
|
padding-top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-content-type-settings[style*="none"] {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-10px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Mobile-specific improvements for Astro Composer modal */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
/* Force mobile positioning for all modals containing our content */
|
||||||
|
.modal:has(.astro-composer-title-input) {
|
||||||
|
position: fixed !important;
|
||||||
|
top: 10% !important;
|
||||||
|
left: 50% !important;
|
||||||
|
transform: translateX(-50%) !important;
|
||||||
|
max-height: 50vh !important;
|
||||||
|
overflow-y: auto !important;
|
||||||
|
width: 90vw !important;
|
||||||
|
max-width: 500px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Only target our specific modal content, not all modals */
|
||||||
|
.modal .astro-composer-title-input {
|
||||||
|
font-size: 16px; /* Prevents zoom on iOS */
|
||||||
|
padding: 12px;
|
||||||
|
border: 1px solid var(--background-modifier-border);
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure our modal content is properly sized on mobile */
|
||||||
|
.modal .astro-composer-button-container {
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal .astro-composer-cancel-button,
|
||||||
|
.modal .astro-composer-create-button {
|
||||||
|
width: 100%;
|
||||||
|
padding: 12px;
|
||||||
|
font-size: 16px;
|
||||||
|
cursor: default !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal .astro-composer-cancel-button:hover,
|
||||||
|
.modal .astro-composer-create-button:hover {
|
||||||
|
cursor: default !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Fallback for browsers that don't support :has() */
|
||||||
|
.astro-composer-mobile-modal {
|
||||||
|
position: fixed !important;
|
||||||
|
top: 10% !important;
|
||||||
|
left: 50% !important;
|
||||||
|
transform: translateX(-50%) !important;
|
||||||
|
max-height: 50vh !important;
|
||||||
|
overflow-y: auto !important;
|
||||||
|
width: 90vw !important;
|
||||||
|
max-width: 500px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Settings UI utility classes */
|
||||||
|
.astro-composer-setting-container-visible {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-setting-container-hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-custom-type-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-header-name {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Collapse button */
|
||||||
|
.astro-composer-collapse-button {
|
||||||
|
background: transparent !important;
|
||||||
|
border: none !important;
|
||||||
|
padding: 4px;
|
||||||
|
margin-right: 4px;
|
||||||
|
cursor: default;
|
||||||
|
color: var(--text-muted);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: background-color 0.2s ease, color 0.2s ease;
|
||||||
|
box-shadow: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-collapse-button:hover {
|
||||||
|
background-color: var(--background-modifier-hover);
|
||||||
|
color: var(--text-normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-collapse-button:active {
|
||||||
|
background-color: var(--background-modifier-active);
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-collapse-button svg {
|
||||||
|
transition: transform 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-collapse-button.is-collapsed svg {
|
||||||
|
transform: rotate(-90deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Reorder buttons container */
|
||||||
|
.astro-composer-reorder-buttons {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
gap: 4px;
|
||||||
|
margin-right: 8px;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Reorder buttons - minimal icon-only style */
|
||||||
|
.astro-composer-reorder-button {
|
||||||
|
background: transparent !important;
|
||||||
|
border: none !important;
|
||||||
|
padding: 4px;
|
||||||
|
cursor: default;
|
||||||
|
color: var(--text-muted);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: background-color 0.2s ease, color 0.2s ease;
|
||||||
|
line-height: 1;
|
||||||
|
opacity: 0.6;
|
||||||
|
box-shadow: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-reorder-button:hover:not(:disabled) {
|
||||||
|
background-color: var(--background-modifier-hover);
|
||||||
|
color: var(--text-normal);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-reorder-button:active:not(:disabled) {
|
||||||
|
background-color: var(--background-modifier-active);
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-reorder-button:disabled {
|
||||||
|
opacity: 0.2;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-reorder-button svg {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-remove-setting {
|
||||||
|
border-top: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-add-button {
|
||||||
|
border-top: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Floating button container - no settings background, right-aligned */
|
||||||
|
.astro-composer-add-button-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
margin-top: 16px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
padding: 0;
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-add-button-container button {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Settings tab - hidden setting elements */
|
||||||
|
/* Only hide the setting item info elements, not nested ones inside content types */
|
||||||
|
.astro-composer-setting-hidden-elements > .setting-item-info > .setting-item-name,
|
||||||
|
.astro-composer-setting-hidden-elements > .setting-item-info > .setting-item-description,
|
||||||
|
.astro-composer-setting-hidden-elements > .setting-item-control {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-setting-hidden-elements {
|
||||||
|
border-top: none;
|
||||||
|
padding-top: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-setting-container-full-width {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-custom-types-container-visible {
|
||||||
|
display: block !important;
|
||||||
|
width: 100% !important;
|
||||||
|
visibility: visible !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure custom content types container is always visible even when parent has hidden elements */
|
||||||
|
.astro-composer-setting-hidden-elements .custom-content-types-container {
|
||||||
|
display: block !important;
|
||||||
|
visibility: visible !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure content type items inside the container are visible */
|
||||||
|
.custom-content-types-container .custom-content-type-item {
|
||||||
|
display: block !important;
|
||||||
|
visibility: visible !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Conflict warning styles */
|
||||||
|
.astro-composer-conflict-warning {
|
||||||
|
color: var(--text-warning);
|
||||||
|
font-size: 0.9em;
|
||||||
|
margin-top: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-conflict-warning.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Help button replacement */
|
||||||
|
/* No special display needed - inherits from parent flex container */
|
||||||
|
|
||||||
|
/* Ribbon context menu hiding - these will be applied via classes */
|
||||||
|
.astro-composer-hide-terminal-icon .menu-item:has(svg[data-lucide="terminal-square"]),
|
||||||
|
.astro-composer-hide-terminal-icon .menu-item:has(.lucide-terminal-square),
|
||||||
|
.astro-composer-hide-terminal-icon .menu-item .menu-item-icon:has(svg[data-lucide="terminal-square"]),
|
||||||
|
.astro-composer-hide-terminal-icon .menu-item .menu-item-icon:has(.lucide-terminal-square) {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.astro-composer-hide-config-icon .menu-item:has(svg[data-lucide="wrench"]),
|
||||||
|
.astro-composer-hide-config-icon .menu-item:has(svg[data-lucide="rocket"]),
|
||||||
|
.astro-composer-hide-config-icon .menu-item:has(.lucide-wrench),
|
||||||
|
.astro-composer-hide-config-icon .menu-item:has(.lucide-rocket),
|
||||||
|
.astro-composer-hide-config-icon .menu-item .menu-item-icon:has(svg[data-lucide="wrench"]),
|
||||||
|
.astro-composer-hide-config-icon .menu-item .menu-item-icon:has(svg[data-lucide="rocket"]),
|
||||||
|
.astro-composer-hide-config-icon .menu-item .menu-item-icon:has(.lucide-wrench),
|
||||||
|
.astro-composer-hide-config-icon .menu-item .menu-item-icon:has(.lucide-rocket) {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Help button hiding */
|
||||||
|
.astro-composer-hide-help-button .workspace-drawer-vault-actions .clickable-icon:has(svg.help) {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Scoped to only this plugin's settings container to avoid affecting other plugins */
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"confirmBulkOperations": true,
|
||||||
|
"deleteParentFolder": true,
|
||||||
|
"deleteParentFolderFilename": "index",
|
||||||
|
"deleteUniqueAttachments": true,
|
||||||
|
"confirmDeletions": true,
|
||||||
|
"useHomeIcon": true,
|
||||||
|
"enableQuickEdit": true,
|
||||||
|
"quickEditCommand": "astro-composer:rename-content",
|
||||||
|
"quickEditCommandName": "Astro Composer: Rename current content",
|
||||||
|
"quickEditIcon": "lucide-pencil-line",
|
||||||
|
"quickEditOpenFile": false,
|
||||||
|
"showToolbarSelectAll": true,
|
||||||
|
"showToolbarClear": true,
|
||||||
|
"showToolbarDraft": true,
|
||||||
|
"showToolbarPublish": true,
|
||||||
|
"showToolbarTags": true,
|
||||||
|
"showToolbarSet": true,
|
||||||
|
"showToolbarRemove": true,
|
||||||
|
"showToolbarDelete": true,
|
||||||
|
"forceStaticGifImages": false,
|
||||||
|
"embeddedViewRefreshDebounceMs": 250,
|
||||||
|
"virtualScrollThreshold": 100,
|
||||||
|
"virtualScrollBuffer": 20,
|
||||||
|
"migrationBasesCmsToCmsDone": true,
|
||||||
|
"showPropertiesInfoModal": true,
|
||||||
|
"thumbnailCacheSize": "balanced"
|
||||||
|
}
|
||||||
+6786
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"id": "bases-cms",
|
||||||
|
"name": "Bases CMS",
|
||||||
|
"version": "0.4.9",
|
||||||
|
"minAppVersion": "1.11.0",
|
||||||
|
"description": "Manage your notes in bases like a content management system.",
|
||||||
|
"author": "David V. Kimball",
|
||||||
|
"authorUrl": "https://davidvkimball.com",
|
||||||
|
"fundingUrl": "https://patreon.com/davidvkimball",
|
||||||
|
"isDesktopOnly": false
|
||||||
|
}
|
||||||
+1570
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"doLoadTxt": false,
|
||||||
|
"doCreateTxt": false,
|
||||||
|
"doLoadXml": false,
|
||||||
|
"doCreateXml": false,
|
||||||
|
"doLoadJson": true,
|
||||||
|
"doCreateJson": true,
|
||||||
|
"doLoadYaml": false,
|
||||||
|
"doCreateYaml": false,
|
||||||
|
"doLoadAstro": true,
|
||||||
|
"doCreateAstro": true,
|
||||||
|
"doLoadTs": false,
|
||||||
|
"doCreateTs": false,
|
||||||
|
"doLoadCss": false,
|
||||||
|
"doCreateCss": false,
|
||||||
|
"doLoadHtml": false,
|
||||||
|
"doCreateHtml": false,
|
||||||
|
"doLoadJs": false,
|
||||||
|
"doCreateJs": false,
|
||||||
|
"doLoadMjs": false,
|
||||||
|
"doCreateMjs": false,
|
||||||
|
"doAutosaveFiles": true,
|
||||||
|
"lineWrapping": true
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
/*
|
||||||
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||||
|
if you want to view the source, please visit the github repository of this plugin
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Ne=Object.create;var W=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var ze=Object.getOwnPropertyNames;var Ae=Object.getPrototypeOf,je=Object.prototype.hasOwnProperty;var Ie=(e,t)=>{for(var s in t)W(e,s,{get:t[s],enumerable:!0})},ge=(e,t,s,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let O of ze(t))!je.call(e,O)&&O!==s&&W(e,O,{get:()=>t[O],enumerable:!(o=Ge(t,O))||o.enumerable});return e};var Be=(e,t,s)=>(s=e!=null?Ne(Ae(e)):{},ge(t||!e||!e.__esModule?W(s,"default",{value:e,enumerable:!0}):s,e)),Je=e=>ge(W({},"__esModule",{value:!0}),e);var wt={};Ie(wt,{default:()=>G});module.exports=Je(wt);var z=require("obsidian");var qe=require("obsidian");var X="json";var c="txt";var x="yaml",A="json",j="xml",I="txt",B="yaml",ce="yml",J="astro",H="ts",F="css",K="html",ee="js",te="mjs";var pe=require("@lezer/lr"),P=require("@lezer/highlight"),Fe=(0,P.styleTags)({String:P.tags.string,Number:P.tags.number,"True False":P.tags.bool,PropertyName:P.tags.propertyName,Null:P.tags.null,", :":P.tags.separator,"[ ]":P.tags.squareBracket,"{ }":P.tags.brace}),fe=pe.LRParser.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"\u26A0 JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[Fe],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});var f=require("@codemirror/language");var Ke=f.LRLanguage.define({name:"json",parser:fe.configure({props:[f.indentNodeProp.add({Object:(0,f.continuedIndent)({except:/^\s*\}/}),Array:(0,f.continuedIndent)({except:/^\s*\]/})}),f.foldNodeProp.add({"Object Array":f.foldInside})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function me(){return new f.LanguageSupport(Ke)}var se=require("@codemirror/view"),$=require("@codemirror/commands"),Pe=require("@codemirror/language"),D=()=>[se.keymap.of([$.indentWithTab]),Pe.indentUnit.of(" ")],he=()=>[se.keymap.of([{key:"Shift-Tab",preventDefault:!0,run:$.indentLess}])];var Se=require("obsidian"),k=require("@codemirror/view"),Xe=require("@codemirror/state"),xe=require("@codemirror/commands");var g=require("@codemirror/view"),et=require("@codemirror/view"),Qe=require("@codemirror/state"),m=require("@codemirror/language"),v=require("@codemirror/commands"),q=require("@codemirror/search"),S=require("@codemirror/autocomplete"),ue=require("@codemirror/lint"),Te=(()=>[(0,g.lineNumbers)(),(0,g.highlightActiveLineGutter)(),(0,g.highlightSpecialChars)(),(0,v.history)(),(0,m.foldGutter)(),(0,g.drawSelection)(),(0,g.dropCursor)(),Qe.EditorState.allowMultipleSelections.of(!0),(0,m.indentOnInput)(),(0,m.syntaxHighlighting)(m.defaultHighlightStyle,{fallback:!0}),(0,m.bracketMatching)(),(0,S.closeBrackets)(),(0,S.autocompletion)(),(0,g.rectangularSelection)(),(0,g.crosshairCursor)(),(0,g.highlightActiveLine)(),(0,q.highlightSelectionMatches)(),g.keymap.of([...S.closeBracketsKeymap,...v.defaultKeymap,...q.searchKeymap,...v.historyKeymap,...m.foldKeymap,...S.completionKeymap,...ue.lintKeymap])])();var h=class extends Se.TextFileView{constructor(s,o){super(s);this.customHistoryKeymap=[{win:"Ctrl-Shift-z",run:xe.redo,preventDefault:!0}];this.plugin=o}onload(){super.onload(),this.editorEl=this.contentEl.createDiv("datafile-source-view mod-cm6"),this.cmEditor=new k.EditorView({state:this.createDefaultEditorState(),parent:this.editorEl}),this.app.workspace.trigger("codemirror",this.cmEditor)}getViewData(){return this.cmEditor.state.doc.toString()}setViewData(s,o){this.cmEditor.dispatch({changes:{from:0,to:this.cmEditor.state.doc.length,insert:s}})}clear(){}getDisplayText(){return this.file?this.file.basename:"NOFILE"}onClose(){return super.onClose()}async reload(){this.plugin.settings.doAutosaveFiles&&await this.save(!1);let s=this.getViewData();this.cmEditor.setState(this.cLine truncated
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"id": "data-files-editor",
|
||||||
|
"name": "Data Files Editor",
|
||||||
|
"version": "1.4.1",
|
||||||
|
"minAppVersion": "0.15.0",
|
||||||
|
"description": "Plugin to edit data files like txt, xml, json, and yaml",
|
||||||
|
"author": "ZukTol",
|
||||||
|
"authorUrl": "https://github.com/ZukTol",
|
||||||
|
"fundingUrl": "",
|
||||||
|
"isDesktopOnly": false
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
This CSS file will be included with your plugin, and
|
||||||
|
available in the app when your plugin is enabled.
|
||||||
|
|
||||||
|
If your plugin does not need CSS, delete this file.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
.datafile-source-view.mod-cm6 .cm-gutters {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
background-color: transparent;
|
||||||
|
color: var(--text-faint) !important;
|
||||||
|
border-right: none !important;
|
||||||
|
margin-inline-end: var(--file-folding-offset);
|
||||||
|
font-size: var(--font-ui-smaller);
|
||||||
|
z-index: 1;
|
||||||
|
font-variant: tabular-nums;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-gutterElement.cm-activeLineGutter {
|
||||||
|
background-color: #aaeeff44;
|
||||||
|
}
|
||||||
+123
@@ -0,0 +1,123 @@
|
|||||||
|
/*
|
||||||
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||||
|
if you want to view the source, please visit the github repository of this plugin
|
||||||
|
*/
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
var __defProp = Object.defineProperty;
|
||||||
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||||
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||||
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||||
|
var __export = (target, all) => {
|
||||||
|
for (var name in all)
|
||||||
|
__defProp(target, name, { get: all[name], enumerable: true });
|
||||||
|
};
|
||||||
|
var __copyProps = (to, from, except, desc) => {
|
||||||
|
if (from && typeof from === "object" || typeof from === "function") {
|
||||||
|
for (let key of __getOwnPropNames(from))
|
||||||
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||||
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
};
|
||||||
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||||
|
|
||||||
|
// src/main.ts
|
||||||
|
var main_exports = {};
|
||||||
|
__export(main_exports, {
|
||||||
|
default: () => DisableTabsPlugin
|
||||||
|
});
|
||||||
|
module.exports = __toCommonJS(main_exports);
|
||||||
|
var import_obsidian2 = require("obsidian");
|
||||||
|
|
||||||
|
// src/settings.ts
|
||||||
|
var DEFAULT_SETTINGS = {
|
||||||
|
enabled: true,
|
||||||
|
hideMobileNewTabIcon: false
|
||||||
|
};
|
||||||
|
|
||||||
|
// src/utils/tab-enforcer.ts
|
||||||
|
var TabEnforcer = class {
|
||||||
|
constructor(app) {
|
||||||
|
this.app = app;
|
||||||
|
}
|
||||||
|
enforceSingleTab() {
|
||||||
|
const leaves = [];
|
||||||
|
this.app.workspace.iterateRootLeaves((leaf) => {
|
||||||
|
leaves.push(leaf);
|
||||||
|
});
|
||||||
|
if (leaves.length > 1) {
|
||||||
|
let active = leaves[leaves.length - 1];
|
||||||
|
for (const leaf of leaves) {
|
||||||
|
const view = leaf.view;
|
||||||
|
if (view && "containerEl" in view) {
|
||||||
|
const containerEl = view.containerEl;
|
||||||
|
if (containerEl && containerEl.hasClass("is-active")) {
|
||||||
|
active = leaf;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
leaves.forEach((leaf) => {
|
||||||
|
if (leaf !== active) {
|
||||||
|
leaf.detach();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// src/ui/settings-tab.ts
|
||||||
|
var import_obsidian = require("obsidian");
|
||||||
|
var DisableTabsSettingTab = class extends import_obsidian.PluginSettingTab {
|
||||||
|
constructor(app, plugin) {
|
||||||
|
super(app, plugin);
|
||||||
|
this.plugin = plugin;
|
||||||
|
this.settings = plugin.settings;
|
||||||
|
}
|
||||||
|
display() {
|
||||||
|
const { containerEl } = this;
|
||||||
|
containerEl.empty();
|
||||||
|
const generalGroup = new import_obsidian.SettingGroup(containerEl);
|
||||||
|
generalGroup.addSetting((setting) => {
|
||||||
|
setting.setName("Hide mobile tabs icon").setDesc("Hide the tabs icon on mobile devices").addToggle(
|
||||||
|
(toggle) => toggle.setValue(this.settings.hideMobileNewTabIcon).onChange(async (value) => {
|
||||||
|
this.settings.hideMobileNewTabIcon = value;
|
||||||
|
await this.plugin.saveSettings();
|
||||||
|
this.plugin.updateMobileTabIconCSS();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// src/main.ts
|
||||||
|
var DisableTabsPlugin = class extends import_obsidian2.Plugin {
|
||||||
|
async onload() {
|
||||||
|
const loadedData = await this.loadData();
|
||||||
|
this.settings = Object.assign({}, DEFAULT_SETTINGS, loadedData);
|
||||||
|
this.tabEnforcer = new TabEnforcer(this.app);
|
||||||
|
this.updateMobileTabIconCSS();
|
||||||
|
this.registerEvent(this.app.workspace.on("layout-change", () => {
|
||||||
|
this.tabEnforcer.enforceSingleTab();
|
||||||
|
}));
|
||||||
|
this.app.workspace.onLayoutReady(() => {
|
||||||
|
this.tabEnforcer.enforceSingleTab();
|
||||||
|
});
|
||||||
|
this.addSettingTab(new DisableTabsSettingTab(this.app, this));
|
||||||
|
}
|
||||||
|
updateMobileTabIconCSS() {
|
||||||
|
if (this.settings.hideMobileNewTabIcon) {
|
||||||
|
document.body.classList.add("disable-tabs-hide-mobile-icon");
|
||||||
|
} else {
|
||||||
|
document.body.classList.remove("disable-tabs-hide-mobile-icon");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async saveSettings() {
|
||||||
|
await this.saveData(this.settings);
|
||||||
|
}
|
||||||
|
onunload() {
|
||||||
|
document.body.classList.remove("disable-tabs-hide-mobile-icon");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjL21haW4udHMiLCAic3JjL3NldHRpbmdzLnRzIiwgInNyYy91dGlscy90YWItZW5mb3JjZXIudHMiLCAic3JjL3VpL3NldHRpbmdzLXRhYi50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiaW1wb3J0IHsgUGx1Z2luIH0gZnJvbSBcIm9ic2lkaWFuXCI7XG5pbXBvcnQgeyBEaXNhYmxlVGFic1NldHRpbmdzLCBERUZBVUxUX1NFVFRJTkdTIH0gZnJvbSBcIi4vc2V0dGluZ3NcIjtcbmltcG9ydCB7IFRhYkVuZm9yY2VyIH0gZnJvbSBcIi4vdXRpbHMvdGFiLWVuZm9yY2VyXCI7XG5pbXBvcnQgeyBEaXNhYmxlVGFic1NldHRpbmdUYWIgfSBmcm9tIFwiLi91aS9zZXR0aW5ncy10YWJcIjtcblxuZXhwb3J0IGRlZmF1bHQgY2xhc3MgRGlzYWJsZVRhYnNQbHVnaW4gZXh0ZW5kcyBQbHVnaW4ge1xuICBzZXR0aW5ncyE6IERpc2FibGVUYWJzU2V0dGluZ3M7XG4gIHByaXZhdGUgdGFiRW5mb3JjZXIhOiBUYWJFbmZvcmNlcjtcblxuICBhc3luYyBvbmxvYWQoKSB7XG4gICAgLy8gTG9hZCBzZXR0aW5nc1xuICAgIGNvbnN0IGxvYWRlZERhdGEgPSBhd2FpdCB0aGlzLmxvYWREYXRhKCkgYXMgUGFydGlhbDxEaXNhYmxlVGFic1NldHRpbmdzPiB8IG51bGw7XG4gICAgdGhpcy5zZXR0aW5ncyA9IE9iamVjdC5hc3NpZ24oe30sIERFRkFVTFRfU0VUVElOR1MsIGxvYWRlZERhdGEpO1xuICAgIFxuICAgIC8vIEluaXRpYWxpemUgdGFiIGVuZm9yY2VyXG4gICAgdGhpcy50YWJFbmZvcmNlciA9IG5ldyBUYWJFbmZvcmNlcih0aGlzLmFwcCk7XG5cbiAgICAvLyBBcHBseSBtb2JpbGUgdGFiIGljb24gQ1NTIGlmIGVuYWJsZWRcbiAgICB0aGlzLnVwZGF0ZU1vYmlsZVRhYkljb25DU1MoKTtcblxuICAgIC8vIEhvb2sgaW50byB0aGUgd29ya3NwYWNlIHRvIGVuZm9yY2Ugc2luZ2xlIHRhYiBvbiBsYXlvdXQgY2hhbmdlc1xuICAgIHRoaXMucmVnaXN0ZXJFdmVudCh0aGlzLmFwcC53b3Jrc3BhY2Uub24oXCJsYXlvdXQtY2hhbmdlXCIsICgpID0+IHtcbiAgICAgIHRoaXMudGFiRW5mb3JjZXIuZW5mb3JjZVNpbmdsZVRhYigpO1xuICAgIH0pKTtcblxuICAgIC8vIEFsc28gZW5mb3JjZSBvbiBpbml0aWFsIGxheW91dCByZWFkeVxuICAgIHRoaXMuYXBwLndvcmtzcGFjZS5vbkxheW91dFJlYWR5KCgpID0+IHtcbiAgICAgIHRoaXMudGFiRW5mb3JjZXIuZW5mb3JjZVNpbmdsZVRhYigpO1xuICAgIH0pO1xuXG4gICAgLy8gUmVnaXN0ZXIgc2V0dGluZ3MgdGFiXG4gICAgdGhpcy5hZGRTZXR0aW5nVGFiKG5ldyBEaXNhYmxlVGFic1NldHRpbmdUYWIodGhpcy5hcHAsIHRoaXMpKTtcbiAgfVxuXG4gIHVwZGF0ZU1vYmlsZVRhYkljb25DU1MoKTogdm9pZCB7XG4gICAgLy8gVG9nZ2xlIENTUyBjbGFzcyBvbiBib2R5IGVsZW1lbnQgYmFzZWQgb24gc2V0dGluZ1xuICAgIGlmICh0aGlzLnNldHRpbmdzLmhpZGVNb2JpbGVOZXdUYWJJY29uKSB7XG4gICAgICBkb2N1bWVudC5ib2R5LmNsYXNzTGlzdC5hZGQoXCJkaXNhYmxlLXRhYnMtaGlkZS1tb2JpbGUtaWNvblwiKTtcbiAgICB9IGVsc2Uge1xuICAgICAgZG9jdW1lbnQuYm9keS5jbGFzc0xpc3QucmVtb3ZlKFwiZGlzYWJsZS10YWJzLWhpZGUtbW9iaWxlLWljb25cIik7XG4gICAgfVxuICB9XG5cbiAgYXN5bmMgc2F2ZVNldHRpbmdzKCkge1xuICAgIGF3YWl0IHRoaXMuc2F2ZURhdGEodGhpcy5zZXR0aW5ncyk7XG4gIH1cblxuICBvbnVubG9hZCgpOiB2b2lkIHtcbiAgICAvLyBDbGVhbiB1cCBDU1MgY2xhc3NcbiAgICBkb2N1bWVudC5ib2R5LmNsYXNzTGlzdC5yZW1vdmUoXCJkaXNhYmxlLXRhYnMtaGlkZS1tb2JpbGUtaWNvblwiKTtcbiAgfVxufVxuIiwgImV4cG9ydCBpbnRlcmZhY2UgRGlzYWJsZVRhYnNTZXR0aW5ncyB7XG4gIGVuYWJsZWQ6IGJvb2xlYW47XG4gIGhpZGVNb2JpbGVOZXdUYWJJY29uOiBib29sZWFuO1xufVxuXG5leHBvcnQgY29uc3QgREVGQVVMVF9TRVRUSU5HUzogRGlzYWJsZVRhYnNTZXR0aW5ncyA9IHtcbiAgZW5hYmxlZDogdHJ1ZSxcbiAgaGlkZU1vYmlsZU5ld1RhYkljb246IGZhbHNlLFxufTtcbiIsICJpbXBvcnQgeyBBcHAsIFdvcmtzcGFjZUxlYWYgfSBmcm9tIFwib2JzaWRpYW5cIjtcblxuZXhwb3J0IGNsYXNzIFRhYkVuZm9yY2VyIHtcbiAgcHJpdmF0ZSBhcHA6IEFwcDtcblxuICBjb25zdHJ1Y3RvcihhcHA6IEFwcCkge1xuICAgIHRoaXMuYXBwID0gYXBwO1xuICB9XG5cbiAgZW5mb3JjZVNpbmdsZVRhYigpOiB2b2lkIHtcbiAgICBjb25zdCBsZWF2ZXM6IFdvcmtzcGFjZUxlYWZbXSA9IFtdO1xuICAgIHRoaXMuYXBwLndvcmtzcGFjZS5pdGVyYXRlUm9vdExlYXZlcyhsZWFmID0+IHtcbiAgICAgIGxlYXZlcy5wdXNoKGxlYWYpO1xuICAgIH0pO1xuXG4gICAgaWYgKGxlYXZlcy5sZW5ndGggPiAxKSB7XG4gICAgICAvLyBGaW5kIHRoZSBhY3RpdmUgbGVhZiAodGhlIG9uZSB0aGF0IGp1c3Qgb3BlbmVkIG9yIGlzIGN1cnJlbnRseSBhY3RpdmUpXG4gICAgICAvLyBQcmVmZXIgdGhlIGxhc3QgbGVhZiBhcyBpdCdzIG1vc3QgbGlrZWx5IHRoZSBuZXdseSBvcGVuZWQgb25lXG4gICAgICBsZXQgYWN0aXZlOiBXb3Jrc3BhY2VMZWFmIHwgbnVsbCA9IGxlYXZlc1tsZWF2ZXMubGVuZ3RoIC0gMV07XG4gICAgICBcbiAgICAgIC8vIFZlcmlmeSBpdCdzIGFjdHVhbGx5IGFjdGl2ZSBieSBjaGVja2luZyBmb3IgdGhlIGlzLWFjdGl2ZSBjbGFzc1xuICAgICAgZm9yIChjb25zdCBsZWFmIG9mIGxlYXZlcykge1xuICAgICAgICBjb25zdCB2aWV3ID0gbGVhZi52aWV3O1xuICAgICAgICBpZiAodmlldyAmJiAnY29udGFpbmVyRWwnIGluIHZpZXcpIHtcbiAgICAgICAgICBjb25zdCBjb250YWluZXJFbCA9ICh2aWV3IGFzIHsgY29udGFpbmVyRWw6IEhUTUxFbGVtZW50IH0pLmNvbnRhaW5lckVsO1xuICAgICAgICAgIGlmIChjb250YWluZXJFbCAmJiBjb250YWluZXJFbC5oYXNDbGFzcygnaXMtYWN0aXZlJykpIHtcbiAgICAgICAgICAgIGFjdGl2ZSA9IGxlYWY7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgLy8gQ2xvc2UgYWxsIG90aGVyIHRhYnMgdG8gcmVwbGFjZSB0aGUgY3VycmVudCB0YWIgc21vb3RobHlcbiAgICAgIGxlYXZlcy5mb3JFYWNoKGxlYWYgPT4ge1xuICAgICAgICBpZiAobGVhZiAhPT0gYWN0aXZlKSB7XG4gICAgICAgICAgbGVhZi5kZXRhY2goKTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfVxuICB9XG59XG4iLCAiaW1wb3J0IHsgQXBwLCBQbHVnaW5TZXR0aW5nVGFiICwgU2V0dGluZ0dyb3VwfSBmcm9tIFwib2JzaWRpYW5cIjtcclxuaW1wb3J0IERpc2FibGVUYWJzUGx1Z2luIGZyb20gXCIuLi9tYWluXCI7XHJcbmltcG9ydCB7IERpc2FibGVUYWJzU2V0dGluZ3MgfSBmcm9tIFwiLi4vc2V0dGluZ3NcIjtcclxuXHJcblxyXG5leHBvcnQgY2xhc3MgRGlzYWJsZVRhYnNTZXR0aW5nVGFiIGV4dGVuZHMgUGx1Z2luU2V0dGluZ1RhYiB7XHJcbiAgcGx1Z2luOiBEaXNhYmxlVGFic1BsdWdpbjtcclxuICBzZXR0aW5nczogRGlzYWJsZVRhYnNTZXR0aW5ncztcclxuXHJcbiAgY29uc3RydWN0b3IoYXBwOiBBcHAsIHBsdWdpbjogRGlzYWJsZVRhYnNQbHVnaW4pIHtcclxuICAgIHN1cGVyKGFwcCwgcGx1Z2luKTtcclxuICAgIHRoaXMucGx1Z2luID0gcGx1Z2luO1xyXG4gICAgdGhpcy5zZXR0aW5ncyA9IHBsd
Line truncated
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"id":"disable-tabs","name":"Disable Tabs","version":"1.0.10","minAppVersion":"1.11.0","description":"Disables having more than one tab open at a time.","author":"David V. Kimball","authorUrl":"https://davidvkimball.com","fundingUrl":"https://patreon.com/davidvkimball","isDesktopOnly":false}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
/* Hide mobile new tab icon when the plugin setting is enabled */
|
||||||
|
body.disable-tabs-hide-mobile-icon .mobile-navbar-action-tabs {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Scoped to only this plugin's settings container to avoid affecting other plugins */
|
||||||
@@ -0,0 +1,441 @@
|
|||||||
|
{
|
||||||
|
"lastVersion": "3.2.7",
|
||||||
|
"aestheticStyle": "glass",
|
||||||
|
"positionStyle": "top",
|
||||||
|
"menuCommands": [
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:editor-undo",
|
||||||
|
"name": "Undo editor",
|
||||||
|
"icon": "undo-glyph"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:editor-redo",
|
||||||
|
"name": "Redo editor",
|
||||||
|
"icon": "redo-glyph"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "SubmenuCommands-header",
|
||||||
|
"name": "submenu",
|
||||||
|
"icon": "heading-glyph",
|
||||||
|
"SubmenuCommands": [
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:header2-text",
|
||||||
|
"name": "Header 2",
|
||||||
|
"icon": "header-2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:header3-text",
|
||||||
|
"name": "Header 3",
|
||||||
|
"icon": "header-3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:header4-text",
|
||||||
|
"name": "Header 4",
|
||||||
|
"icon": "header-4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:header5-text",
|
||||||
|
"name": "Header 5",
|
||||||
|
"icon": "header-5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:header6-text",
|
||||||
|
"name": "Header 6",
|
||||||
|
"icon": "header-6"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:toggle-bold",
|
||||||
|
"name": "Bold",
|
||||||
|
"icon": "bold-glyph"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:toggle-italics",
|
||||||
|
"name": "Italics",
|
||||||
|
"icon": "italic-glyph"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:toggle-strikethrough",
|
||||||
|
"name": "Strikethrough",
|
||||||
|
"icon": "strikethrough-glyph"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:underline",
|
||||||
|
"name": "Underline",
|
||||||
|
"icon": "underline-glyph"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:toggle-highlight",
|
||||||
|
"name": "==Highlight==",
|
||||||
|
"icon": "highlight-glyph"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:toggle-format-brush",
|
||||||
|
"name": "Format Painter",
|
||||||
|
"icon": "paintbrush"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:format-eraser",
|
||||||
|
"name": "Clear text formatting",
|
||||||
|
"icon": "eraser"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:editor:swap-line-down",
|
||||||
|
"name": "Swap line down",
|
||||||
|
"icon": "lucide-corner-right-down"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "SubmenuCommands-text-tools",
|
||||||
|
"name": "Text Tools",
|
||||||
|
"icon": "box",
|
||||||
|
"menuType": "dropdown",
|
||||||
|
"SubmenuCommands": [
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:get-plain-text",
|
||||||
|
"name": "Get Plain Text",
|
||||||
|
"icon": "lucide-file-text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:smart-symbols",
|
||||||
|
"name": "Full Half Converter",
|
||||||
|
"icon": "lucide-at-sign"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editingToolbar-Divider-Line",
|
||||||
|
"name": "Line Operations",
|
||||||
|
"icon": "vertical-split"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:insert-blank-lines",
|
||||||
|
"name": "Insert Blank Lines",
|
||||||
|
"icon": "lucide-space"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:remove-blank-lines",
|
||||||
|
"name": "Remove Blank Lines",
|
||||||
|
"icon": "lucide-minimize-2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:split-lines",
|
||||||
|
"name": "Split Lines",
|
||||||
|
"icon": "lucide-split"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:merge-lines",
|
||||||
|
"name": "Merge Lines",
|
||||||
|
"icon": "lucide-merge"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:dedupe-lines",
|
||||||
|
"name": "Dedupe Lines",
|
||||||
|
"icon": "lucide-filter"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editingToolbar-Divider-Line",
|
||||||
|
"name": "Text Processing",
|
||||||
|
"icon": "vertical-split"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:add-wrap",
|
||||||
|
"name": "Add Prefix/Suffix",
|
||||||
|
"icon": "lucide-wrap-text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:number-lines",
|
||||||
|
"name": "Number Lines (Custom)",
|
||||||
|
"icon": "lucide-list-ordered"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:remove-whitespace-trim",
|
||||||
|
"name": "Trim Line Ends",
|
||||||
|
"icon": "lucide-scissors"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:remove-whitespace-compress",
|
||||||
|
"name": "Shrink Extra Spaces",
|
||||||
|
"icon": "lucide-minimize"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:remove-whitespace-all",
|
||||||
|
"name": "Remove All Whitespace",
|
||||||
|
"icon": "lucide-eraser"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editingToolbar-Divider-Line",
|
||||||
|
"name": "Advanced Tools",
|
||||||
|
"icon": "vertical-split"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:list-to-table",
|
||||||
|
"name": "List to Table",
|
||||||
|
"icon": "lucide-table"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:table-to-list",
|
||||||
|
"name": "Table to List",
|
||||||
|
"icon": "lucide-list"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:extract-between",
|
||||||
|
"name": "Extract Between Strings",
|
||||||
|
"icon": "lucide-brackets"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:editor:swap-line-up",
|
||||||
|
"name": "Swap line up",
|
||||||
|
"icon": "lucide-corner-right-up"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:editor:attach-file",
|
||||||
|
"name": "Attach file",
|
||||||
|
"icon": "lucide-paperclip"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:editor:insert-table",
|
||||||
|
"name": "Insert Table",
|
||||||
|
"icon": "lucide-table"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:editor:toggle-blockquote",
|
||||||
|
"name": "Blockquote",
|
||||||
|
"icon": "quote"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:insert-callout",
|
||||||
|
"name": "Insert Callout ",
|
||||||
|
"icon": "alert-triangle"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "SubmenuCommands-list",
|
||||||
|
"name": "submenu-list",
|
||||||
|
"icon": "bullet-list-glyph",
|
||||||
|
"SubmenuCommands": [
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:toggle-bullet-list",
|
||||||
|
"name": "Bullet list",
|
||||||
|
"icon": "<svg width=\"18\" height=\"18\" focusable=\"false\" fill=\"currentColor\" viewBox=\"0 0 1024 1024\"><g transform=\"scale(1, -1) translate(0, -896) scale(0.9, 0.9) \"><path class=\"path\" d=\"M860 424 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-477 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l477 0 ZM860 756 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-477 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l477 0 ZM860 92 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-477 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l477 0 ZM176 716 l0 0 ZM112 716 q0 -27 18.5 -45.5 q18.5 -18.5 45.5 -18.5 q27 0 45.5 18.5 q18.5 18.5 18.5 45.5 q0 27 -18.5 45.5 q-18.5 18.5 -45.5 18.5 q-27 0 -45.5 -18.5 q-18.5 -18.5 -18.5 -45.5 ZM176 384 l0 0 ZM112 384 q0 -27 18.5 -45.5 q18.5 -18.5 45.5 -18.5 q27 0 45.5 18.5 q18.5 18.5 18.5 45.5 q0 27 -18.5 45.5 q-18.5 18.5 -45.5 18.5 q-27 0 -45.5 -18.5 q-18.5 -18.5 -18.5 -45.5 ZM176 52 l0 0 ZM112 52 q0 -27 18.5 -45.5 q18.5 -18.5 45.5 -18.5 q27 0 45.5 18.5 q18.5 18.5 18.5 45.5 q0 27 -18.5 45.5 q-18.5 18.5 -45.5 18.5 q-27 0 -45.5 -18.5 q-18.5 -18.5 -18.5 -45.5 Z\"></path></g></svg>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:toggle-numbered-list",
|
||||||
|
"name": "Numbered list",
|
||||||
|
"icon": "<svg width=\"18\" height=\"18\" focusable=\"false\" fill=\"currentColor\" viewBox=\"0 0 1024 1024\"><g transform=\"scale(1, -1) translate(0, -896) scale(0.9, 0.9) \"><path class=\"path\" d=\"M860 424 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-457 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l457 0 ZM860 756 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-457 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l457 0 ZM860 92 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-457 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l457 0 ZM264 136 l-3 -3 l-51 -57 l56 0 q14 0 24.5 -10 q10.5 -10 11.5 -25 l0 -1 q0 -15 -10.5 -25.5 q-10.5 -10.5 -24.5 -10.5 l-137 0 q-15 0 -25 10 q-10 10 -11 24.5 q-1 14.5 9 25.5 l63 70 l49 54 q7 7 7 16.5 q0 9.5 -7.5 16.5 q-7.5 7 -18.5 7 q-11 0 -18.5 -6.5 q-7.5 -6.5 -8.5 -16.5 l0 0 q0 -15 -10.5 -25.5 q-10.5 -10.5 -25.5 -10.5 q-15 0 -25.5 10.5 q-10.5 10.5 -10.5 25.5 q0 26 13.5 47.5 q13.5 21.5 36 34.5 q22.5 13 49 13 q26.5 0 49.5 -13 q23 -13 36 -34.5 q13 -21.5 13 -47.5 q0 -20 -7.5 -37.5 q-7.5 -17.5 -21.5 -30.5 l-1 -1 ZM173 794 q11 11 25 10.5 q14 -0.5 24.5 -10.5 q10.5 -10 10.5 -25 l0 -293 q0 -15 -10 -25.5 q-10 -10.5 -25 -10.5 q-15 0 -25.5 10 q-10.5 10 -11.5 25 l0 211 q-10 -8 -23.5 -7 q-13.5 1 -22.5 11 l-1 0 q-10 11 -9.5 25.5 q0.5 14.5 10.5 24.5 l58 54 Z\"></path></g></svg>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:editor:toggle-checklist-status",
|
||||||
|
"name": "Checklist",
|
||||||
|
"icon": "checkbox-glyph"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:undent-list",
|
||||||
|
"name": "Unindent-list",
|
||||||
|
"icon": "<svg width=\"18\" height=\"18\" focusable=\"false\" fill=\"currentColor\" viewBox=\"0 0 1024 1024\"><g transform=\"scale(1, -1) translate(0, -896) scale(0.9, 0.9) \"><path class=\"path\" d=\"M872 302 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-429 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l429 0 ZM872 542 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-429 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l429 0 ZM872 784 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-721 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l721 0 ZM872 62 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-721 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l721 0 ZM244 534 l-123 -122 q-8 -7 -8 -18 q0 -11 8 -18 l123 -122 q8 -7 19 -7 q11 0 18.5 7.5 q7.5 7.5 7.5 18.5 l0 242 q0 11 -7.5 18.5 q-7.5 7.5 -18.5 7.5 q-11 0 -19 -7 Z\"></path></g></svg>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:indent-list",
|
||||||
|
"name": "Indent list",
|
||||||
|
"icon": "<svg width=\"18\" height=\"18\" focusable=\"false\" fill=\"currentColor\" viewBox=\"0 0 1024 1024\"><g transform=\"scale(1, -1) translate(0, -896) scale(0.9, 0.9) \"><path class=\"path\" d=\"M872 302 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-429 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l429 0 ZM872 542 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-429 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l429 0 ZM872 784 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-721 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l721 0 ZM872 62 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-721 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l721 0 ZM158 534 l124 -122 q7 -7 7 -18 q0 -11 -7 -18 l-124 -122 q-7 -7 -18 -7 q-11 0 -19 7.5 q-8 7.5 -8 18.5 l0 242 q0 11 8 18.5 q8 7.5 19 7.5 q11 0 18 -7 Z\"></path></g></svg>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:renumber-ordered-list",
|
||||||
|
"name": "Reorder numbered list",
|
||||||
|
"icon": "list-restart"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "SubmenuCommands-mdcmder",
|
||||||
|
"name": "submenu",
|
||||||
|
"icon": "<svg width=\"18\" height=\"18\" focusable=\"false\" fill=\"currentColor\" viewBox=\"0 0 1024 1024\"><g transform=\"scale(1, -1) translate(0, -896) scale(0.9, 0.9) \"><path class=\"path\" d=\"M464 608 l0 -568 q0 -3 -2.5 -5.5 q-2.5 -2.5 -5.5 -2.5 l-80 0 q-3 0 -5.5 2.5 q-2.5 2.5 -2.5 5.5 l0 568 l-232 0 q-3 0 -5.5 2.5 q-2.5 2.5 -2.5 5.5 l0 80 q0 3 2.5 5.5 q2.5 2.5 5.5 2.5 l560 0 q3 0 5.5 -2.5 q2.5 -2.5 2.5 -5.5 l0 -80 q0 -3 -2.5 -5.5 q-2.5 -2.5 -5.5 -2.5 l-232 0 ZM864 696 q17 0 28.5 11.5 q11.5 11.5 11.5 28.5 q0 17 -11.5 28.5 q-11.5 11.5 -28.5 11.5 q-17 0 -28.5 -11.5 q-11.5 -11.5 -11.5 -28.5 q0 -17 11.5 -28.5 q11.5 -11.5 28.5 -11.5 ZM864 640 q-40 0 -68 28 q-28 28 -28 68 q0 40 28 68 q28 28 68 28 q40 0 68 -28 q28 -28 28 -68 q0 -40 -28 -68 q-28 -28 -68 -28 ZM576 322 l0 -63 q0 -3 2 -5 l89 -70 l-89 -70 q-2 -2 -2 -5 l0 -63 q0 -4 3.5 -5.5 q3.5 -1.5 6.5 0.5 l170 133 q4 3 4.5 8.5 q0.5 5.5 -2.5 9.5 l-2 2 l-170 133 q-3 2 -6.5 0.5 q-3.5 -1.5 -3.5 -5.5 ZM256 322 l0 -63 q0 -3 -2 -5 l-89 -70 l89 -70 q2 -2 2 -5 l0 -63 q0 -4 -3.5 -5.5 q-3.5 -1.5 -6.5 0.5 l-170 133 q-4 3 -4.5 8.5 q-0.5 5.5 2.5 9.5 l2 2 l170 133 q3 2 6.5 0.5 q3.5 -1.5 3.5 -5.5 Z\"></path></g></svg>",
|
||||||
|
"SubmenuCommands": [
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:editor:toggle-code",
|
||||||
|
"name": "Inline code",
|
||||||
|
"icon": "code-glyph"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:codeblock",
|
||||||
|
"name": "Code block",
|
||||||
|
"icon": "codeblock-glyph"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:editor:insert-wikilink",
|
||||||
|
"name": "Insert wikilink [[]]",
|
||||||
|
"icon": "<svg width=\"15\" height=\"15\" focusable=\"false\" fill=\"currentColor\" viewBox=\"0 0 1024 1024\"><g transform=\"scale(1, -1) translate(0, -896) scale(0.9, 0.9) \"><path class=\"path\" d=\"M306 134 l91 0 q1 0 1 -8 l0 -80 q0 -8 -1 -8 l-91 0 q-1 0 -1 7 q0 -8 -5 -8 l-45 0 q-5 0 -5 8 l0 784 q0 8 5 8 l45 0 q5 0 5 -8 q0 8 1 8 l91 0 q1 0 1 -8 l0 -80 q0 -8 -1 -8 l-91 0 q-1 0 -1 8 l0 -623 q0 8 1 8 ZM139 134 l91 0 q1 0 1 -8 l0 -80 q0 -8 -1 -8 l-91 0 q-1 0 -1 7 q0 -8 -5 -8 l-45 0 q-5 0 -5 8 l0 784 q0 8 5 8 l45 0 q5 0 5 -8 q0 8 1 8 l91 0 q1 0 1 -8 l0 -80 q0 -8 -1 -8 l-91 0 q-1 0 -1 8 l0 -623 q0 8 1 8 ZM711 134 q1 0 1 -8 l0 623 q0 -8 -1 -8 l-91 0 q-1 0 -1 8 l0 80 q0 8 1 8 l91 0 q1 0 1 -8 q0 8 4 8 l46 0 q4 0 4 -8 l0 -784 q0 -8 -4 -8 l-46 0 q-4 0 -4 8 q0 -7 -1 -7 l-91 0 q-1 0 -1 8 l0 80 q0 8 1 8 l91 0 ZM878 134 q1 0 1 -8 l0 623 q0 -8 -1 -8 l-91 0 q-1 0 -1 8 l0 80 q0 8 1 8 l91 0 q1 0 1 -8 q0 8 5 8 l45 0 q4 0 4 -8 l0 -784 q0 -8 -4 -8 l-45 0 q-5 0 -5 8 q0 -7 -1 -7 l-91 0 q-1 0 -1 8 l0 80 q0 8 1 8 l91 0 Z\"></path></g></svg>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:editor:insert-embed",
|
||||||
|
"name": "Insert embed ![[]]",
|
||||||
|
"icon": "note-glyph"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:insert-link",
|
||||||
|
"name": "Insert link []()",
|
||||||
|
"icon": "link-glyph"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:hrline",
|
||||||
|
"name": "Horizontal divider",
|
||||||
|
"icon": "<svg width=\"18\" height=\"18\" focusable=\"false\" fill=\"currentColor\" viewBox=\"0 0 1024 1024\"><g transform=\"scale(1, -1) translate(0, -896) scale(0.9, 0.9) \"><path class=\"path\" d=\"M912 424 l0 -80 q0 -3 -2.5 -5.5 q-2.5 -2.5 -5.5 -2.5 l-784 0 q-3 0 -5.5 2.5 q-2.5 2.5 -2.5 5.5 l0 80 q0 3 2.5 5.5 q2.5 2.5 5.5 2.5 l784 0 q3 0 5.5 -2.5 q2.5 -2.5 2.5 -5.5 Z\"></path></g></svg>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:custom-summary",
|
||||||
|
"name": "Summary",
|
||||||
|
"icon": "chat-bubbles-filled"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:custom-small",
|
||||||
|
"name": "Small text",
|
||||||
|
"icon": "header-n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:superscript",
|
||||||
|
"name": "Superscript",
|
||||||
|
"icon": "superscript-glyph"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:subscript",
|
||||||
|
"name": "Subscript",
|
||||||
|
"icon": "subscript-glyph"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:toggle-inline-math",
|
||||||
|
"name": "Inline math",
|
||||||
|
"icon": "lucide-sigma"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:editor:insert-mathblock",
|
||||||
|
"name": "MathBlock",
|
||||||
|
"icon": "lucide-sigma-square"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "SubmenuCommands-aligin",
|
||||||
|
"name": "submenu-aligin",
|
||||||
|
"icon": "align-left",
|
||||||
|
"SubmenuCommands": [
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:left",
|
||||||
|
"name": "<p aligin=\"left\"></p>",
|
||||||
|
"icon": "align-left"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:center",
|
||||||
|
"name": "<center>",
|
||||||
|
"icon": "align-center"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:right",
|
||||||
|
"name": "<p aligin=\"right\"></p>",
|
||||||
|
"icon": "align-right"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:justify",
|
||||||
|
"name": "<p aligin=\"justify\"></p>",
|
||||||
|
"icon": "align-justify"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "editing-toolbar:change-font-color",
|
||||||
|
"name": "Change font color[html]",
|
||||||
|
"icon": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" focusable=\"false\" fill=\"currentColor\"><g fill-rule=\"evenodd\"><path id=\"change-font-color-icon\" d=\"M3 18h18v3H3z\" style=\"fill:#2DC26B\"></path><path d=\"M8.7 16h-.8a.5.5 0 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z\"></path></g></svg>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "zenmode:toggle-zen-mode",
|
||||||
|
"name": "Zen Mode: Toggle",
|
||||||
|
"icon": "expand"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"followingCommands": [],
|
||||||
|
"topCommands": [],
|
||||||
|
"fixedCommands": [],
|
||||||
|
"mobileCommands": [],
|
||||||
|
"enableMultipleConfig": false,
|
||||||
|
"enableTopToolbar": true,
|
||||||
|
"enableFollowingToolbar": false,
|
||||||
|
"enableFixedToolbar": false,
|
||||||
|
"appendMethod": "workspace",
|
||||||
|
"shouldShowMenuOnSelect": false,
|
||||||
|
"cMenuVisibility": false,
|
||||||
|
"cMenuBottomValue": 4.25,
|
||||||
|
"cMenuNumRows": 12,
|
||||||
|
"cMenuWidth": 610,
|
||||||
|
"cMenuFontColor": "#2DC26B",
|
||||||
|
"cMenuBackgroundColor": "#d3f8b6",
|
||||||
|
"autohide": false,
|
||||||
|
"Iscentered": false,
|
||||||
|
"custom_bg1": "#FFB78B8C",
|
||||||
|
"custom_bg2": "#CDF4698C",
|
||||||
|
"custom_bg3": "#A0CCF68C",
|
||||||
|
"custom_bg4": "#F0A7D88C",
|
||||||
|
"custom_bg5": "#ADEFEF8C",
|
||||||
|
"custom_fc1": "#D83931",
|
||||||
|
"custom_fc2": "#DE7802",
|
||||||
|
"custom_fc3": "#245BDB",
|
||||||
|
"custom_fc4": "#6425D0",
|
||||||
|
"custom_fc5": "#646A73",
|
||||||
|
"isLoadOnMobile": false,
|
||||||
|
"horizontalPosition": 0,
|
||||||
|
"verticalPosition": 0,
|
||||||
|
"formatBrushes": {},
|
||||||
|
"customCommands": [
|
||||||
|
{
|
||||||
|
"id": "custom-summary",
|
||||||
|
"name": "Summary",
|
||||||
|
"prefix": "<details> \n<summary>",
|
||||||
|
"suffix": "</summary> \nInclude details here.\n</details>",
|
||||||
|
"char": 0,
|
||||||
|
"line": 0,
|
||||||
|
"islinehead": false,
|
||||||
|
"icon": "chat-bubbles-filled"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "custom-small",
|
||||||
|
"name": "Small text",
|
||||||
|
"prefix": "<small>",
|
||||||
|
"suffix": "</small>",
|
||||||
|
"char": 0,
|
||||||
|
"line": 0,
|
||||||
|
"islinehead": false,
|
||||||
|
"icon": "header-n"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"viewTypeSettings": {
|
||||||
|
"bases": false
|
||||||
|
},
|
||||||
|
"appearanceByStyle": {
|
||||||
|
"top": {
|
||||||
|
"toolbarBackgroundColor": "rgba(var(--background-secondary-rgb), 0.7)",
|
||||||
|
"toolbarIconColor": "var(--text-normal)",
|
||||||
|
"toolbarIconSize": 18,
|
||||||
|
"aestheticStyle": "glass"
|
||||||
|
},
|
||||||
|
"following": {
|
||||||
|
"toolbarBackgroundColor": "rgba(var(--background-secondary-rgb), 0.7)",
|
||||||
|
"toolbarIconColor": "var(--text-normal)",
|
||||||
|
"toolbarIconSize": 18,
|
||||||
|
"aestheticStyle": "default"
|
||||||
|
},
|
||||||
|
"fixed": {
|
||||||
|
"toolbarBackgroundColor": "rgba(var(--background-secondary-rgb), 0.7)",
|
||||||
|
"toolbarIconColor": "var(--text-normal)",
|
||||||
|
"toolbarIconSize": 18,
|
||||||
|
"aestheticStyle": "default"
|
||||||
|
},
|
||||||
|
"mobile": {
|
||||||
|
"toolbarBackgroundColor": "rgba(var(--background-secondary-rgb), 0.7)",
|
||||||
|
"toolbarIconColor": "var(--text-normal)",
|
||||||
|
"toolbarIconSize": 18,
|
||||||
|
"aestheticStyle": "default"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"toolbarBackgroundColor": "rgba(var(--background-secondary-rgb), 0.7)",
|
||||||
|
"toolbarIconColor": "var(--text-normal)",
|
||||||
|
"toolbarIconSize": 18,
|
||||||
|
"useCurrentLineForRegex": false,
|
||||||
|
"commandIdsFixed": true
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
"use strict";var e=require("obsidian");const t=["Custom","editingToolbar","editingToolbarSub","editingToolbarAdd","editingToolbarDelete","editingToolbarReload","codeblock-glyph","underline-glyph","superscript-glyph","subscript-glyph","bot-glyph","header-1","header-2","header-3","header-4","header-5","header-6","header-n","obsidian","obsidian-new","accessibility","activity","air-vent","airplay","alarm-check","alarm-clock-off","alarm-clock","alarm-minus","alarm-plus","album","alert-circle","alert-octagon","alert-triangle","align-center-horizontal","align-center-vertical","align-center","align-end-horizontal","align-end-vertical","align-horizontal-distribute-center","align-horizontal-distribute-end","align-horizontal-distribute-start","align-horizontal-justify-center","align-horizontal-justify-end","align-horizontal-justify-start","align-horizontal-space-around","align-horizontal-space-between","align-justify","align-left","align-right","align-start-horizontal","align-start-vertical","align-vertical-distribute-center","align-vertical-distribute-end","align-vertical-distribute-start","align-vertical-justify-center","align-vertical-justify-end","align-vertical-justify-start","align-vertical-space-around","align-vertical-space-between","anchor","angry","annoyed","aperture","apple","archive-restore","archive","armchair","arrow-big-down","arrow-big-left","arrow-big-right","arrow-big-up","arrow-down-circle","arrow-down-left","arrow-down-right","arrow-down","arrow-left-circle","arrow-left-right","arrow-left","arrow-right-circle","arrow-right","arrow-up-circle","arrow-up-left","arrow-up-right","arrow-up","asterisk","at-sign","award","axe","axis-3d","baby","backpack","baggage-claim","banana","banknote","bar-chart-2","bar-chart-3","bar-chart-4","bar-chart-horizontal","bar-chart","baseline","bath","battery-charging","battery-full","battery-low","battery-medium","battery","beaker","bed-double","bed-single","bed","beer","bell-minus","bell-off","bell-plus","bell-ring","bell","bike","binary","bitcoin","bluetooth-connected","bluetooth-off","bluetooth-searching","bluetooth","bold","bomb","bone","book-open","book","bookmark-minus","bookmark-plus","bookmark","bot","box-select","box","boxes","briefcase","brush","bug","building-2","building","bus","cake","calculator","calendar-check-2","calendar-check","calendar-clock","calendar-days","calendar-heart","calendar-minus","calendar-off","calendar-plus","calendar-range","calendar-search","calendar-x2","calendar-x","calendar","camera-off","camera","car","carrot","cast","check-circle-2","check-circle","check-square","check","chef-hat","cherry","chevron-down","chevron-first","chevron-last","chevron-left","chevron-right","chevron-up","chevrons-down-up","chevrons-down","chevrons-left-right","chevrons-left","chevrons-right-left","chevrons-right","chevrons-up-down","chevrons-up","chrome","cigarette-off","cigarette","circle-dot","circle-ellipsis","circle-slashed","circle","citrus","clapperboard","clipboard-check","clipboard-copy","clipboard-edit","clipboard-list","clipboard-signature","clipboard-type","clipboard-x","clipboard","clock-1","clock-10","clock-11","clock-12","clock-2","clock-3","clock-4","clock-5","clock-6","clock-7","clock-8","clock-9","clock","cloud-cog","cloud-drizzle","cloud-fog","cloud-hail","cloud-lightning","cloud-moon-rain","cloud-moon","cloud-off","cloud-rain-wind","cloud-rain","cloud-snow","cloud-sun-rain","cloud-sun","cloud","cloudy","clover","code-2","code","codepen","codesandbox","coffee","cog","coins","columns","command","compass","component","contact","contrast","cookie","copy","copyleft","copyright","corner-down-left","corner-down-right","corner-left-down","corner-left-up","corner-right-down","corner-right-up","corner-up-left","corner-up-right","cpu","credit-card","croissant","crop","cross","crosshair","crown","cup-soda","curly-braces","currency","database","delete","diamond","dice-1","dice-2","dice-3","dice-4","dice-5","dice-6","dices","diff","disc","divide-circle","divide-square","divide","dollar-sign","download-cloud","download","dribbble","droplet","droplets","drumstick","edit-2","edit-3","edit","egg-fried","egg","equal-not","equal","eraser","euro","expand","external-link","eye-off","eye","facebook","factory","fast-forward","feather","figma","file-archive","file-audio-2","file-audio","file-axis-3d","file-badge-2","file-badge","file-bar-chart-2","file-bar-chart","file-box","file-check-2","file-check","file-clock","file-code","file-cog-2","file-cog","file-diff","file-digit","file-down","file-edit","file-heart","file-image","file-input","file-json-2","file-json","file-key-2","file-key","file-line-chart","file-lock-2","file-lock","file-minus-2","file-minus","file-output","file-pie-chart","file-plus-2","file-plus","file-question","file-scan","file-search-2","file-search","file-signature","file-spreadsheet","file-symlink","file-terminal","file-text","file-type-2","file-type","file-up","file-video-2","file-video","file-volume-2","file-volume","file-warning","file-x2","Line truncated
|
||||||
|
/**!
|
||||||
|
* Sortable 1.15.6
|
||||||
|
* @author RubaXa <trash@rubaxa.org>
|
||||||
|
* @author owenm <owen23355@gmail.com>
|
||||||
|
* @license MIT
|
||||||
|
*/(n.cMenuFontColor,n.cMenuBackgroundColor)}}()}function ka(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,o)}return i}function Sa(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ka(Object(i),!0).forEach(function(t){Ea(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ka(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function Ta(e){return Ta="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ta(e)}function Ea(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Ma(){return Ma=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},Ma.apply(this,arguments)}function Aa(e,t){if(null==e)return{};var i,o,n=function(e,t){if(null==e)return{};var i,o,n={},s=Object.keys(e);for(o=0;o<s.length;o++)i=s[o],t.indexOf(i)>=0||(n[i]=e[i]);return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)i=s[o],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function Ia(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var Da=Ia(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Oa=Ia(/Edge/i),Ba=Ia(/firefox/i),La=Ia(/safari/i)&&!Ia(/chrome/i)&&!Ia(/android/i),Pa=Ia(/iP(ad|od|hone)/i),Na=Ia(/chrome/i)&&Ia(/android/i),Ra={capture:!1,passive:!1};function Fa(e,t,i){e.addEventListener(t,i,!Da&&Ra)}function qa(e,t,i){e.removeEventListener(t,i,!Da&&Ra)}function _a(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function za(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Va(e,t,i,o){if(e){i=i||document;do{if(null!=t&&(">"===t[0]?e.parentNode===i&&_a(e,t):_a(e,t))||o&&e===i)return e;if(e===i)break}while(e=za(e))}return null}var Wa,Ha=/\s+/g;function $a(e,t,i){if(e&&t)if(e.classList)e.classList[i?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(Ha," ").replace(" "+t+" "," ");e.className=(o+(i?" "+t:"")).replace(Ha," ")}}function Ua(e,t,i){var o=e&&e.style;if(o){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(i=e.currentStyle),void 0===t?i:i[t];t in o||-1!==t.indexOf("webkit")||(t="-webkit-"+t),o[t]=i+("string"==typeof i?"":"px")}}function ja(e,t){var i="";if("string"==typeof e)i=e;else do{var o=Ua(e,"transform");o&&"none"!==o&&(i=o+" "+i)}while(!t&&(e=e.parentNode));var n=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return n&&new n(i)}function Ya(e,t,i){if(e){var o=e.getElementsByTagName(t),n=0,s=o.length;if(i)for(;n<s;n++)i(o[n],n);return o}return[]}function Ga(){var e=document.scrollingElement;return e||document.documentElement}function Za(e,t,i,o,n){if(e.getBoundingClientRect||e===window){var s,r,a,l,c,d,h;if(e!==window&&e.parentNode&&e!==Ga()?(r=(s=e.getBoundingClientRect()).top,a=s.left,l=s.bottom,c=s.right,d=s.height,h=s.width):(r=0,a=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,h=window.innerWidth),(t||i)&&e!==window&&(n=n||e.parentNode,!Da))do{if(n&&n.getBoundingClientRect&&("none"!==Ua(n,"transform")||i&&"static"!==Ua(n,"position"))){var u=n.getBoundingClientRect();r-=u.top+parseInt(Ua(n,"border-top-width")),a-=u.left+parseInt(Ua(n,"border-left-width")),l=r+s.height,c=a+s.width;break}}while(n=n.parentNode);if(o&&e!==window){var p=ja(n||e),m=p&&p.a,g=p&&p.d;p&&(l=(r/=g)+(d/=g),c=(a/=m)+(h/=m))}return{top:r,left:a,bottom:l,right:c,width:h,height:d}}}function Ka(e,t,i){for(var o=tl(e,!0),n=Za(e)[t];o;){var s=Za(o)[i];if(!("top"===i||"left"===i?n>=s:n<=s))return o;if(o===Ga())break;o=tl(o,!1)}return!1}function Ja(e,t,i,o){for(var n=0,s=0,r=e.children;s<r.length;){if("none"!==r[s].style.display&&r[s]!==sc.ghost&&(o||r[s]!==sc.dragged)&&Va(r[s],i.draggable,e,!1)){if(n===t)return r[s];n++}s++}return null}function Xa(e,t){for(var i=e.lastElementChild;i&&(i===sc.ghost||"none"===Ua(i,"display")||t&&!_a(i,t));)i=i.previousElementSibling;return i||null}function Qa(e,t){var i=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===sc.clone||t&&!_a(e,t)||i++;return i}function el(e){var t=0,i=0,o=Ga();if(e)do{var n=ja(e),s=n.a,r=n.d;t+=e.scrollLeft*s,i+=e.scrollTop*r}while(e!==o&&(e=e.parenLine truncated
|
||||||
|
/*! Pickr 1.8.4 MIT | https://github.com/Simonwep/pickr */
|
||||||
|
var Ic=function(e){var t={exports:{}};return e(t,t.exports),t.exports}(function(e,t){self,e.exports=(()=>{var e={d:(t,i)=>{for(var o in i)e.o(i,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:i[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.d(t,{default:()=>O});var i={};function o(e,t,i,o){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};t instanceof HTMLCollection||t instanceof NodeList?t=Array.from(t):Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);for(const s of t)for(const t of i)s[e](t,o,{capture:!1,...n});return Array.prototype.slice.call(arguments,1)}e.r(i),e.d(i,{adjustableInputNumbers:()=>d,createElementFromString:()=>r,createFromTemplate:()=>a,eventPath:()=>l,off:()=>s,on:()=>n,resolveElement:()=>c});const n=o.bind(null,"addEventListener"),s=o.bind(null,"removeEventListener");function r(e){const t=document.createElement("div");return t.innerHTML=e.trim(),t.firstElementChild}function a(e){const t=(e,t)=>{const i=e.getAttribute(t);return e.removeAttribute(t),i},i=function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t(e,":obj"),s=t(e,":ref"),r=n?o[n]={}:o;s&&(o[s]=e);for(const o of Array.from(e.children)){const e=t(o,":arr"),n=i(o,e?{}:r);e&&(r[e]||(r[e]=[])).push(Object.keys(n).length?n:o)}return o};return i(r(e))}function l(e){let t=e.path||e.composedPath&&e.composedPath();if(t)return t;let i=e.target.parentElement;for(t=[e.target,i];i=i.parentElement;)t.push(i);return t.push(document,window),t}function c(e){return e instanceof Element?e:"string"==typeof e?e.split(/>>/g).reduce((e,t,i,o)=>(e=e.querySelector(t),i<o.length-1?e.shadowRoot:e),document):null}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;function i(i){const o=[.001,.01,.1][Number(i.shiftKey||2*i.ctrlKey)]*(i.deltaY<0?1:-1);let n=0,s=e.selectionStart;e.value=e.value.replace(/[\d.]+/g,(e,i)=>i<=s&&i+e.length>=s?(s=i,t(Number(e),o,n)):(n++,e)),e.focus(),e.setSelectionRange(s,s),i.preventDefault(),e.dispatchEvent(new Event("input"))}n(e,"focus",()=>n(window,"wheel",i,{passive:!1})),n(e,"blur",()=>s(window,"wheel",i))}const{min:h,max:u,floor:p,round:m}=Math;function g(e,t,i){t/=100,i/=100;const o=p(e=e/360*6),n=e-o,s=i*(1-t),r=i*(1-n*t),a=i*(1-(1-n)*t),l=o%6;return[255*[i,r,s,s,a,i][l],255*[a,i,i,r,s,s][l],255*[s,s,a,i,i,r][l]]}function f(e,t,i){return g(e,t,i).map(e=>m(e).toString(16).padStart(2,"0"))}function b(e,t,i){const o=g(e,t,i),n=o[0]/255,s=o[1]/255,r=o[2]/255,a=h(1-n,1-s,1-r);return[100*(1===a?0:(1-n-a)/(1-a)),100*(1===a?0:(1-s-a)/(1-a)),100*(1===a?0:(1-r-a)/(1-a)),100*a]}function y(e,t,i){const o=(2-(t/=100))*(i/=100)/2;return 0!==o&&(t=1===o?0:o<.5?t*i/(2*o):t*i/(2-2*o)),[e,100*t,100*o]}function w(e,t,i){const o=h(e/=255,t/=255,i/=255),n=u(e,t,i),s=n-o;let r,a;if(0===s)r=a=0;else{a=s/n;const o=((n-e)/6+s/2)/s,l=((n-t)/6+s/2)/s,c=((n-i)/6+s/2)/s;e===n?r=c-l:t===n?r=1/3+o-c:i===n&&(r=2/3+l-o),r<0?r+=1:r>1&&(r-=1)}return[360*r,100*a,100*n]}function v(e,t,i,o){return t/=100,i/=100,[...w(255*(1-h(1,(e/=100)*(1-(o/=100))+o)),255*(1-h(1,t*(1-o)+o)),255*(1-h(1,i*(1-o)+o)))]}function C(e,t,i){t/=100;const o=2*(t*=(i/=100)<.5?i:1-i)/(i+t)*100,n=100*(i+t);return[e,isNaN(o)?0:o,n]}function x(e){return w(...e.match(/.{2}/g).map(e=>parseInt(e,16)))}function k(e){e=e.match(/^[a-zA-Z]+$/)?function(e){if("black"===e.toLowerCase())return"#000";const t=document.createElement("canvas").getContext("2d");return t.fillStyle=e,"#000"===t.fillStyle?null:t.fillStyle}(e):e;const t={cmyk:/^cmyk[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)/i,rgba:/^((rgba)|rgb)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsla:/^((hsla)|hsl)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsva:/^((hsva)|hsv)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},i=e=>e.map(e=>/^(|\d+)\.\d+|\d+$/.test(e)?Number(e):void 0);let o;e:for(const n in t){if(!(o=t[n].exec(e)))continue;const s=e=>!!o[2]==("number"==typeof e);switch(n){case"cmyk":{const[,e,t,s,r]=i(o);if(e>100||t>100||s>100||r>100)break e;return{values:v(e,t,s,r),type:n}}case"rgba":{const[,,,e,t,r,a]=i(o);if(e>255||t>255||r>255||a<0||a>1||!s(a))break e;return{values:[...w(e,t,r),a],a:a,type:n}}case"hexa":{let[,e]=o;4!==e.length&&3!==e.length||(e=e.split("").map(e=>e+e).join(""));const t=e.substring(0,6);let i=e.substring(6);return i=i?parseInt(i,16)/255:void 0,{values:[...x(t),i],a:i,type:n}}case"hsla":{const[,,,e,t,r,a]=i(o);if(e>360||t>100||r>100||a<0||a>1||!s(a))break e;return{values:[...C(e,t,r),a],a:a,type:n}}case"hsva":{const[,,,e,t,r,a]=i(o);if(e>360||t>100||r>100||a<0||a>1||!s(a))break e;return{values:[e,t,r,a],a:a,type:n}}}}return{values:null,type:null}}function S(){const e=(e,t)=>function(){let i=arguments.length>0&&void 0!==arguments[0]?arguLine truncated
|
||||||
|
|
||||||
|
|
||||||
|
/* nosourcemap */
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"id": "editing-toolbar",
|
||||||
|
"name": "Editing Toolbar",
|
||||||
|
"version": "3.2.7",
|
||||||
|
"minAppVersion": "0.14.0",
|
||||||
|
"description": "The Obsidian Editing Toolbar is modified from cmenu, which provides more powerful customization settings and has many built-in editing commands to be a MS Word-like toolbar editing experience.",
|
||||||
|
"author": "Cuman",
|
||||||
|
"authorUrl": "https://github.com/cumany/obsidian-editing-toolbar",
|
||||||
|
"isDesktopOnly": false
|
||||||
|
}
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"showRightClickMenu": true,
|
||||||
|
"showFileExplorerIcon": true,
|
||||||
|
"focusLevel": "parent",
|
||||||
|
"customFolderPath": "src/content",
|
||||||
|
"hideAncestorFolders": false,
|
||||||
|
"autoHidePaths": [
|
||||||
|
"node_modules",
|
||||||
|
"dist"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,818 @@
|
|||||||
|
/*
|
||||||
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||||
|
if you want to view the source, please visit the github repository of this plugin
|
||||||
|
*/
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
var __defProp = Object.defineProperty;
|
||||||
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||||
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||||
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||||
|
var __export = (target, all) => {
|
||||||
|
for (var name in all)
|
||||||
|
__defProp(target, name, { get: all[name], enumerable: true });
|
||||||
|
};
|
||||||
|
var __copyProps = (to, from, except, desc) => {
|
||||||
|
if (from && typeof from === "object" || typeof from === "function") {
|
||||||
|
for (let key of __getOwnPropNames(from))
|
||||||
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||||
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
};
|
||||||
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||||
|
|
||||||
|
// src/main.ts
|
||||||
|
var main_exports = {};
|
||||||
|
__export(main_exports, {
|
||||||
|
ExplorerFocusPlugin: () => ExplorerFocusPlugin,
|
||||||
|
default: () => main_default
|
||||||
|
});
|
||||||
|
module.exports = __toCommonJS(main_exports);
|
||||||
|
var import_obsidian5 = require("obsidian");
|
||||||
|
|
||||||
|
// src/types.ts
|
||||||
|
var DEFAULT_SETTINGS = {
|
||||||
|
showRightClickMenu: true,
|
||||||
|
showFileExplorerIcon: true,
|
||||||
|
focusLevel: "parent",
|
||||||
|
customFolderPath: "",
|
||||||
|
hideAncestorFolders: false,
|
||||||
|
autoHidePaths: []
|
||||||
|
};
|
||||||
|
|
||||||
|
// src/ui/settings-tab.ts
|
||||||
|
var import_obsidian4 = require("obsidian");
|
||||||
|
|
||||||
|
// src/utils/file-explorer-patch.ts
|
||||||
|
var import_obsidian = require("obsidian");
|
||||||
|
|
||||||
|
// node_modules/.pnpm/monkey-around@3.0.0/node_modules/monkey-around/dist/index.mjs
|
||||||
|
function around(obj, factories) {
|
||||||
|
const removers = Object.keys(factories).map((key) => around1(obj, key, factories[key]));
|
||||||
|
return removers.length === 1 ? removers[0] : function() {
|
||||||
|
removers.forEach((r) => r());
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function around1(obj, method, createWrapper) {
|
||||||
|
const inherited = obj[method], hadOwn = obj.hasOwnProperty(method), original = hadOwn ? inherited : function() {
|
||||||
|
return Object.getPrototypeOf(obj)[method].apply(this, arguments);
|
||||||
|
};
|
||||||
|
let current = createWrapper(original);
|
||||||
|
if (inherited)
|
||||||
|
Object.setPrototypeOf(current, inherited);
|
||||||
|
Object.setPrototypeOf(wrapper, current);
|
||||||
|
obj[method] = wrapper;
|
||||||
|
return remove;
|
||||||
|
function wrapper(...args) {
|
||||||
|
if (current === original && obj[method] === wrapper)
|
||||||
|
remove();
|
||||||
|
return current.apply(this, args);
|
||||||
|
}
|
||||||
|
function remove() {
|
||||||
|
if (obj[method] === wrapper) {
|
||||||
|
if (hadOwn)
|
||||||
|
obj[method] = original;
|
||||||
|
else
|
||||||
|
delete obj[method];
|
||||||
|
}
|
||||||
|
if (current === original)
|
||||||
|
return;
|
||||||
|
current = original;
|
||||||
|
Object.setPrototypeOf(wrapper, inherited || Function);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// src/utils/file-explorer-patch.ts
|
||||||
|
var prototypePatched = false;
|
||||||
|
var patchingFailed = false;
|
||||||
|
function patchFileExplorer(plugin) {
|
||||||
|
if (patchingFailed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (import_obsidian.Platform.isMobile) {
|
||||||
|
patchingFailed = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const fileExplorer = getFileExplorer(plugin);
|
||||||
|
if (!fileExplorer) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!prototypePatched) {
|
||||||
|
try {
|
||||||
|
const prototype = Object.getPrototypeOf(fileExplorer);
|
||||||
|
if (typeof prototype.getSortedFolderItems !== "function") {
|
||||||
|
throw new Error("getSortedFolderItems method not found on file explorer prototype");
|
||||||
|
}
|
||||||
|
plugin.register(
|
||||||
|
around(prototype, {
|
||||||
|
getSortedFolderItems(old) {
|
||||||
|
return function(folder) {
|
||||||
|
let sortedChildren = old.call(this, folder);
|
||||||
|
if (plugin.isFocus && plugin.focusedPath) {
|
||||||
|
const focusedPath = plugin.focusedPath;
|
||||||
|
sortedChildren = sortedChildren.filter((vEl) => {
|
||||||
|
const filePath = vEl.file.path;
|
||||||
|
if (filePath === focusedPath) {
|
||||||
|
vEl.info.hidden = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (filePath.startsWith(focusedPath + "/")) {
|
||||||
|
vEl.info.hidden = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (focusedPath.startsWith(filePath + "/")) {
|
||||||
|
vEl.info.hidden = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
vEl.info.hidden = true;
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
sortedChildren.forEach((vEl) => {
|
||||||
|
vEl.info.hidden = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return sortedChildren;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
prototypePatched = true;
|
||||||
|
} catch (error) {
|
||||||
|
patchingFailed = true;
|
||||||
|
console.warn(
|
||||||
|
"[Explorer Focus] Failed to patch file explorer. The plugin will use CSS-based hiding as a fallback, which may be less precise. This usually happens after an Obsidian update - please check for plugin updates.",
|
||||||
|
error
|
||||||
|
);
|
||||||
|
new import_obsidian.Notice(
|
||||||
|
"Explorer Focus: File explorer patching failed. The plugin will still work but may need an update for full functionality.",
|
||||||
|
8e3
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fileExplorer.fileExplorerPlusPatched = true;
|
||||||
|
}
|
||||||
|
function getFileExplorer(plugin) {
|
||||||
|
var _a;
|
||||||
|
const fileExplorerContainer = (_a = plugin.app.workspace.getLeavesOfType("file-explorer")) == null ? void 0 : _a.first();
|
||||||
|
return fileExplorerContainer == null ? void 0 : fileExplorerContainer.view;
|
||||||
|
}
|
||||||
|
function getAllFileExplorers(plugin) {
|
||||||
|
const fileExplorerLeaves = plugin.app.workspace.getLeavesOfType("file-explorer");
|
||||||
|
return fileExplorerLeaves.map((leaf) => leaf.view);
|
||||||
|
}
|
||||||
|
|
||||||
|
// src/ui/folder-suggest.ts
|
||||||
|
var import_obsidian2 = require("obsidian");
|
||||||
|
var FolderSuggest = class extends import_obsidian2.AbstractInputSuggest {
|
||||||
|
constructor(app, inputEl) {
|
||||||
|
super(app, inputEl);
|
||||||
|
this.inputEl = inputEl;
|
||||||
|
}
|
||||||
|
getSuggestions(query) {
|
||||||
|
const lowerQuery = query.toLowerCase();
|
||||||
|
const folders = [];
|
||||||
|
this.app.vault.getAllLoadedFiles().forEach((file) => {
|
||||||
|
if (file instanceof import_obsidian2.TFolder) {
|
||||||
|
if (file.path.toLowerCase().includes(lowerQuery)) {
|
||||||
|
folders.push(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
folders.sort((a, b) => a.path.localeCompare(b.path));
|
||||||
|
return folders.slice(0, 20);
|
||||||
|
}
|
||||||
|
renderSuggestion(folder, el) {
|
||||||
|
el.createEl("div", { text: folder.path || "/" });
|
||||||
|
}
|
||||||
|
selectSuggestion(folder) {
|
||||||
|
this.inputEl.value = folder.path;
|
||||||
|
this.inputEl.trigger("input");
|
||||||
|
this.close();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// src/ui/auto-hide-modal.ts
|
||||||
|
var import_obsidian3 = require("obsidian");
|
||||||
|
var AutoHideModal = class extends import_obsidian3.Modal {
|
||||||
|
constructor(app, plugin, onSave) {
|
||||||
|
var _a;
|
||||||
|
super(app);
|
||||||
|
this.addInput = null;
|
||||||
|
this.plugin = plugin;
|
||||||
|
this.paths = [...(_a = plugin.settings.autoHidePaths) != null ? _a : []];
|
||||||
|
this.onSave = onSave;
|
||||||
|
}
|
||||||
|
onOpen() {
|
||||||
|
this.setTitle("Auto-hide folders");
|
||||||
|
this.renderContent();
|
||||||
|
}
|
||||||
|
renderContent() {
|
||||||
|
var _a;
|
||||||
|
const { contentEl } = this;
|
||||||
|
contentEl.empty();
|
||||||
|
contentEl.createEl("p", {
|
||||||
|
text: "The following folders are currently hidden from the file explorer."
|
||||||
|
});
|
||||||
|
const listWrapper = contentEl.createDiv();
|
||||||
|
this.paths.forEach((path, index) => {
|
||||||
|
const row = listWrapper.createDiv({ cls: "mobile-option-setting-item" });
|
||||||
|
row.createSpan({
|
||||||
|
text: path || "(empty)",
|
||||||
|
cls: "mobile-option-setting-item-name"
|
||||||
|
});
|
||||||
|
const removeBtn = row.createDiv({
|
||||||
|
cls: "clickable-icon mobile-option-setting-item-option-icon",
|
||||||
|
attr: { "aria-label": "Delete" }
|
||||||
|
});
|
||||||
|
(0, import_obsidian3.setIcon)(removeBtn, "x");
|
||||||
|
removeBtn.addEventListener("click", () => {
|
||||||
|
this.paths.splice(index, 1);
|
||||||
|
this.renderContent();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
new import_obsidian3.Setting(contentEl).setName("Folder").addText((text) => {
|
||||||
|
new FolderSuggest(this.app, text.inputEl);
|
||||||
|
text.setPlaceholder("Enter folder path");
|
||||||
|
this.addInput = text;
|
||||||
|
}).addButton((button) => button.setButtonText("Add").onClick(() => {
|
||||||
|
var _a2, _b, _c;
|
||||||
|
const value = (_b = (_a2 = this.addInput) == null ? void 0 : _a2.getValue()) == null ? void 0 : _b.trim();
|
||||||
|
if (value) {
|
||||||
|
this.paths.push(value);
|
||||||
|
(_c = this.addInput) == null ? void 0 : _c.setValue("");
|
||||||
|
this.renderContent();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
(_a = this.modalEl.querySelector(".modal-button-container")) == null ? void 0 : _a.remove();
|
||||||
|
const buttonContainer = this.modalEl.createDiv({ cls: "modal-button-container" });
|
||||||
|
const saveBtn = buttonContainer.createEl("button", {
|
||||||
|
text: "Save",
|
||||||
|
cls: "mod-cta"
|
||||||
|
});
|
||||||
|
saveBtn.addEventListener("click", () => {
|
||||||
|
this.plugin.settings.autoHidePaths = this.paths;
|
||||||
|
void this.plugin.saveSettings();
|
||||||
|
this.plugin.updateAutoHideStyles();
|
||||||
|
this.onSave();
|
||||||
|
this.close();
|
||||||
|
});
|
||||||
|
const cancelBtn = buttonContainer.createEl("button", {
|
||||||
|
text: "Cancel",
|
||||||
|
cls: "mod-cancel"
|
||||||
|
});
|
||||||
|
cancelBtn.addEventListener("click", () => {
|
||||||
|
this.close();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// src/ui/settings-tab.ts
|
||||||
|
var ExplorerFocusSettingTab = class extends import_obsidian4.PluginSettingTab {
|
||||||
|
constructor(app, plugin) {
|
||||||
|
super(app, plugin);
|
||||||
|
this.icon = "lucide-focus";
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
display() {
|
||||||
|
const { containerEl } = this;
|
||||||
|
containerEl.empty();
|
||||||
|
const generalGroup = new import_obsidian4.SettingGroup(containerEl);
|
||||||
|
generalGroup.addSetting((setting) => {
|
||||||
|
setting.setName("Show right-click menu option").addToggle((toggle) => toggle.setValue(this.plugin.settings.showRightClickMenu).onChange(async (value) => {
|
||||||
|
this.plugin.settings.showRightClickMenu = value;
|
||||||
|
await this.plugin.saveSettings();
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
generalGroup.addSetting((setting) => {
|
||||||
|
setting.setName("Show file explorer icon").addToggle((toggle) => toggle.setValue(this.plugin.settings.showFileExplorerIcon).onChange(async (value) => {
|
||||||
|
this.plugin.settings.showFileExplorerIcon = value;
|
||||||
|
await this.plugin.saveSettings();
|
||||||
|
this.plugin.updateFileExplorerIcon();
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
generalGroup.addSetting((setting) => {
|
||||||
|
setting.setName("Command focus level").setDesc("Determines what to focus when using the toggle command or file explorer icon. Right-click menu always focuses the clicked file/folder.").addDropdown((dropdown) => dropdown.addOption("file", "Current file only").addOption("parent", "Parent folder").addOption("grandparent", "Grandparent folder").addOption("greatgrandparent", "Great grandparent folder").addOption("custom", "Specific folder").setValue(this.plugin.settings.focusLevel).onChange(async (value) => {
|
||||||
|
this.plugin.settings.focusLevel = value;
|
||||||
|
await this.plugin.saveSettings();
|
||||||
|
if (this.plugin.isFocus) {
|
||||||
|
const fileExplorers = getAllFileExplorers(this.plugin);
|
||||||
|
fileExplorers.forEach((fileExplorer) => {
|
||||||
|
if (fileExplorer == null ? void 0 : fileExplorer.requestSort) {
|
||||||
|
fileExplorer.requestSort();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.display();
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
if (this.plugin.settings.focusLevel === "custom") {
|
||||||
|
generalGroup.addSetting((setting) => {
|
||||||
|
setting.setName("Custom folder path").setDesc("Enter a folder path (folder/subfolder). This folder will be focused regardless of which file is open.").addText((text) => {
|
||||||
|
new FolderSuggest(this.app, text.inputEl);
|
||||||
|
text.setPlaceholder("Folder/subfolder").setValue(this.plugin.settings.customFolderPath).onChange(async (value) => {
|
||||||
|
this.plugin.settings.customFolderPath = value;
|
||||||
|
await this.plugin.saveSettings();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const autoHideGroup = new import_obsidian4.SettingGroup(containerEl).setHeading("Auto-hide folders");
|
||||||
|
autoHideGroup.addSetting((setting) => {
|
||||||
|
var _a;
|
||||||
|
const autoHidePaths = ((_a = this.plugin.settings.autoHidePaths) != null ? _a : []).filter((p) => p.trim().length > 0);
|
||||||
|
const descFragment = document.createDocumentFragment();
|
||||||
|
descFragment.appendText("These folders are always hidden from the file explorer.");
|
||||||
|
if (autoHidePaths.length > 0) {
|
||||||
|
const list = descFragment.createEl("ul");
|
||||||
|
autoHidePaths.forEach((p) => {
|
||||||
|
list.createEl("li", { text: p });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
setting.setName("Hidden folders").setDesc(descFragment).addButton((button) => button.setButtonText("Manage").onClick(() => {
|
||||||
|
new AutoHideModal(this.app, this.plugin, () => {
|
||||||
|
this.display();
|
||||||
|
}).open();
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// src/utils/focus.ts
|
||||||
|
function getFocusPath(path, level, settings) {
|
||||||
|
if (level === "custom") {
|
||||||
|
return settings.customFolderPath || path;
|
||||||
|
}
|
||||||
|
if (level === "file") {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
const parts = path.split("/");
|
||||||
|
if (level === "parent") {
|
||||||
|
if (parts.length === 1) {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
return parts.slice(0, -1).join("/");
|
||||||
|
}
|
||||||
|
if (level === "grandparent") {
|
||||||
|
if (parts.length <= 2) {
|
||||||
|
return parts[0] || path;
|
||||||
|
}
|
||||||
|
return parts.slice(0, -2).join("/");
|
||||||
|
}
|
||||||
|
if (parts.length <= 3) {
|
||||||
|
return parts[0] || path;
|
||||||
|
}
|
||||||
|
return parts.slice(0, -3).join("/");
|
||||||
|
}
|
||||||
|
|
||||||
|
// src/commands/index.ts
|
||||||
|
function registerCommands(plugin) {
|
||||||
|
plugin.addCommand({
|
||||||
|
id: "toggle",
|
||||||
|
name: "Toggle focus",
|
||||||
|
callback: () => {
|
||||||
|
if (plugin.isFocus) {
|
||||||
|
plugin.exitFocus();
|
||||||
|
} else {
|
||||||
|
if (plugin.settings.focusLevel === "custom") {
|
||||||
|
if (plugin.settings.customFolderPath) {
|
||||||
|
plugin.enterFocus(plugin.settings.customFolderPath);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const file = plugin.app.workspace.getActiveFile();
|
||||||
|
if (file == null ? void 0 : file.path) {
|
||||||
|
const focusPath = getFocusPath(file.path, plugin.settings.focusLevel, plugin.settings);
|
||||||
|
plugin.enterFocus(focusPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (plugin.settings.showRightClickMenu) {
|
||||||
|
plugin.registerEvent(
|
||||||
|
plugin.app.workspace.on("file-menu", (menu, file) => {
|
||||||
|
if (!plugin.settings.showRightClickMenu) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
menu.addItem((item) => {
|
||||||
|
item.setTitle(plugin.isFocus ? "Exit focus" : "Focus").setIcon(plugin.isFocus ? "log-out" : "focus").onClick(() => {
|
||||||
|
plugin.toggleFocus(file == null ? void 0 : file.path);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// src/utils/file-explorer.ts
|
||||||
|
function findNavButtonsContainer(fileExplorerView) {
|
||||||
|
var _a;
|
||||||
|
let container = fileExplorerView.querySelector(".nav-buttons-container");
|
||||||
|
if (container) {
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
container = fileExplorerView.querySelector(".nav-header-button-container");
|
||||||
|
if (container) {
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
const existingButtons = fileExplorerView.querySelectorAll(".nav-action-button");
|
||||||
|
if (existingButtons.length > 0) {
|
||||||
|
const firstButton = existingButtons[0];
|
||||||
|
const parent = firstButton.parentElement;
|
||||||
|
if (parent && (parent.classList.contains("nav-buttons-container") || parent.classList.contains("nav-header-button-container") || Array.from(parent.children).some((el) => el.classList.contains("nav-action-button")))) {
|
||||||
|
return parent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const viewHeader = fileExplorerView.querySelector(".view-header");
|
||||||
|
if (viewHeader) {
|
||||||
|
const headerContainer = viewHeader.querySelector(".nav-buttons-container") || viewHeader.querySelector(".nav-header-button-container") || viewHeader.querySelector(".view-header-title-container");
|
||||||
|
if (headerContainer) {
|
||||||
|
return headerContainer;
|
||||||
|
}
|
||||||
|
return viewHeader;
|
||||||
|
}
|
||||||
|
const navFilesContainer = fileExplorerView.querySelector(".nav-files-container");
|
||||||
|
if (navFilesContainer) {
|
||||||
|
let mobileButtonContainer = fileExplorerView.querySelector(".explorer-focus-mobile-buttons");
|
||||||
|
if (!mobileButtonContainer) {
|
||||||
|
mobileButtonContainer = document.createElement("div");
|
||||||
|
mobileButtonContainer.className = "nav-buttons-container explorer-focus-mobile-buttons";
|
||||||
|
mobileButtonContainer.setCssProps({
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
gap: "4px",
|
||||||
|
padding: "8px",
|
||||||
|
borderBottom: "1px solid var(--background-modifier-border)"
|
||||||
|
});
|
||||||
|
(_a = navFilesContainer.parentElement) == null ? void 0 : _a.insertBefore(mobileButtonContainer, navFilesContainer);
|
||||||
|
}
|
||||||
|
return mobileButtonContainer;
|
||||||
|
}
|
||||||
|
let topContainer = fileExplorerView.querySelector(".explorer-focus-mobile-buttons");
|
||||||
|
if (!topContainer) {
|
||||||
|
topContainer = document.createElement("div");
|
||||||
|
topContainer.className = "nav-buttons-container explorer-focus-mobile-buttons";
|
||||||
|
topContainer.setCssProps({
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
gap: "4px",
|
||||||
|
padding: "8px",
|
||||||
|
borderBottom: "1px solid var(--background-modifier-border)"
|
||||||
|
});
|
||||||
|
fileExplorerView.insertBefore(topContainer, fileExplorerView.firstChild);
|
||||||
|
}
|
||||||
|
return topContainer;
|
||||||
|
}
|
||||||
|
function createFileExplorerIcon(plugin) {
|
||||||
|
const icon = document.createElement("div");
|
||||||
|
icon.className = "clickable-icon nav-action-button";
|
||||||
|
icon.setAttribute("aria-label", "Toggle focus");
|
||||||
|
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
||||||
|
svg.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
||||||
|
svg.setAttribute("width", "24");
|
||||||
|
svg.setAttribute("height", "24");
|
||||||
|
svg.setAttribute("viewBox", "0 0 24 24");
|
||||||
|
svg.setAttribute("fill", "none");
|
||||||
|
svg.setAttribute("stroke", "currentColor");
|
||||||
|
svg.setAttribute("stroke-width", "2");
|
||||||
|
svg.setAttribute("stroke-linecap", "round");
|
||||||
|
svg.setAttribute("stroke-linejoin", "round");
|
||||||
|
svg.setAttribute("class", "svg-icon lucide-focus");
|
||||||
|
const circle = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
||||||
|
circle.setAttribute("cx", "12");
|
||||||
|
circle.setAttribute("cy", "12");
|
||||||
|
circle.setAttribute("r", "3");
|
||||||
|
svg.appendChild(circle);
|
||||||
|
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
||||||
|
path1.setAttribute("d", "M3 7V5a2 2 0 0 1 2-2h2");
|
||||||
|
svg.appendChild(path1);
|
||||||
|
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
||||||
|
path2.setAttribute("d", "M17 3h2a2 2 0 0 1 2 2v2");
|
||||||
|
svg.appendChild(path2);
|
||||||
|
const path3 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
||||||
|
path3.setAttribute("d", "M21 17v2a2 2 0 0 1-2 2h-2");
|
||||||
|
svg.appendChild(path3);
|
||||||
|
const path4 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
||||||
|
path4.setAttribute("d", "M7 21H5a2 2 0 0 1-2-2v-2");
|
||||||
|
svg.appendChild(path4);
|
||||||
|
icon.appendChild(svg);
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
function insertFileExplorerIcon(icon, navButtonsContainer) {
|
||||||
|
if (navButtonsContainer.contains(icon)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const allIcons = Array.from(navButtonsContainer.querySelectorAll(".clickable-icon.nav-action-button"));
|
||||||
|
const defaultIcons = allIcons.filter((el) => !el.classList.contains("cmdr") && el !== icon);
|
||||||
|
const cmdrIcons = Array.from(navButtonsContainer.querySelectorAll(".cmdr"));
|
||||||
|
if (cmdrIcons.length > 0) {
|
||||||
|
navButtonsContainer.insertBefore(icon, cmdrIcons[0]);
|
||||||
|
} else if (defaultIcons.length > 0) {
|
||||||
|
const lastIcon = defaultIcons[defaultIcons.length - 1];
|
||||||
|
if (lastIcon.nextSibling) {
|
||||||
|
navButtonsContainer.insertBefore(icon, lastIcon.nextSibling);
|
||||||
|
} else {
|
||||||
|
navButtonsContainer.appendChild(icon);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
navButtonsContainer.appendChild(icon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// src/main.ts
|
||||||
|
var ExplorerFocusPlugin = class extends import_obsidian5.Plugin {
|
||||||
|
constructor(app, manifest) {
|
||||||
|
super(app, manifest);
|
||||||
|
this.isFocus = false;
|
||||||
|
this.focusedPath = null;
|
||||||
|
this.fileExplorerIcon = null;
|
||||||
|
}
|
||||||
|
async onload() {
|
||||||
|
await this.loadSettings();
|
||||||
|
this.addSettingTab(new ExplorerFocusSettingTab(this.app, this));
|
||||||
|
registerCommands(this);
|
||||||
|
if (this.settings.showFileExplorerIcon) {
|
||||||
|
this.addFileExplorerIcon();
|
||||||
|
}
|
||||||
|
this.app.workspace.onLayoutReady(() => {
|
||||||
|
this.patchAllFileExplorers();
|
||||||
|
this.updateFocusModeClasses();
|
||||||
|
this.updateAutoHideStyles();
|
||||||
|
});
|
||||||
|
this.app.workspace.on("layout-change", () => {
|
||||||
|
this.patchAllFileExplorers();
|
||||||
|
this.updateFocusModeClasses();
|
||||||
|
this.updateAutoHideStyles();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async loadSettings() {
|
||||||
|
const loadedData = await this.loadData();
|
||||||
|
this.settings = Object.assign({}, DEFAULT_SETTINGS, loadedData);
|
||||||
|
}
|
||||||
|
async saveSettings() {
|
||||||
|
await this.saveData(this.settings);
|
||||||
|
}
|
||||||
|
toggleFocus(path) {
|
||||||
|
if (this.isFocus) {
|
||||||
|
this.exitFocus();
|
||||||
|
} else if (path) {
|
||||||
|
this.enterFocus(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
enterFocus(path) {
|
||||||
|
this.isFocus = true;
|
||||||
|
this.focusedPath = path;
|
||||||
|
this.updateFileExplorerIcon();
|
||||||
|
this.updateFocusModeClasses();
|
||||||
|
const fileExplorers = getAllFileExplorers(this);
|
||||||
|
fileExplorers.forEach((fileExplorer) => {
|
||||||
|
if (fileExplorer == null ? void 0 : fileExplorer.requestSort) {
|
||||||
|
fileExplorer.requestSort();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
fileExplorers.forEach((fileExplorer) => {
|
||||||
|
this.refreshFileExplorerVisibility(fileExplorer);
|
||||||
|
});
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
patchAllFileExplorers() {
|
||||||
|
patchFileExplorer(this);
|
||||||
|
const fileExplorers = getAllFileExplorers(this);
|
||||||
|
fileExplorers.forEach((fileExplorer) => {
|
||||||
|
fileExplorer.fileExplorerPlusPatched = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exitFocus() {
|
||||||
|
this.isFocus = false;
|
||||||
|
this.focusedPath = null;
|
||||||
|
this.updateFileExplorerIcon();
|
||||||
|
this.updateFocusModeClasses();
|
||||||
|
const fileExplorers = getAllFileExplorers(this);
|
||||||
|
fileExplorers.forEach((fileExplorer) => {
|
||||||
|
if (fileExplorer == null ? void 0 : fileExplorer.requestSort) {
|
||||||
|
fileExplorer.requestSort();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
fileExplorers.forEach((fileExplorer) => {
|
||||||
|
this.refreshFileExplorerVisibility(fileExplorer);
|
||||||
|
});
|
||||||
|
this.updateAutoHideStyles();
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
refreshFileExplorerVisibility(fileExplorer) {
|
||||||
|
if (!(fileExplorer == null ? void 0 : fileExplorer.fileItems)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.isFocus || !this.focusedPath) {
|
||||||
|
Object.values(fileExplorer.fileItems).forEach((vEl) => {
|
||||||
|
if (!(vEl == null ? void 0 : vEl.el)) return;
|
||||||
|
if (vEl.el.hasAttribute("data-explorer-focus-hidden")) {
|
||||||
|
if (vEl.info) vEl.info.hidden = false;
|
||||||
|
vEl.el.setCssProps({ display: "" });
|
||||||
|
vEl.el.removeAttribute("data-explorer-focus-hidden");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const focusedPath = this.focusedPath;
|
||||||
|
const ancestorPaths = /* @__PURE__ */ new Set();
|
||||||
|
const pathParts = focusedPath.split("/");
|
||||||
|
for (let i = 1; i < pathParts.length; i++) {
|
||||||
|
ancestorPaths.add(pathParts.slice(0, i).join("/"));
|
||||||
|
}
|
||||||
|
const topLevelFolders = /* @__PURE__ */ new Map();
|
||||||
|
const rootItems = [];
|
||||||
|
for (const path of Object.keys(fileExplorer.fileItems)) {
|
||||||
|
const firstSlash = path.indexOf("/");
|
||||||
|
if (firstSlash === -1) {
|
||||||
|
rootItems.push(path);
|
||||||
|
} else {
|
||||||
|
const topLevel = path.substring(0, firstSlash);
|
||||||
|
if (!topLevelFolders.has(topLevel)) {
|
||||||
|
topLevelFolders.set(topLevel, []);
|
||||||
|
}
|
||||||
|
topLevelFolders.get(topLevel).push(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const focusedTopLevel = focusedPath.split("/")[0];
|
||||||
|
for (const path of rootItems) {
|
||||||
|
const vEl = fileExplorer.fileItems[path];
|
||||||
|
if (!(vEl == null ? void 0 : vEl.el)) continue;
|
||||||
|
const shouldShow = path === focusedPath || focusedPath.startsWith(path + "/") || path.startsWith(focusedPath + "/");
|
||||||
|
this.updateItemVisibility(vEl, shouldShow);
|
||||||
|
}
|
||||||
|
for (const [topLevel, paths] of topLevelFolders) {
|
||||||
|
const isInFocusPath = topLevel === focusedTopLevel || ancestorPaths.has(topLevel) || focusedPath === topLevel;
|
||||||
|
if (!isInFocusPath) {
|
||||||
|
for (const path of paths) {
|
||||||
|
const vEl = fileExplorer.fileItems[path];
|
||||||
|
if (!(vEl == null ? void 0 : vEl.el)) continue;
|
||||||
|
this.updateItemVisibility(vEl, false);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (const path of paths) {
|
||||||
|
const vEl = fileExplorer.fileItems[path];
|
||||||
|
if (!(vEl == null ? void 0 : vEl.el)) continue;
|
||||||
|
const shouldShow = path === focusedPath || path.startsWith(focusedPath + "/") || ancestorPaths.has(path);
|
||||||
|
this.updateItemVisibility(vEl, shouldShow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
updateItemVisibility(vEl, shouldShow) {
|
||||||
|
const currentlyHidden = vEl.el.hasAttribute("data-explorer-focus-hidden");
|
||||||
|
if (shouldShow && currentlyHidden) {
|
||||||
|
if (vEl.info) vEl.info.hidden = false;
|
||||||
|
vEl.el.setCssProps({ display: "" });
|
||||||
|
vEl.el.removeAttribute("data-explorer-focus-hidden");
|
||||||
|
} else if (!shouldShow && !currentlyHidden) {
|
||||||
|
if (vEl.info) vEl.info.hidden = true;
|
||||||
|
vEl.el.setCssProps({ display: "none" });
|
||||||
|
vEl.el.setAttribute("data-explorer-focus-hidden", "true");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
updateFocusModeClasses() {
|
||||||
|
const fileExplorers = getAllFileExplorers(this);
|
||||||
|
fileExplorers.forEach((fileExplorer) => {
|
||||||
|
const containerEl = fileExplorer.containerEl;
|
||||||
|
if (this.isFocus) {
|
||||||
|
containerEl.addClass("explorer-focus-mode");
|
||||||
|
} else {
|
||||||
|
containerEl.removeClass("explorer-focus-mode");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
addFileExplorerIcon() {
|
||||||
|
const handleIconClick = () => {
|
||||||
|
if (this.isFocus) {
|
||||||
|
this.exitFocus();
|
||||||
|
} else {
|
||||||
|
if (this.settings.focusLevel === "custom") {
|
||||||
|
if (this.settings.customFolderPath) {
|
||||||
|
this.enterFocus(this.settings.customFolderPath);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const file = this.app.workspace.getActiveFile();
|
||||||
|
if (file == null ? void 0 : file.path) {
|
||||||
|
const focusPath = getFocusPath(file.path, this.settings.focusLevel, this.settings);
|
||||||
|
this.enterFocus(focusPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const addIconToFileExplorer = () => {
|
||||||
|
const fileExplorerLeaves = this.app.workspace.getLeavesOfType("file-explorer");
|
||||||
|
if (fileExplorerLeaves.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const fileExplorerView = fileExplorerLeaves[0].view.containerEl;
|
||||||
|
const navButtonsContainer = findNavButtonsContainer(fileExplorerView);
|
||||||
|
if (!navButtonsContainer) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.fileExplorerIcon && navButtonsContainer.contains(this.fileExplorerIcon)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.fileExplorerIcon && this.fileExplorerIcon.parentElement) {
|
||||||
|
this.fileExplorerIcon.remove();
|
||||||
|
}
|
||||||
|
if (!this.fileExplorerIcon) {
|
||||||
|
this.fileExplorerIcon = createFileExplorerIcon(this);
|
||||||
|
this.fileExplorerIcon.setCssProps({ touchAction: "manipulation" });
|
||||||
|
let touchHandled = false;
|
||||||
|
this.registerDomEvent(this.fileExplorerIcon, "touchstart", (evt) => {
|
||||||
|
touchHandled = true;
|
||||||
|
evt.preventDefault();
|
||||||
|
evt.stopPropagation();
|
||||||
|
handleIconClick();
|
||||||
|
setTimeout(() => {
|
||||||
|
touchHandled = false;
|
||||||
|
}, 300);
|
||||||
|
});
|
||||||
|
this.registerDomEvent(this.fileExplorerIcon, "click", (evt) => {
|
||||||
|
if (touchHandled) {
|
||||||
|
evt.preventDefault();
|
||||||
|
evt.stopPropagation();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
evt.preventDefault();
|
||||||
|
evt.stopPropagation();
|
||||||
|
handleIconClick();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.updateFileExplorerIcon();
|
||||||
|
insertFileExplorerIcon(this.fileExplorerIcon, navButtonsContainer);
|
||||||
|
};
|
||||||
|
addIconToFileExplorer();
|
||||||
|
this.registerEvent(
|
||||||
|
this.app.workspace.on("layout-change", () => {
|
||||||
|
if (this.settings.showFileExplorerIcon) {
|
||||||
|
addIconToFileExplorer();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
updateFileExplorerIcon() {
|
||||||
|
if (!this.fileExplorerIcon) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.settings.showFileExplorerIcon) {
|
||||||
|
if (this.fileExplorerIcon.parentElement) {
|
||||||
|
this.fileExplorerIcon.remove();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.fileExplorerIcon.parentElement) {
|
||||||
|
const fileExplorerLeaves = this.app.workspace.getLeavesOfType("file-explorer");
|
||||||
|
if (fileExplorerLeaves.length > 0) {
|
||||||
|
const fileExplorerView = fileExplorerLeaves[0].view.containerEl;
|
||||||
|
const navButtonsContainer = findNavButtonsContainer(fileExplorerView);
|
||||||
|
if (navButtonsContainer) {
|
||||||
|
insertFileExplorerIcon(this.fileExplorerIcon, navButtonsContainer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.fileExplorerIcon.style.cursor) {
|
||||||
|
this.fileExplorerIcon.style.removeProperty("cursor");
|
||||||
|
}
|
||||||
|
if (this.isFocus) {
|
||||||
|
this.fileExplorerIcon.addClass("is-active");
|
||||||
|
} else {
|
||||||
|
this.fileExplorerIcon.removeClass("is-active");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
updateAutoHideStyles() {
|
||||||
|
var _a;
|
||||||
|
const paths = new Set(
|
||||||
|
((_a = this.settings.autoHidePaths) != null ? _a : []).map((p) => p.trim()).filter((p) => p.length > 0)
|
||||||
|
);
|
||||||
|
const fileExplorers = getAllFileExplorers(this);
|
||||||
|
fileExplorers.forEach((fileExplorer) => {
|
||||||
|
if (!(fileExplorer == null ? void 0 : fileExplorer.fileItems)) return;
|
||||||
|
for (const [filePath, vEl] of Object.entries(fileExplorer.fileItems)) {
|
||||||
|
if (!(vEl == null ? void 0 : vEl.el)) continue;
|
||||||
|
const shouldHide = paths.has(filePath);
|
||||||
|
const isHidden = vEl.el.hasAttribute("data-explorer-focus-auto-hidden");
|
||||||
|
if (shouldHide && !isHidden) {
|
||||||
|
vEl.el.setCssProps({ display: "none" });
|
||||||
|
vEl.el.setAttribute("data-explorer-focus-auto-hidden", "true");
|
||||||
|
} else if (!shouldHide && isHidden) {
|
||||||
|
vEl.el.setCssProps({ display: "" });
|
||||||
|
vEl.el.removeAttribute("data-explorer-focus-auto-hidden");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
onunload() {
|
||||||
|
if (this.fileExplorerIcon) {
|
||||||
|
this.fileExplorerIcon.remove();
|
||||||
|
this.fileExplorerIcon = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var main_default = ExplorerFocusPlugin;
|
||||||
|
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjL21haW4udHMiLCAic3JjL3R5cGVzLnRzIiwgInNyYy91aS9zZXR0aW5ncy10YWIudHMiLCAic3JjL3V0aWxzL2ZpbGUtZXhwbG9yZXItcGF0Y2gudHMiLCAibm9kZV9tb2R1bGVzLy5wbnBtL21vbmtleS1hcm91bmRAMy4wLjAvbm9kZV9tb2R1bGVzL21vbmtleS1hcm91bmQvZGlzdC9pbmRleC5tanMiLCAic3JjL3VpL2ZvbGRlci1zdWdnZXN0LnRzIiwgInNyYy91aS9hdXRvLWhpZGUtbW9kYWwudHMiLCAic3JjL3V0aWxzL2ZvY3VzLnRzIiwgInNyYy9jb21tYW5kcy9pbmRleC50cyIsICJzcmMvdXRpbHMvZmlsZS1leHBsb3Jlci50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiaW1wb3J0IHsgQXBwLCBQbHVnaW4sIFBsdWdpbk1hbmlmZXN0IH0gZnJvbSBcIm9ic2lkaWFuXCI7XHJcbmltcG9ydCB7IEV4cGxvcmVyRm9jdXNTZXR0aW5ncywgREVGQVVMVF9TRVRUSU5HUyB9IGZyb20gJy4vdHlwZXMnO1xyXG5pbXBvcnQgeyBFeHBsb3JlckZvY3VzU2V0dGluZ1RhYiB9IGZyb20gJy4vdWkvc2V0dGluZ3MtdGFiJztcclxuaW1wb3J0IHsgcmVnaXN0ZXJDb21tYW5kcyB9IGZyb20gJy4vY29tbWFuZHMnO1xyXG5pbXBvcnQgeyBjcmVhdGVGaWxlRXhwbG9yZXJJY29uLCBpbnNlcnRGaWxlRXhwbG9yZXJJY29uLCBmaW5kTmF2QnV0dG9uc0NvbnRhaW5lciB9IGZyb20gJy4vdXRpbHMvZmlsZS1leHBsb3Jlcic7XHJcbmltcG9ydCB7IHBhdGNoRmlsZUV4cGxvcmVyIGFzIHBhdGNoRmlsZUV4cGxvcmVyVXRpbCwgZ2V0QWxsRmlsZUV4cGxvcmVycywgRmlsZUV4cGxvcmVyVmlldyB9IGZyb20gJy4vdXRpbHMvZmlsZS1leHBsb3Jlci1wYXRjaCc7XHJcbmltcG9ydCB7IGdldEZvY3VzUGF0aCB9IGZyb20gJy4vdXRpbHMvZm9jdXMnO1xyXG5cclxuZXhwb3J0IGNsYXNzIEV4cGxvcmVyRm9jdXNQbHVnaW4gZXh0ZW5kcyBQbHVnaW4ge1xyXG5cdGlzRm9jdXM6IGJvb2xlYW47XHJcblx0Zm9jdXNlZFBhdGg6IHN0cmluZyB8IG51bGw7XHJcblx0c2V0dGluZ3MhOiBFeHBsb3JlckZvY3VzU2V0dGluZ3M7XHJcblx0ZmlsZUV4cGxvcmVySWNvbjogSFRNTEVsZW1lbnQgfCBudWxsO1xyXG5cclxuXHRjb25zdHJ1Y3RvcihhcHA6IEFwcCwgbWFuaWZlc3Q6IFBsdWdpbk1hbmlmZXN0KSB7XHJcblx0XHRzdXBlcihhcHAsIG1hbmlmZXN0KTtcclxuXHRcdHRoaXMuaXNGb2N1cyA9IGZhbHNlO1xyXG5cdFx0dGhpcy5mb2N1c2VkUGF0aCA9IG51bGw7XHJcblx0XHR0aGlzLmZpbGVFeHBsb3Jlckljb24gPSBudWxsO1xyXG5cdH1cclxuXHJcblx0YXN5bmMgb25sb2FkKCkge1xyXG5cdFx0YXdhaXQgdGhpcy5sb2FkU2V0dGluZ3MoKTtcclxuXHJcblx0XHR0aGlzLmFkZFNldHRpbmdUYWIobmV3IEV4cGxvcmVyRm9jdXNTZXR0aW5nVGFiKHRoaXMuYXBwLCB0aGlzKSk7XHJcblxyXG5cdFx0cmVnaXN0ZXJDb21tYW5kcyh0aGlzKTtcclxuXHJcblx0XHRpZiAodGhpcy5zZXR0aW5ncy5zaG93RmlsZUV4cGxvcmVySWNvbikge1xyXG5cdFx0XHR0aGlzLmFkZEZpbGVFeHBsb3Jlckljb24oKTtcclxuXHRcdH1cclxuXHJcblx0XHR0aGlzLmFwcC53b3Jrc3BhY2Uub25MYXlvdXRSZWFkeSgoKSA9PiB7XHJcblx0XHRcdHRoaXMucGF0Y2hBbGxGaWxlRXhwbG9yZXJzKCk7XHJcblx0XHRcdHRoaXMudXBkYXRlRm9jdXNNb2RlQ2xhc3NlcygpO1xyXG5cdFx0XHR0aGlzLnVwZGF0ZUF1dG9IaWRlU3R5bGVzKCk7XHJcblx0XHR9KTtcclxuXHJcblx0XHR0aGlzLmFwcC53b3Jrc3BhY2Uub24oXCJsYXlvdXQtY2hhbmdlXCIsICgpID0+IHtcclxuXHRcdFx0dGhpcy5wYXRjaEFsbEZpbGVFeHBsb3JlcnMoKTtcclxuXHRcdFx0dGhpcy51cGRhdGVGb2N1c01vZGVDbGFzc2VzKCk7XHJcblx0XHRcdHRoaXMudXBkYXRlQXV0b0hpZGVTdHlsZXMoKTtcclxuXHRcdH0pO1xyXG5cdH1cclxuXHJcblx0YXN5bmMgbG9hZFNldHRpbmdzKCkge1xyXG5cdFx0Y29uc3QgbG9hZGVkRGF0YSA9IGF3YWl0IHRoaXMubG9hZERhdGEoKSBhcyBQYXJ0aWFsPEV4cGxvcmVyRm9jdXNTZXR0aW5ncz4gfCBudWxsO1xyXG5cdFx0dGhpcy5zZXR0aW5ncyA9IE9iamVjdC5hc3NpZ24oe30sIERFRkFVTFRfU0VUVElOR1MsIGxvYWRlZERhdGEpO1xyXG5cdH1cclxuXHJcblx0YXN5bmMgc2F2ZVNldHRpbmdzKCkge1xyXG5cdFx0YXdhaXQgdGhpcy5zYXZlRGF0YSh0aGlzLnNldHRpbmdzKTtcclxuXHR9XHJcblxyXG5cdHRvZ2dsZUZvY3VzKHBhdGg6IHN0cmluZyB8IHVuZGVmaW5lZCkge1xyXG5cdFx0aWYgKHRoaXMuaXNGb2N1cykge1xyXG5cdFx0XHR0aGlzLmV4aXRGb2N1cygpO1xyXG5cdFx0fSBlbHNlIGlmIChwYXRoKSB7XHJcblx0XHRcdHRoaXMuZW50ZXJGb2N1cyhwYXRoKTtcclxuXHRcdH1cclxuXHR9XHJcblxyXG5cdGVudGVyRm9jdXMocGF0aDogc3RyaW5nKSB7XHJcblx0XHR0aGlzLmlzRm9jdXMgPSB0cnVlO1xyXG5cdFx0dGhpcy5mb2N1c2VkUGF0aCA9IHBhdGg7XHJcblx0XHRcclxuXHRcdC8vIFVwZGF0ZSBpY29uIGlmIGl0IGV4aXN0c1xyXG5cdFx0dGhpcy51cGRhdGVGaWxlRXhwbG9yZXJJY29uKCk7XHJcblx0XHRcclxuXHRcdC8vIFVwZGF0ZSBDU1MgY2xhc3Nlc1xyXG5cdFx0dGhpcy51cGRhdGVGb2N1c01vZGVDbGFzc2VzKCk7XHJcblx0XHRcclxuXHRcdC8vIFRyaWdnZXIgZmlsZSBleHBsb3JlciByZWZyZXNoIG9uIGFsbCBmaWxlIGV4cGxvcmVyIGluc3RhbmNlc1xyXG5cdFx0Y29uc3QgZmlsZUV4cGxvcmVycyA9IGdldEFsbEZpbGVFeHBsb3JlcnModGhpcyk7XHJcblx0XHRmaWxlRXhwbG9yZXJzLmZvckVhY2goZmlsZUV4cGxvcmVyID0+IHtcclxuXHRcdFx0aWYgKGZpbGVFeHBsb3Jlcj8ucmVxdWVzdFNvcnQpIHtcclxuXHRcdFx0XHRmaWxlRXhwbG9yZXIucmVxdWVzdFNvcnQoKTtcclxuXHRcdFx0fVxyXG5cdFx0fSk7XHJcblx0XHRcclxuXHRcdC8vIEZvcmNlIHJlZnJlc2ggYnkgbWFudWFsbHkgdXBkYXRpbmcgdmlzaWJpbGl0eSAoZXNwZWNpYWxseSBpbXBvcnRhbnQgb24gbW9iaWxlKVxyXG5cdFx0Ly8gVXNlIHNldFRpbWVvdXQgdG8gZW5zdXJlIERPTSBpcyByZWFkeSBhZnRlciByZXF1ZXN0U29ydFxyXG5cdFx0c2V0VGltZW91dCgoKSA9PiB7XHJcblx0XHRcdGZpbGVFeHBsb3JlcnMuZm9yRWFjaChmaWxlRXhwbG9yZXIgPT4ge1xyXG5cdFx0XHRcdHRoaXMucmVmcmVzaEZpbGVFeHBsb3JlclZpc2liaWxpdHkoZmlsZUV4cGxvcmVyKTtcclxuXHRcdFx0fSk7XHJcblx0XHR9LCAwKTtcclxuXHR9XHJcblxyXG5cdHBhdGNoQWxsRmlsZUV4cGxvcmVycygpOiB2b2lkIHtcclxuXHRcdC8vIFBhdGNoIHRoZSBwcm90b3R5cGUgKG9uY2UpIGFuZCBtYXJrIGFsbCBpbnN0YW5jZXNcclxuXHRcdHBhdGNoRmlsZUV4cGxvcmVyVXRpbCh0aGlzKTtcclxuXHRcdGNvbnN0IGZpbGVFeHBsb3JlcnMgPSBnZXRBbGxGaWxlRXhwbG9yZXJzKHRoaXMpO1xyXG5cdFx0ZmlsZUV4cGxvcmVycy5mb3JFYWNoKGZpbGVFeHBsb3JlciA9PiB7XHJcblx0XHRcdGZpbGVFeHBsb3Jlci5maWxlRXhwbG9yZXJQbHVzUGF0Y2hlZCA9IHRydWU7XHJcblx0XHR9KTtcclxuXHR9XHJcblxyXG5cdGV4aXRGb2N1cygpIHtcclxuXHRcdHRoaXMuaXNGb2N1cyA9IGZhbHNlO1xyXG5cdFx0dGhpcy5mb2N1c2VkUGF0aCA9IG51bGw7XHJcblxyXG5cdFx0Ly8gVXBkYXRlIGljb24gaWYgaXQgZXhpc3RzXHJcblx0XHR0a
Line truncated
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"id":"explorer-focus","name":"Explorer Focus","version":"0.1.9","minAppVersion":"1.11.0","description":"Focus on a specific file or folder in the file explorer.","author":"David V. Kimball","authorUrl":"https://davidvkimball.com","fundingUrl":"https://patreon.com/davidvkimball","isDesktopOnly":false}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/* No custom styles needed - using native Obsidian classes */
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"historyPropertyName": "aliases",
|
||||||
|
"ignoreRegexes": [
|
||||||
|
"^_",
|
||||||
|
"^Untitled$",
|
||||||
|
"^Untitled \\d+$"
|
||||||
|
],
|
||||||
|
"timeoutSeconds": 5,
|
||||||
|
"caseSensitive": false,
|
||||||
|
"autoCreateFrontmatter": true,
|
||||||
|
"includeFolders": [],
|
||||||
|
"excludeFolders": [],
|
||||||
|
"fileExtensions": [
|
||||||
|
"md",
|
||||||
|
"mdx"
|
||||||
|
],
|
||||||
|
"trackFolderRenames": "index",
|
||||||
|
"excludePropertyName": ""
|
||||||
|
}
|
||||||
@@ -0,0 +1,475 @@
|
|||||||
|
/*
|
||||||
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||||
|
if you want to view the source, please visit the github repository of this plugin
|
||||||
|
*/
|
||||||
|
|
||||||
|
var __defProp = Object.defineProperty;
|
||||||
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||||
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||||
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||||
|
var __export = (target, all) => {
|
||||||
|
for (var name in all)
|
||||||
|
__defProp(target, name, { get: all[name], enumerable: true });
|
||||||
|
};
|
||||||
|
var __copyProps = (to, from, except, desc) => {
|
||||||
|
if (from && typeof from === "object" || typeof from === "function") {
|
||||||
|
for (let key of __getOwnPropNames(from))
|
||||||
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||||
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
};
|
||||||
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||||
|
|
||||||
|
// src/main.ts
|
||||||
|
var main_exports = {};
|
||||||
|
__export(main_exports, {
|
||||||
|
default: () => FileNameHistoryPlugin
|
||||||
|
});
|
||||||
|
module.exports = __toCommonJS(main_exports);
|
||||||
|
var import_obsidian3 = require("obsidian");
|
||||||
|
|
||||||
|
// src/settings.ts
|
||||||
|
var DEFAULT_SETTINGS = {
|
||||||
|
historyPropertyName: "aliases",
|
||||||
|
ignoreRegexes: ["^_", "^Untitled$", "^Untitled \\d+$"],
|
||||||
|
timeoutSeconds: 5,
|
||||||
|
caseSensitive: false,
|
||||||
|
autoCreateFrontmatter: true,
|
||||||
|
includeFolders: [],
|
||||||
|
excludeFolders: [],
|
||||||
|
fileExtensions: ["md"],
|
||||||
|
trackFolderRenames: "",
|
||||||
|
excludePropertyName: ""
|
||||||
|
};
|
||||||
|
|
||||||
|
// src/ui/settings-tab.ts
|
||||||
|
var import_obsidian = require("obsidian");
|
||||||
|
var FileNameHistorySettingTab = class extends import_obsidian.PluginSettingTab {
|
||||||
|
constructor(app, plugin) {
|
||||||
|
super(app, plugin);
|
||||||
|
this.icon = "lucide-forward";
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
display() {
|
||||||
|
const { containerEl } = this;
|
||||||
|
containerEl.empty();
|
||||||
|
const saveSettings = () => {
|
||||||
|
void this.plugin.saveSettings();
|
||||||
|
};
|
||||||
|
const generalGroup = new import_obsidian.SettingGroup(containerEl);
|
||||||
|
generalGroup.addSetting((setting) => {
|
||||||
|
setting.setName("History property name").setDesc("The list property to store file name history.").addText(
|
||||||
|
(text) => text.setPlaceholder("aliases").setValue(this.plugin.settings.historyPropertyName).onChange((value) => {
|
||||||
|
this.plugin.settings.historyPropertyName = value || "aliases";
|
||||||
|
saveSettings();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
generalGroup.addSetting((setting) => {
|
||||||
|
setting.setName("Timeout seconds").setDesc("Time in seconds the name must be stable before adding to the configured property.").addSlider(
|
||||||
|
(slider) => slider.setLimits(1, 20, 1).setValue(this.plugin.settings.timeoutSeconds).setDynamicTooltip().onChange((value) => {
|
||||||
|
this.plugin.settings.timeoutSeconds = value;
|
||||||
|
saveSettings();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
generalGroup.addSetting((setting) => {
|
||||||
|
setting.setName("Case-sensitive uniqueness").setDesc("If enabled, treat case differences as unique values in the configured property.").addToggle(
|
||||||
|
(toggle) => toggle.setValue(this.plugin.settings.caseSensitive).onChange((value) => {
|
||||||
|
this.plugin.settings.caseSensitive = value;
|
||||||
|
saveSettings();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
generalGroup.addSetting((setting) => {
|
||||||
|
setting.setName("Auto-create history property").setDesc("Automatically create the configured property if missing.").addToggle(
|
||||||
|
(toggle) => toggle.setValue(this.plugin.settings.autoCreateFrontmatter).onChange((value) => {
|
||||||
|
this.plugin.settings.autoCreateFrontmatter = value;
|
||||||
|
saveSettings();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
generalGroup.addSetting((setting) => {
|
||||||
|
setting.setName("File extensions").setDesc("Comma-separated list of file extensions to track.").addText(
|
||||||
|
(text) => text.setPlaceholder("Md, txt").setValue(this.plugin.settings.fileExtensions.join(",")).onChange((value) => {
|
||||||
|
this.plugin.settings.fileExtensions = value.split(",").map((s) => s.trim()).filter((s) => s);
|
||||||
|
saveSettings();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
const filteringGroup = new import_obsidian.SettingGroup(containerEl).setHeading("Filtering");
|
||||||
|
const foldersGroup = new import_obsidian.SettingGroup(containerEl).setHeading("Folders");
|
||||||
|
const advancedGroup = new import_obsidian.SettingGroup(containerEl).setHeading("Advanced");
|
||||||
|
filteringGroup.addSetting((setting) => {
|
||||||
|
setting.setName("Ignore regex patterns").setDesc(
|
||||||
|
"Comma-separated regex patterns for file names or immediate parent folder names to ignore (e.g., ^_ for underscore prefixes, ^untitled$ for untitled). Leave empty to disable."
|
||||||
|
).addText(
|
||||||
|
(text) => text.setPlaceholder("^_, ^untitled$, ^untitled \\d+$").setValue(this.plugin.settings.ignoreRegexes.join(",")).onChange((value) => {
|
||||||
|
this.plugin.settings.ignoreRegexes = value.split(",").map((s) => s.trim()).filter((s) => s);
|
||||||
|
saveSettings();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
filteringGroup.addSetting((setting) => {
|
||||||
|
setting.setName("Exclude property name").setDesc(
|
||||||
|
"Name of a boolean property to check in files. Files with this property set to true will be excluded from tracking. Takes priority over folder filtering."
|
||||||
|
).addText(
|
||||||
|
(text) => text.setPlaceholder("Skip-rename-tracking").setValue(this.plugin.settings.excludePropertyName).onChange((value) => {
|
||||||
|
this.plugin.settings.excludePropertyName = value;
|
||||||
|
saveSettings();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
foldersGroup.addSetting((setting) => {
|
||||||
|
setting.setName("Include folders").setDesc(
|
||||||
|
"Comma-separated list of folder paths to include. If empty, all folders are included. Use {vault} or {root} to include only files directly in the vault root (no subfolders)."
|
||||||
|
).addText(
|
||||||
|
(text) => text.setValue(this.plugin.settings.includeFolders.join(",")).onChange((value) => {
|
||||||
|
this.plugin.settings.includeFolders = value.split(",").map((s) => s.trim()).filter((s) => s);
|
||||||
|
saveSettings();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
foldersGroup.addSetting((setting) => {
|
||||||
|
setting.setName("Exclude folders").setDesc(
|
||||||
|
'Comma-separated list of folder paths to exclude. Supports wildcards: use "folder/*" to exclude direct children, "folder/**" to exclude all descendants. Use {vault} or {root} to exclude files directly in the vault root.'
|
||||||
|
).addText(
|
||||||
|
(text) => text.setValue(this.plugin.settings.excludeFolders.join(",")).onChange((value) => {
|
||||||
|
this.plugin.settings.excludeFolders = value.split(",").map((s) => s.trim()).filter((s) => s);
|
||||||
|
saveSettings();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
advancedGroup.addSetting((setting) => {
|
||||||
|
setting.setName("Track folder renames for specific file name").setDesc(
|
||||||
|
"If a Markdown file matches this file name, store old immediate parent folder names in the configured property when parent folders are renamed."
|
||||||
|
).addText(
|
||||||
|
(text) => text.setPlaceholder("Index").setValue(this.plugin.settings.trackFolderRenames).onChange((value) => {
|
||||||
|
this.plugin.settings.trackFolderRenames = value;
|
||||||
|
saveSettings();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// src/utils/history-processor.ts
|
||||||
|
var import_obsidian2 = require("obsidian");
|
||||||
|
var HistoryProcessor = class {
|
||||||
|
constructor(app, settings) {
|
||||||
|
this.app = app;
|
||||||
|
this.settings = settings;
|
||||||
|
}
|
||||||
|
async processAliasesManually(path, queue) {
|
||||||
|
const file = this.app.vault.getFileByPath(path);
|
||||||
|
if (!file) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const regexes = [];
|
||||||
|
for (const regexStr of this.settings.ignoreRegexes) {
|
||||||
|
try {
|
||||||
|
regexes.push(new RegExp(regexStr));
|
||||||
|
} catch (e) {
|
||||||
|
console.error(`Invalid ignore regex: ${regexStr}`, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const toAdd = [];
|
||||||
|
const currentBasename = file.basename;
|
||||||
|
const currentBasenameLower = currentBasename.toLowerCase();
|
||||||
|
for (const name of queue) {
|
||||||
|
if (regexes.some((re) => re.test(name))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const nameLower = name.toLowerCase();
|
||||||
|
if (this.settings.caseSensitive && name === currentBasename || !this.settings.caseSensitive && nameLower === currentBasenameLower) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
toAdd.push(name);
|
||||||
|
}
|
||||||
|
if (toAdd.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let content = await this.app.vault.read(file);
|
||||||
|
const frontmatterRegex = /^---\n([\s\S]*?)\n---\n/;
|
||||||
|
const match = content.match(frontmatterRegex);
|
||||||
|
let frontmatter = {};
|
||||||
|
let frontmatterText = "";
|
||||||
|
let bodyContent = content;
|
||||||
|
if (match) {
|
||||||
|
frontmatterText = match[1];
|
||||||
|
bodyContent = content.slice(match[0].length);
|
||||||
|
try {
|
||||||
|
const parsed = (0, import_obsidian2.parseYaml)(frontmatterText);
|
||||||
|
frontmatter = parsed && typeof parsed === "object" ? parsed : {};
|
||||||
|
} catch (e) {
|
||||||
|
console.error(`Error parsing properties:`, e);
|
||||||
|
frontmatter = {};
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
bodyContent = content;
|
||||||
|
}
|
||||||
|
let aliases = frontmatter[this.settings.historyPropertyName];
|
||||||
|
if (!Array.isArray(aliases)) {
|
||||||
|
const hasFrontmatter = Object.keys(frontmatter).length > 0;
|
||||||
|
if (hasFrontmatter && !this.settings.autoCreateFrontmatter) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
aliases = [];
|
||||||
|
}
|
||||||
|
const aliasesArray = aliases;
|
||||||
|
const existing = new Set(
|
||||||
|
this.settings.caseSensitive ? aliasesArray : aliasesArray.map((a) => a.toLowerCase())
|
||||||
|
);
|
||||||
|
let added = false;
|
||||||
|
for (const name of toAdd) {
|
||||||
|
const checkName = this.settings.caseSensitive ? name : name.toLowerCase();
|
||||||
|
if (!existing.has(checkName)) {
|
||||||
|
aliasesArray.push(name);
|
||||||
|
existing.add(checkName);
|
||||||
|
added = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!added) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
frontmatter[this.settings.historyPropertyName] = aliasesArray;
|
||||||
|
const newFrontmatterText = (0, import_obsidian2.stringifyYaml)(frontmatter).trim();
|
||||||
|
const newContent = `---
|
||||||
|
${newFrontmatterText}
|
||||||
|
---
|
||||||
|
${bodyContent}`;
|
||||||
|
await this.app.vault.modify(file, newContent);
|
||||||
|
}
|
||||||
|
async processAliases(path, queue) {
|
||||||
|
const file = this.app.vault.getFileByPath(path);
|
||||||
|
if (!file) return;
|
||||||
|
const regexes = [];
|
||||||
|
for (const regexStr of this.settings.ignoreRegexes) {
|
||||||
|
try {
|
||||||
|
regexes.push(new RegExp(regexStr));
|
||||||
|
} catch (e) {
|
||||||
|
console.error(`Invalid ignore regex: ${regexStr}`, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const toAdd = [];
|
||||||
|
const currentBasename = file.basename;
|
||||||
|
const currentBasenameLower = currentBasename.toLowerCase();
|
||||||
|
for (const name of queue) {
|
||||||
|
if (regexes.some((re) => re.test(name))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const nameLower = name.toLowerCase();
|
||||||
|
if (this.settings.caseSensitive && name === currentBasename || !this.settings.caseSensitive && nameLower === currentBasenameLower) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
toAdd.push(name);
|
||||||
|
}
|
||||||
|
if (toAdd.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (file.extension !== "md") {
|
||||||
|
await this.processAliasesManually(path, queue);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await this.app.fileManager.processFrontMatter(file, (fm) => {
|
||||||
|
let aliases = fm[this.settings.historyPropertyName];
|
||||||
|
if (!Array.isArray(aliases)) {
|
||||||
|
const hasFrontmatter = Object.keys(fm).length > 0;
|
||||||
|
if (hasFrontmatter && !this.settings.autoCreateFrontmatter) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
aliases = [];
|
||||||
|
fm[this.settings.historyPropertyName] = aliases;
|
||||||
|
}
|
||||||
|
const aliasesArray = aliases;
|
||||||
|
const existing = new Set(
|
||||||
|
this.settings.caseSensitive ? aliasesArray : aliasesArray.map((a) => a.toLowerCase())
|
||||||
|
);
|
||||||
|
for (const name of toAdd) {
|
||||||
|
const checkName = this.settings.caseSensitive ? name : name.toLowerCase();
|
||||||
|
if (!existing.has(checkName)) {
|
||||||
|
aliasesArray.push(name);
|
||||||
|
existing.add(checkName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// src/utils/path-utils.ts
|
||||||
|
function getBasename(path) {
|
||||||
|
const name = path.split("/").pop() || "";
|
||||||
|
return name.replace(/\.[^/.]+$/, "");
|
||||||
|
}
|
||||||
|
function getImmediateParentName(path) {
|
||||||
|
const parts = path.split("/");
|
||||||
|
parts.pop();
|
||||||
|
return parts.pop() || "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// src/main.ts
|
||||||
|
var FileNameHistoryPlugin = class extends import_obsidian3.Plugin {
|
||||||
|
constructor() {
|
||||||
|
super(...arguments);
|
||||||
|
this.debounceMap = /* @__PURE__ */ new Map();
|
||||||
|
}
|
||||||
|
async onload() {
|
||||||
|
await this.loadSettings();
|
||||||
|
this.historyProcessor = new HistoryProcessor(this.app, this.settings);
|
||||||
|
this.addSettingTab(new FileNameHistorySettingTab(this.app, this));
|
||||||
|
this.registerEvent(
|
||||||
|
this.app.vault.on("rename", (file, oldPath) => {
|
||||||
|
this.handleRename(file, oldPath);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
onunload() {
|
||||||
|
for (const entry of this.debounceMap.values()) {
|
||||||
|
if (entry.timeoutId !== 0) {
|
||||||
|
window.clearTimeout(entry.timeoutId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.debounceMap.clear();
|
||||||
|
}
|
||||||
|
async loadSettings() {
|
||||||
|
const loadedData = await this.loadData();
|
||||||
|
this.settings = Object.assign({}, DEFAULT_SETTINGS, loadedData);
|
||||||
|
}
|
||||||
|
async saveSettings() {
|
||||||
|
await this.saveData(this.settings);
|
||||||
|
}
|
||||||
|
isPathInFolder(path, folder) {
|
||||||
|
if (folder.includes("{vault}") || folder.includes("{root}")) {
|
||||||
|
const resolvedFolder = folder.replace(/\{vault\}|\{root\}/g, "");
|
||||||
|
if (resolvedFolder === "" || resolvedFolder === "/") {
|
||||||
|
const isVaultRoot = !path.includes("/");
|
||||||
|
return isVaultRoot;
|
||||||
|
}
|
||||||
|
return path.startsWith(resolvedFolder + "/") || path === resolvedFolder;
|
||||||
|
}
|
||||||
|
return path.startsWith(folder + "/") || path === folder;
|
||||||
|
}
|
||||||
|
isPathExcluded(path, excludePattern) {
|
||||||
|
if (excludePattern.includes("{vault}") || excludePattern.includes("{root}")) {
|
||||||
|
const resolvedPattern = excludePattern.replace(/\{vault\}|\{root\}/g, "");
|
||||||
|
if (resolvedPattern === "" || resolvedPattern === "/") {
|
||||||
|
return !path.includes("/");
|
||||||
|
}
|
||||||
|
excludePattern = resolvedPattern;
|
||||||
|
}
|
||||||
|
if (excludePattern.endsWith("/**")) {
|
||||||
|
const baseFolder = excludePattern.slice(0, -3);
|
||||||
|
return path.startsWith(baseFolder + "/") || path === baseFolder;
|
||||||
|
} else if (excludePattern.endsWith("/*")) {
|
||||||
|
const baseFolder = excludePattern.slice(0, -2);
|
||||||
|
if (!path.startsWith(baseFolder + "/")) {
|
||||||
|
return path === baseFolder;
|
||||||
|
}
|
||||||
|
const pathAfterBase = path.slice(baseFolder.length + 1);
|
||||||
|
return pathAfterBase.includes("/");
|
||||||
|
}
|
||||||
|
return path.startsWith(excludePattern + "/") || path === excludePattern;
|
||||||
|
}
|
||||||
|
handleRename(newFile, oldPath) {
|
||||||
|
if (!(newFile instanceof import_obsidian3.TFile)) return;
|
||||||
|
if (!this.settings.fileExtensions.includes(newFile.extension)) return;
|
||||||
|
const oldBasename = getBasename(oldPath);
|
||||||
|
const newBasename = newFile.basename;
|
||||||
|
const oldImmediateParentName = getImmediateParentName(oldPath);
|
||||||
|
const newImmediateParentName = getImmediateParentName(newFile.path);
|
||||||
|
const isNameChange = this.settings.caseSensitive ? oldBasename !== newBasename : oldBasename.toLowerCase() !== newBasename.toLowerCase();
|
||||||
|
const isFolderChange = oldImmediateParentName !== newImmediateParentName && !isNameChange;
|
||||||
|
if (!isNameChange && !isFolderChange) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const path = newFile.path;
|
||||||
|
if (this.settings.excludePropertyName && this.settings.excludePropertyName.trim() !== "") {
|
||||||
|
const cache = this.app.metadataCache.getFileCache(newFile);
|
||||||
|
const frontmatter = cache == null ? void 0 : cache.frontmatter;
|
||||||
|
if (frontmatter && frontmatter[this.settings.excludePropertyName] === true) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.settings.includeFolders.length > 0) {
|
||||||
|
if (!this.settings.includeFolders.some((f) => this.isPathInFolder(path, f))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const isIndexFileForFolderRename = isFolderChange && this.settings.trackFolderRenames && this.settings.trackFolderRenames.trim() !== "" && (this.settings.caseSensitive ? newFile.basename === this.settings.trackFolderRenames : newFile.basename.toLowerCase() === this.settings.trackFolderRenames.toLowerCase());
|
||||||
|
for (const excludePattern of this.settings.excludeFolders) {
|
||||||
|
if (this.isPathExcluded(path, excludePattern)) {
|
||||||
|
if (isIndexFileForFolderRename && excludePattern.endsWith("/*") && !excludePattern.endsWith("/**")) {
|
||||||
|
const baseFolder = excludePattern.slice(0, -2);
|
||||||
|
if (path.startsWith(baseFolder + "/")) {
|
||||||
|
const pathAfterBase = path.slice(baseFolder.length + 1);
|
||||||
|
const pathParts = pathAfterBase.split("/");
|
||||||
|
if (pathParts.length === 2) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const regexes = [];
|
||||||
|
for (const regexStr of this.settings.ignoreRegexes) {
|
||||||
|
try {
|
||||||
|
regexes.push(new RegExp(regexStr));
|
||||||
|
} catch (e) {
|
||||||
|
console.error(`Invalid ignore regex: ${regexStr}`, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let toQueue = null;
|
||||||
|
if (isNameChange) {
|
||||||
|
if (regexes.some((re) => re.test(oldBasename) || re.test(newBasename))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
toQueue = oldBasename;
|
||||||
|
} else if (isFolderChange && this.settings.trackFolderRenames && this.settings.trackFolderRenames.trim() !== "") {
|
||||||
|
const currentBasename = newFile.basename;
|
||||||
|
const matchesFilename = this.settings.caseSensitive ? currentBasename === this.settings.trackFolderRenames : currentBasename.toLowerCase() === this.settings.trackFolderRenames.toLowerCase();
|
||||||
|
if (!matchesFilename) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (oldImmediateParentName === "" || newImmediateParentName === "") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (regexes.some((re) => re.test(oldImmediateParentName) || re.test(newImmediateParentName))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
toQueue = oldImmediateParentName;
|
||||||
|
}
|
||||||
|
if (!toQueue) return;
|
||||||
|
let existingEntry = this.debounceMap.get(newFile.path);
|
||||||
|
if (!existingEntry) {
|
||||||
|
existingEntry = this.debounceMap.get(oldPath);
|
||||||
|
if (existingEntry) {
|
||||||
|
this.debounceMap.delete(oldPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (existingEntry) {
|
||||||
|
if (existingEntry.timeoutId !== 0) {
|
||||||
|
window.clearTimeout(existingEntry.timeoutId);
|
||||||
|
}
|
||||||
|
toQueue = Array.from(existingEntry.queue)[0];
|
||||||
|
}
|
||||||
|
const entry = {
|
||||||
|
queue: /* @__PURE__ */ new Set([toQueue]),
|
||||||
|
timeoutId: 0,
|
||||||
|
currentPath: newFile.path
|
||||||
|
};
|
||||||
|
entry.timeoutId = window.setTimeout(() => {
|
||||||
|
void (async () => {
|
||||||
|
try {
|
||||||
|
await this.historyProcessor.processAliases(entry.currentPath, entry.queue);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error processing aliases:", error);
|
||||||
|
}
|
||||||
|
this.debounceMap.delete(entry.currentPath);
|
||||||
|
})();
|
||||||
|
}, this.settings.timeoutSeconds * 1e3);
|
||||||
|
this.debounceMap.set(newFile.path, entry);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjL21haW4udHMiLCAic3JjL3NldHRpbmdzLnRzIiwgInNyYy91aS9zZXR0aW5ncy10YWIudHMiLCAic3JjL3V0aWxzL2hpc3RvcnktcHJvY2Vzc29yLnRzIiwgInNyYy91dGlscy9wYXRoLXV0aWxzLnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyJpbXBvcnQgeyBQbHVnaW4sIFRBYnN0cmFjdEZpbGUsIFRGaWxlIH0gZnJvbSAnb2JzaWRpYW4nO1xuaW1wb3J0IHsgRmlsZU5hbWVIaXN0b3J5U2V0dGluZ3MsIERFRkFVTFRfU0VUVElOR1MgfSBmcm9tICcuL3NldHRpbmdzJztcbmltcG9ydCB7IEZpbGVOYW1lSGlzdG9yeVNldHRpbmdUYWIgfSBmcm9tICcuL3VpL3NldHRpbmdzLXRhYic7XG5pbXBvcnQgeyBIaXN0b3J5UHJvY2Vzc29yIH0gZnJvbSAnLi91dGlscy9oaXN0b3J5LXByb2Nlc3Nvcic7XG5pbXBvcnQgeyBnZXRCYXNlbmFtZSwgZ2V0SW1tZWRpYXRlUGFyZW50TmFtZSB9IGZyb20gJy4vdXRpbHMvcGF0aC11dGlscyc7XG5cbmV4cG9ydCBkZWZhdWx0IGNsYXNzIEZpbGVOYW1lSGlzdG9yeVBsdWdpbiBleHRlbmRzIFBsdWdpbiB7XG4gIHNldHRpbmdzOiBGaWxlTmFtZUhpc3RvcnlTZXR0aW5ncztcbiAgcHJpdmF0ZSBkZWJvdW5jZU1hcDogTWFwPHN0cmluZywgeyBxdWV1ZTogU2V0PHN0cmluZz47IHRpbWVvdXRJZDogbnVtYmVyOyBjdXJyZW50UGF0aDogc3RyaW5nIH0+ID0gbmV3IE1hcCgpO1xuICBwcml2YXRlIGhpc3RvcnlQcm9jZXNzb3I6IEhpc3RvcnlQcm9jZXNzb3I7XG5cbiAgYXN5bmMgb25sb2FkKCkge1xuICAgIGF3YWl0IHRoaXMubG9hZFNldHRpbmdzKCk7XG4gICAgdGhpcy5oaXN0b3J5UHJvY2Vzc29yID0gbmV3IEhpc3RvcnlQcm9jZXNzb3IodGhpcy5hcHAsIHRoaXMuc2V0dGluZ3MpO1xuICAgIHRoaXMuYWRkU2V0dGluZ1RhYihuZXcgRmlsZU5hbWVIaXN0b3J5U2V0dGluZ1RhYih0aGlzLmFwcCwgdGhpcykpO1xuICAgIHRoaXMucmVnaXN0ZXJFdmVudChcbiAgICAgIHRoaXMuYXBwLnZhdWx0Lm9uKCdyZW5hbWUnLCAoZmlsZTogVEFic3RyYWN0RmlsZSwgb2xkUGF0aDogc3RyaW5nKSA9PiB7XG4gICAgICAgIHRoaXMuaGFuZGxlUmVuYW1lKGZpbGUsIG9sZFBhdGgpO1xuICAgICAgfSlcbiAgICApO1xuICB9XG5cbiAgb251bmxvYWQoKSB7XG4gICAgLy8gQ2xlYXIgYW55IHBlbmRpbmcgdGltZW91dHNcbiAgICBmb3IgKGNvbnN0IGVudHJ5IG9mIHRoaXMuZGVib3VuY2VNYXAudmFsdWVzKCkpIHtcbiAgICAgIGlmIChlbnRyeS50aW1lb3V0SWQgIT09IDApIHtcbiAgICAgICAgd2luZG93LmNsZWFyVGltZW91dChlbnRyeS50aW1lb3V0SWQpO1xuICAgICAgfVxuICAgIH1cbiAgICB0aGlzLmRlYm91bmNlTWFwLmNsZWFyKCk7XG4gIH1cblxuICBhc3luYyBsb2FkU2V0dGluZ3MoKSB7XG4gICAgY29uc3QgbG9hZGVkRGF0YSA9IChhd2FpdCB0aGlzLmxvYWREYXRhKCkpIGFzIFBhcnRpYWw8RmlsZU5hbWVIaXN0b3J5U2V0dGluZ3M+IHwgbnVsbDtcbiAgICB0aGlzLnNldHRpbmdzID0gT2JqZWN0LmFzc2lnbih7fSwgREVGQVVMVF9TRVRUSU5HUywgbG9hZGVkRGF0YSk7XG4gIH1cblxuICBhc3luYyBzYXZlU2V0dGluZ3MoKSB7XG4gICAgYXdhaXQgdGhpcy5zYXZlRGF0YSh0aGlzLnNldHRpbmdzKTtcbiAgfVxuXG4gIHByaXZhdGUgaXNQYXRoSW5Gb2xkZXIocGF0aDogc3RyaW5nLCBmb2xkZXI6IHN0cmluZyk6IGJvb2xlYW4ge1xuICAgIC8vIEhhbmRsZSB2YXVsdCByb290IHZhcmlhYmxlXG4gICAgaWYgKGZvbGRlci5pbmNsdWRlcygne3ZhdWx0fScpIHx8IGZvbGRlci5pbmNsdWRlcygne3Jvb3R9JykpIHtcbiAgICAgIGNvbnN0IHJlc29sdmVkRm9sZGVyID0gZm9sZGVyLnJlcGxhY2UoL1xce3ZhdWx0XFx9fFxce3Jvb3RcXH0vZywgJycpO1xuICAgICAgLy8gSWYgdGhlIGZvbGRlciBpcyBqdXN0IHRoZSB2YXJpYWJsZSwgaXQgbWVhbnMgaW5jbHVkZSBvbmx5IHZhdWx0IHJvb3QgZmlsZXNcbiAgICAgIGlmIChyZXNvbHZlZEZvbGRlciA9PT0gJycgfHwgcmVzb2x2ZWRGb2xkZXIgPT09ICcvJykge1xuICAgICAgICAvLyBJbmNsdWRlIG9ubHkgZmlsZXMgZGlyZWN0bHkgaW4gdGhlIHZhdWx0IHJvb3QgKG5vIHN1YmZvbGRlcnMpXG4gICAgICAgIGNvbnN0IGlzVmF1bHRSb290ID0gIXBhdGguaW5jbHVkZXMoJy8nKTtcbiAgICAgICAgcmV0dXJuIGlzVmF1bHRSb290O1xuICAgICAgfVxuICAgICAgLy8gT3RoZXJ3aXNlLCByZXBsYWNlIHRoZSB2YXJpYWJsZSBhbmQgY2hlY2sgbm9ybWFsbHlcbiAgICAgIHJldHVybiBwYXRoLnN0YXJ0c1dpdGgocmVzb2x2ZWRGb2xkZXIgKyAnLycpIHx8IHBhdGggPT09IHJlc29sdmVkRm9sZGVyO1xuICAgIH1cblxuICAgIC8vIE5vcm1hbCBmb2xkZXIgbWF0Y2hpbmdcbiAgICByZXR1cm4gcGF0aC5zdGFydHNXaXRoKGZvbGRlciArICcvJykgfHwgcGF0aCA9PT0gZm9sZGVyO1xuICB9XG5cbiAgcHJpdmF0ZSBpc1BhdGhFeGNsdWRlZChwYXRoOiBzdHJpbmcsIGV4Y2x1ZGVQYXR0ZXJuOiBzdHJpbmcpOiBib29sZWFuIHtcbiAgICAvLyBIYW5kbGUgdmF1bHQgcm9vdCB2YXJpYWJsZVxuICAgIGlmIChleGNsdWRlUGF0dGVybi5pbmNsdWRlcygne3ZhdWx0fScpIHx8IGV4Y2x1ZGVQYXR0ZXJuLmluY2x1ZGVzKCd7cm9vdH0nKSkge1xuICAgICAgY29uc3QgcmVzb2x2ZWRQYXR0ZXJuID0gZXhjbHVkZVBhdHRlcm4ucmVwbGFjZSgvXFx7dmF1bHRcXH18XFx7cm9vdFxcfS9nLCAnJyk7XG4gICAgICBpZiAocmVzb2x2ZWRQYXR0ZXJuID09PSAnJyB8fCByZXNvbHZlZFBhdHRlcm4gPT09ICcvJykge1xuICAgICAgICAvLyBFeGNsdWRlIG9ubHkgZmlsZXMgZGlyZWN0bHkgaW4gdGhlIHZhdWx0IHJvb3QgKG5vIHN1YmZvbGRlcnMpXG4gICAgICAgIHJldHVybiAhcGF0aC5pbmNsdWRlcygnLycpO1xuICAgICAgfVxuICAgICAgZXhjbHVkZVBhdHRlcm4gPSByZXNvbHZlZFBhdHRlcm47XG4gICAgfVxuXG4gICAgLy8gSGFuZGxlIHdpbGRjYXJkc1xuICAgIGlmIChleGNsdWRlUGF0dGVybi5lbmRzV2l0aCgnLyoqJykpIHtcbiAgICAgIC8vIFJlY3Vyc2l2ZSBleGNsdXNpb246IGRvY3MvKiogbWF0Y2hlcyBkb2NzIGFuZCBhbGwgc3ViZm9sZGVyc1xuICAgICAgY29uc3QgYmFzZUZvbGRlciA9IGV4Y2x1ZGVQYXR0ZXJuLnNsaWNlKDAsIC0zKTtcbiAgICAgIHJldHVybiBwYXRoLnN0YXJ0c1dpdGgoYmFzZUZvbGRlciArICcvJykgfHwgcGF0aCA9PT0gYmFzZUZvbGRlcjtcbiAgICB9IGVsc2UgaWYgKGV4Y2x1ZGVQYXR0ZXJuLmVuZHNXaXRoKCcvKicpKSB7XG4gICAgICAvLyBEaXJlY3QgY2hpbGRyZW4gb25seTogZG9jcy8qIG1hdGNoZXMgZG9jcy9zdWJmb2xkZXIgYnV0IG5vdCBkb2NzL3N1YmZvbGRlci9uZXN0ZWRcbiAgICAgIC8vIFNob3VsZCBleGNsdWRlIGZpbGVzIGluIHN1YmZvbGRlcnMsIGJ1dCBOT1QgZmlsZXMgZGlyZWN0bHkgaW4gdGhlIGJhc2UgZm9sZGVyXG4gICAgICBjb25zdCBiYXNlRm9sZGVyID0gZXhjbHVkZVBhdHRlcm4uc2xpY2UoMCwgLTIpO1xuICAgICAgaWYgKCFwYXRoLnN0YXJ0c1dpdGgoYmFzZUZvbGRlciArICcvJykpIHtcbiAgICAgICAgcmV0dXJuIHBhdGggPT09IGJhc2VGb2xkZXI7XG4gICAgICB9XG4gICAgICBjb25zdCBwYXRoQWZ0ZXJCYXNlID0gcGF0aC5zbGljZShiYXNlRm9sZGVyLmxlbmd0aCArIDEpO1xuICAgICAgLy8gRXhjbHVkZSBpZiBwYXRoIGlzI
Line truncated
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"id":"file-name-history","name":"File Name History","version":"0.2.7","minAppVersion":"1.11.0","description":"Store file name or folder name change history into note properties.","author":"David V. Kimball","authorUrl":"https://davidvkimball.com","fundingUrl":"https://patreon.com/davidvkimball","isDesktopOnly":false}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/* Scoped to only this plugin's settings container to avoid affecting other plugins */
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
{
|
||||||
|
"syncFolderName": true,
|
||||||
|
"ctrlKey": true,
|
||||||
|
"altKey": false,
|
||||||
|
"hideFolderNote": true,
|
||||||
|
"templatePath": "",
|
||||||
|
"autoCreate": false,
|
||||||
|
"autoCreateFocusFiles": true,
|
||||||
|
"autoCreateForAttachmentFolder": false,
|
||||||
|
"autoCreateForFiles": false,
|
||||||
|
"enableCollapsing": false,
|
||||||
|
"excludeFolders": [],
|
||||||
|
"whitelistFolders": [],
|
||||||
|
"showDeleteConfirmation": true,
|
||||||
|
"underlineFolder": true,
|
||||||
|
"stopWhitespaceCollapsing": true,
|
||||||
|
"underlineFolderInPath": true,
|
||||||
|
"openFolderNoteOnClickInPath": true,
|
||||||
|
"openInNewTab": false,
|
||||||
|
"focusExistingTab": false,
|
||||||
|
"oldFolderNoteName": "{{folder_name}}",
|
||||||
|
"folderNoteName": "index",
|
||||||
|
"folderNoteType": ".md",
|
||||||
|
"disableFolderHighlighting": false,
|
||||||
|
"newFolderNoteName": "{{folder_name}}",
|
||||||
|
"storageLocation": "insideFolder",
|
||||||
|
"syncDelete": false,
|
||||||
|
"showRenameConfirmation": true,
|
||||||
|
"defaultOverview": {
|
||||||
|
"id": "",
|
||||||
|
"folderPath": "",
|
||||||
|
"title": "{{folderName}} overview",
|
||||||
|
"showTitle": false,
|
||||||
|
"depth": 3,
|
||||||
|
"includeTypes": [
|
||||||
|
"folder",
|
||||||
|
"markdown"
|
||||||
|
],
|
||||||
|
"style": "list",
|
||||||
|
"disableFileTag": false,
|
||||||
|
"sortBy": "name",
|
||||||
|
"sortByAsc": true,
|
||||||
|
"showEmptyFolders": false,
|
||||||
|
"onlyIncludeSubfolders": false,
|
||||||
|
"storeFolderCondition": true,
|
||||||
|
"showFolderNotes": false,
|
||||||
|
"disableCollapseIcon": true,
|
||||||
|
"alwaysCollapse": false,
|
||||||
|
"autoSync": true,
|
||||||
|
"allowDragAndDrop": true,
|
||||||
|
"hideLinkList": true,
|
||||||
|
"hideFolderOverview": false,
|
||||||
|
"useActualLinks": false,
|
||||||
|
"fmtpIntegration": false,
|
||||||
|
"titleSize": 1,
|
||||||
|
"isInCallout": false
|
||||||
|
},
|
||||||
|
"useSubmenus": true,
|
||||||
|
"syncMove": true,
|
||||||
|
"frontMatterTitle": {
|
||||||
|
"enabled": false,
|
||||||
|
"explorer": true,
|
||||||
|
"path": true
|
||||||
|
},
|
||||||
|
"settingsTab": "general",
|
||||||
|
"supportedFileTypes": [
|
||||||
|
"md",
|
||||||
|
"canvas",
|
||||||
|
"base"
|
||||||
|
],
|
||||||
|
"boldName": false,
|
||||||
|
"boldNameInPath": false,
|
||||||
|
"cursiveName": false,
|
||||||
|
"cursiveNameInPath": false,
|
||||||
|
"disableOpenFolderNoteOnClick": false,
|
||||||
|
"openByClick": true,
|
||||||
|
"openWithCtrl": false,
|
||||||
|
"openWithAlt": false,
|
||||||
|
"excludeFolderDefaultSettings": {
|
||||||
|
"type": "folder",
|
||||||
|
"path": "",
|
||||||
|
"id": "a8a3086d-f63b-409f-be17-9e5676db13b5",
|
||||||
|
"subFolders": true,
|
||||||
|
"disableSync": true,
|
||||||
|
"disableAutoCreate": true,
|
||||||
|
"disableFolderNote": false,
|
||||||
|
"enableCollapsing": false,
|
||||||
|
"position": 0,
|
||||||
|
"excludeFromFolderOverview": false,
|
||||||
|
"string": "",
|
||||||
|
"hideInSettings": false,
|
||||||
|
"detached": false,
|
||||||
|
"showFolderNote": false
|
||||||
|
},
|
||||||
|
"excludePatternDefaultSettings": {
|
||||||
|
"type": "pattern",
|
||||||
|
"path": "",
|
||||||
|
"id": "d97ab7fb-3b20-49e7-8128-666bf4985a2c",
|
||||||
|
"subFolders": true,
|
||||||
|
"disableSync": true,
|
||||||
|
"disableAutoCreate": true,
|
||||||
|
"disableFolderNote": false,
|
||||||
|
"enableCollapsing": false,
|
||||||
|
"position": 0,
|
||||||
|
"excludeFromFolderOverview": false,
|
||||||
|
"string": "",
|
||||||
|
"hideInSettings": false,
|
||||||
|
"detached": false,
|
||||||
|
"showFolderNote": false
|
||||||
|
},
|
||||||
|
"hideCollapsingIcon": false,
|
||||||
|
"hideCollapsingIconForEmptyFolders": false,
|
||||||
|
"tabManagerEnabled": true,
|
||||||
|
"ignoreAttachmentFolder": true,
|
||||||
|
"deleteFilesAction": "trash",
|
||||||
|
"openSidebar": {
|
||||||
|
"mobile": false,
|
||||||
|
"desktop": true
|
||||||
|
},
|
||||||
|
"highlightFolder": true,
|
||||||
|
"persistentSettingsTab": {
|
||||||
|
"afterRestart": true,
|
||||||
|
"afterChangingTab": true
|
||||||
|
},
|
||||||
|
"firstTimeInsertOverview": true,
|
||||||
|
"fvGlobalSettings": {
|
||||||
|
"autoUpdateLinks": false
|
||||||
|
}
|
||||||
|
}
|
||||||
+9144
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"id": "folder-notes",
|
||||||
|
"name": "Folder notes",
|
||||||
|
"version": "1.8.18",
|
||||||
|
"minAppVersion": "0.15.0",
|
||||||
|
"description": "Create notes within folders that can be accessed without collapsing the folder, similar to the functionality offered in Notion.",
|
||||||
|
"author": "Lost Paul",
|
||||||
|
"authorUrl": "https://github.com/LostPaul",
|
||||||
|
"fundingUrl": "https://ko-fi.com/paul305844",
|
||||||
|
"helpUrl": "https://lostpaul.github.io/obsidian-folder-notes/",
|
||||||
|
"isDesktopOnly": false
|
||||||
|
}
|
||||||
@@ -0,0 +1,349 @@
|
|||||||
|
/* ==========================================================================
|
||||||
|
General States & Utilities
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
.hide,
|
||||||
|
.hide-folder .folder-name,
|
||||||
|
.hide-folder-note .is-folder-note {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* make.md plugin integration */
|
||||||
|
.hide-folder-note .mk-tree-node > .mk-tree-wrapper > .dropzone > .mk-tree-item.is-folder-note {
|
||||||
|
opacity: 40%;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pointer-cursor,
|
||||||
|
.has-folder-note .nav-folder-title-content:hover,
|
||||||
|
.has-folder-note.view-header-breadcrumb:hover,
|
||||||
|
.nav-folder-collapse-indicator:hover,
|
||||||
|
.fn-delete-confirmation-modal-buttons span:hover,
|
||||||
|
.fn-delete-confirmation-modal-buttons input:hover {
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hide-folder-note :not(.show-folder-note-in-explorer).only-has-folder-note .nav-folder-children {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Tree Items
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
body:not(.is-grabbing) .tree-item-self.fn-is-active:hover,
|
||||||
|
body:not(.disable-folder-highlight) .tree-item-self.fn-is-active {
|
||||||
|
color: var(--nav-item-color-active);
|
||||||
|
background-color: var(--nav-item-background-active);
|
||||||
|
font-weight: var(--nav-item-weight-active);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Exclude Folder Settings
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
.fn-excluded-folder-heading {
|
||||||
|
margin-top: 0 !important;
|
||||||
|
border-top: 1px solid var(--background-modifier-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.add-exclude-folder-item,
|
||||||
|
.fn-exclude-folder-list {
|
||||||
|
padding-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fn-exclude-folder-list.setting-item {
|
||||||
|
border-top: 0 !important;
|
||||||
|
border-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fn-exclude-folder-list .setting-item-control {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fn-exclude-folder-list .setting-item-info {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fn-exclude-folder-list .search-input-container {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Modal Styles
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
.fn-backup-warning-modal .fn-modal-button-container {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.5rem;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fn-confirmation-modal {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fn-confirmation-modal .setting-item {
|
||||||
|
border-top: 0 !important;
|
||||||
|
padding-top: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:not(.is-phone) .fn-confirmation-modal-button {
|
||||||
|
margin-right: 0.7rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
:not(.is-phone) .fn-delete-confirmation-modal-buttons {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:not(.is-phone) .fn-delete-confirmation-modal-buttons .fn-confirmation-modal-button {
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
:not(.is-phone) .fn-delete-confirmation-modal-buttons input[type="checkbox"] {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-phone .fn-delete-confirmation-modal-buttons {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-phone .fn-delete-confirmation-modal-buttons .fn-confirmation-modal-button {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Folder Overview
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
.folder-overview-container.fv-remove-edit-button .folder-overview-edit-button {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-line:has(.fv-link-list-item),
|
||||||
|
li:has(.fv-link-list-item),
|
||||||
|
.el-ul:has(.fv-link-list-item),
|
||||||
|
.cm-line:has(.fv-link-list-start),
|
||||||
|
.cm-line:has(.fv-link-list-end),
|
||||||
|
.fv-hide-overview {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.folder-overview-list {
|
||||||
|
margin-top: 0 !important;
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
padding-bottom: 1.200 !important;
|
||||||
|
padding-top: 1.200 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-overview-list-item {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-overview-list::marker {
|
||||||
|
color: var(--text-faint);
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-list::marker {
|
||||||
|
color: var(--text-normal) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-overview-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-gap: 20px;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-overview-grid-item {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
margin: 0 1.2rem 1.2rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-overview-grid-item-article article {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 15px;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-overview-grid-item-article a {
|
||||||
|
text-decoration: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-overview-grid-item-article h1 {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.overview-setting-item-fv {
|
||||||
|
border-top: 1px solid var(--background-modifier-border);
|
||||||
|
padding: 0.75em 0;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.overview-setting-item-fv .setting-item {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
File Explorer & Path Styling
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
.folder-note-underline .has-folder-note .nav-folder-title-content {
|
||||||
|
text-decoration-line: underline;
|
||||||
|
text-decoration-color: var(--text-faint);
|
||||||
|
text-decoration-thickness: 2px;
|
||||||
|
text-underline-offset: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-note-underline-path .has-folder-note.view-header-breadcrumb {
|
||||||
|
text-decoration-line: underline;
|
||||||
|
text-decoration-color: var(--text-faint);
|
||||||
|
text-decoration-thickness: 1px;
|
||||||
|
text-underline-offset: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-note-bold .has-folder-note .nav-folder-title-content,
|
||||||
|
.folder-note-bold-path .has-folder-note.view-header-breadcrumb {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-note-cursive .has-folder-note .nav-folder-title-content,
|
||||||
|
.folder-note-cursive-path .has-folder-note.view-header-breadcrumb {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Collapse Icon Handling */
|
||||||
|
|
||||||
|
.fn-folder-overview-collapse-icon {
|
||||||
|
display: block !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fn-has-no-files .collapse-icon,
|
||||||
|
.fn-hide-collapse-icon .has-folder-note.only-has-folder-note .tree-item-icon,
|
||||||
|
body.fn-ignore-attachment-folder.fn-hide-collapse-icon .only-has-folder-note .fn-empty-folder.fn-has-attachment-folder .tree-item-icon,
|
||||||
|
body.fn-hide-collapse-icon .only-has-folder-note .fn-empty-folder:not(.fn-has-attachment-folder) .tree-item-icon,
|
||||||
|
body.fn-hide-empty-collapse-icon :not(.only-has-folder-note) > .fn-empty-folder:not(.fn-has-attachment-folder) .tree-item-icon,
|
||||||
|
body.fn-hide-collapse-icon.only-has-folder-note:not(.is-collapsed):not(.show-folder-note-in-explorer)>.nav-folder-children {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Settings Tabs
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
.fn-settings-tab-bar {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
padding-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fn-settings-tab {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
gap: var(--size-4-2);
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid var(--background-modifier-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fn-settings-tab-active {
|
||||||
|
background-color: var(--color-accent);
|
||||||
|
color: var(--text-on-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fn-settings-tab-name {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fn-settings-tab-icon {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Suggestion Container
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
.fn-suggestion-container {
|
||||||
|
position: absolute;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
background-color: var(--background-primary);
|
||||||
|
max-width: 500px;
|
||||||
|
max-height: 300px;
|
||||||
|
border-radius: var(--radius-m);
|
||||||
|
border: 1px solid var(--background-modifier-border);
|
||||||
|
box-shadow: var(--shadow-s);
|
||||||
|
z-index: var(--layer-notice);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Whitelist Folder Input (Desktop & Mobile)
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/* Default Desktop Layout */
|
||||||
|
.fn-whitelist-folder-input-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fn-whitelist-folder-input-container input {
|
||||||
|
flex-grow: 1;
|
||||||
|
width: auto;
|
||||||
|
margin-right: 8px;
|
||||||
|
height: 40px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fn-whitelist-folder-buttons {
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: center;
|
||||||
|
flex-grow: 0;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Mobile Overrides */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.fn-whitelist-folder-input-container {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fn-whitelist-folder-input-container input {
|
||||||
|
width: 100%;
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fn-whitelist-folder-buttons {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-phone .fn-overview-folder-path .setting-item-control {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"homeBaseType": "File",
|
||||||
|
"homeBaseValue": "_bases/Home.base",
|
||||||
|
"openOnStartup": true,
|
||||||
|
"openViewMode": "default",
|
||||||
|
"openMode": "replace-all",
|
||||||
|
"manualOpenMode": "retain",
|
||||||
|
"replaceNewTab": false,
|
||||||
|
"newTabMode": "only-when-empty",
|
||||||
|
"openWhenAllTabsClosed": false,
|
||||||
|
"useDifferentFileForNewTab": false,
|
||||||
|
"newTabType": "File",
|
||||||
|
"newTabValue": "",
|
||||||
|
"newTabSeparateMobile": false,
|
||||||
|
"mobileNewTabType": "File",
|
||||||
|
"mobileNewTabValue": "",
|
||||||
|
"showStickyHomeIcon": true,
|
||||||
|
"stickyIconName": "home",
|
||||||
|
"hideHomeTabHeader": true,
|
||||||
|
"replaceMobileNewTab": false,
|
||||||
|
"separateMobile": false,
|
||||||
|
"mobileHomeBaseType": "File",
|
||||||
|
"mobileHomeBaseValue": "",
|
||||||
|
"commandOnOpen": "",
|
||||||
|
"waitForGitSync": false,
|
||||||
|
"gitSyncTimeout": 3,
|
||||||
|
"revertView": false,
|
||||||
|
"autoScroll": false,
|
||||||
|
"hideReleaseNotes": false,
|
||||||
|
"stickyIconReplaceTab": false
|
||||||
|
}
|
||||||
+3958
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
|||||||
|
{"id":"home-base","name":"Home Base","version":"0.2.6","minAppVersion":"1.11.0","description":"Your dedicated home in your vault.","author":"David V. Kimball","authorUrl":"https://davidvkimball.com","fundingUrl":"https://patreon.com/davidvkimball","isDesktopOnly":false}
|
||||||
+217
@@ -0,0 +1,217 @@
|
|||||||
|
/**
|
||||||
|
* Home Base Plugin Styles
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ========================================
|
||||||
|
Icon Picker (matching iconic plugin)
|
||||||
|
======================================== */
|
||||||
|
|
||||||
|
.iconic-icon-picker .iconic-search-results {
|
||||||
|
overflow-x: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconic-icon-picker .iconic-search-results>.setting-item-info {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconic-icon-picker .iconic-search-results>.setting-item-control {
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconic-icon-picker .iconic-search-results:focus-visible {
|
||||||
|
box-shadow: 0 0 0 2px var(--background-modifier-border-focus);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Search result icons */
|
||||||
|
.iconic-icon-picker .iconic-search-result>* {
|
||||||
|
height: var(--icon-size);
|
||||||
|
--icon-size: calc(var(--icon-l) * 1.25);
|
||||||
|
--icon-stroke: calc(var(--icon-l-stroke-width) * 6/7);
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconic-icon-picker .iconic-search-result.is-selected {
|
||||||
|
background-color: var(--background-modifier-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconic-icon-picker .iconic-invisible {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ========================================
|
||||||
|
Sticky Home Icon (Desktop)
|
||||||
|
======================================== */
|
||||||
|
|
||||||
|
/* Sticky home icon - part of tab bar structure, flows inline with tabs */
|
||||||
|
.workspace-tab-header-container-inner>.home-base-sticky-icon {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
margin-left: 8px;
|
||||||
|
margin-right: 8px;
|
||||||
|
cursor: default;
|
||||||
|
color: var(--text-muted);
|
||||||
|
transition: color 150ms ease;
|
||||||
|
background: none;
|
||||||
|
height: var(--tab-height, 32px);
|
||||||
|
width: 24px;
|
||||||
|
min-width: 24px;
|
||||||
|
max-width: 24px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
pointer-events: auto;
|
||||||
|
align-self: center;
|
||||||
|
margin-top: -8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Reduce left padding since icon is now inside the container */
|
||||||
|
/* Only apply to splits that actually have the sticky icon (not the other side of a split view) */
|
||||||
|
.workspace-split.mod-vertical.mod-root.home-base-sticky-icon-enabled .workspace-tab-header-container-inner:has(.home-base-sticky-icon) {
|
||||||
|
padding-left: 0;
|
||||||
|
/* Icon is inside, so no extra left padding needed */
|
||||||
|
}
|
||||||
|
|
||||||
|
.home-base-sticky-icon:hover {
|
||||||
|
background: none;
|
||||||
|
color: var(--text-normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
.home-base-sticky-icon-active {
|
||||||
|
color: var(--text-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.home-base-sticky-icon-active:hover {
|
||||||
|
color: var(--text-accent-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-tab-header-container-inner>.home-base-sticky-icon svg {
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
min-width: 18px;
|
||||||
|
min-height: 18px;
|
||||||
|
max-width: 18px;
|
||||||
|
max-height: 18px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
display: block;
|
||||||
|
/* Prevent any size changes */
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hide home base tab header when sticky icon is enabled */
|
||||||
|
/* Completely remove from DOM flow to prevent tab counting */
|
||||||
|
.workspace-tab-header.is-home-base-tab,
|
||||||
|
.workspace-tab-header[data-home-base-ghost="true"] {
|
||||||
|
display: none !important;
|
||||||
|
/* Remove from accessibility tree */
|
||||||
|
visibility: hidden !important;
|
||||||
|
/* Remove from layout completely */
|
||||||
|
position: fixed !important;
|
||||||
|
left: -9999px !important;
|
||||||
|
top: -9999px !important;
|
||||||
|
width: 0 !important;
|
||||||
|
height: 0 !important;
|
||||||
|
overflow: hidden !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
border: none !important;
|
||||||
|
/* Ensure it doesn't count for tab counting logic */
|
||||||
|
pointer-events: none !important;
|
||||||
|
/* Make it not count for :nth-child selectors */
|
||||||
|
order: -9999 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hide sticky icon when tab bar is hidden - general purpose rules */
|
||||||
|
/* These work automatically because the icon is inside the tab container */
|
||||||
|
|
||||||
|
/* Zen Mode */
|
||||||
|
body.zenmode-active .home-base-sticky-icon {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* UI Tweaker */
|
||||||
|
body.hider-tabs .home-base-sticky-icon {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* When tab header container is hidden via display:none, icon should also be hidden */
|
||||||
|
.workspace-tab-header-container[style*="display: none"] .home-base-sticky-icon,
|
||||||
|
.workspace-tab-header-container[style*="display:none"] .home-base-sticky-icon {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* When tab container inner is hidden via display:none */
|
||||||
|
.workspace-tab-header-container-inner[style*="display: none"] .home-base-sticky-icon,
|
||||||
|
.workspace-tab-header-container-inner[style*="display:none"] .home-base-sticky-icon {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Oxygen theme auto-hide: When tab container has opacity 0 and pointer-events none, hide icon */
|
||||||
|
/* Only hide when opacity is 0 AND it's clearly meant to be hidden (not just a transition) */
|
||||||
|
.workspace-tab-header-container[style*="opacity: 0"][style*="pointer-events: none"] .home-base-sticky-icon,
|
||||||
|
.workspace-tab-header-container[style*="opacity:0"][style*="pointer-events:none"] .home-base-sticky-icon {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Focus mode: REMOVED - was incorrectly hiding icon when window is focused */
|
||||||
|
/* Focus mode should be handled by the tab bar hiding, not by this rule */
|
||||||
|
|
||||||
|
/* Additional safety: Hide icon when parent workspace-tabs is hidden via display */
|
||||||
|
.workspace-tabs[style*="display: none"] .home-base-sticky-icon,
|
||||||
|
.workspace-tabs[style*="display:none"] .home-base-sticky-icon {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* JavaScript-controlled hiding removed - CSS handles all visibility automatically */
|
||||||
|
|
||||||
|
/* ========================================
|
||||||
|
Mobile New Tab Button Replacement
|
||||||
|
======================================== */
|
||||||
|
|
||||||
|
/* Hide the default SVG when mobile home is enabled */
|
||||||
|
.home-base-mobile-enabled .mobile-navbar-action-new-tab .clickable-icon svg {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add Lucide house icon as replacement */
|
||||||
|
.home-base-mobile-enabled .mobile-navbar-action-new-tab .clickable-icon::before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
background-color: currentColor;
|
||||||
|
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8'/%3E%3Cpath d='M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") no-repeat center / contain;
|
||||||
|
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8'/%3E%3Cpath d='M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") no-repeat center / contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ========================================
|
||||||
|
Settings Tab Styles
|
||||||
|
======================================== */
|
||||||
|
|
||||||
|
/* File suggester styling - scoped to home base suggestions */
|
||||||
|
.home-base-suggestion-item .suggestion-title {
|
||||||
|
font-weight: 500;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.home-base-suggestion-item .suggestion-note {
|
||||||
|
color: var(--text-faint);
|
||||||
|
font-family: var(--font-monospace);
|
||||||
|
font-size: var(--font-smaller);
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.home-base-suggestion-item .suggestion-flair {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 1px 4px;
|
||||||
|
margin-left: 8px;
|
||||||
|
border-radius: var(--radius-s);
|
||||||
|
background-color: var(--background-modifier-border);
|
||||||
|
color: var(--text-muted);
|
||||||
|
font-size: var(--font-smallest);
|
||||||
|
font-weight: 500;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Scoped to only this plugin's settings container to avoid affecting other plugins */
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
"use strict";var $e=Object.create;var z=Object.defineProperty;var Qe=Object.getOwnPropertyDescriptor;var Ze=Object.getOwnPropertyNames;var Xe=Object.getPrototypeOf,et=Object.prototype.hasOwnProperty;var tt=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),at=(n,t)=>{for(var e in t)z(n,e,{get:t[e],enumerable:!0})},be=(n,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ze(t))!et.call(n,i)&&i!==e&&z(n,i,{get:()=>t[i],enumerable:!(a=Qe(t,i))||a.enumerable});return n};var nt=(n,t,e)=>(e=n!=null?$e(Xe(n)):{},be(t||!n||!n.__esModule?z(e,"default",{value:n,enumerable:!0}):e,n)),it=n=>be(z({},"__esModule",{value:!0}),n);var Ve=tt(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});var m=require("obsidian"),ie="YYYY-MM-DD",oe="gggg-[W]ww",Se="YYYY-MM",Me="YYYY-[Q]Q",Fe="YYYY";function H(n){let t=window.app.plugins.getPlugin("periodic-notes");return t&&t.settings?.[n]?.enabled}function I(){try{let{internalPlugins:n,plugins:t}=window.app;if(H("daily")){let{format:o,folder:s,template:c}=t.getPlugin("periodic-notes")?.settings?.daily||{};return{format:o||ie,folder:s?.trim()||"",template:c?.trim()||""}}let{folder:e,format:a,template:i}=n.getPluginById("daily-notes")?.instance?.options||{};return{format:a||ie,folder:e?.trim()||"",template:i?.trim()||""}}catch(n){console.info("No custom daily note settings found!",n)}}function W(){try{let n=window.app.plugins,t=n.getPlugin("calendar")?.options,e=n.getPlugin("periodic-notes")?.settings?.weekly;if(H("weekly"))return{format:e.format||oe,folder:e.folder?.trim()||"",template:e.template?.trim()||""};let a=t||{};return{format:a.weeklyNoteFormat||oe,folder:a.weeklyNoteFolder?.trim()||"",template:a.weeklyNoteTemplate?.trim()||""}}catch(n){console.info("No custom weekly note settings found!",n)}}function V(){let n=window.app.plugins;try{let t=H("monthly")&&n.getPlugin("periodic-notes")?.settings?.monthly||{};return{format:t.format||Se,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom monthly note settings found!",t)}}function _(){let n=window.app.plugins;try{let t=H("quarterly")&&n.getPlugin("periodic-notes")?.settings?.quarterly||{};return{format:t.format||Me,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom quarterly note settings found!",t)}}function U(){let n=window.app.plugins;try{let t=H("yearly")&&n.getPlugin("periodic-notes")?.settings?.yearly||{};return{format:t.format||Fe,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom yearly note settings found!",t)}}function Ae(...n){let t=[];for(let a=0,i=n.length;a<i;a++)t=t.concat(n[a].split("/"));let e=[];for(let a=0,i=t.length;a<i;a++){let o=t[a];!o||o==="."||e.push(o)}return t[0]===""&&e.unshift(""),e.join("/")}function st(n){let t=n.substring(n.lastIndexOf("/")+1);return t.lastIndexOf(".")!=-1&&(t=t.substring(0,t.lastIndexOf("."))),t}async function rt(n){let t=n.replace(/\\/g,"/").split("/");if(t.pop(),t.length){let e=Ae(...t);window.app.vault.getAbstractFileByPath(e)||await window.app.vault.createFolder(e)}}async function Y(n,t){t.endsWith(".md")||(t+=".md");let e=m.normalizePath(Ae(n,t));return await rt(e),e}async function O(n){let{metadataCache:t,vault:e}=window.app,a=m.normalizePath(n);if(a==="/")return Promise.resolve(["",null]);try{let i=t.getFirstLinkpathDest(a,""),o=await e.cachedRead(i),s=window.app.foldManager.load(i);return[o,s]}catch(i){return console.error(`Failed to read the daily note template '${a}'`,i),new m.Notice("Failed to read the daily note template"),["",null]}}function P(n,t="day"){let e=n.clone().startOf(t).format();return`${t}-${e}`}function Ee(n){return n.replace(/\[[^\]]*\]/g,"")}function lt(n,t){if(t==="week"){let e=Ee(n);return/w{1,2}/i.test(e)&&(/M{1,4}/.test(e)||/D{1,4}/.test(e))}return!1}function L(n,t){return Oe(n.basename,t)}function ct(n,t){return Oe(st(n),t)}function Oe(n,t){let a={day:I,week:W,month:V,quarter:_,year:U}[t]().format.split("/").pop(),i=window.moment(n,a,!0);if(!i.isValid())return null;if(lt(a,t)&&t==="week"){let o=Ee(a);if(/w{1,2}/i.test(o))return window.moment(n,a.replace(/M{1,4}/g,"").replace(/D{1,4}/g,""),!1)}return i}var se=class extends Error{};async function Le(n){let t=window.app,{vault:e}=t,a=window.moment,{template:i,format:o,folder:s}=I(),[c,w]=await O(i),p=n.format(o),v=await Y(s,p);try{let u=await e.create(v,c.replace(/{{\s*date\s*}}/gi,p).replace(/{{\s*time\s*}}/gi,a().format("HH:mm")).replace(/{{\s*title\s*}}/gi,p).replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,S,M,N,y,f)=>{let ee=a(),te=n.clone().set({hour:ee.get("hour"),minute:ee.get("minute"),second:ee.get("second")});return M&&te.add(parseInt(N,10),y),f?te.format(f.substring(1).trim()):te.format(o)}).replace(/{{\s*yesterday\s*}}/gi,n.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,n.clone().add(1,"d").format(o)));return t.foldManager.save(u,w),u}catch(u){console.error(`Failed to create file: '${v}'`Line truncated
|
||||||
|
|
||||||
|
/* nosourcemap */
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"id": "homepage",
|
||||||
|
"name": "Homepage",
|
||||||
|
"version": "4.4.0",
|
||||||
|
"minAppVersion": "1.11.0",
|
||||||
|
"description": "Open a specified note, canvas, base, or workspace on startup, or set it for quick access later.",
|
||||||
|
"author": "novov",
|
||||||
|
"authorUrl": "https://novov.me",
|
||||||
|
"isDesktopOnly": false,
|
||||||
|
"fundingUrl": {
|
||||||
|
"Ko-fi": "https://ko-fi.com/novov"
|
||||||
|
}
|
||||||
|
}
|
||||||
+231
@@ -0,0 +1,231 @@
|
|||||||
|
@keyframes nv-interstitial-destroy {
|
||||||
|
from { opacity: 1; }
|
||||||
|
to { opacity: 0; }
|
||||||
|
}
|
||||||
|
|
||||||
|
.setting-item[nv-greyed] {
|
||||||
|
opacity: .5;
|
||||||
|
pointer-events: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#nv-main-setting {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
#nv-main-setting .setting-item-control {
|
||||||
|
padding-top: var(--size-4-1);
|
||||||
|
flex-basis: 100%;
|
||||||
|
align-items: stretch;
|
||||||
|
}
|
||||||
|
|
||||||
|
#nv-main-setting .setting-item-control input, #nv-main-setting .setting-item-control select {
|
||||||
|
font-size: var(--font-ui-medium);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
#nv-main-setting .setting-item-control select {
|
||||||
|
padding: var(--size-4-3) var(--size-4-4);
|
||||||
|
padding-right: var(--size-4-8);
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#nv-main-setting .setting-item-control input {
|
||||||
|
flex-grow: 1;
|
||||||
|
padding: var(--size-4-5) var(--size-4-4);
|
||||||
|
}
|
||||||
|
|
||||||
|
#nv-main-setting .setting-item-control input[disabled] {
|
||||||
|
opacity: 0.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
#nv-main-setting #nv-desc, #nv-main-setting #nv-info {
|
||||||
|
flex-basis: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#nv-main-setting #nv-desc {
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--text-normal);
|
||||||
|
font-size: var(--font-ui-small);
|
||||||
|
padding: 10px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#nv-main-setting #nv-desc.mod-warning {
|
||||||
|
color: var(--text-error);
|
||||||
|
}
|
||||||
|
|
||||||
|
#nv-main-setting #nv-desc code {
|
||||||
|
font-family: var(--font-monospace);
|
||||||
|
font-size: var(--font-smaller);
|
||||||
|
border-radius: var(--radius-s);
|
||||||
|
}
|
||||||
|
|
||||||
|
#nv-main-setting #nv-desc small {
|
||||||
|
display: block;
|
||||||
|
font-weight: 400;
|
||||||
|
color: var(--text-muted);
|
||||||
|
font-size: calc(var(--font-ui-smaller) * 0.9);
|
||||||
|
padding: 5px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nv-homepage-file-tag {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-left: var(--size-2-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.nv-mobile-setting, .nv-command-setting {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
row-gap: var(--size-2-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.nv-mobile-setting .nv-mobile-info {
|
||||||
|
font-size: var(--font-ui-smaller);
|
||||||
|
width: 100%;
|
||||||
|
margin-right: var(--size-4-18);
|
||||||
|
}
|
||||||
|
|
||||||
|
.nv-command-desc {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nv-command-box {
|
||||||
|
margin: 1em 0 0;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 12px;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nv-command-pill {
|
||||||
|
background-color: var(--background-modifier-hover);
|
||||||
|
border-radius: var(--radius-s);
|
||||||
|
font-size: var(--font-ui-small);
|
||||||
|
padding: var(--size-2-1) var(--size-2-2) var(--size-2-1) var(--size-2-3) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nv-command-pill.nv-command-invalid {
|
||||||
|
color: var(--text-faint);
|
||||||
|
}
|
||||||
|
|
||||||
|
.nv-command-pill button {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0 0 0 3px;
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nv-command-pill button:first-of-type {
|
||||||
|
margin-left: var(--size-4-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.nv-command-pill button.nv-command-selected {
|
||||||
|
margin-left: var(--size-2-2);
|
||||||
|
padding: 0 var(--size-2-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.nv-command-pill button.nv-command-selected span {
|
||||||
|
color: var(--text-accent);
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 0.9em;
|
||||||
|
vertical-align: top;
|
||||||
|
position: relative;
|
||||||
|
top: -1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nv-command-pill > .svg-icon, .nv-command-pill button .svg-icon {
|
||||||
|
height: 1em;
|
||||||
|
width: 1em;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nv-command-pill > .svg-icon {
|
||||||
|
vertical-align: text-bottom;
|
||||||
|
position: relative;
|
||||||
|
margin: 0 var(--size-2-1) 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nv-command-pill.nv-dragging {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nv-command-add-button {
|
||||||
|
font-size: var(--font-ui-small);
|
||||||
|
padding: var(--size-2-2) var(--size-4-2);
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#nv-main-setting + .setting-item, .nv-command-desc + .setting-item {
|
||||||
|
padding-top: 20px;
|
||||||
|
border-top: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nv-debug-button {
|
||||||
|
margin: 3em 0 -0.2em;
|
||||||
|
font-size: var(--font-ui-smaller);
|
||||||
|
padding: 0;
|
||||||
|
height: auto;
|
||||||
|
float: right;
|
||||||
|
box-shadow: none !important;
|
||||||
|
background: none !important;
|
||||||
|
color: var(--text-accent);
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nv-debug-button:hover, .nv-debug-button:active {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-phone #nv-main-setting .setting-item-control {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-phone #nv-main-setting .setting-item-control select {
|
||||||
|
width: auto;
|
||||||
|
max-width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-phone .nv-mobile-setting {
|
||||||
|
row-gap: var(--size-4-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-phone .nv-mobile-setting .setting-item-info {
|
||||||
|
max-width: calc(100% - 100px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-phone .nv-mobile-setting {
|
||||||
|
row-gap: var(--size-4-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-phone .nv-mobile-setting .setting-item-info {
|
||||||
|
max-width: calc(100% - 100px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-phone .nv-command-pill {
|
||||||
|
width: 100%;
|
||||||
|
border: none;
|
||||||
|
background: none;
|
||||||
|
padding: 0 0 var(--size-4-2);
|
||||||
|
display: flex;
|
||||||
|
gap: var(--size-4-4);
|
||||||
|
align-items: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-phone .nv-command-pill .nv-command-text {
|
||||||
|
flex-grow: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-phone .nv-command-pill, .is-phone .nv-command-add-button {
|
||||||
|
font-size: var(--font-ui-medium);
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-phone .nv-command-pill button {
|
||||||
|
line-height: var(--font-ui-medium);
|
||||||
|
height: 100%;
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
{
|
||||||
|
"enableRenameOnPaste": true,
|
||||||
|
"enableRenameOnDrop": true,
|
||||||
|
"imageNameTemplate": "{{DATE:YYYY-MM-DD}}_{{fileName}}",
|
||||||
|
"attachmentLocation": "obsidian",
|
||||||
|
"customAttachmentPath": "./assets",
|
||||||
|
"defaultProvider": "local",
|
||||||
|
"unsplashProxyServer": "",
|
||||||
|
"pexelsApiKey": "",
|
||||||
|
"pexelsApiKeySecretId": "",
|
||||||
|
"pixabayApiKey": "",
|
||||||
|
"pixabayApiKeySecretId": "",
|
||||||
|
"defaultOrientation": "any",
|
||||||
|
"defaultImageSize": "large",
|
||||||
|
"enablePropertyPaste": true,
|
||||||
|
"propertyLinkFormat": "obsidian",
|
||||||
|
"customPropertyLinkFormat": "{image-url}",
|
||||||
|
"defaultPropertyName": "heroImage",
|
||||||
|
"defaultIconPropertyName": "icon",
|
||||||
|
"altTextProperty": "",
|
||||||
|
"autoConvertRemoteImages": false,
|
||||||
|
"convertOnNoteOpen": false,
|
||||||
|
"convertOnNoteSave": false,
|
||||||
|
"processBackgroundChanges": true,
|
||||||
|
"showRenameDialog": true,
|
||||||
|
"autoRename": false,
|
||||||
|
"dupNumberDelimiter": "-",
|
||||||
|
"dupNumberAtStart": false,
|
||||||
|
"disableRenameNotice": false,
|
||||||
|
"enableDescriptiveImages": true,
|
||||||
|
"insertSize": "",
|
||||||
|
"insertReferral": true,
|
||||||
|
"insertBackLink": false,
|
||||||
|
"appendReferral": false,
|
||||||
|
"banner": {
|
||||||
|
"properties": {
|
||||||
|
"imageProperty": "heroImage",
|
||||||
|
"iconProperty": "icon"
|
||||||
|
},
|
||||||
|
"desktop": {
|
||||||
|
"enabled": true,
|
||||||
|
"height": 240,
|
||||||
|
"viewOffset": 0,
|
||||||
|
"noteOffset": -32,
|
||||||
|
"borderRadius": [
|
||||||
|
8,
|
||||||
|
8,
|
||||||
|
8,
|
||||||
|
8
|
||||||
|
],
|
||||||
|
"padding": 8,
|
||||||
|
"fade": true,
|
||||||
|
"iconEnabled": false,
|
||||||
|
"iconSize": 96,
|
||||||
|
"iconRadius": 8,
|
||||||
|
"iconBackground": true,
|
||||||
|
"iconBorder": 2,
|
||||||
|
"iconFrame": true,
|
||||||
|
"iconAlignmentH": "flex-start",
|
||||||
|
"iconAlignmentV": "flex-end",
|
||||||
|
"iconOffsetX": 0,
|
||||||
|
"iconOffsetY": -24
|
||||||
|
},
|
||||||
|
"tablet": {
|
||||||
|
"enabled": true,
|
||||||
|
"height": 190,
|
||||||
|
"viewOffset": 0,
|
||||||
|
"noteOffset": -32,
|
||||||
|
"borderRadius": [
|
||||||
|
8,
|
||||||
|
8,
|
||||||
|
8,
|
||||||
|
8
|
||||||
|
],
|
||||||
|
"padding": 8,
|
||||||
|
"fade": true,
|
||||||
|
"iconEnabled": false,
|
||||||
|
"iconSize": 96,
|
||||||
|
"iconRadius": 8,
|
||||||
|
"iconBackground": true,
|
||||||
|
"iconBorder": 2,
|
||||||
|
"iconFrame": true,
|
||||||
|
"iconAlignmentH": "flex-start",
|
||||||
|
"iconAlignmentV": "flex-end",
|
||||||
|
"iconOffsetX": 0,
|
||||||
|
"iconOffsetY": -24
|
||||||
|
},
|
||||||
|
"phone": {
|
||||||
|
"enabled": true,
|
||||||
|
"height": 160,
|
||||||
|
"viewOffset": 0,
|
||||||
|
"noteOffset": -32,
|
||||||
|
"borderRadius": [
|
||||||
|
8,
|
||||||
|
8,
|
||||||
|
8,
|
||||||
|
8
|
||||||
|
],
|
||||||
|
"padding": 8,
|
||||||
|
"fade": true,
|
||||||
|
"iconEnabled": false,
|
||||||
|
"iconSize": 56,
|
||||||
|
"iconRadius": 8,
|
||||||
|
"iconBackground": true,
|
||||||
|
"iconBorder": 2,
|
||||||
|
"iconFrame": true,
|
||||||
|
"iconAlignmentH": "flex-start",
|
||||||
|
"iconAlignmentV": "flex-end",
|
||||||
|
"iconOffsetX": 0,
|
||||||
|
"iconOffsetY": -24
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"supportedExtensions": [
|
||||||
|
"md",
|
||||||
|
"mdx"
|
||||||
|
],
|
||||||
|
"debugMode": false
|
||||||
|
}
|
||||||
+4257
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
|||||||
|
{"id":"image-manager","name":"Image Manager","version":"0.3.2","minAppVersion":"1.11.0","description":"Insert, rename, and sort images within your notes.","author":"David V. Kimball","authorUrl":"https://davidvkimball.com","fundingUrl":"https://patreon.com/davidvkimball","isDesktopOnly":false}
|
||||||
@@ -0,0 +1,530 @@
|
|||||||
|
/* Image Manager Plugin Styles */
|
||||||
|
|
||||||
|
/* Rename Modal uses Obsidian's default modal sizing */
|
||||||
|
|
||||||
|
.image-manager-rename-modal .modal-content {
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-manager-preview {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
padding: 1rem;
|
||||||
|
background: var(--background-secondary);
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-manager-preview img,
|
||||||
|
.image-manager-preview-img {
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 200px;
|
||||||
|
object-fit: contain;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-manager-info {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-manager-info ul {
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-manager-info li {
|
||||||
|
padding: 0.25rem 0;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-manager-info li strong {
|
||||||
|
color: var(--text-normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-manager-error {
|
||||||
|
color: var(--text-error);
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-manager-error-hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-manager-error-visible {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-manager-hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Remote search modal styles */
|
||||||
|
.image-inserter-container .modal-close-button {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .modal-content {
|
||||||
|
overflow-y: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .container {
|
||||||
|
z-index: 1;
|
||||||
|
position: relative;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .container .input-group {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .container .query-input {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .container .selector {
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .container .scroll-area {
|
||||||
|
overflow-x: hidden;
|
||||||
|
margin-top: 6px;
|
||||||
|
width: 100%;
|
||||||
|
max-height: 70vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .container .scroll-area.loading {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .container .scroll-area .images-list {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(1, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (min-width: 600px) {
|
||||||
|
.image-inserter-container .container {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .container {
|
||||||
|
max-width: 80vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .container .scroll-area .images-list {
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (min-width: 768px) {
|
||||||
|
.image-inserter-container .container .scroll-area .images-list {
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (min-width: 1200px) {
|
||||||
|
.image-inserter-container .container .scroll-area .images-list {
|
||||||
|
grid-template-columns: repeat(4, 1fr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .container .scroll-area .images-list .query-result {
|
||||||
|
padding: 5px 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .container .scroll-area .images-list .query-result img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: contain;
|
||||||
|
box-shadow: none;
|
||||||
|
background-color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .container .scroll-area .images-list .query-result.is-selected {
|
||||||
|
background-color: var(--background-tertiary);
|
||||||
|
box-shadow: 0 1px 3px rgb(0 0 0 / 12%), 0 1px 2px rgb(0 0 0 / 24%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .container .scroll-area .pagination {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 24px;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .container .scroll-area .pagination .btn {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Loading Animation */
|
||||||
|
.image-inserter-container .loading-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .loading-container .loader-icon {
|
||||||
|
display: inline-block;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
color: var(--text-normal);
|
||||||
|
animation: loader-spin 1s linear infinite;
|
||||||
|
transform-origin: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .loading-container .loader-icon svg {
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes loader-spin {
|
||||||
|
from {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .container .scroll-area .no-result-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-inserter-container .container .scroll-area .no-result-container.error-text {
|
||||||
|
color: var(--text-error);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Scoped to only this plugin's settings container to avoid affecting other plugins */
|
||||||
|
|
||||||
|
|
||||||
|
/* File Picker Modal (hidden) */
|
||||||
|
.image-manager-file-picker input[type="file"] {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Confirmation Modal */
|
||||||
|
.image-manager-confirm-message {
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-manager-confirm-message p {
|
||||||
|
margin: 0.5rem 0;
|
||||||
|
white-space: pre-line;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-manager-confirm-buttons {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.5rem;
|
||||||
|
justify-content: flex-end;
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-manager-confirm-buttons button {
|
||||||
|
min-width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ==========================================
|
||||||
|
Banner Image Styles
|
||||||
|
========================================== */
|
||||||
|
|
||||||
|
/* Default CSS Variables for Banner */
|
||||||
|
body {
|
||||||
|
/* Banner Variables */
|
||||||
|
--im-banner-padding: 8px;
|
||||||
|
--im-banner-radius: 0px 0px 0px 0px;
|
||||||
|
--im-banner-height: 240px;
|
||||||
|
--im-banner-url: none;
|
||||||
|
--im-banner-repeat: no-repeat;
|
||||||
|
--im-banner-size: cover;
|
||||||
|
--im-banner-img-x: 0px;
|
||||||
|
--im-banner-img-y: 0px;
|
||||||
|
--im-banner-note-offset: -32px;
|
||||||
|
--im-banner-view-offset: 0px;
|
||||||
|
--im-banner-mask: linear-gradient(180deg, transparent 25%, var(--background-primary));
|
||||||
|
--im-banner-mask-webkit: -webkit-linear-gradient(270deg, transparent 25%, var(--background-primary));
|
||||||
|
|
||||||
|
/* Icon Variables */
|
||||||
|
--im-banner-icon-align-h: flex-start;
|
||||||
|
--im-banner-icon-align-v: flex-end;
|
||||||
|
--im-banner-icon-size-w: 96px;
|
||||||
|
--im-banner-icon-size-h: 96px;
|
||||||
|
--im-banner-icon-offset-x: 0px;
|
||||||
|
--im-banner-icon-offset-y: -24px;
|
||||||
|
--im-banner-icon-radius: 8px;
|
||||||
|
--im-banner-icon-value: '';
|
||||||
|
--im-banner-icon-fontsize: inherit;
|
||||||
|
--im-banner-icon-background: rgb(from var(--background-primary) r g b / 80%);
|
||||||
|
--im-banner-icon-border: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Banner Container */
|
||||||
|
div.image-manager-banner {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 1;
|
||||||
|
width: calc(100% - (var(--im-banner-padding) * 2));
|
||||||
|
height: 100%;
|
||||||
|
margin-left: var(--im-banner-padding);
|
||||||
|
max-height: var(--im-banner-height);
|
||||||
|
padding: var(--size-4-3) var(--size-4-3) 0 var(--size-4-3);
|
||||||
|
transform: translate3d(0, 0, 0);
|
||||||
|
user-select: none;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Banner content wrapper (for rounding and clipping) */
|
||||||
|
div.image-manager-banner > div.banner-content {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 2;
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: var(--im-banner-radius);
|
||||||
|
transform: translate3d(0, 0, 0);
|
||||||
|
/* Hardware acceleration fix for jagged rounded corners */
|
||||||
|
-webkit-mask-image: -webkit-radial-gradient(white, black);
|
||||||
|
-webkit-backface-visibility: hidden;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Banner video element */
|
||||||
|
div.image-manager-banner > div.banner-content > video {
|
||||||
|
inset: 0;
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
z-index: 2;
|
||||||
|
animation: im-banner-fade-in 1s cubic-bezier(0.4, 0, 0.2, 1) forwards, im-banner-video-anim 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
|
||||||
|
object-position: calc(50% + var(--im-banner-img-x)) calc(50% + var(--im-banner-img-y));
|
||||||
|
border-radius: var(--im-banner-radius);
|
||||||
|
transition: object-position 0.5s ease-in-out;
|
||||||
|
will-change: object-position;
|
||||||
|
transform: translate3d(0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Banner image background (::before pseudo-element) */
|
||||||
|
div.image-manager-banner > div.banner-content::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 2;
|
||||||
|
box-shadow: inset 0 2px 4px 1px rgba(0, 0, 0, 0.1);
|
||||||
|
border-radius: var(--im-banner-radius);
|
||||||
|
background-color: rgba(0, 0, 0, 0.2);
|
||||||
|
background-image: var(--im-banner-url);
|
||||||
|
background-repeat: var(--im-banner-repeat);
|
||||||
|
background-size: var(--im-banner-size);
|
||||||
|
background-position-x: calc(50% + var(--im-banner-img-x));
|
||||||
|
background-position-y: calc(50% + var(--im-banner-img-y));
|
||||||
|
animation: im-banner-fade-in 1s cubic-bezier(0.4, 0, 0.2, 1) forwards, im-banner-anim 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
|
||||||
|
transition: background-position-x 0.5s ease-in-out;
|
||||||
|
will-change: background-position-x, background-position-y;
|
||||||
|
transform-style: preserve-3d;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
transform: translate3d(0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Banner fade overlay (::after pseudo-element) */
|
||||||
|
div.image-manager-banner > div.banner-content::after {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 3;
|
||||||
|
content: '';
|
||||||
|
border-radius: var(--im-banner-radius);
|
||||||
|
background: var(--im-banner-mask);
|
||||||
|
background: var(--im-banner-mask-webkit);
|
||||||
|
transform: translate3d(0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Static state (no animation) */
|
||||||
|
div.image-manager-banner.static > div.banner-content::after {
|
||||||
|
animation: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.image-manager-banner.static > div.banner-content::before {
|
||||||
|
animation: none !important;
|
||||||
|
opacity: 1 !important;
|
||||||
|
transition: background-position-x 0.5s ease-in-out, background-position-y 0.5s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Static video */
|
||||||
|
div.image-manager-banner.static > div.banner-content > video {
|
||||||
|
animation: none !important;
|
||||||
|
opacity: 1 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* During animation, disable transition to prevent conflicts */
|
||||||
|
div.image-manager-banner:not(.static) > div.banner-content::before {
|
||||||
|
transition: background-position-x 0.5s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Content after banner */
|
||||||
|
div.image-manager-banner + div {
|
||||||
|
position: relative;
|
||||||
|
z-index: 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Banner animations */
|
||||||
|
@keyframes im-banner-fade-in {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes im-banner-anim {
|
||||||
|
from {
|
||||||
|
background-position-y: calc(50% + (var(--im-banner-img-y, 0px) - 10px));
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
background-position-y: calc(50% + var(--im-banner-img-y, 0px));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes im-banner-video-anim {
|
||||||
|
from {
|
||||||
|
object-position: calc(50% + var(--im-banner-img-x, 0px)) calc(50% + (var(--im-banner-img-y, 0px) - 10px));
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
object-position: calc(50% + var(--im-banner-img-x, 0px)) calc(50% + var(--im-banner-img-y, 0px));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes im-banner-icon-anim {
|
||||||
|
from {
|
||||||
|
transform: translate(var(--im-banner-icon-offset-x), calc(var(--im-banner-icon-offset-y) - 10px));
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
transform: translate(var(--im-banner-icon-offset-x), var(--im-banner-icon-offset-y));
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Icon Container */
|
||||||
|
div.image-manager-banner > div.banner-icon {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
justify-content: var(--im-banner-icon-align-h);
|
||||||
|
align-items: var(--im-banner-icon-align-v);
|
||||||
|
width: inherit;
|
||||||
|
height: inherit;
|
||||||
|
z-index: 4;
|
||||||
|
margin: 0 auto;
|
||||||
|
max-width: var(--file-line-width);
|
||||||
|
transform: translate(0, 0);
|
||||||
|
animation: im-banner-fade-in 0.7s linear forwards, im-banner-icon-anim 0.8s ease-out;
|
||||||
|
will-change: transform, opacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.image-manager-banner > div.banner-icon > div {
|
||||||
|
display: block;
|
||||||
|
position: relative;
|
||||||
|
width: var(--im-banner-icon-size-w);
|
||||||
|
height: var(--im-banner-icon-size-h);
|
||||||
|
background-color: var(--im-banner-icon-background);
|
||||||
|
transform: translate(var(--im-banner-icon-offset-x), var(--im-banner-icon-offset-y));
|
||||||
|
border-radius: var(--im-banner-icon-radius);
|
||||||
|
border: var(--im-banner-icon-border) solid var(--background-primary);
|
||||||
|
z-index: 2;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Text icon */
|
||||||
|
div.image-manager-banner > div.banner-icon > div[data-type="text"]::after {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 1;
|
||||||
|
text-transform: uppercase;
|
||||||
|
content: var(--im-banner-icon-value);
|
||||||
|
color: var(--text-normal);
|
||||||
|
line-height: 0;
|
||||||
|
font-size: var(--im-banner-icon-fontsize, inherit);
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Link/image icon */
|
||||||
|
div.image-manager-banner > div.banner-icon > div[data-type="link"]::after {
|
||||||
|
position: absolute;
|
||||||
|
text-transform: uppercase;
|
||||||
|
inset: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 1;
|
||||||
|
transform: translate(0, 0);
|
||||||
|
content: '';
|
||||||
|
background-image: var(--im-banner-icon-value);
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Static icon (no animation) */
|
||||||
|
div.image-manager-banner.static > div.banner-icon {
|
||||||
|
animation: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Mobile adjustments */
|
||||||
|
body.is-tablet div.image-manager-banner {
|
||||||
|
width: calc(100% - (var(--im-banner-padding) * 2));
|
||||||
|
}
|
||||||
|
|
||||||
|
body.is-phone div.image-manager-banner {
|
||||||
|
width: calc(100% - (var(--im-banner-padding) * 2));
|
||||||
|
}
|
||||||
|
|
||||||
|
body.is-tablet div.image-manager-banner > div.banner-icon {
|
||||||
|
left: calc(var(--size-4-2) * -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
body.is-phone div.image-manager-banner > div.banner-icon {
|
||||||
|
left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Frontmatter Overrides for views with banner */
|
||||||
|
.workspace-leaf-content[data-im-banner] .view-content > .markdown-source-view.mod-cm6 > .cm-editor > .cm-scroller,
|
||||||
|
.workspace-leaf-content[data-im-banner] .view-content .markdown-preview-view {
|
||||||
|
padding-top: var(--im-banner-height, 240px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-im-banner] .view-content > .markdown-source-view.mod-cm6 > .cm-editor > .cm-scroller .inline-embed .el-pre.mod-frontmatter.mod-ui,
|
||||||
|
.workspace-leaf-content[data-im-banner] .view-content > .markdown-source-view.mod-cm6 > .cm-editor > .cm-scroller .inline-embed .markdown-preview-view,
|
||||||
|
.workspace-leaf-content[data-im-banner] .view-content .markdown-preview-view .inline-embed .el-pre.mod-frontmatter.mod-ui,
|
||||||
|
.workspace-leaf-content[data-im-banner] .view-content .markdown-preview-view .inline-embed .markdown-preview-view {
|
||||||
|
padding-top: initial;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-im-banner] .view-content > .markdown-source-view.mod-cm6 > .cm-editor > .cm-scroller .cm-sizer {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
margin-top: var(--im-banner-note-offset, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-im-banner][data-mode="source"] .view-content > .markdown-source-view.mod-cm6 > .cm-editor > .cm-scroller .cm-sizer {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-im-banner] .view-content {
|
||||||
|
margin-top: var(--im-banner-view-offset, 0);
|
||||||
|
}
|
||||||
@@ -0,0 +1,394 @@
|
|||||||
|
/*
|
||||||
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||||
|
if you want to view the source, please visit the github repository of this plugin
|
||||||
|
*/
|
||||||
|
|
||||||
|
(function initCjs() {
|
||||||
|
const globalThisRecord = globalThis;
|
||||||
|
globalThisRecord["__name"] ??= name;
|
||||||
|
const originalRequire = require;
|
||||||
|
if (originalRequire && !originalRequire.__isPatched) {
|
||||||
|
require = Object.assign(
|
||||||
|
(id) => requirePatched(id),
|
||||||
|
originalRequire,
|
||||||
|
{
|
||||||
|
__isPatched: true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
const newFuncs = {
|
||||||
|
__extractDefault() {
|
||||||
|
return extractDefault;
|
||||||
|
},
|
||||||
|
process() {
|
||||||
|
const browserProcess = {
|
||||||
|
browser: true,
|
||||||
|
cwd() {
|
||||||
|
return "/";
|
||||||
|
},
|
||||||
|
env: {},
|
||||||
|
platform: "android"
|
||||||
|
};
|
||||||
|
return browserProcess;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
for (const key of Object.keys(newFuncs)) {
|
||||||
|
globalThisRecord[key] ??= newFuncs[key]?.();
|
||||||
|
}
|
||||||
|
function name(obj) {
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
function extractDefault(module) {
|
||||||
|
return module && module.__esModule && "default" in module ? module.default : module;
|
||||||
|
}
|
||||||
|
const OBSIDIAN_BUILT_IN_MODULE_NAMES = [
|
||||||
|
"obsidian",
|
||||||
|
"@codemirror/autocomplete",
|
||||||
|
"@codemirror/collab",
|
||||||
|
"@codemirror/commands",
|
||||||
|
"@codemirror/language",
|
||||||
|
"@codemirror/lint",
|
||||||
|
"@codemirror/search",
|
||||||
|
"@codemirror/state",
|
||||||
|
"@codemirror/text",
|
||||||
|
"@codemirror/view",
|
||||||
|
"@lezer/common",
|
||||||
|
"@lezer/lr",
|
||||||
|
"@lezer/highlight"
|
||||||
|
];
|
||||||
|
const DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES = [
|
||||||
|
"@codemirror/closebrackets",
|
||||||
|
"@codemirror/comment",
|
||||||
|
"@codemirror/fold",
|
||||||
|
"@codemirror/gutter",
|
||||||
|
"@codemirror/highlight",
|
||||||
|
"@codemirror/history",
|
||||||
|
"@codemirror/matchbrackets",
|
||||||
|
"@codemirror/panel",
|
||||||
|
"@codemirror/rangeset",
|
||||||
|
"@codemirror/rectangular-selection",
|
||||||
|
"@codemirror/stream-parser",
|
||||||
|
"@codemirror/tooltip"
|
||||||
|
];
|
||||||
|
function requirePatched(id) {
|
||||||
|
if (OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id) || DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id)) {
|
||||||
|
return originalRequire?.(id);
|
||||||
|
}
|
||||||
|
if (globalThis?.app?.isMobile) {
|
||||||
|
if (id === "process" || id === "node:process") {
|
||||||
|
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Fake process object is returned instead.`);
|
||||||
|
return globalThis.process;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const module = originalRequire?.(id);
|
||||||
|
if (module) {
|
||||||
|
return extractDefault(module);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Empty object is returned instead.`);
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
|
"use strict";var Vn=Object.create;var he=Object.defineProperty;var Kn=Object.getOwnPropertyDescriptor;var Gn=Object.getOwnPropertyNames;var qn=Object.getPrototypeOf,Yn=Object.prototype.hasOwnProperty;var s=(n,e)=>he(n,"name",{value:e,configurable:!0});var H=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Jn=(n,e)=>{for(var t in e)he(n,t,{get:e[t],enumerable:!0})},Dt=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Gn(e))!Yn.call(n,r)&&r!==t&&he(n,r,{get:()=>e[r],enumerable:!(i=Kn(e,r))||i.enumerable});return n};var Ft=(n,e,t)=>(t=n!=null?Vn(qn(n)):{},Dt(e||!n||!n.__esModule?he(t,"default",{value:n,enumerable:!0}):t,n)),Xn=n=>Dt(he({},"__esModule",{value:!0}),n);var jt=H((_r,_t)=>{var ee=1e3,te=ee*60,ne=te*60,G=ne*24,Qn=G*7,ei=G*365.25;_t.exports=function(n,e){e=e||{};var t=typeof n;if(t==="string"&&n.length>0)return ti(n);if(t==="number"&&isFinite(n))return e.long?ii(n):ni(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function ti(n){if(n=String(n),!(n.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(e){var t=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return t*ei;case"weeks":case"week":case"w":return t*Qn;case"days":case"day":case"d":return t*G;case"hours":case"hour":case"hrs":case"hr":case"h":return t*ne;case"minutes":case"minute":case"mins":case"min":case"m":return t*te;case"seconds":case"second":case"secs":case"sec":case"s":return t*ee;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}s(ti,"parse");function ni(n){var e=Math.abs(n);return e>=G?Math.round(n/G)+"d":e>=ne?Math.round(n/ne)+"h":e>=te?Math.round(n/te)+"m":e>=ee?Math.round(n/ee)+"s":n+"ms"}s(ni,"fmtShort");function ii(n){var e=Math.abs(n);return e>=G?Se(n,e,G,"day"):e>=ne?Se(n,e,ne,"hour"):e>=te?Se(n,e,te,"minute"):e>=ee?Se(n,e,ee,"second"):n+" ms"}s(ii,"fmtLong");function Se(n,e,t,i){var r=e>=t*1.5;return Math.round(n/t)+" "+i+(r?"s":"")}s(Se,"plural")});var Qe=H((Br,Bt)=>{function ri(n){t.debug=t,t.default=t,t.coerce=u,t.disable=a,t.enable=r,t.enabled=l,t.humanize=jt(),t.destroy=c,Object.keys(n).forEach(d=>{t[d]=n[d]}),t.names=[],t.skips=[],t.formatters={};function e(d){let p=0;for(let f=0;f<d.length;f++)p=(p<<5)-p+d.charCodeAt(f),p|=0;return t.colors[Math.abs(p)%t.colors.length]}s(e,"selectColor"),t.selectColor=e;function t(d){let p,f=null,h,m;function v(...g){if(!v.enabled)return;let y=v,A=Number(new Date),w=A-(p||A);y.diff=w,y.prev=p,y.curr=A,p=A,g[0]=t.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let C=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,(x,M)=>{if(x==="%%")return"%";C++;let P=t.formatters[M];if(typeof P=="function"){let O=g[C];x=P.call(y,O),g.splice(C,1),C--}return x}),t.formatArgs.call(y,g),(y.log||t.log).apply(y,g)}return s(v,"debug"),v.namespace=d,v.useColors=t.useColors(),v.color=t.selectColor(d),v.extend=i,v.destroy=t.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:s(()=>f!==null?f:(h!==t.namespaces&&(h=t.namespaces,m=t.enabled(d)),m),"get"),set:s(g=>{f=g},"set")}),typeof t.init=="function"&&t.init(v),v}s(t,"createDebug");function i(d,p){let f=t(this.namespace+(typeof p>"u"?":":p)+d);return f.log=this.log,f}s(i,"extend");function r(d){t.save(d),t.namespaces=d,t.names=[],t.skips=[];let p=(typeof d=="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let f of p)f[0]==="-"?t.skips.push(f.slice(1)):t.names.push(f)}s(r,"enable");function o(d,p){let f=0,h=0,m=-1,v=0;for(;f<d.length;)if(h<p.length&&(p[h]===d[f]||p[h]==="*"))p[h]==="*"?(m=h,v=f,h++):(f++,h++);else if(m!==-1)h=m+1,v++,f=v;else return!1;for(;h<p.length&&p[h]==="*";)h++;return h===p.length}s(o,"matchesTemplate");function a(){let d=[...t.names,...t.skips.map(p=>"-"+p)].join(",");return t.enable(""),d}s(a,"disable");function l(d){for(let p of t.skips)if(o(d,p))return!1;for(let p of t.names)if(o(d,p))return!0;return!1}s(l,"enabled");function u(d){return d instanceof Error?d.stack||d.message:d}s(u,"coerce");function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return s(c,"destroy"),t.enable(t.load()),t}s(ri,"setup");Bt.exports=ri});var Wt=H((I,Te)=>{I.formatArgs=si;I.save=ai;I.load=li;I.useColors=oi;I.storage=ci();I.destroy=(()=>{let n=!1;return()=>{n||(n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();I.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CCLine truncated
|
||||||
|
`).join(`
|
||||||
|
`+o),n.push(r+"m+"+Le.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=yi()+e+" "+n[0]}s(mi,"formatArgs");function yi(){return S.inspectOpts.hideDate?"":new Date().toISOString()+" "}s(yi,"getDate");function bi(...n){return process.stderr.write(Oe.formatWithOptions(S.inspectOpts,...n)+`
|
||||||
|
`)}s(bi,"log");function Ai(n){n?process.env.DEBUG=n:delete process.env.DEBUG}s(Ai,"save");function vi(){return process.env.DEBUG}s(vi,"load");function wi(n){n.inspectOpts={};let e=Object.keys(S.inspectOpts);for(let t=0;t<e.length;t++)n.inspectOpts[e[t]]=S.inspectOpts[e[t]]}s(wi,"init");Le.exports=Qe()(S);var{formatters:Kt}=Le.exports;Kt.o=function(n){return this.inspectOpts.colors=this.useColors,Oe.inspect(n,this.inspectOpts).split(`
|
||||||
|
`).map(e=>e.trim()).join(" ")};Kt.O=function(n){return this.inspectOpts.colors=this.useColors,Oe.inspect(n,this.inspectOpts)}});var qt=H((Gr,tt)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?tt.exports=Wt():tt.exports=Gt()});var Rn=H((Ue,Pn)=>{(function(n,e){typeof Ue=="object"&&typeof Pn<"u"?e(Ue):typeof define=="function"&&define.amd?define(["exports"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.compareVersions={}))})(Ue,(function(n){"use strict";let e=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,t=s(g=>{if(typeof g!="string")throw new TypeError("Invalid argument expected string");let y=g.match(e);if(!y)throw new Error(`Invalid argument not valid semver ('${g}' received)`);return y.shift(),y},"validateAndParse"),i=s(g=>g==="*"||g==="x"||g==="X","isWildcard"),r=s(g=>{let y=parseInt(g,10);return isNaN(y)?g:y},"tryParse"),o=s((g,y)=>typeof g!=typeof y?[String(g),String(y)]:[g,y],"forceType"),a=s((g,y)=>{if(i(g)||i(y))return 0;let[A,w]=o(r(g),r(y));return A>w?1:A<w?-1:0},"compareStrings"),l=s((g,y)=>{for(let A=0;A<Math.max(g.length,y.length);A++){let w=a(g[A]||"0",y[A]||"0");if(w!==0)return w}return 0},"compareSegments"),u=s((g,y)=>{let A=t(g),w=t(y),C=A.pop(),T=w.pop(),x=l(A,w);return x!==0?x:C&&T?l(C.split("."),T.split(".")):C||T?C?-1:1:0},"compareVersions"),c=s((g,y,A)=>{f(A);let w=u(g,y);return d[A].includes(w)},"compare"),d={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},p=Object.keys(d),f=s(g=>{if(typeof g!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof g}`);if(p.indexOf(g)===-1)throw new Error(`Invalid operator, expected one of ${p.join("|")}`)},"assertValidOperator"),h=s((g,y)=>{if(y=y.replace(/([><=]+)\s+/g,"$1"),y.includes("||"))return y.split("||").some(k=>h(g,k));if(y.includes(" - ")){let[k,j]=y.split(" - ",2);return h(g,`>=${k} <=${j}`)}else if(y.includes(" "))return y.trim().replace(/\s{2,}/g," ").split(" ").every(k=>h(g,k));let A=y.match(/^([<>=~^]+)/),w=A?A[1]:"=";if(w!=="^"&&w!=="~")return c(g,y,w);let[C,T,x,,M]=t(g),[P,O,F,,xe]=t(y),de=[C,T,x],E=[P,O??"x",F??"x"];if(xe&&(!M||l(de,E)!==0||l(M.split("."),xe.split("."))===-1))return!1;let N=E.findIndex(k=>k!=="0")+1,U=w==="~"?2:N>1?N:1;return!(l(de.slice(0,U),E.slice(0,U))!==0||l(de.slice(U),E.slice(U))===-1)},"satisfies"),m=s(g=>typeof g=="string"&&/^[v\d]/.test(g)&&e.test(g),"validate"),v=s(g=>typeof g=="string"&&/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/.test(g),"validateStrict");n.compare=c,n.compareVersions=u,n.satisfies=h,n.validate=m,n.validateStrict=v}))});var xr={};Jn(xr,{default:()=>Er});module.exports=Xn(xr);var Ke=require("obsidian");s((function(){if(globalThis.process)return;let e={browser:!0,cwd(){return"/"},env:{},platform:"android"};globalThis.process=e}),"initEsm")();function Ze(n,e){let t=n.length,i=0;for(let r=0;r<t;r++){if(!Object.hasOwn(n,r))continue;let o=n[r];e(o,r,n)&&(n[i++]=o)}n.length=i}s(Ze,"filterInPlace");s((function(){if(globalThis.process)return;let e={browser:!0,cwd(){return"/"},env:{},platform:"android"};globalThis.process=e}),"initEsm")();var K=class{static{s(this,"AsyncEvents")}eventRefsMap=new Map;off(e,t){let i=this.eventRefsMap.get(e);i&&(Ze(i,r=>r.callback!==t),i.length===0&&this.eventRefsMap.delete(e))}offref(e){let t=this.eventRefsMap.get(e.name);t&&(Ze(t,i=>i!==e),t.length===0&&this.eventRefsMap.delete(e.name))}on(e,t,i){let r=this.eventRefsMap.get(e);r||(r=[],this.eventRefsMap.set(e,r));let o={asyncEvents:this,callback:t,name:e,thisArg:i};return r.push(o),o}once(e,t,i){let r=this.on(e,t,i),o=this.on(e,()=>{this.offref(r),this.offref(o)});return r}trigger(e,...t){let i=this.eventRefsMap.get(e)??[];for(let r of i.slice())this.tryTrigger(r,t)}async triggerAsync(e,...t){let i=this.eventRefsMap.get(e)??[];for(let r of i.slice())await this.tryTriggerAsync(r,t)}tryTrigger(e,t){try{e.callback.apply(e.thisArg,t)}catch(i){window.setTimeout(()=>{throw i},0)}}async tryTriggerAsync(e,t){try{await e.callback.call(e.thisArg,...t)}catch(i){window.setTimeout(()=>{throw i},0)}}};s((function(){if(globalThis.process)return;let e={browser:!0,cwd(){return"/"},env:{},platform:"android"};globalThis.process=e}),"initEsm")();function ge(){}s(ge,"noop");async function me(){}s(me,"noopAsync");s((function(){if(globalThis.process)return;let e={browser:!0,cwd(){return"/"},env:{},platform:"android"};globalThis.process=e}),"initEsm")();var Zn=Number.POSITIVE_INFINITY;function Nt(...n){let e=n.filter(o=>!!o);if(typeof AbortSignal.any=="function")return AbortSignal.any(e);if(e.length===0)return Q();if(e.length===1&&e[0])return e[0];let t=new AbortController;for(let o of e)if(o.aborted)return o;let i=[];for(let o of e)i.push(Mt(o,r));return t.signal;function r(o){for(let a of i)a();t.abort(o.reason)}}s(Nt,"
Line truncated
|
||||||
|
`),l=t.split(`
|
||||||
|
`);/^\w*Error(?:: |$)/.test(_(l[0]))&&l.splice(0,1),a.splice(1,a.length-1,...l),this.stack=a.join(`
|
||||||
|
`)}},oe=class n extends Error{static{s(this,"SilentError")}constructor(e){super(e),this.name="SilentError",Error.captureStackTrace?.(this,n)}};function Zt(n){Pe.trigger(it,n)}s(Zt,"emitAsyncErrorEvent");function rt(n){if(!(n instanceof Error))return String(n);let e=n.stack??`${n.name}: ${n.message}`;if(n.cause!==void 0){let t=rt(n.cause).split(`
|
||||||
|
`);e+=`
|
||||||
|
${Yt("Caused by:")}`;for(let i of t)i.trim()&&(e+=i.startsWith(Xt)?`
|
||||||
|
${i}`:`
|
||||||
|
${Yt(i)}`)}return e}s(rt,"errorToString");function se(n=0){return _(new Error().stack).split(`
|
||||||
|
`).slice(n+2).join(`
|
||||||
|
`)}s(se,"getStackTrace");function Qt(n,e){e??=globalThis.console,e.error(rt(n))}s(Qt,"printError");function en(n){let e=Pe.on(it,n);return()=>{Pe.offref(e)}}s(en,"registerAsyncErrorEventHandler");function Yt(n){return`${Xt} --- ${n} --- (0)`}s(Yt,"generateStackTraceLine");function Ci(n){Qt(n)}s(Ci,"handleAsyncError");s((function(){if(globalThis.process)return;let e={browser:!0,cwd(){return"/"},env:{},platform:"android"};globalThis.process=e}),"initEsm")();var ot="53.1.1",Re="obsidian-dev-utils",tn=`.obsidian-dev-utils.code-highlighter-component textarea, .obsidian-dev-utils.code-highlighter-component pre, .obsidian-dev-utils.code-highlighter-component code {
|
||||||
|
font-family: var(--font-monospace);
|
||||||
|
line-height: var(--line-height-normal);
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.obsidian-dev-utils.code-highlighter-component textarea, .obsidian-dev-utils.code-highlighter-component code {
|
||||||
|
font-size: var(--code-size);
|
||||||
|
}
|
||||||
|
.obsidian-dev-utils.code-highlighter-component textarea {
|
||||||
|
background: transparent;
|
||||||
|
color: transparent;
|
||||||
|
z-index: 2;
|
||||||
|
width: 20em;
|
||||||
|
height: 10em;
|
||||||
|
}
|
||||||
|
.obsidian-dev-utils.code-highlighter-component pre {
|
||||||
|
position: absolute;
|
||||||
|
pointer-events: none;
|
||||||
|
border: var(--input-border-width) solid transparent;
|
||||||
|
overflow: auto;
|
||||||
|
inset: 0;
|
||||||
|
padding: var(--size-4-1) var(--size-4-2);
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
.obsidian-dev-utils.code-highlighter-component pre::after {
|
||||||
|
content: "";
|
||||||
|
display: block;
|
||||||
|
height: var(--bottom-gap, 0);
|
||||||
|
}
|
||||||
|
.obsidian-dev-utils.code-highlighter-component pre.is-placeholder {
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
.obsidian-dev-utils.code-highlighter-component code {
|
||||||
|
display: block;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian-dev-utils input[type=url] {
|
||||||
|
height: var(--input-height);
|
||||||
|
}
|
||||||
|
.obsidian-dev-utils input[type=month],
|
||||||
|
.obsidian-dev-utils input[type=tel],
|
||||||
|
.obsidian-dev-utils input[type=time],
|
||||||
|
.obsidian-dev-utils input[type=url],
|
||||||
|
.obsidian-dev-utils input[type=week] {
|
||||||
|
-webkit-app-region: no-drag;
|
||||||
|
background: var(--background-modifier-form-field);
|
||||||
|
border: var(--input-border-width) solid var(--background-modifier-border);
|
||||||
|
color: var(--text-normal);
|
||||||
|
font-family: inherit;
|
||||||
|
padding: var(--size-4-1) var(--size-4-2);
|
||||||
|
font-size: var(--font-ui-small);
|
||||||
|
border-radius: var(--input-radius);
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
@media (hover: hover) {
|
||||||
|
.obsidian-dev-utils input[type=month]:hover,
|
||||||
|
.obsidian-dev-utils input[type=tel]:hover,
|
||||||
|
.obsidian-dev-utils input[type=time]:hover,
|
||||||
|
.obsidian-dev-utils input[type=url]:hover,
|
||||||
|
.obsidian-dev-utils input[type=week]:hover {
|
||||||
|
border-color: var(--background-modifier-border-hover);
|
||||||
|
transition: box-shadow 0.15s ease-in-out, border 0.15s ease-in-out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.obsidian-dev-utils input[type=month]:active, .obsidian-dev-utils input[type=month]:focus,
|
||||||
|
.obsidian-dev-utils input[type=tel]:active,
|
||||||
|
.obsidian-dev-utils input[type=tel]:focus,
|
||||||
|
.obsidian-dev-utils input[type=time]:active,
|
||||||
|
.obsidian-dev-utils input[type=time]:focus,
|
||||||
|
.obsidian-dev-utils input[type=url]:active,
|
||||||
|
.obsidian-dev-utils input[type=url]:focus,
|
||||||
|
.obsidian-dev-utils input[type=week]:active,
|
||||||
|
.obsidian-dev-utils input[type=week]:focus {
|
||||||
|
border-color: var(--background-modifier-border-focus);
|
||||||
|
transition: box-shadow 0.15s ease-in-out, border 0.15s ease-in-out;
|
||||||
|
}
|
||||||
|
.obsidian-dev-utils input[type=month]:active, .obsidian-dev-utils input[type=month]:focus, .obsidian-dev-utils input[type=month]:focus-visible,
|
||||||
|
.obsidian-dev-utils input[type=tel]:active,
|
||||||
|
.obsidian-dev-utils input[type=tel]:focus,
|
||||||
|
.obsidian-dev-utils input[type=tel]:focus-visible,
|
||||||
|
.obsidian-dev-utils input[type=time]:active,
|
||||||
|
.obsidian-dev-utils input[type=time]:focus,
|
||||||
|
.obsidian-dev-utils input[type=time]:focus-visible,
|
||||||
|
.obsidian-dev-utils input[type=url]:active,
|
||||||
|
.obsidian-dev-utils input[type=url]:focus,
|
||||||
|
.obsidian-dev-utils input[type=url]:focus-visible,
|
||||||
|
.obsidian-dev-utils input[type=week]:active,
|
||||||
|
.obsidian-dev-utils input[type=week]:focus,
|
||||||
|
.obsidian-dev-utils input[type=week]:focus-visible {
|
||||||
|
box-shadow: 0 0 0 2px var(--background-modifier-border-focus);
|
||||||
|
}
|
||||||
|
.obsidian-dev-utils input[type=month]::placeholder,
|
||||||
|
.obsidian-dev-utils input[type=tel]::placeholder,
|
||||||
|
.obsidian-dev-utils input[type=time]::placeholder,
|
||||||
|
.obsidian-dev-utils input[type=url]::placeholder,
|
||||||
|
.obsidian-dev-utils input[type=week]::placeholder {
|
||||||
|
color: var(--text-faint);
|
||||||
|
}
|
||||||
|
.mod-rtl input[type=month],
|
||||||
|
.mod-rtl input[type=time],
|
||||||
|
.mod-rtl input[type=week],
|
||||||
|
.is-rtl input[type=month],
|
||||||
|
.is-rtl input[type=time],
|
||||||
|
.is-rtl input[type=week],
|
||||||
|
.rtl input[type=month],
|
||||||
|
.rtl input[type=time],
|
||||||
|
.rtl input[type=week] {
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
.mod-rtl input[type=month]::-webkit-calendar-picker-indicator,
|
||||||
|
.mod-rtl input[type=time]::-webkit-calendar-picker-indicator,
|
||||||
|
.mod-rtl input[type=week]::-webkit-calendar-picker-indicator,
|
||||||
|
.is-rtl input[type=month]::-webkit-calendar-picker-indicator,
|
||||||
|
.is-rtl input[type=time]::-webkit-calendar-picker-indicator,
|
||||||
|
.is-rtl input[type=week]::-webkit-calendar-picker-indicator,
|
||||||
|
.rtl input[type=month]::-webkit-calendar-picker-indicator,
|
||||||
|
.rtl input[type=time]::-webkit-calendar-picker-indicator,
|
||||||
|
.rtl input[type=week]::-webkit-calendar-picker-indicator {
|
||||||
|
right: var(--size-4-1);
|
||||||
|
left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian-dev-utils input[type=month],
|
||||||
|
.obsidian-dev-utils input[type=time],
|
||||||
|
.obsidian-dev-utils input[type=week] {
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.obsidian-dev-utils input[type=month]::-webkit-datetime-edit-text,
|
||||||
|
.obsidian-dev-utils input[type=time]::-webkit-datetime-edit-text,
|
||||||
|
.obsidian-dev-utils input[type=week]::-webkit-datetime-edit-text {
|
||||||
|
color: var(--text-faint);
|
||||||
|
padding-inline-end: 0;
|
||||||
|
}
|
||||||
|
.obsidian-dev-utils input[type=month]::-webkit-calendar-picker-indicator,
|
||||||
|
.obsidian-dev-utils input[type=time]::-webkit-calendar-picker-indicator,
|
||||||
|
.obsidian-dev-utils input[type=week]::-webkit-calendar-picker-indicator {
|
||||||
|
position: absolute;
|
||||||
|
left: var(--size-4-1);
|
||||||
|
right: auto;
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
.obsidian-dev-utils input[type=month]::-webkit-datetime-edit-month-field:active, .obsidian-dev-utils input[type=month]::-webkit-datetime-edit-month-field:focus, .obsidian-dev-utils input[type=month]::-webkit-datetime-edit-day-field:active, .obsidian-dev-utils input[type=month]::-webkit-datetime-edit-day-field:focus, .obsidian-dev-utils input[type=month]::-webkit-datetime-edit-year-field:active, .obsidian-dev-utils input[type=month]::-webkit-datetime-edit-year-field:focus,
|
||||||
|
.obsidian-dev-utils input[type=time]::-webkit-datetime-edit-month-field:active,
|
||||||
|
.obsidian-dev-utils input[type=time]::-webkit-datetime-edit-month-field:focus,
|
||||||
|
.obsidian-dev-utils input[type=time]::-webkit-datetime-edit-day-field:active,
|
||||||
|
.obsidian-dev-utils input[type=time]::-webkit-datetime-edit-day-field:focus,
|
||||||
|
.obsidian-dev-utils input[type=time]::-webkit-datetime-edit-year-field:active,
|
||||||
|
.obsidian-dev-utils input[type=time]::-webkit-datetime-edit-year-field:focus,
|
||||||
|
.obsidian-dev-utils input[type=week]::-webkit-datetime-edit-month-field:active,
|
||||||
|
.obsidian-dev-utils input[type=week]::-webkit-datetime-edit-month-field:focus,
|
||||||
|
.obsidian-dev-utils input[type=week]::-webkit-datetime-edit-day-field:active,
|
||||||
|
.obsidian-dev-utils input[type=week]::-webkit-datetime-edit-day-field:focus,
|
||||||
|
.obsidian-dev-utils input[type=week]::-webkit-datetime-edit-year-field:active,
|
||||||
|
.obsidian-dev-utils input[type=week]::-webkit-datetime-edit-year-field:focus {
|
||||||
|
background-color: var(--text-selection);
|
||||||
|
color: var(--text-normal);
|
||||||
|
cursor: text;
|
||||||
|
}
|
||||||
|
.mod-rtl .obsidian-dev-utils input[type=month], .is-rtl .obsidian-dev-utils input[type=month], .rtl .obsidian-dev-utils input[type=month],
|
||||||
|
.mod-rtl .obsidian-dev-utils input[type=time],
|
||||||
|
.is-rtl .obsidian-dev-utils input[type=time],
|
||||||
|
.rtl .obsidian-dev-utils input[type=time],
|
||||||
|
.mod-rtl .obsidian-dev-utils input[type=week],
|
||||||
|
.is-rtl .obsidian-dev-utils input[type=week],
|
||||||
|
.rtl .obsidian-dev-utils input[type=week] {
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
.mod-rtl .obsidian-dev-utils input[type=month]::-webkit-calendar-picker-indicator, .is-rtl .obsidian-dev-utils input[type=month]::-webkit-calendar-picker-indicator, .rtl .obsidian-dev-utils input[type=month]::-webkit-calendar-picker-indicator,
|
||||||
|
.mod-rtl .obsidian-dev-utils input[type=time]::-webkit-calendar-picker-indicator,
|
||||||
|
.is-rtl .obsidian-dev-utils input[type=time]::-webkit-calendar-picker-indicator,
|
||||||
|
.rtl .obsidian-dev-utils input[type=time]::-webkit-calendar-picker-indicator,
|
||||||
|
.mod-rtl .obsidian-dev-utils input[type=week]::-webkit-calendar-picker-indicator,
|
||||||
|
.is-rtl .obsidian-dev-utils input[type=week]::-webkit-calendar-picker-indicator,
|
||||||
|
.rtl .obsidian-dev-utils input[type=week]::-webkit-calendar-picker-indicator {
|
||||||
|
left: auto;
|
||||||
|
right: var(--size-4-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
body:not(.is-ios):not(.is-android) .obsidian-dev-utils input[type=month],
|
||||||
|
body:not(.is-ios):not(.is-android) .obsidian-dev-utils input[type=time],
|
||||||
|
body:not(.is-ios):not(.is-android) .obsidian-dev-utils input[type=week] {
|
||||||
|
padding-inline-start: var(--size-4-6);
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian-dev-utils input[type=time]::-webkit-calendar-picker-indicator {
|
||||||
|
margin-inline-start: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian-dev-utilsprogress.loop {
|
||||||
|
min-width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian-dev-utils.modal-container .ok-button {
|
||||||
|
margin-right: 10px;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian-dev-utils .multiple-dropdown-component select,
|
||||||
|
.obsidian-dev-utils .multiple-dropdown-component select:focus,
|
||||||
|
.obsidian-dev-utils .multiple-dropdown-component .dropdown {
|
||||||
|
height: auto;
|
||||||
|
padding-top: 3px;
|
||||||
|
}
|
||||||
|
.obsidian-dev-utils .multiple-dropdown-component select option:checked,
|
||||||
|
.obsidian-dev-utils .multiple-dropdown-component select:focus option:checked,
|
||||||
|
.obsidian-dev-utils .multiple-dropdown-component .dropdown option:checked {
|
||||||
|
background-color: #1967d2;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian-dev-utils.plugin-settings-tab a:focus {
|
||||||
|
outline: 2px solid var(--link-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian-dev-utils.prompt-modal .text-box {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian-dev-utils.tri-state-checkbox-component input[type=checkbox]:indeterminate {
|
||||||
|
appearance: checkbox;
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian-dev-utils :invalid {
|
||||||
|
box-shadow: 0 0 0 2px var(--text-error);
|
||||||
|
}
|
||||||
|
.obsidian-dev-utils input.metadata-input-text:active:invalid, .obsidian-dev-utils input.metadata-input-text:focus-visible:invalid, .obsidian-dev-utils input.metadata-input-text:focus:invalid,
|
||||||
|
.obsidian-dev-utils input[type=date]:active:invalid,
|
||||||
|
.obsidian-dev-utils input[type=date]:focus-visible:invalid,
|
||||||
|
.obsidian-dev-utils input[type=date]:focus:invalid,
|
||||||
|
.obsidian-dev-utils input[type=datetime-local]:active:invalid,
|
||||||
|
.obsidian-dev-utils input[type=datetime-local]:focus-visible:invalid,
|
||||||
|
.obsidian-dev-utils input[type=datetime-local]:focus:invalid,
|
||||||
|
.obsidian-dev-utils input[type=email]:active:invalid,
|
||||||
|
.obsidian-dev-utils input[type=email]:focus-visible:invalid,
|
||||||
|
.obsidian-dev-utils input[type=email]:focus:invalid,
|
||||||
|
.obsidian-dev-utils input[type=number]:active:invalid,
|
||||||
|
.obsidian-dev-utils input[type=number]:focus-visible:invalid,
|
||||||
|
.obsidian-dev-utils input[type=number]:focus:invalid,
|
||||||
|
.obsidian-dev-utils input[type=password]:active:invalid,
|
||||||
|
.obsidian-dev-utils input[type=password]:focus-visible:invalid,
|
||||||
|
.obsidian-dev-utils input[type=password]:focus:invalid,
|
||||||
|
.obsidian-dev-utils input[type=search]:active:invalid,
|
||||||
|
.obsidian-dev-utils input[type=search]:focus-visible:invalid,
|
||||||
|
.obsidian-dev-utils input[type=search]:focus:invalid,
|
||||||
|
.obsidian-dev-utils input[type=text]:active:invalid,
|
||||||
|
.obsidian-dev-utils input[type=text]:focus-visible:invalid,
|
||||||
|
.obsidian-dev-utils input[type=text]:focus:invalid,
|
||||||
|
.obsidian-dev-utils textarea:active:invalid,
|
||||||
|
.obsidian-dev-utils textarea:focus-visible:invalid,
|
||||||
|
.obsidian-dev-utils textarea:focus:invalid {
|
||||||
|
box-shadow: 0 0 0 2px var(--text-error);
|
||||||
|
}
|
||||||
|
.obsidian-dev-utils.setting-component-wrapper {
|
||||||
|
position: relative;
|
||||||
|
display: inline-flex;
|
||||||
|
}
|
||||||
|
.obsidian-dev-utils.overlay-validator {
|
||||||
|
caret-color: transparent;
|
||||||
|
cursor: default;
|
||||||
|
position: absolute;
|
||||||
|
background-color: transparent;
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
pointer-events: none;
|
||||||
|
z-index: 9999;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.obsidian-dev-utils.tooltip.tooltip-validator {
|
||||||
|
position: absolute;
|
||||||
|
top: calc(100% + 8px);
|
||||||
|
width: max-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*# sourceMappingURL=data:application/json;charset=utf-8,%7B%22version%22:3,%22sourceRoot%22:%22%22,%22sources%22:%5B%22../src/styles/code-highlighter-component.scss%22,%22../src/styles/input.scss%22,%22../src/styles/input-time.scss%22,%22../src/styles/loop.scss%22,%22../src/styles/modal-container.scss%22,%22../src/styles/multiple-dropdown-component.scss%22,%22../src/styles/plugin-settings-tab.scss%22,%22../src/styles/prompt-modal.scss%22,%22../src/styles/tri-state-checkbox-component.scss%22,%22../src/styles/validation.scss%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AAEI;EACE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;EACA;;;ACzCJ;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;EAKE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGE;EACE;AAAA;AAAA;AAAA;AAAA;IACE;IACA,YACE;;;AAMR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAEE;EACA,YACE;;AAIJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAGE;;AAGF;AAAA;AAAA;AAAA;AAAA;EACE;;AASE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAGE;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;;;AC7DV;AAAA;AAAA;EAGE;EACA;;AAEA;AAAA;AAAA;EACE;EACA;;AAGF;AAAA;AAAA;EACE;EACA;EACA;EACA;;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAEE;EACA;EACA;;AAIK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAGP;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;;;AAKF;AAAA;AAAA;EACE;;;AAMJ;EACE;;;ACjDJ;EACE;;;ACAA;EACE;EACA;;;ACFF;AAAA;AAAA;EAGE;EACA;;AAEA;AAAA;AAAA;EACE;EACA;;;ACRJ;EACE;;;ACDF;EACE;;;ACDF;EACE;;;ACEJ;EAJA;;AAoBI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EApBJ;;AA0BA;EACE;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA%22,%22file%22:%22styles.css%22,%22sourcesContent%22:%5B%22.obsidian-dev-utils%20%7B%5Cn%20%20&.code-highlighter-component%20%7B%5Cn%20%20%20%20textarea,%20pre,%20code%20%7B%5Cn%20%20%20%20%20%20font-family:%20var(--font-monospace);%5Cn%20%20%20%20%20%20line-height:%20var(--line-height-normal);%5Cn%20%20%20%20%20%20margin:%200;%5Cn%20%20%20%20%7D%5Cn%5Cn%20%20%20%20textarea,%20code%20%7B%5Cn%20%20%20%20%20%20font-size:%20var(--code-size);%5Cn%20%20%20%20%7D%5Cn%5Cn%20%20%20%20textarea%20%7B%5Cn%20%20%20%20%20%20background:%20transparent;%5Cn%20%20%20%20%20%20color:%20transparent;%5Cn%20%20%20%20%20%20z-index:%202;%5Cn%20%20%20%20%20%20width:%2020em;%5Cn%20%20%20%20%20%20height:%2010em;%5Cn%20%20%20%20%7D%5Cn%5Cn%20%20%20%20pre%20%7B%5Cn%20%20%20%20%20%20position:%20absolute;%5Cn%20%20%20%20%20%20pointer-events:%20none;%5Cn%20%20%20%20%20%20border:%20var(--input-border-width)%20solid%20transparent;%5Cn%20%20%20%20%20%20overflow:%20auto;%5Cn%20%20%20%20%20%20inset:%200;%5Cn%20%20%20%20%20%20padding:%20var(--size-4-1)%20var(--size-4-2);%5Cn%20%20%20%20%20%20z-index:%201;%5Cn%20%20%20%20%7D%5Cn%5Cn%20%20%20%20pre::after%20%7B%5Cn%20%20%20%20%20%20content:%20%5C%22%5C%22;%5Cn%20%20%20%20%20%20display:%20block;%5Cn%20%20%20%20%20%20height:%20var(--bottom-gap,%200);%5Cn%20%20%20%20%7D%5Cn%5Cn%20%20%20%20pre.is-placeholder%20%7B%5Cn%20%20%20%20%20%20opacity:%200.6;%5Cn%20%20%20%20%7D%5Cn%5Cn%20%20%20%20code%20%7B%5Cn%20%20%20%20%20%20display:%20block;%5Cn%20%20%20%20%20%20padding:%200;%5Cn%20%20%20%20%7D%5Cn%20%20%7D%5Cn%7D%5Cn%22,%22.obsidian-dev-utils%20%7B%5Cn%20%20input%5Btype='url'%5D%20%7B%5Cn%20%20%20%20height:%20var(--input-height)%5Cn%20%20%7D%5Cn%5Cn%20%20input%5Btype='month'%5D,%5Cn%20%20input%5Btype='tel'%5D,%5Cn%20%20input%5Btype='time'%5D,%5Cn%20%20input%5Btype='url'%5D,%5Cn%20%20input%5Btype='week'%5D%20%7B%5Cn%20%20%20%20-webkit-app-region:%20no-drag;%5Cn%20%20%20%20background:%20var(--background-modifier-form-field);%5Cn%20%20%20%20border:%20var(--input-border-width)%20solid%20var(--background-modifier-border);%5Cn%20%20%20%20color:%20var(--text-normal);%5Cn%20%20%20%20font-family:%20inherit;%5Cn%20%20%20%20padding:%20var(--size-4-1)%20var(--size-4-2);%5Cn%20%20%20%20font-size:%20var(--font-ui-small);%5Cn%20%20%20%20border-radius:%20var(--input-radius);%5Cn%20%20%20%20outline:%20none;%5Cn%5Cn%20%20%20%20@at-root%20%7B%5Cn%20%20%20%20%20%20@media%20(hover:%20hover)%20%7B%5Cn%20%20%20%20%20%20%20%20&:hover%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20border-color:%20var(--background-modifier-border-hover);%5Cn%20%20%20%20%20%20%20%20%20%20transition:%5Cn%20%20%20%20%20%20%20%20%20%20%20%20box-shadow%200.15s%20ease-in-out,%5Cn%20%20%20%20%20%20%20%20%20%20%20%20border%200.15s%20ease-in-out;%5Cn%20%20%20%20%20%20%20%20%7D%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%7D%5Cn%5Cn%20%20%20%20&:active,%5Cn%20%20%20%20&:focus%20%7B%5Cn%20%20%20%20%20%20border-color:%20var(--background-modifier-border-focus);%5Cn%20%20%20%20%20%20transition:%5Cn%20%20%20%20%20%20%20%20box-shadow%200.15s%20ease-in-out,%5Cn%20%20%20%20%20%20%20%20border%200.15s%20ease-in-out;%5Cn%20%20%20%20%7D%5Cn%5Cn%20%20%20%20&:active,%5Cn%20%20%20%20&:focus,%5Cn%20%20%20%20&:focus-visible%20%7B%5Cn%Line truncated
|
||||||
|
`;s((function(){if(globalThis.process)return;let e={browser:!0,cwd(){return"/"},env:{},platform:"android"};globalThis.process=e}),"initEsm")();var st=class{static{s(this,"ValueWrapper")}constructor(e){this.value=e}};function at(){let n=globalThis.app;if(n)return n;try{return globalThis.require("obsidian/app")}catch{throw new Error("Obsidian App global instance not found")}}s(at,"getApp");function ye(n,e,t){let r=n??Ei()??globalThis;return r.obsidianDevUtilsState??={},r.obsidianDevUtilsState[e]??=new st(t)}s(ye,"getObsidianDevUtilsState");function Ei(){try{return at()}catch{return null}}s(Ei,"getAppOrNull");s((function(){if(globalThis.process)return;let e={browser:!0,cwd(){return"/"},env:{},platform:"android"};globalThis.process=e}),"initEsm")();function lt(){if(typeof window>"u")return!1;try{return at(),!0}catch{return!1}}s(lt,"isInObsidian");s((function(){if(globalThis.process)return;let e={browser:!0,cwd(){return"/"},env:{},platform:"android"};globalThis.process=e}),"initEsm")();var ct="__no-plugin-id-initialized__",nn=ct;function ut(){return nn}s(ut,"getPluginId");function rn(n){n&&(nn=n)}s(rn,"setPluginId");s((function(){if(globalThis.process)return;let e={browser:!0,cwd(){return"/"},env:{},platform:"android"};globalThis.process=e}),"initEsm")();var on=",",De="-";function sn(){return{disable:xi,enable:ki,get:Ne,set:be}}s(sn,"getDebugController");function Fe(n,e=0){let t=`${n}:${String(e)}`,i=ye(null,"debuggers",new Map).value,r=i.get(t);return r||(r=Ae()(n),r.log=(o,...a)=>{Si(n,e,o,...a)},i.set(t,r)),r}s(Fe,"getDebugger");function an(n){let e=ut(),t=e===ct?"":`${e}:`;return Fe(`${t}${Re}:${n}`)}s(an,"getLibDebugger");function ln(n){let e=Ae().enabled(n),t=e?"enabled":"disabled",i=e?"disable":"enable",r=Ne();be(n),Fe(n)(`Debug messages for plugin ${n} are ${t}. See https://github.com/mnaoumov/obsidian-dev-utils/blob/main/docs/debugging.md how to ${i} them.`),be(r)}s(ln,"showInitialDebugMessage");function xi(n){let e=new Set(Ne());for(let t of ve(n)){if(t.startsWith(De))continue;let i=De+t;e.has(t)&&e.delete(t),e.add(i)}be(Array.from(e))}s(xi,"disableNamespaces");function ki(n){let e=new Set(Ne());for(let t of ve(n)){if(!t.startsWith(De)){let i=De+t;e.has(i)&&e.delete(i)}e.add(t)}be(Array.from(e))}s(ki,"enableNamespaces");function Ne(){return ve(Ae().load()??"")}s(Ne,"getNamespaces");function Ae(){return lt()?ye(null,"debug",dt.default).value:dt.default}s(Ae,"getSharedDebugLibInstance");function Si(n,e,t,...i){if(!Ae().enabled(n))return;if(!lt()){console.debug(t,...i);return}let r=4,o=_(new Error().stack).split(`
|
||||||
|
`);o.splice(0,r+e),console.debug(t,...i,`
|
||||||
|
|
||||||
|
---
|
||||||
|
Logger stack trace:
|
||||||
|
`,Ti(o.join(`
|
||||||
|
`)))}s(Si,"logWithCaller");function Ti(n){return new re("Debug mode: intentional placeholder error. See https://github.com/mnaoumov/obsidian-dev-utils/blob/main/docs/debugging.md.",n,void 0)}s(Ti,"makeStackTraceError");function be(n){Ae().enable(ve(n).join(on))}s(be,"setNamespaces");function ve(n){return typeof n=="string"?n.split(on).filter(Boolean):n.flatMap(ve)}s(ve,"toArray");s((function(){if(globalThis.process)return;let e={browser:!0,cwd(){return"/"},env:{},platform:"android"};globalThis.process=e}),"initEsm")();s((function(){if(globalThis.process)return;let e={browser:!0,cwd(){return"/"},env:{},platform:"android"};globalThis.process=e}),"initEsm")();s((function(){if(globalThis.process)return;let e={browser:!0,cwd(){return"/"},env:{},platform:"android"};globalThis.process=e}),"initEsm")();var Oi={"\n":"\\n","\r":"\\r"," ":"\\t","\b":"\\b","\f":"\\f","'":"\\'",'"':'\\"',"\\":"\\\\"};var Li={};for(let[n,e]of Object.entries(Oi))Li[e]=n;s((function(){if(globalThis.process)return;let e={browser:!0,cwd(){return"/"},env:{},platform:"android"};globalThis.process=e}),"initEsm")();var Pi=[{constructor:ArrayBuffer,equalityComparer:Ri},{constructor:Date,equalityComparer:Di},{constructor:RegExp,equalityComparer:Ni},{constructor:Map,equalityComparer:Fi},{constructor:Set,equalityComparer:Ii}];function Ie(n,e){if(n===e)return!0;if(typeof n!="object"||typeof e!="object"||n===null||e===null)return!1;let t=n.constructor,i=e.constructor;if(t!==i)return!1;if(t!==Object){let u=Mi(n,e);if(u!==void 0)return u}let r=cn(n),o=cn(e);if(r.length!==o.length)return!1;let a=n,l=e;for(let u of r)if(!o.includes(u)||!Ie(a[u],l[u]))return!1;return!0}s(Ie,"deepEqual");function cn(n){let e=[],t=n;for(;t;){let i=Object.getOwnPropertyDescriptors(t);for(let[r,o]of Object.entries(i)){if(r==="__proto__"||typeof o.value=="function")continue;let a=typeof o.get=="function",l=typeof o.set=="function";if(a||l){a&&l&&e.push(r);continue}o.enumerable&&o.writable&&e.push(r)}t=Object.getPrototypeOf(t)}return e.sort()}s(cn,"getAllKeys");function Ri(n,e){if(n.byteLength!==e.byteLength)return!1;let t=new Uint8Array(n),i=new Uint8Array(e);return Ie(t,i)}s(Ri,"deepEqualArrayBuffer");function Di(n,e){return n.getTime()===e.getTime()}s(Di,"deepEqualDate");function Fi(n,e){if(n.size!==e.size)return!1;for(let[t,i]of n.entries())if(!e.has(t)||!Ie(i,e.get(t)))return!1;return!0}s(Fi,"deepEqualMap");function Ni(n,e){return n.source===e.source&&n.flags===e.flags}s(Ni,"deepEqualRegExp");function Ii(n,e){if(n.size!==e.size)return!1;for(let t of n){if(e.has(t))continue;let i=!1;for(let r of e)if(Ie(t,r)){i=!0;break}if(!i)return!1}return!0}s(Ii,"deepEqualSet");function Mi(n,e){for(let{constructor:t,equalityComparer:i}of Pi)if(n instanceof t&&e instanceof t)return i(n,e)}s(Mi,"deepEqualTyped");s((function(){if(globalThis.process)return;let e={browser:!0,cwd(){return"/"},env:{},platform:"android"};globalThis.process=e}),"initEsm")();async function $i(n,e){e??=se(1);try{await n()}catch(t){let i=new re(Jt,e,t);if(_i(i))return;Zt(i)}}s($i,"addErrorHandler");function q(n,e){return e??=se(1),(...t)=>{nt(e);let i=se(1);e=`${e}
|
||||||
|
at --- convertAsyncToSync --- (0)
|
||||||
|
${i}`,Y(()=>n(...t),e)}}s(q,"convertAsyncToSync");function _i(n){let e=n;for(;!(e instanceof oe);){if(!(e instanceof Error))return!1;e=e.cause}return an("Async:handleSilentError")(n),!0}s(_i,"handleSilentError");function Y(n,e){e??=se(1),$i(n,e)}s(Y,"invokeAsyncSafely");function un(n,e=0,t,i){i??=Q(),i.throwIfAborted(),t??=se(1),Y(async()=>{await ji(e,i,!0),await n(i)},t)}s(un,"invokeAsyncSafelyAfterDelay");async function ji(n,e,t){await $t(Nt(e,It(n))),t&&e?.throwIfAborted()}s(ji,"sleep");s((function(){if(globalThis.process)return;let e={browser:!0,cwd(){return"/"},env:{},platform:"android"};globalThis.process=e}),"initEsm")();function Bi(n){let e=new Set;return n.workspace.iterateAllLeaves(t=>{e.add(t.getContainer())}),Array.from(e)}s(Bi,"getAllContainers");function dn(n){return Bi(n).map(e=>e.win)}s(dn,"getAllDomWindows");s((function(){if(globalThis.process)return;let e={browser:!0,cwd(){return"/"},env:{},platform:"android"};globalThis.process=e}),"initEsm")();var ae=class{static{s(this,"AllWindowsEventHandler")}constructor(e,t){this.app=e,this.component=t}registerAllDocumentsDomEvent(e,t,i){this.registerAllWindowsHandler(r=>{this.component.registerDomEvent(r.document,e,t,i)})}registerAllWindowsDomEvent(e,t,i){this.registerAllWindowsHandler(r=>{this.component.registerDomEvent(r,e,t,i)})}registerAllWindowsHandler(e){let t=window;e(t),this.app.workspace.onLayoutReady(()=>{for(let i of dn(this.app))i!==t&&e(i);this.component.registerEvent(this.app.workspace.on("window-open",i=>{e(i.win)}))})}};var Wi=require("obsidian");s((function(){if(globalThis.process)return;let e={browser:!0,cwd(){return"/"},env:{},platform:"android"};globalThis.process=e}),"initEsm")();function ft(n,e){n.register(()=>{e.asyncEvents.offref(e)})}s(ft,"registerAsyncEvent");var b=s(n=>typeof n=="string","isString"),we=s(()=>{let n,e,t=new Promise((i,r)=>{n=i,e=r});return t.resolve=n,t.reject=e,t},"defer"),pn=s(n=>n==null?"":""+n,"makeString"),Hi=s((n,e,t)=>{n.forEach(i=>{e[i]&&(t[i]=e[i])})},"copy"),zi=/###/g,fn=s(n=>n&&n.indexOf("###")>-1?n.replace(zi,"."):n,"cleanKey"),hn=s(n=>!n||b(n),"canNotTraverseDeeper"),Ce=s((n,e,t)=>{let i=b(e)?e.split("."):e,r=0;for(;r<i.length-1;){if(hn(n))return{};let o=fn(i[r]);!n[o]&&t&&(n[o]=new t),Object.prototype.hasOwnProperty.call(n,o)?n=n[o]:n={},++r}return hn(n)?{}:{obj:n,k:fn(i[r])}},"getLastOfPath"),gn=s((n,e,t)=>{let{obj:i,k:r}=Ce(n,e,Object);if(i!==void 0||e.length===1){i[r]=t;return}let o=e[e.length-1],a=e.slice(0,e.length-1),l=Ce(n,a,Object);for(;l.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),l=Ce(n,a,Object),l?.obj&&typeof l.obj[`${l.k}.${o}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${o}`]=t},"setPath"),Ui=s((n,e,t,i)=>{let{obj:r,k:o}=Ce(n,e,Object);r[o]=r[o]||[],r[o].push(t)},"pushPath"),$e=s((n,e)=>{let{obj:t,k:i}=Ce(n,e);if(t&&Object.prototype.hasOwnProperty.call(t,i))return t[i]},"getPath"),Vi=s((n,e,t)=>{let i=$e(n,t);return i!==void 0?i:$e(e,t)},"getPathWithDefaults"),Cn=s((n,e,t)=>{for(let i in e)i!=="__proto__"&&i!=="constructor"&&(i in n?b(n[i])||n[i]instanceof String||b(e[i])||e[i]instanceof String?t&&(n[i]=e[i]):Cn(n[i],e[i],t):n[i]=e[i]);return n},"deepExtend"),J=s(n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),"regexEscape"),Ki={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},Gi=s(n=>b(n)?n.replace(/[&<>"'\/]/g,e=>Ki[e]):n,"escape"),yt=class{static{s(this,"RegExpCache")}constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}},qi=[" ",",","?","!",";"],Yi=new yt(20),Ji=s((n,e,t)=>{e=e||"",t=t||"";let i=qi.filter(a=>e.indexOf(a)<0&&t.indexOf(a)<0);if(i.length===0)return!0;let r=Yi.getRegExp(`(${i.map(a=>a==="?"?"\\?":a).join("|")})`),o=!r.test(n);if(!o){let a=n.indexOf(t);a>0&&!r.test(n.substring(0,a))&&(o=!0)}return o},"looksLikeObjectPath"),bt=s((n,e,t=".")=>{if(!n)return;if(n[e])return Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0;let i=e.split(t),r=n;for(let o=0;o<i.length;){if(!r||typeof r!="object")return;let a,l="";for(let u=o;u<i.length;++u)if(u!==o&&(l+=t),l+=i[u],a=r[l],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&u<i.length-1)continue;o+=u-o+1;break}r=a}return r},"deepFind"),Ee=s(n=>n?.replace(/_/g,"-"),"getCleanedCode"),Xi={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,e){console?.[n]?.apply?.(console,e)}},At=class n{static{s(this,"Logger")}constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Xi,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED
Line truncated
|
||||||
|
${e}`)}async afterLoad(){this.abortSignal.aborted||(await this.triggerLifecycleEvent("load"),this.app.workspace.onLayoutReady(q(this.onLayoutReadyBase.bind(this))))}async onLayoutReadyBase(){try{await this.onLayoutReady()}finally{await this.triggerLifecycleEvent("layoutReady")}}async triggerLifecycleEvent(e){this.lifecycleEventNames.add(e),await this.events.triggerAsync(e)}};var L=require("obsidian");function Mn(n,e){let t=Object.keys(e).map(i=>lr(n,i,e[i]));return t.length===1?t[0]:function(){t.forEach(i=>i())}}s(Mn,"around");function lr(n,e,t){let i=n[e],r=n.hasOwnProperty(e),o=r?i:function(){return Object.getPrototypeOf(n)[e].apply(this,arguments)},a=t(o);return i&&Object.setPrototypeOf(a,i),Object.setPrototypeOf(l,a),n[e]=l,u;function l(...c){return a===o&&n[e]===l&&u(),a.apply(this,c)}s(l,"wrapper");function u(){n[e]===l&&(r?n[e]=o:delete n[e]),a!==o&&(a=o,Object.setPrototypeOf(l,i||Function))}s(u,"remove")}s(lr,"around1");s((function(){if(globalThis.process)return;let e={browser:!0,cwd(){return"/"},env:{},platform:"android"};globalThis.process=e}),"initEsm")();function cr(n,e){return Mn(n,e)}s(cr,"around");function Ge(n,e,t){let i=cr(e,t),r=!1;function o(){if(!r)try{i()}finally{r=!0}}return s(o,"uninstallerWrapper"),n.register(o),i}s(Ge,"registerPatch");var _n=require("obsidian");var $n=40,ur=30,dr=16,Ot=".metadata-property:not(.nested-properties-container .metadata-property):has(> .metadata-property-value > .nested-properties-container):not(.is-collapsed)",qe=class extends _n.Component{constructor(t){super();this.app=t}static{s(this,"FloatingScrollbar")}activeEl=null;thumb=null;track=null;onload(){this.track=createDiv("nested-properties-floating-scrollbar"),this.thumb=this.track.createDiv("nested-properties-floating-scrollbar-thumb"),document.body.appendChild(this.track),this.registerDomEvent(this.track,"wheel",i=>{if(!this.activeEl||this.activeEl.scrollWidth<=this.activeEl.clientWidth)return;let r=i.deltaX||i.deltaY;this.activeEl.scrollLeft+=r,i.preventDefault(),i.stopPropagation()},{passive:!1}),this.registerDomEvent(this.track,"mousedown",i=>{this.handleTrackMousedown(i)});let t=new ae(this.app,this);t.registerAllDocumentsDomEvent("keydown",i=>{!this.activeEl||i.key!=="ArrowLeft"&&i.key!=="ArrowRight"||document.activeElement instanceof HTMLInputElement||document.activeElement instanceof HTMLTextAreaElement||document.activeElement instanceof HTMLElement&&document.activeElement.isContentEditable||(this.activeEl.scrollLeft+=i.key==="ArrowLeft"?-$n:$n,i.preventDefault())}),t.registerAllDocumentsDomEvent("scroll",()=>{this.update()},!0),t.registerAllDocumentsDomEvent("wheel",i=>{this.handleNativeScrollbarWheel(i)},{capture:!0,passive:!1}),t.registerAllDocumentsDomEvent("mousemove",i=>{this.handleNativeScrollbarCursor(i)}),t.registerAllWindowsHandler(()=>{this.update()})}onunload(){this.activeEl&&(this.activeEl.removeEventListener("scroll",this.syncThumb),this.activeEl=null),this.track?.remove(),this.track=null,this.thumb=null}update(){if(!this.track)return;let t=document.querySelector(".status-bar"),i=t instanceof HTMLElement?t.offsetHeight:0,r=window.innerHeight-i,o=null;for(let l of document.querySelectorAll(Ot)){if(l.scrollWidth<=l.clientWidth)continue;let u=l.getBoundingClientRect();if(u.bottom>r&&u.top<r){o=l;break}}if(o!==this.activeEl&&(this.activeEl&&this.activeEl.removeEventListener("scroll",this.syncThumb),this.activeEl=o,this.activeEl&&this.activeEl.addEventListener("scroll",this.syncThumb)),!this.activeEl){this.track.classList.remove("is-visible");return}let a=this.activeEl.getBoundingClientRect();this.track.style.setProperty("--track-left",`${String(a.left)}px`),this.track.style.setProperty("--track-width",`${String(a.width)}px`),this.track.style.setProperty("--track-bottom",`${String(i)}px`),this.track.classList.add("is-visible"),this.syncThumb()}handleNativeScrollbarCursor(t){let i=t.target;if(!(i instanceof HTMLElement))return;let r=i.closest(Ot);!r||r.scrollWidth<=r.clientWidth||r.classList.toggle("nested-properties-ew-resize",jn(r,t))}handleNativeScrollbarWheel(t){let i=pr(t);if(!i)return;let r=t.deltaX||t.deltaY;i.scrollLeft+=r,t.preventDefault(),t.stopPropagation()}handleTrackMousedown(t){if(!this.activeEl||!this.track)return;t.preventDefault();let i=this.track.getBoundingClientRect(),r=this.activeEl;function o(c){return(c.clientX-i.left)/i.width}s(o,"toRatio");function a(c){let d=r.scrollWidth-r.clientWidth;r.scrollLeft=Math.max(0,Math.min(1,c))*d}s(a,"scrollToRatio");function l(c){a(o(c))}s(l,"onMouseMove");function u(){document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",u)}s(u,"onMouseUp"),a(o(t)),document.addEventListener("mousemove",l),document.addEventListener("mouseup",u)}syncThumb=s(()=>{if(!this.track||!this.thumb||!this.activeEl)return;let t=this.activeEl.scrollWidth-this.activeEl.clientWidth;if(t<=0)return;let i=this.track.clientWidth,r=Math.max(ur,this.activeEl.clientWidth/this.activeEl.scrollWidth*i),o=this.activeEl.scrollLeft/t*(i-r);thi
Line truncated
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"author":"mnaoumov","authorUrl":"https://github.com/mnaoumov/","description":"Allows to view/edit nested frontmatter properties.","fundingUrl":"https://www.buymeacoffee.com/mnaoumov","id":"nested-properties","isDesktopOnly":false,"name":"Nested Properties","version":"1.2.0","minAppVersion":"1.12.7"}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
.metadata-property:not(.nested-properties-container .metadata-property):has(>.metadata-property-value>.nested-properties-container){flex-wrap:wrap;overflow:auto}.metadata-property:not(.nested-properties-container .metadata-property):has(>.metadata-property-value>.nested-properties-container)>.metadata-property-warning-icon{display:none}.metadata-property:not(.nested-properties-container .metadata-property):has(>.metadata-property-value>.nested-properties-container)>.metadata-property-value{overflow:visible;width:100%;margin-left:144px}.metadata-property:not(.nested-properties-container .metadata-property):has(>.metadata-property-value>.nested-properties-container).is-collapsed{flex-wrap:nowrap;overflow:hidden}.metadata-property:not(.nested-properties-container .metadata-property):has(>.metadata-property-value>.nested-properties-container).is-collapsed>.metadata-property-value{flex-direction:row;overflow:hidden;width:auto;margin-left:0}.nested-properties-container{width:100%;display:flex;flex-direction:column}.nested-properties-container .metadata-property{width:100%;border-bottom:none;overflow:visible}.nested-properties-container .nested-properties-collapsible{flex-wrap:wrap}.nested-properties-container .nested-properties-collapsible>.metadata-property-value{flex-direction:column;overflow:visible;width:100%;margin-left:144px}.nested-properties-container .nested-properties-collapsible.is-collapsed>.metadata-property-value{flex-direction:row;overflow:hidden;width:auto;margin-left:0}.nested-properties-collapsible.is-collapsed{flex-wrap:nowrap}.nested-properties-collapsible.is-collapsed>.metadata-property-value>.nested-properties-container{display:none}.nested-properties-collapsible.is-collapsed>.metadata-property-key>.nested-properties-collapse-btn{transform:rotate(-90deg)}.nested-properties-summary{display:none;color:var(--text-muted);font-style:italic;cursor:var(--cursor);white-space:nowrap}.nested-properties-collapsible.is-collapsed>.metadata-property-value>.nested-properties-summary{display:inline}.metadata-container:not(:has(.nested-properties-collapsible)) .nested-properties-header-actions{display:none}.nested-properties-header-actions{display:inline-flex;align-items:center;margin-left:4px;vertical-align:middle}.nested-properties-add-item,.nested-properties-add-property{display:inline-flex;width:fit-content;align-items:center;gap:4px;padding:2px 4px;color:var(--text-muted);font-size:var(--metadata-label-font-size);cursor:var(--cursor);border-radius:var(--radius-s)}.nested-properties-add-item:hover,.nested-properties-add-property:hover{color:var(--text-normal);background:var(--background-modifier-hover)}.nested-properties-add-item svg,.nested-properties-add-property svg{width:16px;height:16px}.nested-properties-add-property input{background:transparent;border:none;outline:none;color:var(--text-normal);font-size:inherit;padding:0}.nested-properties-floating-scrollbar{display:none;position:fixed;left:var(--track-left);width:var(--track-width);bottom:var(--track-bottom);height:12px;z-index:10;cursor:ew-resize;background:var(--background-secondary);border-top:1px solid var(--background-modifier-border)}.nested-properties-floating-scrollbar.is-visible{display:block}.nested-properties-floating-scrollbar-thumb{position:absolute;left:var(--thumb-left);width:var(--thumb-width);top:2px;height:8px;border-radius:4px;background:var(--scrollbar-thumb-bg)}.nested-properties-floating-scrollbar-thumb:hover{background:var(--scrollbar-active-thumb-bg)}.nested-properties-ew-resize{cursor:ew-resize}.nested-properties-collapse-btn{display:inline-flex;align-items:center;justify-content:center;cursor:var(--cursor);color:var(--text-muted);flex-shrink:0;width:16px;height:16px;align-self:center;transition:transform .1s ease-in-out}.nested-properties-collapse-btn svg{width:10px;height:10px}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
{
|
||||||
|
"commitMessage": "Blog update {{date}}: {{numFiles}} file(s) changed.",
|
||||||
|
"autoCommitMessage": "Blog update {{date}}: {{numFiles}} file(s) changed.",
|
||||||
|
"commitMessageScript": "",
|
||||||
|
"commitDateFormat": "M/D/YYYY h:ma",
|
||||||
|
"autoSaveInterval": 0,
|
||||||
|
"autoPushInterval": 0,
|
||||||
|
"autoPullInterval": 0,
|
||||||
|
"autoPullOnBoot": true,
|
||||||
|
"autoCommitOnlyStaged": false,
|
||||||
|
"disablePush": false,
|
||||||
|
"pullBeforePush": true,
|
||||||
|
"disablePopups": false,
|
||||||
|
"showErrorNotices": true,
|
||||||
|
"disablePopupsForNoChanges": true,
|
||||||
|
"listChangedFilesInMessageBody": false,
|
||||||
|
"showStatusBar": true,
|
||||||
|
"updateSubmodules": false,
|
||||||
|
"syncMethod": "merge",
|
||||||
|
"mergeStrategy": "none",
|
||||||
|
"customMessageOnAutoBackup": false,
|
||||||
|
"autoBackupAfterFileChange": false,
|
||||||
|
"treeStructure": false,
|
||||||
|
"refreshSourceControl": true,
|
||||||
|
"basePath": "",
|
||||||
|
"differentIntervalCommitAndPush": false,
|
||||||
|
"changedFilesInStatusBar": true,
|
||||||
|
"showedMobileNotice": true,
|
||||||
|
"refreshSourceControlTimer": 7000,
|
||||||
|
"showBranchStatusBar": false,
|
||||||
|
"setLastSaveToLastCommit": false,
|
||||||
|
"submoduleRecurseCheckout": false,
|
||||||
|
"gitDir": "",
|
||||||
|
"showFileMenu": false,
|
||||||
|
"authorInHistoryView": "hide",
|
||||||
|
"dateInHistoryView": false,
|
||||||
|
"diffStyle": "split",
|
||||||
|
"hunks": {
|
||||||
|
"showSigns": false,
|
||||||
|
"hunkCommands": false,
|
||||||
|
"statusBar": "disabled"
|
||||||
|
},
|
||||||
|
"lineAuthor": {
|
||||||
|
"show": false,
|
||||||
|
"followMovement": "inactive",
|
||||||
|
"authorDisplay": "initials",
|
||||||
|
"showCommitHash": false,
|
||||||
|
"dateTimeFormatOptions": "date",
|
||||||
|
"dateTimeFormatCustomString": "YYYY-MM-DD HH:mm",
|
||||||
|
"dateTimeTimezone": "viewer-local",
|
||||||
|
"coloringMaxAge": "1y",
|
||||||
|
"colorNew": {
|
||||||
|
"r": 255,
|
||||||
|
"g": 150,
|
||||||
|
"b": 150
|
||||||
|
},
|
||||||
|
"colorOld": {
|
||||||
|
"r": 120,
|
||||||
|
"g": 160,
|
||||||
|
"b": 255
|
||||||
|
},
|
||||||
|
"textColorCss": "var(--text-muted)",
|
||||||
|
"ignoreWhitespace": false,
|
||||||
|
"gutterSpacingFallbackLength": 5,
|
||||||
|
"lastShownAuthorDisplay": "initials",
|
||||||
|
"lastShownDateTimeFormatOptions": "date"
|
||||||
|
}
|
||||||
|
}
|
||||||
+452
@@ -0,0 +1,452 @@
|
|||||||
|
/*
|
||||||
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||||
|
if you want to view the source visit the plugins github repository (https://github.com/denolehov/obsidian-git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
var FD=Object.create;var pc=Object.defineProperty;var ID=Object.getOwnPropertyDescriptor;var OD=Object.getOwnPropertyNames;var MD=Object.getPrototypeOf,DD=Object.prototype.hasOwnProperty;var Nb=t=>{throw TypeError(t)};var LD=(t,e,r)=>e in t?pc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var BD=(t,e)=>()=>(t&&(e=t(t=0)),e);var F=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ND=(t,e)=>{for(var r in e)pc(t,r,{get:e[r],enumerable:!0})},Hb=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of OD(e))!DD.call(t,n)&&n!==r&&pc(t,n,{get:()=>e[n],enumerable:!(i=ID(e,n))||i.enumerable});return t};var Mt=(t,e,r)=>(r=t!=null?FD(MD(t)):{},Hb(e||!t||!t.__esModule?pc(r,"default",{value:t,enumerable:!0}):r,t)),HD=t=>Hb(pc({},"__esModule",{value:!0}),t);var ze=(t,e,r)=>LD(t,typeof e!="symbol"?e+"":e,r),Tm=(t,e,r)=>e.has(t)||Nb("Cannot "+r);var $=(t,e,r)=>(Tm(t,e,"read from private field"),r?r.call(t):e.get(t)),pe=(t,e,r)=>e.has(t)?Nb("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),fe=(t,e,r,i)=>(Tm(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r),bt=(t,e,r)=>(Tm(t,e,"access private method"),r);var jb=F(Tf=>{"use strict";p();Tf.byteLength=GD;Tf.toByteArray=qD;Tf.fromByteArray=WD;var Qi=[],fi=[],UD=typeof Uint8Array!="undefined"?Uint8Array:Array,Cm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(oa=0,Ub=Cm.length;oa<Ub;++oa)Qi[oa]=Cm[oa],fi[Cm.charCodeAt(oa)]=oa;var oa,Ub;fi[45]=62;fi[95]=63;function Gb(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function GD(t){var e=Gb(t),r=e[0],i=e[1];return(r+i)*3/4-i}function jD(t,e,r){return(e+r)*3/4-r}function qD(t){var e,r=Gb(t),i=r[0],n=r[1],s=new UD(jD(t,i,n)),a=0,o=n>0?i-4:i,l;for(l=0;l<o;l+=4)e=fi[t.charCodeAt(l)]<<18|fi[t.charCodeAt(l+1)]<<12|fi[t.charCodeAt(l+2)]<<6|fi[t.charCodeAt(l+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=e&255;return n===2&&(e=fi[t.charCodeAt(l)]<<2|fi[t.charCodeAt(l+1)]>>4,s[a++]=e&255),n===1&&(e=fi[t.charCodeAt(l)]<<10|fi[t.charCodeAt(l+1)]<<4|fi[t.charCodeAt(l+2)]>>2,s[a++]=e>>8&255,s[a++]=e&255),s}function zD(t){return Qi[t>>18&63]+Qi[t>>12&63]+Qi[t>>6&63]+Qi[t&63]}function VD(t,e,r){for(var i,n=[],s=e;s<r;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),n.push(zD(i));return n.join("")}function WD(t){for(var e,r=t.length,i=r%3,n=[],s=16383,a=0,o=r-i;a<o;a+=s)n.push(VD(t,a,a+s>o?o:a+s));return i===1?(e=t[r-1],n.push(Qi[e>>2]+Qi[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(Qi[e>>10]+Qi[e>>4&63]+Qi[e<<2&63]+"=")),n.join("")}});var qb=F(Pm=>{p();Pm.read=function(t,e,r,i,n){var s,a,o=n*8-i-1,l=(1<<o)-1,c=l>>1,u=-7,f=r?n-1:0,d=r?-1:1,h=t[e+f];for(f+=d,s=h&(1<<-u)-1,h>>=-u,u+=o;u>0;s=s*256+t[e+f],f+=d,u-=8);for(a=s&(1<<-u)-1,s>>=-u,u+=i;u>0;a=a*256+t[e+f],f+=d,u-=8);if(s===0)s=1-c;else{if(s===l)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-c}return(h?-1:1)*a*Math.pow(2,s-i)};Pm.write=function(t,e,r,i,n,s){var a,o,l,c=s*8-n-1,u=(1<<c)-1,f=u>>1,d=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:s-1,m=i?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+f>=1?e+=d/l:e+=d*Math.pow(2,1-f),e*l>=2&&(a++,l/=2),a+f>=u?(o=0,a=u):a+f>=1?(o=(e*l-1)*Math.pow(2,n),a=a+f):(o=e*Math.pow(2,f-1)*Math.pow(2,n),a=0));n>=8;t[r+h]=o&255,h+=m,o/=256,n-=8);for(a=a<<n|o,c+=n;c>0;t[r+h]=a&255,h+=m,a/=256,c-=8);t[r+h-m]|=g*128}});var Bm=F(Ao=>{"use strict";p();var Rm=jb(),Eo=qb(),zb=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ao.Buffer=I;Ao.SlowBuffer=JD;Ao.INSPECT_MAX_BYTES=50;var Cf=2147483647;Ao.kMaxLength=Cf;I.TYPED_ARRAY_SUPPORT=YD();!I.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function YD(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(t){return!1}}Object.defineProperty(I.prototype,"parent",{enumerable:!0,get:function(){if(I.isBuffer(this))return this.buffer}});Object.defineProperty(I.prototype,"offset",{enumerable:!0,get:function(){if(I.isBuffer(this))return this.byteOffset}});function Ln(t){if(t>Cf)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,I.prototype),e}function I(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Om(t)}return Xb(t,e,r)}I.poolSize=8192;function Xb(t,e,r){if(typeof t=="string")return ZD(t,e);if(ArrayBuffer.isView(t))return KD(t);if(t==null)throw new TypeError("Line truncated
|
||||||
|
|
||||||
|
If you're not a developer, report the bug to the developers of the application you're using. If this is a bug in isomorphic-git then you should create a proper bug yourselves. The bug should include a minimal reproduction and details about the version and environment.
|
||||||
|
|
||||||
|
Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${e}`),this.code=this.name=t.code,this.data={message:e}}};he.code="InternalError";var zo=class t extends Re{constructor(e){super(`The filepath "${e}" contains unsafe character sequences`),this.code=this.name=t.code,this.data={filepath:e}}};zo.code="UnsafeFilepathError";var mi=class{constructor(e){this.buffer=e,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(e){this._start=e}slice(e){let r=this.buffer.slice(this._start,this._start+e);return this._start+=e,r}toString(e,r){let i=this.buffer.toString(e,this._start,this._start+r);return this._start+=r,i}write(e,r,i){let n=this.buffer.write(e,this._start,r,i);return this._start+=r,n}copy(e,r,i){let n=e.copy(this.buffer,this._start,r,i);return this._start+=n,n}readUInt8(){let e=this.buffer.readUInt8(this._start);return this._start+=1,e}writeUInt8(e){let r=this.buffer.writeUInt8(e,this._start);return this._start+=1,r}readUInt16BE(){let e=this.buffer.readUInt16BE(this._start);return this._start+=2,e}writeUInt16BE(e){let r=this.buffer.writeUInt16BE(e,this._start);return this._start+=2,r}readUInt32BE(){let e=this.buffer.readUInt32BE(this._start);return this._start+=4,e}writeUInt32BE(e){let r=this.buffer.writeUInt32BE(e,this._start);return this._start+=4,r}};function Fd(t,e){return-(t<e)||+(t>e)}function YE(t,e){return Fd(t.path,e.path)}function XE(t){let e=t>0?t>>12:0;e!==4&&e!==8&&e!==10&&e!==14&&(e=8);let r=t&511;return r&73?r=493:r=420,e!==8&&(r=0),(e<<12)+r}var cn=2**32;function kE(t,e,r,i){if(t!==void 0&&e!==void 0)return[t,e];r===void 0&&(r=i.valueOf());let n=Math.floor(r/1e3),s=(r-n*1e3)*1e6;return[n,s]}function Vo(t){let[e,r]=kE(t.ctimeSeconds,t.ctimeNanoseconds,t.ctimeMs,t.ctime),[i,n]=kE(t.mtimeSeconds,t.mtimeNanoseconds,t.mtimeMs,t.mtime);return{ctimeSeconds:e%cn,ctimeNanoseconds:r%cn,mtimeSeconds:i%cn,mtimeNanoseconds:n%cn,dev:t.dev%cn,ino:t.ino%cn,mode:XE(t.mode%cn),uid:t.uid%cn,gid:t.gid%cn,size:t.size>-1?t.size%cn:0}}function R3(t){let e="";for(let r of new Uint8Array(t))r<16&&(e+="0"),e+=r.toString(16);return e}var Vg=null;async function qn(t){return Vg===null&&(Vg=await F3()),Vg?ZE(t):$3(t)}function $3(t){return new WE().update(t).digest("hex")}async function ZE(t){let e=await crypto.subtle.digest("SHA-1",t);return R3(e)}async function F3(){try{return await ZE(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709"}catch(t){}return!1}function I3(t){return{assumeValid:!!(t&32768),extended:!!(t&16384),stage:(t&12288)>>12,nameLength:t&4095}}function O3(t){let e=t.flags;return e.extended=!1,e.nameLength=Math.min(Buffer.from(t.path).length,4095),(e.assumeValid?32768:0)+(e.extended?16384:0)+((e.stage&3)<<12)+(e.nameLength&4095)}var nv=class t{constructor(e,r){this._dirty=!1,this._unmergedPaths=r||new Set,this._entries=e||new Map}_addEntry(e){if(e.flags.stage===0)e.stages=[e],this._entries.set(e.path,e),this._unmergedPaths.delete(e.path);else{let r=this._entries.get(e.path);r||(this._entries.set(e.path,e),r=e),r.stages[e.flags.stage]=e,this._unmergedPaths.add(e.path)}}static async from(e){if(Buffer.isBuffer(e))return t.fromBuffer(e);if(e===null)return new t(null);throw new he("invalid type passed to GitIndex.from")}static async fromBuffer(e){if(e.length===0)throw new he("Index file is empty (.git/index)");let r=new t,i=new mi(e),n=i.toString("utf8",4);if(n!=="DIRC")throw new he(`Invalid dircache magic file number: ${n}`);let s=await qn(e.slice(0,-20)),a=e.slice(-20).toString("hex");if(a!==s)throw new he(`Invalid checksum in GitIndex buffer: expected ${a} but saw ${s}`);let o=i.readUInt32BE();if(o!==2)throw new he(`Unsupported dircache version: ${o}`);let l=i.readUInt32BE(),c=0;for(;!i.eof()&&c<l;){let u={};u.ctimeSeconds=i.readUInt32BE(),u.ctimeNanoseconds=i.readUInt32BE(),u.mtimeSeconds=i.readUInt32BE(),u.mtimeNanoseconds=i.readUInt32BE(),u.dev=i.readUInt32BE(),u.ino=i.readUInt32BE(),u.mode=i.readUInt32BE(),u.uid=i.readUInt32BE(),u.gid=i.readUInt32BE(),u.size=i.readUInt32BE(),u.oid=i.slice(20).toString("hex");let f=i.readUInt16BE();u.flags=I3(f);let d=e.indexOf(0,i.tell()+1)-i.tell();if(d<1)throw new he(`Got a path length of: ${d}`);if(u.path=i.toString("utf8",d),u.path.includes("..\\")||u.path.includes("../"))throw new zo(u.path);let h=8-(i.tell()-12)%8;for(h===0&&(h=8);h--;){let m=i.readUInt8();if(m!==0)throw new he(`Expected 1-8 null characters but got '${m}' after ${u.path}`);if(i.eof())throw new he("Unexpected end of file")}u.stages=[],r._addEntry(u),c++}return r}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(YE)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(e=>e.stages.length>1?e.stages.filter(r=>r):e)}*[Symbol.iterator](){for(let e of this.entries)yield e}insert({filepath:e,stats:r,oid:i,stage:n=0}){r||(r={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid
Line truncated
|
||||||
|
`)}static async _entryToBuffer(e){let r=Buffer.from(e.path),i=Math.ceil((62+r.length+1)/8)*8,n=Buffer.alloc(i),s=new mi(n),a=Vo(e);return s.writeUInt32BE(a.ctimeSeconds),s.writeUInt32BE(a.ctimeNanoseconds),s.writeUInt32BE(a.mtimeSeconds),s.writeUInt32BE(a.mtimeNanoseconds),s.writeUInt32BE(a.dev),s.writeUInt32BE(a.ino),s.writeUInt32BE(a.mode),s.writeUInt32BE(a.uid),s.writeUInt32BE(a.gid),s.writeUInt32BE(a.size),s.write(e.oid,20,"hex"),s.writeUInt16BE(O3(e)),s.write(e.path,r.length,"utf8"),n}async toObject(){let e=Buffer.alloc(12),r=new mi(e);r.write("DIRC",4,"utf8"),r.writeUInt32BE(2),r.writeUInt32BE(this.entriesFlat.length);let i=[];for(let o of this.entries)if(i.push(t._entryToBuffer(o)),o.stages.length>1)for(let l of o.stages)l&&l!==o&&i.push(t._entryToBuffer(l));i=await Promise.all(i);let n=Buffer.concat(i),s=Buffer.concat([e,n]),a=await qn(s);return Buffer.concat([s,Buffer.from(a,"hex")])}};function xd(t,e,r=!0,i=!0){let n=Vo(t),s=Vo(e);return r&&n.mode!==s.mode||n.mtimeSeconds!==s.mtimeSeconds||n.ctimeSeconds!==s.ctimeSeconds||n.uid!==s.uid||n.gid!==s.gid||i&&n.ino!==s.ino||n.size!==s.size}var Wg=null,Yg=Symbol("IndexCache");function M3(){return{map:new Map,stats:new Map}}async function D3(t,e,r){let[i,n]=await Promise.all([t.lstat(e),t.read(e)]),s=await nv.from(n);r.map.set(e,s),r.stats.set(e,i)}async function L3(t,e,r){let i=r.stats.get(e);if(i===void 0)return!0;if(i===null)return!1;let n=await t.lstat(e);return n===null?!1:xd(i,n)}var mt=class{static async acquire({fs:e,gitdir:r,cache:i,allowUnmerged:n=!0},s){i[Yg]||(i[Yg]=M3());let a=`${r}/index`;Wg===null&&(Wg=new Nc({maxPending:1/0}));let o,l=[];return await Wg.acquire(a,async()=>{let c=i[Yg];await L3(e,a,c)&&await D3(e,a,c);let u=c.map.get(a);if(l=u.unmergedPaths,l.length&&!n)throw new Uc(l);if(o=await s(u),u._dirty){let f=await u.toObject();await e.write(a,f),c.stats.set(a,await e.lstat(a)),u._dirty=!1}}),o}};function Sd(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e>-1&&(t=t.slice(e+1)),t}function xa(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?".":e===0?"/":t.slice(0,e)}function KE(t){let e=new Map,r=function(n){if(!e.has(n)){let s={type:"tree",fullpath:n,basename:Sd(n),metadata:{},children:[]};e.set(n,s),s.parent=r(xa(n)),s.parent&&s.parent!==s&&s.parent.children.push(s)}return e.get(n)},i=function(n,s){if(!e.has(n)){let a={type:"blob",fullpath:n,basename:Sd(n),metadata:s,parent:r(xa(n)),children:[]};a.parent&&a.parent.children.push(a),e.set(n,a)}return e.get(n)};r(".");for(let n of t)i(n.path,n);return e}function B3(t){switch(t){case 16384:return"tree";case 33188:return"blob";case 33261:return"blob";case 40960:return"blob";case 57344:return"commit"}throw new he(`Unexpected GitTree entry mode: ${t.toString(8)}`)}var sv=class{constructor({fs:e,gitdir:r,cache:i}){this.treePromise=mt.acquire({fs:e,gitdir:r,cache:i},async function(s){return KE(s.entries)});let n=this;this.ConstructEntry=class{constructor(a){this._fullpath=a,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return n.type(this)}async mode(){return n.mode(this)}async stat(){return n.stat(this)}async content(){return n.content(this)}async oid(){return n.oid(this)}}}async readdir(e){let r=e._fullpath,n=(await this.treePromise).get(r);if(!n||n.type==="blob")return null;if(n.type!=="tree")throw new Error(`ENOTDIR: not a directory, scandir '${r}'`);let s=n.children.map(a=>a.fullpath);return s.sort(Fd),s}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let i=(await this.treePromise).get(e._fullpath);if(!i)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let n=i.type==="tree"?{}:Vo(i.metadata);e._type=i.type==="tree"?"tree":B3(n.mode),e._mode=n.mode,i.type==="tree"?e._stat=void 0:e._stat=n}return e._stat}async content(e){}async oid(e){if(e._oid===!1){let i=(await this.treePromise).get(e._fullpath);e._oid=i.metadata.oid}return e._oid}},Id=Symbol("GitWalkSymbol");function Aa(){let t=Object.create(null);return Object.defineProperty(t,Id,{value:function({fs:e,gitdir:r,cache:i}){return new sv({fs:e,gitdir:r,cache:i})}}),Object.freeze(t),t}var He=class t extends Re{constructor(e){super(`Could not find ${e}.`),this.code=this.name=t.code,this.data={what:e}}};He.code="NotFoundError";var hr=class t extends Re{constructor(e,r,i,n){super(`Object ${e} ${n?`at ${n}`:""}was anticipated to be a ${i} but it is a ${r}.`),this.code=this.name=t.code,this.data={oid:e,actual:r,expected:i,filepath:n}}};hr.code="ObjectTypeError";var Ps=class t extends Re{constructor(e){super(`Expected a 40-char hex object id but saw "${e}".`),this.code=this.name=t.code,this.data={value:e}}};Ps.code="InvalidOidError";var Gc=class t extends Re{constructor(e){super(`Could not find a fetch refspec for remote "${e}". Make sure the config file has an entry like the following:
|
||||||
|
[remote "${e}"]
|
||||||
|
fetch = +refs/heads/*:refs/remotes/origin/*
|
||||||
|
`),this.code=this.name=t.code,this.data={remote:e}}};Gc.code="NoRefspecError";var Ed=class t{constructor(e){if(this.refs=new Map,this.parsedConfig=[],e){let r=null;this.parsedConfig=e.trim().split(`
|
||||||
|
`).map(i=>{if(/^\s*#/.test(i))return{line:i,comment:!0};let n=i.indexOf(" ");if(i.startsWith("^")){let s=i.slice(1);return this.refs.set(r+"^{}",s),{line:i,ref:r,peeled:s}}else{let s=i.slice(0,n);return r=i.slice(n+1),this.refs.set(r,s),{line:i,ref:r,oid:s}}})}return this}static from(e){return new t(e)}delete(e){this.parsedConfig=this.parsedConfig.filter(r=>r.ref!==e),this.refs.delete(e)}toString(){return this.parsedConfig.map(({line:e})=>e).join(`
|
||||||
|
`)+`
|
||||||
|
`}},kd=class t{constructor({remotePath:e,localPath:r,force:i,matchPrefix:n}){Object.assign(this,{remotePath:e,localPath:r,force:i,matchPrefix:n})}static from(e){let[r,i,n,s,a]=e.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),o=r==="+",l=n==="*";if(l!==(a==="*"))throw new he("Invalid refspec");return new t({remotePath:i,localPath:s,force:o,matchPrefix:l})}translate(e){if(this.matchPrefix){if(e.startsWith(this.remotePath))return this.localPath+e.replace(this.remotePath,"")}else if(e===this.remotePath)return this.localPath;return null}reverseTranslate(e){if(this.matchPrefix){if(e.startsWith(this.localPath))return this.remotePath+e.replace(this.localPath,"")}else if(e===this.localPath)return this.remotePath;return null}},av=class t{constructor(e=[]){this.rules=e}static from(e){let r=[];for(let i of e)r.push(kd.from(i));return new t(r)}add(e){let r=kd.from(e);this.rules.push(r)}translate(e){let r=[];for(let i of this.rules)for(let n of e){let s=i.translate(n);s&&r.push([n,s])}return r}translateOne(e){let r=null;for(let i of this.rules){let n=i.translate(e);n&&(r=n)}return r}localNamespaces(){return this.rules.filter(e=>e.matchPrefix).map(e=>e.localPath.replace(/\/$/,""))}};function N3(t,e){let r=t.replace(/\^\{\}$/,""),i=e.replace(/\^\{\}$/,""),n=-(r<i)||+(r>i);return n===0?t.endsWith("^{}")?1:-1:n}function H3(t,e){let r="",i=0,n=-1,s=0,a="\0";for(let o=0;o<=t.length;++o){if(o<t.length)a=t[o];else{if(a==="/")break;a="/"}if(a==="/"){if(!(n===o-1||s===1))if(s===2){if(r.length<2||i!==2||r.at(-1)!=="."||r.at(-2)!=="."){if(r.length>2){let l=r.lastIndexOf("/");l===-1?(r="",i=0):(r=r.slice(0,l),i=r.length-1-r.lastIndexOf("/")),n=o,s=0;continue}else if(r.length!==0){r="",i=0,n=o,s=0;continue}}e&&(r+=r.length>0?"/..":"..",i=2)}else r.length>0?r+="/"+t.slice(n+1,o):r=t.slice(n+1,o),i=o-n-1;n=o,s=0}else a==="."&&s!==-1?++s:s=-1}return r}function U3(t){if(!t.length)return".";let e=t[0]==="/",r=t.at(-1)==="/";return t=H3(t,!e),t.length?(r&&(t+="/"),e?`/${t}`:t):e?"/":r?"./":"."}function O(...t){if(t.length===0)return".";let e;for(let r=0;r<t.length;++r){let i=t[r];i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":U3(e)}var G3=t=>{if(typeof t=="number")return t;t=t.toLowerCase();let e=parseInt(t);return t.endsWith("k")&&(e*=1024),t.endsWith("m")&&(e*=1024*1024),t.endsWith("g")&&(e*=1024*1024*1024),e},Bc=t=>{if(typeof t=="boolean")return t;if(t=t.trim().toLowerCase(),t==="true"||t==="yes"||t==="on")return!0;if(t==="false"||t==="no"||t==="off")return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${t}`)},AE={core:{filemode:Bc,bare:Bc,logallrefupdates:Bc,symlinks:Bc,ignorecase:Bc,bigFileThreshold:G3}},j3=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,q3=/^[A-Za-z0-9-.]+$/,z3=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,V3=/^[A-Za-z][A-Za-z-]*$/,W3=/^(.*?)( *[#;].*)$/,Y3=t=>{let e=j3.exec(t);if(e!=null){let[r,i]=e.slice(1);return[r,i]}return null},X3=t=>{let e=z3.exec(t);if(e!=null){let[r,i="true"]=e.slice(1),n=Z3(i),s=K3(n);return[r,s]}return null},Z3=t=>{let e=W3.exec(t);if(e==null)return t;let[r,i]=e.slice(1);return TE(r)&&TE(i)?`${r}${i}`:r},TE=t=>(t.match(/(?:^|[^\\])"/g)||[]).length%2!==0,K3=t=>t.split("").reduce((e,r,i,n)=>{let s=r==='"'&&n[i-1]!=="\\",a=r==="\\"&&n[i+1]==='"';return s||a?e:e+r},""),CE=t=>t!=null?t.toLowerCase():null,ov=(t,e,r)=>[CE(t),e,CE(r)].filter(i=>i!=null).join("."),PE=t=>{let e=t.split("."),r=e.shift(),i=e.pop(),n=e.length?e.join("."):void 0;return{section:r,subsection:n,name:i,path:ov(r,n,i),sectionPath:ov(r,n,null),isSection:!!r}},Q3=(t,e)=>t.reduce((r,i,n)=>e(i)?n:r,-1),lv=class t{constructor(e){let r=null,i=null;this.parsedConfig=e?e.split(`
|
||||||
|
`).map(n=>{let s=null,a=null,o=n.trim(),l=Y3(o),c=l!=null;if(c)[r,i]=l;else{let f=X3(o);f!=null&&([s,a]=f)}let u=ov(r,i,s);return{line:n,isSection:c,section:r,subsection:i,name:s,value:a,path:u}}):[]}static from(e){return new t(e)}async get(e,r=!1){let i=PE(e).path,n=this.parsedConfig.filter(s=>s.path===i).map(({section:s,name:a,value:o})=>{let l=AE[s]&&AE[s][a];return l?l(o):o});return r?n:n.pop()}async getall(e){return this.get(e,!0)}async getSubsections(e){return this.parsedConfig.filter(r=>r.isSection&&r.section===e).map(r=>r.subsection)}async deleteSection(e,r){this.parsedConfig=this.parsedConfig.filter(i=>!(i.section===e&&i.subsection===r))}async append(e,r){return this.set(e,r,!0)}async set(e,r,i=!1){let{section:n,subsection:s,name:a,path:o,sectionPath:l,isSection:c}=PE(e),u=Q3(this.parsedConfig,f=>f.path===o);if(r==null)u!==-1&&this.parsedConfig.splice(u,1);else if(u!==-1){let f=this.parsedConfig[u],d=Object.assign({},f,{name:a,value:r,modified:!0});i?this.parsedConfig.splice(u+1,0,d):this.parsedConfig[u]=d}else{let f=this.parsedConfig.findIndex(h=>h.path===l),d={section:n,subsection:s,name:a,value:r,modified:!0,path:o};if(q3.test(n)&&V3.test(a))if(f>=0)this.parsedConfig.splice(f+1,0,d);else{let h={isSection:c,section:n,subsection:s,modified:!0,path:l};this.parsedConfig.push(h,d)}}}toString(){return this.parsedConfig.map(({line:e,section:r,subsection:i,name:n,value:s,modified:a=!1})=>a?n!=null&&s!=null?typeof s=="string"&&/[#;]/.test(s)?` ${n} = "${s}"`:` ${n} = ${s}`:i!=null?`[${r} "${i}"]`:`[${r}]`:e).join(`
|
||||||
|
`)}},ct=class{static async get({fs:e,gitdir:r}){let i=await e.read(`${r}/config`,{encoding:"utf8"});return lv.from(i)}static async save({fs:e,gitdir:r,config:i}){await e.write(`${r}/config`,i.toString(),{encoding:"utf8"})}},bd=t=>[`${t}`,`refs/${t}`,`refs/tags/${t}`,`refs/heads/${t}`,`refs/remotes/${t}`,`refs/remotes/${t}/HEAD`],J3=["config","description","index","shallow","commondir"],Xg;async function Ts(t,e){return Xg===void 0&&(Xg=new Nc),Xg.acquire(t,e)}var W=class t{static async updateRemoteRefs({fs:e,gitdir:r,remote:i,refs:n,symrefs:s,tags:a,refspecs:o=void 0,prune:l=!1,pruneTags:c=!1}){for(let v of n.values())if(!v.match(/[0-9a-f]{40}/))throw new Ps(v);let u=await ct.get({fs:e,gitdir:r});if(!o){if(o=await u.getall(`remote.${i}.fetch`),o.length===0)throw new Gc(i);o.unshift(`+HEAD:refs/remotes/${i}/HEAD`)}let f=av.from(o),d=new Map;if(c){let v=await t.listRefs({fs:e,gitdir:r,filepath:"refs/tags"});await t.deleteRefs({fs:e,gitdir:r,refs:v.map(w=>`refs/tags/${w}`)})}if(a){for(let v of n.keys())if(v.startsWith("refs/tags")&&!v.endsWith("^{}")&&!await t.exists({fs:e,gitdir:r,ref:v})){let w=n.get(v);d.set(v,w)}}let h=f.translate([...n.keys()]);for(let[v,w]of h){let b=n.get(v);d.set(w,b)}let m=f.translate([...s.keys()]);for(let[v,w]of m){let b=s.get(v),k=f.translateOne(b);k&&d.set(w,`ref: ${k}`)}let g=[];if(l){for(let v of f.localNamespaces()){let w=(await t.listRefs({fs:e,gitdir:r,filepath:v})).map(b=>`${v}/${b}`);for(let b of w)d.has(b)||g.push(b)}g.length>0&&await t.deleteRefs({fs:e,gitdir:r,refs:g})}for(let[v,w]of d)await Ts(v,async()=>e.write(O(r,v),`${w.trim()}
|
||||||
|
`,"utf8"));return{pruned:g}}static async writeRef({fs:e,gitdir:r,ref:i,value:n}){if(!n.match(/[0-9a-f]{40}/))throw new Ps(n);await Ts(i,async()=>e.write(O(r,i),`${n.trim()}
|
||||||
|
`,"utf8"))}static async writeSymbolicRef({fs:e,gitdir:r,ref:i,value:n}){await Ts(i,async()=>e.write(O(r,i),`ref: ${n.trim()}
|
||||||
|
`,"utf8"))}static async deleteRef({fs:e,gitdir:r,ref:i}){return t.deleteRefs({fs:e,gitdir:r,refs:[i]})}static async deleteRefs({fs:e,gitdir:r,refs:i}){await Promise.all(i.map(o=>e.rm(O(r,o))));let n=await Ts("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"})),s=Ed.from(n),a=s.refs.size;for(let o of i)s.refs.has(o)&&s.delete(o);s.refs.size<a&&(n=s.toString(),await Ts("packed-refs",async()=>e.write(`${r}/packed-refs`,n,{encoding:"utf8"})))}static async resolve({fs:e,gitdir:r,ref:i,depth:n=void 0}){if(n!==void 0&&(n--,n===-1))return i;if(i.startsWith("ref: "))return i=i.slice(5),t.resolve({fs:e,gitdir:r,ref:i,depth:n});if(i.length===40&&/[0-9a-f]{40}/.test(i))return i;let s=await t.packedRefs({fs:e,gitdir:r}),a=bd(i).filter(o=>!J3.includes(o));for(let o of a){let l=await Ts(o,async()=>await e.read(`${r}/${o}`,{encoding:"utf8"})||s.get(o));if(l)return t.resolve({fs:e,gitdir:r,ref:l.trim(),depth:n})}throw new He(i)}static async exists({fs:e,gitdir:r,ref:i}){try{return await t.expand({fs:e,gitdir:r,ref:i}),!0}catch(n){return!1}}static async expand({fs:e,gitdir:r,ref:i}){if(i.length===40&&/[0-9a-f]{40}/.test(i))return i;let n=await t.packedRefs({fs:e,gitdir:r}),s=bd(i);for(let a of s)if(await Ts(a,async()=>e.exists(`${r}/${a}`))||n.has(a))return a;throw new He(i)}static async expandAgainstMap({ref:e,map:r}){let i=bd(e);for(let n of i)if(await r.has(n))return n;throw new He(e)}static resolveAgainstMap({ref:e,fullref:r=e,depth:i=void 0,map:n}){if(i!==void 0&&(i--,i===-1))return{fullref:r,oid:e};if(e.startsWith("ref: "))return e=e.slice(5),t.resolveAgainstMap({ref:e,fullref:r,depth:i,map:n});if(e.length===40&&/[0-9a-f]{40}/.test(e))return{fullref:r,oid:e};let s=bd(e);for(let a of s){let o=n.get(a);if(o)return t.resolveAgainstMap({ref:o.trim(),fullref:a,depth:i,map:n})}throw new He(e)}static async packedRefs({fs:e,gitdir:r}){let i=await Ts("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"}));return Ed.from(i).refs}static async listRefs({fs:e,gitdir:r,filepath:i}){let n=t.packedRefs({fs:e,gitdir:r}),s=null;try{s=await e.readdirDeep(`${r}/${i}`),s=s.map(a=>a.replace(`${r}/${i}/`,""))}catch(a){s=[]}for(let a of(await n).keys())a.startsWith(i)&&(a=a.replace(i+"/",""),s.includes(a)||s.push(a));return s.sort(N3),s}static async listBranches({fs:e,gitdir:r,remote:i}){return i?t.listRefs({fs:e,gitdir:r,filepath:`refs/remotes/${i}`}):t.listRefs({fs:e,gitdir:r,filepath:"refs/heads"})}static async listTags({fs:e,gitdir:r}){return(await t.listRefs({fs:e,gitdir:r,filepath:"refs/tags"})).filter(n=>!n.endsWith("^{}"))}};function e8(t,e){return Fd(RE(t),RE(e))}function RE(t){return t.mode==="040000"?t.path+"/":t.path}function QE(t){switch(t){case"040000":return"tree";case"100644":return"blob";case"100755":return"blob";case"120000":return"blob";case"160000":return"commit"}throw new he(`Unexpected GitTree entry mode: ${t}`)}function t8(t){let e=[],r=0;for(;r<t.length;){let i=t.indexOf(32,r);if(i===-1)throw new he(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next space character.`);let n=t.indexOf(0,r);if(n===-1)throw new he(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next null character.`);let s=t.slice(r,i).toString("utf8");s==="40000"&&(s="040000");let a=QE(s),o=t.slice(i+1,n).toString("utf8");if(o.includes("\\")||o.includes("/"))throw new zo(o);let l=t.slice(n+1,n+21).toString("hex");r=n+21,e.push({mode:s,path:o,oid:l,type:a})}return e}function r8(t){if(typeof t=="number"&&(t=t.toString(8)),t.match(/^0?4.*/))return"040000";if(t.match(/^1006.*/))return"100644";if(t.match(/^1007.*/))return"100755";if(t.match(/^120.*/))return"120000";if(t.match(/^160.*/))return"160000";throw new he(`Could not understand file mode: ${t}`)}function i8(t){return!t.oid&&t.sha&&(t.oid=t.sha),t.mode=r8(t.mode),t.type||(t.type=QE(t.mode)),t}var Er=class t{constructor(e){if(Buffer.isBuffer(e))this._entries=t8(e);else if(Array.isArray(e))this._entries=e.map(i8);else throw new he("invalid type passed to GitTree constructor");this._entries.sort(YE)}static from(e){return new t(e)}render(){return this._entries.map(e=>`${e.mode} ${e.type} ${e.oid} ${e.path}`).join(`
|
||||||
|
`)}toObject(){let e=[...this._entries];return e.sort(e8),Buffer.concat(e.map(r=>{let i=Buffer.from(r.mode.replace(/^0/,"")),n=Buffer.from(" "),s=Buffer.from(r.path,"utf8"),a=Buffer.from([0]),o=Buffer.from(r.oid,"hex");return Buffer.concat([i,n,s,a,o])}))}entries(){return this._entries}*[Symbol.iterator](){for(let e of this._entries)yield e}},Rs=class{static wrap({type:e,object:r}){let i=`${e} ${r.length}\0`,n=i.length,s=n+r.length,a=new Uint8Array(s);for(let o=0;o<n;o++)a[o]=i.charCodeAt(o);return a.set(r,n),a}static unwrap(e){let r=e.indexOf(32),i=e.indexOf(0),n=e.slice(0,r).toString("utf8"),s=e.slice(r+1,i).toString("utf8"),a=e.length-(i+1);if(parseInt(s)!==a)throw new he(`Length mismatch: expected ${s} bytes but got ${a} instead.`);return{type:n,object:Buffer.from(e.slice(i+1))}}};async function JE({fs:t,gitdir:e,oid:r}){let i=`objects/${r.slice(0,2)}/${r.slice(2)}`,n=await t.read(`${e}/${i}`);return n?{object:n,format:"deflated",source:i}:null}function n8(t,e){let r=new mi(t),i=$E(r);if(i!==e.byteLength)throw new he(`applyDelta expected source buffer to be ${i} bytes but the provided buffer was ${e.length} bytes`);let n=$E(r),s,a=IE(r,e);if(a.byteLength===n)s=a;else{s=Buffer.alloc(n);let o=new mi(s);for(o.copy(a);!r.eof();)o.copy(IE(r,e));let l=o.tell();if(n!==l)throw new he(`applyDelta expected target buffer to be ${n} bytes but the resulting buffer was ${l} bytes`)}return s}function $E(t){let e=0,r=0,i=null;do i=t.readUInt8(),e|=(i&127)<<r,r+=7;while(i&128);return e}function FE(t,e,r){let i=0,n=0;for(;r--;)e&1&&(i|=t.readUInt8()<<n),e>>=1,n+=8;return i}function IE(t,e){let r=t.readUInt8(),i=128,n=15,s=112;if(r&i){let a=FE(t,r&n,4),o=FE(t,(r&s)>>4,3);return o===0&&(o=65536),e.slice(a,a+o)}else return t.slice(r)}function s8(t){let e=[t];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}function ek(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:s8(t)}var Ad=class{constructor(e){if(typeof Buffer=="undefined")throw new Error("Missing Buffer dependency");this.stream=ek(e),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(e){if(!this.eof())return this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e),this.buffer.slice(this.undoCursor,this.cursor)}async skip(e){this.eof()||(this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:e,value:r}=await this.stream.next();return e&&(this._ended=!0,!r)?Buffer.alloc(0):(r&&(r=Buffer.from(r)),r)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(e){this.undoCursor=this.cursor,this.cursor+=e,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(e){if(this._ended)return;let r=[this.buffer];for(;this.cursor+e>a8(r);){let i=await this._next();if(this._ended)break;r.push(i)}this.buffer=Buffer.concat(r)}async _loadnext(){this._discardedBytes+=this.buffer.length,this.undoCursor=0,this.cursor=0,this.buffer=await this._next()}async _init(){this.buffer=await this._next()}};function a8(t){return t.reduce((e,r)=>e+r.length,0)}async function o8(t,e){let r=new Ad(t),i=await r.read(4);if(i=i.toString("utf8"),i!=="PACK")throw new he(`Invalid PACK header '${i}'`);let n=await r.read(4);if(n=n.readUInt32BE(0),n!==2)throw new he(`Invalid packfile version: ${n}`);let s=await r.read(4);if(s=s.readUInt32BE(0),!(s<1))for(;!r.eof()&&s--;){let a=r.tell(),{type:o,length:l,ofs:c,reference:u}=await l8(r),f=new gv.Inflate;for(;!f.result;){let d=await r.chunk();if(!d)break;if(f.push(d,!1),f.err)throw new he(`Pako error: ${f.msg}`);if(f.result){if(f.result.length!==l)throw new he("Inflated object size is different from that stated in packfile.");await r.undo(),await r.read(d.length-f.strm.avail_in);let h=r.tell();await e({data:f.result,type:o,num:s,offset:a,end:h,reference:u,ofs:c})}}}}async function l8(t){let e=await t.byte(),r=e>>4&7,i=e&15;if(e&128){let a=4;do e=await t.byte(),i|=(e&127)<<a,a+=7;while(e&128)}let n,s;if(r===6){let a=0;n=0;let o=[];do e=await t.byte(),n|=(e&127)<<a,a+=7,o.push(e);while(e&128);s=Buffer.fro
Line truncated
|
||||||
|
`,t}function Td(t){let[,e,r,i,n]=t.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:e,email:r,timestamp:Number(i),timezoneOffset:w8(n)}}function w8(t){let[,e,r,i]=t.match(/(\+|-)(\d\d)(\d\d)/);return i=(e==="+"?1:-1)*(Number(r)*60+Number(i)),y8(i)}function y8(t){return t===0?t:-t}var Kr=class t{constructor(e){if(typeof e=="string")this._tag=e;else if(Buffer.isBuffer(e))this._tag=e.toString("utf8");else if(typeof e=="object")this._tag=t.render(e);else throw new he("invalid type passed to GitAnnotatedTag constructor")}static from(e){return new t(e)}static render(e){return`object ${e.object}
|
||||||
|
type ${e.type}
|
||||||
|
tag ${e.tag}
|
||||||
|
tagger ${cv(e.tagger)}
|
||||||
|
|
||||||
|
${e.message}
|
||||||
|
${e.gpgsig?e.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexOf(`
|
||||||
|
|
||||||
|
`))}message(){let e=this.withoutSignature();return e.slice(e.indexOf(`
|
||||||
|
|
||||||
|
`)+2)}parse(){return Object.assign(this.headers(),{message:this.message(),gpgsig:this.gpgsig()})}render(){return this._tag}headers(){let e=this.justHeaders().split(`
|
||||||
|
`),r=[];for(let n of e)n[0]===" "?r[r.length-1]+=`
|
||||||
|
`+n.slice(1):r.push(n);let i={};for(let n of r){let s=n.slice(0,n.indexOf(" ")),a=n.slice(n.indexOf(" ")+1);Array.isArray(i[s])?i[s].push(a):i[s]=a}return i.tagger&&(i.tagger=Td(i.tagger)),i.committer&&(i.committer=Td(i.committer)),i}withoutSignature(){let e=jn(this._tag);return e.indexOf(`
|
||||||
|
-----BEGIN PGP SIGNATURE-----`)===-1?e:e.slice(0,e.lastIndexOf(`
|
||||||
|
-----BEGIN PGP SIGNATURE-----`))}gpgsig(){if(this._tag.indexOf(`
|
||||||
|
-----BEGIN PGP SIGNATURE-----`)===-1)return;let e=this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27);return jn(e)}payload(){return this.withoutSignature()+`
|
||||||
|
`}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(e,r,i){let n=e.payload(),{signature:s}=await r({payload:n,secretKey:i});s=jn(s);let a=n+s;return t.from(a)}};function Kg(t){return t.trim().split(`
|
||||||
|
`).map(e=>" "+e).join(`
|
||||||
|
`)+`
|
||||||
|
`}function b8(t){return t.split(`
|
||||||
|
`).map(e=>e.replace(/^ /,"")).join(`
|
||||||
|
`)}var kr=class t{constructor(e){if(typeof e=="string")this._commit=e;else if(Buffer.isBuffer(e))this._commit=e.toString("utf8");else if(typeof e=="object")this._commit=t.render(e);else throw new he("invalid type passed to GitCommit constructor")}static fromPayloadSignature({payload:e,signature:r}){let i=t.justHeaders(e),n=t.justMessage(e),s=jn(i+`
|
||||||
|
gpgsig`+Kg(r)+`
|
||||||
|
`+n);return new t(s)}static from(e){return new t(e)}toObject(){return Buffer.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return t.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(e){return jn(e.slice(e.indexOf(`
|
||||||
|
|
||||||
|
`)+2))}static justHeaders(e){return e.slice(0,e.indexOf(`
|
||||||
|
|
||||||
|
`))}parseHeaders(){let e=t.justHeaders(this._commit).split(`
|
||||||
|
`),r=[];for(let n of e)n[0]===" "?r[r.length-1]+=`
|
||||||
|
`+n.slice(1):r.push(n);let i={parent:[]};for(let n of r){let s=n.slice(0,n.indexOf(" ")),a=n.slice(n.indexOf(" ")+1);Array.isArray(i[s])?i[s].push(a):i[s]=a}return i.author&&(i.author=Td(i.author)),i.committer&&(i.committer=Td(i.committer)),i}static renderHeaders(e){let r="";if(e.tree?r+=`tree ${e.tree}
|
||||||
|
`:r+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
||||||
|
`,e.parent){if(e.parent.length===void 0)throw new he("commit 'parent' property should be an array");for(let s of e.parent)r+=`parent ${s}
|
||||||
|
`}let i=e.author;r+=`author ${cv(i)}
|
||||||
|
`;let n=e.committer||e.author;return r+=`committer ${cv(n)}
|
||||||
|
`,e.gpgsig&&(r+="gpgsig"+Kg(e.gpgsig)),r}static render(e){return t.renderHeaders(e)+`
|
||||||
|
`+jn(e.message)}render(){return this._commit}withoutSignature(){let e=jn(this._commit);if(e.indexOf(`
|
||||||
|
gpgsig`)===-1)return e;let r=e.slice(0,e.indexOf(`
|
||||||
|
gpgsig`)),i=e.slice(e.indexOf(`-----END PGP SIGNATURE-----
|
||||||
|
`)+28);return jn(r+`
|
||||||
|
`+i)}isolateSignature(){let e=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return b8(e)}static async sign(e,r,i){let n=e.withoutSignature(),s=t.justMessage(e._commit),{signature:a}=await r({payload:n,secretKey:i});a=jn(a);let l=t.justHeaders(e._commit)+`
|
||||||
|
gpgsig`+Kg(a)+`
|
||||||
|
`+s;return t.from(l)}};async function Qo({fs:t,cache:e,gitdir:r,oid:i}){if(i==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:Er.from([]),oid:i};let{type:n,object:s}=await Ke({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=Kr.from(s).parse().object,Qo({fs:t,cache:e,gitdir:r,oid:i});if(n==="commit")return i=kr.from(s).parse().tree,Qo({fs:t,cache:e,gitdir:r,oid:i});if(n!=="tree")throw new hr(i,n,"tree");return{tree:Er.from(s),oid:i}}var uv=class{constructor({fs:e,gitdir:r,ref:i,cache:n}){this.fs=e,this.cache=n,this.gitdir=r,this.mapPromise=(async()=>{let a=new Map,o;try{o=await W.resolve({fs:e,gitdir:r,ref:i})}catch(c){c instanceof He&&(o="4b825dc642cb6eb9a060e54bf8d69288fbee4904")}let l=await Qo({fs:e,cache:this.cache,gitdir:r,oid:o});return l.type="tree",l.mode="40000",a.set(".",l),a})();let s=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return s.type(this)}async mode(){return s.mode(this)}async stat(){return s.stat(this)}async content(){return s.content(this)}async oid(){return s.oid(this)}}}async readdir(e){let r=e._fullpath,{fs:i,cache:n,gitdir:s}=this,a=await this.mapPromise,o=a.get(r);if(!o)throw new Error(`No obj for ${r}`);let l=o.oid;if(!l)throw new Error(`No oid for obj ${JSON.stringify(o)}`);if(o.type!=="tree")return null;let{type:c,object:u}=await Ke({fs:i,cache:n,gitdir:s,oid:l});if(c!==o.type)throw new hr(l,c,o.type);let f=Er.from(u);for(let d of f)a.set(O(r,d.path),d);return f.entries().map(d=>O(r,d.path))}async type(e){if(e._type===!1){let r=await this.mapPromise,{type:i}=r.get(e._fullpath);e._type=i}return e._type}async mode(e){if(e._mode===!1){let r=await this.mapPromise,{mode:i}=r.get(e._fullpath);e._mode=XE(parseInt(i,8))}return e._mode}async stat(e){}async content(e){if(e._content===!1){let r=await this.mapPromise,{fs:i,cache:n,gitdir:s}=this,o=r.get(e._fullpath).oid,{type:l,object:c}=await Ke({fs:i,cache:n,gitdir:s,oid:o});l!=="blob"?e._content=void 0:e._content=new Uint8Array(c)}return e._content}async oid(e){if(e._oid===!1){let i=(await this.mapPromise).get(e._fullpath);e._oid=i.oid}return e._oid}};function Zr({ref:t="HEAD"}={}){let e=Object.create(null);return Object.defineProperty(e,Id,{value:function({fs:r,gitdir:i,cache:n}){return new uv({fs:r,gitdir:i,ref:t,cache:n})}}),Object.freeze(e),e}var fv=class{constructor({fs:e,dir:r,gitdir:i,cache:n}){this.fs=e,this.cache=n,this.dir=r,this.gitdir=i,this.config=null;let s=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return s.type(this)}async mode(){return s.mode(this)}async stat(){return s.stat(this)}async content(){return s.content(this)}async oid(){return s.oid(this)}}}async readdir(e){let r=e._fullpath,{fs:i,dir:n}=this,s=await i.readdir(O(n,r));return s===null?null:s.map(a=>O(r,a))}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let{fs:r,dir:i}=this,n=await r.lstat(`${i}/${e._fullpath}`);if(!n)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let s=n.isDirectory()?"tree":"blob";s==="blob"&&!n.isFile()&&!n.isSymbolicLink()&&(s="special"),e._type=s,n=Vo(n),e._mode=n.mode,n.size===-1&&e._actualSize&&(n.size=e._actualSize),e._stat=n}return e._stat}async content(e){if(e._content===!1){let{fs:r,dir:i,gitdir:n}=this;if(await e.type()==="tree")e._content=void 0;else{let s;if(await e.mode()>>12===10)s=await r.readlink(`${i}/${e._fullpath}`);else{let o=await(await this._getGitConfig(r,n)).get("core.autocrlf");s=await r.read(`${i}/${e._fullpath}`,{autocrlf:o})}e._actualSize=s.length,e._stat&&e._stat.size===-1&&(e._stat.size=e._actualSize),e._content=new Uint8Array(s)}}return e._content}async oid(e){if(e._oid===!1){let r=this,{fs:i,gitdir:n,cache:s}=this,a;await mt.acquire({fs:i,gitdir:n,cache:s},async function(o){let l=o.entriesMap.get(e._fullpath),c=await e.stat(),f=await(await r._getGitConfig(i,n)).get("core.filemode"),d=typeof process!="undefined"?process.platform!=="win32":!0;if(!l||xd(c,l,f,d)){let h=await e.content();h===void 0?a=void 0:(a=await qn(Rs.wrap({type:"blob",object:h})),l&&a===l.oid&&(!f||c.mode===l.mode)&&xd(c,l,f,d)&&o.insert({filepath:e._fullpath,stats:c,oid:a}))}else a=l.oid}),e._oid=a}return e._oid}async _getGitConfig(e,r){return this.config?this.config:(this.config=await ct.get({fs:e,gitdir:r}),this.config)}};function nl(){let t=Object.create(null);return Object.defineProperty(t,Id,{value:function({fs:e,dir:r,gitdir:i,cache:n}){return new fv({fs:e,dir:r,gitdir:i,cache:n})}}),Object.freeze(t),t}function _8(t,e){let r=e-t;return Array.from({length:r},(i,n)=>t+n)}var ik=typeof Array.prototype.flat=="undefined"?t=>t.reduce((e,r)=>e.concat(r),[]):t=>t.flat(),dv=class{constructor(){this.value=null}consider(e){e!=null&&(this.value===null?this.value=e:e<this.value&&(this.value=e))}reset(){th
Line truncated
|
||||||
|
`),i=new TextEncoder().encode(i)}catch(n){}return typeof i!="string"&&(i=Buffer.from(i)),i}catch(i){return null}}async write(e,r,i={}){try{await this._writeFile(e,r,i)}catch(n){await this.mkdir(xa(e)),await this._writeFile(e,r,i)}}async mkdir(e,r=!1){try{await this._mkdir(e)}catch(i){if(i===null||i.code==="EEXIST")return;if(r)throw i;if(i.code==="ENOENT"){let n=xa(e);if(n==="."||n==="/"||n===e)throw i;await this.mkdir(n),await this.mkdir(e,!0)}}}async rm(e){try{await this._unlink(e)}catch(r){if(r.code!=="ENOENT")throw r}}async rmdir(e,r){try{r&&r.recursive?await this._rm(e,r):await this._rmdir(e)}catch(i){if(i.code!=="ENOENT")throw i}}async readdir(e){try{let r=await this._readdir(e);return r.sort(Fd),r}catch(r){return r.code==="ENOTDIR"?null:[]}}async readdirDeep(e){let r=await this._readdir(e);return(await Promise.all(r.map(async n=>{let s=e+"/"+n;return(await this._stat(s)).isDirectory()?this.readdirDeep(s):s}))).reduce((n,s)=>n.concat(s),[])}async lstat(e){try{return await this._lstat(e)}catch(r){if(r.code==="ENOENT"||(r.code||"").includes("ENS"))return null;throw r}}async readlink(e,r={encoding:"buffer"}){try{let i=await this._readlink(e,r);return Buffer.isBuffer(i)?i:Buffer.from(i)}catch(i){if(i.code==="ENOENT"||(i.code||"").includes("ENS"))return null;throw i}}async writelink(e,r){return this._symlink(r.toString("utf8"),e)}};function C(t,e){if(e===void 0)throw new Sr(t)}async function ee({fsp:t,dotgit:e}){C("fsp",t),C("dotgit",e);let r=await t._stat(e).catch(()=>({isFile:()=>!1,isDirectory:()=>!1}));return r.isDirectory()?e:r.isFile()?t._readFile(e,"utf8").then(i=>i.trimRight().substr(8)).then(i=>O(xa(e),i)):e}async function Cd(t,e){return!t&&!e?!1:t&&!e||!t&&e?!0:!(await t.type()==="tree"&&await e.type()==="tree"||await t.type()===await e.type()&&await t.mode()===await e.mode()&&await t.oid()===await e.oid())}async function nk({fs:t,dir:e,gitdir:r=O(e,".git"),commit:i="HEAD",cache:n={}}){try{C("fs",t),C("dir",e),C("gitdir",r);let s=new J(t),a=[Zr({ref:i}),nl(),Aa()],o=[],l=await ee({fsp:s,dotgit:r});await mt.acquire({fs:s,gitdir:l,cache:n},async function(u){o=u.unmergedPaths});let c=await Fs({fs:s,cache:n,dir:e,gitdir:l,trees:a,map:async function(u,[f,d,h]){let m=!await Cd(d,h),g=o.includes(u),v=!await Cd(h,f);if(m||g)return f?{path:u,mode:await f.mode(),oid:await f.oid(),type:await f.type(),content:await f.content()}:void 0;if(v)return!1;throw new tu(u)}});await mt.acquire({fs:s,gitdir:l,cache:n},async function(u){for(let f of c)if(f!==!1){if(!f){await s.rmdir(`${e}/${f.path}`,{recursive:!0}),u.delete({filepath:f.path});continue}if(f.type==="blob"){let d=new TextDecoder().decode(f.content);await s.write(`${e}/${f.path}`,d,{mode:f.mode}),u.insert({filepath:f.path,oid:f.oid,stage:0})}}})}catch(s){throw s.caller="git.abortMerge",s}}var Is=class{static async isIgnored({fs:e,dir:r,gitdir:i=O(r,".git"),filepath:n}){if(Sd(n)===".git")return!0;if(n===".")return!1;let s="",a=O(i,"info","exclude");await e.exists(a)&&(s=await e.read(a,"utf8"));let o=[{gitignore:O(r,".gitignore"),filepath:n}],l=n.split("/").filter(Boolean);for(let u=1;u<l.length;u++){let f=l.slice(0,u).join("/"),d=l.slice(u).join("/");o.push({gitignore:O(r,f,".gitignore"),filepath:d})}let c=!1;for(let u of o){let f;try{f=await e.read(u.gitignore,"utf8")}catch(m){if(m.code==="NOENT")continue}let d=C3().add(s);d.add(f);let h=xa(u.filepath);if(h!=="."&&d.ignores(h))return!0;c?c=!d.test(u.filepath).unignored:c=d.test(u.filepath).ignored}return c}};async function k8({fs:t,gitdir:e,object:r,format:i,oid:n}){if(i!=="deflated")throw new he("GitObjectStoreLoose expects objects to write to be in deflated format");let s=`objects/${n.slice(0,2)}/${n.slice(2)}`,a=`${e}/${s}`;await t.exists(a)||await t.write(a,r)}var Qg=null;async function sk(t){return Qg===null&&(Qg=T8()),Qg?A8(t):gv.deflate(t)}async function A8(t){let e=new CompressionStream("deflate"),r=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}function T8(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch(t){return!1}}async function Ar({fs:t,gitdir:e,type:r,object:i,format:n="content",oid:s=void 0,dryRun:a=!1}){return n!=="deflated"&&(n!=="wrapped"&&(i=Rs.wrap({type:r,object:i})),s=await qn(i),i=Buffer.from(await sk(i))),a||await k8({fs:t,gitdir:e,object:i,format:"deflated",oid:s}),s}function ak(t){let e;for(;~(e=t.indexOf(92));)t[e]=47;return t}async function ok({fs:t,dir:e,gitdir:r=O(e,".git"),filepath:i,cache:n={},force:s=!1,parallel:a=!0}){try{C("fs",t),C("dir",e),C("gitdir",r),C("filepath",i);let o=new J(t),l=await ee({fsp:o,dotgit:r});await mt.acquire({fs:o,gitdir:l,cache:n},async c=>{let f=await(await ct.get({fs:o,gitdir:l})).get("core.autocrlf");return pv({dir:e,gitdir:l,fs:o,filepath:i,index:c,force:s,parallel:a,autocrlf:f})})}catch(o){throw o.caller="git.add",o}}async function pv({dir:t,gitdir:e,fs:r,filepath:i,index:n,force:s,parallel:a,autocrlf:o}){i=Array.isArray(i)?i:[i];let l=i.map(
Line truncated
|
||||||
|
`,author:l,committer:c,signingKey:u})}async function dk({fs:t,onSign:e,dir:r,gitdir:i=O(r,".git"),ref:n="refs/notes/commits",oid:s,note:a,force:o,author:l,committer:c,signingKey:u,cache:f={}}){try{C("fs",t),C("gitdir",i),C("oid",s),C("note",a),u&&C("onSign",e);let d=new J(t),h=await Os({fs:d,gitdir:i,author:l});if(!h)throw new Jt("author");let m=await Jo({fs:d,gitdir:i,author:h,committer:c});if(!m)throw new Jt("committer");let g=await ee({fsp:d,dotgit:i});return await C8({fs:d,cache:f,onSign:e,gitdir:g,ref:n,oid:s,note:a,force:o,author:h,committer:m,signingKey:u})}catch(d){throw d.caller="git.addNote",d}}var P8=/(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/;function nu(t,e){if(typeof t!="string")throw new TypeError("Reference name must be a string");return!P8.test(t)&&(!!e||t.includes("/"))}async function hk({fs:t,gitdir:e,remote:r,url:i,force:n}){if(!nu(r,!0))throw new Fi(r,Hc.clean(r));let s=await ct.get({fs:t,gitdir:e});if(!n&&(await s.getSubsections("remote")).includes(r)&&i!==await s.get(`remote.${r}.url`))throw new $i("remote",r);await s.set(`remote.${r}.url`,i),await s.set(`remote.${r}.fetch`,`+refs/heads/*:refs/remotes/${r}/*`),await ct.save({fs:t,gitdir:e,config:s})}async function pk({fs:t,dir:e,gitdir:r=O(e,".git"),remote:i,url:n,force:s=!1}){try{C("fs",t),C("gitdir",r),C("remote",i),C("url",n);let a=new J(t),o=await ee({fsp:a,dotgit:r});return await hk({fs:a,gitdir:o,remote:i,url:n,force:s})}catch(a){throw a.caller="git.addRemote",a}}async function R8({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tagger:s,message:a=n,gpgsig:o,object:l,signingKey:c,force:u=!1}){if(n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`,!u&&await W.exists({fs:t,gitdir:i,ref:n}))throw new $i("tag",n);let f=await W.resolve({fs:t,gitdir:i,ref:l||"HEAD"}),{type:d}=await Ke({fs:t,cache:e,gitdir:i,oid:f}),h=Kr.from({object:f,type:d,tag:n.replace("refs/tags/",""),tagger:s,message:a,gpgsig:o});c&&(h=await Kr.sign(h,r,c));let m=await Ar({fs:t,gitdir:i,type:"tag",object:h.toObject()});await W.writeRef({fs:t,gitdir:i,ref:n,value:m})}async function mk({fs:t,onSign:e,dir:r,gitdir:i=O(r,".git"),ref:n,tagger:s,message:a=n,gpgsig:o,object:l,signingKey:c,force:u=!1,cache:f={}}){try{C("fs",t),C("gitdir",i),C("ref",n),c&&C("onSign",e);let d=new J(t),h=await ee({fsp:d,dotgit:i}),m=await Os({fs:d,gitdir:h,author:s});if(!m)throw new Jt("tagger");return await R8({fs:d,cache:f,onSign:e,gitdir:h,ref:n,tagger:m,message:a,gpgsig:o,object:l,signingKey:c,force:u})}catch(d){throw d.caller="git.annotatedTag",d}}async function $8({fs:t,gitdir:e,ref:r,object:i,checkout:n=!1,force:s=!1}){if(!nu(r,!0))throw new Fi(r,Hc.clean(r));let a=`refs/heads/${r}`;if(!s&&await W.exists({fs:t,gitdir:e,ref:a}))throw new $i("branch",r,!1);let o;try{o=await W.resolve({fs:t,gitdir:e,ref:i||"HEAD"})}catch(l){}o&&await W.writeRef({fs:t,gitdir:e,ref:a,value:o}),n&&await W.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:a})}async function gk({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i,object:n,checkout:s=!1,force:a=!1}){try{C("fs",t),C("gitdir",r),C("ref",i);let o=new J(t),l=await ee({fsp:o,dotgit:r});return await $8({fs:o,gitdir:l,ref:i,object:n,checkout:s,force:a})}catch(o){throw o.caller="git.branch",o}}var vk=(t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e);async function wv({fs:t,cache:e,onProgress:r,onPostCheckout:i,dir:n,gitdir:s,remote:a,ref:o,filepaths:l,noCheckout:c,noUpdateHead:u,dryRun:f,force:d,track:h=!0,nonBlocking:m=!1,batchSize:g=100}){let v;if(i)try{v=await W.resolve({fs:t,gitdir:s,ref:"HEAD"})}catch(b){v="0000000000000000000000000000000000000000"}let w;try{w=await W.resolve({fs:t,gitdir:s,ref:o})}catch(b){if(o==="HEAD")throw b;let k=`${a}/${o}`;if(w=await W.resolve({fs:t,gitdir:s,ref:k}),h){let x=await ct.get({fs:t,gitdir:s});await x.set(`branch.${o}.remote`,a),await x.set(`branch.${o}.merge`,`refs/heads/${o}`),await ct.save({fs:t,gitdir:s,config:x})}await W.writeRef({fs:t,gitdir:s,ref:`refs/heads/${o}`,value:w})}if(!c){let b;try{b=await F8({fs:t,cache:e,onProgress:r,dir:n,gitdir:s,ref:o,force:d,filepaths:l})}catch(y){throw y instanceof He&&y.data.what===w?new Vc(o,w):y}let k=b.filter(([y])=>y==="conflict").map(([y,S])=>S);if(k.length>0)throw new zc(k);let x=b.filter(([y])=>y==="error").map(([y,S])=>S);if(x.length>0)throw new he(x.join(", "));if(f){i&&await i({previousHead:v,newHead:w,type:l!=null&&l.length>0?"file":"branch"});return}let E=0,A=b.length;if(await mt.acquire({fs:t,gitdir:s,cache:e},async function(y){await Promise.all(b.filter(([S])=>S==="delete"||S==="delete-index").map(async function([S,_]){let T=`${n}/${_}`;S==="delete"&&await t.rm(T),y.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++E,total:A})}))}),await mt.acquire({fs:t,gitdir:s,cache:e},async function(y){for(let[S,_]of b)if(S==="rmdir"||S==="rmdir-index"){let T=`${n}/${_}`;try{S==="rmdir"&&await t.rmdir(T),y.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++E,total:A})}catch(P){if(P.code==="ENOTEMP
Line truncated
|
||||||
|
`).map(a=>n.add(a))}),n}static async write({fs:e,gitdir:r,oids:i}){ba===null&&(ba=new Nc);let n=O(r,"shallow");if(i.size>0){let s=[...i].join(`
|
||||||
|
`)+`
|
||||||
|
`;await ba.acquire(n,async function(){await e.write(n,s,{encoding:"utf8"})})}else await ba.acquire(n,async function(){await e.rm(n)})}};async function B8({fs:t,gitdir:e,oid:r}){let i=`objects/${r.slice(0,2)}/${r.slice(2)}`;return t.exists(`${e}/${i}`)}async function N8({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){let s=await t.readdir(O(r,"objects/pack"));s=s.filter(a=>a.endsWith(".idx"));for(let a of s){let o=`${r}/objects/pack/${a}`,l=await vv({fs:t,cache:e,filename:o,getExternalRefDelta:n});if(l.error)throw new he(l.error);if(l.offsets.has(i))return!0}return!1}async function qE({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){let s=o=>Ke({fs:t,cache:e,gitdir:r,oid:o}),a=await B8({fs:t,gitdir:r,oid:i});return a||(a=await N8({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:s})),a}function H8(t){let n="5041434b"+"00000002"+"00000000";return t.slice(0,12).toString("hex")===n}function yk(t,e){let r=t.map(i=>i.split("=",1)[0]);return e.filter(i=>{let n=i.split("=",1)[0];return r.includes(n)})}var Md={name:"isomorphic-git",version:"1.36.3",agent:"git/isomorphic-git@1.36.3"},qo=class{constructor(){this._queue=[]}write(e){if(this._ended)throw Error("You cannot write to a FIFO that has already been ended!");if(this._waiting){let r=this._waiting;this._waiting=null,r({value:e})}else this._queue.push(e)}end(){if(this._ended=!0,this._waiting){let e=this._waiting;this._waiting=null,e({done:!0})}}destroy(e){this.error=e,this.end()}async next(){if(this._queue.length>0)return{value:this._queue.shift()};if(this._ended)return{done:!0};if(this._waiting)throw Error("You cannot call read until the previous call to read has returned!");return new Promise(e=>{this._waiting=e})}};function U8(t){let e=t.indexOf("\r"),r=t.indexOf(`
|
||||||
|
`);return e===-1&&r===-1?-1:e===-1?r+1:r===-1?e+1:r===e+1?r+1:Math.min(e,r)+1}function bk(t){let e=new qo,r="";return(async()=>(await ou(t,i=>{for(i=i.toString("utf8"),r+=i;;){let n=U8(r);if(n===-1)break;e.write(r.slice(0,n)),r=r.slice(n)}}),r.length>0&&e.write(r),e.end()))(),e}var Rd=class{static demux(e){let r=at.streamReader(e),i=new qo,n=new qo,s=new qo,a=async function(){let o=await r();if(o===null)return a();if(o===!0){i.end(),s.end(),e.error?n.destroy(e.error):n.end();return}switch(o[0]){case 1:{n.write(o.slice(1));break}case 2:{s.write(o.slice(1));break}case 3:{let l=o.slice(1);s.write(l),i.end(),s.end(),n.destroy(new Error(l.toString("utf8")));return}default:i.write(o)}a()};return a(),{packetlines:i,packfile:n,progress:s}}};async function G8(t){let{packetlines:e,packfile:r,progress:i}=Rd.demux(t),n=[],s=[],a=[],o=!1,l=!1;return new Promise((c,u)=>{ou(e,f=>{let d=f.toString("utf8").trim();if(d.startsWith("shallow")){let h=d.slice(-41).trim();h.length!==40&&u(new Ps(h)),n.push(h)}else if(d.startsWith("unshallow")){let h=d.slice(-41).trim();h.length!==40&&u(new Ps(h)),s.push(h)}else if(d.startsWith("ACK")){let[,h,m]=d.split(" ");a.push({oid:h,status:m}),m||(l=!0)}else d.startsWith("NAK")?(o=!0,l=!0):(l=!0,o=!0);l&&(t.error?u(t.error):c({shallows:n,unshallows:s,acks:a,nak:o,packfile:r,progress:i}))}).finally(()=>{l||(t.error?u(t.error):c({shallows:n,unshallows:s,acks:a,nak:o,packfile:r,progress:i}))})})}function j8({capabilities:t=[],wants:e=[],haves:r=[],shallows:i=[],depth:n=null,since:s=null,exclude:a=[]}){let o=[];e=[...new Set(e)];let l=` ${t.join(" ")}`;for(let c of e)o.push(at.encode(`want ${c}${l}
|
||||||
|
`)),l="";for(let c of i)o.push(at.encode(`shallow ${c}
|
||||||
|
`));n!==null&&o.push(at.encode(`deepen ${n}
|
||||||
|
`)),s!==null&&o.push(at.encode(`deepen-since ${Math.floor(s.valueOf()/1e3)}
|
||||||
|
`));for(let c of a)o.push(at.encode(`deepen-not ${c}
|
||||||
|
`));o.push(at.flush());for(let c of r)o.push(at.encode(`have ${c}
|
||||||
|
`));return o.push(at.encode(`done
|
||||||
|
`)),o}async function bv({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,gitdir:l,ref:c,remoteRef:u,remote:f,url:d,corsProxy:h,depth:m=null,since:g=null,exclude:v=[],relative:w=!1,tags:b=!1,singleBranch:k=!1,headers:x={},prune:E=!1,pruneTags:A=!1}){let y=c||await Ds({fs:t,gitdir:l,test:!0}),S=await ct.get({fs:t,gitdir:l}),_=f||y&&await S.get(`branch.${y}.remote`)||"origin",T=d||await S.get(`remote.${_}.url`);if(typeof T=="undefined")throw new Sr("remote OR url");let P=u||y&&await S.get(`branch.${y}.merge`)||c||"HEAD";h===void 0&&(h=await S.get("http.corsProxy"));let D=rl.getRemoteHelperFor({url:T}),B=await D.discover({http:r,onAuth:s,onAuthSuccess:a,onAuthFailure:o,corsProxy:h,service:"git-upload-pack",url:T,headers:x,protocolVersion:1}),N=B.auth,ce=B.refs;if(ce.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(m!==null&&!B.capabilities.has("shallow"))throw new Cs("shallow","depth");if(g!==null&&!B.capabilities.has("deepen-since"))throw new Cs("deepen-since","since");if(v.length>0&&!B.capabilities.has("deepen-not"))throw new Cs("deepen-not","exclude");if(w===!0&&!B.capabilities.has("deepen-relative"))throw new Cs("deepen-relative","relative");let{oid:Pe,fullref:ve}=W.resolveAgainstMap({ref:P,map:ce});for(let q of ce.keys())q===ve||q==="HEAD"||q.startsWith("refs/heads/")||b&&q.startsWith("refs/tags/")||ce.delete(q);let se=yk([...B.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${Md.agent}`]);w&&se.push("deepen-relative");let xe=k?[Pe]:ce.values(),we=k?[y]:await W.listRefs({fs:t,gitdir:l,filepath:"refs"}),z=[];for(let q of we)try{q=await W.expand({fs:t,gitdir:l,ref:q});let Z=await W.resolve({fs:t,gitdir:l,ref:q});await qE({fs:t,cache:e,gitdir:l,oid:Z})&&z.push(Z)}catch(Z){}z=[...new Set(z)];let Q=await Ea.read({fs:t,gitdir:l}),j=B.capabilities.has("shallow")?[...Q]:[],Le=j8({capabilities:se,wants:xe,haves:z,shallows:j,depth:m,since:g,exclude:v}),lr=Buffer.from(await Pd(Le)),It=await D.connect({http:r,onProgress:i,corsProxy:h,service:"git-upload-pack",url:T,auth:N,body:[lr],headers:x}),Fe=await G8(It.body);It.headers&&(Fe.headers=It.headers);for(let q of Fe.shallows)if(!Q.has(q))try{let{object:Z}=await Ke({fs:t,cache:e,gitdir:l,oid:q}),L=new kr(Z),V=await Promise.all(L.headers().parent.map(qe=>qE({fs:t,cache:e,gitdir:l,oid:qe})));V.length===0||V.every(qe=>qe)||Q.add(q)}catch(Z){Q.add(q)}for(let q of Fe.unshallows)Q.delete(q);if(await Ea.write({fs:t,gitdir:l,oids:Q}),k){let q=new Map([[ve,Pe]]),Z=new Map,L=10,V=ve;for(;L--;){let Ot=B.symrefs.get(V);if(Ot===void 0)break;Z.set(V,Ot),V=Ot}let Te=ce.get(V);Te&&q.set(V,Te);let{pruned:qe}=await W.updateRemoteRefs({fs:t,gitdir:l,remote:_,refs:q,symrefs:Z,tags:b,prune:E});E&&(Fe.pruned=qe)}else{let{pruned:q}=await W.updateRemoteRefs({fs:t,gitdir:l,remote:_,refs:ce,symrefs:B.symrefs,tags:b,prune:E,pruneTags:A});E&&(Fe.pruned=q)}if(Fe.HEAD=B.symrefs.get("HEAD"),Fe.HEAD===void 0){let{oid:q}=W.resolveAgainstMap({ref:"HEAD",map:ce});for(let[Z,L]of ce.entries())if(Z!=="HEAD"&&L===q){Fe.HEAD=Z;break}}let At=ve.startsWith("refs/tags")?"tag":"branch";if(Fe.FETCH_HEAD={oid:Pe,description:`${At} '${_a(ve)}' of ${T}`},i||n){let q=bk(Fe.progress);ou(q,async Z=>{if(n&&await n(Z),i){let L=Z.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);L&&await i({phase:L[1].trim(),loaded:parseInt(L[2],10),total:parseInt(L[3],10)})}})}let Tt=Buffer.from(await Pd(Fe.packfile));if(It.body.error)throw It.body.error;let jt=Tt.slice(-20).toString("hex"),Ze={defaultBranch:Fe.HEAD,fetchHead:Fe.FETCH_HEAD.oid,fetchHeadDescription:Fe.FETCH_HEAD.description};if(Fe.headers&&(Ze.headers=Fe.headers),E&&(Ze.pruned=Fe.pruned),jt!==""&&!H8(Tt)){Ze.packfile=`objects/pack/pack-${jt}.pack`;let q=O(l,Ze.packfile);await t.write(q,Tt);let Z=V=>Ke({fs:t,cache:e,gitdir:l,oid:V}),L=await jc.fromPack({pack:Tt,getExternalRefDelta:Z,onProgress:i});await t.write(q.replace(/\.pack$/,".idx"),await L.toBuffer())}return Ze}async function _k({fs:t,bare:e=!1,dir:r,gitdir:i=e?r:O(r,".git"),defaultBranch:n="master"}){if(await t.exists(i+"/config"))return;let s=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];s=s.map(a=>i+"/"+a);for(let a of s)await t.mkdir(a);await t.write(i+"/config",`[core]
|
||||||
|
repositoryformatversion = 0
|
||||||
|
filemode = false
|
||||||
|
bare = ${e}
|
||||||
|
`+(e?"":` logallrefupdates = true
|
||||||
|
`)+` symlinks = false
|
||||||
|
ignorecase = true
|
||||||
|
`),await t.write(i+"/HEAD",`ref: refs/heads/${n}
|
||||||
|
`)}async function q8({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,onPostCheckout:l,dir:c,gitdir:u,url:f,corsProxy:d,ref:h,remote:m,depth:g,since:v,exclude:w,relative:b,singleBranch:k,noCheckout:x,noTags:E,headers:A,nonBlocking:y,batchSize:S=100}){try{if(await _k({fs:t,gitdir:u}),await hk({fs:t,gitdir:u,remote:m,url:f,force:!1}),d){let P=await ct.get({fs:t,gitdir:u});await P.set("http.corsProxy",d),await ct.save({fs:t,gitdir:u,config:P})}let{defaultBranch:_,fetchHead:T}=await bv({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,gitdir:u,ref:h,remote:m,corsProxy:d,depth:g,since:v,exclude:w,relative:b,singleBranch:k,headers:A,tags:!E});if(T===null)return;h=h||_,h=h.replace("refs/heads/",""),await wv({fs:t,cache:e,onProgress:i,onPostCheckout:l,dir:c,gitdir:u,ref:h,remote:m,noCheckout:x,nonBlocking:y,batchSize:S})}catch(_){throw await t.rmdir(u,{recursive:!0,maxRetries:10}).catch(()=>{}),_}}async function xk({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPostCheckout:o,dir:l,gitdir:c=O(l,".git"),url:u,corsProxy:f=void 0,ref:d=void 0,remote:h="origin",depth:m=void 0,since:g=void 0,exclude:v=[],relative:w=!1,singleBranch:b=!1,noCheckout:k=!1,noTags:x=!1,headers:E={},cache:A={},nonBlocking:y=!1,batchSize:S=100}){try{C("fs",t),C("http",e),C("gitdir",c),k||C("dir",l),C("url",u);let _=new J(t),T=await ee({fsp:_,dotgit:c});return await q8({fs:_,cache:A,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPostCheckout:o,dir:l,gitdir:T,url:u,corsProxy:f,ref:d,remote:h,depth:m,since:g,exclude:v,relative:w,singleBranch:b,noCheckout:k,noTags:x,headers:E,nonBlocking:y,batchSize:S})}catch(_){throw _.caller="git.clone",_}}async function Sk({fs:t,onSign:e,dir:r,gitdir:i=O(r,".git"),message:n,author:s,committer:a,signingKey:o,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:f,parent:d,tree:h,cache:m={}}){try{C("fs",t),l||C("message",n),o&&C("onSign",e);let g=new J(t),v=await ee({fsp:g,dotgit:i});return await Od({fs:g,cache:m,onSign:e,gitdir:v,message:n,author:s,committer:a,signingKey:o,amend:l,dryRun:c,noUpdateBranch:u,ref:f,parent:d,tree:h})}catch(g){throw g.caller="git.commit",g}}async function Ek({fs:t,dir:e,gitdir:r=O(e,".git"),fullname:i=!1,test:n=!1}){try{C("fs",t),C("gitdir",r);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await Ds({fs:s,gitdir:a,fullname:i,test:n})}catch(s){throw s.caller="git.currentBranch",s}}async function z8({fs:t,gitdir:e,ref:r}){if(r=r.startsWith("refs/heads/")?r:`refs/heads/${r}`,!await W.exists({fs:t,gitdir:e,ref:r}))throw new He(r);let n=await W.expand({fs:t,gitdir:e,ref:r}),s=await Ds({fs:t,gitdir:e,fullname:!0});if(n===s){let l=await W.resolve({fs:t,gitdir:e,ref:n});await W.writeRef({fs:t,gitdir:e,ref:"HEAD",value:l})}await W.deleteRef({fs:t,gitdir:e,ref:n});let a=_a(r),o=await ct.get({fs:t,gitdir:e});await o.deleteSection("branch",a),await ct.save({fs:t,gitdir:e,config:o})}async function kk({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i}){try{C("fs",t),C("ref",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await z8({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.deleteBranch",n}}async function Ak({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i}){try{C("fs",t),C("ref",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});await W.deleteRef({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.deleteRef",n}}async function V8({fs:t,gitdir:e,remote:r}){let i=await ct.get({fs:t,gitdir:e});await i.deleteSection("remote",r),await ct.save({fs:t,gitdir:e,config:i})}async function Tk({fs:t,dir:e,gitdir:r=O(e,".git"),remote:i}){try{C("fs",t),C("remote",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await V8({fs:n,gitdir:s,remote:i})}catch(n){throw n.caller="git.deleteRemote",n}}async function W8({fs:t,gitdir:e,ref:r}){r=r.startsWith("refs/tags/")?r:`refs/tags/${r}`,await W.deleteRef({fs:t,gitdir:e,ref:r})}async function Ck({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i}){try{C("fs",t),C("ref",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await W8({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.deleteTag",n}}async function Y8({fs:t,gitdir:e,oid:r}){let i=r.slice(0,2);return(await t.readdir(`${e}/objects/${i}`)).map(s=>`${i}${s}`).filter(s=>s.startsWith(r))}async function X8({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){let s=[],a=await t.readdir(O(r,"objects/pack"));a=a.filter(o=>o.endsWith(".idx"));for(let o of a){let l=`${r}/objects/pack/${o}`,c=await vv({fs:t,cache:e,filename:l,getExternalRefDelta:n});if(c.error)throw new he(c.error);for(let u of c.offsets.keys())u.startsWith(i)&&s.push(u)}return s}async function Z8({fs:t,cache:e,gitdir:r,oid:i}){let n=o=>Ke({fs:t,cache:e,gitdir:r,oid:o}),s=await Y8({fs:t,gitdir:r,oid:i}),a=await X8({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n});for(let o of a)s.indexOf(o)===-1&&s.push(o);if(s.length===1)return s[0];throw s.length>1?new qc("oids",i,s):new He(`an object matching "${i}"`)}async function Pk({fs:t,dir:e,gitdir:
Line truncated
|
||||||
|
`,d+=m.conflict.a.join(""),d+=`${"=".repeat(f)}
|
||||||
|
`,d+=m.conflict.b.join(""),d+=`${">".repeat(f)} ${i}
|
||||||
|
`);return{cleanMerge:h,mergedText:d}}async function Q8({fs:t,cache:e,dir:r,gitdir:i=O(r,".git"),index:n,ourOid:s,baseOid:a,theirOid:o,ourName:l="ours",baseName:c="base",theirName:u="theirs",dryRun:f=!1,abortOnConflict:d=!0,mergeDriver:h}){let m=Zr({ref:s}),g=Zr({ref:a}),v=Zr({ref:o}),w=[],b=[],k=[],x=[],E=await Fs({fs:t,cache:e,dir:r,gitdir:i,trees:[m,g,v],map:async function(A,[y,S,_]){let T=Sd(A),P=await Cd(y,S),D=await Cd(_,S);switch(`${P}-${D}`){case"false-false":return{mode:await S.mode(),path:T,oid:await S.oid(),type:await S.type()};case"false-true":return!_&&await y.type()==="tree"?{mode:await y.mode(),path:T,oid:await y.oid(),type:await y.type()}:_?{mode:await _.mode(),path:T,oid:await _.oid(),type:await _.type()}:void 0;case"true-false":return!y&&await _.type()==="tree"?{mode:await _.mode(),path:T,oid:await _.oid(),type:await _.type()}:y?{mode:await y.mode(),path:T,oid:await y.oid(),type:await y.type()}:void 0;case"true-true":{if(y&&_&&await y.type()==="tree"&&await _.type()==="tree")return{mode:await y.mode(),path:T,oid:await y.oid(),type:"tree"};if(y&&_&&await y.type()==="blob"&&await _.type()==="blob")return J8({fs:t,gitdir:i,path:T,ours:y,base:S,theirs:_,ourName:l,baseName:c,theirName:u,mergeDriver:h}).then(async B=>{if(B.cleanMerge)d||n.insert({filepath:A,oid:B.mergeResult.oid,stage:0});else if(w.push(A),b.push(A),!d){let N="";S&&await S.type()==="blob"&&(N=await S.oid());let ce=await y.oid(),Pe=await _.oid();n.delete({filepath:A}),N&&n.insert({filepath:A,oid:N,stage:1}),n.insert({filepath:A,oid:ce,stage:2}),n.insert({filepath:A,oid:Pe,stage:3})}return B.mergeResult});if(S&&!y&&_&&await S.type()==="blob"&&await _.type()==="blob"){if(w.push(A),k.push(A),!d){let B=await S.oid(),N=await _.oid();n.delete({filepath:A}),n.insert({filepath:A,oid:B,stage:1}),n.insert({filepath:A,oid:N,stage:3})}return{mode:await _.mode(),oid:await _.oid(),type:"blob",path:T}}if(S&&y&&!_&&await S.type()==="blob"&&await y.type()==="blob"){if(w.push(A),x.push(A),!d){let B=await S.oid(),N=await y.oid();n.delete({filepath:A}),n.insert({filepath:A,oid:B,stage:1}),n.insert({filepath:A,oid:N,stage:2})}return{mode:await y.mode(),oid:await y.oid(),type:"blob",path:T}}if(S&&!y&&!_&&(await S.type()==="blob"||await S.type()==="tree"))return;throw new Yo}}},reduce:w.length!==0&&(!r||d)?void 0:async(A,y)=>{let S=y.filter(Boolean);if(A&&!(A&&A.type==="tree"&&S.length===0&&A.path!==".")){if(S.length>0||A.path==="."&&S.length===0){let T=new Er(S).toObject(),P=await Ar({fs:t,gitdir:i,type:"tree",object:T,dryRun:f});A.oid=P}return A}}});return w.length!==0?(r&&!d&&await Fs({fs:t,cache:e,dir:r,gitdir:i,trees:[Zr({ref:E.oid})],map:async function(A,[y]){let S=`${r}/${A}`;if(await y.type()==="blob"){let _=await y.mode(),T=new TextDecoder().decode(await y.content());await t.write(S,T,{mode:_})}return!0}}),new Xo(w,b,k,x)):E.oid}async function J8({fs:t,gitdir:e,path:r,ours:i,base:n,theirs:s,ourName:a,theirName:o,baseName:l,dryRun:c,mergeDriver:u=K8}){let f="blob",d="100755",h="",m="";n&&await n.type()==="blob"&&(d=await n.mode(),h=await n.oid(),m=Buffer.from(await n.content()).toString("utf8"));let g=d===await i.mode()?await s.mode():await i.mode();if(await i.oid()===await s.oid())return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await i.oid(),type:f}};if(await i.oid()===h)return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await s.oid(),type:f}};if(await s.oid()===h)return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await i.oid(),type:f}};let v=Buffer.from(await i.content()).toString("utf8"),w=Buffer.from(await s.content()).toString("utf8"),{mergedText:b,cleanMerge:k}=await u({branches:[l,a,o],contents:[m,v,w],path:r}),x=await Ar({fs:t,gitdir:e,type:"blob",object:Buffer.from(b,"utf8"),dryRun:c});return{cleanMerge:k,mergeResult:{mode:g,path:r,oid:x,type:f}}}async function $k({fs:t,cache:e,dir:r,gitdir:i,ours:n,theirs:s,fastForward:a=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:d,committer:h,signingKey:m,onSign:g,mergeDriver:v,allowUnrelatedHistories:w=!1}){n===void 0&&(n=await Ds({fs:t,gitdir:i,fullname:!0})),n=await W.expand({fs:t,gitdir:i,ref:n}),s=await W.expand({fs:t,gitdir:i,ref:s});let b=await W.resolve({fs:t,gitdir:i,ref:n}),k=await W.resolve({fs:t,gitdir:i,ref:s}),x=await _v({fs:t,cache:e,gitdir:i,oids:[b,k]});if(x.length!==1)if(x.length===0&&w)x.push("4b825dc642cb6eb9a060e54bf8d69288fbee4904");else throw new Yo;let E=x[0];if(E===k)return{oid:b,alreadyMerged:!0};if(a&&E===b)return!l&&!c&&await W.writeRef({fs:t,gitdir:i,ref:n,value:k}),{oid:k,fastForward:!0};{if(o)throw new Yc;let A=await mt.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async S=>Q8({fs:t,cache:e,dir:r,gitdir:i,index:S,ourOid:b,theirOid:k,baseOid:E,ourName:_a(n),baseName:"base",theirName:_a(s),dryRun:l,abortOnConflict:u,mergeDriver:v}));if(A instanceof Xo)throw A;return f||(f=`Merge branch '${_a(s)}' into ${_a(n)}`),{oid:await Od({fs:t,cache:e,gitdir:i,message:f,ref:n,tree:A,parent:[b,k],author:d,committer:h,signingK
Line truncated
|
||||||
|
`)),i.push(at.encode(`agent=${Md.agent}
|
||||||
|
`)),(r||e||t)&&i.push(at.delim()),r&&i.push(at.encode("peel")),e&&i.push(at.encode("symrefs")),t&&i.push(at.encode(`ref-prefix ${t}`)),i.push(at.flush()),i}async function tA({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:s,headers:a={},forPush:o=!1,protocolVersion:l=2,prefix:c,symrefs:u,peelTags:f}){try{C("http",t),C("url",s);let d=await tl.discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,headers:a,protocolVersion:l});if(d.protocolVersion===1)return Uk(d,c,u,f);let h=await o6({prefix:c,symrefs:u,peelTags:f}),m=await tl.connect({http:t,auth:d.auth,headers:a,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,body:h});return a6(m.body)}catch(d){throw d.caller="git.listServerRefs",d}}async function rA({fs:t,dir:e,gitdir:r=O(e,".git")}){try{C("fs",t),C("gitdir",r);let i=new J(t),n=await ee({fsp:i,dotgit:r});return W.listTags({fs:i,gitdir:n})}catch(i){throw i.caller="git.listTags",i}}function l6(t,e){return t.committer.timestamp-e.committer.timestamp}var c6="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function zE({fs:t,cache:e,gitdir:r,oid:i,fileId:n}){if(n===c6)return;let s=i,a,o=await Qo({fs:t,cache:e,gitdir:r,oid:i}),l=o.tree;return n===o.oid?a=o.path:(a=await iA({fs:t,cache:e,gitdir:r,tree:l,fileId:n,oid:s}),Array.isArray(a)&&(a.length===0?a=void 0:a.length===1&&(a=a[0]))),a}async function iA({fs:t,cache:e,gitdir:r,tree:i,fileId:n,oid:s,filepaths:a=[],parentPath:o=""}){let l=i.entries().map(function(c){let u;return c.oid===n?(u=O(o,c.path),a.push(u)):c.type==="tree"&&(u=Ke({fs:t,cache:e,gitdir:r,oid:c.oid}).then(function({object:f}){return iA({fs:t,cache:e,gitdir:r,tree:Er.from(f),fileId:n,oid:s,filepaths:a,parentPath:O(o,c.path)})})),u});return await Promise.all(l),a}async function u6({fs:t,cache:e,gitdir:r,filepath:i,ref:n,depth:s,since:a,force:o,follow:l}){let c=typeof a=="undefined"?void 0:Math.floor(a.valueOf()/1e3),u=[],f=await Ea.read({fs:t,gitdir:r}),d=await W.resolve({fs:t,gitdir:r,ref:n}),h=[await el({fs:t,cache:e,gitdir:r,oid:d})],m,g,v;function w(b){v&&i&&u.push(b)}for(;h.length>0;){let b=h.pop();if(c!==void 0&&b.commit.committer.timestamp<=c)break;if(i){let k;try{k=await su({fs:t,cache:e,gitdir:r,oid:b.commit.tree,filepath:i}),g&&m!==k&&u.push(g),m=k,g=b,v=!0}catch(x){if(x instanceof He){let E=l&&m;if(E&&(E=await zE({fs:t,cache:e,gitdir:r,oid:b.commit.tree,fileId:m}),E))if(Array.isArray(E)){if(g){let A=await zE({fs:t,cache:e,gitdir:r,oid:g.commit.tree,fileId:m});if(Array.isArray(A))if(E=E.filter(y=>A.indexOf(y)===-1),E.length===1)E=E[0],i=E,g&&u.push(g);else{E=!1,g&&u.push(g);break}}}else i=E,g&&u.push(g);if(!E){if(v&&m&&(u.push(g),!o))break;if(!o&&!l)throw x}g=b,v=!1}else throw x}}else u.push(b);if(s!==void 0&&u.length===s){w(b);break}if(!f.has(b.oid))for(let k of b.commit.parent){let x=await el({fs:t,cache:e,gitdir:r,oid:k});h.map(E=>E.oid).includes(x.oid)||h.push(x)}h.length===0&&w(b),h.sort((k,x)=>l6(k.commit,x.commit))}return u}async function nA({fs:t,dir:e,gitdir:r=O(e,".git"),filepath:i,ref:n="HEAD",depth:s,since:a,force:o,follow:l,cache:c={}}){try{C("fs",t),C("gitdir",r),C("ref",n);let u=new J(t),f=await ee({fsp:u,dotgit:r});return await u6({fs:u,cache:c,gitdir:f,filepath:i,ref:n,depth:s,since:a,force:o,follow:l})}catch(u){throw u.caller="git.log",u}}async function sA({fs:t,onSign:e,dir:r,gitdir:i=O(r,".git"),ours:n,theirs:s,fastForward:a=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:d,committer:h,signingKey:m,cache:g={},mergeDriver:v,allowUnrelatedHistories:w=!1}){try{C("fs",t),m&&C("onSign",e);let b=new J(t),k=await ee({fsp:b,dotgit:i}),x=await Os({fs:b,gitdir:k,author:d});if(!x&&(!o||!a))throw new Jt("author");let E=await Jo({fs:b,gitdir:k,author:x,committer:h});if(!E&&(!o||!a))throw new Jt("committer");return await $k({fs:b,cache:g,dir:r,gitdir:k,ours:n,theirs:s,fastForward:a,fastForwardOnly:o,dryRun:l,noUpdateBranch:c,abortOnConflict:u,message:f,author:x,committer:E,signingKey:m,onSign:e,mergeDriver:v,allowUnrelatedHistories:w})}catch(b){throw b.caller="git.merge",b}}var f6={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function aA({fs:t,cache:e,dir:r,gitdir:i=O(r,".git"),oids:n}){let s=new WE,a=[];function o(u,f){let d=Buffer.from(u,f);a.push(d),s.update(d)}async function l({stype:u,object:f}){let d=f6[u],h=f.length,m=h>15?128:0,g=h&15;h=h>>>4;let v=(m|d|g).toString(16);for(o(v,"hex");m;)m=h>127?128:0,v=m|h&127,o(mv(2,v),"hex"),h=h>>>7;o(Buffer.from(await sk(f)))}o("PACK"),o("00000002","hex"),o(mv(8,n.length),"hex");for(let u of n){let{type:f,object:d}=await Ke({fs:t,cache:e,gitdir:i,oid:u});await l({write:o,object:d,stype:f})}let c=s.digest();return a.push(c),a}async function d6({fs:t,cache:e,gitdir:r,oids:i,write:n}){let s=await aA({fs:t,cache:e,gitdir:r,oids:i}),a=Buffer.from(await Pd(s)),l=`pack-${a.slice(-20).toString("hex")}.pack`;return n?(await t.write(O(r,`objects/pack/${l}`),a),{filename:l}):{fil
Line truncated
|
||||||
|
`),n=await i();let s=r.toString("utf8").split(`
|
||||||
|
`);if(n=s.shift(),!n.startsWith("unpack "))throw new Sa('unpack ok" or "unpack [error message]',n);e.ok=n==="unpack ok",e.ok||(e.error=n.slice(7)),e.refs={};for(let a of s){if(a.trim()==="")continue;let o=a.slice(0,2),l=a.slice(3),c=l.indexOf(" ");c===-1&&(c=l.length);let u=l.slice(0,c),f=l.slice(c+1);e.refs[u]={ok:o==="ok",error:f}}return e}async function m6({capabilities:t=[],triplets:e=[]}){let r=[],i=`\0 ${t.join(" ")}`;for(let n of e)r.push(at.encode(`${n.oldoid} ${n.oid} ${n.fullRef}${i}
|
||||||
|
`)),i="";return r.push(at.flush()),r}async function g6({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,onPrePush:l,gitdir:c,ref:u,remoteRef:f,remote:d,url:h,force:m=!1,delete:g=!1,corsProxy:v,headers:w={}}){let b=u||await Ds({fs:t,gitdir:c});if(typeof b=="undefined")throw new Sr("ref");let k=await ct.get({fs:t,gitdir:c});d=d||await k.get(`branch.${b}.pushRemote`)||await k.get("remote.pushDefault")||await k.get(`branch.${b}.remote`)||"origin";let x=h||await k.get(`remote.${d}.pushurl`)||await k.get(`remote.${d}.url`);if(typeof x=="undefined")throw new Sr("remote OR url");let E=f||await k.get(`branch.${b}.merge`);if(typeof x=="undefined")throw new Sr("remoteRef");v===void 0&&(v=await k.get("http.corsProxy"));let A=await W.expand({fs:t,gitdir:c,ref:b}),y=g?"0000000000000000000000000000000000000000":await W.resolve({fs:t,gitdir:c,ref:A}),S=rl.getRemoteHelperFor({url:x}),_=await S.discover({http:r,onAuth:s,onAuthSuccess:a,onAuthFailure:o,corsProxy:v,service:"git-receive-pack",url:x,headers:w,protocolVersion:1}),T=_.auth,P;if(!E)P=A;else try{P=await W.expandAgainstMap({ref:E,map:_.refs})}catch(Q){if(Q instanceof He)P=E.startsWith("refs/")?E:`refs/heads/${E}`;else throw Q}let D=_.refs.get(P)||"0000000000000000000000000000000000000000";if(l&&!await l({remote:d,url:x,localRef:{ref:g?"(delete)":A,oid:y},remoteRef:{ref:P,oid:D}}))throw new Ko;let B=!_.capabilities.has("no-thin"),N=new Set;if(!g){let Q=[..._.refs.values()],j=new Set;if(D!=="0000000000000000000000000000000000000000"){let Le=await _v({fs:t,cache:e,gitdir:c,oids:[y,D]});for(let lr of Le)Q.push(lr);B&&(j=await rv({fs:t,cache:e,gitdir:c,oids:Le}))}if(!Q.includes(y)){let Le=await h6({fs:t,cache:e,gitdir:c,start:[y],finish:Q});N=await rv({fs:t,cache:e,gitdir:c,oids:Le})}if(B){try{let Le=await W.resolve({fs:t,gitdir:c,ref:`refs/remotes/${d}/HEAD`,depth:2}),{oid:lr}=await W.resolveAgainstMap({ref:Le.replace(`refs/remotes/${d}/`,""),fullref:Le,map:_.refs}),It=[lr];for(let Fe of await rv({fs:t,cache:e,gitdir:c,oids:It}))j.add(Fe)}catch(Le){}for(let Le of j)N.delete(Le)}if(y===D&&(m=!0),!m){if(A.startsWith("refs/tags")&&D!=="0000000000000000000000000000000000000000")throw new Zo("tag-exists");if(y!=="0000000000000000000000000000000000000000"&&D!=="0000000000000000000000000000000000000000"&&!await Vk({fs:t,cache:e,gitdir:c,oid:y,ancestor:D,depth:-1}))throw new Zo("not-fast-forward")}}let ce=yk([..._.capabilities],["report-status","side-band-64k",`agent=${Md.agent}`]),Pe=await m6({capabilities:ce,triplets:[{oldoid:D,oid:y,fullRef:P}]}),ve=g?[]:await aA({fs:t,cache:e,gitdir:c,oids:[...N]}),se=await S.connect({http:r,onProgress:i,corsProxy:v,service:"git-receive-pack",url:x,auth:T,headers:w,body:[...Pe,...ve]}),{packfile:xe,progress:we}=await Rd.demux(se.body);if(n){let Q=bk(we);ou(Q,async j=>{await n(j)})}let z=await p6(xe);if(se.headers&&(z.headers=se.headers),d&&z.ok&&z.refs[P].ok&&!A.startsWith("refs/tags")){let Q=`refs/remotes/${d}/${P.replace("refs/heads","")}`;g?await W.deleteRef({fs:t,gitdir:c,ref:Q}):await W.writeRef({fs:t,gitdir:c,ref:Q,value:y})}if(z.ok&&Object.values(z.refs).every(Q=>Q.ok))return z;{let Q=Object.entries(z.refs).filter(([j,Le])=>!Le.ok).map(([j,Le])=>`
|
||||||
|
- ${j}: ${Le.error}`).join("");throw new Xc(Q,z)}}async function cA({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPrePush:o,dir:l,gitdir:c=O(l,".git"),ref:u,remoteRef:f,remote:d="origin",url:h,force:m=!1,delete:g=!1,corsProxy:v,headers:w={},cache:b={}}){try{C("fs",t),C("http",e),C("gitdir",c);let k=new J(t),x=await ee({fsp:k,dotgit:c});return await g6({fs:k,cache:b,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPrePush:o,gitdir:x,ref:u,remoteRef:f,remote:d,url:h,force:m,delete:g,corsProxy:v,headers:w})}catch(k){throw k.caller="git.push",k}}async function uA({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:s}=await Ke({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=Kr.from(s).parse().object,uA({fs:t,cache:e,gitdir:r,oid:i});if(n!=="blob")throw new hr(i,n,"blob");return{oid:i,blob:new Uint8Array(s)}}async function fA({fs:t,cache:e,gitdir:r,oid:i,filepath:n=void 0}){return n!==void 0&&(i=await su({fs:t,cache:e,gitdir:r,oid:i,filepath:n})),await uA({fs:t,cache:e,gitdir:r,oid:i})}async function dA({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,filepath:n,cache:s={}}){try{C("fs",t),C("gitdir",r),C("oid",i);let a=new J(t),o=await ee({fsp:a,dotgit:r});return await fA({fs:a,cache:s,gitdir:o,oid:i,filepath:n})}catch(a){throw a.caller="git.readBlob",a}}async function xv({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,cache:n={}}){try{C("fs",t),C("gitdir",r),C("oid",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await el({fs:s,cache:n,gitdir:a,oid:i})}catch(s){throw s.caller="git.readCommit",s}}async function v6({fs:t,cache:e,gitdir:r,ref:i="refs/notes/commits",oid:n}){let s=await W.resolve({gitdir:r,fs:t,ref:i}),{blob:a}=await fA({fs:t,cache:e,gitdir:r,oid:s,filepath:n});return a}async function hA({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i="refs/notes/commits",oid:n,cache:s={}}){try{C("fs",t),C("gitdir",r),C("ref",i),C("oid",n);let a=new J(t),o=await ee({fsp:a,dotgit:r});return await v6({fs:a,cache:s,gitdir:o,ref:i,oid:n})}catch(a){throw a.caller="git.readNote",a}}async function pA({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,format:n="parsed",filepath:s=void 0,encoding:a=void 0,cache:o={}}){try{C("fs",t),C("gitdir",r),C("oid",i);let l=new J(t),c=await ee({fsp:l,dotgit:r});s!==void 0&&(i=await su({fs:l,cache:o,gitdir:c,oid:i,filepath:s}));let f=await Ke({fs:l,cache:o,gitdir:c,oid:i,format:n==="parsed"?"content":n});if(f.oid=i,n==="parsed")switch(f.format="parsed",f.type){case"commit":f.object=kr.from(f.object).parse();break;case"tree":f.object=Er.from(f.object).entries();break;case"blob":a?f.object=f.object.toString(a):(f.object=new Uint8Array(f.object),f.format="content");break;case"tag":f.object=Kr.from(f.object).parse();break;default:throw new hr(f.oid,f.type,"blob|commit|tag|tree")}else(f.format==="deflated"||f.format==="wrapped")&&(f.type=f.format);return f}catch(l){throw l.caller="git.readObject",l}}async function w6({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:s}=await Ke({fs:t,cache:e,gitdir:r,oid:i,format:"content"});if(n!=="tag")throw new hr(i,n,"tag");let a=Kr.from(s);return{oid:i,tag:a.parse(),payload:a.payload()}}async function mA({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,cache:n={}}){try{C("fs",t),C("gitdir",r),C("oid",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await w6({fs:s,cache:n,gitdir:a,oid:i})}catch(s){throw s.caller="git.readTag",s}}async function gA({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,filepath:n=void 0,cache:s={}}){try{C("fs",t),C("gitdir",r),C("oid",i);let a=new J(t),o=await ee({fsp:a,dotgit:r});return await sl({fs:a,cache:s,gitdir:o,oid:i,filepath:n})}catch(a){throw a.caller="git.readTree",a}}async function vA({fs:t,dir:e,gitdir:r=O(e,".git"),filepath:i,cache:n={}}){try{C("fs",t),C("gitdir",r),C("filepath",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});await mt.acquire({fs:s,gitdir:a,cache:n},async function(o){o.delete({filepath:i})})}catch(s){throw s.caller="git.remove",s}}async function y6({fs:t,cache:e,onSign:r,gitdir:i,ref:n="refs/notes/commits",oid:s,author:a,committer:o,signingKey:l}){let c;try{c=await W.resolve({gitdir:i,fs:t,ref:n})}catch(m){if(!(m instanceof He))throw m}let f=(await sl({fs:t,cache:e,gitdir:i,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;f=f.filter(m=>m.path!==s);let d=await au({fs:t,gitdir:i,tree:f});return await Od({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:d,parent:c&&[c],message:`Note removed by 'isomorphic-git removeNote'
|
||||||
|
`,author:a,committer:o,signingKey:l})}async function wA({fs:t,onSign:e,dir:r,gitdir:i=O(r,".git"),ref:n="refs/notes/commits",oid:s,author:a,committer:o,signingKey:l,cache:c={}}){try{C("fs",t),C("gitdir",i),C("oid",s);let u=new J(t),f=await ee({fsp:u,dotgit:i}),d=await Os({fs:u,gitdir:f,author:a});if(!d)throw new Jt("author");let h=await Jo({fs:u,gitdir:f,author:d,committer:o});if(!h)throw new Jt("committer");return await y6({fs:u,cache:c,onSign:e,gitdir:f,ref:n,oid:s,author:d,committer:h,signingKey:l})}catch(u){throw u.caller="git.removeNote",u}}async function b6({fs:t,gitdir:e,oldref:r,ref:i,checkout:n=!1}){if(!nu(i,!0))throw new Fi(i,Hc.clean(i));if(!nu(r,!0))throw new Fi(r,Hc.clean(r));let s=`refs/heads/${r}`,a=`refs/heads/${i}`;if(await W.exists({fs:t,gitdir:e,ref:a}))throw new $i("branch",i,!1);let l=await W.resolve({fs:t,gitdir:e,ref:s,depth:1});await W.writeRef({fs:t,gitdir:e,ref:a,value:l}),await W.deleteRef({fs:t,gitdir:e,ref:s});let u=await Ds({fs:t,gitdir:e,fullname:!0})===s;(n||u)&&await W.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:a})}async function yA({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i,oldref:n,checkout:s=!1}){try{C("fs",t),C("gitdir",r),C("ref",i),C("oldref",n);let a=new J(t),o=await ee({fsp:a,dotgit:r});return await b6({fs:a,gitdir:o,ref:i,oldref:n,checkout:s})}catch(a){throw a.caller="git.renameBranch",a}}async function bA({gitdir:t,type:e,object:r}){return qn(Rs.wrap({type:e,object:r}))}async function _A({fs:t,dir:e,gitdir:r=O(e,".git"),filepath:i,ref:n,cache:s={}}){try{C("fs",t),C("gitdir",r),C("filepath",i);let a=new J(t),o=await ee({fsp:a,dotgit:r}),l,c;try{l=await W.resolve({fs:a,gitdir:o,ref:n||"HEAD"})}catch(d){if(n)throw d}if(l)try{l=await su({fs:a,cache:s,gitdir:o,oid:l,filepath:i})}catch(d){l=null}let u={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},f=e&&await a.read(O(e,i));f&&(c=await bA({gitdir:o,type:"blob",object:f}),l===c&&(u=await a.lstat(O(e,i)))),await mt.acquire({fs:a,gitdir:o,cache:s},async function(d){d.delete({filepath:i}),l&&d.insert({filepath:i,stats:u,oid:l})})}catch(a){throw a.caller="git.reset",a}}async function xA({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i,depth:n}){try{C("fs",t),C("gitdir",r),C("ref",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await W.resolve({fs:s,gitdir:a,ref:i,depth:n})}catch(s){throw s.caller="git.resolveRef",s}}async function SA({fs:t,dir:e,gitdir:r=O(e,".git"),path:i,value:n,append:s=!1}){try{C("fs",t),C("gitdir",r),C("path",i);let a=new J(t),o=await ee({fsp:a,dotgit:r}),l=await ct.get({fs:a,gitdir:o});s?await l.append(i,n):await l.set(i,n),await ct.save({fs:a,gitdir:o,config:l})}catch(a){throw a.caller="git.setConfig",a}}async function EA({fs:t,gitdir:e,commit:r}){let i=kr.from(r).toObject();return await Ar({fs:t,gitdir:e,type:"commit",object:i,format:"content"})}var $d=class t{static get timezoneOffsetForRefLogEntry(){let e=new Date().getTimezoneOffset(),r=Math.abs(Math.floor(e/60)),i=Math.abs(e%60).toString().padStart(2,"0");return`${e>0?"-":"+"}${r.toString().padStart(2,"0")}${i}`}static createStashReflogEntry(e,r,i){let n=e.name.replace(/\s/g,""),s="0000000000000000000000000000000000000000",a=Math.floor(Date.now()/1e3),o=t.timezoneOffsetForRefLogEntry;return`${s} ${r} ${n} ${e.email} ${a} ${o} ${i}
|
||||||
|
`}static getStashReflogEntry(e,r=!1){return e.split(`
|
||||||
|
`).filter(s=>s).reverse().map((s,a)=>r?`stash@{${a}}: ${s.split(" ")[1]}`:s)}},_6={stage:Aa,workdir:nl},iv;async function il(t,e){return iv===void 0&&(iv=new Nc),iv.acquire(t,e)}async function x6(t,e,r,i,n=null){let s=O(r,i),a=await t.lstat(s);if(!a)throw new He(s);if(a.isDirectory())throw new he(`${s}: file expected, but found directory`);let o=n?await JE({fs:t,gitdir:e,oid:n}):void 0,l=o?n:void 0;return o||await il({fs:t,gitdir:e,currentFilepath:s},async()=>{let c=a.isSymbolicLink()?await t.readlink(s).then(ak):await t.read(s);if(c===null)throw new He(s);l=await Ar({fs:t,gitdir:e,type:"blob",object:c})}),l}async function S6({fs:t,dir:e,gitdir:r,entries:i}){async function n(s){if(s.type==="tree"){if(!s.oid){let a=await Promise.all(s.children.map(n));s.oid=await au({fs:t,gitdir:r,tree:a}),s.mode=16384}}else s.type==="blob"&&(s.oid=await x6(t,r,e,s.path,s.oid),s.mode=33188);return s.path=s.path.split("/").pop(),s}return Promise.all(i.map(n))}async function VE({fs:t,dir:e,gitdir:r,treePair:i}){let n=i[1]==="stage",s=i.map(h=>typeof h=="string"?_6[h]():h),a=[],u=await Fs({fs:t,cache:{},dir:e,gitdir:r,trees:s,map:async(h,[m,g])=>{if(!(h==="."||await Is.isIgnored({fs:t,dir:e,gitdir:r,filepath:h}))&&g)return(!m||await m.oid()!==await g.oid()&&await g.oid()!==void 0)&&a.push([m,g]),{mode:await g.mode(),path:h,oid:await g.oid(),type:await g.type()}},reduce:async(h,m)=>(m=m.filter(Boolean),h?(h.children=m,h):m.length>0?m:void 0),iterate:async(h,m)=>{let g=[];for(let v of m){let[w,b]=v;n?b&&(await t.exists(`${e}/${b.toString()}`)?g.push(v):a.push([null,b])):w&&(b?g.push(v):a.push([w,null]))}return g.length?Promise.all(g.map(h)):[]}});if(a.length===0||u.length===0)return null;let d=(await S6({fs:t,dir:e,gitdir:r,entries:u})).filter(Boolean).map(h=>({mode:h.mode,path:h.path,oid:h.oid,type:h.type}));return au({fs:t,gitdir:r,tree:d})}async function E6({fs:t,dir:e,gitdir:r,stashCommit:i,parentCommit:n,wasStaged:s}){let a=[],o=[],l=await Fs({fs:t,cache:{},dir:e,gitdir:r,trees:[Zr({ref:n}),Zr({ref:i})],map:async(c,[u,f])=>{if(c==="."||await Is.isIgnored({fs:t,dir:e,gitdir:r,filepath:c}))return;let d=f?await f.type():await u.type();if(d!=="tree"&&d!=="blob")return;if(!f&&u){let m=d==="tree"?"rmdir":"rm";return d==="tree"&&a.push(c),d==="blob"&&s&&o.push({filepath:c,oid:await u.oid()}),{method:m,filepath:c}}let h=await f.oid();if(!u||await u.oid()!==h)return d==="tree"?{method:"mkdir",filepath:c}:(s&&o.push({filepath:c,oid:h,stats:await t.lstat(O(e,c))}),{method:"write",filepath:c,oid:h})}});await il({fs:t,gitdir:r,dirRemoved:a,ops:l},async()=>{for(let c of l){let u=O(e,c.filepath);switch(c.method){case"rmdir":await t.rmdir(u);break;case"mkdir":await t.mkdir(u);break;case"rm":await t.rm(u);break;case"write":if(!a.some(f=>u.startsWith(f))){let{object:f}=await Ke({fs:t,cache:{},gitdir:r,oid:c.oid});await t.exists(u)&&await t.rm(u),await t.write(u,f)}break}}}),await mt.acquire({fs:t,gitdir:r,cache:{}},async c=>{o.forEach(({filepath:u,stats:f,oid:d})=>{c.insert({filepath:u,stats:f,oid:d})})})}var ka=class t{constructor({fs:e,dir:r,gitdir:i=O(r,".git")}){Object.assign(this,{fs:e,dir:r,gitdir:i,_author:null})}static get refStash(){return"refs/stash"}static get refLogsStash(){return"logs/refs/stash"}get refStashPath(){return O(this.gitdir,t.refStash)}get refLogsStashPath(){return O(this.gitdir,t.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await Os({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new Jt("author");return this._author}async getStashSHA(e,r){return await this.fs.exists(this.refStashPath)?(r||await this.readStashReflogs({parsed:!1}))[e].split(" ")[1]:null}async writeStashCommit({message:e,tree:r,parent:i}){return EA({fs:this.fs,gitdir:this.gitdir,commit:{message:e,tree:r,parent:i,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(e){let r=await this.readStashReflogs({parsed:!1});if(e!==0&&(e<0||e>r.length-1))throw new Fi(`stash@${e}`,"number that is in range of [0, num of stash pushed]");let i=await this.getStashSHA(e,r);return i?el({fs:this.fs,cache:{},gitdir:this.gitdir,oid:i}):{}}async writeStashRef(e){return W.writeRef({fs:this.fs,gitdir:this.gitdir,ref:t.refStash,value:e})}async writeStashReflogEntry({stashCommit:e,message:r}){let i=await this.getAuthor(),n=$d.createStashReflogEntry(i,e,r),s=this.refLogsStashPath;await il({filepath:s,entry:n},async()=>{let a=await this.fs.exists(s)?await this.fs.read(s,"utf8"):"";await this.fs.write(s,a+n,"utf8")})}async readStashReflogs({parsed:e=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];let r=await this.fs.read(this.refLogsStashPath,"utf8");return $d.getStashReflogEntry(r,e)}};async function kA({fs:t,dir:e,gitdir:r,message:i=""}){let n=new ka({fs:t,dir:e,gitdir:r});await n.getAuthor();let s=await Ds({fs:t,gitdir:r,fullname:!1}),a=await W.resolve({fs:t,gitdir:r,ref:"HEAD"}),l=(await xv({fs:t,dir:e,gitdir:r,oid:a})).commit.message,c=[a],u=null,f=Zr({ref:"HEAD"}),d=await VE({fs:t,dir:e,gitdir
Line truncated
|
||||||
|
`)+`
|
||||||
|
`,"utf8");let c=o[o.length-1].split(" ")[1];await n.writeStashRef(c)}else await t.rm(l)})}async function T6({fs:t,dir:e,gitdir:r}){return new ka({fs:t,dir:e,gitdir:r}).readStashReflogs({parsed:!0})}async function C6({fs:t,dir:e,gitdir:r}){let i=new ka({fs:t,dir:e,gitdir:r}),n=[i.refStashPath,i.refLogsStashPath];await il(n,async()=>{await Promise.all(n.map(async s=>{if(await t.exists(s))return t.rm(s)}))})}async function P6({fs:t,dir:e,gitdir:r,refIdx:i=0}){await AA({fs:t,dir:e,gitdir:r,refIdx:i}),await TA({fs:t,dir:e,gitdir:r,refIdx:i})}async function CA({fs:t,dir:e,gitdir:r=O(e,".git"),op:i="push",message:n="",refIdx:s=0}){C("fs",t),C("dir",e),C("gitdir",r),C("op",i);let a={push:k6,apply:AA,drop:TA,list:T6,clear:C6,pop:P6,create:A6},o=["apply","drop","pop"];try{let l=new J(t),c=await ee({fsp:l,dotgit:r});["refs","logs","logs/refs"].map(d=>O(c,d)).forEach(async d=>{await l.exists(d)||await l.mkdir(d)});let f=a[i];if(f){if(o.includes(i)&&s<0)throw new Fi(`stash@${s}`,"number that is in range of [0, num of stash pushed]");return await f({fs:l,dir:e,gitdir:c,message:n,refIdx:s})}throw new Error(`To be implemented: ${i}`)}catch(l){throw l.caller="git.stash",l}}async function PA({fs:t,dir:e,gitdir:r=O(e,".git"),filepath:i,cache:n={}}){try{C("fs",t),C("gitdir",r),C("filepath",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});if(await Is.isIgnored({fs:s,gitdir:a,dir:e,filepath:i}))return"ignored";let l=await R6({fs:s,cache:n,gitdir:a}),c=await RA({fs:s,cache:n,gitdir:a,tree:l,path:i}),u=await mt.acquire({fs:s,gitdir:a,cache:n},async function(v){for(let w of v)if(w.path===i)return w;return null}),f=await s.lstat(O(e,i)),d=c!==null,h=u!==null,m=f!==null,g=async()=>{if(h&&!xd(u,f))return u.oid;{let v=await s.read(O(e,i)),w=await bA({gitdir:a,type:"blob",object:v});return h&&u.oid===w&&f.size!==-1&&mt.acquire({fs:s,gitdir:a,cache:n},async function(b){b.insert({filepath:i,stats:f,oid:w})}),w}};if(!d&&!m&&!h)return"absent";if(!d&&!m&&h)return"*absent";if(!d&&m&&!h)return"*added";if(!d&&m&&h)return await g()===u.oid?"added":"*added";if(d&&!m&&!h)return"deleted";if(d&&!m&&h)return c===u.oid,"*deleted";if(d&&m&&!h)return await g()===c?"*undeleted":"*undeletemodified";if(d&&m&&h){let v=await g();return v===c?v===u.oid?"unmodified":"*unmodified":v===u.oid?"modified":"*modified"}}catch(s){throw s.caller="git.status",s}}async function RA({fs:t,cache:e,gitdir:r,tree:i,path:n}){typeof n=="string"&&(n=n.split("/"));let s=n.shift();for(let a of i)if(a.path===s){if(n.length===0)return a.oid;let{type:o,object:l}=await Ke({fs:t,cache:e,gitdir:r,oid:a.oid});if(o==="tree"){let c=Er.from(l);return RA({fs:t,cache:e,gitdir:r,tree:c,path:n})}if(o==="blob")throw new hr(a.oid,o,"blob",n.join("/"))}return null}async function R6({fs:t,cache:e,gitdir:r}){let i;try{i=await W.resolve({fs:t,gitdir:r,ref:"HEAD"})}catch(s){if(s instanceof He)return[]}let{tree:n}=await sl({fs:t,cache:e,gitdir:r,oid:i});return n}async function $A({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i="HEAD",filepaths:n=["."],filter:s,cache:a={},ignored:o=!1}){try{C("fs",t),C("gitdir",r),C("ref",i);let l=new J(t),c=await ee({fsp:l,dotgit:r});return await Fs({fs:l,cache:a,dir:e,gitdir:c,trees:[Zr({ref:i}),nl(),Aa()],map:async function(u,[f,d,h]){if(!f&&!h&&d&&!o&&await Is.isIgnored({fs:l,dir:e,filepath:u})||!n.some(y=>vk(u,y)))return null;if(s&&!s(u))return;let[m,g,v]=await Promise.all([f&&f.type(),d&&d.type(),h&&h.type()]),w=[m,g,v].includes("blob");if((m==="tree"||m==="special")&&!w)return;if(m==="commit")return null;if((g==="tree"||g==="special")&&!w)return;if(v==="commit")return null;if((v==="tree"||v==="special")&&!w)return;let b=m==="blob"?await f.oid():void 0,k=v==="blob"?await h.oid():void 0,x;m!=="blob"&&g==="blob"&&v!=="blob"?x="42":g==="blob"&&(x=await d.oid());let E=[void 0,b,x,k],A=E.map(y=>E.indexOf(y));return A.shift(),[u,...A]}})}catch(l){throw l.caller="git.statusMatrix",l}}async function FA({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i,object:n,force:s=!1}){try{C("fs",t),C("gitdir",r),C("ref",i);let a=new J(t);if(i===void 0)throw new Sr("ref");i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`;let o=await ee({fsp:a,dotgit:r}),l=await W.resolve({fs:a,gitdir:o,ref:n||"HEAD"});if(!s&&await W.exists({fs:a,gitdir:o,ref:i}))throw new $i("tag",i);await W.writeRef({fs:a,gitdir:o,ref:i,value:l})}catch(a){throw a.caller="git.tag",a}}async function IA({fs:t,dir:e,gitdir:r=O(e,".git"),cache:i={},filepath:n,oid:s,mode:a,add:o,remove:l,force:c}){try{C("fs",t),C("gitdir",r),C("filepath",n);let u=new J(t),f=await ee({fsp:u,dotgit:r});if(l)return await mt.acquire({fs:u,gitdir:f,cache:i},async function(h){if(!c){let m=await u.lstat(O(e,n));if(m){if(m.isDirectory())throw new $s("directory");return}}h.has({filepath:n})&&h.delete({filepath:n})});let d;if(!s){if(d=await u.lstat(O(e,n)),!d)throw new He(`file at "${n}" on disk and "remove" not set`);if(d.isDirectory())throw new $s("directory")}return await mt.acquire({fs:u,gitdir:f,cache:i},async function(h){if(!o&&!h.has({filepath:n}))throw new He(`filLine truncated
|
||||||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z6(t,e){if(t){if(typeof t=="string")return nT(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nT(t,e)}}function nT(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function V6(t,e){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(t)))){var r=[],i=!0,n=!1,s=void 0;try{for(var a=t[Symbol.iterator](),o;!(i=(o=a.next()).done)&&(r.push(o.value),!(e&&r.length===e));i=!0);}catch(l){n=!0,s=l}finally{try{!i&&a.return!=null&&a.return()}finally{if(n)throw s}}return r}}function W6(t){if(Array.isArray(t))return t}var aT=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?$/,oT=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])?$/,lT=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,cT=/^rgba?\(\s*(\d+)\s+(\d+)\s+(\d+)(?:\s*\/\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,uT=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,fT=/^rgba?\(\s*(\d+%)\s+(\d+%)\s+(\d+%)(?:\s*\/\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,dT=/^hsla?\(\s*(\d+)(deg|rad|grad|turn)?\s*,\s*(\d+)%\s*,\s*(\d+)%(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/;function uu(t,e){return t.indexOf(e)>-1}function Y6(t,e,r){var i=t/255,n=e/255,s=r/255,a=Math.max(i,n,s),o=Math.min(i,n,s),l=a-o,c=(a+o)/2;if(l===0)return[0,0,c*100];var u=l/(1-Math.abs(2*c-1)),f=function(){switch(a){case i:return(n-s)/l%6;case n:return(s-i)/l+2;default:return(i-n)/l+4}}();return[f*60,u*100,c*100]}function X6(t,e,r){var i=t/60,n=e/100,s=r/100,a=(1-Math.abs(2*s-1))*n,o=a*(1-Math.abs(i%2-1)),l=s-a/2,c=function(){return i<1?[a,o,0]:i<2?[o,a,0]:i<3?[0,a,o]:i<4?[0,o,a]:i<5?[o,0,a]:[a,0,o]}(),u=pr(c,3),f=u[0],d=u[1],h=u[2];return[(f+l)*255,(d+l)*255,(h+l)*255]}var Z6=function(){function t(e){var r=pr(e,4),i=r[0],n=r[1],s=r[2],a=r[3];G6(this,t),this.values=[Math.max(Math.min(parseInt(i,10),255),0),Math.max(Math.min(parseInt(n,10),255),0),Math.max(Math.min(parseInt(s,10),255),0),a==null?1:Math.max(Math.min(parseFloat(a),255),0)]}return j6(t,[{key:"toRgbString",value:function(){var r=pr(this.values,4),i=r[0],n=r[1],s=r[2],a=r[3];return a===1?"rgb(".concat(i,", ").concat(n,", ").concat(s,")"):"rgba(".concat(i,", ").concat(n,", ").concat(s,", ").concat(a,")")}},{key:"toHslString",value:function(){var r=this.toHslaArray(),i=pr(r,4),n=i[0],s=i[1],a=i[2],o=i[3];return o===1?"hsl(".concat(n,", ").concat(s,"%, ").concat(a,"%)"):"hsla(".concat(n,", ").concat(s,"%, ").concat(a,"%, ").concat(o,")")}},{key:"toHexString",value:function(){var r=pr(this.values,4),i=r[0],n=r[1],s=r[2],a=r[3];return i=Number(i).toString(16).padStart(2,"0"),n=Number(n).toString(16).padStart(2,"0"),s=Number(s).toString(16).padStart(2,"0"),a=a<1?parseInt(a*255,10).toString(16).padStart(2,"0"):"","#".concat(i).concat(n).concat(s).concat(a)}},{key:"toRgbaArray",value:function(){return this.values}},{key:"toHslaArray",value:function(){var r=pr(this.values,4),i=r[0],n=r[1],s=r[2],a=r[3],o=Y6(i,n,s),l=pr(o,3),c=l[0],u=l[1],f=l[2];return[c,u,f,a]}}]),t}();function ul(t){var e=pr(t,4),r=e[0],i=e[1],n=e[2],s=e[3];return new Z6([r,i,n,s])}function Bv(t){var e=pr(t,3),r=e[0],i=e[1],n=e[2];return ul([r,i,n,1])}function zd(t){var e=pr(t,4),r=e[0],i=e[1],n=e[2],s=e[3],a=X6(r,i,n),o=pr(a,3),l=o[0],c=o[1],u=o[2];return ul([l,c,u,s])}function hT(t){var e=pr(t,3),r=e[0],i=e[1],n=e[2];return zd([r,i,n,1])}function K6(t){var e=aT.exec(t)||oT.exec(t),r=pr(e,5),i=r[1],n=r[2],s=r[3],a=r[4];return i=parseInt(i.length<2?i.repeat(2):i,16),n=parseInt(n.length<2?n.repeat(2):n,16),s=parseInt(s.length<2?s.repeat(2):s,16),a=a&&(parseInt(a.length<2?a.repeat(2):a,16)/255).toPrecision(1)||1,ul([i,n,s,a])}function Q6(t){var e=lT.exec(t)||uT.exec(t)||cT.exec(t)||fT.exec(t),r=pr(e,5),i=r[1],n=r[2],s=r[3],a=r[4];return i=uu(i,"%")?parseInt(i,10)*255/100:parseInt(i,10),n=uu(n,"%")?parseInt(n,10)*255/100:parseInt(n,10),s=uu(s,"%")>0?parseInt(s,10)*255/100:parseInt(s,10),a=a===void 0?1:parseFloat(a)/(uu(a,"%")?100:1),ul([i,n,s,a])}function J6(t){var e=dT.exec(t),r=pr(e,6),i=r[1],n=r[2],s=r[3],a=r[4],o=r[5];return n=n||"deg",i=(0,U6.default)(parseFloat(i),n,"deg"),s=parseFloat(s),a=parseFloat(a),o=o===void 0?1:parseFloat(o)/(uu(o,"%")?100:1),zd([i,s,a,o])}function pT(t){return rT.default[t]?Bv(rT.default[t]):aT.test(t)||oT.test(t)?K6(t):lT.test(t)||uT.test(t)||cT.test(t)||fT.test(t)?Q6(t):dT.test(t)?J6(t):null}var e5={fromString:pT,fromRgb:Bv,fromRgba:ul,fromHsl:hT,fromHsla:zd};Vn.default=e5});var Nv=F((WZ,vT)=>{"use strict";p();var gT=Object.prototype.toString;vT.exports=function(e){var r=gT.call(e),i=r==="[object Arguments]";return i||(i=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&gT.call(e.callee)==="[object Function]"),i}});var AT=F((XZ,kT)=>{"
Line truncated
|
||||||
|
`)>=0)return!1;return!0}function w4(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=fn.call(Array(t.indent+1)," ");else return null;return{base:r,prev:fn.call(Array(e+1),r)}}function nw(t,e){if(t.length===0)return"";var r=`
|
||||||
|
`+e.prev+e.base;return r+fn.call(t,","+r)+`
|
||||||
|
`+e.prev}function Kd(t,e){var r=iw(t),i=[];if(r){i.length=t.length;for(var n=0;n<t.length;n++)i[n]=Wn(t,n)?e(t[n],t):""}var s=typeof Qv=="function"?Qv(t):[],a;if(fl){a={};for(var o=0;o<s.length;o++)a["$"+s[o]]=s[o]}for(var l in t)Wn(t,l)&&(r&&String(Number(l))===l&&l<t.length||fl&&a["$"+l]instanceof Symbol||(SC.call(/[^\w$]/,l)?i.push(e(l,t)+": "+e(t[l],t)):i.push(l+": "+e(t[l],t))));if(typeof Qv=="function")for(var c=0;c<s.length;c++)EC.call(t,s[c])&&i.push("["+e(s[c])+"]: "+e(t[s[c]],t));return i}});var FC=F((RK,$C)=>{"use strict";p();var y4=yu(),b4=_r(),eh=function(t,e,r){for(var i=t,n;(n=i.next)!=null;i=n)if(n.key===e)return i.next=n.next,r||(n.next=t.next,t.next=n),n},_4=function(t,e){if(t){var r=eh(t,e);return r&&r.value}},x4=function(t,e,r){var i=eh(t,e);i?i.value=r:t.next={key:e,next:t.next,value:r}},S4=function(t,e){return t?!!eh(t,e):!1},E4=function(t,e){if(t)return eh(t,e,!0)};$C.exports=function(){var e,r={assert:function(i){if(!r.has(i))throw new b4("Side channel does not contain "+y4(i))},delete:function(i){var n=e&&e.next,s=E4(e,i);return s&&n&&n===s&&(e=void 0),!!s},get:function(i){return _4(e,i)},has:function(i){return S4(e,i)},set:function(i,n){e||(e={next:void 0}),x4(e,i,n)}};return r}});var lw=F((FK,OC)=>{"use strict";p();var k4=tn(),bu=Bt(),A4=yu(),T4=_r(),IC=k4("%Map%",!0),C4=bu("Map.prototype.get",!0),P4=bu("Map.prototype.set",!0),R4=bu("Map.prototype.has",!0),$4=bu("Map.prototype.delete",!0),F4=bu("Map.prototype.size",!0);OC.exports=!!IC&&function(){var e,r={assert:function(i){if(!r.has(i))throw new T4("Side channel does not contain "+A4(i))},delete:function(i){if(e){var n=$4(e,i);return F4(e)===0&&(e=void 0),n}return!1},get:function(i){if(e)return C4(e,i)},has:function(i){return e?R4(e,i):!1},set:function(i,n){e||(e=new IC),P4(e,i,n)}};return r}});var DC=F((OK,MC)=>{"use strict";p();var I4=tn(),rh=Bt(),O4=yu(),th=lw(),M4=_r(),dl=I4("%WeakMap%",!0),D4=rh("WeakMap.prototype.get",!0),L4=rh("WeakMap.prototype.set",!0),B4=rh("WeakMap.prototype.has",!0),N4=rh("WeakMap.prototype.delete",!0);MC.exports=dl?function(){var e,r,i={assert:function(n){if(!i.has(n))throw new M4("Side channel does not contain "+O4(n))},delete:function(n){if(dl&&n&&(typeof n=="object"||typeof n=="function")){if(e)return N4(e,n)}else if(th&&r)return r.delete(n);return!1},get:function(n){return dl&&n&&(typeof n=="object"||typeof n=="function")&&e?D4(e,n):r&&r.get(n)},has:function(n){return dl&&n&&(typeof n=="object"||typeof n=="function")&&e?B4(e,n):!!r&&r.has(n)},set:function(n,s){dl&&n&&(typeof n=="object"||typeof n=="function")?(e||(e=new dl),L4(e,n,s)):th&&(r||(r=th()),r.set(n,s))}};return i}:th});var cw=F((DK,LC)=>{"use strict";p();var H4=_r(),U4=yu(),G4=FC(),j4=lw(),q4=DC(),z4=q4||j4||G4;LC.exports=function(){var e,r={assert:function(i){if(!r.has(i))throw new H4("Side channel does not contain "+U4(i))},delete:function(i){return!!e&&e.delete(i)},get:function(i){return e&&e.get(i)},has:function(i){return!!e&&e.has(i)},set:function(i,n){e||(e=z4()),e.set(i,n)}};return r}});var NC=F((BK,BC)=>{"use strict";p();var V4=Gf(),_u=cw()(),Yn=_r(),uw={assert:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Yn("`O` is not an object");if(typeof e!="string")throw new Yn("`slot` must be a string");if(_u.assert(t),!uw.has(t,e))throw new Yn("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Yn("`O` is not an object");if(typeof e!="string")throw new Yn("`slot` must be a string");var r=_u.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Yn("`O` is not an object");if(typeof e!="string")throw new Yn("`slot` must be a string");var r=_u.get(t);return!!r&&V4(r,"$"+e)},set:function(t,e,r){if(!t||typeof t!="object"&&typeof t!="function")throw new Yn("`O` is not an object");if(typeof e!="string")throw new Yn("`slot` must be a string");var i=_u.get(t);i||(i={},_u.set(t,i)),i["$"+e]=r}};Object.freeze&&Object.freeze(uw);BC.exports=uw});var GC=F((HK,UC)=>{"use strict";p();var xu=NC(),W4=Of(),HC=typeof StopIteration=="object"?StopIteration:null;UC.exports=function(e){if(!HC)throw new W4("this environment lacks StopIteration");xu.set(e,"[[Done]]",!1);var r={next:function(){var n=xu.get(this,"[[Iterator]]"),s=!!xu.get(n,"[[Done]]");try{return{done:s,value:s?void 0:n.next()}}catch(a){if(xu.set(n,"[[Done]]",!0),a!==HC)throw a;return{done:!0,value:void 0}}}};return xu.set(r,"[[Iterator]]",e),r}});var fw=F((GK,qC)=>{"use strict";p();var jC=Bt(),Y4=jC("String.prototype.valueOf"),X4=function(e){try{return Y4(e),!0}catch(r){return!1}},Z4=jC("Object.prototype.toString"),K4="[object String]",Q4=bs()();qC.exports=function(e){return typeof e=="string"?!0:!e||typeof e!="object"?!1:Q4?X4(e):Z4(e)===K4}});var hw=F((qK,WC)=>{"use strict";p();var dw=typeof Map=="function"&&Map.prototype?Map:null,J4=typeof Set=="function"&&Set.prototype?Set:null,ih;dw||(ih=function(e){return!1});var VC=dw?Map.prototype.has:null,zC=J4?Set.prototyp
Line truncated
|
||||||
|
`});xe=!1,z=se.length}function Fe(At,Tt){var jt="="+j,Ze=At.indexOf(jt,Tt),q=c(At.substring(At.indexOf("=",Tt)+1,Ze)).split(" ");return Q=q[0],j=q[q.length-1],Ze+jt.length-1}for(_&&(_=_.split(" "),Q=_[0],j=_[1]),we=0;we<T;we++)N==P?u(Q,S,we)?(--we,Le(),N=D):S.charAt(we)==`
|
||||||
|
`?It(xe):ve+=S.charAt(we):N==D?(we+=Q.length-1,Pe=t.tags[S.charAt(we+1)],ce=Pe?S.charAt(we+1):"_v",ce=="="?(we=Fe(S,we),N=P):(Pe&&we++,N=B),xe=we):u(j,S,we)?(se.push({tag:ce,n:c(ve),otag:Q,ctag:j,i:ce=="/"?xe-Q.length:we+j.length}),ve="",we+=j.length-1,N=P,ce=="{"&&(j=="}}"?we++:l(se[se.length-1]))):ve+=S.charAt(we);return It(xe,!0),se};function l(y){y.n.substr(y.n.length-1)==="}"&&(y.n=y.n.substring(0,y.n.length-1))}function c(y){return y.trim?y.trim():y.replace(/^\s*|\s*$/g,"")}function u(y,S,_){if(S.charAt(_)!=y.charAt(0))return!1;for(var T=1,P=y.length;T<P;T++)if(S.charAt(_+T)!=y.charAt(T))return!1;return!0}var f={_t:!0,"\n":!0,$:!0,"/":!0};function d(y,S,_,T){var P=[],D=null,B=null,N=null;for(B=_[_.length-1];y.length>0;){if(N=y.shift(),B&&B.tag=="<"&&!(N.tag in f))throw new Error("Illegal content in < super tag.");if(t.tags[N.tag]<=t.tags.$||h(N,T))_.push(N),N.nodes=d(y,N.tag,_,T);else if(N.tag=="/"){if(_.length===0)throw new Error("Closing tag without opener: /"+N.n);if(D=_.pop(),N.n!=D.n&&!m(N.n,D.n,T))throw new Error("Nesting error: "+D.n+" vs. "+N.n);return D.end=N.i,P}else N.tag==`
|
||||||
|
`&&(N.last=y.length==0||y[0].tag==`
|
||||||
|
`);P.push(N)}if(_.length>0)throw new Error("missing closing tag: "+_.pop().n);return P}function h(y,S){for(var _=0,T=S.length;_<T;_++)if(S[_].o==y.n)return y.tag="#",!0}function m(y,S,_){for(var T=0,P=_.length;T<P;T++)if(_[T].c==y&&_[T].o==S)return!0}function g(y){var S=[];for(var _ in y)S.push('"'+b(_)+'": function(c,p,t,i) {'+y[_]+"}");return"{ "+S.join(",")+" }"}function v(y){var S=[];for(var _ in y.partials)S.push('"'+b(_)+'":{name:"'+b(y.partials[_].name)+'", '+v(y.partials[_])+"}");return"partials: {"+S.join(",")+"}, subs: "+g(y.subs)}t.stringify=function(y,S,_){return"{code: function (c,p,i) { "+t.wrapMain(y.code)+" },"+v(y)+"}"};var w=0;t.generate=function(y,S,_){w=0;var T={code:"",subs:{},partials:{}};return t.walk(y,T),_.asString?this.stringify(T,S,_):this.makeTemplate(T,S,_)},t.wrapMain=function(y){return'var t=this;t.b(i=i||"");'+y+"return t.fl();"},t.template=t.Template,t.makeTemplate=function(y,S,_){var T=this.makePartials(y);return T.code=new Function("c","p","i",this.wrapMain(y.code)),new this.template(T,S,this,_)},t.makePartials=function(y){var S,_={subs:{},partials:y.partials,name:y.name};for(S in _.partials)_.partials[S]=this.makePartials(_.partials[S]);for(S in y.subs)_.subs[S]=new Function("c","p","t","i",y.subs[S]);return _};function b(y){return y.replace(s,"\\\\").replace(r,'\\"').replace(i,"\\n").replace(n,"\\r").replace(a,"\\u2028").replace(o,"\\u2029")}function k(y){return~y.indexOf(".")?"d":"f"}function x(y,S){var _="<"+(S.prefix||""),T=_+y.n+w++;return S.partials[T]={name:y.n,partials:{}},S.code+='t.b(t.rp("'+b(T)+'",c,p,"'+(y.indent||"")+'"));',T}t.codegen={"#":function(y,S){S.code+="if(t.s(t."+k(y.n)+'("'+b(y.n)+'",c,p,1),c,p,0,'+y.i+","+y.end+',"'+y.otag+" "+y.ctag+'")){t.rs(c,p,function(c,p,t){',t.walk(y.nodes,S),S.code+="});c.pop();}"},"^":function(y,S){S.code+="if(!t.s(t."+k(y.n)+'("'+b(y.n)+'",c,p,1),c,p,1,0,0,"")){',t.walk(y.nodes,S),S.code+="};"},">":x,"<":function(y,S){var _={partials:{},code:"",subs:{},inPartial:!0};t.walk(y.nodes,_);var T=S.partials[x(y,S)];T.subs=_.subs,T.partials=_.partials},$:function(y,S){var _={subs:{},code:"",partials:S.partials,prefix:y.n};t.walk(y.nodes,_),S.subs[y.n]=_.code,S.inPartial||(S.code+='t.sub("'+b(y.n)+'",c,p,i);')},"\n":function(y,S){S.code+=A('"\\n"'+(y.last?"":" + i"))},_v:function(y,S){S.code+="t.b(t.v(t."+k(y.n)+'("'+b(y.n)+'",c,p,0)));'},_t:function(y,S){S.code+=A('"'+b(y.text)+'"')},"{":E,"&":E};function E(y,S){S.code+="t.b(t.t(t."+k(y.n)+'("'+b(y.n)+'",c,p,0)));'}function A(y){return"t.b("+y+");"}t.walk=function(y,S){for(var _,T=0,P=y.length;T<P;T++)_=t.codegen[y[T].tag],_&&_(y[T],S);return S},t.parse=function(y,S,_){return _=_||{},d(y,"",[],_.sectionTags||[])},t.cache={},t.cacheKey=function(y,S){return[y,!!S.asString,!!S.disableLambda,S.delimiters,!!S.modelGet].join("||")},t.compile=function(y,S){S=S||{};var _=t.cacheKey(y,S),T=this.cache[_];if(T){var P=T.partials;for(var D in P)delete P[D].instance;return T}return T=this.generate(this.parse(this.scan(y,S.delimiters),y,S),y,S),this.cache[_]=T}})(typeof wy!="undefined"?wy:Hogan)});var bO=F(yy=>{p();var GV={};(function(t){t.Template=function(d,h,m,g){d=d||{},this.r=d.code||this.r,this.c=m,this.options=g||{},this.text=h||"",this.partials=d.partials||{},this.subs=d.subs||{},this.buf=""},t.Template.prototype={r:function(d,h,m){return""},v:u,t:c,render:function(h,m,g){return this.ri([h],m||{},g)},ri:function(d,h,m){return this.r(d,h,m)},ep:function(d,h){var m=this.partials[d],g=h[m.name];if(m.instance&&m.base==g)return m.instance;if(typeof g=="string"){if(!this.c)throw new Error("No compiler available.");g=this.c.compile(g,this.options)}if(!g)return null;if(this.partials[d].base=g,m.subs){h.stackText||(h.stackText={});for(key in m.subs)h.stackText[key]||(h.stackText[key]=this.activeSub!==void 0&&h.stackText[this.activeSub]?h.stackText[this.activeSub]:this.text);g=r(g,m.subs,m.partials,this.stackSubs,this.stackPartials,h.stackText)}return this.partials[d].instance=g,g},rp:function(d,h,m,g){var v=this.ep(d,m);return v?v.ri(h,m,g):""},rs:function(d,h,m){var g=d[d.length-1];if(!f(g)){m(d,h,this);return}for(var v=0;v<g.length;v++)d.push(g[v]),m(d,h,this),d.pop()},s:function(d,h,m,g,v,w,b){var k;return f(d)&&d.length===0?!1:(typeof d=="function"&&(d=this.ms(d,h,m,g,v,w,b)),k=!!d,!g&&k&&h&&h.push(typeof d=="object"?d:h[h.length-1]),k)},d:function(d,h,m,g){var v,w=d.split("."),b=this.f(w[0],h,m,g),k=this.options.modelGet,x=null;if(d==="."&&f(h[h.length-2]))b=h[h.length-1];else for(var E=1;E<w.length;E++)v=e(w[E],b,k),v!==void 0?(x=b,b=v):b="";return g&&!b?!1:(!g&&typeof b=="function"&&(h.push(x),b=this.mv(b,h,m),h.pop()),b)},f:function(d,h,m,g){for(var v=!1,w=null,b=!1,k=this.options.modelGet,x=h.length-1;x>=0;x--)if(w=h[x],v=e(d,w,k),v!==void 0){b=!0;break}return b?(!g&&typeof v=="function"&&(v=this.mv(v,h,m)),v):g?!1:""},ls:function(d,h,m,g,v,w){var b=this.options.delimiters;return this.options.delimiters=w,this.b(this.ct(c(d.call(h,v,m)),h,g)),this.options.delimiters=b,!1},ct:functio
Line truncated
|
||||||
|
|
||||||
|
PROMPT="$1"
|
||||||
|
TEMP_FILE="$OBSIDIAN_GIT_CREDENTIALS_INPUT"
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
rm -f "$TEMP_FILE" "$TEMP_FILE.response"
|
||||||
|
}
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
echo "$PROMPT" > "$TEMP_FILE"
|
||||||
|
|
||||||
|
while [ ! -e "$TEMP_FILE.response" ]; do
|
||||||
|
if [ ! -e "$TEMP_FILE" ]; then
|
||||||
|
echo "Trigger file got removed: Abort" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sleep 0.1
|
||||||
|
done
|
||||||
|
|
||||||
|
RESPONSE=$(cat "$TEMP_FILE.response")
|
||||||
|
|
||||||
|
echo "$RESPONSE"
|
||||||
|
`,qA=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"];p();p();p();var un=class{diff(e,r,i={}){let n;typeof i=="function"?(n=i,i={}):"callback"in i&&(n=i.callback);let s=this.castInput(e,i),a=this.castInput(r,i),o=this.removeEmpty(this.tokenize(s,i)),l=this.removeEmpty(this.tokenize(a,i));return this.diffWithOptionsObj(o,l,i,n)}diffWithOptionsObj(e,r,i,n){var s;let a=b=>{if(b=this.postProcess(b,i),n){setTimeout(function(){n(b)},0);return}else return b},o=r.length,l=e.length,c=1,u=o+l;i.maxEditLength!=null&&(u=Math.min(u,i.maxEditLength));let f=(s=i.timeout)!==null&&s!==void 0?s:1/0,d=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],m=this.extractCommon(h[0],r,e,0,i);if(h[0].oldPos+1>=l&&m+1>=o)return a(this.buildValues(h[0].lastComponent,r,e));let g=-1/0,v=1/0,w=()=>{for(let b=Math.max(g,-c);b<=Math.min(v,c);b+=2){let k,x=h[b-1],E=h[b+1];x&&(h[b-1]=void 0);let A=!1;if(E){let S=E.oldPos-b;A=E&&0<=S&&S<o}let y=x&&x.oldPos+1<l;if(!A&&!y){h[b]=void 0;continue}if(!y||A&&x.oldPos<E.oldPos?k=this.addToPath(E,!0,!1,0,i):k=this.addToPath(x,!1,!0,1,i),m=this.extractCommon(k,r,e,b,i),k.oldPos+1>=l&&m+1>=o)return a(this.buildValues(k.lastComponent,r,e))||!0;h[b]=k,k.oldPos+1>=l&&(v=Math.min(v,b-1)),m+1>=o&&(g=Math.max(g,b+1))}c++};if(n)(function b(){setTimeout(function(){if(c>u||Date.now()>d)return n(void 0);w()||b()},0)})();else for(;c<=u&&Date.now()<=d;){let b=w();if(b)return b}}addToPath(e,r,i,n,s){let a=e.lastComponent;return a&&!s.oneChangePerToken&&a.added===r&&a.removed===i?{oldPos:e.oldPos+n,lastComponent:{count:a.count+1,added:r,removed:i,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:r,removed:i,previousComponent:a}}}extractCommon(e,r,i,n,s){let a=r.length,o=i.length,l=e.oldPos,c=l-n,u=0;for(;c+1<a&&l+1<o&&this.equals(i[l+1],r[c+1],s);)c++,l++,u++,s.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return u&&!s.oneChangePerToken&&(e.lastComponent={count:u,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=l,c}equals(e,r,i){return i.comparator?i.comparator(e,r):e===r||!!i.ignoreCase&&e.toLowerCase()===r.toLowerCase()}removeEmpty(e){let r=[];for(let i=0;i<e.length;i++)e[i]&&r.push(e[i]);return r}castInput(e,r){return e}tokenize(e,r){return Array.from(e)}join(e){return e.join("")}postProcess(e,r){return e}get useLongestToken(){return!1}buildValues(e,r,i){let n=[],s;for(;e;)n.push(e),s=e.previousComponent,delete e.previousComponent,e=s;n.reverse();let a=n.length,o=0,l=0,c=0;for(;o<a;o++){let u=n[o];if(u.removed)u.value=this.join(i.slice(c,c+u.count)),c+=u.count;else{if(!u.added&&this.useLongestToken){let f=r.slice(l,l+u.count);f=f.map(function(d,h){let m=i[c+h];return m.length>d.length?m:d}),u.value=this.join(f)}else u.value=this.join(r.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return n}};p();var Av=class extends un{},zA=new Av;function Tv(t,e,r){return zA.diff(t,e,r)}p();p();function Cv(t,e){let r;for(r=0;r<t.length&&r<e.length;r++)if(t[r]!=e[r])return t.slice(0,r);return t.slice(0,r)}function Pv(t,e){let r;if(!t||!e||t[t.length-1]!=e[e.length-1])return"";for(r=0;r<t.length&&r<e.length;r++)if(t[t.length-(r+1)]!=e[e.length-(r+1)])return t.slice(-r);return t.slice(-r)}function Ud(t,e,r){if(t.slice(0,e.length)!=e)throw Error(`string ${JSON.stringify(t)} doesn't start with prefix ${JSON.stringify(e)}; this is
Line truncated
|
||||||
|
`))&&(e=e.trim()),(!i.newlineIsToken||!r.includes(`
|
||||||
|
`))&&(r=r.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(e.endsWith(`
|
||||||
|
`)&&(e=e.slice(0,-1)),r.endsWith(`
|
||||||
|
`)&&(r=r.slice(0,-1))),super.equals(e,r,i)}},D6=new Ov;function Mv(t,e,r){return D6.diff(t,e,r)}function L6(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
|
||||||
|
`));let r=[],i=t.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let n=0;n<i.length;n++){let s=i[n];n%2&&!e.newlineIsToken?r[r.length-1]+=s:r.push(s)}return r}p();var YA={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function Dv(t,e,r,i,n,s,a){let o;a?typeof a=="function"?o={callback:a}:o=a:o={},typeof o.context=="undefined"&&(o.context=4);let l=o.context;if(o.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(o.callback){let{callback:u}=o;Mv(r,i,Object.assign(Object.assign({},o),{callback:f=>{let d=c(f);u(d)}}))}else return c(Mv(r,i,o));function c(u){if(!u)return;u.push({value:"",lines:[]});function f(b){return b.map(function(k){return" "+k})}let d=[],h=0,m=0,g=[],v=1,w=1;for(let b=0;b<u.length;b++){let k=u[b],x=k.lines||B6(k.value);if(k.lines=x,k.added||k.removed){if(!h){let E=u[b-1];h=v,m=w,E&&(g=l>0?f(E.lines.slice(-l)):[],h-=g.length,m-=g.length)}for(let E of x)g.push((k.added?"+":"-")+E);k.added?w+=x.length:v+=x.length}else{if(h)if(x.length<=l*2&&b<u.length-2)for(let E of f(x))g.push(E);else{let E=Math.min(x.length,l);for(let y of f(x.slice(0,E)))g.push(y);let A={oldStart:h,oldLines:v-h+E,newStart:m,newLines:w-m+E,lines:g};d.push(A),h=0,m=0,g=[]}v+=x.length,w+=x.length}}for(let b of d)for(let k=0;k<b.lines.length;k++)b.lines[k].endsWith(`
|
||||||
|
`)?b.lines[k]=b.lines[k].slice(0,-1):(b.lines.splice(k+1,0,"\\ No newline at end of file"),k++);return{oldFileName:t,newFileName:e,oldHeader:n,newHeader:s,hunks:d}}}function qd(t,e){if(e||(e=YA),Array.isArray(t)){if(t.length>1&&!e.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return t.map(i=>qd(i,e)).join(`
|
||||||
|
`)}let r=[];e.includeIndex&&t.oldFileName==t.newFileName&&r.push("Index: "+t.oldFileName),e.includeUnderline&&r.push("==================================================================="),e.includeFileHeaders&&(r.push("--- "+t.oldFileName+(typeof t.oldHeader=="undefined"?"":" "+t.oldHeader)),r.push("+++ "+t.newFileName+(typeof t.newHeader=="undefined"?"":" "+t.newHeader)));for(let i=0;i<t.hunks.length;i++){let n=t.hunks[i];n.oldLines===0&&(n.oldStart-=1),n.newLines===0&&(n.newStart-=1),r.push("@@ -"+n.oldStart+","+n.oldLines+" +"+n.newStart+","+n.newLines+" @@");for(let s of n.lines)r.push(s)}return r.join(`
|
||||||
|
`)+`
|
||||||
|
`}function XA(t,e,r,i,n,s,a){if(typeof a=="function"&&(a={callback:a}),a!=null&&a.callback){let{callback:o}=a;Dv(t,e,r,i,n,s,Object.assign(Object.assign({},a),{callback:l=>{o(l?qd(l,a.headerOptions):void 0)}}))}else{let o=Dv(t,e,r,i,n,s,a);return o?qd(o,a==null?void 0:a.headerOptions):void 0}}function cu(t,e,r,i,n,s){return XA(t,t,e,r,i,n,s)}function B6(t){let e=t.endsWith(`
|
||||||
|
`),r=t.split(`
|
||||||
|
`).map(i=>i+`
|
||||||
|
`);return e?r.pop():r.push(r.pop().slice(0,-1)),r}var re=Mt(Sv()),Pa=require("obsidian");p();function ZA(t,e){let r=Object.assign({},t.lineAuthor,e.lineAuthor);return Object.assign({},t,e,{lineAuthor:r})}var cl=class extends Error{constructor(r){super("No network connection available");this.originalError=r}};p();var KA=require("obsidian"),H6={options:[],placeholder:"",allowEmpty:!1,onlySelection:!1,initialValue:void 0,obscure:!1},Qe=class extends KA.SuggestModal{constructor(e,r){if(super(e.app),this.config={...H6,...r},this.setPlaceholder(this.config.placeholder),this.config.obscure){this.inputEl.type="password";let i=this.containerEl.querySelector(".prompt-input-container");i.addClass("git-obscure-prompt"),i.setAttr("git-is-obscured","true");let n=i==null?void 0:i.createDiv({cls:"search-input-clear-button"});n.style.marginRight="32px",n.id="git-show-password",n.addEventListener("click",()=>{i.getAttr("git-is-obscured")==="true"?(this.inputEl.type="text",i.setAttr("git-is-obscured","false")):(this.inputEl.type="password",i.setAttr("git-is-obscured","true"))})}}openAndGetResult(){return new Promise(e=>{this.resolve=e,this.open(),this.config.initialValue!=null&&(this.inputEl.value=this.config.initialValue,this.inputEl.dispatchEvent(new Event("input")))})}onClose(){new Promise(e=>setTimeout(e,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(e){return this.config.onlySelection?this.config.options:this.config.allowEmpty?[e.length>0?e:" ",...this.config.options]:[e.length>0?e:"...",...this.config.options]}renderSuggestion(e,r){this.config.obscure?r.hide():r.setText(e)}onChooseSuggestion(e,r){if(this.resolve){let i;this.config.allowEmpty&&e===" "?i="":e==="..."?i=void 0:i=e,this.resolve(i)}}};p();var MP=Mt(mT()),DP=require("child_process"),LP=Mt(OP()),Xn=require("obsidian");function wh(t){throw new Error(`Unexpected object: ${t}`)}function Su(t,e,r){return t===1?`${t} ${e}`:`${t} ${r!=null?r:e+"s"}`}var Gw=(t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e);function Mi(t,e){let r;if(e){if(e.button===0||e.button===1){let i=Xn.Keymap.isModEvent(e);r=t.workspace.getLeaf(i)}}else r=t.workspace.getLeaf(!1);return r}function hn(t,e,r,i,n){if(e.button==2){let s=t.vault.getAbstractFileByPath(r);if(s!=null){let a=new Xn.Menu;t.workspace.trigger("file-menu",a,s,n,i),a.showAtPosition({x:e.pageX,y:e.pageY})}else{let a=new Xn.Menu;t.workspace.trigger("obsidian-git:menu",a,r,n,i),a.showAtPosition({x:e.pageX,y:e.pageY})}}}function Gs(t){throw new Error("Impossible branch: "+t)}function jw(t){return`rgb(${t.r},${t.g},${t.b})`}function BP(t){var s;let e=(s=MP.fromString(t))==null?void 0:s.toRgbaArray();if(e===void 0)return;let[r,i,n]=e;return{r,g:i,b:n}}function NP(t){return t.diff(Xn.moment.unix(0),"seconds")}function HP(t){if(t.length!==0)return t.slice().sort()[Math.floor(t.length/2)]}function UP(t,e){return(0,LP.default)(t,e,{strict:!0})}function Eu(t,e){return new Proxy(t,{get(r,i){return i==="length"?Math.min(e,r.length):r[i]}})}function GP(t,e,r){return t.length<=e?new Array(e-t.length).fill(r).join("")+t:t.substring(t.length-e)}function jP(t,e){if(e<=0)return t;let r=new Array(e).fill(" ").join(""),i=t.substring(e,t.length);return r+i}function qw(t,e,r){return t<=e&&e<=r}function Zn(t){let[e,...r]=t.split("/");return[e,r.length===0?void 0:r.join("/")]}function pn(t){return t.endsWith("/")?t:t.split("/").last().replace(/\.md$/,"")}function qP(t){return t===1?"1 minute":`${t} minutes`}function nG(t){let e=t.lastIndexOf(".");return t.substring(e+1)}function pl(t){if(t.endsWith(".md"))return!1;let e=nG(t);return qA.includes(e)}function zw(t){return(t.startsWith("https://github.com/")||t.startsWith("https://gitlab.com/"))&&(t.endsWith(".git")||(t=t+".git")),t}function ml(t,e){let r=e.vault.getAbstractFileByPath(t);if(!(r instanceof Xn.TFile))return!1;try{return!!e.viewRegistry.getTypeByExtension(r.extension)}catch(i){return!0}}function zP({isFolder:t,gitRelativePath:e}){let r="/";return r+=e,t&&(r+="/"),r.replace(/([\\!#*?[\]])/g,String.raw`\$1`).replace(/\s(?=\s*$)/g,String.raw`\ `)}function gl(t,e,r,i){let n=e.target;t.workspace.trigger("hover-link",{event:e,source:r.getViewType(),hoverParent:r,targetEl:n,linktext:i})}function ku(t,e,r={}){return new Promise((i,n)=>{let s=(0,DP.spawn)(t,e,r),a="",o="";s.stdout.on("data",l=>{a+=l.toString()}),s.stderr.on("data",l=>{o+=l.toString()}),s.on("error",l=>{i({error:new Error(l.message),stdout:a,stderr:a,code:1})}),s.on("close",l=>{i({stdout:a,stderr:o,code:l!=null?l:1,error:void 0})})})}p();var VP=require("os"),yh=require("obsidian"),vl=class{constructor(e){this.plugin=e,this.app=e.app}getRelativeVaultPath(e){return this.plugin.settings.basePath?this.plugin.settings.basePath+"/"+e:e}getRelativeRepoPath(e,r=!0){return r&&this.plugin.settings.basePath.length>0?e.substring(this.plugin.settings.basePath.length+1):e}unload(){}_getTreeStructure(e,r=0){let i=[];for(e=[...e];e.length>0;){let n=e.first(),s=n.path.substring(r)
Line truncated
|
||||||
|
`):n="Too many files to list",e=e+`
|
||||||
|
|
||||||
|
Affected files:
|
||||||
|
`+n}return e}};p();var js=require("obsidian"),bh=class{constructor(e,r){this.plugin=r;this.promises={};this.adapter=e.adapter,this.vault=e,this.lastBasePath=this.plugin.settings.basePath,this.promises.readFile=this.readFile.bind(this),this.promises.writeFile=this.writeFile.bind(this),this.promises.readdir=this.readdir.bind(this),this.promises.mkdir=this.mkdir.bind(this),this.promises.rmdir=this.rmdir.bind(this),this.promises.stat=this.stat.bind(this),this.promises.unlink=this.unlink.bind(this),this.promises.lstat=this.lstat.bind(this),this.promises.readlink=this.readlink.bind(this),this.promises.symlink=this.symlink.bind(this)}async readFile(e,r){var i;if(this.maybeLog("Read: "+e+JSON.stringify(r)),r=="utf8"||r.encoding=="utf8"){let n=this.vault.getAbstractFileByPath(e);return n instanceof js.TFile?(this.maybeLog("Reuse"),this.vault.read(n)):this.adapter.read(e)}else{if(e.endsWith(this.gitDir+"/index"))return this.plugin.settings.basePath!=this.lastBasePath?(this.clearIndex(),this.lastBasePath=this.plugin.settings.basePath,this.adapter.readBinary(e)):(i=this.index)!=null?i:this.adapter.readBinary(e);let n=this.vault.getAbstractFileByPath(e);return n instanceof js.TFile?(this.maybeLog("Reuse"),this.vault.readBinary(n)):this.adapter.readBinary(e)}}async writeFile(e,r){if(this.maybeLog("Write: "+e),typeof r=="string"){let i=this.vault.getAbstractFileByPath(e);return i instanceof js.TFile?this.vault.modify(i,r):this.adapter.write(e,r)}else if(e.endsWith(this.gitDir+"/index"))this.index=r,this.indexmtime=Date.now();else{let i=this.vault.getAbstractFileByPath(e);return i instanceof js.TFile?this.vault.modifyBinary(i,r):this.adapter.writeBinary(e,r)}}async readdir(e){e==="."&&(e="/");let r=await this.adapter.list(e),i=[...r.files,...r.folders],n;return e!=="/"?n=i.map(s=>(0,js.normalizePath)(s.substring(e.length))):n=i,n}async mkdir(e){return this.adapter.mkdir(e)}async rmdir(e,r){var i,n;return this.adapter.rmdir(e,(n=(i=r==null?void 0:r.options)==null?void 0:i.recursive)!=null?n:!1)}async stat(e){if(e.endsWith(this.gitDir+"/index")){if(this.index!==void 0&&this.indexctime!=null&&this.indexmtime!=null)return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,size:this.index.byteLength,type:"file",ctimeMs:this.indexctime,mtimeMs:this.indexmtime};{let i=await this.adapter.stat(e);if(i==null)throw{code:"ENOENT"};return this.indexctime=i.ctime,this.indexmtime=i.mtime,{ctimeMs:i.ctime,mtimeMs:i.mtime,size:i.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1}}}e==="."&&(e="/");let r=this.vault.getAbstractFileByPath(e);if(this.maybeLog("Stat: "+e),r instanceof js.TFile)return this.maybeLog("Reuse stat"),{ctimeMs:r.stat.ctime,mtimeMs:r.stat.mtime,size:r.stat.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1};{let i=await this.adapter.stat(e);if(i)return{ctimeMs:i.ctime,mtimeMs:i.mtime,size:i.size,type:i.type==="folder"?"directory":i.type,isFile:()=>i.type==="file",isDirectory:()=>i.type==="folder",isSymbolicLink:()=>!1};throw{code:"ENOENT"}}}async unlink(e){return this.adapter.remove(e)}async lstat(e){return this.stat(e)}async readlink(e){throw new Error(`readlink of (${e}) is not implemented.`)}async symlink(e){throw new Error(`symlink of (${e}) is not implemented.`)}async saveAndClear(){this.index!==void 0&&await this.adapter.writeBinary(this.plugin.gitManager.getRelativeVaultPath(this.gitDir+"/index"),this.index,{ctime:this.indexctime,mtime:this.indexmtime}),this.clearIndex()}clearIndex(){this.index=void 0,this.indexctime=void 0,this.indexmtime=void 0}get gitDir(){return this.plugin.settings.gitDir||".git"}maybeLog(e){}};var QP=Mt(KP()),Di=class extends vl{constructor(r){super(r);this.FILE=0;this.HEAD=1;this.WORKDIR=2;this.STAGE=3;this.status_mapping={"000":" ","003":"AD","020":"??","022":"A ","023":"AM",100:"D ",101:" D",103:"MD",110:"DA",111:" ",113:"MM",120:"DA",121:" M",122:"M ",123:"MM"};this.noticeLength=999999;this.fs=new bh(this.app.vault,this.plugin)}getRepo(){return{fs:this.fs,dir:this.plugin.settings.basePath,gitdir:this.plugin.settings.gitDir||void 0,onAuth:()=>{var r,i;return{username:(r=this.plugin.localStorage.getUsername())!=null?r:void 0,password:(i=this.plugin.localStorage.getPassword())!=null?i:void 0}},onAuthFailure:async()=>{new Pa.Notice("Authentication failed. Please try with different credentials");let r=await new Qe(this.plugin,{placeholder:"Specify your username"}).openAndGetResult();if(r){let i=await new Qe(this.plugin,{placeholder:"Specify your password/personal access token",obscure:!0}).openAndGetResult();if(i)return this.plugin.localStorage.setUsername(r),this.plugin.localStorage.setPassword(i),{username:r,password:i}}return{cancel:!0}},http:{async request({url:r,method:i,headers:n,body:s}){let a;s&&(a=await lG(s));let o=await(0,Pa.requestUrl)({url:r,method:i,headers:n,body:a,throw:!1});return{url:r,method:i,headers:o.headers,body:oG(o.arrayBuffer),statusCode:o.status,statusMessage:o.status.toString()}}}}}async wrapFS(r){try{let i=await r
Line truncated
|
||||||
|
|
||||||
|
`);return{message:l[0],author:{name:o.commit.author.name,email:o.commit.author.email},body:l.slice(1).join(`
|
||||||
|
|
||||||
|
`),date:new Date(o.commit.committer.timestamp).toDateString(),diff:{changed:0,files:(await this.getFileChangesCount(o.commit.parent.first(),o.oid)).map(c=>({path:c.path,status:c.type,vaultPath:this.getRelativeVaultPath(c.path),hash:o.oid}))},hash:o.oid,refs:[]}}))}updateBasePath(r){return this.getRepo().dir=r,Promise.resolve()}async updateUpstreamBranch(r){let[i,n]=Zn(r),s=await this.branchInfo();await this.wrapFS(re.default.push({...this.getRepo(),remote:i,remoteRef:n})),await this.setConfig(`branch.${s.current}.merge`,`refs/heads/${n}`)}updateGitPath(r){return Promise.resolve()}async getFileChangesCount(r,i){return this.walkDifference({walkers:[re.default.TREE({ref:r}),re.default.TREE({ref:i})]})}async walkDifference({walkers:r,dir:i}){return await this.wrapFS(re.default.walk({...this.getRepo(),trees:r,map:async function(s,[a,o]){if(!Gw(s,i))return null;if(await(a==null?void 0:a.type())==="tree"||await(o==null?void 0:o.type())==="tree")return;let l=await(a==null?void 0:a.oid()),c=await(o==null?void 0:o.oid()),u="equal";if(l!==c&&(u="M"),l===void 0&&(u="A"),c===void 0&&(u="D"),l===void 0&&c===void 0&&(console.log("Something weird happened:"),console.log(a),console.log(o)),u!=="equal")return{path:s,type:u}}}))}async getStagedFiles(r="."){return(await this.walkDifference({walkers:[re.default.TREE({ref:"HEAD"}),re.default.STAGE()],dir:r})).map(n=>({vaultPath:this.getRelativeVaultPath(n.path),path:n.path}))}async getUnstagedFiles(r="."){let i,n=window.setTimeout(()=>{i=new Pa.Notice("This takes longer: Getting status",this.noticeLength)},2e4);try{let s=this.getRepo(),a=await this.wrapFS(re.default.walk({...s,trees:[re.default.WORKDIR(),re.default.STAGE()],map:async function(o,[l,c]){if(!c&&l&&await re.default.isIgnored({...s,filepath:o})||!Gw(o,r))return null;let[u,f]=await Promise.all([l&&l.type(),c&&c.type()]),d=[u,f].includes("blob");if((u==="tree"||u==="special")&&!d)return;if(f==="commit")return null;if((f==="tree"||f==="special")&&!d)return;let h=f==="blob"?await c.oid():void 0,m;return u==="blob"&&f!=="blob"?m="42":u==="blob"&&(m=await l.oid()),m?h?m!==h?{path:o,type:"M"}:null:{path:o,type:"A"}:{path:o,type:"D"}}}));return window.clearTimeout(n),i==null||i.hide(),a}catch(s){throw window.clearTimeout(n),i==null||i.hide(),this.plugin.displayError(s),s}}async getDiffString(r,i=!1,n){let s=this.getRelativeVaultPath(r),a=async(c,[u])=>{if(r==c){let f=await u.oid();return(await re.default.readBlob({...this.getRepo(),oid:f})).blob}};if(n){let c=await(0,re.readBlob)({...this.getRepo(),filepath:r,oid:n}).then(h=>new TextDecoder().decode(h.blob)).catch(h=>{if(!(h instanceof re.default.Errors.NotFoundError))throw h}),u=await re.default.readCommit({...this.getRepo(),oid:n}),f=await(0,re.readBlob)({...this.getRepo(),filepath:r,oid:u.commit.parent.first()}).then(h=>new TextDecoder().decode(h.blob)).catch(h=>{if(!(h instanceof re.default.Errors.NotFoundError))throw h});return cu(s,f!=null?f:"",c!=null?c:"")}let o=(await re.default.walk({...this.getRepo(),trees:[re.default.STAGE()],map:a})).first(),l=new TextDecoder().decode(o);if(i){let c=await this.resolveRef("HEAD").then(f=>(0,re.readBlob)({...this.getRepo(),filepath:r,oid:f})).then(f=>new TextDecoder().decode(f.blob)).catch(f=>{if(!(f instanceof re.default.Errors.NotFoundError))throw f});return cu(s,c!=null?c:"",l)}else{let c;return await this.app.vault.adapter.exists(s)?c=await this.app.vault.adapter.read(s):c="",cu(s,l,c)}}async getLastCommitTime(){let r=this.getRepo(),i=await this.resolveRef("HEAD"),s=(await re.default.readCommit({...r,oid:i})).commit.committer.timestamp;return new Date(s*1e3)}getFileStatusResult(r){let i=this.status_mapping[`${r[this.HEAD]}${r[this.WORKDIR]}${r[this.STAGE]}`];return{index:i[0]=="?"?"U":i[0],workingDir:i[1]=="?"?"U":i[1],path:r[this.FILE],vaultPath:this.getRelativeVaultPath(r[this.FILE])}}async checkAuthorInfo(){let r=await this.getConfig("user.name"),i=await this.getConfig("user.email");if(!r||!i)throw Error("Git author name and email are not set. Please set both fields in the settings.")}showNotice(r,i=!0){if(!this.plugin.settings.disablePopups)return new Pa.Notice(r,i?this.noticeLength:void 0)}};async function*oG(t){yield new Uint8Array(t)}async function lG(t){let e=new ReadableStream({async start(i){for await(let n of t)i.enqueue(n);i.close()}});return await new Response(e).arrayBuffer()}p();var GF=Mt(Sh()),ei=Mt(require("fs/promises")),Qn=require("obsidian"),Ge=Mt(require("path")),Mu=require("path");p();var Mh=Mt(nR(),1),Fh=Mt(Sh(),1),P$=require("child_process"),dF=Mt(Yw(),1),xl=Mt(Yw(),1),BF=require("node:events"),p0=Object.defineProperty,TG=Object.getOwnPropertyDescriptor,m0=Object.getOwnPropertyNames,CG=Object.prototype.hasOwnProperty,Y=(t,e)=>function(){return t&&(e=(0,t[m0(t)[0]])(t=0)),e},PG=(t,e)=>function(){return e||(0,t[m0(t)[0]])((e={exports:{}}).exports,e),e.exports},vt=(t,e)=>{for(var r in e)p0(t,r,{get:e[r],enumerable:!0})},RG=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of m0(e))!CG.c
Line truncated
|
||||||
|
`){return t.split(r).reduce((i,n)=>{let s=e?n.trim():n;return s&&i.push(s),i},[])}function g0(t,e){return $u(t,!0).map(r=>e(r))}function v0(t){return(0,Mh.exists)(t,Mh.FOLDER)}function Oe(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}function jR(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}function Dh(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}function mn(t){return Array.isArray(t)?t:[t]}function qR(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}function zR(t){return mn(t).map(String)}function Ve(t,e=0){if(t==null)return e;let r=parseInt(t,10);return isNaN(r)?e:r}function Tu(t,e){let r=[];for(let i=0,n=t.length;i<n;i++)r.push(e,t[i]);return r}function Cu(t){return(Array.isArray(t)?Buffer.concat(t):t).toString("utf-8")}function VR(t,e){return Object.assign({},...e.map(r=>r in t?{[r]:t[r]}:{}))}function t0(t=0){return new Promise(e=>setTimeout(e,t))}function r0(t){if(t!==!1)return t}var Sl,Ma,Fu,Lh=Y({"src/lib/utils/util.ts"(){"use strict";Sl="\0",Ma=()=>{},Fu=Object.prototype.toString.call.bind(Object.prototype.toString)}});function gn(t,e,r){return e(t)?t:arguments.length>2?r:void 0}function i0(t,e){let r=Ph(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}function Bh(t){return!!t&&Fu(t)==="[object Object]"}function WR(t){return typeof t=="function"}var Iu,er,YR,Rh,w0,XR=Y({"src/lib/utils/argument-filters.ts"(){"use strict";Lh(),Pu(),Iu=t=>Array.isArray(t),er=t=>typeof t=="string",YR=t=>Array.isArray(t)&&t.every(er),Rh=t=>er(t)||Array.isArray(t)&&t.every(er),w0=t=>t==null||"number|boolean|function".includes(typeof t)?!1:Array.isArray(t)||typeof t=="string"||typeof t.length=="number"}}),n0,FG=Y({"src/lib/utils/exit-codes.ts"(){"use strict";n0=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(n0||{})}}),$h,IG=Y({"src/lib/utils/git-output-streams.ts"(){"use strict";$h=class ZR{constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new ZR(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),me,qs,OG=Y({"src/lib/utils/line-parser.ts"(){"use strict";me=class{constructor(t,e){this.matches=[],this.parse=(r,i)=>(this.resetMatches(),this._regExp.every((n,s)=>this.addMatch(n,s,r(s)))?this.useMatches(i,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}useMatches(t,e){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,r){let i=r&&t.exec(r);return i&&this.pushMatch(e,i),!!i}pushMatch(t,e){this.matches.push(...e.slice(1))}},qs=class extends me{addMatch(t,e,r){return/^remote:\s/.test(String(r))&&super.addMatch(t,e,r)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function KR(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...QR},...t.filter(i=>typeof i=="object"&&i));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}var QR,MG=Y({"src/lib/utils/simple-git-options.ts"(){"use strict";QR={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function y0(t,e=[]){return Bh(t)?Object.keys(t).reduce((r,i)=>{let n=t[i];if(Ph(n))r.push(n);else if(i0(n,["boolean"]))r.push(i+"="+n);else if(Array.isArray(n))for(let s of n)i0(s,["string","number"])||r.push(i+"="+s);else r.push(i);return r},e):e}function Cr(t,e=0,r=!1){let i=[];for(let n=0,s=e<0?t.length:e;n<s;n++)"string|number".includes(typeof t[n])&&i.push(String(t[n]));return y0(b0(t),i),r||i.push(...DG(t)),i}function DG(t){let e=typeof Oa(t)=="function";return gn(Oa(t,e?1:0),Iu,[])}function b0(t){let e=WR(Oa(t));return gn(Oa(t,e?1:0),Bh)}function ft(t,e=!0){let r=BR(Oa(t));return e||NR(r)?r:void 0}var LG=Y({"src/lib/utils/task-options.ts"(){"use strict";XR(),Lh(),Pu()}});function s0(t,e){return t(e.stdOut,e.stdErr)}function $r(t,e,r,i=!0){return mn(r).forEach(n=>{for(let s=$u(n,i),a=0,o=s.length;a<o;a++){let l=(c=0)=>{if(!(a+c>=o))return s[a+c]};e.some(({parse:c})=>c(l,t))}}),t}var BG=Y({"src/lib/utils/task-parser.ts"(){"use strict";Lh()}}),JR={};vt(JR,{ExitCodes:()=>n0,GitOutputStreams:()=>$h,LineParser:()=>me,NOOP:()=>Ma,NULL:()=>Sl,RemoteLineParser:()=>qs,append:()=>Oe,appendTaskOptions:()=>y0,asArray:()=>mn,asCamelCase:()=>qR,asFunction:()=>BR,asNumber:()=>Ve,asStringArray:()=>zR,bufferToString:()=>Cu,callTaskParser:()=>s0,createInstanceConfig:()=>KR,delay:()=>t0,filterArray:()=>Iu,filterFunction:()=>WR,filterHasLength:()=>w0,filterPlainObject:()=>Bh,filterPrimitives:()=>i0,filterString:()=>er,filterStringArray:()=>YR,filterStringOrStringArray:()=>Rh,filterType:()=>gn,first:()=>UR,folderExists:()=>v0,forEachLineWithContent:()=>g0,getTrailingOptions:()=>Cr,including:()=>jR,isUserFunction:()=>NR,last:()=>Oa,objectToString:()=>Fu,orVoid:()=>r0,parseStringResponse:()=>$r,pick:()=>VR,prefixedArray:()=>Tu,remove:()=>Dh,splitOn:()=>HR,toLinesWithContent:()=>$u,trailingFunctionArgument:()=>ft,trailingOptionsArgument:()=>
Line truncated
|
||||||
|
`)){let l=HR(a,`
|
||||||
|
`);o=l[0],a=l[1]}yield{file:s,key:o,value:a}}}var g$,QG=Y({"src/lib/responses/ConfigList.ts"(){"use strict";de(),g$=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((t,e)=>Object.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=Oa(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let i=this.addFile(t);i.hasOwnProperty(e)?Array.isArray(i[e])?i[e].push(r):i[e]=[i[e],r]:i[e]=r,this._all=void 0}}}});function Xw(t,e){return typeof t=="string"&&l0.hasOwnProperty(t)?t:e}function JG(t,e,r,i){let n=["config",`--${i}`];return r&&n.push("--add"),n.push(t,e),{commands:n,format:"utf-8",parser(s){return s}}}function ej(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(i){return ZG(i,t)}}}function tj(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return XG(r)}}}function rj(){return{addConfig(t,e,...r){return this._runTask(JG(t,e,r[0]===!0,Xw(r[1],"local")),ft(arguments))},getConfig(t,e){return this._runTask(ej(t,Xw(e,void 0)),ft(arguments))},listConfig(...t){return this._runTask(tj(Xw(t[0],void 0)),ft(arguments))}}}var l0,v$=Y({"src/lib/tasks/config.ts"(){"use strict";QG(),de(),l0=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(l0||{})}});function ij(t){return w$.has(t)}var Zw,w$,y$=Y({"src/lib/tasks/diff-name-status.ts"(){"use strict";Zw=(t=>(t.ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",t))(Zw||{}),w$=new Set(Object.values(Zw))}});function nj(...t){return new _$().param(...t)}function sj(t){let e=new Set,r={};return g0(t,i=>{let[n,s,a]=i.split(Sl);e.add(n),(r[n]=r[n]||[]).push({line:Ve(s),path:n,preview:a})}),{paths:e,results:r}}function aj(){return{grep(t){let e=ft(arguments),r=Cr(arguments);for(let n of b$)if(r.includes(n))return this._runTask(Pr(`git.grep: use of "${n}" is not supported.`),e);typeof t=="string"&&(t=nj().param(t));let i=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:i,format:"utf-8",parser(n){return sj(n)}},e)}}}var b$,Au,aR,_$,x$=Y({"src/lib/tasks/grep.ts"(){"use strict";de(),gt(),b$=["-h"],Au=Symbol("grepQuery"),_$=class{constructor(){this[aR]=[]}*[(aR=Au,Symbol.iterator)](){for(let t of this[Au])yield t}and(...t){return t.length&&this[Au].push("--and","(",...Tu(t,"-e"),")"),this}param(...t){return this[Au].push(...Tu(t,"-e")),this}}}}),S$={};vt(S$,{ResetMode:()=>Ah,getResetMode:()=>lj,resetTask:()=>oj});function oj(t,e){let r=["reset"];return E$(t)&&r.push(`--${t}`),r.push(...e),mr(r)}function lj(t){if(E$(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}function E$(t){return k$.includes(t)}var Ah,k$,A$=Y({"src/lib/tasks/reset.ts"(){"use strict";gt(),Ah=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(Ah||{}),k$=Array.from(Object.values(Ah))}});function cj(){return(0,Fh.default)("simple-git")}function oR(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(i,...n)=>{t(i,...n),r(i,...n)}:t:(i,...n)=>{t(`%s ${i}`,e,...n),r&&r(i,...n)}}function uj(t,e,{namespace:r}){if(typeof t=="string")return t;let i=e&&e.namespace||"";return i.startsWith(r)?i.substr(r.length+1):i||r}function A0(t,e,r,i=cj()){let n=t&&`[${t}]`||"",s=[],a=typeof e=="string"?i.extend(e):e,o=uj(gn(e,er),a,i);return c(r);function l(u,f){return Oe(s,A0(t,o.replace(/^[^:]+/,u),f,i))}function c(u){let f=u&&`[${u}]`||"",d=a&&oR(a,f)||Ma,h=oR(i,`${n} ${f}`,d);return Object.assign(a?d:h,{label:t,sibling:l,info:h,step:c})}}var T$=Y({"src/lib/git-logger.ts"(){"use strict";de(),Fh.default.formatters.L=t=>String(w0(t)?t.length:"-"),Fh.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):Fu(t)}}),C$,fj=Y({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";var t;zs(),T$(),C$=(t=class{constructor(r="GitExecutor"){this.logLabel=r,this._queue=new Map}withProgress(r){return this._queue.get(r)}createProgress(r){let i=t.getName(r.commands[0]),n=A0(this.logLabel,i);return{task:r,logger:n,name:i}}push(r){let i=this.createProgress(r);return i.logger("Adding task to the queue, commands = %o",r.commands),this._queue.set(r,i),i}fatal(r){for(let[i,{logger:n}]of Array.from(this._queue.entries()))i===r.task?(n.info("Failed %o",r),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",r.message),this.complete(i);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(r){this.withProgress(r)&&this._queue.delete(r)}attempt(r){let i=this.withProgress(r);if(!i)throw new Rr(void 0,"TasksPendingQueue: attempt called for an unknown task");return i.logger("Starting
Line truncated
|
||||||
|
`).map(az).filter(Boolean);e||r.sort(function(n,s){let a=n.split("."),o=s.split(".");if(a.length===1||o.length===1)return sz(kh(a[0]),kh(o[0]));for(let l=0,c=Math.max(a.length,o.length);l<c;l++){let u=MF(kh(a[l]),kh(o[l]));if(u)return u}return 0});let i=e?r[0]:[...r].reverse().find(n=>n.indexOf(".")>=0);return new $R(r,i)}}}),LF={};vt(LF,{addAnnotatedTagTask:()=>uz,addTagTask:()=>cz,tagListTask:()=>lz});function lz(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return DF(r,e)}}}function cz(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}function uz(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}var fz=Y({"src/lib/tasks/tag.ts"(){"use strict";oz()}}),dz=PG({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(pj(),ut(R$)),{SimpleGitApi:i}=(dq(),ut(uF)),{Scheduler:n}=(hq(),ut(fF)),{configurationErrorTask:s}=(gt(),ut(o0)),{asArray:a,filterArray:o,filterPrimitives:l,filterString:c,filterStringOrStringArray:u,filterType:f,getTrailingOptions:d,trailingFunctionArgument:h,trailingOptionsArgument:m}=(de(),ut(JR)),{applyPatchTask:g}=(mq(),ut(pF)),{branchTask:v,branchLocalTask:w,deleteBranchesTask:b,deleteBranchTask:k}=(Aq(),ut(bF)),{checkIgnoreTask:x}=(Pq(),ut(SF)),{checkIsRepoTask:E}=(i$(),ut(e$)),{cloneTask:A,cloneMirrorTask:y}=(Fq(),ut(EF)),{cleanWithOptionsTask:S,isCleanOptionsArray:_}=(p$(),ut(d$)),{diffSummaryTask:T}=(I0(),ut(j$)),{fetchTask:P}=(Lq(),ut(TF)),{moveTask:D}=(Uq(),ut(PF)),{pullTask:B}=(jq(),ut(RF)),{pushTagsTask:N}=(nF(),ut(iF)),{addRemoteTask:ce,getRemotesTask:Pe,listRemotesTask:ve,remoteTask:se,removeRemoteTask:xe}=(Qq(),ut(FF)),{getResetMode:we,resetTask:z}=(A$(),ut(S$)),{stashListTask:Q}=(ez(),ut(IF)),{addSubModuleTask:j,initSubModuleTask:Le,subModuleTask:lr,updateSubModuleTask:It}=(nz(),ut(OF)),{addAnnotatedTagTask:Fe,addTagTask:At,tagListTask:Tt}=(fz(),ut(LF)),{straightThroughBufferTask:jt,straightThroughStringTask:Ze}=(gt(),ut(o0));function q(L,V){this._plugins=V,this._executor=new r(L.baseDir,new n(L.maxConcurrentProcesses),V),this._trimmed=L.trimmed}(q.prototype=Object.create(i.prototype)).constructor=q,q.prototype.customBinary=function(L){return this._plugins.reconfigure("binary",L),this},q.prototype.env=function(L,V){return arguments.length===1&&typeof L=="object"?this._executor.env=L:(this._executor.env=this._executor.env||{})[L]=V,this},q.prototype.stashList=function(L){return this._runTask(Q(m(arguments)||{},o(L)&&L||[]),h(arguments))};function Z(L,V,Te,qe){return typeof Te!="string"?s(`git.${L}() requires a string 'repoPath'`):V(Te,f(qe,c),d(arguments))}q.prototype.clone=function(){return this._runTask(Z("clone",A,...arguments),h(arguments))},q.prototype.mirror=function(){return this._runTask(Z("mirror",y,...arguments),h(arguments))},q.prototype.mv=function(L,V){return this._runTask(D(L,V),h(arguments))},q.prototype.checkoutLatestTag=function(L){var V=this;return this.pull(function(){V.tags(function(Te,qe){V.checkout(qe.latest,L)})})},q.prototype.pull=function(L,V,Te,qe){return this._runTask(B(f(L,c),f(V,c),d(arguments)),h(arguments))},q.prototype.fetch=function(L,V){return this._runTask(P(f(L,c),f(V,c),d(arguments)),h(arguments))},q.prototype.silent=function(L){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},q.prototype.tags=function(L,V){return this._runTask(Tt(d(arguments)),h(arguments))},q.prototype.rebase=function(){return this._runTask(Ze(["rebase",...d(arguments)]),h(arguments))},q.prototype.reset=function(L){return this._runTask(z(we(L),d(arguments)),h(arguments))},q.prototype.revert=function(L){let V=h(arguments);return typeof L!="string"?this._runTask(s("Commit must be a string"),V):this._runTask(Ze(["revert",...d(arguments,0,!0),L]),V)},q.prototype.addTag=function(L){let V=typeof L=="string"?At(L):s("Git.addTag requires a tag name");return this._runTask(V,h(arguments))},q.prototype.addAnnotatedTag=function(L,V){return this._runTask(Fe(L,V),h(arguments))},q.prototype.deleteLocalBranch=function(L,V,Te){return this._runTask(k(L,typeof V=="boolean"?V:!1),h(arguments))},q.prototype.deleteLocalBranches=function(L,V,Te){return this._runTask(b(L,typeof V=="boolean"?V:!1),h(arguments))},q.prototype.branch=function(L,V){return this._runTask(v(d(arguments)),h(arguments))},q.prototype.branchLocal=function(L){return this._runTask(w(),h(arguments))},q.prototype.raw=function(L){let V=!Array.isArray(L),Te=[].slice.call(V?arguments:L,0);for(let Ot=0;Ot<Te.length&&V;Ot++)if(!l(Te[Ot])){Te.splice(Ot,Te.length-Ot);break}Te.push(...d(arguments,0,!0));var qe=h(arguments);return Te.length?this._runTask(Ze(Te,this._trimmed),qe):this._runTask(s("Raw: must supply one or more command to execute"),qe)},q.prototype.submoduleAdd=function(L,V,Te){return this._runTask(j(L,V),h(arguments))},q.prototype.submoduleUpdate=function(L,V){return this._runTask
Line truncated
|
||||||
|
`).some(l=>l.contains(n))||await ei.appendFile(r,n+`
|
||||||
|
`)}catch(r){console.error("Error while adding askpass script to exclude file:",r)}}unload(){var r;(r=this.watchAbortController)==null||r.abort()}async status(r){let i=r==null?void 0:r.path;this.plugin.setPluginState({gitAction:1});let n=await this.git.status(i!=null?["--",i]:[]);this.plugin.setPluginState({gitAction:0});let s=n.files.map(a=>{let o=this.formatPath(a);return{path:o.path,from:o.from,index:a.index==="?"?"U":a.index,workingDir:a.working_dir==="?"?"U":a.working_dir,vaultPath:this.getRelativeVaultPath(o.path)}});return{all:s,changed:s.filter(a=>a.workingDir!==" "),staged:s.filter(a=>a.index!==" "&&a.index!="U"),conflicted:n.conflicted.map(a=>this.formatPath({path:a}).path)}}async submoduleAwareHeadRevisonInContainingDirectory(r){let i=this.getRelativeRepoPath(r),s=["-C",Ge.dirname(i),"rev-parse","HEAD"],a=this.git.raw(s);return a.catch(o=>console.warn("obsidian-git: rev-parse error:",o)),(await a).trim()}async getSubmodulePaths(){return new Promise(r=>{this.git.outputHandler((i,n,s,a)=>{if(!(a.contains("submodule")&&a.contains("foreach")))return;let o="",l=this.app.vault.adapter.getBasePath()+(this.plugin.settings.basePath?"/"+this.plugin.settings.basePath:"");n.on("data",c=>{o+=c.toString("utf8")}),n.on("end",()=>{let u=o.split(`
|
||||||
|
`).map(f=>{let d=f.match(/'([^']*)'/);if(d!=null)return l+"/"+d[1]+Mu.sep}).filter(f=>!!f);u.reverse(),r(u)})}),this.git.subModule(["foreach","--recursive",""]).then(()=>{this.git.outputHandler(()=>{})},i=>this.plugin.displayError(i))})}formatPath(r){function i(n){if(n!=null)return n.startsWith('"')&&n.endsWith('"')?n.substring(1,n.length-1):n}return r.from!=null?{from:i(r.from),path:i(r.path)}:{path:i(r.path)}}async blame(r,i,n){if(r=this.getRelativeRepoPath(r),!await this.isTracked(r))return"untracked";let s=await this.getSubmoduleOfFile(r),a=s?["-C",s.submodule]:[],o=s?s.relativeFilepath:r;a.push("blame","--porcelain"),n&&a.push("-w");let l=`-C${Bd}`;switch(i){case"inactive":break;case"same-commit":a.push("-C",l);break;case"all-commits":a.push("-C","-C",l);break;default:Gs(i)}a.push("--",o);let c=await this.git.raw(a);return Mz(c)}async isTracked(r){let i=await this.getSubmoduleOfFile(r),n=i?["-C",i.submodule]:[],s=i?i.relativeFilepath:r;return n.push("ls-files","--",s),this.git.raw(n).then(a=>a.trim()!=="")}async commitAll({message:r}){if(this.plugin.settings.updateSubmodules){this.plugin.setPluginState({gitAction:4});let n=await this.getSubmodulePaths();for(let s of n)await this.git.cwd({path:s,root:!1}).add("-A"),await this.git.cwd({path:s,root:!1}).commit(await this.formatCommitMessage(r))}this.plugin.setPluginState({gitAction:3}),await this.git.add("-A"),this.plugin.setPluginState({gitAction:4});let i=await this.git.commit(await this.formatCommitMessage(r));return this.app.workspace.trigger("obsidian-git:head-change"),i.summary.changes}async commit({message:r,amend:i}){this.plugin.setPluginState({gitAction:4});let n=(await this.git.commit(await this.formatCommitMessage(r),i?["--amend"]:[])).summary.changes;return this.app.workspace.trigger("obsidian-git:head-change"),this.plugin.setPluginState({gitAction:0}),n}async stage(r,i){this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,i),await this.git.add(["--",r]),this.plugin.setPluginState({gitAction:0})}async stageAll({dir:r}){this.plugin.setPluginState({gitAction:3}),await this.git.add(r!=null?r:"-A"),this.plugin.setPluginState({gitAction:0})}async unstageAll({dir:r}){this.plugin.setPluginState({gitAction:3}),await this.git.reset(r!=null?["--",r]:[]),this.plugin.setPluginState({gitAction:0})}async unstage(r,i){this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,i),await this.git.reset(["--",r]),this.plugin.setPluginState({gitAction:0})}async discard(r){this.plugin.setPluginState({gitAction:3}),await this.isTracked(r)&&await this.git.checkout(["--",r]),this.plugin.setPluginState({gitAction:0})}async applyPatch(r){let i=Ge.join(this.relPluginConfigPath,"patch");await this.app.vault.adapter.write(i,r),await this.git.applyPatch(i,{"--cached":null,"--unidiff-zero":null,"--whitespace":"nowarn"}),await this.app.vault.adapter.remove(i)}async getUntrackedPaths(r){let i=r==null?void 0:r.path;this.plugin.setPluginState({gitAction:1});let n=[];i!=null&&n.push("--",i);let s=await this.git.clean(Ia.RECURSIVE+Ia.DRY_RUN,n);return this.plugin.setPluginState({gitAction:0}),s.paths}async hashObject(r){r=this.getRelativeRepoPath(r);let i=await this.getSubmoduleOfFile(r),n=i?["-C",i.submodule]:[],s=i?i.relativeFilepath:r;return n.push("hash-object","--",s),this.git.raw(n)}async discardAll({dir:r}){return this.discard(r!=null?r:".")}async pull(){this.plugin.setPluginState({gitAction:2});try{this.plugin.settings.updateSubmodules&&await this.git.subModule(["update","--remote","--merge","--recursive"]);let r=await this.branchInfo(),i=await this.git.revparse([r.current]);if(!r.tracking&&this.plugin.settings.updateSubmodules){this.plugin.log("No tracking branch found. Ignoring pull of main repo and updating submodules only.");return}await this.git.fetch();let n=await this.git.revparse([r.tracking]);if(i!==n){if(this.plugin.settings.syncMethod==="merge"||this.plugin.settings.syncMethod==="rebase")try{let o=[r.tracking];switch(this.plugin.settings.mergeStrategy!=="none"&&o.push(`--strategy-option=${this.plugin.settings.mergeStrategy}`),this.plugin.settings.syncMethod){case"merge":await this.git.merge(o);break;case"rebase":await this.git.rebase(o)}}catch(o){this.plugin.displayError(`Pull failed (${this.plugin.settings.syncMethod}): ${"message"in o?o.message:o}`);return}else if(this.plugin.settings.syncMethod==="reset")try{await this.git.raw(["update-ref",`refs/heads/${r.current}`,n]),await this.unstageAll({})}catch(o){this.plugin.displayError(`Sync failed (${this.plugin.settings.syncMethod}): ${"message"in o?o.message:o}`)}this.app.workspace.trigger("obsidian-git:head-change");let s=await this.git.revparse([r.current]);return(await this.git.diff([`${i}..${s}`,"--name-only"])).split(/\r\n|\r|\n/).filter(o=>o.length>0).map(o=>({path:o,workingDir:"P",vaultPath:this.getRelativeVaultPath(o)}))}else return[]}catch(r){this.convertErrors(r)}}async push(){this.plugin.setPluginState({gitAction:5});try{if(this.plugin.settings.updateSubmodules){let a=aw
Line truncated
|
||||||
|
`):[]}async removeRemote(r){await this.git.removeRemote(r)}async updateUpstreamBranch(r){try{await this.git.branch(["--set-upstream-to",r])}catch(i){try{await this.git.branch(["--set-upstream",r])}catch(n){let[s,a]=Zn(r),o=await this.branchInfo();await this.git.push(["--set-upstream",s,`${o.current}:${a}`])}}}updateGitPath(r){return this.setGitInstance()}updateBasePath(r){return this.setGitInstance(!0)}async getDiffString(r,i=!1,n){return i?await this.git.diff(["--cached","--",r]):n?await this.git.show([`${n}`,"--",r]):await this.git.diff(["--",r])}async diff(r,i,n){return await this.git.diff([`${i}..${n}`,"--",r])}async rawCommand(r){let i=r.split(" ");return await this.git.raw(i[0],...i.slice(1))}async getSubmoduleOfFile(r){if(!await this.app.vault.adapter.exists(Ge.dirname(r)))return;let i=await this.git.raw(["-C",Ge.dirname(r),"rev-parse","--show-toplevel"],l=>l&&console.warn("get-submodule-of-file",l==null?void 0:l.message));if(i=i.trim(),(await this.git.raw(["-C",Ge.dirname(r),"rev-parse","--show-superproject-working-tree"],l=>l&&console.warn("get-submodule-of-file",l==null?void 0:l.message))).trim()==="")return;let a=this.app.vault.adapter.getFullPath(Ge.normalize(r)),o=Ge.relative(i,a);return{submodule:i,relativeFilepath:o}}async getLastCommitTime(){try{let r=await this.git.log({n:1});if(r!=null&&r.latest!=null)return new Date(r.latest.date)}catch(r){if(r instanceof Rr){if(r.message.contains("does not have any commits yet"))return}else throw r}}async isGitInstalled(){let r=this.plugin.localStorage.getGitPath(),i=await ku(r||"git",["--version"],{});if(i.error)if(Qn.Platform.isWin&&!r){this.plugin.log(`Git not found in PATH. Checking standard installation path(${Nd}) of Git for Windows.`);let n=await ku(Nd,["--version"]);if(n.error)return console.error(n.error),!1;this.useDefaultWindowsGitPath=!0}else return console.error(i.error),!1;else this.useDefaultWindowsGitPath=!1;return!0}convertErrors(r){if(r instanceof Rr){let i=String(r.message);if(i.contains("Could not resolve host")||i.contains("Unable to resolve host")||i.contains("Unable to open connection")||i.match(/ssh: connect to host .*? port .*?: Operation timed out/)!=null||i.match(/ssh: connect to host .*? port .*?: Network is unreachable/)!=null||i.match(/ssh: connect to host .*? port .*?: Undefined error: 0/)!=null)throw new cl(i)}throw r}async isFileTrackedByLFS(r){try{return(await this.git.raw(["check-attr","filter",r])).includes("filter: lfs")}catch(i){let n=i instanceof Error?i.message:String(i);return this.plugin.displayError(`Error checking LFS status: ${n}`),!1}}},jF={hash:"000000",isZeroCommit:!0,summary:""};function Mz(t){let r=t.replace(`\r
|
||||||
|
`,`
|
||||||
|
`).split(`
|
||||||
|
`),i={commits:new Map,hashPerLine:[void 0],originalFileLineNrPerLine:[void 0],finalFileLineNrPerLine:[void 0],groupSizePerStartingLine:new Map},n=1;for(let s=0;s<r.length;){if(HF(r[s])){let a=r[s].split(" "),o=Dz(a,n,i);for(s++;HF(r[s]);s++){let l=r[s].split(" ");Lz(l,i,n)}Bz(i.commits.get(o)),n+=1}else if(!(r[s]===""&&s===r.length-1))throw Error(`Expected non-whitespace line or EOF, but found: ${r[s]}`);s++}return i}function Dz(t,e,r){let i=t[0];if(r.hashPerLine.push(i),r.originalFileLineNrPerLine.push(parseInt(t[1])),r.finalFileLineNrPerLine.push(parseInt(t[2])),t.length>=4&&r.groupSizePerStartingLine.set(e,parseInt(t[3])),parseInt(t[2])!==e)throw Error(`git-blame output is out of order: ${e} vs ${t[2]}`);return i}function Lz(t,e,r){let i=t[0],n=t.slice(1).join(" "),s=e.hashPerLine[r],a=e.commits.get(s)||{hash:s,author:{},committer:{},previous:{}};switch(i){case"summary":a.summary=n;break;case"author":a.author.name=n;break;case"author-mail":a.author.email=UF(n);break;case"author-time":a.author.epochSeconds=parseInt(n);break;case"author-tz":a.author.tz=n;break;case"committer":a.committer.name=n;break;case"committer-mail":a.committer.email=UF(n);break;case"committer-time":a.committer.epochSeconds=parseInt(n);break;case"committer-tz":a.committer.tz=n;break;case"previous":a.previous.commitHash=n;break;case"filename":a.previous.filename=n;break}e.commits.set(s,a)}function Bz(t){if(t.summary===void 0)throw Error(`Summary not provided for commit: ${t.hash}`);L0(t.author)&&(t.author=void 0),L0(t.committer)&&(t.committer=void 0),L0(t.previous)&&(t.previous=void 0),t.isZeroCommit=!!t.hash.match(/^0*$/)}function L0(t){return!t||Object.keys(t).length===0}function HF(t){return t.length>0&&t[0].trim()===t[0]}function UF(t){let e=t.startsWith("<")?t.substring(1):t;return e.endsWith(">")?e.substring(0,e.length-1):e}p();var pI=require("@codemirror/state");p();var B0=class{constructor(){this.eventsPerFilepath=new Map;this.startRemoveStalesSubscribersInterval()}ifFilepathDefinedTransformSubscribers(e,r){if(e)return this.ensureInitialized(e),r(this.eventsPerFilepath.get(e))}forEachSubscriber(e){this.eventsPerFilepath.forEach(r=>r.forEach(e))}ensureInitialized(e){this.eventsPerFilepath.get(e)||this.eventsPerFilepath.set(e,new Set)}startRemoveStalesSubscribersInterval(){this.removeStalesSubscribersTimer=window.setInterval(()=>this==null?void 0:this.forEachSubscriber(e=>e==null?void 0:e.removeIfStale()),6e4)}clear(){window.clearInterval(this.removeStalesSubscribersTimer),this.eventsPerFilepath.clear()}},Jn=new B0;p();var zh=require("@codemirror/state"),qF=Mt(N0());function zF(t,e,r){if(!(t===void 0||e===void 0||r===void 0))return`head${t}-obj${e}-path${r}`}var VF=zh.StateEffect.define();function WF(t,e,r){return r.update({effects:VF.of({key:t,la:e,lineOffsetsFromUnsavedChanges:new Map})})}var kl=zh.StateField.define({create:t=>{},update:(t,e)=>{for(let r of e.effects)if(r.is(VF))return r.value;return Nz(e,t)},compare:(t,e)=>(t==null?void 0:t.key)===(e==null?void 0:e.key)});function Vh(t){var s;let e=qF.sha256.create();if(!t)return e;let{la:r,key:i,lineOffsetsFromUnsavedChanges:n}=t;e.update(r==="untracked"?"t":"f"),e.update(i);for(let[a,o]of(s=n.entries())!=null?s:[])e.update([a,o]);return e}var wi={get:void 0,save:void 0};function YF(t,e){wi.get=t,wi.save=e}function Wh(t){var e,r;return(r=(e=qh(t.coloringMaxAge))==null?void 0:e.asDays())!=null?r:qh(rt.lineAuthor.coloringMaxAge).asDays()}function Nz(t,e){if(e)return t.changes.empty||t.changes.iterChanges((r,i,n,s)=>{var m;let a=t.startState.doc,{newDoc:o}=t,l=a.lineAt(r).number,c=a.lineAt(i).number,u=o.lineAt(n).number,f=o.lineAt(s).number,d=c-l+1,h=f-u+1;for(let g=u;g<=f;g++){let v=(m=e.lineOffsetsFromUnsavedChanges.get(g))!=null?m:0,w=f===g,b=h-d;w&&(v+=b),e.lineOffsetsFromUnsavedChanges.set(g,v)}}),e}p();function XF(){Al=void 0,H0=[],Yh=0,Zh.clear(),Kh.clear(),Tl.clear()}var Al,Xh=()=>Al;function ZF(t,e){var n;let r=e.length;if(r<((n=Al==null?void 0:Al.length)!=null?n:0))return;Al={gutter:t,length:r,text:e};let i=wi.get();r!==i.gutterSpacingFallbackLength&&(i.gutterSpacingFallbackLength=r,wi.save(i))}var H0=[],Hz=15,Yh=0;function KF(t){H0[Yh]=t,Yh=(Yh+1)%Hz}function QF(){return HP(H0)}var Zh=new Map,Kh=new Map,Tl=new Set;p();var fI=require("@codemirror/state"),dI=require("@codemirror/view");p();var q0=require("@codemirror/view"),oI=Mt(N0()),Cl=require("obsidian");p();p();var Qh={x:-10,y:-10};function JF(){Qh.x===-10&&window.addEventListener("mousedown",t=>{Qh.x=t.clientX,Qh.y=t.clientY})}function eI(){for(let t of Tl)if(Uz(t,Qh))return t}function Uz(t,e){let{x:r,y:i,width:n,height:s}=t.getBoundingClientRect();return r<=e.x&&e.x<=r+n&&i<=e.y&&e.y<=i+s}var tI="data-commit";function rI(t,e,r){if(e.hasFocus())return;let i=eI();if(!i)return;let n=jz(i);n&&(!n.isZeroCommit&&!n.isWaitingGutter&&Gz(n,t),U0("showCommitHash",t),U0("authorDisplay",t),U0("dateTimeFormatOptions",t))}function Gz(t,e){e.addItem(r=>r.setTitle("Copy commit hash").setIcon("copy").setSection("obs-git-line-aut
Line truncated
|
||||||
|
If turned on, do auto ${n} every ${qP(i.settings.autoSaveInterval)} after stopping file edits.
|
||||||
|
This also prevents auto ${n} while editing a file. If turned off, it's independent from the last file edit.`).addToggle(f=>f.setValue(i.settings.autoBackupAfterFileChange).onChange(async d=>{i.settings.autoBackupAfterFileChange=d,this.refreshDisplayWithDelay(),await i.saveSettings(),i.automaticsManager.reload("commit")})),this.mayDisableSetting(a,i.settings.setLastSaveToLastCommit),a=new U.Setting(r).setName(`Auto ${n} after latest commit`).setDesc(`If turned on, sets last auto ${n} timestamp to the latest commit timestamp. This reduces the frequency of auto ${n} when doing manual commits.`).addToggle(f=>f.setValue(i.settings.setLastSaveToLastCommit).onChange(async d=>{i.settings.setLastSaveToLastCommit=d,await i.saveSettings(),i.automaticsManager.reload("commit"),this.refreshDisplayWithDelay()})),this.mayDisableSetting(a,i.settings.autoBackupAfterFileChange),a=new U.Setting(r).setName("Auto push interval (minutes)").setDesc("Push commits every X minutes. Set to 0 (default) to disable.").addText(f=>{f.inputEl.type="number",this.setNonDefaultValue({text:f,settingsProperty:"autoPushInterval"}),f.setPlaceholder(String(rt.autoPushInterval)),f.onChange(async d=>{d!==""?i.settings.autoPushInterval=Number(d):i.settings.autoPushInterval=rt.autoPushInterval,await i.saveSettings(),i.automaticsManager.reload("push")})}),this.mayDisableSetting(a,!i.settings.differentIntervalCommitAndPush),new U.Setting(r).setName("Auto pull interval (minutes)").setDesc("Pull changes every X minutes. Set to 0 (default) to disable.").addText(f=>{f.inputEl.type="number",this.setNonDefaultValue({text:f,settingsProperty:"autoPullInterval"}),f.setPlaceholder(String(rt.autoPullInterval)),f.onChange(async d=>{d!==""?i.settings.autoPullInterval=Number(d):i.settings.autoPullInterval=rt.autoPullInterval,await i.saveSettings(),i.automaticsManager.reload("pull")})}),new U.Setting(r).setName(`Auto ${n} only staged files`).setDesc(`If turned on, only staged files are committed on ${n}. If turned off, all changed files are committed.`).addToggle(f=>f.setValue(i.settings.autoCommitOnlyStaged).onChange(async d=>{i.settings.autoCommitOnlyStaged=d,await i.saveSettings()})),new U.Setting(r).setName(`Specify custom commit message on auto ${n}`).setDesc("You will get a pop up to specify your message.").addToggle(f=>f.setValue(i.settings.customMessageOnAutoBackup).onChange(async d=>{i.settings.customMessageOnAutoBackup=d,await i.saveSettings(),this.refreshDisplayWithDelay()})),a=new U.Setting(r).setName(`Commit message on auto ${n}`).setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message).").addTextArea(f=>{f.setPlaceholder(rt.autoCommitMessage).onChange(async d=>{d===""?i.settings.autoCommitMessage=rt.autoCommitMessage:i.settings.autoCommitMessage=d,await i.saveSettings()}),this.setNonDefaultValue({text:f,settingsProperty:"autoCommitMessage"})}),this.mayDisableSetting(a,i.settings.customMessageOnAutoBackup),new U.Setting(r).setName("Commit message").setHeading();let c=new U.Setting(r).setName("Commit message on manual commit").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message). Leave empty to require manual input on each commit.");c.addTextArea(f=>{c.addButton(d=>{d.setIcon("reset").setTooltip(`Set to default: "${rt.commitMessage}"`).onClick(()=>{f.setValue(rt.commitMessage),f.onChanged()})}),f.setValue(i.settings.commitMessage),f.onChange(async d=>{i.settings.commitMessage=d,await i.saveSettings()})}),new U.Setting(r).setName("Commit message script").setDesc("A script that is run using 'sh -c' to generate the commit message. May be used to generate commit messages using AI tools. Available placeholders: {{hostname}}, {{date}}.").addText(f=>{f.onChange(async d=>{d===""?i.settings.commitMessageScript=rt.commitMessageScript:i.settings.commitMessageScript=d,await i.saveSettings()}),this.setNonDefaultValue({text:f,settingsProperty:"commitMessageScript"})});let u=new U.Setting(r).setName("{{date}} placeholder format").addMomentFormat(f=>f.setDefaultFormat(i.settings.commitDateFormat).setValue(i.settings.commitDateFormat).onChange(async d=>{i.settings.commitDateFormat=d,await i.saveSettings()}));u.descEl.innerHTML=`
|
||||||
|
Specify custom date format. E.g. "${kv}. See <a href="https://momentjs.com">Moment.js</a> for more formats.`,new U.Setting(r).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device. Defaults to the OS hostname if not set on desktop.").addText(f=>{var d;return f.setValue((d=i.localStorage.getHostname())!=null?d:"").onChange(h=>{i.localStorage.setHostname(h)})}),new U.Setting(r).setName("Preview commit message").addButton(f=>f.setButtonText("Preview").onClick(async()=>{let d=await i.gitManager.formatCommitMessage(i.settings.commitMessage);new U.Notice(`${d}`)})),new U.Setting(r).setName("List filenames affected by commit in the commit body").addToggle(f=>f.setValue(i.settings.listChangedFilesInMessageBody).onChange(async d=>{i.settings.listChangedFilesInMessageBody=d,await i.saveSettings()})),new U.Setting(r).setName("Pull").setHeading(),i.gitManager instanceof Se&&new U.Setting(r).setName("Merge strategy").setDesc("Decide how to integrate commits from your remote branch into your local branch.").addDropdown(f=>{let d={merge:"Merge",rebase:"Rebase",reset:"Other sync service (Only updates the HEAD without touching the working directory)"};f.addOptions(d),f.setValue(i.settings.syncMethod),f.onChange(async h=>{i.settings.syncMethod=h,await i.saveSettings()})}),new U.Setting(r).setName("Merge strategy on conflicts").setDesc("Decide how to solve conflicts when pulling remote changes. This can be used to favor your local changes or the remote changes automatically.").addDropdown(f=>{let d={none:"None (git default)",ours:"Our changes",theirs:"Their changes"};f.addOptions(d),f.setValue(i.settings.mergeStrategy),f.onChange(async h=>{i.settings.mergeStrategy=h,await i.saveSettings()})}),new U.Setting(r).setName("Pull on startup").setDesc("Automatically pull commits when Obsidian starts.").addToggle(f=>f.setValue(i.settings.autoPullOnBoot).onChange(async d=>{i.settings.autoPullOnBoot=d,await i.saveSettings()})),new U.Setting(r).setName("Commit-and-sync").setDesc("Commit-and-sync with default settings means staging everything -> committing -> pulling -> pushing. Ideally this is a single action that you do regularly to keep your local and remote repository in sync.").setHeading(),a=new U.Setting(r).setName("Push on commit-and-sync").setDesc(`Most of the time you want to push after committing. Turning this off turns a commit-and-sync action into commit ${i.settings.pullBeforePush?"and pull ":""}only. It will still be called commit-and-sync.`).addToggle(f=>f.setValue(!i.settings.disablePush).onChange(async d=>{i.settings.disablePush=!d,this.refreshDisplayWithDelay(),await i.saveSettings()})),new U.Setting(r).setName("Pull on commit-and-sync").setDesc(`On commit-and-sync, pull commits as well. Turning this off turns a commit-and-sync action into commit ${i.settings.disablePush?"":"and push "}only.`).addToggle(f=>f.setValue(i.settings.pullBeforePush).onChange(async d=>{i.settings.pullBeforePush=d,this.refreshDisplayWithDelay(),await i.saveSettings()})),i.gitManager instanceof Se&&(new U.Setting(r).setName("Hunk management").setDesc("Hunks are sections of grouped line changes right in your editor.").setHeading(),new U.Setting(r).setName("Signs").setDesc("This allows you to see your changes right in your editor via colored markers and stage/reset/preview individual hunks.").addToggle(f=>f.setValue(i.settings.hunks.showSigns).onChange(async d=>{i.settings.hunks.showSigns=d,await i.saveSettings(),i.editorIntegration.refreshSignsSettings()})),new U.Setting(r).setName("Hunk commands").setDesc("Adds commands to stage/reset individual Git diff hunks and navigate between them via 'Go to next/prev hunk' commands.").addToggle(f=>f.setValue(i.settings.hunks.hunkCommands).onChange(async d=>{i.settings.hunks.hunkCommands=d,await i.saveSettings(),i.editorIntegration.refreshSignsSettings()})),new U.Setting(r).setName("Status bar with summary of line changes").addDropdown(f=>f.addOptions({disabled:"Disabled",colored:"Colored",monochrome:"Monochrome"}).setValue(i.settings.hunks.statusBar).onChange(async d=>{i.settings.hunks.statusBar=d,await i.saveSettings(),i.editorIntegration.refreshSignsSettings()})),new U.Setting(r).setName("Line author information").setHeading(),this.addLineAuthorInfoSettings())}new U.Setting(r).setName("History view").setHeading(),new U.Setting(r).setName("Show Author").setDesc("Show the author of the commit in the history view.").addDropdown(c=>{let u={hide:"Hide",full:"Full",initials:"Initials"};c.addOptions(u),c.setValue(i.settings.authorInHistoryView),c.onChange(async f=>{i.settings.authorInHistoryView=f,await i.saveSettings(),await i.refresh()})}),new U.Setting(r).setName("Show Date").setDesc("Show the date of the commit in the history view. The {{date}} placeholder format is used to display the date.").addToggle(c=>c.setValue(i.settings.dateInHistoryView).onChange(async u=>{i.settings.dateInHistoryView=u,await i.saveSettings(),await i.refresh()})),new U.Settin
Line truncated
|
||||||
|
`)),c.onChange(u=>{i.localStorage.setEnvVars(u.split(`
|
||||||
|
`))})}),i.gitManager instanceof Se&&new U.Setting(r).setName("Additional PATH environment variable paths").setDesc("Use each line for one path").addTextArea(c=>{c.setValue(i.localStorage.getPATHPaths().join(`
|
||||||
|
`)),c.onChange(u=>{i.localStorage.setPATHPaths(u.split(`
|
||||||
|
`))})}),i.gitManager instanceof Se&&new U.Setting(r).setName("Reload with new environment variables").setDesc("Removing previously added environment variables will not take effect until Obsidian is restarted.").addButton(c=>{c.setButtonText("Reload"),c.setCta(),c.onClick(async()=>{await i.gitManager.setGitInstance()})}),new U.Setting(r).setName("Custom base path (Git repository path)").setDesc(`
|
||||||
|
Sets the relative path to the vault from which the Git binary should be executed.
|
||||||
|
Mostly used to set the path to the Git repository, which is only required if the Git repository is below the vault root directory. Use "\\" instead of "/" on Windows.
|
||||||
|
`).addText(c=>{c.setValue(i.settings.basePath),c.setPlaceholder("directory/directory-with-git-repo"),c.onChange(async u=>{i.settings.basePath=u,await i.saveSettings(),i.gitManager.updateBasePath(u||"").catch(f=>i.displayError(f))})}),new U.Setting(r).setName("Custom Git directory path (Instead of '.git')").setDesc('Corresponds to the GIT_DIR environment variable. Requires restart of Obsidian to take effect. Use "\\" instead of "/" on Windows.').addText(c=>{c.setValue(i.settings.gitDir),c.setPlaceholder(".git"),c.onChange(async u=>{i.settings.gitDir=u,await i.saveSettings()})}),new U.Setting(r).setName("Disable on this device").setDesc("Disables the plugin on this device. This setting is not synced.").addToggle(c=>c.setValue(i.localStorage.getPluginDisabled()).onChange(u=>{i.localStorage.setPluginDisabled(u),u?i.unloadPlugin():i.init({fromReload:!0}).catch(f=>i.displayError(f)),new U.Notice("Obsidian must be restarted for the changes to take affect.")})),new U.Setting(r).setName("Support").setHeading(),new U.Setting(r).setName("Donate").setDesc("If you like this Plugin, consider donating to support continued development.").addButton(c=>{c.buttonEl.outerHTML="<a href='https://ko-fi.com/F1F195IQ5' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi3.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>"});let o=r.createDiv();o.setAttr("align","center"),o.setAttr("style","margin: var(--size-4-2)");let l=o.createEl("button");if(l.setText("Copy Debug Information"),l.onclick=async()=>{await window.navigator.clipboard.writeText(JSON.stringify({settings:this.plugin.settings,pluginVersion:this.plugin.manifest.version},null,4)),new U.Notice("Debug information copied to clipboard. May contain sensitive information!")},U.Platform.isDesktopApp){let c=r.createDiv();c.setAttr("align","center"),c.setText(`Debugging and logging:
|
||||||
|
You can always see the logs of this and every other plugin by opening the console with`);let u=r.createDiv();u.setAttr("align","center"),u.addClass("obsidian-git-shortcuts"),U.Platform.isMacOS===!0?u.createEl("kbd",{text:"CMD (\u2318) + OPTION (\u2325) + I"}):u.createEl("kbd",{text:"CTRL + SHIFT + I"})}}mayDisableSetting(r,i){i&&(r.setDisabled(i),r.setClass("obsidian-git-disabled"))}configureLineAuthorShowStatus(r){this.settings.lineAuthor.show=r,this.plugin.saveSettings(),r?this.plugin.editorIntegration.activateLineAuthoring():this.plugin.editorIntegration.deactiveLineAuthoring()}async lineAuthorSettingHandler(r,i){this.settings.lineAuthor[r]=i,await this.plugin.saveSettings(),this.plugin.editorIntegration.lineAuthoringFeature.refreshLineAuthorViews()}beforeSaveSettings(){let r=this.settings.lineAuthor;r.authorDisplay!=="hide"&&(r.lastShownAuthorDisplay=r.authorDisplay),r.dateTimeFormatOptions!=="hide"&&(r.lastShownDateTimeFormatOptions=r.dateTimeFormatOptions)}addLineAuthorInfoSettings(){let r=new U.Setting(this.containerEl).setName("Show commit authoring information next to each line");if(this.plugin.editorIntegration.lineAuthoringFeature.isAvailableOnCurrentPlatform()||r.setDesc("Only available on desktop currently.").setDisabled(!0),r.descEl.innerHTML=`
|
||||||
|
<a href="${rV}">Feature guide and quick examples</a></br>
|
||||||
|
The commit hash, author name and authoring date can all be individually toggled.</br>Hide everything, to only show the age-colored sidebar.`,r.addToggle(i=>i.setValue(this.settings.lineAuthor.show).onChange(n=>{this.configureLineAuthorShowStatus(n),this.refreshDisplayWithDelay()})),this.settings.lineAuthor.show){let i=new U.Setting(this.containerEl).setName("Follow movement and copies across files and commits").setDesc("").addDropdown(s=>{s.addOptions({inactive:"Do not follow (default)","same-commit":"Follow within same commit","all-commits":"Follow within all commits (maybe slow)"}),s.setValue(this.settings.lineAuthor.followMovement),s.onChange(a=>this.lineAuthorSettingHandler("followMovement",a))});if(i.descEl.innerHTML=`
|
||||||
|
By default (deactivated), each line only shows the newest commit where it was changed.
|
||||||
|
<br/>
|
||||||
|
With <i>same commit</i>, cut-copy-paste-ing of text is followed within the same commit and the original commit of authoring will be shown.
|
||||||
|
<br/>
|
||||||
|
With <i>all commits</i>, cut-copy-paste-ing text inbetween multiple commits will be detected.
|
||||||
|
<br/>
|
||||||
|
It uses <a href="https://git-scm.com/docs/git-blame">git-blame</a> and
|
||||||
|
for matches (at least ${Bd} characters) within the same (or all) commit(s), <em>the originating</em> commit's information is shown.`,new U.Setting(this.containerEl).setName("Show commit hash").addToggle(s=>{s.setValue(this.settings.lineAuthor.showCommitHash),s.onChange(a=>this.lineAuthorSettingHandler("showCommitHash",a))}),new U.Setting(this.containerEl).setName("Author name display").setDesc("If and how the author is displayed").addDropdown(s=>{let a={hide:"Hide",initials:"Initials (default)","first name":"First name","last name":"Last name",full:"Full name"};s.addOptions(a),s.setValue(this.settings.lineAuthor.authorDisplay),s.onChange(async o=>this.lineAuthorSettingHandler("authorDisplay",o))}),new U.Setting(this.containerEl).setName("Authoring date display").setDesc("If and how the date and time of authoring the line is displayed").addDropdown(s=>{let a={hide:"Hide",date:"Date (default)",datetime:"Date and time","natural language":"Natural language",custom:"Custom"};s.addOptions(a),s.setValue(this.settings.lineAuthor.dateTimeFormatOptions),s.onChange(async o=>{await this.lineAuthorSettingHandler("dateTimeFormatOptions",o),this.refreshDisplayWithDelay()})}),this.settings.lineAuthor.dateTimeFormatOptions==="custom"){let s=new U.Setting(this.containerEl);s.setName("Custom authoring date format").addText(a=>{a.setValue(this.settings.lineAuthor.dateTimeFormatCustomString),a.setPlaceholder("YYYY-MM-DD HH:mm"),a.onChange(async o=>{await this.lineAuthorSettingHandler("dateTimeFormatCustomString",o),s.descEl.innerHTML=this.previewCustomDateTimeDescriptionHtml(o)})}),s.descEl.innerHTML=this.previewCustomDateTimeDescriptionHtml(this.settings.lineAuthor.dateTimeFormatCustomString)}new U.Setting(this.containerEl).setName("Authoring date display timezone").addDropdown(s=>{let a={"viewer-local":"My local (default)","author-local":"Author's local",utc0000:"UTC+0000/Z"};s.addOptions(a),s.setValue(this.settings.lineAuthor.dateTimeTimezone),s.onChange(async o=>this.lineAuthorSettingHandler("dateTimeTimezone",o))}).descEl.innerHTML=`
|
||||||
|
The time-zone in which the authoring date should be shown.
|
||||||
|
Either your local time-zone (default),
|
||||||
|
the author's time-zone during commit creation or
|
||||||
|
<a href="https://en.wikipedia.org/wiki/UTC%C2%B100:00">UTC\xB100:00</a>.
|
||||||
|
`;let n=new U.Setting(this.containerEl).setName("Oldest age in coloring");n.descEl.innerHTML=this.previewOldestAgeDescriptionHtml(this.settings.lineAuthor.coloringMaxAge)[0],n.addText(s=>{s.setPlaceholder("1y"),s.setValue(this.settings.lineAuthor.coloringMaxAge),s.onChange(async a=>{let[o,l]=this.previewOldestAgeDescriptionHtml(a);n.descEl.innerHTML=o,l&&(await this.lineAuthorSettingHandler("coloringMaxAge",a),this.refreshColorSettingsName("oldest"))})}),this.createColorSetting("newest"),this.createColorSetting("oldest"),new U.Setting(this.containerEl).setName("Text color").addText(s=>{s.setValue(this.settings.lineAuthor.textColorCss),s.onChange(async a=>{await this.lineAuthorSettingHandler("textColorCss",a)})}).descEl.innerHTML=`
|
||||||
|
The CSS color of the gutter text.<br/>
|
||||||
|
|
||||||
|
It is highly recommended to use
|
||||||
|
<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties">
|
||||||
|
CSS variables</a>
|
||||||
|
defined by themes
|
||||||
|
(e.g. <pre style="display:inline">var(--text-muted)</pre> or
|
||||||
|
<pre style="display:inline">var(--text-on-accent)</pre>,
|
||||||
|
because they automatically adapt to theme changes.<br/>
|
||||||
|
|
||||||
|
See: <a href="https://github.com/obsidian-community/obsidian-theme-template/blob/main/obsidian.css">
|
||||||
|
List of available CSS variables in Obsidian
|
||||||
|
<a/>
|
||||||
|
`,new U.Setting(this.containerEl).setName("Ignore whitespace and newlines in changes").addToggle(s=>{s.setValue(this.settings.lineAuthor.ignoreWhitespace),s.onChange(a=>this.lineAuthorSettingHandler("ignoreWhitespace",a))}).descEl.innerHTML=`
|
||||||
|
Whitespace and newlines are interpreted as
|
||||||
|
part of the document and in changes
|
||||||
|
by default (hence not ignored).
|
||||||
|
This makes the last line being shown as 'changed'
|
||||||
|
when a new subsequent line is added,
|
||||||
|
even if the previously last line's text is the same.
|
||||||
|
<br>
|
||||||
|
If you don't care about purely-whitespace changes
|
||||||
|
(e.g. list nesting / quote indentation changes),
|
||||||
|
then activating this will provide more meaningful change detection.
|
||||||
|
`}}createColorSetting(r){let i=new U.Setting(this.containerEl).setName("").addText(n=>{let s=Y0(r,this.settings.lineAuthor),a=Y0(r,rt.lineAuthor);n.setPlaceholder(jw(a)),n.setValue(jw(s)),n.onChange(async o=>{let l=BP(o);if(l!==void 0){let c=r==="newest"?"colorNew":"colorOld";await this.lineAuthorSettingHandler(c,l)}this.refreshColorSettingsDesc(r,l)})});this.lineAuthorColorSettings.set(r,i),this.refreshColorSettingsName(r),this.refreshColorSettingsDesc(r,Y0(r,this.settings.lineAuthor))}refreshColorSettingsName(r){let i=this.lineAuthorColorSettings.get(r);if(i){let n=r==="oldest"?`oldest (${this.settings.lineAuthor.coloringMaxAge} or older)`:"newest";i.nameEl.innerText=`Color for ${n} commits`}}refreshColorSettingsDesc(r,i){let n=this.lineAuthorColorSettings.get(r);n&&(n.descEl.innerHTML=this.colorSettingPreviewDescHtml(r,this.settings.lineAuthor,i!==void 0))}colorSettingPreviewDescHtml(r,i,n){let s=n?ep(r,i):"rgba(127,127,127,0.3)",a=U.moment.unix(U.moment.now()/1e3).format("YYYY-MM-DD"),o=n?`abcdef Author Name ${a}`:"invalid color";return`Supports 'rgb(r,g,b)', 'hsl(h,s,l)', hex (#) and
|
||||||
|
named colors (e.g. 'black', 'purple'). Color preview: ${`<div
|
||||||
|
class="line-author-settings-preview"
|
||||||
|
style="background-color: ${s}; width: 30ch;"
|
||||||
|
>${o}</div>`}`}previewCustomDateTimeDescriptionHtml(r){let i=(0,U.moment)().format(r);return`<a href="${tV}">Format string</a> to display the authoring date.</br>Currently: ${i}`}previewOldestAgeDescriptionHtml(r){let i=qh(r);return[`The oldest age in the line author coloring. Everything older will have the same color.
|
||||||
|
</br>Smallest valid age is "1d". Currently: ${i!==void 0?`${i.asDays()} days`:"invalid!"}`,i]}setNonDefaultValue({settingsProperty:r,text:i}){let n=this.plugin.settings[r];rt[r]!==n&&(typeof n=="string"||typeof n=="number"||typeof n=="boolean"?i.setValue(String(n)):i.setValue(JSON.stringify(n)))}refreshDisplayWithDelay(r=80){setTimeout(()=>this.display(),r)}};function Y0(t,e){return t==="oldest"?e.colorOld:e.colorNew}function qh(t){let e=U.moment.duration("P"+t.toUpperCase());return e.isValid()&&e.asDays()&&e.asDays()>=1?e:void 0}p();var ti=require("obsidian");var ip=class{constructor(e,r){this.statusBarEl=e;this.plugin=r;this.messages=[];this.base="obsidian-git-statusbar-";this.statusBarEl.setAttribute("data-tooltip-position","top"),r.registerEvent(r.app.workspace.on("obsidian-git:refreshed",()=>{this.refreshCommitTimestamp().catch(console.error)}))}displayMessage(e,r){this.messages.push({message:`Git: ${e.slice(0,100)}`,timeout:r}),this.display()}display(){this.messages.length>0&&!this.currentMessage?(this.currentMessage=this.messages.shift(),this.statusBarEl.addClass(this.base+"message"),this.statusBarEl.ariaLabel="",this.statusBarEl.setText(this.currentMessage.message),this.lastMessageTimestamp=Date.now()):this.currentMessage?Date.now()-this.lastMessageTimestamp>=this.currentMessage.timeout&&(this.currentMessage=null,this.lastMessageTimestamp=null):this.displayState()}displayState(){switch((this.statusBarEl.getText().length>3||!this.statusBarEl.hasChildNodes())&&(this.statusBarEl.empty(),this.conflictEl=this.statusBarEl.createDiv(),this.conflictEl.setAttribute("data-tooltip-position","top"),this.conflictEl.style.float="left",this.pausedEl=this.statusBarEl.createDiv(),this.pausedEl.setAttribute("data-tooltip-position","top"),this.pausedEl.style.float="left",this.iconEl=this.statusBarEl.createDiv(),this.iconEl.style.float="left",this.textEl=this.statusBarEl.createDiv(),this.textEl.style.float="right",this.textEl.style.marginLeft="5px"),this.plugin.localStorage.getConflict()?((0,ti.setIcon)(this.conflictEl,"alert-circle"),this.conflictEl.ariaLabel="You have merge conflicts. Resolve them and commit afterwards.",this.conflictEl.style.marginRight="5px",this.conflictEl.addClass(this.base+"conflict")):(this.conflictEl.empty(),this.conflictEl.style.marginRight=""),this.plugin.localStorage.getPausedAutomatics()?((0,ti.setIcon)(this.pausedEl,"pause-circle"),this.pausedEl.ariaLabel="Automatic routines are currently paused.",this.pausedEl.style.marginRight="5px",this.pausedEl.addClass(this.base+"paused")):(this.pausedEl.empty(),this.pausedEl.style.marginRight=""),this.plugin.state.gitAction){case 0:this.displayFromNow();break;case 1:this.statusBarEl.ariaLabel="Checking repository status...",(0,ti.setIcon)(this.iconEl,"refresh-cw"),this.statusBarEl.addClass(this.base+"status");break;case 3:this.statusBarEl.ariaLabel="Adding files...",(0,ti.setIcon)(this.iconEl,"archive"),this.statusBarEl.addClass(this.base+"add");break;case 4:this.statusBarEl.ariaLabel="Committing changes...",(0,ti.setIcon)(this.iconEl,"git-commit"),this.statusBarEl.addClass(this.base+"commit");break;case 5:this.statusBarEl.ariaLabel="Pushing changes...",(0,ti.setIcon)(this.iconEl,"upload"),this.statusBarEl.addClass(this.base+"push");break;case 2:this.statusBarEl.ariaLabel="Pulling changes...",(0,ti.setIcon)(this.iconEl,"download"),this.statusBarEl.addClass(this.base+"pull");break;default:this.statusBarEl.ariaLabel="Failed on initialization!",(0,ti.setIcon)(this.iconEl,"alert-triangle"),this.statusBarEl.addClass(this.base+"failed-init");break}}displayFromNow(){var i;let e=this.lastCommitTimestamp,r=this.plugin.state.offlineMode;if(e){let n=(0,ti.moment)(e).fromNow();this.statusBarEl.ariaLabel=`${r?"Offline: ":""}Last Commit: ${n}`,(i=this.unPushedCommits)!=null&&i&&(this.statusBarEl.ariaLabel+=`
|
||||||
|
(${this.unPushedCommits} unpushed commits)`)}else this.statusBarEl.ariaLabel=r?"Git is offline":"Git is ready";r?(0,ti.setIcon)(this.iconEl,"globe"):(0,ti.setIcon)(this.iconEl,"check"),this.plugin.settings.changedFilesInStatusBar&&this.plugin.cachedStatus&&this.textEl.setText(this.plugin.cachedStatus.changed.length.toString()),this.statusBarEl.addClass(this.base+"idle")}async refreshCommitTimestamp(){this.lastCommitTimestamp=await this.plugin.gitManager.getLastCommitTime(),this.unPushedCommits=await this.plugin.gitManager.getUnpushedCommits()}remove(){this.statusBarEl.remove()}};p();var sp=require("obsidian"),np=class extends sp.SuggestModal{constructor(r){super(r.app);this.plugin=r;this.resolve=null;this.setPlaceholder("Type your message and select optional the version with the added date.")}openAndGetResult(){return new Promise(r=>{this.resolve=r,this.open()})}onClose(){new Promise(r=>setTimeout(r,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(r){let i=(0,sp.moment)().format(this.plugin.settings.commitDateFormat);return r==""&&(r="..."),[r,`${i}: ${r}`,`${r}: ${i}`]}renderSuggestion(r,i){i.innerText=r}onChooseSuggestion(r,i){this.resolve&&this.resolve(r)}};p();var gI=require("obsidian"),Du=class{constructor(e){this.plugin=e}saveLastAuto(e,r){r==="backup"?this.plugin.localStorage.setLastAutoBackup(e.toString()):r==="pull"?this.plugin.localStorage.setLastAutoPull(e.toString()):r==="push"&&this.plugin.localStorage.setLastAutoPush(e.toString())}loadLastAuto(){var e,r,i;return{backup:new Date((e=this.plugin.localStorage.getLastAutoBackup())!=null?e:""),pull:new Date((r=this.plugin.localStorage.getLastAutoPull())!=null?r:""),push:new Date((i=this.plugin.localStorage.getLastAutoPush())!=null?i:"")}}async init(){await this.setUpAutoCommitAndSync();let e=this.loadLastAuto();if(this.plugin.settings.differentIntervalCommitAndPush&&this.plugin.settings.autoPushInterval>0){let r=this.diff(this.plugin.settings.autoPushInterval,e.push);this.startAutoPush(r)}if(this.plugin.settings.autoPullInterval>0){let r=this.diff(this.plugin.settings.autoPullInterval,e.pull);this.startAutoPull(r)}}unload(){this.clearAutoPull(),this.clearAutoPush(),this.clearAutoCommitAndSync()}reload(...e){this.plugin.localStorage.getPausedAutomatics()||(e.contains("commit")&&(this.clearAutoCommitAndSync(),this.plugin.settings.autoSaveInterval>0&&this.startAutoCommitAndSync(this.plugin.settings.autoSaveInterval)),e.contains("push")&&(this.clearAutoPush(),this.plugin.settings.differentIntervalCommitAndPush&&this.plugin.settings.autoPushInterval>0&&this.startAutoPush(this.plugin.settings.autoPushInterval)),e.contains("pull")&&(this.clearAutoPull(),this.plugin.settings.autoPullInterval>0&&this.startAutoPull(this.plugin.settings.autoPullInterval)))}async setUpAutoCommitAndSync(){if(this.plugin.settings.setLastSaveToLastCommit){this.clearAutoCommitAndSync();let e=await this.plugin.gitManager.getLastCommitTime();e&&this.saveLastAuto(e,"backup")}if(!this.timeoutIDCommitAndSync&&!this.plugin.autoCommitDebouncer){let e=this.loadLastAuto();if(this.plugin.settings.autoSaveInterval>0){let r=this.diff(this.plugin.settings.autoSaveInterval,e.backup);this.startAutoCommitAndSync(r)}}}startAutoCommitAndSync(e){let r=(e!=null?e:this.plugin.settings.autoSaveInterval)*6e4;this.plugin.settings.autoBackupAfterFileChange?e===0?this.doAutoCommitAndSync():this.plugin.autoCommitDebouncer=(0,gI.debounce)(()=>this.doAutoCommitAndSync(),r,!0):(r>2147483647&&(r=2147483647),this.timeoutIDCommitAndSync=window.setTimeout(()=>this.doAutoCommitAndSync(),r))}doAutoCommitAndSync(){this.plugin.promiseQueue.addTask(async()=>{if(this.plugin.settings.setLastSaveToLastCommit){let r=await this.plugin.gitManager.getLastCommitTime();if(r){this.saveLastAuto(r,"backup");let i=this.diff(this.plugin.settings.autoSaveInterval,r);if(i>0)return this.startAutoCommitAndSync(i),!1}}let e=this.plugin.settings.autoCommitOnlyStaged;return this.plugin.settings.differentIntervalCommitAndPush?await this.plugin.commit({fromAuto:!0,onlyStaged:e}):await this.plugin.commitAndSync({fromAutoBackup:!0,onlyStaged:e}),!0},e=>{e!==!1&&(this.saveLastAuto(new Date,"backup"),this.startAutoCommitAndSync())})}startAutoPull(e){let r=(e!=null?e:this.plugin.settings.autoPullInterval)*6e4;r>2147483647&&(r=2147483647),this.timeoutIDPull=window.setTimeout(()=>this.doAutoPull(),r)}doAutoPull(){this.plugin.promiseQueue.addTask(()=>this.plugin.pullChangesFromRemote(),()=>{this.saveLastAuto(new Date,"pull"),this.startAutoPull()})}startAutoPush(e){let r=(e!=null?e:this.plugin.settings.autoPushInterval)*6e4;r>2147483647&&(r=2147483647),this.timeoutIDPush=window.setTimeout(()=>this.doAutoPush(),r)}doAutoPush(){this.plugin.promiseQueue.addTask(()=>this.plugin.push(),()=>{this.saveLastAuto(new Date,"push"),this.startAutoPush()})}clearAutoCommitAndSync(){var r;let e=!1;return this.timeoutIDCommitAndSync&&(window.clearTimeout(this.timeoutIDCommitAndSync),this.timeoutIDCommitAndSync=void 0,e=!0),this.plugin.autoCommitDebo
Line truncated
|
||||||
|
`)}static newName(){let e=SI[xI]||1;return SI[xI]=e+1,X0+e.toString(36)}static mount(e,r,i){let n=e[Z0],s=i&&i.nonce;n?s&&n.setNonce(s):n=new K0(e,s),n.mount(Array.isArray(r)?r:[r],e)}},EI=new Map,K0=class{constructor(e,r){let i=e.ownerDocument||e,n=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&n.CSSStyleSheet){let s=EI.get(i);if(s)return e[Z0]=s;this.sheet=new n.CSSStyleSheet,EI.set(i,this)}else this.styleTag=i.createElement("style"),r&&this.styleTag.setAttribute("nonce",r);this.modules=[],e[Z0]=this}mount(e,r){let i=this.sheet,n=0,s=0;for(let a=0;a<e.length;a++){let o=e[a],l=this.modules.indexOf(o);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),i)for(let c=0;c<o.rules.length;c++)i.insertRule(o.rules[c],n++)}else{for(;s<l;)n+=this.modules[s++].rules.length;n+=o.rules.length,s++}}if(i)r.adoptedStyleSheets.indexOf(this.sheet)<0&&(r.adoptedStyleSheets=[this.sheet,...r.adoptedStyleSheets]);else{let a="";for(let l=0;l<this.modules.length;l++)a+=this.modules[l].getRules()+`
|
||||||
|
`;this.styleTag.textContent=a;let o=r.head||r;this.styleTag.parentNode!=o&&o.insertBefore(this.styleTag,o.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var GI=require("@codemirror/language"),iV=require("@lezer/highlight"),_t=class t{constructor(e,r,i,n){this.fromA=e,this.toA=r,this.fromB=i,this.toB=n}offset(e,r=e){return new t(this.fromA+e,this.toA+e,this.fromB+r,this.toB+r)}};function Ba(t,e,r,i,n,s){if(t==i)return[];let a=sy(t,e,r,i,n,s),o=ay(t,e+a,r,i,n+a,s);e+=a,r-=o,n+=a,s-=o;let l=r-e,c=s-n;if(!l||!c)return[new _t(e,r,n,s)];if(l>c){let f=t.slice(e,r).indexOf(i.slice(n,s));if(f>-1)return[new _t(e,e+f,n,n),new _t(e+f+c,r,s,s)]}else if(c>l){let f=i.slice(n,s).indexOf(t.slice(e,r));if(f>-1)return[new _t(e,e,n,n+f),new _t(r,r,n+f+l,s)]}if(l==1||c==1)return[new _t(e,r,n,s)];let u=qI(t,e,r,i,n,s);if(u){let[f,d,h]=u;return Ba(t,e,f,i,n,d).concat(Ba(t,f+h,r,i,d+h,s))}return nV(t,e,r,i,n,s)}var Bu=1e9,Nu=0,ny=!1;function nV(t,e,r,i,n,s){let a=r-e,o=s-n;if(Bu<1e9&&Math.min(a,o)>Bu*16||Nu>0&&Date.now()>Nu)return Math.min(a,o)>Bu*64?[new _t(e,r,n,s)]:kI(t,e,r,i,n,s);let l=Math.ceil((a+o)/2);Q0.reset(l),J0.reset(l);let c=(h,m)=>t.charCodeAt(e+h)==i.charCodeAt(n+m),u=(h,m)=>t.charCodeAt(r-h-1)==i.charCodeAt(s-m-1),f=(a-o)%2!=0?J0:null,d=f?null:Q0;for(let h=0;h<l;h++){if(h>Bu||Nu>0&&!(h&63)&&Date.now()>Nu)return kI(t,e,r,i,n,s);let m=Q0.advance(h,a,o,l,f,!1,c)||J0.advance(h,a,o,l,d,!0,u);if(m)return sV(t,e,r,e+m[0],i,n,s,n+m[1])}return[new _t(e,r,n,s)]}var hp=class{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let r=0;r<this.len;r++)this.vec[r]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,r,i,n,s,a,o){for(let l=-e+this.start;l<=e-this.end;l+=2){let c=n+l,u=l==-e||l!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,f=u-l;for(;u<r&&f<i&&o(u,f);)u++,f++;if(this.vec[c]=u,u>r)this.end+=2;else if(f>i)this.start+=2;else if(s){let d=n+(r-i)-l;if(d>=0&&d<this.len&&s.vec[d]!=-1)if(a){let h=s.vec[d];if(h>=r-u)return[h,n+h-d]}else{let h=r-s.vec[d];if(u>=h)return[u,f]}}}return null}},Q0=new hp,J0=new hp;function sV(t,e,r,i,n,s,a,o){let l=!1;return!$l(t,i)&&++i==r&&(l=!0),!$l(n,o)&&++o==a&&(l=!0),l?[new _t(e,r,s,a)]:Ba(t,e,i,n,s,o).concat(Ba(t,i,r,n,o,a))}function jI(t,e){let r=1,i=Math.min(t,e);for(;r<i;)r=r<<1;return r}function sy(t,e,r,i,n,s){if(e==r||e==s||t.charCodeAt(e)!=i.charCodeAt(n))return 0;let a=jI(r-e,s-n);for(let o=e,l=n;;){let c=o+a,u=l+a;if(c>r||u>s||t.slice(o,c)!=i.slice(l,u)){if(a==1)return o-e-($l(t,o)?0:1);a=a>>1}else{if(c==r||u==s)return c-e;o=c,l=u}}}function ay(t,e,r,i,n,s){if(e==r||n==s||t.charCodeAt(r-1)!=i.charCodeAt(s-1))return 0;let a=jI(r-e,s-n);for(let o=r,l=s;;){let c=o-a,u=l-a;if(c<e||u<n||t.slice(c,o)!=i.slice(u,l)){if(a==1)return r-o-($l(t,o)?0:1);a=a>>1}else{if(c==e||u==n)return r-c;o=c,l=u}}}function ey(t,e,r,i,n,s,a,o){let l=i.slice(n,s),c=null;for(;;){if(c||a<o)return c;for(let u=e+a;;){$l(t,u)||u++;let f=u+a;if($l(t,f)||(f+=f==u+1?1:-1),f>=r)break;let d=t.slice(u,f),h=-1;for(;(h=l.indexOf(d,h+1))!=-1;){let m=sy(t,f,r,i,n+h+d.length,s),g=ay(t,e,u,i,n,n+h),v=d.length+m+g;(!c||c[2]<v)&&(c=[u-g,n+h-g,v])}u=f}if(o<0)return c;a=a>>1}}function qI(t,e,r,i,n,s){let a=r-e,o=s-n;if(a<o){let l=qI(i,n,s,t,e,r);return l&&[l[1],l[0],l[2]]}return a<4||o*2<a?null:ey(t,e,r,i,n,s,Math.floor(a/4),-1)}function kI(t,e,r,i,n,s){ny=!0;let a=r-e,o=s-n,l;if(a<o){let d=ey(i,n,s,t,e,r,Math.floor(a/6),50);l=d&&[d[1],d[0],d[2]]}else l=ey(t,e,r,i,n,s,Math.floor(o/6),50);if(!l)return[new _t(e,r,n,s)];let[c,u,f]=l;return Ba(t,e,c,i,n,u).concat(Ba(t,c+f,r,i,u+f,s))}function zI(t,e){for(let r=1;r<t.length;r++){let i=t[r-1],n=t[r];i.toA>n.fromA-e&&i.toB>n.fromB-e&&(t[r-1]=new _t(i.fromA,n.toA,i.fromB,n.toB),t.splice(r--,1))}}function aV(t,e,r){for(;;){zI(r,1);let i=!1;for(let n=0;n<r.length;n++){let s=r[n],a,o;(a=sy(t,s.fromA,s.toA,e,s.fromB,s.toB))&&(s=r[n]=new _t(s.fromA+a,s.toA,s.fromB+a,s.toB)),(o=ay(t,s.fromA,s.toA,e,s.fromB,s.toB))&&(s=r[n]=new _t(s.fromA,s.toA-o,s.fromB,s.toB-o));let l=s.toA-s.fromA,c=s.toB-s.fromB;if(l&&c)continue;let u=s.fromA-(n?r[n-1].toA:0),f=(n<r.length-1?r[n+1].fromA:t.length)-s.toA;if(!u||!f)continue;let d=l?t.slice(s.fromA,s.toA):e.slice(s.fromB,s.toB);u<=d.length&&t.slice(s.fromA-u,s.fromA)==d.slice(d.length-u)?(r[n]=new _t(s.fromA-u,s.toA-u,s.fromB-u,s.toB-u),i=!0):f<=d.length&&t.slice(s.toA,s.toA+f)==d.slice(0,f)&&(r[n]=new _t(s.fromA+f,s.toA+f,s.fromB+f,s.toB+f),i=!0)}if(!i)break}return r}function oV(t,e,r){for(let i=0,n=0;n<t.length;n++){let s=t[n],a=s.toA-s.fromA,o=s.toB-s.fromB;if(a&&o||a>3||o>3){let l=n==t.length-1?e.length:t[n+1].fromA,c=s.fromA-i,u=l-s.toA,f=TI(e,s.fromA,c),d=AI(e,s.toA,u),h=s.fromA-f,m=d-s.toA;if((!a||!o)&&h&&m){let g=Math.max(a,o),[v,w,b]=a?[e,s.fromA,s.toA]:[r,s.fromB,s.toB];g>h&&e.slice(f,s.fromA)==v.slice(b-h,b)?(s=t[n]=new _t(f,f+a,s.fromB-h,s.toB-h),f=s.fromA,d=AI(e,s.toA,l-s.toA)):g>m&&e.slice(s.toA,d)==v.slice(w,w+m)&&(s=t[n]=new _t(d-a,d,s.fromB+m,s.toB+m),d=s.
Line truncated
|
||||||
|
`),s=e.split(`
|
||||||
|
`);for(let a of r){let{oldStart:o,oldLines:l,newStart:c,newLines:u}=a,f=Nt.createHunk(o,l,c,u);if(a.oldLines>0){for(let d=o;d<o+l;d++)f.removed.lines.push(n[d-1]);o+l>n.length&&n.last()!=""&&(f.removed.no_nl_at_eof=!0)}if(a.newLines>0){for(let d=c;d<c+u;d++)f.added.lines.push(s[d-1]);c+u>s.length&&s.last()!=""&&(f.added.no_nl_at_eof=!0)}i.push(f)}return i}function uy(t,e,r){let i=e.lineAt(t.fromA).number,n=t.fromA==t.toA?0:gp(e,t.endA)-i+1,s=r.lineAt(t.fromB).number,a=t.fromB==t.toB?0:gp(r,t.endB)-s+1,o={oldStart:i,oldLines:n,newStart:s,newLines:a};return o.oldLines==0&&(o.oldStart-=1),o.newLines==0&&(o.newStart-=1),o}var rO={scanLimit:1e3,timeout:200};function SV(t,e,r,i){let n=ly.Text.of(t.split(`
|
||||||
|
`)),s=ly.Text.of(e.split(`
|
||||||
|
`)),a=r&&i?es.updateB(r,n,s,i,rO):es.build(n,s,rO),o=[];for(let l=0;l<a.length;l++){let c=a[l],u=uy(c,n,s);o.push(u)}return{hunks:cy(t,e,o),chunks:a}}function iO(t,e,r,i){return SV(t,e,r,i)}var Il=require("obsidian");function gp(t,e){let r=t.lineAt(e);return!(r.text.length==0&&r.number==t.lines)?r.number:r.number-1}var Bi=class{static hasHunksData(e){let r=e.field(Fr,!1);return!!r&&!r.isDirty}static getHunks(e,r){let i=e.field(Fr);return i?r?i.stagedHunks:i.hunks:[]}static getHunkAtPos(e,r,i){if(!e.field(Fr))return;let s=e.doc.lineAt(r).number,a=this.getHunks(e,i);return Nt.findHunk(s,a)[0]}static getCursorHunk(e,r){if(!e.field(Fr))return;let n=e.selection.main.head;return this.getHunkAtPos(e,n,r)}static getHunk(e,r,i){if(i!=null)return this.getHunkAtPos(e,i,r);if(e.selection.main.empty)return this.getCursorHunk(e,r);let n=e.selection.main.from,s=e.selection.main.to,a=e.doc.lineAt(n).number,o=gp(e.doc,s),l=this.getHunks(e,r),c=Nt.createPartialHunk(l,a,o);if(!c)return;let u=e.field(Fr);if(r){let f=a,d=o;for(let h of u.hunks)a>h.vend&&(f=f-(h.added.count-h.removed.count)),o>h.vend&&(d=d-(h.added.count-h.removed.count));c.added.lines=u.compareText.split(`
|
||||||
|
`).slice(f-1,d),u.compareTextHead?c.removed.lines=u.compareTextHead.split(`
|
||||||
|
`).slice(c.removed.start-1,c.removed.start-1+c.removed.count):c.removed.lines=[]}else c.added.lines=e.doc.toString().split(`
|
||||||
|
`).slice(a-1,o),o===e.doc.lines&&!e.doc.toString().endsWith(`
|
||||||
|
`)&&(c.added.no_nl_at_eof=!0),c.removed.lines=u.compareText.split(`
|
||||||
|
`).slice(c.removed.start-1,c.removed.start-1+c.removed.count),c.removed.start+c.removed.count-1===u.compareText.split(`
|
||||||
|
`).length&&!u.compareText.endsWith(`
|
||||||
|
`)&&(c.removed.no_nl_at_eof=!0);return c}},Fr=Fl.StateField.define({create:t=>{},update:(t,e)=>{let r=t?{...t}:{maxDiffTimeMs:0,hunks:[],stagedHunks:[],chunks:void 0,isDirty:!1},i=!1;for(let n of e.effects)n.is(Ol)&&(r.compareText=n.value.compareText,r.compareTextHead=n.value.compareTextHead,i=(t==null?void 0:t.compareText)!==n.value.compareText,i&&(r.chunks=void 0)),n.is(Uu)&&nO(r,n.value,e.state);if(r.compareText!==void 0){if(i||e.docChanged){r.isDirty=!0;let n=EV(e,r.compareText,r.chunks,r.maxDiffTimeMs);n&&nO(r,n,e.state)}}else r.compareText=void 0,r.compareTextHead=void 0,r.chunks=void 0,r.hunks=[],r.stagedHunks=[],r.isDirty=!1;return r}});function nO(t,e,r){var n,s;t.hunks=e.hunks,t.chunks=e.chunks,t.isDirty=!1,t.maxDiffTimeMs=Math.max(.95*t.maxDiffTimeMs,e.diffDuration);let i=r.field(Il.editorInfoField).file;(s=(n=Ii.plugin)==null?void 0:n.editorIntegration.signsFeature.changeStatusBar)==null||s.display(t.hunks,i)}var fy=Fl.StateField.define({create:()=>({debouncer:(0,Il.debounce)(t=>{let{state:e,compareText:r,previousChunks:i,changeDesc:n}=t,s=sO(e,r,i,n);e.field(Il.editorEditorField).dispatch({effects:Uu.of(s)})},1e3,!0),maxDiffTimeMs:0}),update:(t,e)=>{var r;for(let i of e.effects)if(i.is(Uu))return t.changeDesc=void 0,t;return!t.changeDesc&&e.changes?t.changeDesc=e.changes:t.changeDesc=(r=t.changeDesc)==null?void 0:r.composeDesc(e.changes),t}});function sO(t,e,r,i){let n=t.doc.toString(),s=performance.now(),{hunks:a,chunks:o}=iO(e,n,r,i),l=performance.now()-s;return{hunks:a,chunks:o,diffDuration:l}}function EV(t,e,r,i){let n=t.state,s=Math.abs(t.changes.length-t.changes.newLength),a=n.field(fy);if(s>1e3||i>16)a.debouncer({state:n,compareText:e,previousChunks:r,changeDesc:a.changeDesc});else return a.changeDesc=void 0,sO(n,e,r,t.changes)}var Ol=Fl.StateEffect.define(),Uu=Fl.StateEffect.define();function aO(t,e){return e.update({effects:Ol.of(t)})}p();p();p();var it;(function(t){t.INSERT="insert",t.DELETE="delete",t.CONTEXT="context"})(it||(it={}));var oO={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},lO={LINES:"lines",WORDS:"words",NONE:"none"},cO={WORD:"word",CHAR:"char"},Ha;(function(t){t.AUTO="auto",t.DARK="dark",t.LIGHT="light"})(Ha||(Ha={}));p();var kV=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],AV=RegExp("["+kV.join("\\")+"]","g");function uO(t){return t.replace(AV,"\\$&")}function dy(t){return t&&t.replace(/\\/g,"/")}function fO(t){let e,r,i,n=0;for(e=0,i=t.length;e<i;e++)r=t.charCodeAt(e),n=(n<<5)-n+r,n|=0;return n}function vp(t){let e=t.length,r=-1/0;for(let i=0;i<e;i++)r=Math.max(r,t[i]);return r}function dO(t,e){let r=t.split(".");return r.length>1?r[r.length-1]:e}function hO(t,e){return e.reduce((r,i)=>r||t.startsWith(i),!1)}var pO=["a/","b/","i/","w/","c/","o/"];function Vs(t,e,r){let i=r!==void 0?[...pO,r]:pO,n=e?new RegExp(`^${uO(e)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,s=""]=n.exec(t)||[],a=i.find(l=>s.indexOf(l)===0);return(a?s.slice(a.length):s).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function TV(t,e){return Vs(t,"---",e)}function CV(t,e){return Vs(t,"+++",e)}function mO(t,e={}){let r=[],i=null,n=null,s=null,a=null,o=null,l=null,c=null,u="--- ",f="+++ ",d="@@",h=/^old mode (\d{6})/,m=/^new mode (\d{6})/,g=/^deleted file mode (\d{6})/,v=/^new file mode (\d{6})/,w=/^copy from "?(.+)"?/,b=/^copy to "?(.+)"?/,k=/^rename from "?(.+)"?/,x=/^rename to "?(.+)"?/,E=/^similarity index (\d+)%/,A=/^dissimilarity index (\d+)%/,y=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,S=/^Binary files (.*) and (.*) differ/,_=/^GIT binary patch/,T=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,P=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,D=/^new file mode (\d{6})/,B=/^deleted file mode (\d{6}),(\d{6})/,N=t.replace(/\\ No newline at end of file/g,"").replace(/\r\n?/g,`
|
||||||
|
`).split(`
|
||||||
|
`);function ce(){n!==null&&i!==null&&(i.blocks.push(n),n=null)}function Pe(){i!==null&&(!i.oldName&&l!==null&&(i.oldName=l),!i.newName&&c!==null&&(i.newName=c),i.newName&&(r.push(i),i=null)),l=null,c=null}function ve(){ce(),Pe(),i={blocks:[],deletedLines:0,addedLines:0}}function se(z){ce();let Q;i!==null&&((Q=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(z))?(i.isCombined=!1,s=parseInt(Q[1],10),o=parseInt(Q[2],10)):(Q=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(z))?(i.isCombined=!0,s=parseInt(Q[1],10),a=parseInt(Q[2],10),o=parseInt(Q[3],10)):(z.startsWith(d)&&console.error("Failed to parse lines, starting in 0!"),s=0,o=0,i.isCombined=!1)),n={lines:[],oldStartLine:s,oldStartLine2:a,newStartLine:o,header:z}}function xe(z){if(i===null||n===null||s===null||o===null)return;let Q={content:z},j=i.isCombined?["+ "," +","++"]:["+"],Le=i.isCombined?["- "," -","--"]:["-"];hO(z,j)?(i.addedLines++,Q.type=it.INSERT,Q.oldNumber=void 0,Q.newNumber=o++):hO(z,Le)?(i.deletedLines++,Q.type=it.DELETE,Q.oldNumber=s++,Q.newNumber=void 0):(Q.type=it.CONTEXT,Q.oldNumber=s++,Q.newNumber=o++),n.lines.push(Q)}function we(z,Q){let j=Q;for(;j<N.length-3;){if(z.startsWith("diff"))return!1;if(N[j].startsWith(u)&&N[j+1].startsWith(f)&&N[j+2].startsWith(d))return!0;j++}return!1}return N.forEach((z,Q)=>{if(!z||z.startsWith("*"))return;let j,Le=N[Q-1],lr=N[Q+1],It=N[Q+2];if(z.startsWith("diff --git")||z.startsWith("diff --combined")){if(ve(),(j=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(z))&&(l=Vs(j[1],void 0,e.dstPrefix),c=Vs(j[2],void 0,e.srcPrefix)),i===null)throw new Error("Where is my file !!!");i.isGitDiff=!0;return}if(z.startsWith("Binary files")&&!(i!=null&&i.isGitDiff)){if(ve(),(j=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(z))&&(l=Vs(j[1],void 0,e.dstPrefix),c=Vs(j[2],void 0,e.srcPrefix)),i===null)throw new Error("Where is my file !!!");i.isBinary=!0;return}if((!i||!i.isGitDiff&&i&&z.startsWith(u)&&lr.startsWith(f)&&It.startsWith(d))&&ve(),i!=null&&i.isTooBig)return;if(i&&(typeof e.diffMaxChanges=="number"&&i.addedLines+i.deletedLines>e.diffMaxChanges||typeof e.diffMaxLineLength=="number"&&z.length>e.diffMaxLineLength)){i.isTooBig=!0,i.addedLines=0,i.deletedLines=0,i.blocks=[],n=null;let At=typeof e.diffTooBigMessage=="function"?e.diffTooBigMessage(r.length):"Diff too big to be displayed";se(At);return}if(z.startsWith(u)&&lr.startsWith(f)||z.startsWith(f)&&Le.startsWith(u)){if(i&&!i.oldName&&z.startsWith("--- ")&&(j=TV(z,e.srcPrefix))){i.oldName=j,i.language=dO(i.oldName,i.language);return}if(i&&!i.newName&&z.startsWith("+++ ")&&(j=CV(z,e.dstPrefix))){i.newName=j,i.language=dO(i.newName,i.language);return}}if(i&&(z.startsWith(d)||i.isGitDiff&&i.oldName&&i.newName&&!n)){se(z);return}if(n&&(z.startsWith("+")||z.startsWith("-")||z.startsWith(" "))){xe(z);return}let Fe=!we(z,Q);if(i===null)throw new Error("Where is my file !!!");(j=h.exec(z))?i.oldMode=j[1]:(j=m.exec(z))?i.newMode=j[1]:(j=g.exec(z))?(i.deletedFileMode=j[1],i.isDeleted=!0):(j=v.exec(z))?(i.newFileMode=j[1],i.isNew=!0):(j=w.exec(z))?(Fe&&(i.oldName=j[1]),i.isCopy=!0):(j=b.exec(z))?(Fe&&(i.newName=j[1]),i.isCopy=!0):(j=k.exec(z))?(Fe&&(i.oldName=j[1]),i.isRename=!0):(j=x.exec(z))?(Fe&&(i.newName=j[1]),i.isRename=!0):(j=S.exec(z))?(i.isBinary=!0,i.oldName=Vs(j[1],void 0,e.srcPrefix),i.newName=Vs(j[2],void 0,e.dstPrefix),se("Binary file")):_.test(z)?(i.isBinary=!0,se(z)):(j=E.exec(z))?i.unchangedPercentage=parseInt(j[1],10):(j=A.exec(z))?i.changedPercentage=parseInt(j[1],10):(j=y.exec(z))?(i.checksumBefore=j[1],i.checksumAfter=j[2],j[3]&&(i.mode=j[3])):(j=T.exec(z))?(i.checksumBefore=[j[2],j[3]],i.checksumAfter=j[1]):(j=P.exec(z))?(i.oldMode=[j[2],j[3]],i.newMode=j[1]):(j=D.exec(z))?(i.newFileMode=j[1],i.isNew=!0):(j=B.exec(z))&&(i.deletedFileMode=j[1],i.isDeleted=!0)}),ce(),Pe(),r}p();p();p();function RV(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let r=[],i;for(i=0;i<=e.length;i++)r[i]=[i];let n;for(n=0;n<=t.length;n++)r[0][n]=n;for(i=1;i<=e.length;i++)for(n=1;n<=t.length;n++)e.charAt(i-1)===t.charAt(n-1)?r[i][n]=r[i-1][n-1]:r[i][n]=Math.min(r[i-1][n-1]+1,Math.min(r[i][n-1]+1,r[i-1][n]+1));return r[e.length][t.length]}function Ml(t){return(e,r)=>{let i=t(e).trim(),n=t(r).trim();return RV(i,n)/(i.length+n.length)}}function Dl(t){function e(i,n,s=new Map){let a=1/0,o;for(let l=0;l<i.length;++l)for(let c=0;c<n.length;++c){let u=JSON.stringify([i[l],n[c]]),f;s.has(u)&&(f=s.get(u))||(f=t(i[l],n[c]),s.set(u,f)),f<a&&(a=f,o={indexA:l,indexB:c,score:a})}return o}function r(i,n,s=0,a=new Map){let o=e(i,n,a);if(!o||i.length+n.length<3)return[[i,n]];let l=i.slice(0,o.indexA),c=n.slice(0,o.indexB),u=[i[o.indexA]],f=[n[o.indexB]],d=o.indexA+1,h=o.indexB+1,m=i.slice(d),g=n.slice(h),v=r(l,c,s+1,a),w=r(u,f,s+1,a),b=r(m,g,s+1,a),k=w;return(o.indexA>0||o.indexB>0)&&(k=v.concat(k)),(i.length>d||n.length>h)&&(k=k.concat(b)),k}return r}var Vt={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:
Line truncated
|
||||||
|
`);return this.hoganUtils.render(vO,"wrapper",{colorScheme:Bl(this.config.colorScheme),filesNumber:e.length,files:r})}};p();var gy=Object.assign(Object.assign({},Ua),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Gu="generic",wO="line-by-line",LV="icon",BV="tag",ju=class{constructor(e,r={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},gy),r)}render(e){let r=e.map(i=>{let n;return i.blocks.length?n=this.generateFileHtml(i):n=this.generateEmptyDiff(),this.makeFileDiffHtml(i,n)}).join(`
|
||||||
|
`);return this.hoganUtils.render(Gu,"wrapper",{colorScheme:Bl(this.config.colorScheme),content:r})}makeFileDiffHtml(e,r){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let i=this.hoganUtils.template(wO,"file-diff"),n=this.hoganUtils.template(Gu,"file-path"),s=this.hoganUtils.template(LV,"file"),a=this.hoganUtils.template(BV,Hl(e));return i.render({file:e,fileHtmlId:Nl(e),diffs:r,filePath:n.render({fileDiffName:Ga(e)},{fileIcon:s,fileTag:a})})}generateEmptyDiff(){return this.hoganUtils.render(Gu,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:Vt})}generateFileHtml(e){let r=Dl(Ml(i=>yi(i.content,e.isCombined).content));return e.blocks.map(i=>{let n=this.hoganUtils.render(Gu,"block-header",{CSSLineClass:Vt,blockHeader:e.isTooBig?i.header:Ws(i.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(i).forEach(([s,a,o])=>{if(a.length&&o.length&&!s.length)this.applyRematchMatching(a,o,r).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e,e.isCombined,l,c);n+=u,n+=f});else if(s.length)s.forEach(l=>{let{prefix:c,content:u}=yi(l.content,e.isCombined);n+=this.generateSingleLineHtml(e,{type:Vt.CONTEXT,prefix:c,content:u,oldNumber:l.oldNumber,newNumber:l.newNumber})});else if(a.length||o.length){let{left:l,right:c}=this.processChangedLines(e,e.isCombined,a,o);n+=l,n+=c}else console.error("Unknown state reached while processing groups of lines",s,a,o)}),n}).join(`
|
||||||
|
`)}applyLineGroupping(e){let r=[],i=[],n=[];for(let s=0;s<e.lines.length;s++){let a=e.lines[s];(a.type!==it.INSERT&&n.length||a.type===it.CONTEXT&&i.length>0)&&(r.push([[],i,n]),i=[],n=[]),a.type===it.CONTEXT?r.push([[a],[],[]]):a.type===it.INSERT&&i.length===0?r.push([[],[],[a]]):a.type===it.INSERT&&i.length>0?n.push(a):a.type===it.DELETE&&i.push(a)}return(i.length||n.length)&&(r.push([[],i,n]),i=[],n=[]),r}applyRematchMatching(e,r,i){let n=e.length*r.length,s=vp(e.concat(r).map(o=>o.content.length));return n<this.config.matchingMaxComparisons&&s<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?i(e,r):[[e,r]]}processChangedLines(e,r,i,n){let s={right:"",left:""},a=Math.max(i.length,n.length);for(let o=0;o<a;o++){let l=i[o],c=n[o],u=l!==void 0&&c!==void 0?wp(l.content,c.content,r,this.config):void 0,f=l!==void 0&&l.oldNumber!==void 0?Object.assign(Object.assign({},u!==void 0?{prefix:u.oldLine.prefix,content:u.oldLine.content,type:Vt.DELETE_CHANGES}:Object.assign(Object.assign({},yi(l.content,r)),{type:Ll(l.type)})),{oldNumber:l.oldNumber,newNumber:l.newNumber}):void 0,d=c!==void 0&&c.newNumber!==void 0?Object.assign(Object.assign({},u!==void 0?{prefix:u.newLine.prefix,content:u.newLine.content,type:Vt.INSERT_CHANGES}:Object.assign(Object.assign({},yi(c.content,r)),{type:Ll(c.type)})),{oldNumber:c.oldNumber,newNumber:c.newNumber}):void 0,{left:h,right:m}=this.generateLineHtml(e,f,d);s.left+=h,s.right+=m}return s}generateLineHtml(e,r,i){return{left:this.generateSingleLineHtml(e,r),right:this.generateSingleLineHtml(e,i)}}generateSingleLineHtml(e,r){if(r===void 0)return"";let i=this.hoganUtils.render(wO,"numbers",{oldNumber:r.oldNumber||"",newNumber:r.newNumber||""});return this.hoganUtils.render(Gu,"line",{type:r.type,lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line",prefix:r.prefix===" "?" ":r.prefix,content:r.content,lineNumber:i,line:r,file:e})}};p();var vy=Object.assign(Object.assign({},Ua),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),qu="generic",NV="side-by-side",HV="icon",UV="tag",zu=class{constructor(e,r={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},vy),r)}render(e){let r=e.map(i=>{let n;return i.blocks.length?n=this.generateFileHtml(i):n=this.generateEmptyDiff(),this.makeFileDiffHtml(i,n)}).join(`
|
||||||
|
`);return this.hoganUtils.render(qu,"wrapper",{colorScheme:Bl(this.config.colorScheme),content:r})}makeFileDiffHtml(e,r){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let i=this.hoganUtils.template(NV,"file-diff"),n=this.hoganUtils.template(qu,"file-path"),s=this.hoganUtils.template(HV,"file"),a=this.hoganUtils.template(UV,Hl(e));return i.render({file:e,fileHtmlId:Nl(e),diffs:r,filePath:n.render({fileDiffName:Ga(e)},{fileIcon:s,fileTag:a})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(qu,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:Vt})}}generateFileHtml(e){let r=Dl(Ml(i=>yi(i.content,e.isCombined).content));return e.blocks.map(i=>{let n={left:this.makeHeaderHtml(i.header,e),right:this.makeHeaderHtml("")};return this.applyLineGroupping(i).forEach(([s,a,o])=>{if(a.length&&o.length&&!s.length)this.applyRematchMatching(a,o,r).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e.isCombined,l,c);n.left+=u,n.right+=f});else if(s.length)s.forEach(l=>{let{prefix:c,content:u}=yi(l.content,e.isCombined),{left:f,right:d}=this.generateLineHtml({type:Vt.CONTEXT,prefix:c,content:u,number:l.oldNumber},{type:Vt.CONTEXT,prefix:c,content:u,number:l.newNumber});n.left+=f,n.right+=d});else if(a.length||o.length){let{left:l,right:c}=this.processChangedLines(e.isCombined,a,o);n.left+=l,n.right+=c}else console.error("Unknown state reached while processing groups of lines",s,a,o)}),n}).reduce((i,n)=>({left:i.left+n.left,right:i.right+n.right}),{left:"",right:""})}applyLineGroupping(e){let r=[],i=[],n=[];for(let s=0;s<e.lines.length;s++){let a=e.lines[s];(a.type!==it.INSERT&&n.length||a.type===it.CONTEXT&&i.length>0)&&(r.push([[],i,n]),i=[],n=[]),a.type===it.CONTEXT?r.push([[a],[],[]]):a.type===it.INSERT&&i.length===0?r.push([[],[],[a]]):a.type===it.INSERT&&i.length>0?n.push(a):a.type===it.DELETE&&i.push(a)}return(i.length||n.length)&&(r.push([[],i,n]),i=[],n=[]),r}applyRematchMatching(e,r,i){let n=e.length*r.length,s=vp(e.concat(r).map(o=>o.content.length));return n<this.config.matchingMaxComparisons&&s<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?i(e,r):[[e,r]]}makeHeaderHtml(e,r){return this.hoganUtils.render(qu,"block-header",{CSSLineClass:Vt,blockHeader:r!=null&&r.isTooBig?e:Ws(e),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})}processChangedLines(e,r,i){let n={right:"",left:""},s=Math.max(r.length,i.length);for(let a=0;a<s;a++){let o=r[a],l=i[a],c=o!==void 0&&l!==void 0?wp(o.content,l.content,e,this.config):void 0,u=o!==void 0&&o.oldNumber!==void 0?Object.assign(Object.assign({},c!==void 0?{prefix:c.oldLine.prefix,content:c.oldLine.content,type:Vt.DELETE_CHANGES}:Object.assign(Object.assign({},yi(o.content,e)),{type:Ll(o.type)})),{number:o.oldNumber}):void 0,f=l!==void 0&&l.newNumber!==void 0?Object.assign(Object.assign({},c!==void 0?{prefix:c.newLine.prefix,content:c.newLine.content,type:Vt.INSERT_CHANGES}:Object.assign(Object.assign({},yi(l.content,e)),{type:Ll(l.type)})),{number:l.newNumber}):void 0,{left:d,right:h}=this.generateLineHtml(u,f);n.left+=d,n.right+=h}return n}generateLineHtml(e,r){return{left:this.generateSingleHtml(e),right:this.generateSingleHtml(r)}}generateSingleHtml(e){let r="d2h-code-side-linenumber",i="d2h-code-side-line";return this.hoganUtils.render(qu,"line",{type:(e==null?void 0:e.type)||`${Vt.CONTEXT} d2h-emptyplaceholder`,lineClass:e!==void 0?r:`${r} d2h-code-side-emptyplaceholder`,contentClass:e!==void 0?i:`${i} d2h-code-side-emptyplaceholder`,prefix:(e==null?void 0:e.prefix)===" "?" ":e==null?void 0:e.prefix,content:e==null?void 0:e.content,lineNumber:e==null?void 0:e.number})}};p();var _y=Mt(by());p();var xt=Mt(by()),wt={};wt["file-summary-line"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<li class="d2h-file-list-line">'),i.b(`
|
||||||
|
`+r),i.b(' <span class="d2h-file-name-wrapper">'),i.b(`
|
||||||
|
`+r),i.b(i.rp("<fileIcon0",t,e," ")),i.b(' <a href="#'),i.b(i.v(i.f("fileHtmlId",t,e,0))),i.b('" class="d2h-file-name">'),i.b(i.v(i.f("fileName",t,e,0))),i.b("</a>"),i.b(`
|
||||||
|
`+r),i.b(' <span class="d2h-file-stats">'),i.b(`
|
||||||
|
`+r),i.b(' <span class="d2h-lines-added">'),i.b(i.v(i.f("addedLines",t,e,0))),i.b("</span>"),i.b(`
|
||||||
|
`+r),i.b(' <span class="d2h-lines-deleted">'),i.b(i.v(i.f("deletedLines",t,e,0))),i.b("</span>"),i.b(`
|
||||||
|
`+r),i.b(" </span>"),i.b(`
|
||||||
|
`+r),i.b(" </span>"),i.b(`
|
||||||
|
`+r),i.b("</li>"),i.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}}},subs:{}});wt["file-summary-wrapper"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<div class="d2h-file-list-wrapper '),i.b(i.v(i.f("colorScheme",t,e,0))),i.b('">'),i.b(`
|
||||||
|
`+r),i.b(' <div class="d2h-file-list-header">'),i.b(`
|
||||||
|
`+r),i.b(' <span class="d2h-file-list-title">Files changed ('),i.b(i.v(i.f("filesNumber",t,e,0))),i.b(")</span>"),i.b(`
|
||||||
|
`+r),i.b(' <a class="d2h-file-switch d2h-hide">hide</a>'),i.b(`
|
||||||
|
`+r),i.b(' <a class="d2h-file-switch d2h-show">show</a>'),i.b(`
|
||||||
|
`+r),i.b(" </div>"),i.b(`
|
||||||
|
`+r),i.b(' <ol class="d2h-file-list">'),i.b(`
|
||||||
|
`+r),i.b(" "),i.b(i.t(i.f("files",t,e,0))),i.b(`
|
||||||
|
`+r),i.b(" </ol>"),i.b(`
|
||||||
|
`+r),i.b("</div>"),i.fl()},partials:{},subs:{}});wt["generic-block-header"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b("<tr>"),i.b(`
|
||||||
|
`+r),i.b(' <td class="'),i.b(i.v(i.f("lineClass",t,e,0))),i.b(" "),i.b(i.v(i.d("CSSLineClass.INFO",t,e,0))),i.b('"></td>'),i.b(`
|
||||||
|
`+r),i.b(' <td class="'),i.b(i.v(i.d("CSSLineClass.INFO",t,e,0))),i.b('">'),i.b(`
|
||||||
|
`+r),i.b(' <div class="'),i.b(i.v(i.f("contentClass",t,e,0))),i.b('">'),i.s(i.f("blockHeader",t,e,1),t,e,0,156,173,"{{ }}")&&(i.rs(t,e,function(n,s,a){a.b(a.t(a.f("blockHeader",n,s,0)))}),t.pop()),i.s(i.f("blockHeader",t,e,1),t,e,1,0,0,"")||i.b(" "),i.b("</div>"),i.b(`
|
||||||
|
`+r),i.b(" </td>"),i.b(`
|
||||||
|
`+r),i.b("</tr>"),i.fl()},partials:{},subs:{}});wt["generic-empty-diff"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b("<tr>"),i.b(`
|
||||||
|
`+r),i.b(' <td class="'),i.b(i.v(i.d("CSSLineClass.INFO",t,e,0))),i.b('">'),i.b(`
|
||||||
|
`+r),i.b(' <div class="'),i.b(i.v(i.f("contentClass",t,e,0))),i.b('">'),i.b(`
|
||||||
|
`+r),i.b(" File without changes"),i.b(`
|
||||||
|
`+r),i.b(" </div>"),i.b(`
|
||||||
|
`+r),i.b(" </td>"),i.b(`
|
||||||
|
`+r),i.b("</tr>"),i.fl()},partials:{},subs:{}});wt["generic-file-path"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<span class="d2h-file-name-wrapper">'),i.b(`
|
||||||
|
`+r),i.b(i.rp("<fileIcon0",t,e," ")),i.b(' <span class="d2h-file-name">'),i.b(i.v(i.f("fileDiffName",t,e,0))),i.b("</span>"),i.b(`
|
||||||
|
`+r),i.b(i.rp("<fileTag1",t,e," ")),i.b("</span>"),i.b(`
|
||||||
|
`+r),i.b('<label class="d2h-file-collapse">'),i.b(`
|
||||||
|
`+r),i.b(' <input class="d2h-file-collapse-input" type="checkbox" name="viewed" value="viewed">'),i.b(`
|
||||||
|
`+r),i.b(" Viewed"),i.b(`
|
||||||
|
`+r),i.b("</label>"),i.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}},"<fileTag1":{name:"fileTag",partials:{},subs:{}}},subs:{}});wt["generic-line"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b("<tr>"),i.b(`
|
||||||
|
`+r),i.b(' <td class="'),i.b(i.v(i.f("lineClass",t,e,0))),i.b(" "),i.b(i.v(i.f("type",t,e,0))),i.b('">'),i.b(`
|
||||||
|
`+r),i.b(" "),i.b(i.t(i.f("lineNumber",t,e,0))),i.b(`
|
||||||
|
`+r),i.b(" </td>"),i.b(`
|
||||||
|
`+r),i.b(' <td class="'),i.b(i.v(i.f("type",t,e,0))),i.b('">'),i.b(`
|
||||||
|
`+r),i.b(' <div class="'),i.b(i.v(i.f("contentClass",t,e,0))),i.b('">'),i.b(`
|
||||||
|
`+r),i.s(i.f("prefix",t,e,1),t,e,0,162,238,"{{ }}")&&(i.rs(t,e,function(n,s,a){a.b(' <span class="d2h-code-line-prefix">'),a.b(a.t(a.f("prefix",n,s,0))),a.b("</span>"),a.b(`
|
||||||
|
`+r)}),t.pop()),i.s(i.f("prefix",t,e,1),t,e,1,0,0,"")||(i.b(' <span class="d2h-code-line-prefix"> </span>'),i.b(`
|
||||||
|
`+r)),i.s(i.f("content",t,e,1),t,e,0,371,445,"{{ }}")&&(i.rs(t,e,function(n,s,a){a.b(' <span class="d2h-code-line-ctn">'),a.b(a.t(a.f("content",n,s,0))),a.b("</span>"),a.b(`
|
||||||
|
`+r)}),t.pop()),i.s(i.f("content",t,e,1),t,e,1,0,0,"")||(i.b(' <span class="d2h-code-line-ctn"><br></span>'),i.b(`
|
||||||
|
`+r)),i.b(" </div>"),i.b(`
|
||||||
|
`+r),i.b(" </td>"),i.b(`
|
||||||
|
`+r),i.b("</tr>"),i.fl()},partials:{},subs:{}});wt["generic-wrapper"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<div class="d2h-wrapper '),i.b(i.v(i.f("colorScheme",t,e,0))),i.b('">'),i.b(`
|
||||||
|
`+r),i.b(" "),i.b(i.t(i.f("content",t,e,0))),i.b(`
|
||||||
|
`+r),i.b("</div>"),i.fl()},partials:{},subs:{}});wt["icon-file-added"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<svg aria-hidden="true" class="d2h-icon d2h-added" height="16" title="added" version="1.1" viewBox="0 0 14 16"'),i.b(`
|
||||||
|
`+r),i.b(' width="14">'),i.b(`
|
||||||
|
`+r),i.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM6 9H3V7h3V4h2v3h3v2H8v3H6V9z"></path>'),i.b(`
|
||||||
|
`+r),i.b("</svg>"),i.fl()},partials:{},subs:{}});wt["icon-file-changed"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<svg aria-hidden="true" class="d2h-icon d2h-changed" height="16" title="modified" version="1.1"'),i.b(`
|
||||||
|
`+r),i.b(' viewBox="0 0 14 16" width="14">'),i.b(`
|
||||||
|
`+r),i.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM4 8c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3-3-1.34-3-3z"></path>'),i.b(`
|
||||||
|
`+r),i.b("</svg>"),i.fl()},partials:{},subs:{}});wt["icon-file-deleted"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<svg aria-hidden="true" class="d2h-icon d2h-deleted" height="16" title="removed" version="1.1"'),i.b(`
|
||||||
|
`+r),i.b(' viewBox="0 0 14 16" width="14">'),i.b(`
|
||||||
|
`+r),i.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM11 9H3V7h8v2z"></path>'),i.b(`
|
||||||
|
`+r),i.b("</svg>"),i.fl()},partials:{},subs:{}});wt["icon-file-renamed"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<svg aria-hidden="true" class="d2h-icon d2h-moved" height="16" title="renamed" version="1.1"'),i.b(`
|
||||||
|
`+r),i.b(' viewBox="0 0 14 16" width="14">'),i.b(`
|
||||||
|
`+r),i.b(' <path d="M6 9H3V7h3V4l5 4-5 4V9z m8-7v12c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h12c0.55 0 1 0.45 1 1z m-1 0H1v12h12V2z"></path>'),i.b(`
|
||||||
|
`+r),i.b("</svg>"),i.fl()},partials:{},subs:{}});wt["icon-file"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<svg aria-hidden="true" class="d2h-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12">'),i.b(`
|
||||||
|
`+r),i.b(' <path d="M6 5H2v-1h4v1zM2 8h7v-1H2v1z m0 2h7v-1H2v1z m0 2h7v-1H2v1z m10-7.5v9.5c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h7.5l3.5 3.5z m-1 0.5L8 2H1v12h10V5z"></path>'),i.b(`
|
||||||
|
`+r),i.b("</svg>"),i.fl()},partials:{},subs:{}});wt["line-by-line-file-diff"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<div id="'),i.b(i.v(i.f("fileHtmlId",t,e,0))),i.b('" class="d2h-file-wrapper" data-lang="'),i.b(i.v(i.d("file.language",t,e,0))),i.b('">'),i.b(`
|
||||||
|
`+r),i.b(' <div class="d2h-file-header">'),i.b(`
|
||||||
|
`+r),i.b(" "),i.b(i.t(i.f("filePath",t,e,0))),i.b(`
|
||||||
|
`+r),i.b(" </div>"),i.b(`
|
||||||
|
`+r),i.b(' <div class="d2h-file-diff">'),i.b(`
|
||||||
|
`+r),i.b(' <div class="d2h-code-wrapper">'),i.b(`
|
||||||
|
`+r),i.b(' <table class="d2h-diff-table">'),i.b(`
|
||||||
|
`+r),i.b(' <tbody class="d2h-diff-tbody">'),i.b(`
|
||||||
|
`+r),i.b(" "),i.b(i.t(i.f("diffs",t,e,0))),i.b(`
|
||||||
|
`+r),i.b(" </tbody>"),i.b(`
|
||||||
|
`+r),i.b(" </table>"),i.b(`
|
||||||
|
`+r),i.b(" </div>"),i.b(`
|
||||||
|
`+r),i.b(" </div>"),i.b(`
|
||||||
|
`+r),i.b("</div>"),i.fl()},partials:{},subs:{}});wt["line-by-line-numbers"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<div class="line-num1">'),i.b(i.v(i.f("oldNumber",t,e,0))),i.b("</div>"),i.b(`
|
||||||
|
`+r),i.b('<div class="line-num2">'),i.b(i.v(i.f("newNumber",t,e,0))),i.b("</div>"),i.fl()},partials:{},subs:{}});wt["side-by-side-file-diff"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<div id="'),i.b(i.v(i.f("fileHtmlId",t,e,0))),i.b('" class="d2h-file-wrapper" data-lang="'),i.b(i.v(i.d("file.language",t,e,0))),i.b('">'),i.b(`
|
||||||
|
`+r),i.b(' <div class="d2h-file-header">'),i.b(`
|
||||||
|
`+r),i.b(" "),i.b(i.t(i.f("filePath",t,e,0))),i.b(`
|
||||||
|
`+r),i.b(" </div>"),i.b(`
|
||||||
|
`+r),i.b(' <div class="d2h-files-diff">'),i.b(`
|
||||||
|
`+r),i.b(' <div class="d2h-file-side-diff">'),i.b(`
|
||||||
|
`+r),i.b(' <div class="d2h-code-wrapper">'),i.b(`
|
||||||
|
`+r),i.b(' <table class="d2h-diff-table">'),i.b(`
|
||||||
|
`+r),i.b(' <tbody class="d2h-diff-tbody">'),i.b(`
|
||||||
|
`+r),i.b(" "),i.b(i.t(i.d("diffs.left",t,e,0))),i.b(`
|
||||||
|
`+r),i.b(" </tbody>"),i.b(`
|
||||||
|
`+r),i.b(" </table>"),i.b(`
|
||||||
|
`+r),i.b(" </div>"),i.b(`
|
||||||
|
`+r),i.b(" </div>"),i.b(`
|
||||||
|
`+r),i.b(' <div class="d2h-file-side-diff">'),i.b(`
|
||||||
|
`+r),i.b(' <div class="d2h-code-wrapper">'),i.b(`
|
||||||
|
`+r),i.b(' <table class="d2h-diff-table">'),i.b(`
|
||||||
|
`+r),i.b(' <tbody class="d2h-diff-tbody">'),i.b(`
|
||||||
|
`+r),i.b(" "),i.b(i.t(i.d("diffs.right",t,e,0))),i.b(`
|
||||||
|
`+r),i.b(" </tbody>"),i.b(`
|
||||||
|
`+r),i.b(" </table>"),i.b(`
|
||||||
|
`+r),i.b(" </div>"),i.b(`
|
||||||
|
`+r),i.b(" </div>"),i.b(`
|
||||||
|
`+r),i.b(" </div>"),i.b(`
|
||||||
|
`+r),i.b("</div>"),i.fl()},partials:{},subs:{}});wt["tag-file-added"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),i.fl()},partials:{},subs:{}});wt["tag-file-changed"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),i.fl()},partials:{},subs:{}});wt["tag-file-deleted"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),i.fl()},partials:{},subs:{}});wt["tag-file-renamed"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),i.fl()},partials:{},subs:{}});var Vu=class{constructor({compiledTemplates:e={},rawTemplates:r={}}){let i=Object.entries(r).reduce((n,[s,a])=>{let o=_y.compile(a,{asString:!1});return Object.assign(Object.assign({},n),{[s]:o})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},wt),e),i)}static compile(e){return _y.compile(e,{asString:!1})}render(e,r,i,n,s){let a=this.templateKey(e,r);try{return this.preCompiledTemplates[a].render(i,n,s)}catch(o){throw new Error(`Could not find template to render '${a}'`)}}template(e,r){return this.preCompiledTemplates[this.templateKey(e,r)]}templateKey(e,r){return`${e}-${r}`}};var jV=Object.assign(Object.assign(Object.assign({},gy),vy),{outputFormat:oO.LINE_BY_LINE,drawFileList:!0});function _p(t,e={}){let r=Object.assign(Object.assign({},jV),e),i=typeof t=="string"?mO(t,r):t,n=new Vu(r),{colorScheme:s}=r,a={colorScheme:s},o=r.drawFileList?new yp(n,a).render(i):"",l=r.outputFormat==="side-by-side"?new zu(n,r).render(i):new ju(n,r).render(i);return o+l}var AO=Mt(EO());var ja=require("obsidian"),xy=Wu.StateEffect.define();function Ys(t,e){let r=t.state,i=r.field(Sp),n=r.field(Fr),s=r.doc.lineAt(e!=null?e:r.selection.main.head).number,a=Nt.findHunk(s,n==null?void 0:n.hunks)[0];if(!a)return;let o=r.doc.line(Math.max(1,a.added.start)).from,l=i.has(o);return r.field(ja.editorEditorField).dispatch({effects:xy.of({pos:o,add:!l})})}var Sp=Wu.StateField.define({create:()=>new Set,update(t,e){let r=new Set;for(let i of e.effects)i.is(xy)&&(i.value.add?t.add(i.value.pos):t.delete(i.value.pos));for(let i of t)r.add(e.changes.mapPos(i));return r}}),TO=Wu.StateField.define({create:t=>kO(t),update(t,e){return e.docChanged||e.effects.some(r=>r.is(Ol)||r.is(xy))?kO(e.state):t},provide:t=>xp.showTooltip.computeN([t],e=>e.field(t))}),CO=xp.EditorView.baseTheme({".cm-tooltip.git-diff-tooltip":{"z-index":"var(--layer-popover)",backgroundColor:"var(--background-primary-alt)",border:"var(--border-width) solid var(--background-primary-alt)",borderRadius:"var(--radius-s)"},".cm-tooltip.git-diff-tooltip .tooltip-toolbar":{display:"flex",padding:"var(--size-2-1)"}});function kO(t){let e=t.field(Fr);return e?[...t.field(Sp)].map(i=>{let n=t.doc.lineAt(i),s=Nt.findHunk(n.number,e.hunks)[0];if(s)return{pos:i,above:!1,arrow:!1,strictSide:!0,clip:!1,create:()=>qV(s,t,i)}}).filter(i=>i!==void 0):[]}function qV(t,e,r){var g,v;let i=Nt.createPatch("file",[t],"10064",!1).join(`
|
||||||
|
`)+`
|
||||||
|
`,n=_p(i,{colorScheme:AO.ColorSchemeType.AUTO,diffStyle:"word",drawFileList:!1}),s=new DOMParser().parseFromString(n,"text/html").querySelector(".d2h-file-diff"),a=document.createElement("div"),o=document.createElement("div");o.addClass("tooltip-toolbar");let l=(w,b)=>{let k=document.createElement("div");return(0,ja.setIcon)(k,w),k.setAttr("aria-label",b),k.addClass("clickable-icon"),k},c=l("x","Close hunk"),u=l("plus","Stage hunk"),f=l("undo","Reset hunk");o.appendChild(c),o.appendChild(u),o.appendChild(f),a.appendChild(o),a.appendChild(s),a.addClass("git-diff-tooltip","git-diff");let d=e.field(ja.editorEditorField);c.onclick=()=>{Ys(d,r)},u.onclick=()=>{let w=Ii.plugin;w&&(w.promiseQueue.addTask(()=>w.hunkActions.stageHunk(r)),Ys(d,r))},f.onclick=()=>{let w=Ii.plugin;w&&(w.hunkActions.resetHunk(r),Ys(d,r))};let h=(v=(g=Ii.plugin)==null?void 0:g.app.workspace.getActiveViewOfType(ja.MarkdownView))==null?void 0:v.scope,m=h==null?void 0:h.register(null,"Escape",(w,b)=>{Ys(d,r)});return{dom:a,destroy:()=>{m&&(h==null||h.unregister(m))},update:w=>{r=w.changes.mapPos(r)}}}function PO(t){let e=t.app;t.addCommand({id:"edit-gitignore",name:"Edit .gitignore",callback:async()=>{let r=t.gitManager.getRelativeVaultPath(".gitignore");await e.vault.adapter.exists(r)||await e.vault.adapter.write(r,"");let i=await e.vault.adapter.read(r),s=await new op(e,i).openAndGetReslt();s!==void 0&&(await e.vault.adapter.write(r,s),await t.refresh())}}),t.addCommand({id:"open-git-view",name:"Open source control view",callback:async()=>{var n;let r=e.workspace.getLeavesOfType(zt.type),i;r.length===0?(i=(n=e.workspace.getRightLeaf(!1))!=null?n:e.workspace.getLeaf(),await i.setViewState({type:zt.type})):i=r.first(),await e.workspace.revealLeaf(i),e.workspace.trigger("obsidian-git:refresh")}}),t.addCommand({id:"open-history-view",name:"Open history view",callback:async()=>{var n;let r=e.workspace.getLeavesOfType(gi.type),i;r.length===0?(i=(n=e.workspace.getRightLeaf(!1))!=null?n:e.workspace.getLeaf(),await i.setViewState({type:gi.type})):i=r.first(),await e.workspace.revealLeaf(i),e.workspace.trigger("obsidian-git:refresh")}}),t.addCommand({id:"open-diff-view",name:"Open diff view",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;{let n=t.gitManager.getRelativeRepoPath(i.path,!0);t.tools.openDiff({aFile:n,aRef:""})}}}),t.addCommand({id:"view-file-on-github",name:"Open file on GitHub",editorCallback:(r,{file:i})=>{if(i)return vI(r,i,t.gitManager)}}),t.addCommand({id:"view-history-on-github",name:"Open file history on GitHub",editorCallback:(r,{file:i})=>{if(i)return wI(i,t.gitManager)}}),t.addCommand({id:"pull",name:"Pull",callback:()=>t.promiseQueue.addTask(()=>t.pullChangesFromRemote())}),t.addCommand({id:"fetch",name:"Fetch",callback:()=>t.promiseQueue.addTask(()=>t.fetch())}),t.addCommand({id:"switch-to-remote-branch",name:"Switch to remote branch",callback:()=>t.promiseQueue.addTask(()=>t.switchRemoteBranch())}),t.addCommand({id:"add-to-gitignore",name:"Add file to .gitignore",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;t.addFileToGitignore(i.path,i instanceof Ni.TFolder).catch(n=>t.displayError(n))}}),t.addCommand({id:"push",name:"Commit-and-sync",callback:()=>t.promiseQueue.addTask(()=>t.commitAndSync({fromAutoBackup:!1}))}),t.addCommand({id:"backup-and-close",name:"Commit-and-sync and then close Obsidian",callback:()=>t.promiseQueue.addTask(async()=>{await t.commitAndSync({fromAutoBackup:!1}),window.close()})}),t.addCommand({id:"commit-push-specified-message",name:"Commit-and-sync with specific message",callback:()=>t.promiseQueue.addTask(()=>t.commitAndSync({fromAutoBackup:!1,requestCustomMessage:!0}))}),t.addCommand({id:"commit",name:"Commit all changes",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1}))}),t.addCommand({id:"commit-specified-message",name:"Commit all changes with specific message",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0}))}),t.addCommand({id:"commit-smart",name:"Commit",callback:()=>t.promiseQueue.addTask(async()=>{let i=(await t.updateCachedStatus()).staged.length>0;return t.commit({fromAuto:!1,requestCustomMessage:!1,onlyStaged:i})})}),t.addCommand({id:"commit-staged",name:"Commit staged",checkCallback:function(r){if(r)return!1;t.promiseQueue.addTask(async()=>t.commit({fromAuto:!1,requestCustomMessage:!1}))}}),Ni.Platform.isDesktopApp&&t.addCommand({id:"commit-amend-staged-specified-message",name:"Amend staged",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:!0,amend:!0}))}),t.addCommand({id:"commit-smart-specified-message",name:"Commit with specific message",callback:()=>t.promiseQueue.addTask(async()=>{let i=(await t.updateCachedStatus()).staged.length>0;return t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:i})})}),t.addCommand({id:"commit-staged-specified-message",name:"Commit staged with specific message",checkCallback:function(r){return
Line truncated
|
||||||
|
- ${s.map(o=>o.vaultPath).join(`
|
||||||
|
- `)}
|
||||||
|
Please remove them or add to .gitignore.`),!0}return!1}async writeAndOpenFile(e){e!==void 0&&await this.plugin.app.vault.adapter.write(al,e);let r=!1;this.plugin.app.workspace.iterateAllLeaves(i=>{i.getDisplayText()!=""&&al.startsWith(i.getDisplayText())&&(r=!0)}),r||await this.plugin.app.workspace.openLinkText(al,"/",!0)}openDiff({aFile:e,bFile:r,aRef:i,bRef:n,event:s}){var l,c;let a=this.plugin.settings.diffStyle;Ul.Platform.isMobileApp&&(a="git_unified");let o={aFile:e,bFile:r!=null?r:e,aRef:i,bRef:n};a=="split"?(l=Mi(this.plugin.app,s))==null||l.setViewState({type:Ls.type,active:!0,state:o}):a=="git_unified"&&((c=Mi(this.plugin.app,s))==null||c.setViewState({type:Bs.type,active:!0,state:o}))}async runRawCommand(){let e=this.plugin.gitManager;if(!(e instanceof Se))return;let i=await new Qe(this.plugin,{placeholder:"push origin master",allowEmpty:!1}).openAndGetResult();i!==void 0&&this.plugin.promiseQueue.addTask(async()=>{let n=new Ul.Notice(`Running '${i}'...`,999999);try{let s=await e.rawCommand(i);s?(n.setMessage(s),window.setTimeout(()=>n.hide(),5e3)):n.hide()}catch(s){throw n.hide(),s}})}};p();var kp=require("obsidian");var qa=class extends kp.ItemView{constructor(r,i){super(r);this.plugin=i;this.gettingDiff=!1;this.parser=new DOMParser,this.navigation=!0,this.contentEl.addClass("git-diff"),this.gitRefreshRef=this.app.workspace.on("obsidian-git:status-changed",()=>{this.refresh().catch(console.error)})}getViewType(){return Bs.type}getDisplayText(){var r;if(((r=this.state)==null?void 0:r.bFile)!=null){let i=this.state.bFile.split("/").last();return i!=null&&i.endsWith(".md")&&(i=i.slice(0,-3)),`Diff: ${i}`}return Bs.name}getIcon(){return Bs.icon}async setState(r,i){this.state=r,kp.Platform.isMobile&&(this.leaf.view.titleEl.textContent=this.getDisplayText()),await this.refresh()}getState(){return this.state}onClose(){return this.app.workspace.offref(this.gitRefreshRef),this.app.workspace.offref(this.gitViewRefreshRef),super.onClose()}async onOpen(){return await this.refresh(),super.onOpen()}async refresh(){var r;if((r=this.state)!=null&&r.bFile&&!this.gettingDiff&&this.plugin.gitManager){this.gettingDiff=!0;try{let i=await this.plugin.gitManager.getDiffString(this.state.bFile,this.state.aRef=="HEAD",this.state.bRef);this.contentEl.empty();let n=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);if(!i){if(this.plugin.gitManager instanceof Se&&await this.plugin.gitManager.isTracked(this.state.bFile))i=[`--- ${this.state.aFile}`,`+++ ${this.state.bFile}`,""].join(`
|
||||||
|
`);else if(await this.app.vault.adapter.exists(n)){let s=await this.app.vault.adapter.read(n);i=[...`--- /dev/null
|
||||||
|
+++ ${this.state.bFile}
|
||||||
|
@@ -0,0 +1,${s.split(`
|
||||||
|
`).length} @@`.split(`
|
||||||
|
`),...s.split(`
|
||||||
|
`).map(o=>`+${o}`)].join(`
|
||||||
|
`)}}if(i){let s=this.parser.parseFromString(_p(i),"text/html").querySelector(".d2h-file-diff");this.contentEl.append(s)}else{let s=this.contentEl.createDiv({cls:"obsidian-git-center"});s.createSpan({text:"\u26A0\uFE0F",attr:{style:"font-size: 2em"}}),s.createEl("br"),s.createSpan({text:"File not found: "+this.state.bFile})}}finally{this.gettingDiff=!1}}}};p();var ts=require("obsidian");var jl=require("@codemirror/commands");var Ap=require("@codemirror/search"),Gl=require("@codemirror/state"),_i=require("@codemirror/view");var za=class extends ts.ItemView{constructor(r,i){super(r);this.plugin=i;this.refreshing=!1;this.ignoreNextModification=!1;this.navigation=!0,this.registerEvent(this.app.workspace.on("obsidian-git:status-changed",()=>{this.mergeView?this.updateRefEditors().catch(console.error):this.createMergeView().catch(console.error)})),this.intervalRef=window.setInterval(()=>{this.mergeView&&this.updateRefEditors().catch(console.error)},30*1e3),this.registerEvent(this.app.vault.on("modify",n=>{this.state.bRef==null&&n.path===this.state.bFile&&(this.ignoreNextModification?this.ignoreNextModification=!1:this.updateModifiableEditor().catch(console.error))})),this.registerEvent(this.app.vault.on("delete",n=>{this.state.bRef==null&&n.path===this.state.bFile&&this.createMergeView().catch(console.error)})),this.registerEvent(this.app.vault.on("create",n=>{this.state.bRef==null&&n.path===this.state.bFile&&this.createMergeView().catch(console.error)})),this.registerEvent(this.app.vault.on("rename",(n,s)=>{this.state.bRef==null&&(n.path===this.state.bFile||s===this.state.bFile)&&this.createMergeView().catch(console.error)})),this.fileSaveDebouncer=(0,ts.debounce)(n=>{let s=this.state.bFile;s&&(this.ignoreNextModification=!0,this.plugin.app.vault.adapter.write(this.plugin.gitManager.getRelativeVaultPath(s),n).catch(a=>this.plugin.displayError(a)))},1e3,!1)}getViewType(){return Ls.type}getDisplayText(){var r;if(((r=this.state)==null?void 0:r.bFile)!=null){let i=this.state.bFile.split("/").last();i!=null&&i.endsWith(".md")&&(i=i.slice(0,-3));let n;return this.state.bRef==null?n=" (Working Tree)":this.state.bRef==""?n=" (Index)":n="("+this.state.bRef.substring(0,7)+")",`Diff: ${i} ${n}`}return Ls.name}getIcon(){return Ls.icon}async setState(r,i){this.state=r,ts.Platform.isMobile&&(this.leaf.view.titleEl.textContent=this.getDisplayText()),await super.setState(r,i),await this.createMergeView()}getState(){return this.state}onClose(){return window.clearInterval(this.intervalRef),super.onClose()}async onOpen(){return await this.createMergeView(),super.onOpen()}async gitShow(r,i){try{return await this.plugin.gitManager.show(r,i,!1)}catch(n){if(n instanceof Rr&&(n.message.includes("does not exist")||n.message.includes("unknown revision or path")||n.message.includes("exists on disk, but not in")||n.message.includes("fatal: bad object")))return n.message.includes("fatal: bad object")&&this.plugin.displayError(n.message),"";throw n}}async bShouldBeEditable(){if(this.state.bRef!=null)return!1;let r=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);return await this.app.vault.adapter.exists(r)}async updateModifiableEditor(){if(!this.mergeView||this.refreshing)return;let r=this.mergeView.b;this.refreshing=!0;let i=await this.app.vault.adapter.read(this.state.bFile);if(i!=r.state.doc.toString()){let n=r.state.update({changes:{from:0,to:r.state.doc.length,insert:i},annotations:[Gl.Transaction.remote.of(!0)]});r.dispatch(n)}this.refreshing=!1}async updateRefEditors(){if(!this.mergeView||this.refreshing)return;let r=this.mergeView.a,i=this.mergeView.b;this.refreshing=!0;let n=await this.gitShow(this.state.aRef,this.state.aFile),s;if(this.state.bRef!=null&&(s=await this.gitShow(this.state.bRef,this.state.bFile)),n!=r.state.doc.toString()){let a=r.state.update({changes:{from:0,to:r.state.doc.length,insert:n}});r.dispatch(a)}if(s!=null&&s!=i.state.doc.toString()){let a=i.state.update({changes:{from:0,to:i.state.doc.length,insert:s}});i.dispatch(a)}this.refreshing=!1}renderButtons(){let r=document.createElement("div"),i=r.createDiv();if(i.addClass("clickable-icon"),i.setAttr("aria-label",this.state.bRef==null?"Stage hunk":"Unstage hunk"),(0,ts.setIcon)(i,this.state.bRef==null?"plus":"minus"),i.onmousedown=async n=>{var h;let s=this.mergeView.b,a=this.mergeView.a,o=oy(s.state),l=(h=r.parentElement)==null?void 0:h.indexOf(r),c=o.chunks[l],u=uy(c,a.state.doc,s.state.doc),f=cy(this.mergeView.a.state.doc.toString(),this.mergeView.b.state.doc.toString(),[u])[0],d=Nt.createPatch(this.state.bFile,[f],"100644",this.state.bRef!=null).join(`
|
||||||
|
`)+`
|
||||||
|
`;await this.plugin.gitManager.applyPatch(d),this.plugin.app.workspace.trigger("obsidian-git:refresh")},this.state.bRef==null){let n=r.createDiv();n.addClass("clickable-icon"),n.setAttr("aria-label","Reset hunk"),(0,ts.setIcon)(n,"undo"),n.onmousedown=s=>{var f;let a=this.mergeView.a,o=this.mergeView.b,l=oy(o.state),c=(f=r.parentElement)==null?void 0:f.indexOf(r),u=l.chunks[c];if(u){let d=u.fromA,h=u.toA,m=u.fromB,g=u.toB,v=a.state.sliceDoc(d,Math.max(d,h-1));d!=h&&g<=o.state.doc.length&&(v+=a.state.lineBreak),o.dispatch({changes:{from:m,to:Math.min(o.state.doc.length,g),insert:v},userEvent:"revert"})}}}return r.onmousedown=n=>{n.preventDefault(),n.stopPropagation()},r}async createMergeView(){var r,i,n;if((r=this.state)!=null&&r.aFile&&((i=this.state)!=null&&i.bFile)&&!this.refreshing&&this.plugin.gitManager){this.refreshing=!0,(n=this.mergeView)==null||n.destroy();let s=this.containerEl.children[1];s.empty(),this.contentEl.addClass("git-split-diff-view","git-diff"),this.bIsEditable=await this.bShouldBeEditable();let a=await this.gitShow(this.state.aRef,this.state.aFile),o;if(this.state.bRef!=null)o=await this.gitShow(this.state.bRef,this.state.bFile);else{let g=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);await this.app.vault.adapter.exists(g)?o=await this.app.vault.adapter.read(g):o=""}let l=[(0,_i.lineNumbers)(),(0,Ap.highlightSelectionMatches)(),(0,_i.drawSelection)(),_i.keymap.of([...jl.standardKeymap,jl.indentWithTab]),(0,jl.history)(),(0,Ap.search)(),_i.EditorView.lineWrapping],c=this,u=_i.ViewPlugin.define(g=>({update(v){if(v.docChanged&&!v.transactions.some(w=>w.annotation(Gl.Transaction.remote))){let w=g.state.doc.toString();c.fileSaveDebouncer(w)}}})),f={doc:a,extensions:[...l,_i.EditorView.editable.of(!1),Gl.EditorState.readOnly.of(!0)]},d=[...l];this.bIsEditable?d.push(u):d.push(_i.EditorView.editable.of(!1),Gl.EditorState.readOnly.of(!0));let h={doc:o,extensions:d};s.addClasses(["cm-s-obsidian","mod-cm6","markdown-source-view","cm-content"]);let m=this.plugin.gitManager instanceof Se&&(this.state.bRef===void 0||this.state.bRef==="");this.mergeView=new mp({b:h,a:f,collapseUnchanged:{minSize:6,margin:4},renderRevertControl:m?()=>this.renderButtons():void 0,revertControls:m?"a-to-b":void 0,diffConfig:{scanLimit:this.bIsEditable?1e3:1e4},parent:s}),this.refreshing=!1}}};p();var aD=require("obsidian");p();p();p();var RO="5";var $O,FO,IO;typeof window!="undefined"&&((IO=(FO=($O=window.__svelte)!=null?$O:window.__svelte={}).v)!=null?IO:FO.v=new Set).add(RO);p();p();p();var Xu="[",wn="[!",Va="]",rs={};var Je=Symbol(),xi=Symbol("filename"),OO=Symbol("hmr"),MO="http://www.w3.org/1999/xhtml";p();p();p();p();var Tp=!0;p();var M=!1;p();var is=Array.isArray,DO=Array.prototype.indexOf,Hi=Array.prototype.includes,ql=Array.from,Sy=Object.keys,tr=Object.defineProperty,Ir=Object.getOwnPropertyDescriptor,Ey=Object.getOwnPropertyDescriptors,ky=Object.prototype,LO=Array.prototype,zl=Object.getPrototypeOf,Ay=Object.isExtensible;function Ty(t){return typeof t=="function"}var Or=()=>{};function Cp(t){for(var e=0;e<t.length;e++)t[e]()}function Pp(){var t,e,r=new Promise((i,n)=>{t=i,e=n});return{promise:r,resolve:t,reject:e}}p();p();var Wt=Symbol("$state"),Zu=Symbol("legacy props"),BO=Symbol(""),Rp=Symbol("proxy path"),yn=new class extends Error{constructor(){super(...arguments);ze(this,"name","StaleReactionError");ze(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var Vl=3,Mr=8;p();p();function $p(t){if(M){let e=new Error(`lifecycle_outside_component
|
||||||
|
\`${t}(...)\` can only be used during component initialisation
|
||||||
|
https://svelte.dev/e/lifecycle_outside_component`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function NO(){if(M){let t=new Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function Cy(){if(M){let t=new Error("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/bind_invalid_checkbox_value")}function HO(){if(M){let t=new Error(`derived_references_self
|
||||||
|
A derived value cannot reference itself recursively
|
||||||
|
https://svelte.dev/e/derived_references_self`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/derived_references_self")}function Py(t,e,r){if(M){let i=new Error(`each_key_duplicate
|
||||||
|
${r?`Keyed each block has duplicate key \`${r}\` at indexes ${t} and ${e}`:`Keyed each block has duplicate key at indexes ${t} and ${e}`}
|
||||||
|
https://svelte.dev/e/each_key_duplicate`);throw i.name="Svelte error",i}else throw new Error("https://svelte.dev/e/each_key_duplicate")}function UO(t){if(M){let e=new Error(`effect_in_teardown
|
||||||
|
\`${t}\` cannot be used inside an effect cleanup function
|
||||||
|
https://svelte.dev/e/effect_in_teardown`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function GO(){if(M){let t=new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function jO(t){if(M){let e=new Error(`effect_orphan
|
||||||
|
\`${t}\` can only be used inside an effect (e.g. during component initialisation)
|
||||||
|
https://svelte.dev/e/effect_orphan`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_orphan")}function qO(){if(M){let t=new Error(`effect_update_depth_exceeded
|
||||||
|
Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
|
||||||
|
https://svelte.dev/e/effect_update_depth_exceeded`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function zO(){if(M){let t=new Error(`hydration_failed
|
||||||
|
Failed to hydrate the application
|
||||||
|
https://svelte.dev/e/hydration_failed`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/hydration_failed")}function VO(t){if(M){let e=new Error(`props_invalid_value
|
||||||
|
Cannot do \`bind:${t}={undefined}\` when \`${t}\` has a fallback value
|
||||||
|
https://svelte.dev/e/props_invalid_value`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/props_invalid_value")}function WO(t){if(M){let e=new Error(`rune_outside_svelte
|
||||||
|
The \`${t}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
|
||||||
|
https://svelte.dev/e/rune_outside_svelte`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function YO(){if(M){let t=new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function XO(){if(M){let t=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function ZO(){if(M){let t=new Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function KO(){if(M){let t=new Error("svelte_boundary_reset_onerror\nA `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}p();p();p();var Xs="font-weight: bold",Zs="font-weight: normal";function QO(t,e){M?console.warn(`%c[svelte] await_waterfall
|
||||||
|
%cAn async derived, \`${t}\` (${e}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app
|
||||||
|
https://svelte.dev/e/await_waterfall`,Xs,Zs):console.warn("https://svelte.dev/e/await_waterfall")}function JO(t,e,r){M?console.warn(`%c[svelte] hydration_attribute_changed
|
||||||
|
%cThe \`${t}\` attribute on \`${e}\` changed its value between server and client renders. The client value, \`${r}\`, will be ignored in favour of the server value
|
||||||
|
https://svelte.dev/e/hydration_attribute_changed`,Xs,Zs):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function Wa(t){M?console.warn(`%c[svelte] hydration_mismatch
|
||||||
|
%c${t?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${t}`:"Hydration failed because the initial UI does not match what was rendered on the server"}
|
||||||
|
https://svelte.dev/e/hydration_mismatch`,Xs,Zs):console.warn("https://svelte.dev/e/hydration_mismatch")}function eM(){M?console.warn(`%c[svelte] lifecycle_double_unmount
|
||||||
|
%cTried to unmount a component that was not mounted
|
||||||
|
https://svelte.dev/e/lifecycle_double_unmount`,Xs,Zs):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function Fp(t){M?console.warn(`%c[svelte] state_proxy_equality_mismatch
|
||||||
|
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${t}\` will produce unexpected results
|
||||||
|
https://svelte.dev/e/state_proxy_equality_mismatch`,Xs,Zs):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function tM(){M?console.warn(`%c[svelte] state_proxy_unmount
|
||||||
|
%cTried to unmount a state proxy, rather than a component
|
||||||
|
https://svelte.dev/e/state_proxy_unmount`,Xs,Zs):console.warn("https://svelte.dev/e/state_proxy_unmount")}function rM(){M?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `<svelte:boundary>` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",Xs,Zs):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function iM(t){M?console.warn(`%c[svelte] transition_slide_display
|
||||||
|
%cThe \`slide\` transition does not work correctly for elements with \`display: ${t}\`
|
||||||
|
https://svelte.dev/e/transition_slide_display`,Xs,Zs):console.warn("https://svelte.dev/e/transition_slide_display")}var ie=!1;function Ht(t){ie=t}var ge;function je(t){if(t===null)throw Wa(),rs;return ge=t}function rr(){return je(Zt(ge))}function H(t){if(ie){if(Zt(ge)!==null)throw Wa(),rs;ge=t}}function Ya(t=1){if(ie){for(var e=t,r=ge;e--;)r=Zt(r);ge=r}}function ns(t=!0){for(var e=0,r=ge;;){if(r.nodeType===Mr){var i=r.data;if(i===Va){if(e===0)return r;e-=1}else(i===Xu||i===wn)&&(e+=1)}var n=Zt(r);t&&r.remove(),r=n}}function Ip(t){if(!t||t.nodeType!==Mr)throw Wa(),rs;return t.data}p();p();p();p();function Op(t){return t===this.v}function Ry(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Mp(t){return!Ry(t,this.v)}p();var ir=!1,ss=!1,Ui=!1;p();p();p();var Ku=null;function Dr(t,e){return t.label=e,Dp(t.v,e),t}function Dp(t,e){var r;return(r=t==null?void 0:t[Rp])==null||r.call(t,e),t}p();function bn(t){let e=new Error,r=VV();return r.length===0?null:(r.unshift(`
|
||||||
|
`),tr(e,"stack",{value:r.join(`
|
||||||
|
`)}),tr(e,"name",{value:t}),e)}function VV(){let t=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let e=new Error().stack;if(Error.stackTraceLimit=t,!e)return[];let r=e.split(`
|
||||||
|
`),i=[];for(let n=0;n<r.length;n++){let s=r[n],a=s.replaceAll("\\","/");if(s.trim()!=="Error"){if(s.includes("validate_each_keys"))return[];a.includes("svelte/src/internal")||a.includes("node_modules/.vite")||i.push(s)}}return i}p();var ke=null;function as(t){ke=t}var _n=null;function Wl(t){_n=t}var Gi=null;function Lp(t){Gi=t}function ot(t,e=!1,r){ke={p:ke,i:!1,c:null,e:null,s:t,x:null,l:ss&&!e?{s:null,u:null,$:[]}:null},M&&(ke.function=r,Gi=r)}function lt(t){var n;var e=ke,r=e.e;if(r!==null){e.e=null;for(var i of r)Fy(i)}return t!==void 0&&(e.x=t),e.i=!0,ke=e.p,M&&(Gi=(n=ke==null?void 0:ke.function)!=null?n:null),t!=null?t:{}}function xn(){return!ss||ke!==null&&ke.l===null}p();p();var Xa=[];function sM(){var t=Xa;Xa=[],Cp(t)}function yt(t){if(Xa.length===0&&!Za){var e=Xa;queueMicrotask(()=>{e===Xa&&sM()})}Xa.push(t)}function aM(){for(;Xa.length>0;)sM()}p();var Iy=new WeakMap;function Bp(t){var e=ne;if(e===null)return le.f|=8388608,t;if(M&&t instanceof Error&&!Iy.has(t)&&Iy.set(t,WV(t,e)),e.f&32768)En(t,e);else{if(!(e.f&128))throw M&&!e.parent&&t instanceof Error&&oM(t),t;e.b.error(t)}}function En(t,e){for(;e!==null;){if(e.f&128)try{e.b.error(t);return}catch(r){t=r}e=e.parent}throw M&&t instanceof Error&&oM(t),t}function WV(t,e){var a,o,l;let r=Ir(t,"message");if(!(r&&!r.configurable)){for(var i=Qu?" ":" ",n=`
|
||||||
|
${i}in ${((a=e.fn)==null?void 0:a.name)||"<unknown>"}`,s=e.ctx;s!==null;)n+=`
|
||||||
|
${i}in ${(o=s.function)==null?void 0:o[xi].split("/").pop()}`,s=s.p;return{message:t.message+`
|
||||||
|
${n}
|
||||||
|
`,stack:(l=t.stack)==null?void 0:l.split(`
|
||||||
|
`).filter(c=>!c.includes("svelte/src/internal")).join(`
|
||||||
|
`)}}}function oM(t){let e=Iy.get(t);e&&(tr(t,"message",{value:e.message}),tr(t,"stack",{value:e.stack}))}p();p();var YV=-7169;function Be(t,e){t.f=t.f&YV|e}function Xl(t){t.f&512||t.deps===null?Be(t,1024):Be(t,4096)}function lM(t){if(t!==null)for(let e of t)!(e.f&2)||!(e.f&32768)||(e.f^=32768,lM(e.deps))}function Np(t,e,r){t.f&2048?e.add(t):t.f&4096&&r.add(t),lM(t.deps),Be(t,1024)}var Zl=new Set,ye=null,tf=null,Rt=null,Br=[],Up=null,Oy=!1,Za=!1,Kl,Ql,Ka,Jl,rf,nf,Qa,os,ec,kn,My,Dy,uM,By=class By{constructor(){pe(this,kn);ze(this,"committed",!1);ze(this,"current",new Map);ze(this,"previous",new Map);pe(this,Kl,new Set);pe(this,Ql,new Set);pe(this,Ka,0);pe(this,Jl,0);pe(this,rf,null);pe(this,nf,new Set);pe(this,Qa,new Set);pe(this,os,new Map);ze(this,"is_fork",!1);pe(this,ec,!1)}is_deferred(){return this.is_fork||$(this,Jl)>0}skip_effect(e){$(this,os).has(e)||$(this,os).set(e,{d:[],m:[]})}unskip_effect(e){var r=$(this,os).get(e);if(r){$(this,os).delete(e);for(var i of r.d)Be(i,2048),vr(i);for(i of r.m)Be(i,4096),vr(i)}}process(e){var n;Br=[],this.apply();var r=[],i=[];for(let s of e)bt(this,kn,My).call(this,s,r,i);if(this.is_deferred()){bt(this,kn,Dy).call(this,i),bt(this,kn,Dy).call(this,r);for(let[s,a]of $(this,os))hM(s,a)}else{for(let s of $(this,Kl))s();$(this,Kl).clear(),$(this,Ka)===0&&bt(this,kn,uM).call(this),tf=this,ye=null,cM(i),cM(r),tf=null,(n=$(this,rf))==null||n.resolve()}Rt=null}capture(e,r){r!==Je&&!this.previous.has(e)&&this.previous.set(e,r),e.f&8388608||(this.current.set(e,e.v),Rt==null||Rt.set(e,e.v))}activate(){ye=this,this.apply()}deactivate(){ye===this&&(ye=null,Rt=null)}flush(){if(this.activate(),Br.length>0){if(Ly(),ye!==null&&ye!==this)return}else $(this,Ka)===0&&this.process([]);this.deactivate()}discard(){for(let e of $(this,Ql))e(this);$(this,Ql).clear()}increment(e){fe(this,Ka,$(this,Ka)+1),e&&fe(this,Jl,$(this,Jl)+1)}decrement(e){fe(this,Ka,$(this,Ka)-1),e&&fe(this,Jl,$(this,Jl)-1),!$(this,ec)&&(fe(this,ec,!0),yt(()=>{fe(this,ec,!1),this.is_deferred()?Br.length>0&&this.flush():this.revive()}))}revive(){for(let e of $(this,nf))$(this,Qa).delete(e),Be(e,2048),vr(e);for(let e of $(this,Qa))Be(e,4096),vr(e);this.flush()}oncommit(e){$(this,Kl).add(e)}ondiscard(e){$(this,Ql).add(e)}settled(){var e;return((e=$(this,rf))!=null?e:fe(this,rf,Pp())).promise}static ensure(){if(ye===null){let e=ye=new By;Zl.add(ye),Za||yt(()=>{ye===e&&e.flush()})}return ye}apply(){if(!(!ir||!this.is_fork&&Zl.size===1)){Rt=new Map(this.current);for(let e of Zl)if(e!==this)for(let[r,i]of e.previous)Rt.has(r)||Rt.set(r,i)}}};Kl=new WeakMap,Ql=new WeakMap,Ka=new WeakMap,Jl=new WeakMap,rf=new WeakMap,nf=new WeakMap,Qa=new WeakMap,os=new WeakMap,ec=new WeakMap,kn=new WeakSet,My=function(e,r,i){var d;e.f^=1024;for(var n=e.first,s=null;n!==null;){var a=n.f,o=(a&96)!==0,l=o&&(a&1024)!==0,c=l||(a&8192)!==0||$(this,os).has(n);if(ir&&s===null&&a&128&&((d=n.b)!=null&&d.is_pending)&&(s=n),!c&&n.fn!==null){o?n.f^=1024:s!==null&&a&16777228?s.b.defer_effect(n):a&4?r.push(n):ir&&a&16777224?i.push(n):ea(n)&&(a&16&&$(this,Qa).add(n),Js(n));var u=n.first;if(u!==null){n=u;continue}}var f=n.parent;for(n=n.next;n===null&&f!==null;)f===s&&(s=null),n=f.next,f=f.parent}},Dy=function(e){for(var r=0;r<e.length;r+=1)Np(e[r],$(this,nf),$(this,Qa))},uM=function(){var n;if(Zl.size>1){this.previous.clear();var e=Rt,r=!0;for(let s of Zl){if(s===this){r=!1;continue}let a=[];for(let[l,c]of this.current){if(s.current.has(l))if(r&&c!==s.current.get(l))s.current.set(l,c);else continue;a.push(l)}if(a.length===0)continue;let o=[...s.current.keys()].filter(l=>!this.current.has(l));if(o.length>0){var i=Br;Br=[];let l=new Set,c=new Map;for(let u of a)fM(u,o,l,c);if(Br.length>0){ye=s,s.apply();for(let u of Br)bt(n=s,kn,My).call(n,u,[],[]);s.deactivate()}Br=i}}ye=null,Rt=e}this.committed=!0,Zl.delete(this)};var Hr=By;function Ja(t){var e=Za;Za=!0;try{var r;for(t&&(ye!==null&&Ly(),r=t());;){if(aM(),Br.length===0&&(ye==null||ye.flush(),Br.length===0))return Up=null,r;Ly()}}finally{Za=e}}function Ly(){var s;Oy=!0;var t=M?new Set:null;try{for(var e=0;Br.length>0;){var r=Hr.ensure();if(e++>1e3){if(M){var i=new Map;for(let a of r.current.keys())for(let[o,l]of(s=a.updated)!=null?s:[]){var n=i.get(o);n||(n={error:l.error,count:0},i.set(o,n)),n.count+=l.count}for(let a of i.values())a.error&&console.error(a.error)}ZV()}if(r.process(Br),An.clear(),M)for(let a of r.current.keys())t.add(a)}}finally{if(Br=[],Oy=!1,Up=null,M)for(let a of t)a.updated=null}}function ZV(){try{qO()}catch(t){M&&tr(t,"stack",{value:""}),En(t,Up)}}var Lr=null;function cM(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var i=t[r++];if(!(i.f&24576)&&ea(i)&&(Lr=new Set,Js(i),i.deps===null&&i.first===null&&i.nodes===null&&(i.teardown===null&&i.ac===null?Ny(i):i.fn=null),(Lr==null?void 0:Lr.size)>0)){An.clear();for(let n of Lr){if(n.f&24576)continue;let s=[n],a=n.parent;for(;a!==null;)Lr.has(a)&&(Lr.delete(a),s.push(a)),a=a.parent;for(let o=s.length-1;o>=0;o--){let l=s[o];l.f&24576||Js(l)}}Lr.clear
Line truncated
|
||||||
|
`).some(l=>l.startsWith("https://svelte.dev/e/")))throw o;return o!==rs&&console.warn("Failed to hydrate: ",o),e.recover===!1&&zO(),Jp(),oc(r),Ht(!1),ia(t,e)}finally{Ht(i),je(n)}}var cc=new Map;function jM(t,{target:e,anchor:r,props:i={},events:n,context:s,intro:a=!0}){Jp();var o=new Set,l=f=>{for(var d=0;d<f.length;d++){var h=f[d];if(!o.has(h)){o.add(h);var m=GM(h);e.addEventListener(h,lc,{passive:m});var g=cc.get(h);g===void 0?(document.addEventListener(h,lc,{passive:m}),cc.set(h,1)):cc.set(h,g+1)}}};l(ql(sb)),nm.add(l);var c=void 0,u=PM(()=>{var f=r!=null?r:e.appendChild(Ft());return jy(f,{pending:()=>{}},d=>{ot({});var h=ke;if(s&&(h.c=s),n&&(i.$$events=n),ie&&In(d,null),am=a,c=t(d,i)||{},am=!0,ie&&(ne.nodes.end=ge,ge===null||ge.nodeType!==Mr||ge.data!==Va))throw Wa(),rs;lt()}),()=>{var m;for(var d of o){e.removeEventListener(d,lc);var h=cc.get(d);--h===0?(document.removeEventListener(d,lc),cc.delete(d)):cc.set(d,h)}nm.delete(l),f!==r&&((m=f.parentNode)==null||m.removeChild(f))}});return ab.set(c,u),c}var ab=new WeakMap;function ds(t,e){let r=ab.get(t);return r?(ab.delete(t),r(e)):(M&&(Wt in t?tM():eM()),Promise.resolve())}p();p();p();var Yi,On,li,uo,df,hf,om,hs=class{constructor(e,r=!0){ze(this,"anchor");pe(this,Yi,new Map);pe(this,On,new Map);pe(this,li,new Map);pe(this,uo,new Set);pe(this,df,!0);pe(this,hf,()=>{var e=ye;if($(this,Yi).has(e)){var r=$(this,Yi).get(e),i=$(this,On).get(r);if(i)uf(i),$(this,uo).delete(r);else{var n=$(this,li).get(r);n&&($(this,On).set(r,n.effect),$(this,li).delete(r),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.effect)}for(let[s,a]of $(this,Yi)){if($(this,Yi).delete(s),s===e)break;let o=$(this,li).get(a);o&&(dt(o.effect),$(this,li).delete(a))}for(let[s,a]of $(this,On)){if(s===r||$(this,uo).has(s))continue;let o=()=>{if(Array.from($(this,Yi).values()).includes(s)){var c=document.createDocumentFragment();Wp(a,c),c.append(Ft()),$(this,li).set(s,{effect:a,fragment:c})}else dt(a);$(this,uo).delete(s),$(this,On).delete(s)};$(this,df)||!i?($(this,uo).add(s),$n(a,o,!1)):o()}}});pe(this,om,e=>{$(this,Yi).delete(e);let r=Array.from($(this,Yi).values());for(let[i,n]of $(this,li))r.includes(i)||(dt(n.effect),$(this,li).delete(i))});this.anchor=e,fe(this,df,r)}ensure(e,r){var i=ye,n=em();if(r&&!$(this,On).has(e)&&!$(this,li).has(e))if(n){var s=document.createDocumentFragment(),a=Ft();s.append(a),$(this,li).set(e,{effect:Ut(()=>r(a)),fragment:s})}else $(this,On).set(e,Ut(()=>r(this.anchor)));if($(this,Yi).set(i,e),n){for(let[o,l]of $(this,On))o===e?i.unskip_effect(l):i.skip_effect(l);for(let[o,l]of $(this,li))o===e?i.unskip_effect(l.effect):i.skip_effect(l.effect);i.oncommit($(this,hf)),i.ondiscard($(this,om))}else ie&&(this.anchor=ge),$(this,hf).call(this)}};Yi=new WeakMap,On=new WeakMap,li=new WeakMap,uo=new WeakMap,df=new WeakMap,hf=new WeakMap,om=new WeakMap;if(M){let t=function(e){if(!(e in globalThis)){let r;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(r!==void 0)return r;WO(e)},set:i=>{r=i}})}};t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}function fo(t){ke===null&&$p("onMount"),ss&&ke.l!==null?vW(ke).m.push(t):or(()=>{let e=We(t);if(typeof e=="function")return e})}function vW(t){var r;var e=t.l;return(r=e.u)!=null?r:e.u={a:[],b:[],m:[]}}p();p();var VM=new Map;function WM(t,e){var r=VM.get(t);r||(r=new Set,VM.set(t,r)),r.add(e)}p();p();p();p();p();p();p();p();p();function Ae(t,e,r=!1){ie&&rr();var i=new hs(t),n=r?65536:0;function s(a,o){if(ie){let c=Ip(t)===wn;if(a===c){var l=ns();je(l),i.anchor=l,Ht(!1),i.ensure(a,o),Ht(!0);return}}i.ensure(a,o)}ii(()=>{var a=!1;e((o,l=!0)=>{a=!0,s(l,o)}),a||s(!1,null)},n)}p();var Cfe=Symbol("NaN");p();p();function ci(t,e){return e}function EW(t,e,r){var f;for(var i=[],n=e.length,s,a=e.length,o=0;o<n;o++){let d=e[o];$n(d,()=>{if(s){if(s.pending.delete(d),s.done.add(d),s.pending.size===0){var h=t.outrogroups;lb(ql(s.done)),h.delete(s),h.size===0&&(t.outrogroups=null)}}else a-=1},!1)}if(a===0){var l=i.length===0&&r!==null;if(l){var c=r,u=c.parentNode;oc(u),u.append(c),t.items.clear()}lb(e,!l)}else s={pending:new Set(e),done:new Set},((f=t.outrogroups)!=null?f:t.outrogroups=new Set).add(s)}function lb(t,e=!0){for(var r=0;r<t.length;r++)dt(t[r],e)}var uc;function ui(t,e,r,i,n,s=null){var a=t,o=new Map,l=(e&4)!==0;if(l){var c=t;a=ie?je(Qt(c)):c.appendChild(Ft())}ie&&rr();var u=null,f=so(()=>{var w=r();return is(w)?w:w==null?[]:ql(w)}),d,h=!0;function m(){v.fallback=u,kW(v,d,a,e,i),u!==null&&(d.length===0?u.f&33554432?(u.f^=33554432,mf(u,null,a)):uf(u):$n(u,()=>{u=null}))}var g=ii(()=>{d=R(f);var w=d.length;let b=!1;if(ie){var k=Ip(a)===wn;k!==(w===0)&&(a=ns(),je(a),Ht(!1),b=!0)}for(var x=new Set,E=ye,A=em(),y=0;y<w;y+=1){ie&&ge.nodeType===Mr&&ge.data===Va&&(a=ge,b=!0,Ht(!1));var S=d[y],_=i(S,y),T=h?null:o.get(_);T?(T.v&&Vi(T.v,S),T.i&&Vi(T.i,y),A&&E.unskip_effect(T.e)):(T=AW(o,h?a:uc!=null?uc:uc=Ft(),S,_,y,n,e,r),h||(T.e.f|=33554432),o.set(_,T)),x.add(_)}if(w===0&&s&&!u&&(h?u=U
Line truncated
|
||||||
|
\r\f\xA0\v\uFEFF`];function eD(t,e,r){var i=t==null?"":""+t;if(e&&(i=i?i+" "+e:e),r){for(var n in r)if(r[n])i=i?i+" "+n:n;else if(i.length)for(var s=n.length,a=0;(a=i.indexOf(n,a))>=0;){var o=a+s;(a===0||JM.includes(i[a-1]))&&(o===i.length||JM.includes(i[o]))?i=(a===0?"":i.substring(0,a))+i.substring(o+1):a=o}}return i===""?null:i}p();function ht(t,e,r,i,n,s){var a=t.__className;if(ie||a!==r||a===void 0){var o=eD(r,i,s);(!ie||o!==t.getAttribute("class"))&&(o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o)),t.__className=r}else if(s&&n!==s)for(var l in s){var c=!!s[l];(n==null||c!==!!n[l])&&t.classList.toggle(l,c)}return s}p();p();var UW=Symbol("class"),GW=Symbol("style"),jW=Symbol("is custom element"),qW=Symbol("is html");function be(t,e,r,i){var n=zW(t);if(ie&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){i||WW(t,e,r!=null?r:"");return}n[e]!==(n[e]=r)&&(e==="loading"&&(t[BO]=r),r==null?t.removeAttribute(e):typeof r!="string"&&VW(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function zW(t){var e;return(e=t.__attributes)!=null?e:t.__attributes={[jW]:t.nodeName.includes("-"),[qW]:t.namespaceURI===MO}}var tD=new Map;function VW(t){var e=t.getAttribute("is")||t.nodeName,r=tD.get(e);if(r)return r;tD.set(e,r=[]);for(var i,n=t,s=Element.prototype;s!==n;){i=Ey(n);for(var a in i)i[a].set&&r.push(a);n=zl(n)}return r}function WW(t,e,r){var i;M&&(e==="srcset"&&YW(t,r)||ub((i=t.getAttribute(e))!=null?i:"",r)||JO(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(r)))}function ub(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function rD(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function YW(t,e){var r=rD(t.srcset),i=rD(e);return i.length===r.length&&i.every(([n,s],a)=>s===r[a][1]&&(ub(r[a][0],n)||ub(n,r[a][0])))}p();p();p();function hb(t,e,r=e){var i=new WeakSet;Jy(t,"input",async n=>{M&&t.type==="checkbox"&&Cy();var s=n?t.defaultValue:t.value;if(s=fb(t)?db(s):s,r(s),ye!==null&&i.add(ye),await im(),s!==(s=e())){var a=t.selectionStart,o=t.selectionEnd,l=t.value.length;if(t.value=s!=null?s:"",o!==null){var c=t.value.length;a===o&&o===l&&c>l?(t.selectionStart=c,t.selectionEnd=c):(t.selectionStart=a,t.selectionEnd=Math.min(o,c))}}}),(ie&&t.defaultValue!==t.value||We(e)==null&&t.value)&&(r(fb(t)?db(t.value):t.value),ye!==null&&i.add(ye)),Kt(()=>{var a;M&&t.type==="checkbox"&&Cy();var n=e();if(t===document.activeElement){var s=(a=tf)!=null?a:ye;if(i.has(s))return}fb(t)&&n===db(t.value)||t.type==="date"&&!n&&!t.value||n!==t.value&&(t.value=n!=null?n:"")})}function fb(t){var e=t.type;return e==="number"||e==="range"}function db(t){return t===""?null:+t}p();p();p();p();p();function nD(t,e){return t===e||(t==null?void 0:t[Wt])===e}function st(t={},e,r,i){return Vr(()=>{var n,s;return Kt(()=>{n=s,s=(i==null?void 0:i())||[],We(()=>{t!==r(...s)&&(e(t,...s),n&&nD(r(...n),t)&&e(null,...n))})}),()=>{yt(()=>{s&&nD(r(...s),t)&&e(null,...s)})}}),t}p();p();p();p();p();p();p();p();p();var um=!1,Yme=Symbol();function mb(t){var e=um;try{return um=!1,[t(),um]}finally{um=e}}function ki(t,e,r,i){var k,x;var n=!ss||(r&2)!==0,s=(r&8)!==0,a=(r&16)!==0,o=i,l=!0,c=()=>(l&&(l=!1,o=a?We(i):i),o),u;if(s){var f=Wt in t||Zu in t;u=(x=(k=Ir(t,e))==null?void 0:k.set)!=null?x:f&&e in t?E=>t[e]=E:void 0}var d,h=!1;s?[d,h]=mb(()=>t[e]):d=t[e],d===void 0&&i!==void 0&&(d=c(),u&&(n&&VO(e),u(d)));var m;if(n?m=()=>{var E=t[e];return E===void 0?c():(l=!0,E)}:m=()=>{var E=t[e];return E!==void 0&&(o=void 0),E===void 0?o:E},n&&!(r&4))return m;if(u){var g=t.$$legacy;return function(E,A){return arguments.length>0?((!n||!A||g||h)&&u(A?m():E),E):m()}}var v=!1,w=(r&1?no:so)(()=>(v=!1,m()));M&&(w.label=e),s&&R(w);var b=ne;return function(E,A){if(arguments.length>0){let y=A?R(w):n&&s?Xe(E):E;return ae(w,y),v=!0,o!==void 0&&(o=y),E}return Ei&&v||b.f&16384?w.v:R(w)}}p();p();p();function sD(t){return new gb(t)}var ms,Ai,gb=class{constructor(e){pe(this,ms);pe(this,Ai);var s,a;var r=new Map,i=(o,l)=>{var c=oo(l,!1,!1);return r.set(o,c),c};let n=new Proxy({...e.props||{},$$events:{}},{get(o,l){var c;return R((c=r.get(l))!=null?c:i(l,Reflect.get(o,l)))},has(o,l){var c;return l===Zu?!0:(R((c=r.get(l))!=null?c:i(l,Reflect.get(o,l))),Reflect.has(o,l))},set(o,l,c){var u;return ae((u=r.get(l))!=null?u:i(l,c),c),Reflect.set(o,l,c)}});fe(this,Ai,(e.hydrate?ob:ia)(e.component,{target:e.target,anchor:e.anchor,props:n,context:e.context,intro:(s=e.intro)!=null?s:!1,recover:e.recover})),!ir&&(!((a=e==null?void 0:e.props)!=null&&a.$$host)||e.sync===!1)&&Ja(),fe(this,ms,n.$$events);for(let o of Object.keys($(this,Ai)))o==="$set"||o==="$destroy"||o==="$on"||tr(this,o,{get(){return $(this,Ai)[o]},set(l){$(this,Ai)[o]=l},enumerable:!0});$(this,Ai).$set=o=>{Object.assign(n,o)},$(this,Ai).$destroy=()=>{ds($(this,Ai))}}$set(e){$(this,Ai).$set(e)}$on(e,r){$(this,ms)[e]=$(this,ms)[e]||[];let i=(...n)=>r.call(this,...n);return $(this,ms)[e].push(i),()=>{$(this,ms)[e]=$(
Line truncated
|
||||||
|
`:""}${(S=e.log.author)==null?void 0:S.name}
|
||||||
|
${(0,yb.moment)(e.log.date).format(e.plugin.settings.commitDateFormat)}
|
||||||
|
${e.log.message}`}]),oe(t,o),lt()}kt(["click"]);var k9=ue('<div class="tree-item nav-folder mod-root"></div>'),A9=ue('<main class="git-view"><div class="nav-header"><div class="nav-buttons-container"><div id="layoutChange" class="clickable-icon nav-action-button" aria-label="Change Layout"></div> <div id="refresh" data-icon="refresh-cw" aria-label="Refresh"></div></div></div> <div class="nav-files-container" style="position: relative;"><!> <div id="sentinel"></div> <div style="margin-bottom:40px"></div></div></main>'),T9={hash:"svelte-12n6twc",code:""};function xb(t,e){ot(e,!0),Ki(t,T9);let r=ki(e,"plugin",15),i=De(!1),n=Xe([]),s=De(void 0),a=De(Xe(r().settings.treeStructure)),o;or(()=>{o&&o.empty()}),fo(()=>{e.view.registerEvent(e.view.app.workspace.on("obsidian-git:head-change",()=>void c().catch(console.error)))}),or(()=>{n.forEach(x=>(0,_b.setIcon)(x,x.getAttr("data-icon")))}),fo(()=>{let x=new IntersectionObserver(A=>{A[0].isIntersecting&&!R(i)&&u().catch(console.error)}),E=document.querySelector("#sentinel");return E&&x.observe(E),()=>{x.disconnect()}}),c().catch(console.error);function l(){c().catch(console.error)}function c(){return ho(this,void 0,void 0,function*(){var x;if(!r().gitReady){ae(s,void 0);return}ae(i,!0);let E=r().gitManager instanceof Se,A;((x=R(s)===null||R(s)===void 0?void 0:R(s).length)!==null&&x!==void 0?x:0)==0?A=E?50:10:A=R(s).length,ae(s,yield r().gitManager.log(void 0,!1,A),!0),ae(i,!1)})}function u(){return ho(this,void 0,void 0,function*(){var x;if(!r().gitReady||R(s)===void 0)return;ae(i,!0);let A=r().gitManager instanceof Se?50:10,y=yield r().gitManager.log(void 0,!1,A,(x=R(s).last())===null||x===void 0?void 0:x.hash);R(s).push(...y.slice(1)),ae(i,!1)})}var f=A9(),d=G(f),h=G(d),m=G(h);m.__click=()=>{ae(a,!R(a)),(0,_b.setIcon)(n[0],R(a)?"list":"folder"),r(r().settings.treeStructure=R(a),!0),r().saveSettings()},st(m,x=>n[0]=x,()=>n==null?void 0:n[0]);var g=te(m,2);let v;g.__click=l,st(g,x=>n[1]=x,()=>n==null?void 0:n[1]),H(h),H(d);var w=te(d,2),b=G(w);{var k=x=>{var E=k9();ui(E,21,()=>R(s),ci,(A,y)=>{bb(A,{get view(){return e.view},get showTree(){return R(a)},get log(){return R(y)},get plugin(){return r()}})}),H(E),oe(x,E)};Ae(b,x=>{R(s)&&x(k)})}Ya(4),H(w),H(f),Ne(()=>{be(m,"data-icon",R(a)?"list":"folder"),v=ht(g,1,"clickable-icon nav-action-button",null,v,{loading:R(i)})}),oe(t,f),lt()}kt(["click"]);var wf=class extends aD.ItemView{constructor(e,r){super(e),this.plugin=r,this.hoverPopover=null}getViewType(){return gi.type}getDisplayText(){return gi.name}getIcon(){return gi.icon}onClose(){return this._view&&ds(this._view),super.onClose()}reload(){this._view&&ds(this._view),this._view=ia(xb,{target:this.contentEl,props:{plugin:this.plugin,view:this}})}onOpen(){return this.reload(),super.onOpen()}};p();var oD=require("obsidian"),dm=class extends oD.FuzzySuggestModal{constructor(r,i){super(r.app);this.branches=i;this.setPlaceholder("Select branch to checkout")}getItems(){return this.branches}getItemText(r){return r}onChooseItem(r,i){this.resolve(r)}openAndGetReslt(){return new Promise(r=>{this.resolve=r,this.open()})}onClose(){new Promise(r=>setTimeout(r,10)).then(()=>{this.resolve&&this.resolve(void 0)})}};p();var uD=require("obsidian");p();var go=require("obsidian");p();var yf=require("obsidian");p();var lD=require("obsidian");var fc=class extends lD.Modal{constructor({app:r,path:i,filesToDeleteCount:n,filesToDiscardCount:s}){super(r);this.resolve=null;this.path=i,this.deleteCount=n,this.discardCount=s}openAndGetResult(){return this.open(),new Promise(r=>{this.resolve=r})}onOpen(){let r=this.deleteCount+this.discardCount,{contentEl:i,titleEl:n}=this,s="";this.path!=""&&(r>1?s=`files in "${this.path}"`:s=`"${this.path}"`),n.setText(`${this.discardCount==0?"Delete":"Discard"} ${s}`),this.deleteCount>0&&i.createEl("p").setText(`Are you sure you want to DELETE the ${Su(this.deleteCount,"untracked file")}? They are deleted according to your Obsidian trash settting.`),this.discardCount>0&&i.createEl("p").setText(`Are you sure you want to discard ALL changes in ${Su(this.discardCount,"tracked file")}?`);let a=i.createDiv({cls:"modal-button-container"});if(this.deleteCount>0){let l=a.createEl("button",{cls:"mod-warning",text:`${this.discardCount>0?"Discard":"Delete"} all ${Su(r,"file")}`});l.addEventListener("click",()=>{this.resolve&&this.resolve("delete"),this.close()}),l.addEventListener("keypress",()=>{this.resolve&&this.resolve("delete"),this.close()})}if(this.discardCount>0){let l=a.createEl("button",{cls:"mod-warning",text:`Discard all ${Su(this.discardCount,"tracked file")}`});l.addEventListener("click",()=>{this.resolve&&this.resolve("discard"),this.close()}),l.addEventListener("keypress",()=>{this.resolve&&this.resolve("discard"),this.close()})}let o=a.createEl("button",{text:"Cancel"});o.addEventListener("click",()=>(this.resolve&&this.resolve(!1),this.close())),o.addEventListener("keypress",()=>(this.resolve&&this.resolve(!1),this.close()))}onClose(){let{contentEl:r}=th
Line truncated
|
||||||
|
`);n.removed.lines.length>0&&!n.removed.no_nl_at_eof&&(c+=`
|
||||||
|
`),i.replaceRange(c,i.offsetToPos(o),i.offsetToPos(l)),i.setSelection(i.offsetToPos(o))}}async stageHunk(e){if(!await this.plugin.isAllInitialized()||!this.editor)return;let{editor:r}=this.editor,i=Bi.getHunk(r.state,!1,e),n=!1;if(i||(i=Bi.getHunk(r.state,!0,e),n=!0),!i)return;let s=r.state.field(fD.editorInfoField).file.path,a=Nt.createPatch(s,[i],"100644",n).join(`
|
||||||
|
`)+`
|
||||||
|
`;await this.gitManager.applyPatch(a),this.plugin.app.workspace.trigger("obsidian-git:refresh")}goToHunk(e){if(!this.editor)return;let{editor:r,obEditor:i}=this.editor,n=Bi.getHunks(r.state,!1),s=i.getCursor().line+1,a=Nt.findNearestHunk(s,n,e,!0);if(a==null)return;let o=n[a];if(o){let l=o.added.start-1;i.setCursor(l,0),i.scrollIntoView({from:{line:l,ch:0},to:{line:l+1,ch:0}},!0)}}};p();p();var vo=require("obsidian");var gm=class{constructor(e){this.plg=e;this.codeMirrorExtensions=[];this.handleWorkspaceLeaf=e=>{if(!this.lineAuthorInfoProvider){console.warn("Git: undefined lineAuthorInfoProvider. Unexpected situation.");return}let r=e==null?void 0:e.view;!(r instanceof vo.MarkdownView)||r.file==null||(r==null?void 0:r.allowNoFile)===!0||this.lineAuthorInfoProvider.trackChanged(r.file).catch(console.error)}}onLoadPlugin(){this.plg.registerEditorExtension(this.codeMirrorExtensions),YF(()=>this.plg.settings.lineAuthor,e=>{this.plg.settings.lineAuthor=e,this.plg.saveSettings()})}conditionallyActivateBySettings(){this.plg.settings.lineAuthor.show&&this.activateFeature()}activateFeature(){try{if(!this.isAvailableOnCurrentPlatform().available)return;nI(this.plg.settings.lineAuthor),this.lineAuthorInfoProvider=new tp(this.plg),this.createEventHandlers(),this.activateCodeMirrorExtensions(),console.log(this.plg.manifest.name+": Enabled line authoring.")}catch(e){console.warn("Git: Error while loading line authoring feature.",e),this.deactivateFeature()}}deactivateFeature(){var e;this.destroyEventHandlers(),this.deactivateCodeMirrorExtensions(),(e=this.lineAuthorInfoProvider)==null||e.destroy(),this.lineAuthorInfoProvider=void 0,console.log(this.plg.manifest.name+": Disabled line authoring.")}isAvailableOnCurrentPlatform(){return{available:this.plg.useSimpleGit&&vo.Platform.isDesktopApp,gitManager:this.plg.gitManager instanceof Se?this.plg.gitManager:void 0}}refreshLineAuthorViews(){this.plg.settings.lineAuthor.show&&(this.deactivateFeature(),this.activateFeature())}activateCodeMirrorExtensions(){this.codeMirrorExtensions.push(mI),this.plg.app.workspace.updateOptions(),this.plg.app.workspace.iterateAllLeaves(this.handleWorkspaceLeaf)}deactivateCodeMirrorExtensions(){for(let e of this.codeMirrorExtensions)this.codeMirrorExtensions.remove(e);this.plg.app.workspace.updateOptions()}createEventHandlers(){this.gutterContextMenuEvent=this.createGutterContextMenuHandler(),this.fileOpenEvent=this.createFileOpenEvent(),this.workspaceLeafChangeEvent=this.createWorkspaceLeafChangeEvent(),this.fileModificationEvent=this.createVaultFileModificationHandler(),this.headChangeEvent=this.createHeadChangeEvent(),this.refreshOnCssChangeEvent=this.createCssRefreshHandler(),this.fileRenameEvent=this.createFileRenameEvent(),JF(),this.plg.registerEvent(this.gutterContextMenuEvent),this.plg.registerEvent(this.refreshOnCssChangeEvent),this.plg.registerEvent(this.fileOpenEvent),this.plg.registerEvent(this.workspaceLeafChangeEvent),this.plg.registerEvent(this.fileModificationEvent),this.plg.registerEvent(this.headChangeEvent),this.plg.registerEvent(this.fileRenameEvent)}destroyEventHandlers(){this.plg.app.workspace.offref(this.gutterContextMenuEvent),this.plg.app.workspace.offref(this.refreshOnCssChangeEvent),this.plg.app.workspace.offref(this.fileOpenEvent),this.plg.app.workspace.offref(this.workspaceLeafChangeEvent),this.plg.app.workspace.offref(this.refreshOnCssChangeEvent),this.plg.app.vault.offref(this.fileModificationEvent),this.plg.app.workspace.offref(this.headChangeEvent),this.plg.app.vault.offref(this.fileRenameEvent)}createFileOpenEvent(){return this.plg.app.workspace.on("file-open",e=>{var r;return void((r=this.lineAuthorInfoProvider)==null?void 0:r.trackChanged(e).catch(console.error))})}createWorkspaceLeafChangeEvent(){return this.plg.app.workspace.on("active-leaf-change",this.handleWorkspaceLeaf)}createFileRenameEvent(){return this.plg.app.vault.on("rename",(e,r)=>{var i;return e instanceof vo.TFile&&((i=this.lineAuthorInfoProvider)==null?void 0:i.trackChanged(e))})}createVaultFileModificationHandler(){return this.plg.app.vault.on("modify",e=>{var r;return e instanceof vo.TFile&&((r=this.lineAuthorInfoProvider)==null?void 0:r.trackChanged(e))})}createHeadChangeEvent(){return this.plg.app.workspace.on("obsidian-git:head-change",()=>{this.refreshLineAuthorViews()})}createCssRefreshHandler(){return this.plg.app.workspace.on("css-change",()=>this.refreshLineAuthorViews())}createGutterContextMenuHandler(){return this.plg.app.workspace.on("editor-menu",rI)}};p();var dc=require("obsidian");p();p();var wo=require("@codemirror/state"),wm=require("@codemirror/view");var vm=class extends wm.GutterMarker{constructor(r,i){super();this.type=r;this.staged=i}toDOM(r){let i=document.createElement("div");return i.className=`git-gutter-marker git-${this.type} ${this.staged?"staged":"unstaged"}`,this.type=="changedelete"&&i.setText("~"),i}},Eb=wo.StateField.define({create:()=>wo.RangeSet.empty,update:(t,e)=>{let r=e.state.field(Fr,!1);if(!r)return wo
Line truncated
|
||||||
|
`+s),this.app.workspace.trigger("obsidian-git:refresh")}handleFileMenu(r,i,n,s){if(!this.gitReady||!this.settings.showFileMenu||!i)return;let a;if(typeof i=="string"?a=i:a=i.path,n=="file-explorer-context-menu"&&(r.addItem(o=>{o.setTitle("Git: Stage").setIcon("plus-circle").setSection("action").onClick(l=>{this.promiseQueue.addTask(async()=>{i instanceof _e.TFile?await this.stageFile(i):(await this.gitManager.stageAll({dir:this.gitManager.getRelativeRepoPath(a,!0)}),this.app.workspace.trigger("obsidian-git:refresh"))})})}),r.addItem(o=>{o.setTitle("Git: Unstage").setIcon("minus-circle").setSection("action").onClick(l=>{this.promiseQueue.addTask(async()=>{i instanceof _e.TFile?await this.unstageFile(i):(await this.gitManager.unstageAll({dir:this.gitManager.getRelativeRepoPath(a,!0)}),this.app.workspace.trigger("obsidian-git:refresh"))})})}),r.addItem(o=>{o.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(l=>{this.addFileToGitignore(a,i instanceof _e.TFolder).catch(c=>this.displayError(c))})})),n=="git-source-control"){r.addItem(l=>{l.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(c=>{this.addFileToGitignore(a,i instanceof _e.TFolder).catch(u=>this.displayError(u))})});let o=this.app.vault.adapter;s==="obsidian-git:menu"&&o instanceof _e.FileSystemAdapter&&(r.addItem(l=>{l.setTitle("Open in default app").setIcon("arrow-up-right").setSection("action").onClick(c=>{this.app.openWithDefaultApp(a)})}),r.addItem(l=>{l.setTitle("Show in system explorer").setIcon("arrow-up-right").setSection("action").onClick(c=>{window.electron.shell.showItemInFolder(wD.join(o.getBasePath(),a))})}))}}async migrateSettings(){this.settings.mergeOnPull!=null&&(this.settings.syncMethod=this.settings.mergeOnPull?"merge":"rebase",this.settings.mergeOnPull=void 0,await this.saveSettings()),this.settings.autoCommitMessage===void 0&&(this.settings.autoCommitMessage=this.settings.commitMessage,await this.saveSettings()),this.settings.gitPath!=null&&(this.localStorage.setGitPath(this.settings.gitPath),this.settings.gitPath=void 0,await this.saveSettings()),this.settings.username!=null&&(this.localStorage.setPassword(this.settings.username),this.settings.username=void 0,await this.saveSettings())}unloadPlugin(){var r,i;this.gitReady=!1,this.editorIntegration.onUnloadPlugin(),this.automaticsManager.unload(),(r=this.branchBar)==null||r.remove(),(i=this.statusBar)==null||i.remove(),this.statusBar=void 0,this.branchBar=void 0,this.gitManager.unload(),this.promiseQueue.clear();for(let n of this.intervalsToClear)window.clearInterval(n);this.intervalsToClear=[],this.debRefresh.cancel()}onunload(){this.unloadPlugin(),console.log("unloading "+this.manifest.name+" plugin")}async loadSettings(){let r=await this.loadData();r==null&&(r={showedMobileNotice:!0}),this.settings=ZA(rt,r)}async saveSettings(){var r;(r=this.settingsTab)==null||r.beforeSaveSettings(),await this.saveData(this.settings)}get useSimpleGit(){return _e.Platform.isDesktopApp}async init({fromReload:r=!1}){var i;if(this.settings.showStatusBar&&!this.statusBar){let n=this.addStatusBarItem();this.statusBar=new ip(n,this),this.intervalsToClear.push(window.setInterval(()=>{var s;return(s=this.statusBar)==null?void 0:s.display()},1e3))}try{this.useSimpleGit?(this.gitManager=new Se(this),await this.gitManager.setGitInstance()):this.gitManager=new Di(this);let n=await this.gitManager.checkRequirements(),s=this.localStorage.getPausedAutomatics();switch(n){case"missing-git":this.displayError(`Cannot run git command. Trying to run: '${this.localStorage.getGitPath()||"git"}' .`);break;case"missing-repo":new _e.Notice("Can't find a valid git repository. Please create one via the given command or clone an existing repo.",1e4);break;case"valid":if(this.gitReady=!0,this.setPluginState({gitAction:0}),_e.Platform.isDesktop&&this.settings.showBranchStatusBar&&!this.branchBar){let a=this.addStatusBarItem();this.branchBar=new pm(a,this),this.intervalsToClear.push(window.setInterval(()=>{var o;return void((o=this.branchBar)==null?void 0:o.display().catch(console.error))},6e4))}await((i=this.branchBar)==null?void 0:i.display()),this.editorIntegration.onReady(),this.app.workspace.trigger("obsidian-git:refresh"),this.app.workspace.trigger("obsidian-git:head-change"),!r&&this.settings.autoPullOnBoot&&!s&&this.promiseQueue.addTask(()=>this.pullChangesFromRemote()),s||await this.automaticsManager.init(),s&&new _e.Notice("Automatic routines are currently paused.");break;default:this.log("Something weird happened. The 'checkRequirements' result is "+n)}}catch(n){this.displayError(n),console.error(n)}}async createNewRepo(){try{await this.gitManager.init(),new _e.Notice("Initialized new repo"),await this.init({fromReload:!0})}catch(r){this.displayError(r)}}async cloneNewRepo(){let i=await new Qe(this,{placeholder:"Enter remote URL"}).openAndGetResult();if(i){let n="Vault Root",s=await new Qe(this,{options:this.gitManager instanceof Di?[n]:[],placeholder
Line truncated
|
||||||
|
# Additional Instructions
|
||||||
|
I strongly recommend to use "Source mode" for viewing the conflicted files. For simple conflicts, in each file listed above replace every occurrence of the following text blocks with the desired text.
|
||||||
|
|
||||||
|
\`\`\`diff
|
||||||
|
<<<<<<< HEAD
|
||||||
|
File changes in local repository
|
||||||
|
=======
|
||||||
|
File changes in remote repository
|
||||||
|
>>>>>>> origin/main
|
||||||
|
\`\`\``]),await this.tools.writeAndOpenFile(i==null?void 0:i.join(`
|
||||||
|
`))}async editRemotes(){if(!await this.isAllInitialized())return;let r=await this.gitManager.getRemotes(),n=await new Qe(this,{options:r,placeholder:"Select or create a new remote by typing its name and selecting it"}).openAndGetResult();if(n){let s=await this.gitManager.getRemoteUrl(n),o=await new Qe(this,{initialValue:s,placeholder:"Enter remote URL"}).openAndGetResult();if(o)return await this.gitManager.setRemote(n,zw(o)),n}}async selectRemoteBranch(){let r=await this.gitManager.getRemotes(),i;r.length===0&&(i=await this.editRemotes(),i==null&&(r=await this.gitManager.getRemotes()));let n=new Qe(this,{options:r,placeholder:"Select or create a new remote by typing its name and selecting it"}),s=i!=null?i:await n.openAndGetResult();if(s){this.displayMessage("Fetching remote branches"),await this.gitManager.fetch(s);let a=await this.gitManager.getRemoteBranches(s),l=await new Qe(this,{options:a,placeholder:"Select or create a new remote branch by typing its name and selecting it"}).openAndGetResult();return l==null?void 0:l.startsWith(s+"/")?l:`${s}/${l}`}}async removeRemote(){if(!await this.isAllInitialized())return;let r=await this.gitManager.getRemotes(),n=await new Qe(this,{options:r,placeholder:"Select a remote"}).openAndGetResult();n&&await this.gitManager.removeRemote(n)}onActiveLeafChange(r){var a,o;let i=r==null?void 0:r.view;if(!(i!=null&&i.getState().file)&&!(i instanceof qa||i instanceof za))return;let n=this.app.workspace.getLeavesOfType(zt.type).first(),s=this.app.workspace.getLeavesOfType(gi.type).first();if((a=n==null?void 0:n.view.containerEl.querySelector("div.tree-item-self.is-active"))==null||a.removeClass("is-active"),(o=s==null?void 0:s.view.containerEl.querySelector("div.tree-item-self.is-active"))==null||o.removeClass("is-active"),(r==null?void 0:r.view)instanceof qa||(r==null?void 0:r.view)instanceof za){let c=r.view.state.bFile.replace(/["\\]/g,"\\$&");this.lastDiffViewState=r.view.getState();let u;n&&r.view.state.aRef=="HEAD"?u=n.view.containerEl.querySelector(`div.staged div.tree-item-self[data-path="${c}"]`):n&&r.view.state.aRef==""?u=n.view.containerEl.querySelector(`div.changes div.tree-item-self[data-path="${c}"]`):s&&(u=s.view.containerEl.querySelector(`div.tree-item-self[data-path='${c}']`)),u==null||u.addClass("is-active")}else this.lastDiffViewState=void 0}handleNoNetworkError(r){this.state.offlineMode?this.log("Encountered network error, but already in offline mode"):this.displayError("Git: Going into offline mode. Future network errors will no longer be displayed.",2e3),this.setPluginState({gitAction:0,offlineMode:!0})}displayMessage(r,i=4*1e3){var n;(n=this.statusBar)==null||n.displayMessage(r.toLowerCase(),i),this.settings.disablePopups||(!this.settings.disablePopupsForNoChanges||!r.startsWith("No changes"))&&new _e.Notice(r,5*1e3),this.log(r)}displayError(r,i=10*1e3){var s;if(r instanceof vD.Errors.UserCanceledError){new _e.Notice("Aborted");return}let n;r instanceof Error?n=r:n=new Error(String(r)),this.setPluginState({gitAction:0}),this.settings.showErrorNotices&&new _e.Notice(n.message,i),console.error(`${this.manifest.id}:`,n.stack),(s=this.statusBar)==null||s.displayMessage(n.message.toLowerCase(),i)}log(...r){console.log(`${this.manifest.id}:`,...r)}};
|
||||||
|
/*! Bundled license information:
|
||||||
|
|
||||||
|
ieee754/index.js:
|
||||||
|
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
||||||
|
|
||||||
|
buffer/index.js:
|
||||||
|
(*!
|
||||||
|
* The buffer module from node.js, for the browser.
|
||||||
|
*
|
||||||
|
* @author Feross Aboukhadijeh <https://feross.org>
|
||||||
|
* @license MIT
|
||||||
|
*)
|
||||||
|
|
||||||
|
safe-buffer/index.js:
|
||||||
|
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
||||||
|
|
||||||
|
crc-32/crc32.js:
|
||||||
|
(*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com *)
|
||||||
|
|
||||||
|
isomorphic-git/index.cjs:
|
||||||
|
(*!
|
||||||
|
* This code for `path.join` is directly copied from @zenfs/core/path for bundle size improvements.
|
||||||
|
* SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
* Copyright (c) James Prevett and other ZenFS contributors.
|
||||||
|
*)
|
||||||
|
|
||||||
|
js-sha256/src/sha256.js:
|
||||||
|
(**
|
||||||
|
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
||||||
|
*
|
||||||
|
* @version 0.9.0
|
||||||
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
||||||
|
* @copyright Chen, Yi-Cyuan 2014-2017
|
||||||
|
* @license MIT
|
||||||
|
*)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* nosourcemap */
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"author": "Vinzent",
|
||||||
|
"authorUrl": "https://github.com/Vinzent03",
|
||||||
|
"id": "obsidian-git",
|
||||||
|
"name": "Git",
|
||||||
|
"description": "Integrate Git version control with automatic backup and other advanced features.",
|
||||||
|
"isDesktopOnly": false,
|
||||||
|
"fundingUrl": "https://ko-fi.com/vinzent",
|
||||||
|
"version": "2.38.0"
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
PROMPT="$1"
|
||||||
|
TEMP_FILE="$OBSIDIAN_GIT_CREDENTIALS_INPUT"
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
rm -f "$TEMP_FILE" "$TEMP_FILE.response"
|
||||||
|
}
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
echo "$PROMPT" > "$TEMP_FILE"
|
||||||
|
|
||||||
|
while [ ! -e "$TEMP_FILE.response" ]; do
|
||||||
|
if [ ! -e "$TEMP_FILE" ]; then
|
||||||
|
echo "Trigger file got removed: Abort" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sleep 0.1
|
||||||
|
done
|
||||||
|
|
||||||
|
RESPONSE=$(cat "$TEMP_FILE.response")
|
||||||
|
|
||||||
|
echo "$RESPONSE"
|
||||||
@@ -0,0 +1,710 @@
|
|||||||
|
@keyframes loading {
|
||||||
|
0% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-signs-gutter {
|
||||||
|
.cm-gutterElement {
|
||||||
|
/* Needed to align the sign properly for different line heigts. Such as
|
||||||
|
* when having a heading or list item.
|
||||||
|
*/
|
||||||
|
padding-top: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="git-view"] .button-border {
|
||||||
|
border: 2px solid var(--interactive-accent);
|
||||||
|
border-radius: var(--radius-s);
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="git-view"] .view-content {
|
||||||
|
padding-left: 0;
|
||||||
|
padding-top: 0;
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="git-history-view"] .view-content {
|
||||||
|
padding-left: 0;
|
||||||
|
padding-top: 0;
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading > svg {
|
||||||
|
animation: 2s linear infinite loading;
|
||||||
|
transform-origin: 50% 50%;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian-git-center {
|
||||||
|
margin: auto;
|
||||||
|
text-align: center;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian-git-textarea {
|
||||||
|
display: block;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian-git-disabled {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian-git-center-button {
|
||||||
|
display: block;
|
||||||
|
margin: 20px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tooltip.mod-left {
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tooltip.mod-right {
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Limits the scrollbar to the view body */
|
||||||
|
.git-view {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
position: relative;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Re-enable wrapping of nav buttns to prevent overflow on smaller screens #*/
|
||||||
|
.workspace-drawer .git-view .nav-buttons-container {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-tools {
|
||||||
|
display: flex;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
.git-tools .type {
|
||||||
|
padding-left: var(--size-2-1);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-tools .type[data-type="M"] {
|
||||||
|
color: orange;
|
||||||
|
}
|
||||||
|
.git-tools .type[data-type="D"] {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.git-tools .buttons {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.git-tools .buttons > * {
|
||||||
|
padding: 0 0;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="git-view"] .tree-item-self,
|
||||||
|
.workspace-leaf-content[data-type="git-history-view"] .tree-item-self {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="git-view"]
|
||||||
|
.tree-item-self:hover
|
||||||
|
.clickable-icon,
|
||||||
|
.workspace-leaf-content[data-type="git-history-view"]
|
||||||
|
.tree-item-self:hover
|
||||||
|
.clickable-icon {
|
||||||
|
color: var(--icon-color-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Highlight an item as active if it's diff is currently opened */
|
||||||
|
.is-active .git-tools .buttons > * {
|
||||||
|
color: var(--nav-item-color-active);
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-author {
|
||||||
|
color: var(--text-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-date {
|
||||||
|
color: var(--text-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-ref {
|
||||||
|
color: var(--text-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ====== diff2html ======
|
||||||
|
The following styles are adapted from the obsidian-version-history plugin by
|
||||||
|
@kometenstaub https://github.com/kometenstaub/obsidian-version-history-diff/blob/main/src/styles.scss
|
||||||
|
which itself is adapted from the diff2html library with the following original license:
|
||||||
|
|
||||||
|
https://github.com/rtfpessoa/diff2html/blob/master/LICENSE.md
|
||||||
|
|
||||||
|
Copyright 2014-2016 Rodrigo Fernandes https://rtfpessoa.github.io/
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
||||||
|
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
|
||||||
|
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||||
|
persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
|
||||||
|
Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
||||||
|
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||||
|
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
.theme-dark,
|
||||||
|
.theme-light {
|
||||||
|
--git-delete-bg: #ff475040;
|
||||||
|
--git-delete-hl: #96050a75;
|
||||||
|
--git-insert-bg: #68d36840;
|
||||||
|
--git-insert-hl: #23c02350;
|
||||||
|
--git-change-bg: #ffd55840;
|
||||||
|
--git-selected: #3572b0;
|
||||||
|
|
||||||
|
--git-delete: #c33;
|
||||||
|
--git-insert: #399839;
|
||||||
|
--git-change: #d0b44c;
|
||||||
|
--git-move: #3572b0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-diff {
|
||||||
|
.d2h-d-none {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.d2h-wrapper {
|
||||||
|
text-align: left;
|
||||||
|
border-radius: 0.25em;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.d2h-file-header.d2h-file-header {
|
||||||
|
background-color: var(--background-secondary);
|
||||||
|
border-bottom: 1px solid var(--background-modifier-border);
|
||||||
|
font-family:
|
||||||
|
Source Sans Pro,
|
||||||
|
Helvetica Neue,
|
||||||
|
Helvetica,
|
||||||
|
Arial,
|
||||||
|
sans-serif;
|
||||||
|
height: 35px;
|
||||||
|
padding: 5px 10px;
|
||||||
|
}
|
||||||
|
.d2h-file-header,
|
||||||
|
.d2h-file-stats {
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.d2h-file-header {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.d2h-file-stats {
|
||||||
|
font-size: 14px;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
.d2h-lines-added {
|
||||||
|
border: 1px solid var(--color-green);
|
||||||
|
border-radius: 5px 0 0 5px;
|
||||||
|
color: var(--color-green);
|
||||||
|
padding: 2px;
|
||||||
|
text-align: right;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.d2h-lines-deleted {
|
||||||
|
border: 1px solid var(--color-red);
|
||||||
|
border-radius: 0 5px 5px 0;
|
||||||
|
color: var(--color-red);
|
||||||
|
margin-left: 1px;
|
||||||
|
padding: 2px;
|
||||||
|
text-align: left;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.d2h-file-name-wrapper {
|
||||||
|
-webkit-box-align: center;
|
||||||
|
-ms-flex-align: center;
|
||||||
|
align-items: center;
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
font-size: 15px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.d2h-file-name {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
color: var(--text-normal);
|
||||||
|
font-size: var(--h5-size);
|
||||||
|
}
|
||||||
|
.d2h-file-wrapper {
|
||||||
|
border: 1px solid var(--background-secondary-alt);
|
||||||
|
border-radius: 3px;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
max-height: 100%;
|
||||||
|
}
|
||||||
|
.d2h-file-collapse {
|
||||||
|
-webkit-box-pack: end;
|
||||||
|
-ms-flex-pack: end;
|
||||||
|
-webkit-box-align: center;
|
||||||
|
-ms-flex-align: center;
|
||||||
|
align-items: center;
|
||||||
|
border: 1px solid var(--background-secondary-alt);
|
||||||
|
border-radius: 3px;
|
||||||
|
cursor: pointer;
|
||||||
|
display: none;
|
||||||
|
font-size: 12px;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: 4px 8px;
|
||||||
|
}
|
||||||
|
.d2h-file-collapse.d2h-selected {
|
||||||
|
background-color: var(--git-selected);
|
||||||
|
}
|
||||||
|
.d2h-file-collapse-input {
|
||||||
|
margin: 0 4px 0 0;
|
||||||
|
}
|
||||||
|
.d2h-diff-table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
font-family: var(--font-monospace);
|
||||||
|
font-size: var(--code-size);
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.d2h-files-diff {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.d2h-file-diff {
|
||||||
|
/*
|
||||||
|
overflow-y: scroll;
|
||||||
|
*/
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: var(--font-text-size);
|
||||||
|
line-height: var(--line-height-normal);
|
||||||
|
}
|
||||||
|
.d2h-file-side-diff {
|
||||||
|
display: inline-block;
|
||||||
|
margin-bottom: -8px;
|
||||||
|
margin-right: -4px;
|
||||||
|
overflow-x: scroll;
|
||||||
|
overflow-y: hidden;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
.d2h-code-line {
|
||||||
|
padding-left: 6em;
|
||||||
|
padding-right: 1.5em;
|
||||||
|
}
|
||||||
|
.d2h-code-line,
|
||||||
|
.d2h-code-side-line {
|
||||||
|
display: inline-block;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
white-space: nowrap;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.d2h-code-side-line {
|
||||||
|
/* needed to be changed */
|
||||||
|
padding-left: 0.5em;
|
||||||
|
padding-right: 0.5em;
|
||||||
|
}
|
||||||
|
.d2h-code-line-ctn {
|
||||||
|
word-wrap: normal;
|
||||||
|
background: none;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0;
|
||||||
|
-webkit-user-select: text;
|
||||||
|
-moz-user-select: text;
|
||||||
|
-ms-user-select: text;
|
||||||
|
user-select: text;
|
||||||
|
vertical-align: middle;
|
||||||
|
width: 100%;
|
||||||
|
/* only works for line-by-line */
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
.d2h-code-line del,
|
||||||
|
.d2h-code-side-line del {
|
||||||
|
background-color: var(--git-delete-hl);
|
||||||
|
color: var(--text-normal);
|
||||||
|
}
|
||||||
|
.d2h-code-line del,
|
||||||
|
.d2h-code-line ins,
|
||||||
|
.d2h-code-side-line del,
|
||||||
|
.d2h-code-side-line ins {
|
||||||
|
border-radius: 0.2em;
|
||||||
|
display: inline-block;
|
||||||
|
margin-top: -1px;
|
||||||
|
text-decoration: none;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.d2h-code-line ins,
|
||||||
|
.d2h-code-side-line ins {
|
||||||
|
background-color: var(--git-insert-hl);
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.d2h-code-line-prefix {
|
||||||
|
word-wrap: normal;
|
||||||
|
background: none;
|
||||||
|
display: inline;
|
||||||
|
padding: 0;
|
||||||
|
white-space: pre;
|
||||||
|
}
|
||||||
|
.line-num1 {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.line-num1,
|
||||||
|
.line-num2 {
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
overflow: hidden;
|
||||||
|
/*
|
||||||
|
padding: 0 0.5em;
|
||||||
|
*/
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
width: 2.5em;
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
.line-num2 {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
.d2h-code-linenumber {
|
||||||
|
background-color: var(--background-primary);
|
||||||
|
border: solid var(--background-modifier-border);
|
||||||
|
border-width: 0 1px;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
color: var(--text-faint);
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
|
position: absolute;
|
||||||
|
text-align: right;
|
||||||
|
width: 5.5em;
|
||||||
|
}
|
||||||
|
.d2h-code-linenumber:after {
|
||||||
|
content: "\200b";
|
||||||
|
}
|
||||||
|
.d2h-code-side-linenumber {
|
||||||
|
background-color: var(--background-primary);
|
||||||
|
border: solid var(--background-modifier-border);
|
||||||
|
border-width: 0 1px;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
color: var(--text-faint);
|
||||||
|
cursor: pointer;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0 0.5em;
|
||||||
|
text-align: right;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
width: 4em;
|
||||||
|
/* needed to be changed */
|
||||||
|
display: table-cell;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.d2h-code-side-linenumber:after {
|
||||||
|
content: "\200b";
|
||||||
|
}
|
||||||
|
.d2h-code-side-emptyplaceholder,
|
||||||
|
.d2h-emptyplaceholder {
|
||||||
|
background-color: var(--background-primary);
|
||||||
|
border-color: var(--background-modifier-border);
|
||||||
|
}
|
||||||
|
.d2h-code-line-prefix,
|
||||||
|
.d2h-code-linenumber,
|
||||||
|
.d2h-code-side-linenumber,
|
||||||
|
.d2h-emptyplaceholder {
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
.d2h-code-linenumber,
|
||||||
|
.d2h-code-side-linenumber {
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
.d2h-del {
|
||||||
|
background-color: var(--git-delete-bg);
|
||||||
|
border-color: var(--git-delete-hl);
|
||||||
|
}
|
||||||
|
.d2h-ins {
|
||||||
|
background-color: var(--git-insert-bg);
|
||||||
|
border-color: var(--git-insert-hl);
|
||||||
|
}
|
||||||
|
.d2h-info {
|
||||||
|
background-color: var(--background-primary);
|
||||||
|
border-color: var(--background-modifier-border);
|
||||||
|
color: var(--text-faint);
|
||||||
|
}
|
||||||
|
.d2h-del,
|
||||||
|
.d2h-ins,
|
||||||
|
.d2h-file-diff .d2h-change {
|
||||||
|
color: var(--text-normal);
|
||||||
|
}
|
||||||
|
.d2h-file-diff .d2h-del.d2h-change {
|
||||||
|
background-color: var(--git-change-bg);
|
||||||
|
}
|
||||||
|
.d2h-file-diff .d2h-ins.d2h-change {
|
||||||
|
background-color: var(--git-insert-bg);
|
||||||
|
}
|
||||||
|
.d2h-file-list-wrapper {
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: default;
|
||||||
|
-webkit-user-drag: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
svg {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.d2h-file-list-header {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.d2h-file-list-title {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.d2h-file-list-line {
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.d2h-file-list {
|
||||||
|
}
|
||||||
|
.d2h-file-list > li {
|
||||||
|
border-bottom: 1px solid var(--background-modifier-border);
|
||||||
|
margin: 0;
|
||||||
|
padding: 5px 10px;
|
||||||
|
}
|
||||||
|
.d2h-file-list > li:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
.d2h-file-switch {
|
||||||
|
cursor: pointer;
|
||||||
|
display: none;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
.d2h-icon {
|
||||||
|
fill: currentColor;
|
||||||
|
margin-right: 10px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.d2h-deleted {
|
||||||
|
color: var(--git-delete);
|
||||||
|
}
|
||||||
|
.d2h-added {
|
||||||
|
color: var(--git-insert);
|
||||||
|
}
|
||||||
|
.d2h-changed {
|
||||||
|
color: var(--git-change);
|
||||||
|
}
|
||||||
|
.d2h-moved {
|
||||||
|
color: var(--git-move);
|
||||||
|
}
|
||||||
|
.d2h-tag {
|
||||||
|
background-color: var(--background-secondary);
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
font-size: 10px;
|
||||||
|
margin-left: 5px;
|
||||||
|
padding: 0 2px;
|
||||||
|
}
|
||||||
|
.d2h-deleted-tag {
|
||||||
|
border: 1px solid var(--git-delete);
|
||||||
|
}
|
||||||
|
.d2h-added-tag {
|
||||||
|
border: 1px solid var(--git-insert);
|
||||||
|
}
|
||||||
|
.d2h-changed-tag {
|
||||||
|
border: 1px solid var(--git-change);
|
||||||
|
}
|
||||||
|
.d2h-moved-tag {
|
||||||
|
border: 1px solid var(--git-move);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* needed for line-by-line*/
|
||||||
|
|
||||||
|
.d2h-diff-tbody {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ====================== Line Authoring Information ====================== */
|
||||||
|
|
||||||
|
.cm-gutterElement.obs-git-blame-gutter {
|
||||||
|
/* Add background color to spacing inbetween and around the gutter for better aesthetics */
|
||||||
|
border-width: 0px 2px 0.2px 2px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: var(--background-secondary);
|
||||||
|
background-color: var(--background-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-gutterElement.obs-git-blame-gutter > div,
|
||||||
|
.line-author-settings-preview {
|
||||||
|
/* delegate text color to settings */
|
||||||
|
color: var(--obs-git-gutter-text);
|
||||||
|
font-family: monospace;
|
||||||
|
height: 100%; /* ensure, that age-based background color occupies entire parent */
|
||||||
|
text-align: right;
|
||||||
|
padding: 0px 6px 0px 6px;
|
||||||
|
white-space: pre; /* Keep spaces and do not collapse them. */
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 800px) {
|
||||||
|
/* hide git blame gutter not to superpose text */
|
||||||
|
.cm-gutterElement.obs-git-blame-gutter {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-unified-diff-view,
|
||||||
|
.git-split-diff-view .cm-deletedLine .cm-changedText {
|
||||||
|
background-color: #ee443330;
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-unified-diff-view,
|
||||||
|
.git-split-diff-view .cm-insertedLine .cm-changedText {
|
||||||
|
background-color: #22bb2230;
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-obscure-prompt[git-is-obscured="true"] #git-show-password:after {
|
||||||
|
-webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-eye"><path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"></path><circle cx="12" cy="12" r="3"></circle></svg>');
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-obscure-prompt[git-is-obscured="false"] #git-show-password:after {
|
||||||
|
-webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-eye-off"><path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"></path><path d="M14.084 14.158a3 3 0 0 1-4.242-4.242"></path><path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"></path><path d="m2 2 20 20"></path></svg>');
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Override styling of Codemirror merge view "collapsed lines" indicator */
|
||||||
|
.git-split-diff-view .ͼ2 .cm-collapsedLines {
|
||||||
|
background: var(--interactive-normal);
|
||||||
|
border-radius: var(--radius-m);
|
||||||
|
color: var(--text-accent);
|
||||||
|
font-size: var(--font-small);
|
||||||
|
padding: var(--size-4-1) var(--size-4-1);
|
||||||
|
}
|
||||||
|
.git-split-diff-view .ͼ2 .cm-collapsedLines:hover {
|
||||||
|
background: var(--interactive-hover);
|
||||||
|
color: var(--text-accent-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-signs-gutter {
|
||||||
|
.cm-gutterElement {
|
||||||
|
display: grid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-gutter-marker:hover {
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-gutter-marker.git-add {
|
||||||
|
background-color: var(--color-green);
|
||||||
|
justify-self: center;
|
||||||
|
height: inherit;
|
||||||
|
width: 0.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-gutter-marker.git-change {
|
||||||
|
background-color: var(--color-yellow);
|
||||||
|
justify-self: center;
|
||||||
|
height: inherit;
|
||||||
|
width: 0.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-gutter-marker.git-changedelete {
|
||||||
|
color: var(--color-yellow);
|
||||||
|
font-weight: var(--font-bold);
|
||||||
|
font-size: 1rem;
|
||||||
|
justify-self: center;
|
||||||
|
height: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-gutter-marker.git-delete {
|
||||||
|
background-color: var(--color-red);
|
||||||
|
height: 0.2rem;
|
||||||
|
width: 0.8rem;
|
||||||
|
align-self: end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-gutter-marker.git-topdelete {
|
||||||
|
background-color: var(--color-red);
|
||||||
|
height: 0.2rem;
|
||||||
|
width: 0.8rem;
|
||||||
|
align-self: start;
|
||||||
|
}
|
||||||
|
|
||||||
|
div:hover > .git-gutter-marker.git-change {
|
||||||
|
width: 0.6rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
div:hover > .git-gutter-marker.git-add {
|
||||||
|
width: 0.6rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
div:hover > .git-gutter-marker.git-delete {
|
||||||
|
height: 0.6rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
div:hover > .git-gutter-marker.git-topdelete {
|
||||||
|
height: 0.6rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
div:hover > .git-gutter-marker.git-changedelete {
|
||||||
|
font-weight: var(--font-bold);
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-gutter-marker.staged {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-diff {
|
||||||
|
.cm-merge-revert {
|
||||||
|
width: 4em;
|
||||||
|
}
|
||||||
|
/* Ensure that merge revert markers are positioned correctly */
|
||||||
|
.cm-merge-revert > * {
|
||||||
|
position: absolute;
|
||||||
|
background-color: var(--background-secondary);
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Prevent shifting of the editor when git signs gutter is the only gutter present */
|
||||||
|
.cm-gutters.cm-gutters-before:has(> .git-signs-gutter:only-child) {
|
||||||
|
margin-inline-end: 0;
|
||||||
|
.git-signs-gutter {
|
||||||
|
margin-inline-start: -1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-changes-status-bar-colored {
|
||||||
|
.git-add {
|
||||||
|
color: var(--color-green);
|
||||||
|
}
|
||||||
|
.git-change {
|
||||||
|
color: var(--color-yellow);
|
||||||
|
}
|
||||||
|
.git-delete {
|
||||||
|
color: var(--color-red);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-changes-status-bar .git-add {
|
||||||
|
margin-right: 0.3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-changes-status-bar .git-change {
|
||||||
|
margin-right: 0.3em;
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"imageNamePattern": "{{fileName}}_{{DATE:YYYY-MM-DD}}",
|
||||||
|
"dupNumberAtStart": false,
|
||||||
|
"dupNumberDelimiter": "-",
|
||||||
|
"dupNumberAlways": false,
|
||||||
|
"autoRename": false,
|
||||||
|
"handleAllAttachments": false,
|
||||||
|
"excludeExtensionPattern": "",
|
||||||
|
"disableRenameNotice": false
|
||||||
|
}
|
||||||
@@ -0,0 +1,944 @@
|
|||||||
|
/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD */
|
||||||
|
var __defProp = Object.defineProperty;
|
||||||
|
var __defProps = Object.defineProperties;
|
||||||
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||||
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
||||||
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||||
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
||||||
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||||
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
||||||
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||||
|
var __spreadValues = (a, b) => {
|
||||||
|
for (var prop in b || (b = {}))
|
||||||
|
if (__hasOwnProp.call(b, prop))
|
||||||
|
__defNormalProp(a, prop, b[prop]);
|
||||||
|
if (__getOwnPropSymbols)
|
||||||
|
for (var prop of __getOwnPropSymbols(b)) {
|
||||||
|
if (__propIsEnum.call(b, prop))
|
||||||
|
__defNormalProp(a, prop, b[prop]);
|
||||||
|
}
|
||||||
|
return a;
|
||||||
|
};
|
||||||
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
||||||
|
var __commonJS = (cb, mod) => function __require() {
|
||||||
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||||
|
};
|
||||||
|
var __export = (target, all) => {
|
||||||
|
for (var name in all)
|
||||||
|
__defProp(target, name, { get: all[name], enumerable: true });
|
||||||
|
};
|
||||||
|
var __copyProps = (to, from, except, desc) => {
|
||||||
|
if (from && typeof from === "object" || typeof from === "function") {
|
||||||
|
for (let key of __getOwnPropNames(from))
|
||||||
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||||
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
};
|
||||||
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||||
|
var __async = (__this, __arguments, generator) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
var fulfilled = (value) => {
|
||||||
|
try {
|
||||||
|
step(generator.next(value));
|
||||||
|
} catch (e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var rejected = (value) => {
|
||||||
|
try {
|
||||||
|
step(generator.throw(value));
|
||||||
|
} catch (e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
||||||
|
step((generator = generator.apply(__this, __arguments)).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// package.json
|
||||||
|
var require_package = __commonJS({
|
||||||
|
"package.json"(exports, module2) {
|
||||||
|
module2.exports = {
|
||||||
|
name: "obsidian-paste-image-rename",
|
||||||
|
version: "1.6.1",
|
||||||
|
main: "main.js",
|
||||||
|
scripts: {
|
||||||
|
start: "node esbuild.config.mjs",
|
||||||
|
build: "tsc -noEmit -skipLibCheck && BUILD_ENV=production node esbuild.config.mjs && cp manifest.json build",
|
||||||
|
version: "node version-bump.mjs && git add manifest.json versions.json",
|
||||||
|
release: "npm run build && gh release create ${npm_package_version} build/*"
|
||||||
|
},
|
||||||
|
keywords: [],
|
||||||
|
author: "Reorx",
|
||||||
|
license: "MIT",
|
||||||
|
devDependencies: {
|
||||||
|
"@types/node": "^18.11.18",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^5.49.0",
|
||||||
|
"@typescript-eslint/parser": "^5.49.0",
|
||||||
|
"builtin-modules": "^3.3.0",
|
||||||
|
esbuild: "0.16.17",
|
||||||
|
obsidian: "^1.1.1",
|
||||||
|
tslib: "2.5.0",
|
||||||
|
typescript: "4.9.4"
|
||||||
|
},
|
||||||
|
dependencies: {
|
||||||
|
"cash-dom": "^8.1.2"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// src/main.ts
|
||||||
|
var main_exports = {};
|
||||||
|
__export(main_exports, {
|
||||||
|
default: () => PasteImageRenamePlugin
|
||||||
|
});
|
||||||
|
module.exports = __toCommonJS(main_exports);
|
||||||
|
var import_obsidian2 = require("obsidian");
|
||||||
|
|
||||||
|
// src/batch.ts
|
||||||
|
var import_obsidian = require("obsidian");
|
||||||
|
|
||||||
|
// src/utils.ts
|
||||||
|
var DEBUG = false;
|
||||||
|
if (DEBUG)
|
||||||
|
console.log("DEBUG is enabled");
|
||||||
|
function debugLog(...args) {
|
||||||
|
if (DEBUG) {
|
||||||
|
console.log(new Date().toISOString().slice(11, 23), ...args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function createElementTree(rootEl, opts) {
|
||||||
|
const result = {
|
||||||
|
el: rootEl.createEl(opts.tag, opts),
|
||||||
|
children: []
|
||||||
|
};
|
||||||
|
const children = opts.children || [];
|
||||||
|
for (const child of children) {
|
||||||
|
result.children.push(createElementTree(result.el, child));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
var path = {
|
||||||
|
// Credit: @creationix/path.js
|
||||||
|
join(...partSegments) {
|
||||||
|
let parts = [];
|
||||||
|
for (let i = 0, l = partSegments.length; i < l; i++) {
|
||||||
|
parts = parts.concat(partSegments[i].split("/"));
|
||||||
|
}
|
||||||
|
const newParts = [];
|
||||||
|
for (let i = 0, l = parts.length; i < l; i++) {
|
||||||
|
const part = parts[i];
|
||||||
|
if (!part || part === ".")
|
||||||
|
continue;
|
||||||
|
else
|
||||||
|
newParts.push(part);
|
||||||
|
}
|
||||||
|
if (parts[0] === "")
|
||||||
|
newParts.unshift("");
|
||||||
|
return newParts.join("/");
|
||||||
|
},
|
||||||
|
// returns the last part of a path, e.g. 'foo.jpg'
|
||||||
|
basename(fullpath) {
|
||||||
|
const sp = fullpath.split("/");
|
||||||
|
return sp[sp.length - 1];
|
||||||
|
},
|
||||||
|
// return extension without dot, e.g. 'jpg'
|
||||||
|
extension(fullpath) {
|
||||||
|
const positions = [...fullpath.matchAll(new RegExp("\\.", "gi"))].map((a) => a.index);
|
||||||
|
return fullpath.slice(positions[positions.length - 1] + 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var filenameNotAllowedChars = /[^\p{L}0-9~`!@$&*()\-_=+{};'",<.>? ]/ug;
|
||||||
|
var sanitizer = {
|
||||||
|
filename(s) {
|
||||||
|
return s.replace(filenameNotAllowedChars, "").trim();
|
||||||
|
},
|
||||||
|
delimiter(s) {
|
||||||
|
s = this.filename(s);
|
||||||
|
if (!s)
|
||||||
|
s = "-";
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
function escapeRegExp(s) {
|
||||||
|
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||||
|
}
|
||||||
|
function lockInputMethodComposition(el) {
|
||||||
|
const state = {
|
||||||
|
lock: false
|
||||||
|
};
|
||||||
|
el.addEventListener("compositionstart", () => {
|
||||||
|
state.lock = true;
|
||||||
|
});
|
||||||
|
el.addEventListener("compositionend", () => {
|
||||||
|
state.lock = false;
|
||||||
|
});
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
// src/batch.ts
|
||||||
|
var ImageBatchRenameModal = class extends import_obsidian.Modal {
|
||||||
|
constructor(app, activeFile, renameFunc, onClose) {
|
||||||
|
super(app);
|
||||||
|
this.activeFile = activeFile;
|
||||||
|
this.renameFunc = renameFunc;
|
||||||
|
this.onCloseExtra = onClose;
|
||||||
|
this.state = {
|
||||||
|
namePattern: "",
|
||||||
|
extPattern: "",
|
||||||
|
nameReplace: "",
|
||||||
|
renameTasks: []
|
||||||
|
};
|
||||||
|
}
|
||||||
|
onOpen() {
|
||||||
|
this.containerEl.addClass("image-rename-modal");
|
||||||
|
const { contentEl, titleEl } = this;
|
||||||
|
titleEl.setText("Batch rename embeded files");
|
||||||
|
const namePatternSetting = new import_obsidian.Setting(contentEl).setName("Name pattern").setDesc("Please input the name pattern to match files (regex)").addText((text) => text.setValue(this.state.namePattern).onChange(
|
||||||
|
(value) => __async(this, null, function* () {
|
||||||
|
this.state.namePattern = value;
|
||||||
|
})
|
||||||
|
));
|
||||||
|
const npInputEl = namePatternSetting.controlEl.children[0];
|
||||||
|
npInputEl.focus();
|
||||||
|
const npInputState = lockInputMethodComposition(npInputEl);
|
||||||
|
npInputEl.addEventListener("keydown", (e) => __async(this, null, function* () {
|
||||||
|
if (e.key === "Enter" && !npInputState.lock) {
|
||||||
|
e.preventDefault();
|
||||||
|
if (!this.state.namePattern) {
|
||||||
|
errorEl.innerText = 'Error: "Name pattern" could not be empty';
|
||||||
|
errorEl.style.display = "block";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.matchImageNames(tbodyEl);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
const extPatternSetting = new import_obsidian.Setting(contentEl).setName("Extension pattern").setDesc("Please input the extension pattern to match files (regex)").addText((text) => text.setValue(this.state.extPattern).onChange(
|
||||||
|
(value) => __async(this, null, function* () {
|
||||||
|
this.state.extPattern = value;
|
||||||
|
})
|
||||||
|
));
|
||||||
|
const extInputEl = extPatternSetting.controlEl.children[0];
|
||||||
|
extInputEl.addEventListener("keydown", (e) => __async(this, null, function* () {
|
||||||
|
if (e.key === "Enter") {
|
||||||
|
e.preventDefault();
|
||||||
|
this.matchImageNames(tbodyEl);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
const nameReplaceSetting = new import_obsidian.Setting(contentEl).setName("Name replace").setDesc("Please input the string to replace the matched name (use $1, $2 for regex groups)").addText((text) => text.setValue(this.state.nameReplace).onChange(
|
||||||
|
(value) => __async(this, null, function* () {
|
||||||
|
this.state.nameReplace = value;
|
||||||
|
})
|
||||||
|
));
|
||||||
|
const nrInputEl = nameReplaceSetting.controlEl.children[0];
|
||||||
|
const nrInputState = lockInputMethodComposition(nrInputEl);
|
||||||
|
nrInputEl.addEventListener("keydown", (e) => __async(this, null, function* () {
|
||||||
|
if (e.key === "Enter" && !nrInputState.lock) {
|
||||||
|
e.preventDefault();
|
||||||
|
this.matchImageNames(tbodyEl);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
const matchedContainer = contentEl.createDiv({
|
||||||
|
cls: "matched-container"
|
||||||
|
});
|
||||||
|
const tableET = createElementTree(matchedContainer, {
|
||||||
|
tag: "table",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
tag: "thead",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
tag: "tr",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
tag: "td",
|
||||||
|
text: "Original path"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tag: "td",
|
||||||
|
text: "Renamed Name"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tag: "tbody"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
const tbodyEl = tableET.children[1].el;
|
||||||
|
const errorEl = contentEl.createDiv({
|
||||||
|
cls: "error",
|
||||||
|
attr: {
|
||||||
|
style: "display: none;"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
new import_obsidian.Setting(contentEl).addButton((button) => {
|
||||||
|
button.setButtonText("Rename all").setClass("mod-cta").onClick(() => {
|
||||||
|
new ConfirmModal(
|
||||||
|
this.app,
|
||||||
|
"Confirm rename all",
|
||||||
|
`Are you sure? This will rename all the ${this.state.renameTasks.length} images matched the pattern.`,
|
||||||
|
() => {
|
||||||
|
this.renameAll();
|
||||||
|
this.close();
|
||||||
|
}
|
||||||
|
).open();
|
||||||
|
});
|
||||||
|
}).addButton((button) => {
|
||||||
|
button.setButtonText("Cancel").onClick(() => {
|
||||||
|
this.close();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
onClose() {
|
||||||
|
const { contentEl } = this;
|
||||||
|
contentEl.empty();
|
||||||
|
this.onCloseExtra();
|
||||||
|
}
|
||||||
|
renameAll() {
|
||||||
|
return __async(this, null, function* () {
|
||||||
|
debugLog("renameAll", this.state);
|
||||||
|
for (const task of this.state.renameTasks) {
|
||||||
|
yield this.renameFunc(task.file, task.name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
matchImageNames(tbodyEl) {
|
||||||
|
const { state } = this;
|
||||||
|
const renameTasks = [];
|
||||||
|
tbodyEl.empty();
|
||||||
|
const fileCache = this.app.metadataCache.getFileCache(this.activeFile);
|
||||||
|
if (!fileCache || !fileCache.embeds)
|
||||||
|
return;
|
||||||
|
const namePatternRegex = new RegExp(state.namePattern, "g");
|
||||||
|
const extPatternRegex = new RegExp(state.extPattern);
|
||||||
|
fileCache.embeds.forEach((embed) => {
|
||||||
|
const file = this.app.metadataCache.getFirstLinkpathDest(embed.link, this.activeFile.path);
|
||||||
|
if (!file) {
|
||||||
|
console.warn("file not found", embed.link);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (state.extPattern) {
|
||||||
|
const m0 = extPatternRegex.exec(file.extension);
|
||||||
|
if (!m0)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const stem = file.basename;
|
||||||
|
namePatternRegex.lastIndex = 0;
|
||||||
|
const m1 = namePatternRegex.exec(stem);
|
||||||
|
if (!m1)
|
||||||
|
return;
|
||||||
|
let renamedName = file.name;
|
||||||
|
if (state.nameReplace) {
|
||||||
|
namePatternRegex.lastIndex = 0;
|
||||||
|
renamedName = stem.replace(namePatternRegex, state.nameReplace);
|
||||||
|
renamedName = `${renamedName}.${file.extension}`;
|
||||||
|
}
|
||||||
|
renameTasks.push({
|
||||||
|
file,
|
||||||
|
name: renamedName
|
||||||
|
});
|
||||||
|
createElementTree(tbodyEl, {
|
||||||
|
tag: "tr",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
tag: "td",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
tag: "span",
|
||||||
|
text: file.name
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tag: "div",
|
||||||
|
text: file.path,
|
||||||
|
attr: {
|
||||||
|
class: "file-path"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tag: "td",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
tag: "span",
|
||||||
|
text: renamedName
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tag: "div",
|
||||||
|
text: path.join(file.parent.path, renamedName),
|
||||||
|
attr: {
|
||||||
|
class: "file-path"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
debugLog("new renameTasks", renameTasks);
|
||||||
|
state.renameTasks = renameTasks;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var ConfirmModal = class extends import_obsidian.Modal {
|
||||||
|
constructor(app, title, message, onConfirm) {
|
||||||
|
super(app);
|
||||||
|
this.title = title;
|
||||||
|
this.message = message;
|
||||||
|
this.onConfirm = onConfirm;
|
||||||
|
}
|
||||||
|
onOpen() {
|
||||||
|
const { contentEl, titleEl } = this;
|
||||||
|
titleEl.setText(this.title);
|
||||||
|
contentEl.createEl("p", {
|
||||||
|
text: this.message
|
||||||
|
});
|
||||||
|
new import_obsidian.Setting(contentEl).addButton((button) => {
|
||||||
|
button.setButtonText("Yes").setClass("mod-warning").onClick(() => {
|
||||||
|
this.onConfirm();
|
||||||
|
this.close();
|
||||||
|
});
|
||||||
|
}).addButton((button) => {
|
||||||
|
button.setButtonText("No").onClick(() => {
|
||||||
|
this.close();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// src/template.ts
|
||||||
|
var dateTmplRegex = /{{DATE:([^}]+)}}/gm;
|
||||||
|
var frontmatterTmplRegex = /{{frontmatter:([^}]+)}}/gm;
|
||||||
|
var replaceDateVar = (s, date) => {
|
||||||
|
const m = dateTmplRegex.exec(s);
|
||||||
|
if (!m)
|
||||||
|
return s;
|
||||||
|
return s.replace(m[0], date.format(m[1]));
|
||||||
|
};
|
||||||
|
var replaceFrontmatterVar = (s, frontmatter) => {
|
||||||
|
if (!frontmatter)
|
||||||
|
return s;
|
||||||
|
const m = frontmatterTmplRegex.exec(s);
|
||||||
|
if (!m)
|
||||||
|
return s;
|
||||||
|
return s.replace(m[0], frontmatter[m[1]] || "");
|
||||||
|
};
|
||||||
|
var renderTemplate = (tmpl, data, frontmatter) => {
|
||||||
|
const now = window.moment();
|
||||||
|
let text = tmpl;
|
||||||
|
let newtext;
|
||||||
|
while ((newtext = replaceDateVar(text, now)) != text) {
|
||||||
|
text = newtext;
|
||||||
|
}
|
||||||
|
while ((newtext = replaceFrontmatterVar(text, frontmatter)) != text) {
|
||||||
|
text = newtext;
|
||||||
|
}
|
||||||
|
text = text.replace(/{{imageNameKey}}/gm, data.imageNameKey).replace(/{{fileName}}/gm, data.fileName).replace(/{{dirName}}/gm, data.dirName).replace(/{{firstHeading}}/gm, data.firstHeading);
|
||||||
|
return text;
|
||||||
|
};
|
||||||
|
|
||||||
|
// src/main.ts
|
||||||
|
var DEFAULT_SETTINGS = {
|
||||||
|
imageNamePattern: "{{fileName}}",
|
||||||
|
dupNumberAtStart: false,
|
||||||
|
dupNumberDelimiter: "-",
|
||||||
|
dupNumberAlways: false,
|
||||||
|
autoRename: false,
|
||||||
|
handleAllAttachments: false,
|
||||||
|
excludeExtensionPattern: "",
|
||||||
|
disableRenameNotice: false
|
||||||
|
};
|
||||||
|
var PASTED_IMAGE_PREFIX = "Pasted image ";
|
||||||
|
var PasteImageRenamePlugin = class extends import_obsidian2.Plugin {
|
||||||
|
constructor() {
|
||||||
|
super(...arguments);
|
||||||
|
this.modals = [];
|
||||||
|
}
|
||||||
|
onload() {
|
||||||
|
return __async(this, null, function* () {
|
||||||
|
const pkg = require_package();
|
||||||
|
console.log(`Plugin loading: ${pkg.name} ${pkg.version} BUILD_ENV=${"production"}`);
|
||||||
|
yield this.loadSettings();
|
||||||
|
this.registerEvent(
|
||||||
|
this.app.vault.on("create", (file) => {
|
||||||
|
if (!(file instanceof import_obsidian2.TFile))
|
||||||
|
return;
|
||||||
|
const timeGapMs = new Date().getTime() - file.stat.ctime;
|
||||||
|
if (timeGapMs > 1e3)
|
||||||
|
return;
|
||||||
|
if (isMarkdownFile(file))
|
||||||
|
return;
|
||||||
|
if (isPastedImage(file)) {
|
||||||
|
debugLog("pasted image created", file);
|
||||||
|
this.startRenameProcess(file, this.settings.autoRename);
|
||||||
|
} else {
|
||||||
|
if (this.settings.handleAllAttachments) {
|
||||||
|
debugLog("handleAllAttachments for file", file);
|
||||||
|
if (this.testExcludeExtension(file)) {
|
||||||
|
debugLog("excluded file by ext", file);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.startRenameProcess(file, this.settings.autoRename);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
const startBatchRenameProcess = () => {
|
||||||
|
this.openBatchRenameModal();
|
||||||
|
};
|
||||||
|
this.addCommand({
|
||||||
|
id: "batch-rename-embeded-files",
|
||||||
|
name: "Batch rename embeded files (in the current file)",
|
||||||
|
callback: startBatchRenameProcess
|
||||||
|
});
|
||||||
|
if (DEBUG) {
|
||||||
|
this.addRibbonIcon("wand-glyph", "Batch rename embeded files", startBatchRenameProcess);
|
||||||
|
}
|
||||||
|
const batchRenameAllImages = () => {
|
||||||
|
this.batchRenameAllImages();
|
||||||
|
};
|
||||||
|
this.addCommand({
|
||||||
|
id: "batch-rename-all-images",
|
||||||
|
name: "Batch rename all images instantly (in the current file)",
|
||||||
|
callback: batchRenameAllImages
|
||||||
|
});
|
||||||
|
if (DEBUG) {
|
||||||
|
this.addRibbonIcon("wand-glyph", "Batch rename all images instantly (in the current file)", batchRenameAllImages);
|
||||||
|
}
|
||||||
|
this.addSettingTab(new SettingTab(this.app, this));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
startRenameProcess(file, autoRename = false) {
|
||||||
|
return __async(this, null, function* () {
|
||||||
|
const activeFile = this.getActiveFile();
|
||||||
|
if (!activeFile) {
|
||||||
|
new import_obsidian2.Notice("Error: No active file found.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const { stem, newName, isMeaningful } = this.generateNewName(file, activeFile);
|
||||||
|
debugLog("generated newName:", newName, isMeaningful);
|
||||||
|
if (!isMeaningful || !autoRename) {
|
||||||
|
this.openRenameModal(file, isMeaningful ? stem : "", activeFile.path);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.renameFile(file, newName, activeFile.path, true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
renameFile(file, inputNewName, sourcePath, replaceCurrentLine) {
|
||||||
|
return __async(this, null, function* () {
|
||||||
|
const { name: newName } = yield this.deduplicateNewName(inputNewName, file);
|
||||||
|
debugLog("deduplicated newName:", newName);
|
||||||
|
const originName = file.name;
|
||||||
|
const linkText = this.app.fileManager.generateMarkdownLink(file, sourcePath);
|
||||||
|
const newPath = path.join(file.parent.path, newName);
|
||||||
|
try {
|
||||||
|
yield this.app.fileManager.renameFile(file, newPath);
|
||||||
|
} catch (err) {
|
||||||
|
new import_obsidian2.Notice(`Failed to rename ${newName}: ${err}`);
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
if (!replaceCurrentLine) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const newLinkText = this.app.fileManager.generateMarkdownLink(file, sourcePath);
|
||||||
|
debugLog("replace text", linkText, newLinkText);
|
||||||
|
const editor = this.getActiveEditor();
|
||||||
|
if (!editor) {
|
||||||
|
new import_obsidian2.Notice(`Failed to rename ${newName}: no active editor`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const cursor = editor.getCursor();
|
||||||
|
const line = editor.getLine(cursor.line);
|
||||||
|
const replacedLine = line.replace(linkText, newLinkText);
|
||||||
|
debugLog("current line -> replaced line", line, replacedLine);
|
||||||
|
editor.transaction({
|
||||||
|
changes: [
|
||||||
|
{
|
||||||
|
from: __spreadProps(__spreadValues({}, cursor), { ch: 0 }),
|
||||||
|
to: __spreadProps(__spreadValues({}, cursor), { ch: line.length }),
|
||||||
|
text: replacedLine
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
if (!this.settings.disableRenameNotice) {
|
||||||
|
new import_obsidian2.Notice(`Renamed ${originName} to ${newName}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
openRenameModal(file, newName, sourcePath) {
|
||||||
|
const modal = new ImageRenameModal(
|
||||||
|
this.app,
|
||||||
|
file,
|
||||||
|
newName,
|
||||||
|
(confirmedName) => {
|
||||||
|
debugLog("confirmedName:", confirmedName);
|
||||||
|
this.renameFile(file, confirmedName, sourcePath, true);
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
this.modals.splice(this.modals.indexOf(modal), 1);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
this.modals.push(modal);
|
||||||
|
modal.open();
|
||||||
|
debugLog("modals count", this.modals.length);
|
||||||
|
}
|
||||||
|
openBatchRenameModal() {
|
||||||
|
const activeFile = this.getActiveFile();
|
||||||
|
const modal = new ImageBatchRenameModal(
|
||||||
|
this.app,
|
||||||
|
activeFile,
|
||||||
|
(file, name) => __async(this, null, function* () {
|
||||||
|
yield this.renameFile(file, name, activeFile.path);
|
||||||
|
}),
|
||||||
|
() => {
|
||||||
|
this.modals.splice(this.modals.indexOf(modal), 1);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
this.modals.push(modal);
|
||||||
|
modal.open();
|
||||||
|
}
|
||||||
|
batchRenameAllImages() {
|
||||||
|
return __async(this, null, function* () {
|
||||||
|
const activeFile = this.getActiveFile();
|
||||||
|
const fileCache = this.app.metadataCache.getFileCache(activeFile);
|
||||||
|
if (!fileCache || !fileCache.embeds)
|
||||||
|
return;
|
||||||
|
const extPatternRegex = /jpe?g|png|gif|tiff|webp/i;
|
||||||
|
for (const embed of fileCache.embeds) {
|
||||||
|
const file = this.app.metadataCache.getFirstLinkpathDest(embed.link, activeFile.path);
|
||||||
|
if (!file) {
|
||||||
|
console.warn("file not found", embed.link);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const m0 = extPatternRegex.exec(file.extension);
|
||||||
|
if (!m0)
|
||||||
|
return;
|
||||||
|
const { newName, isMeaningful } = this.generateNewName(file, activeFile);
|
||||||
|
debugLog("generated newName:", newName, isMeaningful);
|
||||||
|
if (!isMeaningful) {
|
||||||
|
new import_obsidian2.Notice("Failed to batch rename images: the generated name is not meaningful");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
yield this.renameFile(file, newName, activeFile.path, false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// returns a new name for the input file, with extension
|
||||||
|
generateNewName(file, activeFile) {
|
||||||
|
let imageNameKey = "";
|
||||||
|
let firstHeading = "";
|
||||||
|
let frontmatter;
|
||||||
|
const fileCache = this.app.metadataCache.getFileCache(activeFile);
|
||||||
|
if (fileCache) {
|
||||||
|
debugLog("frontmatter", fileCache.frontmatter);
|
||||||
|
frontmatter = fileCache.frontmatter;
|
||||||
|
imageNameKey = (frontmatter == null ? void 0 : frontmatter.imageNameKey) || "";
|
||||||
|
firstHeading = getFirstHeading(fileCache.headings);
|
||||||
|
} else {
|
||||||
|
console.warn("could not get file cache from active file", activeFile.name);
|
||||||
|
}
|
||||||
|
const stem = renderTemplate(
|
||||||
|
this.settings.imageNamePattern,
|
||||||
|
{
|
||||||
|
imageNameKey,
|
||||||
|
fileName: activeFile.basename,
|
||||||
|
dirName: activeFile.parent.name,
|
||||||
|
firstHeading
|
||||||
|
},
|
||||||
|
frontmatter
|
||||||
|
);
|
||||||
|
const meaninglessRegex = new RegExp(`[${this.settings.dupNumberDelimiter}\\s]`, "gm");
|
||||||
|
return {
|
||||||
|
stem,
|
||||||
|
newName: stem + "." + file.extension,
|
||||||
|
isMeaningful: stem.replace(meaninglessRegex, "") !== ""
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// newName: foo.ext
|
||||||
|
deduplicateNewName(newName, file) {
|
||||||
|
return __async(this, null, function* () {
|
||||||
|
const dir = file.parent.path;
|
||||||
|
const listed = yield this.app.vault.adapter.list(dir);
|
||||||
|
debugLog("sibling files", listed);
|
||||||
|
const newNameExt = path.extension(newName), newNameStem = newName.slice(0, newName.length - newNameExt.length - 1), newNameStemEscaped = escapeRegExp(newNameStem), delimiter = this.settings.dupNumberDelimiter, delimiterEscaped = escapeRegExp(delimiter);
|
||||||
|
let dupNameRegex;
|
||||||
|
if (this.settings.dupNumberAtStart) {
|
||||||
|
dupNameRegex = new RegExp(
|
||||||
|
`^(?<number>\\d+)${delimiterEscaped}(?<name>${newNameStemEscaped})\\.${newNameExt}$`
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
dupNameRegex = new RegExp(
|
||||||
|
`^(?<name>${newNameStemEscaped})${delimiterEscaped}(?<number>\\d+)\\.${newNameExt}$`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
debugLog("dupNameRegex", dupNameRegex);
|
||||||
|
const dupNameNumbers = [];
|
||||||
|
let isNewNameExist = false;
|
||||||
|
for (let sibling of listed.files) {
|
||||||
|
sibling = path.basename(sibling);
|
||||||
|
if (sibling == newName) {
|
||||||
|
isNewNameExist = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const m = dupNameRegex.exec(sibling);
|
||||||
|
if (!m)
|
||||||
|
continue;
|
||||||
|
dupNameNumbers.push(parseInt(m.groups.number));
|
||||||
|
}
|
||||||
|
if (isNewNameExist || this.settings.dupNumberAlways) {
|
||||||
|
const newNumber = dupNameNumbers.length > 0 ? Math.max(...dupNameNumbers) + 1 : 1;
|
||||||
|
if (this.settings.dupNumberAtStart) {
|
||||||
|
newName = `${newNumber}${delimiter}${newNameStem}.${newNameExt}`;
|
||||||
|
} else {
|
||||||
|
newName = `${newNameStem}${delimiter}${newNumber}.${newNameExt}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
name: newName,
|
||||||
|
stem: newName.slice(0, newName.length - newNameExt.length - 1),
|
||||||
|
extension: newNameExt
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getActiveFile() {
|
||||||
|
const view = this.app.workspace.getActiveViewOfType(import_obsidian2.MarkdownView);
|
||||||
|
const file = view == null ? void 0 : view.file;
|
||||||
|
debugLog("active file", file == null ? void 0 : file.path);
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
getActiveEditor() {
|
||||||
|
const view = this.app.workspace.getActiveViewOfType(import_obsidian2.MarkdownView);
|
||||||
|
return view == null ? void 0 : view.editor;
|
||||||
|
}
|
||||||
|
onunload() {
|
||||||
|
this.modals.map((modal) => modal.close());
|
||||||
|
}
|
||||||
|
testExcludeExtension(file) {
|
||||||
|
const pattern = this.settings.excludeExtensionPattern;
|
||||||
|
if (!pattern)
|
||||||
|
return false;
|
||||||
|
return new RegExp(pattern).test(file.extension);
|
||||||
|
}
|
||||||
|
loadSettings() {
|
||||||
|
return __async(this, null, function* () {
|
||||||
|
this.settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
saveSettings() {
|
||||||
|
return __async(this, null, function* () {
|
||||||
|
yield this.saveData(this.settings);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
function getFirstHeading(headings) {
|
||||||
|
if (headings && headings.length > 0) {
|
||||||
|
for (const heading of headings) {
|
||||||
|
if (heading.level === 1) {
|
||||||
|
return heading.heading;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
function isPastedImage(file) {
|
||||||
|
if (file instanceof import_obsidian2.TFile) {
|
||||||
|
if (file.name.startsWith(PASTED_IMAGE_PREFIX)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
function isMarkdownFile(file) {
|
||||||
|
if (file instanceof import_obsidian2.TFile) {
|
||||||
|
if (file.extension === "md") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var ImageRenameModal = class extends import_obsidian2.Modal {
|
||||||
|
constructor(app, src, stem, renameFunc, onClose) {
|
||||||
|
super(app);
|
||||||
|
this.src = src;
|
||||||
|
this.stem = stem;
|
||||||
|
this.renameFunc = renameFunc;
|
||||||
|
this.onCloseExtra = onClose;
|
||||||
|
}
|
||||||
|
onOpen() {
|
||||||
|
this.containerEl.addClass("image-rename-modal");
|
||||||
|
const { contentEl, titleEl } = this;
|
||||||
|
titleEl.setText("Rename image");
|
||||||
|
const imageContainer = contentEl.createDiv({
|
||||||
|
cls: "image-container"
|
||||||
|
});
|
||||||
|
imageContainer.createEl("img", {
|
||||||
|
attr: {
|
||||||
|
src: this.app.vault.getResourcePath(this.src)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
let stem = this.stem;
|
||||||
|
const ext = this.src.extension;
|
||||||
|
const getNewName = (stem2) => stem2 + "." + ext;
|
||||||
|
const getNewPath = (stem2) => path.join(this.src.parent.path, getNewName(stem2));
|
||||||
|
const infoET = createElementTree(contentEl, {
|
||||||
|
tag: "ul",
|
||||||
|
cls: "info",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
tag: "li",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
tag: "span",
|
||||||
|
text: "Origin path"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tag: "span",
|
||||||
|
text: this.src.path
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tag: "li",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
tag: "span",
|
||||||
|
text: "New path"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tag: "span",
|
||||||
|
text: getNewPath(stem)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
const doRename = () => __async(this, null, function* () {
|
||||||
|
debugLog("doRename", `stem=${stem}`);
|
||||||
|
this.renameFunc(getNewName(stem));
|
||||||
|
});
|
||||||
|
const nameSetting = new import_obsidian2.Setting(contentEl).setName("New name").setDesc("Please input the new name for the image (without extension)").addText((text) => text.setValue(stem).onChange(
|
||||||
|
(value) => __async(this, null, function* () {
|
||||||
|
stem = sanitizer.filename(value);
|
||||||
|
infoET.children[1].children[1].el.innerText = getNewPath(stem);
|
||||||
|
})
|
||||||
|
));
|
||||||
|
const nameInputEl = nameSetting.controlEl.children[0];
|
||||||
|
nameInputEl.focus();
|
||||||
|
const nameInputState = lockInputMethodComposition(nameInputEl);
|
||||||
|
nameInputEl.addEventListener("keydown", (e) => __async(this, null, function* () {
|
||||||
|
if (e.key === "Enter" && !nameInputState.lock) {
|
||||||
|
e.preventDefault();
|
||||||
|
if (!stem) {
|
||||||
|
errorEl.innerText = 'Error: "New name" could not be empty';
|
||||||
|
errorEl.style.display = "block";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
doRename();
|
||||||
|
this.close();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
const errorEl = contentEl.createDiv({
|
||||||
|
cls: "error",
|
||||||
|
attr: {
|
||||||
|
style: "display: none;"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
new import_obsidian2.Setting(contentEl).addButton((button) => {
|
||||||
|
button.setButtonText("Rename").onClick(() => {
|
||||||
|
doRename();
|
||||||
|
this.close();
|
||||||
|
});
|
||||||
|
}).addButton((button) => {
|
||||||
|
button.setButtonText("Cancel").onClick(() => {
|
||||||
|
this.close();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
onClose() {
|
||||||
|
const { contentEl } = this;
|
||||||
|
contentEl.empty();
|
||||||
|
this.onCloseExtra();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var imageNamePatternDesc = `
|
||||||
|
The pattern indicates how the new name should be generated.
|
||||||
|
|
||||||
|
Available variables:
|
||||||
|
- {{fileName}}: name of the active file, without ".md" extension.
|
||||||
|
- {{imageNameKey}}: this variable is read from the markdown file's frontmatter, from the same key "imageNameKey".
|
||||||
|
- {{DATE:$FORMAT}}: use "$FORMAT" to format the current date, "$FORMAT" must be a Moment.js format string, e.g. {{DATE:YYYY-MM-DD}}.
|
||||||
|
|
||||||
|
Here are some examples from pattern to image names (repeat in sequence), variables: fileName = "My note", imageNameKey = "foo":
|
||||||
|
- {{fileName}}: My note, My note-1, My note-2
|
||||||
|
- {{imageNameKey}}: foo, foo-1, foo-2
|
||||||
|
- {{imageNameKey}}-{{DATE:YYYYMMDD}}: foo-20220408, foo-20220408-1, foo-20220408-2
|
||||||
|
`;
|
||||||
|
var SettingTab = class extends import_obsidian2.PluginSettingTab {
|
||||||
|
constructor(app, plugin) {
|
||||||
|
super(app, plugin);
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
display() {
|
||||||
|
const { containerEl } = this;
|
||||||
|
containerEl.empty();
|
||||||
|
new import_obsidian2.Setting(containerEl).setName("Image name pattern").setDesc(imageNamePatternDesc).setClass("long-description-setting-item").addText((text) => text.setPlaceholder("{{imageNameKey}}").setValue(this.plugin.settings.imageNamePattern).onChange(
|
||||||
|
(value) => __async(this, null, function* () {
|
||||||
|
this.plugin.settings.imageNamePattern = value;
|
||||||
|
yield this.plugin.saveSettings();
|
||||||
|
})
|
||||||
|
));
|
||||||
|
new import_obsidian2.Setting(containerEl).setName("Duplicate number at start (or end)").setDesc(`If enabled, duplicate number will be added at the start as prefix for the image name, otherwise it will be added at the end as suffix for the image name.`).addToggle((toggle) => toggle.setValue(this.plugin.settings.dupNumberAtStart).onChange(
|
||||||
|
(value) => __async(this, null, function* () {
|
||||||
|
this.plugin.settings.dupNumberAtStart = value;
|
||||||
|
yield this.plugin.saveSettings();
|
||||||
|
})
|
||||||
|
));
|
||||||
|
new import_obsidian2.Setting(containerEl).setName("Duplicate number delimiter").setDesc(`The delimiter to generate the number prefix/suffix for duplicated names. For example, if the value is "-", the suffix will be like "-1", "-2", "-3", and the prefix will be like "1-", "2-", "3-". Only characters that are valid in file names are allowed.`).addText((text) => text.setValue(this.plugin.settings.dupNumberDelimiter).onChange(
|
||||||
|
(value) => __async(this, null, function* () {
|
||||||
|
this.plugin.settings.dupNumberDelimiter = sanitizer.delimiter(value);
|
||||||
|
yield this.plugin.saveSettings();
|
||||||
|
})
|
||||||
|
));
|
||||||
|
new import_obsidian2.Setting(containerEl).setName("Always add duplicate number").setDesc(`If enabled, duplicate number will always be added to the image name. Otherwise, it will only be added when the name is duplicated.`).addToggle((toggle) => toggle.setValue(this.plugin.settings.dupNumberAlways).onChange(
|
||||||
|
(value) => __async(this, null, function* () {
|
||||||
|
this.plugin.settings.dupNumberAlways = value;
|
||||||
|
yield this.plugin.saveSettings();
|
||||||
|
})
|
||||||
|
));
|
||||||
|
new import_obsidian2.Setting(containerEl).setName("Auto rename").setDesc(`By default, the rename modal will always be shown to confirm before renaming, if this option is set, the image will be auto renamed after pasting.`).addToggle((toggle) => toggle.setValue(this.plugin.settings.autoRename).onChange(
|
||||||
|
(value) => __async(this, null, function* () {
|
||||||
|
this.plugin.settings.autoRename = value;
|
||||||
|
yield this.plugin.saveSettings();
|
||||||
|
})
|
||||||
|
));
|
||||||
|
new import_obsidian2.Setting(containerEl).setName("Handle all attachments").setDesc(`By default, the plugin only handles images that starts with "Pasted image " in name,
|
||||||
|
which is the prefix Obsidian uses to create images from pasted content.
|
||||||
|
If this option is set, the plugin will handle all attachments that are created in the vault.`).addToggle((toggle) => toggle.setValue(this.plugin.settings.handleAllAttachments).onChange(
|
||||||
|
(value) => __async(this, null, function* () {
|
||||||
|
this.plugin.settings.handleAllAttachments = value;
|
||||||
|
yield this.plugin.saveSettings();
|
||||||
|
})
|
||||||
|
));
|
||||||
|
new import_obsidian2.Setting(containerEl).setName("Exclude extension pattern").setDesc(`This option is only useful when "Handle all attachments" is enabled.
|
||||||
|
Write a Regex pattern to exclude certain extensions from being handled. Only the first line will be used.`).setClass("single-line-textarea").addTextArea((text) => text.setPlaceholder("docx?|xlsx?|pptx?|zip|rar").setValue(this.plugin.settings.excludeExtensionPattern).onChange(
|
||||||
|
(value) => __async(this, null, function* () {
|
||||||
|
this.plugin.settings.excludeExtensionPattern = value;
|
||||||
|
yield this.plugin.saveSettings();
|
||||||
|
})
|
||||||
|
));
|
||||||
|
new import_obsidian2.Setting(containerEl).setName("Disable rename notice").setDesc(`Turn off this option if you don't want to see the notice when renaming images.
|
||||||
|
Note that Obsidian may display a notice when a link has changed, this option cannot disable that.`).addToggle((toggle) => toggle.setValue(this.plugin.settings.disableRenameNotice).onChange(
|
||||||
|
(value) => __async(this, null, function* () {
|
||||||
|
this.plugin.settings.disableRenameNotice = value;
|
||||||
|
yield this.plugin.saveSettings();
|
||||||
|
})
|
||||||
|
));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/* nosourcemap */
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"id": "obsidian-paste-image-rename",
|
||||||
|
"name": "Paste image rename",
|
||||||
|
"version": "1.6.1",
|
||||||
|
"minAppVersion": "0.12.0",
|
||||||
|
"description": "Rename pasted images and all the other attchments added to the vault",
|
||||||
|
"author": "Reorx",
|
||||||
|
"authorUrl": "https://github.com/reorx",
|
||||||
|
"isDesktopOnly": false
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
/* src/styles.css */
|
||||||
|
:root {
|
||||||
|
--shadow-color: 0deg 0% 0%;
|
||||||
|
--shadow-elevation-medium:
|
||||||
|
0.5px 0.5px 0.7px hsl(var(--shadow-color) / 0.14),
|
||||||
|
1.1px 1.1px 1.5px -0.9px hsl(var(--shadow-color) / 0.12),
|
||||||
|
2.4px 2.5px 3.3px -1.8px hsl(var(--shadow-color) / 0.1),
|
||||||
|
5.3px 5.6px 7.3px -2.7px hsl(var(--shadow-color) / 0.09),
|
||||||
|
11px 11.4px 15.1px -3.6px hsl(var(--shadow-color) / 0.07);
|
||||||
|
}
|
||||||
|
.image-rename-modal .modal {
|
||||||
|
width: 65%;
|
||||||
|
min-width: 600px;
|
||||||
|
}
|
||||||
|
.image-rename-modal .modal-content {
|
||||||
|
padding: 10px 5px;
|
||||||
|
}
|
||||||
|
.image-rename-modal .image-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.image-rename-modal .info {
|
||||||
|
padding: 10px 0;
|
||||||
|
color: var(--text-muted);
|
||||||
|
user-select: text;
|
||||||
|
}
|
||||||
|
.image-rename-modal .info li > span:nth-of-type(1) {
|
||||||
|
display: inline-block;
|
||||||
|
width: 6em;
|
||||||
|
margin-right: .5em;
|
||||||
|
}
|
||||||
|
.image-rename-modal .info li > span:nth-of-type(1):after {
|
||||||
|
content: ":";
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
.image-rename-modal .image-container img {
|
||||||
|
display: block;
|
||||||
|
max-height: 300px;
|
||||||
|
box-shadow: var(--shadow-elevation-medium);
|
||||||
|
}
|
||||||
|
.image-rename-modal .setting-item-control input {
|
||||||
|
min-width: 300px;
|
||||||
|
}
|
||||||
|
.image-rename-modal .error {
|
||||||
|
border: 1px solid rgb(201, 90, 90);
|
||||||
|
color: rgb(134, 22, 22);
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
.image-rename-modal table {
|
||||||
|
font-size: .9em;
|
||||||
|
line-height: 1.8;
|
||||||
|
margin-bottom: 1.5em;
|
||||||
|
user-select: text;
|
||||||
|
}
|
||||||
|
.image-rename-modal table td {
|
||||||
|
padding-right: 1em;
|
||||||
|
}
|
||||||
|
.image-rename-modal table thead td {
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
.image-rename-modal table tbody td .file-path {
|
||||||
|
font-size: .8em;
|
||||||
|
color: var(--text-faint);
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
.long-description-setting-item {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
.long-description-setting-item .setting-item-description {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
line-height: 1.3em;
|
||||||
|
}
|
||||||
|
.long-description-setting-item .setting-item-control {
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
.long-description-setting-item .setting-item-control input {
|
||||||
|
min-width: 300px;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"appliedMigrations": [
|
||||||
|
"tokens-to-secretstorage-v1"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
{
|
||||||
|
"pluginList": [
|
||||||
|
"mnaoumov/obsidian-nested-properties",
|
||||||
|
"davidvkimball/obsidian-property-over-file-name",
|
||||||
|
"davidvkimball/obsidian-file-name-history",
|
||||||
|
"davidvkimball/obsidian-explorer-focus",
|
||||||
|
"davidvkimball/obsidian-ui-tweaker",
|
||||||
|
"davidvkimball/obsidian-home-base",
|
||||||
|
"davidvkimball/obsidian-image-manager",
|
||||||
|
"davidvkimball/obsidian-vault-cms",
|
||||||
|
"davidvkimball/obsidian-bases-cms",
|
||||||
|
"davidvkimball/obsidian-oxygen-settings",
|
||||||
|
"davidvkimball/obsidian-seo",
|
||||||
|
"davidvkimball/obsidian-disable-tabs",
|
||||||
|
"davidvkimball/obsidian-astro-composer"
|
||||||
|
],
|
||||||
|
"pluginSubListFrozenVersion": [
|
||||||
|
{
|
||||||
|
"repo": "mnaoumov/obsidian-nested-properties",
|
||||||
|
"version": "latest"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"repo": "davidvkimball/obsidian-property-over-file-name",
|
||||||
|
"version": "latest"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"repo": "davidvkimball/obsidian-file-name-history",
|
||||||
|
"version": "latest"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"repo": "davidvkimball/obsidian-explorer-focus",
|
||||||
|
"version": "latest"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"repo": "davidvkimball/obsidian-ui-tweaker",
|
||||||
|
"version": "latest"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"repo": "davidvkimball/obsidian-home-base",
|
||||||
|
"version": "latest"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"repo": "davidvkimball/obsidian-image-manager",
|
||||||
|
"version": "latest"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"repo": "davidvkimball/obsidian-vault-cms",
|
||||||
|
"version": "latest"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"repo": "davidvkimball/obsidian-bases-cms",
|
||||||
|
"version": "latest"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"repo": "davidvkimball/obsidian-oxygen-settings",
|
||||||
|
"version": "latest"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"repo": "davidvkimball/obsidian-seo",
|
||||||
|
"version": "latest"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"repo": "davidvkimball/obsidian-disable-tabs",
|
||||||
|
"version": "latest"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"repo": "davidvkimball/obsidian-astro-composer",
|
||||||
|
"version": "latest"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"themesList": [],
|
||||||
|
"updateAtStartup": true,
|
||||||
|
"updateThemesAtStartup": true,
|
||||||
|
"enableAfterInstall": true,
|
||||||
|
"loggingEnabled": false,
|
||||||
|
"loggingPath": "BRAT-log",
|
||||||
|
"loggingVerboseEnabled": false,
|
||||||
|
"debuggingMode": false,
|
||||||
|
"notificationsEnabled": true,
|
||||||
|
"globalTokenName": "",
|
||||||
|
"personalAccessToken": "",
|
||||||
|
"selectLatestPluginVersionByDefault": false,
|
||||||
|
"allowIncompatiblePlugins": false
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
"use strict";var tn=Object.create;var pe=Object.defineProperty;var nn=Object.getOwnPropertyDescriptor;var sn=Object.getOwnPropertyNames;var on=Object.getPrototypeOf,rn=Object.prototype.hasOwnProperty;var x=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),an=(s,e)=>{for(var t in e)pe(s,t,{get:e[t],enumerable:!0})},Ze=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of sn(e))!rn.call(s,i)&&i!==t&&pe(s,i,{get:()=>e[i],enumerable:!(n=nn(e,i))||n.enumerable});return s};var ln=(s,e,t)=>(t=s!=null?tn(on(s)):{},Ze(e||!s||!s.__esModule?pe(t,"default",{value:s,enumerable:!0}):t,s)),un=s=>Ze(pe({},"__esModule",{value:!0}),s);var $e=x((ps,et)=>{"use strict";var cn=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...s)=>console.error("SEMVER",...s):()=>{};et.exports=cn});var xe=x((ms,tt)=>{"use strict";var gn="2.0.0",dn=Number.MAX_SAFE_INTEGER||9007199254740991,pn=16,mn=250,hn=["major","premajor","minor","preminor","patch","prepatch","prerelease"];tt.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:pn,MAX_SAFE_BUILD_LENGTH:mn,MAX_SAFE_INTEGER:dn,RELEASE_TYPES:hn,SEMVER_SPEC_VERSION:gn,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Be=x((F,nt)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Oe,MAX_SAFE_BUILD_LENGTH:fn,MAX_LENGTH:bn}=xe(),wn=$e();F=nt.exports={};var Tn=F.re=[],En=F.safeRe=[],h=F.src=[],yn=F.safeSrc=[],f=F.t={},vn=0,Fe="[a-zA-Z0-9-]",Pn=[["\\s",1],["\\d",bn],[Fe,fn]],Rn=s=>{for(let[e,t]of Pn)s=s.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return s},y=(s,e,t)=>{let n=Rn(e),i=vn++;wn(s,i,e),f[s]=i,h[i]=e,yn[i]=n,Tn[i]=new RegExp(e,t?"g":void 0),En[i]=new RegExp(n,t?"g":void 0)};y("NUMERICIDENTIFIER","0|[1-9]\\d*");y("NUMERICIDENTIFIERLOOSE","\\d+");y("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Fe}*`);y("MAINVERSION",`(${h[f.NUMERICIDENTIFIER]})\\.(${h[f.NUMERICIDENTIFIER]})\\.(${h[f.NUMERICIDENTIFIER]})`);y("MAINVERSIONLOOSE",`(${h[f.NUMERICIDENTIFIERLOOSE]})\\.(${h[f.NUMERICIDENTIFIERLOOSE]})\\.(${h[f.NUMERICIDENTIFIERLOOSE]})`);y("PRERELEASEIDENTIFIER",`(?:${h[f.NONNUMERICIDENTIFIER]}|${h[f.NUMERICIDENTIFIER]})`);y("PRERELEASEIDENTIFIERLOOSE",`(?:${h[f.NONNUMERICIDENTIFIER]}|${h[f.NUMERICIDENTIFIERLOOSE]})`);y("PRERELEASE",`(?:-(${h[f.PRERELEASEIDENTIFIER]}(?:\\.${h[f.PRERELEASEIDENTIFIER]})*))`);y("PRERELEASELOOSE",`(?:-?(${h[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${h[f.PRERELEASEIDENTIFIERLOOSE]})*))`);y("BUILDIDENTIFIER",`${Fe}+`);y("BUILD",`(?:\\+(${h[f.BUILDIDENTIFIER]}(?:\\.${h[f.BUILDIDENTIFIER]})*))`);y("FULLPLAIN",`v?${h[f.MAINVERSION]}${h[f.PRERELEASE]}?${h[f.BUILD]}?`);y("FULL",`^${h[f.FULLPLAIN]}$`);y("LOOSEPLAIN",`[v=\\s]*${h[f.MAINVERSIONLOOSE]}${h[f.PRERELEASELOOSE]}?${h[f.BUILD]}?`);y("LOOSE",`^${h[f.LOOSEPLAIN]}$`);y("GTLT","((?:<|>)?=?)");y("XRANGEIDENTIFIERLOOSE",`${h[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);y("XRANGEIDENTIFIER",`${h[f.NUMERICIDENTIFIER]}|x|X|\\*`);y("XRANGEPLAIN",`[v=\\s]*(${h[f.XRANGEIDENTIFIER]})(?:\\.(${h[f.XRANGEIDENTIFIER]})(?:\\.(${h[f.XRANGEIDENTIFIER]})(?:${h[f.PRERELEASE]})?${h[f.BUILD]}?)?)?`);y("XRANGEPLAINLOOSE",`[v=\\s]*(${h[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[f.XRANGEIDENTIFIERLOOSE]})(?:${h[f.PRERELEASELOOSE]})?${h[f.BUILD]}?)?)?`);y("XRANGE",`^${h[f.GTLT]}\\s*${h[f.XRANGEPLAIN]}$`);y("XRANGELOOSE",`^${h[f.GTLT]}\\s*${h[f.XRANGEPLAINLOOSE]}$`);y("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Oe}})(?:\\.(\\d{1,${Oe}}))?(?:\\.(\\d{1,${Oe}}))?`);y("COERCE",`${h[f.COERCEPLAIN]}(?:$|[^\\d])`);y("COERCEFULL",h[f.COERCEPLAIN]+`(?:${h[f.PRERELEASE]})?(?:${h[f.BUILD]})?(?:$|[^\\d])`);y("COERCERTL",h[f.COERCE],!0);y("COERCERTLFULL",h[f.COERCEFULL],!0);y("LONETILDE","(?:~>?)");y("TILDETRIM",`(\\s*)${h[f.LONETILDE]}\\s+`,!0);F.tildeTrimReplace="$1~";y("TILDE",`^${h[f.LONETILDE]}${h[f.XRANGEPLAIN]}$`);y("TILDELOOSE",`^${h[f.LONETILDE]}${h[f.XRANGEPLAINLOOSE]}$`);y("LONECARET","(?:\\^)");y("CARETTRIM",`(\\s*)${h[f.LONECARET]}\\s+`,!0);F.caretTrimReplace="$1^";y("CARET",`^${h[f.LONECARET]}${h[f.XRANGEPLAIN]}$`);y("CARETLOOSE",`^${h[f.LONECARET]}${h[f.XRANGEPLAINLOOSE]}$`);y("COMPARATORLOOSE",`^${h[f.GTLT]}\\s*(${h[f.LOOSEPLAIN]})$|^$`);y("COMPARATOR",`^${h[f.GTLT]}\\s*(${h[f.FULLPLAIN]})$|^$`);y("COMPARATORTRIM",`(\\s*)${h[f.GTLT]}\\s*(${h[f.LOOSEPLAIN]}|${h[f.XRANGEPLAIN]})`,!0);F.comparatorTrimReplace="$1$2$3";y("HYPHENRANGE",`^\\s*(${h[f.XRANGEPLAIN]})\\s+-\\s+(${h[f.XRANGEPLAIN]})\\s*$`);y("HYPHENRANGELOOSE",`^\\s*(${h[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${h[f.XRANGEPLAINLOOSE]})\\s*$`);y("STAR","(<|>)?=?\\s*\\*");y("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");y("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var it=x((hs,st)=>{"use strict";var In=Object.freeze({loose:!0}),Nn=Object.freeze({}),An=s=>s?typeof s!="object"?In:s:Nn;st.exports=An});var lt=x((fs,at)=>{"use strict";var ot=/^[0-9]+$/,rt=(s,e)=>{if(typeof s=="number"&&typeof e=="number")return s===e?0:s<e?-1:1;let t=ot.test(s),n=ot.test(e);return t&&n&&(s=+s,e=+e),s===e?0:t&&!n?-1:n&&!t?1:s<e?-1:1},Cn=(s,eLine truncated
|
||||||
|
GitHub API rate limit exceeded:`,`
|
||||||
|
Request: ${u.requestUrl}`,`
|
||||||
|
Rate limits - Remaining: ${u.remaining}`,`
|
||||||
|
Reset in: ${u.getMinutesToReset()} minutes`),u}throw e&&console.log("GitHub request failed:",o),a}};var je={pluginList:[],pluginSubListFrozenVersion:[],themesList:[],updateAtStartup:!0,updateThemesAtStartup:!0,enableAfterInstall:!0,loggingEnabled:!1,loggingPath:"BRAT-log",loggingVerboseEnabled:!1,debuggingMode:!1,notificationsEnabled:!0,globalTokenName:"",personalAccessToken:"",selectLatestPluginVersionByDefault:!1,allowIncompatiblePlugins:!1};function It(s,e,t="latest",n=!1,i=""){let o=!1;s.settings.pluginList.contains(e)||(s.settings.pluginList.unshift(e),o=!0);let a=s.settings.pluginSubListFrozenVersion.find(c=>c.repo===e);a?(Object.assign(a,{repo:e,version:t,token:void 0,tokenName:i||a.tokenName,isIncompatible:n||void 0}),o=!0):(s.settings.pluginSubListFrozenVersion.unshift({repo:e,version:t,token:void 0,tokenName:i||void 0,isIncompatible:n||void 0}),o=!0),o&&s.saveSettings()}function Pe(s,e){return s.settings.pluginList.contains(e)}function Nt(s,e,t){let n={repo:e,lastUpdate:Q(t)};s.settings.themesList.unshift(n),s.saveSettings()}function At(s,e){return!!s.settings.themesList.find(n=>n.repo===e)}function ze(s,e,t){let n=s.settings.pluginSubListFrozenVersion.find(i=>i.repo===e);n&&(n.tokenName=t||void 0,s.saveSettings())}function Ct(s,e,t){for(let n of s.settings.themesList)n.repo===e&&(n.lastUpdate=t,s.saveSettings())}var L=require("obsidian");var j=class{constructor(e){this.statusEl=e}async validateToken(e,t){var n,i,o,a,c,u,g,m,l;if(!e)return(n=this.statusEl)==null||n.setText("No token provided"),(i=this.statusEl)==null||i.addClass("invalid"),(o=this.statusEl)==null||o.removeClass("valid"),!1;try{let r=await Tt(e,t);return(a=this.statusEl)==null||a.removeClass("invalid","valid"),(c=this.statusEl)==null||c.empty(),r.validToken?((u=this.statusEl)==null||u.addClass("valid"),this.showValidTokenInfo(r),!0):((g=this.statusEl)==null||g.addClass("invalid"),this.showErrorMessage(r.error),!1)}catch(r){return console.error("Token validation error:",r),(m=this.statusEl)==null||m.setText("Failed to validate token"),(l=this.statusEl)==null||l.addClass("invalid"),!1}}showValidTokenInfo(e){var n,i;let t=(n=this.statusEl)==null?void 0:n.createDiv({cls:"brat-token-details"});if(t&&(t.createDiv({text:"\u2713 Valid token",cls:"brat-token-status valid"}),(i=e.currentScopes)!=null&&i.length&&t.createDiv({text:`Scopes: ${e.currentScopes.join(", ")}`,cls:"brat-token-scopes"}),e.rateLimit&&t.createDiv({text:`Rate Limit: ${e.rateLimit.remaining}/${e.rateLimit.limit}`,cls:"brat-token-rate"}),e.expirationDate)){let o=new Date(e.expirationDate),a=Math.ceil((o.getTime()-Date.now())/(1e3*60*60*24));a<7&&t.createDiv({text:`\u26A0\uFE0F Token expires in ${a} days`,cls:"brat-token-warning"})}}showErrorMessage(e){var n,i,o;let t=(n=this.statusEl)==null?void 0:n.createDiv({cls:"brat-token-error"});if(t&&(t.createDiv({text:e.message}),e.details))switch(e.type){case"invalid_prefix":t.createDiv({text:`Valid prefixes: ${(i=e.details.validPrefixes)==null?void 0:i.join(", ")}`});break;case"insufficient_scope":t.createDiv({text:`Required scopes: ${(o=e.details.requiredScopes)==null?void 0:o.join(", ")}`});break}}};function ee(s,e){let t=new DocumentFragment,n=document.createElement("a");if(n.textContent=s,n.href=`https://github.com/${s}`,n.target="_blank",t.appendChild(n),e){let i=document.createTextNode(e);t.appendChild(i)}return t}function Lt({prependText:s,url:e,text:t,appendText:n}){let i=new DocumentFragment,o=document.createElement("a");if(o.textContent=t,o.href=e,s){let a=document.createTextNode(s);i.appendChild(a)}if(i.appendChild(o),n){let a=document.createTextNode(n);i.appendChild(a)}return i}var Re=require("obsidian");function E(s,e,t=10,n){if(!s.settings.notificationsEnabled)return;let i=n?Re.Platform.isDesktop?"(click=dismiss, right-click=Info)":"(click=dismiss)":"",o=new Re.Notice(`BRAT
|
||||||
|
${e}
|
||||||
|
${i}`,t*1e3);n&&(o.noticeEl.oncontextmenu=()=>{n()})}var z=(s,e=!0)=>{let t=s.createEl("div");t.style.float="right",e?(t.style.padding="15px",t.style.paddingLeft="15px",t.style.paddingRight="15px",t.style.marginLeft="15px"):(t.style.padding="10px",t.style.paddingLeft="15px",t.style.paddingRight="15px");let n=t.createDiv("coffee");n.addClass("ex-twitter-span"),n.style.paddingLeft="10px";let i=n.createDiv();i.innerText="Learn more about my work at:",n.appendChild(i);let o=n.createEl("a",{href:"https://tfthacker.com"});return o.innerText="https://tfthacker.com",t};var kt=require("obsidian"),Ie=class extends kt.SuggestModal{constructor(e,t,n,i,o){super(e),this.versions=n,this.selected=i,this.onChoose=o,this.setTitle("Select a version"),this.setPlaceholder(`Type to search for a version for ${t}`),this.setInstructions([{command:"\u2191\u2193",purpose:"Navigate versions"},{command:"\u21B5",purpose:"Select version"},{command:"esc",purpose:"Dismiss modal"}])}getSuggestions(e){let t=e.toLowerCase();return this.versions.filter(n=>n.version.toLowerCase().contains(t))}renderSuggestion(e,t){t.createEl("div",{text:`${e.version} ${e.prerelease?"(Prerelease)":""}`})}onChooseSuggestion(e){this.onChoose(e.version)}onNoSuggestion(){this.onChoose(this.selected?this.selected:""),this.close()}};var U=class extends L.Modal{constructor(t,n,i=!1,o=!1,a="",c="",u=""){super(t.app);this.versionSetting=null;this.repositoryAddressEl=null;this.tokenInputEl=null;this.validateButton=null;this.validator=null;this.addPluginButton=null;this.cancelButton=null;this.plugin=t,this.betaPlugins=n,this.address=a,this.version=c,this.secretName=u,this.openSettingsTabAfterwards=i,this.updateVersion=o,this.enableAfterInstall=t.settings.enableAfterInstall}async submitForm(){var o,a,c,u,g,m,l,r;if(this.address==="")return;let t=ye(this.address);if(this.plugin.settings.pluginSubListFrozenVersion.find(d=>d.repo===t)){await this.betaPlugins.addPlugin(t,!1,!1,!1,this.version,!0,this.enableAfterInstall,this.secretName)&&this.close(),(o=this.cancelButton)==null||o.setDisabled(!1),(a=this.addPluginButton)==null||a.setDisabled(!1),(c=this.addPluginButton)==null||c.setButtonText("Add Plugin"),(u=this.versionSetting)==null||u.setDisabled(!1);return}if(!this.version&&Pe(this.plugin,t)){E(this.plugin,"This plugin is already in the list for beta testing",10);return}await this.betaPlugins.addPlugin(t,!1,!1,!1,this.version,!1,this.enableAfterInstall,this.secretName)&&this.close(),(g=this.cancelButton)==null||g.setDisabled(!1),(m=this.addPluginButton)==null||m.setDisabled(!1),(l=this.addPluginButton)==null||l.setButtonText("Add Plugin"),(r=this.versionSetting)==null||r.setDisabled(!1)}updateVersionDropdown(t,n,i=""){let o;t.clear(),n.length>0&&!i&&this.plugin.settings.selectLatestPluginVersionByDefault?(o="latest",this.version="latest"):o=i,n.length<20||L.Platform.isMobile?t.addDropdown(c=>{c.addOption("","Select a version"),c.addOption("latest","Latest version");for(let u of n)c.addOption(u.version,`${u.version} ${u.prerelease?"(Prerelease)":""}`);c.onChange(u=>{var g;this.version=u,(g=this.addPluginButton)==null||g.setDisabled(this.version==="")}),c.setValue(o),c.selectEl.addClass("brat-version-selector"),c.selectEl.style.width="100%"}):t.addButton(c=>{c.setButtonText(o==="latest"?"Latest version":o||"Select a version...").setClass("brat-version-selector").setClass("button").onClick(()=>{let g=[{version:"latest",prerelease:!1},...n];new Ie(this.app,this.address,g,o,l=>{var r;this.version=l,c.setButtonText(l==="latest"?"Latest version":l||"Select a version..."),(r=this.addPluginButton)==null||r.setDisabled(this.version==="")}).open()})})}onOpen(){let t=this.contentEl.createEl("h4");this.address?(t.appendText("Change plugin version: "),t.appendChild(ee(this.address))):t.setText("Github repository for beta plugin:"),this.contentEl.createEl("form",{},n=>{var g;n.addClass("brat-modal"),(!this.address||!this.updateVersion)&&new L.Setting(n).setClass("repository-setting").then(l=>{l.addText(r=>{this.repositoryAddressEl=r,r.setPlaceholder("Repository (example: https://github.com/GitHubUserName/repository-name)"),r.setValue(this.address),r.onChange(d=>{var b,w;this.address=ye(d.trim()),this.version!==""&&(!this.address||!this.isGitHubRepositoryMatch(this.address))&&this.versionSetting&&(this.updateVersionDropdown(this.versionSetting,[]),this.versionSetting.settingEl.classList.add("disabled-setting"),this.versionSetting.setDisabled(!0),r.inputEl.classList.remove("valid-repository"),r.inputEl.classList.remove("invalid-repository")),this.version||(this.isGitHubRepositoryMatch(this.address)?(b=this.addPluginButton)==null||b.setDisabled(!1):(w=this.addPluginButton)==null||w.setDisabled(!0))}),r.inputEl.addEventListener("keydown",async d=>{var b,w,p;d.key==="Enter"&&(this.address&&(this.updateVersion&&this.version!==""||!this.updateVersion)&&(d.preventDefault(),(b=this.addPluginButton)==null||b.setDisabled(!0),(w=this.cancelButton)==null||w.setDisabled(!0),(p=this.versionSetting)==nu
Line truncated
|
||||||
|
This does not seem to be an obsidian plugin with valid releases, as there are no releases available.`,15),console.error("BRAT: validateRepository",e,t,n)),null;let m=await K(g,"manifest.json",this.plugin.settings.debuggingMode,u,c);if(!m)return n&&(E(this.plugin,`${e}
|
||||||
|
This does not seem to be an obsidian plugin, as there is no manifest.json file.`,15),console.error("BRAT: validateRepository",e,t,n)),null;let l=JSON.parse(m);if(!("id"in l))return n&&E(this.plugin,`${e}
|
||||||
|
The plugin id attribute for the release is missing from the manifest file`,15),null;if(!("version"in l))return n&&E(this.plugin,`${e}
|
||||||
|
The version attribute for the release is missing from the manifest file`,15),null;try{let r=Ae(g.tag_name,{includePrerelease:!0,loose:!0}),d=Ae(l.version,{includePrerelease:!0,loose:!0});Dt(r,d)!==0&&(n&&E(this.plugin,`${e}
|
||||||
|
Version mismatch detected:
|
||||||
|
Release tag version: ${g.tag_name}
|
||||||
|
Manifest version: ${l.version}
|
||||||
|
|
||||||
|
The release tag version will be used to ensure consistency.`,15),l.version=r.version)}catch(r){}return l}catch(u){if(u instanceof D){let g=`GitHub API rate limit exceeded. Reset in ${u.getMinutesToReset()} minutes.`;throw n&&E(this.plugin,g,15),console.error(`BRAT: validateRepository ${u}`),E(this.plugin,`${u.message} Consider adding a personal access token in BRAT settings for higher limits. See documentation for details.`,20,()=>{window.open("https://github.com/TfTHacker/obsidian42-brat/blob/main/BRAT-DEVELOPER-GUIDE.md#github-api-rate-limits")}),u}if(u instanceof O)throw n&&(u.status===401?E(this.plugin,`${e}
|
||||||
|
GitHub API Authentication error. Please verify that your personal access token is valid and set correctly.`,15):E(this.plugin,`${e}
|
||||||
|
GitHub API error ${u.status}: ${u.message}`,15)),console.error(`BRAT: validateRepository ${u}`),u;return n&&E(this.plugin,`${e}
|
||||||
|
Unspecified error encountered: ${u}, verify debug for more information.`,15),null}}async getAllReleaseFiles(e,t,n="",i=""){let o=i,a=await He(e,this.plugin.settings.debuggingMode,o),c=await Ge(e,n,t,this.plugin.settings.debuggingMode,a,o);if(!c)return Promise.reject("No release found");let u=t||n!=="";return console.log({reallyGetManifestOrNot:u,version:c.tag_name}),{mainJs:await K(c,"main.js",this.plugin.settings.debuggingMode,a,o),manifest:u?await K(c,"manifest.json",this.plugin.settings.debuggingMode,a,o):"",styles:await K(c,"styles.css",this.plugin.settings.debuggingMode,a,o)}}async writeReleaseFilesToPluginFolder(e,t){var o,a;let n=`${(0,k.normalizePath)(`${this.plugin.app.vault.configDir}/plugins/${e}`)}/`,{adapter:i}=this.plugin.app.vault;await i.exists(n)||await i.mkdir(n),await i.write(`${n}main.js`,(o=t.mainJs)!=null?o:""),await i.write(`${n}manifest.json`,(a=t.manifest)!=null?a:""),t.styles&&await i.write(`${n}styles.css`,t.styles)}async addPlugin(e,t=!1,n=!1,i=!1,o="",a=!1,c=this.plugin.settings.enableAfterInstall,u=""){try{this.plugin.settings.debuggingMode&&console.log("BRAT: addPlugin",e,t,n,i,o,a,c,u?"with secret":"public");let g="";u&&u.trim()!==""?(g=await this.plugin.app.secretStorage.getSecret(u)||"",g||E(this.plugin,`Secret not found for token name: ${u}. Please add it to SecretStorage or clear the token name for this plugin.`,10)):this.plugin.settings.globalTokenName&&(g=await this.plugin.app.secretStorage.getSecret(this.plugin.settings.globalTokenName)||"");let m=10,l=await this.validateRepository(e,!0,!0,o,g),r=!!l;if(r||(l=await this.validateRepository(e,!1,!0,o,g)),l===null){let w=`${e}
|
||||||
|
A manifest.json file does not exist in the latest release of the repository. This plugin cannot be installed.`;return await this.plugin.log(w,!0),E(this.plugin,w,m),!1}if(!Object.hasOwn(l,"version")){let w=`${e}
|
||||||
|
The manifest.json file in the latest release or pre-release of the repository does not have a version number in the file. This plugin cannot be installed.`;return await this.plugin.log(w,!0),E(this.plugin,w,m),!1}let d=!1;if(Object.hasOwn(l,"minAppVersion")&&!(0,k.requireApiVersion)(l.minAppVersion)){if(o===""||o==="latest"||!this.plugin.settings.allowIncompatiblePlugins){let p=`Plugin: ${e}
|
||||||
|
|
||||||
|
The manifest.json for this plugin indicates that the Obsidian version of the app needs to be ${l.minAppVersion}, but this installation of Obsidian is ${k.apiVersion}.
|
||||||
|
|
||||||
|
You will need to update your Obsidian to use this plugin or contact the plugin developer for more information.`;return await this.plugin.log(p,!0),E(this.plugin,p,30),!1}if(!await De({app:this.plugin.app,message:createFragment(p=>{p.appendText("Plugin: "),p.createEl("code",{text:e}),p.createEl("br"),p.appendText("The "),p.createEl("code",{text:"manifest.json"}),p.appendText(" for this plugin indicates that the Obsidian version of the app needs to be "),p.createEl("code",{text:l.minAppVersion}),p.appendText(", but this installation of Obsidian is "),p.createEl("code",{text:k.apiVersion}),p.appendText("."),p.createEl("br"),p.appendText("Using this plugin is not recommended and may not work as expected. Use at your own risk."),p.createEl("br"),p.appendText("Do you want to install it anyways?")})}))return!1;d=!0}let b=async()=>{var T,C;let w=await this.getAllReleaseFiles(e,r,o,g);console.log("rFiles",w),(r||w.manifest==="")&&(w.manifest=JSON.stringify(l));let p=JSON.parse((T=w.manifest)!=null?T:"");if(d&&(p.brat={isIncompatible:!0,minAppVersionOriginal:p.minAppVersion},p.minAppVersion=k.apiVersion),k.Platform.isMobile&&p.isDesktopOnly)if(this.plugin.settings.allowIncompatiblePlugins){if(!await De({app:this.plugin.app,message:createFragment(R=>{R.appendText("Plugin: "),R.createEl("code",{text:e}),R.createEl("br"),R.appendText("The "),R.createEl("code",{text:"manifest.json"}),R.appendText(" for this plugin indicates that the plugin has "),R.createEl("code",{text:"isDesktopOnly: true"}),R.appendText(", but you are using a mobile device."),R.createEl("br"),R.appendText("Using this plugin is not recommended and may not work as expected. Use at your own risk."),R.createEl("br"),R.appendText("Do you want to forcefully run it on mobile anyways?")})}))return null;p.isDesktopOnly=!1,(C=p.brat)!=null||(p.brat={}),p.brat.isDesktopOnlyOriginal=!0,p.brat.isIncompatible=!0,d=!0}else{let N=`Plugin: ${e}
|
||||||
|
|
||||||
|
The manifest.json for this plugin indicates that the plugin has isDesktopOnly: true, but you are using a mobile device.
|
||||||
|
|
||||||
|
The plugin will not be installed.`;return await this.plugin.log(N,!0),E(this.plugin,N,30),null}if(d&&(w.manifest=JSON.stringify(p)),this.plugin.settings.debuggingMode&&console.log("BRAT: rFiles.manifest",r,w),w.mainJs===null){let N=`${e}
|
||||||
|
The release is not complete and cannot be downloaded. main.js is missing from the Release`;return await this.plugin.log(N,!0),E(this.plugin,N,m),null}return w};if(!t||a){let w=await b();if(w===null)return!1;if(await this.writeReleaseFilesToPluginFolder(l.id,w),It(this.plugin,e,o,d,u),c){let{plugins:p}=this.plugin.app,T=(0,k.normalizePath)(`${p.getPluginFolder()}/${l.id}`);await p.loadManifest(T),await p.enablePluginAndSave(l.id)}if(await this.plugin.app.plugins.loadManifests(),a)await this.reloadPlugin(l.id),await this.plugin.log(`${e} reinstalled`,!0),E(this.plugin,`${e}
|
||||||
|
Plugin has been reinstalled and reloaded with version ${l.version}`,m);else{let p=o===""?"":` (version: ${o})`,T=`${e}${p}
|
||||||
|
The plugin has been registered with BRAT.`;c||(T+=" You may still need to enable it the Community Plugin List."),await this.plugin.log(T,!0),E(this.plugin,T,m)}}else{let w=`${this.plugin.app.vault.configDir}/plugins/${l.id}/`,p="";try{p=await this.plugin.app.vault.adapter.read(`${w}manifest.json`)}catch(R){if(R.errno===-4058||R.errno===-2)return await this.addPlugin(e,!1,r,!1,o,!1,c,u),!0;console.log("BRAT - Local Manifest Load",l.id,JSON.stringify(R,null,2))}if(o!==""&&o!=="latest")return E(this.plugin,`The version of ${e} is frozen, not updating.`,3),!1;let T=await JSON.parse(p),C=Ae(T.version,{includePrerelease:!0,loose:!0}),N=Ae(l.version,{includePrerelease:!0,loose:!0});if(Dt(C,N)===-1){let R=await b();if(R===null)return!1;if(n){let W=`There is an update available for ${l.id} from version ${T.version} to ${l.version}. `;return await this.plugin.log(`${W}[Release Info](https://github.com/${e}/releases/tag/${l.version})`,!0),E(this.plugin,W,30,()=>{l&&window.open(`https://github.com/${e}/releases/tag/${l.version}`)}),!1}await this.writeReleaseFilesToPluginFolder(l.id,R),await this.plugin.app.plugins.loadManifests(),await this.reloadPlugin(l.id);let P=`${l.id}
|
||||||
|
Plugin has been updated from version ${T.version} to ${l.version}. `;return await this.plugin.log(`${P}[Release Info](https://github.com/${e}/releases/tag/${l.version})`,!0),E(this.plugin,P,30,()=>{l&&window.open(`https://github.com/${e}/releases/tag/${l.version}`)}),!0}return i&&E(this.plugin,`No update available for ${e}`,3),!0}}catch(g){console.error(`BRAT: Error adding plugin ${e}:`,{error:g,updatePluginFiles:t,seeIfUpdatedOnly:n,specifyVersion:o,forceReinstall:a});let m=g instanceof Error?g.message:"Unknown error occurred";return await this.plugin.log(`Error ${t?"updating":"adding"} plugin ${e}: ${m}`,!0),!1}return!0}async reloadPlugin(e){let{plugins:t}=this.plugin.app;try{await t.disablePlugin(e),await t.enablePlugin(e)}catch(n){this.plugin.settings.debuggingMode&&console.log("reload plugin",n)}}async updatePlugin(e,t=!1,n=!1,i=!1,o=""){let a=await this.addPlugin(e,!0,t,n,"",i,!1,o);return!a&&!t&&E(this.plugin,`${e}
|
||||||
|
Update of plugin failed.`),a}async checkForPluginUpdatesAndInstallUpdates(e=!1,t=!1){if(!await Ne()){console.log("BRAT: No internet detected.");return}let n,i="Checking for plugin updates STARTED";await this.plugin.log(i,!0),e&&this.plugin.settings.notificationsEnabled&&(n=new k.Notice(`BRAT
|
||||||
|
${i}`,3e4));let o=new Map(this.plugin.settings.pluginSubListFrozenVersion.map(u=>[u.repo,u.version])),a=new Map(this.plugin.settings.pluginSubListFrozenVersion.map(u=>[u.repo,u.tokenName||""]));for(let u of this.plugin.settings.pluginList){let g=o.get(u);g&&g!=="latest"||await this.updatePlugin(u,t,!1,!1,a.get(u)||"")}let c="Checking for plugin updates COMPLETED";await this.plugin.log(c,!0),e&&(n&&n.hide(),E(this.plugin,c,10))}deletePlugin(e){let t=`Removed ${e} from BRAT plugin list`;this.plugin.log(t,!0),this.plugin.settings.pluginList=this.plugin.settings.pluginList.filter(n=>n!==e),this.plugin.settings.pluginSubListFrozenVersion=this.plugin.settings.pluginSubListFrozenVersion.filter(n=>n.repo!==e),this.plugin.saveSettings()}getEnabledDisabledPlugins(e){let t=this.plugin.app.plugins,n=Object.values(t.manifests),i=Object.values(t.plugins).map(o=>o.manifest);return e?n.filter(o=>i.find(a=>o.id===a.id)):n.filter(o=>!i.find(a=>o.id===a.id))}checkIncompatiblePlugins(){let e=this.plugin.settings.pluginSubListFrozenVersion.filter(t=>t.isIncompatible).map(t=>t.repo);e.length>0&&E(this.plugin,`The following incompatible plugins were forcefully installed by BRAT and may not work as expected:
|
||||||
|
${e.join(`
|
||||||
|
`)}`,30)}};var _=require("obsidian");var ne=async(s,e,t)=>{let n=await G(e,!0,s.settings.debuggingMode);if(n||(n=await G(e,!1,s.settings.debuggingMode)),!n)return E(s,"There is no theme.css or theme-beta.css file in the root path of this repository, so there is no theme to install."),!1;let i=await Pt(e,s.settings.debuggingMode);if(!i)return E(s,"There is no manifest.json file in the root path of this repository, so theme cannot be installed."),!1;let o=await JSON.parse(i),a=(0,_.normalizePath)(Vn(s)+o.name),{adapter:c}=s.app.vault;await c.exists(a)||await c.mkdir(a),await c.write((0,_.normalizePath)(`${a}/theme.css`),n),await c.write((0,_.normalizePath)(`${a}/manifest.json`),i),Ct(s,e,Q(n));let u="";return t?(Nt(s,e,n),u=`${o.name} theme installed from ${e}. `,setTimeout(()=>{s.app.customCss.setTheme(o.name)},500)):u=`${o.name} theme updated from ${e}.`,s.log(`${u}[Theme Info](https://github.com/${e})`,!1),E(s,u,20,()=>{window.open(`https://github.com/${e}`)}),!0},q=async(s,e)=>{if(!await Ne()){console.log("BRAT: No internet detected.");return}let t,n="Checking for beta theme updates STARTED";await s.log(n,!0),e&&s.settings.notificationsEnabled&&(t=new _.Notice(`BRAT
|
||||||
|
${n}`,3e4));for(let o of s.settings.themesList){let a=await Z(o.repo,!0,s.settings.debuggingMode);a==="0"&&(a=await Z(o.repo,!1,s.settings.debuggingMode)),console.log("BRAT: lastUpdateOnline",a),a!==o.lastUpdate&&await ne(s,o.repo,!1)}let i="Checking for beta theme updates COMPLETED";(async()=>await s.log(i,!0))(),e&&(s.settings.notificationsEnabled&&t&&t.hide(),E(s,i))},Ce=(s,e)=>{s.settings.themesList=s.settings.themesList.filter(n=>n.repo!==e),s.saveSettings();let t=`Removed ${e} from BRAT themes list and will no longer be updated. However, the theme files still exist in the vault. To remove them, go into Settings > Appearance and remove the theme.`;s.log(t,!0),E(s,t)},Vn=s=>`${(0,_.normalizePath)(`${s.app.vault.configDir}/themes`)}/`;var $t="brat-migrations";async function Un(s,e){try{let t=await s.vault.adapter.read(`${s.vault.configDir}/plugins/obsidian42-brat/${$t}.json`);return JSON.parse(t).appliedMigrations.includes(e)}catch(t){return!1}}async function _n(s,e){try{let t=`${s.vault.configDir}/plugins/obsidian42-brat/${$t}.json`,n={appliedMigrations:[]};try{let i=await s.vault.adapter.read(t);n=JSON.parse(i)}catch(i){}n.appliedMigrations.includes(e)||(n.appliedMigrations.push(e),await s.vault.adapter.write(t,JSON.stringify(n,null,2)))}catch(t){console.error(`BRAT: Failed to mark migration ${e} complete:`,t)}}async function xt(s,e,t){let n="tokens-to-secretstorage-v1";if(!await Un(s,n))try{let i=0,o=u=>{let m=`brat-gh-${u.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}`;return m.length>64?m.substring(0,64).replace(/-$/,""):m},a=u=>{let g=s.secretStorage.listSecrets();for(let m of g)if(s.secretStorage.getSecret(m)===u)return m;return null},c=(u,g)=>{let m=a(u);return m?(console.log(`BRAT: Reusing existing secret "${m}"`),m):(s.secretStorage.setSecret(g,u),console.log(`BRAT: Created new secret "${g}"`),g)};if(e.personalAccessToken&&e.personalAccessToken.trim()!==""){let u=e.personalAccessToken.trim(),m=c(u,"brat-gh-global");e.globalTokenName=m,e.personalAccessToken="",i++}if(e.pluginSubListFrozenVersion){for(let u of e.pluginSubListFrozenVersion)if(u.token&&u.token.trim()!==""){let g=u.token.trim(),m=o(u.repo),l=c(g,m);u.tokenName=l,u.token=void 0,i++}}i>0&&(await t(),console.log(`BRAT: Migrated ${i} token(s) to SecretStorage`)),await _n(s,n)}catch(i){console.error("BRAT: Failed to migrate tokens to SecretStorage:",i)}}var H=require("obsidian");var B=class extends H.Modal{constructor(e,t=!1){super(e.app),this.plugin=e,this.address="",this.openSettingsTabAfterwards=t}async submitForm(){if(this.address==="")return;let e=this.address.replace("https://github.com/","");if(At(this.plugin,e)){E(this.plugin,"This theme is already in the list for beta testing",10);return}await ne(this.plugin,e,!0)&&this.close()}onOpen(){this.contentEl.createEl("h4",{text:"Github repository for beta theme:"}),this.contentEl.createEl("form",{},e=>{e.addClass("brat-modal"),new H.Setting(e).addText(i=>{i.setPlaceholder("Repository (example: https://github.com/GitHubUserName/repository-name"),i.setValue(this.address),i.onChange(o=>{this.address=o.trim()}),i.inputEl.addEventListener("keydown",o=>{o.key==="Enter"&&this.address!==" "&&(o.preventDefault(),this.submitForm())}),i.inputEl.style.width="100%",window.setTimeout(()=>{let o=document.querySelector(".setting-item-info");o&&o.remove(),i.inputEl.focus()},10)}),e.createDiv("modal-button-container",i=>{new H.ButtonComponent(i).setButtonText("Never mind").onClick(()=>{this.close()}),new H.ButtonComponent(i).setButtonText("Add theme").setCta().onClick(o=>{o.preventDefault(),console.log("Add theme button clicked"),this.address!==""&&this.submitForm()})});let t=e.createDiv();t.style.borderTop="1px solid #ccc",t.style.marginTop="30px";let n=t.createSpan();n.createEl("a",{href:"https://bit.ly/o42-twitter",text:"TFTHacker"}),n.appendText(" and "),n.createEl("a",{href:"https://github.com/johannrichard",text:"johannrichard"}),n.style.fontStyle="italic",t.appendChild(n),z(t,!1),window.setTimeout(()=>{let i=e.querySelectorAll(".brat-modal .setting-item-info");for(let o of Array.from(i))o.remove()},50)})}onClose(){this.openSettingsTabAfterwards&&(this.plugin.app.setting.openTab(),this.plugin.app.setting.openTabById(this.plugin.APP_ID))}};var Ot=require("obsidian");function Ft(){(0,Ot.addIcon)("BratIcon",'<path fill="currentColor" stroke="currentColor" d="M 41.667969 41.667969 C 41.667969 39.367188 39.800781 37.5 37.5 37.5 C 35.199219 37.5 33.332031 39.367188 33.332031 41.667969 C 33.332031 43.96875 35.199219 45.832031 37.5 45.832031 C 39.800781 45.832031 41.667969 43.96875 41.667969 41.667969 Z M 60.417969 58.582031 C 59.460938 58.023438 58.320312 57.867188 57.25 58.148438 C 56.179688 58.429688 55.265625 59.125 54.707031 60.082031 C 53.746094 61.777344 51.949219 62.820312 50 62.820312 C 48.050781 62.820312 46.253906 61.777344 45.292969 60.082031 C 44.734375 59.125 43.820312 58.429688 42.75 58.148438 C 41.679688 57.867188 40.539062 58.023438 39.582031 58.582031
Line truncated
|
||||||
|
${o}`,3),this.plugin.betaPlugins.updatePlugin(i.info,!1,!0,!1,a==null?void 0:a.token)})}},{id:"reinstallOnePlugin",icon:"BratIcon",name:"Plugins: Choose a single plugin to reinstall",showInRibbon:!0,callback:()=>{let e=new Set(this.plugin.settings.pluginSubListFrozenVersion.map(i=>i.repo)),t=Object.values(this.plugin.settings.pluginList).filter(i=>!e.has(i)).map(i=>({display:i,info:i})),n=new S(this.plugin);n.setSuggesterData(t),n.display(i=>{let o=`Reinstalling ${i.info}`;E(this.plugin,`
|
||||||
|
${o}`,3),this.plugin.log(o,!0),this.plugin.betaPlugins.updatePlugin(i.info,!1,!1,!0)})}},{id:"restartPlugin",icon:"BratIcon",name:"Plugins: Restart a plugin that is already installed",showInRibbon:!0,callback:()=>{let e=Object.values(this.plugin.app.plugins.manifests).map(n=>({display:n.id,info:n.id})),t=new S(this.plugin);t.setSuggesterData(e),t.display(n=>{E(this.plugin,`${n.info}
|
||||||
|
Plugin reloading .....`,5),this.plugin.betaPlugins.reloadPlugin(n.info)})}},{id:"disablePlugin",icon:"BratIcon",name:"Plugins: Disable a plugin - toggle it off",showInRibbon:!0,callback:()=>{let e=this.plugin.betaPlugins.getEnabledDisabledPlugins(!0).map(n=>({display:`${n.name} (${n.id})`,info:n.id})),t=new S(this.plugin);t.setSuggesterData(e),t.display(n=>{this.plugin.log(`${n.display} plugin disabled`,!1),this.plugin.settings.debuggingMode&&console.log(n.info),this.plugin.app.plugins.disablePluginAndSave(n.info)})}},{id:"enablePlugin",icon:"BratIcon",name:"Plugins: Enable a plugin - toggle it on",showInRibbon:!0,callback:()=>{let e=this.plugin.betaPlugins.getEnabledDisabledPlugins(!1).map(n=>({display:`${n.name} (${n.id})`,info:n.id})),t=new S(this.plugin);t.setSuggesterData(e),t.display(n=>{this.plugin.log(`${n.display} plugin enabled`,!1),this.plugin.app.plugins.enablePluginAndSave(n.info)})}},{id:"openGitHubZRepository",icon:"BratIcon",name:"Plugins: Open the GitHub repository for a plugin",showInRibbon:!0,callback:async()=>{let e=await yt(this.plugin.settings.debuggingMode);if(e){let t=Object.values(e).map(o=>({display:`Plugin: ${o.name} (${o.repo})`,info:o.repo})),n=Object.values(this.plugin.settings.pluginList).map(o=>({display:`BRAT: ${o}`,info:o}));for(let o of t)n.push(o);let i=new S(this.plugin);i.setSuggesterData(n),i.display(o=>{o.info&&window.open(`https://github.com/${o.info}`)})}}},{id:"openGitHubRepoTheme",icon:"BratIcon",name:"Themes: Open the GitHub repository for a theme (appearance)",showInRibbon:!0,callback:async()=>{let e=await vt(this.plugin.settings.debuggingMode);if(e){let t=Object.values(e).map(i=>({display:`Theme: ${i.name} (${i.repo})`,info:i.repo})),n=new S(this.plugin);n.setSuggesterData(t),n.display(i=>{i.info&&window.open(`https://github.com/${i.info}`)})}}},{id:"opentPluginSettings",icon:"BratIcon",name:"Plugins: Open Plugin Settings Tab",showInRibbon:!0,callback:()=>{let e=this.plugin.app.setting,t=Object.values(e.pluginTabs).map(o=>({display:`Plugin: ${o.name}`,info:o.id})),n=new S(this.plugin),i=Object.values(e.settingTabs).map(o=>({display:`Core: ${o.name}`,info:o.id}));for(let o of t)i.push(o);n.setSuggesterData(i),n.display(o=>{e.open(),e.openTabById(o.info)})}},{id:"GrabBetaTheme",icon:"BratIcon",name:"Themes: Grab a beta theme for testing from a Github repository",showInRibbon:!0,callback:()=>{new B(this.plugin).open()}},{id:"updateBetaThemes",icon:"BratIcon",name:"Themes: Update beta themes",showInRibbon:!0,callback:async()=>{await q(this.plugin,!0)}},{id:"allCommands",icon:"BratIcon",name:"All Commands list",showInRibbon:!1,callback:()=>{this.ribbonDisplayCommands()}}];this.plugin=e;for(let t of this.bratCommands)this.plugin.addCommand({id:t.id,name:t.name,icon:t.icon,callback:()=>{t.callback()}})}ribbonDisplayCommands(){let e=[];for(let a of this.bratCommands)a.showInRibbon&&e.push({display:a.name,info:a.callback});let t=new S(this.plugin),n=this.plugin.app.setting,i=Object.values(n.settingTabs).map(a=>({display:`Core: ${a.name}`,info:()=>{n.open(),n.openTabById(a.id)}})),o=Object.values(n.pluginTabs).map(a=>({display:`Plugin: ${a.name}`,info:()=>{n.open(),n.openTabById(a.id)}}));e.push({display:"---- Core Plugin Settings ----",info:()=>{this.ribbonDisplayCommands()}});for(let a of i)e.push(a);e.push({display:"---- Plugin Settings ----",info:()=>{this.ribbonDisplayCommands()}});for(let a of o)e.push(a);t.setSuggesterData(e),t.display(a=>{typeof a.info=="function"&&a.info()})}};var A=require("obsidian");var Le=class extends A.PluginSettingTab{constructor(t,n){super(t,n);this.accessTokenSetting=null;this.accessTokenButton=null;this.tokenInfo=null;this.validator=null;this.plugin=n}display(){let{containerEl:t}=this;t.empty(),t.addClass("brat-settings"),new A.Setting(t).setName("Auto-enable plugins after installation").setDesc('If enabled beta plugins will be automatically enabled after installtion by default. Note: you can toggle this on and off for each plugin in the "Add Plugin" form.').addToggle(l=>{l.setValue(this.plugin.settings.enableAfterInstall).onChange(async r=>{this.plugin.settings.enableAfterInstall=r,await this.plugin.saveSettings()})}),new A.Setting(t).setName("Auto-update plugins at startup").setDesc("If enabled all beta plugins will be checked for updates each time Obsidian starts. Note: this does not update frozen version plugins.").addToggle(l=>{l.setValue(this.plugin.settings.updateAtStartup).onChange(async r=>{this.plugin.settings.updateAtStartup=r,await this.plugin.saveSettings()})}),new A.Setting(t).setName("Auto-update themes at startup").setDesc("If enabled all beta themes will be checked for updates each time Obsidian starts.").addToggle(l=>{l.setValue(this.plugin.settings.updateThemesAtStartup).onChange(async r=>{this.plugin.settings.updateThemesAtStartup=r,await this.plugin.saveSettings()})}),new A.Setting(t).setName("Select latest plugin version by default").setDesc("If enabled the latest version will be selected by default when adding
Line truncated
|
||||||
|
`," ")}
|
||||||
|
`,u=s.app.vault.getAbstractFileByPath(n);u?await s.app.vault.append(u,c):u=await s.app.vault.create(n,c)}}var ke=class extends en.Plugin{constructor(){super(...arguments);this.APP_NAME="BRAT";this.APP_ID="obsidian42-brat";this.settings=je;this.betaPlugins=new te(this);this.commands=new se(this);this.bratApi=new ie(this);this.obsidianProtocolHandler=t=>{if(!t.plugin&&!t.theme){E(this,"Could not locate the repository from the URL.",10);return}for(let n of["plugin","theme"])if(t[n]){let i;switch(n){case"plugin":i=new U(this,this.betaPlugins,!0,!1,t[n],t.version?t.version:void 0),i.open();break;case"theme":i=new B(this),i.address=t[n],i.open();break}return}}}onload(){console.log(`loading ${this.APP_NAME}`),Ft(),this.addRibbonIcon("BratIcon","BRAT",()=>{this.commands.ribbonDisplayCommands()}),this.loadSettings().then(async()=>{await xt(this.app,this.settings,()=>this.saveSettings()),this.app.workspace.onLayoutReady(()=>{this.addSettingTab(new Le(this.app,this)),this.registerObsidianProtocolHandler("brat",this.obsidianProtocolHandler),this.betaPlugins.checkIncompatiblePlugins(),this.settings.updateAtStartup&&setTimeout(()=>{this.betaPlugins.checkForPluginUpdatesAndInstallUpdates(!1)},6e4),this.settings.updateThemesAtStartup&&setTimeout(()=>{q(this,!1)},12e4),setTimeout(()=>{window.bratAPI=this.bratApi},500)})}).catch(t=>{console.error("Failed to load settings:",t)})}async log(t,n=!1){await Zt(this,t,n)}onunload(){console.log(`unloading ${this.APP_NAME}`)}async loadSettings(){this.settings=Object.assign({},je,await this.loadData())}async saveSettings(){await this.saveData(this.settings)}};
|
||||||
|
|
||||||
|
/* nosourcemap */
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"id": "obsidian42-brat",
|
||||||
|
"name": "BRAT",
|
||||||
|
"version": "2.0.2",
|
||||||
|
"minAppVersion": "1.11.4",
|
||||||
|
"description": "Easily install a beta version of a plugin for testing.",
|
||||||
|
"author": "TfTHacker",
|
||||||
|
"authorUrl": "https://github.com/TfTHacker/obsidian42-brat",
|
||||||
|
"helpUrl": "https://tfthacker.com/BRAT",
|
||||||
|
"isDesktopOnly": false,
|
||||||
|
"fundingUrl": {
|
||||||
|
"Visit my site": "https://tfthacker.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
.brat-modal .modal-button-container {
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brat-modal .disabled-setting {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brat-modal .disabled-setting:hover {
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Input validation styles */
|
||||||
|
.brat-settings .valid-input,
|
||||||
|
.brat-modal .valid-repository {
|
||||||
|
border-color: var(--color-green);
|
||||||
|
}
|
||||||
|
.brat-settings .invalid-input,
|
||||||
|
.brat-modal .invalid-repository {
|
||||||
|
border-color: var(--color-red);
|
||||||
|
}
|
||||||
|
.brat-settings .validation-error,
|
||||||
|
.brat-modal .validation-error {
|
||||||
|
border-color: var(--color-orange);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Version selector */
|
||||||
|
.brat-version-selector {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 400px;
|
||||||
|
justify-content: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brat-token-input {
|
||||||
|
min-width: 33%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Token info container styles */
|
||||||
|
.brat-token-info {
|
||||||
|
margin-top: 8px;
|
||||||
|
font-size: 0.8em;
|
||||||
|
padding: 8px;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: var(--background-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Token status indicators */
|
||||||
|
.brat-token-info.valid,
|
||||||
|
.brat-token-status.valid {
|
||||||
|
color: var(--color-green);
|
||||||
|
}
|
||||||
|
|
||||||
|
.brat-token-info.invalid,
|
||||||
|
.brat-token-status.invalid {
|
||||||
|
color: var(--color-red);
|
||||||
|
}
|
||||||
|
|
||||||
|
.brat-token-info.valid {
|
||||||
|
border-left: 3px solid var(--color-green);
|
||||||
|
}
|
||||||
|
|
||||||
|
.brat-token-info.invalid {
|
||||||
|
border-left: 3px solid var(--color-red);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Token details and status */
|
||||||
|
.brat-token-status {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brat-token-details {
|
||||||
|
margin-top: 4px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Token warnings */
|
||||||
|
.brat-token-warning {
|
||||||
|
color: var(--color-orange);
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Token additional info */
|
||||||
|
.brat-token-scopes,
|
||||||
|
.brat-token-rate {
|
||||||
|
color: var(--text-muted);
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Flex break utility */
|
||||||
|
.brat-modal .break {
|
||||||
|
flex-basis: 100%;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Validation status */
|
||||||
|
.brat-modal .validation-status-error {
|
||||||
|
color: var(--text-error);
|
||||||
|
}
|
||||||
|
|
||||||
|
.brat-modal .validation-status {
|
||||||
|
margin-top: 0.5em;
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
font-size: 0.8em;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.confirm-modal .ok-button {
|
||||||
|
margin-right: 10px;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hide filtered plugin items */
|
||||||
|
.brat-plugin-item[hidden] {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hide filtered theme items */
|
||||||
|
.brat-theme-item[hidden] {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Filter and button layout */
|
||||||
|
.brat-filter-and-button {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 10px;
|
||||||
|
margin: 0.75em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brat-filter-input {
|
||||||
|
max-width: 300px;
|
||||||
|
padding: 4px 8px;
|
||||||
|
border: 1px solid var(--background-modifier-border);
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: var(--background-secondary);
|
||||||
|
color: var(--text-normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
.brat-filter-input:focus {
|
||||||
|
outline: none;
|
||||||
|
border-color: var(--interactive-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.brat-filter-and-button .setting-item {
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brat-filter-and-button .setting-item-control {
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"useCache": true,
|
||||||
|
"hideExcluded": true,
|
||||||
|
"recencyBoost": "0",
|
||||||
|
"downrankedFoldersFilters": [],
|
||||||
|
"ignoreDiacritics": true,
|
||||||
|
"ignoreArabicDiacritics": false,
|
||||||
|
"indexedFileTypes": [],
|
||||||
|
"displayTitle": "title",
|
||||||
|
"PDFIndexing": false,
|
||||||
|
"officeIndexing": false,
|
||||||
|
"imagesIndexing": false,
|
||||||
|
"aiImageIndexing": false,
|
||||||
|
"unsupportedFilesIndexing": "default",
|
||||||
|
"splitCamelCase": false,
|
||||||
|
"openInNewPane": false,
|
||||||
|
"vimLikeNavigationShortcut": false,
|
||||||
|
"ribbonIcon": true,
|
||||||
|
"showExcerpt": true,
|
||||||
|
"maxEmbeds": 5,
|
||||||
|
"renderLineReturnInExcerpts": true,
|
||||||
|
"showCreateButton": false,
|
||||||
|
"highlight": true,
|
||||||
|
"showPreviousQueryResults": true,
|
||||||
|
"simpleSearch": false,
|
||||||
|
"tokenizeUrls": false,
|
||||||
|
"fuzziness": "1",
|
||||||
|
"weightBasename": 10,
|
||||||
|
"weightDirectory": 7,
|
||||||
|
"weightH1": 6,
|
||||||
|
"weightH2": 5,
|
||||||
|
"weightH3": 4,
|
||||||
|
"weightUnmarkedTags": 2,
|
||||||
|
"weightCustomProperties": [],
|
||||||
|
"httpApiEnabled": false,
|
||||||
|
"httpApiPort": "51361",
|
||||||
|
"httpApiNotice": true,
|
||||||
|
"welcomeMessage": "1.21.0",
|
||||||
|
"verboseLogging": false,
|
||||||
|
"DANGER_httpHost": null,
|
||||||
|
"DANGER_forceSaveCache": false
|
||||||
|
}
|
||||||
+171
@@ -0,0 +1,171 @@
|
|||||||
|
/*
|
||||||
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||||
|
if you want to view the source, please visit the github repository of this plugin
|
||||||
|
*/
|
||||||
|
|
||||||
|
var uI=Object.create;var ku=Object.defineProperty;var cI=Object.getOwnPropertyDescriptor;var lI=Object.getOwnPropertyNames;var fI=Object.getPrototypeOf,dI=Object.prototype.hasOwnProperty;var hI=(e,t,r)=>t in e?ku(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var v=(e,t)=>()=>(e&&(t=e(e=0)),t);var Mi=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Nn=(e,t)=>{for(var r in t)ku(e,r,{get:t[r],enumerable:!0})},B_=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of lI(t))!dI.call(e,i)&&i!==r&&ku(e,i,{get:()=>t[i],enumerable:!(n=cI(t,i))||n.enumerable});return e};var ln=(e,t,r)=>(r=e!=null?uI(fI(e)):{},B_(t||!e||!e.__esModule?ku(r,"default",{value:e,enumerable:!0}):r,e)),$_=e=>B_(ku({},"__esModule",{value:!0}),e);var zl=(e,t,r)=>(hI(e,typeof t!="symbol"?t+"":t,r),r),hp=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var Fi=(e,t,r)=>(hp(e,t,"read from private field"),r?r.call(e):t.get(e)),Ru=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},pp=(e,t,r,n)=>(hp(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var H_=(e,t,r)=>(hp(e,t,"access private method"),r);var U_,V_=v(()=>{U_="5"});var Wn=v(()=>{V_();typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(U_)});var va,is,as,Bi,Pt,Ht,q_,z_,bt=v(()=>{va="[",is="[!",as="]",Bi={},Pt=Symbol(),Ht=Symbol("filename"),q_=Symbol("hmr"),z_="http://www.w3.org/1999/xhtml"});var Yl,Y_=v(()=>{Yl=!0});var K_,se,j_=v(()=>{K_=globalThis.process?.env?.NODE_ENV,se=K_&&!K_.toLowerCase().startsWith("prod")});var W_=v(()=>{});var mt=v(()=>{Y_();j_();W_()});var xr,ss,Lu,G_,Nt=v(()=>{xr=Symbol("$state"),ss=Symbol("$state metadata"),Lu=Symbol("legacy props"),G_=Symbol("")});function xa(e){return typeof e=="function"}function Z_(e){return e()}function os(e){for(var t=0;t<e.length;t++)e[t]()}var fn,Q_,Pu,mp,Kt,Kr,Kl,gp,X_,Ta,Ut,it=v(()=>{fn=Array.isArray,Q_=Array.prototype.indexOf,Pu=Array.from,mp=Object.keys,Kt=Object.defineProperty,Kr=Object.getOwnPropertyDescriptor,Kl=Object.getOwnPropertyDescriptors,gp=Object.prototype,X_=Array.prototype,Ta=Object.getPrototypeOf;Ut=()=>{}});function J_(){var e=Mu;Mu=[],os(e)}function eb(){var e=Fu;Fu=[],os(e)}function dn(e){Mu.length===0&&queueMicrotask(J_),Mu.push(e)}function tb(e){Fu.length===0&&pI(eb),Fu.push(e)}function _p(){Mu.length>0&&J_(),Fu.length>0&&eb()}var pI,Mu,Fu,On=v(()=>{it();pI=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback,Mu=[],Fu=[]});function jl(e){return e===this.v}function eo(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function to(e){return!eo(e,this.v)}var us=v(()=>{});function bp(){if(se){let e=new Error("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/bind_invalid_checkbox_value")}function rb(){if(se){let e=new Error(`derived_references_self
|
||||||
|
A derived value cannot reference itself recursively
|
||||||
|
https://svelte.dev/e/derived_references_self`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/derived_references_self")}function nb(e){if(se){let t=new Error(`effect_in_teardown
|
||||||
|
\`${e}\` cannot be used inside an effect cleanup function
|
||||||
|
https://svelte.dev/e/effect_in_teardown`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function ib(){if(se){let e=new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function ab(e){if(se){let t=new Error(`effect_orphan
|
||||||
|
\`${e}\` can only be used inside an effect (e.g. during component initialisation)
|
||||||
|
https://svelte.dev/e/effect_orphan`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_orphan")}function sb(){if(se){let e=new Error(`effect_update_depth_exceeded
|
||||||
|
Maximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops
|
||||||
|
https://svelte.dev/e/effect_update_depth_exceeded`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function ob(){if(se){let e=new Error(`hydration_failed
|
||||||
|
Failed to hydrate the application
|
||||||
|
https://svelte.dev/e/hydration_failed`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/hydration_failed")}function ub(e){if(se){let t=new Error(`props_invalid_value
|
||||||
|
Cannot do \`bind:${e}={undefined}\` when \`${e}\` has a fallback value
|
||||||
|
https://svelte.dev/e/props_invalid_value`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/props_invalid_value")}function cb(e){if(se){let t=new Error(`rune_outside_svelte
|
||||||
|
The \`${e}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
|
||||||
|
https://svelte.dev/e/rune_outside_svelte`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function lb(){if(se){let e=new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function fb(){if(se){let e=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function db(){if(se){let e=new Error("state_unsafe_local_read\nReading state that was created inside the same derived is forbidden. Consider using `untrack` to read locally created state\nhttps://svelte.dev/e/state_unsafe_local_read");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function hb(){if(se){let e=new Error("state_unsafe_mutation\nUpdating state inside a derived or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}var hn=v(()=>{mt()});function pb(){gi=!0}var gi,_i,$i=v(()=>{gi=!1,_i=!1});var Ep=v(()=>{mt()});var Bu=v(()=>{mt();Ep();it()});function Hi(e){let t=Error(),r=t.stack;if(r){let n=r.split(`
|
||||||
|
`),i=[`
|
||||||
|
`];for(let a=0;a<n.length;a++){let u=n[a];if(u!=="Error"){if(u.includes("validate_each_keys"))return null;u.includes("svelte/src/internal")||i.push(u)}}if(i.length===1)return null;Kt(t,"stack",{value:i.join(`
|
||||||
|
`)}),Kt(t,"name",{value:`${e}Error`})}return t}var $u,ro=v(()=>{bt();Bu();it();Nt();He();Ge();$u=null});function yp(e){cs=e}function Mt(e,t){var r={f:0,v:e,reactions:null,equals:jl,rv:0,wv:0};return se&&_i&&(r.created=t??Hi("CreatedAt"),r.debug=null),r}function Xn(e){return gb(Mt(e))}function bi(e,t=!1){let r=Mt(e);return t||(r.equals=to),gi&&Pe!==null&&Pe.l!==null&&(Pe.l.s??=[]).push(r),r}function ft(e,t=!1){return gb(bi(e,t))}function gb(e){return $e!==null&&!gn&&$e.f&2&&(Gn===null?bb([e]):Gn.push(e)),e}function oe(e,t){return $e!==null&&!gn&&Ei()&&$e.f&18&&(Gn===null||!Gn.includes(e))&&hb(),io(e,t)}function io(e,t){if(!e.equals(t)){var r=e.v;if(fs?no.set(e,t):no.set(e,r),e.v=t,e.wv=Uu(),se&&_i&&(e.updated=Hi("UpdatedAt"),Oe!=null&&(e.trace_need_increase=!0,e.trace_v??=r)),_b(e,2048),Ei()&&Oe!==null&&Oe.f&1024&&!(Oe.f&96)&&(pn===null?Eb([e]):pn.push(e)),se&&cs.size>0){let n=Array.from(cs);for(let i of n)i.f&1024&&Ar(i,4096),Vi(i)&&ds(i);cs.clear()}}return t}function _b(e,t){var r=e.reactions;if(r!==null)for(var n=Ei(),i=r.length,a=0;a<i;a++){var u=r[a],l=u.f;if(!(l&2048)&&!(!n&&u===Oe)){if(se&&l&262144){cs.add(u);continue}Ar(u,t),l&1280&&(l&2?_b(u,4096):ao(u))}}}var cs,no,yr=v(()=>{mt();Ge();us();Nt();hn();$i();ro();Ot();cs=new Set,no=new Map});function kn(e){var t=2050,r=$e!==null&&$e.f&2?$e:null;Oe===null||r!==null&&r.f&256?t|=256:Oe.f|=1048576;let n={ctx:Pe,deps:null,effects:null,equals:jl,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:r??Oe};return se&&_i&&(n.created=Hi("CreatedAt")),n}function Br(e){let t=kn(e);return t.equals=to,t}function Wl(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)lr(t[r])}}function mI(e){for(var t=e.parent;t!==null;){if(!(t.f&2))return t;t=t.parent}return null}function gI(e){var t,r=Oe;if(Wt(mI(e)),se){let n=cs;yp(new Set);try{Ap.includes(e)&&rb(),Ap.push(e),Wl(e),t=Gl(e)}finally{Wt(r),yp(n),Ap.pop()}}else try{Wl(e),t=Gl(e)}finally{Wt(r)}return t}function Sp(e){var t=gI(e),r=(qi||e.f&256)&&e.deps!==null?4096:1024;Ar(e,r),e.equals(t)||(e.v=t,e.wv=Uu())}var Ap,hs=v(()=>{mt();Nt();Ge();us();hn();He();yr();ro();$i();Ot();Ap=[]});function vb(e,t,r){se?console.warn(`%c[svelte] hydration_attribute_changed
|
||||||
|
%cThe \`${e}\` attribute on \`${t}\` changed its value between server and client renders. The client value, \`${r}\`, will be ignored in favour of the server value
|
||||||
|
https://svelte.dev/e/hydration_attribute_changed`,so,oo):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function Tb(e){se?console.warn(`%c[svelte] hydration_html_changed
|
||||||
|
%c${e?`The value of an \`{@html ...}\` block ${e} changed between server and client renders. The client value will be ignored in favour of the server value`:"The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value"}
|
||||||
|
https://svelte.dev/e/hydration_html_changed`,so,oo):console.warn("https://svelte.dev/e/hydration_html_changed")}function ps(e){se?console.warn(`%c[svelte] hydration_mismatch
|
||||||
|
%c${e?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${e}`:"Hydration failed because the initial UI does not match what was rendered on the server"}
|
||||||
|
https://svelte.dev/e/hydration_mismatch`,so,oo):console.warn("https://svelte.dev/e/hydration_mismatch")}function xb(){se?console.warn(`%c[svelte] lifecycle_double_unmount
|
||||||
|
%cTried to unmount a component that was not mounted
|
||||||
|
https://svelte.dev/e/lifecycle_double_unmount`,so,oo):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function Cp(e,t){se?console.warn(`%c[svelte] ownership_invalid_mutation
|
||||||
|
%c${e?`${e} mutated a value owned by ${t}. This is strongly discouraged. Consider passing values to child components with \`bind:\`, or use a callback instead`:"Mutating a value outside the component that created it is strongly discouraged. Consider passing values to child components with `bind:`, or use a callback instead"}
|
||||||
|
https://svelte.dev/e/ownership_invalid_mutation`,so,oo):console.warn("https://svelte.dev/e/ownership_invalid_mutation")}function Ql(e){se?console.warn(`%c[svelte] state_proxy_equality_mismatch
|
||||||
|
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${e}\` will produce unexpected results
|
||||||
|
https://svelte.dev/e/state_proxy_equality_mismatch`,so,oo):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}var so,oo,Wr=v(()=>{mt();so="font-weight: bold",oo="font-weight: normal"});function $r(e){ge=e}function wt(e){if(e===null)throw ps(),Bi;return De=e}function Vt(){return wt(fr(De))}function Te(e){if(ge){if(fr(De)!==null)throw ps(),Bi;De=e}}function wr(e=1){if(ge){for(var t=e,r=De;t--;)r=fr(r);De=r}}function uo(){for(var e=0,t=De;;){if(t.nodeType===8){var r=t.data;if(r===as){if(e===0)return t;e-=1}else(r===va||r===is)&&(e+=1)}var n=fr(t);t.remove(),t=n}}var ge,De,Et=v(()=>{bt();Wr();Gr();ge=!1});function er(e,t=null,r){var n=null;if(se&&_i&&(n=Hi("CreatedAt")),typeof e!="object"||e===null||xr in e)return e;let i=Ta(e);if(i!==gp&&i!==X_)return e;var a=new Map,u=fn(e),l=Mt(0);u&&a.set("length",Mt(e.length,n));var d;if(se)if(d={parent:t,owners:null},r){let p=r.v?.[ss]?.owners;d.owners=p?new Set(p):null}else d.owners=t===null?Pe!==null?new Set([Pe.function]):null:new Set;return new Proxy(e,{defineProperty(p,g,E){(!("value"in E)||E.configurable===!1||E.enumerable===!1||E.writable===!1)&&lb();var _=a.get(g);return _===void 0?(_=Mt(E.value,n),a.set(g,_)):oe(_,er(E.value,d)),!0},deleteProperty(p,g){var E=a.get(g);if(E===void 0)g in p&&a.set(g,Mt(Pt,n));else{if(u&&typeof g=="string"){var _=a.get("length"),y=Number(g);Number.isInteger(y)&&y<_.v&&oe(_,y)}oe(E,Pt),yb(l)}return!0},get(p,g,E){if(se&&g===ss)return d;if(g===xr)return e;var _=a.get(g),y=g in p;if(_===void 0&&(!y||Kr(p,g)?.writable)&&(_=Mt(er(y?p[g]:Pt,d),n),a.set(g,_)),_!==void 0){var C=q(_);if(se){var D=C?.[ss];D&&D?.parent!==d&&Ip(d,D)}return C===Pt?void 0:C}return Reflect.get(p,g,E)},getOwnPropertyDescriptor(p,g){var E=Reflect.getOwnPropertyDescriptor(p,g);if(E&&"value"in E){var _=a.get(g);_&&(E.value=q(_))}else if(E===void 0){var y=a.get(g),C=y?.v;if(y!==void 0&&C!==Pt)return{enumerable:!0,configurable:!0,value:C,writable:!0}}return E},has(p,g){if(se&&g===ss||g===xr)return!0;var E=a.get(g),_=E!==void 0&&E.v!==Pt||Reflect.has(p,g);if(E!==void 0||Oe!==null&&(!_||Kr(p,g)?.writable)){E===void 0&&(E=Mt(_?er(p[g],d):Pt,n),a.set(g,E));var y=q(E);if(y===Pt)return!1}return _},set(p,g,E,_){var y=a.get(g),C=g in p;if(u&&g==="length")for(var D=E;D<y.v;D+=1){var P=a.get(D+"");P!==void 0?oe(P,Pt):D in p&&(P=Mt(Pt,n),a.set(D+"",P))}if(y===void 0?(!C||Kr(p,g)?.writable)&&(y=Mt(void 0,n),oe(y,er(E,d)),a.set(g,y)):(C=y.v!==Pt,oe(y,er(E,d))),se){var N=E?.[ss];N&&N?.parent!==d&&Ip(d,N),Ab(d)}var L=Reflect.getOwnPropertyDescriptor(p,g);if(L?.set&&L.set.call(_,E),!C){if(u&&typeof g=="string"){var H=a.get("length"),R=Number(g);Number.isInteger(R)&&R>=H.v&&oe(H,R+1)}yb(l)}return!0},ownKeys(p){q(l);var g=Reflect.ownKeys(p).filter(y=>{var C=a.get(y);return C===void 0||C.v!==Pt});for(var[E,_]of a)_.v!==Pt&&!(E in p)&&g.push(E);return g},setPrototypeOf(){fb()}})}function yb(e,t=1){oe(e,e.v+t)}function Xl(e){return e!==null&&typeof e=="object"&&xr in e?e[xr]:e}var co=v(()=>{mt();Ge();Ot();it();Vu();yr();Nt();bt();hn();ro();$i()});function wb(){let e=Array.prototype,t=Array.__svelte_cleanup;t&&t();let{indexOf:r,lastIndexOf:n,includes:i}=e;e.indexOf=function(a,u){let l=r.call(this,a,u);if(l===-1){for(let d=u??0;d<this.length;d+=1)if(Xl(this[d])===a){Ql("array.indexOf(...)");break}}return l},e.lastIndexOf=function(a,u){let l=n.call(this,a,u??this.length-1);if(l===-1){for(let d=0;d<=(u??this.length-1);d+=1)if(Xl(this[d])===a){Ql("array.lastIndexOf(...)");break}}return l},e.includes=function(a,u){let l=i.call(this,a,u);if(!l){for(let d=0;d<this.length;d+=1)if(Xl(this[d])===a){Ql("array.includes(...)");break}}return l},Array.__svelte_cleanup=()=>{e.indexOf=r,e.lastIndexOf=n,e.includes=i}}var Np=v(()=>{Wr();co()});function Zl(){if(Op===void 0){Op=window,Sb=document,qu=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype;Cb=Kr(t,"firstChild").get,Ib=Kr(t,"nextSibling").get,e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0,Text.prototype.__t=void 0,se&&(e.__svelte_meta=null,wb())}}function Qr(e=""){return document.createTextNode(e)}function qt(e){return Cb.call(e)}function fr(e){return Ib.call(e)}function xe(e,t){if(!ge)return qt(e);var r=qt(De);if(r===null)r=De.appendChild(Qr());else if(t&&r.nodeType!==3){var n=Qr();return r?.before(n),wt(n),n}return wt(r),r}function Sr(e,t){if(!ge){var r=qt(e);return r instanceof Comment&&r.data===""?fr(r):r}if(t&&De?.nodeType!==3){var n=Qr();return De?.before(n),wt(n),n}return De}function Ye(e,t=1,r=!1){let n=ge?De:e;for(var i;t--;)i=n,n=fr(n);if(!ge)return n;var a=n?.nodeType;if(r&&a!==3){var u=Qr();return n===null?i?.after(u):n.before(u),wt(u),u}return wt(n),n}function zu(e){e.textContent=""}var Op,Sb,qu,Cb,Ib,Gr=v(()=>{Et();mt();Np();it()});function Rp(e){fs=e}function tr(e){$e=e}function Wt(e){Oe=e}function bb(e){Gn=e}function Eb(e){pn=e}function Uu(){return++Lb}function Vi(e){var t=e.f;if(t&2048)return!0;if(t&4096){var r=e.deps,n=(t&256)!==0;if(r!==null){var i,a,u=(
Line truncated
|
||||||
|
${i.map(g=>`
|
||||||
|
${d}in ${g}`).join("")}
|
||||||
|
`}),Kt(e,"component_stack",{value:i});let p=e.stack;if(p){let g=p.split(`
|
||||||
|
`),E=[];for(let _=0;_<g.length;_++){let y=g[_];y.includes("svelte/src/internal")||E.push(y)}Kt(e,"stack",{value:E.join(`
|
||||||
|
`)})}if(Ob(e,t),Db(t))throw e}function Pb(e,t,r=!0){var n=e.reactions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];a.f&2?Pb(a,t,!1):t===a&&(r?Ar(a,2048):a.f&1024&&Ar(a,4096),ao(a))}}function Gl(e){var t=Hr,r=bn,n=pn,i=$e,a=qi,u=Gn,l=Pe,d=gn,p=e.f;Hr=null,bn=0,pn=null,qi=(p&256)!==0&&(gn||!ms||$e===null),$e=p&96?null:e,Gn=null,Gu(e.ctx),gn=!1,rf++;try{var g=(0,e.fn)(),E=e.deps;if(Hr!==null){var _;if(Wu(e,bn),E!==null&&bn>0)for(E.length=bn+Hr.length,_=0;_<Hr.length;_++)E[bn+_]=Hr[_];else e.deps=E=Hr;if(!qi)for(_=bn;_<E.length;_++)(E[_].reactions??=[]).push(e)}else E!==null&&bn<E.length&&(Wu(e,bn),E.length=bn);if(Ei()&&pn!==null&&!gn&&E!==null&&!(e.f&6146))for(_=0;_<pn.length;_++)Pb(pn[_],e);return i!==null&&(rf++,pn!==null&&(n===null?n=pn:n.push(...pn))),g}finally{Hr=t,bn=r,pn=n,$e=i,qi=a,Gn=u,Gu(l),gn=d}}function _I(e,t){let r=t.reactions;if(r!==null){var n=Q_.call(r,e);if(n!==-1){var i=r.length-1;i===0?r=t.reactions=null:(r[n]=r[i],r.pop())}}r===null&&t.f&2&&(Hr===null||!Hr.includes(t))&&(Ar(t,4096),t.f&768||(t.f^=512),Wl(t),Wu(t,0))}function Wu(e,t){var r=e.deps;if(r!==null)for(var n=t;n<r.length;n++)_I(e,r[n])}function ds(e){var t=e.f;if(!(t&16384)){Ar(e,1024);var r=Oe,n=Pe,i=ms;if(Oe=e,ms=!0,se){var a=Xr;Qu(e.component_function)}try{t&16?Mb(e):Pp(e),Lp(e);var u=Gl(e);e.teardown=typeof u=="function"?u:null,e.wv=Lb;var l=e.deps;if(se&&_i&&e.f&2048&&l!==null)for(let p=0;p<l.length;p++){var d=l[p];d.trace_need_increase&&(d.wv=Uu(),d.trace_need_increase=void 0,d.trace_v=void 0)}se&&tf.push(e)}catch(p){fo(p,e,r,n||e.ctx)}finally{ms=i,Oe=r,se&&Qu(a)}}}function kb(){console.error("Last ten effects were: ",tf.slice(-10).map(e=>e.fn)),tf=[]}function bI(){try{sb()}catch(e){if(se&&Kt(e,"stack",{value:""}),Yu!==null)if(se)try{fo(e,Yu,null,null)}catch(t){throw kb(),t}else fo(e,Yu,null,null);else throw se&&kb(),e}}function Dp(){var e=ms;try{var t=0;for(ms=!0;Ku.length>0;){t++>1e3&&bI();var r=Ku,n=r.length;Ku=[];for(var i=0;i<n;i++){var a=vI(r[i]);EI(a)}}}finally{ju=!1,ms=e,Yu=null,se&&(tf=[]),no.clear()}}function EI(e){var t=e.length;if(t!==0)for(var r=0;r<t;r++){var n=e[r];if(!(n.f&24576))try{Vi(n)&&(ds(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?Mp(n):n.fn=null))}catch(i){fo(i,n,null,n.ctx)}}}function ao(e){ju||(ju=!0,queueMicrotask(Dp));for(var t=Yu=e;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024))return;t.f^=1024}}Ku.push(t)}function vI(e){for(var t=[],r=e;r!==null;){var n=r.f,i=(n&96)!==0,a=i&&(n&1024)!==0;if(!a&&!(n&8192)){if(n&4)t.push(r);else if(i)r.f^=1024;else{var u=$e;try{$e=r,Vi(r)&&ds(r)}catch(p){fo(p,r,null,r.ctx)}finally{$e=u}}var l=r.first;if(l!==null){r=l;continue}}var d=r.parent;for(r=r.next;r===null&&d!==null;)r=d.next,d=d.parent}return t}function ho(e){var t;for(e&&(ju=!0,Dp(),t=e()),_p();Ku.length>0;)ju=!0,Dp(),_p();return t}async function vi(){await Promise.resolve(),ho()}function q(e){var t=e.f,r=(t&2)!==0;if(Hu!==null&&Hu.add(e),$e!==null&&!gn){Gn!==null&&Gn.includes(e)&&db();var n=$e.deps;e.rv<rf&&(e.rv=rf,Hr===null&&n!==null&&n[bn]===e?bn++:Hr===null?Hr=[e]:(!qi||!Hr.includes(e))&&Hr.push(e))}else if(r&&e.deps===null&&e.effects===null){var i=e,a=i.parent;a!==null&&!(a.f&256)&&(i.f^=256)}if(r&&(i=e,Vi(i)&&Sp(i)),se&&_i&&$u!==null&&$e!==null&&$u.reaction===$e){if(e.debug)e.debug();else if(e.created){var u=$u.entries.get(e);u===void 0&&(u={read:[]},$u.entries.set(e,u)),u.read.push(Hi("TracedAt"))}}return fs&&no.has(e)?no.get(e):e.v}function at(e){var t=gn;try{return gn=!0,e()}finally{gn=t}}function Ar(e,t){e.f=e.f&TI|t}function vt(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(xr in e)nf(e);else if(!Array.isArray(e))for(let t in e){let r=e[t];typeof r=="object"&&r&&xr in r&&nf(r)}}}function nf(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{nf(e[n],t)}catch{}let r=Ta(e);if(r!==Object.prototype&&r!==Array.prototype&&r!==Map.prototype&&r!==Set.prototype&&r!==Date.prototype){let n=Kl(r);for(let i in n){let a=n[i].get;if(a)try{a.call(e)}catch{}}}}}var Nb,Jl,ju,Yu,ms,fs,Ku,tf,$e,gn,Oe,Gn,Hr,bn,pn,Lb,rf,qi,Hu,TI,Ge=v(()=>{mt();it();He();Nt();On();yr();hs();hn();bt();$i();ro();Ot();Gr();Nb=new WeakSet,Jl=!1,ju=!1,Yu=null,ms=!1,fs=!1;Ku=[],tf=[],$e=null,gn=!1;Oe=null;Gn=null;Hr=null,bn=0,pn=null;Lb=1,rf=0,qi=!1,Hu=null;TI=-7169});function Bp(e){Oe===null&&$e===null&&ab(e),$e!==null&&$e.f&256&&Oe===null&&ib(),fs&&nb(e)}function xI(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function gs(e,t,r,n=!0){var i=Oe;if(se)for(;i!==null&&i.f&262144;)i=i.parent;var a={ctx:Pe,deps:null,nodes_start:null,nodes_end:null,f:e|2048,first:null,fn:t,last:null,next:null,parent:i,prev:null,teardown:null,transitions:null,wv:0};if(se&&(a.component_function=Xr),r)try{ds(a),a.f|=32768}catch(d){throw lr(a),d}else t!==null&&ao(a);var u=r&&a.deps===null&&a.first===null&&a.nodes_start===null&&a.teardown===null&&(a.f&1048704)===0;if(!u&&n&&(i!==nu
Line truncated
|
||||||
|
`)){let n=AI.exec(r)??wI.exec(r);n&&t.push({file:n[1],line:+n[2],column:+n[3]})}return t}function Hb(){let e=SI()?.slice(4);if(!e)return null;for(let t=0;t<e.length;t++){let r=e[t],n=yI[r.file];if(!n){if(t===0)return null;continue}for(let i of n){if(i.end==null)return null;if(i.start.line<r.line&&i.end.line>r.line)return i.component}}return null}function Ip(e,t){if(t.owners!==null)for(;e;){if(e.owners===null){t.owners=null;break}for(let r of e.owners)t.owners.add(r);e=e.parent}}function Ub(e,t){return e.owners===null?!0:e.owners.has(t)||Ht in t&&[...e.owners].some(r=>r[Ht]===t[Ht])||e.parent!==null&&Ub(e.parent,t)}function Vb(e){return e?.owners?.values().next().value??Vb(e.parent)}function Ab(e){if(II)return;let t=Hb();if(t&&!Ub(e,t)){let r=Vb(e);r[Ht]!==t[Ht]?Cp(t[Ht],r[Ht]):Cp()}}var yI,AI,wI,CI,II,Vu=v(()=>{Nt();He();Ot();it();Wr();bt();yI={},AI=/at (?:.+ \()?(.+):(\d+):(\d+)\)?$/,wI=/@(.+):(\d+):(\d+)$/;CI=Symbol("ADD_OWNER");II=!1});function mo(e){if(se){let t=new Error(`lifecycle_outside_component
|
||||||
|
\`${e}(...)\` can only be used during component initialisation
|
||||||
|
https://svelte.dev/e/lifecycle_outside_component`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var go=v(()=>{mt()});function Gu(e){Pe=e}function Qu(e){Xr=e}function dr(e,t=!1,r){var n=Pe={p:Pe,c:null,d:!1,e:null,m:!1,s:e,x:null,l:null};gi&&!t&&(Pe.l={s:null,u:null,r1:[],r2:Mt(!1)}),Cr(()=>{n.d=!0}),se&&(Pe.function=r,Xr=r)}function hr(e){let t=Pe;if(t!==null){e!==void 0&&(t.x=e);let u=t.e;if(u!==null){var r=Oe,n=$e;t.e=null;try{for(var i=0;i<u.length;i++){var a=u[i];Wt(a.effect),tr(a.reaction),Gt(a.fn)}}finally{Wt(r),tr(n)}}Pe=t.p,se&&(Xr=t.p?.function??null),t.m=!0}return e||{}}function Ei(){return!gi||Pe!==null&&Pe.l===null}var Pe,Xr,Ot=v(()=>{mt();Vu();go();yr();Ge();He();$i();Pe=null;Xr=null});function qb(e){e=e.replace(DI,"");let t=5381,r=e.length;for(;r--;)t=(t<<5)-t^e.charCodeAt(r);return(t>>>0).toString(36)}function zb(e){return RI.includes(e)}function Hp(e){return e?.replace(/\//g,"/\u200B")}var DI,kI,mB,RI,_s=v(()=>{DI=/\r/g;kI=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"],mB=[...kI,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"],RI=["touchstart","touchmove"]});var Yb=v(()=>{_s();Ge();Wr()});var Up=v(()=>{});var Kb=v(()=>{bt();Et()});function uf(){jb||(jb=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t.__on_r?.()})},{capture:!0}))}var jb,cf=v(()=>{Et();Gr();On();jb=!1});function _o(e){var t=$e,r=Oe;tr(null),Wt(null);try{return e()}finally{tr(t),Wt(r)}}function Vp(e,t,r,n=r){e.addEventListener(t,()=>_o(r));let i=e.__on_r;i?e.__on_r=()=>{i(),n(!0)}:e.__on_r=()=>n(!0),uf()}var xi=v(()=>{He();Ge();cf()});function Gb(e,t,r,n={}){function i(a){if(n.capture||bo.call(t,a),!a.cancelBubble)return _o(()=>r?.call(this,a))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?dn(()=>{t.addEventListener(e,i,n)}):t.addEventListener(e,i,n),i}function pr(e,t,r,n,i){var a={capture:n,passive:i},u=Gb(e,t,r,a);(t===document.body||t===window||t===document)&&Cr(()=>{t.removeEventListener(e,u,a)})}function bo(e){var t=this,r=t.ownerDocument,n=e.type,i=e.composedPath?.()||[],a=i[0]||e.target,u=0,l=e.__root;if(l){var d=i.indexOf(l);if(d!==-1&&(t===document||t===window)){e.__root=t;return}var p=i.indexOf(t);if(p===-1)return;d<=p&&(u=d)}if(a=i[u]||e.target,a!==t){Kt(e,"currentTarget",{configurable:!0,get(){return a||r}});var g=$e,E=Oe;tr(null),Wt(null);try{for(var _,y=[];a!==null;){var C=a.assignedSlot||a.parentNode||a.host||null;try{var D=a["__"+n];if(D!=null&&(!a.disabled||e.target===a))if(fn(D)){var[P,...N]=D;P.apply(a,[e,...N])}else D.call(a,e)}catch(L){_?y.push(L):_=L}if(e.cancelBubble||C===t||C===null)break;a=C}if(_){for(let L of y)queueMicrotask(()=>{throw L});throw _}}finally{e.__root=t,delete e.currentTarget,tr(g),Wt(E)}}}var Wb,qp,Zu=v(()=>{He();it();Et();On();bt();Wr();Ge();xi();Wb=new Set,qp=new Set});function Qb(){LI=void 0}var LI,zp=v(()=>{Et();Gr();He();Nt();bt()});function Ju(e){var t=document.createElement("template");return t.innerHTML=e,t.content}var lf=v(()=>{});function Zr(e,t){var r=Oe;r.nodes_start===null&&(r.nodes_start=e,r.nodes_end=t)}function Le(e,t){var r=(t&1)!==0,n=(t&2)!==0,i,a=!e.startsWith("<!>");return()=>{if(ge)return Zr(De,null),De;i===void 0&&(i=Ju(a?e:"<!>"+e),r||(i=qt(i)));var u=n||qu?document.importNode(i,!0):i.cloneNode(!0);if(r){var l=qt(u),d=u.lastChild;Zr(l,d)}else Zr(u,u);return u}}function ec(e=""){if(!ge){var t=Qr(e+"");return Zr(t,t),t}var r=De;return r.nodeType!==3&&(r.before(r=Qr()),wt(r)),Zr(r,r),r}function zi(){if(ge)return Zr(De,null),De;var e=document.createDocumentFragment(),t=document.createComment(""),r=Qr();return e.append(t,r),Zr(t,r),e}function we(e,t){if(ge){Oe.nodes_end=De,Vt();return}e!==null&&e.before(t)}var bs=v(()=>{Et();Gr();lf();Ge();bt()});function ir(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??=e.nodeValue)&&(e.__t=r,e.nodeValue=r+"")}function Es(e,t){return Xb(e,t)}function Kp(e,t){Zl(),t.intro=t.intro??!1;let r=t.target,n=ge,i=De;try{for(var a=qt(r);a&&(a.nodeType!==8||a.data!==va);)a=fr(a);if(!a)throw Bi;$r(!0),wt(a),Vt();let u=Xb(e,{...t,anchor:a});if(De===null||De.nodeType!==8||De.data!==as)throw ps(),Bi;return $r(!1),u}catch(u){if(u===Bi)return t.recover===!1&&ob(),Zl(),zu(r),$r(!1),Es(e,t);throw u}finally{$r(n),wt(i),Qb()}}function Xb(e,{target:t,anchor:r,props:n={},events:i,context:a,intro:u=!0}){Zl();var l=new Set,d=E=>{for(var _=0;_<E.length;_++){var y=E[_];if(!l.has(y)){l.add(y);var C=zb(y);t.addEventListener(y,bo,{passive:C});v
Line truncated
|
||||||
|
\r\f\xA0\v\uFEFF`]});function Ki(e,t,r,n,i,a){var u=e.__className;if(ge||u!==r){var l=vE(r,n,a);(!ge||l!==e.getAttribute("class"))&&(l==null?e.removeAttribute("class"):t?e.className=l:e.setAttribute("class",l)),e.__className=r}else if(a&&i!==a)for(var d in a){var p=!!a[d];(i==null||p!==!!i[d])&&e.classList.toggle(d,p)}return a}var Zp=v(()=>{ic();Et()});function Jp(e,t={},r,n){for(var i in r){var a=r[i];t[i]!==a&&(r[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,n))}}function ac(e,t,r,n){var i=e.__style;if(ge||i!==t){var a=TE(t,n);(!ge||a!==e.getAttribute("style"))&&(a==null?e.removeAttribute("style"):e.style.cssText=a),e.__style=t}else n&&(Array.isArray(n)?(Jp(e,r?.[0],n[0]),Jp(e,r?.[1],n[1],"important")):Jp(e,r,n));return n}var em=v(()=>{ic();Et()});function rm(e){if(ge){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var n=e.value;ji(e,"value",null),e.value=n}if(e.hasAttribute("checked")){var i=e.checked;ji(e,"checked",null),e.checked=i}}};e.__on_r=r,tb(r),uf()}}function ji(e,t,r,n){var i=XI(e);if(ge&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")){n||JI(e,t,r??"");return}i[t]!==(i[t]=r)&&(t==="loading"&&(e[G_]=r),r==null?e.removeAttribute(t):typeof r!="string"&&ZI(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function XI(e){return e.__attributes??={[GI]:e.nodeName.includes("-"),[QI]:e.namespaceURI===z_}}function ZI(e){var t=xE.get(e.nodeName);if(t)return t;xE.set(e.nodeName,t=[]);for(var r,n=e,i=Element.prototype;i!==n;){r=Kl(n);for(var a in r)r[a].set&&t.push(a);n=Ta(n)}return t}function JI(e,t,r){se&&(t==="srcset"&&e3(e,r)||tm(e.getAttribute(t)??"",r)||vb(t,e.outerHTML.replace(e.innerHTML,e.innerHTML&&"..."),String(r)))}function tm(e,t){return e===t?!0:new URL(e,document.baseURI).href===new URL(t,document.baseURI).href}function yE(e){return e.split(",").map(t=>t.trim().split(" ").filter(Boolean))}function e3(e,t){var r=yE(e.srcset),n=yE(t);return n.length===r.length&&n.every(([i,a],u)=>a===r[u][1]&&(tm(r[u][0],i)||tm(i,r[u][0])))}var jI,WI,GI,QI,xE,AE=v(()=>{mt();Et();it();Zu();cf();Wr();Nt();On();_s();Ge();ic();Zp();em();bt();jI=Symbol("class"),WI=Symbol("style"),GI=Symbol("is custom element"),QI=Symbol("is html");xE=new Map});var t3,ei,nm=v(()=>{it();mt();t3=Yl?()=>performance.now():()=>Date.now(),ei={tick:e=>(Yl?requestAnimationFrame:Ut)(e),now:()=>t3(),tasks:new Set}});function wE(){let e=ei.now();ei.tasks.forEach(t=>{t.c(e)||(ei.tasks.delete(t),t.f())}),ei.tasks.size!==0&&ei.tick(wE)}function SE(e){let t;return ei.tasks.size===0&&ei.tick(wE),{promise:new Promise(r=>{ei.tasks.add(t={c:e,f:r})}),abort(){ei.tasks.delete(t)}}}var CE=v(()=>{nm()});function hf(e,t){_o(()=>{e.dispatchEvent(new CustomEvent(t))})}function a3(e){if(e==="float")return"cssFloat";if(e==="offset")return"cssOffset";if(e.startsWith("--"))return e;let t=e.split("-");return t.length===1?t[0]:t[0]+t.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("")}function IE(e){let t={},r=e.split(";");for(let n of r){let[i,a]=n.split(":");if(!i||a===void 0)break;let u=a3(i.trim());t[u]=a.trim()}return t}function am(e,t,r,n){var i=(e&1)!==0,a=(e&2)!==0,u=i&&a,l=(e&4)!==0,d=u?"both":i?"in":"out",p,g=t.inert,E=t.style.overflow,_,y;function C(){var H=$e,R=Oe;tr(null),Wt(null);try{return p??=r()(t,n?.()??{},{direction:d})}finally{tr(H),Wt(R)}}var D={is_global:l,in(){if(t.inert=g,!i){y?.abort(),y?.reset?.();return}a||_?.abort(),hf(t,"introstart"),_=im(t,C(),y,1,()=>{hf(t,"introend"),_?.abort(),_=p=void 0,t.style.overflow=E})},out(H){if(!a){H?.(),p=void 0;return}t.inert=!0,hf(t,"outrostart"),y=im(t,C(),_,0,()=>{hf(t,"outroend"),H?.()})},stop:()=>{_?.abort(),y?.abort()}},P=Oe;if((P.transitions??=[]).push(D),i&&ff){var N=l;if(!N){for(var L=P.parent;L&&L.f&65536;)for(;(L=L.parent)&&!(L.f&16););N=!L||(L.f&32768)!==0}N&&Gt(()=>{at(()=>D.in())})}}function im(e,t,r,n,i){var a=n===1;if(xa(t)){var u,l=!1;return dn(()=>{if(!l){var P=t({direction:a?"in":"out"});u=im(e,P,r,n,i)}}),{abort:()=>{l=!0,u?.abort()},deactivate:()=>u.deactivate(),reset:()=>u.reset(),t:()=>u.t()}}if(r?.deactivate(),!t?.duration)return i(),{abort:Ut,deactivate:Ut,reset:Ut,t:()=>n};let{delay:d=0,css:p,tick:g,easing:E=s3}=t;var _=[];if(a&&r===void 0&&(g&&g(0,1),p)){var y=IE(p(0,1));_.push(y,y)}var C=()=>1-n,D=e.animate(_,{duration:d});return D.onfinish=()=>{var P=r?.t()??1-n;r?.abort();var N=n-P,L=t.duration*Math.abs(N),H=[];if(L>0){var R=!1;if(p)for(var B=Math.ceil(L/16.666666666666668),V=0;V<=B;V+=1){var X=P+N*E(V/B),ce=IE(p(X,1-X));H.push(ce),R||=ce.overflow==="hidden"}R&&(e.style.overflow="hidden"),C=()=>{var ve=D.currentTime;return P+N*E(ve/L)},g&&SE(()=>{if(D.playState!=="running")return!1;var ve=C();return g(ve,1-ve),!0})}D=e.animate(H,{duration:L,fill:"forwards"}),D.onfinish=()=>{C=()=>n,g?.(n,1-n),i()}},{abort:()=>{D&&(D.cancel(),D.effect=null,D.onfinish=Ut)},deactivate:()=>{i=Ut},reset:()=>{n===0&&g?.(1,0)},t:()=>C()}}var s3,NE=v(()=>{it();He();Ge();CE();vs();df();bt();Nt();On();xi();s3=e=>e});var OE=v(()=>{xi()});function um(
Line truncated
|
||||||
|
Enable this option to completely hide them.`).addToggle(i=>i.setValue(t.hideExcluded).onChange(async a=>{t.hideExcluded=a,await ke(e)})),new tn.Setting(r).setName("Folders to downrank in search results").setDesc("Folders to downrank in search results. Files in these folders will be downranked in results. They will still be indexed for tags, unlike excluded files. Folders should be comma delimited.").addText(i=>{i.setValue(t.downrankedFoldersFilters.join(",")).setPlaceholder("Example: src,p2/dir").onChange(async a=>{let u=a.split(",");u=u.map(l=>l.trim()),t.downrankedFoldersFilters=u,await ke(e)})}),new tn.Setting(r).setName("Split CamelCaseWords").setDesc(ar(`Enable this if you want to be able to search for CamelCaseWords as separate words.<br/>
|
||||||
|
\u26A0\uFE0F <span style="color: var(--text-accent)">Changing this setting will clear the cache.</span><br>
|
||||||
|
${Ao}`)).addToggle(i=>i.setValue(t.splitCamelCase).onChange(async a=>{await n.clearCache(),t.splitCamelCase=a,await ke(e)})),new tn.Setting(r).setName("Simpler search").setDesc(`Enable this if Obsidian often freezes while making searches.
|
||||||
|
Words shorter than 3 characters won't be used as prefixes; this can reduce search delay but will return fewer results.`).addToggle(i=>i.setValue(t.simpleSearch).onChange(async a=>{t.simpleSearch=a,await ke(e)})),tn.Platform.isIosApp||new tn.Setting(r).setName("Tokenize URLs").setDesc(`Enable this if you want to be able to search for URLs as separate words.
|
||||||
|
This setting has a strong impact on indexing performance, and can crash Obsidian under certain conditions.`).addToggle(i=>i.setValue(t.tokenizeUrls).onChange(async a=>{t.tokenizeUrls=a,await ke(e)})),new tn.Setting(r).setName("Open in new pane").setDesc("Open and create files in a new pane instead of the current pane.").addToggle(i=>i.setValue(t.openInNewPane).onChange(async a=>{t.openInNewPane=a,await ke(e)})),new tn.Setting(r).setName("Set Vim like navigation keys").setDesc(`Navigate down the results with ${vn()} + J/N, or navigate up with ${vn()} + K/P.`).addToggle(i=>i.setValue(t.vimLikeNavigationShortcut).onChange(async a=>{t.vimLikeNavigationShortcut=a,await ke(e)})),new tn.Setting(r).setName("Fuzziness").setDesc("Define the level of fuzziness for the search. The higher the fuzziness, the more results you'll get.").addDropdown(i=>i.addOptions({0:"Exact match",1:"Not too fuzzy",2:"Fuzzy enough"}).setValue(t.fuzziness).onChange(async a=>{["0","1","2"].includes(a)||(a="2"),t.fuzziness=a,await ke(e)}))}var tn,Tv=v(()=>{tn=require("obsidian");mr();mr();Nr()});function xv(e,t,r){let n=e.database;new Si.Setting(r).setName("Danger Zone").setHeading(),new Si.Setting(r).setName("Ignore diacritics").setDesc(ar(`Normalize diacritics in search terms. Words like "br\xFBl\xE9e" or "\u017Elu\u0165ou\u010Dk\xFD" will be indexed as "brulee" and "zlutoucky".<br/>
|
||||||
|
\u26A0\uFE0F <span style="color: var(--text-accent)">You probably should <strong>NOT</strong> disable this.</span><br>
|
||||||
|
\u26A0\uFE0F <span style="color: var(--text-accent)">Changing this setting will clear the cache.</span><br>
|
||||||
|
${Ao}`)).addToggle(a=>a.setValue(t.ignoreDiacritics).onChange(async u=>{await n.clearCache(),t.ignoreDiacritics=u,await ke(e)})),new Si.Setting(r).setName("Ignore Arabic diacritics (beta)").addToggle(a=>a.setValue(t.ignoreArabicDiacritics).onChange(async u=>{await n.clearCache(),t.ignoreArabicDiacritics=u,await ke(e)}));let i=new DocumentFragment;i.createSpan({},a=>{a.innerHTML=`Disable Omnisearch on this device only.<br>
|
||||||
|
${Ao}`}),new Si.Setting(r).setName("Disable on this device").setDesc(i).addToggle(a=>a.setValue(Nf(e.app)).onChange(async u=>{u?(e.app.saveLocalStorage(Ss,"1"),new Si.Notice("Omnisearch - Disabled. Please restart Obsidian.")):(e.app.saveLocalStorage(Ss),new Si.Notice("Omnisearch - Enabled. Please restart Obsidian."))})),new Si.Setting(r).setName("Force save the cache").setDesc(ar(`Omnisearch has a security feature that automatically disables cache writing if it cannot fully perform the operation.<br>
|
||||||
|
Use this option to force the cache to be saved, even if it causes a crash.<br>
|
||||||
|
\u26A0\uFE0F <span style="color: var(--text-accent)">Enabling this setting could lead to crash loops</span>`)).addToggle(a=>a.setValue(t.DANGER_forceSaveCache).onChange(async u=>{t.DANGER_forceSaveCache=u,await ke(e)})),Qi()&&new Si.Setting(r).setName("Clear cache data").setDesc(ar(`Erase all Omnisearch cache data.
|
||||||
|
Use this if Omnisearch results are inconsistent, missing, or appear outdated.<br>
|
||||||
|
${Ao}`)).addButton(a=>{a.setButtonText("Clear cache"),a.onClick(async()=>{await n.clearCache()})})}var Si,yv=v(()=>{Si=require("obsidian");mr();mr();mr();en()});function Av(e,t,r){Ns.Platform.isMobile||(new Ns.Setting(r).setName("API Access Through HTTP").setHeading().setDesc(ar('Omnisearch can be used through a simple HTTP server (<a href="https://publish.obsidian.md/omnisearch/Public+API+%26+URL+Scheme#HTTP+Server">more information</a>).')),new Ns.Setting(r).setName("Enable the HTTP server").addToggle(n=>n.setValue(t.httpApiEnabled).onChange(async i=>{t.httpApiEnabled=i,i?e.apiHttpServer.listen(t.httpApiPort):e.apiHttpServer.close(),await ke(e)})),new Ns.Setting(r).setName("HTTP Port").addText(n=>{n.setValue(t.httpApiPort).setPlaceholder("51361").onChange(async i=>{parseInt(i)>65535&&(i=t.httpApiPort,n.setValue(t.httpApiPort)),t.httpApiPort=i,t.httpApiEnabled&&(e.apiHttpServer.close(),e.apiHttpServer.listen(t.httpApiPort)),await ke(e)})}),new Ns.Setting(r).setName("Show a notification when the server starts").setDesc("Will display a notification if the server is enabled, at Obsidian startup.").addToggle(n=>n.setValue(t.httpApiNotice).onChange(async i=>{t.httpApiNotice=i,await ke(e)})))}var Ns,wv=v(()=>{Ns=require("obsidian");mr();mr()});var L3,Of,Dm=v(()=>{L3=typeof global=="object"&&global&&global.Object===Object&&global,Of=L3});var P3,M3,Yt,ni=v(()=>{Dm();P3=typeof self=="object"&&self&&self.Object===Object&&self,M3=Of||P3||Function("return this")(),Yt=M3});var F3,Ur,So=v(()=>{ni();F3=Yt.Symbol,Ur=F3});function H3(e){var t=B3.call(e,Ec),r=e[Ec];try{e[Ec]=void 0;var n=!0}catch{}var i=$3.call(e);return n&&(t?e[Ec]=r:delete e[Ec]),i}var Sv,B3,$3,Ec,Cv,Iv=v(()=>{So();Sv=Object.prototype,B3=Sv.hasOwnProperty,$3=Sv.toString,Ec=Ur?Ur.toStringTag:void 0;Cv=H3});function q3(e){return V3.call(e)}var U3,V3,Nv,Ov=v(()=>{U3=Object.prototype,V3=U3.toString;Nv=q3});function K3(e){return e==null?e===void 0?Y3:z3:Dv&&Dv in Object(e)?Cv(e):Nv(e)}var z3,Y3,Dv,ii,Co=v(()=>{So();Iv();Ov();z3="[object Null]",Y3="[object Undefined]",Dv=Ur?Ur.toStringTag:void 0;ii=K3});function j3(e){return e!=null&&typeof e=="object"}var ai,Io=v(()=>{ai=j3});function G3(e){return typeof e=="symbol"||ai(e)&&ii(e)==W3}var W3,si,No=v(()=>{Co();Io();W3="[object Symbol]";si=G3});function Q3(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var Oo,km=v(()=>{Oo=Q3});var X3,Ft,oi=v(()=>{X3=Array.isArray,Ft=X3});function Lv(e){if(typeof e=="string")return e;if(Ft(e))return Oo(e,Lv)+"";if(si(e))return Rv?Rv.call(e):"";var t=e+"";return t=="0"&&1/e==-Z3?"-0":t}var Z3,kv,Rv,Pv,Mv=v(()=>{So();km();oi();No();Z3=1/0,kv=Ur?Ur.prototype:void 0,Rv=kv?kv.toString:void 0;Pv=Lv});function eN(e){for(var t=e.length;t--&&J3.test(e.charAt(t)););return t}var J3,Fv,Bv=v(()=>{J3=/\s/;Fv=eN});function rN(e){return e&&e.slice(0,Fv(e)+1).replace(tN,"")}var tN,$v,Hv=v(()=>{Bv();tN=/^\s+/;$v=rN});function nN(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Tn,Os=v(()=>{Tn=nN});function uN(e){if(typeof e=="number")return e;if(si(e))return Uv;if(Tn(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Tn(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=$v(e);var r=aN.test(e);return r||sN.test(e)?oN(e.slice(2),r?2:8):iN.test(e)?Uv:+e}var Uv,iN,aN,sN,oN,Rm,Vv=v(()=>{Hv();Os();No();Uv=0/0,iN=/^[-+]0x[0-9a-f]+$/i,aN=/^0b[01]+$/i,sN=/^0o[0-7]+$/i,oN=parseInt;Rm=uN});function cN(e){return e}var Ia,vc=v(()=>{Ia=cN});function pN(e){if(!Tn(e))return!1;var t=ii(e);return t==fN||t==dN||t==lN||t==hN}var lN,fN,dN,hN,Df,Lm=v(()=>{Co();Os();lN="[object AsyncFunction]",fN="[object Function]",dN="[object GeneratorFunction]",hN="[object Proxy]";Df=pN});var mN,kf,qv=v(()=>{ni();mN=Yt["__core-js_shared__"],kf=mN});function gN(e){return!!zv&&zv in e}var zv,Yv,Kv=v(()=>{qv();zv=function(){var e=/[^.]+$/.exec(kf&&kf.keys&&kf.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();Yv=gN});function EN(e){if(e!=null){try{return bN.call(e)}catch{}try{return e+""}catch{}}return""}var _N,bN,Xi,Pm=v(()=>{_N=Function.prototype,bN=_N.toString;Xi=EN});function CN(e){if(!Tn(e)||Yv(e))return!1;var t=Df(e)?SN:TN;return t.test(Xi(e))}var vN,TN,xN,yN,AN,wN,SN,jv,Wv=v(()=>{Lm();Kv();Os();Pm();vN=/[\\^$.*+?()[\]{}|]/g,TN=/^\[object .+?Constructor\]$/,xN=Function.prototype,yN=Object.prototype,AN=xN.toString,wN=yN.hasOwnProperty,SN=RegExp("^"+AN.call(wN).replace(vN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");jv=CN});function IN(e,t){return e?.[t]}var Gv,Qv=v(()=>{Gv=IN});function NN(e,t){var r=Gv(e,t);return jv(r)?r:void 0}var rn,Na=v(()=>{Wv();Qv();rn=NN});var ON,Rf,Xv=v(()=>{Na();ni();ON=rn(Yt,"WeakMap"),Rf=ON});function DN(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Zv,Jv=v(()=>{Zv=DN});function PN(e){var t=0,r=0;return function(){var n=LN(),i=RN-(n-r);if(r=n,i>0){if(++t>=kN)return arg
Line truncated
|
||||||
|
${n?`\u{1F44D} You have installed <a href="https://github.com/scambier/obsidian-text-extractor">Text Extractor</a>, Omnisearch can use it to index PDFs and images contents.
|
||||||
|
<br />Text extraction only works on desktop, but the cache can be synchronized with your mobile device.`:'\u26A0\uFE0F Omnisearch requires <a href="https://github.com/scambier/obsidian-text-extractor">Text Extractor</a> to index PDFs and images.'}
|
||||||
|
${i?'<br/>\u{1F44D} You have installed <a href="https://github.com/Swaggeroo/obsidian-ai-image-analyzer">AI Image Analyzer</a>, Omnisearch can use it to index images contents with ai.':'<br/>\u26A0\uFE0F Omnisearch requires <a href="https://github.com/Swaggeroo/obsidian-ai-image-analyzer">AI Image Analyzer</a> to index images with ai.'}`)),new Ji.Setting(r).setName(`PDFs content indexing ${n?"":"\u26A0\uFE0F Disabled"}`).setDesc(ar("Omnisearch will use Text Extractor to index the content of your PDFs.")).addToggle(p=>p.setValue(t.PDFIndexing).onChange(async g=>{await a.clearCache(),t.PDFIndexing=g,await ke(e)})).setDisabled(!n),new Ji.Setting(r).setName(`Images OCR indexing ${n?"":"\u26A0\uFE0F Disabled"}`).setDesc(ar("Omnisearch will use Text Extractor to OCR your images and index their content.")).addToggle(p=>p.setValue(t.imagesIndexing).onChange(async g=>{await a.clearCache(),t.imagesIndexing=g,await ke(e)})).setDisabled(!n);let l=new DocumentFragment;l.createSpan({},p=>{p.innerHTML='Omnisearch will use Text Extractor to index the content of your office documents (currently <pre style="display:inline">.docx</pre> and <pre style="display:inline">.xlsx</pre>).'}),new Ji.Setting(r).setName(`Documents content indexing ${n?"":"\u26A0\uFE0F Disabled"}`).setDesc(l).addToggle(p=>p.setValue(t.officeIndexing).onChange(async g=>{await a.clearCache(),t.officeIndexing=g,await ke(e)})).setDisabled(!n);let d=new DocumentFragment;d.createSpan({},p=>{p.innerHTML=`Omnisearch will use AI Image Analyzer to index the content of your images with ai.<br/>
|
||||||
|
\u26A0\uFE0F <span style="color: var(--text-accent)">If both AI Image Analyzer and Text Extractor are enabled, Text Extractor will only be used as a fallback.</span>`}),new Ji.Setting(r).setName(`Images AI indexing ${i?"":"\u26A0\uFE0F Disabled"}`).setDesc(d).addToggle(p=>p.setValue(t.aiImageIndexing).onChange(async g=>{await a.clearCache(),t.aiImageIndexing=g,await ke(e)})).setDisabled(!i),new Ji.Setting(r).setName("Index paths of unsupported files").setDesc(ar(`
|
||||||
|
Omnisearch can index file<strong>names</strong> of "unsupported" files, such as e.g. <pre style="display:inline">.mp4</pre>
|
||||||
|
or non-extracted PDFs & images.<br/>
|
||||||
|
"Obsidian setting" will respect the value of "Files & Links > Detect all file extensions".`)).addDropdown(p=>{p.addOptions({yes:"Yes",no:"No",default:"Obsidian setting"}).setValue(t.unsupportedFilesIndexing).onChange(async g=>{await u(),t.unsupportedFilesIndexing=g,await ke(e)})}),new Ji.Setting(r).setName("Set frontmatter property key as title").setDesc(ar(`If you have a custom property in your notes that you want to use as the title in search results. If you set this to '#heading', then use the first heading from a file as the title.<br>
|
||||||
|
Leave empty to disable.`)).addText(p=>{p.setValue(t.displayTitle).onChange(async g=>{await u(),t.displayTitle=g,await ke(e)})}),new Ji.Setting(r).setName("Additional TEXT files to index").setDesc(ar(`In addition to standard <code>md</code> files, Omnisearch can also index other <strong style="color: var(--text-accent)">PLAINTEXT</strong> files.<br/>
|
||||||
|
Add extensions separated by a space, without the dot. Example: "<code>txt org csv</code>".<br />
|
||||||
|
\u26A0\uFE0F <span style="color: var(--text-accent)">Using extensions of non-plaintext files (like .pptx) WILL cause crashes,
|
||||||
|
because Omnisearch will try to index their content.</span>`)).addText(p=>{p.setValue(t.indexedFileTypes.join(" ")).setPlaceholder("Example: txt org csv").onChange(async g=>{await a.clearCache(),t.indexedFileTypes=g.split(" "),await ke(e)})})}var Ji,Cy=v(()=>{Ji=require("obsidian");mr();mr();Dc()});function Iy(e,t,r){new Ma.Setting(r).setName("User Interface").setHeading(),new Ma.Setting(r).setName("Show ribbon button").setDesc("Add a button on the sidebar to open the Vault search modal.").addToggle(n=>n.setValue(t.ribbonIcon).onChange(async i=>{t.ribbonIcon=i,await ke(e),i?e.addRibbonButton():e.removeRibbonButton()})),new Ma.Setting(r).setName("Show excerpts").setDesc("Shows the contextual part of the note that matches the search. Disable this to only show filenames in results.").addToggle(n=>n.setValue(t.showExcerpt).onChange(async i=>{Fa.set(i)})),new Ma.Setting(r).setName("Show embed references").setDesc(ar(`Some results are <a href="https://help.obsidian.md/Linking+notes+and+files/Embed+files">embedded</a> in other notes.<br>
|
||||||
|
This setting controls the maximum number of embeds to show in the search results. Set to 0 to disable.<br>
|
||||||
|
Also works with Text Extractor for embedded images and documents.`)).addSlider(n=>{n.setLimits(0,10,1).setValue(t.maxEmbeds).setDynamicTooltip().onChange(async i=>{t.maxEmbeds=i,await ke(e)})}),new Ma.Setting(r).setName("Render line return in excerpts").setDesc("Activate this option to render line returns in result excerpts.").addToggle(n=>n.setValue(t.renderLineReturnInExcerpts).onChange(async i=>{t.renderLineReturnInExcerpts=i,await ke(e)})),new Ma.Setting(r).setName('Show "Create note" button').setDesc(ar(`Shows a button next to the search input, to create a note.
|
||||||
|
Acts the same as the <code>shift \u21B5</code> shortcut, can be useful for mobile device users.`)).addToggle(n=>n.setValue(t.showCreateButton).onChange(async i=>{t.showCreateButton=i,await ke(e)})),new Ma.Setting(r).setName("Highlight matching words in results").setDesc("Will highlight matching results when enabled. See README for more customization options.").addToggle(n=>n.setValue(t.highlight).onChange(async i=>{t.highlight=i,await ke(e)}))}var Ma,Ny=v(()=>{Ma=require("obsidian");wo();mr();mr()});function Dy(e,t,r,n){function i(u,l){u.setLimits(1,10,.5).setValue(t[l]).setDynamicTooltip().onChange(async d=>{t[l]=d,await ke(e)})}let a=kc(e.app);new Fn.Setting(r).setName("Results weighting").setHeading(),new Fn.Setting(r).setName(`File name & declared aliases (default: ${a.weightBasename})`).addSlider(u=>i(u,"weightBasename")),new Fn.Setting(r).setName(`File directory (default: ${a.weightDirectory})`).addSlider(u=>i(u,"weightDirectory")),new Fn.Setting(r).setName(`Headings level 1 (default: ${a.weightH1})`).addSlider(u=>i(u,"weightH1")),new Fn.Setting(r).setName(`Headings level 2 (default: ${a.weightH2})`).addSlider(u=>i(u,"weightH2")),new Fn.Setting(r).setName(`Headings level 3 (default: ${a.weightH3})`).addSlider(u=>i(u,"weightH3")),new Fn.Setting(r).setName(`Tags (default: ${a.weightUnmarkedTags})`).addSlider(u=>i(u,"weightUnmarkedTags")),new Fn.Setting(r).setName("Header properties fields").setDesc('You can set custom weights for values of header properties (e.g. "keywords"). Weights under 1.0 will downrank the results.');for(let u=0;u<t.weightCustomProperties.length;u++){let l=t.weightCustomProperties[u],d=new Fn.Setting(r).setName((u+1).toString()+".");d.settingEl.style.paddingLeft="2em",d.addText(p=>{p.setPlaceholder("Property name").setValue(l.name).onChange(async g=>{l.name=g,await ke(e)})}).addSlider(p=>{p.setLimits(.1,5,.1).setValue(l.weight).setDynamicTooltip().onChange(async g=>{l.weight=g,await ke(e)})}).addButton(p=>{p.setButtonText("Remove"),p.onClick(async()=>{t.weightCustomProperties.splice(u,1),await ke(e),n()})})}new Fn.Setting(r).addButton(u=>{u.setButtonText("Add a new property"),u.onClick(l=>{t.weightCustomProperties.push({name:"",weight:1}),n()})}),new Fn.Setting(r).setName("Recency boost (experimental)").setDesc("Files that have been modified more recently than [selected cutoff] are given a higher rank.").addDropdown(u=>u.addOptions({["0"]:"Disabled",["1"]:"24 hours",["2"]:"7 days",["3"]:"30 days"}).setValue(t.recencyBoost).onChange(async l=>{t.recencyBoost=l,await ke(e)}))}var Fn,ky=v(()=>{Fn=require("obsidian");wo();mr();en()});function kc(e){return{useCache:!0,hideExcluded:!1,recencyBoost:"0",downrankedFoldersFilters:[],ignoreDiacritics:!0,ignoreArabicDiacritics:!1,indexedFileTypes:[],displayTitle:"",PDFIndexing:!1,officeIndexing:!1,imagesIndexing:!1,aiImageIndexing:!1,unsupportedFilesIndexing:"default",splitCamelCase:!1,openInNewPane:!1,vimLikeNavigationShortcut:e.vault.getConfig("vimMode"),ribbonIcon:!0,showExcerpt:!0,maxEmbeds:5,renderLineReturnInExcerpts:!0,showCreateButton:!1,highlight:!0,showPreviousQueryResults:!0,simpleSearch:!1,tokenizeUrls:!1,fuzziness:"1",weightBasename:10,weightDirectory:7,weightH1:6,weightH2:5,weightH3:4,weightUnmarkedTags:2,weightCustomProperties:[],httpApiEnabled:!1,httpApiPort:"51361",httpApiNotice:!0,welcomeMessage:"",verboseLogging:!1,DANGER_httpHost:null,DANGER_forceSaveCache:!1}}async function Ry(e){return Or=Object.assign({},kc(e.app),await e.loadData()),Fa.set(Or.showExcerpt),Sm(Or.verboseLogging),Or}var Rc,Fa,id,Or,wo=v(()=>{Rc=require("obsidian");Em();en();Nr();Tv();yv();wv();Cy();Ny();ky();mr();Fa=yo(!1),id=class extends Rc.PluginSettingTab{constructor(r){super(r.app,r);this.plugin=r,Fa.subscribe(async n=>{Or.showExcerpt=n,await ke(this.plugin)})}display(){let{containerEl:r}=this;if(r.empty(),this.app.loadLocalStorage(Ss)=="1"){let i=r.createEl("span");i.innerHTML='<strong style="color: var(--text-accent)">\u26A0\uFE0F OMNISEARCH IS DISABLED \u26A0\uFE0F</strong>'}r.createEl("h1",{text:"Omnisearch"});let n=r.createDiv();n.innerHTML=`
|
||||||
|
<iframe sandbox="allow-top-navigation-by-user-activation" src="https://github.com/sponsors/scambier/button" title="Sponsor scambier" height="35" width="116" style="border: 0;"></iframe>
|
||||||
|
<a href='https://ko-fi.com/B0B6LQ2C' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi2.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
|
||||||
|
`,Sy(this.plugin,Or,r),r.createEl("hr"),vv(this.plugin,Or,r),r.createEl("hr"),Iy(this.plugin,Or,r),r.createEl("hr"),Dy(this.plugin,Or,r,()=>{this.display()}),r.createEl("hr"),Av(this.plugin,Or,r),r.createEl("hr"),xv(this.plugin,Or,r),r.createEl("hr"),new Rc.Setting(r).setName("Debugging").setHeading(),new Rc.Setting(r).setName("Enable verbose logging").setDesc('Adds a LOT of logs for debugging purposes. You also need to enable "Verbose" logging in the console to see these logs.').addToggle(i=>i.setValue(Or.verboseLogging).onChange(async a=>{Or.verboseLogging=a,Sm(a),await ke(this.plugin)}))}}});function a0(e){var t=b6();we(e,t)}var b6,Ly=v(()=>{Wn();Ai();Pn();b6=Le('<span class="suggestion-flair" aria-label="Not created yet, select to create"><svg viewBox="0 0 100 100" class="add-note-glyph" width="16" height="16"><path fill="currentColor" stroke="currentColor" d="M23.3,6.7c-3.7,0-6.7,3-6.7,6.7v73.3c0,3.7,3,6.7,6.7,6.7h28.4c-3.2-4.8-5.1-10.5-5.1-16.7c0-16.6,13.4-30,30-30 c2.3,0,4.5,0.3,6.7,0.8V31.7c0-0.9-0.3-1.7-1-2.4L60.7,7.6c-0.6-0.6-1.5-1-2.4-1L23.3,6.7z M56.7,13L77,33.3H60 c-1.8,0-3.3-1.5-3.3-3.3L56.7,13z M76.7,53.3c-12.9,0-23.3,10.4-23.3,23.3S63.8,100,76.7,100S100,89.6,100,76.7 S89.6,53.3,76.7,53.3z M76.7,63.3c1.8,0,3.3,1.5,3.3,3.3v6.7h6.7c1.8,0,3.3,1.5,3.3,3.3c0,1.8-1.5,3.3-3.3,3.3H80v6.7 c0,1.8-1.5,3.3-3.3,3.3c-1.8,0-3.3-1.5-3.3-3.3V80h-6.7c-1.8,0-3.3-1.5-3.3-3.3s1.5-3.3,3.3-3.3h6.7v-6.7 C73.3,64.8,74.8,63.3,76.7,63.3L76.7,63.3z"></path></svg></span>')});function Lc(e,t){let r=ze(t,"id",8),n=ze(t,"selected",8,!1),i=ze(t,"glyph",8,!1),a=ze(t,"cssClass",8,"");var u=E6();let l;var d=xe(u);{var p=E=>{a0(E,{})};tt(d,E=>{i()&&E(p)})}var g=Ye(d,2);Yi(g,t,"default",{},null),Te(u),rr(E=>{ji(u,"data-result-id",r()),l=Ki(u,1,`suggestion-item omnisearch-result ${a()??""}`,null,l,E)},[()=>({"is-selected":n()})],Br),pr("mousemove",u,function(E){Jr.call(this,t,E)}),pr("click",u,function(E){Jr.call(this,t,E)}),pr("keypress",u,function(E){Jr.call(this,t,E)}),pr("auxclick",u,function(E){Jr.call(this,t,E)}),we(e,u)}var E6,s0=v(()=>{Wn();Ai();Pn();Ly();E6=Le("<div><!> <!></div>")});function sd(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}var Py,ad,o0=v(()=>{en();Nr();Py=require("obsidian");Dc();ad=class{constructor(t){this.plugin=t}highlightText(t,r){let n=`suggestion-highlight omnisearch-highlight ${this.plugin.settings.highlight?"omnisearch-default-highlight":""}`;if(!r.length)return t;try{return t.replace(new RegExp(`(${r.map(i=>Oc(i.match)).join("|")})`,"giu"),`<span class="${n}">$1</span>`)}catch(i){return console.error("Omnisearch - Error in highlightText()",i),t}}stringsToRegex(t){if(!t.length)return/^$/g;t.sort((n,i)=>i.length-n.length);let r=`(${t.map(n=>`\\b${Oc(n)}\\b|${Oc(n)}`).join("|")})`;return new RegExp(`${r}`,"gui")}getMatches(t,r,n){r=r.map(sd);let i=this.stringsToRegex(r),a=t;this.plugin.settings.ignoreDiacritics&&(t=Gi(t,this.plugin.settings.ignoreArabicDiacritics));let u=new Date().getTime(),l=null,d=[],p=0;for(;(l=i.exec(t))!==null;){if(++p>=100||new Date().getTime()-u>50){ri("Stopped getMatches at",p,"results");break}let g=l.index,E=g+l[0].length,_=a.substring(g,E).trim();_&&l.index>=0&&d.push({match:_,offset:l.index})}if(n&&(n.query.text.length>1||n.getExactTerms().length>0)){let g=t.indexOf(n.getBestStringForExcerpt());g>-1&&d.find(E=>E.offset===g)&&d.unshift({offset:g,match:n.getBestStringForExcerpt()})}return d}makeExcerpt(t,r){let n=this.plugin.settings;try{let i=r??-1,a=Math.max(0,i-av),u=Math.min(t.length,i+cc);if(i>-1?t=(a>0?"\u2026":"")+t.slice(a,u).trim()+(u<t.length-1?"\u2026":""):t=t.slice(0,cc),n.renderLineReturnInExcerpts){let l=new RegExp(/(?:\r\n|\r|\n)/g);t=t.split(l).filter(p=>p).join(`
|
||||||
|
`);let d=t.lastIndexOf(`
|
||||||
|
`,i-a);d>0&&(t=t.slice(d))}return t=sd(t),n.renderLineReturnInExcerpts&&(t=t.trim().replaceAll(`
|
||||||
|
`,"<br>")),t}catch(i){return new Py.Notice("Omnisearch - Error while creating excerpt, see developer console"),console.error("Omnisearch - Error while creating excerpt"),console.error(i),""}}}});async function My(e){let t=e.app;if(!t.plugins.getPlugin("obsidian-icon-folder"))return{};let n=`${t.vault.configDir}/plugins/obsidian-icon-folder/data.json`;try{let i=await t.vault.adapter.read(n),a=JSON.parse(i),u={};for(let l in a){let d=(0,qo.normalizePath)(l);u[d]=a[l]}return u}catch(i){return ri("Failed to read data.json:",i),{}}}async function Fy(e){let t={Li:"lucide-icons"},r="icons",n=e.app,i=n.plugins.getPlugin("obsidian-icon-folder");if(i){r=i.settings?.iconPacksPath||"icons";let u=`${n.vault.configDir}/${r}`;try{let l=await n.vault.adapter.list(u);if(l.folders&&l.folders.length>0)for(let d of l.folders){let p=d.split("/"),g=p[p.length-1],E=v6(g);t[E]=g}}catch(l){ri("Failed to list icon packs:",l)}}return{prefixToIconPack:t,iconsPath:r}}function v6(e){if(e.includes("-")){let t=e.split("-"),r=t[0].charAt(0).toUpperCase();for(let n=1;n<t.length;n++)r+=t[n].charAt(0).toLowerCase();return r}return e.charAt(0).toUpperCase()+e.charAt(1).toLowerCase()}function u0(e,t){let r=(0,qo.normalizePath)(e),n=t[r];if(n){if(typeof n=="string")return n;if(typeof n=="object"&&n.iconName)return n.iconName}return null}function T6(e){let t=e.match(/^[A-Z][a-z]*/);if(t){let r=t[0],n=e.substring(r.length);return{prefix:r,name:n}}else return{prefix:"",name:e}}async function c0(e,t,r,n){let i=T6(e),{prefix:a,name:u}=i;if(!a)return`<span class="omnisearch-result__icon--emoji">${sd(u)}</span>`;let l=n[a];if(!l)return ri(`No icon pack found for prefix: ${a}`),null;if(l==="lucide-icons"){let d=u.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),p=(0,qo.getIcon)(d);return p?p.outerHTML:(ri(`Lucide icon not found: ${d}`),null)}else{if(!r)return ri("Icons path is not set. Cannot load icon SVG."),null;let d=`${t.app.vault.configDir}/${r}/${l}/${u}.svg`;try{return await t.app.vault.adapter.read(d)}catch(p){return ri(`Failed to load icon SVG for ${e} at ${d}:`,p),null}}}function l0(e){let t="file";e==="folder"?t="folder":Mn(e)?t="image":ti(e)?t="file-text":(wi(e)||dc(e)||Cs(e))&&(t="layout-dashboard");let r=(0,qo.getIcon)(t);return r?r.outerHTML:""}var qo,By=v(()=>{qo=require("obsidian");Nr();o0()});function f0(e,t){dr(t,!1);let[r,n]=uc(),i=()=>oc(Fa,"$showExcerpt",r),a=ft(),u=ft(),l=ft(),d=ft(),p=ze(t,"selected",8,!1),g=ze(t,"note",8),E=ze(t,"plugin",8),_=ft(null),y=ft(""),C=ft(""),D={},P=ft(null),N=ft(null),L={},H,R=ft(!1);As(async()=>{D=await My(E());let qe=await Fy(E());L=qe.prefixToIconPack,H=qe.iconsPath,oe(R,!0)});async function B(){let qe=u0(q(C),D);qe?oe(P,await c0(qe,E(),H,L)):oe(P,l0("folder"));let St=u0(g().path,D);St?oe(N,await c0(St,E(),H,L)):oe(N,l0(g().path))}function V(qe,St){return qe.innerHTML=St,{update(Dt){qe.innerHTML=Dt},destroy(){qe.innerHTML=""}}}let X=null,ce=null,ve=ft(null);Qt(()=>(vt(g()),q(R),fc),()=>{g()&&g().path&&q(R)&&(async()=>(oe(y,g().displayTitle||g().basename),oe(C,fc(g().path)),await B()))()}),Qt(()=>(Mn,vt(g()),vt(E()),ui.TFile),()=>{if(oe(_,null),Mn(g().path)){let qe=E().app.vault.getAbstractFileByPath(g().path);qe instanceof ui.TFile&&oe(_,E().app.vault.getResourcePath(qe))}}),Qt(()=>(vt(g()),fc,ui.setIcon,Mn,ti,wi,dc,Cs,q(ve)),()=>{oe(y,g().displayTitle||g().basename),oe(C,fc(g().path)),X&&(0,ui.setIcon)(X,"folder-open"),ce&&(Mn(g().path)?(0,ui.setIcon)(ce,"image"):ti(g().path)?(0,ui.setIcon)(ce,"file-text"):wi(g().path)||dc(g().path)||Cs(g().path)?(0,ui.setIcon)(ce,"layout-dashboard"):(0,ui.setIcon)(ce,"file")),q(ve)&&(0,ui.setIcon)(q(ve),"corner-down-right")}),Qt(()=>(vt(E()),q(y),vt(g())),()=>{oe(a,E().textProcessor.getMatches(q(y),g().foundWords))}),Qt(()=>(vt(E()),q(C),vt(g())),()=>{oe(u,E().textProcessor.getMatches(q(C),g().foundWords))}),Qt(()=>(vt(E()),vt(g())),()=>{oe(l,E().textProcessor.makeExcerpt(g().content,g().matches[0]?.offset??-1))}),Qt(()=>{},()=>{oe(d,!1)}),Jn(),En();let Re=Br(()=>g().isEmbed?"omnisearch-result__embed":"");Lc(e,{get glyph(){return q(d)},get id(){return g().path},get cssClass(){return` ${q(Re)??""}`},get selected(){return p()},$$events:{auxclick(qe){Jr.call(this,t,qe)},click(qe){Jr.call(this,t,qe)},mousemove(qe){Jr.call(this,t,qe)}},children:(qe,St)=>{var Dt=D6(),Se=xe(Dt),et=xe(Se),je=xe(et);{var lt=rt=>{var ct=x6();ys(ct,Xt=>oe(ve,Xt),()=>q(ve)),we(rt,ct)},F=rt=>{var ct=zi(),Xt=Sr(ct);{var Er=Pr=>{var zr=y6();wa(zr,(Ct,$t)=>V?.(Ct,$t),()=>q(N)),we(Pr,zr)};tt(Xt,Pr=>{q(N)&&Pr(Er)})}we(rt,ct)};tt(je,rt=>{g().isEmbed?rt(lt):rt(F,!1)})}var K=Ye(je,2),te=xe(K);Ts(te,()=>E().textProcessor.highlightText(q(y),q(a)),!1,!1),Te(K);var fe=Ye(K,2);{var Fe=rt=>{var ct=A6(),Xt=xe(ct);Te(ct),rr(Er=>ir(Xt,`.${Er??""}`),[()=>Is(g().path)],Br),we(rt,ct)};tt(fe,rt=>{g().displayTitle||rt(Fe)})}var Je=Ye(fe,2);{var Ue=rt=>{var ct=w6(),Xt=xe(ct);Te(ct),rr(()=>ir(Xt,`${g().matches.length??""}\xA0${(g().matches.length>1?"matches":"match")??""}`)),we(rt,ct)};tt(Je,rt=>{g().matches.lengthLine truncated
|
||||||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Je=!0,Ue=!1,ot;return{s:function(){te=te.call(F)},n:function(){var _t=te.next();return Je=_t.done,_t},e:function(_t){Ue=!0,ot=_t},f:function(){try{!Je&&te.return!=null&&te.return()}finally{if(Ue)throw ot}}}}function p(F,K){if(F){if(typeof F=="string")return g(F,K);var te=Object.prototype.toString.call(F).slice(8,-1);if(te==="Object"&&F.constructor&&(te=F.constructor.name),te==="Map"||te==="Set")return Array.from(F);if(te==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(te))return g(F,K)}}function g(F,K){(K==null||K>F.length)&&(K=F.length);for(var te=0,fe=new Array(K);te<K;te++)fe[te]=F[te];return fe}function E(F,K){if(!(F instanceof K))throw new TypeError("Cannot call a class as a function")}function _(F,K){for(var te=0;te<K.length;te++){var fe=K[te];fe.enumerable=fe.enumerable||!1,fe.configurable=!0,"value"in fe&&(fe.writable=!0),Object.defineProperty(F,fe.key,fe)}}function y(F,K,te){return K&&_(F.prototype,K),te&&_(F,te),Object.defineProperty(F,"prototype",{writable:!1}),F}function C(F,K,te){return K in F?Object.defineProperty(F,K,{value:te,enumerable:!0,configurable:!0,writable:!0}):F[K]=te,F}function D(F,K,te){P(F,K),K.set(F,te)}function P(F,K){if(K.has(F))throw new TypeError("Cannot initialize the same private elements twice on an object")}function N(F,K){var te=R(F,K,"get");return L(F,te)}function L(F,K){return K.get?K.get.call(F):K.value}function H(F,K,te){var fe=R(F,K,"set");return B(F,fe,te),te}function R(F,K,te){if(!K.has(F))throw new TypeError("attempted to "+te+" private field on non-instance");return K.get(F)}function B(F,K,te){if(K.set)K.set.call(F,te);else{if(!K.writable)throw new TypeError("attempted to set read only private field");K.value=te}}var V=typeof Symbol<"u"?Symbol.toStringTag:"@@toStringTag",X=new WeakMap,ce=new WeakMap,ve=function(){function F(K){var te=K.executor,fe=te===void 0?function(){}:te,Fe=K.internals,Je=Fe===void 0?lt():Fe,Ue=K.promise,ot=Ue===void 0?new Promise(function(ut,_t){return fe(ut,_t,function(qr){Je.onCancelList.push(qr)})}):Ue;E(this,F),D(this,X,{writable:!0,value:void 0}),D(this,ce,{writable:!0,value:void 0}),C(this,V,"CancelablePromise"),this.cancel=this.cancel.bind(this),H(this,X,Je),H(this,ce,ot||new Promise(function(ut,_t){return fe(ut,_t,function(qr){Je.onCancelList.push(qr)})}))}return y(F,[{key:"then",value:function(te,fe){return et(N(this,ce).then(Se(te,N(this,X)),Se(fe,N(this,X))),N(this,X))}},{key:"catch",value:function(te){return et(N(this,ce).catch(Se(te,N(this,X))),N(this,X))}},{key:"finally",value:function(te,fe){var Fe=this;return fe&&N(this,X).onCancelList.push(te),et(N(this,ce).finally(Se(function(){if(te)return fe&&(N(Fe,X).onCancelList=N(Fe,X).onCancelList.filter(function(Je){return Je!==te})),te()},N(this,X))),N(this,X))}},{key:"cancel",value:function(){N(this,X).isCanceled=!0;var te=N(this,X).onCancelList;N(this,X).onCancelList=[];var fe=d(te),Fe;try{for(fe.s();!(Fe=fe.n()).done;){var Je=Fe.value;if(typeof Je=="function")try{Je()}catch(Ue){console.error(Ue)}}}catch(Ue){fe.e(Ue)}finally{fe.f()}}},{key:"isCanceled",value:function(){return N(this,X).isCanceled===!0}}]),F}(),Re=function(F){t(te,F);var K=n(te);function te(fe){return E(this,te),K.call(this,{executor:fe})}return y(te)}(ve);e.CancelablePromise=Re,C(Re,"all",function(K){return je(K,Promise.all(K))}),C(Re,"allSettled",function(K){return je(K,Promise.allSettled(K))}),C(Re,"any",function(K){return je(K,Promise.any(K))}),C(Re,"race",function(K){return je(K,Promise.race(K))}),C(Re,"resolve",function(K){return St(Promise.resolve(K))}),C(Re,"reject",function(K){return St(Promise.reject(K))}),C(Re,"isCancelable",Dt);var qe=Re;e.default=qe;function St(F){return et(F,lt())}function Dt(F){return F instanceof Re||F instanceof ve}function Se(F,K){if(F)return function(te){if(!K.isCanceled){var fe=F(te);return Dt(fe)&&K.onCancelList.push(fe.cancel),fe}return te}}function et(F,K){return new ve({internals:K,promise:F})}function je(F,K){var te=lt();return te.onCancelList.push(function(){var fe=d(F),Fe;try{for(fe.s();!(Fe=fe.n()).done;){var Je=Fe.value;Dt(Je)&&Je.cancel()}}catch(Ue){fe.e(Ue)}finally{fe.f()}}),new ve({internals:te,promise:K})}function lt(){return{isCanceled:!1,onCancelList:[]}}})});function Yy(e,{delay:t=0,duration:r=400,easing:n=k6}={}){let i=+getComputedStyle(e).opacity;return{delay:t,duration:r,easing:n,css:a=>`opacity: ${a*i}`}}var k6,Ky=v(()=>{mt();Wr();k6=e=>e});function ld(e,t){dr(t,!1);let r=ze(t,"placeholder",8,null),n=ze(t,"placeholderProps",8,null),i="svelte-lazy-placeholder";En();var a=zi(),u=Sr(a);{var l=d=>{var p=L6();Ki(p,1,xs(i));var g=xe(p);{var E=y=>{var C=R6(),D=xe(C,!0);Te(C),rr(()=>ir(D,r())),we(y,C)},_=(y,C)=>{{var D=P=>{var N=zi(),L=Sr(N);Qp(L,r,(H,R)=>{R(H,gm(n))}),we(P,N)};tt(y,P=>{["function","object"].includes(typeof r())&&P(D)},C)}};tt(g,y=>{typeof r()=="string"?y(E):y(_,!1)})}Te(p),we(d,p)};tt(u,d=>{r()&&d(l)})}we(e,a),hr()}var R6,L6,jy=v(()=>{Wn();Ai()
Line truncated
|
||||||
|
characters.</span>`,1),q6=Le("We found 0 results for your search here. <!>",1),z6=Le('<!> <div style="text-align: center;"><!></div>',1),Y6=Le('<!> <!> <!> <div class="prompt-instructions"><div class="prompt-instruction"><span class="prompt-instruction-command">\u2191\u2193</span><span>to navigate</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to cycle history</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to open</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command">Tab</span> <span>to switch to In-File Search</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to open in a new pane</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"></span> <span>to open in a new split</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to open in the background</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to create</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to create in a new pane</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to insert a link</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to toggle excerpts</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command">Esc</span><span>to close</span></div></div>',1)});function g0(e,t){dr(t,!1);let r=ft(),n=ze(t,"plugin",8),i=ze(t,"offset",8),a=ze(t,"note",8),u=ze(t,"index",8,0),l=ze(t,"selected",8,!1);Qt(()=>(vt(n()),vt(a()),vt(i())),()=>{oe(r,n().textProcessor.makeExcerpt(a()?.content??"",i()))}),Jn(),En();let d=Br(()=>u().toString());Lc(e,{get id(){return q(d)},get selected(){return l()},$$events:{auxclick(p){Jr.call(this,t,p)},click(p){Jr.call(this,t,p)},mousemove(p){Jr.call(this,t,p)}},children:(p,g)=>{var E=K6(),_=xe(E);Ts(_,()=>n().textProcessor.highlightText(q(r),a().matches),!1,!1),Te(E),we(p,E)},$$slots:{default:!0}}),hr()}var K6,Zy=v(()=>{Wn();Ai();Pn();s0();K6=Le('<div class="omnisearch-result__body"><!></div>')});function _0(e,t){dr(t,!1);let r=ze(t,"plugin",8),n=ze(t,"modal",8),i=ze(t,"parent",8,null),a=ze(t,"singleFilePath",8,""),u=ze(t,"previousQuery",8),l=ft(),d=ft([]),p=ft(0),g=ft(),E=ft();As(()=>{Me.enable("infile"),Me.on("infile","enter",N),Me.on("infile","open-in-new-pane",P),Me.on("infile","arrow-up",()=>C(-1)),Me.on("infile","arrow-down",()=>C(1)),Me.on("infile","tab",L)}),gf(()=>{Me.disable("infile")});function _(Se){let et=[],je=-1,lt=0;for(;++lt<100;){let F=y(Se,je,cc);if(!F.length)break;je=F.last().offset,et.push(F)}return et}function y(Se,et,je){let lt=Se.find(F=>F.offset>et);return lt?Se.filter(F=>F.offset>et&&F.offset<=lt.offset+je):[]}function C(Se){oe(p,Sf(q(p)+Se,q(d).length)),D()}async function D(){await vi(),document.querySelector(`[data-result-id="${q(p)}"]`)?.scrollIntoView({behavior:"auto",block:"nearest"})}async function P(){return N(!0)}async function N(Se=!1){if(q(g)){n().close(),i()&&i().close();let et=r().textProcessor.stringsToRegex(q(g).foundWords);et.exec(q(g).content),await If(r().app,q(g),et.lastIndex,Se);let je=r().app.workspace.getActiveViewOfType(fd.MarkdownView);if(!je)return;let lt=q(d)[q(p)]??0,F=je.editor.offsetToPos(lt);F.ch=0,je.editor.setCursor(F),je.editor.scrollIntoView({from:{line:F.line-10,ch:0},to:{line:F.line+10,ch:0}})}}function L(){new ta(r(),q(l)??u()).open(),n().close()}Qt(()=>vt(u()),()=>{oe(l,u()??"")}),Qt(()=>(q(l),q(E),ea,vt(r()),vt(a())),()=>{(async()=>(q(l)&&(oe(E,new ea(q(l),{ignoreDiacritics:r().settings.ignoreDiacritics,ignoreArabicDiacritics:r().settings.ignoreArabicDiacritics})),oe(g,(await r().searchEngine.getSuggestions(q(E),{singleFilePath:a()}))[0]??null)),oe(p,0),await D()))()}),Qt(()=>(q(g),q(E)),()=>{if(q(g)){let Se=_(q(g).matches),et=q(E).getExactTerms();et.length&&(Se=Se.filter(je=>et.every(lt=>je.some(F=>F.match.includes(lt))))),oe(d,Se.map(je=>Math.round(je.first().offset)))}}),Jn(),En();var H=Z6(),R=Sr(H);gc(R,{get plugin(){return r()},placeholder:"Omnisearch - File",get initialValue(){return u()},$$events:{input:Se=>oe(l,Se.detail)},children:(Se,et)=>{var je=W6(),lt=xe(je);{var F=K=>{var te=j6();pr("click",te,L),we(K,te)};tt(lt,K=>{fd.Platform.isMobile&&K(F)})}Te(je),we(Se,je)},$$slots:{default:!0}});var B=Ye(R,2);_c(B,{children:(Se,et)=>{var je=zi(),lt=Sr(je);{var F=te=>{var fe=zi(),Fe=Sr(fe);nc(Fe,1,()=>q(d),rc,(Je,Ue,ot)=>{let ut=Br(()=>ot===q(p));g0(Je,{get plugin(){return r()},get offset(){return q(Ue)},get note(){return q(g)},index:ot,get selected(){return q(ut)},$$events:{mousemove:_t=>oe(p,ot),click:_t=>N(_t.ctrlKey),auxclick:_t=>{_t.button==1&&N(!0)}}})}),we(te,fe)},K=te=>{var fe=G6();we(te,fe)};tt(lt,te=>{q(d).length&&q(g)?te(F):te(K,!1)})}we(Se,je)},$$Line truncated
|
||||||
|
`)}function zr(s,o,f,h){this.failures=o,this.failedKeys=h,this.successCount=f,this.message=Pr(s,o)}C(zr).from(Er);function Ct(s,o){this.name="BulkError",this.failures=Object.keys(o).map(function(f){return o[f]}),this.failuresByPos=o,this.message=Pr(s,this.failures)}C(Ct).from(Er);var $t=ct.reduce(function(s,o){return s[o]=o+"Error",s},{}),ki=Er,me=ct.reduce(function(s,o){var f=o+"Error";function h(m,b){this.name=f,m?typeof m=="string"?(this.message="".concat(m).concat(b?`
|
||||||
|
`+b:""),this.inner=b||null):typeof m=="object"&&(this.message="".concat(m.name," ").concat(m.message),this.inner=m):(this.message=Xt[o]||f,this.inner=null)}return C(h).from(ki),s[o]=h,s},{});me.Syntax=SyntaxError,me.Type=TypeError,me.Range=RangeError;var _u=rt.reduce(function(s,o){return s[o+"Error"]=me[o],s},{});function Nh(s,o){if(!s||s instanceof Er||s instanceof TypeError||s instanceof SyntaxError||!s.name||!_u[s.name])return s;var f=new _u[s.name](o||s.message,s);return"stack"in s&&y(f,"stack",{get:function(){return this.inner.stack}}),f}var ca=ct.reduce(function(s,o){return["Syntax","Type","Range"].indexOf(o)===-1&&(s[o+"Error"]=me[o]),s},{});ca.ModifyError=zr,ca.DexieError=Er,ca.BulkError=Ct;function nt(){}function Qa(s){return s}function bu(s,o){return s==null||s===Qa?o:function(f){return o(s(f))}}function di(s,o){return function(){s.apply(this,arguments),o.apply(this,arguments)}}function Oh(s,o){return s===nt?o:function(){var f=s.apply(this,arguments);f!==void 0&&(arguments[0]=f);var h=this.onsuccess,m=this.onerror;this.onsuccess=null,this.onerror=null;var b=o.apply(this,arguments);return h&&(this.onsuccess=this.onsuccess?di(h,this.onsuccess):h),m&&(this.onerror=this.onerror?di(m,this.onerror):m),b!==void 0?b:f}}function Eu(s,o){return s===nt?o:function(){s.apply(this,arguments);var f=this.onsuccess,h=this.onerror;this.onsuccess=this.onerror=null,o.apply(this,arguments),f&&(this.onsuccess=this.onsuccess?di(f,this.onsuccess):f),h&&(this.onerror=this.onerror?di(h,this.onerror):h)}}function El(s,o){return s===nt?o:function(f){var h=s.apply(this,arguments);l(f,h);var m=this.onsuccess,b=this.onerror;this.onsuccess=null,this.onerror=null;var T=o.apply(this,arguments);return m&&(this.onsuccess=this.onsuccess?di(m,this.onsuccess):m),b&&(this.onerror=this.onerror?di(b,this.onerror):b),h===void 0?T===void 0?void 0:T:l(h,T)}}function Dh(s,o){return s===nt?o:function(){return o.apply(this,arguments)===!1?!1:s.apply(this,arguments)}}function js(s,o){return s===nt?o:function(){var f=s.apply(this,arguments);if(f&&typeof f.then=="function"){for(var h=this,m=arguments.length,b=new Array(m);m--;)b[m]=arguments[m];return f.then(function(){return o.apply(h,b)})}return o.apply(this,arguments)}}var on=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function vl(s,o){on=s}var Ne={},kt=100,Rt=typeof Promise>"u"?[]:function(){var s=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[s,d(s),s];var o=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[o,d(o),s]}(),ur=Rt[0],Sn=Rt[1],Ri=Rt[2],vu=Sn&&Sn.then,cr=ur&&ur.constructor,Zt=!!Ri;function la(){queueMicrotask(GS)}var Cn=function(s,o){Tu.push([s,o]),Kn&&(la(),Kn=!1)},Yn=!0,Kn=!0,un=[],Xa=[],kh=Qa,fa={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:nt,pgp:!1,env:{},finalize:nt},be=fa,Tu=[],Za=0,Tl=[];function de(s){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var o=this._PSD=be;if(typeof s!="function"){if(s!==Ne)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Lh(this,this._value);return}this._state=null,this._value=null,++o.ref,o_(this,s)}var Rh={get:function(){var s=be,o=wl;function f(h,m){var b=this,T=!s.global&&(s!==be||o!==wl),A=T&&!ha(),S=new de(function(O,$){Ph(b,new s_(l_(h,s,T,A),l_(m,s,T,A),O,$,s))});return this._consoleTask&&(S._consoleTask=this._consoleTask),S}return f.prototype=Ne,f},set:function(s){y(this,"then",s&&s.prototype===Ne?Rh:{get:function(){return s},set:Rh.set})}};E(de.prototype,{then:Rh,_then:function(s,o){Ph(this,new s_(null,null,s,o,be))},catch:function(s){if(arguments.length===1)return this.then(null,s);var o=arguments[0],f=arguments[1];return typeof o=="function"?this.then(null,function(h){return h instanceof o?f(h):xl(h)}):this.then(null,function(h){return h&&h.name===o?f(h):xl(h)})},finally:function(s){return this.then(function(o){return de.resolve(s()).then(function(){return o})},function(o){return de.resolve(s()).then(function(){return xl(o)})})},timeout:function(s,o){var f=this;return s<1/0?new de(function(h,m){var b=setTimeout(function(){return m(new me.Timeout(o))},s);f.then(h,m).finally(clearTimeout.bind(null,b))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&y(de.prototype,Symbol.toStringTag,"Dexie.Promise"),fa.env=c_();function s_(s,o,f,h,m){this.onFulfilled=typeof s=="function"?s:null,this.onRejected=typeof o=="function"?o:null,this.resolve=f,this.reject=h,this.psd=m}E(de,{all:function(){var s=ut.apply(null,arguments).map(Sl);return new de(function(o,f){s.length===0&&o([]);var h=s.length;s.forEach(function(m,b){return de.resolve(m).then(function(T){s[b]=T,--h||o(s)},f)})})},resolve:function(s){if(s instanceof de)return s;if(s&&typeof s.then=="function")return new de(function(f,h){s.then(f,h)});var o=new de(Ne,!0,s);return o},reject:xl,race:function(){var s=ut.apply(null,arguments).map(Sl);return new de(function(o,f){s.map(function(h){return de
Line truncated
|
||||||
|
`).map(i=>{let a=i.match(/^\s+/);if(a===null)return i;let[u]=a;return u.length>=n.length?i.slice(n.length):i}).join(`
|
||||||
|
`)}var Ls=class{options;rules;lexer;constructor(t){this.options=t||Tt.defaults}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let n=r[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Td(n,`
|
||||||
|
`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let n=r[0],i=bR(n,r[3]||"");return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let n=r[2].trim();if(/#$/.test(n)){let i=Td(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:r[0]}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let n=r[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
|
||||||
|
$1`);n=Td(n.replace(/^ *>[ \t]?/gm,""),`
|
||||||
|
`);let i=this.lexer.state.top;this.lexer.state.top=!0;let a=this.lexer.blockTokens(n);return this.lexer.state.top=i,{type:"blockquote",raw:r[0],tokens:a,text:n}}}list(t){let r=this.rules.block.list.exec(t);if(r){let n=r[1].trim(),i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let u=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),l="",d="",p=!1;for(;t;){let g=!1;if(!(r=u.exec(t))||this.rules.block.hr.test(t))break;l=r[0],t=t.substring(l.length);let E=r[2].split(`
|
||||||
|
`,1)[0].replace(/^\t+/,N=>" ".repeat(3*N.length)),_=t.split(`
|
||||||
|
`,1)[0],y=0;this.options.pedantic?(y=2,d=E.trimStart()):(y=r[2].search(/[^ ]/),y=y>4?1:y,d=E.slice(y),y+=r[1].length);let C=!1;if(!E&&/^ *$/.test(_)&&(l+=_+`
|
||||||
|
`,t=t.substring(_.length+1),g=!0),!g){let N=new RegExp(`^ {0,${Math.min(3,y-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),L=new RegExp(`^ {0,${Math.min(3,y-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),H=new RegExp(`^ {0,${Math.min(3,y-1)}}(?:\`\`\`|~~~)`),R=new RegExp(`^ {0,${Math.min(3,y-1)}}#`);for(;t;){let B=t.split(`
|
||||||
|
`,1)[0];if(_=B,this.options.pedantic&&(_=_.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),H.test(_)||R.test(_)||N.test(_)||L.test(t))break;if(_.search(/[^ ]/)>=y||!_.trim())d+=`
|
||||||
|
`+_.slice(y);else{if(C||E.search(/[^ ]/)>=4||H.test(E)||R.test(E)||L.test(E))break;d+=`
|
||||||
|
`+_}!C&&!_.trim()&&(C=!0),l+=B+`
|
||||||
|
`,t=t.substring(B.length+1),E=_.slice(y)}}a.loose||(p?a.loose=!0:/\n *\n *$/.test(l)&&(p=!0));let D=null,P;this.options.gfm&&(D=/^\[[ xX]\] /.exec(d),D&&(P=D[0]!=="[ ] ",d=d.replace(/^\[[ xX]\] +/,""))),a.items.push({type:"list_item",raw:l,task:!!D,checked:P,loose:!1,text:d,tokens:[]}),a.raw+=l}a.items[a.items.length-1].raw=l.trimEnd(),a.items[a.items.length-1].text=d.trimEnd(),a.raw=a.raw.trimEnd();for(let g=0;g<a.items.length;g++)if(this.lexer.state.top=!1,a.items[g].tokens=this.lexer.blockTokens(a.items[g].text,[]),!a.loose){let E=a.items[g].tokens.filter(y=>y.type==="space"),_=E.length>0&&E.some(y=>/\n.*\n/.test(y.raw));a.loose=_}if(a.loose)for(let g=0;g<a.items.length;g++)a.items[g].loose=!0;return a}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let n=r[1].toLowerCase().replace(/\s+/g," "),i=r[2]?r[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:i,title:a}}}table(t){let r=this.rules.block.table.exec(t);if(!r||!/[:|]/.test(r[2]))return;let n=vA(r[1]),i=r[2].replace(/^\||\| *$/g,"").split("|"),a=r[3]&&r[3].trim()?r[3].replace(/\n[ \t]*$/,"").split(`
|
||||||
|
`):[],u={type:"table",raw:r[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let l of i)/^ *-+: *$/.test(l)?u.align.push("right"):/^ *:-+: *$/.test(l)?u.align.push("center"):/^ *:-+ *$/.test(l)?u.align.push("left"):u.align.push(null);for(let l of n)u.header.push({text:l,tokens:this.lexer.inline(l)});for(let l of a)u.rows.push(vA(l,u.header.length).map(d=>({text:d,tokens:this.lexer.inline(d)})));return u}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let n=r[1].charAt(r[1].length-1)===`
|
||||||
|
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:xn(r[1])}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&/^<a /i.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let n=r[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;let u=Td(n.slice(0,-1),"\\");if((n.length-u.length)%2===0)return}else{let u=_R(r[2],"()");if(u>-1){let d=(r[0].indexOf("!")===0?5:4)+r[1].length+u;r[2]=r[2].substring(0,u),r[0]=r[0].substring(0,d).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let u=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);u&&(i=u[1],a=u[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(n)?i=i.slice(1):i=i.slice(1,-1)),TA(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer)}}reflink(t,r){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let i=(n[2]||n[1]).replace(/\s+/g," "),a=r[i.toLowerCase()];if(!a){let u=n[0].charAt(0);return{type:"text",raw:u,text:u}}return TA(n,a,n[0],this.lexer)}}emStrong(t,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!i||i[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let u=[...i[0]].length-1,l,d,p=u,g=0,E=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(E.lastIndex=0,r=r.slice(-1*t.length+u);(i=E.exec(r))!=null;){if(l=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!l)continue;if(d=[...l].length,i[3]||i[4]){p+=d;continue}else if((i[5]||i[6])&&u%3&&!((u+d)%3)){g+=d;continue}if(p-=d,p>0)continue;d=Math.min(d,d+p+g);let _=[...i[0]][0].length,y=t.slice(0,u+i.index+_+d);if(Math.min(u,d)%2){let D=y.slice(1,-1);return{type:"em",raw:y,text:D,tokens:this.lexer.inlineTokens(D)}}let C=y.slice(2,-2);return{type:"strong",raw:y,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let n=r[2].replace(/\n/g," "),i=/[^ ]/.test(n),a=/^ /.test(n)&&/ $/.test(n);return i&&a&&(n=n.substring(1,n.length-1)),n=xn(n,!0),{type:"codespan",raw:r[0],text:n}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let n,i;return r[2]==="@"?(n=xn(r[1]),i="mailto:"+n):(n=xn(r[1]),i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let n,i;if(r[2]==="@")n=xn(r[0]),i="mailto:"+n;else{let a;do a=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(a!==r[0]);n=xn(r[0]),r[1]==="www."?i="http://"+r[0]:i=r[0]}return{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let n;return this.lexer.state.inRawBlock?n=r[0]:n=xn(r[0]),{type:"text",raw:r[0],text:n}}}},ER=/^(?: *(?:\n|$))+/,vR=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,TR=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Hc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,xR=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,SA=/(?:[*+-]|\d{1,9}[.)])/,CA=dt(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,SA).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),R0=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,yR=/^[^\n]+/,L0=/(?!\s*\])(?:\\.|[^\[\]\\])+/,AR=dt(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",L0).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),wR=dt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,SA).getRegex(),Sd="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|heaLine truncated
|
||||||
|
]`).replace("lheading",CA).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},NA=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,OR=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,OA=/^( {2,}|\\)\n(?!\s*$)/,DR=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Uc="\\p{P}\\p{S}",kR=dt(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Uc).getRegex(),RR=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,LR=dt(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Uc).getRegex(),PR=dt("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Uc).getRegex(),MR=dt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Uc).getRegex(),FR=dt(/\\([punct])/,"gu").replace(/punct/g,Uc).getRegex(),BR=dt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),$R=dt(P0).replace("(?:-->|$)","-->").getRegex(),HR=dt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",$R).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),yd=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,UR=dt(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",yd).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),DA=dt(/^!?\[(label)\]\[(ref)\]/).replace("label",yd).replace("ref",L0).getRegex(),kA=dt(/^!?\[(ref)\](?:\[\])?/).replace("ref",L0).getRegex(),VR=dt("reflink|nolink(?!\\()","g").replace("reflink",DA).replace("nolink",kA).getRegex(),F0={_backpedal:$c,anyPunctuation:FR,autolink:BR,blockSkip:RR,br:OA,code:OR,del:$c,emStrongLDelim:LR,emStrongRDelimAst:PR,emStrongRDelimUnd:MR,escape:NA,link:UR,nolink:kA,punctuation:kR,reflink:DA,reflinkSearch:VR,tag:HR,text:DR,url:$c},qR={...F0,link:dt(/^!?\[(label)\]\((.*?)\)/).replace("label",yd).getRegex(),reflink:dt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",yd).getRegex()},k0={...F0,escape:dt(NA).replace("])","~|])").getRegex(),url:dt(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},zR={...k0,br:dt(OA).replace("{2,}","*").getRegex(),text:dt(k0.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},xd={normal:M0,gfm:IR,pedantic:NR},Bc={normal:F0,gfm:k0,breaks:zR,pedantic:qR},yn=class{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Tt.defaults,this.options.tokenizer=this.options.tokenizer||new Ls,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={block:xd.normal,inline:Bc.normal};this.options.pedantic?(r.block=xd.pedantic,r.inline=Bc.pedantic):this.options.gfm&&(r.block=xd.gfm,this.options.breaks?r.inline=Bc.breaks:r.inline=Bc.gfm),this.tokenizer.rules=r}static get rules(){return{block:xd,inline:Bc}}static lex(t,r){return new yn(r).lex(t)}static lexInline(t,r){return new yn(r).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
|
||||||
|
`),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(l,d,p)=>d+" ".repeat(p.length));let n,i,a,u;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(l=>(n=l.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length),n.raw.length===1&&r.length>0?r[r.length-1].raw+=`
|
||||||
|
`:r.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length),i=r[r.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
|
||||||
|
`+n.raw,i.text+=`
|
||||||
|
`+n.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):r.push(n);continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length),i=r[r.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
|
||||||
|
`+n.raw,i.text+=`
|
||||||
|
`+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(a=t,this.options.extensions&&this.options.extensions.startBlock){let l=1/0,d=t.slice(1),p;this.options.extensions.startBlock.forEach(g=>{p=g.call({lexer:this},d),typeof p=="number"&&p>=0&&(l=Math.min(l,p))}),l<1/0&&l>=0&&(a=t.substring(0,l+1))}if(this.state.top&&(n=this.tokenizer.paragraph(a))){i=r[r.length-1],u&&i.type==="paragraph"?(i.raw+=`
|
||||||
|
`+n.raw,i.text+=`
|
||||||
|
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):r.push(n),u=a.length!==t.length,t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length),i=r[r.length-1],i&&i.type==="text"?(i.raw+=`
|
||||||
|
`+n.raw,i.text+=`
|
||||||
|
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):r.push(n);continue}if(t){let l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let n,i,a,u=t,l,d,p;if(this.tokens.links){let g=Object.keys(this.tokens.links);if(g.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(u))!=null;)g.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.blockSkip.exec(u))!=null;)u=u.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(u))!=null;)u=u.slice(0,l.index)+"++"+u.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(d||(p=""),d=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(g=>(n=g.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),i=r[r.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):r.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length),i=r[r.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):r.push(n);continue}if(n=this.tokenizer.emStrong(t,u,p)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.autolink(t)){t=t.substring(n.raw.length),r.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t))){t=t.substring(n.raw.length),r.push(n);continue}if(a=t,this.options.extensions&&this.options.extensions.startInline){let g=1/0,E=t.slice(1),_;this.options.extensions.startInline.forEach(y=>{_=y.call({lexer:this},E),typeof _=="number"&&_>=0&&(g=Math.min(g,_))}),g<1/0&&g>=0&&(a=t.substring(0,g+1))}if(n=this.tokenizer.inlineText(a)){t=t.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(p=n.raw.slice(-1)),d=!0,i=r[r.length-1],i&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):r.push(n);continue}if(t){let g="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return r}},Ps=class{options;constructor(t){this.options=t||Tt.defaults}code(t,r,n){let i=(r||"").match(/^\S*/)?.[0];return t=t.replace(/\n$/,"")+`
|
||||||
|
`,i?'<pre><code class="language-'+xn(i)+'">'+(n?t:xn(t,!0))+`</code></pre>
|
||||||
|
`:"<pre><code>"+(n?t:xn(t,!0))+`</code></pre>
|
||||||
|
`}blockquote(t){return`<blockquote>
|
||||||
|
${t}</blockquote>
|
||||||
|
`}html(t,r){return t}heading(t,r,n){return`<h${r}>${t}</h${r}>
|
||||||
|
`}hr(){return`<hr>
|
||||||
|
`}list(t,r,n){let i=r?"ol":"ul",a=r&&n!==1?' start="'+n+'"':"";return"<"+i+a+`>
|
||||||
|
`+t+"</"+i+`>
|
||||||
|
`}listitem(t,r,n){return`<li>${t}</li>
|
||||||
|
`}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(t){return`<p>${t}</p>
|
||||||
|
`}table(t,r){return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
||||||
|
<thead>
|
||||||
|
`+t+`</thead>
|
||||||
|
`+r+`</table>
|
||||||
|
`}tablerow(t){return`<tr>
|
||||||
|
${t}</tr>
|
||||||
|
`}tablecell(t,r){let n=r.header?"th":"td";return(r.align?`<${n} align="${r.align}">`:`<${n}>`)+t+`</${n}>
|
||||||
|
`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,r,n){let i=EA(t);if(i===null)return n;t=i;let a='<a href="'+t+'"';return r&&(a+=' title="'+r+'"'),a+=">"+n+"</a>",a}image(t,r,n){let i=EA(t);if(i===null)return n;t=i;let a=`<img src="${t}" alt="${n}"`;return r&&(a+=` title="${r}"`),a+=">",a}text(t){return t}},Ko=class{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,r,n){return""+n}image(t,r,n){return""+n}br(){return""}},An=class{options;renderer;textRenderer;constructor(t){this.options=t||Tt.defaults,this.options.renderer=this.options.renderer||new Ps,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ko}static parse(t,r){return new An(r).parse(t)}static parseInline(t,r){return new An(r).parseInline(t)}parse(t,r=!0){let n="";for(let i=0;i<t.length;i++){let a=t[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[a.type]){let u=a,l=this.options.extensions.renderers[u.type].call({parser:this},u);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)){n+=l||"";continue}}switch(a.type){case"space":continue;case"hr":{n+=this.renderer.hr();continue}case"heading":{let u=a;n+=this.renderer.heading(this.parseInline(u.tokens),u.depth,mR(this.parseInline(u.tokens,this.textRenderer)));continue}case"code":{let u=a;n+=this.renderer.code(u.text,u.lang,!!u.escaped);continue}case"table":{let u=a,l="",d="";for(let g=0;g<u.header.length;g++)d+=this.renderer.tablecell(this.parseInline(u.header[g].tokens),{header:!0,align:u.align[g]});l+=this.renderer.tablerow(d);let p="";for(let g=0;g<u.rows.length;g++){let E=u.rows[g];d="";for(let _=0;_<E.length;_++)d+=this.renderer.tablecell(this.parseInline(E[_].tokens),{header:!1,align:u.align[_]});p+=this.renderer.tablerow(d)}n+=this.renderer.table(l,p);continue}case"blockquote":{let u=a,l=this.parse(u.tokens);n+=this.renderer.blockquote(l);continue}case"list":{let u=a,l=u.ordered,d=u.start,p=u.loose,g="";for(let E=0;E<u.items.length;E++){let _=u.items[E],y=_.checked,C=_.task,D="";if(_.task){let P=this.renderer.checkbox(!!y);p?_.tokens.length>0&&_.tokens[0].type==="paragraph"?(_.tokens[0].text=P+" "+_.tokens[0].text,_.tokens[0].tokens&&_.tokens[0].tokens.length>0&&_.tokens[0].tokens[0].type==="text"&&(_.tokens[0].tokens[0].text=P+" "+_.tokens[0].tokens[0].text)):_.tokens.unshift({type:"text",text:P+" "}):D+=P+" "}D+=this.parse(_.tokens,p),g+=this.renderer.listitem(D,C,!!y)}n+=this.renderer.list(g,l,d);continue}case"html":{let u=a;n+=this.renderer.html(u.text,u.block);continue}case"paragraph":{let u=a;n+=this.renderer.paragraph(this.parseInline(u.tokens));continue}case"text":{let u=a,l=u.tokens?this.parseInline(u.tokens):u.text;for(;i+1<t.length&&t[i+1].type==="text";)u=t[++i],l+=`
|
||||||
|
`+(u.tokens?this.parseInline(u.tokens):u.text);n+=r?this.renderer.paragraph(l):l;continue}default:{let u='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}parseInline(t,r){r=r||this.renderer;let n="";for(let i=0;i<t.length;i++){let a=t[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[a.type]){let u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){n+=u||"";continue}}switch(a.type){case"escape":{let u=a;n+=r.text(u.text);break}case"html":{let u=a;n+=r.html(u.text);break}case"link":{let u=a;n+=r.link(u.href,u.title,this.parseInline(u.tokens,r));break}case"image":{let u=a;n+=r.image(u.href,u.title,u.text);break}case"strong":{let u=a;n+=r.strong(this.parseInline(u.tokens,r));break}case"em":{let u=a;n+=r.em(this.parseInline(u.tokens,r));break}case"codespan":{let u=a;n+=r.codespan(u.text);break}case"br":{n+=r.br();break}case"del":{let u=a;n+=r.del(this.parseInline(u.tokens,r));break}case"text":{let u=a;n+=r.text(u.text);break}default:{let u='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}},Ba=class{options;constructor(t){this.options=t||Tt.defaults}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}};zl(Ba,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));var Ad=class{defaults=wd();options=this.setOptions;parse=this.#e(yn.lex,An.parse);parseInline=this.#e(yn.lexInline,An.parseInline);Parser=An;Renderer=Ps;TextRenderer=Ko;Lexer=yn;Tokenizer=Ls;Hooks=Ba;constructor(...t){this.use(...t)}walkTokens(t,r){let n=[];for(let i of t)switch(n=n.concat(r.call(this,i)),i.type){case"table":{let a=i;for(let u of a.header)n=n.concat(this.walkTokens(u.tokens,r));for(let u of a.rows)for(let l of u)n=n.concat(this.walkTokens(l.tokens,r));break}case"list":{let a=i;n=n.concat(this.walkTokens(a.items,r));break}default:{let a=i;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(u=>{let l=a[u].flat(1/0);n=n.concat(this.walkTokens(l,r))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,r)))}}return n}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let u=r.renderers[a.name];u?r.renderers[a.name]=function(...l){let d=a.renderer.apply(this,l);return d===!1&&(d=u.apply(this,l)),d}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let u=r[a.level];u?u.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),i.extensions=r),n.renderer){let a=this.defaults.renderer||new Ps(this.defaults);for(let u in n.renderer){if(!(u in a))throw new Error(`renderer '${u}' does not exist`);if(u==="options")continue;let l=u,d=n.renderer[l],p=a[l];a[l]=(...g)=>{let E=d.apply(a,g);return E===!1&&(E=p.apply(a,g)),E||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Ls(this.defaults);for(let u in n.tokenizer){if(!(u in a))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;let l=u,d=n.tokenizer[l],p=a[l];a[l]=(...g)=>{let E=d.apply(a,g);return E===!1&&(E=p.apply(a,g)),E}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new Ba;for(let u in n.hooks){if(!(u in a))throw new Error(`hook '${u}' does not exist`);if(u==="options")continue;let l=u,d=n.hooks[l],p=a[l];Ba.passThroughHooks.has(u)?a[l]=g=>{if(this.defaults.async)return Promise.resolve(d.call(a,g)).then(_=>p.call(a,_));let E=d.call(a,g);return p.call(a,E)}:a[l]=(...g)=>{let E=d.apply(a,g);return E===!1&&(E=p.apply(a,g)),E}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,u=n.walkTokens;i.walkTokens=function(l){let d=[];return d.push(u.call(this,l)),a&&(d=d.concat(a.call(this,l))),d}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return yn.lex(t,r??this.defaults)}parser(t,r){return An.parse(t,r??this.defaults)}#e(t,r){return(n,i)=>{let a={...i},u={...this.defaults,...a};this.defaults.async===!0&&a.async===!1&&(u.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),u.async=!0);let l=this.#t(!!u.silent,!!u.async);if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined o
Line truncated
|
||||||
|
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+xn(n.message+"",!0)+"</pre>";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},Ms=new Ad;function st(e,t){return Ms.parse(e,t)}st.options=st.setOptions=function(e){return Ms.setOptions(e),st.defaults=Ms.defaults,yA(st.defaults),st};st.getDefaults=wd;st.defaults=Tt.defaults;st.use=function(...e){return Ms.use(...e),st.defaults=Ms.defaults,yA(st.defaults),st};st.walkTokens=function(e,t){return Ms.walkTokens(e,t)};st.parseInline=Ms.parseInline;st.Parser=An;st.parser=An.parse;st.Renderer=Ps;st.TextRenderer=Ko;st.Lexer=yn;st.lexer=yn.lex;st.Tokenizer=Ls;st.Hooks=Ba;st.parse=st;var YR=st.options,KR=st.setOptions,jR=st.use,WR=st.walkTokens,GR=st.parseInline,QR=st,XR=An.parse,ZR=yn.lex;Tt.Hooks=Ba;Tt.Lexer=yn;Tt.Marked=Ad;Tt.Parser=An;Tt.Renderer=Ps;Tt.TextRenderer=Ko;Tt.Tokenizer=Ls;Tt.getDefaults=wd;Tt.lexer=ZR;Tt.marked=st;Tt.options=YR;Tt.parse=QR;Tt.parseInline=GR;Tt.parser=XR;Tt.setOptions=KR;Tt.use=jR;Tt.walkTokens=WR});function LA(e){return e.type===Ze.Tag||e.type===Ze.Script||e.type===Ze.Style}var Ze,PA,MA,FA,BA,$A,HA,UA,VA,qA,jo=v(()=>{(function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"})(Ze||(Ze={}));PA=Ze.Root,MA=Ze.Text,FA=Ze.Directive,BA=Ze.Comment,$A=Ze.Script,HA=Ze.Style,UA=Ze.Tag,VA=Ze.CDATA,qA=Ze.Doctype});function _e(e){return LA(e)}function Wo(e){return e.type===Ze.CDATA}function nn(e){return e.type===Ze.Text}function Hs(e){return e.type===Ze.Comment}function Id(e){return e.type===Ze.Directive}function Bn(e){return e.type===Ze.Root}function ht(e){return Object.prototype.hasOwnProperty.call(e,"children")}function Go(e,t=!1){let r;if(nn(e))r=new Oi(e.data);else if(Hs(e))r=new Fs(e.data);else if(_e(e)){let n=t?B0(e.children):[],i=new $s(e.name,{...e.attribs},n);n.forEach(a=>a.parent=i),e.namespace!=null&&(i.namespace=e.namespace),e["x-attribsNamespace"]&&(i["x-attribsNamespace"]={...e["x-attribsNamespace"]}),e["x-attribsPrefix"]&&(i["x-attribsPrefix"]={...e["x-attribsPrefix"]}),r=i}else if(Wo(e)){let n=t?B0(e.children):[],i=new zc(n);n.forEach(a=>a.parent=i),r=i}else if(Bn(e)){let n=t?B0(e.children):[],i=new wn(n);n.forEach(a=>a.parent=i),e["x-mode"]&&(i["x-mode"]=e["x-mode"]),r=i}else if(Id(e)){let n=new Bs(e.name,e.data);e["x-name"]!=null&&(n["x-name"]=e["x-name"],n["x-publicId"]=e["x-publicId"],n["x-systemId"]=e["x-systemId"]),r=n}else throw new Error(`Not implemented yet: ${e.type}`);return r.startIndex=e.startIndex,r.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(r.sourceCodeLocation=e.sourceCodeLocation),r}function B0(e){let t=e.map(r=>Go(r,!0));for(let r=1;r<t.length;r++)t[r].prev=t[r-1],t[r-1].next=t[r];return t}var Cd,Vc,Oi,Fs,Bs,qc,zc,wn,$s,$0=v(()=>{jo();Cd=class{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(t){this.parent=t}get previousSibling(){return this.prev}set previousSibling(t){this.prev=t}get nextSibling(){return this.next}set nextSibling(t){this.next=t}cloneNode(t=!1){return Go(this,t)}},Vc=class extends Cd{constructor(t){super(),this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t}},Oi=class extends Vc{constructor(){super(...arguments),this.type=Ze.Text}get nodeType(){return 3}},Fs=class extends Vc{constructor(){super(...arguments),this.type=Ze.Comment}get nodeType(){return 8}},Bs=class extends Vc{constructor(t,r){super(r),this.name=t,this.type=Ze.Directive}get nodeType(){return 1}},qc=class extends Cd{constructor(t){super(),this.children=t}get firstChild(){var t;return(t=this.children[0])!==null&&t!==void 0?t:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(t){this.children=t}},zc=class extends qc{constructor(){super(...arguments),this.type=Ze.CDATA}get nodeType(){return 4}},wn=class extends qc{constructor(){super(...arguments),this.type=Ze.Root}get nodeType(){return 9}},$s=class extends qc{constructor(t,r,n=[],i=t==="script"?Ze.Script:t==="style"?Ze.Style:Ze.Tag){super(n),this.name=t,this.attribs=r,this.type=i}get nodeType(){return 1}get tagName(){return this.name}set tagName(t){this.name=t}get attributes(){return Object.keys(this.attribs).map(t=>{var r,n;return{name:t,value:this.attribs[t],namespace:(r=this["x-attribsNamespace"])===null||r===void 0?void 0:r[t],prefix:(n=this["x-attribsPrefix"])===null||n===void 0?void 0:n[t]}})}}});var YA,Qo,_r=v(()=>{jo();$0();$0();YA={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},Qo=class{constructor(t,r,n){this.dom=[],this.root=new wn(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof r=="function"&&(n=r,r=YA),typeof t=="object"&&(r=t,t=void 0),this.callback=t??null,this.options=r??YA,this.elementCB=n??null}onparserinit(t){this.parser=t}
Line truncated
|
||||||
|
`:kd(e.children):Wo(e)?kd(e.children):nn(e)?e.data:""}function ra(e){return Array.isArray(e)?e.map(ra).join(""):ht(e)&&!Hs(e)?ra(e.children):nn(e)?e.data:""}function jc(e){return Array.isArray(e)?e.map(jc).join(""):ht(e)&&(e.type===Ze.Tag||Wo(e))?jc(e.children):nn(e)?e.data:""}var X0=v(()=>{_r();Q0();jo()});function ru(e){return ht(e)?e.children:[]}function c2(e){return e.parent||null}function Z0(e){let t=c2(e);if(t!=null)return ru(t);let r=[e],{prev:n,next:i}=e;for(;n!=null;)r.unshift(n),{prev:n}=n;for(;i!=null;)r.push(i),{next:i}=i;return r}function EL(e,t){var r;return(r=e.attribs)===null||r===void 0?void 0:r[t]}function vL(e,t){return e.attribs!=null&&Object.prototype.hasOwnProperty.call(e.attribs,t)&&e.attribs[t]!=null}function TL(e){return e.name}function Rd(e){let{next:t}=e;for(;t!==null&&!_e(t);)({next:t}=t);return t}function Ld(e){let{prev:t}=e;for(;t!==null&&!_e(t);)({prev:t}=t);return t}var l2=v(()=>{_r()});function na(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){let t=e.parent.children,r=t.lastIndexOf(e);r>=0&&t.splice(r,1)}e.next=null,e.prev=null,e.parent=null}function xL(e,t){let r=t.prev=e.prev;r&&(r.next=t);let n=t.next=e.next;n&&(n.prev=t);let i=t.parent=e.parent;if(i){let a=i.children;a[a.lastIndexOf(e)]=t,e.parent=null}}function yL(e,t){if(na(t),t.next=null,t.parent=e,e.children.push(t)>1){let r=e.children[e.children.length-2];r.next=t,t.prev=r}else t.prev=null}function AL(e,t){na(t);let{parent:r}=e,n=e.next;if(t.next=n,t.prev=e,e.next=t,t.parent=r,n){if(n.prev=t,r){let i=r.children;i.splice(i.lastIndexOf(n),0,t)}}else r&&r.children.push(t)}function wL(e,t){if(na(t),t.parent=e,t.prev=null,e.children.unshift(t)!==1){let r=e.children[1];r.prev=t,t.next=r}else t.next=null}function SL(e,t){na(t);let{parent:r}=e;if(r){let n=r.children;n.splice(n.indexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=r,t.prev=e.prev,t.next=e,e.prev=t}var f2=v(()=>{});function nu(e,t,r=!0,n=1/0){return Pd(e,Array.isArray(t)?t:[t],r,n)}function Pd(e,t,r,n){let i=[],a=[Array.isArray(t)?t:[t]],u=[0];for(;;){if(u[0]>=a[0].length){if(u.length===1)return i;a.shift(),u.shift();continue}let l=a[0][u[0]++];if(e(l)&&(i.push(l),--n<=0))return i;r&&ht(l)&&l.children.length>0&&(u.unshift(0),a.unshift(l.children))}}function CL(e,t){return t.find(e)}function Md(e,t,r=!0){let n=Array.isArray(t)?t:[t];for(let i=0;i<n.length;i++){let a=n[i];if(_e(a)&&e(a))return a;if(r&&ht(a)&&a.children.length>0){let u=Md(e,a.children,!0);if(u)return u}}return null}function d2(e,t){return(Array.isArray(t)?t:[t]).some(r=>_e(r)&&e(r)||ht(r)&&d2(e,r.children))}function IL(e,t){let r=[],n=[Array.isArray(t)?t:[t]],i=[0];for(;;){if(i[0]>=n[0].length){if(n.length===1)return r;n.shift(),i.shift();continue}let a=n[0][i[0]++];_e(a)&&e(a)&&r.push(a),ht(a)&&a.children.length>0&&(i.unshift(0),n.unshift(a.children))}}var J0=v(()=>{_r()});function eg(e,t){return typeof t=="function"?r=>_e(r)&&t(r.attribs[e]):r=>_e(r)&&r.attribs[e]===t}function NL(e,t){return r=>e(r)||t(r)}function h2(e){let t=Object.keys(e).map(r=>{let n=e[r];return Object.prototype.hasOwnProperty.call(Fd,r)?Fd[r](n):eg(r,n)});return t.length===0?null:t.reduce(NL)}function OL(e,t){let r=h2(e);return r?r(t):!0}function DL(e,t,r,n=1/0){let i=h2(e);return i?nu(i,t,r,n):[]}function kL(e,t,r=!0){return Array.isArray(t)||(t=[t]),Md(eg("id",e),t,r)}function Us(e,t,r=!0,n=1/0){return nu(Fd.tag_name(e),t,r,n)}function RL(e,t,r=!0,n=1/0){return nu(eg("class",e),t,r,n)}function LL(e,t,r=!0,n=1/0){return nu(Fd.tag_type(e),t,r,n)}var Fd,tg=v(()=>{_r();J0();Fd={tag_name(e){return typeof e=="function"?t=>_e(t)&&e(t.name):e==="*"?_e:t=>_e(t)&&t.name===e},tag_type(e){return typeof e=="function"?t=>e(t.type):t=>t.type===e},tag_contains(e){return typeof e=="function"?t=>nn(t)&&e(t.data):t=>nn(t)&&t.data===e}}});function PL(e){let t=e.length;for(;--t>=0;){let r=e[t];if(t>0&&e.lastIndexOf(r,t-1)>=0){e.splice(t,1);continue}for(let n=r.parent;n;n=n.parent)if(e.includes(n)){e.splice(t,1);break}}return e}function p2(e,t){let r=[],n=[];if(e===t)return 0;let i=ht(e)?e:e.parent;for(;i;)r.unshift(i),i=i.parent;for(i=ht(t)?t:t.parent;i;)n.unshift(i),i=i.parent;let a=Math.min(r.length,n.length),u=0;for(;u<a&&r[u]===n[u];)u++;if(u===0)return $n.DISCONNECTED;let l=r[u-1],d=l.children,p=r[u],g=n[u];return d.indexOf(p)>d.indexOf(g)?l===t?$n.FOLLOWING|$n.CONTAINED_BY:$n.FOLLOWING:l===e?$n.PRECEDING|$n.CONTAINS:$n.PRECEDING}function Ua(e){return e=e.filter((t,r,n)=>!n.includes(t,r+1)),e.sort((t,r)=>{let n=p2(t,r);return n&$n.PRECEDING?-1:n&$n.FOLLOWING?1:0}),e}var $n,m2=v(()=>{_r();(function(e){e[e.DISCONNECTED=1]="DISCONNECTED",e[e.PRECEDING=2]="PRECEDING",e[e.FOLLOWING=4]="FOLLOWING",e[e.CONTAINS=8]="CONTAINS",e[e.CONTAINED_BY=16]="CONTAINED_BY"})($n||($n={}))});function rg(e){let t=Bd(HL,e);return t?t.name==="feed"?ML(t):FL(t):null}function ML(e){var t;let r=e.children,n={type:"atom",items:Us("entry",r).map(u=>{var l;let{children:d}=u,p={media:g2(d)};an(p,"id","id",d),an(p,"title","title",d);let g=(l=Bd
Line truncated
|
||||||
|
:is(button, input, select, textarea, optgroup, option)[disabled],
|
||||||
|
optgroup[disabled] > option,
|
||||||
|
fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
|
||||||
|
)`,enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"}});function vg(e,t){return e===Un.default.falseFunc?Un.default.falseFunc:r=>t.isTag(r)&&e(r)}function Tg(e,t){let r=t.getSiblings(e);if(r.length<=1)return[];let n=r.indexOf(e);return n<0||n===r.length-1?[]:r.slice(n+1).filter(t.isTag)}function bg(e){return{xmlMode:!!e.xmlMode,lowerCaseAttributeNames:!!e.lowerCaseAttributeNames,lowerCaseTags:!!e.lowerCaseTags,quirksMode:!!e.quirksMode,cacheResults:!!e.cacheResults,pseudos:e.pseudos,adapter:e.adapter,equals:e.equals}}var Un,Eg,_g,qd,zd=v(()=>{Un=ln(za(),1);hg();Eg={};_g=(e,t,r,n,i)=>{let a=i(t,bg(r),n);return a===Un.default.trueFunc?e:a===Un.default.falseFunc?Un.default.falseFunc:u=>a(u)&&e(u)},qd={is:_g,matches:_g,where:_g,not(e,t,r,n,i){let a=i(t,bg(r),n);return a===Un.default.falseFunc?e:a===Un.default.trueFunc?Un.default.falseFunc:u=>!a(u)&&e(u)},has(e,t,r,n,i){let{adapter:a}=r,u=bg(r);u.relativeSelector=!0;let l=t.some(g=>g.some(el))?[Eg]:void 0,d=i(t,u,l);if(d===Un.default.falseFunc)return Un.default.falseFunc;let p=vg(d,a);if(l&&d!==Un.default.trueFunc){let{shouldTestNextSiblings:g=!1}=d;return E=>{if(!e(E))return!1;l[0]=E;let _=a.getChildren(E),y=g?[..._,...Tg(E,a)]:_;return a.existsOne(p,y)}}return g=>e(g)&&a.existsOne(p,a.getChildren(g))}}});function G2(e,t,r,n,i){var a;let{name:u,data:l}=t;if(Array.isArray(l)){if(!(u in qd))throw new Error(`Unknown pseudo-class :${u}(${l})`);return qd[u](e,l,r,n,i)}let d=(a=r.pseudos)===null||a===void 0?void 0:a[u],p=typeof d=="string"?d:Vd[u];if(typeof p=="string"){if(l!=null)throw new Error(`Pseudo ${u} doesn't have any arguments`);let g=ia(p);return qd.is(e,g,r,n,i)}if(typeof d=="function")return gg(d,u,l,1),g=>d(g,l)&&e(g);if(u in cu)return cu[u](e,l,r,n);if(u in rl){let g=rl[u];return gg(g,u,l,2),E=>g(E,r,l)&&e(E)}throw new Error(`Unknown pseudo-class :${u}`)}var xg=v(()=>{ou();K2();j2();W2();zd()});function yg(e,t){let r=t.getParent(e);return r&&t.isTag(r)?r:null}function Q2(e,t,r,n,i){let{adapter:a,equals:u}=r;switch(t.type){case Ee.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select");case Ee.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select");case Ee.Attribute:{if(t.namespace!=null)throw new Error("Namespaced attributes are not yet supported by css-select");return(!r.xmlMode||r.lowerCaseAttributeNames)&&(t.name=t.name.toLowerCase()),B2[t.action](e,t,r)}case Ee.Pseudo:return G2(e,t,r,n,i);case Ee.Tag:{if(t.namespace!=null)throw new Error("Namespaced tag names are not yet supported by css-select");let{name:l}=t;return(!r.xmlMode||r.lowerCaseTags)&&(l=l.toLowerCase()),function(p){return a.getName(p)===l&&e(p)}}case Ee.Descendant:{if(r.cacheResults===!1||typeof WeakSet>"u")return function(p){let g=p;for(;g=yg(g,a);)if(e(g))return!0;return!1};let l=new WeakSet;return function(p){let g=p;for(;g=yg(g,a);)if(!l.has(g)){if(a.isTag(g)&&e(g))return!0;l.add(g)}return!1}}case"_flexibleDescendant":return function(d){let p=d;do if(e(p))return!0;while(p=yg(p,a));return!1};case Ee.Parent:return function(d){return a.getChildren(d).some(p=>a.isTag(p)&&e(p))};case Ee.Child:return function(d){let p=a.getParent(d);return p!=null&&a.isTag(p)&&e(p)};case Ee.Sibling:return function(d){let p=a.getSiblings(d);for(let g=0;g<p.length;g++){let E=p[g];if(u(d,E))break;if(a.isTag(E)&&e(E))return!0}return!1};case Ee.Adjacent:return a.prevElementSibling?function(d){let p=a.prevElementSibling(d);return p!=null&&e(p)}:function(d){let p=a.getSiblings(d),g;for(let E=0;E<p.length;E++){let _=p[E];if(u(d,_))break;a.isTag(_)&&(g=_)}return!!g&&e(g)};case Ee.Universal:{if(t.namespace!=null&&t.namespace!=="*")throw new Error("Namespaced universal selectors are not yet supported by css-select");return e}}}var X2=v(()=>{$2();xg();ou()});function Z2(e,t,r){let n=Yd(e,t,r);return vg(n,t.adapter)}function Yd(e,t,r){let n=typeof e=="string"?ia(e):e;return Kd(n,t,r)}function J2(e){return e.type===Ee.Pseudo&&(e.name==="scope"||Array.isArray(e.data)&&e.data.some(t=>t.some(J2)))}function gP(e,{adapter:t},r){let n=!!r?.every(i=>{let a=t.isTag(i)&&t.getParent(i);return i===Eg||a&&t.isTag(a)});for(let i of e){if(!(i.length>0&&el(i[0])&&i[0].type!==Ee.Descendant))if(n&&!i.some(J2))i.unshift(hP);else continue;i.unshift(mP)}}function Kd(e,t,r){var n;e.forEach(dg),r=(n=t.context)!==null&&n!==void 0?n:r;let i=Array.isArray(r),a=r&&(Arra
Line truncated
|
||||||
|
`)})):{name:i,value:a.replace(Tw,`\r
|
||||||
|
`)}}).toArray()}var vw,C4,Tw,xw=v(()=>{_r();vw="input,select,textarea,keygen",C4=/%20/g,Tw=/\r?\n/g});var Vg={};Nn(Vg,{extract:()=>D4});function O4(e){var t;return typeof e=="string"?{selector:e,value:"textContent"}:{selector:e.selector,value:(t=e.value)!==null&&t!==void 0?t:"textContent"}}function D4(e){let t={};for(let r in e){let n=e[r],i=Array.isArray(n),{selector:a,value:u}=O4(i?n[0]:n),l=typeof u=="function"?u:typeof u=="string"?d=>this._make(d).prop(u):d=>this._make(d).extract(u);if(i)t[r]=this._findBySelector(a,Number.POSITIVE_INFINITY).map((d,p)=>l(p,r,t)).get();else{let d=this._findBySelector(a,1);t[r]=d.length>0?l(d[0],r,t):void 0}}return t}var yw=v(()=>{});var ja,Aw=v(()=>{N2();dw();gw();Ew();xw();yw();ja=class{constructor(t,r,n){if(this.length=0,this.options=n,this._root=r,t){for(let i=0;i<t.length;i++)this[i]=t[i];this.length=t.length}}};ja.prototype.cheerio="[cheerio object]";ja.prototype.splice=Array.prototype.splice;ja.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator];Object.assign(ja.prototype,cg,Fg,$g,Hg,Ug,Vg)});function ww(e,t){return function r(n,i,a=!0){if(n==null)throw new Error("cheerio.load() expects a string");let u=Wc(i),l=e(n,u,a,null);class d extends ja{_make(E,_){let y=p(E,_);return y.prevObject=this,y}_parse(E,_,y,C){return e(E,_,y,C)}_render(E){return t(E,this.options)}}function p(g,E,_=l,y){if(g&&Hn(g))return g;let C=Wc(y,u),D=typeof _=="string"?[e(_,C,!1,null)]:"length"in _?_:[_],P=Hn(D)?D:new d(D,null,C);if(P._root=P,!g)return new d(void 0,P,C);let N=typeof g=="string"&&Qc(g)?e(g,C,!1,null).children:k4(g)?[g]:Array.isArray(g)?g:void 0,L=new d(N,P,C);if(N)return L;if(typeof g!="string")throw new TypeError("Unexpected type of selector");let H=g,R=E?typeof E=="string"?Qc(E)?new d([e(E,C,!1,null)],P,C):(H=`${E} ${H}`,P):Hn(E)?E:new d(Array.isArray(E)?E:[E],P,C):P;return R?R.find(H):L}return Object.assign(p,ag,{load:r,_root:l,_options:u,fn:d.prototype,prototype:d.prototype}),p}}function k4(e){return!!e.name||e.type==="root"||e.type==="text"||e.type==="comment"}var Sw=v(()=>{ng();iu();Aw();au()});function Zd(e){return e>=55296&&e<=57343}function Cw(e){return e>=56320&&e<=57343}function Iw(e,t){return(e-55296)*1024+9216+t}function Jd(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function eh(e){return e>=64976&&e<=65007||R4.has(e)}var R4,xt,x,Vr,th=v(()=>{R4=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),xt="\uFFFD";(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(x||(x={}));Vr={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"}});var Y,al=v(()=>{(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeVal
Line truncated
|
||||||
|
`)}else if(hc(t))try{let g=JSON.parse(await r.vault.cachedRead(n)),E=[],_=y=>{for(let C in y)typeof y[C]=="object"?_(y[C]):C==="content"&&E.push(y[C])};_(g),i=E.join(`\r
|
||||||
|
`)}catch(g){console.error("Omnisearch: Error while parsing Dataloom file",t),console.error(g)}else Mn(t)?this.plugin.settings.aiImageIndexing&&u?.canBeAnalyzed(n)?i=await u.analyzeImage(n):this.plugin.settings.imagesIndexing&&a?.canFileBeExtracted(t)&&(i=await a.extractText(n)):ti(t)&&this.plugin.settings.PDFIndexing&&a?.canFileBeExtracted(t)?i=await a.extractText(n):dv(t)&&this.plugin.settings.officeIndexing&&a?.canFileBeExtracted(t)?i=await a.extractText(n):this.plugin.notesIndexer.isFilenameIndexable(t)&&(i=n.path);i==null&&(ri(`Omnisearch: ${i} content for file`,n.path),i="");let l=r.metadataCache.getFileCache(n);if(l){let g=bv(this.plugin.app,n,l);for(let E of g.filter(_=>!this.documents.has(_))){let _=this.plugin.notesIndexer.generateIndexableNonexistingDocument(E,n.path)}if(l.frontmatter?.["excalidraw-plugin"]){let E=l.sections?.filter(_=>_.type==="comment")??[];for(let{start:_,end:y}of E.map(C=>C.position))i=i.substring(0,_.offset-1)+i.substring(y.offset)}}let d;this.plugin.settings.displayTitle==="#heading"?d=l?.headings?.find(g=>g.level===1)?.heading??"":d=l?.frontmatter?.[this.plugin.settings.displayTitle]??"";let p=fv(l);return{basename:n.basename,displayTitle:d,content:i,cleanedContent:cv(Gi(i)),path:n.path,mtime:n.stat.mtime,tags:p,unmarkedTags:p.map(g=>g.replace("#","")),aliases:lv(l).join(""),headings1:l?wf(l,1).join(" "):"",headings2:l?wf(l,2).join(" "):"",headings3:l?wf(l,3).join(" "):""}}};Nr();bc();Nr();var Ah=class{constructor(t){this.plugin=t;this.notesToReindex=new Set}flagNoteForReindex(t){this.notesToReindex.add(t)}async refreshIndex(){for(let r of this.notesToReindex)Ke("Updating file",r.path),await this.plugin.documentsRepository.addDocument(r.path);let t=[...this.notesToReindex].map(r=>r.path);t.length&&(this.plugin.searchEngine.removeFromPaths(t),await this.plugin.searchEngine.addFromPaths(t),this.notesToReindex.clear())}isFileIndexable(t){return this.isFilenameIndexable(t)||this.isContentIndexable(t)}isContentIndexable(t){let r=this.plugin.settings,n=!!this.plugin.getTextExtractor(),i=!!this.plugin.getAIImageAnalyzer(),a=n&&r.PDFIndexing,u=n&&r.imagesIndexing,l=i&&r.aiImageIndexing;return this.isFilePlaintext(t)||wi(t)||hc(t)||a&&ti(t)||u&&Mn(t)||l&&Mn(t)}isFilenameIndexable(t){return this.canIndexUnsupportedFiles()||this.isFilePlaintext(t)||wi(t)||Cs(t)||hc(t)}canIndexUnsupportedFiles(){return this.plugin.settings.unsupportedFilesIndexing==="yes"||this.plugin.settings.unsupportedFilesIndexing==="default"&&!!this.plugin.app.vault.getConfig("showUnsupportedFiles")}generateIndexableNonexistingDocument(t,r){return t=Om(t),{path:t+(t.endsWith(".md")?"":".md"),basename:t,displayTitle:"",mtime:0,content:"",cleanedContent:"",tags:[],unmarkedTags:[],aliases:"",headings1:"",headings2:"",headings3:"",doesNotExist:!0,parent:r}}isFilePlaintext(t){return[...this.plugin.settings.indexedFileTypes,"md"].some(r=>t.endsWith(`.${r}`))}};o0();var Sh=require("obsidian");Nr();var wh=class{constructor(t){this.plugin=t;this.embeds=new Map}addEmbed(t,r){this.embeds.has(t)||this.embeds.set(t,new Set),this.embeds.get(t).add(r)}removeFile(t){this.embeds.delete(t),this.refreshEmbedsForNote(t)}renameFile(t,r){this.embeds.has(t)&&(this.embeds.set(r,this.embeds.get(t)),this.embeds.delete(t)),this.embeds.forEach((n,i)=>{n.has(t)&&(n.delete(t),n.add(r))})}refreshEmbedsForNote(t){this.embeds.forEach((r,n)=>{r.has(t)&&r.delete(t)}),this.addEmbedsForNote(t)}getEmbeds(t){return this.embeds.has(t)?[...this.embeds.get(t)]:[]}async writeToCache(){Ke("Writing embeds to cache");let t=this.plugin.database,r=[];for(let[n,i]of this.embeds)r.push({embedded:n,referencedBy:[...i]});await t.embeds.clear(),await t.embeds.bulkAdd(r)}async loadFromCache(){try{let t=this.plugin.database;if(!t.embeds){Ke("No embeds in cache");return}Ke("Loading embeds from cache");let r=await t.embeds.toArray();for(let{embedded:n,referencedBy:i}of r)for(let a of i)this.addEmbed(n,a)}catch{this.plugin.database.clearCache(),console.error("Omnisearch - Error while loading embeds cache"),new Sh.Notice("Omnisearch - There was an error while loading the cache. Please restart Obsidian.")}}addEmbedsForNote(t){let r=(this.plugin.app.metadataCache.getCache(t)?.embeds??[]).map(n=>this.plugin.app.metadataCache.getFirstLinkpathDest((0,Sh.getLinkpath)(n.link),t)).filter(n=>!!n);for(let n of r)this.addEmbed(n.path,t)}};var Ch=class{constructor(t){this.plugin=t;this.nextQueryIsEmpty=!1}async addToHistory(t){if(!t){this.nextQueryIsEmpty=!0;return}this.nextQueryIsEmpty=!1;let r=this.plugin.database,n=await r.searchHistory.toArray();n=n.filter(i=>i.query!==t).reverse(),n.unshift({query:t}),n=n.slice(0,10),await r.searchHistory.clear(),await r.searchHistory.bulkAdd(n)}async getHistory(){let t=(await this.plugin.database.searchHistory.toArray()).reverse().map(r=>r.query);return this.nextQueryIsEmpty&&t.unshift(""),t}};var Ih=class extends zn.Plugin{constructor(r,n){super(r,n);this.apiHttpServer=null;this.settings=kc(this.app);this.embedsRepository=new wh(this);this.da
Line truncated
|
||||||
|
/*! Bundled license information:
|
||||||
|
|
||||||
|
lodash-es/lodash.js:
|
||||||
|
(**
|
||||||
|
* @license
|
||||||
|
* Lodash (Custom Build) <https://lodash.com/>
|
||||||
|
* Build: `lodash modularize exports="es" -o ./`
|
||||||
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||||||
|
* Released under MIT license <https://lodash.com/license>
|
||||||
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||||
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||||
|
*)
|
||||||
|
|
||||||
|
search-query-parser/lib/search-query-parser.js:
|
||||||
|
(*!
|
||||||
|
* search-query-parser.js
|
||||||
|
* Copyright(c) 2014-2019
|
||||||
|
* MIT Licensed
|
||||||
|
*)
|
||||||
|
|
||||||
|
dexie/dist/dexie.js:
|
||||||
|
(*! *****************************************************************************
|
||||||
|
Copyright (c) Microsoft Corporation.
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted.
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||||
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||||
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||||
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||||
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||||
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
***************************************************************************** *)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* nosourcemap */
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"id": "omnisearch",
|
||||||
|
"name": "Omnisearch",
|
||||||
|
"version": "1.28.2",
|
||||||
|
"minAppVersion": "1.7.2",
|
||||||
|
"description": "A search engine that just works",
|
||||||
|
"author": "Simon Cambier",
|
||||||
|
"authorUrl": "https://github.com/scambier/obsidian-omnisearch",
|
||||||
|
"fundingUrl": {
|
||||||
|
"Github": "https://github.com/sponsors/scambier",
|
||||||
|
"Ko-fi": "https://ko-fi.com/scambier"
|
||||||
|
},
|
||||||
|
"isDesktopOnly": false
|
||||||
|
}
|
||||||
+135
@@ -0,0 +1,135 @@
|
|||||||
|
.omnisearch-modal {
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-result {
|
||||||
|
white-space: normal;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
/* justify-content: space-between; */
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-result__title-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
column-gap: 5px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-result__title {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
gap: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-result__title > span {
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-result__folder-path {
|
||||||
|
font-size: 0.75rem;
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
gap: 5px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-result__extension {
|
||||||
|
font-size: 0.7rem;
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-result__counter {
|
||||||
|
font-size: 0.7rem;
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-result__body {
|
||||||
|
white-space: normal;
|
||||||
|
font-size: small;
|
||||||
|
word-wrap: normal;
|
||||||
|
|
||||||
|
overflow: hidden;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 3;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
|
||||||
|
color: var(--text-muted);
|
||||||
|
margin-inline-start: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-result__embed {
|
||||||
|
margin-left: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.omnisearch-result__image-container {
|
||||||
|
flex-basis: 20%;
|
||||||
|
text-align: end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-highlight {
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-default-highlight {
|
||||||
|
text-decoration: underline;
|
||||||
|
text-decoration-color: var(--text-highlight-bg);
|
||||||
|
text-decoration-thickness: 3px;
|
||||||
|
text-underline-offset: -1px;
|
||||||
|
text-decoration-skip-ink: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-input-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: row;
|
||||||
|
gap: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-result__icon {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-result__icon svg {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-result__icon--emoji {
|
||||||
|
font-size: 16px;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
.omnisearch-input-container {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-input-container__buttons {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 1em 0 1em;
|
||||||
|
gap: 1em;
|
||||||
|
}
|
||||||
|
.omnisearch-input-container__buttons > button {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (min-width: 600px) {
|
||||||
|
.omnisearch-input-container__buttons {
|
||||||
|
margin-inline-end: 1em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-input-field {
|
||||||
|
position: relative;
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
@@ -0,0 +1,553 @@
|
|||||||
|
{
|
||||||
|
"lightStyle": "oxygen-light",
|
||||||
|
"darkStyle": "oxygen-dark",
|
||||||
|
"lightScheme": "oxygen-oxygen-light",
|
||||||
|
"darkScheme": "oxygen-oxygen-dark",
|
||||||
|
"editorFont": "",
|
||||||
|
"lineHeight": 1.5,
|
||||||
|
"lineWidth": 40,
|
||||||
|
"lineWidthWide": 50,
|
||||||
|
"maxWidth": 88,
|
||||||
|
"textNormal": 16,
|
||||||
|
"textSmall": 13,
|
||||||
|
"imgGrid": true,
|
||||||
|
"imgWidth": "img-default-width",
|
||||||
|
"tableWidth": "table-default-width",
|
||||||
|
"iframeWidth": "iframe-default-width",
|
||||||
|
"mapWidth": "map-default-width",
|
||||||
|
"chartWidth": "chart-default-width",
|
||||||
|
"colorfulHeadings": false,
|
||||||
|
"colorfulFrame": false,
|
||||||
|
"colorfulActiveStates": false,
|
||||||
|
"trimNames": true,
|
||||||
|
"labeledNav": false,
|
||||||
|
"fullWidthMedia": true,
|
||||||
|
"workspaceBorders": "enhanced",
|
||||||
|
"minimalStatus": true,
|
||||||
|
"underlineInternal": true,
|
||||||
|
"underlineExternal": true,
|
||||||
|
"folding": true,
|
||||||
|
"lineNumbers": false,
|
||||||
|
"readableLineLength": true,
|
||||||
|
"devBlockWidth": false,
|
||||||
|
"customPresets": [
|
||||||
|
{
|
||||||
|
"id": "discord",
|
||||||
|
"name": "Discord",
|
||||||
|
"author": "David V. Kimball",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"light": {
|
||||||
|
"base": {
|
||||||
|
"h": 0,
|
||||||
|
"s": 0,
|
||||||
|
"l": 98
|
||||||
|
},
|
||||||
|
"accent": {
|
||||||
|
"h": 235,
|
||||||
|
"s": 86,
|
||||||
|
"l": 65
|
||||||
|
},
|
||||||
|
"colors": {
|
||||||
|
"bg1": "#fbfbfb",
|
||||||
|
"bg2": "#f3f3f4",
|
||||||
|
"bg3": "#ffffff"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dark": {
|
||||||
|
"base": {
|
||||||
|
"h": 240,
|
||||||
|
"s": 6,
|
||||||
|
"l": 7
|
||||||
|
},
|
||||||
|
"accent": {
|
||||||
|
"h": 235,
|
||||||
|
"s": 86,
|
||||||
|
"l": 65
|
||||||
|
},
|
||||||
|
"colors": {
|
||||||
|
"bg1": "#1a1a1e",
|
||||||
|
"bg2": "#121214",
|
||||||
|
"ui3": "#222327"
|
||||||
|
},
|
||||||
|
"frameLightnessOffset": -5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"enableCustomPresets": true,
|
||||||
|
"navIndentationGuideWidth": "0px",
|
||||||
|
"navIndentationGuideColor": "rgba(var(--mono-rgb-100), 0.12)",
|
||||||
|
"animationPersonality": "default",
|
||||||
|
"animationSpeed": 0.7,
|
||||||
|
"enableBlur": false,
|
||||||
|
"useDefaultFolderIcon": false,
|
||||||
|
"focusMode": false,
|
||||||
|
"deemphasizeProperties": false,
|
||||||
|
"autoHideTabBarWhenSingleTab": false,
|
||||||
|
"hideTitleBarOnHover": false,
|
||||||
|
"hideTabs": false,
|
||||||
|
"hideStatus": false,
|
||||||
|
"hideScroll": false,
|
||||||
|
"hideSidebarButtons": false,
|
||||||
|
"hideLeftSidebarButton": false,
|
||||||
|
"hideRightSidebarButton": false,
|
||||||
|
"hideTooltips": false,
|
||||||
|
"hideFileNavButtons": false,
|
||||||
|
"hideSearchSuggestions": false,
|
||||||
|
"hideSearchCounts": false,
|
||||||
|
"hideInstructions": false,
|
||||||
|
"hidePropertiesReading": true,
|
||||||
|
"hideVault": false,
|
||||||
|
"hidePropertiesHeading": true,
|
||||||
|
"hideAddPropertyButton": true,
|
||||||
|
"autoHideVaultSwitcher": true,
|
||||||
|
"autoHideVaultSwitcherBgTransparency": 1,
|
||||||
|
"hideHelpButton": false,
|
||||||
|
"autoHideSettingsButton": false,
|
||||||
|
"collapseFileExplorerButtons": true,
|
||||||
|
"autoHideFileExplorerNavHeader": false,
|
||||||
|
"autoHideOtherNavHeaders": false,
|
||||||
|
"autoHideLeftTabHeaders": false,
|
||||||
|
"autoHideRightTabHeaders": false,
|
||||||
|
"collapseOtherNavHeaders": false,
|
||||||
|
"autoCollapseRibbon": false,
|
||||||
|
"hideButtonNewNote": false,
|
||||||
|
"hideButtonNewFolder": false,
|
||||||
|
"hideButtonSortOrder": false,
|
||||||
|
"hideButtonAutoReveal": false,
|
||||||
|
"hideButtonCollapseAll": false,
|
||||||
|
"hideButtonReadingMode": false,
|
||||||
|
"hideButtonSearchSettings": false,
|
||||||
|
"hideTabListIcon": false,
|
||||||
|
"hideNewTabIcon": false,
|
||||||
|
"hideTabCloseButton": false,
|
||||||
|
"hideIconMobileChevrons": false,
|
||||||
|
"hideButtonMobileNavbarActionBack": false,
|
||||||
|
"hideButtonMobileNavbarActionForward": false,
|
||||||
|
"hideButtonMobileNavbarActionQuickSwitcher": false,
|
||||||
|
"hideButtonMobileNavbarActionNewTab": false,
|
||||||
|
"hideButtonMobileNavbarActionTabs": false,
|
||||||
|
"hideButtonMobileNavbarActionMenu": false,
|
||||||
|
"swapMobileNewTabIcon": false,
|
||||||
|
"orderNavbarButton1": "order-navbar-button-nth-child-1-1",
|
||||||
|
"orderNavbarButton2": "order-navbar-button-nth-child-2-2",
|
||||||
|
"orderNavbarButton3": "order-navbar-button-nth-child-3-3",
|
||||||
|
"orderNavbarButton4": "order-navbar-button-nth-child-4-4",
|
||||||
|
"orderNavbarButton5": "order-navbar-button-nth-child-5-5",
|
||||||
|
"orderNavbarButton6": "order-navbar-button-nth-child-6-6",
|
||||||
|
"helpButtonReplacement": {
|
||||||
|
"enabled": false,
|
||||||
|
"commandId": "oxygen-settings:oxygen-settings:open-settings",
|
||||||
|
"iconId": "lucide-settings-2"
|
||||||
|
},
|
||||||
|
"autoHideVaultSwitcherTransparency": 0,
|
||||||
|
"zenMode": false,
|
||||||
|
"zenModeFullscreen": false,
|
||||||
|
"zenModeLeftSidebar": true,
|
||||||
|
"zenModeRightSidebar": true,
|
||||||
|
"bordersToggle": false,
|
||||||
|
"workspaceBordersEnhanced": true,
|
||||||
|
"keepTabBorders": false,
|
||||||
|
"autoHideScrollbars": false,
|
||||||
|
"statusBarStyle": "status-bar-default",
|
||||||
|
"uiHoverReveal": false,
|
||||||
|
"uiHoverRevealViewHeaderLeft": false,
|
||||||
|
"uiHoverRevealViewActions": false,
|
||||||
|
"uiHoverRevealSidebarToggleLeft": false,
|
||||||
|
"uiHoverRevealSidebarToggleRight": false,
|
||||||
|
"uiHoverRevealOpacity": 50,
|
||||||
|
"focusModeEnhanced": false,
|
||||||
|
"focusModeOpacity": 50,
|
||||||
|
"focusViewHeaderOpacity": 50,
|
||||||
|
"focusHideViewHeaderLeft": false,
|
||||||
|
"focusHideViewActions": false,
|
||||||
|
"focusHideSidebarToggleButtons": false,
|
||||||
|
"scrollbarHide": false,
|
||||||
|
"interfaceFont": "",
|
||||||
|
"densityModifier": 1,
|
||||||
|
"radiusModifier": 1,
|
||||||
|
"iconStrokeModifier": 1,
|
||||||
|
"layoutStyle": "minimal",
|
||||||
|
"elementStyle": "minimal",
|
||||||
|
"mobileStyle": "stable",
|
||||||
|
"tabTitleFontSize": "0.9em",
|
||||||
|
"tabTitleFontWeight": 400,
|
||||||
|
"tabTitleAlignment": "center",
|
||||||
|
"headerHeight": "40px",
|
||||||
|
"fileHeaderVisibility": "minimal-tab-title-hover",
|
||||||
|
"sidebarActiveFileStyle": "subtle",
|
||||||
|
"sidebarColorfulFolders": "none",
|
||||||
|
"sidebarItemNameSize": "13px",
|
||||||
|
"sidebarLargeNewNoteButton": false,
|
||||||
|
"sidebarFullItemName": false,
|
||||||
|
"sidebarBoldFolders": false,
|
||||||
|
"sidebarAlwaysShowVaultSwitcher": false,
|
||||||
|
"indentationGuidesThickness": "thin",
|
||||||
|
"indentationGuidesColor": "subtle",
|
||||||
|
"windowFrameOpacity": 100,
|
||||||
|
"windowFrameInvertColors": false,
|
||||||
|
"windowTitleOff": false,
|
||||||
|
"frameBackgroundLight": "",
|
||||||
|
"frameBackgroundDark": "",
|
||||||
|
"frameIconColorLight": "",
|
||||||
|
"frameIconColorDark": "",
|
||||||
|
"titlebarTextColorFocusedLight": "",
|
||||||
|
"titlebarTextColorFocusedDark": "",
|
||||||
|
"titlebarTextColorLight": "",
|
||||||
|
"titlebarTextColorDark": "",
|
||||||
|
"titlebarTextWeight": 600,
|
||||||
|
"tabletLeftSidebarWidth": "",
|
||||||
|
"tabletRightSidebarWidth": "",
|
||||||
|
"tabletLeftSidebarWidthPinned": "",
|
||||||
|
"tabletRightSidebarWidthPinned": "",
|
||||||
|
"monospaceFont": "",
|
||||||
|
"boldTextModifier": 200,
|
||||||
|
"focusView": false,
|
||||||
|
"disableQuickModeSwitcher": false,
|
||||||
|
"activeLineStyle": "none",
|
||||||
|
"activeLineColor": "monochrome",
|
||||||
|
"activeLineBackgroundColorLight": "",
|
||||||
|
"activeLineBackgroundColorDark": "",
|
||||||
|
"normalLineWidth": "",
|
||||||
|
"wideLineWidth": "",
|
||||||
|
"basesWidth": "default",
|
||||||
|
"imageWidth": "default",
|
||||||
|
"mapWidthNew": "default",
|
||||||
|
"chartWidthNew": "default",
|
||||||
|
"editorIndentationThickness": "none",
|
||||||
|
"editorIndentationColor": "subtle",
|
||||||
|
"editorIndentationGuideColorLight": "",
|
||||||
|
"editorIndentationGuideColorDark": "",
|
||||||
|
"editorIndentationGuideColorActiveLight": "",
|
||||||
|
"editorIndentationGuideColorActiveDark": "",
|
||||||
|
"propertiesStyle": "default",
|
||||||
|
"propertiesHideHeading": false,
|
||||||
|
"propertiesHideAddButton": false,
|
||||||
|
"propertiesHideIcons": false,
|
||||||
|
"propertiesDisableLinkWrap": false,
|
||||||
|
"propertiesNameWidth": 1,
|
||||||
|
"headingSpacing": "",
|
||||||
|
"paragraphSpacing": "",
|
||||||
|
"readableSpacing": false,
|
||||||
|
"readableSpacingModifier": 0.25,
|
||||||
|
"pSpacing": "",
|
||||||
|
"inlineTitleDisableBackground": false,
|
||||||
|
"inlineTitleFont": "",
|
||||||
|
"inlineTitleFontSize": "",
|
||||||
|
"inlineTitleFontWeight": 600,
|
||||||
|
"inlineTitleColorLight": "",
|
||||||
|
"inlineTitleColorDark": "",
|
||||||
|
"h1ColorLight": "",
|
||||||
|
"h1ColorDark": "",
|
||||||
|
"h1Font": "",
|
||||||
|
"h1Size": "",
|
||||||
|
"h1Weight": 600,
|
||||||
|
"h1Variant": "normal",
|
||||||
|
"h1Style": "normal",
|
||||||
|
"h1Transform": "normal",
|
||||||
|
"h1DividerLine": false,
|
||||||
|
"h2ColorLight": "",
|
||||||
|
"h2ColorDark": "",
|
||||||
|
"h2Font": "",
|
||||||
|
"h2Size": "",
|
||||||
|
"h2Weight": 600,
|
||||||
|
"h2Variant": "normal",
|
||||||
|
"h2Style": "normal",
|
||||||
|
"h2Transform": "normal",
|
||||||
|
"h2DividerLine": false,
|
||||||
|
"h3ColorLight": "",
|
||||||
|
"h3ColorDark": "",
|
||||||
|
"h3Font": "",
|
||||||
|
"h3Size": "",
|
||||||
|
"h3Weight": 600,
|
||||||
|
"h3Variant": "normal",
|
||||||
|
"h3Style": "normal",
|
||||||
|
"h3Transform": "normal",
|
||||||
|
"h3DividerLine": false,
|
||||||
|
"h4ColorLight": "",
|
||||||
|
"h4ColorDark": "",
|
||||||
|
"h4Font": "",
|
||||||
|
"h4Size": "",
|
||||||
|
"h4Weight": 500,
|
||||||
|
"h4Variant": "normal",
|
||||||
|
"h4Style": "normal",
|
||||||
|
"h4Transform": "normal",
|
||||||
|
"h4DividerLine": false,
|
||||||
|
"h5ColorLight": "",
|
||||||
|
"h5ColorDark": "",
|
||||||
|
"h5Font": "",
|
||||||
|
"h5Size": "",
|
||||||
|
"h5Weight": 500,
|
||||||
|
"h5Variant": "normal",
|
||||||
|
"h5Style": "normal",
|
||||||
|
"h5Transform": "normal",
|
||||||
|
"h5DividerLine": false,
|
||||||
|
"h6ColorLight": "",
|
||||||
|
"h6ColorDark": "",
|
||||||
|
"h6Font": "",
|
||||||
|
"h6Size": "",
|
||||||
|
"h6Weight": 400,
|
||||||
|
"h6Variant": "normal",
|
||||||
|
"h6Style": "normal",
|
||||||
|
"h6Transform": "normal",
|
||||||
|
"h6DividerLine": false,
|
||||||
|
"headingsColorfulText": false,
|
||||||
|
"headingsColorfulIndicator": false,
|
||||||
|
"headingsColorfulBackground": false,
|
||||||
|
"headingsColorfulFullWidth": false,
|
||||||
|
"horizontalRuleWidth": "",
|
||||||
|
"horizontalRuleThickness": 2,
|
||||||
|
"horizontalRuleAlignment": "start",
|
||||||
|
"horizontalRuleDashed": false,
|
||||||
|
"horizontalRuleDashedLineSize": "",
|
||||||
|
"horizontalRuleDashedLineSpacing": "",
|
||||||
|
"bannerDisabled": false,
|
||||||
|
"bannerImageHeight": "",
|
||||||
|
"bannerImageHeightSmall": "",
|
||||||
|
"bannerImageSideSpacing": "",
|
||||||
|
"bannerImageRadius": 8,
|
||||||
|
"bannerImageFit": "cover",
|
||||||
|
"bannerImageFadeOffset": "",
|
||||||
|
"bannerIconSize": "",
|
||||||
|
"bannerToContentOffset": "",
|
||||||
|
"blockquotesStyle": "default",
|
||||||
|
"blockquotesBorderThickness": 1,
|
||||||
|
"blockquotesFontSize": "",
|
||||||
|
"blockquotesTextColorLight": "",
|
||||||
|
"blockquotesTextColorDark": "",
|
||||||
|
"blockquotesBackgroundColorLight": "",
|
||||||
|
"blockquotesBackgroundColorDark": "",
|
||||||
|
"blockquotesBorderColorLight": "",
|
||||||
|
"blockquotesBorderColorDark": "",
|
||||||
|
"calloutsStyle": "filled",
|
||||||
|
"calloutsBlendMode": "normal",
|
||||||
|
"calloutsFontSize": "",
|
||||||
|
"codeBlocksStyle": "filled",
|
||||||
|
"codeBlocksFontSize": "",
|
||||||
|
"codeBlocksLineNumbers": false,
|
||||||
|
"codeBlocksScrollLongLines": false,
|
||||||
|
"codeBackgroundColorLight": "",
|
||||||
|
"codeBackgroundColorDark": "",
|
||||||
|
"codeTextColorLight": "",
|
||||||
|
"codeTextColorDark": "",
|
||||||
|
"codeCommentColorLight": "",
|
||||||
|
"codeCommentColorDark": "",
|
||||||
|
"codeFunctionColorLight": "",
|
||||||
|
"codeFunctionColorDark": "",
|
||||||
|
"codeKeywordColorLight": "",
|
||||||
|
"codeKeywordColorDark": "",
|
||||||
|
"codeImportantColorLight": "",
|
||||||
|
"codeImportantColorDark": "",
|
||||||
|
"codeOperatorColorLight": "",
|
||||||
|
"codeOperatorColorDark": "",
|
||||||
|
"codePropertyColorLight": "",
|
||||||
|
"codePropertyColorDark": "",
|
||||||
|
"codePunctuationColorLight": "",
|
||||||
|
"codePunctuationColorDark": "",
|
||||||
|
"codeStringColorLight": "",
|
||||||
|
"codeStringColorDark": "",
|
||||||
|
"codeTagColorLight": "",
|
||||||
|
"codeTagColorDark": "",
|
||||||
|
"codeValueColorLight": "",
|
||||||
|
"codeValueColorDark": "",
|
||||||
|
"embedsStyle": "clean",
|
||||||
|
"embedsBorderThickness": 2,
|
||||||
|
"embedsHideTitles": false,
|
||||||
|
"embedsMaxHeight": "",
|
||||||
|
"embedsStrict": false,
|
||||||
|
"embedsUnderline": false,
|
||||||
|
"embedsDecorationStyle": "solid",
|
||||||
|
"embedsDecorationColorLight": "",
|
||||||
|
"embedsDecorationColorDark": "",
|
||||||
|
"embedsBackgroundLight": "",
|
||||||
|
"embedsBackgroundDark": "",
|
||||||
|
"mediaRadius": 8,
|
||||||
|
"mediaOpacityDark": 1,
|
||||||
|
"mediaDisableMaximized": false,
|
||||||
|
"mediaDisableZoom": false,
|
||||||
|
"imageBlendLight": false,
|
||||||
|
"imageGridFit": "cover",
|
||||||
|
"imageGridBackgroundLight": "",
|
||||||
|
"imageGridBackgroundDark": "",
|
||||||
|
"pdfsPageStyle": "seamless",
|
||||||
|
"pdfsOpacityDark": 1,
|
||||||
|
"pdfsInvertDark": false,
|
||||||
|
"basesToolbarLabel": "visible",
|
||||||
|
"basesToolbarOpacity": 1,
|
||||||
|
"basesTableRowHeight": 30,
|
||||||
|
"basesStripedRows": false,
|
||||||
|
"basesStripedColumns": false,
|
||||||
|
"basesTableHeaderIcons": "visible",
|
||||||
|
"basesTableVerticalAlignment": "top",
|
||||||
|
"canvasBackgroundColor": "",
|
||||||
|
"canvasDotPatternColor": "",
|
||||||
|
"iconMuted": 0.5,
|
||||||
|
"iconColorLight": "",
|
||||||
|
"iconColorDark": "",
|
||||||
|
"iconColorHoverLight": "",
|
||||||
|
"iconColorHoverDark": "",
|
||||||
|
"iconColorActiveLight": "",
|
||||||
|
"iconColorActiveDark": "",
|
||||||
|
"iconColorFocusedLight": "",
|
||||||
|
"iconColorFocusedDark": "",
|
||||||
|
"graphLineColorLight": "",
|
||||||
|
"graphLineColorDark": "",
|
||||||
|
"graphNodeColorLight": "",
|
||||||
|
"graphNodeColorDark": "",
|
||||||
|
"graphNodeFocusedColorLight": "",
|
||||||
|
"graphNodeFocusedColorDark": "",
|
||||||
|
"graphNodeTagColorLight": "",
|
||||||
|
"graphNodeTagColorDark": "",
|
||||||
|
"graphNodeAttachmentColorLight": "",
|
||||||
|
"graphNodeAttachmentColorDark": "",
|
||||||
|
"graphNodeUnresolvedColorLight": "",
|
||||||
|
"graphNodeUnresolvedColorDark": "",
|
||||||
|
"dataviewTrimCols": false,
|
||||||
|
"dataviewInlineLists": false,
|
||||||
|
"dataviewMaxColWidth": "",
|
||||||
|
"linksInternalUnderline": "underline",
|
||||||
|
"linksExternalUnderline": "underline",
|
||||||
|
"linkColorLight": "",
|
||||||
|
"linkColorDark": "",
|
||||||
|
"linkColorHoverLight": "",
|
||||||
|
"linkColorHoverDark": "",
|
||||||
|
"linkUnresolvedColorLight": "",
|
||||||
|
"linkUnresolvedColorDark": "",
|
||||||
|
"linkUnresolvedDecorationColorLight": "",
|
||||||
|
"linkUnresolvedDecorationColorDark": "",
|
||||||
|
"linkUnresolvedOpacity": 0.5,
|
||||||
|
"linkExternalColorLight": "",
|
||||||
|
"linkExternalColorDark": "",
|
||||||
|
"linkExternalColorHoverLight": "",
|
||||||
|
"linkExternalColorHoverDark": "",
|
||||||
|
"listsSpacing": 0.075,
|
||||||
|
"listsIndent": 2,
|
||||||
|
"listsBulletColorLight": "",
|
||||||
|
"listsBulletColorDark": "",
|
||||||
|
"listsOrderedStyle": "decimal",
|
||||||
|
"listsDisableStrikeTasks": false,
|
||||||
|
"tablesFontSize": "",
|
||||||
|
"tablesRowLines": false,
|
||||||
|
"tablesColumnLines": false,
|
||||||
|
"tablesFrame": false,
|
||||||
|
"tablesStripedRows": false,
|
||||||
|
"tablesStripedColumns": false,
|
||||||
|
"tablesTabularFigures": false,
|
||||||
|
"tablesRowNumbers": false,
|
||||||
|
"tablesFitContentWidth": false,
|
||||||
|
"tablesDisableLineWrap": false,
|
||||||
|
"tablesHeaderAlignment": "start",
|
||||||
|
"tablesBodyAlignment": "start",
|
||||||
|
"tablesHighlightActiveRow": false,
|
||||||
|
"tableColumnMinWidth": "",
|
||||||
|
"tableColumnMaxWidth": "",
|
||||||
|
"maximizeTables": "maximize-tables-off",
|
||||||
|
"tableCenter": false,
|
||||||
|
"tableRowBackgroundHoverLight": "",
|
||||||
|
"tableRowBackgroundHoverDark": "",
|
||||||
|
"tagsPlain": false,
|
||||||
|
"tagsShape": "pill",
|
||||||
|
"tagsBorderWidth": 0,
|
||||||
|
"tagColorLight": "",
|
||||||
|
"tagColorDark": "",
|
||||||
|
"tagBackgroundColorLight": "",
|
||||||
|
"tagBackgroundColorDark": "",
|
||||||
|
"tagBorderColorLight": "",
|
||||||
|
"tagBorderColorDark": "",
|
||||||
|
"tasksCheckboxColorLight": "",
|
||||||
|
"tasksCheckboxColorDark": "",
|
||||||
|
"tasksCheckboxShape": "rounded",
|
||||||
|
"ribbonStyle": "ribbon-hidden",
|
||||||
|
"tabsStyle": "tabs-default",
|
||||||
|
"tabTextColorLight": "",
|
||||||
|
"tabTextColorDark": "",
|
||||||
|
"tabTextColorActiveLight": "",
|
||||||
|
"tabTextColorActiveDark": "",
|
||||||
|
"tabStackedPaneWidth": 700,
|
||||||
|
"tabStackedHeaderWidth": 40,
|
||||||
|
"tabStackedSpineOrientation": "tab-stack-top",
|
||||||
|
"tabStackedSpineOrder": "row",
|
||||||
|
"textFormattingColorLight": "",
|
||||||
|
"textFormattingColorDark": "",
|
||||||
|
"italicColorLight": "",
|
||||||
|
"italicColorDark": "",
|
||||||
|
"boldColorLight": "",
|
||||||
|
"boldColorDark": "",
|
||||||
|
"titleColorLight": "",
|
||||||
|
"titleColorDark": "",
|
||||||
|
"titleColorInactiveLight": "",
|
||||||
|
"titleColorInactiveDark": "",
|
||||||
|
"workspaceBackgroundTranslucentLight": "",
|
||||||
|
"workspaceBackgroundTranslucentDark": "",
|
||||||
|
"cardsMinWidth": "",
|
||||||
|
"cardsMaxWidth": "",
|
||||||
|
"cardsMobileWidth": "",
|
||||||
|
"cardsPadding": "",
|
||||||
|
"cardsImageHeight": "",
|
||||||
|
"cardsBorderWidth": "",
|
||||||
|
"cardsBackgroundLight": "",
|
||||||
|
"cardsBackgroundDark": "",
|
||||||
|
"cardsBackgroundHoverLight": "",
|
||||||
|
"cardsBackgroundHoverDark": "",
|
||||||
|
"hideMarkdown": false,
|
||||||
|
"hideSettingsDesc": false,
|
||||||
|
"cursor": "default",
|
||||||
|
"baseColorLight": "",
|
||||||
|
"baseColorDark": "",
|
||||||
|
"bg1Light": "",
|
||||||
|
"bg1Dark": "",
|
||||||
|
"bg2Light": "",
|
||||||
|
"bg2Dark": "",
|
||||||
|
"bg3Light": "",
|
||||||
|
"bg3Dark": "",
|
||||||
|
"ui1Light": "",
|
||||||
|
"ui1Dark": "",
|
||||||
|
"ui2Light": "",
|
||||||
|
"ui2Dark": "",
|
||||||
|
"ui3Light": "",
|
||||||
|
"ui3Dark": "",
|
||||||
|
"ax1Light": "",
|
||||||
|
"ax1Dark": "",
|
||||||
|
"ax2Light": "",
|
||||||
|
"ax2Dark": "",
|
||||||
|
"ax3Light": "",
|
||||||
|
"ax3Dark": "",
|
||||||
|
"sp1Light": "",
|
||||||
|
"sp1Dark": "",
|
||||||
|
"tx1Light": "",
|
||||||
|
"tx1Dark": "",
|
||||||
|
"tx2Light": "",
|
||||||
|
"tx2Dark": "",
|
||||||
|
"tx3Light": "",
|
||||||
|
"tx3Dark": "",
|
||||||
|
"hl1Light": "",
|
||||||
|
"hl1Dark": "",
|
||||||
|
"hl2Light": "",
|
||||||
|
"hl2Dark": "",
|
||||||
|
"colorRedLight": "",
|
||||||
|
"colorRedDark": "",
|
||||||
|
"colorOrangeLight": "",
|
||||||
|
"colorOrangeDark": "",
|
||||||
|
"colorYellowLight": "",
|
||||||
|
"colorYellowDark": "",
|
||||||
|
"colorGreenLight": "",
|
||||||
|
"colorGreenDark": "",
|
||||||
|
"colorCyanLight": "",
|
||||||
|
"colorCyanDark": "",
|
||||||
|
"colorBlueLight": "",
|
||||||
|
"colorBlueDark": "",
|
||||||
|
"colorPurpleLight": "",
|
||||||
|
"colorPurpleDark": "",
|
||||||
|
"colorPinkLight": "",
|
||||||
|
"colorPinkDark": "",
|
||||||
|
"foldingOffset": 32,
|
||||||
|
"gutterBackgroundLight": "",
|
||||||
|
"gutterBackgroundDark": "",
|
||||||
|
"lineNumberColorLight": "",
|
||||||
|
"lineNumberColorDark": "",
|
||||||
|
"lineNumberColorActiveLight": "",
|
||||||
|
"lineNumberColorActiveDark": "",
|
||||||
|
"dashedUnderlineInternal": false,
|
||||||
|
"_migrationVersions": [
|
||||||
|
"minimal-to-oxygen-prefix-v1"
|
||||||
|
]
|
||||||
|
}
|
||||||
+3611
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
|||||||
|
{"id":"oxygen-settings","name":"Oxygen Theme Settings","version":"0.3.8","minAppVersion":"1.11.0","description":"Configure advanced customization options in Oxygen Theme.","author":"David V. Kimball","authorUrl":"https://davidvkimball.com","fundingUrl":"https://patreon.com/davidvkimball","isDesktopOnly":false}
|
||||||
@@ -0,0 +1,764 @@
|
|||||||
|
/* ========================================
|
||||||
|
Oxygen Settings Plugin Styles
|
||||||
|
======================================== */
|
||||||
|
|
||||||
|
/* ========================================
|
||||||
|
Preset Editor Modal Styles
|
||||||
|
======================================== */
|
||||||
|
|
||||||
|
.preset-editor-modal .modal-content {
|
||||||
|
max-height: 70vh;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-section {
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-section {
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
padding-bottom: 1.5rem;
|
||||||
|
border-bottom: 1px solid var(--background-modifier-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-section:last-of-type {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-section h3 {
|
||||||
|
color: var(--text-normal);
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-section {
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preset-editor-modal .color-section h3 {
|
||||||
|
color: var(--text-normal) !important;
|
||||||
|
margin-bottom: 0.75rem;
|
||||||
|
font-size: 0.95rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-group {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-group label {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapsible-item {
|
||||||
|
padding-left: 0;
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-override {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.75rem;
|
||||||
|
margin-bottom: 0.75rem;
|
||||||
|
padding-left: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.override-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.5rem;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-input-wrapper {
|
||||||
|
width: 2rem;
|
||||||
|
height: 2rem;
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-preview-swatch {
|
||||||
|
transition: opacity 0.2s ease, border-color 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-preview-swatch:hover {
|
||||||
|
border-color: var(--text-muted) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Dim the color preview when the input is disabled */
|
||||||
|
.color-input-wrapper:has(input:disabled) .color-preview-swatch {
|
||||||
|
opacity: 0.5;
|
||||||
|
cursor: not-allowed !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-tabs {
|
||||||
|
display: flex;
|
||||||
|
border-bottom: 1px solid var(--background-modifier-border);
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-tab {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
cursor: pointer;
|
||||||
|
border-bottom: 2px solid transparent;
|
||||||
|
color: var(--text-muted);
|
||||||
|
font-size: 0.9rem;
|
||||||
|
transition: color 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-tab:hover {
|
||||||
|
color: var(--text-normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-tab.active {
|
||||||
|
color: var(--text-normal);
|
||||||
|
border-bottom-color: var(--text-accent);
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-content {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-content.active {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-section {
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-group {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-group label {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hsl-controls {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr 1fr auto;
|
||||||
|
gap: 1rem;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hsl-control {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hsl-control label {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hsl-control input[type="range"] {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hsl-control span {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: var(--text-muted);
|
||||||
|
min-width: 2rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preset-editor-modal .color-preview {
|
||||||
|
width: 2rem;
|
||||||
|
height: 2rem;
|
||||||
|
border-radius: 3px;
|
||||||
|
border: 1px solid var(--background-modifier-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-preview-section {
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-preview-section h4 {
|
||||||
|
margin: 0 0 1rem 0;
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-details-section {
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-details-section h4 {
|
||||||
|
margin: 0 0 1rem 0;
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapsible-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
cursor: default;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapsible-header h4 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--text-normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapse-toggle {
|
||||||
|
background: none !important;
|
||||||
|
border: none !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
color: var(--text-muted);
|
||||||
|
cursor: default;
|
||||||
|
padding: 0 !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
width: 20px !important;
|
||||||
|
height: 20px !important;
|
||||||
|
outline: none !important;
|
||||||
|
font-family: inherit;
|
||||||
|
display: flex !important;
|
||||||
|
align-items: center !important;
|
||||||
|
justify-content: center !important;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapse-toggle:hover {
|
||||||
|
color: var(--text-normal);
|
||||||
|
box-shadow: none !important;
|
||||||
|
background: none !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapse-toggle:focus {
|
||||||
|
outline: none !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
background: none !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapse-toggle:active {
|
||||||
|
box-shadow: none !important;
|
||||||
|
background: none !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapse-toggle svg {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
stroke-width: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapsible-content {
|
||||||
|
transition: max-height 0.3s ease;
|
||||||
|
overflow: hidden;
|
||||||
|
max-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapsible-content:not(.collapsed) {
|
||||||
|
max-height: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.override-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.75rem;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-swatch {
|
||||||
|
border: 1px solid var(--background-modifier-border);
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 1rem;
|
||||||
|
background: var(--background-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-row {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-row:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-label {
|
||||||
|
font-weight: 500;
|
||||||
|
min-width: 5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-colors {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-color {
|
||||||
|
width: 2rem;
|
||||||
|
height: 2rem;
|
||||||
|
border-radius: 3px;
|
||||||
|
border: 1px solid var(--background-modifier-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 1rem;
|
||||||
|
margin-top: 1.5rem;
|
||||||
|
padding-top: 1rem;
|
||||||
|
border-top: 1px solid var(--background-modifier-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-footer button {
|
||||||
|
min-width: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ========================================
|
||||||
|
Preset Import Modal Styles
|
||||||
|
======================================== */
|
||||||
|
|
||||||
|
.preset-import-modal .modal-content {
|
||||||
|
max-height: 80vh;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preset-json-input {
|
||||||
|
height: 200px !important;
|
||||||
|
font-family: monospace !important;
|
||||||
|
font-size: 0.9rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-container {
|
||||||
|
border: 1px solid var(--background-modifier-border);
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 1rem;
|
||||||
|
background: var(--background-primary);
|
||||||
|
min-height: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-placeholder,
|
||||||
|
.preview-error {
|
||||||
|
color: var(--text-muted);
|
||||||
|
font-style: italic;
|
||||||
|
text-align: center;
|
||||||
|
margin: 2rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-error {
|
||||||
|
color: var(--text-error);
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-section {
|
||||||
|
background: var(--background-modifier-error);
|
||||||
|
border: 1px solid var(--text-error);
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 1rem;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-message {
|
||||||
|
color: var(--text-error);
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preset-info {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-row {
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preset-id {
|
||||||
|
font-family: monospace;
|
||||||
|
background: var(--background-secondary);
|
||||||
|
padding: 0.2rem 0.4rem;
|
||||||
|
border-radius: 3px;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-toggle {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.5rem;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
border-bottom: 1px solid var(--background-modifier-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-btn {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
cursor: pointer;
|
||||||
|
border-bottom: 2px solid transparent;
|
||||||
|
color: var(--text-muted);
|
||||||
|
font-size: 0.9rem;
|
||||||
|
transition: color 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-btn:hover {
|
||||||
|
color: var(--text-normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-btn.active {
|
||||||
|
color: var(--text-normal);
|
||||||
|
border-bottom-color: var(--text-accent);
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swatch-container {
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-swatches {
|
||||||
|
display: none;
|
||||||
|
gap: 1rem;
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-swatches.active {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-swatch {
|
||||||
|
width: 3rem;
|
||||||
|
height: 3rem;
|
||||||
|
border-radius: 6px;
|
||||||
|
border: 1px solid var(--background-modifier-border);
|
||||||
|
cursor: pointer;
|
||||||
|
transition: transform 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-swatch:hover {
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.mode-details {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-details h5 {
|
||||||
|
margin: 0 0 0.5rem 0;
|
||||||
|
color: var(--text-normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-detail {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.5rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-swatch {
|
||||||
|
width: 1.5rem;
|
||||||
|
height: 1.5rem;
|
||||||
|
border-radius: 3px;
|
||||||
|
border: 1px solid var(--background-modifier-border);
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-detail span:first-of-type {
|
||||||
|
color: var(--text-muted);
|
||||||
|
min-width: 3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.overrides-info {
|
||||||
|
margin-top: 1rem;
|
||||||
|
padding: 0.5rem;
|
||||||
|
background: var(--background-secondary);
|
||||||
|
border-radius: 3px;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ========================================
|
||||||
|
Settings Tab Styles
|
||||||
|
======================================== */
|
||||||
|
|
||||||
|
.custom-preset-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0.75rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
border: 1px solid var(--background-modifier-border);
|
||||||
|
border-radius: 6px;
|
||||||
|
background: var(--background-primary);
|
||||||
|
transition: background-color 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-preset-item:hover {
|
||||||
|
background: var(--background-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.preset-info {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.75rem;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preset-details {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preset-name {
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--text-normal);
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preset-author {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-preset-item .setting-item {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: none;
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-preset-item .setting-item-info {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-preset-item .setting-item-control {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.25rem;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-preset-item .clickable-icon {
|
||||||
|
padding: 0.25rem;
|
||||||
|
border-radius: 3px;
|
||||||
|
transition: background-color 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-preset-item .clickable-icon:hover {
|
||||||
|
background: var(--background-modifier-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ========================================
|
||||||
|
Sidebar Indentation Guides
|
||||||
|
======================================== */
|
||||||
|
|
||||||
|
/* The theme already handles indentation guides using --nav-indentation-guide-width and --nav-indentation-guide-color */
|
||||||
|
/* We only need to override when "None" (0px) is selected - make it invisible but keep it for indentation */
|
||||||
|
body.oxygen-theme[style*="--nav-indentation-guide-width: 0px"] .nav-folder-children::before,
|
||||||
|
body.oxygen-theme[style*="--nav-indentation-guide-width:0px"] .nav-folder-children::before {
|
||||||
|
opacity: 0 !important;
|
||||||
|
visibility: hidden !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ========================================
|
||||||
|
Workspace Borders Enhancements
|
||||||
|
======================================== */
|
||||||
|
/* REMOVED: All border CSS has been moved to the theme */
|
||||||
|
/* The plugin should ONLY toggle classes (borders-on, borders-none, oxygen-theme) */
|
||||||
|
/* The theme handles all CSS styling based on these classes */
|
||||||
|
|
||||||
|
|
||||||
|
/* ========================================
|
||||||
|
Inline Style Replacements
|
||||||
|
======================================== */
|
||||||
|
|
||||||
|
/* Preset Editor Modal - Form Input Styles */
|
||||||
|
.frame-label {
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.frame-description {
|
||||||
|
font-size: 0.85em;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.frame-input {
|
||||||
|
width: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Collapsible Sections */
|
||||||
|
.collapsible-content-item {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapsible-content-item.expanded {
|
||||||
|
display: flex !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Preview Color Swatches - use CSS custom properties for dynamic colors */
|
||||||
|
.preview-color {
|
||||||
|
width: 2rem;
|
||||||
|
height: 2rem;
|
||||||
|
border-radius: 3px;
|
||||||
|
border: 1px solid var(--background-modifier-border);
|
||||||
|
background-color: var(--preview-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Color Preview Wrapper */
|
||||||
|
.color-preview-wrapper {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-preview {
|
||||||
|
width: 2rem;
|
||||||
|
height: 2rem;
|
||||||
|
border-radius: 3px;
|
||||||
|
border: 1px solid var(--background-modifier-border);
|
||||||
|
cursor: pointer;
|
||||||
|
background-color: var(--preview-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* HSL Color Input Overlay */
|
||||||
|
.hsl-color-input-overlay {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
opacity: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Color Input Wrapper */
|
||||||
|
.color-input-wrapper {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-preview-swatch {
|
||||||
|
width: 2rem;
|
||||||
|
height: 2rem;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 2px solid var(--background-modifier-border);
|
||||||
|
cursor: pointer;
|
||||||
|
background-color: var(--preview-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Custom Preset ID Display */
|
||||||
|
.preset-id-display {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: var(--text-muted);
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Confirmation Modal Button Container */
|
||||||
|
.modal-button-container {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
justify-content: flex-end;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-button-container .mod-cta.confirm-button {
|
||||||
|
background-color: var(--interactive-accent);
|
||||||
|
color: var(--text-on-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Color Swatch with Dynamic Background */
|
||||||
|
.color-swatch {
|
||||||
|
background-color: hsl(var(--swatch-hsl));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Detail Swatch */
|
||||||
|
.detail-swatch {
|
||||||
|
background-color: hsl(var(--detail-hsl));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Custom Preset Swatch */
|
||||||
|
.custom-preset-swatch {
|
||||||
|
display: inline-block;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
border-radius: 3px;
|
||||||
|
border: 1px solid var(--background-modifier-border);
|
||||||
|
margin-right: 8px;
|
||||||
|
vertical-align: middle;
|
||||||
|
background: linear-gradient(45deg,
|
||||||
|
var(--swatch-gradient-start) 0%,
|
||||||
|
var(--swatch-gradient-mid) 50%,
|
||||||
|
var(--swatch-gradient-end) 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure cmdr buttons are treated the same as nav-action-button */
|
||||||
|
/* This makes cmdr buttons first-class citizens alongside regular nav-action-button elements */
|
||||||
|
body .mod-sidedock .workspace-leaf-content > .nav-header .cmdr.clickable-icon,
|
||||||
|
body .mod-sidedock .workspace-leaf-content > .view-content > .nav-header .cmdr.clickable-icon {
|
||||||
|
/* Inherit nav-action-button styling */
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure cmdr buttons in view-actions are treated the same as regular view-action buttons */
|
||||||
|
/* This makes cmdr buttons in view headers match the normal color of other view-action buttons */
|
||||||
|
/* Override inline styles and ensure they use the same color/opacity as default view-action buttons */
|
||||||
|
body .view-header .view-actions .cmdr.clickable-icon.view-action,
|
||||||
|
body .view-header .view-actions .cmdr-page-header.clickable-icon.view-action {
|
||||||
|
opacity: var(--icon-opacity) !important;
|
||||||
|
color: var(--icon-color) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Also target the SVG inside cmdr buttons to ensure stroke color matches */
|
||||||
|
body .view-header .view-actions .cmdr.clickable-icon.view-action svg,
|
||||||
|
body .view-header .view-actions .cmdr-page-header.clickable-icon.view-action svg {
|
||||||
|
color: var(--icon-color) !important;
|
||||||
|
stroke: currentColor !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ========================================
|
||||||
|
Background Blur Effect
|
||||||
|
======================================== */
|
||||||
|
|
||||||
|
/* Base modal-bg styling - use theme's cover color for proper dimming */
|
||||||
|
/* Opacity is set inline by Obsidian (0.85), we just need to ensure background color is applied */
|
||||||
|
body.oxygen-theme:not(.is-mobile) .modal-bg {
|
||||||
|
background-color: var(--background-modifier-cover) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Apply blur effect to modal background only */
|
||||||
|
/* Only applies on desktop (not mobile) and when Oxygen theme is active */
|
||||||
|
body.oxygen-theme:not(.is-mobile).enable-blur .modal-bg {
|
||||||
|
backdrop-filter: blur(1px) brightness(0.98);
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Scoped to only this plugin's settings container to avoid affecting other plugins */
|
||||||
|
|
||||||
|
|
||||||
|
/* ========================================
|
||||||
|
Colorful Frame Fixes
|
||||||
|
======================================== */
|
||||||
|
|
||||||
|
.colorful-frame .titlebar {
|
||||||
|
background-color: var(--frame-background) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure background applies even without border classes (Enhanced) */
|
||||||
|
body.colorful-frame:not(.borders-on):not(.borders-none) .titlebar {
|
||||||
|
background-color: var(--frame-background) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Fix for "None" borders (removes weird line) */
|
||||||
|
body.colorful-frame.borders-none .workspace-tab-header-container {
|
||||||
|
border: none !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
}
|
||||||
Loaded 100 of 179 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user