master
lzq 3 months ago
commit fbff9ce5b3
  1. 16
      app.json
  2. 4
      appearance.json
  3. 4
      community-plugins.json
  4. 30
      core-plugins-migration.json
  5. 33
      core-plugins.json
  6. 3
      daily-notes.json
  7. 22
      graph.json
  8. 10
      hotkeys.json
  9. 3
      page-preview.json
  10. 18
      plugins/attachment-management/data.json
  11. 2068
      plugins/attachment-management/main.js
  12. 9
      plugins/attachment-management/manifest.json
  13. 15
      plugins/attachment-management/styles.css
  14. 10
      plugins/attachment-manager/data.json
  15. 640
      plugins/attachment-manager/main.js
  16. 10
      plugins/attachment-manager/manifest.json
  17. 8
      plugins/attachment-manager/styles.css
  18. 58
      plugins/obsidian-git/data.json
  19. 45283
      plugins/obsidian-git/main.js
  20. 9
      plugins/obsidian-git/manifest.json
  21. 558
      plugins/obsidian-git/styles.css
  22. 246
      workspace.json

@ -0,0 +1,16 @@
{
"attachmentFolderPath": "./storage/未命名.md",
"useMarkdownLinks": true,
"newLinkFormat": "relative",
"newFileLocation": "current",
"pdfExportSettings": {
"pageSize": "A4",
"landscape": false,
"margin": "0",
"downscalePercent": 100
},
"readableLineLength": false,
"alwaysUpdateLinks": true,
"defaultViewMode": "preview",
"smartIndentList": true
}

@ -0,0 +1,4 @@
{
"accentColor": "",
"theme": "obsidian"
}

@ -0,0 +1,4 @@
[
"obsidian-git",
"attachment-manager"
]

@ -0,0 +1,30 @@
{
"file-explorer": true,
"global-search": true,
"switcher": true,
"graph": true,
"backlink": true,
"canvas": true,
"outgoing-link": true,
"tag-pane": true,
"properties": false,
"page-preview": true,
"daily-notes": true,
"templates": true,
"note-composer": true,
"command-palette": true,
"slash-command": false,
"editor-status": true,
"bookmarks": true,
"markdown-importer": false,
"zk-prefixer": false,
"random-note": false,
"outline": true,
"word-count": true,
"slides": false,
"audio-recorder": false,
"workspaces": false,
"file-recovery": true,
"publish": false,
"sync": false
}

@ -0,0 +1,33 @@
{
"file-explorer": true,
"global-search": true,
"switcher": true,
"graph": true,
"backlink": true,
"canvas": true,
"outgoing-link": true,
"tag-pane": true,
"properties": false,
"page-preview": true,
"daily-notes": true,
"templates": true,
"note-composer": true,
"command-palette": true,
"slash-command": false,
"editor-status": true,
"bookmarks": true,
"markdown-importer": false,
"zk-prefixer": false,
"random-note": false,
"outline": true,
"word-count": true,
"slides": false,
"audio-recorder": false,
"workspaces": false,
"file-recovery": true,
"publish": false,
"sync": false,
"webviewer": false,
"footnotes": false,
"bases": true
}

@ -0,0 +1,3 @@
{
"folder": "/0便签"
}

@ -0,0 +1,22 @@
{
"collapse-filter": true,
"search": "",
"showTags": false,
"showAttachments": false,
"hideUnresolved": false,
"showOrphans": true,
"collapse-color-groups": true,
"colorGroups": [],
"collapse-display": true,
"showArrow": false,
"textFadeMultiplier": 0,
"nodeSizeMultiplier": 1,
"lineSizeMultiplier": 1,
"collapse-forces": true,
"centerStrength": 0.518713248970312,
"repelStrength": 10,
"linkStrength": 1,
"linkDistance": 250,
"scale": 1.9655560456566739,
"close": false
}

@ -0,0 +1,10 @@
{
"attachment-manager:localization-remote-attachments": [
{
"modifiers": [
"Alt"
],
"key": "D"
}
]
}

@ -0,0 +1,3 @@
{
"graph": false
}

