@mnaoumov/obsidian-lib 1.0.0 → 2.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/README.md +9 -1
- package/dist/lib/cjs/__merged.cjs +54 -64
- package/dist/lib/cjs/__merged.d.cts +5 -3
- package/dist/lib/cjs/active-file-provider.cjs +40 -64
- package/dist/lib/cjs/app.cjs +40 -64
- package/dist/lib/cjs/async-with-notice.cjs +40 -64
- package/dist/lib/cjs/attachment-path.cjs +101 -72
- package/dist/lib/cjs/attachment-path.d.cts +21 -43
- package/dist/lib/cjs/attachment-unit-folder.cjs +40 -64
- package/dist/lib/cjs/attachment-unit-folder.d.cts +8 -9
- package/dist/lib/cjs/backlink-index.cjs +41 -65
- package/dist/lib/cjs/backlink.cjs +40 -64
- package/dist/lib/cjs/bases-view-registrar.cjs +40 -64
- package/dist/lib/cjs/callout.cjs +40 -64
- package/dist/lib/cjs/canvas.cjs +40 -64
- package/dist/lib/cjs/case-insensitive-file-index.cjs +40 -64
- package/dist/lib/cjs/code-block-markdown-information.cjs +40 -64
- package/dist/lib/cjs/code-block-reg-exp.cjs +40 -64
- package/dist/lib/cjs/codemirror/index.cjs +40 -64
- package/dist/lib/cjs/codemirror/state-field-spec.cjs +40 -64
- package/dist/lib/cjs/command-handlers/abstract-file-command-handler.cjs +40 -64
- package/dist/lib/cjs/command-handlers/command-handler-component.cjs +40 -64
- package/dist/lib/cjs/command-handlers/command-handler.cjs +40 -64
- package/dist/lib/cjs/command-handlers/editor-command-handler.cjs +40 -64
- package/dist/lib/cjs/command-handlers/file-command-handler.cjs +40 -64
- package/dist/lib/cjs/command-handlers/folder-command-handler.cjs +40 -64
- package/dist/lib/cjs/command-handlers/global-command-handler.cjs +40 -64
- package/dist/lib/cjs/command-handlers/index.cjs +40 -64
- package/dist/lib/cjs/command-handlers/open-demo-vault-command-handler.cjs +40 -64
- package/dist/lib/cjs/command-handlers/open-settings-command-handler.cjs +40 -64
- package/dist/lib/cjs/command-handlers/unlock-active-note-command-handler.cjs +40 -64
- package/dist/lib/cjs/command-registrar.cjs +40 -64
- package/dist/lib/cjs/community-plugins.cjs +40 -64
- package/dist/lib/cjs/components/abort-signal-component.cjs +40 -64
- package/dist/lib/cjs/components/all-windows-event-component.cjs +40 -64
- package/dist/lib/cjs/components/async-error-handler-component.cjs +40 -64
- package/dist/lib/cjs/components/async-events-component.cjs +40 -64
- package/dist/lib/cjs/components/case-insensitive-file-index-component.cjs +40 -64
- package/dist/lib/cjs/components/component-ex.cjs +41 -65
- package/dist/lib/cjs/components/console-debug-component.cjs +40 -64
- package/dist/lib/cjs/components/core-plugin-toggle-component.cjs +40 -64
- package/dist/lib/cjs/components/disposable-component.cjs +40 -64
- package/dist/lib/cjs/components/embed-extensions-component.cjs +40 -64
- package/dist/lib/cjs/components/generate-markdown-link-default-params-component.cjs +40 -64
- package/dist/lib/cjs/components/index.cjs +40 -64
- package/dist/lib/cjs/components/layout-ready-component.cjs +40 -64
- package/dist/lib/cjs/components/menu-event-registrar-component.cjs +40 -64
- package/dist/lib/cjs/components/monkey-around-component.cjs +40 -64
- package/dist/lib/cjs/components/notebook-navigator-menu-event-registrar-component.cjs +40 -64
- package/dist/lib/cjs/components/plugin-context-component.cjs +40 -64
- package/dist/lib/cjs/components/plugin-gate-component.cjs +41 -65
- package/dist/lib/cjs/components/plugin-notice-component.cjs +46 -65
- package/dist/lib/cjs/components/plugin-notice-component.d.cts +3 -0
- package/dist/lib/cjs/components/plugin-settings-component.cjs +41 -65
- package/dist/lib/cjs/components/plugin-settings-tab-component.cjs +40 -64
- package/dist/lib/cjs/components/plugin-suggestion-component.cjs +40 -64
- package/dist/lib/cjs/components/pointer-position-component.cjs +40 -64
- package/dist/lib/cjs/components/registry-component.cjs +40 -64
- package/dist/lib/cjs/components/release-notes-component.cjs +42 -65
- package/dist/lib/cjs/components/rename-delete-handler-component.cjs +40 -64
- package/dist/lib/cjs/components/rmdir-guard-component.cjs +40 -64
- package/dist/lib/cjs/components/settings-migration-component.cjs +44 -68
- package/dist/lib/cjs/components/settings-migration-component.d.cts +6 -4
- package/dist/lib/cjs/components/syntax-highlighting-component.cjs +40 -64
- package/dist/lib/cjs/components/templates-language-component.cjs +40 -64
- package/dist/lib/cjs/constructors/get-dom-events-handlers-constructor.cjs +40 -64
- package/dist/lib/cjs/constructors/index.cjs +40 -64
- package/dist/lib/cjs/css-class.cjs +40 -64
- package/dist/lib/cjs/data-handler.cjs +40 -64
- package/dist/lib/cjs/dataview-link.cjs +40 -64
- package/dist/lib/cjs/dataview.cjs +40 -64
- package/dist/lib/cjs/debug.cjs +40 -64
- package/dist/lib/cjs/demo-vault-helper-settings.cjs +40 -64
- package/dist/lib/cjs/demo-vault-helper.cjs +42 -65
- package/dist/lib/cjs/demo-vault-naming.cjs +40 -64
- package/dist/lib/cjs/desktop-demo-vault-opener.cjs +48 -71
- package/dist/lib/cjs/desktop-trusted-input.cjs +40 -64
- package/dist/lib/cjs/editor-extension-registrar.cjs +40 -64
- package/dist/lib/cjs/editor-suggest-registrar.cjs +40 -64
- package/dist/lib/cjs/editor.cjs +40 -64
- package/dist/lib/cjs/events.cjs +40 -64
- package/dist/lib/cjs/extensions-registrar.cjs +40 -64
- package/dist/lib/cjs/file-change.cjs +40 -64
- package/dist/lib/cjs/file-explorer.cjs +40 -64
- package/dist/lib/cjs/file-manager.cjs +40 -64
- package/dist/lib/cjs/file-system.cjs +45 -64
- package/dist/lib/cjs/file-system.d.cts +7 -0
- package/dist/lib/cjs/folder-note.cjs +40 -64
- package/dist/lib/cjs/frontmatter-formatting.cjs +41 -65
- package/dist/lib/cjs/frontmatter-link-cache-with-offsets.cjs +40 -64
- package/dist/lib/cjs/frontmatter.cjs +40 -64
- package/dist/lib/cjs/generated-during-build.cjs +42 -66
- package/dist/lib/cjs/generated-during-build.d.cts +8 -2
- package/dist/lib/cjs/hover-link-source-registrar.cjs +40 -64
- package/dist/lib/cjs/html-element.cjs +40 -64
- package/dist/lib/cjs/i18n/custom-type-options.cjs +40 -64
- package/dist/lib/cjs/i18n/default-translations.cjs +40 -64
- package/dist/lib/cjs/i18n/i18n.cjs +40 -64
- package/dist/lib/cjs/i18n/index.cjs +40 -64
- package/dist/lib/cjs/i18n/locales/en.cjs +40 -64
- package/dist/lib/cjs/i18n/locales/index.cjs +40 -64
- package/dist/lib/cjs/i18n/locales/translations-map.cjs +40 -64
- package/dist/lib/cjs/index.cjs +40 -64
- package/dist/lib/cjs/is-in-obsidian.cjs +40 -64
- package/dist/lib/cjs/library-styles.cjs +40 -64
- package/dist/lib/cjs/library.cjs +40 -64
- package/dist/lib/cjs/link-name.cjs +40 -64
- package/dist/lib/cjs/link-update-progress.cjs +40 -64
- package/dist/lib/cjs/link.cjs +40 -64
- package/dist/lib/cjs/logger.cjs +40 -64
- package/dist/lib/cjs/loop.cjs +40 -64
- package/dist/lib/cjs/markdown-code-block-processor-registrar.cjs +40 -64
- package/dist/lib/cjs/markdown-code-block-processor.cjs +40 -64
- package/dist/lib/cjs/markdown-post-processor-registrar.cjs +40 -64
- package/dist/lib/cjs/markdown-view.cjs +40 -64
- package/dist/lib/cjs/markdown.cjs +40 -64
- package/dist/lib/cjs/menu-event-registrar.cjs +40 -64
- package/dist/lib/cjs/metadata-cache.cjs +64 -70
- package/dist/lib/cjs/metadata-cache.d.cts +8 -19
- package/dist/lib/cjs/mobile-trusted-input.cjs +40 -64
- package/dist/lib/cjs/modals/alert.cjs +40 -64
- package/dist/lib/cjs/modals/confirm.cjs +40 -64
- package/dist/lib/cjs/modals/index.cjs +40 -64
- package/dist/lib/cjs/modals/minimizable-modal.cjs +40 -64
- package/dist/lib/cjs/modals/modal-command-builder.cjs +40 -64
- package/dist/lib/cjs/modals/modal.cjs +40 -64
- package/dist/lib/cjs/modals/prompt.cjs +40 -64
- package/dist/lib/cjs/modals/select-item.cjs +40 -64
- package/dist/lib/cjs/modals/select-option.cjs +40 -64
- package/dist/lib/cjs/modals/suggest-modal-command-builder.cjs +40 -64
- package/dist/lib/cjs/note-priority.cjs +41 -65
- package/dist/lib/cjs/notebook-navigator.cjs +40 -64
- package/dist/lib/cjs/obsidian-dev-utils-state.cjs +40 -64
- package/dist/lib/cjs/obsidian-protocol-handler-registrar.cjs +40 -64
- package/dist/lib/cjs/obsidian-settings.cjs +40 -64
- package/dist/lib/cjs/parse-link.cjs +40 -64
- package/dist/lib/cjs/path-settings.cjs +40 -64
- package/dist/lib/cjs/pdf.cjs +40 -64
- package/dist/lib/cjs/plugin/index.cjs +43 -64
- package/dist/lib/cjs/plugin/index.d.cts +1 -0
- package/dist/lib/cjs/plugin/plugin-api-schema.cjs +171 -0
- package/dist/lib/cjs/plugin/plugin-api-schema.d.cts +59 -0
- package/dist/lib/cjs/plugin/plugin-api.cjs +46 -64
- package/dist/lib/cjs/plugin/plugin-api.d.cts +83 -10
- package/dist/lib/cjs/plugin/plugin-context.cjs +40 -64
- package/dist/lib/cjs/plugin/plugin-event-source.cjs +40 -64
- package/dist/lib/cjs/plugin/plugin-install-state.cjs +40 -64
- package/dist/lib/cjs/plugin/plugin-lifecycle-events.cjs +40 -64
- package/dist/lib/cjs/plugin/plugin-settings-tab.cjs +41 -65
- package/dist/lib/cjs/plugin/plugin.cjs +41 -65
- package/dist/lib/cjs/plugin/settings-migration-api.cjs +69 -64
- package/dist/lib/cjs/plugin/settings-migration-api.d.cts +16 -3
- package/dist/lib/cjs/plugin-cli-handler-registrar.cjs +40 -64
- package/dist/lib/cjs/popovers/field-popover.cjs +40 -64
- package/dist/lib/cjs/popovers/index.cjs +40 -64
- package/dist/lib/cjs/popovers/popover-anchor.cjs +40 -64
- package/dist/lib/cjs/popovers/popover.cjs +40 -64
- package/dist/lib/cjs/property-entry.cjs +40 -64
- package/dist/lib/cjs/queue.cjs +40 -64
- package/dist/lib/cjs/react/app-context.cjs +40 -64
- package/dist/lib/cjs/react/index.cjs +40 -64
- package/dist/lib/cjs/reference.cjs +40 -64
- package/dist/lib/cjs/resource-lock.cjs +40 -64
- package/dist/lib/cjs/resource-url.cjs +40 -64
- package/dist/lib/cjs/ribbon-icon-registrar.cjs +40 -64
- package/dist/lib/cjs/setting-components/checkbox-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/code-highlighter-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/date-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/date-time-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/email-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/file-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/index.cjs +40 -64
- package/dist/lib/cjs/setting-components/month-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/multiple-dropdown-component.cjs +41 -65
- package/dist/lib/cjs/setting-components/multiple-email-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/multiple-file-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/multiple-text-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/number-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/password-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/setting-component-wrapper.cjs +40 -64
- package/dist/lib/cjs/setting-components/telephone-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/text-based-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/time-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/tri-state-checkbox-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/typed-dropdown-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/typed-multiple-dropdown-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/typed-range-text-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/typed-text-component.cjs +41 -65
- package/dist/lib/cjs/setting-components/url-component.cjs +40 -64
- package/dist/lib/cjs/setting-components/validator-component.cjs +41 -65
- package/dist/lib/cjs/setting-components/value-component-with-change-tracking.cjs +40 -64
- package/dist/lib/cjs/setting-components/week-component.cjs +40 -64
- package/dist/lib/cjs/setting-ex.cjs +40 -64
- package/dist/lib/cjs/setting-group-ex.cjs +40 -64
- package/dist/lib/cjs/status-bar-item-registrar.cjs +40 -64
- package/dist/lib/cjs/templater.cjs +40 -64
- package/dist/lib/cjs/transformers/duration-transformer.cjs +40 -64
- package/dist/lib/cjs/transformers/index.cjs +40 -64
- package/dist/lib/cjs/trusted-input.cjs +40 -64
- package/dist/lib/cjs/validation.cjs +40 -64
- package/dist/lib/cjs/vault-delete.cjs +40 -64
- package/dist/lib/cjs/vault-transaction.cjs +40 -64
- package/dist/lib/cjs/vault.cjs +41 -65
- package/dist/lib/cjs/view-registrar.cjs +40 -64
- package/dist/lib/cjs/workspace.cjs +40 -64
- package/dist/lib/esm/__merged.d.mts +5 -3
- package/dist/lib/esm/__merged.mjs +20 -14
- package/dist/lib/esm/active-file-provider.mjs +6 -14
- package/dist/lib/esm/app.mjs +6 -14
- package/dist/lib/esm/async-with-notice.mjs +6 -14
- package/dist/lib/esm/attachment-path.d.mts +21 -43
- package/dist/lib/esm/attachment-path.mjs +70 -22
- package/dist/lib/esm/attachment-unit-folder.d.mts +8 -9
- package/dist/lib/esm/attachment-unit-folder.mjs +6 -14
- package/dist/lib/esm/backlink-index.mjs +6 -14
- package/dist/lib/esm/backlink.mjs +6 -14
- package/dist/lib/esm/bases-view-registrar.mjs +6 -14
- package/dist/lib/esm/callout.mjs +6 -14
- package/dist/lib/esm/canvas.mjs +6 -14
- package/dist/lib/esm/case-insensitive-file-index.mjs +6 -14
- package/dist/lib/esm/code-block-markdown-information.mjs +5 -13
- package/dist/lib/esm/code-block-reg-exp.mjs +6 -14
- package/dist/lib/esm/codemirror/index.mjs +6 -14
- package/dist/lib/esm/codemirror/state-field-spec.mjs +5 -13
- package/dist/lib/esm/command-handlers/abstract-file-command-handler.mjs +6 -14
- package/dist/lib/esm/command-handlers/command-handler-component.mjs +6 -14
- package/dist/lib/esm/command-handlers/command-handler.mjs +6 -14
- package/dist/lib/esm/command-handlers/editor-command-handler.mjs +6 -14
- package/dist/lib/esm/command-handlers/file-command-handler.mjs +6 -14
- package/dist/lib/esm/command-handlers/folder-command-handler.mjs +6 -14
- package/dist/lib/esm/command-handlers/global-command-handler.mjs +6 -14
- package/dist/lib/esm/command-handlers/index.mjs +6 -14
- package/dist/lib/esm/command-handlers/open-demo-vault-command-handler.mjs +6 -14
- package/dist/lib/esm/command-handlers/open-settings-command-handler.mjs +6 -14
- package/dist/lib/esm/command-handlers/unlock-active-note-command-handler.mjs +6 -14
- package/dist/lib/esm/command-registrar.mjs +6 -14
- package/dist/lib/esm/community-plugins.mjs +6 -14
- package/dist/lib/esm/components/abort-signal-component.mjs +6 -14
- package/dist/lib/esm/components/all-windows-event-component.mjs +6 -14
- package/dist/lib/esm/components/async-error-handler-component.mjs +6 -14
- package/dist/lib/esm/components/async-events-component.mjs +6 -14
- package/dist/lib/esm/components/case-insensitive-file-index-component.mjs +6 -14
- package/dist/lib/esm/components/component-ex.mjs +6 -14
- package/dist/lib/esm/components/console-debug-component.mjs +6 -14
- package/dist/lib/esm/components/core-plugin-toggle-component.mjs +6 -14
- package/dist/lib/esm/components/disposable-component.mjs +6 -14
- package/dist/lib/esm/components/embed-extensions-component.mjs +6 -14
- package/dist/lib/esm/components/generate-markdown-link-default-params-component.mjs +6 -14
- package/dist/lib/esm/components/index.mjs +6 -14
- package/dist/lib/esm/components/layout-ready-component.mjs +6 -14
- package/dist/lib/esm/components/menu-event-registrar-component.mjs +6 -14
- package/dist/lib/esm/components/monkey-around-component.mjs +6 -14
- package/dist/lib/esm/components/notebook-navigator-menu-event-registrar-component.mjs +6 -14
- package/dist/lib/esm/components/plugin-context-component.mjs +6 -14
- package/dist/lib/esm/components/plugin-gate-component.mjs +6 -14
- package/dist/lib/esm/components/plugin-notice-component.d.mts +3 -0
- package/dist/lib/esm/components/plugin-notice-component.mjs +12 -15
- package/dist/lib/esm/components/plugin-settings-component.mjs +6 -14
- package/dist/lib/esm/components/plugin-settings-tab-component.mjs +6 -14
- package/dist/lib/esm/components/plugin-suggestion-component.mjs +6 -14
- package/dist/lib/esm/components/pointer-position-component.mjs +6 -14
- package/dist/lib/esm/components/registry-component.mjs +6 -14
- package/dist/lib/esm/components/release-notes-component.mjs +11 -15
- package/dist/lib/esm/components/rename-delete-handler-component.mjs +6 -14
- package/dist/lib/esm/components/rmdir-guard-component.mjs +6 -14
- package/dist/lib/esm/components/settings-migration-component.d.mts +6 -4
- package/dist/lib/esm/components/settings-migration-component.mjs +10 -18
- package/dist/lib/esm/components/syntax-highlighting-component.mjs +6 -14
- package/dist/lib/esm/components/templates-language-component.mjs +6 -14
- package/dist/lib/esm/constructors/get-dom-events-handlers-constructor.mjs +6 -14
- package/dist/lib/esm/constructors/index.mjs +6 -14
- package/dist/lib/esm/css-class.mjs +6 -14
- package/dist/lib/esm/data-handler.mjs +6 -14
- package/dist/lib/esm/dataview-link.mjs +6 -14
- package/dist/lib/esm/dataview.mjs +6 -14
- package/dist/lib/esm/debug.mjs +6 -14
- package/dist/lib/esm/demo-vault-helper-settings.mjs +5 -13
- package/dist/lib/esm/demo-vault-helper.mjs +8 -15
- package/dist/lib/esm/demo-vault-naming.mjs +6 -14
- package/dist/lib/esm/desktop-demo-vault-opener.mjs +17 -21
- package/dist/lib/esm/desktop-trusted-input.mjs +6 -14
- package/dist/lib/esm/editor-extension-registrar.mjs +6 -14
- package/dist/lib/esm/editor-suggest-registrar.mjs +6 -14
- package/dist/lib/esm/editor.mjs +6 -14
- package/dist/lib/esm/events.mjs +6 -14
- package/dist/lib/esm/extensions-registrar.mjs +6 -14
- package/dist/lib/esm/file-change.mjs +6 -14
- package/dist/lib/esm/file-explorer.mjs +6 -14
- package/dist/lib/esm/file-manager.mjs +6 -14
- package/dist/lib/esm/file-system.d.mts +7 -0
- package/dist/lib/esm/file-system.mjs +10 -14
- package/dist/lib/esm/folder-note.mjs +6 -14
- package/dist/lib/esm/frontmatter-formatting.mjs +6 -14
- package/dist/lib/esm/frontmatter-link-cache-with-offsets.mjs +6 -14
- package/dist/lib/esm/frontmatter.mjs +6 -14
- package/dist/lib/esm/generated-during-build.d.mts +8 -2
- package/dist/lib/esm/generated-during-build.mjs +8 -16
- package/dist/lib/esm/hover-link-source-registrar.mjs +6 -14
- package/dist/lib/esm/html-element.mjs +6 -14
- package/dist/lib/esm/i18n/custom-type-options.mjs +6 -14
- package/dist/lib/esm/i18n/default-translations.mjs +6 -14
- package/dist/lib/esm/i18n/i18n.mjs +6 -14
- package/dist/lib/esm/i18n/index.mjs +6 -14
- package/dist/lib/esm/i18n/locales/en.mjs +6 -14
- package/dist/lib/esm/i18n/locales/index.mjs +6 -14
- package/dist/lib/esm/i18n/locales/translations-map.mjs +6 -14
- package/dist/lib/esm/index.mjs +6 -14
- package/dist/lib/esm/is-in-obsidian.mjs +6 -14
- package/dist/lib/esm/library-styles.mjs +6 -14
- package/dist/lib/esm/library.mjs +6 -14
- package/dist/lib/esm/link-name.mjs +6 -14
- package/dist/lib/esm/link-update-progress.mjs +5 -13
- package/dist/lib/esm/link.mjs +6 -14
- package/dist/lib/esm/logger.mjs +6 -14
- package/dist/lib/esm/loop.mjs +6 -14
- package/dist/lib/esm/markdown-code-block-processor-registrar.mjs +6 -14
- package/dist/lib/esm/markdown-code-block-processor.mjs +6 -14
- package/dist/lib/esm/markdown-post-processor-registrar.mjs +6 -14
- package/dist/lib/esm/markdown-view.mjs +6 -14
- package/dist/lib/esm/markdown.mjs +6 -14
- package/dist/lib/esm/menu-event-registrar.mjs +5 -13
- package/dist/lib/esm/metadata-cache.d.mts +8 -19
- package/dist/lib/esm/metadata-cache.mjs +35 -21
- package/dist/lib/esm/mobile-trusted-input.mjs +6 -14
- package/dist/lib/esm/modals/alert.mjs +6 -14
- package/dist/lib/esm/modals/confirm.mjs +6 -14
- package/dist/lib/esm/modals/index.mjs +6 -14
- package/dist/lib/esm/modals/minimizable-modal.mjs +6 -14
- package/dist/lib/esm/modals/modal-command-builder.mjs +6 -14
- package/dist/lib/esm/modals/modal.mjs +6 -14
- package/dist/lib/esm/modals/prompt.mjs +6 -14
- package/dist/lib/esm/modals/select-item.mjs +6 -14
- package/dist/lib/esm/modals/select-option.mjs +6 -14
- package/dist/lib/esm/modals/suggest-modal-command-builder.mjs +6 -14
- package/dist/lib/esm/note-priority.mjs +6 -14
- package/dist/lib/esm/notebook-navigator.mjs +6 -14
- package/dist/lib/esm/obsidian-dev-utils-state.mjs +6 -14
- package/dist/lib/esm/obsidian-protocol-handler-registrar.mjs +6 -14
- package/dist/lib/esm/obsidian-settings.mjs +6 -14
- package/dist/lib/esm/parse-link.mjs +6 -14
- package/dist/lib/esm/path-settings.mjs +6 -14
- package/dist/lib/esm/pdf.mjs +6 -14
- package/dist/lib/esm/plugin/index.d.mts +1 -0
- package/dist/lib/esm/plugin/index.mjs +8 -14
- package/dist/lib/esm/plugin/plugin-api-schema.d.mts +59 -0
- package/dist/lib/esm/plugin/plugin-api-schema.mjs +73 -0
- package/dist/lib/esm/plugin/plugin-api.d.mts +83 -10
- package/dist/lib/esm/plugin/plugin-api.mjs +11 -14
- package/dist/lib/esm/plugin/plugin-context.mjs +6 -14
- package/dist/lib/esm/plugin/plugin-event-source.mjs +6 -14
- package/dist/lib/esm/plugin/plugin-install-state.mjs +6 -14
- package/dist/lib/esm/plugin/plugin-lifecycle-events.mjs +6 -14
- package/dist/lib/esm/plugin/plugin-settings-tab.mjs +6 -14
- package/dist/lib/esm/plugin/plugin.mjs +6 -14
- package/dist/lib/esm/plugin/settings-migration-api.d.mts +16 -3
- package/dist/lib/esm/plugin/settings-migration-api.mjs +30 -14
- package/dist/lib/esm/plugin-cli-handler-registrar.mjs +6 -14
- package/dist/lib/esm/popovers/field-popover.mjs +6 -14
- package/dist/lib/esm/popovers/index.mjs +6 -14
- package/dist/lib/esm/popovers/popover-anchor.mjs +6 -14
- package/dist/lib/esm/popovers/popover.mjs +6 -14
- package/dist/lib/esm/property-entry.mjs +6 -14
- package/dist/lib/esm/queue.mjs +6 -14
- package/dist/lib/esm/react/app-context.mjs +6 -14
- package/dist/lib/esm/react/index.mjs +6 -14
- package/dist/lib/esm/reference.mjs +6 -14
- package/dist/lib/esm/resource-lock.mjs +6 -14
- package/dist/lib/esm/resource-url.mjs +6 -14
- package/dist/lib/esm/ribbon-icon-registrar.mjs +6 -14
- package/dist/lib/esm/setting-components/checkbox-component.mjs +6 -14
- package/dist/lib/esm/setting-components/code-highlighter-component.mjs +6 -14
- package/dist/lib/esm/setting-components/date-component.mjs +6 -14
- package/dist/lib/esm/setting-components/date-time-component.mjs +6 -14
- package/dist/lib/esm/setting-components/email-component.mjs +6 -14
- package/dist/lib/esm/setting-components/file-component.mjs +6 -14
- package/dist/lib/esm/setting-components/index.mjs +6 -14
- package/dist/lib/esm/setting-components/month-component.mjs +6 -14
- package/dist/lib/esm/setting-components/multiple-dropdown-component.mjs +6 -14
- package/dist/lib/esm/setting-components/multiple-email-component.mjs +6 -14
- package/dist/lib/esm/setting-components/multiple-file-component.mjs +6 -14
- package/dist/lib/esm/setting-components/multiple-text-component.mjs +6 -14
- package/dist/lib/esm/setting-components/number-component.mjs +6 -14
- package/dist/lib/esm/setting-components/password-component.mjs +6 -14
- package/dist/lib/esm/setting-components/setting-component-wrapper.mjs +6 -14
- package/dist/lib/esm/setting-components/telephone-component.mjs +6 -14
- package/dist/lib/esm/setting-components/text-based-component.mjs +6 -14
- package/dist/lib/esm/setting-components/time-component.mjs +6 -14
- package/dist/lib/esm/setting-components/tri-state-checkbox-component.mjs +6 -14
- package/dist/lib/esm/setting-components/typed-dropdown-component.mjs +6 -14
- package/dist/lib/esm/setting-components/typed-multiple-dropdown-component.mjs +6 -14
- package/dist/lib/esm/setting-components/typed-range-text-component.mjs +6 -14
- package/dist/lib/esm/setting-components/typed-text-component.mjs +6 -14
- package/dist/lib/esm/setting-components/url-component.mjs +6 -14
- package/dist/lib/esm/setting-components/validator-component.mjs +6 -14
- package/dist/lib/esm/setting-components/value-component-with-change-tracking.mjs +5 -13
- package/dist/lib/esm/setting-components/week-component.mjs +6 -14
- package/dist/lib/esm/setting-ex.mjs +6 -14
- package/dist/lib/esm/setting-group-ex.mjs +6 -14
- package/dist/lib/esm/status-bar-item-registrar.mjs +6 -14
- package/dist/lib/esm/templater.mjs +6 -14
- package/dist/lib/esm/transformers/duration-transformer.mjs +6 -14
- package/dist/lib/esm/transformers/index.mjs +6 -14
- package/dist/lib/esm/trusted-input.mjs +6 -14
- package/dist/lib/esm/validation.mjs +6 -14
- package/dist/lib/esm/vault-delete.mjs +6 -14
- package/dist/lib/esm/vault-transaction.mjs +6 -14
- package/dist/lib/esm/vault.mjs +6 -14
- package/dist/lib/esm/view-registrar.mjs +6 -14
- package/dist/lib/esm/workspace.mjs +6 -14
- package/dist/styles.css +4 -1
- package/package.json +69 -24
- package/plugin/plugin-api-schema/package.json +6 -0
|
@@ -0,0 +1,171 @@
|
|
|
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 () {
|
|
7
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
8
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for("Symbol.asyncDispose");
|
|
9
|
+
symbolConstructor.dispose ??= symbolConstructor.for("Symbol.dispose");
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function ensureBrowserProcess() {
|
|
13
|
+
const browserProcess = {
|
|
14
|
+
browser: true,
|
|
15
|
+
cwd() {
|
|
16
|
+
return "/";
|
|
17
|
+
},
|
|
18
|
+
env: {},
|
|
19
|
+
platform: "android"
|
|
20
|
+
};
|
|
21
|
+
const existingProcess = globalThis.process;
|
|
22
|
+
if (!existingProcess) {
|
|
23
|
+
globalThis.process = browserProcess;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (existingProcess.versions?.node) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const existingProcessRecord = existingProcess;
|
|
30
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
31
|
+
existingProcessRecord[key] ??= value;
|
|
32
|
+
}
|
|
33
|
+
existingProcessRecord["browser"] = true;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function keepName($unknown) {
|
|
37
|
+
return $unknown;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
(function initCjs() {
|
|
41
|
+
const globalThisRecord = globalThis;
|
|
42
|
+
ensureDisposeSymbols();
|
|
43
|
+
globalThisRecord["__name"] ??= keepName;
|
|
44
|
+
globalThisRecord["__extractDefault"] ??= extractDefault;
|
|
45
|
+
ensureBrowserProcess();
|
|
46
|
+
function extractDefault(module) {
|
|
47
|
+
return module && module.__esModule && "default" in module ? module.default : module;
|
|
48
|
+
}
|
|
49
|
+
})();
|
|
50
|
+
})();
|
|
51
|
+
(function patchObsidianRequire() {
|
|
52
|
+
const originalRequire = require;
|
|
53
|
+
if (!originalRequire || originalRequire.__isPatched) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
require = Object.assign(
|
|
57
|
+
(id) => requirePatched(id),
|
|
58
|
+
originalRequire,
|
|
59
|
+
{
|
|
60
|
+
__isPatched: true
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
function extractDefault(module) {
|
|
64
|
+
return module && module.__esModule && "default" in module ? module.default : module;
|
|
65
|
+
}
|
|
66
|
+
const OBSIDIAN_BUILT_IN_MODULE_NAMES = /* @__PURE__ */ new Set([
|
|
67
|
+
"@codemirror/autocomplete",
|
|
68
|
+
"@codemirror/collab",
|
|
69
|
+
"@codemirror/commands",
|
|
70
|
+
"@codemirror/language",
|
|
71
|
+
"@codemirror/lint",
|
|
72
|
+
"@codemirror/search",
|
|
73
|
+
"@codemirror/state",
|
|
74
|
+
"@codemirror/text",
|
|
75
|
+
"@codemirror/view",
|
|
76
|
+
"@lezer/common",
|
|
77
|
+
"@lezer/highlight",
|
|
78
|
+
"@lezer/lr",
|
|
79
|
+
"obsidian"
|
|
80
|
+
]);
|
|
81
|
+
const DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES = /* @__PURE__ */ new Set([
|
|
82
|
+
"@codemirror/closebrackets",
|
|
83
|
+
"@codemirror/comment",
|
|
84
|
+
"@codemirror/fold",
|
|
85
|
+
"@codemirror/gutter",
|
|
86
|
+
"@codemirror/highlight",
|
|
87
|
+
"@codemirror/history",
|
|
88
|
+
"@codemirror/matchbrackets",
|
|
89
|
+
"@codemirror/panel",
|
|
90
|
+
"@codemirror/rangeset",
|
|
91
|
+
"@codemirror/rectangular-selection",
|
|
92
|
+
"@codemirror/stream-parser",
|
|
93
|
+
"@codemirror/tooltip"
|
|
94
|
+
]);
|
|
95
|
+
function requirePatched(id) {
|
|
96
|
+
if (OBSIDIAN_BUILT_IN_MODULE_NAMES.has(id) || DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES.has(id)) {
|
|
97
|
+
return originalRequire?.(id);
|
|
98
|
+
}
|
|
99
|
+
if (globalThis.app.isMobile) {
|
|
100
|
+
if (id === "process" || id === "node:process") {
|
|
101
|
+
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Fake process object is returned instead.`);
|
|
102
|
+
return process;
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
const module = originalRequire?.(id);
|
|
106
|
+
if (module) {
|
|
107
|
+
return extractDefault(module);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Empty object is returned instead.`);
|
|
111
|
+
return {};
|
|
112
|
+
}
|
|
113
|
+
})();
|
|
114
|
+
|
|
115
|
+
"use strict";
|
|
116
|
+
var __defProp = Object.defineProperty;
|
|
117
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
118
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
119
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
120
|
+
var __export = (target, all) => {
|
|
121
|
+
for (var name in all)
|
|
122
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
123
|
+
};
|
|
124
|
+
var __copyProps = (to, from, except, desc) => {
|
|
125
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
126
|
+
for (let key of __getOwnPropNames(from))
|
|
127
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
128
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
129
|
+
}
|
|
130
|
+
return to;
|
|
131
|
+
};
|
|
132
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
133
|
+
var plugin_api_schema_exports = {};
|
|
134
|
+
__export(plugin_api_schema_exports, {
|
|
135
|
+
createArgumentsSchema: () => createArgumentsSchema,
|
|
136
|
+
createTypeGuardSchema: () => createTypeGuardSchema
|
|
137
|
+
});
|
|
138
|
+
module.exports = __toCommonJS(plugin_api_schema_exports);
|
|
139
|
+
var import_object_utils = require('@mnaoumov/typescript-lib/object-utils');
|
|
140
|
+
var import_library = require('../library.cjs');
|
|
141
|
+
function createArgumentsSchema(parameters) {
|
|
142
|
+
const parameterList = (0, import_object_utils.castTo)(parameters);
|
|
143
|
+
return createSchema((value) => {
|
|
144
|
+
if (!Array.isArray(value)) {
|
|
145
|
+
return { issues: [{ message: "Expected an argument list." }] };
|
|
146
|
+
}
|
|
147
|
+
if (value.length > parameterList.length) {
|
|
148
|
+
return { issues: [{ message: `Expected at most ${String(parameterList.length)} argument(s), got ${String(value.length)}.` }] };
|
|
149
|
+
}
|
|
150
|
+
const issues = parameterList.flatMap((parameter, index) => parameter.typeGuard(value[index]) ? [] : [{ message: `Expected ${parameter.expected}.`, path: [index] }]);
|
|
151
|
+
return issues.length === 0 ? { value: (0, import_object_utils.castTo)(value) } : { issues };
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function createTypeGuardSchema(params) {
|
|
155
|
+
return createSchema((value) => params.typeGuard(value) ? { value } : { issues: [{ message: `Expected ${params.expected}.` }] });
|
|
156
|
+
}
|
|
157
|
+
function createSchema(validate) {
|
|
158
|
+
return {
|
|
159
|
+
"~standard": {
|
|
160
|
+
validate,
|
|
161
|
+
vendor: import_library.OBSIDIAN_LIBRARY_NAME,
|
|
162
|
+
version: 1
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
167
|
+
0 && (module.exports = {
|
|
168
|
+
createArgumentsSchema,
|
|
169
|
+
createTypeGuardSchema
|
|
170
|
+
});
|
|
171
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL3BsdWdpbi9wbHVnaW4tYXBpLXNjaGVtYS50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAZmlsZVxuICpcbiAqIERlcGVuZGVuY3ktZnJlZSB7QGxpbmsgaHR0cHM6Ly9zdGFuZGFyZHNjaGVtYS5kZXYgfCBTdGFuZGFyZCBTY2hlbWF9IGJ1aWxkZXJzIGZvciB0aGUgcGF5bG9hZCBoYWx2ZXMgb2YgYVxuICogYFBsdWdpbkFwaUNvbnRyYWN0YC5cbiAqXG4gKiBBIGNvbnRyYWN0J3Mgc2NoZW1hcyBjcm9zcyB0aGUgcmVnaXN0cnkgaW5zaWRlIHRoZSBwcm92aWRlcidzIHJlY29yZCBhbmQgcnVuIGluc2lkZSB3aGljaGV2ZXIgbGlicmFyeSBjb3B5XG4gKiBtYWRlIHRoZSBjYWxsLCBzbyB0aGV5IGFyZSBwbGFpbiBvYmplY3RzIG92ZXIgcGxhaW4gZnVuY3Rpb25zIFx1MjAxNCB3aGljaCBhIHR5cGUgZ3VhcmQgYWxyZWFkeSBpcy4gVGhlc2UgYnVpbGRlcnNcbiAqIHR1cm4gdGhlIGd1YXJkcyBhIG1vZHVsZSBhbHJlYWR5IGhhcyBpbnRvIHRoZSB0d28gc2hhcGVz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ElBQy9EO0FBRUEsUUFBSSxNQUFNLFNBQVMsY0FBYyxRQUFRO0FBQ3ZDLGFBQU8sRUFBRSxRQUFRLENBQUMsRUFBRSxTQUFTLG9CQUFvQixPQUFPLGNBQWMsTUFBTSxDQUFDLHFCQUFxQixPQUFPLE1BQU0sTUFBTSxDQUFDLElBQUksQ0FBQyxFQUFFO0FBQUEsSUFDL0g7QUFFQSxVQUFNLFNBQVMsY0FBYyxRQUFRLENBQUMsV0FBVyxVQUFvQyxVQUFVLFVBQVUsTUFBTSxLQUFLLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxFQUFFLFNBQVMsWUFBWSxVQUFVLFFBQVEsS0FBSyxNQUFNLENBQUMsS0FBSyxFQUFFLENBQUMsQ0FBQztBQUM3TCxXQUFPLE9BQU8sV0FBVyxJQUFJLEVBQUUsV0FBTyw0QkFBb0IsS0FBSyxFQUFFLElBQUksRUFBRSxPQUFPO0FBQUEsRUFDaEYsQ0FBQztBQUNIO0FBU08sU0FBUyxzQkFBeUIsUUFBc0U7QUFDN0csU0FBTyxhQUFhLENBQUMsVUFBK0MsT0FBTyxVQUFVLEtBQUssSUFBSSxFQUFFLE1BQU0sSUFBSSxFQUFFLFFBQVEsQ0FBQyxFQUFFLFNBQVMsWUFBWSxPQUFPLFFBQVEsSUFBSSxDQUFDLEVBQUUsQ0FBQztBQUNySztBQUVBLFNBQVMsYUFBZ0IsVUFBd0Y7QUFDL0csU0FBTztBQUFBLElBQ0wsYUFBYTtBQUFBLE1BQ1g7QUFBQSxNQUNBLFFBQVE7QUFBQSxNQUNSLFNBQVM7QUFBQSxJQUNYO0FBQUEsRUFDRjtBQUNGOyIsCiAgIm5hbWVzIjogW10KfQo=
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/// <reference path="../library.d.cts" />
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
*
|
|
5
|
+
* Dependency-free {@link https://standardschema.dev | Standard Schema} builders for the payload halves of a
|
|
6
|
+
* `PluginApiContract`.
|
|
7
|
+
*
|
|
8
|
+
* A contract's schemas cross the registry inside the provider's record and run inside whichever library copy
|
|
9
|
+
* made the call, so they are plain objects over plain functions — which a type guard already is. These builders
|
|
10
|
+
* turn the guards a module already has into the two shapes a method contract needs: one value (an output) and
|
|
11
|
+
* one argument list (an input). zod / valibot / arktype schemas plug into the same slots unchanged; this library
|
|
12
|
+
* just does not make every consumer bundle one to describe two arguments.
|
|
13
|
+
*/
|
|
14
|
+
import type { StandardSchemaV1 } from '@standard-schema/spec' with { 'resolution-mode': 'import' };
|
|
15
|
+
/**
|
|
16
|
+
* One type guard per parameter of a method, in order.
|
|
17
|
+
*
|
|
18
|
+
* @typeParam TParameters - The method's parameters.
|
|
19
|
+
*/
|
|
20
|
+
export type ArgumentTypeGuards<TParameters extends readonly unknown[]> = {
|
|
21
|
+
readonly [TIndex in keyof TParameters]: CreateTypeGuardSchemaParams<TParameters[TIndex]>;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* One value a schema accepts, described by a type guard.
|
|
25
|
+
*
|
|
26
|
+
* @typeParam T - The type the guard narrows to.
|
|
27
|
+
*/
|
|
28
|
+
export interface CreateTypeGuardSchemaParams<T> {
|
|
29
|
+
/**
|
|
30
|
+
* What the value should have been, phrased to follow "Expected", e.g. `'a string'`.
|
|
31
|
+
*/
|
|
32
|
+
readonly expected: string;
|
|
33
|
+
/**
|
|
34
|
+
* Decides whether the value is acceptable.
|
|
35
|
+
*
|
|
36
|
+
* @param value - The value to check.
|
|
37
|
+
* @returns Whether the value is a `T`.
|
|
38
|
+
*/
|
|
39
|
+
readonly typeGuard: (value: unknown) => value is T;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Builds the input schema of a method contract: a schema over the method's ARGUMENT LIST, one type guard per
|
|
43
|
+
* parameter. An argument that fails its guard is reported with its index as the issue path, and an argument
|
|
44
|
+
* list longer than the parameter list is refused. A missing argument reaches its guard as `undefined`, so an
|
|
45
|
+
* optional parameter's guard accepts `undefined`.
|
|
46
|
+
*
|
|
47
|
+
* @typeParam TParameters - The method's parameters, inferred from the guards.
|
|
48
|
+
* @param parameters - One guard per parameter, in order.
|
|
49
|
+
* @returns The schema.
|
|
50
|
+
*/
|
|
51
|
+
export declare function createArgumentsSchema<TParameters extends readonly unknown[]>(parameters: ArgumentTypeGuards<TParameters>): StandardSchemaV1<unknown, TParameters>;
|
|
52
|
+
/**
|
|
53
|
+
* Builds a schema over one value from a type guard — the output schema of a method contract, typically.
|
|
54
|
+
*
|
|
55
|
+
* @typeParam T - The type the guard narrows to.
|
|
56
|
+
* @param params - The guard and what it expects.
|
|
57
|
+
* @returns The schema.
|
|
58
|
+
*/
|
|
59
|
+
export declare function createTypeGuardSchema<T>(params: CreateTypeGuardSchemaParams<T>): StandardSchemaV1<unknown, T>;
|