obsidian-dev-utils 91.0.0 → 92.0.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 +13 -0
- package/dist/demo-vault-helper/main.js +65 -2
- package/dist/integration-test-plugin/main.js +188 -107
- package/dist/lib/cjs/generated-during-build.cjs +1 -1
- package/dist/lib/cjs/obsidian/demo-vault-helper.cjs +49 -1
- package/dist/lib/cjs/obsidian/demo-vault-helper.d.cts +7 -2
- package/dist/lib/cjs/obsidian/modals/minimizable-modal.cjs +22 -1
- package/dist/lib/cjs/obsidian/modals/minimizable-modal.d.cts +14 -0
- package/dist/lib/cjs/obsidian/modals/prompt.cjs +18 -6
- package/dist/lib/cjs/script-utils/demo-vault-coverage.cjs +185 -4
- package/dist/lib/cjs/script-utils/demo-vault-coverage.d.cts +106 -1
- package/dist/lib/esm/generated-during-build.mjs +1 -1
- package/dist/lib/esm/obsidian/demo-vault-helper.d.mts +7 -2
- package/dist/lib/esm/obsidian/demo-vault-helper.mjs +53 -2
- package/dist/lib/esm/obsidian/modals/minimizable-modal.d.mts +14 -0
- package/dist/lib/esm/obsidian/modals/minimizable-modal.mjs +22 -1
- package/dist/lib/esm/obsidian/modals/prompt.mjs +18 -6
- package/dist/lib/esm/script-utils/demo-vault-coverage.d.mts +106 -1
- package/dist/lib/esm/script-utils/demo-vault-coverage.mjs +186 -4
- package/package.json +4 -4
|
@@ -32890,18 +32890,26 @@ var demo_vault_helper_exports = {};
|
|
|
32890
32890
|
__export(demo_vault_helper_exports, {
|
|
32891
32891
|
bootstrapDemoVault: () => bootstrapDemoVault
|
|
32892
32892
|
});
|
|
32893
|
+
var import_obsidian120 = require("obsidian");
|
|
32893
32894
|
init_path();
|
|
32895
|
+
init_type_guards();
|
|
32894
32896
|
init_community_plugins();
|
|
32895
32897
|
var CODE_SCRIPT_TOOLKIT_PLUGIN_ID = "fix-require-modules";
|
|
32896
32898
|
var CODE_SCRIPT_TOOLKIT_MODULES_ROOT = "_assets/CodeScriptToolkit";
|
|
32897
32899
|
var CODE_SCRIPT_TOOLKIT_SETTINGS = {
|
|
32900
|
+
defaultCodeButtonConfig: "---\nsourceVisibility: collapsed\n---",
|
|
32898
32901
|
invocableScriptsFolder: "Invocables",
|
|
32899
32902
|
modulesRoot: CODE_SCRIPT_TOOLKIT_MODULES_ROOT,
|
|
32900
32903
|
shouldHandleProtocolUrls: true,
|
|
32901
32904
|
startupScriptPath: "startup.ts"
|
|
32902
32905
|
};
|
|
32906
|
+
var DEMO_VAULT_HELPER_PLUGIN_ID = "demo-vault-helper";
|
|
32907
|
+
var PLUGINS_FOLDER_NAME = "plugins";
|
|
32908
|
+
var OPEN_DEMO_VAULT_COMMAND_NAME = "Open demo vault";
|
|
32909
|
+
var SANDBOX_NOTICE_DURATION_IN_MILLISECONDS = 0;
|
|
32903
32910
|
async function bootstrapDemoVault(params) {
|
|
32904
32911
|
const { app } = params;
|
|
32912
|
+
const demoedPluginId = await getDemoedPluginId(app);
|
|
32905
32913
|
await installCommunityPlugin({ app, pluginId: CODE_SCRIPT_TOOLKIT_PLUGIN_ID });
|
|
32906
32914
|
const result = await configureCommunityPlugin({
|
|
32907
32915
|
app,
|
|
@@ -32915,6 +32923,26 @@ async function bootstrapDemoVault(params) {
|
|
|
32915
32923
|
await disableCommunityPlugin({ app, pluginId: CODE_SCRIPT_TOOLKIT_PLUGIN_ID });
|
|
32916
32924
|
await enableCommunityPlugin({ app, pluginId: CODE_SCRIPT_TOOLKIT_PLUGIN_ID });
|
|
32917
32925
|
}
|
|
32926
|
+
showSandboxNotice(app, demoedPluginId);
|
|
32927
|
+
}
|
|
32928
|
+
function buildSandboxNoticeFragment(pluginName, basePath) {
|
|
32929
|
+
return createFragment((fragment) => {
|
|
32930
|
+
if (pluginName === null) {
|
|
32931
|
+
fragment.appendText("This is a demo vault.");
|
|
32932
|
+
} else {
|
|
32933
|
+
fragment.appendText("This is a demo vault for ");
|
|
32934
|
+
fragment.createEl("b", { text: pluginName });
|
|
32935
|
+
fragment.appendText(".");
|
|
32936
|
+
}
|
|
32937
|
+
fragment.appendText(" It is a temporary sandbox");
|
|
32938
|
+
if (basePath !== null) {
|
|
32939
|
+
fragment.appendText(" at ");
|
|
32940
|
+
fragment.createEl("code", { text: basePath });
|
|
32941
|
+
}
|
|
32942
|
+
fragment.appendText(", cleaned up automatically about a day after you last use it \u2014 copy anything you want to keep into your own vault. Running ");
|
|
32943
|
+
fragment.createEl("b", { text: pluginName === null ? OPEN_DEMO_VAULT_COMMAND_NAME : `${pluginName}: ${OPEN_DEMO_VAULT_COMMAND_NAME}` });
|
|
32944
|
+
fragment.appendText(" again creates a new copy with the latest plugin version, so your notes will not appear in it.");
|
|
32945
|
+
});
|
|
32918
32946
|
}
|
|
32919
32947
|
async function ensureInvocableScriptsFolder(app) {
|
|
32920
32948
|
const invocableScriptsFolderPath = join(CODE_SCRIPT_TOOLKIT_MODULES_ROOT, CODE_SCRIPT_TOOLKIT_SETTINGS.invocableScriptsFolder);
|
|
@@ -32922,6 +32950,26 @@ async function ensureInvocableScriptsFolder(app) {
|
|
|
32922
32950
|
await app.vault.adapter.mkdir(invocableScriptsFolderPath);
|
|
32923
32951
|
}
|
|
32924
32952
|
}
|
|
32953
|
+
async function getDemoedPluginId(app) {
|
|
32954
|
+
const pluginsFolderPath = join(app.vault.configDir, PLUGINS_FOLDER_NAME);
|
|
32955
|
+
if (!await app.vault.adapter.exists(pluginsFolderPath)) {
|
|
32956
|
+
return null;
|
|
32957
|
+
}
|
|
32958
|
+
const listedFiles = await app.vault.adapter.list(pluginsFolderPath);
|
|
32959
|
+
const demoedPluginIds = listedFiles.folders.map((folderPath) => basename(folderPath)).filter((pluginId) => pluginId !== DEMO_VAULT_HELPER_PLUGIN_ID);
|
|
32960
|
+
return demoedPluginIds.length === 1 ? ensureNonNullable(demoedPluginIds[0]) : null;
|
|
32961
|
+
}
|
|
32962
|
+
function getVaultBasePath(app) {
|
|
32963
|
+
return isBasePathAdapter(app.vault.adapter) ? app.vault.adapter.getBasePath() : null;
|
|
32964
|
+
}
|
|
32965
|
+
function isBasePathAdapter(adapter) {
|
|
32966
|
+
return typeof Reflect.get(adapter, "getBasePath") === "function";
|
|
32967
|
+
}
|
|
32968
|
+
function showSandboxNotice(app, demoedPluginId) {
|
|
32969
|
+
const pluginName = demoedPluginId === null ? null : app.plugins.manifests[demoedPluginId]?.name ?? demoedPluginId;
|
|
32970
|
+
const fragment = buildSandboxNoticeFragment(pluginName, getVaultBasePath(app));
|
|
32971
|
+
new import_obsidian120.Notice(fragment, SANDBOX_NOTICE_DURATION_IN_MILLISECONDS);
|
|
32972
|
+
}
|
|
32925
32973
|
|
|
32926
32974
|
// src/obsidian/index.ts
|
|
32927
32975
|
init_desktop_demo_vault_opener();
|
|
@@ -32935,7 +32983,7 @@ __export(desktop_trusted_input_exports, {
|
|
|
32935
32983
|
typeIntoEditor: () => typeIntoEditor,
|
|
32936
32984
|
unhoverElement: () => unhoverElement
|
|
32937
32985
|
});
|
|
32938
|
-
var
|
|
32986
|
+
var import_obsidian121 = require("obsidian");
|
|
32939
32987
|
init_type_guards();
|
|
32940
32988
|
var INPUT_POLL_INTERVAL_IN_MILLISECONDS = 50;
|
|
32941
32989
|
var INPUT_TIMEOUT_IN_MILLISECONDS = 5e3;
|
|
@@ -32954,7 +33002,7 @@ function moveMouse(params) {
|
|
|
32954
33002
|
}
|
|
32955
33003
|
function pressKey(params) {
|
|
32956
33004
|
const { key, modifiers = [] } = params;
|
|
32957
|
-
const isMacOS =
|
|
33005
|
+
const isMacOS = import_obsidian121.Platform.isMacOS;
|
|
32958
33006
|
const electronModifiers = modifiers.map((modifier) => {
|
|
32959
33007
|
switch (modifier) {
|
|
32960
33008
|
case "Alt": {
|
|
@@ -33019,7 +33067,7 @@ var editor_extension_registrar_exports = {};
|
|
|
33019
33067
|
__export(editor_extension_registrar_exports, {
|
|
33020
33068
|
PluginEditorExtensionRegistrar: () => PluginEditorExtensionRegistrar
|
|
33021
33069
|
});
|
|
33022
|
-
var
|
|
33070
|
+
var import_obsidian122 = require("obsidian");
|
|
33023
33071
|
var PluginEditorExtensionRegistrar = class {
|
|
33024
33072
|
/**
|
|
33025
33073
|
* Creates a new instance of the {@link PluginEditorExtensionRegistrar} class.
|
|
@@ -33045,7 +33093,7 @@ var editor_suggest_registrar_exports = {};
|
|
|
33045
33093
|
__export(editor_suggest_registrar_exports, {
|
|
33046
33094
|
PluginEditorSuggestRegistrar: () => PluginEditorSuggestRegistrar
|
|
33047
33095
|
});
|
|
33048
|
-
var
|
|
33096
|
+
var import_obsidian123 = require("obsidian");
|
|
33049
33097
|
var PluginEditorSuggestRegistrar = class {
|
|
33050
33098
|
/**
|
|
33051
33099
|
* Creates a new instance of the {@link PluginEditorSuggestRegistrar} class.
|
|
@@ -33071,7 +33119,7 @@ var extensions_registrar_exports = {};
|
|
|
33071
33119
|
__export(extensions_registrar_exports, {
|
|
33072
33120
|
PluginExtensionsRegistrar: () => PluginExtensionsRegistrar
|
|
33073
33121
|
});
|
|
33074
|
-
var
|
|
33122
|
+
var import_obsidian124 = require("obsidian");
|
|
33075
33123
|
var PluginExtensionsRegistrar = class {
|
|
33076
33124
|
/**
|
|
33077
33125
|
* Creates a new instance of the {@link PluginExtensionsRegistrar} class.
|
|
@@ -33097,7 +33145,7 @@ var hover_link_source_registrar_exports = {};
|
|
|
33097
33145
|
__export(hover_link_source_registrar_exports, {
|
|
33098
33146
|
PluginHoverLinkSourceRegistrar: () => PluginHoverLinkSourceRegistrar
|
|
33099
33147
|
});
|
|
33100
|
-
var
|
|
33148
|
+
var import_obsidian125 = require("obsidian");
|
|
33101
33149
|
var PluginHoverLinkSourceRegistrar = class {
|
|
33102
33150
|
/**
|
|
33103
33151
|
* Creates a new instance of the {@link PluginHoverLinkSourceRegistrar} class.
|
|
@@ -33165,7 +33213,7 @@ var loop_exports = {};
|
|
|
33165
33213
|
__export(loop_exports, {
|
|
33166
33214
|
loop: () => loop
|
|
33167
33215
|
});
|
|
33168
|
-
var
|
|
33216
|
+
var import_obsidian126 = require("obsidian");
|
|
33169
33217
|
init_abort_controller();
|
|
33170
33218
|
init_debug();
|
|
33171
33219
|
init_error();
|
|
@@ -33584,7 +33632,7 @@ var markdown_post_processor_registrar_exports = {};
|
|
|
33584
33632
|
__export(markdown_post_processor_registrar_exports, {
|
|
33585
33633
|
PluginMarkdownPostProcessorRegistrar: () => PluginMarkdownPostProcessorRegistrar
|
|
33586
33634
|
});
|
|
33587
|
-
var
|
|
33635
|
+
var import_obsidian127 = require("obsidian");
|
|
33588
33636
|
var PluginMarkdownPostProcessorRegistrar = class {
|
|
33589
33637
|
/**
|
|
33590
33638
|
* Creates a new instance of the {@link PluginMarkdownPostProcessorRegistrar} class.
|
|
@@ -33629,7 +33677,7 @@ __export(markdown_exports, {
|
|
|
33629
33677
|
renderExternalLink: () => renderExternalLink,
|
|
33630
33678
|
renderInternalLink: () => renderInternalLink
|
|
33631
33679
|
});
|
|
33632
|
-
var
|
|
33680
|
+
var import_obsidian128 = require("obsidian");
|
|
33633
33681
|
var moduleState4 = {
|
|
33634
33682
|
domEventsHandlersConstructor: null
|
|
33635
33683
|
};
|
|
@@ -33692,12 +33740,12 @@ async function fullRender(params) {
|
|
|
33692
33740
|
if (params.component) {
|
|
33693
33741
|
component = params.component;
|
|
33694
33742
|
} else {
|
|
33695
|
-
component = new
|
|
33743
|
+
component = new import_obsidian128.Component();
|
|
33696
33744
|
component.load();
|
|
33697
33745
|
shouldUnloadComponent = true;
|
|
33698
33746
|
}
|
|
33699
33747
|
const _ = __using(_stack, component.addChild(new EmbedByExtensionMdPatchComponent(params.app.embedRegistry.embedByExtension)));
|
|
33700
|
-
await
|
|
33748
|
+
await import_obsidian128.MarkdownRenderer.render(params.app, params.markdown, params.el, sourcePath, component);
|
|
33701
33749
|
if (shouldUnloadComponent) {
|
|
33702
33750
|
component.unload();
|
|
33703
33751
|
}
|
|
@@ -33720,10 +33768,10 @@ async function markdownToHtml(params) {
|
|
|
33720
33768
|
markdown,
|
|
33721
33769
|
sourcePath
|
|
33722
33770
|
} = params;
|
|
33723
|
-
const component = new
|
|
33771
|
+
const component = new import_obsidian128.Component();
|
|
33724
33772
|
component.load();
|
|
33725
33773
|
const renderDiv = createDiv();
|
|
33726
|
-
await
|
|
33774
|
+
await import_obsidian128.MarkdownRenderer.render(app, markdown, renderDiv, sourcePath ?? "", component);
|
|
33727
33775
|
const html2 = renderDiv.innerHTML;
|
|
33728
33776
|
component.unload();
|
|
33729
33777
|
return html2;
|
|
@@ -33735,7 +33783,7 @@ async function registerLinkHandlers(params) {
|
|
|
33735
33783
|
sourcePath
|
|
33736
33784
|
} = params;
|
|
33737
33785
|
moduleState4.domEventsHandlersConstructor ??= await getDomEventsHandlersConstructor(app);
|
|
33738
|
-
|
|
33786
|
+
import_obsidian128.MarkdownPreviewRenderer.registerDomEvents(
|
|
33739
33787
|
el,
|
|
33740
33788
|
new moduleState4.domEventsHandlersConstructor(
|
|
33741
33789
|
new FixedZIndexDomEventsHandlersInfo({
|
|
@@ -33816,7 +33864,7 @@ var alert_exports = {};
|
|
|
33816
33864
|
__export(alert_exports, {
|
|
33817
33865
|
alert: () => alert
|
|
33818
33866
|
});
|
|
33819
|
-
var
|
|
33867
|
+
var import_obsidian129 = require("obsidian");
|
|
33820
33868
|
init_css_class();
|
|
33821
33869
|
init_modal();
|
|
33822
33870
|
var AlertModal = class extends ModalBase {
|
|
@@ -33836,7 +33884,7 @@ var AlertModal = class extends ModalBase {
|
|
|
33836
33884
|
onOpen() {
|
|
33837
33885
|
this.titleEl.setText(this.title);
|
|
33838
33886
|
this.contentEl.createEl("p", { text: this.message });
|
|
33839
|
-
const okButton = new
|
|
33887
|
+
const okButton = new import_obsidian129.ButtonComponent(this.contentEl);
|
|
33840
33888
|
okButton.setButtonText(this.okButtonText);
|
|
33841
33889
|
okButton.setCta();
|
|
33842
33890
|
okButton.onClick(this.close.bind(this));
|
|
@@ -33857,7 +33905,7 @@ var minimizable_modal_exports = {};
|
|
|
33857
33905
|
__export(minimizable_modal_exports, {
|
|
33858
33906
|
MinimizableModal: () => MinimizableModal
|
|
33859
33907
|
});
|
|
33860
|
-
var
|
|
33908
|
+
var import_obsidian130 = require("obsidian");
|
|
33861
33909
|
init_css_class();
|
|
33862
33910
|
init_plugin_context();
|
|
33863
33911
|
var MINIMIZE_ICON_ID = "minus";
|
|
@@ -33898,7 +33946,7 @@ var PeekLockComponent = class extends MonkeyAroundComponent {
|
|
|
33898
33946
|
onload() {
|
|
33899
33947
|
super.onload();
|
|
33900
33948
|
this.registerMethodPatch({
|
|
33901
|
-
$object:
|
|
33949
|
+
$object: import_obsidian130.Modal.prototype,
|
|
33902
33950
|
methodName: "open",
|
|
33903
33951
|
patchHandler: ({ fallback, originalThis }) => {
|
|
33904
33952
|
blockOrFallback(originalThis, fallback);
|
|
@@ -33954,6 +34002,7 @@ var MinimizableModal = class {
|
|
|
33954
34002
|
minimizedBarEl = null;
|
|
33955
34003
|
peekLockComponent = null;
|
|
33956
34004
|
peekLockEntry = null;
|
|
34005
|
+
shouldMinimizeOnClickOutside;
|
|
33957
34006
|
shouldShowCancelButton;
|
|
33958
34007
|
/**
|
|
33959
34008
|
* Wraps the given modal, adding a minimize button and wiring up cleanup on close.
|
|
@@ -33963,9 +34012,15 @@ var MinimizableModal = class {
|
|
|
33963
34012
|
*/
|
|
33964
34013
|
constructor(modal, options = {}) {
|
|
33965
34014
|
this.modal = modal;
|
|
34015
|
+
this.shouldMinimizeOnClickOutside = options.shouldMinimizeOnClickOutside ?? true;
|
|
33966
34016
|
this.shouldShowCancelButton = options.shouldShowCancelButton ?? true;
|
|
33967
34017
|
addPluginCssClasses(modal.containerEl, ["minimizable-modal" /* MinimizableModal */]);
|
|
33968
34018
|
this.minimizeButtonEl = this.createMinimizeButton();
|
|
34019
|
+
if (this.shouldMinimizeOnClickOutside) {
|
|
34020
|
+
modal.containerEl.addEventListener("click", ($event) => {
|
|
34021
|
+
this.handleContainerClick($event);
|
|
34022
|
+
}, { capture: true });
|
|
34023
|
+
}
|
|
33969
34024
|
this.closePatchComponent.load();
|
|
33970
34025
|
this.patchOnClose(modal);
|
|
33971
34026
|
}
|
|
@@ -34001,7 +34056,7 @@ var MinimizableModal = class {
|
|
|
34001
34056
|
}
|
|
34002
34057
|
createMinimizeButton() {
|
|
34003
34058
|
const buttonEl = this.modal.modalEl.createEl("button", { cls: "minimize-button" /* MinimizeButton */ });
|
|
34004
|
-
(0,
|
|
34059
|
+
(0, import_obsidian130.setIcon)(buttonEl, MINIMIZE_ICON_ID);
|
|
34005
34060
|
buttonEl.addEventListener("click", () => {
|
|
34006
34061
|
this.minimize();
|
|
34007
34062
|
});
|
|
@@ -34015,11 +34070,11 @@ var MinimizableModal = class {
|
|
|
34015
34070
|
text: this.modal.titleEl.textContent
|
|
34016
34071
|
});
|
|
34017
34072
|
const restoreButtonEl = barEl.createEl("button", { cls: "restore-button" /* RestoreButton */ });
|
|
34018
|
-
(0,
|
|
34073
|
+
(0, import_obsidian130.setIcon)(restoreButtonEl, RESTORE_ICON_ID);
|
|
34019
34074
|
if (this.shouldShowCancelButton) {
|
|
34020
34075
|
const cancelButtonEl = barEl.createEl("button", { cls: "cancel-button" /* CancelButton */ });
|
|
34021
|
-
(0,
|
|
34022
|
-
(0,
|
|
34076
|
+
(0, import_obsidian130.setIcon)(cancelButtonEl, CANCEL_ICON_ID);
|
|
34077
|
+
(0, import_obsidian130.setTooltip)(cancelButtonEl, "Cancel");
|
|
34023
34078
|
cancelButtonEl.addEventListener("click", ($event) => {
|
|
34024
34079
|
$event.stopPropagation();
|
|
34025
34080
|
this.modal.close();
|
|
@@ -34064,6 +34119,20 @@ var MinimizableModal = class {
|
|
|
34064
34119
|
this.removeMinimizedBar();
|
|
34065
34120
|
this.isMinimizedValue = false;
|
|
34066
34121
|
}
|
|
34122
|
+
handleContainerClick($event) {
|
|
34123
|
+
if (this.isMinimizedValue) {
|
|
34124
|
+
return;
|
|
34125
|
+
}
|
|
34126
|
+
if ($event.composedPath().includes(this.modal.modalEl)) {
|
|
34127
|
+
return;
|
|
34128
|
+
}
|
|
34129
|
+
if ($event.target === this.modal.containerEl) {
|
|
34130
|
+
return;
|
|
34131
|
+
}
|
|
34132
|
+
$event.preventDefault();
|
|
34133
|
+
$event.stopImmediatePropagation();
|
|
34134
|
+
this.minimize();
|
|
34135
|
+
}
|
|
34067
34136
|
patchOnClose(modal) {
|
|
34068
34137
|
this.closePatchComponent.registerMethodPatch({
|
|
34069
34138
|
$object: modal,
|
|
@@ -34146,13 +34215,14 @@ var prompt_exports = {};
|
|
|
34146
34215
|
__export(prompt_exports, {
|
|
34147
34216
|
prompt: () => prompt
|
|
34148
34217
|
});
|
|
34149
|
-
var
|
|
34218
|
+
var import_obsidian131 = require("obsidian");
|
|
34150
34219
|
init_function();
|
|
34151
34220
|
init_css_class();
|
|
34152
34221
|
init_modal();
|
|
34153
34222
|
var PromptModal = class extends ModalBase {
|
|
34154
34223
|
cancelButtonText;
|
|
34155
34224
|
isOkClicked = false;
|
|
34225
|
+
isTouched = false;
|
|
34156
34226
|
okButtonText;
|
|
34157
34227
|
placeholder;
|
|
34158
34228
|
title;
|
|
@@ -34173,12 +34243,21 @@ var PromptModal = class extends ModalBase {
|
|
|
34173
34243
|
}
|
|
34174
34244
|
onOpen() {
|
|
34175
34245
|
this.titleEl.setText(this.title);
|
|
34176
|
-
const textComponent = new
|
|
34246
|
+
const textComponent = new import_obsidian131.TextComponent(this.contentEl);
|
|
34177
34247
|
const inputEl = textComponent.inputEl;
|
|
34178
|
-
const validate = async () => {
|
|
34248
|
+
const validate = async (shouldReport) => {
|
|
34179
34249
|
const errorMessage = await this.valueValidator(inputEl.value);
|
|
34180
34250
|
inputEl.setCustomValidity(errorMessage ?? "");
|
|
34181
|
-
|
|
34251
|
+
if (shouldReport) {
|
|
34252
|
+
inputEl.reportValidity();
|
|
34253
|
+
}
|
|
34254
|
+
};
|
|
34255
|
+
const handleInput = async () => {
|
|
34256
|
+
this.isTouched = true;
|
|
34257
|
+
await validate(true);
|
|
34258
|
+
};
|
|
34259
|
+
const handleFocus = async () => {
|
|
34260
|
+
await validate(this.isTouched);
|
|
34182
34261
|
};
|
|
34183
34262
|
textComponent.setValue(this.value);
|
|
34184
34263
|
textComponent.inputEl.select();
|
|
@@ -34194,17 +34273,17 @@ var PromptModal = class extends ModalBase {
|
|
|
34194
34273
|
this.close();
|
|
34195
34274
|
}
|
|
34196
34275
|
});
|
|
34197
|
-
inputEl.addEventListener("input", convertAsyncToSync(
|
|
34198
|
-
inputEl.addEventListener("focus", convertAsyncToSync(
|
|
34199
|
-
invokeAsyncSafely(validate);
|
|
34200
|
-
const okButton = new
|
|
34276
|
+
inputEl.addEventListener("input", convertAsyncToSync(handleInput));
|
|
34277
|
+
inputEl.addEventListener("focus", convertAsyncToSync(handleFocus));
|
|
34278
|
+
invokeAsyncSafely(() => validate(false));
|
|
34279
|
+
const okButton = new import_obsidian131.ButtonComponent(this.contentEl);
|
|
34201
34280
|
okButton.setButtonText(this.okButtonText);
|
|
34202
34281
|
okButton.setCta();
|
|
34203
34282
|
okButton.onClick((event) => {
|
|
34204
34283
|
this.handleOk(event, textComponent);
|
|
34205
34284
|
});
|
|
34206
34285
|
okButton.setClass("ok-button" /* OkButton */);
|
|
34207
|
-
const cancelButton = new
|
|
34286
|
+
const cancelButton = new import_obsidian131.ButtonComponent(this.contentEl);
|
|
34208
34287
|
cancelButton.setButtonText(this.cancelButtonText);
|
|
34209
34288
|
cancelButton.onClick(this.close.bind(this));
|
|
34210
34289
|
cancelButton.setClass("cancel-button" /* CancelButton */);
|
|
@@ -34212,6 +34291,8 @@ var PromptModal = class extends ModalBase {
|
|
|
34212
34291
|
handleOk(event, textComponent) {
|
|
34213
34292
|
event.preventDefault();
|
|
34214
34293
|
if (!textComponent.inputEl.checkValidity()) {
|
|
34294
|
+
this.isTouched = true;
|
|
34295
|
+
textComponent.inputEl.reportValidity();
|
|
34215
34296
|
return;
|
|
34216
34297
|
}
|
|
34217
34298
|
this.isOkClicked = true;
|
|
@@ -34232,11 +34313,11 @@ var select_item_exports = {};
|
|
|
34232
34313
|
__export(select_item_exports, {
|
|
34233
34314
|
selectItem: () => selectItem
|
|
34234
34315
|
});
|
|
34235
|
-
var
|
|
34316
|
+
var import_obsidian132 = require("obsidian");
|
|
34236
34317
|
init_css_class();
|
|
34237
34318
|
init_plugin_context();
|
|
34238
34319
|
init_modal();
|
|
34239
|
-
var ItemSelectModal = class extends
|
|
34320
|
+
var ItemSelectModal = class extends import_obsidian132.FuzzySuggestModal {
|
|
34240
34321
|
isSelected = false;
|
|
34241
34322
|
items;
|
|
34242
34323
|
itemTextFunction;
|
|
@@ -34288,7 +34369,7 @@ var suggest_modal_command_builder_exports = {};
|
|
|
34288
34369
|
__export(suggest_modal_command_builder_exports, {
|
|
34289
34370
|
SuggestModalCommandBuilder: () => SuggestModalCommandBuilder
|
|
34290
34371
|
});
|
|
34291
|
-
var
|
|
34372
|
+
var import_obsidian133 = require("obsidian");
|
|
34292
34373
|
var KEYS_MAP = /* @__PURE__ */ new Map([
|
|
34293
34374
|
["Enter", "\u21B5"],
|
|
34294
34375
|
["UpDown", "\u2191\u2193"]
|
|
@@ -34335,7 +34416,7 @@ var SuggestModalCommandBuilder = class {
|
|
|
34335
34416
|
command: this.buildCommand(command),
|
|
34336
34417
|
init: (purposeEl, scope) => {
|
|
34337
34418
|
purposeEl.appendText(" ");
|
|
34338
|
-
const dropdownComponent = new
|
|
34419
|
+
const dropdownComponent = new import_obsidian133.DropdownComponent(purposeEl);
|
|
34339
34420
|
command.onInit(dropdownComponent);
|
|
34340
34421
|
dropdownComponent.onChange((value) => {
|
|
34341
34422
|
command.onChange(value);
|
|
@@ -34410,10 +34491,10 @@ var SuggestModalCommandBuilder = class {
|
|
|
34410
34491
|
return "ctrl";
|
|
34411
34492
|
}
|
|
34412
34493
|
case "Meta": {
|
|
34413
|
-
return
|
|
34494
|
+
return import_obsidian133.Platform.isMacOS ? "cmd" : "win";
|
|
34414
34495
|
}
|
|
34415
34496
|
case "Mod": {
|
|
34416
|
-
return
|
|
34497
|
+
return import_obsidian133.Platform.isMacOS ? "cmd" : "ctrl";
|
|
34417
34498
|
}
|
|
34418
34499
|
case "Shift": {
|
|
34419
34500
|
return "shift";
|
|
@@ -34589,10 +34670,10 @@ var pdf_exports = {};
|
|
|
34589
34670
|
__export(pdf_exports, {
|
|
34590
34671
|
printToPdf: () => printToPdf
|
|
34591
34672
|
});
|
|
34592
|
-
var
|
|
34673
|
+
var import_obsidian134 = require("obsidian");
|
|
34593
34674
|
var ELECTRON_PRINT_TO_PDF_CHANNEL = "print-to-pdf";
|
|
34594
34675
|
async function printToPdf(element, options) {
|
|
34595
|
-
if (
|
|
34676
|
+
if (import_obsidian134.Platform.isMobile) {
|
|
34596
34677
|
throw new Error("Printing to PDF is not supported on mobile devices.");
|
|
34597
34678
|
}
|
|
34598
34679
|
const printDiv = activeDocument.body.createDiv("print");
|
|
@@ -34790,7 +34871,7 @@ __export(plugin_settings_tab_exports, {
|
|
|
34790
34871
|
PluginSettingsTabBase: () => PluginSettingsTabBase,
|
|
34791
34872
|
SAVE_TO_FILE_CONTEXT: () => SAVE_TO_FILE_CONTEXT
|
|
34792
34873
|
});
|
|
34793
|
-
var
|
|
34874
|
+
var import_obsidian152 = require("obsidian");
|
|
34794
34875
|
init_async_events();
|
|
34795
34876
|
init_function();
|
|
34796
34877
|
init_type_guards();
|
|
@@ -34825,7 +34906,7 @@ var text_based_component_exports = {};
|
|
|
34825
34906
|
__export(text_based_component_exports, {
|
|
34826
34907
|
getTextBasedComponentValue: () => getTextBasedComponentValue
|
|
34827
34908
|
});
|
|
34828
|
-
var
|
|
34909
|
+
var import_obsidian135 = require("obsidian");
|
|
34829
34910
|
var AbstractTextComponentWrapper = class {
|
|
34830
34911
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- `unknown` doesn't work, getting compiler errors.
|
|
34831
34912
|
constructor(abstractTextComponent) {
|
|
@@ -34847,7 +34928,7 @@ function getTextBasedComponentValue($unknown) {
|
|
|
34847
34928
|
if (isTextBasedComponent($unknown)) {
|
|
34848
34929
|
return $unknown;
|
|
34849
34930
|
}
|
|
34850
|
-
if ($unknown instanceof
|
|
34931
|
+
if ($unknown instanceof import_obsidian135.AbstractTextComponent) {
|
|
34851
34932
|
return new AbstractTextComponentWrapper($unknown);
|
|
34852
34933
|
}
|
|
34853
34934
|
return null;
|
|
@@ -34862,7 +34943,7 @@ var validator_component_exports = {};
|
|
|
34862
34943
|
__export(validator_component_exports, {
|
|
34863
34944
|
getValidatorComponent: () => getValidatorComponent
|
|
34864
34945
|
});
|
|
34865
|
-
var
|
|
34946
|
+
var import_obsidian136 = require("obsidian");
|
|
34866
34947
|
init_css_class();
|
|
34867
34948
|
init_plugin_context();
|
|
34868
34949
|
var OverlayValidatorComponent = class {
|
|
@@ -34923,28 +35004,28 @@ function getValidatorComponent($unknown) {
|
|
|
34923
35004
|
if (isValidatorComponent($unknown)) {
|
|
34924
35005
|
return $unknown;
|
|
34925
35006
|
}
|
|
34926
|
-
if ($unknown instanceof
|
|
35007
|
+
if ($unknown instanceof import_obsidian136.ColorComponent) {
|
|
34927
35008
|
return new ValidatorElementWrapper($unknown.colorPickerEl);
|
|
34928
35009
|
}
|
|
34929
|
-
if ($unknown instanceof
|
|
35010
|
+
if ($unknown instanceof import_obsidian136.DropdownComponent) {
|
|
34930
35011
|
return new ValidatorElementWrapper($unknown.selectEl);
|
|
34931
35012
|
}
|
|
34932
|
-
if ($unknown instanceof
|
|
35013
|
+
if ($unknown instanceof import_obsidian136.ProgressBarComponent) {
|
|
34933
35014
|
return new OverlayValidatorComponent($unknown.progressBar);
|
|
34934
35015
|
}
|
|
34935
|
-
if ($unknown instanceof
|
|
35016
|
+
if ($unknown instanceof import_obsidian136.SearchComponent) {
|
|
34936
35017
|
return new ValidatorElementWrapper($unknown.inputEl);
|
|
34937
35018
|
}
|
|
34938
|
-
if ($unknown instanceof
|
|
35019
|
+
if ($unknown instanceof import_obsidian136.SliderComponent) {
|
|
34939
35020
|
return new ValidatorElementWrapper($unknown.sliderEl);
|
|
34940
35021
|
}
|
|
34941
|
-
if ($unknown instanceof
|
|
35022
|
+
if ($unknown instanceof import_obsidian136.TextAreaComponent) {
|
|
34942
35023
|
return new ValidatorElementWrapper($unknown.inputEl);
|
|
34943
35024
|
}
|
|
34944
|
-
if ($unknown instanceof
|
|
35025
|
+
if ($unknown instanceof import_obsidian136.TextComponent) {
|
|
34945
35026
|
return new ValidatorElementWrapper($unknown.inputEl);
|
|
34946
35027
|
}
|
|
34947
|
-
if ($unknown instanceof
|
|
35028
|
+
if ($unknown instanceof import_obsidian136.ToggleComponent) {
|
|
34948
35029
|
return new OverlayValidatorComponent($unknown.toggleEl);
|
|
34949
35030
|
}
|
|
34950
35031
|
return null;
|
|
@@ -34959,17 +35040,17 @@ __export(setting_ex_exports, {
|
|
|
34959
35040
|
SettingEx: () => SettingEx,
|
|
34960
35041
|
adoptSettingEx: () => adoptSettingEx
|
|
34961
35042
|
});
|
|
34962
|
-
var
|
|
35043
|
+
var import_obsidian150 = require("obsidian");
|
|
34963
35044
|
|
|
34964
35045
|
// src/obsidian/setting-components/checkbox-component.ts
|
|
34965
35046
|
var checkbox_component_exports = {};
|
|
34966
35047
|
__export(checkbox_component_exports, {
|
|
34967
35048
|
CheckboxComponent: () => CheckboxComponent
|
|
34968
35049
|
});
|
|
34969
|
-
var
|
|
35050
|
+
var import_obsidian137 = require("obsidian");
|
|
34970
35051
|
init_css_class();
|
|
34971
35052
|
init_plugin_context();
|
|
34972
|
-
var CheckboxComponent = class extends
|
|
35053
|
+
var CheckboxComponent = class extends import_obsidian137.ValueComponent {
|
|
34973
35054
|
/**
|
|
34974
35055
|
* An input element of the checkbox.
|
|
34975
35056
|
*/
|
|
@@ -35046,11 +35127,11 @@ var code_highlighter_component_exports = {};
|
|
|
35046
35127
|
__export(code_highlighter_component_exports, {
|
|
35047
35128
|
CodeHighlighterComponent: () => CodeHighlighterComponent
|
|
35048
35129
|
});
|
|
35049
|
-
var
|
|
35130
|
+
var import_obsidian138 = require("obsidian");
|
|
35050
35131
|
init_array();
|
|
35051
35132
|
init_css_class();
|
|
35052
35133
|
init_plugin_context();
|
|
35053
|
-
var CodeHighlighterComponent = class extends
|
|
35134
|
+
var CodeHighlighterComponent = class extends import_obsidian138.ValueComponent {
|
|
35054
35135
|
/**
|
|
35055
35136
|
* An input element of the component.
|
|
35056
35137
|
*
|
|
@@ -35092,7 +35173,7 @@ var CodeHighlighterComponent = class extends import_obsidian137.ValueComponent {
|
|
|
35092
35173
|
addPluginCssClasses(containerEl, "code-highlighter-component" /* CodeHighlighterComponent */);
|
|
35093
35174
|
const wrapper = containerEl.createDiv();
|
|
35094
35175
|
addPluginCssClasses(wrapper, "setting-component-wrapper" /* SettingComponentWrapper */);
|
|
35095
|
-
this.textAreaComponent = new
|
|
35176
|
+
this.textAreaComponent = new import_obsidian138.TextAreaComponent(wrapper);
|
|
35096
35177
|
this.preEl = wrapper.createEl("pre", {
|
|
35097
35178
|
attr: {
|
|
35098
35179
|
tabIndex: "-1"
|
|
@@ -35285,7 +35366,7 @@ var date_component_exports = {};
|
|
|
35285
35366
|
__export(date_component_exports, {
|
|
35286
35367
|
DateComponent: () => DateComponent
|
|
35287
35368
|
});
|
|
35288
|
-
var
|
|
35369
|
+
var import_obsidian140 = require("obsidian");
|
|
35289
35370
|
init_css_class();
|
|
35290
35371
|
|
|
35291
35372
|
// src/obsidian/setting-components/typed-range-text-component.ts
|
|
@@ -35299,10 +35380,10 @@ var typed_text_component_exports = {};
|
|
|
35299
35380
|
__export(typed_text_component_exports, {
|
|
35300
35381
|
TypedTextComponent: () => TypedTextComponent
|
|
35301
35382
|
});
|
|
35302
|
-
var
|
|
35383
|
+
var import_obsidian139 = require("obsidian");
|
|
35303
35384
|
init_css_class();
|
|
35304
35385
|
init_plugin_context();
|
|
35305
|
-
var TypedTextComponent = class extends
|
|
35386
|
+
var TypedTextComponent = class extends import_obsidian139.ValueComponent {
|
|
35306
35387
|
/**
|
|
35307
35388
|
* An input element of the component.
|
|
35308
35389
|
*/
|
|
@@ -35326,7 +35407,7 @@ var TypedTextComponent = class extends import_obsidian138.ValueComponent {
|
|
|
35326
35407
|
*/
|
|
35327
35408
|
constructor(params) {
|
|
35328
35409
|
super();
|
|
35329
|
-
this.textComponent = new
|
|
35410
|
+
this.textComponent = new import_obsidian139.TextComponent(params.containerEl);
|
|
35330
35411
|
this.inputEl = this.textComponent.inputEl;
|
|
35331
35412
|
this.inputEl.type = params.type;
|
|
35332
35413
|
addPluginCssClasses(params.containerEl, params.cssClass);
|
|
@@ -35425,7 +35506,7 @@ var TypedRangeTextComponent = class extends TypedTextComponent {
|
|
|
35425
35506
|
};
|
|
35426
35507
|
|
|
35427
35508
|
// src/obsidian/setting-components/date-component.ts
|
|
35428
|
-
var moment2 = extractDefaultExportInterop(
|
|
35509
|
+
var moment2 = extractDefaultExportInterop(import_obsidian140.moment);
|
|
35429
35510
|
var DATE_FORMAT = "YYYY-MM-DD";
|
|
35430
35511
|
var DateComponent = class extends TypedRangeTextComponent {
|
|
35431
35512
|
/**
|
|
@@ -35465,9 +35546,9 @@ var date_time_component_exports = {};
|
|
|
35465
35546
|
__export(date_time_component_exports, {
|
|
35466
35547
|
DateTimeComponent: () => DateTimeComponent
|
|
35467
35548
|
});
|
|
35468
|
-
var
|
|
35549
|
+
var import_obsidian141 = require("obsidian");
|
|
35469
35550
|
init_css_class();
|
|
35470
|
-
var moment3 = extractDefaultExportInterop(
|
|
35551
|
+
var moment3 = extractDefaultExportInterop(import_obsidian141.moment);
|
|
35471
35552
|
var DATE_TIME_FORMAT = "YYYY-MM-DDTHH:mm";
|
|
35472
35553
|
var DateTimeComponent = class extends TypedRangeTextComponent {
|
|
35473
35554
|
/**
|
|
@@ -35607,9 +35688,9 @@ var month_component_exports = {};
|
|
|
35607
35688
|
__export(month_component_exports, {
|
|
35608
35689
|
MonthComponent: () => MonthComponent
|
|
35609
35690
|
});
|
|
35610
|
-
var
|
|
35691
|
+
var import_obsidian142 = require("obsidian");
|
|
35611
35692
|
init_css_class();
|
|
35612
|
-
var moment4 = extractDefaultExportInterop(
|
|
35693
|
+
var moment4 = extractDefaultExportInterop(import_obsidian142.moment);
|
|
35613
35694
|
var DATE_FORMAT2 = "YYYY-MM";
|
|
35614
35695
|
var MonthComponent = class extends TypedRangeTextComponent {
|
|
35615
35696
|
/**
|
|
@@ -35657,10 +35738,10 @@ var multiple_dropdown_component_exports = {};
|
|
|
35657
35738
|
__export(multiple_dropdown_component_exports, {
|
|
35658
35739
|
MultipleDropdownComponent: () => MultipleDropdownComponent
|
|
35659
35740
|
});
|
|
35660
|
-
var
|
|
35741
|
+
var import_obsidian143 = require("obsidian");
|
|
35661
35742
|
init_css_class();
|
|
35662
35743
|
init_plugin_context();
|
|
35663
|
-
var MultipleDropdownComponent = class extends
|
|
35744
|
+
var MultipleDropdownComponent = class extends import_obsidian143.ValueComponent {
|
|
35664
35745
|
/**
|
|
35665
35746
|
* A select element of the component.
|
|
35666
35747
|
*
|
|
@@ -35689,7 +35770,7 @@ var MultipleDropdownComponent = class extends import_obsidian142.ValueComponent
|
|
|
35689
35770
|
*/
|
|
35690
35771
|
constructor(containerEl) {
|
|
35691
35772
|
super();
|
|
35692
|
-
this.dropdownComponent = new
|
|
35773
|
+
this.dropdownComponent = new import_obsidian143.DropdownComponent(containerEl);
|
|
35693
35774
|
this.dropdownComponent.selectEl.multiple = true;
|
|
35694
35775
|
addPluginCssClasses(containerEl, "multiple-dropdown-component" /* MultipleDropdownComponent */);
|
|
35695
35776
|
}
|
|
@@ -35862,10 +35943,10 @@ var multiple_text_component_exports = {};
|
|
|
35862
35943
|
__export(multiple_text_component_exports, {
|
|
35863
35944
|
MultipleTextComponent: () => MultipleTextComponent
|
|
35864
35945
|
});
|
|
35865
|
-
var
|
|
35946
|
+
var import_obsidian144 = require("obsidian");
|
|
35866
35947
|
init_css_class();
|
|
35867
35948
|
init_plugin_context();
|
|
35868
|
-
var MultipleTextComponent = class extends
|
|
35949
|
+
var MultipleTextComponent = class extends import_obsidian144.ValueComponent {
|
|
35869
35950
|
/**
|
|
35870
35951
|
* An input element of the component.
|
|
35871
35952
|
*
|
|
@@ -35894,7 +35975,7 @@ var MultipleTextComponent = class extends import_obsidian143.ValueComponent {
|
|
|
35894
35975
|
*/
|
|
35895
35976
|
constructor(containerEl) {
|
|
35896
35977
|
super();
|
|
35897
|
-
this.textAreaComponent = new
|
|
35978
|
+
this.textAreaComponent = new import_obsidian144.TextAreaComponent(containerEl);
|
|
35898
35979
|
addPluginCssClasses(containerEl, "multiple-text-component" /* MultipleTextComponent */);
|
|
35899
35980
|
}
|
|
35900
35981
|
/**
|
|
@@ -36156,7 +36237,7 @@ var time_component_exports = {};
|
|
|
36156
36237
|
__export(time_component_exports, {
|
|
36157
36238
|
TimeComponent: () => TimeComponent
|
|
36158
36239
|
});
|
|
36159
|
-
var
|
|
36240
|
+
var import_obsidian145 = require("obsidian");
|
|
36160
36241
|
init_css_class();
|
|
36161
36242
|
var TimeComponent = class extends TypedRangeTextComponent {
|
|
36162
36243
|
/**
|
|
@@ -36178,7 +36259,7 @@ var TimeComponent = class extends TypedRangeTextComponent {
|
|
|
36178
36259
|
* @returns The date.
|
|
36179
36260
|
*/
|
|
36180
36261
|
valueFromString($string) {
|
|
36181
|
-
return
|
|
36262
|
+
return import_obsidian145.moment.duration($string);
|
|
36182
36263
|
}
|
|
36183
36264
|
/**
|
|
36184
36265
|
* Converts a time to a string.
|
|
@@ -36195,7 +36276,7 @@ var TimeComponent = class extends TypedRangeTextComponent {
|
|
|
36195
36276
|
} else {
|
|
36196
36277
|
format2 = "HH:mm";
|
|
36197
36278
|
}
|
|
36198
|
-
return
|
|
36279
|
+
return import_obsidian145.moment.utc(value.asMilliseconds()).format(format2);
|
|
36199
36280
|
}
|
|
36200
36281
|
};
|
|
36201
36282
|
|
|
@@ -36204,10 +36285,10 @@ var tri_state_checkbox_component_exports = {};
|
|
|
36204
36285
|
__export(tri_state_checkbox_component_exports, {
|
|
36205
36286
|
TriStateCheckboxComponent: () => TriStateCheckboxComponent
|
|
36206
36287
|
});
|
|
36207
|
-
var
|
|
36288
|
+
var import_obsidian146 = require("obsidian");
|
|
36208
36289
|
init_css_class();
|
|
36209
36290
|
init_plugin_context();
|
|
36210
|
-
var TriStateCheckboxComponent = class extends
|
|
36291
|
+
var TriStateCheckboxComponent = class extends import_obsidian146.ValueComponent {
|
|
36211
36292
|
/**
|
|
36212
36293
|
* An input element of the checkbox.
|
|
36213
36294
|
*/
|
|
@@ -36285,10 +36366,10 @@ var typed_dropdown_component_exports = {};
|
|
|
36285
36366
|
__export(typed_dropdown_component_exports, {
|
|
36286
36367
|
TypedDropdownComponent: () => TypedDropdownComponent
|
|
36287
36368
|
});
|
|
36288
|
-
var
|
|
36369
|
+
var import_obsidian147 = require("obsidian");
|
|
36289
36370
|
init_css_class();
|
|
36290
36371
|
init_plugin_context();
|
|
36291
|
-
var TypedDropdownComponent = class extends
|
|
36372
|
+
var TypedDropdownComponent = class extends import_obsidian147.ValueComponent {
|
|
36292
36373
|
/**
|
|
36293
36374
|
* A select element of the component.
|
|
36294
36375
|
*
|
|
@@ -36321,7 +36402,7 @@ var TypedDropdownComponent = class extends import_obsidian146.ValueComponent {
|
|
|
36321
36402
|
*/
|
|
36322
36403
|
constructor(containerEl) {
|
|
36323
36404
|
super();
|
|
36324
|
-
this.dropdownComponent = new
|
|
36405
|
+
this.dropdownComponent = new import_obsidian147.DropdownComponent(containerEl);
|
|
36325
36406
|
addPluginCssClasses(containerEl, "typed-dropdown-component" /* TypedDropdownComponent */);
|
|
36326
36407
|
}
|
|
36327
36408
|
/**
|
|
@@ -36411,10 +36492,10 @@ var typed_multiple_dropdown_component_exports = {};
|
|
|
36411
36492
|
__export(typed_multiple_dropdown_component_exports, {
|
|
36412
36493
|
TypedMultipleDropdownComponent: () => TypedMultipleDropdownComponent
|
|
36413
36494
|
});
|
|
36414
|
-
var
|
|
36495
|
+
var import_obsidian148 = require("obsidian");
|
|
36415
36496
|
init_css_class();
|
|
36416
36497
|
init_plugin_context();
|
|
36417
|
-
var TypedMultipleDropdownComponent = class extends
|
|
36498
|
+
var TypedMultipleDropdownComponent = class extends import_obsidian148.ValueComponent {
|
|
36418
36499
|
/**
|
|
36419
36500
|
* A select element of the component.
|
|
36420
36501
|
*
|
|
@@ -36592,9 +36673,9 @@ var week_component_exports = {};
|
|
|
36592
36673
|
__export(week_component_exports, {
|
|
36593
36674
|
WeekComponent: () => WeekComponent
|
|
36594
36675
|
});
|
|
36595
|
-
var
|
|
36676
|
+
var import_obsidian149 = require("obsidian");
|
|
36596
36677
|
init_css_class();
|
|
36597
|
-
var moment6 = extractDefaultExportInterop(
|
|
36678
|
+
var moment6 = extractDefaultExportInterop(import_obsidian149.moment);
|
|
36598
36679
|
var DATE_FORMAT3 = "YYYY-[W]WW";
|
|
36599
36680
|
var WeekComponent = class extends TypedRangeTextComponent {
|
|
36600
36681
|
/**
|
|
@@ -36638,7 +36719,7 @@ var WeekComponent = class extends TypedRangeTextComponent {
|
|
|
36638
36719
|
};
|
|
36639
36720
|
|
|
36640
36721
|
// src/obsidian/setting-ex.ts
|
|
36641
|
-
var SettingEx = class extends
|
|
36722
|
+
var SettingEx = class extends import_obsidian150.Setting {
|
|
36642
36723
|
/**
|
|
36643
36724
|
* Adds a {@link CheckboxComponent} to the setting.
|
|
36644
36725
|
*
|
|
@@ -36855,7 +36936,7 @@ __export(validation_exports, {
|
|
|
36855
36936
|
getOsUnsafePathCharsRegExp: () => getOsUnsafePathCharsRegExp,
|
|
36856
36937
|
isValidationMessageHolder: () => isValidationMessageHolder
|
|
36857
36938
|
});
|
|
36858
|
-
var
|
|
36939
|
+
var import_obsidian151 = require("obsidian");
|
|
36859
36940
|
init_reg_exp();
|
|
36860
36941
|
function isValidationMessageHolder(value) {
|
|
36861
36942
|
return value.validationMessage !== void 0;
|
|
@@ -36870,7 +36951,7 @@ function getOsAndObsidianUnsafePathCharsRegExp(isWindows) {
|
|
|
36870
36951
|
]);
|
|
36871
36952
|
}
|
|
36872
36953
|
function getOsUnsafePathCharsRegExp(isWindows) {
|
|
36873
|
-
isWindows ??=
|
|
36954
|
+
isWindows ??= import_obsidian151.Platform.isWin;
|
|
36874
36955
|
return isWindows ? WINDOWS_UNSAFE_PATH_CHARS : UNIX_UNSAFE_PATH_CHARS;
|
|
36875
36956
|
}
|
|
36876
36957
|
|
|
@@ -36898,7 +36979,7 @@ var PluginSettingsTabEventsComponent = class extends ComponentEx {
|
|
|
36898
36979
|
registerAsyncEvent(this, pluginSettingsComponent.on("saveSettings", (newState, oldState, context) => this.params.onSaveSettings(newState, oldState, context)));
|
|
36899
36980
|
}
|
|
36900
36981
|
};
|
|
36901
|
-
var PluginSettingsTabBase = class extends mixinAsyncEvents()(
|
|
36982
|
+
var PluginSettingsTabBase = class extends mixinAsyncEvents()(import_obsidian152.PluginSettingTab) {
|
|
36902
36983
|
/**
|
|
36903
36984
|
* Whether the plugin settings tab is open.
|
|
36904
36985
|
*
|
|
@@ -36936,7 +37017,7 @@ var PluginSettingsTabBase = class extends mixinAsyncEvents()(import_obsidian151.
|
|
|
36936
37017
|
super(params.plugin.app, params.plugin);
|
|
36937
37018
|
this.pluginSettingsComponent = params.pluginSettingsComponent;
|
|
36938
37019
|
addPluginCssClasses(this.containerEl, "plugin-settings-tab" /* PluginSettingsTab */);
|
|
36939
|
-
this.saveSettingsDebounced = (0,
|
|
37020
|
+
this.saveSettingsDebounced = (0, import_obsidian152.debounce)(
|
|
36940
37021
|
convertAsyncToSync(() => this.pluginSettingsComponent.saveToFile(SAVE_TO_FILE_CONTEXT)),
|
|
36941
37022
|
this.saveSettingsDebounceTimeoutInMilliseconds
|
|
36942
37023
|
);
|
|
@@ -37009,7 +37090,7 @@ var PluginSettingsTabBase = class extends mixinAsyncEvents()(import_obsidian151.
|
|
|
37009
37090
|
}
|
|
37010
37091
|
let shouldSkipOnChange = false;
|
|
37011
37092
|
const UPDATE_VALIDATOR_EL_TIMEOUT_IN_MILLISECONDS = 100;
|
|
37012
|
-
const updateValidatorElementDebounced = (0,
|
|
37093
|
+
const updateValidatorElementDebounced = (0, import_obsidian152.debounce)(() => {
|
|
37013
37094
|
window.requestAnimationFrame(() => {
|
|
37014
37095
|
updateValidatorEl();
|
|
37015
37096
|
});
|
|
@@ -37092,7 +37173,7 @@ var PluginSettingsTabBase = class extends mixinAsyncEvents()(import_obsidian151.
|
|
|
37092
37173
|
tooltipContentEl.textContent = validationMessage;
|
|
37093
37174
|
tooltipEl?.toggle(!!validationMessage);
|
|
37094
37175
|
} else if (validationMessage) {
|
|
37095
|
-
(0,
|
|
37176
|
+
(0, import_obsidian152.setTooltip)(validatorEl, validationMessage);
|
|
37096
37177
|
}
|
|
37097
37178
|
}
|
|
37098
37179
|
}
|
|
@@ -37336,12 +37417,12 @@ __export(plugin_exports, {
|
|
|
37336
37417
|
reloadPlugin: () => reloadPlugin,
|
|
37337
37418
|
showErrorAndDisablePlugin: () => showErrorAndDisablePlugin
|
|
37338
37419
|
});
|
|
37339
|
-
var
|
|
37420
|
+
var import_obsidian153 = require("obsidian");
|
|
37340
37421
|
init_async_events();
|
|
37341
37422
|
init_error();
|
|
37342
37423
|
init_function();
|
|
37343
37424
|
init_type_guards();
|
|
37344
|
-
var PluginBase = class extends mixinAsyncEvents()(
|
|
37425
|
+
var PluginBase = class extends mixinAsyncEvents()(import_obsidian153.Plugin) {
|
|
37345
37426
|
/**
|
|
37346
37427
|
* Gets abort signal component.
|
|
37347
37428
|
*
|
|
@@ -37614,7 +37695,7 @@ var plugin_cli_handler_registrar_exports = {};
|
|
|
37614
37695
|
__export(plugin_cli_handler_registrar_exports, {
|
|
37615
37696
|
PluginCliHandlerRegistrar: () => PluginCliHandlerRegistrar
|
|
37616
37697
|
});
|
|
37617
|
-
var
|
|
37698
|
+
var import_obsidian154 = require("obsidian");
|
|
37618
37699
|
var PluginCliHandlerRegistrar = class {
|
|
37619
37700
|
/**
|
|
37620
37701
|
* Creates a new instance of the {@link PluginCliHandlerRegistrar} class.
|
|
@@ -37648,7 +37729,7 @@ var field_popover_exports = {};
|
|
|
37648
37729
|
__export(field_popover_exports, {
|
|
37649
37730
|
editFieldsInPopover: () => editFieldsInPopover
|
|
37650
37731
|
});
|
|
37651
|
-
var
|
|
37732
|
+
var import_obsidian156 = require("obsidian");
|
|
37652
37733
|
init_css_class();
|
|
37653
37734
|
|
|
37654
37735
|
// src/obsidian/popovers/popover.ts
|
|
@@ -37656,7 +37737,7 @@ var popover_exports = {};
|
|
|
37656
37737
|
__export(popover_exports, {
|
|
37657
37738
|
showPopover: () => showPopover
|
|
37658
37739
|
});
|
|
37659
|
-
var
|
|
37740
|
+
var import_obsidian155 = require("obsidian");
|
|
37660
37741
|
init_css_class();
|
|
37661
37742
|
init_plugin_context();
|
|
37662
37743
|
var ANCHOR_GAP_IN_PIXELS = 4;
|
|
@@ -37712,7 +37793,7 @@ async function showPopover(params) {
|
|
|
37712
37793
|
handleCancel();
|
|
37713
37794
|
}
|
|
37714
37795
|
});
|
|
37715
|
-
const buttonsSetting = new
|
|
37796
|
+
const buttonsSetting = new import_obsidian155.Setting(popoverEl);
|
|
37716
37797
|
buttonsSetting.addButton((button) => {
|
|
37717
37798
|
button.setButtonText(okButtonText ?? t2(($) => $.obsidianDevUtils.buttons.ok)).setCta().setClass("ok-button" /* OkButton */).onClick(handleOk);
|
|
37718
37799
|
});
|
|
@@ -37771,8 +37852,8 @@ async function editFieldsInPopover(params) {
|
|
|
37771
37852
|
}));
|
|
37772
37853
|
}
|
|
37773
37854
|
function addField(containerEl, field) {
|
|
37774
|
-
const setting = new
|
|
37775
|
-
const textComponent = new
|
|
37855
|
+
const setting = new import_obsidian156.Setting(containerEl).setName(field.name);
|
|
37856
|
+
const textComponent = new import_obsidian156.TextComponent(setting.controlEl);
|
|
37776
37857
|
textComponent.setValue(field.defaultValue ?? "");
|
|
37777
37858
|
textComponent.setPlaceholder(field.placeholder ?? "");
|
|
37778
37859
|
textComponent.inputEl.addClass("text-box" /* TextBox */);
|
|
@@ -37791,7 +37872,7 @@ __export(app_context_exports, {
|
|
|
37791
37872
|
AppContext: () => AppContext,
|
|
37792
37873
|
useApp: () => useApp
|
|
37793
37874
|
});
|
|
37794
|
-
var
|
|
37875
|
+
var import_obsidian157 = require("obsidian");
|
|
37795
37876
|
var import_react = __toESM(require_react(), 1);
|
|
37796
37877
|
init_type_guards();
|
|
37797
37878
|
var AppContext = (0, import_react.createContext)(void 0);
|
|
@@ -37804,7 +37885,7 @@ var ribbon_icon_registrar_exports = {};
|
|
|
37804
37885
|
__export(ribbon_icon_registrar_exports, {
|
|
37805
37886
|
PluginRibbonIconRegistrar: () => PluginRibbonIconRegistrar
|
|
37806
37887
|
});
|
|
37807
|
-
var
|
|
37888
|
+
var import_obsidian158 = require("obsidian");
|
|
37808
37889
|
var PluginRibbonIconRegistrar = class {
|
|
37809
37890
|
/**
|
|
37810
37891
|
* Creates a new instance of the {@link PluginRibbonIconRegistrar} class.
|
|
@@ -37865,8 +37946,8 @@ var setting_group_ex_exports = {};
|
|
|
37865
37946
|
__export(setting_group_ex_exports, {
|
|
37866
37947
|
SettingGroupEx: () => SettingGroupEx
|
|
37867
37948
|
});
|
|
37868
|
-
var
|
|
37869
|
-
var SettingGroupEx = class extends
|
|
37949
|
+
var import_obsidian159 = require("obsidian");
|
|
37950
|
+
var SettingGroupEx = class extends import_obsidian159.SettingGroup {
|
|
37870
37951
|
/**
|
|
37871
37952
|
* Creates a new setting group.
|
|
37872
37953
|
*
|
|
@@ -37893,7 +37974,7 @@ var status_bar_item_registrar_exports = {};
|
|
|
37893
37974
|
__export(status_bar_item_registrar_exports, {
|
|
37894
37975
|
PluginStatusBarItemRegistrar: () => PluginStatusBarItemRegistrar
|
|
37895
37976
|
});
|
|
37896
|
-
var
|
|
37977
|
+
var import_obsidian160 = require("obsidian");
|
|
37897
37978
|
var PluginStatusBarItemRegistrar = class {
|
|
37898
37979
|
/**
|
|
37899
37980
|
* Creates a new instance of the {@link PluginStatusBarItemRegistrar} class.
|
|
@@ -38168,7 +38249,7 @@ var view_registrar_exports = {};
|
|
|
38168
38249
|
__export(view_registrar_exports, {
|
|
38169
38250
|
PluginViewRegistrar: () => PluginViewRegistrar
|
|
38170
38251
|
});
|
|
38171
|
-
var
|
|
38252
|
+
var import_obsidian161 = require("obsidian");
|
|
38172
38253
|
var PluginViewRegistrar = class {
|
|
38173
38254
|
/**
|
|
38174
38255
|
* Creates a new instance of the {@link PluginViewRegistrar} class.
|
|
@@ -38905,8 +38986,8 @@ init_value_provider();
|
|
|
38905
38986
|
init_value_wrapper();
|
|
38906
38987
|
|
|
38907
38988
|
// integration-test-plugin/main.ts
|
|
38908
|
-
var
|
|
38909
|
-
var IntegrationTestPlugin = class extends
|
|
38989
|
+
var import_obsidian162 = require("obsidian");
|
|
38990
|
+
var IntegrationTestPlugin = class extends import_obsidian162.Plugin {
|
|
38910
38991
|
onload() {
|
|
38911
38992
|
window.__obsidianDevUtilsModule = src_exports;
|
|
38912
38993
|
}
|