This commit is contained in:
Joel Varty 2021-06-21 15:55:31 -04:00
parent 7cc26439f4
commit 206d221f34
29 changed files with 827 additions and 449 deletions

View File

@ -1,4 +1,4 @@
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fcommerceproject-name=next-commerce-agilitycms&repository-name=next-commerce-agilitycms&demo-title=Next.js%20Commerce%20Agility%20CMS&demo-description=An%20all-in-one%20starter%20kit%20for%20high-performance%20e-commerce%20sites%20with%20Agility%20CMS.&demo-url=https%3A%2F%2Fnextjs-commerce-agility-cms.vercel.app/&demo-image=https%3A%2F%2Fbigcommerce-demo-asset-ksvtgfvnd.vercel.app%2Fbigcommerce.png&integration-ids=oac_MuWZiE4jtmQ2ejZQaQ7ncuDT)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fcommerceproject-name=next-commerce-agilitycms&repository-name=next-commerce-agilitycms&demo-title=Next.js%20Commerce%20with%20Agility%20CMS&demo-description=An%20all-in-one%20starter%20kit%20for%20high-performance%20e-commerce%20sites%20with%20Agility%20CMS.&demo-url=https%3A%2F%2Fnextjs-commerce-agility-cms.vercel.app/&demo-image=https%3A%2F%2Fbigcommerce-demo-asset-ksvtgfvnd.vercel.app%2Fbigcommerce.png&integration-ids=oac_MuWZiE4jtmQ2ejZQaQ7ncuDT)
# Next.js Commerce with Agility CMS

View File

@ -1,3 +1,3 @@
.fit {
min-height: calc(100vh - 88px);
min-height: 400px /*calc(100vh - 88px)*/;
}

View File

