From a882847548b7fc5d808b1ff4844eae745ff666f2 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Thu, 29 Dec 2022 09:47:53 +0800 Subject: [PATCH 01/36] Prepare v3 docs update --- package.json | 19 +- src/ui/components/DocParams/index.tsx | 2 +- src/ui/index.tsx | 6 +- src/ui/router/DocLinkContext.ts | 4 +- src/ui/router/docLink.ts | 4 +- src/ui/router/index.ts | 2 +- src/ui/screens/Docs/Doc/Content.tsx | 12 +- .../Docs/Doc/JSDoc/Arguments/index.tsx | 2 +- .../Docs/Doc/JSDoc/Exceptions/index.tsx | 4 +- .../Docs/Doc/JSDoc/Properties/index.tsx | 2 +- .../screens/Docs/Doc/JSDoc/Returns/index.tsx | 4 +- src/ui/screens/Docs/Doc/JSDoc/Usage/index.tsx | 2 +- src/ui/screens/Docs/Doc/JSDoc/index.tsx | 2 +- src/ui/screens/Docs/Doc/index.tsx | 19 +- src/ui/screens/Docs/Finder/Categories.tsx | 2 +- src/ui/screens/Docs/Finder/Items.tsx | 2 +- src/ui/screens/Docs/Finder/index.tsx | 15 +- src/ui/screens/Docs/Finder/utils.ts | 2 +- .../screens/Docs/NavBar/LatestVersionLink.tsx | 2 +- .../screens/Docs/NavBar/SubmoduleSelector.tsx | 8 +- .../screens/Docs/NavBar/VersionSelector.tsx | 2 +- src/ui/screens/Docs/NavBar/index.tsx | 8 +- src/ui/screens/Docs/index.tsx | 11 +- src/utils/useQuery/index.ts | 3 +- src/utils/versions/index.tsx | 2 +- yarn.lock | 1728 ++++++++++------- 26 files changed, 1073 insertions(+), 796 deletions(-) diff --git a/package.json b/package.json index 196ea99d..b2084529 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "start": "env NODE_ENV=development ts-node -r tsconfig-paths/register devServer.ts" }, "dependencies": { - "@date-fns/date-fns-db": "^0.0.14", + "@date-fns/docs": "0.4.0", "@nyancss/css-modules-loader": "^1.1.0", "@nyancss/react": "^1.3.0", "@sentry/browser": "^5.30.0", @@ -34,7 +34,7 @@ "@types/webpack-dev-middleware": "^4.1.0", "@types/webpack-hot-middleware": "^2.25.3", "@types/webpack-node-externals": "^2.5.0", - "@typesaurus/preact": "^4.0.0", + "@typesaurus/preact": "6.0.0-alpha.4", "assets-webpack-plugin": "^7.0.0", "body-parser": "^1.19.0", "copy-webpack-plugin": "^7.0.0", @@ -45,9 +45,9 @@ "enzyme-adapter-preact-pure": "^2.2.3", "express": "^4.17.1", "file-loader": "^6.1.0", - "firebase": "^8.2.2", - "firebase-admin": "^9.4.2", - "firebase-functions": "^3.13.0", + "firebase": "^9.15.0", + "firebase-admin": "^11.4.1", + "firebase-functions": "^4.1.1", "html-webpack-plugin": "^5.2.0", "husky": "^4.3.0", "isomorphic-fetch": "^2.2.1", @@ -65,13 +65,14 @@ "remarkable": "^2.0.1", "reset.css": "^2.0.2", "style-loader": "^1.2.1", - "ts-loader": "^8.0.3", - "ts-node": "^9.1.1", + "ts-loader": "^9.4.2", + "ts-node": "^10.9.1", "tsconfig-paths": "^3.9.0", "tsconfig-paths-webpack-plugin": "^3.3.0", "tslint": "~6.1.3", - "typesaurus": "^7.1.0", - "typescript": "^4.0.2", + "typeroo": "^0.9.0", + "typesaurus": "10.0.0-alpha.40", + "typescript": "^4.9.4", "webpack": "^5.24.2", "webpack-cli": "^4.1.0", "webpack-dev-middleware": "^4.1.0", diff --git a/src/ui/components/DocParams/index.tsx b/src/ui/components/DocParams/index.tsx index 01c7fbcb..74c41a2d 100644 --- a/src/ui/components/DocParams/index.tsx +++ b/src/ui/components/DocParams/index.tsx @@ -1,5 +1,5 @@ import { h, FunctionComponent, Fragment } from 'preact' -import { JSDocParam, JSDocType } from '@date-fns/date-fns-db' +import { JSDocParam, JSDocType } from '@date-fns/docs/db' import { Markdown } from '~/ui/components/Markdown' import { OptionalLabel, PropsLabel } from './style.css' diff --git a/src/ui/index.tsx b/src/ui/index.tsx index 87ff2945..caadd6cf 100644 --- a/src/ui/index.tsx +++ b/src/ui/index.tsx @@ -6,7 +6,7 @@ import { Docs } from '~/ui/screens/Docs' import { NotFound } from '~/ui/screens/NotFound' import 'reset.css/reset.css?global' import './global.css?global' -import { DEFAULT_SUBMODULE } from '@date-fns/date-fns-db' +import { defaultSubmodule } from '@date-fns/docs/db' const win = typeof window !== 'undefined' ? window : undefined @@ -24,7 +24,7 @@ export const UI = () => { case 'docs': return ( ) @@ -40,7 +40,7 @@ export const UI = () => { case 'versionDocs': return ( diff --git a/src/ui/router/DocLinkContext.ts b/src/ui/router/DocLinkContext.ts index 8d35b5bd..efc4bfbe 100644 --- a/src/ui/router/DocLinkContext.ts +++ b/src/ui/router/DocLinkContext.ts @@ -1,7 +1,7 @@ import { createContext } from 'preact' -import { DEFAULT_SUBMODULE } from '@date-fns/date-fns-db' +import { defaultSubmodule } from '@date-fns/docs/db' import { DocLinkParams } from '~/ui/router/docLink' export const DocLinkContext = createContext>({ - submodule: DEFAULT_SUBMODULE, + submodule: defaultSubmodule, }) diff --git a/src/ui/router/docLink.ts b/src/ui/router/docLink.ts index 8c0ea97a..460e73d1 100644 --- a/src/ui/router/docLink.ts +++ b/src/ui/router/docLink.ts @@ -1,4 +1,4 @@ -import { DEFAULT_SUBMODULE, Submodule } from '@date-fns/date-fns-db' +import { defaultSubmodule, Submodule } from '@date-fns/docs/db' import { AppRouteRef } from '~/ui/router' export interface DocLinkParams { @@ -11,7 +11,7 @@ export function docLink({ submodule, version, }: DocLinkParams): AppRouteRef { - if (!submodule || submodule === DEFAULT_SUBMODULE) { + if (!submodule || submodule === defaultSubmodule) { return version ? { name: 'versionDocs', diff --git a/src/ui/router/index.ts b/src/ui/router/index.ts index 5c124501..5bbba1dd 100644 --- a/src/ui/router/index.ts +++ b/src/ui/router/index.ts @@ -1,4 +1,4 @@ -import { Submodule } from '@date-fns/date-fns-db' +import { Submodule } from '@date-fns/docs/db' import { createRouter, InferRouteRef, route } from '@switcher/preact' export const appRoutes = [ diff --git a/src/ui/screens/Docs/Doc/Content.tsx b/src/ui/screens/Docs/Doc/Content.tsx index bf7f6d03..3b3aadbe 100644 --- a/src/ui/screens/Docs/Doc/Content.tsx +++ b/src/ui/screens/Docs/Doc/Content.tsx @@ -1,6 +1,6 @@ import { h, FunctionComponent } from 'preact' -import { Page } from '@date-fns/date-fns-db' -import { parse } from 'json-bond' +import { Page } from '@date-fns/docs/db' +import { parse } from 'typeroo/json' import { JSDoc } from './JSDoc' import { MarkdownDoc } from './MarkdownDoc' @@ -10,8 +10,16 @@ interface Props { export const Content: FunctionComponent = ({ page }) => { switch (page.type) { + case 'tsdoc': + return ( +
+          {JSON.stringify(page)}
+        
+ ) + case 'jsdoc': return + case 'markdown': return } diff --git a/src/ui/screens/Docs/Doc/JSDoc/Arguments/index.tsx b/src/ui/screens/Docs/Doc/JSDoc/Arguments/index.tsx index f4152961..b5151775 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/Arguments/index.tsx +++ b/src/ui/screens/Docs/Doc/JSDoc/Arguments/index.tsx @@ -1,5 +1,5 @@ import { h, FunctionComponent } from 'preact' -import { JSDocParam } from '@date-fns/date-fns-db' +import { JSDocParam } from '@date-fns/docs/db' import { DocParams } from '~/ui/components/DocParams' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' diff --git a/src/ui/screens/Docs/Doc/JSDoc/Exceptions/index.tsx b/src/ui/screens/Docs/Doc/JSDoc/Exceptions/index.tsx index 1bd64eeb..37c2df7c 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/Exceptions/index.tsx +++ b/src/ui/screens/Docs/Doc/JSDoc/Exceptions/index.tsx @@ -1,10 +1,10 @@ import { h, FunctionComponent } from 'preact' -import { JSDocTypedAttribute } from '@date-fns/date-fns-db' +import { JSDocAttribute } from '@date-fns/docs/db' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' import { Markdown } from '~/ui/components/Markdown' interface Props { - exceptions: JSDocTypedAttribute[] + exceptions: JSDocAttribute[] } export const Exceptions: FunctionComponent = ({ exceptions }) => ( diff --git a/src/ui/screens/Docs/Doc/JSDoc/Properties/index.tsx b/src/ui/screens/Docs/Doc/JSDoc/Properties/index.tsx index de65d105..c3dc4dd1 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/Properties/index.tsx +++ b/src/ui/screens/Docs/Doc/JSDoc/Properties/index.tsx @@ -1,5 +1,5 @@ import { h, FunctionComponent } from 'preact' -import { JSDocParam } from '@date-fns/date-fns-db' +import { JSDocParam } from '@date-fns/docs/db' import { DocParams } from '~/ui/components/DocParams' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' diff --git a/src/ui/screens/Docs/Doc/JSDoc/Returns/index.tsx b/src/ui/screens/Docs/Doc/JSDoc/Returns/index.tsx index 7b747327..571c757b 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/Returns/index.tsx +++ b/src/ui/screens/Docs/Doc/JSDoc/Returns/index.tsx @@ -1,10 +1,10 @@ import { h, FunctionComponent } from 'preact' -import { JSDocTypedAttribute } from '@date-fns/date-fns-db' +import { JSDocAttribute } from '@date-fns/docs/db' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' import { Markdown } from '~/ui/components/Markdown' interface Props { - returns: JSDocTypedAttribute[] + returns: JSDocAttribute[] } export const Returns: FunctionComponent = ({ returns }) => ( diff --git a/src/ui/screens/Docs/Doc/JSDoc/Usage/index.tsx b/src/ui/screens/Docs/Doc/JSDoc/Usage/index.tsx index e8806359..65782d54 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/Usage/index.tsx +++ b/src/ui/screens/Docs/Doc/JSDoc/Usage/index.tsx @@ -1,6 +1,6 @@ import { h, FunctionComponent } from 'preact' import { useEffect, useState } from 'preact/hooks' -import { JSDocUsage } from '@date-fns/date-fns-db' +import { JSDocUsage } from '@date-fns/docs/db' import { Options, Option, OptionLink } from './style.css' import { Content } from './Content' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' diff --git a/src/ui/screens/Docs/Doc/JSDoc/index.tsx b/src/ui/screens/Docs/Doc/JSDoc/index.tsx index 05f51eda..311ba78f 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/index.tsx +++ b/src/ui/screens/Docs/Doc/JSDoc/index.tsx @@ -1,4 +1,4 @@ -import { JSDocFunction } from '@date-fns/date-fns-db' +import { JSDocFunction } from '@date-fns/docs/db' import { FunctionComponent, h } from 'preact' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' import { Markdown } from '~/ui/components/Markdown' diff --git a/src/ui/screens/Docs/Doc/index.tsx b/src/ui/screens/Docs/Doc/index.tsx index 6c40e82f..340f59d8 100644 --- a/src/ui/screens/Docs/Doc/index.tsx +++ b/src/ui/screens/Docs/Doc/index.tsx @@ -1,11 +1,10 @@ import { h, FunctionComponent } from 'preact' -import { useQuery } from '~/utils/useQuery' -import { db, PACKAGE_NAME, Submodule } from '@date-fns/date-fns-db' -import { where } from 'typesaurus' import { Container } from './style.css' import { Content } from './Content' import { DocLinkContext } from '~/ui/router/DocLinkContext' import { useEffect } from 'preact/hooks' +import { useRead } from '@typesaurus/preact' +import { db, Submodule, packageName } from '@date-fns/docs/db' const SCROLL_OFFSET = 35 @@ -20,12 +19,14 @@ export const Doc: FunctionComponent = ({ selectedVersion, selectedSubmodule, }) => { - const [pages, { loading }] = useQuery(db.pages, [ - where('package', '==', PACKAGE_NAME), - where('version', '==', selectedVersion), - where('slug', '==', selectedPage), - where('submodules', 'array-contains', selectedSubmodule), - ]) + const [pages, { loading }] = useRead( + db.pages.query(($) => [ + $.field('package').equal(packageName), + $.field('version').equal(selectedVersion), + $.field('slug').equal(selectedPage), + $.field('submodules').contains(selectedSubmodule), + ]) + ) useEffect(() => { if (pages && location.hash) { diff --git a/src/ui/screens/Docs/Finder/Categories.tsx b/src/ui/screens/Docs/Finder/Categories.tsx index d2002a42..fcc79656 100644 --- a/src/ui/screens/Docs/Finder/Categories.tsx +++ b/src/ui/screens/Docs/Finder/Categories.tsx @@ -1,5 +1,5 @@ import { h, FunctionComponent } from 'preact' -import { PagePreview, Submodule } from '@date-fns/date-fns-db' +import { PagePreview, Submodule } from '@date-fns/docs/db' import { Items } from './Items' import { CategoriesList, Category, CategoryHeader } from './style.css' diff --git a/src/ui/screens/Docs/Finder/Items.tsx b/src/ui/screens/Docs/Finder/Items.tsx index b4dded1f..e995a4df 100644 --- a/src/ui/screens/Docs/Finder/Items.tsx +++ b/src/ui/screens/Docs/Finder/Items.tsx @@ -1,5 +1,5 @@ import { h, FunctionComponent, Fragment } from 'preact' -import { PagePreview, Submodule } from '@date-fns/date-fns-db' +import { PagePreview, Submodule } from '@date-fns/docs/db' import { RouterLink } from '~/ui/router' import { Item, ItemHeader, ItemText, ItemIcon } from './style.css' import { docLink } from '~/ui/router/docLink' diff --git a/src/ui/screens/Docs/Finder/index.tsx b/src/ui/screens/Docs/Finder/index.tsx index df822566..3bd0ea5a 100644 --- a/src/ui/screens/Docs/Finder/index.tsx +++ b/src/ui/screens/Docs/Finder/index.tsx @@ -8,9 +8,8 @@ import { NoResults } from './NoResults' import { Categories } from './Categories' import { Widget } from './Widget' import { filterPages } from './utils' -import { useQuery } from '~/utils/useQuery' -import { db, PACKAGE_NAME, Submodule } from '@date-fns/date-fns-db' -import { where } from 'typesaurus' +import { packageName, Submodule, db } from '@date-fns/docs/db' +import { useRead } from '@typesaurus/preact' type FIXME = any @@ -37,10 +36,12 @@ export const Finder: FunctionComponent = ({ [] ) - const [versions, { loading }] = useQuery(db.versions, [ - where('package', '==', PACKAGE_NAME), - where('version', '==', selectedVersion), - ]) + const [versions, { loading }] = useRead( + db.versions.query(($) => [ + $.field('package').equal(packageName), + $.field('version').equal(selectedVersion), + ]) + ) if (versions && versions.length >= 1) { const { pages, categories } = versions[0].data diff --git a/src/ui/screens/Docs/Finder/utils.ts b/src/ui/screens/Docs/Finder/utils.ts index d1d4070d..2212734e 100644 --- a/src/ui/screens/Docs/Finder/utils.ts +++ b/src/ui/screens/Docs/Finder/utils.ts @@ -1,4 +1,4 @@ -import { PagePreview, Submodule } from '@date-fns/date-fns-db' +import { PagePreview, Submodule } from '@date-fns/docs/db' export function filterPages( pages: PagePreview[], diff --git a/src/ui/screens/Docs/NavBar/LatestVersionLink.tsx b/src/ui/screens/Docs/NavBar/LatestVersionLink.tsx index e97987d3..872ddb08 100644 --- a/src/ui/screens/Docs/NavBar/LatestVersionLink.tsx +++ b/src/ui/screens/Docs/NavBar/LatestVersionLink.tsx @@ -1,4 +1,4 @@ -import { Submodule } from '@date-fns/date-fns-db' +import { Submodule } from '@date-fns/docs/db' import { h, FunctionComponent } from 'preact' import { RouterLink } from '~/ui/router' import { docLink } from '~/ui/router/docLink' diff --git a/src/ui/screens/Docs/NavBar/SubmoduleSelector.tsx b/src/ui/screens/Docs/NavBar/SubmoduleSelector.tsx index a27d8fb8..04348d9e 100644 --- a/src/ui/screens/Docs/NavBar/SubmoduleSelector.tsx +++ b/src/ui/screens/Docs/NavBar/SubmoduleSelector.tsx @@ -1,13 +1,13 @@ import { h, FunctionComponent } from 'preact' import { Label, Select, Selector } from './style.css' -import { Submodule } from '@date-fns/date-fns-db' +import { Submodule } from '@date-fns/docs/db' import { docLink } from '~/ui/router/docLink' import { useContext } from 'preact/hooks' import { RouterContext } from '~/ui/router' -const SUBMODULE_LABELS: { [k in Submodule]: string } = { - [Submodule.Default]: 'Default', - [Submodule.FP]: 'FP', +const SUBMODULE_LABELS: Record = { + default: 'Default', + fp: 'FP', } interface Props { diff --git a/src/ui/screens/Docs/NavBar/VersionSelector.tsx b/src/ui/screens/Docs/NavBar/VersionSelector.tsx index abc6581e..39add02a 100644 --- a/src/ui/screens/Docs/NavBar/VersionSelector.tsx +++ b/src/ui/screens/Docs/NavBar/VersionSelector.tsx @@ -1,5 +1,5 @@ import { h, FunctionComponent } from 'preact' -import { Submodule, VersionPreview } from '@date-fns/date-fns-db' +import { Submodule, VersionPreview } from '@date-fns/docs/db' import { Selector, Label, Select } from './style.css' import { useContext } from 'preact/hooks' import { RouterContext } from '~/ui/router' diff --git a/src/ui/screens/Docs/NavBar/index.tsx b/src/ui/screens/Docs/NavBar/index.tsx index 662d2cfc..3d01038b 100644 --- a/src/ui/screens/Docs/NavBar/index.tsx +++ b/src/ui/screens/Docs/NavBar/index.tsx @@ -10,11 +10,7 @@ import { MenuIcon, } from './style.css' import logoPath from './img/logo.svg' -import { - DEFAULT_SUBMODULE, - Submodule, - VersionPreview, -} from '@date-fns/date-fns-db' +import { defaultSubmodule, Submodule, VersionPreview } from '@date-fns/docs/db' import { VersionSelector } from './VersionSelector' import { SubmoduleSelector } from './SubmoduleSelector' @@ -38,7 +34,7 @@ export const NavBar: FunctionComponent = ({ const versionPreview = versions.find( ({ version }) => version === selectedVersion ) - const submodules = versionPreview?.submodules ?? [DEFAULT_SUBMODULE] + const submodules = versionPreview?.submodules ?? [defaultSubmodule] return ( diff --git a/src/ui/screens/Docs/index.tsx b/src/ui/screens/Docs/index.tsx index 0b1aff5b..f03a8298 100644 --- a/src/ui/screens/Docs/index.tsx +++ b/src/ui/screens/Docs/index.tsx @@ -10,9 +10,6 @@ import { FinderContainer, NavBarContainer, } from './style.css' -import { useQuery } from '~/utils/useQuery' -import { where } from 'typesaurus' -import { db, PACKAGE_NAME, Submodule } from '@date-fns/date-fns-db' import { filterPreReleaseVersions, getLatestVersion, @@ -23,6 +20,8 @@ import { useContext, useEffect, useState } from 'preact/hooks' import { RouterContext } from '~/ui/router' import { docLink } from '~/ui/router/docLink' import { DEFAULT_PAGE } from '~/constants' +import { useRead } from '@typesaurus/preact' +import { Submodule, db, packageName } from '@date-fns/docs/db' interface Props { selectedSubmodule: Submodule @@ -49,9 +48,9 @@ export const Docs: FunctionComponent = ({ } }) - const [packages, { loading }] = useQuery(db.packages, [ - where('name', '==', PACKAGE_NAME), - ]) + const [packages, { loading }] = useRead( + db.packages.query(($) => $.field('name').equal(packageName)) + ) const [menuOpen, setMenuOpen] = useState(false) diff --git a/src/utils/useQuery/index.ts b/src/utils/useQuery/index.ts index 67876bac..7242b934 100644 --- a/src/utils/useQuery/index.ts +++ b/src/utils/useQuery/index.ts @@ -1,3 +1,4 @@ +/* TODO: Recover this? import { useQuery as useFirestoreQuery } from '@typesaurus/preact' import { TypesaurusHookResult } from '@typesaurus/preact/types' import { useEffect } from 'preact/hooks' @@ -20,4 +21,4 @@ export function useQuery( }, [result[1].error]) return result -} +}*/ diff --git a/src/utils/versions/index.tsx b/src/utils/versions/index.tsx index 67a34f27..6c41efe1 100644 --- a/src/utils/versions/index.tsx +++ b/src/utils/versions/index.tsx @@ -1,4 +1,4 @@ -import { VersionPreview } from '@date-fns/date-fns-db' +import { VersionPreview } from '@date-fns/docs/db' export function filterPreReleaseVersions( versions: VersionPreview[], diff --git a/yarn.lock b/yarn.lock index b67f6204..203ff48d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -33,282 +33,500 @@ js-tokens "^4.0.0" "@babel/parser@^7.9.4": - version "7.19.1" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.19.1.tgz" - integrity sha512-h7RCSorm1DdTVGJf3P2Mhj3kdnkmF/EiysUkzS2TdgAYqyjFdMQJbVuXOBej2SBJaXan/lIVtT6KkGbyyq753A== + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.7.tgz#66fe23b3c8569220817d5feb8b9dcdc95bb4f71b" + integrity sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg== "@colors/colors@1.5.0": version "1.5.0" resolved "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz" integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== -"@date-fns/date-fns-db@^0.0.14": - version "0.0.14" - resolved "https://registry.npmjs.org/@date-fns/date-fns-db/-/date-fns-db-0.0.14.tgz" - integrity sha512-4Cg+IDM2XRl+cPN08i7c4ohb7wlF1FDxvf4e6GjQtX5dn9yZLAhVCvdu72lD8C71SjyO7DLY7KC9cEtSrRMx4g== +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + +"@date-fns/docs@0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@date-fns/docs/-/docs-0.4.0.tgz#9c31b70ce52b198948dc9a8cb89c76967c0fdd2e" + integrity sha512-U5fkCFDTnqtOsiKWIusJTRPSma+jPwnLPSGjOdPopkOX1yOWSfLG4ys7L6yYwZ1hO7rTybRu9GfYuGR+kR3Umg== + dependencies: + firebase-admin "^11.4.1" + js-fns "^2.5.2" + typedoc "^0.23.23" + typeroo "^0.9.0" + typesaurus "^10.0.0-alpha.40" "@discoveryjs/json-ext@^0.5.0": version "0.5.2" resolved "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz" integrity sha512-HyYEUDeIj5rRQU2Hk5HTB2uHsbRQpF70nvMhVzi+VJR0X+xNEhjPui4/kBf3VeH/wqD28PT4sVOm8qqLjBrSZg== -"@firebase/analytics-types@0.4.0": - version "0.4.0" - resolved "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.4.0.tgz" - integrity sha512-Jj2xW+8+8XPfWGkv9HPv/uR+Qrmq37NPYT352wf7MvE9LrstpLVmFg3LqG6MCRr5miLAom5sen2gZ+iOhVDeRA== +"@fastify/busboy@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-1.1.0.tgz#4472f856e2bb5a9ee34ad64b93891b73b73537ca" + integrity sha512-Fv854f94v0CzIDllbY3i/0NJPNBRNLDawf3BTYVGCe9VrIIs3Wi7AFx24F9NzCxdf0wyx/x0Q9kEVnvDOPnlxA== + dependencies: + text-decoding "^1.0.0" -"@firebase/analytics@0.6.2": - version "0.6.2" - resolved "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.6.2.tgz" - integrity sha512-4Ceov+rPfOEPIdbjlpTim/wbcUUneIesHag4UOzvmFsRRXqbxLwQpyZQWEbTSriUeU8uTKj9yOW32hsskV9Klg== +"@firebase/analytics-compat@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@firebase/analytics-compat/-/analytics-compat-0.2.0.tgz#c9e70d50bc07ba1865c589ee34f7106661c5105b" + integrity sha512-brk8IN4ErWiZoB/UdJ0mWZhQOKt90ztv4MUwQjhuYJ4iwnVMz0Mzj9+tplU1hVpSZXdfbKQFfRN9kp/3sTiyWw== dependencies: - "@firebase/analytics-types" "0.4.0" - "@firebase/component" "0.1.21" - "@firebase/installations" "0.4.19" - "@firebase/logger" "0.2.6" - "@firebase/util" "0.3.4" - tslib "^1.11.1" + "@firebase/analytics" "0.9.0" + "@firebase/analytics-types" "0.8.0" + "@firebase/component" "0.6.0" + "@firebase/util" "1.8.0" + tslib "^2.1.0" -"@firebase/app-types@0.6.1": - version "0.6.1" - resolved "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.6.1.tgz" - integrity sha512-L/ZnJRAq7F++utfuoTKX4CLBG5YR7tFO3PLzG1/oXXKEezJ0kRL3CMRoueBEmTCzVb/6SIs2Qlaw++uDgi5Xyg== +"@firebase/analytics-types@0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@firebase/analytics-types/-/analytics-types-0.8.0.tgz#551e744a29adbc07f557306530a2ec86add6d410" + integrity sha512-iRP+QKI2+oz3UAh4nPEq14CsEjrjD6a5+fuypjScisAh9kXKFvdJOZJDwk7kikLvWVLGEs9+kIUS4LPQV7VZVw== -"@firebase/app@0.6.13": - version "0.6.13" - resolved "https://registry.npmjs.org/@firebase/app/-/app-0.6.13.tgz" - integrity sha512-xGrJETzvCb89VYbGSHFHCW7O/y067HRxT7MGehUE1xMxdPVBDNayHnxEuKwzfGvXAjVmajXBKFlKxaCWpgSjCQ== - dependencies: - "@firebase/app-types" "0.6.1" - "@firebase/component" "0.1.21" - "@firebase/logger" "0.2.6" - "@firebase/util" "0.3.4" - dom-storage "2.1.0" - tslib "^1.11.1" - xmlhttprequest "1.8.0" - -"@firebase/auth-interop-types@0.1.5": - version "0.1.5" - resolved "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.1.5.tgz" - integrity sha512-88h74TMQ6wXChPA6h9Q3E1Jg6TkTHep2+k63OWg3s0ozyGVMeY+TTOti7PFPzq5RhszQPQOoCi59es4MaRvgCw== - -"@firebase/auth-types@0.10.1": - version "0.10.1" - resolved "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.10.1.tgz" - integrity sha512-/+gBHb1O9x/YlG7inXfxff/6X3BPZt4zgBv4kql6HEmdzNQCodIRlEYnI+/da+lN+dha7PjaFH7C7ewMmfV7rw== - -"@firebase/auth@0.16.1": - version "0.16.1" - resolved "https://registry.npmjs.org/@firebase/auth/-/auth-0.16.1.tgz" - integrity sha512-7juD7D/kaxNti/xa5G+ZGJJs+bdJUWOW0MlNBtXwiG+TjMh69EDmwJnQmmc9h/32QVvXt1qo1OGWOoMMpF/2Gg== - dependencies: - "@firebase/auth-types" "0.10.1" - -"@firebase/component@0.1.21": - version "0.1.21" - resolved "https://registry.npmjs.org/@firebase/component/-/component-0.1.21.tgz" - integrity sha512-kd5sVmCLB95EK81Pj+yDTea8pzN2qo/1yr0ua9yVi6UgMzm6zAeih73iVUkaat96MAHy26yosMufkvd3zC4IKg== - dependencies: - "@firebase/util" "0.3.4" - tslib "^1.11.1" - -"@firebase/database-types@0.6.1", "@firebase/database-types@^0.6.1": - version "0.6.1" - resolved "https://registry.npmjs.org/@firebase/database-types/-/database-types-0.6.1.tgz" - integrity sha512-JtL3FUbWG+bM59iYuphfx9WOu2Mzf0OZNaqWiQ7lJR8wBe7bS9rIm9jlBFtksB7xcya1lZSQPA/GAy2jIlMIkA== +"@firebase/analytics@0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@firebase/analytics/-/analytics-0.9.0.tgz#05baa16abd1283d02debc40150253fe93d106bf0" + integrity sha512-cE6JAvaGDVhn3B09VuQ5pATLCtmQg3AUSDuCmMNzWlP7+12LBarV1JcGWKIi7YQK2ks3B73wRsawi08XKwsolQ== dependencies: - "@firebase/app-types" "0.6.1" + "@firebase/component" "0.6.0" + "@firebase/installations" "0.6.0" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.8.0" + tslib "^2.1.0" + +"@firebase/app-check-compat@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@firebase/app-check-compat/-/app-check-compat-0.3.0.tgz#e050c84fe9046e9aa5bfad32d8407e18c97a4b58" + integrity sha512-CJFHWGMvWRkkvLPTvWdLrEYnfH7WS9zFLsWctSzRjQnzg6dQUTs5FDyg9RN7BIWoaSr9q7FTxkRnsOgardDPLA== + dependencies: + "@firebase/app-check" "0.6.0" + "@firebase/app-check-types" "0.5.0" + "@firebase/component" "0.6.0" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.8.0" + tslib "^2.1.0" + +"@firebase/app-check-interop-types@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@firebase/app-check-interop-types/-/app-check-interop-types-0.2.0.tgz#9106270114ca4e7732457e8319333866a26285d8" + integrity sha512-+3PQIeX6/eiVK+x/yg8r6xTNR97fN7MahFDm+jiQmDjcyvSefoGuTTNQuuMScGyx3vYUBeZn+Cp9kC0yY/9uxQ== -"@firebase/database@0.8.2", "@firebase/database@^0.8.1": - version "0.8.2" - resolved "https://registry.npmjs.org/@firebase/database/-/database-0.8.2.tgz" - integrity sha512-E86yrom0Ii+61UScG44y1q3H3NuozzGGTGbYmiyTe1qK8Qvzuiu7yyfdDnqFW2fkeKvTRLoDeCpgZy27FgEndQ== +"@firebase/app-check-types@0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@firebase/app-check-types/-/app-check-types-0.5.0.tgz#1b02826213d7ce6a1cf773c329b46ea1c67064f4" + integrity sha512-uwSUj32Mlubybw7tedRzR24RP8M8JUVR3NPiMk3/Z4bCmgEKTlQBwMXrehDAZ2wF+TsBq0SN1c6ema71U/JPyQ== + +"@firebase/app-check@0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@firebase/app-check/-/app-check-0.6.0.tgz#86874d48430f1bc04b92426bc99052f6f03eadc4" + integrity sha512-DevuiUQujsG18NQ1fQ1g2X+75Vp1YfSxPsw363/HE2+ABmCWHf4ByPmxEf16y4PVcqJ2MZqYv8kXZYxzRJCS4g== dependencies: - "@firebase/auth-interop-types" "0.1.5" - "@firebase/component" "0.1.21" - "@firebase/database-types" "0.6.1" - "@firebase/logger" "0.2.6" - "@firebase/util" "0.3.4" - faye-websocket "0.11.3" - tslib "^1.11.1" + "@firebase/component" "0.6.0" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.8.0" + tslib "^2.1.0" -"@firebase/firestore-types@2.1.0": - version "2.1.0" - resolved "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-2.1.0.tgz" - integrity sha512-jietErBWihMvJkqqEquQy5GgoEwzHnMXXC/TsVoe9FPysXm1/AeJS12taS7ZYvenAtyvL/AEJyKrRKRh4adcJQ== +"@firebase/app-compat@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@firebase/app-compat/-/app-compat-0.2.0.tgz#ffd401324d0a0974911b55e7843edc020b7a65a5" + integrity sha512-Y8Cpuheai61jCdVflt437I94n8cdRbXY0e1dQMmTWHCShJUfWwpa5y2ZMnxClWnorXy9hC/3yNZMVlu79f1zGA== + dependencies: + "@firebase/app" "0.9.0" + "@firebase/component" "0.6.0" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.8.0" + tslib "^2.1.0" -"@firebase/firestore@2.1.2": - version "2.1.2" - resolved "https://registry.npmjs.org/@firebase/firestore/-/firestore-2.1.2.tgz" - integrity sha512-8yUdBLLr6UhE+IjPR+fxLBD0bDnEqF9GalohfURZeLQPaL3b+LtqqGCLvvXC4MKT0lJAHOV8J9LA6rHj8vI0/Q== - dependencies: - "@firebase/component" "0.1.21" - "@firebase/firestore-types" "2.1.0" - "@firebase/logger" "0.2.6" - "@firebase/util" "0.3.4" - "@firebase/webchannel-wrapper" "0.4.1" - "@grpc/grpc-js" "^1.0.0" - "@grpc/proto-loader" "^0.5.0" - node-fetch "2.6.1" - tslib "^1.11.1" - -"@firebase/functions-types@0.4.0": - version "0.4.0" - resolved "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.4.0.tgz" - integrity sha512-3KElyO3887HNxtxNF1ytGFrNmqD+hheqjwmT3sI09FaDCuaxGbOnsXAXH2eQ049XRXw9YQpHMgYws/aUNgXVyQ== +"@firebase/app-types@0.8.1": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@firebase/app-types/-/app-types-0.8.1.tgz#4c7f916281aed570581fc667e3eb6cc730119a95" + integrity sha512-p75Ow3QhB82kpMzmOntv866wH9eZ3b4+QbUY+8/DA5Zzdf1c8Nsk8B7kbFpzJt4wwHMdy5LTF5YUnoTc1JiWkw== -"@firebase/functions@0.6.1": - version "0.6.1" - resolved "https://registry.npmjs.org/@firebase/functions/-/functions-0.6.1.tgz" - integrity sha512-xNCAY3cLlVWE8Azf+/84OjnaXMoyUstJ3vwVRG0ie22QhsdQuPa1tXTiPX4Tmm+Hbbd/Aw0A/7dkEnuW+zYzaQ== +"@firebase/app-types@0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@firebase/app-types/-/app-types-0.9.0.tgz#35b5c568341e9e263b29b3d2ba0e9cfc9ec7f01e" + integrity sha512-AeweANOIo0Mb8GiYm3xhTEBVCmPwTYAu9Hcd2qSkLuga/6+j9b1Jskl5bpiSQWy9eJ/j5pavxj6eYogmnuzm+Q== + +"@firebase/app@0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@firebase/app/-/app-0.9.0.tgz#0eaf7e837e8c6f97a384b5f6589a23961184c34c" + integrity sha512-sa15stSK6FoGW4mCeAVDt0TvBFxPjvNcG2rhacGudOzMaW3g2TS326zXTFG+p5jnTCPZ2SO5TTSiGHn1NNcD9Q== dependencies: - "@firebase/component" "0.1.21" - "@firebase/functions-types" "0.4.0" - "@firebase/messaging-types" "0.5.0" - node-fetch "2.6.1" - tslib "^1.11.1" + "@firebase/component" "0.6.0" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.8.0" + idb "7.0.1" + tslib "^2.1.0" -"@firebase/installations-types@0.3.4": - version "0.3.4" - resolved "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.3.4.tgz" - integrity sha512-RfePJFovmdIXb6rYwtngyxuEcWnOrzdZd9m7xAW0gRxDIjBT20n3BOhjpmgRWXo/DAxRmS7bRjWAyTHY9cqN7Q== - -"@firebase/installations@0.4.19": - version "0.4.19" - resolved "https://registry.npmjs.org/@firebase/installations/-/installations-0.4.19.tgz" - integrity sha512-QqAQzosKVVqIx7oMt5ujF4NsIXgtlTnej4JXGJ8sQQuJoMnt3T+PFQRHbr7uOfVaBiHYhEaXCcmmhfKUHwKftw== - dependencies: - "@firebase/component" "0.1.21" - "@firebase/installations-types" "0.3.4" - "@firebase/util" "0.3.4" - idb "3.0.2" - tslib "^1.11.1" - -"@firebase/logger@0.2.6": - version "0.2.6" - resolved "https://registry.npmjs.org/@firebase/logger/-/logger-0.2.6.tgz" - integrity sha512-KIxcUvW/cRGWlzK9Vd2KB864HlUnCfdTH0taHE0sXW5Xl7+W68suaeau1oKNEqmc3l45azkd4NzXTCWZRZdXrw== - -"@firebase/messaging-types@0.5.0": +"@firebase/auth-compat@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@firebase/auth-compat/-/auth-compat-0.3.0.tgz#a1e753147e3bd99e0ddbaa76a7c4ec317edf2f0d" + integrity sha512-tcofcrQKBOo5Wrz59onWtZDJfVW09auvG/XRh7lZ4yfEWdGerTJXmEdQU6j3E8AnJ3X91BYltNYhh0ZJOoCJqQ== + dependencies: + "@firebase/auth" "0.21.0" + "@firebase/auth-types" "0.12.0" + "@firebase/component" "0.6.0" + "@firebase/util" "1.8.0" + node-fetch "2.6.7" + tslib "^2.1.0" + +"@firebase/auth-interop-types@0.1.7": + version "0.1.7" + resolved "https://registry.yarnpkg.com/@firebase/auth-interop-types/-/auth-interop-types-0.1.7.tgz#82c8d431779916224d2af5cef6cec2042d830f28" + integrity sha512-yA/dTveGGPcc85JP8ZE/KZqfGQyQTBCV10THdI8HTlP1GDvNrhr//J5jAt58MlsCOaO3XmC4DqScPBbtIsR/EA== + +"@firebase/auth-interop-types@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@firebase/auth-interop-types/-/auth-interop-types-0.2.0.tgz#1119eda760239a839e4c8d04e88fa90082546760" + integrity sha512-7Mt2qzwvu5X3Qxz24gjj0qITrBsMmy1W4vGBP8TZRuQrjA4OTlGVCTG8ysvweZ3xpdl1XGhBsIjo2KjfOPg0xA== + +"@firebase/auth-types@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@firebase/auth-types/-/auth-types-0.12.0.tgz#f28e1b68ac3b208ad02a15854c585be6da3e8e79" + integrity sha512-pPwaZt+SPOshK8xNoiQlK5XIrS97kFYc3Rc7xmy373QsOJ9MmqXxLaYssP5Kcds4wd2qK//amx/c+A8O2fVeZA== + +"@firebase/auth@0.21.0": + version "0.21.0" + resolved "https://registry.yarnpkg.com/@firebase/auth/-/auth-0.21.0.tgz#058ee82bbea55c41ec4f92465e98e8013055eb2c" + integrity sha512-kXOQl/hyLuGKxs0r2icLsDmAyeO0uM4zV9Q+fx6VE8Ncl94TBUc/n895GSrF3RkNHdiq/DZxV/PUCZ/ozPQNKw== + dependencies: + "@firebase/component" "0.6.0" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.8.0" + node-fetch "2.6.7" + tslib "^2.1.0" + +"@firebase/component@0.5.21": + version "0.5.21" + resolved "https://registry.yarnpkg.com/@firebase/component/-/component-0.5.21.tgz#bb10add24fe2ee59a61163a469d4711d8da4002d" + integrity sha512-12MMQ/ulfygKpEJpseYMR0HunJdlsLrwx2XcEs40M18jocy2+spyzHHEwegN3x/2/BLFBjR5247Etmz0G97Qpg== + dependencies: + "@firebase/util" "1.7.3" + tslib "^2.1.0" + +"@firebase/component@0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@firebase/component/-/component-0.6.0.tgz#8149a412cf5ef7336f91ad409e72a8e55cf721ef" + integrity sha512-9hyNc4OmrXMtthDJq6zyJHll/UIYBWYmMG3rXty2eMeWxHWB0vlsq3AOI+k14PL15aSBAQolv0EZJWVJv/gCEg== + dependencies: + "@firebase/util" "1.8.0" + tslib "^2.1.0" + +"@firebase/database-compat@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@firebase/database-compat/-/database-compat-0.3.0.tgz#229a2d584895dbfaf80025595f604247e2e72155" + integrity sha512-5kzhXdACd+RX/G8k/DKYAuiMYHDHIZ9WFV/ccVoPsC+bxIQEgPilDEtkljY5ZxiKbUj+PEOSYUfYdV/LQMJatQ== + dependencies: + "@firebase/component" "0.6.0" + "@firebase/database" "0.14.0" + "@firebase/database-types" "0.10.0" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.8.0" + tslib "^2.1.0" + +"@firebase/database-compat@^0.2.6": + version "0.2.10" + resolved "https://registry.yarnpkg.com/@firebase/database-compat/-/database-compat-0.2.10.tgz#fa4440db9f41a9a05112642504c1e6557a75b8be" + integrity sha512-fK+IgUUqVKcWK/gltzDU+B1xauCOfY6vulO8lxoNTkcCGlSxuTtwsdqjGkFmgFRMYjXFWWJ6iFcJ/vXahzwCtA== + dependencies: + "@firebase/component" "0.5.21" + "@firebase/database" "0.13.10" + "@firebase/database-types" "0.9.17" + "@firebase/logger" "0.3.4" + "@firebase/util" "1.7.3" + tslib "^2.1.0" + +"@firebase/database-types@0.10.0": + version "0.10.0" + resolved "https://registry.yarnpkg.com/@firebase/database-types/-/database-types-0.10.0.tgz#ee982a3ac92c69ca0129efd309611646ceb25162" + integrity sha512-jZHI1fY1tm+8heLR4sbgJHtSYI2kTlSp4QTXWALwdT+dfST5OlZYsZeb+hGWeqjHEElzUnkLbw8XuZSy9Uy6rA== + dependencies: + "@firebase/app-types" "0.9.0" + "@firebase/util" "1.8.0" + +"@firebase/database-types@0.9.17", "@firebase/database-types@^0.9.13": + version "0.9.17" + resolved "https://registry.yarnpkg.com/@firebase/database-types/-/database-types-0.9.17.tgz#4c248052b0a9ae052ba940e4996a0bfab25dc257" + integrity sha512-YQm2tCZyxNtEnlS5qo5gd2PAYgKCy69tUKwioGhApCFThW+mIgZs7IeYeJo2M51i4LCixYUl+CvnOyAnb/c3XA== + dependencies: + "@firebase/app-types" "0.8.1" + "@firebase/util" "1.7.3" + +"@firebase/database@0.13.10": + version "0.13.10" + resolved "https://registry.yarnpkg.com/@firebase/database/-/database-0.13.10.tgz#c24e0219490b9c1fabfb7b42cb45850e145fe56d" + integrity sha512-KRucuzZ7ZHQsRdGEmhxId5jyM2yKsjsQWF9yv0dIhlxYg0D8rCVDZc/waoPKA5oV3/SEIoptF8F7R1Vfe7BCQA== + dependencies: + "@firebase/auth-interop-types" "0.1.7" + "@firebase/component" "0.5.21" + "@firebase/logger" "0.3.4" + "@firebase/util" "1.7.3" + faye-websocket "0.11.4" + tslib "^2.1.0" + +"@firebase/database@0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@firebase/database/-/database-0.14.0.tgz#3cb93dae38ccd6b43d467c666769998b84cb8e92" + integrity sha512-SM5eri3eGuPjQdXBRObqKTsgmkRwrSGsbgtD43EpGzU+lIeBVLqwRzfcFialYrWzFFI5V7hWXdS2oJxAkfnBFw== + dependencies: + "@firebase/auth-interop-types" "0.2.0" + "@firebase/component" "0.6.0" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.8.0" + faye-websocket "0.11.4" + tslib "^2.1.0" + +"@firebase/firestore-compat@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@firebase/firestore-compat/-/firestore-compat-0.3.0.tgz#277b6c4ad6aa6a04b7c2a6911b8878c101493302" + integrity sha512-ckU4mkziDnsFKxgYv+OAJHPuNpti2RjyoeIAqz3EqRHAsYFC70U5w4aXC2Sbu2jJp3Ba2BoD7MV/4Qb2A7CJtw== + dependencies: + "@firebase/component" "0.6.0" + "@firebase/firestore" "3.8.0" + "@firebase/firestore-types" "2.5.1" + "@firebase/util" "1.8.0" + tslib "^2.1.0" + +"@firebase/firestore-types@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@firebase/firestore-types/-/firestore-types-2.5.1.tgz#464b2ee057956599ca34de50eae957c30fdbabb7" + integrity sha512-xG0CA6EMfYo8YeUxC8FeDzf6W3FX1cLlcAGBYV6Cku12sZRI81oWcu61RSKM66K6kUENP+78Qm8mvroBcm1whw== + +"@firebase/firestore@3.8.0": + version "3.8.0" + resolved "https://registry.yarnpkg.com/@firebase/firestore/-/firestore-3.8.0.tgz#4d955a11c2205dd84a9d34ae75506d829593bb00" + integrity sha512-aKwfZ73FmOV8e/dN0anDtrq6+1IhX4zmjxUcXcgaypZ14q6bq0QpUdlRxjsfiUQ5m3H3MwWWIFOcT5Xa89sIkw== + dependencies: + "@firebase/component" "0.6.0" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.8.0" + "@firebase/webchannel-wrapper" "0.9.0" + "@grpc/grpc-js" "~1.7.0" + "@grpc/proto-loader" "^0.6.13" + node-fetch "2.6.7" + tslib "^2.1.0" + +"@firebase/functions-compat@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@firebase/functions-compat/-/functions-compat-0.3.0.tgz#7e426d65209664502baf724757d498a1f12dd27f" + integrity sha512-xOEdqOVeHXJ2ZjDbTntNGLl1lgW9umx73bWXJn9h68bSD4f9ldIVoz+h15s8i/e1pJOO/LlEp2BMvoA35U1P/Q== + dependencies: + "@firebase/component" "0.6.0" + "@firebase/functions" "0.9.0" + "@firebase/functions-types" "0.6.0" + "@firebase/util" "1.8.0" + tslib "^2.1.0" + +"@firebase/functions-types@0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@firebase/functions-types/-/functions-types-0.6.0.tgz#ccd7000dc6fc668f5acb4e6a6a042a877a555ef2" + integrity sha512-hfEw5VJtgWXIRf92ImLkgENqpL6IWpYaXVYiRkFY1jJ9+6tIhWM7IzzwbevwIIud/jaxKVdRzD7QBWfPmkwCYw== + +"@firebase/functions@0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@firebase/functions/-/functions-0.9.0.tgz#8282d9b191026caf543366d55c0b2f7ae1e33f53" + integrity sha512-na/+7uc9ViQVBadEsCVjBnbZsfUCMyS/x6SID1Nz4Z5nkhuxrls9Jcv7jc28tMqHR0VpoGq8W6oLProyjT8JPg== + dependencies: + "@firebase/app-check-interop-types" "0.2.0" + "@firebase/auth-interop-types" "0.2.0" + "@firebase/component" "0.6.0" + "@firebase/messaging-interop-types" "0.2.0" + "@firebase/util" "1.8.0" + node-fetch "2.6.7" + tslib "^2.1.0" + +"@firebase/installations-compat@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@firebase/installations-compat/-/installations-compat-0.2.0.tgz#32f3fc662d65bc8f90dfca0c54e69206d0b23512" + integrity sha512-EqCU8C9XPQN6npfTCW+6agzQ0yPLvbSCY5WROdnU1ZJfOsGFrMMVMRk42XBzah1dHBoSQYggVaixEzJUOH7zbQ== + dependencies: + "@firebase/component" "0.6.0" + "@firebase/installations" "0.6.0" + "@firebase/installations-types" "0.5.0" + "@firebase/util" "1.8.0" + tslib "^2.1.0" + +"@firebase/installations-types@0.5.0": version "0.5.0" - resolved "https://registry.npmjs.org/@firebase/messaging-types/-/messaging-types-0.5.0.tgz" - integrity sha512-QaaBswrU6umJYb/ZYvjR5JDSslCGOH6D9P136PhabFAHLTR4TWjsaACvbBXuvwrfCXu10DtcjMxqfhdNIB1Xfg== + resolved "https://registry.yarnpkg.com/@firebase/installations-types/-/installations-types-0.5.0.tgz#2adad64755cd33648519b573ec7ec30f21fb5354" + integrity sha512-9DP+RGfzoI2jH7gY4SlzqvZ+hr7gYzPODrbzVD82Y12kScZ6ZpRg/i3j6rleto8vTFC8n6Len4560FnV1w2IRg== -"@firebase/messaging@0.7.3": - version "0.7.3" - resolved "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.7.3.tgz" - integrity sha512-63nOP2SmQJrj9jrhV3K96L5MRKS6AqmFVLX1XbGk6K6lz38ZC4LIoCcHxzUBXY7fCAuZvNmh/YB3pE8B2mTs8A== - dependencies: - "@firebase/component" "0.1.21" - "@firebase/installations" "0.4.19" - "@firebase/messaging-types" "0.5.0" - "@firebase/util" "0.3.4" - idb "3.0.2" - tslib "^1.11.1" - -"@firebase/performance-types@0.0.13": - version "0.0.13" - resolved "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.0.13.tgz" - integrity sha512-6fZfIGjQpwo9S5OzMpPyqgYAUZcFzZxHFqOyNtorDIgNXq33nlldTL/vtaUZA8iT9TT5cJlCrF/jthKU7X21EA== - -"@firebase/performance@0.4.5": - version "0.4.5" - resolved "https://registry.npmjs.org/@firebase/performance/-/performance-0.4.5.tgz" - integrity sha512-oenEOaV/UzvV8XPi8afYQ71RzyrHoBesqOyXqb1TOg7dpU+i+UJ5PS8K64DytKUHTxQl+UJFcuxNpsoy9BpWzw== - dependencies: - "@firebase/component" "0.1.21" - "@firebase/installations" "0.4.19" - "@firebase/logger" "0.2.6" - "@firebase/performance-types" "0.0.13" - "@firebase/util" "0.3.4" - tslib "^1.11.1" - -"@firebase/polyfill@0.3.36": - version "0.3.36" - resolved "https://registry.npmjs.org/@firebase/polyfill/-/polyfill-0.3.36.tgz" - integrity sha512-zMM9oSJgY6cT2jx3Ce9LYqb0eIpDE52meIzd/oe/y70F+v9u1LDqk5kUF5mf16zovGBWMNFmgzlsh6Wj0OsFtg== - dependencies: - core-js "3.6.5" - promise-polyfill "8.1.3" - whatwg-fetch "2.0.4" - -"@firebase/remote-config-types@0.1.9": - version "0.1.9" - resolved "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.1.9.tgz" - integrity sha512-G96qnF3RYGbZsTRut7NBX0sxyczxt1uyCgXQuH/eAfUCngxjEGcZQnBdy6mvSdqdJh5mC31rWPO4v9/s7HwtzA== - -"@firebase/remote-config@0.1.30": - version "0.1.30" - resolved "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.1.30.tgz" - integrity sha512-LAfLDcp1AN0V/7AkxBuTKy+Qnq9fKYKxbA5clrXRNVzJbTVnF5eFGsaUOlkes0ESG6lbqKy5ZcDgdl73zBIhAA== - dependencies: - "@firebase/component" "0.1.21" - "@firebase/installations" "0.4.19" - "@firebase/logger" "0.2.6" - "@firebase/remote-config-types" "0.1.9" - "@firebase/util" "0.3.4" - tslib "^1.11.1" - -"@firebase/storage-types@0.3.13": - version "0.3.13" - resolved "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.3.13.tgz" - integrity sha512-pL7b8d5kMNCCL0w9hF7pr16POyKkb3imOW7w0qYrhBnbyJTdVxMWZhb0HxCFyQWC0w3EiIFFmxoz8NTFZDEFog== - -"@firebase/storage@0.4.2": - version "0.4.2" - resolved "https://registry.npmjs.org/@firebase/storage/-/storage-0.4.2.tgz" - integrity sha512-87CrvKrf8kijVekRBmUs8htsNz7N5X/pDhv3BvJBqw8K65GsUolpyjx0f4QJRkCRUYmh3MSkpa5P08lpVbC6nQ== - dependencies: - "@firebase/component" "0.1.21" - "@firebase/storage-types" "0.3.13" - "@firebase/util" "0.3.4" - tslib "^1.11.1" - -"@firebase/util@0.3.4": +"@firebase/installations@0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@firebase/installations/-/installations-0.6.0.tgz#f8354ceb447d89589cbac84650ed28edcd97961b" + integrity sha512-Aks56ThZs1MsM0qJzJxhdeXak+Ob3tjd3JSY2poJptreLWsIOSBCxYO7Ev4yZ7DE7twMdZ0x70NhQ1ceXfdy0w== + dependencies: + "@firebase/component" "0.6.0" + "@firebase/util" "1.8.0" + idb "7.0.1" + tslib "^2.1.0" + +"@firebase/logger@0.3.4": version "0.3.4" - resolved "https://registry.npmjs.org/@firebase/util/-/util-0.3.4.tgz" - integrity sha512-VwjJUE2Vgr2UMfH63ZtIX9Hd7x+6gayi6RUXaTqEYxSbf/JmehLmAEYSuxS/NckfzAXWeGnKclvnXVibDgpjQQ== + resolved "https://registry.yarnpkg.com/@firebase/logger/-/logger-0.3.4.tgz#8822dd3e9168be93c1bce0b4ac235e3b165a6a68" + integrity sha512-hlFglGRgZEwoyClZcGLx/Wd+zoLfGmbDkFx56mQt/jJ0XMbfPqwId1kiPl0zgdWZX+D8iH+gT6GuLPFsJWgiGw== dependencies: - tslib "^1.11.1" + tslib "^2.1.0" -"@firebase/webchannel-wrapper@0.4.1": - version "0.4.1" - resolved "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.4.1.tgz" - integrity sha512-0yPjzuzGMkW1GkrC8yWsiN7vt1OzkMIi9HgxRmKREZl2wnNPOKo/yScTjXf/O57HM8dltqxPF6jlNLFVtc2qdw== +"@firebase/logger@0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@firebase/logger/-/logger-0.4.0.tgz#15ecc03c452525f9d47318ad9491b81d1810f113" + integrity sha512-eRKSeykumZ5+cJPdxxJRgAC3G5NknY2GwEbKfymdnXtnT0Ucm4pspfR6GT4MUQEDuJwRVbVcSx85kgJulMoFFA== + dependencies: + tslib "^2.1.0" + +"@firebase/messaging-compat@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@firebase/messaging-compat/-/messaging-compat-0.2.0.tgz#e42ca592c3ac604ab3716bef0a805a6427ff4c54" + integrity sha512-Qk9W9lVmTO67bR5jCaQ9HqS9MipkCuPGKCcO5JnnDd/p+Y2beWzScYxwzYGh9pEga3qzDAMSCB1PYoNgNTMzew== + dependencies: + "@firebase/component" "0.6.0" + "@firebase/messaging" "0.12.0" + "@firebase/util" "1.8.0" + tslib "^2.1.0" + +"@firebase/messaging-interop-types@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.0.tgz#6056f8904a696bf0f7fdcf5f2ca8f008e8f6b064" + integrity sha512-ujA8dcRuVeBixGR9CtegfpU4YmZf3Lt7QYkcj693FFannwNuZgfAYaTmbJ40dtjB81SAu6tbFPL9YLNT15KmOQ== + +"@firebase/messaging@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@firebase/messaging/-/messaging-0.12.0.tgz#ba7e341c61b9b6d76b06be1ef977e6d0e449bec7" + integrity sha512-M+LWaBH392SLF7/wAH5byJrP5f1MpromUG02NIr0sbgJ6Ot2nc+qDrDGjKF4qLXFqYzhNRlhskCCdf0ClgDM0A== + dependencies: + "@firebase/component" "0.6.0" + "@firebase/installations" "0.6.0" + "@firebase/messaging-interop-types" "0.2.0" + "@firebase/util" "1.8.0" + idb "7.0.1" + tslib "^2.1.0" + +"@firebase/performance-compat@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@firebase/performance-compat/-/performance-compat-0.2.0.tgz#183fdfa3fe33ef6b56ded8d5d25ec01c6be83abe" + integrity sha512-iO0fspVpiVOGxR08Y51nXoSMPH/bdRkRVQXYo4wuDDfQoZ5WZ0DXQuE0kXy3/T9QgqXdr8tSU0P0nil/jvnOcg== + dependencies: + "@firebase/component" "0.6.0" + "@firebase/logger" "0.4.0" + "@firebase/performance" "0.6.0" + "@firebase/performance-types" "0.2.0" + "@firebase/util" "1.8.0" + tslib "^2.1.0" + +"@firebase/performance-types@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@firebase/performance-types/-/performance-types-0.2.0.tgz#400685f7a3455970817136d9b48ce07a4b9562ff" + integrity sha512-kYrbr8e/CYr1KLrLYZZt2noNnf+pRwDq2KK9Au9jHrBMnb0/C9X9yWSXmZkFt4UIdsQknBq8uBB7fsybZdOBTA== + +"@firebase/performance@0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@firebase/performance/-/performance-0.6.0.tgz#ced371911ec618a5b6b5de73924e227a6a5a0fa8" + integrity sha512-mmCQ/8F0hQZ+J+JBvfQPlPAgKIRZccYW6N9321NbX8swd7EQP3dsW905RBmdXRsbjBpBqhn20zcQU6TDOKRwYA== + dependencies: + "@firebase/component" "0.6.0" + "@firebase/installations" "0.6.0" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.8.0" + tslib "^2.1.0" + +"@firebase/remote-config-compat@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@firebase/remote-config-compat/-/remote-config-compat-0.2.0.tgz#b9ddcde4b394ab7d946c47df39eb37f7e81f0100" + integrity sha512-2t+w4ngp1DPtZc04a6IjicbUGBpLb/MuFPlqpT8kHNqa/fNvA+ZFcAlEtHvzjS4o9rnTfjHgB+OJMgFP+r9OOw== + dependencies: + "@firebase/component" "0.6.0" + "@firebase/logger" "0.4.0" + "@firebase/remote-config" "0.4.0" + "@firebase/remote-config-types" "0.3.0" + "@firebase/util" "1.8.0" + tslib "^2.1.0" + +"@firebase/remote-config-types@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@firebase/remote-config-types/-/remote-config-types-0.3.0.tgz#689900dcdb3e5c059e8499b29db393e4e51314b4" + integrity sha512-RtEH4vdcbXZuZWRZbIRmQVBNsE7VDQpet2qFvq6vwKLBIQRQR5Kh58M4ok3A3US8Sr3rubYnaGqZSurCwI8uMA== + +"@firebase/remote-config@0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@firebase/remote-config/-/remote-config-0.4.0.tgz#d6a4582f74f4690ac905e6c99fa5486f60cd63a8" + integrity sha512-sedVYE4PwN4qtXfb7EkUYe9mz7hqBP/3y3c7WRMmTuh2VRNz5C5+NYULr5zySeJq+UZd6KyaS+KUOIxmx70tTw== + dependencies: + "@firebase/component" "0.6.0" + "@firebase/installations" "0.6.0" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.8.0" + tslib "^2.1.0" + +"@firebase/storage-compat@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@firebase/storage-compat/-/storage-compat-0.2.0.tgz#3f3356e9f1131f8d98d8dca1639357ea918939d5" + integrity sha512-w+7CyZyZ53YQWlTb8YOQ9YcmScgDwkvkXhpUbRWHlvlzAs06l0au42MydmHCeeTcSqvLOzpgURiVfm15ZifARg== + dependencies: + "@firebase/component" "0.6.0" + "@firebase/storage" "0.10.0" + "@firebase/storage-types" "0.7.0" + "@firebase/util" "1.8.0" + tslib "^2.1.0" + +"@firebase/storage-types@0.7.0": + version "0.7.0" + resolved "https://registry.yarnpkg.com/@firebase/storage-types/-/storage-types-0.7.0.tgz#0beaeafb62be7ebcf402e25b8cf8fa5a157fe925" + integrity sha512-n/8pYd82hc9XItV3Pa2KGpnuJ/2h/n/oTAaBberhe6GeyWQPnsmwwRK94W3GxUwBA/ZsszBAYZd7w7tTE+6XXA== + +"@firebase/storage@0.10.0": + version "0.10.0" + resolved "https://registry.yarnpkg.com/@firebase/storage/-/storage-0.10.0.tgz#5b94fb270a8fa551ac0f136257123a889ecbea27" + integrity sha512-2rp7+/bQ1gkUgrqDv5qHf/vlPAOKV+a/h1tnZ8D9zN0/6wc42gqFTORJUZj/A4efVnX7Ix8MWHBe4woO/2Th0w== + dependencies: + "@firebase/component" "0.6.0" + "@firebase/util" "1.8.0" + node-fetch "2.6.7" + tslib "^2.1.0" + +"@firebase/util@1.7.3": + version "1.7.3" + resolved "https://registry.yarnpkg.com/@firebase/util/-/util-1.7.3.tgz#e71640b6b2970b754f947235ceb10cba3f70e62c" + integrity sha512-wxNqWbqokF551WrJ9BIFouU/V5SL1oYCGx1oudcirdhadnQRFH5v1sjgGL7cUV/UsekSycygphdrF2lxBxOYKg== + dependencies: + tslib "^2.1.0" + +"@firebase/util@1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@firebase/util/-/util-1.8.0.tgz#e98354c5373f6b1d6b08219887340b79fd23557f" + integrity sha512-clK6pTTxIiLMYz4UrvDTVAs2rIaOiroAuFdX67C0JalvEwzi6Vv8li6xAGj38tkj7Qax06mosM1fQkxf2h4VTg== + dependencies: + tslib "^2.1.0" + +"@firebase/webchannel-wrapper@0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.9.0.tgz#9340bce56560a8bdba1d25d6281d4bfc397450dc" + integrity sha512-BpiZLBWdLFw+qFel9p3Zs1jD6QmH7Ii4aTDu6+vx8ShdidChZUXqDhYJly4ZjSgQh54miXbBgBrk0S+jTIh/Qg== "@gar/promisify@^1.1.3": version "1.1.3" resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz" integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== -"@google-cloud/common@^3.5.0": - version "3.5.0" - resolved "https://registry.npmjs.org/@google-cloud/common/-/common-3.5.0.tgz" - integrity sha512-10d7ZAvKhq47L271AqvHEd8KzJqGU45TY+rwM2Z3JHuB070FeTi7oJJd7elfrnKaEvaktw3hH2wKnRWxk/3oWQ== - dependencies: - "@google-cloud/projectify" "^2.0.0" - "@google-cloud/promisify" "^2.0.0" - arrify "^2.0.1" - duplexify "^4.1.1" - ent "^2.2.0" - extend "^3.0.2" - google-auth-library "^6.1.1" - retry-request "^4.1.1" - teeny-request "^7.0.0" - -"@google-cloud/firestore@^4.5.0": - version "4.8.1" - resolved "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-4.8.1.tgz" - integrity sha512-x/8ixlYqQuH9DoluhBj/uj3MqwoQN1lSCT2v+ieOXuh2L+8eoA7H+FF7f+UJ/D6hzo0MMWJd6q7QaBkpzp203Q== +"@google-cloud/firestore@^6.4.0": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@google-cloud/firestore/-/firestore-6.4.1.tgz#3cd32ffb10a563a9c3c91236b51e49e4cd088393" + integrity sha512-5q4sl1XCL8NH2y82KZ4WQGHDOPnrSMYq3JpIeKD5C0OCSb4MfckOTB9LeAQ3p5tlL+7UsVRHj0SyzKz27XZJjw== dependencies: fast-deep-equal "^3.1.1" functional-red-black-tree "^1.0.1" - google-gax "^2.9.2" + google-gax "^3.5.1" + protobufjs "^7.0.0" -"@google-cloud/paginator@^3.0.0": - version "3.0.5" - resolved "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-3.0.5.tgz" - integrity sha512-N4Uk4BT1YuskfRhKXBs0n9Lg2YTROZc6IMpkO/8DIHODtm5s3xY8K5vVBo23v/2XulY3azwITQlYWgT4GdLsUw== +"@google-cloud/paginator@^3.0.7": + version "3.0.7" + resolved "https://registry.yarnpkg.com/@google-cloud/paginator/-/paginator-3.0.7.tgz#fb6f8e24ec841f99defaebf62c75c2e744dd419b" + integrity sha512-jJNutk0arIQhmpUUQJPJErsojqo834KcyB6X7a1mxuic8i1tKXxde8E69IZxNZawRIlZdIK2QY4WALvlK5MzYQ== dependencies: arrify "^2.0.0" extend "^3.0.2" @@ -331,11 +549,21 @@ resolved "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-2.0.1.tgz" integrity sha512-ZDG38U/Yy6Zr21LaR3BTiiLtpJl6RkPS/JwoRT453G+6Q1DhlV0waNf8Lfu+YVYGIIxgKnLayJRfYlFJfiI8iQ== +"@google-cloud/projectify@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@google-cloud/projectify/-/projectify-3.0.0.tgz#302b25f55f674854dce65c2532d98919b118a408" + integrity sha512-HRkZsNmjScY6Li8/kb70wjGlDDyLkVk3KvoEo9uIoxSjYLJasGiCch9+PqRVDOCGUFvEIqyogl+BeqILL4OJHA== + "@google-cloud/promisify@^2.0.0": version "2.0.3" resolved "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-2.0.3.tgz" integrity sha512-d4VSA86eL/AFTe5xtyZX+ePUjE8dIFu2T8zmdeNBSa5/kNgXPCx/o/wbFNHAGLJdGnk1vddRuMESD9HbOC8irw== +"@google-cloud/promisify@^3.0.0": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@google-cloud/promisify/-/promisify-3.0.1.tgz#8d724fb280f47d1ff99953aee0c1669b25238c2e" + integrity sha512-z1CjRjtQyBOYL+5Qr9DdYIfrdLBe746jRTYfaYU6MeXkqp7UfYs/jX16lFFVzZ7PGEJvqZNqYUEtb1mvDww4pA== + "@google-cloud/pubsub@^3.0.1": version "3.0.1" resolved "https://registry.npmjs.org/@google-cloud/pubsub/-/pubsub-3.0.1.tgz" @@ -357,77 +585,47 @@ lodash.snakecase "^4.1.1" p-defer "^3.0.0" -"@google-cloud/storage@^5.3.0": - version "5.7.2" - resolved "https://registry.npmjs.org/@google-cloud/storage/-/storage-5.7.2.tgz" - integrity sha512-LEKGOe+GnD1yV5YnpAmRJFAReOYHthyC2CAdQs0wv7OJAplvJCEPHchUNC7nk0QEc23mz9cYHEnT76MP+YmBhQ== +"@google-cloud/storage@^6.5.2": + version "6.8.0" + resolved "https://registry.yarnpkg.com/@google-cloud/storage/-/storage-6.8.0.tgz#98bf58f18d422386b245d98d0bda9054852ccd9a" + integrity sha512-eRGsHrhVA7NORehYW9jLUWHRzYqFxbYiG3LQL50ZhjMekDwzhPKUQ7wbjAji9OFcO3Mk8jeNHeWdpAc/QZANCg== dependencies: - "@google-cloud/common" "^3.5.0" - "@google-cloud/paginator" "^3.0.0" - "@google-cloud/promisify" "^2.0.0" - arrify "^2.0.0" + "@google-cloud/paginator" "^3.0.7" + "@google-cloud/projectify" "^3.0.0" + "@google-cloud/promisify" "^3.0.0" + abort-controller "^3.0.0" + async-retry "^1.3.3" compressible "^2.0.12" - date-and-time "^0.14.2" duplexify "^4.0.0" + ent "^2.2.0" extend "^3.0.2" - gaxios "^4.0.0" - gcs-resumable-upload "^3.1.0" - get-stream "^6.0.0" - hash-stream-validation "^0.2.2" - mime "^2.2.0" + gaxios "^5.0.0" + google-auth-library "^8.0.1" + mime "^3.0.0" mime-types "^2.0.8" - onetime "^5.1.0" p-limit "^3.0.1" - pumpify "^2.0.0" - snakeize "^0.1.0" - stream-events "^1.0.1" - xdg-basedir "^4.0.0" - -"@grpc/grpc-js@^1.0.0": - version "1.1.6" - resolved "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.1.6.tgz" - integrity sha512-bUeaMN/dHTkt9AqU0Tc1xdHMB3jVLyPNfg8gZ5cMyhFyMeCwoJbFcJrNBgYqRCbvYhvtaEgzQwkw91NnY4Oktg== - dependencies: - "@grpc/proto-loader" "^0.6.0-pre14" - "@types/node" "^12.12.47" - google-auth-library "^6.0.0" - semver "^6.2.0" - -"@grpc/grpc-js@~1.2.0": - version "1.2.3" - resolved "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.2.3.tgz" - integrity sha512-hMjS4/TiGFtvMxjmM3mgXCw6VIGeI0EWTNzdcV6R+qqCh33dLDcK1wVceAABXKZ+Fia1nETU49RBesOiukQjGA== - dependencies: - "@types/node" "^12.12.47" - google-auth-library "^6.1.1" - semver "^6.2.0" + retry-request "^5.0.0" + teeny-request "^8.0.0" + uuid "^8.0.0" "@grpc/grpc-js@~1.7.0": version "1.7.3" - resolved "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.7.3.tgz" + resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.7.3.tgz#f2ea79f65e31622d7f86d4b4c9ae38f13ccab99a" integrity sha512-H9l79u4kJ2PVSxUNA08HMYAnUBLj9v6KjYQ7SQ71hOZcEXhShE/y5iQCesP8+6/Ik/7i2O0a10bPquIcYfufog== dependencies: "@grpc/proto-loader" "^0.7.0" "@types/node" ">=12.12.47" -"@grpc/proto-loader@^0.5.0", "@grpc/proto-loader@^0.5.1": - version "0.5.5" - resolved "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.5.5.tgz" - integrity sha512-WwN9jVNdHRQoOBo9FDH7qU+mgfjPc8GygPYms3M+y3fbQLfnCe/Kv/E01t7JRgnrsOHH8euvSbed3mIalXhwqQ== - dependencies: - lodash.camelcase "^4.3.0" - protobufjs "^6.8.6" - -"@grpc/proto-loader@^0.6.0-pre14": - version "0.6.0-pre9" - resolved "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.0-pre9.tgz" - integrity sha512-oM+LjpEjNzW5pNJjt4/hq1HYayNeQT+eGrOPABJnYHv7TyNPDNzkQ76rDYZF86X5swJOa4EujEMzQ9iiTdPgww== +"@grpc/proto-loader@^0.6.13": + version "0.6.13" + resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.6.13.tgz#008f989b72a40c60c96cd4088522f09b05ac66bc" + integrity sha512-FjxPYDRTn6Ec3V0arm1FtSpmP6V50wuph2yILpyvTKzjc76oDdoihXqM1DzOW5ubvCC8GivfCnNtfaRE8myJ7g== dependencies: "@types/long" "^4.0.1" lodash.camelcase "^4.3.0" long "^4.0.0" - protobufjs "^6.9.0" - yargs "^15.3.1" + protobufjs "^6.11.3" + yargs "^16.2.0" "@grpc/proto-loader@^0.7.0": version "0.7.4" @@ -440,6 +638,24 @@ protobufjs "^7.0.0" yargs "^16.2.0" +"@jridgewell/resolve-uri@^3.0.3": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" + integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== + +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.14" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" + integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== + +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jsdevtools/ono@^7.1.3": version "7.1.3" resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz" @@ -534,6 +750,11 @@ resolved "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.2.0.tgz" integrity sha512-BNKB9fiYVghALJzCuWO3eNYfdTExPVK4ykrtmfNfy0A6UWYhOYjGMXifUmkunDJNL8ju9tBobo8jF0WR9zGy1Q== +"@panva/asn1.js@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@panva/asn1.js/-/asn1.js-1.0.0.tgz#dd55ae7b8129e02049f009408b97c61ccf9032f6" + integrity sha512-UdkG3mLEqXgnlKsWanWcgb6dOjUzJ+XC5f+aWw30qrtjxeNUSfKX1cd5FBzOaXQumoe9nIqeZUvrRJS03HCCtw== + "@pnpm/network.ca-file@^1.0.1": version "1.0.2" resolved "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz" @@ -677,9 +898,29 @@ "@tootallnate/once@2": version "2.0.0" - resolved "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== +"@tsconfig/node10@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" + integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" + integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== + "@types/anymatch@*": version "1.3.1" resolved "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz" @@ -726,6 +967,13 @@ dependencies: "@types/webpack" "*" +"@types/cors@^2.8.5": + version "2.8.13" + resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.13.tgz#b8ade22ba455a1b8cb3b5d3f35910fd204f84f94" + integrity sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA== + dependencies: + "@types/node" "*" + "@types/cors@^2.8.7": version "2.8.7" resolved "https://registry.npmjs.org/@types/cors/-/cors-2.8.7.tgz" @@ -788,6 +1036,15 @@ "@types/qs" "*" "@types/range-parser" "*" +"@types/express-serve-static-core@^4.17.31": + version "4.17.31" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz#a1139efeab4e7323834bb0226e62ac019f474b2f" + integrity sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + "@types/express@*": version "4.17.8" resolved "https://registry.npmjs.org/@types/express/-/express-4.17.8.tgz" @@ -807,6 +1064,16 @@ "@types/express-serve-static-core" "*" "@types/serve-static" "*" +"@types/express@^4.17.14": + version "4.17.15" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.15.tgz#9290e983ec8b054b65a5abccb610411953d417ff" + integrity sha512-Yv0k4bXGOH+8a+7bELd2PqHQsuiANB+A8a4gnQrkRWzrkKlb6KHaVvyXhqs04sVW/OWlbPyYxRgYlIXLfrufMQ== + dependencies: + "@types/body-parser" "*" + "@types/express-serve-static-core" "^4.17.31" + "@types/qs" "*" + "@types/serve-static" "*" + "@types/highlight.js@^9.7.0": version "9.12.4" resolved "https://registry.npmjs.org/@types/highlight.js/-/highlight.js-9.12.4.tgz" @@ -827,9 +1094,16 @@ resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= +"@types/jsonwebtoken@^8.5.9": + version "8.5.9" + resolved "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-8.5.9.tgz#2c064ecb0b3128d837d2764aa0b117b0ff6e4586" + integrity sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg== + dependencies: + "@types/node" "*" + "@types/linkify-it@*": version "3.0.2" - resolved "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz" + resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-3.0.2.tgz#fd2cd2edbaa7eaac7e7f3c1748b52a19143846c9" integrity sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA== "@types/lodash@^4.14.167": @@ -844,7 +1118,7 @@ "@types/markdown-it@^12.2.3": version "12.2.3" - resolved "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz" + resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-12.2.3.tgz#0d6f6e5e413f8daaa26522904597be3d6cd93b51" integrity sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ== dependencies: "@types/linkify-it" "*" @@ -852,7 +1126,7 @@ "@types/mdurl@*": version "1.0.2" - resolved "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz" + resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-1.0.2.tgz#e2ce9d83a613bacf284c7be7d491945e39e1f8e9" integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA== "@types/mime@*": @@ -878,24 +1152,9 @@ integrity sha512-aYNbO+FZ/3KGeQCEkNhHFRIzBOUgc7QvcVNKXbfnhDkSfwUv91JsQQa10rDgKSTSLkXZ1UIyPe4FJJNVgw1xWQ== "@types/node@>=12.12.47", "@types/node@>=13.7.0": - version "14.18.36" - resolved "https://registry.npmjs.org/@types/node/-/node-14.18.36.tgz" - integrity sha512-FXKWbsJ6a1hIrRxv+FoukuHnGTgEzKYGi7kilfMae96AL9UNkPFNWJEEYWzdRI9ooIkbr4AKldyuSTLql06vLQ== - -"@types/node@^10.10.0": - version "10.17.32" - resolved "https://registry.npmjs.org/@types/node/-/node-10.17.32.tgz" - integrity sha512-EUq+cjH/3KCzQHikGnNbWAGe548IFLSm93Vl8xA7EuYEEATiyOVDyEVuGkowL7c9V69FF/RiZSAOCFPApMs/ig== - -"@types/node@^12.12.47": - version "12.12.58" - resolved "https://registry.npmjs.org/@types/node/-/node-12.12.58.tgz" - integrity sha512-Be46CNIHWAagEfINOjmriSxuv7IVcqbGe+sDSg2SYCEz/0CRBy7LRASGfRbD8KZkqoePU73Wsx3UvOSFcq/9hA== - -"@types/node@^13.7.0": - version "13.13.19" - resolved "https://registry.npmjs.org/@types/node/-/node-13.13.19.tgz" - integrity sha512-IVsULCpTdafcHhBDLYEPnV5l15xV0q065zvOHC1ZmzFYaBCMzku078eXnazoSG8907vZjRgEN/EQjku7GwwFyQ== + version "18.11.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" + integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== "@types/node@^14.14.32": version "14.14.32" @@ -1025,10 +1284,10 @@ "@types/webpack-sources" "*" source-map "^0.6.0" -"@typesaurus/preact@^4.0.0": - version "4.0.0" - resolved "https://registry.npmjs.org/@typesaurus/preact/-/preact-4.0.0.tgz" - integrity sha512-KY/mg+/pse1U8UPCQN2ORI1AXn+peJ/Xroe+YAcc/lh4F11ukGm/fTYR79PdQMqi1ISUwA1PGiNgjst5BedDmg== +"@typesaurus/preact@6.0.0-alpha.4": + version "6.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/@typesaurus/preact/-/preact-6.0.0-alpha.4.tgz#56a03cbce987217e9eeb27e6555b3a9c0c7f314b" + integrity sha512-d7NAFzguZByEm2TuimQ+E89vAQgiHSP3KcOCwWn0Z2HKUEEA/XWMaZACId9IsiIJ3++4QmfDDyL7IzpriHXHOw== "@ungap/promise-all-settled@1.1.2": version "1.1.2" @@ -1213,12 +1472,12 @@ acorn-es7-plugin@^1.0.12: acorn-jsx@^5.3.2: version "5.3.2" - resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn-walk@^8.2.0: +acorn-walk@^8.1.1, acorn-walk@^8.2.0: version "8.2.0" - resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== acorn@^5.0.0: @@ -1231,7 +1490,12 @@ acorn@^8.0.4: resolved "https://registry.npmjs.org/acorn/-/acorn-8.0.4.tgz" integrity sha512-XNP0PqF1XD19ZlLKvB7cMmnZswW4C/03pRHgirB30uSJTaS3A3V1/P4sS3HPvFmjoriPCJQs+JDSbm4bL1TxGQ== -acorn@^8.7.0, acorn@^8.8.0: +acorn@^8.4.1, acorn@^8.8.0: + version "8.8.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" + integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== + +acorn@^8.7.0: version "8.8.0" resolved "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz" integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== @@ -1464,7 +1728,7 @@ argparse@^1.0.10, argparse@^1.0.7: argparse@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== array-filter@^1.0.0: @@ -1506,7 +1770,7 @@ array.prototype.flatmap@^1.2.1: es-abstract "^1.18.0-next.1" function-bind "^1.1.1" -arrify@^2.0.0, arrify@^2.0.1: +arrify@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== @@ -1554,6 +1818,13 @@ async-lock@1.3.2: resolved "https://registry.npmjs.org/async-lock/-/async-lock-1.3.2.tgz" integrity sha512-phnXdS3RP7PPcmP6NWWzWMU0sLTeyvtZCxBPpZdkYE3seGLKSQZs9FrmVO/qwypq98FUtWWUEYxziLkdGk5nnA== +async-retry@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.3.tgz#0e7f36c04d8478e7a58bdbed80cedf977785f280" + integrity sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw== + dependencies: + retry "0.13.1" + async@^2.6.1, async@^2.6.4: version "2.6.4" resolved "https://registry.npmjs.org/async/-/async-2.6.4.tgz" @@ -1661,7 +1932,7 @@ bl@^4.0.3, bl@^4.1.0: bluebird@^3.7.2: version "3.7.2" - resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== bluebird@~3.4.1: @@ -1732,7 +2003,7 @@ brace-expansion@^1.1.7: brace-expansion@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== dependencies: balanced-match "^1.0.0" @@ -1903,7 +2174,7 @@ caseless@~0.12.0: catharsis@^0.9.0: version "0.9.0" - resolved "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz" + resolved "https://registry.yarnpkg.com/catharsis/-/catharsis-0.9.0.tgz#40382a168be0e6da308c277d3a2b3eb40c7d2121" integrity sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A== dependencies: lodash "^4.17.15" @@ -2104,15 +2375,6 @@ cliui@^5.0.0: strip-ansi "^5.2.0" wrap-ansi "^5.1.0" -cliui@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz" - integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^6.2.0" - cliui@^7.0.2: version "7.0.4" resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz" @@ -2306,7 +2568,7 @@ config-chain@^1.1.11: ini "^1.3.4" proto-list "~1.2.1" -configstore@^5.0.0, configstore@^5.0.1: +configstore@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz" integrity sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA== @@ -2381,11 +2643,6 @@ copy-webpack-plugin@^7.0.0: schema-utils "^3.0.0" serialize-javascript "^5.0.1" -core-js@3.6.5: - version "3.6.5" - resolved "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz" - integrity sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA== - core-js@^2.0.0: version "2.6.12" resolved "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz" @@ -2543,11 +2800,6 @@ data-uri-to-buffer@3: resolved "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz" integrity sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og== -date-and-time@^0.14.2: - version "0.14.2" - resolved "https://registry.npmjs.org/date-and-time/-/date-and-time-0.14.2.tgz" - integrity sha512-EFTCh9zRSEpGPmJaexg7HTuzZHh6cnJj1ui7IGCFNXzd2QdpsNh05Db5TF3xzJm30YN+A8/6xHSuRcQqoc3kFA== - date-fns@^2.16.1: version "2.16.1" resolved "https://registry.npmjs.org/date-fns/-/date-fns-2.16.1.tgz" @@ -2588,9 +2840,9 @@ debug@^3.2.7: dependencies: ms "^2.1.1" -debug@^4.1.0, debug@^4.3.3: +debug@^4.1.0, debug@^4.3.3, debug@^4.3.4: version "4.3.4" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" @@ -2700,13 +2952,6 @@ diagnostics@^1.1.1: enabled "1.0.x" kuler "1.0.x" -dicer@^0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/dicer/-/dicer-0.3.0.tgz" - integrity sha512-MdceRRWqltEG2dZqO769g27N/3PXfcKl04VhYnBlo2YhH7zPi88VebsjTKclaOyiuMaGU72hTfw3VkUitGcVCA== - dependencies: - streamsearch "0.1.2" - diff-match-patch@^1.0.0: version "1.0.5" resolved "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.5.tgz" @@ -2753,11 +2998,6 @@ dom-serializer@^1.0.1, dom-serializer@~1.2.0: domhandler "^4.0.0" entities "^2.0.0" -dom-storage@2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/dom-storage/-/dom-storage-2.1.0.tgz" - integrity sha512-g6RpyWXzl0RR6OTElHKBl7nwnK87GUyZMYC7JWsB/IA73vpqK2K6LT39x4VepLxlSsWBFrPVLnsSR5Jyty0+2Q== - domelementtype@1, domelementtype@^1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz" @@ -2834,7 +3074,7 @@ duplexer2@~0.1.4: dependencies: readable-stream "^2.0.2" -duplexify@^4.0.0, duplexify@^4.1.1: +duplexify@^4.0.0: version "4.1.1" resolved "https://registry.npmjs.org/duplexify/-/duplexify-4.1.1.tgz" integrity sha512-DY3xVEmVHTv1wSzKNbwoU6nVjzI369Y6sPoqfYr0/xlx3IdX2n94xIszTcjPO8W8ZIv0Wb0PXNcjuZyT4wiICA== @@ -2940,6 +3180,14 @@ enhanced-resolve@^4.0.0: memory-fs "^0.5.0" tapable "^1.0.0" +enhanced-resolve@^5.0.0: + version "5.12.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz#300e1c90228f5b570c4d35babf263f6da7155634" + integrity sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + enhanced-resolve@^5.7.0: version "5.7.0" resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.7.0.tgz" @@ -3147,7 +3395,7 @@ escape-string-regexp@^1.0.5: escape-string-regexp@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== escodegen@^1.13.0, escodegen@^1.8.1: @@ -3172,12 +3420,12 @@ eslint-scope@^5.1.1: eslint-visitor-keys@^3.3.0: version "3.3.0" - resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== espree@^9.0.0: version "9.4.1" - resolved "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.1.tgz#51d6092615567a2c2cff7833445e37c28c0065bd" integrity sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg== dependencies: acorn "^8.8.0" @@ -3210,7 +3458,7 @@ estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: estraverse@^5.1.0: version "5.3.0" - resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== estraverse@^5.2.0: @@ -3451,10 +3699,10 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" -faye-websocket@0.11.3: - version "0.11.3" - resolved "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.3.tgz" - integrity sha512-D2y4bovYpzziGgbHYtGCMjlJM36vAl/y+xUyn1C+FVx8szd1E+86KwVw6XvYSzOP8iMpm1X0I4xJD+QtUb36OA== +faye-websocket@0.11.4: + version "0.11.4" + resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.4.tgz#7f0d9275cfdd86a1c963dc8b65fcc451edcbb1da" + integrity sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g== dependencies: websocket-driver ">=0.5.1" @@ -3536,7 +3784,7 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" -find-up@^4.0.0, find-up@^4.1.0: +find-up@^4.0.0: version "4.1.0" resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== @@ -3551,30 +3799,33 @@ find-versions@^3.2.0: dependencies: semver-regex "^2.0.0" -firebase-admin@^9.4.2: - version "9.4.2" - resolved "https://registry.npmjs.org/firebase-admin/-/firebase-admin-9.4.2.tgz" - integrity sha512-mRnBJbW6BAz6DJkZ0GOUTkmnmCrwVzMreMc6O+RXWukFydOzi5Xr6TKSiPKxoOQw41r9IluP2AZ3Qzvlx2SR+g== - dependencies: - "@firebase/database" "^0.8.1" - "@firebase/database-types" "^0.6.1" - "@types/node" "^10.10.0" - dicer "^0.3.0" - jsonwebtoken "^8.5.1" - node-forge "^0.10.0" +firebase-admin@^11.4.1: + version "11.4.1" + resolved "https://registry.yarnpkg.com/firebase-admin/-/firebase-admin-11.4.1.tgz#46ab2fa9ca99f7025b4d349eadfbd5e6ab1ee334" + integrity sha512-t5+Pf8rC01TW1KPD5U8Q45AEn7eK+FJaHlpzYStFb62J+MQmN/kB/PWUEsNn+7MNAQ0DZxFUCgJoi+bRmf83oQ== + dependencies: + "@fastify/busboy" "^1.1.0" + "@firebase/database-compat" "^0.2.6" + "@firebase/database-types" "^0.9.13" + "@types/node" ">=12.12.47" + jsonwebtoken "^9.0.0" + jwks-rsa "^2.1.4" + node-forge "^1.3.1" + uuid "^9.0.0" optionalDependencies: - "@google-cloud/firestore" "^4.5.0" - "@google-cloud/storage" "^5.3.0" + "@google-cloud/firestore" "^6.4.0" + "@google-cloud/storage" "^6.5.2" -firebase-functions@^3.13.0: - version "3.13.0" - resolved "https://registry.npmjs.org/firebase-functions/-/firebase-functions-3.13.0.tgz" - integrity sha512-tnltJL5KlGtbeBD9scsVjoKTSTMeo6EAy1gsdOfRlrwAu6idgLRKYVdmw0YymS8N7SwJ3CXo+3fuvSSihKhXbA== +firebase-functions@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/firebase-functions/-/firebase-functions-4.1.1.tgz#47c39a40d6cdaad9a46cb7ee3b9ffbb9bcaa7f2c" + integrity sha512-D0fhHO7m3OfZp5TpbO+ClsEo6vmr8uaR4kt7sePhQgcF1OCRI6YT5dEa9szaQekGKoao/YeZ+C5HVxEGsLxD9Q== dependencies: + "@types/cors" "^2.8.5" "@types/express" "4.17.3" cors "^2.8.5" express "^4.17.1" - lodash "^4.17.14" + node-fetch "^2.6.7" firebase-tools@^11.24.1: version "11.24.1" @@ -3642,25 +3893,37 @@ firebase-tools@^11.24.1: winston-transport "^4.4.0" ws "^7.2.3" -firebase@^8.2.2: - version "8.2.2" - resolved "https://registry.npmjs.org/firebase/-/firebase-8.2.2.tgz" - integrity sha512-a07aW2TTAA9S7p4mx5pu8hvtVokJEjAQlAocHKOWwmRJRIduE9Vvr/3i50FtujT5gGNr0Qm+EyWyB+/7TJiwnw== - dependencies: - "@firebase/analytics" "0.6.2" - "@firebase/app" "0.6.13" - "@firebase/app-types" "0.6.1" - "@firebase/auth" "0.16.1" - "@firebase/database" "0.8.2" - "@firebase/firestore" "2.1.2" - "@firebase/functions" "0.6.1" - "@firebase/installations" "0.4.19" - "@firebase/messaging" "0.7.3" - "@firebase/performance" "0.4.5" - "@firebase/polyfill" "0.3.36" - "@firebase/remote-config" "0.1.30" - "@firebase/storage" "0.4.2" - "@firebase/util" "0.3.4" +firebase@^9.15.0: + version "9.15.0" + resolved "https://registry.yarnpkg.com/firebase/-/firebase-9.15.0.tgz#c48bad2d9ab490b147c18aab591635dd738236b9" + integrity sha512-Fa8qFahDY/pMYMzwPGcfpUkAS3Q55qJ0QKD+5xnXjSX/jVHsJqoXtxapmyDCfAKktiLhXIcRElW1VDVd9xGwQQ== + dependencies: + "@firebase/analytics" "0.9.0" + "@firebase/analytics-compat" "0.2.0" + "@firebase/app" "0.9.0" + "@firebase/app-check" "0.6.0" + "@firebase/app-check-compat" "0.3.0" + "@firebase/app-compat" "0.2.0" + "@firebase/app-types" "0.9.0" + "@firebase/auth" "0.21.0" + "@firebase/auth-compat" "0.3.0" + "@firebase/database" "0.14.0" + "@firebase/database-compat" "0.3.0" + "@firebase/firestore" "3.8.0" + "@firebase/firestore-compat" "0.3.0" + "@firebase/functions" "0.9.0" + "@firebase/functions-compat" "0.3.0" + "@firebase/installations" "0.6.0" + "@firebase/installations-compat" "0.2.0" + "@firebase/messaging" "0.12.0" + "@firebase/messaging-compat" "0.2.0" + "@firebase/performance" "0.6.0" + "@firebase/performance-compat" "0.2.0" + "@firebase/remote-config" "0.4.0" + "@firebase/remote-config-compat" "0.2.0" + "@firebase/storage" "0.10.0" + "@firebase/storage-compat" "0.2.0" + "@firebase/util" "1.8.0" flat@^5.0.2: version "5.0.2" @@ -3812,17 +4075,6 @@ gauge@^4.0.3: strip-ansi "^6.0.1" wide-align "^1.1.5" -gaxios@^3.0.0: - version "3.2.0" - resolved "https://registry.npmjs.org/gaxios/-/gaxios-3.2.0.tgz" - integrity sha512-+6WPeVzPvOshftpxJwRi2Ozez80tn/hdtOUag7+gajDHRJvAblKxTFSSMPtr2hmnLy7p0mvYz0rMXLBl8pSO7Q== - dependencies: - abort-controller "^3.0.0" - extend "^3.0.2" - https-proxy-agent "^5.0.0" - is-stream "^2.0.0" - node-fetch "^2.3.0" - gaxios@^4.0.0: version "4.1.0" resolved "https://registry.npmjs.org/gaxios/-/gaxios-4.1.0.tgz" @@ -3834,25 +4086,16 @@ gaxios@^4.0.0: is-stream "^2.0.0" node-fetch "^2.3.0" -gaxios@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/gaxios/-/gaxios-5.0.0.tgz" - integrity sha512-VD/yc5ln6XU8Ch1hyYY6kRMBE0Yc2np3fPyeJeYHhrPs1i8rgnsApPMWyrugkl7LLoSqpOJVBWlQIa87OAvt8Q== +gaxios@^5.0.0, gaxios@^5.0.1: + version "5.0.2" + resolved "https://registry.yarnpkg.com/gaxios/-/gaxios-5.0.2.tgz#ca3a40e851c728d31d7001c2357062d46bf966d1" + integrity sha512-TjtV2AJOZoMQqRYoy5eM8cCQogYwazWNYLQ72QB0kwa6vHHruYkGmhhyrlzbmgNHK1dNnuP2WSH81urfzyN2Og== dependencies: - abort-controller "^3.0.0" extend "^3.0.2" https-proxy-agent "^5.0.0" is-stream "^2.0.0" node-fetch "^2.6.7" -gcp-metadata@^4.1.0: - version "4.1.4" - resolved "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.1.4.tgz" - integrity sha512-5J/GIH0yWt/56R3dNaNWPGQ/zXsZOddYECfJaqxFWgrZ9HC2Kvc5vl9upOgUUHKzURjAVf2N+f6tEJiojqXUuA== - dependencies: - gaxios "^3.0.0" - json-bigint "^1.0.0" - gcp-metadata@^4.2.0: version "4.2.1" resolved "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.2.1.tgz" @@ -3862,26 +4105,13 @@ gcp-metadata@^4.2.0: json-bigint "^1.0.0" gcp-metadata@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.0.0.tgz" - integrity sha512-gfwuX3yA3nNsHSWUL4KG90UulNiq922Ukj3wLTrcnX33BB7PwB1o0ubR8KVvXu9nJH+P5w1j2SQSNNqto+H0DA== + version "5.1.0" + resolved "https://registry.yarnpkg.com/gcp-metadata/-/gcp-metadata-5.1.0.tgz#105768fd493ab6ff9606e0d77cdf0a4d9c1a0180" + integrity sha512-QVjouEXvNVG/nde6VZDXXFTB02xQdztaumkWCHUff58qsdCS05/8OPh68fQ2QnArfAzZTwfEc979FHSHsU8EWg== dependencies: gaxios "^5.0.0" json-bigint "^1.0.0" -gcs-resumable-upload@^3.1.0: - version "3.1.1" - resolved "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-3.1.1.tgz" - integrity sha512-RS1osvAicj9+MjCc6jAcVL1Pt3tg7NK2C2gXM5nqD1Gs0klF2kj5nnAFSBy97JrtslMIQzpb7iSuxaG8rFWd2A== - dependencies: - abort-controller "^3.0.0" - configstore "^5.0.0" - extend "^3.0.2" - gaxios "^3.0.0" - google-auth-library "^6.0.0" - pumpify "^2.0.0" - stream-events "^1.0.4" - get-caller-file@^2.0.1, get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" @@ -4046,25 +4276,10 @@ good-listener@^1.2.2: dependencies: delegate "^3.1.2" -google-auth-library@^6.0.0: - version "6.0.6" - resolved "https://registry.npmjs.org/google-auth-library/-/google-auth-library-6.0.6.tgz" - integrity sha512-fWYdRdg55HSJoRq9k568jJA1lrhg9i2xgfhVIMJbskUmbDpJGHsbv9l41DGhCDXM21F9Kn4kUwdysgxSYBYJUw== - dependencies: - arrify "^2.0.0" - base64-js "^1.3.0" - ecdsa-sig-formatter "^1.0.11" - fast-text-encoding "^1.0.0" - gaxios "^3.0.0" - gcp-metadata "^4.1.0" - gtoken "^5.0.0" - jws "^4.0.0" - lru-cache "^6.0.0" - -google-auth-library@^6.1.1, google-auth-library@^6.1.3: - version "6.1.4" - resolved "https://registry.npmjs.org/google-auth-library/-/google-auth-library-6.1.4.tgz" - integrity sha512-q0kYtGWnDd9XquwiQGAZeI2Jnglk7NDi0cChE4tWp6Kpo/kbqnt9scJb0HP+/xqt03Beqw/xQah1OPrci+pOxw== +google-auth-library@^7.11.0: + version "7.14.1" + resolved "https://registry.npmjs.org/google-auth-library/-/google-auth-library-7.14.1.tgz" + integrity sha512-5Rk7iLNDFhFeBYc3s8l1CqzbEBcdhwR193RlD4vSNFajIcINKI8W8P0JLmBpwymHqqWbX34pJDQu39cSy/6RsA== dependencies: arrify "^2.0.0" base64-js "^1.3.0" @@ -4076,18 +4291,18 @@ google-auth-library@^6.1.1, google-auth-library@^6.1.3: jws "^4.0.0" lru-cache "^6.0.0" -google-auth-library@^7.11.0: - version "7.14.1" - resolved "https://registry.npmjs.org/google-auth-library/-/google-auth-library-7.14.1.tgz" - integrity sha512-5Rk7iLNDFhFeBYc3s8l1CqzbEBcdhwR193RlD4vSNFajIcINKI8W8P0JLmBpwymHqqWbX34pJDQu39cSy/6RsA== +google-auth-library@^8.0.1: + version "8.7.0" + resolved "https://registry.yarnpkg.com/google-auth-library/-/google-auth-library-8.7.0.tgz#e36e255baba4755ce38dded4c50f896cf8515e51" + integrity sha512-1M0NG5VDIvJZEnstHbRdckLZESoJwguinwN8Dhae0j2ZKIQFIV63zxm6Fo6nM4xkgqUr2bbMtV5Dgo+Hy6oo0Q== dependencies: arrify "^2.0.0" base64-js "^1.3.0" ecdsa-sig-formatter "^1.0.11" fast-text-encoding "^1.0.0" - gaxios "^4.0.0" - gcp-metadata "^4.2.0" - gtoken "^5.0.4" + gaxios "^5.0.0" + gcp-metadata "^5.0.0" + gtoken "^6.1.0" jws "^4.0.0" lru-cache "^6.0.0" @@ -4106,27 +4321,30 @@ google-auth-library@^8.0.2: jws "^4.0.0" lru-cache "^6.0.0" -google-gax@^2.9.2: - version "2.10.0" - resolved "https://registry.npmjs.org/google-gax/-/google-gax-2.10.0.tgz" - integrity sha512-K+1JK5ofNl5k30LsI8UQb/DeLMEbhL/SWirCx0L9pnMcApSfAjRAO7yajXT5X1vicxDBnNSwKs+cu4elxpYraw== +google-gax@^3.0.1: + version "3.5.3" + resolved "https://registry.npmjs.org/google-gax/-/google-gax-3.5.3.tgz" + integrity sha512-caItkifbcPDVf5xW2j6xLXmuX9bh2dheJN9AzMuQj6VvWacUVV5d0BkjL+Ia8sgX9VvXtbqjf4NKK3nTgV9UUQ== dependencies: - "@grpc/grpc-js" "~1.2.0" - "@grpc/proto-loader" "^0.5.1" + "@grpc/grpc-js" "~1.7.0" + "@grpc/proto-loader" "^0.7.0" "@types/long" "^4.0.0" abort-controller "^3.0.0" duplexify "^4.0.0" fast-text-encoding "^1.0.3" - google-auth-library "^6.1.3" + google-auth-library "^8.0.2" is-stream-ended "^0.1.4" node-fetch "^2.6.1" - protobufjs "^6.10.2" - retry-request "^4.0.0" + object-hash "^3.0.0" + proto3-json-serializer "^1.0.0" + protobufjs "7.1.2" + protobufjs-cli "1.1.0" + retry-request "^5.0.0" -google-gax@^3.0.1: - version "3.5.3" - resolved "https://registry.npmjs.org/google-gax/-/google-gax-3.5.3.tgz" - integrity sha512-caItkifbcPDVf5xW2j6xLXmuX9bh2dheJN9AzMuQj6VvWacUVV5d0BkjL+Ia8sgX9VvXtbqjf4NKK3nTgV9UUQ== +google-gax@^3.5.1: + version "3.5.2" + resolved "https://registry.yarnpkg.com/google-gax/-/google-gax-3.5.2.tgz#7c3ad61dbf366a55527b803caead276668b160d8" + integrity sha512-AyP53w0gHcWlzxm+jSgqCR3Xu4Ld7EpSjhtNBnNhzwwWaIUyphH9kBGNIEH+i4UGkTUXOY29K/Re8EiAvkBRGw== dependencies: "@grpc/grpc-js" "~1.7.0" "@grpc/proto-loader" "^0.7.0" @@ -4140,10 +4358,10 @@ google-gax@^3.0.1: object-hash "^3.0.0" proto3-json-serializer "^1.0.0" protobufjs "7.1.2" - protobufjs-cli "1.1.0" + protobufjs-cli "1.0.2" retry-request "^5.0.0" -google-p12-pem@^3.0.0, google-p12-pem@^3.0.3: +google-p12-pem@^3.0.3: version "3.0.3" resolved "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-3.0.3.tgz" integrity sha512-wS0ek4ZtFx/ACKYF3JhyGe5kzH7pgiQ7J5otlumqR9psmWMYc+U9cErKlCYVYHoUaidXHdZ2xbo34kB+S+24hA== @@ -4157,12 +4375,19 @@ google-p12-pem@^3.1.3: dependencies: node-forge "^1.0.0" -graceful-fs@4.2.10, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.6: +google-p12-pem@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/google-p12-pem/-/google-p12-pem-4.0.1.tgz#82841798253c65b7dc2a4e5fe9df141db670172a" + integrity sha512-WPkN4yGtz05WZ5EhtlxNDWPhC4JIic6G8ePitwUWy4l+XPVYec+a0j0Ts47PDtW59y3RwAhUd9/h9ZZ63px6RQ== + dependencies: + node-forge "^1.3.1" + +graceful-fs@4.2.10, graceful-fs@^4.1.9, graceful-fs@^4.2.6: version "4.2.10" - resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== -graceful-fs@^4.1.2, graceful-fs@^4.2.2, graceful-fs@^4.2.4: +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4: version "4.2.4" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz" integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== @@ -4172,16 +4397,6 @@ growl@1.10.5: resolved "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz" integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== -gtoken@^5.0.0: - version "5.0.3" - resolved "https://registry.npmjs.org/gtoken/-/gtoken-5.0.3.tgz" - integrity sha512-Nyd1wZCMRc2dj/mAD0LlfQLcAO06uKdpKJXvK85SGrF5+5+Bpfil9u/2aw35ltvEHjvl0h5FMKN5knEU+9JrOg== - dependencies: - gaxios "^3.0.0" - google-p12-pem "^3.0.0" - jws "^4.0.0" - mime "^2.2.0" - gtoken@^5.0.4: version "5.1.0" resolved "https://registry.npmjs.org/gtoken/-/gtoken-5.1.0.tgz" @@ -4201,6 +4416,15 @@ gtoken@^5.3.2: google-p12-pem "^3.1.3" jws "^4.0.0" +gtoken@^6.1.0: + version "6.1.2" + resolved "https://registry.yarnpkg.com/gtoken/-/gtoken-6.1.2.tgz#aeb7bdb019ff4c3ba3ac100bbe7b6e74dce0e8bc" + integrity sha512-4ccGpzz7YAr7lxrT2neugmXQ3hP9ho2gcaityLVkiUecAiwiy60Ii8gRbZeOsXV19fYaRjgBSshs8kXw+NKCPQ== + dependencies: + gaxios "^5.0.1" + google-p12-pem "^4.0.0" + jws "^4.0.0" + har-schema@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz" @@ -4251,11 +4475,6 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -hash-stream-validation@^0.2.2: - version "0.2.4" - resolved "https://registry.npmjs.org/hash-stream-validation/-/hash-stream-validation-0.2.4.tgz" - integrity sha512-Gjzu0Xn7IagXVkSu9cSFuK1fqzwtLwFhNhVL8IFJijRNMgUttFbBSIAzKuSIrsFMO1+g1RlsoN49zPIbwPDMGQ== - he@1.2.0, he@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz" @@ -4379,7 +4598,7 @@ http-proxy-agent@^4.0.0, http-proxy-agent@^4.0.1: http-proxy-agent@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== dependencies: "@tootallnate/once" "2" @@ -4465,10 +4684,10 @@ icss-utils@^4.0.0, icss-utils@^4.1.1: dependencies: postcss "^7.0.14" -idb@3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/idb/-/idb-3.0.2.tgz" - integrity sha512-+FLa/0sTXqyux0o6C+i2lOR0VoS60LU/jzUo5xjfY6+7sEEgy4Gz1O7yFBXvjd7N0NyIGWIRg8DcQSLEG+VSPw== +idb@7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/idb/-/idb-7.0.1.tgz#d2875b3a2f205d854ee307f6d196f246fea590a7" + integrity sha512-UUxlE7vGWK5RfB/fDwEGgRf84DY/ieqNha6msMV99UsEMQhJ1RwbCd8AYBj3QMgnE3VZnfQvm4oKVCJTYlqIgg== ieee754@^1.1.13: version "1.2.1" @@ -4892,6 +5111,18 @@ join-path@^1.1.1: url-join "0.0.1" valid-url "^1" +jose@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/jose/-/jose-2.0.6.tgz#894ba19169af339d3911be933f913dd02fc57c7c" + integrity sha512-FVoPY7SflDodE4lknJmbAHSUjLCzE2H1F6MS0RYKMQ8SR+lNccpMf8R4eqkNYyyUjR5qZReOzZo5C5YiHOCjjg== + dependencies: + "@panva/asn1.js" "^1.0.0" + +js-fns@^2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/js-fns/-/js-fns-2.5.2.tgz#c3b1c56a02ee88aa2e4c93ae762d1a41d0e1b041" + integrity sha512-4Rc2WqpY3qq4cvSCWNTwLqJKiPuU6842KxC+mULakpeLNToROC+6PJ2QAknGm0swOtq1MASLg+iMiHnf7ehaYA== + js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" @@ -4907,7 +5138,7 @@ js-yaml@3.14.0, js-yaml@^3.13.1: js2xmlparser@^4.0.2: version "4.0.2" - resolved "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz" + resolved "https://registry.yarnpkg.com/js2xmlparser/-/js2xmlparser-4.0.2.tgz#2a1fdf01e90585ef2ae872a01bc169c6a8d5e60a" integrity sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA== dependencies: xmlcreate "^2.0.4" @@ -4917,6 +5148,27 @@ jsbn@~0.1.0: resolved "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= +jsdoc@^3.6.3: + version "3.6.11" + resolved "https://registry.yarnpkg.com/jsdoc/-/jsdoc-3.6.11.tgz#8bbb5747e6f579f141a5238cbad4e95e004458ce" + integrity sha512-8UCU0TYeIYD9KeLzEcAu2q8N/mx9O3phAGl32nmHlE0LpaJL71mMkP4d+QE5zWfNt50qheHtOZ0qoxVrsX5TUg== + dependencies: + "@babel/parser" "^7.9.4" + "@types/markdown-it" "^12.2.3" + bluebird "^3.7.2" + catharsis "^0.9.0" + escape-string-regexp "^2.0.0" + js2xmlparser "^4.0.2" + klaw "^3.0.0" + markdown-it "^12.3.2" + markdown-it-anchor "^8.4.1" + marked "^4.0.10" + mkdirp "^1.0.4" + requizzle "^0.2.3" + strip-json-comments "^3.1.0" + taffydb "2.6.2" + underscore "~1.13.2" + jsdoc@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.0.tgz" @@ -5006,6 +5258,11 @@ json5@^2.1.2: dependencies: minimist "^1.2.5" +jsonc-parser@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" + integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== + jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz" @@ -5022,25 +5279,9 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" -jsonwebtoken@^8.5.1: - version "8.5.1" - resolved "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz" - integrity sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w== - dependencies: - jws "^3.2.2" - lodash.includes "^4.3.0" - lodash.isboolean "^3.0.3" - lodash.isinteger "^4.0.4" - lodash.isnumber "^3.0.3" - lodash.isplainobject "^4.0.6" - lodash.isstring "^4.0.1" - lodash.once "^4.0.0" - ms "^2.1.1" - semver "^5.6.0" - jsonwebtoken@^9.0.0: version "9.0.0" - resolved "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz" + resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz#d0faf9ba1cc3a56255fe49c0961a67e520c1926d" integrity sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw== dependencies: jws "^3.2.2" @@ -5076,6 +5317,18 @@ jwa@^2.0.0: ecdsa-sig-formatter "1.0.11" safe-buffer "^5.0.1" +jwks-rsa@^2.1.4: + version "2.1.5" + resolved "https://registry.yarnpkg.com/jwks-rsa/-/jwks-rsa-2.1.5.tgz#bb7bf8c5767836bc273bf5b27870066aca39c1bb" + integrity sha512-IODtn1SwEm7n6GQZnQLY0oxKDrMh7n/jRH1MzE8mlxWMrh2NnMyOsXTebu8vJ1qCpmuTJcL4DdiE0E4h8jnwsA== + dependencies: + "@types/express" "^4.17.14" + "@types/jsonwebtoken" "^8.5.9" + debug "^4.3.4" + jose "^2.0.6" + limiter "^1.1.5" + lru-memoizer "^2.1.4" + jws@^3.2.2: version "3.2.2" resolved "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz" @@ -5099,7 +5352,7 @@ kind-of@^6.0.2: klaw@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz" + resolved "https://registry.yarnpkg.com/klaw/-/klaw-3.0.0.tgz#b11bec9cf2492f06756d6e809ab73a2910259146" integrity sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g== dependencies: graceful-fs "^4.1.9" @@ -5143,6 +5396,11 @@ libsodium@^0.7.0: resolved "https://registry.npmjs.org/libsodium/-/libsodium-0.7.10.tgz" integrity sha512-eY+z7hDrDKxkAK+QKZVNv92A5KYkxfvIshtBJkmg5TSiCnYqZP3i9OO9whE79Pwgm4jGaoHgkM4ao/b9Cyu4zQ== +limiter@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/limiter/-/limiter-1.1.5.tgz#8f92a25b3b16c6131293a0cc834b4a838a2aa7c2" + integrity sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA== + lines-and-columns@^1.1.6: version "1.1.6" resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz" @@ -5150,7 +5408,7 @@ lines-and-columns@^1.1.6: linkify-it@^3.0.1: version "3.0.3" - resolved "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz" + resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.3.tgz#a98baf44ce45a550efb4d49c769d07524cc2fa2e" integrity sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ== dependencies: uc.micro "^1.0.1" @@ -5200,7 +5458,7 @@ loader-runner@^4.2.0: resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz" integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== -loader-utils@^1.0.2, loader-utils@^1.2.3: +loader-utils@^1.2.3: version "1.4.0" resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz" integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== @@ -5250,6 +5508,11 @@ lodash.camelcase@^4.3.0: resolved "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz" integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY= +lodash.clonedeep@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + integrity sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ== + lodash.defaults@^4.2.0: version "4.2.0" resolved "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz" @@ -5275,31 +5538,11 @@ lodash.flattendeep@^4.4.0: resolved "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz" integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= -lodash.includes@^4.3.0: - version "4.3.0" - resolved "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz" - integrity sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8= - -lodash.isboolean@^3.0.3: - version "3.0.3" - resolved "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz" - integrity sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY= - lodash.isequal@^4.5.0: version "4.5.0" resolved "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz" integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= -lodash.isinteger@^4.0.4: - version "4.0.4" - resolved "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz" - integrity sha1-YZwK89A/iwTDH1iChAt3sRzWg0M= - -lodash.isnumber@^3.0.3: - version "3.0.3" - resolved "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz" - integrity sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w= - lodash.isobject@^2.4.1: version "2.4.1" resolved "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.4.1.tgz" @@ -5312,16 +5555,6 @@ lodash.isplainobject@^4.0.6: resolved "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz" integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= -lodash.isstring@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz" - integrity sha1-1SfftUVuynzJu5XV2ur4i6VKVFE= - -lodash.once@^4.0.0: - version "4.1.1" - resolved "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz" - integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= - lodash.snakecase@^4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz" @@ -5334,7 +5567,7 @@ lodash.union@^4.6.0: lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.19, lodash@^4.17.21: version "4.17.21" - resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20: @@ -5385,7 +5618,7 @@ long@^4.0.0: long@^5.0.0: version "5.2.1" - resolved "https://registry.npmjs.org/long/-/long-5.2.1.tgz" + resolved "https://registry.yarnpkg.com/long/-/long-5.2.1.tgz#e27595d0083d103d2fa2c20c7699f8e0c92b897f" integrity sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A== lower-case@^2.0.1: @@ -5414,6 +5647,27 @@ lru-cache@^7.7.1: resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-7.14.0.tgz" integrity sha512-EIRtP1GrSJny0dqb50QXRUNBxHJhcpxHC++M5tD7RYbvLLn5KVWKsbyswSSqDuU15UFi3bgTQIY8nhDMeF6aDQ== +lru-cache@~4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e" + integrity sha512-uQw9OqphAGiZhkuPlpFGmdTU2tEuhxTourM/19qGJrxBPHAr/f8BT1a0i/lOclESnGatdJG/UCkP9kZB/Lh1iw== + dependencies: + pseudomap "^1.0.1" + yallist "^2.0.0" + +lru-memoizer@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/lru-memoizer/-/lru-memoizer-2.1.4.tgz#b864d92b557f00b1eeb322156a0409cb06dafac6" + integrity sha512-IXAq50s4qwrOBrXJklY+KhgZF+5y98PDaNo0gi/v2KQBFLyWr+JyFvijZXkGKjQj/h9c0OwoE+JZbwUXce76hQ== + dependencies: + lodash.clonedeep "^4.5.0" + lru-cache "~4.0.0" + +lunr@^2.3.9: + version "2.3.9" + resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" + integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow== + make-dir@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz" @@ -5457,12 +5711,12 @@ map-age-cleaner@^0.1.3: markdown-it-anchor@^8.4.1: version "8.6.6" - resolved "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.6.tgz" + resolved "https://registry.yarnpkg.com/markdown-it-anchor/-/markdown-it-anchor-8.6.6.tgz#4a12e358c9c2167ee28cb7a5f10e29d6f1ffd7ca" integrity sha512-jRW30YGywD2ESXDc+l17AiritL0uVaSnWsb26f+68qaW9zgbIIr1f4v2Nsvc0+s0Z2N3uX6t/yAw7BwCQ1wMsA== markdown-it@^12.3.2: version "12.3.2" - resolved "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90" integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg== dependencies: argparse "^2.0.1" @@ -5483,14 +5737,19 @@ marked-terminal@^5.1.1: node-emoji "^1.11.0" supports-hyperlinks "^2.2.0" -marked@^4.0.10, marked@^4.0.14: +marked@^4.0.10, marked@^4.2.4: + version "4.2.5" + resolved "https://registry.yarnpkg.com/marked/-/marked-4.2.5.tgz#979813dfc1252cc123a79b71b095759a32f42a5d" + integrity sha512-jPueVhumq7idETHkb203WDD4fMA3yV9emQ5vLwop58lu8bTclMghBWcYAavlDqIEMaisADinV1TooIFCfqOsYQ== + +marked@^4.0.14: version "4.2.12" resolved "https://registry.npmjs.org/marked/-/marked-4.2.12.tgz" integrity sha512-yr8hSKa3Fv4D3jdZmtMMPghgVt6TWbk86WQaWhDloQjRSQhMMYCAro7jP7VDJrjjdV8pxVxMssXS8B8Y5DZ5aw== mdurl@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz" + resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== media-typer@0.3.0: @@ -5612,6 +5871,11 @@ mime@^2.5.2: resolved "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz" integrity sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg== +mime@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-3.0.0.tgz#b374550dca3a0c18443b0c950a6a58f1931cf7a7" + integrity sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A== + mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" @@ -5638,10 +5902,10 @@ minimatch@3.0.4, minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimatch@^5.0.1: - version "5.1.0" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz" - integrity sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg== +minimatch@^5.0.1, minimatch@^5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.2.tgz#0939d7d6f0898acbd1508abe534d1929368a8fff" + integrity sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg== dependencies: brace-expansion "^2.0.1" @@ -5867,10 +6131,12 @@ node-emoji@^1.11.0: dependencies: lodash "^4.17.21" -node-fetch@2.6.1, node-fetch@^2.2.0, node-fetch@^2.3.0, node-fetch@^2.6.1: - version "2.6.1" - resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== +node-fetch@2.6.7, node-fetch@^2.6.7: + version "2.6.7" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" + integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== + dependencies: + whatwg-url "^5.0.0" node-fetch@^1.0.1: version "1.7.3" @@ -5880,21 +6146,19 @@ node-fetch@^1.0.1: encoding "^0.1.11" is-stream "^1.0.1" -node-fetch@^2.6.7: - version "2.6.7" - resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== - dependencies: - whatwg-url "^5.0.0" +node-fetch@^2.3.0, node-fetch@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== node-forge@^0.10.0: version "0.10.0" resolved "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz" integrity sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA== -node-forge@^1.0.0: +node-forge@^1.0.0, node-forge@^1.3.1: version "1.3.1" - resolved "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz" + resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA== node-gyp@^9.0.0: @@ -5981,7 +6245,7 @@ object-assign@^4: object-hash@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz" + resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-3.0.0.tgz#73f97f753e7baffc0e2cc9d6e079079744ac82e9" integrity sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw== object-inspect@^1.7.0, object-inspect@^1.8.0: @@ -6578,11 +6842,6 @@ promise-inflight@^1.0.1: resolved "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz" integrity sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g== -promise-polyfill@8.1.3: - version "8.1.3" - resolved "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.1.3.tgz" - integrity sha512-MG5r82wBzh7pSKDRa9y+vllNHz3e3d4CNj1PQE4BQYxLme0gKYYBm9YENq+UkEikyZ0XbiGWxYlVw3Rl9O/U8g== - promise-retry@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz" @@ -6603,6 +6862,22 @@ proto3-json-serializer@^1.0.0: dependencies: protobufjs "^7.0.0" +protobufjs-cli@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/protobufjs-cli/-/protobufjs-cli-1.0.2.tgz#905fc49007cf4aaf3c45d5f250eb294eedeea062" + integrity sha512-cz9Pq9p/Zs7okc6avH20W7QuyjTclwJPgqXG11jNaulfS3nbVisID8rC+prfgq0gbZE0w9LBFd1OKFF03kgFzg== + dependencies: + chalk "^4.0.0" + escodegen "^1.13.0" + espree "^9.0.0" + estraverse "^5.1.0" + glob "^8.0.0" + jsdoc "^3.6.3" + minimist "^1.2.0" + semver "^7.1.2" + tmp "^0.2.1" + uglify-js "^3.7.7" + protobufjs-cli@1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/protobufjs-cli/-/protobufjs-cli-1.1.0.tgz" @@ -6637,29 +6912,10 @@ protobufjs@7.1.2, protobufjs@^7.0.0: "@types/node" ">=13.7.0" long "^5.0.0" -protobufjs@^6.10.2: - version "6.10.2" - resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.2.tgz" - integrity sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ== - dependencies: - "@protobufjs/aspromise" "^1.1.2" - "@protobufjs/base64" "^1.1.2" - "@protobufjs/codegen" "^2.0.4" - "@protobufjs/eventemitter" "^1.1.0" - "@protobufjs/fetch" "^1.1.0" - "@protobufjs/float" "^1.0.2" - "@protobufjs/inquire" "^1.1.0" - "@protobufjs/path" "^1.1.2" - "@protobufjs/pool" "^1.1.0" - "@protobufjs/utf8" "^1.1.0" - "@types/long" "^4.0.1" - "@types/node" "^13.7.0" - long "^4.0.0" - -protobufjs@^6.8.6, protobufjs@^6.9.0: - version "6.10.1" - resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.1.tgz" - integrity sha512-pb8kTchL+1Ceg4lFd5XUpK8PdWacbvV5SK2ULH2ebrYtl4GjJmS24m6CKME67jzV53tbJxHlnNOSqQHbTsR9JQ== +protobufjs@^6.11.3: + version "6.11.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74" + integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== dependencies: "@protobufjs/aspromise" "^1.1.2" "@protobufjs/base64" "^1.1.2" @@ -6672,7 +6928,7 @@ protobufjs@^6.8.6, protobufjs@^6.9.0: "@protobufjs/pool" "^1.1.0" "@protobufjs/utf8" "^1.1.0" "@types/long" "^4.0.1" - "@types/node" "^13.7.0" + "@types/node" ">=13.7.0" long "^4.0.0" proxy-addr@~2.0.5: @@ -6715,6 +6971,11 @@ prr@~1.0.1: resolved "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz" integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= +pseudomap@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ== + psl@^1.1.28: version "1.8.0" resolved "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz" @@ -6728,15 +6989,6 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" -pumpify@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/pumpify/-/pumpify-2.0.1.tgz" - integrity sha512-m7KOje7jZxrmutanlkS1daj1dS6z6BgslzOXmcSEpIlCxM3VJH7lG5QLeck/6hgF6F4crFf01UtQmNsJfweTAw== - dependencies: - duplexify "^4.1.1" - inherits "^2.0.3" - pump "^3.0.0" - punycode@^1.3.2: version "1.4.1" resolved "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz" @@ -6995,7 +7247,7 @@ require-main-filename@^2.0.0: requizzle@^0.2.3: version "0.2.4" - resolved "https://registry.npmjs.org/requizzle/-/requizzle-0.2.4.tgz" + resolved "https://registry.yarnpkg.com/requizzle/-/requizzle-0.2.4.tgz#319eb658b28c370f0c20f968fa8ceab98c13d27c" integrity sha512-JRrFk1D4OQ4SqovXOgdav+K8EAhSB/LJZqCz8tbX0KObcdeM15Ss59ozWMBWmmINMagCwmqn4ZNryUGpBsl6Jw== dependencies: lodash "^4.17.21" @@ -7050,31 +7302,24 @@ ret@~0.1.10: resolved "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== -retry-request@^4.0.0, retry-request@^4.1.1: - version "4.1.3" - resolved "https://registry.npmjs.org/retry-request/-/retry-request-4.1.3.tgz" - integrity sha512-QnRZUpuPNgX0+D1xVxul6DbJ9slvo4Rm6iV/dn63e048MvGbUZiKySVt6Tenp04JqmchxjiLltGerOJys7kJYQ== - dependencies: - debug "^4.1.1" - retry-request@^5.0.0: version "5.0.2" - resolved "https://registry.npmjs.org/retry-request/-/retry-request-5.0.2.tgz" + resolved "https://registry.yarnpkg.com/retry-request/-/retry-request-5.0.2.tgz#143d85f90c755af407fcc46b7166a4ba520e44da" integrity sha512-wfI3pk7EE80lCIXprqh7ym48IHYdwmAAzESdbU8Q9l7pnRCk9LEhpbOTNKjz6FARLm/Bl5m+4F0ABxOkYUujSQ== dependencies: debug "^4.1.1" extend "^3.0.2" +retry@0.13.1, retry@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" + integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== + retry@^0.12.0: version "0.12.0" resolved "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz" integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== -retry@^0.13.1: - version "0.13.1" - resolved "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz" - integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== - reusify@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" @@ -7194,12 +7439,12 @@ semver-regex@^2.0.0: resolved "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz" integrity sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw== -semver@^5.3.0, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1: +semver@^5.3.0, semver@^5.5.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: +semver@^6.0.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== @@ -7211,9 +7456,9 @@ semver@^7.0.0: dependencies: lru-cache "^6.0.0" -semver@^7.1.2, semver@^7.3.7, semver@^7.3.8: +semver@^7.1.2, semver@^7.3.4, semver@^7.3.7, semver@^7.3.8: version "7.3.8" - resolved "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== dependencies: lru-cache "^6.0.0" @@ -7341,6 +7586,15 @@ shebang-regex@^3.0.0: resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +shiki@^0.11.1: + version "0.11.1" + resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.11.1.tgz#df0f719e7ab592c484d8b73ec10e215a503ab8cc" + integrity sha512-EugY9VASFuDqOexOgXR18ZV+TbFrQHeCpEYaXamO+SZlsnT/2LxuLBX25GGtIrwaEVFXUAbUQ601SWE2rMwWHA== + dependencies: + jsonc-parser "^3.0.0" + vscode-oniguruma "^1.6.1" + vscode-textmate "^6.0.0" + side-channel@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz" @@ -7395,11 +7649,6 @@ smart-buffer@^4.2.0: resolved "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz" integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== -snakeize@^0.1.0: - version "0.1.0" - resolved "https://registry.npmjs.org/snakeize/-/snakeize-0.1.0.tgz" - integrity sha1-EMCI2LWOsHazIpu1oE4jLOEmQi0= - socks-proxy-agent@5, socks-proxy-agent@^5.0.0: version "5.0.1" resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz" @@ -7431,7 +7680,7 @@ source-list-map@^2.0.0, source-list-map@^2.0.1: resolved "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz" integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== -source-map-support@^0.5.17, source-map-support@~0.5.12, source-map-support@~0.5.19: +source-map-support@~0.5.12, source-map-support@~0.5.19: version "0.5.19" resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz" integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== @@ -7496,7 +7745,7 @@ stream-chain@^2.2.4: resolved "https://registry.npmjs.org/stream-chain/-/stream-chain-2.2.4.tgz" integrity sha512-9lsl3YM53V5N/I1C2uJtc3Kavyi3kNYN83VkKb/bMWRk7D9imiFyUPYa0PoZbLohSVOX1mYE9YsmwObZUsth6Q== -stream-events@^1.0.1, stream-events@^1.0.4, stream-events@^1.0.5: +stream-events@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/stream-events/-/stream-events-1.0.5.tgz" integrity sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg== @@ -7515,11 +7764,6 @@ stream-shift@^1.0.0: resolved "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz" integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== -streamsearch@0.1.2: - version "0.1.2" - resolved "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz" - integrity sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo= - string-argv@0.3.1: version "0.3.1" resolved "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz" @@ -7745,6 +7989,11 @@ supports-hyperlinks@^2.2.0: has-flag "^4.0.0" supports-color "^7.0.0" +taffydb@2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/taffydb/-/taffydb-2.6.2.tgz#7cbcb64b5a141b6a2efc2c5d2c67b4e150b2a268" + integrity sha512-y3JaeRSplks6NYQuCOj3ZFMO3j60rTwbuKCvZxsAraGYH2epusatvZ0baZYA01WsGqJBq/Dl6vOrMUJqyMj8kA== + tapable@^1.0.0: version "1.1.3" resolved "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz" @@ -7786,16 +8035,16 @@ tcp-port-used@^1.0.2: debug "4.3.1" is2 "^2.0.6" -teeny-request@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/teeny-request/-/teeny-request-7.0.0.tgz" - integrity sha512-kWD3sdGmIix6w7c8ZdVKxWq+3YwVPGWz+Mq0wRZXayEKY/YHb63b8uphfBzcFDmyq8frD9+UTc3wLyOhltRbtg== +teeny-request@^8.0.0: + version "8.0.2" + resolved "https://registry.yarnpkg.com/teeny-request/-/teeny-request-8.0.2.tgz#c06a75101cf782788ba8f9a2ed5f2ac84c1c4e15" + integrity sha512-34pe0a4zASseXZCKdeTiIZqSKA8ETHb1EwItZr01PAR3CLPojeAKgSjzeNS4373gi59hNulyDrPKEbh2zO9sCg== dependencies: - http-proxy-agent "^4.0.0" + http-proxy-agent "^5.0.0" https-proxy-agent "^5.0.0" - node-fetch "^2.2.0" + node-fetch "^2.6.1" stream-events "^1.0.5" - uuid "^8.0.0" + uuid "^9.0.0" terser-webpack-plugin@^5.1.1: version "5.1.1" @@ -7827,6 +8076,11 @@ terser@^5.5.1: source-map "~0.7.2" source-map-support "~0.5.19" +text-decoding@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/text-decoding/-/text-decoding-1.0.0.tgz#38a5692d23b5c2b12942d6e245599cb58b1bc52f" + integrity sha512-/0TJD42KDnVwKmDK6jj3xP7E2MG7SHAOG4tyTgyUCRPdHwvkquYNLEQltmdMa3owq3TkddCVcTsoctJI8VQNKA== + text-hex@1.0.x: version "1.0.0" resolved "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz" @@ -7851,7 +8105,7 @@ tmp@^0.0.33: tmp@^0.2.1: version "0.2.1" - resolved "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" integrity sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ== dependencies: rimraf "^3.0.0" @@ -7890,8 +8144,8 @@ toxic@^1.0.0: tr46@~0.0.3: version "0.0.3" - resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== "traverse@>=0.3.0 <0.4": version "0.3.9" @@ -7908,27 +8162,33 @@ triple-beam@^1.2.0, triple-beam@^1.3.0: resolved "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz" integrity sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw== -ts-loader@^8.0.3: - version "8.0.3" - resolved "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.3.tgz" - integrity sha512-wsqfnVdB7xQiqhqbz2ZPLGHLPZbHVV5Qn/MNFZkCFxRU1miDyxKORucDGxKtsQJ63Rfza0udiUxWF5nHY6bpdQ== +ts-loader@^9.4.2: + version "9.4.2" + resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.4.2.tgz#80a45eee92dd5170b900b3d00abcfa14949aeb78" + integrity sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA== dependencies: - chalk "^2.3.0" - enhanced-resolve "^4.0.0" - loader-utils "^1.0.2" + chalk "^4.1.0" + enhanced-resolve "^5.0.0" micromatch "^4.0.0" - semver "^6.0.0" - -ts-node@^9.1.1: - version "9.1.1" - resolved "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz" - integrity sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg== - dependencies: + semver "^7.3.4" + +ts-node@^10.9.1: + version "10.9.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" arg "^4.1.0" create-require "^1.1.0" diff "^4.0.1" make-error "^1.1.1" - source-map-support "^0.5.17" + v8-compile-cache-lib "^3.0.1" yn "3.1.1" tsconfig-paths-webpack-plugin@^3.3.0: @@ -7950,7 +8210,7 @@ tsconfig-paths@^3.4.0, tsconfig-paths@^3.9.0: minimist "^1.2.0" strip-bom "^3.0.0" -tslib@^1.10.0, tslib@^1.11.1, tslib@^1.13.0, tslib@^1.8.1, tslib@^1.9.0: +tslib@^1.10.0, tslib@^1.13.0, tslib@^1.8.1, tslib@^1.9.0: version "1.13.0" resolved "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz" integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q== @@ -7960,11 +8220,16 @@ tslib@^1.9.3: resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.1, tslib@^2.1.0: +tslib@^2.0.1: version "2.3.1" resolved "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== +tslib@^2.1.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" + integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== + tslint@~6.1.3: version "6.1.3" resolved "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz" @@ -8050,15 +8315,30 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typesaurus@^7.1.0: - version "7.1.0" - resolved "https://registry.npmjs.org/typesaurus/-/typesaurus-7.1.0.tgz" - integrity sha512-2Az/QN4FprxtT/6Grr3gFb8v6dY1NkSkGvEt6l0b4/cY28p6HmNY/VaZP9p9wQP2GdU8lAbOi+Ip6j1gehCarA== +typedoc@^0.23.23: + version "0.23.23" + resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.23.23.tgz#9cf95b03d2d40031d8978b55e88b0b968d69f512" + integrity sha512-cg1YQWj+/BU6wq74iott513U16fbrPCbyYs04PHZgvoKJIc6EY4xNobyDZh4KMfRGW8Yjv6wwIzQyoqopKOUGw== + dependencies: + lunr "^2.3.9" + marked "^4.2.4" + minimatch "^5.1.1" + shiki "^0.11.1" -typescript@^4.0.2: - version "4.0.2" - resolved "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz" - integrity sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ== +typeroo@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/typeroo/-/typeroo-0.9.0.tgz#34886e8529423462cd876c8090745b578f83cc9e" + integrity sha512-dVYoqIFk1OeKuDU3pwdQEsUuTosrf3oIHzXBm+/YaemahBe6iDUZl08MStcyVBPplOfK8Hp4CY1nHZEClqNsuw== + +typesaurus@10.0.0-alpha.40, typesaurus@^10.0.0-alpha.40: + version "10.0.0-alpha.40" + resolved "https://registry.yarnpkg.com/typesaurus/-/typesaurus-10.0.0-alpha.40.tgz#022bb1a90a01cc4ee05a35c1c6ccadbd1232afae" + integrity sha512-tzfcGzXOJmOXvPBie8MZVCvbf0qV5vKZgOiYtaZkGJW0SmAZmzQeuxItcS7O9/T+AtBYOzwuhRCqKUIHN4u5VA== + +typescript@^4.9.4: + version "4.9.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78" + integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg== uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" @@ -8208,6 +8488,16 @@ uuid@^8.0.0, uuid@^8.3.2: resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +uuid@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5" + integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg== + +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + v8-compile-cache@^2.2.0: version "2.2.0" resolved "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz" @@ -8240,6 +8530,16 @@ vm2@^3.9.3: acorn "^8.7.0" acorn-walk "^8.2.0" +vscode-oniguruma@^1.6.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz#439bfad8fe71abd7798338d1cd3dc53a8beea94b" + integrity sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA== + +vscode-textmate@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-6.0.0.tgz#a3777197235036814ac9a92451492f2748589210" + integrity sha512-gu73tuZfJgu+mvCSy4UZwd2JXykjK9zAZsfmDeut5dx/1a7FeTk0XwJsSuqQn+cuMCGVbIBfl+s53X4T19DnzQ== + watchpack@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/watchpack/-/watchpack-2.1.0.tgz" @@ -8257,8 +8557,8 @@ wcwidth@^1.0.1: webidl-conversions@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== webpack-cli@^4.1.0: version "4.3.1" @@ -8380,11 +8680,6 @@ websocket-extensions@>=0.1.1: resolved "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz" integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== -whatwg-fetch@2.0.4: - version "2.0.4" - resolved "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz" - integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== - whatwg-fetch@>=0.10.0: version "3.4.1" resolved "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.4.1.tgz" @@ -8397,8 +8692,8 @@ whatwg-fetch@^3.4.1: whatwg-url@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== dependencies: tr46 "~0.0.3" webidl-conversions "^3.0.0" @@ -8506,7 +8801,7 @@ wrap-ansi@^6.2.0: wrap-ansi@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== dependencies: ansi-styles "^4.0.0" @@ -8540,14 +8835,9 @@ xdg-basedir@^4.0.0: xmlcreate@^2.0.4: version "2.0.4" - resolved "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz" + resolved "https://registry.yarnpkg.com/xmlcreate/-/xmlcreate-2.0.4.tgz#0c5ab0f99cdd02a81065fa9cd8f8ae87624889be" integrity sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg== -xmlhttprequest@1.8.0: - version "1.8.0" - resolved "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz" - integrity sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw= - xregexp@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz" @@ -8565,9 +8855,14 @@ y18n@^4.0.0: y18n@^5.0.5: version "5.0.8" - resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== +yallist@^2.0.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A== + yallist@^3.0.2: version "3.1.1" resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz" @@ -8591,14 +8886,6 @@ yargs-parser@13.1.2, yargs-parser@^13.1.2: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^18.1.2: - version "18.1.3" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz" - integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - yargs-parser@^20.2.2: version "20.2.4" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz" @@ -8630,23 +8917,6 @@ yargs@13.3.2: y18n "^4.0.0" yargs-parser "^13.1.2" -yargs@^15.3.1: - version "15.4.1" - resolved "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz" - integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== - dependencies: - cliui "^6.0.0" - decamelize "^1.2.0" - find-up "^4.1.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^4.2.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^18.1.2" - yargs@^16.2.0: version "16.2.0" resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" From 3533e8c10790bc87844f7bd5ba81922f9415e21e Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Thu, 29 Dec 2022 09:56:32 +0800 Subject: [PATCH 02/36] Upgrade webpack packages --- package.json | 42 +- yarn.lock | 1606 +++++++++++++++++++++++--------------------------- 2 files changed, 764 insertions(+), 884 deletions(-) diff --git a/package.json b/package.json index b2084529..7f99d937 100644 --- a/package.json +++ b/package.json @@ -20,41 +20,41 @@ "@sentry/browser": "^5.30.0", "@sentry/tracing": "^5.30.0", "@switcher/preact": "^1.1.2", - "@types/assets-webpack-plugin": "^6.1.0", - "@types/copy-webpack-plugin": "^6.4.0", + "@types/assets-webpack-plugin": "^7.1.0", + "@types/copy-webpack-plugin": "^10.1.0", "@types/cors": "^2.8.7", "@types/enzyme": "^3.10.8", "@types/lodash": "^4.14.167", - "@types/mini-css-extract-plugin": "^1.2.2", + "@types/mini-css-extract-plugin": "^2.5.1", "@types/mocha": "^8.2.0", "@types/node": "^14.14.32", "@types/power-assert": "^1.5.3", "@types/prismjs": "^1.16.3", "@types/remarkable": "^2.0.0", - "@types/webpack-dev-middleware": "^4.1.0", - "@types/webpack-hot-middleware": "^2.25.3", - "@types/webpack-node-externals": "^2.5.0", + "@types/webpack-dev-middleware": "^5.3.0", + "@types/webpack-hot-middleware": "^2.25.6", + "@types/webpack-node-externals": "^2.5.3", "@typesaurus/preact": "6.0.0-alpha.4", - "assets-webpack-plugin": "^7.0.0", + "assets-webpack-plugin": "^7.1.1", "body-parser": "^1.19.0", - "copy-webpack-plugin": "^7.0.0", + "copy-webpack-plugin": "^11.0.0", "cors": "^2.8.5", - "css-loader": "^3.0.0", + "css-loader": "^6.7.3", "date-fns": "^2.16.1", "enzyme": "^3.11.0", "enzyme-adapter-preact-pure": "^2.2.3", "express": "^4.17.1", - "file-loader": "^6.1.0", + "file-loader": "^6.2.0", "firebase": "^9.15.0", "firebase-admin": "^11.4.1", "firebase-functions": "^4.1.1", - "html-webpack-plugin": "^5.2.0", + "html-webpack-plugin": "^5.5.0", "husky": "^4.3.0", "isomorphic-fetch": "^2.2.1", "json-bond": "^0.1.0", "lint-staged": "^10.3.0", "lodash": "^4.17.20", - "mini-css-extract-plugin": "^1.3.9", + "mini-css-extract-plugin": "^2.7.2", "mocha": "^8.2.1", "null-loader": "^4.0.1", "power-assert": "^1.6.1", @@ -64,21 +64,21 @@ "prismjs": "^1.23.0", "remarkable": "^2.0.1", "reset.css": "^2.0.2", - "style-loader": "^1.2.1", + "style-loader": "^3.3.1", "ts-loader": "^9.4.2", "ts-node": "^10.9.1", - "tsconfig-paths": "^3.9.0", - "tsconfig-paths-webpack-plugin": "^3.3.0", + "tsconfig-paths": "^4.1.1", + "tsconfig-paths-webpack-plugin": "^4.0.0", "tslint": "~6.1.3", "typeroo": "^0.9.0", "typesaurus": "10.0.0-alpha.40", "typescript": "^4.9.4", - "webpack": "^5.24.2", - "webpack-cli": "^4.1.0", - "webpack-dev-middleware": "^4.1.0", - "webpack-hot-middleware": "^2.25.0", - "webpack-merge": "^5.7.3", - "webpack-node-externals": "^2.5.2", + "webpack": "^5.75.0", + "webpack-cli": "^5.0.1", + "webpack-dev-middleware": "^6.0.1", + "webpack-hot-middleware": "^2.25.3", + "webpack-merge": "^5.8.0", + "webpack-node-externals": "^3.0.0", "yarn": "^1.22.10" }, "husky": { diff --git a/yarn.lock b/yarn.lock index 203ff48d..9e0d8a0f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -638,12 +638,34 @@ protobufjs "^7.0.0" yargs "^16.2.0" -"@jridgewell/resolve-uri@^3.0.3": +"@jridgewell/gen-mapping@^0.3.0": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" + integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== + dependencies: + "@jridgewell/set-array" "^1.0.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/resolve-uri@3.1.0", "@jridgewell/resolve-uri@^3.0.3": version "3.1.0" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== -"@jridgewell/sourcemap-codec@^1.4.10": +"@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== + +"@jridgewell/source-map@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.2.tgz#f45351aaed4527a298512ec72f81040c998580fb" + integrity sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw== + dependencies: + "@jridgewell/gen-mapping" "^0.3.0" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10": version "1.4.14" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== @@ -656,6 +678,14 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@jridgewell/trace-mapping@^0.3.14", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.17" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" + integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== + dependencies: + "@jridgewell/resolve-uri" "3.1.0" + "@jridgewell/sourcemap-codec" "1.4.14" + "@jsdevtools/ono@^7.1.3": version "7.1.3" resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz" @@ -921,17 +951,14 @@ resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== -"@types/anymatch@*": - version "1.3.1" - resolved "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz" - integrity sha512-/+CRPXpBDpo2RK9C68N3b2cOvO0Cf5B9aPijHsoDQTHivnGSObdOF2BRQOYjojWTDy6nQvMjmqRXIxH55VjxxA== - -"@types/assets-webpack-plugin@^6.1.0": - version "6.1.0" - resolved "https://registry.npmjs.org/@types/assets-webpack-plugin/-/assets-webpack-plugin-6.1.0.tgz" - integrity sha512-8JaEdOtG8POLO29Udlv4kzKfFFQzpmGKEY23kagRwVftbc193KawAFN9qmk9IIKI/ffali17L6MPspREIyjDKw== +"@types/assets-webpack-plugin@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@types/assets-webpack-plugin/-/assets-webpack-plugin-7.1.0.tgz#7ac1f701bad93168400a17e20fc55296dc2937e4" + integrity sha512-0rLRpCPbYaZEfFGnarPhF85sH7dbHXxS+vwQvuYa+uF6Yy5ldX43YpiU/4W9stDKno+xxhsySktGbgjWenoYYQ== dependencies: - "@types/webpack" "*" + "@types/node" "*" + tapable "^2.2.0" + webpack "^5" "@types/body-parser@*": version "1.19.0" @@ -960,12 +987,12 @@ dependencies: "@types/node" "*" -"@types/copy-webpack-plugin@^6.4.0": - version "6.4.0" - resolved "https://registry.npmjs.org/@types/copy-webpack-plugin/-/copy-webpack-plugin-6.4.0.tgz" - integrity sha512-f5mQG5c7xH3zLGrEmKgzLLFSGNB7Y4+4a+a1X4DvjgfbTEWEZUNNXUqGs5tBVCtb5qKPzm2z+6ixX3xirWmOCg== +"@types/copy-webpack-plugin@^10.1.0": + version "10.1.0" + resolved "https://registry.yarnpkg.com/@types/copy-webpack-plugin/-/copy-webpack-plugin-10.1.0.tgz#5e7e5d44f58530bbb0e39cc01f83fc91aa484387" + integrity sha512-Dk0NUW3X6hVQdkH2n9R7NejjPNCocZBiv8XF8Ac5su2d6EKzCcG/yWDwnWGrEsAWvogoADJyUKULwncx0G9Jkg== dependencies: - "@types/webpack" "*" + copy-webpack-plugin "*" "@types/cors@^2.8.5": version "2.8.13" @@ -1001,10 +1028,10 @@ "@types/cheerio" "*" "@types/react" "*" -"@types/eslint-scope@^3.7.0": - version "3.7.0" - resolved "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.0.tgz" - integrity sha512-O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw== +"@types/eslint-scope@^3.7.3": + version "3.7.4" + resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.4.tgz#37fc1223f0786c39627068a12e94d6e6fc61de16" + integrity sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA== dependencies: "@types/eslint" "*" "@types/estree" "*" @@ -1022,10 +1049,10 @@ resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.45.tgz" integrity sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g== -"@types/estree@^0.0.46": - version "0.0.46" - resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.46.tgz" - integrity sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg== +"@types/estree@^0.0.51": + version "0.0.51" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" + integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== "@types/express-serve-static-core@*": version "4.17.12" @@ -1079,20 +1106,20 @@ resolved "https://registry.npmjs.org/@types/highlight.js/-/highlight.js-9.12.4.tgz" integrity sha512-t2szdkwmg2JJyuCM20e8kR2X59WCE5Zkl4bzm1u1Oukjm79zpbiAv+QjnwLnuuV0WHEcX2NgUItu0pAMKuOPww== -"@types/html-minifier-terser@^5.0.0": - version "5.1.0" - resolved "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-5.1.0.tgz" - integrity sha512-iYCgjm1dGPRuo12+BStjd1HiVQqhlRhWDOQigNxn023HcjnhsiFz9pc6CzJj4HwDCSQca9bxTL4PxJDbkdm3PA== +"@types/html-minifier-terser@^6.0.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz#4fc33a00c1d0c16987b1a20cf92d20614c55ac35" + integrity sha512-oh/6byDPnL1zeNXFrDXFLyZjkr1MsBG667IM792caf1L2UPOOMf65NFzjUH/ltyfwjAGfs1rsX1eftK0jC/KIg== -"@types/json-schema@*", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6": +"@types/json-schema@*", "@types/json-schema@^7.0.6": version "7.0.6" resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz" integrity sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw== -"@types/json5@^0.0.29": - version "0.0.29" - resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz" - integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= +"@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": + version "7.0.11" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" + integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== "@types/jsonwebtoken@^8.5.9": version "8.5.9" @@ -1134,12 +1161,12 @@ resolved "https://registry.npmjs.org/@types/mime/-/mime-2.0.3.tgz" integrity sha512-Jus9s4CDbqwocc5pOAnh8ShfrnMcPHuJYzVcSUU7lrh8Ni5HuIqX3oilL86p3dlTrk0LzHRCgA/GQ7uNCw6l2Q== -"@types/mini-css-extract-plugin@^1.2.2": - version "1.2.2" - resolved "https://registry.npmjs.org/@types/mini-css-extract-plugin/-/mini-css-extract-plugin-1.2.2.tgz" - integrity sha512-EoHBJ4rcrd5j7weAFE4yU1gxedx53EFCWKso03G7DW0h2YvtwjKYz/NnuFHudcQDI1HpTLqoQFTwEgfJxygYCw== +"@types/mini-css-extract-plugin@^2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@types/mini-css-extract-plugin/-/mini-css-extract-plugin-2.5.1.tgz#c2ab735b353864019a148251e699b7038443bc77" + integrity sha512-evjjtJttaUexgg3au9ZJFy76tV9mySwX3a4Jl82BuormBYluWLRt0xk2urWrhOdPgDWzulRFyotwYOJTmkSgKw== dependencies: - "@types/webpack" "*" + mini-css-extract-plugin "*" "@types/mocha@^8.2.0": version "8.2.0" @@ -1223,66 +1250,29 @@ "@types/express-serve-static-core" "*" "@types/mime" "*" -"@types/source-list-map@*": - version "0.1.2" - resolved "https://registry.npmjs.org/@types/source-list-map/-/source-list-map-0.1.2.tgz" - integrity sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA== - -"@types/tapable@*": - version "1.0.6" - resolved "https://registry.npmjs.org/@types/tapable/-/tapable-1.0.6.tgz" - integrity sha512-W+bw9ds02rAQaMvaLYxAbJ6cvguW/iJXNT6lTssS1ps6QdrMKttqEAMEG/b5CR8TZl3/L7/lH0ZV5nNR1LXikA== - -"@types/uglify-js@*": - version "3.13.0" - resolved "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.13.0.tgz" - integrity sha512-EGkrJD5Uy+Pg0NUR8uA4bJ5WMfljyad0G+784vLCNUkD+QwOJXUbBYExXfVGf7YtyzdQp3L/XMYcliB987kL5Q== - dependencies: - source-map "^0.6.1" - -"@types/webpack-dev-middleware@^4.1.0": - version "4.1.0" - resolved "https://registry.npmjs.org/@types/webpack-dev-middleware/-/webpack-dev-middleware-4.1.0.tgz" - integrity sha512-cG/RhZcpAmVCQi7sGMc7bFyYGA2Yzu/+pWxTJezs7z2asjGZJ7j+0/+t39AuxQQbEuABWgYAwolg/DysGEcLyA== +"@types/webpack-dev-middleware@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@types/webpack-dev-middleware/-/webpack-dev-middleware-5.3.0.tgz#4d65e1b6058e460bd6cfa3b45320e86654890c1c" + integrity sha512-SklLlklFBfTyIXo1iWXxzeytjlysWfj5QfIcRJrCc7MgzuCjnZOHXviQwe81iFGq9ZkCUXAg2fpbZdHhj5lSWA== dependencies: - "@types/connect" "*" - "@types/webpack" "*" + webpack-dev-middleware "*" -"@types/webpack-hot-middleware@^2.25.3": - version "2.25.3" - resolved "https://registry.npmjs.org/@types/webpack-hot-middleware/-/webpack-hot-middleware-2.25.3.tgz" - integrity sha512-zGkTzrwQnhSadIXGYGZLu7tpXQwn4+6y9nGeql+5UeRtW/k54Jp4SnzB0Qw00ednw0ZFoZOvqTFfXSbFXohc5Q== +"@types/webpack-hot-middleware@^2.25.6": + version "2.25.6" + resolved "https://registry.yarnpkg.com/@types/webpack-hot-middleware/-/webpack-hot-middleware-2.25.6.tgz#4336abd668dc73284a777907cfd00147e794354a" + integrity sha512-1Q9ClNvZR30HIsEAHYQL3bXJK1K7IsrqjGMTfIureFjphsGOZ3TkbeoCupbCmi26pSLjVTPHp+pFrJNpOkBSVg== dependencies: "@types/connect" "*" - "@types/webpack" "*" - -"@types/webpack-node-externals@^2.5.0": - version "2.5.0" - resolved "https://registry.npmjs.org/@types/webpack-node-externals/-/webpack-node-externals-2.5.0.tgz" - integrity sha512-KaWfhUQlpWknM/CMBKhV7i0vxX/N2xEy3WeaE500s4ZNxC4nLnKB+0F3gD3Fg+5octPq0nn8ZlfFR/P3dSkXpw== - dependencies: - "@types/webpack" "*" - -"@types/webpack-sources@*": - version "2.1.0" - resolved "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-2.1.0.tgz" - integrity sha512-LXn/oYIpBeucgP1EIJbKQ2/4ZmpvRl+dlrFdX7+94SKRUV3Evy3FsfMZY318vGhkWUS5MPhtOM3w1/hCOAOXcg== - dependencies: - "@types/node" "*" - "@types/source-list-map" "*" - source-map "^0.7.3" + tapable "^2.2.0" + webpack "^5" -"@types/webpack@*": - version "4.41.26" - resolved "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.26.tgz" - integrity sha512-7ZyTfxjCRwexh+EJFwRUM+CDB2XvgHl4vfuqf1ZKrgGvcS5BrNvPQqJh3tsZ0P6h6Aa1qClVHaJZszLPzpqHeA== +"@types/webpack-node-externals@^2.5.3": + version "2.5.3" + resolved "https://registry.yarnpkg.com/@types/webpack-node-externals/-/webpack-node-externals-2.5.3.tgz#921783aadda1fe686db0a70e20e4b9548b5a3cef" + integrity sha512-A9JxaR8QXoYT95egET4AmCFuChyTlP8d18ZAnmSHuIMsFdS7QlCQQ8pmN/+FHgLIkm+ViE/VngltT5avLACY9A== dependencies: - "@types/anymatch" "*" "@types/node" "*" - "@types/tapable" "*" - "@types/uglify-js" "*" - "@types/webpack-sources" "*" - source-map "^0.6.0" + webpack "^5" "@typesaurus/preact@6.0.0-alpha.4": version "6.0.0-alpha.4" @@ -1294,138 +1284,141 @@ resolved "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz" integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== -"@webassemblyjs/ast@1.11.0": - version "1.11.0" - resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.0.tgz" - integrity sha512-kX2W49LWsbthrmIRMbQZuQDhGtjyqXfEmmHyEi4XWnSZtPmxY0+3anPIzsnRb45VH/J55zlOfWvZuY47aJZTJg== +"@webassemblyjs/ast@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" + integrity sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw== dependencies: - "@webassemblyjs/helper-numbers" "1.11.0" - "@webassemblyjs/helper-wasm-bytecode" "1.11.0" + "@webassemblyjs/helper-numbers" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" -"@webassemblyjs/floating-point-hex-parser@1.11.0": - version "1.11.0" - resolved "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.0.tgz" - integrity sha512-Q/aVYs/VnPDVYvsCBL/gSgwmfjeCb4LW8+TMrO3cSzJImgv8lxxEPM2JA5jMrivE7LSz3V+PFqtMbls3m1exDA== +"@webassemblyjs/floating-point-hex-parser@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz#f6c61a705f0fd7a6aecaa4e8198f23d9dc179e4f" + integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== -"@webassemblyjs/helper-api-error@1.11.0": - version "1.11.0" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.0.tgz" - integrity sha512-baT/va95eXiXb2QflSx95QGT5ClzWpGaa8L7JnJbgzoYeaA27FCvuBXU758l+KXWRndEmUXjP0Q5fibhavIn8w== +"@webassemblyjs/helper-api-error@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz#1a63192d8788e5c012800ba6a7a46c705288fd16" + integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== -"@webassemblyjs/helper-buffer@1.11.0": - version "1.11.0" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.0.tgz" - integrity sha512-u9HPBEl4DS+vA8qLQdEQ6N/eJQ7gT7aNvMIo8AAWvAl/xMrcOSiI2M0MAnMCy3jIFke7bEee/JwdX1nUpCtdyA== +"@webassemblyjs/helper-buffer@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz#832a900eb444884cde9a7cad467f81500f5e5ab5" + integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== -"@webassemblyjs/helper-numbers@1.11.0": - version "1.11.0" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.0.tgz" - integrity sha512-DhRQKelIj01s5IgdsOJMKLppI+4zpmcMQ3XboFPLwCpSNH6Hqo1ritgHgD0nqHeSYqofA6aBN/NmXuGjM1jEfQ== +"@webassemblyjs/helper-numbers@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz#64d81da219fbbba1e3bd1bfc74f6e8c4e10a62ae" + integrity sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ== dependencies: - "@webassemblyjs/floating-point-hex-parser" "1.11.0" - "@webassemblyjs/helper-api-error" "1.11.0" + "@webassemblyjs/floating-point-hex-parser" "1.11.1" + "@webassemblyjs/helper-api-error" "1.11.1" "@xtuc/long" "4.2.2" -"@webassemblyjs/helper-wasm-bytecode@1.11.0": - version "1.11.0" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.0.tgz" - integrity sha512-MbmhvxXExm542tWREgSFnOVo07fDpsBJg3sIl6fSp9xuu75eGz5lz31q7wTLffwL3Za7XNRCMZy210+tnsUSEA== +"@webassemblyjs/helper-wasm-bytecode@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz#f328241e41e7b199d0b20c18e88429c4433295e1" + integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== -"@webassemblyjs/helper-wasm-section@1.11.0": - version "1.11.0" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.0.tgz" - integrity sha512-3Eb88hcbfY/FCukrg6i3EH8H2UsD7x8Vy47iVJrP967A9JGqgBVL9aH71SETPx1JrGsOUVLo0c7vMCN22ytJew== +"@webassemblyjs/helper-wasm-section@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz#21ee065a7b635f319e738f0dd73bfbda281c097a" + integrity sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg== dependencies: - "@webassemblyjs/ast" "1.11.0" - "@webassemblyjs/helper-buffer" "1.11.0" - "@webassemblyjs/helper-wasm-bytecode" "1.11.0" - "@webassemblyjs/wasm-gen" "1.11.0" + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" -"@webassemblyjs/ieee754@1.11.0": - version "1.11.0" - resolved "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.0.tgz" - integrity sha512-KXzOqpcYQwAfeQ6WbF6HXo+0udBNmw0iXDmEK5sFlmQdmND+tr773Ti8/5T/M6Tl/413ArSJErATd8In3B+WBA== +"@webassemblyjs/ieee754@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz#963929e9bbd05709e7e12243a099180812992614" + integrity sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ== dependencies: "@xtuc/ieee754" "^1.2.0" -"@webassemblyjs/leb128@1.11.0": - version "1.11.0" - resolved "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.0.tgz" - integrity sha512-aqbsHa1mSQAbeeNcl38un6qVY++hh8OpCOzxhixSYgbRfNWcxJNJQwe2rezK9XEcssJbbWIkblaJRwGMS9zp+g== +"@webassemblyjs/leb128@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.1.tgz#ce814b45574e93d76bae1fb2644ab9cdd9527aa5" + integrity sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw== dependencies: "@xtuc/long" "4.2.2" -"@webassemblyjs/utf8@1.11.0": - version "1.11.0" - resolved "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.0.tgz" - integrity sha512-A/lclGxH6SpSLSyFowMzO/+aDEPU4hvEiooCMXQPcQFPPJaYcPQNKGOCLUySJsYJ4trbpr+Fs08n4jelkVTGVw== - -"@webassemblyjs/wasm-edit@1.11.0": - version "1.11.0" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.0.tgz" - integrity sha512-JHQ0damXy0G6J9ucyKVXO2j08JVJ2ntkdJlq1UTiUrIgfGMmA7Ik5VdC/L8hBK46kVJgujkBIoMtT8yVr+yVOQ== - dependencies: - "@webassemblyjs/ast" "1.11.0" - "@webassemblyjs/helper-buffer" "1.11.0" - "@webassemblyjs/helper-wasm-bytecode" "1.11.0" - "@webassemblyjs/helper-wasm-section" "1.11.0" - "@webassemblyjs/wasm-gen" "1.11.0" - "@webassemblyjs/wasm-opt" "1.11.0" - "@webassemblyjs/wasm-parser" "1.11.0" - "@webassemblyjs/wast-printer" "1.11.0" - -"@webassemblyjs/wasm-gen@1.11.0": - version "1.11.0" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.0.tgz" - integrity sha512-BEUv1aj0WptCZ9kIS30th5ILASUnAPEvE3tVMTrItnZRT9tXCLW2LEXT8ezLw59rqPP9klh9LPmpU+WmRQmCPQ== - dependencies: - "@webassemblyjs/ast" "1.11.0" - "@webassemblyjs/helper-wasm-bytecode" "1.11.0" - "@webassemblyjs/ieee754" "1.11.0" - "@webassemblyjs/leb128" "1.11.0" - "@webassemblyjs/utf8" "1.11.0" - -"@webassemblyjs/wasm-opt@1.11.0": - version "1.11.0" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.0.tgz" - integrity sha512-tHUSP5F4ywyh3hZ0+fDQuWxKx3mJiPeFufg+9gwTpYp324mPCQgnuVKwzLTZVqj0duRDovnPaZqDwoyhIO8kYg== - dependencies: - "@webassemblyjs/ast" "1.11.0" - "@webassemblyjs/helper-buffer" "1.11.0" - "@webassemblyjs/wasm-gen" "1.11.0" - "@webassemblyjs/wasm-parser" "1.11.0" - -"@webassemblyjs/wasm-parser@1.11.0": - version "1.11.0" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.0.tgz" - integrity sha512-6L285Sgu9gphrcpDXINvm0M9BskznnzJTE7gYkjDbxET28shDqp27wpruyx3C2S/dvEwiigBwLA1cz7lNUi0kw== - dependencies: - "@webassemblyjs/ast" "1.11.0" - "@webassemblyjs/helper-api-error" "1.11.0" - "@webassemblyjs/helper-wasm-bytecode" "1.11.0" - "@webassemblyjs/ieee754" "1.11.0" - "@webassemblyjs/leb128" "1.11.0" - "@webassemblyjs/utf8" "1.11.0" - -"@webassemblyjs/wast-printer@1.11.0": - version "1.11.0" - resolved "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.0.tgz" - integrity sha512-Fg5OX46pRdTgB7rKIUojkh9vXaVN6sGYCnEiJN1GYkb0RPwShZXp6KTDqmoMdQPKhcroOXh3fEzmkWmCYaKYhQ== - dependencies: - "@webassemblyjs/ast" "1.11.0" +"@webassemblyjs/utf8@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.1.tgz#d1f8b764369e7c6e6bae350e854dec9a59f0a3ff" + integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== + +"@webassemblyjs/wasm-edit@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz#ad206ebf4bf95a058ce9880a8c092c5dec8193d6" + integrity sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/helper-wasm-section" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/wasm-opt" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + "@webassemblyjs/wast-printer" "1.11.1" + +"@webassemblyjs/wasm-gen@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz#86c5ea304849759b7d88c47a32f4f039ae3c8f76" + integrity sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/ieee754" "1.11.1" + "@webassemblyjs/leb128" "1.11.1" + "@webassemblyjs/utf8" "1.11.1" + +"@webassemblyjs/wasm-opt@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz#657b4c2202f4cf3b345f8a4c6461c8c2418985f2" + integrity sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + +"@webassemblyjs/wasm-parser@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz#86ca734534f417e9bd3c67c7a1c75d8be41fb199" + integrity sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-api-error" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/ieee754" "1.11.1" + "@webassemblyjs/leb128" "1.11.1" + "@webassemblyjs/utf8" "1.11.1" + +"@webassemblyjs/wast-printer@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz#d0c73beda8eec5426f10ae8ef55cee5e7084c2f0" + integrity sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg== + dependencies: + "@webassemblyjs/ast" "1.11.1" "@xtuc/long" "4.2.2" -"@webpack-cli/info@^1.2.1": - version "1.2.1" - resolved "https://registry.npmjs.org/@webpack-cli/info/-/info-1.2.1.tgz" - integrity sha512-fLnDML5HZ5AEKzHul8xLAksoKN2cibu6MgonkUj8R9V7bbeVRkd1XbGEGWrAUNYHbX1jcqCsDEpBviE5StPMzQ== - dependencies: - envinfo "^7.7.3" +"@webpack-cli/configtest@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-2.0.1.tgz#a69720f6c9bad6aef54a8fa6ba9c3533e7ef4c7f" + integrity sha512-njsdJXJSiS2iNbQVS0eT8A/KPnmyH4pv1APj2K0d1wrZcBLw+yppxOy4CGqa0OxDJkzfL/XELDhD8rocnIwB5A== -"@webpack-cli/serve@^1.2.1": - version "1.2.1" - resolved "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.2.1.tgz" - integrity sha512-Zj1z6AyS+vqV6Hfi7ngCjFGdHV5EwZNIHo6QfFTNe9PyW+zBU1zJ9BiOW1pmUEq950RC4+Dym6flyA/61/vhyw== +"@webpack-cli/info@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-2.0.1.tgz#eed745799c910d20081e06e5177c2b2569f166c0" + integrity sha512-fE1UEWTwsAxRhrJNikE7v4EotYflkEhBL7EbajfkPlf6E37/2QshOy/D48Mw8G5XMFlQtS6YV42vtbG9zBpIQA== + +"@webpack-cli/serve@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-2.0.1.tgz#34bdc31727a1889198855913db2f270ace6d7bf8" + integrity sha512-0G7tNyS+yW8TdgHwZKlDWYXFA6OJQnoLCQvYKkQP0Q2X205PSQ6RNUj0M+1OB/9gRQaUZ/ccYfaxd0nhaWKfjw== "@xtuc/ieee754@^1.2.0": version "1.2.0" @@ -1470,6 +1463,11 @@ acorn-es7-plugin@^1.0.12: resolved "https://registry.npmjs.org/acorn-es7-plugin/-/acorn-es7-plugin-1.1.7.tgz" integrity sha1-8u4fMiipDurRJF+asZIusucdM2s= +acorn-import-assertions@^1.7.6: + version "1.8.0" + resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9" + integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== + acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -1485,12 +1483,7 @@ acorn@^5.0.0: resolved "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz" integrity sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg== -acorn@^8.0.4: - version "8.0.4" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.0.4.tgz" - integrity sha512-XNP0PqF1XD19ZlLKvB7cMmnZswW4C/03pRHgirB30uSJTaS3A3V1/P4sS3HPvFmjoriPCJQs+JDSbm4bL1TxGQ== - -acorn@^8.4.1, acorn@^8.8.0: +acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0: version "8.8.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== @@ -1531,9 +1524,9 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv-formats@^2.1.0: +ajv-formats@^2.1.0, ajv-formats@^2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz" + resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" integrity sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA== dependencies: ajv "^8.0.0" @@ -1543,19 +1536,16 @@ ajv-keywords@^3.5.2: resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv@^6.12.4: - version "6.12.5" - resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz" - integrity sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag== +ajv-keywords@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16" + integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" + fast-deep-equal "^3.1.3" ajv@^6.12.5, ajv@^6.12.6, ajv@^6.5.5: version "6.12.6" - resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== dependencies: fast-deep-equal "^3.1.1" @@ -1573,6 +1563,16 @@ ajv@^8.0.0, ajv@^8.3.0: require-from-string "^2.0.2" uri-js "^4.2.2" +ajv@^8.8.0: + version "8.11.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.11.2.tgz#aecb20b50607acf2569b6382167b65a96008bb78" + integrity sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + ansi-align@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz" @@ -1606,15 +1606,10 @@ ansi-escapes@^5.0.0: dependencies: type-fest "^1.0.2" -ansi-html@0.0.7: - version "0.0.7" - resolved "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz" - integrity sha1-gTWEAhliqenm/QOflA0S9WynhZ4= - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= +ansi-html-community@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/ansi-html-community/-/ansi-html-community-0.0.8.tgz#69fbc4d6ccbe383f9736934ae34c3f8290f1bf41" + integrity sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw== ansi-regex@^3.0.0: version "3.0.0" @@ -1633,7 +1628,7 @@ ansi-regex@^5.0.0: ansi-regex@^5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-styles@^3.2.0, ansi-styles@^3.2.1: @@ -1746,11 +1741,6 @@ array-flatten@3.0.0: resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-3.0.0.tgz" integrity sha512-zPMVc3ZYlGLNk4mpK1NzP2wg0ml9t7fUgDsayR5Y5rSzxQilzR9FGu/EH2jQOcKSAeAfWeylyW8juy3OkWRvNA== -array-union@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz" - integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== - array.prototype.flat@^1.2.3: version "1.2.4" resolved "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz" @@ -1792,14 +1782,14 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= -assets-webpack-plugin@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/assets-webpack-plugin/-/assets-webpack-plugin-7.0.0.tgz" - integrity sha512-DMZ9r6HFxynWeONRMhSOFTvTrmit5dovdoUKdJgCG03M6CC7XiwNImPH+Ad1jaVrQ2n59e05lBhte52xPt4MSA== +assets-webpack-plugin@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/assets-webpack-plugin/-/assets-webpack-plugin-7.1.1.tgz#0b988bf904a1895cae5820957ad82aa402673894" + integrity sha512-HwsDcu9UR9kv7AtiyMpUO9fARn94SbrLzw5+aQ59RnOZJeet+EVHmOrMwXl8fZ8cZmdZ9Sbl1/l+fn7ymiyfMg== dependencies: camelcase "^6.0.0" escape-string-regexp "^4.0.0" - lodash "^4.17.20" + lodash "^4.17.21" ast-types@^0.13.2: version "0.13.4" @@ -1974,7 +1964,7 @@ body-parser@1.20.1, body-parser@^1.18.3: type-is "~1.6.18" unpipe "1.0.0" -boolbase@^1.0.0, boolbase@~1.0.0: +boolbase@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz" integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= @@ -2008,7 +1998,7 @@ brace-expansion@^2.0.1: dependencies: balanced-match "^1.0.0" -braces@^3.0.1, braces@~3.0.2: +braces@^3.0.1, braces@^3.0.2, braces@~3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -2131,15 +2121,15 @@ callsites@^3.0.0: resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camel-case@^4.1.1: - version "4.1.1" - resolved "https://registry.npmjs.org/camel-case/-/camel-case-4.1.1.tgz" - integrity sha512-7fa2WcG4fYFkclIvEmxBbTvmibwF2/agfEBc6q3lOpVu0A13ltLsA+Hr/8Hp6kp5f+G7hKi6t8lys6XxP+1K6Q== +camel-case@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-4.1.2.tgz#9728072a954f805228225a6deea6b38461e1bd5a" + integrity sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw== dependencies: - pascal-case "^3.1.1" - tslib "^1.10.0" + pascal-case "^3.1.2" + tslib "^2.0.3" -camelcase@^5.0.0, camelcase@^5.3.1: +camelcase@^5.0.0: version "5.3.1" resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== @@ -2186,7 +2176,7 @@ chainsaw@~0.1.0: dependencies: traverse ">=0.3.0 <0.4" -chalk@^2.0.0, chalk@^2.3.0, chalk@^2.4.2: +chalk@^2.0.0, chalk@^2.3.0: version "2.4.2" resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -2299,10 +2289,10 @@ cjson@^0.3.1: dependencies: json-parse-helpfulerror "^1.0.3" -clean-css@^4.2.3: - version "4.2.3" - resolved "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz" - integrity sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA== +clean-css@^5.2.2: + version "5.3.1" + resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-5.3.1.tgz#d0610b0b90d125196a2894d35366f734e5d7aa32" + integrity sha512-lCr8OHhiWCTw4v8POJovCoh4T7I9U11yVsPjMWWnnMmp9ZowCxyad1Pathle/9HjaDp+fdQKjO9fQydE6RHTZg== dependencies: source-map "~0.6.0" @@ -2448,9 +2438,9 @@ colorette@^1.2.1: resolved "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz" integrity sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw== -colorette@^2.0.19: +colorette@^2.0.10, colorette@^2.0.14, colorette@^2.0.19: version "2.0.19" - resolved "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.19.tgz#cdf044f47ad41a0f4b56b3a0d5b4e6e1a2d5a798" integrity sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ== colornames@^1.1.1: @@ -2494,11 +2484,6 @@ commander@^2.12.1, commander@^2.19.0, commander@^2.20.0: integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== commander@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/commander/-/commander-4.0.1.tgz" - integrity sha512-IPF4ouhCP+qdlcmCedhxX4xiGBPyigb8v5NeUp+0LyhwLgxMqyp3S0vl7TAPfS/hiP7FC3caI/PB9lTmP8r1NA== - -commander@^4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz" integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== @@ -2508,10 +2493,15 @@ commander@^6.0.0: resolved "https://registry.npmjs.org/commander/-/commander-6.1.0.tgz" integrity sha512-wl7PNrYWd2y5mp1OK/LhTlv8Ff4kQJQRXXAvF+uU/TPNiVJUxZLRYGj/B0y/lPGAVcSbJqH2Za/cvHmrPMC8mA== -commander@^6.2.0: - version "6.2.1" - resolved "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz" - integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== +commander@^8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" + integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== + +commander@^9.4.1: + version "9.4.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-9.4.1.tgz#d1dd8f2ce6faf93147295c0df13c7c21141cfbdd" + integrity sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw== compare-versions@^3.6.0: version "3.6.0" @@ -2629,19 +2619,17 @@ cookie@0.5.0: resolved "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz" integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== -copy-webpack-plugin@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-7.0.0.tgz" - integrity sha512-SLjQNa5iE3BoCP76ESU9qYo9ZkEWtXoZxDurHoqPchAFRblJ9g96xTeC560UXBMre1Nx6ixIIUfiY3VcjpJw3g== +copy-webpack-plugin@*, copy-webpack-plugin@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-11.0.0.tgz#96d4dbdb5f73d02dd72d0528d1958721ab72e04a" + integrity sha512-fX2MWpamkW0hZxMEg0+mYnA40LTosOSa5TqZ9GYIBzyJa9C3QUaMPSE2xAi/buNr8u89SfD9wHSQVBzrRa/SOQ== dependencies: - fast-glob "^3.2.4" - glob-parent "^5.1.1" - globby "^11.0.1" - loader-utils "^2.0.0" + fast-glob "^3.2.11" + glob-parent "^6.0.1" + globby "^13.1.1" normalize-path "^3.0.0" - p-limit "^3.0.2" - schema-utils "^3.0.0" - serialize-javascript "^5.0.1" + schema-utils "^4.0.0" + serialize-javascript "^6.0.0" core-js@^2.0.0: version "2.6.12" @@ -2723,34 +2711,19 @@ crypto-random-string@^2.0.0: resolved "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz" integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== -css-loader@^3.0.0: - version "3.6.0" - resolved "https://registry.npmjs.org/css-loader/-/css-loader-3.6.0.tgz" - integrity sha512-M5lSukoWi1If8dhQAUCvj4H8vUt3vOnwbQBH9DdTm/s4Ym2B/3dPMtYZeJmq7Q3S3Pa+I94DcZ7pc9bP14cWIQ== - dependencies: - camelcase "^5.3.1" - cssesc "^3.0.0" - icss-utils "^4.1.1" - loader-utils "^1.2.3" - normalize-path "^3.0.0" - postcss "^7.0.32" - postcss-modules-extract-imports "^2.0.0" - postcss-modules-local-by-default "^3.0.2" - postcss-modules-scope "^2.2.0" - postcss-modules-values "^3.0.0" - postcss-value-parser "^4.1.0" - schema-utils "^2.7.0" - semver "^6.3.0" - -css-select@^1.1.0: - version "1.2.0" - resolved "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz" - integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg= - dependencies: - boolbase "~1.0.0" - css-what "2.1" - domutils "1.5.1" - nth-check "~1.0.1" +css-loader@^6.7.3: + version "6.7.3" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-6.7.3.tgz#1e8799f3ccc5874fdd55461af51137fcc5befbcd" + integrity sha512-qhOH1KlBMnZP8FzRO6YCH9UHXQhVMcEGLyNdb7Hv2cpcmJbW0YrddO+tG1ab5nT41KpHIYGsbeHqxB9xPu1pKQ== + dependencies: + icss-utils "^5.1.0" + postcss "^8.4.19" + postcss-modules-extract-imports "^3.0.0" + postcss-modules-local-by-default "^4.0.0" + postcss-modules-scope "^3.0.0" + postcss-modules-values "^4.0.0" + postcss-value-parser "^4.2.0" + semver "^7.3.8" css-select@^3.1.2: version "3.1.2" @@ -2763,16 +2736,27 @@ css-select@^3.1.2: domutils "^2.4.3" nth-check "^2.0.0" -css-what@2.1: - version "2.1.3" - resolved "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz" - integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg== +css-select@^4.1.3: + version "4.3.0" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.3.0.tgz#db7129b2846662fd8628cfc496abb2b59e41529b" + integrity sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ== + dependencies: + boolbase "^1.0.0" + css-what "^6.0.1" + domhandler "^4.3.1" + domutils "^2.8.0" + nth-check "^2.0.1" css-what@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/css-what/-/css-what-4.0.0.tgz" integrity sha512-teijzG7kwYfNVsUh2H/YN62xW3KK9YhXEgSlbxMlcyjPNvdKJqFx5lrwlJgoFP1ZHlB89iGDlo/JyshKeRhv5A== +css-what@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" + integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== + cssesc@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz" @@ -2974,21 +2958,13 @@ discontinuous-range@1.0.0: resolved "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz" integrity sha1-44Mx8IRLukm5qctxx3FYWqsbxlo= -dom-converter@^0.2: +dom-converter@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz" integrity sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA== dependencies: utila "~0.4" -dom-serializer@0: - version "0.2.2" - resolved "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz" - integrity sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g== - dependencies: - domelementtype "^2.0.1" - entities "^2.0.0" - dom-serializer@^1.0.1, dom-serializer@~1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.2.0.tgz" @@ -2998,11 +2974,6 @@ dom-serializer@^1.0.1, dom-serializer@~1.2.0: domhandler "^4.0.0" entities "^2.0.0" -domelementtype@1, domelementtype@^1.3.1: - version "1.3.1" - resolved "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz" - integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== - domelementtype@^2.0.1: version "2.0.2" resolved "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.2.tgz" @@ -3013,12 +2984,10 @@ domelementtype@^2.1.0: resolved "https://registry.npmjs.org/domelementtype/-/domelementtype-2.1.0.tgz" integrity sha512-LsTgx/L5VpD+Q8lmsXSHW2WpA+eBlZ9HPf3erD1IoPF00/3JKHZ3BknUVA2QGDNu69ZNmyFmCWBSO45XjYKC5w== -domhandler@^2.3.0: - version "2.4.2" - resolved "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz" - integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA== - dependencies: - domelementtype "1" +domelementtype@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" + integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== domhandler@^4.0.0: version "4.0.0" @@ -3027,21 +2996,12 @@ domhandler@^4.0.0: dependencies: domelementtype "^2.1.0" -domutils@1.5.1: - version "1.5.1" - resolved "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz" - integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8= - dependencies: - dom-serializer "0" - domelementtype "1" - -domutils@^1.5.1: - version "1.7.0" - resolved "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz" - integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg== +domhandler@^4.2.0, domhandler@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.1.tgz#8d792033416f59d68bc03a5aa7b018c1ca89279c" + integrity sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ== dependencies: - dom-serializer "0" - domelementtype "1" + domelementtype "^2.2.0" domutils@^2.4.3, domutils@^2.4.4: version "2.4.4" @@ -3052,13 +3012,22 @@ domutils@^2.4.3, domutils@^2.4.4: domelementtype "^2.0.1" domhandler "^4.0.0" -dot-case@^3.0.3: - version "3.0.3" - resolved "https://registry.npmjs.org/dot-case/-/dot-case-3.0.3.tgz" - integrity sha512-7hwEmg6RiSQfm/GwPL4AAWXKy3YNNZA3oFv2Pdiey0mwkRCPZ9x6SZbkLcn8Ma5PYeVokzoD4Twv2n7LKp5WeA== +domutils@^2.5.2, domutils@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" + integrity sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A== + dependencies: + dom-serializer "^1.0.1" + domelementtype "^2.2.0" + domhandler "^4.2.0" + +dot-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" + integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w== dependencies: - no-case "^3.0.3" - tslib "^1.10.0" + no-case "^3.0.4" + tslib "^2.0.3" dot-prop@^5.2.0: version "5.3.0" @@ -3171,16 +3140,7 @@ end-of-stream@^1.1.0, end-of-stream@^1.4.1: dependencies: once "^1.4.0" -enhanced-resolve@^4.0.0: - version "4.3.0" - resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz" - integrity sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ== - dependencies: - graceful-fs "^4.1.2" - memory-fs "^0.5.0" - tapable "^1.0.0" - -enhanced-resolve@^5.0.0: +enhanced-resolve@^5.0.0, enhanced-resolve@^5.10.0: version "5.12.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz#300e1c90228f5b570c4d35babf263f6da7155634" integrity sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ== @@ -3208,11 +3168,6 @@ ent@^2.2.0: resolved "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz" integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= -entities@^1.1.1: - version "1.1.2" - resolved "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz" - integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== - entities@^2.0.0: version "2.0.3" resolved "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz" @@ -3287,13 +3242,6 @@ err-code@^2.0.2: resolved "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz" integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA== -errno@^0.1.3: - version "0.1.7" - resolved "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz" - integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== - dependencies: - prr "~1.0.1" - error-ex@^1.3.1: version "1.3.2" resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz" @@ -3354,10 +3302,10 @@ es-abstract@^1.18.0-next.1: string.prototype.trimend "^1.0.1" string.prototype.trimstart "^1.0.1" -es-module-lexer@^0.4.0: - version "0.4.0" - resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.4.0.tgz" - integrity sha512-iuEGihqqhKWFgh72Q/Jtch7V2t/ft8w8IPP2aEN8ArYKO+IWyo6hsi96hCdgyeEDQIV3InhYQ9BlwUFPGXrbEQ== +es-module-lexer@^0.9.0: + version "0.9.3" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" + integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== es-to-primitive@^1.2.1: version "1.2.1" @@ -3410,7 +3358,7 @@ escodegen@^1.13.0, escodegen@^1.8.1: optionalDependencies: source-map "~0.6.1" -eslint-scope@^5.1.1: +eslint-scope@5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== @@ -3506,21 +3454,6 @@ execa@^4.0.3: signal-exit "^3.0.2" strip-final-newline "^2.0.0" -execa@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz" - integrity sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - strip-final-newline "^2.0.0" - exegesis-express@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/exegesis-express/-/exegesis-express-4.0.0.tgz" @@ -3638,27 +3571,31 @@ external-editor@^3.0.3: iconv-lite "^0.4.24" tmp "^0.0.33" -extsprintf@1.3.0, extsprintf@^1.2.0: +extsprintf@1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz" integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= -fast-deep-equal@^3.1.1: +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-glob@^3.1.1, fast-glob@^3.2.4: - version "3.2.4" - resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz" - integrity sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ== +fast-glob@^3.2.11: + version "3.2.12" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" + integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.0" + glob-parent "^5.1.2" merge2 "^1.3.0" - micromatch "^4.0.2" - picomatch "^2.2.1" + micromatch "^4.0.4" fast-json-stable-stringify@^2.0.0: version "2.1.0" @@ -3718,13 +3655,13 @@ figures@^3.0.0, figures@^3.2.0: dependencies: escape-string-regexp "^1.0.5" -file-loader@^6.1.0: - version "6.1.0" - resolved "https://registry.npmjs.org/file-loader/-/file-loader-6.1.0.tgz" - integrity sha512-26qPdHyTsArQ6gU4P1HJbAbnFTyT2r0pG7czh1GFAd9TZbj0n94wWbupgixZH/ET/meqi2/5+F7DhW4OAXD+Lg== +file-loader@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.2.0.tgz#baef7cf8e1840df325e4390b4484879480eebe4d" + integrity sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw== dependencies: loader-utils "^2.0.0" - schema-utils "^2.7.1" + schema-utils "^3.0.0" file-uri-to-path@2: version "2.0.0" @@ -3998,10 +3935,10 @@ fs-minipass@^2.0.0, fs-minipass@^2.1.0: dependencies: minipass "^3.0.0" -fs-monkey@1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.1.tgz" - integrity sha512-fcSa+wyTqZa46iWweI7/ZiUfegOZl0SG8+dltIwFXo7+zYU9J9kpS3NB6pZcSlJdhvIwp81Adx2XhZorncxiaA== +fs-monkey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/fs-monkey/-/fs-monkey-1.0.3.tgz#ae3ac92d53bb328efe0e9a1d9541f6ad8d48e2d3" + integrity sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q== fs.realpath@^1.0.0: version "1.0.0" @@ -4147,11 +4084,6 @@ get-stream@^5.0.0: dependencies: pump "^3.0.0" -get-stream@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.0.tgz" - integrity sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg== - get-uri@3: version "3.0.2" resolved "https://registry.npmjs.org/get-uri/-/get-uri-3.0.2.tgz" @@ -4171,17 +4103,24 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" -glob-parent@^5.1.0, glob-parent@^5.1.1, glob-parent@~5.1.0: - version "5.1.1" - resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz" - integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== +glob-parent@^5.1.2, glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" -glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== +glob-parent@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + +glob-parent@~5.1.0: + version "5.1.1" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz" + integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== dependencies: is-glob "^4.0.1" @@ -4257,17 +4196,16 @@ global-dirs@^3.0.0: dependencies: ini "2.0.0" -globby@^11.0.1: - version "11.0.2" - resolved "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz" - integrity sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og== +globby@^13.1.1: + version "13.1.3" + resolved "https://registry.yarnpkg.com/globby/-/globby-13.1.3.tgz#f62baf5720bcb2c1330c8d4ef222ee12318563ff" + integrity sha512-8krCNHXvlCgHDpegPzleMq07yMYTO2sXKASmZmquEYWEmCx6J5UTRbp5RwMJkTJGtcQ44YpiUYUiN0b9mzy8Bw== dependencies: - array-union "^2.1.0" dir-glob "^3.0.1" - fast-glob "^3.1.1" - ignore "^5.1.4" - merge2 "^1.3.0" - slash "^3.0.0" + fast-glob "^3.2.11" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^4.0.0" good-listener@^1.2.2: version "1.2.2" @@ -4382,7 +4320,7 @@ google-p12-pem@^4.0.0: dependencies: node-forge "^1.3.1" -graceful-fs@4.2.10, graceful-fs@^4.1.9, graceful-fs@^4.2.6: +graceful-fs@4.2.10, graceful-fs@^4.1.9, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== @@ -4492,48 +4430,35 @@ html-element-map@^1.2.0: dependencies: array-filter "^1.0.0" -html-entities@^1.2.0: - version "1.4.0" - resolved "https://registry.npmjs.org/html-entities/-/html-entities-1.4.0.tgz" - integrity sha512-8nxjcBcd8wovbeKx7h3wTji4e6+rhaVuPNpMqwWgnHh+N9ToqsCs6XztWRBPQ+UtzsoMAdKZtUENoVzU/EMtZA== +html-entities@^2.1.0: + version "2.3.3" + resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.3.3.tgz#117d7626bece327fc8baace8868fa6f5ef856e46" + integrity sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA== -html-minifier-terser@^5.0.1: - version "5.1.1" - resolved "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz" - integrity sha512-ZPr5MNObqnV/T9akshPKbVgyOqLmy+Bxo7juKCfTfnjNniTAMdy4hz21YQqoofMBJD2kdREaqPPdThoR78Tgxg== +html-minifier-terser@^6.0.2: + version "6.1.0" + resolved "https://registry.yarnpkg.com/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz#bfc818934cc07918f6b3669f5774ecdfd48f32ab" + integrity sha512-YXxSlJBZTP7RS3tWnQw74ooKa6L9b9i9QYXY21eUEvhZ3u9XLfv6OnFsQq6RxkhHygsaUMvYsZRV5rU/OVNZxw== dependencies: - camel-case "^4.1.1" - clean-css "^4.2.3" - commander "^4.1.1" + camel-case "^4.1.2" + clean-css "^5.2.2" + commander "^8.3.0" he "^1.2.0" - param-case "^3.0.3" + param-case "^3.0.4" relateurl "^0.2.7" - terser "^4.6.3" + terser "^5.10.0" -html-webpack-plugin@^5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.2.0.tgz" - integrity sha512-0wkVlJKq7edCN793gdLgdAm5m196qI2vb5SGXy4AtGOFB/lYKyS10+3Vkhe6Bo0acddAW3QVw+0ysgWoko/IEQ== +html-webpack-plugin@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-5.5.0.tgz#c3911936f57681c1f9f4d8b68c158cd9dfe52f50" + integrity sha512-sy88PC2cRTVxvETRgUHFrL4No3UxvcH8G1NepGhqaTT+GXN2kTamqasot0inS5hXeg1cMbFDt27zzo9p35lZVw== dependencies: - "@types/html-minifier-terser" "^5.0.0" - html-minifier-terser "^5.0.1" - loader-utils "^2.0.0" - lodash "^4.17.20" - pretty-error "^2.1.1" + "@types/html-minifier-terser" "^6.0.0" + html-minifier-terser "^6.0.2" + lodash "^4.17.21" + pretty-error "^4.0.0" tapable "^2.0.0" -htmlparser2@^3.3.0: - version "3.10.1" - resolved "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz" - 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" - htmlparser2@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.0.0.tgz" @@ -4544,6 +4469,16 @@ htmlparser2@^6.0.0: domutils "^2.4.4" entities "^2.0.0" +htmlparser2@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-6.1.0.tgz#c4d762b6c3371a05dbe65e94ae43a9f845fb8fb7" + integrity sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A== + dependencies: + domelementtype "^2.0.1" + domhandler "^4.0.0" + domutils "^2.5.2" + entities "^2.0.0" + http-cache-semantics@^4.1.0: version "4.1.1" resolved "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz" @@ -4635,11 +4570,6 @@ human-signals@^1.1.1: resolved "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz" integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== -human-signals@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" - integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== - humanize-ms@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz" @@ -4677,12 +4607,10 @@ iconv-lite@^0.6.2: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" -icss-utils@^4.0.0, icss-utils@^4.1.1: - version "4.1.1" - resolved "https://registry.npmjs.org/icss-utils/-/icss-utils-4.1.1.tgz" - integrity sha512-4aFq7wvWyMHKgxsH8QQtGpvbASCf+eM3wPRLI6R+MgAnTCZ6STYsRvttLvRWK0Nfif5piF394St3HeJDaljGPA== - dependencies: - postcss "^7.0.14" +icss-utils@^5.0.0, icss-utils@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae" + integrity sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA== idb@7.0.1: version "7.0.1" @@ -4694,10 +4622,10 @@ ieee754@^1.1.13: resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== -ignore@^5.1.4: - version "5.1.8" - resolved "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz" - integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== +ignore@^5.2.0: + version "5.2.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" + integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== import-fresh@^3.2.1: version "3.2.1" @@ -4753,7 +4681,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: +inherits@2, inherits@2.0.4, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -4799,10 +4727,10 @@ install-artifact-from-github@^1.3.1: resolved "https://registry.npmjs.org/install-artifact-from-github/-/install-artifact-from-github-1.3.1.tgz" integrity sha512-3l3Bymg2eKDsN5wQuMfgGEj2x6l5MCAv0zPL6rxHESufFVlEAKW/6oY9F1aGgvY/EgWm5+eWGRjINveL4X7Hgg== -interpret@^2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz" - integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== +interpret@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-3.1.1.tgz#5be0ceed67ca79c6c4bc5cf0d7ee843dcea110c4" + integrity sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ== ip-regex@^4.1.0: version "4.2.0" @@ -4865,10 +4793,10 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-core-module@^2.1.0: - version "2.2.0" - resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz" - integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ== +is-core-module@^2.9.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" + integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== dependencies: has "^1.0.3" @@ -4899,6 +4827,13 @@ is-glob@^4.0.1, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" +is-glob@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + is-installed-globally@^0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz" @@ -5088,14 +5023,14 @@ isstream@~0.1.2: resolved "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -jest-worker@^26.6.2: - version "26.6.2" - resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz" - integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== +jest-worker@^27.4.5: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" + integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== dependencies: "@types/node" "*" merge-stream "^2.0.0" - supports-color "^7.0.0" + supports-color "^8.0.0" jju@^1.1.0: version "1.4.0" @@ -5202,12 +5137,7 @@ json-bond@^0.1.0: resolved "https://registry.npmjs.org/json-bond/-/json-bond-0.1.0.tgz" integrity sha512-oOTXdcq0PCJr6OUnzyLN2n0b5msex2KWP60/mgZpop8P6WGWQgZr9frPs4vap+cJG89Mn+hSE8dsEPwNU2B3Ig== -json-parse-better-errors@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz" - integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== - -json-parse-even-better-errors@^2.3.0: +json-parse-even-better-errors@^2.3.0, json-parse-even-better-errors@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== @@ -5231,7 +5161,7 @@ json-schema-traverse@^0.4.1: json-schema-traverse@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== json-schema@0.4.0: @@ -5244,13 +5174,6 @@ json-stringify-safe@~5.0.1: resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= -json5@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== - dependencies: - minimist "^1.2.0" - json5@^2.1.2: version "2.1.3" resolved "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz" @@ -5258,6 +5181,11 @@ json5@^2.1.2: dependencies: minimist "^1.2.5" +json5@^2.2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.2.tgz#64471c5bdcc564c18f7c1d4df2e2297f2457c5ab" + integrity sha512-46Tk9JiOL2z7ytNQWFLpj99RZkVgeHf87yGQKsIkaPz1qSH9UczKH1rO7K3wgRselo0tYMUNfecYpm/p1vC7tQ== + jsonc-parser@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" @@ -5458,15 +5386,6 @@ loader-runner@^4.2.0: resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz" integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== -loader-utils@^1.2.3: - version "1.4.0" - resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz" - integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== - dependencies: - big.js "^5.2.2" - emojis-list "^3.0.0" - json5 "^1.0.1" - loader-utils@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz" @@ -5621,12 +5540,12 @@ long@^5.0.0: resolved "https://registry.yarnpkg.com/long/-/long-5.2.1.tgz#e27595d0083d103d2fa2c20c7699f8e0c92b897f" integrity sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A== -lower-case@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/lower-case/-/lower-case-2.0.1.tgz" - integrity sha512-LiWgfDLLb1dwbFQZsSglpRj+1ctGnayXz3Uv0/WO8n558JycT5fg6zkNcnW0G68Nn0aEldTFeEfmjCfmqry/rQ== +lower-case@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" + integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== dependencies: - tslib "^1.10.0" + tslib "^2.0.3" lru-cache@^5.1.1: version "5.1.1" @@ -5702,13 +5621,6 @@ make-fetch-happen@^10.0.3: socks-proxy-agent "^7.0.0" ssri "^9.0.0" -map-age-cleaner@^0.1.3: - version "0.1.3" - resolved "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz" - integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== - dependencies: - p-defer "^1.0.0" - markdown-it-anchor@^8.4.1: version "8.6.6" resolved "https://registry.yarnpkg.com/markdown-it-anchor/-/markdown-it-anchor-8.6.6.tgz#4a12e358c9c2167ee28cb7a5f10e29d6f1ffd7ca" @@ -5757,28 +5669,12 @@ media-typer@0.3.0: resolved "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz" integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= -mem@^8.0.0: - version "8.0.0" - resolved "https://registry.npmjs.org/mem/-/mem-8.0.0.tgz" - integrity sha512-qrcJOe6uD+EW8Wrci1Vdiua/15Xw3n/QnaNXE7varnB6InxSk7nu3/i5jfy3S6kWxr8WYJ6R1o0afMUtvorTsA== - dependencies: - map-age-cleaner "^0.1.3" - mimic-fn "^3.1.0" - -memfs@^3.2.0: - version "3.2.0" - resolved "https://registry.npmjs.org/memfs/-/memfs-3.2.0.tgz" - integrity sha512-f/xxz2TpdKv6uDn6GtHee8ivFyxwxmPuXatBb1FBwxYNuVpbM3k/Y1Z+vC0mH/dIXXrukYfe3qe5J32Dfjg93A== - dependencies: - fs-monkey "1.0.1" - -memory-fs@^0.5.0: - version "0.5.0" - resolved "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz" - integrity sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA== +memfs@^3.4.12: + version "3.4.12" + resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.4.12.tgz#d00f8ad8dab132dc277c659dc85bfd14b07d03bd" + integrity sha512-BcjuQn6vfqP+k100e0E9m61Hyqa//Brp+I3f0OBmN0ATHlFA8vx3Lt8z57R3u2bPqe3WGDBC+nF72fTH7isyEw== dependencies: - errno "^0.1.3" - readable-stream "^2.0.1" + fs-monkey "^1.0.3" merge-descriptors@1.0.1: version "1.0.1" @@ -5790,7 +5686,7 @@ merge-stream@^2.0.0: resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.3.0: +merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== @@ -5808,6 +5704,14 @@ micromatch@^4.0.0, micromatch@^4.0.2: braces "^3.0.1" picomatch "^2.0.5" +micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + mime-db@1.44.0, "mime-db@>= 1.43.0 < 2": version "1.44.0" resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz" @@ -5818,11 +5722,6 @@ mime-db@1.45.0: resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz" integrity sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w== -mime-db@1.46.0: - version "1.46.0" - resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.46.0.tgz" - integrity sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ== - mime-db@1.52.0, "mime-db@>= 1.40.0 < 2": version "1.52.0" resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz" @@ -5835,9 +5734,9 @@ mime-types@^2.0.8, mime-types@~2.1.24: dependencies: mime-db "1.44.0" -mime-types@^2.1.12, mime-types@^2.1.35, mime-types@~2.1.19, mime-types@~2.1.34: +mime-types@^2.1.12, mime-types@^2.1.31, mime-types@^2.1.35, mime-types@~2.1.19, mime-types@~2.1.34: version "2.1.35" - resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: mime-db "1.52.0" @@ -5849,13 +5748,6 @@ mime-types@^2.1.27: dependencies: mime-db "1.45.0" -mime-types@^2.1.28: - version "2.1.29" - resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.29.tgz" - integrity sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ== - dependencies: - mime-db "1.46.0" - mime@1.6.0: version "1.6.0" resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz" @@ -5881,19 +5773,12 @@ mimic-fn@^2.1.0: resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -mimic-fn@^3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz" - integrity sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ== - -mini-css-extract-plugin@^1.3.9: - version "1.3.9" - resolved "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.3.9.tgz" - integrity sha512-Ac4s+xhVbqlyhXS5J/Vh/QXUz3ycXlCqoCPpg0vdfhsIBH9eg/It/9L1r1XhSCH737M1lqcWnMuWL13zcygn5A== +mini-css-extract-plugin@*, mini-css-extract-plugin@^2.7.2: + version "2.7.2" + resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-2.7.2.tgz#e049d3ea7d3e4e773aad585c6cb329ce0c7b72d7" + integrity sha512-EdlUizq13o0Pd+uCp+WO/JpkLvHRVGt97RqfeGhXqAcorYo1ypJSpkV+WDT0vY/kmh/p7wRdJNJtuyK540PXDw== dependencies: - loader-utils "^2.0.0" - schema-utils "^3.0.0" - webpack-sources "^1.1.0" + schema-utils "^4.0.0" minimatch@3.0.4, minimatch@^3.0.4: version "3.0.4" @@ -5922,9 +5807,9 @@ minimist@^1.2.0, minimist@^1.2.5: integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== minimist@^1.2.6: - version "1.2.6" - resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== + version "1.2.7" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" + integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== minipass-collect@^1.0.2: version "1.0.2" @@ -6081,6 +5966,11 @@ nanoid@3.1.12: resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.1.12.tgz" integrity sha512-1qstj9z5+x491jfiC4Nelk+f8XBad7LN20PmyWINJEMRSf3wcAjAWysw1qaA8z6NSKe2sjq1hRSDpBH5paCb6A== +nanoid@^3.3.4: + version "3.3.4" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" + integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== + nearley@^2.7.10: version "2.20.1" resolved "https://registry.npmjs.org/nearley/-/nearley-2.20.1.tgz" @@ -6116,13 +6006,13 @@ nice-try@^1.0.4: resolved "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== -no-case@^3.0.3: - version "3.0.3" - resolved "https://registry.npmjs.org/no-case/-/no-case-3.0.3.tgz" - integrity sha512-ehY/mVQCf9BL0gKfsJBvFJen+1V//U+0HQMPrWct40ixE4jnv0bfvxDbWtAHL9EcaPEOJHVVYKoQn1TlZUB8Tw== +no-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" + integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== dependencies: - lower-case "^2.0.1" - tslib "^1.10.0" + lower-case "^2.0.2" + tslib "^2.0.3" node-emoji@^1.11.0: version "1.11.0" @@ -6194,7 +6084,7 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -npm-run-path@^4.0.0, npm-run-path@^4.0.1: +npm-run-path@^4.0.0: version "4.0.1" resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz" integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== @@ -6218,12 +6108,12 @@ nth-check@^2.0.0: dependencies: boolbase "^1.0.0" -nth-check@~1.0.1: - version "1.0.2" - resolved "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz" - integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg== +nth-check@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" + integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w== dependencies: - boolbase "~1.0.0" + boolbase "^1.0.0" null-loader@^4.0.1: version "4.0.1" @@ -6342,7 +6232,7 @@ one-time@0.0.4: resolved "https://registry.npmjs.org/one-time/-/one-time-0.0.4.tgz" integrity sha1-+M33eISCb+Tf+T46nMN7HkSAdC4= -onetime@^5.1.0, onetime@^5.1.2: +onetime@^5.1.0: version "5.1.2" resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz" integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== @@ -6400,11 +6290,6 @@ os-tmpdir@~1.0.2: resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= -p-defer@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz" - integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= - p-defer@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/p-defer/-/p-defer-3.0.0.tgz" @@ -6424,7 +6309,7 @@ p-limit@^3.0.1: dependencies: p-try "^2.0.0" -p-limit@^3.0.2, p-limit@^3.1.0: +p-limit@^3.0.2: version "3.1.0" resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== @@ -6488,13 +6373,13 @@ pac-resolver@^5.0.0: ip "^1.1.5" netmask "^2.0.1" -param-case@^3.0.3: - version "3.0.3" - resolved "https://registry.npmjs.org/param-case/-/param-case-3.0.3.tgz" - integrity sha512-VWBVyimc1+QrzappRs7waeN2YmoZFCGXWASRYX1/rGHtXqEcrGEIDm+jqIwFa2fRXNgQEwrxaYuIrX0WcAguTA== +param-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/param-case/-/param-case-3.0.4.tgz#7d17fe4aa12bde34d4a77d91acfb6219caad01c5" + integrity sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A== dependencies: - dot-case "^3.0.3" - tslib "^1.10.0" + dot-case "^3.0.4" + tslib "^2.0.3" parent-module@^1.0.0: version "1.0.1" @@ -6530,13 +6415,13 @@ parseurl@~1.3.3: resolved "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== -pascal-case@^3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.1.tgz" - integrity sha512-XIeHKqIrsquVTQL2crjq3NfJUxmdLasn3TYOU0VBM+UX2a6ztAWBlJQBePLGY7VHW8+2dRadeIPK5+KImwTxQA== +pascal-case@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/pascal-case/-/pascal-case-3.1.2.tgz#b48e0ef2b98e205e7c1dae747d0b1508237660eb" + integrity sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g== dependencies: - no-case "^3.0.3" - tslib "^1.10.0" + no-case "^3.0.4" + tslib "^2.0.3" path-exists@^3.0.0: version "3.0.0" @@ -6568,6 +6453,11 @@ path-parse@^1.0.6: resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== +path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz" @@ -6590,11 +6480,21 @@ performance-now@^2.1.0: resolved "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1: version "2.2.2" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz" integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== +picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + pkg-dir@^4.2.0: version "4.2.0" resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz" @@ -6618,40 +6518,35 @@ portfinder@^1.0.32: debug "^3.2.7" mkdirp "^0.5.6" -postcss-modules-extract-imports@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-2.0.0.tgz" - integrity sha512-LaYLDNS4SG8Q5WAWqIJgdHPJrDDr/Lv775rMBFUbgjTz6j34lUznACHcdRWroPvXANP2Vj7yNK57vp9eFqzLWQ== - dependencies: - postcss "^7.0.5" +postcss-modules-extract-imports@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz#cda1f047c0ae80c97dbe28c3e76a43b88025741d" + integrity sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw== -postcss-modules-local-by-default@^3.0.2: - version "3.0.3" - resolved "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.3.tgz" - integrity sha512-e3xDq+LotiGesympRlKNgaJ0PCzoUIdpH0dj47iWAui/kyTgh3CiAr1qP54uodmJhl6p9rN6BoNcdEDVJx9RDw== +postcss-modules-local-by-default@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.0.tgz#ebbb54fae1598eecfdf691a02b3ff3b390a5a51c" + integrity sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ== dependencies: - icss-utils "^4.1.1" - postcss "^7.0.32" + icss-utils "^5.0.0" postcss-selector-parser "^6.0.2" postcss-value-parser "^4.1.0" -postcss-modules-scope@^2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-2.2.0.tgz" - integrity sha512-YyEgsTMRpNd+HmyC7H/mh3y+MeFWevy7V1evVhJWewmMbjDHIbZbOXICC2y+m1xI1UVfIT1HMW/O04Hxyu9oXQ== +postcss-modules-scope@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz#9ef3151456d3bbfa120ca44898dfca6f2fa01f06" + integrity sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg== dependencies: - postcss "^7.0.6" - postcss-selector-parser "^6.0.0" + postcss-selector-parser "^6.0.4" -postcss-modules-values@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-3.0.0.tgz" - integrity sha512-1//E5jCBrZ9DmRX+zCtmQtRSV6PV42Ix7Bzj9GbwJceduuf7IqP8MgeTXuRDHOWj2m0VzZD5+roFWDuU8RQjcg== +postcss-modules-values@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz#d7c5e7e68c3bb3c9b27cbf48ca0bb3ffb4602c9c" + integrity sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ== dependencies: - icss-utils "^4.0.0" - postcss "^7.0.6" + icss-utils "^5.0.0" -postcss-selector-parser@^6.0.0, postcss-selector-parser@^6.0.2: +postcss-selector-parser@^6.0.2: version "6.0.2" resolved "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.2.tgz" integrity sha512-36P2QR59jDTOAiIkqEprfJDsoNrvwFei3eCqKd1Y0tUsBimsq39BLp7RD+JWny3WgB1zGhJX8XVePwm9k4wdBg== @@ -6660,19 +6555,32 @@ postcss-selector-parser@^6.0.0, postcss-selector-parser@^6.0.2: indexes-of "^1.0.1" uniq "^1.0.1" +postcss-selector-parser@^6.0.4: + version "6.0.11" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.11.tgz#2e41dc39b7ad74046e1615185185cd0b17d0c8dc" + integrity sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g== + dependencies: + cssesc "^3.0.0" + util-deprecate "^1.0.2" + postcss-value-parser@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz" integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ== -postcss@^7.0.14, postcss@^7.0.32, postcss@^7.0.5, postcss@^7.0.6: - version "7.0.32" - resolved "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz" - integrity sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw== +postcss-value-parser@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" + integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== + +postcss@^8.4.19: + version "8.4.20" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.20.tgz#64c52f509644cecad8567e949f4081d98349dc56" + integrity sha512-6Q04AXR1212bXr5fh03u8aAwbLxAQNGQ/Q1LNa0VfOI06ZAlhPHtQvE4OIdpj4kLThXilalPnmDSOD65DcHt+g== dependencies: - chalk "^2.4.2" - source-map "^0.6.1" - supports-color "^6.1.0" + nanoid "^3.3.4" + picocolors "^1.0.0" + source-map-js "^1.0.2" power-assert-context-formatter@^1.0.7: version "1.2.0" @@ -6802,13 +6710,13 @@ prettier@2.1.1: resolved "https://registry.npmjs.org/prettier/-/prettier-2.1.1.tgz" integrity sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw== -pretty-error@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/pretty-error/-/pretty-error-2.1.1.tgz" - integrity sha1-X0+HyPkeWuPzuoerTPXgOxoX8aM= +pretty-error@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-4.0.0.tgz#90a703f46dd7234adb46d0f84823e9d1cb8f10d6" + integrity sha512-AoJ5YMAcXKYxKhuJGdcvse+Voc6v1RgnsR3nWcYU7q4t6z0Q6T86sv5Zq8VIRbOWWFpvdGE83LtdSMNd+6Y0xw== dependencies: - renderkid "^2.0.1" - utila "~0.4" + lodash "^4.17.20" + renderkid "^3.0.0" pretty-format@^3.8.0: version "3.8.0" @@ -6966,11 +6874,6 @@ proxy-from-env@^1.0.0: resolved "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== -prr@~1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz" - integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= - pseudomap@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" @@ -7023,11 +6926,6 @@ qs@~6.5.2: resolved "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz" integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== -querystring@^0.2.0: - version "0.2.1" - resolved "https://registry.npmjs.org/querystring/-/querystring-0.2.1.tgz" - integrity sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg== - raf@^3.4.1: version "3.4.1" resolved "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz" @@ -7109,7 +7007,7 @@ readable-stream@1.1.x: isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.3.7, readable-stream@~2.3.6: +readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.3.7, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -7152,12 +7050,12 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -rechoir@^0.7.0: - version "0.7.0" - resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz" - integrity sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q== +rechoir@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.8.0.tgz#49f866e0d32146142da3ad8f0eff352b3215ff22" + integrity sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ== dependencies: - resolve "^1.9.0" + resolve "^1.20.0" redeyed@~2.1.0: version "2.1.1" @@ -7193,16 +7091,16 @@ remarkable@^2.0.1: argparse "^1.0.10" autolinker "^3.11.0" -renderkid@^2.0.1: - version "2.0.3" - resolved "https://registry.npmjs.org/renderkid/-/renderkid-2.0.3.tgz" - integrity sha512-z8CLQp7EZBPCwCnncgf9C4XAi3WR0dv+uWu/PjIyhhAb5d6IJ/QZqlHFprHeKT+59//V6BNUsLbvN8+2LarxGA== +renderkid@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-3.0.0.tgz#5fd823e4d6951d37358ecc9a58b1f06836b6268a" + integrity sha512-q/7VIQA8lmM1hF+jn+sFSPWGlMkSAeNYcPLmDQx2zzuiDfaLrOmumR8iaUKlenFgh0XRPIUeSPlH3A+AW3Z5pg== dependencies: - css-select "^1.1.0" - dom-converter "^0.2" - htmlparser2 "^3.3.0" - strip-ansi "^3.0.0" - utila "^0.4.0" + css-select "^4.1.3" + dom-converter "^0.2.0" + htmlparser2 "^6.1.0" + lodash "^4.17.21" + strip-ansi "^6.0.1" request@^2.87.0: version "2.88.2" @@ -7237,7 +7135,7 @@ require-directory@^2.1.1: require-from-string@^2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== require-main-filename@^2.0.0: @@ -7274,6 +7172,15 @@ resolve-from@^5.0.0: resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== +resolve@^1.20.0: + version "1.22.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== + dependencies: + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + resolve@^1.3.2: version "1.17.0" resolved "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz" @@ -7281,14 +7188,6 @@ resolve@^1.3.2: dependencies: path-parse "^1.0.6" -resolve@^1.9.0: - version "1.19.0" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz" - integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== - dependencies: - is-core-module "^2.1.0" - path-parse "^1.0.6" - restore-cursor@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz" @@ -7399,15 +7298,6 @@ safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -schema-utils@^2.6.6, schema-utils@^2.7.0, schema-utils@^2.7.1: - version "2.7.1" - resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz" - integrity sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg== - dependencies: - "@types/json-schema" "^7.0.5" - ajv "^6.12.4" - ajv-keywords "^3.5.2" - schema-utils@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz" @@ -7417,6 +7307,25 @@ schema-utils@^3.0.0: ajv "^6.12.5" ajv-keywords "^3.5.2" +schema-utils@^3.1.0, schema-utils@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" + integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== + dependencies: + "@types/json-schema" "^7.0.8" + ajv "^6.12.5" + ajv-keywords "^3.5.2" + +schema-utils@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.0.0.tgz#60331e9e3ae78ec5d16353c467c34b3a0a1d3df7" + integrity sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg== + dependencies: + "@types/json-schema" "^7.0.9" + ajv "^8.8.0" + ajv-formats "^2.1.1" + ajv-keywords "^5.0.0" + select@^1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/select/-/select-1.1.2.tgz" @@ -7508,13 +7417,20 @@ send@0.18.0: range-parser "~1.2.1" statuses "2.0.1" -serialize-javascript@5.0.1, serialize-javascript@^5.0.1: +serialize-javascript@5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz" integrity sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA== dependencies: randombytes "^2.1.0" +serialize-javascript@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + serve-static@1.14.1: version "1.14.1" resolved "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz" @@ -7604,7 +7520,7 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -signal-exit@^3.0.2, signal-exit@^3.0.3: +signal-exit@^3.0.2: version "3.0.3" resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz" integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== @@ -7626,6 +7542,11 @@ slash@^3.0.0: resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== +slash@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7" + integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew== + slice-ansi@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz" @@ -7675,29 +7596,24 @@ socks@^2.3.3, socks@^2.6.2: ip "^2.0.0" smart-buffer "^4.2.0" -source-list-map@^2.0.0, source-list-map@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz" - integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== +source-map-js@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== -source-map-support@~0.5.12, source-map-support@~0.5.19: - version "0.5.19" - resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz" - integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== +source-map-support@~0.5.20: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: +source-map@^0.6.0, source-map@~0.6.0, source-map@~0.6.1: version "0.6.1" resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@^0.7.3, source-map@~0.7.2: - version "0.7.3" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== - sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" @@ -7866,13 +7782,6 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -strip-ansi@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz" @@ -7896,7 +7805,7 @@ strip-ansi@^6.0.0: strip-ansi@^6.0.1: version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: ansi-regex "^5.0.1" @@ -7926,13 +7835,10 @@ stubs@^3.0.0: resolved "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz" integrity sha1-6NK6H6nJBXAwPAMLaQD31fiavls= -style-loader@^1.2.1: - version "1.2.1" - resolved "https://registry.npmjs.org/style-loader/-/style-loader-1.2.1.tgz" - integrity sha512-ByHSTQvHLkWE9Ir5+lGbVOXhxX10fbprhLvdg96wedFZb4NDekDPxVKv5Fwmio+QcMlkkNfuK+5W1peQ5CUhZg== - dependencies: - loader-utils "^2.0.0" - schema-utils "^2.6.6" +style-loader@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.1.tgz#057dfa6b3d4d7c7064462830f9113ed417d38575" + integrity sha512-GPcQ+LDJbrcxHORTRes6Jy2sfvK2kS6hpSfI/fXhPt+spVzxF6LJ1dHLN9zIGmVaaP044YKaIatFaufENRiDoQ== superstatic@^9.0.3: version "9.0.3" @@ -7974,12 +7880,12 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -supports-color@^6.1.0: - version "6.1.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz" - integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== +supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== dependencies: - has-flag "^3.0.0" + has-flag "^4.0.0" supports-hyperlinks@^2.2.0: version "2.2.0" @@ -7989,16 +7895,16 @@ supports-hyperlinks@^2.2.0: has-flag "^4.0.0" supports-color "^7.0.0" +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + taffydb@2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/taffydb/-/taffydb-2.6.2.tgz#7cbcb64b5a141b6a2efc2c5d2c67b4e150b2a268" integrity sha512-y3JaeRSplks6NYQuCOj3ZFMO3j60rTwbuKCvZxsAraGYH2epusatvZ0baZYA01WsGqJBq/Dl6vOrMUJqyMj8kA== -tapable@^1.0.0: - version "1.1.3" - resolved "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz" - integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== - tapable@^2.0.0, tapable@^2.1.1, tapable@^2.2.0: version "2.2.0" resolved "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz" @@ -8046,35 +7952,26 @@ teeny-request@^8.0.0: stream-events "^1.0.5" uuid "^9.0.0" -terser-webpack-plugin@^5.1.1: - version "5.1.1" - resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.1.tgz" - integrity sha512-5XNNXZiR8YO6X6KhSGXfY0QrGrCRlSwAEjIIrlRQR4W8nP69TaJUlh3bkuac6zzgspiGPfKEHcY295MMVExl5Q== - dependencies: - jest-worker "^26.6.2" - p-limit "^3.1.0" - schema-utils "^3.0.0" - serialize-javascript "^5.0.1" - source-map "^0.6.1" - terser "^5.5.1" - -terser@^4.6.3: - version "4.8.0" - resolved "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz" - integrity sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw== +terser-webpack-plugin@^5.1.3: + version "5.3.6" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.6.tgz#5590aec31aa3c6f771ce1b1acca60639eab3195c" + integrity sha512-kfLFk+PoLUQIbLmB1+PZDMRSZS99Mp+/MHqDNmMA6tOItzRt+Npe3E+fsMs5mfcM0wCtrrdU387UnV+vnSffXQ== dependencies: - commander "^2.20.0" - source-map "~0.6.1" - source-map-support "~0.5.12" + "@jridgewell/trace-mapping" "^0.3.14" + jest-worker "^27.4.5" + schema-utils "^3.1.1" + serialize-javascript "^6.0.0" + terser "^5.14.1" -terser@^5.5.1: - version "5.5.1" - resolved "https://registry.npmjs.org/terser/-/terser-5.5.1.tgz" - integrity sha512-6VGWZNVP2KTUcltUQJ25TtNjx/XgdDsBDKGt8nN0MpydU36LmbPPcMBd2kmtZNNGVVDLg44k7GKeHHj+4zPIBQ== +terser@^5.10.0, terser@^5.14.1: + version "5.16.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.16.1.tgz#5af3bc3d0f24241c7fb2024199d5c461a1075880" + integrity sha512-xvQfyfA1ayT0qdK47zskQgRZeWLoOQ8JQ6mIgRGVNwZKdQMU+5FkCBjmv4QjcrTzyZquRw2FVtlJSRUmMKQslw== dependencies: + "@jridgewell/source-map" "^0.3.2" + acorn "^8.5.0" commander "^2.20.0" - source-map "~0.7.2" - source-map-support "~0.5.19" + source-map-support "~0.5.20" text-decoding@^1.0.0: version "1.0.0" @@ -8191,26 +8088,25 @@ ts-node@^10.9.1: v8-compile-cache-lib "^3.0.1" yn "3.1.1" -tsconfig-paths-webpack-plugin@^3.3.0: - version "3.3.0" - resolved "https://registry.npmjs.org/tsconfig-paths-webpack-plugin/-/tsconfig-paths-webpack-plugin-3.3.0.tgz" - integrity sha512-MpQeZpwPY4gYASCUjY4yt2Zj8yv86O8f++3Ai4o0yI0fUC6G1syvnL9VuY71PBgimRYDQU47f12BEmJq9wRaSw== +tsconfig-paths-webpack-plugin@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths-webpack-plugin/-/tsconfig-paths-webpack-plugin-4.0.0.tgz#84008fc3e3e0658fdb0262758b07b4da6265ff1a" + integrity sha512-fw/7265mIWukrSHd0i+wSwx64kYUSAKPfxRDksjKIYTxSAp9W9/xcZVBF4Kl0eqQd5eBpAQ/oQrc5RyM/0c1GQ== dependencies: - chalk "^2.3.0" - enhanced-resolve "^4.0.0" - tsconfig-paths "^3.4.0" + chalk "^4.1.0" + enhanced-resolve "^5.7.0" + tsconfig-paths "^4.0.0" -tsconfig-paths@^3.4.0, tsconfig-paths@^3.9.0: - version "3.9.0" - resolved "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz" - integrity sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw== +tsconfig-paths@^4.0.0, tsconfig-paths@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.1.1.tgz#7f23094ce897fcf4a93f67c4776e813003e48b75" + integrity sha512-VgPrtLKpRgEAJsMj5Q/I/mXouC6A/7eJ/X4Nuk6o0cRPwBtznYxTCU4FodbexbzH9somBPEXYi0ZkUViUpJ21Q== dependencies: - "@types/json5" "^0.0.29" - json5 "^1.0.1" - minimist "^1.2.0" + json5 "^2.2.1" + minimist "^1.2.6" strip-bom "^3.0.0" -tslib@^1.10.0, tslib@^1.13.0, tslib@^1.8.1, tslib@^1.9.0: +tslib@^1.13.0, tslib@^1.8.1, tslib@^1.9.0: version "1.13.0" resolved "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz" integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q== @@ -8225,7 +8121,7 @@ tslib@^2.0.1: resolved "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== -tslib@^2.1.0: +tslib@^2.0.3, tslib@^2.1.0: version "2.4.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== @@ -8463,12 +8359,12 @@ url-join@0.0.1: resolved "https://registry.npmjs.org/url-join/-/url-join-0.0.1.tgz" integrity sha1-HbSK1CLTQCRpqH99l73r/k+x48g= -util-deprecate@^1.0.1, util-deprecate@~1.0.1: +util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= -utila@^0.4.0, utila@~0.4: +utila@~0.4: version "0.4.0" resolved "https://registry.npmjs.org/utila/-/utila-0.4.0.tgz" integrity sha1-ihagXURWV6Oupe7MWxKk+lN5dyw= @@ -8498,11 +8394,6 @@ v8-compile-cache-lib@^3.0.1: resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== -v8-compile-cache@^2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz" - integrity sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q== - valid-url@^1: version "1.0.9" resolved "https://registry.npmjs.org/valid-url/-/valid-url-1.0.9.tgz" @@ -8540,10 +8431,10 @@ vscode-textmate@^6.0.0: resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-6.0.0.tgz#a3777197235036814ac9a92451492f2748589210" integrity sha512-gu73tuZfJgu+mvCSy4UZwd2JXykjK9zAZsfmDeut5dx/1a7FeTk0XwJsSuqQn+cuMCGVbIBfl+s53X4T19DnzQ== -watchpack@^2.0.0: - version "2.1.0" - resolved "https://registry.npmjs.org/watchpack/-/watchpack-2.1.0.tgz" - integrity sha512-UjgD1mqjkG99+3lgG36at4wPnUXNvis2v1utwTgQ43C22c4LD71LsYMExdWXh4HZ+RmW+B0t1Vrg2GpXAkTOQw== +watchpack@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d" + integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" @@ -8560,53 +8451,44 @@ webidl-conversions@^3.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== -webpack-cli@^4.1.0: - version "4.3.1" - resolved "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.3.1.tgz" - integrity sha512-/F4+9QNZM/qKzzL9/06Am8NXIkGV+/NqQ62Dx7DSqudxxpAgBqYn6V7+zp+0Y7JuWksKUbczRY3wMTd+7Uj6OA== +webpack-cli@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-5.0.1.tgz#95fc0495ac4065e9423a722dec9175560b6f2d9a" + integrity sha512-S3KVAyfwUqr0Mo/ur3NzIp6jnerNpo7GUO6so51mxLi1spqsA17YcMXy0WOIJtBSnj748lthxC6XLbNKh/ZC+A== dependencies: "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/info" "^1.2.1" - "@webpack-cli/serve" "^1.2.1" - colorette "^1.2.1" - commander "^6.2.0" - enquirer "^2.3.6" - execa "^5.0.0" + "@webpack-cli/configtest" "^2.0.1" + "@webpack-cli/info" "^2.0.1" + "@webpack-cli/serve" "^2.0.1" + colorette "^2.0.14" + commander "^9.4.1" + cross-spawn "^7.0.3" + envinfo "^7.7.3" fastest-levenshtein "^1.0.12" import-local "^3.0.2" - interpret "^2.2.0" - rechoir "^0.7.0" - v8-compile-cache "^2.2.0" - webpack-merge "^4.2.2" + interpret "^3.1.1" + rechoir "^0.8.0" + webpack-merge "^5.7.3" -webpack-dev-middleware@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-4.1.0.tgz" - integrity sha512-mpa/FY+DiBu5+r5JUIyTCYWRfkWgyA3/OOE9lwfzV9S70A4vJYLsVRKj5rMFEsezBroy2FmPyQ8oBRVW8QmK1A== +webpack-dev-middleware@*, webpack-dev-middleware@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-6.0.1.tgz#fd585127ed44dab3f253daf0d98f4d58a5088cc2" + integrity sha512-PZPZ6jFinmqVPJZbisfggDiC+2EeGZ1ZByyMP5sOFJcPPWSexalISz+cvm+j+oYPT7FIJyxT76esjnw9DhE5sw== dependencies: - colorette "^1.2.1" - mem "^8.0.0" - memfs "^3.2.0" - mime-types "^2.1.28" + colorette "^2.0.10" + memfs "^3.4.12" + mime-types "^2.1.31" range-parser "^1.2.1" - schema-utils "^3.0.0" + schema-utils "^4.0.0" -webpack-hot-middleware@^2.25.0: - version "2.25.0" - resolved "https://registry.npmjs.org/webpack-hot-middleware/-/webpack-hot-middleware-2.25.0.tgz" - integrity sha512-xs5dPOrGPCzuRXNi8F6rwhawWvQQkeli5Ro48PRuQh8pYPCPmNnltP9itiUPT4xI8oW+y0m59lyyeQk54s5VgA== - dependencies: - ansi-html "0.0.7" - html-entities "^1.2.0" - querystring "^0.2.0" - strip-ansi "^3.0.0" - -webpack-merge@^4.2.2: - version "4.2.2" - resolved "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz" - integrity sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g== +webpack-hot-middleware@^2.25.3: + version "2.25.3" + resolved "https://registry.yarnpkg.com/webpack-hot-middleware/-/webpack-hot-middleware-2.25.3.tgz#be343ce2848022cfd854dd82820cd730998c6794" + integrity sha512-IK/0WAHs7MTu1tzLTjio73LjS3Ov+VvBKQmE8WPlJutgG5zT6Urgq/BbAdRrHTRpyzK0dvAvFh1Qg98akxgZpA== dependencies: - lodash "^4.17.15" + ansi-html-community "0.0.8" + html-entities "^2.1.0" + strip-ansi "^6.0.0" webpack-merge@^5.7.3: version "5.7.3" @@ -8616,55 +8498,53 @@ webpack-merge@^5.7.3: clone-deep "^4.0.1" wildcard "^2.0.0" -webpack-node-externals@^2.5.2: - version "2.5.2" - resolved "https://registry.npmjs.org/webpack-node-externals/-/webpack-node-externals-2.5.2.tgz" - integrity sha512-aHdl/y2N7PW2Sx7K+r3AxpJO+aDMcYzMQd60Qxefq3+EwhewSbTBqNumOsCE1JsCUNoyfGj5465N0sSf6hc/5w== - -webpack-sources@^1.1.0: - version "1.4.3" - resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz" - integrity sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ== +webpack-merge@^5.8.0: + version "5.8.0" + resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.8.0.tgz#2b39dbf22af87776ad744c390223731d30a68f61" + integrity sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q== dependencies: - source-list-map "^2.0.0" - source-map "~0.6.1" + clone-deep "^4.0.1" + wildcard "^2.0.0" -webpack-sources@^2.1.1: - version "2.2.0" - resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz" - integrity sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w== - dependencies: - source-list-map "^2.0.1" - source-map "^0.6.1" - -webpack@^5.24.2: - version "5.24.2" - resolved "https://registry.npmjs.org/webpack/-/webpack-5.24.2.tgz" - integrity sha512-uxxKYEY4kMNjP+D2Y+8aw5Vd7ar4pMuKCNemxV26ysr1nk0YDiQTylg9U3VZIdkmI0YHa0uC8ABxL+uGxGWWJg== - dependencies: - "@types/eslint-scope" "^3.7.0" - "@types/estree" "^0.0.46" - "@webassemblyjs/ast" "1.11.0" - "@webassemblyjs/wasm-edit" "1.11.0" - "@webassemblyjs/wasm-parser" "1.11.0" - acorn "^8.0.4" +webpack-node-externals@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/webpack-node-externals/-/webpack-node-externals-3.0.0.tgz#1a3407c158d547a9feb4229a9e3385b7b60c9917" + integrity sha512-LnL6Z3GGDPht/AigwRh2dvL9PQPFQ8skEpVrWZXLWBYmqcaojHNN0onvHzie6rq7EWKrrBfPYqNEzTJgiwEQDQ== + +webpack-sources@^3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" + integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== + +webpack@^5, webpack@^5.75.0: + version "5.75.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.75.0.tgz#1e440468647b2505860e94c9ff3e44d5b582c152" + integrity sha512-piaIaoVJlqMsPtX/+3KTTO6jfvrSYgauFVdt8cr9LTHKmcq/AMd4mhzsiP7ZF/PGRNPGA8336jldh9l2Kt2ogQ== + dependencies: + "@types/eslint-scope" "^3.7.3" + "@types/estree" "^0.0.51" + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/wasm-edit" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + acorn "^8.7.1" + acorn-import-assertions "^1.7.6" browserslist "^4.14.5" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.7.0" - es-module-lexer "^0.4.0" - eslint-scope "^5.1.1" + enhanced-resolve "^5.10.0" + es-module-lexer "^0.9.0" + eslint-scope "5.1.1" events "^3.2.0" glob-to-regexp "^0.4.1" - graceful-fs "^4.2.4" - json-parse-better-errors "^1.0.2" + graceful-fs "^4.2.9" + json-parse-even-better-errors "^2.3.1" loader-runner "^4.2.0" mime-types "^2.1.27" neo-async "^2.6.2" - schema-utils "^3.0.0" + schema-utils "^3.1.0" tapable "^2.1.1" - terser-webpack-plugin "^5.1.1" - watchpack "^2.0.0" - webpack-sources "^2.1.1" + terser-webpack-plugin "^5.1.3" + watchpack "^2.4.0" + webpack-sources "^3.2.3" websocket-driver@>=0.5.1: version "0.7.4" From d5a6cc2ce9fd8cfe2612877fea840545b7608bd1 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Thu, 29 Dec 2022 10:10:07 +0800 Subject: [PATCH 03/36] Upgrade Typesaurus --- package.json | 4 ++-- yarn.lock | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 7f99d937..6f217822 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "start": "env NODE_ENV=development ts-node -r tsconfig-paths/register devServer.ts" }, "dependencies": { - "@date-fns/docs": "0.4.0", + "@date-fns/docs": "0.5.0", "@nyancss/css-modules-loader": "^1.1.0", "@nyancss/react": "^1.3.0", "@sentry/browser": "^5.30.0", @@ -71,7 +71,7 @@ "tsconfig-paths-webpack-plugin": "^4.0.0", "tslint": "~6.1.3", "typeroo": "^0.9.0", - "typesaurus": "10.0.0-alpha.40", + "typesaurus": "10.0.0-alpha.41", "typescript": "^4.9.4", "webpack": "^5.75.0", "webpack-cli": "^5.0.1", diff --git a/yarn.lock b/yarn.lock index 9e0d8a0f..e826cae5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -49,16 +49,16 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@date-fns/docs@0.4.0": - version "0.4.0" - resolved "https://registry.yarnpkg.com/@date-fns/docs/-/docs-0.4.0.tgz#9c31b70ce52b198948dc9a8cb89c76967c0fdd2e" - integrity sha512-U5fkCFDTnqtOsiKWIusJTRPSma+jPwnLPSGjOdPopkOX1yOWSfLG4ys7L6yYwZ1hO7rTybRu9GfYuGR+kR3Umg== +"@date-fns/docs@0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@date-fns/docs/-/docs-0.5.0.tgz#43d2e0b388265c55a3103e5e710aa41de80c2b6f" + integrity sha512-E3c0Yh3c/4qBkr5GzvDpMNiFisVZqg/z7K5eQsSYE3+R98R3NyL2xPPl314MpTfcZmIW8pyTqI+hU7mgGIHnrw== dependencies: firebase-admin "^11.4.1" js-fns "^2.5.2" typedoc "^0.23.23" typeroo "^0.9.0" - typesaurus "^10.0.0-alpha.40" + typesaurus "^10.0.0-alpha.41" "@discoveryjs/json-ext@^0.5.0": version "0.5.2" @@ -8226,10 +8226,10 @@ typeroo@^0.9.0: resolved "https://registry.yarnpkg.com/typeroo/-/typeroo-0.9.0.tgz#34886e8529423462cd876c8090745b578f83cc9e" integrity sha512-dVYoqIFk1OeKuDU3pwdQEsUuTosrf3oIHzXBm+/YaemahBe6iDUZl08MStcyVBPplOfK8Hp4CY1nHZEClqNsuw== -typesaurus@10.0.0-alpha.40, typesaurus@^10.0.0-alpha.40: - version "10.0.0-alpha.40" - resolved "https://registry.yarnpkg.com/typesaurus/-/typesaurus-10.0.0-alpha.40.tgz#022bb1a90a01cc4ee05a35c1c6ccadbd1232afae" - integrity sha512-tzfcGzXOJmOXvPBie8MZVCvbf0qV5vKZgOiYtaZkGJW0SmAZmzQeuxItcS7O9/T+AtBYOzwuhRCqKUIHN4u5VA== +typesaurus@10.0.0-alpha.41, typesaurus@^10.0.0-alpha.41: + version "10.0.0-alpha.41" + resolved "https://registry.yarnpkg.com/typesaurus/-/typesaurus-10.0.0-alpha.41.tgz#c6c9dffedbf06f7b6375c7ff01720f01e952c635" + integrity sha512-K3c8pwpkzMiSG8joVLcRcgZTxe20QDObdKP2eJNU8P+bRpDIvF5y3jDkz+teUoqtAp6CAlO1ZXucl9gQhwK3DA== typescript@^4.9.4: version "4.9.4" From 26dafc18f2a064ae20543a1db1f609a262cb51e9 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Thu, 29 Dec 2022 10:16:51 +0800 Subject: [PATCH 04/36] Rearrange init code --- src/web/index.tsx | 7 +------ src/web/init.ts | 6 ++++++ 2 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 src/web/init.ts diff --git a/src/web/index.tsx b/src/web/index.tsx index 7b4ef258..5866d316 100644 --- a/src/web/index.tsx +++ b/src/web/index.tsx @@ -1,12 +1,7 @@ +import './init' import { h, render } from 'preact' import { UI } from '~/ui' import { RouterContext, useRouter } from '~/ui/router' -import firebase from 'firebase/app' -import { CONFIG, SENTRY_URL } from '~/constants' -import { initSentry } from '~/utils/sentry' - -firebase.initializeApp(CONFIG.firebaseApp) -initSentry(SENTRY_URL) const ClientUI = () => { const router = useRouter(location.href) diff --git a/src/web/init.ts b/src/web/init.ts new file mode 100644 index 00000000..1e7cf3c3 --- /dev/null +++ b/src/web/init.ts @@ -0,0 +1,6 @@ +import { initializeApp } from 'firebase/app' +import { CONFIG, SENTRY_URL } from '~/constants' +import { initSentry } from '~/utils/sentry' + +initializeApp(CONFIG.firebaseApp) +initSentry(SENTRY_URL) From f761f718c01b840658d92cf1825dc03080e7a57f Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Thu, 29 Dec 2022 11:24:35 +0800 Subject: [PATCH 05/36] Add v3 docs schema migration --- .gitignore | 2 +- scripts/migrations/migrateV3.ts | 59 +++++++++++++++++++++++++++++++++ src/constants.ts | 4 +-- 3 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 scripts/migrations/migrateV3.ts diff --git a/.gitignore b/.gitignore index 789949ca..e933a712 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,4 @@ yarn-error.log .DS_Store FIXME_* *.log -/secrets \ No newline at end of file +/secrets diff --git a/scripts/migrations/migrateV3.ts b/scripts/migrations/migrateV3.ts new file mode 100644 index 00000000..fa5e7efa --- /dev/null +++ b/scripts/migrations/migrateV3.ts @@ -0,0 +1,59 @@ +import { db, JSDocFunction, JSDocPage, MarkdownPage } from '@date-fns/docs/db' +import * as admin from 'firebase-admin' +import { last } from 'lodash' +import { StringifiedJSON } from 'typeroo/json' +import { schema, Typesaurus } from 'typesaurus' + +admin.initializeApp() + +type Page = + | MarkdownPage + | (Omit & { + doc: { json: string } + }) + +const oldDb = schema(($) => ({ + pages: $.collection(), +})) + +type OldSchema = Typesaurus.Schema + +const maxPageSize = 100 + +processAll((pages) => + Promise.all( + pages.map((page) => { + if (page.data.type === 'markdown') return + return db.pages.update(page.ref.id, { + doc: page.data.doc.json as StringifiedJSON, + }) + }) + ) +) + .then(() => console.log('Done')) + .catch((error) => { + console.error(error) + process.exit(1) + }) + +type ChunkCallback = (chunk: OldSchema['pages']['Doc'][]) => unknown + +async function processAll( + cb: ChunkCallback, + cursor?: OldSchema['pages']['Doc'] +) { + const { pageSize, nextCursor } = await processChunk(cb, cursor) + if (nextCursor && pageSize === maxPageSize) await processAll(cb, nextCursor) +} + +async function processChunk( + cb: ChunkCallback, + cursor?: OldSchema['pages']['Doc'] +) { + const chunk = await oldDb.pages.query(($) => [ + $.field($.docId()).order('asc', cursor && $.startAfter(cursor)), + $.limit(maxPageSize), + ]) + await cb(chunk) + return { pageSize: chunk.length, nextCursor: last(chunk) } +} diff --git a/src/constants.ts b/src/constants.ts index 49399894..42e1f146 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -33,8 +33,8 @@ const config: { [k: string]: Config } = { development: { jobsURL: 'https://jobs.date-fns.org', firebaseApp: { - apiKey: 'AIzaSyBoDBiIbKeiu4-Uz4JzqH3X7pwbop2PfpU', - projectId: 'date-fns-org', + apiKey: 'AIzaSyArPabWWebnLWhEgITZbLjTA6I_BaDmF0E', + projectId: 'date-fns-org-staging', }, apiURL: '/api', }, From 3247b6e8f5d6d54ad40439af07be361434132cf9 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Sat, 31 Dec 2022 11:41:40 +0800 Subject: [PATCH 06/36] TSDoc rendering prototype --- package.json | 2 +- scripts/migrations/migratePackages.ts | 12 +++ scripts/migrations/migrateV3.ts | 8 +- .../DocExamples}/index.tsx | 2 +- .../DocExamples}/style.css | 0 .../DocExamples}/style.css.d.ts | 0 src/ui/components/DocParams/index.tsx | 8 +- .../Usage => components/DocUsage}/Content.tsx | 0 .../Usage => components/DocUsage}/index.tsx | 6 +- .../Usage => components/DocUsage}/style.css | 0 .../DocUsage}/style.css.d.ts | 0 src/ui/index.tsx | 2 +- src/ui/router/DocLinkContext.ts | 2 +- src/ui/router/docLink.ts | 5 +- src/ui/router/index.ts | 11 ++- src/ui/screens/Docs/Doc/Content.tsx | 11 +-- .../Docs/Doc/JSDoc/Arguments/index.tsx | 4 +- .../Docs/Doc/JSDoc/Exceptions/index.tsx | 4 +- .../Docs/Doc/JSDoc/Properties/index.tsx | 4 +- .../screens/Docs/Doc/JSDoc/Returns/index.tsx | 4 +- src/ui/screens/Docs/Doc/JSDoc/index.tsx | 12 +-- .../Docs/Doc/TSDoc/Arguments/index.tsx | 31 +++++++ .../Docs/Doc/TSDoc/Exceptions/index.tsx | 37 ++++++++ src/ui/screens/Docs/Doc/TSDoc/Issue/index.tsx | 54 ++++++++++++ .../Docs/Doc/TSDoc/Issue/templateText.ts | 62 ++++++++++++++ .../Docs/Doc/TSDoc/Properties/index.tsx | 31 +++++++ .../screens/Docs/Doc/TSDoc/Returns/index.tsx | 37 ++++++++ .../screens/Docs/Doc/TSDoc/Syntax/index.tsx | 18 ++++ src/ui/screens/Docs/Doc/TSDoc/index.tsx | 85 +++++++++++++++++++ src/ui/screens/Docs/Doc/TSDoc/style.css | 3 + src/ui/screens/Docs/Doc/TSDoc/style.css.d.ts | 3 + src/ui/screens/Docs/Doc/index.tsx | 6 +- src/ui/screens/Docs/Finder/Categories.tsx | 6 +- src/ui/screens/Docs/Finder/Items.tsx | 6 +- src/ui/screens/Docs/Finder/index.tsx | 6 +- src/ui/screens/Docs/Finder/utils.ts | 6 +- .../screens/Docs/NavBar/LatestVersionLink.tsx | 4 +- .../screens/Docs/NavBar/SubmoduleSelector.tsx | 8 +- .../screens/Docs/NavBar/VersionSelector.tsx | 6 +- src/ui/screens/Docs/NavBar/index.tsx | 7 +- src/ui/screens/Docs/index.tsx | 20 +++-- src/utils/versions/index.tsx | 8 +- yarn.lock | 8 +- 43 files changed, 466 insertions(+), 83 deletions(-) create mode 100644 scripts/migrations/migratePackages.ts rename src/ui/{screens/Docs/Doc/JSDoc/Examples => components/DocExamples}/index.tsx (90%) rename src/ui/{screens/Docs/Doc/JSDoc/Examples => components/DocExamples}/style.css (100%) rename src/ui/{screens/Docs/Doc/JSDoc/Examples => components/DocExamples}/style.css.d.ts (100%) rename src/ui/{screens/Docs/Doc/JSDoc/Usage => components/DocUsage}/Content.tsx (100%) rename src/ui/{screens/Docs/Doc/JSDoc/Usage => components/DocUsage}/index.tsx (91%) rename src/ui/{screens/Docs/Doc/JSDoc/Usage => components/DocUsage}/style.css (100%) rename src/ui/{screens/Docs/Doc/JSDoc/Usage => components/DocUsage}/style.css.d.ts (100%) create mode 100644 src/ui/screens/Docs/Doc/TSDoc/Arguments/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TSDoc/Exceptions/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TSDoc/Issue/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TSDoc/Issue/templateText.ts create mode 100644 src/ui/screens/Docs/Doc/TSDoc/Properties/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TSDoc/Syntax/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TSDoc/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TSDoc/style.css create mode 100644 src/ui/screens/Docs/Doc/TSDoc/style.css.d.ts diff --git a/package.json b/package.json index 6f217822..c29c8355 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "start": "env NODE_ENV=development ts-node -r tsconfig-paths/register devServer.ts" }, "dependencies": { - "@date-fns/docs": "0.5.0", + "@date-fns/docs": "0.12.1", "@nyancss/css-modules-loader": "^1.1.0", "@nyancss/react": "^1.3.0", "@sentry/browser": "^5.30.0", diff --git a/scripts/migrations/migratePackages.ts b/scripts/migrations/migratePackages.ts new file mode 100644 index 00000000..949b8bee --- /dev/null +++ b/scripts/migrations/migratePackages.ts @@ -0,0 +1,12 @@ +import { db } from '@date-fns/docs' +import * as admin from 'firebase-admin' + +admin.initializeApp() + +db.packages + .all() + .then((packages) => + Promise.all( + packages.map((p) => db.packages.set(db.packages.id(p.data.name), p.data)) + ) + ) diff --git a/scripts/migrations/migrateV3.ts b/scripts/migrations/migrateV3.ts index fa5e7efa..396fcfc0 100644 --- a/scripts/migrations/migrateV3.ts +++ b/scripts/migrations/migrateV3.ts @@ -1,4 +1,4 @@ -import { db, JSDocFunction, JSDocPage, MarkdownPage } from '@date-fns/docs/db' +import { db, DateFnsDocs } from '@date-fns/docs' import * as admin from 'firebase-admin' import { last } from 'lodash' import { StringifiedJSON } from 'typeroo/json' @@ -7,8 +7,8 @@ import { schema, Typesaurus } from 'typesaurus' admin.initializeApp() type Page = - | MarkdownPage - | (Omit & { + | DateFnsDocs.MarkdownPage + | (Omit & { doc: { json: string } }) @@ -25,7 +25,7 @@ processAll((pages) => pages.map((page) => { if (page.data.type === 'markdown') return return db.pages.update(page.ref.id, { - doc: page.data.doc.json as StringifiedJSON, + doc: page.data.doc.json as StringifiedJSON, }) }) ) diff --git a/src/ui/screens/Docs/Doc/JSDoc/Examples/index.tsx b/src/ui/components/DocExamples/index.tsx similarity index 90% rename from src/ui/screens/Docs/Doc/JSDoc/Examples/index.tsx rename to src/ui/components/DocExamples/index.tsx index 3457216f..decf9533 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/Examples/index.tsx +++ b/src/ui/components/DocExamples/index.tsx @@ -9,7 +9,7 @@ interface Props { examples: string[] | string } -export const Examples: FunctionComponent = ({ examples }) => ( +export const DocExamples: FunctionComponent = ({ examples }) => (

Examples diff --git a/src/ui/screens/Docs/Doc/JSDoc/Examples/style.css b/src/ui/components/DocExamples/style.css similarity index 100% rename from src/ui/screens/Docs/Doc/JSDoc/Examples/style.css rename to src/ui/components/DocExamples/style.css diff --git a/src/ui/screens/Docs/Doc/JSDoc/Examples/style.css.d.ts b/src/ui/components/DocExamples/style.css.d.ts similarity index 100% rename from src/ui/screens/Docs/Doc/JSDoc/Examples/style.css.d.ts rename to src/ui/components/DocExamples/style.css.d.ts diff --git a/src/ui/components/DocParams/index.tsx b/src/ui/components/DocParams/index.tsx index 74c41a2d..066ee369 100644 --- a/src/ui/components/DocParams/index.tsx +++ b/src/ui/components/DocParams/index.tsx @@ -1,10 +1,10 @@ import { h, FunctionComponent, Fragment } from 'preact' -import { JSDocParam, JSDocType } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs' import { Markdown } from '~/ui/components/Markdown' import { OptionalLabel, PropsLabel } from './style.css' interface Props { - params: JSDocParam[] + params: DateFnsDocs.JSDocParam[] } export const DocParams: FunctionComponent = ({ params }) => ( @@ -40,7 +40,7 @@ const ParamOptionalLabel: FunctionComponent<{ ) const ParamPropsTable: FunctionComponent<{ - props: JSDocParam[] + props: DateFnsDocs.JSDocParam[] }> = ({ props }) => (
Properties: @@ -62,7 +62,7 @@ const ParamPropsTable: FunctionComponent<{ ) const ParamType: FunctionComponent<{ - type: JSDocType + type: DateFnsDocs.JSDocType variable?: boolean }> = ({ type, variable }) => { const names = type.names diff --git a/src/ui/screens/Docs/Doc/JSDoc/Usage/Content.tsx b/src/ui/components/DocUsage/Content.tsx similarity index 100% rename from src/ui/screens/Docs/Doc/JSDoc/Usage/Content.tsx rename to src/ui/components/DocUsage/Content.tsx diff --git a/src/ui/screens/Docs/Doc/JSDoc/Usage/index.tsx b/src/ui/components/DocUsage/index.tsx similarity index 91% rename from src/ui/screens/Docs/Doc/JSDoc/Usage/index.tsx rename to src/ui/components/DocUsage/index.tsx index 65782d54..c6936f56 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/Usage/index.tsx +++ b/src/ui/components/DocUsage/index.tsx @@ -1,6 +1,6 @@ import { h, FunctionComponent } from 'preact' import { useEffect, useState } from 'preact/hooks' -import { JSDocUsage } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs/types' import { Options, Option, OptionLink } from './style.css' import { Content } from './Content' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' @@ -9,13 +9,13 @@ const LOCALSTORAGE_KEY = 'usageSource' const DEFAULT_SOURCE = 'commonjs' interface Props { - usage: JSDocUsage + usage: DateFnsDocs.FnUsage usageTabs: string[] } type FIXME = any -export const Usage: FunctionComponent = ({ usageTabs, usage }) => { +export const DocUsage: FunctionComponent = ({ usageTabs, usage }) => { const [source, setSource] = useState(DEFAULT_SOURCE) useEffect(() => { diff --git a/src/ui/screens/Docs/Doc/JSDoc/Usage/style.css b/src/ui/components/DocUsage/style.css similarity index 100% rename from src/ui/screens/Docs/Doc/JSDoc/Usage/style.css rename to src/ui/components/DocUsage/style.css diff --git a/src/ui/screens/Docs/Doc/JSDoc/Usage/style.css.d.ts b/src/ui/components/DocUsage/style.css.d.ts similarity index 100% rename from src/ui/screens/Docs/Doc/JSDoc/Usage/style.css.d.ts rename to src/ui/components/DocUsage/style.css.d.ts diff --git a/src/ui/index.tsx b/src/ui/index.tsx index caadd6cf..c6799cef 100644 --- a/src/ui/index.tsx +++ b/src/ui/index.tsx @@ -6,7 +6,7 @@ import { Docs } from '~/ui/screens/Docs' import { NotFound } from '~/ui/screens/NotFound' import 'reset.css/reset.css?global' import './global.css?global' -import { defaultSubmodule } from '@date-fns/docs/db' +import { defaultSubmodule } from '@date-fns/docs/consts' const win = typeof window !== 'undefined' ? window : undefined diff --git a/src/ui/router/DocLinkContext.ts b/src/ui/router/DocLinkContext.ts index efc4bfbe..237ec3ee 100644 --- a/src/ui/router/DocLinkContext.ts +++ b/src/ui/router/DocLinkContext.ts @@ -1,5 +1,5 @@ import { createContext } from 'preact' -import { defaultSubmodule } from '@date-fns/docs/db' +import { defaultSubmodule } from '@date-fns/docs/consts' import { DocLinkParams } from '~/ui/router/docLink' export const DocLinkContext = createContext>({ diff --git a/src/ui/router/docLink.ts b/src/ui/router/docLink.ts index 460e73d1..30871e91 100644 --- a/src/ui/router/docLink.ts +++ b/src/ui/router/docLink.ts @@ -1,9 +1,10 @@ -import { defaultSubmodule, Submodule } from '@date-fns/docs/db' +import { DateFnsDocs } from '@date-fns/docs' +import { defaultSubmodule } from '@date-fns/docs/consts' import { AppRouteRef } from '~/ui/router' export interface DocLinkParams { page: string - submodule?: Submodule + submodule?: DateFnsDocs.Submodule version?: string } export function docLink({ diff --git a/src/ui/router/index.ts b/src/ui/router/index.ts index 5bbba1dd..3813d423 100644 --- a/src/ui/router/index.ts +++ b/src/ui/router/index.ts @@ -1,4 +1,4 @@ -import { Submodule } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs' import { createRouter, InferRouteRef, route } from '@switcher/preact' export const appRoutes = [ @@ -11,13 +11,16 @@ export const appRoutes = [ ), route( 'submoduleDocs', - (params: { submodule: Submodule; page: string }) => + (params: { submodule: DateFnsDocs.Submodule; page: string }) => `/docs/${params.submodule}/${params.page}` ), route( 'submoduleVersionDocs', - (params: { submodule: Submodule; version: string; page: string }) => - `/${params.version}/docs/${params.submodule}/${params.page}` + (params: { + submodule: DateFnsDocs.Submodule + version: string + page: string + }) => `/${params.version}/docs/${params.submodule}/${params.page}` ), ] diff --git a/src/ui/screens/Docs/Doc/Content.tsx b/src/ui/screens/Docs/Doc/Content.tsx index 3b3aadbe..3efe301d 100644 --- a/src/ui/screens/Docs/Doc/Content.tsx +++ b/src/ui/screens/Docs/Doc/Content.tsx @@ -1,21 +1,18 @@ import { h, FunctionComponent } from 'preact' -import { Page } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs/types' import { parse } from 'typeroo/json' import { JSDoc } from './JSDoc' import { MarkdownDoc } from './MarkdownDoc' +import { TSDoc } from './TSDoc' interface Props { - page: Page + page: DateFnsDocs.Page } export const Content: FunctionComponent = ({ page }) => { switch (page.type) { case 'tsdoc': - return ( -
-          {JSON.stringify(page)}
-        
- ) + return case 'jsdoc': return diff --git a/src/ui/screens/Docs/Doc/JSDoc/Arguments/index.tsx b/src/ui/screens/Docs/Doc/JSDoc/Arguments/index.tsx index b5151775..1e90149f 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/Arguments/index.tsx +++ b/src/ui/screens/Docs/Doc/JSDoc/Arguments/index.tsx @@ -1,10 +1,10 @@ import { h, FunctionComponent } from 'preact' -import { JSDocParam } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs/types' import { DocParams } from '~/ui/components/DocParams' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' interface Props { - args: JSDocParam[] + args: DateFnsDocs.JSDocParam[] } export const Arguments: FunctionComponent = ({ args }) => ( diff --git a/src/ui/screens/Docs/Doc/JSDoc/Exceptions/index.tsx b/src/ui/screens/Docs/Doc/JSDoc/Exceptions/index.tsx index 37c2df7c..f6d36851 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/Exceptions/index.tsx +++ b/src/ui/screens/Docs/Doc/JSDoc/Exceptions/index.tsx @@ -1,10 +1,10 @@ import { h, FunctionComponent } from 'preact' -import { JSDocAttribute } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs/types' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' import { Markdown } from '~/ui/components/Markdown' interface Props { - exceptions: JSDocAttribute[] + exceptions: DateFnsDocs.JSDocAttribute[] } export const Exceptions: FunctionComponent = ({ exceptions }) => ( diff --git a/src/ui/screens/Docs/Doc/JSDoc/Properties/index.tsx b/src/ui/screens/Docs/Doc/JSDoc/Properties/index.tsx index c3dc4dd1..2bdde3ab 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/Properties/index.tsx +++ b/src/ui/screens/Docs/Doc/JSDoc/Properties/index.tsx @@ -1,10 +1,10 @@ import { h, FunctionComponent } from 'preact' -import { JSDocParam } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs/types' import { DocParams } from '~/ui/components/DocParams' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' interface Props { - properties: JSDocParam[] + properties: DateFnsDocs.JSDocParam[] } export const Properties: FunctionComponent = ({ properties }) => ( diff --git a/src/ui/screens/Docs/Doc/JSDoc/Returns/index.tsx b/src/ui/screens/Docs/Doc/JSDoc/Returns/index.tsx index 571c757b..a5fd188d 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/Returns/index.tsx +++ b/src/ui/screens/Docs/Doc/JSDoc/Returns/index.tsx @@ -1,10 +1,10 @@ import { h, FunctionComponent } from 'preact' -import { JSDocAttribute } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs/types' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' import { Markdown } from '~/ui/components/Markdown' interface Props { - returns: JSDocAttribute[] + returns: DateFnsDocs.JSDocAttribute[] } export const Returns: FunctionComponent = ({ returns }) => ( diff --git a/src/ui/screens/Docs/Doc/JSDoc/index.tsx b/src/ui/screens/Docs/Doc/JSDoc/index.tsx index 311ba78f..8aa1286e 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/index.tsx +++ b/src/ui/screens/Docs/Doc/JSDoc/index.tsx @@ -1,19 +1,19 @@ -import { JSDocFunction } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs/types' import { FunctionComponent, h } from 'preact' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' import { Markdown } from '~/ui/components/Markdown' import { Arguments } from './Arguments' -import { Examples } from './Examples' +import { DocExamples } from '../../../../components/DocExamples' import { Exceptions } from './Exceptions' import Issue from './Issue' import { Properties } from './Properties' import { Returns } from './Returns' import { Header } from './style.css' import { Syntax } from './Syntax' -import { Usage } from './Usage' +import { DocUsage } from '~/ui/components/DocUsage' interface Props { - doc: JSDocFunction + doc: DateFnsDocs.JSDocFunction } export const JSDoc: FunctionComponent = ({ doc }) => ( @@ -32,7 +32,7 @@ export const JSDoc: FunctionComponent = ({ doc }) => (

{doc.usage && doc.usageTabs && ( - + )} {doc.syntax && } {doc.args && doc.args.length > 0 && } @@ -43,7 +43,7 @@ export const JSDoc: FunctionComponent = ({ doc }) => ( {doc.content.exceptions && ( )} - {doc.content.examples && } + {doc.content.examples && } diff --git a/src/ui/screens/Docs/Doc/TSDoc/Arguments/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Arguments/index.tsx new file mode 100644 index 00000000..1e90149f --- /dev/null +++ b/src/ui/screens/Docs/Doc/TSDoc/Arguments/index.tsx @@ -0,0 +1,31 @@ +import { h, FunctionComponent } from 'preact' +import type { DateFnsDocs } from '@date-fns/docs/types' +import { DocParams } from '~/ui/components/DocParams' +import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' + +interface Props { + args: DateFnsDocs.JSDocParam[] +} + +export const Arguments: FunctionComponent = ({ args }) => ( +
+

+ Arguments + +

+ + + + + + + + + + + + + +
NameTypeDescription
+
+) diff --git a/src/ui/screens/Docs/Doc/TSDoc/Exceptions/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Exceptions/index.tsx new file mode 100644 index 00000000..f6d36851 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TSDoc/Exceptions/index.tsx @@ -0,0 +1,37 @@ +import { h, FunctionComponent } from 'preact' +import type { DateFnsDocs } from '@date-fns/docs/types' +import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import { Markdown } from '~/ui/components/Markdown' + +interface Props { + exceptions: DateFnsDocs.JSDocAttribute[] +} + +export const Exceptions: FunctionComponent = ({ exceptions }) => ( +
+

+ Exceptions + +

+ + + + + + + + + + + {exceptions.map((exception, index) => ( + + + + + ))} + +
TypeDescription
{exception.type.names.join(' | ')} + +
+
+) diff --git a/src/ui/screens/Docs/Doc/TSDoc/Issue/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Issue/index.tsx new file mode 100644 index 00000000..d76308e6 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TSDoc/Issue/index.tsx @@ -0,0 +1,54 @@ +import { h } from 'preact' +import { useContext } from 'preact/hooks' +import { Link } from '~/ui/components/Home/style.css' +import { RouterContext, RouterLink } from '~/ui/router' +import { bugTemplateText, docIssueTemplateText } from './templateText' + +export default function Issue() { + const { location } = useContext(RouterContext) + const pageUrl = window.location.href + const fnName = location.params?.page || '' + const docIssueUrl = docIssueTemplateText(pageUrl, fnName) + const bugIssueUrl = bugTemplateText(pageUrl, fnName) + + return ( +
+

Found an issue with this page?

+ + +
+ ) +} diff --git a/src/ui/screens/Docs/Doc/TSDoc/Issue/templateText.ts b/src/ui/screens/Docs/Doc/TSDoc/Issue/templateText.ts new file mode 100644 index 00000000..f805b8a7 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TSDoc/Issue/templateText.ts @@ -0,0 +1,62 @@ +const githubUrl = + 'https://github.com/date-fns/date-fns/issues/new?assignees=&labels=&template=bug_report.md' + +/** + * Returns GitHub document issue template URL with prefilled title and body + */ +export function docIssueTemplateText(url: string, fn: string): string { + const title = encodeURIComponent(`Problem in ${fn} documentation`) + const body = encodeURIComponent(` + There is an issue with the [${fn} documentation](${url}) + + ### The problem with ${fn} documentation + + + + ### Suggested edits + + + `) + return githubUrl + '&title=' + title + '&body=' + body +} + +/** + * Returns GitHub function issue template URL with prefilled title and body + */ +export function bugTemplateText(url: string, fn: string): string { + const title = encodeURIComponent(`Problem with ${fn} function`) + + const body = encodeURIComponent(` + There is an issue with the [${fn} function](${url}) + + ## The problem + + ### 💻 Code demonstrating the problem + + + + \`\`\`js + import { fn } from 'date-fns' + + fn() + //=> Problematic output + \`\`\` + + ### 🙁 Actual behavior + + + + ### 🙂 Expected behavior + + + + ## Debug information + + - date-fns version: + - Browser/Node.js version: + - Your timezone: + - Your current time: + + `) + return githubUrl + '&title=' + title + '&body=' + body +} diff --git a/src/ui/screens/Docs/Doc/TSDoc/Properties/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Properties/index.tsx new file mode 100644 index 00000000..2bdde3ab --- /dev/null +++ b/src/ui/screens/Docs/Doc/TSDoc/Properties/index.tsx @@ -0,0 +1,31 @@ +import { h, FunctionComponent } from 'preact' +import type { DateFnsDocs } from '@date-fns/docs/types' +import { DocParams } from '~/ui/components/DocParams' +import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' + +interface Props { + properties: DateFnsDocs.JSDocParam[] +} + +export const Properties: FunctionComponent = ({ properties }) => ( +
+

+ Properties + +

+ + + + + + + + + + + + + +
NameTypeDescription
+
+) diff --git a/src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx new file mode 100644 index 00000000..a5fd188d --- /dev/null +++ b/src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx @@ -0,0 +1,37 @@ +import { h, FunctionComponent } from 'preact' +import type { DateFnsDocs } from '@date-fns/docs/types' +import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import { Markdown } from '~/ui/components/Markdown' + +interface Props { + returns: DateFnsDocs.JSDocAttribute[] +} + +export const Returns: FunctionComponent = ({ returns }) => ( +
+

+ Returns + +

+ + + + + + + + + + + {returns.map((returnData, index) => ( + + + + + ))} + +
TypeDescription
{returnData.type.names.join(' | ')} + +
+
+) diff --git a/src/ui/screens/Docs/Doc/TSDoc/Syntax/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Syntax/index.tsx new file mode 100644 index 00000000..993117d3 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TSDoc/Syntax/index.tsx @@ -0,0 +1,18 @@ +import { h, FunctionComponent } from 'preact' +import { Code } from '~/ui/components/Code' +import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' + +interface Props { + syntax: string +} + +export const Syntax: FunctionComponent = ({ syntax }) => ( +
+

+ Syntax + +

+ + +
+) diff --git a/src/ui/screens/Docs/Doc/TSDoc/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/index.tsx new file mode 100644 index 00000000..1e1d4568 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TSDoc/index.tsx @@ -0,0 +1,85 @@ +import type { DateFnsDocs } from '@date-fns/docs/types' +import { findDescription, findExamples, findFn } from '@date-fns/docs/utils' +import { FunctionComponent, h } from 'preact' +import { useMemo } from 'preact/hooks' +import { parse } from 'typeroo' +import { DocExamples } from '~/ui/components/DocExamples' +import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import { DocUsage } from '~/ui/components/DocUsage' +import { Markdown } from '~/ui/components/Markdown' +import Issue from './Issue' +import { Header } from './style.css' + +interface Props { + page: DateFnsDocs.TSDocPage +} + +export const TSDoc: FunctionComponent = ({ page }) => { + const tsdoc = useMemo(() => parse(page.tsdoc), [page.slug]) + const fn = useMemo(() => findFn(tsdoc), [tsdoc]) + const description = useMemo(() => fn && findDescription(fn), [fn]) + const { usage, usageTabs } = useMemo(() => generateUsage(tsdoc.name), tsdoc) + const examples = useMemo(() => fn && findExamples(fn).map(extractCode), [fn]) + + console.log(examples) + + return ( +
+

+
{page.title}
+

+ + {description && ( +
+

+ Description + +

+ + +
+ )} + + + + {/* + + {page.syntax && } + {page.args && page.args.length > 0 && } + {page.content.properties && page.content.properties.length > 0 && ( + + )} + {page.content.returns && }*/} + + {examples && } + + +
{JSON.stringify(tsdoc, null, 2)}
+
+ + +
+ ) +} + +function generateUsage(name: string) { + const usage = { + esm: { + code: `import { ${name} } from "date-fns";`, + title: 'ESM', + }, + + commonjs: { + code: `const ${name} = require("date-fns/${name}");`, + title: 'CommonJS', + }, + } + + const usageTabs = ['esm', 'commonjs'] + + return { usage, usageTabs } +} + +function extractCode(example: string): string { + return example.match(/```ts\n([\s\S]+?)\n```/)?.[1] ?? '' +} diff --git a/src/ui/screens/Docs/Doc/TSDoc/style.css b/src/ui/screens/Docs/Doc/TSDoc/style.css new file mode 100644 index 00000000..0b985482 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TSDoc/style.css @@ -0,0 +1,3 @@ +.Header { + font-family: monospace; +} diff --git a/src/ui/screens/Docs/Doc/TSDoc/style.css.d.ts b/src/ui/screens/Docs/Doc/TSDoc/style.css.d.ts new file mode 100644 index 00000000..2f3eb96a --- /dev/null +++ b/src/ui/screens/Docs/Doc/TSDoc/style.css.d.ts @@ -0,0 +1,3 @@ +import { CSSComponent, CSSPreactComponent } from '~/types/decss' + +export const Header: CSSComponent diff --git a/src/ui/screens/Docs/Doc/index.tsx b/src/ui/screens/Docs/Doc/index.tsx index 340f59d8..f59e5092 100644 --- a/src/ui/screens/Docs/Doc/index.tsx +++ b/src/ui/screens/Docs/Doc/index.tsx @@ -4,14 +4,16 @@ import { Content } from './Content' import { DocLinkContext } from '~/ui/router/DocLinkContext' import { useEffect } from 'preact/hooks' import { useRead } from '@typesaurus/preact' -import { db, Submodule, packageName } from '@date-fns/docs/db' +import { db } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs/types' +import { packageName } from '@date-fns/docs/consts' const SCROLL_OFFSET = 35 interface Props { selectedVersion: string selectedPage: string - selectedSubmodule: Submodule + selectedSubmodule: DateFnsDocs.Submodule } export const Doc: FunctionComponent = ({ diff --git a/src/ui/screens/Docs/Finder/Categories.tsx b/src/ui/screens/Docs/Finder/Categories.tsx index fcc79656..0cf06563 100644 --- a/src/ui/screens/Docs/Finder/Categories.tsx +++ b/src/ui/screens/Docs/Finder/Categories.tsx @@ -1,13 +1,13 @@ import { h, FunctionComponent } from 'preact' -import { PagePreview, Submodule } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs/types' import { Items } from './Items' import { CategoriesList, Category, CategoryHeader } from './style.css' interface Props { categories: string[] - pages: PagePreview[] + pages: DateFnsDocs.PagePreview[] selectedVersion: string - selectedSubmodule: Submodule + selectedSubmodule: DateFnsDocs.Submodule selectedPage: string onNavigate(): void } diff --git a/src/ui/screens/Docs/Finder/Items.tsx b/src/ui/screens/Docs/Finder/Items.tsx index e995a4df..468b0ba8 100644 --- a/src/ui/screens/Docs/Finder/Items.tsx +++ b/src/ui/screens/Docs/Finder/Items.tsx @@ -1,13 +1,13 @@ import { h, FunctionComponent, Fragment } from 'preact' -import { PagePreview, Submodule } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs/types' import { RouterLink } from '~/ui/router' import { Item, ItemHeader, ItemText, ItemIcon } from './style.css' import { docLink } from '~/ui/router/docLink' interface Props { - pages: PagePreview[] + pages: DateFnsDocs.PagePreview[] selectedVersion: string - selectedSubmodule: Submodule + selectedSubmodule: DateFnsDocs.Submodule selectedPage: string onNavigate(): void } diff --git a/src/ui/screens/Docs/Finder/index.tsx b/src/ui/screens/Docs/Finder/index.tsx index 3bd0ea5a..f5bb1393 100644 --- a/src/ui/screens/Docs/Finder/index.tsx +++ b/src/ui/screens/Docs/Finder/index.tsx @@ -8,7 +8,9 @@ import { NoResults } from './NoResults' import { Categories } from './Categories' import { Widget } from './Widget' import { filterPages } from './utils' -import { packageName, Submodule, db } from '@date-fns/docs/db' +import { db } from '@date-fns/docs/db' +import { packageName } from '@date-fns/docs/consts' +import type { DateFnsDocs } from '@date-fns/docs/types' import { useRead } from '@typesaurus/preact' type FIXME = any @@ -16,7 +18,7 @@ type FIXME = any interface Props { selectedVersion: string selectedPage: string - selectedSubmodule: Submodule + selectedSubmodule: DateFnsDocs.Submodule onNavigate(): void } diff --git a/src/ui/screens/Docs/Finder/utils.ts b/src/ui/screens/Docs/Finder/utils.ts index 2212734e..0bf199b2 100644 --- a/src/ui/screens/Docs/Finder/utils.ts +++ b/src/ui/screens/Docs/Finder/utils.ts @@ -1,9 +1,9 @@ -import { PagePreview, Submodule } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs' export function filterPages( - pages: PagePreview[], + pages: DateFnsDocs.PagePreview[], dirtyQuery: string, - selectedSubmodule: Submodule + selectedSubmodule: DateFnsDocs.Submodule ) { let filteredPages = pages diff --git a/src/ui/screens/Docs/NavBar/LatestVersionLink.tsx b/src/ui/screens/Docs/NavBar/LatestVersionLink.tsx index 872ddb08..403db15b 100644 --- a/src/ui/screens/Docs/NavBar/LatestVersionLink.tsx +++ b/src/ui/screens/Docs/NavBar/LatestVersionLink.tsx @@ -1,4 +1,4 @@ -import { Submodule } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs/types' import { h, FunctionComponent } from 'preact' import { RouterLink } from '~/ui/router' import { docLink } from '~/ui/router/docLink' @@ -6,7 +6,7 @@ import { LatestLink } from './style.css' interface Props { latestVersion: string - selectedSubmodule: Submodule + selectedSubmodule: DateFnsDocs.Submodule selectedPage: string } diff --git a/src/ui/screens/Docs/NavBar/SubmoduleSelector.tsx b/src/ui/screens/Docs/NavBar/SubmoduleSelector.tsx index 04348d9e..d3bf8ea6 100644 --- a/src/ui/screens/Docs/NavBar/SubmoduleSelector.tsx +++ b/src/ui/screens/Docs/NavBar/SubmoduleSelector.tsx @@ -1,20 +1,20 @@ import { h, FunctionComponent } from 'preact' import { Label, Select, Selector } from './style.css' -import { Submodule } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs/types' import { docLink } from '~/ui/router/docLink' import { useContext } from 'preact/hooks' import { RouterContext } from '~/ui/router' -const SUBMODULE_LABELS: Record = { +const SUBMODULE_LABELS: Record = { default: 'Default', fp: 'FP', } interface Props { - selectedSubmodule: Submodule + selectedSubmodule: DateFnsDocs.Submodule selectedPage: string selectedVersion: string - submodules: Submodule[] + submodules: DateFnsDocs.Submodule[] } type FIXME = any diff --git a/src/ui/screens/Docs/NavBar/VersionSelector.tsx b/src/ui/screens/Docs/NavBar/VersionSelector.tsx index 39add02a..145d305f 100644 --- a/src/ui/screens/Docs/NavBar/VersionSelector.tsx +++ b/src/ui/screens/Docs/NavBar/VersionSelector.tsx @@ -1,5 +1,5 @@ import { h, FunctionComponent } from 'preact' -import { Submodule, VersionPreview } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs/types' import { Selector, Label, Select } from './style.css' import { useContext } from 'preact/hooks' import { RouterContext } from '~/ui/router' @@ -10,8 +10,8 @@ interface Props { selectedVersion: string latestVersion: string selectedPage: string - selectedSubmodule: Submodule - versions: VersionPreview[] + selectedSubmodule: DateFnsDocs.Submodule + versions: DateFnsDocs.VersionPreview[] } type FIXME = any diff --git a/src/ui/screens/Docs/NavBar/index.tsx b/src/ui/screens/Docs/NavBar/index.tsx index 3d01038b..54353250 100644 --- a/src/ui/screens/Docs/NavBar/index.tsx +++ b/src/ui/screens/Docs/NavBar/index.tsx @@ -10,7 +10,8 @@ import { MenuIcon, } from './style.css' import logoPath from './img/logo.svg' -import { defaultSubmodule, Submodule, VersionPreview } from '@date-fns/docs/db' +import { defaultSubmodule } from '@date-fns/docs/consts' +import type { DateFnsDocs } from '@date-fns/docs/types' import { VersionSelector } from './VersionSelector' import { SubmoduleSelector } from './SubmoduleSelector' @@ -18,8 +19,8 @@ interface Props { selectedVersion: string latestVersion: string selectedPage: string - versions: VersionPreview[] - selectedSubmodule: Submodule + versions: DateFnsDocs.VersionPreview[] + selectedSubmodule: DateFnsDocs.Submodule menuIcon: React.ReactNode } diff --git a/src/ui/screens/Docs/index.tsx b/src/ui/screens/Docs/index.tsx index f03a8298..09461893 100644 --- a/src/ui/screens/Docs/index.tsx +++ b/src/ui/screens/Docs/index.tsx @@ -21,10 +21,12 @@ import { RouterContext } from '~/ui/router' import { docLink } from '~/ui/router/docLink' import { DEFAULT_PAGE } from '~/constants' import { useRead } from '@typesaurus/preact' -import { Submodule, db, packageName } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs/types' +import { db } from '@date-fns/docs/db' +import { packageName } from '@date-fns/docs/consts' interface Props { - selectedSubmodule: Submodule + selectedSubmodule: DateFnsDocs.Submodule selectedVersion?: string selectedPage: string } @@ -48,15 +50,14 @@ export const Docs: FunctionComponent = ({ } }) - const [packages, { loading }] = useRead( - db.packages.query(($) => $.field('name').equal(packageName)) + const [dateFnsPackage, { loading }] = useRead( + db.packages.get(db.packages.id(packageName)) ) const [menuOpen, setMenuOpen] = useState(false) - if (packages && packages.length === 1) { - const dateFnsPackage = packages[0].data - const latestVersion = getLatestVersion(dateFnsPackage.versions).version + if (dateFnsPackage) { + const latestVersion = getLatestVersion(dateFnsPackage.data.versions).version const selectedVersion = urlSelectedVersion ?? latestVersion return ( @@ -67,7 +68,10 @@ export const Docs: FunctionComponent = ({ latestVersion={latestVersion} selectedPage={selectedPage} versions={sortVersions( - filterPreReleaseVersions(dateFnsPackage.versions, selectedVersion) + filterPreReleaseVersions( + dateFnsPackage.data.versions, + selectedVersion + ) )} selectedSubmodule={selectedSubmodule} menuIcon={ diff --git a/src/utils/versions/index.tsx b/src/utils/versions/index.tsx index 6c41efe1..25111be2 100644 --- a/src/utils/versions/index.tsx +++ b/src/utils/versions/index.tsx @@ -1,7 +1,7 @@ -import { VersionPreview } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs' export function filterPreReleaseVersions( - versions: VersionPreview[], + versions: DateFnsDocs.VersionPreview[], selectedVersion?: string ) { return versions.filter( @@ -9,12 +9,12 @@ export function filterPreReleaseVersions( ) } -export function sortVersions(versions: VersionPreview[]) { +export function sortVersions(versions: DateFnsDocs.VersionPreview[]) { return [...versions].sort( (versionA, versionB) => versionB.createdAt - versionA.createdAt ) } -export function getLatestVersion(versions: VersionPreview[]) { +export function getLatestVersion(versions: DateFnsDocs.VersionPreview[]) { return sortVersions(filterPreReleaseVersions(versions))[0] } diff --git a/yarn.lock b/yarn.lock index e826cae5..87db0405 100644 --- a/yarn.lock +++ b/yarn.lock @@ -49,10 +49,10 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@date-fns/docs@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@date-fns/docs/-/docs-0.5.0.tgz#43d2e0b388265c55a3103e5e710aa41de80c2b6f" - integrity sha512-E3c0Yh3c/4qBkr5GzvDpMNiFisVZqg/z7K5eQsSYE3+R98R3NyL2xPPl314MpTfcZmIW8pyTqI+hU7mgGIHnrw== +"@date-fns/docs@0.12.1": + version "0.12.1" + resolved "https://registry.yarnpkg.com/@date-fns/docs/-/docs-0.12.1.tgz#b4bb23c5c24d29dcd1117052447a0c33183b1341" + integrity sha512-GZq6AOorzmy5MI1N/lqzK9YxMDKyFklaS2v8Nk6+dApComxT1IkL1dOLl1tqW3EzBdFSitbB5nrXNAuWAm1Wbg== dependencies: firebase-admin "^11.4.1" js-fns "^2.5.2" From 1cdd4d6a2e6a3ddf2e54255364487e0b19eceea3 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Mon, 2 Jan 2023 10:47:28 +0800 Subject: [PATCH 07/36] Basic type rendering, types modal preparation --- src/ui/components/DocReturns/index.tsx | 41 +++++++++++++ src/ui/components/DocType/index.tsx | 61 +++++++++++++++++++ src/ui/index.tsx | 17 +++++- src/ui/router/index.ts | 22 ++++++- .../screens/Docs/Doc/JSDoc/Returns/index.tsx | 37 +++-------- .../screens/Docs/Doc/TSDoc/Returns/index.tsx | 54 +++++++--------- src/ui/screens/Docs/Doc/TSDoc/index.tsx | 14 ++++- 7 files changed, 176 insertions(+), 70 deletions(-) create mode 100644 src/ui/components/DocReturns/index.tsx create mode 100644 src/ui/components/DocType/index.tsx diff --git a/src/ui/components/DocReturns/index.tsx b/src/ui/components/DocReturns/index.tsx new file mode 100644 index 00000000..6614bd08 --- /dev/null +++ b/src/ui/components/DocReturns/index.tsx @@ -0,0 +1,41 @@ +import { ComponentChildren, FunctionComponent, h } from 'preact' +import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import { Markdown } from '~/ui/components/Markdown' + +interface ReturnType { + description: string + type: ComponentChildren +} + +interface Props { + returns: ReturnType[] +} + +export const DocReturns: FunctionComponent = ({ returns }) => ( +
+

+ Returns + +

+ + + + + + + + + + + {returns.map((returnData, index) => ( + + + + + ))} + +
TypeDescription
{returnData.type} + +
+
+) diff --git a/src/ui/components/DocType/index.tsx b/src/ui/components/DocType/index.tsx new file mode 100644 index 00000000..f7baeb99 --- /dev/null +++ b/src/ui/components/DocType/index.tsx @@ -0,0 +1,61 @@ +import { FunctionComponent, h } from 'preact' +import type { SomeType } from 'typedoc' + +interface Props { + type: SomeType +} + +export const DocType: FunctionComponent = ({ type }) => { + console.log({ type }) + + switch (type.type) { + case 'intrinsic': + return {type.name} + + case 'array': + return ( + + Array{'<'} + + {'>'} + + ) + + case 'reference': + return ( + + + {type.name} + + + ) + + case 'reflection': + case 'query': + case 'predicate': + case 'indexedAccess': + case 'conditional': + case 'inferred': + case 'unknown': + case 'tuple': + case 'union': + case 'intersection': + case 'literal': + case 'typeOperator': + case 'template-literal': + case 'named-tuple-member': + case 'mapped': + case 'optional': + case 'rest': + return ( +
+ If you see this, ping me. +
+ ) + } +} diff --git a/src/ui/index.tsx b/src/ui/index.tsx index c6799cef..2e62749b 100644 --- a/src/ui/index.tsx +++ b/src/ui/index.tsx @@ -1,6 +1,6 @@ -import { h } from 'preact' +import { h, VNode } from 'preact' import { useContext, useEffect } from 'preact/hooks' -import { RouterContext } from '~/ui/router' +import { AppRouteLocation, RouterContext } from '~/ui/router' import { Home } from '~/ui/screens/Home' import { Docs } from '~/ui/screens/Docs' import { NotFound } from '~/ui/screens/NotFound' @@ -17,6 +17,18 @@ export const UI = () => { win?.ga?.('send', 'pageview') }, [JSON.stringify(location)]) + return ( +
+ +
+ ) +} + +interface ContentProps { + location: AppRouteLocation +} + +function Content({ location }: ContentProps): VNode { switch (location.name) { case 'home': return @@ -56,7 +68,6 @@ export const UI = () => { ) case '404': - default: return } } diff --git a/src/ui/router/index.ts b/src/ui/router/index.ts index 3813d423..5b346ad0 100644 --- a/src/ui/router/index.ts +++ b/src/ui/router/index.ts @@ -1,5 +1,11 @@ import type { DateFnsDocs } from '@date-fns/docs' -import { createRouter, InferRouteRef, route } from '@switcher/preact' +import { + createRouter, + InferRoute, + InferRouteRef, + route, +} from '@switcher/preact' +import { RouteLocation, RouteNotFoundLocation } from '@switcher/preact/core' export const appRoutes = [ route('home', '/'), @@ -34,4 +40,16 @@ export const { } = createRouter(appRoutes) // Type to use in prop definitions -export type AppRouteRef = InferRouteRef +export type AppRoutes = typeof appRoutes + +export type AppRouteRef = InferRouteRef + +export type AppRoute = InferRoute + +export type AppRouteMeta = AppRoute['meta'] + +export type AppRouteLocation = + | RouteLocation + | RouteNotFoundLocation + +export type AppRouteName = AppRouteLocation['name'] diff --git a/src/ui/screens/Docs/Doc/JSDoc/Returns/index.tsx b/src/ui/screens/Docs/Doc/JSDoc/Returns/index.tsx index a5fd188d..632ea2fb 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/Returns/index.tsx +++ b/src/ui/screens/Docs/Doc/JSDoc/Returns/index.tsx @@ -1,37 +1,16 @@ -import { h, FunctionComponent } from 'preact' import type { DateFnsDocs } from '@date-fns/docs/types' -import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' -import { Markdown } from '~/ui/components/Markdown' +import { FunctionComponent, h } from 'preact' +import { DocReturns } from '~/ui/components/DocReturns' interface Props { returns: DateFnsDocs.JSDocAttribute[] } export const Returns: FunctionComponent = ({ returns }) => ( -
-

- Returns - -

- - - - - - - - - - - {returns.map((returnData, index) => ( - - - - - ))} - -
TypeDescription
{returnData.type.names.join(' | ')} - -
-
+ ({ + type: returnData.type.names.join(' | '), + description: returnData.description, + }))} + /> ) diff --git a/src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx index a5fd188d..e31b247f 100644 --- a/src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx +++ b/src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx @@ -1,37 +1,25 @@ -import { h, FunctionComponent } from 'preact' -import type { DateFnsDocs } from '@date-fns/docs/types' -import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' -import { Markdown } from '~/ui/components/Markdown' +import { findReturns } from '@date-fns/docs/utils' +import { FunctionComponent, h } from 'preact' +import { useMemo } from 'preact/hooks' +import type { DeclarationReflection } from 'typedoc' +import { DocReturns } from '~/ui/components/DocReturns' +import { DocType } from '~/ui/components/DocType' interface Props { - returns: DateFnsDocs.JSDocAttribute[] + fn: DeclarationReflection } -export const Returns: FunctionComponent = ({ returns }) => ( -
-

- Returns - -

- - - - - - - - - - - {returns.map((returnData, index) => ( - - - - - ))} - -
TypeDescription
{returnData.type.names.join(' | ')} - -
-
-) +export const Returns: FunctionComponent = ({ fn }) => { + const description = useMemo(() => findReturns(fn), [fn]) + console.log({ fn }) + return ( + ({ + type: s.type && , + description: description || '', + })) || [] + } + /> + ) +} diff --git a/src/ui/screens/Docs/Doc/TSDoc/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/index.tsx index 1e1d4568..cf582d75 100644 --- a/src/ui/screens/Docs/Doc/TSDoc/index.tsx +++ b/src/ui/screens/Docs/Doc/TSDoc/index.tsx @@ -1,5 +1,10 @@ import type { DateFnsDocs } from '@date-fns/docs/types' -import { findDescription, findExamples, findFn } from '@date-fns/docs/utils' +import { + findDescription, + findExamples, + findFn, + findReturns, +} from '@date-fns/docs/utils' import { FunctionComponent, h } from 'preact' import { useMemo } from 'preact/hooks' import { parse } from 'typeroo' @@ -8,6 +13,7 @@ import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' import { DocUsage } from '~/ui/components/DocUsage' import { Markdown } from '~/ui/components/Markdown' import Issue from './Issue' +import { Returns } from './Returns' import { Header } from './style.css' interface Props { @@ -18,7 +24,7 @@ export const TSDoc: FunctionComponent = ({ page }) => { const tsdoc = useMemo(() => parse(page.tsdoc), [page.slug]) const fn = useMemo(() => findFn(tsdoc), [tsdoc]) const description = useMemo(() => fn && findDescription(fn), [fn]) - const { usage, usageTabs } = useMemo(() => generateUsage(tsdoc.name), tsdoc) + const { usage, usageTabs } = useMemo(() => generateUsage(tsdoc.name), [tsdoc]) const examples = useMemo(() => fn && findExamples(fn).map(extractCode), [fn]) console.log(examples) @@ -49,7 +55,9 @@ export const TSDoc: FunctionComponent = ({ page }) => { {page.content.properties && page.content.properties.length > 0 && ( )} - {page.content.returns && }*/} + */} + + {fn && } {examples && } From 967263189aefa952fa47b9f1b35ab993e3efc972 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Mon, 2 Jan 2023 18:55:19 +0800 Subject: [PATCH 08/36] Migrate home styles to vanilla-extract --- config/webpackDefaults.ts | 27 +- package.json | 4 + src/types/assets.d.ts | 14 + .../Issue => components/DocLinks}/index.tsx | 10 +- src/ui/components/DocLinks/styles.css.ts | 6 + .../DocLinks}/templateText.ts | 0 src/ui/components/Home/HomeAction.tsx | 6 +- src/ui/components/Home/HomeBlock.tsx | 25 +- src/ui/components/Home/HomeButton.tsx | 11 +- src/ui/components/Home/HomeExternalAction.tsx | 6 +- src/ui/components/Home/HomeExternalLink.tsx | 8 +- src/ui/components/Home/HomeLink.tsx | 6 +- src/ui/components/Home/HomeText.tsx | 4 +- src/ui/components/Home/style.css | 107 ----- src/ui/components/Home/style.css.d.ts | 15 - src/ui/components/Home/styles.css.ts | 128 ++++++ src/ui/index.tsx | 6 +- src/ui/screens/Docs/Doc/JSDoc/index.tsx | 6 +- src/ui/screens/Docs/Doc/TSDoc/Issue/index.tsx | 54 --- .../Docs/Doc/TSDoc/Issue/templateText.ts | 62 --- src/ui/screens/Docs/Doc/TSDoc/index.tsx | 11 +- src/ui/screens/Home/Contributors/index.tsx | 26 +- src/ui/screens/Home/Contributors/style.css | 36 -- .../screens/Home/Contributors/style.css.d.ts | 7 - .../screens/Home/Contributors/styles.css.ts | 38 ++ src/ui/screens/Home/Examples/index.tsx | 41 +- src/ui/screens/Home/Examples/style.css | 51 --- src/ui/screens/Home/Examples/style.css.d.ts | 10 - src/ui/screens/Home/Examples/styles.css.ts | 53 +++ src/ui/screens/Home/Features/features.tsx | 40 +- src/ui/screens/Home/Features/index.tsx | 22 +- src/ui/screens/Home/Features/style.css | 144 ------- src/ui/screens/Home/Features/style.css.d.ts | 23 - src/ui/screens/Home/Features/styles.css.ts | 159 +++++++ src/ui/screens/Home/Footer/index.tsx | 36 +- src/ui/screens/Home/Footer/style.css | 18 - src/ui/screens/Home/Footer/style.css.d.ts | 6 - src/ui/screens/Home/Footer/styles.css.ts | 24 ++ .../screens/Home/Promo/Navigation/index.tsx | 29 +- .../screens/Home/Promo/Navigation/style.css | 30 -- .../Home/Promo/Navigation/style.css.d.ts | 12 - .../Home/Promo/Navigation/styles.css.ts | 30 ++ src/ui/screens/Home/Promo/index.tsx | 50 +-- src/ui/screens/Home/Promo/style.css | 76 ---- src/ui/screens/Home/Promo/style.css.d.ts | 12 - src/ui/screens/Home/Promo/styles.css.ts | 76 ++++ src/ui/screens/Home/Sponsorship/index.tsx | 58 ++- src/ui/screens/Home/Sponsorship/style.css | 62 --- .../screens/Home/Sponsorship/style.css.d.ts | 11 - src/ui/screens/Home/Sponsorship/styles.css.ts | 66 +++ src/ui/screens/Home/index.tsx | 6 +- src/ui/screens/Home/style.css | 13 - src/ui/screens/Home/style.css.d.ts | 3 - src/ui/screens/Home/styles.css.ts | 8 + yarn.lock | 407 +++++++++++++++++- 55 files changed, 1231 insertions(+), 968 deletions(-) create mode 100644 src/types/assets.d.ts rename src/ui/{screens/Docs/Doc/JSDoc/Issue => components/DocLinks}/index.tsx (89%) create mode 100644 src/ui/components/DocLinks/styles.css.ts rename src/ui/{screens/Docs/Doc/JSDoc/Issue => components/DocLinks}/templateText.ts (100%) delete mode 100644 src/ui/components/Home/style.css delete mode 100644 src/ui/components/Home/style.css.d.ts create mode 100644 src/ui/components/Home/styles.css.ts delete mode 100644 src/ui/screens/Docs/Doc/TSDoc/Issue/index.tsx delete mode 100644 src/ui/screens/Docs/Doc/TSDoc/Issue/templateText.ts delete mode 100644 src/ui/screens/Home/Contributors/style.css delete mode 100644 src/ui/screens/Home/Contributors/style.css.d.ts create mode 100644 src/ui/screens/Home/Contributors/styles.css.ts delete mode 100644 src/ui/screens/Home/Examples/style.css delete mode 100644 src/ui/screens/Home/Examples/style.css.d.ts create mode 100644 src/ui/screens/Home/Examples/styles.css.ts delete mode 100644 src/ui/screens/Home/Features/style.css delete mode 100644 src/ui/screens/Home/Features/style.css.d.ts create mode 100644 src/ui/screens/Home/Features/styles.css.ts delete mode 100644 src/ui/screens/Home/Footer/style.css delete mode 100644 src/ui/screens/Home/Footer/style.css.d.ts create mode 100644 src/ui/screens/Home/Footer/styles.css.ts delete mode 100644 src/ui/screens/Home/Promo/Navigation/style.css delete mode 100644 src/ui/screens/Home/Promo/Navigation/style.css.d.ts create mode 100644 src/ui/screens/Home/Promo/Navigation/styles.css.ts delete mode 100644 src/ui/screens/Home/Promo/style.css delete mode 100644 src/ui/screens/Home/Promo/style.css.d.ts create mode 100644 src/ui/screens/Home/Promo/styles.css.ts delete mode 100644 src/ui/screens/Home/Sponsorship/style.css delete mode 100644 src/ui/screens/Home/Sponsorship/style.css.d.ts create mode 100644 src/ui/screens/Home/Sponsorship/styles.css.ts delete mode 100644 src/ui/screens/Home/style.css delete mode 100644 src/ui/screens/Home/style.css.d.ts create mode 100644 src/ui/screens/Home/styles.css.ts diff --git a/config/webpackDefaults.ts b/config/webpackDefaults.ts index b2b6a4ed..0de0df5b 100644 --- a/config/webpackDefaults.ts +++ b/config/webpackDefaults.ts @@ -1,4 +1,5 @@ import { DefinePlugin, Configuration } from 'webpack' +import { VanillaExtractPlugin } from '@vanilla-extract/webpack-plugin' import MiniCssExtractPlugin from 'mini-css-extract-plugin' import { getMode, getPath } from './utils' import merge from 'webpack-merge' @@ -13,7 +14,12 @@ export function webpackDefaults(config: Configuration): Configuration { mode, devtool: isProduction ? 'source-map' : 'inline-source-map', module: { - rules: [tsRule(), cssRule(isWeb), fileRule(isWeb)], + rules: [ + tsRule(), + vanillaExtractRule(), + cssRule(isWeb), + fileRule(isWeb), + ], }, resolve: { extensions: ['.tsx', '.ts', '.js', '.json'], @@ -22,6 +28,7 @@ export function webpackDefaults(config: Configuration): Configuration { }, }, plugins: [ + new VanillaExtractPlugin(), new MiniCssExtractPlugin( isProduction ? { @@ -54,7 +61,7 @@ function tsRule() { }, }, ], - exclude: /node_modules/, + exclude: [/node_modules/, /\.css\.ts$/i], } } @@ -84,6 +91,22 @@ function cssRule(isWeb: boolean) { }, { use: nyancssLoaders }, ], + exclude: [/\.vanilla\.css$/i], + } +} + +function vanillaExtractRule() { + return { + test: /\.vanilla\.css$/i, // Targets only CSS files generated by vanilla-extract + use: [ + MiniCssExtractPlugin.loader, + { + loader: require.resolve('css-loader'), + options: { + url: false, // Required as image imports should be handled via JS/TS import statements + }, + }, + ], } } diff --git a/package.json b/package.json index c29c8355..0d037d05 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,11 @@ "@types/webpack-hot-middleware": "^2.25.6", "@types/webpack-node-externals": "^2.5.3", "@typesaurus/preact": "6.0.0-alpha.4", + "@vanilla-extract/css": "^1.9.2", + "@vanilla-extract/webpack-plugin": "^2.2.0", "assets-webpack-plugin": "^7.1.1", "body-parser": "^1.19.0", + "classnames": "^2.3.2", "copy-webpack-plugin": "^11.0.0", "cors": "^2.8.5", "css-loader": "^6.7.3", @@ -70,6 +73,7 @@ "tsconfig-paths": "^4.1.1", "tsconfig-paths-webpack-plugin": "^4.0.0", "tslint": "~6.1.3", + "typedoc": "^0.23.23", "typeroo": "^0.9.0", "typesaurus": "10.0.0-alpha.41", "typescript": "^4.9.4", diff --git a/src/types/assets.d.ts b/src/types/assets.d.ts new file mode 100644 index 00000000..13821621 --- /dev/null +++ b/src/types/assets.d.ts @@ -0,0 +1,14 @@ +declare module '*.png' { + const url: string + export default url +} + +declare module '*.jpg' { + const url: string + export default url +} + +declare module '*.svg' { + const url: string + export default url +} diff --git a/src/ui/screens/Docs/Doc/JSDoc/Issue/index.tsx b/src/ui/components/DocLinks/index.tsx similarity index 89% rename from src/ui/screens/Docs/Doc/JSDoc/Issue/index.tsx rename to src/ui/components/DocLinks/index.tsx index d76308e6..2db104f6 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/Issue/index.tsx +++ b/src/ui/components/DocLinks/index.tsx @@ -1,10 +1,10 @@ import { h } from 'preact' import { useContext } from 'preact/hooks' -import { Link } from '~/ui/components/Home/style.css' import { RouterContext, RouterLink } from '~/ui/router' import { bugTemplateText, docIssueTemplateText } from './templateText' +import * as styles from './styles.css' -export default function Issue() { +export const DocLinks = () => { const { location } = useContext(RouterContext) const pageUrl = window.location.href const fnName = location.params?.page || '' @@ -18,9 +18,9 @@ export default function Issue() {
  • - Suggest edits by sending a PR - +
  • diff --git a/src/ui/components/DocLinks/styles.css.ts b/src/ui/components/DocLinks/styles.css.ts new file mode 100644 index 00000000..51913f1b --- /dev/null +++ b/src/ui/components/DocLinks/styles.css.ts @@ -0,0 +1,6 @@ +import { style } from '@vanilla-extract/css' + +export const link = style({ + color: '#862d5b', + textDecoration: 'none', +}) diff --git a/src/ui/screens/Docs/Doc/JSDoc/Issue/templateText.ts b/src/ui/components/DocLinks/templateText.ts similarity index 100% rename from src/ui/screens/Docs/Doc/JSDoc/Issue/templateText.ts rename to src/ui/components/DocLinks/templateText.ts diff --git a/src/ui/components/Home/HomeAction.tsx b/src/ui/components/Home/HomeAction.tsx index be581e7a..90f661e6 100644 --- a/src/ui/components/Home/HomeAction.tsx +++ b/src/ui/components/Home/HomeAction.tsx @@ -1,6 +1,6 @@ import { h, FunctionComponent } from 'preact' import { RouterLink, AppRouteRef } from '~/ui/router' -import { Action } from './style.css' +import * as styles from './styles.css' interface Props { to: AppRouteRef @@ -12,7 +12,7 @@ export const HomeAction: FunctionComponent = ({ title, children, }) => ( - + {children} - + ) diff --git a/src/ui/components/Home/HomeBlock.tsx b/src/ui/components/Home/HomeBlock.tsx index e7af5591..236fd2c3 100644 --- a/src/ui/components/Home/HomeBlock.tsx +++ b/src/ui/components/Home/HomeBlock.tsx @@ -1,12 +1,5 @@ import { h, ComponentChild, FunctionComponent } from 'preact' -import { - Block, - InnerContainer, - Header, - SubHeader, - Content, - Actions, -} from './style.css' +import * as styles from './styles.css' interface Props { header?: ComponentChild @@ -20,15 +13,15 @@ export const HomeBlock: FunctionComponent = ({ actions, children, }) => ( - - - {header &&
    {header}
    } +
    +
    + {header &&

    {header}

    } - {subHeader && {subHeader}} + {subHeader &&

    {subHeader}

    } - {children} +
    {children}
    - {actions} - - +
    {actions}
    +
    +
    ) diff --git a/src/ui/components/Home/HomeButton.tsx b/src/ui/components/Home/HomeButton.tsx index cc95c113..d854086c 100644 --- a/src/ui/components/Home/HomeButton.tsx +++ b/src/ui/components/Home/HomeButton.tsx @@ -1,10 +1,11 @@ import { h, FunctionComponent } from 'preact' -import { Button } from './style.css' +import classNames from 'classnames' +import * as styles from './styles.css' interface Props { href: string newTab?: boolean - type: 'primary' | 'secondary' + type: keyof typeof styles.button } export const HomeButton: FunctionComponent = ({ @@ -13,13 +14,13 @@ export const HomeButton: FunctionComponent = ({ newTab, type, }) => ( - + ) diff --git a/src/ui/components/Home/HomeExternalAction.tsx b/src/ui/components/Home/HomeExternalAction.tsx index a1e866ec..540949e1 100644 --- a/src/ui/components/Home/HomeExternalAction.tsx +++ b/src/ui/components/Home/HomeExternalAction.tsx @@ -1,5 +1,5 @@ import { h, FunctionComponent } from 'preact' -import { Action } from './style.css' +import * as styles from './styles.css' interface Props { href: string @@ -11,7 +11,7 @@ export const HomeExternalAction: FunctionComponent = ({ title, children, }) => ( - + {children} - + ) diff --git a/src/ui/components/Home/HomeExternalLink.tsx b/src/ui/components/Home/HomeExternalLink.tsx index 960f27c4..47fac186 100644 --- a/src/ui/components/Home/HomeExternalLink.tsx +++ b/src/ui/components/Home/HomeExternalLink.tsx @@ -1,5 +1,5 @@ import { h, FunctionComponent } from 'preact' -import { Link } from './style.css' +import * as styles from './styles.css' interface Props { href: string @@ -13,13 +13,13 @@ export const HomeExternalLink: FunctionComponent = ({ children, newTab, }) => ( - {children} - + ) diff --git a/src/ui/components/Home/HomeLink.tsx b/src/ui/components/Home/HomeLink.tsx index a47bc34f..3a08e5c8 100644 --- a/src/ui/components/Home/HomeLink.tsx +++ b/src/ui/components/Home/HomeLink.tsx @@ -1,6 +1,6 @@ import { h, FunctionComponent } from 'preact' import { RouterLink, AppRouteRef } from '~/ui/router' -import { Link } from './style.css' +import * as styles from './styles.css' interface Props { to: AppRouteRef @@ -8,7 +8,7 @@ interface Props { } export const HomeLink: FunctionComponent = ({ to, title, children }) => ( - + {children} - + ) diff --git a/src/ui/components/Home/HomeText.tsx b/src/ui/components/Home/HomeText.tsx index 5c184ff4..65e53148 100644 --- a/src/ui/components/Home/HomeText.tsx +++ b/src/ui/components/Home/HomeText.tsx @@ -1,6 +1,6 @@ import { h, FunctionComponent } from 'preact' -import { Text } from './style.css' +import * as styles from './styles.css' export const HomeText: FunctionComponent = ({ children }) => ( - {children} +
    {children}
    ) diff --git a/src/ui/components/Home/style.css b/src/ui/components/Home/style.css deleted file mode 100644 index 184970c2..00000000 --- a/src/ui/components/Home/style.css +++ /dev/null @@ -1,107 +0,0 @@ -.Block { - width: 100%; - display: flex; - flex-direction: column; - align-items: center; - border-bottom: 1px solid #e4e4dd; -} - -.Block:nth-child(odd) { - background-color: #fffdfa; -} - -.Block:nth-child(even) { - background-color: #fffbf5; -} - -.Block:last-child { - border-bottom: none; -} - -.InnerContainer { - max-width: 1200px; - padding: 75px 30px; - display: flex; - flex-direction: column; - align-items: center; -} - -.Header { - color: #770c56; - font-weight: 600; - font-size: 20px; -} - -.SubHeader { - color: #770c56; - margin-top: 0.8rem; - font-size: 1rem; -} - -.Actions { - display: flex; - align-items: center; -} -.Actions :not(:last-child) { - margin-right: 1rem; -} - -.Action { - color: #8c1b54; - margin-top: 20px; -} - -.Button { - margin-top: 30px; - display: block; - text-align: center; - text-decoration: none; - border-radius: 3px; - font-size: 16px; - padding: 15px 30px; -} -.Button-type-primary { - background: #8c1b54; - color: #fff; - border: 1px solid #8c1b54; -} -.Button-type-secondary { - background: transparent; - color: #8c1b54; - border: 1px solid #8c1b54; -} - -.Link { - color: #862d5b; - text-decoration: none; -} - -.Link-decorated { - text-decoration: underline; -} - -.Content { - display: flex; - flex-direction: column; - align-items: center; -} -.Content:not(:first-child) { - margin-top: 30px; -} - -.Text { - font-size: 16px; - line-height: 22px; - text-align: center; - color: #4c193c; - max-width: 500px; -} - -.Text p, -.Text img { - margin-bottom: 1rem; -} - -.Text p:last-child { - margin-bottom: 0; -} diff --git a/src/ui/components/Home/style.css.d.ts b/src/ui/components/Home/style.css.d.ts deleted file mode 100644 index 89f9b0ec..00000000 --- a/src/ui/components/Home/style.css.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { CSSComponent, CSSPreactComponent } from '~/types/decss' -import { RouterLink } from '~/ui/router' - -export const Block: CSSComponent -export const InnerContainer: CSSComponent -export const Header: CSSComponent -export const SubHeader: CSSComponent -export const Actions: CSSComponent -export const Action: CSSPreactComponent -export const Link: CSSPreactComponent -export const Button: CSSComponent<{ - type: 'primary' | 'secondary' -}> -export const Content: CSSComponent -export const Text: CSSComponent diff --git a/src/ui/components/Home/styles.css.ts b/src/ui/components/Home/styles.css.ts new file mode 100644 index 00000000..87075ffc --- /dev/null +++ b/src/ui/components/Home/styles.css.ts @@ -0,0 +1,128 @@ +import { style, globalStyle, styleVariants } from '@vanilla-extract/css' + +export const action = style({ + color: '#8c1b54', + marginTop: '20px', +}) + +export const buttonBase = style({ + marginTop: '30px', + display: 'block', + textAlign: 'center', + textDecoration: 'none', + borderRadius: '3px', + fontSize: '16px', + padding: '15px 30px', +}) + +export const button = styleVariants({ + primary: [ + buttonBase, + { + background: '#8c1b54', + color: '#fff', + border: '1px solid #8c1b54', + }, + ], + + secondary: [ + buttonBase, + { + background: 'transparent', + color: '#8c1b54', + border: '1px solid #8c1b54', + }, + ], +}) + +export const header = style({ + color: '#770c56', + fontWeight: '600', + fontSize: '20px', +}) + +export const innerContainer = style({ + maxWidth: '1200px', + padding: '75px 30px', + display: 'flex', + flexDirection: 'column', + alignItems: 'center', +}) + +export const link = style({ + color: '#862d5b', + textDecoration: 'none', +}) + +export const linkDecorated = style({ + textDecoration: 'underline', +}) + +export const subHeader = style({ + color: '#770c56', + marginTop: '0.8rem', + fontSize: '1rem', +}) + +export const actions = style({ + display: 'flex', + alignItems: 'center', +}) + +globalStyle(`${actions} :not(:last-child)`, { + marginRight: '1rem', +}) + +export const block = style({ + width: '100%', + display: 'flex', + flexDirection: 'column', + alignItems: 'center', + borderBottom: '1px solid #e4e4dd', + + ':last-child': { + borderBottom: 'none', + }, + + selectors: { + '&:nth-child(even)': { + backgroundColor: '#fffbf5', + }, + + '&:nth-child(odd)': { + backgroundColor: '#fffdfa', + }, + }, +}) + +export const content = style({ + display: 'flex', + flexDirection: 'column', + alignItems: 'center', + + selectors: { + '&:not(:first-child)': { + marginTop: '30px', + }, + }, +}) + +export const text = style({ + fontSize: '16px', + lineHeight: '22px', + textAlign: 'center', + color: '#4c193c', + maxWidth: '500px', +}) + +globalStyle(`${text} img`, { + marginBottom: '1rem', +}) + +globalStyle(`${text} p`, { + marginBottom: '1rem', +}) + +globalStyle(`${text} p:last-child`, { + marginBottom: '0', +}) diff --git a/src/ui/index.tsx b/src/ui/index.tsx index 2e62749b..d8ce542a 100644 --- a/src/ui/index.tsx +++ b/src/ui/index.tsx @@ -1,4 +1,4 @@ -import { h, VNode } from 'preact' +import { h, Fragment, VNode } from 'preact' import { useContext, useEffect } from 'preact/hooks' import { AppRouteLocation, RouterContext } from '~/ui/router' import { Home } from '~/ui/screens/Home' @@ -18,9 +18,9 @@ export const UI = () => { }, [JSON.stringify(location)]) return ( -
    + <> -
    + ) } diff --git a/src/ui/screens/Docs/Doc/JSDoc/index.tsx b/src/ui/screens/Docs/Doc/JSDoc/index.tsx index 8aa1286e..61837c14 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/index.tsx +++ b/src/ui/screens/Docs/Doc/JSDoc/index.tsx @@ -3,9 +3,9 @@ import { FunctionComponent, h } from 'preact' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' import { Markdown } from '~/ui/components/Markdown' import { Arguments } from './Arguments' -import { DocExamples } from '../../../../components/DocExamples' +import { DocExamples } from '~/ui/components/DocExamples' import { Exceptions } from './Exceptions' -import Issue from './Issue' +import { DocLinks } from '~/ui/components/DocLinks' import { Properties } from './Properties' import { Returns } from './Returns' import { Header } from './style.css' @@ -45,6 +45,6 @@ export const JSDoc: FunctionComponent = ({ doc }) => ( )} {doc.content.examples && } - + ) diff --git a/src/ui/screens/Docs/Doc/TSDoc/Issue/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Issue/index.tsx deleted file mode 100644 index d76308e6..00000000 --- a/src/ui/screens/Docs/Doc/TSDoc/Issue/index.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { h } from 'preact' -import { useContext } from 'preact/hooks' -import { Link } from '~/ui/components/Home/style.css' -import { RouterContext, RouterLink } from '~/ui/router' -import { bugTemplateText, docIssueTemplateText } from './templateText' - -export default function Issue() { - const { location } = useContext(RouterContext) - const pageUrl = window.location.href - const fnName = location.params?.page || '' - const docIssueUrl = docIssueTemplateText(pageUrl, fnName) - const bugIssueUrl = bugTemplateText(pageUrl, fnName) - - return ( -
    -

    Found an issue with this page?

    - - -
    - ) -} diff --git a/src/ui/screens/Docs/Doc/TSDoc/Issue/templateText.ts b/src/ui/screens/Docs/Doc/TSDoc/Issue/templateText.ts deleted file mode 100644 index f805b8a7..00000000 --- a/src/ui/screens/Docs/Doc/TSDoc/Issue/templateText.ts +++ /dev/null @@ -1,62 +0,0 @@ -const githubUrl = - 'https://github.com/date-fns/date-fns/issues/new?assignees=&labels=&template=bug_report.md' - -/** - * Returns GitHub document issue template URL with prefilled title and body - */ -export function docIssueTemplateText(url: string, fn: string): string { - const title = encodeURIComponent(`Problem in ${fn} documentation`) - const body = encodeURIComponent(` - There is an issue with the [${fn} documentation](${url}) - - ### The problem with ${fn} documentation - - - - ### Suggested edits - - - `) - return githubUrl + '&title=' + title + '&body=' + body -} - -/** - * Returns GitHub function issue template URL with prefilled title and body - */ -export function bugTemplateText(url: string, fn: string): string { - const title = encodeURIComponent(`Problem with ${fn} function`) - - const body = encodeURIComponent(` - There is an issue with the [${fn} function](${url}) - - ## The problem - - ### 💻 Code demonstrating the problem - - - - \`\`\`js - import { fn } from 'date-fns' - - fn() - //=> Problematic output - \`\`\` - - ### 🙁 Actual behavior - - - - ### 🙂 Expected behavior - - - - ## Debug information - - - date-fns version: - - Browser/Node.js version: - - Your timezone: - - Your current time: - - `) - return githubUrl + '&title=' + title + '&body=' + body -} diff --git a/src/ui/screens/Docs/Doc/TSDoc/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/index.tsx index cf582d75..3616ff6c 100644 --- a/src/ui/screens/Docs/Doc/TSDoc/index.tsx +++ b/src/ui/screens/Docs/Doc/TSDoc/index.tsx @@ -1,18 +1,13 @@ import type { DateFnsDocs } from '@date-fns/docs/types' -import { - findDescription, - findExamples, - findFn, - findReturns, -} from '@date-fns/docs/utils' +import { findDescription, findExamples, findFn } from '@date-fns/docs/utils' import { FunctionComponent, h } from 'preact' import { useMemo } from 'preact/hooks' import { parse } from 'typeroo' import { DocExamples } from '~/ui/components/DocExamples' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import { DocLinks } from '~/ui/components/DocLinks' import { DocUsage } from '~/ui/components/DocUsage' import { Markdown } from '~/ui/components/Markdown' -import Issue from './Issue' import { Returns } from './Returns' import { Header } from './style.css' @@ -65,7 +60,7 @@ export const TSDoc: FunctionComponent = ({ page }) => {
    {JSON.stringify(tsdoc, null, 2)}
    - + ) } diff --git a/src/ui/screens/Home/Contributors/index.tsx b/src/ui/screens/Home/Contributors/index.tsx index 15669e71..912973a2 100644 --- a/src/ui/screens/Home/Contributors/index.tsx +++ b/src/ui/screens/Home/Contributors/index.tsx @@ -1,9 +1,9 @@ +import isArray from 'lodash/isArray' import { h } from 'preact' -import { HomeBlock, HomeAction, HomeExternalLink } from '~/ui/components/Home' -import { List, Item, LinkContent, Avatar, Name } from './style.css' -import { useContributors } from '~/utils/useContributors' +import { HomeAction, HomeBlock, HomeExternalLink } from '~/ui/components/Home' import { docLink } from '~/ui/router/docLink' -import isArray from 'lodash/isArray' +import { useContributors } from '~/utils/useContributors' +import * as styles from './styles.css' export const Contributors = () => { const [contributors, { loading }] = useContributors() @@ -19,22 +19,22 @@ export const Contributors = () => { > {loading &&
    Loading...
    } {contributors && isArray(contributors) && ( - +
      {contributors.map((contributor) => ( - +
    1. - - + {`@${contributor.name}'s - @{contributor.name} - + @{contributor.name} + - +
    2. ))} - +
    )} ) diff --git a/src/ui/screens/Home/Contributors/style.css b/src/ui/screens/Home/Contributors/style.css deleted file mode 100644 index 0c5980e3..00000000 --- a/src/ui/screens/Home/Contributors/style.css +++ /dev/null @@ -1,36 +0,0 @@ -.List { - color: #4a3142; - margin-top: 15px; - font-size: 17px; - display: flex; - flex-wrap: wrap; - margin-bottom: -20px; - justify-content: center; -} - -.Item { - margin-top: 20px; - margin: 0 20px 20px 0; - flex-shrink: 0; -} - -.LinkContent { - display: flex; - flex-direction: column; - align-items: center; -} - -.Item:last-child { - margin-bottom: 0; -} - -.Avatar { - width: 60px; - height: 60px; - border-radius: 50%; -} - -.Name { - font-size: 14px; - margin: 5px 0 5px 0; -} diff --git a/src/ui/screens/Home/Contributors/style.css.d.ts b/src/ui/screens/Home/Contributors/style.css.d.ts deleted file mode 100644 index 49ba0389..00000000 --- a/src/ui/screens/Home/Contributors/style.css.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { CSSComponent } from '~/types/decss' - -export const List: CSSComponent -export const Item: CSSComponent -export const LinkContent: CSSComponent -export const Avatar: CSSComponent -export const Name: CSSComponent diff --git a/src/ui/screens/Home/Contributors/styles.css.ts b/src/ui/screens/Home/Contributors/styles.css.ts new file mode 100644 index 00000000..58248380 --- /dev/null +++ b/src/ui/screens/Home/Contributors/styles.css.ts @@ -0,0 +1,38 @@ +import { style } from '@vanilla-extract/css' + +export const list = style({ + color: '#4a3142', + marginTop: '15px', + fontSize: '17px', + display: 'flex', + flexWrap: 'wrap', + marginBottom: '-20px', + justifyContent: 'center', +}) + +export const item = style({ + marginTop: '20px', + margin: '0 20px 20px 0', + flexShrink: 0, + + ':last-child': { + marginBottom: '0', + }, +}) + +export const linkContent = style({ + display: 'flex', + flexDirection: 'column', + alignItems: 'center', +}) + +export const avatar = style({ + width: '60px', + height: '60px', + borderRadius: '50%', +}) + +export const name = style({ + fontSize: '14px', + margin: '5px 0 5px 0', +}) diff --git a/src/ui/screens/Home/Examples/index.tsx b/src/ui/screens/Home/Examples/index.tsx index ad9820cc..68ee0a56 100644 --- a/src/ui/screens/Home/Examples/index.tsx +++ b/src/ui/screens/Home/Examples/index.tsx @@ -3,15 +3,8 @@ import { useState } from 'preact/hooks' import { Code } from '~/ui/components/Code' import { HomeBlock } from '~/ui/components/Home' // TODO: import { trackAction } from 'app/acts/tracking_acts' - -import { - Container, - Options, - Option, - OptionLink, - CodeWrapper, - Warning, -} from './style.css' +import classNames from 'classnames' +import * as styles from './styles.css' // TODO: Generate example results with date-fns v2 const examples = [ @@ -88,39 +81,41 @@ export const Examples = () => { return ( - - + {IS_PRERELEASE && ( - +
    ⚠️ The provided examples are for v2 which is in pre-release right now. If you want to give it a try, install the latest version: npm install date-fns@next - +
    )}
    ) diff --git a/src/ui/screens/Home/Examples/style.css b/src/ui/screens/Home/Examples/style.css deleted file mode 100644 index 7afa96a6..00000000 --- a/src/ui/screens/Home/Examples/style.css +++ /dev/null @@ -1,51 +0,0 @@ -.Container { - width: 100%; - align-items: center; - display: flex; - flex-direction: column; -} - -.Options { - display: flex; - justify-content: center; - align-items: flex-end; -} - -.Option { - margin: 0 5px; -} - -.OptionLink { - color: #770c56; - text-decoration: none; - font-size: 14px; - padding: 10px 15px; - display: block; - border-top-right-radius: 3px; - border-top-left-radius: 3px; - background-color: #efe8df; -} - -.OptionLink-isCurrent { - color: white; - background-color: #770c56; -} - -.CodeWrapper { - width: 700px; -} - -@media screen and (max-width: 767px) { - .CodeWrapper { - width: calc(100vw - 60px); - } -} - -.Warning { - background: #fff8b9; - border-radius: 0.2rem; - padding: 1rem; - color: #4c2f01; - margin: 1rem auto 0; - max-width: 44rem; -} diff --git a/src/ui/screens/Home/Examples/style.css.d.ts b/src/ui/screens/Home/Examples/style.css.d.ts deleted file mode 100644 index abade65e..00000000 --- a/src/ui/screens/Home/Examples/style.css.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { CSSComponent } from '~/types/decss' - -export const Container: CSSComponent -export const Options: CSSComponent -export const Option: CSSComponent -export const OptionLink: CSSComponent<{ - isCurrent: boolean -}> -export const CodeWrapper: CSSComponent -export const Warning: CSSComponent diff --git a/src/ui/screens/Home/Examples/styles.css.ts b/src/ui/screens/Home/Examples/styles.css.ts new file mode 100644 index 00000000..3fb2d114 --- /dev/null +++ b/src/ui/screens/Home/Examples/styles.css.ts @@ -0,0 +1,53 @@ +import { style } from '@vanilla-extract/css' + +export const container = style({ + width: '100%', + alignItems: 'center', + display: 'flex', + flexDirection: 'column', +}) + +export const option = style({ + margin: '0 5px', +}) + +export const optionLink = style({ + color: '#770c56', + textDecoration: 'none', + fontSize: '14px', + padding: '10px 15px', + display: 'block', + borderTopRightRadius: '3px', + borderTopLeftRadius: '3px', + backgroundColor: '#efe8df', +}) + +export const optionLinkIsCurrent = style({ + color: 'white', + backgroundColor: '#770c56', +}) + +export const options = style({ + display: 'flex', + justifyContent: 'center', + alignItems: 'flex-end', +}) + +export const warning = style({ + background: '#fff8b9', + borderRadius: '0.2rem', + padding: '1rem', + color: '#4c2f01', + margin: '1rem auto 0', + maxWidth: '44rem', +}) + +export const codeWrapper = style({ + width: '700px', + + '@media': { + 'screen and (max-width: 767px)': { + width: 'calc(100vw-60px)', + }, + }, +}) diff --git a/src/ui/screens/Home/Features/features.tsx b/src/ui/screens/Home/Features/features.tsx index 98a6ac70..f3f868f8 100644 --- a/src/ui/screens/Home/Features/features.tsx +++ b/src/ui/screens/Home/Features/features.tsx @@ -1,7 +1,13 @@ -import { h, Fragment } from 'preact' -import { IconType } from './style.css' +import { h, Fragment, VNode } from 'preact' +import { iconType } from './styles.css' -export const features = [ +export interface Feature { + title: string + description: VNode + icon: keyof typeof iconType +} + +export const features: Feature[] = [ { title: 'Modular', description: ( @@ -18,7 +24,7 @@ export const features = [

    ), - icon: IconType.modular, + icon: 'modular', }, { @@ -26,8 +32,8 @@ export const features = [ description: ( <>

    - date-fns uses the native Date type and doesn't reinvent the wheel. - It doesn't extend core objects for safety's sake. + date-fns uses the native Date type and doesn't reinvent + the wheel. It doesn't extend core objects for safety's sake.

    @@ -36,7 +42,7 @@ export const features = [

    ), - icon: IconType.native, + icon: 'native', }, { @@ -51,7 +57,7 @@ export const features = [

    It helps to prevent bugs and avoid long debugging sessions.

    ), - icon: IconType.immutable, + icon: 'immutable', }, { @@ -69,7 +75,7 @@ export const features = [

    ), - icon: IconType.types, + icon: 'types', }, { @@ -81,7 +87,7 @@ export const features = [ bloat your build. ), - icon: IconType.fp, + icon: 'fp', }, { @@ -92,7 +98,7 @@ export const features = [ Only the ones that you use will be included in your project. ), - icon: IconType.i18n, + icon: 'i18n', }, { @@ -109,7 +115,7 @@ export const features = [

    ), - icon: IconType.consistent, + icon: 'consistent', }, { @@ -126,7 +132,7 @@ export const features = [

    ), - icon: IconType.reliable, + icon: 'reliable', }, { @@ -144,7 +150,7 @@ export const features = [

    ), - icon: IconType.simple, + icon: 'simple', }, { @@ -155,7 +161,7 @@ export const features = [ users will have the best user experience. ), - icon: IconType.fast, + icon: 'fast', }, { @@ -167,7 +173,7 @@ export const features = [ thanks to JSDoc annotations. ), - icon: IconType.docs, + icon: 'docs', }, { @@ -178,6 +184,6 @@ export const features = [ features. ), - icon: IconType.coming, + icon: 'coming', }, ] diff --git a/src/ui/screens/Home/Features/index.tsx b/src/ui/screens/Home/Features/index.tsx index 07d9a030..11d32f39 100644 --- a/src/ui/screens/Home/Features/index.tsx +++ b/src/ui/screens/Home/Features/index.tsx @@ -1,21 +1,21 @@ import { h } from 'preact' import { HomeBlock } from '~/ui/components/Home' -import { List, Item, Icon, Content, Title, Description } from './style.css' import { features } from './features' +import * as styles from './styles.css' +import classNames from 'classnames' export const Features = () => ( - +
      {features.map((feature) => ( - - - - {feature.title} - {feature.description} - - +
    1. +
      +
      +

      {feature.title}

      +
      {feature.description}
      +
      +
    2. ))} - +
    ) -export default Features diff --git a/src/ui/screens/Home/Features/style.css b/src/ui/screens/Home/Features/style.css deleted file mode 100644 index ef8a0d4a..00000000 --- a/src/ui/screens/Home/Features/style.css +++ /dev/null @@ -1,144 +0,0 @@ -.List { - color: #4a3142; - margin-top: 15px; - font-size: 17px; - display: flex; - flex-wrap: wrap; -} - -.Item { - display: flex; - flex-basis: calc(33.3% - 2rem); - margin: 0 1rem 3rem; -} - -@media screen and (max-width: 767px) { - .Item { - flex-basis: calc(50% - 2rem); - } -} - -@media screen and (max-width: 450px) { - .Item { - flex-basis: 100%; - margin: 0 0 3rem; - } -} - -.Item:last-child { - margin-bottom: 0; -} - -.Title { - font-weight: 600; - font-size: 17px; - margin-bottom: 5px; -} - -.Description { - color: #4c193c; - font-weight: 400; - font-size: 16px; - line-height: 22px; -} - -.Description p { - padding-bottom: 0.5rem; -} - -.Description p:last-child { - padding-bottom: 0; -} - -.Icon { - width: 38px; - height: 38px; - background-size: 40px; - border: 1px solid rgba(119, 12, 86, 0.6); - border-radius: 50%; - background-repeat: no-repeat; - background-position: center; - flex-shrink: 0; - margin-top: 2px; -} - -.Icon-type-modular { - background-image: url('./img/modular.svg'); - background-size: 17px; - background-position: center 6px; -} - -.Icon-type-immutable { - background-image: url('./img/immutable.svg'); - background-size: 17px; - background-position: center 6px; -} - -.Icon-type-consistent { - background-image: url('./img/consistent.svg'); - background-size: 21px; - background-position: center 7px; -} - -.Icon-type-reliable { - background-image: url('./img/reliable.svg'); - background-size: 21px; - background-position: center 6px; -} - -.Icon-type-simple { - background-image: url('./img/simple.svg'); - background-size: 20px; - background-position: center 8px; -} - -.Icon-type-safe { - background-image: url('./img/safe.svg'); - background-size: 18px; -} - -.Icon-type-fast { - background-image: url('./img/fast.svg'); - background-size: 15px; - background-position: center 8px; -} - -.Icon-type-docs { - background-image: url('./img/docs.svg'); - background-size: 19px; - background-position: center 7px; -} - -.Icon-type-types { - background-image: url('./img/types.svg'); - background-size: 20px; - background-position: center 8px; -} - -.Icon-type-fp { - background-image: url('./img/fp.svg'); - background-size: 16px; - background-position: center 8px; -} - -.Icon-type-i18n { - background-image: url('./img/i18n.svg'); - background-size: 16px; - background-position: center 9px; -} - -.Icon-type-native { - background-image: url('./img/native.svg'); - background-size: 24px; - background-position: center 6px; -} - -.Icon-type-coming { - background-image: url('./img/coming.svg'); - background-size: 20px; - background-position: center 8px; -} - -.Content { - margin-left: 15px; -} diff --git a/src/ui/screens/Home/Features/style.css.d.ts b/src/ui/screens/Home/Features/style.css.d.ts deleted file mode 100644 index 5467e66a..00000000 --- a/src/ui/screens/Home/Features/style.css.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { CSSComponent } from '~/types/decss' - -export const enum IconType { - modular = 'modular', - native = 'native', - immutable = 'immutable', - types = 'types', - fp = 'fp', - consistent = 'consistent', - i18n = 'i18n', - reliable = 'reliable', - simple = 'simple', - fast = 'fast', - docs = 'docs', - coming = 'coming', -} - -export const List: CSSComponent -export const Item: CSSComponent -export const Icon: CSSComponent<{ type: IconType }> -export const Content: CSSComponent -export const Title: CSSComponent -export const Description: CSSComponent diff --git a/src/ui/screens/Home/Features/styles.css.ts b/src/ui/screens/Home/Features/styles.css.ts new file mode 100644 index 00000000..5b20d81f --- /dev/null +++ b/src/ui/screens/Home/Features/styles.css.ts @@ -0,0 +1,159 @@ +import { style, globalStyle, styleVariants } from '@vanilla-extract/css' +import comingURL from './img/coming.svg' +import consistentURL from './img/consistent.svg' +import docsURL from './img/docs.svg' +import fastURL from './img/fast.svg' +import fpURL from './img/fp.svg' +import i18nURL from './img/i18n.svg' +import immutableURL from './img/immutable.svg' +import modularURL from './img/modular.svg' +import nativeURL from './img/native.svg' +import reliableURL from './img/reliable.svg' +import safeURL from './img/safe.svg' +import simpleURL from './img/simple.svg' +import typesURL from './img/types.svg' + +export const content = style({ + marginLeft: '15px', +}) + +export const icon = style({ + width: '38px', + height: '38px', + backgroundSize: '40px', + border: '1px solid rgba(119,12,86,0.6)', + borderRadius: '50%', + backgroundRepeat: 'no-repeat', + backgroundPosition: 'center', + flexShrink: '0', + marginTop: '2px', +}) + +export const iconType = styleVariants({ + coming: { + backgroundImage: `url(${comingURL})`, + backgroundSize: '20px', + backgroundPosition: 'center 8px', + }, + + consistent: { + backgroundImage: `url('${consistentURL}')`, + backgroundSize: '21px', + backgroundPosition: 'center 7px', + }, + + docs: { + backgroundImage: `url('${docsURL}')`, + backgroundSize: '19px', + backgroundPosition: 'center 7px', + }, + + fast: { + backgroundImage: `url('${fastURL}')`, + backgroundSize: '15px', + backgroundPosition: 'center 8px', + }, + + fp: { + backgroundImage: `url('${fpURL}')`, + backgroundSize: '16px', + backgroundPosition: 'center 8px', + }, + + i18n: { + backgroundImage: `url('${i18nURL}')`, + backgroundSize: '16px', + backgroundPosition: 'center 9px', + }, + + immutable: { + backgroundImage: `url('${immutableURL}')`, + backgroundSize: '17px', + backgroundPosition: 'center 6px', + }, + + modular: { + backgroundImage: `url('${modularURL}')`, + backgroundSize: '17px', + backgroundPosition: 'center 6px', + }, + + native: { + backgroundImage: `url('${nativeURL}')`, + backgroundSize: '24px', + backgroundPosition: 'center 6px', + }, + + reliable: { + backgroundImage: `url('${reliableURL}')`, + backgroundSize: '21px', + backgroundPosition: 'center 6px', + }, + + safe: { + backgroundImage: `url('${safeURL}')`, + backgroundSize: '18px', + }, + + simple: { + backgroundImage: `url('${simpleURL}')`, + backgroundSize: '20px', + backgroundPosition: 'center 8px', + }, + + types: { + backgroundImage: `url('${typesURL}')`, + backgroundSize: '20px', + backgroundPosition: 'center 8px', + }, +}) + +export const list = style({ + color: '#4a3142', + marginTop: '15px', + fontSize: '17px', + display: 'flex', + flexWrap: 'wrap', +}) + +export const title = style({ + fontWeight: '600', + fontSize: '17px', + marginBottom: '5px', +}) + +export const description = style({ + color: '#4c193c', + fontWeight: '400', + fontSize: '16px', + lineHeight: '22px', +}) + +globalStyle(`${description} p`, { + paddingBottom: '0.5rem', +}) + +globalStyle(`${description} p:last-child`, { + paddingBottom: '0.5rem', +}) + +export const item = style({ + display: 'flex', + flexBasis: 'calc(33.3% - 2rem)', + margin: '0 1rem 3rem', + + ':last-child': { + marginBottom: '0', + }, + + '@media': { + 'screen and (max-width: 767px)': { + flexBasis: 'calc(50% - 2rem)', + }, + + 'screen and (max-width: 450px)': { + flexBasis: '100%', + margin: '0 0 3rem', + }, + }, +}) diff --git a/src/ui/screens/Home/Footer/index.tsx b/src/ui/screens/Home/Footer/index.tsx index bebdc5d4..cfbab9f7 100644 --- a/src/ui/screens/Home/Footer/index.tsx +++ b/src/ui/screens/Home/Footer/index.tsx @@ -2,32 +2,38 @@ import { DEFAULT_PAGE } from '~/constants' import { h } from 'preact' import { HomeBlock } from '~/ui/components/Home' import { RouterLink } from '~/ui/router' -import { Container, Row } from './style.css' import { docLink } from '~/ui/router/docLink' +import * as styles from './styles.css' +import classNames from 'classnames' export const Footer = () => ( - - + ) diff --git a/src/ui/screens/Home/Footer/style.css b/src/ui/screens/Home/Footer/style.css deleted file mode 100644 index c43dc8e3..00000000 --- a/src/ui/screens/Home/Footer/style.css +++ /dev/null @@ -1,18 +0,0 @@ -.Container { - display: flex; - flex-direction: column; - align-items: center; -} - -.Row:not(:last-child) { - margin-bottom: 0.5rem; -} - -.Row-isLicense { - margin-top: 1rem; - font-size: 0.8rem; -} - -.Container a { - color: #a07d8f; -} diff --git a/src/ui/screens/Home/Footer/style.css.d.ts b/src/ui/screens/Home/Footer/style.css.d.ts deleted file mode 100644 index 936d622e..00000000 --- a/src/ui/screens/Home/Footer/style.css.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { CSSComponent } from '~/types/decss' - -export const Container: CSSComponent -export const Row: CSSComponent<{ - isLicense?: boolean -}> diff --git a/src/ui/screens/Home/Footer/styles.css.ts b/src/ui/screens/Home/Footer/styles.css.ts new file mode 100644 index 00000000..8672a203 --- /dev/null +++ b/src/ui/screens/Home/Footer/styles.css.ts @@ -0,0 +1,24 @@ +import { style, globalStyle } from '@vanilla-extract/css' + +export const rowIsLicense = style({ + marginTop: '1rem', + fontSize: '0.8rem', +}) + +export const container = style({ + display: 'flex', + flexDirection: 'column', + alignItems: 'center', +}) + +globalStyle(`${container} a`, { + color: '#a07d8f', +}) + +export const row = style({ + selectors: { + '&:not(:last-child)': { + marginBottom: '0.5rem', + }, + }, +}) diff --git a/src/ui/screens/Home/Promo/Navigation/index.tsx b/src/ui/screens/Home/Promo/Navigation/index.tsx index 16901193..c99d2ed1 100644 --- a/src/ui/screens/Home/Promo/Navigation/index.tsx +++ b/src/ui/screens/Home/Promo/Navigation/index.tsx @@ -1,21 +1,26 @@ import { h } from 'preact' import githubPath from './img/github.svg' import twitterPath from './img/twitter.svg' -import { Navigation as StyledNavigation, Link, Icon } from './style.css' +import * as styles from './styles.css' export const Navigation = () => ( - - - + ) diff --git a/src/ui/screens/Home/Promo/Navigation/style.css b/src/ui/screens/Home/Promo/Navigation/style.css deleted file mode 100644 index 81ed4ab3..00000000 --- a/src/ui/screens/Home/Promo/Navigation/style.css +++ /dev/null @@ -1,30 +0,0 @@ -.Navigation { - margin: 0 -10px; - font-size: 15px; -} - -@media screen and (max-width: 767px) { - .Navigation { - display: flex; - flex-direction: column; - align-items: center; - } -} - -.Link { - color: white; - margin: 5px 10px; - text-decoration: none; - opacity: 0.5; -} - -.Icon { - width: 16px; - margin-right: 5px; - position: relative; - top: 2px; -} - -.Link:hover { - opacity: 1; -} diff --git a/src/ui/screens/Home/Promo/Navigation/style.css.d.ts b/src/ui/screens/Home/Promo/Navigation/style.css.d.ts deleted file mode 100644 index 7682cab6..00000000 --- a/src/ui/screens/Home/Promo/Navigation/style.css.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { CSSComponent, CSSPreactComponent } from '~/types/decss' -import { RouterLink } from '~/ui/router' - -export const Navigation: CSSComponent -export const Link: CSSComponent -export const Icon: CSSComponent -export const LogoImage: CSSComponent -export const LogoName: CSSComponent -export const Header: CSSComponent -export const Text: CSSComponent -export const GettingStarted: CSSComponent -export const GettingStartedLink: CSSPreactComponent diff --git a/src/ui/screens/Home/Promo/Navigation/styles.css.ts b/src/ui/screens/Home/Promo/Navigation/styles.css.ts new file mode 100644 index 00000000..8f2110d9 --- /dev/null +++ b/src/ui/screens/Home/Promo/Navigation/styles.css.ts @@ -0,0 +1,30 @@ +import { style } from '@vanilla-extract/css' + +export const icon = style({ + width: '16px', + marginRight: '5px', + position: 'relative', + top: '2px', +}) + +export const link = style({ + color: 'white', + margin: '5px 10px', + textDecoration: 'none', + opacity: '0.5', + ':hover': { + opacity: '1', + }, +}) + +export const navigation = style({ + margin: '0 -10px', + fontSize: '15px', + '@media': { + 'screen and (max-width: 767px)': { + display: 'flex', + flexDirection: 'column', + alignItems: 'center', + }, + }, +}) diff --git a/src/ui/screens/Home/Promo/index.tsx b/src/ui/screens/Home/Promo/index.tsx index 47a07b9c..5fa9fc97 100644 --- a/src/ui/screens/Home/Promo/index.tsx +++ b/src/ui/screens/Home/Promo/index.tsx @@ -1,47 +1,37 @@ import { h } from 'preact' -import { Navigation } from './Navigation' -import { - Outer, - Inner, - Logo, - LogoImage, - LogoName, - Header, - Text, - GettingStarted, - GettingStartedLink, -} from './style.css' -import logoPath from './img/logo.svg' -import { RouterLink } from '~/ui/router' import { DEFAULT_PAGE } from '~/constants' +import { RouterLink } from '~/ui/router' import { docLink } from '~/ui/router/docLink' +import logoPath from './img/logo.svg' +import { Navigation } from './Navigation' +import * as styles from './styles.css' export const Promo = () => ( - - - - - date-fns - +
    +
    +
    + +
    date-fns
    +
    -
    Modern JavaScript date utility library
    +

    Modern JavaScript date utility library

    - +

    date-fns provides the most comprehensive, yet simple and consistent toolset for manipulating JavaScript dates in{' '} a browser & Node.js. - +

    - - + Documentation - - + +
    - - +
    + ) diff --git a/src/ui/screens/Home/Promo/style.css b/src/ui/screens/Home/Promo/style.css deleted file mode 100644 index 2855a96d..00000000 --- a/src/ui/screens/Home/Promo/style.css +++ /dev/null @@ -1,76 +0,0 @@ -.Outer { - width: 100%; - color: white; - background: #5a0530; - background-image: url('./img/background.png'); - background-size: cover; - background-position: top center; - overflow-y: auto; -} - -.Inner { - background: linear-gradient(rgba(118, 10, 61, 0.7), #4c042b); - padding: 4rem 1rem; - align-items: center; - display: flex; - align-items: center; - flex-direction: column; - justify-content: center; -} - -.Logo { - display: flex; - align-items: center; - justify-content: center; - height: 33px; -} - -.LogoImage { - width: 40px; -} - -.LogoName { - font-size: 35px; - color: #fff; - font-weight: 400; - margin-left: 10px; - position: relative; - top: -1px; -} - -.Header { - text-align: center; - color: #fbd7a1; - font-size: 20px; - margin-top: 2rem; - font-weight: 300; -} - -.Text { - font-size: 16px; - line-height: 22px; - font-weight: 200; - text-align: center; - margin-top: 1rem; - color: #ffe9c9; - max-width: 500px; -} - -.GettingStarted { - display: flex; - width: 100%; - justify-content: center; - margin: 2rem 0; -} - -.GettingStartedLink { - display: block; - background: #8c1b54; - text-align: center; - text-decoration: none; - color: #fff; - border-radius: 3px; - font-size: 1rem; - padding: 1rem; - width: 12rem; -} diff --git a/src/ui/screens/Home/Promo/style.css.d.ts b/src/ui/screens/Home/Promo/style.css.d.ts deleted file mode 100644 index 28871323..00000000 --- a/src/ui/screens/Home/Promo/style.css.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { CSSComponent, CSSPreactComponent } from '~/types/decss' -import { RouterLink } from '~/ui/router' - -export const Outer: CSSComponent -export const Inner: CSSComponent -export const Logo: CSSComponent -export const LogoImage: CSSComponent -export const LogoName: CSSComponent -export const Header: CSSComponent -export const Text: CSSComponent -export const GettingStarted: CSSComponent -export const GettingStartedLink: CSSPreactComponent diff --git a/src/ui/screens/Home/Promo/styles.css.ts b/src/ui/screens/Home/Promo/styles.css.ts new file mode 100644 index 00000000..f91d4e8c --- /dev/null +++ b/src/ui/screens/Home/Promo/styles.css.ts @@ -0,0 +1,76 @@ +import { style } from '@vanilla-extract/css' +import backgroundURL from './img/background.png' + +export const outer = style({ + width: '100%', + color: 'white', + background: '#5a0530', + backgroundImage: `url('${backgroundURL}')`, + backgroundSize: 'cover', + backgroundPosition: 'top center', + overflowY: 'auto', +}) + +export const inner = style({ + background: 'linear-gradient(rgba(118, 10, 61, 0.7), #4c042b)', + padding: '4rem 1rem', + alignItems: 'center', + display: 'flex', + flexDirection: 'column', + justifyContent: 'center', +}) + +export const logo = style({ + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + height: '33px', +}) + +export const logoImage = style({ width: '40px' }) + +export const logoName = style({ + fontSize: '35px', + color: '#fff', + fontWeight: 400, + marginLeft: '10px', + position: 'relative', + top: '-1px', +}) + +export const header = style({ + textAlign: 'center', + color: '#fbd7a1', + fontSize: '20px', + marginTop: '2rem', + fontWeight: 300, +}) + +export const text = style({ + fontSize: '16px', + lineHeight: '22px', + fontWeight: 200, + textAlign: 'center', + marginTop: '1rem', + color: '#ffe9c9', + maxWidth: '500px', +}) + +export const gettingStarted = style({ + display: 'flex', + width: '100%', + justifyContent: 'center', + margin: '2rem 0', +}) + +export const gettingStartedLink = style({ + display: 'block', + background: '#8c1b54', + textAlign: 'center', + textDecoration: 'none', + color: '#fff', + borderRadius: '3px', + fontSize: '1rem', + padding: '1rem', + width: '12rem', +}) diff --git a/src/ui/screens/Home/Sponsorship/index.tsx b/src/ui/screens/Home/Sponsorship/index.tsx index c2bdc89f..e7437eff 100644 --- a/src/ui/screens/Home/Sponsorship/index.tsx +++ b/src/ui/screens/Home/Sponsorship/index.tsx @@ -5,16 +5,9 @@ import { HomeExternalLink, HomeButton, } from '~/ui/components/Home' -import { - Subheader, - List, - Item, - ItemImageContainer, - ItemImage, - ItemImagePlaceholder, - ItemName, -} from './style.css' import { useSponsors, Sponsor } from '~/utils/useSponsors' +import * as styles from './styles.css' +import classNames from 'classnames' export const Sponsorship = () => { const [sponsors, { loading }] = useSponsors() @@ -38,37 +31,37 @@ export const Sponsorship = () => { > {sponsors && ( <> - Gold Sponsors +

    Gold Sponsors

    - +
    {sponsors.gold.map((sponsor) => ( ))} - +
    - Silver Sponsors +

    Silver Sponsors

    - +
    {sponsors.silver.map((sponsor) => ( ))} - +
    - Bronze Sponsors +

    Bronze Sponsors

    - +
    {sponsors.bronze.map((sponsor) => ( ))} - +
    - Backers +

    Backers

    - +
    {sponsors.backers.map((sponsor) => ( ))} - +
    )} @@ -83,27 +76,32 @@ export const Sponsorship = () => { } const Sponsor: FunctionComponent<{ - tier?: 'gold' | 'silver' | 'bronze' + tier?: keyof typeof styles.tier compact?: boolean sponsor: Sponsor }> = ({ tier, sponsor, compact }) => { return ( - - +
    +
    {sponsor.imageUrl ? ( - ) : ( - +
    )} - +
    - {!compact && {sponsor.name}} - + {!compact && {sponsor.name}} +
    ) } diff --git a/src/ui/screens/Home/Sponsorship/style.css b/src/ui/screens/Home/Sponsorship/style.css deleted file mode 100644 index 9fb864f1..00000000 --- a/src/ui/screens/Home/Sponsorship/style.css +++ /dev/null @@ -1,62 +0,0 @@ -.Subheader { - font-size: 18px; - line-height: 22px; - text-align: center; - color: #4c193c; - margin-bottom: 25px; -} - -.List { - display: flex; - justify-content: center; - margin-bottom: 1rem; - flex-wrap: wrap; - margin-right: -20px; -} - -.Item { - display: flex; - flex-direction: column; - align-items: center; - margin: 0 20px 20px 0; -} - -.ItemImageContainer { - width: 60px; - height: 60px; - border-radius: 50%; - overflow: hidden; - display: flex; - flex-direction: column; - justify-content: center; -} - -.ItemImageContainer-tier-gold { - height: 150px; - width: 150px; -} - -.ItemImageContainer-tier-silver { - height: 120px; - width: 120px; -} - -.ItemImageContainer-tier-bronze { - height: 80px; - width: 80px; -} - -.ItemImage { - width: 100%; -} - -.ItemImagePlaceholder { - background-color: grey; - height: 7rem; - width: 7rem; -} - -.ItemName { - font-size: 14px; - margin: 5px 0 5px 0; -} diff --git a/src/ui/screens/Home/Sponsorship/style.css.d.ts b/src/ui/screens/Home/Sponsorship/style.css.d.ts deleted file mode 100644 index 83528ccc..00000000 --- a/src/ui/screens/Home/Sponsorship/style.css.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { CSSComponent } from '~/types/decss' - -export const Subheader: CSSComponent -export const List: CSSComponent -export const Item: CSSComponent -export const ItemImageContainer: CSSComponent<{ - tier?: 'gold' | 'silver' | 'bronze' -}> -export const ItemImage: CSSComponent -export const ItemImagePlaceholder: CSSComponent -export const ItemName: CSSComponent diff --git a/src/ui/screens/Home/Sponsorship/styles.css.ts b/src/ui/screens/Home/Sponsorship/styles.css.ts new file mode 100644 index 00000000..cbfda2cc --- /dev/null +++ b/src/ui/screens/Home/Sponsorship/styles.css.ts @@ -0,0 +1,66 @@ +import { style, styleVariants } from '@vanilla-extract/css' + +export const item = style({ + display: 'flex', + flexDirection: 'column', + alignItems: 'center', + margin: '0 20px 20px 0', +}) + +export const itemImage = style({ + width: '100%', +}) + +export const itemImageContainer = style({ + width: '60px', + height: '60px', + borderRadius: '50%', + overflow: 'hidden', + display: 'flex', + flexDirection: 'column', + justifyContent: 'center', +}) + +export const tier = styleVariants({ + bronze: { + height: '80px', + width: '80px', + }, + + silver: { + height: '120px', + width: '120px', + }, + + gold: { + height: '150px', + width: '150px', + }, +}) + +export const itemImagePlaceholder = style({ + backgroundColor: 'grey', + height: '7rem', + width: '7rem', +}) + +export const itemName = style({ + fontSize: '14px', + margin: '5px 0 5px 0', +}) + +export const list = style({ + display: 'flex', + justifyContent: 'center', + marginBottom: '1rem', + flexWrap: 'wrap', + marginRight: '-20px', +}) + +export const subheader = style({ + fontSize: '18px', + lineHeight: '22px', + textAlign: 'center', + color: '#4c193c', + marginBottom: '25px', +}) diff --git a/src/ui/screens/Home/index.tsx b/src/ui/screens/Home/index.tsx index ae4f6ff3..3b82bd62 100644 --- a/src/ui/screens/Home/index.tsx +++ b/src/ui/screens/Home/index.tsx @@ -7,10 +7,10 @@ import { Testimonials } from './Testimonials' import { Sponsorship } from './Sponsorship' import { Contributors } from './Contributors' import { Footer } from './Footer' -import { Screen } from './style.css' +import * as styles from './styles.css' export const Home = () => ( - +
    {/* */} @@ -19,5 +19,5 @@ export const Home = () => (
    - +
    ) diff --git a/src/ui/screens/Home/style.css b/src/ui/screens/Home/style.css deleted file mode 100644 index a69356db..00000000 --- a/src/ui/screens/Home/style.css +++ /dev/null @@ -1,13 +0,0 @@ -.Screen { - width: 100%; - height: 100%; - overflow-x: hidden; - overflow-y: auto; -} - -.Content { - min-height: 100vh; - display: flex; - flex-direction: column; - width: 100%; -} diff --git a/src/ui/screens/Home/style.css.d.ts b/src/ui/screens/Home/style.css.d.ts deleted file mode 100644 index 096d90d9..00000000 --- a/src/ui/screens/Home/style.css.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CSSComponent, CSSPreactComponent } from '~/types/decss' - -export const Screen: CSSComponent diff --git a/src/ui/screens/Home/styles.css.ts b/src/ui/screens/Home/styles.css.ts new file mode 100644 index 00000000..2ec9e12f --- /dev/null +++ b/src/ui/screens/Home/styles.css.ts @@ -0,0 +1,8 @@ +import { style } from '@vanilla-extract/css' + +export const screen = style({ + width: '100%', + height: '100%', + overflowX: 'hidden', + overflowY: 'auto', +}) diff --git a/yarn.lock b/yarn.lock index 87db0405..f1356ff4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,14 @@ # yarn lockfile v1 +"@ampproject/remapping@^2.1.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" + integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== + dependencies: + "@jridgewell/gen-mapping" "^0.1.0" + "@jridgewell/trace-mapping" "^0.3.9" + "@apidevtools/json-schema-ref-parser@^9.0.3": version "9.0.7" resolved "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.7.tgz" @@ -18,11 +26,148 @@ dependencies: "@babel/highlight" "^7.10.4" +"@babel/code-frame@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" + integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== + dependencies: + "@babel/highlight" "^7.18.6" + +"@babel/compat-data@^7.20.5": + version "7.20.10" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.10.tgz#9d92fa81b87542fff50e848ed585b4212c1d34ec" + integrity sha512-sEnuDPpOJR/fcafHMjpcpGN5M2jbUGUHwmuWKM/YdPzeEDJg8bgmbcWQFUfE32MQjti1koACvoPVsDe8Uq+idg== + +"@babel/core@^7.13.10": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.7.tgz#37072f951bd4d28315445f66e0ec9f6ae0c8c35f" + integrity sha512-t1ZjCluspe5DW24bn2Rr1CDb2v9rn/hROtg9a2tmd0+QYf4bsloYfLQzjG4qHPNMhWtKdGC33R5AxGR2Af2cBw== + dependencies: + "@ampproject/remapping" "^2.1.0" + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.20.7" + "@babel/helper-compilation-targets" "^7.20.7" + "@babel/helper-module-transforms" "^7.20.7" + "@babel/helpers" "^7.20.7" + "@babel/parser" "^7.20.7" + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.20.7" + "@babel/types" "^7.20.7" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.1" + semver "^6.3.0" + +"@babel/generator@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.7.tgz#f8ef57c8242665c5929fe2e8d82ba75460187b4a" + integrity sha512-7wqMOJq8doJMZmP4ApXTzLxSr7+oO2jroJURrVEp6XShrQUObV8Tq/D0NCcoYg2uHqUrjzO0zwBjoYzelxK+sw== + dependencies: + "@babel/types" "^7.20.7" + "@jridgewell/gen-mapping" "^0.3.2" + jsesc "^2.5.1" + +"@babel/helper-compilation-targets@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz#a6cd33e93629f5eb473b021aac05df62c4cd09bb" + integrity sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ== + dependencies: + "@babel/compat-data" "^7.20.5" + "@babel/helper-validator-option" "^7.18.6" + browserslist "^4.21.3" + lru-cache "^5.1.1" + semver "^6.3.0" + +"@babel/helper-environment-visitor@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" + integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== + +"@babel/helper-function-name@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" + integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== + dependencies: + "@babel/template" "^7.18.10" + "@babel/types" "^7.19.0" + +"@babel/helper-hoist-variables@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" + integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-module-imports@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e" + integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-module-transforms@^7.20.7": + version "7.20.11" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz#df4c7af713c557938c50ea3ad0117a7944b2f1b0" + integrity sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg== + dependencies: + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-module-imports" "^7.18.6" + "@babel/helper-simple-access" "^7.20.2" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/helper-validator-identifier" "^7.19.1" + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.20.10" + "@babel/types" "^7.20.7" + +"@babel/helper-plugin-utils@^7.19.0": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629" + integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ== + +"@babel/helper-simple-access@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9" + integrity sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA== + dependencies: + "@babel/types" "^7.20.2" + +"@babel/helper-split-export-declaration@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" + integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-string-parser@^7.19.4": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" + integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== + "@babel/helper-validator-identifier@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz" integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== +"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" + integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== + +"@babel/helper-validator-option@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" + integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== + +"@babel/helpers@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.7.tgz#04502ff0feecc9f20ecfaad120a18f011a8e6dce" + integrity sha512-PBPjs5BppzsGaxHQCDKnZ6Gd9s6xl8bBCluz3vEInLGRJmnZan4F6BYCeqtyXqkk4W5IlPmjK4JlOuZkpJ3xZA== + dependencies: + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.20.7" + "@babel/types" "^7.20.7" + "@babel/highlight@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz" @@ -32,11 +177,68 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.9.4": +"@babel/highlight@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" + integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== + dependencies: + "@babel/helper-validator-identifier" "^7.18.6" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/parser@^7.20.7", "@babel/parser@^7.9.4": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.7.tgz#66fe23b3c8569220817d5feb8b9dcdc95bb4f71b" integrity sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg== +"@babel/plugin-syntax-typescript@^7.18.6": + version "7.20.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz#4e9a0cfc769c85689b77a2e642d24e9f697fc8c7" + integrity sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ== + dependencies: + "@babel/helper-plugin-utils" "^7.19.0" + +"@babel/runtime@^7.12.5": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.7.tgz#fcb41a5a70550e04a7b708037c7c32f7f356d8fd" + integrity sha512-UF0tvkUtxwAgZ5W/KrkHf0Rn0fdnLDU9ScxBrEVNUprE/MzirjK4MJUX1/BVDv00Sv8cljtukVK1aky++X1SjQ== + dependencies: + regenerator-runtime "^0.13.11" + +"@babel/template@^7.18.10", "@babel/template@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" + integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + +"@babel/traverse@^7.20.10", "@babel/traverse@^7.20.7": + version "7.20.10" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.10.tgz#2bf98239597fcec12f842756f186a9dde6d09230" + integrity sha512-oSf1juCgymrSez8NI4A2sr4+uB/mFd9MXplYGPEBnfAuWmmyeVcHa6xLPiaRBcXkcb/28bgxmQLTVwFKE1yfsg== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.20.7" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.19.0" + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + debug "^4.1.0" + globals "^11.1.0" + +"@babel/types@^7.18.6", "@babel/types@^7.19.0", "@babel/types@^7.20.2", "@babel/types@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.7.tgz#54ec75e252318423fc07fb644dc6a58a64c09b7f" + integrity sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg== + dependencies: + "@babel/helper-string-parser" "^7.19.4" + "@babel/helper-validator-identifier" "^7.19.1" + to-fast-properties "^2.0.0" + "@colors/colors@1.5.0": version "1.5.0" resolved "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz" @@ -65,6 +267,11 @@ resolved "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz" integrity sha512-HyYEUDeIj5rRQU2Hk5HTB2uHsbRQpF70nvMhVzi+VJR0X+xNEhjPui4/kBf3VeH/wqD28PT4sVOm8qqLjBrSZg== +"@emotion/hash@^0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.9.0.tgz#c5153d50401ee3c027a57a177bc269b16d889cb7" + integrity sha512-14FtKiHhy2QoPIzdTcvh//8OyBlknNs2nXRwIhG904opCby3l+9Xaf/wuPvICBF0rc1ZCNBd3nKe9cd2mecVkQ== + "@fastify/busboy@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-1.1.0.tgz#4472f856e2bb5a9ee34ad64b93891b73b73537ca" @@ -638,7 +845,15 @@ protobufjs "^7.0.0" yargs "^16.2.0" -"@jridgewell/gen-mapping@^0.3.0": +"@jridgewell/gen-mapping@^0.1.0": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" + integrity sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w== + dependencies: + "@jridgewell/set-array" "^1.0.0" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": version "0.3.2" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== @@ -652,7 +867,7 @@ resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== -"@jridgewell/set-array@^1.0.1": +"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== @@ -1284,6 +1499,61 @@ resolved "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz" integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== +"@vanilla-extract/babel-plugin-debug-ids@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@vanilla-extract/babel-plugin-debug-ids/-/babel-plugin-debug-ids-1.0.0.tgz#82e18dc1b9aa897e3a5798720d6b14cdfeffe908" + integrity sha512-Q2Nh/0FEAENfcphAv+fvcMoKfl3bhPWO/2x3MPviNAhsTsvuvYPuRtLjcXwoe4aJ8MxxI46JLY33j8NBEzpTIg== + dependencies: + "@babel/core" "^7.13.10" + +"@vanilla-extract/css@^1.9.2": + version "1.9.2" + resolved "https://registry.yarnpkg.com/@vanilla-extract/css/-/css-1.9.2.tgz#2c4bcc58f3c7441a1d041083c76bf5c3e2c77675" + integrity sha512-CE5+R89LOl9XG5dRwEIvVyl/YcS2GkqjdE/XnGJ+p7Fp6Exu08fifv7tY87XxFeCIRAbc9psM+h4lF+wC3Y0fg== + dependencies: + "@emotion/hash" "^0.9.0" + "@vanilla-extract/private" "^1.0.3" + ahocorasick "1.0.2" + chalk "^4.1.1" + css-what "^5.0.1" + cssesc "^3.0.0" + csstype "^3.0.7" + deep-object-diff "^1.1.0" + deepmerge "^4.2.2" + media-query-parser "^2.0.2" + outdent "^0.8.0" + +"@vanilla-extract/integration@^6.0.0": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@vanilla-extract/integration/-/integration-6.0.1.tgz#bd2493cad9b94d62b3e409562a89e70675b2325b" + integrity sha512-8D2JdBTH6UEao5Tm50m1qtY63JP4hDxiv/sNvgj2+ix/9M5RML9sa0diS80u0hW/r26+/ZsdzoA5YIbg6ghOMw== + dependencies: + "@babel/core" "^7.13.10" + "@babel/plugin-syntax-typescript" "^7.18.6" + "@vanilla-extract/babel-plugin-debug-ids" "^1.0.0" + "@vanilla-extract/css" "^1.9.2" + esbuild "^0.11.16" + eval "0.1.6" + find-up "^5.0.0" + javascript-stringify "^2.0.1" + lodash "^4.17.21" + outdent "^0.8.0" + +"@vanilla-extract/private@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@vanilla-extract/private/-/private-1.0.3.tgz#7ec72bc2ff6fe51f9d650f962e8d1989b073690f" + integrity sha512-17kVyLq3ePTKOkveHxXuIJZtGYs+cSoev7BlP+Lf4916qfDhk/HBjvlYDe8egrea7LNPHKwSZJK/bzZC+Q6AwQ== + +"@vanilla-extract/webpack-plugin@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@vanilla-extract/webpack-plugin/-/webpack-plugin-2.2.0.tgz#e7d07543d531a9fe283c37eebaabe746a44fbe30" + integrity sha512-EQrnT7gIki+Wm57eIRZRw6pi4M4VVnwiSp5OOcQF81XdZvoYXo51Ern7+dHKS+Xxli151BWTUsg/UZSpaAz29Q== + dependencies: + "@vanilla-extract/integration" "^6.0.0" + chalk "^4.1.1" + debug "^4.3.1" + loader-utils "^2.0.0" + "@webassemblyjs/ast@1.11.1": version "1.11.1" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" @@ -1524,6 +1794,11 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" +ahocorasick@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/ahocorasick/-/ahocorasick-1.0.2.tgz#9eee93aef9d02bfb476d9b648d9b7a40ef2fd500" + integrity sha512-hCOfMzbFx5IDutmWLAt6MZwOUjIfSM9G9FyVxytmE4Rs/5YDPWQrD/+IR1w+FweD9H2oOZEnv36TmkjhNURBVA== + ajv-formats@^2.1.0, ajv-formats@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" @@ -2021,6 +2296,16 @@ browserslist@^4.14.5: escalade "^3.1.1" node-releases "^1.1.69" +browserslist@^4.21.3: + version "4.21.4" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987" + integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw== + dependencies: + caniuse-lite "^1.0.30001400" + electron-to-chromium "^1.4.251" + node-releases "^2.0.6" + update-browserslist-db "^1.0.9" + buffer-crc32@^0.2.1, buffer-crc32@^0.2.13: version "0.2.13" resolved "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz" @@ -2149,6 +2434,11 @@ caniuse-lite@^1.0.30001173: resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001174.tgz" integrity sha512-tqClL/4ThQq6cfFXH3oJL4rifFBeM6gTkphjao5kgwMaW9yn0tKgQLAEfKzDwj6HQWCB/aWo8kTFlSvIN8geEA== +caniuse-lite@^1.0.30001400: + version "1.0.30001441" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001441.tgz#987437b266260b640a23cd18fbddb509d7f69f3e" + integrity sha512-OyxRR4Vof59I3yGWXws6i908EtGbMzVUi3ganaZQHmydk1iwDhRnvaPG2WaR0KcqrDFKrxVZHULT396LEPhXfg== + cardinal@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/cardinal/-/cardinal-2.1.1.tgz" @@ -2195,7 +2485,7 @@ chalk@^4.0.0, chalk@^4.1.0: chalk@^4.1.1: version "4.1.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" @@ -2289,6 +2579,11 @@ cjson@^0.3.1: dependencies: json-parse-helpfulerror "^1.0.3" +classnames@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.2.tgz#351d813bf0137fcc6a76a16b88208d2560a0d924" + integrity sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw== + clean-css@^5.2.2: version "5.3.1" resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-5.3.1.tgz#d0610b0b90d125196a2894d35366f734e5d7aa32" @@ -2604,6 +2899,11 @@ content-type@^1.0.4, content-type@~1.0.4: resolved "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz" integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== +convert-source-map@^1.7.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" + integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== + cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz" @@ -2752,6 +3052,11 @@ css-what@^4.0.0: resolved "https://registry.npmjs.org/css-what/-/css-what-4.0.0.tgz" integrity sha512-teijzG7kwYfNVsUh2H/YN62xW3KK9YhXEgSlbxMlcyjPNvdKJqFx5lrwlJgoFP1ZHlB89iGDlo/JyshKeRhv5A== +css-what@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.1.0.tgz#3f7b707aadf633baf62c2ceb8579b545bb40f7fe" + integrity sha512-arSMRWIIFY0hV8pIxZMEfmMI47Wj3R/aWpZDDxWYCPEiOMv6tfOrnpDtgxBYPEQD4V0Y/958+1TdC3iWTFcUPw== + css-what@^6.0.1: version "6.1.0" resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" @@ -2767,6 +3072,11 @@ csstype@^3.0.2: resolved "https://registry.npmjs.org/csstype/-/csstype-3.0.6.tgz" integrity sha512-+ZAmfyWMT7TiIlzdqJgjMb7S4f1beorDbWbsocyK4RaiqA5RTX3K14bnBWmmA9QEM0gRdsjyyrEmcyga8Zsxmw== +csstype@^3.0.7: + version "3.1.1" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.1.tgz#841b532c45c758ee546a11d5bd7b7b473c8c30b9" + integrity sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw== + csv-parse@^5.0.4: version "5.0.4" resolved "https://registry.npmjs.org/csv-parse/-/csv-parse-5.0.4.tgz" @@ -2868,6 +3178,16 @@ deep-is@^0.1.3, deep-is@~0.1.3: resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= +deep-object-diff@^1.1.0: + version "1.1.9" + resolved "https://registry.yarnpkg.com/deep-object-diff/-/deep-object-diff-1.1.9.tgz#6df7ef035ad6a0caa44479c536ed7b02570f4595" + integrity sha512-Rn+RuwkmkDwCi2/oXOFS9Gsr5lJZu/yTGpK7wAaAIE75CC+LCGEZHpY6VQJa/RoJcrmaA/docWJZvYohlNkWPA== + +deepmerge@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" + integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== + defaults@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz" @@ -3083,6 +3403,11 @@ electron-to-chromium@^1.3.634: resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.636.tgz" integrity sha512-Adcvng33sd3gTjNIDNXGD1G4H6qCImIy2euUJAQHtLNplEKU5WEz5KRJxupRNIIT8sD5oFZLTKBWAf12Bsz24A== +electron-to-chromium@^1.4.251: + version "1.4.284" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592" + integrity sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA== + emoji-regex@^7.0.1: version "7.0.3" resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz" @@ -3316,6 +3641,11 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" +esbuild@^0.11.16: + version "0.11.23" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.11.23.tgz#c42534f632e165120671d64db67883634333b4b8" + integrity sha512-iaiZZ9vUF5wJV8ob1tl+5aJTrwDczlvGP0JoMmnpC2B0ppiMCu8n8gmy5ZTGl5bcG081XBVn+U+jP+mPFm5T5Q== + escalade@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" @@ -3424,6 +3754,13 @@ etag@~1.8.1: resolved "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz" integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= +eval@0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/eval/-/eval-0.1.6.tgz#9620d7d8c85515e97e6b47c5814f46ae381cb3cc" + integrity sha512-o0XUw+5OGkXw4pJZzQoXUk+H87DHuC+7ZE//oSrRGtatTmr12oTnLfg6QOq9DyTt0c/p4TwzgmkKrBzWTSizyQ== + dependencies: + require-like ">= 0.1.1" + event-target-shim@^5.0.0: version "5.0.1" resolved "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz" @@ -3706,7 +4043,7 @@ finalhandler@1.2.0: statuses "2.0.1" unpipe "~1.0.0" -find-up@5.0.0: +find-up@5.0.0, find-up@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== @@ -4049,6 +4386,11 @@ gcp-metadata@^5.0.0: gaxios "^5.0.0" json-bigint "^1.0.0" +gensync@^1.0.0-beta.2: + version "1.0.0-beta.2" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" + integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== + get-caller-file@^2.0.1, get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" @@ -4196,6 +4538,11 @@ global-dirs@^3.0.0: dependencies: ini "2.0.0" +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + globby@^13.1.1: version "13.1.3" resolved "https://registry.yarnpkg.com/globby/-/globby-13.1.3.tgz#f62baf5720bcb2c1330c8d4ef222ee12318563ff" @@ -5023,6 +5370,11 @@ isstream@~0.1.2: resolved "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= +javascript-stringify@^2.0.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/javascript-stringify/-/javascript-stringify-2.1.0.tgz#27c76539be14d8bd128219a2d731b09337904e79" + integrity sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg== + jest-worker@^27.4.5: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" @@ -5125,6 +5477,11 @@ jsdoc@^4.0.0: strip-json-comments "^3.1.0" underscore "~1.13.2" +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + json-bigint@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz" @@ -5664,6 +6021,13 @@ mdurl@^1.0.1: resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== +media-query-parser@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/media-query-parser/-/media-query-parser-2.0.2.tgz#ff79e56cee92615a304a1c2fa4f2bd056c0a1d29" + integrity sha512-1N4qp+jE0pL5Xv4uEcwVUhIkwdUO3S/9gML90nqKA7v7FcOS5vUtatfzok9S9U1EJU8dHWlcv95WLnKmmxZI9w== + dependencies: + "@babel/runtime" "^7.12.5" + media-typer@0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz" @@ -6072,6 +6436,11 @@ node-releases@^1.1.69: resolved "https://registry.npmjs.org/node-releases/-/node-releases-1.1.69.tgz" integrity sha512-DGIjo79VDEyAnRlfSqYTsy+yoHd2IOjJiKUozD2MV2D85Vso6Bug56mb9tT/fY5Urt0iqk01H7x+llAruDR2zA== +node-releases@^2.0.6: + version "2.0.8" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.8.tgz#0f349cdc8fcfa39a92ac0be9bc48b7706292b9ae" + integrity sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A== + nopt@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz" @@ -6290,6 +6659,11 @@ os-tmpdir@~1.0.2: resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= +outdent@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/outdent/-/outdent-0.8.0.tgz#2ebc3e77bf49912543f1008100ff8e7f44428eb0" + integrity sha512-KiOAIsdpUTcAXuykya5fnVVT+/5uS0Q1mrkRHcF89tpieSmY33O/tmc54CqwA+bfhbtEfZUNLHaPUiB9X3jt1A== + p-defer@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/p-defer/-/p-defer-3.0.0.tgz" @@ -7064,6 +7438,11 @@ redeyed@~2.1.0: dependencies: esprima "~4.0.0" +regenerator-runtime@^0.13.11: + version "0.13.11" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" + integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== + registry-auth-token@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.1.tgz" @@ -7138,6 +7517,11 @@ require-from-string@^2.0.2: resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== +"require-like@>= 0.1.1": + version "0.1.2" + resolved "https://registry.yarnpkg.com/require-like/-/require-like-0.1.2.tgz#ad6f30c13becd797010c468afa775c0c0a6b47fa" + integrity sha512-oyrU88skkMtDdauHDuKVrgR+zuItqr6/c//FXzvmxRGMexSDc6hNvJInGW3LL46n+8b50RykrvwSUIIQH2LQ5A== + require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz" @@ -8007,6 +8391,11 @@ tmp@^0.2.1: dependencies: rimraf "^3.0.0" +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== + to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" @@ -8325,6 +8714,14 @@ unzipper@^0.10.10: readable-stream "~2.3.6" setimmediate "~1.0.4" +update-browserslist-db@^1.0.9: + version "1.0.10" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3" + integrity sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ== + dependencies: + escalade "^3.1.1" + picocolors "^1.0.0" + update-notifier-cjs@^5.1.6: version "5.1.6" resolved "https://registry.npmjs.org/update-notifier-cjs/-/update-notifier-cjs-5.1.6.tgz" From 728bfd2d5c07d24b50d9e6759a6d9fe9b9855f3b Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Tue, 3 Jan 2023 15:25:45 +0800 Subject: [PATCH 09/36] Migrate CSS to vanilla-extract --- src/ui/components/BooksWidget/index.tsx | 47 +++--- src/ui/components/BooksWidget/style.css | 93 ----------- src/ui/components/BooksWidget/style.css.d.ts | 12 -- src/ui/components/BooksWidget/styles.css.ts | 99 ++++++++++++ src/ui/components/Code/index.tsx | 13 +- src/ui/components/Code/style.css | 21 --- src/ui/components/Code/style.css.d.ts | 4 - src/ui/components/Code/styles.css.ts | 21 +++ src/ui/components/DocExamples/index.tsx | 14 +- src/ui/components/DocExamples/style.css | 3 - src/ui/components/DocExamples/style.css.d.ts | 3 - src/ui/components/DocExamples/styles.css.ts | 5 + src/ui/components/DocHeader/index.tsx | 10 ++ src/ui/components/DocHeader/styles.css.ts | 5 + src/ui/components/DocHeaderAnchor/index.tsx | 6 +- src/ui/components/DocHeaderAnchor/style.css | 19 --- .../components/DocHeaderAnchor/style.css.d.ts | 3 - .../components/DocHeaderAnchor/styles.css.ts | 18 +++ src/ui/components/DocParams/index.tsx | 8 +- src/ui/components/DocParams/style.css | 9 -- src/ui/components/DocParams/style.css.d.ts | 4 - src/ui/components/DocParams/styles.css.ts | 11 ++ src/ui/components/DocUsage/index.tsx | 21 +-- src/ui/components/DocUsage/style.css | 27 ---- src/ui/components/DocUsage/style.css.d.ts | 5 - src/ui/components/DocUsage/styles.css.ts | 29 ++++ src/ui/components/HireWidget/index.tsx | 34 ++-- src/ui/components/HireWidget/style.css | 28 ---- src/ui/components/HireWidget/style.css.d.ts | 5 - src/ui/components/HireWidget/styles.css.ts | 58 +++++++ src/ui/components/JobsBanner/Icon.tsx | 6 +- src/ui/components/JobsBanner/index.tsx | 31 ++-- src/ui/components/JobsBanner/style.css | 43 ----- src/ui/components/JobsBanner/style.css.d.ts | 8 - src/ui/components/JobsBanner/styles.css.ts | 35 ++++ .../components/JobsSubscribeWidget/index.tsx | 62 ++++--- .../components/JobsSubscribeWidget/style.css | 51 ------ .../JobsSubscribeWidget/style.css.d.ts | 8 - .../JobsSubscribeWidget/styles.css.ts | 81 ++++++++++ src/ui/components/JobsWidget/NextIcon.tsx | 8 +- src/ui/components/JobsWidget/index.tsx | 70 ++++---- src/ui/components/JobsWidget/style.css | 111 ------------- src/ui/components/JobsWidget/style.css.d.ts | 16 -- src/ui/components/JobsWidget/styles.css.ts | 116 +++++++++++++ src/ui/screens/Docs/Doc/JSDoc/index.tsx | 6 +- src/ui/screens/Docs/Doc/JSDoc/style.css | 3 - src/ui/screens/Docs/Doc/JSDoc/style.css.d.ts | 3 - src/ui/screens/Docs/Doc/TSDoc/index.tsx | 6 +- src/ui/screens/Docs/Doc/TSDoc/style.css | 3 - src/ui/screens/Docs/Doc/TSDoc/style.css.d.ts | 3 - src/ui/screens/Docs/Doc/index.tsx | 26 +-- src/ui/screens/Docs/Doc/style.css | 132 --------------- src/ui/screens/Docs/Doc/style.css.d.ts | 4 - src/ui/screens/Docs/Doc/styles.css.ts | 153 ++++++++++++++++++ src/ui/screens/Docs/Finder/CancelButton.tsx | 5 +- src/ui/screens/Docs/Finder/Categories.tsx | 12 +- src/ui/screens/Docs/Finder/Items.tsx | 14 +- src/ui/screens/Docs/Finder/NoResults.tsx | 8 +- src/ui/screens/Docs/Finder/index.tsx | 30 ++-- src/ui/screens/Docs/Finder/style.css | 142 ---------------- src/ui/screens/Docs/Finder/style.css.d.ts | 23 --- src/ui/screens/Docs/Finder/styles.css.ts | 153 ++++++++++++++++++ .../screens/Docs/NavBar/LatestVersionLink.tsx | 8 +- .../screens/Docs/NavBar/SubmoduleSelector.tsx | 15 +- .../screens/Docs/NavBar/VersionSelector.tsx | 15 +- src/ui/screens/Docs/NavBar/index.tsx | 49 +++--- src/ui/screens/Docs/NavBar/style.css | 122 -------------- src/ui/screens/Docs/NavBar/style.css.d.ts | 14 -- src/ui/screens/Docs/NavBar/styles.css.ts | 124 ++++++++++++++ src/ui/screens/Docs/index.tsx | 68 ++++---- src/ui/screens/Docs/style.css | 81 ---------- src/ui/screens/Docs/style.css.d.ts | 8 - src/ui/screens/Docs/styles.css.ts | 88 ++++++++++ src/ui/screens/Home/Testimonials/index.tsx | 45 ++---- src/ui/screens/Home/Testimonials/style.css | 77 --------- .../screens/Home/Testimonials/style.css.d.ts | 11 -- .../screens/Home/Testimonials/styles.css.ts | 79 +++++++++ 77 files changed, 1372 insertions(+), 1439 deletions(-) delete mode 100644 src/ui/components/BooksWidget/style.css delete mode 100644 src/ui/components/BooksWidget/style.css.d.ts create mode 100644 src/ui/components/BooksWidget/styles.css.ts delete mode 100644 src/ui/components/Code/style.css delete mode 100644 src/ui/components/Code/style.css.d.ts create mode 100644 src/ui/components/Code/styles.css.ts delete mode 100644 src/ui/components/DocExamples/style.css delete mode 100644 src/ui/components/DocExamples/style.css.d.ts create mode 100644 src/ui/components/DocExamples/styles.css.ts create mode 100644 src/ui/components/DocHeader/index.tsx create mode 100644 src/ui/components/DocHeader/styles.css.ts delete mode 100644 src/ui/components/DocHeaderAnchor/style.css delete mode 100644 src/ui/components/DocHeaderAnchor/style.css.d.ts create mode 100644 src/ui/components/DocHeaderAnchor/styles.css.ts delete mode 100644 src/ui/components/DocParams/style.css delete mode 100644 src/ui/components/DocParams/style.css.d.ts create mode 100644 src/ui/components/DocParams/styles.css.ts delete mode 100644 src/ui/components/DocUsage/style.css delete mode 100644 src/ui/components/DocUsage/style.css.d.ts create mode 100644 src/ui/components/DocUsage/styles.css.ts delete mode 100644 src/ui/components/HireWidget/style.css delete mode 100644 src/ui/components/HireWidget/style.css.d.ts create mode 100644 src/ui/components/HireWidget/styles.css.ts delete mode 100644 src/ui/components/JobsBanner/style.css delete mode 100644 src/ui/components/JobsBanner/style.css.d.ts create mode 100644 src/ui/components/JobsBanner/styles.css.ts delete mode 100644 src/ui/components/JobsSubscribeWidget/style.css delete mode 100644 src/ui/components/JobsSubscribeWidget/style.css.d.ts create mode 100644 src/ui/components/JobsSubscribeWidget/styles.css.ts delete mode 100644 src/ui/components/JobsWidget/style.css delete mode 100644 src/ui/components/JobsWidget/style.css.d.ts create mode 100644 src/ui/components/JobsWidget/styles.css.ts delete mode 100644 src/ui/screens/Docs/Doc/JSDoc/style.css delete mode 100644 src/ui/screens/Docs/Doc/JSDoc/style.css.d.ts delete mode 100644 src/ui/screens/Docs/Doc/TSDoc/style.css delete mode 100644 src/ui/screens/Docs/Doc/TSDoc/style.css.d.ts delete mode 100644 src/ui/screens/Docs/Doc/style.css delete mode 100644 src/ui/screens/Docs/Doc/style.css.d.ts create mode 100644 src/ui/screens/Docs/Doc/styles.css.ts delete mode 100644 src/ui/screens/Docs/Finder/style.css delete mode 100644 src/ui/screens/Docs/Finder/style.css.d.ts create mode 100644 src/ui/screens/Docs/Finder/styles.css.ts delete mode 100644 src/ui/screens/Docs/NavBar/style.css delete mode 100644 src/ui/screens/Docs/NavBar/style.css.d.ts create mode 100644 src/ui/screens/Docs/NavBar/styles.css.ts delete mode 100644 src/ui/screens/Docs/style.css delete mode 100644 src/ui/screens/Docs/style.css.d.ts create mode 100644 src/ui/screens/Docs/styles.css.ts delete mode 100644 src/ui/screens/Home/Testimonials/style.css delete mode 100644 src/ui/screens/Home/Testimonials/style.css.d.ts create mode 100644 src/ui/screens/Home/Testimonials/styles.css.ts diff --git a/src/ui/components/BooksWidget/index.tsx b/src/ui/components/BooksWidget/index.tsx index 5a77f898..f82542c9 100644 --- a/src/ui/components/BooksWidget/index.tsx +++ b/src/ui/components/BooksWidget/index.tsx @@ -2,18 +2,7 @@ import { h, FunctionComponent } from 'preact' import shuffle from 'lodash/shuffle' import { useMemo, useState } from 'preact/hooks' import { books } from './constants' -import { - Container, - Badge, - BadgeLabel, - BadgeNext, - Cover, - Text, - Header, - Title, - Description, - Link, -} from './style.css' +import * as styles from './styles.css' export const BooksWidget: FunctionComponent = () => { const shuffledBooks = useMemo(() => shuffle(books), []) @@ -22,29 +11,29 @@ export const BooksWidget: FunctionComponent = () => { return (
    - - + - -
    - {book.title} - {book.description} -
    +
    +
    +
    {book.title}
    +
    {book.description}
    +
    - Get the book - - + +
    + - - ☝️ Support date-fns, buy a book 🙏 +
    +
    ☝️ Support date-fns, buy a book 🙏
    - { let newIndex = bookIndex + 1 if (newIndex > books.length - 1) { @@ -54,8 +43,8 @@ export const BooksWidget: FunctionComponent = () => { }} > Next book - - + +
    ) } diff --git a/src/ui/components/BooksWidget/style.css b/src/ui/components/BooksWidget/style.css deleted file mode 100644 index f2166dc4..00000000 --- a/src/ui/components/BooksWidget/style.css +++ /dev/null @@ -1,93 +0,0 @@ -.Container { - padding: 0.5rem; - background: #39065a; - color: #fff6f6; - display: flex; - align-items: flex-start; - text-decoration: none; - transition: background 150ms ease-out; -} - -.Badge { - background: #9a0f98; - padding: 0.25rem; - display: flex; - justify-content: space-between; - align-items: center; -} - -.BadgeLabel { - color: white; - font-weight: 600; -} - -.BadgeNext { - background: transparent; - color: white; - border: 1px solid white; - border-radius: 0.25rem; - cursor: pointer; -} - -.BadgeNext:hover { - color: #9a0f98; - background: white; -} - -.Container:hover { - background: #6a0572; -} - -.Container > *:not(:last-child) { - margin-right: 0.75rem; -} - -.Cover { - width: 6rem; - flex-shrink: 0; -} - -.Text { - line-height: 1.2; -} - -.Text > *:not(:last-child) { - margin-bottom: 0.5rem; -} - -.Header > *:not(:last-child) { - margin-bottom: 0.125rem; -} - -.Title { - font-weight: 600; - font-size: 1.25rem; - color: #ead7af; -} - -.Container:hover .Title { - text-decoration: underline; -} - -.Description { - line-height: 1.4; - font-size: 0.9rem; - color: #fdf4dc; -} - -.Link { - background: #ea0599; - padding: 0.25rem 0.5rem; - display: inline-block; - color: white; - font-size: 1rem; - font-weight: 500; - border-radius: 0.25rem; - transition: background 150ms ease-out; - border: none; - cursor: pointer; -} - -.Container:hover .Link { - background: #ff00a5; -} diff --git a/src/ui/components/BooksWidget/style.css.d.ts b/src/ui/components/BooksWidget/style.css.d.ts deleted file mode 100644 index 526bd858..00000000 --- a/src/ui/components/BooksWidget/style.css.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { CSSComponent, CSSPreactComponent } from '~/types/decss' - -export const Container: CSSComponent -export const Badge: CSSComponent -export const BadgeLabel: CSSComponent -export const BadgeNext: CSSComponent -export const Cover: CSSComponent -export const Text: CSSComponent -export const Header: CSSComponent -export const Title: CSSComponent -export const Description: CSSComponent -export const Link: CSSComponent diff --git a/src/ui/components/BooksWidget/styles.css.ts b/src/ui/components/BooksWidget/styles.css.ts new file mode 100644 index 00000000..7dcaaf6c --- /dev/null +++ b/src/ui/components/BooksWidget/styles.css.ts @@ -0,0 +1,99 @@ +import { style, globalStyle } from '@vanilla-extract/css' + +export const badge = style({ + background: '#9a0f98', + padding: '0.25rem', + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', +}) + +export const badgeLabel = style({ + color: 'white', + fontWeight: '600', +}) + +export const badgeNext = style({ + background: 'transparent', + color: 'white', + border: '1px solid white', + borderRadius: '0.25rem', + cursor: 'pointer', + + ':hover': { + color: '#9a0f98', + background: 'white', + }, +}) + +export const cover = style({ + width: '6rem', + flexShrink: '0', +}) + +export const description = style({ + lineHeight: '1.4', + fontSize: '0.9rem', + color: '#fdf4dc', +}) + +export const container = style({ + padding: '0.5rem', + background: '#39065a', + color: '#fff6f6', + display: 'flex', + alignItems: 'flex-start', + textDecoration: 'none', + transition: 'background 150ms ease-out', + + ':hover': { + background: '#6a0572', + }, +}) + +globalStyle(`${container} > *:not(:last-child)`, { + marginRight: '0.75rem', +}) + +export const header = style({}) + +globalStyle(`${header} > *:not(:last-child)`, { + marginBottom: '0.125rem', +}) + +export const link = style({ + background: '#ea0599', + padding: '0.25rem 0.5rem', + display: 'inline-block', + color: 'white', + fontSize: '1rem', + fontWeight: '500', + borderRadius: '0.25rem', + transition: 'background 150ms ease-out', + border: 'none', + cursor: 'pointer', + selectors: { + [`${container}:hover &`]: { + background: '#ff00a5', + }, + }, +}) + +export const text = style({ + lineHeight: '1.2', +}) + +globalStyle(`${text} > *:not(:last-child)`, { + marginBottom: '0.5rem', +}) + +export const title = style({ + fontWeight: '600', + fontSize: '1.25rem', + color: '#ead7af', + selectors: { + [`${container}:hover &`]: { + textDecoration: 'underline', + }, + }, +}) diff --git a/src/ui/components/Code/index.tsx b/src/ui/components/Code/index.tsx index 6a251cef..57c61147 100644 --- a/src/ui/components/Code/index.tsx +++ b/src/ui/components/Code/index.tsx @@ -1,19 +1,18 @@ -import { h, FunctionComponent, Fragment } from 'preact' +import { FunctionComponent, h } from 'preact' import Prism from 'prismjs' import 'prismjs/themes/prism.css?global' import './global.css?global' -import { Pre, Code as StyledCode } from './style.css' +import * as styles from './styles.css' interface CodeProps { value: string } export const Code: FunctionComponent = ({ value }) => { const html = Prism.highlight(value, Prism.languages.javascript, 'javascript') + return ( - <> -
    -        
    -      
    - +
    +      
    +    
    ) } diff --git a/src/ui/components/Code/style.css b/src/ui/components/Code/style.css deleted file mode 100644 index af718ec1..00000000 --- a/src/ui/components/Code/style.css +++ /dev/null @@ -1,21 +0,0 @@ -.Pre { - overflow-x: auto; - border: 1px solid #b9a2b2; - background-color: #fffffe; - padding: 4px 8px; -} - -.Code { - display: block; - color: #5d583b; - background-color: #fffffe; - font: 13px Consolas, 'Liberation Mono', Menlo, Courier, monospace; -} - -.Code::before { - display: none; -} - -.Code::after { - display: none; -} diff --git a/src/ui/components/Code/style.css.d.ts b/src/ui/components/Code/style.css.d.ts deleted file mode 100644 index bc6e6350..00000000 --- a/src/ui/components/Code/style.css.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CSSComponent } from '~/types/decss' - -export const Pre: CSSComponent -export const Code: CSSComponent diff --git a/src/ui/components/Code/styles.css.ts b/src/ui/components/Code/styles.css.ts new file mode 100644 index 00000000..d7f33797 --- /dev/null +++ b/src/ui/components/Code/styles.css.ts @@ -0,0 +1,21 @@ +import { style } from '@vanilla-extract/css' + +export const code = style({ + display: 'block', + color: '#5d583b', + backgroundColor: '#fffffe', + font: "13px Consolas, 'Liberation Mono', Menlo, Courier, monospace", + '::after': { + display: 'none', + }, + '::before': { + display: 'none', + }, +}) + +export const pre = style({ + overflowX: 'auto', + border: '1px solid #b9a2b2', + backgroundColor: '#fffffe', + padding: '4px 8px', +}) diff --git a/src/ui/components/DocExamples/index.tsx b/src/ui/components/DocExamples/index.tsx index decf9533..bde097b6 100644 --- a/src/ui/components/DocExamples/index.tsx +++ b/src/ui/components/DocExamples/index.tsx @@ -1,9 +1,9 @@ import { h, FunctionComponent } from 'preact' import { Code } from '~/ui/components/Code' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' -import { CodeContainer } from './style.css' import isArray from 'lodash/isArray' import { Markdown } from '~/ui/components/Markdown' +import * as styles from './styles.css' interface Props { examples: string[] | string @@ -17,13 +17,11 @@ export const DocExamples: FunctionComponent = ({ examples }) => ( {isArray(examples) ? ( - examples.map((example, index) => { - return ( - - - - ) - }) + examples.map((example, index) => ( +
    + +
    + )) ) : ( )} diff --git a/src/ui/components/DocExamples/style.css b/src/ui/components/DocExamples/style.css deleted file mode 100644 index 1b2aa4e1..00000000 --- a/src/ui/components/DocExamples/style.css +++ /dev/null @@ -1,3 +0,0 @@ -.CodeContainer { - margin-bottom: 10px; -} diff --git a/src/ui/components/DocExamples/style.css.d.ts b/src/ui/components/DocExamples/style.css.d.ts deleted file mode 100644 index cf2a028d..00000000 --- a/src/ui/components/DocExamples/style.css.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CSSComponent } from '~/types/decss' - -export const CodeContainer: CSSComponent diff --git a/src/ui/components/DocExamples/styles.css.ts b/src/ui/components/DocExamples/styles.css.ts new file mode 100644 index 00000000..17ff6572 --- /dev/null +++ b/src/ui/components/DocExamples/styles.css.ts @@ -0,0 +1,5 @@ +import { style } from '@vanilla-extract/css' + +export const codeContainer = style({ + marginBottom: '10px', +}) diff --git a/src/ui/components/DocHeader/index.tsx b/src/ui/components/DocHeader/index.tsx new file mode 100644 index 00000000..fe101da6 --- /dev/null +++ b/src/ui/components/DocHeader/index.tsx @@ -0,0 +1,10 @@ +import { ComponentChildren, FunctionComponent, h } from 'preact' +import * as styles from './styles.css' + +interface Props { + children: ComponentChildren +} + +export const DocHeader: FunctionComponent = ({ children }) => ( +

    {children}

    +) diff --git a/src/ui/components/DocHeader/styles.css.ts b/src/ui/components/DocHeader/styles.css.ts new file mode 100644 index 00000000..1a33ebe8 --- /dev/null +++ b/src/ui/components/DocHeader/styles.css.ts @@ -0,0 +1,5 @@ +import { style } from '@vanilla-extract/css' + +export const header = style({ + fontFamily: 'monospace', +}) diff --git a/src/ui/components/DocHeaderAnchor/index.tsx b/src/ui/components/DocHeaderAnchor/index.tsx index b71b8646..ec29d3ea 100644 --- a/src/ui/components/DocHeaderAnchor/index.tsx +++ b/src/ui/components/DocHeaderAnchor/index.tsx @@ -1,12 +1,12 @@ import { h, FunctionComponent } from 'preact' -import { DocHeaderLink } from './style.css' +import * as styles from './styles.css' interface Props { anchor: string } export const DocHeaderAnchor: FunctionComponent = ({ anchor }) => ( - + # - + ) diff --git a/src/ui/components/DocHeaderAnchor/style.css b/src/ui/components/DocHeaderAnchor/style.css deleted file mode 100644 index 442f26ad..00000000 --- a/src/ui/components/DocHeaderAnchor/style.css +++ /dev/null @@ -1,19 +0,0 @@ -.DocHeaderLink { - display: none; - margin-left: 7px; - text-decoration: none; - opacity: 0.3; -} - -.DocHeaderLink:hover { - opacity: 0.6; -} - -h1:hover .DocHeaderLink, -h2:hover .DocHeaderLink, -h3:hover .DocHeaderLink, -h4:hover .DocHeaderLink, -h5:hover .DocHeaderLink, -h6:hover .DocHeaderLink { - display: inline; -} diff --git a/src/ui/components/DocHeaderAnchor/style.css.d.ts b/src/ui/components/DocHeaderAnchor/style.css.d.ts deleted file mode 100644 index 110feb2f..00000000 --- a/src/ui/components/DocHeaderAnchor/style.css.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CSSComponent } from '~/types/decss' - -export const DocHeaderLink: CSSComponent diff --git a/src/ui/components/DocHeaderAnchor/styles.css.ts b/src/ui/components/DocHeaderAnchor/styles.css.ts new file mode 100644 index 00000000..ef161513 --- /dev/null +++ b/src/ui/components/DocHeaderAnchor/styles.css.ts @@ -0,0 +1,18 @@ +import { style } from '@vanilla-extract/css' + +export const docHeaderLink = style({ + display: 'none', + marginLeft: '7px', + textDecoration: 'none', + opacity: '0.3', + + ':hover': { + opacity: '0.6', + }, + + selectors: { + 'h1:hover &, h2:hover &, h3:hover &, h4:hover &, h5:hover &, h6:hover &': { + display: 'inline', + }, + }, +}) diff --git a/src/ui/components/DocParams/index.tsx b/src/ui/components/DocParams/index.tsx index 066ee369..a1149072 100644 --- a/src/ui/components/DocParams/index.tsx +++ b/src/ui/components/DocParams/index.tsx @@ -1,7 +1,7 @@ import { h, FunctionComponent, Fragment } from 'preact' import type { DateFnsDocs } from '@date-fns/docs' import { Markdown } from '~/ui/components/Markdown' -import { OptionalLabel, PropsLabel } from './style.css' +import * as styles from './styles.css' interface Props { params: DateFnsDocs.JSDocParam[] @@ -32,18 +32,18 @@ export const DocParams: FunctionComponent = ({ params }) => ( const ParamOptionalLabel: FunctionComponent<{ defaultValue?: string }> = ({ defaultValue }) => ( - +
    {defaultValue !== undefined ? `(optional, default=${defaultValue})` : '(optional)'} - +
    ) const ParamPropsTable: FunctionComponent<{ props: DateFnsDocs.JSDocParam[] }> = ({ props }) => (
    - Properties: +
    Properties:
    diff --git a/src/ui/components/DocParams/style.css b/src/ui/components/DocParams/style.css deleted file mode 100644 index 12f46e5c..00000000 --- a/src/ui/components/DocParams/style.css +++ /dev/null @@ -1,9 +0,0 @@ -.OptionalLabel { - font-style: italic; -} - -.PropsLabel { - font-weight: bold; - margin-top: 10px; - margin-bottom: 5px; -} diff --git a/src/ui/components/DocParams/style.css.d.ts b/src/ui/components/DocParams/style.css.d.ts deleted file mode 100644 index 4d5d839f..00000000 --- a/src/ui/components/DocParams/style.css.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CSSComponent, CSSPreactComponent } from '~/types/decss' - -export const OptionalLabel: CSSComponent -export const PropsLabel: CSSComponent diff --git a/src/ui/components/DocParams/styles.css.ts b/src/ui/components/DocParams/styles.css.ts new file mode 100644 index 00000000..0af0072d --- /dev/null +++ b/src/ui/components/DocParams/styles.css.ts @@ -0,0 +1,11 @@ +import { style } from '@vanilla-extract/css' + +export const optionalLabel = style({ + fontStyle: 'italic', +}) + +export const propsLabel = style({ + fontWeight: 'bold', + marginTop: '10px', + marginBottom: '5px', +}) diff --git a/src/ui/components/DocUsage/index.tsx b/src/ui/components/DocUsage/index.tsx index c6936f56..d3ad3d5b 100644 --- a/src/ui/components/DocUsage/index.tsx +++ b/src/ui/components/DocUsage/index.tsx @@ -1,9 +1,10 @@ import { h, FunctionComponent } from 'preact' import { useEffect, useState } from 'preact/hooks' import type { DateFnsDocs } from '@date-fns/docs/types' -import { Options, Option, OptionLink } from './style.css' import { Content } from './Content' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import * as styles from './styles.css' +import classNames from 'classnames' const LOCALSTORAGE_KEY = 'usageSource' const DEFAULT_SOURCE = 'commonjs' @@ -38,7 +39,7 @@ export const DocUsage: FunctionComponent = ({ usageTabs, usage }) => { - + diff --git a/src/ui/components/DocUsage/style.css b/src/ui/components/DocUsage/style.css deleted file mode 100644 index 88c72d1c..00000000 --- a/src/ui/components/DocUsage/style.css +++ /dev/null @@ -1,27 +0,0 @@ -.Options { - list-style: none; - display: flex; - justify-content: left; - margin: 0 !important; -} - -.Option { - list-style: none; - margin-right: 10px; -} - -.OptionLink { - color: #4a3142; - text-decoration: none; - font-size: 13px; - padding: 4px 8px; - display: block; - border-top-right-radius: 3px; - border-top-left-radius: 3px; - background-color: #faf6f0; -} - -.OptionLink-isCurrent { - color: #000; - background-color: #e8d6e3; -} diff --git a/src/ui/components/DocUsage/style.css.d.ts b/src/ui/components/DocUsage/style.css.d.ts deleted file mode 100644 index 47b2ec5c..00000000 --- a/src/ui/components/DocUsage/style.css.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { CSSComponent, CSSPreactComponent } from '~/types/decss' - -export const Options: CSSComponent -export const Option: CSSComponent -export const OptionLink: CSSComponent<{ isCurrent?: boolean }> diff --git a/src/ui/components/DocUsage/styles.css.ts b/src/ui/components/DocUsage/styles.css.ts new file mode 100644 index 00000000..e8702555 --- /dev/null +++ b/src/ui/components/DocUsage/styles.css.ts @@ -0,0 +1,29 @@ +import { style } from '@vanilla-extract/css' + +export const option = style({ + listStyle: 'none', + marginRight: '10px', +}) + +export const optionLink = style({ + color: '#4a3142', + textDecoration: 'none', + fontSize: '13px', + padding: '4px 8px', + display: 'block', + borderTopRightRadius: '3px', + borderTopLeftRadius: '3px', + backgroundColor: '#faf6f0', +}) + +export const optionLinkIsCurrent = style({ + color: '#000', + backgroundColor: '#e8d6e3', +}) + +export const options = style({ + listStyle: 'none', + display: 'flex', + justifyContent: 'left', + margin: '0 !important', +}) diff --git a/src/ui/components/HireWidget/index.tsx b/src/ui/components/HireWidget/index.tsx index 610a3f68..86788696 100644 --- a/src/ui/components/HireWidget/index.tsx +++ b/src/ui/components/HireWidget/index.tsx @@ -1,33 +1,27 @@ import { h } from 'preact' -import { - Container, - Header, - // Footer, - Block, -} from '~/ui/components/JobsWidget/style.css' -import { BlockContent, HireButton, Description } from './style.css' +import * as styles from './styles.css' export const HireWidget = () => ( - - - -
    Your company is hiring JS developers?
    +
    +
    +
    +
    Your company is hiring JS developers?
    - +
    Find a great teammate and support date-fns. Get in front of tens of thousands of JS devs. - +
    - Promote job here - - - + +
    +
    - {/*
    Subscribe to support date-fns development, it's free!
    */} - + {/*
    Subscribe to support date-fns development, it's free!
    */} +
    ) diff --git a/src/ui/components/HireWidget/style.css b/src/ui/components/HireWidget/style.css deleted file mode 100644 index 4399e89b..00000000 --- a/src/ui/components/HireWidget/style.css +++ /dev/null @@ -1,28 +0,0 @@ -.BlockContent { - padding: 1rem; -} - -.HireButton { - margin-top: 1rem; - flex: none; - height: 2rem; - font-size: 1rem; - display: block; - background: #129e4f; - color: white; - border: 0; - padding: 0 1rem; - cursor: pointer; - align-items: center; - text-decoration: none; - display: flex; - justify-content: center; -} - -.HireButton:hover { - background: #17cf67; -} - -.Description { - margin-top: 0.5rem; -} diff --git a/src/ui/components/HireWidget/style.css.d.ts b/src/ui/components/HireWidget/style.css.d.ts deleted file mode 100644 index ac9496b7..00000000 --- a/src/ui/components/HireWidget/style.css.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { CSSComponent } from '~/types/decss' - -export const BlockContent: CSSComponent -export const HireButton: CSSComponent -export const Description: CSSComponent diff --git a/src/ui/components/HireWidget/styles.css.ts b/src/ui/components/HireWidget/styles.css.ts new file mode 100644 index 00000000..674af0d5 --- /dev/null +++ b/src/ui/components/HireWidget/styles.css.ts @@ -0,0 +1,58 @@ +import { style } from '@vanilla-extract/css' + +export const container = style({ + background: '#f5d958', + padding: '0.25rem', +}) + +export const block = style({ + background: '#fcf4ca', + textDecoration: 'none', + display: 'flex', + flexDirection: 'column', + color: 'black', + transition: 'background 150ms ease-out', +}) + +export const blockContent = style({ + padding: '1rem', +}) + +export const description = style({ + marginTop: '0.5rem', +}) + +export const hireButton = style({ + marginTop: '1rem', + flex: 'none', + height: '2rem', + fontSize: '1rem', + background: '#129e4f', + color: 'white', + border: '0', + padding: '0 1rem', + cursor: 'pointer', + alignItems: 'center', + textDecoration: 'none', + display: 'flex', + justifyContent: 'center', + + ':hover': { + background: '#17cf67', + }, +}) + +export const header = style({ + fontSize: '1.05rem', + lineHeight: '1.4', + fontWeight: '600', +}) + +export const footer = style({ + color: '#837430', + fontWeight: '600', + textAlign: 'center', + display: 'block', + padding: '0.5rem 0', + fontSize: '0.8rem', +}) diff --git a/src/ui/components/JobsBanner/Icon.tsx b/src/ui/components/JobsBanner/Icon.tsx index 80f659a2..4f67ca5e 100644 --- a/src/ui/components/JobsBanner/Icon.tsx +++ b/src/ui/components/JobsBanner/Icon.tsx @@ -1,8 +1,8 @@ import { h } from 'preact' -import { Icon as StyledIcon } from './style.css' +import * as styles from './styles.css' export const Icon = () => ( - + - + ) diff --git a/src/ui/components/JobsBanner/index.tsx b/src/ui/components/JobsBanner/index.tsx index c2d33cc5..6a6cc97a 100644 --- a/src/ui/components/JobsBanner/index.tsx +++ b/src/ui/components/JobsBanner/index.tsx @@ -1,23 +1,17 @@ -import { h, FunctionComponent } from 'preact' -// import classnames from 'classnames' +import { h } from 'preact' // import { trackAction } from 'app/acts/tracking_acts' -import { Icon } from './Icon' -import { Emoji } from './Emoji' -import { Container, Inner, EmojiWrapper } from './style.css' import { useEffect, useState } from 'preact/hooks' +import { Emoji } from './Emoji' +import { Icon } from './Icon' +import * as styles from './styles.css' -interface Props { - size: 'small' | 'large' -} - -export const JobsBanner: FunctionComponent = ({ size }) => { +export const JobsBanner = () => { const [kind, setKind] = useState(null) useEffect(() => setKind(Math.random() > 0.5 ? 'subscribe' : 'recommend'), []) return ( - = ({ size }) => { () => console.log('FIXME') /*trackAction('Banner click', { kind }) */ } > - - +
    +
    - +
    +
    {kind === 'subscribe' && 'Get jobs worth sharing to your email! JavaScript jobs by date-fns'} @@ -40,7 +35,7 @@ export const JobsBanner: FunctionComponent = ({ size }) => { "Know someone who's looking for JavaScript devs? Recommend us a job!"}
    - - +
    + ) } diff --git a/src/ui/components/JobsBanner/style.css b/src/ui/components/JobsBanner/style.css deleted file mode 100644 index a688af9b..00000000 --- a/src/ui/components/JobsBanner/style.css +++ /dev/null @@ -1,43 +0,0 @@ -.Container { - display: block; - font-size: 1.2rem; - line-height: 1.3; - padding: 1rem; - background: #af045c; - color: #fff; - text-decoration: none; -} - -.Container-size-small { - font-size: 1rem; - padding: 1rem 0.5rem; -} - -.Container-size-small .Icon { - height: 1rem; - top: 3px; -} - -.Container:hover { - background: #8c1a54; -} - -.Inner { - display: flex; - align-items: center; - justify-content: center; -} - -.EmojiWrapper { - flex-basis: 2rem; - margin-right: 0.5rem; - flex-shrink: 0; -} - -.Icon { - display: inline-block; - fill: #fff; - position: relative; - height: 1.1rem; - top: 2px; -} diff --git a/src/ui/components/JobsBanner/style.css.d.ts b/src/ui/components/JobsBanner/style.css.d.ts deleted file mode 100644 index 1d0cd147..00000000 --- a/src/ui/components/JobsBanner/style.css.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CSSComponent } from '~/types/decss' - -export const Container: CSSComponent<{ - size: 'small' | 'large' -}> -export const Icon: CSSComponent -export const Inner: CSSComponent -export const EmojiWrapper: CSSComponent diff --git a/src/ui/components/JobsBanner/styles.css.ts b/src/ui/components/JobsBanner/styles.css.ts new file mode 100644 index 00000000..a5a631ce --- /dev/null +++ b/src/ui/components/JobsBanner/styles.css.ts @@ -0,0 +1,35 @@ +import { style } from '@vanilla-extract/css' + +export const container = style({ + display: 'block', + lineHeight: '1.3', + background: '#af045c', + color: '#fff', + textDecoration: 'none', + fontSize: '1rem', + padding: '1rem 0.5rem', + + ':hover': { + background: '#8c1a54', + }, +}) + +export const emojiWrapper = style({ + flexBasis: '2rem', + marginRight: '0.5rem', + flexShrink: '0', +}) + +export const inner = style({ + display: 'flex', + alignItems: 'center', + justifyContent: 'center', +}) + +export const icon = style({ + display: 'inline-block', + fill: '#fff', + position: 'relative', + height: '1rem', + top: '3px', +}) diff --git a/src/ui/components/JobsSubscribeWidget/index.tsx b/src/ui/components/JobsSubscribeWidget/index.tsx index 3bab32bb..ea47ef85 100644 --- a/src/ui/components/JobsSubscribeWidget/index.tsx +++ b/src/ui/components/JobsSubscribeWidget/index.tsx @@ -1,52 +1,48 @@ import { h } from 'preact' -import { - Container, - Header, - Footer, - Block, -} from '~/ui/components/JobsWidget/style.css' -import { - BlockContent, - Form, - Input, - SubscribeButton, - // TwitterLink, - // TwitterIcon, -} from './style.css' -// import twitterIcon from './img/twitterBlack.svg' +import * as styles from './styles.css' +// import twitterIconURL from './img/twitterBlack.svg' export const JobsSubscribeWidget = () => ( - - - -
    Get awesome JavaScript jobs in your email
    -
    +
    +
    +
    + Get awesome JavaScript jobs in your email +
    + + - - + + +
    +
    -
    Subscribe to support date-fns development, it's free!
    +
    + Subscribe to support date-fns development, it's free! +
    - {/* - + {/* + Twitter icon Follow on Twitter - */} -
    + */} + ) diff --git a/src/ui/components/JobsSubscribeWidget/style.css b/src/ui/components/JobsSubscribeWidget/style.css deleted file mode 100644 index 73cfb3cb..00000000 --- a/src/ui/components/JobsSubscribeWidget/style.css +++ /dev/null @@ -1,51 +0,0 @@ -.BlockContent { - padding: 1rem; -} - -.Form { - display: flex; - align-items: center; - margin: 0.5rem 0 0; -} - -.Input { - flex: auto; - height: 2rem; - background: #f9f6e3; - font-size: 1rem; - padding: 0 0.5rem; - border: 0; - border-radius: 0; - color: black; - margin-right: 0.5rem; - border: 1px solid black; -} - -.SubscribeButton { - flex: none; - height: 2rem; - font-size: 1rem; - display: block; - background: black; - color: white; - border: 0; - padding: 0 1rem; - cursor: pointer; - align-items: center; -} - -.SubscribeButton:hover { - color: red; -} - -.TwitterIcon { - width: 24px; - margin-right: 5px; - position: relative; - top: 6px; -} - -.TwitterLink { - color: black; - text-decoration: none; -} diff --git a/src/ui/components/JobsSubscribeWidget/style.css.d.ts b/src/ui/components/JobsSubscribeWidget/style.css.d.ts deleted file mode 100644 index 77a5a7b9..00000000 --- a/src/ui/components/JobsSubscribeWidget/style.css.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CSSComponent } from '~/types/decss' - -export const BlockContent: CSSComponent -export const Form: CSSComponent -export const Input: CSSComponent -export const SubscribeButton: CSSComponent -export const TwitterLink: CSSComponent -export const TwitterIcon: CSSComponent diff --git a/src/ui/components/JobsSubscribeWidget/styles.css.ts b/src/ui/components/JobsSubscribeWidget/styles.css.ts new file mode 100644 index 00000000..d29ffb94 --- /dev/null +++ b/src/ui/components/JobsSubscribeWidget/styles.css.ts @@ -0,0 +1,81 @@ +import { style } from '@vanilla-extract/css' + +export const container = style({ + background: '#f5d958', + padding: '0.25rem', +}) + +export const header = style({ + fontSize: '1.05rem', + lineHeight: '1.4', + fontWeight: '600', +}) + +export const block = style({ + background: '#fcf4ca', + textDecoration: 'none', + display: 'flex', + flexDirection: 'column', + color: 'black', + transition: 'background 150ms ease-out', +}) + +export const footer = style({ + color: '#837430', + fontWeight: '600', + textAlign: 'center', + display: 'block', + padding: '0.5rem 0', + fontSize: '0.8rem', +}) + +export const blockContent = style({ + padding: '1rem', +}) + +export const form = style({ + display: 'flex', + alignItems: 'center', + margin: '0.5rem 0 0', +}) + +export const input = style({ + flex: 'auto', + height: '2rem', + background: '#f9f6e3', + fontSize: '1rem', + padding: '0 0.5rem', + borderRadius: '0', + color: 'black', + marginRight: '0.5rem', + border: '1px solid black', +}) + +export const subscribeButton = style({ + flex: 'none', + height: '2rem', + fontSize: '1rem', + display: 'block', + background: 'black', + color: 'white', + border: '0', + padding: '0 1rem', + cursor: 'pointer', + alignItems: 'center', + + ':hover': { + color: 'red', + }, +}) + +export const twitterIcon = style({ + width: '24px', + marginRight: '5px', + position: 'relative', + top: '6px', +}) + +export const twitterLink = style({ + color: 'black', + textDecoration: 'none', +}) diff --git a/src/ui/components/JobsWidget/NextIcon.tsx b/src/ui/components/JobsWidget/NextIcon.tsx index 55058a88..c75391cf 100644 --- a/src/ui/components/JobsWidget/NextIcon.tsx +++ b/src/ui/components/JobsWidget/NextIcon.tsx @@ -1,10 +1,10 @@ import { FunctionComponent, h } from 'preact' -import { NextIcon as StyledNextIcon } from './style.css' +import * as styles from './styles.css' export const NextIcon: FunctionComponent = () => { return ( - @@ -12,6 +12,6 @@ export const NextIcon: FunctionComponent = () => { fill="currentColor" d="M244.5 230.9L52.5 71.4A32 32 0 000 96v320a32 32 0 0052.5 24.6l192-160.5a32.1 32.1 0 000-49.2zM224 255.4L32 416V96l192 159.4zm276.5-24.5l-192-159.4A32 32 0 00256 96v320a32 32 0 0052.5 24.6l192-160.5a32.1 32.1 0 000-49.2zM480 255.4L288 416V96l192 159.4z" /> - + ) } diff --git a/src/ui/components/JobsWidget/index.tsx b/src/ui/components/JobsWidget/index.tsx index d4591edb..1e5af410 100644 --- a/src/ui/components/JobsWidget/index.tsx +++ b/src/ui/components/JobsWidget/index.tsx @@ -2,26 +2,13 @@ import { h, FunctionComponent } from 'preact' import shuffle from 'lodash/shuffle' import { NextIcon } from './NextIcon' import { CONFIG } from '~/constants' -import { - Company, - Container, - CompanyName, - Block, - Logo, - Header, - Location, - Tag, - Tags, - Buttons, - Link, - NextButton, - Footer, -} from './style.css' import { useJobs } from '~/utils/useJobs' import { useEffect, useMemo, useState } from 'preact/hooks' import { JobsSubscribeWidget } from '~/ui/components/JobsSubscribeWidget' import { request } from '~/utils/request' import * as Sentry from '@sentry/browser' +import * as styles from './styles.css' +import classNames from 'classnames' export const JobsWidget: FunctionComponent = () => { const [result] = useJobs() @@ -57,9 +44,9 @@ export const JobsWidget: FunctionComponent = () => { } return ( - - + { } target="_blank" rel="noopener noreferrer" - clickable > - - +
    - {job.data.companyName} - {job.data.location} +
    {job.data.companyName}
    +
    {job.data.location}
    -
    {job.data.position}
    -
    +
    {job.data.position}
    + - - +
    +
    {job.data.tags.slice(0, 3).map((tag) => ( - {result.tags[tag]} +
    + {result.tags[tag]} +
    ))} - +
    {shuffledJobs.length > 1 && ( - { e.preventDefault() e.stopPropagation() @@ -106,21 +94,21 @@ export const JobsWidget: FunctionComponent = () => { > Next job - + )} - - +
    +
    - -
    + + + ) } diff --git a/src/ui/components/JobsWidget/style.css b/src/ui/components/JobsWidget/style.css deleted file mode 100644 index 302ee9ad..00000000 --- a/src/ui/components/JobsWidget/style.css +++ /dev/null @@ -1,111 +0,0 @@ -.Container { - background: #f5d958; - padding: 0.25rem; -} - -.Block { - background: #fcf4ca; - text-decoration: none; - display: flex; - flex-direction: column; - color: black; - transition: background 150ms ease-out; -} - -.Block-clickable:hover { - background: #ffefa5; -} - -.Company { - display: flex; - align-items: center; - padding: 1rem; -} - -.Company > *:not(:last-child) { - margin-right: 1rem; -} - -.Location { - color: #8f8a72; -} - -.CompanyName { - color: #2c5bf7; - font-weight: 600; -} - -.Logo { - width: 48px; - flex-shrink: 0; -} - -.Header { - font-size: 1.05rem; - line-height: 1.4; - font-weight: 600; -} - -.Buttons { - display: flex; - justify-content: space-between; - border-top: 1px solid #e3dbb6; - padding: 0.5rem 1rem; -} - -.Tags { - display: flex; -} - -.Tags > *:not(:last-child) { - margin-right: 0.5rem; -} - -.Tag { - background: #e3dbb6; - color: #444237; - padding: 0.25rem 0.4rem; - border-radius: 5px; - font-size: 0.8rem; -} - -.NextButton { - display: flex; - background: black; - color: white; - border: 0; - padding: 0.125rem 0.5rem; - cursor: pointer; - align-items: center; -} - -.NextButton:hover { - color: red; -} - -.NextButton > *:not(:last-child) { - margin-right: 0.25rem; -} - -.NextIcon { - width: 1rem; -} - -.Footer { - color: #837430; - font-weight: 600; - text-align: center; - display: block; - padding: 0.5rem 0; - font-size: 0.8rem; -} - -.Link { - color: #837430; - text-decoration: none; -} - -.Link:hover { - color: black; - transition: color 150ms ease-out; -} diff --git a/src/ui/components/JobsWidget/style.css.d.ts b/src/ui/components/JobsWidget/style.css.d.ts deleted file mode 100644 index c8ebc6ba..00000000 --- a/src/ui/components/JobsWidget/style.css.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { CSSComponent } from '~/types/decss' - -export const Container: CSSComponent -export const Block: CSSComponent<{ clickable?: boolean }> -export const Company: CSSComponent -export const Location: CSSComponent -export const CompanyName: CSSComponent -export const Logo: CSSComponent -export const Header: CSSComponent -export const Tags: CSSComponent -export const Tag: CSSComponent -export const Buttons: CSSComponent -export const NextButton: CSSComponent -export const Link: CSSComponent -export const NextIcon: CSSComponent -export const Footer: CSSComponent diff --git a/src/ui/components/JobsWidget/styles.css.ts b/src/ui/components/JobsWidget/styles.css.ts new file mode 100644 index 00000000..4c1b144c --- /dev/null +++ b/src/ui/components/JobsWidget/styles.css.ts @@ -0,0 +1,116 @@ +import { style, globalStyle } from '@vanilla-extract/css' + +export const block = style({ + background: '#fcf4ca', + textDecoration: 'none', + display: 'flex', + flexDirection: 'column', + color: 'black', + transition: 'background 150ms ease-out', +}) + +export const blockClickable = style({ + ':hover': { + background: '#ffefa5', + }, +}) + +export const buttons = style({ + display: 'flex', + justifyContent: 'space-between', + borderTop: '1px solid #e3dbb6', + padding: '0.5rem 1rem', +}) + +export const companyName = style({ + color: '#2c5bf7', + fontWeight: '600', +}) + +export const container = style({ + background: '#f5d958', + padding: '0.25rem', +}) + +export const footer = style({ + color: '#837430', + fontWeight: '600', + textAlign: 'center', + display: 'block', + padding: '0.5rem 0', + fontSize: '0.8rem', +}) + +export const header = style({ + fontSize: '1.05rem', + lineHeight: '1.4', + fontWeight: '600', +}) + +export const link = style({ + color: '#837430', + textDecoration: 'none', + + ':hover': { + color: 'black', + transition: 'color 150ms ease-out', + }, +}) + +export const location = style({ + color: '#8f8a72', +}) + +export const logo = style({ + width: '48px', + flexShrink: '0', +}) + +export const nextIcon = style({ + width: '1rem', +}) + +export const tag = style({ + background: '#e3dbb6', + color: '#444237', + padding: '0.25rem 0.4rem', + borderRadius: '5px', + fontSize: '0.8rem', +}) + +export const company = style({ + display: 'flex', + alignItems: 'center', + padding: '1rem', + selectors: {}, +}) + +globalStyle(`${company} > *:not(:last-child)`, { + marginRight: '1rem', +}) + +export const nextButton = style({ + display: 'flex', + background: 'black', + color: 'white', + border: '0', + padding: '0.125rem 0.5rem', + cursor: 'pointer', + alignItems: 'center', + + ':hover': { + color: 'red', + }, +}) + +globalStyle(`${nextButton} > *:not(:last-child)`, { + marginRight: '0.25rem', +}) + +export const tags = style({ + display: 'flex', +}) + +globalStyle(`${tags} > *:not(:last-child)`, { + marginRight: '0.5rem', +}) diff --git a/src/ui/screens/Docs/Doc/JSDoc/index.tsx b/src/ui/screens/Docs/Doc/JSDoc/index.tsx index 61837c14..e390813d 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/index.tsx +++ b/src/ui/screens/Docs/Doc/JSDoc/index.tsx @@ -8,9 +8,9 @@ import { Exceptions } from './Exceptions' import { DocLinks } from '~/ui/components/DocLinks' import { Properties } from './Properties' import { Returns } from './Returns' -import { Header } from './style.css' import { Syntax } from './Syntax' import { DocUsage } from '~/ui/components/DocUsage' +import { DocHeader } from '~/ui/components/DocHeader' interface Props { doc: DateFnsDocs.JSDocFunction @@ -18,9 +18,7 @@ interface Props { export const JSDoc: FunctionComponent = ({ doc }) => (
    -

    -
    {doc.title}
    -

    + {doc.title}

    diff --git a/src/ui/screens/Docs/Doc/JSDoc/style.css b/src/ui/screens/Docs/Doc/JSDoc/style.css deleted file mode 100644 index 0b985482..00000000 --- a/src/ui/screens/Docs/Doc/JSDoc/style.css +++ /dev/null @@ -1,3 +0,0 @@ -.Header { - font-family: monospace; -} diff --git a/src/ui/screens/Docs/Doc/JSDoc/style.css.d.ts b/src/ui/screens/Docs/Doc/JSDoc/style.css.d.ts deleted file mode 100644 index 2f3eb96a..00000000 --- a/src/ui/screens/Docs/Doc/JSDoc/style.css.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CSSComponent, CSSPreactComponent } from '~/types/decss' - -export const Header: CSSComponent diff --git a/src/ui/screens/Docs/Doc/TSDoc/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/index.tsx index 3616ff6c..c62a2cca 100644 --- a/src/ui/screens/Docs/Doc/TSDoc/index.tsx +++ b/src/ui/screens/Docs/Doc/TSDoc/index.tsx @@ -4,12 +4,12 @@ import { FunctionComponent, h } from 'preact' import { useMemo } from 'preact/hooks' import { parse } from 'typeroo' import { DocExamples } from '~/ui/components/DocExamples' +import { DocHeader } from '~/ui/components/DocHeader' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' import { DocLinks } from '~/ui/components/DocLinks' import { DocUsage } from '~/ui/components/DocUsage' import { Markdown } from '~/ui/components/Markdown' import { Returns } from './Returns' -import { Header } from './style.css' interface Props { page: DateFnsDocs.TSDocPage @@ -26,9 +26,7 @@ export const TSDoc: FunctionComponent = ({ page }) => { return (
    -

    -
    {page.title}
    -

    + {page.title} {description && (
    diff --git a/src/ui/screens/Docs/Doc/TSDoc/style.css b/src/ui/screens/Docs/Doc/TSDoc/style.css deleted file mode 100644 index 0b985482..00000000 --- a/src/ui/screens/Docs/Doc/TSDoc/style.css +++ /dev/null @@ -1,3 +0,0 @@ -.Header { - font-family: monospace; -} diff --git a/src/ui/screens/Docs/Doc/TSDoc/style.css.d.ts b/src/ui/screens/Docs/Doc/TSDoc/style.css.d.ts deleted file mode 100644 index 2f3eb96a..00000000 --- a/src/ui/screens/Docs/Doc/TSDoc/style.css.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CSSComponent, CSSPreactComponent } from '~/types/decss' - -export const Header: CSSComponent diff --git a/src/ui/screens/Docs/Doc/index.tsx b/src/ui/screens/Docs/Doc/index.tsx index f59e5092..fd0edead 100644 --- a/src/ui/screens/Docs/Doc/index.tsx +++ b/src/ui/screens/Docs/Doc/index.tsx @@ -1,12 +1,12 @@ -import { h, FunctionComponent } from 'preact' -import { Container } from './style.css' -import { Content } from './Content' -import { DocLinkContext } from '~/ui/router/DocLinkContext' -import { useEffect } from 'preact/hooks' -import { useRead } from '@typesaurus/preact' +import { packageName } from '@date-fns/docs/consts' import { db } from '@date-fns/docs/db' import type { DateFnsDocs } from '@date-fns/docs/types' -import { packageName } from '@date-fns/docs/consts' +import { useRead } from '@typesaurus/preact' +import { FunctionComponent, h } from 'preact' +import { useEffect } from 'preact/hooks' +import { DocLinkContext } from '~/ui/router/DocLinkContext' +import { Content } from './Content' +import * as styles from './styles.css' const SCROLL_OFFSET = 35 @@ -51,21 +51,21 @@ export const Doc: FunctionComponent = ({ - +
    - +
    ) } else if (pages && pages.length === 0) { return ( - +
    This page is not available for this version or this submodule - +
    ) } else if (loading) { - return Loading... + return
    Loading...
    } else { // FIXME: - return Error! + return
    Error!
    } } diff --git a/src/ui/screens/Docs/Doc/style.css b/src/ui/screens/Docs/Doc/style.css deleted file mode 100644 index 142557d0..00000000 --- a/src/ui/screens/Docs/Doc/style.css +++ /dev/null @@ -1,132 +0,0 @@ -.Container { - padding: 30px; - color: #4a3142; - background-color: #fffdf9; - font-size: 16px; - line-height: 1.6em; - width: 100%; - min-height: 100%; -} - -.Container h1 { - color: #770c56; - font-size: 2.3rem; - margin-bottom: 30px; - padding-bottom: 23px; - border-bottom: 1px solid rgba(88, 68, 82, 0.1); -} - -.Container h2 { - color: #4a3142; - font-size: 1.3rem; - margin-bottom: 15px; - padding-bottom: 10px; - margin-top: 30px; - border-bottom: 1px solid rgba(88, 68, 82, 0.1); -} - -.Container h3 { - color: #4a3142; - font-weight: 500; - font-size: 1.2rem; - margin-bottom: 20px; - margin-top: 20px; -} - -.Container a { - color: #5d3861; -} - -.Container p { - margin-bottom: 10px; - max-width: 700px; -} - -.Container p:last-child { - margin-bottom: 0; -} - -.Container p:empty { - display: none; -} - -.Container ul { - list-style: disc; -} - -.Container ol { - list-style: decimal; -} - -.Container ul, -.Container ol { - max-width: 700px; - margin-left: 25px; - margin-bottom: 10px; -} - -.Container ul p + ul, -.Container ol p + ul { - margin-top: -10px; -} - -.Container ul:last-child, -.Container ol:last-child { - margin-bottom: 0; -} - -.Container pre { - margin-bottom: 10px; -} - -.Container pre:last-child { - margin-bottom: 0; -} - -.Container ul pre:last-child, -.Container ol pre:last-child { - margin-bottom: 10px; -} - -.Container ul ul, -.Container ul ol, -.Container ol ol, -.Container ol ul { - margin-bottom: 0; -} - -.Container table { - background-color: #fffffe; - border-radius: 2px; - margin-bottom: 10px; -} - -.Container table:last-child { - margin-bottom: 0; -} - -.Container table th, -.Container table td { - border: 1px solid #b9a2b2; - padding: 5px 10px; -} - -.Container table th { - font-weight: 600; - text-align: left; - background-color: #faf6f0; -} - -.Container table table { - font-size: 14px; -} - -.Container table table th { - background-color: #fdfdfd; -} - -.Container table table th, -.Container table table td { - border: 1px solid #d6cdd3; - padding: 3px 6px; -} diff --git a/src/ui/screens/Docs/Doc/style.css.d.ts b/src/ui/screens/Docs/Doc/style.css.d.ts deleted file mode 100644 index 21b141ba..00000000 --- a/src/ui/screens/Docs/Doc/style.css.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CSSComponent, CSSPreactComponent } from '~/types/decss' - -export const Container: CSSComponent -export const HeaderLink: CSSComponent diff --git a/src/ui/screens/Docs/Doc/styles.css.ts b/src/ui/screens/Docs/Doc/styles.css.ts new file mode 100644 index 00000000..8e48d367 --- /dev/null +++ b/src/ui/screens/Docs/Doc/styles.css.ts @@ -0,0 +1,153 @@ +import { style, globalStyle } from '@vanilla-extract/css' + +export const container = style({ + padding: '30px', + color: '#4a3142', + backgroundColor: '#fffdf9', + fontSize: '16px', + lineHeight: '1.6em', + width: '100%', + minHeight: '100%', +}) + +globalStyle(`${container} a`, { + color: '#5d3861', +}) + +globalStyle(`${container} h1`, { + color: '#770c56', + fontSize: '2.3rem', + marginBottom: '30px', + paddingBottom: '23px', + borderBottom: '1px solid rgba(88,68,82,0.1)', +}) + +globalStyle(`${container} h2`, { + color: '#4a3142', + fontSize: '1.3rem', + marginBottom: '15px', + paddingBottom: '10px', + marginTop: '30px', + borderBottom: '1px solid rgba(88,68,82,0.1)', +}) + +globalStyle(`${container} h3`, { + color: '#4a3142', + fontWeight: '500', + fontSize: '1.2rem', + marginBottom: '20px', + marginTop: '20px', +}) + +globalStyle(`${container} ol`, { + listStyle: 'decimal', + maxWidth: '700px', + marginLeft: '25px', + marginBottom: '10px', +}) + +globalStyle(`${container} ol ol`, { + marginBottom: '0', +}) + +globalStyle(`${container} ol p + ul`, { + marginTop: '-10px', +}) + +globalStyle(`${container} ol pre:last-child`, { + marginBottom: '10px', +}) + +globalStyle(`${container} ol ul`, { + marginBottom: '0', +}) + +globalStyle(`${container} ol:last-child`, { + marginBottom: '0', +}) + +globalStyle(`${container} p`, { + marginBottom: '10px', + maxWidth: '700px', +}) + +globalStyle(`${container} p:empty`, { + display: 'none', +}) + +globalStyle(`${container} p:last-child`, { + marginBottom: '0', +}) + +globalStyle(`${container} pre`, { + marginBottom: '10px', +}) + +globalStyle(`${container} pre:last-child`, { + marginBottom: '0', +}) + +globalStyle(`${container} table`, { + backgroundColor: '#fffffe', + borderRadius: '2px', + marginBottom: '10px', +}) + +globalStyle(`${container} table table`, { + fontSize: '14px', +}) + +globalStyle(`${container} table table td`, { + border: '1px solid #d6cdd3', + padding: '3px 6px', +}) + +globalStyle(`${container} table table th`, { + backgroundColor: '#fdfdfd', + border: '1px solid #d6cdd3', + padding: '3px 6px', +}) + +globalStyle(`${container} table td`, { + border: '1px solid #b9a2b2', + padding: '5px 10px', +}) + +globalStyle(`${container} table th`, { + border: '1px solid #b9a2b2', + padding: '5px 10px', + fontWeight: '600', + textAlign: 'left', + backgroundColor: '#faf6f0', +}) + +globalStyle(`${container} table:last-child`, { + marginBottom: '0', +}) + +globalStyle(`${container} ul`, { + listStyle: 'disc', + maxWidth: '700px', + marginLeft: '25px', + marginBottom: '10px', +}) + +globalStyle(`${container} ul ol`, { + marginBottom: '0', +}) + +globalStyle(`${container} ul p + ul`, { + marginTop: '-10px', +}) + +globalStyle(`${container} ul pre:last-child`, { + marginBottom: '10px', +}) + +globalStyle(`${container} ul ul`, { + marginBottom: '0', +}) + +globalStyle(`${container} ul:last-child`, { + marginBottom: '0', +}) diff --git a/src/ui/screens/Docs/Finder/CancelButton.tsx b/src/ui/screens/Docs/Finder/CancelButton.tsx index 5bd8af53..e4921a93 100644 --- a/src/ui/screens/Docs/Finder/CancelButton.tsx +++ b/src/ui/screens/Docs/Finder/CancelButton.tsx @@ -1,12 +1,13 @@ import { FunctionComponent, h } from 'preact' -import { SearchCancel } from './style.css' +import * as styles from './styles.css' interface Props { setQuery(query: string): void } export const CancelButton: FunctionComponent = ({ setQuery }) => ( - { // FIXME: // trackAction('Search Cleared') diff --git a/src/ui/screens/Docs/Finder/Categories.tsx b/src/ui/screens/Docs/Finder/Categories.tsx index 0cf06563..04fb7efa 100644 --- a/src/ui/screens/Docs/Finder/Categories.tsx +++ b/src/ui/screens/Docs/Finder/Categories.tsx @@ -1,7 +1,7 @@ import { h, FunctionComponent } from 'preact' import type { DateFnsDocs } from '@date-fns/docs/types' import { Items } from './Items' -import { CategoriesList, Category, CategoryHeader } from './style.css' +import * as styles from './styles.css' interface Props { categories: string[] @@ -20,7 +20,7 @@ export const Categories: FunctionComponent = ({ selectedPage, onNavigate, }) => ( - +
      {categories.map((category) => { const categoryPages = pages.filter((page) => page.category === category) @@ -29,8 +29,8 @@ export const Categories: FunctionComponent = ({ } return ( - - {category} +
    • +

      {category}

      = ({ onNavigate={onNavigate} />
      - +
    • ) })} - +
    ) diff --git a/src/ui/screens/Docs/Finder/Items.tsx b/src/ui/screens/Docs/Finder/Items.tsx index 468b0ba8..0a271704 100644 --- a/src/ui/screens/Docs/Finder/Items.tsx +++ b/src/ui/screens/Docs/Finder/Items.tsx @@ -1,8 +1,8 @@ import { h, FunctionComponent, Fragment } from 'preact' import type { DateFnsDocs } from '@date-fns/docs/types' import { RouterLink } from '~/ui/router' -import { Item, ItemHeader, ItemText, ItemIcon } from './style.css' import { docLink } from '~/ui/router/docLink' +import * as styles from './styles.css' interface Props { pages: DateFnsDocs.PagePreview[] @@ -21,9 +21,9 @@ export const Items: FunctionComponent = ({ }) => ( <> {pages.map((page) => ( - = ({ onClick={onNavigate} >
    - {page.title} - {page.summary} +

    {page.title}

    +

    {page.summary}

    - -
    +
    + ))} ) diff --git a/src/ui/screens/Docs/Finder/NoResults.tsx b/src/ui/screens/Docs/Finder/NoResults.tsx index 530aaacf..cc531e8a 100644 --- a/src/ui/screens/Docs/Finder/NoResults.tsx +++ b/src/ui/screens/Docs/Finder/NoResults.tsx @@ -1,8 +1,8 @@ import { h } from 'preact' -import { NoResultsContainer, NoResultsText } from './style.css' +import * as styles from './styles.css' export const NoResults = () => ( - - Your search didn't match any results. - +
    +

    Your search didn't match any results.

    +
    ) diff --git a/src/ui/screens/Docs/Finder/index.tsx b/src/ui/screens/Docs/Finder/index.tsx index f5bb1393..1749cb9d 100644 --- a/src/ui/screens/Docs/Finder/index.tsx +++ b/src/ui/screens/Docs/Finder/index.tsx @@ -2,7 +2,6 @@ import { h, FunctionComponent } from 'preact' // import { trackAction } from 'app/acts/tracking_acts' import debounce from 'lodash/debounce' import { useCallback, useState } from 'preact/hooks' -import { Container, Content, Loading, Search, SearchField } from './style.css' import { CancelButton } from './CancelButton' import { NoResults } from './NoResults' import { Categories } from './Categories' @@ -12,6 +11,7 @@ import { db } from '@date-fns/docs/db' import { packageName } from '@date-fns/docs/consts' import type { DateFnsDocs } from '@date-fns/docs/types' import { useRead } from '@typesaurus/preact' +import * as styles from './styles.css' type FIXME = any @@ -50,10 +50,10 @@ export const Finder: FunctionComponent = ({ const filteredPages = filterPages(pages, query, selectedSubmodule) return ( - - - +
    + = ({ /> {query.length >= 0 && } - +
    - +
    {filteredPages.length === 0 ? ( ) : ( @@ -82,23 +82,23 @@ export const Finder: FunctionComponent = ({ onNavigate={onNavigate} /> )} - +
    -
    +
    ) } else if (loading) { return ( - - Loading... - +
    +
    Loading...
    +
    ) } else { // FIXME: return ( - - Error! - +
    +
    Error!
    +
    ) } } diff --git a/src/ui/screens/Docs/Finder/style.css b/src/ui/screens/Docs/Finder/style.css deleted file mode 100644 index 5d6c8f5e..00000000 --- a/src/ui/screens/Docs/Finder/style.css +++ /dev/null @@ -1,142 +0,0 @@ -.Container { - height: 100%; - width: 100%; - background: #fffbf5; - display: flex; - flex-direction: column; - align-items: stretch; - border-right: 1px solid #e6e0e6; -} - -.Content { - flex: auto; - overflow-y: auto; - overflow-x: hidden; -} - -.WidgetContainer { - flex: none; -} - -.CategoriesList { - flex-grow: 1; -} - -.Loading { - padding: 30px; -} - -.LogoImage { - cursor: pointer; - height: 30px; - margin-right: 10px; -} - -.Search { - position: relative; - flex: none; - color: #770c56; - font-weight: 600; - font-size: 20px; - display: flex; - justify-content: space-between; - align-items: center; - background-color: #faf6f0; - border-bottom: 1px solid #e6e0e6; - word-break: break-all; -} - -.SearchField { - padding: 0.75rem 1rem; - border: 0; - width: 100%; - font-size: 1rem; -} - -.SearchCancel { - height: 16px; - width: 16px; - top: 50%; - right: 9px; - margin-top: -9px; - cursor: pointer; - background-image: url('./img/cancel.svg'); - background-size: 16px; - position: absolute; - right: 1.5rem; -} - -.Category:first-child { - margin-top: 0; -} - -.CategoryHeader { - font-weight: 600; - font-size: 1rem; - line-height: 1; - color: #4a3142; - padding: 0.5rem 1rem; - border-bottom: 1px solid #e6e0e6; - position: sticky; - top: 0; - background-color: #fffbf5; -} - -.Item { - display: flex; - justify-content: space-between; - align-items: center; - background-color: rgba(255, 255, 255, 0.65); - padding: 0.5rem 1rem; - border-bottom: 1px solid #e6e0e6; - text-decoration: none; -} - -.Item-isSelected, -.Item-isSelected:hover { - background-color: #fff0f3; -} - -.Item:hover { - background: #fdf6f9; -} - -.Item-type-jsdoc .ItemHeader { - font-family: monospace; -} - -.ItemHeader { - font-size: 1rem; - margin-bottom: 0.4px; - word-break: break-all; - color: #4c193c; -} - -.ItemText { - font-weight: 400; - font-size: 0.9rem; - color: #7b6d77; -} - -.ItemIcon { - background-image: url('./img/icon.svg'); - background-size: 16px; - width: 16px; - height: 16px; - flex-shrink: 0; - margin-left: 10px; -} - -.NoResultsContainer { - display: flex; - flex-grow: 1; - align-items: center; - justify-content: center; -} - -.NoResultsText { - font-weight: 400; - font-size: 15px; - line-height: 18px; - color: #7b6d77; -} diff --git a/src/ui/screens/Docs/Finder/style.css.d.ts b/src/ui/screens/Docs/Finder/style.css.d.ts deleted file mode 100644 index b5a92e25..00000000 --- a/src/ui/screens/Docs/Finder/style.css.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { CSSComponent, CSSPreactComponent } from '~/types/decss' -import { RouterLink } from '~/ui/router' - -export const Container: CSSComponent -export const Content: CSSComponent -export const WidgetContainer: CSSComponent -export const Loading: CSSComponent -export const LogoImage: CSSComponent -export const Search: CSSComponent -export const SearchField: CSSComponent -export const SearchCancel: CSSComponent -export const CategoriesList: CSSComponent -export const Category: CSSComponent -export const CategoryHeader: CSSComponent -export const Item: CSSPreactComponent< - typeof RouterLink, - { isCurrent?: boolean } -> -export const ItemHeader: CSSComponent -export const ItemText: CSSComponent -export const ItemIcon: CSSComponent -export const NoResultsContainer: CSSComponent -export const NoResultsText: CSSComponent diff --git a/src/ui/screens/Docs/Finder/styles.css.ts b/src/ui/screens/Docs/Finder/styles.css.ts new file mode 100644 index 00000000..2021a16e --- /dev/null +++ b/src/ui/screens/Docs/Finder/styles.css.ts @@ -0,0 +1,153 @@ +import { style } from '@vanilla-extract/css' +import iconURL from './img/icon.svg' +import cancelURL from './img/cancel.svg' + +export const categoriesList = style({ + flexGrow: '1', +}) + +export const category = style({ + ':first-child': { + marginTop: '0', + }, +}) + +export const categoryHeader = style({ + fontWeight: '600', + fontSize: '1rem', + lineHeight: '1', + color: '#4a3142', + padding: '0.5rem 1rem', + borderBottom: '1px solid #e6e0e6', + position: 'sticky', + top: '0', + backgroundColor: '#fffbf5', +}) + +export const container = style({ + height: '100%', + width: '100%', + background: '#fffbf5', + display: 'flex', + flexDirection: 'column', + alignItems: 'stretch', + borderRight: '1px solid #e6e0e6', +}) + +export const content = style({ + flex: 'auto', + overflowY: 'auto', + overflowX: 'hidden', +}) + +export const item = style({ + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + backgroundColor: 'rgba(255,255,255,0.65)', + padding: '0.5rem 1rem', + borderBottom: '1px solid #e6e0e6', + textDecoration: 'none', + ':hover': { + background: '#fdf6f9', + }, +}) + +export const itemIcon = style({ + backgroundImage: `url('${iconURL}')`, + backgroundSize: '16px', + width: '16px', + height: '16px', + flexShrink: '0', + marginLeft: '10px', +}) + +export const itemIsSelected = style({ + backgroundColor: '#fff0f3', + + ':hover': { + backgroundColor: '#fff0f3', + }, +}) + +export const itemText = style({ + fontWeight: '400', + fontSize: '0.9rem', + color: '#7b6d77', +}) + +export const itemTypeJsdoc = style({}) + +export const loading = style({ + padding: '30px', +}) + +export const logoImage = style({ + cursor: 'pointer', + height: '30px', + marginRight: '10px', +}) + +export const noResultsContainer = style({ + display: 'flex', + flexGrow: '1', + alignItems: 'center', + justifyContent: 'center', +}) + +export const noResultsText = style({ + fontWeight: '400', + fontSize: '15px', + lineHeight: '18px', + color: '#7b6d77', +}) + +export const search = style({ + position: 'relative', + flex: 'none', + color: '#770c56', + fontWeight: '600', + fontSize: '20px', + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + backgroundColor: '#faf6f0', + borderBottom: '1px solid #e6e0e6', + wordBreak: 'break-all', +}) + +export const searchCancel = style({ + height: '16px', + width: '16px', + top: '50%', + marginTop: '-9px', + cursor: 'pointer', + backgroundImage: `url('${cancelURL}')`, + backgroundSize: '16px', + position: 'absolute', + right: '1.5rem', +}) + +export const searchField = style({ + padding: '0.75rem 1rem', + border: '0', + width: '100%', + fontSize: '1rem', +}) + +export const widgetContainer = style({ + flex: 'none', +}) + +export const itemHeader = style({ + fontSize: '1rem', + marginBottom: '0.4px', + wordBreak: 'break-all', + color: '#4c193c', + + selectors: { + [`${itemTypeJsdoc} &`]: { + fontFamily: 'monospace', + }, + }, +}) diff --git a/src/ui/screens/Docs/NavBar/LatestVersionLink.tsx b/src/ui/screens/Docs/NavBar/LatestVersionLink.tsx index 403db15b..2e057ed2 100644 --- a/src/ui/screens/Docs/NavBar/LatestVersionLink.tsx +++ b/src/ui/screens/Docs/NavBar/LatestVersionLink.tsx @@ -2,7 +2,7 @@ import type { DateFnsDocs } from '@date-fns/docs/types' import { h, FunctionComponent } from 'preact' import { RouterLink } from '~/ui/router' import { docLink } from '~/ui/router/docLink' -import { LatestLink } from './style.css' +import * as styles from './styles.css' interface Props { latestVersion: string @@ -15,8 +15,8 @@ export const LatestVersionLink: FunctionComponent = ({ selectedSubmodule, selectedPage, }) => ( - = ({ })} > Switch to latest - + ) diff --git a/src/ui/screens/Docs/NavBar/SubmoduleSelector.tsx b/src/ui/screens/Docs/NavBar/SubmoduleSelector.tsx index d3bf8ea6..913620ba 100644 --- a/src/ui/screens/Docs/NavBar/SubmoduleSelector.tsx +++ b/src/ui/screens/Docs/NavBar/SubmoduleSelector.tsx @@ -1,9 +1,9 @@ import { h, FunctionComponent } from 'preact' -import { Label, Select, Selector } from './style.css' import type { DateFnsDocs } from '@date-fns/docs/types' import { docLink } from '~/ui/router/docLink' import { useContext } from 'preact/hooks' import { RouterContext } from '~/ui/router' +import * as styles from './styles.css' const SUBMODULE_LABELS: Record = { default: 'Default', @@ -32,11 +32,11 @@ export const SubmoduleSelector: FunctionComponent = ({ } return ( - - + + + ) } diff --git a/src/ui/screens/Docs/NavBar/VersionSelector.tsx b/src/ui/screens/Docs/NavBar/VersionSelector.tsx index 145d305f..0c8c4423 100644 --- a/src/ui/screens/Docs/NavBar/VersionSelector.tsx +++ b/src/ui/screens/Docs/NavBar/VersionSelector.tsx @@ -1,10 +1,10 @@ import { h, FunctionComponent } from 'preact' import type { DateFnsDocs } from '@date-fns/docs/types' -import { Selector, Label, Select } from './style.css' import { useContext } from 'preact/hooks' import { RouterContext } from '~/ui/router' import { LatestVersionLink } from './LatestVersionLink' import { docLink } from '~/ui/router/docLink' +import * as styles from './styles.css' interface Props { selectedVersion: string @@ -26,11 +26,11 @@ export const VersionSelector: FunctionComponent = ({ const { navigate } = useContext(RouterContext) return ( - - + + ) } diff --git a/src/ui/screens/Docs/NavBar/index.tsx b/src/ui/screens/Docs/NavBar/index.tsx index 54353250..0165b1dc 100644 --- a/src/ui/screens/Docs/NavBar/index.tsx +++ b/src/ui/screens/Docs/NavBar/index.tsx @@ -1,19 +1,11 @@ import { h, FunctionComponent } from 'preact' import { RouterLink } from '~/ui/router' -import { - Container, - Inner, - Logo, - LogoImage, - Links, - Link, - MenuIcon, -} from './style.css' import logoPath from './img/logo.svg' import { defaultSubmodule } from '@date-fns/docs/consts' import type { DateFnsDocs } from '@date-fns/docs/types' import { VersionSelector } from './VersionSelector' import { SubmoduleSelector } from './SubmoduleSelector' +import * as styles from './styles.css' interface Props { selectedVersion: string @@ -38,32 +30,35 @@ export const NavBar: FunctionComponent = ({ const submodules = versionPreview?.submodules ?? [defaultSubmodule] return ( - - - - {menuIcon} +
    +
    +
    +
    {menuIcon}
    - - + + date-fns - + - + GitHub - + - + Community - + - + Twitter - + - + JS Jobs - - + +
    = ({ submodules={submodules} />
    - - +
    +
    ) } diff --git a/src/ui/screens/Docs/NavBar/style.css b/src/ui/screens/Docs/NavBar/style.css deleted file mode 100644 index 9860f8a0..00000000 --- a/src/ui/screens/Docs/NavBar/style.css +++ /dev/null @@ -1,122 +0,0 @@ -.Container { - color: #ffe9c9; - background: #5a0530; - background-image: url('./img/navBarBackground.png'); - background-size: cover; - background-position: top center; - height: 100%; - width: 100%; -} - -.Inner { - background: rgba(118, 10, 61, 0.7); - display: flex; - justify-content: space-between; - align-items: center; - width: 100%; - height: 2rem; - padding: 0 1rem; -} - -.Links { - display: flex; -} - -.Link { - color: #ffe9c9; - text-decoration: none; - margin-right: 1rem; - font-size: 0.9rem; - position: relative; - top: 1px; -} - -@media screen and (max-width: 800px) { - .Link { - display: none; - } -} - -.MenuIcon { - display: none; - align-items: center; - font-size: 1.2rem; - line-height: 1.2rem; - font-weight: 400; - color: white; - text-decoration: none; - margin-right: 1rem; - cursor: pointer; -} - -.MenuIcon img { - width: 18px; -} - -@media screen and (max-width: 767px) { - .MenuIcon { - display: flex; - } -} - -.Logo { - display: flex; - align-items: center; - font-size: 1.2rem; - line-height: 1.2rem; - font-weight: 400; - color: white; - text-decoration: none; - margin-right: 2rem; -} - -@media screen and (max-width: 360px) { - .Logo { - font-size: 1rem; - line-height: 1rem; - margin-right: 1rem; - } -} - -.LogoImage { - height: 1.3rem; - margin-right: 0.5rem; -} - -@media screen and (max-width: 400px) { - .LogoImage { - display: none; - } -} - -.Selector { - margin-right: 1rem; -} - -.Selector:last-child { - margin-right: 0; -} - -.LatestLink { - color: #fbd7a1; - margin-left: 0.5rem; -} - -.Label { - margin-right: 0.5rem; -} - -@media screen and (max-width: 550px) { - .Label { - display: none; - } -} - -.Select { - min-width: 5rem; - opacity: 0.85; -} - -.Select:disabled { - opacity: 0.4; -} diff --git a/src/ui/screens/Docs/NavBar/style.css.d.ts b/src/ui/screens/Docs/NavBar/style.css.d.ts deleted file mode 100644 index 1f65872e..00000000 --- a/src/ui/screens/Docs/NavBar/style.css.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { CSSComponent, CSSPreactComponent } from '~/types/decss' -import { RouterLink } from '~/ui/router' - -export const Container: CSSComponent -export const Inner: CSSComponent -export const Links: CSSComponent -export const Link: CSSComponent -export const MenuIcon: CSSComponent -export const Logo: CSSPreactComponent -export const LogoImage: CSSComponent -export const Selector: CSSComponent -export const LatestLink: CSSPreactComponent -export const Label: CSSComponent -export const Select: CSSComponent diff --git a/src/ui/screens/Docs/NavBar/styles.css.ts b/src/ui/screens/Docs/NavBar/styles.css.ts new file mode 100644 index 00000000..03216364 --- /dev/null +++ b/src/ui/screens/Docs/NavBar/styles.css.ts @@ -0,0 +1,124 @@ +import { globalStyle, style } from '@vanilla-extract/css' +import backgroundURL from './img/navBarBackground.png' + +export const container = style({ + color: '#ffe9c9', + background: '#5a0530', + backgroundImage: `url('${backgroundURL}'})`, + backgroundSize: 'cover', + backgroundPosition: 'top center', + height: '100%', + width: '100%', +}) + +export const inner = style({ + background: 'rgba(118,10,61,0.7)', + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + width: '100%', + height: '2rem', + padding: '0 1rem', +}) + +export const latestLink = style({ + color: '#fbd7a1', + marginLeft: '0.5rem', +}) + +export const links = style({ + display: 'flex', +}) + +export const select = style({ + minWidth: '5rem', + opacity: '0.85', + + ':disabled': { + opacity: '0.4', + }, +}) + +export const selector = style({ + marginRight: '1rem', + + ':last-child': { + marginRight: '0', + }, +}) + +export const label = style({ + marginRight: '0.5rem', + '@media': { + 'screen and (max-width: 550px)': { + display: 'none', + }, + }, +}) + +export const link = style({ + color: '#ffe9c9', + textDecoration: 'none', + marginRight: '1rem', + fontSize: '0.9rem', + position: 'relative', + top: '1px', + + '@media': { + 'screen and (max-width: 800px)': { + display: 'none', + }, + }, +}) + +export const logo = style({ + display: 'flex', + alignItems: 'center', + fontSize: '1.2rem', + lineHeight: '1.2rem', + fontWeight: '400', + color: 'white', + textDecoration: 'none', + marginRight: '2rem', + + '@media': { + 'screen and (max-width: 360px)': { + fontSize: '1rem', + lineHeight: '1rem', + marginRight: '1rem', + }, + }, +}) + +export const logoImage = style({ + height: '1.3rem', + marginRight: '0.5rem', + + '@media': { + 'screen and (max-width: 400px)': { + display: 'none', + }, + }, +}) + +export const menuIcon = style({ + display: 'none', + alignItems: 'center', + fontSize: '1.2rem', + lineHeight: '1.2rem', + fontWeight: '400', + color: 'white', + textDecoration: 'none', + marginRight: '1rem', + cursor: 'pointer', + + '@media': { + 'screen and (max-width: 767px)': { + display: 'flex', + }, + }, +}) + +globalStyle(`${menuIcon} img`, { + width: '18px', +}) diff --git a/src/ui/screens/Docs/index.tsx b/src/ui/screens/Docs/index.tsx index 09461893..edc43a2d 100644 --- a/src/ui/screens/Docs/index.tsx +++ b/src/ui/screens/Docs/index.tsx @@ -1,29 +1,23 @@ -import { h, FunctionComponent } from 'preact' -import { NavBar } from './NavBar' -import { Finder } from './Finder' -import { Doc } from './Doc' -import { - Screen, - Content, - Loading, - DocContainer, - FinderContainer, - NavBarContainer, -} from './style.css' +import { packageName } from '@date-fns/docs/consts' +import { db } from '@date-fns/docs/db' +import type { DateFnsDocs } from '@date-fns/docs/types' +import { useRead } from '@typesaurus/preact' +import classNames from 'classnames' +import { FunctionComponent, h } from 'preact' +import { useContext, useEffect, useState } from 'preact/hooks' +import { DEFAULT_PAGE } from '~/constants' +import { RouterContext } from '~/ui/router' +import { docLink } from '~/ui/router/docLink' import { filterPreReleaseVersions, getLatestVersion, sortVersions, } from '~/utils/versions' +import { Doc } from './Doc' +import { Finder } from './Finder' import hamburgerPath from './img/hamburger.svg' -import { useContext, useEffect, useState } from 'preact/hooks' -import { RouterContext } from '~/ui/router' -import { docLink } from '~/ui/router/docLink' -import { DEFAULT_PAGE } from '~/constants' -import { useRead } from '@typesaurus/preact' -import type { DateFnsDocs } from '@date-fns/docs/types' -import { db } from '@date-fns/docs/db' -import { packageName } from '@date-fns/docs/consts' +import { NavBar } from './NavBar' +import * as styles from './styles.css' interface Props { selectedSubmodule: DateFnsDocs.Submodule @@ -61,8 +55,8 @@ export const Docs: FunctionComponent = ({ const selectedVersion = urlSelectedVersion ?? latestVersion return ( - - +
    +
    = ({ setMenuOpen(!menuOpen)} /> } /> - +
    - - +
    +
    setMenuOpen(false)} /> - +
    - setMenuOpen(false) : undefined} > = ({ selectedPage={selectedPage} selectedSubmodule={selectedSubmodule} /> - - - +
    +
    +
    ) } else if (loading) { - return Loading... + return
    Loading...
    } else { - return Failed to load package list! + return
    Failed to load package list!
    } } diff --git a/src/ui/screens/Docs/style.css b/src/ui/screens/Docs/style.css deleted file mode 100644 index 532a4875..00000000 --- a/src/ui/screens/Docs/style.css +++ /dev/null @@ -1,81 +0,0 @@ -.Screen { - display: flex; - height: 100%; - width: 100%; - flex-direction: column; - align-items: stretch; - overflow: hidden; -} - -.NavBarContainer { - flex: none; - height: 2rem; -} - -.Content { - flex: auto; - display: flex; - flex-direction: row; - align-items: stretch; - min-height: 0; - position: relative; -} - -.FinderContainer { - flex: none; - width: 25rem; - max-width: 100%; -} - -@media screen and (max-width: 767px) { - .FinderContainer { - display: none; - position: absolute; - left: 0; - top: 0; - height: 100%; - z-index: 10; - } - - .FinderContainer-menuOpen { - display: block; - } -} - -.DocContainer { - height: auto; - min-height: 100%; - flex: auto; - overflow-y: auto; -} - -@media screen and (max-width: 767px) { - .DocContainer-menuOpen { - overflow-y: hidden; - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; - user-select: none; - } - - .DocContainer:after { - display: none; - content: ''; - background-color: grey; - opacity: 0.5; - height: 100%; - width: 100%; - left: 0; - top: 0; - position: absolute; - } - - .DocContainer-menuOpen:after { - display: block; - } -} - -.Loading { - padding: 30px; -} diff --git a/src/ui/screens/Docs/style.css.d.ts b/src/ui/screens/Docs/style.css.d.ts deleted file mode 100644 index 63d74e82..00000000 --- a/src/ui/screens/Docs/style.css.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CSSComponent, CSSPreactComponent } from '~/types/decss' - -export const Screen: CSSComponent -export const Content: CSSComponent -export const Loading: CSSComponent -export const NavBarContainer: CSSComponent -export const FinderContainer: CSSComponent<{ menuOpen?: boolean }> -export const DocContainer: CSSComponent<{ menuOpen?: boolean }> diff --git a/src/ui/screens/Docs/styles.css.ts b/src/ui/screens/Docs/styles.css.ts new file mode 100644 index 00000000..c4d67983 --- /dev/null +++ b/src/ui/screens/Docs/styles.css.ts @@ -0,0 +1,88 @@ +import { style } from '@vanilla-extract/css' + +export const content = style({ + flex: 'auto', + display: 'flex', + flexDirection: 'row', + alignItems: 'stretch', + minHeight: '0', + position: 'relative', +}) + +export const loading = style({ + padding: '30px', +}) + +export const navBarContainer = style({ + flex: 'none', + height: '2rem', +}) + +export const screen = style({ + display: 'flex', + height: '100%', + width: '100%', + flexDirection: 'column', + alignItems: 'stretch', + overflow: 'hidden', +}) + +export const docContainer = style({ + height: 'auto', + minHeight: '100%', + flex: 'auto', + overflowY: 'auto', + + ':after': { + display: 'none', + content: '', + backgroundColor: 'grey', + opacity: '0.5', + height: '100%', + width: '100%', + left: '0', + top: '0', + position: 'absolute', + }, +}) + +export const docContainerMenuOpen = style({ + ':after': { + display: 'block', + }, + + '@media': { + 'screen and (max-width: 767px)': { + overflowY: 'hidden', + MozUserSelect: 'none', + KhtmlUserSelect: 'none', + WebkitUserSelect: 'none', + userSelect: 'none', + }, + }, +}) + +export const finderContainer = style({ + flex: 'none', + width: '25rem', + maxWidth: '100%', + + '@media': { + 'screen and (max-width: 767px)': { + display: 'none', + position: 'absolute', + left: '0', + top: '0', + height: '100%', + zIndex: '10', + }, + }, +}) + +export const finderContainerMenuOpen = style({ + '@media': { + 'screen and (max-width: 767px)': { + display: 'block', + }, + }, +}) diff --git a/src/ui/screens/Home/Testimonials/index.tsx b/src/ui/screens/Home/Testimonials/index.tsx index 89762d8a..017c4517 100644 --- a/src/ui/screens/Home/Testimonials/index.tsx +++ b/src/ui/screens/Home/Testimonials/index.tsx @@ -1,21 +1,10 @@ -import { h, Fragment } from 'preact' +import { Fragment, h } from 'preact' import { HomeBlock, HomeExternalAction, HomeExternalLink, } from '~/ui/components/Home' - -import { - List, - Item, - Quote, - QuoteTriangle, - QuoteTriangleInner, - Avatar, - AvatarImage, - Name, - Text, -} from './style.css' +import * as styles from './styles.css' const testimonials = [ { @@ -70,29 +59,29 @@ export const Testimonials = () => ( } > - +
    {testimonials.map((testimonial, index) => ( - - - - +
    +
    + +
    - - - - +
    +
    +
    +
    - +
    {testimonial.name} {testimonial.title} - +
    - {testimonial.text} - - +
    {testimonial.text}
    +
    +
    ))} - +
    ) diff --git a/src/ui/screens/Home/Testimonials/style.css b/src/ui/screens/Home/Testimonials/style.css deleted file mode 100644 index 0e412e76..00000000 --- a/src/ui/screens/Home/Testimonials/style.css +++ /dev/null @@ -1,77 +0,0 @@ -.List { - display: flex; - flex-wrap: wrap; - justify-content: center; - margin-bottom: -30px; -} - -.Item { - display: flex; - flex-basis: calc(50% - 50px); - margin: 0 50px 30px 0; -} - -@media screen and (max-width: 767px) { - .Item { - display: flex; - flex-basis: 100%; - margin: 0 0 30px; - } -} - -.Quote { - border: 1px solid #e4e4dd; - border-radius: 4px; - background-color: white; - padding: 16px 15px 15px; - flex-grow: 1; - position: relative; -} - -.QuoteTriangle { - width: 0; - height: 0; - border-top: 12px solid rgba(0, 0, 0, 0); - border-bottom: 12px solid rgba(0, 0, 0, 0); - border-right: 12px solid #e4e4dd; - position: absolute; - top: 16px; - left: -12px; -} - -.QuoteTriangleInner { - position: relative; - top: -11px; - left: 1px; - width: 0; - height: 0; - border-top: 11px solid rgba(0, 0, 0, 0); - border-bottom: 11px solid rgba(0, 0, 0, 0); - border-right: 11px solid #fff; -} - -.Avatar { - flex-basis: 60px; - flex-shrink: 0; - margin-right: 20px; -} - -.AvatarImage { - width: 60px; - height: 60px; - border-radius: 50%; - border: 1px solid #e4e4dd; -} - -.Name { - font-weight: 600; - font-size: 17px; - margin-bottom: 5px; -} - -.Text { - color: #4c193c; - font-weight: 400; - font-size: 16px; - line-height: 22px; -} diff --git a/src/ui/screens/Home/Testimonials/style.css.d.ts b/src/ui/screens/Home/Testimonials/style.css.d.ts deleted file mode 100644 index c646f35e..00000000 --- a/src/ui/screens/Home/Testimonials/style.css.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { CSSComponent } from '~/types/decss' - -export const List: CSSComponent -export const Item: CSSComponent -export const Quote: CSSComponent -export const QuoteTriangle: CSSComponent -export const QuoteTriangleInner: CSSComponent -export const Avatar: CSSComponent -export const AvatarImage: CSSComponent -export const Name: CSSComponent -export const Text: CSSComponent diff --git a/src/ui/screens/Home/Testimonials/styles.css.ts b/src/ui/screens/Home/Testimonials/styles.css.ts new file mode 100644 index 00000000..ff8aebaa --- /dev/null +++ b/src/ui/screens/Home/Testimonials/styles.css.ts @@ -0,0 +1,79 @@ +import { style } from '@vanilla-extract/css' + +export const avatar = style({ + flexBasis: '60px', + flexShrink: '0', + marginRight: '20px', +}) + +export const avatarImage = style({ + width: '60px', + height: '60px', + borderRadius: '50%', + border: '1px solid #e4e4dd', +}) + +export const list = style({ + display: 'flex', + flexWrap: 'wrap', + justifyContent: 'center', + marginBottom: '-30px', +}) + +export const name = style({ + fontWeight: '600', + fontSize: '17px', + marginBottom: '5px', +}) + +export const quote = style({ + border: '1px solid #e4e4dd', + borderRadius: '4px', + backgroundColor: 'white', + padding: '16px 15px 15px', + flexGrow: '1', + position: 'relative', +}) + +export const quoteTriangle = style({ + width: '0', + height: '0', + borderTop: '12px solid rgba(0,0,0,0)', + borderBottom: '12px solid rgba(0,0,0,0)', + borderRight: '12px solid #e4e4dd', + position: 'absolute', + top: '16px', + left: '-12px', +}) + +export const quoteTriangleInner = style({ + position: 'relative', + top: '-11px', + left: '1px', + width: '0', + height: '0', + borderTop: '11px solid rgba(0,0,0,0)', + borderBottom: '11px solid rgba(0,0,0,0)', + borderRight: '11px solid #fff', +}) + +export const text = style({ + color: '#4c193c', + fontWeight: '400', + fontSize: '16px', + lineHeight: '22px', +}) + +export const item = style({ + display: 'flex', + flexBasis: 'calc(50% - 50px)', + margin: '0 50px 30px 0', + + '@media': { + 'screen and (max-width: 767px)': { + display: 'flex', + flexBasis: '100%', + margin: '0 0 30px', + }, + }, +}) From 23709a69416420d1ec14d803eeca958d44d5131d Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Tue, 3 Jan 2023 15:28:22 +0800 Subject: [PATCH 10/36] Remove NyanCSS --- config/webpackDefaults.ts | 17 +---------------- package.json | 2 -- yarn.lock | 35 ----------------------------------- 3 files changed, 1 insertion(+), 53 deletions(-) diff --git a/config/webpackDefaults.ts b/config/webpackDefaults.ts index 0de0df5b..562d00d6 100644 --- a/config/webpackDefaults.ts +++ b/config/webpackDefaults.ts @@ -73,24 +73,9 @@ function cssRule(isWeb: boolean) { ] : 'null-loader' - const nyancssLoaders = [ - '@nyancss/css-modules-loader/preact', - { loader: MiniCssExtractPlugin.loader, options: { esModule: false } }, - { - loader: 'css-loader', - options: { modules: true }, - }, - ] - return { test: /\.css$/, - oneOf: [ - { - resourceQuery: /global/, // foobar.css?global - use: cssLoaders, - }, - { use: nyancssLoaders }, - ], + use: cssLoaders, exclude: [/\.vanilla\.css$/i], } } diff --git a/package.json b/package.json index 0d037d05..0567e9ee 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,6 @@ }, "dependencies": { "@date-fns/docs": "0.12.1", - "@nyancss/css-modules-loader": "^1.1.0", - "@nyancss/react": "^1.3.0", "@sentry/browser": "^5.30.0", "@sentry/tracing": "^5.30.0", "@switcher/preact": "^1.1.2", diff --git a/yarn.lock b/yarn.lock index f1356ff4..ed67d55d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -950,41 +950,6 @@ mkdirp "^1.0.4" rimraf "^3.0.2" -"@nyancss/css-modules-loader@^1.1.0": - version "1.1.0" - resolved "https://registry.npmjs.org/@nyancss/css-modules-loader/-/css-modules-loader-1.1.0.tgz" - integrity sha512-Zqhw3HTF2NX21Bf9tjdRcEZMspmCQ/vb2ix4oSqlU7wt/jjBJg/25WnPxubwU8bhYx+lCfNiBJD2+pOaWIUviQ== - dependencies: - "@nyancss/css-modules" "^1.2" - -"@nyancss/css-modules@^1.2": - version "1.2.0" - resolved "https://registry.npmjs.org/@nyancss/css-modules/-/css-modules-1.2.0.tgz" - integrity sha512-2tT/mxRtl0Y8u8EtJLk8pLNJktoZcKewc8DFMc48Om9pw5lKDOeG9N9IUzIhO1jJkaKmJ+/SOoKHAwf8Ho4q+Q== - dependencies: - "@nyancss/types" "^1" - "@nyancss/utils" "^1.2" - -"@nyancss/react@^1.3.0": - version "1.3.0" - resolved "https://registry.npmjs.org/@nyancss/react/-/react-1.3.0.tgz" - integrity sha512-yzuuTnn+WU5qOTzlFlZFQ1YyAMLwMsRxFoEr3GMi2vlz3J958sJQSjPBQTpSOUmxOfhFNacWIhXFm5UYXRe2Kw== - dependencies: - "@nyancss/types" "^1" - "@nyancss/utils" "^1.2" - -"@nyancss/types@^1", "@nyancss/types@^1.1.0": - version "1.1.0" - resolved "https://registry.npmjs.org/@nyancss/types/-/types-1.1.0.tgz" - integrity sha512-iiC7HUmil5T3pLcRDP+9Iza0WbN9ZXD9t5UGvwscf8PC97JJyXQe1tS5fea3DskEB8mxUUh/J8A14LMyvX71kw== - -"@nyancss/utils@^1.2": - version "1.2.0" - resolved "https://registry.npmjs.org/@nyancss/utils/-/utils-1.2.0.tgz" - integrity sha512-9QWCpjZGo5GupaS+6C6VfYscaZo2PGsr8SWs+/B7ryrA6ztSAYE3EOVvTQIdxYC23ccZzsfIlM2tqcchUMOq+A== - dependencies: - "@nyancss/types" "^1.1.0" - "@opentelemetry/api@^1.0.0": version "1.0.4" resolved "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.4.tgz" From 344edb64d551cc6fd54a7461acceb0c25a42fc49 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Thu, 5 Jan 2023 08:57:24 +0800 Subject: [PATCH 11/36] Add types modal scaffold --- package.json | 4 +- src/server/template/index.ts | 1 + src/ui/components/DocType/index.tsx | 4 +- src/ui/components/ModalPortal/CloseIcon.tsx | 10 ++ src/ui/components/ModalPortal/index.tsx | 64 ++++++++ src/ui/components/ModalPortal/styles.css.ts | 81 ++++++++++ src/ui/components/Modals/index.tsx | 141 ++++++++++++++++++ src/ui/index.tsx | 8 +- .../screens/Docs/Doc/TSDoc/Returns/index.tsx | 1 - src/ui/screens/Docs/Doc/TSDoc/Types/index.tsx | 23 +++ .../Docs/Doc/TSDoc/Types/styles.css.ts | 9 ++ src/ui/screens/Docs/Doc/TSDoc/index.tsx | 31 +++- src/ui/screens/Docs/NavBar/index.tsx | 4 +- src/utils/useRefState/index.ts | 19 +++ yarn.lock | 18 ++- 15 files changed, 399 insertions(+), 19 deletions(-) create mode 100644 src/ui/components/ModalPortal/CloseIcon.tsx create mode 100644 src/ui/components/ModalPortal/index.tsx create mode 100644 src/ui/components/ModalPortal/styles.css.ts create mode 100644 src/ui/components/Modals/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TSDoc/Types/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TSDoc/Types/styles.css.ts create mode 100644 src/utils/useRefState/index.ts diff --git a/package.json b/package.json index 0567e9ee..0978dc86 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@date-fns/docs": "0.12.1", "@sentry/browser": "^5.30.0", "@sentry/tracing": "^5.30.0", - "@switcher/preact": "^1.1.2", + "@switcher/preact": "2.3.0", "@types/assets-webpack-plugin": "^7.1.0", "@types/copy-webpack-plugin": "^10.1.0", "@types/cors": "^2.8.7", @@ -59,7 +59,7 @@ "mocha": "^8.2.1", "null-loader": "^4.0.1", "power-assert": "^1.6.1", - "preact": "^10.4.8", + "preact": "^10.11.3", "preact-render-to-string": "^5.1.10", "prettier": "2.1.1", "prismjs": "^1.23.0", diff --git a/src/server/template/index.ts b/src/server/template/index.ts index c881a38c..56df78a2 100644 --- a/src/server/template/index.ts +++ b/src/server/template/index.ts @@ -58,6 +58,7 @@ export const template = ({ body }: Params = {}) =>
    ${body ?? ''}
    +
    diff --git a/src/ui/components/DocType/index.tsx b/src/ui/components/DocType/index.tsx index f7baeb99..640dda0d 100644 --- a/src/ui/components/DocType/index.tsx +++ b/src/ui/components/DocType/index.tsx @@ -6,7 +6,7 @@ interface Props { } export const DocType: FunctionComponent = ({ type }) => { - console.log({ type }) + // console.log({ type }) switch (type.type) { case 'intrinsic': @@ -25,7 +25,7 @@ export const DocType: FunctionComponent = ({ type }) => { return ( ( + + + +) diff --git a/src/ui/components/ModalPortal/index.tsx b/src/ui/components/ModalPortal/index.tsx new file mode 100644 index 00000000..22f66055 --- /dev/null +++ b/src/ui/components/ModalPortal/index.tsx @@ -0,0 +1,64 @@ +import classNames from 'classnames' +import { ComponentChildren, FunctionComponent, h } from 'preact' +import { createPortal } from 'preact/compat' +import { Ref, useEffect } from 'preact/hooks' +import { ModalPortalCloseIcon } from './CloseIcon' +import * as styles from './styles.css' + +export interface ModalPortalProps { + children: ComponentChildren + close: () => void + bare?: boolean + size?: keyof typeof styles.window + closeOnOverlayClick?: boolean + adjusted?: boolean + overlayRef?: Ref +} + +export const ModalPortal: FunctionComponent = ({ + children, + close, + bare, + size = 'medium', + closeOnOverlayClick, + adjusted, + overlayRef, +}) => { + const portals = document.getElementById('portals') + + useEffect(() => { + if (!portals) return + document.body.style.overflow = 'hidden' + return () => (document.body.style.overflow = 'auto') + }, [portals]) + + if (!portals) return null + + return createPortal( +
    + {bare ? ( + children + ) : ( +
    { + if (closeOnOverlayClick) e.target === e.currentTarget && close() + }} + > +
    + + + {children} +
    +
    + )} +
    , + portals + ) +} diff --git a/src/ui/components/ModalPortal/styles.css.ts b/src/ui/components/ModalPortal/styles.css.ts new file mode 100644 index 00000000..0c09888e --- /dev/null +++ b/src/ui/components/ModalPortal/styles.css.ts @@ -0,0 +1,81 @@ +import { globalStyle, style, styleVariants } from '@vanilla-extract/css' + +export const overlay = style({ + zIndex: 20, + position: 'fixed', + left: '0', + top: '0', + right: '0', + bottom: '0', + background: '#080005d4', + overflowY: 'auto', + display: 'flex', + justifyContent: 'center', +}) + +export const overlayAdjusted = style({ + alignItems: 'center', +}) + +export const windowWrapper = style({ + width: '100%', + padding: '4rem', + + '@media': { + '(max-width: 1024px)': { + padding: '1rem', + }, + }, +}) + +export const windowBase = style({ + background: '#fffdf9', + borderRadius: '4px', + color: '#4a3142', + width: '100%', + margin: '0 auto', +}) + +export const window = styleVariants({ + small: [ + windowBase, + { + maxWidth: '40rem', + }, + ], + + medium: [ + windowBase, + { + maxWidth: '50rem', + }, + ], +}) + +export const close = style({ + border: '0', + background: 'transparent', + position: 'fixed', + width: '3rem', + height: '3rem', + color: '#5d3861', + cursor: 'pointer', + + ':hover': { + color: '#c482cb', + }, + + selectors: { + [`${window.small} &`]: { + marginLeft: '41rem', + }, + + [`${window.medium} &`]: { + marginLeft: '51rem', + }, + }, +}) + +globalStyle(`${close} svg`, { + width: '100%', +}) diff --git a/src/ui/components/Modals/index.tsx b/src/ui/components/Modals/index.tsx new file mode 100644 index 00000000..6023e58e --- /dev/null +++ b/src/ui/components/Modals/index.tsx @@ -0,0 +1,141 @@ +import { ModalPortal, ModalPortalProps } from '~/ui/components/ModalPortal' +import { + ComponentChild, + ComponentChildren, + createContext, + FunctionComponent, + h, +} from 'preact' +import { + MutableRef, + Ref, + useContext, + useMemo, + useRef, + useState, +} from 'preact/hooks' +import { useRefState } from '~/utils/useRefState' + +export interface ModalComponent { + id: string + component: ComponentChildren +} + +export type ModalOverlayRef = MutableRef + +export type ModalOnCloseRef = MutableRef<(() => unknown) | null> + +export interface ModalAPI { + modal: ModalComponent | undefined + props: ShowModalInnerProps + showModal: ShowModal + overlayRef: ModalOverlayRef + onCloseRef: ModalOnCloseRef +} + +export type ShowModalInnerProps = Pick< + ModalPortalProps, + 'size' | 'bare' | 'closeOnOverlayClick' | 'adjusted' +> + +export interface ShowModalProps { + modalId: string + component: ComponentChild | null + props?: ShowModalInnerProps + onClose?: () => unknown +} + +export type ShowModal = (props: ShowModalProps) => void + +export const ModalsContext = createContext({ + modal: undefined, + props: {}, + showModal: () => {}, + overlayRef: { current: null }, + onCloseRef: { current: null }, +}) + +export interface ModalsProps { + api: ModalAPI +} + +export function Modals({ + api: { modal, props, showModal, overlayRef }, +}: ModalsProps) { + if (!modal) return null + return ( + { + showModal({ modalId: modal.id, component: undefined }) + }} + overlayRef={overlayRef} + {...props} + > + {modal.component} + + ) +} + +export function useModals(): ModalAPI { + const [modal, setModal] = useRefState(undefined) + const [props, setProps] = useState({ size: 'medium' }) + const overlayRef: ModalOverlayRef = useRef(null) + const onCloseRef: ModalOnCloseRef = useRef(null) + + const showModal: ShowModal = ({ + modalId, + component, + props: newProps, + onClose, + }) => { + // Call current modal onClose callback + if (!component) onCloseRef.current?.() + // Assign new callback + onCloseRef.current = onClose || null + + // Ignore close if another modal got opened + if (!component && modalId !== modal.current?.id) return + + setModal(component ? { id: modalId, component } : undefined) + setProps(newProps || {}) + } + + return { modal: modal.current, props, showModal, overlayRef, onCloseRef } +} + +export interface ModalPropsBase { + close: () => void + overlayRef: ModalOverlayRef +} + +export interface ModalPropsExtra { + onClose: () => unknown +} + +export function createModal>( + Component: FunctionComponent, + innerProps?: Omit +) { + return (): ((props: Props & ModalPropsExtra) => void) => { + const modalId = useMemo(() => Date.now().toString(), []) + const { showModal, overlayRef } = useContext(ModalsContext) + + return ({ onClose, ...props }) => { + showModal({ + modalId, + component: ( + // @ts-ignore: we're tricking TypeScript, this is ok + { + showModal({ modalId, component: null }) + }} + overlayRef={overlayRef} + /> + ), + props: innerProps, + onClose, + }) + } + } +} diff --git a/src/ui/index.tsx b/src/ui/index.tsx index d8ce542a..1d9a9956 100644 --- a/src/ui/index.tsx +++ b/src/ui/index.tsx @@ -7,6 +7,7 @@ import { NotFound } from '~/ui/screens/NotFound' import 'reset.css/reset.css?global' import './global.css?global' import { defaultSubmodule } from '@date-fns/docs/consts' +import { Modals, ModalsContext, useModals } from './components/Modals' const win = typeof window !== 'undefined' ? window : undefined @@ -17,9 +18,14 @@ export const UI = () => { win?.ga?.('send', 'pageview') }, [JSON.stringify(location)]) + const modalsApi = useModals() + return ( <> - + + + + ) } diff --git a/src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx index e31b247f..f0657cc0 100644 --- a/src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx +++ b/src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx @@ -11,7 +11,6 @@ interface Props { export const Returns: FunctionComponent = ({ fn }) => { const description = useMemo(() => findReturns(fn), [fn]) - console.log({ fn }) return ( ( + ({ typeId, tsdoc }) => { + return ( +
    +
    +
    TODO: Navigation
    +
    TODO: Content
    +
    +
    + ) + }, + { size: 'medium', closeOnOverlayClick: true } +) diff --git a/src/ui/screens/Docs/Doc/TSDoc/Types/styles.css.ts b/src/ui/screens/Docs/Doc/TSDoc/Types/styles.css.ts new file mode 100644 index 00000000..00e88670 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TSDoc/Types/styles.css.ts @@ -0,0 +1,9 @@ +import { style } from '@vanilla-extract/css' + +export const wrapper = style({}) + +export const inner = style({}) + +export const nav = style({}) + +export const content = style({}) diff --git a/src/ui/screens/Docs/Doc/TSDoc/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/index.tsx index c62a2cca..975d8054 100644 --- a/src/ui/screens/Docs/Doc/TSDoc/index.tsx +++ b/src/ui/screens/Docs/Doc/TSDoc/index.tsx @@ -1,7 +1,7 @@ import type { DateFnsDocs } from '@date-fns/docs/types' import { findDescription, findExamples, findFn } from '@date-fns/docs/utils' import { FunctionComponent, h } from 'preact' -import { useMemo } from 'preact/hooks' +import { useContext, useEffect, useMemo } from 'preact/hooks' import { parse } from 'typeroo' import { DocExamples } from '~/ui/components/DocExamples' import { DocHeader } from '~/ui/components/DocHeader' @@ -9,20 +9,45 @@ import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' import { DocLinks } from '~/ui/components/DocLinks' import { DocUsage } from '~/ui/components/DocUsage' import { Markdown } from '~/ui/components/Markdown' +import { RouterContext } from '~/ui/router' import { Returns } from './Returns' +import { useTypesModal } from './Types' interface Props { page: DateFnsDocs.TSDocPage } +const typeHashRE = /types\/(\w+)\/(\w+)/ + export const TSDoc: FunctionComponent = ({ page }) => { + const { location, navigate } = useContext(RouterContext) const tsdoc = useMemo(() => parse(page.tsdoc), [page.slug]) const fn = useMemo(() => findFn(tsdoc), [tsdoc]) const description = useMemo(() => fn && findDescription(fn), [fn]) const { usage, usageTabs } = useMemo(() => generateUsage(tsdoc.name), [tsdoc]) const examples = useMemo(() => fn && findExamples(fn).map(extractCode), [fn]) - - console.log(examples) + const showTypesModal = useTypesModal() + + useEffect(() => { + const captures = location.hash.match(typeHashRE) + if (!captures) return + + const type = captures[2] + if (!type) return + + const typeId = parseInt(type) + if (isNaN(typeId)) return + + showTypesModal({ + typeId, + tsdoc, + onClose: () => { + // TODO: Fix Switcher to allow replacing the current location + if (location.name === '404') return + navigate({ ...location, hash: '' }) + }, + }) + }, [window.location.href]) return (
    diff --git a/src/ui/screens/Docs/NavBar/index.tsx b/src/ui/screens/Docs/NavBar/index.tsx index 0165b1dc..daa3524a 100644 --- a/src/ui/screens/Docs/NavBar/index.tsx +++ b/src/ui/screens/Docs/NavBar/index.tsx @@ -1,4 +1,4 @@ -import { h, FunctionComponent } from 'preact' +import { h, FunctionComponent, VNode } from 'preact' import { RouterLink } from '~/ui/router' import logoPath from './img/logo.svg' import { defaultSubmodule } from '@date-fns/docs/consts' @@ -13,7 +13,7 @@ interface Props { selectedPage: string versions: DateFnsDocs.VersionPreview[] selectedSubmodule: DateFnsDocs.Submodule - menuIcon: React.ReactNode + menuIcon: VNode } export const NavBar: FunctionComponent = ({ diff --git a/src/utils/useRefState/index.ts b/src/utils/useRefState/index.ts new file mode 100644 index 00000000..d8879d3e --- /dev/null +++ b/src/utils/useRefState/index.ts @@ -0,0 +1,19 @@ +import { useRef, useState } from 'preact/hooks' + +export function useRefState(initialValue: Type) { + const ref = useRef(initialValue) + const [, setUpdated] = useState(0) + const set = (value: Type) => { + ref.current = value + setUpdated(Date.now()) + } + return [ref, set] as const +} + +export function usePrimitiveRefState(initialValue: Type) { + const [ref, set] = useRefState(initialValue) + const primitiveSet = (value: Type) => { + if (ref.current !== value) set(value) + } + return [ref, primitiveSet] as const +} diff --git a/yarn.lock b/yarn.lock index ed67d55d..78fc28e6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1096,10 +1096,12 @@ "@sentry/types" "5.30.0" tslib "^1.9.3" -"@switcher/preact@^1.1.2": - version "1.1.2" - resolved "https://registry.npmjs.org/@switcher/preact/-/preact-1.1.2.tgz" - integrity sha512-1knle4+lkOCUSZaA9dJ/6G15FMHqwFCc9FwIdY/i4blov7p28PkPU2v1up8WT/1v8H5xHd+zpn8rdmXnzSazMg== +"@switcher/preact@2.3.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@switcher/preact/-/preact-2.3.0.tgz#c7a18dd2af9ede0df252bf2e05c4be68aa5b7069" + integrity sha512-0YmKAEMAn6WOa601iDpdpANGB5dhzVUtcK1RbPtk59ZJYmdmumBgEhzk84YYlOlpyAwwtsh9tNNetvww9kYfyg== + dependencies: + preact "^10.2.1" "@tootallnate/once@1": version "1.1.2" @@ -7034,10 +7036,10 @@ preact-render-to-string@^5.1.10: dependencies: pretty-format "^3.8.0" -preact@^10.4.8: - version "10.4.8" - resolved "https://registry.npmjs.org/preact/-/preact-10.4.8.tgz" - integrity sha512-uVLeEAyRsCkUEFhVHlOu17OxcrwC7+hTGZ08kBoLBiGHiZooUZuibQnphgMKftw/rqYntNMyhVCPqQhcyAGHag== +preact@^10.11.3, preact@^10.2.1: + version "10.11.3" + resolved "https://registry.yarnpkg.com/preact/-/preact-10.11.3.tgz#8a7e4ba19d3992c488b0785afcc0f8aa13c78d19" + integrity sha512-eY93IVpod/zG3uMF22Unl8h9KkrcKIRs2EGar8hwLZZDU1lkjph303V9HZBwufh2s736U6VXuhD109LYqPoffg== prelude-ls@~1.1.2: version "1.1.2" From ef651454ed81c98704e01fb902978ff10e47b48b Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Mon, 16 Jan 2023 13:48:18 +0800 Subject: [PATCH 12/36] Add types modal scaffold --- package.json | 2 +- src/ui/components/DocReturns/index.tsx | 59 +++++++------ .../{DocParams => JSDocParams}/index.tsx | 4 +- .../{DocParams => JSDocParams}/styles.css.ts | 0 .../{DocType => TSDocType}/index.tsx | 4 +- .../Docs/Doc/JSDoc/Arguments/index.tsx | 4 +- .../Docs/Doc/JSDoc/Properties/index.tsx | 4 +- .../Docs/Doc/TSDoc/Arguments/index.tsx | 82 +++++++++++++------ .../Docs/Doc/TSDoc/Arguments/styles.css.ts | 5 ++ .../Docs/Doc/TSDoc/Exceptions/index.tsx | 37 --------- .../screens/Docs/Doc/TSDoc/Generics/index.tsx | 67 +++++++++++++++ .../Docs/Doc/TSDoc/Generics/styles.css.ts | 5 ++ .../Docs/Doc/TSDoc/Properties/index.tsx | 31 ------- .../screens/Docs/Doc/TSDoc/Returns/index.tsx | 30 ++++--- .../Docs/Doc/TSDoc/Signature/index.tsx | 50 +++++++++++ .../Docs/Doc/TSDoc/Signatures/index.tsx | 37 +++++++++ .../Docs/Doc/TSDoc/Signatures/styles.css.ts | 19 +++++ src/ui/screens/Docs/Doc/TSDoc/index.tsx | 23 ++---- yarn.lock | 8 +- 19 files changed, 316 insertions(+), 155 deletions(-) rename src/ui/components/{DocParams => JSDocParams}/index.tsx (93%) rename src/ui/components/{DocParams => JSDocParams}/styles.css.ts (100%) rename src/ui/components/{DocType => TSDocType}/index.tsx (91%) create mode 100644 src/ui/screens/Docs/Doc/TSDoc/Arguments/styles.css.ts delete mode 100644 src/ui/screens/Docs/Doc/TSDoc/Exceptions/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TSDoc/Generics/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TSDoc/Generics/styles.css.ts delete mode 100644 src/ui/screens/Docs/Doc/TSDoc/Properties/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TSDoc/Signature/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TSDoc/Signatures/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TSDoc/Signatures/styles.css.ts diff --git a/package.json b/package.json index 0978dc86..3e67dc4b 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "start": "env NODE_ENV=development ts-node -r tsconfig-paths/register devServer.ts" }, "dependencies": { - "@date-fns/docs": "0.12.1", + "@date-fns/docs": "0.14.0", "@sentry/browser": "^5.30.0", "@sentry/tracing": "^5.30.0", "@switcher/preact": "2.3.0", diff --git a/src/ui/components/DocReturns/index.tsx b/src/ui/components/DocReturns/index.tsx index 6614bd08..0df328a2 100644 --- a/src/ui/components/DocReturns/index.tsx +++ b/src/ui/components/DocReturns/index.tsx @@ -1,4 +1,4 @@ -import { ComponentChildren, FunctionComponent, h } from 'preact' +import { ComponentChildren, FunctionComponent, h, Fragment } from 'preact' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' import { Markdown } from '~/ui/components/Markdown' @@ -9,33 +9,44 @@ interface ReturnType { interface Props { returns: ReturnType[] + header?: 'h2' | 'h3' } -export const DocReturns: FunctionComponent = ({ returns }) => ( -
    -

    +export const DocReturns: FunctionComponent = ({ returns, header }) => { + const headerContent = ( + <> Returns -

    + + ) -

    - - - - - - + return ( +
    + {header === 'h2' ? ( +

    {headerContent}

    + ) : ( +

    {headerContent}

    + )} -
    - {returns.map((returnData, index) => ( - - - +
    TypeDescription
    {returnData.type} - -
    + + + + - ))} - -
    TypeDescription
    - -) + + + + {returns.map((returnData, index) => ( + + {returnData.type} + + + + + ))} + + + + ) +} diff --git a/src/ui/components/DocParams/index.tsx b/src/ui/components/JSDocParams/index.tsx similarity index 93% rename from src/ui/components/DocParams/index.tsx rename to src/ui/components/JSDocParams/index.tsx index a1149072..de90313e 100644 --- a/src/ui/components/DocParams/index.tsx +++ b/src/ui/components/JSDocParams/index.tsx @@ -7,7 +7,7 @@ interface Props { params: DateFnsDocs.JSDocParam[] } -export const DocParams: FunctionComponent = ({ params }) => ( +export const JSDocParams: FunctionComponent = ({ params }) => ( <> {params.map((param, index) => ( @@ -55,7 +55,7 @@ const ParamPropsTable: FunctionComponent<{ - +
    diff --git a/src/ui/components/DocParams/styles.css.ts b/src/ui/components/JSDocParams/styles.css.ts similarity index 100% rename from src/ui/components/DocParams/styles.css.ts rename to src/ui/components/JSDocParams/styles.css.ts diff --git a/src/ui/components/DocType/index.tsx b/src/ui/components/TSDocType/index.tsx similarity index 91% rename from src/ui/components/DocType/index.tsx rename to src/ui/components/TSDocType/index.tsx index 640dda0d..dccdfe2c 100644 --- a/src/ui/components/DocType/index.tsx +++ b/src/ui/components/TSDocType/index.tsx @@ -5,7 +5,7 @@ interface Props { type: SomeType } -export const DocType: FunctionComponent = ({ type }) => { +export const TSDocType: FunctionComponent = ({ type }) => { // console.log({ type }) switch (type.type) { @@ -16,7 +16,7 @@ export const DocType: FunctionComponent = ({ type }) => { return ( Array{'<'} - + {'>'} ) diff --git a/src/ui/screens/Docs/Doc/JSDoc/Arguments/index.tsx b/src/ui/screens/Docs/Doc/JSDoc/Arguments/index.tsx index 1e90149f..6e352761 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/Arguments/index.tsx +++ b/src/ui/screens/Docs/Doc/JSDoc/Arguments/index.tsx @@ -1,6 +1,6 @@ import { h, FunctionComponent } from 'preact' import type { DateFnsDocs } from '@date-fns/docs/types' -import { DocParams } from '~/ui/components/DocParams' +import { JSDocParams } from '~/ui/components/JSDocParams' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' interface Props { @@ -24,7 +24,7 @@ export const Arguments: FunctionComponent = ({ args }) => ( - + diff --git a/src/ui/screens/Docs/Doc/JSDoc/Properties/index.tsx b/src/ui/screens/Docs/Doc/JSDoc/Properties/index.tsx index 2bdde3ab..18a8b2df 100644 --- a/src/ui/screens/Docs/Doc/JSDoc/Properties/index.tsx +++ b/src/ui/screens/Docs/Doc/JSDoc/Properties/index.tsx @@ -1,6 +1,6 @@ import { h, FunctionComponent } from 'preact' import type { DateFnsDocs } from '@date-fns/docs/types' -import { DocParams } from '~/ui/components/DocParams' +import { JSDocParams } from '~/ui/components/JSDocParams' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' interface Props { @@ -24,7 +24,7 @@ export const Properties: FunctionComponent = ({ properties }) => ( - + diff --git a/src/ui/screens/Docs/Doc/TSDoc/Arguments/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Arguments/index.tsx index 1e90149f..c667e3fd 100644 --- a/src/ui/screens/Docs/Doc/TSDoc/Arguments/index.tsx +++ b/src/ui/screens/Docs/Doc/TSDoc/Arguments/index.tsx @@ -1,31 +1,67 @@ -import { h, FunctionComponent } from 'preact' +import { h, FunctionComponent, Fragment } from 'preact' import type { DateFnsDocs } from '@date-fns/docs/types' -import { DocParams } from '~/ui/components/DocParams' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import type { ParameterReflection } from 'typedoc' +import { TSDocType } from '~/ui/components/TSDocType' +import { Markdown } from '~/ui/components/Markdown' +import { joinCommentParts } from '@date-fns/docs/utils' +import * as styles from './styles.css' interface Props { - args: DateFnsDocs.JSDocParam[] + args: ParameterReflection[] + header: 'h2' | 'h3' } -export const Arguments: FunctionComponent = ({ args }) => ( -
    -

    +export const Arguments: FunctionComponent = ({ args, header }) => { + const headerContent = ( + <> Arguments -

    - - - - - - - - - - - - - -
    NameTypeDescription
    -
    -) + + ) + + return ( +
    + {header === 'h2' ? ( +

    {headerContent}

    + ) : ( +

    {headerContent}

    + )} + + + + + + + + + + + + {args.map((arg, index) => ( + + + + + + + + ))} + +
    NameTypeDescription
    + {arg.name} + + {arg.flags.isOptional && ( +
    (optional)
    + )} +
    {arg.type && } + {arg.comment?.summary && ( + + )} + +
    {JSON.stringify(arg, null, 2)}
    +
    +
    +
    + ) +} diff --git a/src/ui/screens/Docs/Doc/TSDoc/Arguments/styles.css.ts b/src/ui/screens/Docs/Doc/TSDoc/Arguments/styles.css.ts new file mode 100644 index 00000000..d971530f --- /dev/null +++ b/src/ui/screens/Docs/Doc/TSDoc/Arguments/styles.css.ts @@ -0,0 +1,5 @@ +import { style } from '@vanilla-extract/css' + +export const optionalLabel = style({ + fontStyle: 'italic', +}) diff --git a/src/ui/screens/Docs/Doc/TSDoc/Exceptions/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Exceptions/index.tsx deleted file mode 100644 index f6d36851..00000000 --- a/src/ui/screens/Docs/Doc/TSDoc/Exceptions/index.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { h, FunctionComponent } from 'preact' -import type { DateFnsDocs } from '@date-fns/docs/types' -import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' -import { Markdown } from '~/ui/components/Markdown' - -interface Props { - exceptions: DateFnsDocs.JSDocAttribute[] -} - -export const Exceptions: FunctionComponent = ({ exceptions }) => ( -
    -

    - Exceptions - -

    - - - - - - - - - - - {exceptions.map((exception, index) => ( - - - - - ))} - -
    TypeDescription
    {exception.type.names.join(' | ')} - -
    -
    -) diff --git a/src/ui/screens/Docs/Doc/TSDoc/Generics/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Generics/index.tsx new file mode 100644 index 00000000..4f35c8e2 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TSDoc/Generics/index.tsx @@ -0,0 +1,67 @@ +import { h, FunctionComponent, Fragment } from 'preact' +import type { DateFnsDocs } from '@date-fns/docs/types' +import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import type { ParameterReflection, TypeParameterReflection } from 'typedoc' +import { TSDocType } from '~/ui/components/TSDocType' +import { Markdown } from '~/ui/components/Markdown' +import { joinCommentParts } from '@date-fns/docs/utils' +import * as styles from './styles.css' + +interface Props { + args: TypeParameterReflection[] + header: 'h2' | 'h3' +} + +export const Generics: FunctionComponent = ({ args, header }) => { + const headerContent = ( + <> + Generics + + + ) + + return ( +
    + {header === 'h2' ? ( +

    {headerContent}

    + ) : ( +

    {headerContent}

    + )} + + + + + + + + + + + + {args.map((arg, index) => ( + + + + + + + + ))} + +
    NameTypeDescription
    + {arg.name} + + {arg.flags.isOptional && ( +
    (optional)
    + )} +
    {arg.type && } + {arg.comment?.summary && ( + + )} + +
    {JSON.stringify(arg, null, 2)}
    +
    +
    +
    + ) +} diff --git a/src/ui/screens/Docs/Doc/TSDoc/Generics/styles.css.ts b/src/ui/screens/Docs/Doc/TSDoc/Generics/styles.css.ts new file mode 100644 index 00000000..d971530f --- /dev/null +++ b/src/ui/screens/Docs/Doc/TSDoc/Generics/styles.css.ts @@ -0,0 +1,5 @@ +import { style } from '@vanilla-extract/css' + +export const optionalLabel = style({ + fontStyle: 'italic', +}) diff --git a/src/ui/screens/Docs/Doc/TSDoc/Properties/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Properties/index.tsx deleted file mode 100644 index 2bdde3ab..00000000 --- a/src/ui/screens/Docs/Doc/TSDoc/Properties/index.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { h, FunctionComponent } from 'preact' -import type { DateFnsDocs } from '@date-fns/docs/types' -import { DocParams } from '~/ui/components/DocParams' -import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' - -interface Props { - properties: DateFnsDocs.JSDocParam[] -} - -export const Properties: FunctionComponent = ({ properties }) => ( -
    -

    - Properties - -

    - - - - - - - - - - - - - -
    NameTypeDescription
    -
    -) diff --git a/src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx index f0657cc0..1da13871 100644 --- a/src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx +++ b/src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx @@ -1,24 +1,28 @@ -import { findReturns } from '@date-fns/docs/utils' import { FunctionComponent, h } from 'preact' -import { useMemo } from 'preact/hooks' -import type { DeclarationReflection } from 'typedoc' +import type { SomeType } from 'typedoc' import { DocReturns } from '~/ui/components/DocReturns' -import { DocType } from '~/ui/components/DocType' +import { TSDocType } from '~/ui/components/TSDocType' interface Props { - fn: DeclarationReflection + type: SomeType | undefined + description: string + header: 'h2' | 'h3' } -export const Returns: FunctionComponent = ({ fn }) => { - const description = useMemo(() => findReturns(fn), [fn]) +export const Returns: FunctionComponent = ({ + type, + description, + header, +}) => { return ( ({ - type: s.type && , - description: description || '', - })) || [] - } + returns={[ + { + type: type && , + description, + }, + ]} + header={header} /> ) } diff --git a/src/ui/screens/Docs/Doc/TSDoc/Signature/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Signature/index.tsx new file mode 100644 index 00000000..d4082a10 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TSDoc/Signature/index.tsx @@ -0,0 +1,50 @@ +import { findSignatureReturns } from '@date-fns/docs/utils' +import { h, FunctionComponent, Fragment } from 'preact' +import { useMemo } from 'preact/hooks' +import type { SignatureReflection, TypeParameterReflection } from 'typedoc' +import { Arguments } from '../Arguments' +import { Generics } from '../Generics' +import { Returns } from '../Returns' + +interface SignatureProps { + signature: SignatureReflection + header: 'h2' | 'h3' +} + +export const Signature: FunctionComponent = ({ + signature, + header, +}) => { + const returns = useMemo(() => findSignatureReturns(signature), [signature]) + + // @ts-ignore: Typing is inproper in TypeDoc + const typeParameters = signature.typeParameter as + | TypeParameterReflection[] + | undefined + + return ( + <> + {/*page.syntax && */} + + {signature.typeParameters && ( + + )} + + {signature.parameters && signature.parameters.length > 0 && ( + + )} + + {signature.type && ( + + )} + + +
    {JSON.stringify(signature, null, 2)}
    +
    + + ) +} diff --git a/src/ui/screens/Docs/Doc/TSDoc/Signatures/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Signatures/index.tsx new file mode 100644 index 00000000..0e3ba18e --- /dev/null +++ b/src/ui/screens/Docs/Doc/TSDoc/Signatures/index.tsx @@ -0,0 +1,37 @@ +import classNames from 'classnames' +import { h, FunctionComponent, Fragment } from 'preact' +import type { SignatureReflection } from 'typedoc' +import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import { Signature } from '../Signature' +import * as styles from './styles.css' + +interface SignaturesProps { + signatures: SignatureReflection[] +} + +export const Signatures: FunctionComponent = ({ + signatures, +}) => { + const solo = signatures.length === 1 + return ( +
    + {!solo && ( +

    + Signatures + +

    + )} + +
    + {signatures.map((signature, index) => ( +
    + +
    + ))} +
    +
    + ) +} diff --git a/src/ui/screens/Docs/Doc/TSDoc/Signatures/styles.css.ts b/src/ui/screens/Docs/Doc/TSDoc/Signatures/styles.css.ts new file mode 100644 index 00000000..fb156a33 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TSDoc/Signatures/styles.css.ts @@ -0,0 +1,19 @@ +import { style, globalStyle } from '@vanilla-extract/css' + +export const signature = style({ + selectors: { + '&:not(:last-child)': { + marginBottom: '1rem', + }, + }, +}) + +export const multiSignature = style({ + border: '1px solid #5844521a', + padding: '1rem', + background: '#fffefd', +}) + +globalStyle(`${multiSignature} > :first-child > :first-child`, { + marginTop: '0', +}) diff --git a/src/ui/screens/Docs/Doc/TSDoc/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/index.tsx index 975d8054..afacdde6 100644 --- a/src/ui/screens/Docs/Doc/TSDoc/index.tsx +++ b/src/ui/screens/Docs/Doc/TSDoc/index.tsx @@ -1,5 +1,5 @@ import type { DateFnsDocs } from '@date-fns/docs/types' -import { findDescription, findExamples, findFn } from '@date-fns/docs/utils' +import { findFnDescription, findFnExamples, findFn } from '@date-fns/docs/utils' import { FunctionComponent, h } from 'preact' import { useContext, useEffect, useMemo } from 'preact/hooks' import { parse } from 'typeroo' @@ -10,7 +10,7 @@ import { DocLinks } from '~/ui/components/DocLinks' import { DocUsage } from '~/ui/components/DocUsage' import { Markdown } from '~/ui/components/Markdown' import { RouterContext } from '~/ui/router' -import { Returns } from './Returns' +import { Signatures } from './Signatures' import { useTypesModal } from './Types' interface Props { @@ -23,9 +23,13 @@ export const TSDoc: FunctionComponent = ({ page }) => { const { location, navigate } = useContext(RouterContext) const tsdoc = useMemo(() => parse(page.tsdoc), [page.slug]) const fn = useMemo(() => findFn(tsdoc), [tsdoc]) - const description = useMemo(() => fn && findDescription(fn), [fn]) + const description = useMemo(() => fn && findFnDescription(fn), [fn]) const { usage, usageTabs } = useMemo(() => generateUsage(tsdoc.name), [tsdoc]) - const examples = useMemo(() => fn && findExamples(fn).map(extractCode), [fn]) + const signatures = fn && fn.signatures + const examples = useMemo(() => fn && findFnExamples(fn).map(extractCode), [ + fn, + ]) + const showTypesModal = useTypesModal() useEffect(() => { @@ -66,16 +70,7 @@ export const TSDoc: FunctionComponent = ({ page }) => { - {/* - - {page.syntax && } - {page.args && page.args.length > 0 && } - {page.content.properties && page.content.properties.length > 0 && ( - - )} - */} - - {fn && } + {signatures && } {examples && } diff --git a/yarn.lock b/yarn.lock index 78fc28e6..53341bea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -251,10 +251,10 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@date-fns/docs@0.12.1": - version "0.12.1" - resolved "https://registry.yarnpkg.com/@date-fns/docs/-/docs-0.12.1.tgz#b4bb23c5c24d29dcd1117052447a0c33183b1341" - integrity sha512-GZq6AOorzmy5MI1N/lqzK9YxMDKyFklaS2v8Nk6+dApComxT1IkL1dOLl1tqW3EzBdFSitbB5nrXNAuWAm1Wbg== +"@date-fns/docs@0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@date-fns/docs/-/docs-0.14.0.tgz#088936cfd144e1dcfc2421f661d6bf1bf0db7b17" + integrity sha512-5ntq8+wdqFUsqZRkoDK6IlhPKEotq6DavzwXwOGTbCi17t0iZPFnuqKFUxOh7Vje/yGLk/iSLSKj98T0JqzC4g== dependencies: firebase-admin "^11.4.1" js-fns "^2.5.2" From 015f9d190a998fd9fa159f67f5b0637c26c38009 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Tue, 24 Jan 2023 13:33:21 +0800 Subject: [PATCH 13/36] Advance types rendering, a lot of changes --- package.json | 2 +- src/ui/components/Code/index.tsx | 27 ++- src/ui/components/Code/styles.css.ts | 4 +- .../Finder => components/Item}/img/icon.svg | 0 src/ui/components/Item/index.tsx | 29 +++ src/ui/components/Item/styles.css.ts | 55 +++++ src/ui/components/ModalPortal/styles.css.ts | 23 ++ src/ui/components/RichText/index.tsx | 10 + src/ui/components/RichText/styles.css.ts | 148 ++++++++++++ src/ui/components/TypeDocInterface/index.tsx | 61 +++++ .../components/TypeDocInterface/styles.css.ts | 9 + .../{TSDocType => TypeDocType}/index.tsx | 29 ++- src/ui/components/TypeDocType/styles.css.ts | 5 + src/ui/screens/Docs/Doc/Content.tsx | 6 +- .../Docs/Doc/TSDoc/Arguments/index.tsx | 67 ------ .../Docs/Doc/TSDoc/Arguments/styles.css.ts | 5 - .../screens/Docs/Doc/TSDoc/Generics/index.tsx | 67 ------ .../Docs/Doc/TSDoc/Generics/styles.css.ts | 5 - .../screens/Docs/Doc/TSDoc/Syntax/index.tsx | 18 -- src/ui/screens/Docs/Doc/TSDoc/Types/index.tsx | 23 -- .../Docs/Doc/TSDoc/Types/styles.css.ts | 9 - .../Docs/Doc/TypeDoc/Arguments/index.tsx | 30 +++ .../Docs/Doc/TypeDoc/Generics/index.tsx | 30 +++ .../Doc/{TSDoc => TypeDoc}/Returns/index.tsx | 4 +- .../{TSDoc => TypeDoc}/Signature/index.tsx | 9 +- .../{TSDoc => TypeDoc}/Signatures/index.tsx | 8 +- .../Signatures/styles.css.ts | 0 .../screens/Docs/Doc/TypeDoc/Type/index.tsx | 122 ++++++++++ .../Docs/Doc/TypeDoc/Type/styles.css.ts | 5 + .../screens/Docs/Doc/TypeDoc/Types/index.tsx | 214 ++++++++++++++++++ .../Docs/Doc/TypeDoc/Types/styles.css.ts | 86 +++++++ .../Docs/Doc/{TSDoc => TypeDoc}/index.tsx | 18 +- src/ui/screens/Docs/Doc/index.tsx | 5 +- src/ui/screens/Docs/Doc/styles.css.ts | 144 ------------ src/ui/screens/Docs/Finder/Items.tsx | 17 +- src/ui/screens/Docs/Finder/styles.css.ts | 52 +---- yarn.lock | 8 +- 37 files changed, 925 insertions(+), 429 deletions(-) rename src/ui/{screens/Docs/Finder => components/Item}/img/icon.svg (100%) create mode 100644 src/ui/components/Item/index.tsx create mode 100644 src/ui/components/Item/styles.css.ts create mode 100644 src/ui/components/RichText/index.tsx create mode 100644 src/ui/components/RichText/styles.css.ts create mode 100644 src/ui/components/TypeDocInterface/index.tsx create mode 100644 src/ui/components/TypeDocInterface/styles.css.ts rename src/ui/components/{TSDocType => TypeDocType}/index.tsx (64%) create mode 100644 src/ui/components/TypeDocType/styles.css.ts delete mode 100644 src/ui/screens/Docs/Doc/TSDoc/Arguments/index.tsx delete mode 100644 src/ui/screens/Docs/Doc/TSDoc/Arguments/styles.css.ts delete mode 100644 src/ui/screens/Docs/Doc/TSDoc/Generics/index.tsx delete mode 100644 src/ui/screens/Docs/Doc/TSDoc/Generics/styles.css.ts delete mode 100644 src/ui/screens/Docs/Doc/TSDoc/Syntax/index.tsx delete mode 100644 src/ui/screens/Docs/Doc/TSDoc/Types/index.tsx delete mode 100644 src/ui/screens/Docs/Doc/TSDoc/Types/styles.css.ts create mode 100644 src/ui/screens/Docs/Doc/TypeDoc/Arguments/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TypeDoc/Generics/index.tsx rename src/ui/screens/Docs/Doc/{TSDoc => TypeDoc}/Returns/index.tsx (80%) rename src/ui/screens/Docs/Doc/{TSDoc => TypeDoc}/Signature/index.tsx (84%) rename src/ui/screens/Docs/Doc/{TSDoc => TypeDoc}/Signatures/index.tsx (84%) rename src/ui/screens/Docs/Doc/{TSDoc => TypeDoc}/Signatures/styles.css.ts (100%) create mode 100644 src/ui/screens/Docs/Doc/TypeDoc/Type/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TypeDoc/Type/styles.css.ts create mode 100644 src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts rename src/ui/screens/Docs/Doc/{TSDoc => TypeDoc}/index.tsx (84%) diff --git a/package.json b/package.json index 3e67dc4b..3b9a8f3f 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "start": "env NODE_ENV=development ts-node -r tsconfig-paths/register devServer.ts" }, "dependencies": { - "@date-fns/docs": "0.14.0", + "@date-fns/docs": "0.18.0", "@sentry/browser": "^5.30.0", "@sentry/tracing": "^5.30.0", "@switcher/preact": "2.3.0", diff --git a/src/ui/components/Code/index.tsx b/src/ui/components/Code/index.tsx index 57c61147..cf37a230 100644 --- a/src/ui/components/Code/index.tsx +++ b/src/ui/components/Code/index.tsx @@ -5,9 +5,34 @@ import './global.css?global' import * as styles from './styles.css' interface CodeProps { + value: string | JSX.Element +} +export const Code: FunctionComponent = ({ value }) => + typeof value === 'string' ? ( + + ) : ( + + ) + +interface CodeComponentProps { + value: JSX.Element +} + +export const CodeComponent: FunctionComponent = ({ + value, +}) => { + return ( +
    +      {value}
    +    
    + ) +} + +interface CodeHighlightProps { value: string } -export const Code: FunctionComponent = ({ value }) => { + +function CodeHighlight({ value }: CodeHighlightProps) { const html = Prism.highlight(value, Prism.languages.javascript, 'javascript') return ( diff --git a/src/ui/components/Code/styles.css.ts b/src/ui/components/Code/styles.css.ts index d7f33797..01068bb6 100644 --- a/src/ui/components/Code/styles.css.ts +++ b/src/ui/components/Code/styles.css.ts @@ -5,9 +5,11 @@ export const code = style({ color: '#5d583b', backgroundColor: '#fffffe', font: "13px Consolas, 'Liberation Mono', Menlo, Courier, monospace", + '::after': { display: 'none', }, + '::before': { display: 'none', }, @@ -17,5 +19,5 @@ export const pre = style({ overflowX: 'auto', border: '1px solid #b9a2b2', backgroundColor: '#fffffe', - padding: '4px 8px', + padding: '.25rem .5rem', }) diff --git a/src/ui/screens/Docs/Finder/img/icon.svg b/src/ui/components/Item/img/icon.svg similarity index 100% rename from src/ui/screens/Docs/Finder/img/icon.svg rename to src/ui/components/Item/img/icon.svg diff --git a/src/ui/components/Item/index.tsx b/src/ui/components/Item/index.tsx new file mode 100644 index 00000000..203874a2 --- /dev/null +++ b/src/ui/components/Item/index.tsx @@ -0,0 +1,29 @@ +import classNames from 'classnames' +import { Fragment, FunctionComponent, h } from 'preact' +import * as styles from './styles.css' + +interface Props { + title: string + summary: string | undefined + selected: boolean + code: boolean +} + +export const Item: FunctionComponent = ({ + title, + summary, + selected, + code, +}) => ( +
    +
    +

    + {title} +

    + + {styles.summary &&

    {summary}

    } +
    + +
    +
    +) diff --git a/src/ui/components/Item/styles.css.ts b/src/ui/components/Item/styles.css.ts new file mode 100644 index 00000000..699b74d4 --- /dev/null +++ b/src/ui/components/Item/styles.css.ts @@ -0,0 +1,55 @@ +import { style } from '@vanilla-extract/css' +import iconURL from './img/icon.svg' + +export const item = style({ + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + backgroundColor: 'rgba(255,255,255,0.65)', + padding: '0.5rem 1rem', + borderBottom: '1px solid #e6e0e6', + textDecoration: 'none', + + ':hover': { + background: '#fdf6f9', + }, +}) + +export const icon = style({ + backgroundImage: `url('${iconURL}')`, + backgroundSize: '16px', + width: '16px', + height: '16px', + flexShrink: '0', + marginLeft: '10px', +}) + +export const selected = style({ + backgroundColor: '#fff0f3', + + ':hover': { + backgroundColor: '#fff0f3', + }, +}) + +export const title = style({ + fontSize: '1rem', + marginBottom: '0.4px', + wordBreak: 'break-all', + color: '#4c193c', +}) + +export const codeTitle = style({ + fontFamily: 'monospace', +}) + +export const summary = style({ + fontWeight: '400', + fontSize: '0.9rem', + color: '#7b6d77', + display: '-webkit-box', + WebkitBoxOrient: 'vertical', + WebkitLineClamp: 2, + overflow: 'hidden', + wordBreak: 'break-all', +}) diff --git a/src/ui/components/ModalPortal/styles.css.ts b/src/ui/components/ModalPortal/styles.css.ts index 0c09888e..e105e441 100644 --- a/src/ui/components/ModalPortal/styles.css.ts +++ b/src/ui/components/ModalPortal/styles.css.ts @@ -34,6 +34,7 @@ export const windowBase = style({ color: '#4a3142', width: '100%', margin: '0 auto', + overflow: 'hidden', }) export const window = styleVariants({ @@ -50,6 +51,20 @@ export const window = styleVariants({ maxWidth: '50rem', }, ], + + large: [ + windowBase, + { + maxWidth: '60rem', + }, + ], + + xlarge: [ + windowBase, + { + maxWidth: '70rem', + }, + ], }) export const close = style({ @@ -73,6 +88,14 @@ export const close = style({ [`${window.medium} &`]: { marginLeft: '51rem', }, + + [`${window.large} &`]: { + marginLeft: '61rem', + }, + + [`${window.xlarge} &`]: { + marginLeft: '71rem', + }, }, }) diff --git a/src/ui/components/RichText/index.tsx b/src/ui/components/RichText/index.tsx new file mode 100644 index 00000000..d94e0c4d --- /dev/null +++ b/src/ui/components/RichText/index.tsx @@ -0,0 +1,10 @@ +import { ComponentChildren, FunctionComponent, h } from 'preact' +import * as styles from './styles.css' + +interface Props { + children: ComponentChildren +} + +export const RichText: FunctionComponent = ({ children }) => ( +
    {children}
    +) diff --git a/src/ui/components/RichText/styles.css.ts b/src/ui/components/RichText/styles.css.ts new file mode 100644 index 00000000..1718f999 --- /dev/null +++ b/src/ui/components/RichText/styles.css.ts @@ -0,0 +1,148 @@ +import { style, globalStyle } from '@vanilla-extract/css' + +export const content = style({ + fontSize: '1rem', + lineHeight: '1.6em', +}) + +globalStyle(`${content} a`, { + color: '#5d3861', +}) + +globalStyle(`${content} h1`, { + color: '#770c56', + fontSize: '2.3rem', + marginBottom: '30px', + paddingBottom: '23px', + borderBottom: '1px solid rgba(88,68,82,0.1)', +}) + +globalStyle(`${content} h2`, { + color: '#4a3142', + fontSize: '1.3rem', + marginBottom: '15px', + paddingBottom: '10px', + marginTop: '30px', + borderBottom: '1px solid rgba(88,68,82,0.1)', +}) + +globalStyle(`${content} h3`, { + color: '#4a3142', + fontWeight: '500', + fontSize: '1.2rem', + marginBottom: '20px', + marginTop: '20px', +}) + +globalStyle(`${content} ol`, { + listStyle: 'decimal', + maxWidth: '700px', + marginLeft: '25px', + marginBottom: '10px', +}) + +globalStyle(`${content} ol ol`, { + marginBottom: '0', +}) + +globalStyle(`${content} ol p + ul`, { + marginTop: '-10px', +}) + +globalStyle(`${content} ol pre:last-child`, { + marginBottom: '10px', +}) + +globalStyle(`${content} ol ul`, { + marginBottom: '0', +}) + +globalStyle(`${content} ol:last-child`, { + marginBottom: '0', +}) + +globalStyle(`${content} p`, { + marginBottom: '10px', + maxWidth: '700px', +}) + +globalStyle(`${content} p:empty`, { + display: 'none', +}) + +globalStyle(`${content} p:last-child`, { + marginBottom: '0', +}) + +globalStyle(`${content} pre`, { + marginBottom: '10px', +}) + +globalStyle(`${content} pre:last-child`, { + marginBottom: '0', +}) + +globalStyle(`${content} table`, { + backgroundColor: '#fffffe', + borderRadius: '2px', + marginBottom: '10px', +}) + +globalStyle(`${content} table table`, { + fontSize: '14px', +}) + +globalStyle(`${content} table table td`, { + border: '1px solid #d6cdd3', + padding: '3px 6px', +}) + +globalStyle(`${content} table table th`, { + backgroundColor: '#fdfdfd', + border: '1px solid #d6cdd3', + padding: '3px 6px', +}) + +globalStyle(`${content} table td`, { + border: '1px solid #b9a2b2', + padding: '5px 10px', +}) + +globalStyle(`${content} table th`, { + border: '1px solid #b9a2b2', + padding: '5px 10px', + fontWeight: '600', + textAlign: 'left', + backgroundColor: '#faf6f0', +}) + +globalStyle(`${content} table:last-child`, { + marginBottom: '0', +}) + +globalStyle(`${content} ul`, { + listStyle: 'disc', + maxWidth: '700px', + marginLeft: '25px', + marginBottom: '10px', +}) + +globalStyle(`${content} ul ol`, { + marginBottom: '0', +}) + +globalStyle(`${content} ul p + ul`, { + marginTop: '-10px', +}) + +globalStyle(`${content} ul pre:last-child`, { + marginBottom: '10px', +}) + +globalStyle(`${content} ul ul`, { + marginBottom: '0', +}) + +globalStyle(`${content} ul:last-child`, { + marginBottom: '0', +}) diff --git a/src/ui/components/TypeDocInterface/index.tsx b/src/ui/components/TypeDocInterface/index.tsx new file mode 100644 index 00000000..d3874e0b --- /dev/null +++ b/src/ui/components/TypeDocInterface/index.tsx @@ -0,0 +1,61 @@ +import { joinCommentParts } from '@date-fns/docs/utils' +import { FunctionComponent, h } from 'preact' +import type { + DeclarationReflection, + ParameterReflection, + TypeParameterReflection, +} from 'typedoc' +import { Markdown } from '../Markdown' +import { TypeDocType } from '../TypeDocType' +import * as styles from './styles.css' + +interface TypeDocInterfaceProps { + list: + | ParameterReflection[] + | DeclarationReflection[] + | TypeParameterReflection[] +} + +export const TypeDocInterface: FunctionComponent = ({ + list, +}) => { + return ( + + + + + + + + + + + {list.map((item, index) => ( + + + + + + + + ))} + +
    NameTypeDescription
    + {item.name} + + {item.flags.isOptional && ( +
    (optional)
    + )} +
    + {item.type && } + + {item.comment?.summary && ( + + )} + + +
    {JSON.stringify(item, null, 2)}
    +
    +
    + ) +} diff --git a/src/ui/components/TypeDocInterface/styles.css.ts b/src/ui/components/TypeDocInterface/styles.css.ts new file mode 100644 index 00000000..3f21f1c8 --- /dev/null +++ b/src/ui/components/TypeDocInterface/styles.css.ts @@ -0,0 +1,9 @@ +import { style } from '@vanilla-extract/css' + +export const code = style({ + fontFamily: 'monospace', +}) + +export const optional = style({ + fontStyle: 'italic', +}) diff --git a/src/ui/components/TSDocType/index.tsx b/src/ui/components/TypeDocType/index.tsx similarity index 64% rename from src/ui/components/TSDocType/index.tsx rename to src/ui/components/TypeDocType/index.tsx index dccdfe2c..20b46de9 100644 --- a/src/ui/components/TSDocType/index.tsx +++ b/src/ui/components/TypeDocType/index.tsx @@ -1,29 +1,28 @@ import { FunctionComponent, h } from 'preact' import type { SomeType } from 'typedoc' +import * as styles from './styles.css' interface Props { type: SomeType } -export const TSDocType: FunctionComponent = ({ type }) => { - // console.log({ type }) - +export const TypeDocType: FunctionComponent = ({ type }) => { switch (type.type) { case 'intrinsic': - return {type.name} + return {type.name} case 'array': return ( - + Array{'<'} - + {'>'} ) case 'reference': return ( - +
    = ({ type }) => { ) + case 'union': + return ( + + {type.types.map((t, index) => ( + + + {index < type.types.length - 1 && ' | '} + + ))} + + ) + + case 'literal': + return {JSON.stringify(type.value)} + case 'reflection': case 'query': case 'predicate': @@ -45,7 +59,6 @@ export const TSDocType: FunctionComponent = ({ type }) => { case 'tuple': case 'union': case 'intersection': - case 'literal': case 'typeOperator': case 'template-literal': case 'named-tuple-member': diff --git a/src/ui/components/TypeDocType/styles.css.ts b/src/ui/components/TypeDocType/styles.css.ts new file mode 100644 index 00000000..b8fec085 --- /dev/null +++ b/src/ui/components/TypeDocType/styles.css.ts @@ -0,0 +1,5 @@ +import { style } from '@vanilla-extract/css' + +export const code = style({ + fontFamily: 'monospace', +}) diff --git a/src/ui/screens/Docs/Doc/Content.tsx b/src/ui/screens/Docs/Doc/Content.tsx index 3efe301d..4b19e500 100644 --- a/src/ui/screens/Docs/Doc/Content.tsx +++ b/src/ui/screens/Docs/Doc/Content.tsx @@ -3,7 +3,7 @@ import type { DateFnsDocs } from '@date-fns/docs/types' import { parse } from 'typeroo/json' import { JSDoc } from './JSDoc' import { MarkdownDoc } from './MarkdownDoc' -import { TSDoc } from './TSDoc' +import { TypeDoc } from './TypeDoc' interface Props { page: DateFnsDocs.Page @@ -11,8 +11,8 @@ interface Props { export const Content: FunctionComponent = ({ page }) => { switch (page.type) { - case 'tsdoc': - return + case 'typedoc': + return case 'jsdoc': return diff --git a/src/ui/screens/Docs/Doc/TSDoc/Arguments/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Arguments/index.tsx deleted file mode 100644 index c667e3fd..00000000 --- a/src/ui/screens/Docs/Doc/TSDoc/Arguments/index.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import { h, FunctionComponent, Fragment } from 'preact' -import type { DateFnsDocs } from '@date-fns/docs/types' -import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' -import type { ParameterReflection } from 'typedoc' -import { TSDocType } from '~/ui/components/TSDocType' -import { Markdown } from '~/ui/components/Markdown' -import { joinCommentParts } from '@date-fns/docs/utils' -import * as styles from './styles.css' - -interface Props { - args: ParameterReflection[] - header: 'h2' | 'h3' -} - -export const Arguments: FunctionComponent = ({ args, header }) => { - const headerContent = ( - <> - Arguments - - - ) - - return ( -
    - {header === 'h2' ? ( -

    {headerContent}

    - ) : ( -

    {headerContent}

    - )} - - - - - - - - - - - - {args.map((arg, index) => ( - - - - - - - - ))} - -
    NameTypeDescription
    - {arg.name} - - {arg.flags.isOptional && ( -
    (optional)
    - )} -
    {arg.type && } - {arg.comment?.summary && ( - - )} - -
    {JSON.stringify(arg, null, 2)}
    -
    -
    -
    - ) -} diff --git a/src/ui/screens/Docs/Doc/TSDoc/Arguments/styles.css.ts b/src/ui/screens/Docs/Doc/TSDoc/Arguments/styles.css.ts deleted file mode 100644 index d971530f..00000000 --- a/src/ui/screens/Docs/Doc/TSDoc/Arguments/styles.css.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { style } from '@vanilla-extract/css' - -export const optionalLabel = style({ - fontStyle: 'italic', -}) diff --git a/src/ui/screens/Docs/Doc/TSDoc/Generics/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Generics/index.tsx deleted file mode 100644 index 4f35c8e2..00000000 --- a/src/ui/screens/Docs/Doc/TSDoc/Generics/index.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import { h, FunctionComponent, Fragment } from 'preact' -import type { DateFnsDocs } from '@date-fns/docs/types' -import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' -import type { ParameterReflection, TypeParameterReflection } from 'typedoc' -import { TSDocType } from '~/ui/components/TSDocType' -import { Markdown } from '~/ui/components/Markdown' -import { joinCommentParts } from '@date-fns/docs/utils' -import * as styles from './styles.css' - -interface Props { - args: TypeParameterReflection[] - header: 'h2' | 'h3' -} - -export const Generics: FunctionComponent = ({ args, header }) => { - const headerContent = ( - <> - Generics - - - ) - - return ( -
    - {header === 'h2' ? ( -

    {headerContent}

    - ) : ( -

    {headerContent}

    - )} - - - - - - - - - - - - {args.map((arg, index) => ( - - - - - - - - ))} - -
    NameTypeDescription
    - {arg.name} - - {arg.flags.isOptional && ( -
    (optional)
    - )} -
    {arg.type && } - {arg.comment?.summary && ( - - )} - -
    {JSON.stringify(arg, null, 2)}
    -
    -
    -
    - ) -} diff --git a/src/ui/screens/Docs/Doc/TSDoc/Generics/styles.css.ts b/src/ui/screens/Docs/Doc/TSDoc/Generics/styles.css.ts deleted file mode 100644 index d971530f..00000000 --- a/src/ui/screens/Docs/Doc/TSDoc/Generics/styles.css.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { style } from '@vanilla-extract/css' - -export const optionalLabel = style({ - fontStyle: 'italic', -}) diff --git a/src/ui/screens/Docs/Doc/TSDoc/Syntax/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Syntax/index.tsx deleted file mode 100644 index 993117d3..00000000 --- a/src/ui/screens/Docs/Doc/TSDoc/Syntax/index.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { h, FunctionComponent } from 'preact' -import { Code } from '~/ui/components/Code' -import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' - -interface Props { - syntax: string -} - -export const Syntax: FunctionComponent = ({ syntax }) => ( -
    -

    - Syntax - -

    - - -
    -) diff --git a/src/ui/screens/Docs/Doc/TSDoc/Types/index.tsx b/src/ui/screens/Docs/Doc/TSDoc/Types/index.tsx deleted file mode 100644 index dc091168..00000000 --- a/src/ui/screens/Docs/Doc/TSDoc/Types/index.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { h } from 'preact' -import { DeclarationReflection } from 'typedoc' -import { createModal } from '~/ui/components/Modals' -import * as styles from './styles.css' - -export interface TypesModalProps { - typeId: number - tsdoc: DeclarationReflection -} - -export const useTypesModal = createModal( - ({ typeId, tsdoc }) => { - return ( -
    -
    -
    TODO: Navigation
    -
    TODO: Content
    -
    -
    - ) - }, - { size: 'medium', closeOnOverlayClick: true } -) diff --git a/src/ui/screens/Docs/Doc/TSDoc/Types/styles.css.ts b/src/ui/screens/Docs/Doc/TSDoc/Types/styles.css.ts deleted file mode 100644 index 00e88670..00000000 --- a/src/ui/screens/Docs/Doc/TSDoc/Types/styles.css.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { style } from '@vanilla-extract/css' - -export const wrapper = style({}) - -export const inner = style({}) - -export const nav = style({}) - -export const content = style({}) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Arguments/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Arguments/index.tsx new file mode 100644 index 00000000..4cdc4bf1 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TypeDoc/Arguments/index.tsx @@ -0,0 +1,30 @@ +import { Fragment, FunctionComponent, h } from 'preact' +import type { ParameterReflection } from 'typedoc' +import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import { TypeDocInterface } from '~/ui/components/TypeDocInterface' + +interface Props { + args: ParameterReflection[] + header: 'h2' | 'h3' +} + +export const Arguments: FunctionComponent = ({ args, header }) => { + const headerContent = ( + <> + Arguments + + + ) + + return ( +
    + {header === 'h2' ? ( +

    {headerContent}

    + ) : ( +

    {headerContent}

    + )} + + +
    + ) +} diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Generics/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Generics/index.tsx new file mode 100644 index 00000000..4332ff71 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TypeDoc/Generics/index.tsx @@ -0,0 +1,30 @@ +import { Fragment, FunctionComponent, h } from 'preact' +import type { TypeParameterReflection } from 'typedoc' +import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import { TypeDocInterface } from '~/ui/components/TypeDocInterface' + +interface Props { + args: TypeParameterReflection[] + header: 'h2' | 'h3' +} + +export const Generics: FunctionComponent = ({ args, header }) => { + const headerContent = ( + <> + Generics + + + ) + + return ( +
    + {header === 'h2' ? ( +

    {headerContent}

    + ) : ( +

    {headerContent}

    + )} + + +
    + ) +} diff --git a/src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Returns/index.tsx similarity index 80% rename from src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx rename to src/ui/screens/Docs/Doc/TypeDoc/Returns/index.tsx index 1da13871..2a56ab97 100644 --- a/src/ui/screens/Docs/Doc/TSDoc/Returns/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Returns/index.tsx @@ -1,7 +1,7 @@ import { FunctionComponent, h } from 'preact' import type { SomeType } from 'typedoc' import { DocReturns } from '~/ui/components/DocReturns' -import { TSDocType } from '~/ui/components/TSDocType' +import { TypeDocType } from '~/ui/components/TypeDocType' interface Props { type: SomeType | undefined @@ -18,7 +18,7 @@ export const Returns: FunctionComponent = ({ , + type: type && , description, }, ]} diff --git a/src/ui/screens/Docs/Doc/TSDoc/Signature/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Signature/index.tsx similarity index 84% rename from src/ui/screens/Docs/Doc/TSDoc/Signature/index.tsx rename to src/ui/screens/Docs/Doc/TypeDoc/Signature/index.tsx index d4082a10..f4507e90 100644 --- a/src/ui/screens/Docs/Doc/TSDoc/Signature/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Signature/index.tsx @@ -5,13 +5,16 @@ import type { SignatureReflection, TypeParameterReflection } from 'typedoc' import { Arguments } from '../Arguments' import { Generics } from '../Generics' import { Returns } from '../Returns' +import { Type } from '../Type' interface SignatureProps { + name: string signature: SignatureReflection header: 'h2' | 'h3' } export const Signature: FunctionComponent = ({ + name, signature, header, }) => { @@ -24,10 +27,10 @@ export const Signature: FunctionComponent = ({ return ( <> - {/*page.syntax && */} + - {signature.typeParameters && ( - + {signature.typeParameter && ( + )} {signature.parameters && signature.parameters.length > 0 && ( diff --git a/src/ui/screens/Docs/Doc/TSDoc/Signatures/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Signatures/index.tsx similarity index 84% rename from src/ui/screens/Docs/Doc/TSDoc/Signatures/index.tsx rename to src/ui/screens/Docs/Doc/TypeDoc/Signatures/index.tsx index 0e3ba18e..8bda4ea7 100644 --- a/src/ui/screens/Docs/Doc/TSDoc/Signatures/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Signatures/index.tsx @@ -6,10 +6,12 @@ import { Signature } from '../Signature' import * as styles from './styles.css' interface SignaturesProps { + name: string signatures: SignatureReflection[] } export const Signatures: FunctionComponent = ({ + name, signatures, }) => { const solo = signatures.length === 1 @@ -28,7 +30,11 @@ export const Signatures: FunctionComponent = ({ class={classNames(styles.signature, !solo && styles.multiSignature)} key={index} > - +
    ))}
    diff --git a/src/ui/screens/Docs/Doc/TSDoc/Signatures/styles.css.ts b/src/ui/screens/Docs/Doc/TypeDoc/Signatures/styles.css.ts similarity index 100% rename from src/ui/screens/Docs/Doc/TSDoc/Signatures/styles.css.ts rename to src/ui/screens/Docs/Doc/TypeDoc/Signatures/styles.css.ts diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Type/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Type/index.tsx new file mode 100644 index 00000000..d5c3956a --- /dev/null +++ b/src/ui/screens/Docs/Doc/TypeDoc/Type/index.tsx @@ -0,0 +1,122 @@ +import classNames from 'classnames' +import { Fragment, FunctionComponent, h } from 'preact' +import type { + ParameterReflection, + SignatureReflection, + TypeParameterReflection, +} from 'typedoc' +import { Code } from '~/ui/components/Code' +import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import { TypeDocType } from '~/ui/components/TypeDocType' +import * as styles from './styles.css' + +interface TypeProps { + name: string + signature: SignatureReflection + header: 'h2' | 'h3' +} + +export const Type: FunctionComponent = ({ + name, + signature, + header, +}) => { + const headerContent = ( + <> + Type + + + ) + + const withArgs = signature.parameters && signature.parameters.length > 0 + + return ( +
    + {header === 'h2' ? ( +

    {headerContent}

    + ) : ( +

    {headerContent}

    + )} + + + + function {name} + {signature.typeParameter && ( + + )} + ( + + + {signature.parameters && } + + + ) + {signature.type && ( + + : + + )} + ; + + + } + /> +
    + ) +} + +interface GenericsProps { + params: TypeParameterReflection[] +} + +function Generics({ params }: GenericsProps) { + return ( + + {'<'} + {params.map((param, index) => ( + +
    {param.name} + {param.type && ( + + {' '} + extends + + )} + {param.default && ( + + {' '} + = + + )} + {index < params.length - 1 && ', '} + + ))} + {'>'} + + ) +} + +interface ArgumentsProps { + args: ParameterReflection[] +} + +function Arguments({ args }: ArgumentsProps) { + return ( + <> + {args.map((arg) => ( +
    + {' '} + {arg.name} + {arg.type && ( + + : + + )} + {arg.defaultValue && = {arg.defaultValue}} +
    + ))} + + ) +} diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Type/styles.css.ts b/src/ui/screens/Docs/Doc/TypeDoc/Type/styles.css.ts new file mode 100644 index 00000000..54dbffca --- /dev/null +++ b/src/ui/screens/Docs/Doc/TypeDoc/Type/styles.css.ts @@ -0,0 +1,5 @@ +import { style } from '@vanilla-extract/css' + +export const withArgs = style({ + display: 'block', +}) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx new file mode 100644 index 00000000..eb0849ff --- /dev/null +++ b/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx @@ -0,0 +1,214 @@ +import { joinCommentParts } from '@date-fns/docs/utils' +import { h } from 'preact' +import { useMemo } from 'preact/hooks' +import type { DeclarationReflection } from 'typedoc' +import { TypeDocInterface } from '~/ui/components/TypeDocInterface' +import { Item } from '~/ui/components/Item' +import { Markdown } from '~/ui/components/Markdown' +import { createModal } from '~/ui/components/Modals' +import { RichText } from '~/ui/components/RichText' +import { TypeDocType } from '~/ui/components/TypeDocType' +import * as styles from './styles.css' + +export interface TypesModalProps { + typeId: number + doc: DeclarationReflection +} + +export const useTypesModal = createModal( + ({ typeId, doc }) => { + const types = useMemo(() => extractTypes(doc), [doc]) + const map = useMemo(() => buildMap(types), [types]) + const type = map[typeId] + + console.log('>>> TYPE', type) + + return ( +
    +
    + {types.map((type) => ( + + + + ))} +
    + + {type ? ( +
    +

    + {type.name}{' '} + {type.kindString && ( + + {kindToBadgeTitle(type.kindString)} + + )} +

    + + {type.comment?.summary && ( + +
    + +
    +
    + )} + + + {type.type && ( +
    +

    Type

    + +
    + +
    +
    + )} + + {type.typeParameters && ( +
    +

    Generics

    + + +
    + )} + + +
    + + +
    {JSON.stringify(type, null, 2)}
    +
    +
    + ) : ( +
    + The type definition is not found. If you see this,{' '} + ping me. +
    + )} +
    + ) + }, + { size: 'xlarge', closeOnOverlayClick: true } +) + +interface ContentProps { + type: DeclarationReflection +} + +function TypeContent({ type }: ContentProps) { + switch (type.kindString) { + case 'Interface': + if (!type.children?.length) return null + + return ( +
    +

    Interface

    + +
    + ) + + case 'Type parameter': + return ( +
    + {type.default && ( +
    +

    Default type

    + +
    + +
    +
    + )} +
    + ) + + default: + return null + } +} + +function extractTypes( + dec: DeclarationReflection, + acc?: DeclarationReflection[] +): DeclarationReflection[] { + const types = acc || [] + + dec.children?.forEach((child) => { + switch (child.kindString) { + // Ignore these types and their children + case 'Module': + return + + // Process function singatures and add their type parameters + case 'Function': + child.signatures?.forEach((signature) => { + // @ts-ignore: For some reason TypeDoc contains the error, it's typeParameter not typeParameters + signature.typeParameter?.forEach((param) => types.push(param)) + }) + return + + // Add these types, but not process their children + case 'Interface': + case 'Type alias': + types.push(child) + return + + default: + console.log('~~~ UNHANDLED TYPE', child.kindString, child) + } + + if (child.children) extractTypes(child, types) + }) + + return types +} + +function buildMap(types: DeclarationReflection[]) { + const map: Record = {} + + types.forEach((type) => { + map[type.id] = type + }) + + return map +} + +function kindToBadgeStyle(kindString: string): keyof typeof styles.badge { + switch (kindString) { + case 'Type alias': + return 'alias' + + case 'Interface': + return 'interface' + + case 'Type parameter': + return 'generic' + + default: + return 'alias' + } +} + +function kindToBadgeTitle(kindString: string): string { + switch (kindString) { + case 'Type alias': + return 'Alias' + + case 'Interface': + return 'Interface' + + case 'Type parameter': + return 'Generic' + + default: + return 'TODO' + } +} diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts b/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts new file mode 100644 index 00000000..187c6d29 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts @@ -0,0 +1,86 @@ +import { globalStyle, style, styleVariants } from '@vanilla-extract/css' + +export const badgeBase = style({ + fontSize: '1.1rem', + padding: '.1rem .3rem', + borderRadius: '5px', + border: '1px solid black', + verticalAlign: 'top', +}) + +export const badge = styleVariants({ + alias: [ + badgeBase, + { + color: '#146066', + borderColor: '#5ae6f1', + backgroundColor: '#d5fcff', + }, + ], + + interface: [ + badgeBase, + { + color: '#004813', + borderColor: '#9dbfa6', + backgroundColor: '#e2f7e8', + }, + ], + + generic: [ + badgeBase, + { + color: '#786c07', + borderColor: '#ddd491', + backgroundColor: '#fffad7', + }, + ], +}) + +export const wrapper = style({ + display: 'grid', + gridTemplateColumns: '23rem auto', + maxHeight: '50rem', + gridTemplateRows: '1fr', +}) + +export const item = style({ + textDecoration: 'none', +}) + +export const nav = style({ + borderRight: '1px solid #e6e0e6', + overflowY: 'auto', +}) + +export const content = style({ + padding: '2rem', + overflowY: 'auto', +}) + +globalStyle(`${content} h3`, { + marginBottom: '1rem', + paddingBottom: '0.5rem', + borderBottom: '1px solid #5844521a', +}) + +export const header = style({ + color: '#770c56', + fontSize: '1.5rem', + marginBottom: '1rem', + fontFamily: 'monospace', + paddingBottom: '1rem', + borderBottom: '1px solid #5844521a', +}) + +export const summary = style({ + fontSize: '1rem', +}) + +export const code = style({ + overflowX: 'auto', + border: '1px solid #b9a2b2', + backgroundColor: '#fffffe', + padding: '.25rem .5rem', + fontFamily: 'monospace', +}) diff --git a/src/ui/screens/Docs/Doc/TSDoc/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/index.tsx similarity index 84% rename from src/ui/screens/Docs/Doc/TSDoc/index.tsx rename to src/ui/screens/Docs/Doc/TypeDoc/index.tsx index afacdde6..43fdd52b 100644 --- a/src/ui/screens/Docs/Doc/TSDoc/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/index.tsx @@ -13,18 +13,18 @@ import { RouterContext } from '~/ui/router' import { Signatures } from './Signatures' import { useTypesModal } from './Types' -interface Props { - page: DateFnsDocs.TSDocPage +interface TypeDocProps { + page: DateFnsDocs.TypeDocPage } const typeHashRE = /types\/(\w+)\/(\w+)/ -export const TSDoc: FunctionComponent = ({ page }) => { +export const TypeDoc: FunctionComponent = ({ page }) => { const { location, navigate } = useContext(RouterContext) - const tsdoc = useMemo(() => parse(page.tsdoc), [page.slug]) - const fn = useMemo(() => findFn(tsdoc), [tsdoc]) + const doc = useMemo(() => parse(page.doc), [page.slug]) + const fn = useMemo(() => findFn(doc), [doc]) const description = useMemo(() => fn && findFnDescription(fn), [fn]) - const { usage, usageTabs } = useMemo(() => generateUsage(tsdoc.name), [tsdoc]) + const { usage, usageTabs } = useMemo(() => generateUsage(doc.name), [doc]) const signatures = fn && fn.signatures const examples = useMemo(() => fn && findFnExamples(fn).map(extractCode), [ fn, @@ -44,7 +44,7 @@ export const TSDoc: FunctionComponent = ({ page }) => { showTypesModal({ typeId, - tsdoc, + doc, onClose: () => { // TODO: Fix Switcher to allow replacing the current location if (location.name === '404') return @@ -70,12 +70,12 @@ export const TSDoc: FunctionComponent = ({ page }) => { - {signatures && } + {signatures && } {examples && } -
    {JSON.stringify(tsdoc, null, 2)}
    +
    {JSON.stringify(doc, null, 2)}
    diff --git a/src/ui/screens/Docs/Doc/index.tsx b/src/ui/screens/Docs/Doc/index.tsx index fd0edead..0cd0990b 100644 --- a/src/ui/screens/Docs/Doc/index.tsx +++ b/src/ui/screens/Docs/Doc/index.tsx @@ -4,6 +4,7 @@ import type { DateFnsDocs } from '@date-fns/docs/types' import { useRead } from '@typesaurus/preact' import { FunctionComponent, h } from 'preact' import { useEffect } from 'preact/hooks' +import { RichText } from '~/ui/components/RichText' import { DocLinkContext } from '~/ui/router/DocLinkContext' import { Content } from './Content' import * as styles from './styles.css' @@ -52,7 +53,9 @@ export const Doc: FunctionComponent = ({ value={{ version: selectedVersion, submodule: selectedSubmodule }} >
    - + + +
    ) diff --git a/src/ui/screens/Docs/Doc/styles.css.ts b/src/ui/screens/Docs/Doc/styles.css.ts index 8e48d367..df8cc46b 100644 --- a/src/ui/screens/Docs/Doc/styles.css.ts +++ b/src/ui/screens/Docs/Doc/styles.css.ts @@ -4,150 +4,6 @@ export const container = style({ padding: '30px', color: '#4a3142', backgroundColor: '#fffdf9', - fontSize: '16px', - lineHeight: '1.6em', width: '100%', minHeight: '100%', }) - -globalStyle(`${container} a`, { - color: '#5d3861', -}) - -globalStyle(`${container} h1`, { - color: '#770c56', - fontSize: '2.3rem', - marginBottom: '30px', - paddingBottom: '23px', - borderBottom: '1px solid rgba(88,68,82,0.1)', -}) - -globalStyle(`${container} h2`, { - color: '#4a3142', - fontSize: '1.3rem', - marginBottom: '15px', - paddingBottom: '10px', - marginTop: '30px', - borderBottom: '1px solid rgba(88,68,82,0.1)', -}) - -globalStyle(`${container} h3`, { - color: '#4a3142', - fontWeight: '500', - fontSize: '1.2rem', - marginBottom: '20px', - marginTop: '20px', -}) - -globalStyle(`${container} ol`, { - listStyle: 'decimal', - maxWidth: '700px', - marginLeft: '25px', - marginBottom: '10px', -}) - -globalStyle(`${container} ol ol`, { - marginBottom: '0', -}) - -globalStyle(`${container} ol p + ul`, { - marginTop: '-10px', -}) - -globalStyle(`${container} ol pre:last-child`, { - marginBottom: '10px', -}) - -globalStyle(`${container} ol ul`, { - marginBottom: '0', -}) - -globalStyle(`${container} ol:last-child`, { - marginBottom: '0', -}) - -globalStyle(`${container} p`, { - marginBottom: '10px', - maxWidth: '700px', -}) - -globalStyle(`${container} p:empty`, { - display: 'none', -}) - -globalStyle(`${container} p:last-child`, { - marginBottom: '0', -}) - -globalStyle(`${container} pre`, { - marginBottom: '10px', -}) - -globalStyle(`${container} pre:last-child`, { - marginBottom: '0', -}) - -globalStyle(`${container} table`, { - backgroundColor: '#fffffe', - borderRadius: '2px', - marginBottom: '10px', -}) - -globalStyle(`${container} table table`, { - fontSize: '14px', -}) - -globalStyle(`${container} table table td`, { - border: '1px solid #d6cdd3', - padding: '3px 6px', -}) - -globalStyle(`${container} table table th`, { - backgroundColor: '#fdfdfd', - border: '1px solid #d6cdd3', - padding: '3px 6px', -}) - -globalStyle(`${container} table td`, { - border: '1px solid #b9a2b2', - padding: '5px 10px', -}) - -globalStyle(`${container} table th`, { - border: '1px solid #b9a2b2', - padding: '5px 10px', - fontWeight: '600', - textAlign: 'left', - backgroundColor: '#faf6f0', -}) - -globalStyle(`${container} table:last-child`, { - marginBottom: '0', -}) - -globalStyle(`${container} ul`, { - listStyle: 'disc', - maxWidth: '700px', - marginLeft: '25px', - marginBottom: '10px', -}) - -globalStyle(`${container} ul ol`, { - marginBottom: '0', -}) - -globalStyle(`${container} ul p + ul`, { - marginTop: '-10px', -}) - -globalStyle(`${container} ul pre:last-child`, { - marginBottom: '10px', -}) - -globalStyle(`${container} ul ul`, { - marginBottom: '0', -}) - -globalStyle(`${container} ul:last-child`, { - marginBottom: '0', -}) diff --git a/src/ui/screens/Docs/Finder/Items.tsx b/src/ui/screens/Docs/Finder/Items.tsx index 0a271704..4af3ab7a 100644 --- a/src/ui/screens/Docs/Finder/Items.tsx +++ b/src/ui/screens/Docs/Finder/Items.tsx @@ -3,6 +3,7 @@ import type { DateFnsDocs } from '@date-fns/docs/types' import { RouterLink } from '~/ui/router' import { docLink } from '~/ui/router/docLink' import * as styles from './styles.css' +import { Item } from '~/ui/components/Item' interface Props { pages: DateFnsDocs.PagePreview[] @@ -29,15 +30,17 @@ export const Items: FunctionComponent = ({ submodule: selectedSubmodule, version: selectedVersion, })} - isSelected={selectedPage === page.slug} onClick={onNavigate} > -
    -

    {page.title}

    -

    {page.summary}

    -
    - -
    + ))} diff --git a/src/ui/screens/Docs/Finder/styles.css.ts b/src/ui/screens/Docs/Finder/styles.css.ts index 2021a16e..87ef2303 100644 --- a/src/ui/screens/Docs/Finder/styles.css.ts +++ b/src/ui/screens/Docs/Finder/styles.css.ts @@ -1,5 +1,4 @@ import { style } from '@vanilla-extract/css' -import iconURL from './img/icon.svg' import cancelURL from './img/cancel.svg' export const categoriesList = style({ @@ -40,44 +39,6 @@ export const content = style({ overflowX: 'hidden', }) -export const item = style({ - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', - backgroundColor: 'rgba(255,255,255,0.65)', - padding: '0.5rem 1rem', - borderBottom: '1px solid #e6e0e6', - textDecoration: 'none', - ':hover': { - background: '#fdf6f9', - }, -}) - -export const itemIcon = style({ - backgroundImage: `url('${iconURL}')`, - backgroundSize: '16px', - width: '16px', - height: '16px', - flexShrink: '0', - marginLeft: '10px', -}) - -export const itemIsSelected = style({ - backgroundColor: '#fff0f3', - - ':hover': { - backgroundColor: '#fff0f3', - }, -}) - -export const itemText = style({ - fontWeight: '400', - fontSize: '0.9rem', - color: '#7b6d77', -}) - -export const itemTypeJsdoc = style({}) - export const loading = style({ padding: '30px', }) @@ -139,15 +100,6 @@ export const widgetContainer = style({ flex: 'none', }) -export const itemHeader = style({ - fontSize: '1rem', - marginBottom: '0.4px', - wordBreak: 'break-all', - color: '#4c193c', - - selectors: { - [`${itemTypeJsdoc} &`]: { - fontFamily: 'monospace', - }, - }, +export const item = style({ + textDecoration: 'none', }) diff --git a/yarn.lock b/yarn.lock index 53341bea..b5522ba4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -251,10 +251,10 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@date-fns/docs@0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@date-fns/docs/-/docs-0.14.0.tgz#088936cfd144e1dcfc2421f661d6bf1bf0db7b17" - integrity sha512-5ntq8+wdqFUsqZRkoDK6IlhPKEotq6DavzwXwOGTbCi17t0iZPFnuqKFUxOh7Vje/yGLk/iSLSKj98T0JqzC4g== +"@date-fns/docs@0.18.0": + version "0.18.0" + resolved "https://registry.yarnpkg.com/@date-fns/docs/-/docs-0.18.0.tgz#65fe9f2f7c232069de61c3d74a1fb2a7b4c9cdca" + integrity sha512-0Rxwc7RSQ6mYu9+1b5QOAMRlKhFLahqfYQvB5tqJOXGIDO/L7PGM5q1NwZ1fXydEFFabwxaetLpO4ZV+PAjqKw== dependencies: firebase-admin "^11.4.1" js-fns "^2.5.2" From f529acb199c592516994767d3521648ac93bfb5f Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Wed, 25 Jan 2023 07:41:02 +0800 Subject: [PATCH 14/36] TSDoc -> TypeDoc, constants, latest @date-fns/docs --- package.json | 2 +- src/ui/components/DocDescription/index.tsx | 32 ++++++++ src/ui/components/DocExamples/index.tsx | 43 ++++++---- src/ui/components/DocLinks/index.tsx | 2 - src/ui/components/DocLinks/styles.css.ts | 6 -- src/ui/components/RichText/styles.css.ts | 7 ++ src/ui/screens/Docs/Doc/JSDoc/index.tsx | 10 +-- .../Docs/Doc/TypeDoc/Constants/index.tsx | 80 +++++++++++++++++++ .../Docs/Doc/TypeDoc/Constants/styles.css.ts | 5 ++ .../{ => Function}/Arguments/index.tsx | 0 .../TypeDoc/{ => Function}/Generics/index.tsx | 0 .../TypeDoc/{ => Function}/Returns/index.tsx | 0 .../{ => Function}/Signature/index.tsx | 0 .../{ => Function}/Signatures/index.tsx | 0 .../{ => Function}/Signatures/styles.css.ts | 0 .../Doc/TypeDoc/{ => Function}/Type/index.tsx | 0 .../TypeDoc/{ => Function}/Type/styles.css.ts | 0 .../Docs/Doc/TypeDoc/Function/index.tsx | 69 ++++++++++++++++ src/ui/screens/Docs/Doc/TypeDoc/index.tsx | 76 +++--------------- src/utils/docs/index.ts | 3 + yarn.lock | 8 +- 21 files changed, 240 insertions(+), 103 deletions(-) create mode 100644 src/ui/components/DocDescription/index.tsx delete mode 100644 src/ui/components/DocLinks/styles.css.ts create mode 100644 src/ui/screens/Docs/Doc/TypeDoc/Constants/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TypeDoc/Constants/styles.css.ts rename src/ui/screens/Docs/Doc/TypeDoc/{ => Function}/Arguments/index.tsx (100%) rename src/ui/screens/Docs/Doc/TypeDoc/{ => Function}/Generics/index.tsx (100%) rename src/ui/screens/Docs/Doc/TypeDoc/{ => Function}/Returns/index.tsx (100%) rename src/ui/screens/Docs/Doc/TypeDoc/{ => Function}/Signature/index.tsx (100%) rename src/ui/screens/Docs/Doc/TypeDoc/{ => Function}/Signatures/index.tsx (100%) rename src/ui/screens/Docs/Doc/TypeDoc/{ => Function}/Signatures/styles.css.ts (100%) rename src/ui/screens/Docs/Doc/TypeDoc/{ => Function}/Type/index.tsx (100%) rename src/ui/screens/Docs/Doc/TypeDoc/{ => Function}/Type/styles.css.ts (100%) create mode 100644 src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx create mode 100644 src/utils/docs/index.ts diff --git a/package.json b/package.json index 3b9a8f3f..add55461 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "start": "env NODE_ENV=development ts-node -r tsconfig-paths/register devServer.ts" }, "dependencies": { - "@date-fns/docs": "0.18.0", + "@date-fns/docs": "0.21.1", "@sentry/browser": "^5.30.0", "@sentry/tracing": "^5.30.0", "@switcher/preact": "2.3.0", diff --git a/src/ui/components/DocDescription/index.tsx b/src/ui/components/DocDescription/index.tsx new file mode 100644 index 00000000..4886cb08 --- /dev/null +++ b/src/ui/components/DocDescription/index.tsx @@ -0,0 +1,32 @@ +import { ComponentChildren, FunctionComponent, h, Fragment } from 'preact' +import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import { Markdown } from '~/ui/components/Markdown' + +interface DocDescriptionProps { + description: string + header?: 'h2' | 'h3' +} + +export const DocDescription: FunctionComponent = ({ + description, + header, +}) => { + const headerContent = ( + <> + Description + + + ) + + return ( +
    + {header === 'h2' ? ( +

    {headerContent}

    + ) : ( +

    {headerContent}

    + )} + + +
    + ) +} diff --git a/src/ui/components/DocExamples/index.tsx b/src/ui/components/DocExamples/index.tsx index bde097b6..ffe6cb04 100644 --- a/src/ui/components/DocExamples/index.tsx +++ b/src/ui/components/DocExamples/index.tsx @@ -1,4 +1,4 @@ -import { h, FunctionComponent } from 'preact' +import { h, Fragment, FunctionComponent } from 'preact' import { Code } from '~/ui/components/Code' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' import isArray from 'lodash/isArray' @@ -7,23 +7,34 @@ import * as styles from './styles.css' interface Props { examples: string[] | string + header?: 'h2' | 'h3' } -export const DocExamples: FunctionComponent = ({ examples }) => ( -
    -

    +export const DocExamples: FunctionComponent = ({ examples, header }) => { + const headerContent = ( + <> Examples -

    + + ) - {isArray(examples) ? ( - examples.map((example, index) => ( -
    - -
    - )) - ) : ( - - )} -
    -) + return ( +
    + {header === 'h2' ? ( +

    {headerContent}

    + ) : ( +

    {headerContent}

    + )} + + {isArray(examples) ? ( + examples.map((example, index) => ( +
    + +
    + )) + ) : ( + + )} +
    + ) +} diff --git a/src/ui/components/DocLinks/index.tsx b/src/ui/components/DocLinks/index.tsx index 2db104f6..e279bc82 100644 --- a/src/ui/components/DocLinks/index.tsx +++ b/src/ui/components/DocLinks/index.tsx @@ -2,7 +2,6 @@ import { h } from 'preact' import { useContext } from 'preact/hooks' import { RouterContext, RouterLink } from '~/ui/router' import { bugTemplateText, docIssueTemplateText } from './templateText' -import * as styles from './styles.css' export const DocLinks = () => { const { location } = useContext(RouterContext) @@ -19,7 +18,6 @@ export const DocLinks = () => {
  • = ({ doc }) => (
    {doc.title} -
    -

    - Description - -

    - - -
    + {doc.usage && doc.usageTabs && ( diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Constants/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Constants/index.tsx new file mode 100644 index 00000000..7aa07450 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TypeDoc/Constants/index.tsx @@ -0,0 +1,80 @@ +import type { DateFnsDocs } from '@date-fns/docs/types' +import { + findDescription, + findSummary, + findFnDescription, + findFnExamples, + findExamples, +} from '@date-fns/docs/utils' +import { Fragment, FunctionComponent, h } from 'preact' +import { useMemo } from 'preact/hooks' +import type { DeclarationReflection } from 'typedoc' +import { CodeComponent } from '~/ui/components/Code' +import { DocDescription } from '~/ui/components/DocDescription' +import { DocExamples } from '~/ui/components/DocExamples' +import { DocHeader } from '~/ui/components/DocHeader' +import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import { DocLinks } from '~/ui/components/DocLinks' +import { extractCodeFromTagString } from '~/utils/docs' +import * as styles from './styles.css' + +interface TypeDocConstantsProps { + page: DateFnsDocs.TypeDocPage + doc: DeclarationReflection +} + +export const TypeDocConstants: FunctionComponent = ({ + page, + doc, +}) => { + const description = useMemo(() => findDescription(doc), [doc]) + + return ( + <> + {page.title} + + {description && } + + {doc.children?.map((constant) => ( + + ))} + + +
    {JSON.stringify(doc, null, 2)}
    +
    + + + + ) +} + +interface ConstantProps { + constant: DeclarationReflection +} + +function Constant({ constant }: ConstantProps) { + if (constant.kindString !== 'Variable') return null + + const description = useMemo( + () => findDescription(constant) || findSummary(constant), + [constant] + ) + + const examples = useMemo( + () => findExamples(constant).map(extractCodeFromTagString), + [constant] + ) + + return ( +
    +

    + {constant.name} + +

    + + {description && } + + {examples && } +
    + ) +} diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Constants/styles.css.ts b/src/ui/screens/Docs/Doc/TypeDoc/Constants/styles.css.ts new file mode 100644 index 00000000..8355c5b6 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TypeDoc/Constants/styles.css.ts @@ -0,0 +1,5 @@ +import { style } from '@vanilla-extract/css' + +export const name = style({ + fontFamily: 'monospace', +}) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Arguments/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/Arguments/index.tsx similarity index 100% rename from src/ui/screens/Docs/Doc/TypeDoc/Arguments/index.tsx rename to src/ui/screens/Docs/Doc/TypeDoc/Function/Arguments/index.tsx diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Generics/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/Generics/index.tsx similarity index 100% rename from src/ui/screens/Docs/Doc/TypeDoc/Generics/index.tsx rename to src/ui/screens/Docs/Doc/TypeDoc/Function/Generics/index.tsx diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Returns/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/Returns/index.tsx similarity index 100% rename from src/ui/screens/Docs/Doc/TypeDoc/Returns/index.tsx rename to src/ui/screens/Docs/Doc/TypeDoc/Function/Returns/index.tsx diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Signature/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/Signature/index.tsx similarity index 100% rename from src/ui/screens/Docs/Doc/TypeDoc/Signature/index.tsx rename to src/ui/screens/Docs/Doc/TypeDoc/Function/Signature/index.tsx diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Signatures/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/index.tsx similarity index 100% rename from src/ui/screens/Docs/Doc/TypeDoc/Signatures/index.tsx rename to src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/index.tsx diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Signatures/styles.css.ts b/src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/styles.css.ts similarity index 100% rename from src/ui/screens/Docs/Doc/TypeDoc/Signatures/styles.css.ts rename to src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/styles.css.ts diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Type/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/Type/index.tsx similarity index 100% rename from src/ui/screens/Docs/Doc/TypeDoc/Type/index.tsx rename to src/ui/screens/Docs/Doc/TypeDoc/Function/Type/index.tsx diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Type/styles.css.ts b/src/ui/screens/Docs/Doc/TypeDoc/Function/Type/styles.css.ts similarity index 100% rename from src/ui/screens/Docs/Doc/TypeDoc/Type/styles.css.ts rename to src/ui/screens/Docs/Doc/TypeDoc/Function/Type/styles.css.ts diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx new file mode 100644 index 00000000..cc43a831 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx @@ -0,0 +1,69 @@ +import type { DateFnsDocs } from '@date-fns/docs/types' +import { findFn, findFnDescription, findFnExamples } from '@date-fns/docs/utils' +import { FunctionComponent, h } from 'preact' +import { useMemo } from 'preact/hooks' +import type { DeclarationReflection } from 'typedoc' +import { DocDescription } from '~/ui/components/DocDescription' +import { DocExamples } from '~/ui/components/DocExamples' +import { DocHeader } from '~/ui/components/DocHeader' +import { DocLinks } from '~/ui/components/DocLinks' +import { DocUsage } from '~/ui/components/DocUsage' +import { extractCodeFromTagString } from '~/utils/docs' +import { Signatures } from './Signatures' + +interface TypeDocFunctionProps { + page: DateFnsDocs.TypeDocPage + doc: DeclarationReflection +} + +export const TypeDocFunction: FunctionComponent = ({ + page, + doc, +}) => { + const fn = useMemo(() => findFn(doc), [doc]) + const description = useMemo(() => fn && findFnDescription(fn), [fn]) + const { usage, usageTabs } = useMemo(() => generateUsage(doc.name), [doc]) + const signatures = fn && fn.signatures + const examples = useMemo( + () => fn && findFnExamples(fn).map(extractCodeFromTagString), + [fn] + ) + + return ( +
    + {page.title} + + {description && } + + + + {signatures && } + + {examples && } + + +
    {JSON.stringify(doc, null, 2)}
    +
    + + +
    + ) +} + +function generateUsage(name: string) { + const usage = { + esm: { + code: `import { ${name} } from "date-fns";`, + title: 'ESM', + }, + + commonjs: { + code: `const ${name} = require("date-fns/${name}");`, + title: 'CommonJS', + }, + } + + const usageTabs = ['esm', 'commonjs'] + + return { usage, usageTabs } +} diff --git a/src/ui/screens/Docs/Doc/TypeDoc/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/index.tsx index 43fdd52b..34b23413 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/index.tsx @@ -1,17 +1,12 @@ import type { DateFnsDocs } from '@date-fns/docs/types' -import { findFnDescription, findFnExamples, findFn } from '@date-fns/docs/utils' import { FunctionComponent, h } from 'preact' import { useContext, useEffect, useMemo } from 'preact/hooks' -import { parse } from 'typeroo' -import { DocExamples } from '~/ui/components/DocExamples' -import { DocHeader } from '~/ui/components/DocHeader' -import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' -import { DocLinks } from '~/ui/components/DocLinks' -import { DocUsage } from '~/ui/components/DocUsage' -import { Markdown } from '~/ui/components/Markdown' import { RouterContext } from '~/ui/router' -import { Signatures } from './Signatures' +import { TypeDocFunction } from './Function' import { useTypesModal } from './Types' +import { parse } from 'typeroo' +import { TypeDocConstants } from './Constants' +import type { DeclarationReflection } from 'typedoc' interface TypeDocProps { page: DateFnsDocs.TypeDocPage @@ -21,16 +16,8 @@ const typeHashRE = /types\/(\w+)\/(\w+)/ export const TypeDoc: FunctionComponent = ({ page }) => { const { location, navigate } = useContext(RouterContext) - const doc = useMemo(() => parse(page.doc), [page.slug]) - const fn = useMemo(() => findFn(doc), [doc]) - const description = useMemo(() => fn && findFnDescription(fn), [fn]) - const { usage, usageTabs } = useMemo(() => generateUsage(doc.name), [doc]) - const signatures = fn && fn.signatures - const examples = useMemo(() => fn && findFnExamples(fn).map(extractCode), [ - fn, - ]) - const showTypesModal = useTypesModal() + const doc = useMemo(() => parse(page.doc), [page.slug]) useEffect(() => { const captures = location.hash.match(typeHashRE) @@ -53,54 +40,11 @@ export const TypeDoc: FunctionComponent = ({ page }) => { }) }, [window.location.href]) - return ( -
    - {page.title} - - {description && ( -
    -

    - Description - -

    - - -
    - )} - - - - {signatures && } + switch (page.kind) { + case 'function': + return - {examples && } - - -
    {JSON.stringify(doc, null, 2)}
    -
    - - -
    - ) -} - -function generateUsage(name: string) { - const usage = { - esm: { - code: `import { ${name} } from "date-fns";`, - title: 'ESM', - }, - - commonjs: { - code: `const ${name} = require("date-fns/${name}");`, - title: 'CommonJS', - }, + case 'constants': + return } - - const usageTabs = ['esm', 'commonjs'] - - return { usage, usageTabs } -} - -function extractCode(example: string): string { - return example.match(/```ts\n([\s\S]+?)\n```/)?.[1] ?? '' } diff --git a/src/utils/docs/index.ts b/src/utils/docs/index.ts new file mode 100644 index 00000000..d11da1d1 --- /dev/null +++ b/src/utils/docs/index.ts @@ -0,0 +1,3 @@ +export function extractCodeFromTagString(example: string): string { + return example.match(/```ts\n([\s\S]+?)\n```/)?.[1] ?? '' +} diff --git a/yarn.lock b/yarn.lock index b5522ba4..11d8fa01 100644 --- a/yarn.lock +++ b/yarn.lock @@ -251,10 +251,10 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@date-fns/docs@0.18.0": - version "0.18.0" - resolved "https://registry.yarnpkg.com/@date-fns/docs/-/docs-0.18.0.tgz#65fe9f2f7c232069de61c3d74a1fb2a7b4c9cdca" - integrity sha512-0Rxwc7RSQ6mYu9+1b5QOAMRlKhFLahqfYQvB5tqJOXGIDO/L7PGM5q1NwZ1fXydEFFabwxaetLpO4ZV+PAjqKw== +"@date-fns/docs@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@date-fns/docs/-/docs-0.21.1.tgz#e4dc7277c1fb6957bdcbcffbbb2d560018394cda" + integrity sha512-pRejd20/ptuMoY9pLXGPh8wy8MBn9zHhNb40bfWcOq++vPt5t/VIT7/upD2qIiAWjdpEyAvFbKQBqjg9zEbyLA== dependencies: firebase-admin "^11.4.1" js-fns "^2.5.2" From a40ee11bfc9333bee752b9e2d1b5b8af5723b91f Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Thu, 26 Jan 2023 09:30:35 +0800 Subject: [PATCH 15/36] Constants doc --- src/ui/components/Debug/index.tsx | 12 ++ src/ui/components/DocDescription/index.tsx | 32 ++--- src/ui/components/DocExamples/index.tsx | 52 +++---- src/ui/components/DocHeader/index.tsx | 14 +- src/ui/components/DocReturns/index.tsx | 26 ++-- src/ui/components/DocUsage/index.tsx | 21 +-- src/ui/components/Entities/index.tsx | 32 +++++ .../Entities}/styles.css.ts | 6 +- src/ui/components/HighlightQuery/index.tsx | 61 +++++++++ .../components/HighlightQuery/styles.css.ts | 5 + src/ui/components/Markdown/index.tsx | 2 + src/ui/components/NoSearchResults/index.tsx | 31 +++++ .../components/NoSearchResults/styles.css.ts | 5 + src/ui/components/RichText/styles.css.ts | 4 + .../Search}/img/cancel.svg | 0 src/ui/components/Search/index.tsx | 61 +++++++++ src/ui/components/Search/styles.css.ts | 39 ++++++ src/ui/components/SectionHeader/index.tsx | 29 ++++ src/ui/components/SourceLink/index.tsx | 32 +++++ src/ui/components/SourceLink/styles.css.ts | 27 ++++ .../Docs/Doc/TypeDoc/Constants/index.tsx | 127 ++++++++++++++---- .../Docs/Doc/TypeDoc/Constants/styles.css.ts | 10 ++ .../Doc/TypeDoc/Function/Arguments/index.tsx | 37 ++--- .../Doc/TypeDoc/Function/Generics/index.tsx | 30 ++--- .../Doc/TypeDoc/Function/Signatures/index.tsx | 24 ++-- .../Docs/Doc/TypeDoc/Function/Type/index.tsx | 18 +-- .../Docs/Doc/TypeDoc/Function/index.tsx | 20 +-- src/ui/screens/Docs/Finder/CancelButton.tsx | 17 --- src/ui/screens/Docs/Finder/index.tsx | 49 ++----- src/ui/screens/Docs/Finder/styles.css.ts | 34 ----- src/utils/docs/index.ts | 32 +++++ src/utils/remarkableTree/utils/index.ts | 2 + 32 files changed, 603 insertions(+), 288 deletions(-) create mode 100644 src/ui/components/Debug/index.tsx create mode 100644 src/ui/components/Entities/index.tsx rename src/ui/{screens/Docs/Doc/TypeDoc/Function/Signatures => components/Entities}/styles.css.ts (64%) create mode 100644 src/ui/components/HighlightQuery/index.tsx create mode 100644 src/ui/components/HighlightQuery/styles.css.ts create mode 100644 src/ui/components/NoSearchResults/index.tsx create mode 100644 src/ui/components/NoSearchResults/styles.css.ts rename src/ui/{screens/Docs/Finder => components/Search}/img/cancel.svg (100%) create mode 100644 src/ui/components/Search/index.tsx create mode 100644 src/ui/components/Search/styles.css.ts create mode 100644 src/ui/components/SectionHeader/index.tsx create mode 100644 src/ui/components/SourceLink/index.tsx create mode 100644 src/ui/components/SourceLink/styles.css.ts delete mode 100644 src/ui/screens/Docs/Finder/CancelButton.tsx diff --git a/src/ui/components/Debug/index.tsx b/src/ui/components/Debug/index.tsx new file mode 100644 index 00000000..c1909bd7 --- /dev/null +++ b/src/ui/components/Debug/index.tsx @@ -0,0 +1,12 @@ +import { Fragment, FunctionComponent, h } from 'preact' +import { Code } from '../Code' + +interface DebugProps { + data: unknown +} + +export const Debug: FunctionComponent = ({ data }) => ( + +) diff --git a/src/ui/components/DocDescription/index.tsx b/src/ui/components/DocDescription/index.tsx index 4886cb08..21b750eb 100644 --- a/src/ui/components/DocDescription/index.tsx +++ b/src/ui/components/DocDescription/index.tsx @@ -1,32 +1,20 @@ -import { ComponentChildren, FunctionComponent, h, Fragment } from 'preact' -import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import { Fragment, FunctionComponent, h } from 'preact' import { Markdown } from '~/ui/components/Markdown' +import { SectionHeader } from '../SectionHeader' interface DocDescriptionProps { description: string + scope?: string header?: 'h2' | 'h3' } export const DocDescription: FunctionComponent = ({ description, header, -}) => { - const headerContent = ( - <> - Description - - - ) - - return ( -
    - {header === 'h2' ? ( -

    {headerContent}

    - ) : ( -

    {headerContent}

    - )} - - -
    - ) -} + scope, +}) => ( +
    + + +
    +) diff --git a/src/ui/components/DocExamples/index.tsx b/src/ui/components/DocExamples/index.tsx index ffe6cb04..b7d382b1 100644 --- a/src/ui/components/DocExamples/index.tsx +++ b/src/ui/components/DocExamples/index.tsx @@ -1,40 +1,32 @@ -import { h, Fragment, FunctionComponent } from 'preact' -import { Code } from '~/ui/components/Code' -import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' import isArray from 'lodash/isArray' +import { Fragment, FunctionComponent, h } from 'preact' +import { Code } from '~/ui/components/Code' import { Markdown } from '~/ui/components/Markdown' +import { SectionHeader } from '../SectionHeader' import * as styles from './styles.css' interface Props { examples: string[] | string + scope?: string header?: 'h2' | 'h3' } -export const DocExamples: FunctionComponent = ({ examples, header }) => { - const headerContent = ( - <> - Examples - - - ) +export const DocExamples: FunctionComponent = ({ + examples, + scope, + header, +}) => ( +
    + - return ( -
    - {header === 'h2' ? ( -

    {headerContent}

    - ) : ( -

    {headerContent}

    - )} - - {isArray(examples) ? ( - examples.map((example, index) => ( -
    - -
    - )) - ) : ( - - )} -
    - ) -} + {isArray(examples) ? ( + examples.map((example, index) => ( +
    + +
    + )) + ) : ( + + )} +
    +) diff --git a/src/ui/components/DocHeader/index.tsx b/src/ui/components/DocHeader/index.tsx index fe101da6..513c2081 100644 --- a/src/ui/components/DocHeader/index.tsx +++ b/src/ui/components/DocHeader/index.tsx @@ -1,10 +1,18 @@ import { ComponentChildren, FunctionComponent, h } from 'preact' +import { SourceLink } from '../SourceLink' import * as styles from './styles.css' -interface Props { +interface DocHeaderProps { children: ComponentChildren + source?: string } -export const DocHeader: FunctionComponent = ({ children }) => ( -

    {children}

    +export const DocHeader: FunctionComponent = ({ + children, + source, +}) => ( +

    + {children} + +

    ) diff --git a/src/ui/components/DocReturns/index.tsx b/src/ui/components/DocReturns/index.tsx index 0df328a2..7f95c3a4 100644 --- a/src/ui/components/DocReturns/index.tsx +++ b/src/ui/components/DocReturns/index.tsx @@ -1,32 +1,26 @@ -import { ComponentChildren, FunctionComponent, h, Fragment } from 'preact' -import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import { ComponentChildren, Fragment, FunctionComponent, h } from 'preact' import { Markdown } from '~/ui/components/Markdown' +import { SectionHeader } from '../SectionHeader' interface ReturnType { description: string type: ComponentChildren } -interface Props { +interface DocReturnsProps { returns: ReturnType[] + scope?: string header?: 'h2' | 'h3' } -export const DocReturns: FunctionComponent = ({ returns, header }) => { - const headerContent = ( - <> - Returns - - - ) - +export const DocReturns: FunctionComponent = ({ + returns, + scope, + header, +}) => { return (
    - {header === 'h2' ? ( -

    {headerContent}

    - ) : ( -

    {headerContent}

    - )} + diff --git a/src/ui/components/DocUsage/index.tsx b/src/ui/components/DocUsage/index.tsx index d3ad3d5b..948c58fc 100644 --- a/src/ui/components/DocUsage/index.tsx +++ b/src/ui/components/DocUsage/index.tsx @@ -1,10 +1,11 @@ -import { h, FunctionComponent } from 'preact' +import { h, Fragment, FunctionComponent } from 'preact' import { useEffect, useState } from 'preact/hooks' import type { DateFnsDocs } from '@date-fns/docs/types' import { Content } from './Content' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' import * as styles from './styles.css' import classNames from 'classnames' +import { SectionHeader } from '../SectionHeader' const LOCALSTORAGE_KEY = 'usageSource' const DEFAULT_SOURCE = 'commonjs' @@ -12,11 +13,16 @@ const DEFAULT_SOURCE = 'commonjs' interface Props { usage: DateFnsDocs.FnUsage usageTabs: string[] + scope?: string + header?: 'h2' | 'h3' } -type FIXME = any - -export const DocUsage: FunctionComponent = ({ usageTabs, usage }) => { +export const DocUsage: FunctionComponent = ({ + usageTabs, + usage, + scope, + header, +}) => { const [source, setSource] = useState(DEFAULT_SOURCE) useEffect(() => { @@ -34,10 +40,7 @@ export const DocUsage: FunctionComponent = ({ usageTabs, usage }) => { return (
    -

    - Usage - -

    +
      {usageTabs.map((usageTab) => { @@ -55,7 +58,7 @@ export const DocUsage: FunctionComponent = ({ usageTabs, usage }) => { selectedTab === usageTab && styles.optionLinkIsCurrent )} href="#" - onClick={(e: FIXME) => { + onClick={(e) => { // FIXME: // trackAction('Changed Usage Source', { source }) e.preventDefault() diff --git a/src/ui/components/Entities/index.tsx b/src/ui/components/Entities/index.tsx new file mode 100644 index 00000000..cafb5d59 --- /dev/null +++ b/src/ui/components/Entities/index.tsx @@ -0,0 +1,32 @@ +import classNames from 'classnames' +import { ComponentChildren, Fragment, FunctionComponent, h } from 'preact' +import * as styles from './styles.css' + +interface EntitiesProps { + children: ComponentChildren + alwaysMulti?: boolean +} + +export const Entities: FunctionComponent = ({ + children, + alwaysMulti, +}) => { + const solo = !Array.isArray(children) || children.length === 1 + const childrenArr = Array.isArray(children) ? children : [children] + + return ( +
      + {childrenArr.map((child, index) => ( +
      + {child} +
      + ))} +
      + ) +} diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/styles.css.ts b/src/ui/components/Entities/styles.css.ts similarity index 64% rename from src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/styles.css.ts rename to src/ui/components/Entities/styles.css.ts index fb156a33..94f58cc1 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/styles.css.ts +++ b/src/ui/components/Entities/styles.css.ts @@ -1,6 +1,6 @@ import { style, globalStyle } from '@vanilla-extract/css' -export const signature = style({ +export const entity = style({ selectors: { '&:not(:last-child)': { marginBottom: '1rem', @@ -8,12 +8,12 @@ export const signature = style({ }, }) -export const multiSignature = style({ +export const miltiEntity = style({ border: '1px solid #5844521a', padding: '1rem', background: '#fffefd', }) -globalStyle(`${multiSignature} > :first-child > :first-child`, { +globalStyle(`${miltiEntity} > :first-child > :first-child`, { marginTop: '0', }) diff --git a/src/ui/components/HighlightQuery/index.tsx b/src/ui/components/HighlightQuery/index.tsx new file mode 100644 index 00000000..feeaadca --- /dev/null +++ b/src/ui/components/HighlightQuery/index.tsx @@ -0,0 +1,61 @@ +import classNames from 'classnames' +import { Fragment, FunctionComponent, h } from 'preact' +import { useMemo } from 'preact/hooks' +import * as styles from './styles.css' + +interface HighlightQueryProps { + text: string + query: string +} + +export const HighlightQuery: FunctionComponent = ({ + text, + query, +}) => { + const chunks = useMemo(() => highlightText(text, query), [text, query]) + + return ( + <> + {chunks.map((chunk, index) => ( + + {chunk.text} + + ))} + + ) +} + +interface Chunk { + text: string + type: 'chunk' | 'query' +} + +function highlightText(text: string, query: string): Chunk[] { + if (!text || !query) return [{ text, type: 'chunk' }] + + const chunks: Chunk[] = [] + const textLower = text.toLowerCase() + const queryLower = query.toLowerCase() + let lastIndex = 0 + let index = textLower.indexOf(queryLower) + + while (index !== -1) { + const start = lastIndex + const end = index + + chunks.push({ text: text.slice(start, end), type: 'chunk' }) + chunks.push({ text: text.slice(end, end + query.length), type: 'query' }) + + lastIndex = end + query.length + index = textLower.indexOf(queryLower, lastIndex) + + if (lastIndex >= text.length) break + } + + chunks.push({ text: text.slice(lastIndex), type: 'chunk' }) + + return chunks +} diff --git a/src/ui/components/HighlightQuery/styles.css.ts b/src/ui/components/HighlightQuery/styles.css.ts new file mode 100644 index 00000000..aac21fb8 --- /dev/null +++ b/src/ui/components/HighlightQuery/styles.css.ts @@ -0,0 +1,5 @@ +import { style } from '@vanilla-extract/css' + +export const highlight = style({ + backgroundColor: '#fffe25', +}) diff --git a/src/ui/components/Markdown/index.tsx b/src/ui/components/Markdown/index.tsx index 4d7a65f7..7aafdad2 100644 --- a/src/ui/components/Markdown/index.tsx +++ b/src/ui/components/Markdown/index.tsx @@ -6,6 +6,8 @@ import { linkify } from 'remarkable/linkify' const md = new Remarkable().use(linkify) +md.inline.ruler.enable(['mark']) + interface Props { value: string } diff --git a/src/ui/components/NoSearchResults/index.tsx b/src/ui/components/NoSearchResults/index.tsx new file mode 100644 index 00000000..a6957372 --- /dev/null +++ b/src/ui/components/NoSearchResults/index.tsx @@ -0,0 +1,31 @@ +import classNames from 'classnames' +import { Fragment, FunctionComponent, h } from 'preact' +import { useMemo } from 'preact/hooks' +import * as styles from './styles.css' + +interface NoSearchResultsProps { + noun: string + query: string + setQuery: (query: string) => void +} + +export const NoSearchResults: FunctionComponent = ({ + noun, + query, + setQuery, +}) => { + return ( + + ) +} diff --git a/src/ui/components/NoSearchResults/styles.css.ts b/src/ui/components/NoSearchResults/styles.css.ts new file mode 100644 index 00000000..74f7d3da --- /dev/null +++ b/src/ui/components/NoSearchResults/styles.css.ts @@ -0,0 +1,5 @@ +import { style } from '@vanilla-extract/css' + +export const query = style({ + backgroundColor: '#fffe25', +}) diff --git a/src/ui/components/RichText/styles.css.ts b/src/ui/components/RichText/styles.css.ts index f178a5f7..ea380557 100644 --- a/src/ui/components/RichText/styles.css.ts +++ b/src/ui/components/RichText/styles.css.ts @@ -153,3 +153,7 @@ globalStyle(`${content} blockquote`, { background: '#faf6f0', padding: '0.5rem 1rem', }) + +globalStyle(`${content} mark`, { + backgroundColor: '#fffe25', +}) diff --git a/src/ui/screens/Docs/Finder/img/cancel.svg b/src/ui/components/Search/img/cancel.svg similarity index 100% rename from src/ui/screens/Docs/Finder/img/cancel.svg rename to src/ui/components/Search/img/cancel.svg diff --git a/src/ui/components/Search/index.tsx b/src/ui/components/Search/index.tsx new file mode 100644 index 00000000..1145f715 --- /dev/null +++ b/src/ui/components/Search/index.tsx @@ -0,0 +1,61 @@ +import { FunctionComponent, h } from 'preact' +// import { trackAction } from 'app/acts/tracking_acts' +import debounce from 'lodash/debounce' +import { StateUpdater, useCallback } from 'preact/hooks' +import * as styles from './styles.css' +import classNames from 'classnames' + +interface SearchProps { + query: [string, StateUpdater] + bordered?: boolean +} + +export const Search: FunctionComponent = ({ + query: [query, setQuery], + bordered, +}) => { + const trackSearch = useCallback( + debounce((newQuery: string) => { + // FIXME: + // trackAction('Search', { query: newQuery }) + }, 500), + [] + ) + + return ( +
      + { + const newQuery = (e.target as HTMLInputElement).value + trackSearch(newQuery) + setQuery(newQuery) + }} + /> + + {query.trim().length > 0 && } +
      + ) +} + +interface CancelProps { + setQuery(query: string): void +} + +function Cancel({ setQuery }: CancelProps) { + return ( +
      { + // FIXME: + // trackAction('Search Cleared') + setQuery('') + }} + /> + ) +} diff --git a/src/ui/components/Search/styles.css.ts b/src/ui/components/Search/styles.css.ts new file mode 100644 index 00000000..64571ba7 --- /dev/null +++ b/src/ui/components/Search/styles.css.ts @@ -0,0 +1,39 @@ +import { style } from '@vanilla-extract/css' +import cancelURL from './img/cancel.svg' + +export const search = style({ + position: 'relative', + flex: 'none', + color: '#770c56', + fontWeight: '600', + fontSize: '20px', + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + backgroundColor: '#faf6f0', + borderBottom: '1px solid #e6e0e6', + wordBreak: 'break-all', +}) + +export const bordered = style({ + border: '1px solid #e6e0e6', +}) + +export const cancel = style({ + height: '16px', + width: '16px', + top: '50%', + marginTop: '-9px', + cursor: 'pointer', + backgroundImage: `url('${cancelURL}')`, + backgroundSize: '16px', + position: 'absolute', + right: '1.5rem', +}) + +export const input = style({ + padding: '0.75rem 1rem', + border: '0', + width: '100%', + fontSize: '1rem', +}) diff --git a/src/ui/components/SectionHeader/index.tsx b/src/ui/components/SectionHeader/index.tsx new file mode 100644 index 00000000..53ed370a --- /dev/null +++ b/src/ui/components/SectionHeader/index.tsx @@ -0,0 +1,29 @@ +import kebabCase from 'lodash/kebabCase' +import { Fragment, FunctionComponent, h } from 'preact' +import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' + +interface SectionHeaderProps { + header: string + scope?: string + tag?: 'h2' | 'h3' +} + +export const SectionHeader: FunctionComponent = ({ + header, + scope, + tag, +}) => { + const anchor = (scope ? `${scope}/` : '') + kebabCase(header) + const headerContent = ( + <> + {header} + + + ) + + return tag === 'h3' ? ( +

      {headerContent}

      + ) : ( +

      {headerContent}

      + ) +} diff --git a/src/ui/components/SourceLink/index.tsx b/src/ui/components/SourceLink/index.tsx new file mode 100644 index 00000000..2f80e8d1 --- /dev/null +++ b/src/ui/components/SourceLink/index.tsx @@ -0,0 +1,32 @@ +import classNames from 'classnames' +import { FunctionComponent, h } from 'preact' +import * as styles from './styles.css' + +interface SourceLinkProps { + source: string | undefined + size?: keyof typeof styles.size +} + +export const SourceLink: FunctionComponent = ({ + source, + size, +}) => + source ? ( + + + + + + ) : null diff --git a/src/ui/components/SourceLink/styles.css.ts b/src/ui/components/SourceLink/styles.css.ts new file mode 100644 index 00000000..0931a84b --- /dev/null +++ b/src/ui/components/SourceLink/styles.css.ts @@ -0,0 +1,27 @@ +import { style, styleVariants } from '@vanilla-extract/css' + +export const link = style({ + position: 'relative', + top: '2px', +}) + +export const icon = style({ + color: '#9f8194', + display: 'inline-block', + transition: 'color 0.15s ease-out', + marginLeft: '0.5rem', + + ':hover': { + color: '#6e0839', + }, +}) + +export const size = styleVariants({ + small: { + width: '1rem', + }, + + medium: { + width: '1.5rem', + }, +}) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Constants/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Constants/index.tsx index 7aa07450..fbb41423 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Constants/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Constants/index.tsx @@ -1,21 +1,33 @@ import type { DateFnsDocs } from '@date-fns/docs/types' import { findDescription, - findSummary, - findFnDescription, - findFnExamples, findExamples, + findSummary, } from '@date-fns/docs/utils' import { Fragment, FunctionComponent, h } from 'preact' -import { useMemo } from 'preact/hooks' +import { useMemo, useState } from 'preact/hooks' import type { DeclarationReflection } from 'typedoc' -import { CodeComponent } from '~/ui/components/Code' +import { Code } from '~/ui/components/Code' +import { Debug } from '~/ui/components/Debug' import { DocDescription } from '~/ui/components/DocDescription' import { DocExamples } from '~/ui/components/DocExamples' import { DocHeader } from '~/ui/components/DocHeader' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' import { DocLinks } from '~/ui/components/DocLinks' -import { extractCodeFromTagString } from '~/utils/docs' +import { DocUsage } from '~/ui/components/DocUsage' +import { Entities } from '~/ui/components/Entities' +import { HighlightQuery } from '~/ui/components/HighlightQuery' +import { NoSearchResults } from '~/ui/components/NoSearchResults' +import { Search } from '~/ui/components/Search' +import { SectionHeader } from '~/ui/components/SectionHeader' +import { SourceLink } from '~/ui/components/SourceLink' +import { TypeDocType } from '~/ui/components/TypeDocType' +import { + extractCodeFromTagString, + findSource, + generateUsage, + hightlightMarkdown, +} from '~/utils/docs' import * as styles from './styles.css' interface TypeDocConstantsProps { @@ -23,25 +35,64 @@ interface TypeDocConstantsProps { doc: DeclarationReflection } +interface ConstantItem { + constant: DeclarationReflection + summary: string | undefined + description: string | undefined +} + export const TypeDocConstants: FunctionComponent = ({ page, doc, }) => { const description = useMemo(() => findDescription(doc), [doc]) + const [query, setQuery] = useState('') + + const constants: ConstantItem[] = useMemo( + () => + doc.children?.map((constant) => { + const summary = findSummary(constant) + const description = findDescription(constant) + return { constant, summary, description } + }) || [], + [doc] + ) + + const filtered = useMemo( + () => + query + ? constants.filter( + (item) => + item.constant.name.toLowerCase().includes(query.toLowerCase()) || + item.summary?.toLowerCase().includes(query.toLowerCase()) || + item.description?.toLowerCase().includes(query.toLowerCase()) + ) + : constants, + [constants, query] + ) + return ( <> - {page.title} + {page.title} {description && } - {doc.children?.map((constant) => ( - - ))} +
      +
      + +
      - -
      {JSON.stringify(doc, null, 2)}
      -
      + {filtered.length ? ( + + {filtered.map((item) => ( + + ))} + + ) : ( + + )} +
      @@ -49,32 +100,58 @@ export const TypeDocConstants: FunctionComponent = ({ } interface ConstantProps { - constant: DeclarationReflection + item: ConstantItem + query: string } -function Constant({ constant }: ConstantProps) { +function Constant({ item, query }: ConstantProps) { + const constant = item.constant + const name = constant.name + const description = item.description || item.summary + if (constant.kindString !== 'Variable') return null - const description = useMemo( - () => findDescription(constant) || findSummary(constant), - [constant] - ) + const { usage, usageTabs } = useMemo(() => generateUsage(name, 'constants'), [ + item, + ]) const examples = useMemo( () => findExamples(constant).map(extractCodeFromTagString), - [constant] + [item] ) return (
      -

      - {constant.name} - +

      + + + + + + +

      - {description && } + {description && ( + + )} + + + + {constant.type && ( +
      + + } /> +
      + )} - {examples && } + {examples.length > 0 && ( + + )}

      ) } diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Constants/styles.css.ts b/src/ui/screens/Docs/Doc/TypeDoc/Constants/styles.css.ts index 8355c5b6..851351f6 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Constants/styles.css.ts +++ b/src/ui/screens/Docs/Doc/TypeDoc/Constants/styles.css.ts @@ -1,5 +1,15 @@ import { style } from '@vanilla-extract/css' +export const list = style({ + marginTop: '1rem', + borderTop: '1px solid #5844521a', + paddingTop: '1rem', +}) + +export const search = style({ + marginBottom: '1rem', +}) + export const name = style({ fontFamily: 'monospace', }) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/Arguments/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/Arguments/index.tsx index 4cdc4bf1..ff533da5 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Function/Arguments/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/Arguments/index.tsx @@ -1,30 +1,21 @@ import { Fragment, FunctionComponent, h } from 'preact' import type { ParameterReflection } from 'typedoc' -import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import { SectionHeader } from '~/ui/components/SectionHeader' import { TypeDocInterface } from '~/ui/components/TypeDocInterface' -interface Props { +interface ArgumentsProps { args: ParameterReflection[] - header: 'h2' | 'h3' + scope?: string + header?: 'h2' | 'h3' } -export const Arguments: FunctionComponent = ({ args, header }) => { - const headerContent = ( - <> - Arguments - - - ) - - return ( -
      - {header === 'h2' ? ( -

      {headerContent}

      - ) : ( -

      {headerContent}

      - )} - - -
      - ) -} +export const Arguments: FunctionComponent = ({ + args, + scope, + header, +}) => ( +
      + + +
      +) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/Generics/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/Generics/index.tsx index 4332ff71..a46e1884 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Function/Generics/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/Generics/index.tsx @@ -1,30 +1,18 @@ import { Fragment, FunctionComponent, h } from 'preact' import type { TypeParameterReflection } from 'typedoc' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import { SectionHeader } from '~/ui/components/SectionHeader' import { TypeDocInterface } from '~/ui/components/TypeDocInterface' interface Props { args: TypeParameterReflection[] - header: 'h2' | 'h3' + scope?: string + header?: 'h2' | 'h3' } -export const Generics: FunctionComponent = ({ args, header }) => { - const headerContent = ( - <> - Generics - - - ) - - return ( -
      - {header === 'h2' ? ( -

      {headerContent}

      - ) : ( -

      {headerContent}

      - )} - - -
      - ) -} +export const Generics: FunctionComponent = ({ args, scope, header }) => ( +
      + + +
      +) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/index.tsx index 8bda4ea7..1606280d 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/index.tsx @@ -1,9 +1,8 @@ -import classNames from 'classnames' -import { h, FunctionComponent, Fragment } from 'preact' +import { Fragment, FunctionComponent, h } from 'preact' import type { SignatureReflection } from 'typedoc' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import { Entities } from '~/ui/components/Entities' import { Signature } from '../Signature' -import * as styles from './styles.css' interface SignaturesProps { name: string @@ -24,20 +23,15 @@ export const Signatures: FunctionComponent = ({ )} -
      + {signatures.map((signature, index) => ( -
      - -
      + ))} -
      +
    ) } diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/Type/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/Type/index.tsx index d5c3956a..48eacd0e 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Function/Type/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/Type/index.tsx @@ -7,36 +7,28 @@ import type { } from 'typedoc' import { Code } from '~/ui/components/Code' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' +import { SectionHeader } from '~/ui/components/SectionHeader' import { TypeDocType } from '~/ui/components/TypeDocType' import * as styles from './styles.css' interface TypeProps { name: string signature: SignatureReflection - header: 'h2' | 'h3' + scope?: string + header?: 'h2' | 'h3' } export const Type: FunctionComponent = ({ name, signature, + scope, header, }) => { - const headerContent = ( - <> - Type - - - ) - const withArgs = signature.parameters && signature.parameters.length > 0 return (
    - {header === 'h2' ? ( -

    {headerContent}

    - ) : ( -

    {headerContent}

    - )} + = ({ ) } - -function generateUsage(name: string) { - const usage = { - esm: { - code: `import { ${name} } from "date-fns";`, - title: 'ESM', - }, - - commonjs: { - code: `const ${name} = require("date-fns/${name}");`, - title: 'CommonJS', - }, - } - - const usageTabs = ['esm', 'commonjs'] - - return { usage, usageTabs } -} diff --git a/src/ui/screens/Docs/Finder/CancelButton.tsx b/src/ui/screens/Docs/Finder/CancelButton.tsx deleted file mode 100644 index e4921a93..00000000 --- a/src/ui/screens/Docs/Finder/CancelButton.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { FunctionComponent, h } from 'preact' -import * as styles from './styles.css' - -interface Props { - setQuery(query: string): void -} - -export const CancelButton: FunctionComponent = ({ setQuery }) => ( -
    { - // FIXME: - // trackAction('Search Cleared') - setQuery('') - }} - /> -) diff --git a/src/ui/screens/Docs/Finder/index.tsx b/src/ui/screens/Docs/Finder/index.tsx index 1749cb9d..5191005c 100644 --- a/src/ui/screens/Docs/Finder/index.tsx +++ b/src/ui/screens/Docs/Finder/index.tsx @@ -1,28 +1,25 @@ -import { h, FunctionComponent } from 'preact' +import { FunctionComponent, h } from 'preact' // import { trackAction } from 'app/acts/tracking_acts' -import debounce from 'lodash/debounce' -import { useCallback, useState } from 'preact/hooks' -import { CancelButton } from './CancelButton' -import { NoResults } from './NoResults' -import { Categories } from './Categories' -import { Widget } from './Widget' -import { filterPages } from './utils' -import { db } from '@date-fns/docs/db' import { packageName } from '@date-fns/docs/consts' +import { db } from '@date-fns/docs/db' import type { DateFnsDocs } from '@date-fns/docs/types' import { useRead } from '@typesaurus/preact' +import { useState } from 'preact/hooks' +import { Search } from '~/ui/components/Search' +import { Categories } from './Categories' +import { NoResults } from './NoResults' import * as styles from './styles.css' +import { filterPages } from './utils' +import { Widget } from './Widget' -type FIXME = any - -interface Props { +interface FinderProps { selectedVersion: string selectedPage: string selectedSubmodule: DateFnsDocs.Submodule onNavigate(): void } -export const Finder: FunctionComponent = ({ +export const Finder: FunctionComponent = ({ selectedSubmodule, selectedVersion, selectedPage, @@ -30,14 +27,6 @@ export const Finder: FunctionComponent = ({ }) => { const [query, setQuery] = useState('') - const trackSearch = useCallback( - debounce((newQuery: string) => { - // FIXME: - // trackAction('Search', { query: newQuery }) - }, 500), - [] - ) - const [versions, { loading }] = useRead( db.versions.query(($) => [ $.field('package').equal(packageName), @@ -51,23 +40,7 @@ export const Finder: FunctionComponent = ({ return (
    -
    - { - const newQuery = e.target.value - trackSearch(newQuery) - setQuery(newQuery) - }} - /> - - {query.length >= 0 && } -
    +
    {filteredPages.length === 0 ? ( diff --git a/src/ui/screens/Docs/Finder/styles.css.ts b/src/ui/screens/Docs/Finder/styles.css.ts index 87ef2303..6c00f285 100644 --- a/src/ui/screens/Docs/Finder/styles.css.ts +++ b/src/ui/screens/Docs/Finder/styles.css.ts @@ -1,5 +1,4 @@ import { style } from '@vanilla-extract/css' -import cancelURL from './img/cancel.svg' export const categoriesList = style({ flexGrow: '1', @@ -63,39 +62,6 @@ export const noResultsText = style({ color: '#7b6d77', }) -export const search = style({ - position: 'relative', - flex: 'none', - color: '#770c56', - fontWeight: '600', - fontSize: '20px', - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', - backgroundColor: '#faf6f0', - borderBottom: '1px solid #e6e0e6', - wordBreak: 'break-all', -}) - -export const searchCancel = style({ - height: '16px', - width: '16px', - top: '50%', - marginTop: '-9px', - cursor: 'pointer', - backgroundImage: `url('${cancelURL}')`, - backgroundSize: '16px', - position: 'absolute', - right: '1.5rem', -}) - -export const searchField = style({ - padding: '0.75rem 1rem', - border: '0', - width: '100%', - fontSize: '1rem', -}) - export const widgetContainer = style({ flex: 'none', }) diff --git a/src/utils/docs/index.ts b/src/utils/docs/index.ts index d11da1d1..23e6c611 100644 --- a/src/utils/docs/index.ts +++ b/src/utils/docs/index.ts @@ -1,3 +1,35 @@ +import type { DeclarationReflection } from 'typedoc' + +export function generateUsage(name: string, module = name) { + const usage = { + esm: { + code: `import { ${name} } from "date-fns";`, + title: 'ESM', + }, + + commonjs: { + code: `const ${name} = require("date-fns/${module}");`, + title: 'CommonJS', + }, + } + + const usageTabs = ['esm', 'commonjs'] + + return { usage, usageTabs } +} + export function extractCodeFromTagString(example: string): string { return example.match(/```ts\n([\s\S]+?)\n```/)?.[1] ?? '' } + +export function findSource(ref: DeclarationReflection, trimHash = false) { + const url = ref.sources?.[0].url + if (!url) return + return trimHash ? url.replace(/#.*$/, '') : url +} + +export function hightlightMarkdown(text: string, query: string) { + if (!query) return text + const regex = new RegExp(query, 'gi') + return text.replace(regex, (match) => `==${match}==`) +} diff --git a/src/utils/remarkableTree/utils/index.ts b/src/utils/remarkableTree/utils/index.ts index 11831130..b87c2cd5 100644 --- a/src/utils/remarkableTree/utils/index.ts +++ b/src/utils/remarkableTree/utils/index.ts @@ -84,6 +84,8 @@ export function getTagName(token: Token) { return 'tbody' case 'td_open': return 'td' + case 'mark_open': + return 'mark' default: throw new Error( `Can't retrieve the tag name from a token: an unknown token type "${token.type}"` From bade1dac6e7b3709fde5d220d9e8c896dde4767f Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Tue, 7 Feb 2023 09:17:46 +0800 Subject: [PATCH 16/36] Advance TypeDoc doc rendering --- package.json | 2 +- src/ui/components/DocHeader/styles.css.ts | 3 + src/ui/components/Drop/index.tsx | 200 +++++++++++++++ src/ui/components/Drop/styles.css.ts | 57 +++++ src/ui/components/IdHighlight/index.tsx | 75 ++++++ src/ui/components/IdHighlight/styles.css.ts | 15 ++ src/ui/components/Missing/index.tsx | 19 ++ src/ui/components/SourceLink/index.tsx | 23 +- src/ui/components/SourceLink/styles.css.ts | 5 +- src/ui/components/TypeDocInterface/index.tsx | 86 ++++--- .../components/TypeDocInterface/styles.css.ts | 4 + .../TypeDocReflection/Signature/index.tsx | 20 ++ .../TypeDocReflection/Signature/styles.css.ts | 6 + src/ui/components/TypeDocReflection/index.tsx | 31 +++ .../TypeDocSignature/Arguments/index.tsx | 34 +++ .../TypeDocSignature/Generics/index.tsx | 54 +++++ src/ui/components/TypeDocSignature/index.tsx | 44 ++++ .../components/TypeDocSignature/styles.css.ts | 5 + src/ui/components/TypeDocType/index.tsx | 131 ++++++++-- src/ui/components/TypeDocType/styles.css.ts | 4 + src/ui/components/WithDrop/index.tsx | 150 ++++++++++++ src/ui/components/WithDrop/styles.css.ts | 15 ++ src/ui/contexts/InlineTypeContext/index.tsx | 18 ++ src/ui/global.css | 5 + .../Docs/Doc/TypeDoc/Constants/index.tsx | 12 +- .../Docs/Doc/TypeDoc/Constants/styles.css.ts | 6 + .../Docs/Doc/TypeDoc/Function/Type/index.tsx | 94 +------- .../Docs/Doc/TypeDoc/Function/index.tsx | 8 +- .../screens/Docs/Doc/TypeDoc/Types/index.tsx | 227 ++++++++++++------ .../Docs/Doc/TypeDoc/Types/styles.css.ts | 109 +++++---- src/ui/screens/Docs/Doc/TypeDoc/index.tsx | 22 +- src/ui/screens/Docs/Doc/index.tsx | 28 ++- src/ui/screens/Docs/Doc/styles.css.ts | 7 +- src/utils/docs/index.ts | 72 +++++- yarn.lock | 8 +- 35 files changed, 1287 insertions(+), 312 deletions(-) create mode 100644 src/ui/components/Drop/index.tsx create mode 100644 src/ui/components/Drop/styles.css.ts create mode 100644 src/ui/components/IdHighlight/index.tsx create mode 100644 src/ui/components/IdHighlight/styles.css.ts create mode 100644 src/ui/components/Missing/index.tsx create mode 100644 src/ui/components/TypeDocReflection/Signature/index.tsx create mode 100644 src/ui/components/TypeDocReflection/Signature/styles.css.ts create mode 100644 src/ui/components/TypeDocReflection/index.tsx create mode 100644 src/ui/components/TypeDocSignature/Arguments/index.tsx create mode 100644 src/ui/components/TypeDocSignature/Generics/index.tsx create mode 100644 src/ui/components/TypeDocSignature/index.tsx create mode 100644 src/ui/components/TypeDocSignature/styles.css.ts create mode 100644 src/ui/components/WithDrop/index.tsx create mode 100644 src/ui/components/WithDrop/styles.css.ts create mode 100644 src/ui/contexts/InlineTypeContext/index.tsx diff --git a/package.json b/package.json index add55461..cb41cca8 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "start": "env NODE_ENV=development ts-node -r tsconfig-paths/register devServer.ts" }, "dependencies": { - "@date-fns/docs": "0.21.1", + "@date-fns/docs": "0.22.0", "@sentry/browser": "^5.30.0", "@sentry/tracing": "^5.30.0", "@switcher/preact": "2.3.0", diff --git a/src/ui/components/DocHeader/styles.css.ts b/src/ui/components/DocHeader/styles.css.ts index 1a33ebe8..8a7be198 100644 --- a/src/ui/components/DocHeader/styles.css.ts +++ b/src/ui/components/DocHeader/styles.css.ts @@ -2,4 +2,7 @@ import { style } from '@vanilla-extract/css' export const header = style({ fontFamily: 'monospace', + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', }) diff --git a/src/ui/components/Drop/index.tsx b/src/ui/components/Drop/index.tsx new file mode 100644 index 00000000..1ce3cf31 --- /dev/null +++ b/src/ui/components/Drop/index.tsx @@ -0,0 +1,200 @@ +import classNames from 'classnames' +import isEqual from 'lodash/isEqual' +import { ComponentChildren, h, JSX, RefObject } from 'preact' +import { useCallback, useEffect, useState } from 'preact/hooks' + +import * as styles from './styles.css' + +export const DropInner = Inner + +export interface DropArea { + x: number + y: number + width: number + height: number +} + +export type DropPosition = 'above' | 'below' | 'left' | 'right' + +export interface DropProps { + children: ComponentChildren + area: DropArea + ghost?: boolean + innerRef?: RefObject + onClick?: JSX.MouseEventHandler + preferPosition?: DropPosition +} + +/** + * Floating popup, used for dropdown menus, tooltips, etc. + */ +export function Drop({ + area, + children, + ghost, + innerRef, + onClick, + preferPosition, +}: DropProps) { + const [trianglePosition, setTrianglePosition] = useState( + 'below' + ) + + const [wrapper, setWrapper] = useState(undefined) + const [wrapperArea, setWrapperArea] = useState( + undefined + ) + + useEffect(() => { + if (!wrapper || !wrapperArea?.width) return + + const windowWidth = window.innerWidth + const windowHeight = window.innerHeight + const width = wrapperArea.width + const height = wrapperArea.height + + wrapper.style.opacity = '1' + + let verticalLeft = area.x + area.width / 2 - width / 2 + if (verticalLeft < 0) verticalLeft = 0 + else if (verticalLeft + width > windowWidth) + verticalLeft = windowWidth - width + + let horizontalTop = area.y + area.height / 2 - height / 2 + if (horizontalTop < 0) horizontalTop = 0 + else if (horizontalTop + height > windowHeight) + horizontalTop = windowHeight - height + + const positioning = { + below: () => { + const belowTop = area.y + area.height + if (belowTop + height < windowHeight) { + wrapper.style.top = `${belowTop}px` + wrapper.style.left = `${verticalLeft}px` + setTrianglePosition('above') + return true + } + }, + + above: () => { + const aboveTop = area.y - height + if (aboveTop > 0) { + wrapper.style.top = `${aboveTop}px` + wrapper.style.left = `${verticalLeft}px` + setTrianglePosition('below') + return true + } + }, + + left: () => { + const left = area.x - width + if (left > 0) { + wrapper.style.top = `${horizontalTop}px` + wrapper.style.left = `${left}px` + setTrianglePosition('right') + return true + } + }, + + right: () => { + const right = area.x + area.width + if (right + width < windowWidth) { + wrapper.style.top = `${horizontalTop}px` + wrapper.style.left = `${right}px` + setTrianglePosition('left') + return true + } + }, + } + + if (preferPosition === 'left') { + circlePositioning([positioning.left, positioning.right]) + } else if (preferPosition === 'right') { + circlePositioning([positioning.right, positioning.left]) + } else if (preferPosition === 'above') { + circlePositioning([positioning.above, positioning.below]) + } else { + circlePositioning([positioning.below, positioning.above]) + } + }, [ + trianglePosition, + wrapper, + wrapperArea?.width, + wrapperArea?.height, + area.x, + area.width, + area.y, + area.height, + preferPosition, + ]) + + const wrapperCallback = useCallback( + (el: HTMLDivElement | null) => { + if (!el) return + if (innerRef) innerRef.current = el + setWrapper(el) + }, + [innerRef] + ) + + useEffect(() => { + const newArea = wrapper?.getBoundingClientRect() + if (!isEqual(newArea, wrapperArea)) setWrapperArea(newArea) + }) + + return ( +
    + {(trianglePosition === 'above' || trianglePosition === 'left') && ( + + )} + + + {typeof children === 'string' ? ( +
    {children}
    + ) : ( + children + )} +
    + + {(trianglePosition === 'below' || trianglePosition === 'right') && ( + + )} +
    + ) +} + +function circlePositioning(fns: Array<() => void | boolean>) { + for (let i = 0; i < fns.length; i++) { + if (fns[i]?.()) return + } +} + +export type TrianglePosition = 'above' | 'below' | 'left' | 'right' + +interface TriangleProps { + position: TrianglePosition +} + +function Triangle(position: TriangleProps) { + return ( +
    + ) +} + +interface InnerProps { + children: ComponentChildren +} + +function Inner({ children }: InnerProps) { + return
    {children}
    +} diff --git a/src/ui/components/Drop/styles.css.ts b/src/ui/components/Drop/styles.css.ts new file mode 100644 index 00000000..10b360c1 --- /dev/null +++ b/src/ui/components/Drop/styles.css.ts @@ -0,0 +1,57 @@ +import { style, styleVariants } from '@vanilla-extract/css' + +export const drop = style({ + position: 'fixed', + opacity: 0, + transition: 'opacity 150ms', + zIndex: 20, + maxWidth: '30rem', + display: 'flex', + alignItems: 'center', +}) + +export const vertical = style({ + flexDirection: 'column', +}) + +export const ghost = style({ + pointerEvents: 'none', +}) + +export const triangle = style({ + background: 'var(--color-tooltip-canvas)', + width: '0.75rem', + height: '0.5rem', + position: 'relative', + marginBottom: '-1px', +}) + +export const position = styleVariants({ + above: { + clipPath: 'polygon(50% 0%, 0% 100%, 100% 100%)', + }, + + below: { + clipPath: 'polygon(50% 100%, 0 0, 100% 0)', + }, + + left: { + clipPath: 'polygon(0 50%, 100% 100%, 100% 0)', + }, + + right: { + clipPath: 'polygon(0 0, 0 100%, 100% 50%)', + }, +}) + +export const inner = style({ + background: 'var(--color-tooltip-canvas)', + color: 'var(--color-tooltip-ink)', + borderRadius: '3px', + overflow: 'hidden', + textAlign: 'center', +}) + +export const string = style({ + padding: '0.5rem', +}) diff --git a/src/ui/components/IdHighlight/index.tsx b/src/ui/components/IdHighlight/index.tsx new file mode 100644 index 00000000..d15b0cd3 --- /dev/null +++ b/src/ui/components/IdHighlight/index.tsx @@ -0,0 +1,75 @@ +import { match } from 'assert' +import { FunctionComponent, h } from 'preact' +import { useEffect, useRef } from 'preact/hooks' +import * as styles from './styles.css' + +interface IdHightlightProps { + id: string | undefined + match?: (id: string, hash: string) => boolean +} + +export const IdHightlight: FunctionComponent = ({ + id, + children, + match, +}) => { + const spanRef = useRef(null) + const stopAnimation = useRef<() => void>() + + useEffect(() => { + if (!id || spanRef.current === null) return + + const skip = match + ? !match(id, location.hash) + : location.hash.slice(1) !== id + if (skip) return + + stopAnimation.current?.() + + const span = spanRef.current + + !isInViewport(span) && span.scrollIntoView({ behavior: 'smooth' }) + + const cbOut = () => { + span.removeEventListener('transitionend', cbOut) + + span.classList.remove(styles.highlightIn) + span.classList.remove(styles.highlightOut) + + stopAnimation.current = undefined + } + + const cbIn = () => { + span.removeEventListener('transitionend', cbIn) + + span.addEventListener('transitionend', cbOut) + span.classList.add(styles.highlightOut) + } + + stopAnimation.current = () => { + span.removeEventListener('transitionend', cbIn) + cbOut() + stopAnimation.current = undefined + } + + spanRef.current.addEventListener('transitionend', cbIn) + span.classList.add(styles.highlightIn) + }, [id, location.hash, spanRef.current]) + + return ( + + {children} + + ) +} + +function isInViewport(element: HTMLElement): boolean { + const rect = element.getBoundingClientRect() + return ( + rect.top >= 0 && + rect.left >= 0 && + rect.bottom <= + (window.innerHeight || document.documentElement.clientHeight) && + rect.right <= (window.innerWidth || document.documentElement.clientWidth) + ) +} diff --git a/src/ui/components/IdHighlight/styles.css.ts b/src/ui/components/IdHighlight/styles.css.ts new file mode 100644 index 00000000..09e84c4c --- /dev/null +++ b/src/ui/components/IdHighlight/styles.css.ts @@ -0,0 +1,15 @@ +import { style } from '@vanilla-extract/css' + +export const text = style({ + backgroundColor: '#fffe2500', +}) + +export const highlightIn = style({ + backgroundColor: '#fffe25', + transition: 'background-color 0.25s ease-out', +}) + +export const highlightOut = style({ + backgroundColor: '#fffe2500', + transition: 'background-color 2.5s ease-out', +}) diff --git a/src/ui/components/Missing/index.tsx b/src/ui/components/Missing/index.tsx new file mode 100644 index 00000000..9800e7fe --- /dev/null +++ b/src/ui/components/Missing/index.tsx @@ -0,0 +1,19 @@ +import { Fragment, FunctionComponent, h } from 'preact' + +interface MissingProps { + data?: unknown + message?: string +} + +export const Missing: FunctionComponent = ({ message, data }) => ( +
    { + if (e.shiftKey) console.log(data) + }} + > +
    + {message ? message + ' ' : ''}If you see this,{' '} + ping me. +
    +
    +) diff --git a/src/ui/components/SourceLink/index.tsx b/src/ui/components/SourceLink/index.tsx index 2f80e8d1..c8a0a26b 100644 --- a/src/ui/components/SourceLink/index.tsx +++ b/src/ui/components/SourceLink/index.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames' import { FunctionComponent, h } from 'preact' +import WithDrop from '../WithDrop' import * as styles from './styles.css' interface SourceLinkProps { @@ -18,15 +19,17 @@ export const SourceLink: FunctionComponent = ({ target="_blank" rel="noopener noreferrer" > - - - + + + + + ) : null diff --git a/src/ui/components/SourceLink/styles.css.ts b/src/ui/components/SourceLink/styles.css.ts index 0931a84b..14ce6ae6 100644 --- a/src/ui/components/SourceLink/styles.css.ts +++ b/src/ui/components/SourceLink/styles.css.ts @@ -3,13 +3,14 @@ import { style, styleVariants } from '@vanilla-extract/css' export const link = style({ position: 'relative', top: '2px', + marginLeft: '0.5rem', }) export const icon = style({ color: '#9f8194', display: 'inline-block', transition: 'color 0.15s ease-out', - marginLeft: '0.5rem', + position: 'relative', ':hover': { color: '#6e0839', @@ -19,9 +20,11 @@ export const icon = style({ export const size = styleVariants({ small: { width: '1rem', + top: '1px', }, medium: { width: '1.5rem', + top: '2px', }, }) diff --git a/src/ui/components/TypeDocInterface/index.tsx b/src/ui/components/TypeDocInterface/index.tsx index d3874e0b..3fdd1238 100644 --- a/src/ui/components/TypeDocInterface/index.tsx +++ b/src/ui/components/TypeDocInterface/index.tsx @@ -1,24 +1,36 @@ import { joinCommentParts } from '@date-fns/docs/utils' -import { FunctionComponent, h } from 'preact' +import { Fragment, FunctionComponent, h } from 'preact' +import { useContext } from 'preact/hooks' import type { DeclarationReflection, ParameterReflection, TypeParameterReflection, } from 'typedoc' +import { InlineTypeContext } from '~/ui/contexts/InlineTypeContext' +import { findSource, ParentTypesMap } from '~/utils/docs' +import { IdHightlight } from '../IdHighlight' import { Markdown } from '../Markdown' +import { SourceLink } from '../SourceLink' import { TypeDocType } from '../TypeDocType' import * as styles from './styles.css' -interface TypeDocInterfaceProps { - list: - | ParameterReflection[] - | DeclarationReflection[] - | TypeParameterReflection[] +interface TypeDocInterfaceProps< + Ref extends + | ParameterReflection + | DeclarationReflection + | TypeParameterReflection +> { + list: Ref[] } -export const TypeDocInterface: FunctionComponent = ({ - list, -}) => { +export function TypeDocInterface< + Ref extends + | ParameterReflection + | DeclarationReflection + | TypeParameterReflection +>({ list }: TypeDocInterfaceProps) { + const inline = useContext(InlineTypeContext) + return (
    @@ -30,31 +42,37 @@ export const TypeDocInterface: FunctionComponent = ({ - {list.map((item, index) => ( - - - - - - - - ))} + {list.map((item, index) => { + const id = inline.buildId?.(item) + return ( + + + + + + + + ) + })}
    - {item.name} - - {item.flags.isOptional && ( -
    (optional)
    - )} -
    - {item.type && } - - {item.comment?.summary && ( - - )} - - -
    {JSON.stringify(item, null, 2)}
    -
    -
    + + + {item.name} + {item.flags.isOptional && ?} + + + + + + {item.type && } + + {item.comment?.summary && ( + + )} + + +
    {JSON.stringify(item, null, 2)}
    +
    +
    ) diff --git a/src/ui/components/TypeDocInterface/styles.css.ts b/src/ui/components/TypeDocInterface/styles.css.ts index 3f21f1c8..76fc9b46 100644 --- a/src/ui/components/TypeDocInterface/styles.css.ts +++ b/src/ui/components/TypeDocInterface/styles.css.ts @@ -7,3 +7,7 @@ export const code = style({ export const optional = style({ fontStyle: 'italic', }) + +export const nowrap = style({ + whiteSpace: 'nowrap', +}) diff --git a/src/ui/components/TypeDocReflection/Signature/index.tsx b/src/ui/components/TypeDocReflection/Signature/index.tsx new file mode 100644 index 00000000..b7f13de0 --- /dev/null +++ b/src/ui/components/TypeDocReflection/Signature/index.tsx @@ -0,0 +1,20 @@ +import { Fragment, FunctionComponent, h } from 'preact' +import type { SignatureReflection } from 'typedoc' +import { TypeDocSignature } from '../../TypeDocSignature' + +interface TypeDocReflectionProps { + signature: SignatureReflection + listed: boolean | undefined +} + +export const TypeDocReflectionSignature: FunctionComponent = ({ + signature, + listed, +}) => { + const content = + if (listed) { + return <>({content}) + } else { + return content + } +} diff --git a/src/ui/components/TypeDocReflection/Signature/styles.css.ts b/src/ui/components/TypeDocReflection/Signature/styles.css.ts new file mode 100644 index 00000000..0d587ea4 --- /dev/null +++ b/src/ui/components/TypeDocReflection/Signature/styles.css.ts @@ -0,0 +1,6 @@ +import { style } from '@vanilla-extract/css' + +export const code = style({ + whiteSpace: 'nowrap', + fontFamily: 'monospace', +}) diff --git a/src/ui/components/TypeDocReflection/index.tsx b/src/ui/components/TypeDocReflection/index.tsx new file mode 100644 index 00000000..cb9daeb5 --- /dev/null +++ b/src/ui/components/TypeDocReflection/index.tsx @@ -0,0 +1,31 @@ +import { FunctionComponent, h } from 'preact' +import type { ReflectionType } from 'typedoc' +import { ParentTypesMap } from '~/utils/docs' +import { Missing } from '../Missing' +import { TypeDocReflectionSignature } from './Signature' + +interface TypeDocReflection { + reflection: ReflectionType + listed: boolean | undefined +} + +export const TypeDocReflection: FunctionComponent = ({ + reflection, + listed, +}) => { + if ('signatures' in reflection.declaration) { + if ( + !reflection.declaration.signatures || + reflection.declaration.signatures.length !== 1 + ) + return + + return ( + + ) + } + return +} diff --git a/src/ui/components/TypeDocSignature/Arguments/index.tsx b/src/ui/components/TypeDocSignature/Arguments/index.tsx new file mode 100644 index 00000000..efe603a6 --- /dev/null +++ b/src/ui/components/TypeDocSignature/Arguments/index.tsx @@ -0,0 +1,34 @@ +import { Fragment, FunctionComponent, h } from 'preact' +import type { ParameterReflection } from 'typedoc' +import { ParentTypesMap } from '~/utils/docs' +import { TypeDocType } from '../../TypeDocType' + +interface TypeDocSignatureArgumentsProps { + args: ParameterReflection[] +} + +export const TypeDocSignatureArguments: FunctionComponent = ({ + args, +}) => { + return ( + <> + {args.map((arg, index) => ( + <> +
    + + {' '} + {arg.name} + {arg.flags.isOptional && '?'} + {arg.type && ( + + : + + )} + {arg.defaultValue && = {arg.defaultValue}} + {index < args.length - 1 && ','} + + + ))} + + ) +} diff --git a/src/ui/components/TypeDocSignature/Generics/index.tsx b/src/ui/components/TypeDocSignature/Generics/index.tsx new file mode 100644 index 00000000..067dd501 --- /dev/null +++ b/src/ui/components/TypeDocSignature/Generics/index.tsx @@ -0,0 +1,54 @@ +import { FunctionComponent, h } from 'preact' +import { useContext } from 'preact/hooks' +import type { TypeParameterReflection } from 'typedoc' +import { InlineTypeContext } from '~/ui/contexts/InlineTypeContext' +import { ParentTypesMap, typeHash } from '~/utils/docs' +import { IdHightlight } from '../../IdHighlight' +import { TypeDocType } from '../../TypeDocType' + +interface TypeDocSignatureGenericsProps { + params: TypeParameterReflection[] +} + +export const TypeDocSignatureGenerics: FunctionComponent = ({ + params, +}) => { + const inline = useContext(InlineTypeContext) + + return ( + + {'<'} + {params.map((param, index) => { + const id = inline.buildId?.(param) + return ( + + {inline ? ( + + + {param.name} + + + ) : ( + {param.name} + )} + + {param.type && ( + + {' '} + extends + + )} + {param.default && ( + + {' '} + = + + )} + {index < params.length - 1 && ', '} + + ) + })} + {'>'} + + ) +} diff --git a/src/ui/components/TypeDocSignature/index.tsx b/src/ui/components/TypeDocSignature/index.tsx new file mode 100644 index 00000000..886b5b95 --- /dev/null +++ b/src/ui/components/TypeDocSignature/index.tsx @@ -0,0 +1,44 @@ +import classNames from 'classnames' +import { Fragment, FunctionComponent, h } from 'preact' +import type { SignatureReflection, TypeParameterReflection } from 'typedoc' +import { ParentTypesMap } from '~/utils/docs' +import { TypeDocType } from '../TypeDocType' +import { TypeDocSignatureArguments as Arguments } from './Arguments' +import { TypeDocSignatureGenerics as Generics } from './Generics' +import * as styles from './styles.css' + +interface TypeDocSignatureProps { + name?: string + signature: SignatureReflection +} + +export const TypeDocSignature: FunctionComponent = ({ + name, + signature, +}) => { + const withArgs = signature.parameters && signature.parameters.length > 0 + + return ( + <> + + {name && `function ${name}`} + {signature.typeParameter && ( + + )} + ( + + + {signature.parameters && } + + {withArgs &&
    } + + ) + {signature.type && ( + + {name ? ':' : ' =>'} + + )} + + + ) +} diff --git a/src/ui/components/TypeDocSignature/styles.css.ts b/src/ui/components/TypeDocSignature/styles.css.ts new file mode 100644 index 00000000..54dbffca --- /dev/null +++ b/src/ui/components/TypeDocSignature/styles.css.ts @@ -0,0 +1,5 @@ +import { style } from '@vanilla-extract/css' + +export const withArgs = style({ + display: 'block', +}) diff --git a/src/ui/components/TypeDocType/index.tsx b/src/ui/components/TypeDocType/index.tsx index 20b46de9..78b57126 100644 --- a/src/ui/components/TypeDocType/index.tsx +++ b/src/ui/components/TypeDocType/index.tsx @@ -1,12 +1,26 @@ -import { FunctionComponent, h } from 'preact' +import classNames from 'classnames' +import { FunctionComponent, Fragment, h } from 'preact' +import { useContext } from 'preact/hooks' import type { SomeType } from 'typedoc' +import { InlineTypeContext } from '~/ui/contexts/InlineTypeContext' +import { ParentTypesMap, typeHash } from '~/utils/docs' +import { Debug } from '../Debug' +import { Missing } from '../Missing' +import { TypeDocReflection } from '../TypeDocReflection' import * as styles from './styles.css' -interface Props { +interface TypeDocTypeProps { type: SomeType + /** When the type is part of union or intersection */ + listed?: boolean } -export const TypeDocType: FunctionComponent = ({ type }) => { +export const TypeDocType: FunctionComponent = ({ + type, + listed, +}) => { + const inline = useContext(InlineTypeContext) + switch (type.type) { case 'intrinsic': return {type.name} @@ -21,25 +35,43 @@ export const TypeDocType: FunctionComponent = ({ type }) => { ) case 'reference': + // TODO: Get rid of it one TypeDoc adds it + const id = ((type as unknown) as { id: number }).id + const hash = inline.parentTypesMap?.[id] || typeHash(type.name, id) + const typeArguments = type.typeArguments return ( - - {type.name} - + + {type.package ? ( + {type.name} + ) : ( + {type.name} + )} + + {typeArguments && '<'} + + {typeArguments && ( + <> + {typeArguments.map((arg, index) => ( + <> + + + {index < typeArguments.length - 1 && ', '} + + + ))} + {'>'} + + )} ) case 'union': return ( - + {type.types.map((t, index) => ( - + {index < type.types.length - 1 && ' | '} ))} @@ -47,28 +79,81 @@ export const TypeDocType: FunctionComponent = ({ type }) => { ) case 'literal': - return {JSON.stringify(type.value)} + return {JSON.stringify(type.value)} case 'reflection': + return + + case 'typeOperator': + return ( + + {type.operator} + + ) + + case 'tuple': + return ( + + [ + {type.elements.map((t, index) => ( + + + {index < type.elements.length - 1 && ', '} + + ))} + ] + + ) + + case 'conditional': + return ( + + + extends{' '} + + {' '} + + ? + {' '} + + : + + + ) + + case 'mapped': + return ( + + {'{'}{' '} + + [{type.parameter} in + ]: + {' '} + {'}'} + + ) + + case 'indexedAccess': + return ( + + + [ + + ] + + ) + case 'query': case 'predicate': - case 'indexedAccess': case 'conditional': case 'inferred': case 'unknown': - case 'tuple': - case 'union': case 'intersection': case 'typeOperator': case 'template-literal': case 'named-tuple-member': - case 'mapped': case 'optional': case 'rest': - return ( -
    - If you see this, ping me. -
    - ) + return } } diff --git a/src/ui/components/TypeDocType/styles.css.ts b/src/ui/components/TypeDocType/styles.css.ts index b8fec085..c926f994 100644 --- a/src/ui/components/TypeDocType/styles.css.ts +++ b/src/ui/components/TypeDocType/styles.css.ts @@ -3,3 +3,7 @@ import { style } from '@vanilla-extract/css' export const code = style({ fontFamily: 'monospace', }) + +export const unbreakable = style({ + whiteSpace: 'nowrap', +}) diff --git a/src/ui/components/WithDrop/index.tsx b/src/ui/components/WithDrop/index.tsx new file mode 100644 index 00000000..5ebfc51e --- /dev/null +++ b/src/ui/components/WithDrop/index.tsx @@ -0,0 +1,150 @@ +import classNames from 'classnames' +import { debounce } from 'js-fns' +import { ComponentChildren, h } from 'preact' +import { createPortal } from 'preact/compat' +import { useEffect, useRef, useState } from 'preact/hooks' +import { Drop, DropPosition } from '../Drop' +import * as styles from './styles.css' + +export interface WithDropProps { + drop: ComponentChildren + children: ComponentChildren + trigger?: 'hover' | 'click' | 'render' + 'data-testid'?: string + style?: any + show?: boolean + disabled?: boolean + onShow?: () => void + onHide?: () => void + preferPosition?: DropPosition + inline?: boolean + block?: boolean +} + +export default function WithDrop({ + drop, + children, + trigger = 'hover', + 'data-testid': testId, + style, + show: forceShow, + disabled, + onShow, + onHide, + preferPosition, + inline, + block, +}: WithDropProps) { + const portals = + typeof document !== 'undefined' && document.getElementById('portals') + const [show, setShowState] = useState(!!forceShow) + + useEffect(() => { + const newShow = !!forceShow + if (show !== newShow) setShowState(newShow) + }, [forceShow]) + + function setShow(newShow: boolean) { + newShow ? onShow?.() : onHide?.() + setShowState(newShow) + } + const [_, setScrollUpdated] = useState(0) + const containerRef = useRef(null) + const dropRef = useRef(undefined) + const area = containerRef.current?.getBoundingClientRect() + + useEffect(() => { + if (!containerRef.current) return + const listener = debounce(() => setScrollUpdated(Date.now()), 50) + window.addEventListener('scroll', listener, true) + window.addEventListener('resize', listener) + return () => { + window.removeEventListener('scroll', listener, true) + window.removeEventListener('resize', listener) + } + }, [containerRef.current]) + + useEffect(() => { + if (!show) return + + const listener = (e: MouseEvent) => { + if (!show || trigger !== 'click' || !dropRef.current || !e.target) return + const outsideClick = !dropRef.current.contains(e.target as Node) + if (outsideClick) setShow(false) + } + + window.addEventListener('click', listener) + return () => window.removeEventListener('click', listener) + }, [show]) + + useEffect(() => { + if (!show || trigger !== 'hover') return + + const listener = (e: MouseEvent) => { + const { x, y } = e + const dropArea = dropRef.current?.getBoundingClientRect() + const containerArea = containerRef.current?.getBoundingClientRect() + + const insideDrop = + dropArea && + x >= dropArea.left && + x <= dropArea.right && + y >= dropArea.top && + y <= dropArea.bottom + + const insideContainer = + containerArea && + x >= containerArea.left && + x <= containerArea.right && + y >= containerArea.top && + y <= containerArea.bottom + + if (!forceShow && !insideDrop && !insideContainer) setShow(false) + } + + document.addEventListener('mousemove', listener) + return () => document.removeEventListener('mousemove', listener) + }, [show, trigger, containerRef.current, dropRef.current]) + + return ( +
    setShow(true) : undefined} + onClick={ + trigger === 'click' && !disabled + ? (e: MouseEvent) => { + e.preventDefault() + e.stopPropagation() + setShow(!show) + } + : undefined + } + data-testid={testId} + style={style} + > + {children} + {portals && + area && + show && + drop && + createPortal( + setShow(!show) : undefined} + area={area} + innerRef={dropRef} + preferPosition={preferPosition} + > + {drop} + , + portals + )} +
    + ) +} diff --git a/src/ui/components/WithDrop/styles.css.ts b/src/ui/components/WithDrop/styles.css.ts new file mode 100644 index 00000000..07fe2386 --- /dev/null +++ b/src/ui/components/WithDrop/styles.css.ts @@ -0,0 +1,15 @@ +import { globalStyle, style } from '@vanilla-extract/css' + +export const wrapper = style({ + display: 'inline-block', +}) + +export const inlineWrapper = style({ + display: 'inline', +}) + +export const blockWrapper = style({}) + +globalStyle(`${wrapper} > *`, { + width: '100%', +}) diff --git a/src/ui/contexts/InlineTypeContext/index.tsx b/src/ui/contexts/InlineTypeContext/index.tsx new file mode 100644 index 00000000..b1fd601c --- /dev/null +++ b/src/ui/contexts/InlineTypeContext/index.tsx @@ -0,0 +1,18 @@ +import { createContext } from 'preact' +import type { + DeclarationReflection, + ParameterReflection, + TypeParameterReflection, +} from 'typedoc' + +export type ParentTypesMap = Record + +export interface InlineTypeContextValue { + buildId?: ( + ref: TypeParameterReflection | ParameterReflection | DeclarationReflection + ) => string + idHighlightMatch?: (id: string, hash: string) => boolean + parentTypesMap?: ParentTypesMap +} + +export const InlineTypeContext = createContext({}) diff --git a/src/ui/global.css b/src/ui/global.css index 4d8442b7..57e993b1 100644 --- a/src/ui/global.css +++ b/src/ui/global.css @@ -44,3 +44,8 @@ code:after { letter-spacing: -0.2em; content: '\00a0'; } + +:root { + --color-tooltip-canvas: #280027; + --color-tooltip-ink: #fff5ff; +} diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Constants/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Constants/index.tsx index fbb41423..dd1b60ff 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Constants/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Constants/index.tsx @@ -122,14 +122,16 @@ function Constant({ item, query }: ConstantProps) { return (
    -

    - - +

    + + + + + + - -

    {description && ( diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Constants/styles.css.ts b/src/ui/screens/Docs/Doc/TypeDoc/Constants/styles.css.ts index 851351f6..b7f586d8 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Constants/styles.css.ts +++ b/src/ui/screens/Docs/Doc/TypeDoc/Constants/styles.css.ts @@ -13,3 +13,9 @@ export const search = style({ export const name = style({ fontFamily: 'monospace', }) + +export const sectionHeader = style({ + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', +}) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/Type/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/Type/index.tsx index 48eacd0e..3d05ac71 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Function/Type/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/Type/index.tsx @@ -1,15 +1,8 @@ -import classNames from 'classnames' import { Fragment, FunctionComponent, h } from 'preact' -import type { - ParameterReflection, - SignatureReflection, - TypeParameterReflection, -} from 'typedoc' +import type { SignatureReflection } from 'typedoc' import { Code } from '~/ui/components/Code' -import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' import { SectionHeader } from '~/ui/components/SectionHeader' -import { TypeDocType } from '~/ui/components/TypeDocType' -import * as styles from './styles.css' +import { TypeDocSignature } from '~/ui/components/TypeDocSignature' interface TypeProps { name: string @@ -24,91 +17,10 @@ export const Type: FunctionComponent = ({ scope, header, }) => { - const withArgs = signature.parameters && signature.parameters.length > 0 - return (
    - - - - function {name} - {signature.typeParameter && ( - - )} - ( - - - {signature.parameters && } - - - ) - {signature.type && ( - - : - - )} - ; - -

    - } - /> + } /> ) } - -interface GenericsProps { - params: TypeParameterReflection[] -} - -function Generics({ params }: GenericsProps) { - return ( - - {'<'} - {params.map((param, index) => ( - - {param.name} - {param.type && ( - - {' '} - extends - - )} - {param.default && ( - - {' '} - = - - )} - {index < params.length - 1 && ', '} - - ))} - {'>'} - - ) -} - -interface ArgumentsProps { - args: ParameterReflection[] -} - -function Arguments({ args }: ArgumentsProps) { - return ( - <> - {args.map((arg) => ( -
    - {' '} - {arg.name} - {arg.type && ( - - : - - )} - {arg.defaultValue && = {arg.defaultValue}} -
    - ))} - - ) -} diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx index 1a44088b..1553a03c 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx @@ -8,7 +8,11 @@ import { DocExamples } from '~/ui/components/DocExamples' import { DocHeader } from '~/ui/components/DocHeader' import { DocLinks } from '~/ui/components/DocLinks' import { DocUsage } from '~/ui/components/DocUsage' -import { extractCodeFromTagString, generateUsage } from '~/utils/docs' +import { + extractCodeFromTagString, + findSource, + generateUsage, +} from '~/utils/docs' import { Signatures } from './Signatures' interface TypeDocFunctionProps { @@ -31,7 +35,7 @@ export const TypeDocFunction: FunctionComponent = ({ return (
    - {page.title} + {page.title} {description && } diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx index eb0849ff..b71e3bec 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx @@ -1,99 +1,141 @@ -import { joinCommentParts } from '@date-fns/docs/utils' +import { joinCommentParts, traverseType } from '@date-fns/docs/utils' import { h } from 'preact' import { useMemo } from 'preact/hooks' -import type { DeclarationReflection } from 'typedoc' -import { TypeDocInterface } from '~/ui/components/TypeDocInterface' +import type { DeclarationReflection, SignatureReflection } from 'typedoc' +import { Code } from '~/ui/components/Code' import { Item } from '~/ui/components/Item' import { Markdown } from '~/ui/components/Markdown' +import { Missing } from '~/ui/components/Missing' import { createModal } from '~/ui/components/Modals' import { RichText } from '~/ui/components/RichText' +import { SourceLink } from '~/ui/components/SourceLink' +import { TypeDocInterface } from '~/ui/components/TypeDocInterface' import { TypeDocType } from '~/ui/components/TypeDocType' +import { InlineTypeContext } from '~/ui/contexts/InlineTypeContext' +import { + findSource, + inlineTypeHash, + inlineTypeId, + inlineTypeIdHighlightMatch, + ParentTypesMap, + typeHash, +} from '~/utils/docs' import * as styles from './styles.css' export interface TypesModalProps { + parent: string typeId: number doc: DeclarationReflection + nestedId: number | undefined } export const useTypesModal = createModal( - ({ typeId, doc }) => { + ({ parent, typeId, doc }) => { const types = useMemo(() => extractTypes(doc), [doc]) const map = useMemo(() => buildMap(types), [types]) - const type = map[typeId] + const type = map[typeId] as DeclarationReflection | undefined + const parentTypesMap = buildParentTypesMap(type) console.log('>>> TYPE', type) + console.log('>>> MAP', parentTypesMap) return ( -
    -
    - {types.map((type) => ( - - - - ))} -
    - - {type ? ( -
    -

    - {type.name}{' '} - {type.kindString && ( - - {kindToBadgeTitle(type.kindString)} - - )} -

    - - {type.comment?.summary && ( - -
    - -
    -
    - )} - - - {type.type && ( -
    -

    Type

    - -
    - -
    -
    - )} + { + console.log(type, inlineTypeId(type, t)) + return inlineTypeId(type, t) + }, + idHighlightMatch: inlineTypeIdHighlightMatch, + parentTypesMap, + } + : {} + } + > +
    +
    + {parent} types +
    - {type.typeParameters && ( -
    -

    Generics

    +
    +
    + {types.map((type) => ( + + + + ))} +
    - + {type ? ( +
    +
    +

    + {type.name} + {type.kindString && ( + + {kindToBadgeTitle(type.kindString)} + + )} +

    + +
    - )} - - - - -
    {JSON.stringify(type, null, 2)}
    -
    -
    - ) : ( -
    - The type definition is not found. If you see this,{' '} - ping me. + {type.comment?.summary && ( + +
    + +
    +
    + )} + + + {type.type && ( +
    +

    Type

    + + } /> +
    + )} + + {type.typeParameters && ( +
    +

    Generics

    + + +
    + )} + + +
    + + +
    {JSON.stringify(type, null, 2)}
    +
    +
    + ) : ( +
    + +
    + )}
    - )} -
    +
    +
    ) }, { size: 'xlarge', closeOnOverlayClick: true } @@ -111,6 +153,7 @@ function TypeContent({ type }: ContentProps) { return (

    Interface

    +
    ) @@ -122,9 +165,7 @@ function TypeContent({ type }: ContentProps) {

    Default type

    -
    - -
    + } />
    )}
    @@ -135,6 +176,21 @@ function TypeContent({ type }: ContentProps) { } } +function TitleIcon() { + return ( + + + + ) +} + function extractTypes( dec: DeclarationReflection, acc?: DeclarationReflection[] @@ -212,3 +268,28 @@ function kindToBadgeTitle(kindString: string): string { return 'TODO' } } + +function buildParentTypesMap( + refl: DeclarationReflection | undefined, + type: DeclarationReflection | SignatureReflection | undefined = refl, + accMap?: ParentTypesMap +): ParentTypesMap { + const map: ParentTypesMap = accMap || {} + + refl && + ((refl && type?.typeParameter) || type?.typeParameters)?.map((ref) => { + map[ref.id] = inlineTypeHash(refl, ref) + }) + + type?.type && + traverseType(type.type, (ref) => { + console.log(' ~~~', ref) + if (ref.type === 'reflection') { + ref.declaration?.signatures?.forEach((signature) => { + buildParentTypesMap(refl, signature, map) + }) + } + }) + + return map +} diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts b/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts index 187c6d29..e41a1849 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts +++ b/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts @@ -1,43 +1,29 @@ import { globalStyle, style, styleVariants } from '@vanilla-extract/css' -export const badgeBase = style({ - fontSize: '1.1rem', - padding: '.1rem .3rem', - borderRadius: '5px', - border: '1px solid black', - verticalAlign: 'top', -}) +export const wrapper = style({}) -export const badge = styleVariants({ - alias: [ - badgeBase, - { - color: '#146066', - borderColor: '#5ae6f1', - backgroundColor: '#d5fcff', - }, - ], +export const title = style({ + background: '#ebe1d8', + borderBottom: '1px solid #e6e0e6', + padding: '.5rem 1rem', + fontSize: '1rem', + fontWeight: 600, + color: '#7b6d77', +}) - interface: [ - badgeBase, - { - color: '#004813', - borderColor: '#9dbfa6', - backgroundColor: '#e2f7e8', - }, - ], +export const titleIcon = style({ + width: '1.2rem', + color: '#8d6831', + position: 'relative', + top: '2px', + marginRight: '.25rem', +}) - generic: [ - badgeBase, - { - color: '#786c07', - borderColor: '#ddd491', - backgroundColor: '#fffad7', - }, - ], +export const titleParent = style({ + fontFamily: 'monospace', }) -export const wrapper = style({ +export const inner = style({ display: 'grid', gridTemplateColumns: '23rem auto', maxHeight: '50rem', @@ -66,21 +52,58 @@ globalStyle(`${content} h3`, { export const header = style({ color: '#770c56', - fontSize: '1.5rem', marginBottom: '1rem', - fontFamily: 'monospace', paddingBottom: '1rem', borderBottom: '1px solid #5844521a', + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', }) -export const summary = style({ - fontSize: '1rem', +export const headerText = style({ + fontSize: '1.5rem', + fontFamily: 'monospace', }) -export const code = style({ - overflowX: 'auto', - border: '1px solid #b9a2b2', - backgroundColor: '#fffffe', - padding: '.25rem .5rem', - fontFamily: 'monospace', +export const badgeBase = style({ + fontSize: '1.1rem', + padding: '.1rem .3rem', + borderRadius: '5px', + border: '1px solid black', + marginLeft: '.5rem', + position: 'relative', + top: '-1px', +}) + +export const badge = styleVariants({ + alias: [ + badgeBase, + { + color: '#146066', + borderColor: '#5ae6f1', + backgroundColor: '#d5fcff', + }, + ], + + interface: [ + badgeBase, + { + color: '#004813', + borderColor: '#9dbfa6', + backgroundColor: '#e2f7e8', + }, + ], + + generic: [ + badgeBase, + { + color: '#786c07', + borderColor: '#ddd491', + backgroundColor: '#fffad7', + }, + ], +}) + +export const summary = style({ + fontSize: '1rem', }) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/index.tsx index 34b23413..926cfefd 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/index.tsx @@ -1,36 +1,32 @@ import type { DateFnsDocs } from '@date-fns/docs/types' import { FunctionComponent, h } from 'preact' import { useContext, useEffect, useMemo } from 'preact/hooks' +import { parse } from 'typeroo' import { RouterContext } from '~/ui/router' +import { matchTypeHash } from '~/utils/docs' +import { TypeDocConstants } from './Constants' import { TypeDocFunction } from './Function' import { useTypesModal } from './Types' -import { parse } from 'typeroo' -import { TypeDocConstants } from './Constants' -import type { DeclarationReflection } from 'typedoc' interface TypeDocProps { page: DateFnsDocs.TypeDocPage } -const typeHashRE = /types\/(\w+)\/(\w+)/ - export const TypeDoc: FunctionComponent = ({ page }) => { const { location, navigate } = useContext(RouterContext) - const showTypesModal = useTypesModal() const doc = useMemo(() => parse(page.doc), [page.slug]) + const showTypesModal = useTypesModal() useEffect(() => { - const captures = location.hash.match(typeHashRE) - if (!captures) return - - const type = captures[2] - if (!type) return + const { typeId, nestedId } = matchTypeHash(location.hash) - const typeId = parseInt(type) - if (isNaN(typeId)) return + if (!typeId) return showTypesModal({ + parent: page.title, typeId, + nestedId: + nestedId === undefined || isNaN(nestedId) ? undefined : nestedId, doc, onClose: () => { // TODO: Fix Switcher to allow replacing the current location diff --git a/src/ui/screens/Docs/Doc/index.tsx b/src/ui/screens/Docs/Doc/index.tsx index 0cd0990b..c8387f32 100644 --- a/src/ui/screens/Docs/Doc/index.tsx +++ b/src/ui/screens/Docs/Doc/index.tsx @@ -52,23 +52,35 @@ export const Doc: FunctionComponent = ({ -
    - - - +
    +
    + + + +
    ) } else if (pages && pages.length === 0) { return ( -
    - This page is not available for this version or this submodule +
    +
    + This page is not available for this version or this submodule +
    ) } else if (loading) { - return
    Loading...
    + return ( +
    +
    Loading...
    +
    + ) } else { // FIXME: - return
    Error!
    + return ( +
    +
    Error!
    +
    + ) } } diff --git a/src/ui/screens/Docs/Doc/styles.css.ts b/src/ui/screens/Docs/Doc/styles.css.ts index df8cc46b..7f2cff1d 100644 --- a/src/ui/screens/Docs/Doc/styles.css.ts +++ b/src/ui/screens/Docs/Doc/styles.css.ts @@ -1,9 +1,14 @@ import { style, globalStyle } from '@vanilla-extract/css' -export const container = style({ +export const wrapper = style({ padding: '30px', color: '#4a3142', backgroundColor: '#fffdf9', width: '100%', minHeight: '100%', }) + +export const inner = style({ + maxWidth: '60rem', + margin: '0 auto', +}) diff --git a/src/utils/docs/index.ts b/src/utils/docs/index.ts index 23e6c611..2fffda0c 100644 --- a/src/utils/docs/index.ts +++ b/src/utils/docs/index.ts @@ -1,4 +1,11 @@ -import type { DeclarationReflection } from 'typedoc' +import type { + DeclarationReflection, + ParameterReflection, + SignatureReflection, + TypeParameterReflection, +} from 'typedoc' + +export type ParentTypesMap = Record export function generateUsage(name: string, module = name) { const usage = { @@ -22,8 +29,15 @@ export function extractCodeFromTagString(example: string): string { return example.match(/```ts\n([\s\S]+?)\n```/)?.[1] ?? '' } -export function findSource(ref: DeclarationReflection, trimHash = false) { - const url = ref.sources?.[0].url +export function findSource( + ref: + | ParameterReflection + | DeclarationReflection + | TypeParameterReflection + | undefined, + trimHash = false +) { + const url = ref?.sources?.[0].url if (!url) return return trimHash ? url.replace(/#.*$/, '') : url } @@ -33,3 +47,55 @@ export function hightlightMarkdown(text: string, query: string) { const regex = new RegExp(query, 'gi') return text.replace(regex, (match) => `==${match}==`) } + +export function typeHash(name: string, id: number, nested?: string) { + return `#${typeId(name, id, nested)}` +} + +export function typeId(name: string, id: number, nested?: string) { + return `types/${name}/${id}${nested ? `/${nested}` : ''}` +} + +const typeHashRE = /types\/\w+\/(\d+)(?:\/\w+\/(\d+)(?:\/\w+))?/ + +export function matchTypeHash(hash: string) { + const captures = hash.match(typeHashRE) + if (!captures) return {} + + const type = captures[1] + if (!type) return {} + + const typeId = parseInt(type) + if (isNaN(typeId)) return {} + + const nestedId = captures[2] ? parseInt(captures[2]) : undefined + + return { typeId, nestedId } +} + +export function inlineTypeHash( + refl: DeclarationReflection, + type: TypeParameterReflection | ParameterReflection | DeclarationReflection +) { + return `#${inlineTypeId(refl, type)}` +} + +export function inlineTypeId( + refl: DeclarationReflection, + type: TypeParameterReflection | ParameterReflection | DeclarationReflection +) { + return typeId(refl.name, refl.id, `${type.name}/${type.id}/${rand()}`) +} + +export function inlineTypeIdHighlightMatch(id: string, hash: string) { + const idMatches = matchTypeHash(id) + const hashMatches = matchTypeHash(hash) + return ( + idMatches.typeId === hashMatches.typeId && + idMatches.nestedId === hashMatches.nestedId + ) +} + +function rand() { + return btoa(Math.random().toString().slice(2, 5)).slice(0, 3) +} diff --git a/yarn.lock b/yarn.lock index 11d8fa01..03967a03 100644 --- a/yarn.lock +++ b/yarn.lock @@ -251,10 +251,10 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@date-fns/docs@0.21.1": - version "0.21.1" - resolved "https://registry.yarnpkg.com/@date-fns/docs/-/docs-0.21.1.tgz#e4dc7277c1fb6957bdcbcffbbb2d560018394cda" - integrity sha512-pRejd20/ptuMoY9pLXGPh8wy8MBn9zHhNb40bfWcOq++vPt5t/VIT7/upD2qIiAWjdpEyAvFbKQBqjg9zEbyLA== +"@date-fns/docs@0.22.0": + version "0.22.0" + resolved "https://registry.yarnpkg.com/@date-fns/docs/-/docs-0.22.0.tgz#aaaafdba6b5c192ef2e2cb8a969821498592f42d" + integrity sha512-LKpsZZZXy2oqAW62TQ7UZCN3uoO1eCj6RTaEHE9h6fruQ9EoxjHV7kl+ENtNPpL4zUCTxwiQgkeRDytH8z0G8Q== dependencies: firebase-admin "^11.4.1" js-fns "^2.5.2" From 988f2fa1cf4ce88ed4b9162b7702c8c9eea07c9c Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Tue, 7 Feb 2023 10:41:05 +0800 Subject: [PATCH 17/36] Object reflection, indentation, proper type styling, imports --- src/ui/components/DocReturns/index.tsx | 5 +- src/ui/components/InlineCode/index.tsx | 10 +++ src/ui/components/InlineCode/styles.css.ts | 8 ++ src/ui/components/TypeDocInterface/index.tsx | 7 +- .../TypeDocReflection/Object/index.tsx | 34 ++++++++ .../{Signature => Object}/styles.css.ts | 0 .../TypeDocReflection/Signature/index.tsx | 4 +- src/ui/components/TypeDocReflection/index.tsx | 5 +- .../TypeDocSignature/Arguments/index.tsx | 11 ++- .../TypeDocSignature/Generics/index.tsx | 18 ++-- src/ui/components/TypeDocType/index.tsx | 86 +++++++++---------- .../InlineTypeContext/{index.tsx => index.ts} | 0 src/ui/contexts/TypeIndentContext/index.ts | 3 + .../screens/Docs/Doc/TypeDoc/Types/index.tsx | 34 +++++++- src/utils/docs/index.ts | 13 +++ 15 files changed, 172 insertions(+), 66 deletions(-) create mode 100644 src/ui/components/InlineCode/index.tsx create mode 100644 src/ui/components/InlineCode/styles.css.ts create mode 100644 src/ui/components/TypeDocReflection/Object/index.tsx rename src/ui/components/TypeDocReflection/{Signature => Object}/styles.css.ts (100%) rename src/ui/contexts/InlineTypeContext/{index.tsx => index.ts} (100%) create mode 100644 src/ui/contexts/TypeIndentContext/index.ts diff --git a/src/ui/components/DocReturns/index.tsx b/src/ui/components/DocReturns/index.tsx index 7f95c3a4..7e074c47 100644 --- a/src/ui/components/DocReturns/index.tsx +++ b/src/ui/components/DocReturns/index.tsx @@ -1,5 +1,6 @@ import { ComponentChildren, Fragment, FunctionComponent, h } from 'preact' import { Markdown } from '~/ui/components/Markdown' +import { InlineCode } from '../InlineCode' import { SectionHeader } from '../SectionHeader' interface ReturnType { @@ -33,7 +34,9 @@ export const DocReturns: FunctionComponent = ({ {returns.map((returnData, index) => ( - {returnData.type} + + {returnData.type} + diff --git a/src/ui/components/InlineCode/index.tsx b/src/ui/components/InlineCode/index.tsx new file mode 100644 index 00000000..6f15ef84 --- /dev/null +++ b/src/ui/components/InlineCode/index.tsx @@ -0,0 +1,10 @@ +import { ComponentChildren, Fragment, FunctionComponent, h } from 'preact' +import * as styles from './styles.css' + +interface InlineCodeProps { + children: ComponentChildren +} + +export const InlineCode: FunctionComponent = ({ + children, +}) => {children} diff --git a/src/ui/components/InlineCode/styles.css.ts b/src/ui/components/InlineCode/styles.css.ts new file mode 100644 index 00000000..981bd9c2 --- /dev/null +++ b/src/ui/components/InlineCode/styles.css.ts @@ -0,0 +1,8 @@ +import { style } from '@vanilla-extract/css' + +export const code = style({ + fontFamily: 'monospace', + display: 'block', + textIndent: '-10px', + paddingLeft: '10px', +}) diff --git a/src/ui/components/TypeDocInterface/index.tsx b/src/ui/components/TypeDocInterface/index.tsx index 3fdd1238..6c7966b8 100644 --- a/src/ui/components/TypeDocInterface/index.tsx +++ b/src/ui/components/TypeDocInterface/index.tsx @@ -9,6 +9,7 @@ import type { import { InlineTypeContext } from '~/ui/contexts/InlineTypeContext' import { findSource, ParentTypesMap } from '~/utils/docs' import { IdHightlight } from '../IdHighlight' +import { InlineCode } from '../InlineCode' import { Markdown } from '../Markdown' import { SourceLink } from '../SourceLink' import { TypeDocType } from '../TypeDocType' @@ -58,7 +59,11 @@ export function TypeDocInterface< - {item.type && } + {item.type && ( + + + + )} diff --git a/src/ui/components/TypeDocReflection/Object/index.tsx b/src/ui/components/TypeDocReflection/Object/index.tsx new file mode 100644 index 00000000..c2647993 --- /dev/null +++ b/src/ui/components/TypeDocReflection/Object/index.tsx @@ -0,0 +1,34 @@ +import { Fragment, FunctionComponent, h } from 'preact' +import { useContext } from 'preact/hooks' +import type { DeclarationReflection } from 'typedoc' +import { TypeIndentContext } from '~/ui/contexts/TypeIndentContext' +import { Debug } from '../../Debug' +import { TypeDocSignature } from '../../TypeDocSignature' +import { TypeDocType } from '../../TypeDocType' + +interface TypeDocReflectionObjectProps { + declaration: DeclarationReflection +} + +export const TypeDocReflectionObject: FunctionComponent = ({ + declaration, +}) => { + const indent = useContext(TypeIndentContext) + const localIndent = indent + 2 + + return ( + + {'{'} + {declaration.children?.map((child) => ( + <> +
    + {' '.repeat(localIndent)} + {child.name} + {child.flags.isOptional && '?'}: + + ))} +
    + {' '.repeat(indent) + '}'} +
    + ) +} diff --git a/src/ui/components/TypeDocReflection/Signature/styles.css.ts b/src/ui/components/TypeDocReflection/Object/styles.css.ts similarity index 100% rename from src/ui/components/TypeDocReflection/Signature/styles.css.ts rename to src/ui/components/TypeDocReflection/Object/styles.css.ts diff --git a/src/ui/components/TypeDocReflection/Signature/index.tsx b/src/ui/components/TypeDocReflection/Signature/index.tsx index b7f13de0..2cb95a50 100644 --- a/src/ui/components/TypeDocReflection/Signature/index.tsx +++ b/src/ui/components/TypeDocReflection/Signature/index.tsx @@ -2,12 +2,12 @@ import { Fragment, FunctionComponent, h } from 'preact' import type { SignatureReflection } from 'typedoc' import { TypeDocSignature } from '../../TypeDocSignature' -interface TypeDocReflectionProps { +interface TypeDocReflectionSignatureProps { signature: SignatureReflection listed: boolean | undefined } -export const TypeDocReflectionSignature: FunctionComponent = ({ +export const TypeDocReflectionSignature: FunctionComponent = ({ signature, listed, }) => { diff --git a/src/ui/components/TypeDocReflection/index.tsx b/src/ui/components/TypeDocReflection/index.tsx index cb9daeb5..480dee3c 100644 --- a/src/ui/components/TypeDocReflection/index.tsx +++ b/src/ui/components/TypeDocReflection/index.tsx @@ -1,7 +1,7 @@ import { FunctionComponent, h } from 'preact' import type { ReflectionType } from 'typedoc' -import { ParentTypesMap } from '~/utils/docs' import { Missing } from '../Missing' +import { TypeDocReflectionObject } from './Object' import { TypeDocReflectionSignature } from './Signature' interface TypeDocReflection { @@ -27,5 +27,6 @@ export const TypeDocReflection: FunctionComponent = ({ /> ) } - return + + return } diff --git a/src/ui/components/TypeDocSignature/Arguments/index.tsx b/src/ui/components/TypeDocSignature/Arguments/index.tsx index efe603a6..531f4d41 100644 --- a/src/ui/components/TypeDocSignature/Arguments/index.tsx +++ b/src/ui/components/TypeDocSignature/Arguments/index.tsx @@ -1,5 +1,7 @@ import { Fragment, FunctionComponent, h } from 'preact' +import { useContext } from 'preact/hooks' import type { ParameterReflection } from 'typedoc' +import { TypeIndentContext } from '~/ui/contexts/TypeIndentContext' import { ParentTypesMap } from '~/utils/docs' import { TypeDocType } from '../../TypeDocType' @@ -10,13 +12,16 @@ interface TypeDocSignatureArgumentsProps { export const TypeDocSignatureArguments: FunctionComponent = ({ args, }) => { + const indent = useContext(TypeIndentContext) + const localIndent = indent + 2 + return ( - <> + {args.map((arg, index) => ( <>
    - {' '} + {' '.repeat(localIndent)} {arg.name} {arg.flags.isOptional && '?'} {arg.type && ( @@ -29,6 +34,6 @@ export const TypeDocSignatureArguments: FunctionComponent ))} - +
    ) } diff --git a/src/ui/components/TypeDocSignature/Generics/index.tsx b/src/ui/components/TypeDocSignature/Generics/index.tsx index 067dd501..b007a41d 100644 --- a/src/ui/components/TypeDocSignature/Generics/index.tsx +++ b/src/ui/components/TypeDocSignature/Generics/index.tsx @@ -1,4 +1,4 @@ -import { FunctionComponent, h } from 'preact' +import { FunctionComponent, h, Fragment } from 'preact' import { useContext } from 'preact/hooks' import type { TypeParameterReflection } from 'typedoc' import { InlineTypeContext } from '~/ui/contexts/InlineTypeContext' @@ -16,12 +16,12 @@ export const TypeDocSignatureGenerics: FunctionComponent + <> {'<'} {params.map((param, index) => { const id = inline.buildId?.(param) return ( - + <> {inline ? ( @@ -33,22 +33,22 @@ export const TypeDocSignatureGenerics: FunctionComponent + <> {' '} extends - + )} {param.default && ( - + <> {' '} = - + )} {index < params.length - 1 && ', '} - + ) })} {'>'} - + ) } diff --git a/src/ui/components/TypeDocType/index.tsx b/src/ui/components/TypeDocType/index.tsx index 78b57126..866e0755 100644 --- a/src/ui/components/TypeDocType/index.tsx +++ b/src/ui/components/TypeDocType/index.tsx @@ -23,15 +23,15 @@ export const TypeDocType: FunctionComponent = ({ switch (type.type) { case 'intrinsic': - return {type.name} + return <>{type.name} case 'array': return ( - + <> Array{'<'} {'>'} - + ) case 'reference': @@ -40,107 +40,104 @@ export const TypeDocType: FunctionComponent = ({ const hash = inline.parentTypesMap?.[id] || typeHash(type.name, id) const typeArguments = type.typeArguments return ( - - - {type.package ? ( - {type.name} - ) : ( - {type.name} - )} + <> + <> + {type.package ? <>{type.name} : {type.name}} {typeArguments && '<'} - + {typeArguments && ( <> {typeArguments.map((arg, index) => ( <> - - - {index < typeArguments.length - 1 && ', '} - + + {index < typeArguments.length - 1 && <>, } ))} {'>'} )} - + ) case 'union': return ( - + <> {type.types.map((t, index) => ( - + <> + {index !== 0 && <>| } - {index < type.types.length - 1 && ' | '} - + {index < type.types.length - 1 && <> } + ))} - + ) + case 'intersection': + case 'literal': - return {JSON.stringify(type.value)} + return <>{JSON.stringify(type.value)} case 'reflection': return case 'typeOperator': return ( - + <> {type.operator} - + ) case 'tuple': return ( - + <> [ {type.elements.map((t, index) => ( - + <> {index < type.elements.length - 1 && ', '} - + ))} ] - + ) case 'conditional': return ( - - + <> + <> extends{' '} - {' '} - + {' '} + <> ? - {' '} - + {' '} + <> : - - + + ) case 'mapped': return ( - + <> {'{'}{' '} - + <> [{type.parameter} in ]: - {' '} + {' '} {'}'} - + ) case 'indexedAccess': return ( - - + <> + <> [ - + ] - + ) case 'query': @@ -148,7 +145,6 @@ export const TypeDocType: FunctionComponent = ({ case 'conditional': case 'inferred': case 'unknown': - case 'intersection': case 'typeOperator': case 'template-literal': case 'named-tuple-member': diff --git a/src/ui/contexts/InlineTypeContext/index.tsx b/src/ui/contexts/InlineTypeContext/index.ts similarity index 100% rename from src/ui/contexts/InlineTypeContext/index.tsx rename to src/ui/contexts/InlineTypeContext/index.ts diff --git a/src/ui/contexts/TypeIndentContext/index.ts b/src/ui/contexts/TypeIndentContext/index.ts new file mode 100644 index 00000000..ce7caa09 --- /dev/null +++ b/src/ui/contexts/TypeIndentContext/index.ts @@ -0,0 +1,3 @@ +import { createContext } from 'preact' + +export const TypeIndentContext = createContext(0) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx index b71e3bec..4d2e4351 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx @@ -3,6 +3,7 @@ import { h } from 'preact' import { useMemo } from 'preact/hooks' import type { DeclarationReflection, SignatureReflection } from 'typedoc' import { Code } from '~/ui/components/Code' +import { DocUsage } from '~/ui/components/DocUsage' import { Item } from '~/ui/components/Item' import { Markdown } from '~/ui/components/Markdown' import { Missing } from '~/ui/components/Missing' @@ -14,11 +15,13 @@ import { TypeDocType } from '~/ui/components/TypeDocType' import { InlineTypeContext } from '~/ui/contexts/InlineTypeContext' import { findSource, + generateTypeUsage, inlineTypeHash, inlineTypeId, inlineTypeIdHighlightMatch, ParentTypesMap, typeHash, + typeId as typeIdStr, } from '~/utils/docs' import * as styles from './styles.css' @@ -35,9 +38,13 @@ export const useTypesModal = createModal( const map = useMemo(() => buildMap(types), [types]) const type = map[typeId] as DeclarationReflection | undefined const parentTypesMap = buildParentTypesMap(type) - - console.log('>>> TYPE', type) - console.log('>>> MAP', parentTypesMap) + const usage = useMemo( + () => + type?.kindString && + kindHasUsage(type.kindString) && + generateTypeUsage(type.name), + [type] + ) return ( ( )} + {usage && ( + + )} + {type.type && (

    Type

    @@ -237,6 +253,18 @@ function buildMap(types: DeclarationReflection[]) { return map } +function kindHasUsage(kindString: string): boolean { + switch (kindString) { + case 'Type alias': + case 'Interface': + return true + + case 'Type parameter': + default: + return false + } +} + function kindToBadgeStyle(kindString: string): keyof typeof styles.badge { switch (kindString) { case 'Type alias': diff --git a/src/utils/docs/index.ts b/src/utils/docs/index.ts index 2fffda0c..919371e1 100644 --- a/src/utils/docs/index.ts +++ b/src/utils/docs/index.ts @@ -25,6 +25,19 @@ export function generateUsage(name: string, module = name) { return { usage, usageTabs } } +export function generateTypeUsage(name: string) { + const usage = { + esm: { + code: `import type { ${name} } from "date-fns";`, + title: 'ESM', + }, + } + + const usageTabs = ['esm'] + + return { usage, usageTabs } +} + export function extractCodeFromTagString(example: string): string { return example.match(/```ts\n([\s\S]+?)\n```/)?.[1] ?? '' } From a785f4320039b9e5f0b16a8843450b9dbf640580 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Tue, 7 Feb 2023 10:44:52 +0800 Subject: [PATCH 18/36] Add section headers to types --- .../screens/Docs/Doc/TypeDoc/Types/index.tsx | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx index 4d2e4351..434aac86 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx @@ -9,6 +9,7 @@ import { Markdown } from '~/ui/components/Markdown' import { Missing } from '~/ui/components/Missing' import { createModal } from '~/ui/components/Modals' import { RichText } from '~/ui/components/RichText' +import { SectionHeader } from '~/ui/components/SectionHeader' import { SourceLink } from '~/ui/components/SourceLink' import { TypeDocInterface } from '~/ui/components/TypeDocInterface' import { TypeDocType } from '~/ui/components/TypeDocType' @@ -45,6 +46,7 @@ export const useTypesModal = createModal( generateTypeUsage(type.name), [type] ) + const scope = type && typeIdStr(type.name, type.id) return ( ( usage={usage.usage} usageTabs={usage.usageTabs} header="h3" - scope={typeIdStr(type.name, type.id)} + scope={scope} /> )} {type.type && (
    -

    Type

    - + } />
    )} {type.typeParameters && (
    -

    Generics

    - +
    )} - + @@ -159,17 +159,17 @@ export const useTypesModal = createModal( interface ContentProps { type: DeclarationReflection + scope: string | undefined } -function TypeContent({ type }: ContentProps) { +function TypeContent({ type, scope }: ContentProps) { switch (type.kindString) { case 'Interface': if (!type.children?.length) return null return (
    -

    Interface

    - +
    ) @@ -179,8 +179,7 @@ function TypeContent({ type }: ContentProps) {
    {type.default && (
    -

    Default type

    - + } />
    )} From 9650bd7ecc10156649439d436e8ddd2bbc8ad5d4 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Fri, 10 Mar 2023 13:30:08 +0800 Subject: [PATCH 19/36] Commit bunch of changes --- package.json | 2 +- src/ui/components/DocDescription/index.tsx | 6 +- src/ui/components/HighlightQuery/index.tsx | 4 +- src/ui/components/IdHighlight/index.tsx | 12 +- src/ui/components/Item/index.tsx | 28 ++++- src/ui/components/Item/styles.css.ts | 2 +- src/ui/components/NoSearchResults/index.tsx | 13 +-- src/ui/components/RichText/styles.css.ts | 2 +- src/ui/components/Search/index.tsx | 7 +- src/ui/components/Search/styles.css.ts | 2 +- .../TypeDocSignature/Generics/index.tsx | 6 +- src/ui/components/TypeDocSignature/index.tsx | 5 +- .../contexts/IgnoreParentTypesSource/index.ts | 3 + src/ui/hooks/useActiveItem/index.ts | 19 ++++ src/ui/hooks/useQuery/index.tsx | 13 +++ .../Docs/Doc/TypeDoc/Constants/index.tsx | 11 +- .../Doc/TypeDoc/Function/Signature/index.tsx | 5 +- .../Docs/Doc/TypeDoc/Function/index.tsx | 44 +++++++- .../screens/Docs/Doc/TypeDoc/Types/index.tsx | 106 +++++++++++++----- .../Docs/Doc/TypeDoc/Types/styles.css.ts | 21 +++- src/ui/screens/Docs/Finder/Categories.tsx | 3 + src/ui/screens/Docs/Finder/Items.tsx | 63 ++++++----- src/ui/screens/Docs/Finder/index.tsx | 6 +- src/utils/docs/index.ts | 31 ++++- src/utils/dom/index.ts | 75 +++++++++++++ yarn.lock | 8 +- 26 files changed, 383 insertions(+), 114 deletions(-) create mode 100644 src/ui/contexts/IgnoreParentTypesSource/index.ts create mode 100644 src/ui/hooks/useActiveItem/index.ts create mode 100644 src/ui/hooks/useQuery/index.tsx create mode 100644 src/utils/dom/index.ts diff --git a/package.json b/package.json index cb41cca8..960c881a 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "start": "env NODE_ENV=development ts-node -r tsconfig-paths/register devServer.ts" }, "dependencies": { - "@date-fns/docs": "0.22.0", + "@date-fns/docs": "0.24.0", "@sentry/browser": "^5.30.0", "@sentry/tracing": "^5.30.0", "@switcher/preact": "2.3.0", diff --git a/src/ui/components/DocDescription/index.tsx b/src/ui/components/DocDescription/index.tsx index 21b750eb..d3730758 100644 --- a/src/ui/components/DocDescription/index.tsx +++ b/src/ui/components/DocDescription/index.tsx @@ -6,15 +6,19 @@ interface DocDescriptionProps { description: string scope?: string header?: 'h2' | 'h3' + skipHeader?: boolean } export const DocDescription: FunctionComponent = ({ description, header, scope, + skipHeader, }) => (
    - + {!skipHeader && ( + + )}
    ) diff --git a/src/ui/components/HighlightQuery/index.tsx b/src/ui/components/HighlightQuery/index.tsx index feeaadca..2204c160 100644 --- a/src/ui/components/HighlightQuery/index.tsx +++ b/src/ui/components/HighlightQuery/index.tsx @@ -5,7 +5,7 @@ import * as styles from './styles.css' interface HighlightQueryProps { text: string - query: string + query: string | undefined } export const HighlightQuery: FunctionComponent = ({ @@ -33,7 +33,7 @@ interface Chunk { type: 'chunk' | 'query' } -function highlightText(text: string, query: string): Chunk[] { +function highlightText(text: string, query: string | undefined): Chunk[] { if (!text || !query) return [{ text, type: 'chunk' }] const chunks: Chunk[] = [] diff --git a/src/ui/components/IdHighlight/index.tsx b/src/ui/components/IdHighlight/index.tsx index d15b0cd3..9b622cc5 100644 --- a/src/ui/components/IdHighlight/index.tsx +++ b/src/ui/components/IdHighlight/index.tsx @@ -1,6 +1,7 @@ import { match } from 'assert' import { FunctionComponent, h } from 'preact' import { useEffect, useRef } from 'preact/hooks' +import { isInViewport } from '~/utils/dom' import * as styles from './styles.css' interface IdHightlightProps { @@ -62,14 +63,3 @@ export const IdHightlight: FunctionComponent = ({ ) } - -function isInViewport(element: HTMLElement): boolean { - const rect = element.getBoundingClientRect() - return ( - rect.top >= 0 && - rect.left >= 0 && - rect.bottom <= - (window.innerHeight || document.documentElement.clientHeight) && - rect.right <= (window.innerWidth || document.documentElement.clientWidth) - ) -} diff --git a/src/ui/components/Item/index.tsx b/src/ui/components/Item/index.tsx index 203874a2..986fb5e2 100644 --- a/src/ui/components/Item/index.tsx +++ b/src/ui/components/Item/index.tsx @@ -1,27 +1,45 @@ import classNames from 'classnames' import { Fragment, FunctionComponent, h } from 'preact' +import { Ref } from 'preact/hooks' +import { highlightMarkdown } from '~/utils/docs' +import { HighlightQuery } from '../HighlightQuery' +import { Markdown } from '../Markdown' +import { RichText } from '../RichText' import * as styles from './styles.css' interface Props { title: string summary: string | undefined - selected: boolean + active: boolean code: boolean + query?: string + activeRef?: Ref } export const Item: FunctionComponent = ({ title, summary, - selected, + active, code, + query, + activeRef, }) => ( -
    +

    - {title} +

    - {styles.summary &&

    {summary}

    } + {summary && ( +

    + + + +

    + )}
    diff --git a/src/ui/components/Item/styles.css.ts b/src/ui/components/Item/styles.css.ts index 699b74d4..bdf28c69 100644 --- a/src/ui/components/Item/styles.css.ts +++ b/src/ui/components/Item/styles.css.ts @@ -24,7 +24,7 @@ export const icon = style({ marginLeft: '10px', }) -export const selected = style({ +export const active = style({ backgroundColor: '#fff0f3', ':hover': { diff --git a/src/ui/components/NoSearchResults/index.tsx b/src/ui/components/NoSearchResults/index.tsx index a6957372..c7b6bb0e 100644 --- a/src/ui/components/NoSearchResults/index.tsx +++ b/src/ui/components/NoSearchResults/index.tsx @@ -1,21 +1,18 @@ -import classNames from 'classnames' import { Fragment, FunctionComponent, h } from 'preact' -import { useMemo } from 'preact/hooks' +import { RichText } from '../RichText' import * as styles from './styles.css' interface NoSearchResultsProps { noun: string - query: string - setQuery: (query: string) => void + query: [string, (query: string) => void] } export const NoSearchResults: FunctionComponent = ({ noun, - query, - setQuery, + query: [query, setQuery], }) => { return ( -
    + No {noun} found for {query}.{' '} = ({ > Clear query -
    + ) } diff --git a/src/ui/components/RichText/styles.css.ts b/src/ui/components/RichText/styles.css.ts index ea380557..470bf023 100644 --- a/src/ui/components/RichText/styles.css.ts +++ b/src/ui/components/RichText/styles.css.ts @@ -2,7 +2,7 @@ import { style, globalStyle } from '@vanilla-extract/css' export const content = style({ fontSize: '1rem', - lineHeight: '1.6em', + lineHeight: '1.6', }) globalStyle(`${content} a`, { diff --git a/src/ui/components/Search/index.tsx b/src/ui/components/Search/index.tsx index 1145f715..df3cb6b6 100644 --- a/src/ui/components/Search/index.tsx +++ b/src/ui/components/Search/index.tsx @@ -1,18 +1,20 @@ import { FunctionComponent, h } from 'preact' // import { trackAction } from 'app/acts/tracking_acts' import debounce from 'lodash/debounce' -import { StateUpdater, useCallback } from 'preact/hooks' +import { Ref, StateUpdater, useCallback } from 'preact/hooks' import * as styles from './styles.css' import classNames from 'classnames' interface SearchProps { - query: [string, StateUpdater] + query: [string, (query: string) => void] bordered?: boolean + inputRef?: Ref } export const Search: FunctionComponent = ({ query: [query, setQuery], bordered, + inputRef, }) => { const trackSearch = useCallback( debounce((newQuery: string) => { @@ -36,6 +38,7 @@ export const Search: FunctionComponent = ({ trackSearch(newQuery) setQuery(newQuery) }} + ref={inputRef} /> {query.trim().length > 0 && } diff --git a/src/ui/components/Search/styles.css.ts b/src/ui/components/Search/styles.css.ts index 64571ba7..1531077d 100644 --- a/src/ui/components/Search/styles.css.ts +++ b/src/ui/components/Search/styles.css.ts @@ -28,7 +28,7 @@ export const cancel = style({ backgroundImage: `url('${cancelURL}')`, backgroundSize: '16px', position: 'absolute', - right: '1.5rem', + right: '1rem', }) export const input = style({ diff --git a/src/ui/components/TypeDocSignature/Generics/index.tsx b/src/ui/components/TypeDocSignature/Generics/index.tsx index b007a41d..9f1a6469 100644 --- a/src/ui/components/TypeDocSignature/Generics/index.tsx +++ b/src/ui/components/TypeDocSignature/Generics/index.tsx @@ -1,6 +1,7 @@ import { FunctionComponent, h, Fragment } from 'preact' import { useContext } from 'preact/hooks' import type { TypeParameterReflection } from 'typedoc' +import { IgnoreParentTypesSourceContext } from '~/ui/contexts/IgnoreParentTypesSource' import { InlineTypeContext } from '~/ui/contexts/InlineTypeContext' import { ParentTypesMap, typeHash } from '~/utils/docs' import { IdHightlight } from '../../IdHighlight' @@ -14,6 +15,7 @@ export const TypeDocSignatureGenerics: FunctionComponent { const inline = useContext(InlineTypeContext) + const ignoreSource = useContext(IgnoreParentTypesSourceContext) return ( <> @@ -22,7 +24,9 @@ export const TypeDocSignatureGenerics: FunctionComponent - {inline ? ( + {inline && ignoreSource && inline.parentTypesMap?.[param.id] ? ( + {param.name} + ) : inline && !ignoreSource ? ( {param.name} diff --git a/src/ui/components/TypeDocSignature/index.tsx b/src/ui/components/TypeDocSignature/index.tsx index 886b5b95..2336cd3d 100644 --- a/src/ui/components/TypeDocSignature/index.tsx +++ b/src/ui/components/TypeDocSignature/index.tsx @@ -1,11 +1,8 @@ -import classNames from 'classnames' import { Fragment, FunctionComponent, h } from 'preact' -import type { SignatureReflection, TypeParameterReflection } from 'typedoc' -import { ParentTypesMap } from '~/utils/docs' +import type { SignatureReflection } from 'typedoc' import { TypeDocType } from '../TypeDocType' import { TypeDocSignatureArguments as Arguments } from './Arguments' import { TypeDocSignatureGenerics as Generics } from './Generics' -import * as styles from './styles.css' interface TypeDocSignatureProps { name?: string diff --git a/src/ui/contexts/IgnoreParentTypesSource/index.ts b/src/ui/contexts/IgnoreParentTypesSource/index.ts new file mode 100644 index 00000000..d751b1a3 --- /dev/null +++ b/src/ui/contexts/IgnoreParentTypesSource/index.ts @@ -0,0 +1,3 @@ +import { createContext } from 'preact' + +export const IgnoreParentTypesSourceContext = createContext(false) diff --git a/src/ui/hooks/useActiveItem/index.ts b/src/ui/hooks/useActiveItem/index.ts new file mode 100644 index 00000000..6d033738 --- /dev/null +++ b/src/ui/hooks/useActiveItem/index.ts @@ -0,0 +1,19 @@ +import { useEffect, useRef, useState } from 'preact/hooks' +import { + scrollIntoViewIfNeeded, + ScrollIntoViewIfNeededOptions, +} from '~/utils/dom' + +export function useActiveItem( + id: unknown, + options?: ScrollIntoViewIfNeededOptions +) { + const activeRef = useRef(null) + + useEffect(() => { + console.log('item', activeRef.current) + scrollIntoViewIfNeeded(activeRef.current, options) + }, [id]) + + return { activeRef } +} diff --git a/src/ui/hooks/useQuery/index.tsx b/src/ui/hooks/useQuery/index.tsx new file mode 100644 index 00000000..26019bde --- /dev/null +++ b/src/ui/hooks/useQuery/index.tsx @@ -0,0 +1,13 @@ +import { useRef, useState } from 'preact/hooks' + +export function useQuery() { + const searchRef = useRef(null) + const [query, setQueryState] = useState('') + + function setQuery(str: string) { + setQueryState(str) + searchRef.current?.focus() + } + + return { query, setQuery, searchRef } +} diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Constants/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Constants/index.tsx index dd1b60ff..9033c0c8 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Constants/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Constants/index.tsx @@ -22,11 +22,12 @@ import { Search } from '~/ui/components/Search' import { SectionHeader } from '~/ui/components/SectionHeader' import { SourceLink } from '~/ui/components/SourceLink' import { TypeDocType } from '~/ui/components/TypeDocType' +import { useQuery } from '~/ui/hooks/useQuery' import { extractCodeFromTagString, findSource, generateUsage, - hightlightMarkdown, + highlightMarkdown, } from '~/utils/docs' import * as styles from './styles.css' @@ -47,7 +48,7 @@ export const TypeDocConstants: FunctionComponent = ({ }) => { const description = useMemo(() => findDescription(doc), [doc]) - const [query, setQuery] = useState('') + const { query, setQuery, searchRef } = useQuery() const constants: ConstantItem[] = useMemo( () => @@ -80,7 +81,7 @@ export const TypeDocConstants: FunctionComponent = ({
    - +
    {filtered.length ? ( @@ -90,7 +91,7 @@ export const TypeDocConstants: FunctionComponent = ({ ))} ) : ( - + )}
    @@ -136,7 +137,7 @@ function Constant({ item, query }: ConstantProps) { {description && ( diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/Signature/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/Signature/index.tsx index f4507e90..dcc033f1 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Function/Signature/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/Signature/index.tsx @@ -2,6 +2,7 @@ import { findSignatureReturns } from '@date-fns/docs/utils' import { h, FunctionComponent, Fragment } from 'preact' import { useMemo } from 'preact/hooks' import type { SignatureReflection, TypeParameterReflection } from 'typedoc' +import { IgnoreParentTypesSourceContext } from '~/ui/contexts/IgnoreParentTypesSource' import { Arguments } from '../Arguments' import { Generics } from '../Generics' import { Returns } from '../Returns' @@ -27,7 +28,9 @@ export const Signature: FunctionComponent = ({ return ( <> - + + + {signature.typeParameter && ( diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx index 1553a03c..bebf91a6 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx @@ -1,17 +1,28 @@ import type { DateFnsDocs } from '@date-fns/docs/types' -import { findFn, findFnDescription, findFnExamples } from '@date-fns/docs/utils' +import { + findFn, + findFnDescription, + findFnExamples, + traverseType, +} from '@date-fns/docs/utils' import { FunctionComponent, h } from 'preact' import { useMemo } from 'preact/hooks' -import type { DeclarationReflection } from 'typedoc' +import type { DeclarationReflection, SignatureReflection } from 'typedoc' import { DocDescription } from '~/ui/components/DocDescription' import { DocExamples } from '~/ui/components/DocExamples' import { DocHeader } from '~/ui/components/DocHeader' import { DocLinks } from '~/ui/components/DocLinks' import { DocUsage } from '~/ui/components/DocUsage' +import { InlineTypeContext } from '~/ui/contexts/InlineTypeContext' import { extractCodeFromTagString, findSource, generateUsage, + inlineTypeHash, + pageTypeHash, + pageTypeId, + pageTypeIdHighlightMatch, + ParentTypesMap, } from '~/utils/docs' import { Signatures } from './Signatures' @@ -25,6 +36,7 @@ export const TypeDocFunction: FunctionComponent = ({ doc, }) => { const fn = useMemo(() => findFn(doc), [doc]) + const parentTypesMap = useMemo(() => buildParentTypesMap(fn), [fn]) const description = useMemo(() => fn && findFnDescription(fn), [fn]) const { usage, usageTabs } = useMemo(() => generateUsage(doc.name), [doc]) const signatures = fn && fn.signatures @@ -33,11 +45,19 @@ export const TypeDocFunction: FunctionComponent = ({ [fn] ) + console.log('+++++++++++++++++++++++', parentTypesMap) + return ( -
    + pageTypeId(refl.name, refl.id), + idHighlightMatch: pageTypeIdHighlightMatch, + parentTypesMap, + }} + > {page.title} - {description && } + {description && } @@ -50,6 +70,20 @@ export const TypeDocFunction: FunctionComponent = ({ -
    + ) } + +function buildParentTypesMap( + refl: DeclarationReflection | undefined +): ParentTypesMap { + const map: ParentTypesMap = {} + + refl?.signatures?.forEach((signature) => { + signature?.typeParameter?.map((r) => { + map[r.id] = pageTypeHash(r.name, r.id) + }) + }) + + return map +} diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx index 434aac86..989c222c 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx @@ -1,4 +1,9 @@ -import { joinCommentParts, traverseType } from '@date-fns/docs/utils' +import { + findDescription, + findSummary, + joinCommentParts, + traverseType, +} from '@date-fns/docs/utils' import { h } from 'preact' import { useMemo } from 'preact/hooks' import type { DeclarationReflection, SignatureReflection } from 'typedoc' @@ -8,12 +13,16 @@ import { Item } from '~/ui/components/Item' import { Markdown } from '~/ui/components/Markdown' import { Missing } from '~/ui/components/Missing' import { createModal } from '~/ui/components/Modals' +import { NoSearchResults } from '~/ui/components/NoSearchResults' import { RichText } from '~/ui/components/RichText' +import { Search } from '~/ui/components/Search' import { SectionHeader } from '~/ui/components/SectionHeader' import { SourceLink } from '~/ui/components/SourceLink' import { TypeDocInterface } from '~/ui/components/TypeDocInterface' import { TypeDocType } from '~/ui/components/TypeDocType' import { InlineTypeContext } from '~/ui/contexts/InlineTypeContext' +import { useQuery } from '~/ui/hooks/useQuery' +import { useActiveItem } from '~/ui/hooks/useActiveItem' import { findSource, generateTypeUsage, @@ -33,12 +42,18 @@ export interface TypesModalProps { nestedId: number | undefined } +interface TypeItem { + type: DeclarationReflection + summary: string | undefined + description: string | undefined +} + export const useTypesModal = createModal( ({ parent, typeId, doc }) => { const types = useMemo(() => extractTypes(doc), [doc]) const map = useMemo(() => buildMap(types), [types]) const type = map[typeId] as DeclarationReflection | undefined - const parentTypesMap = buildParentTypesMap(type) + const parentTypesMap = useMemo(() => buildParentTypesMap(type), [type]) const usage = useMemo( () => type?.kindString && @@ -48,15 +63,39 @@ export const useTypesModal = createModal( ) const scope = type && typeIdStr(type.name, type.id) + const { query, setQuery, searchRef } = useQuery() + + const navItems: TypeItem[] = useMemo( + () => + types.map((t) => { + const summary = findSummary(t) + const description = findDescription(t) + return { type: t, summary, description } + }) || [], + [types] + ) + + const filteredNav = useMemo( + () => + query + ? navItems.filter( + (item) => + item.type.name.toLowerCase().includes(query.toLowerCase()) || + item.summary?.toLowerCase().includes(query.toLowerCase()) || + item.description?.toLowerCase().includes(query.toLowerCase()) + ) + : navItems, + [navItems, query] + ) + + const { activeRef } = useActiveItem(type?.id) + return ( { - console.log(type, inlineTypeId(type, t)) - return inlineTypeId(type, t) - }, + buildId: inlineTypeId.bind(null, type), idHighlightMatch: inlineTypeIdHighlightMatch, parentTypesMap, } @@ -68,22 +107,31 @@ export const useTypesModal = createModal( {parent} types
    -
    +
    - {types.map((type) => ( - - - - ))} + + +
    + {filteredNav.length ? ( + filteredNav.map(({ type, summary, description }) => ( + + + + )) + ) : ( +
    + +
    + )} +
    {type ? ( @@ -216,16 +264,17 @@ function extractTypes( switch (child.kindString) { // Ignore these types and their children case 'Module': - return - - // Process function singatures and add their type parameters case 'Function': - child.signatures?.forEach((signature) => { - // @ts-ignore: For some reason TypeDoc contains the error, it's typeParameter not typeParameters - signature.typeParameter?.forEach((param) => types.push(param)) - }) return + // // Process function singatures and add their type parameters + // case 'Function': + // child.signatures?.forEach((signature) => { + // // @ts-ignore: For some reason TypeDoc contains the error, it's typeParameter not typeParameters + // signature.typeParameter?.forEach((param) => types.push(param)) + // }) + // return + // Add these types, but not process their children case 'Interface': case 'Type alias': @@ -310,7 +359,6 @@ function buildParentTypesMap( type?.type && traverseType(type.type, (ref) => { - console.log(' ~~~', ref) if (ref.type === 'reflection') { ref.declaration?.signatures?.forEach((signature) => { buildParentTypesMap(refl, signature, map) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts b/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts index e41a1849..29c1100f 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts +++ b/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts @@ -1,6 +1,10 @@ import { globalStyle, style, styleVariants } from '@vanilla-extract/css' -export const wrapper = style({}) +export const wrapper = style({ + height: 'min(calc(100vh - 8rem), 50rem)', + display: 'grid', + gridTemplateRows: 'auto 1fr', +}) export const title = style({ background: '#ebe1d8', @@ -23,11 +27,11 @@ export const titleParent = style({ fontFamily: 'monospace', }) -export const inner = style({ +export const main = style({ display: 'grid', gridTemplateColumns: '23rem auto', - maxHeight: '50rem', gridTemplateRows: '1fr', + overflow: 'hidden', }) export const item = style({ @@ -36,9 +40,20 @@ export const item = style({ export const nav = style({ borderRight: '1px solid #e6e0e6', + display: 'grid', + gridTemplateRows: 'auto 1fr', + overflow: 'hidden', +}) + +export const list = style({ overflowY: 'auto', }) +export const noResults = style({ + textAlign: 'center', + padding: '1rem', +}) + export const content = style({ padding: '2rem', overflowY: 'auto', diff --git a/src/ui/screens/Docs/Finder/Categories.tsx b/src/ui/screens/Docs/Finder/Categories.tsx index 04fb7efa..5108efee 100644 --- a/src/ui/screens/Docs/Finder/Categories.tsx +++ b/src/ui/screens/Docs/Finder/Categories.tsx @@ -10,6 +10,7 @@ interface Props { selectedSubmodule: DateFnsDocs.Submodule selectedPage: string onNavigate(): void + query: string } export const Categories: FunctionComponent = ({ @@ -19,6 +20,7 @@ export const Categories: FunctionComponent = ({ selectedSubmodule, selectedPage, onNavigate, + query, }) => (
      {categories.map((category) => { @@ -39,6 +41,7 @@ export const Categories: FunctionComponent = ({ selectedSubmodule={selectedSubmodule} selectedPage={selectedPage} onNavigate={onNavigate} + query={query} />
  • diff --git a/src/ui/screens/Docs/Finder/Items.tsx b/src/ui/screens/Docs/Finder/Items.tsx index 4af3ab7a..62af86ff 100644 --- a/src/ui/screens/Docs/Finder/Items.tsx +++ b/src/ui/screens/Docs/Finder/Items.tsx @@ -4,6 +4,7 @@ import { RouterLink } from '~/ui/router' import { docLink } from '~/ui/router/docLink' import * as styles from './styles.css' import { Item } from '~/ui/components/Item' +import { useActiveItem } from '~/ui/hooks/useActiveItem' interface Props { pages: DateFnsDocs.PagePreview[] @@ -11,6 +12,7 @@ interface Props { selectedSubmodule: DateFnsDocs.Submodule selectedPage: string onNavigate(): void + query: string } export const Items: FunctionComponent = ({ @@ -19,29 +21,38 @@ export const Items: FunctionComponent = ({ selectedSubmodule, selectedPage, onNavigate, -}) => ( - <> - {pages.map((page) => ( - - - - ))} - -) + query, +}) => { + const { activeRef } = useActiveItem(selectedPage, { + marginTop: 33, + }) + + return ( + <> + {pages.map((page) => ( + + + + ))} + + ) +} diff --git a/src/ui/screens/Docs/Finder/index.tsx b/src/ui/screens/Docs/Finder/index.tsx index 5191005c..2a1a9c58 100644 --- a/src/ui/screens/Docs/Finder/index.tsx +++ b/src/ui/screens/Docs/Finder/index.tsx @@ -11,6 +11,7 @@ import { NoResults } from './NoResults' import * as styles from './styles.css' import { filterPages } from './utils' import { Widget } from './Widget' +import { useQuery } from '~/ui/hooks/useQuery' interface FinderProps { selectedVersion: string @@ -25,7 +26,7 @@ export const Finder: FunctionComponent = ({ selectedPage, onNavigate, }) => { - const [query, setQuery] = useState('') + const { query, setQuery, searchRef } = useQuery() const [versions, { loading }] = useRead( db.versions.query(($) => [ @@ -40,7 +41,7 @@ export const Finder: FunctionComponent = ({ return (
    - +
    {filteredPages.length === 0 ? ( @@ -53,6 +54,7 @@ export const Finder: FunctionComponent = ({ selectedSubmodule={selectedSubmodule} selectedPage={selectedPage} onNavigate={onNavigate} + query={query} /> )}
    diff --git a/src/utils/docs/index.ts b/src/utils/docs/index.ts index 919371e1..1ac6579a 100644 --- a/src/utils/docs/index.ts +++ b/src/utils/docs/index.ts @@ -55,12 +55,20 @@ export function findSource( return trimHash ? url.replace(/#.*$/, '') : url } -export function hightlightMarkdown(text: string, query: string) { +export function highlightMarkdown(text: string, query: string | undefined) { if (!query) return text const regex = new RegExp(query, 'gi') return text.replace(regex, (match) => `==${match}==`) } +export function pageTypeHash(name: string, id: number) { + return `#${pageTypeId(name, id)}` +} + +export function pageTypeId(name: string, id: number) { + return `page/${name}/${id}/${rand()}` +} + export function typeHash(name: string, id: number, nested?: string) { return `#${typeId(name, id, nested)}` } @@ -86,6 +94,27 @@ export function matchTypeHash(hash: string) { return { typeId, nestedId } } +const pageTypeHashRE = /types\/\w+\/(\d+)(?:\/\w+)?/ + +export function matchPageTypeHash(hash: string) { + const captures = hash.match(pageTypeHashRE) + if (!captures) return + + const type = captures[1] + if (!type) return + + const typeId = parseInt(type) + if (isNaN(typeId)) return + + return typeId +} + +export function pageTypeIdHighlightMatch(id: string, hash: string) { + const idMatch = matchPageTypeHash(id) + const hashMatch = matchPageTypeHash(hash) + return (idMatch && idMatch === hashMatch) || false +} + export function inlineTypeHash( refl: DeclarationReflection, type: TypeParameterReflection | ParameterReflection | DeclarationReflection diff --git a/src/utils/dom/index.ts b/src/utils/dom/index.ts new file mode 100644 index 00000000..965c52ec --- /dev/null +++ b/src/utils/dom/index.ts @@ -0,0 +1,75 @@ +import { consoleTestResultHandler } from 'tslint/lib/test' + +export interface ScrollIntoViewIfNeededOptions extends ScrollToOptions { + marginTop?: number +} + +export function scrollIntoViewIfNeeded( + element: HTMLElement | null, + { marginTop, behavior }: ScrollIntoViewIfNeededOptions = {} +): void { + if (!element) return + + const rect = element.getBoundingClientRect() + const scrollParent = findParentWithScroll(element) + console.log({ scrollParent }) + + if (!scrollParent) return + + const parentRect = scrollParent.getBoundingClientRect() + + const inViewport = + rect.top >= parentRect.top + (marginTop || 0) + scrollParent.scrollTop && + rect.left >= parentRect.left && + rect.bottom <= parentRect.bottom + scrollParent.scrollTop && + rect.right <= parentRect.right + + console.log({ + rect, + parentRect, + marginTop, + inViewport, + scrollTop: scrollParent.scrollTop, + }) + + if (inViewport) return + + scrollParent.scrollTo({ + top: rect.top - parentRect.top - (marginTop || 0), + behavior, + }) + + // element.scrollIntoView({ behavior }) +} + +export function isInViewport( + element: HTMLElement, + marginTop?: number +): boolean { + const rect = element.getBoundingClientRect() + const scrollParent = findParentWithScroll(element) + + if (!scrollParent) return true + + const parentRect = scrollParent.getBoundingClientRect() + + console.log({ rect, parentRect, marginTop }) + + return ( + rect.top >= parentRect.top + (marginTop || 0) && + rect.left >= parentRect.left && + rect.bottom <= parentRect.bottom && + rect.right <= parentRect.right + ) +} + +function findParentWithScroll(element: HTMLElement): HTMLElement | null { + let current: HTMLElement | null = element + while (current) { + if (current.offsetHeight < current.scrollHeight) { + return current + } + current = current.parentElement + } + return null +} diff --git a/yarn.lock b/yarn.lock index 03967a03..2f8fed30 100644 --- a/yarn.lock +++ b/yarn.lock @@ -251,10 +251,10 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@date-fns/docs@0.22.0": - version "0.22.0" - resolved "https://registry.yarnpkg.com/@date-fns/docs/-/docs-0.22.0.tgz#aaaafdba6b5c192ef2e2cb8a969821498592f42d" - integrity sha512-LKpsZZZXy2oqAW62TQ7UZCN3uoO1eCj6RTaEHE9h6fruQ9EoxjHV7kl+ENtNPpL4zUCTxwiQgkeRDytH8z0G8Q== +"@date-fns/docs@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@date-fns/docs/-/docs-0.24.0.tgz#a69db423f5ffe78992cbbb2094c631da696c3cb0" + integrity sha512-/mI63fs/kVMThANrSSDiLsHi8polkI9Ase4S7rkMh5r77pxmhvhSoA78m7mLIRyst5u5dlP9052hKspSxtf92A== dependencies: firebase-admin "^11.4.1" js-fns "^2.5.2" From f8ac43760bd47e8723364bf9c5a9e51ccc3f0827 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Sat, 11 Mar 2023 09:52:31 +0800 Subject: [PATCH 20/36] Fix in page generic navigation --- src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx | 2 -- src/utils/docs/index.ts | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx index bebf91a6..dabadd5f 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx @@ -45,8 +45,6 @@ export const TypeDocFunction: FunctionComponent = ({ [fn] ) - console.log('+++++++++++++++++++++++', parentTypesMap) - return ( Date: Sat, 11 Mar 2023 09:52:37 +0800 Subject: [PATCH 21/36] I've had enough --- package.json | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/package.json b/package.json index 960c881a..e0252c15 100644 --- a/package.json +++ b/package.json @@ -83,20 +83,6 @@ "webpack-node-externals": "^3.0.0", "yarn": "^1.22.10" }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } - }, - "lint-staged": { - "*.{js,jsx,json,css,md}": [ - "yarn format" - ], - "*.{ts,tsx}": [ - "yarn format", - "yarn lint" - ] - }, "prettier": { "singleQuote": true, "semi": false From b896bab2d19bf8775baaf64eb114845e5751cdc6 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Sat, 11 Mar 2023 13:32:29 +0800 Subject: [PATCH 22/36] Improve function doc - Add throws - Extract description from examples - Add description to singnatures --- src/ui/components/DocExamples/index.tsx | 54 ++++++++++++++----- src/ui/components/DocExamples/styles.css.ts | 4 ++ .../Doc/TypeDoc/Function/Signature/index.tsx | 16 +++++- .../Doc/TypeDoc/Function/Signatures/index.tsx | 19 +++++-- .../Doc/TypeDoc/Function/Throws/index.tsx | 49 +++++++++++++++++ 5 files changed, 122 insertions(+), 20 deletions(-) create mode 100644 src/ui/screens/Docs/Doc/TypeDoc/Function/Throws/index.tsx diff --git a/src/ui/components/DocExamples/index.tsx b/src/ui/components/DocExamples/index.tsx index b7d382b1..34993d3c 100644 --- a/src/ui/components/DocExamples/index.tsx +++ b/src/ui/components/DocExamples/index.tsx @@ -1,12 +1,12 @@ -import isArray from 'lodash/isArray' import { Fragment, FunctionComponent, h } from 'preact' +import { useMemo } from 'preact/hooks' import { Code } from '~/ui/components/Code' import { Markdown } from '~/ui/components/Markdown' import { SectionHeader } from '../SectionHeader' import * as styles from './styles.css' interface Props { - examples: string[] | string + examples: string[] scope?: string header?: 'h2' | 'h3' } @@ -15,18 +15,44 @@ export const DocExamples: FunctionComponent = ({ examples, scope, header, -}) => ( -
    - +}) => { + const richExamples = useMemo(() => enrichExamples(examples), [examples]) - {isArray(examples) ? ( - examples.map((example, index) => ( + return ( +
    + + + {richExamples.map((example, index) => (
    - + {example.description && ( +
    + +
    + )} + +
    - )) - ) : ( - - )} -
    -) + ))} +
    + ) +} + +interface Example { + description?: string + code: string +} + +function enrichExamples(examples: string[]): Example[] { + return examples.map((example) => { + const captures = example.match(/^((?:\/\/.+\n)*)((?:.*\n?)*)/) + if (!captures) return { code: example } + + return { + description: captures[1] + .split(/\n/) + .map((str) => str.replace(/^\/\/\s?/, '').trim()) + .join(' '), + code: captures[2], + } + }) +} diff --git a/src/ui/components/DocExamples/styles.css.ts b/src/ui/components/DocExamples/styles.css.ts index 17ff6572..706b4e18 100644 --- a/src/ui/components/DocExamples/styles.css.ts +++ b/src/ui/components/DocExamples/styles.css.ts @@ -3,3 +3,7 @@ import { style } from '@vanilla-extract/css' export const codeContainer = style({ marginBottom: '10px', }) + +export const description = style({ + marginBottom: '10px', +}) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/Signature/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/Signature/index.tsx index dcc033f1..5ffb3751 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Function/Signature/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/Signature/index.tsx @@ -1,11 +1,12 @@ -import { findSignatureReturns } from '@date-fns/docs/utils' -import { h, FunctionComponent, Fragment } from 'preact' +import { findSignatureReturns, findTags } from '@date-fns/docs/utils' +import { Fragment, FunctionComponent, h } from 'preact' import { useMemo } from 'preact/hooks' import type { SignatureReflection, TypeParameterReflection } from 'typedoc' import { IgnoreParentTypesSourceContext } from '~/ui/contexts/IgnoreParentTypesSource' import { Arguments } from '../Arguments' import { Generics } from '../Generics' import { Returns } from '../Returns' +import { Throws } from '../Throws' import { Type } from '../Type' interface SignatureProps { @@ -20,6 +21,15 @@ export const Signature: FunctionComponent = ({ header, }) => { const returns = useMemo(() => findSignatureReturns(signature), [signature]) + const throws = useMemo( + () => + findTags(signature, '@throws').map((str) => { + const captures = str.match(/^(?:(\w+) - )?(.*)$/) + if (!captures) return { type: undefined, description: str } + return { type: captures[1], description: captures[2] || str } + }), + [signature] + ) // @ts-ignore: Typing is inproper in TypeDoc const typeParameters = signature.typeParameter as @@ -48,6 +58,8 @@ export const Signature: FunctionComponent = ({ /> )} + {throws.length > 0 && } +
    {JSON.stringify(signature, null, 2)}
    diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/index.tsx index 1606280d..fa92e6f3 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/index.tsx @@ -2,6 +2,7 @@ import { Fragment, FunctionComponent, h } from 'preact' import type { SignatureReflection } from 'typedoc' import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' import { Entities } from '~/ui/components/Entities' +import { RichText } from '~/ui/components/RichText' import { Signature } from '../Signature' interface SignaturesProps { @@ -17,10 +18,20 @@ export const Signatures: FunctionComponent = ({ return (
    {!solo && ( -

    - Signatures - -

    +
    +

    + Signatures + +

    + + +
    + This function has multiple signatures, meaning it can be called + with a different set of arguments, and it might return different + types. Check out every signature to find which one you need. +
    +
    +
    )} diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/Throws/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/Throws/index.tsx new file mode 100644 index 00000000..e38be920 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/Throws/index.tsx @@ -0,0 +1,49 @@ +import { Fragment, FunctionComponent, h } from 'preact' +import { InlineCode } from '~/ui/components/InlineCode' +import { Markdown } from '~/ui/components/Markdown' +import { SectionHeader } from '~/ui/components/SectionHeader' + +export interface TypeDocThrow { + type: string | undefined + description: string +} + +export interface TypeDocThrowsProps { + throws: TypeDocThrow[] + scope?: string + header?: 'h2' | 'h3' +} + +export const Throws: FunctionComponent = ({ + throws, + scope, + header, +}) => { + return ( +
    + + + + + + + + + + + + {throws.map((throwData, index) => ( + + + + + ))} + +
    TypeDescription
    + {throwData.type && {throwData.type}} + + +
    +
    + ) +} From 14fce1977ebfb0ef5e1ba444fba77aa4ef5a9018 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Mon, 13 Mar 2023 09:15:38 +0800 Subject: [PATCH 23/36] Add CDN to usage --- src/ui/components/DocUsage/Content.tsx | 21 ----- src/ui/components/DocUsage/index.tsx | 107 ++++++++++++++++++++--- src/ui/components/DocUsage/styles.css.ts | 7 ++ src/ui/hooks/useActiveItem/index.ts | 1 - src/utils/docs/index.ts | 41 ++++++++- 5 files changed, 141 insertions(+), 36 deletions(-) delete mode 100644 src/ui/components/DocUsage/Content.tsx diff --git a/src/ui/components/DocUsage/Content.tsx b/src/ui/components/DocUsage/Content.tsx deleted file mode 100644 index a398f349..00000000 --- a/src/ui/components/DocUsage/Content.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { h, FunctionComponent } from 'preact' -import { Code } from '~/ui/components/Code' -import { Markdown } from '~/ui/components/Markdown' - -interface Props { - code: string - text?: string -} - -export const Content: FunctionComponent = ({ code, text }) => ( -
    -
    - -
    - {text && ( -
    - -
    - )} -
    -) diff --git a/src/ui/components/DocUsage/index.tsx b/src/ui/components/DocUsage/index.tsx index 948c58fc..6888fcbe 100644 --- a/src/ui/components/DocUsage/index.tsx +++ b/src/ui/components/DocUsage/index.tsx @@ -1,17 +1,19 @@ -import { h, Fragment, FunctionComponent } from 'preact' -import { useEffect, useState } from 'preact/hooks' import type { DateFnsDocs } from '@date-fns/docs/types' -import { Content } from './Content' -import { DocHeaderAnchor } from '~/ui/components/DocHeaderAnchor' -import * as styles from './styles.css' import classNames from 'classnames' +import { Fragment, FunctionComponent, h } from 'preact' +import { useEffect, useState } from 'preact/hooks' +import { Code } from '~/ui/components/Code' +import { Markdown } from '~/ui/components/Markdown' +import { Usage } from '~/utils/docs' import { SectionHeader } from '../SectionHeader' +import * as styles from './styles.css' const LOCALSTORAGE_KEY = 'usageSource' const DEFAULT_SOURCE = 'commonjs' +const LS_SELECTED_OPTIONS_KEY = 'usageSelectedOptions' interface Props { - usage: DateFnsDocs.FnUsage + usage: Usage usageTabs: string[] scope?: string header?: 'h2' | 'h3' @@ -24,6 +26,19 @@ export const DocUsage: FunctionComponent = ({ header, }) => { const [source, setSource] = useState(DEFAULT_SOURCE) + const [selectedOptions, setSelectedOptionsState] = useState< + Record + >(getSelectedOptions()) + + function setSelectedOptions(newOptions: Record) { + setSelectedOptionsState(newOptions) + try { + window.localStorage.setItem( + LS_SELECTED_OPTIONS_KEY, + JSON.stringify(newOptions) + ) + } catch (_e) {} + } useEffect(() => { const localStorageSource = window.localStorage.getItem(LOCALSTORAGE_KEY) @@ -38,6 +53,18 @@ export const DocUsage: FunctionComponent = ({ const selectedTab = usageTabs.includes(source) ? source : usageTabs[0] const selectedUsage = usage[selectedTab] + useEffect(() => { + if (!('options' in selectedUsage)) return + + if (!selectedOptions[selectedTab]) { + const firstOption = selectedUsage.options[0] + setSelectedOptions({ + ...selectedOptions, + [selectedTab]: firstOption, + }) + } + }, [selectedTab, selectedUsage]) + return (
    @@ -45,10 +72,7 @@ export const DocUsage: FunctionComponent = ({
      {usageTabs.map((usageTab) => { const usageItem = usage[usageTab] - - if (!usageItem) { - return null - } + if (!usageItem) return null return (
    • @@ -67,13 +91,74 @@ export const DocUsage: FunctionComponent = ({ }} > {usageItem.title} + + {'options' in usageItem && ( + + )}
    • ) })}
    - +
    ) } + +function getSelectedOptions() { + try { + return JSON.parse( + window.localStorage.getItem(LS_SELECTED_OPTIONS_KEY) || '{}' + ) + } catch (_e) { + return {} + } +} + +interface ContentProps { + code: string + text?: string +} + +export const Content: FunctionComponent = ({ code, text }) => ( +
    +
    + +
    + + {text && ( +
    + +
    + )} +
    +) diff --git a/src/ui/components/DocUsage/styles.css.ts b/src/ui/components/DocUsage/styles.css.ts index e8702555..63ec308a 100644 --- a/src/ui/components/DocUsage/styles.css.ts +++ b/src/ui/components/DocUsage/styles.css.ts @@ -27,3 +27,10 @@ export const options = style({ justifyContent: 'left', margin: '0 !important', }) + +export const optionSelect = style({ + borderColor: '#5844521a', + backgroundColor: 'transparent', + marginLeft: '0.25rem', + color: '#5d3861', +}) diff --git a/src/ui/hooks/useActiveItem/index.ts b/src/ui/hooks/useActiveItem/index.ts index 6d033738..e3e0755e 100644 --- a/src/ui/hooks/useActiveItem/index.ts +++ b/src/ui/hooks/useActiveItem/index.ts @@ -11,7 +11,6 @@ export function useActiveItem( const activeRef = useRef(null) useEffect(() => { - console.log('item', activeRef.current) scrollIntoViewIfNeeded(activeRef.current, options) }, [id]) diff --git a/src/utils/docs/index.ts b/src/utils/docs/index.ts index 7d322278..2e5bf318 100644 --- a/src/utils/docs/index.ts +++ b/src/utils/docs/index.ts @@ -7,8 +7,31 @@ import type { export type ParentTypesMap = Record -export function generateUsage(name: string, module = name) { - const usage = { +export interface Usage { + [usageTab: string]: UsageTab | UsageTabWithOptions +} + +export interface UsageBase { + title: string + text?: string +} + +export interface UsageTab extends UsageBase { + code: string +} + +export interface UsageTabWithOptions extends UsageBase { + code: (option: string) => string + options: Record +} + +export interface UsageMap { + usage: Usage + usageTabs: string[] +} + +export function generateUsage(name: string, module = name): UsageMap { + const usage: Usage = { esm: { code: `import { ${name} } from "date-fns";`, title: 'ESM', @@ -18,9 +41,21 @@ export function generateUsage(name: string, module = name) { code: `const ${name} = require("date-fns/${module}");`, title: 'CommonJS', }, + + cdn: { + title: 'CDN', + code: (cdn) => `import ${name} from "${cdn}/date-fns/${name}.mjs";`, + options: { + unpkg: 'https://unpkg.com', + Skypack: 'https://cdn.skypack.dev', + 'esm.sh': 'https://esm.sh', + JSPM: 'https://jspm.io', + jsDelivr: 'https://cdn.jsdelivr.net/npm', + }, + }, } - const usageTabs = ['esm', 'commonjs'] + const usageTabs = ['esm', 'commonjs', 'cdn'] return { usage, usageTabs } } From 709b2301df59fe8316ebbf45adfe61fc5e8b9fa3 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Sun, 19 Mar 2023 14:45:05 +0800 Subject: [PATCH 24/36] Fix scroll in docs lists --- src/ui/components/Item/index.tsx | 5 +- src/ui/hooks/useActiveItem/index.ts | 29 +++++----- .../screens/Docs/Doc/TypeDoc/Types/index.tsx | 2 +- src/ui/screens/Docs/Finder/Categories.tsx | 5 +- src/ui/screens/Docs/Finder/Items.tsx | 11 ++-- src/ui/screens/Docs/Finder/index.tsx | 7 ++- src/utils/dom/index.ts | 55 ++++++++----------- 7 files changed, 54 insertions(+), 60 deletions(-) diff --git a/src/ui/components/Item/index.tsx b/src/ui/components/Item/index.tsx index 986fb5e2..817eb816 100644 --- a/src/ui/components/Item/index.tsx +++ b/src/ui/components/Item/index.tsx @@ -1,6 +1,5 @@ import classNames from 'classnames' import { Fragment, FunctionComponent, h } from 'preact' -import { Ref } from 'preact/hooks' import { highlightMarkdown } from '~/utils/docs' import { HighlightQuery } from '../HighlightQuery' import { Markdown } from '../Markdown' @@ -13,7 +12,7 @@ interface Props { active: boolean code: boolean query?: string - activeRef?: Ref + activeRef?: (element: HTMLDivElement | null) => void } export const Item: FunctionComponent = ({ @@ -26,7 +25,7 @@ export const Item: FunctionComponent = ({ }) => (

    diff --git a/src/ui/hooks/useActiveItem/index.ts b/src/ui/hooks/useActiveItem/index.ts index e3e0755e..0940a493 100644 --- a/src/ui/hooks/useActiveItem/index.ts +++ b/src/ui/hooks/useActiveItem/index.ts @@ -1,18 +1,19 @@ -import { useEffect, useRef, useState } from 'preact/hooks' -import { - scrollIntoViewIfNeeded, - ScrollIntoViewIfNeededOptions, -} from '~/utils/dom' +import { useCallback, useRef } from 'preact/hooks' +import { scrollIntoViewIfNeeded } from '~/utils/dom' -export function useActiveItem( - id: unknown, - options?: ScrollIntoViewIfNeededOptions -) { - const activeRef = useRef(null) - - useEffect(() => { - scrollIntoViewIfNeeded(activeRef.current, options) - }, [id]) +export function useActiveItem(marginTop?: number) { + const prevRef = useRef(null) + const activeRef = useCallback((element: HTMLDivElement | null) => { + const first = prevRef.current === null + prevRef.current = element + // Delay to let DOM update + setTimeout(() => + scrollIntoViewIfNeeded(element, { + marginTop, + behavior: first ? 'auto' : 'smooth', + }) + ) + }, []) return { activeRef } } diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx index 989c222c..233d189a 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx @@ -88,7 +88,7 @@ export const useTypesModal = createModal( [navItems, query] ) - const { activeRef } = useActiveItem(type?.id) + const { activeRef } = useActiveItem() return ( void } export const Categories: FunctionComponent = ({ @@ -21,6 +22,7 @@ export const Categories: FunctionComponent = ({ selectedPage, onNavigate, query, + activeRef, }) => (
      {categories.map((category) => { @@ -42,6 +44,7 @@ export const Categories: FunctionComponent = ({ selectedPage={selectedPage} onNavigate={onNavigate} query={query} + activeRef={activeRef} />

    diff --git a/src/ui/screens/Docs/Finder/Items.tsx b/src/ui/screens/Docs/Finder/Items.tsx index 62af86ff..552b8ec8 100644 --- a/src/ui/screens/Docs/Finder/Items.tsx +++ b/src/ui/screens/Docs/Finder/Items.tsx @@ -1,10 +1,9 @@ -import { h, FunctionComponent, Fragment } from 'preact' import type { DateFnsDocs } from '@date-fns/docs/types' +import { Fragment, FunctionComponent, h } from 'preact' +import { Item } from '~/ui/components/Item' import { RouterLink } from '~/ui/router' import { docLink } from '~/ui/router/docLink' import * as styles from './styles.css' -import { Item } from '~/ui/components/Item' -import { useActiveItem } from '~/ui/hooks/useActiveItem' interface Props { pages: DateFnsDocs.PagePreview[] @@ -13,6 +12,7 @@ interface Props { selectedPage: string onNavigate(): void query: string + activeRef: (element: HTMLDivElement | null) => void } export const Items: FunctionComponent = ({ @@ -22,11 +22,8 @@ export const Items: FunctionComponent = ({ selectedPage, onNavigate, query, + activeRef, }) => { - const { activeRef } = useActiveItem(selectedPage, { - marginTop: 33, - }) - return ( <> {pages.map((page) => ( diff --git a/src/ui/screens/Docs/Finder/index.tsx b/src/ui/screens/Docs/Finder/index.tsx index 2a1a9c58..893ee28d 100644 --- a/src/ui/screens/Docs/Finder/index.tsx +++ b/src/ui/screens/Docs/Finder/index.tsx @@ -4,14 +4,14 @@ import { packageName } from '@date-fns/docs/consts' import { db } from '@date-fns/docs/db' import type { DateFnsDocs } from '@date-fns/docs/types' import { useRead } from '@typesaurus/preact' -import { useState } from 'preact/hooks' import { Search } from '~/ui/components/Search' +import { useActiveItem } from '~/ui/hooks/useActiveItem' +import { useQuery } from '~/ui/hooks/useQuery' import { Categories } from './Categories' import { NoResults } from './NoResults' import * as styles from './styles.css' import { filterPages } from './utils' import { Widget } from './Widget' -import { useQuery } from '~/ui/hooks/useQuery' interface FinderProps { selectedVersion: string @@ -35,6 +35,8 @@ export const Finder: FunctionComponent = ({ ]) ) + const { activeRef } = useActiveItem(33) + if (versions && versions.length >= 1) { const { pages, categories } = versions[0].data const filteredPages = filterPages(pages, query, selectedSubmodule) @@ -55,6 +57,7 @@ export const Finder: FunctionComponent = ({ selectedPage={selectedPage} onNavigate={onNavigate} query={query} + activeRef={activeRef} /> )}
    diff --git a/src/utils/dom/index.ts b/src/utils/dom/index.ts index 965c52ec..3274018a 100644 --- a/src/utils/dom/index.ts +++ b/src/utils/dom/index.ts @@ -10,51 +10,42 @@ export function scrollIntoViewIfNeeded( ): void { if (!element) return - const rect = element.getBoundingClientRect() - const scrollParent = findParentWithScroll(element) - console.log({ scrollParent }) - - if (!scrollParent) return - - const parentRect = scrollParent.getBoundingClientRect() - - const inViewport = - rect.top >= parentRect.top + (marginTop || 0) + scrollParent.scrollTop && - rect.left >= parentRect.left && - rect.bottom <= parentRect.bottom + scrollParent.scrollTop && - rect.right <= parentRect.right + const parent = findParentWithScroll(element) + if (!parent) return - console.log({ - rect, - parentRect, - marginTop, - inViewport, - scrollTop: scrollParent.scrollTop, - }) - - if (inViewport) return + const rect = element.getBoundingClientRect() + const parentRect = parent.getBoundingClientRect() - scrollParent.scrollTo({ - top: rect.top - parentRect.top - (marginTop || 0), - behavior, - }) + if (isRectInViewport({ rect, parentRect, marginTop })) return - // element.scrollIntoView({ behavior }) + const top = element.offsetTop - parent.offsetTop - (marginTop || 0) + parent.scrollTo({ top, behavior }) } export function isInViewport( element: HTMLElement, marginTop?: number ): boolean { - const rect = element.getBoundingClientRect() - const scrollParent = findParentWithScroll(element) + const parent = findParentWithScroll(element) + if (!parent) return true - if (!scrollParent) return true + const rect = element.getBoundingClientRect() + const parentRect = parent.getBoundingClientRect() - const parentRect = scrollParent.getBoundingClientRect() + return isRectInViewport({ rect, parentRect, marginTop }) +} - console.log({ rect, parentRect, marginTop }) +interface IsRectInViewportProps { + rect: DOMRect + parentRect: DOMRect + marginTop: number | undefined +} +function isRectInViewport({ + rect, + parentRect, + marginTop, +}: IsRectInViewportProps) { return ( rect.top >= parentRect.top + (marginTop || 0) && rect.left >= parentRect.left && From 9508755243c154315a64a71a992c5916283637bd Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Sun, 19 Mar 2023 15:28:59 +0800 Subject: [PATCH 25/36] Fallback description to summary --- src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx index dabadd5f..b367e3fc 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx @@ -3,11 +3,11 @@ import { findFn, findFnDescription, findFnExamples, - traverseType, + findSummary, } from '@date-fns/docs/utils' import { FunctionComponent, h } from 'preact' import { useMemo } from 'preact/hooks' -import type { DeclarationReflection, SignatureReflection } from 'typedoc' +import type { DeclarationReflection } from 'typedoc' import { DocDescription } from '~/ui/components/DocDescription' import { DocExamples } from '~/ui/components/DocExamples' import { DocHeader } from '~/ui/components/DocHeader' @@ -18,7 +18,6 @@ import { extractCodeFromTagString, findSource, generateUsage, - inlineTypeHash, pageTypeHash, pageTypeId, pageTypeIdHighlightMatch, @@ -37,7 +36,10 @@ export const TypeDocFunction: FunctionComponent = ({ }) => { const fn = useMemo(() => findFn(doc), [doc]) const parentTypesMap = useMemo(() => buildParentTypesMap(fn), [fn]) - const description = useMemo(() => fn && findFnDescription(fn), [fn]) + const description = useMemo( + () => fn && (findFnDescription(fn) || findSummary(fn)), + [fn] + ) const { usage, usageTabs } = useMemo(() => generateUsage(doc.name), [doc]) const signatures = fn && fn.signatures const examples = useMemo( From f40917e0b414a4400cf9a01a614a46e1e03ad7a1 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Sun, 19 Mar 2023 15:38:36 +0800 Subject: [PATCH 26/36] Unique signature header links --- .../Doc/TypeDoc/Function/Returns/index.tsx | 3 +++ .../Doc/TypeDoc/Function/Signature/index.tsx | 19 +++++++++++++++---- .../Doc/TypeDoc/Function/Signatures/index.tsx | 1 + 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/Returns/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/Returns/index.tsx index 2a56ab97..799bde6e 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Function/Returns/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/Returns/index.tsx @@ -7,12 +7,14 @@ interface Props { type: SomeType | undefined description: string header: 'h2' | 'h3' + scope?: string | undefined } export const Returns: FunctionComponent = ({ type, description, header, + scope, }) => { return ( = ({ }, ]} header={header} + scope={scope} /> ) } diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/Signature/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/Signature/index.tsx index 5ffb3751..3e205e67 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Function/Signature/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/Signature/index.tsx @@ -13,12 +13,14 @@ interface SignatureProps { name: string signature: SignatureReflection header: 'h2' | 'h3' + index: number | undefined } export const Signature: FunctionComponent = ({ name, signature, header, + index, }) => { const returns = useMemo(() => findSignatureReturns(signature), [signature]) const throws = useMemo( @@ -36,18 +38,24 @@ export const Signature: FunctionComponent = ({ | TypeParameterReflection[] | undefined + const scope = index === undefined ? undefined : `${index + 1}` + return ( <> - + {signature.typeParameter && ( - + )} {signature.parameters && signature.parameters.length > 0 && ( - + )} {signature.type && ( @@ -55,10 +63,13 @@ export const Signature: FunctionComponent = ({ description={returns || ''} type={signature.type} header={header} + scope={scope} /> )} - {throws.length > 0 && } + {throws.length > 0 && ( + + )}
    {JSON.stringify(signature, null, 2)}
    diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/index.tsx index fa92e6f3..9ab62c63 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/Signatures/index.tsx @@ -40,6 +40,7 @@ export const Signatures: FunctionComponent = ({ name={name} signature={signature} header={solo ? 'h2' : 'h3'} + index={solo ? undefined : index} /> ))}
    From f7352c0ec5520b29dc7d3d2508e248358ccd1404 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Sun, 19 Mar 2023 19:00:11 +0800 Subject: [PATCH 27/36] Center layout --- src/ui/screens/Docs/Doc/index.tsx | 24 ++------ src/ui/screens/Docs/Doc/styles.css.ts | 7 +-- src/ui/screens/Docs/Finder/styles.css.ts | 1 + src/ui/screens/Docs/NavBar/index.tsx | 76 ++++++++++++------------ src/ui/screens/Docs/NavBar/styles.css.ts | 9 ++- src/ui/screens/Docs/styles.css.ts | 32 +++++++--- 6 files changed, 77 insertions(+), 72 deletions(-) diff --git a/src/ui/screens/Docs/Doc/index.tsx b/src/ui/screens/Docs/Doc/index.tsx index c8387f32..9706425b 100644 --- a/src/ui/screens/Docs/Doc/index.tsx +++ b/src/ui/screens/Docs/Doc/index.tsx @@ -53,34 +53,22 @@ export const Doc: FunctionComponent = ({ value={{ version: selectedVersion, submodule: selectedSubmodule }} >
    -
    - - - -
    + + +
    ) } else if (pages && pages.length === 0) { return (
    -
    - This page is not available for this version or this submodule -
    + This page is not available for this version or this submodule
    ) } else if (loading) { - return ( -
    -
    Loading...
    -
    - ) + return
    Loading...
    } else { // FIXME: - return ( -
    -
    Error!
    -
    - ) + return
    Error!
    } } diff --git a/src/ui/screens/Docs/Doc/styles.css.ts b/src/ui/screens/Docs/Doc/styles.css.ts index 7f2cff1d..e7ed6c84 100644 --- a/src/ui/screens/Docs/Doc/styles.css.ts +++ b/src/ui/screens/Docs/Doc/styles.css.ts @@ -4,11 +4,6 @@ export const wrapper = style({ padding: '30px', color: '#4a3142', backgroundColor: '#fffdf9', - width: '100%', + maxWidth: '55rem', minHeight: '100%', }) - -export const inner = style({ - maxWidth: '60rem', - margin: '0 auto', -}) diff --git a/src/ui/screens/Docs/Finder/styles.css.ts b/src/ui/screens/Docs/Finder/styles.css.ts index 6c00f285..ac370022 100644 --- a/src/ui/screens/Docs/Finder/styles.css.ts +++ b/src/ui/screens/Docs/Finder/styles.css.ts @@ -30,6 +30,7 @@ export const container = style({ flexDirection: 'column', alignItems: 'stretch', borderRight: '1px solid #e6e0e6', + borderLeft: '1px solid #e6e0e6', }) export const content = style({ diff --git a/src/ui/screens/Docs/NavBar/index.tsx b/src/ui/screens/Docs/NavBar/index.tsx index daa3524a..9a6a32d1 100644 --- a/src/ui/screens/Docs/NavBar/index.tsx +++ b/src/ui/screens/Docs/NavBar/index.tsx @@ -31,50 +31,52 @@ export const NavBar: FunctionComponent = ({ return (
    -
    -
    -
    {menuIcon}
    +
    + -
    - +
    + - + +
    diff --git a/src/ui/screens/Docs/NavBar/styles.css.ts b/src/ui/screens/Docs/NavBar/styles.css.ts index 03216364..f2e4886b 100644 --- a/src/ui/screens/Docs/NavBar/styles.css.ts +++ b/src/ui/screens/Docs/NavBar/styles.css.ts @@ -7,18 +7,23 @@ export const container = style({ backgroundImage: `url('${backgroundURL}'})`, backgroundSize: 'cover', backgroundPosition: 'top center', - height: '100%', width: '100%', + height: '2rem', }) -export const inner = style({ +export const outer = style({ background: 'rgba(118,10,61,0.7)', +}) + +export const inner = style({ display: 'flex', justifyContent: 'space-between', alignItems: 'center', width: '100%', height: '2rem', padding: '0 1rem', + maxWidth: '80rem', + margin: '0 auto', }) export const latestLink = style({ diff --git a/src/ui/screens/Docs/styles.css.ts b/src/ui/screens/Docs/styles.css.ts index c4d67983..bdb1b98f 100644 --- a/src/ui/screens/Docs/styles.css.ts +++ b/src/ui/screens/Docs/styles.css.ts @@ -1,5 +1,12 @@ import { style } from '@vanilla-extract/css' +export const screen = style({ + height: '100%', + width: '100%', + overflowY: 'auto', + background: '#fffdf9', +}) + export const content = style({ flex: 'auto', display: 'flex', @@ -7,6 +14,9 @@ export const content = style({ alignItems: 'stretch', minHeight: '0', position: 'relative', + maxWidth: '80rem', + margin: '0 auto', + width: '100%', }) export const loading = style({ @@ -16,15 +26,9 @@ export const loading = style({ export const navBarContainer = style({ flex: 'none', height: '2rem', -}) - -export const screen = style({ - display: 'flex', - height: '100%', - width: '100%', - flexDirection: 'column', - alignItems: 'stretch', - overflow: 'hidden', + position: 'sticky', + top: 0, + zIndex: 1, }) export const docContainer = style({ @@ -32,6 +36,7 @@ export const docContainer = style({ minHeight: '100%', flex: 'auto', overflowY: 'auto', + marginLeft: '25rem', ':after': { display: 'none', @@ -44,6 +49,12 @@ export const docContainer = style({ top: '0', position: 'absolute', }, + + '@media': { + 'screen and (max-width: 767px)': { + marginLeft: 0, + }, + }, }) export const docContainerMenuOpen = style({ @@ -66,6 +77,9 @@ export const finderContainer = style({ flex: 'none', width: '25rem', maxWidth: '100%', + position: 'fixed', + bottom: 0, + top: '2rem', '@media': { 'screen and (max-width: 767px)': { From 19052f7d9e35511c7877289c681195f83b6722e8 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Tue, 21 Mar 2023 08:29:04 +0800 Subject: [PATCH 28/36] Dark mode foundation --- src/ui/components/Code/index.tsx | 3 +- src/ui/components/Code/styles.css.ts | 14 ++ src/ui/components/Code/theme.css | 169 ++++++++++++++++++ src/ui/components/DocUsage/styles.css.ts | 14 ++ src/ui/components/Home/styles.css.ts | 46 ++++- src/ui/global.css | 13 ++ src/ui/screens/Home/Examples/styles.css.ts | 14 ++ src/ui/screens/Home/Features/features.tsx | 39 ++-- .../Home/Features/icons/ComingIcon.tsx | 13 ++ .../Home/Features/icons/ConsistentIcon.tsx | 21 +++ .../screens/Home/Features/icons/DocsIcon.tsx | 13 ++ src/ui/screens/Home/Features/icons/FPIcon.tsx | 27 +++ .../screens/Home/Features/icons/FastIcon.tsx | 14 ++ .../screens/Home/Features/icons/I18nIcon.tsx | 14 ++ .../Home/Features/icons/ImmutableIcon.tsx | 14 ++ .../Home/Features/icons/ModularIcon.tsx | 14 ++ .../Home/Features/icons/NativeIcon.tsx | 15 ++ .../Home/Features/icons/ReliableIcon.tsx | 14 ++ .../screens/Home/Features/icons/SafeIcon.tsx | 14 ++ .../Home/Features/icons/SimpleIcon.tsx | 14 ++ .../screens/Home/Features/icons/TypesIcon.tsx | 23 +++ src/ui/screens/Home/Features/img/coming.svg | 12 -- .../screens/Home/Features/img/consistent.svg | 14 -- src/ui/screens/Home/Features/img/docs.svg | 12 -- src/ui/screens/Home/Features/img/fast.svg | 10 -- src/ui/screens/Home/Features/img/fp.svg | 17 -- src/ui/screens/Home/Features/img/i18n.svg | 10 -- .../screens/Home/Features/img/immutable.svg | 10 -- src/ui/screens/Home/Features/img/modular.svg | 10 -- src/ui/screens/Home/Features/img/native.svg | 10 -- src/ui/screens/Home/Features/img/reliable.svg | 10 -- src/ui/screens/Home/Features/img/safe.svg | 10 -- src/ui/screens/Home/Features/img/simple.svg | 10 -- src/ui/screens/Home/Features/img/types.svg | 16 -- src/ui/screens/Home/Features/index.tsx | 3 +- src/ui/screens/Home/Features/styles.css.ts | 65 ++++--- src/ui/screens/Home/Promo/styles.css.ts | 12 ++ .../screens/Home/Testimonials/styles.css.ts | 31 ++++ 38 files changed, 582 insertions(+), 202 deletions(-) create mode 100644 src/ui/components/Code/theme.css create mode 100644 src/ui/screens/Home/Features/icons/ComingIcon.tsx create mode 100644 src/ui/screens/Home/Features/icons/ConsistentIcon.tsx create mode 100644 src/ui/screens/Home/Features/icons/DocsIcon.tsx create mode 100644 src/ui/screens/Home/Features/icons/FPIcon.tsx create mode 100644 src/ui/screens/Home/Features/icons/FastIcon.tsx create mode 100644 src/ui/screens/Home/Features/icons/I18nIcon.tsx create mode 100644 src/ui/screens/Home/Features/icons/ImmutableIcon.tsx create mode 100644 src/ui/screens/Home/Features/icons/ModularIcon.tsx create mode 100644 src/ui/screens/Home/Features/icons/NativeIcon.tsx create mode 100644 src/ui/screens/Home/Features/icons/ReliableIcon.tsx create mode 100644 src/ui/screens/Home/Features/icons/SafeIcon.tsx create mode 100644 src/ui/screens/Home/Features/icons/SimpleIcon.tsx create mode 100644 src/ui/screens/Home/Features/icons/TypesIcon.tsx delete mode 100644 src/ui/screens/Home/Features/img/coming.svg delete mode 100644 src/ui/screens/Home/Features/img/consistent.svg delete mode 100644 src/ui/screens/Home/Features/img/docs.svg delete mode 100644 src/ui/screens/Home/Features/img/fast.svg delete mode 100644 src/ui/screens/Home/Features/img/fp.svg delete mode 100644 src/ui/screens/Home/Features/img/i18n.svg delete mode 100644 src/ui/screens/Home/Features/img/immutable.svg delete mode 100644 src/ui/screens/Home/Features/img/modular.svg delete mode 100644 src/ui/screens/Home/Features/img/native.svg delete mode 100644 src/ui/screens/Home/Features/img/reliable.svg delete mode 100644 src/ui/screens/Home/Features/img/safe.svg delete mode 100644 src/ui/screens/Home/Features/img/simple.svg delete mode 100644 src/ui/screens/Home/Features/img/types.svg diff --git a/src/ui/components/Code/index.tsx b/src/ui/components/Code/index.tsx index cf37a230..4b60b99b 100644 --- a/src/ui/components/Code/index.tsx +++ b/src/ui/components/Code/index.tsx @@ -1,7 +1,6 @@ import { FunctionComponent, h } from 'preact' import Prism from 'prismjs' -import 'prismjs/themes/prism.css?global' -import './global.css?global' +import './theme.css?global' import * as styles from './styles.css' interface CodeProps { diff --git a/src/ui/components/Code/styles.css.ts b/src/ui/components/Code/styles.css.ts index 01068bb6..17c55959 100644 --- a/src/ui/components/Code/styles.css.ts +++ b/src/ui/components/Code/styles.css.ts @@ -13,6 +13,13 @@ export const code = style({ '::before': { display: 'none', }, + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#c5c4c2', + backgroundColor: '#1e0814', + }, + }, }) export const pre = style({ @@ -20,4 +27,11 @@ export const pre = style({ border: '1px solid #b9a2b2', backgroundColor: '#fffffe', padding: '.25rem .5rem', + + '@media': { + '(prefers-color-scheme: dark)': { + backgroundColor: '#1e0814', + borderColor: '#361e2a', + }, + }, }) diff --git a/src/ui/components/Code/theme.css b/src/ui/components/Code/theme.css new file mode 100644 index 00000000..81839c2c --- /dev/null +++ b/src/ui/components/Code/theme.css @@ -0,0 +1,169 @@ +/** + * Custom date-fns theme for Prism, based on the default Prism theme + * by Lea Verou (which was based on dabblet http://dabblet.com). + */ + +code[class*='language-'], +pre[class*='language-'] { + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-size: 1em; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*='language-']::-moz-selection, +pre[class*='language-'] ::-moz-selection, +code[class*='language-']::-moz-selection, +code[class*='language-'] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} + +pre[class*='language-']::selection, +pre[class*='language-'] ::selection, +code[class*='language-']::selection, +code[class*='language-'] ::selection { + text-shadow: none; + background: #b3d4fc; +} + +@media print { + code[class*='language-'], + pre[class*='language-'] { + text-shadow: none; + } +} + +/* Code blocks */ +pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; +} + +:not(pre) > code[class*='language-'], +pre[class*='language-'] { + background: #f5f2f0; +} + +/* Inline code */ +:not(pre) > code[class*='language-'] { + padding: 0.1em; + border-radius: 0.3em; + white-space: normal; +} + +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.comment { + color: #9e9a95; +} + +.token.punctuation { + color: #999; +} + +.token.namespace { + opacity: 0.7; +} + +.token.number, +.token.string, +.token.property, +.token.tag, +.token.boolean, +.token.constant, +.token.symbol, +.token.deleted { + color: #905; +} + +.token.selector, +.token.attr-name, +.token.char, +.token.builtin, +.token.inserted { + color: #690; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #9a6e3a; +} + +.token.atrule, +.token.attr-value { + color: #07a; +} + +.token.keyword { + color: #770c56; +} + +.token.function, +.token.class-name { + color: #8e3608; +} + +.token.regex, +.token.important, +.token.variable { + color: #e90; +} + +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} + +@media (prefers-color-scheme: dark) { + .token.keyword { + color: #e170be; + } + + .token.number, + .token.string, + .token.property, + .token.tag, + .token.boolean, + .token.constant, + .token.symbol, + .token.deleted { + color: #cfc0c8; + } + + .token.function, + .token.class-name { + color: #db8e66; + } +} diff --git a/src/ui/components/DocUsage/styles.css.ts b/src/ui/components/DocUsage/styles.css.ts index 63ec308a..dd58efa3 100644 --- a/src/ui/components/DocUsage/styles.css.ts +++ b/src/ui/components/DocUsage/styles.css.ts @@ -14,11 +14,25 @@ export const optionLink = style({ borderTopRightRadius: '3px', borderTopLeftRadius: '3px', backgroundColor: '#faf6f0', + + '@media': { + '(prefers-color-scheme: dark)': { + backgroundColor: '#4a2f3e', + color: '#c9bec5', + }, + }, }) export const optionLinkIsCurrent = style({ color: '#000', backgroundColor: '#e8d6e3', + + '@media': { + '(prefers-color-scheme: dark)': { + backgroundColor: '#8c1b54', + color: '#fff', + }, + }, }) export const options = style({ diff --git a/src/ui/components/Home/styles.css.ts b/src/ui/components/Home/styles.css.ts index 87075ffc..f417856f 100644 --- a/src/ui/components/Home/styles.css.ts +++ b/src/ui/components/Home/styles.css.ts @@ -39,6 +39,24 @@ export const header = style({ color: '#770c56', fontWeight: '600', fontSize: '20px', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#c79ab9', + }, + }, +}) + +export const subHeader = style({ + color: '#770c56', + marginTop: '0.8rem', + fontSize: '1rem', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#c79ab9', + }, + }, }) export const innerContainer = style({ @@ -52,18 +70,18 @@ export const innerContainer = style({ export const link = style({ color: '#862d5b', textDecoration: 'none', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#ffe7f7', + }, + }, }) export const linkDecorated = style({ textDecoration: 'underline', }) -export const subHeader = style({ - color: '#770c56', - marginTop: '0.8rem', - fontSize: '1rem', -}) - export const actions = style({ display: 'flex', alignItems: 'center', @@ -93,6 +111,22 @@ export const block = style({ backgroundColor: '#fffdfa', }, }, + + '@media': { + '(prefers-color-scheme: dark)': { + borderColor: '#31292d', + + selectors: { + '&:nth-child(even)': { + backgroundColor: '#240e19', + }, + + '&:nth-child(odd)': { + backgroundColor: '#160e12', + }, + }, + }, + }, }) export const content = style({ diff --git a/src/ui/global.css b/src/ui/global.css index 57e993b1..1f851f41 100644 --- a/src/ui/global.css +++ b/src/ui/global.css @@ -48,4 +48,17 @@ code:after { :root { --color-tooltip-canvas: #280027; --color-tooltip-ink: #fff5ff; + --icon-color: #770c5699; +} + +@media (prefers-color-scheme: dark) { + :root { + color-scheme: dark; + --icon-color: #dfc2d6; + } + + code { + background-color: #1e0814; + color: #c5c4c2; + } } diff --git a/src/ui/screens/Home/Examples/styles.css.ts b/src/ui/screens/Home/Examples/styles.css.ts index 3fb2d114..2639804f 100644 --- a/src/ui/screens/Home/Examples/styles.css.ts +++ b/src/ui/screens/Home/Examples/styles.css.ts @@ -20,11 +20,25 @@ export const optionLink = style({ borderTopRightRadius: '3px', borderTopLeftRadius: '3px', backgroundColor: '#efe8df', + + '@media': { + '(prefers-color-scheme: dark)': { + backgroundColor: '#4a2f3e', + color: '#c9bec5', + }, + }, }) export const optionLinkIsCurrent = style({ color: 'white', backgroundColor: '#770c56', + + '@media': { + '(prefers-color-scheme: dark)': { + backgroundColor: '#8c1b54', + color: '#fff', + }, + }, }) export const options = style({ diff --git a/src/ui/screens/Home/Features/features.tsx b/src/ui/screens/Home/Features/features.tsx index f3f868f8..5d719705 100644 --- a/src/ui/screens/Home/Features/features.tsx +++ b/src/ui/screens/Home/Features/features.tsx @@ -1,10 +1,21 @@ import { h, Fragment, VNode } from 'preact' -import { iconType } from './styles.css' +import ComingIcon from './icons/ComingIcon' +import ConsistentIcon from './icons/ConsistentIcon' +import DocsIcon from './icons/DocsIcon' +import FastIcon from './icons/FastIcon' +import FPIcon from './icons/FPIcon' +import I18nIcon from './icons/I18nIcon' +import ImmutableIcon from './icons/ImmutableIcon' +import ModularIcon from './icons/ModularIcon' +import NativeIcon from './icons/NativeIcon' +import ReliableIcon from './icons/ReliableIcon' +import SimpleIcon from './icons/SimpleIcon' +import TypesIcon from './icons/TypesIcon' export interface Feature { title: string description: VNode - icon: keyof typeof iconType + icon: VNode } export const features: Feature[] = [ @@ -24,7 +35,7 @@ export const features: Feature[] = [

    ), - icon: 'modular', + icon: , }, { @@ -42,7 +53,7 @@ export const features: Feature[] = [

    ), - icon: 'native', + icon: , }, { @@ -57,7 +68,7 @@ export const features: Feature[] = [

    It helps to prevent bugs and avoid long debugging sessions.

    ), - icon: 'immutable', + icon: , }, { @@ -75,7 +86,7 @@ export const features: Feature[] = [

    ), - icon: 'types', + icon: , }, { @@ -87,7 +98,7 @@ export const features: Feature[] = [ bloat your build. ), - icon: 'fp', + icon: , }, { @@ -98,7 +109,7 @@ export const features: Feature[] = [ Only the ones that you use will be included in your project. ), - icon: 'i18n', + icon: , }, { @@ -115,7 +126,7 @@ export const features: Feature[] = [

    ), - icon: 'consistent', + icon: , }, { @@ -132,7 +143,7 @@ export const features: Feature[] = [

    ), - icon: 'reliable', + icon: , }, { @@ -150,7 +161,7 @@ export const features: Feature[] = [

    ), - icon: 'simple', + icon: , }, { @@ -161,7 +172,7 @@ export const features: Feature[] = [ users will have the best user experience. ), - icon: 'fast', + icon: , }, { @@ -173,7 +184,7 @@ export const features: Feature[] = [ thanks to JSDoc annotations. ), - icon: 'docs', + icon: , }, { @@ -184,6 +195,6 @@ export const features: Feature[] = [ features. ), - icon: 'coming', + icon: , }, ] diff --git a/src/ui/screens/Home/Features/icons/ComingIcon.tsx b/src/ui/screens/Home/Features/icons/ComingIcon.tsx new file mode 100644 index 00000000..ff5ad423 --- /dev/null +++ b/src/ui/screens/Home/Features/icons/ComingIcon.tsx @@ -0,0 +1,13 @@ +import { h } from 'preact' + +export default function ComingIcon() { + return ( + + + + + + + + ) +} diff --git a/src/ui/screens/Home/Features/icons/ConsistentIcon.tsx b/src/ui/screens/Home/Features/icons/ConsistentIcon.tsx new file mode 100644 index 00000000..30803953 --- /dev/null +++ b/src/ui/screens/Home/Features/icons/ConsistentIcon.tsx @@ -0,0 +1,21 @@ +import { h } from 'preact' + +export default function ConsistentIcon() { + return ( + + + + + + + + + + ) +} diff --git a/src/ui/screens/Home/Features/icons/DocsIcon.tsx b/src/ui/screens/Home/Features/icons/DocsIcon.tsx new file mode 100644 index 00000000..f1ccb96c --- /dev/null +++ b/src/ui/screens/Home/Features/icons/DocsIcon.tsx @@ -0,0 +1,13 @@ +import { h } from 'preact' + +export default function DocsIcon() { + return ( + + + + + + + + ) +} diff --git a/src/ui/screens/Home/Features/icons/FPIcon.tsx b/src/ui/screens/Home/Features/icons/FPIcon.tsx new file mode 100644 index 00000000..0b459df5 --- /dev/null +++ b/src/ui/screens/Home/Features/icons/FPIcon.tsx @@ -0,0 +1,27 @@ +import { h } from 'preact' + +export default function FPIcon() { + return ( + + + + + + + + + + + + + ) +} diff --git a/src/ui/screens/Home/Features/icons/FastIcon.tsx b/src/ui/screens/Home/Features/icons/FastIcon.tsx new file mode 100644 index 00000000..e2e79ac1 --- /dev/null +++ b/src/ui/screens/Home/Features/icons/FastIcon.tsx @@ -0,0 +1,14 @@ +import { h } from 'preact' + +export default function FastIcon() { + return ( + + + + + + ) +} diff --git a/src/ui/screens/Home/Features/icons/I18nIcon.tsx b/src/ui/screens/Home/Features/icons/I18nIcon.tsx new file mode 100644 index 00000000..c6036cba --- /dev/null +++ b/src/ui/screens/Home/Features/icons/I18nIcon.tsx @@ -0,0 +1,14 @@ +import { h } from 'preact' + +export default function I18nIcon() { + return ( + + + + + + ) +} diff --git a/src/ui/screens/Home/Features/icons/ImmutableIcon.tsx b/src/ui/screens/Home/Features/icons/ImmutableIcon.tsx new file mode 100644 index 00000000..26c3925a --- /dev/null +++ b/src/ui/screens/Home/Features/icons/ImmutableIcon.tsx @@ -0,0 +1,14 @@ +import { h } from 'preact' + +export default function ImmutableIcon() { + return ( + + + + + + ) +} diff --git a/src/ui/screens/Home/Features/icons/ModularIcon.tsx b/src/ui/screens/Home/Features/icons/ModularIcon.tsx new file mode 100644 index 00000000..55a46df2 --- /dev/null +++ b/src/ui/screens/Home/Features/icons/ModularIcon.tsx @@ -0,0 +1,14 @@ +import { h } from 'preact' + +export default function ModularIcon() { + return ( + + + + + + ) +} diff --git a/src/ui/screens/Home/Features/icons/NativeIcon.tsx b/src/ui/screens/Home/Features/icons/NativeIcon.tsx new file mode 100644 index 00000000..d3851859 --- /dev/null +++ b/src/ui/screens/Home/Features/icons/NativeIcon.tsx @@ -0,0 +1,15 @@ +import { h } from 'preact' + +export default function NativeIcon() { + return ( + + + + + + ) +} diff --git a/src/ui/screens/Home/Features/icons/ReliableIcon.tsx b/src/ui/screens/Home/Features/icons/ReliableIcon.tsx new file mode 100644 index 00000000..e00cc471 --- /dev/null +++ b/src/ui/screens/Home/Features/icons/ReliableIcon.tsx @@ -0,0 +1,14 @@ +import { h } from 'preact' + +export default function ReliableIcon() { + return ( + + + + + + ) +} diff --git a/src/ui/screens/Home/Features/icons/SafeIcon.tsx b/src/ui/screens/Home/Features/icons/SafeIcon.tsx new file mode 100644 index 00000000..43b2f0d8 --- /dev/null +++ b/src/ui/screens/Home/Features/icons/SafeIcon.tsx @@ -0,0 +1,14 @@ +import { h } from 'preact' + +export default function SafeIcon() { + return ( + + + + + + ) +} diff --git a/src/ui/screens/Home/Features/icons/SimpleIcon.tsx b/src/ui/screens/Home/Features/icons/SimpleIcon.tsx new file mode 100644 index 00000000..60303b6c --- /dev/null +++ b/src/ui/screens/Home/Features/icons/SimpleIcon.tsx @@ -0,0 +1,14 @@ +import { h } from 'preact' + +export default function SimpleIcon() { + return ( + + + + + + ) +} diff --git a/src/ui/screens/Home/Features/icons/TypesIcon.tsx b/src/ui/screens/Home/Features/icons/TypesIcon.tsx new file mode 100644 index 00000000..e08abcd1 --- /dev/null +++ b/src/ui/screens/Home/Features/icons/TypesIcon.tsx @@ -0,0 +1,23 @@ +import { h } from 'preact' + +export default function TypesIcon() { + return ( + + + + + + + + + + + + ) +} diff --git a/src/ui/screens/Home/Features/img/coming.svg b/src/ui/screens/Home/Features/img/coming.svg deleted file mode 100644 index 3f19dfd5..00000000 --- a/src/ui/screens/Home/Features/img/coming.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - Group 7 - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/src/ui/screens/Home/Features/img/consistent.svg b/src/ui/screens/Home/Features/img/consistent.svg deleted file mode 100644 index 23acd204..00000000 --- a/src/ui/screens/Home/Features/img/consistent.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - Untitled 5 - Created with Sketch. - - - - - - - - - \ No newline at end of file diff --git a/src/ui/screens/Home/Features/img/docs.svg b/src/ui/screens/Home/Features/img/docs.svg deleted file mode 100644 index 00f5c3a2..00000000 --- a/src/ui/screens/Home/Features/img/docs.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - noun_1121101 - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/src/ui/screens/Home/Features/img/fast.svg b/src/ui/screens/Home/Features/img/fast.svg deleted file mode 100644 index 233413f0..00000000 --- a/src/ui/screens/Home/Features/img/fast.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - Untitled 15 - Created with Sketch. - - - - - \ No newline at end of file diff --git a/src/ui/screens/Home/Features/img/fp.svg b/src/ui/screens/Home/Features/img/fp.svg deleted file mode 100644 index 54666973..00000000 --- a/src/ui/screens/Home/Features/img/fp.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - Group 4 - Created with Sketch. - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ui/screens/Home/Features/img/i18n.svg b/src/ui/screens/Home/Features/img/i18n.svg deleted file mode 100644 index d55f4152..00000000 --- a/src/ui/screens/Home/Features/img/i18n.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - Ы - Created with Sketch. - - - - - \ No newline at end of file diff --git a/src/ui/screens/Home/Features/img/immutable.svg b/src/ui/screens/Home/Features/img/immutable.svg deleted file mode 100644 index 71c9c12f..00000000 --- a/src/ui/screens/Home/Features/img/immutable.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - Untitled 17 - Created with Sketch. - - - - - \ No newline at end of file diff --git a/src/ui/screens/Home/Features/img/modular.svg b/src/ui/screens/Home/Features/img/modular.svg deleted file mode 100644 index 8527ff2e..00000000 --- a/src/ui/screens/Home/Features/img/modular.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - Untitled 16 - Created with Sketch. - - - - - \ No newline at end of file diff --git a/src/ui/screens/Home/Features/img/native.svg b/src/ui/screens/Home/Features/img/native.svg deleted file mode 100644 index 54539f12..00000000 --- a/src/ui/screens/Home/Features/img/native.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - Shape - Created with Sketch. - - - - - \ No newline at end of file diff --git a/src/ui/screens/Home/Features/img/reliable.svg b/src/ui/screens/Home/Features/img/reliable.svg deleted file mode 100644 index 8c9c9618..00000000 --- a/src/ui/screens/Home/Features/img/reliable.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - Untitled 12 - Created with Sketch. - - - - - \ No newline at end of file diff --git a/src/ui/screens/Home/Features/img/safe.svg b/src/ui/screens/Home/Features/img/safe.svg deleted file mode 100644 index 56020d61..00000000 --- a/src/ui/screens/Home/Features/img/safe.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - Untitled 14 - Created with Sketch. - - - - - \ No newline at end of file diff --git a/src/ui/screens/Home/Features/img/simple.svg b/src/ui/screens/Home/Features/img/simple.svg deleted file mode 100644 index 99545cc9..00000000 --- a/src/ui/screens/Home/Features/img/simple.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - Untitled 12 - Created with Sketch. - - - - - \ No newline at end of file diff --git a/src/ui/screens/Home/Features/img/types.svg b/src/ui/screens/Home/Features/img/types.svg deleted file mode 100644 index 6d4cac83..00000000 --- a/src/ui/screens/Home/Features/img/types.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - Group 2 - Created with Sketch. - - - - - - - - - - - \ No newline at end of file diff --git a/src/ui/screens/Home/Features/index.tsx b/src/ui/screens/Home/Features/index.tsx index 11d32f39..1e50a048 100644 --- a/src/ui/screens/Home/Features/index.tsx +++ b/src/ui/screens/Home/Features/index.tsx @@ -2,14 +2,13 @@ import { h } from 'preact' import { HomeBlock } from '~/ui/components/Home' import { features } from './features' import * as styles from './styles.css' -import classNames from 'classnames' export const Features = () => (
      {features.map((feature) => (
    1. -
      +
      {feature.icon}

      {feature.title}

      {feature.description}
      diff --git a/src/ui/screens/Home/Features/styles.css.ts b/src/ui/screens/Home/Features/styles.css.ts index 5b20d81f..90bdf83b 100644 --- a/src/ui/screens/Home/Features/styles.css.ts +++ b/src/ui/screens/Home/Features/styles.css.ts @@ -1,17 +1,4 @@ import { style, globalStyle, styleVariants } from '@vanilla-extract/css' -import comingURL from './img/coming.svg' -import consistentURL from './img/consistent.svg' -import docsURL from './img/docs.svg' -import fastURL from './img/fast.svg' -import fpURL from './img/fp.svg' -import i18nURL from './img/i18n.svg' -import immutableURL from './img/immutable.svg' -import modularURL from './img/modular.svg' -import nativeURL from './img/native.svg' -import reliableURL from './img/reliable.svg' -import safeURL from './img/safe.svg' -import simpleURL from './img/simple.svg' -import typesURL from './img/types.svg' export const content = style({ marginLeft: '15px', @@ -21,88 +8,100 @@ export const icon = style({ width: '38px', height: '38px', backgroundSize: '40px', - border: '1px solid rgba(119,12,86,0.6)', + border: '1px solid var(--icon-color)', borderRadius: '50%', backgroundRepeat: 'no-repeat', backgroundPosition: 'center', flexShrink: '0', marginTop: '2px', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + + '@media': { + '(prefers-color-scheme: dark)': {}, + }, +}) + +globalStyle(`${icon} > svg`, { + height: '60%', + display: 'inline-block', }) export const iconType = styleVariants({ coming: { - backgroundImage: `url(${comingURL})`, + // backgroundImage: `url(${comingURL})`, backgroundSize: '20px', backgroundPosition: 'center 8px', }, consistent: { - backgroundImage: `url('${consistentURL}')`, + // backgroundImage: `url('${consistentURL}')`, backgroundSize: '21px', backgroundPosition: 'center 7px', }, docs: { - backgroundImage: `url('${docsURL}')`, + // backgroundImage: `url('${docsURL}')`, backgroundSize: '19px', backgroundPosition: 'center 7px', }, fast: { - backgroundImage: `url('${fastURL}')`, + // backgroundImage: `url('${fastURL}')`, backgroundSize: '15px', backgroundPosition: 'center 8px', }, fp: { - backgroundImage: `url('${fpURL}')`, + // backgroundImage: `url('${fpURL}')`, backgroundSize: '16px', backgroundPosition: 'center 8px', }, i18n: { - backgroundImage: `url('${i18nURL}')`, + // backgroundImage: `url('${i18nURL}')`, backgroundSize: '16px', backgroundPosition: 'center 9px', }, immutable: { - backgroundImage: `url('${immutableURL}')`, + // backgroundImage: `url('${immutableURL}')`, backgroundSize: '17px', backgroundPosition: 'center 6px', }, modular: { - backgroundImage: `url('${modularURL}')`, + // backgroundImage: `url('${modularURL}')`, backgroundSize: '17px', backgroundPosition: 'center 6px', }, native: { - backgroundImage: `url('${nativeURL}')`, + // backgroundImage: `url('${nativeURL}')`, backgroundSize: '24px', backgroundPosition: 'center 6px', }, reliable: { - backgroundImage: `url('${reliableURL}')`, + // backgroundImage: `url('${reliableURL}')`, backgroundSize: '21px', backgroundPosition: 'center 6px', }, safe: { - backgroundImage: `url('${safeURL}')`, + // backgroundImage: `url('${safeURL}')`, backgroundSize: '18px', }, simple: { - backgroundImage: `url('${simpleURL}')`, + // backgroundImage: `url('${simpleURL}')`, backgroundSize: '20px', backgroundPosition: 'center 8px', }, types: { - backgroundImage: `url('${typesURL}')`, + // backgroundImage: `url('${typesURL}')`, backgroundSize: '20px', backgroundPosition: 'center 8px', }, @@ -114,6 +113,12 @@ export const list = style({ fontSize: '17px', display: 'flex', flexWrap: 'wrap', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#ddd2d9', + }, + }, }) export const title = style({ @@ -127,6 +132,12 @@ export const description = style({ fontWeight: '400', fontSize: '16px', lineHeight: '22px', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#cbc0c7', + }, + }, }) globalStyle(`${description} p`, { diff --git a/src/ui/screens/Home/Promo/styles.css.ts b/src/ui/screens/Home/Promo/styles.css.ts index f91d4e8c..1cc15f9a 100644 --- a/src/ui/screens/Home/Promo/styles.css.ts +++ b/src/ui/screens/Home/Promo/styles.css.ts @@ -9,6 +9,12 @@ export const outer = style({ backgroundSize: 'cover', backgroundPosition: 'top center', overflowY: 'auto', + + '@media': { + '(prefers-color-scheme: dark)': { + borderBottom: '1px solid #31292d', + }, + }, }) export const inner = style({ @@ -18,6 +24,12 @@ export const inner = style({ display: 'flex', flexDirection: 'column', justifyContent: 'center', + + '@media': { + '(prefers-color-scheme: dark)': { + background: 'linear-gradient(#34031bb3, #1e0b14)', + }, + }, }) export const logo = style({ diff --git a/src/ui/screens/Home/Testimonials/styles.css.ts b/src/ui/screens/Home/Testimonials/styles.css.ts index ff8aebaa..7554dbf0 100644 --- a/src/ui/screens/Home/Testimonials/styles.css.ts +++ b/src/ui/screens/Home/Testimonials/styles.css.ts @@ -11,6 +11,12 @@ export const avatarImage = style({ height: '60px', borderRadius: '50%', border: '1px solid #e4e4dd', + + '@media': { + '(prefers-color-scheme: dark)': { + borderColor: '1px solid #31292d', + }, + }, }) export const list = style({ @@ -33,6 +39,13 @@ export const quote = style({ padding: '16px 15px 15px', flexGrow: '1', position: 'relative', + + '@media': { + '(prefers-color-scheme: dark)': { + borderColor: '#31292d', + backgroundColor: '#14070e', + }, + }, }) export const quoteTriangle = style({ @@ -44,6 +57,12 @@ export const quoteTriangle = style({ position: 'absolute', top: '16px', left: '-12px', + + '@media': { + '(prefers-color-scheme: dark)': { + borderRightColor: '#31292d', + }, + }, }) export const quoteTriangleInner = style({ @@ -55,6 +74,12 @@ export const quoteTriangleInner = style({ borderTop: '11px solid rgba(0,0,0,0)', borderBottom: '11px solid rgba(0,0,0,0)', borderRight: '11px solid #fff', + + '@media': { + '(prefers-color-scheme: dark)': { + borderRightColor: '#14070e', + }, + }, }) export const text = style({ @@ -62,6 +87,12 @@ export const text = style({ fontWeight: '400', fontSize: '16px', lineHeight: '22px', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#cbc0c7', + }, + }, }) export const item = style({ From 1793bdb74ba06de0b42c34445a23bbed1e5d1174 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Sun, 26 Mar 2023 15:29:59 +0800 Subject: [PATCH 29/36] Full home page dark mode, docs --- src/ui/components/Code/styles.css.ts | 7 ++-- src/ui/components/Home/styles.css.ts | 35 +++++++++++++++---- src/ui/components/Item/styles.css.ts | 33 +++++++++++++++++ src/ui/components/RichText/styles.css.ts | 24 +++++++++++++ src/ui/global.css | 2 +- src/ui/screens/Docs/Doc/styles.css.ts | 8 +++++ src/ui/screens/Docs/Finder/styles.css.ts | 14 ++++++++ src/ui/screens/Docs/styles.css.ts | 8 ++++- src/ui/screens/Home/Promo/styles.css.ts | 16 +++++++-- src/ui/screens/Home/Sponsorship/styles.css.ts | 7 ++++ .../screens/Home/Testimonials/styles.css.ts | 10 ++++-- 11 files changed, 149 insertions(+), 15 deletions(-) diff --git a/src/ui/components/Code/styles.css.ts b/src/ui/components/Code/styles.css.ts index 17c55959..4ad7a67f 100644 --- a/src/ui/components/Code/styles.css.ts +++ b/src/ui/components/Code/styles.css.ts @@ -17,7 +17,7 @@ export const code = style({ '@media': { '(prefers-color-scheme: dark)': { color: '#c5c4c2', - backgroundColor: '#1e0814', + backgroundColor: '#12000a', }, }, }) @@ -27,11 +27,12 @@ export const pre = style({ border: '1px solid #b9a2b2', backgroundColor: '#fffffe', padding: '.25rem .5rem', + borderRadius: '4px', '@media': { '(prefers-color-scheme: dark)': { - backgroundColor: '#1e0814', - borderColor: '#361e2a', + backgroundColor: '#12000a', + borderColor: '#2c1622', }, }, }) diff --git a/src/ui/components/Home/styles.css.ts b/src/ui/components/Home/styles.css.ts index f417856f..e47750e7 100644 --- a/src/ui/components/Home/styles.css.ts +++ b/src/ui/components/Home/styles.css.ts @@ -3,6 +3,12 @@ import { style, globalStyle, styleVariants } from '@vanilla-extract/css' export const action = style({ color: '#8c1b54', marginTop: '20px', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#ff80c0', + }, + }, }) export const buttonBase = style({ @@ -31,6 +37,13 @@ export const button = styleVariants({ background: 'transparent', color: '#8c1b54', border: '1px solid #8c1b54', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#bb8aa2', + borderColor: '#bb8aa2', + }, + }, }, ], }) @@ -42,7 +55,7 @@ export const header = style({ '@media': { '(prefers-color-scheme: dark)': { - color: '#c79ab9', + color: '#ddd2d9', }, }, }) @@ -54,7 +67,7 @@ export const subHeader = style({ '@media': { '(prefers-color-scheme: dark)': { - color: '#c79ab9', + color: '#fbd7a1', }, }, }) @@ -73,7 +86,11 @@ export const link = style({ '@media': { '(prefers-color-scheme: dark)': { - color: '#ffe7f7', + color: '#e1a8c5', + + ':hover': { + color: '#ff80c0', + }, }, }, }) @@ -114,15 +131,15 @@ export const block = style({ '@media': { '(prefers-color-scheme: dark)': { - borderColor: '#31292d', + borderColor: '#2c1622', selectors: { '&:nth-child(even)': { - backgroundColor: '#240e19', + backgroundColor: '#1a030f', }, '&:nth-child(odd)': { - backgroundColor: '#160e12', + backgroundColor: '#12020a', }, }, }, @@ -147,6 +164,12 @@ export const text = style({ textAlign: 'center', color: '#4c193c', maxWidth: '500px', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#cbc0c7', + }, + }, }) globalStyle(`${text} img`, { diff --git a/src/ui/components/Item/styles.css.ts b/src/ui/components/Item/styles.css.ts index bdf28c69..98d62a17 100644 --- a/src/ui/components/Item/styles.css.ts +++ b/src/ui/components/Item/styles.css.ts @@ -13,6 +13,17 @@ export const item = style({ ':hover': { background: '#fdf6f9', }, + + '@media': { + '(prefers-color-scheme: dark)': { + backgroundColor: '#120009', + borderColor: '#2c1622', + + ':hover': { + background: '#3c001e', + }, + }, + }, }) export const icon = style({ @@ -30,6 +41,16 @@ export const active = style({ ':hover': { backgroundColor: '#fff0f3', }, + + '@media': { + '(prefers-color-scheme: dark)': { + backgroundColor: '#2c0016', + + ':hover': { + backgroundColor: '#2c0016', + }, + }, + }, }) export const title = style({ @@ -37,6 +58,12 @@ export const title = style({ marginBottom: '0.4px', wordBreak: 'break-all', color: '#4c193c', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#ddd2d9', + }, + }, }) export const codeTitle = style({ @@ -52,4 +79,10 @@ export const summary = style({ WebkitLineClamp: 2, overflow: 'hidden', wordBreak: 'break-all', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#9d8995', + }, + }, }) diff --git a/src/ui/components/RichText/styles.css.ts b/src/ui/components/RichText/styles.css.ts index 470bf023..8413f58d 100644 --- a/src/ui/components/RichText/styles.css.ts +++ b/src/ui/components/RichText/styles.css.ts @@ -7,6 +7,12 @@ export const content = style({ globalStyle(`${content} a`, { color: '#5d3861', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#ff80c0', + }, + }, }) globalStyle(`${content} h1`, { @@ -15,6 +21,12 @@ globalStyle(`${content} h1`, { marginBottom: '30px', paddingBottom: '23px', borderBottom: '1px solid rgba(88,68,82,0.1)', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#fff6fc', + }, + }, }) globalStyle(`${content} h2`, { @@ -24,6 +36,12 @@ globalStyle(`${content} h2`, { paddingBottom: '10px', marginTop: '30px', borderBottom: '1px solid rgba(88,68,82,0.1)', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#ddd2d9', + }, + }, }) globalStyle(`${content} h3`, { @@ -32,6 +50,12 @@ globalStyle(`${content} h3`, { fontSize: '1.2rem', marginBottom: '20px', marginTop: '20px', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#ddd2d9', + }, + }, }) globalStyle(`${content} ol`, { diff --git a/src/ui/global.css b/src/ui/global.css index 1f851f41..c7a4eadd 100644 --- a/src/ui/global.css +++ b/src/ui/global.css @@ -54,7 +54,7 @@ code:after { @media (prefers-color-scheme: dark) { :root { color-scheme: dark; - --icon-color: #dfc2d6; + --icon-color: #585056; } code { diff --git a/src/ui/screens/Docs/Doc/styles.css.ts b/src/ui/screens/Docs/Doc/styles.css.ts index e7ed6c84..967287f7 100644 --- a/src/ui/screens/Docs/Doc/styles.css.ts +++ b/src/ui/screens/Docs/Doc/styles.css.ts @@ -6,4 +6,12 @@ export const wrapper = style({ backgroundColor: '#fffdf9', maxWidth: '55rem', minHeight: '100%', + + '@media': { + '(prefers-color-scheme: dark)': { + backgroundColor: '#1a030f', + color: '#cbc0c7', + borderRight: '1px solid #2c1622', + }, + }, }) diff --git a/src/ui/screens/Docs/Finder/styles.css.ts b/src/ui/screens/Docs/Finder/styles.css.ts index ac370022..c7a0b357 100644 --- a/src/ui/screens/Docs/Finder/styles.css.ts +++ b/src/ui/screens/Docs/Finder/styles.css.ts @@ -20,6 +20,14 @@ export const categoryHeader = style({ position: 'sticky', top: '0', backgroundColor: '#fffbf5', + + '@media': { + '(prefers-color-scheme: dark)': { + backgroundColor: '#280215', + borderColor: '#2c1622', + color: '#ddd2d9', + }, + }, }) export const container = style({ @@ -31,6 +39,12 @@ export const container = style({ alignItems: 'stretch', borderRight: '1px solid #e6e0e6', borderLeft: '1px solid #e6e0e6', + + '@media': { + '(prefers-color-scheme: dark)': { + borderColor: '#2c1622', + }, + }, }) export const content = style({ diff --git a/src/ui/screens/Docs/styles.css.ts b/src/ui/screens/Docs/styles.css.ts index bdb1b98f..b41388b7 100644 --- a/src/ui/screens/Docs/styles.css.ts +++ b/src/ui/screens/Docs/styles.css.ts @@ -3,8 +3,14 @@ import { style } from '@vanilla-extract/css' export const screen = style({ height: '100%', width: '100%', - overflowY: 'auto', + overflowY: 'scroll', background: '#fffdf9', + + '@media': { + '(prefers-color-scheme: dark)': { + backgroundColor: '#12020a', + }, + }, }) export const content = style({ diff --git a/src/ui/screens/Home/Promo/styles.css.ts b/src/ui/screens/Home/Promo/styles.css.ts index 1cc15f9a..aa401cd9 100644 --- a/src/ui/screens/Home/Promo/styles.css.ts +++ b/src/ui/screens/Home/Promo/styles.css.ts @@ -12,7 +12,7 @@ export const outer = style({ '@media': { '(prefers-color-scheme: dark)': { - borderBottom: '1px solid #31292d', + borderBottom: '1px solid #2c1622', }, }, }) @@ -27,7 +27,7 @@ export const inner = style({ '@media': { '(prefers-color-scheme: dark)': { - background: 'linear-gradient(#34031bb3, #1e0b14)', + background: 'linear-gradient(#2a0517d6, #12020a)', }, }, }) @@ -56,6 +56,12 @@ export const header = style({ fontSize: '20px', marginTop: '2rem', fontWeight: 300, + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#fff6fc', + }, + }, }) export const text = style({ @@ -66,6 +72,12 @@ export const text = style({ marginTop: '1rem', color: '#ffe9c9', maxWidth: '500px', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#cbc0c7', + }, + }, }) export const gettingStarted = style({ diff --git a/src/ui/screens/Home/Sponsorship/styles.css.ts b/src/ui/screens/Home/Sponsorship/styles.css.ts index cbfda2cc..4e9399a9 100644 --- a/src/ui/screens/Home/Sponsorship/styles.css.ts +++ b/src/ui/screens/Home/Sponsorship/styles.css.ts @@ -19,6 +19,7 @@ export const itemImageContainer = style({ display: 'flex', flexDirection: 'column', justifyContent: 'center', + backgroundColor: 'white', }) export const tier = styleVariants({ @@ -63,4 +64,10 @@ export const subheader = style({ textAlign: 'center', color: '#4c193c', marginBottom: '25px', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#ddd2d9', + }, + }, }) diff --git a/src/ui/screens/Home/Testimonials/styles.css.ts b/src/ui/screens/Home/Testimonials/styles.css.ts index 7554dbf0..83efbd0d 100644 --- a/src/ui/screens/Home/Testimonials/styles.css.ts +++ b/src/ui/screens/Home/Testimonials/styles.css.ts @@ -14,7 +14,7 @@ export const avatarImage = style({ '@media': { '(prefers-color-scheme: dark)': { - borderColor: '1px solid #31292d', + borderColor: '#2c1622', }, }, }) @@ -30,6 +30,12 @@ export const name = style({ fontWeight: '600', fontSize: '17px', marginBottom: '5px', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#ddd2d9', + }, + }, }) export const quote = style({ @@ -42,7 +48,7 @@ export const quote = style({ '@media': { '(prefers-color-scheme: dark)': { - borderColor: '#31292d', + borderColor: '#2c1622', backgroundColor: '#14070e', }, }, From 5db0e0c603a8f979f499886f0d9683c2ede25763 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Mon, 3 Apr 2023 17:18:12 +0800 Subject: [PATCH 30/36] More dark theme styles --- src/ui/components/DocUsage/styles.css.ts | 6 ++++ src/ui/components/Entities/styles.css.ts | 6 ++++ src/ui/components/RichText/styles.css.ts | 32 +++++++++++++++++++ src/ui/components/Search/styles.css.ts | 15 ++++++++- .../Docs/Doc/TypeDoc/Constants/styles.css.ts | 6 ++++ .../Docs/Doc/TypeDoc/Types/styles.css.ts | 12 +++++++ src/ui/screens/Docs/Finder/styles.css.ts | 1 + src/ui/screens/Docs/styles.css.ts | 2 +- 8 files changed, 78 insertions(+), 2 deletions(-) diff --git a/src/ui/components/DocUsage/styles.css.ts b/src/ui/components/DocUsage/styles.css.ts index dd58efa3..22234359 100644 --- a/src/ui/components/DocUsage/styles.css.ts +++ b/src/ui/components/DocUsage/styles.css.ts @@ -47,4 +47,10 @@ export const optionSelect = style({ backgroundColor: 'transparent', marginLeft: '0.25rem', color: '#5d3861', + + '@media': { + '(prefers-color-scheme: dark)': { + borderColor: '#2c1622', + }, + }, }) diff --git a/src/ui/components/Entities/styles.css.ts b/src/ui/components/Entities/styles.css.ts index 94f58cc1..64189770 100644 --- a/src/ui/components/Entities/styles.css.ts +++ b/src/ui/components/Entities/styles.css.ts @@ -12,6 +12,12 @@ export const miltiEntity = style({ border: '1px solid #5844521a', padding: '1rem', background: '#fffefd', + + '@media': { + '(prefers-color-scheme: dark)': { + borderColor: '#2c1622', + }, + }, }) globalStyle(`${miltiEntity} > :first-child > :first-child`, { diff --git a/src/ui/components/RichText/styles.css.ts b/src/ui/components/RichText/styles.css.ts index 8413f58d..92a330cc 100644 --- a/src/ui/components/RichText/styles.css.ts +++ b/src/ui/components/RichText/styles.css.ts @@ -110,6 +110,12 @@ globalStyle(`${content} table`, { backgroundColor: '#fffffe', borderRadius: '2px', marginBottom: '10px', + + '@media': { + '(prefers-color-scheme: dark)': { + backgroundColor: '#12000a', + }, + }, }) globalStyle(`${content} table table`, { @@ -119,17 +125,36 @@ globalStyle(`${content} table table`, { globalStyle(`${content} table table td`, { border: '1px solid #d6cdd3', padding: '3px 6px', + + '@media': { + '(prefers-color-scheme: dark)': { + borderColor: '#2c1622', + }, + }, }) globalStyle(`${content} table table th`, { backgroundColor: '#fdfdfd', border: '1px solid #d6cdd3', padding: '3px 6px', + + '@media': { + '(prefers-color-scheme: dark)': { + borderColor: '#2c1622', + backgroundColor: '#280215', + }, + }, }) globalStyle(`${content} table td`, { border: '1px solid #b9a2b2', padding: '5px 10px', + + '@media': { + '(prefers-color-scheme: dark)': { + borderColor: '#2c1622', + }, + }, }) globalStyle(`${content} table th`, { @@ -138,6 +163,13 @@ globalStyle(`${content} table th`, { fontWeight: '600', textAlign: 'left', backgroundColor: '#faf6f0', + + '@media': { + '(prefers-color-scheme: dark)': { + borderColor: '#2c1622', + backgroundColor: '#280215', + }, + }, }) globalStyle(`${content} table:last-child`, { diff --git a/src/ui/components/Search/styles.css.ts b/src/ui/components/Search/styles.css.ts index 1531077d..dc2aef21 100644 --- a/src/ui/components/Search/styles.css.ts +++ b/src/ui/components/Search/styles.css.ts @@ -10,9 +10,14 @@ export const search = style({ display: 'flex', justifyContent: 'space-between', alignItems: 'center', - backgroundColor: '#faf6f0', borderBottom: '1px solid #e6e0e6', wordBreak: 'break-all', + + '@media': { + '(prefers-color-scheme: dark)': { + borderColor: '#2c1622', + }, + }, }) export const bordered = style({ @@ -36,4 +41,12 @@ export const input = style({ border: '0', width: '100%', fontSize: '1rem', + backgroundColor: 'white', + + '@media': { + '(prefers-color-scheme: dark)': { + backgroundColor: '#120009', + color: 'white', + }, + }, }) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Constants/styles.css.ts b/src/ui/screens/Docs/Doc/TypeDoc/Constants/styles.css.ts index b7f586d8..37b17751 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Constants/styles.css.ts +++ b/src/ui/screens/Docs/Doc/TypeDoc/Constants/styles.css.ts @@ -4,6 +4,12 @@ export const list = style({ marginTop: '1rem', borderTop: '1px solid #5844521a', paddingTop: '1rem', + + '@media': { + '(prefers-color-scheme: dark)': { + borderColor: '#2c1622', + }, + }, }) export const search = style({ diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts b/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts index 29c1100f..02f3dd80 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts +++ b/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts @@ -63,6 +63,12 @@ globalStyle(`${content} h3`, { marginBottom: '1rem', paddingBottom: '0.5rem', borderBottom: '1px solid #5844521a', + + '@media': { + '(prefers-color-scheme: dark)': { + borderColor: '#2c1622', + }, + }, }) export const header = style({ @@ -73,6 +79,12 @@ export const header = style({ display: 'flex', justifyContent: 'space-between', alignItems: 'center', + + '@media': { + '(prefers-color-scheme: dark)': { + borderColor: '#2c1622', + }, + }, }) export const headerText = style({ diff --git a/src/ui/screens/Docs/Finder/styles.css.ts b/src/ui/screens/Docs/Finder/styles.css.ts index c7a0b357..9dafa550 100644 --- a/src/ui/screens/Docs/Finder/styles.css.ts +++ b/src/ui/screens/Docs/Finder/styles.css.ts @@ -43,6 +43,7 @@ export const container = style({ '@media': { '(prefers-color-scheme: dark)': { borderColor: '#2c1622', + background: '#120009', }, }, }) diff --git a/src/ui/screens/Docs/styles.css.ts b/src/ui/screens/Docs/styles.css.ts index b41388b7..1391cab3 100644 --- a/src/ui/screens/Docs/styles.css.ts +++ b/src/ui/screens/Docs/styles.css.ts @@ -18,11 +18,11 @@ export const content = style({ display: 'flex', flexDirection: 'row', alignItems: 'stretch', - minHeight: '0', position: 'relative', maxWidth: '80rem', margin: '0 auto', width: '100%', + minHeight: '100%', }) export const loading = style({ From 4e601571a0f6c87891a7980b6c9a9d370aae434e Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Tue, 2 May 2023 09:28:02 +0700 Subject: [PATCH 31/36] Finish dark mode --- src/ui/components/HireWidget/styles.css.ts | 12 ++++++ src/ui/components/Item/img/icon.svg | 13 ------ src/ui/components/Item/index.tsx | 19 +++++++- src/ui/components/Item/styles.css.ts | 3 -- .../JobsSubscribeWidget/styles.css.ts | 43 +++++++++++++++++++ src/ui/components/JobsWidget/styles.css.ts | 12 ++++++ src/ui/global.css | 8 ++++ src/ui/screens/Docs/NavBar/styles.css.ts | 2 +- 8 files changed, 94 insertions(+), 18 deletions(-) delete mode 100644 src/ui/components/Item/img/icon.svg diff --git a/src/ui/components/HireWidget/styles.css.ts b/src/ui/components/HireWidget/styles.css.ts index 674af0d5..b61e4403 100644 --- a/src/ui/components/HireWidget/styles.css.ts +++ b/src/ui/components/HireWidget/styles.css.ts @@ -3,6 +3,12 @@ import { style } from '@vanilla-extract/css' export const container = style({ background: '#f5d958', padding: '0.25rem', + + '@media': { + '(prefers-color-scheme: dark)': { + background: '#641d03', + }, + }, }) export const block = style({ @@ -12,6 +18,12 @@ export const block = style({ flexDirection: 'column', color: 'black', transition: 'background 150ms ease-out', + + '@media': { + '(prefers-color-scheme: dark)': { + background: '#411302', + }, + }, }) export const blockContent = style({ diff --git a/src/ui/components/Item/img/icon.svg b/src/ui/components/Item/img/icon.svg deleted file mode 100644 index 9eb6ad5e..00000000 --- a/src/ui/components/Item/img/icon.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - Untitled - Created with Sketch. - - - - - - - - \ No newline at end of file diff --git a/src/ui/components/Item/index.tsx b/src/ui/components/Item/index.tsx index 817eb816..82ebbf7f 100644 --- a/src/ui/components/Item/index.tsx +++ b/src/ui/components/Item/index.tsx @@ -41,6 +41,23 @@ export const Item: FunctionComponent = ({ )}
      -
      +
      ) + +function Icon() { + return ( + + + + + + + + + ) +} diff --git a/src/ui/components/Item/styles.css.ts b/src/ui/components/Item/styles.css.ts index 98d62a17..1fffc354 100644 --- a/src/ui/components/Item/styles.css.ts +++ b/src/ui/components/Item/styles.css.ts @@ -1,5 +1,4 @@ import { style } from '@vanilla-extract/css' -import iconURL from './img/icon.svg' export const item = style({ display: 'flex', @@ -27,8 +26,6 @@ export const item = style({ }) export const icon = style({ - backgroundImage: `url('${iconURL}')`, - backgroundSize: '16px', width: '16px', height: '16px', flexShrink: '0', diff --git a/src/ui/components/JobsSubscribeWidget/styles.css.ts b/src/ui/components/JobsSubscribeWidget/styles.css.ts index d29ffb94..cc191cfc 100644 --- a/src/ui/components/JobsSubscribeWidget/styles.css.ts +++ b/src/ui/components/JobsSubscribeWidget/styles.css.ts @@ -3,12 +3,24 @@ import { style } from '@vanilla-extract/css' export const container = style({ background: '#f5d958', padding: '0.25rem', + + '@media': { + '(prefers-color-scheme: dark)': { + background: '#641d03', + }, + }, }) export const header = style({ fontSize: '1.05rem', lineHeight: '1.4', fontWeight: '600', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#ded7a9', + }, + }, }) export const block = style({ @@ -18,6 +30,12 @@ export const block = style({ flexDirection: 'column', color: 'black', transition: 'background 150ms ease-out', + + '@media': { + '(prefers-color-scheme: dark)': { + background: '#411302', + }, + }, }) export const footer = style({ @@ -27,6 +45,12 @@ export const footer = style({ display: 'block', padding: '0.5rem 0', fontSize: '0.8rem', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#a8a493', + }, + }, }) export const blockContent = style({ @@ -49,6 +73,14 @@ export const input = style({ color: 'black', marginRight: '0.5rem', border: '1px solid black', + + '@media': { + '(prefers-color-scheme: dark)': { + borderColor: '#290d03', + background: '#290d03', + color: 'white', + }, + }, }) export const subscribeButton = style({ @@ -66,6 +98,17 @@ export const subscribeButton = style({ ':hover': { color: 'red', }, + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#ded7a9', + background: '#925603', + + ':hover': { + color: 'white', + }, + }, + }, }) export const twitterIcon = style({ diff --git a/src/ui/components/JobsWidget/styles.css.ts b/src/ui/components/JobsWidget/styles.css.ts index 4c1b144c..73aa53f1 100644 --- a/src/ui/components/JobsWidget/styles.css.ts +++ b/src/ui/components/JobsWidget/styles.css.ts @@ -7,6 +7,12 @@ export const block = style({ flexDirection: 'column', color: 'black', transition: 'background 150ms ease-out', + + '@media': { + '(prefers-color-scheme: dark)': { + background: '#411302', + }, + }, }) export const blockClickable = style({ @@ -30,6 +36,12 @@ export const companyName = style({ export const container = style({ background: '#f5d958', padding: '0.25rem', + + '@media': { + '(prefers-color-scheme: dark)': { + background: '#641d03', + }, + }, }) export const footer = style({ diff --git a/src/ui/global.css b/src/ui/global.css index c7a4eadd..9831d1ab 100644 --- a/src/ui/global.css +++ b/src/ui/global.css @@ -61,4 +61,12 @@ code:after { background-color: #1e0814; color: #c5c4c2; } + + body, + input, + select, + textarea, + button { + color: white; + } } diff --git a/src/ui/screens/Docs/NavBar/styles.css.ts b/src/ui/screens/Docs/NavBar/styles.css.ts index f2e4886b..b19b8c40 100644 --- a/src/ui/screens/Docs/NavBar/styles.css.ts +++ b/src/ui/screens/Docs/NavBar/styles.css.ts @@ -4,7 +4,7 @@ import backgroundURL from './img/navBarBackground.png' export const container = style({ color: '#ffe9c9', background: '#5a0530', - backgroundImage: `url('${backgroundURL}'})`, + backgroundImage: `url('${backgroundURL}')`, backgroundSize: 'cover', backgroundPosition: 'top center', width: '100%', From 64047c099252369e539e207191e0efdf3dd29892 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Mon, 26 Jun 2023 15:06:41 +0800 Subject: [PATCH 32/36] Improve the dark theme --- src/ui/components/DocUsage/styles.css.ts | 1 + src/ui/components/Entities/styles.css.ts | 1 + src/ui/components/Home/styles.css.ts | 4 +- src/ui/components/Item/styles.css.ts | 4 +- src/ui/components/ModalPortal/styles.css.ts | 8 ++++ src/ui/components/RichText/styles.css.ts | 12 ++++- .../Docs/Doc/TypeDoc/Types/styles.css.ts | 45 +++++++++++++++++++ 7 files changed, 69 insertions(+), 6 deletions(-) diff --git a/src/ui/components/DocUsage/styles.css.ts b/src/ui/components/DocUsage/styles.css.ts index 22234359..ee4cd7c9 100644 --- a/src/ui/components/DocUsage/styles.css.ts +++ b/src/ui/components/DocUsage/styles.css.ts @@ -51,6 +51,7 @@ export const optionSelect = style({ '@media': { '(prefers-color-scheme: dark)': { borderColor: '#2c1622', + color: 'white', }, }, }) diff --git a/src/ui/components/Entities/styles.css.ts b/src/ui/components/Entities/styles.css.ts index 64189770..bcdc41d0 100644 --- a/src/ui/components/Entities/styles.css.ts +++ b/src/ui/components/Entities/styles.css.ts @@ -16,6 +16,7 @@ export const miltiEntity = style({ '@media': { '(prefers-color-scheme: dark)': { borderColor: '#2c1622', + background: '#12000a', }, }, }) diff --git a/src/ui/components/Home/styles.css.ts b/src/ui/components/Home/styles.css.ts index e47750e7..a6e4c14b 100644 --- a/src/ui/components/Home/styles.css.ts +++ b/src/ui/components/Home/styles.css.ts @@ -6,7 +6,7 @@ export const action = style({ '@media': { '(prefers-color-scheme: dark)': { - color: '#ff80c0', + color: '#d397b6', }, }, }) @@ -89,7 +89,7 @@ export const link = style({ color: '#e1a8c5', ':hover': { - color: '#ff80c0', + color: '#d397b6', }, }, }, diff --git a/src/ui/components/Item/styles.css.ts b/src/ui/components/Item/styles.css.ts index 1fffc354..5e7f4581 100644 --- a/src/ui/components/Item/styles.css.ts +++ b/src/ui/components/Item/styles.css.ts @@ -41,10 +41,10 @@ export const active = style({ '@media': { '(prefers-color-scheme: dark)': { - backgroundColor: '#2c0016', + backgroundColor: '#35021b', ':hover': { - backgroundColor: '#2c0016', + backgroundColor: '#35021b', }, }, }, diff --git a/src/ui/components/ModalPortal/styles.css.ts b/src/ui/components/ModalPortal/styles.css.ts index e105e441..4602e7fe 100644 --- a/src/ui/components/ModalPortal/styles.css.ts +++ b/src/ui/components/ModalPortal/styles.css.ts @@ -35,6 +35,14 @@ export const windowBase = style({ width: '100%', margin: '0 auto', overflow: 'hidden', + + '@media': { + '(prefers-color-scheme: dark)': { + border: '1px solid #2c1622', + color: 'white', + background: '#1a030f', + }, + }, }) export const window = styleVariants({ diff --git a/src/ui/components/RichText/styles.css.ts b/src/ui/components/RichText/styles.css.ts index 92a330cc..2952d1ac 100644 --- a/src/ui/components/RichText/styles.css.ts +++ b/src/ui/components/RichText/styles.css.ts @@ -10,7 +10,7 @@ globalStyle(`${content} a`, { '@media': { '(prefers-color-scheme: dark)': { - color: '#ff80c0', + color: '#d397b6', }, }, }) @@ -206,8 +206,16 @@ globalStyle(`${content} ul:last-child`, { globalStyle(`${content} blockquote`, { marginBottom: '10px', borderLeft: '3px solid #b9a2b2', - background: '#faf6f0', + background: '#35001d', padding: '0.5rem 1rem', + + '@media': { + '(prefers-color-scheme: dark)': { + background: '#12000a', + border: '1px solid #2c1622', + borderLeftWidth: '3px', + }, + }, }) globalStyle(`${content} mark`, { diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts b/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts index 02f3dd80..1833fe19 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts +++ b/src/ui/screens/Docs/Doc/TypeDoc/Types/styles.css.ts @@ -13,6 +13,14 @@ export const title = style({ fontSize: '1rem', fontWeight: 600, color: '#7b6d77', + + '@media': { + '(prefers-color-scheme: dark)': { + background: '#280215', + borderColor: '#2c1622', + color: '#cbc0c7', + }, + }, }) export const titleIcon = style({ @@ -21,6 +29,12 @@ export const titleIcon = style({ position: 'relative', top: '2px', marginRight: '.25rem', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#c99952', + }, + }, }) export const titleParent = style({ @@ -43,6 +57,12 @@ export const nav = style({ display: 'grid', gridTemplateRows: 'auto 1fr', overflow: 'hidden', + + '@media': { + '(prefers-color-scheme: dark)': { + borderColor: '#2c1622', + }, + }, }) export const list = style({ @@ -83,6 +103,7 @@ export const header = style({ '@media': { '(prefers-color-scheme: dark)': { borderColor: '#2c1622', + color: '#fff6fc', }, }, }) @@ -109,6 +130,14 @@ export const badge = styleVariants({ color: '#146066', borderColor: '#5ae6f1', backgroundColor: '#d5fcff', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#00b3b3', + borderColor: '#4d6a6a', + backgroundColor: '#0f1a1a', + }, + }, }, ], @@ -118,6 +147,14 @@ export const badge = styleVariants({ color: '#004813', borderColor: '#9dbfa6', backgroundColor: '#e2f7e8', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#00b300', + borderColor: '#4d6a4d', + backgroundColor: '#0f1a0f', + }, + }, }, ], @@ -127,6 +164,14 @@ export const badge = styleVariants({ color: '#786c07', borderColor: '#ddd491', backgroundColor: '#fffad7', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#b3a900', + borderColor: '#4d4d33', + backgroundColor: '#1a1a00', + }, + }, }, ], }) From 2d5146a469003eba8a5770c2d29d4049261e8c7b Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Mon, 10 Jul 2023 12:51:52 +0800 Subject: [PATCH 33/36] FP submodule section & dark theme --- package.json | 2 +- .../components/HighlightQuery/styles.css.ts | 1 + .../Docs/Doc/TypeDoc/Function/FP/index.tsx | 52 +++++++++++++++++++ .../Doc/TypeDoc/Function/FP/styles.css.ts | 25 +++++++++ .../Docs/Doc/TypeDoc/Function/index.tsx | 9 ++++ .../screens/Docs/NavBar/SubmoduleSelector.tsx | 5 ++ src/utils/docs/index.ts | 12 +++++ yarn.lock | 8 +-- 8 files changed, 109 insertions(+), 5 deletions(-) create mode 100644 src/ui/screens/Docs/Doc/TypeDoc/Function/FP/index.tsx create mode 100644 src/ui/screens/Docs/Doc/TypeDoc/Function/FP/styles.css.ts diff --git a/package.json b/package.json index e0252c15..d47f21cb 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "start": "env NODE_ENV=development ts-node -r tsconfig-paths/register devServer.ts" }, "dependencies": { - "@date-fns/docs": "0.24.0", + "@date-fns/docs": "^0.25.0", "@sentry/browser": "^5.30.0", "@sentry/tracing": "^5.30.0", "@switcher/preact": "2.3.0", diff --git a/src/ui/components/HighlightQuery/styles.css.ts b/src/ui/components/HighlightQuery/styles.css.ts index aac21fb8..18a03ad9 100644 --- a/src/ui/components/HighlightQuery/styles.css.ts +++ b/src/ui/components/HighlightQuery/styles.css.ts @@ -2,4 +2,5 @@ import { style } from '@vanilla-extract/css' export const highlight = style({ backgroundColor: '#fffe25', + color: 'black', }) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/FP/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/FP/index.tsx new file mode 100644 index 00000000..614480d7 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/FP/index.tsx @@ -0,0 +1,52 @@ +import { Fragment, FunctionComponent, h } from 'preact' +import { RouterLink } from '~/ui/router' +import { docLink } from '~/ui/router/docLink' +import { parseMajorVersion } from '~/utils/docs' +import * as styles from './styles.css' + +interface Props { + name: string + pure: boolean | undefined + selectedVersion: string + hasOptions: boolean +} + +export const FP: FunctionComponent = ({ + name, + pure, + selectedVersion, + hasOptions, +}) => { + const version = selectedVersion && parseMajorVersion(selectedVersion) + if (!version || version < 3) return null + + return pure ? ( +
      + 🦄 The function is also available in the FP submodule as{' '} + {name} + {hasOptions && ( + + {' '} + and {name}WithOptions + + )} + .{' '} + + Read more about it in the FP guide + + . +
      + ) : ( +
      + ⚠️ Please note that this function is not present in the FP submodule as it + uses Date.now() internally hence impure and can't be safely + curried. +
      + ) +} diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/FP/styles.css.ts b/src/ui/screens/Docs/Doc/TypeDoc/Function/FP/styles.css.ts new file mode 100644 index 00000000..da5153a5 --- /dev/null +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/FP/styles.css.ts @@ -0,0 +1,25 @@ +import { globalStyle, style } from '@vanilla-extract/css' + +export const fpNote = style({ + marginTop: '0.75rem', + fontSize: '14px', + color: '#7c6973', + + '@media': { + '(prefers-color-scheme: dark)': { + color: '#9b838f', + }, + }, +}) + +globalStyle(`${fpNote} code`, { + border: '1px solid #5844521a', + background: '#fffefd', + + '@media': { + '(prefers-color-scheme: dark)': { + borderColor: '#2c1622', + background: '#12000a', + }, + }, +}) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx index b367e3fc..87263ef8 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx @@ -17,6 +17,7 @@ import { InlineTypeContext } from '~/ui/contexts/InlineTypeContext' import { extractCodeFromTagString, findSource, + fnHasOptions, generateUsage, pageTypeHash, pageTypeId, @@ -24,6 +25,7 @@ import { ParentTypesMap, } from '~/utils/docs' import { Signatures } from './Signatures' +import { FP } from './FP' interface TypeDocFunctionProps { page: DateFnsDocs.TypeDocPage @@ -61,6 +63,13 @@ export const TypeDocFunction: FunctionComponent = ({ + + {signatures && } {examples && } diff --git a/src/ui/screens/Docs/NavBar/SubmoduleSelector.tsx b/src/ui/screens/Docs/NavBar/SubmoduleSelector.tsx index 913620ba..e317aede 100644 --- a/src/ui/screens/Docs/NavBar/SubmoduleSelector.tsx +++ b/src/ui/screens/Docs/NavBar/SubmoduleSelector.tsx @@ -4,6 +4,7 @@ import { docLink } from '~/ui/router/docLink' import { useContext } from 'preact/hooks' import { RouterContext } from '~/ui/router' import * as styles from './styles.css' +import { parseMajorVersion } from '~/utils/docs' const SUBMODULE_LABELS: Record = { default: 'Default', @@ -31,6 +32,10 @@ export const SubmoduleSelector: FunctionComponent = ({ return null } + // For v3 don't show submodule selector and render FP section instead + const version = parseMajorVersion(selectedVersion) + if (version >= 3) return null + return (
      ) : (
      diff --git a/src/utils/docs/index.ts b/src/utils/docs/index.ts index 37adf34f..23bf93de 100644 --- a/src/utils/docs/index.ts +++ b/src/utils/docs/index.ts @@ -188,3 +188,8 @@ export function fnHasOptions(fn: DeclarationReflection | undefined) { sig.parameters?.find((param) => param.name === 'options') ) } + +export let debugTypeDoc = false +try { + debugTypeDoc = localStorage.getItem('debug') === 'true' +} catch (_) {} From b5d6232f48acdca81b86f90e0714c3839327409f Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Mon, 21 Aug 2023 16:29:08 +0800 Subject: [PATCH 35/36] Defaults, exclude external types --- src/ui/components/IdHighlight/index.tsx | 1 + src/ui/components/TypeDocInterface/index.tsx | 12 ++++++++++++ src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx | 3 ++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/ui/components/IdHighlight/index.tsx b/src/ui/components/IdHighlight/index.tsx index 9b622cc5..2033fd60 100644 --- a/src/ui/components/IdHighlight/index.tsx +++ b/src/ui/components/IdHighlight/index.tsx @@ -29,6 +29,7 @@ export const IdHightlight: FunctionComponent = ({ const span = spanRef.current + // TODO: Use scrollIntoViewIfNeeded(span, { behavior: 'smooth' }) with marginTop for page type !isInViewport(span) && span.scrollIntoView({ behavior: 'smooth' }) const cbOut = () => { diff --git a/src/ui/components/TypeDocInterface/index.tsx b/src/ui/components/TypeDocInterface/index.tsx index d1332223..67719c82 100644 --- a/src/ui/components/TypeDocInterface/index.tsx +++ b/src/ui/components/TypeDocInterface/index.tsx @@ -32,6 +32,7 @@ export function TypeDocInterface< | TypeParameterReflection >({ list }: TypeDocInterfaceProps) { const inline = useContext(InlineTypeContext) + const hasDefault = list.some((item) => 'default' in item && item.default) return ( @@ -39,6 +40,7 @@ export function TypeDocInterface< + {hasDefault && } @@ -67,6 +69,16 @@ export function TypeDocInterface< )} + {hasDefault && ( + + )} +
      Name TypeDefaultDescription
      + {'default' in item && item.default && ( + + + + )} + {item.comment?.summary && ( diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx index 671e806b..62488236 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx @@ -262,7 +262,6 @@ function extractTypes( dec.children?.forEach((child) => { switch (child.kindString) { // Ignore these types and their children - case 'Module': case 'Function': return @@ -277,6 +276,8 @@ function extractTypes( // Add these types, but not process their children case 'Interface': case 'Type alias': + // Ignore external, i.e. Record + if (child.flags.isExternal) return types.push(child) return From 093cf15637966e1ab7b343880f565f08022fbe8d Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Wed, 15 Nov 2023 13:16:22 +0800 Subject: [PATCH 36/36] Add types summary --- .../screens/Docs/Doc/TypeDoc/Types/index.tsx | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx b/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx index 62488236..4167900b 100644 --- a/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx +++ b/src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx @@ -1,5 +1,6 @@ import { findDescription, + findFnSummary, findSummary, joinCommentParts, traverseType, @@ -8,6 +9,7 @@ import { h } from 'preact' import { useMemo } from 'preact/hooks' import type { DeclarationReflection, SignatureReflection } from 'typedoc' import { Code } from '~/ui/components/Code' +import { Debug } from '~/ui/components/Debug' import { DocUsage } from '~/ui/components/DocUsage' import { Item } from '~/ui/components/Item' import { Markdown } from '~/ui/components/Markdown' @@ -21,20 +23,19 @@ import { SourceLink } from '~/ui/components/SourceLink' import { TypeDocInterface } from '~/ui/components/TypeDocInterface' import { TypeDocType } from '~/ui/components/TypeDocType' import { InlineTypeContext } from '~/ui/contexts/InlineTypeContext' -import { useQuery } from '~/ui/hooks/useQuery' import { useActiveItem } from '~/ui/hooks/useActiveItem' +import { useQuery } from '~/ui/hooks/useQuery' import { + ParentTypesMap, findSource, generateTypeUsage, inlineTypeHash, inlineTypeId, inlineTypeIdHighlightMatch, - ParentTypesMap, typeHash, typeId as typeIdStr, } from '~/utils/docs' import * as styles from './styles.css' -import { Debug } from '~/ui/components/Debug' export interface TypesModalProps { parent: string @@ -69,7 +70,7 @@ export const useTypesModal = createModal( const navItems: TypeItem[] = useMemo( () => types.map((t) => { - const summary = findSummary(t) + const summary = getSummary(t) const description = findDescription(t) return { type: t, summary, description } }) || [], @@ -91,6 +92,8 @@ export const useTypesModal = createModal( const { activeRef } = useActiveItem() + const summary = useMemo(() => type && getSummary(type), [type]) + return ( ( - {type.comment?.summary && ( + {summary && (
      - +
      )} @@ -368,3 +369,9 @@ function buildParentTypesMap( return map } + +function getSummary(refl: DeclarationReflection) { + return refl.comment?.summary + ? joinCommentParts(refl.comment?.summary) + : refl.type?.type === 'reflection' && findFnSummary(refl.type.declaration) +}