vault backup: 2022-06-07 09:34:48

This commit is contained in:
Daniel Bulant 2022-06-07 09:34:48 +02:00
parent 21e6ad9ff8
commit 3b82f33f38
19 changed files with 17821 additions and 166314 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
{ {
"id": "dataview", "id": "dataview",
"name": "Dataview", "name": "Dataview",
"version": "0.4.26", "version": "0.5.28",
"minAppVersion": "0.13.11", "minAppVersion": "0.13.11",
"description": "Complex data views for the data-obsessed.", "description": "Complex data views for the data-obsessed.",
"author": "Michael Brenan <blacksmithgu@gmail.com>", "author": "Michael Brenan <blacksmithgu@gmail.com>",

View file

@ -9,6 +9,10 @@
text-align: left; text-align: left;
} }
.table-view-table > tbody > tr:hover {
background-color: var(--text-selection);
}
.table-view-table > thead > tr > th { .table-view-table > thead > tr > th {
font-weight: 700; font-weight: 700;
font-size: larger; font-size: larger;
@ -28,6 +32,11 @@
max-width: 100%; max-width: 100%;
} }
/** Live Preview padding fixes, specifically for DataviewJS custom HTML elements. */
.is-live-preview .block-language-dataviewjs > p, .is-live-preview .block-language-dataviewjs > span {
line-height: 1.0;
}
/** Rendered value styling for any view. */ /** Rendered value styling for any view. */
.dataview-result-list-root-ul { .dataview-result-list-root-ul {
padding: 0em !important; padding: 0em !important;
@ -39,7 +48,9 @@
padding-left: 8px; padding-left: 8px;
} }
/** Inline Field Rendering. */ /*******************/
/** Inline Fields **/
/*******************/
.dataview.inline-field-key { .dataview.inline-field-key {
border-top-left-radius: 250px; border-top-left-radius: 250px;
@ -69,3 +80,46 @@
background-color: var(--background-secondary-alt); background-color: var(--background-secondary-alt);
color: var(--text-nav-selected); color: var(--text-nav-selected);
} }
/***************/
/** Task View **/
/***************/
.dataview.task-list-item, .dataview.task-list-basic-item {
margin-top: 3px;
margin-bottom: 3px;
transition: 0.4s;
}
.dataview.task-list-item:hover, .dataview.task-list-basic-item:hover {
background-color: var(--text-selection);
box-shadow: -40px 0 0 var(--text-selection);
cursor: pointer;
}
/*****************/
/** Error Views **/
/*****************/
div.dataview-error-box {
width: 100%;
min-height: 150px;
display: flex;
align-items: center;
justify-content: center;
border: 4px dashed var(--background-secondary);
}
.dataview-error-message {
color: var(--text-muted);
text-align: center;
}
/*************************/
/** Additional Metadata **/
/*************************/
.dataview.small-text {
font-size: smaller;
color: var(--text-selection);
}

View file

@ -15,7 +15,7 @@
}, },
"syntaxHighlight": false, "syntaxHighlight": false,
"copyButton": false, "copyButton": false,
"version": "9.0.1", "version": "9.0.3",
"autoCollapse": false, "autoCollapse": false,
"defaultCollapseType": "open", "defaultCollapseType": "open",
"injectColor": true, "injectColor": true,

View file