@ -1,21 +1,49 @@
import pageTemplates from "components/agility-pageTemplates"
import Head from 'next/head'
const AgilityPage = ({ agilityProps, error, revalidate }: { agilityProps: any, error?: any, revalidate?: any}) => {
const AgilityPage = ({ agilityProps, error, revalidate }: { agilityProps: any, error?: any, revalidate?: any }) => {
if (!agilityProps) {
console.error(`Page object or template was not found.`)
return null
}
let AgilityPageTemplate = pageTemplates(agilityProps.pageTemplateName)
if (! AgilityPageTemplate) {
console.error(`${agilityProps.pageTemplateName} not found.`)
return null
let pageTitle = "Commerce Storefront"
if (agilityProps.globalData?.sitedata) {
pageTitle = agilityProps.globalData?.sitedata.name
}
return (
<AgilityPageTemplate {...agilityProps} />
)
if (agilityProps.notFound === true) {
return (
<>
<Head>
<title>Page Not Found - {pageTitle}</title>
</Head>
<div className="m-8 text-center" >Page not found.</div>
</>
)
}
if (agilityProps.pageTemplateName) {
let AgilityPageTemplate = pageTemplates(agilityProps.pageTemplateName)
if (!AgilityPageTemplate) {
console.error(`${agilityProps.pageTemplateName} not found.`)
return null
}
return (
<>
<Head>
<title>{agilityProps.sitemapNode?.title} - {pageTitle}</title>
</Head>
<AgilityPageTemplate {...agilityProps} />
</>
)
} else {
return null
}
}

View File

@ -1,75 +0,0 @@
import React, { Component, useState } from 'react';
import Link from 'next/link';
import {expandLinkedList} from "@agility/utils"
const GlobalFooter = (props) => {
const { globalFooterProps } = props;
return (
<div>FOOTER</div>
)
}
GlobalFooter.getCustomInitialProps = async function ({agility, languageCode, channelName}) {
const api = agility;
let contentItem = null;
//hack
return {}
try {
//get the global footer
let contentItemList = await api.getContentList({
referenceName: "globalfooter",
languageCode: languageCode
});
if (contentItemList?.length > 0) {
contentItem = contentItemList[0];
//resolve the links...
contentItem = await expandLinkedList({ agility, contentItem, languageCode,
fieldName: "column2Links",
sortIDField: "column2SortIDs"
})
contentItem = await expandLinkedList({ agility, contentItem, languageCode,
fieldName: "column3Links",
sortIDField: "column3SortIDs"
})
contentItem = await expandLinkedList({ agility, contentItem, languageCode,
fieldName: "column4Links",
sortIDField: "column4SortIDs"
})
}
} catch (error) {
if (console) console.error("Could not load global footer item.", error);
}
//return a clean object...
return {
siteName: contentItem.fields.siteName,
siteDescription: contentItem.fields.siteDescription,
column2Title: contentItem.fields.column2Title,
column3Title: contentItem.fields.column3Title,
column4Title: contentItem.fields.column4Title,
facebookURL: contentItem.fields.facebookURL,
twitterURL: contentItem.fields.twitterURL,
youTubeURL: contentItem.fields.youTubeURL,
column2Links: contentItem.fields.column2Links.map(link => link.fields.link),
column3Links: contentItem.fields.column3Links.map(link => link.fields.link),
column4Links: contentItem.fields.column4Links.map(link => link.fields.link),
}
}
export default GlobalFooter

View File

@ -1,73 +0,0 @@
import React, { Component, useState } from 'react';
import Link from 'next/link';
const GlobalHeader = (props) => {
const { globalHeaderProps, sitemapNode, page } = props;
const globalHeaderItem = globalHeaderProps.contentItem;
let siteName = globalHeaderItem?.fields.siteName || "Agility Starter 2020"
let logo = globalHeaderItem?.fields.logo || nulll
return (
<div>HEADER</div>
)
}
GlobalHeader.getCustomInitialProps = async function (props) {
const api = props.agility;
const languageCode = props.languageCode;
const channelName = props.channelName;
let contentItem = null;
let links = [];
//hack
return {}
try {
//get the global header
let contentItemList = await api.getContentList({
referenceName: "globalheader",
languageCode: languageCode
});
if (contentItemList && contentItemList.length) {
contentItem = contentItemList[0];
}
} catch (error) {
if (console) console.error("Could not load global header item.", error);
}
try {
//get the nested sitemap
let sitemap = await api.getSitemapNested({
channelName: channelName,
languageCode: languageCode,
});
//grab the top level links that are visible on menu
links = sitemap
.filter(node => node.visible.menu)
.map(node => {
return {
text: node.menuText || node.title,
path: node.path
}
})
} catch (error) {
if (console) console.error("Could not load nested sitemap.", error);
}
return {
contentItem,
links
}
}
export default GlobalHeader

View File

@ -0,0 +1,99 @@
import React from "react";
import Head from "next/head";
import { renderHTML } from "@agility/nextjs";
import { AgilityImage } from "@agility/nextjs";
import truncate from "truncate-html";
import Link from "next/link";
import Image from "next/image"
const PostDetails = ({ dynamicPageItem }: any) => {
// post fields
const post = dynamicPageItem.fields;
const productJSON = post.product
const product = JSON.parse(productJSON)
// format date
const dateStr = new Date(post.date).toLocaleDateString();
const description = truncate(post.content, {
length: 160,
decodeEntities: true,
stripTags: true,
reserveLastWord: true,
});
let imageSrc = post.image?.url || null;
// post image alt
let imageAlt = post.image?.label || null;
let ogImageSrc = `${imageSrc}?w=1600&h=900`
let imageHeight = 900
let imageWidth = 1600
return (
<>
<Head>
<meta property="twitter:image" content={ogImageSrc} />
<meta property="twitter:card" content="summary_large_image" />
<meta name="og:title" content={post.title} />
<meta property="og:image" content={ogImageSrc} />
<meta property="og:image:width" content={`${imageWidth}`} />
<meta property="og:image:height" content={`${imageHeight}`} />
<meta name="description" content={description} />
<meta name="og:description" content={description} />
<meta name="twitter:description" content={description} />
<meta name="twitter:title" content={post.title} />
</Head>
<div className="relative px-8">
<div className="max-w-screen-xl mx-auto">
<div className="h-64 md:h-96 aspect-w-16 aspect-h-9 relative">
<AgilityImage
src={imageSrc}
alt={imageAlt}
className="object-cover object-center rounded-lg"
layout="fill"
/>
<Link href={`/product${product.slug}`}>
<a className="absolute" style={{bottom: "-80px", right: "-20px"}}>
<Image src={product.imageUrl} alt={product.name} width={300} height={300} layout="fixed" />
</a>
</Link>
</div>
<div className="max-w-2xl mx-auto mt-4">
<Link href={`/product${product.slug}`}><a className="uppercase text-primary-500 text-xs font-bold tracking-widest leading-loose">{product.name}</a></Link>
<div className="border-b-2 border-primary-500 w-8"></div>
<div className="mt-4 uppercase text-gray-600 italic font-semibold text-xs">
{dateStr}
</div>
<h1 className="font-display text-4xl font-bold my-6 text-secondary-500">
{post.title}
</h1>
<div
className="prose max-w-full mb-20"
dangerouslySetInnerHTML={renderHTML(post.content)}
/>
</div>
</div>
</div>
</>
);
};
PostDetails.getCustomInitialProps = async () => {
return {
cloud_name: process.env.CLOUDINARY_CLOUD_NAME
}
}
export default PostDetails;

View File

@ -0,0 +1,87 @@
import React from "react";
import Link from "next/link";
import Image from "next/image"
import { ModuleWithInit, AgilityImage } from '@agility/nextjs'
import products from "pages/api/catalog/products";
interface ICustomData {
posts: []
}
interface IModule {
}
const PostsListing: ModuleWithInit<IModule, ICustomData> = ({ customData, module, languageCode, isDevelopmentMode, isPreview }) => {
// get posts
const { posts } = customData;
// set up href for internal links
let href = "/pages/[...slug]";
// if there are no posts, display message on frontend
if (posts.length <= 0) {
return (
<div className="mt-44 px-6 flex flex-col items-center justify-center">
<h1 className="text-3xl text-center font-bold">No posts available.</h1>
<div className="my-10">
<Link href={href} as="/home">
<a className="px-4 py-3 my-3 border border-transparent text-base leading-6 font-medium rounded-md text-white bg-primary-600 hover:bg-primary-500 focus:outline-none focus:border-primary-700 focus:shadow-outline-primary transition duration-300">
Return Home
</a>
</Link>
</div>
</div>
);
}
return (
<div className="relative px-8 mb-12">
<div className="max-w-screen-xl mx-auto">
<div className="sm:grid sm:gap-8 sm:grid-cols-2 lg:grid-cols-3">
{posts.map((post: any, index) => (
<Link href={post.url} key={index}>
<a>
<div className="flex-col group mb-8 md:mb-0">
<div className="relative h-64">
<AgilityImage
src={post.imageSrc}
alt={post.imageAlt}
className="object-cover object-center rounded-t-lg"
layout="fill"
/>
<div className="absolute right-0" style={{bottom: "-60px"}}>
<Image src={post.productImageSrc} alt={post.productName} width={200} height={200} layout="fixed" />
</div>
</div>
<div className="bg-gray-100 p-8 border-2 border-t-0 rounded-b-lg">
<div className="uppercase text-primary-500 text-xs font-bold tracking-widest leading-loose">
{post.productName}
</div>
<div className="border-b-2 border-primary-500 w-8"></div>
<div className="mt-4 uppercase text-gray-600 italic font-semibold text-xs">
{post.date}
</div>
<h2 className="text-secondary-500 mt-1 font-black text-2xl group-hover:text-primary-500 transition duration-300">
{post.title}
</h2>
</div>
</div>
</a>
</Link>
))}
</div>
</div>
</div>
);
};
export default PostsListing;

View File

@ -1,39 +0,0 @@
import { FC } from "react"
import { Grid, Marquee, Hero } from '@components/ui'
import { ProductCard } from '@components/product'
import { ModuleWithInit } from "@agility/nextjs"
interface ICustomData {
products: any
}
interface IModule {
}
const FeaturedProducts: ModuleWithInit<IModule, ICustomData> = ({ customData }) => {
if (! customData) {
return <div>No featured products returned.</div>
}
const products:any = customData.products
return (
<Grid variant="filled">
{products.slice(0, 3).map((product: any, i: number) => (
<ProductCard
key={product.id}
product={product}
imgProps={{
width: i === 0 ? 1080 : 540,
height: i === 0 ? 1080 : 540,
}}
/>
))}
</Grid>
)
}
export default FeaturedProducts

View File

@ -1,42 +0,0 @@
import React, { FC } from 'react'
import HomeAllProductsGrid from '@components/common/HomeAllProductsGrid'
import { ModuleWithInit } from '@agility/nextjs'
import { ProductCard } from '@components/product'
import { Grid, Marquee, Hero } from '@components/ui'
interface ICustomData {
products: any
}
interface IModule {
}
const HomeAllProductsGridModule: ModuleWithInit<IModule, ICustomData> = ({ customData }) => {
const products = customData.products
return (
<Grid layout="B" variant="filled">
{products.slice(0, 3).map((product: any, i: number) => (
<ProductCard
key={product.id}
product={product}
imgProps={{
width: i === 0 ? 1080 : 540,
height: i === 0 ? 1080 : 540,
}}
/>
))}
</Grid>
)
}
export default HomeAllProductsGridModule

View File

@ -1,8 +1,44 @@
const ProductListing = () => {
return (
<section>ProductListing</section>
)
import React, { FC } from 'react'
import { ModuleWithInit } from '@agility/nextjs'
import { ProductCard } from '@components/product'
import { Grid, Marquee, Hero } from '@components/ui'
interface ICustomData {
products: any
}
export default ProductListing
interface IModule {
numItems: string,
layout?: 'A' | 'B' | 'C' | 'D' | 'normal'
variant?: 'default' | 'filled'
}
const ProductListingModule: ModuleWithInit<IModule, ICustomData> = ( { customData, module, languageCode, isDevelopmentMode, isPreview }) => {
const products = customData.products
return (
<Grid layout={module.fields.layout} variant={module.fields.variant}>
{products.map((product: any, i: number) => (
<ProductCard
key={product.id}
product={product}
imgProps={{
width: i === 0 ? 1080 : 540,
height: i === 0 ? 1080 : 540,
}}
/>
))}
</Grid>
)
}
export default ProductListingModule

View File

@ -12,7 +12,7 @@ interface IModule {
}
const BestsellingProducts: ModuleWithInit<IModule, ICustomData> = ({ customData }) => {
const ProductMarqueeModule: ModuleWithInit<IModule, ICustomData> = ({ customData }) => {
const products = customData.products
@ -26,5 +26,5 @@ const BestsellingProducts: ModuleWithInit<IModule, ICustomData> = ({ customData
}
export default BestsellingProducts
export default ProductMarqueeModule

View File

@ -8,8 +8,6 @@ interface Fields {
const RichTextArea:Module<Fields> = ({ module: {fields} }) => {
return (
<Container>
<Text className="prose prose-sm sm:prose lg:prose-lg xl:prose-xl" html={fields.textblob} />

View File

@ -1,21 +1,22 @@
import RichTextArea from "./RichTextArea"
import BestsellingProducts from "./BestsellingProducts"
import ProductMarquee from "./ProductMarquee"
import ProductDetails from "./ProductDetails"
import FeaturedProducts from "./FeaturedProducts"
import ProductListing from "./ProductListing"
import ProductSearch from "./ProductSearch"
import Hero from "./Hero"
import HomeAllProductsGrid from "./HomeAllProductsGrid"
import HomeAllProductsGrid from "./ProductListing"
import Cart from "./Cart"
import Orders from "./Orders"
import Profile from "./Profile"
import Wishlist from "./Wishlist"
import BlogPostListing from "./BlogPostListing"
import BlogPostDetails from "./BlogPostDetails"
const allModules = [
{ name: "RichTextArea", module: RichTextArea },
{ name: "BestsellingProducts", module: BestsellingProducts },
{ name: "FeaturedProducts", module: FeaturedProducts },
{ name: "ProductMarquee", module: ProductMarquee },
{ name: "ProductListing", module: ProductListing },
{ name: "ProductSearch", module: ProductSearch },
{ name: "Hero", module: Hero },
@ -23,8 +24,11 @@ const allModules = [
{ name: "HomeAllProductsGrid", module: HomeAllProductsGrid },
{ name: "Cart", module: Cart },
{ name: "Orders", module: Orders },
{ name: "Profile", module: Profile},
{ name: "Wishlist", module: Wishlist}
{ name: "Profile", module: Profile },
{ name: "Wishlist", module: Wishlist },
{ name: "BlogPostListing", module: BlogPostListing },
{ name: "BlogPostDetails", module: BlogPostDetails }
]
/**

View File

@ -10,122 +10,118 @@ import { I18nWidget } from '@components/common'
import s from './Footer.module.css'
interface Props {
className?: string
children?: any
pages?: Page[]
className?: string
children?: any
pages?: Page[],
agilityProps: any
}
const links = [
{
name: 'Home',
url: '/',
},
]
const links:[] = []
const Footer: FC<Props> = ({ className, pages }) => {
const { sitePages } = usePages(pages)
const rootClassName = cn(s.root, className)
const Footer: FC<Props> = ({ className, pages, agilityProps }) => {
const { sitePages } = usePages(pages)
const rootClassName = cn(s.root, className)
return (
<footer className={rootClassName}>
<Container>
<div className="grid grid-cols-1 lg:grid-cols-12 gap-8 border-b border-accent-2 py-12 text-primary bg-primary transition-colors duration-150">
<div className="col-span-1 lg:col-span-2">
<Link href="/">
<a className="flex flex-initial items-center font-bold md:mr-24">
<span className="rounded-full border border-accent-6 mr-2">
<Logo />
</span>
<span>ACME</span>
</a>
</Link>
</div>
<div className="col-span-1 lg:col-span-8">
<div className="grid md:grid-rows-4 md:grid-cols-3 md:grid-flow-col">
{[...links, ...sitePages].map((page) => (
<span key={page.url} className="py-3 md:py-0 md:pb-4">
<Link href={page.url!}>
<a className="text-accent-9 hover:text-accent-6 transition ease-in-out duration-150">
{page.name}
</a>
</Link>
</span>
))}
</div>
</div>
<div className="col-span-1 lg:col-span-2 flex items-start lg:justify-end text-primary">
<div className="flex space-x-6 items-center h-10">
<a
className={s.link}
aria-label="Github Repository"
href="https://github.com/joelvarty/nextsj-commerce-agilitycms"
>
<Github />
</a>
<I18nWidget />
</div>
</div>
</div>
<div className="pt-6 pb-10 flex flex-col md:flex-row justify-between items-center space-y-4 text-accent-6 text-sm">
<div>
<span>&copy; 2021 ACME, Inc. All rights reserved.</span>
</div>
<div className="flex items-center text-primary text-sm">
<span className="text-primary">Created by</span>
<a
rel="noopener"
href="https://vercel.com"
aria-label="Vercel.com Link"
target="_blank"
className="text-primary"
>
<Vercel
className="inline-block h-6 ml-3 text-primary"
alt="Vercel.com Logo"
/>
</a>
const siteData = agilityProps.globalData["sitedata"]
<span className="text-primary ml-5">CMS Integration by</span>
<a
rel="noopener"
href="https://agilitycms.com"
aria-label="AgilityCMS.com Link"
target="_blank"
className="text-primary"
>
<Agility
className="inline-block h-6 ml-3 text-primary"
alt="AgilityCMS.com Logo"
/>
</a>
</div>
</div>
</Container>
</footer>
)
return (
<footer className={rootClassName}>
<Container>
<div className="grid grid-cols-1 lg:grid-cols-12 gap-8 border-b border-accent-2 py-12 text-primary bg-primary transition-colors duration-150">
<div className="col-span-1 lg:col-span-2">
<Link href="/">
<a className="flex flex-initial items-center font-bold md:mr-24 ">
<img src={siteData.logo.url} height="32" width="32" className="rounded-full border border-accent-6 mr-2" />
<span>{siteData.name}</span>
</a>
</Link>
</div>
<div className="col-span-1 lg:col-span-8">
<div className="grid md:grid-rows-4 md:grid-cols-3 md:grid-flow-col">
{[...links, ...sitePages, ...siteData.links].map((page) => (
<span key={page.url} className="py-3 md:py-0 md:pb-4">
<Link href={page.url!}>
<a className="text-accent-9 hover:text-accent-6 transition ease-in-out duration-150">
{page.name}
</a>
</Link>
</span>
))}
</div>
</div>
<div className="col-span-1 lg:col-span-2 flex items-start lg:justify-end text-primary">
<div className="flex space-x-6 items-center h-10">
<a
className={s.link}
aria-label="Github Repository"
href="https://github.com/joelvarty/nextsj-commerce-agilitycms"
>
<Github />
</a>
<I18nWidget />
</div>
</div>
</div>
<div className="pt-6 pb-10 flex flex-col md:flex-row justify-between items-center space-y-4 text-accent-6 text-sm">
<div>
<span>&copy; 2021 ACME, Inc. All rights reserved.</span>
</div>
<div className="flex items-center text-primary text-sm">
<span className="text-primary">Created by</span>
<a
rel="noopener"
href="https://vercel.com"
aria-label="Vercel.com Link"
target="_blank"
className="text-primary"
>
<Vercel
className="inline-block h-6 ml-3 text-primary"
alt="Vercel.com Logo"
/>
</a>
<span className="text-primary ml-5">CMS Integration by</span>
<a
rel="noopener"
href="https://agilitycms.com"
aria-label="AgilityCMS.com Link"
target="_blank"
className="text-primary"
>
<Agility
className="inline-block h-6 ml-3 text-primary"
alt="AgilityCMS.com Logo"
/>
</a>
</div>
</div>
</Container>
</footer>
)
}
function usePages(pages?: Page[]) {
const { locale } = useRouter()
const sitePages: Page[] = []
const { locale } = useRouter()
const sitePages: Page[] = []
if (pages) {
pages.forEach((page) => {
const slug = page.url && getSlug(page.url)
if (!slug) return
if (locale && !slug.startsWith(`${locale}/`)) return
sitePages.push(page)
})
}
if (pages) {
pages.forEach((page) => {
const slug = page.url && getSlug(page.url)
if (!slug) return
if (locale && !slug.startsWith(`${locale}/`)) return
sitePages.push(page)
})
}
return {
sitePages: sitePages.sort(bySortOrder),
}
return {
sitePages: sitePages.sort(bySortOrder),
}
}
// Sort pages by the sort order assigned in the BC dashboard
function bySortOrder(a: Page, b: Page) {
return (a.sort_order ?? 0) - (b.sort_order ?? 0)
return (a.sort_order ?? 0) - (b.sort_order ?? 0)
}
export default Footer

View File

@ -45,7 +45,8 @@ const FeatureBar = dynamic(
interface Props {
pageProps: {
pages?: Page[]
categories: Category[]
categories: Category[],
agilityProps: any
}
}
@ -90,10 +91,14 @@ const SidebarUI: FC = () => {
) : null
}
const Layout: FC<Props> = ({
children,
pageProps: { categories = [], ...pageProps },
}) => {
const Layout: FC<Props> = (props) => {
const {
children,
pageProps: { agilityProps, categories = [], ...pageProps },
} = props
const { acceptedCookies, onAcceptCookies } = useAcceptCookies()
const { locale = 'en-US' } = useRouter()
const navBarlinks = categories.slice(0, 2).map((c) => ({
@ -104,9 +109,9 @@ const Layout: FC<Props> = ({
return (
<CommerceProvider locale={locale}>
<div className={cn(s.root)}>
<Navbar links={navBarlinks} />
<Navbar links={navBarlinks} agilityProps={agilityProps}/>
<main className="fit">{children}</main>
<Footer pages={pageProps.pages} />
<Footer pages={pageProps.pages} agilityProps={agilityProps} />
<ModalUI />
<SidebarUI />
<FeatureBar

View File

@ -6,46 +6,52 @@ import { Logo, Container } from '@components/ui'
import { Searchbar, UserNav } from '@components/common'
interface Link {
href: string
label: string
href: string
label: string
}
interface NavbarProps {
links?: Link[]
links?: Link[],
agilityProps: any
}
const Navbar: FC<NavbarProps> = ({ links }) => (
<NavbarRoot>
<Container>
<div className={s.nav}>
<div className="flex items-center flex-1">
<Link href="/">
<a className={s.logo} aria-label="Logo">
<Logo />
</a>
</Link>
<nav className={s.navMenu}>
<Link href="/search">
<a className={s.link}>All</a>
</Link>
{links?.map((l) => (
<Link href={l.href} key={l.href}>
<a className={s.link}>{l.label}</a>
</Link>
))}
</nav>
</div>
<div className="justify-center flex-1 hidden lg:flex">
<Searchbar />
</div>
<div className="flex items-center justify-end flex-1 space-x-8">
<UserNav />
</div>
</div>
<div className="flex pb-4 lg:px-6 lg:hidden">
<Searchbar id="mobile-search" />
</div>
</Container>
</NavbarRoot>
)
const Navbar: FC<NavbarProps> = ({ links, agilityProps }) => {
const siteData = agilityProps.globalData["sitedata"]
return (
<NavbarRoot>
<Container>
<div className={s.nav}>
<div className="flex items-center flex-1">
<Link href="/">
<a className={s.logo} aria-label="Logo">
<img src={siteData.logo.url} alt={siteData.logo.label} height="32" width="32" className="rounded-full border border-accent-6" />
</a>
</Link>
<nav className={s.navMenu}>
<Link href="/search">
<a className={s.link}>All</a>
</Link>
{links?.map((l) => (
<Link href={l.href} key={l.href}>
<a className={s.link}>{l.label}</a>
</Link>
))}
</nav>
</div>
<div className="justify-center flex-1 hidden lg:flex">
<Searchbar />
</div>
<div className="flex items-center justify-end flex-1 space-x-8">
<UserNav />
</div>
</div>
<div className="flex pb-4 lg:px-6 lg:hidden">
<Searchbar id="mobile-search" />
</div>
</Container>
</NavbarRoot>
)
}
export default Navbar

View File

@ -1,27 +0,0 @@
import commerce from '@lib/api/commerce'
const getCustomInitialProps = async function ({ item, agility, languageCode, channelName, pageInSitemap, dynamicPageItem }: any) {
//TODO: pass the locale and preview mode as props...
const locale = "en-US"
const preview = false
const config = { locale, locales: [locale] }
const productsPromise = commerce.getAllProducts({
variables: { first: 6 },
config,
preview,
// Saleor provider only
...({ featured: true } as any),
})
const { products } = await productsPromise
return {
products
}
}
export default { getCustomInitialProps }

View File

@ -0,0 +1,72 @@
import { ComponentWithInit } from "@agility/nextjs"
interface ICustomData {
name: any,
logo: any,
links: any[]
}
const SiteData:ComponentWithInit<ICustomData> = ({ globalData, sitemapNode, page }) => {
return null
}
SiteData.getCustomInitialProps = async function ({ agility, languageCode, channelName }) {
// set up api
const api = agility;
// set up content item
let contentItem = null;
// set up links
let links = [];
try {
// try to fetch our site header
let header = await api.getContentList({
referenceName: "sitedata",
languageCode: languageCode,
take: 1
});
// if we have a header, set as content item
if (header && header.items.length > 0) {
contentItem = header.items[0];
// else return null
} else {
throw new Error("The Site Data item did not have any content.")
}
} catch (error) {
throw new Error(`Could not load site data item: ${error}`)
}
try {
// get the nested sitemap
let sitemap = await api.getSitemapNested({
channelName: channelName,
languageCode: languageCode,
});
// grab the top level links that are visible on menu
links = sitemap
.filter((node:any) => node.visible.menu)
.map((node:any) => {
return {
name: node.menuText || node.title,
url: node.path,
};
});
} catch (error) {
throw new Error(`Could not load nested sitemap: ${error}`)
}
// return clean object...
return {
name: contentItem.fields.name,
logo: contentItem.fields.logo,
links,
};
};
export default SiteData

View File

@ -0,0 +1,86 @@
const getCustomInitialProps = async ({
agility,
channelName,
languageCode,
}:any) => {
// set up api
const api = agility;
// get sitemap...
let sitemap = await api.getSitemap({
channelName: channelName,
languageCode,
});
// get posts...
let rawPosts = await api.getContentList({
referenceName: "blogposts",
languageCode,
take: 50,
contentLinkDepth: 2,
depth: 2
});
// resolve dynamic urls
const dynamicUrls: [] = resolvePostUrls(sitemap, rawPosts.items);
const posts: [] = rawPosts.items.map((post: any) => {
const productJSON = post.fields.product
const product = JSON.parse(productJSON)
const productName = product.name
const productImageSrc = product.imageUrl
// date
const date = new Date(post.fields.date).toLocaleDateString();
// url
const url = dynamicUrls[post.contentID] || "#";
// post image src
let imageSrc = post.fields.image?.url || null
// post image alt
let imageAlt = post.fields.image?.label || null;
return {
contentID: post.contentID,
title: post.fields.title,
date,
url,
productName,
productImageSrc,
imageSrc,
imageAlt,
};
});
//sort newest first...
posts.sort((a: any, b: any) => {
return b.date.localeCompare(a.date);
})
return {
posts,
};
};
// function to resole post urls
const resolvePostUrls = function (sitemap: any, posts: any): any {
let dynamicUrls: any = {};
posts.forEach((post: any) => {
Object.keys(sitemap).forEach((path) => {
if (sitemap[path].contentID === post.contentID) {
dynamicUrls[post.contentID] = path;
}
});
});
return dynamicUrls;
};
export default { getCustomInitialProps }

View File

@ -3,13 +3,14 @@ import commerce from '@lib/api/commerce'
const getCustomInitialProps = async function ({ item, agility, languageCode, channelName, pageInSitemap, dynamicPageItem }: any) {
//TODO: pass the locale and preview mode as props...
const locale = "en-US"
const preview = false
const numItems = parseInt(item.fields.numItems) || 10
const config = { locale, locales: [locale] }
const productsPromise = commerce.getAllProducts({
variables: { first: 6 },
variables: { first: numItems },
config,
preview,
// Saleor provider only

View File

@ -1,17 +1,19 @@
import BestsellingProductsData from "./BestsellingProductsData"
import CartData from "./CartData"
import FeaturedProductsData from "./FeaturedProductsData"
import HomeAllProductsGridData from "./HomeAllProductsGridData"
import ProductListing from "./ProductListing"
import ProductMarquee from "./ProductMarquee"
import ProductSearchData from "./ProductSearchData"
import ProductDetailsData from "./ProductDetailsData"
import BlogPostListing from "./BlogPostListing"
const allModules:any =[
{ name: "BestsellingProducts", init: BestsellingProductsData },
{ name: "FeaturedProducts", init: FeaturedProductsData},
{ name: "HomeAllProductsGrid", init: HomeAllProductsGridData},
{ name: "ProductListing", init: ProductListing},
{ name: "ProductMarquee", init: ProductMarquee},
{ name: "ProductSearch", init: ProductSearchData},
{ name: "Cart", init: CartData},
{ name: "ProductDetails", init: ProductDetailsData}
{ name: "ProductDetails", init: ProductDetailsData},
{ name: "BlogPostListing", init: BlogPostListing}
]
/**

View File

@ -26,8 +26,9 @@
},
"dependencies": {
"@agility/content-sync": "^1.0.3",
"@agility/nextjs": "^0.2.0-rc14",
"@agility/nextjs": "^0.2.0-rc18",
"@react-spring/web": "^9.2.1",
"@tailwindcss/typography": "^0.4.1",
"@vercel/fetch": "^6.1.0",
"autoprefixer": "^10.2.6",
"body-scroll-lock": "^3.1.5",
@ -57,7 +58,8 @@
"swell-js": "^4.0.0-next.0",
"swr": "^0.5.6",
"tabbable": "^5.2.0",
"tailwindcss": "^2.1.2"
"tailwindcss": "^2.1.2",
"truncate-html": "^1.0.3"
},
"devDependencies": {
"@graphql-codegen/cli": "^1.21.5",

View File

@ -12,7 +12,8 @@ import { getAgilityPageProps, getAgilityPaths } from "@agility/nextjs/node"
import { handlePreview } from "@agility/nextjs"
import AgilityPage from "components/agility-global/AgilityPage"
import getModuleData from "framework/module-data"
import getModuleData from "@lib/module-data"
import SiteData from '@lib/global-data/SiteData'
export async function getStaticProps({ preview, params, locale, locales, defaultLocale }: GetStaticPropsContext<{ slug: string[] }>) {
@ -26,15 +27,13 @@ export async function getStaticProps({ preview, params, locale, locales, default
params.slug[1] = "product-details"
}
//add any global components (header, footer) that need agility data here
//add any global data accessor here
const globalComponents = {
// "header": GlobalHeader,
// "footer": GlobalFooter
"sitedata": SiteData
}
const agilityProps = await getAgilityPageProps({ preview, params, locale, getModule: getModuleData, defaultLocale, globalComponents });
let rebuildFrequency = 10
let productDetail: any = null

View File

@ -65,4 +65,7 @@ module.exports = {
},
},
},
plugins: [
require('@tailwindcss/typography'),
],
}

220
yarn.lock
View File

@ -19,10 +19,10 @@
dotenv "^8.2.0"
proper-lockfile "^4.1.2"
"@agility/nextjs@^0.2.0-rc14":
version "0.2.0-rc14"
resolved "https://registry.yarnpkg.com/@agility/nextjs/-/nextjs-0.2.0-rc14.tgz#eaeed440fcaf778db9f463c0f3f0a4bf64316771"
integrity sha512-DHgiUeVsLZByHcjsawz7HL9OLkD9nIOyHNUwNxuFSWjB22m5jn1V33EdxkF6ecjtC9n3Dm/WkWFsNGXyLIdl/Q==
"@agility/nextjs@^0.2.0-rc18":
version "0.2.0-rc18"
resolved "https://registry.yarnpkg.com/@agility/nextjs/-/nextjs-0.2.0-rc18.tgz#bf2f6bfe61bac3c9b8ad9c4b70e461eae017b45c"
integrity sha512-hitv7OafgJtVo2Y8s0t9dLmQKhowD1wr9GkP9lOKJkinBNb0kj4Lzf7Cpl7g34wwstPtEYHtwSlWC1bvfdMfUQ==
"@ardatan/aggregate-error@0.0.6":
version "0.0.6"
@ -1053,6 +1053,16 @@
dependencies:
defer-to-connect "^1.0.1"
"@tailwindcss/typography@^0.4.1":
version "0.4.1"
resolved "https://registry.yarnpkg.com/@tailwindcss/typography/-/typography-0.4.1.tgz#51ddbceea6a0ee9902c649dbe58871c81a831212"
integrity sha512-ovPPLUhs7zAIJfr0y1dbGlyCuPhpuv/jpBoFgqAc658DWGGrOBWBMpAWLw2KlzbNeVk4YBJMzue1ekvIbdw6XA==
dependencies:
lodash.castarray "^4.4.0"
lodash.isplainobject "^4.0.6"
lodash.merge "^4.6.2"
lodash.uniq "^4.5.0"
"@tootallnate/once@1":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"
@ -1068,6 +1078,13 @@
resolved "https://registry.yarnpkg.com/@types/body-scroll-lock/-/body-scroll-lock-2.6.1.tgz#0dbd2b6ad2f4cfcece7102d6cf8630ce95508ee0"
integrity sha512-PPFm/2A6LfKmSpvMg58gHtSqwwMChbcKKGhSCRIhY4MyFzhY8moAN6HrTCpOeZQUqkFdTFfMqr7njeqGLKt72Q==
"@types/cheerio@^0.22.8":
version "0.22.29"
resolved "https://registry.yarnpkg.com/@types/cheerio/-/cheerio-0.22.29.tgz#7115e9688bfc9e2f2730327c674b3d6a7e753e09"
integrity sha512-rNX1PsrDPxiNiyLnRKiW2NXHJFHqx0Fl3J2WsZq0MTBspa/FgwlqhXJE2crIcc+/2IglLHtSWw7g053oUR8fOg==
dependencies:
"@types/node" "*"
"@types/cookie@^0.4.0":
version "0.4.0"
resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.4.0.tgz#14f854c0f93d326e39da6e3b6f34f7d37513d108"
@ -1621,6 +1638,11 @@ body-scroll-lock@^3.1.5:
resolved "https://registry.yarnpkg.com/body-scroll-lock/-/body-scroll-lock-3.1.5.tgz#c1392d9217ed2c3e237fee1e910f6cdd80b7aaec"
integrity sha512-Yi1Xaml0EvNA0OYWxXiYNqY24AfWkbA6w5vxE7GWxtKfzIbZM+Qw+aSmkgsbWzbHiy/RCSkUZBplVxTA+E4jJg==
boolbase@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24=
bowser@^2.11.0:
version "2.11.0"
resolved "https://registry.yarnpkg.com/bowser/-/bowser-2.11.0.tgz#5ca3c35757a7aa5771500c70a73a9f91ef420a8f"
@ -1929,6 +1951,28 @@ charenc@0.0.2:
resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667"
integrity sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=
cheerio@0.22.0:
version "0.22.0"
resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-0.22.0.tgz#a9baa860a3f9b595a6b81b1a86873121ed3a269e"
integrity sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=
dependencies:
css-select "~1.2.0"
dom-serializer "~0.1.0"
entities "~1.1.1"
htmlparser2 "^3.9.1"
lodash.assignin "^4.0.9"
lodash.bind "^4.1.4"
lodash.defaults "^4.0.1"
lodash.filter "^4.4.0"
lodash.flatten "^4.2.0"
lodash.foreach "^4.3.0"
lodash.map "^4.4.0"
lodash.merge "^4.4.0"
lodash.pick "^4.2.1"
lodash.reduce "^4.4.0"
lodash.reject "^4.4.0"
lodash.some "^4.4.0"
chokidar@3.5.1:
version "3.5.1"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a"
@ -2301,11 +2345,26 @@ css-prefers-color-scheme@^3.1.1:
dependencies:
postcss "^7.0.5"
css-select@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858"
integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=
dependencies:
boolbase "~1.0.0"
css-what "2.1"
domutils "1.5.1"
nth-check "~1.0.1"
css-unit-converter@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/css-unit-converter/-/css-unit-converter-1.1.2.tgz#4c77f5a1954e6dbff60695ecb214e3270436ab21"
integrity sha512-IiJwMC8rdZE0+xiEZHeru6YoONC4rfPMqGm2W85jMIbkFvv5nFTwJVFHam2eFrN6txmoUYFAFXiv8ICVeTO0MA==
css-what@2.1:
version "2.1.3"
resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2"
integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==
css.escape@1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/css.escape/-/css.escape-1.5.1.tgz#42e27d4fa04ae32f931a4b4d4191fa9cddee97cb"
@ -2629,11 +2688,60 @@ dlv@^1.1.3:
resolved "https://registry.yarnpkg.com/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79"
integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==
dom-serializer@0:
version "0.2.2"
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51"
integrity sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==
dependencies:
domelementtype "^2.0.1"
entities "^2.0.0"
dom-serializer@~0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0"
integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==
dependencies:
domelementtype "^1.3.0"
entities "^1.1.1"
domain-browser@^1.1.1:
version "1.2.0"
resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda"
integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==
domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f"
integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==
domelementtype@^2.0.1:
version "2.2.0"
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.2.0.tgz#9a0b6c2782ed6a1c7323d42267183df9bd8b1d57"
integrity sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==
domhandler@^2.3.0:
version "2.4.2"
resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803"
integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==
dependencies:
domelementtype "1"
domutils@1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf"
integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=
dependencies:
dom-serializer "0"
domelementtype "1"
domutils@^1.5.1:
version "1.7.0"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a"
integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==
dependencies:
dom-serializer "0"
domelementtype "1"
dot-case@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751"
@ -2746,6 +2854,16 @@ enquirer@^2.3.6:
dependencies:
ansi-colors "^4.1.1"
entities@^1.1.1, entities@~1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56"
integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==
entities@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55"
integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==
errno@^0.1.3:
version "0.1.8"
resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f"
@ -3348,6 +3466,18 @@ html-tags@^3.1.0:
resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-3.1.0.tgz#7b5e6f7e665e9fb41f30007ed9e0d41e97fb2140"
integrity sha512-1qYz89hW3lFDEazhjW0yVAV87lw8lVkrJocr72XmBkMKsoSVJCQx3W8BXsC7hO2qAt8BoVjYjtAcZ9perqGnNg==
htmlparser2@^3.9.1:
version "3.10.1"
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f"
integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==
dependencies:
domelementtype "^1.3.1"
domhandler "^2.3.0"
domutils "^1.5.1"
entities "^1.1.1"
inherits "^2.0.1"
readable-stream "^3.1.1"
http-cache-semantics@^4.0.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390"
@ -4034,11 +4164,26 @@ locate-path@^5.0.0:
dependencies:
p-locate "^4.1.0"
lodash.assignin@^4.0.9:
version "4.2.0"
resolved "https://registry.yarnpkg.com/lodash.assignin/-/lodash.assignin-4.2.0.tgz#ba8df5fb841eb0a3e8044232b0e263a8dc6a28a2"
integrity sha1-uo31+4QesKPoBEIysOJjqNxqKKI=
lodash.bind@^4.1.4:
version "4.2.1"
resolved "https://registry.yarnpkg.com/lodash.bind/-/lodash.bind-4.2.1.tgz#7ae3017e939622ac31b7d7d7dcb1b34db1690d35"
integrity sha1-euMBfpOWIqwxt9fX3LGzTbFpDTU=
lodash.camelcase@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6"
integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY=
lodash.castarray@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/lodash.castarray/-/lodash.castarray-4.4.0.tgz#c02513515e309daddd4c24c60cfddcf5976d9115"
integrity sha1-wCUTUV4wna3dTCTGDP3c9ZdtkRU=
lodash.clonedeep@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
@ -4049,6 +4194,26 @@ lodash.debounce@^4.0.8:
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=
lodash.defaults@^4.0.1:
version "4.2.0"
resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c"
integrity sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=
lodash.filter@^4.4.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash.filter/-/lodash.filter-4.6.0.tgz#668b1d4981603ae1cc5a6fa760143e480b4c4ace"
integrity sha1-ZosdSYFgOuHMWm+nYBQ+SAtMSs4=
lodash.flatten@^4.2.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f"
integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=
lodash.foreach@^4.3.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.foreach/-/lodash.foreach-4.5.0.tgz#1a6a35eace401280c7f06dddec35165ab27e3e53"
integrity sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=
lodash.get@^4:
version "4.4.2"
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
@ -4089,21 +4254,51 @@ lodash.isstring@^4.0.1:
resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451"
integrity sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=
lodash.map@^4.4.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3"
integrity sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=
lodash.merge@^4.4.0, lodash.merge@^4.6.2:
version "4.6.2"
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==
lodash.once@^4.0.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac"
integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=
lodash.pick@^4.2.1:
version "4.4.0"
resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3"
integrity sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=
lodash.random@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/lodash.random/-/lodash.random-3.2.0.tgz#96e24e763333199130d2c9e2fd57f91703cc262d"
integrity sha1-luJOdjMzGZEw0sni/Vf5FwPMJi0=
lodash.reduce@^4.4.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash.reduce/-/lodash.reduce-4.6.0.tgz#f1ab6b839299ad48f784abbf476596f03b914d3b"
integrity sha1-8atrg5KZrUj3hKu/R2WW8DuRTTs=
lodash.reject@^4.4.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash.reject/-/lodash.reject-4.6.0.tgz#80d6492dc1470864bbf583533b651f42a9f52415"
integrity sha1-gNZJLcFHCGS79YNTO2UfQqn1JBU=
lodash.snakecase@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d"
integrity sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=
lodash.some@^4.4.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d"
integrity sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=
lodash.sortby@^4.7.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
@ -4601,6 +4796,13 @@ npm-run-path@^4.0.1:
dependencies:
path-key "^3.0.0"
nth-check@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c"
integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==
dependencies:
boolbase "~1.0.0"
nullthrows@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/nullthrows/-/nullthrows-1.1.1.tgz#7818258843856ae971eae4208ad7d7eb19a431b1"
@ -5585,7 +5787,7 @@ readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.3.3, readable
string_decoder "~1.1.1"
util-deprecate "~1.0.1"
readable-stream@^3.4.0, readable-stream@^3.5.0, readable-stream@^3.6.0:
readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.5.0, readable-stream@^3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198"
integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==
@ -6408,6 +6610,14 @@ tr46@^1.0.1:
dependencies:
punycode "^2.1.0"
truncate-html@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/truncate-html/-/truncate-html-1.0.3.tgz#0166dfc7890626130c2e4174c6b73d4d63993e5f"
integrity sha512-1o1prdRv+iehXcGwn29YgXU17DotHkr+OK3ijVEG7FGMwHNG9RyobXwimw6djDvbIc24rhmz3tjNNvNESjkNkQ==
dependencies:
"@types/cheerio" "^0.22.8"
cheerio "0.22.0"
ts-loader@^7.0.0:
version "7.0.5"
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-7.0.5.tgz#789338fb01cb5dc0a33c54e50558b34a73c9c4c5"