From 721e5168e752a1412d2373f4d51eb8ad15a36de2 Mon Sep 17 00:00:00 2001 From: Baroshem Date: Tue, 14 Nov 2023 11:24:13 +0100 Subject: [PATCH 1/6] feat: add Product Gallery component --- docs/components/content/ProductGallery.vue | 11 ++ .../content/2.components/CldProductGallery.md | 71 +++++++++++ docs/content/2.components/CldUploadButton.md | 2 +- playground/app.vue | 7 ++ src/runtime/components/CldProductGallery.vue | 110 ++++++++++++++++++ 5 files changed, 200 insertions(+), 1 deletion(-) create mode 100644 docs/components/content/ProductGallery.vue create mode 100644 docs/content/2.components/CldProductGallery.md create mode 100644 src/runtime/components/CldProductGallery.vue diff --git a/docs/components/content/ProductGallery.vue b/docs/components/content/ProductGallery.vue new file mode 100644 index 0000000..ea82420 --- /dev/null +++ b/docs/components/content/ProductGallery.vue @@ -0,0 +1,11 @@ + + + diff --git a/docs/content/2.components/CldProductGallery.md b/docs/content/2.components/CldProductGallery.md new file mode 100644 index 0000000..0076066 --- /dev/null +++ b/docs/content/2.components/CldProductGallery.md @@ -0,0 +1,71 @@ +# CldProductGallery.vue + +--- + +The CldProductGallery creates a product gallery element that uses an instance of the [Cloudinary Product Gallery Widget](https://cloudinary.com/documentation/product_gallery_reference) to give you an easy way to add product gallery component to your Nuxt app. + +## Basic Usage + +```vue + + + +``` + +:product-gallery + +## Props + +CldProductGallery accepts several customization props listed below: + +| Prop Name | Type | Example | +| ---------------- | ------- | -------------------------------------------------------------------- | +| cloudName | string | `"demo"` | +| mediaAssets | array | `[{ tag: 'electric_car_product_gallery_demo', mediaType: 'video' }]` | +| displayProps | object | `{ mode: "expanded", columns: 2 }` | +| aspectRatio | string | `"4:3"` | +| imageBreakpoint | number | `200` | +| carouselStyle | string | `"indicators"` | +| indicatorProps | object | `{ color: "red" }` | +| carouselLocation | string | `"right"` | +| borderColor | string | `"red"` | +| borderWidth | number | `5` | +| transition | string | `"fade"` | +| zoom | boolean | `false` | +| params | object | `{}` | + +For all other available props checkout [Cloudinary Product Gallery Docs](https://cloudinary.com/documentation/product_gallery_reference#widget_parameters) and make sure to pass them to the component as `params` like following: + +```vue + + + +``` diff --git a/docs/content/2.components/CldUploadButton.md b/docs/content/2.components/CldUploadButton.md index df5dff0..33b24ba 100644 --- a/docs/content/2.components/CldUploadButton.md +++ b/docs/content/2.components/CldUploadButton.md @@ -2,7 +2,7 @@ --- -The CldUploadButton creates a button element that uses an instance of the [Cloudinary Upload Widget](https://cloudinary.com/documentation/upload_widget) to give you an easy way to add upload capabilities to your Next.js app. +The CldUploadButton creates a button element that uses an instance of the [Cloudinary Upload Widget](https://cloudinary.com/documentation/upload_widget) to give you an easy way to add upload capabilities to your Nuxt app. The CldUploadButton component wraps the [CldUploadWidget](/components/clduploadwidget) component providing a pre-defined UI (a button). The same concepts apply, including having the option of using Signed or Unsigned uploads. diff --git a/playground/app.vue b/playground/app.vue index c20312f..c2d3873 100644 --- a/playground/app.vue +++ b/playground/app.vue @@ -2,9 +2,16 @@ // Usage of `useCldImageUrl` composable const { url } = useCldImageUrl({ options: { src: "/cld-sample-5.jpg" } }); console.log(url); + +const mediaAssets = [ + { tag: "electric_car_product_gallery_demo" }, // by default mediaType: "image" + { tag: "electric_car_product_gallery_demo", mediaType: "video" }, + { tag: "electric_car_360_product_gallery_demo", mediaType: "spin" }, +];