From 878721c8ccfddaebbc9cd14aae6d45f3617cc4ba Mon Sep 17 00:00:00 2001 From: Marcos Candeia Date: Tue, 4 Apr 2023 23:25:50 -0300 Subject: [PATCH 01/15] Add vtex productshelf Signed-off-by: Marcos Candeia --- live.gen.ts | 38 ++++++++++++------------ schemas.gen.json | 55 +++++++++++++++++++++++++++++++++++ sections/VtexProductShelf.tsx | 31 ++++++++++++++++++++ 3 files changed, 106 insertions(+), 18 deletions(-) create mode 100644 sections/VtexProductShelf.tsx diff --git a/live.gen.ts b/live.gen.ts index 6dfd2e6e..f0c55f27 100644 --- a/live.gen.ts +++ b/live.gen.ts @@ -22,15 +22,16 @@ import * as $$$$$$$$1 from "./sections/DesignSystem.story.tsx"; import * as $$$$$$$$2 from "./sections/Features.tsx"; import * as $$$$$$$$3 from "./sections/BannerPLP.tsx"; import * as $$$$$$$$4 from "./sections/BannerGrid.tsx"; -import * as $$$$$$$$5 from "./sections/SearchResult.tsx"; -import * as $$$$$$$$6 from "./sections/ProductShelf.tsx"; -import * as $$$$$$$$7 from "./sections/Footer.tsx"; -import * as $$$$$$$$8 from "./sections/CookieConsent.tsx"; -import * as $$$$$$$$9 from "./sections/Header.tsx"; -import * as $$$$$$$$10 from "./sections/ProductDetails.tsx"; -import * as $$$$$$$$11 from "./sections/Highlights.tsx"; -import * as $$$$$$$$12 from "./sections/WhatsApp.tsx"; -import * as $$$$$$$$13 from "./sections/Carousel.tsx"; +import * as $$$$$$$$5 from "./sections/VtexProductShelf.tsx"; +import * as $$$$$$$$6 from "./sections/SearchResult.tsx"; +import * as $$$$$$$$7 from "./sections/ProductShelf.tsx"; +import * as $$$$$$$$8 from "./sections/Footer.tsx"; +import * as $$$$$$$$9 from "./sections/CookieConsent.tsx"; +import * as $$$$$$$$10 from "./sections/Header.tsx"; +import * as $$$$$$$$11 from "./sections/ProductDetails.tsx"; +import * as $$$$$$$$12 from "./sections/Highlights.tsx"; +import * as $$$$$$$$13 from "./sections/WhatsApp.tsx"; +import * as $$$$$$$$14 from "./sections/Carousel.tsx"; import * as $live_middleware from "$live/routes/_middleware.ts"; import * as $live_workbench from "$live/routes/live/workbench.ts"; import * as $live_editorData from "$live/routes/live/editorData.ts"; @@ -115,15 +116,16 @@ const manifest: DecoManifest = { "deco-sites/fashion/sections/Features.tsx": $$$$$$$$2, "deco-sites/fashion/sections/BannerPLP.tsx": $$$$$$$$3, "deco-sites/fashion/sections/BannerGrid.tsx": $$$$$$$$4, - "deco-sites/fashion/sections/SearchResult.tsx": $$$$$$$$5, - "deco-sites/fashion/sections/ProductShelf.tsx": $$$$$$$$6, - "deco-sites/fashion/sections/Footer.tsx": $$$$$$$$7, - "deco-sites/fashion/sections/CookieConsent.tsx": $$$$$$$$8, - "deco-sites/fashion/sections/Header.tsx": $$$$$$$$9, - "deco-sites/fashion/sections/ProductDetails.tsx": $$$$$$$$10, - "deco-sites/fashion/sections/Highlights.tsx": $$$$$$$$11, - "deco-sites/fashion/sections/WhatsApp.tsx": $$$$$$$$12, - "deco-sites/fashion/sections/Carousel.tsx": $$$$$$$$13, + "deco-sites/fashion/sections/VtexProductShelf.tsx": $$$$$$$$5, + "deco-sites/fashion/sections/SearchResult.tsx": $$$$$$$$6, + "deco-sites/fashion/sections/ProductShelf.tsx": $$$$$$$$7, + "deco-sites/fashion/sections/Footer.tsx": $$$$$$$$8, + "deco-sites/fashion/sections/CookieConsent.tsx": $$$$$$$$9, + "deco-sites/fashion/sections/Header.tsx": $$$$$$$$10, + "deco-sites/fashion/sections/ProductDetails.tsx": $$$$$$$$11, + "deco-sites/fashion/sections/Highlights.tsx": $$$$$$$$12, + "deco-sites/fashion/sections/WhatsApp.tsx": $$$$$$$$13, + "deco-sites/fashion/sections/Carousel.tsx": $$$$$$$$14, "$live/sections/PageInclude.tsx": i2$$$9, "deco-sites/std/sections/configYourViews.global.tsx": i2$$$0, "deco-sites/std/sections/SEO.tsx": i2$$$1, diff --git a/schemas.gen.json b/schemas.gen.json index 7dc9f04a..4851352a 100644 --- a/schemas.gen.json +++ b/schemas.gen.json @@ -2602,6 +2602,37 @@ ], "title": "deco-sites/fashion/components/ui/BannerGrid.tsx@Props" }, + "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Z0ZXhQcm9kdWN0U2hlbGYudHN4@Props": { + "type": "object", + "properties": { + "title": { + "type": "string", + "title": "Title" + }, + "itemsPerPage": { + "type": [ + "number", + "null" + ], + "title": "Items Per Page" + } + }, + "required": [ + "title" + ], + "title": "Props" + }, + "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Z0ZXhQcm9kdWN0U2hlbGYudHN4@Props&Props": { + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Z0ZXhQcm9kdWN0U2hlbGYudHN4@Props" + }, + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@Props" + } + ], + "title": "deco-sites/fashion/sections/VtexProductShelf.tsx@Props&Props" + }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvc2VhcmNoL1NlYXJjaFJlc3VsdC50c3g=@Props": { "type": "object", "properties": { @@ -4376,6 +4407,27 @@ } } }, + "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Z0ZXhQcm9kdWN0U2hlbGYudHN4": { + "title": "deco-sites/fashion/sections/VtexProductShelf.tsx", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Z0ZXhQcm9kdWN0U2hlbGYudHN4@Props&Props" + } + ], + "required": [ + "__resolveType" + ], + "properties": { + "__resolveType": { + "type": "string", + "enum": [ + "deco-sites/fashion/sections/VtexProductShelf.tsx" + ], + "default": "deco-sites/fashion/sections/VtexProductShelf.tsx" + } + } + }, "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1NlYXJjaFJlc3VsdC50c3g=": { "title": "deco-sites/fashion/sections/SearchResult.tsx", "type": "object", @@ -5157,6 +5209,9 @@ { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0Jhbm5lckdyaWQudHN4" }, + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Z0ZXhQcm9kdWN0U2hlbGYudHN4" + }, { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1NlYXJjaFJlc3VsdC50c3g=" }, diff --git a/sections/VtexProductShelf.tsx b/sections/VtexProductShelf.tsx new file mode 100644 index 00000000..632b2ee8 --- /dev/null +++ b/sections/VtexProductShelf.tsx @@ -0,0 +1,31 @@ +import ProductShelf, { + Props as ProductShelfProps, +} from "deco-sites/fashion/components/product/ProductShelf.tsx"; +import loader, { + Props as LoaderProps, +} from "deco-sites/std/functions/vtexProductList.ts"; +import { HandlerContext } from "https://deno.land/x/fresh@1.1.4/src/server/types.ts"; +import { LiveConfig } from "https://denopkg.com/deco-cx/live@1.0.0-rc.36/blocks/handler.ts"; +import { StateVTEX } from "https://denopkg.com/deco-sites/std@1.0.0-rc.9/commerce/vtex/types.ts"; + +export interface Props { + title: string; + itemsPerPage?: number; +} + +function ProductShelfSection(props: ProductShelfProps) { + return ; +} + +export async function getProps( + request: Request, + ctx: HandlerContext< + unknown, + LiveConfig + >, +): Promise { + const { data: products } = await loader(request, ctx, ctx.state.$live); + return { ...ctx.state.$live, products }; +} + +export default ProductShelfSection; From 509c0b15437365309c91b571f9b1cea76bfe8ced Mon Sep 17 00:00:00 2001 From: Marcos Candeia Date: Wed, 5 Apr 2023 21:32:11 -0300 Subject: [PATCH 02/15] Update live version Signed-off-by: Marcos Candeia --- import_map.json | 3 ++- sections/VtexProductShelf.tsx | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/import_map.json b/import_map.json index fd48f579..8f18dfd2 100644 --- a/import_map.json +++ b/import_map.json @@ -1,6 +1,7 @@ { "imports": { - "$live/": "https://denopkg.com/deco-cx/live@1.0.0-rc.43/", + "$store/": "./", + "$live/": "https://denopkg.com/deco-cx/live@1793c3980d9244aac8da841a90da40dad5b37a68/", "deco-sites/std/": "https://denopkg.com/deco-sites/std@1.0.0-rc.11/", "deco-sites/fashion/": "./", "partytown/": "https://deno.land/x/partytown@0.2.1/", diff --git a/sections/VtexProductShelf.tsx b/sections/VtexProductShelf.tsx index 632b2ee8..a58dba89 100644 --- a/sections/VtexProductShelf.tsx +++ b/sections/VtexProductShelf.tsx @@ -1,12 +1,13 @@ +import { HandlerContext } from "$fresh/src/server/types.ts"; import ProductShelf, { Props as ProductShelfProps, } from "deco-sites/fashion/components/product/ProductShelf.tsx"; +import { Product } from "deco-sites/std/commerce/types.ts"; +import { StateVTEX } from "deco-sites/std/commerce/vtex/types.ts"; import loader, { Props as LoaderProps, } from "deco-sites/std/functions/vtexProductList.ts"; -import { HandlerContext } from "https://deno.land/x/fresh@1.1.4/src/server/types.ts"; import { LiveConfig } from "https://denopkg.com/deco-cx/live@1.0.0-rc.36/blocks/handler.ts"; -import { StateVTEX } from "https://denopkg.com/deco-sites/std@1.0.0-rc.9/commerce/vtex/types.ts"; export interface Props { title: string; From 4dc0bfd2e0efbeff7f77a392e5fa8db1877d10d9 Mon Sep 17 00:00:00 2001 From: Marcos Candeia Date: Wed, 5 Apr 2023 22:49:34 -0300 Subject: [PATCH 03/15] Generate only the necessary data Signed-off-by: Marcos Candeia --- schemas.gen.json | 29 ++--------------------------- sections/VtexProductShelf.tsx | 12 +++--------- 2 files changed, 5 insertions(+), 36 deletions(-) diff --git a/schemas.gen.json b/schemas.gen.json index 4851352a..72eee274 100644 --- a/schemas.gen.json +++ b/schemas.gen.json @@ -2602,7 +2602,7 @@ ], "title": "deco-sites/fashion/components/ui/BannerGrid.tsx@Props" }, - "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Z0ZXhQcm9kdWN0U2hlbGYudHN4@Props": { + "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@Props": { "type": "object", "properties": { "title": { @@ -2625,7 +2625,7 @@ "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Z0ZXhQcm9kdWN0U2hlbGYudHN4@Props&Props": { "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Z0ZXhQcm9kdWN0U2hlbGYudHN4@Props" + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@Props" }, { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@Props" @@ -2684,31 +2684,6 @@ ], "title": "deco-sites/fashion/components/search/SearchResult.tsx@Props" }, - "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@Props": { - "type": "object", - "properties": { - "title": { - "type": "string", - "title": "Title" - }, - "products": { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Product[]|null", - "title": "Products" - }, - "itemsPerPage": { - "type": [ - "number", - "null" - ], - "title": "Items Per Page" - } - }, - "required": [ - "title", - "products" - ], - "title": "deco-sites/fashion/components/product/ProductShelf.tsx@Props" - }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvZm9vdGVyL0Zvb3Rlci50c3g=@StringItem": { "type": "object", "properties": { diff --git a/sections/VtexProductShelf.tsx b/sections/VtexProductShelf.tsx index a58dba89..bc3d3073 100644 --- a/sections/VtexProductShelf.tsx +++ b/sections/VtexProductShelf.tsx @@ -2,18 +2,12 @@ import { HandlerContext } from "$fresh/src/server/types.ts"; import ProductShelf, { Props as ProductShelfProps, } from "deco-sites/fashion/components/product/ProductShelf.tsx"; -import { Product } from "deco-sites/std/commerce/types.ts"; import { StateVTEX } from "deco-sites/std/commerce/vtex/types.ts"; import loader, { Props as LoaderProps, } from "deco-sites/std/functions/vtexProductList.ts"; import { LiveConfig } from "https://denopkg.com/deco-cx/live@1.0.0-rc.36/blocks/handler.ts"; -export interface Props { - title: string; - itemsPerPage?: number; -} - function ProductShelfSection(props: ProductShelfProps) { return ; } @@ -22,11 +16,11 @@ export async function getProps( request: Request, ctx: HandlerContext< unknown, - LiveConfig + LiveConfig >, -): Promise { +): Promise> { const { data: products } = await loader(request, ctx, ctx.state.$live); - return { ...ctx.state.$live, products }; + return { products }; } export default ProductShelfSection; From cb40c0aca87be1fbfea5598699cb6df41616f66e Mon Sep 17 00:00:00 2001 From: Marcos Candeia Date: Thu, 6 Apr 2023 08:19:09 -0300 Subject: [PATCH 04/15] Product shelf POC Signed-off-by: Marcos Candeia --- schemas.gen.json | 8 +------- sections/VtexProductShelf.tsx | 4 ++-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/schemas.gen.json b/schemas.gen.json index 72eee274..4443492d 100644 --- a/schemas.gen.json +++ b/schemas.gen.json @@ -2605,10 +2605,6 @@ "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@Props": { "type": "object", "properties": { - "title": { - "type": "string", - "title": "Title" - }, "itemsPerPage": { "type": [ "number", @@ -2617,9 +2613,7 @@ "title": "Items Per Page" } }, - "required": [ - "title" - ], + "required": [], "title": "Props" }, "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Z0ZXhQcm9kdWN0U2hlbGYudHN4@Props&Props": { diff --git a/sections/VtexProductShelf.tsx b/sections/VtexProductShelf.tsx index bc3d3073..84307fd3 100644 --- a/sections/VtexProductShelf.tsx +++ b/sections/VtexProductShelf.tsx @@ -18,9 +18,9 @@ export async function getProps( unknown, LiveConfig >, -): Promise> { +): Promise> { const { data: products } = await loader(request, ctx, ctx.state.$live); - return { products }; + return { products, title: "Marcos Candeia" }; } export default ProductShelfSection; From 392eba5f429c28528ea19e09f01d3ea41dbee11c Mon Sep 17 00:00:00 2001 From: Marcos Candeia Date: Thu, 6 Apr 2023 10:13:57 -0300 Subject: [PATCH 05/15] deno task run Signed-off-by: Marcos Candeia --- schemas.gen.json | 52 ++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/schemas.gen.json b/schemas.gen.json index 4443492d..bfdc2651 100644 --- a/schemas.gen.json +++ b/schemas.gen.json @@ -2602,31 +2602,6 @@ ], "title": "deco-sites/fashion/components/ui/BannerGrid.tsx@Props" }, - "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@Props": { - "type": "object", - "properties": { - "itemsPerPage": { - "type": [ - "number", - "null" - ], - "title": "Items Per Page" - } - }, - "required": [], - "title": "Props" - }, - "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Z0ZXhQcm9kdWN0U2hlbGYudHN4@Props&Props": { - "allOf": [ - { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@Props" - }, - { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@Props" - } - ], - "title": "deco-sites/fashion/sections/VtexProductShelf.tsx@Props&Props" - }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvc2VhcmNoL1NlYXJjaFJlc3VsdC50c3g=@Props": { "type": "object", "properties": { @@ -2678,6 +2653,31 @@ ], "title": "deco-sites/fashion/components/search/SearchResult.tsx@Props" }, + "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@Props": { + "type": "object", + "properties": { + "title": { + "type": "string", + "title": "Title" + }, + "products": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Product[]|null", + "title": "Products" + }, + "itemsPerPage": { + "type": [ + "number", + "null" + ], + "title": "Items Per Page" + } + }, + "required": [ + "title", + "products" + ], + "title": "deco-sites/fashion/components/product/ProductShelf.tsx@Props" + }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvZm9vdGVyL0Zvb3Rlci50c3g=@StringItem": { "type": "object", "properties": { @@ -4381,7 +4381,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Z0ZXhQcm9kdWN0U2hlbGYudHN4@Props&Props" + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@Props" } ], "required": [ From cb9d2a5cef2ca13a4060aaaff656f72258dbde48 Mon Sep 17 00:00:00 2001 From: Marcos Candeia Date: Thu, 6 Apr 2023 14:51:32 -0300 Subject: [PATCH 06/15] Shopify or VTEX loader selector Signed-off-by: Marcos Candeia --- schemas.gen.json | 13 ++++++++++++- sections/VtexProductShelf.tsx | 22 ++++++++++++++++------ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/schemas.gen.json b/schemas.gen.json index bfdc2651..5cd1342b 100644 --- a/schemas.gen.json +++ b/schemas.gen.json @@ -2602,6 +2602,17 @@ ], "title": "deco-sites/fashion/components/ui/BannerGrid.tsx@Props" }, + "ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@Props|Props": { + "anyOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@Props" + }, + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@Props" + } + ], + "title": "deco-sites/std/functions/vtexProductList.ts@Props|Props" + }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvc2VhcmNoL1NlYXJjaFJlc3VsdC50c3g=@Props": { "type": "object", "properties": { @@ -4381,7 +4392,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@Props" + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@Props|Props" } ], "required": [ diff --git a/sections/VtexProductShelf.tsx b/sections/VtexProductShelf.tsx index 84307fd3..2a8b7d85 100644 --- a/sections/VtexProductShelf.tsx +++ b/sections/VtexProductShelf.tsx @@ -3,24 +3,34 @@ import ProductShelf, { Props as ProductShelfProps, } from "deco-sites/fashion/components/product/ProductShelf.tsx"; import { StateVTEX } from "deco-sites/std/commerce/vtex/types.ts"; -import loader, { - Props as LoaderProps, +import { + default as shopifyLoader, + default as vtexLoader, + Props as ShopifyLoaderProps, + Props as VtexLoaderProps, } from "deco-sites/std/functions/vtexProductList.ts"; import { LiveConfig } from "https://denopkg.com/deco-cx/live@1.0.0-rc.36/blocks/handler.ts"; function ProductShelfSection(props: ProductShelfProps) { return ; } - +export interface OtherProps { + props: string; +} export async function getProps( request: Request, ctx: HandlerContext< unknown, - LiveConfig + LiveConfig< + | VtexLoaderProps & { type: "VTEX" } + | ShopifyLoaderProps & { type: "Shopify" }, + StateVTEX + > >, -): Promise> { +): Promise> { + const loader = (ctx.state.$live.type === "VTEX") ? vtexLoader : shopifyLoader; const { data: products } = await loader(request, ctx, ctx.state.$live); - return { products, title: "Marcos Candeia" }; + return { products }; } export default ProductShelfSection; From f503f3d059a68d27adfda83022a7eb94897c8fd9 Mon Sep 17 00:00:00 2001 From: Marcos Candeia Date: Thu, 6 Apr 2023 16:00:15 -0300 Subject: [PATCH 07/15] Use new getprops func Signed-off-by: Marcos Candeia --- import_map.json | 2 +- live.gen.ts | 6 +- schemas.gen.json | 125 ++++++++++++++++++++++++++++-- sections/ProductShelfGetProps.tsx | 57 ++++++++++++++ sections/VtexProductShelf.tsx | 12 +-- 5 files changed, 185 insertions(+), 17 deletions(-) create mode 100644 sections/ProductShelfGetProps.tsx diff --git a/import_map.json b/import_map.json index 8f18dfd2..a855cf87 100644 --- a/import_map.json +++ b/import_map.json @@ -1,7 +1,7 @@ { "imports": { "$store/": "./", - "$live/": "https://denopkg.com/deco-cx/live@1793c3980d9244aac8da841a90da40dad5b37a68/", + "$live/": "https://denopkg.com/deco-cx/live@d3a5015ff57d586274cf7587f98659c9f2f18361/", "deco-sites/std/": "https://denopkg.com/deco-sites/std@1.0.0-rc.11/", "deco-sites/fashion/": "./", "partytown/": "https://deno.land/x/partytown@0.2.1/", diff --git a/live.gen.ts b/live.gen.ts index f0c55f27..c7f54326 100644 --- a/live.gen.ts +++ b/live.gen.ts @@ -31,7 +31,8 @@ import * as $$$$$$$$10 from "./sections/Header.tsx"; import * as $$$$$$$$11 from "./sections/ProductDetails.tsx"; import * as $$$$$$$$12 from "./sections/Highlights.tsx"; import * as $$$$$$$$13 from "./sections/WhatsApp.tsx"; -import * as $$$$$$$$14 from "./sections/Carousel.tsx"; +import * as $$$$$$$$14 from "./sections/ProductShelfGetProps.tsx"; +import * as $$$$$$$$15 from "./sections/Carousel.tsx"; import * as $live_middleware from "$live/routes/_middleware.ts"; import * as $live_workbench from "$live/routes/live/workbench.ts"; import * as $live_editorData from "$live/routes/live/editorData.ts"; @@ -125,7 +126,8 @@ const manifest: DecoManifest = { "deco-sites/fashion/sections/ProductDetails.tsx": $$$$$$$$11, "deco-sites/fashion/sections/Highlights.tsx": $$$$$$$$12, "deco-sites/fashion/sections/WhatsApp.tsx": $$$$$$$$13, - "deco-sites/fashion/sections/Carousel.tsx": $$$$$$$$14, + "deco-sites/fashion/sections/ProductShelfGetProps.tsx": $$$$$$$$14, + "deco-sites/fashion/sections/Carousel.tsx": $$$$$$$$15, "$live/sections/PageInclude.tsx": i2$$$9, "deco-sites/std/sections/configYourViews.global.tsx": i2$$$0, "deco-sites/std/sections/SEO.tsx": i2$$$1, diff --git a/schemas.gen.json b/schemas.gen.json index 5cd1342b..b4b4cad8 100644 --- a/schemas.gen.json +++ b/schemas.gen.json @@ -2602,16 +2602,36 @@ ], "title": "deco-sites/fashion/components/ui/BannerGrid.tsx@Props" }, - "ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@Props|Props": { - "anyOf": [ + "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@omitProps": { + "type": "object", + "properties": { + "title": { + "type": "string", + "title": "Title" + }, + "itemsPerPage": { + "type": [ + "number", + "null" + ], + "title": "Items Per Page" + } + }, + "required": [ + "title" + ], + "title": "omitProps" + }, + "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@Props&Props": { + "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@Props" + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@omitProps" }, { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@Props" } ], - "title": "deco-sites/std/functions/vtexProductList.ts@Props|Props" + "title": "deco-sites/fashion/components/product/ProductShelf.tsx@Props&Props" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvc2VhcmNoL1NlYXJjaFJlc3VsdC50c3g=@Props": { "type": "object", @@ -3166,6 +3186,77 @@ "required": [], "title": "deco-sites/fashion/components/ui/WhatsApp.tsx@Props" }, + "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@PlatformVTEX": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "VTEX", + "title": "Type", + "default": "VTEX" + } + }, + "required": [ + "type" + ], + "title": "PlatformVTEX" + }, + "ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@PlatformVTEX&Props": { + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@Props" + }, + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@PlatformVTEX" + } + ] + }, + "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@PlatformShopify": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "Shopify", + "title": "Type", + "default": "Shopify" + } + }, + "required": [ + "type" + ], + "title": "PlatformShopify" + }, + "ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Nob3BpZnlQcm9kdWN0TGlzdC50cw==@PlatformShopify&Props": { + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Nob3BpZnlQcm9kdWN0TGlzdC50cw==@Props" + }, + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@PlatformShopify" + } + ] + }, + "ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@PlatformShopify&Props|PlatformVTEX&Props": { + "anyOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@PlatformVTEX&Props" + }, + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Nob3BpZnlQcm9kdWN0TGlzdC50cw==@PlatformShopify&Props" + } + ] + }, + "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@Props&PlatformShopify&Props|PlatformVTEX&Props": { + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@omitProps" + }, + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@PlatformShopify&Props|PlatformVTEX&Props" + } + ], + "title": "deco-sites/fashion/components/product/ProductShelf.tsx@Props&PlatformShopify&Props|PlatformVTEX&Props" + }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvQmFubmVyQ2Fyb3VzZWwudHN4@Banner": { "type": "object", "properties": { @@ -4392,7 +4483,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@Props|Props" + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@Props&Props" } ], "required": [ @@ -4571,6 +4662,27 @@ } } }, + "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==": { + "title": "deco-sites/fashion/sections/ProductShelfGetProps.tsx", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@Props&PlatformShopify&Props|PlatformVTEX&Props" + } + ], + "required": [ + "__resolveType" + ], + "properties": { + "__resolveType": { + "type": "string", + "enum": [ + "deco-sites/fashion/sections/ProductShelfGetProps.tsx" + ], + "default": "deco-sites/fashion/sections/ProductShelfGetProps.tsx" + } + } + }, "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0Nhcm91c2VsLnRzeA==": { "title": "deco-sites/fashion/sections/Carousel.tsx", "type": "object", @@ -5216,6 +5328,9 @@ { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1doYXRzQXBwLnRzeA==" }, + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==" + }, { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0Nhcm91c2VsLnRzeA==" }, diff --git a/sections/ProductShelfGetProps.tsx b/sections/ProductShelfGetProps.tsx new file mode 100644 index 00000000..f371557a --- /dev/null +++ b/sections/ProductShelfGetProps.tsx @@ -0,0 +1,57 @@ +import { HandlerContext } from "$fresh/src/server/types.ts"; +import ProductShelf, { + Props as ProductShelfProps, +} from "deco-sites/fashion/components/product/ProductShelf.tsx"; +import { Segment } from "deco-sites/std/commerce/vtex/types.ts"; +import { + default as vtexLoader, + Props as VtexLoaderProps, +} from "deco-sites/std/functions/vtexProductList.ts"; + +import { ConfigShopify } from "deco-sites/std/commerce/shopify/client.ts"; +import { + default as shopifyLoader, + Props as ShopifyLoaderProps, +} from "deco-sites/std/functions/shopifyProductList.ts"; +import { ConfigVTEX } from "deco-sites/std/functions/vtexConfig.ts"; +import { LiveConfig } from "https://denopkg.com/deco-cx/live@1.0.0-rc.36/blocks/handler.ts"; +import { LiveState } from "../../live/types.ts"; + +function ProductShelfSection(props: ProductShelfProps) { + return ; +} +export interface OtherProps { + props: string; +} + +export interface PlatformVTEX { + /** + * @default VTEX + */ + type: "VTEX"; +} +export interface PlatformShopify { + /** + * @default Shopify + */ + type: "Shopify"; +} +export async function getProps( + request: Request, + ctx: HandlerContext< + unknown, + LiveConfig< + | VtexLoaderProps & PlatformVTEX + | ShopifyLoaderProps & PlatformShopify, + LiveState<{ configVTEX?: ConfigVTEX; configShopify: ConfigShopify }> & { + segment?: Partial; + } + > + >, +): Promise> { + const loader = (ctx.state.$live.type === "VTEX") ? vtexLoader : shopifyLoader; + const { data: products } = await loader(request, ctx, ctx.state.$live); + return { products }; +} + +export default ProductShelfSection; diff --git a/sections/VtexProductShelf.tsx b/sections/VtexProductShelf.tsx index 2a8b7d85..27ef0170 100644 --- a/sections/VtexProductShelf.tsx +++ b/sections/VtexProductShelf.tsx @@ -4,32 +4,26 @@ import ProductShelf, { } from "deco-sites/fashion/components/product/ProductShelf.tsx"; import { StateVTEX } from "deco-sites/std/commerce/vtex/types.ts"; import { - default as shopifyLoader, default as vtexLoader, - Props as ShopifyLoaderProps, Props as VtexLoaderProps, } from "deco-sites/std/functions/vtexProductList.ts"; + import { LiveConfig } from "https://denopkg.com/deco-cx/live@1.0.0-rc.36/blocks/handler.ts"; function ProductShelfSection(props: ProductShelfProps) { return ; } -export interface OtherProps { - props: string; -} export async function getProps( request: Request, ctx: HandlerContext< unknown, LiveConfig< - | VtexLoaderProps & { type: "VTEX" } - | ShopifyLoaderProps & { type: "Shopify" }, + VtexLoaderProps, StateVTEX > >, ): Promise> { - const loader = (ctx.state.$live.type === "VTEX") ? vtexLoader : shopifyLoader; - const { data: products } = await loader(request, ctx, ctx.state.$live); + const { data: products } = await vtexLoader(request, ctx, ctx.state.$live); return { products }; } From 7965114a0d3b6e62ac5d26bd45bf33242baa3231 Mon Sep 17 00:00:00 2001 From: Marcos Candeia Date: Thu, 6 Apr 2023 19:24:07 -0300 Subject: [PATCH 08/15] Support recursive types with live Signed-off-by: Marcos Candeia --- import_map.json | 2 +- schemas.gen.json | 447 ++++++++++++++++++++++++++---- sections/ProductShelfGetProps.tsx | 13 +- sections/VtexProductShelf.tsx | 7 +- 4 files changed, 413 insertions(+), 56 deletions(-) diff --git a/import_map.json b/import_map.json index a855cf87..44392643 100644 --- a/import_map.json +++ b/import_map.json @@ -1,7 +1,7 @@ { "imports": { "$store/": "./", - "$live/": "https://denopkg.com/deco-cx/live@d3a5015ff57d586274cf7587f98659c9f2f18361/", + "$live/": "https://denopkg.com/deco-cx/live@2824c859d9cdad55ff78bcbc8b4a4d31ef29e1e3/", "deco-sites/std/": "https://denopkg.com/deco-sites/std@1.0.0-rc.11/", "deco-sites/fashion/": "./", "partytown/": "https://deno.land/x/partytown@0.2.1/", diff --git a/schemas.gen.json b/schemas.gen.json index b4b4cad8..0277cb51 100644 --- a/schemas.gen.json +++ b/schemas.gen.json @@ -59,8 +59,174 @@ } ] }, + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ImageObject": { + "type": "object", + "allOf": [ + {} + ], + "properties": { + "@type": { + "type": "string", + "const": "ImageObject", + "title": "@type" + } + }, + "required": [ + "@type" + ], + "title": "ImageObject" + }, + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ImageObject[]": { + "type": "array", + "items": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ImageObject" + } + }, + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing": { + "type": "object", + "properties": { + "@id": { + "type": [ + "string", + "null" + ], + "title": "@id" + }, + "additionalType": { + "type": [ + "string", + "null" + ], + "title": "Additional Type" + }, + "alternateName": { + "type": [ + "string", + "null" + ], + "title": "Alternate Name" + }, + "description": { + "type": [ + "string", + "null" + ], + "title": "Description" + }, + "disambiguatingDescription": { + "type": [ + "string", + "null" + ], + "title": "Disambiguating Description" + }, + "identifier": { + "type": [ + "string", + "null" + ], + "title": "Identifier" + }, + "image": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ImageObject[]", + "title": "Image" + }, + "name": { + "type": [ + "string", + "null" + ], + "title": "Name" + }, + "sameAs": { + "type": [ + "string", + "null" + ], + "title": "Same As" + }, + "subjectOf": { + "type": [ + "string", + "null" + ], + "title": "Subject Of" + }, + "url": { + "type": [ + "string", + "null" + ], + "title": "Url" + } + }, + "required": [], + "title": "omitQHR5cGU=Thing" + }, + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ListItem": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing" + } + ], + "properties": { + "@type": { + "type": "string", + "const": "ListItem", + "title": "@type" + }, + "item": { + "title": "Item" + }, + "position": { + "type": "number", + "title": "Position" + } + }, + "required": [ + "@type", + "item", + "position" + ], + "title": "ListItem" + }, + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ListItem[]": { + "type": "array", + "items": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ListItem" + } + }, + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=ItemList": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing" + } + ], + "properties": { + "itemListElement": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ListItem[]", + "title": "Item List Element" + }, + "numberOfItems": { + "type": "number", + "title": "Number Of Items" + } + }, + "required": [ + "itemListElement", + "numberOfItems" + ], + "title": "omitQHR5cGU=ItemList" + }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@BreadcrumbList": { "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=ItemList" + } + ], "properties": { "@type": { "type": "string", @@ -219,6 +385,11 @@ }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@PropertyValue": { "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing" + } + ], "properties": { "@type": { "type": "string", @@ -321,70 +492,56 @@ ], "title": "AggregateRating" }, - "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf": { - "type": "object", - "properties": {}, - "required": [], - "title": "ProductLeaf" - }, - "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf[]": { - "type": "array", - "items": { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf" - } - }, - "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductGroup": { + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@QuantitativeValue": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "ProductGroup", - "title": "@type" - }, - "hasVariant": { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf[]", - "title": "Has Variant" - }, - "productGroupID": { - "type": "string", - "title": "Product Group I D" - }, - "additionalProperty": { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@PropertyValue[]", - "title": "Additional Property" - }, - "model": { + "value": { "type": [ - "string", + "number", "null" ], - "title": "Model" + "title": "Value" } }, - "required": [ - "@type", - "hasVariant", - "productGroupID", - "additionalProperty" - ], - "title": "ProductGroup" + "required": [], + "title": "QuantitativeValue" }, - "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@QuantitativeValue": { + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=PriceSpecification": { "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing" + } + ], "properties": { - "value": { + "eligibleQuantity": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@QuantitativeValue", + "title": "Eligible Quantity" + }, + "price": { + "type": "number", + "title": "Price" + }, + "priceCurrency": { "type": [ - "number", + "string", "null" ], - "title": "Value" + "title": "Price Currency" } }, - "required": [], - "title": "QuantitativeValue" + "required": [ + "price" + ], + "title": "omitQHR5cGU=PriceSpecification" }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@UnitPriceSpecification": { "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=PriceSpecification" + } + ], "properties": { "@type": { "type": "string", @@ -480,6 +637,11 @@ }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Offer": { "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing" + } + ], "properties": { "@type": { "type": "string", @@ -653,6 +815,11 @@ }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Review": { "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing" + } + ], "properties": { "@type": { "type": "string", @@ -704,8 +871,165 @@ ], "title": "Review" }, + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitaXNWYXJpYW50T2Y=Product": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing" + } + ], + "properties": { + "@type": { + "type": "string", + "const": "Product", + "title": "@type" + }, + "additionalProperty": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@PropertyValue[]", + "title": "Additional Property" + }, + "aggregateRating": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@AggregateRating", + "title": "Aggregate Rating" + }, + "award": { + "type": [ + "string", + "null" + ], + "title": "Award" + }, + "brand": { + "type": [ + "string", + "null" + ], + "title": "Brand" + }, + "category": { + "type": [ + "string", + "null" + ], + "title": "Category" + }, + "gtin": { + "type": [ + "string", + "null" + ], + "title": "Gtin" + }, + "inProductGroupWithID": { + "type": [ + "string", + "null" + ], + "title": "In Product Group With I D" + }, + "offers": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@AggregateOffer", + "title": "Offers" + }, + "productID": { + "type": "string", + "title": "Product I D" + }, + "productionDate": { + "type": [ + "string", + "null" + ], + "title": "Production Date" + }, + "releaseDate": { + "type": [ + "string", + "null" + ], + "title": "Release Date" + }, + "review": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Review", + "title": "Review" + }, + "sku": { + "type": "string", + "title": "Sku" + } + }, + "required": [ + "@type", + "productID", + "sku" + ], + "title": "omitaXNWYXJpYW50T2Y=Product" + }, + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitaXNWYXJpYW50T2Y=Product" + } + ], + "properties": {}, + "required": [], + "title": "ProductLeaf" + }, + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf[]": { + "type": "array", + "items": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf" + } + }, + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductGroup": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing" + } + ], + "properties": { + "@type": { + "type": "string", + "const": "ProductGroup", + "title": "@type" + }, + "hasVariant": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf[]", + "title": "Has Variant" + }, + "productGroupID": { + "type": "string", + "title": "Product Group I D" + }, + "additionalProperty": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@PropertyValue[]", + "title": "Additional Property" + }, + "model": { + "type": [ + "string", + "null" + ], + "title": "Model" + } + }, + "required": [ + "@type", + "hasVariant", + "productGroupID", + "additionalProperty" + ], + "title": "ProductGroup" + }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Product": { "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing" + } + ], "properties": { "@type": { "type": "string", @@ -3186,6 +3510,30 @@ "required": [], "title": "deco-sites/fashion/components/ui/WhatsApp.tsx@Props" }, + "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@Category": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "children": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@Category[]", + "title": "Children" + } + }, + "required": [ + "name", + "children" + ], + "title": "Category" + }, + "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@Category[]": { + "type": "array", + "items": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@Category" + } + }, "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@PlatformVTEX": { "type": "object", "properties": { @@ -3194,10 +3542,15 @@ "const": "VTEX", "title": "Type", "default": "VTEX" + }, + "category": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@Category", + "title": "Category" } }, "required": [ - "type" + "type", + "category" ], "title": "PlatformVTEX" }, diff --git a/sections/ProductShelfGetProps.tsx b/sections/ProductShelfGetProps.tsx index f371557a..86b6a23f 100644 --- a/sections/ProductShelfGetProps.tsx +++ b/sections/ProductShelfGetProps.tsx @@ -1,4 +1,4 @@ -import { HandlerContext } from "$fresh/src/server/types.ts"; +import { LoaderContext } from "$live/types.ts"; import ProductShelf, { Props as ProductShelfProps, } from "deco-sites/fashion/components/product/ProductShelf.tsx"; @@ -24,11 +24,17 @@ export interface OtherProps { props: string; } +export interface Category { + name: string; + children: Category[]; +} + export interface PlatformVTEX { /** * @default VTEX */ type: "VTEX"; + category: Category; } export interface PlatformShopify { /** @@ -36,10 +42,9 @@ export interface PlatformShopify { */ type: "Shopify"; } -export async function getProps( +export async function loadData( request: Request, - ctx: HandlerContext< - unknown, + ctx: LoaderContext< LiveConfig< | VtexLoaderProps & PlatformVTEX | ShopifyLoaderProps & PlatformShopify, diff --git a/sections/VtexProductShelf.tsx b/sections/VtexProductShelf.tsx index 27ef0170..2d32da94 100644 --- a/sections/VtexProductShelf.tsx +++ b/sections/VtexProductShelf.tsx @@ -1,4 +1,4 @@ -import { HandlerContext } from "$fresh/src/server/types.ts"; +import { LoaderContext } from "$live/types.ts"; import ProductShelf, { Props as ProductShelfProps, } from "deco-sites/fashion/components/product/ProductShelf.tsx"; @@ -13,10 +13,9 @@ import { LiveConfig } from "https://denopkg.com/deco-cx/live@1.0.0-rc.36/blocks/ function ProductShelfSection(props: ProductShelfProps) { return ; } -export async function getProps( +export async function loadData( request: Request, - ctx: HandlerContext< - unknown, + ctx: LoaderContext< LiveConfig< VtexLoaderProps, StateVTEX From ae9a4044ef8809fa85cd924ff79cd3487d55d38c Mon Sep 17 00:00:00 2001 From: Marcos Candeia Date: Fri, 7 Apr 2023 17:43:19 -0300 Subject: [PATCH 09/15] Use resolve props method Signed-off-by: Marcos Candeia --- import_map.json | 2 +- live.gen.ts | 26 +- loaders/dogApiFacts.ts | 21 + schemas.gen.json | 1110 ++++++++++++++--------------- sections/DogFacts.tsx | 33 + sections/ProductShelfGetProps.tsx | 13 +- sections/VtexProductShelf.tsx | 30 +- 7 files changed, 632 insertions(+), 603 deletions(-) create mode 100644 loaders/dogApiFacts.ts create mode 100644 sections/DogFacts.tsx diff --git a/import_map.json b/import_map.json index 44392643..5c9c39a0 100644 --- a/import_map.json +++ b/import_map.json @@ -1,7 +1,7 @@ { "imports": { "$store/": "./", - "$live/": "https://denopkg.com/deco-cx/live@2824c859d9cdad55ff78bcbc8b4a4d31ef29e1e3/", + "$live/": "https://denopkg.com/deco-cx/live.ts@79d8dc23dd40fa5af25947bf9c9676c33a0ec32d/", "deco-sites/std/": "https://denopkg.com/deco-sites/std@1.0.0-rc.11/", "deco-sites/fashion/": "./", "partytown/": "https://deno.land/x/partytown@0.2.1/", diff --git a/live.gen.ts b/live.gen.ts index c7f54326..eb3a2576 100644 --- a/live.gen.ts +++ b/live.gen.ts @@ -5,6 +5,7 @@ import config from "./deno.json" assert { type: "json" }; import { DecoManifest } from "$live/types.ts"; +import * as $$$0 from "./loaders/dogApiFacts.ts"; import * as $$$$0 from "./routes/api/[...catchall].tsx"; import * as $$$$1 from "./routes/_app.tsx"; import * as $$$$$0 from "./islands/ShippingSimulation.tsx"; @@ -28,11 +29,12 @@ import * as $$$$$$$$7 from "./sections/ProductShelf.tsx"; import * as $$$$$$$$8 from "./sections/Footer.tsx"; import * as $$$$$$$$9 from "./sections/CookieConsent.tsx"; import * as $$$$$$$$10 from "./sections/Header.tsx"; -import * as $$$$$$$$11 from "./sections/ProductDetails.tsx"; -import * as $$$$$$$$12 from "./sections/Highlights.tsx"; -import * as $$$$$$$$13 from "./sections/WhatsApp.tsx"; -import * as $$$$$$$$14 from "./sections/ProductShelfGetProps.tsx"; -import * as $$$$$$$$15 from "./sections/Carousel.tsx"; +import * as $$$$$$$$11 from "./sections/DogFacts.tsx"; +import * as $$$$$$$$12 from "./sections/ProductDetails.tsx"; +import * as $$$$$$$$13 from "./sections/Highlights.tsx"; +import * as $$$$$$$$14 from "./sections/WhatsApp.tsx"; +import * as $$$$$$$$15 from "./sections/ProductShelfGetProps.tsx"; +import * as $$$$$$$$16 from "./sections/Carousel.tsx"; import * as $live_middleware from "$live/routes/_middleware.ts"; import * as $live_workbench from "$live/routes/live/workbench.ts"; import * as $live_editorData from "$live/routes/live/editorData.ts"; @@ -88,6 +90,9 @@ import * as i2$$$7 from "deco-sites/std/sections/configVTEX.global.tsx"; import * as i2$$$8 from "deco-sites/std/sections/SEOPDP.tsx"; const manifest: DecoManifest = { + "loaders": { + "deco-sites/fashion/loaders/dogApiFacts.ts": $$$0, + }, "routes": { "./routes/api/[...catchall].tsx": $$$$0, "./routes/_app.tsx": $$$$1, @@ -123,11 +128,12 @@ const manifest: DecoManifest = { "deco-sites/fashion/sections/Footer.tsx": $$$$$$$$8, "deco-sites/fashion/sections/CookieConsent.tsx": $$$$$$$$9, "deco-sites/fashion/sections/Header.tsx": $$$$$$$$10, - "deco-sites/fashion/sections/ProductDetails.tsx": $$$$$$$$11, - "deco-sites/fashion/sections/Highlights.tsx": $$$$$$$$12, - "deco-sites/fashion/sections/WhatsApp.tsx": $$$$$$$$13, - "deco-sites/fashion/sections/ProductShelfGetProps.tsx": $$$$$$$$14, - "deco-sites/fashion/sections/Carousel.tsx": $$$$$$$$15, + "deco-sites/fashion/sections/DogFacts.tsx": $$$$$$$$11, + "deco-sites/fashion/sections/ProductDetails.tsx": $$$$$$$$12, + "deco-sites/fashion/sections/Highlights.tsx": $$$$$$$$13, + "deco-sites/fashion/sections/WhatsApp.tsx": $$$$$$$$14, + "deco-sites/fashion/sections/ProductShelfGetProps.tsx": $$$$$$$$15, + "deco-sites/fashion/sections/Carousel.tsx": $$$$$$$$16, "$live/sections/PageInclude.tsx": i2$$$9, "deco-sites/std/sections/configYourViews.global.tsx": i2$$$0, "deco-sites/std/sections/SEO.tsx": i2$$$1, diff --git a/loaders/dogApiFacts.ts b/loaders/dogApiFacts.ts new file mode 100644 index 00000000..9926a2c5 --- /dev/null +++ b/loaders/dogApiFacts.ts @@ -0,0 +1,21 @@ +import type { LoaderContext } from "$live/types.ts"; + +// Return type of this loader +export interface DogFact { + fact: string; +} + +// Props type that will be configured in deco.cx's Admin +export interface Props { + numberOfFacts?: number; +} + +export default async function dogApiFacts( + _req: Request, + { state: { $live: { numberOfFacts } } }: LoaderContext, +): Promise { + const { facts } = (await fetch( + `https://dogapi.dog/api/facts?number=${numberOfFacts ?? 1}`, + ).then((r) => r.json())) as { facts: string[] }; + return facts.map((fact) => ({ fact })); +} diff --git a/schemas.gen.json b/schemas.gen.json index 0277cb51..653f1b65 100644 --- a/schemas.gen.json +++ b/schemas.gen.json @@ -59,115 +59,12 @@ } ] }, - "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ImageObject": { - "type": "object", - "allOf": [ - {} - ], - "properties": { - "@type": { - "type": "string", - "const": "ImageObject", - "title": "@type" - } - }, - "required": [ - "@type" - ], - "title": "ImageObject" - }, - "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ImageObject[]": { - "type": "array", - "items": { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ImageObject" - } - }, - "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing": { - "type": "object", - "properties": { - "@id": { - "type": [ - "string", - "null" - ], - "title": "@id" - }, - "additionalType": { - "type": [ - "string", - "null" - ], - "title": "Additional Type" - }, - "alternateName": { - "type": [ - "string", - "null" - ], - "title": "Alternate Name" - }, - "description": { - "type": [ - "string", - "null" - ], - "title": "Description" - }, - "disambiguatingDescription": { - "type": [ - "string", - "null" - ], - "title": "Disambiguating Description" - }, - "identifier": { - "type": [ - "string", - "null" - ], - "title": "Identifier" - }, - "image": { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ImageObject[]", - "title": "Image" - }, - "name": { - "type": [ - "string", - "null" - ], - "title": "Name" - }, - "sameAs": { - "type": [ - "string", - "null" - ], - "title": "Same As" - }, - "subjectOf": { - "type": [ - "string", - "null" - ], - "title": "Subject Of" - }, - "url": { - "type": [ - "string", - "null" - ], - "title": "Url" - } - }, - "required": [], - "title": "omitQHR5cGU=Thing" - }, + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Thing": {}, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ListItem": { "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing" + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Thing" } ], "properties": { @@ -201,7 +98,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing" + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Thing" } ], "properties": { @@ -347,7 +244,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@FilterBase" + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@FilterRange" } ], "properties": { @@ -383,6 +280,112 @@ "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@FilterRange|FilterToggle" } }, + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ImageObject": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Thing" + } + ], + "properties": { + "@type": { + "type": "string", + "const": "ImageObject", + "title": "@type" + } + }, + "required": [ + "@type" + ], + "title": "ImageObject" + }, + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ImageObject[]": { + "type": "array", + "items": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ImageObject" + } + }, + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing": { + "type": "object", + "properties": { + "@id": { + "type": [ + "string", + "null" + ], + "title": "@id" + }, + "additionalType": { + "type": [ + "string", + "null" + ], + "title": "Additional Type" + }, + "alternateName": { + "type": [ + "string", + "null" + ], + "title": "Alternate Name" + }, + "description": { + "type": [ + "string", + "null" + ], + "title": "Description" + }, + "disambiguatingDescription": { + "type": [ + "string", + "null" + ], + "title": "Disambiguating Description" + }, + "identifier": { + "type": [ + "string", + "null" + ], + "title": "Identifier" + }, + "image": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ImageObject[]", + "title": "Image" + }, + "name": { + "type": [ + "string", + "null" + ], + "title": "Name" + }, + "sameAs": { + "type": [ + "string", + "null" + ], + "title": "Same As" + }, + "subjectOf": { + "type": [ + "string", + "null" + ], + "title": "Subject Of" + }, + "url": { + "type": [ + "string", + "null" + ], + "title": "Url" + } + }, + "required": [], + "title": "omitQHR5cGU=Thing" + }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@PropertyValue": { "type": "object", "allOf": [ @@ -492,6 +495,67 @@ ], "title": "AggregateRating" }, + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Product" + } + ], + "properties": {}, + "required": [], + "title": "ProductLeaf" + }, + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf[]": { + "type": "array", + "items": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf" + } + }, + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductGroup": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Thing" + } + ], + "properties": { + "@type": { + "type": "string", + "const": "ProductGroup", + "title": "@type" + }, + "hasVariant": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf[]", + "title": "Has Variant" + }, + "productGroupID": { + "type": "string", + "title": "Product Group I D" + }, + "additionalProperty": { + "type": "array", + "items": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@PropertyValue" + }, + "title": "Additional Property" + }, + "model": { + "type": [ + "string", + "null" + ], + "title": "Model" + } + }, + "required": [ + "@type", + "hasVariant", + "productGroupID", + "additionalProperty" + ], + "title": "ProductGroup" + }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@QuantitativeValue": { "type": "object", "properties": { @@ -510,7 +574,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing" + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Thing" } ], "properties": { @@ -639,7 +703,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing" + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Thing" } ], "properties": { @@ -817,7 +881,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing" + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Thing" } ], "properties": { @@ -826,202 +890,50 @@ "const": "Review", "title": "@type" }, - "itemReviewed": { - "type": [ - "string", - "null" - ], - "title": "Item Reviewed" - }, - "negativeNotes": { - "type": "array", - "items": { - "type": "string" - }, - "title": "Negative Notes" - }, - "positiveNotes": { - "type": "array", - "items": { - "type": "string" - }, - "title": "Positive Notes" - }, - "reviewAspect": { - "type": [ - "string", - "null" - ], - "title": "Review Aspect" - }, - "reviewBody": { - "type": [ - "string", - "null" - ], - "title": "Review Body" - }, - "reviewRating": { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@AggregateRating", - "title": "Review Rating" - } - }, - "required": [ - "@type" - ], - "title": "Review" - }, - "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitaXNWYXJpYW50T2Y=Product": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing" - } - ], - "properties": { - "@type": { - "type": "string", - "const": "Product", - "title": "@type" - }, - "additionalProperty": { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@PropertyValue[]", - "title": "Additional Property" - }, - "aggregateRating": { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@AggregateRating", - "title": "Aggregate Rating" - }, - "award": { - "type": [ - "string", - "null" - ], - "title": "Award" - }, - "brand": { - "type": [ - "string", - "null" - ], - "title": "Brand" - }, - "category": { - "type": [ - "string", - "null" - ], - "title": "Category" - }, - "gtin": { - "type": [ - "string", - "null" - ], - "title": "Gtin" - }, - "inProductGroupWithID": { - "type": [ - "string", - "null" - ], - "title": "In Product Group With I D" - }, - "offers": { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@AggregateOffer", - "title": "Offers" - }, - "productID": { - "type": "string", - "title": "Product I D" - }, - "productionDate": { - "type": [ - "string", - "null" - ], - "title": "Production Date" - }, - "releaseDate": { - "type": [ - "string", - "null" - ], - "title": "Release Date" - }, - "review": { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Review", - "title": "Review" - }, - "sku": { - "type": "string", - "title": "Sku" - } - }, - "required": [ - "@type", - "productID", - "sku" - ], - "title": "omitaXNWYXJpYW50T2Y=Product" - }, - "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitaXNWYXJpYW50T2Y=Product" - } - ], - "properties": {}, - "required": [], - "title": "ProductLeaf" - }, - "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf[]": { - "type": "array", - "items": { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf" - } - }, - "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductGroup": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing" - } - ], - "properties": { - "@type": { - "type": "string", - "const": "ProductGroup", - "title": "@type" - }, - "hasVariant": { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf[]", - "title": "Has Variant" + "itemReviewed": { + "type": [ + "string", + "null" + ], + "title": "Item Reviewed" }, - "productGroupID": { - "type": "string", - "title": "Product Group I D" + "negativeNotes": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Negative Notes" }, - "additionalProperty": { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@PropertyValue[]", - "title": "Additional Property" + "positiveNotes": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Positive Notes" }, - "model": { + "reviewAspect": { "type": [ "string", "null" ], - "title": "Model" + "title": "Review Aspect" + }, + "reviewBody": { + "type": [ + "string", + "null" + ], + "title": "Review Body" + }, + "reviewRating": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@AggregateRating", + "title": "Review Rating" } }, "required": [ - "@type", - "hasVariant", - "productGroupID", - "additionalProperty" + "@type" ], - "title": "ProductGroup" + "title": "Review" }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Product": { "type": "object", @@ -1327,8 +1239,8 @@ "string", "null" ], - "title": "Query", - "description": "overides the query term" + "description": "overides the query term", + "title": "Query" }, "count": { "type": "number", @@ -1482,24 +1394,24 @@ "properties": { "limit": { "type": "number", - "title": "Limit", - "description": "total number of items to display" + "description": "total number of items to display", + "title": "Limit" }, "term": { "type": [ "string", "null" ], - "title": "Term", - "description": "query to use on search" + "description": "query to use on search", + "title": "Term" }, "wildcard": { "type": [ "boolean", "null" ], - "title": "Wildcard", - "description": "search for term anywhere" + "description": "search for term anywhere", + "title": "Wildcard" }, "sort": { "anyOf": [ @@ -1521,16 +1433,16 @@ } ], "type": "string", - "title": "Sort", - "description": "search sort parameter" + "description": "search sort parameter", + "title": "Sort" }, "tags": { "type": "array", "items": { "type": "string" }, - "title": "Tags", - "description": "search for products that have certain tag" + "description": "search for products that have certain tag", + "title": "Tags" } }, "required": [ @@ -1731,9 +1643,9 @@ "number", "null" ], - "title": "Count", "description": "limit the number of searches", - "default": "4" + "default": "4", + "title": "Count" } }, "required": [], @@ -1845,9 +1757,9 @@ "number", "null" ], - "title": "Levels", "description": "Number of levels of categories to be returned", - "default": "2" + "default": "2", + "title": "Levels" } }, "required": [], @@ -1861,8 +1773,8 @@ "string", "null" ], - "title": "Query", - "description": "overides the query term" + "description": "overides the query term", + "title": "Query" }, "count": { "type": "number", @@ -1880,13 +1792,13 @@ "properties": { "query": { "type": "string", - "title": "Query", - "description": "query to use on search" + "description": "query to use on search", + "title": "Query" }, "count": { "type": "number", - "title": "Count", - "description": "total number of items to display" + "description": "total number of items to display", + "title": "Count" }, "sort": { "anyOf": [ @@ -1924,17 +1836,17 @@ } ], "type": "string", - "title": "Sort", - "description": "search sort parameter" + "description": "search sort parameter", + "title": "Sort" }, "collection": { "type": "array", "items": { "type": "string" }, - "title": "Collection", "description": "Collection ID or (Product Cluster id). For more info: https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/search .", - "pattern": "\\d*" + "pattern": "\\d*", + "title": "Collection" } }, "required": [ @@ -1951,16 +1863,16 @@ "string", "null" ], - "title": "Term", - "description": "overides the query term" + "description": "overides the query term", + "title": "Term" }, "tags": { "type": "array", "items": { "type": "string" }, - "title": "Tags", - "description": "filter products by tag" + "description": "filter products by tag", + "title": "Tags" }, "count": { "type": "number", @@ -1981,8 +1893,8 @@ "string", "null" ], - "title": "Term", - "description": "overides the query term" + "description": "overides the query term", + "title": "Term" }, "count": { "type": "number", @@ -1994,8 +1906,8 @@ "string", "null" ], - "title": "Ft", - "description": "FullText term" + "description": "FullText term", + "title": "Ft" }, "fq": { "type": [ @@ -2009,8 +1921,8 @@ "string", "null" ], - "title": "Map", - "description": "map param" + "description": "map param", + "title": "Map" } }, "required": [ @@ -2023,13 +1935,13 @@ "properties": { "query": { "type": "string", - "title": "Query", - "description": "query to use on search" + "description": "query to use on search", + "title": "Query" }, "count": { "type": "number", - "title": "Count", - "description": "total number of items to display" + "description": "total number of items to display", + "title": "Count" }, "sort": { "anyOf": [ @@ -2067,17 +1979,17 @@ } ], "type": "string", - "title": "Sort", - "description": "search sort parameter" + "description": "search sort parameter", + "title": "Sort" }, "collection": { "type": "array", "items": { "type": "string" }, - "title": "Collection", "description": "Collection ID or (Product Cluster id). For more info: https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/search .", - "pattern": "\\d*" + "pattern": "\\d*", + "title": "Collection" } }, "required": [ @@ -2091,13 +2003,13 @@ "properties": { "query": { "type": "string", - "title": "Query", - "description": "search term to use on search" + "description": "search term to use on search", + "title": "Query" }, "count": { "type": "number", - "title": "Count", - "description": "total number of items to display" + "description": "total number of items to display", + "title": "Count" } }, "required": [ @@ -2169,24 +2081,24 @@ "properties": { "domain": { "type": "string", - "title": "Domain", - "description": "Your VNDA domain name. For example, https://mystore.vnda.com.br" + "description": "Your VNDA domain name. For example, https://mystore.vnda.com.br", + "title": "Domain" }, "authToken": { "type": "string", - "title": "Auth Token", - "description": "The token generated from admin panel. Read here: https://developers.vnda.com.br/docs/chave-de-acesso-e-requisicoes. Do not add any other permissions than catalog." + "description": "The token generated from admin panel. Read here: https://developers.vnda.com.br/docs/chave-de-acesso-e-requisicoes. Do not add any other permissions than catalog.", + "title": "Auth Token" }, "useSandbox": { "type": "boolean", - "title": "Use Sandbox", - "description": "Define if sandbox environment should be used" + "description": "Define if sandbox environment should be used", + "title": "Use Sandbox" }, "defaultPriceCurrency": { "type": "string", - "title": "Default Price Currency", "description": "Default price currency.", - "default": "USD" + "default": "USD", + "title": "Default Price Currency" } }, "required": [ @@ -2215,7 +2127,7 @@ ], "title": "deco-sites/std/commerce/yourViews/client.ts@ConfigYourViews" }, - "ZGVjby1jeC9saXZlL2Jsb2Nrcy9hY2NvdW50LnRz@Account": { + "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9hY2NvdW50LnRz@Account": { "type": "object", "properties": {}, "required": [], @@ -2225,30 +2137,30 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2Jsb2Nrcy9hY2NvdW50LnRz@Account" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9hY2NvdW50LnRz@Account" } ], "properties": { "account": { "type": "string", - "title": "Account", - "description": "VTEX Account name. For more info, read here: https://help.vtex.com/en/tutorial/o-que-e-account-name--i0mIGLcg3QyEy8OCicEoC." + "description": "VTEX Account name. For more info, read here: https://help.vtex.com/en/tutorial/o-que-e-account-name--i0mIGLcg3QyEy8OCicEoC.", + "title": "Account" }, "defaultLocale": { "type": "string", - "title": "Default Locale", - "description": "Locale used for VTEX Intelligent Search client." + "description": "Locale used for VTEX Intelligent Search client.", + "title": "Default Locale" }, "defaultPriceCurrency": { "type": "string", - "title": "Default Price Currency", "description": "Default price currency.", - "default": "USD" + "default": "USD", + "title": "Default Price Currency" }, "defaultSalesChannel": { "type": "string", - "title": "Default Sales Channel", - "description": "VTEX sales channel. This will be the default sales channel your site. For more info, read here: https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV" + "description": "VTEX sales channel. This will be the default sales channel your site. For more info, read here: https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV", + "title": "Default Sales Channel" }, "defaultRegionId": { "type": [ @@ -2277,19 +2189,19 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2Jsb2Nrcy9hY2NvdW50LnRz@Account" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9hY2NvdW50LnRz@Account" } ], "properties": { "storeName": { "type": "string", - "title": "Store Name", - "description": "Shopify store name." + "description": "Shopify store name.", + "title": "Store Name" }, "storefrontAccessToken": { "type": "string", - "title": "Storefront Access Token", - "description": "Shopify storefront access token." + "description": "Shopify storefront access token.", + "title": "Storefront Access Token" } }, "required": [ @@ -2302,7 +2214,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2Jsb2Nrcy9hY2NvdW50LnRz@Account" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9hY2NvdW50LnRz@Account" } ], "properties": { @@ -2323,6 +2235,68 @@ ], "title": "deco-sites/std/commerce/occ/client.ts@ConfigOCC" }, + "ZGVjby1zaXRlcy9mYXNoaW9uL2xvYWRlcnMvZG9nQXBpRmFjdHMudHM=@DogFact": { + "type": "object", + "properties": { + "fact": { + "type": "string", + "title": "Fact" + } + }, + "required": [ + "fact" + ], + "title": "DogFact" + }, + "ZGVjby1zaXRlcy9mYXNoaW9uL2xvYWRlcnMvZG9nQXBpRmFjdHMudHM=@DogFact[]": { + "anyOf": [ + { + "$ref": "#/definitions/Resolvable" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2xvYWRlcnMvZG9nQXBpRmFjdHMudHM=@DogFact" + }, + "title": "deco-sites/fashion/loaders/dogApiFacts.ts@DogFact[]" + }, + { + "title": "deco-sites/fashion/loaders/dogApiFacts.ts", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2xvYWRlcnMvZG9nQXBpRmFjdHMudHM=@Props" + } + ], + "required": [ + "__resolveType" + ], + "properties": { + "__resolveType": { + "type": "string", + "enum": [ + "deco-sites/fashion/loaders/dogApiFacts.ts" + ], + "default": "deco-sites/fashion/loaders/dogApiFacts.ts" + } + } + } + ] + }, + "ZGVjby1zaXRlcy9mYXNoaW9uL2xvYWRlcnMvZG9nQXBpRmFjdHMudHM=@Props": { + "type": "object", + "properties": { + "numberOfFacts": { + "type": [ + "number", + "null" + ], + "title": "Number Of Facts" + } + }, + "required": [], + "title": "deco-sites/fashion/loaders/dogApiFacts.ts@Props" + }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdnRleC90eXBlcy50cw==@SKU": { "type": "object", "properties": { @@ -2362,39 +2336,39 @@ ], "title": "deco-sites/fashion/components/ui/ShippingSimulation.tsx@Props" }, - "ZGVjby1jeC9saXZlL2Jsb2Nrcy9mbGFnLnRz@Flag": { + "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9mbGFnLnRz@Flag": { "$ref": "#/root/flags" }, - "ZGVjby1jeC9saXZlL2Jsb2Nrcy9mbGFnLnRz@Flag[]": { + "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9mbGFnLnRz@Flag[]": { "type": "array", "items": { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2Jsb2Nrcy9mbGFnLnRz@Flag" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9mbGFnLnRz@Flag" } }, - "ZGVjby1jeC9saXZlL2hhbmRsZXJzL3JvdXRlc1NlbGVjdGlvbi50cw==@SelectionConfig": { + "ZGVjby1jeC9saXZlLnRzL2hhbmRsZXJzL3JvdXRlc1NlbGVjdGlvbi50cw==@SelectionConfig": { "type": "object", "properties": { "flags": { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2Jsb2Nrcy9mbGFnLnRz@Flag[]", + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9mbGFnLnRz@Flag[]", "title": "Flags" } }, "required": [ "flags" ], - "title": "deco-cx/live/handlers/routesSelection.ts@SelectionConfig" + "title": "deco-cx/live.ts/handlers/routesSelection.ts@SelectionConfig" }, - "ZGVjby1jeC9saXZlL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler": { + "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler": { "$ref": "#/root/handlers" }, - "ZGVjby1jeC9saXZlL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler@record": { + "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler@record": { "title": "Unknown record", "type": "object", "additionalProperties": { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler" } }, - "ZGVjby1jeC9saXZlL2hhbmRsZXJzL3JvdXRlci50cw==@RouterConfig": { + "ZGVjby1jeC9saXZlLnRzL2hhbmRsZXJzL3JvdXRlci50cw==@RouterConfig": { "type": "object", "properties": { "base": { @@ -2405,54 +2379,54 @@ "title": "Base" }, "routes": { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler@record", + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler@record", "title": "Routes" } }, "required": [ "routes" ], - "title": "deco-cx/live/handlers/router.ts@RouterConfig" + "title": "deco-cx/live.ts/handlers/router.ts@RouterConfig" }, - "ZGVjby1jeC9saXZlL2Jsb2Nrcy9wYWdlLnRz@Page": { + "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9wYWdlLnRz@Page": { "$ref": "#/root/pages" }, - "ZGVjby1jeC9saXZlL2hhbmRsZXJzL2RldlBhZ2UudHM=@DevConfig": { + "ZGVjby1jeC9saXZlLnRzL2hhbmRsZXJzL2RldlBhZ2UudHM=@DevConfig": { "type": "object", "properties": { "page": { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2Jsb2Nrcy9wYWdlLnRz@Page", + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9wYWdlLnRz@Page", "title": "Page" } }, "required": [ "page" ], - "title": "deco-cx/live/handlers/devPage.ts@DevConfig" + "title": "deco-cx/live.ts/handlers/devPage.ts@DevConfig" }, - "ZGVjby1jeC9saXZlL2hhbmRsZXJzL2ZyZXNoLnRz@FreshConfig": { + "ZGVjby1jeC9saXZlLnRzL2hhbmRsZXJzL2ZyZXNoLnRz@FreshConfig": { "type": "object", "properties": { "page": { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2Jsb2Nrcy9wYWdlLnRz@Page", + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9wYWdlLnRz@Page", "title": "Page" } }, "required": [ "page" ], - "title": "deco-cx/live/handlers/fresh.ts@FreshConfig" + "title": "deco-cx/live.ts/handlers/fresh.ts@FreshConfig" }, - "ZGVjby1jeC9saXZlL2Jsb2Nrcy9zZWN0aW9uLnRz@Section": { + "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9zZWN0aW9uLnRz@Section": { "$ref": "#/root/sections" }, - "ZGVjby1jeC9saXZlL2Jsb2Nrcy9zZWN0aW9uLnRz@Section[]": { + "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9zZWN0aW9uLnRz@Section[]": { "type": "array", "items": { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2Jsb2Nrcy9zZWN0aW9uLnRz@Section" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9zZWN0aW9uLnRz@Section" } }, - "ZGVjby1jeC9saXZlL3BhZ2VzL0xpdmVQYWdlLnRzeA==@Props": { + "ZGVjby1jeC9saXZlLnRzL3BhZ2VzL0xpdmVQYWdlLnRzeA==@Props": { "type": "object", "properties": { "name": { @@ -2460,7 +2434,7 @@ "title": "Name" }, "sections": { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2Jsb2Nrcy9zZWN0aW9uLnRz@Section[]", + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9zZWN0aW9uLnRz@Section[]", "title": "Sections" } }, @@ -2468,7 +2442,7 @@ "name", "sections" ], - "title": "deco-cx/live/pages/LivePage.tsx@Props" + "title": "deco-cx/live.ts/pages/LivePage.tsx@Props" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvTGlua1RyZWUudHN4@Link": { "type": "object", @@ -2708,18 +2682,18 @@ } ], "type": "string", - "title": "Icon", - "description": "Image src" + "description": "Image src", + "title": "Icon" }, "title": { "type": "string", - "title": "Title", - "description": "Title" + "description": "Title", + "title": "Title" }, "description": { "type": "string", - "title": "Description", - "description": "Description and Image alt text" + "description": "Description and Image alt text", + "title": "Description" } }, "required": [ @@ -2753,24 +2727,24 @@ "properties": { "matcher": { "type": "string", - "title": "Matcher", - "description": "RegExp to enable this banner on the current URL. Use /feminino/* to display this banner on feminino category" + "description": "RegExp to enable this banner on the current URL. Use /feminino/* to display this banner on feminino category", + "title": "Matcher" }, "title": { "type": [ "string", "null" ], - "title": "Title", - "description": "text to be rendered on top of the image" + "description": "text to be rendered on top of the image", + "title": "Title" }, "subtitle": { "type": [ "string", "null" ], - "title": "Subtitle", - "description": "text to be rendered on top of the image" + "description": "text to be rendered on top of the image", + "title": "Subtitle" }, "image": { "type": "object", @@ -2838,13 +2812,13 @@ }, "alt": { "type": "string", - "title": "Alt", - "description": "Image alt text" + "description": "Image alt text", + "title": "Alt" }, "href": { "type": "string", - "title": "Href", - "description": "When you click you go to" + "description": "When you click you go to", + "title": "Href" } }, "required": [ @@ -2926,7 +2900,7 @@ ], "title": "deco-sites/fashion/components/ui/BannerGrid.tsx@Props" }, - "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@omitProps": { + "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@omitcHJvZHVjdHM=Props": { "type": "object", "properties": { "title": { @@ -2944,18 +2918,27 @@ "required": [ "title" ], - "title": "omitProps" + "title": "omitcHJvZHVjdHM=Props" }, - "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@Props&Props": { + "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@2&omitcHJvZHVjdHM=Props": { "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@omitProps" + "type": "object", + "properties": { + "productsQuery": { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@Props", + "title": "Products Query" + } + }, + "required": [ + "productsQuery" + ] }, { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@Props" + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@omitcHJvZHVjdHM=Props" } ], - "title": "deco-sites/fashion/components/product/ProductShelf.tsx@Props&Props" + "title": "deco-sites/fashion/components/product/ProductShelf.tsx@2&omitcHJvZHVjdHM=Props" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvc2VhcmNoL1NlYXJjaFJlc3VsdC50c3g=@Props": { "type": "object", @@ -2976,8 +2959,8 @@ } ], "type": "string", - "title": "Variant", - "description": "Use drawer for mobile like behavior on desktop. Aside for rendering the filters alongside the products" + "description": "Use drawer for mobile like behavior on desktop. Aside for rendering the filters alongside the products", + "title": "Variant" }, "columns": { "type": "object", @@ -3413,6 +3396,24 @@ ], "title": "deco-sites/fashion/components/header/Header.tsx@Props" }, + "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0RvZ0ZhY3RzLnRzeA==@LoadProps": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2xvYWRlcnMvZG9nQXBpRmFjdHMudHM=@Props" + } + ], + "properties": { + "title": { + "type": "string", + "title": "Title" + } + }, + "required": [ + "title" + ], + "title": "deco-sites/fashion/sections/DogFacts.tsx@LoadProps" + }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0RGV0YWlscy50c3g=@Props": { "type": "object", "properties": { @@ -3510,106 +3511,6 @@ "required": [], "title": "deco-sites/fashion/components/ui/WhatsApp.tsx@Props" }, - "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@Category": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "children": { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@Category[]", - "title": "Children" - } - }, - "required": [ - "name", - "children" - ], - "title": "Category" - }, - "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@Category[]": { - "type": "array", - "items": { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@Category" - } - }, - "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@PlatformVTEX": { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "VTEX", - "title": "Type", - "default": "VTEX" - }, - "category": { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@Category", - "title": "Category" - } - }, - "required": [ - "type", - "category" - ], - "title": "PlatformVTEX" - }, - "ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@PlatformVTEX&Props": { - "allOf": [ - { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@Props" - }, - { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@PlatformVTEX" - } - ] - }, - "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@PlatformShopify": { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "Shopify", - "title": "Type", - "default": "Shopify" - } - }, - "required": [ - "type" - ], - "title": "PlatformShopify" - }, - "ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Nob3BpZnlQcm9kdWN0TGlzdC50cw==@PlatformShopify&Props": { - "allOf": [ - { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Nob3BpZnlQcm9kdWN0TGlzdC50cw==@Props" - }, - { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@PlatformShopify" - } - ] - }, - "ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@PlatformShopify&Props|PlatformVTEX&Props": { - "anyOf": [ - { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@PlatformVTEX&Props" - }, - { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Nob3BpZnlQcm9kdWN0TGlzdC50cw==@PlatformShopify&Props" - } - ] - }, - "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@Props&PlatformShopify&Props|PlatformVTEX&Props": { - "allOf": [ - { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@omitProps" - }, - { - "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@PlatformShopify&Props|PlatformVTEX&Props" - } - ], - "title": "deco-sites/fashion/components/product/ProductShelf.tsx@Props&PlatformShopify&Props|PlatformVTEX&Props" - }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvQmFubmVyQ2Fyb3VzZWwudHN4@Banner": { "type": "object", "properties": { @@ -3625,8 +3526,8 @@ }, "alt": { "type": "string", - "title": "Alt", - "description": "Image's alt text" + "description": "Image's alt text", + "title": "Alt" }, "action": { "type": "object", @@ -3682,8 +3583,8 @@ "boolean", "null" ], - "title": "Preload", - "description": "Check this option when this banner is the biggest image on the screen for image optimizations" + "description": "Check this option when this banner is the biggest image on the screen for image optimizations", + "title": "Preload" }, "interval": { "type": [ @@ -3697,18 +3598,18 @@ "required": [], "title": "deco-sites/fashion/components/ui/BannerCarousel.tsx@Props" }, - "ZGVjby1jeC9saXZlL3NlY3Rpb25zL1BhZ2VJbmNsdWRlLnRzeA==@Props": { + "ZGVjby1jeC9saXZlLnRzL3NlY3Rpb25zL1BhZ2VJbmNsdWRlLnRzeA==@Props": { "type": "object", "properties": { "page": { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2Jsb2Nrcy9wYWdlLnRz@Page", + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9wYWdlLnRz@Page", "title": "Page" } }, "required": [ "page" ], - "title": "deco-cx/live/sections/PageInclude.tsx@Props" + "title": "deco-cx/live.ts/sections/PageInclude.tsx@Props" }, "ZGVjby1zaXRlcy9zdGQvY29tcG9uZW50cy9zZW8vU0VPQmFzZS50c3g=@Props": { "type": "object", @@ -3809,8 +3710,8 @@ "items": { "type": "string" }, - "title": "Tracking Ids", - "description": "google tag manager container id. For more info: https://developers.google.com/tag-platform/tag-manager/web#standard_web_page_installation ." + "description": "google tag manager container id. For more info: https://developers.google.com/tag-platform/tag-manager/web#standard_web_page_installation .", + "title": "Tracking Ids" } }, "required": [], @@ -3851,7 +3752,7 @@ ], "title": "deco-sites/std/components/seo/SEOPDP.tsx@Props" }, - "ZGVjby1jeC9saXZlL21hdGNoZXJzL01hdGNoRGF0ZS50cw==@Props": { + "ZGVjby1jeC9saXZlLnRzL21hdGNoZXJzL01hdGNoRGF0ZS50cw==@Props": { "type": "object", "properties": { "start": { @@ -3859,22 +3760,22 @@ "string", "null" ], - "title": "Start", - "format": "date-time" + "format": "date-time", + "title": "Start" }, "end": { "type": [ "string", "null" ], - "title": "End", - "format": "date-time" + "format": "date-time", + "title": "End" } }, "required": [], - "title": "deco-cx/live/matchers/MatchDate.ts@Props" + "title": "deco-cx/live.ts/matchers/MatchDate.ts@Props" }, - "ZGVjby1jeC9saXZlL21hdGNoZXJzL01hdGNoVXNlckFnZW50LnRz@Props": { + "ZGVjby1jeC9saXZlLnRzL21hdGNoZXJzL01hdGNoVXNlckFnZW50LnRz@Props": { "type": "object", "properties": { "includes": { @@ -3893,9 +3794,9 @@ } }, "required": [], - "title": "deco-cx/live/matchers/MatchUserAgent.ts@Props" + "title": "deco-cx/live.ts/matchers/MatchUserAgent.ts@Props" }, - "ZGVjby1jeC9saXZlL21hdGNoZXJzL01hdGNoU2l0ZS50cw==@Props": { + "ZGVjby1jeC9saXZlLnRzL21hdGNoZXJzL01hdGNoU2l0ZS50cw==@Props": { "type": "object", "properties": { "siteId": { @@ -3906,18 +3807,18 @@ "required": [ "siteId" ], - "title": "deco-cx/live/matchers/MatchSite.ts@Props" + "title": "deco-cx/live.ts/matchers/MatchSite.ts@Props" }, - "ZGVjby1jeC9saXZlL2Jsb2Nrcy9tYXRjaGVyLnRz@Matcher": { + "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9tYXRjaGVyLnRz@Matcher": { "$ref": "#/root/matchers" }, - "ZGVjby1jeC9saXZlL2Jsb2Nrcy9tYXRjaGVyLnRz@Matcher[]": { + "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9tYXRjaGVyLnRz@Matcher[]": { "type": "array", "items": { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2Jsb2Nrcy9tYXRjaGVyLnRz@Matcher" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9tYXRjaGVyLnRz@Matcher" } }, - "ZGVjby1jeC9saXZlL21hdGNoZXJzL01hdGNoTXVsdGkudHM=@Props": { + "ZGVjby1jeC9saXZlLnRzL21hdGNoZXJzL01hdGNoTXVsdGkudHM=@Props": { "type": "object", "properties": { "op": { @@ -3935,7 +3836,7 @@ "title": "Op" }, "matchers": { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2Jsb2Nrcy9tYXRjaGVyLnRz@Matcher[]", + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9tYXRjaGVyLnRz@Matcher[]", "title": "Matchers" } }, @@ -3943,9 +3844,9 @@ "op", "matchers" ], - "title": "deco-cx/live/matchers/MatchMulti.ts@Props" + "title": "deco-cx/live.ts/matchers/MatchMulti.ts@Props" }, - "ZGVjby1jeC9saXZlL21hdGNoZXJzL01hdGNoUmFuZG9tLnRz@Props": { + "ZGVjby1jeC9saXZlLnRzL21hdGNoZXJzL01hdGNoUmFuZG9tLnRz@Props": { "type": "object", "properties": { "traffic": { @@ -3956,9 +3857,9 @@ "required": [ "traffic" ], - "title": "deco-cx/live/matchers/MatchRandom.ts@Props" + "title": "deco-cx/live.ts/matchers/MatchRandom.ts@Props" }, - "ZGVjby1jeC9saXZlL21hdGNoZXJzL01hdGNoRW52aXJvbm1lbnQudHM=@Props": { + "ZGVjby1jeC9saXZlLnRzL21hdGNoZXJzL01hdGNoRW52aXJvbm1lbnQudHM=@Props": { "type": "object", "properties": { "environment": { @@ -3979,13 +3880,13 @@ "required": [ "environment" ], - "title": "deco-cx/live/matchers/MatchEnvironment.ts@Props" + "title": "deco-cx/live.ts/matchers/MatchEnvironment.ts@Props" }, - "ZGVjby1jeC9saXZlL2ZsYWdzL2F1ZGllbmNlLnRz@Audience": { + "ZGVjby1jeC9saXZlLnRzL2ZsYWdzL2F1ZGllbmNlLnRz@Audience": { "type": "object", "properties": { "matcher": { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2Jsb2Nrcy9tYXRjaGVyLnRz@Matcher", + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9tYXRjaGVyLnRz@Matcher", "title": "Matcher" }, "name": { @@ -3993,7 +3894,7 @@ "title": "Name" }, "routes": { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler@record", + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler@record", "title": "Routes" }, "overrides": { @@ -4009,13 +3910,13 @@ "name", "routes" ], - "title": "deco-cx/live/flags/audience.ts@Audience" + "title": "deco-cx/live.ts/flags/audience.ts@Audience" }, - "ZGVjby1jeC9saXZlL2ZsYWdzL2V2ZXJ5b25lLnRz@EveryoneConfig": { + "ZGVjby1jeC9saXZlLnRzL2ZsYWdzL2V2ZXJ5b25lLnRz@EveryoneConfig": { "type": "object", "properties": { "routes": { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler@record", + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler@record", "title": "Routes" }, "overrides": { @@ -4027,7 +3928,7 @@ } }, "required": [], - "title": "deco-cx/live/flags/everyone.ts@EveryoneConfig" + "title": "deco-cx/live.ts/flags/everyone.ts@EveryoneConfig" }, "ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhDb25maWcudHM=": { "title": "deco-sites/std/functions/vtexConfig.ts", @@ -4461,6 +4362,27 @@ } } }, + "ZGVjby1zaXRlcy9mYXNoaW9uL2xvYWRlcnMvZG9nQXBpRmFjdHMudHM=": { + "title": "deco-sites/fashion/loaders/dogApiFacts.ts", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2xvYWRlcnMvZG9nQXBpRmFjdHMudHM=@Props" + } + ], + "required": [ + "__resolveType" + ], + "properties": { + "__resolveType": { + "type": "string", + "enum": [ + "deco-sites/fashion/loaders/dogApiFacts.ts" + ], + "default": "deco-sites/fashion/loaders/dogApiFacts.ts" + } + } + }, "ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvU2hpcHBpbmdTaW11bGF0aW9uLnRzeA==": { "title": "./islands/ShippingSimulation.tsx", "type": "object", @@ -4631,7 +4553,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2hhbmRsZXJzL3JvdXRlc1NlbGVjdGlvbi50cw==@SelectionConfig" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2hhbmRsZXJzL3JvdXRlc1NlbGVjdGlvbi50cw==@SelectionConfig" } ], "required": [ @@ -4652,7 +4574,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2hhbmRsZXJzL3JvdXRlci50cw==@RouterConfig" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2hhbmRsZXJzL3JvdXRlci50cw==@RouterConfig" } ], "required": [ @@ -4673,7 +4595,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2hhbmRsZXJzL2RldlBhZ2UudHM=@DevConfig" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2hhbmRsZXJzL2RldlBhZ2UudHM=@DevConfig" } ], "required": [ @@ -4694,7 +4616,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2hhbmRsZXJzL2ZyZXNoLnRz@FreshConfig" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2hhbmRsZXJzL2ZyZXNoLnRz@FreshConfig" } ], "required": [ @@ -4715,7 +4637,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL3BhZ2VzL0xpdmVQYWdlLnRzeA==@Props" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL3BhZ2VzL0xpdmVQYWdlLnRzeA==@Props" } ], "required": [ @@ -4836,7 +4758,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@Props&Props" + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@2&omitcHJvZHVjdHM=Props" } ], "required": [ @@ -4952,6 +4874,27 @@ } } }, + "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0RvZ0ZhY3RzLnRzeA==": { + "title": "deco-sites/fashion/sections/DogFacts.tsx", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0RvZ0ZhY3RzLnRzeA==@LoadProps" + } + ], + "required": [ + "__resolveType" + ], + "properties": { + "__resolveType": { + "type": "string", + "enum": [ + "deco-sites/fashion/sections/DogFacts.tsx" + ], + "default": "deco-sites/fashion/sections/DogFacts.tsx" + } + } + }, "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3REZXRhaWxzLnRzeA==": { "title": "deco-sites/fashion/sections/ProductDetails.tsx", "type": "object", @@ -5020,7 +4963,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@Props&PlatformShopify&Props|PlatformVTEX&Props" + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@Props" } ], "required": [ @@ -5062,7 +5005,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL3NlY3Rpb25zL1BhZ2VJbmNsdWRlLnRzeA==@Props" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL3NlY3Rpb25zL1BhZ2VJbmNsdWRlLnRzeA==@Props" } ], "required": [ @@ -5272,7 +5215,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL21hdGNoZXJzL01hdGNoRGF0ZS50cw==@Props" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL21hdGNoZXJzL01hdGNoRGF0ZS50cw==@Props" } ], "required": [ @@ -5293,7 +5236,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL21hdGNoZXJzL01hdGNoVXNlckFnZW50LnRz@Props" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL21hdGNoZXJzL01hdGNoVXNlckFnZW50LnRz@Props" } ], "required": [ @@ -5314,7 +5257,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL21hdGNoZXJzL01hdGNoU2l0ZS50cw==@Props" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL21hdGNoZXJzL01hdGNoU2l0ZS50cw==@Props" } ], "required": [ @@ -5335,7 +5278,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL21hdGNoZXJzL01hdGNoTXVsdGkudHM=@Props" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL21hdGNoZXJzL01hdGNoTXVsdGkudHM=@Props" } ], "required": [ @@ -5356,7 +5299,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL21hdGNoZXJzL01hdGNoUmFuZG9tLnRz@Props" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL21hdGNoZXJzL01hdGNoUmFuZG9tLnRz@Props" } ], "required": [ @@ -5377,7 +5320,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL21hdGNoZXJzL01hdGNoRW52aXJvbm1lbnQudHM=@Props" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL21hdGNoZXJzL01hdGNoRW52aXJvbm1lbnQudHM=@Props" } ], "required": [ @@ -5414,7 +5357,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2ZsYWdzL2F1ZGllbmNlLnRz@Audience" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2ZsYWdzL2F1ZGllbmNlLnRz@Audience" } ], "required": [ @@ -5435,7 +5378,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2ZsYWdzL2V2ZXJ5b25lLnRz@EveryoneConfig" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2ZsYWdzL2V2ZXJ5b25lLnRz@EveryoneConfig" } ], "required": [ @@ -5451,7 +5394,7 @@ } } }, - "ZGVjby1jeC9saXZlL3JvdXRlcy9fbWlkZGxld2FyZS50cw==@MiddlewareConfig": { + "ZGVjby1jeC9saXZlLnRzL3JvdXRlcy9fbWlkZGxld2FyZS50cw==@MiddlewareConfig": { "type": "object", "properties": { "state": { @@ -5465,20 +5408,20 @@ "required": [ "state" ], - "title": "deco-cx/live/routes/_middleware.ts@MiddlewareConfig" + "title": "deco-cx/live.ts/routes/_middleware.ts@MiddlewareConfig" }, - "ZGVjby1jeC9saXZlL3JvdXRlcy9bLi4uY2F0Y2hhbGxdLnRzeA==@Entrypoint": { + "ZGVjby1jeC9saXZlLnRzL3JvdXRlcy9bLi4uY2F0Y2hhbGxdLnRzeA==@Entrypoint": { "type": "object", "properties": { "handler": { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler", + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler", "title": "Handler" } }, "required": [ "handler" ], - "title": "deco-cx/live/routes/[...catchall].tsx@Entrypoint" + "title": "deco-cx/live.ts/routes/[...catchall].tsx@Entrypoint" } }, "root": { @@ -5564,6 +5507,17 @@ } ] }, + "loaders": { + "title": "loaders", + "anyOf": [ + { + "$ref": "#/definitions/Resolvable" + }, + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2xvYWRlcnMvZG9nQXBpRmFjdHMudHM=" + } + ] + }, "islands": { "title": "islands", "anyOf": [ @@ -5672,6 +5626,9 @@ { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0hlYWRlci50c3g=" }, + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0RvZ0ZhY3RzLnRzeA==" + }, { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3REZXRhaWxzLnRzeA==" }, @@ -5772,14 +5729,14 @@ "./routes/_middleware.ts": { "anyOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL3JvdXRlcy9fbWlkZGxld2FyZS50cw==@MiddlewareConfig" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL3JvdXRlcy9fbWlkZGxld2FyZS50cw==@MiddlewareConfig" } ] }, "./routes/[...catchall].tsx": { "anyOf": [ { - "$ref": "#/definitions/ZGVjby1jeC9saXZlL3JvdXRlcy9bLi4uY2F0Y2hhbGxdLnRzeA==@Entrypoint" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL3JvdXRlcy9bLi4uY2F0Y2hhbGxdLnRzeA==@Entrypoint" } ] } @@ -5792,6 +5749,9 @@ { "$ref": "#/root/accounts" }, + { + "$ref": "#/root/loaders" + }, { "$ref": "#/root/islands" }, diff --git a/sections/DogFacts.tsx b/sections/DogFacts.tsx new file mode 100644 index 00000000..fdb7f2bd --- /dev/null +++ b/sections/DogFacts.tsx @@ -0,0 +1,33 @@ +import { PropsResolver } from "../../live/blocks/propsResolver.ts"; +import dogApiFacts, { + DogFact, + Props as DogFactsProps, +} from "../loaders/dogApiFacts.ts"; + +export interface Props { + title: string; + dogFacts: DogFact[]; +} + +export default function DogFacts({ title, dogFacts }: Props) { + return ( +
+

{title}

+
    + {dogFacts.map(({ fact }) =>
  • {fact}
  • )} +
+
+ ); +} + +// Props type that will be configured in deco.cx's Admin +export interface LoadProps extends DogFactsProps { + title: string; +} + +export const resolveProps: PropsResolver< + Props, + LoadProps +> = { + dogFacts: dogApiFacts, +}; diff --git a/sections/ProductShelfGetProps.tsx b/sections/ProductShelfGetProps.tsx index 86b6a23f..63fe9c2d 100644 --- a/sections/ProductShelfGetProps.tsx +++ b/sections/ProductShelfGetProps.tsx @@ -14,7 +14,6 @@ import { Props as ShopifyLoaderProps, } from "deco-sites/std/functions/shopifyProductList.ts"; import { ConfigVTEX } from "deco-sites/std/functions/vtexConfig.ts"; -import { LiveConfig } from "https://denopkg.com/deco-cx/live@1.0.0-rc.36/blocks/handler.ts"; import { LiveState } from "../../live/types.ts"; function ProductShelfSection(props: ProductShelfProps) { @@ -45,13 +44,11 @@ export interface PlatformShopify { export async function loadData( request: Request, ctx: LoaderContext< - LiveConfig< - | VtexLoaderProps & PlatformVTEX - | ShopifyLoaderProps & PlatformShopify, - LiveState<{ configVTEX?: ConfigVTEX; configShopify: ConfigShopify }> & { - segment?: Partial; - } - > + | VtexLoaderProps & PlatformVTEX + | ShopifyLoaderProps & PlatformShopify, + LiveState<{ configVTEX?: ConfigVTEX; configShopify: ConfigShopify }> & { + segment?: Partial; + } >, ): Promise> { const loader = (ctx.state.$live.type === "VTEX") ? vtexLoader : shopifyLoader; diff --git a/sections/VtexProductShelf.tsx b/sections/VtexProductShelf.tsx index 2d32da94..8718b8b1 100644 --- a/sections/VtexProductShelf.tsx +++ b/sections/VtexProductShelf.tsx @@ -1,3 +1,4 @@ +import { PropsResolver } from "$live/blocks/propsResolver.ts"; import { LoaderContext } from "$live/types.ts"; import ProductShelf, { Props as ProductShelfProps, @@ -8,22 +9,33 @@ import { Props as VtexLoaderProps, } from "deco-sites/std/functions/vtexProductList.ts"; -import { LiveConfig } from "https://denopkg.com/deco-cx/live@1.0.0-rc.36/blocks/handler.ts"; - function ProductShelfSection(props: ProductShelfProps) { return ; } + +export type LoaderInput = + & { productsQuery: VtexLoaderProps } + & Omit; export async function loadData( request: Request, ctx: LoaderContext< - LiveConfig< - VtexLoaderProps, - StateVTEX - > + LoaderInput, + StateVTEX >, -): Promise> { - const { data: products } = await vtexLoader(request, ctx, ctx.state.$live); - return { products }; +) { + const { data: products } = await vtexLoader( + request, + ctx, + ctx.state.$live.productsQuery, + ); + return products; } export default ProductShelfSection; + +export const resolveProps: PropsResolver< + ProductShelfProps, + LoaderInput +> = { + products: loadData, +}; From 1f40064ad897f532038c58029bb650e526e67e78 Mon Sep 17 00:00:00 2001 From: Marcos Candeia Date: Fri, 7 Apr 2023 18:15:28 -0300 Subject: [PATCH 10/15] Refact productshelfgetprops Signed-off-by: Marcos Candeia --- import_map.json | 2 +- schemas.gen.json | 79 +++++++++++++++++++++++++++++-- sections/ProductShelfGetProps.tsx | 46 +++++++++--------- 3 files changed, 100 insertions(+), 27 deletions(-) diff --git a/import_map.json b/import_map.json index 5c9c39a0..135ac0af 100644 --- a/import_map.json +++ b/import_map.json @@ -1,7 +1,7 @@ { "imports": { "$store/": "./", - "$live/": "https://denopkg.com/deco-cx/live.ts@79d8dc23dd40fa5af25947bf9c9676c33a0ec32d/", + "$live/": "https://denopkg.com/deco-cx/live.ts@026ae123590437ad329c0bb8355ce99bcc2c128a/", "deco-sites/std/": "https://denopkg.com/deco-sites/std@1.0.0-rc.11/", "deco-sites/fashion/": "./", "partytown/": "https://deno.land/x/partytown@0.2.1/", diff --git a/schemas.gen.json b/schemas.gen.json index 653f1b65..27ac175d 100644 --- a/schemas.gen.json +++ b/schemas.gen.json @@ -2920,7 +2920,7 @@ ], "title": "omitcHJvZHVjdHM=Props" }, - "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@2&omitcHJvZHVjdHM=Props": { + "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@cd6fe400c08631e5c1c2a9b91520991e&omitcHJvZHVjdHM=Props": { "allOf": [ { "type": "object", @@ -2938,7 +2938,7 @@ "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@omitcHJvZHVjdHM=Props" } ], - "title": "deco-sites/fashion/components/product/ProductShelf.tsx@2&omitcHJvZHVjdHM=Props" + "title": "deco-sites/fashion/components/product/ProductShelf.tsx@cd6fe400c08631e5c1c2a9b91520991e&omitcHJvZHVjdHM=Props" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvc2VhcmNoL1NlYXJjaFJlc3VsdC50c3g=@Props": { "type": "object", @@ -3511,6 +3511,77 @@ "required": [], "title": "deco-sites/fashion/components/ui/WhatsApp.tsx@Props" }, + "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@PlatformVTEX": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "VTEX", + "default": "VTEX", + "title": "Type" + } + }, + "required": [ + "type" + ], + "title": "PlatformVTEX" + }, + "ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@PlatformVTEX&Props": { + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@Props" + }, + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@PlatformVTEX" + } + ] + }, + "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@PlatformShopify": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "Shopify", + "default": "Shopify", + "title": "Type" + } + }, + "required": [ + "type" + ], + "title": "PlatformShopify" + }, + "ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Nob3BpZnlQcm9kdWN0TGlzdC50cw==@PlatformShopify&Props": { + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Nob3BpZnlQcm9kdWN0TGlzdC50cw==@Props" + }, + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@PlatformShopify" + } + ] + }, + "ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@PlatformShopify&Props|PlatformVTEX&Props": { + "anyOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@PlatformVTEX&Props" + }, + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Nob3BpZnlQcm9kdWN0TGlzdC50cw==@PlatformShopify&Props" + } + ] + }, + "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@PlatformShopify&Props|PlatformVTEX&Props&omitcHJvZHVjdHM=Props": { + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@omitcHJvZHVjdHM=Props" + }, + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@PlatformShopify&Props|PlatformVTEX&Props" + } + ], + "title": "deco-sites/fashion/components/product/ProductShelf.tsx@PlatformShopify&Props|PlatformVTEX&Props&omitcHJvZHVjdHM=Props" + }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvQmFubmVyQ2Fyb3VzZWwudHN4@Banner": { "type": "object", "properties": { @@ -4758,7 +4829,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@2&omitcHJvZHVjdHM=Props" + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@cd6fe400c08631e5c1c2a9b91520991e&omitcHJvZHVjdHM=Props" } ], "required": [ @@ -4963,7 +5034,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@Props" + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@PlatformShopify&Props|PlatformVTEX&Props&omitcHJvZHVjdHM=Props" } ], "required": [ diff --git a/sections/ProductShelfGetProps.tsx b/sections/ProductShelfGetProps.tsx index 63fe9c2d..abf3a4cd 100644 --- a/sections/ProductShelfGetProps.tsx +++ b/sections/ProductShelfGetProps.tsx @@ -8,6 +8,7 @@ import { Props as VtexLoaderProps, } from "deco-sites/std/functions/vtexProductList.ts"; +import { PropsResolver } from "$live/blocks/propsResolver.ts"; import { ConfigShopify } from "deco-sites/std/commerce/shopify/client.ts"; import { default as shopifyLoader, @@ -19,41 +20,42 @@ import { LiveState } from "../../live/types.ts"; function ProductShelfSection(props: ProductShelfProps) { return ; } -export interface OtherProps { - props: string; -} - -export interface Category { - name: string; - children: Category[]; -} export interface PlatformVTEX { /** * @default VTEX */ type: "VTEX"; - category: Category; } + export interface PlatformShopify { /** * @default Shopify */ type: "Shopify"; } -export async function loadData( - request: Request, - ctx: LoaderContext< +export type LoaderProps = + & Omit + & ( | VtexLoaderProps & PlatformVTEX - | ShopifyLoaderProps & PlatformShopify, - LiveState<{ configVTEX?: ConfigVTEX; configShopify: ConfigShopify }> & { - segment?: Partial; - } - >, -): Promise> { - const loader = (ctx.state.$live.type === "VTEX") ? vtexLoader : shopifyLoader; - const { data: products } = await loader(request, ctx, ctx.state.$live); - return { products }; -} + | ShopifyLoaderProps & PlatformShopify + ); + +export const resolveProps: PropsResolver = + async ( + request: Request, + ctx: LoaderContext< + LoaderProps, + LiveState<{ configVTEX?: ConfigVTEX; configShopify: ConfigShopify }> & { + segment?: Partial; + } + >, + ): Promise => { + const loader = (ctx.state.$live.type === "VTEX") + ? vtexLoader + : shopifyLoader; + const { data: products } = await loader(request, ctx, ctx.state.$live); + return { ...ctx.state.$live, products }; + }; export default ProductShelfSection; From 1209d261b2968cb0da7e799cc18ff26b44954929 Mon Sep 17 00:00:00 2001 From: Marcos Candeia Date: Fri, 7 Apr 2023 18:17:07 -0300 Subject: [PATCH 11/15] Fix imports Signed-off-by: Marcos Candeia --- sections/DogFacts.tsx | 4 ++-- sections/ProductShelfGetProps.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sections/DogFacts.tsx b/sections/DogFacts.tsx index fdb7f2bd..673ed4c4 100644 --- a/sections/DogFacts.tsx +++ b/sections/DogFacts.tsx @@ -1,8 +1,8 @@ -import { PropsResolver } from "../../live/blocks/propsResolver.ts"; +import { PropsResolver } from "$live/blocks/propsResolver.ts"; import dogApiFacts, { DogFact, Props as DogFactsProps, -} from "../loaders/dogApiFacts.ts"; +} from "deco-sites/fashion/loaders/dogApiFacts.ts"; export interface Props { title: string; diff --git a/sections/ProductShelfGetProps.tsx b/sections/ProductShelfGetProps.tsx index abf3a4cd..c8728277 100644 --- a/sections/ProductShelfGetProps.tsx +++ b/sections/ProductShelfGetProps.tsx @@ -15,7 +15,7 @@ import { Props as ShopifyLoaderProps, } from "deco-sites/std/functions/shopifyProductList.ts"; import { ConfigVTEX } from "deco-sites/std/functions/vtexConfig.ts"; -import { LiveState } from "../../live/types.ts"; +import { LiveState } from "$live/types.ts"; function ProductShelfSection(props: ProductShelfProps) { return ; From a9c737bc517b544b09d1987efd5dec0fea33f5f4 Mon Sep 17 00:00:00 2001 From: Marcos Candeia Date: Fri, 7 Apr 2023 18:51:15 -0300 Subject: [PATCH 12/15] use new live ver Signed-off-by: Marcos Candeia --- import_map.json | 2 +- sections/DogFacts.tsx | 4 ++-- sections/ProductShelfGetProps.tsx | 31 ++++++++++++++----------------- sections/VtexProductShelf.tsx | 4 ++-- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/import_map.json b/import_map.json index 135ac0af..77e67ed6 100644 --- a/import_map.json +++ b/import_map.json @@ -1,7 +1,7 @@ { "imports": { "$store/": "./", - "$live/": "https://denopkg.com/deco-cx/live.ts@026ae123590437ad329c0bb8355ce99bcc2c128a/", + "$live/": "https://denopkg.com/deco-cx/live.ts@5b77c3c102359e4dc56e9749f376c68b5253d9e4/", "deco-sites/std/": "https://denopkg.com/deco-sites/std@1.0.0-rc.11/", "deco-sites/fashion/": "./", "partytown/": "https://deno.land/x/partytown@0.2.1/", diff --git a/sections/DogFacts.tsx b/sections/DogFacts.tsx index 673ed4c4..62375a15 100644 --- a/sections/DogFacts.tsx +++ b/sections/DogFacts.tsx @@ -1,4 +1,4 @@ -import { PropsResolver } from "$live/blocks/propsResolver.ts"; +import { PropsLoader } from "$live/mod.ts"; import dogApiFacts, { DogFact, Props as DogFactsProps, @@ -25,7 +25,7 @@ export interface LoadProps extends DogFactsProps { title: string; } -export const resolveProps: PropsResolver< +export const loader: PropsLoader< Props, LoadProps > = { diff --git a/sections/ProductShelfGetProps.tsx b/sections/ProductShelfGetProps.tsx index c8728277..b90a45d3 100644 --- a/sections/ProductShelfGetProps.tsx +++ b/sections/ProductShelfGetProps.tsx @@ -8,7 +8,7 @@ import { Props as VtexLoaderProps, } from "deco-sites/std/functions/vtexProductList.ts"; -import { PropsResolver } from "$live/blocks/propsResolver.ts"; +import { PropsLoader } from "$live/mod.ts"; import { ConfigShopify } from "deco-sites/std/commerce/shopify/client.ts"; import { default as shopifyLoader, @@ -41,21 +41,18 @@ export type LoaderProps = | ShopifyLoaderProps & PlatformShopify ); -export const resolveProps: PropsResolver = - async ( - request: Request, - ctx: LoaderContext< - LoaderProps, - LiveState<{ configVTEX?: ConfigVTEX; configShopify: ConfigShopify }> & { - segment?: Partial; - } - >, - ): Promise => { - const loader = (ctx.state.$live.type === "VTEX") - ? vtexLoader - : shopifyLoader; - const { data: products } = await loader(request, ctx, ctx.state.$live); - return { ...ctx.state.$live, products }; - }; +export const loader: PropsLoader = async ( + request: Request, + ctx: LoaderContext< + LoaderProps, + LiveState<{ configVTEX?: ConfigVTEX; configShopify: ConfigShopify }> & { + segment?: Partial; + } + >, +): Promise => { + const loader = (ctx.state.$live.type === "VTEX") ? vtexLoader : shopifyLoader; + const { data: products } = await loader(request, ctx, ctx.state.$live); + return { ...ctx.state.$live, products }; +}; export default ProductShelfSection; diff --git a/sections/VtexProductShelf.tsx b/sections/VtexProductShelf.tsx index 8718b8b1..70091524 100644 --- a/sections/VtexProductShelf.tsx +++ b/sections/VtexProductShelf.tsx @@ -1,4 +1,4 @@ -import { PropsResolver } from "$live/blocks/propsResolver.ts"; +import { PropsLoader } from "$live/mod.ts"; import { LoaderContext } from "$live/types.ts"; import ProductShelf, { Props as ProductShelfProps, @@ -33,7 +33,7 @@ export async function loadData( export default ProductShelfSection; -export const resolveProps: PropsResolver< +export const loader: PropsLoader< ProductShelfProps, LoaderInput > = { From ac3ac72197f5edcce3b48e432d5a69e1ac3af9a3 Mon Sep 17 00:00:00 2001 From: Marcos Candeia Date: Sat, 8 Apr 2023 14:47:10 -0300 Subject: [PATCH 13/15] Add dog facts Signed-off-by: Marcos Candeia --- import_map.json | 2 +- schemas.gen.json | 1086 ++++++++++++++++++++++++----------------- sections/DogFacts.tsx | 36 +- 3 files changed, 658 insertions(+), 466 deletions(-) diff --git a/import_map.json b/import_map.json index 77e67ed6..2dacecef 100644 --- a/import_map.json +++ b/import_map.json @@ -1,7 +1,7 @@ { "imports": { "$store/": "./", - "$live/": "https://denopkg.com/deco-cx/live.ts@5b77c3c102359e4dc56e9749f376c68b5253d9e4/", + "$live/": "https://denopkg.com/deco-cx/live.ts@01afaf1c75b8360d50bc39b4096de80cf4b4613e/", "deco-sites/std/": "https://denopkg.com/deco-sites/std@1.0.0-rc.11/", "deco-sites/fashion/": "./", "partytown/": "https://deno.land/x/partytown@0.2.1/", diff --git a/schemas.gen.json b/schemas.gen.json index 27ac175d..aa978e09 100644 --- a/schemas.gen.json +++ b/schemas.gen.json @@ -22,16 +22,16 @@ "type": "object", "properties": { "account": { - "type": "string", - "title": "Account" + "title": "Account", + "type": "string" }, "defaultLocale": { - "type": "string", - "title": "Default Locale" + "title": "Default Locale", + "type": "string" }, "defaultPriceCurrency": { - "type": "string", - "title": "Default Price Currency" + "title": "Default Price Currency", + "type": "string" } }, "required": [ @@ -59,7 +59,9 @@ } ] }, - "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Thing": {}, + "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Thing": { + "title": "Thing" + }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ListItem": { "type": "object", "allOf": [ @@ -69,16 +71,16 @@ ], "properties": { "@type": { + "title": "@type", "type": "string", - "const": "ListItem", - "title": "@type" + "const": "ListItem" }, "item": { "title": "Item" }, "position": { - "type": "number", - "title": "Position" + "title": "Position", + "type": "number" } }, "required": [ @@ -92,7 +94,8 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ListItem" - } + }, + "title": "ListItem[]" }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=ItemList": { "type": "object", @@ -107,8 +110,8 @@ "title": "Item List Element" }, "numberOfItems": { - "type": "number", - "title": "Number Of Items" + "title": "Number Of Items", + "type": "number" } }, "required": [ @@ -126,9 +129,9 @@ ], "properties": { "@type": { + "title": "@type", "type": "string", - "const": "BreadcrumbList", - "title": "@type" + "const": "BreadcrumbList" } }, "required": [ @@ -140,12 +143,12 @@ "type": "object", "properties": { "label": { - "type": "string", - "title": "Label" + "title": "Label", + "type": "string" }, "key": { - "type": "string", - "title": "Key" + "title": "Key", + "type": "string" } }, "required": [ @@ -158,24 +161,24 @@ "type": "object", "properties": { "quantity": { - "type": "number", - "title": "Quantity" + "title": "Quantity", + "type": "number" }, "label": { - "type": "string", - "title": "Label" + "title": "Label", + "type": "string" }, "value": { - "type": "string", - "title": "Value" + "title": "Value", + "type": "string" }, "selected": { - "type": "boolean", - "title": "Selected" + "title": "Selected", + "type": "boolean" }, "url": { - "type": "string", - "title": "Url" + "title": "Url", + "type": "string" } }, "required": [ @@ -191,7 +194,8 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@FilterToggleValue" - } + }, + "title": "FilterToggleValue[]" }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@FilterToggle": { "type": "object", @@ -202,17 +206,17 @@ ], "properties": { "@type": { + "title": "@type", "type": "string", - "const": "FilterToggle", - "title": "@type" + "const": "FilterToggle" }, "values": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@FilterToggleValue[]", "title": "Values" }, "quantity": { - "type": "number", - "title": "Quantity" + "title": "Quantity", + "type": "number" } }, "required": [ @@ -226,12 +230,12 @@ "type": "object", "properties": { "min": { - "type": "number", - "title": "Min" + "title": "Min", + "type": "number" }, "max": { - "type": "number", - "title": "Max" + "title": "Max", + "type": "number" } }, "required": [ @@ -249,9 +253,9 @@ ], "properties": { "@type": { + "title": "@type", "type": "string", - "const": "FilterRange", - "title": "@type" + "const": "FilterRange" }, "values": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@FilterRangeValue", @@ -272,13 +276,15 @@ { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@FilterRange" } - ] + ], + "title": "FilterRange|FilterToggle" }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@FilterRange|FilterToggle[]": { "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@FilterRange|FilterToggle" - } + }, + "title": "FilterRange|FilterToggle[]" }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ImageObject": { "type": "object", @@ -289,9 +295,9 @@ ], "properties": { "@type": { + "title": "@type", "type": "string", - "const": "ImageObject", - "title": "@type" + "const": "ImageObject" } }, "required": [ @@ -303,84 +309,85 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ImageObject" - } + }, + "title": "ImageObject[]" }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@omitQHR5cGU=Thing": { "type": "object", "properties": { "@id": { + "title": "@id", "type": [ "string", "null" - ], - "title": "@id" + ] }, "additionalType": { + "title": "Additional Type", "type": [ "string", "null" - ], - "title": "Additional Type" + ] }, "alternateName": { + "title": "Alternate Name", "type": [ "string", "null" - ], - "title": "Alternate Name" + ] }, "description": { + "title": "Description", "type": [ "string", "null" - ], - "title": "Description" + ] }, "disambiguatingDescription": { + "title": "Disambiguating Description", "type": [ "string", "null" - ], - "title": "Disambiguating Description" + ] }, "identifier": { + "title": "Identifier", "type": [ "string", "null" - ], - "title": "Identifier" + ] }, "image": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ImageObject[]", "title": "Image" }, "name": { + "title": "Name", "type": [ "string", "null" - ], - "title": "Name" + ] }, "sameAs": { + "title": "Same As", "type": [ "string", "null" - ], - "title": "Same As" + ] }, "subjectOf": { + "title": "Subject Of", "type": [ "string", "null" - ], - "title": "Subject Of" + ] }, "url": { + "title": "Url", "type": [ "string", "null" - ], - "title": "Url" + ] } }, "required": [], @@ -395,58 +402,58 @@ ], "properties": { "@type": { + "title": "@type", "type": "string", - "const": "PropertyValue", - "title": "@type" + "const": "PropertyValue" }, "maxValue": { + "title": "Max Value", "type": [ "number", "null" - ], - "title": "Max Value" + ] }, "minValue": { + "title": "Min Value", "type": [ "number", "null" - ], - "title": "Min Value" + ] }, "propertyID": { + "title": "Property I D", "type": [ "string", "null" - ], - "title": "Property I D" + ] }, "unitCode": { + "title": "Unit Code", "type": [ "string", "null" - ], - "title": "Unit Code" + ] }, "unitText": { + "title": "Unit Text", "type": [ "string", "null" - ], - "title": "Unit Text" + ] }, "value": { + "title": "Value", "type": [ "string", "null" - ], - "title": "Value" + ] }, "valueReference": { + "title": "Value Reference", "type": [ "string", "null" - ], - "title": "Value Reference" + ] } }, "required": [ @@ -458,36 +465,37 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@PropertyValue" - } + }, + "title": "PropertyValue[]" }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@AggregateRating": { "type": "object", "properties": { "@type": { + "title": "@type", "type": "string", - "const": "AggregateRating", - "title": "@type" + "const": "AggregateRating" }, "ratingCount": { + "title": "Rating Count", "type": [ "number", "null" - ], - "title": "Rating Count" + ] }, "reviewCount": { + "title": "Review Count", "type": [ "number", "null" - ], - "title": "Review Count" + ] }, "ratingValue": { + "title": "Rating Value", "type": [ "number", "null" - ], - "title": "Rating Value" + ] } }, "required": [ @@ -510,7 +518,8 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf" - } + }, + "title": "ProductLeaf[]" }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductGroup": { "type": "object", @@ -521,17 +530,17 @@ ], "properties": { "@type": { + "title": "@type", "type": "string", - "const": "ProductGroup", - "title": "@type" + "const": "ProductGroup" }, "hasVariant": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf[]", "title": "Has Variant" }, "productGroupID": { - "type": "string", - "title": "Product Group I D" + "title": "Product Group I D", + "type": "string" }, "additionalProperty": { "type": "array", @@ -541,11 +550,11 @@ "title": "Additional Property" }, "model": { + "title": "Model", "type": [ "string", "null" - ], - "title": "Model" + ] } }, "required": [ @@ -560,11 +569,11 @@ "type": "object", "properties": { "value": { + "title": "Value", "type": [ "number", "null" - ], - "title": "Value" + ] } }, "required": [], @@ -583,15 +592,15 @@ "title": "Eligible Quantity" }, "price": { - "type": "number", - "title": "Price" + "title": "Price", + "type": "number" }, "priceCurrency": { + "title": "Price Currency", "type": [ "string", "null" - ], - "title": "Price Currency" + ] } }, "required": [ @@ -608,33 +617,39 @@ ], "properties": { "@type": { + "title": "@type", "type": "string", - "const": "UnitPriceSpecification", - "title": "@type" + "const": "UnitPriceSpecification" }, "priceComponentType": { "anyOf": [ { + "title": "Inline string", "type": "string", "const": "https://schema.org/ActivationFee" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/CleaningFee" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/DistanceFee" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/Downpayment" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/Installment" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/Subscription" } @@ -645,26 +660,32 @@ "priceType": { "anyOf": [ { + "title": "Inline string", "type": "string", "const": "https://schema.org/InvoicePrice" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/ListPrice" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/MinimumAdvertisedPrice" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/MSRP" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/SalePrice" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/SRP" } @@ -673,18 +694,18 @@ "title": "Price Type" }, "billingDuration": { + "title": "Billing Duration", "type": [ "number", "null" - ], - "title": "Billing Duration" + ] }, "billingIncrement": { + "title": "Billing Increment", "type": [ "number", "null" - ], - "title": "Billing Increment" + ] } }, "required": [ @@ -697,7 +718,8 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@UnitPriceSpecification" - } + }, + "title": "UnitPriceSpecification[]" }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Offer": { "type": "object", @@ -708,49 +730,59 @@ ], "properties": { "@type": { + "title": "@type", "type": "string", - "const": "Offer", - "title": "@type" + "const": "Offer" }, "availability": { "anyOf": [ { + "title": "Inline string", "type": "string", "const": "https://schema.org/BackOrder" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/Discontinued" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/InStock" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/InStoreOnly" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/LimitedAvailability" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/OnlineOnly" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/OutOfStock" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/PreOrder" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/PreSale" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/SoldOut" } @@ -759,11 +791,11 @@ "title": "Availability" }, "gtin": { + "title": "Gtin", "type": [ "string", "null" - ], - "title": "Gtin" + ] }, "inventoryLevel": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@QuantitativeValue", @@ -772,18 +804,22 @@ "itemCondition": { "anyOf": [ { + "title": "Inline string", "type": "string", "const": "https://schema.org/DamagedCondition" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/NewCondition" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/RefurbishedCondition" }, { + "title": "Inline string", "type": "string", "const": "https://schema.org/UsedCondition" } @@ -792,33 +828,33 @@ "title": "Item Condition" }, "price": { - "type": "number", - "title": "Price" + "title": "Price", + "type": "number" }, "priceSpecification": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@UnitPriceSpecification[]", "title": "Price Specification" }, "priceValidUntil": { + "title": "Price Valid Until", "type": [ "string", "null" - ], - "title": "Price Valid Until" + ] }, "seller": { + "title": "Seller", "type": [ "string", "null" - ], - "title": "Seller" + ] }, "sku": { + "title": "Sku", "type": [ "string", "null" - ], - "title": "Sku" + ] } }, "required": [ @@ -834,38 +870,39 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Offer" - } + }, + "title": "Offer[]" }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@AggregateOffer": { "type": "object", "properties": { "@type": { + "title": "@type", "type": "string", - "const": "AggregateOffer", - "title": "@type" + "const": "AggregateOffer" }, "highPrice": { - "type": "number", - "title": "High Price" + "title": "High Price", + "type": "number" }, "lowPrice": { - "type": "number", - "title": "Low Price" + "title": "Low Price", + "type": "number" }, "offerCount": { - "type": "number", - "title": "Offer Count" + "title": "Offer Count", + "type": "number" }, "offers": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Offer[]", "title": "Offers" }, "priceCurrency": { + "title": "Price Currency", "type": [ "string", "null" - ], - "title": "Price Currency" + ] } }, "required": [ @@ -886,20 +923,21 @@ ], "properties": { "@type": { + "title": "@type", "type": "string", - "const": "Review", - "title": "@type" + "const": "Review" }, "itemReviewed": { + "title": "Item Reviewed", "type": [ "string", "null" - ], - "title": "Item Reviewed" + ] }, "negativeNotes": { "type": "array", "items": { + "title": "Inline string", "type": "string" }, "title": "Negative Notes" @@ -907,23 +945,24 @@ "positiveNotes": { "type": "array", "items": { + "title": "Inline string", "type": "string" }, "title": "Positive Notes" }, "reviewAspect": { + "title": "Review Aspect", "type": [ "string", "null" - ], - "title": "Review Aspect" + ] }, "reviewBody": { + "title": "Review Body", "type": [ "string", "null" - ], - "title": "Review Body" + ] }, "reviewRating": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@AggregateRating", @@ -944,9 +983,9 @@ ], "properties": { "@type": { + "title": "@type", "type": "string", - "const": "Product", - "title": "@type" + "const": "Product" }, "additionalProperty": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@PropertyValue[]", @@ -957,39 +996,39 @@ "title": "Aggregate Rating" }, "award": { + "title": "Award", "type": [ "string", "null" - ], - "title": "Award" + ] }, "brand": { + "title": "Brand", "type": [ "string", "null" - ], - "title": "Brand" + ] }, "category": { + "title": "Category", "type": [ "string", "null" - ], - "title": "Category" + ] }, "gtin": { + "title": "Gtin", "type": [ "string", "null" - ], - "title": "Gtin" + ] }, "inProductGroupWithID": { + "title": "In Product Group With I D", "type": [ "string", "null" - ], - "title": "In Product Group With I D" + ] }, "isVariantOf": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductGroup", @@ -1000,30 +1039,30 @@ "title": "Offers" }, "productID": { - "type": "string", - "title": "Product I D" + "title": "Product I D", + "type": "string" }, "productionDate": { + "title": "Production Date", "type": [ "string", "null" - ], - "title": "Production Date" + ] }, "releaseDate": { + "title": "Release Date", "type": [ "string", "null" - ], - "title": "Release Date" + ] }, "review": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Review", "title": "Review" }, "sku": { - "type": "string", - "title": "Sku" + "title": "Sku", + "type": "string" } }, "required": [ @@ -1037,18 +1076,19 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Product" - } + }, + "title": "Product[]" }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@SortOption": { "type": "object", "properties": { "value": { - "type": "string", - "title": "Value" + "title": "Value", + "type": "string" }, "label": { - "type": "string", - "title": "Label" + "title": "Label", + "type": "string" } }, "required": [ @@ -1061,15 +1101,16 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@SortOption" - } + }, + "title": "SortOption[]" }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductListingPage": { "type": "object", "properties": { "@type": { + "title": "@type", "type": "string", - "const": "ProductListingPage", - "title": "@type" + "const": "ProductListingPage" }, "breadcrumb": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@BreadcrumbList", @@ -1087,15 +1128,17 @@ "type": "object", "properties": { "currentPage": { - "type": "number", - "title": "Current Page" + "title": "Current Page", + "type": "number" }, "nextPage": { "anyOf": [ { + "title": "Inline string", "type": "string" }, { + "title": "Inline null", "type": "null" } ], @@ -1104,9 +1147,11 @@ "previousPage": { "anyOf": [ { + "title": "Inline string", "type": "string" }, { + "title": "Inline null", "type": "null" } ], @@ -1143,6 +1188,7 @@ "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductListingPage" }, { + "title": "Inline null", "type": "null" }, { @@ -1235,29 +1281,32 @@ "type": "object", "properties": { "query": { + "title": "Query", "type": [ "string", "null" ], - "description": "overides the query term", - "title": "Query" + "description": "overides the query term" }, "count": { - "type": "number", "title": "Count", + "type": "number", "description": "number of products per page to display" }, "fuzzy": { "anyOf": [ { + "title": "Inline string", "type": "string", "const": "automatic" }, { + "title": "Inline string", "type": "string", "const": "disabled" }, { + "title": "Inline string", "type": "string", "const": "enabled" } @@ -1280,6 +1329,7 @@ "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Product[]" }, { + "title": "Inline null", "type": "null" }, { @@ -1393,41 +1443,45 @@ "type": "object", "properties": { "limit": { + "title": "Limit", "type": "number", - "description": "total number of items to display", - "title": "Limit" + "description": "total number of items to display" }, "term": { + "title": "Term", "type": [ "string", "null" ], - "description": "query to use on search", - "title": "Term" + "description": "query to use on search" }, "wildcard": { + "title": "Wildcard", "type": [ "boolean", "null" ], - "description": "search for term anywhere", - "title": "Wildcard" + "description": "search for term anywhere" }, "sort": { "anyOf": [ { + "title": "Inline string", "type": "string", "const": "newest" }, { + "title": "Inline string", "type": "string", "const": "oldest" }, { + "title": "Inline string", "type": "string", "const": "lowest_price" }, { + "title": "Inline string", "type": "string", "const": "highest_price" } @@ -1439,6 +1493,7 @@ "tags": { "type": "array", "items": { + "title": "Inline string", "type": "string" }, "description": "search for products that have certain tag", @@ -1454,9 +1509,9 @@ "type": "object", "properties": { "@type": { + "title": "@type", "type": "string", - "const": "ProductDetailsPage", - "title": "@type" + "const": "ProductDetailsPage" }, "breadcrumbList": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@BreadcrumbList", @@ -1483,6 +1538,7 @@ "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductDetailsPage" }, { + "title": "Inline null", "type": "null" }, { @@ -1571,8 +1627,8 @@ "type": "object", "properties": { "term": { - "type": "string", - "title": "Term" + "title": "Term", + "type": "string" } }, "required": [ @@ -1584,7 +1640,8 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Search" - } + }, + "title": "Search[]" }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Suggestion": { "type": "object", @@ -1610,6 +1667,7 @@ "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Suggestion" }, { + "title": "Inline null", "type": "null" }, { @@ -1639,13 +1697,13 @@ "type": "object", "properties": { "count": { + "title": "Count", "type": [ "number", "null" ], "description": "limit the number of searches", - "default": "4", - "title": "Count" + "default": "4" } }, "required": [], @@ -1655,29 +1713,29 @@ "type": "object", "properties": { "label": { - "type": "string", - "title": "Label" + "title": "Label", + "type": "string" }, "href": { - "type": "string", - "title": "Href" + "title": "Href", + "type": "string" }, "image": { "type": "object", "properties": { "src": { + "title": "Src", "type": [ "string", "null" - ], - "title": "Src" + ] }, "alt": { + "title": "Alt", "type": [ "string", "null" - ], - "title": "Alt" + ] } }, "required": [], @@ -1701,6 +1759,7 @@ "children": { "type": "array", "items": { + "title": "Inline object", "type": "object" }, "title": "Children" @@ -1713,7 +1772,8 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Navbar" - } + }, + "title": "Navbar[]" }, "ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Navbar[]|null": { "anyOf": [ @@ -1724,6 +1784,7 @@ "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Navbar[]" }, { + "title": "Inline null", "type": "null" }, { @@ -1753,13 +1814,13 @@ "type": "object", "properties": { "levels": { + "title": "Levels", "type": [ "number", "null" ], "description": "Number of levels of categories to be returned", - "default": "2", - "title": "Levels" + "default": "2" } }, "required": [], @@ -1769,16 +1830,16 @@ "type": "object", "properties": { "query": { + "title": "Query", "type": [ "string", "null" ], - "description": "overides the query term", - "title": "Query" + "description": "overides the query term" }, "count": { - "type": "number", "title": "Count", + "type": "number", "description": "number of products per page to display" } }, @@ -1791,46 +1852,54 @@ "type": "object", "properties": { "query": { + "title": "Query", "type": "string", - "description": "query to use on search", - "title": "Query" + "description": "query to use on search" }, "count": { + "title": "Count", "type": "number", - "description": "total number of items to display", - "title": "Count" + "description": "total number of items to display" }, "sort": { "anyOf": [ { + "title": "Inline string", "type": "string", "const": "" }, { + "title": "Inline string", "type": "string", "const": "price:desc" }, { + "title": "Inline string", "type": "string", "const": "price:asc" }, { + "title": "Inline string", "type": "string", "const": "orders:desc" }, { + "title": "Inline string", "type": "string", "const": "name:desc" }, { + "title": "Inline string", "type": "string", "const": "name:asc" }, { + "title": "Inline string", "type": "string", "const": "release:desc" }, { + "title": "Inline string", "type": "string", "const": "discount:desc" } @@ -1842,6 +1911,7 @@ "collection": { "type": "array", "items": { + "title": "Inline string", "type": "string" }, "description": "Collection ID or (Product Cluster id). For more info: https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/search .", @@ -1859,24 +1929,25 @@ "type": "object", "properties": { "term": { + "title": "Term", "type": [ "string", "null" ], - "description": "overides the query term", - "title": "Term" + "description": "overides the query term" }, "tags": { "type": "array", "items": { + "title": "Inline string", "type": "string" }, "description": "filter products by tag", "title": "Tags" }, "count": { - "type": "number", "title": "Count", + "type": "number", "description": "number of products per page to display" } }, @@ -1889,40 +1960,40 @@ "type": "object", "properties": { "term": { + "title": "Term", "type": [ "string", "null" ], - "description": "overides the query term", - "title": "Term" + "description": "overides the query term" }, "count": { - "type": "number", "title": "Count", + "type": "number", "description": "number of products per page to display" }, "ft": { + "title": "Ft", "type": [ "string", "null" ], - "description": "FullText term", - "title": "Ft" + "description": "FullText term" }, "fq": { + "title": "Fq", "type": [ "string", "null" - ], - "title": "Fq" + ] }, "map": { + "title": "Map", "type": [ "string", "null" ], - "description": "map param", - "title": "Map" + "description": "map param" } }, "required": [ @@ -1934,46 +2005,54 @@ "type": "object", "properties": { "query": { + "title": "Query", "type": "string", - "description": "query to use on search", - "title": "Query" + "description": "query to use on search" }, "count": { + "title": "Count", "type": "number", - "description": "total number of items to display", - "title": "Count" + "description": "total number of items to display" }, "sort": { "anyOf": [ { + "title": "Inline string", "type": "string", "const": "" }, { + "title": "Inline string", "type": "string", "const": "price:desc" }, { + "title": "Inline string", "type": "string", "const": "price:asc" }, { + "title": "Inline string", "type": "string", "const": "orders:desc" }, { + "title": "Inline string", "type": "string", "const": "name:desc" }, { + "title": "Inline string", "type": "string", "const": "name:asc" }, { + "title": "Inline string", "type": "string", "const": "release:desc" }, { + "title": "Inline string", "type": "string", "const": "discount:desc" } @@ -1985,6 +2064,7 @@ "collection": { "type": "array", "items": { + "title": "Inline string", "type": "string" }, "description": "Collection ID or (Product Cluster id). For more info: https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/search .", @@ -2002,14 +2082,14 @@ "type": "object", "properties": { "query": { + "title": "Query", "type": "string", - "description": "search term to use on search", - "title": "Query" + "description": "search term to use on search" }, "count": { + "title": "Count", "type": "number", - "description": "total number of items to display", - "title": "Count" + "description": "total number of items to display" } }, "required": [ @@ -2024,36 +2104,44 @@ "crossSelling": { "anyOf": [ { + "title": "Inline string", "type": "string", "const": "" }, { "anyOf": [ { + "title": "Inline string", "type": "string", "const": "whosawalsosaw" }, { + "title": "Inline string", "type": "string", "const": "whosawalsobought" }, { + "title": "Inline string", "type": "string", "const": "whoboughtalsobought" }, { + "title": "Inline string", "type": "string", "const": "showtogether" }, { + "title": "Inline string", "type": "string", "const": "accessories" }, { + "title": "Inline string", "type": "string", "const": "similars" }, { + "title": "Inline string", "type": "string", "const": "suggestions" } @@ -2066,11 +2154,11 @@ "description": "VTEX Cross Selling API. This loader only works on routes of type /:slug/p" }, "count": { + "title": "Count", "type": [ "number", "null" - ], - "title": "Count" + ] } }, "required": [], @@ -2080,25 +2168,25 @@ "type": "object", "properties": { "domain": { + "title": "Domain", "type": "string", - "description": "Your VNDA domain name. For example, https://mystore.vnda.com.br", - "title": "Domain" + "description": "Your VNDA domain name. For example, https://mystore.vnda.com.br" }, "authToken": { + "title": "Auth Token", "type": "string", - "description": "The token generated from admin panel. Read here: https://developers.vnda.com.br/docs/chave-de-acesso-e-requisicoes. Do not add any other permissions than catalog.", - "title": "Auth Token" + "description": "The token generated from admin panel. Read here: https://developers.vnda.com.br/docs/chave-de-acesso-e-requisicoes. Do not add any other permissions than catalog." }, "useSandbox": { + "title": "Use Sandbox", "type": "boolean", - "description": "Define if sandbox environment should be used", - "title": "Use Sandbox" + "description": "Define if sandbox environment should be used" }, "defaultPriceCurrency": { + "title": "Default Price Currency", "type": "string", "description": "Default price currency.", - "default": "USD", - "title": "Default Price Currency" + "default": "USD" } }, "required": [ @@ -2113,12 +2201,12 @@ "type": "object", "properties": { "token": { - "type": "string", - "title": "Token" + "title": "Token", + "type": "string" }, "appId": { - "type": "string", - "title": "App Id" + "title": "App Id", + "type": "string" } }, "required": [ @@ -2142,39 +2230,39 @@ ], "properties": { "account": { + "title": "Account", "type": "string", - "description": "VTEX Account name. For more info, read here: https://help.vtex.com/en/tutorial/o-que-e-account-name--i0mIGLcg3QyEy8OCicEoC.", - "title": "Account" + "description": "VTEX Account name. For more info, read here: https://help.vtex.com/en/tutorial/o-que-e-account-name--i0mIGLcg3QyEy8OCicEoC." }, "defaultLocale": { + "title": "Default Locale", "type": "string", - "description": "Locale used for VTEX Intelligent Search client.", - "title": "Default Locale" + "description": "Locale used for VTEX Intelligent Search client." }, "defaultPriceCurrency": { + "title": "Default Price Currency", "type": "string", "description": "Default price currency.", - "default": "USD", - "title": "Default Price Currency" + "default": "USD" }, "defaultSalesChannel": { + "title": "Default Sales Channel", "type": "string", - "description": "VTEX sales channel. This will be the default sales channel your site. For more info, read here: https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV", - "title": "Default Sales Channel" + "description": "VTEX sales channel. This will be the default sales channel your site. For more info, read here: https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV" }, "defaultRegionId": { + "title": "Default Region Id", "type": [ "string", "null" - ], - "title": "Default Region Id" + ] }, "defaultHideUnnavailableItems": { + "title": "Default Hide Unnavailable Items", "type": [ "boolean", "null" - ], - "title": "Default Hide Unnavailable Items" + ] } }, "required": [ @@ -2194,14 +2282,14 @@ ], "properties": { "storeName": { + "title": "Store Name", "type": "string", - "description": "Shopify store name.", - "title": "Store Name" + "description": "Shopify store name." }, "storefrontAccessToken": { + "title": "Storefront Access Token", "type": "string", - "description": "Shopify storefront access token.", - "title": "Storefront Access Token" + "description": "Shopify storefront access token." } }, "required": [ @@ -2219,15 +2307,15 @@ ], "properties": { "baseUrl": { - "type": "string", - "title": "Base Url" + "title": "Base Url", + "type": "string" }, "nrpp": { + "title": "Nrpp", "type": [ "string", "null" - ], - "title": "Nrpp" + ] } }, "required": [ @@ -2239,8 +2327,8 @@ "type": "object", "properties": { "fact": { - "type": "string", - "title": "Fact" + "title": "Fact", + "type": "string" } }, "required": [ @@ -2287,11 +2375,11 @@ "type": "object", "properties": { "numberOfFacts": { + "title": "Number Of Facts", "type": [ "number", "null" - ], - "title": "Number Of Facts" + ] } }, "required": [], @@ -2301,16 +2389,16 @@ "type": "object", "properties": { "id": { - "type": "number", - "title": "Id" + "title": "Id", + "type": "number" }, "quantity": { - "type": "number", - "title": "Quantity" + "title": "Quantity", + "type": "number" }, "seller": { - "type": "string", - "title": "Seller" + "title": "Seller", + "type": "string" } }, "required": [ @@ -2337,13 +2425,15 @@ "title": "deco-sites/fashion/components/ui/ShippingSimulation.tsx@Props" }, "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9mbGFnLnRz@Flag": { - "$ref": "#/root/flags" + "$ref": "#/root/flags", + "title": "Flag" }, "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9mbGFnLnRz@Flag[]": { "type": "array", "items": { "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9mbGFnLnRz@Flag" - } + }, + "title": "Flag[]" }, "ZGVjby1jeC9saXZlLnRzL2hhbmRsZXJzL3JvdXRlc1NlbGVjdGlvbi50cw==@SelectionConfig": { "type": "object", @@ -2359,7 +2449,8 @@ "title": "deco-cx/live.ts/handlers/routesSelection.ts@SelectionConfig" }, "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler": { - "$ref": "#/root/handlers" + "$ref": "#/root/handlers", + "title": "Handler" }, "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler@record": { "title": "Unknown record", @@ -2372,11 +2463,11 @@ "type": "object", "properties": { "base": { + "title": "Base", "type": [ "string", "null" - ], - "title": "Base" + ] }, "routes": { "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler@record", @@ -2389,7 +2480,8 @@ "title": "deco-cx/live.ts/handlers/router.ts@RouterConfig" }, "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9wYWdlLnRz@Page": { - "$ref": "#/root/pages" + "$ref": "#/root/pages", + "title": "Page" }, "ZGVjby1jeC9saXZlLnRzL2hhbmRsZXJzL2RldlBhZ2UudHM=@DevConfig": { "type": "object", @@ -2418,20 +2510,22 @@ "title": "deco-cx/live.ts/handlers/fresh.ts@FreshConfig" }, "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9zZWN0aW9uLnRz@Section": { - "$ref": "#/root/sections" + "$ref": "#/root/sections", + "title": "Section" }, "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9zZWN0aW9uLnRz@Section[]": { "type": "array", "items": { "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9zZWN0aW9uLnRz@Section" - } + }, + "title": "Section[]" }, "ZGVjby1jeC9saXZlLnRzL3BhZ2VzL0xpdmVQYWdlLnRzeA==@Props": { "type": "object", "properties": { "name": { - "type": "string", - "title": "Name" + "title": "Name", + "type": "string" }, "sections": { "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9zZWN0aW9uLnRz@Section[]", @@ -2448,12 +2542,12 @@ "type": "object", "properties": { "label": { - "type": "string", - "title": "Label" + "title": "Label", + "type": "string" }, "href": { - "type": "string", - "title": "Href" + "title": "Href", + "type": "string" } }, "required": [ @@ -2466,9 +2560,11 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvTGlua1RyZWUudHN4@Link" - } + }, + "title": "Link[]" }, "ZGVjby1zaXRlcy9zdGQvY29tcG9uZW50cy90eXBlcy50cw==@Image": { + "title": "Inline string", "type": "string", "format": "image-uri" }, @@ -2478,10 +2574,12 @@ "label": { "anyOf": [ { + "title": "Inline string", "type": "string", "const": "Instagram" }, { + "title": "Inline string", "type": "string", "const": "Facebook" } @@ -2490,8 +2588,8 @@ "title": "Label" }, "href": { - "type": "string", - "title": "Href" + "title": "Href", + "type": "string" } }, "required": [ @@ -2504,24 +2602,25 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvTGlua1RyZWUudHN4@Social" - } + }, + "title": "Social[]" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvTGlua1RyZWUudHN4@Props": { "type": "object", "properties": { "title": { + "title": "Title", "type": [ "string", "null" - ], - "title": "Title" + ] }, "description": { + "title": "Description", "type": [ "string", "null" - ], - "title": "Description" + ] }, "links": { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvTGlua1RyZWUudHN4@Link[]", @@ -2549,134 +2648,167 @@ "icon": { "anyOf": [ { + "title": "Inline string", "type": "string", "const": "ChevronLeft" }, { + "title": "Inline string", "type": "string", "const": "ChevronRight" }, { + "title": "Inline string", "type": "string", "const": "ChevronUp" }, { + "title": "Inline string", "type": "string", "const": "ChevronDown" }, { + "title": "Inline string", "type": "string", "const": "QuestionMarkCircle" }, { + "title": "Inline string", "type": "string", "const": "User" }, { + "title": "Inline string", "type": "string", "const": "ShoppingCart" }, { + "title": "Inline string", "type": "string", "const": "Bars3" }, { + "title": "Inline string", "type": "string", "const": "Heart" }, { + "title": "Inline string", "type": "string", "const": "MagnifyingGlass" }, { + "title": "Inline string", "type": "string", "const": "XMark" }, { + "title": "Inline string", "type": "string", "const": "Plus" }, { + "title": "Inline string", "type": "string", "const": "Minus" }, { + "title": "Inline string", "type": "string", "const": "MapPin" }, { + "title": "Inline string", "type": "string", "const": "Phone" }, { + "title": "Inline string", "type": "string", "const": "Elo" }, { + "title": "Inline string", "type": "string", "const": "Mastercard" }, { + "title": "Inline string", "type": "string", "const": "Visa" }, { + "title": "Inline string", "type": "string", "const": "Pix" }, { + "title": "Inline string", "type": "string", "const": "Logo" }, { + "title": "Inline string", "type": "string", "const": "Facebook" }, { + "title": "Inline string", "type": "string", "const": "Instagram" }, { + "title": "Inline string", "type": "string", "const": "Tiktok" }, { + "title": "Inline string", "type": "string", "const": "Truck" }, { + "title": "Inline string", "type": "string", "const": "Discount" }, { + "title": "Inline string", "type": "string", "const": "Return" }, { + "title": "Inline string", "type": "string", "const": "CreditCard" }, { + "title": "Inline string", "type": "string", "const": "Deco" }, { + "title": "Inline string", "type": "string", "const": "Discord" }, { + "title": "Inline string", "type": "string", "const": "Trash" }, { + "title": "Inline string", "type": "string", "const": "FilterList" }, { + "title": "Inline string", "type": "string", "const": "WhatsApp" }, { + "title": "Inline string", "type": "string", "const": "ArrowsPointingOut" } @@ -2686,14 +2818,14 @@ "title": "Icon" }, "title": { + "title": "Title", "type": "string", - "description": "Title", - "title": "Title" + "description": "Title" }, "description": { + "title": "Description", "type": "string", - "description": "Description and Image alt text", - "title": "Description" + "description": "Description and Image alt text" } }, "required": [ @@ -2707,7 +2839,8 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvRmVhdHVyZXMudHN4@Feature" - } + }, + "title": "Feature[]" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvRmVhdHVyZXMudHN4@Props": { "type": "object", @@ -2726,25 +2859,25 @@ "type": "object", "properties": { "matcher": { + "title": "Matcher", "type": "string", - "description": "RegExp to enable this banner on the current URL. Use /feminino/* to display this banner on feminino category", - "title": "Matcher" + "description": "RegExp to enable this banner on the current URL. Use /feminino/* to display this banner on feminino category" }, "title": { + "title": "Title", "type": [ "string", "null" ], - "description": "text to be rendered on top of the image", - "title": "Title" + "description": "text to be rendered on top of the image" }, "subtitle": { + "title": "Subtitle", "type": [ "string", "null" ], - "description": "text to be rendered on top of the image", - "title": "Subtitle" + "description": "text to be rendered on top of the image" }, "image": { "type": "object", @@ -2758,11 +2891,11 @@ "title": "Mobile" }, "alt": { + "title": "Alt", "type": [ "string", "null" - ], - "title": "Alt" + ] } }, "required": [ @@ -2782,7 +2915,8 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvQmFubmVyUExQLnRzeA==@Banner" - } + }, + "title": "Banner[]" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvQmFubmVyUExQLnRzeA==@Props": { "type": "object", @@ -2811,14 +2945,14 @@ "title": "Src Desktop" }, "alt": { + "title": "Alt", "type": "string", - "description": "Image alt text", - "title": "Alt" + "description": "Image alt text" }, "href": { + "title": "Href", "type": "string", - "description": "When you click you go to", - "title": "Href" + "description": "When you click you go to" } }, "required": [ @@ -2832,34 +2966,35 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvQmFubmVyR3JpZC50c3g=@Banner" - } + }, + "title": "Banner[]" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvQmFubmVyR3JpZC50c3g=@Props": { "type": "object", "properties": { "title": { + "title": "Title", "type": [ "string", "null" - ], - "title": "Title" + ] }, "itemsPerLine": { "type": "object", "properties": { "mobile": { + "title": "Mobile", "type": [ "number", "null" - ], - "title": "Mobile" + ] }, "desktop": { + "title": "Desktop", "type": [ "number", "null" - ], - "title": "Desktop" + ] } }, "required": [], @@ -2870,18 +3005,18 @@ "type": "object", "properties": { "mobile": { + "title": "Mobile", "type": [ "number", "null" - ], - "title": "Mobile" + ] }, "desktop": { + "title": "Desktop", "type": [ "number", "null" - ], - "title": "Desktop" + ] } }, "required": [], @@ -2904,15 +3039,15 @@ "type": "object", "properties": { "title": { - "type": "string", - "title": "Title" + "title": "Title", + "type": "string" }, "itemsPerPage": { + "title": "Items Per Page", "type": [ "number", "null" - ], - "title": "Items Per Page" + ] } }, "required": [ @@ -2920,7 +3055,7 @@ ], "title": "omitcHJvZHVjdHM=Props" }, - "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@cd6fe400c08631e5c1c2a9b91520991e&omitcHJvZHVjdHM=Props": { + "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@667018fc6b0c5c75c94a2edfc11a277b&omitcHJvZHVjdHM=Props": { "allOf": [ { "type": "object", @@ -2938,7 +3073,7 @@ "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@omitcHJvZHVjdHM=Props" } ], - "title": "deco-sites/fashion/components/product/ProductShelf.tsx@cd6fe400c08631e5c1c2a9b91520991e&omitcHJvZHVjdHM=Props" + "title": "deco-sites/fashion/components/product/ProductShelf.tsx@667018fc6b0c5c75c94a2edfc11a277b&omitcHJvZHVjdHM=Props" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvc2VhcmNoL1NlYXJjaFJlc3VsdC50c3g=@Props": { "type": "object", @@ -2950,10 +3085,12 @@ "variant": { "anyOf": [ { + "title": "Inline string", "type": "string", "const": "aside" }, { + "title": "Inline string", "type": "string", "const": "drawer" } @@ -2966,18 +3103,18 @@ "type": "object", "properties": { "mobile": { + "title": "Mobile", "type": [ "number", "null" - ], - "title": "Mobile" + ] }, "desktop": { + "title": "Desktop", "type": [ "number", "null" - ], - "title": "Desktop" + ] } }, "required": [], @@ -2995,19 +3132,19 @@ "type": "object", "properties": { "title": { - "type": "string", - "title": "Title" + "title": "Title", + "type": "string" }, "products": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Product[]|null", "title": "Products" }, "itemsPerPage": { + "title": "Items Per Page", "type": [ "number", "null" - ], - "title": "Items Per Page" + ] } }, "required": [ @@ -3020,12 +3157,12 @@ "type": "object", "properties": { "label": { - "type": "string", - "title": "Label" + "title": "Label", + "type": "string" }, "href": { - "type": "string", - "title": "Href" + "title": "Href", + "type": "string" } }, "required": [ @@ -3040,134 +3177,167 @@ "icon": { "anyOf": [ { + "title": "Inline string", "type": "string", "const": "ChevronLeft" }, { + "title": "Inline string", "type": "string", "const": "ChevronRight" }, { + "title": "Inline string", "type": "string", "const": "ChevronUp" }, { + "title": "Inline string", "type": "string", "const": "ChevronDown" }, { + "title": "Inline string", "type": "string", "const": "QuestionMarkCircle" }, { + "title": "Inline string", "type": "string", "const": "User" }, { + "title": "Inline string", "type": "string", "const": "ShoppingCart" }, { + "title": "Inline string", "type": "string", "const": "Bars3" }, { + "title": "Inline string", "type": "string", "const": "Heart" }, { + "title": "Inline string", "type": "string", "const": "MagnifyingGlass" }, { + "title": "Inline string", "type": "string", "const": "XMark" }, { + "title": "Inline string", "type": "string", "const": "Plus" }, { + "title": "Inline string", "type": "string", "const": "Minus" }, { + "title": "Inline string", "type": "string", "const": "MapPin" }, { + "title": "Inline string", "type": "string", "const": "Phone" }, { + "title": "Inline string", "type": "string", "const": "Elo" }, { + "title": "Inline string", "type": "string", "const": "Mastercard" }, { + "title": "Inline string", "type": "string", "const": "Visa" }, { + "title": "Inline string", "type": "string", "const": "Pix" }, { + "title": "Inline string", "type": "string", "const": "Logo" }, { + "title": "Inline string", "type": "string", "const": "Facebook" }, { + "title": "Inline string", "type": "string", "const": "Instagram" }, { + "title": "Inline string", "type": "string", "const": "Tiktok" }, { + "title": "Inline string", "type": "string", "const": "Truck" }, { + "title": "Inline string", "type": "string", "const": "Discount" }, { + "title": "Inline string", "type": "string", "const": "Return" }, { + "title": "Inline string", "type": "string", "const": "CreditCard" }, { + "title": "Inline string", "type": "string", "const": "Deco" }, { + "title": "Inline string", "type": "string", "const": "Discord" }, { + "title": "Inline string", "type": "string", "const": "Trash" }, { + "title": "Inline string", "type": "string", "const": "FilterList" }, { + "title": "Inline string", "type": "string", "const": "WhatsApp" }, { + "title": "Inline string", "type": "string", "const": "ArrowsPointingOut" } @@ -3189,20 +3359,22 @@ { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvZm9vdGVyL0Zvb3Rlci50c3g=@IconItem" } - ] + ], + "title": "IconItem|StringItem" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvZm9vdGVyL0Zvb3Rlci50c3g=@IconItem|StringItem[]": { "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvZm9vdGVyL0Zvb3Rlci50c3g=@IconItem|StringItem" - } + }, + "title": "IconItem|StringItem[]" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvZm9vdGVyL0Zvb3Rlci50c3g=@Section": { "type": "object", "properties": { "label": { - "type": "string", - "title": "Label" + "title": "Label", + "type": "string" }, "children": { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvZm9vdGVyL0Zvb3Rlci50c3g=@IconItem|StringItem[]", @@ -3219,7 +3391,8 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvZm9vdGVyL0Zvb3Rlci50c3g=@Section" - } + }, + "title": "Section[]" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvZm9vdGVyL0Zvb3Rlci50c3g=@Props": { "type": "object", @@ -3236,38 +3409,38 @@ "type": "object", "properties": { "placeholder": { + "title": "Placeholder", "type": [ "string", "null" ], - "title": "Placeholder", "description": "Search bar default placeholder message", "default": "What are you looking for?" }, "action": { + "title": "Action", "type": [ "string", "null" ], - "title": "Action", "description": "When user clicks on the search button, navigate it to", "default": "/s" }, "name": { + "title": "Name", "type": [ "string", "null" ], - "title": "Name", "description": "Querystring param used when navigating the user", "default": "q" }, "query": { + "title": "Query", "type": [ "string", "null" - ], - "title": "Query" + ] } }, "required": [], @@ -3277,12 +3450,12 @@ "type": "object", "properties": { "label": { - "type": "string", - "title": "Label" + "title": "Label", + "type": "string" }, "href": { - "type": "string", - "title": "Href" + "title": "Href", + "type": "string" }, "children": { "type": "array", @@ -3290,12 +3463,12 @@ "type": "object", "properties": { "label": { - "type": "string", - "title": "Label" + "title": "Label", + "type": "string" }, "href": { - "type": "string", - "title": "Href" + "title": "Href", + "type": "string" }, "children": { "type": "array", @@ -3303,12 +3476,12 @@ "type": "object", "properties": { "label": { - "type": "string", - "title": "Label" + "title": "Label", + "type": "string" }, "href": { - "type": "string", - "title": "Href" + "title": "Href", + "type": "string" } }, "required": [ @@ -3334,11 +3507,11 @@ "title": "Src" }, "alt": { + "title": "Alt", "type": [ "string", "null" - ], - "title": "Alt" + ] } }, "required": [], @@ -3355,7 +3528,8 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvaGVhZGVyL0hlYWRlci50c3g=@NavItem" - } + }, + "title": "NavItem[]" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvaGVhZGVyL0hlYWRlci50c3g=@Props": { "type": "object", @@ -3363,6 +3537,7 @@ "alerts": { "type": "array", "items": { + "title": "Inline string", "type": "string" }, "title": "Alerts" @@ -3396,23 +3571,25 @@ ], "title": "deco-sites/fashion/components/header/Header.tsx@Props" }, - "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0RvZ0ZhY3RzLnRzeA==@LoadProps": { + "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0RvZ0ZhY3RzLnRzeA==@LoaderProps": { "type": "object", - "allOf": [ - { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2xvYWRlcnMvZG9nQXBpRmFjdHMudHM=@Props" - } - ], "properties": { "title": { - "type": "string", - "title": "Title" + "title": "Title", + "type": "string" + }, + "numberOfFacts": { + "title": "Number Of Facts", + "type": [ + "number", + "null" + ] } }, "required": [ "title" ], - "title": "deco-sites/fashion/sections/DogFacts.tsx@LoadProps" + "title": "deco-sites/fashion/sections/DogFacts.tsx@LoaderProps" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0RGV0YWlscy50c3g=@Props": { "type": "object", @@ -3424,14 +3601,17 @@ "variant": { "anyOf": [ { + "title": "Inline string", "type": "string", "const": "front-back" }, { + "title": "Inline string", "type": "string", "const": "slider" }, { + "title": "Inline string", "type": "string", "const": "auto" } @@ -3454,16 +3634,16 @@ "title": "Src" }, "alt": { - "type": "string", - "title": "Alt" + "title": "Alt", + "type": "string" }, "href": { - "type": "string", - "title": "Href" + "title": "Href", + "type": "string" }, "label": { - "type": "string", - "title": "Label" + "title": "Label", + "type": "string" } }, "required": [ @@ -3478,7 +3658,8 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvSGlnaGxpZ2h0cy50c3g=@Highlight" - } + }, + "title": "Highlight[]" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvSGlnaGxpZ2h0cy50c3g=@Props": { "type": "object", @@ -3488,8 +3669,8 @@ "title": "Highlights" }, "title": { - "type": "string", - "title": "Title" + "title": "Title", + "type": "string" } }, "required": [ @@ -3501,11 +3682,11 @@ "type": "object", "properties": { "phone": { + "title": "Phone", "type": [ "number", "null" - ], - "title": "Phone" + ] } }, "required": [], @@ -3515,10 +3696,10 @@ "type": "object", "properties": { "type": { + "title": "Type", "type": "string", "const": "VTEX", - "default": "VTEX", - "title": "Type" + "default": "VTEX" } }, "required": [ @@ -3534,16 +3715,17 @@ { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@PlatformVTEX" } - ] + ], + "title": "PlatformVTEX&Props" }, "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@PlatformShopify": { "type": "object", "properties": { "type": { + "title": "Type", "type": "string", "const": "Shopify", - "default": "Shopify", - "title": "Type" + "default": "Shopify" } }, "required": [ @@ -3559,7 +3741,8 @@ { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL1Byb2R1Y3RTaGVsZkdldFByb3BzLnRzeA==@PlatformShopify" } - ] + ], + "title": "PlatformShopify&Props" }, "ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Z0ZXhQcm9kdWN0TGlzdC50cw==@PlatformShopify&Props|PlatformVTEX&Props": { "anyOf": [ @@ -3569,7 +3752,8 @@ { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvZnVuY3Rpb25zL3Nob3BpZnlQcm9kdWN0TGlzdC50cw==@PlatformShopify&Props" } - ] + ], + "title": "PlatformShopify&Props|PlatformVTEX&Props" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@PlatformShopify&Props|PlatformVTEX&Props&omitcHJvZHVjdHM=Props": { "allOf": [ @@ -3596,28 +3780,28 @@ "title": "Mobile" }, "alt": { + "title": "Alt", "type": "string", - "description": "Image's alt text", - "title": "Alt" + "description": "Image's alt text" }, "action": { "type": "object", "properties": { "href": { - "type": "string", - "title": "Href" + "title": "Href", + "type": "string" }, "title": { - "type": "string", - "title": "Title" + "title": "Title", + "type": "string" }, "subTitle": { - "type": "string", - "title": "Sub Title" + "title": "Sub Title", + "type": "string" }, "label": { - "type": "string", - "title": "Label" + "title": "Label", + "type": "string" } }, "required": [ @@ -3640,7 +3824,8 @@ "type": "array", "items": { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvQmFubmVyQ2Fyb3VzZWwudHN4@Banner" - } + }, + "title": "Banner[]" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvQmFubmVyQ2Fyb3VzZWwudHN4@Props": { "type": "object", @@ -3650,19 +3835,19 @@ "title": "Images" }, "preload": { + "title": "Preload", "type": [ "boolean", "null" ], - "description": "Check this option when this banner is the biggest image on the screen for image optimizations", - "title": "Preload" + "description": "Check this option when this banner is the biggest image on the screen for image optimizations" }, "interval": { + "title": "Interval", "type": [ "number", "null" ], - "title": "Interval", "description": "time (in seconds) to start the carousel autoplay" } }, @@ -3686,40 +3871,40 @@ "type": "object", "properties": { "title": { + "title": "Title", "type": [ "string", "null" - ], - "title": "Title" + ] }, "description": { + "title": "Description", "type": [ "string", "null" - ], - "title": "Description" + ] }, "canonical": { + "title": "Canonical", "type": [ "string", "null" ], - "title": "Canonical", "default": "https://example.com" }, "imageUrl": { + "title": "Image Url", "type": [ "string", "null" - ], - "title": "Image Url" + ] }, "themeColor": { + "title": "Theme Color", "type": [ "string", "null" - ], - "title": "Theme Color" + ] } }, "required": [], @@ -3733,39 +3918,39 @@ "title": "Page" }, "title": { + "title": "Title", "type": [ "string", "null" - ], - "title": "Title" + ] }, "description": { + "title": "Description", "type": [ "string", "null" - ], - "title": "Description" + ] }, "url": { + "title": "Url", "type": [ "string", "null" - ], - "title": "Url" + ] }, "imageUrl": { + "title": "Image Url", "type": [ "string", "null" - ], - "title": "Image Url" + ] }, "themeColor": { + "title": "Theme Color", "type": [ "string", "null" - ], - "title": "Theme Color" + ] } }, "required": [ @@ -3779,6 +3964,7 @@ "trackingIds": { "type": "array", "items": { + "title": "Inline string", "type": "string" }, "description": "google tag manager container id. For more info: https://developers.google.com/tag-platform/tag-manager/web#standard_web_page_installation .", @@ -3796,25 +3982,25 @@ "title": "Page" }, "titleTemplate": { - "type": "string", "title": "Title Template", + "type": "string", "description": "add a %s whenever you want it to be replaced with the product name", "default": "%s | Fashion Store" }, "description": { + "title": "Description", "type": [ "string", "null" ], - "title": "Description", "description": "If not set, the product description will be used instead" }, "themeColor": { + "title": "Theme Color", "type": [ "string", "null" - ], - "title": "Theme Color" + ] } }, "required": [ @@ -3827,20 +4013,20 @@ "type": "object", "properties": { "start": { + "title": "Start", "type": [ "string", "null" ], - "format": "date-time", - "title": "Start" + "format": "date-time" }, "end": { + "title": "End", "type": [ "string", "null" ], - "format": "date-time", - "title": "End" + "format": "date-time" } }, "required": [], @@ -3850,18 +4036,18 @@ "type": "object", "properties": { "includes": { + "title": "Includes", "type": [ "string", "null" - ], - "title": "Includes" + ] }, "match": { + "title": "Match", "type": [ "string", "null" - ], - "title": "Match" + ] } }, "required": [], @@ -3871,8 +4057,8 @@ "type": "object", "properties": { "siteId": { - "type": "number", - "title": "Site Id" + "title": "Site Id", + "type": "number" } }, "required": [ @@ -3881,13 +4067,15 @@ "title": "deco-cx/live.ts/matchers/MatchSite.ts@Props" }, "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9tYXRjaGVyLnRz@Matcher": { - "$ref": "#/root/matchers" + "$ref": "#/root/matchers", + "title": "Matcher" }, "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9tYXRjaGVyLnRz@Matcher[]": { "type": "array", "items": { "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9tYXRjaGVyLnRz@Matcher" - } + }, + "title": "Matcher[]" }, "ZGVjby1jeC9saXZlLnRzL21hdGNoZXJzL01hdGNoTXVsdGkudHM=@Props": { "type": "object", @@ -3895,10 +4083,12 @@ "op": { "anyOf": [ { + "title": "Inline string", "type": "string", "const": "or" }, { + "title": "Inline string", "type": "string", "const": "and" } @@ -3921,8 +4111,8 @@ "type": "object", "properties": { "traffic": { - "type": "number", - "title": "Traffic" + "title": "Traffic", + "type": "number" } }, "required": [ @@ -3936,10 +4126,12 @@ "environment": { "anyOf": [ { + "title": "Inline string", "type": "string", "const": "production" }, { + "title": "Inline string", "type": "string", "const": "development" } @@ -3961,8 +4153,8 @@ "title": "Matcher" }, "name": { - "type": "string", - "title": "Name" + "title": "Name", + "type": "string" }, "routes": { "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler@record", @@ -3972,6 +4164,7 @@ "title": "Overrides", "type": "object", "additionalProperties": { + "title": "Inline string", "type": "string" } } @@ -3994,6 +4187,7 @@ "title": "Overrides", "type": "object", "additionalProperties": { + "title": "Inline string", "type": "string" } } @@ -4829,7 +5023,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@cd6fe400c08631e5c1c2a9b91520991e&omitcHJvZHVjdHM=Props" + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@667018fc6b0c5c75c94a2edfc11a277b&omitcHJvZHVjdHM=Props" } ], "required": [ @@ -4950,7 +5144,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0RvZ0ZhY3RzLnRzeA==@LoadProps" + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0RvZ0ZhY3RzLnRzeA==@LoaderProps" } ], "required": [ diff --git a/sections/DogFacts.tsx b/sections/DogFacts.tsx index 62375a15..790a0e8d 100644 --- a/sections/DogFacts.tsx +++ b/sections/DogFacts.tsx @@ -1,33 +1,31 @@ -import { PropsLoader } from "$live/mod.ts"; -import dogApiFacts, { - DogFact, - Props as DogFactsProps, -} from "deco-sites/fashion/loaders/dogApiFacts.ts"; +import type { LoaderContext } from "$live/types.ts"; +import type { SectionProps } from "$live/mod.ts"; -export interface Props { - title: string; - dogFacts: DogFact[]; -} - -export default function DogFacts({ title, dogFacts }: Props) { +export default function DogFacts( + { title, dogFacts }: SectionProps, +) { return (

