From 7f86072636f988a3e0f2b8e8436061321c47897a Mon Sep 17 00:00:00 2001 From: Rami Bitar Date: Wed, 3 Jun 2026 23:17:00 -0400 Subject: [PATCH] use default exports and not named exports --- .../commerce/collection-grid.editor.tsx | 4 +- components/commerce/collection.editor.tsx | 12 ++-- .../commerce/featured-product.editor.tsx | 12 ++-- .../commerce/product-details.editor.tsx | 12 ++-- .../commerce/products-carousel.editor.tsx | 12 ++-- components/commerce/products-grid.editor.tsx | 12 ++-- .../commerce/recommended-products.editor.tsx | 12 ++-- .../commerce/search-products.editor.tsx | 4 +- components/cta/cta.editor.tsx | 4 +- components/faq/faq.editor.tsx | 4 +- components/features/features.editor.tsx | 4 +- components/footer/footer.editor.tsx | 4 +- components/hero/hero.editor.tsx | 4 +- components/landing/banner.editor.tsx | 4 +- components/landing/image-gallery.editor.tsx | 4 +- components/landing/newsletter-cta.editor.tsx | 4 +- components/logos/logos.editor.tsx | 4 +- components/navigation/navigation.editor.tsx | 4 +- .../testimonials/testimonials.editor.tsx | 4 +- editor.config.tsx | 72 +++++++------------ tsconfig.tsbuildinfo | 2 +- 21 files changed, 96 insertions(+), 102 deletions(-) diff --git a/components/commerce/collection-grid.editor.tsx b/components/commerce/collection-grid.editor.tsx index 044ab34..a68b976 100644 --- a/components/commerce/collection-grid.editor.tsx +++ b/components/commerce/collection-grid.editor.tsx @@ -2,7 +2,7 @@ import { ComponentConfig } from "@reacteditor/core"; import { FolderOpen } from "lucide-react"; import { CollectionGrid, type CollectionGridProps } from "@/components/commerce/collection-grid"; -export const collectionGridEditor: ComponentConfig = { +const collectionGridEditor: ComponentConfig = { label: "Collections", icon: , category: "commerce", @@ -29,3 +29,5 @@ export const collectionGridEditor: ComponentConfig = { }, render: (props) => , }; + +export default collectionGridEditor; diff --git a/components/commerce/collection.editor.tsx b/components/commerce/collection.editor.tsx index 5418181..3b4ca9b 100644 --- a/components/commerce/collection.editor.tsx +++ b/components/commerce/collection.editor.tsx @@ -4,10 +4,7 @@ import { imageField } from "@reacteditor/plugin-media/field"; import { frontendAiMediaAdapter } from "@/services/media-adapter"; import { CollectionView, type CollectionProps } from "@/components/commerce/collection"; -export function createCollectionEditor(opts: { - collectionField: any; -}): ComponentConfig { - return { +const collectionEditor: ComponentConfig = { label: "Collection page", icon: , category: "commerce", @@ -48,7 +45,7 @@ export function createCollectionEditor(opts: { metafieldFilters: [], }, fields: { - collection: { label: "Collection", ...opts.collectionField }, + collection: { label: "Collection", type: "shopifyCollection" } as any, showDescription: { label: "Description", type: "radio", @@ -247,5 +244,6 @@ export function createCollectionEditor(opts: { }, }, render: (props) => , - }; -} +}; + +export default collectionEditor; diff --git a/components/commerce/featured-product.editor.tsx b/components/commerce/featured-product.editor.tsx index be8a49c..dc1dc01 100644 --- a/components/commerce/featured-product.editor.tsx +++ b/components/commerce/featured-product.editor.tsx @@ -2,10 +2,7 @@ import { ComponentConfig } from "@reacteditor/core"; import { Star } from "lucide-react"; import { FeaturedProductView, type FeaturedProductProps } from "@/components/commerce/featured-product"; -export function createFeaturedProductEditor(opts: { - productField: any; -}): ComponentConfig { - return { +const featuredProductEditor: ComponentConfig = { label: "Featured product", icon: , category: "commerce", @@ -17,7 +14,7 @@ export function createFeaturedProductEditor(opts: { tone: "default", }, fields: { - product: { label: "Product", ...opts.productField }, + product: { label: "Product", type: "shopifyProduct" } as any, tagline: { label: "Tagline", type: "text", contentEditable: true }, ctaLabel: { label: "CTA label", type: "text", contentEditable: true }, align: { @@ -38,5 +35,6 @@ export function createFeaturedProductEditor(opts: { }, }, render: (props) => , - }; -} +}; + +export default featuredProductEditor; diff --git a/components/commerce/product-details.editor.tsx b/components/commerce/product-details.editor.tsx index dfa65e0..a536438 100644 --- a/components/commerce/product-details.editor.tsx +++ b/components/commerce/product-details.editor.tsx @@ -2,15 +2,13 @@ import { ComponentConfig } from "@reacteditor/core"; import { Package } from "lucide-react"; import { ProductDetailsView, type ProductDetailsProps } from "@/components/commerce/product-details"; -export function createProductDetailsEditor(opts: { - productField: any; -}): ComponentConfig { - return { +const productDetailsEditor: ComponentConfig = { label: "Product details", icon: , category: "commerce", defaultProps: { product: null }, - fields: { product: { label: "Product", ...opts.productField } }, + fields: { product: { label: "Product", type: "shopifyProduct" } as any }, render: (props) => , - }; -} +}; + +export default productDetailsEditor; diff --git a/components/commerce/products-carousel.editor.tsx b/components/commerce/products-carousel.editor.tsx index fafce97..92c7754 100644 --- a/components/commerce/products-carousel.editor.tsx +++ b/components/commerce/products-carousel.editor.tsx @@ -2,10 +2,7 @@ import { ComponentConfig } from "@reacteditor/core"; import { GalleryHorizontalEnd } from "lucide-react"; import { ProductsCarousel, type ProductsCarouselProps } from "@/components/commerce/products-carousel"; -export function createProductsCarouselEditor(opts: { - collectionField: any; -}): ComponentConfig { - return { +const productsCarouselEditor: ComponentConfig = { label: "Products carousel", icon: , category: "commerce", @@ -20,7 +17,7 @@ export function createProductsCarouselEditor(opts: { ctaHref: "", }, fields: { - collection: { label: "Collection", ...opts.collectionField }, + collection: { label: "Collection", type: "shopifyCollection" } as any, tagline: { label: "Tagline", type: "text", contentEditable: true }, heading: { label: "Heading", type: "text", contentEditable: true }, subheading: { label: "Subheading", type: "textarea", contentEditable: true }, @@ -38,5 +35,6 @@ export function createProductsCarouselEditor(opts: { ctaHref: { label: "CTA link", type: "text" }, }, render: (props) => , - }; -} +}; + +export default productsCarouselEditor; diff --git a/components/commerce/products-grid.editor.tsx b/components/commerce/products-grid.editor.tsx index 9d09c0e..a2624fe 100644 --- a/components/commerce/products-grid.editor.tsx +++ b/components/commerce/products-grid.editor.tsx @@ -2,10 +2,7 @@ import { ComponentConfig } from "@reacteditor/core"; import { LayoutGrid } from "lucide-react"; import { ProductsGrid, type ProductsGridProps } from "@/components/commerce/products-grid"; -export function createProductsGridEditor(opts: { - collectionField: any; -}): ComponentConfig { - return { +const productsGridEditor: ComponentConfig = { label: "Products grid", icon: , category: "commerce", @@ -20,7 +17,7 @@ export function createProductsGridEditor(opts: { ctaHref: "", }, fields: { - collection: { label: "Collection", ...opts.collectionField }, + collection: { label: "Collection", type: "shopifyCollection" } as any, tagline: { label: "Tagline", type: "text", contentEditable: true }, heading: { label: "Heading", type: "text", contentEditable: true }, subheading: { label: "Subheading", type: "textarea", contentEditable: true }, @@ -37,5 +34,6 @@ export function createProductsGridEditor(opts: { ctaHref: { label: "CTA link", type: "text" }, }, render: (props) => , - }; -} +}; + +export default productsGridEditor; diff --git a/components/commerce/recommended-products.editor.tsx b/components/commerce/recommended-products.editor.tsx index 0e9a90b..22304aa 100644 --- a/components/commerce/recommended-products.editor.tsx +++ b/components/commerce/recommended-products.editor.tsx @@ -2,10 +2,7 @@ import { ComponentConfig } from "@reacteditor/core"; import { Sparkles } from "lucide-react"; import { RecommendedProductsView, type RecommendedProductsProps } from "@/components/commerce/recommended-products"; -export function createRecommendedProductsEditor(opts: { - productField: any; -}): ComponentConfig { - return { +const recommendedProductsEditor: ComponentConfig = { label: "Recommended products", icon: , category: "commerce", @@ -16,11 +13,12 @@ export function createRecommendedProductsEditor(opts: { limit: 4, }, fields: { - product: { label: "Source product", ...opts.productField }, + product: { label: "Source product", type: "shopifyProduct" } as any, tagline: { label: "Tagline", type: "text", contentEditable: true }, heading: { label: "Heading", type: "text", contentEditable: true }, limit: { label: "Limit", type: "number", min: 2, max: 8 }, }, render: (props) => , - }; -} +}; + +export default recommendedProductsEditor; diff --git a/components/commerce/search-products.editor.tsx b/components/commerce/search-products.editor.tsx index 4383195..8dfd0fa 100644 --- a/components/commerce/search-products.editor.tsx +++ b/components/commerce/search-products.editor.tsx @@ -2,7 +2,7 @@ import { ComponentConfig } from '@reacteditor/core'; import { Search } from 'lucide-react'; import { SearchProductsView, type SearchProductsProps } from '@/components/commerce/search-products'; -export const searchProductsEditor: ComponentConfig = { +const searchProductsEditor: ComponentConfig = { label: 'Search & filter', icon: , category: 'commerce', @@ -240,3 +240,5 @@ export const searchProductsEditor: ComponentConfig = { }, render: (props) => , }; + +export default searchProductsEditor; diff --git a/components/cta/cta.editor.tsx b/components/cta/cta.editor.tsx index 3b02d79..b0a70d3 100644 --- a/components/cta/cta.editor.tsx +++ b/components/cta/cta.editor.tsx @@ -4,7 +4,7 @@ import { Megaphone } from "lucide-react"; import { CTA, type CTAProps } from "@/components/cta/cta"; import { frontendAiMediaAdapter } from "@/services/media-adapter"; -export const ctaEditor: ComponentConfig = { +const ctaEditor: ComponentConfig = { label: "Call to action", icon: , category: "content", @@ -51,3 +51,5 @@ export const ctaEditor: ComponentConfig = { }, render: (props) => , }; + +export default ctaEditor; diff --git a/components/faq/faq.editor.tsx b/components/faq/faq.editor.tsx index 5b89634..3902034 100644 --- a/components/faq/faq.editor.tsx +++ b/components/faq/faq.editor.tsx @@ -2,7 +2,7 @@ import { ComponentConfig } from "@reacteditor/core"; import { HelpCircle } from "lucide-react"; import { FAQ, type FAQProps } from "@/components/faq/faq"; -export const faqEditor: ComponentConfig = { +const faqEditor: ComponentConfig = { label: "FAQ", icon: , category: "content", @@ -50,3 +50,5 @@ export const faqEditor: ComponentConfig = { }, render: (props) => , }; + +export default faqEditor; diff --git a/components/features/features.editor.tsx b/components/features/features.editor.tsx index 9587615..170d921 100644 --- a/components/features/features.editor.tsx +++ b/components/features/features.editor.tsx @@ -2,7 +2,7 @@ import { ComponentConfig } from "@reacteditor/core"; import { Sparkles } from "lucide-react"; import { Features, type FeaturesProps } from "@/components/features/features"; -export const featuresEditor: ComponentConfig = { +const featuresEditor: ComponentConfig = { label: "Features", icon: , category: "content", @@ -52,3 +52,5 @@ export const featuresEditor: ComponentConfig = { }, render: (props) => , }; + +export default featuresEditor; diff --git a/components/footer/footer.editor.tsx b/components/footer/footer.editor.tsx index 1ed192d..0a3416a 100644 --- a/components/footer/footer.editor.tsx +++ b/components/footer/footer.editor.tsx @@ -2,7 +2,7 @@ import { ComponentConfig } from "@reacteditor/core"; import { LayoutGrid } from "lucide-react"; import { Footer, type FooterProps } from "@/components/footer/footer"; -export const footerEditor: ComponentConfig = { +const footerEditor: ComponentConfig = { label: "Footer", icon: , category: "footer", @@ -100,3 +100,5 @@ export const footerEditor: ComponentConfig = { }, render: (props) =>