From 39d06abb97ac9a6a5b9182258d068497e9ac0cf8 Mon Sep 17 00:00:00 2001 From: Sander Paniago Date: Wed, 23 Oct 2024 11:03:43 -0400 Subject: [PATCH 1/5] feat: add params sponsoredCount query search --- packages/api/src/__generated__/schema.ts | 1 + packages/api/src/platforms/vtex/clients/search/index.ts | 6 ++++++ packages/api/src/platforms/vtex/resolvers/query.ts | 3 ++- packages/api/src/typeDefs/query.graphql | 4 ++++ packages/core/@generated/graphql.ts | 1 + 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/api/src/__generated__/schema.ts b/packages/api/src/__generated__/schema.ts index 48e7356649..9cd5a52926 100644 --- a/packages/api/src/__generated__/schema.ts +++ b/packages/api/src/__generated__/schema.ts @@ -509,6 +509,7 @@ export type QuerySearchArgs = { first: Scalars['Int']; selectedFacets?: Maybe>; sort?: Maybe; + sponsoredCount?: Maybe; term?: Maybe; }; diff --git a/packages/api/src/platforms/vtex/clients/search/index.ts b/packages/api/src/platforms/vtex/clients/search/index.ts index a64a383c82..c0a2cc84de 100644 --- a/packages/api/src/platforms/vtex/clients/search/index.ts +++ b/packages/api/src/platforms/vtex/clients/search/index.ts @@ -34,6 +34,7 @@ export interface SearchArgs { hideUnavailableItems?: boolean showInvisibleItems?: boolean showSponsored?: boolean + sponsoredCount?: number } export interface ProductLocator { @@ -115,6 +116,7 @@ export const IntelligentSearch = ( type, fuzzy = 'auto', showInvisibleItems, + sponsoredCount }: SearchArgs): Promise => { const params = new URLSearchParams({ page: (page + 1).toString(), @@ -141,6 +143,10 @@ export const IntelligentSearch = ( params.append('showSponsored', showSponsored.toString()) } + if (sponsoredCount !== undefined) { + params.append('sponsoredCount', sponsoredCount.toString()) + } + const pathname = addDefaultFacets(selectedFacets) .map(({ key, value }) => `${key}/${value}`) .join('/') diff --git a/packages/api/src/platforms/vtex/resolvers/query.ts b/packages/api/src/platforms/vtex/resolvers/query.ts index 68bf191493..b2dbe56b48 100644 --- a/packages/api/src/platforms/vtex/resolvers/query.ts +++ b/packages/api/src/platforms/vtex/resolvers/query.ts @@ -112,7 +112,7 @@ export const Query = { }, search: async ( _: unknown, - { first, after: maybeAfter, sort, term, selectedFacets }: QuerySearchArgs, + { first, after: maybeAfter, sort, term, selectedFacets, sponsoredCount }: QuerySearchArgs, ctx: Context ) => { // Insert channel in context for later usage @@ -160,6 +160,7 @@ export const Query = { query: query ?? undefined, sort: SORT_MAP[sort ?? 'score_desc'], selectedFacets: selectedFacets?.flatMap(transformSelectedFacet) ?? [], + sponsoredCount: sponsoredCount ?? undefined } const productSearchPromise = ctx.clients.search.products(searchArgs) diff --git a/packages/api/src/typeDefs/query.graphql b/packages/api/src/typeDefs/query.graphql index 0e38c291b2..0065e82bc3 100644 --- a/packages/api/src/typeDefs/query.graphql +++ b/packages/api/src/typeDefs/query.graphql @@ -242,6 +242,10 @@ type Query { Array of selected search facets. """ selectedFacets: [IStoreSelectedFacet!] + """ + Search advertisement products return in result. + """ + sponsoredCount: Int ): StoreSearchResult! @cacheControl(scope: "public", sMaxAge: 120, staleWhileRevalidate: 3600) diff --git a/packages/core/@generated/graphql.ts b/packages/core/@generated/graphql.ts index feeba2639b..d0c51c8cbe 100644 --- a/packages/core/@generated/graphql.ts +++ b/packages/core/@generated/graphql.ts @@ -505,6 +505,7 @@ export type QuerySearchArgs = { first: Scalars['Int']['input'] selectedFacets: InputMaybe> sort?: InputMaybe + sponsoredCount: InputMaybe term?: InputMaybe } From 443a5da4f4f32dfea49cc67bc818f3250e6a90d7 Mon Sep 17 00:00:00 2001 From: Sander Paniago Date: Thu, 24 Oct 2024 08:33:58 -0400 Subject: [PATCH 2/5] feat: ajust graphql core search --- packages/core/src/sdk/product/usePageProductsQuery.ts | 2 ++ packages/core/src/sdk/product/useProductsPrefetch.ts | 2 ++ packages/core/src/sdk/product/useProductsQuery.ts | 2 ++ 3 files changed, 6 insertions(+) diff --git a/packages/core/src/sdk/product/usePageProductsQuery.ts b/packages/core/src/sdk/product/usePageProductsQuery.ts index f17870ef72..eff47e18cb 100644 --- a/packages/core/src/sdk/product/usePageProductsQuery.ts +++ b/packages/core/src/sdk/product/usePageProductsQuery.ts @@ -37,6 +37,7 @@ export const query = gql(` $sort: StoreSort! $term: String! $selectedFacets: [IStoreSelectedFacet!]! + $sponsoredCount: Int ) { ...ClientManyProducts search( @@ -45,6 +46,7 @@ export const query = gql(` sort: $sort term: $term selectedFacets: $selectedFacets + sponsoredCount: $sponsoredCount ) { products { pageInfo { diff --git a/packages/core/src/sdk/product/useProductsPrefetch.ts b/packages/core/src/sdk/product/useProductsPrefetch.ts index f848d0ab6d..c425ba044b 100644 --- a/packages/core/src/sdk/product/useProductsPrefetch.ts +++ b/packages/core/src/sdk/product/useProductsPrefetch.ts @@ -16,6 +16,7 @@ export const query = gql(` $sort: StoreSort! $term: String! $selectedFacets: [IStoreSelectedFacet!]! + $sponsoredCount: Int ) { ...ClientManyProducts search( @@ -24,6 +25,7 @@ export const query = gql(` sort: $sort term: $term selectedFacets: $selectedFacets + sponsoredCount: $sponsoredCount ) { products { pageInfo { diff --git a/packages/core/src/sdk/product/useProductsQuery.ts b/packages/core/src/sdk/product/useProductsQuery.ts index 1c8a219d84..fdd7320d9d 100644 --- a/packages/core/src/sdk/product/useProductsQuery.ts +++ b/packages/core/src/sdk/product/useProductsQuery.ts @@ -15,6 +15,7 @@ export const query = gql(` $sort: StoreSort! $term: String! $selectedFacets: [IStoreSelectedFacet!]! + $sponsoredCount: Int ) { ...ClientManyProducts search( @@ -23,6 +24,7 @@ export const query = gql(` sort: $sort term: $term selectedFacets: $selectedFacets + sponsoredCount: $sponsoredCount ) { products { pageInfo { From 1139ea15ea11c446871c5d2447b8f3bce027d24b Mon Sep 17 00:00:00 2001 From: Sander Paniago Date: Thu, 24 Oct 2024 09:04:40 -0400 Subject: [PATCH 3/5] resolve error ClientManyProductsQuery --- packages/core/@generated/gql.ts | 8 ++++---- packages/core/@generated/graphql.ts | 4 +++- .../src/fragments/ClientManyProducts.ts | 2 ++ .../core/src/sdk/product/useLocalizedVariables.ts | 13 ++++++++++++- .../core/src/sdk/product/useProductsPrefetch.ts | 2 +- 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/packages/core/@generated/gql.ts b/packages/core/@generated/gql.ts index acc84a5177..299e9fd08b 100644 --- a/packages/core/@generated/gql.ts +++ b/packages/core/@generated/gql.ts @@ -18,7 +18,7 @@ const documents = { types.Filter_FacetsFragmentDoc, '\n fragment ProductDetailsFragment_product on StoreProduct {\n id: productID\n sku\n name\n gtin\n description\n unitMultiplier\n isVariantOf {\n name\n productGroupID\n skuVariants {\n activeVariations\n slugsMap\n availableVariations\n }\n }\n\n image {\n url\n alternateName\n }\n\n brand {\n name\n }\n\n offers {\n lowPrice\n lowPriceWithTaxes\n offers {\n availability\n price\n priceWithTaxes\n listPrice\n listPriceWithTaxes\n seller {\n identifier\n }\n }\n }\n\n additionalProperty {\n propertyID\n name\n value\n valueReference\n }\n\n # Contains necessary info to add this item to cart\n ...CartProductItem\n }\n': types.ProductDetailsFragment_ProductFragmentDoc, - '\n fragment ClientManyProducts on Query {\n search(\n first: $first\n after: $after\n sort: $sort\n term: $term\n selectedFacets: $selectedFacets\n ) {\n products {\n pageInfo {\n totalCount\n }\n }\n }\n }\n': + '\n fragment ClientManyProducts on Query {\n search(\n first: $first\n after: $after\n sort: $sort\n term: $term\n selectedFacets: $selectedFacets\n sponsoredCount: $sponsoredCount\n\n ) {\n products {\n pageInfo {\n totalCount\n }\n }\n }\n }\n': types.ClientManyProductsFragmentDoc, '\n fragment ClientProduct on Query {\n product(locator: $locator) {\n id: productID\n }\n }\n': types.ClientProductFragmentDoc, @@ -42,7 +42,7 @@ const documents = { types.ValidateCartMutationDocument, '\n mutation SubscribeToNewsletter($data: IPersonNewsletter!) {\n subscribeToNewsletter(data: $data) {\n id\n }\n }\n': types.SubscribeToNewsletterDocument, - '\n query ClientManyProductsQuery(\n $first: Int!\n $after: String\n $sort: StoreSort!\n $term: String!\n $selectedFacets: [IStoreSelectedFacet!]!\n ) {\n ...ClientManyProducts\n search(\n first: $first\n after: $after\n sort: $sort\n term: $term\n selectedFacets: $selectedFacets\n ) {\n products {\n pageInfo {\n totalCount\n }\n edges {\n node {\n ...ProductSummary_product\n }\n }\n }\n }\n }\n': + '\n query ClientManyProductsQuery(\n $first: Int!\n $after: String\n $sort: StoreSort!\n $term: String!\n $selectedFacets: [IStoreSelectedFacet!]!\n $sponsoredCount: Int\n ) {\n ...ClientManyProducts\n search(\n first: $first\n after: $after\n sort: $sort\n term: $term\n selectedFacets: $selectedFacets\n sponsoredCount: $sponsoredCount\n ) {\n products {\n pageInfo {\n totalCount\n }\n edges {\n node {\n ...ProductSummary_product\n }\n }\n }\n }\n }\n': types.ClientManyProductsQueryDocument, '\n query ClientProductGalleryQuery(\n $first: Int!\n $after: String!\n $sort: StoreSort!\n $term: String!\n $selectedFacets: [IStoreSelectedFacet!]!\n ) {\n ...ClientProductGallery\n redirect(term: $term, selectedFacets: $selectedFacets) {\n url\n }\n search(\n first: $first\n after: $after\n sort: $sort\n term: $term\n selectedFacets: $selectedFacets\n ) {\n products {\n pageInfo {\n totalCount\n }\n }\n facets {\n ...Filter_facets\n }\n metadata {\n ...SearchEvent_metadata\n }\n }\n }\n\n fragment SearchEvent_metadata on SearchMetadata {\n isTermMisspelled\n logicalOperator\n }\n': types.ClientProductGalleryQueryDocument, @@ -80,7 +80,7 @@ export function gql( * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( - source: '\n fragment ClientManyProducts on Query {\n search(\n first: $first\n after: $after\n sort: $sort\n term: $term\n selectedFacets: $selectedFacets\n ) {\n products {\n pageInfo {\n totalCount\n }\n }\n }\n }\n' + source: '\n fragment ClientManyProducts on Query {\n search(\n first: $first\n after: $after\n sort: $sort\n term: $term\n selectedFacets: $selectedFacets\n sponsoredCount: $sponsoredCount\n\n ) {\n products {\n pageInfo {\n totalCount\n }\n }\n }\n }\n' ): typeof import('./graphql').ClientManyProductsFragmentDoc /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. @@ -152,7 +152,7 @@ export function gql( * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( - source: '\n query ClientManyProductsQuery(\n $first: Int!\n $after: String\n $sort: StoreSort!\n $term: String!\n $selectedFacets: [IStoreSelectedFacet!]!\n ) {\n ...ClientManyProducts\n search(\n first: $first\n after: $after\n sort: $sort\n term: $term\n selectedFacets: $selectedFacets\n ) {\n products {\n pageInfo {\n totalCount\n }\n edges {\n node {\n ...ProductSummary_product\n }\n }\n }\n }\n }\n' + source: '\n query ClientManyProductsQuery(\n $first: Int!\n $after: String\n $sort: StoreSort!\n $term: String!\n $selectedFacets: [IStoreSelectedFacet!]!\n $sponsoredCount: Int\n ) {\n ...ClientManyProducts\n search(\n first: $first\n after: $after\n sort: $sort\n term: $term\n selectedFacets: $selectedFacets\n sponsoredCount: $sponsoredCount\n ) {\n products {\n pageInfo {\n totalCount\n }\n edges {\n node {\n ...ProductSummary_product\n }\n }\n }\n }\n }\n' ): typeof import('./graphql').ClientManyProductsQueryDocument /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. diff --git a/packages/core/@generated/graphql.ts b/packages/core/@generated/graphql.ts index d0c51c8cbe..7158aa8e2b 100644 --- a/packages/core/@generated/graphql.ts +++ b/packages/core/@generated/graphql.ts @@ -1429,6 +1429,7 @@ export type ClientManyProductsQueryQueryVariables = Exact<{ sort: StoreSort term: Scalars['String']['input'] selectedFacets: Array | IStoreSelectedFacet + sponsoredCount: InputMaybe }> export type ClientManyProductsQueryQuery = { @@ -1885,6 +1886,7 @@ export const ClientManyProductsFragmentDoc = new TypedDocumentString( sort: $sort term: $term selectedFacets: $selectedFacets + sponsoredCount: $sponsoredCount ) { products { pageInfo { @@ -2088,7 +2090,7 @@ export const SubscribeToNewsletterDocument = { export const ClientManyProductsQueryDocument = { __meta__: { operationName: 'ClientManyProductsQuery', - operationHash: 'ad2eb78cfccb9dbd5a9f2d1e150cc70fea5da99a', + operationHash: '14148671fbf53498fad5c600ee87765920145019', }, } as unknown as TypedDocumentString< ClientManyProductsQueryQuery, diff --git a/packages/core/src/customizations/src/fragments/ClientManyProducts.ts b/packages/core/src/customizations/src/fragments/ClientManyProducts.ts index ff32a03b47..c4aa9944b9 100644 --- a/packages/core/src/customizations/src/fragments/ClientManyProducts.ts +++ b/packages/core/src/customizations/src/fragments/ClientManyProducts.ts @@ -8,6 +8,8 @@ export const fragment = gql(` sort: $sort term: $term selectedFacets: $selectedFacets + sponsoredCount: $sponsoredCount + ) { products { pageInfo { diff --git a/packages/core/src/sdk/product/useLocalizedVariables.ts b/packages/core/src/sdk/product/useLocalizedVariables.ts index 73ca339c41..f358a50757 100644 --- a/packages/core/src/sdk/product/useLocalizedVariables.ts +++ b/packages/core/src/sdk/product/useLocalizedVariables.ts @@ -12,6 +12,7 @@ export const useLocalizedVariables = ({ sort, term, selectedFacets, + sponsoredCount, }: Partial) => { const { channel, locale } = useSession() @@ -28,6 +29,16 @@ export const useLocalizedVariables = ({ { key: 'channel', value: channel ?? '' }, { key: 'locale', value: locale }, ], + sponsoredCount: sponsoredCount ?? 3, } - }, [selectedFacets, first, after, sort, term, channel, locale]) + }, [ + selectedFacets, + first, + after, + sort, + term, + channel, + locale, + sponsoredCount, + ]) } diff --git a/packages/core/src/sdk/product/useProductsPrefetch.ts b/packages/core/src/sdk/product/useProductsPrefetch.ts index c425ba044b..d730639c40 100644 --- a/packages/core/src/sdk/product/useProductsPrefetch.ts +++ b/packages/core/src/sdk/product/useProductsPrefetch.ts @@ -42,7 +42,7 @@ export const query = gql(` `) export const useProductsQueryPrefetch = ( - variables: ClientManyProductsQueryQueryVariables, + variables: Partial, options?: QueryOptions ) => { const localizedVariables = useLocalizedVariables(variables) From 5a1aa416391b7160908822c303e538f720c3cd03 Mon Sep 17 00:00:00 2001 From: Sander Paniago Date: Thu, 24 Oct 2024 09:09:12 -0400 Subject: [PATCH 4/5] add sponsoredCount section ProductShelf cms --- packages/core/cms/faststore/sections.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/core/cms/faststore/sections.json b/packages/core/cms/faststore/sections.json index ca97d868e3..0206599110 100644 --- a/packages/core/cms/faststore/sections.json +++ b/packages/core/cms/faststore/sections.json @@ -960,6 +960,10 @@ "default": true } } + }, + "sponsoredCount": { + "type": "integer", + "title": "Quantity Products sponsored" } } } From 0025c3056b52cff72407f06341bf558eecec1f37 Mon Sep 17 00:00:00 2001 From: Sander Pereira Paniago Date: Thu, 7 Nov 2024 15:36:44 -0400 Subject: [PATCH 5/5] remove section custom --- packages/core/cms/faststore/sections.json | 519 +++++++++++++++++----- 1 file changed, 406 insertions(+), 113 deletions(-) diff --git a/packages/core/cms/faststore/sections.json b/packages/core/cms/faststore/sections.json index 0206599110..cea9ba5b77 100644 --- a/packages/core/cms/faststore/sections.json +++ b/packages/core/cms/faststore/sections.json @@ -29,8 +29,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["Magnifying Glass"], - "enum": ["MagnifyingGlass"], + "enumNames": [ + "Magnifying Glass" + ], + "enum": [ + "MagnifyingGlass" + ], "default": "MagnifyingGlass" }, "alt": { @@ -63,8 +67,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["Clock Clockwise"], - "enum": ["ClockClockwise"], + "enumNames": [ + "Clock Clockwise" + ], + "enum": [ + "ClockClockwise" + ], "default": "ClockClockwise" }, "alt": { @@ -108,8 +116,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["Magnifying Glass"], - "enum": ["MagnifyingGlass"] + "enumNames": [ + "Magnifying Glass" + ], + "enum": [ + "MagnifyingGlass" + ] }, "alt": { "type": "string", @@ -151,12 +163,16 @@ "title": "Navbar", "type": "object", "description": "Navbar configuration", - "required": ["logo"], + "required": [ + "logo" + ], "properties": { "logo": { "title": "Logo", "type": "object", - "required": ["src"], + "required": [ + "src" + ], "properties": { "src": { "title": "Image", @@ -172,7 +188,10 @@ "link": { "title": "Logo Link", "type": "object", - "required": ["url", "title"], + "required": [ + "url", + "title" + ], "properties": { "url": { "title": "Link URL", @@ -190,7 +209,9 @@ "title": "Search Input", "description": "Search Input configurations", "type": "object", - "required": ["sort"], + "required": [ + "sort" + ], "properties": { "placeholder": { "title": "Placeholder for Search Bar", @@ -235,8 +256,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["User"], - "enum": ["User"], + "enumNames": [ + "User" + ], + "enum": [ + "User" + ], "default": "User" }, "alt": { @@ -265,8 +290,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["Shopping Cart"], - "enum": ["ShoppingCart"], + "enumNames": [ + "Shopping Cart" + ], + "enum": [ + "ShoppingCart" + ], "default": "ShoppingCart" }, "alt": { @@ -296,8 +325,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["Map Pin"], - "enum": ["MapPin"], + "enumNames": [ + "Map Pin" + ], + "enum": [ + "MapPin" + ], "default": "MapPin" }, "alt": { @@ -321,7 +354,10 @@ "items": { "title": "Link", "type": "object", - "required": ["text", "url"], + "required": [ + "text", + "url" + ], "properties": { "text": { "title": "Link Text", @@ -345,8 +381,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["List"], - "enum": ["List"], + "enumNames": [ + "List" + ], + "enum": [ + "List" + ], "default": "List" }, "alt": { @@ -381,7 +421,11 @@ "title": "Alert", "description": "Add an alert", "type": "object", - "required": ["icon", "content", "dismissible"], + "required": [ + "icon", + "content", + "dismissible" + ], "properties": { "icon": { "type": "string", @@ -394,7 +438,14 @@ "Truck", "User" ], - "enum": ["Bell", "BellRinging", "Checked", "Info", "Truck", "User"] + "enum": [ + "Bell", + "BellRinging", + "Checked", + "Info", + "Truck", + "User" + ] }, "content": { "type": "string", @@ -438,7 +489,11 @@ "items": { "title": "Incentive", "type": "object", - "required": ["title", "firstLineText", "icon"], + "required": [ + "title", + "firstLineText", + "icon" + ], "properties": { "title": { "type": "string", @@ -497,7 +552,10 @@ "items": { "title": "Link", "type": "object", - "required": ["text", "url"], + "required": [ + "text", + "url" + ], "properties": { "text": { "title": "Link Text", @@ -531,7 +589,11 @@ "items": { "title": "Link", "type": "object", - "required": ["alt", "url", "icon"], + "required": [ + "alt", + "url", + "icon" + ], "properties": { "icon": { "title": "Icon", @@ -586,7 +648,10 @@ "link": { "title": "Logo Link", "type": "object", - "required": ["url", "title"], + "required": [ + "url", + "title" + ], "properties": { "url": { "title": "Link URL", @@ -607,7 +672,9 @@ "acceptedPaymentMethods": { "title": "Payment Methods Sections", "type": "object", - "required": ["showPaymentMethods"], + "required": [ + "showPaymentMethods" + ], "properties": { "showPaymentMethods": { "title": "Display Payment Methods", @@ -625,7 +692,10 @@ "items": { "title": "Payment Method", "type": "object", - "required": ["icon", "alt"], + "required": [ + "icon", + "alt" + ], "properties": { "icon": { "type": "object", @@ -675,7 +745,11 @@ "title": "Banner Text", "description": "Add a quick promotion with a text/action pair", "type": "object", - "required": ["title", "caption", "link"], + "required": [ + "title", + "caption", + "link" + ], "properties": { "title": { "title": "Title", @@ -688,7 +762,10 @@ "link": { "title": "Call to Action", "type": "object", - "required": ["text", "url"], + "required": [ + "text", + "url" + ], "properties": { "text": { "title": "Text", @@ -708,14 +785,28 @@ "colorVariant": { "type": "string", "title": "Color variant", - "enumNames": ["Main", "Light", "Accent"], - "enum": ["main", "light", "accent"] + "enumNames": [ + "Main", + "Light", + "Accent" + ], + "enum": [ + "main", + "light", + "accent" + ] }, "variant": { "type": "string", "title": "Variant", - "enumNames": ["Primary", "Secondary"], - "enum": ["primary", "secondary"] + "enumNames": [ + "Primary", + "Secondary" + ], + "enum": [ + "primary", + "secondary" + ] } } } @@ -727,7 +818,9 @@ "title": "Hero", "description": "Add a quick promotion with an image/action pair", "type": "object", - "required": ["title"], + "required": [ + "title" + ], "properties": { "title": { "title": "Title", @@ -776,14 +869,28 @@ "colorVariant": { "type": "string", "title": "Color variant", - "enumNames": ["Main", "Light", "Accent"], - "enum": ["main", "light", "accent"] + "enumNames": [ + "Main", + "Light", + "Accent" + ], + "enum": [ + "main", + "light", + "accent" + ] }, "variant": { "type": "string", "title": "Variant", - "enumNames": ["Primary", "Secondary"], - "enum": ["primary", "secondary"] + "enumNames": [ + "Primary", + "Secondary" + ], + "enum": [ + "primary", + "secondary" + ] } } } @@ -804,7 +911,11 @@ "items": { "title": "Incentive", "type": "object", - "required": ["title", "firstLineText", "icon"], + "required": [ + "title", + "firstLineText", + "icon" + ], "properties": { "title": { "type": "string", @@ -853,7 +964,12 @@ "title": "Product Shelf", "description": "Add custom shelves to your store", "type": "object", - "required": ["title", "numberOfItems", "after", "sort"], + "required": [ + "title", + "numberOfItems", + "after", + "sort" + ], "properties": { "title": { "type": "string", @@ -912,7 +1028,10 @@ "items": { "title": "Facet", "type": "object", - "required": ["key", "value"], + "required": [ + "key", + "value" + ], "properties": { "key": { "title": "Key", @@ -960,22 +1079,25 @@ "default": true } } - }, - "sponsoredCount": { - "type": "integer", - "title": "Quantity Products sponsored" } } } }, { "name": "CrossSellingShelf", - "requiredScopes": ["pdp", "custom"], + "requiredScopes": [ + "pdp", + "custom" + ], "schema": { "title": "Cross Selling Shelf", "description": "Add cross selling product data to your users", "type": "object", - "required": ["title", "numberOfItems", "kind"], + "required": [ + "title", + "numberOfItems", + "kind" + ], "properties": { "title": { "title": "Title", @@ -997,8 +1119,14 @@ "title": "Kind", "description": "Change cross selling types", "default": "buy", - "enum": ["buy", "view"], - "enumNames": ["Who bought also bought", "Who saw also saw"] + "enum": [ + "buy", + "view" + ], + "enumNames": [ + "Who bought also bought", + "Who saw also saw" + ] }, "taxesConfiguration": { "title": "Taxes Configuration", @@ -1026,7 +1154,12 @@ "title": "Product Tiles", "description": "Add custom highlights to your store", "type": "object", - "required": ["title", "first", "after", "sort"], + "required": [ + "title", + "first", + "after", + "sort" + ], "properties": { "title": { "title": "Title", @@ -1079,7 +1212,10 @@ "items": { "title": "Facet", "type": "object", - "required": ["key", "value"], + "required": [ + "key", + "value" + ], "properties": { "key": { "title": "Key", @@ -1122,7 +1258,9 @@ "title": "Newsletter", "description": "Allow users to subscribe to your updates", "type": "object", - "required": ["title"], + "required": [ + "title" + ], "properties": { "icon": { "title": "Icon", @@ -1131,8 +1269,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["Envelope"], - "enum": ["Envelope"], + "enumNames": [ + "Envelope" + ], + "enum": [ + "Envelope" + ], "default": "Envelope" }, "alt": { @@ -1192,8 +1334,16 @@ "colorVariant": { "title": "Color variant", "type": "string", - "enumNames": ["Main", "Light", "Accent"], - "enum": ["main", "light", "accent"], + "enumNames": [ + "Main", + "Light", + "Accent" + ], + "enum": [ + "main", + "light", + "accent" + ], "default": "main" }, "toastSubscribe": { @@ -1215,8 +1365,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["CircleWavyCheck"], - "enum": ["CircleWavyCheck"], + "enumNames": [ + "CircleWavyCheck" + ], + "enum": [ + "CircleWavyCheck" + ], "default": "CircleWavyCheck" } } @@ -1240,8 +1394,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["CircleWavyWarning"], - "enum": ["CircleWavyWarning"], + "enumNames": [ + "CircleWavyWarning" + ], + "enum": [ + "CircleWavyWarning" + ], "default": "CircleWavyWarning" } } @@ -1264,12 +1422,18 @@ "title": "Banner Newsletter", "description": "Add newsletter with a banner", "type": "object", - "required": ["banner", "newsletter"], + "required": [ + "banner", + "newsletter" + ], "properties": { "banner": { "title": "Banner", "type": "object", - "required": ["title", "link"], + "required": [ + "title", + "link" + ], "properties": { "title": { "title": "Title", @@ -1284,7 +1448,10 @@ "link": { "title": "Call to Action", "type": "object", - "required": ["text", "url"], + "required": [ + "text", + "url" + ], "properties": { "text": { "title": "Text", @@ -1301,15 +1468,29 @@ "colorVariant": { "title": "Color variant", "type": "string", - "enumNames": ["Main", "Light", "Accent"], - "enum": ["main", "light", "accent"], + "enumNames": [ + "Main", + "Light", + "Accent" + ], + "enum": [ + "main", + "light", + "accent" + ], "default": "light" }, "variant": { "title": "Variant", "type": "string", - "enumNames": ["Primary", "Secondary"], - "enum": ["primary", "secondary"], + "enumNames": [ + "Primary", + "Secondary" + ], + "enum": [ + "primary", + "secondary" + ], "default": "secondary" } } @@ -1317,7 +1498,10 @@ "newsletter": { "title": "Newsletter", "type": "object", - "required": ["title", "description"], + "required": [ + "title", + "description" + ], "properties": { "icon": { "title": "Icon", @@ -1326,8 +1510,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["Envelope"], - "enum": ["Envelope"], + "enumNames": [ + "Envelope" + ], + "enum": [ + "Envelope" + ], "default": "Envelope" }, "alt": { @@ -1382,8 +1570,16 @@ "colorVariant": { "title": "Color variant", "type": "string", - "enumNames": ["Main", "Light", "Accent"], - "enum": ["main", "light", "accent"], + "enumNames": [ + "Main", + "Light", + "Accent" + ], + "enum": [ + "main", + "light", + "accent" + ], "default": "main" }, "toastSubscribe": { @@ -1405,8 +1601,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["CircleWavyCheck"], - "enum": ["CircleWavyCheck"], + "enumNames": [ + "CircleWavyCheck" + ], + "enum": [ + "CircleWavyCheck" + ], "default": "CircleWavyCheck" } } @@ -1430,8 +1630,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["CircleWavyWarning"], - "enum": ["CircleWavyWarning"], + "enumNames": [ + "CircleWavyWarning" + ], + "enum": [ + "CircleWavyWarning" + ], "default": "CircleWavyWarning" } } @@ -1443,18 +1647,28 @@ }, { "name": "Breadcrumb", - "requiredScopes": ["pdp", "plp"], + "requiredScopes": [ + "pdp", + "plp" + ], "schema": { "title": "Breadcrumb", "description": "Configure the breadcrumb icon and depth", "type": "object", - "required": ["icon", "alt"], + "required": [ + "icon", + "alt" + ], "properties": { "icon": { "title": "Icon", "type": "string", - "enumNames": ["House"], - "enum": ["House"] + "enumNames": [ + "House" + ], + "enum": [ + "House" + ] }, "alt": { "title": "Alternative Label", @@ -1465,7 +1679,9 @@ }, { "name": "ProductDetails", - "requiredScopes": ["pdp"], + "requiredScopes": [ + "pdp" + ], "schema": { "title": "Product Details", "type": "object", @@ -1487,8 +1703,14 @@ "size": { "title": "Size", "type": "string", - "enumNames": ["Big", "Small"], - "enum": ["big", "small"] + "enumNames": [ + "Big", + "Small" + ], + "enum": [ + "big", + "small" + ] } } }, @@ -1515,8 +1737,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["Shopping Cart"], - "enum": ["ShoppingCart"] + "enumNames": [ + "Shopping Cart" + ], + "enum": [ + "ShoppingCart" + ] }, "alt": { "type": "string", @@ -1581,8 +1807,16 @@ "initiallyExpanded": { "type": "string", "title": "Initially Expanded?", - "enumNames": ["First", "All", "None"], - "enum": ["first", "all", "none"] + "enumNames": [ + "First", + "All", + "None" + ], + "enum": [ + "first", + "all", + "none" + ] }, "displayDescription": { "title": "Should display description?", @@ -1628,12 +1862,17 @@ }, { "name": "ProductGallery", - "requiredScopes": ["plp", "search"], + "requiredScopes": [ + "plp", + "search" + ], "schema": { "title": "Product Gallery", "type": "object", "description": "Product Gallery configuration", - "required": ["filter"], + "required": [ + "filter" + ], "properties": { "searchTermLabel": { "title": "Search page term label", @@ -1648,7 +1887,10 @@ "previousPageButton": { "title": "Previous page button", "type": "object", - "required": ["icon", "label"], + "required": [ + "icon", + "label" + ], "properties": { "icon": { "title": "Icon", @@ -1657,8 +1899,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["ArrowLeft"], - "enum": ["ArrowLeft"], + "enumNames": [ + "ArrowLeft" + ], + "enum": [ + "ArrowLeft" + ], "default": "ArrowLeft" }, "alt": { @@ -1678,7 +1924,9 @@ "loadMorePageButton": { "title": "Load more products Button", "type": "object", - "required": ["label"], + "required": [ + "label" + ], "properties": { "label": { "title": "Load more products label", @@ -1690,7 +1938,10 @@ "filter": { "title": "Filter", "type": "object", - "required": ["title", "mobileOnly"], + "required": [ + "title", + "mobileOnly" + ], "properties": { "title": { "title": "Filter title", @@ -1709,7 +1960,10 @@ "filterButton": { "title": "Show filter button", "type": "object", - "required": ["label", "icon"], + "required": [ + "label", + "icon" + ], "properties": { "label": { "title": "Label", @@ -1719,13 +1973,20 @@ "icon": { "title": "Icon", "type": "object", - "required": ["icon", "alt"], + "required": [ + "icon", + "alt" + ], "properties": { "icon": { "title": "Icon", "type": "string", - "enumNames": ["FadersHorizontal"], - "enum": ["FadersHorizontal"], + "enumNames": [ + "FadersHorizontal" + ], + "enum": [ + "FadersHorizontal" + ], "default": "FadersHorizontal" }, "alt": { @@ -1859,7 +2120,10 @@ "icon": { "title": "Icon", "type": "object", - "required": ["icon", "alt"], + "required": [ + "icon", + "alt" + ], "properties": { "icon": { "title": "Icon", @@ -1899,7 +2163,11 @@ "checkoutButton": { "title": "Checkout button", "type": "object", - "required": ["label", "loadingLabel", "icon"], + "required": [ + "label", + "loadingLabel", + "icon" + ], "properties": { "label": { "title": "Label", @@ -1914,13 +2182,20 @@ "icon": { "title": "Icon", "type": "object", - "required": ["icon", "alt"], + "required": [ + "icon", + "alt" + ], "properties": { "icon": { "title": "Icon", "type": "string", - "enumNames": ["ArrowRight"], - "enum": ["ArrowRight"], + "enumNames": [ + "ArrowRight" + ], + "enum": [ + "ArrowRight" + ], "default": "ArrowRight" }, "alt": { @@ -1969,7 +2244,9 @@ "title": "Region Bar", "type": "object", "description": "Region Bar configuration", - "required": ["label"], + "required": [ + "label" + ], "properties": { "icon": { "title": "Location Icon", @@ -1978,8 +2255,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["Map Pin"], - "enum": ["MapPin"], + "enumNames": [ + "Map Pin" + ], + "enum": [ + "MapPin" + ], "default": "MapPin" }, "alt": { @@ -2006,8 +2287,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["Caret Right"], - "enum": ["CaretRight"], + "enumNames": [ + "Caret Right" + ], + "enum": [ + "CaretRight" + ], "default": "CaretRight" }, "alt": { @@ -2079,8 +2364,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["Arrow Square Out"], - "enum": ["ArrowSquareOut"], + "enumNames": [ + "Arrow Square Out" + ], + "enum": [ + "ArrowSquareOut" + ], "default": "ArrowSquareOut" }, "alt": { @@ -2113,8 +2402,12 @@ "icon": { "title": "Icon", "type": "string", - "enumNames": ["CircleWavy Warning"], - "enum": ["CircleWavyWarning"] + "enumNames": [ + "CircleWavy Warning" + ], + "enum": [ + "CircleWavyWarning" + ] }, "alt": { "title": "Alternative Label", @@ -2168,4 +2461,4 @@ } } } -] +] \ No newline at end of file