@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,374 @@
|
|
|
1
|
+
// Generated by scripts/generate-plugin-host-modules.mjs. Do not edit by hand.
|
|
2
|
+
export const pluginHostModuleRegistry = {
|
|
3
|
+
"@codemirror/autocomplete": {
|
|
4
|
+
entry: "@codemirror/autocomplete",
|
|
5
|
+
moduleId: "codemirror-autocomplete",
|
|
6
|
+
packageName: "@codemirror/autocomplete",
|
|
7
|
+
platforms: ["web", "electron-renderer"],
|
|
8
|
+
public: true,
|
|
9
|
+
source: "config",
|
|
10
|
+
specifier: "@codemirror/autocomplete",
|
|
11
|
+
version: "6.18.6",
|
|
12
|
+
},
|
|
13
|
+
"@codemirror/commands": {
|
|
14
|
+
entry: "@codemirror/commands",
|
|
15
|
+
moduleId: "codemirror-commands",
|
|
16
|
+
packageName: "@codemirror/commands",
|
|
17
|
+
platforms: ["web", "electron-renderer"],
|
|
18
|
+
public: true,
|
|
19
|
+
source: "config",
|
|
20
|
+
specifier: "@codemirror/commands",
|
|
21
|
+
version: "6.8.1",
|
|
22
|
+
},
|
|
23
|
+
"@codemirror/language": {
|
|
24
|
+
entry: "@codemirror/language",
|
|
25
|
+
moduleId: "codemirror-language",
|
|
26
|
+
packageName: "@codemirror/language",
|
|
27
|
+
platforms: ["web", "electron-renderer"],
|
|
28
|
+
public: true,
|
|
29
|
+
source: "config",
|
|
30
|
+
specifier: "@codemirror/language",
|
|
31
|
+
version: "6.11.3",
|
|
32
|
+
},
|
|
33
|
+
"@codemirror/lint": {
|
|
34
|
+
entry: "@codemirror/lint",
|
|
35
|
+
moduleId: "codemirror-lint",
|
|
36
|
+
packageName: "@codemirror/lint",
|
|
37
|
+
platforms: ["web", "electron-renderer"],
|
|
38
|
+
public: true,
|
|
39
|
+
source: "config",
|
|
40
|
+
specifier: "@codemirror/lint",
|
|
41
|
+
version: "6.8.5",
|
|
42
|
+
},
|
|
43
|
+
"@codemirror/merge": {
|
|
44
|
+
entry: "@codemirror/merge",
|
|
45
|
+
moduleId: "codemirror-merge",
|
|
46
|
+
packageName: "@codemirror/merge",
|
|
47
|
+
platforms: ["web", "electron-renderer"],
|
|
48
|
+
public: true,
|
|
49
|
+
source: "config",
|
|
50
|
+
specifier: "@codemirror/merge",
|
|
51
|
+
version: "6.12.1",
|
|
52
|
+
},
|
|
53
|
+
"@codemirror/search": {
|
|
54
|
+
entry: "@codemirror/search",
|
|
55
|
+
moduleId: "codemirror-search",
|
|
56
|
+
packageName: "@codemirror/search",
|
|
57
|
+
platforms: ["web", "electron-renderer"],
|
|
58
|
+
public: true,
|
|
59
|
+
source: "config",
|
|
60
|
+
specifier: "@codemirror/search",
|
|
61
|
+
version: "6.5.11",
|
|
62
|
+
},
|
|
63
|
+
"@codemirror/state": {
|
|
64
|
+
entry: "@codemirror/state",
|
|
65
|
+
moduleId: "codemirror-state",
|
|
66
|
+
packageName: "@codemirror/state",
|
|
67
|
+
platforms: ["web", "electron-renderer"],
|
|
68
|
+
public: true,
|
|
69
|
+
source: "config",
|
|
70
|
+
specifier: "@codemirror/state",
|
|
71
|
+
version: "6.6.0",
|
|
72
|
+
},
|
|
73
|
+
"@codemirror/view": {
|
|
74
|
+
entry: "@codemirror/view",
|
|
75
|
+
moduleId: "codemirror-view",
|
|
76
|
+
packageName: "@codemirror/view",
|
|
77
|
+
platforms: ["web", "electron-renderer"],
|
|
78
|
+
public: true,
|
|
79
|
+
source: "config",
|
|
80
|
+
specifier: "@codemirror/view",
|
|
81
|
+
version: "6.42.1",
|
|
82
|
+
},
|
|
83
|
+
"@dnd-kit/dom": {
|
|
84
|
+
entry: "@dnd-kit/dom",
|
|
85
|
+
moduleId: "dnd-kit-dom",
|
|
86
|
+
packageName: "@dnd-kit/dom",
|
|
87
|
+
platforms: ["web", "electron-renderer"],
|
|
88
|
+
public: true,
|
|
89
|
+
source: "config",
|
|
90
|
+
specifier: "@dnd-kit/dom",
|
|
91
|
+
version: "0.4.0",
|
|
92
|
+
},
|
|
93
|
+
"@dnd-kit/helpers": {
|
|
94
|
+
entry: "@dnd-kit/helpers",
|
|
95
|
+
moduleId: "dnd-kit-helpers",
|
|
96
|
+
packageName: "@dnd-kit/helpers",
|
|
97
|
+
platforms: ["web", "electron-renderer"],
|
|
98
|
+
public: true,
|
|
99
|
+
source: "config",
|
|
100
|
+
specifier: "@dnd-kit/helpers",
|
|
101
|
+
version: "0.4.0",
|
|
102
|
+
},
|
|
103
|
+
"@dnd-kit/svelte": {
|
|
104
|
+
entry: "@dnd-kit/svelte",
|
|
105
|
+
moduleId: "dnd-kit-svelte",
|
|
106
|
+
packageName: "@dnd-kit/svelte",
|
|
107
|
+
platforms: ["web", "electron-renderer"],
|
|
108
|
+
public: true,
|
|
109
|
+
source: "config",
|
|
110
|
+
specifier: "@dnd-kit/svelte",
|
|
111
|
+
version: "0.4.0",
|
|
112
|
+
},
|
|
113
|
+
"@dnd-kit/svelte/sortable": {
|
|
114
|
+
entry: "@dnd-kit/svelte/sortable",
|
|
115
|
+
moduleId: "dnd-kit-svelte-sortable",
|
|
116
|
+
packageName: "@dnd-kit/svelte",
|
|
117
|
+
platforms: ["web", "electron-renderer"],
|
|
118
|
+
public: true,
|
|
119
|
+
source: "package-json-export",
|
|
120
|
+
specifier: "@dnd-kit/svelte/sortable",
|
|
121
|
+
version: "0.4.0",
|
|
122
|
+
},
|
|
123
|
+
"@dnd-kit/svelte/utilities": {
|
|
124
|
+
entry: "@dnd-kit/svelte/utilities",
|
|
125
|
+
moduleId: "dnd-kit-svelte-utilities",
|
|
126
|
+
packageName: "@dnd-kit/svelte",
|
|
127
|
+
platforms: ["web", "electron-renderer"],
|
|
128
|
+
public: true,
|
|
129
|
+
source: "package-json-export",
|
|
130
|
+
specifier: "@dnd-kit/svelte/utilities",
|
|
131
|
+
version: "0.4.0",
|
|
132
|
+
},
|
|
133
|
+
"@lapis-notes/api": {
|
|
134
|
+
entry: "@lapis-notes/api",
|
|
135
|
+
moduleId: "lapis-notes-api",
|
|
136
|
+
packageName: "@lapis-notes/api",
|
|
137
|
+
platforms: ["web", "electron-renderer", "electron-sidecar"],
|
|
138
|
+
public: true,
|
|
139
|
+
source: "config",
|
|
140
|
+
specifier: "@lapis-notes/api",
|
|
141
|
+
version: "0.0.1",
|
|
142
|
+
},
|
|
143
|
+
"@lapis-notes/api/cache": {
|
|
144
|
+
entry: "@lapis-notes/api/cache",
|
|
145
|
+
moduleId: "lapis-notes-api-cache",
|
|
146
|
+
packageName: "@lapis-notes/api",
|
|
147
|
+
platforms: ["web", "electron-renderer"],
|
|
148
|
+
public: true,
|
|
149
|
+
source: "package-json-export",
|
|
150
|
+
specifier: "@lapis-notes/api/cache",
|
|
151
|
+
version: "0.0.1",
|
|
152
|
+
},
|
|
153
|
+
"@lapis-notes/api/copy-button": {
|
|
154
|
+
entry: "@lapis-notes/api/copy-button",
|
|
155
|
+
moduleId: "lapis-notes-api-copy-button",
|
|
156
|
+
packageName: "@lapis-notes/api",
|
|
157
|
+
platforms: ["web", "electron-renderer"],
|
|
158
|
+
public: true,
|
|
159
|
+
source: "config",
|
|
160
|
+
specifier: "@lapis-notes/api/copy-button",
|
|
161
|
+
version: "0.0.1",
|
|
162
|
+
},
|
|
163
|
+
"@lapis-notes/api/editor": {
|
|
164
|
+
defaultExport: true,
|
|
165
|
+
entry: "@lapis-notes/api/editor",
|
|
166
|
+
moduleId: "lapis-notes-api-editor",
|
|
167
|
+
packageName: "@lapis-notes/api",
|
|
168
|
+
platforms: ["web", "electron-renderer"],
|
|
169
|
+
public: true,
|
|
170
|
+
source: "config",
|
|
171
|
+
specifier: "@lapis-notes/api/editor",
|
|
172
|
+
version: "0.0.1",
|
|
173
|
+
},
|
|
174
|
+
"@lapis-notes/api/icon": {
|
|
175
|
+
entry: "@lapis-notes/api/icon",
|
|
176
|
+
moduleId: "lapis-notes-api-icon",
|
|
177
|
+
packageName: "@lapis-notes/api",
|
|
178
|
+
platforms: ["web", "electron-renderer"],
|
|
179
|
+
public: true,
|
|
180
|
+
source: "config",
|
|
181
|
+
specifier: "@lapis-notes/api/icon",
|
|
182
|
+
version: "0.0.1",
|
|
183
|
+
},
|
|
184
|
+
"@lapis-notes/api/language-service": {
|
|
185
|
+
entry: "@lapis-notes/api/language-service",
|
|
186
|
+
moduleId: "lapis-notes-api-language-service",
|
|
187
|
+
packageName: "@lapis-notes/api",
|
|
188
|
+
platforms: ["web", "electron-renderer"],
|
|
189
|
+
public: true,
|
|
190
|
+
source: "package-json-export",
|
|
191
|
+
specifier: "@lapis-notes/api/language-service",
|
|
192
|
+
version: "0.0.1",
|
|
193
|
+
},
|
|
194
|
+
"@lapis-notes/api/menu": {
|
|
195
|
+
defaultExport: true,
|
|
196
|
+
entry: "@lapis-notes/api/menu",
|
|
197
|
+
moduleId: "lapis-notes-api-menu",
|
|
198
|
+
packageName: "@lapis-notes/api",
|
|
199
|
+
platforms: ["web", "electron-renderer"],
|
|
200
|
+
public: true,
|
|
201
|
+
source: "config",
|
|
202
|
+
specifier: "@lapis-notes/api/menu",
|
|
203
|
+
version: "0.0.1",
|
|
204
|
+
},
|
|
205
|
+
"@lapis-notes/api/metadata-value": {
|
|
206
|
+
entry: "@lapis-notes/api/metadata-value",
|
|
207
|
+
moduleId: "lapis-notes-api-metadata-value",
|
|
208
|
+
packageName: "@lapis-notes/api",
|
|
209
|
+
platforms: ["web", "electron-renderer"],
|
|
210
|
+
public: true,
|
|
211
|
+
source: "package-json-export",
|
|
212
|
+
specifier: "@lapis-notes/api/metadata-value",
|
|
213
|
+
version: "0.0.1",
|
|
214
|
+
},
|
|
215
|
+
"@lapis-notes/markdown": {
|
|
216
|
+
entry: "@lapis-notes/markdown",
|
|
217
|
+
moduleId: "lapis-notes-markdown",
|
|
218
|
+
packageName: "@lapis-notes/markdown",
|
|
219
|
+
platforms: ["web", "electron-renderer"],
|
|
220
|
+
public: true,
|
|
221
|
+
source: "config",
|
|
222
|
+
specifier: "@lapis-notes/markdown",
|
|
223
|
+
version: "0.0.0",
|
|
224
|
+
},
|
|
225
|
+
"@lapis-notes/markdown/embed": {
|
|
226
|
+
entry: "@lapis-notes/markdown/embed",
|
|
227
|
+
moduleId: "lapis-notes-markdown-embed",
|
|
228
|
+
packageName: "@lapis-notes/markdown",
|
|
229
|
+
platforms: ["web", "electron-renderer"],
|
|
230
|
+
public: true,
|
|
231
|
+
source: "package-json-export",
|
|
232
|
+
specifier: "@lapis-notes/markdown/embed",
|
|
233
|
+
version: "0.0.0",
|
|
234
|
+
},
|
|
235
|
+
"@lapis-notes/ui": {
|
|
236
|
+
entry: "@lapis-notes/ui",
|
|
237
|
+
moduleId: "lapis-notes-ui",
|
|
238
|
+
packageName: "@lapis-notes/ui",
|
|
239
|
+
platforms: ["web", "electron-renderer"],
|
|
240
|
+
public: true,
|
|
241
|
+
source: "config",
|
|
242
|
+
specifier: "@lapis-notes/ui",
|
|
243
|
+
version: "0.0.1",
|
|
244
|
+
},
|
|
245
|
+
"@lezer/highlight": {
|
|
246
|
+
entry: "@lezer/highlight",
|
|
247
|
+
moduleId: "lezer-highlight",
|
|
248
|
+
packageName: "@lezer/highlight",
|
|
249
|
+
platforms: ["web", "electron-renderer"],
|
|
250
|
+
public: true,
|
|
251
|
+
source: "config",
|
|
252
|
+
specifier: "@lezer/highlight",
|
|
253
|
+
version: "1.2.1",
|
|
254
|
+
},
|
|
255
|
+
"@lezer/lr": {
|
|
256
|
+
entry: "@lezer/lr",
|
|
257
|
+
moduleId: "lezer-lr",
|
|
258
|
+
packageName: "@lezer/lr",
|
|
259
|
+
platforms: ["web", "electron-renderer"],
|
|
260
|
+
public: true,
|
|
261
|
+
source: "config",
|
|
262
|
+
specifier: "@lezer/lr",
|
|
263
|
+
version: "1.4.2",
|
|
264
|
+
},
|
|
265
|
+
"bits-ui": {
|
|
266
|
+
entry: "bits-ui",
|
|
267
|
+
moduleId: "bits-ui",
|
|
268
|
+
packageName: "bits-ui",
|
|
269
|
+
platforms: ["web", "electron-renderer"],
|
|
270
|
+
public: true,
|
|
271
|
+
source: "config",
|
|
272
|
+
specifier: "bits-ui",
|
|
273
|
+
version: "2.18.1",
|
|
274
|
+
},
|
|
275
|
+
clsx: {
|
|
276
|
+
entry: "clsx",
|
|
277
|
+
moduleId: "clsx",
|
|
278
|
+
packageName: "clsx",
|
|
279
|
+
platforms: ["web", "electron-renderer"],
|
|
280
|
+
public: true,
|
|
281
|
+
source: "config",
|
|
282
|
+
specifier: "clsx",
|
|
283
|
+
version: "2.1.1",
|
|
284
|
+
},
|
|
285
|
+
"js-yaml": {
|
|
286
|
+
entry: "js-yaml",
|
|
287
|
+
moduleId: "js-yaml",
|
|
288
|
+
packageName: "js-yaml",
|
|
289
|
+
platforms: ["web", "electron-renderer"],
|
|
290
|
+
public: true,
|
|
291
|
+
source: "config",
|
|
292
|
+
specifier: "js-yaml",
|
|
293
|
+
version: "4.1.1",
|
|
294
|
+
},
|
|
295
|
+
lapis: {
|
|
296
|
+
aliasOf: "@lapis-notes/api",
|
|
297
|
+
entry: "@lapis-notes/api",
|
|
298
|
+
moduleId: "lapis",
|
|
299
|
+
packageName: "@lapis-notes/api",
|
|
300
|
+
platforms: ["electron-sidecar"],
|
|
301
|
+
public: true,
|
|
302
|
+
source: "config",
|
|
303
|
+
specifier: "lapis",
|
|
304
|
+
version: "0.0.1",
|
|
305
|
+
},
|
|
306
|
+
luxon: {
|
|
307
|
+
entry: "luxon",
|
|
308
|
+
moduleId: "luxon",
|
|
309
|
+
packageName: "luxon",
|
|
310
|
+
platforms: ["web", "electron-renderer"],
|
|
311
|
+
public: true,
|
|
312
|
+
source: "config",
|
|
313
|
+
specifier: "luxon",
|
|
314
|
+
version: "3.7.1",
|
|
315
|
+
},
|
|
316
|
+
obsidian: {
|
|
317
|
+
aliasOf: "@lapis-notes/api",
|
|
318
|
+
entry: "@lapis-notes/api",
|
|
319
|
+
moduleId: "obsidian",
|
|
320
|
+
packageName: "@lapis-notes/api",
|
|
321
|
+
platforms: ["web", "electron-renderer"],
|
|
322
|
+
public: true,
|
|
323
|
+
source: "config",
|
|
324
|
+
specifier: "obsidian",
|
|
325
|
+
version: "0.0.1",
|
|
326
|
+
},
|
|
327
|
+
svelte: {
|
|
328
|
+
entry: "svelte",
|
|
329
|
+
moduleId: "svelte",
|
|
330
|
+
packageName: "svelte",
|
|
331
|
+
platforms: ["web", "electron-renderer"],
|
|
332
|
+
public: true,
|
|
333
|
+
source: "config",
|
|
334
|
+
specifier: "svelte",
|
|
335
|
+
version: "5.55.7",
|
|
336
|
+
},
|
|
337
|
+
"svelte/internal/client": {
|
|
338
|
+
deprecated: true,
|
|
339
|
+
entry: "svelte/internal/client",
|
|
340
|
+
moduleId: "svelte-internal-client",
|
|
341
|
+
packageName: "svelte",
|
|
342
|
+
platforms: ["web", "electron-renderer"],
|
|
343
|
+
public: false,
|
|
344
|
+
reason: "Temporary compatibility only. Do not use for new plugins.",
|
|
345
|
+
source: "config",
|
|
346
|
+
specifier: "svelte/internal/client",
|
|
347
|
+
version: "5.55.7",
|
|
348
|
+
},
|
|
349
|
+
"svelte/store": {
|
|
350
|
+
entry: "svelte/store",
|
|
351
|
+
moduleId: "svelte-store",
|
|
352
|
+
packageName: "svelte",
|
|
353
|
+
platforms: ["web", "electron-renderer"],
|
|
354
|
+
public: true,
|
|
355
|
+
source: "config",
|
|
356
|
+
specifier: "svelte/store",
|
|
357
|
+
version: "5.55.7",
|
|
358
|
+
},
|
|
359
|
+
zod: {
|
|
360
|
+
entry: "zod",
|
|
361
|
+
moduleId: "zod",
|
|
362
|
+
packageName: "zod",
|
|
363
|
+
platforms: ["web", "electron-renderer"],
|
|
364
|
+
public: true,
|
|
365
|
+
source: "config",
|
|
366
|
+
specifier: "zod",
|
|
367
|
+
version: "3.25.76",
|
|
368
|
+
},
|
|
369
|
+
};
|
|
370
|
+
export const pluginHostModuleSpecifiers = Object.keys(pluginHostModuleRegistry);
|
|
371
|
+
export function isPluginHostModuleSpecifier(value) {
|
|
372
|
+
return Object.hasOwn(pluginHostModuleRegistry, value);
|
|
373
|
+
}
|
|
374
|
+
export default pluginHostModuleRegistry;
|
package/dist/glob.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type EditorAssociationGlobOptions = {
|
|
2
|
+
caseSensitive?: boolean;
|
|
3
|
+
};
|
|
4
|
+
export type EditorAssociationGlobValidation = {
|
|
5
|
+
valid: true;
|
|
6
|
+
} | {
|
|
7
|
+
valid: false;
|
|
8
|
+
message: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function normalizeGlobPath(path: string): string;
|
|
11
|
+
export declare function normalizeEditorAssociationGlob(pattern: string): string;
|
|
12
|
+
export declare function validateEditorAssociationGlob(pattern: string): EditorAssociationGlobValidation;
|
|
13
|
+
export declare function matchesEditorAssociationGlob(pattern: string, path: string, options?: EditorAssociationGlobOptions): boolean;
|
|
14
|
+
export declare function hasEditorAssociationGlobMagic(pattern: string): boolean;
|
|
15
|
+
export declare function compareEditorAssociationPatternSpecificity(left: string, right: string): number;
|
package/dist/glob.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Minimatch } from "minimatch";
|
|
2
|
+
import { Platform } from "./platform";
|
|
3
|
+
const MAGIC_TOKEN_PATTERN = /\*\*|[*?{[]/gu;
|
|
4
|
+
function editorAssociationGlobOptions(pattern, options = {}) {
|
|
5
|
+
return {
|
|
6
|
+
dot: true,
|
|
7
|
+
magicalBraces: true,
|
|
8
|
+
matchBase: !pattern.includes("/"),
|
|
9
|
+
nocase: options.caseSensitive === undefined
|
|
10
|
+
? Platform.isMacOS || Platform.isWin
|
|
11
|
+
: !options.caseSensitive,
|
|
12
|
+
nocomment: true,
|
|
13
|
+
noext: true,
|
|
14
|
+
nonegate: true,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export function normalizeGlobPath(path) {
|
|
18
|
+
return path.trim().replace(/\\+/gu, "/");
|
|
19
|
+
}
|
|
20
|
+
export function normalizeEditorAssociationGlob(pattern) {
|
|
21
|
+
return normalizeGlobPath(pattern);
|
|
22
|
+
}
|
|
23
|
+
function compileEditorAssociationGlob(pattern, options = {}) {
|
|
24
|
+
const normalizedPattern = normalizeEditorAssociationGlob(pattern);
|
|
25
|
+
if (!normalizedPattern) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
const matcher = new Minimatch(normalizedPattern, editorAssociationGlobOptions(normalizedPattern, options));
|
|
30
|
+
return matcher.makeRe() ? matcher : null;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export function validateEditorAssociationGlob(pattern) {
|
|
37
|
+
if (!normalizeEditorAssociationGlob(pattern)) {
|
|
38
|
+
return { valid: false, message: "Glob pattern must not be empty." };
|
|
39
|
+
}
|
|
40
|
+
if (!compileEditorAssociationGlob(pattern)) {
|
|
41
|
+
return { valid: false, message: "Glob pattern is invalid." };
|
|
42
|
+
}
|
|
43
|
+
return { valid: true };
|
|
44
|
+
}
|
|
45
|
+
export function matchesEditorAssociationGlob(pattern, path, options = {}) {
|
|
46
|
+
const matcher = compileEditorAssociationGlob(pattern, options);
|
|
47
|
+
return matcher?.match(normalizeGlobPath(path)) ?? false;
|
|
48
|
+
}
|
|
49
|
+
export function hasEditorAssociationGlobMagic(pattern) {
|
|
50
|
+
return compileEditorAssociationGlob(pattern)?.hasMagic() ?? false;
|
|
51
|
+
}
|
|
52
|
+
function countMagicTokens(pattern) {
|
|
53
|
+
return (normalizeEditorAssociationGlob(pattern).match(MAGIC_TOKEN_PATTERN)
|
|
54
|
+
?.length ?? 0);
|
|
55
|
+
}
|
|
56
|
+
export function compareEditorAssociationPatternSpecificity(left, right) {
|
|
57
|
+
const leftExact = hasEditorAssociationGlobMagic(left) ? 0 : 1;
|
|
58
|
+
const rightExact = hasEditorAssociationGlobMagic(right) ? 0 : 1;
|
|
59
|
+
if (leftExact !== rightExact) {
|
|
60
|
+
return leftExact - rightExact;
|
|
61
|
+
}
|
|
62
|
+
const leftLength = normalizeEditorAssociationGlob(left).length;
|
|
63
|
+
const rightLength = normalizeEditorAssociationGlob(right).length;
|
|
64
|
+
if (leftLength !== rightLength) {
|
|
65
|
+
return leftLength - rightLength;
|
|
66
|
+
}
|
|
67
|
+
return countMagicTokens(right) - countMagicTokens(left);
|
|
68
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare class HistoryManager<T> {
|
|
2
|
+
readonly updater: (state: T) => void | Promise<void>;
|
|
3
|
+
private historyStack;
|
|
4
|
+
private currentIndex;
|
|
5
|
+
private maxSize;
|
|
6
|
+
hasForward: boolean;
|
|
7
|
+
hasBackward: boolean;
|
|
8
|
+
constructor(updater: (state: T) => void | Promise<void>, maxSize?: number);
|
|
9
|
+
private limitStackSize;
|
|
10
|
+
updateState(state: Partial<T>): void;
|
|
11
|
+
get stack(): T[];
|
|
12
|
+
pushState(state: T): void;
|
|
13
|
+
replaceState(state: T): void;
|
|
14
|
+
trigger(): Promise<void>;
|
|
15
|
+
go(steps: number): Promise<void>;
|
|
16
|
+
forward(): Promise<void>;
|
|
17
|
+
back(): Promise<void>;
|
|
18
|
+
canGo(steps: number): boolean;
|
|
19
|
+
get history(): {
|
|
20
|
+
length: number;
|
|
21
|
+
state: T | null;
|
|
22
|
+
currentState: () => T | null;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export class HistoryManager {
|
|
2
|
+
updater;
|
|
3
|
+
historyStack = $state([]);
|
|
4
|
+
currentIndex = $state(-1);
|
|
5
|
+
maxSize;
|
|
6
|
+
hasForward = $derived(this.canGo(1));
|
|
7
|
+
hasBackward = $derived(this.canGo(-1));
|
|
8
|
+
constructor(updater, maxSize = 20) {
|
|
9
|
+
this.updater = updater;
|
|
10
|
+
this.maxSize = maxSize;
|
|
11
|
+
}
|
|
12
|
+
limitStackSize() {
|
|
13
|
+
while (this.historyStack.length > this.maxSize) {
|
|
14
|
+
this.historyStack.shift();
|
|
15
|
+
this.currentIndex--;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
updateState(state) {
|
|
19
|
+
if (this.historyStack.length && this.historyStack[this.currentIndex]) {
|
|
20
|
+
this.historyStack[this.currentIndex] = {
|
|
21
|
+
...this.historyStack[this.currentIndex],
|
|
22
|
+
...state,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
get stack() {
|
|
27
|
+
return [...this.historyStack];
|
|
28
|
+
}
|
|
29
|
+
pushState(state) {
|
|
30
|
+
// Clear forward history if we're adding a new state
|
|
31
|
+
this.historyStack = this.historyStack.slice(0, this.currentIndex + 1);
|
|
32
|
+
this.historyStack.push(state);
|
|
33
|
+
this.currentIndex++;
|
|
34
|
+
this.limitStackSize();
|
|
35
|
+
}
|
|
36
|
+
replaceState(state) {
|
|
37
|
+
if (this.historyStack[this.currentIndex]) {
|
|
38
|
+
this.historyStack[this.currentIndex] = state;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
trigger() {
|
|
42
|
+
if (this.currentIndex < 0 || !this.historyStack[this.currentIndex]) {
|
|
43
|
+
return Promise.resolve();
|
|
44
|
+
}
|
|
45
|
+
const state = this.historyStack[this.currentIndex];
|
|
46
|
+
return Promise.resolve(this.updater(state)).then(() => undefined);
|
|
47
|
+
}
|
|
48
|
+
go(steps) {
|
|
49
|
+
const newIndex = this.currentIndex + steps;
|
|
50
|
+
if (newIndex >= 0 && newIndex < this.historyStack.length) {
|
|
51
|
+
this.currentIndex = newIndex;
|
|
52
|
+
this.limitStackSize();
|
|
53
|
+
return this.trigger();
|
|
54
|
+
}
|
|
55
|
+
return Promise.resolve();
|
|
56
|
+
}
|
|
57
|
+
forward() {
|
|
58
|
+
return this.go(1);
|
|
59
|
+
}
|
|
60
|
+
back() {
|
|
61
|
+
return this.go(-1);
|
|
62
|
+
}
|
|
63
|
+
canGo(steps) {
|
|
64
|
+
const newIndex = this.currentIndex + steps;
|
|
65
|
+
return newIndex >= 0 && newIndex < this.historyStack.length;
|
|
66
|
+
}
|
|
67
|
+
get history() {
|
|
68
|
+
return {
|
|
69
|
+
length: this.historyStack.length,
|
|
70
|
+
state: this.currentIndex >= 0 ? this.historyStack[this.currentIndex] : null,
|
|
71
|
+
currentState: () => this.currentIndex >= 0 ? this.historyStack[this.currentIndex] : null,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Virtualizer, type PartialKeys, type VirtualizerOptions } from "@tanstack/virtual-core";
|
|
2
|
+
export * from "@tanstack/virtual-core";
|
|
3
|
+
export type SvelteVirtualizer<TScrollElement extends Element | Window, TItemElement extends Element> = Omit<Virtualizer<TScrollElement, TItemElement>, "setOptions"> & {
|
|
4
|
+
setOptions: (options: Partial<VirtualizerOptions<TScrollElement, TItemElement>>) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare function createVirtualizer<TScrollElement extends Element, TItemElement extends Element>(options: PartialKeys<VirtualizerOptions<TScrollElement, TItemElement>, "observeElementRect" | "observeElementOffset" | "scrollToFn">): SvelteVirtualizer<TScrollElement, TItemElement>;
|
|
7
|
+
export declare function createWindowVirtualizer<TItemElement extends Element>(options: PartialKeys<VirtualizerOptions<Window, TItemElement>, "getScrollElement" | "observeElementRect" | "observeElementOffset" | "scrollToFn">): SvelteVirtualizer<Window, TItemElement>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Virtualizer, elementScroll, observeElementOffset, observeElementRect, observeWindowOffset, observeWindowRect, windowScroll, } from "@tanstack/virtual-core";
|
|
2
|
+
export * from "@tanstack/virtual-core";
|
|
3
|
+
function createVirtualizerBase(options) {
|
|
4
|
+
const resolvedOptions = { ...options };
|
|
5
|
+
const instance = new Virtualizer(resolvedOptions);
|
|
6
|
+
let virtualItems = $state(instance.getVirtualItems());
|
|
7
|
+
let totalSize = $state(instance.getTotalSize());
|
|
8
|
+
const originalSetOptions = instance.setOptions;
|
|
9
|
+
const handler = {
|
|
10
|
+
get(target, prop) {
|
|
11
|
+
if (prop === "getVirtualItems")
|
|
12
|
+
return () => virtualItems;
|
|
13
|
+
if (prop === "getTotalSize")
|
|
14
|
+
return () => totalSize;
|
|
15
|
+
return Reflect.get(target, prop);
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
const virtualizer = new Proxy(instance, handler);
|
|
19
|
+
virtualizer.setOptions(resolvedOptions);
|
|
20
|
+
const setOptions = (options) => {
|
|
21
|
+
originalSetOptions({
|
|
22
|
+
...resolvedOptions,
|
|
23
|
+
...options,
|
|
24
|
+
onChange: (instance, sync) => {
|
|
25
|
+
instance._willUpdate();
|
|
26
|
+
virtualItems = instance.getVirtualItems();
|
|
27
|
+
totalSize = instance.getTotalSize();
|
|
28
|
+
options.onChange?.(instance, sync);
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
virtualizer.measure();
|
|
32
|
+
};
|
|
33
|
+
$effect(() => {
|
|
34
|
+
const cleanup = virtualizer._didMount();
|
|
35
|
+
virtualizer._willUpdate();
|
|
36
|
+
return cleanup;
|
|
37
|
+
});
|
|
38
|
+
$effect(() => {
|
|
39
|
+
virtualizer.setOptions({
|
|
40
|
+
...resolvedOptions,
|
|
41
|
+
...options,
|
|
42
|
+
onChange: (virtualizer, sync) => {
|
|
43
|
+
virtualizer._willUpdate();
|
|
44
|
+
virtualItems = virtualizer.getVirtualItems();
|
|
45
|
+
totalSize = virtualizer.getTotalSize();
|
|
46
|
+
options.onChange?.(virtualizer, sync);
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
virtualizer.measure();
|
|
50
|
+
});
|
|
51
|
+
return Object.assign(virtualizer, { setOptions });
|
|
52
|
+
}
|
|
53
|
+
export function createVirtualizer(options) {
|
|
54
|
+
return createVirtualizerBase({
|
|
55
|
+
observeElementRect: observeElementRect,
|
|
56
|
+
observeElementOffset: observeElementOffset,
|
|
57
|
+
scrollToFn: elementScroll,
|
|
58
|
+
...options,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
export function createWindowVirtualizer(options) {
|
|
62
|
+
return createVirtualizerBase({
|
|
63
|
+
getScrollElement: () => (typeof document !== "undefined" ? window : null),
|
|
64
|
+
observeElementRect: observeWindowRect,
|
|
65
|
+
observeElementOffset: observeWindowOffset,
|
|
66
|
+
scrollToFn: windowScroll,
|
|
67
|
+
initialOffset: () => (typeof document !== "undefined" ? window.scrollY : 0),
|
|
68
|
+
...options,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { untrack } from "svelte";
|
|
2
|
+
const MOBILE_BREAKPOINT = 768;
|
|
3
|
+
export class IsMobile {
|
|
4
|
+
#current = $state(false);
|
|
5
|
+
constructor() {
|
|
6
|
+
$effect(() => {
|
|
7
|
+
return untrack(() => {
|
|
8
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
9
|
+
const onChange = () => {
|
|
10
|
+
this.#current = window.innerWidth < MOBILE_BREAKPOINT;
|
|
11
|
+
};
|
|
12
|
+
mql.addEventListener("change", onChange);
|
|
13
|
+
onChange();
|
|
14
|
+
return () => {
|
|
15
|
+
mql.removeEventListener("change", onChange);
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
get current() {
|
|
21
|
+
return this.#current;
|
|
22
|
+
}
|
|
23
|
+
}
|