From a03bace32c0c11cc82388d0e09d65d0dfb1c77d4 Mon Sep 17 00:00:00 2001 From: zernonia <59365435+zernonia@users.noreply.github.com> Date: Sat, 23 Mar 2024 18:24:48 +0800 Subject: [PATCH] feat: Blocks (#428) * chore: build registry * feat: block preview * refactor: change to use iframe feat: add more blocks * chore: fix build * feat: add all other blocks * feat: add copy button * chore: cleanup --- .../theme/components/Announcement.vue | 18 + .../theme/components/BlockCopyButton.vue | 38 ++ .../.vitepress/theme/components/BlockPage.vue | 12 + .../theme/components/BlockPreview.vue | 245 ++++++++++ .../.vitepress/theme/components/Blocks.vue | 53 ++ .../theme/components/ComponentLoader.vue | 3 +- .../theme/components/ComponentPreview.vue | 2 +- .../theme/components/LandingPage.vue | 13 +- apps/www/.vitepress/theme/config/docs.ts | 4 + apps/www/.vitepress/theme/config/site.ts | 4 +- .../theme/layout/ExamplesLayout.vue | 15 +- .../.vitepress/theme/layout/MainLayout.vue | 412 ++++++++-------- apps/www/__registry__/index.ts | 112 +++++ apps/www/src/content/blocks.md | 9 + apps/www/src/content/blocks/renderer.md | 10 + .../default/block/Authentication01.vue | 41 ++ .../default/block/Authentication02.vue | 60 +++ .../default/block/Authentication03.vue | 65 +++ .../default/block/Authentication04.vue | 73 +++ .../registry/default/block/Dashboard01.vue | 462 ++++++++++++++++++ .../registry/default/block/Dashboard02.vue | 222 +++++++++ .../registry/default/block/Dashboard03.vue | 441 +++++++++++++++++ .../registry/default/block/Dashboard04.vue | 216 ++++++++ .../new-york/block/Authentication01.vue | 41 ++ .../new-york/block/Authentication02.vue | 60 +++ .../new-york/block/Authentication03.vue | 65 +++ .../new-york/block/Authentication04.vue | 73 +++ .../registry/new-york/block/Dashboard01.vue | 462 ++++++++++++++++++ .../registry/new-york/block/Dashboard02.vue | 222 +++++++++ .../registry/new-york/block/Dashboard03.vue | 441 +++++++++++++++++ .../registry/new-york/block/Dashboard04.vue | 216 ++++++++ apps/www/src/lib/registry/registry.ts | 21 +- apps/www/src/lib/registry/schema.ts | 1 + apps/www/src/public/placeholder.svg | 1 + 34 files changed, 3893 insertions(+), 240 deletions(-) create mode 100644 apps/www/.vitepress/theme/components/Announcement.vue create mode 100644 apps/www/.vitepress/theme/components/BlockCopyButton.vue create mode 100644 apps/www/.vitepress/theme/components/BlockPage.vue create mode 100644 apps/www/.vitepress/theme/components/BlockPreview.vue create mode 100644 apps/www/.vitepress/theme/components/Blocks.vue create mode 100644 apps/www/src/content/blocks.md create mode 100644 apps/www/src/content/blocks/renderer.md create mode 100644 apps/www/src/lib/registry/default/block/Authentication01.vue 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/default/block/Dashboard01.vue create mode 100644 apps/www/src/lib/registry/default/block/Dashboard02.vue create mode 100644 apps/www/src/lib/registry/default/block/Dashboard03.vue create mode 100644 apps/www/src/lib/registry/default/block/Dashboard04.vue create mode 100644 apps/www/src/lib/registry/new-york/block/Authentication01.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/lib/registry/new-york/block/Dashboard01.vue create mode 100644 apps/www/src/lib/registry/new-york/block/Dashboard02.vue create mode 100644 apps/www/src/lib/registry/new-york/block/Dashboard03.vue create mode 100644 apps/www/src/lib/registry/new-york/block/Dashboard04.vue create mode 100644 apps/www/src/public/placeholder.svg diff --git a/apps/www/.vitepress/theme/components/Announcement.vue b/apps/www/.vitepress/theme/components/Announcement.vue new file mode 100644 index 00000000..83e1412e --- /dev/null +++ b/apps/www/.vitepress/theme/components/Announcement.vue @@ -0,0 +1,18 @@ + + + diff --git a/apps/www/.vitepress/theme/components/BlockCopyButton.vue b/apps/www/.vitepress/theme/components/BlockCopyButton.vue new file mode 100644 index 00000000..d56e82ca --- /dev/null +++ b/apps/www/.vitepress/theme/components/BlockCopyButton.vue @@ -0,0 +1,38 @@ + + + diff --git a/apps/www/.vitepress/theme/components/BlockPage.vue b/apps/www/.vitepress/theme/components/BlockPage.vue new file mode 100644 index 00000000..83c757f0 --- /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 new file mode 100644 index 00000000..404847ea --- /dev/null +++ b/apps/www/.vitepress/theme/components/BlockPreview.vue @@ -0,0 +1,245 @@ + + +