@lapis-notes/api 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/LICENSE.md +4 -0
- package/README.md +43 -0
- package/dist/__tests__/data-adapter-conformance.js +205 -0
- package/dist/__tests__/lapis-runtime-manifest.js +32 -0
- package/dist/__tests__/svelte-internal-client.d.ts +3 -0
- package/dist/agent-result-views.d.ts +52 -0
- package/dist/agent-result-views.js +89 -0
- package/dist/agent-skills.d.ts +99 -0
- package/dist/agent-skills.js +182 -0
- package/dist/agent-tools.d.ts +92 -0
- package/dist/agent-tools.js +139 -0
- package/dist/app-database-host.d.ts +4 -0
- package/dist/app-database-host.js +4 -0
- package/dist/app-shell-plugin-persistence.d.ts +15 -0
- package/dist/app-shell-plugin-persistence.js +34 -0
- package/dist/app-url.d.ts +54 -0
- package/dist/app-url.js +269 -0
- package/dist/application-compatibility.d.ts +31 -0
- package/dist/application-compatibility.js +64 -0
- package/dist/application-state.svelte.d.ts +14 -0
- package/dist/application-state.svelte.js +30 -0
- package/dist/assets/lapis-logo.svg +471 -0
- package/dist/bases.d.ts +281 -0
- package/dist/bases.js +475 -0
- package/dist/cache.svelte.d.ts +569 -0
- package/dist/cache.svelte.js +1433 -0
- package/dist/command.svelte.d.ts +337 -0
- package/dist/command.svelte.js +571 -0
- package/dist/compat.d.ts +29 -0
- package/dist/compat.js +30 -0
- package/dist/components/configuration/configuration.css +199 -0
- package/dist/components/configuration/date-setting.svelte +71 -0
- package/dist/components/configuration/date-setting.svelte.d.ts +8 -0
- package/dist/components/configuration/list-setting.svelte +128 -0
- package/dist/components/configuration/list-setting.svelte.d.ts +13 -0
- package/dist/components/configuration/object-array-row-grip.svelte +78 -0
- package/dist/components/configuration/object-array-row-grip.svelte.d.ts +9 -0
- package/dist/components/configuration/object-array-row.svelte +163 -0
- package/dist/components/configuration/object-array-row.svelte.d.ts +19 -0
- package/dist/components/configuration/object-array-setting.svelte +196 -0
- package/dist/components/configuration/object-array-setting.svelte.d.ts +15 -0
- package/dist/components/configuration/object-array-table-dnd.d.ts +8 -0
- package/dist/components/configuration/object-array-table-dnd.js +10 -0
- package/dist/components/configuration/object-array-utils.d.ts +11 -0
- package/dist/components/configuration/object-array-utils.js +103 -0
- package/dist/components/configuration/object-grid-setting.svelte +79 -0
- package/dist/components/configuration/object-grid-setting.svelte.d.ts +10 -0
- package/dist/components/configuration/object-map-row.svelte +147 -0
- package/dist/components/configuration/object-map-row.svelte.d.ts +15 -0
- package/dist/components/configuration/object-map-setting.svelte +137 -0
- package/dist/components/configuration/object-map-setting.svelte.d.ts +14 -0
- package/dist/components/configuration/object-map-types.d.ts +5 -0
- package/dist/components/configuration/object-map-types.js +1 -0
- package/dist/components/configuration/options-combobox-setting.svelte +129 -0
- package/dist/components/configuration/options-combobox-setting.svelte.d.ts +12 -0
- package/dist/components/copy-button/button.svelte +93 -0
- package/dist/components/copy-button/button.svelte.d.ts +13 -0
- package/dist/components/copy-button/index.d.ts +2 -0
- package/dist/components/copy-button/index.js +2 -0
- package/dist/components/editor/editor.css +565 -0
- package/dist/components/editor/editor.d.ts +33 -0
- package/dist/components/editor/editor.js +132 -0
- package/dist/components/editor/editor.svelte +176 -0
- package/dist/components/editor/editor.svelte.d.ts +15 -0
- package/dist/components/editor/embedded-editor-surface.d.ts +12 -0
- package/dist/components/editor/embedded-editor-surface.js +22 -0
- package/dist/components/editor/embedded-editor-surface.svelte +115 -0
- package/dist/components/editor/embedded-editor-surface.svelte.d.ts +17 -0
- package/dist/components/editor/extensions/autocomplete/index.d.ts +2 -0
- package/dist/components/editor/extensions/autocomplete/index.js +2 -0
- package/dist/components/editor/extensions/autocomplete/lapis-code-mirror-autocomplete.d.ts +16 -0
- package/dist/components/editor/extensions/autocomplete/lapis-code-mirror-autocomplete.js +34 -0
- package/dist/components/editor/extensions/autocomplete/vault-completion-sources.d.ts +27 -0
- package/dist/components/editor/extensions/autocomplete/vault-completion-sources.js +55 -0
- package/dist/components/editor/extensions/class-highlighter/index.d.ts +1 -0
- package/dist/components/editor/extensions/class-highlighter/index.js +47 -0
- package/dist/components/editor/extensions/fold-gutter/index.d.ts +8 -0
- package/dist/components/editor/extensions/fold-gutter/index.js +40 -0
- package/dist/components/editor/extensions/gutter-line-style-sync/index.d.ts +2 -0
- package/dist/components/editor/extensions/gutter-line-style-sync/index.js +118 -0
- package/dist/components/editor/extensions/lint/index.d.ts +4 -0
- package/dist/components/editor/extensions/lint/index.js +4 -0
- package/dist/components/editor/extensions/lint/lapis-code-mirror-lint.d.ts +26 -0
- package/dist/components/editor/extensions/lint/lapis-code-mirror-lint.js +101 -0
- package/dist/components/editor/extensions/lint/lapis-lint-diagnostic-helpers.d.ts +8 -0
- package/dist/components/editor/extensions/lint/lapis-lint-diagnostic-helpers.js +7 -0
- package/dist/components/editor/extensions/lint/lapis-lint-diagnostic.d.ts +20 -0
- package/dist/components/editor/extensions/lint/lapis-lint-diagnostic.js +47 -0
- package/dist/components/editor/extensions/lint/lapis-lint-hover-tooltip.d.ts +9 -0
- package/dist/components/editor/extensions/lint/lapis-lint-hover-tooltip.js +373 -0
- package/dist/components/editor/extensions/lint/lapis-lint-inline-widget.d.ts +31 -0
- package/dist/components/editor/extensions/lint/lapis-lint-inline-widget.js +191 -0
- package/dist/components/editor/extensions/lint/lapis-lint-tooltip.svelte +176 -0
- package/dist/components/editor/extensions/lint/lapis-lint-tooltip.svelte.d.ts +15 -0
- package/dist/components/editor/extensions/lint/lint-tooltip-actions.d.ts +11 -0
- package/dist/components/editor/extensions/lint/lint-tooltip-actions.js +21 -0
- package/dist/components/editor/extensions/lint/mount-lint-tooltip.d.ts +16 -0
- package/dist/components/editor/extensions/lint/mount-lint-tooltip.js +60 -0
- package/dist/components/editor/extensions/search/dom.d.ts +2 -0
- package/dist/components/editor/extensions/search/dom.js +6 -0
- package/dist/components/editor/extensions/search/index.d.ts +35 -0
- package/dist/components/editor/extensions/search/index.js +44 -0
- package/dist/components/editor/extensions/search/search.svelte +335 -0
- package/dist/components/editor/extensions/search/search.svelte.d.ts +8 -0
- package/dist/components/editor/index.d.ts +9 -0
- package/dist/components/editor/index.js +9 -0
- package/dist/components/editor/language-service/dom.d.ts +1 -0
- package/dist/components/editor/language-service/dom.js +6 -0
- package/dist/components/editor/language-service/index.d.ts +28 -0
- package/dist/components/editor/language-service/index.js +342 -0
- package/dist/components/empty-view/empty-view.css +39 -0
- package/dist/components/empty-view/empty-view.svelte +26 -0
- package/dist/components/empty-view/empty-view.svelte.d.ts +9 -0
- package/dist/components/empty-view/index.d.ts +2 -0
- package/dist/components/empty-view/index.js +2 -0
- package/dist/components/icon/icon-list.css +74 -0
- package/dist/components/icon/icon-list.svelte +213 -0
- package/dist/components/icon/icon-list.svelte.d.ts +11 -0
- package/dist/components/icon/icon.svelte +15 -0
- package/dist/components/icon/icon.svelte.d.ts +7 -0
- package/dist/components/icon/index.d.ts +3 -0
- package/dist/components/icon/index.js +3 -0
- package/dist/components/menu/context-menu.svelte +89 -0
- package/dist/components/menu/context-menu.svelte.d.ts +11 -0
- package/dist/components/menu/drawer-menu.svelte +83 -0
- package/dist/components/menu/drawer-menu.svelte.d.ts +8 -0
- package/dist/components/menu/dropdown-menu.svelte +89 -0
- package/dist/components/menu/dropdown-menu.svelte.d.ts +11 -0
- package/dist/components/menu/index.d.ts +6 -0
- package/dist/components/menu/index.js +6 -0
- package/dist/components/menu/menu.css +139 -0
- package/dist/components/menu/menu.svelte +37 -0
- package/dist/components/menu/menu.svelte.d.ts +11 -0
- package/dist/components/menu/mobile-menu-query.svelte.d.ts +3 -0
- package/dist/components/menu/mobile-menu-query.svelte.js +21 -0
- package/dist/components/menu/popover-menu.svelte +90 -0
- package/dist/components/menu/popover-menu.svelte.d.ts +10 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/index.js +2 -0
- package/dist/components/select/select.svelte +72 -0
- package/dist/components/select/select.svelte.d.ts +25 -0
- package/dist/configuration-option-source-providers.d.ts +17 -0
- package/dist/configuration-option-source-providers.js +59 -0
- package/dist/configuration-option-source-registry.d.ts +59 -0
- package/dist/configuration-option-source-registry.js +123 -0
- package/dist/configuration.svelte.d.ts +258 -0
- package/dist/configuration.svelte.js +887 -0
- package/dist/context-keys.svelte.d.ts +42 -0
- package/dist/context-keys.svelte.js +278 -0
- package/dist/context.svelte.d.ts +247 -0
- package/dist/context.svelte.js +540 -0
- package/dist/daily-document-provider.d.ts +38 -0
- package/dist/daily-document-provider.js +176 -0
- package/dist/design-core-button-types.d.ts +7 -0
- package/dist/design-core-button-types.js +1 -0
- package/dist/diagnostics.d.ts +93 -0
- package/dist/diagnostics.js +84 -0
- package/dist/dialog-portal.d.ts +3 -0
- package/dist/dialog-portal.js +3 -0
- package/dist/docs-api.d.ts +44 -0
- package/dist/docs-api.js +29 -0
- package/dist/editor-view-registry.d.ts +35 -0
- package/dist/editor-view-registry.js +112 -0
- package/dist/editor.svelte.d.ts +126 -0
- package/dist/editor.svelte.js +454 -0
- package/dist/embed-registry.d.ts +15 -0
- package/dist/embed-registry.js +16 -0
- package/dist/enhance.d.ts +111 -0
- package/dist/enhance.js +309 -0
- package/dist/events.d.ts +28 -0
- package/dist/events.js +49 -0
- package/dist/file-manager.d.ts +90 -0
- package/dist/file-manager.js +289 -0
- package/dist/file-tools/app-tools.d.ts +3 -0
- package/dist/file-tools/app-tools.js +242 -0
- package/dist/file-tools/index.d.ts +3 -0
- package/dist/file-tools/index.js +3 -0
- package/dist/file-tools/paths.d.ts +14 -0
- package/dist/file-tools/paths.js +33 -0
- package/dist/file-tools/vault-operations.d.ts +3 -0
- package/dist/file-tools/vault-operations.js +60 -0
- package/dist/generated/plugin-host-modules.schema.generated.d.ts +371 -0
- package/dist/generated/plugin-host-modules.schema.generated.js +374 -0
- package/dist/glob.d.ts +15 -0
- package/dist/glob.js +68 -0
- package/dist/history.svelte.d.ts +24 -0
- package/dist/history.svelte.js +74 -0
- package/dist/hooks/createVirtualizer.svelte.d.ts +7 -0
- package/dist/hooks/createVirtualizer.svelte.js +70 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/index.js +5 -0
- package/dist/hooks/is-mobile.svelte.d.ts +5 -0
- package/dist/hooks/is-mobile.svelte.js +23 -0
- package/dist/hooks/mountComponent.svelte.d.ts +7 -0
- package/dist/hooks/mountComponent.svelte.js +16 -0
- package/dist/hooks/use-text-highlight.d.ts +17 -0
- package/dist/hooks/use-text-highlight.js +82 -0
- package/dist/hooks/useBoundingRect.svelte.d.ts +11 -0
- package/dist/hooks/useBoundingRect.svelte.js +46 -0
- package/dist/icons/index.d.ts +57 -0
- package/dist/icons/index.js +288 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.js +87 -0
- package/dist/language-service/index.d.ts +9 -0
- package/dist/language-service/index.js +7 -0
- package/dist/language-service/manager.d.ts +47 -0
- package/dist/language-service/manager.js +404 -0
- package/dist/language-service/types.d.ts +92 -0
- package/dist/language-service/types.js +1 -0
- package/dist/language-service/virtual-document.d.ts +11 -0
- package/dist/language-service/virtual-document.js +45 -0
- package/dist/language-service/worker-protocol.d.ts +63 -0
- package/dist/language-service/worker-protocol.js +1 -0
- package/dist/language-service/worker-provider.d.ts +9 -0
- package/dist/language-service/worker-provider.js +38 -0
- package/dist/lapis-extension.d.ts +244 -0
- package/dist/lapis-extension.js +591 -0
- package/dist/links.d.ts +34 -0
- package/dist/links.js +191 -0
- package/dist/loaders.d.ts +9 -0
- package/dist/loaders.js +59 -0
- package/dist/localization-manager.svelte.d.ts +56 -0
- package/dist/localization-manager.svelte.js +157 -0
- package/dist/logging.d.ts +172 -0
- package/dist/logging.js +352 -0
- package/dist/markdown-extension-registry.d.ts +31 -0
- package/dist/markdown-extension-registry.js +31 -0
- package/dist/markdown-file-surface-registry.d.ts +25 -0
- package/dist/markdown-file-surface-registry.js +23 -0
- package/dist/markdown.d.ts +205 -0
- package/dist/markdown.js +147 -0
- package/dist/menu-utils.d.ts +1 -0
- package/dist/menu-utils.js +47 -0
- package/dist/menu.svelte.d.ts +121 -0
- package/dist/menu.svelte.js +295 -0
- package/dist/metadata-value.d.ts +10 -0
- package/dist/metadata-value.js +173 -0
- package/dist/metadata.svelte.d.ts +106 -0
- package/dist/metadata.svelte.js +608 -0
- package/dist/notifications.d.ts +209 -0
- package/dist/notifications.js +338 -0
- package/dist/open-file.d.ts +23 -0
- package/dist/open-file.js +102 -0
- package/dist/platform.d.ts +86 -0
- package/dist/platform.js +86 -0
- package/dist/plugin-asset-server.d.ts +60 -0
- package/dist/plugin-asset-server.js +222 -0
- package/dist/plugin-assets.d.ts +4 -0
- package/dist/plugin-assets.js +3 -0
- package/dist/plugin-capability-facade.d.ts +104 -0
- package/dist/plugin-capability-facade.js +61 -0
- package/dist/plugin-dependency-resolver.d.ts +36 -0
- package/dist/plugin-dependency-resolver.js +54 -0
- package/dist/plugin-dependency-scanner.d.ts +9 -0
- package/dist/plugin-dependency-scanner.js +274 -0
- package/dist/plugin-distribution/canonical-json.d.ts +1 -0
- package/dist/plugin-distribution/canonical-json.js +40 -0
- package/dist/plugin-distribution/compatibility.d.ts +5 -0
- package/dist/plugin-distribution/compatibility.js +38 -0
- package/dist/plugin-distribution/errors.d.ts +11 -0
- package/dist/plugin-distribution/errors.js +13 -0
- package/dist/plugin-distribution/hashes.d.ts +2 -0
- package/dist/plugin-distribution/hashes.js +17 -0
- package/dist/plugin-distribution/index.d.ts +18 -0
- package/dist/plugin-distribution/index.js +18 -0
- package/dist/plugin-distribution/installed-plugin-state.d.ts +20 -0
- package/dist/plugin-distribution/installed-plugin-state.js +73 -0
- package/dist/plugin-distribution/installer.d.ts +89 -0
- package/dist/plugin-distribution/installer.js +395 -0
- package/dist/plugin-distribution/manager.d.ts +128 -0
- package/dist/plugin-distribution/manager.js +358 -0
- package/dist/plugin-distribution/path-safety.d.ts +2 -0
- package/dist/plugin-distribution/path-safety.js +20 -0
- package/dist/plugin-distribution/plugin-bundle-verifier.d.ts +28 -0
- package/dist/plugin-distribution/plugin-bundle-verifier.js +96 -0
- package/dist/plugin-distribution/plugin-bundle-worker.d.ts +34 -0
- package/dist/plugin-distribution/plugin-bundle-worker.js +99 -0
- package/dist/plugin-distribution/plugin-bundle.d.ts +16 -0
- package/dist/plugin-distribution/plugin-bundle.js +244 -0
- package/dist/plugin-distribution/plugin-bundle.worker.d.ts +1 -0
- package/dist/plugin-distribution/plugin-bundle.worker.js +38 -0
- package/dist/plugin-distribution/registry-cache.d.ts +26 -0
- package/dist/plugin-distribution/registry-cache.js +85 -0
- package/dist/plugin-distribution/registry-client.d.ts +36 -0
- package/dist/plugin-distribution/registry-client.js +115 -0
- package/dist/plugin-distribution/reserved-ids.d.ts +4 -0
- package/dist/plugin-distribution/reserved-ids.js +10 -0
- package/dist/plugin-distribution/runtime-validation.d.ts +14 -0
- package/dist/plugin-distribution/runtime-validation.js +388 -0
- package/dist/plugin-distribution/schemas.d.ts +4895 -0
- package/dist/plugin-distribution/schemas.js +299 -0
- package/dist/plugin-distribution/signing.d.ts +5 -0
- package/dist/plugin-distribution/signing.js +38 -0
- package/dist/plugin-distribution/types.d.ts +217 -0
- package/dist/plugin-distribution/types.js +1 -0
- package/dist/plugin-install-progress.d.ts +15 -0
- package/dist/plugin-install-progress.js +86 -0
- package/dist/plugin-manager.d.ts +306 -0
- package/dist/plugin-manager.js +2848 -0
- package/dist/plugin-runtime-entry.d.ts +19 -0
- package/dist/plugin-runtime-entry.js +135 -0
- package/dist/plugin.d.ts +350 -0
- package/dist/plugin.js +754 -0
- package/dist/popover.d.ts +20 -0
- package/dist/popover.js +32 -0
- package/dist/promise-worker.d.ts +22 -0
- package/dist/promise-worker.js +65 -0
- package/dist/prompt-confirm.d.ts +9 -0
- package/dist/prompt-confirm.js +33 -0
- package/dist/search-document-provider.d.ts +45 -0
- package/dist/search-document-provider.js +54 -0
- package/dist/search-query/index.d.ts +78 -0
- package/dist/search-query/index.js +426 -0
- package/dist/search-query/parser.d.ts +3 -0
- package/dist/search-query/parser.js +16 -0
- package/dist/search-query/parser.terms.js +26 -0
- package/dist/search-query/search-query.grammar +128 -0
- package/dist/search.d.ts +19 -0
- package/dist/search.js +104 -0
- package/dist/setting-section-layout.d.ts +19 -0
- package/dist/setting-section-layout.js +194 -0
- package/dist/settings.svelte.d.ts +474 -0
- package/dist/settings.svelte.js +1421 -0
- package/dist/source-text-file-view.d.ts +25 -0
- package/dist/source-text-file-view.js +78 -0
- package/dist/status-bar.svelte.d.ts +29 -0
- package/dist/status-bar.svelte.js +72 -0
- package/dist/storage/app-database.d.ts +860 -0
- package/dist/storage/app-database.js +2372 -0
- package/dist/storage/blob-store.d.ts +12 -0
- package/dist/storage/blob-store.js +1 -0
- package/dist/storage/browser-app-database-coordination.d.ts +35 -0
- package/dist/storage/browser-app-database-coordination.js +207 -0
- package/dist/storage/browser-coordinated-app-database.d.ts +109 -0
- package/dist/storage/browser-coordinated-app-database.js +704 -0
- package/dist/storage/browser.d.ts +153 -0
- package/dist/storage/browser.js +794 -0
- package/dist/storage/desktop-native.d.ts +184 -0
- package/dist/storage/desktop-native.js +415 -0
- package/dist/storage/fs.d.ts +188 -0
- package/dist/storage/fs.js +307 -0
- package/dist/storage/index-projection.d.ts +236 -0
- package/dist/storage/index-projection.js +402 -0
- package/dist/storage/index.d.ts +17 -0
- package/dist/storage/index.js +17 -0
- package/dist/storage/keyval.d.ts +94 -0
- package/dist/storage/keyval.js +199 -0
- package/dist/storage/memory-vault-adapter.d.ts +44 -0
- package/dist/storage/memory-vault-adapter.js +351 -0
- package/dist/storage/native-vault-bootstrap-kv.d.ts +22 -0
- package/dist/storage/native-vault-bootstrap-kv.js +96 -0
- package/dist/storage/path.d.ts +22 -0
- package/dist/storage/path.js +110 -0
- package/dist/storage/search-embedding-provider.d.ts +75 -0
- package/dist/storage/search-embedding-provider.js +446 -0
- package/dist/storage/search-embedding-worker.d.ts +1 -0
- package/dist/storage/search-embedding-worker.js +63 -0
- package/dist/storage/search-query-evaluator.d.ts +14 -0
- package/dist/storage/search-query-evaluator.js +678 -0
- package/dist/storage/task-projection.d.ts +152 -0
- package/dist/storage/task-projection.js +154 -0
- package/dist/storage/turso-app-database.d.ts +150 -0
- package/dist/storage/turso-app-database.js +2671 -0
- package/dist/storage/vault-session.d.ts +37 -0
- package/dist/storage/vault-session.js +196 -0
- package/dist/storage/vault-state.d.ts +74 -0
- package/dist/storage/vault-state.js +181 -0
- package/dist/storage/vault.svelte.d.ts +257 -0
- package/dist/storage/vault.svelte.js +661 -0
- package/dist/suggest.d.ts +193 -0
- package/dist/suggest.js +391 -0
- package/dist/tasks.d.ts +7 -0
- package/dist/tasks.js +18 -0
- package/dist/telemetry.d.ts +116 -0
- package/dist/telemetry.js +103 -0
- package/dist/utils.d.ts +55 -0
- package/dist/utils.js +314 -0
- package/dist/vault-api.d.ts +5 -0
- package/dist/vault-api.js +3 -0
- package/dist/vault-maintenance-commands.d.ts +5 -0
- package/dist/vault-maintenance-commands.js +32 -0
- package/dist/view.svelte.d.ts +215 -0
- package/dist/view.svelte.js +381 -0
- package/dist/vite-env.d.ts +2 -0
- package/dist/workspace-host-internal.d.ts +7 -0
- package/dist/workspace-host-internal.js +7 -0
- package/dist/workspace-host.d.ts +10 -0
- package/dist/workspace-host.js +14 -0
- package/dist/workspace-layout-commands.d.ts +3 -0
- package/dist/workspace-layout-commands.js +72 -0
- package/dist/workspace-layout-normalizer.d.ts +92 -0
- package/dist/workspace-layout-normalizer.js +301 -0
- package/dist/workspace-layouts.d.ts +7 -0
- package/dist/workspace-layouts.js +23 -0
- package/dist/workspace-trust.d.ts +32 -0
- package/dist/workspace-trust.js +72 -0
- package/dist/workspace.svelte.d.ts +796 -0
- package/dist/workspace.svelte.js +4380 -0
- package/package.json +240 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { DateTime } from "luxon";
|
|
2
|
+
import { EventDispatcher } from "./events";
|
|
3
|
+
import { parseYaml } from "./utils";
|
|
4
|
+
export const DEFAULT_DAILY_NOTES_FOLDER = "daily";
|
|
5
|
+
export const DEFAULT_DAILY_NOTES_DATE_FORMAT = "yyyy-MM-dd";
|
|
6
|
+
function validateProvider(provider) {
|
|
7
|
+
if (!provider.id.trim()) {
|
|
8
|
+
throw new Error("Daily document provider id must not be empty.");
|
|
9
|
+
}
|
|
10
|
+
if (!Number.isFinite(provider.priority ?? 0)) {
|
|
11
|
+
throw new Error(`Daily document provider ${provider.id} must use a finite priority.`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/** Public registry for the host-owned daily Markdown document policy. */
|
|
15
|
+
export class DailyDocumentProviderRegistry extends EventDispatcher {
|
|
16
|
+
providers = new Map();
|
|
17
|
+
register(provider) {
|
|
18
|
+
validateProvider(provider);
|
|
19
|
+
const id = provider.id.trim();
|
|
20
|
+
if (this.providers.has(id)) {
|
|
21
|
+
throw new Error(`Daily document provider already registered: ${id}`);
|
|
22
|
+
}
|
|
23
|
+
const registered = { ...provider, id };
|
|
24
|
+
this.providers.set(id, registered);
|
|
25
|
+
this.emit("changed", { providerId: id, reason: "registered" });
|
|
26
|
+
let disposed = false;
|
|
27
|
+
return {
|
|
28
|
+
id,
|
|
29
|
+
dispose: () => {
|
|
30
|
+
if (disposed)
|
|
31
|
+
return;
|
|
32
|
+
disposed = true;
|
|
33
|
+
if (this.providers.get(id) !== registered)
|
|
34
|
+
return;
|
|
35
|
+
this.providers.delete(id);
|
|
36
|
+
this.emit("changed", { providerId: id, reason: "unregistered" });
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
getAll() {
|
|
41
|
+
return [...this.providers.values()];
|
|
42
|
+
}
|
|
43
|
+
resolve() {
|
|
44
|
+
const providers = this.getAll().sort((left, right) => (right.priority ?? 0) - (left.priority ?? 0) ||
|
|
45
|
+
left.id.localeCompare(right.id));
|
|
46
|
+
const selected = providers[0];
|
|
47
|
+
if (!selected) {
|
|
48
|
+
throw new Error("No daily document provider is registered.");
|
|
49
|
+
}
|
|
50
|
+
const conflicting = providers[1];
|
|
51
|
+
if (conflicting &&
|
|
52
|
+
(conflicting.priority ?? 0) === (selected.priority ?? 0)) {
|
|
53
|
+
throw new Error(`Ambiguous daily document providers: ${selected.id}, ${conflicting.id}`);
|
|
54
|
+
}
|
|
55
|
+
return selected;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const DAILY_NOTES_CONFIGURATION_SCHEMA = {
|
|
59
|
+
id: "dailyNotes",
|
|
60
|
+
title: "Daily notes",
|
|
61
|
+
type: "object",
|
|
62
|
+
properties: {
|
|
63
|
+
folder: {
|
|
64
|
+
type: "string",
|
|
65
|
+
default: DEFAULT_DAILY_NOTES_FOLDER,
|
|
66
|
+
title: "Folder",
|
|
67
|
+
description: "Vault folder used when a daily note must be created.",
|
|
68
|
+
},
|
|
69
|
+
dateFormat: {
|
|
70
|
+
type: "string",
|
|
71
|
+
default: DEFAULT_DAILY_NOTES_DATE_FORMAT,
|
|
72
|
+
title: "Filename date format",
|
|
73
|
+
description: "Luxon date format used for new daily-note filenames. It must produce one safe filename segment.",
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
function assertLocalDate(date) {
|
|
78
|
+
const parsed = DateTime.fromISO(date, { zone: "utc", setZone: true });
|
|
79
|
+
if (!/^\d{4}-\d{2}-\d{2}$/u.test(date) || !parsed.isValid) {
|
|
80
|
+
throw new Error(`Invalid local date: ${date}`);
|
|
81
|
+
}
|
|
82
|
+
return parsed;
|
|
83
|
+
}
|
|
84
|
+
export function formatDailyDocumentFilename(date, format) {
|
|
85
|
+
const trimmedFormat = format.trim();
|
|
86
|
+
if (!trimmedFormat) {
|
|
87
|
+
throw new Error("Daily-note date format must not be empty.");
|
|
88
|
+
}
|
|
89
|
+
const formatted = assertLocalDate(date).toFormat(trimmedFormat);
|
|
90
|
+
if (!formatted ||
|
|
91
|
+
formatted === "." ||
|
|
92
|
+
formatted === ".." ||
|
|
93
|
+
/[/\\\u0000-\u001f:]/u.test(formatted)) {
|
|
94
|
+
throw new Error(`Daily-note date format must produce one safe filename segment; received ${JSON.stringify(formatted)}.`);
|
|
95
|
+
}
|
|
96
|
+
return `${formatted}.md`;
|
|
97
|
+
}
|
|
98
|
+
function normalizeDailyNotesFolder(folder) {
|
|
99
|
+
const normalized = folder
|
|
100
|
+
.trim()
|
|
101
|
+
.replaceAll("\\", "/")
|
|
102
|
+
.replace(/^\/+|\/+$/gu, "");
|
|
103
|
+
if (!normalized ||
|
|
104
|
+
normalized
|
|
105
|
+
.split("/")
|
|
106
|
+
.some((segment) => !segment || segment === "." || segment === "..") ||
|
|
107
|
+
/[\u0000-\u001f:]/u.test(normalized)) {
|
|
108
|
+
throw new Error(`Invalid daily-note folder: ${JSON.stringify(folder)}.`);
|
|
109
|
+
}
|
|
110
|
+
return normalized;
|
|
111
|
+
}
|
|
112
|
+
function frontmatterFromContent(content) {
|
|
113
|
+
const match = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(content);
|
|
114
|
+
return match ? parseYaml(match[1]) : null;
|
|
115
|
+
}
|
|
116
|
+
async function dailyFrontmatter(app, file) {
|
|
117
|
+
const cached = (await app.metadataCache.getFileCacheAsync(file))?.frontmatter;
|
|
118
|
+
if (cached)
|
|
119
|
+
return cached;
|
|
120
|
+
return frontmatterFromContent(await app.vault.read(file));
|
|
121
|
+
}
|
|
122
|
+
function isCanonicalDailyFrontmatter(frontmatter, date) {
|
|
123
|
+
return frontmatter?.type === "daily-note" && frontmatter.date === date;
|
|
124
|
+
}
|
|
125
|
+
function dailyDocumentContent(date) {
|
|
126
|
+
return `---\ntype: daily-note\ndate: ${date}\n---\n\n# ${date}\n`;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Install Lapis' default daily-note policy and its generated settings controls.
|
|
130
|
+
* Hosts call this before loading configuration and dispose it with the App.
|
|
131
|
+
*/
|
|
132
|
+
export function registerDefaultDailyDocumentProvider(app) {
|
|
133
|
+
app.configuration.schema.register(DAILY_NOTES_CONFIGURATION_SCHEMA);
|
|
134
|
+
const locate = async (date) => {
|
|
135
|
+
assertLocalDate(date);
|
|
136
|
+
const matches = [];
|
|
137
|
+
for (const file of app.vault.getMarkdownFiles()) {
|
|
138
|
+
if (isCanonicalDailyFrontmatter(await dailyFrontmatter(app, file), date)) {
|
|
139
|
+
matches.push(file);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (matches.length > 1) {
|
|
143
|
+
throw new Error(`Multiple daily notes declare date ${date}: ${matches.map((file) => file.path).join(", ")}`);
|
|
144
|
+
}
|
|
145
|
+
return matches[0] ?? null;
|
|
146
|
+
};
|
|
147
|
+
const registration = app.dailyDocumentProviders.register({
|
|
148
|
+
id: "lapis:daily-notes",
|
|
149
|
+
locate,
|
|
150
|
+
ensure: async (date) => {
|
|
151
|
+
const existing = await locate(date);
|
|
152
|
+
if (existing)
|
|
153
|
+
return existing;
|
|
154
|
+
const configuration = app.configuration.getConfiguration();
|
|
155
|
+
const folder = normalizeDailyNotesFolder(configuration.get("dailyNotes.folder", DEFAULT_DAILY_NOTES_FOLDER));
|
|
156
|
+
const filename = formatDailyDocumentFilename(date, configuration.get("dailyNotes.dateFormat", DEFAULT_DAILY_NOTES_DATE_FORMAT));
|
|
157
|
+
const path = `${folder}/${filename}`;
|
|
158
|
+
const occupied = app.vault.getFileByPath(path);
|
|
159
|
+
if (occupied) {
|
|
160
|
+
const frontmatter = await dailyFrontmatter(app, occupied);
|
|
161
|
+
if (isCanonicalDailyFrontmatter(frontmatter, date))
|
|
162
|
+
return occupied;
|
|
163
|
+
throw new Error(`Cannot create daily note for ${date}: ${path} already exists without matching daily-note front matter.`);
|
|
164
|
+
}
|
|
165
|
+
await app.vault.mkpath(folder);
|
|
166
|
+
return app.vault.create(path, dailyDocumentContent(date));
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
return {
|
|
170
|
+
id: registration.id,
|
|
171
|
+
dispose: () => {
|
|
172
|
+
registration.dispose();
|
|
173
|
+
app.configuration.schema.unregister(DAILY_NOTES_CONFIGURATION_SCHEMA);
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mirror of `@lapismd/design-core/shadcn/button` public variant/size unions.
|
|
3
|
+
* Kept as a plain .ts module so `tsc --noEmit` does not need to parse
|
|
4
|
+
* design-core's `<script module>` exports from `button.svelte`.
|
|
5
|
+
*/
|
|
6
|
+
export type ButtonVariant = "default" | "outline" | "secondary" | "ghost" | "destructive" | "link";
|
|
7
|
+
export type ButtonSize = "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { WorkspaceDiagnosticsManager as DesignDiagnosticsManager } from "@lapismd/design-core/workspace/problems";
|
|
2
|
+
import type { WorkspaceMenu } from "@lapismd/design-core/workspace/core";
|
|
3
|
+
import type { Menu } from "./menu.svelte";
|
|
4
|
+
export type DiagnosticSeverity = "error" | "warning" | "information" | "hint";
|
|
5
|
+
export interface DiagnosticPosition {
|
|
6
|
+
line: number;
|
|
7
|
+
character: number;
|
|
8
|
+
}
|
|
9
|
+
export interface DiagnosticRange {
|
|
10
|
+
start: DiagnosticPosition;
|
|
11
|
+
end: DiagnosticPosition;
|
|
12
|
+
}
|
|
13
|
+
export type DiagnosticTag = "unnecessary" | "deprecated";
|
|
14
|
+
export interface DiagnosticResource {
|
|
15
|
+
uri: string;
|
|
16
|
+
label?: string;
|
|
17
|
+
detail?: string;
|
|
18
|
+
icon?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface DiagnosticRelatedInformation {
|
|
21
|
+
resource: DiagnosticResource;
|
|
22
|
+
range?: DiagnosticRange;
|
|
23
|
+
message: string;
|
|
24
|
+
}
|
|
25
|
+
export interface WorkspaceDiagnostic {
|
|
26
|
+
message: string;
|
|
27
|
+
severity: DiagnosticSeverity;
|
|
28
|
+
range?: DiagnosticRange;
|
|
29
|
+
source?: string;
|
|
30
|
+
code?: string | number | {
|
|
31
|
+
value: string | number;
|
|
32
|
+
target?: string;
|
|
33
|
+
};
|
|
34
|
+
tags?: readonly DiagnosticTag[];
|
|
35
|
+
relatedInformation?: readonly DiagnosticRelatedInformation[];
|
|
36
|
+
}
|
|
37
|
+
export interface WorkspaceDiagnosticEntry {
|
|
38
|
+
key: string;
|
|
39
|
+
collectionId: string;
|
|
40
|
+
collectionLabel: string;
|
|
41
|
+
resource: DiagnosticResource | null;
|
|
42
|
+
diagnostic: WorkspaceDiagnostic;
|
|
43
|
+
}
|
|
44
|
+
export interface DiagnosticCollectionOptions {
|
|
45
|
+
label?: string;
|
|
46
|
+
buildItemMenu?: (menu: Menu, entry: WorkspaceDiagnosticEntry) => void;
|
|
47
|
+
}
|
|
48
|
+
export type DiagnosticCollectionUpdate = readonly [
|
|
49
|
+
resource: DiagnosticResource | null,
|
|
50
|
+
diagnostics: readonly WorkspaceDiagnostic[] | undefined
|
|
51
|
+
];
|
|
52
|
+
export interface DiagnosticCollection extends Iterable<readonly [DiagnosticResource | null, readonly WorkspaceDiagnostic[]]> {
|
|
53
|
+
readonly id: string;
|
|
54
|
+
readonly label: string;
|
|
55
|
+
readonly disposed: boolean;
|
|
56
|
+
set(resource: DiagnosticResource | null, diagnostics: readonly WorkspaceDiagnostic[] | undefined): void;
|
|
57
|
+
set(entries: Iterable<DiagnosticCollectionUpdate>): void;
|
|
58
|
+
get(resource: DiagnosticResource | null): readonly WorkspaceDiagnostic[] | undefined;
|
|
59
|
+
has(resource: DiagnosticResource | null): boolean;
|
|
60
|
+
delete(resource: DiagnosticResource | null): boolean;
|
|
61
|
+
clear(): void;
|
|
62
|
+
forEach(callback: (resource: DiagnosticResource | null, diagnostics: readonly WorkspaceDiagnostic[], collection: DiagnosticCollection) => void): void;
|
|
63
|
+
dispose(): void;
|
|
64
|
+
}
|
|
65
|
+
export interface DiagnosticsSnapshot {
|
|
66
|
+
entries: readonly WorkspaceDiagnosticEntry[];
|
|
67
|
+
counts: Readonly<Record<DiagnosticSeverity, number>>;
|
|
68
|
+
}
|
|
69
|
+
type AppendMenu = (target: WorkspaceMenu, source: Menu) => void;
|
|
70
|
+
/** Lapis-owned façade over Design Core's application-independent manager. */
|
|
71
|
+
export declare class DiagnosticsManager {
|
|
72
|
+
private readonly manager;
|
|
73
|
+
private readonly createMenu;
|
|
74
|
+
private readonly appendMenu;
|
|
75
|
+
constructor(manager: DesignDiagnosticsManager, createMenu: () => Menu, appendMenu: AppendMenu);
|
|
76
|
+
get size(): number;
|
|
77
|
+
createCollection(id: string, options?: DiagnosticCollectionOptions): DiagnosticCollection;
|
|
78
|
+
getCollection(id: string): DiagnosticCollection | undefined;
|
|
79
|
+
subscribe(subscriber: (snapshot: DiagnosticsSnapshot) => void): () => void;
|
|
80
|
+
snapshot(): DiagnosticsSnapshot;
|
|
81
|
+
}
|
|
82
|
+
export declare function bindRuntimePluginDiagnostics(plugins: {
|
|
83
|
+
on(name: "plugin-error", listener: (id: string, message: string) => void): unknown;
|
|
84
|
+
on(name: "plugin-enabled", listener: (plugin: {
|
|
85
|
+
manifest: {
|
|
86
|
+
id: string;
|
|
87
|
+
};
|
|
88
|
+
}) => void): unknown;
|
|
89
|
+
offref(ref: unknown): void;
|
|
90
|
+
}, diagnostics: Pick<DiagnosticsManager, "createCollection">): () => void;
|
|
91
|
+
export declare function diagnosticResourceForPath(path: string): DiagnosticResource;
|
|
92
|
+
export declare function pathFromDiagnosticResource(resource: DiagnosticResource): string | null;
|
|
93
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/** Lapis-owned façade over Design Core's application-independent manager. */
|
|
2
|
+
export class DiagnosticsManager {
|
|
3
|
+
manager;
|
|
4
|
+
createMenu;
|
|
5
|
+
appendMenu;
|
|
6
|
+
constructor(manager, createMenu, appendMenu) {
|
|
7
|
+
this.manager = manager;
|
|
8
|
+
this.createMenu = createMenu;
|
|
9
|
+
this.appendMenu = appendMenu;
|
|
10
|
+
}
|
|
11
|
+
get size() {
|
|
12
|
+
return this.manager.size;
|
|
13
|
+
}
|
|
14
|
+
createCollection(id, options = {}) {
|
|
15
|
+
const designOptions = {
|
|
16
|
+
label: options.label,
|
|
17
|
+
buildItemMenu: options.buildItemMenu
|
|
18
|
+
? (target, entry) => {
|
|
19
|
+
const menu = this.createMenu();
|
|
20
|
+
options.buildItemMenu?.(menu, entry);
|
|
21
|
+
this.appendMenu(target, menu);
|
|
22
|
+
}
|
|
23
|
+
: undefined,
|
|
24
|
+
};
|
|
25
|
+
return this.manager.createCollection(id, designOptions);
|
|
26
|
+
}
|
|
27
|
+
getCollection(id) {
|
|
28
|
+
return this.manager.getCollection(id);
|
|
29
|
+
}
|
|
30
|
+
subscribe(subscriber) {
|
|
31
|
+
return this.manager.subscribe((snapshot) => subscriber(snapshot));
|
|
32
|
+
}
|
|
33
|
+
snapshot() {
|
|
34
|
+
return this.manager.snapshot();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export function bindRuntimePluginDiagnostics(plugins, diagnostics) {
|
|
38
|
+
const collection = diagnostics.createCollection("lapis:runtime", {
|
|
39
|
+
label: "Runtime",
|
|
40
|
+
});
|
|
41
|
+
const pluginFailures = new Map();
|
|
42
|
+
const publish = () => {
|
|
43
|
+
if (collection.disposed)
|
|
44
|
+
return;
|
|
45
|
+
collection.set(null, [...pluginFailures.values()]);
|
|
46
|
+
};
|
|
47
|
+
const errorRef = plugins.on("plugin-error", (id, message) => {
|
|
48
|
+
pluginFailures.set(id, {
|
|
49
|
+
message,
|
|
50
|
+
severity: "error",
|
|
51
|
+
source: "Plugin",
|
|
52
|
+
code: id,
|
|
53
|
+
});
|
|
54
|
+
publish();
|
|
55
|
+
});
|
|
56
|
+
const enabledRef = plugins.on("plugin-enabled", (plugin) => {
|
|
57
|
+
if (!pluginFailures.delete(plugin.manifest.id))
|
|
58
|
+
return;
|
|
59
|
+
publish();
|
|
60
|
+
});
|
|
61
|
+
return () => {
|
|
62
|
+
plugins.offref(errorRef);
|
|
63
|
+
plugins.offref(enabledRef);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export function diagnosticResourceForPath(path) {
|
|
67
|
+
const normalized = path.replace(/^\/+/, "");
|
|
68
|
+
return {
|
|
69
|
+
uri: `vault:///${encodeURI(normalized)}`,
|
|
70
|
+
label: normalized.split("/").at(-1) ?? normalized,
|
|
71
|
+
detail: normalized,
|
|
72
|
+
icon: "file-text",
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export function pathFromDiagnosticResource(resource) {
|
|
76
|
+
if (!resource.uri.startsWith("vault:///"))
|
|
77
|
+
return null;
|
|
78
|
+
try {
|
|
79
|
+
return decodeURI(resource.uri.slice("vault:///".length));
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Curated entry point for the public plugin API reference published on
|
|
3
|
+
* lapis.md.
|
|
4
|
+
*
|
|
5
|
+
* Keep this list focused on the supported plugin-author surface rather than the
|
|
6
|
+
* package's full internal export barrel.
|
|
7
|
+
*/
|
|
8
|
+
export { App, createDefaultAppSafeModeState, RenderContext, SecretStorage, } from "./context.svelte";
|
|
9
|
+
export type { AppSafeModeFailure, AppSafeModeState, AppStateProperties, } from "./context.svelte";
|
|
10
|
+
export { getApplicationCompatibility, installApplicationCompatibility, resolveApplication, } from "./application-compatibility";
|
|
11
|
+
export { provideApplicationState, useApplicationState, } from "./application-state.svelte";
|
|
12
|
+
export { Plugin, resolvePluginDataPath } from "./plugin";
|
|
13
|
+
export type { PluginManifest, PluginRuntimeOptions, PluginSource, } from "./plugin";
|
|
14
|
+
export type { LapisExtensionContributions, LapisExtensionKind, LapisExtensionManifest, LapisExtensionPermission, LapisExtensionRuntimeHost, LapisPluginClassification, } from "./lapis-extension";
|
|
15
|
+
export { PluginManager } from "./plugin-manager";
|
|
16
|
+
export { AppUrlService } from "./app-url";
|
|
17
|
+
export { FileManager } from "./file-manager";
|
|
18
|
+
export { AppSettings, ButtonComponent, DropdownComponent, Modal, PluginSettingTab, ProgressBarComponent, SearchComponent, Setting, SliderComponent, TextAreaComponent, TextComponent, ToggleComponent, } from "./settings.svelte";
|
|
19
|
+
export { Menu, MenuItem, MenuSeparator } from "./menu.svelte";
|
|
20
|
+
export { CommandManager, Keymap, Scope } from "./command.svelte";
|
|
21
|
+
export type { Command, Hotkey, HotkeyAssignment, HotkeyConflict, KeymapContext, KeymapEventHandler, KeymapInfo, } from "./command.svelte";
|
|
22
|
+
export { Component, FileView, ItemView, TextFileView, View, } from "./view.svelte";
|
|
23
|
+
export type { ViewState, ViewStateResult } from "./view.svelte";
|
|
24
|
+
export { Notice, Workspace, WorkspaceLeaf, WorkspaceSidebarGroup, WorkspaceSidedock, WorkspaceSplit, WorkspaceTabs, } from "./workspace.svelte";
|
|
25
|
+
export type { OpenViewState, WorkspaceHintTarget } from "./workspace.svelte";
|
|
26
|
+
export { AbstractInputSuggest, EditorSuggest, FuzzySuggestModal, PopoverSuggest, SuggestModal, } from "./suggest";
|
|
27
|
+
export type { EditorSuggestContext, EditorSuggestTriggerInfo } from "./suggest";
|
|
28
|
+
export { Editor } from "./editor.svelte";
|
|
29
|
+
export type { EditorChange, EditorPosition, EditorRange, EditorRangeOrCaret, EditorScrollInfo, EditorSelection, EditorSelectionOrCaret, EditorTransaction, MarkdownFileInfo, } from "./editor.svelte";
|
|
30
|
+
export { MarkdownRenderChild } from "./markdown";
|
|
31
|
+
export type { MarkdownDirectiveRenderer, MarkdownPostProcessor, MarkdownPostProcessorContext, MarkdownViewMenuItemProvider, } from "./markdown";
|
|
32
|
+
export type { MarkdownCodeMirrorExtensionContext, MarkdownContributionMode, MarkdownExtensionContribution, MarkdownSurfaceContext, } from "./markdown-extension-registry";
|
|
33
|
+
export type { MarkdownFileSurfaceActivation, MarkdownFileSurfaceHandle, MarkdownFileSurfaceOptions, MarkdownFileSurfaceProvider, } from "./markdown-file-surface-registry";
|
|
34
|
+
export { MetadataCache } from "./cache.svelte";
|
|
35
|
+
export type { CachedMetadata } from "./cache.svelte";
|
|
36
|
+
export { TAbstractFile, TFile, TFolder, Vault } from "./storage";
|
|
37
|
+
export type { DataAdapter, VaultAdapter, VaultAdapterCapabilities, VaultIdentityAdapter, VaultProfile, VaultProfileDemoMetadata, VaultSession, } from "./storage";
|
|
38
|
+
export { normalizePath } from "./storage/path";
|
|
39
|
+
export { addIcon } from "./icons/index";
|
|
40
|
+
export { NotificationManager, NotificationProgressHandle, } from "./notifications";
|
|
41
|
+
export type { NotifyOptions, NotificationProgressOptions, NotificationProgressReport, NotificationProgressSnapshot, NotificationProgressToken, } from "./notifications";
|
|
42
|
+
export { EventDispatcher } from "./events";
|
|
43
|
+
export { LanguageServiceManager } from "./language-service";
|
|
44
|
+
export type { LanguageServiceCompletionItem, LanguageServiceDiagnostic, LanguageServiceHover, LanguageServiceLocation, LanguageServiceProvider, LanguageServiceProviderCapabilities, LanguageServiceProviderMetadata, } from "./language-service";
|
package/dist/docs-api.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Curated entry point for the public plugin API reference published on
|
|
3
|
+
* lapis.md.
|
|
4
|
+
*
|
|
5
|
+
* Keep this list focused on the supported plugin-author surface rather than the
|
|
6
|
+
* package's full internal export barrel.
|
|
7
|
+
*/
|
|
8
|
+
export { App, createDefaultAppSafeModeState, RenderContext, SecretStorage, } from "./context.svelte";
|
|
9
|
+
export { getApplicationCompatibility, installApplicationCompatibility, resolveApplication, } from "./application-compatibility";
|
|
10
|
+
export { provideApplicationState, useApplicationState, } from "./application-state.svelte";
|
|
11
|
+
export { Plugin, resolvePluginDataPath } from "./plugin";
|
|
12
|
+
export { PluginManager } from "./plugin-manager";
|
|
13
|
+
export { AppUrlService } from "./app-url";
|
|
14
|
+
export { FileManager } from "./file-manager";
|
|
15
|
+
export { AppSettings, ButtonComponent, DropdownComponent, Modal, PluginSettingTab, ProgressBarComponent, SearchComponent, Setting, SliderComponent, TextAreaComponent, TextComponent, ToggleComponent, } from "./settings.svelte";
|
|
16
|
+
export { Menu, MenuItem, MenuSeparator } from "./menu.svelte";
|
|
17
|
+
export { CommandManager, Keymap, Scope } from "./command.svelte";
|
|
18
|
+
export { Component, FileView, ItemView, TextFileView, View, } from "./view.svelte";
|
|
19
|
+
export { Notice, Workspace, WorkspaceLeaf, WorkspaceSidebarGroup, WorkspaceSidedock, WorkspaceSplit, WorkspaceTabs, } from "./workspace.svelte";
|
|
20
|
+
export { AbstractInputSuggest, EditorSuggest, FuzzySuggestModal, PopoverSuggest, SuggestModal, } from "./suggest";
|
|
21
|
+
export { Editor } from "./editor.svelte";
|
|
22
|
+
export { MarkdownRenderChild } from "./markdown";
|
|
23
|
+
export { MetadataCache } from "./cache.svelte";
|
|
24
|
+
export { TAbstractFile, TFile, TFolder, Vault } from "./storage";
|
|
25
|
+
export { normalizePath } from "./storage/path";
|
|
26
|
+
export { addIcon } from "./icons/index";
|
|
27
|
+
export { NotificationManager, NotificationProgressHandle, } from "./notifications";
|
|
28
|
+
export { EventDispatcher } from "./events";
|
|
29
|
+
export { LanguageServiceManager } from "./language-service";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { EventDispatcher } from "./events";
|
|
2
|
+
export type EditorViewPriority = "default" | "option" | "exclusive";
|
|
3
|
+
export type EditorViewContribution = {
|
|
4
|
+
id: string;
|
|
5
|
+
viewType?: string;
|
|
6
|
+
label: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
filenamePatterns?: string[];
|
|
9
|
+
priority?: EditorViewPriority;
|
|
10
|
+
pluginId?: string;
|
|
11
|
+
source?: "core" | "plugin" | "manifest" | "compat";
|
|
12
|
+
activationEvent?: string;
|
|
13
|
+
};
|
|
14
|
+
export type RegisteredEditorViewContribution = EditorViewContribution & {
|
|
15
|
+
viewType: string;
|
|
16
|
+
filenamePatterns: string[];
|
|
17
|
+
priority: EditorViewPriority;
|
|
18
|
+
};
|
|
19
|
+
export type EditorViewRegistryChange = {
|
|
20
|
+
id: string;
|
|
21
|
+
action: "registered" | "updated" | "unregistered";
|
|
22
|
+
};
|
|
23
|
+
export declare class EditorViewRegistry extends EventDispatcher<{
|
|
24
|
+
changed: [change: EditorViewRegistryChange];
|
|
25
|
+
}> {
|
|
26
|
+
private readonly views;
|
|
27
|
+
register(contribution: EditorViewContribution): () => void;
|
|
28
|
+
upsert(contribution: EditorViewContribution): () => void;
|
|
29
|
+
update(id: string, contribution: Partial<EditorViewContribution>): boolean;
|
|
30
|
+
removeFilenamePatterns(id: string, patterns: readonly string[]): boolean;
|
|
31
|
+
unregister(id: string): boolean;
|
|
32
|
+
get(id: string): RegisteredEditorViewContribution | undefined;
|
|
33
|
+
getByViewType(viewType: string): RegisteredEditorViewContribution[];
|
|
34
|
+
getAll(): RegisteredEditorViewContribution[];
|
|
35
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { EventDispatcher } from "./events";
|
|
2
|
+
function normalizeString(value) {
|
|
3
|
+
return value.trim();
|
|
4
|
+
}
|
|
5
|
+
function uniqueStrings(values = []) {
|
|
6
|
+
return [...new Set(values.map(normalizeString).filter(Boolean))];
|
|
7
|
+
}
|
|
8
|
+
function normalizeContribution(contribution) {
|
|
9
|
+
const id = normalizeString(contribution.id);
|
|
10
|
+
if (!id) {
|
|
11
|
+
throw new Error("Editor view contribution id must not be empty.");
|
|
12
|
+
}
|
|
13
|
+
const label = normalizeString(contribution.label);
|
|
14
|
+
if (!label) {
|
|
15
|
+
throw new Error(`Editor view contribution ${id} label must not be empty.`);
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
...contribution,
|
|
19
|
+
id,
|
|
20
|
+
viewType: normalizeString(contribution.viewType ?? id),
|
|
21
|
+
label,
|
|
22
|
+
filenamePatterns: uniqueStrings(contribution.filenamePatterns),
|
|
23
|
+
priority: contribution.priority ?? "option",
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function mergeContribution(current, next) {
|
|
27
|
+
const normalized = normalizeContribution({ ...current, ...next });
|
|
28
|
+
return {
|
|
29
|
+
...current,
|
|
30
|
+
...normalized,
|
|
31
|
+
filenamePatterns: uniqueStrings([
|
|
32
|
+
...current.filenamePatterns,
|
|
33
|
+
...normalized.filenamePatterns,
|
|
34
|
+
]),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export class EditorViewRegistry extends EventDispatcher {
|
|
38
|
+
views = new Map();
|
|
39
|
+
register(contribution) {
|
|
40
|
+
const normalized = normalizeContribution(contribution);
|
|
41
|
+
if (this.views.has(normalized.id)) {
|
|
42
|
+
console.warn(`Editor view ${normalized.id} is already registered.`);
|
|
43
|
+
return () => { };
|
|
44
|
+
}
|
|
45
|
+
this.views.set(normalized.id, normalized);
|
|
46
|
+
this.emit("changed", { id: normalized.id, action: "registered" });
|
|
47
|
+
return () => {
|
|
48
|
+
this.unregister(normalized.id);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
upsert(contribution) {
|
|
52
|
+
const normalized = normalizeContribution(contribution);
|
|
53
|
+
const existing = this.views.get(normalized.id);
|
|
54
|
+
if (!existing) {
|
|
55
|
+
return this.register(normalized);
|
|
56
|
+
}
|
|
57
|
+
const merged = mergeContribution(existing, normalized);
|
|
58
|
+
this.views.set(merged.id, merged);
|
|
59
|
+
this.emit("changed", { id: merged.id, action: "updated" });
|
|
60
|
+
return () => { };
|
|
61
|
+
}
|
|
62
|
+
update(id, contribution) {
|
|
63
|
+
const existing = this.views.get(id);
|
|
64
|
+
if (!existing) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
const merged = mergeContribution(existing, {
|
|
68
|
+
...existing,
|
|
69
|
+
...contribution,
|
|
70
|
+
id: existing.id,
|
|
71
|
+
label: contribution.label ?? existing.label,
|
|
72
|
+
});
|
|
73
|
+
this.views.set(existing.id, merged);
|
|
74
|
+
this.emit("changed", { id: existing.id, action: "updated" });
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
removeFilenamePatterns(id, patterns) {
|
|
78
|
+
const existing = this.views.get(id);
|
|
79
|
+
if (!existing) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
const removedPatterns = new Set(uniqueStrings(patterns));
|
|
83
|
+
const filenamePatterns = existing.filenamePatterns.filter((pattern) => !removedPatterns.has(pattern));
|
|
84
|
+
if (filenamePatterns.length === existing.filenamePatterns.length) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
if (filenamePatterns.length === 0 && existing.source === "compat") {
|
|
88
|
+
this.views.delete(id);
|
|
89
|
+
this.emit("changed", { id, action: "unregistered" });
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
this.views.set(id, { ...existing, filenamePatterns });
|
|
93
|
+
this.emit("changed", { id, action: "updated" });
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
unregister(id) {
|
|
97
|
+
const deleted = this.views.delete(id);
|
|
98
|
+
if (deleted) {
|
|
99
|
+
this.emit("changed", { id, action: "unregistered" });
|
|
100
|
+
}
|
|
101
|
+
return deleted;
|
|
102
|
+
}
|
|
103
|
+
get(id) {
|
|
104
|
+
return this.views.get(id);
|
|
105
|
+
}
|
|
106
|
+
getByViewType(viewType) {
|
|
107
|
+
return this.getAll().filter((view) => view.viewType === viewType);
|
|
108
|
+
}
|
|
109
|
+
getAll() {
|
|
110
|
+
return [...this.views.values()].sort((left, right) => left.label.localeCompare(right.label));
|
|
111
|
+
}
|
|
112
|
+
}
|