1
0

项目:更新插件

This commit is contained in:
周中平 2024-02-26 20:05:21 +08:00
parent 9d667e8300
commit 8370246ad5
Signed by: zhouzhongping
GPG Key ID: 6666822800008000
10 changed files with 2858 additions and 2658 deletions

View File

@ -29274,6 +29274,7 @@ var DEFAULT_SETTINGS = {
disablePush: false, disablePush: false,
pullBeforePush: true, pullBeforePush: true,
disablePopups: false, disablePopups: false,
disablePopupsForNoChanges: false,
listChangedFilesInMessageBody: false, listChangedFilesInMessageBody: false,
showStatusBar: true, showStatusBar: true,
updateSubmodules: false, updateSubmodules: false,
@ -29611,25 +29612,22 @@ var SimpleGit = class extends GitManager {
this.plugin.setState(1 /* status */); this.plugin.setState(1 /* status */);
const status2 = await this.git.status((err) => this.onError(err)); const status2 = await this.git.status((err) => this.onError(err));
this.plugin.setState(0 /* idle */); this.plugin.setState(0 /* idle */);
const allFilesFormatted = status2.files.map((e) => {
const res = this.formatPath(e);
return {
path: res.path,
from: res.from,
index: e.index === "?" ? "U" : e.index,
working_dir: e.working_dir === "?" ? "U" : e.working_dir,
vault_path: this.getVaultPath(res.path)
};
});
return { return {
changed: status2.files.filter((e) => e.working_dir !== " ").map((e) => { all: allFilesFormatted,
const res = this.formatPath(e); changed: allFilesFormatted.filter((e) => e.working_dir !== " "),
return { staged: allFilesFormatted.filter(
path: res.path, (e) => e.index !== " " && e.index != "U"
from: res.from, ),
working_dir: e.working_dir === "?" ? "U" : e.working_dir,
vault_path: this.getVaultPath(res.path)
};
}),
staged: status2.files.filter((e) => e.index !== " " && e.index != "?").map((e) => {
const res = this.formatPath(e, e.index === "R");
return {
path: res.path,
from: res.from,
index: e.index,
vault_path: this.getVaultPath(res.path)
};
}),
conflicted: status2.conflicted.map( conflicted: status2.conflicted.map(
(path2) => this.formatPath({ path: path2 }).path (path2) => this.formatPath({ path: path2 }).path
) )
@ -29754,10 +29752,14 @@ var SimpleGit = class extends GitManager {
dispatchEvent(new CustomEvent("git-head-update")); dispatchEvent(new CustomEvent("git-head-update"));
return res.summary.changes; return res.summary.changes;
} }
async commit(message) { async commit({
message,
amend
}) {
this.plugin.setState(4 /* commit */); this.plugin.setState(4 /* commit */);
const res = (await this.git.commit( const res = (await this.git.commit(
await this.formatCommitMessage(message), await this.formatCommitMessage(message),
amend ? ["--amend"] : [],
(err) => this.onError(err) (err) => this.onError(err)
)).summary.changes; )).summary.changes;
dispatchEvent(new CustomEvent("git-head-update")); dispatchEvent(new CustomEvent("git-head-update"));
@ -31263,7 +31265,7 @@ var IsomorphicGit = class extends GitManager {
const conflicted = []; const conflicted = [];
window.clearTimeout(timeout); window.clearTimeout(timeout);
notice == null ? void 0 : notice.hide(); notice == null ? void 0 : notice.hide();
return { changed, staged, conflicted }; return { all: status2, changed, staged, conflicted };
} catch (error) { } catch (error) {
window.clearTimeout(timeout); window.clearTimeout(timeout);
notice == null ? void 0 : notice.hide(); notice == null ? void 0 : notice.hide();
@ -31279,13 +31281,15 @@ var IsomorphicGit = class extends GitManager {
try { try {
await this.checkAuthorInfo(); await this.checkAuthorInfo();
await this.stageAll({ status: status2, unstagedFiles }); await this.stageAll({ status: status2, unstagedFiles });
return this.commit(message); return this.commit({ message });
} catch (error) { } catch (error) {
this.plugin.displayError(error); this.plugin.displayError(error);
throw error; throw error;
} }
} }
async commit(message) { async commit({
message
}) {
try { try {
await this.checkAuthorInfo(); await this.checkAuthorInfo();
this.plugin.setState(4 /* commit */); this.plugin.setState(4 /* commit */);
@ -31641,7 +31645,7 @@ var IsomorphicGit = class extends GitManager {
throw error; throw error;
} }
} }
async branchIsMerged(branch2) { async branchIsMerged(_) {
return true; return true;
} }
async init() { async init() {
@ -31808,7 +31812,7 @@ var IsomorphicGit = class extends GitManager {
); );
await this.setConfig(`branch.${branch2}.remote`, remote); await this.setConfig(`branch.${branch2}.remote`, remote);
} }
updateGitPath(gitPath) { updateGitPath(_) {
return; return;
} }
async getFileChangesCount(commitHash1, commitHash2) { async getFileChangesCount(commitHash1, commitHash2) {
@ -32017,8 +32021,8 @@ var IsomorphicGit = class extends GitManager {
return diff2; return diff2;
} else { } else {
let workdirContent; let workdirContent;
if (await app.vault.adapter.exists(vaultPath)) { if (await this.app.vault.adapter.exists(vaultPath)) {
workdirContent = await app.vault.adapter.read(vaultPath); workdirContent = await this.app.vault.adapter.read(vaultPath);
} else { } else {
workdirContent = ""; workdirContent = "";
} }
@ -32305,14 +32309,14 @@ var ObsidianGitSettingsTab = class extends import_obsidian8.PluginSettingTab {
plugin.saveSettings(); plugin.saveSettings();
}) })
); );
new import_obsidian8.Setting(containerEl).setName("{{date}} placeholder format").setDesc( const datePlaceholderSetting = new import_obsidian8.Setting(containerEl).setName("{{date}} placeholder format").addText(
`Specify custom date format. E.g. "${DATE_TIME_FORMAT_SECONDS}"`
).addText(
(text2) => text2.setPlaceholder(plugin.settings.commitDateFormat).setValue(plugin.settings.commitDateFormat).onChange(async (value) => { (text2) => text2.setPlaceholder(plugin.settings.commitDateFormat).setValue(plugin.settings.commitDateFormat).onChange(async (value) => {
plugin.settings.commitDateFormat = value; plugin.settings.commitDateFormat = value;
await plugin.saveSettings(); await plugin.saveSettings();
}) })
); );
datePlaceholderSetting.descEl.innerHTML = `
Specify custom date format. E.g. "${DATE_TIME_FORMAT_SECONDS}. See <a href="https://momentjs.com">Moment.js</a> for more formats.`;
new import_obsidian8.Setting(containerEl).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device.").addText( new import_obsidian8.Setting(containerEl).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device.").addText(
(text2) => { (text2) => {
var _a2; var _a2;
@ -32408,9 +32412,19 @@ var ObsidianGitSettingsTab = class extends import_obsidian8.PluginSettingTab {
).addToggle( ).addToggle(
(toggle) => toggle.setValue(plugin.settings.disablePopups).onChange((value) => { (toggle) => toggle.setValue(plugin.settings.disablePopups).onChange((value) => {
plugin.settings.disablePopups = value; plugin.settings.disablePopups = value;
this.display();
plugin.saveSettings(); plugin.saveSettings();
}) })
); );
if (!plugin.settings.disablePopups)
new import_obsidian8.Setting(containerEl).setName("Hide notifications for no changes").setDesc(
"Don't show notifications when there are no changes to commit/push"
).addToggle(
(toggle) => toggle.setValue(plugin.settings.disablePopupsForNoChanges).onChange((value) => {
plugin.settings.disablePopupsForNoChanges = value;
plugin.saveSettings();
})
);
new import_obsidian8.Setting(containerEl).setName("Show status bar").setDesc( new import_obsidian8.Setting(containerEl).setName("Show status bar").setDesc(
"Obsidian must be restarted for the changes to take affect" "Obsidian must be restarted for the changes to take affect"
).addToggle( ).addToggle(
@ -32997,7 +33011,7 @@ var LineAuthoringSubscriber = class {
async notifyLineAuthoring(id, la) { async notifyLineAuthoring(id, la) {
if (this.view === void 0) { if (this.view === void 0) {
console.warn( console.warn(
`Obsidian Git: View is not defined for editor cache key. Unforeseen situation. id: ${id}` `Git: View is not defined for editor cache key. Unforeseen situation. id: ${id}`
); );
return; return;
} }
@ -33747,7 +33761,7 @@ var LineAuthorProvider = class {
} }
async trackChanged(file) { async trackChanged(file) {
this.trackChangedHelper(file).catch((reason) => { this.trackChangedHelper(file).catch((reason) => {
console.warn("Obsidian Git: Error in trackChanged." + reason); console.warn("Git: Error in trackChanged." + reason);
return Promise.reject(reason); return Promise.reject(reason);
}); });
} }
@ -33756,7 +33770,7 @@ var LineAuthorProvider = class {
return; return;
if (file.path === void 0) { if (file.path === void 0) {
console.warn( console.warn(
"Obsidian Git: Attempted to track change of undefined filepath. Unforeseen situation." "Git: Attempted to track change of undefined filepath. Unforeseen situation."
); );
return; return;
} }
@ -33813,7 +33827,7 @@ var LineAuthoringFeature = class {
const file = obsView == null ? void 0 : obsView.file; const file = obsView == null ? void 0 : obsView.file;
if (!this.lineAuthorInfoProvider) { if (!this.lineAuthorInfoProvider) {
console.warn( console.warn(
"Obsidian Git: undefined lineAuthorInfoProvider. Unexpected situation." "Git: undefined lineAuthorInfoProvider. Unexpected situation."
); );
return; return;
} }
@ -33848,10 +33862,7 @@ var LineAuthoringFeature = class {
this.activateCodeMirrorExtensions(); this.activateCodeMirrorExtensions();
console.log(this.plg.manifest.name + ": Enabled line authoring."); console.log(this.plg.manifest.name + ": Enabled line authoring.");
} catch (e) { } catch (e) {
console.warn( console.warn("Git: Error while loading line authoring feature.", e);
"Obsidian Git: Error while loading line authoring feature.",
e
);
this.deactivateFeature(); this.deactivateFeature();
} }
} }
@ -34123,7 +34134,7 @@ var ChangedFilesModal = class extends import_obsidian14.FuzzySuggestModal {
let working_dir = ""; let working_dir = "";
let index2 = ""; let index2 = "";
if (item.working_dir != " ") if (item.working_dir != " ")
working_dir = `Working dir: ${item.working_dir} `; working_dir = `Working Dir: ${item.working_dir} `;
if (item.index != " ") if (item.index != " ")
index2 = `Index: ${item.index}`; index2 = `Index: ${item.index}`;
return `${working_dir}${index2} | ${item.vault_path}`; return `${working_dir}${index2} | ${item.vault_path}`;
@ -40065,7 +40076,7 @@ function create_else_block3(ctx) {
append2(div7, t6); append2(div7, t6);
current = true; current = true;
if (!mounted) { if (!mounted) {
dispose = listen(div7, "click", click_handler_3); dispose = listen(div7, "click", stop_propagation(click_handler_3));
mounted = true; mounted = true;
} }
}, },
@ -42610,7 +42621,7 @@ function instance9($$self, $$props, $$invalidate) {
plugin.setState(0 /* idle */); plugin.setState(0 /* idle */);
return false; return false;
} }
plugin.promiseQueue.addTask(() => plugin.gitManager.commit(commitMessage).then(() => { plugin.promiseQueue.addTask(() => plugin.gitManager.commit({ message: commitMessage }).then(() => {
if (commitMessage !== plugin.settings.commitMessage) { if (commitMessage !== plugin.settings.commitMessage) {
$$invalidate(2, commitMessage = ""); $$invalidate(2, commitMessage = "");
} }
@ -43107,11 +43118,11 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
id: "add-to-gitignore", id: "add-to-gitignore",
name: "Add file to gitignore", name: "Add file to gitignore",
checkCallback: (checking) => { checkCallback: (checking) => {
const file = app.workspace.getActiveFile(); const file = this.app.workspace.getActiveFile();
if (checking) { if (checking) {
return file !== null; return file !== null;
} else { } else {
app.vault.adapter.append( this.app.vault.adapter.append(
this.gitManager.getVaultPath(".gitignore"), this.gitManager.getVaultPath(".gitignore"),
"\n" + this.gitManager.asRepositoryRelativePath( "\n" + this.gitManager.asRepositoryRelativePath(
file.path, file.path,
@ -43169,6 +43180,20 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
}) })
) )
}); });
if (import_obsidian30.Platform.isDesktopApp) {
this.addCommand({
id: "commit-amend-staged-specified-message",
name: "Commit Amend",
callback: () => this.promiseQueue.addTask(
() => this.commit({
fromAutoBackup: false,
requestCustomMessage: true,
onlyStaged: true,
amend: true
})
)
});
}
this.addCommand({ this.addCommand({
id: "commit-staged-specified-message", id: "commit-staged-specified-message",
name: "Commit staged with specific message", name: "Commit staged with specific message",
@ -43266,12 +43291,13 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
if (!await this.isAllInitialized()) if (!await this.isAllInitialized())
return; return;
const status2 = await this.gitManager.status(); const status2 = await this.gitManager.status();
console.log(status2);
this.setState(0 /* idle */); this.setState(0 /* idle */);
if (status2.changed.length + status2.staged.length > 500) { if (status2.changed.length + status2.staged.length > 500) {
this.displayError("Too many changes to display"); this.displayError("Too many changes to display");
return; return;
} }
new ChangedFilesModal(this, status2.changed).open(); new ChangedFilesModal(this, status2.all).open();
} }
}); });
this.addCommand({ this.addCommand({
@ -43366,7 +43392,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
const length = 1e4; const length = 1e4;
if (this.manifest.id === "obsidian-git" && import_obsidian30.Platform.isDesktopApp && !this.settings.showedMobileNotice) { if (this.manifest.id === "obsidian-git" && import_obsidian30.Platform.isDesktopApp && !this.settings.showedMobileNotice) {
new import_obsidian30.Notice( new import_obsidian30.Notice(
"Obsidian Git is now available on mobile! Please read the plugin's README for more information.", "Git is now available on mobile! Please read the plugin's README for more information.",
length length
); );
this.settings.showedMobileNotice = true; this.settings.showedMobileNotice = true;
@ -43374,7 +43400,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
} }
if (this.manifest.id === "obsidian-git-isomorphic") { if (this.manifest.id === "obsidian-git-isomorphic") {
new import_obsidian30.Notice( new import_obsidian30.Notice(
"Obsidian Git Mobile is now deprecated. Please uninstall it and install Obsidian Git instead.", "Git Mobile is now deprecated. Please uninstall it and install Git instead.",
length length
); );
} }
@ -43713,7 +43739,8 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
fromAutoBackup, fromAutoBackup,
requestCustomMessage = false, requestCustomMessage = false,
onlyStaged = false, onlyStaged = false,
commitMessage commitMessage,
amend = false
}) { }) {
if (!await this.isAllInitialized()) if (!await this.isAllInitialized())
return false; return false;
@ -43781,12 +43808,16 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
} }
let committedFiles; let committedFiles;
if (onlyStaged) { if (onlyStaged) {
committedFiles = await this.gitManager.commit(cmtMessage); committedFiles = await this.gitManager.commit({
message: cmtMessage,
amend
});
} else { } else {
committedFiles = await this.gitManager.commitAll({ committedFiles = await this.gitManager.commitAll({
message: cmtMessage, message: cmtMessage,
status: status2, status: status2,
unstagedFiles unstagedFiles,
amend
}); });
} }
if (this.gitManager instanceof SimpleGit) { if (this.gitManager instanceof SimpleGit) {
@ -44170,7 +44201,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
if (conflicted !== void 0) { if (conflicted !== void 0) {
lines = [ lines = [
"# Conflicts", "# Conflicts",
"Please resolve them and commit them using the commands `Obsidian Git: Commit all changes` followed by `Obsidian Git: Push`", "Please resolve them and commit them using the commands `Git: Commit all changes` followed by `Git: Push`",
"(This file will automatically be deleted before commit)", "(This file will automatically be deleted before commit)",
"[[#Additional Instructions]] available below file list", "[[#Additional Instructions]] available below file list",
"", "",
@ -44237,9 +44268,7 @@ I strongly recommend to use "Source mode" for viewing the conflicted files. For
if (remoteName) { if (remoteName) {
this.displayMessage("Fetching remote branches"); this.displayMessage("Fetching remote branches");
await this.gitManager.fetch(remoteName); await this.gitManager.fetch(remoteName);
const branches = await this.gitManager.getRemoteBranches( const branches = await this.gitManager.getRemoteBranches(remoteName);
remoteName
);
const branchModal = new GeneralModal({ const branchModal = new GeneralModal({
options: branches, options: branches,
placeholder: "Select or create a new remote branch by typing its name and selecting it" placeholder: "Select or create a new remote branch by typing its name and selecting it"
@ -44309,7 +44338,9 @@ I strongly recommend to use "Source mode" for viewing the conflicted files. For
var _a2; var _a2;
(_a2 = this.statusBar) == null ? void 0 : _a2.displayMessage(message.toLowerCase(), timeout); (_a2 = this.statusBar) == null ? void 0 : _a2.displayMessage(message.toLowerCase(), timeout);
if (!this.settings.disablePopups) { if (!this.settings.disablePopups) {
new import_obsidian30.Notice(message, 5 * 1e3); if (!this.settings.disablePopupsForNoChanges || !message.startsWith("No changes")) {
new import_obsidian30.Notice(message, 5 * 1e3);
}
} }
console.log(`git obsidian message: ${message}`); console.log(`git obsidian message: ${message}`);
} }

View File

@ -1,9 +1,9 @@
{ {
"id": "obsidian-git", "id": "obsidian-git",
"name": "Obsidian Git", "name": "Git",
"description": "Backup your vault with Git.", "description": "Backup your vault with Git.",
"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.1" "version": "2.23.2"
} }

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{ {
"id": "obsidian-linter", "id": "obsidian-linter",
"name": "Linter", "name": "Linter",
"version": "1.22.0", "version": "1.23.1",
"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",

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",
"version": "0.8.0", "version": "0.9.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,7 +1,7 @@
{ {
"id": "templater-obsidian", "id": "templater-obsidian",
"name": "Templater", "name": "Templater",
"version": "2.1.0", "version": "2.2.1",
"description": "Create and use templates", "description": "Create and use templates",
"minAppVersion": "1.5.0", "minAppVersion": "1.5.0",
"author": "SilentVoid", "author": "SilentVoid",

View File

@ -1,7 +1,7 @@
{ {
"name": "Minimal", "name": "Minimal",
"version": "7.2.1", "version": "7.4.8",
"minAppVersion": "1.1.9", "minAppVersion": "1.5.0",
"author": "@kepano", "author": "@kepano",
"authorUrl": "https://twitter.com/kepano", "authorUrl": "https://twitter.com/kepano",
"fundingUrl": "https://www.buymeacoffee.com/kepano" "fundingUrl": "https://www.buymeacoffee.com/kepano"

File diff suppressed because one or more lines are too long