This commit is contained in:
Oscar Plaisant
2024-05-14 10:51:40 +02:00
parent f71d6b0503
commit 66c143b7b3
164 changed files with 25026 additions and 13829 deletions
+17
View File
@@ -0,0 +1,17 @@
{
"defaultHide": true,
"selectorTag": "#",
"includeHighlighted": true,
"includeUnderlined": false,
"includeBolded": false,
"includeItalics": false,
"includeBracketed": false,
"includeCurlyBrackets": false,
"fixedClozeWidth": false,
"editorMenuAddCloze": true,
"editorMenuAddClozeWithHint": true,
"editorMenuRemoveCloze": true,
"hintStrategy": 0,
"hintCount": 2,
"hintPercentage": 0.2
}
+697
View File
@@ -0,0 +1,697 @@
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/main.ts
var main_exports = {};
__export(main_exports, {
default: () => ClozePlugin
});
module.exports = __toCommonJS(main_exports);
var import_obsidian3 = require("obsidian");
// src/lang/en.ts
var langs = {
add_cloze: "Create cloze",
add_cloze_with_hint: "Create cloze with hint",
remove_cloze: "Remove cloze",
toggle_cloze: "Toggle all clozes",
reveal_more_hint: "More hint",
setting_selector_tag: "Required tag",
setting_selector_tag_desc: "If you provide a tag here, the plugin will only activate on notes with that tag i.e. #cloze.",
setting_hide_by_default: "Hide by default",
setting_hide_by_default_desc: "Enable this setting, all clozes will be hidden by default when reading the page. \u{1F648}",
setting_auto_convert: "Auto Convert",
setting_highlight: "Highlighted text",
setting_highlight_desc: "Enable this setting, all ==highlighted texts== will be converted to cloze.",
setting_bold: "Bolded text",
setting_bold_desc: "Enable this setting, all **bolded texts** will be converted to cloze.",
setting_underline: "Underlined text",
setting_underline_desc: "Enable this setting, all <u>underlined texts</u> will be converted to cloze.",
setting_italics: "Italic text",
setting_italics_desc: "Enable this setting, all *italic texts* and _italic texts_ will be converted to cloze.",
setting_bracket: "Bracketed text",
setting_bracket_desc: "Enable this setting, all [bracketed texts] will be converted to cloze.",
setting_curly_bracket: "Curly bracketed text",
setting_curly_bracket_desc: "Enable this setting, all {text enclosed in curly brackets} will be converted to cloze.",
setting_editor_menu: "Editor menu",
setting_editor_menu_add_cloze: "Display add cloze button",
setting_editor_menu_add_cloze_with_hint: "Display add cloze with hint button",
setting_editor_menu_remove_cloze: "Display remove cloze button",
setting_custom_setting: "Custom settings",
setting_fixed_cloze_width: "Fixed cloze width",
setting_fixed_cloze_width_desc: "Enable this setting, clozes will have the same default width, which helps to ensure that the original text length is not revealed.",
setting_hint: "Hint",
setting_hint_strategy: "Hint strategy",
setting_hint_strategy_desc: "If you would like the cloze to automatically display the hint based on its content, you have two strategies to choose from: by text count or by text length percentage.",
setting_hint_by_count: "By count",
setting_hint_by_count_desc: "Set this setting, clozes that are in the hidden state will display the first n letters/characters as a hint.",
setting_hint_by_percentage: "By percentage",
setting_hint_by_percentage_desc: "Set this setting, clozes that are in the hidden state will display hint based on the percentage of the cloze content. For example, 20% of a cloze containing 10 letters would show 2 of its 1st letters.",
setting_contact: "Thank you for using Cloze! Any feedback is welcomed"
};
var en_default = langs;
// src/lang/zh.ts
var langs2 = {
add_cloze: "\u6DFB\u52A0\u586B\u7A7A",
add_cloze_with_hint: "\u6DFB\u52A0\u5E26\u63D0\u793A\u7684\u586B\u7A7A",
remove_cloze: "\u79FB\u9664\u586B\u7A7A",
toggle_cloze: "\u663E/\u9690\u6240\u6709\u586B\u7A7A",
reveal_more_hint: "\u66F4\u591A\u63D0\u793A",
setting_selector_tag: "\u4F5C\u7528\u6807\u7B7E",
setting_selector_tag_desc: "\u8BE5\u63D2\u4EF6\u5C06\u4EC5\u4F5C\u7528\u4E8E\u5E26\u6709\u8BE5\u6807\u7B7E\u7684\u7B14\u8BB0\u4E0A\uFF0C\u4E3A\u7A7A\u5219\u4F5C\u7528\u4E8E\u6240\u6709\u7B14\u8BB0 i.e. #cloze\u3002",
setting_hide_by_default: "\u9ED8\u8BA4\u9690\u85CF",
setting_hide_by_default_desc: "\u542F\u7528\u6B64\u8BBE\u7F6E\u540E\uFF0C\u6253\u5F00\u9875\u9762\u65F6\u6240\u6709\u586B\u7A7A\u5185\u5BB9\u5C06\u9ED8\u8BA4\u9690\u85CF\u3002\u{1F648}",
setting_auto_convert: "\u81EA\u52A8\u8F6C\u6362",
setting_highlight: "\u9AD8\u4EAE\u6587\u5B57",
setting_highlight_desc: "\u542F\u7528\u6B64\u8BBE\u7F6E\u540E\uFF0C\u6240\u6709==\u9AD8\u4EAE\u6587\u5B57==\u4E5F\u5C06\u8F6C\u6362\u4E3A\u586B\u7A7A\u3002",
setting_bold: "\u7C97\u4F53\u6587\u5B57",
setting_bold_desc: "\u542F\u7528\u6B64\u8BBE\u7F6E\u540E\uFF0C\u6240\u6709**\u7C97\u4F53\u6587\u5B57**\u4E5F\u5C06\u8F6C\u6362\u4E3A\u586B\u7A7A\u3002",
setting_underline: "\u4E0B\u5212\u7EBF\u6587\u5B57",
setting_underline_desc: "\u542F\u7528\u6B64\u8BBE\u7F6E\u540E\uFF0C\u6240\u6709<u>\u4E0B\u5212\u7EBF\u6587\u5B57</u>\u4E5F\u5C06\u8F6C\u6362\u4E3A\u586B\u7A7A\u3002",
setting_italics: "\u659C\u4F53\u6587\u5B57",
setting_italics_desc: "\u542F\u7528\u6B64\u8BBE\u7F6E\u540E\uFF0C\u6240\u6709<i>\u659C\u4F53\u6587\u5B57</i>\u4E5F\u5C06\u8F6C\u6362\u4E3A\u586B\u7A7A\u3002",
setting_bracket: "\u62EC\u53F7\u6587\u5B57",
setting_bracket_desc: "\u542F\u7528\u6B64\u8BBE\u7F6E\u540E\uFF0C\u6240\u6709[\u62EC\u53F7\u6587\u5B57]\u4E5F\u5C06\u8F6C\u6362\u4E3A\u586B\u7A7A\u3002",
setting_curly_bracket: "\u82B1\u62EC\u53F7\u6587\u5B57",
setting_curly_bracket_desc: "\u542F\u7528\u6B64\u8BBE\u7F6E\u540E\uFF0C\u6240\u6709{\u82B1\u62EC\u53F7\u6587\u5B57}\u4E5F\u5C06\u8F6C\u6362\u4E3A\u586B\u7A7A\u3002",
setting_editor_menu: "\u7F16\u8F91\u5668\u83DC\u5355",
setting_editor_menu_add_cloze: "\u663E\u793A\u6DFB\u52A0\u586B\u7A7A\u6309\u94AE",
setting_editor_menu_add_cloze_with_hint: "\u663E\u793A\u6DFB\u52A0\u5E26\u63D0\u793A\u7684\u586B\u7A7A\u6309\u94AE",
setting_editor_menu_remove_cloze: "\u663E\u793A\u79FB\u9664\u586B\u7A7A\u6309\u94AE",
setting_custom_setting: "\u81EA\u5B9A\u4E49\u8BBE\u7F6E",
setting_fixed_cloze_width: "\u56FA\u5B9A\u586B\u7A7A\u5BBD\u5EA6",
setting_fixed_cloze_width_desc: "\u542F\u7528\u6B64\u8BBE\u7F6E\u540E\uFF0C\u6240\u6709\u586B\u7A7A\u7684\u5BBD\u5EA6\u9ED8\u8BA4\u76F8\u540C\uFF08\u53EF\u907F\u514D\u900F\u9732\u539F\u6587\u5B57\u957F\u5EA6\uFF09\u3002",
setting_hint: "\u63D0\u793A",
setting_hint_strategy: "\u63D0\u793A\u7B56\u7565",
setting_hint_strategy_desc: "\u5982\u679C\u4F60\u5E0C\u671B\u586B\u7A7A\u9ED8\u8BA4\u5C55\u793A\u63D0\u793A\uFF0C\u53EF\u9009\u62E9\u81EA\u52A8\u63D0\u793A\u7B56\u7565\uFF1A\u9996\u5B57\u6BCD\u6216\u662F\u767E\u5206\u6BD4\u3002",
setting_hint_by_count: "\u63D0\u793A\u5B57\u6570",
setting_hint_by_count_desc: "\u586B\u7A7A\u5728\u9690\u85CF\u72B6\u6001\u4E0B\u4F1A\u5C55\u793A\u539F\u4F4D\u7684\u9996n\u4E2A\u5B57\u7B26\u3002",
setting_hint_by_percentage: "\u63D0\u793A\u767E\u5206\u6BD4",
setting_hint_by_percentage_desc: "\u586B\u7A7A\u5728\u9690\u85CF\u72B6\u6001\u4E0B\u4F1A\u5C55\u793A\u539F\u4F4D\u7684\u9996n%\u4E2A\u5B57\u7B26\u3002",
setting_contact: "\u8C22\u8C22\u4F60\u7684\u4F7F\u7528~ \u6B22\u8FCE\u53CD\u9988\uFF01\u6233\u8FD9\u91CC\uFF1A"
};
var zh_default = langs2;
// src/lang/index.ts
var langs3 = {
en: en_default,
zh: zh_default
};
var language = window.localStorage.getItem("language") || "en";
var lang_default = langs3[language] || en_default;
// src/settings/settingData.ts
var HINT_STRATEGY = {
none: 0,
count: 1,
percentage: 2
};
var DEFAULT_SETTINGS = {
defaultHide: true,
selectorTag: "#",
includeHighlighted: false,
includeUnderlined: false,
includeBolded: false,
includeItalics: false,
includeBracketed: false,
includeCurlyBrackets: false,
fixedClozeWidth: false,
editorMenuAddCloze: true,
editorMenuAddClozeWithHint: true,
editorMenuRemoveCloze: true,
hintStrategy: HINT_STRATEGY.none,
hintCount: 2,
hintPercentage: 0.2
// 20%
};
var settingData_default = DEFAULT_SETTINGS;
// src/settings/settingTab.ts
var import_obsidian = require("obsidian");
var SettingTab = class extends import_obsidian.PluginSettingTab {
constructor(app, plugin) {
super(app, plugin);
this.plugin = plugin;
}
display() {
const { containerEl } = this;
containerEl.empty();
containerEl.createEl("h1", { text: "Cloze" });
this.displayAutoConvert(containerEl);
this.displayCustomSetting(containerEl);
this.displayHintSetting(containerEl);
this.displayEditorMenuSetting(containerEl);
this.displayContact(containerEl);
}
displayAutoConvert(containerEl) {
containerEl.createEl("h2", { text: lang_default.setting_auto_convert });
new import_obsidian.Setting(containerEl).setName(lang_default.setting_highlight).setDesc(lang_default.setting_highlight_desc).addToggle((toggle) => toggle.setValue(this.plugin.settings.includeHighlighted).onChange((value) => {
this.plugin.settings.includeHighlighted = value;
this.plugin.saveSettings();
}));
new import_obsidian.Setting(containerEl).setName(lang_default.setting_bold).setDesc(lang_default.setting_bold_desc).addToggle((toggle) => toggle.setValue(this.plugin.settings.includeBolded).onChange((value) => {
this.plugin.settings.includeBolded = value;
this.plugin.saveSettings();
}));
new import_obsidian.Setting(containerEl).setName(lang_default.setting_underline).setDesc(lang_default.setting_underline_desc).addToggle((toggle) => toggle.setValue(this.plugin.settings.includeUnderlined).onChange((value) => {
this.plugin.settings.includeUnderlined = value;
this.plugin.saveSettings();
}));
new import_obsidian.Setting(containerEl).setName(lang_default.setting_italics).setDesc(lang_default.setting_italics_desc).addToggle((toggle) => toggle.setValue(this.plugin.settings.includeItalics).onChange((value) => {
this.plugin.settings.includeItalics = value;
this.plugin.saveSettings();
}));
new import_obsidian.Setting(containerEl).setName(lang_default.setting_bracket).setDesc(lang_default.setting_bracket_desc).addToggle((toggle) => toggle.setValue(this.plugin.settings.includeBracketed).onChange((value) => {
this.plugin.settings.includeBracketed = value;
this.plugin.saveSettings();
}));
new import_obsidian.Setting(containerEl).setName(lang_default.setting_curly_bracket).setDesc(lang_default.setting_curly_bracket_desc).addToggle((toggle) => toggle.setValue(this.plugin.settings.includeCurlyBrackets).onChange((value) => {
this.plugin.settings.includeCurlyBrackets = value;
this.plugin.saveSettings();
}));
}
displayCustomSetting(containerEl) {
containerEl.createEl("h2", { text: lang_default.setting_custom_setting });
new import_obsidian.Setting(containerEl).setName(lang_default.setting_selector_tag).setDesc(lang_default.setting_selector_tag_desc).addText((text) => text.setValue(this.plugin.settings.selectorTag).onChange(async (value) => {
this.plugin.settings.selectorTag = this.sanitizeTag(value);
await this.plugin.saveSettings();
}));
new import_obsidian.Setting(containerEl).setName(lang_default.setting_fixed_cloze_width).setDesc(lang_default.setting_fixed_cloze_width_desc).addToggle((toggle) => toggle.setValue(this.plugin.settings.fixedClozeWidth).onChange((value) => {
this.plugin.settings.fixedClozeWidth = value;
this.plugin.saveSettings();
}));
new import_obsidian.Setting(containerEl).setName(lang_default.setting_hide_by_default).setDesc(lang_default.setting_hide_by_default_desc).addToggle((toggle) => toggle.setValue(this.plugin.settings.defaultHide).onChange((value) => {
this.plugin.settings.defaultHide = value;
this.plugin.saveSettings();
}));
}
displayHintSetting(containerEl) {
const settingEl = containerEl.createEl("div");
settingEl.createEl("h2", { text: "Hint" });
new import_obsidian.Setting(settingEl).setName(lang_default.setting_hint_strategy).setDesc(lang_default.setting_hint_strategy_desc).addDropdown((comp) => {
comp.addOptions({ [HINT_STRATEGY.none]: "Off", [HINT_STRATEGY.count]: "By Count", [HINT_STRATEGY.percentage]: "By Percentage" });
comp.setValue(this.plugin.settings.hintStrategy.toString());
comp.onChange((val) => {
this.plugin.settings.hintStrategy = Number(val);
initHintStrategyVaule(Number(val));
this.plugin.saveSettings();
});
});
let hintStrategySetting;
const initHintStrategyVaule = (strategy) => {
var _a;
if (hintStrategySetting)
(_a = hintStrategySetting.settingEl.parentElement) == null ? void 0 : _a.removeChild(hintStrategySetting.settingEl);
switch (strategy) {
case HINT_STRATEGY.none:
break;
case HINT_STRATEGY.count:
hintStrategySetting = new import_obsidian.Setting(settingEl).setName(lang_default.setting_hint_by_count).setDesc(lang_default.setting_hint_by_count_desc).addText((text) => {
text.setValue(this.plugin.settings.hintCount.toString()).onChange(async (value) => {
const valueNumber = Number(value);
if (isNaN(valueNumber))
return;
this.plugin.settings.hintCount = valueNumber;
this.plugin.saveSettings();
});
});
break;
case HINT_STRATEGY.percentage:
hintStrategySetting = new import_obsidian.Setting(settingEl).setName(lang_default.setting_hint_by_percentage).setDesc(lang_default.setting_hint_by_percentage_desc).addText((text) => {
text.setValue(this.plugin.settings.hintPercentage * 100 + "%").onChange(async (value) => {
const matches = value.match(/^(\d+)%$/);
if (!matches)
return;
const valueNumber = Number(matches[1]) / 100;
if (isNaN(valueNumber))
return;
this.plugin.settings.hintPercentage = valueNumber;
this.plugin.saveSettings();
});
});
break;
}
};
initHintStrategyVaule(Number(this.plugin.settings.hintStrategy));
}
displayEditorMenuSetting(containerEl) {
containerEl.createEl("h2", { text: lang_default.setting_editor_menu });
new import_obsidian.Setting(containerEl).setName(lang_default.setting_editor_menu_add_cloze).addToggle((toggle) => toggle.setValue(this.plugin.settings.editorMenuAddCloze).onChange((value) => {
this.plugin.settings.editorMenuAddCloze = value;
this.plugin.saveSettings();
}));
new import_obsidian.Setting(containerEl).setName(lang_default.setting_editor_menu_add_cloze_with_hint).addToggle((toggle) => toggle.setValue(this.plugin.settings.editorMenuAddClozeWithHint).onChange((value) => {
this.plugin.settings.editorMenuAddClozeWithHint = value;
this.plugin.saveSettings();
}));
new import_obsidian.Setting(containerEl).setName(lang_default.setting_editor_menu_remove_cloze).addToggle((toggle) => toggle.setValue(this.plugin.settings.editorMenuRemoveCloze).onChange((value) => {
this.plugin.settings.editorMenuRemoveCloze = value;
this.plugin.saveSettings();
}));
}
displayContact(containerEl) {
containerEl.createEl("p", {
text: lang_default.setting_contact + " ",
cls: "setting-item-description"
}).createEl("a", {
text: "here",
href: "https://github.com/DearVikki/obsidian-cloze-plugin/issues"
});
}
// Check and clean up tags that are not (what I understand to be) well formed Obsidian tags.
sanitizeTag(tagInput) {
const allowedCharacters = /^[a-zA-Z0-9-_]+$/;
const tagBody = tagInput.startsWith("#") ? tagInput.slice(1) : tagInput;
if (allowedCharacters.test(tagBody)) {
return "#" + tagBody;
}
const sanitizedTagBody = tagBody.replace(/[^a-zA-Z0-9-_]/g, "_");
return "#" + sanitizedTagBody;
}
};
var settingTab_default = SettingTab;
// src/components/modal-hint.ts
var import_obsidian2 = require("obsidian");
var HintModal = class extends import_obsidian2.Modal {
constructor(app, clozedText, onSubmit) {
super(app);
this.clozedText = clozedText;
this.onSubmit = onSubmit;
}
onOpen() {
const { contentEl } = this;
contentEl.createEl("p", { text: "Clozed text: " + this.clozedText });
new import_obsidian2.Setting(contentEl).setClass("modal-hint-setting").setName("Hint text: ").addText((text) => text.onChange((value) => {
this.result = value;
}));
new import_obsidian2.Setting(contentEl).addButton((btn) => btn.setButtonText("Submit").setCta().onClick(() => {
this.close();
this.onSubmit(this.result);
}));
}
onClose() {
const { contentEl } = this;
contentEl.empty();
}
};
// src/const.ts
var ATTRS = {
hide: "data-cloze-hide",
hint: "data-cloze-hint",
content: "data-cloze-content"
};
var CLASSES = {
cloze: "cloze",
clozeContent: "cloze-content",
highlight: "cloze-highlight",
bold: "cloze-bold",
underline: "cloze-underline",
hint: "cloze-hint",
fixedWidth: "cloze-fixed-width"
};
// src/utils.ts
var utils = {
getClozeEl: (target) => {
return target.closest("." + CLASSES.cloze);
},
getClozeContentEl: (target) => {
return target.querySelector("." + CLASSES.clozeContent);
},
getClozeHintEl: (target) => {
return target.querySelector("." + CLASSES.hint);
},
getClozeContent: (clozeEl) => {
const $content = clozeEl.querySelector("." + CLASSES.clozeContent);
if ($content) {
return $content.textContent || "";
}
return "";
},
hasCustomHint: (clozeEl) => {
return !!clozeEl.getAttribute(ATTRS.hint);
},
getClozeCustomHint: (clozeEl) => {
return clozeEl.getAttribute(ATTRS.hint) || "";
},
getClozeCurrentHint: (clozeEl) => {
const $hint = clozeEl.querySelector("." + CLASSES.hint);
if ($hint) {
return $hint.textContent || "";
}
return "";
},
setClozeHint: (clozeEl, hint) => {
const $hint = utils.getClozeHintEl(clozeEl);
if (!$hint || hint === void 0)
return;
$hint.textContent = hint;
if ($hint.parentElement)
$hint.parentElement.title = hint;
},
isClozeHide: (clozeEl) => {
return !!clozeEl.getAttribute(ATTRS.hide);
}
};
var utils_default = utils;
// src/main.ts
var ClozePlugin = class extends import_obsidian3.Plugin {
constructor() {
super(...arguments);
this.isSourceHide = false;
this.isPreviewHide = true;
this.clozeSelector = () => {
const selectors = [".cloze-span"];
if (this.settings.includeHighlighted) {
selectors.push("mark");
selectors.push(".cm-highlight");
}
if (this.settings.includeUnderlined) {
selectors.push("u");
}
if (this.settings.includeBolded) {
selectors.push("strong");
selectors.push(".cm-strong");
}
if (this.settings.includeItalics) {
selectors.push("em");
selectors.push(".cm-em");
}
return selectors.join(", ");
};
this.transformBracketedText = (element) => {
const items = element.querySelectorAll("p, h1, h2, h3, h4, h5, li, td, th, code");
items.forEach((item) => {
item.innerHTML = item.innerHTML.replace(/\[(.*?)\]/g, '<span class="cloze-span">$1</span>');
});
};
this.transformCurlyBracketedText = (element) => {
const items = element.querySelectorAll("p, h1, h2, h3, h4, h5, li, td, th, code");
items.forEach((item) => {
item.innerHTML = item.innerHTML.replace(/\{(.*?)\}/g, '<span class="cloze-span">$1</span>');
});
};
this.renderCloze = ($cloze) => {
$cloze.classList.add(CLASSES.cloze);
$cloze.innerHTML = `<span class="cloze-hint"></span><span class="cloze-content">${$cloze.innerHTML}</span>`;
this.initHint($cloze);
};
this.initHint = ($cloze) => {
let hint = "";
if (utils_default.hasCustomHint($cloze)) {
hint = utils_default.getClozeCustomHint($cloze);
} else {
const textContent = utils_default.getClozeContent($cloze);
if (this.settings.hintStrategy === HINT_STRATEGY.count) {
hint = textContent.slice(0, this.settings.hintCount);
} else if (this.settings.hintStrategy === HINT_STRATEGY.percentage) {
hint = textContent.slice(0, Math.ceil(textContent.length * this.settings.hintPercentage));
}
}
utils_default.setClozeHint($cloze, hint);
};
// ----------- cloze interaction ------------
this.hideClozeContent = (target) => {
if (!target.getAttribute(ATTRS.hide)) {
target.setAttribute(ATTRS.hide, "true");
}
this.initHint(target);
};
this.showClozeContent = (target) => {
if (target.getAttribute(ATTRS.hide)) {
target.removeAttribute(ATTRS.hide);
}
};
this.addCloze = (editor, needHint) => {
const currentStr = editor.getSelection();
const content = currentStr.replace(/<span class="cloze-span">(.*?)<\/span>/g, "$1");
if (needHint) {
new HintModal(this.app, content, (hint) => {
const newStr = `<span class="cloze-span" data-cloze-hint="${hint}">` + content + "</span>";
editor.replaceSelection(newStr);
editor.blur();
}).open();
} else {
const newStr = '<span class="cloze-span">' + content + "</span>";
editor.replaceSelection(newStr);
editor.blur();
}
};
this.removeCloze = (editor) => {
const currentStr = editor.getSelection();
const newStr = currentStr.replace(/<span.*?class="cloze-span".*?>(.*?)<\/span>/g, "$1");
editor.replaceSelection(newStr);
};
this.revealMoreHint = ($cloze) => {
const currentHint = utils_default.getClozeCurrentHint($cloze);
const hintLength = currentHint.length + 3;
utils_default.setClozeHint($cloze, utils_default.getClozeContent($cloze).slice(0, hintLength));
};
}
async onload() {
console.log("load cloze plugin");
await this.loadSettings();
this.addSettingTab(new settingTab_default(this.app, this));
this.initRibbon();
this.initEditorMenu();
this.initCommand();
this.initMarkdownPostProcessor();
this.registerDomEvent(document, "click", (event) => {
if (this.isPreviewMode()) {
this.toggleHide(utils_default.getClozeEl(event.target));
}
});
this.registerDomEvent(document, "contextmenu", (event) => {
if (this.isPreviewMode()) {
this.onRightClick(event, utils_default.getClozeEl(event.target));
}
});
}
initRibbon() {
this.addRibbonIcon("fish", lang_default.toggle_cloze, (evt) => {
if (this.checkTags()) {
this.togglePageAllHide();
}
});
}
initEditorMenu() {
this.registerEvent(
this.app.workspace.on("editor-menu", (menu, editor) => {
const selection = editor.getSelection();
if (selection && this.checkTags()) {
if (this.settings.editorMenuAddCloze) {
menu.addItem((item) => {
item.setTitle(lang_default.add_cloze).onClick((e) => {
this.addCloze(editor);
});
});
}
if (this.settings.editorMenuAddClozeWithHint) {
menu.addItem((item) => {
item.setTitle(lang_default.add_cloze_with_hint).onClick((e) => {
this.addCloze(editor, true);
});
});
}
if (this.settings.editorMenuRemoveCloze) {
menu.addItem((item) => {
item.setTitle(lang_default.remove_cloze).onClick((e) => {
this.removeCloze(editor);
});
});
}
}
})
);
}
initCommand() {
this.addCommand({
id: "add-cloze",
name: lang_default.add_cloze,
icon: "fish",
editorCallback: (editor, ctx) => {
const selection = editor.getSelection();
if (selection && this.checkTags()) {
this.addCloze(editor);
}
}
});
this.addCommand({
id: "add-cloze-with-hint",
name: lang_default.add_cloze_with_hint,
icon: "fish-symbol",
editorCallback: (editor, ctx) => {
const selection = editor.getSelection();
if (selection && this.checkTags()) {
this.addCloze(editor, true);
}
}
});
this.addCommand({
id: "remove-cloze",
name: lang_default.remove_cloze,
icon: "fish-off",
editorCallback: (editor, ctx) => {
const selection = editor.getSelection();
if (selection && this.checkTags()) {
this.removeCloze(editor);
}
}
});
this.addCommand({
id: "toggle-cloze",
name: lang_default.toggle_cloze,
callback: () => {
if (this.checkTags()) {
this.togglePageAllHide();
}
}
});
}
initMarkdownPostProcessor() {
this.registerMarkdownPostProcessor((element, context) => {
if (!this.checkTags()) {
return;
}
if (this.settings.fixedClozeWidth) {
const containerEl = context.containerEl;
if (containerEl) {
containerEl.classList.add(CLASSES.fixedWidth);
} else {
new import_obsidian3.Notice("Cloze plugin: No containerEl.");
}
}
if (this.settings.includeBracketed) {
this.transformBracketedText(element);
}
if (this.settings.includeCurlyBrackets) {
this.transformCurlyBracketedText(element);
}
element.querySelectorAll(this.clozeSelector()).forEach(this.renderCloze);
this.toggleAllHide(element, this.isAllHide());
});
}
onRightClick(event, $cloze) {
if (!$cloze)
return;
if (!utils_default.isClozeHide($cloze))
return;
if (utils_default.hasCustomHint($cloze))
return;
const menu = new import_obsidian3.Menu();
menu.addItem(
(item) => item.setTitle(en_default.reveal_more_hint).setIcon("snail").onClick(() => {
this.revealMoreHint($cloze);
})
);
menu.showAtMouseEvent(event);
}
isPreviewMode() {
const view = this.app.workspace.getActiveViewOfType(import_obsidian3.MarkdownView);
if (view == null)
return true;
return view.getMode() === "preview";
}
isAllHide() {
return this.isPreviewMode() ? this.isPreviewHide : this.isSourceHide;
}
// Extract and verify tags - works in both preview and edit mode
checkTags() {
var _a;
if (this.settings.selectorTag === "" || this.settings.selectorTag === "#") {
return true;
}
const activeView = this.app.workspace.getActiveViewOfType(import_obsidian3.MarkdownView);
if (activeView) {
const { app, file } = activeView;
if (file) {
const cachedMetadata = app.metadataCache.getFileCache(file);
const tags = ((cachedMetadata == null ? void 0 : cachedMetadata.tags) || []).map((t) => t.tag);
const frontmatterTags = ((_a = cachedMetadata == null ? void 0 : cachedMetadata.frontmatter) == null ? void 0 : _a.tags) || [];
return [...frontmatterTags, ...tags].some((t) => {
if (!t.startsWith("#")) {
t = "#" + t;
}
return t.toLowerCase() === this.settings.selectorTag.toLowerCase();
});
}
}
return false;
}
async loadSettings() {
this.settings = Object.assign({}, settingData_default, await this.loadData());
this.isPreviewHide = this.settings.defaultHide;
}
async saveSettings() {
await this.saveData(this.settings);
this.isPreviewHide = this.settings.defaultHide;
}
toggleHide(target) {
if (!target)
return;
if (target.getAttribute(ATTRS.hide)) {
this.showClozeContent(target);
} else {
this.hideClozeContent(target);
}
}
toggleAllHide(dom = document, hide) {
if (dom && this.checkTags()) {
const marks = dom.querySelectorAll(this.clozeSelector());
if (hide) {
marks.forEach((mark) => {
this.hideClozeContent(mark);
});
} else {
marks.forEach((mark) => {
this.showClozeContent(mark);
});
}
}
}
togglePageAllHide() {
const mostRecentLeaf = this.app.workspace.getMostRecentLeaf();
if (!mostRecentLeaf)
return;
const leafContainer = mostRecentLeaf.containerEl;
if (!leafContainer)
return;
if (this.isPreviewMode()) {
const nodeContainers = leafContainer.querySelectorAll(".markdown-preview-view");
nodeContainers.forEach((nodeContainer) => {
this.toggleAllHide(nodeContainer, !this.isPreviewHide);
});
this.isPreviewHide = !this.isPreviewHide;
} else {
const nodeContainers = leafContainer.querySelectorAll(".markdown-source-view");
nodeContainers.forEach((nodeContainer) => {
this.toggleAllHide(nodeContainer, !this.isSourceHide);
});
this.isSourceHide = !this.isSourceHide;
}
}
};
+10
View File
@@ -0,0 +1,10 @@
{
"id": "cloze",
"name": "Cloze",
"version": "0.1.16",
"minAppVersion": "0.12.0",
"description": "Convert highlights, underlines, bolded texts or any selected texts into clozes.",
"author": "Vikki",
"authorUrl": "https://github.com/DearVikki",
"isDesktopOnly": false
}
+76
View File
@@ -0,0 +1,76 @@
/*
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.
*/
body {
--cloze-underline-width: 1px;
--cloze-underline-style: solid;
/*noinspection CssUnresolvedCustomProperty*/
--cloze-underline-color: var(--text-normal);
--cloze-fixed-width: 30px;
/*noinspection CssUnresolvedCustomProperty*/
--cloze-hint-color: var(--text-muted);
/*noinspection CssUnresolvedCustomProperty*/
--cloze-hint-font-size: var(--font-ui-smaller);
}
.cloze-span,
.cloze{
border-bottom: var(--cloze-underline-width) var(--cloze-underline-style) var(--cloze-underline-color) !important;
position: relative;
}
.cloze-span,
.cloze[data-cloze-hide=true]{
cursor: pointer;
}
[data-cloze-hide=true]:not(.cloze-hint) {
color: transparent !important;
text-shadow: none !important;
}
/* embedded segments */
[data-cloze-hide=true] .cloze-content,
[data-cloze-hide=true] mark,
[data-cloze-hide=true] u,
[data-cloze-hide=true] strong,
[data-cloze-hide=true] a {
color: transparent !important;
text-shadow: none !important;
pointer-events: none;
}
/* fixed cloze width */
.cloze-fixed-width .cloze[data-cloze-hide=true]:not(.cloze-hint) {
white-space: nowrap;
width: var(--cloze-fixed-width);
display: inline-block;
overflow: hidden;
}
/* cloze hint */
.cloze-hint {
color: var(--cloze-hint-color);
font-size: var(--cloze-hint-font-size);
text-shadow: none !important;
position: absolute;
left: 0;
top: 0;
width: max-content;
display: none;
pointer-events: none;
}
[data-cloze-hide=true] .cloze-hint {
display: block;
}
.modal-hint-setting input{
width: 100%;
}
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -1,8 +1,8 @@
{
"id": "darlal-switcher-plus",
"name": "Quick Switcher++",
"version": "4.0.0",
"minAppVersion": "1.5.3",
"version": "4.2.0",
"minAppVersion": "1.5.12",
"description": "Enhanced Quick Switcher, search open panels, and symbols.",
"author": "darlal",
"authorUrl": "https://github.com/darlal/obsidian-switcher-plus",
+3
View File
@@ -165,3 +165,6 @@
.qsp-headings-l4 {}
.qsp-headings-l5 {}
.qsp-headings-l6 {}
/* Usually the "plus" button button in the NavBar on mobile platforms */
.qsp-mobile-launcher-button {}
+5 -1
View File
@@ -17,6 +17,7 @@
"useExcalidrawExtension": true,
"cropPrefix": "cropped_",
"annotatePrefix": "annotated_",
"annotatePreserveSize": false,
"displaySVGInPreview": true,
"previewImageType": "SVGIMG",
"allowImageCache": true,
@@ -33,6 +34,8 @@
"defaultMode": "normal",
"defaultPenMode": "mobile",
"penModeCrosshairVisible": false,
"renderImageInMarkdownReadingMode": false,
"renderImageInMarkdownToPDF": false,
"allowPinchZoom": false,
"allowWheelZoom": false,
"zoomToFitOnOpen": true,
@@ -60,6 +63,7 @@
"exportWithTheme": true,
"exportWithBackground": true,
"exportPaddingSVG": 10,
"exportEmbedScene": false,
"keepInSync": false,
"autoexportSVG": false,
"autoexportPNG": false,
@@ -73607,7 +73611,7 @@
}
},
"defaultTrayMode": false,
"previousRelease": "2.1.1",
"previousRelease": "2.1.7",
"showReleaseNotes": true,
"showNewVersionNotification": true,
"latexBoilerplate": "\\color{blue}",
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,7 +1,7 @@
{
"id": "obsidian-excalidraw-plugin",
"name": "Excalidraw",
"version": "2.1.1",
"version": "2.1.7",
"minAppVersion": "1.1.6",
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
"author": "Zsolt Viczian",
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,5 +1,5 @@
{
"hideRibbon": true,
"hideRibbon": false,
"hideStatus": false,
"hideTabs": false,
"hideScroll": true,
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,7 +1,7 @@
{
"id": "obsidian-hover-editor",
"name": "Hover Editor",
"version": "0.11.17",
"version": "0.11.19",
"minAppVersion": "1.4.16",
"description": "Transform the Page Preview hover popover into a fully working editor instance",
"author": "NothingIsLost",
+9
View File
@@ -150,6 +150,15 @@ body {
width: 100%;
}
/*
Obsidian 1.6 sets a different background for non-root splits,
then uses primary as an override at root. Since hover editors
don't live in a root split, we have to copy the override:
*/
.popover.hover-editor .workspace-split .view-content {
background-color: var(--background-primary);
}
.popover.hover-editor {
min-height: unset;
max-height: unset;
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,7 +1,7 @@
{
"id": "obsidian-latex-suite",
"name": "Latex Suite",
"version": "1.9.1",
"version": "1.9.3",
"minAppVersion": "1.0.0",
"description": "Make typesetting LaTeX math as fast as handwriting through snippets, text expansion, and editor enhancements",
"author": "artisticat",
+26 -27
View File
@@ -93,16 +93,12 @@
}
.snippets-editor-validity-indicator.valid {
background-color: #7dc535;
background-color: var(--color-green);
visibility: visible;
}
.theme-dark .snippets-editor-validity-indicator.valid {
background-color: #588b24;
}
.snippets-editor-validity-indicator.invalid {
background-color: #ea5555;
background-color: var(--color-red);
visibility: visible;
}
@@ -115,6 +111,9 @@
border: none;
}
.search-input-container input.latex-suite-location-input-el {
width: initial;
}
/*
Snippet color classes.
@@ -124,36 +123,36 @@ Snippet color classes.
nesting multiple decorations. */
.latex-suite-snippet-placeholder {
border-width: 1px 0 1px 0;
border-style: solid;
border-radius: 2px;
background-color: var(--placeholder-bg);
outline: var(--placeholder-outline) solid 1px;
}
.latex-suite-snippet-placeholder-0, span.latex-suite-snippet-placeholder-0 span {
border-color: lightskyblue;
--placeholder-bg: #87cefa2e;
--placeholder-outline: #87cefa6e;
}
.theme-dark .latex-suite-snippet-placeholder-0, span.latex-suite-snippet-placeholder-0 span {
--placeholder-outline: #87cefa43;
}
.latex-suite-snippet-placeholder-1, span.latex-suite-snippet-placeholder-1 span {
border-color: orange;
--placeholder-bg: #ffa50033;
--placeholder-outline: #ffa5006b;
}
.theme-dark .latex-suite-snippet-placeholder-1, span.latex-suite-snippet-placeholder-1 span {
--placeholder-outline: #ffa5004d;
}
.latex-suite-snippet-placeholder-2, span.latex-suite-snippet-placeholder-2 span {
border-color: lime;
--placeholder-bg: #00ff0022;
--placeholder-outline: #00ff0060;
}
.latex-suite-snippet-placeholder-3, span.latex-suite-snippet-placeholder-3 span {
border-color: pink;
}
.latex-suite-snippet-placeholder-4, span.latex-suite-snippet-placeholder-4 span {
border-color: cornsilk;
}
.latex-suite-snippet-placeholder-5, span.latex-suite-snippet-placeholder-5 span {
border-color: magenta;
}
.latex-suite-snippet-placeholder-6, span.latex-suite-snippet-placeholder-6 span {
border-color: navajowhite;
.theme-dark .latex-suite-snippet-placeholder-2, span.latex-suite-snippet-placeholder-2 span {
--placeholder-outline: #00ff003d;
}
@@ -197,11 +196,11 @@ sup.cm-math, sub.cm-math {
/* Highlight brackets */
.theme-light .latex-suite-highlighted-bracket, .theme-light .latex-suite-highlighted-bracket [class^="latex-suite-color-bracket-"] {
background-color: hsl(var(--accent-h), var(--accent-s), var(--accent-l), 0.25);
background-color: hsl(var(--accent-h), var(--accent-s), 40%, 0.3);
}
.theme-dark .latex-suite-highlighted-bracket, .theme-dark .latex-suite-highlighted-bracket [class^="latex-suite-color-bracket-"] {
background-color: hsl(var(--accent-h), var(--accent-s), calc(var(--accent-l) - 7%), 0.3);
background-color: hsl(var(--accent-h), var(--accent-s), 70%, 0.6);
}
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -1,9 +1,9 @@
{
"id": "obsidian-markmind",
"name": "Markmind",
"version": "1.9.5",
"version": "1.9.7",
"minAppVersion": "0.9.12",
"description": "This is a mindmapoutline and pdf annotate tool for obsidian.",
"description": "This is a mindmap , outline tool for obsidian.",
"author": "Mark",
"authorUrl": "https://github.com/MarkMindCkm/obsidian-markmind",
"isDesktopOnly": false
+4
View File
@@ -96,6 +96,10 @@
border-radius: 4px;
}
.mm-node .mm-node-content img {
min-width:50px;
}
.mm-node.node-wireFrame .mm-node-content {
border-radius: 6px;
border-bottom-left-radius: 0;
+2 -2
View File
@@ -2,7 +2,6 @@
"devMode": false,
"ignoreCodeBlockRestrictions": false,
"preferredDateFormat": "YYYY-MM-DD",
"useUsDateInputOrder": false,
"firstWeekday": {
"index": 1,
"name": "Monday",
@@ -19,5 +18,6 @@
"buttonTemplates": [],
"excludedFolders": [
"templates"
]
],
"useUsDateInputOrder": false
}
File diff suppressed because one or more lines are too long
+3 -2
View File
@@ -1,11 +1,12 @@
{
"id": "obsidian-meta-bind-plugin",
"name": "Meta Bind",
"version": "0.12.5",
"version": "1.1.0",
"minAppVersion": "1.4.0",
"description": "Make your notes interactive with inline input fields, metadata displays, and buttons.",
"author": "Moritz Jung",
"authorUrl": "https://mprojectscode.github.io/",
"authorUrl": "https://www.moritzjung.dev/",
"fundingUrl": "https://github.com/sponsors/mProjectsCode",
"helpUrl": "https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/",
"isDesktopOnly": false
}
+230 -69
View File
@@ -4,6 +4,14 @@ body {
--mb-slider-spacing: 5px;
--mb-select-element-border-width: 5px;
--mb-date-input-year-input-width: 80px;
--mb-background-modifier-active: hsla(var(--interactive-accent-hsl), 0.15);
--mb-background-modifier-active-hover: hsla(var(--interactive-accent-hsl), 0.3);
--mb-input-type-select-text: var(--text-muted);
--mb-input-type-select-text-hover: var(--text-normal);
--mb-input-type-select-text-active: var(--text-normal);
--mb-input-type-select-text-active-hover: var(--text-normal);
}
/* Input Wrappers */
@@ -125,74 +133,56 @@ div.mb-view-wrapper {
/* Select Input */
.mb-select-input-element {
cursor: pointer;
padding: 5px;
margin: 5px 0 5px 0;
display: flex;
gap: var(--size-4-2);
align-items: center;
padding: var(--size-4-1) var(--size-4-2);
margin: var(--size-4-1) 0;
border-radius: var(--mb-border-radius);
border-left: var(--mb-select-element-border-width) solid transparent;
white-space: pre-wrap;
font-size: 16px;
min-width: 200px;
}
color: var(--mb-input-type-select-text);
.mb-select-input-element.is-selected {
border-left: var(--mb-select-element-border-width) solid var(--interactive-accent);
background: var(--background-secondary);
}
&.is-selected {
color: var(--mb-input-type-select-text-active);
background: var(--mb-background-modifier-active);
.mb-select-input-element:hover {
background: var(--background-secondary);
}
&:hover {
color: var(--mb-input-type-select-text-active-hover);
background: var(--mb-background-modifier-active-hover);
}
}
/* Date Input */
.mb-date-input-year-input[type='number'] {
width: var(--mb-date-input-year-input-width);
height: unset;
align-self: stretch;
}
&:hover {
color: var(--mb-input-type-select-text-hover);
background: var(--background-modifier-hover);
}
/* Input Element Group */
.mb-input-element-group {
display: inline-flex;
flex-direction: row;
}
&:not(.mb-mod-multi) > input[type='checkbox'] {
border-radius: 50%;
}
.mb-input-element-group .mb-input-element-group-element:focus {
z-index: 10;
& > input[type='checkbox'] {
margin: 0;
}
}
.mb-input-element-group .mb-input-element-group-element:first-child {
border-radius: var(--mb-border-radius) 0 0 var(--mb-border-radius);
}
.mb-input-element-group .mb-input-element-group-element:not(:first-child):not(:last-child) {
border-radius: 0;
}
.mb-input-element-group .mb-input-element-group-element:last-child {
border-radius: 0 var(--mb-border-radius) var(--mb-border-radius) 0;
}
/* SailKite small input fields so that line height is consistent */
/* https://discord.com/channels/1171444840257572935/1171444840257572939/1171562547212726403 */
/*.mb-input-element-group {*/
/* & > .mb-date-input-year-input[type='number'] {*/
/* padding-block: 0;*/
/* }*/
/* & > .mb-input-element-group-element {*/
/* height: 100%;*/
/* }*/
/*}*/
/* List Input */
.mb-list-input {
display: flex;
gap: var(--size-4-2);
}
.mb-list-input > div:has(> input) {
.mb-list-input > input {
flex-grow: 1;
}
.mb-list-input > textarea {
flex-grow: 1;
resize: vertical;
}
.mb-list-empty {
color: var(--text-faint);
}
@@ -201,15 +191,22 @@ div.mb-view-wrapper {
margin-bottom: var(--size-4-4);
display: flex;
flex-direction: column;
gap: var(--size-4-2);
gap: var(--size-4-1);
}
.mb-list-item {
display: flex;
}
padding: var(--size-4-1) var(--size-4-2);
border-radius: var(--mb-border-radius);
user-select: text;
.mb-list-item > span {
flex-grow: 1;
& > span {
flex-grow: 1;
}
&:hover {
background: var(--background-modifier-hover);
}
}
/* Inline List */
@@ -226,21 +223,19 @@ div.mb-view-wrapper {
padding-inline: var(--size-4-2);
padding-block: var(--size-4-1);
font-size: var(--font-ui-small);
vertical-align: bottom;
user-select: text;
&:not(:last-child) {
margin-right: var(--size-4-2);
}
& > .mb-inline-list-item-button {
border: none;
background: none;
padding: initial;
height: unset;
box-shadow: none;
&:hover {
color: var(--text-error);
}
&:hover {
border-color: var(--background-modifier-border-hover);
background-color: var(--background-modifier-hover);
transition:
box-shadow 0.15s ease-in-out,
border 0.15s ease-in-out;
}
}
@@ -254,7 +249,17 @@ div.mb-view-wrapper {
font-size: var(--font-ui-small);
&:hover {
color: var(--text-accent);
border-color: var(--background-modifier-border-hover);
background-color: var(--background-modifier-hover);
transition:
box-shadow 0.15s ease-in-out,
border 0.15s ease-in-out;
}
&:focus,
&:focus-visible {
box-shadow: 0 0 0 2px var(--background-modifier-border-focus);
color: var(--text-normal);
}
}
}
@@ -264,13 +269,25 @@ div.mb-view-wrapper {
background: var(--background-modifier-form-field);
border-radius: var(--mb-border-radius);
border: var(--mb-border-width) solid var(--background-modifier-border);
padding: 5px 5px 5px 7px;
cursor: pointer;
padding: var(--size-4-1) var(--size-4-2);
position: relative;
color: var(--text-normal);
display: inline-flex;
align-items: center;
gap: 5px;
gap: var(--size-4-1);
user-select: text;
&:hover {
border-color: var(--background-modifier-border-hover);
transition:
box-shadow 0.15s ease-in-out,
border 0.15s ease-in-out;
}
}
.mb-suggest-input > button {
padding: 0;
height: 20px;
}
.mb-suggest-text {
@@ -280,7 +297,7 @@ div.mb-view-wrapper {
/* Progress Bar Input */
.mb-progress-bar-input {
height: 32px;
height: var(--input-height);
width: 100%;
border-radius: var(--mb-border-radius);
border: var(--mb-border-width) solid var(--background-modifier-border);
@@ -293,7 +310,7 @@ div.mb-view-wrapper {
}
.mb-progress-bar-progress {
height: 32px;
height: 100%;
background: var(--color-accent);
border-radius: var(--mb-border-radius);
}
@@ -319,6 +336,14 @@ div.mb-view-wrapper {
right: var(--size-4-2);
}
/* Text Area Input */
.mb-input-textarea {
width: 100%;
height: 100px;
resize: vertical;
}
/* Card */
.mb-card {
padding: var(--size-4-2);
@@ -370,6 +395,107 @@ div.mb-view-wrapper {
gap: var(--size-4-4);
}
.mb-image-suggester-modal {
width: 80%;
}
.mb-image-card-image {
width: 100%;
height: fit-content;
max-height: 500px;
object-fit: contain;
}
.mb-image-card-text {
display: block;
margin: var(--size-4-2);
margin-bottom: var(--size-4-4);
}
.mb-image-card-footer {
display: flex;
align-items: center;
& > span {
padding-left: var(--size-4-2);
font-size: var(--font-ui-small);
color: var(--text-muted);
min-width: 0;
text-overflow-ellipsis: true;
flex: 1;
}
}
.mb-image-suggest-input {
background: var(--background-secondary);
border-radius: var(--mb-border-radius);
border: var(--mb-border-width) solid var(--background-modifier-border);
padding: var(--size-4-2);
width: 100%;
}
/* Time Input */
.mb-input-type-time {
input[type='time'] {
-webkit-app-region: no-drag;
background: var(--background-modifier-form-field);
border: var(--input-border-width) solid var(--background-modifier-border);
color: var(--text-normal);
font-family: inherit;
padding: var(--size-4-1) var(--size-4-2);
font-size: var(--font-ui-small);
border-radius: var(--input-radius);
outline: none;
&:hover {
border-color: var(--background-modifier-border-hover);
transition:
box-shadow 0.15s ease-in-out,
border 0.15s ease-in-out;
}
&:focus,
&:focus-visible {
box-shadow: 0 0 0 2px var(--background-modifier-border-focus);
}
}
}
/* Date Picker Input */
.date-picker-input {
background: var(--background-modifier-form-field);
border: var(--mb-border-width) solid var(--background-modifier-border);
color: var(--text-normal);
font-family: inherit;
padding: var(--size-4-1) var(--size-4-2);
font-size: var(--font-ui-small);
border-radius: var(--input-radius);
outline: none;
position: relative;
display: inline-flex;
align-items: center;
gap: 5px;
&:hover {
border-color: var(--background-modifier-border-hover);
transition:
box-shadow 0.15s ease-in-out,
border 0.15s ease-in-out;
}
&:focus,
&:focus-visible {
box-shadow: 0 0 0 2px var(--background-modifier-border-focus);
}
}
.date-picker-text {
display: inline-block;
}
/* Error */
.mb-error {
color: var(--text-error) !important;
@@ -507,10 +633,36 @@ th.mb-html-table-button-cell {
gap: var(--size-4-2);
}
.mb-flex-row > :first-child {
.mb-flex-row.mb-flex-row-stretch > :first-child {
flex: 1;
}
.mb-flex-row-reverse {
display: flex;
flex-direction: row-reverse;
justify-content: space-between;
align-items: center;
gap: var(--size-4-2);
}
.mb-flex-row-reverse.mb-flex-row-stretch > :last-child {
flex: 1;
}
.mb-full-width-text-input {
width: 100%;
}
.mb-full-width-text-input > input {
width: 100%;
}
.mb-full-width-text-input > textarea {
width: 100%;
height: 200px;
resize: vertical;
}
/* --- HIGHLIGHTING CLASSES --- */
.mb-highlight-test {
color: #00bfbc;
@@ -554,3 +706,12 @@ th.mb-html-table-button-cell {
.meta-bind-small-width > * {
width: 80px;
}
/* --- PUBLISH STUFF --- */
.published-container {
.mb-input-type-toggle > div {
display: inline-block;
vertical-align: sub;
}
}
+2 -2
View File
@@ -5,12 +5,12 @@
{
"id": 2,
"name": "memoire-L3",
"lastUpdate": 1712029971697
"lastUpdate": 1715610303854
},
{
"id": 1,
"name": "Ma bibliothèque",
"lastUpdate": 1712029971708
"lastUpdate": 1715610303930
}
],
"renderCitations": true,
@@ -0,0 +1,102 @@
{
"settings_version": "0.21.0",
"debug": false,
"obsidian_command_palette_prefix": "Execute: ",
"preview_variables_in_command_palette": true,
"show_autocomplete_menu": true,
"working_directory": "",
"default_shells": {},
"environment_variable_path_augmentations": {
"darwin": "/Users/oscarplaisant/.opam/default/bin:/Users/oscarplaisant/.opam/default/bin:/opt/local/bin:/opt/local/sbin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/.cargo/env:/Library/TeX/texbin:/Users/oscarplaisant/.cargo/bin:/Users/oscarplaisant/.opam/default/bin:/opt/local/bin:/opt/local/sbin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/oscarplaisant/.cargo/env:/Users/oscarplaisant/.cargo/bin+:/Users/oscarplaisant/.zsh_scripts/+:/Users/oscarplaisant/.zsh_scripts/+:/Users/oscarplaisant/.zsh_scripts/"
},
"show_installation_warnings": true,
"error_message_duration": 20,
"notification_message_duration": 10,
"execution_notification_mode": "disabled",
"output_channel_clipboard_also_outputs_to_notification": true,
"output_channel_notification_decorates_output": true,
"enable_events": true,
"approve_modals_by_pressing_enter_key": true,
"command_palette": {
"re_execute_last_shell_command": {
"enabled": true,
"prefix": "Re-execute: "
}
},
"max_visible_lines_in_shell_command_fields": false,
"shell_commands": [
{
"id": "4s9o488usd",
"platform_specific_commands": {
"default": "/opt/homebrew/bin/neovide {{file_path:absolute}}"
},
"shells": {},
"alias": "neovide",
"icon": null,
"confirm_execution": false,
"ignore_error_codes": [],
"input_contents": {
"stdin": null
},
"output_handlers": {
"stdout": {
"handler": "ignore",
"convert_ansi_code": true
},
"stderr": {
"handler": "notification",
"convert_ansi_code": true
}
},
"output_wrappers": {
"stdout": null,
"stderr": null
},
"output_channel_order": "stdout-first",
"output_handling_mode": "buffered",
"events": {},
"command_palette_availability": "enabled",
"preactions": [],
"variable_default_values": {}
},
{
"id": "53b5ai5phh",
"platform_specific_commands": {
"default": "/opt/homebrew/bin/tmux new-window && /opt/homebrew/bin/tmux send-keys \"cd {{folder_path:absolute}}\" Enter \"nvim {{file_name}}\" Enter && open -a iTerm\n"
},
"shells": {},
"alias": "Open in tmux>nVim",
"icon": "terminal-square",
"confirm_execution": false,
"ignore_error_codes": [],
"input_contents": {
"stdin": null
},
"output_handlers": {
"stdout": {
"handler": "ignore",
"convert_ansi_code": true
},
"stderr": {
"handler": "notification",
"convert_ansi_code": true
}
},
"output_wrappers": {
"stdout": null,
"stderr": null
},
"output_channel_order": "stdout-first",
"output_handling_mode": "buffered",
"events": {},
"command_palette_availability": "enabled",
"preactions": [],
"variable_default_values": {}
}
],
"prompts": [],
"builtin_variables": {},
"custom_variables": [],
"custom_shells": [],
"output_wrappers": []
}
+11 -3
View File
@@ -1,5 +1,5 @@
{
"settings_version": "0.21.0",
"settings_version": "0.22.0",
"debug": false,
"obsidian_command_palette_prefix": "Execute: ",
"preview_variables_in_command_palette": true,
@@ -57,7 +57,9 @@
"events": {},
"command_palette_availability": "enabled",
"preactions": [],
"variable_default_values": {}
"variable_default_values": {},
"execution_notification_mode": null,
"debounce": null
},
{
"id": "53b5ai5phh",
@@ -91,12 +93,18 @@
"events": {},
"command_palette_availability": "enabled",
"preactions": [],
"variable_default_values": {}
"variable_default_values": {},
"execution_notification_mode": null,
"debounce": null
}
],
"prompts": [],
"builtin_variables": {},
"custom_variables": [],
"custom_variables_notify_changes_via": {
"obsidian_uri": true,
"output_assignment": true
},
"custom_shells": [],
"output_wrappers": []
}
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,7 +1,7 @@
{
"id": "obsidian-shellcommands",
"name": "Shell commands",
"version": "0.21.0",
"version": "0.22.0",
"minAppVersion": "1.4.0",
"description": "You can predefine system commands that you want to run frequently, and assign hotkeys for them. For example open external applications. Automatic execution is also supported, and execution via URI links.",
"author": "Jarkko Linnanvirta",
+1 -1
View File
@@ -1,6 +1,6 @@
/*
* 'Shell commands' plugin for Obsidian.
* Copyright (C) 2021 - 2023 Jarkko Linnanvirta
* Copyright (C) 2021 - 2024 Jarkko Linnanvirta
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,8 +0,0 @@
{
"leftSidebarWidth": 300,
"rightSidebarWidth": 334.5,
"leftPin": false,
"rightPin": false,
"leftSideEnabled": false,
"rightSideEnabled": false
}
File diff suppressed because one or more lines are too long
@@ -1,9 +0,0 @@
{
"id": "obsidian-sidebar-expand-on-hover",
"name": "Sidebar Expand on Hover",
"version": "1.0.1",
"minAppVersion": "0.12.3",
"description": "This Obsidian plugin expands or collapses the sidebars based on mouse hovering on the ribbons.",
"authorUrl": "https://github.com/toiq",
"isDesktopOnly": true
}
+1 -1
View File
@@ -43,7 +43,7 @@
"singlelineCardSeparator": "::",
"singlelineReversedCardSeparator": ":::"
},
"buryDate": "2024-04-02",
"buryDate": "2024-05-13",
"buryList": [],
"historyDeck": ""
}
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,7 +1,7 @@
{
"id": "obsidian-spaced-repetition",
"name": "Spaced Repetition",
"version": "1.12.2",
"version": "1.12.4",
"minAppVersion": "0.15.4",
"description": "Fight the forgetting curve by reviewing flashcards & entire notes.",
"author": "Stephen Mwangi",
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,7 +1,7 @@
{
"id": "obsidian-tasks-plugin",
"name": "Tasks",
"version": "6.2.0",
"version": "7.1.0",
"minAppVersion": "1.1.1",
"description": "Task management for Obsidian",
"helpUrl": "https://publish.obsidian.md/tasks/",
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
{
"id": "obsidian-zotero-desktop-connector",
"name": "Zotero Integration",
"version": "3.1.7",
"version": "3.1.8",
"minAppVersion": "1.1.1",
"description": "Insert and import citations, bibliographies, notes, and PDF annotations from Zotero.",
"author": "mgmeyers",
+92 -12
View File
@@ -658,23 +658,80 @@ var import_obsidian3 = require("obsidian");
// src/features/githubUtils.ts
var import_obsidian = require("obsidian");
var GITHUB_RAW_USERCONTENT_PATH = "https://raw.githubusercontent.com/";
var grabReleaseFileFromRepository = async (repository, version, fileName, debugLogging = true) => {
const URL = `https://github.com/${repository}/releases/download/${version}/${fileName}`;
var isPrivateRepo = async (repository, debugLogging = true, personalAccessToken = "") => {
const URL2 = `https://api.github.com/repos/${repository}`;
try {
const download = await (0, import_obsidian.request)({ url: URL });
return download === "Not Found" || download === `{"error":"Not Found"}` ? null : download;
const response = await (0, import_obsidian.request)({
url: URL2,
headers: personalAccessToken ? {
Authorization: `Token ${personalAccessToken}`
} : {}
});
const data = await JSON.parse(response);
return data.private;
} catch (e) {
if (debugLogging)
console.log("error in isPrivateRepo", URL2, e);
return false;
}
};
var grabReleaseFileFromRepository = async (repository, version, fileName, debugLogging = true, personalAccessToken = "") => {
try {
const isPrivate = await isPrivateRepo(repository, debugLogging, personalAccessToken);
if (isPrivate) {
const URL2 = `https://api.github.com/repos/${repository}/releases`;
const response = await (0, import_obsidian.request)({
url: URL2,
headers: {
Authorization: `Token ${personalAccessToken}`
}
});
const data = await JSON.parse(response);
const release = data.find((release2) => release2.tag_name === version);
if (!release) {
return null;
}
const asset = release.assets.find(
(asset2) => asset2.name === fileName
);
if (!asset) {
return null;
}
const download = await (0, import_obsidian.request)({
url: asset.url,
headers: {
Authorization: `Token ${personalAccessToken}`,
Accept: "application/octet-stream"
}
});
return download === "Not Found" || download === `{"error":"Not Found"}` ? null : download;
} else {
const URL2 = `https://github.com/${repository}/releases/download/${version}/${fileName}`;
const download = await (0, import_obsidian.request)({
url: URL2,
headers: personalAccessToken ? {
Authorization: `Token ${personalAccessToken}`
} : {}
});
return download === "Not Found" || download === `{"error":"Not Found"}` ? null : download;
}
} catch (error) {
if (debugLogging)
console.log("error in grabReleaseFileFromRepository", URL, error);
return null;
}
};
var grabManifestJsonFromRepository = async (repositoryPath, rootManifest = true, debugLogging = true) => {
var grabManifestJsonFromRepository = async (repositoryPath, rootManifest = true, debugLogging = true, personalAccessToken = "") => {
const manifestJsonPath = GITHUB_RAW_USERCONTENT_PATH + repositoryPath + (rootManifest ? "/HEAD/manifest.json" : "/HEAD/manifest-beta.json");
if (debugLogging)
console.log("grabManifestJsonFromRepository manifestJsonPath", manifestJsonPath);
try {
const response = await (0, import_obsidian.request)({ url: manifestJsonPath });
const response = await (0, import_obsidian.request)({
url: manifestJsonPath,
headers: personalAccessToken ? {
Authorization: `Token ${personalAccessToken}`
} : {}
});
if (debugLogging)
console.log("grabManifestJsonFromRepository response", response);
return response === "404: Not Found" ? null : await JSON.parse(response);
@@ -783,7 +840,8 @@ var DEFAULT_SETTINGS = {
loggingPath: "BRAT-log",
loggingVerboseEnabled: false,
debuggingMode: false,
notificationsEnabled: true
notificationsEnabled: true,
personalAccessToken: ""
};
function addBetaPluginToList(plugin, repositoryPath, specifyVersion = "") {
let save = false;
@@ -1265,6 +1323,15 @@ var BratSettingsTab = class extends import_obsidian5.PluginSettingTab {
await this.plugin.saveSettings();
});
});
new import_obsidian5.Setting(containerEl).setName("Personal Access Token").setDesc(
"If you need to access private repositories, enter the personal access token here."
).addText((text) => {
var _a;
text.setPlaceholder("Enter your personal access token").setValue((_a = this.plugin.settings.personalAccessToken) != null ? _a : "").onChange(async (value) => {
this.plugin.settings.personalAccessToken = value;
await this.plugin.saveSettings();
});
});
}
};
@@ -1433,16 +1500,24 @@ var BetaPlugins = class {
const manifestJson = await grabManifestJsonFromRepository(
repositoryPath,
!getBetaManifest,
this.plugin.settings.debuggingMode
this.plugin.settings.debuggingMode,
this.plugin.settings.personalAccessToken
);
if (!manifestJson) {
if (reportIssues)
if (reportIssues) {
toastMessage(
this.plugin,
`${repositoryPath}
This does not seem to be an obsidian plugin, as there is no manifest.json file.`,
noticeTimeout
);
console.error(
"BRAT: validateRepository",
repositoryPath,
getBetaManifest,
reportIssues
);
}
return null;
}
if (!("id" in manifestJson)) {
@@ -1480,24 +1555,28 @@ The version attribute for the release is missing from the manifest file`,
async getAllReleaseFiles(repositoryPath, manifest, getManifest, specifyVersion = "") {
const version = specifyVersion === "" ? manifest.version : specifyVersion;
const reallyGetManifestOrNot = getManifest || specifyVersion !== "";
console.log({ reallyGetManifestOrNot, version });
return {
mainJs: await grabReleaseFileFromRepository(
repositoryPath,
version,
"main.js",
this.plugin.settings.debuggingMode
this.plugin.settings.debuggingMode,
this.plugin.settings.personalAccessToken
),
manifest: reallyGetManifestOrNot ? await grabReleaseFileFromRepository(
repositoryPath,
version,
"manifest.json",
this.plugin.settings.debuggingMode
this.plugin.settings.debuggingMode,
this.plugin.settings.personalAccessToken
) : "",
styles: await grabReleaseFileFromRepository(
repositoryPath,
version,
"styles.css",
this.plugin.settings.debuggingMode
this.plugin.settings.debuggingMode,
this.plugin.settings.personalAccessToken
)
};
}
@@ -1587,6 +1666,7 @@ You will need to update your Obsidian to use this plugin or contact the plugin d
usingBetaManifest,
specifyVersion
);
console.log("rFiles", rFiles);
if (usingBetaManifest || rFiles.manifest === "")
rFiles.manifest = JSON.stringify(primaryManifest);
if (this.plugin.settings.debuggingMode)
+14 -14
View File
@@ -1,15 +1,15 @@
{
"id": "obsidian42-brat",
"name": "BRAT",
"version": "0.8.4",
"minAppVersion": "1.4.16",
"description": "Easily install a beta version of a plugin for testing.",
"author": "TfTHacker",
"authorUrl": "https://github.com/TfTHacker/obsidian42-brat",
"helpUrl": "https://tfthacker.com/BRAT",
"isDesktopOnly": false,
"fundingUrl": {
"Buy Me a Coffee": "https://bit.ly/o42-kofi",
"Visit my site": "https://tfthacker.com"
}
}
"id": "obsidian42-brat",
"name": "BRAT",
"version": "1.0.1",
"minAppVersion": "1.4.16",
"description": "Easily install a beta version of a plugin for testing.",
"author": "TfTHacker",
"authorUrl": "https://github.com/TfTHacker/obsidian42-brat",
"helpUrl": "https://tfthacker.com/BRAT",
"isDesktopOnly": false,
"fundingUrl": {
"Buy Me a Coffee": "https://bit.ly/o42-kofi",
"Visit my site": "https://tfthacker.com"
}
}
File diff suppressed because it is too large Load Diff
+13 -14
View File
@@ -1,15 +1,14 @@
{
"id": "obsidian42-strange-new-worlds",
"name": "Strange New Worlds (SNW)",
"version": "1.2.5",
"minAppVersion": "1.4.16",
"description": "Revealing networked thought and the strange new worlds created by your vault",
"author": "TfTHacker",
"authorUrl": "https://twitter.com/TfTHacker",
"helpUrl": "https://tfthacker.com/SNW",
"isDesktopOnly": false,
"fundingUrl": {
"Buy Me a Coffee": "https://bit.ly/o42-kofi",
"Vist my site": "https://tfthacker.com"
}
}
"id": "obsidian42-strange-new-worlds",
"name": "Strange New Worlds",
"version": "2.1.2",
"minAppVersion": "1.5.11",
"description": "Help see how your vault is interconnected with visual indicators.",
"author": "TfTHacker",
"authorUrl": "https://twitter.com/TfTHacker",
"helpUrl": "https://tfthacker.com/SNW",
"isDesktopOnly": false,
"fundingUrl": {
"Sponsor my work": "https://tfthacker.com/sponsor"
}
}
+83 -3
View File
@@ -3,6 +3,12 @@ body {
--snw-icon-opacity: 0.4;
}
div:has(> .snw-reference),
.snw-link-preview {
display: inline;
}
.snw-reference {
display: inline;
font-size: var(--font-ui-smaller);
@@ -21,6 +27,20 @@ body {
font-size: var(--font-ui-smaller);
}
/* Properties */
/* Have to remove the underline since text-decoration-line isn't inheritted, but then re-add ito the link */
.metadata-container .internal-link:has(.snw-frontmatter-wrapper) {
text-decoration-line: none !important;
color: unset;
cursor: unset;
.multi-select-pill-content {
text-decoration-line: underline !important;
color: var(--link-color);
cursor: var(--cursor-link);
}
}
/* CM Live Preview */
.cm-content .snw-reference {
padding-right: 2px;
@@ -75,7 +95,7 @@ body {
color: var(--text-normal);
}
.snw-sidepane-container > div > .snw-ref-area {
.snw-sidepane-container>div>.snw-ref-area {
max-height: 100% !important;
margin-bottom: 10px;
}
@@ -132,7 +152,7 @@ body {
margin-bottom: 1px !important;
}
[uic='uic'] > * {
[uic='uic']>* {
margin-top: 0px !important;
margin-bottom: 0px !important;
max-height: 230px !important;
@@ -223,7 +243,7 @@ body {
border-bottom: 1px solid var(--background-modifier-border);
}
.snw-breadcrumbs > span {
.snw-breadcrumbs>span {
margin-right: 1ch;
border: 1px solid var(--background-modifier-border);
border-radius: var(--radius-s);
@@ -246,3 +266,63 @@ body {
height: 0px;
color: transparent;
}
/* Dropdown options */
.snw-sort-dropdown-wrapper {
position: relative;
}
.snw-sort-dropdown-button {
border: none !important;
box-shadow: none !important;
width: 35px;
background-color: unset !important;
opacity: var(--snw-icon-opacity);
>svg {
width: 25px;
color: var(--tab-text-color-focused) !important;
}
}
.snw-sort-dropdown-list {
position: absolute;
right: 0;
top: 15px;
width: 90px;
padding: 5px;
z-index: 1;
border: 3px solid var(--divider-color);
border-radius: 2px;
background-color: var(--background-primary);
overflow-y: auto;
list-style: none;
color: var(--nav-item-color);
font-size: var(--nav-item-size);
font-weight: var(--nav-item-weight);
}
.snw-sort-dropdown-list-item {
padding-left: 5px;
}
.snw-sort-dropdown-list-item:hover {
background-color: var(--background-modifier-hover);
}
.snw-sort-dropdown-list-item-label {
padding-left: 5px;
position: relative;
bottom: 5px;
}
/* prevent printing of reference numbers */
@media print {
.snw-reference {
display: none;
}
}
+1 -1
View File
@@ -4,7 +4,7 @@
"position": "Auto",
"customPositionX": 0,
"customPositionY": 0,
"stickToMouse": true,
"stickToMouse": false,
"log": false,
"disableCloseSuggest": false
}
-47
View File
@@ -1,47 +0,0 @@
{
"defaultSearchEngine": "google",
"customSearchEngine": [
{
"name": "duckduckgo",
"url": "https://duckduckgo.com/?q="
}
],
"ignoreList": [
"notion",
"craft"
],
"alwaysShowCustomSearch": false,
"showOtherSearchEngines": false,
"showSearchBarInPage": false,
"markdownPath": "/",
"customHighlightFormat": false,
"highlightFormat": "[{CONTENT}]({URL})",
"highlightInSameTab": false,
"openInSameTab": false,
"showRefreshButton": true,
"openInObsidianWeb": false,
"useCustomIcons": false,
"useWebview": false,
"useIconList": true,
"darkMode": false,
"bookmarkManager": {
"openBookMark": false,
"saveBookMark": false,
"sendToReadWise": false,
"pagination": "12",
"category": "- Computer\n - 算法\n - 数据结构\n- obsidian\n - surfing\n - dataview\n",
"defaultCategory": "ROOT",
"defaultColumnList": [
"name",
"description",
"url",
"category",
"tags",
"created",
"modified",
"action"
],
"defaultFilterType": "tree"
},
"treeData": []
}
File diff suppressed because one or more lines are too long
-15
View File
@@ -1,15 +0,0 @@
{
"id": "surfing",
"name": "Surfing",
"version": "0.9.5",
"minAppVersion": "1.4.0",
"description": "Surf the Net in Obsidian.",
"author": "Boninall & Windily-cloud",
"authorUrl": "https://github.com/Quorafind",
"isDesktopOnly": true,
"fundingUrl": {
"Buy Me a Coffee": "https://www.buymeacoffee.com/boninall",
"爱发电": "https://afdian.net/a/boninall",
"支付宝": "https://cdn.jsdelivr.net/gh/Quorafind/.github@main/IMAGE/%E6%94%AF%E4%BB%98%E5%AE%9D%E4%BB%98%E6%AC%BE%E7%A0%81.jpg"
}
}
File diff suppressed because one or more lines are too long
+56 -2
View File
@@ -24,19 +24,67 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
// main.ts
var main_exports = {};
__export(main_exports, {
SyncGraphSettingTab: () => SyncGraphSettingTab,
default: () => SyncGraphPlugin
});
module.exports = __toCommonJS(main_exports);
var import_obsidian = require("obsidian");
var DEFAULT_SETTINGS = {
autoSync: false,
defaultDepth: 1,
defaultIncomingLinks: true,
defaultOutgoingLinks: true,
defaultNeighborLinks: true
};
var SyncGraphSettingTab = class extends import_obsidian.PluginSettingTab {
constructor(app, plugin) {
super(app, plugin);
this.plugin = plugin;
}
display() {
let { containerEl } = this;
containerEl.empty();
new import_obsidian.Setting(containerEl).setName("Auto Sync").addToggle((toggle) => toggle.setValue(this.plugin.settings.autoSync).onChange(async (value) => {
this.plugin.settings.autoSync = value;
await this.plugin.saveSettings();
}));
new import_obsidian.Setting(containerEl).setName("Default depth").addSlider((value) => value.setLimits(1, 10, 1).setValue(this.plugin.settings.defaultDepth).onChange(async (value2) => {
this.plugin.settings.defaultDepth = value2;
await this.plugin.saveSettings();
}).setDynamicTooltip());
new import_obsidian.Setting(containerEl).setName("Default Incoming Links").addToggle((toggle) => toggle.setValue(this.plugin.settings.defaultIncomingLinks).onChange(async (value) => {
this.plugin.settings.defaultIncomingLinks = value;
await this.plugin.saveSettings();
}));
new import_obsidian.Setting(containerEl).setName("Default Outgoing Links").addToggle((toggle) => toggle.setValue(this.plugin.settings.defaultOutgoingLinks).onChange(async (value) => {
this.plugin.settings.defaultOutgoingLinks = value;
await this.plugin.saveSettings();
}));
new import_obsidian.Setting(containerEl).setName("Default Neighbor Links").addToggle((toggle) => toggle.setValue(this.plugin.settings.defaultNeighborLinks).onChange(async (value) => {
this.plugin.settings.defaultNeighborLinks = value;
await this.plugin.saveSettings();
}));
}
};
var SyncGraphPlugin = class extends import_obsidian.Plugin {
async onload() {
await this.loadSettings();
this.addSettingTab(new SyncGraphSettingTab(this.app, this));
this.addCommand({
id: "sync-graph-colorgroups-to-localgraph",
id: "sync-graph-settings-to-localgraph",
name: "Sync Graph Settings to Local Graph",
callback: async () => {
await this.syncGlobalToLocal();
}
});
this.app.workspace.on("active-leaf-change", async () => {
if (this.settings.autoSync) {
await this.syncGlobalToLocal();
}
});
}
async loadSettings() {
this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
}
async syncGlobalToLocal() {
const configDir = this.app.vault.configDir;
@@ -56,7 +104,13 @@ var SyncGraphPlugin = class extends import_obsidian.Plugin {
const viewState = localGraphLeaf.getViewState();
viewState.state.options.colorGroups = colorGroups;
viewState.state.options.search = searchFilters;
viewState.state.options.localJumps = this.settings.defaultDepth;
viewState.state.options.localBacklinks = this.settings.defaultIncomingLinks;
viewState.state.options.localForelinks = this.settings.defaultOutgoingLinks;
viewState.state.options.localInterlinks = this.settings.defaultNeighborLinks;
localGraphLeaf.setViewState(viewState);
}
async saveSettings() {
await this.saveData(this.settings);
}
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsibWFpbi50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiaW1wb3J0IHsgUGx1Z2luLCBXb3Jrc3BhY2VMZWFmLCBub3JtYWxpemVQYXRofSBmcm9tICdvYnNpZGlhbic7XG5cbmV4cG9ydCBkZWZhdWx0IGNsYXNzIFN5bmNHcmFwaFBsdWdpbiBleHRlbmRzIFBsdWdpbiB7XG5cdGFzeW5jIG9ubG9hZCgpIHtcblx0XHR0aGlzLmFkZENvbW1hbmQoe1xuXHRcdFx0aWQ6IFwic3luYy1ncmFwaC1jb2xvcmdyb3Vwcy10by1sb2NhbGdyYXBoXCIsXG5cdFx0XHRuYW1lOiBcIlN5bmMgR3JhcGggU2V0dGluZ3MgdG8gTG9jYWwgR3JhcGhcIixcblx0XHRcdGNhbGxiYWNrOiBhc3luYyAoKSA9PiB7IGF3YWl0IHRoaXMuc3luY0dsb2JhbFRvTG9jYWwoKSB9XG5cdFx0fSlcblx0fVxuXG5cdGFzeW5jIHN5bmNHbG9iYWxUb0xvY2FsKCkge1xuXHRcdGNvbnN0IGNvbmZpZ0RpciA9IHRoaXMuYXBwLnZhdWx0LmNvbmZpZ0Rpcjtcblx0XHRjb25zdCBncmFwaENvbmZpZ1BhdGggPSBub3JtYWxpemVQYXRoKGNvbmZpZ0RpciArICcvZ3JhcGguanNvbicpO1xuXG5cdFx0Ly8gdGhpcy5hcHAudmF1bHQuZ2V0QWJzdHJhY3RGaWxlQnlQYXRoKCcub2JzaWRpYW4vZ3JhcGguanNvbicpIHdvdWxkIHJldHVybiBudWxsXG5cdFx0Ly8gU28gd2UncmUgZG9pbmcgaXQgdGhlIGxlc3Mgc2FmZSB3YXlcblx0XHRjb25zdCBncmFwaENvbmZpZ0pzb24gPSBhd2FpdCB0aGlzLmFwcC52YXVsdC5hZGFwdGVyLnJlYWQoZ3JhcGhDb25maWdQYXRoKTtcblx0XHRjb25zdCBncmFwaENvbmZpZyA9IEpTT04ucGFyc2UoZ3JhcGhDb25maWdKc29uKTtcblx0XHRjb25zdCBncmFwaENvbG9yR3JvdXBzID0gZ3JhcGhDb25maWcuY29sb3JHcm91cHM7XG5cdFx0Y29uc3Qgc2VhcmNoRmlsdGVycyA9IGdyYXBoQ29uZmlnLnNlYXJjaDtcblx0XHR0aGlzLmdldExvY2FsR3JhcGhMZWF2ZXMoKS5mb3JFYWNoKChsZWFmKSA9PiB7XG5cdFx0XHR0aGlzLnNldFNldHRpbmdzKGxlYWYsIGdyYXBoQ29sb3JHcm91cHMsIHNlYXJjaEZpbHRlcnMpO1xuXHRcdH0pXG5cdH1cblxuXHRnZXRMb2NhbEdyYXBoTGVhdmVzKCkge1xuXHRcdHJldHVybiB0aGlzLmFwcC53b3Jrc3BhY2UuZ2V0TGVhdmVzT2ZUeXBlKCdsb2NhbGdyYXBoJyk7XG5cdH1cblx0XG5cdHNldFNldHRpbmdzKGxvY2FsR3JhcGhMZWFmOiBXb3Jrc3BhY2VMZWFmLCBjb2xvckdyb3VwczogYW55LCBzZWFyY2hGaWx0ZXJzOiBhbnkpIHtcblx0XHRjb25zdCB2aWV3U3RhdGUgPSBsb2NhbEdyYXBoTGVhZi5nZXRWaWV3U3RhdGUoKTtcblx0XHR2aWV3U3RhdGUuc3RhdGUub3B0aW9ucy5jb2xvckdyb3VwcyA9IGNvbG9yR3JvdXBzO1xuXHRcdHZpZXdTdGF0ZS5zdGF0ZS5vcHRpb25zLnNlYXJjaCA9IHNlYXJjaEZpbHRlcnM7XG5cdFx0bG9jYWxHcmFwaExlYWYuc2V0Vmlld1N0YXRlKHZpZXdTdGF0ZSk7XG5cdH1cbn0iXSwKICAibWFwcGluZ3MiOiAiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUEsc0JBQW9EO0FBRXBELElBQXFCLGtCQUFyQixjQUE2Qyx1QkFBTztBQUFBLEVBQ25ELE1BQU0sU0FBUztBQUNkLFNBQUssV0FBVztBQUFBLE1BQ2YsSUFBSTtBQUFBLE1BQ0osTUFBTTtBQUFBLE1BQ04sVUFBVSxZQUFZO0FBQUUsY0FBTSxLQUFLLGtCQUFrQjtBQUFBLE1BQUU7QUFBQSxJQUN4RCxDQUFDO0FBQUEsRUFDRjtBQUFBLEVBRUEsTUFBTSxvQkFBb0I7QUFDekIsVUFBTSxZQUFZLEtBQUssSUFBSSxNQUFNO0FBQ2pDLFVBQU0sa0JBQWtCLG1DQUFjLFlBQVksYUFBYTtBQUkvRCxVQUFNLGtCQUFrQixNQUFNLEtBQUssSUFBSSxNQUFNLFFBQVEsS0FBSyxlQUFlO0FBQ3pFLFVBQU0sY0FBYyxLQUFLLE1BQU0sZUFBZTtBQUM5QyxVQUFNLG1CQUFtQixZQUFZO0FBQ3JDLFVBQU0sZ0JBQWdCLFlBQVk7QUFDbEMsU0FBSyxvQkFBb0IsRUFBRSxRQUFRLENBQUMsU0FBUztBQUM1QyxXQUFLLFlBQVksTUFBTSxrQkFBa0IsYUFBYTtBQUFBLElBQ3ZELENBQUM7QUFBQSxFQUNGO0FBQUEsRUFFQSxzQkFBc0I7QUFDckIsV0FBTyxLQUFLLElBQUksVUFBVSxnQkFBZ0IsWUFBWTtBQUFBLEVBQ3ZEO0FBQUEsRUFFQSxZQUFZLGdCQUErQixhQUFrQixlQUFvQjtBQUNoRixVQUFNLFlBQVksZUFBZSxhQUFhO0FBQzlDLGNBQVUsTUFBTSxRQUFRLGNBQWM7QUFDdEMsY0FBVSxNQUFNLFFBQVEsU0FBUztBQUNqQyxtQkFBZSxhQUFhLFNBQVM7QUFBQSxFQUN0QztBQUNEOyIsCiAgIm5hbWVzIjogW10KfQo=
+2 -2
View File
@@ -1,9 +1,9 @@
{
"id": "sync-graph-settings",
"name": "Sync Graph Settings",
"version": "1.1.0",
"version": "1.2.0",
"minAppVersion": "0.15.0",
"description": "This is a plugin for syncing graph settings (Color Groups and Search Filters) to Local Graphs",
"description": "This is a plugin for syncing various graph settings to Local Graphs",
"author": "xallt",
"authorUrl": "github.com/Xallt",
"isDesktopOnly": false
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,7 +1,7 @@
{
"id": "templater-obsidian",
"name": "Templater",
"version": "2.2.3",
"version": "2.3.1",
"description": "Create and use templates",
"minAppVersion": "1.5.0",
"author": "SilentVoid",
+8 -3
View File
@@ -15,7 +15,7 @@
"delayMilliSeconds": 0,
"disableSuggestionsDuringImeOn": false,
"disableSuggestionsInMathBlock": true,
"insertAfterCompletion": true,
"insertSpaceAfterCompletion": false,
"firstCharactersDisableSuggestions": ":/^",
"patternsToSuppressTrigger": [
"^~~~.*",
@@ -37,8 +37,10 @@
],
"select with custom alias": [
{
"modifiers": [],
"key": "ArrowRight",
"modifiers": [
"Shift"
],
"key": "Tab",
"hideHotkeyGuide": false
}
],
@@ -71,11 +73,13 @@
"enableCurrentFileComplement": false,
"currentFileMinNumberOfCharacters": 0,
"onlyComplementEnglishOnCurrentFileComplement": false,
"excludeCurrentFileWordPatterns": [],
"enableCurrentVaultComplement": false,
"currentVaultMinNumberOfCharacters": 2,
"includeCurrentVaultPathPrefixPatterns": "",
"excludeCurrentVaultPathPrefixPatterns": "",
"includeCurrentVaultOnlyFilesUnderCurrentDirectory": false,
"excludeCurrentVaultWordPatterns": [],
"enableCustomDictionaryComplement": false,
"customDictionaryPaths": "https://raw.githubusercontent.com/first20hours/google-10000-english/master/google-10000-english-no-swears.txt",
"columnDelimiter": "Tab",
@@ -105,6 +109,7 @@
},
"disableOnMobile": false,
"showLogAboutPerformanceInConsole": false,
"insertAfterCompletion": true,
"selectionHistoryTree": {},
"useCommonPrefixCompletionOfSuggestion": false,
"selectSuggestionKeys": "Tab",
+1 -1
View File
@@ -1 +1 @@
{"matrice hessienne":{"matrice hessienne":{"internalLink":{"count":2,"lastUpdated":1710324879177}}},"baptême":{"baptême":{"internalLink":{"count":5,"lastUpdated":1709864270370}}},"gradient":{"gradient":{"internalLink":{"count":1,"lastUpdated":1710325461961}}},"obsidian plugin tag and wordcloud":{"obsidian plugin tag and wordcloud":{"internalLink":{"count":1,"lastUpdated":1710345237714}}},"intersection de sous groupes":{"intersection de sous groupes":{"internalLink":{"count":1,"lastUpdated":1710465530327}}},"valeurs":{"valeurs":{"internalLink":{"count":1,"lastUpdated":1711459246780}}},"Learning APL":{"Learning APL":{"internalLink":{"count":1,"lastUpdated":1711584419388}}},"structure de donnés":{"structure de donnés":{"internalLink":{"count":1,"lastUpdated":1711621251914}}},"paramètre":{"paramètre":{"internalLink":{"count":1,"lastUpdated":1711621492446}}},"langage de programmation":{"langage de programmation":{"internalLink":{"count":4,"lastUpdated":1711920773085}},"langage":{"internalLink":{"count":1,"lastUpdated":1711920903060}}},"argument d'une fonction":{"argument d'une fonction":{"internalLink":{"count":1,"lastUpdated":1711624010397}}},"argument":{"argument":{"internalLink":{"count":2,"lastUpdated":1711624133731}}},"techniques de pkm":{"techniques de pkm":{"internalLink":{"count":1,"lastUpdated":1711627281333}}},"paradigme de programmation":{"paradigme de programmation":{"internalLink":{"count":6,"lastUpdated":1711917618071}}},"état":{"état":{"internalLink":{"count":3,"lastUpdated":1711905774038}}},"structure de données":{"structure de données":{"internalLink":{"count":1,"lastUpdated":1711643699590}}},"structures de données":{"structures de données":{"internalLink":{"count":2,"lastUpdated":1711904665130}}},"enregistrement":{"enregistrement":{"internalLink":{"count":1,"lastUpdated":1711668283936}}},"envoi de messages entre objets":{"envoi de messages entre objets":{"internalLink":{"count":1,"lastUpdated":1711742931869}}},"programmation structurée":{"programmation structurée":{"internalLink":{"count":1,"lastUpdated":1711764089506}}},"effet de bord":{"effet de bord":{"internalLink":{"count":2,"lastUpdated":1711906516742}}},"programmation impérative":{"programmation impérative":{"internalLink":{"count":4,"lastUpdated":1711988908729}}},"composition de fonctions":{"composition de fonctions":{"internalLink":{"count":1,"lastUpdated":1711904385231}}},"fonction":{"fonction":{"internalLink":{"count":2,"lastUpdated":1711904857369}}},"fonction pure":{"fonction pure":{"internalLink":{"count":1,"lastUpdated":1711915488076}}},"effets de bord":{"effets de bord":{"internalLink":{"count":1,"lastUpdated":1711915498637}}},"Alan Perlis":{"Alan Perlis":{"internalLink":{"count":1,"lastUpdated":1711915724379}}},"fonction racine carrée":{"fonction racine carrée":{"internalLink":{"count":1,"lastUpdated":1711916013705}}},"méthode de Newton":{"méthode de Newton":{"internalLink":{"count":1,"lastUpdated":1711916030171}}},"langages formels":{"langages formels":{"internalLink":{"count":1,"lastUpdated":1711916816989}}},"logique":{"logique":{"internalLink":{"count":1,"lastUpdated":1711916822650}}},"sophisme":{"sophisme":{"internalLink":{"count":1,"lastUpdated":1711916957089}}},"définition":{"définition":{"currentVault":{"count":1,"lastUpdated":1711920701861},"currentFile":{"count":1,"lastUpdated":1711920749062}}},"remplissage":{"remplissage":{"currentVault":{"count":1,"lastUpdated":1711920704851}}},"défini":{"défini":{"currentFile":{"count":1,"lastUpdated":1711920747172}}},"SE - organisation des données":{"SE - organisation des données":{"internalLink":{"count":1,"lastUpdated":1711920824428}}},"Frédéric Lordon":{"Frédéric Lordon":{"internalLink":{"count":1,"lastUpdated":1711942941375}}},"taxonomie des paradigmes de programmation":{"taxonomie des paradigmes de programmation":{"internalLink":{"count":2,"lastUpdated":1712001528811}}},"FermetureInformatique2024":{"FermetureInformatique2024":{"internalLink":{"count":1,"lastUpdated":1712011439635}}},"processus":{"processus":{"internalLink":{"count":2,"lastUpdated":1712026279944}}},"swap d'un processus":{"swap d'un processus":{"internalLink":{"count":1,"lastUpdated":1712026273892}}}}
{"garbage collection":{"garbage collection":{"internalLink":{"count":1,"lastUpdated":1715606605864}}},"changement de base d'une forme bilinéaire":{"test":{"internalLink":{"count":1,"lastUpdated":1715676329297}}},"test_patat":{"test_patat":{"internalLink":{"count":1,"lastUpdated":1715676413667}},"bonjour":{"internalLink":{"count":1,"lastUpdated":1715676438324}}}}
+87 -25
View File
@@ -3216,6 +3216,9 @@ var CurrentFileWordProvider = class {
const currentToken = this.tokenizer.tokenize(
editor.getLine(editor.getCursor().line).slice(0, editor.getCursor().ch)
).last();
const excludePatterns = option.excludeWordPatterns.map(
(x) => new RegExp(`^${x}$`)
);
const content = await this.app.vault.cachedRead(file);
const tokens = this.tokenizer.tokenize(content).filter((x) => {
if (x.length < option.minNumberOfCharacters) {
@@ -3225,7 +3228,7 @@ var CurrentFileWordProvider = class {
return false;
}
return option.onlyEnglish ? allAlphabets(x) : true;
}).map((x) => startsSmallLetterOnlyFirst(x) ? x.toLowerCase() : x);
}).map((x) => startsSmallLetterOnlyFirst(x) ? x.toLowerCase() : x).filter((x) => !excludePatterns.some((rp) => x.match(rp)));
this.words = uniq(tokens).filter((x) => x !== currentToken).map((x) => ({
value: x,
type: "currentFile",
@@ -3409,12 +3412,15 @@ var CurrentVaultWordProvider = class {
const markdownFilePaths = this.app.vault.getMarkdownFiles().map((x) => x.path).filter((p) => this.includePrefixPatterns.every((x) => p.startsWith(x))).filter((p) => this.excludePrefixPatterns.every((x) => !p.startsWith(x))).filter(
(p) => !this.onlyUnderCurrentDirectory || dirname(p) === currentDirname
);
const excludePatterns = option.excludeWordPatterns.map(
(x) => new RegExp(`^${x}$`)
);
let wordByValue = {};
for (const path of markdownFilePaths) {
const content = await this.app.vault.adapter.read(path);
const tokens = this.tokenizer.tokenize(content).filter(
(x) => x.length >= option.minNumberOfCharacters && !this.tokenizer.shouldIgnoreOnCurrent(x)
).map((x) => startsSmallLetterOnlyFirst(x) ? x.toLowerCase() : x);
).map((x) => startsSmallLetterOnlyFirst(x) ? x.toLowerCase() : x).filter((x) => !excludePatterns.some((rp) => x.match(rp)));
for (const token of tokens) {
wordByValue[token] = {
value: token,
@@ -3896,13 +3902,16 @@ var AutoCompleteSuggest = class _AutoCompleteSuggest extends import_obsidian5.Ed
this.appHelper = new AppHelper(app2);
this.statusBar = statusBar;
}
triggerComplete() {
triggerComplete(opt) {
const editor = this.appHelper.getCurrentEditor();
const activeFile = this.app.workspace.getActiveFile();
if (!editor || !activeFile) {
return;
}
this.runManually = true;
if (opt == null ? void 0 : opt.fallbackLinkify) {
this.completionMode = this.completionMode === "prefix" ? "partial" : "new";
}
this.trigger(editor, activeFile, true);
}
hideCompletion() {
@@ -3916,12 +3925,8 @@ var AutoCompleteSuggest = class _AutoCompleteSuggest extends import_obsidian5.Ed
this.settings.intelligentSuggestionPrioritization.historyFilePath || DEFAULT_HISTORIES_PATH
);
if (await this.appHelper.exists(historyPath)) {
this.settings.selectionHistoryTree = {};
return this.appHelper.loadJson(historyPath);
}
if (Object.keys(this.settings.selectionHistoryTree).length > 0) {
return this.settings.selectionHistoryTree;
}
return {};
}
static async new(app2, settings, statusBar, onPersistSelectionHistory) {
@@ -3985,6 +3990,7 @@ var AutoCompleteSuggest = class _AutoCompleteSuggest extends import_obsidian5.Ed
ins.refreshCurrentVaultTokens();
ins.app.metadataCache.offref(cacheResolvedRef);
});
ins.completionMode = ins.matchStrategy.name;
return ins;
}
predictableComplete() {
@@ -4095,10 +4101,24 @@ var AutoCompleteSuggest = class _AutoCompleteSuggest extends import_obsidian5.Ed
const start = performance.now();
this.showDebugLog(() => `[context.query]: ${context.query}`);
const parsedQuery = JSON.parse(context.query);
const words = parsedQuery.queries.filter(
const createNewLinkSuggestions = () => parsedQuery.queries.slice().reverse().filter((q) => q.word.length >= this.minNumberTriggered).map((q) => ({
value: q.word,
createdPath: "FIXME: ",
type: "internalLink",
phantom: true,
offset: q.offset
}));
if (parsedQuery.completionMode === "new") {
cb(createNewLinkSuggestions());
return;
}
const matchStrategy = MatchStrategy.fromName(
parsedQuery.completionMode
);
let words = parsedQuery.queries.filter(
(x, i, xs) => parsedQuery.currentFrontMatter || this.settings.minNumberOfWordsTriggeredPhrase + i - 1 < xs.length && x.word.length >= this.minNumberTriggered && !x.word.endsWith(" ")
).map((q) => {
const handler = parsedQuery.currentFrontMatter && this.frontMatterComplementStrategy !== SpecificMatchStrategy.INHERIT ? this.frontMatterComplementStrategy.handler : this.matchStrategy.handler;
const handler = parsedQuery.currentFrontMatter && this.frontMatterComplementStrategy !== SpecificMatchStrategy.INHERIT ? this.frontMatterComplementStrategy.handler : matchStrategy.handler;
return handler(
this.indexedWords,
q.word,
@@ -4112,6 +4132,13 @@ var AutoCompleteSuggest = class _AutoCompleteSuggest extends import_obsidian5.Ed
}
).map((word) => ({ ...word, offset: q.offset }));
}).flat().sort((a, b) => Number(a.fuzzy) - Number(b.fuzzy));
if (this.completionMode != this.matchStrategy.name && this.completionMode === "partial") {
words = words.filter((x) => x.type === "internalLink");
if (words.length === 0) {
cb(createNewLinkSuggestions());
return;
}
}
cb(
uniqWith(words, suggestionUniqPredicate).slice(
0,
@@ -4214,7 +4241,8 @@ var AutoCompleteSuggest = class _AutoCompleteSuggest extends import_obsidian5.Ed
onlyEnglish: this.settings.onlyComplementEnglishOnCurrentFileComplement,
minNumberOfCharacters: this.currentFileMinNumberOfCharacters,
makeSynonymAboutEmoji: this.settings.matchingWithoutEmoji,
makeSynonymAboutAccentsDiacritics: this.settings.treatAccentDiacriticsAsAlphabeticCharacters
makeSynonymAboutAccentsDiacritics: this.settings.treatAccentDiacriticsAsAlphabeticCharacters,
excludeWordPatterns: this.settings.excludeCurrentFileWordPatterns
});
this.statusBar.setCurrentFileIndexed(
this.currentFileWordProvider.wordCount
@@ -4240,7 +4268,8 @@ var AutoCompleteSuggest = class _AutoCompleteSuggest extends import_obsidian5.Ed
await this.currentVaultWordProvider.refreshWords({
minNumberOfCharacters: this.currentVaultMinNumberOfCharacters,
makeSynonymAboutEmoji: this.settings.matchingWithoutEmoji,
makeSynonymAboutAccentsDiacritics: this.settings.treatAccentDiacriticsAsAlphabeticCharacters
makeSynonymAboutAccentsDiacritics: this.settings.treatAccentDiacriticsAsAlphabeticCharacters,
excludeWordPatterns: this.settings.excludeCurrentVaultWordPatterns
});
this.statusBar.setCurrentVaultIndexed(
this.currentVaultWordProvider.wordCount
@@ -4390,6 +4419,7 @@ var AutoCompleteSuggest = class _AutoCompleteSuggest extends import_obsidian5.Ed
const onReturnNull = (message) => {
showDebugLog(message);
this.runManually = false;
this.completionMode = this.matchStrategy.name;
this.close();
};
if (!this.settings.complementAutomatically && !this.isOpen && !this.runManually) {
@@ -4485,7 +4515,7 @@ var AutoCompleteSuggest = class _AutoCompleteSuggest extends import_obsidian5.Ed
);
if (suppressedTokens.length === 0) {
onReturnNull(
`Don't show suggestions because all tokens are ignored by token pattern: ${String.raw`^[\u3040-\u309F\u30A0-\u30FF]{1,2}$`}`
"Don't show suggestions because all tokens are ignored by token pattern"
);
return null;
}
@@ -4503,6 +4533,7 @@ var AutoCompleteSuggest = class _AutoCompleteSuggest extends import_obsidian5.Ed
end: cursor,
query: JSON.stringify({
currentFrontMatter,
completionMode: this.completionMode,
queries: suppressedTokens.map((x) => ({
...x,
offset: x.offset - currentTokens[0].offset
@@ -4585,6 +4616,7 @@ var AutoCompleteSuggest = class _AutoCompleteSuggest extends import_obsidian5.Ed
}
selectSuggestion(word) {
var _a, _b;
this.completionMode = this.matchStrategy.name;
let forceWithAlias = false;
let context = this.context;
if (!context) {
@@ -4607,7 +4639,7 @@ var AutoCompleteSuggest = class _AutoCompleteSuggest extends import_obsidian5.Ed
insertedText = `${insertedText}, `;
}
} else {
if (this.settings.insertAfterCompletion && !(word.type === "customDictionary" && word.ignoreSpaceAfterCompletion)) {
if (this.settings.insertSpaceAfterCompletion && !(word.type === "customDictionary" && word.ignoreSpaceAfterCompletion)) {
insertedText = `${insertedText} `;
}
}
@@ -4738,15 +4770,15 @@ var DEFAULT_SETTINGS = {
delayMilliSeconds: 0,
disableSuggestionsDuringImeOn: false,
disableSuggestionsInMathBlock: false,
insertAfterCompletion: true,
insertSpaceAfterCompletion: false,
firstCharactersDisableSuggestions: ":/^",
patternsToSuppressTrigger: ["^~~~.*", "^```.*"],
phrasePatternsToSuppressTrigger: [],
noAutoFocusUntilCycle: false,
// appearance
showMatchStrategy: true,
showComplementAutomatically: true,
showIndexingStatus: true,
showMatchStrategy: false,
showComplementAutomatically: false,
showIndexingStatus: false,
descriptionOnSuggestion: "Short",
// key customization
hotkeys: {
@@ -4772,12 +4804,14 @@ var DEFAULT_SETTINGS = {
enableCurrentFileComplement: true,
currentFileMinNumberOfCharacters: 0,
onlyComplementEnglishOnCurrentFileComplement: false,
excludeCurrentFileWordPatterns: [],
// current vault complement
enableCurrentVaultComplement: false,
currentVaultMinNumberOfCharacters: 0,
includeCurrentVaultPathPrefixPatterns: "",
excludeCurrentVaultPathPrefixPatterns: "",
includeCurrentVaultOnlyFilesUnderCurrentDirectory: false,
excludeCurrentVaultWordPatterns: [],
// custom dictionary complement
enableCustomDictionaryComplement: false,
customDictionaryPaths: `https://raw.githubusercontent.com/first20hours/google-10000-english/master/google-10000-english-no-swears.txt`,
@@ -4799,7 +4833,7 @@ var DEFAULT_SETTINGS = {
},
frontMatterKeyForExclusionInternalLink: "",
// front matter complement
enableFrontMatterComplement: true,
enableFrontMatterComplement: false,
frontMatterComplementMatchStrategy: "inherit",
insertCommaAfterFrontMatterCompletion: false,
intelligentSuggestionPrioritization: {
@@ -4811,10 +4845,7 @@ var DEFAULT_SETTINGS = {
// mobile
disableOnMobile: false,
// debug
showLogAboutPerformanceInConsole: false,
// others
// TODO: Want to remove in the future version
selectionHistoryTree: {}
showLogAboutPerformanceInConsole: false
};
var VariousComplementsSettingTab = class extends import_obsidian7.PluginSettingTab {
constructor(app2, plugin) {
@@ -4998,7 +5029,7 @@ var VariousComplementsSettingTab = class extends import_obsidian7.PluginSettingT
await this.plugin.saveSettings();
});
});
new import_obsidian7.Setting(containerEl).setName("Disable suggestions in the Math block.").setDesc("It doesn't support the inline Math block.").addToggle((tc) => {
new import_obsidian7.Setting(containerEl).setName("Disable suggestions in the Math block").setDesc("It doesn't support the inline Math block.").addToggle((tc) => {
tc.setValue(
this.plugin.settings.disableSuggestionsInMathBlock
).onChange(async (value) => {
@@ -5007,9 +5038,9 @@ var VariousComplementsSettingTab = class extends import_obsidian7.PluginSettingT
});
});
new import_obsidian7.Setting(containerEl).setName("Insert space after completion").addToggle((tc) => {
tc.setValue(this.plugin.settings.insertAfterCompletion).onChange(
tc.setValue(this.plugin.settings.insertSpaceAfterCompletion).onChange(
async (value) => {
this.plugin.settings.insertAfterCompletion = value;
this.plugin.settings.insertSpaceAfterCompletion = value;
await this.plugin.saveSettings();
}
);
@@ -5179,6 +5210,18 @@ var VariousComplementsSettingTab = class extends import_obsidian7.PluginSettingT
await this.plugin.saveSettings({ currentFile: true });
});
});
new import_obsidian7.Setting(containerEl).setName("Exclude word patterns for indexing").setDesc(
"Regexp patterns for words to be excluded from the suggestions, separated by line breaks."
).addTextArea((tc) => {
const el = tc.setValue(
this.plugin.settings.excludeCurrentFileWordPatterns.join("\n")
).onChange(async (value) => {
this.plugin.settings.excludeCurrentFileWordPatterns = smartLineBreakSplit(value);
await this.plugin.saveSettings();
});
el.inputEl.className = "various-complements__settings__text-area-path-dense";
return el;
});
}
}
addCurrentVaultComplementSettings(containerEl) {
@@ -5230,6 +5273,18 @@ var VariousComplementsSettingTab = class extends import_obsidian7.PluginSettingT
await this.plugin.saveSettings();
});
});
new import_obsidian7.Setting(containerEl).setName("Exclude word patterns for indexing").setDesc(
"Regexp patterns for words to be excluded from the suggestions, separated by line breaks."
).addTextArea((tc) => {
const el = tc.setValue(
this.plugin.settings.excludeCurrentVaultWordPatterns.join("\n")
).onChange(async (value) => {
this.plugin.settings.excludeCurrentVaultWordPatterns = smartLineBreakSplit(value);
await this.plugin.saveSettings();
});
el.inputEl.className = "various-complements__settings__text-area-path-dense";
return el;
});
}
}
addCustomDictionaryComplementSettings(containerEl) {
@@ -7860,6 +7915,13 @@ var VariousComponents = class extends import_obsidian9.Plugin {
this.suggester.hideCompletion();
}
});
this.addCommand({
id: "fallback-linkify",
name: "Fallback linkify",
callback: async () => {
this.suggester.triggerComplete({ fallbackLinkify: true });
}
});
this.addCommand({
id: "add-word-custom-dictionary",
name: "Add a word to a custom dictionary",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"id": "various-complements",
"name": "Various Complements",
"version": "9.4.0",
"version": "10.0.0",
"minAppVersion": "0.16.0",
"description": "This plugin enables you to complete words like the auto-completion of IDE",
"author": "tadashi-aikawa",
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,7 +1,7 @@
{
"id": "vertical-tabs-view",
"name": "Vertical Tabs View",
"version": "2.4.5",
"version": "2.6.0",
"minAppVersion": "0.15.0",
"description": "Provides a vertical tabs view.",
"author": "hdykokd",
+25 -11
View File
@@ -1,6 +1,6 @@
#vertical-tabs-view-content {
padding: 0;
margin: 2px;
/* margin: 2px; */
}
ul.vertical-tabs-view-list {
@@ -19,9 +19,9 @@ ul.vertical-tabs-view-list {
color: var(--tab-text-color);
font-size: var(--tab-font-size);
font-weight: var(--tab-font-weight);
padding: 2px 0 2px 2px;
padding: 2px;
width: 100%;
min-height: 2.5rem;
min-height: 2.5em;
border-radius: var(--tab-radius);
overflow: hidden;
white-space: nowrap;
@@ -31,6 +31,10 @@ ul.vertical-tabs-view-list {
color: var(--tab-text-color-focused-active-current);
background-color: var(--tab-background-active);
}
.vertical-tabs-view-list li.vertical-tabs-view-list-item.selected {
border: 2px dashed var(--tab-text-color-focused-highlighted);
margin: 1px 0;
}
.vertical-tabs-view-list li.vertical-tabs-view-list-item:hover {
background-color: var(--background-modifier-hover);
@@ -76,24 +80,23 @@ ul.vertical-tabs-view-list {
.vertical-tabs-view-list li .vertical-tabs-view-list-item-right-container {
flex-shrink: 0;
}
/* icons */
.vertical-tabs-view-list li .vertical-tabs-view-list-item-icon {
color: var(--tab-text-color);
padding-top: 0.25em;
}
.vertical-tabs-view-list li .vertical-tabs-view-list-item-icon._hidden {
display: none;
}
.vertical-tabs-view-list li .vertical-tabs-view-list-item-tab-icon {
margin: 0 0.25em;
margin: 0 0.5em 0 0.25em;
min-width: var(--icon-s);
--icon-size: var(--icon-s);
--icon-stroke: var(--icon-s-stroke-width);
}
.vertical-tabs-view-list li .vertical-tabs-view-list-item-close-btn,
.vertical-tabs-view-list li .vertical-tabs-view-list-item-pin-btn {
cursor: pointer;
--icon-size: var(--icon-l);
--icon-stroke: var(--icon-l-stroke-width);
}
.vertical-tabs-view-list li .vertical-tabs-view-list-item-close-btn:hover,
@@ -107,8 +110,19 @@ ul.vertical-tabs-view-list {
}
.vertical-tabs-view-list li .vertical-tabs-view-list-item-pin-btn {
margin-right: 0.5em;
margin-top: 0.5em;
margin-right: 0.25em;
}
.vertical-tabs-view-list li .vertical-tabs-view-list-item-pin-btn-pin {
opacity: 0.75;
}
.vertical-tabs-view-list-item-close-btn > svg,
.vertical-tabs-view-list-item-pin-btn > svg,
.vertical-tabs-view-list-item-tab-icon > svg {
width: 1.5em;
height: 1.5em;
stroke-width: var(--icon-s-stroke-width);
}
.vertical-tabs-view-list li .vertical-tabs-view-list-item-name-container {
+3 -3
View File
@@ -4,7 +4,7 @@
"showCitekeyInSuggester": true,
"literatureNoteFolder": "sources/zotero",
"enableServer": true,
"serverPort": 9092,
"serverPort": 65500,
"serverHostname": "127.0.0.1",
"template": {
"folder": "templates/zotero",
@@ -21,7 +21,7 @@
],
"autoRefresh": true,
"zoteroDataDir": "/Users/oscarplaisant/Zotero",
"citationLibrary": 2,
"imgExcerptImport": "symlink",
"citationLibrary": 1,
"imgExcerptImport": "copy",
"imgExcerptPath": "images/zotero"
}