obsidian-dev-utils 55.4.0 → 56.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 +11 -0
- package/dist/lib/cjs/abort-controller.cjs +8 -4
- package/dist/lib/cjs/array.cjs +7 -3
- package/dist/lib/cjs/async-events.cjs +9 -5
- package/dist/lib/cjs/async.cjs +8 -4
- package/dist/lib/cjs/blob.cjs +8 -4
- package/dist/lib/cjs/codemirror/index.cjs +7 -3
- package/dist/lib/cjs/codemirror/state-field-spec.cjs +7 -3
- package/dist/lib/cjs/css-class.cjs +7 -3
- package/dist/lib/cjs/debug-controller.cjs +7 -3
- package/dist/lib/cjs/debug.cjs +7 -3
- package/dist/lib/cjs/enum.cjs +7 -3
- package/dist/lib/cjs/error.cjs +7 -3
- package/dist/lib/cjs/function.cjs +7 -3
- package/dist/lib/cjs/html-element.cjs +20 -16
- package/dist/lib/cjs/index.cjs +7 -3
- package/dist/lib/cjs/library.cjs +8 -4
- package/dist/lib/cjs/object-utils.cjs +7 -3
- package/dist/lib/cjs/obsidian/@types/i18next.d.cts +3 -3
- package/dist/lib/cjs/obsidian/app.cjs +7 -3
- package/dist/lib/cjs/obsidian/async-with-notice.cjs +10 -6
- package/dist/lib/cjs/obsidian/attachment-path.cjs +7 -3
- package/dist/lib/cjs/obsidian/backlink.cjs +7 -3
- package/dist/lib/cjs/obsidian/callout.cjs +7 -3
- package/dist/lib/cjs/obsidian/code-block-markdown-information.cjs +7 -3
- package/dist/lib/cjs/obsidian/command-handlers/abstract-file-command-handler.cjs +355 -0
- package/dist/lib/cjs/obsidian/command-handlers/abstract-file-command-handler.d.cts +178 -0
- package/dist/lib/cjs/obsidian/{commands/index.cjs → command-handlers/app-active-file-provider.cjs} +31 -34
- package/dist/lib/cjs/obsidian/command-handlers/app-active-file-provider.d.cts +25 -0
- package/dist/lib/cjs/obsidian/command-handlers/app-menu-event-registrar.cjs +173 -0
- package/dist/lib/cjs/obsidian/command-handlers/app-menu-event-registrar.d.cts +41 -0
- package/dist/lib/cjs/obsidian/command-handlers/command-handler-component.cjs +164 -0
- package/dist/lib/cjs/obsidian/command-handlers/command-handler-component.d.cts +26 -0
- package/dist/lib/cjs/obsidian/command-handlers/command-handler.cjs +174 -0
- package/dist/lib/cjs/obsidian/command-handlers/command-handler.d.cts +143 -0
- package/dist/lib/cjs/obsidian/command-handlers/editor-command-handler.cjs +269 -0
- package/dist/lib/cjs/obsidian/command-handlers/editor-command-handler.d.cts +114 -0
- package/dist/lib/cjs/obsidian/command-handlers/file-command-handler.cjs +261 -0
- package/dist/lib/cjs/obsidian/command-handlers/file-command-handler.d.cts +112 -0
- package/dist/lib/cjs/obsidian/command-handlers/folder-command-handler.cjs +261 -0
- package/dist/lib/cjs/obsidian/command-handlers/folder-command-handler.d.cts +112 -0
- package/dist/lib/cjs/obsidian/command-handlers/global-command-handler.cjs +177 -0
- package/dist/lib/cjs/obsidian/command-handlers/global-command-handler.d.cts +38 -0
- package/dist/lib/cjs/obsidian/command-handlers/index.cjs +170 -0
- package/dist/lib/cjs/obsidian/command-handlers/index.d.cts +9 -0
- package/dist/lib/cjs/obsidian/components/all-windows-event-handler.cjs +8 -4
- package/dist/lib/cjs/obsidian/components/async-component.cjs +164 -0
- package/dist/lib/cjs/obsidian/components/async-component.d.cts +28 -0
- package/dist/lib/cjs/obsidian/components/async-events-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/index.cjs +10 -3
- package/dist/lib/cjs/obsidian/components/index.d.cts +1 -0
- package/dist/lib/cjs/obsidian/components/setting-components/checkbox-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/code-highlighter-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/date-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/date-time-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/email-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/file-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/index.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/month-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/multiple-dropdown-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/multiple-email-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/multiple-file-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/multiple-text-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/number-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/password-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/setting-component-wrapper.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/telephone-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/text-based-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/time-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/tri-state-checkbox-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/typed-dropdown-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/typed-multiple-dropdown-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/typed-range-text-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/typed-text-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/url-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/validator-component.cjs +9 -5
- package/dist/lib/cjs/obsidian/components/setting-components/value-component-with-change-tracking.cjs +7 -3
- package/dist/lib/cjs/obsidian/components/setting-components/week-component.cjs +7 -3
- package/dist/lib/cjs/obsidian/constructors/getDomEventsHandlersConstructor.cjs +7 -3
- package/dist/lib/cjs/obsidian/constructors/index.cjs +7 -3
- package/dist/lib/cjs/obsidian/dataview-link.cjs +7 -3
- package/dist/lib/cjs/obsidian/dataview.cjs +8 -4
- package/dist/lib/cjs/obsidian/editor.cjs +7 -3
- package/dist/lib/cjs/obsidian/file-change.cjs +7 -3
- package/dist/lib/cjs/obsidian/file-manager.cjs +7 -3
- package/dist/lib/cjs/obsidian/file-system.cjs +7 -3
- package/dist/lib/cjs/obsidian/frontmatter-link-cache-with-offsets.cjs +7 -3
- package/dist/lib/cjs/obsidian/frontmatter.cjs +7 -3
- package/dist/lib/cjs/obsidian/i18n/{custom-type-options-base.cjs → custom-type-options.cjs} +9 -5
- package/dist/lib/cjs/obsidian/i18n/custom-type-options.d.cts +37 -0
- package/dist/lib/cjs/obsidian/{plugin/plugin-settings-wrapper.cjs → i18n/default-translations.cjs} +10 -5
- package/dist/lib/cjs/obsidian/i18n/default-translations.d.cts +14 -0
- package/dist/lib/cjs/obsidian/i18n/i18n.cjs +7 -3
- package/dist/lib/cjs/obsidian/i18n/i18n.d.cts +2 -13
- package/dist/lib/cjs/obsidian/i18n/index.cjs +13 -9
- package/dist/lib/cjs/obsidian/i18n/index.d.cts +2 -2
- package/dist/lib/cjs/obsidian/i18n/locales/en.cjs +7 -3
- package/dist/lib/cjs/obsidian/i18n/locales/index.cjs +7 -3
- package/dist/lib/cjs/obsidian/i18n/locales/translations-map.cjs +7 -3
- package/dist/lib/cjs/obsidian/i18n/locales/translations-map.d.cts +1 -2
- package/dist/lib/cjs/obsidian/index.cjs +10 -6
- package/dist/lib/cjs/obsidian/index.d.cts +1 -1
- package/dist/lib/cjs/obsidian/is-in-obsidian.cjs +7 -3
- package/dist/lib/cjs/obsidian/link.cjs +7 -3
- package/dist/lib/cjs/obsidian/logger.cjs +7 -3
- package/dist/lib/cjs/obsidian/loop.cjs +7 -3
- package/dist/lib/cjs/obsidian/markdown-code-block-processor.cjs +7 -3
- package/dist/lib/cjs/obsidian/markdown-view.cjs +7 -3
- package/dist/lib/cjs/obsidian/markdown.cjs +7 -3
- package/dist/lib/cjs/obsidian/metadata-cache.cjs +7 -3
- package/dist/lib/cjs/obsidian/modals/alert.cjs +10 -6
- package/dist/lib/cjs/obsidian/modals/confirm.cjs +10 -6
- package/dist/lib/cjs/obsidian/modals/index.cjs +10 -6
- package/dist/lib/cjs/obsidian/modals/index.d.cts +1 -1
- package/dist/lib/cjs/obsidian/modals/{modal-base.cjs → modal.cjs} +10 -6
- package/dist/lib/cjs/obsidian/modals/prompt.cjs +10 -6
- package/dist/lib/cjs/obsidian/modals/select-item.cjs +9 -5
- package/dist/lib/cjs/obsidian/monkey-around.cjs +7 -3
- package/dist/lib/cjs/obsidian/obsidian-settings.cjs +7 -3
- package/dist/lib/cjs/obsidian/pdf.cjs +10 -6
- package/dist/lib/cjs/obsidian/{commands/non-editor-command-base.cjs → plugin/components/abort-signal-component.cjs} +31 -21
- package/dist/lib/cjs/obsidian/plugin/components/abort-signal-component.d.cts +27 -0
- package/dist/lib/cjs/obsidian/plugin/components/async-error-handler-component.cjs +165 -0
- package/dist/lib/cjs/obsidian/plugin/components/async-error-handler-component.d.cts +29 -0
- package/dist/lib/cjs/obsidian/plugin/components/console-debug-component.cjs +160 -0
- package/dist/lib/cjs/obsidian/plugin/components/console-debug-component.d.cts +29 -0
- package/dist/lib/cjs/obsidian/{i18n/default-translations-base.cjs → plugin/components/i18n-component.cjs} +41 -6
- package/dist/lib/cjs/obsidian/plugin/components/i18n-component.d.cts +23 -0
- package/dist/lib/cjs/obsidian/plugin/components/index.cjs +170 -0
- package/dist/lib/cjs/obsidian/plugin/components/index.d.cts +9 -0
- package/dist/lib/cjs/obsidian/plugin/components/lifecycle-events-component.cjs +207 -0
- package/dist/lib/cjs/obsidian/plugin/components/lifecycle-events-component.d.cts +59 -0
- package/dist/lib/cjs/obsidian/plugin/components/plugin-context-component.cjs +162 -0
- package/dist/lib/cjs/obsidian/plugin/components/plugin-context-component.d.cts +25 -0
- package/dist/lib/cjs/obsidian/plugin/components/plugin-notice-component.cjs +161 -0
- package/dist/lib/cjs/obsidian/plugin/components/plugin-notice-component.d.cts +25 -0
- package/dist/lib/cjs/obsidian/plugin/components/plugin-settings-component.cjs +566 -0
- package/dist/lib/cjs/obsidian/plugin/components/plugin-settings-component.d.cts +296 -0
- package/dist/lib/cjs/obsidian/plugin/components/plugin-settings-tab-component.cjs +166 -0
- package/dist/lib/cjs/obsidian/plugin/components/plugin-settings-tab-component.d.cts +28 -0
- package/dist/lib/cjs/obsidian/plugin/index.cjs +13 -18
- package/dist/lib/cjs/obsidian/plugin/index.d.cts +2 -5
- package/dist/lib/cjs/obsidian/plugin/obsidian-plugin-repo-paths.cjs +7 -3
- package/dist/lib/cjs/obsidian/plugin/path-settings.cjs +7 -3
- package/dist/lib/cjs/obsidian/plugin/plugin-context.cjs +18 -7
- package/dist/lib/cjs/obsidian/plugin/plugin-context.d.cts +3 -2
- package/dist/lib/cjs/obsidian/plugin/plugin-id.cjs +7 -3
- package/dist/lib/cjs/obsidian/plugin/plugin-settings-tab.cjs +408 -0
- package/dist/lib/cjs/obsidian/plugin/{plugin-settings-tab-base.d.cts → plugin-settings-tab.d.cts} +28 -11
- package/dist/lib/cjs/obsidian/plugin/plugin.cjs +137 -3
- package/dist/lib/cjs/obsidian/plugin/plugin.d.cts +106 -5
- package/dist/lib/cjs/obsidian/queue.cjs +7 -3
- package/dist/lib/cjs/obsidian/react/app-context.cjs +7 -3
- package/dist/lib/cjs/obsidian/react/index.cjs +7 -3
- package/dist/lib/cjs/obsidian/reference.cjs +7 -3
- package/dist/lib/cjs/obsidian/rename-delete-handler.cjs +7 -3
- package/dist/lib/cjs/obsidian/resource-url.cjs +7 -3
- package/dist/lib/cjs/obsidian/setting-ex.cjs +7 -3
- package/dist/lib/cjs/obsidian/setting-group-ex.cjs +7 -3
- package/dist/lib/cjs/obsidian/validation.cjs +7 -3
- package/dist/lib/cjs/obsidian/vault-delete.cjs +7 -3
- package/dist/lib/cjs/obsidian/vault.cjs +7 -3
- package/dist/lib/cjs/obsidian/workspace.cjs +7 -3
- package/dist/lib/cjs/path.cjs +7 -3
- package/dist/lib/cjs/reg-exp.cjs +7 -3
- package/dist/lib/cjs/script-utils/build.cjs +7 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/change-extension-plugin.cjs +7 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/copy-to-obsidian-plugins-folder-plugin.cjs +7 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/custom-esbuild-options-plugin.cjs +7 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/dependency.cjs +8 -4
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/fix-esm-plugin.cjs +7 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/fix-source-maps-plugin.cjs +7 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/index.cjs +7 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/obsidian-plugin-builder.cjs +7 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/preprocess-plugin.cjs +10 -6
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/rename-css-plugin.cjs +7 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/svelte-wrapper-plugin.cjs +7 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild.cjs +7 -3
- package/dist/lib/cjs/script-utils/bundlers/index.cjs +7 -3
- package/dist/lib/cjs/script-utils/cli-utils.cjs +7 -3
- package/dist/lib/cjs/script-utils/code-generator.cjs +7 -3
- package/dist/lib/cjs/script-utils/commitlint-config.cjs +7 -3
- package/dist/lib/cjs/script-utils/exec.cjs +7 -3
- package/dist/lib/cjs/script-utils/formatters/dprint.cjs +8 -4
- package/dist/lib/cjs/script-utils/formatters/index.cjs +7 -3
- package/dist/lib/cjs/script-utils/fs.cjs +7 -3
- package/dist/lib/cjs/script-utils/index.cjs +7 -3
- package/dist/lib/cjs/script-utils/json.cjs +7 -3
- package/dist/lib/cjs/script-utils/linters/cspell.cjs +7 -3
- package/dist/lib/cjs/script-utils/linters/eslint-config.cjs +9 -13
- package/dist/lib/cjs/script-utils/linters/eslint-rules/index.cjs +7 -3
- package/dist/lib/cjs/script-utils/linters/eslint-rules/no-async-callback-to-unsafe-return.cjs +7 -3
- package/dist/lib/cjs/script-utils/linters/eslint-rules/no-used-underscore-variables.cjs +7 -3
- package/dist/lib/cjs/script-utils/linters/eslint-rules/obsidian-dev-utils-plugin.cjs +7 -3
- package/dist/lib/cjs/script-utils/linters/eslint-rules/rule-tester-helper.cjs +7 -3
- package/dist/lib/cjs/script-utils/linters/eslint.cjs +8 -4
- package/dist/lib/cjs/script-utils/linters/index.cjs +7 -3
- package/dist/lib/cjs/script-utils/linters/markdownlint-cli2-config.cjs +7 -3
- package/dist/lib/cjs/script-utils/linters/markdownlint.cjs +11 -5
- package/dist/lib/cjs/script-utils/nano-staged-config.cjs +7 -3
- package/dist/lib/cjs/script-utils/npm-publish.cjs +7 -3
- package/dist/lib/cjs/script-utils/npm-run.cjs +7 -3
- package/dist/lib/cjs/script-utils/npm.cjs +7 -3
- package/dist/lib/cjs/script-utils/obsidian-dev-utils-repo-paths.cjs +7 -3
- package/dist/lib/cjs/script-utils/root.cjs +7 -3
- package/dist/lib/cjs/script-utils/test-runners/index.cjs +7 -3
- package/dist/lib/cjs/script-utils/test-runners/vitest.cjs +7 -3
- package/dist/lib/cjs/script-utils/version.cjs +7 -3
- package/dist/lib/cjs/strict-proxy.cjs +7 -3
- package/dist/lib/cjs/string.cjs +7 -3
- package/dist/lib/cjs/transformers/date-transformer.cjs +7 -3
- package/dist/lib/cjs/transformers/duration-transformer.cjs +7 -3
- package/dist/lib/cjs/transformers/group-transformer.cjs +7 -3
- package/dist/lib/cjs/transformers/index.cjs +7 -3
- package/dist/lib/cjs/transformers/map-transformer.cjs +7 -3
- package/dist/lib/cjs/transformers/set-transformer.cjs +7 -3
- package/dist/lib/cjs/transformers/skip-private-property-transformer.cjs +7 -3
- package/dist/lib/cjs/transformers/transformer.cjs +7 -3
- package/dist/lib/cjs/transformers/two-way-map-transformer.cjs +7 -3
- package/dist/lib/cjs/transformers/typed-transformer.cjs +7 -3
- package/dist/lib/cjs/two-way-map.cjs +7 -3
- package/dist/lib/cjs/type-guards.cjs +7 -3
- package/dist/lib/cjs/type.cjs +7 -3
- package/dist/lib/cjs/url.cjs +7 -3
- package/dist/lib/cjs/value-provider.cjs +7 -3
- package/dist/lib/esm/abort-controller.mjs +4 -2
- package/dist/lib/esm/array.mjs +3 -1
- package/dist/lib/esm/async-events.mjs +5 -3
- package/dist/lib/esm/async.mjs +4 -2
- package/dist/lib/esm/blob.mjs +4 -2
- package/dist/lib/esm/codemirror/index.mjs +3 -1
- package/dist/lib/esm/codemirror/state-field-spec.mjs +2 -0
- package/dist/lib/esm/css-class.mjs +3 -1
- package/dist/lib/esm/debug-controller.mjs +2 -0
- package/dist/lib/esm/debug.mjs +3 -1
- package/dist/lib/esm/enum.mjs +3 -1
- package/dist/lib/esm/error.mjs +3 -1
- package/dist/lib/esm/function.mjs +3 -1
- package/dist/lib/esm/html-element.mjs +16 -14
- package/dist/lib/esm/index.mjs +3 -1
- package/dist/lib/esm/library.mjs +4 -2
- package/dist/lib/esm/object-utils.mjs +3 -1
- package/dist/lib/esm/obsidian/@types/i18next.d.mts +3 -3
- package/dist/lib/esm/obsidian/app.mjs +3 -1
- package/dist/lib/esm/obsidian/async-with-notice.mjs +6 -4
- package/dist/lib/esm/obsidian/attachment-path.mjs +3 -1
- package/dist/lib/esm/obsidian/backlink.mjs +3 -1
- package/dist/lib/esm/obsidian/callout.mjs +3 -1
- package/dist/lib/esm/obsidian/code-block-markdown-information.mjs +2 -0
- package/dist/lib/esm/obsidian/command-handlers/abstract-file-command-handler.d.mts +178 -0
- package/dist/lib/esm/obsidian/command-handlers/abstract-file-command-handler.mjs +247 -0
- package/dist/lib/esm/obsidian/command-handlers/app-active-file-provider.d.mts +25 -0
- package/dist/lib/esm/obsidian/command-handlers/app-active-file-provider.mjs +46 -0
- package/dist/lib/esm/obsidian/command-handlers/app-menu-event-registrar.d.mts +41 -0
- package/dist/lib/esm/obsidian/command-handlers/app-menu-event-registrar.mjs +65 -0
- package/dist/lib/esm/obsidian/command-handlers/command-handler-component.d.mts +26 -0
- package/dist/lib/esm/obsidian/command-handlers/command-handler-component.mjs +56 -0
- package/dist/lib/esm/obsidian/command-handlers/command-handler.d.mts +143 -0
- package/dist/lib/esm/obsidian/command-handlers/command-handler.mjs +66 -0
- package/dist/lib/esm/obsidian/command-handlers/editor-command-handler.d.mts +114 -0
- package/dist/lib/esm/obsidian/command-handlers/editor-command-handler.mjs +161 -0
- package/dist/lib/esm/obsidian/command-handlers/file-command-handler.d.mts +112 -0
- package/dist/lib/esm/obsidian/command-handlers/file-command-handler.mjs +157 -0
- package/dist/lib/esm/obsidian/command-handlers/folder-command-handler.d.mts +112 -0
- package/dist/lib/esm/obsidian/command-handlers/folder-command-handler.mjs +157 -0
- package/dist/lib/esm/obsidian/command-handlers/global-command-handler.d.mts +38 -0
- package/dist/lib/esm/obsidian/command-handlers/global-command-handler.mjs +69 -0
- package/dist/lib/esm/obsidian/command-handlers/index.d.mts +9 -0
- package/dist/lib/esm/obsidian/command-handlers/index.mjs +44 -0
- package/dist/lib/esm/obsidian/components/all-windows-event-handler.mjs +4 -2
- package/dist/lib/esm/obsidian/components/async-component.d.mts +28 -0
- package/dist/lib/esm/obsidian/components/async-component.mjs +56 -0
- package/dist/lib/esm/obsidian/components/async-events-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/index.d.mts +1 -0
- package/dist/lib/esm/obsidian/components/index.mjs +5 -1
- package/dist/lib/esm/obsidian/components/setting-components/checkbox-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/code-highlighter-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/date-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/date-time-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/email-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/file-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/index.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/month-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/multiple-dropdown-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/multiple-email-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/multiple-file-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/multiple-text-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/number-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/password-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/setting-component-wrapper.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/telephone-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/text-based-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/time-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/tri-state-checkbox-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/typed-dropdown-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/typed-multiple-dropdown-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/typed-range-text-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/typed-text-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/url-component.mjs +3 -1
- package/dist/lib/esm/obsidian/components/setting-components/validator-component.mjs +5 -3
- package/dist/lib/esm/obsidian/components/setting-components/value-component-with-change-tracking.mjs +2 -0
- package/dist/lib/esm/obsidian/components/setting-components/week-component.mjs +3 -1
- package/dist/lib/esm/obsidian/constructors/getDomEventsHandlersConstructor.mjs +3 -1
- package/dist/lib/esm/obsidian/constructors/index.mjs +3 -1
- package/dist/lib/esm/obsidian/dataview-link.mjs +3 -1
- package/dist/lib/esm/obsidian/dataview.mjs +4 -2
- package/dist/lib/esm/obsidian/editor.mjs +3 -1
- package/dist/lib/esm/obsidian/file-change.mjs +3 -1
- package/dist/lib/esm/obsidian/file-manager.mjs +3 -1
- package/dist/lib/esm/obsidian/file-system.mjs +3 -1
- package/dist/lib/esm/obsidian/frontmatter-link-cache-with-offsets.mjs +3 -1
- package/dist/lib/esm/obsidian/frontmatter.mjs +3 -1
- package/dist/lib/esm/obsidian/i18n/custom-type-options.d.mts +37 -0
- package/dist/lib/esm/obsidian/i18n/custom-type-options.mjs +25 -0
- package/dist/lib/esm/obsidian/i18n/default-translations.d.mts +14 -0
- package/dist/lib/esm/obsidian/i18n/default-translations.mjs +25 -0
- package/dist/lib/esm/obsidian/i18n/i18n.d.mts +2 -13
- package/dist/lib/esm/obsidian/i18n/i18n.mjs +3 -1
- package/dist/lib/esm/obsidian/i18n/index.d.mts +2 -2
- package/dist/lib/esm/obsidian/i18n/index.mjs +7 -5
- package/dist/lib/esm/obsidian/i18n/locales/en.mjs +3 -1
- package/dist/lib/esm/obsidian/i18n/locales/index.mjs +3 -1
- package/dist/lib/esm/obsidian/i18n/locales/translations-map.d.mts +1 -2
- package/dist/lib/esm/obsidian/i18n/locales/translations-map.mjs +3 -1
- package/dist/lib/esm/obsidian/index.d.mts +1 -1
- package/dist/lib/esm/obsidian/index.mjs +5 -3
- package/dist/lib/esm/obsidian/is-in-obsidian.mjs +3 -1
- package/dist/lib/esm/obsidian/link.mjs +3 -1
- package/dist/lib/esm/obsidian/logger.mjs +3 -1
- package/dist/lib/esm/obsidian/loop.mjs +3 -1
- package/dist/lib/esm/obsidian/markdown-code-block-processor.mjs +3 -1
- package/dist/lib/esm/obsidian/markdown-view.mjs +3 -1
- package/dist/lib/esm/obsidian/markdown.mjs +3 -1
- package/dist/lib/esm/obsidian/metadata-cache.mjs +3 -1
- package/dist/lib/esm/obsidian/modals/alert.mjs +4 -2
- package/dist/lib/esm/obsidian/modals/confirm.mjs +4 -2
- package/dist/lib/esm/obsidian/modals/index.d.mts +1 -1
- package/dist/lib/esm/obsidian/modals/index.mjs +5 -3
- package/dist/lib/esm/obsidian/modals/modal.mjs +54 -0
- package/dist/lib/esm/obsidian/modals/prompt.mjs +4 -2
- package/dist/lib/esm/obsidian/modals/select-item.mjs +4 -2
- package/dist/lib/esm/obsidian/monkey-around.mjs +3 -1
- package/dist/lib/esm/obsidian/obsidian-settings.mjs +3 -1
- package/dist/lib/esm/obsidian/pdf.mjs +6 -4
- package/dist/lib/esm/obsidian/plugin/components/abort-signal-component.d.mts +27 -0
- package/dist/lib/esm/obsidian/plugin/components/abort-signal-component.mjs +54 -0
- package/dist/lib/esm/obsidian/plugin/components/async-error-handler-component.d.mts +29 -0
- package/dist/lib/esm/obsidian/plugin/components/async-error-handler-component.mjs +57 -0
- package/dist/lib/esm/obsidian/plugin/components/console-debug-component.d.mts +29 -0
- package/dist/lib/esm/obsidian/plugin/components/console-debug-component.mjs +52 -0
- package/dist/lib/esm/obsidian/plugin/components/i18n-component.d.mts +23 -0
- package/dist/lib/esm/obsidian/plugin/components/i18n-component.mjs +48 -0
- package/dist/lib/esm/obsidian/plugin/components/index.d.mts +9 -0
- package/dist/lib/esm/obsidian/plugin/components/index.mjs +44 -0
- package/dist/lib/esm/obsidian/plugin/components/lifecycle-events-component.d.mts +59 -0
- package/dist/lib/esm/obsidian/plugin/components/lifecycle-events-component.mjs +102 -0
- package/dist/lib/esm/obsidian/plugin/components/plugin-context-component.d.mts +25 -0
- package/dist/lib/esm/obsidian/plugin/components/plugin-context-component.mjs +57 -0
- package/dist/lib/esm/obsidian/plugin/components/plugin-notice-component.d.mts +25 -0
- package/dist/lib/esm/obsidian/plugin/components/plugin-notice-component.mjs +56 -0
- package/dist/lib/esm/obsidian/plugin/components/plugin-settings-component.d.mts +296 -0
- package/dist/lib/esm/obsidian/plugin/components/plugin-settings-component.mjs +463 -0
- package/dist/lib/esm/obsidian/plugin/components/plugin-settings-tab-component.d.mts +28 -0
- package/dist/lib/esm/obsidian/plugin/components/plugin-settings-tab-component.mjs +58 -0
- package/dist/lib/esm/obsidian/plugin/index.d.mts +2 -5
- package/dist/lib/esm/obsidian/plugin/index.mjs +7 -11
- package/dist/lib/esm/obsidian/plugin/obsidian-plugin-repo-paths.mjs +3 -1
- package/dist/lib/esm/obsidian/plugin/path-settings.mjs +3 -1
- package/dist/lib/esm/obsidian/plugin/plugin-context.d.mts +3 -2
- package/dist/lib/esm/obsidian/plugin/plugin-context.mjs +14 -5
- package/dist/lib/esm/obsidian/plugin/plugin-id.mjs +3 -1
- package/dist/lib/esm/obsidian/plugin/{plugin-settings-tab-base.d.mts → plugin-settings-tab.d.mts} +28 -11
- package/dist/lib/esm/obsidian/plugin/plugin-settings-tab.mjs +309 -0
- package/dist/lib/esm/obsidian/plugin/plugin.d.mts +106 -5
- package/dist/lib/esm/obsidian/plugin/plugin.mjs +140 -2
- package/dist/lib/esm/obsidian/queue.mjs +3 -1
- package/dist/lib/esm/obsidian/react/app-context.mjs +3 -1
- package/dist/lib/esm/obsidian/react/index.mjs +3 -1
- package/dist/lib/esm/obsidian/reference.mjs +3 -1
- package/dist/lib/esm/obsidian/rename-delete-handler.mjs +3 -1
- package/dist/lib/esm/obsidian/resource-url.mjs +3 -1
- package/dist/lib/esm/obsidian/setting-ex.mjs +3 -1
- package/dist/lib/esm/obsidian/setting-group-ex.mjs +3 -1
- package/dist/lib/esm/obsidian/validation.mjs +3 -1
- package/dist/lib/esm/obsidian/vault-delete.mjs +3 -1
- package/dist/lib/esm/obsidian/vault.mjs +3 -1
- package/dist/lib/esm/obsidian/workspace.mjs +3 -1
- package/dist/lib/esm/path.mjs +3 -1
- package/dist/lib/esm/reg-exp.mjs +3 -1
- package/dist/lib/esm/script-utils/build.mjs +3 -1
- package/dist/lib/esm/script-utils/bundlers/esbuild-impl/change-extension-plugin.mjs +3 -1
- package/dist/lib/esm/script-utils/bundlers/esbuild-impl/copy-to-obsidian-plugins-folder-plugin.mjs +3 -1
- package/dist/lib/esm/script-utils/bundlers/esbuild-impl/custom-esbuild-options-plugin.mjs +3 -1
- package/dist/lib/esm/script-utils/bundlers/esbuild-impl/dependency.mjs +3 -1
- package/dist/lib/esm/script-utils/bundlers/esbuild-impl/fix-esm-plugin.mjs +3 -1
- package/dist/lib/esm/script-utils/bundlers/esbuild-impl/fix-source-maps-plugin.mjs +3 -1
- package/dist/lib/esm/script-utils/bundlers/esbuild-impl/index.mjs +3 -1
- package/dist/lib/esm/script-utils/bundlers/esbuild-impl/obsidian-plugin-builder.mjs +3 -1
- package/dist/lib/esm/script-utils/bundlers/esbuild-impl/preprocess-plugin.mjs +5 -3
- package/dist/lib/esm/script-utils/bundlers/esbuild-impl/rename-css-plugin.mjs +3 -1
- package/dist/lib/esm/script-utils/bundlers/esbuild-impl/svelte-wrapper-plugin.mjs +3 -1
- package/dist/lib/esm/script-utils/bundlers/esbuild.mjs +3 -1
- package/dist/lib/esm/script-utils/bundlers/index.mjs +3 -1
- package/dist/lib/esm/script-utils/cli-utils.mjs +3 -1
- package/dist/lib/esm/script-utils/code-generator.mjs +3 -1
- package/dist/lib/esm/script-utils/commitlint-config.mjs +3 -1
- package/dist/lib/esm/script-utils/exec.mjs +3 -1
- package/dist/lib/esm/script-utils/formatters/dprint.mjs +3 -1
- package/dist/lib/esm/script-utils/formatters/index.mjs +3 -1
- package/dist/lib/esm/script-utils/fs.mjs +3 -1
- package/dist/lib/esm/script-utils/index.mjs +3 -1
- package/dist/lib/esm/script-utils/json.mjs +3 -1
- package/dist/lib/esm/script-utils/linters/cspell.mjs +3 -1
- package/dist/lib/esm/script-utils/linters/eslint-config.mjs +5 -11
- package/dist/lib/esm/script-utils/linters/eslint-rules/index.mjs +3 -1
- package/dist/lib/esm/script-utils/linters/eslint-rules/no-async-callback-to-unsafe-return.mjs +3 -1
- package/dist/lib/esm/script-utils/linters/eslint-rules/no-used-underscore-variables.mjs +3 -1
- package/dist/lib/esm/script-utils/linters/eslint-rules/obsidian-dev-utils-plugin.mjs +3 -1
- package/dist/lib/esm/script-utils/linters/eslint-rules/rule-tester-helper.mjs +3 -1
- package/dist/lib/esm/script-utils/linters/eslint.mjs +3 -1
- package/dist/lib/esm/script-utils/linters/index.mjs +3 -1
- package/dist/lib/esm/script-utils/linters/markdownlint-cli2-config.mjs +3 -1
- package/dist/lib/esm/script-utils/linters/markdownlint.mjs +6 -2
- package/dist/lib/esm/script-utils/nano-staged-config.mjs +3 -1
- package/dist/lib/esm/script-utils/npm-publish.mjs +3 -1
- package/dist/lib/esm/script-utils/npm-run.mjs +3 -1
- package/dist/lib/esm/script-utils/npm.mjs +3 -1
- package/dist/lib/esm/script-utils/obsidian-dev-utils-repo-paths.mjs +3 -1
- package/dist/lib/esm/script-utils/root.mjs +3 -1
- package/dist/lib/esm/script-utils/test-runners/index.mjs +3 -1
- package/dist/lib/esm/script-utils/test-runners/vitest.mjs +3 -1
- package/dist/lib/esm/script-utils/version.mjs +3 -1
- package/dist/lib/esm/strict-proxy.mjs +3 -1
- package/dist/lib/esm/string.mjs +3 -1
- package/dist/lib/esm/transformers/date-transformer.mjs +3 -1
- package/dist/lib/esm/transformers/duration-transformer.mjs +3 -1
- package/dist/lib/esm/transformers/group-transformer.mjs +3 -1
- package/dist/lib/esm/transformers/index.mjs +3 -1
- package/dist/lib/esm/transformers/map-transformer.mjs +3 -1
- package/dist/lib/esm/transformers/set-transformer.mjs +3 -1
- package/dist/lib/esm/transformers/skip-private-property-transformer.mjs +3 -1
- package/dist/lib/esm/transformers/transformer.mjs +3 -1
- package/dist/lib/esm/transformers/two-way-map-transformer.mjs +3 -1
- package/dist/lib/esm/transformers/typed-transformer.mjs +3 -1
- package/dist/lib/esm/two-way-map.mjs +3 -1
- package/dist/lib/esm/type-guards.mjs +3 -1
- package/dist/lib/esm/type.mjs +3 -1
- package/dist/lib/esm/url.mjs +3 -1
- package/dist/lib/esm/value-provider.mjs +3 -1
- package/obsidian/Components/async-component/package.json +6 -0
- package/obsidian/Modals/modal/package.json +6 -0
- package/obsidian/Plugin/components/abort-signal-component/package.json +6 -0
- package/obsidian/Plugin/components/async-error-handler-component/package.json +6 -0
- package/obsidian/Plugin/components/console-debug-component/package.json +6 -0
- package/obsidian/Plugin/components/i18n-component/package.json +6 -0
- package/obsidian/Plugin/components/index/package.json +6 -0
- package/obsidian/Plugin/components/lifecycle-events-component/package.json +6 -0
- package/obsidian/Plugin/components/package.json +6 -0
- package/obsidian/Plugin/components/plugin-context-component/package.json +6 -0
- package/obsidian/Plugin/components/plugin-notice-component/package.json +6 -0
- package/obsidian/Plugin/components/plugin-settings-component/package.json +6 -0
- package/obsidian/Plugin/components/plugin-settings-tab-component/package.json +6 -0
- package/obsidian/Plugin/{plugin-settings-wrapper → plugin-settings-tab}/package.json +3 -3
- package/obsidian/command-handlers/abstract-file-command-handler/package.json +6 -0
- package/obsidian/command-handlers/app-active-file-provider/package.json +6 -0
- package/obsidian/command-handlers/app-menu-event-registrar/package.json +6 -0
- package/obsidian/command-handlers/command-handler/package.json +6 -0
- package/obsidian/command-handlers/command-handler-component/package.json +6 -0
- package/obsidian/command-handlers/editor-command-handler/package.json +6 -0
- package/obsidian/command-handlers/file-command-handler/package.json +6 -0
- package/obsidian/command-handlers/folder-command-handler/package.json +6 -0
- package/obsidian/command-handlers/global-command-handler/package.json +6 -0
- package/obsidian/command-handlers/index/package.json +6 -0
- package/obsidian/command-handlers/package.json +6 -0
- package/obsidian/i18n/{custom-type-options-base → custom-type-options}/package.json +3 -3
- package/obsidian/i18n/{default-translations-base → default-translations}/package.json +3 -3
- package/package.json +33 -12
- package/dist/lib/cjs/obsidian/commands/abstract-file-command-base.cjs +0 -439
- package/dist/lib/cjs/obsidian/commands/abstract-file-command-base.d.cts +0 -264
- package/dist/lib/cjs/obsidian/commands/command-base.cjs +0 -253
- package/dist/lib/cjs/obsidian/commands/command-base.d.cts +0 -125
- package/dist/lib/cjs/obsidian/commands/editor-command-base.cjs +0 -280
- package/dist/lib/cjs/obsidian/commands/editor-command-base.d.cts +0 -139
- package/dist/lib/cjs/obsidian/commands/file-command-base.cjs +0 -341
- package/dist/lib/cjs/obsidian/commands/file-command-base.d.cts +0 -191
- package/dist/lib/cjs/obsidian/commands/folder-command-base.cjs +0 -333
- package/dist/lib/cjs/obsidian/commands/folder-command-base.d.cts +0 -184
- package/dist/lib/cjs/obsidian/commands/index.d.cts +0 -6
- package/dist/lib/cjs/obsidian/commands/non-editor-command-base.d.cts +0 -34
- package/dist/lib/cjs/obsidian/i18n/custom-type-options-base.d.cts +0 -37
- package/dist/lib/cjs/obsidian/i18n/default-translations-base.d.cts +0 -25
- package/dist/lib/cjs/obsidian/plugin/plugin-base.cjs +0 -407
- package/dist/lib/cjs/obsidian/plugin/plugin-base.d.cts +0 -176
- package/dist/lib/cjs/obsidian/plugin/plugin-settings-manager-base.cjs +0 -484
- package/dist/lib/cjs/obsidian/plugin/plugin-settings-manager-base.d.cts +0 -186
- package/dist/lib/cjs/obsidian/plugin/plugin-settings-tab-base.cjs +0 -399
- package/dist/lib/cjs/obsidian/plugin/plugin-settings-wrapper.d.cts +0 -25
- package/dist/lib/cjs/obsidian/plugin/plugin-types-base.cjs +0 -120
- package/dist/lib/cjs/obsidian/plugin/plugin-types-base.d.cts +0 -87
- package/dist/lib/esm/obsidian/commands/abstract-file-command-base.d.mts +0 -264
- package/dist/lib/esm/obsidian/commands/abstract-file-command-base.mjs +0 -329
- package/dist/lib/esm/obsidian/commands/command-base.d.mts +0 -125
- package/dist/lib/esm/obsidian/commands/command-base.mjs +0 -146
- package/dist/lib/esm/obsidian/commands/editor-command-base.d.mts +0 -139
- package/dist/lib/esm/obsidian/commands/editor-command-base.mjs +0 -176
- package/dist/lib/esm/obsidian/commands/file-command-base.d.mts +0 -191
- package/dist/lib/esm/obsidian/commands/file-command-base.mjs +0 -240
- package/dist/lib/esm/obsidian/commands/folder-command-base.d.mts +0 -184
- package/dist/lib/esm/obsidian/commands/folder-command-base.mjs +0 -232
- package/dist/lib/esm/obsidian/commands/index.d.mts +0 -6
- package/dist/lib/esm/obsidian/commands/index.mjs +0 -36
- package/dist/lib/esm/obsidian/commands/non-editor-command-base.d.mts +0 -34
- package/dist/lib/esm/obsidian/commands/non-editor-command-base.mjs +0 -46
- package/dist/lib/esm/obsidian/i18n/custom-type-options-base.d.mts +0 -37
- package/dist/lib/esm/obsidian/i18n/custom-type-options-base.mjs +0 -23
- package/dist/lib/esm/obsidian/i18n/default-translations-base.d.mts +0 -25
- package/dist/lib/esm/obsidian/i18n/default-translations-base.mjs +0 -23
- package/dist/lib/esm/obsidian/modals/modal-base.mjs +0 -52
- package/dist/lib/esm/obsidian/plugin/plugin-base.d.mts +0 -176
- package/dist/lib/esm/obsidian/plugin/plugin-base.mjs +0 -317
- package/dist/lib/esm/obsidian/plugin/plugin-settings-manager-base.d.mts +0 -186
- package/dist/lib/esm/obsidian/plugin/plugin-settings-manager-base.mjs +0 -385
- package/dist/lib/esm/obsidian/plugin/plugin-settings-tab-base.mjs +0 -302
- package/dist/lib/esm/obsidian/plugin/plugin-settings-wrapper.d.mts +0 -25
- package/dist/lib/esm/obsidian/plugin/plugin-settings-wrapper.mjs +0 -22
- package/dist/lib/esm/obsidian/plugin/plugin-types-base.d.mts +0 -87
- package/dist/lib/esm/obsidian/plugin/plugin-types-base.mjs +0 -22
- package/obsidian/Commands/abstract-file-command-base/package.json +0 -6
- package/obsidian/Commands/command-base/package.json +0 -6
- package/obsidian/Commands/editor-command-base/package.json +0 -6
- package/obsidian/Commands/file-command-base/package.json +0 -6
- package/obsidian/Commands/folder-command-base/package.json +0 -6
- package/obsidian/Commands/index/package.json +0 -6
- package/obsidian/Commands/non-editor-command-base/package.json +0 -6
- package/obsidian/Commands/package.json +0 -6
- package/obsidian/Modals/modal-base/package.json +0 -6
- package/obsidian/Plugin/plugin-base/package.json +0 -6
- package/obsidian/Plugin/plugin-settings-manager-base/package.json +0 -6
- package/obsidian/Plugin/plugin-settings-tab-base/package.json +0 -6
- package/obsidian/Plugin/plugin-types-base/package.json +0 -6
- /package/dist/lib/cjs/obsidian/modals/{modal-base.d.cts → modal.d.cts} +0 -0
- /package/dist/lib/esm/obsidian/modals/{modal-base.d.mts → modal.d.mts} +0 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
/*
|
|
2
|
+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
3
|
+
if you want to view the source, please visit the github repository of this plugin
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function initCjs() {
|
|
7
|
+
// eslint-disable-next-line obsidianmd/prefer-active-doc -- Actively use globalThis.
|
|
8
|
+
const globalThisRecord = globalThis;
|
|
9
|
+
globalThisRecord['__name'] ??= name;
|
|
10
|
+
const originalRequire = require;
|
|
11
|
+
if (originalRequire && !originalRequire.__isPatched) {
|
|
12
|
+
// eslint-disable-next-line no-global-assign, no-implicit-globals -- We need to patch the `require()` function.
|
|
13
|
+
require = Object.assign(
|
|
14
|
+
(id) => requirePatched(id),
|
|
15
|
+
originalRequire,
|
|
16
|
+
{
|
|
17
|
+
__isPatched: true
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const newFuncs = {
|
|
23
|
+
__extractDefault() {
|
|
24
|
+
return extractDefault;
|
|
25
|
+
},
|
|
26
|
+
process() {
|
|
27
|
+
const browserProcess = {
|
|
28
|
+
browser: true,
|
|
29
|
+
cwd() {
|
|
30
|
+
return '/';
|
|
31
|
+
},
|
|
32
|
+
env: {},
|
|
33
|
+
platform: 'android'
|
|
34
|
+
};
|
|
35
|
+
return browserProcess;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
for (const key of Object.keys(newFuncs)) {
|
|
40
|
+
globalThisRecord[key] ??= newFuncs[key]?.();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function name(obj) {
|
|
44
|
+
return obj;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function extractDefault(module) {
|
|
48
|
+
return module && module.__esModule && 'default' in module ? module.default : module;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const OBSIDIAN_BUILT_IN_MODULE_NAMES = [
|
|
52
|
+
'obsidian',
|
|
53
|
+
'@codemirror/autocomplete',
|
|
54
|
+
'@codemirror/collab',
|
|
55
|
+
'@codemirror/commands',
|
|
56
|
+
'@codemirror/language',
|
|
57
|
+
'@codemirror/lint',
|
|
58
|
+
'@codemirror/search',
|
|
59
|
+
'@codemirror/state',
|
|
60
|
+
'@codemirror/text',
|
|
61
|
+
'@codemirror/view',
|
|
62
|
+
'@lezer/common',
|
|
63
|
+
'@lezer/lr',
|
|
64
|
+
'@lezer/highlight'];
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
const DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES = [
|
|
68
|
+
'@codemirror/closebrackets',
|
|
69
|
+
'@codemirror/comment',
|
|
70
|
+
'@codemirror/fold',
|
|
71
|
+
'@codemirror/gutter',
|
|
72
|
+
'@codemirror/highlight',
|
|
73
|
+
'@codemirror/history',
|
|
74
|
+
'@codemirror/matchbrackets',
|
|
75
|
+
'@codemirror/panel',
|
|
76
|
+
'@codemirror/rangeset',
|
|
77
|
+
'@codemirror/rectangular-selection',
|
|
78
|
+
'@codemirror/stream-parser',
|
|
79
|
+
'@codemirror/tooltip'];
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
function requirePatched(id) {
|
|
83
|
+
if (OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id) || DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id)) {
|
|
84
|
+
return originalRequire?.(id);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated, obsidianmd/prefer-active-doc -- Need access to app. Actively use globalThis.
|
|
88
|
+
if (globalThis.app.isMobile) {
|
|
89
|
+
if (id === 'process' || id === 'node:process') {
|
|
90
|
+
// eslint-disable-next-line no-console -- Valid usage.
|
|
91
|
+
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Fake process object is returned instead.`);
|
|
92
|
+
// eslint-disable-next-line obsidianmd/prefer-active-doc -- Actively use globalThis.
|
|
93
|
+
return globalThis.process;
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
const module = originalRequire?.(id);
|
|
97
|
+
if (module) {
|
|
98
|
+
return extractDefault(module);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// eslint-disable-next-line no-console -- Valid usage.
|
|
103
|
+
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Empty object is returned instead.`);
|
|
104
|
+
return {};
|
|
105
|
+
}
|
|
106
|
+
})();
|
|
107
|
+
|
|
108
|
+
"use strict";
|
|
109
|
+
var __defProp = Object.defineProperty;
|
|
110
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
111
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
112
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
113
|
+
var __export = (target, all) => {
|
|
114
|
+
for (var name in all)
|
|
115
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
116
|
+
};
|
|
117
|
+
var __copyProps = (to, from, except, desc) => {
|
|
118
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
119
|
+
for (let key of __getOwnPropNames(from))
|
|
120
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
121
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
122
|
+
}
|
|
123
|
+
return to;
|
|
124
|
+
};
|
|
125
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
126
|
+
var abstract_file_command_handler_exports = {};
|
|
127
|
+
__export(abstract_file_command_handler_exports, {
|
|
128
|
+
AbstractFileCommandHandler: () => AbstractFileCommandHandler
|
|
129
|
+
});
|
|
130
|
+
module.exports = __toCommonJS(abstract_file_command_handler_exports);
|
|
131
|
+
var import_async = require('../../async.cjs');
|
|
132
|
+
var import_global_command_handler = require('./global-command-handler.cjs');
|
|
133
|
+
class AbstractFileCommandHandler extends import_global_command_handler.GlobalCommandHandler {
|
|
134
|
+
/**
|
|
135
|
+
* Gets the item name to use in the single-file menu.
|
|
136
|
+
*
|
|
137
|
+
* @returns The item name, or `undefined` to use the command name.
|
|
138
|
+
*/
|
|
139
|
+
get fileMenuItemName() {
|
|
140
|
+
return this._fileMenuItemName;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Gets the section to use in the single-file menu.
|
|
144
|
+
*
|
|
145
|
+
* @returns The section name, or `undefined` to use the plugin name.
|
|
146
|
+
*/
|
|
147
|
+
get fileMenuSection() {
|
|
148
|
+
return this._fileMenuSection;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Gets the icon to use in the single-file menu submenu.
|
|
152
|
+
*
|
|
153
|
+
* @returns The icon, or `undefined` for no icon.
|
|
154
|
+
*/
|
|
155
|
+
get fileMenuSubmenuIcon() {
|
|
156
|
+
return this._fileMenuSubmenuIcon;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Gets the item name to use in the multi-file menu.
|
|
160
|
+
*
|
|
161
|
+
* @returns The item name, or `undefined` to fall back to single-file item name.
|
|
162
|
+
*/
|
|
163
|
+
get filesMenuItemName() {
|
|
164
|
+
return this._filesMenuItemName;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Gets the section to use in the multi-file menu.
|
|
168
|
+
*
|
|
169
|
+
* @returns The section name, or `undefined` to fall back to single-file section.
|
|
170
|
+
*/
|
|
171
|
+
get filesMenuSection() {
|
|
172
|
+
return this._filesMenuSection;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Gets the icon to use in the multi-file menu submenu.
|
|
176
|
+
*
|
|
177
|
+
* @returns The icon, or `undefined` to fall back to single-file submenu icon.
|
|
178
|
+
*/
|
|
179
|
+
get filesMenuSubmenuIcon() {
|
|
180
|
+
return this._filesMenuSubmenuIcon;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Gets whether to add the command to a submenu.
|
|
184
|
+
*
|
|
185
|
+
* @returns Whether to add to a submenu.
|
|
186
|
+
*/
|
|
187
|
+
get shouldAddCommandToSubmenu() {
|
|
188
|
+
return this._shouldAddCommandToSubmenu;
|
|
189
|
+
}
|
|
190
|
+
_fileMenuItemName;
|
|
191
|
+
_fileMenuSection;
|
|
192
|
+
_fileMenuSubmenuIcon;
|
|
193
|
+
_filesMenuItemName;
|
|
194
|
+
_filesMenuSection;
|
|
195
|
+
_filesMenuSubmenuIcon;
|
|
196
|
+
_shouldAddCommandToSubmenu;
|
|
197
|
+
activeFileProvider;
|
|
198
|
+
/**
|
|
199
|
+
* Creates a new abstract file command handler.
|
|
200
|
+
*
|
|
201
|
+
* @param params - The parameters for the abstract file command handler.
|
|
202
|
+
*/
|
|
203
|
+
constructor(params) {
|
|
204
|
+
super(params);
|
|
205
|
+
this._fileMenuItemName = params.fileMenuItemName;
|
|
206
|
+
this._fileMenuSection = params.fileMenuSection;
|
|
207
|
+
this._fileMenuSubmenuIcon = params.fileMenuSubmenuIcon;
|
|
208
|
+
this._filesMenuItemName = params.filesMenuItemName;
|
|
209
|
+
this._filesMenuSection = params.filesMenuSection;
|
|
210
|
+
this._filesMenuSubmenuIcon = params.filesMenuSubmenuIcon;
|
|
211
|
+
this._shouldAddCommandToSubmenu = params.shouldAddCommandToSubmenu;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Registers file-menu and files-menu event handlers.
|
|
215
|
+
*
|
|
216
|
+
* @param context - The registration context.
|
|
217
|
+
*/
|
|
218
|
+
async onRegistered(context) {
|
|
219
|
+
await super.onRegistered(context);
|
|
220
|
+
this.activeFileProvider = context.activeFileProvider;
|
|
221
|
+
context.menuEventRegistrar.registerFileMenuEventHandler(this.handleAbstractFileMenu.bind(this));
|
|
222
|
+
context.menuEventRegistrar.registerFilesMenuEventHandler(this.handleAbstractFilesMenu.bind(this));
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Checks whether the command can execute from the command palette.
|
|
226
|
+
* Uses the active file as the target.
|
|
227
|
+
*
|
|
228
|
+
* @returns Whether the command can execute.
|
|
229
|
+
*/
|
|
230
|
+
canExecute() {
|
|
231
|
+
if (!this.shouldAddToCommandPalette()) {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
const activeFile = this.getActiveFile();
|
|
235
|
+
return !!activeFile && this.canExecuteAbstractFile(activeFile);
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Checks whether the command can execute for a single abstract file.
|
|
239
|
+
*
|
|
240
|
+
* @param _abstractFile - The file or folder.
|
|
241
|
+
* @returns Whether the command can execute.
|
|
242
|
+
*/
|
|
243
|
+
canExecuteAbstractFile(_abstractFile) {
|
|
244
|
+
return true;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Checks whether the command can execute for multiple abstract files.
|
|
248
|
+
* Default implementation checks each file individually.
|
|
249
|
+
*
|
|
250
|
+
* @param abstractFiles - The files or folders.
|
|
251
|
+
* @returns Whether the command can execute.
|
|
252
|
+
*/
|
|
253
|
+
canExecuteAbstractFiles(abstractFiles) {
|
|
254
|
+
return abstractFiles.length > 0 && abstractFiles.every((f) => this.canExecuteAbstractFile(f));
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Executes the command from the command palette using the active file.
|
|
258
|
+
*/
|
|
259
|
+
async execute() {
|
|
260
|
+
const activeFile = this.getActiveFile();
|
|
261
|
+
if (activeFile) {
|
|
262
|
+
await this.executeAbstractFile(activeFile);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Executes the command for multiple abstract files.
|
|
267
|
+
* Default implementation executes sequentially.
|
|
268
|
+
*
|
|
269
|
+
* @param abstractFiles - The files or folders.
|
|
270
|
+
*/
|
|
271
|
+
async executeAbstractFiles(abstractFiles) {
|
|
272
|
+
for (const file of abstractFiles) {
|
|
273
|
+
await this.executeAbstractFile(file);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Checks whether the command should appear in the single-file context menu.
|
|
278
|
+
*
|
|
279
|
+
* @param _abstractFile - The file or folder.
|
|
280
|
+
* @param _source - The source of the event.
|
|
281
|
+
* @param _leaf - The workspace leaf, if available.
|
|
282
|
+
* @returns Whether to add to the file menu.
|
|
283
|
+
*/
|
|
284
|
+
shouldAddToAbstractFileMenu(_abstractFile, _source, _leaf) {
|
|
285
|
+
return false;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Checks whether the command should appear in the multi-file context menu.
|
|
289
|
+
* Default implementation checks each file individually.
|
|
290
|
+
*
|
|
291
|
+
* @param abstractFiles - The files or folders.
|
|
292
|
+
* @param source - The source of the event.
|
|
293
|
+
* @param leaf - The workspace leaf, if available.
|
|
294
|
+
* @returns Whether to add to the files menu.
|
|
295
|
+
*/
|
|
296
|
+
shouldAddToAbstractFilesMenu(abstractFiles, source, leaf) {
|
|
297
|
+
return abstractFiles.every((f) => this.shouldAddToAbstractFileMenu(f, source, leaf));
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Checks whether the command should appear in the command palette.
|
|
301
|
+
*
|
|
302
|
+
* @returns Whether to add to the command palette.
|
|
303
|
+
*/
|
|
304
|
+
shouldAddToCommandPalette() {
|
|
305
|
+
return true;
|
|
306
|
+
}
|
|
307
|
+
getActiveFile() {
|
|
308
|
+
return this.activeFileProvider?.getActiveFile() ?? null;
|
|
309
|
+
}
|
|
310
|
+
handleAbstractFileMenu(menu, abstractFile, source, leaf) {
|
|
311
|
+
if (!this.shouldAddToAbstractFileMenu(abstractFile, source, leaf)) {
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
if (!this.canExecuteAbstractFile(abstractFile)) {
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
const section = this.fileMenuSection ?? this.pluginName;
|
|
318
|
+
if (this.shouldAddCommandToSubmenu) {
|
|
319
|
+
menu.setSectionSubmenu(section, {
|
|
320
|
+
icon: this.fileMenuSubmenuIcon ?? "",
|
|
321
|
+
title: section
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
menu.addItem((item) => {
|
|
325
|
+
item.setTitle(this.fileMenuItemName ?? this.name).setIcon(this.icon).setSection(section).onClick(() => {
|
|
326
|
+
(0, import_async.invokeAsyncSafely)(() => this.executeAbstractFile(abstractFile));
|
|
327
|
+
});
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
handleAbstractFilesMenu(menu, abstractFiles, source, leaf) {
|
|
331
|
+
if (!this.shouldAddToAbstractFilesMenu(abstractFiles, source, leaf)) {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
if (!this.canExecuteAbstractFiles(abstractFiles)) {
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
const section = this.filesMenuSection ?? this.fileMenuSection ?? this.pluginName;
|
|
338
|
+
if (this.shouldAddCommandToSubmenu) {
|
|
339
|
+
menu.setSectionSubmenu(section, {
|
|
340
|
+
icon: this.filesMenuSubmenuIcon ?? this.fileMenuSubmenuIcon ?? "",
|
|
341
|
+
title: section
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
menu.addItem((item) => {
|
|
345
|
+
item.setTitle(this.filesMenuItemName ?? this.fileMenuItemName ?? this.name).setIcon(this.icon).setSection(section).onClick(() => {
|
|
346
|
+
(0, import_async.invokeAsyncSafely)(() => this.executeAbstractFiles(abstractFiles));
|
|
347
|
+
});
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
352
|
+
0 && (module.exports = {
|
|
353
|
+
AbstractFileCommandHandler
|
|
354
|
+
});
|
|
355
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2NvbW1hbmQtaGFuZGxlcnMvYWJ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QUFRLE1BQU07QUFDYiw0Q0FBa0IsTUFBTSxLQUFLLHFCQUFxQixhQUFhLENBQUM7QUFBQSxNQUNsRSxDQUFDO0FBQUEsSUFDTCxDQUFDO0FBQUEsRUFDSDtBQUNGOyIsCiAgIm5hbWVzIjogW10KfQo=
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file
|
|
3
|
+
*
|
|
4
|
+
* Command handler for abstract file commands with file/files menu integration.
|
|
5
|
+
*/
|
|
6
|
+
import type { IconName, TAbstractFile, WorkspaceLeaf } from 'obsidian';
|
|
7
|
+
import type { CommandHandlerParams, CommandHandlerRegistrationContext } from './command-handler.cjs';
|
|
8
|
+
import { GlobalCommandHandler } from './global-command-handler.cjs';
|
|
9
|
+
/**
|
|
10
|
+
* Parameters for creating an abstract file command handler.
|
|
11
|
+
*/
|
|
12
|
+
export interface AbstractFileCommandHandlerParams extends CommandHandlerParams {
|
|
13
|
+
/**
|
|
14
|
+
* The item name to use in the single-file menu.
|
|
15
|
+
*/
|
|
16
|
+
readonly fileMenuItemName?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* The section to use in the single-file menu.
|
|
19
|
+
*/
|
|
20
|
+
readonly fileMenuSection?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* The icon to use in the single-file menu submenu.
|
|
23
|
+
*/
|
|
24
|
+
readonly fileMenuSubmenuIcon?: IconName | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* The item name to use in the multi-file menu.
|
|
27
|
+
*/
|
|
28
|
+
readonly filesMenuItemName?: string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* The section to use in the multi-file menu.
|
|
31
|
+
*/
|
|
32
|
+
readonly filesMenuSection?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* The icon to use in the multi-file menu submenu.
|
|
35
|
+
*/
|
|
36
|
+
readonly filesMenuSubmenuIcon?: IconName | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Whether to add the command to a submenu.
|
|
39
|
+
*/
|
|
40
|
+
readonly shouldAddCommandToSubmenu?: boolean | undefined;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Command handler for abstract file commands.
|
|
44
|
+
*
|
|
45
|
+
* Handles both single-file and multi-file context menus.
|
|
46
|
+
* Subclasses override {@link canExecuteAbstractFile} and {@link executeAbstractFile}.
|
|
47
|
+
*/
|
|
48
|
+
export declare abstract class AbstractFileCommandHandler extends GlobalCommandHandler {
|
|
49
|
+
/**
|
|
50
|
+
* Gets the item name to use in the single-file menu.
|
|
51
|
+
*
|
|
52
|
+
* @returns The item name, or `undefined` to use the command name.
|
|
53
|
+
*/
|
|
54
|
+
protected get fileMenuItemName(): string | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Gets the section to use in the single-file menu.
|
|
57
|
+
*
|
|
58
|
+
* @returns The section name, or `undefined` to use the plugin name.
|
|
59
|
+
*/
|
|
60
|
+
protected get fileMenuSection(): string | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Gets the icon to use in the single-file menu submenu.
|
|
63
|
+
*
|
|
64
|
+
* @returns The icon, or `undefined` for no icon.
|
|
65
|
+
*/
|
|
66
|
+
protected get fileMenuSubmenuIcon(): IconName | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Gets the item name to use in the multi-file menu.
|
|
69
|
+
*
|
|
70
|
+
* @returns The item name, or `undefined` to fall back to single-file item name.
|
|
71
|
+
*/
|
|
72
|
+
protected get filesMenuItemName(): string | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Gets the section to use in the multi-file menu.
|
|
75
|
+
*
|
|
76
|
+
* @returns The section name, or `undefined` to fall back to single-file section.
|
|
77
|
+
*/
|
|
78
|
+
protected get filesMenuSection(): string | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Gets the icon to use in the multi-file menu submenu.
|
|
81
|
+
*
|
|
82
|
+
* @returns The icon, or `undefined` to fall back to single-file submenu icon.
|
|
83
|
+
*/
|
|
84
|
+
protected get filesMenuSubmenuIcon(): IconName | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Gets whether to add the command to a submenu.
|
|
87
|
+
*
|
|
88
|
+
* @returns Whether to add to a submenu.
|
|
89
|
+
*/
|
|
90
|
+
protected get shouldAddCommandToSubmenu(): boolean | undefined;
|
|
91
|
+
private readonly _fileMenuItemName?;
|
|
92
|
+
private readonly _fileMenuSection?;
|
|
93
|
+
private readonly _fileMenuSubmenuIcon?;
|
|
94
|
+
private readonly _filesMenuItemName?;
|
|
95
|
+
private readonly _filesMenuSection?;
|
|
96
|
+
private readonly _filesMenuSubmenuIcon?;
|
|
97
|
+
private readonly _shouldAddCommandToSubmenu?;
|
|
98
|
+
private activeFileProvider?;
|
|
99
|
+
/**
|
|
100
|
+
* Creates a new abstract file command handler.
|
|
101
|
+
*
|
|
102
|
+
* @param params - The parameters for the abstract file command handler.
|
|
103
|
+
*/
|
|
104
|
+
constructor(params: AbstractFileCommandHandlerParams);
|
|
105
|
+
/**
|
|
106
|
+
* Registers file-menu and files-menu event handlers.
|
|
107
|
+
*
|
|
108
|
+
* @param context - The registration context.
|
|
109
|
+
*/
|
|
110
|
+
onRegistered(context: CommandHandlerRegistrationContext): Promise<void>;
|
|
111
|
+
/**
|
|
112
|
+
* Checks whether the command can execute from the command palette.
|
|
113
|
+
* Uses the active file as the target.
|
|
114
|
+
*
|
|
115
|
+
* @returns Whether the command can execute.
|
|
116
|
+
*/
|
|
117
|
+
protected canExecute(): boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Checks whether the command can execute for a single abstract file.
|
|
120
|
+
*
|
|
121
|
+
* @param _abstractFile - The file or folder.
|
|
122
|
+
* @returns Whether the command can execute.
|
|
123
|
+
*/
|
|
124
|
+
protected canExecuteAbstractFile(_abstractFile: TAbstractFile): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Checks whether the command can execute for multiple abstract files.
|
|
127
|
+
* Default implementation checks each file individually.
|
|
128
|
+
*
|
|
129
|
+
* @param abstractFiles - The files or folders.
|
|
130
|
+
* @returns Whether the command can execute.
|
|
131
|
+
*/
|
|
132
|
+
protected canExecuteAbstractFiles(abstractFiles: TAbstractFile[]): boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Executes the command from the command palette using the active file.
|
|
135
|
+
*/
|
|
136
|
+
protected execute(): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Executes the command for a single abstract file.
|
|
139
|
+
*
|
|
140
|
+
* @param abstractFile - The file or folder.
|
|
141
|
+
*/
|
|
142
|
+
protected abstract executeAbstractFile(abstractFile: TAbstractFile): Promise<void>;
|
|
143
|
+
/**
|
|
144
|
+
* Executes the command for multiple abstract files.
|
|
145
|
+
* Default implementation executes sequentially.
|
|
146
|
+
*
|
|
147
|
+
* @param abstractFiles - The files or folders.
|
|
148
|
+
*/
|
|
149
|
+
protected executeAbstractFiles(abstractFiles: TAbstractFile[]): Promise<void>;
|
|
150
|
+
/**
|
|
151
|
+
* Checks whether the command should appear in the single-file context menu.
|
|
152
|
+
*
|
|
153
|
+
* @param _abstractFile - The file or folder.
|
|
154
|
+
* @param _source - The source of the event.
|
|
155
|
+
* @param _leaf - The workspace leaf, if available.
|
|
156
|
+
* @returns Whether to add to the file menu.
|
|
157
|
+
*/
|
|
158
|
+
protected shouldAddToAbstractFileMenu(_abstractFile: TAbstractFile, _source: string, _leaf?: WorkspaceLeaf): boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Checks whether the command should appear in the multi-file context menu.
|
|
161
|
+
* Default implementation checks each file individually.
|
|
162
|
+
*
|
|
163
|
+
* @param abstractFiles - The files or folders.
|
|
164
|
+
* @param source - The source of the event.
|
|
165
|
+
* @param leaf - The workspace leaf, if available.
|
|
166
|
+
* @returns Whether to add to the files menu.
|
|
167
|
+
*/
|
|
168
|
+
protected shouldAddToAbstractFilesMenu(abstractFiles: TAbstractFile[], source: string, leaf?: WorkspaceLeaf): boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Checks whether the command should appear in the command palette.
|
|
171
|
+
*
|
|
172
|
+
* @returns Whether to add to the command palette.
|
|
173
|
+
*/
|
|
174
|
+
protected shouldAddToCommandPalette(): boolean;
|
|
175
|
+
private getActiveFile;
|
|
176
|
+
private handleAbstractFileMenu;
|
|
177
|
+
private handleAbstractFilesMenu;
|
|
178
|
+
}
|
package/dist/lib/cjs/obsidian/{commands/index.cjs → command-handlers/app-active-file-provider.cjs}
RENAMED
|
@@ -4,6 +4,7 @@ if you want to view the source, please visit the github repository of this plugi
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
(function initCjs() {
|
|
7
|
+
// eslint-disable-next-line obsidianmd/prefer-active-doc -- Actively use globalThis.
|
|
7
8
|
const globalThisRecord = globalThis;
|
|
8
9
|
globalThisRecord['__name'] ??= name;
|
|
9
10
|
const originalRequire = require;
|
|
@@ -83,10 +84,12 @@ if you want to view the source, please visit the github repository of this plugi
|
|
|
83
84
|
return originalRequire?.(id);
|
|
84
85
|
}
|
|
85
86
|
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated,
|
|
87
|
-
if (globalThis
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated, obsidianmd/prefer-active-doc -- Need access to app. Actively use globalThis.
|
|
88
|
+
if (globalThis.app.isMobile) {
|
|
88
89
|
if (id === 'process' || id === 'node:process') {
|
|
90
|
+
// eslint-disable-next-line no-console -- Valid usage.
|
|
89
91
|
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Fake process object is returned instead.`);
|
|
92
|
+
// eslint-disable-next-line obsidianmd/prefer-active-doc -- Actively use globalThis.
|
|
90
93
|
return globalThis.process;
|
|
91
94
|
}
|
|
92
95
|
} else {
|
|
@@ -96,17 +99,16 @@ if you want to view the source, please visit the github repository of this plugi
|
|
|
96
99
|
}
|
|
97
100
|
}
|
|
98
101
|
|
|
102
|
+
// eslint-disable-next-line no-console -- Valid usage.
|
|
99
103
|
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Empty object is returned instead.`);
|
|
100
104
|
return {};
|
|
101
105
|
}
|
|
102
106
|
})();
|
|
103
107
|
|
|
104
108
|
"use strict";
|
|
105
|
-
var __create = Object.create;
|
|
106
109
|
var __defProp = Object.defineProperty;
|
|
107
110
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
108
111
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
109
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
110
112
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
111
113
|
var __export = (target, all) => {
|
|
112
114
|
for (var name in all)
|
|
@@ -120,38 +122,33 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
120
122
|
}
|
|
121
123
|
return to;
|
|
122
124
|
};
|
|
123
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
124
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
125
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
126
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
127
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
128
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
129
|
-
mod
|
|
130
|
-
));
|
|
131
125
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
132
|
-
var
|
|
133
|
-
__export(
|
|
134
|
-
|
|
135
|
-
command_base: () => command_base,
|
|
136
|
-
editor_command_base: () => editor_command_base,
|
|
137
|
-
file_command_base: () => file_command_base,
|
|
138
|
-
folder_command_base: () => folder_command_base,
|
|
139
|
-
non_editor_command_base: () => non_editor_command_base
|
|
126
|
+
var app_active_file_provider_exports = {};
|
|
127
|
+
__export(app_active_file_provider_exports, {
|
|
128
|
+
AppActiveFileProvider: () => AppActiveFileProvider
|
|
140
129
|
});
|
|
141
|
-
module.exports = __toCommonJS(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
130
|
+
module.exports = __toCommonJS(app_active_file_provider_exports);
|
|
131
|
+
class AppActiveFileProvider {
|
|
132
|
+
/**
|
|
133
|
+
* Creates a new app-backed active file provider.
|
|
134
|
+
*
|
|
135
|
+
* @param app - The Obsidian app instance.
|
|
136
|
+
*/
|
|
137
|
+
constructor(app) {
|
|
138
|
+
this.app = app;
|
|
139
|
+
}
|
|
140
|
+
app;
|
|
141
|
+
/**
|
|
142
|
+
* Gets the currently active file from the workspace.
|
|
143
|
+
*
|
|
144
|
+
* @returns The active file, or `null` if no file is active.
|
|
145
|
+
*/
|
|
146
|
+
getActiveFile() {
|
|
147
|
+
return this.app.workspace.getActiveFile();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
148
150
|
// Annotate the CommonJS export names for ESM import in node:
|
|
149
151
|
0 && (module.exports = {
|
|
150
|
-
|
|
151
|
-
command_base,
|
|
152
|
-
editor_command_base,
|
|
153
|
-
file_command_base,
|
|
154
|
-
folder_command_base,
|
|
155
|
-
non_editor_command_base
|
|
152
|
+
AppActiveFileProvider
|
|
156
153
|
});
|
|
157
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
154
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2NvbW1hbmQtaGFuZGxlcnMvYXBwLWFjdGl2ZS1maWxlLXByb3ZpZGVyLnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyIvKipcbiAqIEBmaWxlXG4gKlxuICogQXBwLWJhY2tlZCBpbXBsZW1lbnRhdGlvbiBvZiB7QGxpbmsgQWN0aXZlRmlsZVByb3ZpZGVyfS5cbiAqL1xuXG5pbXBvcnQgdHlwZSB7XG4gIEFwcCxcbiAgVEZpbGVcbn0gZnJvbSAnb2JzaWRpYW4nO1xuXG5pbXBvcnQgdHlwZSB7IEFjdGl2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