From dbf373597b74620c8b24a18a889dc5bb7e792401 Mon Sep 17 00:00:00 2001 From: Alex Freska Date: Wed, 6 Sep 2023 13:51:00 -0400 Subject: [PATCH] feat: add tos and privacy, refactor markdown support --- .changeset/nervous-dancers-remain.md | 5 + .changeset/wild-pans-watch.md | 5 + apps/website/components/Layout/Footer.tsx | 14 +- apps/website/config/mdx.tsx | 44 +- apps/website/config/routes.ts | 3 + apps/website/content/prs.ts | 7 +- apps/website/lib/notion.ts | 80 +++- apps/website/pages/grants/index.tsx | 68 ++- apps/website/pages/markdown/index.tsx | 67 +++ apps/website/pages/privacy-policy/index.tsx | 67 +++ apps/website/pages/terms-of-service/index.tsx | 6 +- libs/design-system/src/core/List.tsx | 90 ++-- libs/design-system/src/core/Text.tsx | 7 +- package-lock.json | 437 ++++++++++++++++++ package.json | 1 + 15 files changed, 790 insertions(+), 111 deletions(-) create mode 100644 .changeset/nervous-dancers-remain.md create mode 100644 .changeset/wild-pans-watch.md create mode 100644 apps/website/pages/markdown/index.tsx create mode 100644 apps/website/pages/privacy-policy/index.tsx diff --git a/.changeset/nervous-dancers-remain.md b/.changeset/nervous-dancers-remain.md new file mode 100644 index 000000000..53a91290c --- /dev/null +++ b/.changeset/nervous-dancers-remain.md @@ -0,0 +1,5 @@ +--- +'website': minor +--- + +Content now renders as GitHub flavored markdown and supports nesting and tables. diff --git a/.changeset/wild-pans-watch.md b/.changeset/wild-pans-watch.md new file mode 100644 index 000000000..9066b1de8 --- /dev/null +++ b/.changeset/wild-pans-watch.md @@ -0,0 +1,5 @@ +--- +'website': minor +--- + +ToS and Privacy Policy are now linked in the website footer. diff --git a/apps/website/components/Layout/Footer.tsx b/apps/website/components/Layout/Footer.tsx index fda809965..d33ee1139 100644 --- a/apps/website/components/Layout/Footer.tsx +++ b/apps/website/components/Layout/Footer.tsx @@ -36,7 +36,7 @@ export function Footer() {
- {/* Terms of Service - */} - {/* + + Privacy Policy - */} +
diff --git a/apps/website/config/mdx.tsx b/apps/website/config/mdx.tsx index 2b8185b1c..88f6c6c8f 100644 --- a/apps/website/config/mdx.tsx +++ b/apps/website/config/mdx.tsx @@ -1,12 +1,16 @@ import { + Checkbox, Code, Li, Link, Ol, + panelStyles, Paragraph, SectionHeading, + Text, Ul, } from '@siafoundation/design-system' +import { cx } from 'class-variance-authority' // Components used in mardown rendering export const components = { @@ -16,17 +20,17 @@ export const components = { ), h2: ({ children }) => ( - + {children} ), h3: ({ children }) => ( - + {children} ), p: ({ children }) => ( - + {children} ), @@ -34,5 +38,37 @@ export const components = { code: (props) => , ol: Ol, ul: Ul, - li: Li, + li: (props) =>
  • , + table: ({ children }) => ( + + {children} +
    + ), + thead: ({ children }) => {children}, + tr: ({ children }) => ( + + {children} + + ), + th: ({ children }) => ( + + {children} + + ), + tbody: ({ children }) => {children}, + td: ({ children }) => ( + + {children} + + ), + input: (props) => { + if (props.type === 'checkbox') { + return ( +
    + +
    + ) + } + return + }, } diff --git a/apps/website/config/routes.ts b/apps/website/config/routes.ts index daac04291..79489d88e 100644 --- a/apps/website/config/routes.ts +++ b/apps/website/config/routes.ts @@ -72,6 +72,9 @@ export const routes = { terms: { index: '/terms-of-service', }, + privacy: { + index: '/privacy-policy', + }, letter: { index: '/letter', }, diff --git a/apps/website/content/prs.ts b/apps/website/content/prs.ts index b0bc1491e..45b82e1c4 100644 --- a/apps/website/content/prs.ts +++ b/apps/website/content/prs.ts @@ -3,6 +3,7 @@ import { MDXRemoteSerializeResult } from 'next-mdx-remote' import { serialize } from 'next-mdx-remote/serialize' import { getCacheValue } from '../lib/cache' import { getMinutesInSeconds } from '../lib/time' +import remarkGfm from 'remark-gfm' const maxAge = getMinutesInSeconds(5) @@ -16,7 +17,11 @@ export async function getPrs() { let source: MDXRemoteSerializeResult = null try { // as md, dont need the mdx components and allows style tags, vs - source = await serialize(pr.body, { mdxOptions: { format: 'md' } }) + source = await serialize(pr.body, { + mdxOptions: { + remarkPlugins: [remarkGfm], + }, + }) } catch (e) { console.log(e) } diff --git a/apps/website/lib/notion.ts b/apps/website/lib/notion.ts index bfed869c3..4f8747fce 100644 --- a/apps/website/lib/notion.ts +++ b/apps/website/lib/notion.ts @@ -1,15 +1,25 @@ import { isFullBlock, isFullPage } from '@notionhq/client' +import { TableBlockObjectResponse } from '@notionhq/client/build/src/api-endpoints' import { Notion } from '@siafoundation/data-sources' import matter from 'gray-matter' import { serialize } from 'next-mdx-remote/serialize' +import remarkGfm from 'remark-gfm' export async function getNotionPage(pageId: string) { const p = await Notion.pages.retrieve({ page_id: pageId }) + const title = isFullPage(p) + ? (p.properties.title['title'][0].plain_text as string) + : null const date = isFullPage(p) ? p.last_edited_time : null const markdown = await notionToMarkdown(pageId) - const source = await serialize(matter(markdown).content) + const source = await serialize(matter(markdown).content, { + mdxOptions: { + remarkPlugins: [remarkGfm], + }, + }) return { + title, date, source, } @@ -36,8 +46,7 @@ function richTextToMarkdown(richText) { .join('') } -// Function to convert Notion blocks to markdown -async function notionToMarkdown(pageId) { +async function notionToMarkdown(pageId, indent = '') { const response = await Notion.blocks.children.list({ block_id: pageId, page_size: 50, @@ -48,33 +57,84 @@ async function notionToMarkdown(pageId) { if (!isFullBlock(block)) { continue } + + if (block.has_children) { + const childMarkdown = await notionToMarkdown(block.id, indent + ' ') + markdown += childMarkdown + } + switch (block.type) { case 'paragraph': - markdown += richTextToMarkdown(block.paragraph.rich_text) + '\n\n' + markdown += + indent + richTextToMarkdown(block.paragraph.rich_text) + '\n\n' break case 'heading_1': markdown += - '# ' + richTextToMarkdown(block.heading_1.rich_text) + '\n\n' + indent + '# ' + richTextToMarkdown(block.heading_1.rich_text) + '\n\n' break case 'heading_2': markdown += - '## ' + richTextToMarkdown(block.heading_2.rich_text) + '\n\n' + indent + + '## ' + + richTextToMarkdown(block.heading_2.rich_text) + + '\n\n' break case 'heading_3': markdown += - '### ' + richTextToMarkdown(block.heading_3.rich_text) + '\n\n' + indent + + '### ' + + richTextToMarkdown(block.heading_3.rich_text) + + '\n\n' break case 'bulleted_list_item': markdown += - '* ' + richTextToMarkdown(block.bulleted_list_item.rich_text) + '\n' + indent + + '* ' + + richTextToMarkdown(block.bulleted_list_item.rich_text) + + '\n' break case 'numbered_list_item': markdown += - '1. ' + richTextToMarkdown(block.numbered_list_item.rich_text) + '\n' + indent + + '1. ' + + richTextToMarkdown(block.numbered_list_item.rich_text) + + '\n' + break + case 'table': + markdown = await tableToMarkdown(block, markdown) break - // Additional cases can be added here for other block types... } } return markdown } + +async function tableToMarkdown( + block: TableBlockObjectResponse, + markdown: string +): Promise { + const tableData = await Notion.blocks.children.list({ + block_id: block.id, + page_size: 100, + }) + + const rows = [] + for (const rowBlock of tableData.results) { + const row = [] + // eslint-disable-next-line @typescript-eslint/no-explicit-any + for (const cell of (rowBlock as any).table_row.cells) { + const cellMarkdown = richTextToMarkdown(cell).trim() + row.push(cellMarkdown) + } + rows.push(row) + } + + rows.forEach((row, i) => { + markdown += `| ${row.join(' | ')} |\n` + if (i === 0) { + markdown += `| ${row.map(() => '---').join(' | ')} |\n` + } + }) + markdown += '\n\n' + return markdown +} diff --git a/apps/website/pages/grants/index.tsx b/apps/website/pages/grants/index.tsx index b1885821a..5a846721f 100644 --- a/apps/website/pages/grants/index.tsx +++ b/apps/website/pages/grants/index.tsx @@ -127,24 +127,22 @@ export default function Grants({ title: 'Proposal Requirements', icon: 'ListChecked', children: ( -
      -
    1. +
        +
      1. Name of organization or individual and project name.
      2. -
      3. +
      4. Purpose of the grant: who benefits and how the project will serve the Foundation’s mission of user-owned data.
      5. -
      6. Code contributions must be open source.
      7. -
      8. - Timeline with measurable objectives and goals. -
      9. -
      10. +
      11. Code contributions must be open source.
      12. +
      13. Timeline with measurable objectives and goals.
      14. +
      15. Any potential risks that will affect the outcome of the project.
      16. -
      17. Budget and justification.
      18. -
      19. +
      20. Budget and justification.
      21. +
      22. Reporting requirements: Progress reports to the foundation/committee and to the community.
      23. @@ -155,38 +153,34 @@ export default function Grants({ title: 'Proposal Process', icon: 'MailAll', children: ( -
          -
        1. +
            +
          1. Create a proposal with the above requirements in mind.
          2. -
          3. +
          4. Submit your proposal at{' '} {webLinks.forumGrants} .
          5. -
          6. +
          7. Open discussion will ensue in the comment section from the community.
          8. -
          9. -
          10. - New proposals, to accept, reject, or request more - info. -
          11. -
          12. Existing grants, to assess their progress.
          13. -
          14. - Newly completed grants, to review their outcomes. -
          15. -
          - } - > +
        2. The Grant Committee convenes every two weeks to review the following: +
            +
          1. + New proposals, to accept, reject, or request more + info. +
          2. +
          3. Existing grants, to assess their progress.
          4. +
          5. + Newly completed grants, to review their outcomes. +
          6. +
        ), @@ -202,8 +196,8 @@ export default function Grants({ following factors while utilizing a scoring matrix to ensure a thorough vetting process. -
          -
        1. +
            +
          1. In line with Foundation’s mission: {' '} @@ -212,25 +206,25 @@ export default function Grants({ consistent with The Sia Foundation’s mission of user-owned data?
          2. -
          3. +
          4. Community Impact: Will the project provide a meaningful volume of services and/or people served in the decentralized cloud storage community (in particular the Sia community)?
          5. -
          6. +
          7. Goals, Objectives & Outcome: {' '} Are there clear goals and objectives written? Are measurable outcomes evident?
          8. -
          9. +
          10. Deliverable: How well does the individual/organization demonstrate the ability to deliver and measure proposed outcomes?
          11. -
          12. +
          13. Risks and Technical Feasibility: {' '} @@ -238,7 +232,7 @@ export default function Grants({ be thoughtful if the risk is high enough to impact the outcome of the project.
          14. -
          15. +
          16. Budget Justification: How well does the applicant justify the budget?
          17. @@ -250,7 +244,7 @@ export default function Grants({ title: 'Grant Committee', icon: 'EventsAlt', children: ( -
              +
                {grantCommittee.map(({ name }) => (
              1. {name}
              2. ))} diff --git a/apps/website/pages/markdown/index.tsx b/apps/website/pages/markdown/index.tsx new file mode 100644 index 000000000..c6c82fa96 --- /dev/null +++ b/apps/website/pages/markdown/index.tsx @@ -0,0 +1,67 @@ +import { SiteHeading, Text } from '@siafoundation/design-system' +import { Layout } from '../../components/Layout' +import { routes } from '../../config/routes' +import { getStats } from '../../content/stats' +import { AsyncReturnType } from '../../lib/types' +import { getMinutesInSeconds } from '../../lib/time' +import { SectionSolid } from '../../components/SectionSolid' +import { format } from 'date-fns' +import { MDXRemote } from 'next-mdx-remote' +import { components } from '../../config/mdx' +import { backgrounds, previews } from '../../content/assets' +import { SectionTransparent } from '../../components/SectionTransparent' +import { getNotionPage } from '../../lib/notion' + +type Props = AsyncReturnType['props'] + +const description = '' + +export default function Markdown({ title, date, source }: Props) { + return ( + + + + } + backgroundImage={backgrounds.nateBridge} + previewImage={previews.nateBridge} + > + + + {`Document version date: ${format(new Date(date), 'PP')}`} + + + ) +} + +const databaseId = '922ab5c84ab24f569dfbc8f8393ec654' + +export async function getStaticProps() { + const stats = await getStats() + + const { title, date, source } = await getNotionPage(databaseId) + + return { + props: { + title, + date, + source, + fallback: { + '/api/stats': stats, + }, + }, + revalidate: getMinutesInSeconds(5), + } +} diff --git a/apps/website/pages/privacy-policy/index.tsx b/apps/website/pages/privacy-policy/index.tsx new file mode 100644 index 000000000..f63b5caba --- /dev/null +++ b/apps/website/pages/privacy-policy/index.tsx @@ -0,0 +1,67 @@ +import { SiteHeading, Text } from '@siafoundation/design-system' +import { Layout } from '../../components/Layout' +import { routes } from '../../config/routes' +import { getStats } from '../../content/stats' +import { AsyncReturnType } from '../../lib/types' +import { getMinutesInSeconds } from '../../lib/time' +import { SectionSolid } from '../../components/SectionSolid' +import { format } from 'date-fns' +import { MDXRemote } from 'next-mdx-remote' +import { components } from '../../config/mdx' +import { backgrounds, previews } from '../../content/assets' +import { SectionTransparent } from '../../components/SectionTransparent' +import { getNotionPage } from '../../lib/notion' + +type Props = AsyncReturnType['props'] + +const description = '' + +export default function PrivacyPolicy({ title, date, source }: Props) { + return ( + + + + } + backgroundImage={backgrounds.nateBridge} + previewImage={previews.nateBridge} + > + + + {`Document version date: ${format(new Date(date), 'PP')}`} + + + ) +} + +const databaseId = 'fad41ea72c9a41eb85564bbfa1c34c70' + +export async function getStaticProps() { + const stats = await getStats() + + const { title, date, source } = await getNotionPage(databaseId) + + return { + props: { + title, + date, + source, + fallback: { + '/api/stats': stats, + }, + }, + revalidate: getMinutesInSeconds(5), + } +} diff --git a/apps/website/pages/terms-of-service/index.tsx b/apps/website/pages/terms-of-service/index.tsx index 1da6546ce..e300827b7 100644 --- a/apps/website/pages/terms-of-service/index.tsx +++ b/apps/website/pages/terms-of-service/index.tsx @@ -14,10 +14,9 @@ import { getNotionPage } from '../../lib/notion' type Props = AsyncReturnType['props'] -const title = 'Terms of Service' const description = '' -export default function TermsOfService({ date, source }: Props) { +export default function TermsOfService({ title, date, source }: Props) { return ( {children}
              + return ( +
                + {children} +
              + ) } export function Ul({ children, className }: Props) { - return
                {children}
              -} - -const numMap: Record = { - 1: , - 2: , - 3: , - 4: , - 5: , - 6: , - 7: , + return ( +
                + {children} +
              + ) } -type LiProps = { - children: React.ReactNode - subList?: React.ReactNode - className?: string - index?: number - size?: React.ComponentProps['size'] - color?: React.ComponentProps['color'] -} +type LiProps = React.ComponentProps export function Li({ children, - index = 0, size = '16', - subList, className, - color = 'contrast', + color = 'subtle', + scaleSize, + font, + weight, + noWrap, + ellipsis, + underline, }: LiProps) { - const numEl = numMap[index] - return ( -
            1. -
              -
              - - {numEl || } - -
              -
              -
              - - {children} - - {subList} -
              +
            2. p]:!py-0', + className + )} + > + {children}
            3. ) } diff --git a/libs/design-system/src/core/Text.tsx b/libs/design-system/src/core/Text.tsx index 1d15245df..a889c1df8 100644 --- a/libs/design-system/src/core/Text.tsx +++ b/libs/design-system/src/core/Text.tsx @@ -4,8 +4,12 @@ import { VariantProps } from '../types' // // avoid clipping decenders when overflow is hidden // padding: '0.14em 0', -export const textStyles = cva(['inline-block'], { +export const textStyles = cva([], { variants: { + display: { + default: 'inline-block', + none: '', + }, font: { mono: 'font-mono', sans: 'font-sans', @@ -79,6 +83,7 @@ export const textStyles = cva(['inline-block'], { }, }, defaultVariants: { + display: 'default', weight: 'regular', font: 'sans', color: 'contrast', diff --git a/package-lock.json b/package-lock.json index 4711232d6..a6f37ec90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -95,6 +95,7 @@ "react-router-dom": "6.4.3", "react-select": "^5.3.2", "regenerator-runtime": "0.13.7", + "remark-gfm": "^3.0.1", "request": "^2.88.2", "request-promise-native": "^1.0.9", "rss-parser": "^3.13.0", @@ -18288,6 +18289,15 @@ "node": ">=0.10.0" } }, + "node_modules/markdown-table": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.3.tgz", + "integrity": "sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/math-expression-evaluator": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.4.0.tgz", @@ -18334,6 +18344,32 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdast-util-find-and-replace": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.2.2.tgz", + "integrity": "sha512-MTtdFRz/eMDHXzeK6W3dO7mXUlF82Gom4y0oOgvHhh/HXZAGvIQDUvQ0SuUx+j2tv44b8xTHOm8K/9OoRFnXKw==", + "dependencies": { + "@types/mdast": "^3.0.0", + "escape-string-regexp": "^5.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/mdast-util-from-markdown": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.2.0.tgz", @@ -18357,6 +18393,94 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdast-util-gfm": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-2.0.2.tgz", + "integrity": "sha512-qvZ608nBppZ4icQlhQQIAdc6S3Ffj9RGmzwUKUWuEICFnd1LVkN3EktF7ZHAgfcEdvZB5owU9tQgt99e2TlLjg==", + "dependencies": { + "mdast-util-from-markdown": "^1.0.0", + "mdast-util-gfm-autolink-literal": "^1.0.0", + "mdast-util-gfm-footnote": "^1.0.0", + "mdast-util-gfm-strikethrough": "^1.0.0", + "mdast-util-gfm-table": "^1.0.0", + "mdast-util-gfm-task-list-item": "^1.0.0", + "mdast-util-to-markdown": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-autolink-literal": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-1.0.3.tgz", + "integrity": "sha512-My8KJ57FYEy2W2LyNom4n3E7hKTuQk/0SES0u16tjA9Z3oFkF4RrC/hPAPgjlSpezsOvI8ObcXcElo92wn5IGA==", + "dependencies": { + "@types/mdast": "^3.0.0", + "ccount": "^2.0.0", + "mdast-util-find-and-replace": "^2.0.0", + "micromark-util-character": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-footnote": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-1.0.2.tgz", + "integrity": "sha512-56D19KOGbE00uKVj3sgIykpwKL179QsVFwx/DCW0u/0+URsryacI4MAdNJl0dh+u2PSsD9FtxPFbHCzJ78qJFQ==", + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-to-markdown": "^1.3.0", + "micromark-util-normalize-identifier": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-strikethrough": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-1.0.3.tgz", + "integrity": "sha512-DAPhYzTYrRcXdMjUtUjKvW9z/FNAMTdU0ORyMcbmkwYNbKocDpdk+PX1L1dQgOID/+vVs1uBQ7ElrBQfZ0cuiQ==", + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-to-markdown": "^1.3.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-table": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-1.0.7.tgz", + "integrity": "sha512-jjcpmNnQvrmN5Vx7y7lEc2iIOEytYv7rTvu+MeyAsSHTASGCCRA79Igg2uKssgOs1i1po8s3plW0sTu1wkkLGg==", + "dependencies": { + "@types/mdast": "^3.0.0", + "markdown-table": "^3.0.0", + "mdast-util-from-markdown": "^1.0.0", + "mdast-util-to-markdown": "^1.3.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-task-list-item": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-1.0.2.tgz", + "integrity": "sha512-PFTA1gzfp1B1UaiJVyhJZA1rm0+Tzn690frc/L8vNX1Jop4STZgOE6bxUhnzdVSB+vm2GU1tIsuQcA9bxTQpMQ==", + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-to-markdown": "^1.3.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-mdx": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-2.0.0.tgz", @@ -18636,6 +18760,120 @@ "uvu": "^0.5.0" } }, + "node_modules/micromark-extension-gfm": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-2.0.3.tgz", + "integrity": "sha512-vb9OoHqrhCmbRidQv/2+Bc6pkP0FrtlhurxZofvOEy5o8RtuuvTq+RQ1Vw5ZDNrVraQZu3HixESqbG+0iKk/MQ==", + "dependencies": { + "micromark-extension-gfm-autolink-literal": "^1.0.0", + "micromark-extension-gfm-footnote": "^1.0.0", + "micromark-extension-gfm-strikethrough": "^1.0.0", + "micromark-extension-gfm-table": "^1.0.0", + "micromark-extension-gfm-tagfilter": "^1.0.0", + "micromark-extension-gfm-task-list-item": "^1.0.0", + "micromark-util-combine-extensions": "^1.0.0", + "micromark-util-types": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-autolink-literal": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-1.0.5.tgz", + "integrity": "sha512-z3wJSLrDf8kRDOh2qBtoTRD53vJ+CWIyo7uyZuxf/JAbNJjiHsOpG1y5wxk8drtv3ETAHutCu6N3thkOOgueWg==", + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-sanitize-uri": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-footnote": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-1.1.2.tgz", + "integrity": "sha512-Yxn7z7SxgyGWRNa4wzf8AhYYWNrwl5q1Z8ii+CSTTIqVkmGZF1CElX2JI8g5yGoM3GAman9/PVCUFUSJ0kB/8Q==", + "dependencies": { + "micromark-core-commonmark": "^1.0.0", + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-normalize-identifier": "^1.0.0", + "micromark-util-sanitize-uri": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-strikethrough": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-1.0.7.tgz", + "integrity": "sha512-sX0FawVE1o3abGk3vRjOH50L5TTLr3b5XMqnP9YDRb34M0v5OoZhG+OHFz1OffZ9dlwgpTBKaT4XW/AsUVnSDw==", + "dependencies": { + "micromark-util-chunked": "^1.0.0", + "micromark-util-classify-character": "^1.0.0", + "micromark-util-resolve-all": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-table": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-1.0.7.tgz", + "integrity": "sha512-3ZORTHtcSnMQEKtAOsBQ9/oHp9096pI/UvdPtN7ehKvrmZZ2+bbWhi0ln+I9drmwXMt5boocn6OlwQzNXeVeqw==", + "dependencies": { + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-tagfilter": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-1.0.2.tgz", + "integrity": "sha512-5XWB9GbAUSHTn8VPU8/1DBXMuKYT5uOgEjJb8gN3mW0PNW5OPHpSdojoqf+iq1xo7vWzw/P8bAHY0n6ijpXF7g==", + "dependencies": { + "micromark-util-types": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-task-list-item": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-1.0.5.tgz", + "integrity": "sha512-RMFXl2uQ0pNQy6Lun2YBYT9g9INXtWJULgbt01D/x8/6yJ2qpKyzdZD3pi6UIkzF++Da49xAelVKUeUMqd5eIQ==", + "dependencies": { + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/micromark-extension-mdx-expression": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-1.0.3.tgz", @@ -22244,6 +22482,21 @@ "jsesc": "bin/jsesc" } }, + "node_modules/remark-gfm": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-3.0.1.tgz", + "integrity": "sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig==", + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-gfm": "^2.0.0", + "micromark-extension-gfm": "^2.0.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-mdx": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-2.1.1.tgz", @@ -39908,6 +40161,11 @@ "resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-1.1.1.tgz", "integrity": "sha512-WWC0ZuMzCyDHYCasEGs4IPvLyTGftYwh6wIEOULOF0HXcqZlhwRzrK0w2VUlxWA98xnvb/jszw4ZSkJ6ADpM6Q==" }, + "markdown-table": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.3.tgz", + "integrity": "sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==" + }, "math-expression-evaluator": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.4.0.tgz", @@ -39944,6 +40202,24 @@ } } }, + "mdast-util-find-and-replace": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.2.2.tgz", + "integrity": "sha512-MTtdFRz/eMDHXzeK6W3dO7mXUlF82Gom4y0oOgvHhh/HXZAGvIQDUvQ0SuUx+j2tv44b8xTHOm8K/9OoRFnXKw==", + "requires": { + "@types/mdast": "^3.0.0", + "escape-string-regexp": "^5.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==" + } + } + }, "mdast-util-from-markdown": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.2.0.tgz", @@ -39963,6 +40239,70 @@ "uvu": "^0.5.0" } }, + "mdast-util-gfm": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-2.0.2.tgz", + "integrity": "sha512-qvZ608nBppZ4icQlhQQIAdc6S3Ffj9RGmzwUKUWuEICFnd1LVkN3EktF7ZHAgfcEdvZB5owU9tQgt99e2TlLjg==", + "requires": { + "mdast-util-from-markdown": "^1.0.0", + "mdast-util-gfm-autolink-literal": "^1.0.0", + "mdast-util-gfm-footnote": "^1.0.0", + "mdast-util-gfm-strikethrough": "^1.0.0", + "mdast-util-gfm-table": "^1.0.0", + "mdast-util-gfm-task-list-item": "^1.0.0", + "mdast-util-to-markdown": "^1.0.0" + } + }, + "mdast-util-gfm-autolink-literal": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-1.0.3.tgz", + "integrity": "sha512-My8KJ57FYEy2W2LyNom4n3E7hKTuQk/0SES0u16tjA9Z3oFkF4RrC/hPAPgjlSpezsOvI8ObcXcElo92wn5IGA==", + "requires": { + "@types/mdast": "^3.0.0", + "ccount": "^2.0.0", + "mdast-util-find-and-replace": "^2.0.0", + "micromark-util-character": "^1.0.0" + } + }, + "mdast-util-gfm-footnote": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-1.0.2.tgz", + "integrity": "sha512-56D19KOGbE00uKVj3sgIykpwKL179QsVFwx/DCW0u/0+URsryacI4MAdNJl0dh+u2PSsD9FtxPFbHCzJ78qJFQ==", + "requires": { + "@types/mdast": "^3.0.0", + "mdast-util-to-markdown": "^1.3.0", + "micromark-util-normalize-identifier": "^1.0.0" + } + }, + "mdast-util-gfm-strikethrough": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-1.0.3.tgz", + "integrity": "sha512-DAPhYzTYrRcXdMjUtUjKvW9z/FNAMTdU0ORyMcbmkwYNbKocDpdk+PX1L1dQgOID/+vVs1uBQ7ElrBQfZ0cuiQ==", + "requires": { + "@types/mdast": "^3.0.0", + "mdast-util-to-markdown": "^1.3.0" + } + }, + "mdast-util-gfm-table": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-1.0.7.tgz", + "integrity": "sha512-jjcpmNnQvrmN5Vx7y7lEc2iIOEytYv7rTvu+MeyAsSHTASGCCRA79Igg2uKssgOs1i1po8s3plW0sTu1wkkLGg==", + "requires": { + "@types/mdast": "^3.0.0", + "markdown-table": "^3.0.0", + "mdast-util-from-markdown": "^1.0.0", + "mdast-util-to-markdown": "^1.3.0" + } + }, + "mdast-util-gfm-task-list-item": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-1.0.2.tgz", + "integrity": "sha512-PFTA1gzfp1B1UaiJVyhJZA1rm0+Tzn690frc/L8vNX1Jop4STZgOE6bxUhnzdVSB+vm2GU1tIsuQcA9bxTQpMQ==", + "requires": { + "@types/mdast": "^3.0.0", + "mdast-util-to-markdown": "^1.3.0" + } + }, "mdast-util-mdx": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-2.0.0.tgz", @@ -40172,6 +40512,92 @@ "uvu": "^0.5.0" } }, + "micromark-extension-gfm": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-2.0.3.tgz", + "integrity": "sha512-vb9OoHqrhCmbRidQv/2+Bc6pkP0FrtlhurxZofvOEy5o8RtuuvTq+RQ1Vw5ZDNrVraQZu3HixESqbG+0iKk/MQ==", + "requires": { + "micromark-extension-gfm-autolink-literal": "^1.0.0", + "micromark-extension-gfm-footnote": "^1.0.0", + "micromark-extension-gfm-strikethrough": "^1.0.0", + "micromark-extension-gfm-table": "^1.0.0", + "micromark-extension-gfm-tagfilter": "^1.0.0", + "micromark-extension-gfm-task-list-item": "^1.0.0", + "micromark-util-combine-extensions": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "micromark-extension-gfm-autolink-literal": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-1.0.5.tgz", + "integrity": "sha512-z3wJSLrDf8kRDOh2qBtoTRD53vJ+CWIyo7uyZuxf/JAbNJjiHsOpG1y5wxk8drtv3ETAHutCu6N3thkOOgueWg==", + "requires": { + "micromark-util-character": "^1.0.0", + "micromark-util-sanitize-uri": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "micromark-extension-gfm-footnote": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-1.1.2.tgz", + "integrity": "sha512-Yxn7z7SxgyGWRNa4wzf8AhYYWNrwl5q1Z8ii+CSTTIqVkmGZF1CElX2JI8g5yGoM3GAman9/PVCUFUSJ0kB/8Q==", + "requires": { + "micromark-core-commonmark": "^1.0.0", + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-normalize-identifier": "^1.0.0", + "micromark-util-sanitize-uri": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + } + }, + "micromark-extension-gfm-strikethrough": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-1.0.7.tgz", + "integrity": "sha512-sX0FawVE1o3abGk3vRjOH50L5TTLr3b5XMqnP9YDRb34M0v5OoZhG+OHFz1OffZ9dlwgpTBKaT4XW/AsUVnSDw==", + "requires": { + "micromark-util-chunked": "^1.0.0", + "micromark-util-classify-character": "^1.0.0", + "micromark-util-resolve-all": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + } + }, + "micromark-extension-gfm-table": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-1.0.7.tgz", + "integrity": "sha512-3ZORTHtcSnMQEKtAOsBQ9/oHp9096pI/UvdPtN7ehKvrmZZ2+bbWhi0ln+I9drmwXMt5boocn6OlwQzNXeVeqw==", + "requires": { + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + } + }, + "micromark-extension-gfm-tagfilter": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-1.0.2.tgz", + "integrity": "sha512-5XWB9GbAUSHTn8VPU8/1DBXMuKYT5uOgEjJb8gN3mW0PNW5OPHpSdojoqf+iq1xo7vWzw/P8bAHY0n6ijpXF7g==", + "requires": { + "micromark-util-types": "^1.0.0" + } + }, + "micromark-extension-gfm-task-list-item": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-1.0.5.tgz", + "integrity": "sha512-RMFXl2uQ0pNQy6Lun2YBYT9g9INXtWJULgbt01D/x8/6yJ2qpKyzdZD3pi6UIkzF++Da49xAelVKUeUMqd5eIQ==", + "requires": { + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + } + }, "micromark-extension-mdx-expression": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-1.0.3.tgz", @@ -42599,6 +43025,17 @@ } } }, + "remark-gfm": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-3.0.1.tgz", + "integrity": "sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig==", + "requires": { + "@types/mdast": "^3.0.0", + "mdast-util-gfm": "^2.0.0", + "micromark-extension-gfm": "^2.0.0", + "unified": "^10.0.0" + } + }, "remark-mdx": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-2.1.1.tgz", diff --git a/package.json b/package.json index 9d595bdd0..3ae174a71 100644 --- a/package.json +++ b/package.json @@ -106,6 +106,7 @@ "react-router-dom": "6.4.3", "react-select": "^5.3.2", "regenerator-runtime": "0.13.7", + "remark-gfm": "^3.0.1", "request": "^2.88.2", "request-promise-native": "^1.0.9", "rss-parser": "^3.13.0",