obsidian-dev-utils 65.0.1 → 66.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 +28 -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 +40 -34
- package/dist/lib/cjs/obsidian/plugin/plugin.d.cts +16 -13
- 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 +16 -13
- package/dist/lib/esm/obsidian/plugin/plugin.mjs +40 -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,172 @@
|
|
|
1
|
+
/*
|
|
2
|
+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
3
|
+
if you want to view the source, please visit the github repository of this plugin
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function initCjs() {
|
|
7
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
8
|
+
const globalThisRecord = globalThis;
|
|
9
|
+
globalThisRecord['__name'] ??= name;
|
|
10
|
+
const originalRequire = require;
|
|
11
|
+
if (originalRequire && !originalRequire.__isPatched) {
|
|
12
|
+
// eslint-disable-next-line no-global-assign, no-implicit-globals -- We need to patch the `require()` function.
|
|
13
|
+
require = Object.assign(
|
|
14
|
+
(id) => requirePatched(id),
|
|
15
|
+
originalRequire,
|
|
16
|
+
{
|
|
17
|
+
__isPatched: true
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const newFuncs = {
|
|
23
|
+
__extractDefault() {
|
|
24
|
+
return extractDefault;
|
|
25
|
+
},
|
|
26
|
+
process() {
|
|
27
|
+
const browserProcess = {
|
|
28
|
+
browser: true,
|
|
29
|
+
cwd() {
|
|
30
|
+
return '/';
|
|
31
|
+
},
|
|
32
|
+
env: {},
|
|
33
|
+
platform: 'android'
|
|
34
|
+
};
|
|
35
|
+
return browserProcess;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
for (const key of Object.keys(newFuncs)) {
|
|
40
|
+
globalThisRecord[key] ??= newFuncs[key]?.();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function name(obj) {
|
|
44
|
+
return obj;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function extractDefault(module) {
|
|
48
|
+
return module && module.__esModule && 'default' in module ? module.default : module;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const OBSIDIAN_BUILT_IN_MODULE_NAMES = [
|
|
52
|
+
'obsidian',
|
|
53
|
+
'@codemirror/autocomplete',
|
|
54
|
+
'@codemirror/collab',
|
|
55
|
+
'@codemirror/commands',
|
|
56
|
+
'@codemirror/language',
|
|
57
|
+
'@codemirror/lint',
|
|
58
|
+
'@codemirror/search',
|
|
59
|
+
'@codemirror/state',
|
|
60
|
+
'@codemirror/text',
|
|
61
|
+
'@codemirror/view',
|
|
62
|
+
'@lezer/common',
|
|
63
|
+
'@lezer/lr',
|
|
64
|
+
'@lezer/highlight'];
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
const DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES = [
|
|
68
|
+
'@codemirror/closebrackets',
|
|
69
|
+
'@codemirror/comment',
|
|
70
|
+
'@codemirror/fold',
|
|
71
|
+
'@codemirror/gutter',
|
|
72
|
+
'@codemirror/highlight',
|
|
73
|
+
'@codemirror/history',
|
|
74
|
+
'@codemirror/matchbrackets',
|
|
75
|
+
'@codemirror/panel',
|
|
76
|
+
'@codemirror/rangeset',
|
|
77
|
+
'@codemirror/rectangular-selection',
|
|
78
|
+
'@codemirror/stream-parser',
|
|
79
|
+
'@codemirror/tooltip'];
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
function requirePatched(id) {
|
|
83
|
+
if (OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id) || DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id)) {
|
|
84
|
+
return originalRequire?.(id);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated, obsidianmd/no-global-this -- Need access to app. Actively use globalThis.
|
|
88
|
+
if (globalThis.app.isMobile) {
|
|
89
|
+
if (id === 'process' || id === 'node:process') {
|
|
90
|
+
// eslint-disable-next-line no-console -- Valid usage.
|
|
91
|
+
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Fake process object is returned instead.`);
|
|
92
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
93
|
+
return globalThis.process;
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
const module = originalRequire?.(id);
|
|
97
|
+
if (module) {
|
|
98
|
+
return extractDefault(module);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// eslint-disable-next-line no-console -- Valid usage.
|
|
103
|
+
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Empty object is returned instead.`);
|
|
104
|
+
return {};
|
|
105
|
+
}
|
|
106
|
+
})();
|
|
107
|
+
|
|
108
|
+
"use strict";
|
|
109
|
+
var __defProp = Object.defineProperty;
|
|
110
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
111
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
112
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
113
|
+
var __export = (target, all) => {
|
|
114
|
+
for (var name in all)
|
|
115
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
116
|
+
};
|
|
117
|
+
var __copyProps = (to, from, except, desc) => {
|
|
118
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
119
|
+
for (let key of __getOwnPropNames(from))
|
|
120
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
121
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
122
|
+
}
|
|
123
|
+
return to;
|
|
124
|
+
};
|
|
125
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
126
|
+
var menu_event_registrar_component_exports = {};
|
|
127
|
+
__export(menu_event_registrar_component_exports, {
|
|
128
|
+
MenuEventRegistrarComponent: () => MenuEventRegistrarComponent
|
|
129
|
+
});
|
|
130
|
+
module.exports = __toCommonJS(menu_event_registrar_component_exports);
|
|
131
|
+
var import_disposable_component = require('./disposable-component.cjs');
|
|
132
|
+
class MenuEventRegistrarComponent extends import_disposable_component.DisposableComponent {
|
|
133
|
+
/**
|
|
134
|
+
* Creates a new app-backed menu event registrar.
|
|
135
|
+
*
|
|
136
|
+
* @param app - The Obsidian app instance.
|
|
137
|
+
*/
|
|
138
|
+
constructor(app) {
|
|
139
|
+
super();
|
|
140
|
+
this.app = app;
|
|
141
|
+
}
|
|
142
|
+
app;
|
|
143
|
+
/**
|
|
144
|
+
* Registers a handler for the editor context menu event.
|
|
145
|
+
*
|
|
146
|
+
* @param handler - The handler to register.
|
|
147
|
+
*/
|
|
148
|
+
registerEditorMenuEventHandler(handler) {
|
|
149
|
+
this.registerEvent(this.app.workspace.on("editor-menu", handler));
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Registers a handler for the single-file context menu event.
|
|
153
|
+
*
|
|
154
|
+
* @param handler - The handler to register.
|
|
155
|
+
*/
|
|
156
|
+
registerFileMenuEventHandler(handler) {
|
|
157
|
+
this.registerEvent(this.app.workspace.on("file-menu", handler));
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Registers a handler for the multi-file context menu event.
|
|
161
|
+
*
|
|
162
|
+
* @param handler - The handler to register.
|
|
163
|
+
*/
|
|
164
|
+
registerFilesMenuEventHandler(handler) {
|
|
165
|
+
this.registerEvent(this.app.workspace.on("files-menu", handler));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
169
|
+
0 && (module.exports = {
|
|
170
|
+
MenuEventRegistrarComponent
|
|
171
|
+
});
|
|
172
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2NvbXBvbmVudHMvbWVudS1ldmVudC1yZWdpc3RyYXItY29tcG9uZW50LnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyIvKipcbiAqIEBmaWxlXG4gKlxuICogUmVnaXN0ZXJzIG1lbnUgZXZlbnQgaGFuZGxlcnMgd2l0aCBPYnNpZGlhbidzIHdvcmtzcGFjZSwgc3VwcG9ydGluZyBlZGl0b3IsIGZpbGUsIGFuZCBtdWx0aS1maWxlIGNvbnRleHQgbWVudXMuXG4gKi9cblxuaW1wb3J0IHR5cGUgeyBBcHAgfSBmcm9tICdvYnNpZGlhbic7XG5cbmltcG9ydCB0eXBl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ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBZUEsa0NBQW9DO0FBUzdCLE1BQU0sb0NBQW9DLGdEQUFrRDtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQSxFQU0xRixZQUE2QixLQUFVO0FBQzVDLFVBQU07QUFENEI7QUFBQSxFQUVwQztBQUFBLEVBRm9DO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBLEVBUzdCLCtCQUErQixTQUF1QztBQUMzRSxTQUFLLGNBQWMsS0FBSyxJQUFJLFVBQVUsR0FBRyxlQUFlLE9BQU8sQ0FBQztBQUFBLEVBQ2xFO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBLEVBT08sNkJBQTZCLFNBQXFDO0FBQ3ZFLFNBQUssY0FBYyxLQUFLLElBQUksVUFBVSxHQUFHLGFBQWEsT0FBTyxDQUFDO0FBQUEsRUFDaEU7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUEsRUFPTyw4QkFBOEIsU0FBc0M7QUFDekUsU0FBSyxjQUFjLEtBQUssSUFBSSxVQUFVLEdBQUcsY0FBYyxPQUFPLENBQUM7QUFBQSxFQUNqRTtBQUNGOyIsCiAgIm5hbWVzIjogW10KfQo=
|
|
@@ -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.cjs';
|
|
8
|
+
import { DisposableComponent } from './disposable-component.cjs';
|
|
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,197 @@
|
|
|
1
|
+
/*
|
|
2
|
+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
3
|
+
if you want to view the source, please visit the github repository of this plugin
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function initCjs() {
|
|
7
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
8
|
+
const globalThisRecord = globalThis;
|
|
9
|
+
globalThisRecord['__name'] ??= name;
|
|
10
|
+
const originalRequire = require;
|
|
11
|
+
if (originalRequire && !originalRequire.__isPatched) {
|
|
12
|
+
// eslint-disable-next-line no-global-assign, no-implicit-globals -- We need to patch the `require()` function.
|
|
13
|
+
require = Object.assign(
|
|
14
|
+
(id) => requirePatched(id),
|
|
15
|
+
originalRequire,
|
|
16
|
+
{
|
|
17
|
+
__isPatched: true
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const newFuncs = {
|
|
23
|
+
__extractDefault() {
|
|
24
|
+
return extractDefault;
|
|
25
|
+
},
|
|
26
|
+
process() {
|
|
27
|
+
const browserProcess = {
|
|
28
|
+
browser: true,
|
|
29
|
+
cwd() {
|
|
30
|
+
return '/';
|
|
31
|
+
},
|
|
32
|
+
env: {},
|
|
33
|
+
platform: 'android'
|
|
34
|
+
};
|
|
35
|
+
return browserProcess;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
for (const key of Object.keys(newFuncs)) {
|
|
40
|
+
globalThisRecord[key] ??= newFuncs[key]?.();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function name(obj) {
|
|
44
|
+
return obj;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function extractDefault(module) {
|
|
48
|
+
return module && module.__esModule && 'default' in module ? module.default : module;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const OBSIDIAN_BUILT_IN_MODULE_NAMES = [
|
|
52
|
+
'obsidian',
|
|
53
|
+
'@codemirror/autocomplete',
|
|
54
|
+
'@codemirror/collab',
|
|
55
|
+
'@codemirror/commands',
|
|
56
|
+
'@codemirror/language',
|
|
57
|
+
'@codemirror/lint',
|
|
58
|
+
'@codemirror/search',
|
|
59
|
+
'@codemirror/state',
|
|
60
|
+
'@codemirror/text',
|
|
61
|
+
'@codemirror/view',
|
|
62
|
+
'@lezer/common',
|
|
63
|
+
'@lezer/lr',
|
|
64
|
+
'@lezer/highlight'];
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
const DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES = [
|
|
68
|
+
'@codemirror/closebrackets',
|
|
69
|
+
'@codemirror/comment',
|
|
70
|
+
'@codemirror/fold',
|
|
71
|
+
'@codemirror/gutter',
|
|
72
|
+
'@codemirror/highlight',
|
|
73
|
+
'@codemirror/history',
|
|
74
|
+
'@codemirror/matchbrackets',
|
|
75
|
+
'@codemirror/panel',
|
|
76
|
+
'@codemirror/rangeset',
|
|
77
|
+
'@codemirror/rectangular-selection',
|
|
78
|
+
'@codemirror/stream-parser',
|
|
79
|
+
'@codemirror/tooltip'];
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
function requirePatched(id) {
|
|
83
|
+
if (OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id) || DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id)) {
|
|
84
|
+
return originalRequire?.(id);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated, obsidianmd/no-global-this -- Need access to app. Actively use globalThis.
|
|
88
|
+
if (globalThis.app.isMobile) {
|
|
89
|
+
if (id === 'process' || id === 'node:process') {
|
|
90
|
+
// eslint-disable-next-line no-console -- Valid usage.
|
|
91
|
+
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Fake process object is returned instead.`);
|
|
92
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
93
|
+
return globalThis.process;
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
const module = originalRequire?.(id);
|
|
97
|
+
if (module) {
|
|
98
|
+
return extractDefault(module);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// eslint-disable-next-line no-console -- Valid usage.
|
|
103
|
+
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Empty object is returned instead.`);
|
|
104
|
+
return {};
|
|
105
|
+
}
|
|
106
|
+
})();
|
|
107
|
+
|
|
108
|
+
"use strict";
|
|
109
|
+
var __defProp = Object.defineProperty;
|
|
110
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
111
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
112
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
113
|
+
var __export = (target, all) => {
|
|
114
|
+
for (var name in all)
|
|
115
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
116
|
+
};
|
|
117
|
+
var __copyProps = (to, from, except, desc) => {
|
|
118
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
119
|
+
for (let key of __getOwnPropNames(from))
|
|
120
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
121
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
122
|
+
}
|
|
123
|
+
return to;
|
|
124
|
+
};
|
|
125
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
126
|
+
var monkey_around_component_exports = {};
|
|
127
|
+
__export(monkey_around_component_exports, {
|
|
128
|
+
MonkeyAroundComponent: () => MonkeyAroundComponent,
|
|
129
|
+
around: () => around,
|
|
130
|
+
hasPatchToken: () => hasPatchToken
|
|
131
|
+
});
|
|
132
|
+
module.exports = __toCommonJS(monkey_around_component_exports);
|
|
133
|
+
var import_monkey_around = require('monkey-around');
|
|
134
|
+
var import_app = require('../app.cjs');
|
|
135
|
+
var import_disposable_component = require('./disposable-component.cjs');
|
|
136
|
+
class MonkeyAroundComponent extends import_disposable_component.DisposableComponent {
|
|
137
|
+
/**
|
|
138
|
+
* Registers a single-method patch using a simplified handler.
|
|
139
|
+
*
|
|
140
|
+
* @typeParam Obj - The object to patch.
|
|
141
|
+
* @typeParam K - The method name to patch.
|
|
142
|
+
* @param params - The parameters of the patch.
|
|
143
|
+
*/
|
|
144
|
+
registerMethodPatch(params) {
|
|
145
|
+
if (params.patchToken) {
|
|
146
|
+
const originalMethod = params.obj[params.methodName];
|
|
147
|
+
getMonkeyAroundPatches().set(originalMethod, params.patchToken);
|
|
148
|
+
}
|
|
149
|
+
this.registerPatch(params.obj, {
|
|
150
|
+
[params.methodName]: (originalMethod) => {
|
|
151
|
+
return patchedMethod;
|
|
152
|
+
function patchedMethod(...originalArgs) {
|
|
153
|
+
const originalThis = this;
|
|
154
|
+
return params.patchHandler({
|
|
155
|
+
fallback() {
|
|
156
|
+
return originalMethod.call(originalThis, ...originalArgs);
|
|
157
|
+
},
|
|
158
|
+
originalArgs,
|
|
159
|
+
originalMethod,
|
|
160
|
+
originalMethodBound: originalMethod.bind(originalThis),
|
|
161
|
+
originalThis
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Registers a patch using raw factories (advanced API).
|
|
169
|
+
*
|
|
170
|
+
* @typeParam Obj - The object to patch.
|
|
171
|
+
* @param obj - The object to patch.
|
|
172
|
+
* @param factories - The factories to apply to the object.
|
|
173
|
+
*/
|
|
174
|
+
registerPatch(obj, factories) {
|
|
175
|
+
if (!this._loaded) {
|
|
176
|
+
throw new Error("Cannot register patch on a component that is not loaded.");
|
|
177
|
+
}
|
|
178
|
+
const uninstaller = around(obj, factories);
|
|
179
|
+
this.register(uninstaller);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function around(obj, factories) {
|
|
183
|
+
return (0, import_monkey_around.around)(obj, factories);
|
|
184
|
+
}
|
|
185
|
+
function hasPatchToken(fn, patchToken) {
|
|
186
|
+
return getMonkeyAroundPatches().get(fn) === patchToken;
|
|
187
|
+
}
|
|
188
|
+
function getMonkeyAroundPatches() {
|
|
189
|
+
return (0, import_app.getObsidianDevUtilsState)(null, "monkeyAroundPatches", /* @__PURE__ */ new WeakMap()).value;
|
|
190
|
+
}
|
|
191
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
192
|
+
0 && (module.exports = {
|
|
193
|
+
MonkeyAroundComponent,
|
|
194
|
+
around,
|
|
195
|
+
hasPatchToken
|
|
196
|
+
});
|
|
197
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2NvbXBvbmVudHMvbW9ua2V5LWFyb3VuZC1jb21wb25lbnQudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGZpbGVcbiAqXG4gKiBJbXByb3ZlZCB0eXBlLXNhZmUgd3JhcHBlciBvZiB7QGxpbmsgaHR0cHM6Ly93d3cubnBtanMuY29tL3BhY2thZ2UvbW9ua2V5LWFyb3VuZH0gbGlicmFyeS5cbiAqL1xuXG5pbXBvcnQgdHlwZSB7IENvbmRpdGlvbmFsS2V5cyB9IGZyb20gJ3R5cGUtZmVzdCc7XG5cbmltcG9ydCB7IGFyb3VuZCBhcyBvcmlnaW5hbEFyb3VuZCB9IGZyb20gJ21vbmtleS1hcm91bmQnO1xuXG5pbXBvcnQgdHlwZSB7IEdlbmVyaWNGdW5jdGlvbiB9IGZyb20gJy4uLy4uL2Z1bmN0aW9uLnRzJztcbmltcG9ydCB0eXBlIHsgR2VuZXJpY09iamVjdCB9IGZyb20gJy4uLy4uL3R5cGUtZ3VhcmRzLnRzJztcblxuaW1wb3J0IHsgZ2V0T2JzaWRpYW5EZXZVdGlsc1N0YXRlIH0gZnJvbSAnLi4vYXBwLnRzJztcbmltcG9ydCB7IERpc3Bvc2FibGVDb21wb25lbnQgfSBmcm9tICcuL2Rpc3Bvc2FibGUtY29tcG9uZW50LnRzJztcblxuLyoqXG4gKiBBIHR5cGUgb2YgdGhlIGZhY3RvcmllcyB0byBhcHBseSB0byB0aGUgb2JqZWN0LlxuICpcbiAqIEB0eXBlUGFyYW0gT2JqIC0gVGhlIG9iamVjdCB0byBwYXRjaC5cbiAqL1xuZXhwb3J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xQ0FBeUIsTUFBTSx1QkFBdUIsb0JBQUksUUFBaUMsQ0FBQyxFQUFFO0FBQ3ZHOyIsCiAgIm5hbWVzIjogWyJvcmlnaW5hbEFyb3VuZCJdCn0K
|
|
@@ -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.cjs';
|
|
8
|
+
import { DisposableComponent } from './disposable-component.cjs';
|
|
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 {};
|
|
@@ -128,10 +128,10 @@ __export(plugin_context_component_exports, {
|
|
|
128
128
|
PluginContextComponent: () => PluginContextComponent
|
|
129
129
|
});
|
|
130
130
|
module.exports = __toCommonJS(plugin_context_component_exports);
|
|
131
|
-
var
|
|
132
|
-
var
|
|
133
|
-
var
|
|
134
|
-
class PluginContextComponent extends
|
|
131
|
+
var import_plugin_context = require('../plugin/plugin-context.cjs');
|
|
132
|
+
var import_all_windows_event_component = require('./all-windows-event-component.cjs');
|
|
133
|
+
var import_disposable_component = require('./disposable-component.cjs');
|
|
134
|
+
class PluginContextComponent extends import_disposable_component.DisposableComponent {
|
|
135
135
|
/**
|
|
136
136
|
* The singleton key for the {@link PluginContextComponent} class.
|
|
137
137
|
*/
|
|
@@ -154,7 +154,7 @@ class PluginContextComponent extends import_obsidian.Component {
|
|
|
154
154
|
onload() {
|
|
155
155
|
super.onload();
|
|
156
156
|
(0, import_plugin_context.initPluginContext)(this.app, this.pluginId);
|
|
157
|
-
new
|
|
157
|
+
this.addChild(new import_all_windows_event_component.AllWindowsEventComponent(this.app)).registerAllWindowsHandler((win) => {
|
|
158
158
|
(0, import_plugin_context.initDebugController)(win, this);
|
|
159
159
|
});
|
|
160
160
|
}
|
|
@@ -163,4 +163,4 @@ class PluginContextComponent extends import_obsidian.Component {
|
|
|
163
163
|
0 && (module.exports = {
|
|
164
164
|
PluginContextComponent
|
|
165
165
|
});
|
|
166
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
166
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2NvbXBvbmVudHMvcGx1Z2luLWNvbnRleHQtY29tcG9uZW50LnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyIvKipcbiAqIEBmaWxlXG4gKlxuICogQ29tcG9uZW50IHRoYXQgaW5pdGlhbGl6ZXMgdGhlIHBsdWdpbiBjb250ZXh0LCBkZWJ1ZyBjb250cm9sbGVyLCBhbmQgbGlicmFyeSBzdHlsZXMuXG4gKi9cblxuaW1wb3J0IHR5cGUgeyBBcHAgfSBmcm9tICdvYnNpZGlhbic7XG5cbmltcG9ydC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SxFQUk5RCxPQUF1QixnQkFBZ0IsT0FBTyx1QkFBdUIsSUFBSTtBQUFBLEVBQ3hEO0FBQUEsRUFDQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQSxFQU9WLFlBQVksUUFBaUQ7QUFDbEUsVUFBTTtBQUNOLFNBQUssTUFBTSxPQUFPO0FBQ2xCLFNBQUssV0FBVyxPQUFPO0FBQUEsRUFDekI7QUFBQTtBQUFBO0FBQUE7QUFBQSxFQUtnQixTQUFlO0FBQzdCLFVBQU0sT0FBTztBQUNiLGlEQUFrQixLQUFLLEtBQUssS0FBSyxRQUFRO0FBQ3pDLFNBQUssU0FBUyxJQUFJLDREQUF5QixLQUFLLEdBQUcsQ0FBQyxFQUFFLDBCQUEwQixDQUFDLFFBQVE7QUFDdkYscURBQW9CLEtBQUssSUFBSTtBQUFBLElBQy9CLENBQUM7QUFBQSxFQUNIO0FBQ0Y7IiwKICAibmFtZXMiOiBbXQp9Cg==
|
package/dist/lib/cjs/obsidian/{plugin/components → components}/plugin-context-component.d.cts
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.cjs';
|
|
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
|
*/
|
|
@@ -129,7 +129,8 @@ __export(plugin_notice_component_exports, {
|
|
|
129
129
|
});
|
|
130
130
|
module.exports = __toCommonJS(plugin_notice_component_exports);
|
|
131
131
|
var import_obsidian = require('obsidian');
|
|
132
|
-
|
|
132
|
+
var import_disposable_component = require('./disposable-component.cjs');
|
|
133
|
+
class PluginNoticeComponent extends import_disposable_component.DisposableComponent {
|
|
133
134
|
/**
|
|
134
135
|
* Creates a new plugin notice component.
|
|
135
136
|
*
|
|
@@ -162,4 +163,4 @@ ${message}`);
|
|
|
162
163
|
0 && (module.exports = {
|
|
163
164
|
PluginNoticeComponent
|
|
164
165
|
});
|
|
165
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
166
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2NvbXBvbmVudHMvcGx1Z2luLW5vdGljZS1jb21wb25lbnQudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGZpbGVcbiAqXG4gKiBDb21wb25lbnQgdGhhdCBtYW5hZ2VzIGRpc3BsYXlpbmcgbm90aWNlcyB0byB0aGUgdXNlci5cbiAqL1xuXG5pbXBvcnQgeyBOb3RpY2UgfSBmcm9tICdvYnNpZGlhbic7XG5cbmltcG9ydCB7IERpc3Bvc2FibGVDb21wb25lbnQgfSBmcm9tICcuL2Rpc3Bvc2FibGUtY29tcG9uZW50LnRzJztcblxuLyoqXG4gKiBNYW5hZ2VzIHNob3dpbmcgcGx1Z2luIG5vdGljZXMuIEF1dG9tYXRpY2FsbHkgaGlkZXMgdGhlIHByZXZpb3VzIG5vdGljZSB3aGVuIGEgbmV3IG9uZSBpcyBzaG93bi5cbiAqL1xuZXhwb3J0IGNsYXNzIFBsdWdpbk5vdGljZUNvbXBvbmVudCBleHRlbmRzIERpc3Bvc2FibGVDb21wb25lbnQge1xuICAvKipcbiAgICogVGhlIHNpbmdsZXRvbiBrZXkgZm9yIHRoZSB7QGxpbmsgUGx1Z2luTm90a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Ozs7Ozs7Ozs7OztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFNQSxzQkFBdUI7QUFFdkIsa0NBQW9DO0FBSzdCLE1BQU0sOEJBQThCLGdEQUFvQjtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQSxFQWF0RCxZQUE2QixZQUFvQjtBQUN0RCxVQUFNO0FBRDRCO0FBQUEsRUFFcEM7QUFBQSxFQUZvQztBQUFBO0FBQUE7QUFBQTtBQUFBLEVBVHBDLE9BQXVCLGdCQUFnQixPQUFPLHNCQUFzQixJQUFJO0FBQUEsRUFFaEU7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUEsRUFnQkQsV0FBVyxTQUF1QjtBQUN2QyxRQUFJLEtBQUssUUFBUTtBQUNmLFdBQUssT0FBTyxLQUFLO0FBQUEsSUFDbkI7QUFFQSxTQUFLLFNBQVMsSUFBSSx1QkFBTyxHQUFHLEtBQUssVUFBVTtBQUFBLEVBQUssT0FBTyxFQUFFO0FBQUEsRUFDM0Q7QUFDRjsiLAogICJuYW1lcyI6IFtdCn0K
|
package/dist/lib/cjs/obsidian/{plugin/components → components}/plugin-notice-component.d.cts
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.cjs';
|
|
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.
|