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
|
@@ -1,280 +0,0 @@
|
|
|
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
|
-
const globalThisRecord = globalThis;
|
|
8
|
-
globalThisRecord['__name'] ??= name;
|
|
9
|
-
const originalRequire = require;
|
|
10
|
-
if (originalRequire && !originalRequire.__isPatched) {
|
|
11
|
-
// eslint-disable-next-line no-global-assign, no-implicit-globals -- We need to patch the `require()` function.
|
|
12
|
-
require = Object.assign(
|
|
13
|
-
(id) => requirePatched(id),
|
|
14
|
-
originalRequire,
|
|
15
|
-
{
|
|
16
|
-
__isPatched: true
|
|
17
|
-
}
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const newFuncs = {
|
|
22
|
-
__extractDefault() {
|
|
23
|
-
return extractDefault;
|
|
24
|
-
},
|
|
25
|
-
process() {
|
|
26
|
-
const browserProcess = {
|
|
27
|
-
browser: true,
|
|
28
|
-
cwd() {
|
|
29
|
-
return '/';
|
|
30
|
-
},
|
|
31
|
-
env: {},
|
|
32
|
-
platform: 'android'
|
|
33
|
-
};
|
|
34
|
-
return browserProcess;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
for (const key of Object.keys(newFuncs)) {
|
|
39
|
-
globalThisRecord[key] ??= newFuncs[key]?.();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function name(obj) {
|
|
43
|
-
return obj;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function extractDefault(module) {
|
|
47
|
-
return module && module.__esModule && 'default' in module ? module.default : module;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const OBSIDIAN_BUILT_IN_MODULE_NAMES = [
|
|
51
|
-
'obsidian',
|
|
52
|
-
'@codemirror/autocomplete',
|
|
53
|
-
'@codemirror/collab',
|
|
54
|
-
'@codemirror/commands',
|
|
55
|
-
'@codemirror/language',
|
|
56
|
-
'@codemirror/lint',
|
|
57
|
-
'@codemirror/search',
|
|
58
|
-
'@codemirror/state',
|
|
59
|
-
'@codemirror/text',
|
|
60
|
-
'@codemirror/view',
|
|
61
|
-
'@lezer/common',
|
|
62
|
-
'@lezer/lr',
|
|
63
|
-
'@lezer/highlight'];
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES = [
|
|
67
|
-
'@codemirror/closebrackets',
|
|
68
|
-
'@codemirror/comment',
|
|
69
|
-
'@codemirror/fold',
|
|
70
|
-
'@codemirror/gutter',
|
|
71
|
-
'@codemirror/highlight',
|
|
72
|
-
'@codemirror/history',
|
|
73
|
-
'@codemirror/matchbrackets',
|
|
74
|
-
'@codemirror/panel',
|
|
75
|
-
'@codemirror/rangeset',
|
|
76
|
-
'@codemirror/rectangular-selection',
|
|
77
|
-
'@codemirror/stream-parser',
|
|
78
|
-
'@codemirror/tooltip'];
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
function requirePatched(id) {
|
|
82
|
-
if (OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id) || DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id)) {
|
|
83
|
-
return originalRequire?.(id);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated, @typescript-eslint/no-unnecessary-condition -- We need access to app here which might not be available yet.
|
|
87
|
-
if (globalThis?.app?.isMobile) {
|
|
88
|
-
if (id === 'process' || id === 'node:process') {
|
|
89
|
-
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Fake process object is returned instead.`);
|
|
90
|
-
return globalThis.process;
|
|
91
|
-
}
|
|
92
|
-
} else {
|
|
93
|
-
const module = originalRequire?.(id);
|
|
94
|
-
if (module) {
|
|
95
|
-
return extractDefault(module);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Empty object is returned instead.`);
|
|
100
|
-
return {};
|
|
101
|
-
}
|
|
102
|
-
})();
|
|
103
|
-
|
|
104
|
-
"use strict";
|
|
105
|
-
var __defProp = Object.defineProperty;
|
|
106
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
107
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
108
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
109
|
-
var __export = (target, all) => {
|
|
110
|
-
for (var name in all)
|
|
111
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
112
|
-
};
|
|
113
|
-
var __copyProps = (to, from, except, desc) => {
|
|
114
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
115
|
-
for (let key of __getOwnPropNames(from))
|
|
116
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
117
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
118
|
-
}
|
|
119
|
-
return to;
|
|
120
|
-
};
|
|
121
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
122
|
-
var editor_command_base_exports = {};
|
|
123
|
-
__export(editor_command_base_exports, {
|
|
124
|
-
EditorCommandBase: () => EditorCommandBase,
|
|
125
|
-
EditorCommandInvocationBase: () => EditorCommandInvocationBase
|
|
126
|
-
});
|
|
127
|
-
module.exports = __toCommonJS(editor_command_base_exports);
|
|
128
|
-
var import_command_base = require('./command-base.cjs');
|
|
129
|
-
class EditorCommandBase extends import_command_base.CommandBase {
|
|
130
|
-
/**
|
|
131
|
-
* Gets the item name to use in the editor menu.
|
|
132
|
-
*
|
|
133
|
-
* @returns The item name to use in the editor menu.
|
|
134
|
-
*/
|
|
135
|
-
get editorMenuItemName() {
|
|
136
|
-
return this._editorMenuItemName;
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Gets the section to use in the editor menu.
|
|
140
|
-
*
|
|
141
|
-
* @returns The section to use in the editor menu.
|
|
142
|
-
*/
|
|
143
|
-
get editorMenuSection() {
|
|
144
|
-
return this._editorMenuSection;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Gets the icon to use in the editor menu submenu.
|
|
148
|
-
*
|
|
149
|
-
* @returns The icon to use in the editor menu submenu.
|
|
150
|
-
*/
|
|
151
|
-
get editorMenuSubmenuIcon() {
|
|
152
|
-
return this._editorMenuSubmenuIcon;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Gets whether to add the command to the submenu.
|
|
156
|
-
*
|
|
157
|
-
* @returns Whether to add the command to the submenu.
|
|
158
|
-
*/
|
|
159
|
-
get shouldAddCommandToSubmenu() {
|
|
160
|
-
return this._shouldAddCommandToSubmenu;
|
|
161
|
-
}
|
|
162
|
-
_editorMenuItemName;
|
|
163
|
-
_editorMenuSection;
|
|
164
|
-
_editorMenuSubmenuIcon;
|
|
165
|
-
_shouldAddCommandToSubmenu;
|
|
166
|
-
/**
|
|
167
|
-
* Creates a new editor command.
|
|
168
|
-
*
|
|
169
|
-
* @param params - The parameters for the editor command.
|
|
170
|
-
*/
|
|
171
|
-
constructor(params) {
|
|
172
|
-
super(params);
|
|
173
|
-
this._editorMenuItemName = params.editorMenuItemName;
|
|
174
|
-
this._editorMenuSection = params.editorMenuSection;
|
|
175
|
-
this._editorMenuSubmenuIcon = params.editorMenuSubmenuIcon;
|
|
176
|
-
this._shouldAddCommandToSubmenu = params.shouldAddCommandToSubmenu;
|
|
177
|
-
this.editorCheckCallback = this.editorCheckCallback.bind(this);
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Checks if the command can execute or executes it.
|
|
181
|
-
*
|
|
182
|
-
* @param checking - Is checking mode only. If `true`, only the check if the command can execute is performed. If `false`, the command is executed.
|
|
183
|
-
* @param editor - The editor to check.
|
|
184
|
-
* @param ctx - The context of the command.
|
|
185
|
-
* @returns Whether the command can execute.
|
|
186
|
-
*/
|
|
187
|
-
editorCheckCallback(checking, editor, ctx) {
|
|
188
|
-
if (!this.shouldAddToCommandPalette()) {
|
|
189
|
-
return false;
|
|
190
|
-
}
|
|
191
|
-
return this.createEditorCommandInvocation(editor, ctx).invoke(checking);
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Registers the command.
|
|
195
|
-
*/
|
|
196
|
-
register() {
|
|
197
|
-
super.register();
|
|
198
|
-
this.plugin.registerEvent(this.app.workspace.on("editor-menu", this.handleEditorMenu.bind(this)));
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Checks if the command should be added to the command palette.
|
|
202
|
-
*
|
|
203
|
-
* @returns Whether the command should be added to the command palette.
|
|
204
|
-
*/
|
|
205
|
-
shouldAddToCommandPalette() {
|
|
206
|
-
return true;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Checks if the command should be added to the editor menu.
|
|
210
|
-
*
|
|
211
|
-
* @param _editor - The editor to check.
|
|
212
|
-
* @param _ctx - The context of the command.
|
|
213
|
-
* @returns Whether the command should be added to the editor menu.
|
|
214
|
-
*/
|
|
215
|
-
shouldAddToEditorMenu(_editor, _ctx) {
|
|
216
|
-
return false;
|
|
217
|
-
}
|
|
218
|
-
handleEditorMenu(menu, editor, ctx) {
|
|
219
|
-
if (!this.shouldAddToEditorMenu(editor, ctx)) {
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
if (!this.createEditorCommandInvocation(editor, ctx).invoke(true)) {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
const editorMenuSection = this.editorMenuSection ?? this.plugin.manifest.name;
|
|
226
|
-
if (this.shouldAddCommandToSubmenu) {
|
|
227
|
-
menu.setSectionSubmenu(editorMenuSection, {
|
|
228
|
-
icon: this.editorMenuSubmenuIcon ?? "",
|
|
229
|
-
title: editorMenuSection
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
menu.addItem((item) => {
|
|
233
|
-
item.setTitle(this.editorMenuItemName ?? this.originalName).setIcon(this.icon).setSection(editorMenuSection).onClick(() => this.createEditorCommandInvocation(editor, ctx).invoke(false));
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
class EditorCommandInvocationBase extends import_command_base.CommandInvocationBase {
|
|
238
|
-
/**
|
|
239
|
-
* Creates a new editor command invocation.
|
|
240
|
-
*
|
|
241
|
-
* @param plugin - The plugin that the command invocation belongs to.
|
|
242
|
-
* @param editor - The editor to create the command invocation for.
|
|
243
|
-
* @param ctx - The context of the command.
|
|
244
|
-
*/
|
|
245
|
-
constructor(plugin, editor, ctx) {
|
|
246
|
-
super(plugin);
|
|
247
|
-
this.editor = editor;
|
|
248
|
-
this.ctx = ctx;
|
|
249
|
-
this._file = ctx.file;
|
|
250
|
-
}
|
|
251
|
-
editor;
|
|
252
|
-
ctx;
|
|
253
|
-
/**
|
|
254
|
-
* The file to invoke the command for.
|
|
255
|
-
*
|
|
256
|
-
* @returns The file to invoke the command for.
|
|
257
|
-
* @throws If the file is not set.
|
|
258
|
-
*/
|
|
259
|
-
get file() {
|
|
260
|
-
if (!this._file) {
|
|
261
|
-
throw new Error("File not set");
|
|
262
|
-
}
|
|
263
|
-
return this._file;
|
|
264
|
-
}
|
|
265
|
-
_file;
|
|
266
|
-
/**
|
|
267
|
-
* Checks if the command can execute.
|
|
268
|
-
*
|
|
269
|
-
* @returns Whether the command can execute.
|
|
270
|
-
*/
|
|
271
|
-
canExecute() {
|
|
272
|
-
return super.canExecute() && !!this._file;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
276
|
-
0 && (module.exports = {
|
|
277
|
-
EditorCommandBase,
|
|
278
|
-
EditorCommandInvocationBase
|
|
279
|
-
});
|
|
280
|
-
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic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BQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBLEVBdUIvRixZQUFZLFFBQW9DLFFBQW1DLEtBQXVCO0FBQy9HLFVBQU0sTUFBTTtBQUR5QztBQUFtQztBQUV4RixTQUFLLFFBQVEsSUFBSTtBQUFBLEVBQ25CO0FBQUEsRUFIdUQ7QUFBQSxFQUFtQztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBLEVBaEIxRixJQUFjLE9BQWM7QUFDMUIsUUFBSSxDQUFDLEtBQUssT0FBTztBQUNmLFlBQU0sSUFBSSxNQUFNLGNBQWM7QUFBQSxJQUNoQztBQUNBLFdBQU8sS0FBSztBQUFBLEVBQ2Q7QUFBQSxFQUVpQjtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQSxFQW1CRCxhQUFzQjtBQUNwQyxXQUFPLE1BQU0sV0FBVyxLQUFLLENBQUMsQ0FBQyxLQUFLO0FBQUEsRUFDdEM7QUFDRjsiLAogICJuYW1lcyI6IFtdCn0K
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file
|
|
3
|
-
*
|
|
4
|
-
* Base classes for editor commands.
|
|
5
|
-
*/
|
|
6
|
-
import type { Editor, IconName, MarkdownFileInfo, Plugin, TFile } from 'obsidian';
|
|
7
|
-
import type { CommandBaseParams } from './command-base.cjs';
|
|
8
|
-
import { CommandBase, CommandInvocationBase } from './command-base.cjs';
|
|
9
|
-
/**
|
|
10
|
-
* Options for creating an editor command.
|
|
11
|
-
*
|
|
12
|
-
* @typeParam TPlugin - The type of the plugin that the command belongs to.
|
|
13
|
-
*/
|
|
14
|
-
export interface EditorCommandBaseParams<TPlugin extends Plugin> extends CommandBaseParams<TPlugin> {
|
|
15
|
-
/**
|
|
16
|
-
* The item name to use in the editor menu.
|
|
17
|
-
*/
|
|
18
|
-
readonly editorMenuItemName?: string | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* The section to use in the editor menu.
|
|
21
|
-
*/
|
|
22
|
-
readonly editorMenuSection?: string | undefined;
|
|
23
|
-
/**
|
|
24
|
-
* The icon to use in the editor menu submenu.
|
|
25
|
-
*/
|
|
26
|
-
readonly editorMenuSubmenuIcon?: IconName | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* Whether to add the command to the submenu.
|
|
29
|
-
*/
|
|
30
|
-
readonly shouldAddCommandToSubmenu?: boolean | undefined;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Base class for editor commands.
|
|
34
|
-
*
|
|
35
|
-
* @typeParam TPlugin - The type of the plugin that the command belongs to.
|
|
36
|
-
*/
|
|
37
|
-
export declare abstract class EditorCommandBase<TPlugin extends Plugin> extends CommandBase<TPlugin> {
|
|
38
|
-
/**
|
|
39
|
-
* Gets the item name to use in the editor menu.
|
|
40
|
-
*
|
|
41
|
-
* @returns The item name to use in the editor menu.
|
|
42
|
-
*/
|
|
43
|
-
protected get editorMenuItemName(): string | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Gets the section to use in the editor menu.
|
|
46
|
-
*
|
|
47
|
-
* @returns The section to use in the editor menu.
|
|
48
|
-
*/
|
|
49
|
-
protected get editorMenuSection(): string | undefined;
|
|
50
|
-
/**
|
|
51
|
-
* Gets the icon to use in the editor menu submenu.
|
|
52
|
-
*
|
|
53
|
-
* @returns The icon to use in the editor menu submenu.
|
|
54
|
-
*/
|
|
55
|
-
protected get editorMenuSubmenuIcon(): IconName | undefined;
|
|
56
|
-
/**
|
|
57
|
-
* Gets whether to add the command to the submenu.
|
|
58
|
-
*
|
|
59
|
-
* @returns Whether to add the command to the submenu.
|
|
60
|
-
*/
|
|
61
|
-
protected get shouldAddCommandToSubmenu(): boolean | undefined;
|
|
62
|
-
private readonly _editorMenuItemName?;
|
|
63
|
-
private readonly _editorMenuSection?;
|
|
64
|
-
private readonly _editorMenuSubmenuIcon?;
|
|
65
|
-
private readonly _shouldAddCommandToSubmenu?;
|
|
66
|
-
/**
|
|
67
|
-
* Creates a new editor command.
|
|
68
|
-
*
|
|
69
|
-
* @param params - The parameters for the editor command.
|
|
70
|
-
*/
|
|
71
|
-
constructor(params: EditorCommandBaseParams<TPlugin>);
|
|
72
|
-
/**
|
|
73
|
-
* Checks if the command can execute or executes it.
|
|
74
|
-
*
|
|
75
|
-
* @param checking - Is checking mode only. If `true`, only the check if the command can execute is performed. If `false`, the command is executed.
|
|
76
|
-
* @param editor - The editor to check.
|
|
77
|
-
* @param ctx - The context of the command.
|
|
78
|
-
* @returns Whether the command can execute.
|
|
79
|
-
*/
|
|
80
|
-
editorCheckCallback(checking: boolean, editor: Editor, ctx: MarkdownFileInfo): boolean;
|
|
81
|
-
/**
|
|
82
|
-
* Registers the command.
|
|
83
|
-
*/
|
|
84
|
-
register(): void;
|
|
85
|
-
/**
|
|
86
|
-
* Creates a new editor command invocation.
|
|
87
|
-
*
|
|
88
|
-
* @param editor - The editor to create the command invocation for.
|
|
89
|
-
* @param ctx - The context of the command.
|
|
90
|
-
* @returns The command invocation.
|
|
91
|
-
*/
|
|
92
|
-
protected abstract createEditorCommandInvocation(editor: Editor, ctx: MarkdownFileInfo): CommandInvocationBase;
|
|
93
|
-
/**
|
|
94
|
-
* Checks if the command should be added to the command palette.
|
|
95
|
-
*
|
|
96
|
-
* @returns Whether the command should be added to the command palette.
|
|
97
|
-
*/
|
|
98
|
-
protected shouldAddToCommandPalette(): boolean;
|
|
99
|
-
/**
|
|
100
|
-
* Checks if the command should be added to the editor menu.
|
|
101
|
-
*
|
|
102
|
-
* @param _editor - The editor to check.
|
|
103
|
-
* @param _ctx - The context of the command.
|
|
104
|
-
* @returns Whether the command should be added to the editor menu.
|
|
105
|
-
*/
|
|
106
|
-
protected shouldAddToEditorMenu(_editor: Editor, _ctx: MarkdownFileInfo): boolean;
|
|
107
|
-
private handleEditorMenu;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Base class for editor command invocations.
|
|
111
|
-
*
|
|
112
|
-
* @typeParam TPlugin - The type of the plugin that the command belongs to.
|
|
113
|
-
*/
|
|
114
|
-
export declare class EditorCommandInvocationBase<TPlugin extends Plugin> extends CommandInvocationBase<TPlugin> {
|
|
115
|
-
protected readonly editor: Editor;
|
|
116
|
-
protected readonly ctx: MarkdownFileInfo;
|
|
117
|
-
/**
|
|
118
|
-
* The file to invoke the command for.
|
|
119
|
-
*
|
|
120
|
-
* @returns The file to invoke the command for.
|
|
121
|
-
* @throws If the file is not set.
|
|
122
|
-
*/
|
|
123
|
-
protected get file(): TFile;
|
|
124
|
-
private readonly _file;
|
|
125
|
-
/**
|
|
126
|
-
* Creates a new editor command invocation.
|
|
127
|
-
*
|
|
128
|
-
* @param plugin - The plugin that the command invocation belongs to.
|
|
129
|
-
* @param editor - The editor to create the command invocation for.
|
|
130
|
-
* @param ctx - The context of the command.
|
|
131
|
-
*/
|
|
132
|
-
constructor(plugin: TPlugin, editor: Editor, ctx: MarkdownFileInfo);
|
|
133
|
-
/**
|
|
134
|
-
* Checks if the command can execute.
|
|
135
|
-
*
|
|
136
|
-
* @returns Whether the command can execute.
|
|
137
|
-
*/
|
|
138
|
-
canExecute(): boolean;
|
|
139
|
-
}
|