{title}

    - {dogFacts.map(({ fact }) =>
  • {fact}
  • )} + {dogFacts.map((fact) =>
  • {fact}
  • )}
); } // Props type that will be configured in deco.cx's Admin -export interface LoadProps extends DogFactsProps { +export interface LoaderProps { title: string; + numberOfFacts?: number; } -export const loader: PropsLoader< - Props, - LoadProps -> = { - dogFacts: dogApiFacts, -}; +export async function loader( + _req: Request, + { state: { $live: { numberOfFacts, title } } }: LoaderContext, +) { + const { facts: dogFacts } = (await fetch( + `https://dogapi.dog/api/facts?number=${numberOfFacts ?? 1}`, + ).then((r) => r.json())) as { facts: string[] }; + return { dogFacts, title }; +} From cf086f360fa3e4bc8a4554d4b760ccb8f6c1a9e1 Mon Sep 17 00:00:00 2001 From: Marcos Candeia Date: Sat, 8 Apr 2023 16:00:15 -0300 Subject: [PATCH 14/15] Allow preview islands Signed-off-by: Marcos Candeia --- import_map.json | 2 +- islands/DogFacts.tsx | 40 +++++++++++++++++++++ live.gen.ts | 6 ++-- schemas.gen.json | 84 +++++++++++++++++++++++++++++++++----------- 4 files changed, 109 insertions(+), 23 deletions(-) create mode 100644 islands/DogFacts.tsx diff --git a/import_map.json b/import_map.json index 2dacecef..eceb54f5 100644 --- a/import_map.json +++ b/import_map.json @@ -1,7 +1,7 @@ { "imports": { "$store/": "./", - "$live/": "https://denopkg.com/deco-cx/live.ts@01afaf1c75b8360d50bc39b4096de80cf4b4613e/", + "$live/": "https://denopkg.com/deco-cx/live.ts@185343dbaf9481672495b4f999f97a6d97d2f4ea/", "deco-sites/std/": "https://denopkg.com/deco-sites/std@1.0.0-rc.11/", "deco-sites/fashion/": "./", "partytown/": "https://deno.land/x/partytown@0.2.1/", diff --git a/islands/DogFacts.tsx b/islands/DogFacts.tsx new file mode 100644 index 00000000..72e34034 --- /dev/null +++ b/islands/DogFacts.tsx @@ -0,0 +1,40 @@ +import type { SectionProps } from "$live/mod.ts"; +import type { LoaderContext } from "$live/types.ts"; +import { useCallback, useState } from "preact/compat"; + +export default function DogFacts( + { title, dogFacts }: SectionProps, +) { + const [value, setValue] = useState(0); + const increment = useCallback(() => { + setValue(value + 1); + }, [value]); + return ( + <> +
+

