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",
"pretty-quick": "^3.0.0",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"rehype-format": "^4.0.1",
"remark": "^14.0.2",
"remark-frontmatter": "^4.0.1",

View file

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

View file

@ -70,6 +70,7 @@ export const setup = async () => {
console.log('Failed at account confirmation request', err)
process.exit()
}
console.log(JSON.stringify(result.data, null ,2))
store[acc].token = result.data.token
store[acc].username = result.data.account.username
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">
{/* Social icons */}
<div className="w-full sm:w-auto flex flex-row flex-wrap gap-4 lg:gap-8 items-center justify-center">
<Link href="/contact">
<a
className="hover:text-secondary hover:-mt-2 transition-all"
title="Contact information"
>
<Link href="/contact" className="hover:text-secondary hover:-mt-2 transition-all" title="Contact information">
<HelpIcon {...icon} />
</a>
</Link>
{Object.keys(social).map((item) => (
<Link key={item} href={social[item].href}>
<a className="hover:text-secondary hover:-mt-2 transition-all" title={item}>
<Link key={item} href={social[item].href} className="hover:text-secondary hover:-mt-2 transition-all" title={item}>
{social[item].icon}
</a>
</Link>
))}
</div>

View file

@ -1,6 +1,5 @@
import { useState, useEffect } from 'react'
import FreeSewingIcon from 'shared/components/icons/freesewing.js'
import Link from 'next/link'
import ThemePicker from 'shared/components/theme-picker.js'
import CloseIcon from 'shared/components/icons/close.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}
before={[
<div className="flex flex-row items-center justify-between border-b mb-4">
<Link href="/">
<a>
<HomeIcon />
</a>
</Link>
<Link href="/"><HomeIcon /></Link>
<ThemePicker app={app} />
</div>,
]}

View file

@ -74,8 +74,8 @@ const SubLevel = ({ nodes = {}, active }) => (
items-center
`}
>
<Link href={`${child.__slug}`}>
<a
<Link
href={`${child.__slug}`}
title={child.__title}
className={`
grow pl-2 border-l-2
@ -105,7 +105,6 @@ const SubLevel = ({ nodes = {}, active }) => (
<span className={child.__slug === active ? 'font-bold' : ''}>
{child.__linktitle || child.__title}
</span>
</a>
</Link>
<Chevron w={6} m={3} />
</summary>
@ -114,8 +113,9 @@ const SubLevel = ({ nodes = {}, active }) => (
</li>
) : (
<li className="pl-2 flex flex-row items-center" key={child.__slug}>
<Link href={`${child.__slug}`} title={child.__title}>
<a
<Link
href={`${child.__slug}`}
title={child.__title}
className={`
pl-2 border-l-2
grow
@ -144,7 +144,6 @@ const SubLevel = ({ nodes = {}, active }) => (
<span className={child.__slug === active ? 'font-bold' : ''}>
{child.__linktitle || child.__title}
</span>
</a>
</Link>
</li>
)
@ -152,56 +151,6 @@ const SubLevel = ({ nodes = {}, active }) => (
</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 = ({
app,
active,
@ -217,11 +166,9 @@ export const Icons = ({
for (const page of order(app.navigation)) {
output.push(
<li key={page.__slug}>
<Link href={`${page.__slug}`}>
<a className={linkClasses} title={page.__title} style={linkStyle}>
<Link href={`${page.__slug}`} className={linkClasses} title={page.__title} style={linkStyle}>
{icons[page.__slug] ? icons[page.__slug]('w-14 h-14') : <HelpIcon />}
<span className="font-bold">{page.__title}</span>
</a>
</Link>
</li>
)
@ -229,16 +176,7 @@ export const Icons = ({
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 }) => {
if (!app.navigation) return null
const output = []
@ -271,8 +209,8 @@ export const MainSections = ({ app, active }) => {
{txt}
</span>
) : (
<Link href={`${page.__slug}`}>
<a
<Link
href={`${page.__slug}`}
className={`${linkClasses}
flex flex-row gap-4 items-center
hover:bg-secondary hover:bg-opacity-10
@ -281,7 +219,6 @@ export const MainSections = ({ app, active }) => {
title={page.__title}
>
{txt}
</a>
</Link>
)}
</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'}
`}
>
<Link href={props.hit.page}>
<a href={props.hit.page} className="flex flex-row justify-between gap-2">
<Link href={props.hit.page} className="flex flex-row justify-between gap-2">
<span className="text-base sm:text-xl font-bold leading-5">
{props.hit._highlightResult?.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">
{props.hit.page.split('/')[1]}
</span>
</a>
</Link>
{props.hit._snippetResult?.body && (
<Link href={props.hit.page}>
<a href={props.hit.page} className="text-sm sm:text-base block py-1">
<Link href={props.hit.page} className="text-sm sm:text-base block py-1">
<CustomHighlight hit={props.hit} attribute="body" snippet />
</a>
</Link>
)}
{props.hit?._highlightResult?.page && (
<Link href={props.hit.page}>
<a href={props.hit.page} className="text-xs sm:text-sm block opacity-70">
<Link href={props.hit.page} className="text-xs sm:text-sm block opacity-70">
<CustomHighlight hit={props.hit} attribute="page" />
</a>
</Link>
)}
</div>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -25,7 +25,7 @@ const PreviewTile = ({ img, slug, title, href=false, fixed=false }) => (
>
{href
? <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>
)

View file

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