From 62fbdead876349ebbc031a07d4601961106772f3 Mon Sep 17 00:00:00 2001 From: Rami Bitar Date: Tue, 5 May 2026 13:42:40 -0400 Subject: [PATCH] refactor shopify storefront --- api/chat.ts | 6 +- .../theme => components}/ThemeProvider.tsx | 0 {editor/theme => components}/Typography.tsx | 2 +- .../commerce/cart-drawer.tsx | 8 +- .../commerce/collection-card.tsx | 2 +- .../commerce/collection-detail.tsx | 2 +- .../commerce/collection-grid.editor.tsx | 2 +- .../commerce/collection-grid.tsx | 6 +- .../commerce/collection.editor.tsx | 2 +- .../commerce/collection.tsx | 4 +- .../commerce/collections.tsx | 2 +- .../commerce/featured-product.editor.tsx | 2 +- .../commerce/featured-product.tsx | 6 +- .../commerce/product-card.tsx | 0 .../commerce/product-detail.tsx | 0 .../commerce/product-detail/index.tsx | 10 +- .../product-detail/product-detail-gallery.tsx | 2 +- .../product-detail/product-detail-info.tsx | 6 +- .../product-recommendations.tsx | 2 +- .../commerce/product-details.editor.tsx | 2 +- .../commerce/product-details.tsx | 8 +- .../commerce/products-carousel.editor.tsx | 2 +- .../commerce/products-carousel.tsx | 8 +- .../commerce/products-grid.editor.tsx | 2 +- .../commerce/products-grid.tsx | 6 +- .../commerce/products.tsx | 6 +- .../commerce/recommended-products.editor.tsx | 2 +- .../commerce/recommended-products.tsx | 4 +- .../commerce/shop-footer.tsx | 0 .../commerce/shop-header.tsx | 4 +- .../cta/cta.editor.tsx | 4 +- {editor/components => components}/cta/cta.tsx | 4 +- .../faq/faq.editor.tsx | 2 +- {editor/components => components}/faq/faq.tsx | 2 +- .../features/features.editor.tsx | 2 +- .../features/features.tsx | 2 +- .../footer/footer.editor.tsx | 2 +- .../footer/footer.tsx | 2 +- .../hero/hero.editor.tsx | 4 +- .../components => components}/hero/hero.tsx | 4 +- .../landing/banner.editor.tsx | 2 +- .../landing/banner.tsx | 2 +- .../landing/image-gallery.editor.tsx | 4 +- .../landing/image-gallery.tsx | 4 +- .../landing/newsletter-cta.editor.tsx | 4 +- .../landing/newsletter-cta.tsx | 4 +- .../logos/logos.editor.tsx | 4 +- .../components => components}/logos/logos.tsx | 0 .../navigation/navigation.editor.tsx | 2 +- .../navigation/navigation.tsx | 6 +- .../testimonials/testimonials.editor.tsx | 4 +- .../testimonials/testimonials.tsx | 2 +- components/ui/accordion.tsx | 20 +- components/ui/alert-dialog.tsx | 144 ---- components/ui/alert.tsx | 32 +- components/ui/aspect-ratio.tsx | 11 - components/ui/avatar.tsx | 78 +- components/ui/badge.tsx | 36 +- components/ui/breadcrumb.tsx | 103 ++- components/ui/button-group.tsx | 100 +-- components/ui/button.tsx | 44 +- components/ui/calendar.tsx | 220 ------ components/ui/card.tsx | 26 +- components/ui/carousel.tsx | 314 ++++---- components/ui/chart.tsx | 357 --------- components/ui/checkbox.tsx | 32 - components/ui/collapsible.tsx | 33 - components/ui/combobox.tsx | 310 -------- components/ui/command.tsx | 184 ----- components/ui/context-menu.tsx | 252 ------ components/ui/dialog.tsx | 346 ++++++--- components/ui/direction.tsx | 22 - components/ui/drawer.tsx | 135 ---- components/ui/dropdown-menu.tsx | 257 ------- components/ui/empty.tsx | 1 + components/ui/field.tsx | 248 ------ components/ui/form.tsx | 167 ---- components/ui/hover-card.tsx | 44 -- components/ui/input-group.tsx | 170 ---- components/ui/input-otp.tsx | 57 +- components/ui/input.tsx | 2 +- components/ui/item.tsx | 186 +++-- components/ui/kbd.tsx | 28 - components/ui/label.tsx | 24 - components/ui/menubar.tsx | 276 ------- components/ui/native-select.tsx | 53 -- components/ui/navigation-menu.tsx | 53 +- components/ui/popover.tsx | 89 --- components/ui/progress.tsx | 39 +- components/ui/radio-group.tsx | 45 -- components/ui/resizable.tsx | 56 -- components/ui/scroll-area.tsx | 58 -- components/ui/select.tsx | 411 ++++++---- components/ui/separator.tsx | 12 +- components/ui/sheet.tsx | 331 ++++++-- components/ui/sidebar.tsx | 726 ------------------ components/ui/skeleton.tsx | 2 +- components/ui/slider.tsx | 63 -- components/ui/sonner.tsx | 53 +- components/ui/spinner.tsx | 48 +- components/ui/switch.tsx | 103 ++- components/ui/table.tsx | 59 +- components/ui/tabs.tsx | 71 +- components/ui/toggle-group.tsx | 83 -- components/ui/toggle.tsx | 47 -- components/ui/tooltip.tsx | 61 -- {editor/config => config}/icons.tsx | 0 {editor/config => config}/initial-data.ts | 0 {editor/config => config}/options.ts | 0 {editor/config => config}/root.tsx | 4 +- config/types.ts | 61 ++ .../contexts => contexts}/shopify-context.tsx | 4 +- editor/components/ui/accordion.tsx | 66 -- editor/components/ui/alert.tsx | 60 -- editor/components/ui/avatar.tsx | 53 -- editor/components/ui/badge.tsx | 48 -- editor/components/ui/breadcrumb.tsx | 148 ---- editor/components/ui/button-group.tsx | 97 --- editor/components/ui/button.tsx | 58 -- editor/components/ui/card.tsx | 92 --- editor/components/ui/carousel.tsx | 245 ------ editor/components/ui/dialog.tsx | 266 ------- editor/components/ui/empty.tsx | 105 --- editor/components/ui/input-otp.tsx | 86 --- editor/components/ui/input.tsx | 21 - editor/components/ui/item.tsx | 213 ----- editor/components/ui/navigation-menu.tsx | 151 ---- editor/components/ui/pagination.tsx | 127 --- editor/components/ui/progress.tsx | 44 -- editor/components/ui/select.tsx | 287 ------- editor/components/ui/separator.tsx | 28 - editor/components/ui/sheet.tsx | 316 -------- editor/components/ui/skeleton.tsx | 13 - editor/components/ui/sonner.tsx | 23 - editor/components/ui/spinner.tsx | 38 - editor/components/ui/switch.tsx | 74 -- editor/components/ui/table.tsx | 113 --- editor/components/ui/tabs.tsx | 66 -- editor/components/ui/textarea.tsx | 18 - editor/config/types.ts | 61 -- editor/lib/utils.ts | 11 - {editor/graphql => graphql}/cart.js | 0 {editor/graphql => graphql}/collections.js | 0 {editor/graphql => graphql}/products.js | 0 {editor/hooks => hooks}/use-shopify-cart.ts | 6 +- .../use-shopify-collections.ts | 4 +- .../hooks => hooks}/use-shopify-products.ts | 4 +- {editor/lib => lib}/resolve-editor-path.ts | 0 {editor/lib => lib}/use-demo-data.ts | 0 lib/utils.ts | 11 +- .../index.tsx => react-editor.config.tsx | 42 +- .../services => services}/media-adapter.ts | 0 .../services => services}/shopify/client.ts | 0 src/App.tsx | 6 +- tsconfig.json | 15 +- {editor/vendor => vendor}/plugin-ai.css | 0 156 files changed, 1688 insertions(+), 8293 deletions(-) rename {editor/theme => components}/ThemeProvider.tsx (100%) rename {editor/theme => components}/Typography.tsx (98%) rename {editor/components => components}/commerce/cart-drawer.tsx (96%) rename {editor/components => components}/commerce/collection-card.tsx (96%) rename {editor/components => components}/commerce/collection-detail.tsx (97%) rename {editor/components => components}/commerce/collection-grid.editor.tsx (90%) rename {editor/components => components}/commerce/collection-grid.tsx (95%) rename {editor/components => components}/commerce/collection.editor.tsx (88%) rename {editor/components => components}/commerce/collection.tsx (95%) rename {editor/components => components}/commerce/collections.tsx (97%) rename {editor/components => components}/commerce/featured-product.editor.tsx (96%) rename {editor/components => components}/commerce/featured-product.tsx (95%) rename {editor/components => components}/commerce/product-card.tsx (100%) rename {editor/components => components}/commerce/product-detail.tsx (100%) rename {editor/components => components}/commerce/product-detail/index.tsx (94%) rename {editor/components => components}/commerce/product-detail/product-detail-gallery.tsx (97%) rename {editor/components => components}/commerce/product-detail/product-detail-info.tsx (96%) rename {editor/components => components}/commerce/product-detail/product-recommendations.tsx (96%) rename {editor/components => components}/commerce/product-details.editor.tsx (92%) rename {editor/components => components}/commerce/product-details.tsx (97%) rename {editor/components => components}/commerce/products-carousel.editor.tsx (96%) rename {editor/components => components}/commerce/products-carousel.tsx (93%) rename {editor/components => components}/commerce/products-grid.editor.tsx (93%) rename {editor/components => components}/commerce/products-grid.tsx (93%) rename {editor/components => components}/commerce/products.tsx (97%) rename {editor/components => components}/commerce/recommended-products.editor.tsx (93%) rename {editor/components => components}/commerce/recommended-products.tsx (95%) rename {editor/components => components}/commerce/shop-footer.tsx (100%) rename {editor/components => components}/commerce/shop-header.tsx (94%) rename {editor/components => components}/cta/cta.editor.tsx (92%) rename {editor/components => components}/cta/cta.tsx (96%) rename {editor/components => components}/faq/faq.editor.tsx (96%) rename {editor/components => components}/faq/faq.tsx (97%) rename {editor/components => components}/features/features.editor.tsx (95%) rename {editor/components => components}/features/features.tsx (96%) rename {editor/components => components}/footer/footer.editor.tsx (97%) rename {editor/components => components}/footer/footer.tsx (98%) rename {editor/components => components}/hero/hero.editor.tsx (93%) rename {editor/components => components}/hero/hero.tsx (97%) rename {editor/components => components}/landing/banner.editor.tsx (91%) rename {editor/components => components}/landing/banner.tsx (95%) rename {editor/components => components}/landing/image-gallery.editor.tsx (92%) rename {editor/components => components}/landing/image-gallery.tsx (96%) rename {editor/components => components}/landing/newsletter-cta.editor.tsx (89%) rename {editor/components => components}/landing/newsletter-cta.tsx (97%) rename {editor/components => components}/logos/logos.editor.tsx (90%) rename {editor/components => components}/logos/logos.tsx (100%) rename {editor/components => components}/navigation/navigation.editor.tsx (95%) rename {editor/components => components}/navigation/navigation.tsx (98%) rename {editor/components => components}/testimonials/testimonials.editor.tsx (92%) rename {editor/components => components}/testimonials/testimonials.tsx (97%) delete mode 100644 components/ui/alert-dialog.tsx delete mode 100644 components/ui/aspect-ratio.tsx delete mode 100644 components/ui/calendar.tsx delete mode 100644 components/ui/chart.tsx delete mode 100644 components/ui/checkbox.tsx delete mode 100644 components/ui/collapsible.tsx delete mode 100644 components/ui/combobox.tsx delete mode 100644 components/ui/command.tsx delete mode 100644 components/ui/context-menu.tsx delete mode 100644 components/ui/direction.tsx delete mode 100644 components/ui/drawer.tsx delete mode 100644 components/ui/dropdown-menu.tsx delete mode 100644 components/ui/field.tsx delete mode 100644 components/ui/form.tsx delete mode 100644 components/ui/hover-card.tsx delete mode 100644 components/ui/input-group.tsx delete mode 100644 components/ui/kbd.tsx delete mode 100644 components/ui/label.tsx delete mode 100644 components/ui/menubar.tsx delete mode 100644 components/ui/native-select.tsx delete mode 100644 components/ui/popover.tsx delete mode 100644 components/ui/radio-group.tsx delete mode 100644 components/ui/resizable.tsx delete mode 100644 components/ui/scroll-area.tsx delete mode 100644 components/ui/sidebar.tsx delete mode 100644 components/ui/slider.tsx delete mode 100644 components/ui/toggle-group.tsx delete mode 100644 components/ui/toggle.tsx delete mode 100644 components/ui/tooltip.tsx rename {editor/config => config}/icons.tsx (100%) rename {editor/config => config}/initial-data.ts (100%) rename {editor/config => config}/options.ts (100%) rename {editor/config => config}/root.tsx (96%) create mode 100644 config/types.ts rename {editor/contexts => contexts}/shopify-context.tsx (98%) delete mode 100644 editor/components/ui/accordion.tsx delete mode 100644 editor/components/ui/alert.tsx delete mode 100644 editor/components/ui/avatar.tsx delete mode 100644 editor/components/ui/badge.tsx delete mode 100644 editor/components/ui/breadcrumb.tsx delete mode 100644 editor/components/ui/button-group.tsx delete mode 100644 editor/components/ui/button.tsx delete mode 100644 editor/components/ui/card.tsx delete mode 100644 editor/components/ui/carousel.tsx delete mode 100644 editor/components/ui/dialog.tsx delete mode 100644 editor/components/ui/empty.tsx delete mode 100644 editor/components/ui/input-otp.tsx delete mode 100644 editor/components/ui/input.tsx delete mode 100644 editor/components/ui/item.tsx delete mode 100644 editor/components/ui/navigation-menu.tsx delete mode 100644 editor/components/ui/pagination.tsx delete mode 100644 editor/components/ui/progress.tsx delete mode 100644 editor/components/ui/select.tsx delete mode 100644 editor/components/ui/separator.tsx delete mode 100644 editor/components/ui/sheet.tsx delete mode 100644 editor/components/ui/skeleton.tsx delete mode 100644 editor/components/ui/sonner.tsx delete mode 100644 editor/components/ui/spinner.tsx delete mode 100644 editor/components/ui/switch.tsx delete mode 100644 editor/components/ui/table.tsx delete mode 100644 editor/components/ui/tabs.tsx delete mode 100644 editor/components/ui/textarea.tsx delete mode 100644 editor/config/types.ts delete mode 100644 editor/lib/utils.ts rename {editor/graphql => graphql}/cart.js (100%) rename {editor/graphql => graphql}/collections.js (100%) rename {editor/graphql => graphql}/products.js (100%) rename {editor/hooks => hooks}/use-shopify-cart.ts (95%) rename {editor/hooks => hooks}/use-shopify-collections.ts (97%) rename {editor/hooks => hooks}/use-shopify-products.ts (98%) rename {editor/lib => lib}/resolve-editor-path.ts (100%) rename {editor/lib => lib}/use-demo-data.ts (100%) rename editor/config/index.tsx => react-editor.config.tsx (54%) rename {editor/services => services}/media-adapter.ts (100%) rename {editor/services => services}/shopify/client.ts (100%) rename {editor/vendor => vendor}/plugin-ai.css (100%) diff --git a/api/chat.ts b/api/chat.ts index c63bc58..0041efa 100644 --- a/api/chat.ts +++ b/api/chat.ts @@ -11,15 +11,15 @@ import { reactEditorTools, getEditorContext, } from "@reacteditor/plugin-ai/server"; -import { shopifyFetch } from "@/editor/services/shopify/client"; +import { shopifyFetch } from "@/services/shopify/client"; import { GET_PRODUCTS_QUERY, GET_PRODUCT_QUERY, -} from "@/editor/graphql/products"; +} from "@/graphql/products"; import { GET_COLLECTIONS_QUERY, GET_COLLECTION_PRODUCTS_QUERY, -} from "@/editor/graphql/collections"; +} from "@/graphql/collections"; type Body = { messages: UIMessage[]; diff --git a/editor/theme/ThemeProvider.tsx b/components/ThemeProvider.tsx similarity index 100% rename from editor/theme/ThemeProvider.tsx rename to components/ThemeProvider.tsx diff --git a/editor/theme/Typography.tsx b/components/Typography.tsx similarity index 98% rename from editor/theme/Typography.tsx rename to components/Typography.tsx index 7751fb3..5290fc8 100644 --- a/editor/theme/Typography.tsx +++ b/components/Typography.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { cn } from "@/editor/lib/utils"; +import { cn } from "@/lib/utils"; export type TypographyVariant = | "h1" diff --git a/editor/components/commerce/cart-drawer.tsx b/components/commerce/cart-drawer.tsx similarity index 96% rename from editor/components/commerce/cart-drawer.tsx rename to components/commerce/cart-drawer.tsx index 85f327f..a2cb2e5 100644 --- a/editor/components/commerce/cart-drawer.tsx +++ b/components/commerce/cart-drawer.tsx @@ -1,9 +1,9 @@ 'use client'; import React from 'react'; -import { useShopifyCart, redirectToCheckout } from '@/editor/hooks/use-shopify-cart'; -import { Button } from '@/editor/components/ui/button'; -import { Spinner } from '@/editor/components/ui/spinner'; +import { useShopifyCart, redirectToCheckout } from '@/hooks/use-shopify-cart'; +import { Button } from '@/components/ui/button'; +import { Spinner } from '@/components/ui/spinner'; import { Sheet, SheetContent, @@ -11,7 +11,7 @@ import { SheetTitle, SheetBody, SheetFooter, -} from '@/editor/components/ui/sheet'; +} from '@/components/ui/sheet'; const CartDrawer: React.FC = () => { const { isOpen, closeCart, items, itemCount, totalAmount, checkoutUrl, loading, removeItem, updateItemQuantity } = useShopifyCart(); diff --git a/editor/components/commerce/collection-card.tsx b/components/commerce/collection-card.tsx similarity index 96% rename from editor/components/commerce/collection-card.tsx rename to components/commerce/collection-card.tsx index 33b57df..3aa3ce5 100644 --- a/editor/components/commerce/collection-card.tsx +++ b/components/commerce/collection-card.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Link } from 'react-router'; -import { Card, CardContent } from '@/editor/components/ui/card'; +import { Card, CardContent } from '@/components/ui/card'; interface CollectionImage { url: string; diff --git a/editor/components/commerce/collection-detail.tsx b/components/commerce/collection-detail.tsx similarity index 97% rename from editor/components/commerce/collection-detail.tsx rename to components/commerce/collection-detail.tsx index 9137efe..b3325ef 100644 --- a/editor/components/commerce/collection-detail.tsx +++ b/components/commerce/collection-detail.tsx @@ -1,7 +1,7 @@ 'use client'; import React from 'react'; -import { useCollectionProducts } from '@/editor/hooks/use-shopify-collections'; +import { useCollectionProducts } from '@/hooks/use-shopify-collections'; import ProductCard from './product-card'; import { Skeleton } from '@/components/ui/skeleton'; diff --git a/editor/components/commerce/collection-grid.editor.tsx b/components/commerce/collection-grid.editor.tsx similarity index 90% rename from editor/components/commerce/collection-grid.editor.tsx rename to components/commerce/collection-grid.editor.tsx index ae444e0..044ab34 100644 --- a/editor/components/commerce/collection-grid.editor.tsx +++ b/components/commerce/collection-grid.editor.tsx @@ -1,6 +1,6 @@ import { ComponentConfig } from "@reacteditor/core"; import { FolderOpen } from "lucide-react"; -import { CollectionGrid, type CollectionGridProps } from "@/editor/components/commerce/collection-grid"; +import { CollectionGrid, type CollectionGridProps } from "@/components/commerce/collection-grid"; export const collectionGridEditor: ComponentConfig = { label: "Collections", diff --git a/editor/components/commerce/collection-grid.tsx b/components/commerce/collection-grid.tsx similarity index 95% rename from editor/components/commerce/collection-grid.tsx rename to components/commerce/collection-grid.tsx index b830bb5..08fdf52 100644 --- a/editor/components/commerce/collection-grid.tsx +++ b/components/commerce/collection-grid.tsx @@ -1,8 +1,8 @@ import { useEffect, useState } from "react"; import { Link } from "react-router"; -import { shopifyFetch } from "@/editor/services/shopify/client"; -import { GET_COLLECTIONS_QUERY } from "@/editor/graphql/collections"; -import { Typography } from "@/editor/theme/Typography"; +import { shopifyFetch } from "@/services/shopify/client"; +import { GET_COLLECTIONS_QUERY } from "@/graphql/collections"; +import { Typography } from "@/components/Typography"; export type CollectionGridProps = { tagline: string; diff --git a/editor/components/commerce/collection.editor.tsx b/components/commerce/collection.editor.tsx similarity index 88% rename from editor/components/commerce/collection.editor.tsx rename to components/commerce/collection.editor.tsx index d833cb8..2d6d265 100644 --- a/editor/components/commerce/collection.editor.tsx +++ b/components/commerce/collection.editor.tsx @@ -1,6 +1,6 @@ import { ComponentConfig } from "@reacteditor/core"; import { FolderOpen } from "lucide-react"; -import { CollectionView, type CollectionProps } from "@/editor/components/commerce/collection"; +import { CollectionView, type CollectionProps } from "@/components/commerce/collection"; export function createCollectionEditor(opts: { collectionField: any; diff --git a/editor/components/commerce/collection.tsx b/components/commerce/collection.tsx similarity index 95% rename from editor/components/commerce/collection.tsx rename to components/commerce/collection.tsx index b06ee4c..c430b5c 100644 --- a/editor/components/commerce/collection.tsx +++ b/components/commerce/collection.tsx @@ -1,7 +1,7 @@ import type { ShopifyCollection } from "@reacteditor/field-shopify"; -import { useCollectionProducts } from "@/editor/hooks/use-shopify-collections"; +import { useCollectionProducts } from "@/hooks/use-shopify-collections"; import { ProductCard } from "./product-card"; -import { Typography } from "@/editor/theme/Typography"; +import { Typography } from "@/components/Typography"; import { Skeleton } from "@/components/ui/skeleton"; export type CollectionProps = { diff --git a/editor/components/commerce/collections.tsx b/components/commerce/collections.tsx similarity index 97% rename from editor/components/commerce/collections.tsx rename to components/commerce/collections.tsx index 08df453..3b04894 100644 --- a/editor/components/commerce/collections.tsx +++ b/components/commerce/collections.tsx @@ -1,7 +1,7 @@ 'use client'; import React from 'react'; -import { useCollections } from '@/editor/hooks/use-shopify-collections'; +import { useCollections } from '@/hooks/use-shopify-collections'; import CollectionCard from './collection-card'; const Collections: React.FC = () => { diff --git a/editor/components/commerce/featured-product.editor.tsx b/components/commerce/featured-product.editor.tsx similarity index 96% rename from editor/components/commerce/featured-product.editor.tsx rename to components/commerce/featured-product.editor.tsx index 973ea3d..be8a49c 100644 --- a/editor/components/commerce/featured-product.editor.tsx +++ b/components/commerce/featured-product.editor.tsx @@ -1,6 +1,6 @@ import { ComponentConfig } from "@reacteditor/core"; import { Star } from "lucide-react"; -import { FeaturedProductView, type FeaturedProductProps } from "@/editor/components/commerce/featured-product"; +import { FeaturedProductView, type FeaturedProductProps } from "@/components/commerce/featured-product"; export function createFeaturedProductEditor(opts: { productField: any; diff --git a/editor/components/commerce/featured-product.tsx b/components/commerce/featured-product.tsx similarity index 95% rename from editor/components/commerce/featured-product.tsx rename to components/commerce/featured-product.tsx index 1aee5f5..e217f40 100644 --- a/editor/components/commerce/featured-product.tsx +++ b/components/commerce/featured-product.tsx @@ -1,8 +1,8 @@ import { Link } from "react-router"; import type { ShopifyProduct } from "@reacteditor/field-shopify"; -import { useProduct } from "@/editor/hooks/use-shopify-products"; -import { useShopifyCart } from "@/editor/hooks/use-shopify-cart"; -import { Typography } from "@/editor/theme/Typography"; +import { useProduct } from "@/hooks/use-shopify-products"; +import { useShopifyCart } from "@/hooks/use-shopify-cart"; +import { Typography } from "@/components/Typography"; import { Skeleton } from "@/components/ui/skeleton"; import { cn } from "@/lib/utils"; diff --git a/editor/components/commerce/product-card.tsx b/components/commerce/product-card.tsx similarity index 100% rename from editor/components/commerce/product-card.tsx rename to components/commerce/product-card.tsx diff --git a/editor/components/commerce/product-detail.tsx b/components/commerce/product-detail.tsx similarity index 100% rename from editor/components/commerce/product-detail.tsx rename to components/commerce/product-detail.tsx diff --git a/editor/components/commerce/product-detail/index.tsx b/components/commerce/product-detail/index.tsx similarity index 94% rename from editor/components/commerce/product-detail/index.tsx rename to components/commerce/product-detail/index.tsx index 688724a..93078df 100644 --- a/editor/components/commerce/product-detail/index.tsx +++ b/components/commerce/product-detail/index.tsx @@ -2,13 +2,13 @@ import React, { useState, useEffect } from 'react'; import { Link } from 'react-router'; -import { useProduct, type Product } from '@/editor/hooks/use-shopify-products'; -import { useShopifyCart } from '@/editor/hooks/use-shopify-cart'; +import { useProduct, type Product } from '@/hooks/use-shopify-products'; +import { useShopifyCart } from '@/hooks/use-shopify-cart'; import ProductDetailGallery from './product-detail-gallery'; import ProductDetailInfo from './product-detail-info'; import ProductRecommendations from './product-recommendations'; -import { Button } from '@/editor/components/ui/button'; -import { Alert, AlertTitle, AlertDescription } from '@/editor/components/ui/alert'; +import { Button } from '@/components/ui/button'; +import { Alert, AlertTitle, AlertDescription } from '@/components/ui/alert'; import { Skeleton } from '@/components/ui/skeleton'; import { Breadcrumb, @@ -17,7 +17,7 @@ import { BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, -} from '@/editor/components/ui/breadcrumb'; +} from '@/components/ui/breadcrumb'; interface ProductVariant { id: string; diff --git a/editor/components/commerce/product-detail/product-detail-gallery.tsx b/components/commerce/product-detail/product-detail-gallery.tsx similarity index 97% rename from editor/components/commerce/product-detail/product-detail-gallery.tsx rename to components/commerce/product-detail/product-detail-gallery.tsx index 98aa495..cd444c4 100644 --- a/editor/components/commerce/product-detail/product-detail-gallery.tsx +++ b/components/commerce/product-detail/product-detail-gallery.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Button } from '@/editor/components/ui/button'; +import { Button } from '@/components/ui/button'; interface ProductImage { url: string; diff --git a/editor/components/commerce/product-detail/product-detail-info.tsx b/components/commerce/product-detail/product-detail-info.tsx similarity index 96% rename from editor/components/commerce/product-detail/product-detail-info.tsx rename to components/commerce/product-detail/product-detail-info.tsx index 84edafd..1d6ab87 100644 --- a/editor/components/commerce/product-detail/product-detail-info.tsx +++ b/components/commerce/product-detail/product-detail-info.tsx @@ -1,8 +1,8 @@ import React from 'react'; import { Product, ProductVariant } from './index.tsx'; -import { Button } from '@/editor/components/ui/button'; -import { Badge } from '@/editor/components/ui/badge'; -import { Spinner } from '@/editor/components/ui/spinner'; +import { Button } from '@/components/ui/button'; +import { Badge } from '@/components/ui/badge'; +import { Spinner } from '@/components/ui/spinner'; interface ProductDetailInfoProps { product: Product; diff --git a/editor/components/commerce/product-detail/product-recommendations.tsx b/components/commerce/product-detail/product-recommendations.tsx similarity index 96% rename from editor/components/commerce/product-detail/product-recommendations.tsx rename to components/commerce/product-detail/product-recommendations.tsx index 4f1661d..08833f3 100644 --- a/editor/components/commerce/product-detail/product-recommendations.tsx +++ b/components/commerce/product-detail/product-recommendations.tsx @@ -1,7 +1,7 @@ 'use client'; import React from 'react'; -import { useProductRecommendations } from '@/editor/hooks/use-shopify-products'; +import { useProductRecommendations } from '@/hooks/use-shopify-products'; import ProductCard from '../product-card'; interface ProductRecommendationsProps { diff --git a/editor/components/commerce/product-details.editor.tsx b/components/commerce/product-details.editor.tsx similarity index 92% rename from editor/components/commerce/product-details.editor.tsx rename to components/commerce/product-details.editor.tsx index c408908..dfa65e0 100644 --- a/editor/components/commerce/product-details.editor.tsx +++ b/components/commerce/product-details.editor.tsx @@ -1,6 +1,6 @@ import { ComponentConfig } from "@reacteditor/core"; import { Package } from "lucide-react"; -import { ProductDetailsView, type ProductDetailsProps } from "@/editor/components/commerce/product-details"; +import { ProductDetailsView, type ProductDetailsProps } from "@/components/commerce/product-details"; export function createProductDetailsEditor(opts: { productField: any; diff --git a/editor/components/commerce/product-details.tsx b/components/commerce/product-details.tsx similarity index 97% rename from editor/components/commerce/product-details.tsx rename to components/commerce/product-details.tsx index 3b901c3..315c83c 100644 --- a/editor/components/commerce/product-details.tsx +++ b/components/commerce/product-details.tsx @@ -1,10 +1,10 @@ import { useEffect, useState } from "react"; import { useParams } from "react-router"; import type { ShopifyProduct } from "@reacteditor/field-shopify"; -import { useProduct } from "@/editor/hooks/use-shopify-products"; -import { useShopifyCart } from "@/editor/hooks/use-shopify-cart"; -import { Typography } from "@/editor/theme/Typography"; -import { cn } from "@/editor/lib/utils"; +import { useProduct } from "@/hooks/use-shopify-products"; +import { useShopifyCart } from "@/hooks/use-shopify-cart"; +import { Typography } from "@/components/Typography"; +import { cn } from "@/lib/utils"; import { Skeleton } from "@/components/ui/skeleton"; export type ProductDetailsProps = { diff --git a/editor/components/commerce/products-carousel.editor.tsx b/components/commerce/products-carousel.editor.tsx similarity index 96% rename from editor/components/commerce/products-carousel.editor.tsx rename to components/commerce/products-carousel.editor.tsx index cd2280d..fafce97 100644 --- a/editor/components/commerce/products-carousel.editor.tsx +++ b/components/commerce/products-carousel.editor.tsx @@ -1,6 +1,6 @@ import { ComponentConfig } from "@reacteditor/core"; import { GalleryHorizontalEnd } from "lucide-react"; -import { ProductsCarousel, type ProductsCarouselProps } from "@/editor/components/commerce/products-carousel"; +import { ProductsCarousel, type ProductsCarouselProps } from "@/components/commerce/products-carousel"; export function createProductsCarouselEditor(opts: { collectionField: any; diff --git a/editor/components/commerce/products-carousel.tsx b/components/commerce/products-carousel.tsx similarity index 93% rename from editor/components/commerce/products-carousel.tsx rename to components/commerce/products-carousel.tsx index e14fcf2..ae4af05 100644 --- a/editor/components/commerce/products-carousel.tsx +++ b/components/commerce/products-carousel.tsx @@ -1,17 +1,17 @@ import { useEffect, useState } from "react"; import { Link } from "react-router"; import type { ShopifyCollection } from "@reacteditor/field-shopify"; -import { getProducts } from "@/editor/hooks/use-shopify-products"; -import { getCollectionProducts } from "@/editor/hooks/use-shopify-collections"; +import { getProducts } from "@/hooks/use-shopify-products"; +import { getCollectionProducts } from "@/hooks/use-shopify-collections"; import { ProductCard } from "./product-card"; -import { Typography } from "@/editor/theme/Typography"; +import { Typography } from "@/components/Typography"; import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, -} from "@/editor/components/ui/carousel"; +} from "@/components/ui/carousel"; export type ProductsCarouselProps = { collection: ShopifyCollection | null; diff --git a/editor/components/commerce/products-grid.editor.tsx b/components/commerce/products-grid.editor.tsx similarity index 93% rename from editor/components/commerce/products-grid.editor.tsx rename to components/commerce/products-grid.editor.tsx index 8db4358..9d09c0e 100644 --- a/editor/components/commerce/products-grid.editor.tsx +++ b/components/commerce/products-grid.editor.tsx @@ -1,6 +1,6 @@ import { ComponentConfig } from "@reacteditor/core"; import { LayoutGrid } from "lucide-react"; -import { ProductsGrid, type ProductsGridProps } from "@/editor/components/commerce/products-grid"; +import { ProductsGrid, type ProductsGridProps } from "@/components/commerce/products-grid"; export function createProductsGridEditor(opts: { collectionField: any; diff --git a/editor/components/commerce/products-grid.tsx b/components/commerce/products-grid.tsx similarity index 93% rename from editor/components/commerce/products-grid.tsx rename to components/commerce/products-grid.tsx index bff3570..9a1543c 100644 --- a/editor/components/commerce/products-grid.tsx +++ b/components/commerce/products-grid.tsx @@ -1,10 +1,10 @@ import { useEffect, useState } from "react"; import { Link } from "react-router"; import type { ShopifyCollection } from "@reacteditor/field-shopify"; -import { getProducts } from "@/editor/hooks/use-shopify-products"; -import { getCollectionProducts } from "@/editor/hooks/use-shopify-collections"; +import { getProducts } from "@/hooks/use-shopify-products"; +import { getCollectionProducts } from "@/hooks/use-shopify-collections"; import { ProductCard } from "./product-card"; -import { Typography } from "@/editor/theme/Typography"; +import { Typography } from "@/components/Typography"; export type ProductsGridProps = { collection: ShopifyCollection | null; diff --git a/editor/components/commerce/products.tsx b/components/commerce/products.tsx similarity index 97% rename from editor/components/commerce/products.tsx rename to components/commerce/products.tsx index 99c0353..8bb2dac 100644 --- a/editor/components/commerce/products.tsx +++ b/components/commerce/products.tsx @@ -2,9 +2,9 @@ import React, { useState, useEffect } from 'react'; import ProductCard from './product-card'; -import { getProducts } from '@/editor/hooks/use-shopify-products'; -import { Button } from '@/editor/components/ui/button'; -import { Spinner } from '@/editor/components/ui/spinner'; +import { getProducts } from '@/hooks/use-shopify-products'; +import { Button } from '@/components/ui/button'; +import { Spinner } from '@/components/ui/spinner'; interface ProductImage { url: string; diff --git a/editor/components/commerce/recommended-products.editor.tsx b/components/commerce/recommended-products.editor.tsx similarity index 93% rename from editor/components/commerce/recommended-products.editor.tsx rename to components/commerce/recommended-products.editor.tsx index 25bfc7e..0e9a90b 100644 --- a/editor/components/commerce/recommended-products.editor.tsx +++ b/components/commerce/recommended-products.editor.tsx @@ -1,6 +1,6 @@ import { ComponentConfig } from "@reacteditor/core"; import { Sparkles } from "lucide-react"; -import { RecommendedProductsView, type RecommendedProductsProps } from "@/editor/components/commerce/recommended-products"; +import { RecommendedProductsView, type RecommendedProductsProps } from "@/components/commerce/recommended-products"; export function createRecommendedProductsEditor(opts: { productField: any; diff --git a/editor/components/commerce/recommended-products.tsx b/components/commerce/recommended-products.tsx similarity index 95% rename from editor/components/commerce/recommended-products.tsx rename to components/commerce/recommended-products.tsx index 71d4396..bd51d0c 100644 --- a/editor/components/commerce/recommended-products.tsx +++ b/components/commerce/recommended-products.tsx @@ -2,9 +2,9 @@ import type { ShopifyProduct } from "@reacteditor/field-shopify"; import { useProduct, useProductRecommendations, -} from "@/editor/hooks/use-shopify-products"; +} from "@/hooks/use-shopify-products"; import { ProductCard } from "./product-card"; -import { Typography } from "@/editor/theme/Typography"; +import { Typography } from "@/components/Typography"; import { Skeleton } from "@/components/ui/skeleton"; export type RecommendedProductsProps = { diff --git a/editor/components/commerce/shop-footer.tsx b/components/commerce/shop-footer.tsx similarity index 100% rename from editor/components/commerce/shop-footer.tsx rename to components/commerce/shop-footer.tsx diff --git a/editor/components/commerce/shop-header.tsx b/components/commerce/shop-header.tsx similarity index 94% rename from editor/components/commerce/shop-header.tsx rename to components/commerce/shop-header.tsx index c8a8fe7..93a61f8 100644 --- a/editor/components/commerce/shop-header.tsx +++ b/components/commerce/shop-header.tsx @@ -2,8 +2,8 @@ import React from 'react'; import { Link } from 'react-router'; -import { useShopifyCart } from '@/editor/hooks/use-shopify-cart'; -import config from '@/editor/lib/config.json'; +import { useShopifyCart } from '@/hooks/use-shopify-cart'; +import config from '@/lib/config.json'; const CartIcon: React.FC = () => { const { toggleCart, itemCount } = useShopifyCart(); diff --git a/editor/components/cta/cta.editor.tsx b/components/cta/cta.editor.tsx similarity index 92% rename from editor/components/cta/cta.editor.tsx rename to components/cta/cta.editor.tsx index 0650c87..3b02d79 100644 --- a/editor/components/cta/cta.editor.tsx +++ b/components/cta/cta.editor.tsx @@ -1,8 +1,8 @@ import { ComponentConfig } from "@reacteditor/core"; import { imageField } from "@reacteditor/plugin-media/field"; import { Megaphone } from "lucide-react"; -import { CTA, type CTAProps } from "@/editor/components/cta/cta"; -import { frontendAiMediaAdapter } from "@/editor/services/media-adapter"; +import { CTA, type CTAProps } from "@/components/cta/cta"; +import { frontendAiMediaAdapter } from "@/services/media-adapter"; export const ctaEditor: ComponentConfig = { label: "Call to action", diff --git a/editor/components/cta/cta.tsx b/components/cta/cta.tsx similarity index 96% rename from editor/components/cta/cta.tsx rename to components/cta/cta.tsx index 0281370..9eccac0 100644 --- a/editor/components/cta/cta.tsx +++ b/components/cta/cta.tsx @@ -1,6 +1,6 @@ import { Link } from "react-router"; -import { cn } from "@/editor/lib/utils"; -import { Typography } from "@/editor/theme/Typography"; +import { cn } from "@/lib/utils"; +import { Typography } from "@/components/Typography"; export type CTAProps = { tagline: string; diff --git a/editor/components/faq/faq.editor.tsx b/components/faq/faq.editor.tsx similarity index 96% rename from editor/components/faq/faq.editor.tsx rename to components/faq/faq.editor.tsx index 5a1b937..5b89634 100644 --- a/editor/components/faq/faq.editor.tsx +++ b/components/faq/faq.editor.tsx @@ -1,6 +1,6 @@ import { ComponentConfig } from "@reacteditor/core"; import { HelpCircle } from "lucide-react"; -import { FAQ, type FAQProps } from "@/editor/components/faq/faq"; +import { FAQ, type FAQProps } from "@/components/faq/faq"; export const faqEditor: ComponentConfig = { label: "FAQ", diff --git a/editor/components/faq/faq.tsx b/components/faq/faq.tsx similarity index 97% rename from editor/components/faq/faq.tsx rename to components/faq/faq.tsx index 559f5be..c8d8509 100644 --- a/editor/components/faq/faq.tsx +++ b/components/faq/faq.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; import { Plus, Minus } from "lucide-react"; -import { Typography } from "@/editor/theme/Typography"; +import { Typography } from "@/components/Typography"; export type FAQProps = { tagline: string; diff --git a/editor/components/features/features.editor.tsx b/components/features/features.editor.tsx similarity index 95% rename from editor/components/features/features.editor.tsx rename to components/features/features.editor.tsx index b65242f..9587615 100644 --- a/editor/components/features/features.editor.tsx +++ b/components/features/features.editor.tsx @@ -1,6 +1,6 @@ import { ComponentConfig } from "@reacteditor/core"; import { Sparkles } from "lucide-react"; -import { Features, type FeaturesProps } from "@/editor/components/features/features"; +import { Features, type FeaturesProps } from "@/components/features/features"; export const featuresEditor: ComponentConfig = { label: "Features", diff --git a/editor/components/features/features.tsx b/components/features/features.tsx similarity index 96% rename from editor/components/features/features.tsx rename to components/features/features.tsx index 8df7bc2..cd77adc 100644 --- a/editor/components/features/features.tsx +++ b/components/features/features.tsx @@ -1,4 +1,4 @@ -import { Typography } from "@/editor/theme/Typography"; +import { Typography } from "@/components/Typography"; export type FeaturesProps = { tagline: string; diff --git a/editor/components/footer/footer.editor.tsx b/components/footer/footer.editor.tsx similarity index 97% rename from editor/components/footer/footer.editor.tsx rename to components/footer/footer.editor.tsx index 4bb6f53..1ed192d 100644 --- a/editor/components/footer/footer.editor.tsx +++ b/components/footer/footer.editor.tsx @@ -1,6 +1,6 @@ import { ComponentConfig } from "@reacteditor/core"; import { LayoutGrid } from "lucide-react"; -import { Footer, type FooterProps } from "@/editor/components/footer/footer"; +import { Footer, type FooterProps } from "@/components/footer/footer"; export const footerEditor: ComponentConfig = { label: "Footer", diff --git a/editor/components/footer/footer.tsx b/components/footer/footer.tsx similarity index 98% rename from editor/components/footer/footer.tsx rename to components/footer/footer.tsx index 08c1322..016c84c 100644 --- a/editor/components/footer/footer.tsx +++ b/components/footer/footer.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; import { Link } from "react-router"; -import { Typography } from "@/editor/theme/Typography"; +import { Typography } from "@/components/Typography"; export type FooterProps = { brand: string; diff --git a/editor/components/hero/hero.editor.tsx b/components/hero/hero.editor.tsx similarity index 93% rename from editor/components/hero/hero.editor.tsx rename to components/hero/hero.editor.tsx index d6759ef..79940c3 100644 --- a/editor/components/hero/hero.editor.tsx +++ b/components/hero/hero.editor.tsx @@ -1,8 +1,8 @@ import { ComponentConfig } from "@reacteditor/core"; import { imageField } from "@reacteditor/plugin-media/field"; import { LayoutTemplate } from "lucide-react"; -import { Hero, type HeroProps } from "@/editor/components/hero/hero"; -import { frontendAiMediaAdapter } from "@/editor/services/media-adapter"; +import { Hero, type HeroProps } from "@/components/hero/hero"; +import { frontendAiMediaAdapter } from "@/services/media-adapter"; export const heroEditor: ComponentConfig = { label: "Hero", diff --git a/editor/components/hero/hero.tsx b/components/hero/hero.tsx similarity index 97% rename from editor/components/hero/hero.tsx rename to components/hero/hero.tsx index 31e31ac..9b1e572 100644 --- a/editor/components/hero/hero.tsx +++ b/components/hero/hero.tsx @@ -1,6 +1,6 @@ import { Link } from "react-router"; -import { cn } from "@/editor/lib/utils"; -import { Typography } from "@/editor/theme/Typography"; +import { cn } from "@/lib/utils"; +import { Typography } from "@/components/Typography"; export type HeroProps = { tagline: string; diff --git a/editor/components/landing/banner.editor.tsx b/components/landing/banner.editor.tsx similarity index 91% rename from editor/components/landing/banner.editor.tsx rename to components/landing/banner.editor.tsx index be9bf8a..b70f60d 100644 --- a/editor/components/landing/banner.editor.tsx +++ b/components/landing/banner.editor.tsx @@ -1,6 +1,6 @@ import { ComponentConfig } from "@reacteditor/core"; import { Megaphone } from "lucide-react"; -import { Banner, type BannerProps } from "@/editor/components/landing/banner"; +import { Banner, type BannerProps } from "@/components/landing/banner"; export const bannerEditor: ComponentConfig = { label: "Announcement bar", diff --git a/editor/components/landing/banner.tsx b/components/landing/banner.tsx similarity index 95% rename from editor/components/landing/banner.tsx rename to components/landing/banner.tsx index f964f4f..301d946 100644 --- a/editor/components/landing/banner.tsx +++ b/components/landing/banner.tsx @@ -1,5 +1,5 @@ import { Link } from "react-router"; -import { cn } from "@/editor/lib/utils"; +import { cn } from "@/lib/utils"; export type BannerProps = { text: string; diff --git a/editor/components/landing/image-gallery.editor.tsx b/components/landing/image-gallery.editor.tsx similarity index 92% rename from editor/components/landing/image-gallery.editor.tsx rename to components/landing/image-gallery.editor.tsx index 9d9a5eb..7cf13f4 100644 --- a/editor/components/landing/image-gallery.editor.tsx +++ b/components/landing/image-gallery.editor.tsx @@ -1,8 +1,8 @@ import { ComponentConfig } from "@reacteditor/core"; import { imageField } from "@reacteditor/plugin-media/field"; import { Images } from "lucide-react"; -import { ImageGallery, type ImageGalleryProps } from "@/editor/components/landing/image-gallery"; -import { frontendAiMediaAdapter } from "@/editor/services/media-adapter"; +import { ImageGallery, type ImageGalleryProps } from "@/components/landing/image-gallery"; +import { frontendAiMediaAdapter } from "@/services/media-adapter"; export const imageGalleryEditor: ComponentConfig = { label: "Image gallery", diff --git a/editor/components/landing/image-gallery.tsx b/components/landing/image-gallery.tsx similarity index 96% rename from editor/components/landing/image-gallery.tsx rename to components/landing/image-gallery.tsx index 053c412..ddf02b1 100644 --- a/editor/components/landing/image-gallery.tsx +++ b/components/landing/image-gallery.tsx @@ -1,5 +1,5 @@ -import { cn } from "@/editor/lib/utils"; -import { Typography } from "@/editor/theme/Typography"; +import { cn } from "@/lib/utils"; +import { Typography } from "@/components/Typography"; export type ImageGalleryProps = { tagline: string; diff --git a/editor/components/landing/newsletter-cta.editor.tsx b/components/landing/newsletter-cta.editor.tsx similarity index 89% rename from editor/components/landing/newsletter-cta.editor.tsx rename to components/landing/newsletter-cta.editor.tsx index 3f98438..9e2d63c 100644 --- a/editor/components/landing/newsletter-cta.editor.tsx +++ b/components/landing/newsletter-cta.editor.tsx @@ -1,8 +1,8 @@ import { ComponentConfig } from "@reacteditor/core"; import { imageField } from "@reacteditor/plugin-media/field"; import { Mail } from "lucide-react"; -import { NewsletterCta, type NewsletterCtaProps } from "@/editor/components/landing/newsletter-cta"; -import { frontendAiMediaAdapter } from "@/editor/services/media-adapter"; +import { NewsletterCta, type NewsletterCtaProps } from "@/components/landing/newsletter-cta"; +import { frontendAiMediaAdapter } from "@/services/media-adapter"; export const newsletterCtaEditor: ComponentConfig = { label: "Newsletter", diff --git a/editor/components/landing/newsletter-cta.tsx b/components/landing/newsletter-cta.tsx similarity index 97% rename from editor/components/landing/newsletter-cta.tsx rename to components/landing/newsletter-cta.tsx index 1bb6508..3957c20 100644 --- a/editor/components/landing/newsletter-cta.tsx +++ b/components/landing/newsletter-cta.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; -import { cn } from "@/editor/lib/utils"; -import { Typography } from "@/editor/theme/Typography"; +import { cn } from "@/lib/utils"; +import { Typography } from "@/components/Typography"; export type NewsletterCtaProps = { tagline: string; diff --git a/editor/components/logos/logos.editor.tsx b/components/logos/logos.editor.tsx similarity index 90% rename from editor/components/logos/logos.editor.tsx rename to components/logos/logos.editor.tsx index 17817f2..44c426c 100644 --- a/editor/components/logos/logos.editor.tsx +++ b/components/logos/logos.editor.tsx @@ -1,8 +1,8 @@ import { ComponentConfig } from "@reacteditor/core"; import { imageField } from "@reacteditor/plugin-media/field"; import { Award } from "lucide-react"; -import { Logos, type LogosProps } from "@/editor/components/logos/logos"; -import { frontendAiMediaAdapter } from "@/editor/services/media-adapter"; +import { Logos, type LogosProps } from "@/components/logos/logos"; +import { frontendAiMediaAdapter } from "@/services/media-adapter"; export const logosEditor: ComponentConfig = { label: "Press / Logos", diff --git a/editor/components/logos/logos.tsx b/components/logos/logos.tsx similarity index 100% rename from editor/components/logos/logos.tsx rename to components/logos/logos.tsx diff --git a/editor/components/navigation/navigation.editor.tsx b/components/navigation/navigation.editor.tsx similarity index 95% rename from editor/components/navigation/navigation.editor.tsx rename to components/navigation/navigation.editor.tsx index 7b1c28a..5648e0a 100644 --- a/editor/components/navigation/navigation.editor.tsx +++ b/components/navigation/navigation.editor.tsx @@ -1,6 +1,6 @@ import { ComponentConfig } from "@reacteditor/core"; import { Menu as MenuIcon } from "lucide-react"; -import { Navigation, type NavigationProps } from "@/editor/components/navigation/navigation"; +import { Navigation, type NavigationProps } from "@/components/navigation/navigation"; export const navigationEditor: ComponentConfig = { label: "Navigation", diff --git a/editor/components/navigation/navigation.tsx b/components/navigation/navigation.tsx similarity index 98% rename from editor/components/navigation/navigation.tsx rename to components/navigation/navigation.tsx index 3594206..bd9fe81 100644 --- a/editor/components/navigation/navigation.tsx +++ b/components/navigation/navigation.tsx @@ -1,9 +1,9 @@ import { Menu as MenuIcon, ShoppingBag, Search } from "lucide-react"; import { useState } from "react"; import { Link } from "react-router"; -import { useShopifyCart } from "@/editor/hooks/use-shopify-cart"; -import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@/editor/components/ui/sheet"; -import { cn } from "@/editor/lib/utils"; +import { useShopifyCart } from "@/hooks/use-shopify-cart"; +import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@/components/ui/sheet"; +import { cn } from "@/lib/utils"; export type NavigationProps = { brand: string; diff --git a/editor/components/testimonials/testimonials.editor.tsx b/components/testimonials/testimonials.editor.tsx similarity index 92% rename from editor/components/testimonials/testimonials.editor.tsx rename to components/testimonials/testimonials.editor.tsx index 46f7948..1ade8fc 100644 --- a/editor/components/testimonials/testimonials.editor.tsx +++ b/components/testimonials/testimonials.editor.tsx @@ -1,8 +1,8 @@ import { ComponentConfig } from "@reacteditor/core"; import { imageField } from "@reacteditor/plugin-media/field"; import { Quote } from "lucide-react"; -import { Testimonials, type TestimonialsProps } from "@/editor/components/testimonials/testimonials"; -import { frontendAiMediaAdapter } from "@/editor/services/media-adapter"; +import { Testimonials, type TestimonialsProps } from "@/components/testimonials/testimonials"; +import { frontendAiMediaAdapter } from "@/services/media-adapter"; export const testimonialsEditor: ComponentConfig = { label: "Testimonials", diff --git a/editor/components/testimonials/testimonials.tsx b/components/testimonials/testimonials.tsx similarity index 97% rename from editor/components/testimonials/testimonials.tsx rename to components/testimonials/testimonials.tsx index f2e428a..bd153b9 100644 --- a/editor/components/testimonials/testimonials.tsx +++ b/components/testimonials/testimonials.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; import { ArrowLeft, ArrowRight } from "lucide-react"; -import { Typography } from "@/editor/theme/Typography"; +import { Typography } from "@/components/Typography"; export type TestimonialsProps = { tagline: string; diff --git a/components/ui/accordion.tsx b/components/ui/accordion.tsx index 4a8cca4..ec141d1 100644 --- a/components/ui/accordion.tsx +++ b/components/ui/accordion.tsx @@ -1,15 +1,15 @@ -"use client" +"use client"; -import * as React from "react" -import * as AccordionPrimitive from "@radix-ui/react-accordion" -import { ChevronDownIcon } from "lucide-react" +import * as React from "react"; +import * as AccordionPrimitive from "@radix-ui/react-accordion"; +import { ChevronDownIcon } from "lucide-react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; function Accordion({ ...props }: React.ComponentProps) { - return + return ; } function AccordionItem({ @@ -22,7 +22,7 @@ function AccordionItem({ className={cn("border-b last:border-b-0", className)} {...props} /> - ) + ); } function AccordionTrigger({ @@ -44,7 +44,7 @@ function AccordionTrigger({ - ) + ); } function AccordionContent({ @@ -60,7 +60,7 @@ function AccordionContent({ >
{children}
- ) + ); } -export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } +export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }; diff --git a/components/ui/alert-dialog.tsx b/components/ui/alert-dialog.tsx deleted file mode 100644 index 4dbb919..0000000 --- a/components/ui/alert-dialog.tsx +++ /dev/null @@ -1,144 +0,0 @@ -'use client'; - -import * as React from 'react'; - -import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog'; - -import { buttonVariants } from '@/components/ui/button'; -import { cn } from '@/lib/utils'; - -const AlertDialog = AlertDialogPrimitive.Root; - -const AlertDialogTrigger = AlertDialogPrimitive.Trigger; - -const AlertDialogPortal = AlertDialogPrimitive.Portal; - -const AlertDialogOverlay = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); -AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName; - -const AlertDialogContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - - -
- -
-
-)); -AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName; - -const AlertDialogHeader = ({ - className, - ...props -}: React.HTMLAttributes) => ( -
-); -AlertDialogHeader.displayName = 'AlertDialogHeader'; - -const AlertDialogFooter = ({ - className, - ...props -}: React.HTMLAttributes) => ( -
-); -AlertDialogFooter.displayName = 'AlertDialogFooter'; - -const AlertDialogTitle = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); -AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName; - -const AlertDialogDescription = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); -AlertDialogDescription.displayName = - AlertDialogPrimitive.Description.displayName; - -const AlertDialogAction = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); -AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName; - -const AlertDialogCancel = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); -AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName; - -export { - AlertDialog, - AlertDialogPortal, - AlertDialogOverlay, - AlertDialogTrigger, - AlertDialogContent, - AlertDialogHeader, - AlertDialogFooter, - AlertDialogTitle, - AlertDialogDescription, - AlertDialogAction, - AlertDialogCancel, -}; diff --git a/components/ui/alert.tsx b/components/ui/alert.tsx index 1421354..3c5a3e4 100644 --- a/components/ui/alert.tsx +++ b/components/ui/alert.tsx @@ -1,34 +1,28 @@ import * as React from "react" -import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" -const alertVariants = cva( - "relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", - { - variants: { - variant: { - default: "bg-card text-card-foreground", - destructive: - "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90", - }, - }, - defaultVariants: { - variant: "default", - }, - } -) +type AlertVariant = "default" | "destructive" + +const baseClasses = + "relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current" + +const variantClasses: Record = { + default: "bg-card text-card-foreground", + destructive: + "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90", +} function Alert({ className, - variant, + variant = "default", ...props -}: React.ComponentProps<"div"> & VariantProps) { +}: React.ComponentProps<"div"> & { variant?: AlertVariant }) { return (
) diff --git a/components/ui/aspect-ratio.tsx b/components/ui/aspect-ratio.tsx deleted file mode 100644 index 3df3fd0..0000000 --- a/components/ui/aspect-ratio.tsx +++ /dev/null @@ -1,11 +0,0 @@ -"use client" - -import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio" - -function AspectRatio({ - ...props -}: React.ComponentProps) { - return -} - -export { AspectRatio } diff --git a/components/ui/avatar.tsx b/components/ui/avatar.tsx index a38fe5d..1b11ef8 100644 --- a/components/ui/avatar.tsx +++ b/components/ui/avatar.tsx @@ -1,28 +1,24 @@ -"use client" +"use client"; -import * as React from "react" -import * as AvatarPrimitive from "@radix-ui/react-avatar" +import * as React from "react"; +import * as AvatarPrimitive from "@radix-ui/react-avatar"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; function Avatar({ className, - size = "default", ...props -}: React.ComponentProps & { - size?: "default" | "sm" | "lg" -}) { +}: React.ComponentProps) { return ( - ) + ); } function AvatarImage({ @@ -35,7 +31,7 @@ function AvatarImage({ className={cn("aspect-square size-full", className)} {...props} /> - ) + ); } function AvatarFallback({ @@ -46,64 +42,12 @@ function AvatarFallback({ - ) + ); } -function AvatarBadge({ className, ...props }: React.ComponentProps<"span">) { - return ( - svg]:hidden", - "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", - "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", - className - )} - {...props} - /> - ) -} - -function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) { - return ( -
- ) -} - -function AvatarGroupCount({ - className, - ...props -}: React.ComponentProps<"div">) { - return ( -
svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", - className - )} - {...props} - /> - ) -} - -export { - Avatar, - AvatarImage, - AvatarFallback, - AvatarBadge, - AvatarGroup, - AvatarGroupCount, -} +export { Avatar, AvatarImage, AvatarFallback }; diff --git a/components/ui/badge.tsx b/components/ui/badge.tsx index ba40cc1..eba4579 100644 --- a/components/ui/badge.tsx +++ b/components/ui/badge.tsx @@ -1,48 +1,48 @@ -import * as React from "react" -import { Slot } from "@radix-ui/react-slot" -import { cva, type VariantProps } from "class-variance-authority" +import * as React from "react"; +import { Slot } from "@radix-ui/react-slot"; +import { cva, type VariantProps } from "class-variance-authority"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const badgeVariants = cva( - "inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", + "inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none transition-[color,box-shadow] overflow-hidden", { variants: { variant: { - default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90", + default: + "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90", secondary: - "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90", + "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90", destructive: - "bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60", + "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90", outline: - "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground", - ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground", - link: "text-primary underline-offset-4 [a&]:hover:underline", + "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground", }, }, defaultVariants: { variant: "default", }, } -) +); function Badge({ className, - variant = "default", + variant, asChild = false, ...props }: React.ComponentProps<"span"> & - VariantProps & { asChild?: boolean }) { - const Comp = asChild ? Slot : "span" + VariantProps & { + asChild?: boolean; + }) { + const Comp = asChild ? Slot : "span"; return ( - ) + ); } -export { Badge, badgeVariants } +export { Badge, badgeVariants }; diff --git a/components/ui/breadcrumb.tsx b/components/ui/breadcrumb.tsx index eb88f32..cbe7189 100644 --- a/components/ui/breadcrumb.tsx +++ b/components/ui/breadcrumb.tsx @@ -1,101 +1,140 @@ -import * as React from "react" -import { Slot } from "@radix-ui/react-slot" -import { ChevronRight, MoreHorizontal } from "lucide-react" +import React from 'react'; +import { cn } from '@/lib/utils'; -import { cn } from "@/lib/utils" - -function Breadcrumb({ ...props }: React.ComponentProps<"nav">) { - return