@mnaoumov/obsidian-lib 10.11.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 (460) hide show
  1. package/README.md +26 -0
  2. package/components/all-windows-status-bar-item-component/package.json +6 -0
  3. package/components/shared-component-pool-component/package.json +6 -0
  4. package/components/worker-component/package.json +6 -0
  5. package/components/worker-pool-component/package.json +6 -0
  6. package/components/workspace-layout-state-component/package.json +6 -0
  7. package/dist/lib/cjs/__merged.cjs +477 -285
  8. package/dist/lib/cjs/__merged.d.cts +26 -10
  9. package/dist/lib/cjs/anchored-suggest.cjs +1 -1
  10. package/dist/lib/cjs/app.cjs +2 -2
  11. package/dist/lib/cjs/async-with-notice.cjs +4 -4
  12. package/dist/lib/cjs/attachment-path.cjs +9 -9
  13. package/dist/lib/cjs/attachment-path.d.cts +3 -3
  14. package/dist/lib/cjs/attachment-unit-folder.cjs +2 -2
  15. package/dist/lib/cjs/backlink-index.cjs +5 -5
  16. package/dist/lib/cjs/backlink.cjs +7 -7
  17. package/dist/lib/cjs/bases-view-registrar.cjs +1 -1
  18. package/dist/lib/cjs/broken-link-candidates.cjs +1 -1
  19. package/dist/lib/cjs/bug-report-diagnostics.cjs +222 -0
  20. package/dist/lib/cjs/bug-report-diagnostics.d.cts +186 -0
  21. package/dist/lib/cjs/bug-report.cjs +38 -12
  22. package/dist/lib/cjs/bug-report.d.cts +65 -0
  23. package/dist/lib/cjs/bulk-operation-progress.cjs +1 -1
  24. package/dist/lib/cjs/bulk-operation.cjs +2 -2
  25. package/dist/lib/cjs/callout.cjs +6 -6
  26. package/dist/lib/cjs/canvas.cjs +11 -9
  27. package/dist/lib/cjs/canvas.d.cts +13 -0
  28. package/dist/lib/cjs/case-insensitive-file-index.cjs +3 -3
  29. package/dist/lib/cjs/code-block-render-handoff.cjs +5 -5
  30. package/dist/lib/cjs/codemirror/editor-mode-extension.cjs +4 -4
  31. package/dist/lib/cjs/codemirror/incremental-parse-state-field.cjs +2 -2
  32. package/dist/lib/cjs/codemirror/index.cjs +7 -7
  33. package/dist/lib/cjs/codemirror/inline-token-widgets.cjs +5 -5
  34. package/dist/lib/cjs/codemirror/markdown-editor-views.cjs +2 -2
  35. package/dist/lib/cjs/codemirror/settings-facet.cjs +1 -1
  36. package/dist/lib/cjs/command-handlers/abstract-file-command-handler.cjs +17 -17
  37. package/dist/lib/cjs/command-handlers/abstract-file-command-handler.d.cts +13 -13
  38. package/dist/lib/cjs/command-handlers/command-handler-component.cjs +2 -2
  39. package/dist/lib/cjs/command-handlers/command-handler.cjs +2 -2
  40. package/dist/lib/cjs/command-handlers/editor-command-handler.cjs +10 -10
  41. package/dist/lib/cjs/command-handlers/editor-command-handler.d.cts +7 -7
  42. package/dist/lib/cjs/command-handlers/file-command-handler.cjs +3 -3
  43. package/dist/lib/cjs/command-handlers/folder-command-handler.cjs +3 -3
  44. package/dist/lib/cjs/command-handlers/global-command-handler.cjs +2 -2
  45. package/dist/lib/cjs/command-handlers/index.cjs +15 -15
  46. package/dist/lib/cjs/command-handlers/open-bug-report-command-handler.cjs +95 -4
  47. package/dist/lib/cjs/command-handlers/open-bug-report-command-handler.d.cts +34 -2
  48. package/dist/lib/cjs/command-handlers/open-demo-vault-command-handler.cjs +2 -2
  49. package/dist/lib/cjs/command-handlers/open-discussion-command-handler.cjs +2 -2
  50. package/dist/lib/cjs/command-handlers/open-feature-request-command-handler.cjs +2 -2
  51. package/dist/lib/cjs/command-handlers/open-git-hub-command-handler.cjs +1 -1
  52. package/dist/lib/cjs/command-handlers/open-settings-command-handler.cjs +2 -2
  53. package/dist/lib/cjs/command-handlers/undo-bulk-operation-command-handler.cjs +2 -2
  54. package/dist/lib/cjs/command-handlers/unlock-active-note-command-handler.cjs +1 -1
  55. package/dist/lib/cjs/community-plugins.cjs +3 -3
  56. package/dist/lib/cjs/components/abort-signal-component.cjs +2 -2
  57. package/dist/lib/cjs/components/all-windows-event-component.cjs +5 -5
  58. package/dist/lib/cjs/components/all-windows-status-bar-item-component.cjs +245 -0
  59. package/dist/lib/cjs/components/all-windows-status-bar-item-component.d.cts +146 -0
  60. package/dist/lib/cjs/components/async-error-handler-component.cjs +5 -5
  61. package/dist/lib/cjs/components/async-events-component.cjs +1 -1
  62. package/dist/lib/cjs/components/bulk-operation-commit-component.cjs +12 -12
  63. package/dist/lib/cjs/components/case-insensitive-file-index-component.cjs +2 -2
  64. package/dist/lib/cjs/components/component-ex.cjs +21 -11
  65. package/dist/lib/cjs/components/component-ex.d.cts +11 -0
  66. package/dist/lib/cjs/components/console-debug-component.cjs +2 -2
  67. package/dist/lib/cjs/components/core-plugin-toggle-component.cjs +2 -2
  68. package/dist/lib/cjs/components/disposable-component.cjs +2 -2
  69. package/dist/lib/cjs/components/embed-extensions-component.cjs +21 -4
  70. package/dist/lib/cjs/components/embed-extensions-component.d.cts +8 -0
  71. package/dist/lib/cjs/components/embeddable-markdown-editor-component.cjs +24 -10
  72. package/dist/lib/cjs/components/embeddable-markdown-editor-component.d.cts +9 -0
  73. package/dist/lib/cjs/components/file-explorer-root-menu-component.cjs +7 -7
  74. package/dist/lib/cjs/components/generate-markdown-link-default-params-component.cjs +2 -2
  75. package/dist/lib/cjs/components/incremental-file-index-component.cjs +4 -4
  76. package/dist/lib/cjs/components/index.cjs +54 -39
  77. package/dist/lib/cjs/components/index.d.cts +5 -0
  78. package/dist/lib/cjs/components/layout-ready-component.cjs +3 -3
  79. package/dist/lib/cjs/components/menu-event-registrar-component.cjs +2 -2
  80. package/dist/lib/cjs/components/monkey-around-component.cjs +3 -3
  81. package/dist/lib/cjs/components/notebook-navigator-menu-event-registrar-component.cjs +5 -5
  82. package/dist/lib/cjs/components/plugin-context-component.cjs +5 -5
  83. package/dist/lib/cjs/components/plugin-gate-component.cjs +69 -36
  84. package/dist/lib/cjs/components/plugin-gate-component.d.cts +36 -13
  85. package/dist/lib/cjs/components/plugin-notice-component.cjs +39 -33
  86. package/dist/lib/cjs/components/plugin-notice-component.d.cts +4 -3
  87. package/dist/lib/cjs/components/plugin-settings-component.cjs +119 -18
  88. package/dist/lib/cjs/components/plugin-settings-component.d.cts +35 -5
  89. package/dist/lib/cjs/components/plugin-settings-tab-component.cjs +2 -2
  90. package/dist/lib/cjs/components/plugin-suggestion-component.cjs +8 -8
  91. package/dist/lib/cjs/components/pointer-position-component.cjs +2 -2
  92. package/dist/lib/cjs/components/reconfigurable-editor-extension-component.cjs +3 -3
  93. package/dist/lib/cjs/components/registry-component.cjs +2 -2
  94. package/dist/lib/cjs/components/release-notes-component.cjs +6 -6
  95. package/dist/lib/cjs/components/rename-delete-handler-component.cjs +25 -25
  96. package/dist/lib/cjs/components/rmdir-guard-component.cjs +2 -2
  97. package/dist/lib/cjs/components/settings-facet-component.cjs +1 -1
  98. package/dist/lib/cjs/components/settings-migration-component.cjs +5 -5
  99. package/dist/lib/cjs/components/shared-component-pool-component.cjs +368 -0
  100. package/dist/lib/cjs/components/shared-component-pool-component.d.cts +129 -0
  101. package/dist/lib/cjs/components/style-sheet-component.cjs +3 -3
  102. package/dist/lib/cjs/components/syntax-highlighting-component.cjs +3 -3
  103. package/dist/lib/cjs/components/templates-language-component.cjs +1 -1
  104. package/dist/lib/cjs/components/worker-component.cjs +363 -0
  105. package/dist/lib/cjs/components/worker-component.d.cts +156 -0
  106. package/dist/lib/cjs/components/worker-pool-component.cjs +185 -0
  107. package/dist/lib/cjs/components/worker-pool-component.d.cts +102 -0
  108. package/dist/lib/cjs/components/workspace-layout-state-component.cjs +495 -0
  109. package/dist/lib/cjs/components/workspace-layout-state-component.d.cts +239 -0
  110. package/dist/lib/cjs/constructors/get-dom-events-handlers-constructor.cjs +5 -5
  111. package/dist/lib/cjs/constructors/index.cjs +1 -1
  112. package/dist/lib/cjs/css-class.cjs +5 -1
  113. package/dist/lib/cjs/css-class.d.cts +16 -0
  114. package/dist/lib/cjs/data-handler.cjs +264 -6
  115. package/dist/lib/cjs/data-handler.d.cts +219 -2
  116. package/dist/lib/cjs/data-stores/data-store-locations.cjs +82 -24
  117. package/dist/lib/cjs/data-stores/data-store-locations.d.cts +15 -0
  118. package/dist/lib/cjs/data-stores/data-store-replica.cjs +33 -5
  119. package/dist/lib/cjs/data-stores/data-store-seeds.cjs +6 -6
  120. package/dist/lib/cjs/data-stores/data-store-seeds.d.cts +2 -2
  121. package/dist/lib/cjs/data-stores/data-store-transport.cjs +81 -8
  122. package/dist/lib/cjs/data-stores/data-store-transport.d.cts +30 -1
  123. package/dist/lib/cjs/data-stores/index.cjs +6 -6
  124. package/dist/lib/cjs/data-stores/local-data-store.cjs +74 -10
  125. package/dist/lib/cjs/data-stores/local-data-store.d.cts +58 -1
  126. package/dist/lib/cjs/data-stores/shared-data-store.cjs +76 -19
  127. package/dist/lib/cjs/data-stores/shared-data-store.d.cts +18 -1
  128. package/dist/lib/cjs/dataview-link.cjs +2 -2
  129. package/dist/lib/cjs/dataview.cjs +27 -7
  130. package/dist/lib/cjs/dataview.d.cts +14 -0
  131. package/dist/lib/cjs/debug.cjs +3 -3
  132. package/dist/lib/cjs/demo-vault-helper.cjs +34 -6
  133. package/dist/lib/cjs/demo-vault-helper.d.cts +6 -2
  134. package/dist/lib/cjs/desktop-bulk-operation-git.cjs +10 -10
  135. package/dist/lib/cjs/desktop-demo-vault-opener.cjs +13 -13
  136. package/dist/lib/cjs/desktop-git-runner.cjs +4 -14
  137. package/dist/lib/cjs/desktop-git-runner.d.cts +8 -2
  138. package/dist/lib/cjs/desktop-operating-system.cjs +1 -1
  139. package/dist/lib/cjs/desktop-request-url-stream.cjs +8 -14
  140. package/dist/lib/cjs/desktop-trusted-input.cjs +2 -2
  141. package/dist/lib/cjs/disposable.cjs +150 -0
  142. package/dist/lib/cjs/disposable.d.cts +39 -0
  143. package/dist/lib/cjs/editor-extension-registrar.cjs +1 -1
  144. package/dist/lib/cjs/editor-suggest-registrar.cjs +2 -2
  145. package/dist/lib/cjs/editor-suggest.cjs +1 -1
  146. package/dist/lib/cjs/editor.cjs +6 -6
  147. package/dist/lib/cjs/events.cjs +2 -2
  148. package/dist/lib/cjs/extensions-registrar.cjs +1 -1
  149. package/dist/lib/cjs/feature-request.cjs +1 -1
  150. package/dist/lib/cjs/file-change.cjs +10 -10
  151. package/dist/lib/cjs/file-explorer.cjs +2 -2
  152. package/dist/lib/cjs/file-manager.cjs +5 -5
  153. package/dist/lib/cjs/file-system.cjs +10 -10
  154. package/dist/lib/cjs/folder-note.cjs +4 -4
  155. package/dist/lib/cjs/frontmatter-formatting.cjs +7 -6
  156. package/dist/lib/cjs/frontmatter-link-cache-with-offsets.cjs +1 -1
  157. package/dist/lib/cjs/frontmatter.cjs +5 -5
  158. package/dist/lib/cjs/generated-during-build.cjs +2 -2
  159. package/dist/lib/cjs/git-rename-history.cjs +1 -1
  160. package/dist/lib/cjs/git-rename-history.d.cts +2 -2
  161. package/dist/lib/cjs/hotkey.cjs +1 -1
  162. package/dist/lib/cjs/hover-link-source-registrar.cjs +1 -1
  163. package/dist/lib/cjs/html-element.cjs +2 -2
  164. package/dist/lib/cjs/i18n/custom-type-options.cjs +1 -1
  165. package/dist/lib/cjs/i18n/default-translations.cjs +1 -1
  166. package/dist/lib/cjs/i18n/i18n.cjs +7 -7
  167. package/dist/lib/cjs/i18n/index.cjs +4 -4
  168. package/dist/lib/cjs/i18n/locales/en.cjs +27 -1
  169. package/dist/lib/cjs/i18n/locales/en.d.cts +26 -0
  170. package/dist/lib/cjs/i18n/locales/index.cjs +2 -2
  171. package/dist/lib/cjs/i18n/locales/translations-map.cjs +1 -1
  172. package/dist/lib/cjs/i18n/locales/translations-map.d.cts +26 -0
  173. package/dist/lib/cjs/index.cjs +147 -126
  174. package/dist/lib/cjs/index.d.cts +7 -0
  175. package/dist/lib/cjs/inline-token-renderer.cjs +2 -2
  176. package/dist/lib/cjs/is-in-obsidian.cjs +1 -1
  177. package/dist/lib/cjs/library-styles.cjs +3 -3
  178. package/dist/lib/cjs/link-and-tag-input-suggest.cjs +2 -2
  179. package/dist/lib/cjs/link.cjs +76 -56
  180. package/dist/lib/cjs/link.d.cts +20 -14
  181. package/dist/lib/cjs/logger.cjs +4 -4
  182. package/dist/lib/cjs/loop.cjs +10 -16
  183. package/dist/lib/cjs/markdown-code-block-processor-registrar.cjs +17 -2
  184. package/dist/lib/cjs/markdown-code-block-processor-registrar.d.cts +7 -0
  185. package/dist/lib/cjs/markdown-code-block-processor.cjs +13 -13
  186. package/dist/lib/cjs/markdown-post-processor-registrar.cjs +2 -2
  187. package/dist/lib/cjs/markdown-view.cjs +191 -3
  188. package/dist/lib/cjs/markdown-view.d.cts +48 -1
  189. package/dist/lib/cjs/markdown.cjs +12 -12
  190. package/dist/lib/cjs/metadata-cache.cjs +23 -23
  191. package/dist/lib/cjs/metadata-cache.d.cts +5 -4
  192. package/dist/lib/cjs/misplaced-attachment.cjs +297 -0
  193. package/dist/lib/cjs/misplaced-attachment.d.cts +228 -0
  194. package/dist/lib/cjs/mobile-app-info.cjs +1 -1
  195. package/dist/lib/cjs/modals/alert.cjs +4 -4
  196. package/dist/lib/cjs/modals/code-block-builder.cjs +7 -7
  197. package/dist/lib/cjs/modals/confirm.cjs +4 -4
  198. package/dist/lib/cjs/modals/copy-text-manually.cjs +181 -0
  199. package/dist/lib/cjs/modals/copy-text-manually.d.cts +38 -0
  200. package/dist/lib/cjs/modals/index.cjs +17 -11
  201. package/dist/lib/cjs/modals/index.d.cts +2 -0
  202. package/dist/lib/cjs/modals/minimizable-modal.cjs +6 -6
  203. package/dist/lib/cjs/modals/modal-command-builder.cjs +3 -3
  204. package/dist/lib/cjs/modals/modal.cjs +3 -3
  205. package/dist/lib/cjs/modals/prompt.cjs +10 -10
  206. package/dist/lib/cjs/modals/prompt.d.cts +1 -1
  207. package/dist/lib/cjs/modals/review-bug-report-diagnostics.cjs +202 -0
  208. package/dist/lib/cjs/modals/review-bug-report-diagnostics.d.cts +30 -0
  209. package/dist/lib/cjs/modals/select-item.cjs +6 -6
  210. package/dist/lib/cjs/modals/select-option.cjs +3 -3
  211. package/dist/lib/cjs/modals/suggest-modal-command-builder.cjs +1 -1
  212. package/dist/lib/cjs/note-priority.cjs +2 -2
  213. package/dist/lib/cjs/notebook-navigator.cjs +12 -2
  214. package/dist/lib/cjs/notebook-navigator.d.cts +6 -0
  215. package/dist/lib/cjs/obsidian-lib-state.cjs +1 -1
  216. package/dist/lib/cjs/obsidian-protocol-handler-registrar.cjs +1 -1
  217. package/dist/lib/cjs/obsidian-settings.cjs +1 -1
  218. package/dist/lib/cjs/obsidian-word-characters.cjs +1 -1
  219. package/dist/lib/cjs/parse-link.cjs +14 -14
  220. package/dist/lib/cjs/path-compatibility.cjs +368 -0
  221. package/dist/lib/cjs/path-compatibility.d.cts +263 -0
  222. package/dist/lib/cjs/path-settings.cjs +3 -3
  223. package/dist/lib/cjs/pdf.cjs +2 -2
  224. package/dist/lib/cjs/plugin/index.cjs +18 -12
  225. package/dist/lib/cjs/plugin/index.d.cts +2 -0
  226. package/dist/lib/cjs/plugin/plugin-api.cjs +21 -12
  227. package/dist/lib/cjs/plugin/plugin-api.d.cts +5 -1
  228. package/dist/lib/cjs/plugin/plugin-async-cleanup.cjs +6 -3
  229. package/dist/lib/cjs/plugin/plugin-async-cleanup.d.cts +5 -0
  230. package/dist/lib/cjs/plugin/plugin-context.cjs +10 -9
  231. package/dist/lib/cjs/plugin/plugin-event-source.cjs +1 -1
  232. package/dist/lib/cjs/plugin/plugin-event-source.d.cts +4 -4
  233. package/dist/lib/cjs/plugin/plugin-install-state.cjs +49 -4
  234. package/dist/lib/cjs/plugin/plugin-install-state.d.cts +30 -0
  235. package/dist/lib/cjs/plugin/plugin-instance.cjs +450 -0
  236. package/dist/lib/cjs/plugin/plugin-instance.d.cts +258 -0
  237. package/dist/lib/cjs/plugin/plugin-lifecycle-events.cjs +1 -1
  238. package/dist/lib/cjs/plugin/plugin-lifecycle-events.d.cts +6 -4
  239. package/dist/lib/cjs/plugin/plugin-settings-tab.cjs +15 -15
  240. package/dist/lib/cjs/plugin/plugin.cjs +133 -34
  241. package/dist/lib/cjs/plugin/plugin.d.cts +35 -5
  242. package/dist/lib/cjs/plugin/settings-migration-api.cjs +1 -1
  243. package/dist/lib/cjs/plugin/third-party-plugin.cjs +231 -0
  244. package/dist/lib/cjs/plugin/third-party-plugin.d.cts +244 -0
  245. package/dist/lib/cjs/plugin-cli-handler-registrar.cjs +2 -2
  246. package/dist/lib/cjs/popovers/field-popover.cjs +4 -4
  247. package/dist/lib/cjs/popovers/index.cjs +3 -3
  248. package/dist/lib/cjs/popovers/popover-anchor.cjs +1 -1
  249. package/dist/lib/cjs/popovers/popover.cjs +5 -5
  250. package/dist/lib/cjs/queue.cjs +8 -8
  251. package/dist/lib/cjs/react/app-context.cjs +3 -3
  252. package/dist/lib/cjs/react/index.cjs +1 -1
  253. package/dist/lib/cjs/reference-definition.cjs +1 -1
  254. package/dist/lib/cjs/reference.cjs +3 -3
  255. package/dist/lib/cjs/release-asset.cjs +5 -5
  256. package/dist/lib/cjs/rendered-markdown.cjs +4 -4
  257. package/dist/lib/cjs/request-url.cjs +4 -4
  258. package/dist/lib/cjs/resource-lock.cjs +46 -42
  259. package/dist/lib/cjs/resource-lock.d.cts +8 -7
  260. package/dist/lib/cjs/resource-url.cjs +3 -3
  261. package/dist/lib/cjs/ribbon-icon-registrar.cjs +1 -1
  262. package/dist/lib/cjs/setting-components/checkbox-component.cjs +3 -3
  263. package/dist/lib/cjs/setting-components/code-highlighter-component.cjs +7 -7
  264. package/dist/lib/cjs/setting-components/date-component.cjs +4 -4
  265. package/dist/lib/cjs/setting-components/date-time-component.cjs +4 -4
  266. package/dist/lib/cjs/setting-components/email-component.cjs +2 -2
  267. package/dist/lib/cjs/setting-components/file-component.cjs +2 -2
  268. package/dist/lib/cjs/setting-components/folder-list-component.cjs +3 -3
  269. package/dist/lib/cjs/setting-components/hotkey-component.cjs +5 -5
  270. package/dist/lib/cjs/setting-components/index.cjs +30 -30
  271. package/dist/lib/cjs/setting-components/list-component.cjs +5 -5
  272. package/dist/lib/cjs/setting-components/month-component.cjs +4 -4
  273. package/dist/lib/cjs/setting-components/multiple-dropdown-component.cjs +3 -3
  274. package/dist/lib/cjs/setting-components/multiple-email-component.cjs +2 -2
  275. package/dist/lib/cjs/setting-components/multiple-file-component.cjs +3 -3
  276. package/dist/lib/cjs/setting-components/multiple-text-component.cjs +9 -6
  277. package/dist/lib/cjs/setting-components/multiple-text-component.d.cts +4 -1
  278. package/dist/lib/cjs/setting-components/number-component.cjs +2 -2
  279. package/dist/lib/cjs/setting-components/password-component.cjs +2 -2
  280. package/dist/lib/cjs/setting-components/setting-component-wrapper.cjs +3 -3
  281. package/dist/lib/cjs/setting-components/tag-list-component.cjs +4 -4
  282. package/dist/lib/cjs/setting-components/telephone-component.cjs +2 -2
  283. package/dist/lib/cjs/setting-components/text-based-component.cjs +1 -1
  284. package/dist/lib/cjs/setting-components/time-component.cjs +3 -3
  285. package/dist/lib/cjs/setting-components/tri-state-checkbox-component.cjs +3 -3
  286. package/dist/lib/cjs/setting-components/typed-dropdown-component.cjs +3 -3
  287. package/dist/lib/cjs/setting-components/typed-multiple-dropdown-component.cjs +4 -4
  288. package/dist/lib/cjs/setting-components/typed-range-text-component.cjs +1 -1
  289. package/dist/lib/cjs/setting-components/typed-text-component.cjs +3 -3
  290. package/dist/lib/cjs/setting-components/url-component.cjs +2 -2
  291. package/dist/lib/cjs/setting-components/validator-component.cjs +4 -4
  292. package/dist/lib/cjs/setting-components/week-component.cjs +4 -4
  293. package/dist/lib/cjs/setting-ex.cjs +26 -26
  294. package/dist/lib/cjs/setting-group-ex.cjs +2 -2
  295. package/dist/lib/cjs/settings-recovery.cjs +217 -0
  296. package/dist/lib/cjs/settings-recovery.d.cts +178 -0
  297. package/dist/lib/cjs/settings-tabs.cjs +5 -5
  298. package/dist/lib/cjs/status-bar-item-registrar.cjs +1 -1
  299. package/dist/lib/cjs/templater.cjs +14 -4
  300. package/dist/lib/cjs/templater.d.cts +6 -0
  301. package/dist/lib/cjs/transformers/duration-transformer.cjs +2 -2
  302. package/dist/lib/cjs/transformers/index.cjs +1 -1
  303. package/dist/lib/cjs/trusted-input.cjs +1 -1
  304. package/dist/lib/cjs/validation.cjs +4 -4
  305. package/dist/lib/cjs/vault-delete.cjs +6 -6
  306. package/dist/lib/cjs/vault-transaction.cjs +5 -5
  307. package/dist/lib/cjs/vault.cjs +12 -12
  308. package/dist/lib/cjs/view-registrar.cjs +1 -1
  309. package/dist/lib/cjs/virtual-file.cjs +16 -14
  310. package/dist/lib/cjs/virtual-file.d.cts +2 -1
  311. package/dist/lib/cjs/wasm.cjs +119 -0
  312. package/dist/lib/cjs/wasm.d.cts +54 -0
  313. package/dist/lib/cjs/worker-protocol.cjs +209 -0
  314. package/dist/lib/cjs/worker-protocol.d.cts +282 -0
  315. package/dist/lib/cjs/workspace.cjs +1 -1
  316. package/dist/lib/esm/__merged.d.mts +26 -10
  317. package/dist/lib/esm/__merged.mjs +215 -5
  318. package/dist/lib/esm/app.mjs +2 -2
  319. package/dist/lib/esm/attachment-path.d.mts +3 -3
  320. package/dist/lib/esm/attachment-path.mjs +2 -2
  321. package/dist/lib/esm/backlink-index.mjs +2 -2
  322. package/dist/lib/esm/bug-report-diagnostics.d.mts +186 -0
  323. package/dist/lib/esm/bug-report-diagnostics.mjs +127 -0
  324. package/dist/lib/esm/bug-report.d.mts +65 -0
  325. package/dist/lib/esm/bug-report.mjs +33 -10
  326. package/dist/lib/esm/canvas.d.mts +13 -0
  327. package/dist/lib/esm/canvas.mjs +6 -5
  328. package/dist/lib/esm/command-handlers/abstract-file-command-handler.d.mts +13 -13
  329. package/dist/lib/esm/command-handlers/abstract-file-command-handler.mjs +14 -14
  330. package/dist/lib/esm/command-handlers/editor-command-handler.d.mts +7 -7
  331. package/dist/lib/esm/command-handlers/editor-command-handler.mjs +8 -8
  332. package/dist/lib/esm/command-handlers/open-bug-report-command-handler.d.mts +34 -2
  333. package/dist/lib/esm/command-handlers/open-bug-report-command-handler.mjs +99 -3
  334. package/dist/lib/esm/components/all-windows-status-bar-item-component.d.mts +146 -0
  335. package/dist/lib/esm/components/all-windows-status-bar-item-component.mjs +154 -0
  336. package/dist/lib/esm/components/component-ex.d.mts +11 -0
  337. package/dist/lib/esm/components/component-ex.mjs +19 -6
  338. package/dist/lib/esm/components/disposable-component.mjs +1 -1
  339. package/dist/lib/esm/components/embed-extensions-component.d.mts +8 -0
  340. package/dist/lib/esm/components/embed-extensions-component.mjs +20 -3
  341. package/dist/lib/esm/components/embeddable-markdown-editor-component.d.mts +9 -0
  342. package/dist/lib/esm/components/embeddable-markdown-editor-component.mjs +16 -2
  343. package/dist/lib/esm/components/index.d.mts +5 -0
  344. package/dist/lib/esm/components/index.mjs +12 -2
  345. package/dist/lib/esm/components/plugin-gate-component.d.mts +36 -13
  346. package/dist/lib/esm/components/plugin-gate-component.mjs +61 -26
  347. package/dist/lib/esm/components/plugin-notice-component.d.mts +4 -3
  348. package/dist/lib/esm/components/plugin-notice-component.mjs +30 -21
  349. package/dist/lib/esm/components/plugin-settings-component.d.mts +35 -5
  350. package/dist/lib/esm/components/plugin-settings-component.mjs +105 -4
  351. package/dist/lib/esm/components/rename-delete-handler-component.mjs +2 -2
  352. package/dist/lib/esm/components/shared-component-pool-component.d.mts +129 -0
  353. package/dist/lib/esm/components/shared-component-pool-component.mjs +280 -0
  354. package/dist/lib/esm/components/worker-component.d.mts +156 -0
  355. package/dist/lib/esm/components/worker-component.mjs +279 -0
  356. package/dist/lib/esm/components/worker-pool-component.d.mts +102 -0
  357. package/dist/lib/esm/components/worker-pool-component.mjs +95 -0
  358. package/dist/lib/esm/components/workspace-layout-state-component.d.mts +239 -0
  359. package/dist/lib/esm/components/workspace-layout-state-component.mjs +404 -0
  360. package/dist/lib/esm/css-class.d.mts +16 -0
  361. package/dist/lib/esm/css-class.mjs +5 -1
  362. package/dist/lib/esm/data-handler.d.mts +219 -2
  363. package/dist/lib/esm/data-handler.mjs +262 -5
  364. package/dist/lib/esm/data-stores/data-store-locations.d.mts +15 -0
  365. package/dist/lib/esm/data-stores/data-store-locations.mjs +80 -22
  366. package/dist/lib/esm/data-stores/data-store-replica.mjs +33 -5
  367. package/dist/lib/esm/data-stores/data-store-seeds.d.mts +2 -2
  368. package/dist/lib/esm/data-stores/data-store-seeds.mjs +4 -4
  369. package/dist/lib/esm/data-stores/data-store-transport.d.mts +30 -1
  370. package/dist/lib/esm/data-stores/data-store-transport.mjs +78 -5
  371. package/dist/lib/esm/data-stores/local-data-store.d.mts +58 -1
  372. package/dist/lib/esm/data-stores/local-data-store.mjs +71 -9
  373. package/dist/lib/esm/data-stores/shared-data-store.d.mts +18 -1
  374. package/dist/lib/esm/data-stores/shared-data-store.mjs +72 -15
  375. package/dist/lib/esm/dataview.d.mts +14 -0
  376. package/dist/lib/esm/dataview.mjs +19 -1
  377. package/dist/lib/esm/demo-vault-helper.d.mts +6 -2
  378. package/dist/lib/esm/demo-vault-helper.mjs +29 -1
  379. package/dist/lib/esm/desktop-demo-vault-opener.mjs +1 -1
  380. package/dist/lib/esm/desktop-git-runner.d.mts +8 -2
  381. package/dist/lib/esm/desktop-git-runner.mjs +3 -3
  382. package/dist/lib/esm/desktop-request-url-stream.mjs +4 -10
  383. package/dist/lib/esm/disposable.d.mts +39 -0
  384. package/dist/lib/esm/disposable.mjs +64 -0
  385. package/dist/lib/esm/file-system.mjs +2 -2
  386. package/dist/lib/esm/frontmatter-formatting.mjs +2 -1
  387. package/dist/lib/esm/generated-during-build.mjs +2 -2
  388. package/dist/lib/esm/git-rename-history.d.mts +2 -2
  389. package/dist/lib/esm/git-rename-history.mjs +1 -1
  390. package/dist/lib/esm/i18n/locales/en.d.mts +26 -0
  391. package/dist/lib/esm/i18n/locales/en.mjs +27 -1
  392. package/dist/lib/esm/i18n/locales/translations-map.d.mts +26 -0
  393. package/dist/lib/esm/index.d.mts +7 -0
  394. package/dist/lib/esm/index.mjs +15 -1
  395. package/dist/lib/esm/link.d.mts +20 -14
  396. package/dist/lib/esm/link.mjs +57 -38
  397. package/dist/lib/esm/loop.mjs +2 -8
  398. package/dist/lib/esm/markdown-code-block-processor-registrar.d.mts +7 -0
  399. package/dist/lib/esm/markdown-code-block-processor-registrar.mjs +16 -1
  400. package/dist/lib/esm/markdown-view.d.mts +48 -1
  401. package/dist/lib/esm/markdown-view.mjs +192 -2
  402. package/dist/lib/esm/metadata-cache.d.mts +5 -4
  403. package/dist/lib/esm/metadata-cache.mjs +6 -6
  404. package/dist/lib/esm/misplaced-attachment.d.mts +228 -0
  405. package/dist/lib/esm/misplaced-attachment.mjs +212 -0
  406. package/dist/lib/esm/modals/copy-text-manually.d.mts +38 -0
  407. package/dist/lib/esm/modals/copy-text-manually.mjs +99 -0
  408. package/dist/lib/esm/modals/index.d.mts +2 -0
  409. package/dist/lib/esm/modals/index.mjs +5 -1
  410. package/dist/lib/esm/modals/prompt.d.mts +1 -1
  411. package/dist/lib/esm/modals/prompt.mjs +1 -1
  412. package/dist/lib/esm/modals/review-bug-report-diagnostics.d.mts +30 -0
  413. package/dist/lib/esm/modals/review-bug-report-diagnostics.mjs +120 -0
  414. package/dist/lib/esm/notebook-navigator.d.mts +6 -0
  415. package/dist/lib/esm/notebook-navigator.mjs +11 -2
  416. package/dist/lib/esm/parse-link.mjs +4 -4
  417. package/dist/lib/esm/path-compatibility.d.mts +263 -0
  418. package/dist/lib/esm/path-compatibility.mjs +277 -0
  419. package/dist/lib/esm/plugin/index.d.mts +2 -0
  420. package/dist/lib/esm/plugin/index.mjs +6 -2
  421. package/dist/lib/esm/plugin/plugin-api.d.mts +5 -1
  422. package/dist/lib/esm/plugin/plugin-api.mjs +13 -4
  423. package/dist/lib/esm/plugin/plugin-async-cleanup.d.mts +5 -0
  424. package/dist/lib/esm/plugin/plugin-async-cleanup.mjs +3 -1
  425. package/dist/lib/esm/plugin/plugin-context.mjs +2 -1
  426. package/dist/lib/esm/plugin/plugin-event-source.d.mts +4 -4
  427. package/dist/lib/esm/plugin/plugin-event-source.mjs +1 -1
  428. package/dist/lib/esm/plugin/plugin-install-state.d.mts +30 -0
  429. package/dist/lib/esm/plugin/plugin-install-state.mjs +44 -1
  430. package/dist/lib/esm/plugin/plugin-instance.d.mts +258 -0
  431. package/dist/lib/esm/plugin/plugin-instance.mjs +367 -0
  432. package/dist/lib/esm/plugin/plugin-lifecycle-events.d.mts +6 -4
  433. package/dist/lib/esm/plugin/plugin-lifecycle-events.mjs +1 -1
  434. package/dist/lib/esm/plugin/plugin.d.mts +35 -5
  435. package/dist/lib/esm/plugin/plugin.mjs +118 -9
  436. package/dist/lib/esm/plugin/third-party-plugin.d.mts +244 -0
  437. package/dist/lib/esm/plugin/third-party-plugin.mjs +147 -0
  438. package/dist/lib/esm/release-asset.mjs +1 -1
  439. package/dist/lib/esm/resource-lock.d.mts +8 -7
  440. package/dist/lib/esm/resource-lock.mjs +31 -26
  441. package/dist/lib/esm/setting-components/multiple-text-component.d.mts +4 -1
  442. package/dist/lib/esm/setting-components/multiple-text-component.mjs +6 -3
  443. package/dist/lib/esm/settings-recovery.d.mts +178 -0
  444. package/dist/lib/esm/settings-recovery.mjs +125 -0
  445. package/dist/lib/esm/settings-tabs.mjs +2 -2
  446. package/dist/lib/esm/templater.d.mts +6 -0
  447. package/dist/lib/esm/templater.mjs +11 -2
  448. package/dist/lib/esm/vault.mjs +1 -1
  449. package/dist/lib/esm/virtual-file.d.mts +2 -1
  450. package/dist/lib/esm/virtual-file.mjs +7 -5
  451. package/dist/lib/esm/wasm.d.mts +54 -0
  452. package/dist/lib/esm/wasm.mjs +30 -0
  453. package/dist/lib/esm/worker-protocol.d.mts +282 -0
  454. package/dist/lib/esm/worker-protocol.mjs +113 -0
  455. package/dist/styles.css +16 -1
  456. package/modals/copy-text-manually/package.json +6 -0
  457. package/modals/review-bug-report-diagnostics/package.json +6 -0
  458. package/package.json +10 -8
  459. package/plugin/plugin-instance/package.json +6 -0
  460. package/plugin/third-party-plugin/package.json +6 -0