@ -470,13 +470,13 @@ var c6=Object.create;var X1=Object.defineProperty;var a6=Object.getOwnPropertyDe
`];for(let e of Array.from(this.sheet.cssRules))c.push(e.cssText);return c.join(` `];for(let e of Array.from(this.sheet.cssRules))c.push(e.cssText);return c.join(`
`)}addAdmonition(c){if(!c.icon)return;let e;c.icon.type=="obsidian"?e=`.callout[data-callout="${c.type}"] { `)}addAdmonition(c){if(!c.icon)return;let e,i=c.injectColor??this.plugin.data.injectColor?`--callout-color: ${c.color};`:"";c.icon.type=="obsidian"?e=`.callout[data-callout="${c.type}"] {
--callout-color: ${c.color}; /* RGB Tuple (just like admonitions) */ ${i}
--callout-icon: ${c.icon.name}; /* Icon name from the Obsidian Icon Set */ --callout-icon: ${c.icon.name}; /* Icon name from the Obsidian Icon Set */
}`:e=`.callout[data-callout="${c.type}"] { }`:e=`.callout[data-callout="${c.type}"] {
--callout-color: ${c.color}; ${i}
--callout-icon: '${(this.plugin.iconManager.getIconNode(c.icon)?.outerHTML??"").replace(/(width|height)=(\\?"|')\d+(\\?"|')/g,"")}'; --callout-icon: '${(this.plugin.iconManager.getIconNode(c.icon)?.outerHTML??"").replace(/(width|height)=(\\?"|')\d+(\\?"|')/g,"")}';
}`,this.indexing.contains(c.type)&&this.sheet.deleteRule(this.indexing.indexOf(c.type)),this.indexing=[...this.indexing.filter(i=>i!=c.type),c.type],this.sheet.insertRule(e,this.sheet.cssRules.length),this.updateSnippet()}removeAdmonition(c){if(!this.indexing.contains(c.type))return;let e=this.indexing.indexOf(c.type);this.sheet.deleteRule(e),this.indexing.splice(e,1),this.updateSnippet()}get sheet(){return this.style.sheet}unload(){this.style.detach()}get snippetPath(){return this.plugin.app.customCss.getSnippetPath(this.plugin.data.snippetPath)}setUseSnippet(){this.plugin.data.useSnippet&&this.updateSnippet()}async updateSnippet(){!this.plugin.data.useSnippet||(await this.plugin.app.vault.adapter.exists(this.snippetPath)?await this.plugin.app.vault.adapter.write(this.snippetPath,this.generateCssString()):await this.plugin.app.vault.create(this.snippetPath,this.generateCssString()),this.plugin.app.customCss.setCssEnabledStatus(this.plugin.data.snippetPath,!0),this.plugin.app.customCss.readCssFolders())}};var bb={userAdmonitions:{},syntaxHighlight:!1,copyButton:!1,version:"",autoCollapse:!1,defaultCollapseType:"open",injectColor:!0,parseTitles:!0,dropShadow:!0,hideEmpty:!1,open:{admonitions:!0,icons:!0,other:!0,advanced:!1},icons:[],useFontAwesome:!0,rpgDownloadedOnce:!1,msDocConverted:!1,useSnippet:!1,snippetPath:`custom-admonitions.${[...Array(6).keys()].map(()=>(16*Math.random()|0).toString(16)).join("")}`},r4=class extends x.Plugin{constructor(){super(...arguments);this.postprocessors=new Map;this.iconManager=new i4(this)}get types(){return Object.keys(this.admonitions)}get admonitionArray(){return Object.keys(this.admonitions).map(c=>({...this.admonitions[c],type:c}))}async onload(){console.log("Obsidian Admonition loaded"),this.postprocessors=new Map,await this.loadSettings(),await this.iconManager.load(),this.app.workspace.onLayoutReady(async()=>{this.addChild(this.calloutManager=new d2(this)),this.registerEditorSuggest(new t4(this)),Object.keys(this.admonitions).forEach(c=>{this.registerType(c)}),this.addSettingTab(new l2(this.app,this)),(0,x.addIcon)(K1,M4),(0,x.addIcon)(Q1,C4),(0,x.addIcon)(P1,H4),(0,x.addIcon)(E1,g4),this.addCommand({id:"collapse-admonitions",name:"Collapse Admonitions in Note",checkCallback:c=>{if(c)return!!this.app.workspace.getActiveViewOfType(x.MarkdownView);let e=this.app.workspace.getActiveViewOfType(x.MarkdownView);if(!e||!(e instanceof x.MarkdownView))return;let i=e.contentEl.querySelectorAll("details[open].admonition-plugin");for(let n=0;n<i.length;n++)i[n].removeAttribute("open")}}),this.addCommand({id:"open-admonitions",name:"Open Admonitions in Note",checkCallback:c=>{if(c)return!!this.app.workspace.getActiveViewOfType(x.MarkdownView);let e=this.app.workspace.getActiveViewOfType(x.MarkdownView);if(!e||!(e instanceof x.MarkdownView))return;let i=e.contentEl.querySelectorAll("details:not([open]).admonition-plugin");for(let n=0;n<i.length;n++)i[n].setAttribute("open","open")}}),this.addCommand({id:"insert-admonition",name:"Insert Admonition",editorCallback:(c,e)=>{let i=new r2(this);i.onClose=()=>{if(!i.insert)return;let n="",o="";i.title.length&&i.title.toLowerCase()!=i.type.toLowerCase()&&(n=`title: ${i.title} }`,this.indexing.contains(c.type)&&this.sheet.deleteRule(this.indexing.indexOf(c.type)),this.indexing=[...this.indexing.filter(n=>n!=c.type),c.type],this.sheet.insertRule(e,this.sheet.cssRules.length),this.updateSnippet()}removeAdmonition(c){if(!this.indexing.contains(c.type))return;let e=this.indexing.indexOf(c.type);this.sheet.deleteRule(e),this.indexing.splice(e,1),this.updateSnippet()}get sheet(){return this.style.sheet}unload(){this.style.detach()}get snippetPath(){return this.plugin.app.customCss.getSnippetPath(this.plugin.data.snippetPath)}setUseSnippet(){this.plugin.data.useSnippet&&this.updateSnippet()}async updateSnippet(){!this.plugin.data.useSnippet||(await this.plugin.app.vault.adapter.exists(this.snippetPath)?await this.plugin.app.vault.adapter.write(this.snippetPath,this.generateCssString()):await this.plugin.app.vault.create(this.snippetPath,this.generateCssString()),this.plugin.app.customCss.setCssEnabledStatus(this.plugin.data.snippetPath,!0),this.plugin.app.customCss.readCssFolders())}};var bb={userAdmonitions:{},syntaxHighlight:!1,copyButton:!1,version:"",autoCollapse:!1,defaultCollapseType:"open",injectColor:!0,parseTitles:!0,dropShadow:!0,hideEmpty:!1,open:{admonitions:!0,icons:!0,other:!0,advanced:!1},icons:[],useFontAwesome:!0,rpgDownloadedOnce:!1,msDocConverted:!1,useSnippet:!1,snippetPath:`custom-admonitions.${[...Array(6).keys()].map(()=>(16*Math.random()|0).toString(16)).join("")}`},r4=class extends x.Plugin{constructor(){super(...arguments);this.postprocessors=new Map;this.iconManager=new i4(this)}get types(){return Object.keys(this.admonitions)}get admonitionArray(){return Object.keys(this.admonitions).map(c=>({...this.admonitions[c],type:c}))}async onload(){console.log("Obsidian Admonition loaded"),this.postprocessors=new Map,await this.loadSettings(),await this.iconManager.load(),this.app.workspace.onLayoutReady(async()=>{this.addChild(this.calloutManager=new d2(this)),this.registerEditorSuggest(new t4(this)),Object.keys(this.admonitions).forEach(c=>{this.registerType(c)}),this.addSettingTab(new l2(this.app,this)),(0,x.addIcon)(K1,M4),(0,x.addIcon)(Q1,C4),(0,x.addIcon)(P1,H4),(0,x.addIcon)(E1,g4),this.addCommand({id:"collapse-admonitions",name:"Collapse Admonitions in Note",checkCallback:c=>{if(c)return!!this.app.workspace.getActiveViewOfType(x.MarkdownView);let e=this.app.workspace.getActiveViewOfType(x.MarkdownView);if(!e||!(e instanceof x.MarkdownView))return;let i=e.contentEl.querySelectorAll("details[open].admonition-plugin");for(let n=0;n<i.length;n++)i[n].removeAttribute("open")}}),this.addCommand({id:"open-admonitions",name:"Open Admonitions in Note",checkCallback:c=>{if(c)return!!this.app.workspace.getActiveViewOfType(x.MarkdownView);let e=this.app.workspace.getActiveViewOfType(x.MarkdownView);if(!e||!(e instanceof x.MarkdownView))return;let i=e.contentEl.querySelectorAll("details:not([open]).admonition-plugin");for(let n=0;n<i.length;n++)i[n].setAttribute("open","open")}}),this.addCommand({id:"insert-admonition",name:"Insert Admonition",editorCallback:(c,e)=>{let i=new r2(this);i.onClose=()=>{if(!i.insert)return;let n="",o="";i.title.length&&i.title.toLowerCase()!=i.type.toLowerCase()&&(n=`title: ${i.title}
`),(this.data.autoCollapse&&i.collapse!=this.data.defaultCollapseType||!this.data.autoCollapse&&i.collapse!="none")&&(o=`collapse: ${i.collapse} `),(this.data.autoCollapse&&i.collapse!=this.data.defaultCollapseType||!this.data.autoCollapse&&i.collapse!="none")&&(o=`collapse: ${i.collapse}
`),c.getDoc().replaceSelection(`\`\`\`ad-${i.type} `),c.getDoc().replaceSelection(`\`\`\`ad-${i.type}
${n}${o} ${n}${o}
@ -488,7 +488,7 @@ ${c.getDoc().getSelection()}
> `)} > `)}
`)},i.open()}})})}async downloadIcon(c){this.iconManager.downloadIcon(c)}async removeIcon(c){this.iconManager.removeIcon(c)}async postprocessor(c,e,i,n){if(!!this.admonitions[c])try{let o=typeof n=="string"?n:n?.sourcePath??this.app.workspace.getActiveFile()?.path??"",{title:r,collapse:t,content:l,icon:f,color:s}=u4(c,e,this.admonitions[c]);this.data.autoCollapse&&!t?t=this.data.defaultCollapseType??"open":t&&t.trim()==="none"&&(t="");let h=this.admonitions[c],m=this.getAdmonitionElement(c,r,this.iconManager.iconDefinitions.find(({name:v})=>f===v)??h.icon,s??(h.injectColor??this.data.injectColor?h.color:null),t);this.renderAdmonitionContent(m,c,l,n,o,e),t&&t!="none"&&this.calloutManager.setCollapsible(m);let z=i.parentElement;return z&&z.addClass("admonition-parent",`admonition-${c}-parent`),i.replaceWith(m),m}catch(o){console.error(o);let r=createEl("pre");r.createEl("code",{attr:{style:"color: var(--text-error) !important"}}).createSpan({text:`There was an error rendering the admonition: `)},i.open()}})})}async downloadIcon(c){this.iconManager.downloadIcon(c)}async removeIcon(c){this.iconManager.removeIcon(c)}async postprocessor(c,e,i,n){if(!!this.admonitions[c])try{let o=typeof n=="string"?n:n?.sourcePath??this.app.workspace.getActiveFile()?.path??"",{title:r,collapse:t,content:l,icon:f,color:s}=u4(c,e,this.admonitions[c]);this.data.autoCollapse&&!t?t=this.data.defaultCollapseType??"open":t&&t.trim()==="none"&&(t="");let h=this.admonitions[c],m=this.getAdmonitionElement(c,r,this.iconManager.iconDefinitions.find(({name:v})=>f===v)??h.icon,s??(h.injectColor??this.data.injectColor?h.color:null),t);this.renderAdmonitionContent(m,c,l,n,o,e),t&&t!="none"&&this.calloutManager.setCollapsible(m);let z=i.parentElement;return z&&z.addClass("admonition-parent",`admonition-${c}-parent`),i.replaceWith(m),m}catch(o){console.error(o);let r=createEl("pre");r.createEl("code",{attr:{style:"color: var(--text-error) !important"}}).createSpan({text:`There was an error rendering the admonition:
`+e}),i.replaceWith(r)}}getAdmonitionElement(c,e,i,n,o){let r=createDiv({cls:`callout admonition admonition-${c} admonition-plugin ${e?.trim().length?"":"no-title"}`,attr:{style:`--admonition-color: ${n};`,"data-callout":c,"data-callout-fold":""}}),t=r.createDiv({cls:`callout-title admonition-title ${e?.trim().length?"":"no-title"}`});if(e&&e.trim().length){let l=t.createDiv("callout-icon admonition-title-icon");i&&i.name&&i.type&&l.appendChild(this.iconManager.getIconNode(i)??createDiv());let f=t.createDiv("callout-title-inner admonition-title-content");x.MarkdownRenderer.renderMarkdown(e,f,"",null),f.firstElementChild&&f.firstElementChild instanceof HTMLParagraphElement&&f.setChildrenInPlace(Array.from(f.firstElementChild.childNodes))}return o&&(r.addClass("is-collapsible"),o=="closed"&&r.addClass("is-collapsed")),this.data.dropShadow||r.addClass("no-drop"),r}renderAdmonitionContent(c,e,i,n,o,r){let t=new x.MarkdownRenderChild(c);if(t.containerEl=c,n&&typeof n!="string"&&n.addChild(t),i&&i?.trim().length){let l=this.getAdmonitionContentElement(e,c,i);if(/^`{3,}mermaid/m.test(i)){let s=!c.hasAttribute("open");c instanceof HTMLDetailsElement&&c.setAttribute("open","open"),setImmediate(()=>{x.MarkdownRenderer.renderMarkdown(i,l,o,t),c instanceof HTMLDetailsElement&&s&&c.removeAttribute("open")})}else x.MarkdownRenderer.renderMarkdown(i,l,o,t);(!i.length||l.textContent.trim()=="")&&this.data.hideEmpty&&c.addClass("no-content");let f=l.querySelectorAll(".task-list-item-checkbox");if(f?.length){let s=r.split(` `+e}),i.replaceWith(r)}}getAdmonitionElement(c,e,i,n,o){let r=createDiv({cls:`callout admonition admonition-${c} admonition-plugin ${e?.trim().length?"":"no-title"}`,attr:{style:n?`--callout-color: ${n};`:"","data-callout":c,"data-callout-fold":""}}),t=r.createDiv({cls:`callout-title admonition-title ${e?.trim().length?"":"no-title"}`});if(e&&e.trim().length){let l=t.createDiv("callout-icon admonition-title-icon");i&&i.name&&i.type&&l.appendChild(this.iconManager.getIconNode(i)??createDiv());let f=t.createDiv("callout-title-inner admonition-title-content");x.MarkdownRenderer.renderMarkdown(e,f,"",null),f.firstElementChild&&f.firstElementChild instanceof HTMLParagraphElement&&f.setChildrenInPlace(Array.from(f.firstElementChild.childNodes))}return o&&(r.addClass("is-collapsible"),o=="closed"&&r.addClass("is-collapsed")),this.data.dropShadow||r.addClass("no-drop"),r}renderAdmonitionContent(c,e,i,n,o,r){let t=new x.MarkdownRenderChild(c);if(t.containerEl=c,n&&typeof n!="string"&&n.addChild(t),i&&i?.trim().length){let l=this.getAdmonitionContentElement(e,c,i);if(/^`{3,}mermaid/m.test(i)){let s=!c.hasAttribute("open");c instanceof HTMLDetailsElement&&c.setAttribute("open","open"),setImmediate(()=>{x.MarkdownRenderer.renderMarkdown(i,l,o,t),c instanceof HTMLDetailsElement&&s&&c.removeAttribute("open")})}else x.MarkdownRenderer.renderMarkdown(i,l,o,t);(!i.length||l.textContent.trim()=="")&&this.data.hideEmpty&&c.addClass("no-content");let f=l.querySelectorAll(".task-list-item-checkbox");if(f?.length){let s=r.split(`
`),h=0;f.forEach(m=>{let z=s.slice(h).findIndex(v=>/^[ \t>]*\- \[.\]/.test(v));z!=-1&&(m.dataset.line=`${z+h+1}`,h=z+h+1)})}}}getAdmonitionContentElement(c,e,i){let n=e.createDiv("callout-content admonition-content");if(this.admonitions[c].copy??this.data.copyButton){let o=n.createDiv("admonition-content-copy");(0,x.setIcon)(o,"copy"),o.addEventListener("click",()=>{navigator.clipboard.writeText(i.trim()).then(async()=>{new x.Notice("Admonition content copied to clipboard.")})})}return n}registerType(c){this.data.syntaxHighlight&&this.turnOnSyntaxHighlighting([c]),this.postprocessors.has(c)&&x.MarkdownPreviewRenderer.unregisterCodeBlockPostProcessor(`ad-${c}`),this.postprocessors.set(c,this.registerMarkdownCodeBlockProcessor(`ad-${c}`,(i,n,o)=>this.postprocessor(c,i,n,o)));let e=this.admonitions[c];e.command&&this.registerCommandsFor(e)}get admonitions(){return{...V4,...this.data.userAdmonitions}}async addAdmonition(c){this.data.userAdmonitions={...this.data.userAdmonitions,[c.type]:c},this.registerType(c.type),this.calloutManager.addAdmonition(c),await this.saveSettings()}registerCommandsFor(c){c.command=!0,this.addCommand({id:`insert-${c.type}-callout`,name:`Insert ${c.type} Callout`,editorCheckCallback:(e,i,n)=>{if(e)return c.command;if(c.command)try{let o=i.getDoc().getSelection();i.getDoc().replaceSelection(`> [!${c.type}] `),h=0;f.forEach(m=>{let z=s.slice(h).findIndex(v=>/^[ \t>]*\- \[.\]/.test(v));z!=-1&&(m.dataset.line=`${z+h+1}`,h=z+h+1)})}}}getAdmonitionContentElement(c,e,i){let n=e.createDiv("callout-content admonition-content");if(this.admonitions[c].copy??this.data.copyButton){let o=n.createDiv("admonition-content-copy");(0,x.setIcon)(o,"copy"),o.addEventListener("click",()=>{navigator.clipboard.writeText(i.trim()).then(async()=>{new x.Notice("Admonition content copied to clipboard.")})})}return n}registerType(c){this.data.syntaxHighlight&&this.turnOnSyntaxHighlighting([c]),this.postprocessors.has(c)&&x.MarkdownPreviewRenderer.unregisterCodeBlockPostProcessor(`ad-${c}`),this.postprocessors.set(c,this.registerMarkdownCodeBlockProcessor(`ad-${c}`,(i,n,o)=>this.postprocessor(c,i,n,o)));let e=this.admonitions[c];e.command&&this.registerCommandsFor(e)}get admonitions(){return{...V4,...this.data.userAdmonitions}}async addAdmonition(c){this.data.userAdmonitions={...this.data.userAdmonitions,[c.type]:c},this.registerType(c.type),this.calloutManager.addAdmonition(c),await this.saveSettings()}registerCommandsFor(c){c.command=!0,this.addCommand({id:`insert-${c.type}-callout`,name:`Insert ${c.type} Callout`,editorCheckCallback:(e,i,n)=>{if(e)return c.command;if(c.command)try{let o=i.getDoc().getSelection();i.getDoc().replaceSelection(`> [!${c.type}]
> ${o.split(` > ${o.split(`
`).join(` `).join(`

View file

@ -1,7 +1,7 @@
{ {
"id": "obsidian-admonition", "id": "obsidian-admonition",
"name": "Admonition", "name": "Admonition",
"version": "9.0.1", "version": "9.0.3",
"minAppVersion": "0.14.0", "minAppVersion": "0.14.0",
"description": "Enhanced callouts for Obsidian.md", "description": "Enhanced callouts for Obsidian.md",
"author": "Jeremy Valentine", "author": "Jeremy Valentine",

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
{ {
"id": "obsidian-chartsview-plugin", "id": "obsidian-chartsview-plugin",
"name": "Charts View", "name": "Charts View",
"version": "1.1.6", "version": "1.1.8",
"minAppVersion": "0.9.12", "minAppVersion": "0.9.12",
"description": "Data visualization solution in Obsidian based on Ant Design Charts.", "description": "Data visualization solution in Obsidian based on Ant Design Charts.",
"author": "caronchen", "author": "caronchen",

View file

@ -69,8 +69,9 @@
"mdCSS": "", "mdCSS": "",
"scriptEngineSettings": {}, "scriptEngineSettings": {},
"defaultTrayMode": false, "defaultTrayMode": false,
"previousRelease": "1.6.25", "previousRelease": "1.6.33",
"showReleaseNotes": true, "showReleaseNotes": true,
"mathjaxSourceURL": "https://cdn.jsdelivr.net/npm/mathjax@3.2.1/es5/tex-svg.js",
"loadCount": 1, "loadCount": 1,
"patchCommentBlock": false, "patchCommentBlock": false,
"runWYSIWYGpatch": false, "runWYSIWYGpatch": false,

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
{ {
"id": "obsidian-excalidraw-plugin", "id": "obsidian-excalidraw-plugin",
"name": "Excalidraw", "name": "Excalidraw",
"version": "1.6.25", "version": "1.6.33",
"minAppVersion": "0.12.16", "minAppVersion": "0.12.16",
"description": "An Obsidian plugin to edit and view Excalidraw drawings", "description": "An Obsidian plugin to edit and view Excalidraw drawings",
"author": "Zsolt Viczian", "author": "Zsolt Viczian",

File diff suppressed because one or more lines are too long

View file

@ -1,10 +1,10 @@
{ {
"id": "obsidian-filename-heading-sync", "id": "obsidian-filename-heading-sync",
"name": "Filename Heading Sync", "name": "Filename Heading Sync",
"version": "1.6.0", "version": "1.6.1",
"minAppVersion": "0.11.0", "minAppVersion": "0.11.0",
"description": "Obsidian plugin for keeping the filename with the first heading of a file in sync", "description": "Obsidian plugin for keeping the filename with the first heading of a file in sync",
"author": "dvcrn", "author": "dvcrn",
"authorUrl": "https://github.com/dvcrn/filename-header-sync", "authorUrl": "https://github.com/dvcrn/obsidian-filename-heading-sync",
"isDesktopOnly": false "isDesktopOnly": false
} }

View file

@ -6767,7 +6767,7 @@ var require_feather = __commonJS({
__export(exports, { __export(exports, {
default: () => ObsidianGit default: () => ObsidianGit
}); });
var import_obsidian14 = __toModule(require("obsidian")); var import_obsidian15 = __toModule(require("obsidian"));
var path2 = __toModule(require("path")); var path2 = __toModule(require("path"));
// src/promiseQueue.ts // src/promiseQueue.ts
@ -6927,8 +6927,12 @@ var ObsidianGitSettingsTab = class extends import_obsidian.PluginSettingTab {
plugin.gitManager.updateGitPath(value || "git"); plugin.gitManager.updateGitPath(value || "git");
}); });
}); });
new import_obsidian.Setting(containerEl).setName("Base Path (Git repository path)").setDesc("Sets the relative path from where to execute the git binary. Mostly used to set the path to the git repository.").addText((cb) => { new import_obsidian.Setting(containerEl).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((cb) => {
cb.setValue(plugin.settings.basePath); cb.setValue(plugin.settings.basePath);
cb.setPlaceholder("directory/directory-with-git-repo");
cb.onChange((value) => { cb.onChange((value) => {
plugin.settings.basePath = value; plugin.settings.basePath = value;
plugin.saveSettings(); plugin.saveSettings();
@ -7208,6 +7212,7 @@ function getData(manager) {
// src/simpleGit.ts // src/simpleGit.ts
var import_child_process2 = __toModule(require("child_process")); var import_child_process2 = __toModule(require("child_process"));
var import_obsidian6 = __toModule(require("obsidian"));
var path = __toModule(require("path")); var path = __toModule(require("path"));
var import_path = __toModule(require("path")); var import_path = __toModule(require("path"));
@ -9342,16 +9347,10 @@ var init_FileStatusSummary = __esm({
} }
}); });
function renamedFile(line) { function renamedFile(line) {
const detail = /^(.+) -> (.+)$/.exec(line); const [to, from] = line.split(NULL);
if (!detail) {
return {
from: line,
to: line
};
}
return { return {
from: String(detail[1]), from: from || to,
to: String(detail[2]) to
}; };
} }
function parser2(indexX, indexY, handler) { function parser2(indexX, indexY, handler) {
@ -9377,7 +9376,7 @@ function splitLine(result, lineStr) {
handler(result, path3); handler(result, path3);
} }
if (raw !== "##" && raw !== "!!") { if (raw !== "##" && raw !== "!!") {
result.files.push(new FileStatusSummary(path3, index, workingDir)); result.files.push(new FileStatusSummary(path3.replace(/\0.+$/, ""), index, workingDir));
} }
} }
} }
@ -9454,10 +9453,17 @@ var init_StatusSummary = __esm({
}] }]
]); ]);
parseStatusSummary = function(text2) { parseStatusSummary = function(text2) {
const lines = text2.trim().split(NULL); const lines = text2.split(NULL);
const status = new StatusSummary(); const status = new StatusSummary();
for (let i = 0, l = lines.length; i < l; i++) { for (let i = 0, l = lines.length; i < l; ) {
splitLine(status, lines[i]); let line = lines[i++].trim();
if (!line) {
continue;
}
if (line.charAt(0) === "R") {
line += NULL + (lines[i++] || "");
}
splitLine(status, line);
} }
return status; return status;
}; };
@ -10818,19 +10824,23 @@ var GitManager = class {
var SimpleGit = class extends GitManager { var SimpleGit = class extends GitManager {
constructor(plugin) { constructor(plugin) {
super(plugin); super(plugin);
this.setGitInstance();
} }
setGitInstance() { setGitInstance(ignoreError = false) {
return __async(this, null, function* () { return __async(this, null, function* () {
if (this.isGitInstalled()) { if (this.isGitInstalled()) {
const adapter = this.app.vault.adapter; const adapter = this.app.vault.adapter;
const path3 = adapter.getBasePath(); const path3 = adapter.getBasePath();
let extraPath = ""; let basePath = path3;
if (this.plugin.settings.basePath) { if (this.plugin.settings.basePath) {
extraPath = import_path.sep + this.plugin.settings.basePath; const exists2 = yield adapter.exists((0, import_obsidian6.normalizePath)(this.plugin.settings.basePath));
if (exists2) {
basePath = path3 + import_path.sep + this.plugin.settings.basePath;
} else if (!ignoreError) {
new import_obsidian6.Notice("ObsidianGit: Base path does not exist");
}
} }
this.git = esm_default({ this.git = esm_default({
baseDir: path3 + extraPath, baseDir: basePath,
binary: this.plugin.settings.gitPath || void 0, binary: this.plugin.settings.gitPath || void 0,
config: ["core.quotepath=off"] config: ["core.quotepath=off"]
}); });
@ -10845,24 +10855,31 @@ var SimpleGit = class extends GitManager {
this.plugin.setState(PluginState.idle); this.plugin.setState(PluginState.idle);
return { return {
changed: status.files.filter((e) => e.working_dir !== " ").map((e) => { changed: status.files.filter((e) => e.working_dir !== " ").map((e) => {
const res = this.formatPath(e.path); const res = this.formatPath(e);
e.path = res.path; e.path = res.path;
e.from = res.from; e.from = res.from;
e.working_dir = e.working_dir === "?" ? "U" : e.working_dir; e.working_dir = e.working_dir === "?" ? "U" : e.working_dir;
return e; return e;
}), }),
staged: status.files.filter((e) => e.index !== " " && e.index != "?").map((e) => { staged: status.files.filter((e) => e.index !== " " && e.index != "?").map((e) => {
const res = this.formatPath(e.path, e.index === "R"); const res = this.formatPath(e, e.index === "R");
e.path = res.path; e.path = res.path;
e.from = res.from; e.from = res.from;
return e; return e;
}), }),
conflicted: status.conflicted.map((e) => this.formatPath(e).path) conflicted: status.conflicted.map((e) => this.formatPath({
path: e,
from: void 0,
index: void 0,
working_dir: void 0
}).path)
}; };
}); });
} }
formatPath(path3, renamed = false) { formatPath(path3, renamed = false) {
function format(path4) { function format(path4) {
if (path4 == void 0)
return void 0;
if (path4.startsWith('"') && path4.endsWith('"')) { if (path4.startsWith('"') && path4.endsWith('"')) {
return path4.substring(1, path4.length - 1); return path4.substring(1, path4.length - 1);
} else { } else {
@ -10870,14 +10887,13 @@ var SimpleGit = class extends GitManager {
} }
} }
if (renamed) { if (renamed) {
const paths = path3.split(" -> ").map((e) => format(e));
return { return {
from: paths[0], from: format(path3.from),
path: paths[1] path: format(path3.path)
}; };
} else { } else {
return { return {
path: format(path3) path: format(path3.path)
}; };
} }
} }
@ -11014,7 +11030,7 @@ var SimpleGit = class extends GitManager {
const status = yield this.git.status(); const status = yield this.git.status();
const trackingBranch = status.tracking; const trackingBranch = status.tracking;
const currentBranch = status.current; const currentBranch = status.current;
const remoteChangedFiles = (yield this.git.diffSummary([currentBranch, trackingBranch])).changed; const remoteChangedFiles = (yield this.git.diffSummary([currentBranch, trackingBranch], (err) => this.onError(err))).changed;
this.plugin.setState(PluginState.push); this.plugin.setState(PluginState.push);
if (this.plugin.settings.updateSubmodules) { if (this.plugin.settings.updateSubmodules) {
yield this.git.env(__spreadProps(__spreadValues({}, process.env), { "OBSIDIAN_GIT": 1 })).subModule(["foreach", "--recursive", `tracking=$(git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)"); echo $tracking; if [ ! -z "$(git diff --shortstat $tracking)" ]; then git push; fi`], (err) => this.onError(err)); yield this.git.env(__spreadProps(__spreadValues({}, process.env), { "OBSIDIAN_GIT": 1 })).subModule(["foreach", "--recursive", `tracking=$(git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)"); echo $tracking; if [ ! -z "$(git diff --shortstat $tracking)" ]; then git push; fi`], (err) => this.onError(err));
@ -11142,7 +11158,7 @@ var SimpleGit = class extends GitManager {
this.setGitInstance(); this.setGitInstance();
} }
updateBasePath(basePath) { updateBasePath(basePath) {
this.setGitInstance(); this.setGitInstance(true);
} }
getDiffString(filePath, stagedChanges = false) { getDiffString(filePath, stagedChanges = false) {
return __async(this, null, function* () { return __async(this, null, function* () {
@ -11186,8 +11202,8 @@ var SimpleGit = class extends GitManager {
// src/ui/diff/diffView.ts // src/ui/diff/diffView.ts
var import_diff2html = __toModule(require_diff2html()); var import_diff2html = __toModule(require_diff2html());
var import_obsidian6 = __toModule(require("obsidian")); var import_obsidian7 = __toModule(require("obsidian"));
var DiffView = class extends import_obsidian6.ItemView { var DiffView = class extends import_obsidian7.ItemView {
constructor(leaf, plugin) { constructor(leaf, plugin) {
super(leaf); super(leaf);
this.plugin = plugin; this.plugin = plugin;
@ -11244,10 +11260,10 @@ var DiffView = class extends import_obsidian6.ItemView {
}; };
// src/ui/modals/generalModal.ts // src/ui/modals/generalModal.ts
var import_obsidian7 = __toModule(require("obsidian")); var import_obsidian8 = __toModule(require("obsidian"));
var GeneralModal = class extends import_obsidian7.SuggestModal { var GeneralModal = class extends import_obsidian8.SuggestModal {
constructor(app, remotes, placeholder) { constructor(app2, remotes, placeholder) {
super(app); super(app2);
this.resolve = null; this.resolve = null;
this.list = remotes; this.list = remotes;
this.setPlaceholder(placeholder); this.setPlaceholder(placeholder);
@ -11278,7 +11294,7 @@ var GeneralModal = class extends import_obsidian7.SuggestModal {
}; };
// src/ui/sidebar/sidebarView.ts // src/ui/sidebar/sidebarView.ts
var import_obsidian13 = __toModule(require("obsidian")); var import_obsidian14 = __toModule(require("obsidian"));
// node_modules/svelte/internal/index.mjs // node_modules/svelte/internal/index.mjs
function noop() { function noop() {
@ -11419,9 +11435,9 @@ function set_input_value(input, value) {
function toggle_class(element2, name, toggle) { function toggle_class(element2, name, toggle) {
element2.classList[toggle ? "add" : "remove"](name); element2.classList[toggle ? "add" : "remove"](name);
} }
function custom_event(type, detail, bubbles = false) { function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {
const e = document.createEvent("CustomEvent"); const e = document.createEvent("CustomEvent");
e.initCustomEvent(type, bubbles, false, detail); e.initCustomEvent(type, bubbles, cancelable, detail);
return e; return e;
} }
var managed_styles = new Map(); var managed_styles = new Map();
@ -11918,7 +11934,7 @@ var {
} = import_tslib.default; } = import_tslib.default;
// src/ui/sidebar/gitView.svelte // src/ui/sidebar/gitView.svelte
var import_obsidian12 = __toModule(require("obsidian")); var import_obsidian13 = __toModule(require("obsidian"));
// node_modules/svelte/easing/index.mjs // node_modules/svelte/easing/index.mjs
function cubicOut(t) { function cubicOut(t) {
@ -11946,14 +11962,14 @@ function slide(node, { delay: delay2 = 0, duration = 400, easing = cubicOut } =
} }
// src/ui/sidebar/components/fileComponent.svelte // src/ui/sidebar/components/fileComponent.svelte
var import_obsidian10 = __toModule(require("obsidian")); var import_obsidian11 = __toModule(require("obsidian"));
// node_modules/obsidian-community-lib/dist/utils.js // node_modules/obsidian-community-lib/dist/utils.js
var feather = __toModule(require_feather()); var feather = __toModule(require_feather());
var import_obsidian8 = __toModule(require("obsidian")); var import_obsidian9 = __toModule(require("obsidian"));
function hoverPreview(event, view, to) { function hoverPreview(event, view, to) {
const targetEl = event.target; const targetEl = event.target;
view.app.workspace.trigger("hover-link", { app.workspace.trigger("hover-link", {
event, event,
source: view.getViewType(), source: view.getViewType(),
hoverParent: view, hoverParent: view,
@ -11961,28 +11977,28 @@ function hoverPreview(event, view, to) {
linktext: to linktext: to
}); });
} }
function createNewMDNote(app, newName, currFilePath = "") { function createNewMDNote(newName, currFilePath = "") {
return __async(this, null, function* () { return __async(this, null, function* () {
const newFileFolder = app.fileManager.getNewFileParent(currFilePath).path; const newFileFolder = app.fileManager.getNewFileParent(currFilePath).path;
const newFilePath = (0, import_obsidian8.normalizePath)(`${newFileFolder}${newFileFolder === "/" ? "" : "/"}${addMD(newName)}`); const newFilePath = (0, import_obsidian9.normalizePath)(`${newFileFolder}${newFileFolder === "/" ? "" : "/"}${addMD(newName)}`);
return yield app.vault.create(newFilePath, ""); return yield app.vault.create(newFilePath, "");
}); });
} }
var addMD = (noteName) => { var addMD = (noteName) => {
return noteName.endsWith(".md") ? noteName : noteName + ".md"; return noteName.match(/\.MD$|\.md$/m) ? noteName : noteName + ".md";
}; };
function openOrSwitch(_0, _1, _2) { function openOrSwitch(_0, _1) {
return __async(this, arguments, function* (app, dest, event, options = { createNewFile: true }) { return __async(this, arguments, function* (dest, event, options = { createNewFile: true }) {
const { workspace } = app; const { workspace } = app;
let destFile = app.metadataCache.getFirstLinkpathDest(dest, ""); let destFile = app.metadataCache.getFirstLinkpathDest(dest, "");
if (!destFile && options.createNewFile) { if (!destFile && options.createNewFile) {
destFile = yield createNewMDNote(app, dest); destFile = yield createNewMDNote(dest);
} else if (!destFile && !options.createNewFile) } else if (!destFile && !options.createNewFile)
return; return;
const leavesWithDestAlreadyOpen = []; const leavesWithDestAlreadyOpen = [];
workspace.iterateAllLeaves((leaf) => { workspace.iterateAllLeaves((leaf) => {
var _a2; var _a2;
if (leaf.view instanceof import_obsidian8.MarkdownView) { if (leaf.view instanceof import_obsidian9.MarkdownView) {
const file = (_a2 = leaf.view) === null || _a2 === void 0 ? void 0 : _a2.file; const file = (_a2 = leaf.view) === null || _a2 === void 0 ? void 0 : _a2.file;
if (file && file.basename + "." + file.extension === dest) { if (file && file.basename + "." + file.extension === dest) {
leavesWithDestAlreadyOpen.push(leaf); leavesWithDestAlreadyOpen.push(leaf);
@ -12000,10 +12016,10 @@ function openOrSwitch(_0, _1, _2) {
} }
// src/ui/modals/discardModal.ts // src/ui/modals/discardModal.ts
var import_obsidian9 = __toModule(require("obsidian")); var import_obsidian10 = __toModule(require("obsidian"));
var DiscardModal = class extends import_obsidian9.Modal { var DiscardModal = class extends import_obsidian10.Modal {
constructor(app, deletion, filename) { constructor(app2, deletion, filename) {
super(app); super(app2);
this.deletion = deletion; this.deletion = deletion;
this.filename = filename; this.filename = filename;
this.resolve = null; this.resolve = null;
@ -12207,7 +12223,7 @@ function instance($$self, $$props, $$invalidate) {
let { manager } = $$props; let { manager } = $$props;
let { workspace } = $$props; let { workspace } = $$props;
let buttons = []; let buttons = [];
setImmediate(() => buttons.forEach((b) => (0, import_obsidian10.setIcon)(b, b.getAttr("data-icon"), 16))); setImmediate(() => buttons.forEach((b) => (0, import_obsidian11.setIcon)(b, b.getAttr("data-icon"), 16)));
function hover(event) { function hover(event) {
if (!change.path.startsWith(view.app.vault.configDir) || !change.path.startsWith(".")) { if (!change.path.startsWith(view.app.vault.configDir) || !change.path.startsWith(".")) {
hoverPreview(event, view, change.path.split("/").last().replace(".md", "")); hoverPreview(event, view, change.path.split("/").last().replace(".md", ""));
@ -12323,7 +12339,7 @@ var FileComponent = class extends SvelteComponent {
var fileComponent_default = FileComponent; var fileComponent_default = FileComponent;
// src/ui/sidebar/components/stagedFileComponent.svelte // src/ui/sidebar/components/stagedFileComponent.svelte
var import_obsidian11 = __toModule(require("obsidian")); var import_obsidian12 = __toModule(require("obsidian"));
function add_css2(target) { function add_css2(target) {
append_styles(target, "svelte-15heedx", "main.svelte-15heedx.svelte-15heedx.svelte-15heedx{cursor:pointer;background-color:var(--background-secondary);border-radius:4px;width:98%;display:flex;justify-content:space-between;font-size:0.8rem;margin-bottom:2px}main.svelte-15heedx .path.svelte-15heedx.svelte-15heedx{color:var(--text-muted);white-space:nowrap;max-width:75%;overflow:hidden;text-overflow:ellipsis}main.svelte-15heedx:hover .path.svelte-15heedx.svelte-15heedx{color:var(--text-normal);transition:all 200ms}main.svelte-15heedx .tools.svelte-15heedx.svelte-15heedx{display:flex;align-items:center}main.svelte-15heedx .tools .type.svelte-15heedx.svelte-15heedx{height:16px;width:16px;margin:0;display:flex;align-items:center;justify-content:center}main.svelte-15heedx .tools .type[data-type=M].svelte-15heedx.svelte-15heedx{color:orange}main.svelte-15heedx .tools .type[data-type=D].svelte-15heedx.svelte-15heedx{color:red}main.svelte-15heedx .tools .type[data-type=A].svelte-15heedx.svelte-15heedx{color:yellowgreen}main.svelte-15heedx .tools .type[data-type=R].svelte-15heedx.svelte-15heedx{color:violet}main.svelte-15heedx .tools .buttons.svelte-15heedx.svelte-15heedx{display:flex}main.svelte-15heedx .tools .buttons.svelte-15heedx>.svelte-15heedx{color:var(--text-faint);height:16px;width:16px;margin:0;transition:all 0.2s;border-radius:2px;margin-right:1px}main.svelte-15heedx .tools .buttons.svelte-15heedx>.svelte-15heedx:hover{color:var(--text-normal);background-color:var(--interactive-accent)}"); append_styles(target, "svelte-15heedx", "main.svelte-15heedx.svelte-15heedx.svelte-15heedx{cursor:pointer;background-color:var(--background-secondary);border-radius:4px;width:98%;display:flex;justify-content:space-between;font-size:0.8rem;margin-bottom:2px}main.svelte-15heedx .path.svelte-15heedx.svelte-15heedx{color:var(--text-muted);white-space:nowrap;max-width:75%;overflow:hidden;text-overflow:ellipsis}main.svelte-15heedx:hover .path.svelte-15heedx.svelte-15heedx{color:var(--text-normal);transition:all 200ms}main.svelte-15heedx .tools.svelte-15heedx.svelte-15heedx{display:flex;align-items:center}main.svelte-15heedx .tools .type.svelte-15heedx.svelte-15heedx{height:16px;width:16px;margin:0;display:flex;align-items:center;justify-content:center}main.svelte-15heedx .tools .type[data-type=M].svelte-15heedx.svelte-15heedx{color:orange}main.svelte-15heedx .tools .type[data-type=D].svelte-15heedx.svelte-15heedx{color:red}main.svelte-15heedx .tools .type[data-type=A].svelte-15heedx.svelte-15heedx{color:yellowgreen}main.svelte-15heedx .tools .type[data-type=R].svelte-15heedx.svelte-15heedx{color:violet}main.svelte-15heedx .tools .buttons.svelte-15heedx.svelte-15heedx{display:flex}main.svelte-15heedx .tools .buttons.svelte-15heedx>.svelte-15heedx{color:var(--text-faint);height:16px;width:16px;margin:0;transition:all 0.2s;border-radius:2px;margin-right:1px}main.svelte-15heedx .tools .buttons.svelte-15heedx>.svelte-15heedx:hover{color:var(--text-normal);background-color:var(--interactive-accent)}");
} }
@ -12478,7 +12494,7 @@ function instance2($$self, $$props, $$invalidate) {
let { view } = $$props; let { view } = $$props;
let { manager } = $$props; let { manager } = $$props;
let buttons = []; let buttons = [];
setImmediate(() => buttons.forEach((b) => (0, import_obsidian11.setIcon)(b, b.getAttr("data-icon"), 16))); setImmediate(() => buttons.forEach((b) => (0, import_obsidian12.setIcon)(b, b.getAttr("data-icon"), 16)));
function hover(event) { function hover(event) {
if (!change.path.startsWith(view.app.vault.configDir) || !change.path.startsWith(".")) { if (!change.path.startsWith(view.app.vault.configDir) || !change.path.startsWith(".")) {
hoverPreview(event, view, formattedPath.split("/").last().replace(".md", "")); hoverPreview(event, view, formattedPath.split("/").last().replace(".md", ""));
@ -13990,7 +14006,7 @@ function instance4($$self, $$props, $$invalidate) {
let changesOpen = true; let changesOpen = true;
let stagedOpen = true; let stagedOpen = true;
let loading = true; let loading = true;
const debRefresh = (0, import_obsidian12.debounce)(() => { const debRefresh = (0, import_obsidian13.debounce)(() => {
if (plugin.settings.refreshSourceControl) { if (plugin.settings.refreshSourceControl) {
refresh(); refresh();
} }
@ -14003,8 +14019,8 @@ function instance4($$self, $$props, $$invalidate) {
let renameEvent; let renameEvent;
addEventListener("git-refresh", refresh); addEventListener("git-refresh", refresh);
plugin.app.workspace.onLayoutReady(() => setImmediate(() => { plugin.app.workspace.onLayoutReady(() => setImmediate(() => {
buttons.forEach((btn) => (0, import_obsidian12.setIcon)(btn, btn.getAttr("data-icon"), 16)); buttons.forEach((btn) => (0, import_obsidian13.setIcon)(btn, btn.getAttr("data-icon"), 16));
(0, import_obsidian12.setIcon)(layoutBtn, showTree ? "list" : "folder", 16); (0, import_obsidian13.setIcon)(layoutBtn, showTree ? "list" : "folder", 16);
modifyEvent = plugin.app.vault.on("modify", () => { modifyEvent = plugin.app.vault.on("modify", () => {
debRefresh(); debRefresh();
}); });
@ -14135,7 +14151,7 @@ function instance4($$self, $$props, $$invalidate) {
$: { $: {
if (layoutBtn) { if (layoutBtn) {
layoutBtn.empty(); layoutBtn.empty();
(0, import_obsidian12.setIcon)(layoutBtn, showTree ? "list" : "folder", 16); (0, import_obsidian13.setIcon)(layoutBtn, showTree ? "list" : "folder", 16);
} }
} }
} }
@ -14182,7 +14198,7 @@ var GitView = class extends SvelteComponent {
var gitView_default = GitView; var gitView_default = GitView;
// src/ui/sidebar/sidebarView.ts // src/ui/sidebar/sidebarView.ts
var GitView2 = class extends import_obsidian13.ItemView { var GitView2 = class extends import_obsidian14.ItemView {
constructor(leaf, plugin) { constructor(leaf, plugin) {
super(leaf); super(leaf);
this.plugin = plugin; this.plugin = plugin;
@ -14214,7 +14230,7 @@ var GitView2 = class extends import_obsidian13.ItemView {
}; };
// src/main.ts // src/main.ts
var ObsidianGit = class extends import_obsidian14.Plugin { var ObsidianGit = class extends import_obsidian15.Plugin {
constructor() { constructor() {
super(...arguments); super(...arguments);
this.gitReady = false; this.gitReady = false;
@ -14401,13 +14417,16 @@ var ObsidianGit = class extends import_obsidian14.Plugin {
return __async(this, null, function* () { return __async(this, null, function* () {
try { try {
this.gitManager = new SimpleGit(this); this.gitManager = new SimpleGit(this);
if (this.gitManager instanceof SimpleGit) {
yield this.gitManager.setGitInstance();
}
const result = yield this.gitManager.checkRequirements(); const result = yield this.gitManager.checkRequirements();
switch (result) { switch (result) {
case "missing-git": case "missing-git":
this.displayError("Cannot run git command"); this.displayError("Cannot run git command");
break; break;
case "missing-repo": case "missing-repo":
new import_obsidian14.Notice("Can't find a valid git repository. Please create one via the given command."); new import_obsidian15.Notice("Can't find a valid git repository. Please create one via the given command.");
break; break;
case "valid": case "valid":
this.gitReady = true; this.gitReady = true;
@ -14440,7 +14459,7 @@ var ObsidianGit = class extends import_obsidian14.Plugin {
createNewRepo() { createNewRepo() {
return __async(this, null, function* () { return __async(this, null, function* () {
yield this.gitManager.init(); yield this.gitManager.init();
new import_obsidian14.Notice("Initialized new repo"); new import_obsidian15.Notice("Initialized new repo");
}); });
} }
cloneNewRepo() { cloneNewRepo() {
@ -14451,9 +14470,9 @@ var ObsidianGit = class extends import_obsidian14.Plugin {
let dir = yield new GeneralModal(this.app, [], "Enter directory for clone. It needs to be empty or not existent.").open(); let dir = yield new GeneralModal(this.app, [], "Enter directory for clone. It needs to be empty or not existent.").open();
if (dir) { if (dir) {
dir = path2.normalize(dir); dir = path2.normalize(dir);
new import_obsidian14.Notice(`Cloning new repo into "${dir}"`); new import_obsidian15.Notice(`Cloning new repo into "${dir}"`);
yield this.gitManager.clone(url, dir); yield this.gitManager.clone(url, dir);
new import_obsidian14.Notice("Cloned new repo"); new import_obsidian15.Notice("Cloned new repo");
} }
} }
}); });
@ -14527,7 +14546,7 @@ var ObsidianGit = class extends import_obsidian14.Plugin {
let commitMessage = fromAutoBackup ? this.settings.autoCommitMessage : this.settings.commitMessage; let commitMessage = fromAutoBackup ? this.settings.autoCommitMessage : this.settings.commitMessage;
if (fromAutoBackup && this.settings.customMessageOnAutoBackup || requestCustomMessage) { if (fromAutoBackup && this.settings.customMessageOnAutoBackup || requestCustomMessage) {
if (!this.settings.disablePopups && fromAutoBackup) { if (!this.settings.disablePopups && fromAutoBackup) {
new import_obsidian14.Notice("Auto backup: Please enter a custom commit message. Leave empty to abort"); new import_obsidian15.Notice("Auto backup: Please enter a custom commit message. Leave empty to abort");
} }
const tempMessage = yield new CustomMessageModal(this, true).open(); const tempMessage = yield new CustomMessageModal(this, true).open();
if (tempMessage != void 0 && tempMessage != "" && tempMessage != "...") { if (tempMessage != void 0 && tempMessage != "" && tempMessage != "...") {
@ -14582,7 +14601,7 @@ var ObsidianGit = class extends import_obsidian14.Plugin {
remotesAreSet() { remotesAreSet() {
return __async(this, null, function* () { return __async(this, null, function* () {
if (!(yield this.gitManager.branchInfo()).tracking) { if (!(yield this.gitManager.branchInfo()).tracking) {
new import_obsidian14.Notice("No upstream branch is set. Please select one."); new import_obsidian15.Notice("No upstream branch is set. Please select one.");
const remoteBranch = yield this.selectRemoteBranch(); const remoteBranch = yield this.selectRemoteBranch();
if (remoteBranch == void 0) { if (remoteBranch == void 0) {
this.displayError("Did not push. No upstream-branch is set!", 1e4); this.displayError("Did not push. No upstream-branch is set!", 1e4);
@ -14603,7 +14622,7 @@ var ObsidianGit = class extends import_obsidian14.Plugin {
this.doAutoBackup(); this.doAutoBackup();
} else { } else {
this.onFileModifyEventRef = this.app.vault.on("modify", () => this.autoBackupDebouncer()); this.onFileModifyEventRef = this.app.vault.on("modify", () => this.autoBackupDebouncer());
this.autoBackupDebouncer = (0, import_obsidian14.debounce)(() => this.doAutoBackup(), time, true); this.autoBackupDebouncer = (0, import_obsidian15.debounce)(() => this.doAutoBackup(), time, true);
} }
} else { } else {
this.timeoutIDBackup = window.setTimeout(() => this.doAutoBackup(), time); this.timeoutIDBackup = window.setTimeout(() => this.doAutoBackup(), time);
@ -14655,7 +14674,7 @@ var ObsidianGit = class extends import_obsidian14.Plugin {
"Please resolve them and commit per command (This file will be deleted before the commit).", "Please resolve them and commit per command (This file will be deleted before the commit).",
...conflicted.map((e) => { ...conflicted.map((e) => {
const file = this.app.vault.getAbstractFileByPath(e); const file = this.app.vault.getAbstractFileByPath(e);
if (file instanceof import_obsidian14.TFile) { if (file instanceof import_obsidian15.TFile) {
const link = this.app.metadataCache.fileToLinktext(file, "/"); const link = this.app.metadataCache.fileToLinktext(file, "/");
return `- [[${link}]]`; return `- [[${link}]]`;
} else { } else {
@ -14732,14 +14751,14 @@ var ObsidianGit = class extends import_obsidian14.Plugin {
var _a2; var _a2;
(_a2 = this.statusBar) == null ? void 0 : _a2.displayMessage(message.toLowerCase(), timeout); (_a2 = this.statusBar) == null ? void 0 : _a2.displayMessage(message.toLowerCase(), timeout);
if (!this.settings.disablePopups) { if (!this.settings.disablePopups) {
new import_obsidian14.Notice(message, 5 * 1e3); new import_obsidian15.Notice(message, 5 * 1e3);
} }
console.log(`git obsidian message: ${message}`); console.log(`git obsidian message: ${message}`);
} }
displayError(message, timeout = 10 * 1e3) { displayError(message, timeout = 10 * 1e3) {
var _a2; var _a2;
message = message.toString(); message = message.toString();
new import_obsidian14.Notice(message, timeout); new import_obsidian15.Notice(message, timeout);
console.log(`git obsidian error: ${message}`); console.log(`git obsidian error: ${message}`);
(_a2 = this.statusBar) == null ? void 0 : _a2.displayMessage(message.toLowerCase(), timeout); (_a2 = this.statusBar) == null ? void 0 : _a2.displayMessage(message.toLowerCase(), timeout);
} }

View file

@ -4,5 +4,5 @@
"description": "Backup your vault with git.", "description": "Backup your vault with git.",
"isDesktopOnly": true, "isDesktopOnly": true,
"js": "main.js", "js": "main.js",
"version": "1.25.1" "version": "1.25.3"
} }

View file

@ -1,7 +1,7 @@
{ {
"id": "obsidian-kanban", "id": "obsidian-kanban",
"name": "Kanban", "name": "Kanban",
"version": "1.2.39", "version": "1.2.40",
"minAppVersion": "0.12.3", "minAppVersion": "0.12.3",
"description": "Create markdown-backed Kanban boards in Obsidian.", "description": "Create markdown-backed Kanban boards in Obsidian.",
"author": "mgmeyers", "author": "mgmeyers",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -5,5 +5,5 @@
"id": "open-note-to-window-title", "id": "open-note-to-window-title",
"isDesktopOnly": false, "isDesktopOnly": false,
"name": "Custom window title", "name": "Custom window title",
"version": "0.3.3" "version": "0.3.5"
} }