@onderwijsin/nuxt-markdown-renderer 0.0.0-stage → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +332 -2
  3. package/dist/metadata/runtime/app/components/renderer/MarkdownButton.vue +67 -0
  4. package/dist/metadata/runtime/app/components/renderer/MarkdownCallout.vue +115 -0
  5. package/dist/metadata/runtime/app/components/renderer/MarkdownReference.vue +33 -0
  6. package/dist/metadata/runtime/app/utils/define-editor-component-schema.ts +12 -0
  7. package/dist/metadata/schema/editor-component-schema.ts +262 -0
  8. package/dist/module.d.mts +22 -0
  9. package/dist/module.json +12 -0
  10. package/dist/module.mjs +268 -0
  11. package/dist/runtime/app/comark-plugins/video-source.d.ts +8 -0
  12. package/dist/runtime/app/comark-plugins/video-source.js +31 -0
  13. package/dist/runtime/app/components/MarkdownRenderer.d.vue.ts +12 -0
  14. package/dist/runtime/app/components/MarkdownRenderer.vue +41 -0
  15. package/dist/runtime/app/components/MarkdownRenderer.vue.d.ts +12 -0
  16. package/dist/runtime/app/components/renderer/MarkdownButton.d.vue.ts +26 -0
  17. package/dist/runtime/app/components/renderer/MarkdownButton.vue +47 -0
  18. package/dist/runtime/app/components/renderer/MarkdownButton.vue.d.ts +26 -0
  19. package/dist/runtime/app/components/renderer/MarkdownCallout.d.vue.ts +49 -0
  20. package/dist/runtime/app/components/renderer/MarkdownCallout.vue +80 -0
  21. package/dist/runtime/app/components/renderer/MarkdownCallout.vue.d.ts +49 -0
  22. package/dist/runtime/app/components/renderer/MarkdownReference.d.vue.ts +17 -0
  23. package/dist/runtime/app/components/renderer/MarkdownReference.vue +24 -0
  24. package/dist/runtime/app/components/renderer/MarkdownReference.vue.d.ts +17 -0
  25. package/dist/runtime/app/utils/component-manifest.d.ts +13 -0
  26. package/dist/runtime/app/utils/component-manifest.js +17 -0
  27. package/dist/runtime/app/utils/define-editor-component-schema.d.ts +9 -0
  28. package/dist/runtime/app/utils/define-editor-component-schema.js +3 -0
  29. package/dist/runtime/app/utils/resolve-reference-path.d.ts +7 -0
  30. package/dist/runtime/app/utils/resolve-reference-path.js +2 -0
  31. package/dist/runtime/index.css +1 -0
  32. package/dist/runtime/index.d.ts +1 -0
  33. package/dist/runtime/index.js +0 -0
  34. package/dist/runtime/server/utils/component-metadata-handler.d.ts +61 -0
  35. package/dist/runtime/server/utils/component-metadata-handler.js +17 -0
  36. package/dist/runtime/server/utils/metadata.d.ts +22 -0
  37. package/dist/runtime/server/utils/metadata.js +186 -0
  38. package/dist/runtime/shared/types.d.ts +1 -0
  39. package/dist/runtime/shared/types.js +0 -0
  40. package/dist/runtime/types/markdown-renderer.d.ts +20 -0
  41. package/dist/schema/editor-component-schema.d.ts +223 -0
  42. package/dist/schema/editor-component-schema.js +151 -0
  43. package/dist/types.d.mts +7 -0
  44. package/package.json +78 -3
