diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json index 0b17b49..d3f66fa 100644 --- a/.obsidian/community-plugins.json +++ b/.obsidian/community-plugins.json @@ -1,4 +1,3 @@ [ - "mrj-text-expand", "obsidian-git" ] \ No newline at end of file diff --git a/.obsidian/graph.json b/.obsidian/graph.json index a10df69..c65c33d 100644 --- a/.obsidian/graph.json +++ b/.obsidian/graph.json @@ -32,6 +32,6 @@ "repelStrength": 10, "linkStrength": 1, "linkDistance": 250, - "scale": 0.8153718570546572, + "scale": 0.6816823949098497, "close": true } \ No newline at end of file diff --git a/.obsidian/plugins/mrj-text-expand/data.json b/.obsidian/plugins/mrj-text-expand/data.json deleted file mode 100644 index ecd2864..0000000 --- a/.obsidian/plugins/mrj-text-expand/data.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "autoExpand": false, - "defaultTemplate": "- $link", - "delay": 100, - "excludeCurrent": true, - "lineEnding": "", - "prefixes": { - "header": "^", - "footer": ">" - } -} \ No newline at end of file diff --git a/.obsidian/plugins/mrj-text-expand/main.js b/.obsidian/plugins/mrj-text-expand/main.js deleted file mode 100644 index bae38a3..0000000 --- a/.obsidian/plugins/mrj-text-expand/main.js +++ /dev/null @@ -1,801 +0,0 @@ -'use strict'; - -var obsidian = require('obsidian'); - -/****************************************************************************** -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. -***************************************************************************** */ - -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -function getAllExpandersQuery(content) { - let accum = []; - for (var i = 0; i < content.length; i++) { - const line = content[i]; - if (line === '```expander') { - for (var e = 0; e < content.length - i; e++) { - const nextline = content[i + e]; - if (nextline === '```') { - accum.push({ - start: i, - end: i + e, - query: content[i + 1], - template: e > 2 ? content.slice(i + 2, i + e).join('\n') : '' - }); - break; - } - } - } - } - return accum; -} -function getClosestQuery(queries, lineNumber) { - if (queries.length === 0) { - return undefined; - } - return queries.reduce((a, b) => { - return Math.abs(b.start - lineNumber) < Math.abs(a.start - lineNumber) ? b : a; - }); -} -function getLastLineToReplace(content, query, endline) { - const lineFrom = query.end; - for (var i = lineFrom + 1; i < content.length; i++) { - if (content[i] === endline) { - return i; - } - } - return lineFrom + 1; -} -const pick = (obj, arr) => arr.reduce((acc, curr) => { - return (curr in obj) - ? Object.assign({}, acc, { [curr]: obj[curr] }) - : acc; -}, {}); - -// Functions for string processing -function splitByLines(content) { - return content.split('\n'); -} -function removeEmptyLines(s) { - const lines = s.split('\n').map(e => e.trim()); - if (lines.length < 2) { - return s; - } - else if (lines.indexOf('') === 0) { - return removeEmptyLines(lines.slice(1).join('\n')); - } - return s; -} -function removeFrontMatter(s, lookEnding = false) { - const lines = s.split('\n'); - if (lookEnding && lines.indexOf('---') === 0) { - return lines.slice(1).join('\n'); - } - else if (lookEnding) { - return removeFrontMatter(lines.slice(1).join('\n'), true); - } - else if (lines.indexOf('---') === 0) { - return removeFrontMatter(lines.slice(1).join('\n'), true); - } - return s; -} -function trimContent(content) { - return removeFrontMatter(removeEmptyLines(content)); -} - -function getFrontMatter(file, plugin, s) { - const { frontmatter = null } = plugin.app.metadataCache.getCache(file.path); - if (frontmatter) { - return frontmatter[s.split(':')[1]] || ''; - } - return ''; -} -function getFileInfo(plugin, file) { - return __awaiter(this, void 0, void 0, function* () { - const info = Object.assign({}, file, { - content: file.extension === 'md' ? yield plugin.app.vault.cachedRead(file) : '', - link: plugin.app.fileManager.generateMarkdownLink(file, file.name).replace(/^!/, '') - }, plugin.app.metadataCache.getFileCache(file)); - return pick(info, [ - 'basename', - 'content', - 'extension', - 'headings', - 'link', 'name', - 'path', 'sections', 'stat', - 'frontmatter', - 'links', - 'listItems' - ]); - }); -} - -function highlight(lineStart, lineEnd, matchStart, matchEnd, lineContent) { - return [ - ...lineContent.slice(0, matchStart - lineStart), - '==', - ...lineContent.slice(matchStart - lineStart, (matchStart - lineStart) + (matchEnd - matchStart)), - '==', - ...lineContent.slice((matchStart - lineStart) + (matchEnd - matchStart)), - ].join(''); -} -const sequences = [ - { - name: '\\$count', - loop: true, - format: (_p, _s, _content, _file, _d, index) => index ? String(index + 1) : String(1), - desc: 'add index number to each produced file' - }, - { - name: '\\$filename', - loop: true, - format: (_p, _s, _content, file) => file.basename, - desc: 'name of the founded file' - }, - { - name: '\\$link', - loop: true, - format: (p, _s, _content, file) => p.app.fileManager.generateMarkdownLink(file, file.path).replace('![[', '[['), - desc: 'link based on Obsidian settings' - }, - { - name: '\\$lines:\\d+', - loop: true, - readContent: true, - format: (p, s, content, _file) => { - const digits = Number(s.split(':')[1]); - return trimContent(content) - .split('\n') - .filter((_, i) => i < digits) - .join('\n') - .replace(new RegExp(p.config.lineEnding, 'g'), ''); - }, - desc: 'specified count of lines from the found file' - }, - { - name: '\\$characters:\\d+', - loop: true, - readContent: true, - format: (p, s, content, _file) => { - const digits = Number(s.split(':')[1]); - return trimContent(content) - .split('') - .filter((_, i) => i < digits) - .join('') - .replace(new RegExp(p.config.lineEnding, 'g'), ''); - }, - desc: 'specified count of lines from the found file' - }, - { - name: '\\$frontmatter:[\\p\{L\}_-]+', - loop: true, - format: (p, s, _content, file) => getFrontMatter(file, p, s), - desc: 'value from the frontmatter key in the found file' - }, - { - name: '\\$lines+', - loop: true, - readContent: true, - format: (p, s, content, _file) => content.replace(new RegExp(p.config.lineEnding, 'g'), ''), - desc: 'all content from the found file' - }, - { - name: '\\$ext', - loop: true, - format: (_p, s, content, file) => file.extension, - desc: 'return file extension' - }, - { - name: '\\$created:format:date', - loop: true, - format: (_p, s, content, file) => String(new Date(file.stat.ctime).toISOString()).split('T')[0], - desc: 'created time formatted' - }, - { - name: '\\$created:format:time', - loop: true, - format: (_p, s, content, file) => String(new Date(file.stat.ctime).toISOString()).split(/([.T])/)[2], - desc: 'created time formatted' - }, - { - name: '\\$created:format', - loop: true, - format: (_p, s, content, file) => String(new Date(file.stat.ctime).toISOString()), - desc: 'created time formatted' - }, - { - name: '\\$created', - loop: true, - format: (_p, s, content, file) => String(file.stat.ctime), - desc: 'created time' - }, - { - name: '\\$size', - loop: true, - format: (_p, s, content, file) => String(file.stat.size), - desc: 'size of the file' - }, - { - name: '\\$path', - loop: true, - format: (_p, s, content, file) => file.path, - desc: 'path to the found file' - }, - { - name: '\\$parent', - loop: true, - format: (_p, s, content, file) => file.parent.name, - desc: 'parent folder name' - }, - { - name: '^(.+|)\\$header:.+', - loop: true, - format: (p, s, content, file) => { - var _a; - const prefix = s.slice(0, s.indexOf('$')); - const header = s.slice(s.indexOf('$')).replace('$header:', '').replace(/"/g, ''); - const neededLevel = header.split("#").length - 1; - const neededTitle = header.replace(/^#+/g, '').trim(); - const metadata = p.app.metadataCache.getFileCache(file); - return ((_a = metadata.headings) === null || _a === void 0 ? void 0 : _a.filter(e => { - const tests = [ - [neededTitle, e.heading.includes(neededTitle)], - [neededLevel, e.level === neededLevel] - ].filter(e => e[0]); - if (tests.length) { - return tests.map(e => e[1]).every(e => e === true); - } - return true; - }).map(h => p.app.fileManager.generateMarkdownLink(file, file.basename, '#' + h.heading)).map(link => prefix + link).join('\n')) || ''; - }, - desc: 'headings from founded files. $header:## - return all level 2 headings. $header:Title - return all heading which match the string. Can be prepended like: - !$header:## to transclude the headings.' - }, - { - name: '^(.+|)\\$blocks', - readContent: true, - loop: true, - format: (p, s, content, file) => { - const prefix = s.slice(0, s.indexOf('$')); - return content - .split('\n') - .filter(e => /\^\w+$/.test(e)) - .map(e => prefix + p.app.fileManager.generateMarkdownLink(file, file.basename, '#' + e.replace(/^.+?(\^\w+$)/, '$1'))) - .join('\n'); - }, - desc: 'block ids from the found files. Can be prepended.' - }, - { - name: '^(.+|)\\$match:header', loop: true, format: (p, s, content, file, results) => { - var _a; - const prefix = s.slice(0, s.indexOf('$')); - const metadata = p.app.metadataCache.getFileCache(file); - const headings = (_a = metadata.headings) === null || _a === void 0 ? void 0 : _a.filter(h => results.result.content.filter(c => h.position.end.offset < c[0]).some(e => e)).slice(-1); - return headings - .map(h => p.app.fileManager.generateMarkdownLink(file, file.basename, '#' + h.heading)) - .map(link => prefix + link) - .join('\n') || ''; - }, desc: 'extract found selections' - }, - { - name: '^(.+|)\\$matchline(:(\\+|-|)\\d+:\\d+|:(\\+|-|)\\d+|)', - loop: true, - format: (_p, s, content, file, results) => { - const prefix = s.slice(0, s.indexOf('$matchline')); - const [keyword, context, limit] = s.slice(s.indexOf('$matchline')).split(':'); - const value = context || ''; - const limitValue = Number(limit); - const isPlus = value.contains('+'); - const isMinus = value.contains('-'); - const isContext = !isPlus && !isMinus; - const offset = Number(value.replace(/[+-]/, '')); - const lines = results.content.split('\n'); - // Grab info about line content, index, text length and start/end character position - const lineInfos = []; - for (let i = 0; i < lines.length; i++) { - const text = lines[i]; - if (i === 0) { - lineInfos.push({ - num: 0, - start: 0, - end: text.length, - text - }); - continue; - } - const start = lineInfos[i - 1].end + 1; - lineInfos.push({ - num: i, - start, - text, - end: text.length + start - }); - } - return results.result.content.map(([from, to]) => { - const matchedLines = lineInfos - .filter(({ start, end }) => start <= from && end >= to) - .map((line) => { - return Object.assign(Object.assign({}, line), { text: highlight(line.start, line.end, from, to, line.text) }); - }); - const resultLines = []; - for (const matchedLine of matchedLines) { - const prevLines = isMinus || isContext - ? lineInfos.filter(l => matchedLine.num - l.num > 0 && matchedLine.num - l.num < offset) - : []; - const nextLines = isPlus || isContext - ? lineInfos.filter(l => l.num - matchedLine.num > 0 && l.num - matchedLine.num < offset) - : []; - resultLines.push(...prevLines, matchedLine, ...nextLines); - } - return prefix + resultLines.map(e => e.text).join('\n'); - }).map(line => limitValue ? line.slice(0, limitValue) : line).join('\n'); - }, desc: 'extract line with matches' - }, - { - name: '^(.+|)\\$searchresult', - loop: true, - desc: '', - format: (_p, s, content, file, results) => { - const prefix = s.slice(0, s.indexOf('$searchresult')); - return results.children.map(matchedFile => { - return prefix + matchedFile.el.innerText; - }).join('\n'); - } - }, - { - name: '^(.+|)\\$match', loop: true, format: (_p, s, content, file, results) => { - if (!results.result.content) { - console.warn('There is no content in results'); - return ''; - } - function appendPrefix(prefix, line) { - return prefix + line; - } - const prefixContent = s.slice(0, s.indexOf('$')); - return results.result.content - .map(([from, to]) => results.content.slice(from, to)) - .map(line => appendPrefix(prefixContent, line)) - .join('\n'); - }, desc: 'extract found selections' - }, -]; - -function extractFilesFromSearchResults(searchResults, currentFileName, excludeCurrent = true) { - const files = Array.from(searchResults.keys()); - return excludeCurrent - ? files.filter(file => file.basename !== currentFileName) - : files; -} - -var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - -function createCommonjsModule(fn, basedir, module) { - return module = { - path: basedir, - exports: {}, - require: function (path, base) { - return commonjsRequire(path, (base === undefined || base === null) ? module.path : base); - } - }, fn(module, module.exports), module.exports; -} - -function commonjsRequire () { - throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs'); -} - -var eta_min = createCommonjsModule(function (module, exports) { -!function(e,n){n(exports);}(commonjsGlobal,(function(e){function n(e){var t,r,i=new Error(e);return t=i,r=n.prototype,Object.setPrototypeOf?Object.setPrototypeOf(t,r):t.__proto__=r,i}function t(e,t,r){var i=t.slice(0,r).split(/\n/),a=i.length,o=i[a-1].length+1;throw n(e+=" at line "+a+" col "+o+":\n\n "+t.split(/\n/)[a-1]+"\n "+Array(o).join(" ")+"^")}n.prototype=Object.create(Error.prototype,{name:{value:"Eta Error",enumerable:!1}});var r=new Function("return this")().Promise;function i(e,n){for(var t in n)r=n,i=t,Object.prototype.hasOwnProperty.call(r,i)&&(e[t]=n[t]);var r,i;return e}function a(e,n,t,r){var i,a;return Array.isArray(n.autoTrim)?(i=n.autoTrim[1],a=n.autoTrim[0]):i=a=n.autoTrim,(t||!1===t)&&(i=t),(r||!1===r)&&(a=r),a||i?"slurp"===i&&"slurp"===a?e.trim():("_"===i||"slurp"===i?e=function(e){return String.prototype.trimLeft?e.trimLeft():e.replace(/^\s+/,"")}(e):"-"!==i&&"nl"!==i||(e=e.replace(/^(?:\r\n|\n|\r)/,"")),"_"===a||"slurp"===a?e=function(e){return String.prototype.trimRight?e.trimRight():e.replace(/\s+$/,"")}(e):"-"!==a&&"nl"!==a||(e=e.replace(/(?:\r\n|\n|\r)$/,"")),e):e}var o={"&":"&","<":"<",">":">",'"':""","'":"'"};function c(e){return o[e]}var s=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,l=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,u=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;function p(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function f(e,n){var r=[],i=!1,o=0,c=n.parse;if(n.plugins)for(var f=0;f"']/.test(n)?n.replace(/[&<>"']/g,c):n},include:function(e,t){var r=this.templates.get(e);if(!r)throw n('Could not fetch template "'+e+'"');return r(t,this)},parse:{exec:"",interpolate:"=",raw:"~"},plugins:[],rmWhitespace:!1,tags:["<%","%>"],templates:g,useWith:!1,varName:"it"};function m(e,n){var t={};return i(t,h),n&&i(t,n),e&&i(t,e),t}function v(e,t){var r=m(t||{}),i=r.async?function(){try{return new Function("return (async function(){}).constructor")()}catch(e){throw e instanceof SyntaxError?n("This environment doesn't support async/await"):e}}():Function;try{return new i(r.varName,"E","cb",d(e,r))}catch(t){throw t instanceof SyntaxError?n("Bad template syntax\n\n"+t.message+"\n"+Array(t.message.length+1).join("=")+"\n"+d(e,r)+"\n"):t}}function y(e,n){if(n.cache&&n.name&&n.templates.get(n.name))return n.templates.get(n.name);var t="function"==typeof e?e:v(e,n);return n.cache&&n.name&&n.templates.define(n.name,t),t}function x(e,t,i,a){var o=m(i||{});if(!o.async)return y(e,o)(t,o);if(!a){if("function"==typeof r)return new r((function(n,r){try{n(y(e,o)(t,o));}catch(e){r(e);}}));throw n("Please provide a callback function, this env doesn't support Promises")}try{y(e,o)(t,o,a);}catch(e){return a(e)}}e.compile=v,e.compileToString=d,e.config=h,e.configure=function(e){return i(h,e)},e.defaultConfig=h,e.getConfig=m,e.parse=f,e.render=x,e.renderAsync=function(e,n,t,r){return x(e,n,Object.assign({},t,{async:!0}),r)},e.templates=g,Object.defineProperty(e,"__esModule",{value:!0});})); - -}); - -class TextExpander extends obsidian.Plugin { - constructor(app, plugin) { - super(app, plugin); - this.config = { - autoExpand: false, - defaultTemplate: '- $link', - delay: 300, - excludeCurrent: true, - lineEnding: '<-->', - prefixes: { - header: '^', - footer: '>' - } - }; - this.seqs = sequences; - this.leftPanelInfo = { - collapsed: false, - tab: 0, - text: '' - }; - this.search = this.search.bind(this); - this.init = this.init.bind(this); - this.autoExpand = this.autoExpand.bind(this); - } - autoExpand() { - return __awaiter(this, void 0, void 0, function* () { - if (!this.config.autoExpand) { - return; - } - const activeLeaf = this.app.workspace.activeLeaf; - if (!activeLeaf) { - return; - } - const activeView = activeLeaf.view; - const isAllowedView = activeView instanceof obsidian.MarkdownView; - if (!isAllowedView) { - return; - } - yield this.init(true); - }); - } - onload() { - return __awaiter(this, void 0, void 0, function* () { - this.addSettingTab(new SettingTab(this.app, this)); - this.registerMarkdownCodeBlockProcessor('expander', (source, el, ctx) => { - el - .createDiv() - .createEl('button', { text: 'Run expand query' }) - .addEventListener('click', this.init.bind(this, false, ctx.getSectionInfo(el).lineStart)); - }); - this.addCommand({ - id: 'editor-expand', - name: 'expand', - callback: this.init, - hotkeys: [] - }); - this.addCommand({ - id: 'editor-expand-all', - name: 'expand all', - callback: () => this.init(true), - hotkeys: [] - }); - this.app.workspace.on('file-open', this.autoExpand); - const data = yield this.loadData(); - if (data) { - this.config = Object.assign(Object.assign({}, this.config), data); - } - }); - } - onunload() { - console.log('unloading plugin'); - this.app.workspace.off('file-open', this.autoExpand); - } - saveSettings() { - return __awaiter(this, void 0, void 0, function* () { - yield this.saveData(this.config); - }); - } - init(proceedAllQueriesOnPage = false, lineToStart) { - return __awaiter(this, void 0, void 0, function* () { - const currentView = this.app.workspace.activeLeaf.view; - // Is on editable view - if (!(currentView instanceof obsidian.MarkdownView)) { - return; - } - const cmDoc = this.cm = currentView.editor; - const curNum = lineToStart || cmDoc.getCursor().line; - const content = cmDoc.getValue(); - if (lineToStart) { - cmDoc.setCursor(lineToStart ? lineToStart - 1 : 0); - } - const formatted = splitByLines(content); - const findQueries = getAllExpandersQuery(formatted); - const closestQuery = getClosestQuery(findQueries, curNum); - if (proceedAllQueriesOnPage) { - yield findQueries.reduce((promise, query, i) => promise.then(() => { - const newContent = splitByLines(cmDoc.getValue()); - const updatedQueries = getAllExpandersQuery(newContent); - return this.runExpanderCodeBlock(updatedQueries[i], newContent, currentView); - }), Promise.resolve()); - } - else { - yield this.runExpanderCodeBlock(closestQuery, formatted, currentView); - } - }); - } - runExpanderCodeBlock(query, content, view) { - return __awaiter(this, void 0, void 0, function* () { - const { lineEnding, prefixes } = this.config; - if (!query) { - new Notification('Expand query not found'); - return Promise.resolve(); - } - this.clearOldResultsInFile(content, query, lineEnding); - const newContent = splitByLines(this.cm.getValue()); - if (query.query !== '') { - this.search(query.query); - } - return yield this.runTemplateProcessing(query, getLastLineToReplace(newContent, query, this.config.lineEnding), prefixes, view); - }); - } - runTemplateProcessing(query, lastLine, prefixes, currentView) { - var _a; - return __awaiter(this, void 0, void 0, function* () { - let currentFileName = ''; - const templateContent = query.template.split('\n'); - const { heading, footer, repeatableContent } = this.parseTemplate(prefixes, templateContent); - if (currentView instanceof obsidian.FileView) { - currentFileName = currentView.file.basename; - } - this.saveLeftPanelState(); - const searchResults = yield this.getFoundAfterDelay(query.query === ''); - const files = extractFilesFromSearchResults(searchResults, currentFileName, this.config.excludeCurrent); - this.restoreLeftPanelState(); - currentView.editor.focus(); - const currentFileInfo = (currentView instanceof obsidian.FileView) - ? yield getFileInfo(this, currentView.file) - : {}; - const filesInfo = yield Promise.all(files.map(file => getFileInfo(this, file))); - let changed; - if (query.template.contains("<%")) { - const templateToRender = repeatableContent.join('\n'); - const dataToRender = { - current: currentFileInfo, - files: filesInfo - }; - changed = yield eta_min.render(templateToRender, dataToRender, { autoEscape: false }); - // changed = doT.template(templateToRender, {strip: false})(dataToRender) - } - else { - changed = yield this.generateTemplateFromSequences(files, repeatableContent, searchResults); - } - let result = [ - heading, - changed, - footer, - this.config.lineEnding - ].filter(e => e).join('\n'); - // Do not paste generated content if used changed activeLeaf - const viewBeforeReplace = this.app.workspace.activeLeaf.view; - if (!(viewBeforeReplace instanceof obsidian.MarkdownView) || viewBeforeReplace.file.basename !== currentFileName) { - return; - } - currentView.editor.replaceRange(result, { line: query.end + 1, ch: 0 }, { line: lastLine, ch: ((_a = this.cm.getLine(lastLine)) === null || _a === void 0 ? void 0 : _a.length) || 0 }); - return Promise.resolve(); - }); - } - generateTemplateFromSequences(files, repeatableContent, searchResults) { - return __awaiter(this, void 0, void 0, function* () { - if (!searchResults) { - return ''; - } - const changed = yield Promise.all(files - .map((file, i) => __awaiter(this, void 0, void 0, function* () { - const result = yield Promise.all(repeatableContent.map((s) => __awaiter(this, void 0, void 0, function* () { return yield this.applyTemplateToSearchResults(searchResults, file, s, i); }))); - return result.join('\n'); - }))); - return changed.join('\n'); - }); - } - parseTemplate(prefixes, templateContent) { - const isHeader = (line) => line.startsWith(prefixes.header); - const isFooter = (line) => line.startsWith(prefixes.footer); - const isRepeat = (line) => !isHeader(line) && !isFooter(line); - const heading = templateContent.filter(isHeader).map((s) => s.slice(1)).join('\n'); - const footer = templateContent.filter(isFooter).map((s) => s.slice(1)).join('\n'); - const repeatableContent = templateContent.filter(isRepeat).filter(e => e).length === 0 - ? [this.config.defaultTemplate] - : templateContent.filter(isRepeat).filter(e => e); - return { heading, footer, repeatableContent }; - } - saveLeftPanelState() { - this.leftPanelInfo = { - collapsed: this.app.workspace.leftSplit.collapsed, - tab: this.getSearchTabIndex(), - text: this.getSearchValue(), - }; - } - restoreLeftPanelState() { - const { collapsed, tab, text } = this.leftPanelInfo; - const splitChildren = this.getLeftSplitElement(); - this.getSearchView().searchComponent.setValue(text); - if (tab !== splitChildren.currentTab) { - splitChildren.selectTabIndex(tab); - } - if (collapsed) { - this.app.workspace.leftSplit.collapse(); - } - } - search(s) { - // @ts-ignore - const globalSearchFn = this.app.internalPlugins.getPluginById('global-search').instance.openGlobalSearch.bind(this); - const search = (query) => globalSearchFn(query); - search(s); - } - getLeftSplitElement() { - // @ts-ignore - return this.app.workspace.leftSplit.children[0]; - } - getSearchView() { - const view = this.getLeftSplitElement().children.filter(e => e.getViewState().type === 'search')[0].view; - if ('searchComponent' in view) { - return view; - } - return undefined; - } - getSearchValue() { - const view = this.getSearchView(); - if (view) { - return view.searchComponent.getValue(); - } - return ''; - } - getSearchTabIndex() { - const leftTabs = this.getLeftSplitElement().children; - let searchTabId; - this.app.workspace.iterateAllLeaves((leaf) => { - if (leaf.getViewState().type == "search") { - searchTabId = leaf.id; - } - }); - return leftTabs.findIndex((item, _index, _array) => { - if (item.id == searchTabId) { - return true; - } - }); - } - ; - getFoundAfterDelay(immediate) { - return __awaiter(this, void 0, void 0, function* () { - const searchLeaf = this.app.workspace.getLeavesOfType('search')[0]; - const view = yield searchLeaf.open(searchLeaf.view); - if (immediate) { - // @ts-ignore - return Promise.resolve(view.dom.resultDomLookup); - } - return new Promise(resolve => { - setTimeout(() => { - // @ts-ignore - return resolve(view.dom.resultDomLookup); - }, this.config.delay); - }); - }); - } - applyTemplateToSearchResults(searchResults, file, template, index) { - return __awaiter(this, void 0, void 0, function* () { - const fileContent = (new RegExp(this.seqs.filter(e => e.readContent).map(e => e.name).join('|')).test(template)) - ? yield this.app.vault.cachedRead(file) - : ''; - return this.seqs.reduce((acc, seq) => acc.replace(new RegExp(seq.name, 'gu'), replace => seq.format(this, replace, fileContent, file, searchResults.get(file), index)), template); - }); - } - clearOldResultsInFile(content, query, lineEnding) { - var _a; - const lastLine = getLastLineToReplace(content, query, this.config.lineEnding); - this.cm.replaceRange('\n' + lineEnding, { line: query.end + 1, ch: 0 }, { line: lastLine, ch: ((_a = this.cm.getLine(lastLine)) === null || _a === void 0 ? void 0 : _a.length) || 0 }); - } -} -class SettingTab extends obsidian.PluginSettingTab { - constructor(app, plugin) { - super(app, plugin); - this.app = app; - this.plugin = plugin; - } - display() { - let { containerEl } = this; - containerEl.empty(); - containerEl.createEl('h2', { text: 'Settings for Text Expander' }); - new obsidian.Setting(containerEl) - .setName('Auto Expand') - .setDesc('Expand all queries in a file once you open it') - .addToggle(toggle => { - toggle - .setValue(this.plugin.config.autoExpand) - .onChange(value => { - this.plugin.config.autoExpand = value; - this.plugin.saveSettings(); - }); - }); - new obsidian.Setting(containerEl) - .setName('Delay') - .setDesc('Text expander don\' wait until search completed. It waits for a delay and paste result after that.') - .addSlider(slider => { - slider.setLimits(100, 10000, 100); - slider.setValue(this.plugin.config.delay); - slider.onChange(value => { - this.plugin.config.delay = value; - this.plugin.saveSettings(); - }); - slider.setDynamicTooltip(); - }); - new obsidian.Setting(containerEl) - .setName('Line ending') - .setDesc('You can specify the text which will appear at the bottom of the generated text.') - .addText(text => { - text.setValue(this.plugin.config.lineEnding) - .onChange(val => { - this.plugin.config.lineEnding = val; - this.plugin.saveSettings(); - }); - }); - new obsidian.Setting(containerEl) - .setName('Default template') - .setDesc('You can specify default template') - .addTextArea(text => { - text.setValue(this.plugin.config.defaultTemplate) - .onChange(val => { - this.plugin.config.defaultTemplate = val; - this.plugin.saveSettings(); - }); - }); - new obsidian.Setting(containerEl) - .setName('Exclude current file') - .setDesc('You can specify should text expander exclude results from current file or not') - .addToggle(toggle => { - toggle - .setValue(this.plugin.config.excludeCurrent) - .onChange(value => { - this.plugin.config.excludeCurrent = value; - this.plugin.saveSettings(); - }); - }); - new obsidian.Setting(containerEl) - .setHeading() - .setName('Prefixes'); - new obsidian.Setting(containerEl) - .setName('Header') - .setDesc('Line prefixed by this symbol will be recognized as header') - .addText(text => { - text.setValue(this.plugin.config.prefixes.header) - .onChange(val => { - this.plugin.config.prefixes.header = val; - this.plugin.saveSettings(); - }); - }); - new obsidian.Setting(containerEl) - .setName('Footer') - .setDesc('Line prefixed by this symbol will be recognized as footer') - .addText(text => { - text.setValue(this.plugin.config.prefixes.footer) - .onChange(val => { - this.plugin.config.prefixes.footer = val; - this.plugin.saveSettings(); - }); - }); - new obsidian.Setting(containerEl) - .setName('Sequences') - .setDesc('REGEXP - DESCRIPTION') - .setDesc((() => { - const fragment = new DocumentFragment(); - const div = fragment.createEl('div'); - this.plugin.seqs - .map(e => e.name + ' - ' + (e.desc || '')) - .map(e => { - const el = fragment.createEl('div'); - el.setText(e); - el.setAttribute('style', ` - border-bottom: 1px solid rgba(255, 255, 255, 0.1); - margin-bottom: 0.5rem; - padding-bottom: 0.5rem; - `); - return el; - }).forEach(el => { - div.appendChild(el); - }); - fragment.appendChild(div); - return fragment; - })()); - } -} - -module.exports = TextExpander; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNv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HVyblwiXSA6IG9wWzBdID8geVtcInRocm93XCJdIHx8ICgodCA9IHlbXCJyZXR1cm5cIl0pICYmIHQuY2FsbCh5KSwgMCkgOiB5Lm5leHQpICYmICEodCA9IHQuY2FsbCh5LCBvcFsxXSkpLmRvbmUpIHJldHVybiB0O1xyXG4gICAgICAgICAgICBpZiAoeSA9IDAsIHQpIG9wID0gW29wWzBdICYgMiwgdC52YWx1ZV07XHJcbiAgICAgICAgICAgIHN3aXRjaCAob3BbMF0pIHtcclxuICAgICAgICAgICAgICAgIGNhc2UgMDogY2FzZSAxOiB0ID0gb3A7IGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgY2FzZSA0OiBfLmxhYmVsKys7IHJldHVybiB7IHZhbHVlOiBvcFsxXSwgZG9uZTogZmFsc2UgfTtcclxuICAgICAgICAgICAgICAgIGNhc2UgNTogXy5sYWJlbCsrOyB5ID0gb3BbMV07IG9wID0gWzBdOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGNhc2UgNzogb3AgPSBfLm9wcy5wb3AoKTsgXy50cnlzLnBvcCgpOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEodCA9IF8udHJ5cywgdCA9IHQubGVuZ3RoID4gMCAmJiB0W3QubGVuZ3RoIC0gMV0pICYmIChvcFswXSA9PT0gNiB8fCBvcFswXSA9PT0gMikpIHsgXyA9IDA7IGNvbnRpbnVlOyB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wWzBdID09PSAzICYmICghdCB8fCAob3BbMV0gPiB0WzBdICYmIG9wWzFdIDwgdFszXSkpKSB7IF8ubGFiZWwgPSBvcFsxXTsgYnJlYWs7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAob3BbMF0gPT09IDYgJiYgXy5sYWJlbCA8IHRbMV0pIHsgXy5sYWJlbCA9IHRbMV07IHQgPSBvcDsgYnJlYWs7IH1cclxuICAgICAgICA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BpbnRlcmZhY2UgRXhwYW5kZXJRdWVyeSB7XG4gICAgc3RhcnQ6IG51bWJlclxuICAgIGVuZDogbnVtYmVyXG4gICAgdGVtcGxhdGU6IHN0cmluZ1xuICAgIHF1ZXJ5OiBzdHJpbmdcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGdldEFsbEV4cGFuZGVyc1F1ZXJ5KGNvbnRlbnQ6IHN0cmluZ1tdKTogRXhwYW5kZXJRdWVyeVtdIHtcbiAgICBsZXQgYWNjdW06IEV4cGFuZGVyUXVlcnlbXSA9IFtdXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjb250ZW50Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgIGNvbnN0IGxpbmUgPSBjb250ZW50W2ldXG5cbiAgICAgICAgaWYgKGxpbmUgPT09ICdgYGBleHBhbmRlcicpIHtcbiAgICAgICAgICAgIGZvciAodmFyIGUgPSAwOyBlIDwgY29udGVudC5sZW5ndGggLSBpOyBlKyspIHtcbiAgICAgICAgICAgICAgICBjb25zdCBuZXh0bGluZSA9IGNvbnRlbnRbaSArIGVdXG4gICAgICAgICAgICAgICAgaWYgKG5leHRsaW5lID09PSAnYGBgJykge1xuICAgICAgICAgICAgICAgICAgICBhY2N1bS5wdXNoKFxuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0OiBpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuZDogaSArIGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVlcnk6IGNvbnRlbnRbaSArIDFdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlOiBlID4gMiA/IGNvbnRlbnQuc2xpY2UoaSArIDIsIGkgKyBlKS5qb2luKCdcXG4nKSA6ICcnXG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgIC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gnOicpWzFdKVxuXG4gICAgICAgICAgICByZXR1cm4gdHJpbUNvbnRlbnQoY29udGVudClcbiAgICAgICAgICAgICAgICAuc3BsaXQoJ1xcbicpXG4gICAgICAgICAgICAgICAgLmZpbHRlcigoXzogc3RyaW5nLCBpOiBudW1iZXIpID0+IGkgPCBkaWdpdHMpXG4gICAgICAgICAgICAgICAgLmpvaW4oJ1xcbicpXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UobmV3IFJlZ0V4cChwLmNvbmZpZy5saW5lRW5kaW5nLCAnZycpLCAnJylcbiAgICAgICAgfSxcbiAgICAgICAgZGVzYzogJ3NwZWNpZmllZCBjb3VudCBvZiBsaW5lcyBmcm9tIHRoZSBmb3VuZCBmaWxlJ1xuICAgIH0sXG4gICAge1xuICAgICAgICBuYW1lOiAnXFxcXCRjaGFyYWN0ZXJzOlxcXFxkKycsXG4gICAgICAgIGxvb3A6IHRydWUsXG4gICAgICAgIHJlYWRDb250ZW50OiB0cnVlLFxuICAgICAgICBmb3JtYXQ6IChwLCBzOiBzdHJpbmcsIGNvbnRlbnQ6IHN0cmluZywgX2ZpbGU6IFRGaWxlKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBkaWdpdHMgPSBOdW1iZXIocy5zcGxpdCgnOicpWzFdKVxuXG4gICAgICAgICAgICByZXR1cm4gdHJpbUNvbnRlbnQoY29udGVudClcbiAgICAgICAgICAgICAgICAuc3BsaXQoJycpXG4gICAgICAgICAgICAgICAgLmZpbHRlcigoXzogc3RyaW5nLCBpOiBudW1iZXIpID0+IGkgPCBkaWdpdHMpXG4gICAgICAgICAgICAgICAgLmpvaW4oJycpXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UobmV3IFJlZ0V4cChwLmNvbmZpZy5saW5lRW5kaW5nLCAnZycpLCAnJylcbiAgICAgICAgfSxcbiAgICAgICAgZGVzYzogJ3NwZWNpZmllZCBjb3VudCBvZiBsaW5lcyBmcm9tIHRoZSBmb3VuZCBmaWxlJ1xuICAgI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gcmVzdWx0cykgPT4ge1xuICAgICAgICAgICAgY29uc3QgcHJlZml4ID0gcy5zbGljZSgwLCBzLmluZGV4T2YoJyRtYXRjaGxpbmUnKSk7XG4gICAgICAgICAgICBjb25zdCBba2V5d29yZCwgY29udGV4dCwgbGltaXRdID0gcy5zbGljZShzLmluZGV4T2YoJyRtYXRjaGxpbmUnKSkuc3BsaXQoJzonKVxuICAgICAgICAgICAgY29uc3QgdmFsdWUgPSBjb250ZXh0IHx8ICcnO1xuICAgICAgICAgICAgY29uc3QgbGltaXRWYWx1ZSA9IE51bWJlcihsaW1pdClcbiAgICAgICAgICAgIGNvbnN0IGlzUGx1cyA9IHZhbHVlLmNvbnRhaW5zKCcrJyk7XG4gICAgICAgICAgICBjb25zdCBpc01pbnVzID0gdmFsdWUuY29udGFpbnMoJy0nKTtcbiAgICAgICAgICAgIGNvbnN0IGlzQ29udGV4dCA9ICFpc1BsdXMgJiYgIWlzTWludXM7XG4gICAgICAgICAgICBjb25zdCBvZmZzZXQgPSBOdW1iZXIodmFsdWUucmVwbGFjZSgvWystXS8sICcnKSk7XG5cbiAgICAgICAgICAgIGNvbnN0IGxpbmVzID0gcmVzdWx0cy5jb250ZW50LnNwbGl0KCdcXG4nKTtcblxuICAgICAgICAgICAgLy8gR3JhYiBpbmZvIGFib3V0IGxpbmUgY29udGVudCwgaW5kZXgsIHRleHQgbGVuZ3RoIGFuZCBzdGFydC9lbmQgY2hhcmFjdGVyIHBvc2l0aW9uXG4gICAgICAgICAgICBjb25zdCBsaW5lSW5mb3M6IEFycmF5PExpbmVJbmZvPiA9IFtdXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGxpbmVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgdGV4dCA9IGxpbmVzW2ldXG5cbiAgICAgICAgICAgICAgICBpZiAoaSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBsaW5lSW5mb3MucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICBudW06IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGFydDogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVuZDogdGV4dC5sZW5ndGgsXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0XG4gICAgICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICAgICAgY29udGludWVcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjb25zdCBzdGFydCA9IGxpbmVJbmZvc1tpLTFdLmVuZCArIDFcbiAgICAgICAgICAgICAgICBsaW5lSW5mb3MucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIG51bTogaSxcbiAgICAgICAgICAgICAgICAgICAgc3RhcnQsXG4gICAgICAgICAgICAgICAgICAgIHRleHQsXG4gICAgICAgICAgICAgICAgICAgIGVuZDogdGV4dC5sZW5ndGggKyBzdGFydFxuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiByZXN1bHRzLnJlc3VsdC5jb250ZW50Lm1hcCgoW2Zyb20sIHRvXSkgPT4ge1xuICAgICAgICAgICAgICAgIGNvbnN0IG1hdGNoZWRMaW5lcyA9IGxpbmVJbmZvc1xuICAgICAgICAgICAgICAgICAgICAuZmlsdGVyKCh7IHN0YXJ0LCBlbmQgfSkgPT4gc3RhcnQgPD0gZnJvbSAmJiBlbmQgPj0gdG8pXG4gICAgICAgICAgICAgICAgICAgIC5tYXAoKGxpbmUpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLi4ubGluZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0OiBoaWdobGlnaHQobGluZS5zdGFydCwgbGluZS5lbmQsIGZyb20sIHRvLCBsaW5lLnRleHQpXG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICBjb25zdCByZXN1bHRMaW5lczogTGluZUluZm9bXSA9IFtdXG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCBtYXRjaGVkTGluZSBvZiBtYXRjaGVkTGluZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcHJldkxpbmVzID0gaXNNaW51cyB8fCBpc0NvbnRleHRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBsaW5lSW5mb3MuZmlsdGVyKGwgPT4gbWF0Y2hlZExpbmUubnVtIC0gbC5udW0gPiAwICYmIG1hdGNoZWRMaW5lLm51bSAtIGwubnVtIDwgb2Zmc2V0KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFtdXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IG5leHRMaW5lcyA9IGlzUGx1cyB8fCBpc0NvbnRleHRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBsaW5lSW5mb3MuZmlsdGVyKGwgPT4gbC5udW0gLSBtYXRjaGVkTGluZS5udW0gPiAwICYmIGwubnVtIC0gbWF0Y2hlZExpbmUubnVtIDwgb2Zmc2V0KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFtdXG5cbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0TGluZXMucHVzaCggLi4ucHJldkxpbmVzLCBtYXRjaGVkTGluZSwgLi4ubmV4dExpbmVzIClcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gcHJlZml4ICsgcmVzdWx0TGluZXMubWFwKGUgPT4gZS50ZXh0KS5qb2luKCdcXG4nKVxuICAgICAgICAgICAgfSkubWFwKGxpbmUgPT4gbGltaXRWYWx1ZSA/IGxpbmUuc2xpY2UoMCwgbGltaXRWYWx1ZSkgOiBsaW5lKS5qb2luKCdcXG4nKVxuICAgICAgICB9LCBkZXNjOiAnZXh0cmFjdCBsaW5lIHdpdGggbWF0Y2hlcydcbiAgICB9LFxuICAgIHtcbiAgICAgICAgbmFtZTogJ14oLit8KVxcXFwkc2VhcmNocmVzdWx0JyxcbiAgICAgICAgbG9vcDogdHJ1ZSxcbiAgICAgICAgZGVzYzogJycsXG4gICAgICAgIGZvcm1hdDogKF9wLCBzOiBzdHJpbmcsIGNvbnRlbnQ6IHN0cmluZywgZmlsZTogVEZpbGUsIHJlc3VsdHMpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IHByZWZpeCA9IHMuc2xpY2UoMCwgcy5pbmRleE9mKCckc2VhcmNocmVzdWx0JykpO1xuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdHMuY2hpbGRyZW4ubWFwKG1hdGNoZWRGaWxlID0+IHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcHJlZml4ICsgbWF0Y2hlZEZpbGUuZWwuaW5uZXJUZXh0XG4gICAgICAgICAgICB9KS5qb2luKCdcXG4nKVxuICAgICAgICB9XG4gICAgfSxcbiAgICB7XG4gICAgICAgIG5hbWU6ICdeKC4rfClcXFxcJG1hdGNoJywgbG9vcDogdHJ1ZSwgZm9ybWF0OiAoX3AsIHM6IHN0cmluZywgY29udGVudDogc3RyaW5nLCBmaWxlOiBURmlsZSwgcmVzdWx0cykgPT4ge1xuXG4gICAgICAgICAgICBpZiAoIXJlc3VsdHMucmVzdWx0LmNvbnRlbnQpIHtcbiAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oJ1RoZXJlIGlzIG5vIGNvbnRlbnQgaW4gcmVzdWx0cycpXG4gICAgICAgICAgICAgICAgcmV0dXJuICcnXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGFwcGVuZFByZWZpeChwcmVmaXg6IHN0cmluZywgbGluZTogc3RyaW5nKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHByZWZpeCArIGxpbmU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGNvbnN0IHByZWZpeENvbnRlbnQgPSBzLnNsaWNl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AgICAgICAgICAgICAgIC5zZXRWYWx1ZSh0aGlzLnBsdWdpbi5jb25maWcuYXV0b0V4cGFuZClcbiAgICAgICAgICAgICAgICAgICAgLm9uQ2hhbmdlKHZhbHVlID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGx1Z2luLmNvbmZpZy5hdXRvRXhwYW5kID0gdmFsdWVcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGx1Z2luLnNhdmVTZXR0aW5ncygpXG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9KVxuXG4gICAgICAgIG5ldyBTZXR0aW5nKGNvbnRhaW5lckVsKVxuICAgICAgICAgICAgLnNldE5hbWUoJ0RlbGF5JylcbiAgICAgICAgICAgIC5zZXREZXNjKCdUZXh0IGV4cGFuZGVyIGRvblxcJyB3YWl0IHVudGlsIHNlYXJjaCBjb21wbGV0ZWQuIEl0IHdhaXRzIGZvciBhIGRlbGF5IGFuZCBwYXN0ZSByZXN1bHQgYWZ0ZXIgdGhhdC4nKVxuICAgICAgICAgICAgLmFkZFNsaWRlcihzbGlkZXIgPT4ge1xuICAgICAgICAgICAgICAgIHNsaWRlci5zZXRMaW1pdHMoMTAwLCAxMDAwMCwgMTAwKVxuICAgICAgICAgICAgICAgIHNsaWRlci5zZXRWYWx1ZSh0aGlzLnBsdWdpbi5jb25maWcuZGVsYXkpXG4gICAgICAgICAgICAgICAgc2xpZGVyLm9uQ2hhbmdlKHZhbHVlID0+IHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wbHVnaW4uY29uZmlnLmRlbGF5ID0gdmFsdWVcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wbHVnaW4uc2F2ZVNldHRpbmdzKClcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIHNsaWRlci5zZXREeW5hbWljVG9vbHRpcCgpXG4gICAgICAgICAgICB9KVxuXG4gICAgICAgIG5ldyBTZXR0aW5nKGNvbnRhaW5lckVsKVxuICAgICAgICAgICAgLnNldE5hbWUoJ0xpbmUgZW5kaW5nJylcbiAgICAgICAgICAgIC5zZXREZXNjKCdZb3UgY2FuIHNwZWNpZnkgdGhlIHRleHQgd2hpY2ggd2lsbCBhcHBlYXIgYXQgdGhlIGJvdHRvbSBvZiB0aGUgZ2VuZXJhdGVkIHRleHQuJylcbiAgICAgICAgICAgIC5hZGRUZXh0KHRleHQgPT4ge1xuICAgICAgICAgICAgICAgIHRleHQuc2V0VmFsdWUodGhpcy5wbHVnaW4uY29uZmlnLmxpbmVFbmRpbmcpXG4gICAgICAgICAgICAgICAgICAgIC5vbkNoYW5nZSh2YWwgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wbHVnaW4uY29uZmlnLmxpbmVFbmRpbmcgPSB2YWxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGx1Z2luLnNhdmVTZXR0aW5ncygpXG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9KVxuXG4gICAgICAgIG5ldyBTZXR0aW5nKGNvbnRhaW5lckVsKVxuICAgICAgICAgICAgLnNldE5hbWUoJ0RlZmF1bHQgdGVtcGxhdGUnKVxuICAgICAgICAgICAgLnNldERlc2MoJ1lvdSBjYW4gc3BlY2lmeSBkZWZhdWx0IHRlbXBsYXRlJylcbiAgICAgICAgICAgIC5hZGRUZXh0QXJlYSh0ZXh0ID0+IHtcbiAgICAgICAgICAgICAgICB0ZXh0LnNldFZhbHVlKHRoaXMucGx1Z2luLmNvbmZpZy5kZWZhdWx0VGVtcGxhdGUpXG4gICAgICAgICAgICAgICAgICAgIC5vbkNoYW5nZSh2YWwgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wbHVnaW4uY29uZmlnLmRlZmF1bHRUZW1wbGF0ZSA9IHZhbFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wbHVnaW4uc2F2ZVNldHRpbmdzKClcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIH0pXG5cbiAgICAgICAgbmV3IFNldHRpbmcoY29udGFpbmVyRWwpXG4gICAgICAgICAgICAuc2V0TmFtZSgnRXhjbHVkZSBjdXJyZW50IGZpbGUnKVxuICAgICAgICAgICAgLnNldERlc2MoJ1lvdSBjYW4gc3BlY2lmeSBzaG91bGQgdGV4dCBleHBhbmRlciBleGNsdWRlIHJlc3VsdHMgZnJvbSBjdXJyZW50IGZpbGUgb3Igbm90JylcbiAgICAgICAgICAgIC5hZGRUb2dnbGUodG9nZ2xlID0+IHtcbiAgICAgICAgICAgICAgICB0b2dnbGVcbiAgICAgICAgICAgICAgICAgICAgLnNldFZhbHVlKHRoaXMucGx1Z2luLmNvbmZpZy5leGNsdWRlQ3VycmVudClcbiAgICAgICAgICAgICAgICAgICAgLm9uQ2hhbmdlKHZhbHVlID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGx1Z2luLmNvbmZpZy5leGNsdWRlQ3VycmVudCA9IHZhbHVlXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBsdWdpbi5zYXZlU2V0dGluZ3MoKVxuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfSlcblxuICAgICAgICBuZXcgU2V0dGluZyhjb250YWluZXJFbClcbiAgICAgICAgICAgIC5zZXRIZWFkaW5nKClcbiAgICAgICAgICAgIC5zZXROYW1lKCdQcmVmaXhlcycpXG5cbiAgICAgICAgbmV3IFNldHRpbmcoY29udGFpbmVyRWwpXG4gICAgICAgICAgICAuc2V0TmFtZSgnSGVhZGVyJylcbiAgICAgICAgICAgIC5zZXREZXNjKCdMaW5lIHByZWZpeGVkIGJ5IHRoaXMgc3ltYm9sIHdpbGwgYmUgcmVjb2duaXplZCBhcyBoZWFkZXInKVxuICAgICAgICAgICAgLmFkZFRleHQodGV4dCA9PiB7XG4gICAgICAgICAgICAgICAgdGV4dC5zZXRWYWx1ZSh0aGlzLnBsdWdpbi5jb25maWcucHJlZml4ZXMuaGVhZGVyKVxuICAgICAgICAgICAgICAgICAgICAub25DaGFuZ2UodmFsID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGx1Z2luLmNvbmZpZy5wcmVmaXhlcy5oZWFkZXIgPSB2YWxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGx1Z2luLnNhdmVTZXR0aW5ncygpXG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9KVxuXG4gICAgICAgIG5ldyBTZXR0aW5nKGNvbnRhaW5lckVsKVxuICAgICAgICAgICAgLnNldE5hbWUoJ0Zvb3RlcicpXG4gICAgICAgICAgICAuc2V0RGVzYygnTGluZSBwcmVmaXhlZCBieSB0aGlzIHN5bWJvbCB3aWxsIGJlIHJlY29nbml6ZWQgYXMgZm9vdGVyJylcbiAgICAgICAgICAgIC5hZGRUZXh0KHRleHQgPT4ge1xuICAgICAgICAgICAgICAgIHRleHQuc2V0VmFsdWUodGhpcy5wbHVnaW4uY29uZmlnLnByZWZpeGVzLmZvb3RlcilcbiAgICAgICAgICAgICAgICAgICAgLm9uQ2hhbmdlKHZhbCA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBsdWdpbi5jb25maWcucHJlZml4ZXMuZm9vdGVyID0gdmFsXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBsdWdpbi5zYXZlU2V0dGluZ3MoKVxuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfSlcblxuICAgICAgICBuZXcgU2V0dGluZyhjb250YWluZXJFbClcbiAgICAgICAgICAgIC5zZXROYW1lKCdTZXF1ZW5jZXMnKVxuICAgICAgICAgICAgLnNldERlc2MoJ1JFR0VYUCAtIERFU0NSSVBUSU9OJylcbiAgICAgICAgICAgIC5zZXREZXNjKFxuICAgICAgICAgICAgICAgICgoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGZyYWdtZW50ID0gbmV3IERvY3VtZW50RnJhZ21lbnQoKVxuICAgICAgICAgICAgICAgICAgICBjb25zdCBkaXYgPSBmcmFnbWVudC5jcmVhdGVFbCgnZGl2JylcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wbHVnaW4uc2Vxc1xuICAgICAgICAgICAgICAgICAgICAgICAgLm1hcChlID0+IGUubmFtZSArICcgLSAnICsgKGUuZGVzYyB8fCAnJykpXG4gICAgICAgICAgICAgICAgICAgICAgICAubWFwKGUgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGVsID0gZnJhZ21lbnQuY3JlYXRlRWwoJ2RpdicpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwuc2V0VGV4dChlKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsLnNldEF0dHJpYnV0ZSgnc3R5bGUnLCBgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1ib3R0b206IDFweCBzb2xpZCByZ2JhKDI1NSwgMjU1LCAyNTUsIDAuMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbi1ib3R0b206IDAuNXJlbTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZy1ib3R0b206IDAuNXJlbTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBgKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBlbFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkuZm9yRWFjaChlbCA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkaXYuYXBwZW5kQ2hpbGQoZWwpXG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIGZyYWdtZW50LmFwcGVuZENoaWxkKGRpdilcblxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnJhZ21lbnRcbiAgICAgICAgICAgICAgICB9KSgpXG4gICAgICAgICAgICApXG4gICAgfVxufVxuIl0sIm5hbWV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ixDQUFDO2FBQy9CLE9BQU8sQ0FDSixDQUFDLE1BQUs7QUFDRixZQUFBLE1BQU0sUUFBUSxHQUFHLElBQUksZ0JBQWdCLEVBQUUsQ0FBQTtZQUN2QyxNQUFNLEdBQUcsR0FBRyxRQUFRLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQyxDQUFBO1lBQ3BDLElBQUksQ0FBQyxNQUFNLENBQUMsSUFBSTtBQUNYLGlCQUFBLEdBQUcsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLElBQUksR0FBRyxLQUFLLElBQUksQ0FBQyxDQUFDLElBQUksSUFBSSxFQUFFLENBQUMsQ0FBQztpQkFDekMsR0FBRyxDQUFDLENBQUMsSUFBRztnQkFDTCxNQUFNLEVBQUUsR0FBRyxRQUFRLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQyxDQUFBO0FBQ25DLGdCQUFBLEVBQUUsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUE7QUFDYixnQkFBQSxFQUFFLENBQUMsWUFBWSxDQUFDLE9BQU8sRUFBRSxDQUFBOzs7O0FBSXhCLDRCQUFBLENBQUEsQ0FBQyxDQUFBO0FBQ0YsZ0JBQUEsT0FBTyxFQUFFLENBQUE7QUFDYixhQUFDLENBQUMsQ0FBQyxPQUFPLENBQUMsRUFBRSxJQUFHO0FBQ2hCLGdCQUFBLEdBQUcsQ0FBQyxXQUFXLENBQUMsRUFBRSxDQUFDLENBQUE7QUFDdkIsYUFBQyxDQUFDLENBQUE7QUFDRixZQUFBLFFBQVEsQ0FBQyxXQUFXLENBQUMsR0FBRyxDQUFDLENBQUE7QUFFekIsWUFBQSxPQUFPLFFBQVEsQ0FBQTtTQUNsQixHQUFHLENBQ1AsQ0FBQTtLQUNSO0FBQ0o7Ozs7In0= diff --git a/.obsidian/plugins/mrj-text-expand/manifest.json b/.obsidian/plugins/mrj-text-expand/manifest.json deleted file mode 100644 index 3d53702..0000000 --- a/.obsidian/plugins/mrj-text-expand/manifest.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "mrj-text-expand", - "name": "Text expand", - "version": "0.11.2", - "description": "Search and paste/transclude links to located files.", - "isDesktopOnly": false, - "author": "MrJackphil", - "authorUrl": "https://mrjackphil.com" -} diff --git a/.obsidian/plugins/obsidian-git/data.json b/.obsidian/plugins/obsidian-git/data.json index 3f2a630..e2ab79d 100644 --- a/.obsidian/plugins/obsidian-git/data.json +++ b/.obsidian/plugins/obsidian-git/data.json @@ -13,12 +13,12 @@ "showStatusBar": true, "updateSubmodules": false, "syncMethod": "merge", - "gitPath": "", "customMessageOnAutoBackup": false, "autoBackupAfterFileChange": true, "treeStructure": false, "refreshSourceControl": true, "basePath": "", "differentIntervalCommitAndPush": true, - "changedFilesInStatusBar": false + "changedFilesInStatusBar": false, + "username": "" } \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-git/main.js b/.obsidian/plugins/obsidian-git/main.js index 88b21ec..361ebee 100644 --- a/.obsidian/plugins/obsidian-git/main.js +++ b/.obsidian/plugins/obsidian-git/main.js @@ -815,10 +815,10 @@ var require_src2 = __commonJS({ var fs_1 = require("fs"); var debug_1 = __importDefault2(require_src()); var log = debug_1.default("@kwsites/file-exists"); - function check(path3, isFile, isDirectory) { - log(`checking %s`, path3); + function check(path2, isFile, isDirectory) { + log(`checking %s`, path2); try { - const stat = fs_1.statSync(path3); + const stat = fs_1.statSync(path2); if (stat.isFile() && isFile) { log(`[OK] path represents a file`); return true; @@ -838,8 +838,8 @@ var require_src2 = __commonJS({ throw e; } } - function exists2(path3, type = exports.READABLE) { - return check(path3, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0); + function exists2(path2, type = exports.READABLE) { + return check(path2, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0); } exports.exists = exists2; exports.FILE = 1; @@ -961,8 +961,8 @@ var require_utils = __commonJS({ return str.replace(regex, "\\$&"); } exports.escapeForRegExp = escapeForRegExp; - function unifyPath(path3) { - return path3 ? path3.replace(/\\/g, "/") : path3; + function unifyPath(path2) { + return path2 ? path2.replace(/\\/g, "/") : path2; } exports.unifyPath = unifyPath; function hashCode(text2) { @@ -1478,10 +1478,10 @@ var require_base = __commonJS({ } return components; } - function clonePath(path3) { + function clonePath(path2) { return { - newPos: path3.newPos, - components: path3.components.slice(0) + newPos: path2.newPos, + components: path2.components.slice(0) }; } } @@ -4246,15 +4246,15 @@ var require_template = __commonJS({ } return val; } - function createSpecializedPartial(instance5, subs, partials, stackSubs, stackPartials, stackText) { + function createSpecializedPartial(instance6, subs, partials, stackSubs, stackPartials, stackText) { function PartialTemplate() { } ; - PartialTemplate.prototype = instance5; + PartialTemplate.prototype = instance6; function Substitutions() { } ; - Substitutions.prototype = instance5.subs; + Substitutions.prototype = instance6.subs; var key2; var partial = new PartialTemplate(); partial.subs = new Substitutions(); @@ -5486,8 +5486,8 @@ var require_feather = __commonJS({ "./node_modules/core-js/es/array/from.js": function(module3, exports2, __webpack_require__) { __webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"); __webpack_require__("./node_modules/core-js/modules/es.array.from.js"); - var path3 = __webpack_require__("./node_modules/core-js/internals/path.js"); - module3.exports = path3.Array.from; + var path2 = __webpack_require__("./node_modules/core-js/internals/path.js"); + module3.exports = path2.Array.from; }, "./node_modules/core-js/internals/a-function.js": function(module3, exports2) { module3.exports = function(it) { @@ -6059,10 +6059,10 @@ var require_feather = __commonJS({ var fails = __webpack_require__("./node_modules/core-js/internals/fails.js"); var replacement = /#|\.prototype\./; var isForced = function(feature, detection) { - var value = data[normalize2(feature)]; + var value = data[normalize(feature)]; return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == "function" ? fails(detection) : !!detection; }; - var normalize2 = isForced.normalize = function(string) { + var normalize = isForced.normalize = function(string) { return String(string).replace(replacement, ".").toLowerCase(); }; var data = isForced.data = {}; @@ -6613,8 +6613,8 @@ var require_feather = __commonJS({ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function _classCallCheck(instance5, Constructor) { - if (!(instance5 instanceof Constructor)) { + function _classCallCheck(instance6, Constructor) { + if (!(instance6 instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -6773,8 +6773,7 @@ var require_feather = __commonJS({ __export(exports, { default: () => ObsidianGit }); -var import_obsidian15 = __toModule(require("obsidian")); -var path2 = __toModule(require("path")); +var import_obsidian18 = __toModule(require("obsidian")); // src/promiseQueue.ts var PromiseQueue = class { @@ -6800,484 +6799,93 @@ var PromiseQueue = class { }; // src/settings.ts -var import_obsidian = __toModule(require("obsidian")); -var ObsidianGitSettingsTab = class extends import_obsidian.PluginSettingTab { - display() { - let { containerEl } = this; - const plugin = this.plugin; - containerEl.empty(); - containerEl.createEl("h2", { text: "Git Backup settings" }); - containerEl.createEl("br"); - containerEl.createEl("h3", { text: "Automatic" }); - const commitOrBackup = plugin.settings.differentIntervalCommitAndPush ? "commit" : "backup"; - new import_obsidian.Setting(containerEl).setName("Split automatic commit and push").setDesc("Enable to use separate timer for commit and push").addToggle((toggle) => toggle.setValue(plugin.settings.differentIntervalCommitAndPush).onChange((value) => { - plugin.settings.differentIntervalCommitAndPush = value; - plugin.saveSettings(); - plugin.clearAutoBackup(); - plugin.clearAutoPush(); - if (plugin.settings.autoSaveInterval > 0) { - plugin.startAutoBackup(plugin.settings.autoSaveInterval); - } - if (value && plugin.settings.autoPushInterval > 0) { - plugin.startAutoPush(plugin.settings.autoPushInterval); - } - this.display(); - })); - new import_obsidian.Setting(containerEl).setName(`Vault ${commitOrBackup} interval (minutes)`).setDesc(`${plugin.settings.differentIntervalCommitAndPush ? "Commit" : "Commit and push"} changes every X minutes. Set to 0 (default) to disable. (See below setting for further configuration!)`).addText((text2) => text2.setValue(String(plugin.settings.autoSaveInterval)).onChange((value) => { - if (!isNaN(Number(value))) { - plugin.settings.autoSaveInterval = Number(value); - plugin.saveSettings(); - if (plugin.settings.autoSaveInterval > 0) { - plugin.clearAutoBackup(); - plugin.startAutoBackup(plugin.settings.autoSaveInterval); - new import_obsidian.Notice(`Automatic ${commitOrBackup} enabled! Every ${plugin.settings.autoSaveInterval} minutes.`); - } else if (plugin.settings.autoSaveInterval <= 0) { - plugin.clearAutoBackup() && new import_obsidian.Notice(`Automatic ${commitOrBackup} disabled!`); - } - } else { - new import_obsidian.Notice("Please specify a valid number."); - } - })); - new import_obsidian.Setting(containerEl).setName(`If turned on, do auto ${commitOrBackup} every X minutes after last change. Prevents auto ${commitOrBackup} while editing a file. If turned off, do auto ${commitOrBackup} every X minutes. It's independent from last change.`).addToggle((toggle) => toggle.setValue(plugin.settings.autoBackupAfterFileChange).onChange((value) => { - plugin.settings.autoBackupAfterFileChange = value; - plugin.saveSettings(); - plugin.clearAutoBackup(); - if (plugin.settings.autoSaveInterval > 0) { - plugin.startAutoBackup(plugin.settings.autoSaveInterval); - } - })); - if (plugin.settings.differentIntervalCommitAndPush) { - new import_obsidian.Setting(containerEl).setName(`Vault push interval (minutes)`).setDesc("Push changes every X minutes. Set to 0 (default) to disable.").addText((text2) => text2.setValue(String(plugin.settings.autoPushInterval)).onChange((value) => { - if (!isNaN(Number(value))) { - plugin.settings.autoPushInterval = Number(value); - plugin.saveSettings(); - if (plugin.settings.autoPushInterval > 0) { - plugin.clearAutoPush(); - plugin.startAutoPush(plugin.settings.autoPushInterval); - new import_obsidian.Notice(`Automatic push enabled! Every ${plugin.settings.autoPushInterval} minutes.`); - } else if (plugin.settings.autoPushInterval <= 0) { - plugin.clearAutoPush() && new import_obsidian.Notice("Automatic push disabled!"); - } - } else { - new import_obsidian.Notice("Please specify a valid number."); - } - })); - } - new import_obsidian.Setting(containerEl).setName("Auto pull interval (minutes)").setDesc("Pull changes every X minutes. Set to 0 (default) to disable.").addText((text2) => text2.setValue(String(plugin.settings.autoPullInterval)).onChange((value) => { - if (!isNaN(Number(value))) { - plugin.settings.autoPullInterval = Number(value); - plugin.saveSettings(); - if (plugin.settings.autoPullInterval > 0) { - plugin.clearAutoPull(); - plugin.startAutoPull(plugin.settings.autoPullInterval); - new import_obsidian.Notice(`Automatic pull enabled! Every ${plugin.settings.autoPullInterval} minutes.`); - } else if (plugin.settings.autoPullInterval <= 0) { - plugin.clearAutoPull() && new import_obsidian.Notice("Automatic pull disabled!"); - } - } else { - new import_obsidian.Notice("Please specify a valid number."); - } - })); - new import_obsidian.Setting(containerEl).setName("Commit message on manual backup/commit").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below) and {{numFiles}} (number of changed files in the commit)").addText((text2) => text2.setPlaceholder("vault backup: {{date}}").setValue(plugin.settings.commitMessage ? plugin.settings.commitMessage : "").onChange((value) => { - plugin.settings.commitMessage = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Specify custom commit message on auto backup").setDesc("You will get a pop up to specify your message").addToggle((toggle) => toggle.setValue(plugin.settings.customMessageOnAutoBackup).onChange((value) => { - plugin.settings.customMessageOnAutoBackup = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Commit message on auto backup/commit").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below) and {{numFiles}} (number of changed files in the commit)").addText((text2) => text2.setPlaceholder("vault backup: {{date}}").setValue(plugin.settings.autoCommitMessage).onChange((value) => { - plugin.settings.autoCommitMessage = value; - plugin.saveSettings(); - })); - containerEl.createEl("br"); - containerEl.createEl("h3", { text: "Commit message" }); - new import_obsidian.Setting(containerEl).setName("{{date}} placeholder format").setDesc('Specify custom date format. E.g. "YYYY-MM-DD HH:mm:ss"').addText((text2) => text2.setPlaceholder(plugin.settings.commitDateFormat).setValue(plugin.settings.commitDateFormat).onChange((value) => __async(this, null, function* () { - plugin.settings.commitDateFormat = value; - yield plugin.saveSettings(); - }))); - new import_obsidian.Setting(containerEl).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device.").addText((text2) => text2.setValue(localStorage.getItem(plugin.manifest.id + ":hostname")).onChange((value) => __async(this, null, function* () { - localStorage.setItem(plugin.manifest.id + ":hostname", value); - }))); - new import_obsidian.Setting(containerEl).setName("Preview commit message").addButton((button) => button.setButtonText("Preview").onClick(() => __async(this, null, function* () { - let commitMessagePreview = yield plugin.gitManager.formatCommitMessage(plugin.settings.commitMessage); - new import_obsidian.Notice(`${commitMessagePreview}`); - }))); - new import_obsidian.Setting(containerEl).setName("List filenames affected by commit in the commit body").addToggle((toggle) => toggle.setValue(plugin.settings.listChangedFilesInMessageBody).onChange((value) => { - plugin.settings.listChangedFilesInMessageBody = value; - plugin.saveSettings(); - })); - containerEl.createEl("br"); - containerEl.createEl("h3", { text: "Backup" }); - new import_obsidian.Setting(containerEl).setName("Sync Method").setDesc("Selects the method used for handling new changes found in your remote git repository.").addDropdown((dropdown) => { - const options = { - "merge": "Merge", - "rebase": "Rebase", - "reset": "Other sync service (Only updates the HEAD without touching the working directory)" - }; - dropdown.addOptions(options); - dropdown.setValue(plugin.settings.syncMethod); - dropdown.onChange((option) => __async(this, null, function* () { - plugin.settings.syncMethod = option; - plugin.saveSettings(); - })); - }); - new import_obsidian.Setting(containerEl).setName("Pull updates on startup").setDesc("Automatically pull updates when Obsidian starts").addToggle((toggle) => toggle.setValue(plugin.settings.autoPullOnBoot).onChange((value) => { - plugin.settings.autoPullOnBoot = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Push on backup").setDesc("Disable to only commit changes").addToggle((toggle) => toggle.setValue(!plugin.settings.disablePush).onChange((value) => { - plugin.settings.disablePush = !value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Pull changes before push").setDesc("Commit -> pull -> push (Only if pushing is enabled)").addToggle((toggle) => toggle.setValue(plugin.settings.pullBeforePush).onChange((value) => { - plugin.settings.pullBeforePush = value; - plugin.saveSettings(); - })); - containerEl.createEl("br"); - containerEl.createEl("h3", { text: "Miscellaneous" }); - new import_obsidian.Setting(containerEl).setName("Current branch").setDesc("Switch to a different branch").addDropdown((dropdown) => __async(this, null, function* () { - const branchInfo = yield plugin.gitManager.branchInfo(); - for (const branch of branchInfo.branches) { - dropdown.addOption(branch, branch); - } - dropdown.setValue(branchInfo.current); - dropdown.onChange((option) => __async(this, null, function* () { - yield plugin.gitManager.checkout(option); - new import_obsidian.Notice(`Checked out to ${option}`); - })); - })); - new import_obsidian.Setting(containerEl).setName("Automatically refresh Source Control View on file changes").setDesc("On slower machines this may cause lags. If so, just disable this option").addToggle((toggle) => toggle.setValue(plugin.settings.refreshSourceControl).onChange((value) => { - plugin.settings.refreshSourceControl = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Disable notifications").setDesc("Disable notifications for git operations to minimize distraction (refer to status bar for updates). Errors are still shown as notifications even if you enable this setting").addToggle((toggle) => toggle.setValue(plugin.settings.disablePopups).onChange((value) => { - plugin.settings.disablePopups = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Show status bar").setDesc("Obsidian must be restarted for the changes to take affect").addToggle((toggle) => toggle.setValue(plugin.settings.showStatusBar).onChange((value) => { - plugin.settings.showStatusBar = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Show changes files count in status bar").addToggle((toggle) => toggle.setValue(plugin.settings.changedFilesInStatusBar).onChange((value) => { - plugin.settings.changedFilesInStatusBar = value; - plugin.saveSettings(); - })); - containerEl.createEl("br"); - containerEl.createEl("h3", { text: "Advanced" }); - new import_obsidian.Setting(containerEl).setName("Update submodules").setDesc('"Create backup" and "pull" takes care of submodules. Missing features: Conflicted files, count of pulled/pushed/committed files. Tracking branch needs to be set for each submodule').addToggle((toggle) => toggle.setValue(plugin.settings.updateSubmodules).onChange((value) => { - plugin.settings.updateSubmodules = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Custom Git binary path").addText((cb) => { - cb.setValue(plugin.settings.gitPath); - cb.setPlaceholder("git"); - cb.onChange((value) => { - plugin.settings.gitPath = value; - plugin.saveSettings(); - plugin.gitManager.updateGitPath(value || "git"); - }); - }); - 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.setPlaceholder("directory/directory-with-git-repo"); - cb.onChange((value) => { - plugin.settings.basePath = value; - plugin.saveSettings(); - plugin.gitManager.updateBasePath(value || ""); - }); - }); - const info = containerEl.createDiv(); - info.setAttr("align", "center"); - info.setText("Debugging and logging:\nYou can always see the logs of this and every other plugin by opening the console with"); - const keys = containerEl.createDiv(); - keys.setAttr("align", "center"); - keys.addClass("obsidian-git-shortcuts"); - if (import_obsidian.Platform.isMacOS === true) { - keys.createEl("kbd", { text: "CMD (\u2318) + OPTION (\u2325) + I" }); - } else { - keys.createEl("kbd", { text: "CTRL + SHIFT + I" }); - } - } -}; - -// src/statusBar.ts var import_obsidian2 = __toModule(require("obsidian")); -// src/types.ts -var PluginState; -(function(PluginState2) { - PluginState2[PluginState2["idle"] = 0] = "idle"; - PluginState2[PluginState2["status"] = 1] = "status"; - PluginState2[PluginState2["pull"] = 2] = "pull"; - PluginState2[PluginState2["add"] = 3] = "add"; - PluginState2[PluginState2["commit"] = 4] = "commit"; - PluginState2[PluginState2["push"] = 5] = "push"; - PluginState2[PluginState2["conflicted"] = 6] = "conflicted"; -})(PluginState || (PluginState = {})); - -// src/statusBar.ts -var StatusBar = class { - constructor(statusBarEl, plugin) { - this.statusBarEl = statusBarEl; +// src/gitManager.ts +var GitManager = class { + constructor(plugin) { this.plugin = plugin; - this.messages = []; - this.base = "obsidian-git-statusbar-"; - this.statusBarEl.setAttribute("aria-label-position", "top"); + this.app = plugin.app; } - displayMessage(message, timeout) { - this.messages.push({ - message: `Git: ${message.slice(0, 100)}`, - timeout - }); - this.display(); - } - display() { - if (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(); - } else if (this.currentMessage) { - const messageAge = Date.now() - this.lastMessageTimestamp; - if (messageAge >= this.currentMessage.timeout) { - this.currentMessage = null; - this.lastMessageTimestamp = null; - } + getVaultPath(path2) { + if (this.plugin.settings.basePath) { + return this.plugin.settings.basePath + "/" + path2; } else { - this.displayState(); + return path2; } } - displayState() { - if (this.statusBarEl.getText().length > 3 || !this.statusBarEl.hasChildNodes()) { - this.statusBarEl.empty(); - this.iconEl = this.statusBarEl.createDiv(); - this.textEl = this.statusBarEl.createDiv(); - this.textEl.style.float = "right"; - this.textEl.style.marginLeft = "5px"; - this.iconEl.style.float = "left"; - } - switch (this.plugin.state) { - case PluginState.idle: - this.displayFromNow(this.plugin.lastUpdate); - break; - case PluginState.status: - this.statusBarEl.ariaLabel = "Checking repository status..."; - (0, import_obsidian2.setIcon)(this.iconEl, "refresh-cw"); - this.statusBarEl.addClass(this.base + "status"); - break; - case PluginState.add: - this.statusBarEl.ariaLabel = "Adding files..."; - (0, import_obsidian2.setIcon)(this.iconEl, "refresh-w"); - this.statusBarEl.addClass(this.base + "add"); - break; - case PluginState.commit: - this.statusBarEl.ariaLabel = "Committing changes..."; - (0, import_obsidian2.setIcon)(this.iconEl, "git-commit"); - this.statusBarEl.addClass(this.base + "commit"); - break; - case PluginState.push: - this.statusBarEl.ariaLabel = "Pushing changes..."; - (0, import_obsidian2.setIcon)(this.iconEl, "upload"); - this.statusBarEl.addClass(this.base + "push"); - break; - case PluginState.pull: - this.statusBarEl.ariaLabel = "Pulling changes..."; - (0, import_obsidian2.setIcon)(this.iconEl, "download"); - this.statusBarEl.addClass(this.base + "pull"); - break; - case PluginState.conflicted: - this.statusBarEl.ariaLabel = "You have conflict files..."; - (0, import_obsidian2.setIcon)(this.iconEl, "alert-circle"); - this.statusBarEl.addClass(this.base + "conflict"); - break; - default: - this.statusBarEl.ariaLabel = "Failed on initialization!"; - (0, import_obsidian2.setIcon)(this.iconEl, "alert-triangle"); - this.statusBarEl.addClass(this.base + "failed-init"); - break; - } + getPath(path2, relativeToVault) { + return relativeToVault && this.plugin.settings.basePath.length > 0 ? path2.substring(this.plugin.settings.basePath.length + 1) : path2; } - displayFromNow(timestamp) { - if (timestamp) { - const moment = window.moment; - const fromNow = moment(timestamp).fromNow(); - this.statusBarEl.ariaLabel = `${this.plugin.offlineMode ? "Offline: " : ""}Last Git update: ${fromNow}`; - } else { - this.statusBarEl.ariaLabel = this.plugin.offlineMode ? "Git is offline" : "Git is ready"; - } - if (this.plugin.offlineMode) { - (0, import_obsidian2.setIcon)(this.iconEl, "globe"); - } else { - (0, import_obsidian2.setIcon)(this.iconEl, "check"); - } - if (this.plugin.settings.changedFilesInStatusBar && this.plugin.cachedStatus) { - this.textEl.setText(this.plugin.cachedStatus.changed.length.toString()); - } - this.statusBarEl.addClass(this.base + "idle"); - } -}; - -// src/ui/modals/changedFilesModal.ts -var import_obsidian3 = __toModule(require("obsidian")); -var ChangedFilesModal = class extends import_obsidian3.FuzzySuggestModal { - constructor(plugin, changedFiles) { - super(plugin.app); - this.plugin = plugin; - this.changedFiles = changedFiles; - this.setPlaceholder("Not supported files will be opened by default app!"); - } - getItems() { - return this.changedFiles; - } - getItemText(item) { - if (item.index == "?" && item.working_dir == "U") { - return `Untracked | ${item.vault_path}`; - } - let working_dir = ""; - let index = ""; - if (item.working_dir != " ") - working_dir = `Working dir: ${item.working_dir} `; - if (item.index != " ") - index = `Index: ${item.index}`; - return `${working_dir}${index} | ${item.vault_path}`; - } - onChooseItem(item, _) { - if (this.plugin.app.metadataCache.getFirstLinkpathDest(item.vault_path, "") == null) { - this.app.openWithDefaultApp(item.vault_path); - } else { - this.plugin.app.workspace.openLinkText(item.vault_path, "/"); - } - } -}; - -// src/ui/modals/customMessageModal.ts -var import_obsidian4 = __toModule(require("obsidian")); -var CustomMessageModal = class extends import_obsidian4.SuggestModal { - constructor(plugin, fromAutoBackup) { - super(plugin.app); - this.fromAutoBackup = fromAutoBackup; - this.resolve = null; - this.plugin = plugin; - this.setPlaceholder("Type your message and select optional the version with the added date."); - } - open() { - super.open(); - return new Promise((resolve) => { - this.resolve = resolve; - }); - } - onClose() { - if (this.resolve) - this.resolve(void 0); - } - selectSuggestion(value, evt) { - if (this.resolve) - this.resolve(value); - super.selectSuggestion(value, evt); - } - getSuggestions(query) { - const date = window.moment().format(this.plugin.settings.commitDateFormat); - if (query == "") - query = "..."; - return [query, `${date}: ${query}`, `${query}: ${date}`]; - } - renderSuggestion(value, el) { - el.innerText = value; - } - onChooseSuggestion(item, _) { - } -}; - -// src/constants.ts -var DEFAULT_SETTINGS = { - commitMessage: "vault backup: {{date}}", - autoCommitMessage: void 0, - commitDateFormat: "YYYY-MM-DD HH:mm:ss", - autoSaveInterval: 0, - autoPushInterval: 0, - autoPullInterval: 0, - autoPullOnBoot: false, - disablePush: false, - pullBeforePush: true, - disablePopups: false, - listChangedFilesInMessageBody: false, - showStatusBar: true, - updateSubmodules: false, - syncMethod: "merge", - gitPath: "", - customMessageOnAutoBackup: false, - autoBackupAfterFileChange: false, - treeStructure: false, - refreshSourceControl: true, - basePath: "", - differentIntervalCommitAndPush: false, - changedFilesInStatusBar: false -}; -var GIT_VIEW_CONFIG = { - type: "git-view", - name: "Source Control", - icon: "git-pull-request" -}; -var DIFF_VIEW_CONFIG = { - type: "diff-view", - name: "Diff View", - icon: "git-pull-request" -}; - -// src/openInGitHub.ts -var import_electron = __toModule(require("electron")); -var import_obsidian5 = __toModule(require("obsidian")); -function openLineInGitHub(editor, file, manager) { - return __async(this, null, function* () { - const { isGitHub, branch, repo, user } = yield getData(manager); - if (isGitHub) { - const from = editor.getCursor("from").line + 1; - const to = editor.getCursor("to").line + 1; - if (from === to) { - yield import_electron.shell.openExternal(`https://github.com/${user}/${repo}/blob/${branch}/${file.path}?plain=1#L${from}`); + getTreeStructure(children2, beginLength = 0) { + let list = []; + children2 = [...children2]; + while (children2.length > 0) { + const first2 = children2.first(); + const restPath = first2.path.substring(beginLength); + if (restPath.contains("/")) { + const title = restPath.substring(0, restPath.indexOf("/")); + const childrenWithSameTitle = children2.filter((item) => { + return item.path.substring(beginLength).startsWith(title + "/"); + }); + childrenWithSameTitle.forEach((item) => children2.remove(item)); + list.push({ + title, + children: this.getTreeStructure(childrenWithSameTitle, (beginLength > 0 ? beginLength + title.length : title.length) + 1) + }); } else { - yield import_electron.shell.openExternal(`https://github.com/${user}/${repo}/blob/${branch}/${file.path}?plain=1#L${from}-L${to}`); + list.push({ title: restPath, statusResult: first2 }); + children2.remove(first2); } - } else { - new import_obsidian5.Notice("It seems like you are not using GitHub"); } - }); -} -function openHistoryInGitHub(file, manager) { - return __async(this, null, function* () { - const { isGitHub, branch, repo, user } = yield getData(manager); - if (isGitHub) { - yield import_electron.shell.openExternal(`https://github.com/${user}/${repo}/commits/${branch}/${file.path}`); - } else { - new import_obsidian5.Notice("It seems like you are not using GitHub"); - } - }); -} -function getData(manager) { - return __async(this, null, function* () { - const branchInfo = yield manager.branchInfo(); - const remoteBranch = branchInfo.tracking; - const branch = branchInfo.current; - const remote = remoteBranch.substring(0, remoteBranch.indexOf("/")); - const remoteUrl = yield manager.getConfig(`remote.${remote}.url`); - const [isGitHub, httpsUser, httpsRepo, sshUser, sshRepo] = remoteUrl.match(/(?:^https:\/\/github\.com\/(.*)\/(.*)\.git$)|(?:^git@github\.com:(.*)\/(.*)\.git$)/); - return { - isGitHub: !!isGitHub, - repo: httpsRepo || sshRepo, - user: httpsUser || sshUser, - branch - }; - }); -} + return list; + } + formatCommitMessage(template) { + return __async(this, null, function* () { + let status; + if (template.includes("{{numFiles}}")) { + status = yield this.status(); + let numFiles = status.staged.length; + template = template.replace("{{numFiles}}", String(numFiles)); + } + if (template.includes("{{hostname}}")) { + const hostname = this.plugin.localStorage.getHostname() || ""; + template = template.replace("{{hostname}}", hostname); + } + if (template.includes("{{files}}")) { + status = status != null ? status : yield this.status(); + let changeset = {}; + status.staged.forEach((value) => { + if (value.index in changeset) { + changeset[value.index].push(value.path); + } else { + changeset[value.index] = [value.path]; + } + }); + let chunks = []; + for (let [action, files2] of Object.entries(changeset)) { + chunks.push(action + " " + files2.join(" ")); + } + let files = chunks.join(", "); + template = template.replace("{{files}}", files); + } + let moment = window.moment; + template = template.replace("{{date}}", moment().format(this.plugin.settings.commitDateFormat)); + if (this.plugin.settings.listChangedFilesInMessageBody) { + template = template + "\n\nAffected files:\n" + (status != null ? status : yield this.status()).staged.map((e) => e.path).join("\n"); + } + return template; + }); + } +}; + +// src/isomorphicGit.ts +var IsomorphicGit = class extends GitManager { +}; // src/simpleGit.ts var import_child_process2 = __toModule(require("child_process")); -var import_obsidian6 = __toModule(require("obsidian")); +var import_obsidian = __toModule(require("obsidian")); var path = __toModule(require("path")); var import_path = __toModule(require("path")); @@ -7398,10 +7006,7 @@ function splitOn(input, char) { if (index <= 0) { return [input, ""]; } - return [ - input.substr(0, index), - input.substr(index + 1) - ]; + return [input.substr(0, index), input.substr(index + 1)]; } function first(input, offset = 0) { return isArrayLike(input) && input.length > offset ? input[offset] : void 0; @@ -7426,8 +7031,8 @@ function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") { function forEachLineWithContent(input, callback) { return toLinesWithContent(input, true).map((line) => callback(line)); } -function folderExists(path3) { - return (0, import_file_exists.exists)(path3, import_file_exists.FOLDER); +function folderExists(path2) { + return (0, import_file_exists.exists)(path2, import_file_exists.FOLDER); } function append(target, item) { if (Array.isArray(target)) { @@ -7619,6 +7224,7 @@ function createInstanceConfig(...options) { const baseDir = process.cwd(); const config = Object.assign(__spreadValues2({ baseDir }, defaultOptions), ...options.filter((o) => typeof o === "object" && o)); config.baseDir = config.baseDir || baseDir; + config.trimmed = config.trimmed === true; return config; } var defaultOptions; @@ -7627,7 +7233,8 @@ var init_simple_git_options = __esm({ defaultOptions = { binary: "git", maxConcurrentProcesses: 5, - config: [] + config: [], + trimmed: false }; } }); @@ -7782,8 +7389,8 @@ function checkIsRepoRootTask() { commands, format: "utf-8", onError, - parser(path3) { - return /^\.(git)?$/.test(path3.trim()); + parser(path2) { + return /^\.(git)?$/.test(path2.trim()); } }; } @@ -7999,7 +7606,10 @@ var init_clean = __esm({ CleanOptions2["RECURSIVE"] = "d"; return CleanOptions2; })(CleanOptions || {}); - CleanOptionValues = /* @__PURE__ */ new Set(["i", ...asStringArray(Object.values(CleanOptions))]); + CleanOptionValues = /* @__PURE__ */ new Set([ + "i", + ...asStringArray(Object.values(CleanOptions)) + ]); } }); function configListParser(text2) { @@ -8167,11 +7777,11 @@ function parseGrep(grep) { const paths = /* @__PURE__ */ new Set(); const results = {}; forEachLineWithContent(grep, (input) => { - const [path3, line, preview] = input.split(NULL); - paths.add(path3); - (results[path3] = results[path3] || []).push({ + const [path2, line, preview] = input.split(NULL); + paths.add(path2); + (results[path2] = results[path2] || []).push({ line: asNumber(line), - path: path3, + path: path2, preview }); }); @@ -8629,11 +8239,11 @@ var init_task_callback = __esm({ } }); function changeWorkingDirectoryTask(directory, root) { - return adhocExecTask((instance5) => { + return adhocExecTask((instance6) => { if (!folderExists(directory)) { throw new Error(`Git.cwd: cannot change to non-directory "${directory}"`); } - return (root || instance5).cwd = directory; + return (root || instance6).cwd = directory; }); } var init_change_working_directory = __esm({ @@ -8745,14 +8355,14 @@ var init_hash_object = __esm({ init_task(); } }); -function parseInit(bare, path3, text2) { +function parseInit(bare, path2, text2) { const response = String(text2).trim(); let result; if (result = initResponseRegex.exec(response)) { - return new InitSummary(bare, path3, false, result[1]); + return new InitSummary(bare, path2, false, result[1]); } if (result = reInitResponseRegex.exec(response)) { - return new InitSummary(bare, path3, true, result[1]); + return new InitSummary(bare, path2, true, result[1]); } let gitDir = ""; const tokens = response.split(" "); @@ -8763,7 +8373,7 @@ function parseInit(bare, path3, text2) { break; } } - return new InitSummary(bare, path3, /^re/i.test(response), gitDir); + return new InitSummary(bare, path2, /^re/i.test(response), gitDir); } var InitSummary; var initResponseRegex; @@ -8771,9 +8381,9 @@ var reInitResponseRegex; var init_InitSummary = __esm({ "src/lib/responses/InitSummary.ts"() { InitSummary = class { - constructor(bare, path3, existing, gitDir) { + constructor(bare, path2, existing, gitDir) { this.bare = bare; - this.path = path3; + this.path = path2; this.existing = existing; this.gitDir = gitDir; } @@ -8785,7 +8395,7 @@ var init_InitSummary = __esm({ function hasBareCommand(command) { return command.includes(bareCommand); } -function initTask(bare = false, path3, customArgs) { +function initTask(bare = false, path2, customArgs) { const commands = ["init", ...customArgs]; if (bare && !hasBareCommand(commands)) { commands.splice(1, 0, bareCommand); @@ -8794,7 +8404,7 @@ function initTask(bare = false, path3, customArgs) { commands, format: "utf-8", parser(text2) { - return parseInit(commands.includes("--bare"), path3, text2); + return parseInit(commands.includes("--bare"), path2, text2); } }; } @@ -9015,10 +8625,7 @@ function prettyFormat(format, splitter) { fields.push(field); formatStr.push(String(format[field])); }); - return [ - fields, - formatStr.join(splitter) - ]; + return [fields, formatStr.join(splitter)]; } function userOptions(input) { return Object.keys(input).reduce((out, key2) => { @@ -9049,9 +8656,9 @@ function parseLogOptions(opt = {}, customArgs = []) { if (maxCount) { command.push(`--max-count=${maxCount}`); } - if (opt.from && opt.to) { + if (opt.from || opt.to) { const rangeOperator = opt.symmetric !== false ? "..." : ".."; - suffix.push(`${opt.from}${rangeOperator}${opt.to}`); + suffix.push(`${opt.from || ""}${rangeOperator}${opt.to || ""}`); } if (filterString(opt.file)) { suffix.push("--follow", opt.file); @@ -9060,10 +8667,7 @@ function parseLogOptions(opt = {}, customArgs = []) { return { fields, splitter, - commands: [ - ...command, - ...suffix - ] + commands: [...command, ...suffix] }; } function logTask(splitter, fields, customArgs) { @@ -9484,12 +9088,12 @@ var init_FileStatusSummary = __esm({ "src/lib/responses/FileStatusSummary.ts"() { fromPathRegex = /^(.+) -> (.+)$/; FileStatusSummary = class { - constructor(path3, index, working_dir) { - this.path = path3; + constructor(path2, index, working_dir) { + this.path = path2; this.index = index; this.working_dir = working_dir; if (index + working_dir === "R") { - const detail = fromPathRegex.exec(path3) || [null, path3, path3]; + const detail = fromPathRegex.exec(path2) || [null, path2, path2]; this.from = detail[1] || ""; this.path = detail[2] || ""; } @@ -9520,14 +9124,14 @@ function splitLine(result, lineStr) { default: return; } - function data(index, workingDir, path3) { + function data(index, workingDir, path2) { const raw = `${index}${workingDir}`; const handler = parsers6.get(raw); if (handler) { - handler(result, path3); + handler(result, path2); } if (raw !== "##" && raw !== "!!") { - result.files.push(new FileStatusSummary(path3.replace(/\0.+$/, ""), index, workingDir)); + result.files.push(new FileStatusSummary(path2.replace(/\0.+$/, ""), index, workingDir)); } } } @@ -9583,25 +9187,28 @@ var init_StatusSummary = __esm({ ...conflicts("A", "A", "U"), ...conflicts("D", "D", "U"), ...conflicts("U", "A", "D", "U"), - ["##", (result, line) => { - const aheadReg = /ahead (\d+)/; - const behindReg = /behind (\d+)/; - const currentReg = /^(.+?(?=(?:\.{3}|\s|$)))/; - const trackingReg = /\.{3}(\S*)/; - const onEmptyBranchReg = /\son\s([\S]+)$/; - let regexResult; - regexResult = aheadReg.exec(line); - result.ahead = regexResult && +regexResult[1] || 0; - regexResult = behindReg.exec(line); - result.behind = regexResult && +regexResult[1] || 0; - regexResult = currentReg.exec(line); - result.current = regexResult && regexResult[1]; - regexResult = trackingReg.exec(line); - result.tracking = regexResult && regexResult[1]; - regexResult = onEmptyBranchReg.exec(line); - result.current = regexResult && regexResult[1] || result.current; - result.detached = /\(no branch\)/.test(line); - }] + [ + "##", + (result, line) => { + const aheadReg = /ahead (\d+)/; + const behindReg = /behind (\d+)/; + const currentReg = /^(.+?(?=(?:\.{3}|\s|$)))/; + const trackingReg = /\.{3}(\S*)/; + const onEmptyBranchReg = /\son\s([\S]+)$/; + let regexResult; + regexResult = aheadReg.exec(line); + result.ahead = regexResult && +regexResult[1] || 0; + regexResult = behindReg.exec(line); + result.behind = regexResult && +regexResult[1] || 0; + regexResult = currentReg.exec(line); + result.current = regexResult && regexResult[1]; + regexResult = trackingReg.exec(line); + result.tracking = regexResult && regexResult[1]; + regexResult = onEmptyBranchReg.exec(line); + result.current = regexResult && regexResult[1] || result.current; + result.detached = /\(no branch\)/.test(line); + } + ] ]); parseStatusSummary = function(text2) { const lines = text2.split(NULL); @@ -9693,8 +9300,8 @@ var init_simple_git_api = __esm({ } return this._runTask(configurationErrorTask("Git.cwd: workingDirectory must be supplied as a string"), next); } - hashObject(path3, write) { - return this._runTask(hashObjectTask(path3, write === true), trailingFunctionArgument(arguments)); + hashObject(path2, write) { + return this._runTask(hashObjectTask(path2, write === true), trailingFunctionArgument(arguments)); } init(bare) { return this._runTask(initTask(bare === true, this._executor.cwd, getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); @@ -10037,7 +9644,9 @@ function parseFetchResult(stdOut, stdErr) { raw: stdOut, remote: null, branches: [], - tags: [] + tags: [], + updated: [], + deleted: [] }; return parseStringResponse(result, parsers9, [stdOut, stdErr]); } @@ -10060,6 +9669,19 @@ var init_parse_fetch = __esm({ name, tracking }); + }), + new LineParser(/- \[deleted]\s+\S+\s*-> (.+)$/, (result, [tracking]) => { + result.deleted.push({ + tracking + }); + }), + new LineParser(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/, (result, [from, to, name, tracking]) => { + result.updated.push({ + name, + tracking, + to, + from + }); }) ]; } @@ -10256,8 +9878,8 @@ __export2(sub_module_exports, { subModuleTask: () => subModuleTask, updateSubModuleTask: () => updateSubModuleTask }); -function addSubModuleTask(repo, path3) { - return subModuleTask(["add", repo, path3]); +function addSubModuleTask(repo, path2) { + return subModuleTask(["add", repo, path2]); } function initSubModuleTask(customArgs) { return subModuleTask(["init", ...customArgs]); @@ -10387,7 +10009,12 @@ var require_git = __commonJS2({ trailingOptionsArgument: trailingOptionsArgument2 } = (init_utils(), __toCommonJS(utils_exports)); var { applyPatchTask: applyPatchTask2 } = (init_apply_patch(), __toCommonJS(apply_patch_exports)); - var { branchTask: branchTask2, branchLocalTask: branchLocalTask2, deleteBranchesTask: deleteBranchesTask2, deleteBranchTask: deleteBranchTask2 } = (init_branch(), __toCommonJS(branch_exports)); + var { + branchTask: branchTask2, + branchLocalTask: branchLocalTask2, + deleteBranchesTask: deleteBranchesTask2, + deleteBranchTask: deleteBranchTask2 + } = (init_branch(), __toCommonJS(branch_exports)); var { checkIgnoreTask: checkIgnoreTask2 } = (init_check_ignore(), __toCommonJS(check_ignore_exports)); var { checkIsRepoTask: checkIsRepoTask2 } = (init_check_is_repo(), __toCommonJS(check_is_repo_exports)); var { cloneTask: cloneTask2, cloneMirrorTask: cloneMirrorTask2 } = (init_clone(), __toCommonJS(clone_exports)); @@ -10398,14 +10025,26 @@ var require_git = __commonJS2({ var { moveTask: moveTask2 } = (init_move(), __toCommonJS(move_exports)); var { pullTask: pullTask2 } = (init_pull(), __toCommonJS(pull_exports)); var { pushTagsTask: pushTagsTask2 } = (init_push(), __toCommonJS(push_exports)); - var { addRemoteTask: addRemoteTask2, getRemotesTask: getRemotesTask2, listRemotesTask: listRemotesTask2, remoteTask: remoteTask2, removeRemoteTask: removeRemoteTask2 } = (init_remote(), __toCommonJS(remote_exports)); + var { + addRemoteTask: addRemoteTask2, + getRemotesTask: getRemotesTask2, + listRemotesTask: listRemotesTask2, + remoteTask: remoteTask2, + removeRemoteTask: removeRemoteTask2 + } = (init_remote(), __toCommonJS(remote_exports)); var { getResetMode: getResetMode2, resetTask: resetTask2 } = (init_reset(), __toCommonJS(reset_exports)); var { stashListTask: stashListTask2 } = (init_stash_list(), __toCommonJS(stash_list_exports)); - var { addSubModuleTask: addSubModuleTask2, initSubModuleTask: initSubModuleTask2, subModuleTask: subModuleTask2, updateSubModuleTask: updateSubModuleTask2 } = (init_sub_module(), __toCommonJS(sub_module_exports)); + var { + addSubModuleTask: addSubModuleTask2, + initSubModuleTask: initSubModuleTask2, + subModuleTask: subModuleTask2, + updateSubModuleTask: updateSubModuleTask2 + } = (init_sub_module(), __toCommonJS(sub_module_exports)); var { addAnnotatedTagTask: addAnnotatedTagTask2, addTagTask: addTagTask2, tagListTask: tagListTask2 } = (init_tag(), __toCommonJS(tag_exports)); var { straightThroughBufferTask: straightThroughBufferTask2, straightThroughStringTask: straightThroughStringTask2 } = (init_task(), __toCommonJS(task_exports)); function Git2(options, plugins) { this._executor = new GitExecutor2(options.binary, options.baseDir, new Scheduler2(options.maxConcurrentProcesses), plugins); + this._trimmed = options.trimmed; } (Git2.prototype = Object.create(SimpleGitApi2.prototype)).constructor = Git2; Git2.prototype.customBinary = function(command) { @@ -10515,10 +10154,10 @@ var require_git = __commonJS2({ if (!command.length) { return this._runTask(configurationErrorTask2("Raw: must supply one or more command to execute"), next); } - return this._runTask(straightThroughStringTask2(command), next); + return this._runTask(straightThroughStringTask2(command, this._trimmed), next); }; - Git2.prototype.submoduleAdd = function(repo, path3, then) { - return this._runTask(addSubModuleTask2(repo, path3), trailingFunctionArgument2(arguments)); + Git2.prototype.submoduleAdd = function(repo, path2, then) { + return this._runTask(addSubModuleTask2(repo, path2), trailingFunctionArgument2(arguments)); }; Git2.prototype.submoduleUpdate = function(args, then) { return this._runTask(updateSubModuleTask2(getTrailingOptions2(arguments, true)), trailingFunctionArgument2(arguments)); @@ -10838,7 +10477,9 @@ function spawnOptionsPlugin(spawnOptions) { } }; } -function timeoutPlugin({ block }) { +function timeoutPlugin({ + block +}) { if (block > 0) { return { type: "spawn.after", @@ -10892,73 +10533,23 @@ function gitInstanceFactory(baseDir, options) { init_git_response_error(); var esm_default = gitInstanceFactory; -// src/gitManager.ts -var GitManager = class { - constructor(plugin) { - this.plugin = plugin; - this.app = plugin.app; - } - getTreeStructure(children2, beginLength = 0) { - let list = []; - children2 = [...children2]; - while (children2.length > 0) { - const first2 = children2.first(); - const restPath = first2.path.substring(beginLength); - if (restPath.contains("/")) { - const title = restPath.substring(0, restPath.indexOf("/")); - const childrenWithSameTitle = children2.filter((item) => { - return item.path.substring(beginLength).startsWith(title + "/"); - }); - childrenWithSameTitle.forEach((item) => children2.remove(item)); - list.push({ - title, - children: this.getTreeStructure(childrenWithSameTitle, (beginLength > 0 ? beginLength + title.length : title.length) + 1) - }); - } else { - list.push({ title: restPath, statusResult: first2 }); - children2.remove(first2); - } - } - return list; - } - formatCommitMessage(template) { - return __async(this, null, function* () { - let status; - if (template.includes("{{numFiles}}")) { - status = yield this.status(); - let numFiles = status.staged.length; - template = template.replace("{{numFiles}}", String(numFiles)); - } - if (template.includes("{{hostname}}")) { - const hostname = localStorage.getItem(this.plugin.manifest.id + ":hostname") || ""; - template = template.replace("{{hostname}}", hostname); - } - if (template.includes("{{files}}")) { - status = status != null ? status : yield this.status(); - let changeset = {}; - status.staged.forEach((value) => { - if (value.index in changeset) { - changeset[value.index].push(value.path); - } else { - changeset[value.index] = [value.path]; - } - }); - let chunks = []; - for (let [action, files2] of Object.entries(changeset)) { - chunks.push(action + " " + files2.join(" ")); - } - let files = chunks.join(", "); - template = template.replace("{{files}}", files); - } - let moment = window.moment; - template = template.replace("{{date}}", moment().format(this.plugin.settings.commitDateFormat)); - if (this.plugin.settings.listChangedFilesInMessageBody) { - template = template + "\n\nAffected files:\n" + (status != null ? status : yield this.status()).staged.map((e) => e.path).join("\n"); - } - return template; - }); - } -}; +// src/types.ts +var PluginState; +(function(PluginState2) { + PluginState2[PluginState2["idle"] = 0] = "idle"; + PluginState2[PluginState2["status"] = 1] = "status"; + PluginState2[PluginState2["pull"] = 2] = "pull"; + PluginState2[PluginState2["add"] = 3] = "add"; + PluginState2[PluginState2["commit"] = 4] = "commit"; + PluginState2[PluginState2["push"] = 5] = "push"; + PluginState2[PluginState2["conflicted"] = 6] = "conflicted"; +})(PluginState || (PluginState = {})); +var FileType; +(function(FileType2) { + FileType2[FileType2["staged"] = 0] = "staged"; + FileType2[FileType2["changed"] = 1] = "changed"; + FileType2[FileType2["pulled"] = 2] = "pulled"; +})(FileType || (FileType = {})); // src/simpleGit.ts var SimpleGit = class extends GitManager { @@ -10969,19 +10560,19 @@ var SimpleGit = class extends GitManager { return __async(this, null, function* () { if (this.isGitInstalled()) { const adapter = this.app.vault.adapter; - const path3 = adapter.getBasePath(); - let basePath = path3; + const path2 = adapter.getBasePath(); + let basePath = path2; if (this.plugin.settings.basePath) { - const exists2 = yield adapter.exists((0, import_obsidian6.normalizePath)(this.plugin.settings.basePath)); + const exists2 = yield adapter.exists((0, import_obsidian.normalizePath)(this.plugin.settings.basePath)); if (exists2) { - basePath = path3 + import_path.sep + this.plugin.settings.basePath; + basePath = path2 + import_path.sep + this.plugin.settings.basePath; } else if (!ignoreError) { - new import_obsidian6.Notice("ObsidianGit: Base path does not exist"); + new import_obsidian.Notice("ObsidianGit: Base path does not exist"); } } this.git = esm_default({ baseDir: basePath, - binary: this.plugin.settings.gitPath || void 0, + binary: this.plugin.localStorage.getGitPath() || void 0, config: ["core.quotepath=off"] }); this.git.cwd(yield this.git.revparse("--show-toplevel")); @@ -11021,36 +10612,29 @@ var SimpleGit = class extends GitManager { }; }); } - getVaultPath(path3) { - if (this.plugin.settings.basePath) { - return this.plugin.settings.basePath + "/" + path3; - } else { - return path3; - } - } - formatPath(path3, renamed = false) { - function format(path4) { - if (path4 == void 0) + formatPath(path2, renamed = false) { + function format(path3) { + if (path3 == void 0) return void 0; - if (path4.startsWith('"') && path4.endsWith('"')) { - return path4.substring(1, path4.length - 1); + if (path3.startsWith('"') && path3.endsWith('"')) { + return path3.substring(1, path3.length - 1); } else { - return path4; + return path3; } } if (renamed) { return { - from: format(path3.from), - path: format(path3.path) + from: format(path2.from), + path: format(path2.path) }; } else { return { - path: format(path3.path) + path: format(path2.path) }; } } - commitAll(message) { - return __async(this, null, function* () { + commitAll(_0) { + return __async(this, arguments, function* ({ message }) { if (this.plugin.settings.updateSubmodules) { this.plugin.setState(PluginState.commit); yield new Promise((resolve, reject) => __async(this, null, function* () { @@ -11099,18 +10683,18 @@ var SimpleGit = class extends GitManager { return res; }); } - stage(path3, relativeToVault) { + stage(path2, relativeToVault) { return __async(this, null, function* () { this.plugin.setState(PluginState.add); - path3 = this.getPath(path3, relativeToVault); - yield this.git.add(["--", path3], (err) => this.onError(err)); + path2 = this.getPath(path2, relativeToVault); + yield this.git.add(["--", path2], (err) => this.onError(err)); this.plugin.setState(PluginState.idle); }); } - stageAll() { - return __async(this, null, function* () { + stageAll(_0) { + return __async(this, arguments, function* ({ dir }) { this.plugin.setState(PluginState.add); - yield this.git.add("-A", (err) => this.onError(err)); + yield this.git.add(dir != null ? dir : "-A", (err) => this.onError(err)); this.plugin.setState(PluginState.idle); }); } @@ -11121,11 +10705,11 @@ var SimpleGit = class extends GitManager { this.plugin.setState(PluginState.idle); }); } - unstage(path3, relativeToVault) { + unstage(path2, relativeToVault) { return __async(this, null, function* () { this.plugin.setState(PluginState.add); - path3 = this.getPath(path3, relativeToVault); - yield this.git.reset(["--", path3], (err) => this.onError(err)); + path2 = this.getPath(path2, relativeToVault); + yield this.git.reset(["--", path2], (err) => this.onError(err)); this.plugin.setState(PluginState.idle); }); } @@ -11169,9 +10753,15 @@ var SimpleGit = class extends GitManager { } const afterMergeCommit = yield this.git.revparse([branchInfo.current], (err) => this.onError(err)); const filesChanged = yield this.git.diff([`${localCommit}..${afterMergeCommit}`, "--name-only"]); - return filesChanged.split(/\r\n|\r|\n/).filter((value) => value.length > 0).length; + return filesChanged.split(/\r\n|\r|\n/).filter((value) => value.length > 0).map((e) => { + return { + path: e, + working_dir: "P", + vault_path: this.getVaultPath(e) + }; + }); } else { - return 0; + return []; } }); } @@ -11231,15 +10821,15 @@ var SimpleGit = class extends GitManager { } log(file, relativeToVault = true) { return __async(this, null, function* () { - const path3 = this.getPath(file, relativeToVault); - const res = yield this.git.log({ file: path3 }, (err) => this.onError(err)); + const path2 = this.getPath(file, relativeToVault); + const res = yield this.git.log({ file: path2 }, (err) => this.onError(err)); return res.all; }); } show(commitHash, file, relativeToVault = true) { return __async(this, null, function* () { - const path3 = this.getPath(file, relativeToVault); - return this.git.show([commitHash + ":" + path3], (err) => this.onError(err)); + const path2 = this.getPath(file, relativeToVault); + return this.git.show([commitHash + ":" + path2], (err) => this.onError(err)); }); } checkout(branch) { @@ -11257,15 +10847,15 @@ var SimpleGit = class extends GitManager { yield this.git.clone(url, path.join(this.app.vault.adapter.getBasePath(), dir), [], (err) => this.onError(err)); }); } - setConfig(path3, value) { + setConfig(path2, value) { return __async(this, null, function* () { - yield this.git.addConfig(path3, value, (err) => this.onError(err)); + yield this.git.addConfig(path2, value, (err) => this.onError(err)); }); } - getConfig(path3) { + getConfig(path2) { return __async(this, null, function* () { const config = yield this.git.listConfig((err) => this.onError(err)); - return config.all[path3]; + return config.all[path2]; }); } fetch(remote) { @@ -11311,7 +10901,17 @@ var SimpleGit = class extends GitManager { } updateUpstreamBranch(remoteBranch) { return __async(this, null, function* () { - yield this.git.push(["--set-upstream", ...remoteBranch.split("/")], (err) => this.onError(err)); + try { + yield this.git.branch(["--set-upstream-to", remoteBranch]); + } catch (e) { + console.error(e); + try { + yield this.git.branch(["--set-upstream", remoteBranch]); + } catch (e2) { + console.error(e2); + yield this.git.push(["--set-upstream", ...remoteBranch.split("/")], (err) => this.onError(err)); + } + } }); } updateGitPath(gitPath) { @@ -11320,9 +10920,6 @@ var SimpleGit = class extends GitManager { updateBasePath(basePath) { this.setGitInstance(true); } - getPath(path3, relativeToVault) { - return relativeToVault && this.plugin.settings.basePath.length > 0 ? path3.substring(this.plugin.settings.basePath.length + 1) : path3; - } getDiffString(filePath, stagedChanges = false) { return __async(this, null, function* () { if (stagedChanges) @@ -11337,7 +10934,7 @@ var SimpleGit = class extends GitManager { }); } isGitInstalled() { - const command = (0, import_child_process2.spawnSync)(this.plugin.settings.gitPath || "git", ["--version"], { + const command = (0, import_child_process2.spawnSync)(this.plugin.localStorage.getGitPath() || "git", ["--version"], { stdio: "ignore" }); if (command.error) { @@ -11348,7 +10945,7 @@ var SimpleGit = class extends GitManager { } onError(error) { if (error) { - let networkFailure = error.message.contains("Could not resolve host"); + let networkFailure = error.message.contains("Could not resolve host") || error.message.match(/ssh: connect to host .*? port .*?: Operation timed out/); if (!networkFailure) { this.plugin.displayError(error.message); this.plugin.setState(PluginState.idle); @@ -11363,10 +10960,566 @@ var SimpleGit = class extends GitManager { } }; +// src/settings.ts +var ObsidianGitSettingsTab = class extends import_obsidian2.PluginSettingTab { + display() { + let { containerEl } = this; + const plugin = this.plugin; + const commitOrBackup = plugin.settings.differentIntervalCommitAndPush ? "commit" : "backup"; + const gitReady = plugin.gitReady; + containerEl.empty(); + containerEl.createEl("h2", { text: "Git Backup settings" }); + if (!gitReady) { + containerEl.createEl("p", { text: "Git is not ready. When all settings are correct you can configure auto backup, etc." }); + } + if (gitReady) { + containerEl.createEl("br"); + containerEl.createEl("h3", { text: "Automatic" }); + new import_obsidian2.Setting(containerEl).setName("Split automatic commit and push").setDesc("Enable to use separate timer for commit and push").addToggle((toggle) => toggle.setValue(plugin.settings.differentIntervalCommitAndPush).onChange((value) => { + plugin.settings.differentIntervalCommitAndPush = value; + plugin.saveSettings(); + plugin.clearAutoBackup(); + plugin.clearAutoPush(); + if (plugin.settings.autoSaveInterval > 0) { + plugin.startAutoBackup(plugin.settings.autoSaveInterval); + } + if (value && plugin.settings.autoPushInterval > 0) { + plugin.startAutoPush(plugin.settings.autoPushInterval); + } + this.display(); + })); + new import_obsidian2.Setting(containerEl).setName(`Vault ${commitOrBackup} interval (minutes)`).setDesc(`${plugin.settings.differentIntervalCommitAndPush ? "Commit" : "Commit and push"} changes every X minutes. Set to 0 (default) to disable. (See below setting for further configuration!)`).addText((text2) => text2.setValue(String(plugin.settings.autoSaveInterval)).onChange((value) => { + if (!isNaN(Number(value))) { + plugin.settings.autoSaveInterval = Number(value); + plugin.saveSettings(); + if (plugin.settings.autoSaveInterval > 0) { + plugin.clearAutoBackup(); + plugin.startAutoBackup(plugin.settings.autoSaveInterval); + new import_obsidian2.Notice(`Automatic ${commitOrBackup} enabled! Every ${plugin.settings.autoSaveInterval} minutes.`); + } else if (plugin.settings.autoSaveInterval <= 0) { + plugin.clearAutoBackup() && new import_obsidian2.Notice(`Automatic ${commitOrBackup} disabled!`); + } + } else { + new import_obsidian2.Notice("Please specify a valid number."); + } + })); + new import_obsidian2.Setting(containerEl).setName(`If turned on, do auto ${commitOrBackup} every X minutes after last change. Prevents auto ${commitOrBackup} while editing a file. If turned off, do auto ${commitOrBackup} every X minutes. It's independent from last change.`).addToggle((toggle) => toggle.setValue(plugin.settings.autoBackupAfterFileChange).onChange((value) => { + plugin.settings.autoBackupAfterFileChange = value; + plugin.saveSettings(); + plugin.clearAutoBackup(); + if (plugin.settings.autoSaveInterval > 0) { + plugin.startAutoBackup(plugin.settings.autoSaveInterval); + } + })); + if (plugin.settings.differentIntervalCommitAndPush) { + new import_obsidian2.Setting(containerEl).setName(`Vault push interval (minutes)`).setDesc("Push changes every X minutes. Set to 0 (default) to disable.").addText((text2) => text2.setValue(String(plugin.settings.autoPushInterval)).onChange((value) => { + if (!isNaN(Number(value))) { + plugin.settings.autoPushInterval = Number(value); + plugin.saveSettings(); + if (plugin.settings.autoPushInterval > 0) { + plugin.clearAutoPush(); + plugin.startAutoPush(plugin.settings.autoPushInterval); + new import_obsidian2.Notice(`Automatic push enabled! Every ${plugin.settings.autoPushInterval} minutes.`); + } else if (plugin.settings.autoPushInterval <= 0) { + plugin.clearAutoPush() && new import_obsidian2.Notice("Automatic push disabled!"); + } + } else { + new import_obsidian2.Notice("Please specify a valid number."); + } + })); + } + new import_obsidian2.Setting(containerEl).setName("Auto pull interval (minutes)").setDesc("Pull changes every X minutes. Set to 0 (default) to disable.").addText((text2) => text2.setValue(String(plugin.settings.autoPullInterval)).onChange((value) => { + if (!isNaN(Number(value))) { + plugin.settings.autoPullInterval = Number(value); + plugin.saveSettings(); + if (plugin.settings.autoPullInterval > 0) { + plugin.clearAutoPull(); + plugin.startAutoPull(plugin.settings.autoPullInterval); + new import_obsidian2.Notice(`Automatic pull enabled! Every ${plugin.settings.autoPullInterval} minutes.`); + } else if (plugin.settings.autoPullInterval <= 0) { + plugin.clearAutoPull() && new import_obsidian2.Notice("Automatic pull disabled!"); + } + } else { + new import_obsidian2.Notice("Please specify a valid number."); + } + })); + new import_obsidian2.Setting(containerEl).setName("Commit message on manual backup/commit").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below) and {{numFiles}} (number of changed files in the commit)").addText((text2) => text2.setPlaceholder("vault backup: {{date}}").setValue(plugin.settings.commitMessage ? plugin.settings.commitMessage : "").onChange((value) => { + plugin.settings.commitMessage = value; + plugin.saveSettings(); + })); + new import_obsidian2.Setting(containerEl).setName("Specify custom commit message on auto backup").setDesc("You will get a pop up to specify your message").addToggle((toggle) => toggle.setValue(plugin.settings.customMessageOnAutoBackup).onChange((value) => { + plugin.settings.customMessageOnAutoBackup = value; + plugin.saveSettings(); + })); + new import_obsidian2.Setting(containerEl).setName("Commit message on auto backup/commit").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below) and {{numFiles}} (number of changed files in the commit)").addText((text2) => text2.setPlaceholder("vault backup: {{date}}").setValue(plugin.settings.autoCommitMessage).onChange((value) => { + plugin.settings.autoCommitMessage = value; + plugin.saveSettings(); + })); + containerEl.createEl("br"); + containerEl.createEl("h3", { text: "Commit message" }); + new import_obsidian2.Setting(containerEl).setName("{{date}} placeholder format").setDesc('Specify custom date format. E.g. "YYYY-MM-DD HH:mm:ss"').addText((text2) => text2.setPlaceholder(plugin.settings.commitDateFormat).setValue(plugin.settings.commitDateFormat).onChange((value) => __async(this, null, function* () { + plugin.settings.commitDateFormat = value; + yield plugin.saveSettings(); + }))); + new import_obsidian2.Setting(containerEl).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device.").addText((text2) => text2.setValue(plugin.localStorage.getHostname()).onChange((value) => __async(this, null, function* () { + plugin.localStorage.setHostname(value); + }))); + new import_obsidian2.Setting(containerEl).setName("Preview commit message").addButton((button) => button.setButtonText("Preview").onClick(() => __async(this, null, function* () { + let commitMessagePreview = yield plugin.gitManager.formatCommitMessage(plugin.settings.commitMessage); + new import_obsidian2.Notice(`${commitMessagePreview}`); + }))); + new import_obsidian2.Setting(containerEl).setName("List filenames affected by commit in the commit body").addToggle((toggle) => toggle.setValue(plugin.settings.listChangedFilesInMessageBody).onChange((value) => { + plugin.settings.listChangedFilesInMessageBody = value; + plugin.saveSettings(); + })); + containerEl.createEl("br"); + containerEl.createEl("h3", { text: "Backup" }); + if (plugin.gitManager instanceof SimpleGit) + new import_obsidian2.Setting(containerEl).setName("Sync Method").setDesc("Selects the method used for handling new changes found in your remote git repository.").addDropdown((dropdown) => { + const options = { + "merge": "Merge", + "rebase": "Rebase", + "reset": "Other sync service (Only updates the HEAD without touching the working directory)" + }; + dropdown.addOptions(options); + dropdown.setValue(plugin.settings.syncMethod); + dropdown.onChange((option) => __async(this, null, function* () { + plugin.settings.syncMethod = option; + plugin.saveSettings(); + })); + }); + new import_obsidian2.Setting(containerEl).setName("Pull updates on startup").setDesc("Automatically pull updates when Obsidian starts").addToggle((toggle) => toggle.setValue(plugin.settings.autoPullOnBoot).onChange((value) => { + plugin.settings.autoPullOnBoot = value; + plugin.saveSettings(); + })); + new import_obsidian2.Setting(containerEl).setName("Push on backup").setDesc("Disable to only commit changes").addToggle((toggle) => toggle.setValue(!plugin.settings.disablePush).onChange((value) => { + plugin.settings.disablePush = !value; + plugin.saveSettings(); + })); + new import_obsidian2.Setting(containerEl).setName("Pull changes before push").setDesc("Commit -> pull -> push (Only if pushing is enabled)").addToggle((toggle) => toggle.setValue(plugin.settings.pullBeforePush).onChange((value) => { + plugin.settings.pullBeforePush = value; + plugin.saveSettings(); + })); + } + containerEl.createEl("br"); + containerEl.createEl("h3", { text: "Miscellaneous" }); + if (gitReady) + new import_obsidian2.Setting(containerEl).setName("Current branch").setDesc("Switch to a different branch").addDropdown((dropdown) => __async(this, null, function* () { + const branchInfo = yield plugin.gitManager.branchInfo(); + for (const branch of branchInfo.branches) { + dropdown.addOption(branch, branch); + } + dropdown.setValue(branchInfo.current); + dropdown.onChange((option) => __async(this, null, function* () { + yield plugin.gitManager.checkout(option); + new import_obsidian2.Notice(`Checked out to ${option}`); + })); + })); + new import_obsidian2.Setting(containerEl).setName("Automatically refresh Source Control View on file changes").setDesc("On slower machines this may cause lags. If so, just disable this option").addToggle((toggle) => toggle.setValue(plugin.settings.refreshSourceControl).onChange((value) => { + plugin.settings.refreshSourceControl = value; + plugin.saveSettings(); + })); + new import_obsidian2.Setting(containerEl).setName("Disable notifications").setDesc("Disable notifications for git operations to minimize distraction (refer to status bar for updates). Errors are still shown as notifications even if you enable this setting").addToggle((toggle) => toggle.setValue(plugin.settings.disablePopups).onChange((value) => { + plugin.settings.disablePopups = value; + plugin.saveSettings(); + })); + new import_obsidian2.Setting(containerEl).setName("Show status bar").setDesc("Obsidian must be restarted for the changes to take affect").addToggle((toggle) => toggle.setValue(plugin.settings.showStatusBar).onChange((value) => { + plugin.settings.showStatusBar = value; + plugin.saveSettings(); + })); + new import_obsidian2.Setting(containerEl).setName("Show changes files count in status bar").addToggle((toggle) => toggle.setValue(plugin.settings.changedFilesInStatusBar).onChange((value) => { + plugin.settings.changedFilesInStatusBar = value; + plugin.saveSettings(); + })); + containerEl.createEl("br"); + containerEl.createEl("h3", { text: "Advanced" }); + if (plugin.gitManager instanceof SimpleGit) + new import_obsidian2.Setting(containerEl).setName("Update submodules").setDesc('"Create backup" and "pull" takes care of submodules. Missing features: Conflicted files, count of pulled/pushed/committed files. Tracking branch needs to be set for each submodule').addToggle((toggle) => toggle.setValue(plugin.settings.updateSubmodules).onChange((value) => { + plugin.settings.updateSubmodules = value; + plugin.saveSettings(); + })); + if (plugin.gitManager instanceof SimpleGit) + new import_obsidian2.Setting(containerEl).setName("Custom Git binary path").addText((cb) => { + cb.setValue(plugin.localStorage.getGitPath()); + cb.setPlaceholder("git"); + cb.onChange((value) => { + plugin.localStorage.setGitPath(value); + plugin.gitManager.updateGitPath(value || "git"); + }); + }); + if (plugin.gitManager instanceof IsomorphicGit) + new import_obsidian2.Setting(containerEl).setName("Username on your git server. E.g. your username on GitHub").addText((cb) => { + cb.setValue(plugin.settings.username); + cb.onChange((value) => { + plugin.settings.username = value; + plugin.saveSettings(); + }); + }); + if (plugin.gitManager instanceof IsomorphicGit) + new import_obsidian2.Setting(containerEl).setName("Password/Personal access token").setDesc("Type in your password and press on the button to set it. You won't be able to see it again.").addText((cb) => { + cb.inputEl.autocapitalize = "off"; + cb.inputEl.autocomplete = "off"; + cb.inputEl.spellcheck = false; + cb.onChange((value) => { + plugin.localStorage.setPassword(value); + }); + }); + if (gitReady) + new import_obsidian2.Setting(containerEl).setName("Author name for commit").addText((cb) => __async(this, null, function* () { + cb.setValue(yield plugin.gitManager.getConfig("user.name")); + cb.onChange((value) => { + plugin.gitManager.setConfig("user.name", value); + }); + })); + if (gitReady) + new import_obsidian2.Setting(containerEl).setName("Author email for commit").addText((cb) => __async(this, null, function* () { + cb.setValue(yield plugin.gitManager.getConfig("user.email")); + cb.onChange((value) => { + plugin.gitManager.setConfig("user.email", value); + }); + })); + new import_obsidian2.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.setPlaceholder("directory/directory-with-git-repo"); + cb.onChange((value) => { + plugin.settings.basePath = value; + plugin.saveSettings(); + plugin.gitManager.updateBasePath(value || ""); + }); + }); + new import_obsidian2.Setting(containerEl).setName("Donate").setDesc("If you like this Plugin, consider donating to support continued development.").addButton((bt) => { + bt.buttonEl.outerHTML = "Buy Me a Coffee at ko-fi.com"; + }); + const info = containerEl.createDiv(); + info.setAttr("align", "center"); + info.setText("Debugging and logging:\nYou can always see the logs of this and every other plugin by opening the console with"); + const keys = containerEl.createDiv(); + keys.setAttr("align", "center"); + keys.addClass("obsidian-git-shortcuts"); + if (import_obsidian2.Platform.isMacOS === true) { + keys.createEl("kbd", { text: "CMD (\u2318) + OPTION (\u2325) + I" }); + } else { + keys.createEl("kbd", { text: "CTRL + SHIFT + I" }); + } + } +}; + +// src/statusBar.ts +var import_obsidian3 = __toModule(require("obsidian")); +var StatusBar = class { + constructor(statusBarEl, plugin) { + this.statusBarEl = statusBarEl; + this.plugin = plugin; + this.messages = []; + this.base = "obsidian-git-statusbar-"; + this.statusBarEl.setAttribute("aria-label-position", "top"); + } + displayMessage(message, timeout) { + this.messages.push({ + message: `Git: ${message.slice(0, 100)}`, + timeout + }); + this.display(); + } + display() { + if (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(); + } else if (this.currentMessage) { + const messageAge = Date.now() - this.lastMessageTimestamp; + if (messageAge >= this.currentMessage.timeout) { + this.currentMessage = null; + this.lastMessageTimestamp = null; + } + } else { + this.displayState(); + } + } + displayState() { + if (this.statusBarEl.getText().length > 3 || !this.statusBarEl.hasChildNodes()) { + this.statusBarEl.empty(); + this.iconEl = this.statusBarEl.createDiv(); + this.textEl = this.statusBarEl.createDiv(); + this.textEl.style.float = "right"; + this.textEl.style.marginLeft = "5px"; + this.iconEl.style.float = "left"; + } + switch (this.plugin.state) { + case PluginState.idle: + this.displayFromNow(this.plugin.lastUpdate); + break; + case PluginState.status: + this.statusBarEl.ariaLabel = "Checking repository status..."; + (0, import_obsidian3.setIcon)(this.iconEl, "refresh-cw"); + this.statusBarEl.addClass(this.base + "status"); + break; + case PluginState.add: + this.statusBarEl.ariaLabel = "Adding files..."; + (0, import_obsidian3.setIcon)(this.iconEl, "refresh-w"); + this.statusBarEl.addClass(this.base + "add"); + break; + case PluginState.commit: + this.statusBarEl.ariaLabel = "Committing changes..."; + (0, import_obsidian3.setIcon)(this.iconEl, "git-commit"); + this.statusBarEl.addClass(this.base + "commit"); + break; + case PluginState.push: + this.statusBarEl.ariaLabel = "Pushing changes..."; + (0, import_obsidian3.setIcon)(this.iconEl, "upload"); + this.statusBarEl.addClass(this.base + "push"); + break; + case PluginState.pull: + this.statusBarEl.ariaLabel = "Pulling changes..."; + (0, import_obsidian3.setIcon)(this.iconEl, "download"); + this.statusBarEl.addClass(this.base + "pull"); + break; + case PluginState.conflicted: + this.statusBarEl.ariaLabel = "You have conflict files..."; + (0, import_obsidian3.setIcon)(this.iconEl, "alert-circle"); + this.statusBarEl.addClass(this.base + "conflict"); + break; + default: + this.statusBarEl.ariaLabel = "Failed on initialization!"; + (0, import_obsidian3.setIcon)(this.iconEl, "alert-triangle"); + this.statusBarEl.addClass(this.base + "failed-init"); + break; + } + } + displayFromNow(timestamp) { + if (timestamp) { + const moment = window.moment; + const fromNow = moment(timestamp).fromNow(); + this.statusBarEl.ariaLabel = `${this.plugin.offlineMode ? "Offline: " : ""}Last Git update: ${fromNow}`; + } else { + this.statusBarEl.ariaLabel = this.plugin.offlineMode ? "Git is offline" : "Git is ready"; + } + if (this.plugin.offlineMode) { + (0, import_obsidian3.setIcon)(this.iconEl, "globe"); + } else { + (0, import_obsidian3.setIcon)(this.iconEl, "check"); + } + if (this.plugin.settings.changedFilesInStatusBar && this.plugin.cachedStatus) { + this.textEl.setText(this.plugin.cachedStatus.changed.length.toString()); + } + this.statusBarEl.addClass(this.base + "idle"); + } +}; + +// src/ui/modals/changedFilesModal.ts +var import_obsidian4 = __toModule(require("obsidian")); +var ChangedFilesModal = class extends import_obsidian4.FuzzySuggestModal { + constructor(plugin, changedFiles) { + super(plugin.app); + this.plugin = plugin; + this.changedFiles = changedFiles; + this.setPlaceholder("Not supported files will be opened by default app!"); + } + getItems() { + return this.changedFiles; + } + getItemText(item) { + if (item.index == "U" && item.working_dir == "U") { + return `Untracked | ${item.vault_path}`; + } + let working_dir = ""; + let index = ""; + if (item.working_dir != " ") + working_dir = `Working dir: ${item.working_dir} `; + if (item.index != " ") + index = `Index: ${item.index}`; + return `${working_dir}${index} | ${item.vault_path}`; + } + onChooseItem(item, _) { + if (this.plugin.app.metadataCache.getFirstLinkpathDest(item.vault_path, "") == null) { + this.app.openWithDefaultApp(item.vault_path); + } else { + this.plugin.app.workspace.openLinkText(item.vault_path, "/"); + } + } +}; + +// src/ui/modals/customMessageModal.ts +var import_obsidian5 = __toModule(require("obsidian")); +var CustomMessageModal = class extends import_obsidian5.SuggestModal { + constructor(plugin, fromAutoBackup) { + super(plugin.app); + this.fromAutoBackup = fromAutoBackup; + this.resolve = null; + this.plugin = plugin; + this.setPlaceholder("Type your message and select optional the version with the added date."); + } + open() { + super.open(); + return new Promise((resolve) => { + this.resolve = resolve; + }); + } + onClose() { + if (this.resolve) + this.resolve(void 0); + } + selectSuggestion(value, evt) { + if (this.resolve) + this.resolve(value); + super.selectSuggestion(value, evt); + } + getSuggestions(query) { + const date = window.moment().format(this.plugin.settings.commitDateFormat); + if (query == "") + query = "..."; + return [query, `${date}: ${query}`, `${query}: ${date}`]; + } + renderSuggestion(value, el) { + el.innerText = value; + } + onChooseSuggestion(item, _) { + } +}; + +// src/constants.ts +var import_obsidian6 = __toModule(require("obsidian")); +var DEFAULT_SETTINGS = { + commitMessage: "vault backup: {{date}}", + autoCommitMessage: void 0, + commitDateFormat: "YYYY-MM-DD HH:mm:ss", + autoSaveInterval: 0, + autoPushInterval: 0, + autoPullInterval: 0, + autoPullOnBoot: false, + disablePush: false, + pullBeforePush: true, + disablePopups: false, + listChangedFilesInMessageBody: false, + showStatusBar: true, + updateSubmodules: false, + syncMethod: "merge", + customMessageOnAutoBackup: false, + autoBackupAfterFileChange: false, + treeStructure: false, + refreshSourceControl: import_obsidian6.Platform.isDesktopApp, + basePath: "", + differentIntervalCommitAndPush: false, + changedFilesInStatusBar: false, + username: "" +}; +var GIT_VIEW_CONFIG = { + type: "git-view", + name: "Source Control", + icon: "git-pull-request" +}; +var DIFF_VIEW_CONFIG = { + type: "diff-view", + name: "Diff View", + icon: "git-pull-request" +}; + +// src/localStorageSettings.ts +var LocalStorageSettings = class { + constructor(plugin) { + this.plugin = plugin; + this.prefix = this.plugin.manifest.id; + } + getPassword() { + return localStorage.getItem(this.prefix + ":password"); + } + setPassword(value) { + return localStorage.setItem(this.prefix + ":password", value); + } + getHostname() { + return localStorage.getItem(this.prefix + ":hostname"); + } + setHostname(value) { + return localStorage.setItem(this.prefix + ":hostname", value); + } + getConflict() { + return localStorage.getItem(this.prefix + ":conflict"); + } + setConflict(value) { + return localStorage.setItem(this.prefix + ":conflict", value); + } + getLastAutoPull() { + return localStorage.getItem(this.prefix + ":lastAutoPull"); + } + setLastAutoPull(value) { + return localStorage.setItem(this.prefix + ":lastAutoPull", value); + } + getLastAutoBackup() { + return localStorage.getItem(this.prefix + ":lastAutoBackup"); + } + setLastAutoBackup(value) { + return localStorage.setItem(this.prefix + ":lastAutoBackup", value); + } + getLastAutoPush() { + return localStorage.getItem(this.prefix + ":lastAutoPush"); + } + setLastAutoPush(value) { + return localStorage.setItem(this.prefix + ":lastAutoPush", value); + } + getGitPath() { + return localStorage.getItem(this.prefix + ":gitPath"); + } + setGitPath(value) { + return localStorage.setItem(this.prefix + ":gitPath", value); + } +}; + +// src/openInGitHub.ts +var import_obsidian7 = __toModule(require("obsidian")); +function openLineInGitHub(editor, file, manager) { + return __async(this, null, function* () { + const { isGitHub, branch, repo, user } = yield getData(manager); + if (isGitHub) { + const path2 = manager.getPath(file.path, true); + const from = editor.getCursor("from").line + 1; + const to = editor.getCursor("to").line + 1; + if (from === to) { + window.open(`https://github.com/${user}/${repo}/blob/${branch}/${path2}?plain=1#L${from}`); + } else { + window.open(`https://github.com/${user}/${repo}/blob/${branch}/${path2}?plain=1#L${from}-L${to}`); + } + } else { + new import_obsidian7.Notice("It seems like you are not using GitHub"); + } + }); +} +function openHistoryInGitHub(file, manager) { + return __async(this, null, function* () { + const { isGitHub, branch, repo, user } = yield getData(manager); + const path2 = manager.getPath(file.path, true); + if (isGitHub) { + window.open(`https://github.com/${user}/${repo}/commits/${branch}/${path2}`); + } else { + new import_obsidian7.Notice("It seems like you are not using GitHub"); + } + }); +} +function getData(manager) { + return __async(this, null, function* () { + const branchInfo = yield manager.branchInfo(); + const remoteBranch = branchInfo.tracking; + const branch = branchInfo.current; + const remote = remoteBranch.substring(0, remoteBranch.indexOf("/")); + const remoteUrl = yield manager.getConfig(`remote.${remote}.url`); + const [isGitHub, httpsUser, httpsRepo, sshUser, sshRepo] = remoteUrl.match(/(?:^https:\/\/github\.com\/(.*)\/(.*)\.git$)|(?:^git@github\.com:(.*)\/(.*)\.git$)/); + return { + isGitHub: !!isGitHub, + repo: httpsRepo || sshRepo, + user: httpsUser || sshUser, + branch + }; + }); +} + // src/ui/diff/diffView.ts var import_diff2html = __toModule(require_diff2html()); -var import_obsidian7 = __toModule(require("obsidian")); -var DiffView = class extends import_obsidian7.ItemView { +var import_obsidian8 = __toModule(require("obsidian")); +var DiffView = class extends import_obsidian8.ItemView { constructor(leaf, plugin) { super(leaf); this.plugin = plugin; @@ -11406,16 +11559,17 @@ var DiffView = class extends import_obsidian7.ItemView { var _a2; if (((_a2 = this.state) == null ? void 0 : _a2.file) && !this.gettingDiff && this.plugin.gitManager) { this.gettingDiff = true; - const diff = this.parser.parseFromString((0, import_diff2html.html)(yield this.plugin.gitManager.getDiffString(this.state.file, this.state.staged)), "text/html").querySelector(".d2h-file-diff"); + let diff = yield this.plugin.gitManager.getDiffString(this.state.file, this.state.staged); this.contentEl.empty(); - if (diff) { - this.contentEl.append(diff); - } else { - const div = this.contentEl.createDiv({ cls: "diff-err" }); - div.createSpan({ text: "\u26A0\uFE0F", cls: "diff-err-sign" }); - div.createEl("br"); - div.createSpan({ text: "No changes to " + this.state.file }); + if (!diff) { + const content = yield this.app.vault.adapter.read(this.plugin.gitManager.getVaultPath(this.state.file)); + const header = `--- /dev/null ++++ ${this.state.file} +@@ -0,0 +1,${content.split("\n").length} @@`; + diff = [...header.split("\n"), ...content.split("\n").map((line) => `+${line}`)].join("\n"); } + const diffEl = this.parser.parseFromString((0, import_diff2html.html)(diff), "text/html").querySelector(".d2h-file-diff"); + this.contentEl.append(diffEl); this.gettingDiff = false; } }); @@ -11423,12 +11577,14 @@ var DiffView = class extends import_obsidian7.ItemView { }; // src/ui/modals/generalModal.ts -var import_obsidian8 = __toModule(require("obsidian")); -var GeneralModal = class extends import_obsidian8.SuggestModal { - constructor(app2, remotes, placeholder) { +var import_obsidian9 = __toModule(require("obsidian")); +var GeneralModal = class extends import_obsidian9.SuggestModal { + constructor(app2, options, placeholder, allowEmpty = false, onlySelection = false) { super(app2); + this.options = options; + this.allowEmpty = allowEmpty; + this.onlySelection = onlySelection; this.resolve = null; - this.list = remotes; this.setPlaceholder(placeholder); } open() { @@ -11438,8 +11594,16 @@ var GeneralModal = class extends import_obsidian8.SuggestModal { }); } selectSuggestion(value, evt) { - if (this.resolve) - this.resolve(value); + if (this.resolve) { + let res; + if (this.allowEmpty && value === " ") + res = ""; + else if (value === "...") + res = void 0; + else + res = value; + this.resolve(res); + } super.selectSuggestion(value, evt); } onClose() { @@ -11447,7 +11611,13 @@ var GeneralModal = class extends import_obsidian8.SuggestModal { this.resolve(void 0); } getSuggestions(query) { - return [query.length > 0 ? query : "...", ...this.list]; + if (this.onlySelection) { + return this.options; + } else if (this.allowEmpty) { + return [query.length > 0 ? query : " ", ...this.options]; + } else { + return [query.length > 0 ? query : "...", ...this.options]; + } } renderSuggestion(value, el) { el.innerText = value; @@ -11456,8 +11626,46 @@ var GeneralModal = class extends import_obsidian8.SuggestModal { } }; +// src/ui/modals/ignoreModal.ts +var import_obsidian10 = __toModule(require("obsidian")); +var IgnoreModal = class extends import_obsidian10.Modal { + constructor(app2, content) { + super(app2); + this.content = content; + this.resolve = null; + } + open() { + super.open(); + return new Promise((resolve) => { + this.resolve = resolve; + }); + } + onOpen() { + let { contentEl, titleEl } = this; + titleEl.setText("Edit .gitignore"); + const div = contentEl.createDiv(); + const text2 = div.createEl("textarea", { + text: this.content, + cls: ["obsidian-git-textarea"], + attr: { rows: 10, cols: 30, wrap: "off" } + }); + div.createEl("button", { + cls: ["mod-cta", "obsidian-git-center-button"], + text: "Save" + }).addEventListener("click", () => __async(this, null, function* () { + this.resolve(text2.value); + this.close(); + })); + } + onClose() { + let { contentEl } = this; + this.resolve(void 0); + contentEl.empty(); + } +}; + // src/ui/sidebar/sidebarView.ts -var import_obsidian14 = __toModule(require("obsidian")); +var import_obsidian17 = __toModule(require("obsidian")); // node_modules/svelte/internal/index.mjs function noop() { @@ -11949,7 +12157,7 @@ function make_dirty(component, i) { } component.$$.dirty[i / 31 | 0] |= 1 << i % 31; } -function init(component, options, instance5, create_fragment5, not_equal, props, append_styles2, dirty = [-1]) { +function init(component, options, instance6, create_fragment6, not_equal, props, append_styles2, dirty = [-1]) { const parent_component = current_component; set_current_component(component); const $$ = component.$$ = { @@ -11972,7 +12180,7 @@ function init(component, options, instance5, create_fragment5, not_equal, props, }; append_styles2 && append_styles2($$.root); let ready2 = false; - $$.ctx = instance5 ? instance5(component, options.props || {}, (i, ret, ...rest) => { + $$.ctx = instance6 ? instance6(component, options.props || {}, (i, ret, ...rest) => { const value = rest.length ? rest[0] : ret; if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { if (!$$.skip_bound && $$.bound[i]) @@ -11985,7 +12193,7 @@ function init(component, options, instance5, create_fragment5, not_equal, props, $$.update(); ready2 = true; run_all($$.before_update); - $$.fragment = create_fragment5 ? create_fragment5($$.ctx) : false; + $$.fragment = create_fragment6 ? create_fragment6($$.ctx) : false; if (options.target) { if (options.hydrate) { start_hydrating(); @@ -12099,7 +12307,7 @@ var { } = import_tslib.default; // src/ui/sidebar/gitView.svelte -var import_obsidian13 = __toModule(require("obsidian")); +var import_obsidian16 = __toModule(require("obsidian")); // node_modules/svelte/easing/index.mjs function cubicOut(t) { @@ -12127,11 +12335,11 @@ function slide(node, { delay: delay2 = 0, duration = 400, easing = cubicOut } = } // src/ui/sidebar/components/fileComponent.svelte -var import_obsidian11 = __toModule(require("obsidian")); +var import_obsidian13 = __toModule(require("obsidian")); // node_modules/obsidian-community-lib/dist/utils.js var feather = __toModule(require_feather()); -var import_obsidian9 = __toModule(require("obsidian")); +var import_obsidian11 = __toModule(require("obsidian")); function hoverPreview(event, view, to) { const targetEl = event.target; app.workspace.trigger("hover-link", { @@ -12145,7 +12353,7 @@ function hoverPreview(event, view, to) { function createNewMDNote(newName, currFilePath = "") { return __async(this, null, function* () { const newFileFolder = app.fileManager.getNewFileParent(currFilePath).path; - const newFilePath = (0, import_obsidian9.normalizePath)(`${newFileFolder}${newFileFolder === "/" ? "" : "/"}${addMD(newName)}`); + const newFilePath = (0, import_obsidian11.normalizePath)(`${newFileFolder}${newFileFolder === "/" ? "" : "/"}${addMD(newName)}`); return yield app.vault.create(newFilePath, ""); }); } @@ -12163,7 +12371,7 @@ function openOrSwitch(_0, _1) { const leavesWithDestAlreadyOpen = []; workspace.iterateAllLeaves((leaf) => { var _a2; - if (leaf.view instanceof import_obsidian9.MarkdownView) { + if (leaf.view instanceof import_obsidian11.MarkdownView) { const file = (_a2 = leaf.view) === null || _a2 === void 0 ? void 0 : _a2.file; if (file && file.basename + "." + file.extension === dest) { leavesWithDestAlreadyOpen.push(leaf); @@ -12181,8 +12389,8 @@ function openOrSwitch(_0, _1) { } // src/ui/modals/discardModal.ts -var import_obsidian10 = __toModule(require("obsidian")); -var DiscardModal = class extends import_obsidian10.Modal { +var import_obsidian12 = __toModule(require("obsidian")); +var DiscardModal = class extends import_obsidian12.Modal { constructor(app2, deletion, filename) { super(app2); this.deletion = deletion; @@ -12388,7 +12596,7 @@ function instance($$self, $$props, $$invalidate) { let { manager } = $$props; let { workspace } = $$props; let buttons = []; - setImmediate(() => buttons.forEach((b) => (0, import_obsidian11.setIcon)(b, b.getAttr("data-icon"), 16))); + window.setTimeout(() => buttons.forEach((b) => (0, import_obsidian13.setIcon)(b, b.getAttr("data-icon"), 16)), 0); function hover(event) { if (!change.path.startsWith(view.app.vault.configDir) || !change.path.startsWith(".")) { hoverPreview(event, view, change.vault_path.split("/").last().replace(".md", "")); @@ -12503,10 +12711,127 @@ var FileComponent = class extends SvelteComponent { }; var fileComponent_default = FileComponent; -// src/ui/sidebar/components/stagedFileComponent.svelte -var import_obsidian12 = __toModule(require("obsidian")); -var import_path2 = __toModule(require("path")); +// src/ui/sidebar/components/pulledFileComponent.svelte +var import_obsidian14 = __toModule(require("obsidian")); function add_css2(target) { + append_styles(target, "svelte-1pr4yz5", "main.svelte-1pr4yz5.svelte-1pr4yz5{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-1pr4yz5 .path.svelte-1pr4yz5{color:var(--text-muted);white-space:nowrap;max-width:75%;overflow:hidden;text-overflow:ellipsis}main.svelte-1pr4yz5:hover .path.svelte-1pr4yz5{color:var(--text-normal);transition:all 200ms}main.svelte-1pr4yz5 .tools.svelte-1pr4yz5{display:flex;align-items:center}main.svelte-1pr4yz5 .tools .type.svelte-1pr4yz5{height:16px;width:16px;margin:0;display:flex;align-items:center;justify-content:center}main.svelte-1pr4yz5 .tools .type[data-type=M].svelte-1pr4yz5{color:orange}main.svelte-1pr4yz5 .tools .type[data-type=D].svelte-1pr4yz5{color:red}"); +} +function create_fragment2(ctx) { + let main; + let span0; + let t0_value = ctx[0].vault_path.split("/").last().replace(".md", "") + ""; + let t0; + let span0_aria_label_value; + let t1; + let div; + let span1; + let t2_value = ctx[0].working_dir + ""; + let t2; + let span1_data_type_value; + let mounted; + let dispose; + return { + c() { + main = element("main"); + span0 = element("span"); + t0 = text(t0_value); + t1 = space(); + div = element("div"); + span1 = element("span"); + t2 = text(t2_value); + attr(span0, "class", "path svelte-1pr4yz5"); + attr(span0, "aria-label-position", ctx[1]); + attr(span0, "aria-label", span0_aria_label_value = ctx[0].vault_path.split("/").last() != ctx[0].vault_path ? ctx[0].vault_path : ""); + attr(span1, "class", "type svelte-1pr4yz5"); + attr(span1, "data-type", span1_data_type_value = ctx[0].working_dir); + attr(div, "class", "tools svelte-1pr4yz5"); + attr(main, "class", "svelte-1pr4yz5"); + }, + m(target, anchor) { + insert(target, main, anchor); + append2(main, span0); + append2(span0, t0); + append2(main, t1); + append2(main, div); + append2(div, span1); + append2(span1, t2); + if (!mounted) { + dispose = [ + listen(span0, "click", self2(ctx[3])), + listen(main, "mouseover", ctx[2]), + listen(main, "click", self2(ctx[3])), + listen(main, "focus", ctx[5]) + ]; + mounted = true; + } + }, + p(ctx2, [dirty]) { + if (dirty & 1 && t0_value !== (t0_value = ctx2[0].vault_path.split("/").last().replace(".md", "") + "")) + set_data(t0, t0_value); + if (dirty & 2) { + attr(span0, "aria-label-position", ctx2[1]); + } + if (dirty & 1 && span0_aria_label_value !== (span0_aria_label_value = ctx2[0].vault_path.split("/").last() != ctx2[0].vault_path ? ctx2[0].vault_path : "")) { + attr(span0, "aria-label", span0_aria_label_value); + } + if (dirty & 1 && t2_value !== (t2_value = ctx2[0].working_dir + "")) + set_data(t2, t2_value); + if (dirty & 1 && span1_data_type_value !== (span1_data_type_value = ctx2[0].working_dir)) { + attr(span1, "data-type", span1_data_type_value); + } + }, + i: noop, + o: noop, + d(detaching) { + if (detaching) + detach(main); + mounted = false; + run_all(dispose); + } + }; +} +function instance2($$self, $$props, $$invalidate) { + let side; + let { change } = $$props; + let { view } = $$props; + function hover(event) { + if (!change.path.startsWith(view.app.vault.configDir) || !change.path.startsWith(".")) { + hoverPreview(event, view, change.vault_path.split("/").last().replace(".md", "")); + } + } + function open(event) { + if (!(change.path.startsWith(view.app.vault.configDir) || change.path.startsWith(".") || change.working_dir === "D")) { + openOrSwitch(change.vault_path, event); + } + } + function focus_handler(event) { + bubble.call(this, $$self, event); + } + $$self.$$set = ($$props2) => { + if ("change" in $$props2) + $$invalidate(0, change = $$props2.change); + if ("view" in $$props2) + $$invalidate(4, view = $$props2.view); + }; + $$self.$$.update = () => { + if ($$self.$$.dirty & 16) { + $: + $$invalidate(1, side = view.leaf.getRoot().side == "left" ? "right" : "left"); + } + }; + return [change, side, hover, open, view, focus_handler]; +} +var PulledFileComponent = class extends SvelteComponent { + constructor(options) { + super(); + init(this, options, instance2, create_fragment2, safe_not_equal, { change: 0, view: 4 }, add_css2); + } +}; +var pulledFileComponent_default = PulledFileComponent; + +// src/ui/sidebar/components/stagedFileComponent.svelte +var import_obsidian15 = __toModule(require("obsidian")); +function add_css3(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)}"); } function create_if_block2(ctx) { @@ -12538,7 +12863,7 @@ function create_if_block2(ctx) { } }; } -function create_fragment2(ctx) { +function create_fragment3(ctx) { let main; let span0; let t0_value = ctx[3].split("/").last().replace(".md", "") + ""; @@ -12653,14 +12978,14 @@ function create_fragment2(ctx) { } }; } -function instance2($$self, $$props, $$invalidate) { +function instance3($$self, $$props, $$invalidate) { let formattedPath; let side; let { change } = $$props; let { view } = $$props; let { manager } = $$props; let buttons = []; - setImmediate(() => buttons.forEach((b) => (0, import_obsidian12.setIcon)(b, b.getAttr("data-icon"), 16))); + window.setTimeout(() => buttons.forEach((b) => (0, import_obsidian15.setIcon)(b, b.getAttr("data-icon"), 16)), 0); function hover(event) { if (!change.path.startsWith(view.app.vault.configDir) || !change.path.startsWith(".")) { hoverPreview(event, view, formattedPath.split("/").last().replace(".md", "")); @@ -12745,13 +13070,13 @@ function instance2($$self, $$props, $$invalidate) { var StagedFileComponent = class extends SvelteComponent { constructor(options) { super(); - init(this, options, instance2, create_fragment2, safe_not_equal, { change: 0, view: 1, manager: 9 }, add_css2); + init(this, options, instance3, create_fragment3, safe_not_equal, { change: 0, view: 1, manager: 9 }, add_css3); } }; var stagedFileComponent_default = StagedFileComponent; // src/ui/sidebar/components/treeComponent.svelte -function add_css3(target) { +function add_css4(target) { append_styles(target, "svelte-pgmdei", '@charset "UTF-8";main.svelte-pgmdei.svelte-pgmdei:not(.topLevel){margin-left:5px}.opener.svelte-pgmdei.svelte-pgmdei{display:flex;justify-content:space-between;align-items:center;padding:0 4px}.opener.svelte-pgmdei .collapse-icon.svelte-pgmdei::after{content:"\xA0"}.opener.svelte-pgmdei div.svelte-pgmdei{display:flex}.opener.svelte-pgmdei svg.svelte-pgmdei{transform:rotate(-90deg)}.opener.open.svelte-pgmdei svg.svelte-pgmdei{transform:rotate(0)}.opener.svelte-pgmdei span.svelte-pgmdei{font-size:0.8rem}.file-view.svelte-pgmdei.svelte-pgmdei{margin-left:5px}'); } function get_each_context(ctx, list, i) { @@ -12759,7 +13084,7 @@ function get_each_context(ctx, list, i) { child_ctx[7] = list[i]; return child_ctx; } -function create_else_block_1(ctx) { +function create_else_block(ctx) { let div2; let div1; let div0; @@ -12775,7 +13100,7 @@ function create_else_block_1(ctx) { function click_handler() { return ctx[6](ctx[7]); } - let if_block = !ctx[5][ctx[7].title] && create_if_block_2(ctx); + let if_block = !ctx[5][ctx[7].title] && create_if_block_4(ctx); return { c() { div2 = element("div"); @@ -12827,7 +13152,7 @@ function create_else_block_1(ctx) { transition_in(if_block, 1); } } else { - if_block = create_if_block_2(ctx); + if_block = create_if_block_4(ctx); if_block.c(); transition_in(if_block, 1); if_block.m(if_block_anchor.parentNode, if_block_anchor); @@ -12870,25 +13195,33 @@ function create_if_block3(ctx) { let if_block; let t; let current; - const if_block_creators = [create_if_block_1, create_else_block]; + const if_block_creators = [create_if_block_1, create_if_block_2, create_if_block_3]; const if_blocks = []; function select_block_type_1(ctx2, dirty) { - if (ctx2[3]) + if (ctx2[3] == FileType.staged) return 0; - return 1; + if (ctx2[3] == FileType.changed) + return 1; + if (ctx2[3] == FileType.pulled) + return 2; + return -1; + } + if (~(current_block_type_index = select_block_type_1(ctx, -1))) { + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); } - current_block_type_index = select_block_type_1(ctx, -1); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); return { c() { div = element("div"); - if_block.c(); + if (if_block) + if_block.c(); t = space(); attr(div, "class", "file-view svelte-pgmdei"); }, m(target, anchor) { insert(target, div, anchor); - if_blocks[current_block_type_index].m(div, null); + if (~current_block_type_index) { + if_blocks[current_block_type_index].m(div, null); + } append2(div, t); current = true; }, @@ -12896,22 +13229,30 @@ function create_if_block3(ctx) { let previous_block_index = current_block_type_index; current_block_type_index = select_block_type_1(ctx2, dirty); if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } else { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); + if (~current_block_type_index) { + if_blocks[current_block_type_index].p(ctx2, dirty); + } + } else { + if (if_block) { + group_outros(); + transition_out(if_blocks[previous_block_index], 1, 1, () => { + if_blocks[previous_block_index] = null; + }); + check_outros(); + } + if (~current_block_type_index) { + if_block = if_blocks[current_block_type_index]; + if (!if_block) { + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); + if_block.c(); + } else { + if_block.p(ctx2, dirty); + } + transition_in(if_block, 1); + if_block.m(div, t); + } else { + if_block = null; } - transition_in(if_block, 1); - if_block.m(div, t); } }, i(local) { @@ -12927,11 +13268,13 @@ function create_if_block3(ctx) { d(detaching) { if (detaching) detach(div); - if_blocks[current_block_type_index].d(); + if (~current_block_type_index) { + if_blocks[current_block_type_index].d(); + } } }; } -function create_if_block_2(ctx) { +function create_if_block_4(ctx) { let div; let treecomponent; let t; @@ -12942,7 +13285,7 @@ function create_if_block_2(ctx) { hierarchy: ctx[7], plugin: ctx[1], view: ctx[2], - staged: ctx[3] + fileType: ctx[3] } }); return { @@ -12967,7 +13310,7 @@ function create_if_block_2(ctx) { if (dirty & 4) treecomponent_changes.view = ctx2[2]; if (dirty & 8) - treecomponent_changes.staged = ctx2[3]; + treecomponent_changes.fileType = ctx2[3]; treecomponent.$set(treecomponent_changes); }, i(local) { @@ -13001,7 +13344,47 @@ function create_if_block_2(ctx) { } }; } -function create_else_block(ctx) { +function create_if_block_3(ctx) { + let pulledfilecomponent; + let current; + pulledfilecomponent = new pulledFileComponent_default({ + props: { + change: ctx[7].statusResult, + view: ctx[2] + } + }); + return { + c() { + create_component(pulledfilecomponent.$$.fragment); + }, + m(target, anchor) { + mount_component(pulledfilecomponent, target, anchor); + current = true; + }, + p(ctx2, dirty) { + const pulledfilecomponent_changes = {}; + if (dirty & 1) + pulledfilecomponent_changes.change = ctx2[7].statusResult; + if (dirty & 4) + pulledfilecomponent_changes.view = ctx2[2]; + pulledfilecomponent.$set(pulledfilecomponent_changes); + }, + i(local) { + if (current) + return; + transition_in(pulledfilecomponent.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(pulledfilecomponent.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(pulledfilecomponent, detaching); + } + }; +} +function create_if_block_2(ctx) { let filecomponent; let current; filecomponent = new fileComponent_default({ @@ -13095,7 +13478,7 @@ function create_each_block(ctx) { let if_block; let if_block_anchor; let current; - const if_block_creators = [create_if_block3, create_else_block_1]; + const if_block_creators = [create_if_block3, create_else_block]; const if_blocks = []; function select_block_type(ctx2, dirty) { if (ctx2[7].statusResult) @@ -13153,7 +13536,7 @@ function create_each_block(ctx) { } }; } -function create_fragment3(ctx) { +function create_fragment4(ctx) { let main; let current; let each_value = ctx[0].children; @@ -13228,11 +13611,11 @@ function create_fragment3(ctx) { } }; } -function instance3($$self, $$props, $$invalidate) { +function instance4($$self, $$props, $$invalidate) { let { hierarchy } = $$props; let { plugin } = $$props; let { view } = $$props; - let { staged } = $$props; + let { fileType } = $$props; let { topLevel = false } = $$props; const closed = {}; const click_handler = (entity) => { @@ -13245,42 +13628,47 @@ function instance3($$self, $$props, $$invalidate) { $$invalidate(1, plugin = $$props2.plugin); if ("view" in $$props2) $$invalidate(2, view = $$props2.view); - if ("staged" in $$props2) - $$invalidate(3, staged = $$props2.staged); + if ("fileType" in $$props2) + $$invalidate(3, fileType = $$props2.fileType); if ("topLevel" in $$props2) $$invalidate(4, topLevel = $$props2.topLevel); }; - return [hierarchy, plugin, view, staged, topLevel, closed, click_handler]; + return [hierarchy, plugin, view, fileType, topLevel, closed, click_handler]; } var TreeComponent = class extends SvelteComponent { constructor(options) { super(); - init(this, options, instance3, create_fragment3, safe_not_equal, { + init(this, options, instance4, create_fragment4, safe_not_equal, { hierarchy: 0, plugin: 1, view: 2, - staged: 3, + fileType: 3, topLevel: 4 - }, add_css3); + }, add_css4); } }; var treeComponent_default = TreeComponent; // src/ui/sidebar/gitView.svelte -function add_css4(target) { +function add_css5(target) { append_styles(target, "svelte-1f0ksxd", '@charset "UTF-8";.commit-msg.svelte-1f0ksxd.svelte-1f0ksxd{width:100%;min-height:1.9em;height:1.9em;resize:vertical;padding:2px 5px;background-color:var(--background-modifier-form-field)}.search-input-container.svelte-1f0ksxd.svelte-1f0ksxd{width:100%}.file-view.svelte-1f0ksxd.svelte-1f0ksxd{margin-left:5px}.opener.svelte-1f0ksxd.svelte-1f0ksxd{display:flex;justify-content:space-between;align-items:center;padding:0 4px}.opener.svelte-1f0ksxd .collapse-icon.svelte-1f0ksxd::after{content:"\xA0"}.opener.svelte-1f0ksxd div.svelte-1f0ksxd{display:flex}.opener.svelte-1f0ksxd svg.svelte-1f0ksxd{transform:rotate(-90deg)}.opener.open.svelte-1f0ksxd svg.svelte-1f0ksxd{transform:rotate(0)}.git-view-body.svelte-1f0ksxd.svelte-1f0ksxd{overflow-y:auto;padding-left:10px}main.svelte-1f0ksxd.svelte-1f0ksxd{display:flex;flex-direction:column;height:100%;overflow-y:hidden}.nav-buttons-container.svelte-1f0ksxd.svelte-1f0ksxd{justify-content:space-between}.group.svelte-1f0ksxd.svelte-1f0ksxd{display:flex}'); } function get_each_context2(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[30] = list[i]; + child_ctx[34] = list[i]; return child_ctx; } function get_each_context_1(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[33] = list[i]; + child_ctx[34] = list[i]; return child_ctx; } -function create_if_block_5(ctx) { +function get_each_context_2(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[39] = list[i]; + return child_ctx; +} +function create_if_block_8(ctx) { let div; let div_aria_label_value; let mounted; @@ -13294,7 +13682,7 @@ function create_if_block_5(ctx) { m(target, anchor) { insert(target, div, anchor); if (!mounted) { - dispose = listen(div, "click", ctx[26]); + dispose = listen(div, "click", ctx[29]); mounted = true; } }, @@ -13325,11 +13713,14 @@ function create_if_block4(ctx) { let t9_value = ctx[5].changed.length + ""; let t9; let t10; + let t11; + let if_block2_anchor; let current; let mounted; let dispose; - let if_block0 = ctx[11] && create_if_block_3(ctx); - let if_block1 = ctx[10] && create_if_block_12(ctx); + let if_block0 = ctx[13] && create_if_block_6(ctx); + let if_block1 = ctx[12] && create_if_block_42(ctx); + let if_block2 = ctx[6].length > 0 && create_if_block_12(ctx); return { c() { div3 = element("div"); @@ -13355,15 +13746,19 @@ function create_if_block4(ctx) { t10 = space(); if (if_block1) if_block1.c(); + t11 = space(); + if (if_block2) + if_block2.c(); + if_block2_anchor = empty(); attr(div1, "class", "svelte-1f0ksxd"); attr(span1, "class", "tree-item-flair"); attr(div2, "class", "opener tree-item-self is-clickable svelte-1f0ksxd"); - toggle_class(div2, "open", ctx[11]); + toggle_class(div2, "open", ctx[13]); attr(div3, "class", "staged"); attr(div5, "class", "svelte-1f0ksxd"); attr(span3, "class", "tree-item-flair"); attr(div6, "class", "opener tree-item-self is-clickable svelte-1f0ksxd"); - toggle_class(div6, "open", ctx[10]); + toggle_class(div6, "open", ctx[12]); attr(div7, "class", "changes"); }, m(target, anchor) { @@ -13386,11 +13781,15 @@ function create_if_block4(ctx) { append2(div7, t10); if (if_block1) if_block1.m(div7, null); + insert(target, t11, anchor); + if (if_block2) + if_block2.m(target, anchor); + insert(target, if_block2_anchor, anchor); current = true; if (!mounted) { dispose = [ - listen(div2, "click", ctx[27]), - listen(div6, "click", ctx[28]) + listen(div2, "click", ctx[30]), + listen(div6, "click", ctx[31]) ]; mounted = true; } @@ -13398,17 +13797,17 @@ function create_if_block4(ctx) { p(ctx2, dirty) { if ((!current || dirty[0] & 32) && t3_value !== (t3_value = ctx2[5].staged.length + "")) set_data(t3, t3_value); - if (dirty[0] & 2048) { - toggle_class(div2, "open", ctx2[11]); + if (dirty[0] & 8192) { + toggle_class(div2, "open", ctx2[13]); } - if (ctx2[11]) { + if (ctx2[13]) { if (if_block0) { if_block0.p(ctx2, dirty); - if (dirty[0] & 2048) { + if (dirty[0] & 8192) { transition_in(if_block0, 1); } } else { - if_block0 = create_if_block_3(ctx2); + if_block0 = create_if_block_6(ctx2); if_block0.c(); transition_in(if_block0, 1); if_block0.m(div3, null); @@ -13422,17 +13821,17 @@ function create_if_block4(ctx) { } if ((!current || dirty[0] & 32) && t9_value !== (t9_value = ctx2[5].changed.length + "")) set_data(t9, t9_value); - if (dirty[0] & 1024) { - toggle_class(div6, "open", ctx2[10]); + if (dirty[0] & 4096) { + toggle_class(div6, "open", ctx2[12]); } - if (ctx2[10]) { + if (ctx2[12]) { if (if_block1) { if_block1.p(ctx2, dirty); - if (dirty[0] & 1024) { + if (dirty[0] & 4096) { transition_in(if_block1, 1); } } else { - if_block1 = create_if_block_12(ctx2); + if_block1 = create_if_block_42(ctx2); if_block1.c(); transition_in(if_block1, 1); if_block1.m(div7, null); @@ -13444,17 +13843,38 @@ function create_if_block4(ctx) { }); check_outros(); } + if (ctx2[6].length > 0) { + if (if_block2) { + if_block2.p(ctx2, dirty); + if (dirty[0] & 64) { + transition_in(if_block2, 1); + } + } else { + if_block2 = create_if_block_12(ctx2); + if_block2.c(); + transition_in(if_block2, 1); + if_block2.m(if_block2_anchor.parentNode, if_block2_anchor); + } + } else if (if_block2) { + group_outros(); + transition_out(if_block2, 1, 1, () => { + if_block2 = null; + }); + check_outros(); + } }, i(local) { if (current) return; transition_in(if_block0); transition_in(if_block1); + transition_in(if_block2); current = true; }, o(local) { transition_out(if_block0); transition_out(if_block1); + transition_out(if_block2); current = false; }, d(detaching) { @@ -13468,18 +13888,24 @@ function create_if_block4(ctx) { detach(div7); if (if_block1) if_block1.d(); + if (detaching) + detach(t11); + if (if_block2) + if_block2.d(detaching); + if (detaching) + detach(if_block2_anchor); mounted = false; run_all(dispose); } }; } -function create_if_block_3(ctx) { +function create_if_block_6(ctx) { let div; let current_block_type_index; let if_block; let div_transition; let current; - const if_block_creators = [create_if_block_4, create_else_block_12]; + const if_block_creators = [create_if_block_7, create_else_block_2]; const if_blocks = []; function select_block_type(ctx2, dirty) { if (ctx2[2]) @@ -13552,13 +13978,13 @@ function create_if_block_3(ctx) { } }; } -function create_else_block_12(ctx) { +function create_else_block_2(ctx) { let each_1_anchor; let current; - let each_value_1 = ctx[5].staged; + let each_value_2 = ctx[5].staged; let each_blocks = []; - for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i)); + for (let i = 0; i < each_value_2.length; i += 1) { + each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); } const out = (i) => transition_out(each_blocks[i], 1, 1, () => { each_blocks[i] = null; @@ -13579,22 +14005,22 @@ function create_else_block_12(ctx) { }, p(ctx2, dirty) { if (dirty[0] & 35) { - each_value_1 = ctx2[5].staged; + each_value_2 = ctx2[5].staged; let i; - for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_1(ctx2, each_value_1, i); + for (i = 0; i < each_value_2.length; i += 1) { + const child_ctx = get_each_context_2(ctx2, each_value_2, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); transition_in(each_blocks[i], 1); } else { - each_blocks[i] = create_each_block_1(child_ctx); + each_blocks[i] = create_each_block_2(child_ctx); each_blocks[i].c(); transition_in(each_blocks[i], 1); each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); } } group_outros(); - for (i = each_value_1.length; i < each_blocks.length; i += 1) { + for (i = each_value_2.length; i < each_blocks.length; i += 1) { out(i); } check_outros(); @@ -13603,7 +14029,7 @@ function create_else_block_12(ctx) { i(local) { if (current) return; - for (let i = 0; i < each_value_1.length; i += 1) { + for (let i = 0; i < each_value_2.length; i += 1) { transition_in(each_blocks[i]); } current = true; @@ -13622,15 +14048,15 @@ function create_else_block_12(ctx) { } }; } -function create_if_block_4(ctx) { +function create_if_block_7(ctx) { let treecomponent; let current; treecomponent = new treeComponent_default({ props: { - hierarchy: ctx[9], + hierarchy: ctx[10], plugin: ctx[0], view: ctx[1], - staged: true, + fileType: FileType.staged, topLevel: true } }); @@ -13644,8 +14070,8 @@ function create_if_block_4(ctx) { }, p(ctx2, dirty) { const treecomponent_changes = {}; - if (dirty[0] & 512) - treecomponent_changes.hierarchy = ctx2[9]; + if (dirty[0] & 1024) + treecomponent_changes.hierarchy = ctx2[10]; if (dirty[0] & 1) treecomponent_changes.plugin = ctx2[0]; if (dirty[0] & 2) @@ -13667,12 +14093,12 @@ function create_if_block_4(ctx) { } }; } -function create_each_block_1(ctx) { +function create_each_block_2(ctx) { let stagedfilecomponent; let current; stagedfilecomponent = new stagedFileComponent_default({ props: { - change: ctx[33], + change: ctx[39], view: ctx[1], manager: ctx[0].gitManager } @@ -13688,7 +14114,7 @@ function create_each_block_1(ctx) { p(ctx2, dirty) { const stagedfilecomponent_changes = {}; if (dirty[0] & 32) - stagedfilecomponent_changes.change = ctx2[33]; + stagedfilecomponent_changes.change = ctx2[39]; if (dirty[0] & 2) stagedfilecomponent_changes.view = ctx2[1]; if (dirty[0] & 1) @@ -13710,13 +14136,13 @@ function create_each_block_1(ctx) { } }; } -function create_if_block_12(ctx) { +function create_if_block_42(ctx) { let div; let current_block_type_index; let if_block; let div_transition; let current; - const if_block_creators = [create_if_block_22, create_else_block2]; + const if_block_creators = [create_if_block_5, create_else_block_1]; const if_blocks = []; function select_block_type_1(ctx2, dirty) { if (ctx2[2]) @@ -13789,10 +14215,345 @@ function create_if_block_12(ctx) { } }; } +function create_else_block_1(ctx) { + let each_1_anchor; + let current; + let each_value_1 = ctx[5].changed; + let each_blocks = []; + for (let i = 0; i < each_value_1.length; i += 1) { + each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i)); + } + const out = (i) => transition_out(each_blocks[i], 1, 1, () => { + each_blocks[i] = null; + }); + return { + c() { + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + each_1_anchor = empty(); + }, + m(target, anchor) { + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(target, anchor); + } + insert(target, each_1_anchor, anchor); + current = true; + }, + p(ctx2, dirty) { + if (dirty[0] & 35) { + each_value_1 = ctx2[5].changed; + let i; + for (i = 0; i < each_value_1.length; i += 1) { + const child_ctx = get_each_context_1(ctx2, each_value_1, i); + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + transition_in(each_blocks[i], 1); + } else { + each_blocks[i] = create_each_block_1(child_ctx); + each_blocks[i].c(); + transition_in(each_blocks[i], 1); + each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); + } + } + group_outros(); + for (i = each_value_1.length; i < each_blocks.length; i += 1) { + out(i); + } + check_outros(); + } + }, + i(local) { + if (current) + return; + for (let i = 0; i < each_value_1.length; i += 1) { + transition_in(each_blocks[i]); + } + current = true; + }, + o(local) { + each_blocks = each_blocks.filter(Boolean); + for (let i = 0; i < each_blocks.length; i += 1) { + transition_out(each_blocks[i]); + } + current = false; + }, + d(detaching) { + destroy_each(each_blocks, detaching); + if (detaching) + detach(each_1_anchor); + } + }; +} +function create_if_block_5(ctx) { + let treecomponent; + let current; + treecomponent = new treeComponent_default({ + props: { + hierarchy: ctx[9], + plugin: ctx[0], + view: ctx[1], + fileType: FileType.changed, + topLevel: true + } + }); + return { + c() { + create_component(treecomponent.$$.fragment); + }, + m(target, anchor) { + mount_component(treecomponent, target, anchor); + current = true; + }, + p(ctx2, dirty) { + const treecomponent_changes = {}; + if (dirty[0] & 512) + treecomponent_changes.hierarchy = ctx2[9]; + if (dirty[0] & 1) + treecomponent_changes.plugin = ctx2[0]; + if (dirty[0] & 2) + treecomponent_changes.view = ctx2[1]; + treecomponent.$set(treecomponent_changes); + }, + i(local) { + if (current) + return; + transition_in(treecomponent.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(treecomponent.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(treecomponent, detaching); + } + }; +} +function create_each_block_1(ctx) { + let filecomponent; + let current; + filecomponent = new fileComponent_default({ + props: { + change: ctx[34], + view: ctx[1], + manager: ctx[0].gitManager, + workspace: ctx[0].app.workspace + } + }); + filecomponent.$on("git-refresh", triggerRefresh); + return { + c() { + create_component(filecomponent.$$.fragment); + }, + m(target, anchor) { + mount_component(filecomponent, target, anchor); + current = true; + }, + p(ctx2, dirty) { + const filecomponent_changes = {}; + if (dirty[0] & 32) + filecomponent_changes.change = ctx2[34]; + if (dirty[0] & 2) + filecomponent_changes.view = ctx2[1]; + if (dirty[0] & 1) + filecomponent_changes.manager = ctx2[0].gitManager; + if (dirty[0] & 1) + filecomponent_changes.workspace = ctx2[0].app.workspace; + filecomponent.$set(filecomponent_changes); + }, + i(local) { + if (current) + return; + transition_in(filecomponent.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(filecomponent.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(filecomponent, detaching); + } + }; +} +function create_if_block_12(ctx) { + let div3; + let div2; + let div1; + let t2; + let span1; + let t3_value = ctx[6].length + ""; + let t3; + let t4; + let current; + let mounted; + let dispose; + let if_block = ctx[14] && create_if_block_22(ctx); + return { + c() { + div3 = element("div"); + div2 = element("div"); + div1 = element("div"); + div1.innerHTML = `
+ Recently Pulled Changes`; + t2 = space(); + span1 = element("span"); + t3 = text(t3_value); + t4 = space(); + if (if_block) + if_block.c(); + attr(div1, "class", "svelte-1f0ksxd"); + attr(span1, "class", "tree-item-flair"); + attr(div2, "class", "opener tree-item-self is-clickable svelte-1f0ksxd"); + toggle_class(div2, "open", ctx[14]); + attr(div3, "class", "pulled"); + }, + m(target, anchor) { + insert(target, div3, anchor); + append2(div3, div2); + append2(div2, div1); + append2(div2, t2); + append2(div2, span1); + append2(span1, t3); + append2(div3, t4); + if (if_block) + if_block.m(div3, null); + current = true; + if (!mounted) { + dispose = listen(div2, "click", ctx[32]); + mounted = true; + } + }, + p(ctx2, dirty) { + if ((!current || dirty[0] & 64) && t3_value !== (t3_value = ctx2[6].length + "")) + set_data(t3, t3_value); + if (dirty[0] & 16384) { + toggle_class(div2, "open", ctx2[14]); + } + if (ctx2[14]) { + if (if_block) { + if_block.p(ctx2, dirty); + if (dirty[0] & 16384) { + transition_in(if_block, 1); + } + } else { + if_block = create_if_block_22(ctx2); + if_block.c(); + transition_in(if_block, 1); + if_block.m(div3, null); + } + } else if (if_block) { + group_outros(); + transition_out(if_block, 1, 1, () => { + if_block = null; + }); + check_outros(); + } + }, + i(local) { + if (current) + return; + transition_in(if_block); + current = true; + }, + o(local) { + transition_out(if_block); + current = false; + }, + d(detaching) { + if (detaching) + detach(div3); + if (if_block) + if_block.d(); + mounted = false; + dispose(); + } + }; +} +function create_if_block_22(ctx) { + let div; + let current_block_type_index; + let if_block; + let div_transition; + let current; + const if_block_creators = [create_if_block_32, create_else_block2]; + const if_blocks = []; + function select_block_type_2(ctx2, dirty) { + if (ctx2[2]) + return 0; + return 1; + } + current_block_type_index = select_block_type_2(ctx, [-1, -1]); + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); + return { + c() { + div = element("div"); + if_block.c(); + attr(div, "class", "file-view svelte-1f0ksxd"); + }, + m(target, anchor) { + insert(target, div, anchor); + if_blocks[current_block_type_index].m(div, null); + current = true; + }, + p(ctx2, dirty) { + let previous_block_index = current_block_type_index; + current_block_type_index = select_block_type_2(ctx2, dirty); + if (current_block_type_index === previous_block_index) { + if_blocks[current_block_type_index].p(ctx2, dirty); + } else { + group_outros(); + transition_out(if_blocks[previous_block_index], 1, 1, () => { + if_blocks[previous_block_index] = null; + }); + check_outros(); + if_block = if_blocks[current_block_type_index]; + if (!if_block) { + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); + if_block.c(); + } else { + if_block.p(ctx2, dirty); + } + transition_in(if_block, 1); + if_block.m(div, null); + } + }, + i(local) { + if (current) + return; + transition_in(if_block); + if (local) { + add_render_callback(() => { + if (!div_transition) + div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, true); + div_transition.run(1); + }); + } + current = true; + }, + o(local) { + transition_out(if_block); + if (local) { + if (!div_transition) + div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, false); + div_transition.run(0); + } + current = false; + }, + d(detaching) { + if (detaching) + detach(div); + if_blocks[current_block_type_index].d(); + if (detaching && div_transition) + div_transition.end(); + } + }; +} function create_else_block2(ctx) { let each_1_anchor; let current; - let each_value = ctx[5].changed; + let each_value = ctx[6]; let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { each_blocks[i] = create_each_block2(get_each_context2(ctx, each_value, i)); @@ -13815,8 +14576,8 @@ function create_else_block2(ctx) { current = true; }, p(ctx2, dirty) { - if (dirty[0] & 35) { - each_value = ctx2[5].changed; + if (dirty[0] & 66) { + each_value = ctx2[6]; let i; for (i = 0; i < each_value.length; i += 1) { const child_ctx = get_each_context2(ctx2, each_value, i); @@ -13859,15 +14620,15 @@ function create_else_block2(ctx) { } }; } -function create_if_block_22(ctx) { +function create_if_block_32(ctx) { let treecomponent; let current; treecomponent = new treeComponent_default({ props: { - hierarchy: ctx[8], + hierarchy: ctx[11], plugin: ctx[0], view: ctx[1], - staged: false, + fileType: FileType.pulled, topLevel: true } }); @@ -13881,8 +14642,8 @@ function create_if_block_22(ctx) { }, p(ctx2, dirty) { const treecomponent_changes = {}; - if (dirty[0] & 256) - treecomponent_changes.hierarchy = ctx2[8]; + if (dirty[0] & 2048) + treecomponent_changes.hierarchy = ctx2[11]; if (dirty[0] & 1) treecomponent_changes.plugin = ctx2[0]; if (dirty[0] & 2) @@ -13905,53 +14666,47 @@ function create_if_block_22(ctx) { }; } function create_each_block2(ctx) { - let filecomponent; + let pulledfilecomponent; let current; - filecomponent = new fileComponent_default({ + pulledfilecomponent = new pulledFileComponent_default({ props: { - change: ctx[30], - view: ctx[1], - manager: ctx[0].gitManager, - workspace: ctx[0].app.workspace + change: ctx[34], + view: ctx[1] } }); - filecomponent.$on("git-refresh", triggerRefresh); + pulledfilecomponent.$on("git-refresh", triggerRefresh); return { c() { - create_component(filecomponent.$$.fragment); + create_component(pulledfilecomponent.$$.fragment); }, m(target, anchor) { - mount_component(filecomponent, target, anchor); + mount_component(pulledfilecomponent, target, anchor); current = true; }, p(ctx2, dirty) { - const filecomponent_changes = {}; - if (dirty[0] & 32) - filecomponent_changes.change = ctx2[30]; + const pulledfilecomponent_changes = {}; + if (dirty[0] & 64) + pulledfilecomponent_changes.change = ctx2[34]; if (dirty[0] & 2) - filecomponent_changes.view = ctx2[1]; - if (dirty[0] & 1) - filecomponent_changes.manager = ctx2[0].gitManager; - if (dirty[0] & 1) - filecomponent_changes.workspace = ctx2[0].app.workspace; - filecomponent.$set(filecomponent_changes); + pulledfilecomponent_changes.view = ctx2[1]; + pulledfilecomponent.$set(pulledfilecomponent_changes); }, i(local) { if (current) return; - transition_in(filecomponent.$$.fragment, local); + transition_in(pulledfilecomponent.$$.fragment, local); current = true; }, o(local) { - transition_out(filecomponent.$$.fragment, local); + transition_out(pulledfilecomponent.$$.fragment, local); current = false; }, d(detaching) { - destroy_component(filecomponent, detaching); + destroy_component(pulledfilecomponent, detaching); } }; } -function create_fragment4(ctx) { +function create_fragment5(ctx) { let main; let div9; let div6; @@ -13977,7 +14732,7 @@ function create_fragment4(ctx) { let current; let mounted; let dispose; - let if_block0 = ctx[6] && create_if_block_5(ctx); + let if_block0 = ctx[7] && create_if_block_8(ctx); let if_block1 = ctx[5] && create_if_block4(ctx); return { c() { @@ -14050,29 +14805,29 @@ function create_fragment4(ctx) { append2(main, div9); append2(div9, div6); append2(div6, div0); - ctx[17](div0); + ctx[20](div0); append2(div6, t0); append2(div6, div1); - ctx[18](div1); + ctx[21](div1); append2(div6, t1); append2(div6, div2); - ctx[19](div2); + ctx[22](div2); append2(div6, t2); append2(div6, div3); - ctx[20](div3); + ctx[23](div3); append2(div6, t3); append2(div6, div4); - ctx[21](div4); + ctx[24](div4); append2(div6, t4); append2(div6, div5); - ctx[22](div5); + ctx[25](div5); append2(div9, t5); append2(div9, div7); - ctx[24](div7); + ctx[27](div7); append2(div9, t6); append2(div9, div8); append2(div8, textarea); - set_input_value(textarea, ctx[6]); + set_input_value(textarea, ctx[7]); append2(div8, t7); if (if_block0) if_block0.m(div8, null); @@ -14083,14 +14838,14 @@ function create_fragment4(ctx) { current = true; if (!mounted) { dispose = [ - listen(div0, "click", ctx[12]), - listen(div1, "click", ctx[13]), - listen(div2, "click", ctx[14]), - listen(div3, "click", ctx[15]), - listen(div4, "click", ctx[16]), - listen(div5, "click", ctx[23]), + listen(div0, "click", ctx[15]), + listen(div1, "click", ctx[16]), + listen(div2, "click", ctx[17]), + listen(div3, "click", ctx[18]), + listen(div4, "click", ctx[19]), + listen(div5, "click", ctx[26]), listen(div7, "click", triggerRefresh), - listen(textarea, "input", ctx[25]) + listen(textarea, "input", ctx[28]) ]; mounted = true; } @@ -14099,14 +14854,14 @@ function create_fragment4(ctx) { if (dirty[0] & 16) { toggle_class(div7, "loading", ctx2[4]); } - if (dirty[0] & 64) { - set_input_value(textarea, ctx2[6]); + if (dirty[0] & 128) { + set_input_value(textarea, ctx2[7]); } - if (ctx2[6]) { + if (ctx2[7]) { if (if_block0) { if_block0.p(ctx2, dirty); } else { - if_block0 = create_if_block_5(ctx2); + if_block0 = create_if_block_8(ctx2); if_block0.c(); if_block0.m(div8, null); } @@ -14147,13 +14902,13 @@ function create_fragment4(ctx) { d(detaching) { if (detaching) detach(main); - ctx[17](null); - ctx[18](null); - ctx[19](null); ctx[20](null); ctx[21](null); ctx[22](null); + ctx[23](null); ctx[24](null); + ctx[25](null); + ctx[27](null); if (if_block0) if_block0.d(); if (if_block1) @@ -14166,24 +14921,29 @@ function create_fragment4(ctx) { function triggerRefresh() { dispatchEvent(new CustomEvent("git-refresh")); } -function instance4($$self, $$props, $$invalidate) { +function instance5($$self, $$props, $$invalidate) { let { plugin } = $$props; let { view } = $$props; let loading; let status; + let lastPulledFiles = []; let commitMessage = plugin.settings.commitMessage; let buttons = []; let changeHierarchy; let stagedHierarchy; + let lastPulledFilesHierarchy; let changesOpen = true; let stagedOpen = true; + let lastPulledFilesOpen = true; let showTree = plugin.settings.treeStructure; let layoutBtn; addEventListener("git-view-refresh", refresh); - plugin.app.workspace.onLayoutReady(() => setImmediate(() => { - buttons.forEach((btn) => (0, import_obsidian13.setIcon)(btn, btn.getAttr("data-icon"), 16)); - (0, import_obsidian13.setIcon)(layoutBtn, showTree ? "list" : "folder", 16); - })); + plugin.app.workspace.onLayoutReady(() => { + window.setTimeout(() => { + buttons.forEach((btn) => (0, import_obsidian16.setIcon)(btn, btn.getAttr("data-icon"), 16)); + (0, import_obsidian16.setIcon)(layoutBtn, showTree ? "list" : "folder", 16); + }, 0); + }); onDestroy(() => { removeEventListener("git-view-refresh", refresh); }); @@ -14196,34 +14956,55 @@ function instance4($$self, $$props, $$invalidate) { } plugin.gitManager.commit(commitMessage).then(() => { if (commitMessage !== plugin.settings.commitMessage) { - $$invalidate(6, commitMessage = ""); + $$invalidate(7, commitMessage = ""); } }).finally(triggerRefresh); }); } function refresh() { return __awaiter(this, void 0, void 0, function* () { + if (!plugin.gitReady) { + $$invalidate(5, status = void 0); + return; + } $$invalidate(5, status = plugin.cachedStatus); + if (plugin.lastPulledFiles && plugin.lastPulledFiles != lastPulledFiles) { + $$invalidate(6, lastPulledFiles = plugin.lastPulledFiles); + $$invalidate(11, lastPulledFilesHierarchy = { + title: "", + children: plugin.gitManager.getTreeStructure(lastPulledFiles) + }); + } if (status) { - $$invalidate(8, changeHierarchy = { - title: "", - children: plugin.gitManager.getTreeStructure(status.changed) - }); - $$invalidate(9, stagedHierarchy = { - title: "", - children: plugin.gitManager.getTreeStructure(status.staged) - }); + if (status.changed.length + status.staged.length > 500) { + $$invalidate(5, status = void 0); + if (!plugin.loading) { + plugin.displayError("Too many changes to display"); + } + } else { + $$invalidate(9, changeHierarchy = { + title: "", + children: plugin.gitManager.getTreeStructure(status.changed) + }); + $$invalidate(10, stagedHierarchy = { + title: "", + children: plugin.gitManager.getTreeStructure(status.staged) + }); + } + } else { + $$invalidate(9, changeHierarchy = void 0); + $$invalidate(10, stagedHierarchy = void 0); } $$invalidate(4, loading = plugin.loading); }); } function stageAll() { $$invalidate(4, loading = true); - plugin.gitManager.stageAll().finally(triggerRefresh); + plugin.gitManager.stageAll({ status }).finally(triggerRefresh); } function unstageAll() { $$invalidate(4, loading = true); - plugin.gitManager.unstageAll().finally(triggerRefresh); + plugin.gitManager.unstageAll({ status }).finally(triggerRefresh); } function push() { $$invalidate(4, loading = true); @@ -14238,31 +15019,31 @@ function instance4($$self, $$props, $$invalidate) { function div0_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { buttons[0] = $$value; - $$invalidate(7, buttons); + $$invalidate(8, buttons); }); } function div1_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { buttons[1] = $$value; - $$invalidate(7, buttons); + $$invalidate(8, buttons); }); } function div2_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { buttons[2] = $$value; - $$invalidate(7, buttons); + $$invalidate(8, buttons); }); } function div3_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { buttons[3] = $$value; - $$invalidate(7, buttons); + $$invalidate(8, buttons); }); } function div4_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { buttons[4] = $$value; - $$invalidate(7, buttons); + $$invalidate(8, buttons); }); } function div5_binding($$value) { @@ -14279,16 +15060,17 @@ function instance4($$self, $$props, $$invalidate) { function div7_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { buttons[6] = $$value; - $$invalidate(7, buttons); + $$invalidate(8, buttons); }); } function textarea_input_handler() { commitMessage = this.value; - $$invalidate(6, commitMessage); + $$invalidate(7, commitMessage); } - const click_handler_1 = () => $$invalidate(6, commitMessage = ""); - const click_handler_2 = () => $$invalidate(11, stagedOpen = !stagedOpen); - const click_handler_3 = () => $$invalidate(10, changesOpen = !changesOpen); + const click_handler_1 = () => $$invalidate(7, commitMessage = ""); + const click_handler_2 = () => $$invalidate(13, stagedOpen = !stagedOpen); + const click_handler_3 = () => $$invalidate(12, changesOpen = !changesOpen); + const click_handler_4 = () => $$invalidate(14, lastPulledFilesOpen = !lastPulledFilesOpen); $$self.$$set = ($$props2) => { if ("plugin" in $$props2) $$invalidate(0, plugin = $$props2.plugin); @@ -14300,7 +15082,7 @@ function instance4($$self, $$props, $$invalidate) { $: { if (layoutBtn) { layoutBtn.empty(); - (0, import_obsidian13.setIcon)(layoutBtn, showTree ? "list" : "folder", 16); + (0, import_obsidian16.setIcon)(layoutBtn, showTree ? "list" : "folder", 16); } } } @@ -14312,12 +15094,15 @@ function instance4($$self, $$props, $$invalidate) { layoutBtn, loading, status, + lastPulledFiles, commitMessage, buttons, changeHierarchy, stagedHierarchy, + lastPulledFilesHierarchy, changesOpen, stagedOpen, + lastPulledFilesOpen, commit, stageAll, unstageAll, @@ -14334,19 +15119,20 @@ function instance4($$self, $$props, $$invalidate) { textarea_input_handler, click_handler_1, click_handler_2, - click_handler_3 + click_handler_3, + click_handler_4 ]; } var GitView = class extends SvelteComponent { constructor(options) { super(); - init(this, options, instance4, create_fragment4, safe_not_equal, { plugin: 0, view: 1 }, add_css4, [-1, -1]); + init(this, options, instance5, create_fragment5, safe_not_equal, { plugin: 0, view: 1 }, add_css5, [-1, -1]); } }; var gitView_default = GitView; // src/ui/sidebar/sidebarView.ts -var GitView2 = class extends import_obsidian14.ItemView { +var GitView2 = class extends import_obsidian17.ItemView { constructor(leaf, plugin) { super(leaf); this.plugin = plugin; @@ -14362,7 +15148,6 @@ var GitView2 = class extends import_obsidian14.ItemView { return GIT_VIEW_CONFIG.icon; } onClose() { - this._view.$destroy(); return super.onClose(); } onOpen() { @@ -14378,7 +15163,7 @@ var GitView2 = class extends import_obsidian14.ItemView { }; // src/main.ts -var ObsidianGit = class extends import_obsidian15.Plugin { +var ObsidianGit = class extends import_obsidian18.Plugin { constructor() { super(...arguments); this.gitReady = false; @@ -14386,7 +15171,7 @@ var ObsidianGit = class extends import_obsidian15.Plugin { this.conflictOutputFile = "conflict-files-obsidian-git.md"; this.offlineMode = false; this.loading = false; - this.debRefresh = (0, import_obsidian15.debounce)(() => { + this.debRefresh = (0, import_obsidian18.debounce)(() => { if (this.settings.refreshSourceControl) { this.refresh(); } @@ -14418,6 +15203,7 @@ var ObsidianGit = class extends import_obsidian15.Plugin { onload() { return __async(this, null, function* () { console.log("loading " + this.manifest.name + " plugin"); + this.localStorage = new LocalStorageSettings(this); yield this.loadSettings(); this.migrateSettings(); addEventListener("git-refresh", this.refresh.bind(this)); @@ -14432,6 +15218,19 @@ var ObsidianGit = class extends import_obsidian15.Plugin { defaultMod: true }); this.addSettingTab(new ObsidianGitSettingsTab(this.app, this)); + this.addCommand({ + id: "edit-gitignore", + name: "Edit .gitignore", + callback: () => __async(this, null, function* () { + const content = yield this.app.vault.adapter.read(this.gitManager.getVaultPath(".gitignore")); + const modal = new IgnoreModal(this.app, content); + const res = yield modal.open(); + if (res !== void 0) { + yield this.app.vault.adapter.write(this.gitManager.getVaultPath(".gitignore"), res); + this.refresh(); + } + }) + }); this.addCommand({ id: "open-git-view", name: "Open source control view", @@ -14467,11 +15266,33 @@ var ObsidianGit = class extends import_obsidian15.Plugin { name: "Pull", callback: () => this.promiseQueue.addTask(() => this.pullChangesFromRemote()) }); + this.addCommand({ + id: "add-to-gitignore", + name: "Add file to gitignore", + checkCallback: (checking) => { + const file = app.workspace.getActiveFile(); + if (checking) { + return file !== void 0; + } else { + app.vault.adapter.append(this.gitManager.getVaultPath(".gitignore"), "\n" + this.gitManager.getPath(file.path, true)).then(() => { + this.refresh(); + }); + } + } + }); this.addCommand({ id: "push", name: "Create backup", callback: () => this.promiseQueue.addTask(() => this.createBackup(false)) }); + this.addCommand({ + id: "backup-and-close", + name: "Create backup and close", + callback: () => this.promiseQueue.addTask(() => __async(this, null, function* () { + yield this.createBackup(false); + window.close(); + })) + }); this.addCommand({ id: "commit-push-specified-message", name: "Create backup with specific message", @@ -14487,6 +15308,16 @@ var ObsidianGit = class extends import_obsidian15.Plugin { name: "Commit all changes with specific message", callback: () => this.promiseQueue.addTask(() => this.commit(false, true)) }); + this.addCommand({ + id: "commit-staged", + name: "Commit staged", + callback: () => this.promiseQueue.addTask(() => this.commit(false, false, true)) + }); + this.addCommand({ + id: "commit-staged-specified-message", + name: "Commit staged with specific message", + callback: () => this.promiseQueue.addTask(() => this.commit(false, true, true)) + }); this.addCommand({ id: "push2", name: "Push", @@ -14528,6 +15359,25 @@ var ObsidianGit = class extends import_obsidian15.Plugin { return this.removeRemote(); }) }); + this.addCommand({ + id: "delete-repo", + name: "CAUTION: Delete repository", + callback: () => __async(this, null, function* () { + const repoExists = yield this.app.vault.adapter.exists(`${this.settings.basePath}/.git`); + if (repoExists) { + const modal = new GeneralModal(this.app, ["NO", "YES"], "Do you really want to delete the repository (.git directory)? This action cannot be undone.", false, true); + const shouldDelete = (yield modal.open()) === "YES"; + if (shouldDelete) { + yield this.app.vault.adapter.rmdir(`${this.settings.basePath}/.git`, true); + new import_obsidian18.Notice("Successfully deleted repository. Reloading plugin..."); + this.unloadPlugin(); + this.init(); + } + } else { + new import_obsidian18.Notice("No repository found"); + } + }) + }); this.addCommand({ id: "init-repo", name: "Initialize a new repo", @@ -14546,11 +15396,20 @@ var ObsidianGit = class extends import_obsidian15.Plugin { id: "list-changed-files", name: "List changed files", callback: () => __async(this, null, function* () { + if (!(yield this.isAllInitialized())) + return; const status = yield this.gitManager.status(); this.setState(PluginState.idle); + if (status.changed.length + status.staged.length > 500) { + this.displayError("Too many changes to display"); + return; + } new ChangedFilesModal(this, status.changed).open(); }) }); + this.registerEvent(this.app.workspace.on("file-menu", (menu, file, source) => { + this.handleFileMenu(menu, file, source); + })); if (this.settings.showStatusBar) { let statusBarEl = this.addStatusBarItem(); this.statusBar = new StatusBar(statusBarEl, this); @@ -14559,6 +15418,40 @@ var ObsidianGit = class extends import_obsidian15.Plugin { this.app.workspace.onLayoutReady(() => this.init()); }); } + handleFileMenu(menu, file, source) { + if (source !== "file-explorer-context-menu") { + return; + } + if (!file) { + return; + } + if (!this.gitReady) + return; + menu.addItem((item) => { + item.setTitle(`Git: Stage`).setIcon("plus-circle").setSection("action").onClick((_) => { + this.promiseQueue.addTask(() => __async(this, null, function* () { + if (file instanceof import_obsidian18.TFile) { + yield this.gitManager.stage(file.path, true); + } else { + yield this.gitManager.stageAll({ dir: this.gitManager.getPath(file.path, true) }); + } + this.displayMessage(`Staged ${file.path}`); + })); + }); + }); + menu.addItem((item) => { + item.setTitle(`Git: Unstage`).setIcon("minus-circle").setSection("action").onClick((_) => { + this.promiseQueue.addTask(() => __async(this, null, function* () { + if (file instanceof import_obsidian18.TFile) { + yield this.gitManager.unstage(file.path, true); + } else { + yield this.gitManager.unstageAll({ dir: this.gitManager.getPath(file.path, true) }); + } + this.displayMessage(`Unstaged ${file.path}`); + })); + }); + }); + } migrateSettings() { if (this.settings.mergeOnPull != void 0) { this.settings.syncMethod = this.settings.mergeOnPull ? "merge" : "rebase"; @@ -14569,19 +15462,31 @@ var ObsidianGit = class extends import_obsidian15.Plugin { this.settings.autoCommitMessage = this.settings.commitMessage; this.saveSettings(); } + if (this.settings.gitPath != void 0) { + this.localStorage.setGitPath(this.settings.gitPath); + this.settings.gitPath = void 0; + this.saveSettings(); + } + } + unloadPlugin() { + this.gitReady = false; + dispatchEvent(new CustomEvent("git-refresh")); + this.clearAutoPull(); + this.clearAutoPush(); + this.clearAutoBackup(); + removeEventListener("git-refresh", this.refresh.bind(this)); + this.app.metadataCache.offref(this.modifyEvent); + this.app.metadataCache.offref(this.deleteEvent); + this.app.metadataCache.offref(this.createEvent); + this.app.metadataCache.offref(this.renameEvent); + this.debRefresh.cancel(); } onunload() { return __async(this, null, function* () { this.app.workspace.unregisterHoverLinkSource(GIT_VIEW_CONFIG.type); this.app.workspace.detachLeavesOfType(GIT_VIEW_CONFIG.type); this.app.workspace.detachLeavesOfType(DIFF_VIEW_CONFIG.type); - this.clearAutoPull(); - this.clearAutoBackup(); - removeEventListener("git-refresh", this.refresh.bind(this)); - this.app.metadataCache.offref(this.modifyEvent); - this.app.metadataCache.offref(this.deleteEvent); - this.app.metadataCache.offref(this.createEvent); - this.app.metadataCache.offref(this.renameEvent); + this.unloadPlugin(); console.log("unloading " + this.manifest.name + " plugin"); }); } @@ -14598,11 +15503,11 @@ var ObsidianGit = class extends import_obsidian15.Plugin { saveLastAuto(date, mode) { return __async(this, null, function* () { if (mode === "backup") { - window.localStorage.setItem(this.manifest.id + ":lastAutoBackup", date.toString()); + this.localStorage.setLastAutoBackup(date.toString()); } else if (mode === "pull") { - window.localStorage.setItem(this.manifest.id + ":lastAutoPull", date.toString()); + this.localStorage.setLastAutoPull(date.toString()); } else if (mode === "push") { - window.localStorage.setItem(this.manifest.id + ":lastAutoPush", date.toString()); + this.localStorage.setLastAutoPush(date.toString()); } }); } @@ -14610,18 +15515,20 @@ var ObsidianGit = class extends import_obsidian15.Plugin { return __async(this, null, function* () { var _a2, _b, _c; return { - "backup": new Date((_a2 = window.localStorage.getItem(this.manifest.id + ":lastAutoBackup")) != null ? _a2 : ""), - "pull": new Date((_b = window.localStorage.getItem(this.manifest.id + ":lastAutoPull")) != null ? _b : ""), - "push": new Date((_c = window.localStorage.getItem(this.manifest.id + ":lastAutoPush")) != null ? _c : "") + "backup": new Date((_a2 = this.localStorage.getLastAutoBackup()) != null ? _a2 : ""), + "pull": new Date((_b = this.localStorage.getLastAutoPull()) != null ? _b : ""), + "push": new Date((_c = this.localStorage.getLastAutoPush()) != null ? _c : "") }; }); } init() { return __async(this, null, function* () { try { - this.gitManager = new SimpleGit(this); - if (this.gitManager instanceof SimpleGit) { + if (true) { + this.gitManager = new SimpleGit(this); yield this.gitManager.setGitInstance(); + } else { + this.gitManager = new IsomorphicGit(this); } const result = yield this.gitManager.checkRequirements(); switch (result) { @@ -14629,7 +15536,7 @@ var ObsidianGit = class extends import_obsidian15.Plugin { this.displayError("Cannot run git command"); break; case "missing-repo": - new import_obsidian15.Notice("Can't find a valid git repository. Please create one via the given command."); + new import_obsidian18.Notice("Can't find a valid git repository. Please create one via the given command or clone an existing repo."); break; case "valid": this.gitReady = true; @@ -14683,7 +15590,8 @@ var ObsidianGit = class extends import_obsidian15.Plugin { createNewRepo() { return __async(this, null, function* () { yield this.gitManager.init(); - new import_obsidian15.Notice("Initialized new repo"); + new import_obsidian18.Notice("Initialized new repo"); + yield this.init(); }); } cloneNewRepo() { @@ -14691,12 +15599,42 @@ var ObsidianGit = class extends import_obsidian15.Plugin { const modal = new GeneralModal(this.app, [], "Enter remote URL"); const url = yield modal.open(); if (url) { - let dir = yield new GeneralModal(this.app, [], "Enter directory for clone. It needs to be empty or not existent.").open(); - if (dir) { - dir = path2.normalize(dir); - new import_obsidian15.Notice(`Cloning new repo into "${dir}"`); + const confirmOption = "Vault Root"; + let dir = yield new GeneralModal(this.app, [confirmOption], "Enter directory for clone. It needs to be empty or not existent.", this.gitManager instanceof IsomorphicGit).open(); + if (dir !== void 0) { + if (dir === confirmOption) { + dir = "."; + } + dir = (0, import_obsidian18.normalizePath)(dir); + if (dir === "/") { + dir = "."; + } + if (dir === ".") { + const modal2 = new GeneralModal(this.app, ["NO", "YES"], `Does your remote repo contain a ${app.vault.configDir} directory at the root?`, false, true); + const containsConflictDir = yield modal2.open(); + if (containsConflictDir === void 0) { + new import_obsidian18.Notice("Aborted clone"); + return; + } else if (containsConflictDir === "YES") { + const confirmOption2 = "DELETE ALL YOUR LOCAL CONFIG AND PLUGINS"; + const modal3 = new GeneralModal(this.app, ["Abort clone", confirmOption2], `To avoid conflicts, the local ${app.vault.configDir} directory needs to be deleted.`, false, true); + const shouldDelete = (yield modal3.open()) === confirmOption2; + if (shouldDelete) { + yield this.app.vault.adapter.rmdir(app.vault.configDir, true); + } else { + new import_obsidian18.Notice("Aborted clone"); + return; + } + } + } + new import_obsidian18.Notice(`Cloning new repo into "${dir}"`); yield this.gitManager.clone(url, dir); - new import_obsidian15.Notice("Cloned new repo"); + new import_obsidian18.Notice("Cloned new repo."); + new import_obsidian18.Notice("Please restart Obsidian"); + if (dir && dir !== ".") { + this.settings.basePath = dir; + this.saveSettings(); + } } } }); @@ -14748,34 +15686,50 @@ var ObsidianGit = class extends import_obsidian15.Plugin { this.setState(PluginState.idle); }); } - commit(fromAutoBackup, requestCustomMessage = false) { + commit(fromAutoBackup, requestCustomMessage = false, onlyStaged = false) { return __async(this, null, function* () { if (!(yield this.isAllInitialized())) return false; - const file = this.app.vault.getAbstractFileByPath(this.conflictOutputFile); - if (file) - yield this.app.vault.delete(file); + const hadConflict = this.localStorage.getConflict() === "true"; + let changedFiles; let status; + let unstagedFiles; if (this.gitManager instanceof SimpleGit) { - status = yield this.gitManager.status(); + const file = this.app.vault.getAbstractFileByPath(this.conflictOutputFile); + yield this.app.vault.delete(file); + status = yield this.updateCachedStatus(); if (fromAutoBackup && status.conflicted.length > 0) { this.displayError(`Did not commit, because you have ${status.conflicted.length} conflict ${status.conflicted.length > 1 ? "files" : "file"}. Please resolve them and commit per command.`); this.handleConflict(status.conflicted); return; } + changedFiles = [...status.changed, ...status.staged]; + } else if (fromAutoBackup && hadConflict) { + this.setState(PluginState.conflicted); + this.displayError(`Did not commit, because you have conflict files. Please resolve them and commit per command.`); + return; + } else if (hadConflict) { + const file = this.app.vault.getAbstractFileByPath(this.conflictOutputFile); + yield this.app.vault.delete(file); + status = yield this.updateCachedStatus(); + changedFiles = [...status.changed, ...status.staged]; } else { - status = yield this.gitManager.status(); + if (onlyStaged) { + changedFiles = yield this.gitManager.getStagedFiles(); + } else { + unstagedFiles = yield this.gitManager.getUnstagedFiles(); + changedFiles = unstagedFiles.map(({ filepath }) => ({ vault_path: this.gitManager.getVaultPath(filepath) })); + } } - if (yield this.hasTooBigFiles([...status.staged, ...status.changed])) { + if (yield this.hasTooBigFiles(changedFiles)) { this.setState(PluginState.idle); return false; } - const changedFiles = status.changed.length + status.staged.length; - if (changedFiles !== 0) { + if (changedFiles.length !== 0 || hadConflict) { let commitMessage = fromAutoBackup ? this.settings.autoCommitMessage : this.settings.commitMessage; if (fromAutoBackup && this.settings.customMessageOnAutoBackup || requestCustomMessage) { if (!this.settings.disablePopups && fromAutoBackup) { - new import_obsidian15.Notice("Auto backup: Please enter a custom commit message. Leave empty to abort"); + new import_obsidian18.Notice("Auto backup: Please enter a custom commit message. Leave empty to abort"); } const tempMessage = yield new CustomMessageModal(this, true).open(); if (tempMessage != void 0 && tempMessage != "" && tempMessage != "...") { @@ -14785,8 +15739,18 @@ var ObsidianGit = class extends import_obsidian15.Plugin { return false; } } - const committedFiles = yield this.gitManager.commitAll(commitMessage); - this.displayMessage(`Committed ${committedFiles} ${committedFiles > 1 ? "files" : "file"}`); + let committedFiles; + if (onlyStaged) { + committedFiles = yield this.gitManager.commit(commitMessage); + } else { + committedFiles = yield this.gitManager.commitAll({ message: commitMessage, status, unstagedFiles }); + } + let roughly = false; + if (committedFiles === void 0) { + roughly = true; + committedFiles = changedFiles.length; + } + this.displayMessage(`Committed${roughly ? " approx." : ""} ${committedFiles} ${committedFiles > 1 ? "files" : "file"}`); } else { this.displayMessage("No changes to commit"); } @@ -14805,7 +15769,7 @@ var ObsidianGit = class extends import_obsidian15.Plugin { if (remoteUrl.includes("github.com")) { const tooBigFiles = files.filter((f) => { const file = this.app.vault.getAbstractFileByPath(f.vault_path); - if (file instanceof import_obsidian15.TFile) { + if (file instanceof import_obsidian18.TFile) { return file.stat.size >= 1e8; } return false; @@ -14823,19 +15787,27 @@ var ObsidianGit = class extends import_obsidian15.Plugin { return __async(this, null, function* () { if (!(yield this.isAllInitialized())) return false; - if (!this.remotesAreSet()) { + if (!(yield this.remotesAreSet())) { return false; } const file = this.app.vault.getAbstractFileByPath(this.conflictOutputFile); - if (file) + const hadConflict = this.localStorage.getConflict() === "true"; + if (this.gitManager instanceof SimpleGit && file) yield this.app.vault.delete(file); let status; - if (this.gitManager instanceof SimpleGit && (status = yield this.gitManager.status()).conflicted.length > 0) { + if (this.gitManager instanceof SimpleGit && (status = yield this.updateCachedStatus()).conflicted.length > 0) { this.displayError(`Cannot push. You have ${status.conflicted.length} conflict ${status.conflicted.length > 1 ? "files" : "file"}`); this.handleConflict(status.conflicted); return false; - } else { + } else if (this.gitManager instanceof IsomorphicGit && hadConflict) { + this.displayError(`Cannot push. You have conflict files`); + this.setState(PluginState.conflicted); + return false; + } + { + console.log("Pushing...."); const pushedFiles = yield this.gitManager.push(); + console.log("Pushed!", pushedFiles); this.lastUpdate = Date.now(); if (pushedFiles > 0) { this.displayMessage(`Pushed ${pushedFiles} ${pushedFiles > 1 ? "files" : "file"} to remote`); @@ -14850,12 +15822,16 @@ var ObsidianGit = class extends import_obsidian15.Plugin { } pull() { return __async(this, null, function* () { - const pulledFilesLength = yield this.gitManager.pull(); - this.offlineMode = false; - if (pulledFilesLength > 0) { - this.displayMessage(`Pulled ${pulledFilesLength} ${pulledFilesLength > 1 ? "files" : "file"} from remote`); + if (!(yield this.remotesAreSet())) { + return false; } - return pulledFilesLength != 0; + const pulledFiles = yield this.gitManager.pull(); + this.offlineMode = false; + if (pulledFiles.length > 0) { + this.displayMessage(`Pulled ${pulledFiles.length} ${pulledFiles.length > 1 ? "files" : "file"} from remote`); + this.lastPulledFiles = pulledFiles; + } + return pulledFiles.length != 0; }); } stageCurrentFile() { @@ -14885,10 +15861,10 @@ var ObsidianGit = class extends import_obsidian15.Plugin { remotesAreSet() { return __async(this, null, function* () { if (!(yield this.gitManager.branchInfo()).tracking) { - new import_obsidian15.Notice("No upstream branch is set. Please select one."); + new import_obsidian18.Notice("No upstream branch is set. Please select one."); const remoteBranch = yield this.selectRemoteBranch(); if (remoteBranch == void 0) { - this.displayError("Did not push. No upstream-branch is set!", 1e4); + this.displayError("Aborted. No upstream-branch is set!", 1e4); this.setState(PluginState.idle); return false; } else { @@ -14906,7 +15882,7 @@ var ObsidianGit = class extends import_obsidian15.Plugin { this.doAutoBackup(); } else { this.onFileModifyEventRef = this.app.vault.on("modify", () => this.autoBackupDebouncer()); - this.autoBackupDebouncer = (0, import_obsidian15.debounce)(() => this.doAutoBackup(), time, true); + this.autoBackupDebouncer = (0, import_obsidian18.debounce)(() => this.doAutoBackup(), time, true); } } else { this.timeoutIDBackup = window.setTimeout(() => this.doAutoBackup(), time); @@ -14975,20 +15951,24 @@ var ObsidianGit = class extends import_obsidian15.Plugin { handleConflict(conflicted) { return __async(this, null, function* () { this.setState(PluginState.conflicted); - const lines = [ - "# Conflict files", - "Please resolve them and commit per command (This file will be deleted before the commit).", - ...conflicted.map((e) => { - const file = this.app.vault.getAbstractFileByPath(e); - if (file instanceof import_obsidian15.TFile) { - const link = this.app.metadataCache.fileToLinktext(file, "/"); - return `- [[${link}]]`; - } else { - return `- Not a file: ${e}`; - } - }) - ]; - this.writeAndOpenFile(lines.join("\n")); + this.localStorage.setConflict("true"); + let lines; + if (conflicted !== void 0) { + lines = [ + "# Conflict files", + "Please resolve them and commit per command (This file will be deleted before the commit).", + ...conflicted.map((e) => { + const file = this.app.vault.getAbstractFileByPath(e); + if (file instanceof import_obsidian18.TFile) { + const link = this.app.metadataCache.fileToLinktext(file, "/"); + return `- [[${link}]]`; + } else { + return `- Not a file: ${e}`; + } + }) + ]; + } + this.writeAndOpenFile(lines == null ? void 0 : lines.join("\n")); }); } editRemotes() { @@ -15001,8 +15981,10 @@ var ObsidianGit = class extends import_obsidian15.Plugin { if (remoteName) { const urlModal = new GeneralModal(this.app, [], "Enter the remote URL"); const remoteURL = yield urlModal.open(); - yield this.gitManager.setRemote(remoteName, remoteURL); - return remoteName; + if (remoteURL) { + yield this.gitManager.setRemote(remoteName, remoteURL); + return remoteName; + } } }); } @@ -15041,7 +16023,9 @@ var ObsidianGit = class extends import_obsidian15.Plugin { } writeAndOpenFile(text2) { return __async(this, null, function* () { - yield this.app.vault.adapter.write(this.conflictOutputFile, text2); + if (text2 !== void 0) { + yield this.app.vault.adapter.write(this.conflictOutputFile, text2); + } let fileIsAlreadyOpened = false; this.app.workspace.iterateAllLeaves((leaf) => { if (leaf.getDisplayText() != "" && this.conflictOutputFile.startsWith(leaf.getDisplayText())) { @@ -15057,14 +16041,14 @@ var ObsidianGit = class extends import_obsidian15.Plugin { var _a2; (_a2 = this.statusBar) == null ? void 0 : _a2.displayMessage(message.toLowerCase(), timeout); if (!this.settings.disablePopups) { - new import_obsidian15.Notice(message, 5 * 1e3); + new import_obsidian18.Notice(message, 5 * 1e3); } console.log(`git obsidian message: ${message}`); } displayError(message, timeout = 10 * 1e3) { var _a2; message = message.toString(); - new import_obsidian15.Notice(message, timeout); + new import_obsidian18.Notice(message, timeout); console.log(`git obsidian error: ${message}`); (_a2 = this.statusBar) == null ? void 0 : _a2.displayMessage(message.toLowerCase(), timeout); } diff --git a/.obsidian/plugins/obsidian-git/manifest.json b/.obsidian/plugins/obsidian-git/manifest.json index 48bf9e9..accbcaa 100644 --- a/.obsidian/plugins/obsidian-git/manifest.json +++ b/.obsidian/plugins/obsidian-git/manifest.json @@ -4,5 +4,5 @@ "description": "Backup your vault with git.", "isDesktopOnly": true, "js": "main.js", - "version": "1.28.0" + "version": "1.31.0" } diff --git a/.obsidian/plugins/obsidian-git/styles.css b/.obsidian/plugins/obsidian-git/styles.css index 68a06f0..e283d44 100644 --- a/.obsidian/plugins/obsidian-git/styles.css +++ b/.obsidian/plugins/obsidian-git/styles.css @@ -2,11 +2,13 @@ 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } } -.loading > svg { + +.loading>svg { animation: 2s linear infinite loading; transform-origin: 50% 50%; display: inline-block; @@ -17,6 +19,17 @@ width: 50%; } +.obsidian-git-textarea { + display: block; + margin-left: auto; + margin-right: auto; +} + +.obsidian-git-center-button { + display: block; + margin: 20px auto; +} + .tooltip.mod-left { overflow-wrap: break-word; } @@ -44,9 +57,11 @@ .workspace-leaf-content[data-type="diff-view"] .d2h-d-none { display: none; } + .workspace-leaf-content[data-type="diff-view"] .d2h-wrapper { text-align: left; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-header { background-color: var(--background-primary); border-bottom: 1px solid var(--interactive-accent); @@ -54,16 +69,19 @@ height: 35px; padding: 5px 10px; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-header, .workspace-leaf-content[data-type="diff-view"] .d2h-file-stats { display: -webkit-box; display: -ms-flexbox; display: flex; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-stats { font-size: 14px; margin-left: auto; } + .workspace-leaf-content[data-type="diff-view"] .d2h-lines-added { border: 1px solid #b4e2b4; border-radius: 5px 0 0 5px; @@ -72,6 +90,7 @@ text-align: right; vertical-align: middle; } + .workspace-leaf-content[data-type="diff-view"] .d2h-lines-deleted { border: 1px solid #e9aeae; border-radius: 0 5px 5px 0; @@ -81,6 +100,7 @@ text-align: left; vertical-align: middle; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-name-wrapper { -webkit-box-align: center; -ms-flex-align: center; @@ -91,16 +111,19 @@ font-size: 15px; width: 100%; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-name { overflow-x: hidden; text-overflow: ellipsis; white-space: nowrap; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-wrapper { border: 1px solid var(--background-modifier-border); border-radius: 3px; margin-bottom: 1em; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-collapse { -webkit-box-pack: end; -ms-flex-pack: end; @@ -115,24 +138,30 @@ justify-content: flex-end; padding: 4px 8px; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-collapse.d2h-selected { background-color: #c8e1ff; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-collapse-input { margin: 0 4px 0 0; } + .workspace-leaf-content[data-type="diff-view"] .d2h-diff-table { border-collapse: collapse; font-family: Menlo, Consolas, monospace; font-size: 13px; width: 100%; } + .workspace-leaf-content[data-type="diff-view"] .d2h-files-diff { width: 100%; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff { overflow-y: hidden; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-side-diff { display: inline-block; margin-bottom: -8px; @@ -141,9 +170,11 @@ overflow-y: hidden; width: 50%; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-line { padding: 0 8em; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-line, .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line { display: inline-block; @@ -154,9 +185,11 @@ white-space: nowrap; width: 100%; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line { padding: 0 4.5em; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-line-ctn { word-wrap: normal; background: none; @@ -170,20 +203,17 @@ white-space: pre; width: 100%; } + .theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del, -.theme-light - .workspace-leaf-content[data-type="diff-view"] - .d2h-code-side-line - del { +.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line del { background-color: #ffb6ba; } + .theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del, -.theme-dark - .workspace-leaf-content[data-type="diff-view"] - .d2h-code-side-line - del { +.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line del { background-color: #8d232881; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del, .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins, .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line del, @@ -194,22 +224,19 @@ text-decoration: none; vertical-align: middle; } + .theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins, -.theme-light - .workspace-leaf-content[data-type="diff-view"] - .d2h-code-side-line - ins { +.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line ins { background-color: #97f295; text-align: left; } + .theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins, -.theme-dark - .workspace-leaf-content[data-type="diff-view"] - .d2h-code-side-line - ins { +.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line ins { background-color: #1d921996; text-align: left; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-line-prefix { word-wrap: normal; background: none; @@ -217,9 +244,11 @@ padding: 0; white-space: pre; } + .workspace-leaf-content[data-type="diff-view"] .line-num1 { float: left; } + .workspace-leaf-content[data-type="diff-view"] .line-num1, .workspace-leaf-content[data-type="diff-view"] .line-num2 { -webkit-box-sizing: border-box; @@ -229,9 +258,11 @@ text-overflow: ellipsis; width: 3.5em; } + .workspace-leaf-content[data-type="diff-view"] .line-num2 { float: right; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber { background-color: var(--background-primary); border: solid var(--background-modifier-border); @@ -245,9 +276,11 @@ text-align: right; width: 7.5em; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber:after { content: "\200b"; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber { background-color: var(--background-primary); border: solid var(--background-modifier-border); @@ -264,14 +297,17 @@ text-overflow: ellipsis; width: 4em; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber:after { content: "\200b"; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-emptyplaceholder, .workspace-leaf-content[data-type="diff-view"] .d2h-emptyplaceholder { background-color: var(--background-primary); border-color: var(--background-modifier-border); } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-line-prefix, .workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber, .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber, @@ -281,115 +317,127 @@ -ms-user-select: none; user-select: none; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber, .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber { direction: rtl; } + .theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-del { background-color: #fee8e9; border-color: #e9aeae; } + .theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-ins { background-color: #dfd; border-color: #b4e2b4; } + .theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-del { background-color: #521b1d83; border-color: #691d1d73; } + .theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-ins { background-color: rgba(30, 71, 30, 0.5); border-color: #13501381; } + .workspace-leaf-content[data-type="diff-view"] .d2h-info { background-color: var(--background-primary); border-color: var(--background-modifier-border); color: var(--text-normal); } -.theme-light - .workspace-leaf-content[data-type="diff-view"] - .d2h-file-diff - .d2h-del.d2h-change { + +.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-del.d2h-change { background-color: #fdf2d0; } -.theme-dark - .workspace-leaf-content[data-type="diff-view"] - .d2h-file-diff - .d2h-del.d2h-change { + +.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-del.d2h-change { background-color: #55492480; } -.theme-light - .workspace-leaf-content[data-type="diff-view"] - .d2h-file-diff - .d2h-ins.d2h-change { + +.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-ins.d2h-change { background-color: #ded; } -.theme-dark - .workspace-leaf-content[data-type="diff-view"] - .d2h-file-diff - .d2h-ins.d2h-change { + +.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-ins.d2h-change { background-color: rgba(37, 78, 37, 0.418); } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-list-wrapper { margin-bottom: 10px; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-list-wrapper a { color: #3572b0; text-decoration: none; } -.workspace-leaf-content[data-type="diff-view"] - .d2h-file-list-wrapper - a:visited { + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-wrapper a:visited { color: #3572b0; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-list-header { text-align: left; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-list-title { font-weight: 700; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-list-line { display: -webkit-box; display: -ms-flexbox; display: flex; text-align: left; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-list { display: block; list-style: none; margin: 0; padding: 0; } -.workspace-leaf-content[data-type="diff-view"] .d2h-file-list > li { + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-list>li { border-bottom: 1px solid var(--background-modifier-border); margin: 0; padding: 5px 10px; } -.workspace-leaf-content[data-type="diff-view"] .d2h-file-list > li:last-child { + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-list>li:last-child { border-bottom: none; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-switch { cursor: pointer; display: none; font-size: 10px; } + .workspace-leaf-content[data-type="diff-view"] .d2h-icon { fill: currentColor; margin-right: 10px; vertical-align: middle; } + .workspace-leaf-content[data-type="diff-view"] .d2h-deleted { color: #c33; } + .workspace-leaf-content[data-type="diff-view"] .d2h-added { color: #399839; } + .workspace-leaf-content[data-type="diff-view"] .d2h-changed { color: #d0b44c; } + .workspace-leaf-content[data-type="diff-view"] .d2h-moved { color: #3572b0; } + .workspace-leaf-content[data-type="diff-view"] .d2h-tag { background-color: var(--background-primary); display: -webkit-box; @@ -399,15 +447,19 @@ margin-left: 5px; padding: 0 2px; } + .workspace-leaf-content[data-type="diff-view"] .d2h-deleted-tag { border: 2px solid #c33; } + .workspace-leaf-content[data-type="diff-view"] .d2h-added-tag { border: 1px solid #399839; } + .workspace-leaf-content[data-type="diff-view"] .d2h-changed-tag { border: 1px solid #d0b44c; } + .workspace-leaf-content[data-type="diff-view"] .d2h-moved-tag { border: 1px solid #3572b0; -} +} \ No newline at end of file diff --git a/_templates/OJ Problem Notes.md b/_templates/OJ Problem Notes.md index 0e0ee79..ba150df 100644 --- a/_templates/OJ Problem Notes.md +++ b/_templates/OJ Problem Notes.md @@ -13,13 +13,6 @@ > ##### Revisions: > N/A -##### Related topics: -```expander -tag:# -``` - - - ##### Links: - [Link to problem]() ___