Skip to content

Commit

Permalink
Update dev-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Feb 10, 2024
1 parent b9b37b6 commit 0e6dd7a
Show file tree
Hide file tree
Showing 54 changed files with 1,913 additions and 1,883 deletions.
36 changes: 18 additions & 18 deletions docs/_asset/editor.jsx
Expand Up @@ -12,14 +12,14 @@
* @typedef {import('mdast-util-mdx-jsx').MdxJsxAttributeValueExpression} MdxJsxAttributeValueExpression
* @typedef {import('mdast-util-mdx-jsx').MdxJsxExpressionAttribute} MdxJsxExpressionAttribute
* @typedef {import('mdx/types.js').MDXModule} MDXModule
* @typedef {import('react-error-boundary').FallbackProps} FallbackProps
* @typedef {import('react-error-boundary').FallbackProps} FallbackProperties
* @typedef {import('unified').PluggableList} PluggableList
* @typedef {import('unist').Node} UnistNode
*/

/**
* @typedef DisplayProps
* Props.
* @typedef DisplayProperties
* Properties.
* @property {Error} error
* Error.
*
Expand Down Expand Up @@ -204,7 +204,7 @@ function Playground() {

if (show === 'result') {
/** @type {MDXModule} */
const mod = await run(String(file), {
const result = await run(String(file), {
...runtime,
baseUrl: window.location.href
})
Expand All @@ -214,7 +214,7 @@ function Playground() {
FallbackComponent={ErrorFallback}
resetKeys={[value]}
>
<div className="playground-result">{mod.default({})}</div>
<div className="playground-result">{result.default({})}</div>
</ErrorBoundary>
)
}
Expand Down Expand Up @@ -567,39 +567,39 @@ function Playground() {

/**
*
* @param {Readonly<FallbackProps>} props
* Props.
* @param {Readonly<FallbackProperties>} properties
* Properties.
* @returns {JSX.Element}
* Element.
*/
function ErrorFallback(props) {
function ErrorFallback(properties) {
// type-coverage:ignore-next-line
const error = /** @type {Error} */ (props.error)
const error = /** @type {Error} */ (properties.error)
return (
<div role="alert">
<p>Something went wrong:</p>
<DisplayError error={error} />
<button type="button" onClick={props.resetErrorBoundary}>
<button type="button" onClick={properties.resetErrorBoundary}>
Try again
</button>
</div>
)
}

/**
* @param {DisplayProps} props
* Props.
* @param {DisplayProperties} properties
* Properties.
* @returns {JSX.Element}
* Element.
*/
function DisplayError(props) {
function DisplayError(properties) {
return (
<pre>
<code>
{String(
props.error.stack
? props.error.message + '\n' + props.error.stack
: props.error
properties.error.stack
? properties.error.message + '\n' + properties.error.stack
: properties.error
)}
</code>
</pre>
Expand Down Expand Up @@ -638,8 +638,8 @@ function cleanUnistNode(node) {
node.attributes &&
Array.isArray(node.attributes)
) {
for (const attr of node.attributes) {
cleanUnistNode(attr)
for (const attribute of node.attributes) {
cleanUnistNode(attribute)
}
}

Expand Down
29 changes: 17 additions & 12 deletions docs/_component/blog.jsx
Expand Up @@ -3,13 +3,13 @@
*/

/**
* @typedef EntryProps
* Props for `BlogEntry`.
* @typedef EntryProperties
* Properties for `BlogEntry`.
* @property {Readonly<Item>} item
* Item.
*
* @typedef GroupProps
* Props for `BlogGroup`.
* @typedef GroupProperties
* Properties for `BlogGroup`.
* @property {string | undefined} [className]
* Class name.
* @property {ReadonlyArray<Item>} items
Expand All @@ -30,13 +30,13 @@ const runtime = {Fragment, jsx, jsxs}
const dateTimeFormat = new Intl.DateTimeFormat('en', {dateStyle: 'long'})

/**
* @param {Readonly<EntryProps>} props
* Props.
* @param {Readonly<EntryProperties>} properties
* Properties.
* @returns {JSX.Element}
* Element.
*/
export function BlogEntry(props) {
const {item} = props
export function BlogEntry(properties) {
const {item} = properties
const {data, name} = item
const {matter = {}, meta = {}} = data
const title = matter.title || meta.title
Expand Down Expand Up @@ -106,13 +106,18 @@ export function BlogEntry(props) {
}

/**
* @param {Readonly<GroupProps>} props
* Props.
* @param {Readonly<GroupProperties>} properties
* Properties.
* @returns {JSX.Element}
* Element.
*/
export function BlogGroup(props) {
const {className, items, sort = 'navSortSelf,meta.title', ...rest} = props
export function BlogGroup(properties) {
const {
className,
items,
sort = 'navSortSelf,meta.title',
...rest
} = properties
const sorted = sortItems(items, sort)

return (
Expand Down
20 changes: 10 additions & 10 deletions docs/_component/home.jsx
Expand Up @@ -7,34 +7,34 @@
/**
* @typedef {Exclude<DataMeta, undefined>} Meta
*
* @typedef Props
* Props.
* @typedef Properties
* Properties.
* @property {string} name
* Name.
* @property {ReactNode} children
* Children.
* @property {Item} navTree
* @property {Item} navigationTree
* Navigation tree.
* @property {Meta} meta
* Meta.
*/

import React from 'react'
import {FootSite} from './foot-site.jsx'
import {NavSite, NavSiteSkip} from './nav-site.jsx'
import {NavigationSite, NavigationSiteSkip} from './nav-site.jsx'

/**
* @param {Readonly<Props>} props
* Props.
* @param {Readonly<Properties>} properties
* Properties.
* @returns {JSX.Element}
* Element.
*/
export function Home(props) {
const {children, meta, name, navTree} = props
export function Home(properties) {
const {children, meta, name, navigationTree} = properties

return (
<div className="page home">
<NavSiteSkip />
<NavigationSiteSkip />
<main>
{meta.schemaOrg ? (
<script type="application/ld+json">
Expand All @@ -46,7 +46,7 @@ export function Home(props) {
</article>
<FootSite />
</main>
<NavSite name={name} navTree={navTree} />
<NavigationSite name={name} navigationTree={navigationTree} />
</div>
)
}
48 changes: 26 additions & 22 deletions docs/_component/layout.jsx
Expand Up @@ -4,44 +4,48 @@
*/

/**
* @typedef Props
* Props.
* @typedef Properties
* Properties.
* @property {string} name
* Name.
* @property {Readonly<URL>} ghUrl
* GitHub URL.
* @property {Readonly<DataMeta> | undefined} [meta]
* Meta.
* @property {Readonly<Item>} navTree
* @property {Readonly<Item>} navigationTree
* Navigation tree.
* @property {JSX.Element} children
* Children.
*/

import React from 'react'
import {FootSite} from './foot-site.jsx'
import {NavSite, NavSiteSkip} from './nav-site.jsx'
import {NavigationSite, NavigationSiteSkip} from './nav-site.jsx'
import {sortItems} from './sort.js'

const dateTimeFormat = new Intl.DateTimeFormat('en', {dateStyle: 'long'})

/**
* @param {Readonly<Props>} props
* Props.
* @param {Readonly<Properties>} properties
* Properties.
* @returns {JSX.Element}
* Element.
*/
export function Layout(props) {
const {ghUrl, name, navTree} = props
const [self, parent] = findSelfAndParent(navTree) || []
const navSortItems = parent ? parent.data.navSortItems : undefined
export function Layout(properties) {
const {ghUrl, name, navigationTree} = properties
const [self, parent] = findSelfAndParent(navigationTree) || []
const navigationSortItems = parent
? parent.data.navigationSortItems
: undefined
const siblings = parent
? sortItems(
parent.children,
typeof navSortItems === 'string' ? navSortItems : undefined
typeof navigationSortItems === 'string'
? navigationSortItems
: undefined
)
: []
const meta = (self ? self.data.meta : props.meta) || {}
const meta = (self ? self.data.meta : properties.meta) || {}
const index = self ? siblings.indexOf(self) : -1
const previous = index === -1 ? undefined : siblings[index - 1]
const next = index === -1 ? undefined : siblings[index + 1]
Expand All @@ -50,10 +54,10 @@ export function Layout(props) {
self
? accumulateReadingTime(self)
: meta.readingTime
? Array.isArray(meta.readingTime)
? meta.readingTime
: [meta.readingTime, meta.readingTime]
: []
? Array.isArray(meta.readingTime)
? meta.readingTime
: [meta.readingTime, meta.readingTime]
: []
).map(function (d) {
return d > 15 ? Math.round(d / 5) * 5 : Math.ceil(d)
})
Expand All @@ -67,7 +71,7 @@ export function Layout(props) {
}

const up =
parent && self && parent !== navTree ? (
parent && self && parent !== navigationTree ? (
<div>
<a href={parent.name}>{entryToTitle(parent)}</a>
{' / '}
Expand Down Expand Up @@ -140,8 +144,8 @@ export function Layout(props) {
const href = d.github
? 'https://github.com/' + d.github
: d.twitter
? 'https://twitter.com/' + d.twitter
: d.url || undefined
? 'https://twitter.com/' + d.twitter
: d.url || undefined
return (
<span key={d.name}>
{i ? ', ' : ''}
Expand Down Expand Up @@ -187,15 +191,15 @@ export function Layout(props) {

return (
<div className="page doc">
<NavSiteSkip />
<NavigationSiteSkip />
<main>
<article>
{header ? (
<header className="content">
<div className="block head-article">{header}</div>
</header>
) : undefined}
<div className="content body">{props.children}</div>
<div className="content body">{properties.children}</div>
{footer || tail ? (
<footer className="content">
<div className="block foot-article">
Expand All @@ -207,7 +211,7 @@ export function Layout(props) {
</article>
<FootSite />
</main>
<NavSite name={name} navTree={navTree} />
<NavigationSite name={name} navigationTree={navigationTree} />
</div>
)

Expand Down
22 changes: 11 additions & 11 deletions docs/_component/nav-site.jsx
Expand Up @@ -3,11 +3,11 @@
*/

/**
* @typedef Props
* Props.
* @typedef Properties
* Properties.
* @property {string} name
* Name.
* @property {Readonly<Item>} navTree
* @property {Readonly<Item>} navigationTree
* Navigation tree.
*/

Expand All @@ -17,9 +17,9 @@ import {GitHub} from './icon/github.jsx'
import {Mdx} from './icon/mdx.jsx'
import {OpenCollective} from './icon/open-collective.jsx'
import {Twitter} from './icon/twitter.jsx'
import {NavGroup} from './nav.jsx'
import {NavigationGroup} from './nav.jsx'

export function NavSiteSkip() {
export function NavigationSiteSkip() {
return (
<a
href="#start-of-navigation"
Expand All @@ -32,13 +32,13 @@ export function NavSiteSkip() {
}

/**
* @param {Readonly<Props>} props
* Props.
* @param {Readonly<Properties>} properties
* Properties.
* @returns {JSX.Element}
* Element.
*/
export function NavSite(props) {
const {name, navTree} = props
export function NavigationSite(properties) {
const {name, navigationTree} = properties

return (
<nav className="navigation" aria-label="Site navigation">
Expand All @@ -57,9 +57,9 @@ export function NavSite(props) {
</h1>
</a>
</div>
<NavGroup
<NavigationGroup
className="navigation-secondary"
items={navTree.children}
items={navigationTree.children}
name={name}
/>
<ol className="navigation-tertiary">
Expand Down

0 comments on commit 0e6dd7a

Please sign in to comment.