@ -0,0 +1,18 @@
{
"attachPath": {
"attachmentRoot": "",
"saveAttE": "obsFolder",
"attachmentPath": "storage/${notename}",
"attachFormat": "${date}",
"type": "GLOBAL"
},
"dateFormat": "YYYYMMDD_HHmmssSSS",
"excludeExtensionPattern": "",
"autoRenameAttachment": true,
"excludedPaths": "",
"excludePathsArray": [],
"excludeSubpaths": false,
"originalNameStorage": [],
"overridePath": {},
"disableNotification": false
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,9 @@
{
"id": "attachment-management",
"name": "Attachment Management",
"version": "0.9.8",
"description": "Customize your attachment path of notes independently with variables and auto rename it on change.",
"author": "trganda",
"authorUrl": "https://github.com/trganda",
"isDesktopOnly": false
}

@ -0,0 +1,15 @@
/*
This CSS file will be included with your plugin, and
available in the app when your plugin is enabled.
If your plugin does not need CSS, delete this file.
*/
.attach_management_sub_setting {
padding-left: 2em;
}
.attach_management_sub_setting + .attach_management_sub_setting {
padding-left: 0;
margin-left: 2em;
}

@ -0,0 +1,10 @@
{
"folderName": "storage/${filename}",
"pastedImageName": "${datetime}",
"datetimeFormat": "YYYYMMDD_HHmmssSSS",
"hideFolder": true,
"aeroFolder": true,
"autoRenameFolder": true,
"autoRenameFiles": true,
"autoDeleteFolder": false
}

@ -0,0 +1,640 @@
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// main.ts
var main_exports = {};
__export(main_exports, {
default: () => main_default
});
module.exports = __toCommonJS(main_exports);
// src/Plugin.ts
var import_obsidian7 = require("obsidian");
// src/Settings.ts
var import_obsidian = require("obsidian");
var _notename = "${notename}";
var _filename = "${filename}";
var _datetime = "${datetime}";
var DEFAULT_SETTINGS = {
folderName: `${_filename}_Attachments`,
pastedImageName: `${_notename}-${_datetime}`,
datetimeFormat: "YYYYMMDDHHmmssSSS",
hideFolder: false,
aeroFolder: true,
autoRenameFolder: true,
autoRenameFiles: true,
autoDeleteFolder: false
};
var containsFilenameOrNotename = (settings) => {
return settings.folderName.contains(_filename) || settings.folderName.contains(_notename);
};
var encode = (text) => {
const specialCharacters = ["\\$", "\\[", "\\]", "\\{", "\\}", "\\(", "\\)", "\\*", "\\+", "\\.", "\\?", "\\\\", "\\^"];
const reg = new RegExp("[" + specialCharacters.join("") + "]", "gi");
return text.replace(reg, (character) => `\\${character}`);
};
var buildFolderRegExp = (settings) => {
let reg = encode(settings.folderName);
reg = reg.replace(encode(_filename), ".+").replace(encode(_notename), ".+");
return new RegExp("^" + reg + "$");
};
var buildFolderName = (settings, fileName, notename) => {
if (settings.folderName.contains(_filename)) {
return "./" + settings.folderName.replace(_filename, fileName);
}
if (settings.folderName.contains(_notename)) {
return "./" + settings.folderName.replace(_notename, notename);
}
return "./" + settings.folderName;
};
var buildPastedImageName = (settings, notename) => {
return buildPastedImageNameWithMoment(settings, (0, import_obsidian.moment)(), notename);
};
var buildPastedImageNameWithMoment = (settings, moment3, notename) => {
const datetime = moment3.format(settings.datetimeFormat);
return settings.pastedImageName.replace(_notename, notename).replace(_datetime, datetime);
};
// src/SettingTab.ts
var import_obsidian2 = require("obsidian");
// src/lang/zh.ts
var zh_default = {
"plugin_name": "\u9644\u4EF6\u7BA1\u7406\u5668",
"settings_folder_name": "\u9644\u4EF6\u6587\u4EF6\u5939",
"settings_folder_name_desc": "\u9644\u4EF6\u6587\u4EF6\u5939\u7684\u540D\u79F0\uFF0C\u4F7F\u7528\u53D8\u91CF ${filename} \u83B7\u53D6\u7B14\u8BB0\uFF08md/canvas\uFF09\u6587\u4EF6\u540D\u79F0\uFF08\u5305\u542B\u540E\u7F00\uFF09\uFF0C\u4F8B\uFF1A${filename}_Attachments\u3002",
"settings_pasted_image_file_name": "\u201C\u7C98\u8D34\u56FE\u7247\u201D\u6587\u4EF6\u540D",
"settings_pasted_image_file_name_desc": "\u201C\u7C98\u8D34\u56FE\u7247\u201D\u4FDD\u5B58\u4E3A\u6587\u4EF6\u7684\u540D\u79F0\uFF0C\u4F7F\u7528\u53D8\u91CF ${notename} \u83B7\u53D6\u7B14\u8BB0\uFF08md/canvas\uFF09\u540D\u79F0\uFF0C\u4F7F\u7528\u53D8\u91CF ${datetime} \u83B7\u53D6\u65F6\u95F4\uFF0C\u4F8B\uFF1A${notename}-${datetime}\u3002",
"settings_datetime_format": "${datetime} \u683C\u5F0F",
"settings_datetime_format_desc": "\u65E5\u671F\u65F6\u95F4\u683C\u5F0F\uFF08\u4F7F\u7528 moment.js \u683C\u5F0F\uFF09\uFF0C\u4F8B\uFF1AYYYYMMDDHHmmssSSS\u3002",
"settings_hide_folder": "\u9690\u85CF\u9644\u4EF6\u6587\u4EF6\u5939",
"settings_aero_folder": "\u900F\u660E\u9644\u4EF6\u6587\u4EF6\u5939",
"settings_auto_rename_folder": "\u81EA\u52A8\u91CD\u547D\u540D\u9644\u4EF6\u6587\u4EF6\u5939",
"settings_auto_rename_folder_desc": "\u7B14\u8BB0\uFF08md/canvas\uFF09\u540D\u79F0\u53D8\u5316\u65F6\uFF0C\u5982\u679C\u9644\u4EF6\u6587\u4EF6\u5939\u540D\u79F0\u4E2D\u5305\u542B\u201C${filename}\u201D\uFF0C\u81EA\u52A8\u91CD\u547D\u540D\u9644\u4EF6\u6587\u4EF6\u5939\u3002",
"settings_auto_rename_files": "\u81EA\u52A8\u91CD\u547D\u540D\u9644\u4EF6\u6587\u4EF6",
"settings_auto_rename_files_desc": "\u7B14\u8BB0\uFF08md/canvas\uFF09\u540D\u79F0\u53D8\u5316\u65F6\uFF0C\u5982\u679C\u9644\u4EF6\u6587\u4EF6\u540D\u79F0\u4E2D\u5305\u542B\u201C${notename}\u201D\uFF0C\u81EA\u52A8\u91CD\u547D\u540D\u9644\u4EF6\u6587\u4EF6\u3002",
"settings_auto_delete_folder": "\u81EA\u52A8\u5220\u9664\u9644\u4EF6\u6587\u4EF6\u5939",
"settings_auto_delete_folder_desc": "\u7B14\u8BB0\uFF08md/canvas\uFF09\u5220\u9664\u65F6\uFF0C\u5982\u679C\u9644\u4EF6\u6587\u4EF6\u5939\u540D\u79F0\u4E2D\u5305\u542B\u201C${filename}\u201D\uFF0C\u81EA\u52A8\u5220\u9664\u9644\u4EF6\u6587\u4EF6\u5939\u3002",
"command_toggle_attachment_folder_visibility": "\u5207\u6362\u9644\u4EF6\u6587\u4EF6\u5939\u7684\u201C\u663E\u793A/\u9690\u85CF\u201D",
"status_attachment_folder_visibility": "\u9644\u4EF6\u6587\u4EF6\u5939\u5DF2\u9690\u85CF",
"command_localization_remote_attachments": "\u4E0B\u8F7D\u8FDC\u7A0B\u56FE\u7247",
"command_localization_remote_attachments_success": "\u4E0B\u8F7D\u6210\u529F\u3002",
"command_localization_remote_attachments_failure": "\u4E0B\u8F7D\u5931\u8D25\u3002"
};
// src/lang/en.ts
var en_default = {
"plugin_name": "Attachment Manager",
"settings_folder_name": "Attachment Folder",
"settings_folder_name_desc": 'The name of the attachment folder, using the variable ${filename} to get name of the note("md/canvas") file. e.g., ${filename}_Attachments .',
"settings_pasted_image_file_name": "Pasted Image Name",
"settings_pasted_image_file_name_desc": '"Pasted Image" file name, using the variable ${notename} to get name of the note("md/canvas"), using the variable ${datetime} to get datetime. e.g., ${notename}-${datetime}) .',
"settings_datetime_format": "${datetime} Format",
"settings_datetime_format_desc": "Format for ${datetime} (use moment.js format). e.g., YYYYMMDDHHmmssSSS .",
"settings_hide_folder": "Hide attachment folder",
"settings_aero_folder": "Aero attachment folder",
"settings_auto_rename_folder": "Automatically rename attachment folder",
"settings_auto_rename_folder_desc": 'When renaming note("md/canvas"), automatically rename attachment folder if folder name contains "${filename}".',
"settings_auto_rename_files": "Automatically rename attachment files",
"settings_auto_rename_files_desc": 'When renaming note("md/canvas"), automatically rename attachment files if file name contains "${notename}".',
"settings_auto_delete_folder": "Automatically delete attachment folder",
"settings_auto_delete_folder_desc": 'When deleting note("md/canvas"), automatically delete attachment folder if folder name contains "${filename}".',
"command_toggle_attachment_folder_visibility": "Toggle visibility of attachment folder",
"status_attachment_folder_visibility": "Attachment folder are hidden.",
"command_localization_remote_attachments": "Download remote images",
"command_localization_remote_attachments_success": "download success.",
"command_localization_remote_attachments_failure": "download failure."
};
// src/lang/index.ts
var lang = {
en: en_default,
zh: zh_default,
get(key, ...args) {
const language = window.localStorage.getItem("language") || "en";
const _lang = this[language] || en_default;
let text = _lang[key] || key;
if (args) {
for (let i = 0; i < args.length; i++) {
text = text.replace(new RegExp(`\\{\\{${i}\\}\\}`, "g"), args[i]);
}
}
return text;
}
};
// src/SettingTab.ts
var SettingTab = class extends import_obsidian2.PluginSettingTab {
constructor(app, plugin) {
super(app, plugin);
this.plugin = plugin;
}
display() {
const { containerEl } = this;
containerEl.empty();
new import_obsidian2.Setting(containerEl).setName(lang.get("settings_folder_name")).setDesc(lang.get("settings_folder_name_desc")).addText((text) => text.setPlaceholder(DEFAULT_SETTINGS.folderName).setValue(this.plugin.settings.folderName).onChange(async (value) => {
value = (0, import_obsidian2.normalizePath)(value);
this.plugin.settings.folderName = value;
await this.plugin.saveSettings();
}));
new import_obsidian2.Setting(containerEl).setName(lang.get("settings_pasted_image_file_name")).setDesc(lang.get("settings_pasted_image_file_name_desc")).addText((text) => text.setPlaceholder(DEFAULT_SETTINGS.pastedImageName).setValue(this.plugin.settings.pastedImageName).onChange(async (value) => {
this.plugin.settings.pastedImageName = value;
await this.plugin.saveSettings();
}));
new import_obsidian2.Setting(containerEl).setName(lang.get("settings_datetime_format")).setDesc(lang.get("settings_datetime_format_desc")).addMomentFormat((text) => text.setDefaultFormat(DEFAULT_SETTINGS.datetimeFormat).setValue(this.plugin.settings.datetimeFormat).onChange(async (value) => {
this.plugin.settings.datetimeFormat = value;
await this.plugin.saveSettings();
}));
new import_obsidian2.Setting(containerEl).setName(lang.get("settings_hide_folder")).addToggle((toggle) => toggle.setValue(this.plugin.settings.hideFolder).onChange(async (value) => {
this.plugin.settings.hideFolder = value;
await this.plugin.saveSettings();
await this.plugin.hideFolder.refresh();
}));
new import_obsidian2.Setting(containerEl).setName(lang.get("settings_aero_folder")).addToggle((toggle) => toggle.setValue(this.plugin.settings.aeroFolder).onChange(async (value) => {
this.plugin.settings.aeroFolder = value;
await this.plugin.saveSettings();
await this.plugin.hideFolder.refresh();
}));
new import_obsidian2.Setting(containerEl).setName(lang.get("settings_auto_rename_folder")).setDesc(lang.get("settings_auto_rename_folder_desc")).addToggle((toggle) => toggle.setValue(this.plugin.settings.autoRenameFolder).onChange(async (value) => {
this.plugin.settings.autoRenameFolder = value;
await this.plugin.saveSettings();
}));
if (this.plugin.settings.autoRenameFolder)
new import_obsidian2.Setting(containerEl).setName(lang.get("settings_auto_rename_files")).setDesc(lang.get("settings_auto_rename_files_desc")).addToggle((toggle) => toggle.setValue(this.plugin.settings.autoRenameFiles).onChange(async (value) => {
this.plugin.settings.autoRenameFiles = value;
await this.plugin.saveSettings();
}));
new import_obsidian2.Setting(containerEl).setName(lang.get("settings_auto_delete_folder")).setDesc(lang.get("settings_auto_delete_folder_desc")).addToggle((toggle) => toggle.setValue(this.plugin.settings.autoDeleteFolder).onChange(async (value) => {
this.plugin.settings.autoDeleteFolder = value;
await this.plugin.saveSettings();
}));
}
};
// src/components/VaultAttachmentConfiguration.ts
var VaultAttachmentConfiguration = class {
constructor(vault) {
this.key = "attachmentFolderPath";
this.key2 = "newLinkFormat";
this.vault = vault;
}
backup() {
this._value = this.vault.getConfig(this.key);
this._value2 = this.vault.getConfig(this.key2);
if (this._value2 !== "relative" && this._value2 !== "shortest") {
this.vault.setConfig(this.key2, "relative");
}
}
update(value) {
this.vault.setConfig(this.key, value);
}
restore() {
this.vault.setConfig(this.key, this._value);
this.vault.setConfig(this.key2, this._value2);
}
};
// src/handler/FileOpenHandler.ts
var FileOpenHandler = class {
static build(plugin) {
const handler = new FileOpenHandler(plugin);
return handler.handle.bind(handler);
}
constructor(plugin) {
this.plugin = plugin;
this.vaultAttachmentConfiguration = plugin.vaultAttachmentConfiguration;
}
async handle(file) {
if (file == null) {
return;
}
if (file.extension !== "md" && file.extension !== "canvas") {
return;
}
this.vaultAttachmentConfiguration.update(buildFolderName(this.plugin.settings, file.name, file.basename));
}
};
// src/handler/DeleteHandler.ts
var Path = __toESM(require("path/posix"));
var DeleteHandler = class {
static build(plugin) {
const handler = new DeleteHandler(plugin);
return handler.handle.bind(handler);
}
constructor(plugin) {
this.vault = plugin.app.vault;
this.plugin = plugin;
this.adapter = plugin.adapter;
this.vaultAttachmentConfiguration = plugin.vaultAttachmentConfiguration;
}
async handle(file) {
if (file.extension !== "md" && file.extension !== "canvas") {
return;
}
if (!containsFilenameOrNotename(this.plugin.settings) || !this.plugin.settings.autoDeleteFolder) {
return;
}
const folderPath = Path.join(Path.dirname(file.path), buildFolderName(this.plugin.settings, file.name, file.basename));
if (await this.adapter.exists(folderPath)) {
const trashOption = this.vault.getConfig("trashOption");
if (trashOption === "system") {
await this.adapter.trashSystem(folderPath);
} else if (trashOption === "local") {
await this.adapter.trashLocal(folderPath);
} else {
await this.adapter.remove(folderPath);
}
}
}
};
// src/handler/RenameHandler.ts
var import_obsidian3 = require("obsidian");
var Path2 = __toESM(require("path/posix"));
var RenameHandler = class {
static build(plugin) {
const handler = new RenameHandler(plugin);
return handler.handle.bind(handler);
}
constructor(plugin) {
this.vault = plugin.app.vault;
this.plugin = plugin;
this.adapter = plugin.adapter;
this.fileManager = plugin.app.fileManager;
this.vaultAttachmentConfiguration = plugin.vaultAttachmentConfiguration;
}
async handle(newFile, oldFilePath) {
if (!(newFile instanceof import_obsidian3.TFile)) {
return;
}
if (newFile.extension !== "md" && newFile.extension !== "canvas") {
return;
}
if (!containsFilenameOrNotename(this.plugin.settings) || !this.plugin.settings.autoRenameFolder) {
return;
}
const newFolderName = buildFolderName(this.plugin.settings, newFile.name, newFile.basename);
this.vaultAttachmentConfiguration.update(newFolderName);
const newFolderPath = (0, import_obsidian3.normalizePath)(Path2.join(Path2.dirname(newFile.path), newFolderName));
const oldFileParsedPath = Path2.parse(oldFilePath);
const oldFolderPath = (0, import_obsidian3.normalizePath)(Path2.join(Path2.dirname(oldFilePath), buildFolderName(this.plugin.settings, oldFileParsedPath.base, oldFileParsedPath.name)));
await this._renameFolder(oldFolderPath, newFolderPath);
if (!this.plugin.settings.autoRenameFiles) {
return;
}
await this._renameFiles(newFolderPath, newFile.basename, Path2.basename(oldFilePath, "." + newFile.extension));
}
async _renameFolder(oldFolderPath, newFolderPath) {
if (!await this.adapter.exists(oldFolderPath) || oldFolderPath === newFolderPath) {
return;
}
const oldFolder = this.vault.getAbstractFileByPath(oldFolderPath);
if (oldFolder == null) {
return;
}
const newFolderParentPath = Path2.dirname(newFolderPath);
if (!await this.adapter.exists(newFolderParentPath)) {
await this.vault.createFolder(newFolderParentPath);
}
await this.fileManager.renameFile(oldFolder, newFolderPath);
const oldFolderParentPath = Path2.dirname(oldFolderPath);
const oldFolderParentListedFiles = await this.adapter.list(oldFolderParentPath);
if (oldFolderParentListedFiles.folders.length === 0 && oldFolderParentListedFiles.files.length === 0) {
await this.adapter.rmdir(oldFolderParentPath, true);
}
}
async _renameFiles(newFolderPath, newFileName, oldFileName) {
const attachmentFiles = (await this.adapter.list(newFolderPath)).files;
for (const file of attachmentFiles) {
let attachmentFileName = Path2.basename(file);
if (!attachmentFileName.contains(oldFileName)) {
continue;
}
attachmentFileName = attachmentFileName.replace(oldFileName, newFileName);
const newFilePath = (0, import_obsidian3.normalizePath)(Path2.join(newFolderPath, attachmentFileName));
const attachmentFile = this.vault.getAbstractFileByPath(file);
if (attachmentFile == null) {
continue;
}
await this.fileManager.renameFile(attachmentFile, newFilePath);
}
}
};
// src/components/HideFolder.ts
var import_obsidian4 = require("obsidian");
var HideFolder = class {
constructor(plugin) {
this.plugin = plugin;
}
load() {
this.ribbonIconButton = this.plugin.addRibbonIcon(
this.plugin.settings.hideFolder ? "eye-off" : "eye",
lang.get("command_toggle_attachment_folder_visibility"),
(evt) => {
this.plugin.settings.hideFolder = !this.plugin.settings.hideFolder;
this.plugin.saveSettings();
this.refresh();
}
);
this.statusBarItem = this.plugin.addStatusBarItem();
this.statusBarItem.setText(this.plugin.settings.hideFolder ? lang.get("status_attachment_folder_visibility") : "");
this.plugin.addCommand({
id: "toggle-attachment-folder_visibility",
name: lang.get("command_toggle_attachment_folder_visibility"),
callback: () => {
this.plugin.settings.hideFolder = !this.plugin.settings.hideFolder;
this.plugin.saveSettings();
this.refresh();
}
});
this.mutationObserver = new MutationObserver((mutationRecord) => {
mutationRecord.forEach((record) => {
var _a, _b;
if ((_b = (_a = record.target) == null ? void 0 : _a.parentElement) == null ? void 0 : _b.classList.contains("nav-folder")) {
this.refreshFolders();
}
});
});
this.mutationObserver.observe(window.document, { childList: true, subtree: true });
}
async refresh() {
(0, import_obsidian4.setIcon)(this.ribbonIconButton, this.plugin.settings.hideFolder ? "eye-off" : "eye");
this.statusBarItem.setText(this.plugin.settings.hideFolder ? lang.get("status_attachment_folder_visibility") : "");
await this.refreshFolders();
}
async refreshFolders() {
const filter = buildFolderRegExp(this.plugin.settings);
const folders = document.querySelectorAll(".nav-folder-title-content");
folders.forEach((folder) => {
var _a, _b, _c, _d, _e, _f, _g, _h;
const folderName = folder.innerHTML;
if (filter.test(folderName)) {
if (this.plugin.settings.hideFolder) {
(_b = (_a = folder.parentElement) == null ? void 0 : _a.parentElement) == null ? void 0 : _b.addClass("hide-attachment-folder");
} else {
(_d = (_c = folder.parentElement) == null ? void 0 : _c.parentElement) == null ? void 0 : _d.removeClass("hide-attachment-folder");
}
if (this.plugin.settings.aeroFolder) {
(_f = (_e = folder.parentElement) == null ? void 0 : _e.parentElement) == null ? void 0 : _f.addClass("aero-attachment-folder");
} else {
(_h = (_g = folder.parentElement) == null ? void 0 : _g.parentElement) == null ? void 0 : _h.removeClass("aero-attachment-folder");
}
}
});
}
unload() {
this.mutationObserver.disconnect();
}
};
// src/handler/CreateHandler.ts
var import_obsidian5 = require("obsidian");
var Path3 = __toESM(require("path/posix"));
var CreateHandler = class {
static build(plugin) {
const handler = new CreateHandler(plugin);
return handler.handle.bind(handler);
}
constructor(plugin) {
this.vault = plugin.app.vault;
this.plugin = plugin;
this.workspace = plugin.app.workspace;
this.fileManager = plugin.app.fileManager;
this.vaultAttachmentConfiguration = plugin.vaultAttachmentConfiguration;
}
async handle(file) {
if (!(file instanceof import_obsidian5.TFile)) {
return;
}
if (!file.name.startsWith("Pasted image ")) {
return;
}
const activeView = this.workspace.getActiveViewOfType(import_obsidian5.TextFileView);
const activeFile = activeView == null ? void 0 : activeView.file;
if (!activeFile) {
return;
}
if (activeFile.extension !== "md" && activeFile.extension !== "canvas") {
return;
}
const folderPath = Path3.join(Path3.dirname(activeFile.path), buildFolderName(this.plugin.settings, activeFile.name, activeFile.basename));
if (!file.path.startsWith(folderPath)) {
return;
}
const imagePath = (0, import_obsidian5.normalizePath)(Path3.join(folderPath, buildPastedImageName(this.plugin.settings, activeFile.basename) + "." + file.extension));
if (activeFile.extension === "md") {
this._rename4MD(file, imagePath, activeView, activeFile);
}
if (activeFile.extension === "canvas") {
this._rename4Canvas(file, imagePath, activeView);
}
}
async _rename4MD(file, newPath, activeView, activeFile) {
await this.fileManager.renameFile(file, file.path);
const oldLinkText = this.fileManager.generateMarkdownLink(file, activeFile.path);
await this.fileManager.renameFile(file, newPath);
const newLinkText = this.fileManager.generateMarkdownLink(file, activeFile.path);
let content = activeView.getViewData();
content = content.replace(oldLinkText, newLinkText);
activeView.setViewData(content, false);
}
async _rename4Canvas(file, newPath, activeView) {
const oldPath = file.path;
await this.fileManager.renameFile(file, newPath);
let content = activeView.getViewData();
content = content.replace(`/(file\\s*\\:\\s*\\")${oldPath}(\\")/g`, `$1${newPath}$2`);
activeView.setViewData(content, false);
}
};
// src/components/LocalizationAttachments.ts
var import_obsidian6 = require("obsidian");
var Path4 = __toESM(require("path/posix"));
var IMAGE_EXTENSION = {
"image/apng": "apng",
"image/avif": "avif",
"image/bmp": "bmp",
"image/gif": "gif",
"image/x-icon": "ico",
"image/jpeg": "jpg",
"image/png": "png",
"image/svg+xml": "svg",
"image/tiff": "tif",
"image/webp": "webp"
};
var LocalizationAttachments = class {
constructor(plugin) {
this.vault = plugin.app.vault;
this.plugin = plugin;
this.adapter = plugin.adapter;
this.workspace = plugin.app.workspace;
this.fileManager = plugin.app.fileManager;
}
load() {
this.plugin.addCommand({
id: "localization-remote-attachments",
name: lang.get("command_localization_remote_attachments"),
callback: () => {
this.processActivePage();
}
});
}
async processActivePage() {
const activeView = this.workspace.getActiveViewOfType(import_obsidian6.TextFileView);
const activeFile = activeView == null ? void 0 : activeView.file;
if (!activeFile) {
return;
}
const folderPath = Path4.join(Path4.dirname(activeFile.path), buildFolderName(this.plugin.settings, activeFile.name, activeFile.basename));
if (!await this.adapter.exists(folderPath)) {
await this.vault.createFolder(folderPath);
}
if (activeFile.extension === "md") {
await this._process4MD(activeView, activeFile, folderPath);
return;
}
if (activeFile.extension === "canvas") {
await this._process4Canvas(activeView, activeFile, folderPath);
return;
}
}
async _process4MD(activeView, activeFile, folderPath) {
const content = activeView.getViewData();
const regex = /!\[(?<anchor>.*?)\]\((?<link>.+?)\)/g;
const promises = [];
let timeseed = (0, import_obsidian6.moment)();
content.replace(regex, (match, anchor, link) => {
timeseed = timeseed.add(1, "m");
const imagePath = Path4.join(folderPath, buildPastedImageNameWithMoment(this.plugin.settings, timeseed, activeFile.basename));
promises.push(this._download4MD(activeFile, match, link, imagePath));
return match;
});
const list = await Promise.all(promises);
const newContent = content.replace(regex, (match) => {
const newLink = list.shift();
return newLink ? newLink : match;
});
if (content != newContent) {
activeView.setViewData(newContent, false);
}
}
async _download4MD(activeFile, match, link, imagePath) {
if (!this._isUrl(link)) {
return match;
}
const file = await this._download(link, imagePath);
if (!(file instanceof import_obsidian6.TFile)) {
return match;
}
return this.fileManager.generateMarkdownLink(file, activeFile.path);
}
async _process4Canvas(activeView, activeFile, folderPath) {
const content = JSON.parse(activeView.getViewData());
const promises = [];
let timeseed = (0, import_obsidian6.moment)();
content.nodes.forEach((node) => {
timeseed = timeseed.add(1, "m");
const imagePath = Path4.join(folderPath, buildPastedImageNameWithMoment(this.plugin.settings, timeseed, activeFile.basename));
promises.push(this._download4Canvas(node, imagePath));
});
await Promise.all(promises);
activeView.setViewData(JSON.stringify(content, null, " "), false);
}
async _download4Canvas(node, imagePath) {
if (node.type !== "link" || !node.url) {
return;
}
const file = await this._download(node.url, imagePath);
if (!(file instanceof import_obsidian6.TFile)) {
return;
}
node.type = "file";
delete node.url;
node.file = file.path;
}
_isUrl(url) {
try {
return Boolean(new URL(url));
} catch (_) {
return false;
}
}
async _download(url, imagePath) {
return await (0, import_obsidian6.requestUrl)(url).then(async (response) => {
if (200 != response.status) {
new import_obsidian6.Notice(`${url} ${lang.get("command_localization_remote_attachments_failure")}`);
return false;
}
const contentType = response.headers["content-type"];
const extension = IMAGE_EXTENSION[contentType];
if (!extension) {
return false;
}
const file = await this.vault.createBinary((0, import_obsidian6.normalizePath)(imagePath + "." + extension), response.arrayBuffer);
new import_obsidian6.Notice(`${url} ${lang.get("command_localization_remote_attachments_success")}`);
return file;
});
}
};
// src/Plugin.ts
var Plugin = class extends import_obsidian7.Plugin {
async onload() {
this.adapter = this.app.vault.adapter;
this.vaultAttachmentConfiguration = new VaultAttachmentConfiguration(this.app.vault);
this.vaultAttachmentConfiguration.backup();
this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
this.addSettingTab(new SettingTab(this.app, this));
this.registerEvent(this.app.workspace.on("file-open", FileOpenHandler.build(this)));
this.registerEvent(this.app.vault.on("create", CreateHandler.build(this)));
this.registerEvent(this.app.vault.on("rename", RenameHandler.build(this)));
this.registerEvent(this.app.vault.on("delete", DeleteHandler.build(this)));
this.hideFolder = new HideFolder(this);
this.hideFolder.load();
this.localizationAttachments = new LocalizationAttachments(this);
this.localizationAttachments.load();
}
onunload() {
this.vaultAttachmentConfiguration.restore();
this.hideFolder.unload();
}
async saveSettings() {
await this.saveData(this.settings);
}
};
// main.ts
var main_default = Plugin;

@ -0,0 +1,10 @@
{
"id": "attachment-manager",
"name": "Attachment Manager",
"version": "1.2.2",
"minAppVersion": "0.12.17",
"description": "Attachment folder name binding note name, automatically rename, automatically delete, show/hide.\n附件文件夹名称绑定笔记名、自动重命名、自动删除、显示/隐藏。",
"author": "chenfeicqq",
"authorUrl": "https://github.com/chenfeicqq",
"isDesktopOnly": true
}

@ -0,0 +1,8 @@
.nav-folder.aero-attachment-folder{
opacity: 0.2;
}
.nav-folder.hide-attachment-folder,
.nav-folder.hide-attachment-folder *{
visibility: hidden;
height: 0 !important;
}

@ -0,0 +1,58 @@
{
"commitMessage": "[obsidian] [manual] vault backup: {{date}}",
"commitDateFormat": "YYYY-MM-DD HH:mm:ss",
"autoSaveInterval": 1,
"autoPushInterval": 0,
"autoPullInterval": 0,
"autoPullOnBoot": true,
"disablePush": false,
"pullBeforePush": true,
"disablePopups": false,
"disablePopupsForNoChanges": false,
"listChangedFilesInMessageBody": false,
"showStatusBar": true,
"updateSubmodules": false,
"syncMethod": "merge",
"customMessageOnAutoBackup": false,
"autoBackupAfterFileChange": true,
"treeStructure": false,
"refreshSourceControl": true,
"basePath": "",
"differentIntervalCommitAndPush": false,
"changedFilesInStatusBar": false,
"showedMobileNotice": true,
"refreshSourceControlTimer": 7000,
"showBranchStatusBar": true,
"setLastSaveToLastCommit": false,
"submoduleRecurseCheckout": false,
"gitDir": "",
"showFileMenu": true,
"authorInHistoryView": "hide",
"dateInHistoryView": false,
"lineAuthor": {
"show": false,
"followMovement": "inactive",
"authorDisplay": "initials",
"showCommitHash": false,
"dateTimeFormatOptions": "date",
"dateTimeFormatCustomString": "YYYY-MM-DD HH:mm",
"dateTimeTimezone": "viewer-local",
"coloringMaxAge": "1y",
"colorNew": {
"r": 255,
"g": 150,
"b": 150
},
"colorOld": {
"r": 120,
"g": 160,
"b": 255
},
"textColorCss": "var(--text-muted)",
"ignoreWhitespace": false,
"gutterSpacingFallbackLength": 5,
"lastShownAuthorDisplay": "initials",
"lastShownDateTimeFormatOptions": "date"
},
"autoCommitMessage": "[obsidian] [auto] vault backup: {{date}}"
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,9 @@
{
"id": "obsidian-git",
"name": "Git",
"description": "Backup your vault with Git.",
"isDesktopOnly": false,
"fundingUrl": "https://ko-fi.com/vinzent",
"js": "main.js",
"version": "2.24.2"
}

@ -0,0 +1,558 @@
@keyframes loading {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.workspace-leaf-content[data-type="git-view"] .button-border {
border: 2px solid var(--interactive-accent);
border-radius: var(--radius-s);
}
.workspace-leaf-content[data-type="git-view"] .view-content {
padding: 0;
}
.workspace-leaf-content[data-type="git-history-view"] .view-content {
padding: 0;
}
.loading > svg {
animation: 2s linear infinite loading;
transform-origin: 50% 50%;
display: inline-block;
}
.obsidian-git-center {
margin: auto;
text-align: center;
width: 50%;
}
.obsidian-git-textarea {
display: block;
margin-left: auto;
margin-right: auto;
}
.obsidian-git-center-button {
display: block;
margin: 20px auto;
}
.tooltip.mod-left {
overflow-wrap: break-word;
}
.tooltip.mod-right {
overflow-wrap: break-word;
}
.git-tools {
display: flex;
margin-left: auto;
}
.git-tools .type {
padding-left: var(--size-2-1);
display: flex;
align-items: center;
justify-content: center;
width: 11px;
}
.git-tools .type[data-type="M"] {
color: orange;
}
.git-tools .type[data-type="D"] {
color: red;
}
.git-tools .buttons {
display: flex;
}
.git-tools .buttons > * {
padding: 0 0;
height: auto;
}
.git-author {
color: var(--text-accent);
}
.git-date {
color: var(--text-accent);
}
.git-ref {
color: var(--text-accent);
}
.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);
font-family: var(--font-monospace);
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;
color: #399839;
padding: 2px;
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;
color: #c33;
margin-left: 1px;
padding: 2px;
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;
align-items: center;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
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;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
border: 1px solid var(--background-modifier-border);
border-radius: 3px;
cursor: pointer;
display: none;
font-size: 12px;
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;
margin-right: -4px;
overflow-x: scroll;
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;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
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;
display: inline-block;
padding: 0;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
vertical-align: middle;
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 {
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 {
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,
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line ins {
border-radius: 0.2em;
display: inline-block;
margin-top: -1px;
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 {
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 {
background-color: #1d921996;
text-align: left;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line-prefix {
word-wrap: normal;
background: none;
display: inline;
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;
box-sizing: border-box;
overflow: hidden;
padding: 0 0.5em;
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);
border-width: 0 1px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: var(--text-muted);
cursor: pointer;
display: inline-block;
position: absolute;
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);
border-width: 0 1px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: var(--text-muted);
cursor: pointer;
display: inline-block;
overflow: hidden;
padding: 0 0.5em;
position: absolute;
text-align: right;
text-overflow: ellipsis;
width: 4em;
}
.workspace-leaf-content[data-type="diff-view"] .d2h-diff-tbody tr {
position: relative;
}
.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,
.workspace-leaf-content[data-type="diff-view"] .d2h-emptyplaceholder {
-webkit-user-select: none;
-moz-user-select: none;
-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 {
background-color: #fdf2d0;
}
.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 {
background-color: #ded;
}
.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 {
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 {
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 {
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;
display: -ms-flexbox;
display: flex;
font-size: 10px;
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;
}
/* ====================== Line Authoring Information ====================== */
.cm-gutterElement.obs-git-blame-gutter {
/* Add background color to spacing inbetween and around the gutter for better aesthetics */
border-width: 0px 2px 0.2px 2px;
border-style: solid;
border-color: var(--background-secondary);
background-color: var(--background-secondary);
}
.cm-gutterElement.obs-git-blame-gutter > div,
.line-author-settings-preview {
/* delegate text color to settings */
color: var(--obs-git-gutter-text);
font-family: monospace;
height: 100%; /* ensure, that age-based background color occupies entire parent */
text-align: right;
padding: 0px 6px 0px 6px;
white-space: pre; /* Keep spaces and do not collapse them. */
}
@media(max-width:800px){
/* hide git blame gutter not to superpose text */
.cm-gutterElement.obs-git-blame-gutter {
display: none;
}
}

@ -0,0 +1,246 @@
{
"main": {
"id": "fcc39aa9d18a64f0",
"type": "split",
"children": [
{
"id": "d63f0ebb65e64941",
"type": "tabs",
"children": [
{
"id": "f96745f4c9535c25",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "0便签/未命名.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "未命名"
}
},
{
"id": "d812f0afb0fc584b",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "0便签/未命名.md",
"mode": "preview",
"source": false
},
"icon": "lucide-file",
"title": "未命名"
}
}
]
}
],
"direction": "vertical"
},
"left": {
"id": "91f39ce006be5288",
"type": "split",
"children": [
{
"id": "766c9d245cfdf550",
"type": "tabs",
"children": [
{
"id": "0c044a8a83387bf4",
"type": "leaf",
"state": {
"type": "file-explorer",
"state": {
"sortOrder": "alphabetical",
"autoReveal": false
},
"icon": "lucide-folder-closed",
"title": "文件列表"
}
},
{
"id": "8887934dc6d8261c",
"type": "leaf",
"state": {
"type": "search",
"state": {
"query": "",
"matchingCase": false,
"explainSearch": false,
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical"
},
"icon": "lucide-search",
"title": "搜索"
}
},
{
"id": "bffcaa34c3c0a105",
"type": "leaf",
"state": {
"type": "bookmarks",
"state": {},
"icon": "lucide-bookmark",
"title": "书签"
}
}
]
}
],
"direction": "horizontal",
"width": 221.49999618530273
},
"right": {
"id": "11f6d5783b354721",
"type": "split",
"children": [
{
"id": "4c072d28f14533f6",
"type": "tabs",
"children": [
{
"id": "7725292a79b70f4c",
"type": "leaf",
"state": {
"type": "backlink",
"state": {
"file": "项目/StackEdit.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
"showSearch": false,
"searchQuery": "",
"backlinkCollapsed": false,
"unlinkedCollapsed": true
},
"icon": "links-coming-in",
"title": "StackEdit 的反向链接列表"
}
},
{
"id": "ea1640f355358fe5",
"type": "leaf",
"state": {
"type": "outgoing-link",
"state": {
"file": "项目/StackEdit.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
},
"icon": "links-going-out",
"title": "StackEdit 的出链列表"
}
},
{
"id": "c71bcfa9f1f1f2e4",
"type": "leaf",
"state": {
"type": "tag",
"state": {
"sortOrder": "frequency",
"useHierarchy": true
},
"icon": "lucide-tags",
"title": "标签"
}
},
{
"id": "cd5d92f04555df5a",
"type": "leaf",
"state": {
"type": "outline",
"state": {
"file": "0便签/未命名.md",
"followCursor": false,
"showSearch": false,
"searchQuery": ""
},
"icon": "lucide-list",
"title": "未命名 的大纲"
}
},
{
"id": "41dc69d24f64472c",
"type": "leaf",
"state": {
"type": "git-view",
"state": {},
"icon": "git-pull-request",
"title": "Source Control"
}
}
],
"currentTab": 3
}
],
"direction": "horizontal",
"width": 280.5
},
"left-ribbon": {
"hiddenItems": {
"bases:创建新数据库": false,
"switcher:打开快速切换": false,
"graph:查看关系图谱": false,
"canvas:新建白板": false,
"daily-notes:打开/创建今天的日记": false,
"templates:插入模板": false,
"command-palette:打开命令面板": false,
"attachment-manager:切换附件文件夹的“显示/隐藏”": false
}
},
"active": "f96745f4c9535c25",
"lastOpenFiles": [
"0便签/0随手记.md",
"项目/StackEdit.md",
"0便签/未命名.md",
"android/Handler.md",
"android/Android事件分发.md",
"android/泛型.md",
"work_note/em/股票详情页底部tab.md",
"work_note/em/分时图.md",
"work_note/em/分时数据流经.png",
"work_note/em/storage/image-20220704111114834.png",
"web/javascript笔记.md",
"web/前端工具.md",
"未命名.canvas",
"local/tmp02.md",
"local/tmp.md",
"local/plan.md",
"local/未命名.canvas",
"kotlin/Kotlin.md",
"work_note/em.zip",
"kotlin/storage/image-20240130092905463.png",
"kotlin/Kotlin协程.md",
"点滴笔记/点滴拾遗202305.md",
"点滴笔记/2021-02.md",
"点滴笔记/2020-02.md",
"其他/开源协议.md",
"其他/交通.md",
"其他/storage/开源协议",
"其他/storage",
"其他/storage/开源协议/开源协议.png",
"local/img.md",
"其他/用户协议.md",
"其他/隐私政策.md",
"java/Java Date Pattern.md",
"img_note/Date_pattern.png",
"java/Java Date Pattern 1.md",
"local/Untitled.md",
"项目/storage/mall商城/dfac5662d0194.png",
"python/未命名.base",
"0便签/未命名 1.base",
"0便签/未命名.base",
"0便签",
"android/storage/android_Lifecycle/2aed5222780e1.svg",
"common/storage",
"kotlin",
"web",
"算法/storage/数学.md/20250428_104256945.png",
"算法/storage/数学.md/Pasted image 20250428104249.png",
"算法/storage/数据结构--堆.md/eed8a1acbfc154ab9733e6637f7fd9e1.png"
]
}
Loading…
Cancel
Save