{title}

+
    + {dogFacts.map((fact) =>
  • {fact}
  • )} +
+
+

Counter: {value}

+ + + ); +} + +// Props type that will be configured in deco.cx's Admin +export interface LoaderProps { + title: string; + numberOfFacts?: number; +} + +export async function loader( + _req: Request, + { state: { $live: { numberOfFacts, title } } }: LoaderContext, +) { + const { facts: dogFacts } = (await fetch( + `https://dogapi.dog/api/facts?number=${numberOfFacts ?? 1}`, + ).then((r) => r.json())) as { facts: string[] }; + return { dogFacts, title }; +} diff --git a/live.gen.ts b/live.gen.ts index eb3a2576..7ba87abb 100644 --- a/live.gen.ts +++ b/live.gen.ts @@ -17,7 +17,8 @@ import * as $$$$$5 from "./islands/HeaderModals.tsx"; import * as $$$$$6 from "./islands/SliderJS.tsx"; import * as $$$$$7 from "./islands/ProductImageZoom.tsx"; import * as $$$$$8 from "./islands/ViewSendEvent.tsx"; -import * as $$$$$9 from "./islands/SearchControls.tsx"; +import * as $$$$$9 from "./islands/DogFacts.tsx"; +import * as $$$$$10 from "./islands/SearchControls.tsx"; import * as $$$$$$$$0 from "./sections/LinkTree.tsx"; import * as $$$$$$$$1 from "./sections/DesignSystem.story.tsx"; import * as $$$$$$$$2 from "./sections/Features.tsx"; @@ -114,7 +115,8 @@ const manifest: DecoManifest = { "./islands/SliderJS.tsx": $$$$$6, "./islands/ProductImageZoom.tsx": $$$$$7, "./islands/ViewSendEvent.tsx": $$$$$8, - "./islands/SearchControls.tsx": $$$$$9, + "./islands/DogFacts.tsx": $$$$$9, + "./islands/SearchControls.tsx": $$$$$10, }, "sections": { "deco-sites/fashion/sections/LinkTree.tsx": $$$$$$$$0, diff --git a/schemas.gen.json b/schemas.gen.json index aa978e09..eee8bb06 100644 --- a/schemas.gen.json +++ b/schemas.gen.json @@ -2424,6 +2424,26 @@ ], "title": "deco-sites/fashion/components/ui/ShippingSimulation.tsx@Props" }, + "ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvRG9nRmFjdHMudHN4@LoaderProps": { + "type": "object", + "properties": { + "title": { + "title": "Title", + "type": "string" + }, + "numberOfFacts": { + "title": "Number Of Facts", + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "title" + ], + "title": "deco-sites/fashion/islands/DogFacts.tsx@LoaderProps" + }, "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9mbGFnLnRz@Flag": { "$ref": "#/root/flags", "title": "Flag" @@ -4648,7 +4668,7 @@ } } }, - "ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvU2hpcHBpbmdTaW11bGF0aW9uLnRzeA==": { + "Li9pc2xhbmRzL1NoaXBwaW5nU2ltdWxhdGlvbi50c3g=": { "title": "./islands/ShippingSimulation.tsx", "type": "object", "allOf": [ @@ -4669,7 +4689,7 @@ } } }, - "ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvSGVhZGVyQnV0dG9uLnRzeA==": { + "Li9pc2xhbmRzL0hlYWRlckJ1dHRvbi50c3g=": { "title": "./islands/HeaderButton.tsx", "type": "object", "required": [ @@ -4685,7 +4705,7 @@ } } }, - "ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvU2VuZEV2ZW50QnV0dG9uLnRzeA==": { + "Li9pc2xhbmRzL1NlbmRFdmVudEJ1dHRvbi50c3g=": { "title": "./islands/SendEventButton.tsx", "type": "object", "required": [ @@ -4701,7 +4721,7 @@ } } }, - "ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvSGVhZGVyU2VhcmNoTWVudS50c3g=": { + "Li9pc2xhbmRzL0hlYWRlclNlYXJjaE1lbnUudHN4": { "title": "./islands/HeaderSearchMenu.tsx", "type": "object", "required": [ @@ -4717,7 +4737,7 @@ } } }, - "ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvQWRkVG9DYXJ0QnV0dG9uLnRzeA==": { + "Li9pc2xhbmRzL0FkZFRvQ2FydEJ1dHRvbi50c3g=": { "title": "./islands/AddToCartButton.tsx", "type": "object", "required": [ @@ -4733,7 +4753,7 @@ } } }, - "ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvSGVhZGVyTW9kYWxzLnRzeA==": { + "Li9pc2xhbmRzL0hlYWRlck1vZGFscy50c3g=": { "title": "./islands/HeaderModals.tsx", "type": "object", "required": [ @@ -4749,7 +4769,7 @@ } } }, - "ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvU2xpZGVySlMudHN4": { + "Li9pc2xhbmRzL1NsaWRlckpTLnRzeA==": { "title": "./islands/SliderJS.tsx", "type": "object", "required": [ @@ -4765,7 +4785,7 @@ } } }, - "ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvUHJvZHVjdEltYWdlWm9vbS50c3g=": { + "Li9pc2xhbmRzL1Byb2R1Y3RJbWFnZVpvb20udHN4": { "title": "./islands/ProductImageZoom.tsx", "type": "object", "required": [ @@ -4781,7 +4801,7 @@ } } }, - "ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvVmlld1NlbmRFdmVudC50c3g=": { + "Li9pc2xhbmRzL1ZpZXdTZW5kRXZlbnQudHN4": { "title": "./islands/ViewSendEvent.tsx", "type": "object", "required": [ @@ -4797,7 +4817,28 @@ } } }, - "ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvU2VhcmNoQ29udHJvbHMudHN4": { + "Li9pc2xhbmRzL0RvZ0ZhY3RzLnRzeA==": { + "title": "./islands/DogFacts.tsx", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvRG9nRmFjdHMudHN4@LoaderProps" + } + ], + "required": [ + "__resolveType" + ], + "properties": { + "__resolveType": { + "type": "string", + "enum": [ + "./islands/DogFacts.tsx" + ], + "default": "./islands/DogFacts.tsx" + } + } + }, + "Li9pc2xhbmRzL1NlYXJjaENvbnRyb2xzLnRzeA==": { "title": "./islands/SearchControls.tsx", "type": "object", "required": [ @@ -5790,34 +5831,37 @@ "$ref": "#/definitions/Resolvable" }, { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvU2hpcHBpbmdTaW11bGF0aW9uLnRzeA==" + "$ref": "#/definitions/Li9pc2xhbmRzL1NoaXBwaW5nU2ltdWxhdGlvbi50c3g=" + }, + { + "$ref": "#/definitions/Li9pc2xhbmRzL0hlYWRlckJ1dHRvbi50c3g=" }, { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvSGVhZGVyQnV0dG9uLnRzeA==" + "$ref": "#/definitions/Li9pc2xhbmRzL1NlbmRFdmVudEJ1dHRvbi50c3g=" }, { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvU2VuZEV2ZW50QnV0dG9uLnRzeA==" + "$ref": "#/definitions/Li9pc2xhbmRzL0hlYWRlclNlYXJjaE1lbnUudHN4" }, { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvSGVhZGVyU2VhcmNoTWVudS50c3g=" + "$ref": "#/definitions/Li9pc2xhbmRzL0FkZFRvQ2FydEJ1dHRvbi50c3g=" }, { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvQWRkVG9DYXJ0QnV0dG9uLnRzeA==" + "$ref": "#/definitions/Li9pc2xhbmRzL0hlYWRlck1vZGFscy50c3g=" }, { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvSGVhZGVyTW9kYWxzLnRzeA==" + "$ref": "#/definitions/Li9pc2xhbmRzL1NsaWRlckpTLnRzeA==" }, { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvU2xpZGVySlMudHN4" + "$ref": "#/definitions/Li9pc2xhbmRzL1Byb2R1Y3RJbWFnZVpvb20udHN4" }, { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvUHJvZHVjdEltYWdlWm9vbS50c3g=" + "$ref": "#/definitions/Li9pc2xhbmRzL1ZpZXdTZW5kRXZlbnQudHN4" }, { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvVmlld1NlbmRFdmVudC50c3g=" + "$ref": "#/definitions/Li9pc2xhbmRzL0RvZ0ZhY3RzLnRzeA==" }, { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2lzbGFuZHMvU2VhcmNoQ29udHJvbHMudHN4" + "$ref": "#/definitions/Li9pc2xhbmRzL1NlYXJjaENvbnRyb2xzLnRzeA==" } ] }, From 64a4a76685d6e707bc294f16249626dd4c48e475 Mon Sep 17 00:00:00 2001 From: Marcos Candeia Date: Sun, 9 Apr 2023 09:12:35 -0300 Subject: [PATCH 15/15] Minor fixes on live Signed-off-by: Marcos Candeia --- import_map.json | 2 +- islands/DogFacts.tsx | 21 + live.gen.ts | 56 +- schemas.gen.json | 1049 +++++++++++++++++--------------------- sections/DogFacts_v2.tsx | 41 ++ 5 files changed, 574 insertions(+), 595 deletions(-) create mode 100644 sections/DogFacts_v2.tsx diff --git a/import_map.json b/import_map.json index eceb54f5..87851715 100644 --- a/import_map.json +++ b/import_map.json @@ -1,7 +1,7 @@ { "imports": { "$store/": "./", - "$live/": "https://denopkg.com/deco-cx/live.ts@185343dbaf9481672495b4f999f97a6d97d2f4ea/", + "$live/": "https://denopkg.com/deco-cx/live.ts@e2c8ef8e220fc55fddd779cec06a59b3ce8fe491/", "deco-sites/std/": "https://denopkg.com/deco-sites/std@1.0.0-rc.11/", "deco-sites/fashion/": "./", "partytown/": "https://deno.land/x/partytown@0.2.1/", diff --git a/islands/DogFacts.tsx b/islands/DogFacts.tsx index 72e34034..ed9c2288 100644 --- a/islands/DogFacts.tsx +++ b/islands/DogFacts.tsx @@ -1,7 +1,12 @@ import type { SectionProps } from "$live/mod.ts"; +import { onServer } from "$live/routes/live/rpc/[func].ts"; import type { LoaderContext } from "$live/types.ts"; import { useCallback, useState } from "preact/compat"; +const getEnvVar = onServer("myIslandFunc", (_, envVar: string) => { + return Deno.env.get(envVar); +}); + export default function DogFacts( { title, dogFacts }: SectionProps, ) { @@ -9,6 +14,10 @@ export default function DogFacts( const increment = useCallback(() => { setValue(value + 1); }, [value]); + + const [envVarKey, setEnvVarKey] = useState(""); + + const [envVarValue, setEnvVarValue] = useState(undefined); return ( <>
@@ -19,6 +28,18 @@ export default function DogFacts(

Counter: {value}

+ setEnvVarKey(e?.currentTarget?.value ?? "")} + /> +

