1
0

项目:更新插件

This commit is contained in:
周中平 2024-01-10 16:42:54 +08:00
parent e31131008e
commit 54d6b12242
Signed by: zhouzhongping
GPG Key ID: 6666822800008000
8 changed files with 355 additions and 218 deletions

View File

@ -29417,6 +29417,11 @@ function getDisplayPath(path2) {
return path2; return path2;
return path2.split("/").last().replace(".md", ""); return path2.split("/").last().replace(".md", "");
} }
function formatMinutes(minutes) {
if (minutes === 1)
return "1 minute";
return `${minutes} minutes`;
}
// src/gitManager/gitManager.ts // src/gitManager/gitManager.ts
init_polyfill_buffer(); init_polyfill_buffer();
@ -29942,10 +29947,15 @@ var SimpleGit = class extends GitManager {
}; };
} }
async getRemoteUrl(remote) { async getRemoteUrl(remote) {
return await this.git.remote( try {
["get-url", remote], await this.git.remote(["get-url", remote]);
(err, url) => this.onError(err) } catch (error) {
) || void 0; if (error.toString().contains(remote)) {
return void 0;
} else {
this.onError(error);
}
}
} }
// https://github.com/kometenstaub/obsidian-version-history-diff/issues/3 // https://github.com/kometenstaub/obsidian-version-history-diff/issues/3
async log(file, relativeToVault = true, limit) { async log(file, relativeToVault = true, limit) {
@ -31280,7 +31290,7 @@ var IsomorphicGit = class extends GitManager {
await this.checkAuthorInfo(); await this.checkAuthorInfo();
this.plugin.setState(4 /* commit */); this.plugin.setState(4 /* commit */);
const formatMessage = await this.formatCommitMessage(message); const formatMessage = await this.formatCommitMessage(message);
const hadConflict = this.plugin.localStorage.getConflict() === "true"; const hadConflict = this.plugin.localStorage.getConflict();
let parent = void 0; let parent = void 0;
if (hadConflict) { if (hadConflict) {
const branchInfo = await this.branchInfo(); const branchInfo = await this.branchInfo();
@ -31293,7 +31303,7 @@ var IsomorphicGit = class extends GitManager {
parent parent
}) })
); );
this.plugin.localStorage.setConflict("false"); this.plugin.localStorage.setConflict(false);
return; return;
} catch (error) { } catch (error) {
this.plugin.displayError(error); this.plugin.displayError(error);
@ -32167,7 +32177,9 @@ var ObsidianGitSettingsTab = class extends import_obsidian8.PluginSettingTab {
plugin.settings.autoSaveInterval plugin.settings.autoSaveInterval
); );
new import_obsidian8.Notice( new import_obsidian8.Notice(
`Automatic ${commitOrBackup} enabled! Every ${plugin.settings.autoSaveInterval} minutes.` `Automatic ${commitOrBackup} enabled! Every ${formatMinutes(
plugin.settings.autoSaveInterval
)}.`
); );
} else if (plugin.settings.autoSaveInterval <= 0) { } else if (plugin.settings.autoSaveInterval <= 0) {
plugin.clearAutoBackup() && new import_obsidian8.Notice( plugin.clearAutoBackup() && new import_obsidian8.Notice(
@ -32180,8 +32192,12 @@ var ObsidianGitSettingsTab = class extends import_obsidian8.PluginSettingTab {
}) })
); );
if (!plugin.settings.setLastSaveToLastCommit) if (!plugin.settings.setLastSaveToLastCommit)
new import_obsidian8.Setting(containerEl).setName(`Auto Backup after stop editing any file`).setDesc( new import_obsidian8.Setting(containerEl).setName(`Auto Backup after stopping file edits`).setDesc(
`Requires the ${commitOrBackup} interval not to be 0. If turned on, do auto ${commitOrBackup} every ${plugin.settings.autoSaveInterval} minutes after stop editing any file. This also prevents auto ${commitOrBackup} while editing a file. If turned off, it's independent from the last change.` `Requires the ${commitOrBackup} interval not to be 0.
If turned on, do auto ${commitOrBackup} every ${formatMinutes(
plugin.settings.autoSaveInterval
)} after stopping file edits.
This also prevents auto ${commitOrBackup} while editing a file. If turned off, it's independent from the last change.`
).addToggle( ).addToggle(
(toggle) => toggle.setValue(plugin.settings.autoBackupAfterFileChange).onChange((value) => { (toggle) => toggle.setValue(plugin.settings.autoBackupAfterFileChange).onChange((value) => {
plugin.settings.autoBackupAfterFileChange = value; plugin.settings.autoBackupAfterFileChange = value;
@ -32221,7 +32237,9 @@ var ObsidianGitSettingsTab = class extends import_obsidian8.PluginSettingTab {
plugin.settings.autoPushInterval plugin.settings.autoPushInterval
); );
new import_obsidian8.Notice( new import_obsidian8.Notice(
`Automatic push enabled! Every ${plugin.settings.autoPushInterval} minutes.` `Automatic push enabled! Every ${formatMinutes(
plugin.settings.autoPushInterval
)}.`
); );
} else if (plugin.settings.autoPushInterval <= 0) { } else if (plugin.settings.autoPushInterval <= 0) {
plugin.clearAutoPush() && new import_obsidian8.Notice( plugin.clearAutoPush() && new import_obsidian8.Notice(
@ -32249,7 +32267,9 @@ var ObsidianGitSettingsTab = class extends import_obsidian8.PluginSettingTab {
plugin.settings.autoPullInterval plugin.settings.autoPullInterval
); );
new import_obsidian8.Notice( new import_obsidian8.Notice(
`Automatic pull enabled! Every ${plugin.settings.autoPullInterval} minutes.` `Automatic pull enabled! Every ${formatMinutes(
plugin.settings.autoPullInterval
)}.`
); );
} else if (plugin.settings.autoPullInterval <= 0) { } else if (plugin.settings.autoPullInterval <= 0) {
plugin.clearAutoPull() && new import_obsidian8.Notice("Automatic pull disabled!"); plugin.clearAutoPull() && new import_obsidian8.Notice("Automatic pull disabled!");
@ -32413,7 +32433,7 @@ var ObsidianGitSettingsTab = class extends import_obsidian8.PluginSettingTab {
plugin.saveSettings(); plugin.saveSettings();
}) })
); );
new import_obsidian8.Setting(containerEl).setName("Show changes files count in status bar").addToggle( new import_obsidian8.Setting(containerEl).setName("Show the count of modified files in the status bar").addToggle(
(toggle) => toggle.setValue(plugin.settings.changedFilesInStatusBar).onChange((value) => { (toggle) => toggle.setValue(plugin.settings.changedFilesInStatusBar).onChange((value) => {
plugin.settings.changedFilesInStatusBar = value; plugin.settings.changedFilesInStatusBar = value;
plugin.saveSettings(); plugin.saveSettings();
@ -33972,6 +33992,7 @@ var StatusBar = class {
this.messages = []; this.messages = [];
this.base = "obsidian-git-statusbar-"; this.base = "obsidian-git-statusbar-";
this.statusBarEl.setAttribute("aria-label-position", "top"); this.statusBarEl.setAttribute("aria-label-position", "top");
this.statusBarEl.setAttribute("data-tooltip-position", "top");
addEventListener("git-refresh", this.refreshCommitTimestamp.bind(this)); addEventListener("git-refresh", this.refreshCommitTimestamp.bind(this));
} }
displayMessage(message, timeout) { displayMessage(message, timeout) {
@ -34224,7 +34245,7 @@ async function getData(manager) {
`remote.${remote}.url` `remote.${remote}.url`
); );
const [isGitHub, httpsUser, httpsRepo, sshUser, sshRepo] = remoteUrl.match( const [isGitHub, httpsUser, httpsRepo, sshUser, sshRepo] = remoteUrl.match(
/(?:^https:\/\/github\.com\/(.*)\/(.*)\.git$)|(?:^git@github\.com:(.*)\/(.*)\.git$)/ /(?:^https:\/\/github\.com\/(.*)\/(.*)\.git$)|(?:^[a-zA-Z]+@github\.com:(.*)\/(.*)\.git$)/
); );
return { return {
result: "success", result: "success",
@ -34282,10 +34303,10 @@ var LocalStorageSettings = class {
return app.saveLocalStorage(this.prefix + "hostname", value); return app.saveLocalStorage(this.prefix + "hostname", value);
} }
getConflict() { getConflict() {
return app.loadLocalStorage(this.prefix + "conflict"); return app.loadLocalStorage(this.prefix + "conflict") == "true";
} }
setConflict(value) { setConflict(value) {
return app.saveLocalStorage(this.prefix + "conflict", value); return app.saveLocalStorage(this.prefix + "conflict", `${value}`);
} }
getLastAutoPull() { getLastAutoPull() {
return app.loadLocalStorage(this.prefix + "lastAutoPull"); return app.loadLocalStorage(this.prefix + "lastAutoPull");
@ -37069,6 +37090,12 @@ function create_fragment(ctx) {
/*side*/ /*side*/
ctx[3] ctx[3]
); );
attr(
div3,
"data-tooltip-position",
/*side*/
ctx[3]
);
attr(div3, "aria-label", div3_aria_label_value = /*diff*/ attr(div3, "aria-label", div3_aria_label_value = /*diff*/
ctx[0].vault_path); ctx[0].vault_path);
toggle_class( toggle_class(
@ -37164,6 +37191,15 @@ function create_fragment(ctx) {
ctx2[3] ctx2[3]
); );
} }
if (dirty & /*side*/
8) {
attr(
div3,
"data-tooltip-position",
/*side*/
ctx2[3]
);
}
if (dirty & /*diff*/ if (dirty & /*diff*/
1 && div3_aria_label_value !== (div3_aria_label_value = /*diff*/ 1 && div3_aria_label_value !== (div3_aria_label_value = /*diff*/
ctx2[0].vault_path)) { ctx2[0].vault_path)) {
@ -37330,6 +37366,12 @@ function create_else_block(ctx) {
/*side*/ /*side*/
ctx[5] ctx[5]
); );
attr(
div3,
"data-tooltip-position",
/*side*/
ctx[5]
);
attr(div3, "aria-label", div3_aria_label_value = /*entity*/ attr(div3, "aria-label", div3_aria_label_value = /*entity*/
ctx[8].vaultPath); ctx[8].vaultPath);
attr(div4, "class", "tree-item nav-folder"); attr(div4, "class", "tree-item nav-folder");
@ -37389,6 +37431,15 @@ function create_else_block(ctx) {
ctx[5] ctx[5]
); );
} }
if (!current || dirty & /*side*/
32) {
attr(
div3,
"data-tooltip-position",
/*side*/
ctx[5]
);
}
if (!current || dirty & /*hierarchy*/ if (!current || dirty & /*hierarchy*/
1 && div3_aria_label_value !== (div3_aria_label_value = /*entity*/ 1 && div3_aria_label_value !== (div3_aria_label_value = /*entity*/
ctx[8].vaultPath)) { ctx[8].vaultPath)) {
@ -38178,6 +38229,12 @@ function create_fragment3(ctx) {
/*side*/ /*side*/
ctx[5] ctx[5]
); );
attr(
div1,
"data-tooltip-position",
/*side*/
ctx[5]
);
attr(div3, "class", "tree-item-self is-clickable nav-folder-title"); attr(div3, "class", "tree-item-self is-clickable nav-folder-title");
attr(div4, "class", "tree-item nav-folder"); attr(div4, "class", "tree-item nav-folder");
toggle_class( toggle_class(
@ -38256,6 +38313,15 @@ function create_fragment3(ctx) {
ctx2[5] ctx2[5]
); );
} }
if (!current || dirty & /*side*/
32) {
attr(
div1,
"data-tooltip-position",
/*side*/
ctx2[5]
);
}
if (!/*isCollapsed*/ if (!/*isCollapsed*/
ctx2[4]) { ctx2[4]) {
if (if_block1) { if (if_block1) {
@ -39038,6 +39104,12 @@ function create_fragment5(ctx) {
/*side*/ /*side*/
ctx[3] ctx[3]
); );
attr(
div6,
"data-tooltip-position",
/*side*/
ctx[3]
);
attr(div6, "aria-label", div6_aria_label_value = /*change*/ attr(div6, "aria-label", div6_aria_label_value = /*change*/
ctx[0].vault_path); ctx[0].vault_path);
toggle_class( toggle_class(
@ -39154,6 +39226,15 @@ function create_fragment5(ctx) {
ctx2[3] ctx2[3]
); );
} }
if (dirty & /*side*/
8) {
attr(
div6,
"data-tooltip-position",
/*side*/
ctx2[3]
);
}
if (dirty & /*change*/ if (dirty & /*change*/
1 && div6_aria_label_value !== (div6_aria_label_value = /*change*/ 1 && div6_aria_label_value !== (div6_aria_label_value = /*change*/
ctx2[0].vault_path)) { ctx2[0].vault_path)) {
@ -39349,6 +39430,12 @@ function create_fragment6(ctx) {
/*side*/ /*side*/
ctx[1] ctx[1]
); );
attr(
div2,
"data-tooltip-position",
/*side*/
ctx[1]
);
attr(div2, "aria-label", div2_aria_label_value = /*change*/ attr(div2, "aria-label", div2_aria_label_value = /*change*/
ctx[0].vault_path); ctx[0].vault_path);
attr(main, "class", "tree-item nav-file svelte-1wbh8tp"); attr(main, "class", "tree-item nav-file svelte-1wbh8tp");
@ -39418,6 +39505,15 @@ function create_fragment6(ctx) {
ctx2[1] ctx2[1]
); );
} }
if (dirty & /*side*/
2) {
attr(
div2,
"data-tooltip-position",
/*side*/
ctx2[1]
);
}
if (dirty & /*change*/ if (dirty & /*change*/
1 && div2_aria_label_value !== (div2_aria_label_value = /*change*/ 1 && div2_aria_label_value !== (div2_aria_label_value = /*change*/
ctx2[0].vault_path)) { ctx2[0].vault_path)) {
@ -39585,6 +39681,12 @@ function create_fragment7(ctx) {
/*side*/ /*side*/
ctx[3] ctx[3]
); );
attr(
div5,
"data-tooltip-position",
/*side*/
ctx[3]
);
attr(div5, "aria-label", div5_aria_label_value = /*change*/ attr(div5, "aria-label", div5_aria_label_value = /*change*/
ctx[0].vault_path); ctx[0].vault_path);
toggle_class( toggle_class(
@ -39694,6 +39796,15 @@ function create_fragment7(ctx) {
ctx2[3] ctx2[3]
); );
} }
if (dirty & /*side*/
8) {
attr(
div5,
"data-tooltip-position",
/*side*/
ctx2[3]
);
}
if (dirty & /*change*/ if (dirty & /*change*/
1 && div5_aria_label_value !== (div5_aria_label_value = /*change*/ 1 && div5_aria_label_value !== (div5_aria_label_value = /*change*/
ctx2[0].vault_path)) { ctx2[0].vault_path)) {
@ -39727,7 +39838,6 @@ function create_fragment7(ctx) {
}; };
} }
function instance7($$self, $$props, $$invalidate) { function instance7($$self, $$props, $$invalidate) {
let formattedPath;
let side; let side;
let { change } = $$props; let { change } = $$props;
let { view } = $$props; let { view } = $$props;
@ -39783,11 +39893,6 @@ function instance7($$self, $$props, $$invalidate) {
$$invalidate(8, manager = $$props2.manager); $$invalidate(8, manager = $$props2.manager);
}; };
$$self.$$.update = () => { $$self.$$.update = () => {
if ($$self.$$.dirty & /*change*/
1) {
$:
formattedPath = change.vault_path;
}
if ($$self.$$.dirty & /*view*/ if ($$self.$$.dirty & /*view*/
2) { 2) {
$: $:
@ -39920,6 +40025,12 @@ function create_else_block3(ctx) {
/*side*/ /*side*/
ctx[6] ctx[6]
); );
attr(
div6,
"data-tooltip-position",
/*side*/
ctx[6]
);
attr(div6, "aria-label", div6_aria_label_value = /*entity*/ attr(div6, "aria-label", div6_aria_label_value = /*entity*/
ctx[15].vaultPath); ctx[15].vaultPath);
attr(div7, "class", "tree-item nav-folder"); attr(div7, "class", "tree-item nav-folder");
@ -39995,6 +40106,15 @@ function create_else_block3(ctx) {
ctx[6] ctx[6]
); );
} }
if (!current || dirty & /*side*/
64) {
attr(
div6,
"data-tooltip-position",
/*side*/
ctx[6]
);
}
if (!current || dirty & /*hierarchy*/ if (!current || dirty & /*hierarchy*/
1 && div6_aria_label_value !== (div6_aria_label_value = /*entity*/ 1 && div6_aria_label_value !== (div6_aria_label_value = /*entity*/
ctx[15].vaultPath)) { ctx[15].vaultPath)) {
@ -43597,7 +43717,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
}) { }) {
if (!await this.isAllInitialized()) if (!await this.isAllInitialized())
return false; return false;
let hadConflict = this.localStorage.getConflict() === "true"; let hadConflict = this.localStorage.getConflict();
let changedFiles; let changedFiles;
let status2; let status2;
let unstagedFiles; let unstagedFiles;
@ -43605,7 +43725,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
this.mayDeleteConflictFile(); this.mayDeleteConflictFile();
status2 = await this.updateCachedStatus(); status2 = await this.updateCachedStatus();
if (status2.conflicted.length == 0) { if (status2.conflicted.length == 0) {
this.localStorage.setConflict("false"); this.localStorage.setConflict(false);
hadConflict = false; hadConflict = false;
} }
if (fromAutoBackup && status2.conflicted.length > 0) { if (fromAutoBackup && status2.conflicted.length > 0) {
@ -43671,7 +43791,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
} }
if (this.gitManager instanceof SimpleGit) { if (this.gitManager instanceof SimpleGit) {
if ((await this.updateCachedStatus()).conflicted.length == 0) { if ((await this.updateCachedStatus()).conflicted.length == 0) {
this.localStorage.setConflict("false"); this.localStorage.setConflict(false);
} }
} }
let roughly = false; let roughly = false;
@ -43723,7 +43843,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
if (!await this.remotesAreSet()) { if (!await this.remotesAreSet()) {
return false; return false;
} }
const hadConflict = this.localStorage.getConflict() === "true"; const hadConflict = this.localStorage.getConflict();
if (this.gitManager instanceof SimpleGit) if (this.gitManager instanceof SimpleGit)
await this.mayDeleteConflictFile(); await this.mayDeleteConflictFile();
let status2; let status2;
@ -43786,7 +43906,8 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
); );
if (file) { if (file) {
this.app.workspace.iterateAllLeaves((leaf) => { this.app.workspace.iterateAllLeaves((leaf) => {
if (leaf.view instanceof import_obsidian30.MarkdownView && leaf.view.file.path == file.path) { var _a2;
if (leaf.view instanceof import_obsidian30.MarkdownView && ((_a2 = leaf.view.file) == null ? void 0 : _a2.path) == file.path) {
leaf.detach(); leaf.detach();
} }
}); });
@ -43909,7 +44030,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
} }
} }
if (!this.timeoutIDBackup && !this.onFileModifyEventRef) { if (!this.timeoutIDBackup && !this.onFileModifyEventRef) {
const lastAutos = await this.loadLastAuto(); const lastAutos = this.loadLastAuto();
if (this.settings.autoSaveInterval > 0) { if (this.settings.autoSaveInterval > 0) {
const now2 = /* @__PURE__ */ new Date(); const now2 = /* @__PURE__ */ new Date();
const diff2 = this.settings.autoSaveInterval - Math.round( const diff2 = this.settings.autoSaveInterval - Math.round(
@ -43921,7 +44042,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
} }
async setUpAutos() { async setUpAutos() {
this.setUpAutoBackup(); this.setUpAutoBackup();
const lastAutos = await this.loadLastAuto(); const lastAutos = this.loadLastAuto();
if (this.settings.differentIntervalCommitAndPush && this.settings.autoPushInterval > 0) { if (this.settings.differentIntervalCommitAndPush && this.settings.autoPushInterval > 0) {
const now2 = /* @__PURE__ */ new Date(); const now2 = /* @__PURE__ */ new Date();
const diff2 = this.settings.autoPushInterval - Math.round( const diff2 = this.settings.autoPushInterval - Math.round(
@ -44044,7 +44165,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
} }
async handleConflict(conflicted) { async handleConflict(conflicted) {
this.setState(6 /* conflicted */); this.setState(6 /* conflicted */);
this.localStorage.setConflict("true"); this.localStorage.setConflict(true);
let lines; let lines;
if (conflicted !== void 0) { if (conflicted !== void 0) {
lines = [ lines = [

View File

@ -5,5 +5,5 @@
"isDesktopOnly": false, "isDesktopOnly": false,
"fundingUrl": "https://ko-fi.com/vinzent", "fundingUrl": "https://ko-fi.com/vinzent",
"js": "main.js", "js": "main.js",
"version": "2.22.0" "version": "2.22.1"
} }

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,11 @@
{ {
"id": "obsidian-linter", "id": "obsidian-linter",
"name": "Linter", "name": "Linter",
"version": "1.21.0", "version": "1.22.0",
"minAppVersion": "1.4.16", "minAppVersion": "1.4.16",
"description": "Formats and styles your notes. It can be used to format YAML tags, aliases, arrays, and metadata; footnotes; headings; spacing; math blocks; regular markdown contents like list, italics, and bold styles; and more with the use of custom rule options as well.", "description": "Formats and styles your notes. It can be used to format YAML tags, aliases, arrays, and metadata; footnotes; headings; spacing; math blocks; regular markdown contents like list, italics, and bold styles; and more with the use of custom rule options as well.",
"author": "Victor Tao", "author": "Victor Tao",
"authorUrl": "https://github.com/platers", "authorUrl": "https://github.com/platers",
"helpUrl": "https://platers.github.io/obsidian-linter/",
"isDesktopOnly": false "isDesktopOnly": false
} }

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{ {
"id": "obsidian-weread-plugin", "id": "obsidian-weread-plugin",
"name": "Weread Plugin", "name": "Weread Plugin",
"version": "0.6.0", "version": "0.8.0",
"minAppVersion": "0.12.0", "minAppVersion": "0.12.0",
"description": "This is obsidian plugin for Tencent weread.", "description": "This is obsidian plugin for Tencent weread.",
"author": "hankzhao", "author": "hankzhao",

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,9 @@
{ {
"id": "templater-obsidian", "id": "templater-obsidian",
"name": "Templater", "name": "Templater",
"version": "1.18.3", "version": "2.1.0",
"description": "Create and use templates", "description": "Create and use templates",
"minAppVersion": "0.11.13", "minAppVersion": "1.5.0",
"author": "SilentVoid", "author": "SilentVoid",
"authorUrl": "https://github.com/SilentVoid13", "authorUrl": "https://github.com/SilentVoid13",
"helpUrl": "https://silentvoid13.github.io/Templater/", "helpUrl": "https://silentvoid13.github.io/Templater/",