Update plugin-media
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import { ComponentConfig } from "@reacteditor/core";
|
||||
import { FolderOpen } from "lucide-react";
|
||||
import { imageField } from "@reacteditor/plugin-media/field";
|
||||
import { frontendAiMediaAdapter } from "@/services/media-adapter";
|
||||
import { CollectionView, type CollectionProps } from "@/components/commerce/collection";
|
||||
|
||||
const collectionEditor: ComponentConfig<CollectionProps> = {
|
||||
@@ -64,7 +62,7 @@ const collectionEditor: ComponentConfig<CollectionProps> = {
|
||||
},
|
||||
customCoverImage: {
|
||||
label: "Custom cover image",
|
||||
...imageField({ adapter: frontendAiMediaAdapter }),
|
||||
type: "image",
|
||||
},
|
||||
columns: {
|
||||
label: "Columns",
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { ComponentConfig } from "@reacteditor/core";
|
||||
import { imageField } from "@reacteditor/plugin-media/field";
|
||||
import { Megaphone } from "lucide-react";
|
||||
import { CTA, type CTAProps } from "@/components/cta/cta";
|
||||
import { frontendAiMediaAdapter } from "@/services/media-adapter";
|
||||
|
||||
const ctaEditor: ComponentConfig<CTAProps> = {
|
||||
label: "Call to action",
|
||||
@@ -39,7 +37,7 @@ const ctaEditor: ComponentConfig<CTAProps> = {
|
||||
href: { label: "Link", type: "text" },
|
||||
},
|
||||
},
|
||||
imageUrl: { label: "Background image", ...imageField({ adapter: frontendAiMediaAdapter }) },
|
||||
imageUrl: { label: "Background image", type: "image" },
|
||||
align: {
|
||||
label: "Alignment",
|
||||
type: "radio",
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { ComponentConfig } from "@reacteditor/core";
|
||||
import { imageField } from "@reacteditor/plugin-media/field";
|
||||
import { LayoutTemplate } from "lucide-react";
|
||||
import { Hero, type HeroProps } from "@/components/hero/hero";
|
||||
import { frontendAiMediaAdapter } from "@/services/media-adapter";
|
||||
|
||||
const heroEditor: ComponentConfig<HeroProps> = {
|
||||
label: "Hero",
|
||||
@@ -51,7 +49,7 @@ const heroEditor: ComponentConfig<HeroProps> = {
|
||||
},
|
||||
getItemSummary: (item) => item?.label || "Button",
|
||||
},
|
||||
imageUrl: { label: "Background image", ...imageField({ adapter: frontendAiMediaAdapter }) },
|
||||
imageUrl: { label: "Background image", type: "image" },
|
||||
align: {
|
||||
label: "Alignment",
|
||||
type: "radio",
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { ComponentConfig } from "@reacteditor/core";
|
||||
import { imageField } from "@reacteditor/plugin-media/field";
|
||||
import { Images } from "lucide-react";
|
||||
import { ImageGallery, type ImageGalleryProps } from "@/components/landing/image-gallery";
|
||||
import { frontendAiMediaAdapter } from "@/services/media-adapter";
|
||||
|
||||
const imageGalleryEditor: ComponentConfig<ImageGalleryProps> = {
|
||||
label: "Image gallery",
|
||||
@@ -40,7 +38,7 @@ const imageGalleryEditor: ComponentConfig<ImageGalleryProps> = {
|
||||
defaultItemProps: { src: "", alt: "" },
|
||||
getItemSummary: (it) => it?.caption || "Image",
|
||||
arrayFields: {
|
||||
src: { label: "Image", ...imageField({ adapter: frontendAiMediaAdapter }) },
|
||||
src: { label: "Image", type: "image" },
|
||||
alt: { label: "Alt text", type: "text", contentEditable: true },
|
||||
caption: { label: "Caption", type: "text", contentEditable: true },
|
||||
},
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { ComponentConfig, Fields } from "@reacteditor/core";
|
||||
import { imageField } from "@reacteditor/plugin-media/field";
|
||||
import { Mail } from "lucide-react";
|
||||
import { NewsletterCta, type NewsletterCtaProps } from "@/components/landing/newsletter-cta";
|
||||
import { frontendAiMediaAdapter } from "@/services/media-adapter";
|
||||
|
||||
const baseFields: Fields<NewsletterCtaProps> = {
|
||||
tagline: { label: "Tagline", type: "text", contentEditable: true },
|
||||
@@ -18,7 +16,7 @@ const baseFields: Fields<NewsletterCtaProps> = {
|
||||
{ label: "Klaviyo", value: "klaviyo" },
|
||||
],
|
||||
},
|
||||
imageUrl: { label: "Image", ...imageField({ adapter: frontendAiMediaAdapter }) },
|
||||
imageUrl: { label: "Image", type: "image" },
|
||||
layout: {
|
||||
label: "Layout",
|
||||
type: "radio",
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { ComponentConfig } from "@reacteditor/core";
|
||||
import { imageField } from "@reacteditor/plugin-media/field";
|
||||
import { Award } from "lucide-react";
|
||||
import { Logos, type LogosProps } from "@/components/logos/logos";
|
||||
import { frontendAiMediaAdapter } from "@/services/media-adapter";
|
||||
|
||||
const logosEditor: ComponentConfig<LogosProps> = {
|
||||
label: "Press / Logos",
|
||||
@@ -35,7 +33,7 @@ const logosEditor: ComponentConfig<LogosProps> = {
|
||||
defaultItemProps: { src: "", alt: "" },
|
||||
getItemSummary: (it) => it?.alt || "Logo",
|
||||
arrayFields: {
|
||||
src: { label: "Image", ...imageField({ adapter: frontendAiMediaAdapter }) },
|
||||
src: { label: "Image", type: "image" },
|
||||
alt: { label: "Alt text", type: "text", contentEditable: true },
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { ComponentConfig } from "@reacteditor/core";
|
||||
import { Menu as MenuIcon } from "lucide-react";
|
||||
import { imageField } from "@reacteditor/plugin-media/field";
|
||||
import { Navigation, type NavigationProps } from "@/components/navigation/navigation";
|
||||
import { frontendAiMediaAdapter } from "@/services/media-adapter";
|
||||
|
||||
const navigationEditor: ComponentConfig<NavigationProps> = {
|
||||
label: "Navigation",
|
||||
@@ -24,7 +22,7 @@ const navigationEditor: ComponentConfig<NavigationProps> = {
|
||||
tone: "default",
|
||||
},
|
||||
fields: {
|
||||
logo: { label: "Logo", ...imageField({ adapter: frontendAiMediaAdapter }) },
|
||||
logo: { label: "Logo", type: "image" },
|
||||
brand: { label: "Logo Alt", type: "text", contentEditable: true },
|
||||
links: {
|
||||
label: "Links",
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { ComponentConfig } from "@reacteditor/core";
|
||||
import { imageField } from "@reacteditor/plugin-media/field";
|
||||
import { Quote } from "lucide-react";
|
||||
import { Testimonials, type TestimonialsProps } from "@/components/testimonials/testimonials";
|
||||
import { frontendAiMediaAdapter } from "@/services/media-adapter";
|
||||
|
||||
const testimonialsEditor: ComponentConfig<TestimonialsProps> = {
|
||||
label: "Testimonials",
|
||||
@@ -50,7 +48,7 @@ const testimonialsEditor: ComponentConfig<TestimonialsProps> = {
|
||||
quote: { label: "Quote", type: "textarea", contentEditable: true },
|
||||
author: { label: "Author", type: "text", contentEditable: true },
|
||||
role: { label: "Role", type: "text", contentEditable: true },
|
||||
avatar: { label: "Avatar", ...imageField({ adapter: frontendAiMediaAdapter }) },
|
||||
avatar: { label: "Avatar", type: "image" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user