From 6289d3cdbd6903eb05011f0545ee45ca2dd27077 Mon Sep 17 00:00:00 2001 From: Hugo Richard Date: Fri, 5 Sep 2025 23:29:16 +0100 Subject: [PATCH 1/4] up --- .../components/content/AIContentGenerator.vue | 250 ++++++++++++++++++ docs/app/components/content/ComponentCode.vue | 19 ++ docs/server/api/content-generation.ts | 59 +++++ docs/shared/utils/components.ts | 44 +++ docs/shared/utils/index.ts | 1 + 5 files changed, 373 insertions(+) create mode 100644 docs/app/components/content/AIContentGenerator.vue create mode 100644 docs/server/api/content-generation.ts create mode 100644 docs/shared/utils/components.ts create mode 100644 docs/shared/utils/index.ts diff --git a/docs/app/components/content/AIContentGenerator.vue b/docs/app/components/content/AIContentGenerator.vue new file mode 100644 index 0000000000..880fe5cd99 --- /dev/null +++ b/docs/app/components/content/AIContentGenerator.vue @@ -0,0 +1,250 @@ + + + + + diff --git a/docs/app/components/content/ComponentCode.vue b/docs/app/components/content/ComponentCode.vue index 7b9d4f4550..789299d070 100644 --- a/docs/app/components/content/ComponentCode.vue +++ b/docs/app/components/content/ComponentCode.vue @@ -300,6 +300,21 @@ ${props.slots?.default} return code }) +function handleAIGenerated(generatedContent: any) { + try { + // Apply generated content to component props + Object.entries(generatedContent).forEach(([key, value]) => { + if (value !== undefined && value !== null) { + setComponentProp(key, value) + } + }) + + console.log('Applied generated content:', generatedContent) + } catch (error) { + console.error('Error applying generated content:', error) + } +} + const { data: ast } = await useAsyncData(`component-code-${name}-${hash({ props: componentProps, slots: props.slots })}`, async () => { if (!props.prettier) { return parseMarkdown(code.value) @@ -373,6 +388,10 @@ const { data: ast } = await useAsyncData(`component-code-${name}-${hash({ props:
+