obsidian-dev-utils 88.6.0 → 88.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/integration-test-plugin/main.js +309 -190
- package/dist/lib/cjs/__merged.cjs +4 -1
- package/dist/lib/cjs/__merged.d.cts +1 -0
- package/dist/lib/cjs/generated-during-build.cjs +1 -1
- package/dist/lib/cjs/obsidian/components/index.cjs +6 -3
- package/dist/lib/cjs/obsidian/components/index.d.cts +1 -0
- package/dist/lib/cjs/obsidian/components/syntax-highlighting-component.cjs +244 -0
- package/dist/lib/cjs/obsidian/components/syntax-highlighting-component.d.cts +149 -0
- package/dist/lib/cjs/obsidian/plugin/plugin-settings-tab.cjs +1 -1
- package/dist/lib/cjs/script-utils/cli-utils.cjs +9 -1
- package/dist/lib/cjs/script-utils/cli-utils.d.cts +6 -0
- package/dist/lib/cjs/script-utils/env-toggle.cjs +180 -0
- package/dist/lib/cjs/script-utils/env-toggle.d.cts +42 -0
- package/dist/lib/cjs/script-utils/git.cjs +156 -0
- package/dist/lib/cjs/script-utils/git.d.cts +37 -0
- package/dist/lib/cjs/script-utils/index.cjs +7 -1
- package/dist/lib/cjs/script-utils/index.d.cts +2 -0
- package/dist/lib/cjs/script-utils/linters/cspell.cjs +11 -2
- package/dist/lib/cjs/script-utils/linters/cspell.d.cts +7 -0
- package/dist/lib/cjs/script-utils/linters/markdownlint-cli2-config.cjs +7 -4
- package/dist/lib/cjs/script-utils/linters/markdownlint.cjs +17 -8
- package/dist/lib/cjs/script-utils/nano-staged-config.cjs +7 -11
- package/dist/lib/cjs/script-utils/nano-staged-config.d.cts +7 -5
- package/dist/lib/esm/__merged.d.mts +1 -0
- package/dist/lib/esm/__merged.mjs +3 -1
- package/dist/lib/esm/generated-during-build.mjs +1 -1
- package/dist/lib/esm/obsidian/components/index.d.mts +1 -0
- package/dist/lib/esm/obsidian/components/index.mjs +4 -2
- package/dist/lib/esm/obsidian/components/syntax-highlighting-component.d.mts +149 -0
- package/dist/lib/esm/obsidian/components/syntax-highlighting-component.mjs +136 -0
- package/dist/lib/esm/obsidian/plugin/plugin-settings-tab.mjs +1 -1
- package/dist/lib/esm/script-utils/cli-utils.d.mts +6 -0
- package/dist/lib/esm/script-utils/cli-utils.mjs +9 -1
- package/dist/lib/esm/script-utils/env-toggle.d.mts +42 -0
- package/dist/lib/esm/script-utils/env-toggle.mjs +60 -0
- package/dist/lib/esm/script-utils/git.d.mts +37 -0
- package/dist/lib/esm/script-utils/git.mjs +48 -0
- package/dist/lib/esm/script-utils/index.d.mts +2 -0
- package/dist/lib/esm/script-utils/index.mjs +5 -1
- package/dist/lib/esm/script-utils/linters/cspell.d.mts +7 -0
- package/dist/lib/esm/script-utils/linters/cspell.mjs +15 -3
- package/dist/lib/esm/script-utils/linters/markdownlint-cli2-config.mjs +7 -4
- package/dist/lib/esm/script-utils/linters/markdownlint.mjs +17 -8
- package/dist/lib/esm/script-utils/nano-staged-config.d.mts +7 -5
- package/dist/lib/esm/script-utils/nano-staged-config.mjs +10 -11
- package/dist/templates/dprint.json +2 -2
- package/obsidian/components/syntax-highlighting-component/package.json +6 -0
- package/package.json +2 -2
- package/script-utils/env-toggle/package.json +6 -0
- package/script-utils/git/package.json +6 -0
- package/@types/obsidian/package.json +0 -4
- package/dist/lib/cjs/@types/obsidian.d.cts +0 -28
- package/dist/lib/esm/@types/obsidian.d.mts +0 -28
|
@@ -6172,7 +6172,7 @@ async function getCommunityPluginRepo(pluginId) {
|
|
|
6172
6172
|
return entry?.repo ?? null;
|
|
6173
6173
|
}
|
|
6174
6174
|
async function getLatestReleaseVersion(repo) {
|
|
6175
|
-
const response = await (0,
|
|
6175
|
+
const response = await (0, import_obsidian104.requestUrl)(`https://api.github.com/repos/${repo}/releases/latest`);
|
|
6176
6176
|
const release = response.json;
|
|
6177
6177
|
return release.tag_name;
|
|
6178
6178
|
}
|
|
@@ -6235,7 +6235,7 @@ async function uninstallCommunityPlugin(params) {
|
|
|
6235
6235
|
await app.plugins.uninstallPlugin(pluginId);
|
|
6236
6236
|
}
|
|
6237
6237
|
async function fetchCommunityPluginEntries() {
|
|
6238
|
-
const response = await (0,
|
|
6238
|
+
const response = await (0, import_obsidian104.requestUrl)(COMMUNITY_PLUGINS_URL);
|
|
6239
6239
|
return response.json;
|
|
6240
6240
|
}
|
|
6241
6241
|
async function getCommunityPluginEntries() {
|
|
@@ -6249,7 +6249,7 @@ async function getCommunityPluginEntries() {
|
|
|
6249
6249
|
}
|
|
6250
6250
|
}
|
|
6251
6251
|
async function getPluginManifest(repo, version) {
|
|
6252
|
-
const response = await (0,
|
|
6252
|
+
const response = await (0, import_obsidian104.requestUrl)(`https://github.com/${repo}/releases/download/${version}/manifest.json`);
|
|
6253
6253
|
return response.json;
|
|
6254
6254
|
}
|
|
6255
6255
|
async function resolveCommunityPluginId(ref) {
|
|
@@ -6263,11 +6263,11 @@ async function resolveCommunityPluginId(ref) {
|
|
|
6263
6263
|
}
|
|
6264
6264
|
return entry.id;
|
|
6265
6265
|
}
|
|
6266
|
-
var
|
|
6266
|
+
var import_obsidian104, COMMUNITY_PLUGINS_STATE_KEY, COMMUNITY_PLUGINS_URL, DATA_JSON_INDENT;
|
|
6267
6267
|
var init_community_plugins = __esm({
|
|
6268
6268
|
"src/obsidian/community-plugins.ts"() {
|
|
6269
6269
|
"use strict";
|
|
6270
|
-
|
|
6270
|
+
import_obsidian104 = require("obsidian");
|
|
6271
6271
|
init_obsidian_dev_utils_state();
|
|
6272
6272
|
COMMUNITY_PLUGINS_STATE_KEY = "communityPluginEntriesPromise";
|
|
6273
6273
|
COMMUNITY_PLUGINS_URL = "https://raw.githubusercontent.com/obsidianmd/obsidian-releases/HEAD/community-plugins.json";
|
|
@@ -6417,13 +6417,13 @@ async function showModal(modalCreator) {
|
|
|
6417
6417
|
modal.open();
|
|
6418
6418
|
});
|
|
6419
6419
|
}
|
|
6420
|
-
var
|
|
6420
|
+
var import_obsidian105, ModalBase;
|
|
6421
6421
|
var init_modal = __esm({
|
|
6422
6422
|
"src/obsidian/modals/modal.ts"() {
|
|
6423
6423
|
"use strict";
|
|
6424
|
-
|
|
6424
|
+
import_obsidian105 = require("obsidian");
|
|
6425
6425
|
init_plugin_context();
|
|
6426
|
-
ModalBase = class extends
|
|
6426
|
+
ModalBase = class extends import_obsidian105.Modal {
|
|
6427
6427
|
/**
|
|
6428
6428
|
* A function to resolve the value of the modal.
|
|
6429
6429
|
*/
|
|
@@ -6463,11 +6463,11 @@ async function selectOption(params) {
|
|
|
6463
6463
|
})
|
|
6464
6464
|
);
|
|
6465
6465
|
}
|
|
6466
|
-
var
|
|
6466
|
+
var import_obsidian106, SelectOptionModal;
|
|
6467
6467
|
var init_select_option = __esm({
|
|
6468
6468
|
"src/obsidian/modals/select-option.ts"() {
|
|
6469
6469
|
"use strict";
|
|
6470
|
-
|
|
6470
|
+
import_obsidian106 = require("obsidian");
|
|
6471
6471
|
init_css_class();
|
|
6472
6472
|
init_modal();
|
|
6473
6473
|
SelectOptionModal = class extends ModalBase {
|
|
@@ -6493,7 +6493,7 @@ var init_select_option = __esm({
|
|
|
6493
6493
|
this.contentEl.createEl("p", { text: this.message });
|
|
6494
6494
|
}
|
|
6495
6495
|
for (const option of this.options) {
|
|
6496
|
-
const button = new
|
|
6496
|
+
const button = new import_obsidian106.ButtonComponent(this.contentEl);
|
|
6497
6497
|
button.setButtonText(option.text);
|
|
6498
6498
|
if (option.isCta) {
|
|
6499
6499
|
button.setCta();
|
|
@@ -6637,7 +6637,7 @@ async function resolveDemoVaultArchive(params) {
|
|
|
6637
6637
|
}
|
|
6638
6638
|
progressNotice.setContent(`Downloading demo vault for ${pluginName} v${version}\u2026`);
|
|
6639
6639
|
const assetUrl = `https://github.com/${repo}/releases/download/${version}/${pluginId}-demo-vault-${version}.zip`;
|
|
6640
|
-
const response = await (0,
|
|
6640
|
+
const response = await (0, import_obsidian107.requestUrl)({
|
|
6641
6641
|
throw: false,
|
|
6642
6642
|
url: assetUrl
|
|
6643
6643
|
});
|
|
@@ -6650,7 +6650,7 @@ async function resolveDemoVaultArchive(params) {
|
|
|
6650
6650
|
(0, import_node_fs.writeFileSync)(archivePath, archive);
|
|
6651
6651
|
return archive;
|
|
6652
6652
|
}
|
|
6653
|
-
var import_adm_zip, import_compare_versions2, import_node_buffer, import_node_fs, import_node_os,
|
|
6653
|
+
var import_adm_zip, import_compare_versions2, import_node_buffer, import_node_fs, import_node_os, import_obsidian107, DEMO_VAULTS_CACHE_FOLDER, ARCHIVES_SUBFOLDER, EXTRACTED_VAULTS_SUBFOLDER, HTTP_STATUS_OK, ORPHANED_EXTRACTED_VAULT_MAX_AGE_IN_MILLISECONDS;
|
|
6654
6654
|
var init_desktop_demo_vault_opener = __esm({
|
|
6655
6655
|
"src/obsidian/desktop-demo-vault-opener.ts"() {
|
|
6656
6656
|
"use strict";
|
|
@@ -6659,7 +6659,7 @@ var init_desktop_demo_vault_opener = __esm({
|
|
|
6659
6659
|
import_node_buffer = require("node:buffer");
|
|
6660
6660
|
import_node_fs = require("node:fs");
|
|
6661
6661
|
import_node_os = require("node:os");
|
|
6662
|
-
|
|
6662
|
+
import_obsidian107 = require("obsidian");
|
|
6663
6663
|
init_path();
|
|
6664
6664
|
init_community_plugins();
|
|
6665
6665
|
init_select_option();
|
|
@@ -12116,7 +12116,7 @@ __export(attachment_path_exports, {
|
|
|
12116
12116
|
isAtProperAttachmentPath: () => isAtProperAttachmentPath
|
|
12117
12117
|
});
|
|
12118
12118
|
|
|
12119
|
-
// node_modules/@obsidian-typings/obsidian-public-1.
|
|
12119
|
+
// node_modules/@obsidian-typings/obsidian-public-1.13.4/dist/esm/implementations.mjs
|
|
12120
12120
|
var import_obsidian2 = require("obsidian");
|
|
12121
12121
|
var import_obsidian3 = require("obsidian");
|
|
12122
12122
|
var import_obsidian4 = require("obsidian");
|
|
@@ -12208,6 +12208,10 @@ var import_obsidian89 = require("obsidian");
|
|
|
12208
12208
|
var import_obsidian90 = require("obsidian");
|
|
12209
12209
|
var import_obsidian91 = require("obsidian");
|
|
12210
12210
|
var import_obsidian92 = require("obsidian");
|
|
12211
|
+
var import_obsidian93 = require("obsidian");
|
|
12212
|
+
var import_obsidian94 = require("obsidian");
|
|
12213
|
+
var import_obsidian95 = require("obsidian");
|
|
12214
|
+
var import_obsidian96 = require("obsidian");
|
|
12211
12215
|
var CustomArrayDictImpl = class {
|
|
12212
12216
|
/**
|
|
12213
12217
|
* Internal map storing key-to-array mappings.
|
|
@@ -12452,10 +12456,10 @@ var ViewType = {
|
|
|
12452
12456
|
WebviewerHistory: "webviewer-history"
|
|
12453
12457
|
};
|
|
12454
12458
|
function getTFileConstructor() {
|
|
12455
|
-
return
|
|
12459
|
+
return import_obsidian36.TFile;
|
|
12456
12460
|
}
|
|
12457
12461
|
function getTFolderConstructor() {
|
|
12458
|
-
return
|
|
12462
|
+
return import_obsidian37.TFolder;
|
|
12459
12463
|
}
|
|
12460
12464
|
function parentFolderPath(path) {
|
|
12461
12465
|
return path.replace(/\/?[^/]*$/, "") || "/";
|
|
@@ -12484,7 +12488,7 @@ function getDataAdapterEx(app) {
|
|
|
12484
12488
|
return app.vault.adapter;
|
|
12485
12489
|
}
|
|
12486
12490
|
async function loadPrism() {
|
|
12487
|
-
return await (0,
|
|
12491
|
+
return await (0, import_obsidian96.loadPrism)();
|
|
12488
12492
|
}
|
|
12489
12493
|
function isReferenceCache(reference) {
|
|
12490
12494
|
return !!reference.position;
|
|
@@ -12533,7 +12537,7 @@ __export(file_system_exports, {
|
|
|
12533
12537
|
isTreatedAsAttachment: () => isTreatedAsAttachment,
|
|
12534
12538
|
trimMarkdownExtension: () => trimMarkdownExtension
|
|
12535
12539
|
});
|
|
12536
|
-
var
|
|
12540
|
+
var import_obsidian97 = require("obsidian");
|
|
12537
12541
|
init_path();
|
|
12538
12542
|
init_string();
|
|
12539
12543
|
init_type_guards();
|
|
@@ -12666,7 +12670,7 @@ function asFileOrNull(abstractFile) {
|
|
|
12666
12670
|
if (abstractFile === null) {
|
|
12667
12671
|
return null;
|
|
12668
12672
|
}
|
|
12669
|
-
if (abstractFile instanceof
|
|
12673
|
+
if (abstractFile instanceof import_obsidian97.TFile) {
|
|
12670
12674
|
return abstractFile;
|
|
12671
12675
|
}
|
|
12672
12676
|
throw new Error("Abstract file is not a file");
|
|
@@ -12678,7 +12682,7 @@ function asFolderOrNull(abstractFile) {
|
|
|
12678
12682
|
if (abstractFile === null) {
|
|
12679
12683
|
return null;
|
|
12680
12684
|
}
|
|
12681
|
-
if (abstractFile instanceof
|
|
12685
|
+
if (abstractFile instanceof import_obsidian97.TFolder) {
|
|
12682
12686
|
return abstractFile;
|
|
12683
12687
|
}
|
|
12684
12688
|
throw new Error("Abstract file is not a folder");
|
|
@@ -12858,8 +12862,8 @@ function getMarkdownFiles(params) {
|
|
|
12858
12862
|
});
|
|
12859
12863
|
let markdownFiles = [];
|
|
12860
12864
|
if (isRecursive) {
|
|
12861
|
-
|
|
12862
|
-
if (isMarkdownFile(abstractFile) && abstractFile instanceof
|
|
12865
|
+
import_obsidian97.Vault.recurseChildren(folder, (abstractFile) => {
|
|
12866
|
+
if (isMarkdownFile(abstractFile) && abstractFile instanceof import_obsidian97.TFile) {
|
|
12863
12867
|
markdownFiles.push(abstractFile);
|
|
12864
12868
|
}
|
|
12865
12869
|
});
|
|
@@ -12905,7 +12909,7 @@ function getPath2(app, pathOrFile) {
|
|
|
12905
12909
|
return getResolvedPath(pathOrFile);
|
|
12906
12910
|
}
|
|
12907
12911
|
function isAbstractFile(file) {
|
|
12908
|
-
return file instanceof
|
|
12912
|
+
return file instanceof import_obsidian97.TAbstractFile;
|
|
12909
12913
|
}
|
|
12910
12914
|
function isBaseFile(pathOrFile) {
|
|
12911
12915
|
return checkExtension(pathOrFile, BASE_FILE_EXTENSION);
|
|
@@ -12914,10 +12918,10 @@ function isCanvasFile(pathOrFile) {
|
|
|
12914
12918
|
return checkExtension(pathOrFile, CANVAS_FILE_EXTENSION);
|
|
12915
12919
|
}
|
|
12916
12920
|
function isFile(file) {
|
|
12917
|
-
return file instanceof
|
|
12921
|
+
return file instanceof import_obsidian97.TFile;
|
|
12918
12922
|
}
|
|
12919
12923
|
function isFolder(file) {
|
|
12920
|
-
return file instanceof
|
|
12924
|
+
return file instanceof import_obsidian97.TFolder;
|
|
12921
12925
|
}
|
|
12922
12926
|
function isMarkdownFile(pathOrFile) {
|
|
12923
12927
|
return checkExtension(pathOrFile, MARKDOWN_FILE_EXTENSION);
|
|
@@ -12968,7 +12972,7 @@ function getName(pathOrFile) {
|
|
|
12968
12972
|
return isAbstractFile(pathOrFile) ? pathOrFile.name : basename(pathOrFile);
|
|
12969
12973
|
}
|
|
12970
12974
|
function getResolvedPath(path) {
|
|
12971
|
-
return (0,
|
|
12975
|
+
return (0, import_obsidian97.normalizePath)(resolve("/", path));
|
|
12972
12976
|
}
|
|
12973
12977
|
|
|
12974
12978
|
// src/obsidian/attachment-path.ts
|
|
@@ -13175,7 +13179,7 @@ var resource_url_exports = {};
|
|
|
13175
13179
|
__export(resource_url_exports, {
|
|
13176
13180
|
relativePathToResourceUrl: () => relativePathToResourceUrl
|
|
13177
13181
|
});
|
|
13178
|
-
var
|
|
13182
|
+
var import_obsidian98 = require("obsidian");
|
|
13179
13183
|
init_path();
|
|
13180
13184
|
function relativePathToResourceUrl(params) {
|
|
13181
13185
|
const {
|
|
@@ -13184,7 +13188,7 @@ function relativePathToResourceUrl(params) {
|
|
|
13184
13188
|
relativePath
|
|
13185
13189
|
} = params;
|
|
13186
13190
|
const noteFullPath = toPosixPath(getDataAdapterEx(app).getFullRealPath(notePath));
|
|
13187
|
-
const noteUrl = `${
|
|
13191
|
+
const noteUrl = `${import_obsidian98.Platform.resourcePathPrefix}${noteFullPath}`;
|
|
13188
13192
|
const relativeUrl = new URL(relativePath, noteUrl);
|
|
13189
13193
|
return String(relativeUrl);
|
|
13190
13194
|
}
|
|
@@ -13675,7 +13679,7 @@ __export(link_exports, {
|
|
|
13675
13679
|
updateLinksInContent: () => updateLinksInContent,
|
|
13676
13680
|
updateLinksInFile: () => updateLinksInFile
|
|
13677
13681
|
});
|
|
13678
|
-
var
|
|
13682
|
+
var import_obsidian101 = require("obsidian");
|
|
13679
13683
|
init_abort_controller();
|
|
13680
13684
|
init_obsidian_dev_utils_state();
|
|
13681
13685
|
init_path();
|
|
@@ -13759,18 +13763,18 @@ __export(frontmatter_exports, {
|
|
|
13759
13763
|
parseFrontmatter: () => parseFrontmatter,
|
|
13760
13764
|
setFrontmatter: () => setFrontmatter
|
|
13761
13765
|
});
|
|
13762
|
-
var
|
|
13766
|
+
var import_obsidian99 = require("obsidian");
|
|
13763
13767
|
init_string();
|
|
13764
13768
|
function parseFrontmatter(content3) {
|
|
13765
|
-
const frontmatterInfo = (0,
|
|
13766
|
-
return (0,
|
|
13769
|
+
const frontmatterInfo = (0, import_obsidian99.getFrontMatterInfo)(content3);
|
|
13770
|
+
return (0, import_obsidian99.parseYaml)(frontmatterInfo.frontmatter) ?? {};
|
|
13767
13771
|
}
|
|
13768
13772
|
function setFrontmatter(content3, newFrontmatter) {
|
|
13769
|
-
const frontmatterInfo = (0,
|
|
13773
|
+
const frontmatterInfo = (0, import_obsidian99.getFrontMatterInfo)(content3);
|
|
13770
13774
|
if (Object.keys(newFrontmatter).length === 0) {
|
|
13771
13775
|
return content3.slice(frontmatterInfo.contentStart);
|
|
13772
13776
|
}
|
|
13773
|
-
const newFrontmatterStr = (0,
|
|
13777
|
+
const newFrontmatterStr = (0, import_obsidian99.stringifyYaml)(newFrontmatter);
|
|
13774
13778
|
return frontmatterInfo.exists ? insertAt({
|
|
13775
13779
|
endIndex: frontmatterInfo.to,
|
|
13776
13780
|
startIndex: frontmatterInfo.from,
|
|
@@ -13859,7 +13863,7 @@ __export(vault_exports, {
|
|
|
13859
13863
|
saveNote: () => saveNote,
|
|
13860
13864
|
trashSafe: () => trashSafe
|
|
13861
13865
|
});
|
|
13862
|
-
var
|
|
13866
|
+
var import_obsidian100 = require("obsidian");
|
|
13863
13867
|
init_abort_controller();
|
|
13864
13868
|
init_debug();
|
|
13865
13869
|
init_function();
|
|
@@ -14243,7 +14247,7 @@ async function saveNote(app, pathOrFile) {
|
|
|
14243
14247
|
}
|
|
14244
14248
|
const path = getPath2(app, pathOrFile);
|
|
14245
14249
|
for (const leaf of app.workspace.getLeavesOfType(ViewType.Markdown)) {
|
|
14246
|
-
if (leaf.view instanceof
|
|
14250
|
+
if (leaf.view instanceof import_obsidian100.MarkdownView && leaf.view.file?.path === path && leaf.view.dirty) {
|
|
14247
14251
|
await leaf.view.save();
|
|
14248
14252
|
}
|
|
14249
14253
|
}
|
|
@@ -25745,7 +25749,7 @@ function shouldResetAlias(params) {
|
|
|
25745
25749
|
const cleanDisplayText = replaceAll({
|
|
25746
25750
|
replacer: "",
|
|
25747
25751
|
searchValue: /^\.\//g,
|
|
25748
|
-
str: (0,
|
|
25752
|
+
str: (0, import_obsidian101.normalizePath)(ensureNonNullable(displayText.split(" > ")[0]))
|
|
25749
25753
|
}).toLowerCase();
|
|
25750
25754
|
for (const alias of aliasesToReset) {
|
|
25751
25755
|
if (alias.toLowerCase() === cleanDisplayText) {
|
|
@@ -25760,7 +25764,7 @@ function shouldResetAlias(params) {
|
|
|
25760
25764
|
return false;
|
|
25761
25765
|
}
|
|
25762
25766
|
function splitSubpath(link2) {
|
|
25763
|
-
const parsed = (0,
|
|
25767
|
+
const parsed = (0, import_obsidian101.parseLinktext)(normalizeString(link2));
|
|
25764
25768
|
return {
|
|
25765
25769
|
linkPath: parsed.path,
|
|
25766
25770
|
subpath: parsed.subpath
|
|
@@ -26280,7 +26284,7 @@ var bases_view_registrar_exports = {};
|
|
|
26280
26284
|
__export(bases_view_registrar_exports, {
|
|
26281
26285
|
PluginBasesViewRegistrar: () => PluginBasesViewRegistrar
|
|
26282
26286
|
});
|
|
26283
|
-
var
|
|
26287
|
+
var import_obsidian102 = require("obsidian");
|
|
26284
26288
|
var PluginBasesViewRegistrar = class {
|
|
26285
26289
|
/**
|
|
26286
26290
|
* Creates a new instance of the {@link PluginBasesViewRegistrar} class.
|
|
@@ -26782,10 +26786,10 @@ var component_ex_exports = {};
|
|
|
26782
26786
|
__export(component_ex_exports, {
|
|
26783
26787
|
ComponentEx: () => ComponentEx
|
|
26784
26788
|
});
|
|
26785
|
-
var
|
|
26789
|
+
var import_obsidian103 = require("obsidian");
|
|
26786
26790
|
init_error();
|
|
26787
26791
|
init_function();
|
|
26788
|
-
var ComponentEx = class _ComponentEx extends
|
|
26792
|
+
var ComponentEx = class _ComponentEx extends import_obsidian103.Component {
|
|
26789
26793
|
childrenSet = /* @__PURE__ */ new Set();
|
|
26790
26794
|
hasBeenLoaded = false;
|
|
26791
26795
|
loadErrors = [];
|
|
@@ -27657,7 +27661,7 @@ var open_demo_vault_command_handler_exports = {};
|
|
|
27657
27661
|
__export(open_demo_vault_command_handler_exports, {
|
|
27658
27662
|
OpenDemoVaultCommandHandler: () => OpenDemoVaultCommandHandler
|
|
27659
27663
|
});
|
|
27660
|
-
var
|
|
27664
|
+
var import_obsidian108 = require("obsidian");
|
|
27661
27665
|
var OpenDemoVaultCommandHandler = class extends GlobalCommandHandler {
|
|
27662
27666
|
/**
|
|
27663
27667
|
* The Obsidian app instance.
|
|
@@ -27710,7 +27714,7 @@ var OpenDemoVaultCommandHandler = class extends GlobalCommandHandler {
|
|
|
27710
27714
|
* @returns Whether the app is running on desktop.
|
|
27711
27715
|
*/
|
|
27712
27716
|
canExecute() {
|
|
27713
|
-
return
|
|
27717
|
+
return import_obsidian108.Platform.isDesktopApp;
|
|
27714
27718
|
}
|
|
27715
27719
|
};
|
|
27716
27720
|
|
|
@@ -27862,7 +27866,8 @@ __export(components_exports, {
|
|
|
27862
27866
|
"plugin-settings-tab-component": () => plugin_settings_tab_component_exports,
|
|
27863
27867
|
"pointer-position-component": () => pointer_position_component_exports,
|
|
27864
27868
|
"registry-component": () => registry_component_exports,
|
|
27865
|
-
"rename-delete-handler-component": () => rename_delete_handler_component_exports
|
|
27869
|
+
"rename-delete-handler-component": () => rename_delete_handler_component_exports,
|
|
27870
|
+
"syntax-highlighting-component": () => syntax_highlighting_component_exports
|
|
27866
27871
|
});
|
|
27867
27872
|
|
|
27868
27873
|
// src/obsidian/components/abort-signal-component.ts
|
|
@@ -28086,7 +28091,7 @@ var plugin_notice_component_exports = {};
|
|
|
28086
28091
|
__export(plugin_notice_component_exports, {
|
|
28087
28092
|
PluginNoticeComponent: () => PluginNoticeComponent
|
|
28088
28093
|
});
|
|
28089
|
-
var
|
|
28094
|
+
var import_obsidian109 = require("obsidian");
|
|
28090
28095
|
init_obsidian_dev_utils_state();
|
|
28091
28096
|
init_type_guards();
|
|
28092
28097
|
init_value_provider();
|
|
@@ -28400,7 +28405,7 @@ var PluginNoticeComponent = class extends ComponentEx {
|
|
|
28400
28405
|
});
|
|
28401
28406
|
addPluginCssClasses(closeButtonEl, "plugin-notice-close-button" /* PluginNoticeCloseButton */);
|
|
28402
28407
|
closeButtonEl.addClasses(["clickable-icon" /* ClickableIcon */, "modal-header-button" /* ModalHeaderButton */]);
|
|
28403
|
-
(0,
|
|
28408
|
+
(0, import_obsidian109.setIcon)(closeButtonEl, "x");
|
|
28404
28409
|
closeButtonEl.addEventListener("click", (evt) => {
|
|
28405
28410
|
evt.stopPropagation();
|
|
28406
28411
|
invokeAsyncSafely(async () => {
|
|
@@ -28436,7 +28441,7 @@ var PluginNoticeComponent = class extends ComponentEx {
|
|
|
28436
28441
|
fragment.appendChild(content3);
|
|
28437
28442
|
}
|
|
28438
28443
|
if (abortController) {
|
|
28439
|
-
const cancelButton = new
|
|
28444
|
+
const cancelButton = new import_obsidian109.ButtonComponent(createDiv());
|
|
28440
28445
|
cancelButton.setButtonText(cancelButtonText ?? t2(($) => $.obsidianDevUtils.buttons.cancel));
|
|
28441
28446
|
addPluginCssClasses(cancelButton.buttonEl, "cancel-button" /* CancelButton */);
|
|
28442
28447
|
cancelButton.buttonEl.addEventListener("click", () => {
|
|
@@ -28576,7 +28581,7 @@ var PluginNoticeComponent = class extends ComponentEx {
|
|
|
28576
28581
|
shouldShowCloseButton
|
|
28577
28582
|
}));
|
|
28578
28583
|
if (!isReusable) {
|
|
28579
|
-
builtNotice = new
|
|
28584
|
+
builtNotice = new import_obsidian109.Notice(content3, noticeDurationInMilliseconds);
|
|
28580
28585
|
this.installExplicitCloseGuards(builtNotice, requiresExplicitClose);
|
|
28581
28586
|
this.installUserClickTracking(builtNotice);
|
|
28582
28587
|
this.wireOnHide(builtNotice, onHide);
|
|
@@ -28584,7 +28589,7 @@ var PluginNoticeComponent = class extends ComponentEx {
|
|
|
28584
28589
|
return builtNotice;
|
|
28585
28590
|
}
|
|
28586
28591
|
this.notice?.hide();
|
|
28587
|
-
builtNotice = new
|
|
28592
|
+
builtNotice = new import_obsidian109.Notice(content3, noticeDurationInMilliseconds);
|
|
28588
28593
|
this.notice = builtNotice;
|
|
28589
28594
|
this.installExplicitCloseGuards(builtNotice, requiresExplicitClose);
|
|
28590
28595
|
this.installUserClickTracking(builtNotice);
|
|
@@ -28662,7 +28667,7 @@ var async_events_component_exports = {};
|
|
|
28662
28667
|
__export(async_events_component_exports, {
|
|
28663
28668
|
registerAsyncEvent: () => registerAsyncEvent
|
|
28664
28669
|
});
|
|
28665
|
-
var
|
|
28670
|
+
var import_obsidian110 = require("obsidian");
|
|
28666
28671
|
function registerAsyncEvent(component, eventRef) {
|
|
28667
28672
|
component.register(() => {
|
|
28668
28673
|
eventRef.asyncEventSource.offref(eventRef);
|
|
@@ -28755,7 +28760,7 @@ var disposable_component_exports = {};
|
|
|
28755
28760
|
__export(disposable_component_exports, {
|
|
28756
28761
|
asDisposableComponent: () => asDisposableComponent
|
|
28757
28762
|
});
|
|
28758
|
-
var
|
|
28763
|
+
var import_obsidian111 = require("obsidian");
|
|
28759
28764
|
function asDisposableComponent(component) {
|
|
28760
28765
|
const disposableEx = component;
|
|
28761
28766
|
const symbolDispose = disposableEx[Symbol.dispose] ?? (() => {
|
|
@@ -29113,7 +29118,7 @@ var duration_transformer_exports = {};
|
|
|
29113
29118
|
__export(duration_transformer_exports, {
|
|
29114
29119
|
DurationTransformer: () => DurationTransformer
|
|
29115
29120
|
});
|
|
29116
|
-
var
|
|
29121
|
+
var import_obsidian112 = require("obsidian");
|
|
29117
29122
|
var DurationTransformer = class extends TypedTransformer {
|
|
29118
29123
|
/**
|
|
29119
29124
|
* An id of the transformer.
|
|
@@ -29140,7 +29145,7 @@ var DurationTransformer = class extends TypedTransformer {
|
|
|
29140
29145
|
* @returns The restored value.
|
|
29141
29146
|
*/
|
|
29142
29147
|
restoreValue(transformedValue) {
|
|
29143
|
-
return
|
|
29148
|
+
return import_obsidian112.moment.duration(transformedValue);
|
|
29144
29149
|
}
|
|
29145
29150
|
/**
|
|
29146
29151
|
* Transforms the value to a string.
|
|
@@ -30005,7 +30010,7 @@ var plugin_settings_tab_component_exports = {};
|
|
|
30005
30010
|
__export(plugin_settings_tab_component_exports, {
|
|
30006
30011
|
PluginSettingsTabComponent: () => PluginSettingsTabComponent
|
|
30007
30012
|
});
|
|
30008
|
-
var
|
|
30013
|
+
var import_obsidian113 = require("obsidian");
|
|
30009
30014
|
var PluginSettingsTabComponent = class extends ComponentEx {
|
|
30010
30015
|
/**
|
|
30011
30016
|
* The plugin the settings tab is registered with.
|
|
@@ -30164,7 +30169,7 @@ __export(rename_delete_handler_component_exports, {
|
|
|
30164
30169
|
EmptyFolderBehavior: () => EmptyFolderBehavior,
|
|
30165
30170
|
RenameDeleteHandlerComponent: () => RenameDeleteHandlerComponent
|
|
30166
30171
|
});
|
|
30167
|
-
var
|
|
30172
|
+
var import_obsidian117 = require("obsidian");
|
|
30168
30173
|
init_array();
|
|
30169
30174
|
init_debug();
|
|
30170
30175
|
init_obsidian_dev_utils_state();
|
|
@@ -30181,7 +30186,7 @@ __export(resource_lock_exports, {
|
|
|
30181
30186
|
requestResourceUnlockForPath: () => requestResourceUnlockForPath,
|
|
30182
30187
|
unlockResourceForPath: () => unlockResourceForPath
|
|
30183
30188
|
});
|
|
30184
|
-
var
|
|
30189
|
+
var import_obsidian116 = require("obsidian");
|
|
30185
30190
|
init_disposable();
|
|
30186
30191
|
init_function();
|
|
30187
30192
|
init_obsidian_dev_utils_state();
|
|
@@ -30195,14 +30200,14 @@ __export(editor_exports, {
|
|
|
30195
30200
|
});
|
|
30196
30201
|
var import_state = require("@codemirror/state");
|
|
30197
30202
|
var import_view = require("@codemirror/view");
|
|
30198
|
-
var
|
|
30203
|
+
var import_obsidian114 = require("obsidian");
|
|
30199
30204
|
var compartmentByCodeMirror = /* @__PURE__ */ new WeakMap();
|
|
30200
30205
|
var isProcessingLockedEditorKeydown = false;
|
|
30201
30206
|
function syncOpenEditorBuffersForPath(app, pathOrFile, content3) {
|
|
30202
30207
|
const path = getPath2(app, pathOrFile);
|
|
30203
30208
|
for (const leaf of app.workspace.getLeavesOfType(ViewType.Markdown)) {
|
|
30204
30209
|
const view = leaf.view;
|
|
30205
|
-
if (!(view instanceof
|
|
30210
|
+
if (!(view instanceof import_obsidian114.MarkdownView)) {
|
|
30206
30211
|
continue;
|
|
30207
30212
|
}
|
|
30208
30213
|
if (view.file?.path !== path) {
|
|
@@ -30265,7 +30270,7 @@ var confirm_exports = {};
|
|
|
30265
30270
|
__export(confirm_exports, {
|
|
30266
30271
|
confirm: () => confirm
|
|
30267
30272
|
});
|
|
30268
|
-
var
|
|
30273
|
+
var import_obsidian115 = require("obsidian");
|
|
30269
30274
|
init_css_class();
|
|
30270
30275
|
init_modal();
|
|
30271
30276
|
var ConfirmModal = class extends ModalBase {
|
|
@@ -30288,7 +30293,7 @@ var ConfirmModal = class extends ModalBase {
|
|
|
30288
30293
|
onOpen() {
|
|
30289
30294
|
this.titleEl.setText(this.title);
|
|
30290
30295
|
this.contentEl.createEl("p", { text: this.message });
|
|
30291
|
-
const okButton = new
|
|
30296
|
+
const okButton = new import_obsidian115.ButtonComponent(this.contentEl);
|
|
30292
30297
|
okButton.setButtonText(this.okButtonText);
|
|
30293
30298
|
okButton.setCta();
|
|
30294
30299
|
okButton.onClick(() => {
|
|
@@ -30296,7 +30301,7 @@ var ConfirmModal = class extends ModalBase {
|
|
|
30296
30301
|
this.close();
|
|
30297
30302
|
});
|
|
30298
30303
|
okButton.setClass("ok-button" /* OkButton */);
|
|
30299
|
-
const cancelButton = new
|
|
30304
|
+
const cancelButton = new import_obsidian115.ButtonComponent(this.contentEl);
|
|
30300
30305
|
cancelButton.setButtonText(this.cancelButtonText);
|
|
30301
30306
|
cancelButton.onClick(this.close.bind(this));
|
|
30302
30307
|
cancelButton.setClass("cancel-button" /* CancelButton */);
|
|
@@ -30363,7 +30368,7 @@ var ResourceLockMutationBlockerComponent = class extends MonkeyAroundComponent {
|
|
|
30363
30368
|
super.onload();
|
|
30364
30369
|
this.registerMethodPatch({
|
|
30365
30370
|
methodName: "append",
|
|
30366
|
-
obj:
|
|
30371
|
+
obj: import_obsidian116.Vault.prototype,
|
|
30367
30372
|
patchHandler: ({ fallback, originalArgs: [file] }) => {
|
|
30368
30373
|
this.assertNotBlocked([file.path]);
|
|
30369
30374
|
return fallback();
|
|
@@ -30371,7 +30376,7 @@ var ResourceLockMutationBlockerComponent = class extends MonkeyAroundComponent {
|
|
|
30371
30376
|
});
|
|
30372
30377
|
this.registerMethodPatch({
|
|
30373
30378
|
methodName: "copy",
|
|
30374
|
-
obj:
|
|
30379
|
+
obj: import_obsidian116.Vault.prototype,
|
|
30375
30380
|
patchHandler: ({ fallback, originalArgs: [, newPath] }) => {
|
|
30376
30381
|
this.assertNotBlocked([newPath]);
|
|
30377
30382
|
return fallback();
|
|
@@ -30379,7 +30384,7 @@ var ResourceLockMutationBlockerComponent = class extends MonkeyAroundComponent {
|
|
|
30379
30384
|
});
|
|
30380
30385
|
this.registerMethodPatch({
|
|
30381
30386
|
methodName: "create",
|
|
30382
|
-
obj:
|
|
30387
|
+
obj: import_obsidian116.Vault.prototype,
|
|
30383
30388
|
patchHandler: ({ fallback, originalArgs: [path] }) => {
|
|
30384
30389
|
this.assertNotBlocked([path]);
|
|
30385
30390
|
return fallback();
|
|
@@ -30387,7 +30392,7 @@ var ResourceLockMutationBlockerComponent = class extends MonkeyAroundComponent {
|
|
|
30387
30392
|
});
|
|
30388
30393
|
this.registerMethodPatch({
|
|
30389
30394
|
methodName: "createBinary",
|
|
30390
|
-
obj:
|
|
30395
|
+
obj: import_obsidian116.Vault.prototype,
|
|
30391
30396
|
patchHandler: ({ fallback, originalArgs: [path] }) => {
|
|
30392
30397
|
this.assertNotBlocked([path]);
|
|
30393
30398
|
return fallback();
|
|
@@ -30395,7 +30400,7 @@ var ResourceLockMutationBlockerComponent = class extends MonkeyAroundComponent {
|
|
|
30395
30400
|
});
|
|
30396
30401
|
this.registerMethodPatch({
|
|
30397
30402
|
methodName: "createFolder",
|
|
30398
|
-
obj:
|
|
30403
|
+
obj: import_obsidian116.Vault.prototype,
|
|
30399
30404
|
patchHandler: ({ fallback, originalArgs: [path] }) => {
|
|
30400
30405
|
this.assertNotBlocked([path]);
|
|
30401
30406
|
return fallback();
|
|
@@ -30403,7 +30408,7 @@ var ResourceLockMutationBlockerComponent = class extends MonkeyAroundComponent {
|
|
|
30403
30408
|
});
|
|
30404
30409
|
this.registerMethodPatch({
|
|
30405
30410
|
methodName: "delete",
|
|
30406
|
-
obj:
|
|
30411
|
+
obj: import_obsidian116.Vault.prototype,
|
|
30407
30412
|
patchHandler: ({ fallback, originalArgs: [file] }) => {
|
|
30408
30413
|
this.assertNotBlocked([file.path]);
|
|
30409
30414
|
return fallback();
|
|
@@ -30411,7 +30416,7 @@ var ResourceLockMutationBlockerComponent = class extends MonkeyAroundComponent {
|
|
|
30411
30416
|
});
|
|
30412
30417
|
this.registerMethodPatch({
|
|
30413
30418
|
methodName: "modify",
|
|
30414
|
-
obj:
|
|
30419
|
+
obj: import_obsidian116.Vault.prototype,
|
|
30415
30420
|
patchHandler: ({ fallback, originalArgs: [file] }) => {
|
|
30416
30421
|
this.assertNotBlocked([file.path]);
|
|
30417
30422
|
return fallback();
|
|
@@ -30419,7 +30424,7 @@ var ResourceLockMutationBlockerComponent = class extends MonkeyAroundComponent {
|
|
|
30419
30424
|
});
|
|
30420
30425
|
this.registerMethodPatch({
|
|
30421
30426
|
methodName: "modifyBinary",
|
|
30422
|
-
obj:
|
|
30427
|
+
obj: import_obsidian116.Vault.prototype,
|
|
30423
30428
|
patchHandler: ({ fallback, originalArgs: [file] }) => {
|
|
30424
30429
|
this.assertNotBlocked([file.path]);
|
|
30425
30430
|
return fallback();
|
|
@@ -30427,7 +30432,7 @@ var ResourceLockMutationBlockerComponent = class extends MonkeyAroundComponent {
|
|
|
30427
30432
|
});
|
|
30428
30433
|
this.registerMethodPatch({
|
|
30429
30434
|
methodName: "process",
|
|
30430
|
-
obj:
|
|
30435
|
+
obj: import_obsidian116.Vault.prototype,
|
|
30431
30436
|
patchHandler: ({ fallback, originalArgs: [file] }) => {
|
|
30432
30437
|
this.assertNotBlocked([file.path]);
|
|
30433
30438
|
return fallback();
|
|
@@ -30435,7 +30440,7 @@ var ResourceLockMutationBlockerComponent = class extends MonkeyAroundComponent {
|
|
|
30435
30440
|
});
|
|
30436
30441
|
this.registerMethodPatch({
|
|
30437
30442
|
methodName: "rename",
|
|
30438
|
-
obj:
|
|
30443
|
+
obj: import_obsidian116.Vault.prototype,
|
|
30439
30444
|
patchHandler: ({ fallback, originalArgs: [file, newPath] }) => {
|
|
30440
30445
|
this.assertNotBlocked([file.path, newPath]);
|
|
30441
30446
|
return fallback();
|
|
@@ -30443,7 +30448,7 @@ var ResourceLockMutationBlockerComponent = class extends MonkeyAroundComponent {
|
|
|
30443
30448
|
});
|
|
30444
30449
|
this.registerMethodPatch({
|
|
30445
30450
|
methodName: "trash",
|
|
30446
|
-
obj:
|
|
30451
|
+
obj: import_obsidian116.Vault.prototype,
|
|
30447
30452
|
patchHandler: ({ fallback, originalArgs: [file] }) => {
|
|
30448
30453
|
this.assertNotBlocked([file.path]);
|
|
30449
30454
|
return fallback();
|
|
@@ -30451,7 +30456,7 @@ var ResourceLockMutationBlockerComponent = class extends MonkeyAroundComponent {
|
|
|
30451
30456
|
});
|
|
30452
30457
|
this.registerMethodPatch({
|
|
30453
30458
|
methodName: "renameFile",
|
|
30454
|
-
obj:
|
|
30459
|
+
obj: import_obsidian116.FileManager.prototype,
|
|
30455
30460
|
patchHandler: ({ fallback, originalArgs: [file, newPath] }) => {
|
|
30456
30461
|
this.assertNotBlocked([file.path, newPath]);
|
|
30457
30462
|
return fallback();
|
|
@@ -30459,7 +30464,7 @@ var ResourceLockMutationBlockerComponent = class extends MonkeyAroundComponent {
|
|
|
30459
30464
|
});
|
|
30460
30465
|
this.registerMethodPatch({
|
|
30461
30466
|
methodName: "trashFile",
|
|
30462
|
-
obj:
|
|
30467
|
+
obj: import_obsidian116.FileManager.prototype,
|
|
30463
30468
|
patchHandler: ({ fallback, originalArgs: [file] }) => {
|
|
30464
30469
|
this.assertNotBlocked([file.path]);
|
|
30465
30470
|
return fallback();
|
|
@@ -30661,8 +30666,8 @@ var ResourceLockManager = class {
|
|
|
30661
30666
|
const tabStatusContainerEl = view.leaf.tabHeaderStatusContainerEl;
|
|
30662
30667
|
if (tabStatusContainerEl) {
|
|
30663
30668
|
tabIconEl = tabStatusContainerEl.createSpan({ cls: LOCK_INDICATOR_CSS_CLASS });
|
|
30664
|
-
(0,
|
|
30665
|
-
(0,
|
|
30669
|
+
(0, import_obsidian116.setIcon)(tabIconEl, LOCK_ICON_ID);
|
|
30670
|
+
(0, import_obsidian116.setTooltip)(tabIconEl, tooltip);
|
|
30666
30671
|
this.registerUnlockMenu(app, tabIconEl, () => path);
|
|
30667
30672
|
}
|
|
30668
30673
|
const onTypeAttempt = () => {
|
|
@@ -30824,7 +30829,7 @@ ${entry.operationName}`;
|
|
|
30824
30829
|
const viewsToLock = /* @__PURE__ */ new Set();
|
|
30825
30830
|
for (const leaf of app.workspace.getLeavesOfType(ViewType.Markdown)) {
|
|
30826
30831
|
const view = leaf.view;
|
|
30827
|
-
if (!(view instanceof
|
|
30832
|
+
if (!(view instanceof import_obsidian116.MarkdownView)) {
|
|
30828
30833
|
continue;
|
|
30829
30834
|
}
|
|
30830
30835
|
const path = view.file?.path;
|
|
@@ -30873,7 +30878,7 @@ ${entry.operationName}`;
|
|
|
30873
30878
|
if (path === void 0) {
|
|
30874
30879
|
return;
|
|
30875
30880
|
}
|
|
30876
|
-
const menu = new
|
|
30881
|
+
const menu = new import_obsidian116.Menu();
|
|
30877
30882
|
this.addUnlockMenuItem(app, menu, path);
|
|
30878
30883
|
menu.showAtMouseEvent(evt);
|
|
30879
30884
|
};
|
|
@@ -30947,13 +30952,13 @@ ${entry.operationName}`;
|
|
|
30947
30952
|
return fragment;
|
|
30948
30953
|
}
|
|
30949
30954
|
updateIndicatorTooltips(indicators, tooltip) {
|
|
30950
|
-
(0,
|
|
30955
|
+
(0, import_obsidian116.setTooltip)(indicators.actionIconEl, tooltip);
|
|
30951
30956
|
if (indicators.tabIconEl) {
|
|
30952
|
-
(0,
|
|
30957
|
+
(0, import_obsidian116.setTooltip)(indicators.tabIconEl, tooltip);
|
|
30953
30958
|
}
|
|
30954
30959
|
}
|
|
30955
30960
|
updateStatusBar(app) {
|
|
30956
|
-
const activeView = app.workspace.getActiveViewOfType(
|
|
30961
|
+
const activeView = app.workspace.getActiveViewOfType(import_obsidian116.MarkdownView);
|
|
30957
30962
|
const activePath = activeView?.file?.path;
|
|
30958
30963
|
const activeOwnerPath = activePath === void 0 ? null : this.resolveLockOwnerPath(app, activePath);
|
|
30959
30964
|
if (activeOwnerPath === null || !activeView) {
|
|
@@ -30967,13 +30972,13 @@ ${entry.operationName}`;
|
|
|
30967
30972
|
return;
|
|
30968
30973
|
}
|
|
30969
30974
|
this.statusBarItemEl = statusBarEl.createDiv({ cls: [STATUS_BAR_ITEM_CSS_CLASS, LOCK_INDICATOR_CSS_CLASS] });
|
|
30970
|
-
(0,
|
|
30975
|
+
(0, import_obsidian116.setIcon)(this.statusBarItemEl, LOCK_ICON_ID);
|
|
30971
30976
|
this.registerUnlockMenu(app, this.statusBarItemEl, () => {
|
|
30972
|
-
const path = app.workspace.getActiveViewOfType(
|
|
30977
|
+
const path = app.workspace.getActiveViewOfType(import_obsidian116.MarkdownView)?.file?.path;
|
|
30973
30978
|
return path === void 0 ? void 0 : this.resolveLockOwnerPath(app, path) ?? void 0;
|
|
30974
30979
|
});
|
|
30975
30980
|
}
|
|
30976
|
-
(0,
|
|
30981
|
+
(0, import_obsidian116.setTooltip)(this.statusBarItemEl, this.lockTooltip(app, activeOwnerPath));
|
|
30977
30982
|
}
|
|
30978
30983
|
/**
|
|
30979
30984
|
* Wires an opt-in `abort` listener for a lock entry: when the entry's controller aborts, releases
|
|
@@ -31782,7 +31787,7 @@ var RenameMap = class {
|
|
|
31782
31787
|
context: "RenameNote" /* RenameNote */,
|
|
31783
31788
|
path: this.oldPath
|
|
31784
31789
|
})) {
|
|
31785
|
-
|
|
31790
|
+
import_obsidian117.Vault.recurseChildren(oldAttachmentFolder, (oldAttachmentFile) => {
|
|
31786
31791
|
this.abortSignal.throwIfAborted();
|
|
31787
31792
|
if (isFile(oldAttachmentFile)) {
|
|
31788
31793
|
oldAttachmentFiles.push(oldAttachmentFile);
|
|
@@ -32069,6 +32074,119 @@ var RenameDeleteHandlerComponent = class extends ComponentEx {
|
|
|
32069
32074
|
}
|
|
32070
32075
|
};
|
|
32071
32076
|
|
|
32077
|
+
// src/obsidian/components/syntax-highlighting-component.ts
|
|
32078
|
+
var syntax_highlighting_component_exports = {};
|
|
32079
|
+
__export(syntax_highlighting_component_exports, {
|
|
32080
|
+
SyntaxHighlightingComponent: () => SyntaxHighlightingComponent
|
|
32081
|
+
});
|
|
32082
|
+
init_error();
|
|
32083
|
+
var SyntaxHighlightingComponent = class extends ComponentEx {
|
|
32084
|
+
/**
|
|
32085
|
+
* Registers a fenced code block language, highlighting it in the editor and, optionally, in reading view.
|
|
32086
|
+
*
|
|
32087
|
+
* @param params - The parameters for registering the language.
|
|
32088
|
+
* @returns A {@link Promise} that resolves when the language is registered.
|
|
32089
|
+
*
|
|
32090
|
+
* @example
|
|
32091
|
+
* ```ts
|
|
32092
|
+
* await component.registerCodeBlockLanguageAsync({
|
|
32093
|
+
* editorMode: 'text/typescript',
|
|
32094
|
+
* language: 'my-language',
|
|
32095
|
+
* prismGrammar: 'typescript'
|
|
32096
|
+
* });
|
|
32097
|
+
* ```
|
|
32098
|
+
*/
|
|
32099
|
+
async registerCodeBlockLanguageAsync(params) {
|
|
32100
|
+
const {
|
|
32101
|
+
editorMode,
|
|
32102
|
+
language,
|
|
32103
|
+
prismGrammar
|
|
32104
|
+
} = params;
|
|
32105
|
+
this.ensureLoaded();
|
|
32106
|
+
if (prismGrammar !== void 0) {
|
|
32107
|
+
await this.registerPrismLanguageAsync({
|
|
32108
|
+
grammar: prismGrammar,
|
|
32109
|
+
language
|
|
32110
|
+
});
|
|
32111
|
+
}
|
|
32112
|
+
this.ensureLoaded();
|
|
32113
|
+
const previousModeFactory = window.CodeMirror.modes[language];
|
|
32114
|
+
window.CodeMirror.defineMode(language, (config) => window.CodeMirror.getMode(config, editorMode));
|
|
32115
|
+
this.register(() => {
|
|
32116
|
+
if (previousModeFactory !== void 0) {
|
|
32117
|
+
window.CodeMirror.modes[language] = previousModeFactory;
|
|
32118
|
+
return;
|
|
32119
|
+
}
|
|
32120
|
+
delete window.CodeMirror.modes[language];
|
|
32121
|
+
});
|
|
32122
|
+
}
|
|
32123
|
+
/**
|
|
32124
|
+
* Registers a Prism language, highlighting it everywhere Prism renders code — reading view and the
|
|
32125
|
+
* {@link CodeHighlighterComponent} settings field.
|
|
32126
|
+
*
|
|
32127
|
+
* @param params - The parameters for registering the language.
|
|
32128
|
+
* @returns A {@link Promise} that resolves when the language is registered.
|
|
32129
|
+
*
|
|
32130
|
+
* @example
|
|
32131
|
+
* ```ts
|
|
32132
|
+
* await component.registerPrismLanguageAsync({
|
|
32133
|
+
* grammar: {
|
|
32134
|
+
* keyword: /\bfoo\b/
|
|
32135
|
+
* },
|
|
32136
|
+
* language: 'my-language'
|
|
32137
|
+
* });
|
|
32138
|
+
* ```
|
|
32139
|
+
*/
|
|
32140
|
+
async registerPrismLanguageAsync(params) {
|
|
32141
|
+
const {
|
|
32142
|
+
grammar,
|
|
32143
|
+
language
|
|
32144
|
+
} = params;
|
|
32145
|
+
this.ensureLoaded();
|
|
32146
|
+
const prism = await loadPrism();
|
|
32147
|
+
this.ensureLoaded();
|
|
32148
|
+
const previousGrammar = prism.languages[language];
|
|
32149
|
+
prism.languages[language] = this.resolveGrammar(prism, grammar);
|
|
32150
|
+
this.register(() => {
|
|
32151
|
+
if (previousGrammar !== void 0) {
|
|
32152
|
+
prism.languages[language] = previousGrammar;
|
|
32153
|
+
return;
|
|
32154
|
+
}
|
|
32155
|
+
delete prism.languages[language];
|
|
32156
|
+
});
|
|
32157
|
+
}
|
|
32158
|
+
/**
|
|
32159
|
+
* Returns the grammar of an already registered Prism language.
|
|
32160
|
+
*
|
|
32161
|
+
* @param prism - The loaded Prism module.
|
|
32162
|
+
* @param language - The language to look up.
|
|
32163
|
+
* @returns The grammar of the language.
|
|
32164
|
+
* @throws An {@link Error} if the language is not registered.
|
|
32165
|
+
*/
|
|
32166
|
+
requirePrismLanguage(prism, language) {
|
|
32167
|
+
return prism.languages[language] ?? throwExpression(new Error(`Prism language "${language}" is not registered.`));
|
|
32168
|
+
}
|
|
32169
|
+
/**
|
|
32170
|
+
* Resolves a grammar source into the grammar to register.
|
|
32171
|
+
*
|
|
32172
|
+
* @param prism - The loaded Prism module.
|
|
32173
|
+
* @param grammarSource - The grammar source to resolve.
|
|
32174
|
+
* @returns The resolved grammar.
|
|
32175
|
+
*/
|
|
32176
|
+
resolveGrammar(prism, grammarSource) {
|
|
32177
|
+
if (typeof grammarSource === "string") {
|
|
32178
|
+
return this.requirePrismLanguage(prism, grammarSource);
|
|
32179
|
+
}
|
|
32180
|
+
if (typeof grammarSource === "function") {
|
|
32181
|
+
return grammarSource({
|
|
32182
|
+
prism,
|
|
32183
|
+
requirePrismLanguage: (language) => this.requirePrismLanguage(prism, language)
|
|
32184
|
+
});
|
|
32185
|
+
}
|
|
32186
|
+
return grammarSource;
|
|
32187
|
+
}
|
|
32188
|
+
};
|
|
32189
|
+
|
|
32072
32190
|
// src/obsidian/constructors/index.ts
|
|
32073
32191
|
var constructors_exports = {};
|
|
32074
32192
|
__export(constructors_exports, {
|
|
@@ -32080,14 +32198,14 @@ var get_dom_events_handlers_constructor_exports = {};
|
|
|
32080
32198
|
__export(get_dom_events_handlers_constructor_exports, {
|
|
32081
32199
|
getDomEventsHandlersConstructor: () => getDomEventsHandlersConstructor
|
|
32082
32200
|
});
|
|
32083
|
-
var
|
|
32201
|
+
var import_obsidian118 = require("obsidian");
|
|
32084
32202
|
init_type_guards();
|
|
32085
32203
|
var MarkdownPreviewRendererRegisterDomEventsPatchComponent = class extends MonkeyAroundComponent {
|
|
32086
32204
|
domEventsHandlersConstructor = null;
|
|
32087
32205
|
onload() {
|
|
32088
32206
|
this.registerMethodPatch({
|
|
32089
32207
|
methodName: "registerDomEvents",
|
|
32090
|
-
obj:
|
|
32208
|
+
obj: import_obsidian118.MarkdownPreviewRenderer,
|
|
32091
32209
|
patchHandler: ({
|
|
32092
32210
|
fallback,
|
|
32093
32211
|
originalArgs: [, handlers]
|
|
@@ -32224,7 +32342,7 @@ __export(desktop_trusted_input_exports, {
|
|
|
32224
32342
|
typeIntoEditor: () => typeIntoEditor,
|
|
32225
32343
|
unhoverElement: () => unhoverElement
|
|
32226
32344
|
});
|
|
32227
|
-
var
|
|
32345
|
+
var import_obsidian119 = require("obsidian");
|
|
32228
32346
|
init_type_guards();
|
|
32229
32347
|
var INPUT_POLL_INTERVAL_IN_MILLISECONDS = 50;
|
|
32230
32348
|
var INPUT_TIMEOUT_IN_MILLISECONDS = 5e3;
|
|
@@ -32243,7 +32361,7 @@ function moveMouse(params) {
|
|
|
32243
32361
|
}
|
|
32244
32362
|
function pressKey(params) {
|
|
32245
32363
|
const { key, modifiers = [] } = params;
|
|
32246
|
-
const isMacOS =
|
|
32364
|
+
const isMacOS = import_obsidian119.Platform.isMacOS;
|
|
32247
32365
|
const electronModifiers = modifiers.map((modifier) => {
|
|
32248
32366
|
switch (modifier) {
|
|
32249
32367
|
case "Alt":
|
|
@@ -32302,7 +32420,7 @@ var editor_extension_registrar_exports = {};
|
|
|
32302
32420
|
__export(editor_extension_registrar_exports, {
|
|
32303
32421
|
PluginEditorExtensionRegistrar: () => PluginEditorExtensionRegistrar
|
|
32304
32422
|
});
|
|
32305
|
-
var
|
|
32423
|
+
var import_obsidian120 = require("obsidian");
|
|
32306
32424
|
var PluginEditorExtensionRegistrar = class {
|
|
32307
32425
|
/**
|
|
32308
32426
|
* Creates a new instance of the {@link PluginEditorExtensionRegistrar} class.
|
|
@@ -32328,7 +32446,7 @@ var editor_suggest_registrar_exports = {};
|
|
|
32328
32446
|
__export(editor_suggest_registrar_exports, {
|
|
32329
32447
|
PluginEditorSuggestRegistrar: () => PluginEditorSuggestRegistrar
|
|
32330
32448
|
});
|
|
32331
|
-
var
|
|
32449
|
+
var import_obsidian121 = require("obsidian");
|
|
32332
32450
|
var PluginEditorSuggestRegistrar = class {
|
|
32333
32451
|
/**
|
|
32334
32452
|
* Creates a new instance of the {@link PluginEditorSuggestRegistrar} class.
|
|
@@ -32354,7 +32472,7 @@ var extensions_registrar_exports = {};
|
|
|
32354
32472
|
__export(extensions_registrar_exports, {
|
|
32355
32473
|
PluginExtensionsRegistrar: () => PluginExtensionsRegistrar
|
|
32356
32474
|
});
|
|
32357
|
-
var
|
|
32475
|
+
var import_obsidian122 = require("obsidian");
|
|
32358
32476
|
var PluginExtensionsRegistrar = class {
|
|
32359
32477
|
/**
|
|
32360
32478
|
* Creates a new instance of the {@link PluginExtensionsRegistrar} class.
|
|
@@ -32477,7 +32595,7 @@ var hover_link_source_registrar_exports = {};
|
|
|
32477
32595
|
__export(hover_link_source_registrar_exports, {
|
|
32478
32596
|
PluginHoverLinkSourceRegistrar: () => PluginHoverLinkSourceRegistrar
|
|
32479
32597
|
});
|
|
32480
|
-
var
|
|
32598
|
+
var import_obsidian123 = require("obsidian");
|
|
32481
32599
|
var PluginHoverLinkSourceRegistrar = class {
|
|
32482
32600
|
/**
|
|
32483
32601
|
* Creates a new instance of the {@link PluginHoverLinkSourceRegistrar} class.
|
|
@@ -32545,7 +32663,7 @@ var loop_exports = {};
|
|
|
32545
32663
|
__export(loop_exports, {
|
|
32546
32664
|
loop: () => loop
|
|
32547
32665
|
});
|
|
32548
|
-
var
|
|
32666
|
+
var import_obsidian124 = require("obsidian");
|
|
32549
32667
|
init_abort_controller();
|
|
32550
32668
|
init_debug();
|
|
32551
32669
|
init_error();
|
|
@@ -32965,7 +33083,7 @@ var markdown_post_processor_registrar_exports = {};
|
|
|
32965
33083
|
__export(markdown_post_processor_registrar_exports, {
|
|
32966
33084
|
PluginMarkdownPostProcessorRegistrar: () => PluginMarkdownPostProcessorRegistrar
|
|
32967
33085
|
});
|
|
32968
|
-
var
|
|
33086
|
+
var import_obsidian125 = require("obsidian");
|
|
32969
33087
|
var PluginMarkdownPostProcessorRegistrar = class {
|
|
32970
33088
|
/**
|
|
32971
33089
|
* Creates a new instance of the {@link PluginMarkdownPostProcessorRegistrar} class.
|
|
@@ -33010,7 +33128,7 @@ __export(markdown_exports, {
|
|
|
33010
33128
|
renderExternalLink: () => renderExternalLink,
|
|
33011
33129
|
renderInternalLink: () => renderInternalLink
|
|
33012
33130
|
});
|
|
33013
|
-
var
|
|
33131
|
+
var import_obsidian126 = require("obsidian");
|
|
33014
33132
|
var domEventsHandlersConstructor = null;
|
|
33015
33133
|
var EmbedByExtensionMdPatchComponent = class extends MonkeyAroundComponent {
|
|
33016
33134
|
constructor(embedByExtension) {
|
|
@@ -33071,12 +33189,12 @@ async function fullRender(params) {
|
|
|
33071
33189
|
if (params.component) {
|
|
33072
33190
|
component = params.component;
|
|
33073
33191
|
} else {
|
|
33074
|
-
component = new
|
|
33192
|
+
component = new import_obsidian126.Component();
|
|
33075
33193
|
component.load();
|
|
33076
33194
|
shouldUnloadComponent = true;
|
|
33077
33195
|
}
|
|
33078
33196
|
const _ = __using(_stack, component.addChild(new EmbedByExtensionMdPatchComponent(params.app.embedRegistry.embedByExtension)));
|
|
33079
|
-
await
|
|
33197
|
+
await import_obsidian126.MarkdownRenderer.render(params.app, params.markdown, params.el, sourcePath, component);
|
|
33080
33198
|
if (shouldUnloadComponent) {
|
|
33081
33199
|
component.unload();
|
|
33082
33200
|
}
|
|
@@ -33099,10 +33217,10 @@ async function markdownToHtml(params) {
|
|
|
33099
33217
|
markdown,
|
|
33100
33218
|
sourcePath
|
|
33101
33219
|
} = params;
|
|
33102
|
-
const component = new
|
|
33220
|
+
const component = new import_obsidian126.Component();
|
|
33103
33221
|
component.load();
|
|
33104
33222
|
const renderDiv = createDiv();
|
|
33105
|
-
await
|
|
33223
|
+
await import_obsidian126.MarkdownRenderer.render(app, markdown, renderDiv, sourcePath ?? "", component);
|
|
33106
33224
|
const html2 = renderDiv.innerHTML;
|
|
33107
33225
|
component.unload();
|
|
33108
33226
|
return html2;
|
|
@@ -33114,7 +33232,7 @@ async function registerLinkHandlers(params) {
|
|
|
33114
33232
|
sourcePath
|
|
33115
33233
|
} = params;
|
|
33116
33234
|
domEventsHandlersConstructor ??= await getDomEventsHandlersConstructor(app);
|
|
33117
|
-
|
|
33235
|
+
import_obsidian126.MarkdownPreviewRenderer.registerDomEvents(
|
|
33118
33236
|
el,
|
|
33119
33237
|
new domEventsHandlersConstructor(
|
|
33120
33238
|
new FixedZIndexDomEventsHandlersInfo({
|
|
@@ -33195,7 +33313,7 @@ var alert_exports = {};
|
|
|
33195
33313
|
__export(alert_exports, {
|
|
33196
33314
|
alert: () => alert
|
|
33197
33315
|
});
|
|
33198
|
-
var
|
|
33316
|
+
var import_obsidian127 = require("obsidian");
|
|
33199
33317
|
init_css_class();
|
|
33200
33318
|
init_modal();
|
|
33201
33319
|
var AlertModal = class extends ModalBase {
|
|
@@ -33215,7 +33333,7 @@ var AlertModal = class extends ModalBase {
|
|
|
33215
33333
|
onOpen() {
|
|
33216
33334
|
this.titleEl.setText(this.title);
|
|
33217
33335
|
this.contentEl.createEl("p", { text: this.message });
|
|
33218
|
-
const okButton = new
|
|
33336
|
+
const okButton = new import_obsidian127.ButtonComponent(this.contentEl);
|
|
33219
33337
|
okButton.setButtonText(this.okButtonText);
|
|
33220
33338
|
okButton.setCta();
|
|
33221
33339
|
okButton.onClick(this.close.bind(this));
|
|
@@ -33236,7 +33354,7 @@ var minimizable_modal_exports = {};
|
|
|
33236
33354
|
__export(minimizable_modal_exports, {
|
|
33237
33355
|
MinimizableModal: () => MinimizableModal
|
|
33238
33356
|
});
|
|
33239
|
-
var
|
|
33357
|
+
var import_obsidian128 = require("obsidian");
|
|
33240
33358
|
init_css_class();
|
|
33241
33359
|
init_plugin_context();
|
|
33242
33360
|
var MINIMIZE_ICON_ID = "minus";
|
|
@@ -33278,7 +33396,7 @@ var PeekLockComponent = class extends MonkeyAroundComponent {
|
|
|
33278
33396
|
super.onload();
|
|
33279
33397
|
this.registerMethodPatch({
|
|
33280
33398
|
methodName: "open",
|
|
33281
|
-
obj:
|
|
33399
|
+
obj: import_obsidian128.Modal.prototype,
|
|
33282
33400
|
patchHandler: ({ fallback, originalThis }) => {
|
|
33283
33401
|
blockOrFallback(originalThis, fallback);
|
|
33284
33402
|
}
|
|
@@ -33380,7 +33498,7 @@ var MinimizableModal = class {
|
|
|
33380
33498
|
}
|
|
33381
33499
|
createMinimizeButton() {
|
|
33382
33500
|
const buttonEl = this.modal.modalEl.createEl("button", { cls: "minimize-button" /* MinimizeButton */ });
|
|
33383
|
-
(0,
|
|
33501
|
+
(0, import_obsidian128.setIcon)(buttonEl, MINIMIZE_ICON_ID);
|
|
33384
33502
|
buttonEl.addEventListener("click", () => {
|
|
33385
33503
|
this.minimize();
|
|
33386
33504
|
});
|
|
@@ -33394,11 +33512,11 @@ var MinimizableModal = class {
|
|
|
33394
33512
|
text: this.modal.titleEl.textContent
|
|
33395
33513
|
});
|
|
33396
33514
|
const restoreButtonEl = barEl.createEl("button", { cls: "restore-button" /* RestoreButton */ });
|
|
33397
|
-
(0,
|
|
33515
|
+
(0, import_obsidian128.setIcon)(restoreButtonEl, RESTORE_ICON_ID);
|
|
33398
33516
|
if (this.shouldShowCancelButton) {
|
|
33399
33517
|
const cancelButtonEl = barEl.createEl("button", { cls: "cancel-button" /* CancelButton */ });
|
|
33400
|
-
(0,
|
|
33401
|
-
(0,
|
|
33518
|
+
(0, import_obsidian128.setIcon)(cancelButtonEl, CANCEL_ICON_ID);
|
|
33519
|
+
(0, import_obsidian128.setTooltip)(cancelButtonEl, "Cancel");
|
|
33402
33520
|
cancelButtonEl.addEventListener("click", (evt) => {
|
|
33403
33521
|
evt.stopPropagation();
|
|
33404
33522
|
this.modal.close();
|
|
@@ -33525,7 +33643,7 @@ var prompt_exports = {};
|
|
|
33525
33643
|
__export(prompt_exports, {
|
|
33526
33644
|
prompt: () => prompt
|
|
33527
33645
|
});
|
|
33528
|
-
var
|
|
33646
|
+
var import_obsidian129 = require("obsidian");
|
|
33529
33647
|
init_function();
|
|
33530
33648
|
init_css_class();
|
|
33531
33649
|
init_modal();
|
|
@@ -33552,7 +33670,7 @@ var PromptModal = class extends ModalBase {
|
|
|
33552
33670
|
}
|
|
33553
33671
|
onOpen() {
|
|
33554
33672
|
this.titleEl.setText(this.title);
|
|
33555
|
-
const textComponent = new
|
|
33673
|
+
const textComponent = new import_obsidian129.TextComponent(this.contentEl);
|
|
33556
33674
|
const inputEl = textComponent.inputEl;
|
|
33557
33675
|
const validate = async () => {
|
|
33558
33676
|
const errorMessage = await this.valueValidator(inputEl.value);
|
|
@@ -33576,14 +33694,14 @@ var PromptModal = class extends ModalBase {
|
|
|
33576
33694
|
inputEl.addEventListener("input", convertAsyncToSync(validate));
|
|
33577
33695
|
inputEl.addEventListener("focus", convertAsyncToSync(validate));
|
|
33578
33696
|
invokeAsyncSafely(validate);
|
|
33579
|
-
const okButton = new
|
|
33697
|
+
const okButton = new import_obsidian129.ButtonComponent(this.contentEl);
|
|
33580
33698
|
okButton.setButtonText(this.okButtonText);
|
|
33581
33699
|
okButton.setCta();
|
|
33582
33700
|
okButton.onClick((event) => {
|
|
33583
33701
|
this.handleOk(event, textComponent);
|
|
33584
33702
|
});
|
|
33585
33703
|
okButton.setClass("ok-button" /* OkButton */);
|
|
33586
|
-
const cancelButton = new
|
|
33704
|
+
const cancelButton = new import_obsidian129.ButtonComponent(this.contentEl);
|
|
33587
33705
|
cancelButton.setButtonText(this.cancelButtonText);
|
|
33588
33706
|
cancelButton.onClick(this.close.bind(this));
|
|
33589
33707
|
cancelButton.setClass("cancel-button" /* CancelButton */);
|
|
@@ -33611,11 +33729,11 @@ var select_item_exports = {};
|
|
|
33611
33729
|
__export(select_item_exports, {
|
|
33612
33730
|
selectItem: () => selectItem
|
|
33613
33731
|
});
|
|
33614
|
-
var
|
|
33732
|
+
var import_obsidian130 = require("obsidian");
|
|
33615
33733
|
init_css_class();
|
|
33616
33734
|
init_plugin_context();
|
|
33617
33735
|
init_modal();
|
|
33618
|
-
var ItemSelectModal = class extends
|
|
33736
|
+
var ItemSelectModal = class extends import_obsidian130.FuzzySuggestModal {
|
|
33619
33737
|
isSelected = false;
|
|
33620
33738
|
items;
|
|
33621
33739
|
itemTextFunc;
|
|
@@ -33667,7 +33785,7 @@ var suggest_modal_command_builder_exports = {};
|
|
|
33667
33785
|
__export(suggest_modal_command_builder_exports, {
|
|
33668
33786
|
SuggestModalCommandBuilder: () => SuggestModalCommandBuilder
|
|
33669
33787
|
});
|
|
33670
|
-
var
|
|
33788
|
+
var import_obsidian131 = require("obsidian");
|
|
33671
33789
|
var KEYS_MAP = /* @__PURE__ */ new Map([
|
|
33672
33790
|
["Enter", "\u21B5"],
|
|
33673
33791
|
["UpDown", "\u2191\u2193"]
|
|
@@ -33714,7 +33832,7 @@ var SuggestModalCommandBuilder = class {
|
|
|
33714
33832
|
command: this.buildCommand(command),
|
|
33715
33833
|
init: (purposeEl, scope) => {
|
|
33716
33834
|
purposeEl.appendText(" ");
|
|
33717
|
-
const dropdownComponent = new
|
|
33835
|
+
const dropdownComponent = new import_obsidian131.DropdownComponent(purposeEl);
|
|
33718
33836
|
command.onInit(dropdownComponent);
|
|
33719
33837
|
dropdownComponent.onChange((value) => {
|
|
33720
33838
|
command.onChange(value);
|
|
@@ -33791,9 +33909,9 @@ var SuggestModalCommandBuilder = class {
|
|
|
33791
33909
|
case "Ctrl":
|
|
33792
33910
|
return "ctrl";
|
|
33793
33911
|
case "Meta":
|
|
33794
|
-
return
|
|
33912
|
+
return import_obsidian131.Platform.isMacOS ? "cmd" : "win";
|
|
33795
33913
|
case "Mod":
|
|
33796
|
-
return
|
|
33914
|
+
return import_obsidian131.Platform.isMacOS ? "cmd" : "ctrl";
|
|
33797
33915
|
case "Shift":
|
|
33798
33916
|
return "shift";
|
|
33799
33917
|
default:
|
|
@@ -33960,10 +34078,10 @@ var pdf_exports = {};
|
|
|
33960
34078
|
__export(pdf_exports, {
|
|
33961
34079
|
printToPdf: () => printToPdf
|
|
33962
34080
|
});
|
|
33963
|
-
var
|
|
34081
|
+
var import_obsidian132 = require("obsidian");
|
|
33964
34082
|
var ELECTRON_PRINT_TO_PDF_CHANNEL = "print-to-pdf";
|
|
33965
34083
|
async function printToPdf(el, options) {
|
|
33966
|
-
if (
|
|
34084
|
+
if (import_obsidian132.Platform.isMobile) {
|
|
33967
34085
|
throw new Error("Printing to PDF is not supported on mobile devices.");
|
|
33968
34086
|
}
|
|
33969
34087
|
const printDiv = activeDocument.body.createDiv("print");
|
|
@@ -34161,7 +34279,7 @@ __export(plugin_settings_tab_exports, {
|
|
|
34161
34279
|
PluginSettingsTabBase: () => PluginSettingsTabBase,
|
|
34162
34280
|
SAVE_TO_FILE_CONTEXT: () => SAVE_TO_FILE_CONTEXT
|
|
34163
34281
|
});
|
|
34164
|
-
var
|
|
34282
|
+
var import_obsidian150 = require("obsidian");
|
|
34165
34283
|
init_async_events();
|
|
34166
34284
|
init_function();
|
|
34167
34285
|
init_type_guards();
|
|
@@ -34196,7 +34314,7 @@ var text_based_component_exports = {};
|
|
|
34196
34314
|
__export(text_based_component_exports, {
|
|
34197
34315
|
getTextBasedComponentValue: () => getTextBasedComponentValue
|
|
34198
34316
|
});
|
|
34199
|
-
var
|
|
34317
|
+
var import_obsidian133 = require("obsidian");
|
|
34200
34318
|
var AbstractTextComponentWrapper = class {
|
|
34201
34319
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- `unknown` doesn't work, getting compiler errors.
|
|
34202
34320
|
constructor(abstractTextComponent) {
|
|
@@ -34218,7 +34336,7 @@ function getTextBasedComponentValue(obj) {
|
|
|
34218
34336
|
if (isTextBasedComponent(obj)) {
|
|
34219
34337
|
return obj;
|
|
34220
34338
|
}
|
|
34221
|
-
if (obj instanceof
|
|
34339
|
+
if (obj instanceof import_obsidian133.AbstractTextComponent) {
|
|
34222
34340
|
return new AbstractTextComponentWrapper(obj);
|
|
34223
34341
|
}
|
|
34224
34342
|
return null;
|
|
@@ -34233,7 +34351,7 @@ var validator_component_exports = {};
|
|
|
34233
34351
|
__export(validator_component_exports, {
|
|
34234
34352
|
getValidatorComponent: () => getValidatorComponent
|
|
34235
34353
|
});
|
|
34236
|
-
var
|
|
34354
|
+
var import_obsidian134 = require("obsidian");
|
|
34237
34355
|
init_css_class();
|
|
34238
34356
|
init_plugin_context();
|
|
34239
34357
|
var OverlayValidatorComponent = class {
|
|
@@ -34294,28 +34412,28 @@ function getValidatorComponent(obj) {
|
|
|
34294
34412
|
if (isValidatorComponent(obj)) {
|
|
34295
34413
|
return obj;
|
|
34296
34414
|
}
|
|
34297
|
-
if (obj instanceof
|
|
34415
|
+
if (obj instanceof import_obsidian134.ColorComponent) {
|
|
34298
34416
|
return new ValidatorElementWrapper(obj.colorPickerEl);
|
|
34299
34417
|
}
|
|
34300
|
-
if (obj instanceof
|
|
34418
|
+
if (obj instanceof import_obsidian134.DropdownComponent) {
|
|
34301
34419
|
return new ValidatorElementWrapper(obj.selectEl);
|
|
34302
34420
|
}
|
|
34303
|
-
if (obj instanceof
|
|
34421
|
+
if (obj instanceof import_obsidian134.ProgressBarComponent) {
|
|
34304
34422
|
return new OverlayValidatorComponent(obj.progressBar);
|
|
34305
34423
|
}
|
|
34306
|
-
if (obj instanceof
|
|
34424
|
+
if (obj instanceof import_obsidian134.SearchComponent) {
|
|
34307
34425
|
return new ValidatorElementWrapper(obj.inputEl);
|
|
34308
34426
|
}
|
|
34309
|
-
if (obj instanceof
|
|
34427
|
+
if (obj instanceof import_obsidian134.SliderComponent) {
|
|
34310
34428
|
return new ValidatorElementWrapper(obj.sliderEl);
|
|
34311
34429
|
}
|
|
34312
|
-
if (obj instanceof
|
|
34430
|
+
if (obj instanceof import_obsidian134.TextAreaComponent) {
|
|
34313
34431
|
return new ValidatorElementWrapper(obj.inputEl);
|
|
34314
34432
|
}
|
|
34315
|
-
if (obj instanceof
|
|
34433
|
+
if (obj instanceof import_obsidian134.TextComponent) {
|
|
34316
34434
|
return new ValidatorElementWrapper(obj.inputEl);
|
|
34317
34435
|
}
|
|
34318
|
-
if (obj instanceof
|
|
34436
|
+
if (obj instanceof import_obsidian134.ToggleComponent) {
|
|
34319
34437
|
return new OverlayValidatorComponent(obj.toggleEl);
|
|
34320
34438
|
}
|
|
34321
34439
|
return null;
|
|
@@ -34330,17 +34448,17 @@ __export(setting_ex_exports, {
|
|
|
34330
34448
|
SettingEx: () => SettingEx,
|
|
34331
34449
|
adoptSettingEx: () => adoptSettingEx
|
|
34332
34450
|
});
|
|
34333
|
-
var
|
|
34451
|
+
var import_obsidian148 = require("obsidian");
|
|
34334
34452
|
|
|
34335
34453
|
// src/obsidian/setting-components/checkbox-component.ts
|
|
34336
34454
|
var checkbox_component_exports = {};
|
|
34337
34455
|
__export(checkbox_component_exports, {
|
|
34338
34456
|
CheckboxComponent: () => CheckboxComponent
|
|
34339
34457
|
});
|
|
34340
|
-
var
|
|
34458
|
+
var import_obsidian135 = require("obsidian");
|
|
34341
34459
|
init_css_class();
|
|
34342
34460
|
init_plugin_context();
|
|
34343
|
-
var CheckboxComponent = class extends
|
|
34461
|
+
var CheckboxComponent = class extends import_obsidian135.ValueComponent {
|
|
34344
34462
|
/**
|
|
34345
34463
|
* An input element of the checkbox.
|
|
34346
34464
|
*/
|
|
@@ -34417,10 +34535,10 @@ var code_highlighter_component_exports = {};
|
|
|
34417
34535
|
__export(code_highlighter_component_exports, {
|
|
34418
34536
|
CodeHighlighterComponent: () => CodeHighlighterComponent
|
|
34419
34537
|
});
|
|
34420
|
-
var
|
|
34538
|
+
var import_obsidian136 = require("obsidian");
|
|
34421
34539
|
init_css_class();
|
|
34422
34540
|
init_plugin_context();
|
|
34423
|
-
var CodeHighlighterComponent = class extends
|
|
34541
|
+
var CodeHighlighterComponent = class extends import_obsidian136.ValueComponent {
|
|
34424
34542
|
/**
|
|
34425
34543
|
* An input element of the component.
|
|
34426
34544
|
*
|
|
@@ -34462,7 +34580,7 @@ var CodeHighlighterComponent = class extends import_obsidian132.ValueComponent {
|
|
|
34462
34580
|
addPluginCssClasses(containerEl, "code-highlighter-component" /* CodeHighlighterComponent */);
|
|
34463
34581
|
const wrapper = containerEl.createDiv();
|
|
34464
34582
|
addPluginCssClasses(wrapper, "setting-component-wrapper" /* SettingComponentWrapper */);
|
|
34465
|
-
this.textAreaComponent = new
|
|
34583
|
+
this.textAreaComponent = new import_obsidian136.TextAreaComponent(wrapper);
|
|
34466
34584
|
this.preEl = wrapper.createEl("pre", {
|
|
34467
34585
|
attr: {
|
|
34468
34586
|
tabIndex: "-1"
|
|
@@ -34655,7 +34773,7 @@ var date_component_exports = {};
|
|
|
34655
34773
|
__export(date_component_exports, {
|
|
34656
34774
|
DateComponent: () => DateComponent
|
|
34657
34775
|
});
|
|
34658
|
-
var
|
|
34776
|
+
var import_obsidian138 = require("obsidian");
|
|
34659
34777
|
init_css_class();
|
|
34660
34778
|
|
|
34661
34779
|
// src/obsidian/setting-components/typed-range-text-component.ts
|
|
@@ -34669,10 +34787,10 @@ var typed_text_component_exports = {};
|
|
|
34669
34787
|
__export(typed_text_component_exports, {
|
|
34670
34788
|
TypedTextComponent: () => TypedTextComponent
|
|
34671
34789
|
});
|
|
34672
|
-
var
|
|
34790
|
+
var import_obsidian137 = require("obsidian");
|
|
34673
34791
|
init_css_class();
|
|
34674
34792
|
init_plugin_context();
|
|
34675
|
-
var TypedTextComponent = class extends
|
|
34793
|
+
var TypedTextComponent = class extends import_obsidian137.ValueComponent {
|
|
34676
34794
|
/**
|
|
34677
34795
|
* An input element of the component.
|
|
34678
34796
|
*/
|
|
@@ -34696,7 +34814,7 @@ var TypedTextComponent = class extends import_obsidian133.ValueComponent {
|
|
|
34696
34814
|
*/
|
|
34697
34815
|
constructor(params) {
|
|
34698
34816
|
super();
|
|
34699
|
-
this.textComponent = new
|
|
34817
|
+
this.textComponent = new import_obsidian137.TextComponent(params.containerEl);
|
|
34700
34818
|
this.inputEl = this.textComponent.inputEl;
|
|
34701
34819
|
this.inputEl.type = params.type;
|
|
34702
34820
|
addPluginCssClasses(params.containerEl, params.cssClass);
|
|
@@ -34794,7 +34912,7 @@ var TypedRangeTextComponent = class extends TypedTextComponent {
|
|
|
34794
34912
|
};
|
|
34795
34913
|
|
|
34796
34914
|
// src/obsidian/setting-components/date-component.ts
|
|
34797
|
-
var moment2 = extractDefaultExportInterop(
|
|
34915
|
+
var moment2 = extractDefaultExportInterop(import_obsidian138.moment);
|
|
34798
34916
|
var DATE_FORMAT = "YYYY-MM-DD";
|
|
34799
34917
|
var DateComponent = class extends TypedRangeTextComponent {
|
|
34800
34918
|
/**
|
|
@@ -34834,9 +34952,9 @@ var date_time_component_exports = {};
|
|
|
34834
34952
|
__export(date_time_component_exports, {
|
|
34835
34953
|
DateTimeComponent: () => DateTimeComponent
|
|
34836
34954
|
});
|
|
34837
|
-
var
|
|
34955
|
+
var import_obsidian139 = require("obsidian");
|
|
34838
34956
|
init_css_class();
|
|
34839
|
-
var moment3 = extractDefaultExportInterop(
|
|
34957
|
+
var moment3 = extractDefaultExportInterop(import_obsidian139.moment);
|
|
34840
34958
|
var DATE_TIME_FORMAT = "YYYY-MM-DDTHH:mm";
|
|
34841
34959
|
var DateTimeComponent = class extends TypedRangeTextComponent {
|
|
34842
34960
|
/**
|
|
@@ -34976,9 +35094,9 @@ var month_component_exports = {};
|
|
|
34976
35094
|
__export(month_component_exports, {
|
|
34977
35095
|
MonthComponent: () => MonthComponent
|
|
34978
35096
|
});
|
|
34979
|
-
var
|
|
35097
|
+
var import_obsidian140 = require("obsidian");
|
|
34980
35098
|
init_css_class();
|
|
34981
|
-
var moment4 = extractDefaultExportInterop(
|
|
35099
|
+
var moment4 = extractDefaultExportInterop(import_obsidian140.moment);
|
|
34982
35100
|
var DATE_FORMAT2 = "YYYY-MM";
|
|
34983
35101
|
var MonthComponent = class extends TypedRangeTextComponent {
|
|
34984
35102
|
/**
|
|
@@ -35026,10 +35144,10 @@ var multiple_dropdown_component_exports = {};
|
|
|
35026
35144
|
__export(multiple_dropdown_component_exports, {
|
|
35027
35145
|
MultipleDropdownComponent: () => MultipleDropdownComponent
|
|
35028
35146
|
});
|
|
35029
|
-
var
|
|
35147
|
+
var import_obsidian141 = require("obsidian");
|
|
35030
35148
|
init_css_class();
|
|
35031
35149
|
init_plugin_context();
|
|
35032
|
-
var MultipleDropdownComponent = class extends
|
|
35150
|
+
var MultipleDropdownComponent = class extends import_obsidian141.ValueComponent {
|
|
35033
35151
|
/**
|
|
35034
35152
|
* A select element of the component.
|
|
35035
35153
|
*
|
|
@@ -35058,7 +35176,7 @@ var MultipleDropdownComponent = class extends import_obsidian137.ValueComponent
|
|
|
35058
35176
|
*/
|
|
35059
35177
|
constructor(containerEl) {
|
|
35060
35178
|
super();
|
|
35061
|
-
this.dropdownComponent = new
|
|
35179
|
+
this.dropdownComponent = new import_obsidian141.DropdownComponent(containerEl);
|
|
35062
35180
|
this.dropdownComponent.selectEl.multiple = true;
|
|
35063
35181
|
addPluginCssClasses(containerEl, "multiple-dropdown-component" /* MultipleDropdownComponent */);
|
|
35064
35182
|
}
|
|
@@ -35231,10 +35349,10 @@ var multiple_text_component_exports = {};
|
|
|
35231
35349
|
__export(multiple_text_component_exports, {
|
|
35232
35350
|
MultipleTextComponent: () => MultipleTextComponent
|
|
35233
35351
|
});
|
|
35234
|
-
var
|
|
35352
|
+
var import_obsidian142 = require("obsidian");
|
|
35235
35353
|
init_css_class();
|
|
35236
35354
|
init_plugin_context();
|
|
35237
|
-
var MultipleTextComponent = class extends
|
|
35355
|
+
var MultipleTextComponent = class extends import_obsidian142.ValueComponent {
|
|
35238
35356
|
/**
|
|
35239
35357
|
* An input element of the component.
|
|
35240
35358
|
*
|
|
@@ -35263,7 +35381,7 @@ var MultipleTextComponent = class extends import_obsidian138.ValueComponent {
|
|
|
35263
35381
|
*/
|
|
35264
35382
|
constructor(containerEl) {
|
|
35265
35383
|
super();
|
|
35266
|
-
this.textAreaComponent = new
|
|
35384
|
+
this.textAreaComponent = new import_obsidian142.TextAreaComponent(containerEl);
|
|
35267
35385
|
addPluginCssClasses(containerEl, "multiple-text-component" /* MultipleTextComponent */);
|
|
35268
35386
|
}
|
|
35269
35387
|
/**
|
|
@@ -35525,7 +35643,7 @@ var time_component_exports = {};
|
|
|
35525
35643
|
__export(time_component_exports, {
|
|
35526
35644
|
TimeComponent: () => TimeComponent
|
|
35527
35645
|
});
|
|
35528
|
-
var
|
|
35646
|
+
var import_obsidian143 = require("obsidian");
|
|
35529
35647
|
init_css_class();
|
|
35530
35648
|
var TimeComponent = class extends TypedRangeTextComponent {
|
|
35531
35649
|
/**
|
|
@@ -35547,7 +35665,7 @@ var TimeComponent = class extends TypedRangeTextComponent {
|
|
|
35547
35665
|
* @returns The date.
|
|
35548
35666
|
*/
|
|
35549
35667
|
valueFromString(str) {
|
|
35550
|
-
return
|
|
35668
|
+
return import_obsidian143.moment.duration(str);
|
|
35551
35669
|
}
|
|
35552
35670
|
/**
|
|
35553
35671
|
* Converts a time to a string.
|
|
@@ -35564,7 +35682,7 @@ var TimeComponent = class extends TypedRangeTextComponent {
|
|
|
35564
35682
|
} else {
|
|
35565
35683
|
format2 = "HH:mm";
|
|
35566
35684
|
}
|
|
35567
|
-
return
|
|
35685
|
+
return import_obsidian143.moment.utc(value.asMilliseconds()).format(format2);
|
|
35568
35686
|
}
|
|
35569
35687
|
};
|
|
35570
35688
|
|
|
@@ -35573,10 +35691,10 @@ var tri_state_checkbox_component_exports = {};
|
|
|
35573
35691
|
__export(tri_state_checkbox_component_exports, {
|
|
35574
35692
|
TriStateCheckboxComponent: () => TriStateCheckboxComponent
|
|
35575
35693
|
});
|
|
35576
|
-
var
|
|
35694
|
+
var import_obsidian144 = require("obsidian");
|
|
35577
35695
|
init_css_class();
|
|
35578
35696
|
init_plugin_context();
|
|
35579
|
-
var TriStateCheckboxComponent = class extends
|
|
35697
|
+
var TriStateCheckboxComponent = class extends import_obsidian144.ValueComponent {
|
|
35580
35698
|
/**
|
|
35581
35699
|
* An input element of the checkbox.
|
|
35582
35700
|
*/
|
|
@@ -35654,10 +35772,10 @@ var typed_dropdown_component_exports = {};
|
|
|
35654
35772
|
__export(typed_dropdown_component_exports, {
|
|
35655
35773
|
TypedDropdownComponent: () => TypedDropdownComponent
|
|
35656
35774
|
});
|
|
35657
|
-
var
|
|
35775
|
+
var import_obsidian145 = require("obsidian");
|
|
35658
35776
|
init_css_class();
|
|
35659
35777
|
init_plugin_context();
|
|
35660
|
-
var TypedDropdownComponent = class extends
|
|
35778
|
+
var TypedDropdownComponent = class extends import_obsidian145.ValueComponent {
|
|
35661
35779
|
/**
|
|
35662
35780
|
* A select element of the component.
|
|
35663
35781
|
*
|
|
@@ -35690,7 +35808,7 @@ var TypedDropdownComponent = class extends import_obsidian141.ValueComponent {
|
|
|
35690
35808
|
*/
|
|
35691
35809
|
constructor(containerEl) {
|
|
35692
35810
|
super();
|
|
35693
|
-
this.dropdownComponent = new
|
|
35811
|
+
this.dropdownComponent = new import_obsidian145.DropdownComponent(containerEl);
|
|
35694
35812
|
addPluginCssClasses(containerEl, "typed-dropdown-component" /* TypedDropdownComponent */);
|
|
35695
35813
|
}
|
|
35696
35814
|
/**
|
|
@@ -35780,10 +35898,10 @@ var typed_multiple_dropdown_component_exports = {};
|
|
|
35780
35898
|
__export(typed_multiple_dropdown_component_exports, {
|
|
35781
35899
|
TypedMultipleDropdownComponent: () => TypedMultipleDropdownComponent
|
|
35782
35900
|
});
|
|
35783
|
-
var
|
|
35901
|
+
var import_obsidian146 = require("obsidian");
|
|
35784
35902
|
init_css_class();
|
|
35785
35903
|
init_plugin_context();
|
|
35786
|
-
var TypedMultipleDropdownComponent = class extends
|
|
35904
|
+
var TypedMultipleDropdownComponent = class extends import_obsidian146.ValueComponent {
|
|
35787
35905
|
/**
|
|
35788
35906
|
* A select element of the component.
|
|
35789
35907
|
*
|
|
@@ -35961,9 +36079,9 @@ var week_component_exports = {};
|
|
|
35961
36079
|
__export(week_component_exports, {
|
|
35962
36080
|
WeekComponent: () => WeekComponent
|
|
35963
36081
|
});
|
|
35964
|
-
var
|
|
36082
|
+
var import_obsidian147 = require("obsidian");
|
|
35965
36083
|
init_css_class();
|
|
35966
|
-
var moment6 = extractDefaultExportInterop(
|
|
36084
|
+
var moment6 = extractDefaultExportInterop(import_obsidian147.moment);
|
|
35967
36085
|
var DATE_FORMAT3 = "YYYY-[W]WW";
|
|
35968
36086
|
var WeekComponent = class extends TypedRangeTextComponent {
|
|
35969
36087
|
/**
|
|
@@ -36007,7 +36125,7 @@ var WeekComponent = class extends TypedRangeTextComponent {
|
|
|
36007
36125
|
};
|
|
36008
36126
|
|
|
36009
36127
|
// src/obsidian/setting-ex.ts
|
|
36010
|
-
var SettingEx = class extends
|
|
36128
|
+
var SettingEx = class extends import_obsidian148.Setting {
|
|
36011
36129
|
/**
|
|
36012
36130
|
* Adds a {@link CheckboxComponent} to the setting.
|
|
36013
36131
|
*
|
|
@@ -36224,7 +36342,7 @@ __export(validation_exports, {
|
|
|
36224
36342
|
getOsUnsafePathCharsRegExp: () => getOsUnsafePathCharsRegExp,
|
|
36225
36343
|
isValidationMessageHolder: () => isValidationMessageHolder
|
|
36226
36344
|
});
|
|
36227
|
-
var
|
|
36345
|
+
var import_obsidian149 = require("obsidian");
|
|
36228
36346
|
init_reg_exp();
|
|
36229
36347
|
function isValidationMessageHolder(value) {
|
|
36230
36348
|
return value.validationMessage !== void 0;
|
|
@@ -36239,7 +36357,7 @@ function getOsAndObsidianUnsafePathCharsRegExp(isWindows) {
|
|
|
36239
36357
|
]);
|
|
36240
36358
|
}
|
|
36241
36359
|
function getOsUnsafePathCharsRegExp(isWindows) {
|
|
36242
|
-
isWindows ??=
|
|
36360
|
+
isWindows ??= import_obsidian149.Platform.isWin;
|
|
36243
36361
|
return isWindows ? WINDOWS_UNSAFE_PATH_CHARS : UNIX_UNSAFE_PATH_CHARS;
|
|
36244
36362
|
}
|
|
36245
36363
|
|
|
@@ -36267,7 +36385,7 @@ var PluginSettingsTabEventsComponent = class extends ComponentEx {
|
|
|
36267
36385
|
registerAsyncEvent(this, pluginSettingsComponent.on("saveSettings", (newState, oldState, context) => this.params.onSaveSettings(newState, oldState, context)));
|
|
36268
36386
|
}
|
|
36269
36387
|
};
|
|
36270
|
-
var PluginSettingsTabBase = class extends mixinAsyncEvents()(
|
|
36388
|
+
var PluginSettingsTabBase = class extends mixinAsyncEvents()(import_obsidian150.PluginSettingTab) {
|
|
36271
36389
|
/**
|
|
36272
36390
|
* Whether the plugin settings tab is open.
|
|
36273
36391
|
*
|
|
@@ -36305,7 +36423,7 @@ var PluginSettingsTabBase = class extends mixinAsyncEvents()(import_obsidian146.
|
|
|
36305
36423
|
super(params.plugin.app, params.plugin);
|
|
36306
36424
|
this.pluginSettingsComponent = params.pluginSettingsComponent;
|
|
36307
36425
|
addPluginCssClasses(this.containerEl, "plugin-settings-tab" /* PluginSettingsTab */);
|
|
36308
|
-
this.saveSettingsDebounced = (0,
|
|
36426
|
+
this.saveSettingsDebounced = (0, import_obsidian150.debounce)(
|
|
36309
36427
|
convertAsyncToSync(() => this.pluginSettingsComponent.saveToFile(SAVE_TO_FILE_CONTEXT)),
|
|
36310
36428
|
this.saveSettingsDebounceTimeoutInMilliseconds
|
|
36311
36429
|
);
|
|
@@ -36378,7 +36496,7 @@ var PluginSettingsTabBase = class extends mixinAsyncEvents()(import_obsidian146.
|
|
|
36378
36496
|
}
|
|
36379
36497
|
let shouldSkipOnChange = false;
|
|
36380
36498
|
const UPDATE_VALIDATOR_EL_TIMEOUT_IN_MILLISECONDS = 100;
|
|
36381
|
-
const updateValidatorElDebounced = (0,
|
|
36499
|
+
const updateValidatorElDebounced = (0, import_obsidian150.debounce)(() => {
|
|
36382
36500
|
window.requestAnimationFrame(() => {
|
|
36383
36501
|
updateValidatorEl();
|
|
36384
36502
|
});
|
|
@@ -36461,7 +36579,7 @@ var PluginSettingsTabBase = class extends mixinAsyncEvents()(import_obsidian146.
|
|
|
36461
36579
|
tooltipContentEl.textContent = validationMessage;
|
|
36462
36580
|
tooltipEl?.toggle(!!validationMessage);
|
|
36463
36581
|
} else if (validationMessage) {
|
|
36464
|
-
(0,
|
|
36582
|
+
(0, import_obsidian150.setTooltip)(validatorEl, validationMessage);
|
|
36465
36583
|
}
|
|
36466
36584
|
}
|
|
36467
36585
|
}
|
|
@@ -36705,12 +36823,12 @@ __export(plugin_exports, {
|
|
|
36705
36823
|
reloadPlugin: () => reloadPlugin,
|
|
36706
36824
|
showErrorAndDisablePlugin: () => showErrorAndDisablePlugin
|
|
36707
36825
|
});
|
|
36708
|
-
var
|
|
36826
|
+
var import_obsidian151 = require("obsidian");
|
|
36709
36827
|
init_async_events();
|
|
36710
36828
|
init_error();
|
|
36711
36829
|
init_function();
|
|
36712
36830
|
init_type_guards();
|
|
36713
|
-
var PluginBase = class extends mixinAsyncEvents()(
|
|
36831
|
+
var PluginBase = class extends mixinAsyncEvents()(import_obsidian151.Plugin) {
|
|
36714
36832
|
/**
|
|
36715
36833
|
* Gets abort signal component.
|
|
36716
36834
|
*
|
|
@@ -36960,7 +37078,7 @@ var plugin_cli_handler_registrar_exports = {};
|
|
|
36960
37078
|
__export(plugin_cli_handler_registrar_exports, {
|
|
36961
37079
|
PluginCliHandlerRegistrar: () => PluginCliHandlerRegistrar
|
|
36962
37080
|
});
|
|
36963
|
-
var
|
|
37081
|
+
var import_obsidian152 = require("obsidian");
|
|
36964
37082
|
var PluginCliHandlerRegistrar = class {
|
|
36965
37083
|
/**
|
|
36966
37084
|
* Creates a new instance of the {@link PluginCliHandlerRegistrar} class.
|
|
@@ -36994,7 +37112,7 @@ var field_popover_exports = {};
|
|
|
36994
37112
|
__export(field_popover_exports, {
|
|
36995
37113
|
editFieldsInPopover: () => editFieldsInPopover
|
|
36996
37114
|
});
|
|
36997
|
-
var
|
|
37115
|
+
var import_obsidian154 = require("obsidian");
|
|
36998
37116
|
init_css_class();
|
|
36999
37117
|
|
|
37000
37118
|
// src/obsidian/popovers/popover.ts
|
|
@@ -37002,7 +37120,7 @@ var popover_exports = {};
|
|
|
37002
37120
|
__export(popover_exports, {
|
|
37003
37121
|
showPopover: () => showPopover
|
|
37004
37122
|
});
|
|
37005
|
-
var
|
|
37123
|
+
var import_obsidian153 = require("obsidian");
|
|
37006
37124
|
init_css_class();
|
|
37007
37125
|
init_plugin_context();
|
|
37008
37126
|
var ANCHOR_GAP_IN_PIXELS = 4;
|
|
@@ -37058,7 +37176,7 @@ async function showPopover(params) {
|
|
|
37058
37176
|
handleCancel();
|
|
37059
37177
|
}
|
|
37060
37178
|
});
|
|
37061
|
-
const buttonsSetting = new
|
|
37179
|
+
const buttonsSetting = new import_obsidian153.Setting(popoverEl);
|
|
37062
37180
|
buttonsSetting.addButton((button) => {
|
|
37063
37181
|
button.setButtonText(okButtonText ?? t2(($) => $.obsidianDevUtils.buttons.ok)).setCta().setClass("ok-button" /* OkButton */).onClick(handleOk);
|
|
37064
37182
|
});
|
|
@@ -37117,8 +37235,8 @@ async function editFieldsInPopover(params) {
|
|
|
37117
37235
|
}));
|
|
37118
37236
|
}
|
|
37119
37237
|
function addField(containerEl, field) {
|
|
37120
|
-
const setting = new
|
|
37121
|
-
const textComponent = new
|
|
37238
|
+
const setting = new import_obsidian154.Setting(containerEl).setName(field.name);
|
|
37239
|
+
const textComponent = new import_obsidian154.TextComponent(setting.controlEl);
|
|
37122
37240
|
textComponent.setValue(field.defaultValue ?? "");
|
|
37123
37241
|
textComponent.setPlaceholder(field.placeholder ?? "");
|
|
37124
37242
|
textComponent.inputEl.addClass("text-box" /* TextBox */);
|
|
@@ -37137,7 +37255,7 @@ __export(app_context_exports, {
|
|
|
37137
37255
|
AppContext: () => AppContext,
|
|
37138
37256
|
useApp: () => useApp
|
|
37139
37257
|
});
|
|
37140
|
-
var
|
|
37258
|
+
var import_obsidian155 = require("obsidian");
|
|
37141
37259
|
var import_react = __toESM(require_react(), 1);
|
|
37142
37260
|
init_type_guards();
|
|
37143
37261
|
var AppContext = (0, import_react.createContext)(void 0);
|
|
@@ -37150,7 +37268,7 @@ var ribbon_icon_registrar_exports = {};
|
|
|
37150
37268
|
__export(ribbon_icon_registrar_exports, {
|
|
37151
37269
|
PluginRibbonIconRegistrar: () => PluginRibbonIconRegistrar
|
|
37152
37270
|
});
|
|
37153
|
-
var
|
|
37271
|
+
var import_obsidian156 = require("obsidian");
|
|
37154
37272
|
var PluginRibbonIconRegistrar = class {
|
|
37155
37273
|
/**
|
|
37156
37274
|
* Creates a new instance of the {@link PluginRibbonIconRegistrar} class.
|
|
@@ -37211,8 +37329,8 @@ var setting_group_ex_exports = {};
|
|
|
37211
37329
|
__export(setting_group_ex_exports, {
|
|
37212
37330
|
SettingGroupEx: () => SettingGroupEx
|
|
37213
37331
|
});
|
|
37214
|
-
var
|
|
37215
|
-
var SettingGroupEx = class extends
|
|
37332
|
+
var import_obsidian157 = require("obsidian");
|
|
37333
|
+
var SettingGroupEx = class extends import_obsidian157.SettingGroup {
|
|
37216
37334
|
/**
|
|
37217
37335
|
* Creates a new setting group.
|
|
37218
37336
|
*
|
|
@@ -37239,7 +37357,7 @@ var status_bar_item_registrar_exports = {};
|
|
|
37239
37357
|
__export(status_bar_item_registrar_exports, {
|
|
37240
37358
|
PluginStatusBarItemRegistrar: () => PluginStatusBarItemRegistrar
|
|
37241
37359
|
});
|
|
37242
|
-
var
|
|
37360
|
+
var import_obsidian158 = require("obsidian");
|
|
37243
37361
|
var PluginStatusBarItemRegistrar = class {
|
|
37244
37362
|
/**
|
|
37245
37363
|
* Creates a new instance of the {@link PluginStatusBarItemRegistrar} class.
|
|
@@ -37511,7 +37629,7 @@ var view_registrar_exports = {};
|
|
|
37511
37629
|
__export(view_registrar_exports, {
|
|
37512
37630
|
PluginViewRegistrar: () => PluginViewRegistrar
|
|
37513
37631
|
});
|
|
37514
|
-
var
|
|
37632
|
+
var import_obsidian159 = require("obsidian");
|
|
37515
37633
|
var PluginViewRegistrar = class {
|
|
37516
37634
|
/**
|
|
37517
37635
|
* Creates a new instance of the {@link PluginViewRegistrar} class.
|
|
@@ -37796,6 +37914,7 @@ __export(merged_exports, {
|
|
|
37796
37914
|
SilentError: () => SilentError,
|
|
37797
37915
|
SkipPrivatePropertyTransformer: () => SkipPrivatePropertyTransformer,
|
|
37798
37916
|
SuggestModalCommandBuilder: () => SuggestModalCommandBuilder,
|
|
37917
|
+
SyntaxHighlightingComponent: () => SyntaxHighlightingComponent,
|
|
37799
37918
|
TelephoneComponent: () => TelephoneComponent,
|
|
37800
37919
|
TimeComponent: () => TimeComponent,
|
|
37801
37920
|
Transformer: () => Transformer,
|
|
@@ -38234,8 +38353,8 @@ init_value_provider();
|
|
|
38234
38353
|
init_value_wrapper();
|
|
38235
38354
|
|
|
38236
38355
|
// integration-test-plugin/main.ts
|
|
38237
|
-
var
|
|
38238
|
-
var IntegrationTestPlugin = class extends
|
|
38356
|
+
var import_obsidian160 = require("obsidian");
|
|
38357
|
+
var IntegrationTestPlugin = class extends import_obsidian160.Plugin {
|
|
38239
38358
|
onload() {
|
|
38240
38359
|
window.__obsidianDevUtilsModule = src_exports;
|
|
38241
38360
|
}
|