EnvVar value: {envVarValue}

+ ); } diff --git a/live.gen.ts b/live.gen.ts index 7ba87abb..2a7f42fc 100644 --- a/live.gen.ts +++ b/live.gen.ts @@ -23,20 +23,22 @@ import * as $$$$$$$$0 from "./sections/LinkTree.tsx"; import * as $$$$$$$$1 from "./sections/DesignSystem.story.tsx"; import * as $$$$$$$$2 from "./sections/Features.tsx"; import * as $$$$$$$$3 from "./sections/BannerPLP.tsx"; -import * as $$$$$$$$4 from "./sections/BannerGrid.tsx"; -import * as $$$$$$$$5 from "./sections/VtexProductShelf.tsx"; -import * as $$$$$$$$6 from "./sections/SearchResult.tsx"; -import * as $$$$$$$$7 from "./sections/ProductShelf.tsx"; -import * as $$$$$$$$8 from "./sections/Footer.tsx"; -import * as $$$$$$$$9 from "./sections/CookieConsent.tsx"; -import * as $$$$$$$$10 from "./sections/Header.tsx"; -import * as $$$$$$$$11 from "./sections/DogFacts.tsx"; -import * as $$$$$$$$12 from "./sections/ProductDetails.tsx"; -import * as $$$$$$$$13 from "./sections/Highlights.tsx"; -import * as $$$$$$$$14 from "./sections/WhatsApp.tsx"; -import * as $$$$$$$$15 from "./sections/ProductShelfGetProps.tsx"; -import * as $$$$$$$$16 from "./sections/Carousel.tsx"; +import * as $$$$$$$$4 from "./sections/DogFacts_v2.tsx"; +import * as $$$$$$$$5 from "./sections/BannerGrid.tsx"; +import * as $$$$$$$$6 from "./sections/VtexProductShelf.tsx"; +import * as $$$$$$$$7 from "./sections/SearchResult.tsx"; +import * as $$$$$$$$8 from "./sections/ProductShelf.tsx"; +import * as $$$$$$$$9 from "./sections/Footer.tsx"; +import * as $$$$$$$$10 from "./sections/CookieConsent.tsx"; +import * as $$$$$$$$11 from "./sections/Header.tsx"; +import * as $$$$$$$$12 from "./sections/DogFacts.tsx"; +import * as $$$$$$$$13 from "./sections/ProductDetails.tsx"; +import * as $$$$$$$$14 from "./sections/Highlights.tsx"; +import * as $$$$$$$$15 from "./sections/WhatsApp.tsx"; +import * as $$$$$$$$16 from "./sections/ProductShelfGetProps.tsx"; +import * as $$$$$$$$17 from "./sections/Carousel.tsx"; import * as $live_middleware from "$live/routes/_middleware.ts"; +import * as $live_rpc from "$live/routes/live/rpc/[func].ts"; import * as $live_workbench from "$live/routes/live/workbench.ts"; import * as $live_editorData from "$live/routes/live/editorData.ts"; import * as $live_inspect from "$live/routes/live/inspect.ts"; @@ -98,6 +100,7 @@ const manifest: DecoManifest = { "./routes/api/[...catchall].tsx": $$$$0, "./routes/_app.tsx": $$$$1, "./routes/_middleware.ts": $live_middleware, + "./routes/live/rpc/[func].ts": $live_rpc, "./routes/live/workbench.ts": $live_workbench, "./routes/live/editorData.ts": $live_editorData, "./routes/live/inspect.ts": $live_inspect, @@ -123,19 +126,20 @@ const manifest: DecoManifest = { "deco-sites/fashion/sections/DesignSystem.story.tsx": $$$$$$$$1, "deco-sites/fashion/sections/Features.tsx": $$$$$$$$2, "deco-sites/fashion/sections/BannerPLP.tsx": $$$$$$$$3, - "deco-sites/fashion/sections/BannerGrid.tsx": $$$$$$$$4, - "deco-sites/fashion/sections/VtexProductShelf.tsx": $$$$$$$$5, - "deco-sites/fashion/sections/SearchResult.tsx": $$$$$$$$6, - "deco-sites/fashion/sections/ProductShelf.tsx": $$$$$$$$7, - "deco-sites/fashion/sections/Footer.tsx": $$$$$$$$8, - "deco-sites/fashion/sections/CookieConsent.tsx": $$$$$$$$9, - "deco-sites/fashion/sections/Header.tsx": $$$$$$$$10, - "deco-sites/fashion/sections/DogFacts.tsx": $$$$$$$$11, - "deco-sites/fashion/sections/ProductDetails.tsx": $$$$$$$$12, - "deco-sites/fashion/sections/Highlights.tsx": $$$$$$$$13, - "deco-sites/fashion/sections/WhatsApp.tsx": $$$$$$$$14, - "deco-sites/fashion/sections/ProductShelfGetProps.tsx": $$$$$$$$15, - "deco-sites/fashion/sections/Carousel.tsx": $$$$$$$$16, + "deco-sites/fashion/sections/DogFacts_v2.tsx": $$$$$$$$4, + "deco-sites/fashion/sections/BannerGrid.tsx": $$$$$$$$5, + "deco-sites/fashion/sections/VtexProductShelf.tsx": $$$$$$$$6, + "deco-sites/fashion/sections/SearchResult.tsx": $$$$$$$$7, + "deco-sites/fashion/sections/ProductShelf.tsx": $$$$$$$$8, + "deco-sites/fashion/sections/Footer.tsx": $$$$$$$$9, + "deco-sites/fashion/sections/CookieConsent.tsx": $$$$$$$$10, + "deco-sites/fashion/sections/Header.tsx": $$$$$$$$11, + "deco-sites/fashion/sections/DogFacts.tsx": $$$$$$$$12, + "deco-sites/fashion/sections/ProductDetails.tsx": $$$$$$$$13, + "deco-sites/fashion/sections/Highlights.tsx": $$$$$$$$14, + "deco-sites/fashion/sections/WhatsApp.tsx": $$$$$$$$15, + "deco-sites/fashion/sections/ProductShelfGetProps.tsx": $$$$$$$$16, + "deco-sites/fashion/sections/Carousel.tsx": $$$$$$$$17, "$live/sections/PageInclude.tsx": i2$$$9, "deco-sites/std/sections/configYourViews.global.tsx": i2$$$0, "deco-sites/std/sections/SEO.tsx": i2$$$1, diff --git a/schemas.gen.json b/schemas.gen.json index eee8bb06..248d26be 100644 --- a/schemas.gen.json +++ b/schemas.gen.json @@ -22,16 +22,16 @@ "type": "object", "properties": { "account": { - "title": "Account", - "type": "string" + "type": "string", + "title": "Account" }, "defaultLocale": { - "title": "Default Locale", - "type": "string" + "type": "string", + "title": "Default Locale" }, "defaultPriceCurrency": { - "title": "Default Price Currency", - "type": "string" + "type": "string", + "title": "Default Price Currency" } }, "required": [ @@ -71,16 +71,16 @@ ], "properties": { "@type": { - "title": "@type", "type": "string", - "const": "ListItem" + "const": "ListItem", + "title": "@type" }, "item": { "title": "Item" }, "position": { - "title": "Position", - "type": "number" + "type": "number", + "title": "Position" } }, "required": [ @@ -110,8 +110,8 @@ "title": "Item List Element" }, "numberOfItems": { - "title": "Number Of Items", - "type": "number" + "type": "number", + "title": "Number Of Items" } }, "required": [ @@ -129,9 +129,9 @@ ], "properties": { "@type": { - "title": "@type", "type": "string", - "const": "BreadcrumbList" + "const": "BreadcrumbList", + "title": "@type" } }, "required": [ @@ -143,12 +143,12 @@ "type": "object", "properties": { "label": { - "title": "Label", - "type": "string" + "type": "string", + "title": "Label" }, "key": { - "title": "Key", - "type": "string" + "type": "string", + "title": "Key" } }, "required": [ @@ -161,24 +161,24 @@ "type": "object", "properties": { "quantity": { - "title": "Quantity", - "type": "number" + "type": "number", + "title": "Quantity" }, "label": { - "title": "Label", - "type": "string" + "type": "string", + "title": "Label" }, "value": { - "title": "Value", - "type": "string" + "type": "string", + "title": "Value" }, "selected": { - "title": "Selected", - "type": "boolean" + "type": "boolean", + "title": "Selected" }, "url": { - "title": "Url", - "type": "string" + "type": "string", + "title": "Url" } }, "required": [ @@ -206,17 +206,17 @@ ], "properties": { "@type": { - "title": "@type", "type": "string", - "const": "FilterToggle" + "const": "FilterToggle", + "title": "@type" }, "values": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@FilterToggleValue[]", "title": "Values" }, "quantity": { - "title": "Quantity", - "type": "number" + "type": "number", + "title": "Quantity" } }, "required": [ @@ -230,12 +230,12 @@ "type": "object", "properties": { "min": { - "title": "Min", - "type": "number" + "type": "number", + "title": "Min" }, "max": { - "title": "Max", - "type": "number" + "type": "number", + "title": "Max" } }, "required": [ @@ -253,9 +253,9 @@ ], "properties": { "@type": { - "title": "@type", "type": "string", - "const": "FilterRange" + "const": "FilterRange", + "title": "@type" }, "values": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@FilterRangeValue", @@ -295,9 +295,9 @@ ], "properties": { "@type": { - "title": "@type", "type": "string", - "const": "ImageObject" + "const": "ImageObject", + "title": "@type" } }, "required": [ @@ -316,78 +316,78 @@ "type": "object", "properties": { "@id": { - "title": "@id", "type": [ "string", "null" - ] + ], + "title": "@id" }, "additionalType": { - "title": "Additional Type", "type": [ "string", "null" - ] + ], + "title": "Additional Type" }, "alternateName": { - "title": "Alternate Name", "type": [ "string", "null" - ] + ], + "title": "Alternate Name" }, "description": { - "title": "Description", "type": [ "string", "null" - ] + ], + "title": "Description" }, "disambiguatingDescription": { - "title": "Disambiguating Description", "type": [ "string", "null" - ] + ], + "title": "Disambiguating Description" }, "identifier": { - "title": "Identifier", "type": [ "string", "null" - ] + ], + "title": "Identifier" }, "image": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ImageObject[]", "title": "Image" }, "name": { - "title": "Name", "type": [ "string", "null" - ] + ], + "title": "Name" }, "sameAs": { - "title": "Same As", "type": [ "string", "null" - ] + ], + "title": "Same As" }, "subjectOf": { - "title": "Subject Of", "type": [ "string", "null" - ] + ], + "title": "Subject Of" }, "url": { - "title": "Url", "type": [ "string", "null" - ] + ], + "title": "Url" } }, "required": [], @@ -402,58 +402,58 @@ ], "properties": { "@type": { - "title": "@type", "type": "string", - "const": "PropertyValue" + "const": "PropertyValue", + "title": "@type" }, "maxValue": { - "title": "Max Value", "type": [ "number", "null" - ] + ], + "title": "Max Value" }, "minValue": { - "title": "Min Value", "type": [ "number", "null" - ] + ], + "title": "Min Value" }, "propertyID": { - "title": "Property I D", "type": [ "string", "null" - ] + ], + "title": "Property I D" }, "unitCode": { - "title": "Unit Code", "type": [ "string", "null" - ] + ], + "title": "Unit Code" }, "unitText": { - "title": "Unit Text", "type": [ "string", "null" - ] + ], + "title": "Unit Text" }, "value": { - "title": "Value", "type": [ "string", "null" - ] + ], + "title": "Value" }, "valueReference": { - "title": "Value Reference", "type": [ "string", "null" - ] + ], + "title": "Value Reference" } }, "required": [ @@ -472,30 +472,30 @@ "type": "object", "properties": { "@type": { - "title": "@type", "type": "string", - "const": "AggregateRating" + "const": "AggregateRating", + "title": "@type" }, "ratingCount": { - "title": "Rating Count", "type": [ "number", "null" - ] + ], + "title": "Rating Count" }, "reviewCount": { - "title": "Review Count", "type": [ "number", "null" - ] + ], + "title": "Review Count" }, "ratingValue": { - "title": "Rating Value", "type": [ "number", "null" - ] + ], + "title": "Rating Value" } }, "required": [ @@ -530,17 +530,17 @@ ], "properties": { "@type": { - "title": "@type", "type": "string", - "const": "ProductGroup" + "const": "ProductGroup", + "title": "@type" }, "hasVariant": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductLeaf[]", "title": "Has Variant" }, "productGroupID": { - "title": "Product Group I D", - "type": "string" + "type": "string", + "title": "Product Group I D" }, "additionalProperty": { "type": "array", @@ -550,11 +550,11 @@ "title": "Additional Property" }, "model": { - "title": "Model", "type": [ "string", "null" - ] + ], + "title": "Model" } }, "required": [ @@ -569,11 +569,11 @@ "type": "object", "properties": { "value": { - "title": "Value", "type": [ "number", "null" - ] + ], + "title": "Value" } }, "required": [], @@ -592,15 +592,15 @@ "title": "Eligible Quantity" }, "price": { - "title": "Price", - "type": "number" + "type": "number", + "title": "Price" }, "priceCurrency": { - "title": "Price Currency", "type": [ "string", "null" - ] + ], + "title": "Price Currency" } }, "required": [ @@ -617,39 +617,33 @@ ], "properties": { "@type": { - "title": "@type", "type": "string", - "const": "UnitPriceSpecification" + "const": "UnitPriceSpecification", + "title": "@type" }, "priceComponentType": { "anyOf": [ { - "title": "Inline string", "type": "string", "const": "https://schema.org/ActivationFee" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/CleaningFee" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/DistanceFee" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/Downpayment" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/Installment" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/Subscription" } @@ -660,32 +654,26 @@ "priceType": { "anyOf": [ { - "title": "Inline string", "type": "string", "const": "https://schema.org/InvoicePrice" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/ListPrice" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/MinimumAdvertisedPrice" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/MSRP" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/SalePrice" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/SRP" } @@ -694,18 +682,18 @@ "title": "Price Type" }, "billingDuration": { - "title": "Billing Duration", "type": [ "number", "null" - ] + ], + "title": "Billing Duration" }, "billingIncrement": { - "title": "Billing Increment", "type": [ "number", "null" - ] + ], + "title": "Billing Increment" } }, "required": [ @@ -730,59 +718,49 @@ ], "properties": { "@type": { - "title": "@type", "type": "string", - "const": "Offer" + "const": "Offer", + "title": "@type" }, "availability": { "anyOf": [ { - "title": "Inline string", "type": "string", "const": "https://schema.org/BackOrder" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/Discontinued" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/InStock" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/InStoreOnly" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/LimitedAvailability" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/OnlineOnly" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/OutOfStock" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/PreOrder" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/PreSale" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/SoldOut" } @@ -791,11 +769,11 @@ "title": "Availability" }, "gtin": { - "title": "Gtin", "type": [ "string", "null" - ] + ], + "title": "Gtin" }, "inventoryLevel": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@QuantitativeValue", @@ -804,22 +782,18 @@ "itemCondition": { "anyOf": [ { - "title": "Inline string", "type": "string", "const": "https://schema.org/DamagedCondition" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/NewCondition" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/RefurbishedCondition" }, { - "title": "Inline string", "type": "string", "const": "https://schema.org/UsedCondition" } @@ -828,33 +802,33 @@ "title": "Item Condition" }, "price": { - "title": "Price", - "type": "number" + "type": "number", + "title": "Price" }, "priceSpecification": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@UnitPriceSpecification[]", "title": "Price Specification" }, "priceValidUntil": { - "title": "Price Valid Until", "type": [ "string", "null" - ] + ], + "title": "Price Valid Until" }, "seller": { - "title": "Seller", "type": [ "string", "null" - ] + ], + "title": "Seller" }, "sku": { - "title": "Sku", "type": [ "string", "null" - ] + ], + "title": "Sku" } }, "required": [ @@ -877,32 +851,32 @@ "type": "object", "properties": { "@type": { - "title": "@type", "type": "string", - "const": "AggregateOffer" + "const": "AggregateOffer", + "title": "@type" }, "highPrice": { - "title": "High Price", - "type": "number" + "type": "number", + "title": "High Price" }, "lowPrice": { - "title": "Low Price", - "type": "number" + "type": "number", + "title": "Low Price" }, "offerCount": { - "title": "Offer Count", - "type": "number" + "type": "number", + "title": "Offer Count" }, "offers": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Offer[]", "title": "Offers" }, "priceCurrency": { - "title": "Price Currency", "type": [ "string", "null" - ] + ], + "title": "Price Currency" } }, "required": [ @@ -923,21 +897,20 @@ ], "properties": { "@type": { - "title": "@type", "type": "string", - "const": "Review" + "const": "Review", + "title": "@type" }, "itemReviewed": { - "title": "Item Reviewed", "type": [ "string", "null" - ] + ], + "title": "Item Reviewed" }, "negativeNotes": { "type": "array", "items": { - "title": "Inline string", "type": "string" }, "title": "Negative Notes" @@ -945,24 +918,23 @@ "positiveNotes": { "type": "array", "items": { - "title": "Inline string", "type": "string" }, "title": "Positive Notes" }, "reviewAspect": { - "title": "Review Aspect", "type": [ "string", "null" - ] + ], + "title": "Review Aspect" }, "reviewBody": { - "title": "Review Body", "type": [ "string", "null" - ] + ], + "title": "Review Body" }, "reviewRating": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@AggregateRating", @@ -983,9 +955,9 @@ ], "properties": { "@type": { - "title": "@type", "type": "string", - "const": "Product" + "const": "Product", + "title": "@type" }, "additionalProperty": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@PropertyValue[]", @@ -996,39 +968,39 @@ "title": "Aggregate Rating" }, "award": { - "title": "Award", "type": [ "string", "null" - ] + ], + "title": "Award" }, "brand": { - "title": "Brand", "type": [ "string", "null" - ] + ], + "title": "Brand" }, "category": { - "title": "Category", "type": [ "string", "null" - ] + ], + "title": "Category" }, "gtin": { - "title": "Gtin", "type": [ "string", "null" - ] + ], + "title": "Gtin" }, "inProductGroupWithID": { - "title": "In Product Group With I D", "type": [ "string", "null" - ] + ], + "title": "In Product Group With I D" }, "isVariantOf": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductGroup", @@ -1039,30 +1011,30 @@ "title": "Offers" }, "productID": { - "title": "Product I D", - "type": "string" + "type": "string", + "title": "Product I D" }, "productionDate": { - "title": "Production Date", "type": [ "string", "null" - ] + ], + "title": "Production Date" }, "releaseDate": { - "title": "Release Date", "type": [ "string", "null" - ] + ], + "title": "Release Date" }, "review": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Review", "title": "Review" }, "sku": { - "title": "Sku", - "type": "string" + "type": "string", + "title": "Sku" } }, "required": [ @@ -1083,12 +1055,12 @@ "type": "object", "properties": { "value": { - "title": "Value", - "type": "string" + "type": "string", + "title": "Value" }, "label": { - "title": "Label", - "type": "string" + "type": "string", + "title": "Label" } }, "required": [ @@ -1108,9 +1080,9 @@ "type": "object", "properties": { "@type": { - "title": "@type", "type": "string", - "const": "ProductListingPage" + "const": "ProductListingPage", + "title": "@type" }, "breadcrumb": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@BreadcrumbList", @@ -1128,17 +1100,15 @@ "type": "object", "properties": { "currentPage": { - "title": "Current Page", - "type": "number" + "type": "number", + "title": "Current Page" }, "nextPage": { "anyOf": [ { - "title": "Inline string", "type": "string" }, { - "title": "Inline null", "type": "null" } ], @@ -1147,11 +1117,9 @@ "previousPage": { "anyOf": [ { - "title": "Inline string", "type": "string" }, { - "title": "Inline null", "type": "null" } ], @@ -1188,7 +1156,6 @@ "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductListingPage" }, { - "title": "Inline null", "type": "null" }, { @@ -1281,32 +1248,29 @@ "type": "object", "properties": { "query": { - "title": "Query", "type": [ "string", "null" ], - "description": "overides the query term" + "description": "overides the query term", + "title": "Query" }, "count": { - "title": "Count", "type": "number", + "title": "Count", "description": "number of products per page to display" }, "fuzzy": { "anyOf": [ { - "title": "Inline string", "type": "string", "const": "automatic" }, { - "title": "Inline string", "type": "string", "const": "disabled" }, { - "title": "Inline string", "type": "string", "const": "enabled" } @@ -1329,7 +1293,6 @@ "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Product[]" }, { - "title": "Inline null", "type": "null" }, { @@ -1443,45 +1406,41 @@ "type": "object", "properties": { "limit": { - "title": "Limit", "type": "number", - "description": "total number of items to display" + "description": "total number of items to display", + "title": "Limit" }, "term": { - "title": "Term", "type": [ "string", "null" ], - "description": "query to use on search" + "description": "query to use on search", + "title": "Term" }, "wildcard": { - "title": "Wildcard", "type": [ "boolean", "null" ], - "description": "search for term anywhere" + "description": "search for term anywhere", + "title": "Wildcard" }, "sort": { "anyOf": [ { - "title": "Inline string", "type": "string", "const": "newest" }, { - "title": "Inline string", "type": "string", "const": "oldest" }, { - "title": "Inline string", "type": "string", "const": "lowest_price" }, { - "title": "Inline string", "type": "string", "const": "highest_price" } @@ -1493,7 +1452,6 @@ "tags": { "type": "array", "items": { - "title": "Inline string", "type": "string" }, "description": "search for products that have certain tag", @@ -1509,9 +1467,9 @@ "type": "object", "properties": { "@type": { - "title": "@type", "type": "string", - "const": "ProductDetailsPage" + "const": "ProductDetailsPage", + "title": "@type" }, "breadcrumbList": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@BreadcrumbList", @@ -1538,7 +1496,6 @@ "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@ProductDetailsPage" }, { - "title": "Inline null", "type": "null" }, { @@ -1627,8 +1584,8 @@ "type": "object", "properties": { "term": { - "title": "Term", - "type": "string" + "type": "string", + "title": "Term" } }, "required": [ @@ -1667,7 +1624,6 @@ "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Suggestion" }, { - "title": "Inline null", "type": "null" }, { @@ -1697,13 +1653,13 @@ "type": "object", "properties": { "count": { - "title": "Count", "type": [ "number", "null" ], "description": "limit the number of searches", - "default": "4" + "default": "4", + "title": "Count" } }, "required": [], @@ -1713,29 +1669,29 @@ "type": "object", "properties": { "label": { - "title": "Label", - "type": "string" + "type": "string", + "title": "Label" }, "href": { - "title": "Href", - "type": "string" + "type": "string", + "title": "Href" }, "image": { "type": "object", "properties": { "src": { - "title": "Src", "type": [ "string", "null" - ] + ], + "title": "Src" }, "alt": { - "title": "Alt", "type": [ "string", "null" - ] + ], + "title": "Alt" } }, "required": [], @@ -1759,7 +1715,6 @@ "children": { "type": "array", "items": { - "title": "Inline object", "type": "object" }, "title": "Children" @@ -1784,7 +1739,6 @@ "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Navbar[]" }, { - "title": "Inline null", "type": "null" }, { @@ -1814,13 +1768,13 @@ "type": "object", "properties": { "levels": { - "title": "Levels", "type": [ "number", "null" ], "description": "Number of levels of categories to be returned", - "default": "2" + "default": "2", + "title": "Levels" } }, "required": [], @@ -1830,16 +1784,16 @@ "type": "object", "properties": { "query": { - "title": "Query", "type": [ "string", "null" ], - "description": "overides the query term" + "description": "overides the query term", + "title": "Query" }, "count": { - "title": "Count", "type": "number", + "title": "Count", "description": "number of products per page to display" } }, @@ -1852,54 +1806,46 @@ "type": "object", "properties": { "query": { - "title": "Query", "type": "string", - "description": "query to use on search" + "description": "query to use on search", + "title": "Query" }, "count": { - "title": "Count", "type": "number", - "description": "total number of items to display" + "description": "total number of items to display", + "title": "Count" }, "sort": { "anyOf": [ { - "title": "Inline string", "type": "string", "const": "" }, { - "title": "Inline string", "type": "string", "const": "price:desc" }, { - "title": "Inline string", "type": "string", "const": "price:asc" }, { - "title": "Inline string", "type": "string", "const": "orders:desc" }, { - "title": "Inline string", "type": "string", "const": "name:desc" }, { - "title": "Inline string", "type": "string", "const": "name:asc" }, { - "title": "Inline string", "type": "string", "const": "release:desc" }, { - "title": "Inline string", "type": "string", "const": "discount:desc" } @@ -1911,7 +1857,6 @@ "collection": { "type": "array", "items": { - "title": "Inline string", "type": "string" }, "description": "Collection ID or (Product Cluster id). For more info: https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/search .", @@ -1929,25 +1874,24 @@ "type": "object", "properties": { "term": { - "title": "Term", "type": [ "string", "null" ], - "description": "overides the query term" + "description": "overides the query term", + "title": "Term" }, "tags": { "type": "array", "items": { - "title": "Inline string", "type": "string" }, "description": "filter products by tag", "title": "Tags" }, "count": { - "title": "Count", "type": "number", + "title": "Count", "description": "number of products per page to display" } }, @@ -1960,40 +1904,40 @@ "type": "object", "properties": { "term": { - "title": "Term", "type": [ "string", "null" ], - "description": "overides the query term" + "description": "overides the query term", + "title": "Term" }, "count": { - "title": "Count", "type": "number", + "title": "Count", "description": "number of products per page to display" }, "ft": { - "title": "Ft", "type": [ "string", "null" ], - "description": "FullText term" + "description": "FullText term", + "title": "Ft" }, "fq": { - "title": "Fq", "type": [ "string", "null" - ] + ], + "title": "Fq" }, "map": { - "title": "Map", "type": [ "string", "null" ], - "description": "map param" + "description": "map param", + "title": "Map" } }, "required": [ @@ -2005,54 +1949,46 @@ "type": "object", "properties": { "query": { - "title": "Query", "type": "string", - "description": "query to use on search" + "description": "query to use on search", + "title": "Query" }, "count": { - "title": "Count", "type": "number", - "description": "total number of items to display" + "description": "total number of items to display", + "title": "Count" }, "sort": { "anyOf": [ { - "title": "Inline string", "type": "string", "const": "" }, { - "title": "Inline string", "type": "string", "const": "price:desc" }, { - "title": "Inline string", "type": "string", "const": "price:asc" }, { - "title": "Inline string", "type": "string", "const": "orders:desc" }, { - "title": "Inline string", "type": "string", "const": "name:desc" }, { - "title": "Inline string", "type": "string", "const": "name:asc" }, { - "title": "Inline string", "type": "string", "const": "release:desc" }, { - "title": "Inline string", "type": "string", "const": "discount:desc" } @@ -2064,7 +2000,6 @@ "collection": { "type": "array", "items": { - "title": "Inline string", "type": "string" }, "description": "Collection ID or (Product Cluster id). For more info: https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/search .", @@ -2082,14 +2017,14 @@ "type": "object", "properties": { "query": { - "title": "Query", "type": "string", - "description": "search term to use on search" + "description": "search term to use on search", + "title": "Query" }, "count": { - "title": "Count", "type": "number", - "description": "total number of items to display" + "description": "total number of items to display", + "title": "Count" } }, "required": [ @@ -2104,44 +2039,36 @@ "crossSelling": { "anyOf": [ { - "title": "Inline string", "type": "string", "const": "" }, { "anyOf": [ { - "title": "Inline string", "type": "string", "const": "whosawalsosaw" }, { - "title": "Inline string", "type": "string", "const": "whosawalsobought" }, { - "title": "Inline string", "type": "string", "const": "whoboughtalsobought" }, { - "title": "Inline string", "type": "string", "const": "showtogether" }, { - "title": "Inline string", "type": "string", "const": "accessories" }, { - "title": "Inline string", "type": "string", "const": "similars" }, { - "title": "Inline string", "type": "string", "const": "suggestions" } @@ -2154,11 +2081,11 @@ "description": "VTEX Cross Selling API. This loader only works on routes of type /:slug/p" }, "count": { - "title": "Count", "type": [ "number", "null" - ] + ], + "title": "Count" } }, "required": [], @@ -2168,25 +2095,25 @@ "type": "object", "properties": { "domain": { - "title": "Domain", "type": "string", - "description": "Your VNDA domain name. For example, https://mystore.vnda.com.br" + "description": "Your VNDA domain name. For example, https://mystore.vnda.com.br", + "title": "Domain" }, "authToken": { - "title": "Auth Token", "type": "string", - "description": "The token generated from admin panel. Read here: https://developers.vnda.com.br/docs/chave-de-acesso-e-requisicoes. Do not add any other permissions than catalog." + "description": "The token generated from admin panel. Read here: https://developers.vnda.com.br/docs/chave-de-acesso-e-requisicoes. Do not add any other permissions than catalog.", + "title": "Auth Token" }, "useSandbox": { - "title": "Use Sandbox", "type": "boolean", - "description": "Define if sandbox environment should be used" + "description": "Define if sandbox environment should be used", + "title": "Use Sandbox" }, "defaultPriceCurrency": { - "title": "Default Price Currency", "type": "string", "description": "Default price currency.", - "default": "USD" + "default": "USD", + "title": "Default Price Currency" } }, "required": [ @@ -2201,12 +2128,12 @@ "type": "object", "properties": { "token": { - "title": "Token", - "type": "string" + "type": "string", + "title": "Token" }, "appId": { - "title": "App Id", - "type": "string" + "type": "string", + "title": "App Id" } }, "required": [ @@ -2230,39 +2157,39 @@ ], "properties": { "account": { - "title": "Account", "type": "string", - "description": "VTEX Account name. For more info, read here: https://help.vtex.com/en/tutorial/o-que-e-account-name--i0mIGLcg3QyEy8OCicEoC." + "description": "VTEX Account name. For more info, read here: https://help.vtex.com/en/tutorial/o-que-e-account-name--i0mIGLcg3QyEy8OCicEoC.", + "title": "Account" }, "defaultLocale": { - "title": "Default Locale", "type": "string", - "description": "Locale used for VTEX Intelligent Search client." + "description": "Locale used for VTEX Intelligent Search client.", + "title": "Default Locale" }, "defaultPriceCurrency": { - "title": "Default Price Currency", "type": "string", "description": "Default price currency.", - "default": "USD" + "default": "USD", + "title": "Default Price Currency" }, "defaultSalesChannel": { - "title": "Default Sales Channel", "type": "string", - "description": "VTEX sales channel. This will be the default sales channel your site. For more info, read here: https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV" + "description": "VTEX sales channel. This will be the default sales channel your site. For more info, read here: https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV", + "title": "Default Sales Channel" }, "defaultRegionId": { - "title": "Default Region Id", "type": [ "string", "null" - ] + ], + "title": "Default Region Id" }, "defaultHideUnnavailableItems": { - "title": "Default Hide Unnavailable Items", "type": [ "boolean", "null" - ] + ], + "title": "Default Hide Unnavailable Items" } }, "required": [ @@ -2282,14 +2209,14 @@ ], "properties": { "storeName": { - "title": "Store Name", "type": "string", - "description": "Shopify store name." + "description": "Shopify store name.", + "title": "Store Name" }, "storefrontAccessToken": { - "title": "Storefront Access Token", "type": "string", - "description": "Shopify storefront access token." + "description": "Shopify storefront access token.", + "title": "Storefront Access Token" } }, "required": [ @@ -2307,15 +2234,15 @@ ], "properties": { "baseUrl": { - "title": "Base Url", - "type": "string" + "type": "string", + "title": "Base Url" }, "nrpp": { - "title": "Nrpp", "type": [ "string", "null" - ] + ], + "title": "Nrpp" } }, "required": [ @@ -2327,8 +2254,8 @@ "type": "object", "properties": { "fact": { - "title": "Fact", - "type": "string" + "type": "string", + "title": "Fact" } }, "required": [ @@ -2375,11 +2302,11 @@ "type": "object", "properties": { "numberOfFacts": { - "title": "Number Of Facts", "type": [ "number", "null" - ] + ], + "title": "Number Of Facts" } }, "required": [], @@ -2389,16 +2316,16 @@ "type": "object", "properties": { "id": { - "title": "Id", - "type": "number" + "type": "number", + "title": "Id" }, "quantity": { - "title": "Quantity", - "type": "number" + "type": "number", + "title": "Quantity" }, "seller": { - "title": "Seller", - "type": "string" + "type": "string", + "title": "Seller" } }, "required": [ @@ -2428,15 +2355,15 @@ "type": "object", "properties": { "title": { - "title": "Title", - "type": "string" + "type": "string", + "title": "Title" }, "numberOfFacts": { - "title": "Number Of Facts", "type": [ "number", "null" - ] + ], + "title": "Number Of Facts" } }, "required": [ @@ -2483,11 +2410,11 @@ "type": "object", "properties": { "base": { - "title": "Base", "type": [ "string", "null" - ] + ], + "title": "Base" }, "routes": { "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler@record", @@ -2533,22 +2460,37 @@ "$ref": "#/root/sections", "title": "Section" }, - "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9zZWN0aW9uLnRz@Section[]": { + "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9pc2xhbmQudHM=@Island": { + "$ref": "#/root/islands", + "title": "Island" + }, + "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9zZWN0aW9uLnRz@Island|Section": { + "anyOf": [ + { + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9zZWN0aW9uLnRz@Section" + }, + { + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9pc2xhbmQudHM=@Island" + } + ], + "title": "Island|Section" + }, + "ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9zZWN0aW9uLnRz@Island|Section[]": { "type": "array", "items": { - "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9zZWN0aW9uLnRz@Section" + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9zZWN0aW9uLnRz@Island|Section" }, - "title": "Section[]" + "title": "Island|Section[]" }, "ZGVjby1jeC9saXZlLnRzL3BhZ2VzL0xpdmVQYWdlLnRzeA==@Props": { "type": "object", "properties": { "name": { - "title": "Name", - "type": "string" + "type": "string", + "title": "Name" }, "sections": { - "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9zZWN0aW9uLnRz@Section[]", + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9zZWN0aW9uLnRz@Island|Section[]", "title": "Sections" } }, @@ -2562,12 +2504,12 @@ "type": "object", "properties": { "label": { - "title": "Label", - "type": "string" + "type": "string", + "title": "Label" }, "href": { - "title": "Href", - "type": "string" + "type": "string", + "title": "Href" } }, "required": [ @@ -2584,9 +2526,9 @@ "title": "Link[]" }, "ZGVjby1zaXRlcy9zdGQvY29tcG9uZW50cy90eXBlcy50cw==@Image": { - "title": "Inline string", "type": "string", - "format": "image-uri" + "format": "image-uri", + "title": "Image" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvTGlua1RyZWUudHN4@Social": { "type": "object", @@ -2594,12 +2536,10 @@ "label": { "anyOf": [ { - "title": "Inline string", "type": "string", "const": "Instagram" }, { - "title": "Inline string", "type": "string", "const": "Facebook" } @@ -2608,8 +2548,8 @@ "title": "Label" }, "href": { - "title": "Href", - "type": "string" + "type": "string", + "title": "Href" } }, "required": [ @@ -2629,18 +2569,18 @@ "type": "object", "properties": { "title": { - "title": "Title", "type": [ "string", "null" - ] + ], + "title": "Title" }, "description": { - "title": "Description", "type": [ "string", "null" - ] + ], + "title": "Description" }, "links": { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvTGlua1RyZWUudHN4@Link[]", @@ -2668,167 +2608,134 @@ "icon": { "anyOf": [ { - "title": "Inline string", "type": "string", "const": "ChevronLeft" }, { - "title": "Inline string", "type": "string", "const": "ChevronRight" }, { - "title": "Inline string", "type": "string", "const": "ChevronUp" }, { - "title": "Inline string", "type": "string", "const": "ChevronDown" }, { - "title": "Inline string", "type": "string", "const": "QuestionMarkCircle" }, { - "title": "Inline string", "type": "string", "const": "User" }, { - "title": "Inline string", "type": "string", "const": "ShoppingCart" }, { - "title": "Inline string", "type": "string", "const": "Bars3" }, { - "title": "Inline string", "type": "string", "const": "Heart" }, { - "title": "Inline string", "type": "string", "const": "MagnifyingGlass" }, { - "title": "Inline string", "type": "string", "const": "XMark" }, { - "title": "Inline string", "type": "string", "const": "Plus" }, { - "title": "Inline string", "type": "string", "const": "Minus" }, { - "title": "Inline string", "type": "string", "const": "MapPin" }, { - "title": "Inline string", "type": "string", "const": "Phone" }, { - "title": "Inline string", "type": "string", "const": "Elo" }, { - "title": "Inline string", "type": "string", "const": "Mastercard" }, { - "title": "Inline string", "type": "string", "const": "Visa" }, { - "title": "Inline string", "type": "string", "const": "Pix" }, { - "title": "Inline string", "type": "string", "const": "Logo" }, { - "title": "Inline string", "type": "string", "const": "Facebook" }, { - "title": "Inline string", "type": "string", "const": "Instagram" }, { - "title": "Inline string", "type": "string", "const": "Tiktok" }, { - "title": "Inline string", "type": "string", "const": "Truck" }, { - "title": "Inline string", "type": "string", "const": "Discount" }, { - "title": "Inline string", "type": "string", "const": "Return" }, { - "title": "Inline string", "type": "string", "const": "CreditCard" }, { - "title": "Inline string", "type": "string", "const": "Deco" }, { - "title": "Inline string", "type": "string", "const": "Discord" }, { - "title": "Inline string", "type": "string", "const": "Trash" }, { - "title": "Inline string", "type": "string", "const": "FilterList" }, { - "title": "Inline string", "type": "string", "const": "WhatsApp" }, { - "title": "Inline string", "type": "string", "const": "ArrowsPointingOut" } @@ -2838,14 +2745,14 @@ "title": "Icon" }, "title": { - "title": "Title", "type": "string", - "description": "Title" + "description": "Title", + "title": "Title" }, "description": { - "title": "Description", "type": "string", - "description": "Description and Image alt text" + "description": "Description and Image alt text", + "title": "Description" } }, "required": [ @@ -2879,25 +2786,25 @@ "type": "object", "properties": { "matcher": { - "title": "Matcher", "type": "string", - "description": "RegExp to enable this banner on the current URL. Use /feminino/* to display this banner on feminino category" + "description": "RegExp to enable this banner on the current URL. Use /feminino/* to display this banner on feminino category", + "title": "Matcher" }, "title": { - "title": "Title", "type": [ "string", "null" ], - "description": "text to be rendered on top of the image" + "description": "text to be rendered on top of the image", + "title": "Title" }, "subtitle": { - "title": "Subtitle", "type": [ "string", "null" ], - "description": "text to be rendered on top of the image" + "description": "text to be rendered on top of the image", + "title": "Subtitle" }, "image": { "type": "object", @@ -2911,11 +2818,11 @@ "title": "Mobile" }, "alt": { - "title": "Alt", "type": [ "string", "null" - ] + ], + "title": "Alt" } }, "required": [ @@ -2953,6 +2860,26 @@ "required": [], "title": "deco-sites/fashion/components/ui/BannerPLP.tsx@Props" }, + "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0RvZ0ZhY3RzX3YyLnRzeA==@LoadProps": { + "type": "object", + "properties": { + "title": { + "type": "string", + "title": "Title" + }, + "numberOfFacts": { + "type": [ + "number", + "null" + ], + "title": "Number Of Facts" + } + }, + "required": [ + "title" + ], + "title": "deco-sites/fashion/sections/DogFacts_v2.tsx@LoadProps" + }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvdWkvQmFubmVyR3JpZC50c3g=@Banner": { "type": "object", "properties": { @@ -2965,14 +2892,14 @@ "title": "Src Desktop" }, "alt": { - "title": "Alt", "type": "string", - "description": "Image alt text" + "description": "Image alt text", + "title": "Alt" }, "href": { - "title": "Href", "type": "string", - "description": "When you click you go to" + "description": "When you click you go to", + "title": "Href" } }, "required": [ @@ -2993,28 +2920,28 @@ "type": "object", "properties": { "title": { - "title": "Title", "type": [ "string", "null" - ] + ], + "title": "Title" }, "itemsPerLine": { "type": "object", "properties": { "mobile": { - "title": "Mobile", "type": [ "number", "null" - ] + ], + "title": "Mobile" }, "desktop": { - "title": "Desktop", "type": [ "number", "null" - ] + ], + "title": "Desktop" } }, "required": [], @@ -3025,18 +2952,18 @@ "type": "object", "properties": { "mobile": { - "title": "Mobile", "type": [ "number", "null" - ] + ], + "title": "Mobile" }, "desktop": { - "title": "Desktop", "type": [ "number", "null" - ] + ], + "title": "Desktop" } }, "required": [], @@ -3059,15 +2986,15 @@ "type": "object", "properties": { "title": { - "title": "Title", - "type": "string" + "type": "string", + "title": "Title" }, "itemsPerPage": { - "title": "Items Per Page", "type": [ "number", "null" - ] + ], + "title": "Items Per Page" } }, "required": [ @@ -3075,7 +3002,7 @@ ], "title": "omitcHJvZHVjdHM=Props" }, - "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@667018fc6b0c5c75c94a2edfc11a277b&omitcHJvZHVjdHM=Props": { + "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@cd6fe400c08631e5c1c2a9b91520991e&omitcHJvZHVjdHM=Props": { "allOf": [ { "type": "object", @@ -3093,7 +3020,7 @@ "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@omitcHJvZHVjdHM=Props" } ], - "title": "deco-sites/fashion/components/product/ProductShelf.tsx@667018fc6b0c5c75c94a2edfc11a277b&omitcHJvZHVjdHM=Props" + "title": "deco-sites/fashion/components/product/ProductShelf.tsx@cd6fe400c08631e5c1c2a9b91520991e&omitcHJvZHVjdHM=Props" }, "ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvc2VhcmNoL1NlYXJjaFJlc3VsdC50c3g=@Props": { "type": "object", @@ -3105,12 +3032,10 @@ "variant": { "anyOf": [ { - "title": "Inline string", "type": "string", "const": "aside" }, { - "title": "Inline string", "type": "string", "const": "drawer" } @@ -3123,18 +3048,18 @@ "type": "object", "properties": { "mobile": { - "title": "Mobile", "type": [ "number", "null" - ] + ], + "title": "Mobile" }, "desktop": { - "title": "Desktop", "type": [ "number", "null" - ] + ], + "title": "Desktop" } }, "required": [], @@ -3152,19 +3077,19 @@ "type": "object", "properties": { "title": { - "title": "Title", - "type": "string" + "type": "string", + "title": "Title" }, "products": { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvY29tbWVyY2UvdHlwZXMudHM=@Product[]|null", "title": "Products" }, "itemsPerPage": { - "title": "Items Per Page", "type": [ "number", "null" - ] + ], + "title": "Items Per Page" } }, "required": [ @@ -3177,12 +3102,12 @@ "type": "object", "properties": { "label": { - "title": "Label", - "type": "string" + "type": "string", + "title": "Label" }, "href": { - "title": "Href", - "type": "string" + "type": "string", + "title": "Href" } }, "required": [ @@ -3197,167 +3122,134 @@ "icon": { "anyOf": [ { - "title": "Inline string", "type": "string", "const": "ChevronLeft" }, { - "title": "Inline string", "type": "string", "const": "ChevronRight" }, { - "title": "Inline string", "type": "string", "const": "ChevronUp" }, { - "title": "Inline string", "type": "string", "const": "ChevronDown" }, { - "title": "Inline string", "type": "string", "const": "QuestionMarkCircle" }, { - "title": "Inline string", "type": "string", "const": "User" }, { - "title": "Inline string", "type": "string", "const": "ShoppingCart" }, { - "title": "Inline string", "type": "string", "const": "Bars3" }, { - "title": "Inline string", "type": "string", "const": "Heart" }, { - "title": "Inline string", "type": "string", "const": "MagnifyingGlass" }, { - "title": "Inline string", "type": "string", "const": "XMark" }, { - "title": "Inline string", "type": "string", "const": "Plus" }, { - "title": "Inline string", "type": "string", "const": "Minus" }, { - "title": "Inline string", "type": "string", "const": "MapPin" }, { - "title": "Inline string", "type": "string", "const": "Phone" }, { - "title": "Inline string", "type": "string", "const": "Elo" }, { - "title": "Inline string", "type": "string", "const": "Mastercard" }, { - "title": "Inline string", "type": "string", "const": "Visa" }, { - "title": "Inline string", "type": "string", "const": "Pix" }, { - "title": "Inline string", "type": "string", "const": "Logo" }, { - "title": "Inline string", "type": "string", "const": "Facebook" }, { - "title": "Inline string", "type": "string", "const": "Instagram" }, { - "title": "Inline string", "type": "string", "const": "Tiktok" }, { - "title": "Inline string", "type": "string", "const": "Truck" }, { - "title": "Inline string", "type": "string", "const": "Discount" }, { - "title": "Inline string", "type": "string", "const": "Return" }, { - "title": "Inline string", "type": "string", "const": "CreditCard" }, { - "title": "Inline string", "type": "string", "const": "Deco" }, { - "title": "Inline string", "type": "string", "const": "Discord" }, { - "title": "Inline string", "type": "string", "const": "Trash" }, { - "title": "Inline string", "type": "string", "const": "FilterList" }, { - "title": "Inline string", "type": "string", "const": "WhatsApp" }, { - "title": "Inline string", "type": "string", "const": "ArrowsPointingOut" } @@ -3393,8 +3285,8 @@ "type": "object", "properties": { "label": { - "title": "Label", - "type": "string" + "type": "string", + "title": "Label" }, "children": { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvZm9vdGVyL0Zvb3Rlci50c3g=@IconItem|StringItem[]", @@ -3429,38 +3321,38 @@ "type": "object", "properties": { "placeholder": { - "title": "Placeholder", "type": [ "string", "null" ], + "title": "Placeholder", "description": "Search bar default placeholder message", "default": "What are you looking for?" }, "action": { - "title": "Action", "type": [ "string", "null" ], + "title": "Action", "description": "When user clicks on the search button, navigate it to", "default": "/s" }, "name": { - "title": "Name", "type": [ "string", "null" ], + "title": "Name", "description": "Querystring param used when navigating the user", "default": "q" }, "query": { - "title": "Query", "type": [ "string", "null" - ] + ], + "title": "Query" } }, "required": [], @@ -3470,12 +3362,12 @@ "type": "object", "properties": { "label": { - "title": "Label", - "type": "string" + "type": "string", + "title": "Label" }, "href": { - "title": "Href", - "type": "string" + "type": "string", + "title": "Href" }, "children": { "type": "array", @@ -3483,12 +3375,12 @@ "type": "object", "properties": { "label": { - "title": "Label", - "type": "string" + "type": "string", + "title": "Label" }, "href": { - "title": "Href", - "type": "string" + "type": "string", + "title": "Href" }, "children": { "type": "array", @@ -3496,12 +3388,12 @@ "type": "object", "properties": { "label": { - "title": "Label", - "type": "string" + "type": "string", + "title": "Label" }, "href": { - "title": "Href", - "type": "string" + "type": "string", + "title": "Href" } }, "required": [ @@ -3527,11 +3419,11 @@ "title": "Src" }, "alt": { - "title": "Alt", "type": [ "string", "null" - ] + ], + "title": "Alt" } }, "required": [], @@ -3557,7 +3449,6 @@ "alerts": { "type": "array", "items": { - "title": "Inline string", "type": "string" }, "title": "Alerts" @@ -3595,15 +3486,15 @@ "type": "object", "properties": { "title": { - "title": "Title", - "type": "string" + "type": "string", + "title": "Title" }, "numberOfFacts": { - "title": "Number Of Facts", "type": [ "number", "null" - ] + ], + "title": "Number Of Facts" } }, "required": [ @@ -3621,17 +3512,14 @@ "variant": { "anyOf": [ { - "title": "Inline string", "type": "string", "const": "front-back" }, { - "title": "Inline string", "type": "string", "const": "slider" }, { - "title": "Inline string", "type": "string", "const": "auto" } @@ -3654,16 +3542,16 @@ "title": "Src" }, "alt": { - "title": "Alt", - "type": "string" + "type": "string", + "title": "Alt" }, "href": { - "title": "Href", - "type": "string" + "type": "string", + "title": "Href" }, "label": { - "title": "Label", - "type": "string" + "type": "string", + "title": "Label" } }, "required": [ @@ -3689,8 +3577,8 @@ "title": "Highlights" }, "title": { - "title": "Title", - "type": "string" + "type": "string", + "title": "Title" } }, "required": [ @@ -3702,11 +3590,11 @@ "type": "object", "properties": { "phone": { - "title": "Phone", "type": [ "number", "null" - ] + ], + "title": "Phone" } }, "required": [], @@ -3716,10 +3604,10 @@ "type": "object", "properties": { "type": { - "title": "Type", "type": "string", "const": "VTEX", - "default": "VTEX" + "default": "VTEX", + "title": "Type" } }, "required": [ @@ -3742,10 +3630,10 @@ "type": "object", "properties": { "type": { - "title": "Type", "type": "string", "const": "Shopify", - "default": "Shopify" + "default": "Shopify", + "title": "Type" } }, "required": [ @@ -3800,28 +3688,28 @@ "title": "Mobile" }, "alt": { - "title": "Alt", "type": "string", - "description": "Image's alt text" + "description": "Image's alt text", + "title": "Alt" }, "action": { "type": "object", "properties": { "href": { - "title": "Href", - "type": "string" + "type": "string", + "title": "Href" }, "title": { - "title": "Title", - "type": "string" + "type": "string", + "title": "Title" }, "subTitle": { - "title": "Sub Title", - "type": "string" + "type": "string", + "title": "Sub Title" }, "label": { - "title": "Label", - "type": "string" + "type": "string", + "title": "Label" } }, "required": [ @@ -3855,19 +3743,19 @@ "title": "Images" }, "preload": { - "title": "Preload", "type": [ "boolean", "null" ], - "description": "Check this option when this banner is the biggest image on the screen for image optimizations" + "description": "Check this option when this banner is the biggest image on the screen for image optimizations", + "title": "Preload" }, "interval": { - "title": "Interval", "type": [ "number", "null" ], + "title": "Interval", "description": "time (in seconds) to start the carousel autoplay" } }, @@ -3891,40 +3779,40 @@ "type": "object", "properties": { "title": { - "title": "Title", "type": [ "string", "null" - ] + ], + "title": "Title" }, "description": { - "title": "Description", "type": [ "string", "null" - ] + ], + "title": "Description" }, "canonical": { - "title": "Canonical", "type": [ "string", "null" ], + "title": "Canonical", "default": "https://example.com" }, "imageUrl": { - "title": "Image Url", "type": [ "string", "null" - ] + ], + "title": "Image Url" }, "themeColor": { - "title": "Theme Color", "type": [ "string", "null" - ] + ], + "title": "Theme Color" } }, "required": [], @@ -3938,39 +3826,39 @@ "title": "Page" }, "title": { - "title": "Title", "type": [ "string", "null" - ] + ], + "title": "Title" }, "description": { - "title": "Description", "type": [ "string", "null" - ] + ], + "title": "Description" }, "url": { - "title": "Url", "type": [ "string", "null" - ] + ], + "title": "Url" }, "imageUrl": { - "title": "Image Url", "type": [ "string", "null" - ] + ], + "title": "Image Url" }, "themeColor": { - "title": "Theme Color", "type": [ "string", "null" - ] + ], + "title": "Theme Color" } }, "required": [ @@ -3984,7 +3872,6 @@ "trackingIds": { "type": "array", "items": { - "title": "Inline string", "type": "string" }, "description": "google tag manager container id. For more info: https://developers.google.com/tag-platform/tag-manager/web#standard_web_page_installation .", @@ -4002,25 +3889,25 @@ "title": "Page" }, "titleTemplate": { - "title": "Title Template", "type": "string", + "title": "Title Template", "description": "add a %s whenever you want it to be replaced with the product name", "default": "%s | Fashion Store" }, "description": { - "title": "Description", "type": [ "string", "null" ], + "title": "Description", "description": "If not set, the product description will be used instead" }, "themeColor": { - "title": "Theme Color", "type": [ "string", "null" - ] + ], + "title": "Theme Color" } }, "required": [ @@ -4033,20 +3920,20 @@ "type": "object", "properties": { "start": { - "title": "Start", "type": [ "string", "null" ], - "format": "date-time" + "format": "date-time", + "title": "Start" }, "end": { - "title": "End", "type": [ "string", "null" ], - "format": "date-time" + "format": "date-time", + "title": "End" } }, "required": [], @@ -4056,18 +3943,18 @@ "type": "object", "properties": { "includes": { - "title": "Includes", "type": [ "string", "null" - ] + ], + "title": "Includes" }, "match": { - "title": "Match", "type": [ "string", "null" - ] + ], + "title": "Match" } }, "required": [], @@ -4077,8 +3964,8 @@ "type": "object", "properties": { "siteId": { - "title": "Site Id", - "type": "number" + "type": "number", + "title": "Site Id" } }, "required": [ @@ -4103,12 +3990,10 @@ "op": { "anyOf": [ { - "title": "Inline string", "type": "string", "const": "or" }, { - "title": "Inline string", "type": "string", "const": "and" } @@ -4131,8 +4016,8 @@ "type": "object", "properties": { "traffic": { - "title": "Traffic", - "type": "number" + "type": "number", + "title": "Traffic" } }, "required": [ @@ -4146,12 +4031,10 @@ "environment": { "anyOf": [ { - "title": "Inline string", "type": "string", "const": "production" }, { - "title": "Inline string", "type": "string", "const": "development" } @@ -4173,8 +4056,8 @@ "title": "Matcher" }, "name": { - "title": "Name", - "type": "string" + "type": "string", + "title": "Name" }, "routes": { "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL2Jsb2Nrcy9oYW5kbGVyLnRz@Handler@record", @@ -4184,7 +4067,6 @@ "title": "Overrides", "type": "object", "additionalProperties": { - "title": "Inline string", "type": "string" } } @@ -4207,7 +4089,6 @@ "title": "Overrides", "type": "object", "additionalProperties": { - "title": "Inline string", "type": "string" } } @@ -5038,6 +4919,27 @@ } } }, + "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0RvZ0ZhY3RzX3YyLnRzeA==": { + "title": "deco-sites/fashion/sections/DogFacts_v2.tsx", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0RvZ0ZhY3RzX3YyLnRzeA==@LoadProps" + } + ], + "required": [ + "__resolveType" + ], + "properties": { + "__resolveType": { + "type": "string", + "enum": [ + "deco-sites/fashion/sections/DogFacts_v2.tsx" + ], + "default": "deco-sites/fashion/sections/DogFacts_v2.tsx" + } + } + }, "ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0Jhbm5lckdyaWQudHN4": { "title": "deco-sites/fashion/sections/BannerGrid.tsx", "type": "object", @@ -5064,7 +4966,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@667018fc6b0c5c75c94a2edfc11a277b&omitcHJvZHVjdHM=Props" + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL2NvbXBvbmVudHMvcHJvZHVjdC9Qcm9kdWN0U2hlbGYudHN4@cd6fe400c08631e5c1c2a9b91520991e&omitcHJvZHVjdHM=Props" } ], "required": [ @@ -5914,6 +5816,9 @@ { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0Jhbm5lclBMUC50c3g=" }, + { + "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0RvZ0ZhY3RzX3YyLnRzeA==" + }, { "$ref": "#/definitions/ZGVjby1zaXRlcy9mYXNoaW9uL3NlY3Rpb25zL0Jhbm5lckdyaWQudHN4" }, @@ -6032,6 +5937,7 @@ "type": "object", "required": [ "./routes/_middleware.ts", + "./routes/live/rpc/[func].ts", "./routes/[...catchall].tsx" ], "properties": { @@ -6042,6 +5948,13 @@ } ] }, + "./routes/live/rpc/[func].ts": { + "anyOf": [ + { + "$ref": "#/definitions/ZGVjby1jeC9saXZlLnRzL3JvdXRlcy9fbWlkZGxld2FyZS50cw==@MiddlewareConfig" + } + ] + }, "./routes/[...catchall].tsx": { "anyOf": [ { diff --git a/sections/DogFacts_v2.tsx b/sections/DogFacts_v2.tsx new file mode 100644 index 00000000..90d073ca --- /dev/null +++ b/sections/DogFacts_v2.tsx @@ -0,0 +1,41 @@ +import { PropsLoader } from "$live/mod.ts"; +import type { LoaderContext } from "$live/types.ts"; + +// Props type that will be configured in deco.cx's Admin +export interface LoadProps { + title: string; + numberOfFacts?: number; +} + +async function dogFacts( + _req: Request, + { state: { $live: { numberOfFacts } } }: LoaderContext, +): Promise { + const { facts } = (await fetch( + `https://dogapi.dog/api/facts?number=${numberOfFacts ?? 1}`, + ).then((r) => r.json())) as { facts: string[] }; + return facts; +} + +export interface Props { + title: string; + dogFacts: string[]; +} + +export default function DogFacts({ title, dogFacts }: Props) { + return ( +
+

{title}

+
    + {dogFacts.map((fact) =>
  • {fact}
  • )} +
+
+ ); +} + +export const loader: PropsLoader< + Props, + LoadProps +> = { + dogFacts, +};