@lupinum/ginko-content 0.1.5 → 0.2.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/compatibility.json +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/cms-contract/build.js +15 -20
- package/dist/cms-contract/types.d.ts +12 -7
- package/dist/core/content/document +1 -0
- package/dist/core/content/document.d.ts +16 -0
- package/dist/core/content/document.js +2 -0
- package/dist/core/content/graph.d.ts +3 -1
- package/dist/core/content/graph.js +21 -20
- package/dist/core/content/locale.d.ts +6 -1
- package/dist/core/content/locale.js +17 -6
- package/dist/core/content/path.d.ts +5 -5
- package/dist/core/content/path.js +8 -8
- package/dist/core/content/snapshot +1 -0
- package/dist/core/content/snapshot.d.ts +25 -0
- package/dist/core/content/snapshot.js +99 -0
- package/dist/core/provider-errors.d.ts +1 -1
- package/dist/core/provider-errors.js +1 -0
- package/dist/core/query/builder.js +3 -3
- package/dist/core/query/execute.js +75 -36
- package/dist/core/query/filter.js +2 -2
- package/dist/core/query/lower.js +79 -3
- package/dist/core/query/params.js +7 -7
- package/dist/core/query/plan.d.ts +18 -0
- package/dist/core/query/plan.js +7 -0
- package/dist/core/references/resolve.js +6 -9
- package/dist/features/agent/agent-markdown +1 -0
- package/dist/features/agent/agent-markdown.d.ts +116 -0
- package/dist/features/agent/agent-markdown.js +138 -0
- package/dist/features/agent/walker +1 -0
- package/dist/features/agent/walker.d.ts +10 -0
- package/dist/features/agent/walker.js +174 -0
- package/dist/features/collections/resolve.d.ts +2 -2
- package/dist/features/collections/resolve.js +19 -16
- package/dist/features/localization/links.js +1 -1
- package/dist/features/localization/results.d.ts +3 -3
- package/dist/features/localization/results.js +46 -41
- package/dist/features/localization/translated-slugs.js +5 -5
- package/dist/features/navigation/build.d.ts +2 -2
- package/dist/features/navigation/build.js +23 -26
- package/dist/features/navigation/canonical.d.ts +10 -11
- package/dist/features/navigation/canonical.js +26 -21
- package/dist/features/navigation/resolve.js +4 -4
- package/dist/features/navigation/tree.js +3 -3
- package/dist/{runtime → features}/query/backlinks.js +3 -5
- package/dist/{runtime → features}/query/documents.js +1 -1
- package/dist/{runtime → features}/query/localized-docs.d.ts +1 -1
- package/dist/{runtime → features}/query/localized-docs.js +3 -6
- package/dist/{runtime → features}/query/navigation.d.ts +1 -1
- package/dist/{runtime → features}/query/navigation.js +8 -8
- package/dist/{runtime → features}/query/populate.js +6 -14
- package/dist/{runtime → features}/query/unified.d.ts +4 -4
- package/dist/{runtime → features}/query/unified.js +4 -2
- package/dist/{runtime → features}/query/variants.js +4 -4
- package/dist/features/search/navigation.js +2 -2
- package/dist/features/search/sections.d.ts +1 -1
- package/dist/features/search/sections.js +1 -1
- package/dist/features/sitemap/query.d.ts +5 -5
- package/dist/features/sitemap/query.js +6 -6
- package/dist/integrations/nitro/ingest.js +9 -20
- package/dist/integrations/nitro/storage.d.ts +1 -0
- package/dist/integrations/nitro/storage.js +21 -34
- package/dist/module.d.mts +135 -803
- package/dist/module.json +1 -1
- package/dist/module.mjs +143 -51
- package/dist/parsers/csv.js +3 -3
- package/dist/parsers/index.js +3 -3
- package/dist/parsers/json.js +8 -6
- package/dist/parsers/markdown-plugins.js +9 -5
- package/dist/parsers/markdown.js +7 -6
- package/dist/parsers/path-meta.js +21 -19
- package/dist/parsers/reserved +1 -0
- package/dist/parsers/reserved.d.ts +15 -0
- package/dist/parsers/reserved.js +35 -0
- package/dist/parsers/yaml.js +6 -4
- package/dist/public/agent +1 -0
- package/dist/public/agent.d.ts +17 -0
- package/dist/public/agent.js +34 -0
- package/dist/public/client.d.ts +2 -3
- package/dist/public/client.js +1 -2
- package/dist/public/provider-query +1 -0
- package/dist/public/provider-query.d.ts +58 -0
- package/dist/public/provider-query.js +5 -0
- package/dist/public/provider.d.ts +8 -3
- package/dist/public/provider.js +2 -0
- package/dist/public/server.d.ts +7 -12
- package/dist/public/server.js +5 -36
- package/dist/runtime/app/components/ContentRenderer.d.vue.ts +3 -3
- package/dist/runtime/app/components/ContentRenderer.vue +2 -2
- package/dist/runtime/app/components/ContentRenderer.vue.d.ts +3 -3
- package/dist/runtime/app/components/ContentRendererInline.d.vue.ts +1 -1
- package/dist/runtime/app/components/ContentRendererInline.vue.d.ts +1 -1
- package/dist/runtime/app/components/Prose/ProseImg.d.vue.ts +4 -4
- package/dist/runtime/app/components/Prose/ProseImg.vue.d.ts +4 -4
- package/dist/runtime/app/components/Prose/ProsePre.d.vue.ts +1 -1
- package/dist/runtime/app/components/Prose/ProsePre.vue.d.ts +1 -1
- package/dist/runtime/app/components/internal/ContentRendererMarkdown.d.vue.ts +1 -1
- package/dist/runtime/app/components/internal/ContentRendererMarkdown.vue +4 -4
- package/dist/runtime/app/components/internal/ContentRendererMarkdown.vue.d.ts +1 -1
- package/dist/runtime/app/components/internal/MarkdownRenderer.d.ts +3 -3
- package/dist/runtime/app/composables/preview.d.ts +1 -1
- package/dist/runtime/app/composables/query-api.d.ts +5 -5
- package/dist/runtime/app/composables/query-api.js +5 -3
- package/dist/runtime/app/composables/route.d.ts +1 -1
- package/dist/runtime/app/composables/route.js +4 -4
- package/dist/runtime/app/composables/search.js +1 -1
- package/dist/runtime/app/composables/use-content-document.js +1 -1
- package/dist/runtime/app/composables/use-content-list.js +1 -1
- package/dist/runtime/app/composables/use-content-navigation.js +2 -2
- package/dist/runtime/app/composables/use-content-page.js +4 -4
- package/dist/runtime/app/pages/content.vue +2 -1
- package/dist/runtime/markdown/plugins.js +6 -8
- package/dist/runtime/server/agent-markdown.d.ts +5 -65
- package/dist/runtime/server/agent-markdown.js +40 -315
- package/dist/runtime/server/agent-site.js +9 -2
- package/dist/runtime/server/api/agent-raw.js +1 -1
- package/dist/runtime/server/api/cache.d.ts +1 -1
- package/dist/runtime/server/api/cache.js +43 -4
- package/dist/runtime/server/api/locales.js +3 -3
- package/dist/runtime/server/api/navigation.d.ts +1 -1
- package/dist/runtime/server/api/navigation.js +3 -1
- package/dist/runtime/server/api/query.js +2 -2
- package/dist/runtime/server/api/search-index.d.ts +1 -1
- package/dist/runtime/server/api/sitemap.d.ts +1 -1
- package/dist/runtime/server/cache-adapters.d.ts +18 -0
- package/dist/runtime/server/cache-adapters.js +12 -0
- package/dist/runtime/server/collection-helpers.d.ts +2 -2
- package/dist/runtime/server/collection-helpers.js +15 -11
- package/dist/runtime/server/index.d.ts +6 -4
- package/dist/runtime/server/index.js +10 -3
- package/dist/runtime/server/middleware/agent-link-headers.js +1 -1
- package/dist/runtime/server/middleware/agent-markdown.js +1 -1
- package/dist/runtime/server/navigation-query.d.ts +2 -2
- package/dist/runtime/server/navigation-query.js +52 -7
- package/dist/runtime/server/navigation.d.ts +1 -1
- package/dist/runtime/server/provider-document +1 -0
- package/dist/runtime/server/provider-document.d.ts +59 -0
- package/dist/runtime/server/provider-document.js +48 -0
- package/dist/runtime/server/provider-query-wire +1 -0
- package/dist/runtime/server/provider-query-wire.d.ts +32 -0
- package/dist/runtime/server/provider-query-wire.js +27 -0
- package/dist/runtime/server/provider-query.d.ts +18 -9
- package/dist/runtime/server/provider-query.js +62 -28
- package/dist/runtime/server/provider-result.d.ts +4 -4
- package/dist/runtime/server/providers/filesystem.js +3 -11
- package/dist/runtime/server/providers/index.d.ts +18 -1
- package/dist/runtime/server/providers/index.js +72 -20
- package/dist/runtime/server/query-api.d.ts +5 -5
- package/dist/runtime/server/query-api.js +9 -6
- package/dist/runtime/server/query-executor.d.ts +3 -3
- package/dist/runtime/server/query-executor.js +43 -59
- package/dist/runtime/server/search.d.ts +1 -1
- package/dist/runtime/server/search.js +4 -4
- package/dist/runtime/server/sitemap.js +5 -5
- package/dist/runtime/server/storage-access.d.ts +4 -1
- package/dist/runtime/server/storage-access.js +27 -2
- package/dist/runtime/transformers/component-resolver.d.ts +1 -1
- package/dist/storage/content.d.ts +2 -6
- package/dist/storage/content.js +19 -8
- package/dist/storage/contents.d.ts +9 -1
- package/dist/storage/contents.js +26 -19
- package/dist/storage/driver.d.ts +2 -2
- package/dist/storage/driver.js +2 -1
- package/dist/storage/graph.js +4 -0
- package/dist/storage/manifest.js +3 -1
- package/dist/storage/references.js +9 -5
- package/dist/storage/snapshot-runtime +1 -0
- package/dist/storage/snapshot-runtime.d.ts +11 -0
- package/dist/storage/snapshot-runtime.js +46 -0
- package/dist/storage/validation.d.ts +1 -1
- package/dist/storage/validation.js +79 -105
- package/dist/testing/provider-contract.d.ts +14 -4
- package/dist/testing/provider-contract.js +121 -68
- package/dist/testing/provider-fixture.d.ts +1 -1
- package/dist/testing/provider-fixture.js +124 -120
- package/dist/types/config.d.ts +17 -4
- package/dist/types/content.d.ts +104 -70
- package/dist/types/fields.js +1 -1
- package/dist/types/module.d.ts +1 -1
- package/dist/types/query-parts/public.d.ts +14 -5
- package/dist/types/query-parts/results.d.ts +6 -2
- package/dist/types/query-parts/transport.d.ts +19 -0
- package/dist/types/virtual.d.ts +6 -0
- package/dist/types.d.mts +2 -2
- package/dist/web-types.json +1 -1
- package/package.json +39 -9
- package/dist/runtime/app/plugins/markdown-components +0 -1
- package/dist/runtime/app/plugins/markdown-components.d.ts +0 -2
- package/dist/runtime/app/plugins/markdown-components.js +0 -19
- /package/dist/{runtime → features/agent}/agent-paths +0 -0
- /package/dist/{runtime → features/agent}/agent-paths.d.ts +0 -0
- /package/dist/{runtime → features/agent}/agent-paths.js +0 -0
- /package/dist/{runtime → features}/query/backlinks +0 -0
- /package/dist/{runtime → features}/query/backlinks.d.ts +0 -0
- /package/dist/{runtime → features}/query/context +0 -0
- /package/dist/{runtime → features}/query/context.d.ts +0 -0
- /package/dist/{runtime → features}/query/context.js +0 -0
- /package/dist/{runtime → features}/query/documents +0 -0
- /package/dist/{runtime → features}/query/documents.d.ts +0 -0
- /package/dist/{runtime → features}/query/errors +0 -0
- /package/dist/{runtime → features}/query/errors.d.ts +0 -0
- /package/dist/{runtime → features}/query/errors.js +0 -0
- /package/dist/{runtime → features}/query/handles +0 -0
- /package/dist/{runtime → features}/query/handles.d.ts +0 -0
- /package/dist/{runtime → features}/query/handles.js +0 -0
- /package/dist/{runtime → features}/query/locale-options +0 -0
- /package/dist/{runtime → features}/query/locale-options.d.ts +0 -0
- /package/dist/{runtime → features}/query/locale-options.js +0 -0
- /package/dist/{runtime → features}/query/localized-docs +0 -0
- /package/dist/{runtime → features}/query/navigation +0 -0
- /package/dist/{runtime → features}/query/pagination +0 -0
- /package/dist/{runtime → features}/query/pagination.d.ts +0 -0
- /package/dist/{runtime → features}/query/pagination.js +0 -0
- /package/dist/{runtime → features}/query/populate +0 -0
- /package/dist/{runtime → features}/query/populate.d.ts +0 -0
- /package/dist/{runtime → features}/query/public-limits +0 -0
- /package/dist/{runtime → features}/query/public-limits.d.ts +0 -0
- /package/dist/{runtime → features}/query/public-limits.js +0 -0
- /package/dist/{runtime → features}/query/resolve +0 -0
- /package/dist/{runtime → features}/query/resolve.d.ts +0 -0
- /package/dist/{runtime → features}/query/resolve.js +0 -0
- /package/dist/{runtime → features}/query/responses +0 -0
- /package/dist/{runtime → features}/query/responses.d.ts +0 -0
- /package/dist/{runtime → features}/query/responses.js +0 -0
- /package/dist/{runtime → features}/query/routes +0 -0
- /package/dist/{runtime → features}/query/routes.d.ts +0 -0
- /package/dist/{runtime → features}/query/routes.js +0 -0
- /package/dist/{runtime → features}/query/unified +0 -0
- /package/dist/{runtime → features}/query/variants +0 -0
- /package/dist/{runtime → features}/query/variants.d.ts +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const RESERVED_CONTENT_KEYS = [
|
|
2
|
+
"id",
|
|
3
|
+
"collection",
|
|
4
|
+
"locale",
|
|
5
|
+
"path",
|
|
6
|
+
"canonicalKey",
|
|
7
|
+
"type",
|
|
8
|
+
"file",
|
|
9
|
+
"resolved",
|
|
10
|
+
"variants",
|
|
11
|
+
"localePaths",
|
|
12
|
+
"unprefixedPath",
|
|
13
|
+
// Query-time only: `execute.ts`'s `withDirConfig` stamps the directory
|
|
14
|
+
// `.navigation` config onto variant-resolution (`resolveVariant`) results
|
|
15
|
+
// as a top-level `dir`, so an authored `dir:` frontmatter key would be
|
|
16
|
+
// silently clobbered there. It is not stamped at parse time (path-meta
|
|
17
|
+
// writes the directory name to `file.dir`, not top-level `dir`), so we
|
|
18
|
+
// reserve it here to strip+warn like the other system keys.
|
|
19
|
+
"dir"
|
|
20
|
+
];
|
|
21
|
+
export const stripReservedContentKeys = (source, fileId) => {
|
|
22
|
+
if (!source || typeof source !== "object") {
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
const reserved = new Set(RESERVED_CONTENT_KEYS);
|
|
26
|
+
for (const key of RESERVED_CONTENT_KEYS) {
|
|
27
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
28
|
+
const hint = key === "id" ? " Use `ref` for a stable authored alias." : "";
|
|
29
|
+
console.warn(
|
|
30
|
+
`[content] Ignoring reserved frontmatter key "${key}" in "${fileId}"; the system value wins.${hint}`
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return Object.fromEntries(Object.entries(source).filter(([key]) => !reserved.has(key)));
|
|
35
|
+
};
|
package/dist/parsers/yaml.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { load } from "js-yaml";
|
|
2
2
|
import { defineTransformer } from "./utils.js";
|
|
3
|
+
import { stripReservedContentKeys } from "./reserved.js";
|
|
3
4
|
export default defineTransformer({
|
|
4
5
|
name: "Yaml",
|
|
5
6
|
extensions: [".yml", ".yaml"],
|
|
6
|
-
parse: (
|
|
7
|
+
parse: (id, content) => {
|
|
7
8
|
const data = load(String(content));
|
|
8
9
|
let parsed = data;
|
|
9
10
|
if (Array.isArray(data)) {
|
|
10
|
-
console.warn(`YAML array is not supported in ${
|
|
11
|
+
console.warn(`YAML array is not supported in ${id}, moving the array into the \`body\` key`);
|
|
11
12
|
parsed = { body: data };
|
|
12
13
|
}
|
|
14
|
+
parsed = stripReservedContentKeys(parsed, id);
|
|
13
15
|
return {
|
|
14
16
|
...parsed,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
id,
|
|
18
|
+
type: "yaml"
|
|
17
19
|
};
|
|
18
20
|
}
|
|
19
21
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './agent.js'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM markdown output public API surface (Nitro / H3 contexts).
|
|
3
|
+
*
|
|
4
|
+
* The "agent" feature serves agent-readable content output — `/raw/*.md`,
|
|
5
|
+
* `/llms.txt`, `/llms-full.txt`, and the component→markdown serializers /
|
|
6
|
+
* registration primitives. It lives on its own subpath (`@lupinum/ginko-content/agent`)
|
|
7
|
+
* so it does not share the `./server` query facade. The `agent` code identifiers
|
|
8
|
+
* match the shipped module option name (`agent: {...}`).
|
|
9
|
+
*
|
|
10
|
+
* This is a PURE re-export: the registration API was reshaped once (per-app
|
|
11
|
+
* registry) in T4.2b — the moved names keep their call signatures.
|
|
12
|
+
*/
|
|
13
|
+
export { agentMarkdownPathForRoute, agentRawPathForRoute, normalizeAgentRoutePath } from '../features/agent/agent-paths.js';
|
|
14
|
+
export { clearAgentMarkdownSerializers, blockquoteMarkdown, createAgentMarkdownRegistry, defineAgentMarkdownComponent, getMarkdownProp, jsonFenceMarkdown, linkMarkdown, queryMarkdownEnabledContent, registerAgentMarkdownComponent, registerAgentMarkdownComponents, registerAgentMarkdownSerializer, registerAgentMarkdownSerializers, renderMarkdownChildren, resolveAgentMarkdownOptions, resolveContentMarkdown, resolveContentMarkdownByRoute, xmlComponentMarkdown } from '../runtime/server/agent-markdown.js';
|
|
15
|
+
export { buildAgentPageIndex, collectAgentMarkdownPrerenderRoutes, getAgentLocales, isSupportedAgentLocale, localeFromAgentPath, renderAgentMarkdownFrontmatter, renderAgentMarkdownPage, renderLlmsFullTxt, renderLlmsTxt, resolveMarkdownForPublicRoute, routePathFromIndexSlug, routePathFromRawSlug } from '../runtime/server/agent-site.js';
|
|
16
|
+
export type { AgentMarkdown, AgentMarkdownComponent, AgentMarkdownComponentMap, AgentMarkdownContext, AgentMarkdownMeta, AgentMarkdownPublicSignals, AgentMarkdownRegistry, AgentMarkdownSerializer, AgentMarkdownSerializerMap, ResolvedAgentMarkdownOptions } from '../runtime/server/agent-markdown.js';
|
|
17
|
+
export type { AgentPage, AgentPageSource } from '../runtime/server/agent-site.js';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export { agentMarkdownPathForRoute, agentRawPathForRoute, normalizeAgentRoutePath } from "../features/agent/agent-paths.js";
|
|
2
|
+
export {
|
|
3
|
+
clearAgentMarkdownSerializers,
|
|
4
|
+
blockquoteMarkdown,
|
|
5
|
+
createAgentMarkdownRegistry,
|
|
6
|
+
defineAgentMarkdownComponent,
|
|
7
|
+
getMarkdownProp,
|
|
8
|
+
jsonFenceMarkdown,
|
|
9
|
+
linkMarkdown,
|
|
10
|
+
queryMarkdownEnabledContent,
|
|
11
|
+
registerAgentMarkdownComponent,
|
|
12
|
+
registerAgentMarkdownComponents,
|
|
13
|
+
registerAgentMarkdownSerializer,
|
|
14
|
+
registerAgentMarkdownSerializers,
|
|
15
|
+
renderMarkdownChildren,
|
|
16
|
+
resolveAgentMarkdownOptions,
|
|
17
|
+
resolveContentMarkdown,
|
|
18
|
+
resolveContentMarkdownByRoute,
|
|
19
|
+
xmlComponentMarkdown
|
|
20
|
+
} from "../runtime/server/agent-markdown.js";
|
|
21
|
+
export {
|
|
22
|
+
buildAgentPageIndex,
|
|
23
|
+
collectAgentMarkdownPrerenderRoutes,
|
|
24
|
+
getAgentLocales,
|
|
25
|
+
isSupportedAgentLocale,
|
|
26
|
+
localeFromAgentPath,
|
|
27
|
+
renderAgentMarkdownFrontmatter,
|
|
28
|
+
renderAgentMarkdownPage,
|
|
29
|
+
renderLlmsFullTxt,
|
|
30
|
+
renderLlmsTxt,
|
|
31
|
+
resolveMarkdownForPublicRoute,
|
|
32
|
+
routePathFromIndexSlug,
|
|
33
|
+
routePathFromRawSlug
|
|
34
|
+
} from "../runtime/server/agent-site.js";
|
package/dist/public/client.d.ts
CHANGED
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
* pages use the thin `useContentPage` convenience helper built on top of it.
|
|
6
6
|
*/
|
|
7
7
|
export { one, many, paginate, backlinks, resolveOne, variants, tree, neighbors } from '../runtime/app/composables/query-api.js';
|
|
8
|
-
export { getCollectionPath } from '../
|
|
9
|
-
export type { CollectionPathOptions } from '../
|
|
10
|
-
export { agentMarkdownPathForRoute, agentRawPathForRoute, normalizeAgentRoutePath } from '../runtime/agent-paths.js';
|
|
8
|
+
export { getCollectionPath } from '../features/query/routes.js';
|
|
9
|
+
export type { CollectionPathOptions } from '../features/query/routes.js';
|
|
11
10
|
export { useContentHead } from '../runtime/app/composables/head.js';
|
|
12
11
|
export { useContentPage, useContentOne, useContentMany, useContentPagination, useContentBacklinks, useContentResolveOne, useContentVariants, useContentTree, useContentNavigation, useContentNeighbors } from '../runtime/app/composables/use-content.js';
|
|
13
12
|
export type { UseContentPageOptions } from '../runtime/app/composables/use-content.js';
|
package/dist/public/client.js
CHANGED
|
@@ -8,8 +8,7 @@ export {
|
|
|
8
8
|
tree,
|
|
9
9
|
neighbors
|
|
10
10
|
} from "../runtime/app/composables/query-api.js";
|
|
11
|
-
export { getCollectionPath } from "../
|
|
12
|
-
export { agentMarkdownPathForRoute, agentRawPathForRoute, normalizeAgentRoutePath } from "../runtime/agent-paths.js";
|
|
11
|
+
export { getCollectionPath } from "../features/query/routes.js";
|
|
13
12
|
export { useContentHead } from "../runtime/app/composables/head.js";
|
|
14
13
|
export {
|
|
15
14
|
useContentPage,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './provider-query.js'
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider wire contract v1 (CS-5).
|
|
3
|
+
*
|
|
4
|
+
* The single query envelope crossing the `ContentProvider` boundary. It wraps
|
|
5
|
+
* the executor-facing `ContentQueryPlan` (see `../core/query/plan.ts`) rather
|
|
6
|
+
* than the open-ended builder params that used to leak across the seam:
|
|
7
|
+
*
|
|
8
|
+
* - **closed** — no index signatures; every field is named.
|
|
9
|
+
* - **versioned** — `v` lets providers reject a wire they do not understand.
|
|
10
|
+
* - **JSON-pure** — the plan carries no `RegExp` instances, `Date`s, or
|
|
11
|
+
* functions (regex operands are lowered to a tagged JSON object), so the
|
|
12
|
+
* whole envelope survives `JSON.parse(JSON.stringify(query))`. The provider
|
|
13
|
+
* registry asserts this in dev.
|
|
14
|
+
*
|
|
15
|
+
* Providers pattern-match `plan.filter` (a `FilterExpr` tree); they never
|
|
16
|
+
* parse builder params again.
|
|
17
|
+
*
|
|
18
|
+
* The builder-params → wire lowering helpers (`toContentProviderQuery`,
|
|
19
|
+
* `toContentProviderNavigationQuery`, `PROVIDER_QUERY_VERSION`) live in the
|
|
20
|
+
* runtime adapter layer (`../runtime/server/provider-query-wire`) so the
|
|
21
|
+
* internal query IR is not named in the public facade; they are re-exported
|
|
22
|
+
* here to keep the exported surface stable.
|
|
23
|
+
*/
|
|
24
|
+
import type { ContentQueryPlan } from '../core/query/plan';
|
|
25
|
+
export type { ContentQueryPlan } from '../core/query/plan';
|
|
26
|
+
export { PROVIDER_QUERY_VERSION, toContentProviderQuery, toContentProviderNavigationQuery } from '../runtime/server/provider-query-wire';
|
|
27
|
+
/** The single wire type crossing the provider `query`/`navigationQuery` boundary. */
|
|
28
|
+
export interface ContentProviderQuery {
|
|
29
|
+
/** Wire version — always `PROVIDER_QUERY_VERSION` (1). */
|
|
30
|
+
v: 1;
|
|
31
|
+
/** `null` = cross-collection query (navigation / search aggregation paths). */
|
|
32
|
+
collection: string | null;
|
|
33
|
+
plan: ContentQueryPlan;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Navigation-only knobs that are NOT part of the query plan. Navigation adds
|
|
37
|
+
* projection fields, a canonical-vs-localized routing flag, and a locale
|
|
38
|
+
* resolution spec — all of which configure `navigationQuery` tree shaping
|
|
39
|
+
* rather than document selection, so they travel beside the plan instead of
|
|
40
|
+
* being smuggled through it.
|
|
41
|
+
*
|
|
42
|
+
* `resolveLocale` is carried here in its un-lowered builder shape because
|
|
43
|
+
* navigation walks the fallback chain itself and must distinguish
|
|
44
|
+
* `fallback: true` (expand from config) / `false` (exact) / an explicit chain —
|
|
45
|
+
* a distinction the executor plan intentionally normalizes away.
|
|
46
|
+
*/
|
|
47
|
+
export interface ContentProviderNavigationOptions {
|
|
48
|
+
/** Extra fields the navigation tree should carry beyond the defaults. */
|
|
49
|
+
fields?: string[];
|
|
50
|
+
/** Emit canonical (locale-agnostic) routes instead of localized ones. */
|
|
51
|
+
canonical?: boolean;
|
|
52
|
+
/** Locale resolution for the navigation tree, in builder shape. */
|
|
53
|
+
resolveLocale?: {
|
|
54
|
+
locale?: string;
|
|
55
|
+
fallback?: boolean | string[];
|
|
56
|
+
exact?: boolean;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -2,11 +2,16 @@ import type { H3Event } from 'h3';
|
|
|
2
2
|
import type { ContentQueryResponse } from '../types/api';
|
|
3
3
|
import type { NavItem, ParsedContent } from '../types/content';
|
|
4
4
|
import type { ContentProviderName } from '../types/config';
|
|
5
|
-
import type { ContentCollectionItemSurroundingsOptions, ContentCollectionNavigationOptions, ContentCollectionPageOptions, ContentCollectionRouteMetaOptions, ContentCollectionSearchSectionsOptions, ContentPageResult,
|
|
5
|
+
import type { ContentCollectionItemSurroundingsOptions, ContentCollectionNavigationOptions, ContentCollectionPageOptions, ContentCollectionRouteMetaOptions, ContentCollectionSearchSectionsOptions, ContentPageResult, ContentRouteMeta, ContentSearchSection, ContentSitemapEntry } from '../types/query';
|
|
6
6
|
import type { QueryCollectionsSitemapEntriesOptions } from '../features/sitemap/query';
|
|
7
7
|
import type { ContentProviderSearchRequest, ContentSearchResult } from '../types/search';
|
|
8
8
|
import type { ContentCacheHint, ContentCacheHintInput } from '../core/cache-hints';
|
|
9
|
+
import type { ContentProviderNavigationOptions, ContentProviderQuery } from './provider-query';
|
|
9
10
|
export type { ContentCacheHint, ContentCacheHintInput } from '../core/cache-hints';
|
|
11
|
+
export type { ContentProviderQuery, ContentProviderNavigationOptions, ContentQueryPlan } from './provider-query';
|
|
12
|
+
export { PROVIDER_QUERY_VERSION, toContentProviderQuery, toContentProviderNavigationQuery } from './provider-query';
|
|
13
|
+
export { createContentProviderError } from './provider-errors';
|
|
14
|
+
export type { ContentProviderErrorCode } from './provider-errors';
|
|
10
15
|
export declare const contentProviderResultMarker = "__ginkoContentProviderResult";
|
|
11
16
|
export interface ContentProviderResult<T = unknown> {
|
|
12
17
|
readonly [contentProviderResultMarker]: true;
|
|
@@ -53,8 +58,8 @@ export interface ContentProviderCapabilities {
|
|
|
53
58
|
export interface ContentProvider {
|
|
54
59
|
name: ContentProviderName;
|
|
55
60
|
capabilities: ContentProviderCapabilities;
|
|
56
|
-
query: <T = ParsedContent>(event: H3Event, query:
|
|
57
|
-
navigationQuery?: (event: H3Event, query:
|
|
61
|
+
query: <T = ParsedContent>(event: H3Event, query: ContentProviderQuery) => Promise<MaybeContentProviderResult<ContentQueryResponse<T>>>;
|
|
62
|
+
navigationQuery?: (event: H3Event, query: ContentProviderQuery, options?: ContentProviderNavigationOptions) => Promise<MaybeContentProviderResult<NavItem[]>>;
|
|
58
63
|
navigation?: (event: H3Event, collection: string, options?: string[] | ContentCollectionNavigationOptions) => Promise<MaybeContentProviderResult<NavItem[]>>;
|
|
59
64
|
surroundings?: (event: H3Event, collection: string, path: string, options?: ContentCollectionItemSurroundingsOptions) => Promise<MaybeContentProviderResult<Array<NavItem | null>>>;
|
|
60
65
|
searchSections?: (event: H3Event, collection: string, options?: ContentCollectionSearchSectionsOptions) => Promise<MaybeContentProviderResult<ContentSearchSection[]>>;
|
package/dist/public/provider.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { PROVIDER_QUERY_VERSION, toContentProviderQuery, toContentProviderNavigationQuery } from "./provider-query.js";
|
|
2
|
+
export { createContentProviderError } from "./provider-errors.js";
|
|
1
3
|
export const contentProviderResultMarker = "__ginkoContentProviderResult";
|
|
2
4
|
export const withContentCache = (data, cache) => ({
|
|
3
5
|
[contentProviderResultMarker]: true,
|
package/dist/public/server.d.ts
CHANGED
|
@@ -6,19 +6,14 @@
|
|
|
6
6
|
* re-exported here for ergonomic discoverability from `@lupinum/ginko-content/server`.
|
|
7
7
|
*/
|
|
8
8
|
export { one, many, paginate, backlinks, resolveOne, variants, tree, neighbors, createServerContentQueryContext } from '../runtime/server/query-api.js';
|
|
9
|
-
export { getCollectionPath } from '../
|
|
10
|
-
export type { CollectionPathOptions } from '../
|
|
11
|
-
export {
|
|
12
|
-
export { clearAgentMarkdownSerializers, blockquoteMarkdown, defineAgentMarkdownComponent, getMarkdownProp, jsonFenceMarkdown, linkMarkdown, queryMarkdownEnabledContent, registerAgentMarkdownComponent, registerAgentMarkdownComponents, registerAgentMarkdownSerializer, registerAgentMarkdownSerializers, renderMarkdownChildren, resolveAgentMarkdownOptions, resolveContentMarkdown, resolveContentMarkdownByRoute, xmlComponentMarkdown } from '../runtime/server/agent-markdown.js';
|
|
13
|
-
export { buildAgentPageIndex, collectAgentMarkdownPrerenderRoutes, getAgentLocales, isSupportedAgentLocale, localeFromAgentPath, renderAgentMarkdownFrontmatter, renderAgentMarkdownPage, renderLlmsFullTxt, renderLlmsTxt, resolveMarkdownForPublicRoute, routePathFromIndexSlug, routePathFromRawSlug } from '../runtime/server/agent-site.js';
|
|
14
|
-
export type { AgentMarkdown, AgentMarkdownComponent, AgentMarkdownComponentMap, AgentMarkdownContext, AgentMarkdownMeta, AgentMarkdownPublicSignals, AgentMarkdownSerializer, AgentMarkdownSerializerMap, ResolvedAgentMarkdownOptions } from '../runtime/server/agent-markdown.js';
|
|
15
|
-
export type { AgentPage, AgentPageSource } from '../runtime/server/agent-site.js';
|
|
16
|
-
export type { QueryWhere, QueryOperators, ContentSelector, ContentPageResult, ContentQueryBuilderParams, ContentRouteMeta, ContentSearchSection, ContentResolvedMeta, ContentSitemapEntry, BacklinkFields, BacklinkSource, BacklinksOptions, BacklinksResult, LocaleFallback, DocumentFromHandle, OneOptions, ManyOptions, PaginationOptions, PaginationResult, PopulateSpec, PopulatedDocument, ResolveOneOptions, ResolveOneResult, LocalizedDoc, LocalizedContentDocument, LocalePathEntry, NeighborsOptions, NeighborsResult, SortSpec, TreeOptions, VariantsOptions, ContentVariant } from '../types/query.js';
|
|
9
|
+
export { getCollectionPath } from '../features/query/routes.js';
|
|
10
|
+
export type { CollectionPathOptions } from '../features/query/routes.js';
|
|
11
|
+
export type { QueryWhere, QueryOperators, ContentSelector, ContentPageResult, ContentRouteMeta, ContentSearchSection, ContentResolvedMeta, ContentSitemapEntry, BacklinkFields, BacklinkSource, BacklinksOptions, BacklinksResult, LocaleFallback, DocumentFromHandle, OneOptions, ManyOptions, PaginationOptions, PaginationResult, PopulateSpec, PopulatedDocument, ResolveOneOptions, ResolveOneResult, LocalizedDoc, LocalizedContentDocument, LocalePathEntry, NeighborsOptions, NeighborsResult, SortSpec, TreeOptions, VariantsOptions, ContentVariant } from '../types/query.js';
|
|
17
12
|
export type { ContentQueryResponse } from '../types/api.js';
|
|
18
13
|
export declare const queryCollectionsSitemapEntries: typeof import('../runtime/server/sitemap-provider.js').queryCollectionsSitemapEntries;
|
|
19
14
|
export { createContentProviderError } from './provider-errors.js';
|
|
20
|
-
export { contentCacheHeaders, noopContentCache, vercelContentCache, type VercelContentCacheOptions } from '../runtime/server/cache-adapters.js';
|
|
15
|
+
export { contentCacheHeaders, noopContentCache, vercelContentCache, headersContentCache, type VercelContentCacheOptions } from '../runtime/server/cache-adapters.js';
|
|
21
16
|
export { clearContentCacheHint, collectContentCacheHint, getContentCacheHint } from '../runtime/server/cache-hints.js';
|
|
22
|
-
export
|
|
23
|
-
export {
|
|
24
|
-
export type {
|
|
17
|
+
export { PROVIDER_QUERY_VERSION, toContentProviderNavigationQuery, toContentProviderQuery, withContentCache } from './provider.js';
|
|
18
|
+
export { normalizeProviderDocument, shapeProviderDocument } from '../runtime/server/provider-document.js';
|
|
19
|
+
export type { ProviderDocumentInput, ShapeProviderDocumentOptions } from '../runtime/server/provider-document.js';
|
package/dist/public/server.js
CHANGED
|
@@ -9,40 +9,7 @@ export {
|
|
|
9
9
|
neighbors,
|
|
10
10
|
createServerContentQueryContext
|
|
11
11
|
} from "../runtime/server/query-api.js";
|
|
12
|
-
export { getCollectionPath } from "../
|
|
13
|
-
export { agentMarkdownPathForRoute, agentRawPathForRoute, normalizeAgentRoutePath } from "../runtime/agent-paths.js";
|
|
14
|
-
export {
|
|
15
|
-
clearAgentMarkdownSerializers,
|
|
16
|
-
blockquoteMarkdown,
|
|
17
|
-
defineAgentMarkdownComponent,
|
|
18
|
-
getMarkdownProp,
|
|
19
|
-
jsonFenceMarkdown,
|
|
20
|
-
linkMarkdown,
|
|
21
|
-
queryMarkdownEnabledContent,
|
|
22
|
-
registerAgentMarkdownComponent,
|
|
23
|
-
registerAgentMarkdownComponents,
|
|
24
|
-
registerAgentMarkdownSerializer,
|
|
25
|
-
registerAgentMarkdownSerializers,
|
|
26
|
-
renderMarkdownChildren,
|
|
27
|
-
resolveAgentMarkdownOptions,
|
|
28
|
-
resolveContentMarkdown,
|
|
29
|
-
resolveContentMarkdownByRoute,
|
|
30
|
-
xmlComponentMarkdown
|
|
31
|
-
} from "../runtime/server/agent-markdown.js";
|
|
32
|
-
export {
|
|
33
|
-
buildAgentPageIndex,
|
|
34
|
-
collectAgentMarkdownPrerenderRoutes,
|
|
35
|
-
getAgentLocales,
|
|
36
|
-
isSupportedAgentLocale,
|
|
37
|
-
localeFromAgentPath,
|
|
38
|
-
renderAgentMarkdownFrontmatter,
|
|
39
|
-
renderAgentMarkdownPage,
|
|
40
|
-
renderLlmsFullTxt,
|
|
41
|
-
renderLlmsTxt,
|
|
42
|
-
resolveMarkdownForPublicRoute,
|
|
43
|
-
routePathFromIndexSlug,
|
|
44
|
-
routePathFromRawSlug
|
|
45
|
-
} from "../runtime/server/agent-site.js";
|
|
12
|
+
export { getCollectionPath } from "../features/query/routes.js";
|
|
46
13
|
export const queryCollectionsSitemapEntries = async (...args) => {
|
|
47
14
|
const { queryCollectionsSitemapEntries: queryCollectionsSitemapEntries2 } = await import("../runtime/server/sitemap-provider.js");
|
|
48
15
|
return await queryCollectionsSitemapEntries2(...args);
|
|
@@ -51,11 +18,13 @@ export { createContentProviderError } from "./provider-errors.js";
|
|
|
51
18
|
export {
|
|
52
19
|
contentCacheHeaders,
|
|
53
20
|
noopContentCache,
|
|
54
|
-
vercelContentCache
|
|
21
|
+
vercelContentCache,
|
|
22
|
+
headersContentCache
|
|
55
23
|
} from "../runtime/server/cache-adapters.js";
|
|
56
24
|
export {
|
|
57
25
|
clearContentCacheHint,
|
|
58
26
|
collectContentCacheHint,
|
|
59
27
|
getContentCacheHint
|
|
60
28
|
} from "../runtime/server/cache-hints.js";
|
|
61
|
-
export { withContentCache } from "./provider.js";
|
|
29
|
+
export { PROVIDER_QUERY_VERSION, toContentProviderNavigationQuery, toContentProviderQuery, withContentCache } from "./provider.js";
|
|
30
|
+
export { normalizeProviderDocument, shapeProviderDocument } from "../runtime/server/provider-document.js";
|
|
@@ -19,7 +19,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
19
19
|
default: undefined;
|
|
20
20
|
};
|
|
21
21
|
class: {
|
|
22
|
-
type: (
|
|
22
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
|
|
23
23
|
default: undefined;
|
|
24
24
|
};
|
|
25
25
|
unwrap: {
|
|
@@ -45,7 +45,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
45
45
|
default: undefined;
|
|
46
46
|
};
|
|
47
47
|
class: {
|
|
48
|
-
type: (
|
|
48
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
|
|
49
49
|
default: undefined;
|
|
50
50
|
};
|
|
51
51
|
unwrap: {
|
|
@@ -55,8 +55,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
55
55
|
}>> & Readonly<{}>, {
|
|
56
56
|
excerpt: boolean;
|
|
57
57
|
value: Record<string, any>;
|
|
58
|
+
tag: string;
|
|
58
59
|
class: string | unknown[] | Record<string, any>;
|
|
59
60
|
prose: boolean;
|
|
60
|
-
tag: string;
|
|
61
61
|
unwrap: string | boolean;
|
|
62
62
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -12,7 +12,7 @@ function normalizeBody(value, excerpt) {
|
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
14
|
function warnUnsupportedValue(value, excerpt) {
|
|
15
|
-
const path = value?.
|
|
15
|
+
const path = value?.path ? ` for "${value.path}"` : "";
|
|
16
16
|
const target = excerpt ? "excerpt" : "body";
|
|
17
17
|
console.warn(
|
|
18
18
|
`[ginko-content] <ContentRenderer> could not render ${target}${path}. Pass the full content document with a markdown body, or provide an \`empty\` slot for empty/unsupported content.`
|
|
@@ -52,7 +52,7 @@ export default defineComponent({
|
|
|
52
52
|
() => props.excerpt,
|
|
53
53
|
(newExcerpt) => {
|
|
54
54
|
if (newExcerpt && !props.value?.excerpt) {
|
|
55
|
-
console.warn(`No excerpt found for document content/${props?.value?.
|
|
55
|
+
console.warn(`No excerpt found for document content/${props?.value?.path}.${props?.value?.file?.extension}!`);
|
|
56
56
|
console.warn("Make sure to use <!--more--> in your content if you want to use excerpt feature.");
|
|
57
57
|
}
|
|
58
58
|
},
|
|
@@ -19,7 +19,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
19
19
|
default: undefined;
|
|
20
20
|
};
|
|
21
21
|
class: {
|
|
22
|
-
type: (
|
|
22
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
|
|
23
23
|
default: undefined;
|
|
24
24
|
};
|
|
25
25
|
unwrap: {
|
|
@@ -45,7 +45,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
45
45
|
default: undefined;
|
|
46
46
|
};
|
|
47
47
|
class: {
|
|
48
|
-
type: (
|
|
48
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
|
|
49
49
|
default: undefined;
|
|
50
50
|
};
|
|
51
51
|
unwrap: {
|
|
@@ -55,8 +55,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
55
55
|
}>> & Readonly<{}>, {
|
|
56
56
|
excerpt: boolean;
|
|
57
57
|
value: Record<string, any>;
|
|
58
|
+
tag: string;
|
|
58
59
|
class: string | unknown[] | Record<string, any>;
|
|
59
60
|
prose: boolean;
|
|
60
|
-
tag: string;
|
|
61
61
|
unwrap: string | boolean;
|
|
62
62
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -41,9 +41,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
41
41
|
default: () => {};
|
|
42
42
|
};
|
|
43
43
|
}>> & Readonly<{}>, {
|
|
44
|
+
tag: string;
|
|
44
45
|
components: Record<string, any>;
|
|
45
46
|
prose: boolean;
|
|
46
|
-
tag: string;
|
|
47
47
|
unwrap: string | boolean;
|
|
48
48
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
49
49
|
declare const _default: typeof __VLS_export;
|
|
@@ -41,9 +41,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
41
41
|
default: () => {};
|
|
42
42
|
};
|
|
43
43
|
}>> & Readonly<{}>, {
|
|
44
|
+
tag: string;
|
|
44
45
|
components: Record<string, any>;
|
|
45
46
|
prose: boolean;
|
|
46
|
-
tag: string;
|
|
47
47
|
unwrap: string | boolean;
|
|
48
48
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
49
49
|
declare const _default: typeof __VLS_export;
|
|
@@ -12,11 +12,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
12
12
|
default: undefined;
|
|
13
13
|
};
|
|
14
14
|
width: {
|
|
15
|
-
type: (
|
|
15
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
16
16
|
default: undefined;
|
|
17
17
|
};
|
|
18
18
|
height: {
|
|
19
|
-
type: (
|
|
19
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
20
20
|
default: undefined;
|
|
21
21
|
};
|
|
22
22
|
loading: {
|
|
@@ -37,11 +37,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
37
37
|
default: undefined;
|
|
38
38
|
};
|
|
39
39
|
width: {
|
|
40
|
-
type: (
|
|
40
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
41
41
|
default: undefined;
|
|
42
42
|
};
|
|
43
43
|
height: {
|
|
44
|
-
type: (
|
|
44
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
45
45
|
default: undefined;
|
|
46
46
|
};
|
|
47
47
|
loading: {
|
|
@@ -12,11 +12,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
12
12
|
default: undefined;
|
|
13
13
|
};
|
|
14
14
|
width: {
|
|
15
|
-
type: (
|
|
15
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
16
16
|
default: undefined;
|
|
17
17
|
};
|
|
18
18
|
height: {
|
|
19
|
-
type: (
|
|
19
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
20
20
|
default: undefined;
|
|
21
21
|
};
|
|
22
22
|
loading: {
|
|
@@ -37,11 +37,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
37
37
|
default: undefined;
|
|
38
38
|
};
|
|
39
39
|
width: {
|
|
40
|
-
type: (
|
|
40
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
41
41
|
default: undefined;
|
|
42
42
|
};
|
|
43
43
|
height: {
|
|
44
|
-
type: (
|
|
44
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
45
45
|
default: undefined;
|
|
46
46
|
};
|
|
47
47
|
loading: {
|
|
@@ -62,8 +62,8 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
62
62
|
};
|
|
63
63
|
}>> & Readonly<{}>, {
|
|
64
64
|
code: string;
|
|
65
|
-
meta: string;
|
|
66
65
|
style: string | Record<string, any>;
|
|
66
|
+
meta: string;
|
|
67
67
|
class: string;
|
|
68
68
|
language: string;
|
|
69
69
|
filename: string;
|
|
@@ -62,8 +62,8 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
62
62
|
};
|
|
63
63
|
}>> & Readonly<{}>, {
|
|
64
64
|
code: string;
|
|
65
|
-
meta: string;
|
|
66
65
|
style: string | Record<string, any>;
|
|
66
|
+
meta: string;
|
|
67
67
|
class: string;
|
|
68
68
|
language: string;
|
|
69
69
|
filename: string;
|
|
@@ -59,9 +59,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
59
59
|
}>> & Readonly<{}>, {
|
|
60
60
|
excerpt: boolean;
|
|
61
61
|
data: Record<string, any>;
|
|
62
|
+
tag: string;
|
|
62
63
|
components: Record<string, any>;
|
|
63
64
|
prose: boolean;
|
|
64
|
-
tag: string;
|
|
65
65
|
unwrap: string | boolean;
|
|
66
66
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
67
67
|
declare const _default: typeof __VLS_export;
|
|
@@ -44,8 +44,8 @@ const runtimeContent = useRuntimeConfig().public?.content || {};
|
|
|
44
44
|
const attrs = useAttrs();
|
|
45
45
|
const { unwrap: unwrapRoot } = useUnwrap();
|
|
46
46
|
const localePath = useLocalePath();
|
|
47
|
-
const locale = computed(() => props.value.locale || props.value.
|
|
48
|
-
const linkLocale = computed(() => props.value.
|
|
47
|
+
const locale = computed(() => props.value.locale || props.value.resolved?.locale || props.value.locale);
|
|
48
|
+
const linkLocale = computed(() => props.value.resolved?.requestedLocale || locale.value);
|
|
49
49
|
const defaultLocale = computed(() => props.value.defaultLocale || runtimeContent.defaultLocale);
|
|
50
50
|
const locales = computed(() => {
|
|
51
51
|
const variantLocales = Array.isArray(props.value.variants) ? props.value.variants.map((variant) => variant.locale).filter((locale2) => Boolean(locale2)) : [];
|
|
@@ -64,7 +64,7 @@ const body = computed(() => {
|
|
|
64
64
|
}
|
|
65
65
|
const resolvedRefs = resolveMarkdownRenderRefs(
|
|
66
66
|
body2,
|
|
67
|
-
props.value.
|
|
67
|
+
props.value.resolved?.resolvedRefs,
|
|
68
68
|
runtimeContent.links,
|
|
69
69
|
(route) => localePath(route, linkLocale.value)
|
|
70
70
|
);
|
|
@@ -105,7 +105,7 @@ const rendererAttrs = computed(() => {
|
|
|
105
105
|
:default-locale="defaultLocale"
|
|
106
106
|
:locales="locales"
|
|
107
107
|
:components="resolvedComponents"
|
|
108
|
-
:data-content-id="debug ? value.
|
|
108
|
+
:data-content-id="debug ? value.id : void 0"
|
|
109
109
|
v-bind="rendererAttrs"
|
|
110
110
|
/>
|
|
111
111
|
</template>
|
|
@@ -59,9 +59,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
59
59
|
}>> & Readonly<{}>, {
|
|
60
60
|
excerpt: boolean;
|
|
61
61
|
data: Record<string, any>;
|
|
62
|
+
tag: string;
|
|
62
63
|
components: Record<string, any>;
|
|
63
64
|
prose: boolean;
|
|
64
|
-
tag: string;
|
|
65
65
|
unwrap: string | boolean;
|
|
66
66
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
67
67
|
declare const _default: typeof __VLS_export;
|
|
@@ -19,7 +19,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
19
19
|
default: string;
|
|
20
20
|
};
|
|
21
21
|
class: {
|
|
22
|
-
type: (
|
|
22
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
|
|
23
23
|
default: undefined;
|
|
24
24
|
};
|
|
25
25
|
dataContentId: {
|
|
@@ -58,7 +58,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
58
58
|
default: string;
|
|
59
59
|
};
|
|
60
60
|
class: {
|
|
61
|
-
type: (
|
|
61
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
|
|
62
62
|
default: undefined;
|
|
63
63
|
};
|
|
64
64
|
dataContentId: {
|
|
@@ -79,12 +79,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
79
79
|
};
|
|
80
80
|
}>> & Readonly<{}>, {
|
|
81
81
|
locale: string;
|
|
82
|
+
tag: string;
|
|
82
83
|
defaultLocale: string;
|
|
83
84
|
locales: string[];
|
|
84
85
|
class: string | unknown[] | Record<string, any>;
|
|
85
86
|
components: Record<string, any>;
|
|
86
87
|
prose: boolean | undefined;
|
|
87
|
-
tag: string;
|
|
88
88
|
dataContentId: string;
|
|
89
89
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
90
90
|
export default _default;
|