From 1c5104581685a5a3d1d6c0b30dd406ac27ac3653 Mon Sep 17 00:00:00 2001 From: Robert Soriano Date: Tue, 3 Dec 2024 08:49:44 -0800 Subject: [PATCH] chore(vue): Add custom menu items to `` (#4693) --- .changeset/moody-snails-smell.md | 5 + integration/presets/vue.ts | 6 +- integration/templates/vue-vite/src/App.vue | 5 +- .../src/components/CustomUserButton.vue | 32 ++++++ integration/tests/vue/components.test.ts | 45 ++++++++ packages/vue/src/components/uiComponents.ts | 94 +++++++++++++++- packages/vue/src/errors/messages.ts | 15 +++ packages/vue/src/keys.ts | 10 +- packages/vue/src/types.ts | 42 +++++++- .../__tests__/useCustomElementPortal.test.ts | 29 +++++ .../__tests__/useCustomMenuItems.test.ts | 102 ++++++++++++++++++ packages/vue/src/utils/componentValidation.ts | 9 ++ .../vue/src/utils/useCustomElementPortal.ts | 40 +++++++ packages/vue/src/utils/useCustomMenuItems.ts | 95 ++++++++++++++++ 14 files changed, 519 insertions(+), 10 deletions(-) create mode 100644 .changeset/moody-snails-smell.md create mode 100644 integration/templates/vue-vite/src/components/CustomUserButton.vue create mode 100644 packages/vue/src/utils/__tests__/useCustomElementPortal.test.ts create mode 100644 packages/vue/src/utils/__tests__/useCustomMenuItems.test.ts create mode 100644 packages/vue/src/utils/componentValidation.ts create mode 100644 packages/vue/src/utils/useCustomElementPortal.ts create mode 100644 packages/vue/src/utils/useCustomMenuItems.ts diff --git a/.changeset/moody-snails-smell.md b/.changeset/moody-snails-smell.md new file mode 100644 index 0000000000..bdf814b8fd --- /dev/null +++ b/.changeset/moody-snails-smell.md @@ -0,0 +1,5 @@ +--- +"@clerk/vue": patch +--- + +Add support for custom menu items to `` diff --git a/integration/presets/vue.ts b/integration/presets/vue.ts index ca8be4cf2a..3d9cc9e280 100644 --- a/integration/presets/vue.ts +++ b/integration/presets/vue.ts @@ -6,9 +6,9 @@ const vite = applicationConfig() .useTemplate(templates['vue-vite']) .setEnvFormatter('public', key => `VITE_${key}`) .addScript('setup', 'pnpm install') - .addScript('dev', 'npm run dev') - .addScript('build', 'npm run build') - .addScript('serve', 'npm run preview') + .addScript('dev', 'pnpm dev') + .addScript('build', 'pnpm build') + .addScript('serve', 'pnpm preview') .addDependency('@clerk/vue', '*'); export const vue = { diff --git a/integration/templates/vue-vite/src/App.vue b/integration/templates/vue-vite/src/App.vue index 2d04a9aa09..ca35a2979f 100644 --- a/integration/templates/vue-vite/src/App.vue +++ b/integration/templates/vue-vite/src/App.vue @@ -1,5 +1,6 @@