From 6c66e974e52492477f687d9253546aafb97d3cb6 Mon Sep 17 00:00:00 2001 From: zernonia Date: Sat, 23 Mar 2024 17:19:01 +0800 Subject: [PATCH] refactor: change to use iframe feat: add more blocks --- .../.vitepress/theme/components/BlockPage.vue | 12 +++ .../theme/components/BlockPreview.vue | 22 ++++-- .../.vitepress/theme/components/Blocks.vue | 2 +- .../.vitepress/theme/layout/MainLayout.vue | 7 +- apps/www/__registry__/index.ts | 42 +++++++++++ apps/www/src/content/blocks/renderer.md | 10 +++ .../default/block/Authentication01.vue | 2 +- .../default/block/Authentication02.vue | 60 +++++++++++++++ .../default/block/Authentication03.vue | 65 +++++++++++++++++ .../default/block/Authentication04.vue | 73 +++++++++++++++++++ .../new-york/block/Authentication01.vue | 2 +- .../new-york/block/Authentication02.vue | 60 +++++++++++++++ .../new-york/block/Authentication03.vue | 65 +++++++++++++++++ .../new-york/block/Authentication04.vue | 73 +++++++++++++++++++ apps/www/src/public/placeholder.svg | 1 + 15 files changed, 485 insertions(+), 11 deletions(-) create mode 100644 apps/www/.vitepress/theme/components/BlockPage.vue create mode 100644 apps/www/src/content/blocks/renderer.md create mode 100644 apps/www/src/lib/registry/default/block/Authentication02.vue create mode 100644 apps/www/src/lib/registry/default/block/Authentication03.vue create mode 100644 apps/www/src/lib/registry/default/block/Authentication04.vue create mode 100644 apps/www/src/lib/registry/new-york/block/Authentication02.vue create mode 100644 apps/www/src/lib/registry/new-york/block/Authentication03.vue create mode 100644 apps/www/src/lib/registry/new-york/block/Authentication04.vue create mode 100644 apps/www/src/public/placeholder.svg diff --git a/apps/www/.vitepress/theme/components/BlockPage.vue b/apps/www/.vitepress/theme/components/BlockPage.vue new file mode 100644 index 00000000..69e58caa --- /dev/null +++ b/apps/www/.vitepress/theme/components/BlockPage.vue @@ -0,0 +1,12 @@ + + + diff --git a/apps/www/.vitepress/theme/components/BlockPreview.vue b/apps/www/.vitepress/theme/components/BlockPreview.vue index 10352231..c1f6edc1 100644 --- a/apps/www/.vitepress/theme/components/BlockPreview.vue +++ b/apps/www/.vitepress/theme/components/BlockPreview.vue @@ -7,7 +7,6 @@ import MagicString from 'magic-string' import { cssVariables } from '../config/shiki' import StyleSwitcher from './StyleSwitcher.vue' import Spinner from './Spinner.vue' -import ComponentLoader from './ComponentLoader.vue' import { useConfigStore } from '@/stores/config' // import { BlockCopyCodeButton } from '@/components/block-copy-code-button' @@ -26,7 +25,10 @@ const props = defineProps<{ const { style, codeConfig } = useConfigStore() +const isLoading = ref(true) +const tabValue = ref('preview') const resizableRef = ref>() + const rawString = ref('') const codeHtml = ref('') const metadata = reactive({ @@ -90,10 +92,10 @@ watch([style, codeConfig], async () => {