@@ -0,0 +1,26 @@
1
+ import type { ButtonProps } from "@nuxt/ui";
2
+ type __VLS_Props = {
3
+ /** Label displayed inside the button. */
4
+ label: string;
5
+ /** Link destination. Use either full URL or internal route path. */
6
+ to: string;
7
+ /** The color tone of the button. */
8
+ color?: ButtonProps["color"];
9
+ /** The visual style variant of the button. */
10
+ variant?: ButtonProps["variant"];
11
+ /** The size of the button. */
12
+ size?: ButtonProps["size"];
13
+ /** The icon displayed inside the button. */
14
+ icon?: string;
15
+ /** Whether the icon should be displayed after the label. */
16
+ trailing?: boolean;
17
+ /** Whether the button should trigger a download of the linked resource. */
18
+ download?: boolean;
19
+ };
20
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
21
+ size: "xs" | "sm" | "md" | "lg" | "xl";
22
+ color: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral";
23
+ variant: "solid" | "outline" | "soft" | "subtle" | "ghost" | "link";
24
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
+ declare const _default: typeof __VLS_export;
26
+ export default _default;
@@ -0,0 +1,47 @@
1
+ <script setup>
2
+ import { defineEditorComponentSchema } from "../../utils/define-editor-component-schema";
3
+ defineEditorComponentSchema({
4
+ label: "Button",
5
+ description: "A clickable button component.",
6
+ type: "block",
7
+ properties: {
8
+ color: {
9
+ values: [
10
+ "primary",
11
+ "secondary",
12
+ "success",
13
+ "info",
14
+ "warning",
15
+ "error",
16
+ "neutral"
17
+ ]
18
+ },
19
+ variant: {
20
+ values: ["solid", "outline", "soft", "subtle", "ghost", "link"]
21
+ },
22
+ size: {
23
+ values: ["xs", "sm", "md", "lg", "xl"]
24
+ },
25
+ icon: {
26
+ input: {
27
+ type: "icon",
28
+ collections: ["lucide"]
29
+ }
30
+ }
31
+ }
32
+ });
33
+ defineProps({
34
+ label: { type: String, required: true },
35
+ to: { type: String, required: true },
36
+ color: { type: null, required: false, default: "primary" },
37
+ variant: { type: null, required: false, default: "soft" },
38
+ size: { type: null, required: false, default: "md" },
39
+ icon: { type: String, required: false },
40
+ trailing: { type: Boolean, required: false },
41
+ download: { type: Boolean, required: false }
42
+ });
43
+ </script>
44
+
45
+ <template>
46
+ <UButton v-bind="$props" />
47
+ </template>
@@ -0,0 +1,26 @@
1
+ import type { ButtonProps } from "@nuxt/ui";
2
+ type __VLS_Props = {
3
+ /** Label displayed inside the button. */
4
+ label: string;
5
+ /** Link destination. Use either full URL or internal route path. */
6
+ to: string;
7
+ /** The color tone of the button. */
8
+ color?: ButtonProps["color"];
9
+ /** The visual style variant of the button. */
10
+ variant?: ButtonProps["variant"];
11
+ /** The size of the button. */
12
+ size?: ButtonProps["size"];
13
+ /** The icon displayed inside the button. */
14
+ icon?: string;
15
+ /** Whether the icon should be displayed after the label. */
16
+ trailing?: boolean;
17
+ /** Whether the button should trigger a download of the linked resource. */
18
+ download?: boolean;
19
+ };
20
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
21
+ size: "xs" | "sm" | "md" | "lg" | "xl";
22
+ color: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral";
23
+ variant: "solid" | "outline" | "soft" | "subtle" | "ghost" | "link";
24
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
+ declare const _default: typeof __VLS_export;
26
+ export default _default;
@@ -0,0 +1,49 @@
1
+ import type { AlertProps, ButtonProps } from "@nuxt/ui";
2
+ type __VLS_Props = {
3
+ /** Callout title. */
4
+ title?: string;
5
+ /** The color tone of the callout. */
6
+ color?: AlertProps["color"];
7
+ /** The visual style variant of the callout. */
8
+ variant?: AlertProps["variant"];
9
+ /** Optional Iconify icon name. */
10
+ icon?: string;
11
+ /** The orientation of the callout. Determines the position of the actions. */
12
+ orientation?: AlertProps["orientation"];
13
+ /** Optional call-to-action buttons. */
14
+ actions?: {
15
+ /** Label displayed inside the button. */
16
+ label: string;
17
+ /** Link destination. Use either full URL or internal route path. */
18
+ to: string;
19
+ /** The color tone of the button. */
20
+ color?: ButtonProps["color"];
21
+ /** The visual style variant of the button. */
22
+ variant?: ButtonProps["variant"];
23
+ /** The size of the button. */
24
+ size?: ButtonProps["size"];
25
+ /** The icon displayed inside the button. */
26
+ icon?: string;
27
+ /** Whether the icon should be displayed after the label. */
28
+ trailing?: boolean;
29
+ /** Whether the button should trigger a download of the linked resource. */
30
+ download?: boolean;
31
+ }[];
32
+ };
33
+ declare var __VLS_9: {};
34
+ type __VLS_Slots = {} & {
35
+ description?: (props: typeof __VLS_9) => any;
36
+ };
37
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
38
+ color: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral";
39
+ variant: "solid" | "outline" | "soft" | "subtle";
40
+ orientation: "horizontal" | "vertical";
41
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
42
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
43
+ declare const _default: typeof __VLS_export;
44
+ export default _default;
45
+ type __VLS_WithSlots<T, S> = T & {
46
+ new (): {
47
+ $slots: S;
48
+ };
49
+ };
@@ -0,0 +1,80 @@
1
+ <script setup>
2
+ import { defineEditorComponentSchema } from "../../utils/define-editor-component-schema";
3
+ defineEditorComponentSchema({
4
+ label: "Callout",
5
+ description: "A component used to highlight important information.",
6
+ type: "block",
7
+ properties: {
8
+ color: {
9
+ values: [
10
+ "primary",
11
+ "secondary",
12
+ "success",
13
+ "info",
14
+ "warning",
15
+ "error",
16
+ "neutral"
17
+ ]
18
+ },
19
+ variant: {
20
+ values: ["solid", "outline", "soft", "subtle"]
21
+ },
22
+ icon: {
23
+ input: {
24
+ type: "icon",
25
+ collections: ["lucide"]
26
+ }
27
+ },
28
+ orientation: {
29
+ values: ["horizontal", "vertical"]
30
+ },
31
+ actions: {
32
+ type: "array",
33
+ items: {
34
+ type: "object",
35
+ properties: {
36
+ color: {
37
+ values: [
38
+ "primary",
39
+ "secondary",
40
+ "success",
41
+ "info",
42
+ "warning",
43
+ "error",
44
+ "neutral"
45
+ ]
46
+ },
47
+ variant: {
48
+ values: ["solid", "outline", "soft", "subtle", "ghost", "link"]
49
+ },
50
+ size: {
51
+ values: ["xs", "sm", "md", "lg", "xl"]
52
+ },
53
+ icon: {
54
+ input: {
55
+ type: "icon",
56
+ collections: ["lucide"]
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+ });
64
+ defineProps({
65
+ title: { type: String, required: false },
66
+ color: { type: null, required: false, default: "primary" },
67
+ variant: { type: null, required: false, default: "soft" },
68
+ icon: { type: String, required: false },
69
+ orientation: { type: null, required: false, default: "vertical" },
70
+ actions: { type: Array, required: false }
71
+ });
72
+ </script>
73
+
74
+ <template>
75
+ <UAlert v-bind="$props">
76
+ <template v-if="$slots.description" #description>
77
+ <slot name="description" />
78
+ </template>
79
+ </UAlert>
80
+ </template>
@@ -0,0 +1,49 @@
1
+ import type { AlertProps, ButtonProps } from "@nuxt/ui";
2
+ type __VLS_Props = {
3
+ /** Callout title. */
4
+ title?: string;
5
+ /** The color tone of the callout. */
6
+ color?: AlertProps["color"];
7
+ /** The visual style variant of the callout. */
8
+ variant?: AlertProps["variant"];
9
+ /** Optional Iconify icon name. */
10
+ icon?: string;
11
+ /** The orientation of the callout. Determines the position of the actions. */
12
+ orientation?: AlertProps["orientation"];
13
+ /** Optional call-to-action buttons. */
14
+ actions?: {
15
+ /** Label displayed inside the button. */
16
+ label: string;
17
+ /** Link destination. Use either full URL or internal route path. */
18
+ to: string;
19
+ /** The color tone of the button. */
20
+ color?: ButtonProps["color"];
21
+ /** The visual style variant of the button. */
22
+ variant?: ButtonProps["variant"];
23
+ /** The size of the button. */
24
+ size?: ButtonProps["size"];
25
+ /** The icon displayed inside the button. */
26
+ icon?: string;
27
+ /** Whether the icon should be displayed after the label. */
28
+ trailing?: boolean;
29
+ /** Whether the button should trigger a download of the linked resource. */
30
+ download?: boolean;
31
+ }[];
32
+ };
33
+ declare var __VLS_9: {};
34
+ type __VLS_Slots = {} & {
35
+ description?: (props: typeof __VLS_9) => any;
36
+ };
37
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
38
+ color: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral";
39
+ variant: "solid" | "outline" | "soft" | "subtle";
40
+ orientation: "horizontal" | "vertical";
41
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
42
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
43
+ declare const _default: typeof __VLS_export;
44
+ export default _default;
45
+ type __VLS_WithSlots<T, S> = T & {
46
+ new (): {
47
+ $slots: S;
48
+ };
49
+ };
@@ -0,0 +1,17 @@
1
+ type __VLS_Props = {
2
+ /** Directus collection name. */
3
+ collection: string;
4
+ /** Referenced Directus item primary key. */
5
+ item: string;
6
+ /** Source display label. */
7
+ label?: string;
8
+ /** Author-controlled display text. */
9
+ text?: string;
10
+ /** Iconify icon as collection:name. */
11
+ icon?: string;
12
+ /** Reference source snapshot. */
13
+ data?: Record<string, unknown>;
14
+ };
15
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
@@ -0,0 +1,24 @@
1
+ <script setup>
2
+ import { computed } from "vue";
3
+ import resolveReferencePath from "#markdown-renderer/reference-resolver";
4
+ const props = defineProps({
5
+ collection: { type: String, required: true },
6
+ item: { type: String, required: true },
7
+ label: { type: String, required: false },
8
+ text: { type: String, required: false },
9
+ icon: { type: String, required: false },
10
+ data: { type: Object, required: false }
11
+ });
12
+ const displayText = computed(() => props.text ?? props.label ?? "");
13
+ const path = computed(
14
+ () => resolveReferencePath(props.collection, props.item, props.label, props.text, props.data)
15
+ );
16
+ </script>
17
+
18
+ <template>
19
+ <ULink v-if="path" variant="link" :to="path" :icon="icon" class="text-primary underline">
20
+ <UIcon v-if="icon" :name="icon" class="mr-1 align-[-0.125em]" />
21
+ <span>{{ displayText }}</span>
22
+ </ULink>
23
+ <span v-else>{{ displayText }}</span>
24
+ </template>
@@ -0,0 +1,17 @@
1
+ type __VLS_Props = {
2
+ /** Directus collection name. */
3
+ collection: string;
4
+ /** Referenced Directus item primary key. */
5
+ item: string;
6
+ /** Source display label. */
7
+ label?: string;
8
+ /** Author-controlled display text. */
9
+ text?: string;
10
+ /** Iconify icon as collection:name. */
11
+ icon?: string;
12
+ /** Reference source snapshot. */
13
+ data?: Record<string, unknown>;
14
+ };
15
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
@@ -0,0 +1,13 @@
1
+ type ComponentLoader = () => Promise<unknown>;
2
+ /**
3
+ * Creates the runtime resolver around build-time generated lazy component imports.
4
+ * @param componentLoaders Lazy imports keyed by renderer component name.
5
+ * @param componentSets Configured component allowlists.
6
+ * @returns Runtime manifest values consumed by `MarkdownRenderer` and metadata generation.
7
+ */
8
+ export declare function createRendererManifest(componentLoaders: Record<string, ComponentLoader>, componentSets: Record<string, string[]>): {
9
+ componentSets: Record<string, string[]>;
10
+ rendererComponentNames: string[];
11
+ resolveRendererComponent(name: string, componentSet?: string): Promise<unknown> | null;
12
+ };
13
+ export {};
@@ -0,0 +1,17 @@
1
+ function resolveComponentName(name) {
2
+ return name.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
3
+ }
4
+ export function createRendererManifest(componentLoaders, componentSets) {
5
+ return {
6
+ componentSets,
7
+ rendererComponentNames: Object.keys(componentLoaders),
8
+ resolveRendererComponent(name, componentSet) {
9
+ const normalizedName = resolveComponentName(name);
10
+ const allowedComponents = componentSet ? componentSets[componentSet] : void 0;
11
+ if (normalizedName !== "Reference" && componentSet && (!allowedComponents || !allowedComponents.includes(normalizedName))) {
12
+ return null;
13
+ }
14
+ return componentLoaders[normalizedName]?.() ?? null;
15
+ }
16
+ };
17
+ }
@@ -0,0 +1,9 @@
1
+ import type { EditorComponentInput } from "../../../schema/editor-component-schema.js";
2
+ /**
3
+ * Defines editor metadata for a Markdown component.
4
+ *
5
+ * This is a compiler macro registered with `nuxt-component-meta`; its call is extracted at build
6
+ * time. The implementation is intentionally inert in case tooling evaluates the module directly.
7
+ * @param metadata Markdown editor metadata extracted during the Nuxt build.
8
+ */
9
+ export declare function defineEditorComponentSchema(metadata: EditorComponentInput): void;
@@ -0,0 +1,3 @@
1
+ export function defineEditorComponentSchema(metadata) {
2
+ void metadata;
3
+ }
@@ -0,0 +1,7 @@
1
+ import type { ResolveReferencePath } from "../../shared/types.js";
2
+ /**
3
+ * Default reference resolver used when the consuming application does not configure one.
4
+ * @returns No route because route semantics belong to the consuming application.
5
+ */
6
+ declare const resolveReferencePath: ResolveReferencePath;
7
+ export default resolveReferencePath;
@@ -0,0 +1,2 @@
1
+ const resolveReferencePath = () => void 0;
2
+ export default resolveReferencePath;
@@ -0,0 +1 @@
1
+ @source "./app";
@@ -0,0 +1 @@
1
+ export type { ResolveReferencePath } from "./shared/types.js";
File without changes
@@ -0,0 +1,61 @@
1
+ import type { EditorComponentSource } from "./metadata.js";
2
+ /**
3
+ * Creates the set-aware metadata endpoint around a generated component-meta registry.
4
+ * @param componentMeta Registry generated by `nuxt-component-meta`.
5
+ * @param rendererComponents All discovered renderer node and Nuxt component names.
6
+ * @param componentSets Configured component allowlists.
7
+ * @param corsOrigin Origins allowed to read metadata from a browser.
8
+ * @returns An H3 event handler serving the selected metadata array.
9
+ */
10
+ export declare function createComponentMetadataHandler(componentMeta: unknown, rendererComponents: EditorComponentSource[], componentSets: Record<string, string[]>, corsOrigin: "*" | "null" | string[]): import("h3").EventHandler<import("h3").EventHandlerRequest, {
11
+ name: string;
12
+ props: Record<string, {
13
+ name: string;
14
+ type: "string" | "number" | "boolean" | "object" | "array";
15
+ values?: string[] | undefined;
16
+ default?: unknown;
17
+ description?: string | undefined;
18
+ required?: boolean | undefined;
19
+ tags?: {
20
+ name: string;
21
+ text?: string | undefined;
22
+ config?: unknown;
23
+ }[] | undefined;
24
+ } & {
25
+ properties?: Record<string, {
26
+ name: string;
27
+ type: "string" | "number" | "boolean" | "object" | "array";
28
+ values?: string[] | undefined;
29
+ default?: unknown;
30
+ description?: string | undefined;
31
+ required?: boolean | undefined;
32
+ tags?: {
33
+ name: string;
34
+ text?: string | undefined;
35
+ config?: unknown;
36
+ }[] | undefined;
37
+ } & /*elided*/ any>;
38
+ items?: {
39
+ name: string;
40
+ type: "string" | "number" | "boolean" | "object" | "array";
41
+ values?: string[] | undefined;
42
+ default?: unknown;
43
+ description?: string | undefined;
44
+ required?: boolean | undefined;
45
+ tags?: {
46
+ name: string;
47
+ text?: string | undefined;
48
+ config?: unknown;
49
+ }[] | undefined;
50
+ } & /*elided*/ any;
51
+ }>;
52
+ slots: string[];
53
+ label: string;
54
+ nodeType: "block" | "inline";
55
+ description?: string | undefined;
56
+ tags?: {
57
+ name: string;
58
+ text?: string | undefined;
59
+ config?: unknown;
60
+ }[] | undefined;
61
+ }[] | undefined>;
@@ -0,0 +1,17 @@
1
+ import { createError, defineEventHandler, getRouterParam, handleCors } from "h3";
2
+ import { createEditorComponentMetadata } from "./metadata.js";
3
+ export function createComponentMetadataHandler(componentMeta, rendererComponents, componentSets, corsOrigin) {
4
+ return defineEventHandler((event) => {
5
+ if (handleCors(event, { origin: corsOrigin, methods: ["GET"] })) return;
6
+ const componentSet = getRouterParam(event, "componentSet");
7
+ const componentNames = componentSet ? componentSets[componentSet] : void 0;
8
+ if (componentSet && !componentNames) {
9
+ throw createError({
10
+ statusCode: 404,
11
+ statusMessage: `Unknown Markdown renderer component set: ${componentSet}`
12
+ });
13
+ }
14
+ const components = componentNames ? rendererComponents.filter(({ name }) => componentNames.includes(name)) : rendererComponents;
15
+ return createEditorComponentMetadata(componentMeta, components);
16
+ });
17
+ }
@@ -0,0 +1,22 @@
1
+ import type { EditorComponentOutput } from "../../../schema/editor-component-schema.js";
2
+ export interface EditorComponentSource {
3
+ /** Name stored in Markdown and returned to the editor. */
4
+ name: string;
5
+ /** Name used to find the component in the generated Nuxt metadata registry. */
6
+ componentName: string;
7
+ }
8
+ /**
9
+ * Converts Nuxt component metadata to the Directus Markdown editor contract.
10
+ *
11
+ * The registry is an external/generated boundary, so every value is narrowed before use. Reserved
12
+ * `Reference` nodes are omitted because Directus owns that editor node. Components without parsed
13
+ * metadata are also omitted rather than returning an incomplete contract.
14
+ *
15
+ * The result is a bare array. The Directus extension accepts either this shape or a legacy
16
+ * `{ components: [...] }` wrapper and normalizes both; the array avoids an unnecessary envelope.
17
+ *
18
+ * @param registry Component registry generated by `nuxt-component-meta`.
19
+ * @param components Renderer node names and their Nuxt component names.
20
+ * @returns Directus Markdown editor component metadata.
21
+ */
22
+ export declare function createEditorComponentMetadata(registry: unknown, components: EditorComponentSource[]): EditorComponentOutput[];