@lupinum/ginko-content 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/LICENSE +21 -0
- package/README.md +90 -0
- package/compatibility.json +27 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +690 -0
- package/dist/cms-contract/build +1 -0
- package/dist/cms-contract/build.d.ts +44 -0
- package/dist/cms-contract/build.js +513 -0
- package/dist/cms-contract/index +1 -0
- package/dist/cms-contract/index.d.ts +25 -0
- package/dist/cms-contract/index.js +37 -0
- package/dist/cms-contract/mdc +1 -0
- package/dist/cms-contract/mdc.d.ts +32 -0
- package/dist/cms-contract/mdc.js +52 -0
- package/dist/cms-contract/path +1 -0
- package/dist/cms-contract/path.d.ts +12 -0
- package/dist/cms-contract/path.js +18 -0
- package/dist/cms-contract/schema +1 -0
- package/dist/cms-contract/schema.d.ts +18 -0
- package/dist/cms-contract/schema.js +13 -0
- package/dist/cms-contract/types +1 -0
- package/dist/cms-contract/types.d.ts +177 -0
- package/dist/cms-contract/types.js +0 -0
- package/dist/cms-import/index +1 -0
- package/dist/cms-import/index.d.ts +21 -0
- package/dist/cms-import/index.js +57 -0
- package/dist/config.d.mts +3 -0
- package/dist/config.mjs +3 -0
- package/dist/core/cache +1 -0
- package/dist/core/cache-hints +1 -0
- package/dist/core/cache-hints.d.ts +3 -0
- package/dist/core/cache-hints.js +55 -0
- package/dist/core/cache.d.ts +29 -0
- package/dist/core/cache.js +0 -0
- package/dist/core/content/collection +1 -0
- package/dist/core/content/collection.d.ts +3 -0
- package/dist/core/content/collection.js +52 -0
- package/dist/core/content/graph +1 -0
- package/dist/core/content/graph.d.ts +147 -0
- package/dist/core/content/graph.js +189 -0
- package/dist/core/content/ignore +1 -0
- package/dist/core/content/ignore.d.ts +5 -0
- package/dist/core/content/ignore.js +10 -0
- package/dist/core/content/locale +1 -0
- package/dist/core/content/locale.d.ts +61 -0
- package/dist/core/content/locale.js +77 -0
- package/dist/core/content/path +1 -0
- package/dist/core/content/path.d.ts +36 -0
- package/dist/core/content/path.js +143 -0
- package/dist/core/content/slug +1 -0
- package/dist/core/content/slug.d.ts +4 -0
- package/dist/core/content/slug.js +41 -0
- package/dist/core/content/sources +1 -0
- package/dist/core/content/sources.d.ts +2 -0
- package/dist/core/content/sources.js +6 -0
- package/dist/core/errors +1 -0
- package/dist/core/errors.d.ts +15 -0
- package/dist/core/errors.js +10 -0
- package/dist/core/markdown/tree +1 -0
- package/dist/core/markdown/tree.d.ts +9 -0
- package/dist/core/markdown/tree.js +47 -0
- package/dist/core/query/builder +1 -0
- package/dist/core/query/builder.d.ts +18 -0
- package/dist/core/query/builder.js +186 -0
- package/dist/core/query/execute +1 -0
- package/dist/core/query/execute.d.ts +52 -0
- package/dist/core/query/execute.js +304 -0
- package/dist/core/query/filter +1 -0
- package/dist/core/query/filter.d.ts +42 -0
- package/dist/core/query/filter.js +118 -0
- package/dist/core/query/json +1 -0
- package/dist/core/query/json.d.ts +2 -0
- package/dist/core/query/json.js +20 -0
- package/dist/core/query/lower +1 -0
- package/dist/core/query/lower.d.ts +14 -0
- package/dist/core/query/lower.js +121 -0
- package/dist/core/query/operators +1 -0
- package/dist/core/query/operators.d.ts +23 -0
- package/dist/core/query/operators.js +126 -0
- package/dist/core/query/params +1 -0
- package/dist/core/query/params.d.ts +15 -0
- package/dist/core/query/params.js +83 -0
- package/dist/core/query/plan +1 -0
- package/dist/core/query/plan.d.ts +110 -0
- package/dist/core/query/plan.js +0 -0
- package/dist/core/references/resolve +1 -0
- package/dist/core/references/resolve.d.ts +31 -0
- package/dist/core/references/resolve.js +121 -0
- package/dist/core/references/schema +1 -0
- package/dist/core/references/schema.d.ts +8 -0
- package/dist/core/references/schema.js +70 -0
- package/dist/core/result +1 -0
- package/dist/core/result.d.ts +27 -0
- package/dist/core/result.js +2 -0
- package/dist/features/collections/resolve +1 -0
- package/dist/features/collections/resolve.d.ts +63 -0
- package/dist/features/collections/resolve.js +76 -0
- package/dist/features/localization/config +1 -0
- package/dist/features/localization/config.d.ts +18 -0
- package/dist/features/localization/config.js +25 -0
- package/dist/features/localization/links +1 -0
- package/dist/features/localization/links.d.ts +1 -0
- package/dist/features/localization/links.js +69 -0
- package/dist/features/localization/path +1 -0
- package/dist/features/localization/path.d.ts +32 -0
- package/dist/features/localization/path.js +80 -0
- package/dist/features/localization/results +1 -0
- package/dist/features/localization/results.d.ts +42 -0
- package/dist/features/localization/results.js +149 -0
- package/dist/features/localization/translated-slugs +1 -0
- package/dist/features/localization/translated-slugs.d.ts +11 -0
- package/dist/features/localization/translated-slugs.js +80 -0
- package/dist/features/navigation/build +1 -0
- package/dist/features/navigation/build.d.ts +28 -0
- package/dist/features/navigation/build.js +104 -0
- package/dist/features/navigation/canonical +1 -0
- package/dist/features/navigation/canonical.d.ts +33 -0
- package/dist/features/navigation/canonical.js +149 -0
- package/dist/features/navigation/query +1 -0
- package/dist/features/navigation/query.d.ts +19 -0
- package/dist/features/navigation/query.js +51 -0
- package/dist/features/navigation/resolve +1 -0
- package/dist/features/navigation/resolve.d.ts +20 -0
- package/dist/features/navigation/resolve.js +79 -0
- package/dist/features/navigation/tree +1 -0
- package/dist/features/navigation/tree.d.ts +6 -0
- package/dist/features/navigation/tree.js +32 -0
- package/dist/features/search/navigation +1 -0
- package/dist/features/search/navigation.d.ts +6 -0
- package/dist/features/search/navigation.js +21 -0
- package/dist/features/search/sections +1 -0
- package/dist/features/search/sections.d.ts +21 -0
- package/dist/features/search/sections.js +98 -0
- package/dist/features/sitemap/query +1 -0
- package/dist/features/sitemap/query.d.ts +68 -0
- package/dist/features/sitemap/query.js +171 -0
- package/dist/integrations/nitro/context +1 -0
- package/dist/integrations/nitro/context.d.ts +63 -0
- package/dist/integrations/nitro/context.js +28 -0
- package/dist/integrations/nitro/ingest +1 -0
- package/dist/integrations/nitro/ingest.d.ts +18 -0
- package/dist/integrations/nitro/ingest.js +120 -0
- package/dist/integrations/nitro/preview +1 -0
- package/dist/integrations/nitro/preview.d.ts +5 -0
- package/dist/integrations/nitro/preview.js +21 -0
- package/dist/integrations/nitro/runtime-config +1 -0
- package/dist/integrations/nitro/runtime-config.d.ts +1 -0
- package/dist/integrations/nitro/runtime-config.js +4 -0
- package/dist/integrations/nitro/storage +1 -0
- package/dist/integrations/nitro/storage.d.ts +9 -0
- package/dist/integrations/nitro/storage.js +113 -0
- package/dist/integrations/vue/content-components +1 -0
- package/dist/integrations/vue/content-components.d.ts +24 -0
- package/dist/integrations/vue/content-components.js +67 -0
- package/dist/integrations/vue/html-tags +1 -0
- package/dist/integrations/vue/html-tags.d.ts +2 -0
- package/dist/integrations/vue/html-tags.js +119 -0
- package/dist/integrations/vue/markdown-refs +1 -0
- package/dist/integrations/vue/markdown-refs.d.ts +1 -0
- package/dist/integrations/vue/markdown-refs.js +1 -0
- package/dist/module.d.mts +2044 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +1381 -0
- package/dist/parsers/csv +1 -0
- package/dist/parsers/csv.d.ts +2 -0
- package/dist/parsers/csv.js +38 -0
- package/dist/parsers/from-csv +1 -0
- package/dist/parsers/from-csv.d.ts +20 -0
- package/dist/parsers/from-csv.js +85 -0
- package/dist/parsers/index +1 -0
- package/dist/parsers/index.d.ts +10 -0
- package/dist/parsers/index.js +50 -0
- package/dist/parsers/json +1 -0
- package/dist/parsers/json.d.ts +2 -0
- package/dist/parsers/json.js +29 -0
- package/dist/parsers/markdown +1 -0
- package/dist/parsers/markdown-plugins +1 -0
- package/dist/parsers/markdown-plugins.d.ts +3 -0
- package/dist/parsers/markdown-plugins.js +58 -0
- package/dist/parsers/markdown.d.ts +2 -0
- package/dist/parsers/markdown.js +64 -0
- package/dist/parsers/path-meta +1 -0
- package/dist/parsers/path-meta.d.ts +4 -0
- package/dist/parsers/path-meta.js +37 -0
- package/dist/parsers/utils +1 -0
- package/dist/parsers/utils.d.ts +2 -0
- package/dist/parsers/utils.js +3 -0
- package/dist/parsers/yaml +1 -0
- package/dist/parsers/yaml.d.ts +2 -0
- package/dist/parsers/yaml.js +19 -0
- package/dist/public/client +1 -0
- package/dist/public/client.d.ts +19 -0
- package/dist/public/client.js +26 -0
- package/dist/public/provider +1 -0
- package/dist/public/provider-errors +1 -0
- package/dist/public/provider-errors.d.ts +4 -0
- package/dist/public/provider-errors.js +28 -0
- package/dist/public/provider.d.ts +74 -0
- package/dist/public/provider.js +6 -0
- package/dist/public/server +1 -0
- package/dist/public/server.d.ts +19 -0
- package/dist/public/server.js +28 -0
- package/dist/runtime/app/components/ContentRenderer.d.vue.ts +62 -0
- package/dist/runtime/app/components/ContentRenderer.vue +84 -0
- package/dist/runtime/app/components/ContentRenderer.vue.d.ts +62 -0
- package/dist/runtime/app/components/ContentRendererInline.d.vue.ts +50 -0
- package/dist/runtime/app/components/ContentRendererInline.vue +97 -0
- package/dist/runtime/app/components/ContentRendererInline.vue.d.ts +50 -0
- package/dist/runtime/app/components/Prose/ProseCode.d.vue.ts +61 -0
- package/dist/runtime/app/components/Prose/ProseCode.vue +32 -0
- package/dist/runtime/app/components/Prose/ProseCode.vue.d.ts +61 -0
- package/dist/runtime/app/components/Prose/ProseCodeInline.d.vue.ts +13 -0
- package/dist/runtime/app/components/Prose/ProseCodeInline.vue +3 -0
- package/dist/runtime/app/components/Prose/ProseCodeInline.vue.d.ts +13 -0
- package/dist/runtime/app/components/Prose/ProseImg.d.vue.ts +59 -0
- package/dist/runtime/app/components/Prose/ProseImg.vue +59 -0
- package/dist/runtime/app/components/Prose/ProseImg.vue.d.ts +59 -0
- package/dist/runtime/app/components/Prose/ProsePre.d.vue.ts +79 -0
- package/dist/runtime/app/components/Prose/ProsePre.vue +42 -0
- package/dist/runtime/app/components/Prose/ProsePre.vue.d.ts +79 -0
- package/dist/runtime/app/components/internal/ContentRendererMarkdown.d.vue.ts +68 -0
- package/dist/runtime/app/components/internal/ContentRendererMarkdown.vue +99 -0
- package/dist/runtime/app/components/internal/ContentRendererMarkdown.vue.d.ts +68 -0
- package/dist/runtime/app/components/internal/MarkdownRenderer +1 -0
- package/dist/runtime/app/components/internal/MarkdownRenderer.d.ts +90 -0
- package/dist/runtime/app/components/internal/MarkdownRenderer.js +191 -0
- package/dist/runtime/app/composables/async-data +1 -0
- package/dist/runtime/app/composables/async-data.d.ts +2 -0
- package/dist/runtime/app/composables/async-data.js +4 -0
- package/dist/runtime/app/composables/content-i18n +1 -0
- package/dist/runtime/app/composables/content-i18n.d.ts +5 -0
- package/dist/runtime/app/composables/content-i18n.js +1 -0
- package/dist/runtime/app/composables/head +1 -0
- package/dist/runtime/app/composables/head.d.ts +11 -0
- package/dist/runtime/app/composables/head.js +98 -0
- package/dist/runtime/app/composables/locale +1 -0
- package/dist/runtime/app/composables/locale-context +1 -0
- package/dist/runtime/app/composables/locale-context.d.ts +5 -0
- package/dist/runtime/app/composables/locale-context.js +8 -0
- package/dist/runtime/app/composables/locale.d.ts +8 -0
- package/dist/runtime/app/composables/locale.js +15 -0
- package/dist/runtime/app/composables/navigation +1 -0
- package/dist/runtime/app/composables/navigation.d.ts +3 -0
- package/dist/runtime/app/composables/navigation.js +7 -0
- package/dist/runtime/app/composables/preview +1 -0
- package/dist/runtime/app/composables/preview.d.ts +5 -0
- package/dist/runtime/app/composables/preview.js +52 -0
- package/dist/runtime/app/composables/query-api +1 -0
- package/dist/runtime/app/composables/query-api.d.ts +27 -0
- package/dist/runtime/app/composables/query-api.js +46 -0
- package/dist/runtime/app/composables/route +1 -0
- package/dist/runtime/app/composables/route.d.ts +11 -0
- package/dist/runtime/app/composables/route.js +150 -0
- package/dist/runtime/app/composables/runtime +1 -0
- package/dist/runtime/app/composables/runtime.d.ts +2 -0
- package/dist/runtime/app/composables/runtime.js +7 -0
- package/dist/runtime/app/composables/search +1 -0
- package/dist/runtime/app/composables/search.d.ts +58 -0
- package/dist/runtime/app/composables/search.js +321 -0
- package/dist/runtime/app/composables/site-data +1 -0
- package/dist/runtime/app/composables/site-data.d.ts +12 -0
- package/dist/runtime/app/composables/site-data.js +12 -0
- package/dist/runtime/app/composables/toc +1 -0
- package/dist/runtime/app/composables/toc.d.ts +10 -0
- package/dist/runtime/app/composables/toc.js +31 -0
- package/dist/runtime/app/composables/use-content +1 -0
- package/dist/runtime/app/composables/use-content.d.ts +188 -0
- package/dist/runtime/app/composables/use-content.js +307 -0
- package/dist/runtime/app/composables/useUnwrap +1 -0
- package/dist/runtime/app/composables/useUnwrap.d.ts +8 -0
- package/dist/runtime/app/composables/useUnwrap.js +35 -0
- package/dist/runtime/app/composables/utils +1 -0
- package/dist/runtime/app/composables/utils.d.ts +22 -0
- package/dist/runtime/app/composables/utils.js +76 -0
- package/dist/runtime/app/composables/web-socket +1 -0
- package/dist/runtime/app/composables/web-socket.d.ts +3 -0
- package/dist/runtime/app/composables/web-socket.js +65 -0
- package/dist/runtime/app/pages/content.d.vue.ts +3 -0
- package/dist/runtime/app/pages/content.vue +14 -0
- package/dist/runtime/app/pages/content.vue.d.ts +3 -0
- package/dist/runtime/app/plugins/markdown-components +1 -0
- package/dist/runtime/app/plugins/markdown-components.d.ts +2 -0
- package/dist/runtime/app/plugins/markdown-components.js +19 -0
- package/dist/runtime/app/plugins/ws +1 -0
- package/dist/runtime/app/plugins/ws.d.ts +2 -0
- package/dist/runtime/app/plugins/ws.js +7 -0
- package/dist/runtime/app.d.vue.ts +3 -0
- package/dist/runtime/app.vue +3 -0
- package/dist/runtime/app.vue.d.ts +3 -0
- package/dist/runtime/markdown/plugins +1 -0
- package/dist/runtime/markdown/plugins.d.ts +3 -0
- package/dist/runtime/markdown/plugins.js +39 -0
- package/dist/runtime/query/public-limits +1 -0
- package/dist/runtime/query/public-limits.d.ts +2 -0
- package/dist/runtime/query/public-limits.js +2 -0
- package/dist/runtime/query/resolve +1 -0
- package/dist/runtime/query/resolve.d.ts +5 -0
- package/dist/runtime/query/resolve.js +9 -0
- package/dist/runtime/query/routes +1 -0
- package/dist/runtime/query/routes.d.ts +33 -0
- package/dist/runtime/query/routes.js +21 -0
- package/dist/runtime/query/unified +1 -0
- package/dist/runtime/query/unified.d.ts +94 -0
- package/dist/runtime/query/unified.js +473 -0
- package/dist/runtime/server/api/cache +1 -0
- package/dist/runtime/server/api/cache.d.ts +8 -0
- package/dist/runtime/server/api/cache.js +26 -0
- package/dist/runtime/server/api/locales +1 -0
- package/dist/runtime/server/api/locales.d.ts +6 -0
- package/dist/runtime/server/api/locales.js +28 -0
- package/dist/runtime/server/api/navigation +1 -0
- package/dist/runtime/server/api/navigation.d.ts +2 -0
- package/dist/runtime/server/api/navigation.js +21 -0
- package/dist/runtime/server/api/query +1 -0
- package/dist/runtime/server/api/query.d.ts +2 -0
- package/dist/runtime/server/api/query.js +6 -0
- package/dist/runtime/server/api/revalidate +1 -0
- package/dist/runtime/server/api/revalidate.d.ts +6 -0
- package/dist/runtime/server/api/revalidate.js +156 -0
- package/dist/runtime/server/api/search +1 -0
- package/dist/runtime/server/api/search-index +1 -0
- package/dist/runtime/server/api/search-index.d.ts +2 -0
- package/dist/runtime/server/api/search-index.js +20 -0
- package/dist/runtime/server/api/search.d.ts +2 -0
- package/dist/runtime/server/api/search.js +40 -0
- package/dist/runtime/server/api/site-data +1 -0
- package/dist/runtime/server/api/site-data.d.ts +2 -0
- package/dist/runtime/server/api/site-data.js +22 -0
- package/dist/runtime/server/api/sitemap +1 -0
- package/dist/runtime/server/api/sitemap.d.ts +2 -0
- package/dist/runtime/server/api/sitemap.js +11 -0
- package/dist/runtime/server/cache-adapter +1 -0
- package/dist/runtime/server/cache-adapter.d.ts +2 -0
- package/dist/runtime/server/cache-adapter.js +11 -0
- package/dist/runtime/server/cache-adapters +1 -0
- package/dist/runtime/server/cache-adapters.d.ts +9 -0
- package/dist/runtime/server/cache-adapters.js +50 -0
- package/dist/runtime/server/cache-hints +1 -0
- package/dist/runtime/server/cache-hints.d.ts +5 -0
- package/dist/runtime/server/cache-hints.js +17 -0
- package/dist/runtime/server/collection-helpers +1 -0
- package/dist/runtime/server/collection-helpers.d.ts +13 -0
- package/dist/runtime/server/collection-helpers.js +99 -0
- package/dist/runtime/server/index +1 -0
- package/dist/runtime/server/index.d.ts +9 -0
- package/dist/runtime/server/index.js +15 -0
- package/dist/runtime/server/manifest +1 -0
- package/dist/runtime/server/manifest.d.ts +1 -0
- package/dist/runtime/server/manifest.js +1 -0
- package/dist/runtime/server/navigation +1 -0
- package/dist/runtime/server/navigation-query +1 -0
- package/dist/runtime/server/navigation-query.d.ts +4 -0
- package/dist/runtime/server/navigation-query.js +80 -0
- package/dist/runtime/server/navigation.d.ts +2 -0
- package/dist/runtime/server/navigation.js +9 -0
- package/dist/runtime/server/pagefind +1 -0
- package/dist/runtime/server/pagefind.d.ts +2 -0
- package/dist/runtime/server/pagefind.js +30 -0
- package/dist/runtime/server/plugins/cache +1 -0
- package/dist/runtime/server/plugins/cache.d.ts +2 -0
- package/dist/runtime/server/plugins/cache.js +17 -0
- package/dist/runtime/server/plugins/sitemap +1 -0
- package/dist/runtime/server/plugins/sitemap.d.ts +2 -0
- package/dist/runtime/server/plugins/sitemap.js +25 -0
- package/dist/runtime/server/preview +1 -0
- package/dist/runtime/server/preview.d.ts +1 -0
- package/dist/runtime/server/preview.js +1 -0
- package/dist/runtime/server/provider-query +1 -0
- package/dist/runtime/server/provider-query.d.ts +27 -0
- package/dist/runtime/server/provider-query.js +131 -0
- package/dist/runtime/server/provider-result +1 -0
- package/dist/runtime/server/provider-result.d.ts +10 -0
- package/dist/runtime/server/provider-result.js +30 -0
- package/dist/runtime/server/providers/filesystem +1 -0
- package/dist/runtime/server/providers/filesystem.d.ts +2 -0
- package/dist/runtime/server/providers/filesystem.js +47 -0
- package/dist/runtime/server/providers/index +1 -0
- package/dist/runtime/server/providers/index.d.ts +3 -0
- package/dist/runtime/server/providers/index.js +190 -0
- package/dist/runtime/server/query-api +1 -0
- package/dist/runtime/server/query-api.d.ts +28 -0
- package/dist/runtime/server/query-api.js +54 -0
- package/dist/runtime/server/query-executor +1 -0
- package/dist/runtime/server/query-executor.d.ts +4 -0
- package/dist/runtime/server/query-executor.js +121 -0
- package/dist/runtime/server/runtime-config +1 -0
- package/dist/runtime/server/runtime-config.d.ts +1 -0
- package/dist/runtime/server/runtime-config.js +1 -0
- package/dist/runtime/server/search +1 -0
- package/dist/runtime/server/search.d.ts +18 -0
- package/dist/runtime/server/search.js +134 -0
- package/dist/runtime/server/sitemap +1 -0
- package/dist/runtime/server/sitemap-provider +1 -0
- package/dist/runtime/server/sitemap-provider.d.ts +10 -0
- package/dist/runtime/server/sitemap-provider.js +11 -0
- package/dist/runtime/server/sitemap.d.ts +6 -0
- package/dist/runtime/server/sitemap.js +45 -0
- package/dist/runtime/server/storage +1 -0
- package/dist/runtime/server/storage-access +1 -0
- package/dist/runtime/server/storage-access.d.ts +1 -0
- package/dist/runtime/server/storage-access.js +9 -0
- package/dist/runtime/server/storage.d.ts +2 -0
- package/dist/runtime/server/storage.js +2 -0
- package/dist/runtime/server/validation +1 -0
- package/dist/runtime/server/validation.d.ts +1 -0
- package/dist/runtime/server/validation.js +6 -0
- package/dist/runtime/shared/search +1 -0
- package/dist/runtime/shared/search.d.ts +2 -0
- package/dist/runtime/shared/search.js +89 -0
- package/dist/runtime/transformers/component-resolver +1 -0
- package/dist/runtime/transformers/component-resolver.d.ts +10 -0
- package/dist/runtime/transformers/component-resolver.js +30 -0
- package/dist/runtime/transformers/csv/from-csv +1 -0
- package/dist/runtime/transformers/csv/from-csv.d.ts +1 -0
- package/dist/runtime/transformers/csv/from-csv.js +1 -0
- package/dist/runtime/transformers/csv/index +1 -0
- package/dist/runtime/transformers/csv/index.d.ts +1 -0
- package/dist/runtime/transformers/csv/index.js +1 -0
- package/dist/runtime/transformers/define +1 -0
- package/dist/runtime/transformers/define.d.ts +1 -0
- package/dist/runtime/transformers/define.js +1 -0
- package/dist/runtime/transformers/index +1 -0
- package/dist/runtime/transformers/index.d.ts +1 -0
- package/dist/runtime/transformers/index.js +1 -0
- package/dist/runtime/transformers/json +1 -0
- package/dist/runtime/transformers/json.d.ts +1 -0
- package/dist/runtime/transformers/json.js +1 -0
- package/dist/runtime/transformers/markdown +1 -0
- package/dist/runtime/transformers/markdown.d.ts +1 -0
- package/dist/runtime/transformers/markdown.js +1 -0
- package/dist/runtime/transformers/path-meta +1 -0
- package/dist/runtime/transformers/path-meta.d.ts +2 -0
- package/dist/runtime/transformers/path-meta.js +2 -0
- package/dist/runtime/transformers/utils +1 -0
- package/dist/runtime/transformers/utils.d.ts +1 -0
- package/dist/runtime/transformers/utils.js +1 -0
- package/dist/runtime/transformers/yaml +1 -0
- package/dist/runtime/transformers/yaml.d.ts +1 -0
- package/dist/runtime/transformers/yaml.js +1 -0
- package/dist/runtime/utils/content-components +1 -0
- package/dist/runtime/utils/content-components.d.ts +9 -0
- package/dist/runtime/utils/content-components.js +16 -0
- package/dist/runtime/utils/query +1 -0
- package/dist/runtime/utils/query.d.ts +5 -0
- package/dist/runtime/utils/query.js +18 -0
- package/dist/runtime/virtual/transformers.d.ts +4 -0
- package/dist/runtime/virtual.d.ts +7 -0
- package/dist/storage/cache +1 -0
- package/dist/storage/cache.d.ts +32 -0
- package/dist/storage/cache.js +42 -0
- package/dist/storage/content +1 -0
- package/dist/storage/content.d.ts +41 -0
- package/dist/storage/content.js +86 -0
- package/dist/storage/contents +1 -0
- package/dist/storage/contents.d.ts +5 -0
- package/dist/storage/contents.js +116 -0
- package/dist/storage/driver +1 -0
- package/dist/storage/driver.d.ts +28 -0
- package/dist/storage/driver.js +22 -0
- package/dist/storage/graph +1 -0
- package/dist/storage/graph.d.ts +3 -0
- package/dist/storage/graph.js +14 -0
- package/dist/storage/manifest +1 -0
- package/dist/storage/manifest.d.ts +18 -0
- package/dist/storage/manifest.js +68 -0
- package/dist/storage/references +1 -0
- package/dist/storage/references.d.ts +13 -0
- package/dist/storage/references.js +78 -0
- package/dist/storage/validation +1 -0
- package/dist/storage/validation.d.ts +46 -0
- package/dist/storage/validation.js +341 -0
- package/dist/testing/provider-contract +1 -0
- package/dist/testing/provider-contract.d.ts +31 -0
- package/dist/testing/provider-contract.js +237 -0
- package/dist/testing/provider-fixture +1 -0
- package/dist/testing/provider-fixture.d.ts +65 -0
- package/dist/testing/provider-fixture.js +606 -0
- package/dist/types/api +1 -0
- package/dist/types/api.d.ts +47 -0
- package/dist/types/api.js +1 -0
- package/dist/types/config +1 -0
- package/dist/types/config.d.ts +281 -0
- package/dist/types/config.js +28 -0
- package/dist/types/content +1 -0
- package/dist/types/content.d.ts +311 -0
- package/dist/types/content.js +1 -0
- package/dist/types/fields +1 -0
- package/dist/types/fields.d.ts +81 -0
- package/dist/types/fields.js +146 -0
- package/dist/types/index +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.js +6 -0
- package/dist/types/module +1 -0
- package/dist/types/module.d.ts +428 -0
- package/dist/types/module.js +0 -0
- package/dist/types/picomatch.d.ts +8 -0
- package/dist/types/query +1 -0
- package/dist/types/query.d.ts +862 -0
- package/dist/types/query.js +1 -0
- package/dist/types/reference +1 -0
- package/dist/types/reference.d.ts +1 -0
- package/dist/types/reference.js +1 -0
- package/dist/types/runtime +1 -0
- package/dist/types/runtime.d.ts +45 -0
- package/dist/types/runtime.js +1 -0
- package/dist/types/search +1 -0
- package/dist/types/search.d.ts +64 -0
- package/dist/types/search.js +0 -0
- package/dist/types/virtual.d.ts +19 -0
- package/dist/types.d.mts +11 -0
- package/dist/web-types.json +466 -0
- package/package.json +135 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { PropType, VNode } from 'vue';
|
|
2
|
+
import type { MarkdownRoot } from '../../../../types/content';
|
|
3
|
+
export declare function localizeMarkdownNodeProps(props: Record<string, any>, locale?: string, defaultLocale?: string, locales?: string[]): Record<string, any>;
|
|
4
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
tree: {
|
|
6
|
+
type: PropType<MarkdownRoot>;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
components: {
|
|
10
|
+
type: PropType<Record<string, any>>;
|
|
11
|
+
default: () => {};
|
|
12
|
+
};
|
|
13
|
+
prose: {
|
|
14
|
+
type: PropType<boolean | undefined>;
|
|
15
|
+
default: undefined;
|
|
16
|
+
};
|
|
17
|
+
tag: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
class: {
|
|
22
|
+
type: (ObjectConstructor | StringConstructor | ArrayConstructor)[];
|
|
23
|
+
default: undefined;
|
|
24
|
+
};
|
|
25
|
+
dataContentId: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
default: undefined;
|
|
28
|
+
};
|
|
29
|
+
locale: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
default: undefined;
|
|
32
|
+
};
|
|
33
|
+
defaultLocale: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
default: undefined;
|
|
36
|
+
};
|
|
37
|
+
locales: {
|
|
38
|
+
type: PropType<string[]>;
|
|
39
|
+
default: () => never[];
|
|
40
|
+
};
|
|
41
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
44
|
+
tree: {
|
|
45
|
+
type: PropType<MarkdownRoot>;
|
|
46
|
+
required: true;
|
|
47
|
+
};
|
|
48
|
+
components: {
|
|
49
|
+
type: PropType<Record<string, any>>;
|
|
50
|
+
default: () => {};
|
|
51
|
+
};
|
|
52
|
+
prose: {
|
|
53
|
+
type: PropType<boolean | undefined>;
|
|
54
|
+
default: undefined;
|
|
55
|
+
};
|
|
56
|
+
tag: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
default: string;
|
|
59
|
+
};
|
|
60
|
+
class: {
|
|
61
|
+
type: (ObjectConstructor | StringConstructor | ArrayConstructor)[];
|
|
62
|
+
default: undefined;
|
|
63
|
+
};
|
|
64
|
+
dataContentId: {
|
|
65
|
+
type: StringConstructor;
|
|
66
|
+
default: undefined;
|
|
67
|
+
};
|
|
68
|
+
locale: {
|
|
69
|
+
type: StringConstructor;
|
|
70
|
+
default: undefined;
|
|
71
|
+
};
|
|
72
|
+
defaultLocale: {
|
|
73
|
+
type: StringConstructor;
|
|
74
|
+
default: undefined;
|
|
75
|
+
};
|
|
76
|
+
locales: {
|
|
77
|
+
type: PropType<string[]>;
|
|
78
|
+
default: () => never[];
|
|
79
|
+
};
|
|
80
|
+
}>> & Readonly<{}>, {
|
|
81
|
+
defaultLocale: string;
|
|
82
|
+
locales: string[];
|
|
83
|
+
locale: string;
|
|
84
|
+
class: string | unknown[] | Record<string, any>;
|
|
85
|
+
components: Record<string, any>;
|
|
86
|
+
prose: boolean | undefined;
|
|
87
|
+
tag: string;
|
|
88
|
+
dataContentId: string;
|
|
89
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
90
|
+
export default _default;
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { defineComponent, getCurrentInstance, h } from "vue";
|
|
2
|
+
import { kebabCase, pascalCase } from "scule";
|
|
3
|
+
import htmlTags from "../../../../integrations/vue/html-tags.js";
|
|
4
|
+
import { localizeLinkProps } from "../../../../features/localization/links";
|
|
5
|
+
function parsePropValue(value) {
|
|
6
|
+
if (value === "true") return true;
|
|
7
|
+
if (value === "false") return false;
|
|
8
|
+
if (value === "null") return null;
|
|
9
|
+
try {
|
|
10
|
+
return JSON.parse(value);
|
|
11
|
+
} catch {
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export function localizeMarkdownNodeProps(props, locale, defaultLocale, locales = []) {
|
|
16
|
+
if (!locale || props == null || Object.keys(props).length === 0) {
|
|
17
|
+
return props;
|
|
18
|
+
}
|
|
19
|
+
const localizedProps = structuredClone(props);
|
|
20
|
+
localizeLinkProps(localizedProps, locale, defaultLocale, locales);
|
|
21
|
+
return localizedProps;
|
|
22
|
+
}
|
|
23
|
+
function resolveVueComponent(name, components, registry, prose, seen = /* @__PURE__ */ new Set()) {
|
|
24
|
+
if (seen.has(name)) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
seen.add(name);
|
|
28
|
+
const candidates = [
|
|
29
|
+
name,
|
|
30
|
+
pascalCase(name),
|
|
31
|
+
kebabCase(name)
|
|
32
|
+
];
|
|
33
|
+
if (prose !== false) {
|
|
34
|
+
candidates.unshift(`Prose${pascalCase(name)}`);
|
|
35
|
+
}
|
|
36
|
+
for (const candidate of candidates) {
|
|
37
|
+
const explicit = components[candidate];
|
|
38
|
+
if (explicit) {
|
|
39
|
+
if (typeof explicit === "string" && explicit !== candidate && !htmlTags.includes(explicit)) {
|
|
40
|
+
return resolveVueComponent(explicit, components, registry, prose, seen) || explicit;
|
|
41
|
+
}
|
|
42
|
+
return explicit;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
for (const candidate of candidates) {
|
|
46
|
+
const registered = registry[candidate];
|
|
47
|
+
if (registered) {
|
|
48
|
+
return registered;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
function renderNode(node, options, key, parent) {
|
|
54
|
+
if (node.type === "text") {
|
|
55
|
+
return node.value || "";
|
|
56
|
+
}
|
|
57
|
+
const tag = node.tag;
|
|
58
|
+
if (!tag) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
const nodeProps = localizeMarkdownNodeProps(
|
|
62
|
+
node.props || {},
|
|
63
|
+
options.locale,
|
|
64
|
+
options.defaultLocale,
|
|
65
|
+
options.locales
|
|
66
|
+
);
|
|
67
|
+
const children = node.children || [];
|
|
68
|
+
let component = tag;
|
|
69
|
+
if (parent?.tag === "pre") {
|
|
70
|
+
component = tag;
|
|
71
|
+
} else {
|
|
72
|
+
const resolvedAs = typeof nodeProps.as === "string" ? resolveVueComponent(nodeProps.as, options.components, options.registry, options.prose) : null;
|
|
73
|
+
const resolvedComponent = resolvedAs || resolveVueComponent(tag, options.components, options.registry, options.prose);
|
|
74
|
+
if (resolvedComponent) {
|
|
75
|
+
component = resolvedComponent;
|
|
76
|
+
} else if (htmlTags.includes(tag)) {
|
|
77
|
+
component = tag;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const props = {};
|
|
81
|
+
for (const propKey in nodeProps) {
|
|
82
|
+
if (propKey === "$") {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (propKey === "className") {
|
|
86
|
+
props.class = nodeProps[propKey];
|
|
87
|
+
} else if (propKey.startsWith(":") && typeof nodeProps[propKey] === "string") {
|
|
88
|
+
props[propKey.slice(1)] = parsePropValue(nodeProps[propKey]);
|
|
89
|
+
} else {
|
|
90
|
+
props[propKey] = nodeProps[propKey];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (key !== void 0) {
|
|
94
|
+
props.key = key;
|
|
95
|
+
}
|
|
96
|
+
if (component?.props?.__node || component?.__asyncResolved?.props?.__node) {
|
|
97
|
+
props.__node = node;
|
|
98
|
+
}
|
|
99
|
+
if (children.length === 0) {
|
|
100
|
+
return h(component, props);
|
|
101
|
+
}
|
|
102
|
+
const slots = {};
|
|
103
|
+
const regularChildren = [];
|
|
104
|
+
for (let index = 0; index < children.length; index++) {
|
|
105
|
+
const child = children[index];
|
|
106
|
+
if (child == null) {
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
const childTag = child.tag;
|
|
110
|
+
const childProps = child.props || {};
|
|
111
|
+
if (childTag === "template") {
|
|
112
|
+
const slotName = typeof childProps.name === "string" ? childProps.name : Object.keys(childProps).find((key2) => key2.startsWith("v-slot:"))?.slice(7);
|
|
113
|
+
if (slotName) {
|
|
114
|
+
const slotChildren = (child.children || []).map((slotChild, slotIndex) => renderNode(slotChild, options, slotIndex, node)).filter((slotChild) => slotChild !== null);
|
|
115
|
+
slots[slotName] = () => slotChildren;
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const rendered = renderNode(child, options, index, node);
|
|
120
|
+
if (rendered !== null) {
|
|
121
|
+
regularChildren.push(rendered);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (typeof component !== "string" || !htmlTags.includes(component)) {
|
|
125
|
+
if (regularChildren.length > 0) {
|
|
126
|
+
slots.default = () => regularChildren;
|
|
127
|
+
}
|
|
128
|
+
return h(component, props, slots);
|
|
129
|
+
}
|
|
130
|
+
return h(component, props, regularChildren);
|
|
131
|
+
}
|
|
132
|
+
export default defineComponent({
|
|
133
|
+
name: "MarkdownRenderer",
|
|
134
|
+
props: {
|
|
135
|
+
tree: {
|
|
136
|
+
type: Object,
|
|
137
|
+
required: true
|
|
138
|
+
},
|
|
139
|
+
components: {
|
|
140
|
+
type: Object,
|
|
141
|
+
default: () => ({})
|
|
142
|
+
},
|
|
143
|
+
prose: {
|
|
144
|
+
type: Boolean,
|
|
145
|
+
default: void 0
|
|
146
|
+
},
|
|
147
|
+
tag: {
|
|
148
|
+
type: String,
|
|
149
|
+
default: "div"
|
|
150
|
+
},
|
|
151
|
+
class: {
|
|
152
|
+
type: [String, Array, Object],
|
|
153
|
+
default: void 0
|
|
154
|
+
},
|
|
155
|
+
dataContentId: {
|
|
156
|
+
type: String,
|
|
157
|
+
default: void 0
|
|
158
|
+
},
|
|
159
|
+
locale: {
|
|
160
|
+
type: String,
|
|
161
|
+
default: void 0
|
|
162
|
+
},
|
|
163
|
+
defaultLocale: {
|
|
164
|
+
type: String,
|
|
165
|
+
default: void 0
|
|
166
|
+
},
|
|
167
|
+
locales: {
|
|
168
|
+
type: Array,
|
|
169
|
+
default: () => []
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
setup(props) {
|
|
173
|
+
const registry = getCurrentInstance()?.appContext?.components || {};
|
|
174
|
+
const attrs = getCurrentInstance()?.attrs || {};
|
|
175
|
+
return () => {
|
|
176
|
+
const children = (props.tree.children || []).map((node, index) => renderNode(node, {
|
|
177
|
+
components: props.components,
|
|
178
|
+
registry,
|
|
179
|
+
prose: props.prose,
|
|
180
|
+
locale: props.locale,
|
|
181
|
+
defaultLocale: props.defaultLocale,
|
|
182
|
+
locales: props.locales
|
|
183
|
+
}, index)).filter((child) => child !== null);
|
|
184
|
+
return h(props.tag, {
|
|
185
|
+
class: props.class,
|
|
186
|
+
"data-content-id": props.dataContentId,
|
|
187
|
+
...attrs
|
|
188
|
+
}, children);
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './async-data.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './content-i18n.js'
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare module '#build/content-i18n.mjs' {
|
|
2
|
+
export function useRouteBaseName(): (route: { name?: unknown } | unknown) => string | undefined
|
|
3
|
+
export function useSetI18nParams(): (params: Record<string, unknown>) => void
|
|
4
|
+
export function useSwitchLocalePath(): (locale: string) => string
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useRouteBaseName, useSetI18nParams, useSwitchLocalePath } from "#build/content-i18n.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './head.js'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RouteLocationNormalized, RouteLocationNormalizedLoaded } from 'vue-router';
|
|
2
|
+
import type { Ref } from 'vue';
|
|
3
|
+
import type { ParsedContent } from '../../../types/content';
|
|
4
|
+
/**
|
|
5
|
+
* Apply sensible page head defaults from a parsed content document.
|
|
6
|
+
*
|
|
7
|
+
* The composable merges explicit `content.head` values with common fallbacks
|
|
8
|
+
* from the document (`title`, `description`, `image`) and adds canonical /
|
|
9
|
+
* Open Graph URL metadata when a public site URL is configured.
|
|
10
|
+
*/
|
|
11
|
+
export declare const useContentHead: (_content: ParsedContent | Ref<ParsedContent>, to?: RouteLocationNormalized | RouteLocationNormalizedLoaded) => void;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { hasProtocol, joinURL, withoutTrailingSlash } from "ufo";
|
|
2
|
+
import { useRoute, nextTick, useHead, unref, watch, useRuntimeConfig } from "#imports";
|
|
3
|
+
function isHeadImageObject(image) {
|
|
4
|
+
return typeof image === "object" && image !== null;
|
|
5
|
+
}
|
|
6
|
+
export const useContentHead = (_content, to = useRoute()) => {
|
|
7
|
+
const content = unref(_content);
|
|
8
|
+
const config = useRuntimeConfig();
|
|
9
|
+
const appConfig = config.app;
|
|
10
|
+
const applyHead = (head) => useHead(head);
|
|
11
|
+
const refreshHead = (data = content) => {
|
|
12
|
+
if (!to.path || !data) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const head = Object.assign({}, data?.head || {});
|
|
16
|
+
head.meta = [...head.meta || []];
|
|
17
|
+
head.link = [...head.link || []];
|
|
18
|
+
const title = head.title || data?.title;
|
|
19
|
+
if (title) {
|
|
20
|
+
head.title = title;
|
|
21
|
+
if (import.meta.server && !head.meta.some((m) => m.property === "og:title")) {
|
|
22
|
+
head.meta.push({
|
|
23
|
+
property: "og:title",
|
|
24
|
+
content: title
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const siteUrl = typeof config.public.siteUrl === "string" ? withoutTrailingSlash(config.public.siteUrl) : void 0;
|
|
29
|
+
if (import.meta.server && siteUrl) {
|
|
30
|
+
const url = withoutTrailingSlash(joinURL(siteUrl, appConfig.baseURL, to.fullPath));
|
|
31
|
+
if (!head.meta.some((m) => m.property === "og:url")) {
|
|
32
|
+
head.meta.push({
|
|
33
|
+
property: "og:url",
|
|
34
|
+
content: url
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
if (!head.link.some((m) => m.rel === "canonical")) {
|
|
38
|
+
head.link.push({
|
|
39
|
+
rel: "canonical",
|
|
40
|
+
href: url
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const description = head?.description || data?.description;
|
|
45
|
+
if (description && head.meta.filter((m) => m.name === "description").length === 0) {
|
|
46
|
+
head.meta.push({
|
|
47
|
+
name: "description",
|
|
48
|
+
content: description
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (import.meta.server && description && !head.meta.some((m) => m.property === "og:description")) {
|
|
52
|
+
head.meta.push({
|
|
53
|
+
property: "og:description",
|
|
54
|
+
content: description
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const image = head?.image || data?.image;
|
|
58
|
+
if (import.meta.server && image && head.meta.filter((m) => m.property === "og:image").length === 0) {
|
|
59
|
+
if (typeof image === "string") {
|
|
60
|
+
head.meta.push({
|
|
61
|
+
property: "og:image",
|
|
62
|
+
content: siteUrl && !hasProtocol(image) ? new URL(joinURL(appConfig.baseURL, image), siteUrl).href : image
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if (isHeadImageObject(image)) {
|
|
66
|
+
const imageKeys = [
|
|
67
|
+
"src",
|
|
68
|
+
"secure_url",
|
|
69
|
+
"type",
|
|
70
|
+
"width",
|
|
71
|
+
"height",
|
|
72
|
+
"alt"
|
|
73
|
+
];
|
|
74
|
+
for (const key of imageKeys) {
|
|
75
|
+
if (key === "src" && image.src) {
|
|
76
|
+
const isAbsoluteURL = hasProtocol(image.src);
|
|
77
|
+
const imageURL = isAbsoluteURL ? image.src : joinURL(appConfig.baseURL, image.src ?? "/");
|
|
78
|
+
head.meta.push({
|
|
79
|
+
property: "og:image",
|
|
80
|
+
content: siteUrl && !isAbsoluteURL ? new URL(imageURL, siteUrl).href : imageURL
|
|
81
|
+
});
|
|
82
|
+
} else if (image[key]) {
|
|
83
|
+
head.meta.push({
|
|
84
|
+
property: `og:image:${key}`,
|
|
85
|
+
content: image[key]
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (import.meta.client) {
|
|
92
|
+
nextTick(() => applyHead(head));
|
|
93
|
+
} else {
|
|
94
|
+
applyHead(head);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
watch(() => unref(_content), refreshHead, { immediate: true });
|
|
98
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './locale.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './locale-context.js'
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { normalizeContentPath } from '../../../features/localization/path';
|
|
2
|
+
export { normalizeContentPath };
|
|
3
|
+
export declare const resolveActiveLocale: (locales: string[], defaultLocale?: string) => any;
|
|
4
|
+
export declare const resolveRouteContent: (path: string, locales: string[], defaultLocale?: string) => {
|
|
5
|
+
locale: string | undefined;
|
|
6
|
+
path: string;
|
|
7
|
+
routePath: string;
|
|
8
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { getLocaleContext } from "./locale-context.js";
|
|
2
|
+
import { normalizeContentPath, resolveRouteContent as resolveLocalizedRouteContent } from "../../../features/localization/path";
|
|
3
|
+
export { normalizeContentPath };
|
|
4
|
+
export const resolveActiveLocale = (locales, defaultLocale) => {
|
|
5
|
+
const { route, nuxtApp, resolvedLocaleState } = getLocaleContext();
|
|
6
|
+
const i18nLocale = nuxtApp.$i18n?.locale;
|
|
7
|
+
const explicitLocale = typeof i18nLocale === "string" ? i18nLocale : i18nLocale?.value || resolvedLocaleState.value;
|
|
8
|
+
if (explicitLocale && locales.includes(explicitLocale)) {
|
|
9
|
+
return explicitLocale;
|
|
10
|
+
}
|
|
11
|
+
const segments = route.path.split("/").filter(Boolean);
|
|
12
|
+
const routeLocale = segments[0] && locales.includes(segments[0]) ? segments[0] : void 0;
|
|
13
|
+
return routeLocale || defaultLocale;
|
|
14
|
+
};
|
|
15
|
+
export const resolveRouteContent = (path, locales, defaultLocale) => resolveLocalizedRouteContent(path, locales, defaultLocale, resolveActiveLocale(locales, defaultLocale));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './navigation.js'
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { fetchContentApi, getContentApiFetcher } from "./utils.js";
|
|
2
|
+
export const fetchNavigationPayload = async (queryBuilder) => {
|
|
3
|
+
const params = queryBuilder.params();
|
|
4
|
+
return await fetchContentApi("navigation", params, {
|
|
5
|
+
fetcher: getContentApiFetcher()
|
|
6
|
+
});
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './preview.js'
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const lookupGlobal = (name) => {
|
|
2
|
+
const fn = globalThis[name];
|
|
3
|
+
return typeof fn === "function" ? fn : void 0;
|
|
4
|
+
};
|
|
5
|
+
const cookie = (name) => {
|
|
6
|
+
const useCookie = lookupGlobal("useCookie");
|
|
7
|
+
return useCookie ? useCookie(name) : { value: null };
|
|
8
|
+
};
|
|
9
|
+
const route = () => {
|
|
10
|
+
const useRoute = lookupGlobal("useRoute");
|
|
11
|
+
return useRoute ? useRoute() : { query: {} };
|
|
12
|
+
};
|
|
13
|
+
let showWarning = true;
|
|
14
|
+
export const useContentPreview = () => {
|
|
15
|
+
const getPreviewToken = () => {
|
|
16
|
+
return cookie("previewToken").value || import.meta.client && sessionStorage.getItem("previewToken") || void 0;
|
|
17
|
+
};
|
|
18
|
+
const setPreviewToken = (token) => {
|
|
19
|
+
cookie("previewToken").value = token ?? null;
|
|
20
|
+
route().query.preview = token || "";
|
|
21
|
+
if (import.meta.client) {
|
|
22
|
+
if (token) {
|
|
23
|
+
sessionStorage.setItem("previewToken", token);
|
|
24
|
+
} else {
|
|
25
|
+
sessionStorage.removeItem("previewToken");
|
|
26
|
+
}
|
|
27
|
+
window.location.reload();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const isEnabled = () => {
|
|
31
|
+
const query = route().query;
|
|
32
|
+
if (Object.prototype.hasOwnProperty.call(query, "preview") && !query.preview) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
if (query.preview || cookie("previewToken").value) {
|
|
36
|
+
if (import.meta.dev && showWarning) {
|
|
37
|
+
console.warn("[content] Preview mode enabled since a preview token is set (either in query or cookie).");
|
|
38
|
+
showWarning = false;
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
if (import.meta.client && sessionStorage.getItem("previewToken")) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
return false;
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
isEnabled,
|
|
49
|
+
getPreviewToken,
|
|
50
|
+
setPreviewToken
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './query-api.js'
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ParsedContent } from '../../../types/content';
|
|
2
|
+
import type { ContentCollectionHandle } from '../../../types/config';
|
|
3
|
+
import type { ContentVariant, ContentTreeItem, BacklinksOptions, BacklinksResult, BacklinkSource, DocumentFromHandle, ManyOptions, LocalizedDoc, NeighborsOptions, NeighborsResult, OneOptions, PopulateSpec, PopulateFromOptions, PopulatedDocument, PaginationOptions, PaginationResult, ResolveOneOptions, ResolveOneResult, TreeOptions, VariantsOptions } from '../../../types/query';
|
|
4
|
+
import { type ContentQueryContext } from '../../query/unified';
|
|
5
|
+
export declare const createClientContentQueryContext: () => ContentQueryContext;
|
|
6
|
+
export declare function resolveOne<const H extends ContentCollectionHandle | string, O extends ResolveOneOptions<H, PopulateSpec | undefined>>(handle: H, options: O): Promise<ResolveOneResult<PopulatedDocument<DocumentFromHandle<H>, PopulateFromOptions<O>>>>;
|
|
7
|
+
export declare function one<const H extends ContentCollectionHandle | string, O extends OneOptions<H, PopulateSpec | undefined>>(handle: H, options: O): Promise<LocalizedDoc<PopulatedDocument<DocumentFromHandle<H>, PopulateFromOptions<O>>> | null>;
|
|
8
|
+
export declare function many<const H extends ContentCollectionHandle | string, O extends ManyOptions<H, PopulateSpec | undefined>>(handle: H, options?: O & ManyOptions<H, PopulateSpec | undefined>): Promise<Array<LocalizedDoc<PopulatedDocument<DocumentFromHandle<H>, PopulateFromOptions<O>>>>>;
|
|
9
|
+
export declare function paginate<const H extends ContentCollectionHandle | string, O extends PaginationOptions<H, PopulateSpec | undefined>>(handle: H, options: O): Promise<PaginationResult<PopulatedDocument<DocumentFromHandle<H>, PopulateFromOptions<O>>>>;
|
|
10
|
+
export declare function backlinks<const Target extends ContentCollectionHandle | string, const Source extends BacklinkSource | ReadonlyArray<BacklinkSource>, P extends PopulateSpec | undefined = undefined>(handle: Target, options: BacklinksOptions<Target, Source, P>): Promise<BacklinksResult<Source, P>>;
|
|
11
|
+
export declare function variants<H extends ContentCollectionHandle | string>(handle: H, options: VariantsOptions<H>): Promise<Array<ContentVariant<H extends {
|
|
12
|
+
__schema: {
|
|
13
|
+
_output: infer O;
|
|
14
|
+
};
|
|
15
|
+
} ? O & ParsedContent : ParsedContent>>>;
|
|
16
|
+
export declare function tree<H extends ContentCollectionHandle | string, Fields extends ReadonlyArray<string> | undefined = undefined>(handle: H, options?: Omit<TreeOptions<H>, 'fields'> & {
|
|
17
|
+
fields?: Fields;
|
|
18
|
+
}): Promise<ContentTreeItem<H extends {
|
|
19
|
+
__schema: {
|
|
20
|
+
_output: infer O;
|
|
21
|
+
};
|
|
22
|
+
} ? O & ParsedContent : ParsedContent, Fields>[]>;
|
|
23
|
+
export declare function neighbors<H extends ContentCollectionHandle | string>(handle: H, options: NeighborsOptions<H>): Promise<NeighborsResult<H extends {
|
|
24
|
+
__schema: {
|
|
25
|
+
_output: infer O;
|
|
26
|
+
};
|
|
27
|
+
} ? O & ParsedContent : ParsedContent>>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { fetchContentApi, getContentApiFetcher } from "./utils.js";
|
|
2
|
+
import { getContentRuntime } from "./runtime.js";
|
|
3
|
+
import {
|
|
4
|
+
backlinks as backlinksWithContext,
|
|
5
|
+
many as manyWithContext,
|
|
6
|
+
neighbors as neighborsWithContext,
|
|
7
|
+
one as oneWithContext,
|
|
8
|
+
paginate as paginateWithContext,
|
|
9
|
+
resolveOne as resolveOneWithContext,
|
|
10
|
+
tree as treeWithContext,
|
|
11
|
+
variants as variantsWithContext
|
|
12
|
+
} from "../../query/unified.js";
|
|
13
|
+
export const createClientContentQueryContext = () => {
|
|
14
|
+
const runtime = getContentRuntime();
|
|
15
|
+
const fetcher = getContentApiFetcher();
|
|
16
|
+
return {
|
|
17
|
+
runtime,
|
|
18
|
+
transport: async (endpoint, params) => {
|
|
19
|
+
return await fetchContentApi(endpoint, params, { fetcher, runtime });
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export async function resolveOne(handle, options) {
|
|
24
|
+
return await resolveOneWithContext(createClientContentQueryContext(), handle, options);
|
|
25
|
+
}
|
|
26
|
+
export async function one(handle, options) {
|
|
27
|
+
return await oneWithContext(createClientContentQueryContext(), handle, options);
|
|
28
|
+
}
|
|
29
|
+
export async function many(handle, options = {}) {
|
|
30
|
+
return await manyWithContext(createClientContentQueryContext(), handle, options);
|
|
31
|
+
}
|
|
32
|
+
export async function paginate(handle, options) {
|
|
33
|
+
return await paginateWithContext(createClientContentQueryContext(), handle, options);
|
|
34
|
+
}
|
|
35
|
+
export async function backlinks(handle, options) {
|
|
36
|
+
return await backlinksWithContext(createClientContentQueryContext(), handle, options);
|
|
37
|
+
}
|
|
38
|
+
export async function variants(handle, options) {
|
|
39
|
+
return await variantsWithContext(createClientContentQueryContext(), handle, options);
|
|
40
|
+
}
|
|
41
|
+
export async function tree(handle, options = {}) {
|
|
42
|
+
return await treeWithContext(createClientContentQueryContext(), handle, options);
|
|
43
|
+
}
|
|
44
|
+
export async function neighbors(handle, options) {
|
|
45
|
+
return await neighborsWithContext(createClientContentQueryContext(), handle, options);
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './route.js'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ComputedRef, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import type { ContentPageResult, ContentRouteMeta } from '../../../types/query';
|
|
3
|
+
type ContentRouteValue = ContentRouteMeta | ContentPageResult | null | undefined;
|
|
4
|
+
export declare function useContentSwitchLocalePath(): (locale: string) => string;
|
|
5
|
+
export declare function useContentRoute(value: MaybeRefOrGetter<ContentRouteValue>): {
|
|
6
|
+
switchLocalePath: (locale: string) => string;
|
|
7
|
+
localePaths: ComputedRef<Record<string, string>>;
|
|
8
|
+
canonicalPath: ComputedRef<string | undefined>;
|
|
9
|
+
path: ComputedRef<string | undefined>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|