1
0
Fork 0

chore: more in upstream changes

This commit is contained in:
joostdecock 2022-12-04 13:19:42 +01:00
parent e28ca4ea86
commit 85bd7f142f
15 changed files with 107 additions and 198 deletions

View file

@ -95,8 +95,6 @@
"prettier": "^2.7.1", "prettier": "^2.7.1",
"pretty-quick": "^3.0.0", "pretty-quick": "^3.0.0",
"prop-types": "^15.7.2", "prop-types": "^15.7.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"rehype-format": "^4.0.1", "rehype-format": "^4.0.1",
"remark": "^14.0.2", "remark": "^14.0.2",
"remark-frontmatter": "^4.0.1", "remark-frontmatter": "^4.0.1",

View file

@ -12,7 +12,7 @@ const runTests = async (...params) => {
//await apikeyTests(...params) //await apikeyTests(...params)
//await accountTests(...params) //await accountTests(...params)
//await personTests(...params) //await personTests(...params)
await patternTests(...params) //await patternTests(...params)
} }
// Load initial data required for tests // Load initial data required for tests

View file

@ -70,6 +70,7 @@ export const setup = async () => {
console.log('Failed at account confirmation request', err) console.log('Failed at account confirmation request', err)
process.exit() process.exit()
} }
console.log(JSON.stringify(result.data, null ,2))
store[acc].token = result.data.token store[acc].token = result.data.token
store[acc].username = result.data.account.username store[acc].username = result.data.account.username
store[acc].id = result.data.account.id store[acc].id = result.data.account.id

View file

