@mnaoumov/obsidian-lib 10.12.0 → 11.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.
Files changed (399) hide show
  1. package/components/worker-component/package.json +6 -0
  2. package/components/worker-pool-component/package.json +6 -0
  3. package/dist/lib/cjs/__merged.cjs +409 -292
  4. package/dist/lib/cjs/__merged.d.cts +17 -8
  5. package/dist/lib/cjs/anchored-suggest.cjs +1 -1
  6. package/dist/lib/cjs/app.cjs +2 -2
  7. package/dist/lib/cjs/async-with-notice.cjs +4 -4
  8. package/dist/lib/cjs/attachment-path.cjs +9 -9
  9. package/dist/lib/cjs/attachment-path.d.cts +3 -3
  10. package/dist/lib/cjs/attachment-unit-folder.cjs +2 -2
  11. package/dist/lib/cjs/backlink-index.cjs +5 -5
  12. package/dist/lib/cjs/backlink.cjs +7 -7
  13. package/dist/lib/cjs/bases-view-registrar.cjs +1 -1
  14. package/dist/lib/cjs/broken-link-candidates.cjs +1 -1
  15. package/dist/lib/cjs/bug-report.cjs +3 -3
  16. package/dist/lib/cjs/bulk-operation-progress.cjs +1 -1
  17. package/dist/lib/cjs/bulk-operation.cjs +2 -2
  18. package/dist/lib/cjs/callout.cjs +6 -6
  19. package/dist/lib/cjs/canvas.cjs +11 -9
  20. package/dist/lib/cjs/canvas.d.cts +13 -0
  21. package/dist/lib/cjs/case-insensitive-file-index.cjs +3 -3
  22. package/dist/lib/cjs/code-block-render-handoff.cjs +5 -5
  23. package/dist/lib/cjs/codemirror/editor-mode-extension.cjs +4 -4
  24. package/dist/lib/cjs/codemirror/incremental-parse-state-field.cjs +2 -2
  25. package/dist/lib/cjs/codemirror/index.cjs +7 -7
  26. package/dist/lib/cjs/codemirror/inline-token-widgets.cjs +5 -5
  27. package/dist/lib/cjs/codemirror/markdown-editor-views.cjs +2 -2
  28. package/dist/lib/cjs/codemirror/settings-facet.cjs +1 -1
  29. package/dist/lib/cjs/command-handlers/abstract-file-command-handler.cjs +17 -17
  30. package/dist/lib/cjs/command-handlers/abstract-file-command-handler.d.cts +13 -13
  31. package/dist/lib/cjs/command-handlers/command-handler-component.cjs +2 -2
  32. package/dist/lib/cjs/command-handlers/command-handler.cjs +2 -2
  33. package/dist/lib/cjs/command-handlers/editor-command-handler.cjs +10 -10
  34. package/dist/lib/cjs/command-handlers/editor-command-handler.d.cts +7 -7
  35. package/dist/lib/cjs/command-handlers/file-command-handler.cjs +3 -3
  36. package/dist/lib/cjs/command-handlers/folder-command-handler.cjs +3 -3
  37. package/dist/lib/cjs/command-handlers/global-command-handler.cjs +2 -2
  38. package/dist/lib/cjs/command-handlers/index.cjs +15 -15
  39. package/dist/lib/cjs/command-handlers/open-bug-report-command-handler.cjs +6 -6
  40. package/dist/lib/cjs/command-handlers/open-demo-vault-command-handler.cjs +2 -2
  41. package/dist/lib/cjs/command-handlers/open-discussion-command-handler.cjs +2 -2
  42. package/dist/lib/cjs/command-handlers/open-feature-request-command-handler.cjs +2 -2
  43. package/dist/lib/cjs/command-handlers/open-git-hub-command-handler.cjs +1 -1
  44. package/dist/lib/cjs/command-handlers/open-settings-command-handler.cjs +2 -2
  45. package/dist/lib/cjs/command-handlers/undo-bulk-operation-command-handler.cjs +2 -2
  46. package/dist/lib/cjs/command-handlers/unlock-active-note-command-handler.cjs +1 -1
  47. package/dist/lib/cjs/community-plugins.cjs +3 -3
  48. package/dist/lib/cjs/components/abort-signal-component.cjs +2 -2
  49. package/dist/lib/cjs/components/all-windows-event-component.cjs +5 -5
  50. package/dist/lib/cjs/components/all-windows-status-bar-item-component.cjs +3 -3
  51. package/dist/lib/cjs/components/async-error-handler-component.cjs +5 -5
  52. package/dist/lib/cjs/components/async-events-component.cjs +1 -1
  53. package/dist/lib/cjs/components/bulk-operation-commit-component.cjs +12 -12
  54. package/dist/lib/cjs/components/case-insensitive-file-index-component.cjs +2 -2
  55. package/dist/lib/cjs/components/component-ex.cjs +21 -11
  56. package/dist/lib/cjs/components/component-ex.d.cts +11 -0
  57. package/dist/lib/cjs/components/console-debug-component.cjs +2 -2
  58. package/dist/lib/cjs/components/core-plugin-toggle-component.cjs +2 -2
  59. package/dist/lib/cjs/components/disposable-component.cjs +2 -2
  60. package/dist/lib/cjs/components/embed-extensions-component.cjs +1 -1
  61. package/dist/lib/cjs/components/embeddable-markdown-editor-component.cjs +8 -8
  62. package/dist/lib/cjs/components/file-explorer-root-menu-component.cjs +7 -7
  63. package/dist/lib/cjs/components/generate-markdown-link-default-params-component.cjs +2 -2
  64. package/dist/lib/cjs/components/incremental-file-index-component.cjs +4 -4
  65. package/dist/lib/cjs/components/index.cjs +46 -40
  66. package/dist/lib/cjs/components/index.d.cts +2 -0
  67. package/dist/lib/cjs/components/layout-ready-component.cjs +3 -3
  68. package/dist/lib/cjs/components/menu-event-registrar-component.cjs +2 -2
  69. package/dist/lib/cjs/components/monkey-around-component.cjs +3 -3
  70. package/dist/lib/cjs/components/notebook-navigator-menu-event-registrar-component.cjs +5 -5
  71. package/dist/lib/cjs/components/plugin-context-component.cjs +5 -5
  72. package/dist/lib/cjs/components/plugin-gate-component.cjs +68 -28
  73. package/dist/lib/cjs/components/plugin-gate-component.d.cts +36 -13
  74. package/dist/lib/cjs/components/plugin-notice-component.cjs +39 -33
  75. package/dist/lib/cjs/components/plugin-notice-component.d.cts +4 -3
  76. package/dist/lib/cjs/components/plugin-settings-component.cjs +113 -17
  77. package/dist/lib/cjs/components/plugin-settings-component.d.cts +35 -5
  78. package/dist/lib/cjs/components/plugin-settings-tab-component.cjs +2 -2
  79. package/dist/lib/cjs/components/plugin-suggestion-component.cjs +8 -8
  80. package/dist/lib/cjs/components/pointer-position-component.cjs +2 -2
  81. package/dist/lib/cjs/components/reconfigurable-editor-extension-component.cjs +3 -3
  82. package/dist/lib/cjs/components/registry-component.cjs +2 -2
  83. package/dist/lib/cjs/components/release-notes-component.cjs +6 -6
  84. package/dist/lib/cjs/components/rename-delete-handler-component.cjs +25 -25
  85. package/dist/lib/cjs/components/rmdir-guard-component.cjs +2 -2
  86. package/dist/lib/cjs/components/settings-facet-component.cjs +1 -1
  87. package/dist/lib/cjs/components/settings-migration-component.cjs +5 -5
  88. package/dist/lib/cjs/components/shared-component-pool-component.cjs +6 -6
  89. package/dist/lib/cjs/components/style-sheet-component.cjs +3 -3
  90. package/dist/lib/cjs/components/syntax-highlighting-component.cjs +3 -3
  91. package/dist/lib/cjs/components/templates-language-component.cjs +1 -1
  92. package/dist/lib/cjs/components/worker-component.cjs +363 -0
  93. package/dist/lib/cjs/components/worker-component.d.cts +156 -0
  94. package/dist/lib/cjs/components/worker-pool-component.cjs +185 -0
  95. package/dist/lib/cjs/components/worker-pool-component.d.cts +102 -0
  96. package/dist/lib/cjs/components/workspace-layout-state-component.cjs +7 -7
  97. package/dist/lib/cjs/constructors/get-dom-events-handlers-constructor.cjs +5 -5
  98. package/dist/lib/cjs/constructors/index.cjs +1 -1
  99. package/dist/lib/cjs/data-handler.cjs +111 -4
  100. package/dist/lib/cjs/data-handler.d.cts +92 -1
  101. package/dist/lib/cjs/data-stores/data-store-locations.cjs +82 -24
  102. package/dist/lib/cjs/data-stores/data-store-locations.d.cts +15 -0
  103. package/dist/lib/cjs/data-stores/data-store-replica.cjs +33 -5
  104. package/dist/lib/cjs/data-stores/data-store-seeds.cjs +6 -6
  105. package/dist/lib/cjs/data-stores/data-store-seeds.d.cts +2 -2
  106. package/dist/lib/cjs/data-stores/data-store-transport.cjs +81 -8
  107. package/dist/lib/cjs/data-stores/data-store-transport.d.cts +30 -1
  108. package/dist/lib/cjs/data-stores/index.cjs +6 -6
  109. package/dist/lib/cjs/data-stores/local-data-store.cjs +74 -10
  110. package/dist/lib/cjs/data-stores/local-data-store.d.cts +58 -1
  111. package/dist/lib/cjs/data-stores/shared-data-store.cjs +76 -19
  112. package/dist/lib/cjs/data-stores/shared-data-store.d.cts +18 -1
  113. package/dist/lib/cjs/dataview-link.cjs +2 -2
  114. package/dist/lib/cjs/dataview.cjs +27 -7
  115. package/dist/lib/cjs/dataview.d.cts +14 -0
  116. package/dist/lib/cjs/debug.cjs +3 -3
  117. package/dist/lib/cjs/demo-vault-helper.cjs +34 -6
  118. package/dist/lib/cjs/demo-vault-helper.d.cts +6 -2
  119. package/dist/lib/cjs/desktop-bulk-operation-git.cjs +10 -10
  120. package/dist/lib/cjs/desktop-demo-vault-opener.cjs +13 -13
  121. package/dist/lib/cjs/desktop-git-runner.cjs +2 -2
  122. package/dist/lib/cjs/desktop-operating-system.cjs +1 -1
  123. package/dist/lib/cjs/desktop-request-url-stream.cjs +8 -14
  124. package/dist/lib/cjs/desktop-trusted-input.cjs +2 -2
  125. package/dist/lib/cjs/disposable.cjs +150 -0
  126. package/dist/lib/cjs/disposable.d.cts +39 -0
  127. package/dist/lib/cjs/editor-extension-registrar.cjs +1 -1
  128. package/dist/lib/cjs/editor-suggest-registrar.cjs +2 -2
  129. package/dist/lib/cjs/editor-suggest.cjs +1 -1
  130. package/dist/lib/cjs/editor.cjs +6 -6
  131. package/dist/lib/cjs/events.cjs +2 -2
  132. package/dist/lib/cjs/extensions-registrar.cjs +1 -1
  133. package/dist/lib/cjs/feature-request.cjs +1 -1
  134. package/dist/lib/cjs/file-change.cjs +10 -10
  135. package/dist/lib/cjs/file-explorer.cjs +2 -2
  136. package/dist/lib/cjs/file-manager.cjs +5 -5
  137. package/dist/lib/cjs/file-system.cjs +10 -10
  138. package/dist/lib/cjs/folder-note.cjs +4 -4
  139. package/dist/lib/cjs/frontmatter-formatting.cjs +7 -6
  140. package/dist/lib/cjs/frontmatter-link-cache-with-offsets.cjs +1 -1
  141. package/dist/lib/cjs/frontmatter.cjs +5 -5
  142. package/dist/lib/cjs/generated-during-build.cjs +1 -1
  143. package/dist/lib/cjs/hotkey.cjs +1 -1
  144. package/dist/lib/cjs/hover-link-source-registrar.cjs +1 -1
  145. package/dist/lib/cjs/html-element.cjs +2 -2
  146. package/dist/lib/cjs/i18n/custom-type-options.cjs +1 -1
  147. package/dist/lib/cjs/i18n/default-translations.cjs +1 -1
  148. package/dist/lib/cjs/i18n/i18n.cjs +7 -7
  149. package/dist/lib/cjs/i18n/index.cjs +4 -4
  150. package/dist/lib/cjs/i18n/locales/en.cjs +5 -1
  151. package/dist/lib/cjs/i18n/locales/en.d.cts +4 -0
  152. package/dist/lib/cjs/i18n/locales/index.cjs +2 -2
  153. package/dist/lib/cjs/i18n/locales/translations-map.cjs +1 -1
  154. package/dist/lib/cjs/i18n/locales/translations-map.d.cts +4 -0
  155. package/dist/lib/cjs/index.cjs +145 -127
  156. package/dist/lib/cjs/index.d.cts +6 -0
  157. package/dist/lib/cjs/inline-token-renderer.cjs +2 -2
  158. package/dist/lib/cjs/is-in-obsidian.cjs +1 -1
  159. package/dist/lib/cjs/library-styles.cjs +3 -3
  160. package/dist/lib/cjs/link-and-tag-input-suggest.cjs +2 -2
  161. package/dist/lib/cjs/link.cjs +76 -56
  162. package/dist/lib/cjs/link.d.cts +20 -14
  163. package/dist/lib/cjs/logger.cjs +4 -4
  164. package/dist/lib/cjs/loop.cjs +10 -16
  165. package/dist/lib/cjs/markdown-code-block-processor-registrar.cjs +17 -2
  166. package/dist/lib/cjs/markdown-code-block-processor-registrar.d.cts +7 -0
  167. package/dist/lib/cjs/markdown-code-block-processor.cjs +13 -13
  168. package/dist/lib/cjs/markdown-post-processor-registrar.cjs +2 -2
  169. package/dist/lib/cjs/markdown-view.cjs +3 -3
  170. package/dist/lib/cjs/markdown.cjs +12 -12
  171. package/dist/lib/cjs/metadata-cache.cjs +23 -23
  172. package/dist/lib/cjs/metadata-cache.d.cts +5 -4
  173. package/dist/lib/cjs/misplaced-attachment.cjs +297 -0
  174. package/dist/lib/cjs/misplaced-attachment.d.cts +228 -0
  175. package/dist/lib/cjs/mobile-app-info.cjs +1 -1
  176. package/dist/lib/cjs/modals/alert.cjs +4 -4
  177. package/dist/lib/cjs/modals/code-block-builder.cjs +7 -7
  178. package/dist/lib/cjs/modals/confirm.cjs +4 -4
  179. package/dist/lib/cjs/modals/copy-text-manually.cjs +4 -4
  180. package/dist/lib/cjs/modals/index.cjs +12 -12
  181. package/dist/lib/cjs/modals/minimizable-modal.cjs +6 -6
  182. package/dist/lib/cjs/modals/modal-command-builder.cjs +3 -3
  183. package/dist/lib/cjs/modals/modal.cjs +3 -3
  184. package/dist/lib/cjs/modals/prompt.cjs +10 -10
  185. package/dist/lib/cjs/modals/prompt.d.cts +1 -1
  186. package/dist/lib/cjs/modals/review-bug-report-diagnostics.cjs +5 -5
  187. package/dist/lib/cjs/modals/select-item.cjs +6 -6
  188. package/dist/lib/cjs/modals/select-option.cjs +3 -3
  189. package/dist/lib/cjs/modals/suggest-modal-command-builder.cjs +1 -1
  190. package/dist/lib/cjs/note-priority.cjs +2 -2
  191. package/dist/lib/cjs/notebook-navigator.cjs +12 -2
  192. package/dist/lib/cjs/notebook-navigator.d.cts +6 -0
  193. package/dist/lib/cjs/obsidian-lib-state.cjs +1 -1
  194. package/dist/lib/cjs/obsidian-protocol-handler-registrar.cjs +1 -1
  195. package/dist/lib/cjs/obsidian-settings.cjs +1 -1
  196. package/dist/lib/cjs/obsidian-word-characters.cjs +1 -1
  197. package/dist/lib/cjs/parse-link.cjs +14 -14
  198. package/dist/lib/cjs/path-compatibility.cjs +368 -0
  199. package/dist/lib/cjs/path-compatibility.d.cts +263 -0
  200. package/dist/lib/cjs/path-settings.cjs +3 -3
  201. package/dist/lib/cjs/pdf.cjs +2 -2
  202. package/dist/lib/cjs/plugin/index.cjs +16 -13
  203. package/dist/lib/cjs/plugin/index.d.cts +1 -0
  204. package/dist/lib/cjs/plugin/plugin-api.cjs +8 -8
  205. package/dist/lib/cjs/plugin/plugin-async-cleanup.cjs +6 -3
  206. package/dist/lib/cjs/plugin/plugin-async-cleanup.d.cts +5 -0
  207. package/dist/lib/cjs/plugin/plugin-context.cjs +10 -9
  208. package/dist/lib/cjs/plugin/plugin-event-source.cjs +1 -1
  209. package/dist/lib/cjs/plugin/plugin-event-source.d.cts +4 -4
  210. package/dist/lib/cjs/plugin/plugin-install-state.cjs +4 -4
  211. package/dist/lib/cjs/plugin/plugin-instance.cjs +14 -12
  212. package/dist/lib/cjs/plugin/plugin-instance.d.cts +7 -0
  213. package/dist/lib/cjs/plugin/plugin-lifecycle-events.cjs +1 -1
  214. package/dist/lib/cjs/plugin/plugin-lifecycle-events.d.cts +6 -4
  215. package/dist/lib/cjs/plugin/plugin-settings-tab.cjs +15 -15
  216. package/dist/lib/cjs/plugin/plugin.cjs +118 -34
  217. package/dist/lib/cjs/plugin/plugin.d.cts +28 -5
  218. package/dist/lib/cjs/plugin/settings-migration-api.cjs +1 -1
  219. package/dist/lib/cjs/plugin/third-party-plugin.cjs +231 -0
  220. package/dist/lib/cjs/plugin/third-party-plugin.d.cts +244 -0
  221. package/dist/lib/cjs/plugin-cli-handler-registrar.cjs +2 -2
  222. package/dist/lib/cjs/popovers/field-popover.cjs +4 -4
  223. package/dist/lib/cjs/popovers/index.cjs +3 -3
  224. package/dist/lib/cjs/popovers/popover-anchor.cjs +1 -1
  225. package/dist/lib/cjs/popovers/popover.cjs +5 -5
  226. package/dist/lib/cjs/queue.cjs +8 -8
  227. package/dist/lib/cjs/react/app-context.cjs +3 -3
  228. package/dist/lib/cjs/react/index.cjs +1 -1
  229. package/dist/lib/cjs/reference-definition.cjs +1 -1
  230. package/dist/lib/cjs/reference.cjs +3 -3
  231. package/dist/lib/cjs/release-asset.cjs +5 -5
  232. package/dist/lib/cjs/rendered-markdown.cjs +4 -4
  233. package/dist/lib/cjs/request-url.cjs +4 -4
  234. package/dist/lib/cjs/resource-lock.cjs +46 -42
  235. package/dist/lib/cjs/resource-lock.d.cts +8 -7
  236. package/dist/lib/cjs/resource-url.cjs +3 -3
  237. package/dist/lib/cjs/ribbon-icon-registrar.cjs +1 -1
  238. package/dist/lib/cjs/setting-components/checkbox-component.cjs +3 -3
  239. package/dist/lib/cjs/setting-components/code-highlighter-component.cjs +7 -7
  240. package/dist/lib/cjs/setting-components/date-component.cjs +4 -4
  241. package/dist/lib/cjs/setting-components/date-time-component.cjs +4 -4
  242. package/dist/lib/cjs/setting-components/email-component.cjs +2 -2
  243. package/dist/lib/cjs/setting-components/file-component.cjs +2 -2
  244. package/dist/lib/cjs/setting-components/folder-list-component.cjs +3 -3
  245. package/dist/lib/cjs/setting-components/hotkey-component.cjs +5 -5
  246. package/dist/lib/cjs/setting-components/index.cjs +30 -30
  247. package/dist/lib/cjs/setting-components/list-component.cjs +5 -5
  248. package/dist/lib/cjs/setting-components/month-component.cjs +4 -4
  249. package/dist/lib/cjs/setting-components/multiple-dropdown-component.cjs +3 -3
  250. package/dist/lib/cjs/setting-components/multiple-email-component.cjs +2 -2
  251. package/dist/lib/cjs/setting-components/multiple-file-component.cjs +3 -3
  252. package/dist/lib/cjs/setting-components/multiple-text-component.cjs +9 -6
  253. package/dist/lib/cjs/setting-components/multiple-text-component.d.cts +4 -1
  254. package/dist/lib/cjs/setting-components/number-component.cjs +2 -2
  255. package/dist/lib/cjs/setting-components/password-component.cjs +2 -2
  256. package/dist/lib/cjs/setting-components/setting-component-wrapper.cjs +3 -3
  257. package/dist/lib/cjs/setting-components/tag-list-component.cjs +4 -4
  258. package/dist/lib/cjs/setting-components/telephone-component.cjs +2 -2
  259. package/dist/lib/cjs/setting-components/text-based-component.cjs +1 -1
  260. package/dist/lib/cjs/setting-components/time-component.cjs +3 -3
  261. package/dist/lib/cjs/setting-components/tri-state-checkbox-component.cjs +3 -3
  262. package/dist/lib/cjs/setting-components/typed-dropdown-component.cjs +3 -3
  263. package/dist/lib/cjs/setting-components/typed-multiple-dropdown-component.cjs +4 -4
  264. package/dist/lib/cjs/setting-components/typed-range-text-component.cjs +1 -1
  265. package/dist/lib/cjs/setting-components/typed-text-component.cjs +3 -3
  266. package/dist/lib/cjs/setting-components/url-component.cjs +2 -2
  267. package/dist/lib/cjs/setting-components/validator-component.cjs +4 -4
  268. package/dist/lib/cjs/setting-components/week-component.cjs +4 -4
  269. package/dist/lib/cjs/setting-ex.cjs +26 -26
  270. package/dist/lib/cjs/setting-group-ex.cjs +2 -2
  271. package/dist/lib/cjs/settings-recovery.cjs +217 -0
  272. package/dist/lib/cjs/settings-recovery.d.cts +178 -0
  273. package/dist/lib/cjs/settings-tabs.cjs +5 -5
  274. package/dist/lib/cjs/status-bar-item-registrar.cjs +1 -1
  275. package/dist/lib/cjs/templater.cjs +14 -4
  276. package/dist/lib/cjs/templater.d.cts +6 -0
  277. package/dist/lib/cjs/transformers/duration-transformer.cjs +2 -2
  278. package/dist/lib/cjs/transformers/index.cjs +1 -1
  279. package/dist/lib/cjs/trusted-input.cjs +1 -1
  280. package/dist/lib/cjs/validation.cjs +4 -4
  281. package/dist/lib/cjs/vault-delete.cjs +6 -6
  282. package/dist/lib/cjs/vault-transaction.cjs +5 -5
  283. package/dist/lib/cjs/vault.cjs +12 -12
  284. package/dist/lib/cjs/view-registrar.cjs +1 -1
  285. package/dist/lib/cjs/virtual-file.cjs +16 -14
  286. package/dist/lib/cjs/virtual-file.d.cts +2 -1
  287. package/dist/lib/cjs/wasm.cjs +119 -0
  288. package/dist/lib/cjs/wasm.d.cts +54 -0
  289. package/dist/lib/cjs/worker-protocol.cjs +209 -0
  290. package/dist/lib/cjs/worker-protocol.d.cts +282 -0
  291. package/dist/lib/cjs/workspace.cjs +1 -1
  292. package/dist/lib/esm/__merged.d.mts +17 -8
  293. package/dist/lib/esm/__merged.mjs +133 -3
  294. package/dist/lib/esm/app.mjs +2 -2
  295. package/dist/lib/esm/attachment-path.d.mts +3 -3
  296. package/dist/lib/esm/attachment-path.mjs +2 -2
  297. package/dist/lib/esm/backlink-index.mjs +2 -2
  298. package/dist/lib/esm/canvas.d.mts +13 -0
  299. package/dist/lib/esm/canvas.mjs +6 -5
  300. package/dist/lib/esm/command-handlers/abstract-file-command-handler.d.mts +13 -13
  301. package/dist/lib/esm/command-handlers/abstract-file-command-handler.mjs +14 -14
  302. package/dist/lib/esm/command-handlers/editor-command-handler.d.mts +7 -7
  303. package/dist/lib/esm/command-handlers/editor-command-handler.mjs +8 -8
  304. package/dist/lib/esm/components/component-ex.d.mts +11 -0
  305. package/dist/lib/esm/components/component-ex.mjs +19 -6
  306. package/dist/lib/esm/components/disposable-component.mjs +1 -1
  307. package/dist/lib/esm/components/index.d.mts +2 -0
  308. package/dist/lib/esm/components/index.mjs +5 -1
  309. package/dist/lib/esm/components/plugin-gate-component.d.mts +36 -13
  310. package/dist/lib/esm/components/plugin-gate-component.mjs +57 -14
  311. package/dist/lib/esm/components/plugin-notice-component.d.mts +4 -3
  312. package/dist/lib/esm/components/plugin-notice-component.mjs +30 -21
  313. package/dist/lib/esm/components/plugin-settings-component.d.mts +35 -5
  314. package/dist/lib/esm/components/plugin-settings-component.mjs +99 -3
  315. package/dist/lib/esm/components/rename-delete-handler-component.mjs +2 -2
  316. package/dist/lib/esm/components/worker-component.d.mts +156 -0
  317. package/dist/lib/esm/components/worker-component.mjs +279 -0
  318. package/dist/lib/esm/components/worker-pool-component.d.mts +102 -0
  319. package/dist/lib/esm/components/worker-pool-component.mjs +95 -0
  320. package/dist/lib/esm/components/workspace-layout-state-component.mjs +1 -1
  321. package/dist/lib/esm/data-handler.d.mts +92 -1
  322. package/dist/lib/esm/data-handler.mjs +112 -3
  323. package/dist/lib/esm/data-stores/data-store-locations.d.mts +15 -0
  324. package/dist/lib/esm/data-stores/data-store-locations.mjs +80 -22
  325. package/dist/lib/esm/data-stores/data-store-replica.mjs +33 -5
  326. package/dist/lib/esm/data-stores/data-store-seeds.d.mts +2 -2
  327. package/dist/lib/esm/data-stores/data-store-seeds.mjs +4 -4
  328. package/dist/lib/esm/data-stores/data-store-transport.d.mts +30 -1
  329. package/dist/lib/esm/data-stores/data-store-transport.mjs +78 -5
  330. package/dist/lib/esm/data-stores/local-data-store.d.mts +58 -1
  331. package/dist/lib/esm/data-stores/local-data-store.mjs +71 -9
  332. package/dist/lib/esm/data-stores/shared-data-store.d.mts +18 -1
  333. package/dist/lib/esm/data-stores/shared-data-store.mjs +72 -15
  334. package/dist/lib/esm/dataview.d.mts +14 -0
  335. package/dist/lib/esm/dataview.mjs +19 -1
  336. package/dist/lib/esm/demo-vault-helper.d.mts +6 -2
  337. package/dist/lib/esm/demo-vault-helper.mjs +29 -1
  338. package/dist/lib/esm/desktop-demo-vault-opener.mjs +1 -1
  339. package/dist/lib/esm/desktop-request-url-stream.mjs +4 -10
  340. package/dist/lib/esm/disposable.d.mts +39 -0
  341. package/dist/lib/esm/disposable.mjs +64 -0
  342. package/dist/lib/esm/file-system.mjs +2 -2
  343. package/dist/lib/esm/frontmatter-formatting.mjs +2 -1
  344. package/dist/lib/esm/generated-during-build.mjs +1 -1
  345. package/dist/lib/esm/i18n/locales/en.d.mts +4 -0
  346. package/dist/lib/esm/i18n/locales/en.mjs +5 -1
  347. package/dist/lib/esm/i18n/locales/translations-map.d.mts +4 -0
  348. package/dist/lib/esm/index.d.mts +6 -0
  349. package/dist/lib/esm/index.mjs +13 -1
  350. package/dist/lib/esm/link.d.mts +20 -14
  351. package/dist/lib/esm/link.mjs +57 -38
  352. package/dist/lib/esm/loop.mjs +2 -8
  353. package/dist/lib/esm/markdown-code-block-processor-registrar.d.mts +7 -0
  354. package/dist/lib/esm/markdown-code-block-processor-registrar.mjs +16 -1
  355. package/dist/lib/esm/metadata-cache.d.mts +5 -4
  356. package/dist/lib/esm/metadata-cache.mjs +6 -6
  357. package/dist/lib/esm/misplaced-attachment.d.mts +228 -0
  358. package/dist/lib/esm/misplaced-attachment.mjs +212 -0
  359. package/dist/lib/esm/modals/prompt.d.mts +1 -1
  360. package/dist/lib/esm/modals/prompt.mjs +1 -1
  361. package/dist/lib/esm/notebook-navigator.d.mts +6 -0
  362. package/dist/lib/esm/notebook-navigator.mjs +11 -2
  363. package/dist/lib/esm/parse-link.mjs +4 -4
  364. package/dist/lib/esm/path-compatibility.d.mts +263 -0
  365. package/dist/lib/esm/path-compatibility.mjs +277 -0
  366. package/dist/lib/esm/plugin/index.d.mts +1 -0
  367. package/dist/lib/esm/plugin/index.mjs +4 -2
  368. package/dist/lib/esm/plugin/plugin-async-cleanup.d.mts +5 -0
  369. package/dist/lib/esm/plugin/plugin-async-cleanup.mjs +3 -1
  370. package/dist/lib/esm/plugin/plugin-context.mjs +2 -1
  371. package/dist/lib/esm/plugin/plugin-event-source.d.mts +4 -4
  372. package/dist/lib/esm/plugin/plugin-event-source.mjs +1 -1
  373. package/dist/lib/esm/plugin/plugin-instance.d.mts +7 -0
  374. package/dist/lib/esm/plugin/plugin-instance.mjs +2 -1
  375. package/dist/lib/esm/plugin/plugin-lifecycle-events.d.mts +6 -4
  376. package/dist/lib/esm/plugin/plugin-lifecycle-events.mjs +1 -1
  377. package/dist/lib/esm/plugin/plugin.d.mts +28 -5
  378. package/dist/lib/esm/plugin/plugin.mjs +103 -9
  379. package/dist/lib/esm/plugin/third-party-plugin.d.mts +244 -0
  380. package/dist/lib/esm/plugin/third-party-plugin.mjs +147 -0
  381. package/dist/lib/esm/release-asset.mjs +1 -1
  382. package/dist/lib/esm/resource-lock.d.mts +8 -7
  383. package/dist/lib/esm/resource-lock.mjs +31 -26
  384. package/dist/lib/esm/setting-components/multiple-text-component.d.mts +4 -1
  385. package/dist/lib/esm/setting-components/multiple-text-component.mjs +6 -3
  386. package/dist/lib/esm/settings-recovery.d.mts +178 -0
  387. package/dist/lib/esm/settings-recovery.mjs +125 -0
  388. package/dist/lib/esm/settings-tabs.mjs +2 -2
  389. package/dist/lib/esm/templater.d.mts +6 -0
  390. package/dist/lib/esm/templater.mjs +11 -2
  391. package/dist/lib/esm/vault.mjs +1 -1
  392. package/dist/lib/esm/virtual-file.d.mts +2 -1
  393. package/dist/lib/esm/virtual-file.mjs +7 -5
  394. package/dist/lib/esm/wasm.d.mts +54 -0
  395. package/dist/lib/esm/wasm.mjs +30 -0
  396. package/dist/lib/esm/worker-protocol.d.mts +282 -0
  397. package/dist/lib/esm/worker-protocol.mjs +113 -0
  398. package/package.json +9 -8
  399. package/plugin/third-party-plugin/package.json +6 -0
