obsidian-dev-utils 65.0.1 → 66.0.1
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 +32 -0
- package/dist/dev/main.js +4892 -4807
- package/dist/lib/cjs/async-events.cjs +15 -18
- package/dist/lib/cjs/async-events.d.cts +19 -19
- package/dist/lib/cjs/async.cjs +1 -1
- package/dist/lib/cjs/async.d.cts +9 -8
- package/dist/lib/cjs/function.cjs +1 -1
- package/dist/lib/cjs/function.d.cts +43 -3
- package/dist/lib/cjs/library.cjs +1 -1
- package/dist/lib/cjs/obsidian/async-with-notice.cjs +1 -1
- package/dist/lib/cjs/obsidian/async-with-notice.d.cts +2 -2
- package/dist/lib/cjs/obsidian/{plugin/components → components}/abort-signal-component.cjs +4 -4
- package/dist/lib/cjs/obsidian/{plugin/components → components}/abort-signal-component.d.cts +2 -2
- package/dist/lib/cjs/obsidian/components/all-windows-event-component.cjs +201 -0
- package/dist/lib/{esm/obsidian/components/all-windows-event-handler.d.mts → cjs/obsidian/components/all-windows-event-component.d.cts} +6 -7
- package/dist/lib/cjs/obsidian/components/async-component.cjs +3 -2
- package/dist/lib/cjs/obsidian/components/async-component.d.cts +2 -1
- package/dist/lib/cjs/obsidian/{plugin/components → components}/async-error-handler-component.cjs +5 -5
- package/dist/lib/cjs/obsidian/{plugin/components → components}/async-error-handler-component.d.cts +2 -2
- package/dist/lib/cjs/obsidian/components/async-events-component.cjs +3 -2
- package/dist/lib/cjs/obsidian/components/async-events-component.d.cts +2 -1
- package/dist/lib/cjs/obsidian/{plugin/components → components}/console-debug-component.cjs +4 -4
- package/dist/lib/cjs/obsidian/{plugin/components → components}/console-debug-component.d.cts +2 -2
- package/dist/lib/cjs/obsidian/components/disposable-component.cjs +160 -0
- package/dist/lib/cjs/obsidian/components/disposable-component.d.cts +34 -0
- package/dist/lib/cjs/obsidian/{plugin/components → components}/i18n-component.cjs +4 -4
- package/dist/lib/cjs/obsidian/{plugin/components → components}/i18n-component.d.cts +2 -2
- package/dist/lib/cjs/obsidian/components/index.cjs +40 -7
- package/dist/lib/cjs/obsidian/components/index.d.cts +13 -2
- package/dist/lib/cjs/obsidian/components/layout-ready-component.cjs +185 -0
- package/dist/lib/cjs/obsidian/components/layout-ready-component.d.cts +47 -0
- package/dist/lib/cjs/obsidian/components/menu-event-registrar-component.cjs +172 -0
- package/dist/lib/cjs/obsidian/components/menu-event-registrar-component.d.cts +41 -0
- package/dist/lib/cjs/obsidian/components/monkey-around-component.cjs +197 -0
- package/dist/lib/cjs/obsidian/components/monkey-around-component.d.cts +113 -0
- package/dist/lib/cjs/obsidian/{plugin/components → components}/plugin-context-component.cjs +6 -6
- package/dist/lib/cjs/obsidian/{plugin/components → components}/plugin-context-component.d.cts +2 -2
- package/dist/lib/cjs/obsidian/{plugin/components → components}/plugin-notice-component.cjs +3 -2
- package/dist/lib/cjs/obsidian/{plugin/components → components}/plugin-notice-component.d.cts +2 -2
- package/dist/lib/cjs/obsidian/components/plugin-settings-component.cjs +534 -0
- package/dist/lib/cjs/obsidian/{plugin/components → components}/plugin-settings-component.d.cts +6 -21
- package/dist/lib/cjs/obsidian/{plugin/components → components}/plugin-settings-tab-component.cjs +3 -2
- package/dist/lib/cjs/obsidian/{plugin/components → components}/plugin-settings-tab-component.d.cts +5 -5
- package/dist/lib/cjs/obsidian/constructors/getDomEventsHandlersConstructor.cjs +20 -16
- package/dist/lib/cjs/obsidian/dataview.cjs +1 -1
- package/dist/lib/cjs/obsidian/dataview.d.cts +1 -1
- package/dist/lib/cjs/obsidian/index.cjs +7 -4
- package/dist/lib/cjs/obsidian/index.d.cts +2 -1
- package/dist/lib/cjs/obsidian/loop.cjs +1 -1
- package/dist/lib/cjs/obsidian/loop.d.cts +2 -2
- package/dist/lib/cjs/obsidian/markdown.cjs +13 -7
- package/dist/lib/cjs/obsidian/menu-event-registrar.cjs +1 -50
- package/dist/lib/cjs/obsidian/menu-event-registrar.d.cts +1 -35
- package/dist/lib/cjs/obsidian/modals/prompt.cjs +1 -1
- package/dist/lib/cjs/obsidian/modals/prompt.d.cts +1 -1
- package/dist/lib/cjs/obsidian/modals/select-item.cjs +1 -1
- package/dist/lib/cjs/obsidian/modals/select-item.d.cts +1 -1
- package/dist/lib/cjs/obsidian/path-settings.cjs +239 -0
- package/dist/lib/cjs/obsidian/plugin/index.cjs +1 -7
- package/dist/lib/cjs/obsidian/plugin/index.d.cts +0 -2
- package/dist/lib/cjs/obsidian/plugin/plugin-settings-tab.cjs +4 -4
- package/dist/lib/cjs/obsidian/plugin/plugin-settings-tab.d.cts +5 -5
- package/dist/lib/cjs/obsidian/plugin/plugin.cjs +39 -34
- package/dist/lib/cjs/obsidian/plugin/plugin.d.cts +13 -11
- package/dist/lib/cjs/obsidian/queue.cjs +1 -1
- package/dist/lib/cjs/obsidian/queue.d.cts +2 -2
- package/dist/lib/cjs/obsidian/rename-delete-handler.cjs +19 -12
- package/dist/lib/cjs/obsidian/setting-components/checkbox-component.cjs +209 -0
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/checkbox-component.d.cts +1 -1
- package/dist/lib/cjs/obsidian/setting-components/code-highlighter-component.cjs +356 -0
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/code-highlighter-component.d.cts +1 -1
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/date-component.cjs +3 -3
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/date-time-component.cjs +3 -3
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/email-component.cjs +2 -2
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/file-component.cjs +2 -2
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/index.cjs +1 -1
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/month-component.cjs +3 -3
- package/dist/lib/cjs/obsidian/setting-components/multiple-dropdown-component.cjs +241 -0
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/multiple-dropdown-component.d.cts +1 -1
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/multiple-email-component.cjs +2 -2
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/multiple-file-component.cjs +3 -3
- package/dist/lib/cjs/obsidian/setting-components/multiple-text-component.cjs +254 -0
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/multiple-text-component.d.cts +1 -1
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/number-component.cjs +2 -2
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/password-component.cjs +2 -2
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/setting-component-wrapper.cjs +4 -4
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/telephone-component.cjs +2 -2
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/text-based-component.cjs +1 -1
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/time-component.cjs +2 -2
- package/dist/lib/cjs/obsidian/setting-components/tri-state-checkbox-component.cjs +210 -0
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/tri-state-checkbox-component.d.cts +1 -1
- package/dist/lib/cjs/obsidian/setting-components/typed-dropdown-component.cjs +247 -0
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/typed-dropdown-component.d.cts +1 -1
- package/dist/lib/cjs/obsidian/setting-components/typed-multiple-dropdown-component.cjs +249 -0
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/typed-multiple-dropdown-component.d.cts +1 -1
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/typed-range-text-component.cjs +1 -1
- package/dist/lib/cjs/obsidian/setting-components/typed-text-component.cjs +224 -0
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/typed-text-component.d.cts +2 -2
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/url-component.cjs +2 -2
- package/dist/lib/cjs/obsidian/setting-components/validator-component.cjs +226 -0
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/validator-component.d.cts +1 -1
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/value-component-with-change-tracking.cjs +1 -1
- package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/week-component.cjs +3 -3
- package/dist/lib/cjs/obsidian/setting-ex.cjs +21 -21
- package/dist/lib/cjs/obsidian/setting-ex.d.cts +20 -20
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/obsidian-plugin-builder.cjs +1 -1
- package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/obsidian-plugin-builder.d.cts +2 -2
- package/dist/lib/cjs/script-utils/linters/eslint-config.cjs +2 -1
- package/dist/lib/cjs/script-utils/linters/eslint-config.d.cts +2 -2
- package/dist/lib/cjs/type.cjs +1 -1
- package/dist/lib/esm/async-events.d.mts +19 -19
- package/dist/lib/esm/async-events.mjs +15 -18
- package/dist/lib/esm/async.d.mts +9 -8
- package/dist/lib/esm/async.mjs +1 -1
- package/dist/lib/esm/function.d.mts +43 -3
- package/dist/lib/esm/function.mjs +1 -1
- package/dist/lib/esm/library.mjs +1 -1
- package/dist/lib/esm/obsidian/async-with-notice.d.mts +2 -2
- package/dist/lib/esm/obsidian/async-with-notice.mjs +1 -1
- package/dist/lib/esm/obsidian/{plugin/components → components}/abort-signal-component.d.mts +2 -2
- package/dist/lib/esm/obsidian/components/abort-signal-component.mjs +59 -0
- package/dist/lib/{cjs/obsidian/components/all-windows-event-handler.d.cts → esm/obsidian/components/all-windows-event-component.d.mts} +6 -7
- package/dist/lib/esm/obsidian/components/all-windows-event-component.mjs +93 -0
- package/dist/lib/esm/obsidian/components/async-component.d.mts +2 -1
- package/dist/lib/esm/obsidian/components/async-component.mjs +3 -2
- package/dist/lib/esm/obsidian/{plugin/components → components}/async-error-handler-component.d.mts +2 -2
- package/dist/lib/esm/obsidian/components/async-error-handler-component.mjs +62 -0
- package/dist/lib/esm/obsidian/components/async-events-component.d.mts +2 -1
- package/dist/lib/esm/obsidian/components/async-events-component.mjs +3 -2
- package/dist/lib/esm/obsidian/{plugin/components → components}/console-debug-component.d.mts +2 -2
- package/dist/lib/esm/obsidian/components/console-debug-component.mjs +56 -0
- package/dist/lib/esm/obsidian/components/disposable-component.d.mts +34 -0
- package/dist/lib/esm/obsidian/components/disposable-component.mjs +50 -0
- package/dist/lib/esm/obsidian/{plugin/components → components}/i18n-component.d.mts +2 -2
- package/dist/lib/esm/obsidian/components/i18n-component.mjs +53 -0
- package/dist/lib/esm/obsidian/components/index.d.mts +13 -2
- package/dist/lib/esm/obsidian/components/index.mjs +27 -5
- package/dist/lib/esm/obsidian/components/layout-ready-component.d.mts +47 -0
- package/dist/lib/esm/obsidian/components/layout-ready-component.mjs +76 -0
- package/dist/lib/esm/obsidian/components/menu-event-registrar-component.d.mts +41 -0
- package/dist/lib/esm/obsidian/components/menu-event-registrar-component.mjs +64 -0
- package/dist/lib/esm/obsidian/components/monkey-around-component.d.mts +113 -0
- package/dist/lib/esm/obsidian/components/monkey-around-component.mjs +87 -0
- package/dist/lib/esm/obsidian/{plugin/components → components}/plugin-context-component.d.mts +2 -2
- package/dist/lib/esm/obsidian/components/plugin-context-component.mjs +61 -0
- package/dist/lib/esm/obsidian/{plugin/components → components}/plugin-notice-component.d.mts +2 -2
- package/dist/lib/esm/obsidian/components/plugin-notice-component.mjs +58 -0
- package/dist/lib/esm/obsidian/{plugin/components → components}/plugin-settings-component.d.mts +6 -21
- package/dist/lib/esm/obsidian/components/plugin-settings-component.mjs +433 -0
- package/dist/lib/esm/obsidian/{plugin/components → components}/plugin-settings-tab-component.d.mts +5 -5
- package/dist/lib/esm/obsidian/components/plugin-settings-tab-component.mjs +50 -0
- package/dist/lib/esm/obsidian/constructors/getDomEventsHandlersConstructor.mjs +20 -16
- package/dist/lib/esm/obsidian/dataview.d.mts +1 -1
- package/dist/lib/esm/obsidian/dataview.mjs +1 -1
- package/dist/lib/esm/obsidian/index.d.mts +2 -1
- package/dist/lib/esm/obsidian/index.mjs +5 -3
- package/dist/lib/esm/obsidian/loop.d.mts +2 -2
- package/dist/lib/esm/obsidian/loop.mjs +1 -1
- package/dist/lib/esm/obsidian/markdown.mjs +13 -7
- package/dist/lib/esm/obsidian/menu-event-registrar.d.mts +1 -35
- package/dist/lib/esm/obsidian/menu-event-registrar.mjs +1 -42
- package/dist/lib/esm/obsidian/modals/prompt.d.mts +1 -1
- package/dist/lib/esm/obsidian/modals/prompt.mjs +1 -1
- package/dist/lib/esm/obsidian/modals/select-item.d.mts +1 -1
- package/dist/lib/esm/obsidian/modals/select-item.mjs +1 -1
- package/dist/lib/esm/obsidian/path-settings.mjs +135 -0
- package/dist/lib/esm/obsidian/plugin/index.d.mts +0 -2
- package/dist/lib/esm/obsidian/plugin/index.mjs +1 -5
- package/dist/lib/esm/obsidian/plugin/plugin-settings-tab.d.mts +5 -5
- package/dist/lib/esm/obsidian/plugin/plugin-settings-tab.mjs +4 -4
- package/dist/lib/esm/obsidian/plugin/plugin.d.mts +13 -11
- package/dist/lib/esm/obsidian/plugin/plugin.mjs +39 -34
- package/dist/lib/esm/obsidian/queue.d.mts +2 -2
- package/dist/lib/esm/obsidian/queue.mjs +1 -1
- package/dist/lib/esm/obsidian/rename-delete-handler.mjs +22 -12
- package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/checkbox-component.d.mts +1 -1
- package/dist/lib/esm/obsidian/setting-components/checkbox-component.mjs +101 -0
- package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/code-highlighter-component.d.mts +1 -1
- package/dist/lib/esm/obsidian/setting-components/code-highlighter-component.mjs +254 -0
- package/dist/lib/esm/obsidian/setting-components/date-component.mjs +62 -0
- package/dist/lib/esm/obsidian/setting-components/date-time-component.mjs +62 -0
- package/dist/lib/esm/obsidian/setting-components/email-component.mjs +72 -0
- package/dist/lib/esm/obsidian/setting-components/file-component.mjs +66 -0
- package/dist/lib/esm/obsidian/setting-components/index.mjs +78 -0
- package/dist/lib/esm/obsidian/setting-components/month-component.mjs +70 -0
- package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/multiple-dropdown-component.d.mts +1 -1
- package/dist/lib/esm/obsidian/setting-components/multiple-dropdown-component.mjs +136 -0
- package/dist/lib/esm/obsidian/setting-components/multiple-email-component.mjs +59 -0
- package/dist/lib/esm/obsidian/setting-components/multiple-file-component.mjs +68 -0
- package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/multiple-text-component.d.mts +1 -1
- package/dist/lib/esm/obsidian/setting-components/multiple-text-component.mjs +149 -0
- package/dist/lib/esm/obsidian/setting-components/number-component.mjs +82 -0
- package/dist/lib/esm/obsidian/setting-components/password-component.mjs +58 -0
- package/dist/lib/esm/obsidian/setting-components/setting-component-wrapper.mjs +45 -0
- package/dist/lib/esm/obsidian/setting-components/telephone-component.mjs +72 -0
- package/dist/lib/esm/obsidian/setting-components/text-based-component.mjs +58 -0
- package/dist/lib/esm/obsidian/setting-components/time-component.mjs +67 -0
- package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/tri-state-checkbox-component.d.mts +1 -1
- package/dist/lib/esm/obsidian/setting-components/tri-state-checkbox-component.mjs +102 -0
- package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/typed-dropdown-component.d.mts +1 -1
- package/dist/lib/esm/obsidian/setting-components/typed-dropdown-component.mjs +142 -0
- package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/typed-multiple-dropdown-component.d.mts +1 -1
- package/dist/lib/esm/obsidian/setting-components/typed-multiple-dropdown-component.mjs +141 -0
- package/dist/lib/esm/obsidian/setting-components/typed-range-text-component.mjs +60 -0
- package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/typed-text-component.d.mts +2 -2
- package/dist/lib/esm/obsidian/setting-components/typed-text-component.mjs +119 -0
- package/dist/lib/esm/obsidian/setting-components/url-component.mjs +72 -0
- package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/validator-component.d.mts +1 -1
- package/dist/lib/esm/obsidian/setting-components/validator-component.mjs +127 -0
- package/dist/lib/esm/obsidian/setting-components/week-component.mjs +70 -0
- package/dist/lib/esm/obsidian/setting-ex.d.mts +20 -20
- package/dist/lib/esm/obsidian/setting-ex.mjs +21 -21
- package/dist/lib/esm/script-utils/bundlers/esbuild-impl/obsidian-plugin-builder.d.mts +2 -2
- package/dist/lib/esm/script-utils/bundlers/esbuild-impl/obsidian-plugin-builder.mjs +1 -1
- package/dist/lib/esm/script-utils/linters/eslint-config.d.mts +2 -2
- package/dist/lib/esm/script-utils/linters/eslint-config.mjs +2 -1
- package/dist/lib/esm/type.mjs +1 -1
- package/obsidian/Components/abort-signal-component/package.json +6 -0
- package/obsidian/Components/{all-windows-event-handler → all-windows-event-component}/package.json +3 -3
- package/obsidian/Components/async-error-handler-component/package.json +6 -0
- package/obsidian/Components/console-debug-component/package.json +6 -0
- package/obsidian/Components/disposable-component/package.json +6 -0
- package/obsidian/Components/i18n-component/package.json +6 -0
- package/obsidian/Components/layout-ready-component/package.json +6 -0
- package/obsidian/Components/menu-event-registrar-component/package.json +6 -0
- package/obsidian/Components/monkey-around-component/package.json +6 -0
- package/obsidian/Components/plugin-context-component/package.json +6 -0
- package/obsidian/Components/plugin-notice-component/package.json +6 -0
- package/obsidian/Components/plugin-settings-component/package.json +6 -0
- package/obsidian/Components/plugin-settings-tab-component/package.json +6 -0
- package/obsidian/path-settings/package.json +6 -0
- package/obsidian/setting-components/checkbox-component/package.json +6 -0
- package/obsidian/setting-components/code-highlighter-component/package.json +6 -0
- package/obsidian/setting-components/date-component/package.json +6 -0
- package/obsidian/setting-components/date-time-component/package.json +6 -0
- package/obsidian/setting-components/email-component/package.json +6 -0
- package/obsidian/setting-components/file-component/package.json +6 -0
- package/obsidian/setting-components/index/package.json +6 -0
- package/obsidian/setting-components/month-component/package.json +6 -0
- package/obsidian/setting-components/multiple-dropdown-component/package.json +6 -0
- package/obsidian/setting-components/multiple-email-component/package.json +6 -0
- package/obsidian/setting-components/multiple-file-component/package.json +6 -0
- package/obsidian/setting-components/multiple-text-component/package.json +6 -0
- package/obsidian/setting-components/number-component/package.json +6 -0
- package/obsidian/setting-components/package.json +6 -0
- package/obsidian/setting-components/password-component/package.json +6 -0
- package/obsidian/setting-components/setting-component-wrapper/package.json +6 -0
- package/obsidian/setting-components/telephone-component/package.json +6 -0
- package/obsidian/setting-components/text-based-component/package.json +6 -0
- package/obsidian/setting-components/time-component/package.json +6 -0
- package/obsidian/setting-components/tri-state-checkbox-component/package.json +6 -0
- package/obsidian/setting-components/typed-dropdown-component/package.json +6 -0
- package/obsidian/setting-components/typed-multiple-dropdown-component/package.json +6 -0
- package/obsidian/setting-components/typed-range-text-component/package.json +6 -0
- package/obsidian/setting-components/typed-text-component/package.json +6 -0
- package/obsidian/setting-components/url-component/package.json +6 -0
- package/obsidian/setting-components/validator-component/package.json +6 -0
- package/obsidian/setting-components/value-component-with-change-tracking/package.json +6 -0
- package/obsidian/setting-components/week-component/package.json +6 -0
- package/package.json +23 -43
- package/dist/lib/cjs/obsidian/components/all-windows-event-handler.cjs +0 -196
- package/dist/lib/cjs/obsidian/components/setting-components/checkbox-component.cjs +0 -209
- package/dist/lib/cjs/obsidian/components/setting-components/code-highlighter-component.cjs +0 -356
- package/dist/lib/cjs/obsidian/components/setting-components/multiple-dropdown-component.cjs +0 -241
- package/dist/lib/cjs/obsidian/components/setting-components/multiple-text-component.cjs +0 -254
- package/dist/lib/cjs/obsidian/components/setting-components/tri-state-checkbox-component.cjs +0 -210
- package/dist/lib/cjs/obsidian/components/setting-components/typed-dropdown-component.cjs +0 -247
- package/dist/lib/cjs/obsidian/components/setting-components/typed-multiple-dropdown-component.cjs +0 -249
- package/dist/lib/cjs/obsidian/components/setting-components/typed-text-component.cjs +0 -224
- package/dist/lib/cjs/obsidian/components/setting-components/validator-component.cjs +0 -226
- package/dist/lib/cjs/obsidian/monkey-around.cjs +0 -177
- package/dist/lib/cjs/obsidian/monkey-around.d.cts +0 -62
- package/dist/lib/cjs/obsidian/plugin/components/index.cjs +0 -170
- package/dist/lib/cjs/obsidian/plugin/components/index.d.cts +0 -9
- package/dist/lib/cjs/obsidian/plugin/components/layout-ready-component.cjs +0 -124
- package/dist/lib/cjs/obsidian/plugin/components/layout-ready-component.d.cts +0 -18
- package/dist/lib/cjs/obsidian/plugin/components/plugin-settings-component.cjs +0 -563
- package/dist/lib/cjs/obsidian/plugin/path-settings.cjs +0 -239
- package/dist/lib/esm/obsidian/components/all-windows-event-handler.mjs +0 -88
- package/dist/lib/esm/obsidian/components/setting-components/checkbox-component.mjs +0 -101
- package/dist/lib/esm/obsidian/components/setting-components/code-highlighter-component.mjs +0 -254
- package/dist/lib/esm/obsidian/components/setting-components/date-component.mjs +0 -62
- package/dist/lib/esm/obsidian/components/setting-components/date-time-component.mjs +0 -62
- package/dist/lib/esm/obsidian/components/setting-components/email-component.mjs +0 -72
- package/dist/lib/esm/obsidian/components/setting-components/file-component.mjs +0 -66
- package/dist/lib/esm/obsidian/components/setting-components/index.mjs +0 -78
- package/dist/lib/esm/obsidian/components/setting-components/month-component.mjs +0 -70
- package/dist/lib/esm/obsidian/components/setting-components/multiple-dropdown-component.mjs +0 -136
- package/dist/lib/esm/obsidian/components/setting-components/multiple-email-component.mjs +0 -59
- package/dist/lib/esm/obsidian/components/setting-components/multiple-file-component.mjs +0 -68
- package/dist/lib/esm/obsidian/components/setting-components/multiple-text-component.mjs +0 -149
- package/dist/lib/esm/obsidian/components/setting-components/number-component.mjs +0 -82
- package/dist/lib/esm/obsidian/components/setting-components/password-component.mjs +0 -58
- package/dist/lib/esm/obsidian/components/setting-components/setting-component-wrapper.mjs +0 -45
- package/dist/lib/esm/obsidian/components/setting-components/telephone-component.mjs +0 -72
- package/dist/lib/esm/obsidian/components/setting-components/text-based-component.mjs +0 -58
- package/dist/lib/esm/obsidian/components/setting-components/time-component.mjs +0 -67
- package/dist/lib/esm/obsidian/components/setting-components/tri-state-checkbox-component.mjs +0 -102
- package/dist/lib/esm/obsidian/components/setting-components/typed-dropdown-component.mjs +0 -142
- package/dist/lib/esm/obsidian/components/setting-components/typed-multiple-dropdown-component.mjs +0 -141
- package/dist/lib/esm/obsidian/components/setting-components/typed-range-text-component.mjs +0 -60
- package/dist/lib/esm/obsidian/components/setting-components/typed-text-component.mjs +0 -119
- package/dist/lib/esm/obsidian/components/setting-components/url-component.mjs +0 -72
- package/dist/lib/esm/obsidian/components/setting-components/validator-component.mjs +0 -127
- package/dist/lib/esm/obsidian/components/setting-components/week-component.mjs +0 -70
- package/dist/lib/esm/obsidian/monkey-around.d.mts +0 -62
- package/dist/lib/esm/obsidian/monkey-around.mjs +0 -66
- package/dist/lib/esm/obsidian/plugin/components/abort-signal-component.mjs +0 -59
- package/dist/lib/esm/obsidian/plugin/components/async-error-handler-component.mjs +0 -62
- package/dist/lib/esm/obsidian/plugin/components/console-debug-component.mjs +0 -56
- package/dist/lib/esm/obsidian/plugin/components/i18n-component.mjs +0 -53
- package/dist/lib/esm/obsidian/plugin/components/index.d.mts +0 -9
- package/dist/lib/esm/obsidian/plugin/components/index.mjs +0 -44
- package/dist/lib/esm/obsidian/plugin/components/layout-ready-component.d.mts +0 -18
- package/dist/lib/esm/obsidian/plugin/components/layout-ready-component.mjs +0 -24
- package/dist/lib/esm/obsidian/plugin/components/plugin-context-component.mjs +0 -61
- package/dist/lib/esm/obsidian/plugin/components/plugin-notice-component.mjs +0 -60
- package/dist/lib/esm/obsidian/plugin/components/plugin-settings-component.mjs +0 -461
- package/dist/lib/esm/obsidian/plugin/components/plugin-settings-tab-component.mjs +0 -49
- package/dist/lib/esm/obsidian/plugin/path-settings.mjs +0 -135
- package/obsidian/Components/setting-components/checkbox-component/package.json +0 -6
- package/obsidian/Components/setting-components/code-highlighter-component/package.json +0 -6
- package/obsidian/Components/setting-components/date-component/package.json +0 -6
- package/obsidian/Components/setting-components/date-time-component/package.json +0 -6
- package/obsidian/Components/setting-components/email-component/package.json +0 -6
- package/obsidian/Components/setting-components/file-component/package.json +0 -6
- package/obsidian/Components/setting-components/index/package.json +0 -6
- package/obsidian/Components/setting-components/month-component/package.json +0 -6
- package/obsidian/Components/setting-components/multiple-dropdown-component/package.json +0 -6
- package/obsidian/Components/setting-components/multiple-email-component/package.json +0 -6
- package/obsidian/Components/setting-components/multiple-file-component/package.json +0 -6
- package/obsidian/Components/setting-components/multiple-text-component/package.json +0 -6
- package/obsidian/Components/setting-components/number-component/package.json +0 -6
- package/obsidian/Components/setting-components/package.json +0 -6
- package/obsidian/Components/setting-components/password-component/package.json +0 -6
- package/obsidian/Components/setting-components/setting-component-wrapper/package.json +0 -6
- package/obsidian/Components/setting-components/telephone-component/package.json +0 -6
- package/obsidian/Components/setting-components/text-based-component/package.json +0 -6
- package/obsidian/Components/setting-components/time-component/package.json +0 -6
- package/obsidian/Components/setting-components/tri-state-checkbox-component/package.json +0 -6
- package/obsidian/Components/setting-components/typed-dropdown-component/package.json +0 -6
- package/obsidian/Components/setting-components/typed-multiple-dropdown-component/package.json +0 -6
- package/obsidian/Components/setting-components/typed-range-text-component/package.json +0 -6
- package/obsidian/Components/setting-components/typed-text-component/package.json +0 -6
- package/obsidian/Components/setting-components/url-component/package.json +0 -6
- package/obsidian/Components/setting-components/validator-component/package.json +0 -6
- package/obsidian/Components/setting-components/value-component-with-change-tracking/package.json +0 -6
- package/obsidian/Components/setting-components/week-component/package.json +0 -6
- package/obsidian/Plugin/components/abort-signal-component/package.json +0 -6
- package/obsidian/Plugin/components/async-error-handler-component/package.json +0 -6
- package/obsidian/Plugin/components/console-debug-component/package.json +0 -6
- package/obsidian/Plugin/components/i18n-component/package.json +0 -6
- package/obsidian/Plugin/components/index/package.json +0 -6
- package/obsidian/Plugin/components/layout-ready-component/package.json +0 -6
- package/obsidian/Plugin/components/package.json +0 -6
- package/obsidian/Plugin/components/plugin-context-component/package.json +0 -6
- package/obsidian/Plugin/components/plugin-notice-component/package.json +0 -6
- package/obsidian/Plugin/components/plugin-settings-component/package.json +0 -6
- package/obsidian/Plugin/components/plugin-settings-tab-component/package.json +0 -6
- package/obsidian/Plugin/path-settings/package.json +0 -6
- package/obsidian/monkey-around/package.json +0 -6
- /package/dist/lib/cjs/obsidian/{plugin/path-settings.d.cts → path-settings.d.cts} +0 -0
- /package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/date-component.d.cts +0 -0
- /package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/date-time-component.d.cts +0 -0
- /package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/email-component.d.cts +0 -0
- /package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/file-component.d.cts +0 -0
- /package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/index.d.cts +0 -0
- /package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/month-component.d.cts +0 -0
- /package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/multiple-email-component.d.cts +0 -0
- /package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/multiple-file-component.d.cts +0 -0
- /package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/number-component.d.cts +0 -0
- /package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/password-component.d.cts +0 -0
- /package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/setting-component-wrapper.d.cts +0 -0
- /package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/telephone-component.d.cts +0 -0
- /package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/text-based-component.d.cts +0 -0
- /package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/time-component.d.cts +0 -0
- /package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/typed-range-text-component.d.cts +0 -0
- /package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/url-component.d.cts +0 -0
- /package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/value-component-with-change-tracking.d.cts +0 -0
- /package/dist/lib/cjs/obsidian/{components/setting-components → setting-components}/week-component.d.cts +0 -0
- /package/dist/lib/esm/obsidian/{plugin/path-settings.d.mts → path-settings.d.mts} +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/date-component.d.mts +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/date-time-component.d.mts +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/email-component.d.mts +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/file-component.d.mts +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/index.d.mts +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/month-component.d.mts +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/multiple-email-component.d.mts +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/multiple-file-component.d.mts +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/number-component.d.mts +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/password-component.d.mts +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/setting-component-wrapper.d.mts +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/telephone-component.d.mts +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/text-based-component.d.mts +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/time-component.d.mts +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/typed-range-text-component.d.mts +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/url-component.d.mts +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/value-component-with-change-tracking.d.mts +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/value-component-with-change-tracking.mjs +0 -0
- /package/dist/lib/esm/obsidian/{components/setting-components → setting-components}/week-component.d.mts +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
8
|
+
if (globalThis.process) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const browserProcess = {
|
|
13
|
+
browser: true,
|
|
14
|
+
cwd() {
|
|
15
|
+
return '/';
|
|
16
|
+
},
|
|
17
|
+
env: {},
|
|
18
|
+
platform: 'android'
|
|
19
|
+
};
|
|
20
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
21
|
+
globalThis.process = browserProcess;
|
|
22
|
+
})();
|
|
23
|
+
|
|
24
|
+
import { invokeAsyncSafely } from "../../async.mjs";
|
|
25
|
+
import { DisposableComponent } from "./disposable-component.mjs";
|
|
26
|
+
class LayoutReadyComponent extends DisposableComponent {
|
|
27
|
+
/**
|
|
28
|
+
* Creates a new LayoutReadyComponent instance.
|
|
29
|
+
*
|
|
30
|
+
* @param app - The Obsidian App instance.
|
|
31
|
+
*/
|
|
32
|
+
constructor(app) {
|
|
33
|
+
super();
|
|
34
|
+
this.app = app;
|
|
35
|
+
}
|
|
36
|
+
app;
|
|
37
|
+
/**
|
|
38
|
+
* Loads the component and registers the layout ready handler.
|
|
39
|
+
*/
|
|
40
|
+
onload() {
|
|
41
|
+
super.onload();
|
|
42
|
+
this.app.workspace.onLayoutReady(() => {
|
|
43
|
+
window.setTimeout(() => {
|
|
44
|
+
if (this._loaded) {
|
|
45
|
+
invokeAsyncSafely(this.onLayoutReady.bind(this));
|
|
46
|
+
}
|
|
47
|
+
}, 0);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
class CallbackLayoutReadyComponent extends LayoutReadyComponent {
|
|
52
|
+
/**
|
|
53
|
+
* Creates a new CallbackLayoutReadyComponent instance.
|
|
54
|
+
*
|
|
55
|
+
* @param app - The Obsidian App instance.
|
|
56
|
+
* @param callback - The callback to invoke when layout is ready.
|
|
57
|
+
*/
|
|
58
|
+
constructor(app, callback) {
|
|
59
|
+
super(app);
|
|
60
|
+
this.callback = callback;
|
|
61
|
+
}
|
|
62
|
+
callback;
|
|
63
|
+
/**
|
|
64
|
+
* Executes when the Obsidian layout becomes ready.
|
|
65
|
+
*
|
|
66
|
+
* @returns The result of invoking the callback.
|
|
67
|
+
*/
|
|
68
|
+
onLayoutReady() {
|
|
69
|
+
return this.callback();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
CallbackLayoutReadyComponent,
|
|
74
|
+
LayoutReadyComponent
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2NvbXBvbmVudHMvbGF5b3V0LXJlYWR5LWNvbXBvbmVudC50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAZmlsZVxuICpcbiAqIEludGVyZmFjZSBmb3IgY29tcG9uZW50cyB0aGF0IG5lZWQgdG8gcGVyZm9ybSB3b3JrIHdoZW4gdGhlIHdvcmtzcGFjZSBsYXlvdXQgaXMgcmVhZHkuXG4gKi9cblxuaW1wb3J0IHR5cGUgeyBBcHAgfSBmcm9tICdvYnNpZGlhbic7XG5pbXBvcnQgdHlwZSB7IFByb21pc2FibGUgfSBmcm9tICd0eXBlLWZlc3QnO1xuXG5pbXBvcnQgeyBpbnZva2VBc3luY1NhZmVseSB9IGZyb20gJy4uLy4uL2FzeW5jLnRzJztcbmltcG9ydCB7IERpc3Bvc2FibGVDb21wb25lbnQgfSBmcm9tICcuL2Rpc3Bvc2FibGUtY29tcG9uZW50LnRzJztcblxuLyoqXG4gKiBBIGNvbXBvbmVudCB0aGF0IGV4ZWN1dGVzIGEgY2FsbGJhY2sgZnVuY3Rpb24gd2hlbiB0aGUgT2JzaWRpYW4gbGF5b3V0IGJlY29tZXMgcmVhZHkuXG4gKi9cbmV4cG9ydCBhYnN0cmFjdCBjb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RUFGb0M7QUFBQTtBQUFBO0FBQUE7QUFBQSxFQU9wQixTQUFlO0FBQzdCLFVBQU0sT0FBTztBQUNiLFNBQUssSUFBSSxVQUFVLGNBQWMsTUFBTTtBQUNyQyxhQUFPLFdBQVcsTUFBTTtBQUN0QixZQUFJLEtBQUssU0FBUztBQUNoQiw0QkFBa0IsS0FBSyxjQUFjLEtBQUssSUFBSSxDQUFDO0FBQUEsUUFDakQ7QUFBQSxNQUNGLEdBQUcsQ0FBQztBQUFBLElBQ04sQ0FBQztBQUFBLEVBQ0g7QUFNRjtBQUtPLE1BQU0scUNBQXFDLHFCQUFxQjtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBLEVBTzlELFlBQVksS0FBMkIsVUFBa0M7QUFDOUUsVUFBTSxHQUFHO0FBRG1DO0FBQUEsRUFFOUM7QUFBQSxFQUY4QztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQSxFQVMzQixnQkFBa0M7QUFDbkQsV0FBTyxLQUFLLFNBQVM7QUFBQSxFQUN2QjtBQUNGOyIsCiAgIm5hbWVzIjogW10KfQo=
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file
|
|
3
|
+
*
|
|
4
|
+
* Registers menu event handlers with Obsidian's workspace, supporting editor, file, and multi-file context menus.
|
|
5
|
+
*/
|
|
6
|
+
import type { App } from 'obsidian';
|
|
7
|
+
import type { EditorMenuEventHandler, FileMenuEventHandler, FilesMenuEventHandler, MenuEventRegistrar } from '../menu-event-registrar.mjs';
|
|
8
|
+
import { DisposableComponent } from './disposable-component.mjs';
|
|
9
|
+
/**
|
|
10
|
+
* {@link MenuEventRegistrar} backed by Obsidian's {@link App} workspace events.
|
|
11
|
+
*
|
|
12
|
+
* Event handlers are registered with the provided {@link Component} for lifecycle management.
|
|
13
|
+
*/
|
|
14
|
+
/** */
|
|
15
|
+
export declare class MenuEventRegistrarComponent extends DisposableComponent implements MenuEventRegistrar {
|
|
16
|
+
private readonly app;
|
|
17
|
+
/**
|
|
18
|
+
* Creates a new app-backed menu event registrar.
|
|
19
|
+
*
|
|
20
|
+
* @param app - The Obsidian app instance.
|
|
21
|
+
*/
|
|
22
|
+
constructor(app: App);
|
|
23
|
+
/**
|
|
24
|
+
* Registers a handler for the editor context menu event.
|
|
25
|
+
*
|
|
26
|
+
* @param handler - The handler to register.
|
|
27
|
+
*/
|
|
28
|
+
registerEditorMenuEventHandler(handler: EditorMenuEventHandler): void;
|
|
29
|
+
/**
|
|
30
|
+
* Registers a handler for the single-file context menu event.
|
|
31
|
+
*
|
|
32
|
+
* @param handler - The handler to register.
|
|
33
|
+
*/
|
|
34
|
+
registerFileMenuEventHandler(handler: FileMenuEventHandler): void;
|
|
35
|
+
/**
|
|
36
|
+
* Registers a handler for the multi-file context menu event.
|
|
37
|
+
*
|
|
38
|
+
* @param handler - The handler to register.
|
|
39
|
+
*/
|
|
40
|
+
registerFilesMenuEventHandler(handler: FilesMenuEventHandler): void;
|
|
41
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
8
|
+
if (globalThis.process) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const browserProcess = {
|
|
13
|
+
browser: true,
|
|
14
|
+
cwd() {
|
|
15
|
+
return '/';
|
|
16
|
+
},
|
|
17
|
+
env: {},
|
|
18
|
+
platform: 'android'
|
|
19
|
+
};
|
|
20
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
21
|
+
globalThis.process = browserProcess;
|
|
22
|
+
})();
|
|
23
|
+
|
|
24
|
+
import { DisposableComponent } from "./disposable-component.mjs";
|
|
25
|
+
class MenuEventRegistrarComponent extends DisposableComponent {
|
|
26
|
+
/**
|
|
27
|
+
* Creates a new app-backed menu event registrar.
|
|
28
|
+
*
|
|
29
|
+
* @param app - The Obsidian app instance.
|
|
30
|
+
*/
|
|
31
|
+
constructor(app) {
|
|
32
|
+
super();
|
|
33
|
+
this.app = app;
|
|
34
|
+
}
|
|
35
|
+
app;
|
|
36
|
+
/**
|
|
37
|
+
* Registers a handler for the editor context menu event.
|
|
38
|
+
*
|
|
39
|
+
* @param handler - The handler to register.
|
|
40
|
+
*/
|
|
41
|
+
registerEditorMenuEventHandler(handler) {
|
|
42
|
+
this.registerEvent(this.app.workspace.on("editor-menu", handler));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Registers a handler for the single-file context menu event.
|
|
46
|
+
*
|
|
47
|
+
* @param handler - The handler to register.
|
|
48
|
+
*/
|
|
49
|
+
registerFileMenuEventHandler(handler) {
|
|
50
|
+
this.registerEvent(this.app.workspace.on("file-menu", handler));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Registers a handler for the multi-file context menu event.
|
|
54
|
+
*
|
|
55
|
+
* @param handler - The handler to register.
|
|
56
|
+
*/
|
|
57
|
+
registerFilesMenuEventHandler(handler) {
|
|
58
|
+
this.registerEvent(this.app.workspace.on("files-menu", handler));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
MenuEventRegistrarComponent
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2NvbXBvbmVudHMvbWVudS1ldmVudC1yZWdpc3RyYXItY29tcG9uZW50LnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyIvKipcbiAqIEBmaWxlXG4gKlxuICogUmVnaXN0ZXJzIG1lbnUgZXZlbnQgaGFuZGxlcn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RXZlbnRIYW5kbGVyKTogdm9pZCB7XG4gICAgdGhpcy5yZWdpc3RlckV2ZW50KHRoaXMuYXBwLndvcmtzcGFjZS5vbignZmlsZXMtbWVudScsIGhhbmRsZXIpKTtcbiAgfVxufVxuIl0sCiAgIm1hcHBpbmdzIjogIjs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFlQSxTQUFTLDJCQUEyQjtBQVM3QixNQUFNLG9DQUFvQyxvQkFBa0Q7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUEsRUFNMUYsWUFBNkIsS0FBVTtBQUM1QyxVQUFNO0FBRDRCO0FBQUEsRUFFcEM7QUFBQSxFQUZvQztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQSxFQVM3QiwrQkFBK0IsU0FBdUM7QUFDM0UsU0FBSyxjQUFjLEtBQUssSUFBSSxVQUFVLEdBQUcsZUFBZSxPQUFPLENBQUM7QUFBQSxFQUNsRTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQSxFQU9PLDZCQUE2QixTQUFxQztBQUN2RSxTQUFLLGNBQWMsS0FBSyxJQUFJLFVBQVUsR0FBRyxhQUFhLE9BQU8sQ0FBQztBQUFBLEVBQ2hFO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBLEVBT08sOEJBQThCLFNBQXNDO0FBQ3pFLFNBQUssY0FBYyxLQUFLLElBQUksVUFBVSxHQUFHLGNBQWMsT0FBTyxDQUFDO0FBQUEsRUFDakU7QUFDRjsiLAogICJuYW1lcyI6IFtdCn0K
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file
|
|
3
|
+
*
|
|
4
|
+
* Improved type-safe wrapper of {@link https://www.npmjs.com/package/monkey-around} library.
|
|
5
|
+
*/
|
|
6
|
+
import type { ConditionalKeys } from 'type-fest';
|
|
7
|
+
import type { GenericFunction } from '../../function.mjs';
|
|
8
|
+
import { DisposableComponent } from './disposable-component.mjs';
|
|
9
|
+
/**
|
|
10
|
+
* A type of the factories to apply to the object.
|
|
11
|
+
*
|
|
12
|
+
* @typeParam Obj - The object to patch.
|
|
13
|
+
*/
|
|
14
|
+
export type Factories<Obj extends object> = Partial<{
|
|
15
|
+
[Key in ConditionalKeys<Obj, GenericFunction | undefined>]: WrapperFactory<Extract<Obj[Key], GenericFunction | undefined>>;
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Parameters passed to {@link MonkeyAroundComponent#registerMethodPatch}.
|
|
19
|
+
*
|
|
20
|
+
* @typeParam Obj - The object to patch.
|
|
21
|
+
* @typeParam MethodName - The method name to patch.
|
|
22
|
+
*/
|
|
23
|
+
export interface MonkeyAroundComponentRegisterMethodPatchParams<Obj extends object, MethodName extends MethodKeys<Obj>> {
|
|
24
|
+
/**
|
|
25
|
+
* The method name to patch.
|
|
26
|
+
*/
|
|
27
|
+
readonly methodName: MethodName;
|
|
28
|
+
/**
|
|
29
|
+
* The object to patch.
|
|
30
|
+
*/
|
|
31
|
+
readonly obj: Obj;
|
|
32
|
+
/**
|
|
33
|
+
* The patch handler function.
|
|
34
|
+
*/
|
|
35
|
+
readonly patchHandler: PatchHandlerFn<Obj, MethodName>;
|
|
36
|
+
/**
|
|
37
|
+
* An optional token to identify the patch.
|
|
38
|
+
*/
|
|
39
|
+
readonly patchToken?: symbol;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A patch handler function that intercepts calls to a method on an object.
|
|
43
|
+
*
|
|
44
|
+
* @typeParam Obj - The object being patched.
|
|
45
|
+
* @typeParam K - The method name being patched.
|
|
46
|
+
*/
|
|
47
|
+
export type PatchHandlerFn<Obj extends object, K extends MethodKeys<Obj>> = (params: PatchHandlerParams<Obj, K>) => ReturnType<Extract<Obj[K], GenericFunction>>;
|
|
48
|
+
/**
|
|
49
|
+
* Parameters passed to a {@link PatchHandlerFn} callback.
|
|
50
|
+
*
|
|
51
|
+
* @typeParam Obj - The object being patched.
|
|
52
|
+
* @typeParam K - The method name being patched.
|
|
53
|
+
*/
|
|
54
|
+
export interface PatchHandlerParams<Obj extends object, K extends MethodKeys<Obj>> {
|
|
55
|
+
fallback(this: void): ReturnType<Extract<Obj[K], GenericFunction>>;
|
|
56
|
+
/**
|
|
57
|
+
* The original arguments of the intercepted call, as a tuple.
|
|
58
|
+
*/
|
|
59
|
+
readonly originalArgs: Parameters<Extract<Obj[K], GenericFunction>>;
|
|
60
|
+
/**
|
|
61
|
+
* The original (unpatched) function. Call via `originalFn.call(originalThis, ...originalArgs)`.
|
|
62
|
+
*/
|
|
63
|
+
readonly originalMethod: Extract<Obj[K], GenericFunction>;
|
|
64
|
+
readonly originalMethodBound: OmitThisParameter<Extract<Obj[K], GenericFunction>>;
|
|
65
|
+
/**
|
|
66
|
+
* The original `this` context of the intercepted call.
|
|
67
|
+
*/
|
|
68
|
+
readonly originalThis: Obj;
|
|
69
|
+
}
|
|
70
|
+
type MethodKeys<Obj extends object> = ConditionalKeys<Obj, Function | undefined> & keyof Obj;
|
|
71
|
+
type Uninstaller = () => void;
|
|
72
|
+
type WrapperFactory<T extends Function | undefined> = (next: T) => T;
|
|
73
|
+
/**
|
|
74
|
+
* A component that manages monkey-patches with lifecycle-bound cleanup.
|
|
75
|
+
* All patches registered via this component are automatically uninstalled when the component unloads.
|
|
76
|
+
*/
|
|
77
|
+
export declare class MonkeyAroundComponent extends DisposableComponent {
|
|
78
|
+
/**
|
|
79
|
+
* Registers a single-method patch using a simplified handler.
|
|
80
|
+
*
|
|
81
|
+
* @typeParam Obj - The object to patch.
|
|
82
|
+
* @typeParam K - The method name to patch.
|
|
83
|
+
* @param params - The parameters of the patch.
|
|
84
|
+
*/
|
|
85
|
+
registerMethodPatch<Obj extends object, const MethodName extends MethodKeys<Obj>>(params: MonkeyAroundComponentRegisterMethodPatchParams<Obj, MethodName>): void;
|
|
86
|
+
/**
|
|
87
|
+
* Registers a patch using raw factories (advanced API).
|
|
88
|
+
*
|
|
89
|
+
* @typeParam Obj - The object to patch.
|
|
90
|
+
* @param obj - The object to patch.
|
|
91
|
+
* @param factories - The factories to apply to the object.
|
|
92
|
+
*/
|
|
93
|
+
registerPatch<Obj extends object>(obj: Obj, factories: Factories<Obj>): void;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Applies a patch to the object.
|
|
97
|
+
* Better strongly-typed version of `monkey-around`.
|
|
98
|
+
*
|
|
99
|
+
* @typeParam Obj - The object to patch.
|
|
100
|
+
* @param obj - The object to patch.
|
|
101
|
+
* @param factories - The factories to apply to the object.
|
|
102
|
+
* @returns The uninstaller that removes the patch when called.
|
|
103
|
+
*/
|
|
104
|
+
export declare function around<Obj extends object>(obj: Obj, factories: Factories<Obj>): Uninstaller;
|
|
105
|
+
/**
|
|
106
|
+
* Checks if a function has a specific patch token.
|
|
107
|
+
*
|
|
108
|
+
* @param fn - The function to check.
|
|
109
|
+
* @param patchToken - The patch token to check for.
|
|
110
|
+
* @returns Whether the function has the patch token.
|
|
111
|
+
*/
|
|
112
|
+
export declare function hasPatchToken(fn: GenericFunction, patchToken: symbol): boolean;
|
|
113
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
8
|
+
if (globalThis.process) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const browserProcess = {
|
|
13
|
+
browser: true,
|
|
14
|
+
cwd() {
|
|
15
|
+
return '/';
|
|
16
|
+
},
|
|
17
|
+
env: {},
|
|
18
|
+
platform: 'android'
|
|
19
|
+
};
|
|
20
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
21
|
+
globalThis.process = browserProcess;
|
|
22
|
+
})();
|
|
23
|
+
|
|
24
|
+
import { around as originalAround } from "monkey-around";
|
|
25
|
+
import { getObsidianDevUtilsState } from "../app.mjs";
|
|
26
|
+
import { DisposableComponent } from "./disposable-component.mjs";
|
|
27
|
+
class MonkeyAroundComponent extends DisposableComponent {
|
|
28
|
+
/**
|
|
29
|
+
* Registers a single-method patch using a simplified handler.
|
|
30
|
+
*
|
|
31
|
+
* @typeParam Obj - The object to patch.
|
|
32
|
+
* @typeParam K - The method name to patch.
|
|
33
|
+
* @param params - The parameters of the patch.
|
|
34
|
+
*/
|
|
35
|
+
registerMethodPatch(params) {
|
|
36
|
+
if (params.patchToken) {
|
|
37
|
+
const originalMethod = params.obj[params.methodName];
|
|
38
|
+
getMonkeyAroundPatches().set(originalMethod, params.patchToken);
|
|
39
|
+
}
|
|
40
|
+
this.registerPatch(params.obj, {
|
|
41
|
+
[params.methodName]: (originalMethod) => {
|
|
42
|
+
return patchedMethod;
|
|
43
|
+
function patchedMethod(...originalArgs) {
|
|
44
|
+
const originalThis = this;
|
|
45
|
+
return params.patchHandler({
|
|
46
|
+
fallback() {
|
|
47
|
+
return originalMethod.call(originalThis, ...originalArgs);
|
|
48
|
+
},
|
|
49
|
+
originalArgs,
|
|
50
|
+
originalMethod,
|
|
51
|
+
originalMethodBound: originalMethod.bind(originalThis),
|
|
52
|
+
originalThis
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Registers a patch using raw factories (advanced API).
|
|
60
|
+
*
|
|
61
|
+
* @typeParam Obj - The object to patch.
|
|
62
|
+
* @param obj - The object to patch.
|
|
63
|
+
* @param factories - The factories to apply to the object.
|
|
64
|
+
*/
|
|
65
|
+
registerPatch(obj, factories) {
|
|
66
|
+
if (!this._loaded) {
|
|
67
|
+
throw new Error("Cannot register patch on a component that is not loaded.");
|
|
68
|
+
}
|
|
69
|
+
const uninstaller = around(obj, factories);
|
|
70
|
+
this.register(uninstaller);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function around(obj, factories) {
|
|
74
|
+
return originalAround(obj, factories);
|
|
75
|
+
}
|
|
76
|
+
function hasPatchToken(fn, patchToken) {
|
|
77
|
+
return getMonkeyAroundPatches().get(fn) === patchToken;
|
|
78
|
+
}
|
|
79
|
+
function getMonkeyAroundPatches() {
|
|
80
|
+
return getObsidianDevUtilsState(null, "monkeyAroundPatches", /* @__PURE__ */ new WeakMap()).value;
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
MonkeyAroundComponent,
|
|
84
|
+
around,
|
|
85
|
+
hasPatchToken
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2NvbXBvbmVudHMvbW9ua2V5LWFyb3VuZC1jb21wb25lbnQudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGZpbGVcbiAqXG4gKiBJbXByb3ZlZCB0eXBlLXNhZmUgd3JhcHBlciBvZiB7QGxpbmsgaHR0cHM6Ly93d3cubnBtanMuY29tL3BhY2thZ2UvbW9ua2V5LWFyb3VuZH0gbGlicmFyeS5cbiAqL1xuXG5pbXBvcnQgdHlwZSB7IENvbmRpdGlvbmFsS2V5cyB9IGZyb20gJ3R5cGUtZmVzdCc7XG5cbmltcG9ydCB7IGFyb3VuZCBhcyBvcmlnaW5hbEFyb3VuZCB9IGZyb20gJ21vbmtleS1hcm91bmQnO1xuXG5pbXBvcnQgdHlwZSB7IEdlbmVyaWNGdW5jdGlvbiB9IGZyb20gJy4uLy4uL2Z1bmN0aW9uLnRzJztcbmltcG9ydCB0eXBlIHsgR2VuZXJpY09iamVjdCB9IGZyb20gJy4uLy4uL3R5cGUtZ3VhcmRzLnRzJztcblxuaW1wb3J0IHsgZ2V0T2J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FNBQU8sdUJBQXVCLEVBQUUsSUFBSSxFQUFFLE1BQU07QUFDOUM7QUFFQSxTQUFTLHlCQUEyRDtBQUNsRSxTQUFPLHlCQUF5QixNQUFNLHVCQUF1QixvQkFBSSxRQUFpQyxDQUFDLEVBQUU7QUFDdkc7IiwKICAibmFtZXMiOiBbXQp9Cg==
|
package/dist/lib/esm/obsidian/{plugin/components → components}/plugin-context-component.d.mts
RENAMED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Component that initializes the plugin context, debug controller, and library styles.
|
|
5
5
|
*/
|
|
6
6
|
import type { App } from 'obsidian';
|
|
7
|
-
import {
|
|
7
|
+
import { DisposableComponent } from './disposable-component.mjs';
|
|
8
8
|
interface PluginContextComponentConstructorParams {
|
|
9
9
|
readonly app: App;
|
|
10
10
|
readonly pluginId: string;
|
|
@@ -12,7 +12,7 @@ interface PluginContextComponentConstructorParams {
|
|
|
12
12
|
/**
|
|
13
13
|
* Initializes plugin context (plugin ID, debug controller, library styles) on load.
|
|
14
14
|
*/
|
|
15
|
-
export declare class PluginContextComponent extends
|
|
15
|
+
export declare class PluginContextComponent extends DisposableComponent {
|
|
16
16
|
/**
|
|
17
17
|
* The singleton key for the {@link PluginContextComponent} class.
|
|
18
18
|
*/
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
8
|
+
if (globalThis.process) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const browserProcess = {
|
|
13
|
+
browser: true,
|
|
14
|
+
cwd() {
|
|
15
|
+
return '/';
|
|
16
|
+
},
|
|
17
|
+
env: {},
|
|
18
|
+
platform: 'android'
|
|
19
|
+
};
|
|
20
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
21
|
+
globalThis.process = browserProcess;
|
|
22
|
+
})();
|
|
23
|
+
|
|
24
|
+
import {
|
|
25
|
+
initDebugController,
|
|
26
|
+
initPluginContext
|
|
27
|
+
} from "../plugin/plugin-context.mjs";
|
|
28
|
+
import { AllWindowsEventComponent } from "./all-windows-event-component.mjs";
|
|
29
|
+
import { DisposableComponent } from "./disposable-component.mjs";
|
|
30
|
+
class PluginContextComponent extends DisposableComponent {
|
|
31
|
+
/**
|
|
32
|
+
* The singleton key for the {@link PluginContextComponent} class.
|
|
33
|
+
*/
|
|
34
|
+
static COMPONENT_KEY = Symbol(PluginContextComponent.name);
|
|
35
|
+
app;
|
|
36
|
+
pluginId;
|
|
37
|
+
/**
|
|
38
|
+
* Creates a new plugin context component.
|
|
39
|
+
*
|
|
40
|
+
* @param params - The constructor parameters.
|
|
41
|
+
*/
|
|
42
|
+
constructor(params) {
|
|
43
|
+
super();
|
|
44
|
+
this.app = params.app;
|
|
45
|
+
this.pluginId = params.pluginId;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Initializes the plugin context and debug controller.
|
|
49
|
+
*/
|
|
50
|
+
onload() {
|
|
51
|
+
super.onload();
|
|
52
|
+
initPluginContext(this.app, this.pluginId);
|
|
53
|
+
this.addChild(new AllWindowsEventComponent(this.app)).registerAllWindowsHandler((win) => {
|
|
54
|
+
initDebugController(win, this);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
PluginContextComponent
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2NvbXBvbmVudHMvcGx1Z2luLWNvbnRleHQtY29tcG9uZW50LnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyIvKipcbiAqI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CQUErQixvQkFBb0I7QUFBQTtBQUFBO0FBQUE7QUFBQSxFQUk5RCxPQUF1QixnQkFBZ0IsT0FBTyx1QkFBdUIsSUFBSTtBQUFBLEVBQ3hEO0FBQUEsRUFDQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQSxFQU9WLFlBQVksUUFBaUQ7QUFDbEUsVUFBTTtBQUNOLFNBQUssTUFBTSxPQUFPO0FBQ2xCLFNBQUssV0FBVyxPQUFPO0FBQUEsRUFDekI7QUFBQTtBQUFBO0FBQUE7QUFBQSxFQUtnQixTQUFlO0FBQzdCLFVBQU0sT0FBTztBQUNiLHNCQUFrQixLQUFLLEtBQUssS0FBSyxRQUFRO0FBQ3pDLFNBQUssU0FBUyxJQUFJLHlCQUF5QixLQUFLLEdBQUcsQ0FBQyxFQUFFLDBCQUEwQixDQUFDLFFBQVE7QUFDdkYsMEJBQW9CLEtBQUssSUFBSTtBQUFBLElBQy9CLENBQUM7QUFBQSxFQUNIO0FBQ0Y7IiwKICAibmFtZXMiOiBbXQp9Cg==
|
package/dist/lib/esm/obsidian/{plugin/components → components}/plugin-notice-component.d.mts
RENAMED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Component that manages displaying notices to the user.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { DisposableComponent } from './disposable-component.mjs';
|
|
7
7
|
/**
|
|
8
8
|
* Manages showing plugin notices. Automatically hides the previous notice when a new one is shown.
|
|
9
9
|
*/
|
|
10
|
-
export declare class PluginNoticeComponent extends
|
|
10
|
+
export declare class PluginNoticeComponent extends DisposableComponent {
|
|
11
11
|
private readonly pluginName;
|
|
12
12
|
/**
|
|
13
13
|
* The singleton key for the {@link PluginNoticeComponent} class.
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
8
|
+
if (globalThis.process) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const browserProcess = {
|
|
13
|
+
browser: true,
|
|
14
|
+
cwd() {
|
|
15
|
+
return '/';
|
|
16
|
+
},
|
|
17
|
+
env: {},
|
|
18
|
+
platform: 'android'
|
|
19
|
+
};
|
|
20
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
21
|
+
globalThis.process = browserProcess;
|
|
22
|
+
})();
|
|
23
|
+
|
|
24
|
+
import { Notice } from "obsidian";
|
|
25
|
+
import { DisposableComponent } from "./disposable-component.mjs";
|
|
26
|
+
class PluginNoticeComponent extends DisposableComponent {
|
|
27
|
+
/**
|
|
28
|
+
* Creates a new plugin notice component.
|
|
29
|
+
*
|
|
30
|
+
* @param pluginName - The plugin name (shown as prefix in notices).
|
|
31
|
+
*/
|
|
32
|
+
constructor(pluginName) {
|
|
33
|
+
super();
|
|
34
|
+
this.pluginName = pluginName;
|
|
35
|
+
}
|
|
36
|
+
pluginName;
|
|
37
|
+
/**
|
|
38
|
+
* The singleton key for the {@link PluginNoticeComponent} class.
|
|
39
|
+
*/
|
|
40
|
+
static COMPONENT_KEY = Symbol(PluginNoticeComponent.name);
|
|
41
|
+
notice;
|
|
42
|
+
/**
|
|
43
|
+
* Displays a notice message to the user.
|
|
44
|
+
*
|
|
45
|
+
* @param message - The message to display.
|
|
46
|
+
*/
|
|
47
|
+
showNotice(message) {
|
|
48
|
+
if (this.notice) {
|
|
49
|
+
this.notice.hide();
|
|
50
|
+
}
|
|
51
|
+
this.notice = new Notice(`${this.pluginName}
|
|
52
|
+
${message}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
PluginNoticeComponent
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingUR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FBQUEsRUFDM0Q7QUFDRjsiLAogICJuYW1lcyI6IFtdCn0K
|
package/dist/lib/esm/obsidian/{plugin/components → components}/plugin-settings-component.d.mts
RENAMED
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
* by this component — no separate manager class is needed.
|
|
9
9
|
*/
|
|
10
10
|
import type { Promisable, ReadonlyDeep } from 'type-fest';
|
|
11
|
-
import type { AsyncEventRef } from '
|
|
12
|
-
import type { Transformer } from '
|
|
13
|
-
import type { GenericObject } from '
|
|
14
|
-
import type { MaybeReturn, StringKeys } from '
|
|
15
|
-
import type { DataHandler } from '
|
|
16
|
-
import { AsyncComponentBase } from '
|
|
11
|
+
import type { AsyncEventRef } from '../../async-events.mjs';
|
|
12
|
+
import type { Transformer } from '../../transformers/transformer.mjs';
|
|
13
|
+
import type { GenericObject } from '../../type-guards.mjs';
|
|
14
|
+
import type { MaybeReturn, StringKeys } from '../../type.mjs';
|
|
15
|
+
import type { DataHandler } from '../data-handler.mjs';
|
|
16
|
+
import { AsyncComponentBase } from './async-component.mjs';
|
|
17
17
|
/**
|
|
18
18
|
* A snapshot of plugin settings state, including raw input values, effective (validated) values,
|
|
19
19
|
* and per-property validation messages.
|
|
@@ -261,19 +261,4 @@ export declare abstract class PluginSettingsComponentBase<PluginSettings extends
|
|
|
261
261
|
private setPropertyImpl;
|
|
262
262
|
private settingsToRawRecord;
|
|
263
263
|
}
|
|
264
|
-
/**
|
|
265
|
-
* A no-op settings component for plugins without settings.
|
|
266
|
-
*/
|
|
267
|
-
export declare class EmptyPluginSettingsComponent extends PluginSettingsComponentBase<object> {
|
|
268
|
-
/**
|
|
269
|
-
* Creates a new empty plugin settings component.
|
|
270
|
-
*/
|
|
271
|
-
constructor();
|
|
272
|
-
/**
|
|
273
|
-
* Creates empty default settings.
|
|
274
|
-
*
|
|
275
|
-
* @returns An empty object.
|
|
276
|
-
*/
|
|
277
|
-
protected createDefaultSettings(): object;
|
|
278
|
-
}
|
|
279
264
|
export {};
|