@ -107,19 +107,12 @@ const Footer = ({ app }) => {
<div className="lg:col-span-2 -order-2 2xl:order-2 px-4 lg:px-0"> <div className="lg:col-span-2 -order-2 2xl:order-2 px-4 lg:px-0">
{/* Social icons */} {/* Social icons */}
<div className="w-full sm:w-auto flex flex-row flex-wrap gap-4 lg:gap-8 items-center justify-center"> <div className="w-full sm:w-auto flex flex-row flex-wrap gap-4 lg:gap-8 items-center justify-center">
<Link href="/contact"> <Link href="/contact" className="hover:text-secondary hover:-mt-2 transition-all" title="Contact information">
<a
className="hover:text-secondary hover:-mt-2 transition-all"
title="Contact information"
>
<HelpIcon {...icon} /> <HelpIcon {...icon} />
</a>
</Link> </Link>
{Object.keys(social).map((item) => ( {Object.keys(social).map((item) => (
<Link key={item} href={social[item].href}> <Link key={item} href={social[item].href} className="hover:text-secondary hover:-mt-2 transition-all" title={item}>
<a className="hover:text-secondary hover:-mt-2 transition-all" title={item}>
{social[item].icon} {social[item].icon}
</a>
</Link> </Link>
))} ))}
</div> </div>

View file

@ -1,6 +1,5 @@
import { useState, useEffect } from 'react' import { useState, useEffect } from 'react'
import FreeSewingIcon from 'shared/components/icons/freesewing.js' import FreeSewingIcon from 'shared/components/icons/freesewing.js'
import Link from 'next/link'
import ThemePicker from 'shared/components/theme-picker.js' import ThemePicker from 'shared/components/theme-picker.js'
import CloseIcon from 'shared/components/icons/close.js' import CloseIcon from 'shared/components/icons/close.js'
import MenuIcon from 'shared/components/icons/menu.js' import MenuIcon from 'shared/components/icons/menu.js'

View file

@ -19,11 +19,7 @@ const DefaultLayout = ({ app, title = false, crumbs = false, children = [] }) =>
slug={slug} slug={slug}
before={[ before={[
<div className="flex flex-row items-center justify-between border-b mb-4"> <div className="flex flex-row items-center justify-between border-b mb-4">
<Link href="/"> <Link href="/"><HomeIcon /></Link>
<a>
<HomeIcon />
</a>
</Link>
<ThemePicker app={app} /> <ThemePicker app={app} />
</div>, </div>,
]} ]}

View file

@ -74,8 +74,8 @@ const SubLevel = ({ nodes = {}, active }) => (
items-center items-center
`} `}
> >
<Link href={`${child.__slug}`}> <Link
<a href={`${child.__slug}`}
title={child.__title} title={child.__title}
className={` className={`
grow pl-2 border-l-2 grow pl-2 border-l-2
@ -105,7 +105,6 @@ const SubLevel = ({ nodes = {}, active }) => (
<span className={child.__slug === active ? 'font-bold' : ''}> <span className={child.__slug === active ? 'font-bold' : ''}>
{child.__linktitle || child.__title} {child.__linktitle || child.__title}
</span> </span>
</a>
</Link> </Link>
<Chevron w={6} m={3} /> <Chevron w={6} m={3} />
</summary> </summary>
@ -114,8 +113,9 @@ const SubLevel = ({ nodes = {}, active }) => (
</li> </li>
) : ( ) : (
<li className="pl-2 flex flex-row items-center" key={child.__slug}> <li className="pl-2 flex flex-row items-center" key={child.__slug}>
<Link href={`${child.__slug}`} title={child.__title}> <Link
<a href={`${child.__slug}`}
title={child.__title}
className={` className={`
pl-2 border-l-2 pl-2 border-l-2
grow grow
@ -144,7 +144,6 @@ const SubLevel = ({ nodes = {}, active }) => (
<span className={child.__slug === active ? 'font-bold' : ''}> <span className={child.__slug === active ? 'font-bold' : ''}>
{child.__linktitle || child.__title} {child.__linktitle || child.__title}
</span> </span>
</a>
</Link> </Link>
</li> </li>
) )
@ -152,56 +151,6 @@ const SubLevel = ({ nodes = {}, active }) => (
</ul> </ul>
) )
// Component that renders a toplevel of navigation
/*
const TopLevel = ({ icon, title, nav, current, slug, hasChildren=false, active }) => (
<details className='py-1' open={0}>
<summary className={`
flex flex-row uppercase gap-4 font-bold text-lg
hover:cursor-row-resize
p-2
text-base-content
sm:text-base-content
items-center
`}>
<span className="text-secondary">{icon}</span>
<Link href={`${slug}`}>
<a className={`
grow ${linkClasses} hover:cursor-pointer
${slug === active
? 'text-secondary sm:text-secondary'
: ''
}`}
>
{title}
</a>
</Link>
{hasChildren && <Chevron />}
</summary>
{hasChildren && <SubLevel nodes={current} active={active} />}
</details>
)
const Navigation = ({ app, active, className='' }) => {
if (!app.navigation) return null
const output = []
for (const page of order(app.navigation)) output.push(<TopLevel
key={page.__slug}
icon={icons[page.__slug]
? icons[page.__slug]('w-6 h-6')
: <span className="text-3xl mr-2 translate-y-3 inline-block p-0 leading-3">&deg;</span>
}
title={page.__title}
slug={page.__slug}
hasChildren={1}
nav={app.navigation}
current={order(app.navigation[page.__slug])}
active={active}
/>)
return <div className={`pb-20 ${className}`}>{output}</div>
}
*/
export const Icons = ({ export const Icons = ({
app, app,
active, active,
@ -217,11 +166,9 @@ export const Icons = ({
for (const page of order(app.navigation)) { for (const page of order(app.navigation)) {
output.push( output.push(
<li key={page.__slug}> <li key={page.__slug}>
<Link href={`${page.__slug}`}> <Link href={`${page.__slug}`} className={linkClasses} title={page.__title} style={linkStyle}>
<a className={linkClasses} title={page.__title} style={linkStyle}>
{icons[page.__slug] ? icons[page.__slug]('w-14 h-14') : <HelpIcon />} {icons[page.__slug] ? icons[page.__slug]('w-14 h-14') : <HelpIcon />}
<span className="font-bold">{page.__title}</span> <span className="font-bold">{page.__title}</span>
</a>
</Link> </Link>
</li> </li>
) )
@ -229,16 +176,7 @@ export const Icons = ({
return <ul className={ulClasses}>{output}</ul> return <ul className={ulClasses}>{output}</ul>
} }
/*
const PrimaryMenu = ({ app, active, before=[], after=[] }) => (
<nav className="mb-12">
{before}
<Icons app={app} ulClasses="hidden md:block lg:hidden flex flex-col items-center"/>
<Navigation app={app} active={active} className="md:hidden lg:block"/>
{after}
</nav>
)
*/
export const MainSections = ({ app, active }) => { export const MainSections = ({ app, active }) => {
if (!app.navigation) return null if (!app.navigation) return null
const output = [] const output = []
@ -271,8 +209,8 @@ export const MainSections = ({ app, active }) => {
{txt} {txt}
</span> </span>
) : ( ) : (
<Link href={`${page.__slug}`}> <Link
<a href={`${page.__slug}`}
className={`${linkClasses} className={`${linkClasses}
flex flex-row gap-4 items-center flex flex-row gap-4 items-center
hover:bg-secondary hover:bg-opacity-10 hover:bg-secondary hover:bg-opacity-10
@ -281,7 +219,6 @@ export const MainSections = ({ app, active }) => {
title={page.__title} title={page.__title}
> >
{txt} {txt}
</a>
</Link> </Link>
)} )}
</li> </li>

View file

@ -67,8 +67,7 @@ const Hit = (props) => (
${props.index === props.active ? 'bg-secondary bg-opacity-30' : 'bg-base-300 bg-opacity-10'} ${props.index === props.active ? 'bg-secondary bg-opacity-30' : 'bg-base-300 bg-opacity-10'}
`} `}
> >
<Link href={props.hit.page}> <Link href={props.hit.page} className="flex flex-row justify-between gap-2">
<a href={props.hit.page} className="flex flex-row justify-between gap-2">
<span className="text-base sm:text-xl font-bold leading-5"> <span className="text-base sm:text-xl font-bold leading-5">
{props.hit._highlightResult?.title ? ( {props.hit._highlightResult?.title ? (
<CustomHighlight hit={props.hit} attribute="title" /> <CustomHighlight hit={props.hit} attribute="title" />
@ -79,20 +78,15 @@ const Hit = (props) => (
<span className="text-xs pt-0.5 sm:text-base sm:pt-1 font-bold uppercase"> <span className="text-xs pt-0.5 sm:text-base sm:pt-1 font-bold uppercase">
{props.hit.page.split('/')[1]} {props.hit.page.split('/')[1]}
</span> </span>
</a>
</Link> </Link>
{props.hit._snippetResult?.body && ( {props.hit._snippetResult?.body && (
<Link href={props.hit.page}> <Link href={props.hit.page} className="text-sm sm:text-base block py-1">
<a href={props.hit.page} className="text-sm sm:text-base block py-1">
<CustomHighlight hit={props.hit} attribute="body" snippet /> <CustomHighlight hit={props.hit} attribute="body" snippet />
</a>
</Link> </Link>
)} )}
{props.hit?._highlightResult?.page && ( {props.hit?._highlightResult?.page && (
<Link href={props.hit.page}> <Link href={props.hit.page} className="text-xs sm:text-sm block opacity-70">
<a href={props.hit.page} className="text-xs sm:text-sm block opacity-70">
<CustomHighlight hit={props.hit} attribute="page" /> <CustomHighlight hit={props.hit} attribute="page" />
</a>
</Link> </Link>
)} )}
</div> </div>

View file

@ -25,21 +25,22 @@
"serve": "pm2 start npm --name 'dev' -- run start" "serve": "pm2 start npm --name 'dev' -- run start"
}, },
"dependencies": { "dependencies": {
"@heroicons/react": "^2.0.1", "@heroicons/react": "latest",
"@mdx-js/loader": "^2.0.0-rc.2", "@mdx-js/loader": "latest",
"@mdx-js/mdx": "^2.0.0-rc.2", "@mdx-js/mdx": "latest",
"@mdx-js/react": "^2.0.0-rc.2", "@mdx-js/react": "latest",
"@mdx-js/runtime": "next", "@mdx-js/runtime": "latest",
"@next/bundle-analyzer": "^13.0.5", "@next/bundle-analyzer": "^13",
"@tailwindcss/typography": "^0.5.0", "@tailwindcss/typography": "latest",
"algoliasearch": "^4.11.0", "algoliasearch": "^4.11.0",
"daisyui": "^2.0.6", "daisyui": "^2.0.6",
"lodash.get": "^4.4.2", "lodash.get": "^4.4.2",
"lodash.orderby": "^4.6.0", "lodash.orderby": "^4.6.0",
"lodash.set": "^4.3.2", "lodash.set": "^4.3.2",
"netlify-cli": "^12.0.4", "next": "^13",
"next": "latest", "react": "^18.2.0",
"react-copy-to-clipboard": "^5.0.4", "react-copy-to-clipboard": "^5.0.4",
"react-dom": "^18.2.0",
"react-hotkeys-hook": "^3.4.4", "react-hotkeys-hook": "^3.4.4",
"react-instantsearch-dom": "^6.18.0", "react-instantsearch-dom": "^6.18.0",
"react-markdown": "^8.0.3", "react-markdown": "^8.0.3",

View file

@ -44,7 +44,6 @@
"lodash.get": "^4.4.2", "lodash.get": "^4.4.2",
"lodash.orderby": "^4.6.0", "lodash.orderby": "^4.6.0",
"lodash.set": "^4.3.2", "lodash.set": "^4.3.2",
"netlify-cli": "^12.0.4",
"next": "latest", "next": "latest",
"next-i18next": "^12.0.0", "next-i18next": "^12.0.0",
"react-copy-to-clipboard": "^5.0.4", "react-copy-to-clipboard": "^5.0.4",

View file

@ -40,7 +40,6 @@
"lodash.get": "^4.4.2", "lodash.get": "^4.4.2",
"lodash.orderby": "^4.6.0", "lodash.orderby": "^4.6.0",
"lodash.set": "^4.3.2", "lodash.set": "^4.3.2",
"netlify-cli": "^12.0.4",
"next": "latest", "next": "latest",
"react-hotkeys-hook": "^3.4.4", "react-hotkeys-hook": "^3.4.4",
"react-instantsearch-dom": "^6.18.0", "react-instantsearch-dom": "^6.18.0",

View file

@ -87,8 +87,7 @@ const SubLevel = ({ nodes={}, active }) => (
hover:cursor-row-resize hover:cursor-row-resize
items-center items-center
`}> `}>
<Link href={`${child.__slug}`}> <Link href={`${child.__slug}`} title={child.__title} className={`
<a title={child.__title} className={`
grow pl-2 border-l-2 grow pl-2 border-l-2
${linkClasses} ${linkClasses}
hover:cursor-pointer hover:cursor-pointer
@ -111,7 +110,6 @@ const SubLevel = ({ nodes={}, active }) => (
<span className={child.__slug === active ? 'font-bold' : ''}> <span className={child.__slug === active ? 'font-bold' : ''}>
{ child.__linktitle || child.__title } { child.__linktitle || child.__title }
</span> </span>
</a>
</Link> </Link>
<Chevron w={6} m={3}/> <Chevron w={6} m={3}/>
</summary> </summary>
@ -120,8 +118,7 @@ const SubLevel = ({ nodes={}, active }) => (
</li> </li>
) : ( ) : (
<li className='pl-2 flex flex-row items-center' key={child.__slug}> <li className='pl-2 flex flex-row items-center' key={child.__slug}>
<Link href={`${child.__slug}`} title={child.__title}> <Link href={`${child.__slug}`} title={child.__title} className={`
<a className={`
pl-2 border-l-2 pl-2 border-l-2
grow grow
${linkClasses} ${linkClasses}
@ -144,7 +141,6 @@ const SubLevel = ({ nodes={}, active }) => (
<span className={child.__slug === active ? 'font-bold' : ''}> <span className={child.__slug === active ? 'font-bold' : ''}>
{child.__linktitle || child.__title} {child.__linktitle || child.__title}
</span> </span>
</a>
</Link> </Link>
</li> </li>
) )
@ -165,8 +161,7 @@ const TopLevel = ({ icon, title, nav, current, slug, hasChildren=false, active }
items-center items-center
`}> `}>
<span className="text-secondary">{icon}</span> <span className="text-secondary">{icon}</span>
<Link href={`${slug}`}> <Link href={`${slug}`} className={`
<a className={`
grow ${linkClasses} hover:cursor-pointer grow ${linkClasses} hover:cursor-pointer
${slug === active ${slug === active
? 'text-secondary sm:text-secondary' ? 'text-secondary sm:text-secondary'
@ -174,7 +169,6 @@ const TopLevel = ({ icon, title, nav, current, slug, hasChildren=false, active }
}`} }`}
> >
{title} {title}
</a>
</Link> </Link>
{hasChildren && <Chevron />} {hasChildren && <Chevron />}
</summary> </summary>
@ -216,14 +210,12 @@ export const Icons = ({
for (const page of order(app.navigation)) { for (const page of order(app.navigation)) {
output.push( output.push(
<li key={page.__slug} className={liClasses}> <li key={page.__slug} className={liClasses}>
<Link href={`${page.__slug}`}> <Link href={`${page.__slug}`} className={linkClasses} title={page.__title} style={linkStyle}>
<a className={linkClasses} title={page.__title} style={linkStyle}>
{icons[page.__slug] {icons[page.__slug]
? icons[page.__slug]('w-14 h-14') ? icons[page.__slug]('w-14 h-14')
: <HelpIcon /> : <HelpIcon />
} }
<span className='font-bold'>{page.__title}</span> <span className='font-bold'>{page.__title}</span>
</a>
</Link> </Link>
</li> </li>
) )

View file

@ -1,11 +1,9 @@
import Link from 'next/link' import Link from 'next/link'
const PageLink = ({ href, txt, className="" }) => ( const PageLink = ({ href, txt, className="" }) => (
<Link href={href}> <Link href={href} className={`font-bold text-secondary
<a className={`font-bold text-secondary
hover:text-secondary-focus hover:underline ${className}`} hover:text-secondary-focus hover:underline ${className}`}
title={txt}>{txt}</a> title={txt}>{txt}</Link>
</Link>
) )
export default PageLink export default PageLink

View file

@ -25,7 +25,7 @@ const PreviewTile = ({ img, slug, title, href=false, fixed=false }) => (
> >
{href {href
? <a href={href} title={title} className={linkClasses(fixed)}/> ? <a href={href} title={title} className={linkClasses(fixed)}/>
: <Link href={slug}><a title={title} className={linkClasses(fixed)}/></Link> : <Link href={slug} title={title} className={linkClasses(fixed)}></Link>
} }
</div> </div>
) )

View file

@ -43,6 +43,8 @@
"mdast-util-toc": "^6.1.0", "mdast-util-toc": "^6.1.0",
"pdfkit": "^0.13.0", "pdfkit": "^0.13.0",
"postcss-for": "^2.1.1", "postcss-for": "^2.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-markdown": "^8.0.0", "react-markdown": "^8.0.0",
"react-sizeme": "^3.0.2", "react-sizeme": "^3.0.2",
"react-timeago": "^7.1.0", "react-timeago": "^7.1.0",