@@ -0,0 +1,231 @@
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
+ (function () {
6
+ function ensureBrowserProcess() {
7
+ const browserProcess = {
8
+ browser: true,
9
+ cwd() {
10
+ return "/";
11
+ },
12
+ env: {},
13
+ platform: "android"
14
+ };
15
+ const existingProcess = globalThis.process;
16
+ if (!existingProcess) {
17
+ globalThis.process = browserProcess;
18
+ return;
19
+ }
20
+ if (existingProcess.versions?.node) {
21
+ return;
22
+ }
23
+ const existingProcessRecord = existingProcess;
24
+ for (const [key, value] of Object.entries(browserProcess)) {
25
+ existingProcessRecord[key] ??= value;
26
+ }
27
+ existingProcessRecord["browser"] = true;
28
+ }
29
+
30
+ ensureBrowserProcess();
31
+ })();
32
+ (function patchObsidianRequire() {
33
+ const originalRequire = require;
34
+ if (!originalRequire || originalRequire.__isPatched) {
35
+ return;
36
+ }
37
+ require = Object.assign(
38
+ (id) => requirePatched(id),
39
+ originalRequire,
40
+ {
41
+ __isPatched: true
42
+ }
43
+ );
44
+ function extractDefault($module) {
45
+ return $module && $module.__esModule && "default" in $module ? $module.default : $module;
46
+ }
47
+ const OBSIDIAN_BUILT_IN_MODULE_NAMES = /* @__PURE__ */ new Set([
48
+ "@codemirror/autocomplete",
49
+ "@codemirror/collab",
50
+ "@codemirror/commands",
51
+ "@codemirror/language",
52
+ "@codemirror/lint",
53
+ "@codemirror/search",
54
+ "@codemirror/state",
55
+ "@codemirror/text",
56
+ "@codemirror/view",
57
+ "@lezer/common",
58
+ "@lezer/highlight",
59
+ "@lezer/lr",
60
+ "obsidian"
61
+ ]);
62
+ const DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES = /* @__PURE__ */ new Set([
63
+ "@codemirror/closebrackets",
64
+ "@codemirror/comment",
65
+ "@codemirror/fold",
66
+ "@codemirror/gutter",
67
+ "@codemirror/highlight",
68
+ "@codemirror/history",
69
+ "@codemirror/matchbrackets",
70
+ "@codemirror/panel",
71
+ "@codemirror/rangeset",
72
+ "@codemirror/rectangular-selection",
73
+ "@codemirror/stream-parser",
74
+ "@codemirror/tooltip"
75
+ ]);
76
+ function requirePatched(id) {
77
+ if (OBSIDIAN_BUILT_IN_MODULE_NAMES.has(id) || DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES.has(id)) {
78
+ return originalRequire?.(id);
79
+ }
80
+ const app = globalThis.app;
81
+ if (app?.isMobile) {
82
+ if (id === "process" || id === "node:process") {
83
+ console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Fake process object is returned instead.`);
84
+ return process;
85
+ }
86
+ } else {
87
+ const $module = originalRequire?.(id);
88
+ if ($module) {
89
+ return extractDefault($module);
90
+ }
91
+ }
92
+ console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Empty object is returned instead.`);
93
+ return {};
94
+ }
95
+ })();
96
+
97
+ "use strict";
98
+ var __defProp = Object.defineProperty;
99
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
100
+ var __getOwnPropNames = Object.getOwnPropertyNames;
101
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
102
+ var __export = (target, all) => {
103
+ for (var name in all)
104
+ __defProp(target, name, { get: all[name], enumerable: true });
105
+ };
106
+ var __copyProps = (to, from, except, desc) => {
107
+ if (from && typeof from === "object" || typeof from === "function") {
108
+ for (let key of __getOwnPropNames(from))
109
+ if (!__hasOwnProp.call(to, key) && key !== except)
110
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
111
+ }
112
+ return to;
113
+ };
114
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
115
+ var third_party_plugin_exports = {};
116
+ __export(third_party_plugin_exports, {
117
+ createThirdPartyPluginDependency: () => createThirdPartyPluginDependency,
118
+ getThirdPartyPluginApi: () => getThirdPartyPluginApi,
119
+ getThirdPartyPluginAvailability: () => getThirdPartyPluginAvailability,
120
+ isThirdPartyPluginDependency: () => isThirdPartyPluginDependency,
121
+ requireThirdPartyPluginApi: () => requireThirdPartyPluginApi,
122
+ waitForThirdPartyPluginApi: () => waitForThirdPartyPluginApi,
123
+ watchThirdPartyPluginApi: () => watchThirdPartyPluginApi
124
+ });
125
+ module.exports = __toCommonJS(third_party_plugin_exports);
126
+ var import_async_events = require("@mnaoumov/typescript-lib/async-events");
127
+ var import_plugin_instance = require("./plugin-instance.cjs");
128
+ var import_plugin_lifecycle_events = require("./plugin-lifecycle-events.cjs");
129
+ class ThirdPartyPluginApiWatchBase {
130
+ // A `protected` constructor is not assignable to `AbstractConstructor<object>`, which is what
131
+ // `mixinAsyncEvents` accepts, so this stays public even though only the subclass below calls it.
132
+ constructor(params) {
133
+ this.params = params;
134
+ }
135
+ params;
136
+ }
137
+ class ThirdPartyPluginApiRefImpl extends (0, import_async_events.mixinAsyncEvents)()(ThirdPartyPluginApiWatchBase) {
138
+ get availability() {
139
+ return getThirdPartyPluginAvailability(this.params);
140
+ }
141
+ get value() {
142
+ return this.currentValue;
143
+ }
144
+ currentValue = null;
145
+ /**
146
+ * Re-reads the API, firing `change` only when it actually changed.
147
+ */
148
+ refresh() {
149
+ const value = getThirdPartyPluginApi(this.params);
150
+ if (value === this.currentValue) {
151
+ return;
152
+ }
153
+ this.currentValue = value;
154
+ this.trigger("change");
155
+ }
156
+ }
157
+ function createThirdPartyPluginDependency(params) {
158
+ const minPluginVersion = params.minPluginVersion ?? params.adapter.minPluginVersion;
159
+ return {
160
+ adapter: params.adapter,
161
+ pluginId: params.adapter.pluginId,
162
+ pluginName: params.adapter.pluginName,
163
+ reason: params.reason,
164
+ ...minPluginVersion !== void 0 && { minPluginVersion }
165
+ };
166
+ }
167
+ function getThirdPartyPluginApi(params) {
168
+ const plugin = (0, import_plugin_instance.getLoadedPlugin)(toPluginAvailabilityParams(params));
169
+ return plugin === null ? null : params.adapter.getApi(plugin);
170
+ }
171
+ function getThirdPartyPluginAvailability(params) {
172
+ return (0, import_plugin_instance.getPluginAvailability)(toPluginAvailabilityParams(params));
173
+ }
174
+ function isThirdPartyPluginDependency(dependency) {
175
+ return "adapter" in dependency;
176
+ }
177
+ async function requireThirdPartyPluginApi(params) {
178
+ const plugin = await (0, import_plugin_instance.requirePlugin)({
179
+ ...params,
180
+ ...toPluginAvailabilityParams(params),
181
+ pluginName: params.adapter.pluginName
182
+ });
183
+ return getVerifiedApi(params.adapter, plugin);
184
+ }
185
+ async function waitForThirdPartyPluginApi(params) {
186
+ const plugin = await (0, import_plugin_instance.waitForPlugin)({
187
+ ...params,
188
+ ...toPluginAvailabilityParams(params)
189
+ });
190
+ return getVerifiedApi(params.adapter, plugin);
191
+ }
192
+ function watchThirdPartyPluginApi(params) {
193
+ const { app, component } = params;
194
+ const ref = new ThirdPartyPluginApiRefImpl(params);
195
+ function refresh() {
196
+ ref.refresh();
197
+ }
198
+ component.registerEvent(app.plugins.on(import_plugin_instance.PLUGINS_CHANGED_EVENT_NAME, refresh));
199
+ component.registerEvent(app.workspace.on(import_plugin_lifecycle_events.PLUGIN_LOADED_EVENT_NAME, refresh));
200
+ component.registerEvent(app.workspace.on(import_plugin_lifecycle_events.PLUGIN_UNLOADED_EVENT_NAME, refresh));
201
+ ref.refresh();
202
+ return ref;
203
+ }
204
+ function getVerifiedApi(adapter, plugin) {
205
+ const api = adapter.getApi(plugin);
206
+ if (api === null) {
207
+ throw new Error(`The plugin "${adapter.pluginId}" does not expose the API its adapter expects.`);
208
+ }
209
+ return api;
210
+ }
211
+ function toPluginAvailabilityParams(params) {
212
+ const { adapter, app } = params;
213
+ const minPluginVersion = params.minPluginVersion ?? adapter.minPluginVersion;
214
+ return {
215
+ app,
216
+ isPlugin: (plugin) => adapter.getApi(plugin) !== null,
217
+ pluginId: adapter.pluginId,
218
+ ...minPluginVersion !== void 0 && { minPluginVersion }
219
+ };
220
+ }
221
+ // Annotate the CommonJS export names for ESM import in node:
222
+ 0 && (module.exports = {
223
+ createThirdPartyPluginDependency,
224
+ getThirdPartyPluginApi,
225
+ getThirdPartyPluginAvailability,
226
+ isThirdPartyPluginDependency,
227
+ requireThirdPartyPluginApi,
228
+ waitForThirdPartyPluginApi,
229
+ watchThirdPartyPluginApi
230
+ });
231
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9wbHVnaW4vdGhpcmQtcGFydHktcGx1Z2luLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGZpbGVcbiAqXG4gKiBUeXBlZCBhY2Nlc3MgdG8gdGhlIEFQSSBvZiBhIFRISVJELVBBUlRZIHBsdWdpbjogb25lIHRoYXQgcHVibGlzaGVzIG5vdGhpbmcgdGhyb3VnaCB0aGlzIGxpYnJhcnkncyByZWdpc3RyeS5cbiAqXG4gKiBBIHBsdWdpbiBidWlsdCBvbiB0aGlzIGxpYnJhcnkgcHVibGlzaGVzIGEgdmVyc2lvbmVkIGNvbnRyYWN0IChgZ2V0UGx1Z2luQXBpcygpYCksIGFuZCBhIGNvbnN1bWVyIHJlYWNoZXMgaXRcbiAqIHRocm91Z2ggYHdhdGNoUGx1Z2luQXBpYCAoYC4vcGx1Z2luLWFwaS50c2ApLiBNb3N0IHBsdWdpbnMgYSBjb25zdW1lciB3YW50cyB0byB0YWxrIHRvIOKAlCBgRGF0YXZpZXdgLFxuICogYFRlbXBsYXRlcmAsIGBOb3RlYm9vayBOYXZpZ2F0b3JgIOKAlCBhcmUgbm90IGJ1aWx0IG9uIGl0LCBzbyB0aGVpciBBUEkgaGFuZ3Mgb2ZmIHRoZSBwbHVnaW4gaW5zdGFuY2UgdW5kZXIgYVxuICogbmFtZSBvZiB0aGVpciBvd24gY2hvb3NpbmcsIGFuZCBldmVyeSBjb25zdW1lciB1c2VkIHRvIHJlYWNoIGl0IGJ5IGhhbmQgdGhyb3VnaCBgYXBwLnBsdWdpbnNgIHdpdGggYSBjYXN0LlxuICpcbiAqIEEge0BsaW5rIFRoaX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xQixVQUFhLEVBQUUsaUJBQWlCO0FBQUEsRUFDM0Q7QUFDRjsiLCJuYW1lcyI6W119
@@ -0,0 +1,244 @@
1
+ /// <reference path="../library-references.d.cts" />
2
+ /// <reference lib="dom" />
3
+ /**
4
+ * @file
5
+ *
6
+ * Typed access to the API of a THIRD-PARTY plugin: one that publishes nothing through this library's registry.
7
+ *
8
+ * A plugin built on this library publishes a versioned contract (`getPluginApis()`), and a consumer reaches it
9
+ * through `watchPluginApi` (`./plugin-api.ts`). Most plugins a consumer wants to talk to — `Dataview`,
10
+ * `Templater`, `Notebook Navigator` — are not built on it, so their API hangs off the plugin instance under a
11
+ * name of their own choosing, and every consumer used to reach it by hand through `app.plugins` with a cast.
12
+ *
13
+ * A {@link ThirdPartyPluginAdapter} says ONCE, for one plugin, how to get from its instance to its typed API,
14
+ * and VERIFIES the shape on the way, so a release that renamed what the adapter reads is "not there" rather
15
+ * than a `Cannot read properties of undefined` from inside a callback. Everything else here is generic:
16
+ *
17
+ * - {@link getThirdPartyPluginApi} answers "now", for a one-shot use.
18
+ * - {@link watchThirdPartyPluginApi} answers "now" for as long as a component lives: its ref re-reads on every
19
+ * `app.plugins` `changed` and every `obsidian-lib:plugin-loaded` / `-unloaded` broadcast, so an OPTIONAL
20
+ * dependency is a ref whose `value` is `null` while the plugin is absent, and becomes the API the moment it
21
+ * is enabled.
22
+ * - {@link waitForThirdPartyPluginApi} and {@link requireThirdPartyPluginApi} are the one-shot waits, built on
23
+ * `waitForPlugin` / `requirePlugin` (`./plugin-instance.ts`), so they share that module's availability
24
+ * classification, its notice and its repair buttons.
25
+ * - A REQUIRED dependency is declared through `PluginBase.getPluginDependencies()` as a
26
+ * {@link ThirdPartyPluginDependency} (built by {@link createThirdPartyPluginDependency}), and the plugin gate
27
+ * keeps `onloadImpl` from running while it is missing, too old or the wrong shape — the same treatment an
28
+ * own-plugin dependency gets.
29
+ *
30
+ * Availability is {@link PluginAvailability}, read from Obsidian `1.15.1` as `plugin-instance.ts` documents:
31
+ * an instance whose `onload` is still running reads as `loading`, never as available. An adapter's
32
+ * `getApi` returning `null` reads as {@link PluginAvailability.ShapeMismatch}.
33
+ */
34
+ import type { AsyncEventSource } from '@mnaoumov/typescript-lib/async-events' with { 'resolution-mode': 'import' };
35
+ import type { App, Component, Plugin } from 'obsidian' with { 'resolution-mode': 'import' };
36
+ import type { Except } from 'type-fest' with { 'resolution-mode': 'import' };
37
+ import type { PluginDependencyBase } from '../components/plugin-gate-component.cjs';
38
+ import type { RequirePluginParams, WaitForPluginParams } from './plugin-instance.cjs';
39
+ import { PluginAvailability } from './plugin-instance.cjs';
40
+ /**
41
+ * Parameters for {@link createThirdPartyPluginDependency}.
42
+ *
43
+ * @typeParam TApi - The adapter's API type.
44
+ */
45
+ export interface CreateThirdPartyPluginDependencyParams<TApi extends object> {
46
+ /**
47
+ * The adapter of the required plugin.
48
+ */
49
+ readonly adapter: ThirdPartyPluginAdapter<TApi>;
50
+ /**
51
+ * The oldest release the dependent works with. Defaults to the adapter's own
52
+ * {@link ThirdPartyPluginAdapter.minPluginVersion}; a dependent may only raise it.
53
+ */
54
+ readonly minPluginVersion?: string;
55
+ /**
56
+ * A localized sentence saying what the dependent does with the plugin, shown in the settings banner.
57
+ */
58
+ readonly reason: DocumentFragment | string;
59
+ }
60
+ /**
61
+ * Parameters for {@link getThirdPartyPluginApi} and {@link getThirdPartyPluginAvailability}.
62
+ *
63
+ * @typeParam TApi - The adapter's API type.
64
+ */
65
+ export interface GetThirdPartyPluginApiParams<TApi extends object> {
66
+ /**
67
+ * The adapter of the plugin.
68
+ */
69
+ readonly adapter: ThirdPartyPluginAdapter<TApi>;
70
+ /**
71
+ * The Obsidian app instance.
72
+ */
73
+ readonly app: App;
74
+ /**
75
+ * The oldest release the caller works with. Defaults to the adapter's own
76
+ * {@link ThirdPartyPluginAdapter.minPluginVersion}.
77
+ */
78
+ readonly minPluginVersion?: string;
79
+ }
80
+ /**
81
+ * Parameters for {@link getThirdPartyPluginAvailability}.
82
+ *
83
+ * @typeParam TApi - The adapter's API type.
84
+ */
85
+ export type GetThirdPartyPluginAvailabilityParams<TApi extends object> = GetThirdPartyPluginApiParams<TApi>;
86
+ /**
87
+ * Parameters for {@link requireThirdPartyPluginApi}.
88
+ *
89
+ * @typeParam TApi - The adapter's API type.
90
+ */
91
+ export interface RequireThirdPartyPluginApiParams<TApi extends object> extends Except<RequirePluginParams, 'app' | 'isPlugin' | 'minPluginVersion' | 'pluginId' | 'pluginName'>, GetThirdPartyPluginApiParams<TApi> {
92
+ }
93
+ /**
94
+ * How to get from one third-party plugin's instance to its typed API.
95
+ *
96
+ * An adapter is plain data plus one function, so it can be a module-level constant shared by every consumer,
97
+ * and adding a plugin means adding one adapter.
98
+ *
99
+ * @typeParam TApi - The plugin's API, typed by the adapter's author and verified by {@link getApi}.
100
+ */
101
+ export interface ThirdPartyPluginAdapter<TApi extends object> {
102
+ /**
103
+ * Reads the typed API off a running instance of the plugin, VERIFYING its shape.
104
+ *
105
+ * Return `null` when the instance does not carry the members the adapter types, which is what a release
106
+ * that renamed or reshaped them looks like. Never cast: a cast asserts a shape nothing checked.
107
+ *
108
+ * @param plugin - The running instance, whose `onload` has settled.
109
+ * @returns The API, or `null` when the instance is not the shape the adapter expects.
110
+ */
111
+ readonly getApi: (plugin: Plugin) => null | TApi;
112
+ /**
113
+ * The oldest release of the plugin the adapter was verified against, compared with its `manifest.version`.
114
+ * A release below it reads as {@link PluginAvailability.Outdated}.
115
+ */
116
+ readonly minPluginVersion?: string;
117
+ /**
118
+ * The `manifest.id` of the plugin.
119
+ */
120
+ readonly pluginId: string;
121
+ /**
122
+ * The display name of the plugin, shown to the user.
123
+ */
124
+ readonly pluginName: string;
125
+ }
126
+ /**
127
+ * A live reference to a third-party plugin's API.
128
+ *
129
+ * @typeParam TApi - The adapter's API type.
130
+ */
131
+ export interface ThirdPartyPluginApiRef<TApi extends object> extends AsyncEventSource<ThirdPartyPluginApiRefEventMap> {
132
+ /**
133
+ * Whether the API can be used right now, and if not, why. Read at the moment of reading.
134
+ */
135
+ readonly availability: PluginAvailability;
136
+ /**
137
+ * The API, or `null` when it is not available right now. `null` during the consumer's `onload` may only
138
+ * mean the plugin has not loaded yet; the value becomes the API on its own once it has.
139
+ */
140
+ readonly value: null | TApi;
141
+ }
142
+ /**
143
+ * The events a {@link ThirdPartyPluginApiRef} fires.
144
+ */
145
+ export interface ThirdPartyPluginApiRefEventMap {
146
+ /**
147
+ * Fired whenever {@link ThirdPartyPluginApiRef.value} changes, including when it becomes `null` because the
148
+ * plugin was disabled or reloaded.
149
+ */
150
+ readonly change: [];
151
+ }
152
+ /**
153
+ * A third-party plugin another plugin cannot work without, declared through
154
+ * `PluginBase.getPluginDependencies()`.
155
+ *
156
+ * Built by {@link createThirdPartyPluginDependency}, which copies the adapter's id and name.
157
+ */
158
+ export interface ThirdPartyPluginDependency extends PluginDependencyBase {
159
+ /**
160
+ * The adapter the gate reads the dependency's API through.
161
+ */
162
+ readonly adapter: ThirdPartyPluginAdapter<object>;
163
+ }
164
+ /**
165
+ * Parameters for {@link waitForThirdPartyPluginApi}.
166
+ *
167
+ * @typeParam TApi - The adapter's API type.
168
+ */
169
+ export interface WaitForThirdPartyPluginApiParams<TApi extends object> extends Except<WaitForPluginParams, 'app' | 'isPlugin' | 'minPluginVersion' | 'pluginId'>, GetThirdPartyPluginApiParams<TApi> {
170
+ }
171
+ /**
172
+ * Parameters for {@link watchThirdPartyPluginApi}.
173
+ *
174
+ * @typeParam TApi - The adapter's API type.
175
+ */
176
+ export interface WatchThirdPartyPluginApiParams<TApi extends object> extends GetThirdPartyPluginApiParams<TApi> {
177
+ /**
178
+ * The component owning the watch. Its unload stops it.
179
+ */
180
+ readonly component: Component;
181
+ }
182
+ /**
183
+ * Builds the declaration of a required third-party plugin, for `PluginBase.getPluginDependencies()`.
184
+ *
185
+ * @typeParam TApi - The adapter's API type.
186
+ * @param params - The {@link CreateThirdPartyPluginDependencyParams}.
187
+ * @returns The dependency.
188
+ */
189
+ export declare function createThirdPartyPluginDependency<TApi extends object>(params: CreateThirdPartyPluginDependencyParams<TApi>): ThirdPartyPluginDependency;
190
+ /**
191
+ * Returns a third-party plugin's typed API when the plugin is {@link PluginAvailability.Available}, and `null`
192
+ * otherwise.
193
+ *
194
+ * @typeParam TApi - The adapter's API type.
195
+ * @param params - The {@link GetThirdPartyPluginApiParams}.
196
+ * @returns The API, or `null`.
197
+ */
198
+ export declare function getThirdPartyPluginApi<TApi extends object>(params: GetThirdPartyPluginApiParams<TApi>): null | TApi;
199
+ /**
200
+ * Reads whether a third-party plugin's API can be used right now, and if not, why.
201
+ *
202
+ * @typeParam TApi - The adapter's API type.
203
+ * @param params - The {@link GetThirdPartyPluginApiParams}.
204
+ * @returns The {@link PluginAvailability}; {@link PluginAvailability.ShapeMismatch} when the adapter does not
205
+ * recognize the running instance.
206
+ */
207
+ export declare function getThirdPartyPluginAvailability<TApi extends object>(params: GetThirdPartyPluginAvailabilityParams<TApi>): PluginAvailability;
208
+ /**
209
+ * Checks whether a dependency declared through `PluginBase.getPluginDependencies()` is a third-party one.
210
+ *
211
+ * @param dependency - The declared dependency.
212
+ * @returns Whether it carries an adapter.
213
+ */
214
+ export declare function isThirdPartyPluginDependency(dependency: PluginDependencyBase): dependency is ThirdPartyPluginDependency;
215
+ /**
216
+ * Waits for a third-party plugin's API, asking the user to install, enable or update the plugin while it is
217
+ * not available. Settles once; see `requirePlugin`.
218
+ *
219
+ * @typeParam TApi - The adapter's API type.
220
+ * @param params - The {@link RequireThirdPartyPluginApiParams}.
221
+ * @returns A {@link Promise} resolving with the API.
222
+ */
223
+ export declare function requireThirdPartyPluginApi<TApi extends object>(params: RequireThirdPartyPluginApiParams<TApi>): Promise<TApi>;
224
+ /**
225
+ * Waits for a third-party plugin's API to become available. Settles once; see `waitForPlugin`.
226
+ *
227
+ * @typeParam TApi - The adapter's API type.
228
+ * @param params - The {@link WaitForThirdPartyPluginApiParams}.
229
+ * @returns A {@link Promise} resolving with the API.
230
+ * @throws `PluginInstanceUnavailableError` when the timeout elapses.
231
+ */
232
+ export declare function waitForThirdPartyPluginApi<TApi extends object>(params: WaitForThirdPartyPluginApiParams<TApi>): Promise<TApi>;
233
+ /**
234
+ * Watches a third-party plugin's API and returns a live {@link ThirdPartyPluginApiRef}.
235
+ *
236
+ * The ref re-reads on every `app.plugins` `changed` and every library lifecycle broadcast, so it follows the
237
+ * plugin through enable, disable, update and reload with no polling. This is the shape of an OPTIONAL
238
+ * dependency: read `ref.value` where the integration is used, and treat `null` as "not there".
239
+ *
240
+ * @typeParam TApi - The adapter's API type.
241
+ * @param params - The {@link WatchThirdPartyPluginApiParams}.
242
+ * @returns The live reference.
243
+ */
244
+ export declare function watchThirdPartyPluginApi<TApi extends object>(params: WatchThirdPartyPluginApiParams<TApi>): ThirdPartyPluginApiRef<TApi>;
@@ -117,8 +117,8 @@ __export(plugin_cli_handler_registrar_exports, {
117
117
  PluginCliHandlerRegistrar: () => PluginCliHandlerRegistrar
118
118
  });
119
119
  module.exports = __toCommonJS(plugin_cli_handler_registrar_exports);
120
- var import_async = require('@mnaoumov/typescript-lib/async');
121
- var import_obsidian = require('obsidian');
120
+ var import_async = require("@mnaoumov/typescript-lib/async");
121
+ var import_obsidian = require("obsidian");
122
122
  class PluginCliHandlerRegistrar {
123
123
  /**
124
124
  * Creates a new instance of the {@link PluginCliHandlerRegistrar} class.
@@ -117,10 +117,10 @@ __export(field_popover_exports, {
117
117
  editFieldsInPopover: () => editFieldsInPopover
118
118
  });
119
119
  module.exports = __toCommonJS(field_popover_exports);
120
- var import_object_utils = require('@mnaoumov/typescript-lib/object-utils');
121
- var import_obsidian = require('obsidian');
122
- var import_css_class = require('../css-class.cjs');
123
- var import_popover = require('./popover.cjs');
120
+ var import_object_utils = require("@mnaoumov/typescript-lib/object-utils");
121
+ var import_obsidian = require("obsidian");
122
+ var import_css_class = require("../css-class.cjs");
123
+ var import_popover = require("./popover.cjs");
124
124
  async function editFieldsInPopover(params) {
125
125
  const {
126
126
  anchor,
@@ -102,9 +102,9 @@ __export(popovers_exports, {
102
102
  "popover-anchor": () => popover_anchor
103
103
  });
104
104
  module.exports = __toCommonJS(popovers_exports);
105
- var field_popover = __toESM(((module) => module && module.__esModule && 'default' in module ? module.default : module)(require('./field-popover.cjs')), 1);
106
- var popover_anchor = __toESM(((module) => module && module.__esModule && 'default' in module ? module.default : module)(require('./popover-anchor.cjs')), 1);
107
- var popover = __toESM(((module) => module && module.__esModule && 'default' in module ? module.default : module)(require('./popover.cjs')), 1);
105
+ var field_popover = __toESM(((module) => module && module.__esModule && 'default' in module ? module.default : module)(require("./field-popover.cjs")), 1);
106
+ var popover_anchor = __toESM(((module) => module && module.__esModule && 'default' in module ? module.default : module)(require("./popover-anchor.cjs")), 1);
107
+ var popover = __toESM(((module) => module && module.__esModule && 'default' in module ? module.default : module)(require("./popover.cjs")), 1);
108
108
  // Annotate the CommonJS export names for ESM import in node:
109
109
  0 && (module.exports = {
110
110
  "field-popover": null,
@@ -120,7 +120,7 @@ __export(popover_anchor_exports, {
120
120
  createAnchorFromSelection: () => createAnchorFromSelection
121
121
  });
122
122
  module.exports = __toCommonJS(popover_anchor_exports);
123
- var import_html_element = require('@mnaoumov/typescript-lib/html-element');
123
+ var import_html_element = require("@mnaoumov/typescript-lib/html-element");
124
124
  const CENTER_FRACTION = 0.5;
125
125
  function createAnchorFromDocumentCenter(doc) {
126
126
  const win = (0, import_html_element.getDocumentWindow)(doc);
@@ -117,11 +117,11 @@ __export(popover_exports, {
117
117
  showPopover: () => showPopover
118
118
  });
119
119
  module.exports = __toCommonJS(popover_exports);
120
- var import_html_element = require('@mnaoumov/typescript-lib/html-element');
121
- var import_obsidian = require('obsidian');
122
- var import_css_class = require('../css-class.cjs');
123
- var import_i18n = require('../i18n/i18n.cjs');
124
- var import_plugin_context = require('../plugin/plugin-context.cjs');
120
+ var import_html_element = require("@mnaoumov/typescript-lib/html-element");
121
+ var import_obsidian = require("obsidian");
122
+ var import_css_class = require("../css-class.cjs");
123
+ var import_i18n = require("../i18n/i18n.cjs");
124
+ var import_plugin_context = require("../plugin/plugin-context.cjs");
125
125
  const ANCHOR_GAP_IN_PIXELS = 4;
126
126
  const VIEWPORT_MARGIN_IN_PIXELS = 8;
127
127
  async function showPopover(params) {
@@ -119,14 +119,14 @@ __export(queue_exports, {
119
119
  flushQueue: () => flushQueue
120
120
  });
121
121
  module.exports = __toCommonJS(queue_exports);
122
- var import_abort_controller = require('@mnaoumov/typescript-lib/abort-controller');
123
- var import_async = require('@mnaoumov/typescript-lib/async');
124
- var import_error = require('@mnaoumov/typescript-lib/error');
125
- var import_function = require('@mnaoumov/typescript-lib/function');
126
- var import_async_with_notice = require('./async-with-notice.cjs');
127
- var import_i18n = require('./i18n/i18n.cjs');
128
- var import_logger = require('./logger.cjs');
129
- var import_obsidian_lib_state = require('./obsidian-lib-state.cjs');
122
+ var import_abort_controller = require("@mnaoumov/typescript-lib/abort-controller");
123
+ var import_async = require("@mnaoumov/typescript-lib/async");
124
+ var import_error = require("@mnaoumov/typescript-lib/error");
125
+ var import_function = require("@mnaoumov/typescript-lib/function");
126
+ var import_async_with_notice = require("./async-with-notice.cjs");
127
+ var import_i18n = require("./i18n/i18n.cjs");
128
+ var import_logger = require("./logger.cjs");
129
+ var import_obsidian_lib_state = require("./obsidian-lib-state.cjs");
130
130
  function addToQueue(params) {
131
131
  const stackTrace = params.stackTrace ?? (0, import_error.getStackTrace)(1);
132
132
  (0, import_async.invokeAsyncSafely)(() => addToQueueAndWait(params), stackTrace);
@@ -118,9 +118,9 @@ __export(app_context_exports, {
118
118
  useApp: () => useApp
119
119
  });
120
120
  module.exports = __toCommonJS(app_context_exports);
121
- var import_type_guards = require('@mnaoumov/typescript-lib/type-guards');
122
- var import_obsidian = require('obsidian');
123
- var import_react = require('react');
121
+ var import_type_guards = require("@mnaoumov/typescript-lib/type-guards");
122
+ var import_obsidian = require("obsidian");
123
+ var import_react = require("react");
124
124
  const AppContext = (0, import_react.createContext)(void 0);
125
125
  function useApp() {
126
126
  return (0, import_type_guards.ensureNonNullable)((0, import_react.useContext)(AppContext), "AppContext not found");
@@ -100,7 +100,7 @@ __export(react_exports, {
100
100
  "app-context": () => app_context
101
101
  });
102
102
  module.exports = __toCommonJS(react_exports);
103
- var app_context = __toESM(((module) => module && module.__esModule && 'default' in module ? module.default : module)(require('./app-context.cjs')), 1);
103
+ var app_context = __toESM(((module) => module && module.__esModule && 'default' in module ? module.default : module)(require("./app-context.cjs")), 1);
104
104
  // Annotate the CommonJS export names for ESM import in node:
105
105
  0 && (module.exports = {
106
106
  "app-context": null
@@ -90,7 +90,7 @@ __export(reference_definition_exports, {
90
90
  referenceDefinitionToFileChange: () => referenceDefinitionToFileChange
91
91
  });
92
92
  module.exports = __toCommonJS(reference_definition_exports);
93
- var import_debug = require('./debug.cjs');
93
+ var import_debug = require("./debug.cjs");
94
94
  const ASCII_PUNCTUATION_REG_EXP = /[!-/:-@[-`{-~]/;
95
95
  const BARE_DESTINATION_FORBIDDEN_CHARACTER_REG_EXP = /[\s\p{Cc}]/u;
96
96
  const DEFINITION_PREFIX_REG_EXP = /^[ \t]*\[(?:\\[\s\S]|[^\\\]])+\]:[ \t]*(?:\r?\n(?:[ \t]*>)*[ \t]*)?/;