@@ -0,0 +1,239 @@
1
+ /// <reference path="../library-references.d.mts" />
2
+ /**
3
+ * @file
4
+ *
5
+ * Keeps a plugin's layout-scoped state in the workspace layout itself, so each saved workspace remembers its own value
6
+ * and switching workspaces restores it, instead of one global value in `data.json`.
7
+ *
8
+ * Read from Obsidian `1.15.1`: `Workspace.getLayout()` builds a fresh object (`main`, `left`, `right`, `left-ribbon`,
9
+ * `floating`, `active`) and `Workspace.setLayout()` ignores every other top-level key. `deserializeLayout` keeps each
10
+ * item's `id`, popout leaves included. The Workspaces core plugin saves through `getLayout()` and loads through
11
+ * `changeLayout()`, which calls `setLayout()`. Startup goes through `loadLayout()`, `readWorkspaceFile()` and
12
+ * `setLayout()`, after the plugins enabled at startup have loaded. So two patches on the `app.workspace` instance carry
13
+ * the whole thing: `getLayout` writes the records under {@link WORKSPACE_LAYOUT_STATE_LAYOUT_KEY}, and `setLayout`
14
+ * replaces them from the layout it is handed before any view is restored. Per-leaf state is keyed by leaf id at the
15
+ * layout level, so no `WorkspaceItem.serialize` or `deserializeLayout` patch is needed.
16
+ *
17
+ * A view the plugin owns needs none of this: `View.getState` / `setState` already ride in each leaf's state. This
18
+ * component is for the scope those methods cannot represent: the whole layout, and leaves of views the plugin does not
19
+ * own.
20
+ *
21
+ * Every plugin bundles its own copy of this library, so the records, the subscriptions and ONE installation of the
22
+ * patches live in the shared-state bag under a versioned key, owned by one subscriber. When the owner unloads while
23
+ * others remain, the next subscriber installs again from its own copy. What crosses that boundary is a wire format
24
+ * between copies of different versions: plain objects and plain functions only, fields only ever added, and a change of
25
+ * meaning moves to a new key. The layout record is a wire format too, persisted in `workspace.json` and in every saved
26
+ * workspace.
27
+ */
28
+ import type { App, WorkspaceLeaf } from 'obsidian';
29
+ import type { JsonValue } from 'type-fest';
30
+ import { ComponentEx } from './component-ex.mjs';
31
+ /**
32
+ * The top-level key of a serialized layout that holds the records.
33
+ */
34
+ export declare const WORKSPACE_LAYOUT_STATE_LAYOUT_KEY = "obsidianLibLayoutStateV1";
35
+ /**
36
+ * A change of one key's value, in one scope.
37
+ *
38
+ * @typeParam T - The value type.
39
+ */
40
+ export interface WorkspaceLayoutStateChange<T> {
41
+ /**
42
+ * The leaf whose value changed, or `null` for the workspace scope or a leaf no longer in the layout.
43
+ */
44
+ readonly leaf: null | WorkspaceLeaf;
45
+ /**
46
+ * The id of the leaf whose value changed, or `null` for the workspace scope.
47
+ */
48
+ readonly leafId: null | string;
49
+ /**
50
+ * The value before the change, as {@link WorkspaceLayoutStateKey.get} read it.
51
+ */
52
+ readonly oldValue: T;
53
+ /**
54
+ * The value after the change, as {@link WorkspaceLayoutStateKey.get} reads it.
55
+ */
56
+ readonly value: T;
57
+ }
58
+ /**
59
+ * Parameters for {@link WorkspaceLayoutStateComponent}.
60
+ */
61
+ export interface WorkspaceLayoutStateComponentConstructorParams {
62
+ /**
63
+ * The Obsidian app instance.
64
+ */
65
+ readonly app: App;
66
+ /**
67
+ * The id of the plugin the values belong to. Every value is namespaced by it.
68
+ */
69
+ readonly pluginId: string;
70
+ }
71
+ /**
72
+ * A typed handle to one layout-scoped key.
73
+ *
74
+ * Every method takes an optional leaf. Without one, the value belongs to the whole layout (the workspace scope).
75
+ *
76
+ * @typeParam T - The value type.
77
+ */
78
+ export interface WorkspaceLayoutStateKey<T> {
79
+ /**
80
+ * Reads the value: a clone of the stored one, or of the default when nothing is stored or the stored value fails the
81
+ * key's guard.
82
+ *
83
+ * @param leaf - The leaf, or nothing for the workspace scope.
84
+ * @returns The value.
85
+ */
86
+ readonly get: (leaf?: WorkspaceLeaf) => T;
87
+ /**
88
+ * Checks whether a value is stored, valid or not.
89
+ *
90
+ * @param leaf - The leaf, or nothing for the workspace scope.
91
+ * @returns Whether a value is stored.
92
+ */
93
+ readonly has: (leaf?: WorkspaceLeaf) => boolean;
94
+ /**
95
+ * The key name, unique within the plugin.
96
+ */
97
+ readonly key: string;
98
+ /**
99
+ * Subscribes to changes of this key made through `set` or `unset`, in any scope and from any copy of the library. A
100
+ * layout load is reported through {@link WorkspaceLayoutStateComponent.onLayoutLoad} instead.
101
+ *
102
+ * @param callback - Called after each change.
103
+ * @returns A function that unsubscribes. Unloading the component unsubscribes too.
104
+ */
105
+ readonly onChange: (callback: (change: WorkspaceLayoutStateChange<T>) => void) => () => void;
106
+ /**
107
+ * Stores a clone of the value and requests a layout save. Storing a value equal to the stored one does nothing.
108
+ *
109
+ * @param value - The value. It must be JSON-safe; `null` is stored as `null`.
110
+ * @param leaf - The leaf, or nothing for the workspace scope.
111
+ * @throws A `TypeError` if the value is not JSON-safe.
112
+ */
113
+ readonly set: (value: T, leaf?: WorkspaceLeaf) => void;
114
+ /**
115
+ * Removes the stored value, so `get` reads the default again, and requests a layout save.
116
+ *
117
+ * @param leaf - The leaf, or nothing for the workspace scope.
118
+ */
119
+ readonly unset: (leaf?: WorkspaceLeaf) => void;
120
+ }
121
+ /**
122
+ * Defines a layout-scoped key.
123
+ *
124
+ * @typeParam T - The value type.
125
+ */
126
+ export interface WorkspaceLayoutStateKeyDefinition<T> {
127
+ /**
128
+ * The value read when nothing valid is stored.
129
+ */
130
+ readonly defaultValue: T;
131
+ /**
132
+ * Checks a stored value. A value that fails reads as the default and stays stored until it is replaced or unset.
133
+ *
134
+ * @default Accepts every JSON value.
135
+ */
136
+ readonly isValid?: (value: unknown) => value is T;
137
+ /**
138
+ * The key name, unique within the plugin.
139
+ */
140
+ readonly key: string;
141
+ }
142
+ /**
143
+ * One plugin's records. Fields a newer copy adds are preserved.
144
+ */
145
+ export interface WorkspaceLayoutStatePluginRecord {
146
+ /**
147
+ * The values by leaf id, then by key.
148
+ */
149
+ readonly leaves: Record<string, JsonRecord>;
150
+ /**
151
+ * Fields a newer copy of the library added.
152
+ */
153
+ readonly [field: string]: unknown;
154
+ /**
155
+ * The workspace-scope values by key.
156
+ */
157
+ readonly workspace: JsonRecord;
158
+ }
159
+ /**
160
+ * The record persisted under {@link WORKSPACE_LAYOUT_STATE_LAYOUT_KEY}. Fields a newer copy adds are preserved.
161
+ */
162
+ export interface WorkspaceLayoutStateRecord {
163
+ /**
164
+ * The records by plugin id.
165
+ */
166
+ readonly plugins: Record<string, WorkspaceLayoutStatePluginRecord>;
167
+ /**
168
+ * Fields a newer copy of the library added.
169
+ */
170
+ readonly [field: string]: unknown;
171
+ }
172
+ type JsonRecord = Record<string, JsonValue>;
173
+ /**
174
+ * Keeps a plugin's layout-scoped values in the workspace layout, so saved workspaces each restore their own.
175
+ *
176
+ * Any number of these, in any number of plugins, share one installation per {@link App}. Values are restored when a
177
+ * layout loads, which REPLACES every value: write them after {@link Workspace.onLayoutReady}, and re-read them in
178
+ * {@link onLayoutLoad}.
179
+ */
180
+ export declare class WorkspaceLayoutStateComponent extends ComponentEx {
181
+ /**
182
+ * The Obsidian app instance.
183
+ */
184
+ protected readonly app: App;
185
+ /**
186
+ * The id of the plugin the values belong to.
187
+ */
188
+ protected readonly pluginId: string;
189
+ private readonly layoutLoadListeners;
190
+ private readonly recordChangeListeners;
191
+ /**
192
+ * Creates a new workspace layout state component.
193
+ *
194
+ * @param params - The parameters.
195
+ * @throws A `TypeError` if the plugin id is empty.
196
+ */
197
+ constructor(params: WorkspaceLayoutStateComponentConstructorParams);
198
+ /**
199
+ * Defines a typed key.
200
+ *
201
+ * @typeParam T - The value type.
202
+ * @param definition - The key definition.
203
+ * @returns The key handle.
204
+ * @throws A `TypeError` if the key is empty or the default value is not JSON-safe.
205
+ */
206
+ defineKey<T>(definition: WorkspaceLayoutStateKeyDefinition<T>): WorkspaceLayoutStateKey<T>;
207
+ /**
208
+ * Subscribes to layout loads: a saved workspace loaded, the layout restored at startup, or the saved layout read when
209
+ * the component is first loaded after layout-ready. Every value may have changed.
210
+ *
211
+ * @param callback - Called after the layout is loaded, once its leaves exist.
212
+ * @returns A function that unsubscribes. Unloading the component unsubscribes too.
213
+ */
214
+ onLayoutLoad(callback: () => void): () => void;
215
+ /**
216
+ * Subscribes to the shared installation, installing it when nobody has yet.
217
+ */
218
+ onload(): void;
219
+ private subscribeToRecordChanges;
220
+ }
221
+ /**
222
+ * Parses a persisted record. A part that is malformed is dropped one level at a time: a malformed record reads as
223
+ * empty, a malformed plugin record drops only that plugin, and a malformed leaf bucket drops only that leaf. Fields this
224
+ * copy does not know are kept.
225
+ *
226
+ * @param value - The value found under {@link WORKSPACE_LAYOUT_STATE_LAYOUT_KEY}.
227
+ * @returns The parsed record, sharing nothing with the input.
228
+ */
229
+ export declare function parseWorkspaceLayoutStateRecord(value: unknown): WorkspaceLayoutStateRecord;
230
+ /**
231
+ * Builds the record to persist into a serialized layout: leaf buckets for leaves absent from the layout are left out,
232
+ * and so are plugins with nothing left.
233
+ *
234
+ * @param record - The current record.
235
+ * @param layout - The serialized layout.
236
+ * @returns The record to persist, or `null` when there is nothing to persist.
237
+ */
238
+ export declare function serializeWorkspaceLayoutStateRecord(record: WorkspaceLayoutStateRecord, layout: unknown): null | WorkspaceLayoutStateRecord;
239
+ export {};