obsidian-dev-utils 55.4.1 → 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 +6 -0
- package/dist/lib/cjs/abort-controller.cjs +6 -4
- package/dist/lib/cjs/array.cjs +5 -3
- package/dist/lib/cjs/async-events.cjs +7 -5
- package/dist/lib/cjs/async.cjs +6 -4
- package/dist/lib/cjs/blob.cjs +6 -4
- package/dist/lib/cjs/codemirror/index.cjs +5 -3
- package/dist/lib/cjs/codemirror/state-field-spec.cjs +5 -3
- package/dist/lib/cjs/css-class.cjs +5 -3
- package/dist/lib/cjs/debug-controller.cjs +5 -3
- package/dist/lib/cjs/debug.cjs +5 -3
- package/dist/lib/cjs/enum.cjs +5 -3
- package/dist/lib/cjs/error.cjs +5 -3
- package/dist/lib/cjs/function.cjs +5 -3
- package/dist/lib/cjs/html-element.cjs +18 -16
- package/dist/lib/cjs/index.cjs +5 -3
- package/dist/lib/cjs/library.cjs +6 -4
- package/dist/lib/cjs/object-utils.cjs +5 -3
- package/dist/lib/cjs/obsidian/@types/i18next.d.cts +3 -3
- package/dist/lib/cjs/obsidian/app.cjs +5 -3
- package/dist/lib/cjs/obsidian/async-with-notice.cjs +8 -6
- package/dist/lib/cjs/obsidian/attachment-path.cjs +5 -3
- package/dist/lib/cjs/obsidian/backlink.cjs +5 -3
- package/dist/lib/cjs/obsidian/callout.cjs +5 -3
- package/dist/lib/cjs/obsidian/code-block-markdown-information.cjs +5 -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} +29 -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 +6 -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 +5 -3
- package/dist/lib/cjs/obsidian/components/index.cjs +8 -3
- package/dist/lib/cjs/obsidian/components/index.d.cts +1 -0
- package/dist/lib/cjs/obsidian/components/setting-components/checkbox-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/code-highlighter-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/date-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/date-time-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/email-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/file-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/index.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/month-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/multiple-dropdown-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/multiple-email-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/multiple-file-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/multiple-text-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/number-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/password-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/setting-component-wrapper.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/telephone-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/text-based-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/time-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/tri-state-checkbox-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/typed-dropdown-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/typed-multiple-dropdown-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/typed-range-text-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/typed-text-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/url-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/validator-component.cjs +7 -5
- package/dist/lib/cjs/obsidian/components/setting-components/value-component-with-change-tracking.cjs +5 -3
- package/dist/lib/cjs/obsidian/components/setting-components/week-component.cjs +5 -3
- package/dist/lib/cjs/obsidian/constructors/getDomEventsHandlersConstructor.cjs +5 -3
- package/dist/lib/cjs/obsidian/constructors/index.cjs +5 -3
- package/dist/lib/cjs/obsidian/dataview-link.cjs +5 -3
- package/dist/lib/cjs/obsidian/dataview.cjs +6 -4
- package/dist/lib/cjs/obsidian/editor.cjs +5 -3
- package/dist/lib/cjs/obsidian/file-change.cjs +5 -3
- package/dist/lib/cjs/obsidian/file-manager.cjs +5 -3
- package/dist/lib/cjs/obsidian/file-system.cjs +5 -3
- package/dist/lib/cjs/obsidian/frontmatter-link-cache-with-offsets.cjs +5 -3
- package/dist/lib/cjs/obsidian/frontmatter.cjs +5 -3
- package/dist/lib/cjs/obsidian/i18n/{custom-type-options-base.cjs → custom-type-options.cjs} +7 -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} +8 -5
- package/dist/lib/cjs/obsidian/i18n/default-translations.d.cts +14 -0
- package/dist/lib/cjs/obsidian/i18n/i18n.cjs +5 -3
- package/dist/lib/cjs/obsidian/i18n/i18n.d.cts +2 -13
- package/dist/lib/cjs/obsidian/i18n/index.cjs +11 -9
- package/dist/lib/cjs/obsidian/i18n/index.d.cts +2 -2
- package/dist/lib/cjs/obsidian/i18n/locales/en.cjs +5 -3
- package/dist/lib/cjs/obsidian/i18n/locales/index.cjs +5 -3
- package/dist/lib/cjs/obsidian/i18n/locales/translations-map.cjs +5 -3
- package/dist/lib/cjs/obsidian/i18n/locales/translations-map.d.cts +1 -2
- package/dist/lib/cjs/obsidian/index.cjs +8 -6
- package/dist/lib/cjs/obsidian/index.d.cts +1 -1
- package/dist/lib/cjs/obsidian/is-in-obsidian.cjs +5 -3
- package/dist/lib/cjs/obsidian/link.cjs +5 -3
- package/dist/lib/cjs/obsidian/logger.cjs +5 -3
- package/dist/lib/cjs/obsidian/loop.cjs +5 -3
- package/dist/lib/cjs/obsidian/markdown-code-block-processor.cjs +5 -3
- package/dist/lib/cjs/obsidian/markdown-view.cjs +5 -3
- package/dist/lib/cjs/obsidian/markdown.cjs +5 -3
- package/dist/lib/cjs/obsidian/metadata-cache.cjs +5 -3
- package/dist/lib/cjs/obsidian/modals/alert.cjs +8 -6
- package/dist/lib/cjs/obsidian/modals/confirm.cjs +8 -6
- package/dist/lib/cjs/obsidian/modals/index.cjs +8 -6
- package/dist/lib/cjs/obsidian/modals/index.d.cts +1 -1
- package/dist/lib/cjs/obsidian/modals/{modal-base.cjs → modal.cjs} +8 -6
- package/dist/lib/cjs/obsidian/modals/prompt.cjs +8 -6
- package/dist/lib/cjs/obsidian/modals/select-item.cjs +7 -5
- package/dist/lib/cjs/obsidian/monkey-around.cjs +5 -3
- package/dist/lib/cjs/obsidian/obsidian-settings.cjs +5 -3
- package/dist/lib/cjs/obsidian/pdf.cjs +8 -6
- package/dist/lib/cjs/obsidian/plugin/components/abort-signal-component.cjs +162 -0
- 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/{commands/non-editor-command-base.cjs → plugin/components/console-debug-component.cjs} +26 -20
- 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} +39 -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 +11 -18
- package/dist/lib/cjs/obsidian/plugin/index.d.cts +2 -5
- package/dist/lib/cjs/obsidian/plugin/obsidian-plugin-repo-paths.cjs +5 -3
- package/dist/lib/cjs/obsidian/plugin/path-settings.cjs +5 -3
- package/dist/lib/cjs/obsidian/plugin/plugin-context.cjs +16 -7
- package/dist/lib/cjs/obsidian/plugin/plugin-context.d.cts +3 -2
- package/dist/lib/cjs/obsidian/plugin/plugin-id.cjs +5 -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 +135 -3
- package/dist/lib/cjs/obsidian/plugin/plugin.d.cts +106 -5
- package/dist/lib/cjs/obsidian/queue.cjs +5 -3
- package/dist/lib/cjs/obsidian/react/app-context.cjs +5 -3
- package/dist/lib/cjs/obsidian/react/index.cjs +5 -3
- package/dist/lib/cjs/obsidian/reference.cjs +5 -3
- package/dist/lib/cjs/obsidian/rename-delete-handler.cjs +5 -3
- package/dist/lib/cjs/obsidian/resource-url.cjs +5 -3
- package/dist/lib/cjs/obsidian/setting-ex.cjs +5 -3
- package/dist/lib/cjs/obsidian/setting-group-ex.cjs +5 -3
- package/dist/lib/cjs/obsidian/validation.cjs +5 -3
- package/dist/lib/cjs/obsidian/vault-delete.cjs +5 -3
- package/dist/lib/cjs/obsidian/vault.cjs +5 -3
- package/dist/lib/cjs/obsidian/workspace.cjs +5 -3
- package/dist/lib/cjs/path.cjs +5 -3
- package/dist/lib/cjs/reg-exp.cjs +5 -3
- package/dist/lib/cjs/script-utils/build.cjs +5 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/change-extension-plugin.cjs +5 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/copy-to-obsidian-plugins-folder-plugin.cjs +5 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/custom-esbuild-options-plugin.cjs +5 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/dependency.cjs +6 -4
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/fix-esm-plugin.cjs +5 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/fix-source-maps-plugin.cjs +5 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/index.cjs +5 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/obsidian-plugin-builder.cjs +5 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/preprocess-plugin.cjs +8 -6
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/rename-css-plugin.cjs +5 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/svelte-wrapper-plugin.cjs +5 -3
- package/dist/lib/cjs/script-utils/bundlers/esbuild.cjs +5 -3
- package/dist/lib/cjs/script-utils/bundlers/index.cjs +5 -3
- package/dist/lib/cjs/script-utils/cli-utils.cjs +5 -3
- package/dist/lib/cjs/script-utils/code-generator.cjs +5 -3
- package/dist/lib/cjs/script-utils/commitlint-config.cjs +5 -3
- package/dist/lib/cjs/script-utils/exec.cjs +5 -3
- package/dist/lib/cjs/script-utils/formatters/dprint.cjs +6 -4
- package/dist/lib/cjs/script-utils/formatters/index.cjs +5 -3
- package/dist/lib/cjs/script-utils/fs.cjs +5 -3
- package/dist/lib/cjs/script-utils/index.cjs +5 -3
- package/dist/lib/cjs/script-utils/json.cjs +5 -3
- package/dist/lib/cjs/script-utils/linters/cspell.cjs +5 -3
- package/dist/lib/cjs/script-utils/linters/eslint-config.cjs +6 -4
- package/dist/lib/cjs/script-utils/linters/eslint-rules/index.cjs +5 -3
- package/dist/lib/cjs/script-utils/linters/eslint-rules/no-async-callback-to-unsafe-return.cjs +5 -3
- package/dist/lib/cjs/script-utils/linters/eslint-rules/no-used-underscore-variables.cjs +5 -3
- package/dist/lib/cjs/script-utils/linters/eslint-rules/obsidian-dev-utils-plugin.cjs +5 -3
- package/dist/lib/cjs/script-utils/linters/eslint-rules/rule-tester-helper.cjs +5 -3
- package/dist/lib/cjs/script-utils/linters/eslint.cjs +6 -4
- package/dist/lib/cjs/script-utils/linters/index.cjs +5 -3
- package/dist/lib/cjs/script-utils/linters/markdownlint-cli2-config.cjs +5 -3
- package/dist/lib/cjs/script-utils/linters/markdownlint.cjs +9 -5
- package/dist/lib/cjs/script-utils/nano-staged-config.cjs +5 -3
- package/dist/lib/cjs/script-utils/npm-publish.cjs +5 -3
- package/dist/lib/cjs/script-utils/npm-run.cjs +5 -3
- package/dist/lib/cjs/script-utils/npm.cjs +5 -3
- package/dist/lib/cjs/script-utils/obsidian-dev-utils-repo-paths.cjs +5 -3
- package/dist/lib/cjs/script-utils/root.cjs +5 -3
- package/dist/lib/cjs/script-utils/test-runners/index.cjs +5 -3
- package/dist/lib/cjs/script-utils/test-runners/vitest.cjs +5 -3
- package/dist/lib/cjs/script-utils/version.cjs +5 -3
- package/dist/lib/cjs/strict-proxy.cjs +5 -3
- package/dist/lib/cjs/string.cjs +5 -3
- package/dist/lib/cjs/transformers/date-transformer.cjs +5 -3
- package/dist/lib/cjs/transformers/duration-transformer.cjs +5 -3
- package/dist/lib/cjs/transformers/group-transformer.cjs +5 -3
- package/dist/lib/cjs/transformers/index.cjs +5 -3
- package/dist/lib/cjs/transformers/map-transformer.cjs +5 -3
- package/dist/lib/cjs/transformers/set-transformer.cjs +5 -3
- package/dist/lib/cjs/transformers/skip-private-property-transformer.cjs +5 -3
- package/dist/lib/cjs/transformers/transformer.cjs +5 -3
- package/dist/lib/cjs/transformers/two-way-map-transformer.cjs +5 -3
- package/dist/lib/cjs/transformers/typed-transformer.cjs +5 -3
- package/dist/lib/cjs/two-way-map.cjs +5 -3
- package/dist/lib/cjs/type-guards.cjs +5 -3
- package/dist/lib/cjs/type.cjs +5 -3
- package/dist/lib/cjs/url.cjs +5 -3
- package/dist/lib/cjs/value-provider.cjs +5 -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 +4 -2
- 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 -441
- package/dist/lib/cjs/obsidian/commands/abstract-file-command-base.d.cts +0 -264
- package/dist/lib/cjs/obsidian/commands/command-base.cjs +0 -255
- package/dist/lib/cjs/obsidian/commands/command-base.d.cts +0 -125
- package/dist/lib/cjs/obsidian/commands/editor-command-base.cjs +0 -282
- package/dist/lib/cjs/obsidian/commands/editor-command-base.d.cts +0 -139
- package/dist/lib/cjs/obsidian/commands/file-command-base.cjs +0 -343
- package/dist/lib/cjs/obsidian/commands/file-command-base.d.cts +0 -191
- package/dist/lib/cjs/obsidian/commands/folder-command-base.cjs +0 -335
- 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 -409
- package/dist/lib/cjs/obsidian/plugin/plugin-base.d.cts +0 -176
- package/dist/lib/cjs/obsidian/plugin/plugin-settings-manager-base.cjs +0 -486
- 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 -401
- package/dist/lib/cjs/obsidian/plugin/plugin-settings-wrapper.d.cts +0 -25
- package/dist/lib/cjs/obsidian/plugin/plugin-types-base.cjs +0 -122
- 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,176 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file
|
|
3
|
-
*
|
|
4
|
-
* Base class for Obsidian plugins providing utility methods for settings management, error handling, and notifications.
|
|
5
|
-
*
|
|
6
|
-
* This class simplifies the process of managing plugin settings, displaying notifications, and handling errors.
|
|
7
|
-
* Subclasses should implement methods to create default settings and settings tabs, and complete plugin-specific
|
|
8
|
-
* loading tasks.
|
|
9
|
-
*/
|
|
10
|
-
import type { ReadonlyDeep } from 'type-fest';
|
|
11
|
-
import { Plugin as ObsidianPlugin } from 'obsidian';
|
|
12
|
-
import type { TranslationsMap } from '../i18n/i18n.mjs';
|
|
13
|
-
import type { ExtractPluginSettings, ExtractPluginSettingsManager, ExtractPluginSettingsTab, ExtractReadonlyPluginSettingsWrapper, PluginTypesBase } from './plugin-types-base.mjs';
|
|
14
|
-
import { AsyncEvents } from '../../async-events.mjs';
|
|
15
|
-
type LifecycleEventName = 'layoutReady' | 'load' | 'unload';
|
|
16
|
-
/**
|
|
17
|
-
* Base class for creating Obsidian plugins with built-in support for settings management, error handling, and notifications.
|
|
18
|
-
*
|
|
19
|
-
* @typeParam PluginTypes - Plugin-specific types.
|
|
20
|
-
*/
|
|
21
|
-
export declare abstract class PluginBase<PluginTypes extends PluginTypesBase> extends ObsidianPlugin {
|
|
22
|
-
/**
|
|
23
|
-
* The events of the plugin.
|
|
24
|
-
*/
|
|
25
|
-
readonly events: AsyncEvents;
|
|
26
|
-
/**
|
|
27
|
-
* Gets the AbortSignal used for aborting long-running operations.
|
|
28
|
-
*
|
|
29
|
-
* @returns The abort signal.
|
|
30
|
-
* @throws If the abort signal is not defined.
|
|
31
|
-
*/
|
|
32
|
-
get abortSignal(): AbortSignal;
|
|
33
|
-
/**
|
|
34
|
-
* Gets the readonly plugin settings.
|
|
35
|
-
*
|
|
36
|
-
* @returns The readonly plugin settings.
|
|
37
|
-
*/
|
|
38
|
-
get settings(): ReadonlyDeep<ExtractPluginSettings<PluginTypes>>;
|
|
39
|
-
/**
|
|
40
|
-
* Gets the plugin settings manager.
|
|
41
|
-
*
|
|
42
|
-
* @returns The plugin settings manager.
|
|
43
|
-
*/
|
|
44
|
-
get settingsManager(): ExtractPluginSettingsManager<PluginTypes>;
|
|
45
|
-
/**
|
|
46
|
-
* Gets the plugin settings tab.
|
|
47
|
-
*
|
|
48
|
-
* @returns The plugin settings tab.
|
|
49
|
-
*/
|
|
50
|
-
get settingsTab(): ExtractPluginSettingsTab<PluginTypes>;
|
|
51
|
-
private _abortSignal?;
|
|
52
|
-
private _settingsManager;
|
|
53
|
-
private _settingsTab;
|
|
54
|
-
private readonly lifecycleEventNames;
|
|
55
|
-
private notice?;
|
|
56
|
-
/**
|
|
57
|
-
* Logs a message to the console.
|
|
58
|
-
*
|
|
59
|
-
* Use instead of `console.debug()`.
|
|
60
|
-
*
|
|
61
|
-
* Those messages are not shown by default, but they can be shown by enabling `your-plugin-id` debugger namespace.
|
|
62
|
-
*
|
|
63
|
-
* @see {@link https://github.com/mnaoumov/obsidian-dev-utils/blob/main/docs/debugging.md} for more information.
|
|
64
|
-
*
|
|
65
|
-
* @param message - The message to log.
|
|
66
|
-
* @param args - The arguments to log.
|
|
67
|
-
*/
|
|
68
|
-
consoleDebug(message: string, ...args: unknown[]): void;
|
|
69
|
-
/**
|
|
70
|
-
* Called when the external settings change.
|
|
71
|
-
*
|
|
72
|
-
* Usually, you don't need to override this method. Consider using {@link onLoadSettings} instead.
|
|
73
|
-
*
|
|
74
|
-
* If you still need to override this method, make sure to call `await super.onExternalSettingsChange()` first.
|
|
75
|
-
*/
|
|
76
|
-
onExternalSettingsChange(): Promise<void>;
|
|
77
|
-
/**
|
|
78
|
-
* Called when the plugin is loaded
|
|
79
|
-
*
|
|
80
|
-
* Usually, you don't need to override this method. Consider using {@link onloadImpl} instead.
|
|
81
|
-
*
|
|
82
|
-
* If you still need to override this method, make sure to call `await super.onload()` first.
|
|
83
|
-
*/
|
|
84
|
-
onload(): Promise<void>;
|
|
85
|
-
/**
|
|
86
|
-
* Called when the plugin is unloaded.
|
|
87
|
-
*
|
|
88
|
-
* Usually, you don't need to override this method. Consider using {@link onunloadImpl} instead.
|
|
89
|
-
*
|
|
90
|
-
* If you still need to override this method, make sure to call `super.onunload()` first.
|
|
91
|
-
*/
|
|
92
|
-
onunload(): void;
|
|
93
|
-
/**
|
|
94
|
-
* Registers a callback to be executed when a lifecycle event is triggered.
|
|
95
|
-
*
|
|
96
|
-
* @param name - The name of the event.
|
|
97
|
-
* @param callback - The callback to execute.
|
|
98
|
-
*/
|
|
99
|
-
registerForLifecycleEvent(name: LifecycleEventName, callback: () => Promise<void>): void;
|
|
100
|
-
/**
|
|
101
|
-
* Waits for a lifecycle event to be triggered.
|
|
102
|
-
*
|
|
103
|
-
* If you `await` this method during lifecycle event, it might cause a deadlock.
|
|
104
|
-
*
|
|
105
|
-
* Consider wrapping this call with {@link invokeAsyncSafely}.
|
|
106
|
-
*
|
|
107
|
-
* @param name - The name of the event.
|
|
108
|
-
* @returns A {@link Promise} that resolves when the event is triggered.
|
|
109
|
-
*/
|
|
110
|
-
waitForLifecycleEvent(name: LifecycleEventName): Promise<void>;
|
|
111
|
-
/**
|
|
112
|
-
* Creates the plugin settings manager. This method must be implemented by subclasses.
|
|
113
|
-
*
|
|
114
|
-
* @returns The plugin settings manager.
|
|
115
|
-
*/
|
|
116
|
-
protected createSettingsManager(): ExtractPluginSettingsManager<PluginTypes> | null;
|
|
117
|
-
/**
|
|
118
|
-
* Creates a plugin settings tab.
|
|
119
|
-
*
|
|
120
|
-
* @returns The settings tab or `null` if not applicable.
|
|
121
|
-
*/
|
|
122
|
-
protected createSettingsTab(): ExtractPluginSettingsTab<PluginTypes> | null;
|
|
123
|
-
/**
|
|
124
|
-
* Creates a translations map.
|
|
125
|
-
*
|
|
126
|
-
* @returns The translations map.
|
|
127
|
-
*/
|
|
128
|
-
protected createTranslationsMap(): TranslationsMap<PluginTypes>;
|
|
129
|
-
/**
|
|
130
|
-
* Called when an async error occurs.
|
|
131
|
-
*
|
|
132
|
-
* @param _asyncError - The async error.
|
|
133
|
-
*/
|
|
134
|
-
protected handleAsyncError(_asyncError: unknown): void;
|
|
135
|
-
/**
|
|
136
|
-
* Called when the layout is ready.
|
|
137
|
-
*/
|
|
138
|
-
protected onLayoutReady(): Promise<void>;
|
|
139
|
-
/**
|
|
140
|
-
* Executed when the plugin is loaded.
|
|
141
|
-
*
|
|
142
|
-
* If this method fails, the plugin will be automatically unloaded.
|
|
143
|
-
*
|
|
144
|
-
* @remarks It is important to call `super.onloadImpl()` in overridden method.
|
|
145
|
-
*/
|
|
146
|
-
protected onloadImpl(): Promise<void>;
|
|
147
|
-
/**
|
|
148
|
-
* Called when the plugin settings are loaded or reloaded.
|
|
149
|
-
*
|
|
150
|
-
* @param _loadedSettings - The loaded settings wrapper.
|
|
151
|
-
* @param _isInitialLoad - Whether the settings are being loaded for the first time.
|
|
152
|
-
*/
|
|
153
|
-
protected onLoadSettings(_loadedSettings: ExtractReadonlyPluginSettingsWrapper<PluginTypes>, _isInitialLoad: boolean): Promise<void>;
|
|
154
|
-
/**
|
|
155
|
-
* Called when the plugin settings are saved.
|
|
156
|
-
*
|
|
157
|
-
* @param _newSettings - The new settings.
|
|
158
|
-
* @param _oldSettings - The old settings.
|
|
159
|
-
* @param _context - The context.
|
|
160
|
-
*/
|
|
161
|
-
protected onSaveSettings(_newSettings: ExtractReadonlyPluginSettingsWrapper<PluginTypes>, _oldSettings: ExtractReadonlyPluginSettingsWrapper<PluginTypes>, _context: unknown): Promise<void>;
|
|
162
|
-
/**
|
|
163
|
-
* Called when the plugin is unloaded.
|
|
164
|
-
*/
|
|
165
|
-
protected onunloadImpl(): Promise<void>;
|
|
166
|
-
/**
|
|
167
|
-
* Displays a notice message to the user.
|
|
168
|
-
*
|
|
169
|
-
* @param message - The message to display.
|
|
170
|
-
*/
|
|
171
|
-
protected showNotice(message: string): void;
|
|
172
|
-
private afterLoad;
|
|
173
|
-
private onLayoutReadyBase;
|
|
174
|
-
private triggerLifecycleEvent;
|
|
175
|
-
}
|
|
176
|
-
export {};
|
|
@@ -1,317 +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 initEsm() {
|
|
7
|
-
if (globalThis.process) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const browserProcess = {
|
|
12
|
-
browser: true,
|
|
13
|
-
cwd() {
|
|
14
|
-
return '/';
|
|
15
|
-
},
|
|
16
|
-
env: {},
|
|
17
|
-
platform: 'android'
|
|
18
|
-
};
|
|
19
|
-
globalThis.process = browserProcess;
|
|
20
|
-
})();
|
|
21
|
-
|
|
22
|
-
import {
|
|
23
|
-
Notice,
|
|
24
|
-
Plugin as ObsidianPlugin
|
|
25
|
-
} from "obsidian";
|
|
26
|
-
import { AsyncEvents } from "../../async-events.mjs";
|
|
27
|
-
import {
|
|
28
|
-
convertAsyncToSync,
|
|
29
|
-
invokeAsyncSafely,
|
|
30
|
-
invokeAsyncSafelyAfterDelay
|
|
31
|
-
} from "../../async.mjs";
|
|
32
|
-
import { getDebugger } from "../../debug.mjs";
|
|
33
|
-
import {
|
|
34
|
-
registerAsyncErrorEventHandler,
|
|
35
|
-
SilentError
|
|
36
|
-
} from "../../error.mjs";
|
|
37
|
-
import { noopAsync } from "../../function.mjs";
|
|
38
|
-
import { AllWindowsEventHandler } from "../components/all-windows-event-handler.mjs";
|
|
39
|
-
import { registerAsyncEvent } from "../components/async-events-component.mjs";
|
|
40
|
-
import {
|
|
41
|
-
initI18N,
|
|
42
|
-
t
|
|
43
|
-
} from "../i18n/i18n.mjs";
|
|
44
|
-
import { defaultTranslationsMap } from "../i18n/locales/translations-map.mjs";
|
|
45
|
-
import {
|
|
46
|
-
initDebugController,
|
|
47
|
-
initPluginContext
|
|
48
|
-
} from "./plugin-context.mjs";
|
|
49
|
-
class PluginBase extends ObsidianPlugin {
|
|
50
|
-
/**
|
|
51
|
-
* The events of the plugin.
|
|
52
|
-
*/
|
|
53
|
-
events = new AsyncEvents();
|
|
54
|
-
/**
|
|
55
|
-
* Gets the AbortSignal used for aborting long-running operations.
|
|
56
|
-
*
|
|
57
|
-
* @returns The abort signal.
|
|
58
|
-
* @throws If the abort signal is not defined.
|
|
59
|
-
*/
|
|
60
|
-
get abortSignal() {
|
|
61
|
-
if (!this._abortSignal) {
|
|
62
|
-
throw new Error("Abort signal not defined");
|
|
63
|
-
}
|
|
64
|
-
return this._abortSignal;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Gets the readonly plugin settings.
|
|
68
|
-
*
|
|
69
|
-
* @returns The readonly plugin settings.
|
|
70
|
-
*/
|
|
71
|
-
get settings() {
|
|
72
|
-
return this.settingsManager.settingsWrapper.safeSettings;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Gets the plugin settings manager.
|
|
76
|
-
*
|
|
77
|
-
* @returns The plugin settings manager.
|
|
78
|
-
*/
|
|
79
|
-
get settingsManager() {
|
|
80
|
-
if (!this._settingsManager) {
|
|
81
|
-
throw new Error("Settings manager not defined");
|
|
82
|
-
}
|
|
83
|
-
return this._settingsManager;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Gets the plugin settings tab.
|
|
87
|
-
*
|
|
88
|
-
* @returns The plugin settings tab.
|
|
89
|
-
*/
|
|
90
|
-
get settingsTab() {
|
|
91
|
-
if (!this._settingsTab) {
|
|
92
|
-
throw new Error("Settings tab not defined");
|
|
93
|
-
}
|
|
94
|
-
return this._settingsTab;
|
|
95
|
-
}
|
|
96
|
-
_abortSignal;
|
|
97
|
-
_settingsManager = null;
|
|
98
|
-
_settingsTab = null;
|
|
99
|
-
lifecycleEventNames = /* @__PURE__ */ new Set();
|
|
100
|
-
notice;
|
|
101
|
-
/**
|
|
102
|
-
* Logs a message to the console.
|
|
103
|
-
*
|
|
104
|
-
* Use instead of `console.debug()`.
|
|
105
|
-
*
|
|
106
|
-
* Those messages are not shown by default, but they can be shown by enabling `your-plugin-id` debugger namespace.
|
|
107
|
-
*
|
|
108
|
-
* @see {@link https://github.com/mnaoumov/obsidian-dev-utils/blob/main/docs/debugging.md} for more information.
|
|
109
|
-
*
|
|
110
|
-
* @param message - The message to log.
|
|
111
|
-
* @param args - The arguments to log.
|
|
112
|
-
*/
|
|
113
|
-
consoleDebug(message, ...args) {
|
|
114
|
-
const FRAMES_TO_SKIP = 1;
|
|
115
|
-
const pluginDebugger = getDebugger(this.manifest.id, FRAMES_TO_SKIP);
|
|
116
|
-
pluginDebugger(message, ...args);
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Called when the external settings change.
|
|
120
|
-
*
|
|
121
|
-
* Usually, you don't need to override this method. Consider using {@link onLoadSettings} instead.
|
|
122
|
-
*
|
|
123
|
-
* If you still need to override this method, make sure to call `await super.onExternalSettingsChange()` first.
|
|
124
|
-
*/
|
|
125
|
-
async onExternalSettingsChange() {
|
|
126
|
-
await super.onExternalSettingsChange?.();
|
|
127
|
-
await this._settingsManager?.loadFromFile(false);
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Called when the plugin is loaded
|
|
131
|
-
*
|
|
132
|
-
* Usually, you don't need to override this method. Consider using {@link onloadImpl} instead.
|
|
133
|
-
*
|
|
134
|
-
* If you still need to override this method, make sure to call `await super.onload()` first.
|
|
135
|
-
*/
|
|
136
|
-
async onload() {
|
|
137
|
-
await super.onload();
|
|
138
|
-
await this.onloadImpl();
|
|
139
|
-
invokeAsyncSafelyAfterDelay(this.afterLoad.bind(this));
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Called when the plugin is unloaded.
|
|
143
|
-
*
|
|
144
|
-
* Usually, you don't need to override this method. Consider using {@link onunloadImpl} instead.
|
|
145
|
-
*
|
|
146
|
-
* If you still need to override this method, make sure to call `super.onunload()` first.
|
|
147
|
-
*/
|
|
148
|
-
onunload() {
|
|
149
|
-
super.onunload();
|
|
150
|
-
invokeAsyncSafely(async () => {
|
|
151
|
-
try {
|
|
152
|
-
await this.onunloadImpl();
|
|
153
|
-
} finally {
|
|
154
|
-
await this.triggerLifecycleEvent("unload");
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Registers a callback to be executed when a lifecycle event is triggered.
|
|
160
|
-
*
|
|
161
|
-
* @param name - The name of the event.
|
|
162
|
-
* @param callback - The callback to execute.
|
|
163
|
-
*/
|
|
164
|
-
registerForLifecycleEvent(name, callback) {
|
|
165
|
-
invokeAsyncSafely(async () => {
|
|
166
|
-
await this.waitForLifecycleEvent(name);
|
|
167
|
-
await callback();
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Waits for a lifecycle event to be triggered.
|
|
172
|
-
*
|
|
173
|
-
* If you `await` this method during lifecycle event, it might cause a deadlock.
|
|
174
|
-
*
|
|
175
|
-
* Consider wrapping this call with {@link invokeAsyncSafely}.
|
|
176
|
-
*
|
|
177
|
-
* @param name - The name of the event.
|
|
178
|
-
* @returns A {@link Promise} that resolves when the event is triggered.
|
|
179
|
-
*/
|
|
180
|
-
async waitForLifecycleEvent(name) {
|
|
181
|
-
if (this.lifecycleEventNames.has(name)) {
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
await new Promise((resolve) => {
|
|
185
|
-
this.events.once(name, () => {
|
|
186
|
-
resolve();
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Creates the plugin settings manager. This method must be implemented by subclasses.
|
|
192
|
-
*
|
|
193
|
-
* @returns The plugin settings manager.
|
|
194
|
-
*/
|
|
195
|
-
createSettingsManager() {
|
|
196
|
-
return null;
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Creates a plugin settings tab.
|
|
200
|
-
*
|
|
201
|
-
* @returns The settings tab or `null` if not applicable.
|
|
202
|
-
*/
|
|
203
|
-
createSettingsTab() {
|
|
204
|
-
return null;
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Creates a translations map.
|
|
208
|
-
*
|
|
209
|
-
* @returns The translations map.
|
|
210
|
-
*/
|
|
211
|
-
createTranslationsMap() {
|
|
212
|
-
return defaultTranslationsMap;
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* Called when an async error occurs.
|
|
216
|
-
*
|
|
217
|
-
* @param _asyncError - The async error.
|
|
218
|
-
*/
|
|
219
|
-
handleAsyncError(_asyncError) {
|
|
220
|
-
this.showNotice(t(($) => $.obsidianDevUtils.notices.unhandledError));
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* Called when the layout is ready.
|
|
224
|
-
*/
|
|
225
|
-
async onLayoutReady() {
|
|
226
|
-
await noopAsync();
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Executed when the plugin is loaded.
|
|
230
|
-
*
|
|
231
|
-
* If this method fails, the plugin will be automatically unloaded.
|
|
232
|
-
*
|
|
233
|
-
* @remarks It is important to call `super.onloadImpl()` in overridden method.
|
|
234
|
-
*/
|
|
235
|
-
async onloadImpl() {
|
|
236
|
-
initPluginContext(this.app, this.manifest.id);
|
|
237
|
-
new AllWindowsEventHandler(this.app, this).registerAllWindowsHandler((win) => {
|
|
238
|
-
initDebugController(win);
|
|
239
|
-
});
|
|
240
|
-
await initI18N(this.createTranslationsMap());
|
|
241
|
-
this.register(registerAsyncErrorEventHandler(this.handleAsyncError.bind(this)));
|
|
242
|
-
this._settingsManager = this.createSettingsManager();
|
|
243
|
-
if (this._settingsManager) {
|
|
244
|
-
registerAsyncEvent(this, this._settingsManager.on("loadSettings", this.onLoadSettings.bind(this)));
|
|
245
|
-
registerAsyncEvent(this, this._settingsManager.on("saveSettings", this.onSaveSettings.bind(this)));
|
|
246
|
-
}
|
|
247
|
-
await this._settingsManager?.loadFromFile(true);
|
|
248
|
-
this._settingsTab = this.createSettingsTab();
|
|
249
|
-
if (this._settingsTab) {
|
|
250
|
-
this.addSettingTab(this._settingsTab);
|
|
251
|
-
}
|
|
252
|
-
const abortController = new AbortController();
|
|
253
|
-
this._abortSignal = abortController.signal;
|
|
254
|
-
this.register(() => {
|
|
255
|
-
abortController.abort(new SilentError(`Plugin ${this.manifest.id} had been unloaded`));
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Called when the plugin settings are loaded or reloaded.
|
|
260
|
-
*
|
|
261
|
-
* @param _loadedSettings - The loaded settings wrapper.
|
|
262
|
-
* @param _isInitialLoad - Whether the settings are being loaded for the first time.
|
|
263
|
-
*/
|
|
264
|
-
async onLoadSettings(_loadedSettings, _isInitialLoad) {
|
|
265
|
-
await noopAsync();
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Called when the plugin settings are saved.
|
|
269
|
-
*
|
|
270
|
-
* @param _newSettings - The new settings.
|
|
271
|
-
* @param _oldSettings - The old settings.
|
|
272
|
-
* @param _context - The context.
|
|
273
|
-
*/
|
|
274
|
-
async onSaveSettings(_newSettings, _oldSettings, _context) {
|
|
275
|
-
await noopAsync();
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Called when the plugin is unloaded.
|
|
279
|
-
*/
|
|
280
|
-
async onunloadImpl() {
|
|
281
|
-
await noopAsync();
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* Displays a notice message to the user.
|
|
285
|
-
*
|
|
286
|
-
* @param message - The message to display.
|
|
287
|
-
*/
|
|
288
|
-
showNotice(message) {
|
|
289
|
-
if (this.notice) {
|
|
290
|
-
this.notice.hide();
|
|
291
|
-
}
|
|
292
|
-
this.notice = new Notice(`${this.manifest.name}
|
|
293
|
-
${message}`);
|
|
294
|
-
}
|
|
295
|
-
async afterLoad() {
|
|
296
|
-
if (this.abortSignal.aborted) {
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
await this.triggerLifecycleEvent("load");
|
|
300
|
-
this.app.workspace.onLayoutReady(convertAsyncToSync(this.onLayoutReadyBase.bind(this)));
|
|
301
|
-
}
|
|
302
|
-
async onLayoutReadyBase() {
|
|
303
|
-
try {
|
|
304
|
-
await this.onLayoutReady();
|
|
305
|
-
} finally {
|
|
306
|
-
await this.triggerLifecycleEvent("layoutReady");
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
async triggerLifecycleEvent(name) {
|
|
310
|
-
this.lifecycleEventNames.add(name);
|
|
311
|
-
await this.events.triggerAsync(name);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
export {
|
|
315
|
-
PluginBase
|
|
316
|
-
};
|
|
317
|
-
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL3BsdWdpbi9wbHVnaW4tYmFzZS50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAZmlsZVxuICpcbiAqIEJhc2UgY2xhc3MgZm9yIE9ic2lkaWFuIHBsdWdpbnMgcHJvdmlkaW5nIHV0aWxpdHkgbWV0aG9kcyBmb3Igc2V0dGluZ3MgbWFuYWdlbWVudCwgZXJyb3IgaGFuZGxpbmcsIGFuZCBub3RpZmljYXRpb25zLlxuICpcbiAqIFRoaXMgY2xhc3Mgc2ltcGxpZmllcyB0aGUgcHJvY2VzcyBvZiBtYW5hZ2luZyBwbHVnaW4gc2V0dGluZ3MsIGRpc3BsYXlpbmcgbm90aWZpY2F0aW9ucywgYW5kIGhhbmRsaW5nIGVycm9ycy5cbiAqIFN1YmNsYXNzZXMgc2hvdWxkIGltcGxlbWVudCBtZXRob2RzIHRvIGNyZWF0ZSBkZWZhdWx0IHNldHRpbmdzIGFuZCBzZXR0aW5ncyB0YWJzLCBhbmQgY29tcGxld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