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
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
3
|
-
if you want to view the source, please visit the github repository of this plugin
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
(function initCjs() {
|
|
7
|
-
// 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 checkbox_component_exports = {};
|
|
127
|
-
__export(checkbox_component_exports, {
|
|
128
|
-
CheckboxComponent: () => CheckboxComponent
|
|
129
|
-
});
|
|
130
|
-
module.exports = __toCommonJS(checkbox_component_exports);
|
|
131
|
-
var import_obsidian = require('obsidian');
|
|
132
|
-
var import_css_class = require('../../../css-class.cjs');
|
|
133
|
-
var import_plugin_context = require('../../plugin/plugin-context.cjs');
|
|
134
|
-
class CheckboxComponent extends import_obsidian.ValueComponent {
|
|
135
|
-
/**
|
|
136
|
-
* An input element of the checkbox.
|
|
137
|
-
*/
|
|
138
|
-
inputEl;
|
|
139
|
-
/**
|
|
140
|
-
* A validator element of the checkbox.
|
|
141
|
-
*
|
|
142
|
-
* @returns The validator element.
|
|
143
|
-
*/
|
|
144
|
-
get validatorEl() {
|
|
145
|
-
return this.inputEl;
|
|
146
|
-
}
|
|
147
|
-
changeCallback;
|
|
148
|
-
/**
|
|
149
|
-
* Creates a new checkbox component.
|
|
150
|
-
*
|
|
151
|
-
* @param containerEl - The container element.
|
|
152
|
-
*/
|
|
153
|
-
constructor(containerEl) {
|
|
154
|
-
super();
|
|
155
|
-
(0, import_plugin_context.addPluginCssClasses)(containerEl, [import_css_class.CssClass.CheckboxComponent]);
|
|
156
|
-
this.inputEl = containerEl.createEl("input", { type: "checkbox" });
|
|
157
|
-
this.inputEl.addEventListener("change", this.onChanged.bind(this));
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Gets the value of the checkbox.
|
|
161
|
-
*
|
|
162
|
-
* @returns The value of the checkbox.
|
|
163
|
-
*/
|
|
164
|
-
getValue() {
|
|
165
|
-
return this.inputEl.checked;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Sets the callback to be called when the checkbox is changed.
|
|
169
|
-
*
|
|
170
|
-
* @param callback - The callback to be called when the checkbox is changed.
|
|
171
|
-
* @returns The component.
|
|
172
|
-
*/
|
|
173
|
-
onChange(callback) {
|
|
174
|
-
this.changeCallback = callback;
|
|
175
|
-
return this;
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Called when the checkbox is changed.
|
|
179
|
-
*/
|
|
180
|
-
onChanged() {
|
|
181
|
-
this.changeCallback?.(this.getValue());
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Sets the disabled state of the checkbox.
|
|
185
|
-
*
|
|
186
|
-
* @param disabled - The disabled state of the checkbox.
|
|
187
|
-
* @returns The component.
|
|
188
|
-
*/
|
|
189
|
-
setDisabled(disabled) {
|
|
190
|
-
super.setDisabled(disabled);
|
|
191
|
-
this.inputEl.disabled = disabled;
|
|
192
|
-
return this;
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Sets the value of the checkbox.
|
|
196
|
-
*
|
|
197
|
-
* @param value - The value to set the checkbox to.
|
|
198
|
-
* @returns The component.
|
|
199
|
-
*/
|
|
200
|
-
setValue(value) {
|
|
201
|
-
this.inputEl.checked = value;
|
|
202
|
-
return this;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
206
|
-
0 && (module.exports = {
|
|
207
|
-
CheckboxComponent
|
|
208
|
-
});
|
|
209
|
-
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2NvbXBvbmVudHMvc2V0dGluZy1jb21wb25lbnRzL2NoZWNrYm94LWNvbXBvbmVudC50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAZmlsZVxuICpcbiAqIENoZWNrYm94IGNvbXBvbmVudC5cbiAqL1xuXG5pbXBvcnQgdHlwZSB7IFByb21pc2FibGUgfSBmcm9tICd0eXBlLWZlc3QnO1xuXG5pbXBvcnQgeyBWYWx1ZUNvbXBvbmVudCB9IGZyb20gJ29ic2lkaWFuJztcblxuaW1wb3J0IHR5cGUgeyBWYWxpZGF0b3JFbGVtZW50IH0gZnJvbSAnLi4vLi4vLi4vaHRtbC1lbGVtZW50LnRzJztcbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgLS0gV2UgbmVlZCB0byBpbXBvcnQgYGluaXRQbHVnaW5Db250ZXh0YCB0byB1c2UgaXQgaW4gdGhlIHRzZG9jcy5cbmltcG9ydCB0eXBlIHsgaW5pdFBsdWdpbkNvbnRleHQgfSBmcm9tICcuLi8uLi9wbHVnaW4vcGx1Z2luLWNvbnRleHQudHMnO1xuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby11bnVzZWQtdmFycyAtLSBX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ERATED/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 code_highlighter_component_exports = {};
|
|
127
|
-
__export(code_highlighter_component_exports, {
|
|
128
|
-
CodeHighlighterComponent: () => CodeHighlighterComponent
|
|
129
|
-
});
|
|
130
|
-
module.exports = __toCommonJS(code_highlighter_component_exports);
|
|
131
|
-
var import_implementations = require('@obsidian-typings/obsidian-public-latest/implementations');
|
|
132
|
-
var import_obsidian = require('obsidian');
|
|
133
|
-
var import_async = require('../../../async.cjs');
|
|
134
|
-
var import_css_class = require('../../../css-class.cjs');
|
|
135
|
-
var import_html_element = require('../../../html-element.cjs');
|
|
136
|
-
var import_plugin_context = require('../../plugin/plugin-context.cjs');
|
|
137
|
-
class CodeHighlighterComponent extends import_obsidian.ValueComponent {
|
|
138
|
-
/**
|
|
139
|
-
* An input element of the component.
|
|
140
|
-
*
|
|
141
|
-
* @returns The input element of the component.
|
|
142
|
-
*/
|
|
143
|
-
get inputEl() {
|
|
144
|
-
return this.textAreaComponent.inputEl;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Gets the validator element of the component.
|
|
148
|
-
*
|
|
149
|
-
* @returns The validator element of the component.
|
|
150
|
-
*/
|
|
151
|
-
get validatorEl() {
|
|
152
|
-
return this.inputEl;
|
|
153
|
-
}
|
|
154
|
-
codeEl;
|
|
155
|
-
placeholder = "";
|
|
156
|
-
preEl;
|
|
157
|
-
simulateChangeCallback;
|
|
158
|
-
tabSize;
|
|
159
|
-
textAreaComponent;
|
|
160
|
-
/**
|
|
161
|
-
* Creates a new multiple text component.
|
|
162
|
-
*
|
|
163
|
-
* @param containerEl - The container element of the component.
|
|
164
|
-
*/
|
|
165
|
-
constructor(containerEl) {
|
|
166
|
-
super();
|
|
167
|
-
(0, import_plugin_context.addPluginCssClasses)(containerEl, import_css_class.CssClass.CodeHighlighterComponent);
|
|
168
|
-
const wrapper = containerEl.createDiv();
|
|
169
|
-
(0, import_plugin_context.addPluginCssClasses)(wrapper, import_css_class.CssClass.SettingComponentWrapper);
|
|
170
|
-
this.textAreaComponent = new import_obsidian.TextAreaComponent(wrapper);
|
|
171
|
-
this.preEl = wrapper.createEl("pre", {
|
|
172
|
-
attr: {
|
|
173
|
-
tabIndex: "-1"
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
this.codeEl = this.preEl.createEl("code", {
|
|
177
|
-
attr: {
|
|
178
|
-
tabIndex: "-1"
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
this.inputEl.addEventListener("input", (0, import_async.convertAsyncToSync)(this.updateHighlightedCode.bind(this)));
|
|
182
|
-
this.inputEl.addEventListener("scroll", this.handleScroll.bind(this));
|
|
183
|
-
this.inputEl.addEventListener("keydown", this.handleKeyDown.bind(this));
|
|
184
|
-
const DEFAULT_TAB_SIZE = 2;
|
|
185
|
-
this.tabSize = DEFAULT_TAB_SIZE;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Empties the component.
|
|
189
|
-
*/
|
|
190
|
-
empty() {
|
|
191
|
-
this.setValue("");
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Gets the value of the component.
|
|
195
|
-
*
|
|
196
|
-
* @returns The value of the component.
|
|
197
|
-
*/
|
|
198
|
-
getValue() {
|
|
199
|
-
return this.textAreaComponent.getValue();
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Checks if the component is empty.
|
|
203
|
-
*
|
|
204
|
-
* @returns `true` if the component is empty, `false` otherwise.
|
|
205
|
-
*/
|
|
206
|
-
isEmpty() {
|
|
207
|
-
return this.textAreaComponent.getValue() === "";
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Adds a change listener to the component.
|
|
211
|
-
*
|
|
212
|
-
* @param callback - The callback to call when the value changes.
|
|
213
|
-
* @returns The component.
|
|
214
|
-
*/
|
|
215
|
-
onChange(callback) {
|
|
216
|
-
const changeHandler = () => {
|
|
217
|
-
callback(this.getValue());
|
|
218
|
-
};
|
|
219
|
-
this.simulateChangeCallback = changeHandler;
|
|
220
|
-
this.textAreaComponent.onChange(changeHandler);
|
|
221
|
-
return this;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Sets the disabled state of the component.
|
|
225
|
-
*
|
|
226
|
-
* @param disabled - The disabled state to set.
|
|
227
|
-
* @returns The component.
|
|
228
|
-
*/
|
|
229
|
-
setDisabled(disabled) {
|
|
230
|
-
super.setDisabled(disabled);
|
|
231
|
-
this.textAreaComponent.setDisabled(disabled);
|
|
232
|
-
return this;
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Sets the language for code highlighting.
|
|
236
|
-
*
|
|
237
|
-
* @param language - The language to set.
|
|
238
|
-
* @returns The component.
|
|
239
|
-
*/
|
|
240
|
-
setLanguage(language) {
|
|
241
|
-
const LANGUAGE_CLASS_PREFIX = "language-";
|
|
242
|
-
for (const el of [this.preEl, this.codeEl]) {
|
|
243
|
-
for (const cls of Array.from(el.classList)) {
|
|
244
|
-
if (cls.startsWith(LANGUAGE_CLASS_PREFIX)) {
|
|
245
|
-
el.classList.remove(cls);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
el.classList.add(`${LANGUAGE_CLASS_PREFIX}${language}`);
|
|
249
|
-
}
|
|
250
|
-
return this;
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Sets the placeholder of the component.
|
|
254
|
-
*
|
|
255
|
-
* @param placeholder - The placeholder to set.
|
|
256
|
-
* @returns The component.
|
|
257
|
-
*/
|
|
258
|
-
setPlaceholder(placeholder) {
|
|
259
|
-
this.placeholder = placeholder;
|
|
260
|
-
(0, import_async.invokeAsyncSafely)(this.updateHighlightedCode.bind(this));
|
|
261
|
-
return this;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Sets the placeholder value of the component.
|
|
265
|
-
*
|
|
266
|
-
* @param placeholderValue - The placeholder value to set.
|
|
267
|
-
* @returns The component.
|
|
268
|
-
*/
|
|
269
|
-
setPlaceholderValue(placeholderValue) {
|
|
270
|
-
this.setPlaceholder(placeholderValue);
|
|
271
|
-
return this;
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* Sets the tab size of the component.
|
|
275
|
-
*
|
|
276
|
-
* @param tabSize - The tab size to set.
|
|
277
|
-
* @returns The component.
|
|
278
|
-
*/
|
|
279
|
-
setTabSize(tabSize) {
|
|
280
|
-
this.tabSize = tabSize;
|
|
281
|
-
return this;
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* Sets the value of the component.
|
|
285
|
-
*
|
|
286
|
-
* @param value - The value to set.
|
|
287
|
-
* @returns The component.
|
|
288
|
-
*/
|
|
289
|
-
setValue(value) {
|
|
290
|
-
this.textAreaComponent.setValue(value);
|
|
291
|
-
(0, import_async.invokeAsyncSafely)(this.updateHighlightedCode.bind(this));
|
|
292
|
-
return this;
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* @deprecated Use only from tests to simulate a change event.
|
|
296
|
-
*/
|
|
297
|
-
simulateChange() {
|
|
298
|
-
this.simulateChangeCallback?.();
|
|
299
|
-
}
|
|
300
|
-
handleKeyDown(evt) {
|
|
301
|
-
if (evt.key !== "Tab") {
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
evt.preventDefault();
|
|
305
|
-
if (evt.ctrlKey || evt.metaKey) {
|
|
306
|
-
const focusables = Array.from(activeDocument.querySelectorAll(
|
|
307
|
-
':is(a, button, input, select, textarea, [tabindex]):not([tabindex="-1"]):not(:disabled):not([type="hidden"])'
|
|
308
|
-
));
|
|
309
|
-
const index = focusables.indexOf(this.inputEl);
|
|
310
|
-
const deltaIndex = evt.shiftKey ? -1 : 1;
|
|
311
|
-
const nextControl = focusables[(index + deltaIndex + focusables.length) % focusables.length];
|
|
312
|
-
nextControl?.focus();
|
|
313
|
-
return;
|
|
314
|
-
}
|
|
315
|
-
const oldValue = this.getValue();
|
|
316
|
-
const selectionStart = this.inputEl.selectionStart;
|
|
317
|
-
const selectionEnd = this.inputEl.selectionEnd;
|
|
318
|
-
const beforeSelection = oldValue.slice(0, selectionStart);
|
|
319
|
-
const afterSelection = oldValue.slice(selectionEnd);
|
|
320
|
-
const tabs = " ".repeat(this.tabSize);
|
|
321
|
-
let newBeforeSelection = beforeSelection;
|
|
322
|
-
if (evt.shiftKey) {
|
|
323
|
-
if (beforeSelection.endsWith(tabs)) {
|
|
324
|
-
newBeforeSelection = beforeSelection.slice(0, -this.tabSize);
|
|
325
|
-
}
|
|
326
|
-
} else {
|
|
327
|
-
newBeforeSelection = beforeSelection + tabs;
|
|
328
|
-
}
|
|
329
|
-
const newValue = `${newBeforeSelection}${afterSelection}`;
|
|
330
|
-
this.setValue(newValue);
|
|
331
|
-
this.inputEl.selectionStart = newBeforeSelection.length;
|
|
332
|
-
this.inputEl.selectionEnd = newBeforeSelection.length;
|
|
333
|
-
}
|
|
334
|
-
handleScroll() {
|
|
335
|
-
this.preEl.scrollTop = this.inputEl.scrollTop;
|
|
336
|
-
this.preEl.scrollLeft = this.inputEl.scrollLeft;
|
|
337
|
-
}
|
|
338
|
-
async updateHighlightedCode() {
|
|
339
|
-
this.codeEl.textContent = this.inputEl.value || this.placeholder;
|
|
340
|
-
const prism = await (0, import_implementations.loadPrism)();
|
|
341
|
-
prism.highlightElement(this.codeEl);
|
|
342
|
-
this.preEl.toggleClass(import_css_class.CssClass.IsPlaceholder, this.isEmpty());
|
|
343
|
-
window.requestAnimationFrame(() => {
|
|
344
|
-
const gap = Math.max(0, this.inputEl.scrollHeight - this.preEl.scrollHeight);
|
|
345
|
-
this.preEl.setCssProps({
|
|
346
|
-
"--bottom-gap": (0, import_html_element.toPx)(gap)
|
|
347
|
-
});
|
|
348
|
-
this.handleScroll();
|
|
349
|
-
});
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
353
|
-
0 && (module.exports = {
|
|
354
|
-
CodeHighlighterComponent
|
|
355
|
-
});
|
|
356
|
-
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2NvbXBvbmVudHMvc2V0dGluZy1jb21wb25lbnRzL2NvZGUtaGlnaGxpZ2h0ZXItY29tcG9uZW50LnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyIvKipcbiAqIEBmaWxlXG4gKlxuICogQ29udGFpbnMgYSBjb21wb25lbnQgdGhhdCBkaXNwbGF5cyBhbmQgZWRpdHMgbXVsdGlwbGUgdGV4dCB2YWx1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