obsidian-dev-utils 91.0.1 → 92.1.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 +12 -0
- package/dist/demo-vault-helper/main.js +65 -2
- package/dist/integration-test-plugin/main.js +171 -102
- package/dist/lib/cjs/generated-during-build.cjs +1 -1
- package/dist/lib/cjs/obsidian/components/monkey-around-component.cjs +1 -1
- package/dist/lib/cjs/obsidian/components/monkey-around-component.d.cts +5 -0
- 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/vault.cjs +1 -1
- package/dist/lib/cjs/obsidian/vault.d.cts +3 -0
- 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/cjs/script-utils/linters/eslint-rules/no-async-callback-to-unsafe-return.cjs +1 -1
- package/dist/lib/cjs/script-utils/linters/eslint-rules/no-async-callback-to-unsafe-return.d.cts +3 -0
- package/dist/lib/cjs/script-utils/linters/eslint-rules/no-unused-params-members.cjs +1 -1
- package/dist/lib/cjs/script-utils/linters/eslint-rules/no-unused-params-members.d.cts +3 -0
- package/dist/lib/cjs/script-utils/linters/eslint-rules/no-used-underscore-variables.cjs +1 -1
- package/dist/lib/cjs/script-utils/linters/eslint-rules/no-used-underscore-variables.d.cts +3 -0
- package/dist/lib/cjs/script-utils/linters/eslint-rules/obsidian-dev-utils-plugin.cjs +1 -1
- package/dist/lib/cjs/script-utils/linters/eslint-rules/obsidian-dev-utils-plugin.d.cts +3 -0
- package/dist/lib/cjs/script-utils/linters/eslint-rules/params-options-name-match.cjs +1 -1
- package/dist/lib/cjs/script-utils/linters/eslint-rules/params-options-name-match.d.cts +3 -0
- package/dist/lib/cjs/script-utils/linters/eslint-rules/prefer-noop-async.cjs +1 -1
- package/dist/lib/cjs/script-utils/linters/eslint-rules/prefer-noop-async.d.cts +3 -0
- package/dist/lib/cjs/script-utils/linters/eslint-rules/readonly-params-options-result-members.cjs +1 -1
- package/dist/lib/cjs/script-utils/linters/eslint-rules/readonly-params-options-result-members.d.cts +3 -0
- package/dist/lib/cjs/script-utils/linters/eslint-rules/require-component-suffix.cjs +1 -1
- package/dist/lib/cjs/script-utils/linters/eslint-rules/require-component-suffix.d.cts +3 -0
- package/dist/lib/cjs/script-utils/linters/eslint-rules/require-method-template.cjs +1 -1
- package/dist/lib/cjs/script-utils/linters/eslint-rules/require-method-template.d.cts +3 -0
- package/dist/lib/cjs/script-utils/linters/eslint-rules/require-super-call.cjs +1 -1
- package/dist/lib/cjs/script-utils/linters/eslint-rules/require-super-call.d.cts +3 -0
- package/dist/lib/cjs/script-utils/linters/over-exposure.cjs +1 -1
- package/dist/lib/cjs/script-utils/linters/over-exposure.d.cts +12 -0
- package/dist/lib/esm/generated-during-build.mjs +1 -1
- package/dist/lib/esm/obsidian/components/monkey-around-component.d.mts +5 -0
- package/dist/lib/esm/obsidian/components/monkey-around-component.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/vault.d.mts +3 -0
- package/dist/lib/esm/obsidian/vault.mjs +1 -1
- 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/dist/lib/esm/script-utils/linters/eslint-rules/no-async-callback-to-unsafe-return.d.mts +3 -0
- package/dist/lib/esm/script-utils/linters/eslint-rules/no-async-callback-to-unsafe-return.mjs +1 -1
- package/dist/lib/esm/script-utils/linters/eslint-rules/no-unused-params-members.d.mts +3 -0
- package/dist/lib/esm/script-utils/linters/eslint-rules/no-unused-params-members.mjs +1 -1
- package/dist/lib/esm/script-utils/linters/eslint-rules/no-used-underscore-variables.d.mts +3 -0
- package/dist/lib/esm/script-utils/linters/eslint-rules/no-used-underscore-variables.mjs +1 -1
- package/dist/lib/esm/script-utils/linters/eslint-rules/obsidian-dev-utils-plugin.d.mts +3 -0
- package/dist/lib/esm/script-utils/linters/eslint-rules/obsidian-dev-utils-plugin.mjs +1 -1
- package/dist/lib/esm/script-utils/linters/eslint-rules/params-options-name-match.d.mts +3 -0
- package/dist/lib/esm/script-utils/linters/eslint-rules/params-options-name-match.mjs +1 -1
- package/dist/lib/esm/script-utils/linters/eslint-rules/prefer-noop-async.d.mts +3 -0
- package/dist/lib/esm/script-utils/linters/eslint-rules/prefer-noop-async.mjs +1 -1
- package/dist/lib/esm/script-utils/linters/eslint-rules/readonly-params-options-result-members.d.mts +3 -0
- package/dist/lib/esm/script-utils/linters/eslint-rules/readonly-params-options-result-members.mjs +1 -1
- package/dist/lib/esm/script-utils/linters/eslint-rules/require-component-suffix.d.mts +3 -0
- package/dist/lib/esm/script-utils/linters/eslint-rules/require-component-suffix.mjs +1 -1
- package/dist/lib/esm/script-utils/linters/eslint-rules/require-method-template.d.mts +3 -0
- package/dist/lib/esm/script-utils/linters/eslint-rules/require-method-template.mjs +1 -1
- package/dist/lib/esm/script-utils/linters/eslint-rules/require-super-call.d.mts +3 -0
- package/dist/lib/esm/script-utils/linters/eslint-rules/require-super-call.mjs +1 -1
- package/dist/lib/esm/script-utils/linters/over-exposure.d.mts +12 -0
- package/dist/lib/esm/script-utils/linters/over-exposure.mjs +1 -1
- package/package.json +2 -2
|
@@ -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,7 +34215,7 @@ 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();
|
|
@@ -34174,7 +34243,7 @@ var PromptModal = class extends ModalBase {
|
|
|
34174
34243
|
}
|
|
34175
34244
|
onOpen() {
|
|
34176
34245
|
this.titleEl.setText(this.title);
|
|
34177
|
-
const textComponent = new
|
|
34246
|
+
const textComponent = new import_obsidian131.TextComponent(this.contentEl);
|
|
34178
34247
|
const inputEl = textComponent.inputEl;
|
|
34179
34248
|
const validate = async (shouldReport) => {
|
|
34180
34249
|
const errorMessage = await this.valueValidator(inputEl.value);
|
|
@@ -34207,14 +34276,14 @@ var PromptModal = class extends ModalBase {
|
|
|
34207
34276
|
inputEl.addEventListener("input", convertAsyncToSync(handleInput));
|
|
34208
34277
|
inputEl.addEventListener("focus", convertAsyncToSync(handleFocus));
|
|
34209
34278
|
invokeAsyncSafely(() => validate(false));
|
|
34210
|
-
const okButton = new
|
|
34279
|
+
const okButton = new import_obsidian131.ButtonComponent(this.contentEl);
|
|
34211
34280
|
okButton.setButtonText(this.okButtonText);
|
|
34212
34281
|
okButton.setCta();
|
|
34213
34282
|
okButton.onClick((event) => {
|
|
34214
34283
|
this.handleOk(event, textComponent);
|
|
34215
34284
|
});
|
|
34216
34285
|
okButton.setClass("ok-button" /* OkButton */);
|
|
34217
|
-
const cancelButton = new
|
|
34286
|
+
const cancelButton = new import_obsidian131.ButtonComponent(this.contentEl);
|
|
34218
34287
|
cancelButton.setButtonText(this.cancelButtonText);
|
|
34219
34288
|
cancelButton.onClick(this.close.bind(this));
|
|
34220
34289
|
cancelButton.setClass("cancel-button" /* CancelButton */);
|
|
@@ -34244,11 +34313,11 @@ var select_item_exports = {};
|
|
|
34244
34313
|
__export(select_item_exports, {
|
|
34245
34314
|
selectItem: () => selectItem
|
|
34246
34315
|
});
|
|
34247
|
-
var
|
|
34316
|
+
var import_obsidian132 = require("obsidian");
|
|
34248
34317
|
init_css_class();
|
|
34249
34318
|
init_plugin_context();
|
|
34250
34319
|
init_modal();
|
|
34251
|
-
var ItemSelectModal = class extends
|
|
34320
|
+
var ItemSelectModal = class extends import_obsidian132.FuzzySuggestModal {
|
|
34252
34321
|
isSelected = false;
|
|
34253
34322
|
items;
|
|
34254
34323
|
itemTextFunction;
|
|
@@ -34300,7 +34369,7 @@ var suggest_modal_command_builder_exports = {};
|
|
|
34300
34369
|
__export(suggest_modal_command_builder_exports, {
|
|
34301
34370
|
SuggestModalCommandBuilder: () => SuggestModalCommandBuilder
|
|
34302
34371
|
});
|
|
34303
|
-
var
|
|
34372
|
+
var import_obsidian133 = require("obsidian");
|
|
34304
34373
|
var KEYS_MAP = /* @__PURE__ */ new Map([
|
|
34305
34374
|
["Enter", "\u21B5"],
|
|
34306
34375
|
["UpDown", "\u2191\u2193"]
|
|
@@ -34347,7 +34416,7 @@ var SuggestModalCommandBuilder = class {
|
|
|
34347
34416
|
command: this.buildCommand(command),
|
|
34348
34417
|
init: (purposeEl, scope) => {
|
|
34349
34418
|
purposeEl.appendText(" ");
|
|
34350
|
-
const dropdownComponent = new
|
|
34419
|
+
const dropdownComponent = new import_obsidian133.DropdownComponent(purposeEl);
|
|
34351
34420
|
command.onInit(dropdownComponent);
|
|
34352
34421
|
dropdownComponent.onChange((value) => {
|
|
34353
34422
|
command.onChange(value);
|
|
@@ -34422,10 +34491,10 @@ var SuggestModalCommandBuilder = class {
|
|
|
34422
34491
|
return "ctrl";
|
|
34423
34492
|
}
|
|
34424
34493
|
case "Meta": {
|
|
34425
|
-
return
|
|
34494
|
+
return import_obsidian133.Platform.isMacOS ? "cmd" : "win";
|
|
34426
34495
|
}
|
|
34427
34496
|
case "Mod": {
|
|
34428
|
-
return
|
|
34497
|
+
return import_obsidian133.Platform.isMacOS ? "cmd" : "ctrl";
|
|
34429
34498
|
}
|
|
34430
34499
|
case "Shift": {
|
|
34431
34500
|
return "shift";
|
|
@@ -34601,10 +34670,10 @@ var pdf_exports = {};
|
|
|
34601
34670
|
__export(pdf_exports, {
|
|
34602
34671
|
printToPdf: () => printToPdf
|
|
34603
34672
|
});
|
|
34604
|
-
var
|
|
34673
|
+
var import_obsidian134 = require("obsidian");
|
|
34605
34674
|
var ELECTRON_PRINT_TO_PDF_CHANNEL = "print-to-pdf";
|
|
34606
34675
|
async function printToPdf(element, options) {
|
|
34607
|
-
if (
|
|
34676
|
+
if (import_obsidian134.Platform.isMobile) {
|
|
34608
34677
|
throw new Error("Printing to PDF is not supported on mobile devices.");
|
|
34609
34678
|
}
|
|
34610
34679
|
const printDiv = activeDocument.body.createDiv("print");
|
|
@@ -34802,7 +34871,7 @@ __export(plugin_settings_tab_exports, {
|
|
|
34802
34871
|
PluginSettingsTabBase: () => PluginSettingsTabBase,
|
|
34803
34872
|
SAVE_TO_FILE_CONTEXT: () => SAVE_TO_FILE_CONTEXT
|
|
34804
34873
|
});
|
|
34805
|
-
var
|
|
34874
|
+
var import_obsidian152 = require("obsidian");
|
|
34806
34875
|
init_async_events();
|
|
34807
34876
|
init_function();
|
|
34808
34877
|
init_type_guards();
|
|
@@ -34837,7 +34906,7 @@ var text_based_component_exports = {};
|
|
|
34837
34906
|
__export(text_based_component_exports, {
|
|
34838
34907
|
getTextBasedComponentValue: () => getTextBasedComponentValue
|
|
34839
34908
|
});
|
|
34840
|
-
var
|
|
34909
|
+
var import_obsidian135 = require("obsidian");
|
|
34841
34910
|
var AbstractTextComponentWrapper = class {
|
|
34842
34911
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- `unknown` doesn't work, getting compiler errors.
|
|
34843
34912
|
constructor(abstractTextComponent) {
|
|
@@ -34859,7 +34928,7 @@ function getTextBasedComponentValue($unknown) {
|
|
|
34859
34928
|
if (isTextBasedComponent($unknown)) {
|
|
34860
34929
|
return $unknown;
|
|
34861
34930
|
}
|
|
34862
|
-
if ($unknown instanceof
|
|
34931
|
+
if ($unknown instanceof import_obsidian135.AbstractTextComponent) {
|
|
34863
34932
|
return new AbstractTextComponentWrapper($unknown);
|
|
34864
34933
|
}
|
|
34865
34934
|
return null;
|
|
@@ -34874,7 +34943,7 @@ var validator_component_exports = {};
|
|
|
34874
34943
|
__export(validator_component_exports, {
|
|
34875
34944
|
getValidatorComponent: () => getValidatorComponent
|
|
34876
34945
|
});
|
|
34877
|
-
var
|
|
34946
|
+
var import_obsidian136 = require("obsidian");
|
|
34878
34947
|
init_css_class();
|
|
34879
34948
|
init_plugin_context();
|
|
34880
34949
|
var OverlayValidatorComponent = class {
|
|
@@ -34935,28 +35004,28 @@ function getValidatorComponent($unknown) {
|
|
|
34935
35004
|
if (isValidatorComponent($unknown)) {
|
|
34936
35005
|
return $unknown;
|
|
34937
35006
|
}
|
|
34938
|
-
if ($unknown instanceof
|
|
35007
|
+
if ($unknown instanceof import_obsidian136.ColorComponent) {
|
|
34939
35008
|
return new ValidatorElementWrapper($unknown.colorPickerEl);
|
|
34940
35009
|
}
|
|
34941
|
-
if ($unknown instanceof
|
|
35010
|
+
if ($unknown instanceof import_obsidian136.DropdownComponent) {
|
|
34942
35011
|
return new ValidatorElementWrapper($unknown.selectEl);
|
|
34943
35012
|
}
|
|
34944
|
-
if ($unknown instanceof
|
|
35013
|
+
if ($unknown instanceof import_obsidian136.ProgressBarComponent) {
|
|
34945
35014
|
return new OverlayValidatorComponent($unknown.progressBar);
|
|
34946
35015
|
}
|
|
34947
|
-
if ($unknown instanceof
|
|
35016
|
+
if ($unknown instanceof import_obsidian136.SearchComponent) {
|
|
34948
35017
|
return new ValidatorElementWrapper($unknown.inputEl);
|
|
34949
35018
|
}
|
|
34950
|
-
if ($unknown instanceof
|
|
35019
|
+
if ($unknown instanceof import_obsidian136.SliderComponent) {
|
|
34951
35020
|
return new ValidatorElementWrapper($unknown.sliderEl);
|
|
34952
35021
|
}
|
|
34953
|
-
if ($unknown instanceof
|
|
35022
|
+
if ($unknown instanceof import_obsidian136.TextAreaComponent) {
|
|
34954
35023
|
return new ValidatorElementWrapper($unknown.inputEl);
|
|
34955
35024
|
}
|
|
34956
|
-
if ($unknown instanceof
|
|
35025
|
+
if ($unknown instanceof import_obsidian136.TextComponent) {
|
|
34957
35026
|
return new ValidatorElementWrapper($unknown.inputEl);
|
|
34958
35027
|
}
|
|
34959
|
-
if ($unknown instanceof
|
|
35028
|
+
if ($unknown instanceof import_obsidian136.ToggleComponent) {
|
|
34960
35029
|
return new OverlayValidatorComponent($unknown.toggleEl);
|
|
34961
35030
|
}
|
|
34962
35031
|
return null;
|
|
@@ -34971,17 +35040,17 @@ __export(setting_ex_exports, {
|
|
|
34971
35040
|
SettingEx: () => SettingEx,
|
|
34972
35041
|
adoptSettingEx: () => adoptSettingEx
|
|
34973
35042
|
});
|
|
34974
|
-
var
|
|
35043
|
+
var import_obsidian150 = require("obsidian");
|
|
34975
35044
|
|
|
34976
35045
|
// src/obsidian/setting-components/checkbox-component.ts
|
|
34977
35046
|
var checkbox_component_exports = {};
|
|
34978
35047
|
__export(checkbox_component_exports, {
|
|
34979
35048
|
CheckboxComponent: () => CheckboxComponent
|
|
34980
35049
|
});
|
|
34981
|
-
var
|
|
35050
|
+
var import_obsidian137 = require("obsidian");
|
|
34982
35051
|
init_css_class();
|
|
34983
35052
|
init_plugin_context();
|
|
34984
|
-
var CheckboxComponent = class extends
|
|
35053
|
+
var CheckboxComponent = class extends import_obsidian137.ValueComponent {
|
|
34985
35054
|
/**
|
|
34986
35055
|
* An input element of the checkbox.
|
|
34987
35056
|
*/
|
|
@@ -35058,11 +35127,11 @@ var code_highlighter_component_exports = {};
|
|
|
35058
35127
|
__export(code_highlighter_component_exports, {
|
|
35059
35128
|
CodeHighlighterComponent: () => CodeHighlighterComponent
|
|
35060
35129
|
});
|
|
35061
|
-
var
|
|
35130
|
+
var import_obsidian138 = require("obsidian");
|
|
35062
35131
|
init_array();
|
|
35063
35132
|
init_css_class();
|
|
35064
35133
|
init_plugin_context();
|
|
35065
|
-
var CodeHighlighterComponent = class extends
|
|
35134
|
+
var CodeHighlighterComponent = class extends import_obsidian138.ValueComponent {
|
|
35066
35135
|
/**
|
|
35067
35136
|
* An input element of the component.
|
|
35068
35137
|
*
|
|
@@ -35104,7 +35173,7 @@ var CodeHighlighterComponent = class extends import_obsidian137.ValueComponent {
|
|
|
35104
35173
|
addPluginCssClasses(containerEl, "code-highlighter-component" /* CodeHighlighterComponent */);
|
|
35105
35174
|
const wrapper = containerEl.createDiv();
|
|
35106
35175
|
addPluginCssClasses(wrapper, "setting-component-wrapper" /* SettingComponentWrapper */);
|
|
35107
|
-
this.textAreaComponent = new
|
|
35176
|
+
this.textAreaComponent = new import_obsidian138.TextAreaComponent(wrapper);
|
|
35108
35177
|
this.preEl = wrapper.createEl("pre", {
|
|
35109
35178
|
attr: {
|
|
35110
35179
|
tabIndex: "-1"
|
|
@@ -35297,7 +35366,7 @@ var date_component_exports = {};
|
|
|
35297
35366
|
__export(date_component_exports, {
|
|
35298
35367
|
DateComponent: () => DateComponent
|
|
35299
35368
|
});
|
|
35300
|
-
var
|
|
35369
|
+
var import_obsidian140 = require("obsidian");
|
|
35301
35370
|
init_css_class();
|
|
35302
35371
|
|
|
35303
35372
|
// src/obsidian/setting-components/typed-range-text-component.ts
|
|
@@ -35311,10 +35380,10 @@ var typed_text_component_exports = {};
|
|
|
35311
35380
|
__export(typed_text_component_exports, {
|
|
35312
35381
|
TypedTextComponent: () => TypedTextComponent
|
|
35313
35382
|
});
|
|
35314
|
-
var
|
|
35383
|
+
var import_obsidian139 = require("obsidian");
|
|
35315
35384
|
init_css_class();
|
|
35316
35385
|
init_plugin_context();
|
|
35317
|
-
var TypedTextComponent = class extends
|
|
35386
|
+
var TypedTextComponent = class extends import_obsidian139.ValueComponent {
|
|
35318
35387
|
/**
|
|
35319
35388
|
* An input element of the component.
|
|
35320
35389
|
*/
|
|
@@ -35338,7 +35407,7 @@ var TypedTextComponent = class extends import_obsidian138.ValueComponent {
|
|
|
35338
35407
|
*/
|
|
35339
35408
|
constructor(params) {
|
|
35340
35409
|
super();
|
|
35341
|
-
this.textComponent = new
|
|
35410
|
+
this.textComponent = new import_obsidian139.TextComponent(params.containerEl);
|
|
35342
35411
|
this.inputEl = this.textComponent.inputEl;
|
|
35343
35412
|
this.inputEl.type = params.type;
|
|
35344
35413
|
addPluginCssClasses(params.containerEl, params.cssClass);
|
|
@@ -35437,7 +35506,7 @@ var TypedRangeTextComponent = class extends TypedTextComponent {
|
|
|
35437
35506
|
};
|
|
35438
35507
|
|
|
35439
35508
|
// src/obsidian/setting-components/date-component.ts
|
|
35440
|
-
var moment2 = extractDefaultExportInterop(
|
|
35509
|
+
var moment2 = extractDefaultExportInterop(import_obsidian140.moment);
|
|
35441
35510
|
var DATE_FORMAT = "YYYY-MM-DD";
|
|
35442
35511
|
var DateComponent = class extends TypedRangeTextComponent {
|
|
35443
35512
|
/**
|
|
@@ -35477,9 +35546,9 @@ var date_time_component_exports = {};
|
|
|
35477
35546
|
__export(date_time_component_exports, {
|
|
35478
35547
|
DateTimeComponent: () => DateTimeComponent
|
|
35479
35548
|
});
|
|
35480
|
-
var
|
|
35549
|
+
var import_obsidian141 = require("obsidian");
|
|
35481
35550
|
init_css_class();
|
|
35482
|
-
var moment3 = extractDefaultExportInterop(
|
|
35551
|
+
var moment3 = extractDefaultExportInterop(import_obsidian141.moment);
|
|
35483
35552
|
var DATE_TIME_FORMAT = "YYYY-MM-DDTHH:mm";
|
|
35484
35553
|
var DateTimeComponent = class extends TypedRangeTextComponent {
|
|
35485
35554
|
/**
|
|
@@ -35619,9 +35688,9 @@ var month_component_exports = {};
|
|
|
35619
35688
|
__export(month_component_exports, {
|
|
35620
35689
|
MonthComponent: () => MonthComponent
|
|
35621
35690
|
});
|
|
35622
|
-
var
|
|
35691
|
+
var import_obsidian142 = require("obsidian");
|
|
35623
35692
|
init_css_class();
|
|
35624
|
-
var moment4 = extractDefaultExportInterop(
|
|
35693
|
+
var moment4 = extractDefaultExportInterop(import_obsidian142.moment);
|
|
35625
35694
|
var DATE_FORMAT2 = "YYYY-MM";
|
|
35626
35695
|
var MonthComponent = class extends TypedRangeTextComponent {
|
|
35627
35696
|
/**
|
|
@@ -35669,10 +35738,10 @@ var multiple_dropdown_component_exports = {};
|
|
|
35669
35738
|
__export(multiple_dropdown_component_exports, {
|
|
35670
35739
|
MultipleDropdownComponent: () => MultipleDropdownComponent
|
|
35671
35740
|
});
|
|
35672
|
-
var
|
|
35741
|
+
var import_obsidian143 = require("obsidian");
|
|
35673
35742
|
init_css_class();
|
|
35674
35743
|
init_plugin_context();
|
|
35675
|
-
var MultipleDropdownComponent = class extends
|
|
35744
|
+
var MultipleDropdownComponent = class extends import_obsidian143.ValueComponent {
|
|
35676
35745
|
/**
|
|
35677
35746
|
* A select element of the component.
|
|
35678
35747
|
*
|
|
@@ -35701,7 +35770,7 @@ var MultipleDropdownComponent = class extends import_obsidian142.ValueComponent
|
|
|
35701
35770
|
*/
|
|
35702
35771
|
constructor(containerEl) {
|
|
35703
35772
|
super();
|
|
35704
|
-
this.dropdownComponent = new
|
|
35773
|
+
this.dropdownComponent = new import_obsidian143.DropdownComponent(containerEl);
|
|
35705
35774
|
this.dropdownComponent.selectEl.multiple = true;
|
|
35706
35775
|
addPluginCssClasses(containerEl, "multiple-dropdown-component" /* MultipleDropdownComponent */);
|
|
35707
35776
|
}
|
|
@@ -35874,10 +35943,10 @@ var multiple_text_component_exports = {};
|
|
|
35874
35943
|
__export(multiple_text_component_exports, {
|
|
35875
35944
|
MultipleTextComponent: () => MultipleTextComponent
|
|
35876
35945
|
});
|
|
35877
|
-
var
|
|
35946
|
+
var import_obsidian144 = require("obsidian");
|
|
35878
35947
|
init_css_class();
|
|
35879
35948
|
init_plugin_context();
|
|
35880
|
-
var MultipleTextComponent = class extends
|
|
35949
|
+
var MultipleTextComponent = class extends import_obsidian144.ValueComponent {
|
|
35881
35950
|
/**
|
|
35882
35951
|
* An input element of the component.
|
|
35883
35952
|
*
|
|
@@ -35906,7 +35975,7 @@ var MultipleTextComponent = class extends import_obsidian143.ValueComponent {
|
|
|
35906
35975
|
*/
|
|
35907
35976
|
constructor(containerEl) {
|
|
35908
35977
|
super();
|
|
35909
|
-
this.textAreaComponent = new
|
|
35978
|
+
this.textAreaComponent = new import_obsidian144.TextAreaComponent(containerEl);
|
|
35910
35979
|
addPluginCssClasses(containerEl, "multiple-text-component" /* MultipleTextComponent */);
|
|
35911
35980
|
}
|
|
35912
35981
|
/**
|
|
@@ -36168,7 +36237,7 @@ var time_component_exports = {};
|
|
|
36168
36237
|
__export(time_component_exports, {
|
|
36169
36238
|
TimeComponent: () => TimeComponent
|
|
36170
36239
|
});
|
|
36171
|
-
var
|
|
36240
|
+
var import_obsidian145 = require("obsidian");
|
|
36172
36241
|
init_css_class();
|
|
36173
36242
|
var TimeComponent = class extends TypedRangeTextComponent {
|
|
36174
36243
|
/**
|
|
@@ -36190,7 +36259,7 @@ var TimeComponent = class extends TypedRangeTextComponent {
|
|
|
36190
36259
|
* @returns The date.
|
|
36191
36260
|
*/
|
|
36192
36261
|
valueFromString($string) {
|
|
36193
|
-
return
|
|
36262
|
+
return import_obsidian145.moment.duration($string);
|
|
36194
36263
|
}
|
|
36195
36264
|
/**
|
|
36196
36265
|
* Converts a time to a string.
|
|
@@ -36207,7 +36276,7 @@ var TimeComponent = class extends TypedRangeTextComponent {
|
|
|
36207
36276
|
} else {
|
|
36208
36277
|
format2 = "HH:mm";
|
|
36209
36278
|
}
|
|
36210
|
-
return
|
|
36279
|
+
return import_obsidian145.moment.utc(value.asMilliseconds()).format(format2);
|
|
36211
36280
|
}
|
|
36212
36281
|
};
|
|
36213
36282
|
|
|
@@ -36216,10 +36285,10 @@ var tri_state_checkbox_component_exports = {};
|
|
|
36216
36285
|
__export(tri_state_checkbox_component_exports, {
|
|
36217
36286
|
TriStateCheckboxComponent: () => TriStateCheckboxComponent
|
|
36218
36287
|
});
|
|
36219
|
-
var
|
|
36288
|
+
var import_obsidian146 = require("obsidian");
|
|
36220
36289
|
init_css_class();
|
|
36221
36290
|
init_plugin_context();
|
|
36222
|
-
var TriStateCheckboxComponent = class extends
|
|
36291
|
+
var TriStateCheckboxComponent = class extends import_obsidian146.ValueComponent {
|
|
36223
36292
|
/**
|
|
36224
36293
|
* An input element of the checkbox.
|
|
36225
36294
|
*/
|
|
@@ -36297,10 +36366,10 @@ var typed_dropdown_component_exports = {};
|
|
|
36297
36366
|
__export(typed_dropdown_component_exports, {
|
|
36298
36367
|
TypedDropdownComponent: () => TypedDropdownComponent
|
|
36299
36368
|
});
|
|
36300
|
-
var
|
|
36369
|
+
var import_obsidian147 = require("obsidian");
|
|
36301
36370
|
init_css_class();
|
|
36302
36371
|
init_plugin_context();
|
|
36303
|
-
var TypedDropdownComponent = class extends
|
|
36372
|
+
var TypedDropdownComponent = class extends import_obsidian147.ValueComponent {
|
|
36304
36373
|
/**
|
|
36305
36374
|
* A select element of the component.
|
|
36306
36375
|
*
|
|
@@ -36333,7 +36402,7 @@ var TypedDropdownComponent = class extends import_obsidian146.ValueComponent {
|
|
|
36333
36402
|
*/
|
|
36334
36403
|
constructor(containerEl) {
|
|
36335
36404
|
super();
|
|
36336
|
-
this.dropdownComponent = new
|
|
36405
|
+
this.dropdownComponent = new import_obsidian147.DropdownComponent(containerEl);
|
|
36337
36406
|
addPluginCssClasses(containerEl, "typed-dropdown-component" /* TypedDropdownComponent */);
|
|
36338
36407
|
}
|
|
36339
36408
|
/**
|
|
@@ -36423,10 +36492,10 @@ var typed_multiple_dropdown_component_exports = {};
|
|
|
36423
36492
|
__export(typed_multiple_dropdown_component_exports, {
|
|
36424
36493
|
TypedMultipleDropdownComponent: () => TypedMultipleDropdownComponent
|
|
36425
36494
|
});
|
|
36426
|
-
var
|
|
36495
|
+
var import_obsidian148 = require("obsidian");
|
|
36427
36496
|
init_css_class();
|
|
36428
36497
|
init_plugin_context();
|
|
36429
|
-
var TypedMultipleDropdownComponent = class extends
|
|
36498
|
+
var TypedMultipleDropdownComponent = class extends import_obsidian148.ValueComponent {
|
|
36430
36499
|
/**
|
|
36431
36500
|
* A select element of the component.
|
|
36432
36501
|
*
|
|
@@ -36604,9 +36673,9 @@ var week_component_exports = {};
|
|
|
36604
36673
|
__export(week_component_exports, {
|
|
36605
36674
|
WeekComponent: () => WeekComponent
|
|
36606
36675
|
});
|
|
36607
|
-
var
|
|
36676
|
+
var import_obsidian149 = require("obsidian");
|
|
36608
36677
|
init_css_class();
|
|
36609
|
-
var moment6 = extractDefaultExportInterop(
|
|
36678
|
+
var moment6 = extractDefaultExportInterop(import_obsidian149.moment);
|
|
36610
36679
|
var DATE_FORMAT3 = "YYYY-[W]WW";
|
|
36611
36680
|
var WeekComponent = class extends TypedRangeTextComponent {
|
|
36612
36681
|
/**
|
|
@@ -36650,7 +36719,7 @@ var WeekComponent = class extends TypedRangeTextComponent {
|
|
|
36650
36719
|
};
|
|
36651
36720
|
|
|
36652
36721
|
// src/obsidian/setting-ex.ts
|
|
36653
|
-
var SettingEx = class extends
|
|
36722
|
+
var SettingEx = class extends import_obsidian150.Setting {
|
|
36654
36723
|
/**
|
|
36655
36724
|
* Adds a {@link CheckboxComponent} to the setting.
|
|
36656
36725
|
*
|
|
@@ -36867,7 +36936,7 @@ __export(validation_exports, {
|
|
|
36867
36936
|
getOsUnsafePathCharsRegExp: () => getOsUnsafePathCharsRegExp,
|
|
36868
36937
|
isValidationMessageHolder: () => isValidationMessageHolder
|
|
36869
36938
|
});
|
|
36870
|
-
var
|
|
36939
|
+
var import_obsidian151 = require("obsidian");
|
|
36871
36940
|
init_reg_exp();
|
|
36872
36941
|
function isValidationMessageHolder(value) {
|
|
36873
36942
|
return value.validationMessage !== void 0;
|
|
@@ -36882,7 +36951,7 @@ function getOsAndObsidianUnsafePathCharsRegExp(isWindows) {
|
|
|
36882
36951
|
]);
|
|
36883
36952
|
}
|
|
36884
36953
|
function getOsUnsafePathCharsRegExp(isWindows) {
|
|
36885
|
-
isWindows ??=
|
|
36954
|
+
isWindows ??= import_obsidian151.Platform.isWin;
|
|
36886
36955
|
return isWindows ? WINDOWS_UNSAFE_PATH_CHARS : UNIX_UNSAFE_PATH_CHARS;
|
|
36887
36956
|
}
|
|
36888
36957
|
|
|
@@ -36910,7 +36979,7 @@ var PluginSettingsTabEventsComponent = class extends ComponentEx {
|
|
|
36910
36979
|
registerAsyncEvent(this, pluginSettingsComponent.on("saveSettings", (newState, oldState, context) => this.params.onSaveSettings(newState, oldState, context)));
|
|
36911
36980
|
}
|
|
36912
36981
|
};
|
|
36913
|
-
var PluginSettingsTabBase = class extends mixinAsyncEvents()(
|
|
36982
|
+
var PluginSettingsTabBase = class extends mixinAsyncEvents()(import_obsidian152.PluginSettingTab) {
|
|
36914
36983
|
/**
|
|
36915
36984
|
* Whether the plugin settings tab is open.
|
|
36916
36985
|
*
|
|
@@ -36948,7 +37017,7 @@ var PluginSettingsTabBase = class extends mixinAsyncEvents()(import_obsidian151.
|
|
|
36948
37017
|
super(params.plugin.app, params.plugin);
|
|
36949
37018
|
this.pluginSettingsComponent = params.pluginSettingsComponent;
|
|
36950
37019
|
addPluginCssClasses(this.containerEl, "plugin-settings-tab" /* PluginSettingsTab */);
|
|
36951
|
-
this.saveSettingsDebounced = (0,
|
|
37020
|
+
this.saveSettingsDebounced = (0, import_obsidian152.debounce)(
|
|
36952
37021
|
convertAsyncToSync(() => this.pluginSettingsComponent.saveToFile(SAVE_TO_FILE_CONTEXT)),
|
|
36953
37022
|
this.saveSettingsDebounceTimeoutInMilliseconds
|
|
36954
37023
|
);
|
|
@@ -37021,7 +37090,7 @@ var PluginSettingsTabBase = class extends mixinAsyncEvents()(import_obsidian151.
|
|
|
37021
37090
|
}
|
|
37022
37091
|
let shouldSkipOnChange = false;
|
|
37023
37092
|
const UPDATE_VALIDATOR_EL_TIMEOUT_IN_MILLISECONDS = 100;
|
|
37024
|
-
const updateValidatorElementDebounced = (0,
|
|
37093
|
+
const updateValidatorElementDebounced = (0, import_obsidian152.debounce)(() => {
|
|
37025
37094
|
window.requestAnimationFrame(() => {
|
|
37026
37095
|
updateValidatorEl();
|
|
37027
37096
|
});
|
|
@@ -37104,7 +37173,7 @@ var PluginSettingsTabBase = class extends mixinAsyncEvents()(import_obsidian151.
|
|
|
37104
37173
|
tooltipContentEl.textContent = validationMessage;
|
|
37105
37174
|
tooltipEl?.toggle(!!validationMessage);
|
|
37106
37175
|
} else if (validationMessage) {
|
|
37107
|
-
(0,
|
|
37176
|
+
(0, import_obsidian152.setTooltip)(validatorEl, validationMessage);
|
|
37108
37177
|
}
|
|
37109
37178
|
}
|
|
37110
37179
|
}
|
|
@@ -37348,12 +37417,12 @@ __export(plugin_exports, {
|
|
|
37348
37417
|
reloadPlugin: () => reloadPlugin,
|
|
37349
37418
|
showErrorAndDisablePlugin: () => showErrorAndDisablePlugin
|
|
37350
37419
|
});
|
|
37351
|
-
var
|
|
37420
|
+
var import_obsidian153 = require("obsidian");
|
|
37352
37421
|
init_async_events();
|
|
37353
37422
|
init_error();
|
|
37354
37423
|
init_function();
|
|
37355
37424
|
init_type_guards();
|
|
37356
|
-
var PluginBase = class extends mixinAsyncEvents()(
|
|
37425
|
+
var PluginBase = class extends mixinAsyncEvents()(import_obsidian153.Plugin) {
|
|
37357
37426
|
/**
|
|
37358
37427
|
* Gets abort signal component.
|
|
37359
37428
|
*
|
|
@@ -37626,7 +37695,7 @@ var plugin_cli_handler_registrar_exports = {};
|
|
|
37626
37695
|
__export(plugin_cli_handler_registrar_exports, {
|
|
37627
37696
|
PluginCliHandlerRegistrar: () => PluginCliHandlerRegistrar
|
|
37628
37697
|
});
|
|
37629
|
-
var
|
|
37698
|
+
var import_obsidian154 = require("obsidian");
|
|
37630
37699
|
var PluginCliHandlerRegistrar = class {
|
|
37631
37700
|
/**
|
|
37632
37701
|
* Creates a new instance of the {@link PluginCliHandlerRegistrar} class.
|
|
@@ -37660,7 +37729,7 @@ var field_popover_exports = {};
|
|
|
37660
37729
|
__export(field_popover_exports, {
|
|
37661
37730
|
editFieldsInPopover: () => editFieldsInPopover
|
|
37662
37731
|
});
|
|
37663
|
-
var
|
|
37732
|
+
var import_obsidian156 = require("obsidian");
|
|
37664
37733
|
init_css_class();
|
|
37665
37734
|
|
|
37666
37735
|
// src/obsidian/popovers/popover.ts
|
|
@@ -37668,7 +37737,7 @@ var popover_exports = {};
|
|
|
37668
37737
|
__export(popover_exports, {
|
|
37669
37738
|
showPopover: () => showPopover
|
|
37670
37739
|
});
|
|
37671
|
-
var
|
|
37740
|
+
var import_obsidian155 = require("obsidian");
|
|
37672
37741
|
init_css_class();
|
|
37673
37742
|
init_plugin_context();
|
|
37674
37743
|
var ANCHOR_GAP_IN_PIXELS = 4;
|
|
@@ -37724,7 +37793,7 @@ async function showPopover(params) {
|
|
|
37724
37793
|
handleCancel();
|
|
37725
37794
|
}
|
|
37726
37795
|
});
|
|
37727
|
-
const buttonsSetting = new
|
|
37796
|
+
const buttonsSetting = new import_obsidian155.Setting(popoverEl);
|
|
37728
37797
|
buttonsSetting.addButton((button) => {
|
|
37729
37798
|
button.setButtonText(okButtonText ?? t2(($) => $.obsidianDevUtils.buttons.ok)).setCta().setClass("ok-button" /* OkButton */).onClick(handleOk);
|
|
37730
37799
|
});
|
|
@@ -37783,8 +37852,8 @@ async function editFieldsInPopover(params) {
|
|
|
37783
37852
|
}));
|
|
37784
37853
|
}
|
|
37785
37854
|
function addField(containerEl, field) {
|
|
37786
|
-
const setting = new
|
|
37787
|
-
const textComponent = new
|
|
37855
|
+
const setting = new import_obsidian156.Setting(containerEl).setName(field.name);
|
|
37856
|
+
const textComponent = new import_obsidian156.TextComponent(setting.controlEl);
|
|
37788
37857
|
textComponent.setValue(field.defaultValue ?? "");
|
|
37789
37858
|
textComponent.setPlaceholder(field.placeholder ?? "");
|
|
37790
37859
|
textComponent.inputEl.addClass("text-box" /* TextBox */);
|
|
@@ -37803,7 +37872,7 @@ __export(app_context_exports, {
|
|
|
37803
37872
|
AppContext: () => AppContext,
|
|
37804
37873
|
useApp: () => useApp
|
|
37805
37874
|
});
|
|
37806
|
-
var
|
|
37875
|
+
var import_obsidian157 = require("obsidian");
|
|
37807
37876
|
var import_react = __toESM(require_react(), 1);
|
|
37808
37877
|
init_type_guards();
|
|
37809
37878
|
var AppContext = (0, import_react.createContext)(void 0);
|
|
@@ -37816,7 +37885,7 @@ var ribbon_icon_registrar_exports = {};
|
|
|
37816
37885
|
__export(ribbon_icon_registrar_exports, {
|
|
37817
37886
|
PluginRibbonIconRegistrar: () => PluginRibbonIconRegistrar
|
|
37818
37887
|
});
|
|
37819
|
-
var
|
|
37888
|
+
var import_obsidian158 = require("obsidian");
|
|
37820
37889
|
var PluginRibbonIconRegistrar = class {
|
|
37821
37890
|
/**
|
|
37822
37891
|
* Creates a new instance of the {@link PluginRibbonIconRegistrar} class.
|
|
@@ -37877,8 +37946,8 @@ var setting_group_ex_exports = {};
|
|
|
37877
37946
|
__export(setting_group_ex_exports, {
|
|
37878
37947
|
SettingGroupEx: () => SettingGroupEx
|
|
37879
37948
|
});
|
|
37880
|
-
var
|
|
37881
|
-
var SettingGroupEx = class extends
|
|
37949
|
+
var import_obsidian159 = require("obsidian");
|
|
37950
|
+
var SettingGroupEx = class extends import_obsidian159.SettingGroup {
|
|
37882
37951
|
/**
|
|
37883
37952
|
* Creates a new setting group.
|
|
37884
37953
|
*
|
|
@@ -37905,7 +37974,7 @@ var status_bar_item_registrar_exports = {};
|
|
|
37905
37974
|
__export(status_bar_item_registrar_exports, {
|
|
37906
37975
|
PluginStatusBarItemRegistrar: () => PluginStatusBarItemRegistrar
|
|
37907
37976
|
});
|
|
37908
|
-
var
|
|
37977
|
+
var import_obsidian160 = require("obsidian");
|
|
37909
37978
|
var PluginStatusBarItemRegistrar = class {
|
|
37910
37979
|
/**
|
|
37911
37980
|
* Creates a new instance of the {@link PluginStatusBarItemRegistrar} class.
|
|
@@ -38180,7 +38249,7 @@ var view_registrar_exports = {};
|
|
|
38180
38249
|
__export(view_registrar_exports, {
|
|
38181
38250
|
PluginViewRegistrar: () => PluginViewRegistrar
|
|
38182
38251
|
});
|
|
38183
|
-
var
|
|
38252
|
+
var import_obsidian161 = require("obsidian");
|
|
38184
38253
|
var PluginViewRegistrar = class {
|
|
38185
38254
|
/**
|
|
38186
38255
|
* Creates a new instance of the {@link PluginViewRegistrar} class.
|
|
@@ -38917,8 +38986,8 @@ init_value_provider();
|
|
|
38917
38986
|
init_value_wrapper();
|
|
38918
38987
|
|
|
38919
38988
|
// integration-test-plugin/main.ts
|
|
38920
|
-
var
|
|
38921
|
-
var IntegrationTestPlugin = class extends
|
|
38989
|
+
var import_obsidian162 = require("obsidian");
|
|
38990
|
+
var IntegrationTestPlugin = class extends import_obsidian162.Plugin {
|
|
38922
38991
|
onload() {
|
|
38923
38992
|
window.__obsidianDevUtilsModule = src_exports;
|
|
38924
38993
|
}
|