From b5da766165341eb79a54d1820281afa88e772ece Mon Sep 17 00:00:00 2001 From: Romain Hamel Date: Sat, 1 Mar 2025 19:57:40 +0100 Subject: [PATCH 01/19] feat: improve property inputs --- devtools/app/components/ComponentCode.vue | 1 + .../app/components/ComponentPropInput.vue | 35 ++++++------ devtools/app/components/inputs/ArrayInput.vue | 53 +++++++++++++------ .../app/components/inputs/NumberInput.vue | 2 +- .../app/components/inputs/ObjectInput.vue | 8 +-- .../components/inputs/PrimitiveArrayInput.vue | 8 +-- .../app/components/inputs/StringInput.vue | 7 ++- devtools/app/composables/useShiki.ts | 25 ++++++++- devtools/app/pages/components/[id].vue | 3 +- playground/components/CompodiumWelcome.vue | 14 +++-- playground/components/InputProps.vue | 31 +++++++++++ src/runtime/server/api/component-meta.get.ts | 7 ++- src/runtime/server/services/infer.ts | 11 ++-- 13 files changed, 151 insertions(+), 54 deletions(-) create mode 100644 playground/components/InputProps.vue diff --git a/devtools/app/components/ComponentCode.vue b/devtools/app/components/ComponentCode.vue index 750e7e22..db73d41b 100644 --- a/devtools/app/components/ComponentCode.vue +++ b/devtools/app/components/ComponentCode.vue @@ -32,6 +32,7 @@ const { data: formattedCode } = useAsyncData('__compodium-component-formatted-co }, { watch: [code] }) const { codeToHtml } = useShiki() + const { data: highlightedCode } = useAsyncData('__compodium-component-highlighted-code', async () => { return formattedCode.value ? codeToHtml(formattedCode.value, 'vue') diff --git a/devtools/app/components/ComponentPropInput.vue b/devtools/app/components/ComponentPropInput.vue index a67f406c..e1297c9e 100644 --- a/devtools/app/components/ComponentPropInput.vue +++ b/devtools/app/components/ComponentPropInput.vue @@ -22,7 +22,7 @@ const inputTypes: Record = {