diff --git a/CONTRIBUTING.org b/CONTRIBUTING.org index 6d6448d5..4a1d2e23 100644 --- a/CONTRIBUTING.org +++ b/CONTRIBUTING.org @@ -10,15 +10,22 @@ providing work for review. ** Contributing with Content +In a effort to avoid repeating myself and having to maintain things in multiple +places, the Markdown conventions guidelines will live next to the code. Visit +=/sandbox/markdown= anywhere the Wiki is hosted to access the guidelines. + See [[./CONTRIBUTING_WITH_MARKDOWN.org][CONTRIBUTING_WITH_MARKDOWN]]. ** Contributing with Code -See [[./CONTRIBUTING_WITH_CODE.org][CONTRIBUTING_WITH_CODE]]. +We're all consenting adults, use history as documentation and as long as you +respect the existing conventions and configured linting tools you can't go very +wrong. ** Testing your Changes -This is a Next.js application written with TypeScript. All you have to do in +This is a Next.js application written with TypeScript and I'll assume basic +knowledge for a JavaScript stack is known from the reader. All you have to do in order to run the project locally is to clone the repository and install the JavaScript dependencies. @@ -36,4 +43,4 @@ project locally, Vercel generates and updates URLs for every pull requests on the repository. As a general advice, avoid pushing for every little change you make as build -minutes are limited. +minutes are free but limited. diff --git a/CONTRIBUTING_WITH_CODE.org b/CONTRIBUTING_WITH_CODE.org deleted file mode 100644 index 0f2f9565..00000000 --- a/CONTRIBUTING_WITH_CODE.org +++ /dev/null @@ -1,53 +0,0 @@ -#+TITLE: Contributing with Code -#+AUTHOR: Mathieu Marques - -** Coding Conventions - -*** TypeScript - -- Respect existing conventions -- Respect the =eslint= configuration -- Respect the =prettier= configuration - -A commit hook exists to check for ESLint errors and warnings to validate your -commits. It only validates the content of your commits. - -*** Styles - -Prefer the component styling properties when it makes sense, or the =sx= -property from =@mui/system= otherwise. - -** TODO Commit Conventions - -/Work in progress/ - -- Branch name -- Commit hooks -- Commit naming -- Pull request naming - -** TODO Scryfall Cache - -** Mocks - -In order to both reduce the strain on Scryfall's API and allow offline -development, various mocks were set up. See =src/mocks/handlers.ts= for their -implementations and payloads. - -See [[#environment-variables][#Environment Variables]] to disable the mocks. - -** TODO Tests - -/Work in progress/ - -- =jest= -- =react-testing-library= -- Coverage report - -** Environment Variables - -- =SCRYFALL_DEBUG= :: - Whether the Scryfall caching server should output more logs. - -You can overwrite their respective value, by creating a new =.env.local= at the -root of the project. diff --git a/CONTRIBUTING_WITH_MARKDOWN.org b/CONTRIBUTING_WITH_MARKDOWN.org index 84c2dfd9..16ce144f 100644 --- a/CONTRIBUTING_WITH_MARKDOWN.org +++ b/CONTRIBUTING_WITH_MARKDOWN.org @@ -17,33 +17,6 @@ content. Static content within the Wiki comes from those partials, this avoids having to maintain content within code. -** General Markdown Conventions - -- Fill your paragraphs to 80 columns -- If your title makes the frontmatter data longer than 80 columns, think of a - better heading for your document. In addition to annoy users with - terminal-based clients, it also might not look as good in the homepage where - article cards are rendered with their corresponding title with limited space -- Heading levels start at 2 in order to account for the page title -- Don't use unicode quote characters eg. =‘’= and =“”=. They might not render - properly for everyone so ASCII quotes should be preferred -- A colon right in front of a word will be interpreted as a Markdown /directive/ - so make sure you have a space right after =:= when it is used as punctuation -- A dot right after a number character ie. when you end your sentence with a - digit, renders as a numbered list item. To avoid this behavior, escape the dot - with a backslash: =Brainstorm is good, you might want all 4\.= -- Depending on one's Markdown client, a dot at the end of a link can be - considered part of said link eg. when you end your sentences with a link. - Avoid bare links, wrap them with angled brackets =<= and =>= - -In addition, a linter will run on your committed changes to detect necessary -improvements. A command is provided to help you sanitize your content locally: -=pnpm lint:wiki=. - -If you can, set up your editor of choice to run =prettier= on save when you edit -Wiki content. It'll do almost everything for you and make the linter happy -automatically. - ** Scryfall In some contexts, you can refer to card names within Markdown. To ease the @@ -70,48 +43,6 @@ multiple printings of the same card. Duress | STA | 92 #+END_SRC -** Frontmatter - -*** Chapters - -Chapter documents can take advantage of a front section called /frontmatter/ in -Markdown parlance. It should start with a triple-dash line and end with another -triple-dash line. Within that section, a body of YAML metadata can be provided. - -- =banner= (mandatory) :: - Configure a banner for the chapter page. Scryfall syntax is supported. -- =title= (mandatory) :: - A string for your chapter title. Wrap it with quotes to allow special - characters within such as =:= and ='=. -- =authors= :: - Comma-separated list of authors that you want to credit for the chapter - page. Currently unused. -- =order= :: - A number to specify the order of your chapter under its collapsible group - within the sidebar. By default chapters are alpha-sorted using their slug ie. - their path. - -*** Articles - -Articles documents don't have an =order= property but support other fields. Use -other existing articles for inspiration. - -- =banner= (mandatory) :: - Set a banner for the article to display in the homepage as well as at the top - of the article in its own dedicated page. Scryfall syntax is supported. -- =kind= (mandatory) :: - A kind symbol. Available values can be found in the keys at - [[./src/tools/markdown/constants/Kind.ts][Kind.ts]]. -- =title= (mandatory) :: - The string used for your article page title. Note that this does not have any - effect on the URL for your article. -- =authors= :: - Comma-separated list of authors that you want to credit for the article. -- =tags= :: - An array of tag symbols. Available values can be found in the keys at - [[./src/tools/markdown/constants/Tag.ts][Tag.ts]]. Tags are used to dictate - which card abbreviations should be documented in the sidebar. - ** Tables of Content An automatic table of content can be inserted in Markdown documents with an @@ -154,39 +85,6 @@ You can insert inline Scryfall links for cards using the following syntax: This will render an inline link reading "Brainstorm" and pointing to [[https://scryfall.com/search?q=!Brainstorm]]. -*** Card Rows - -Use this directive to render card images within your Markdown content. -[[#scryfall][Scryfall queries]] are supported in order to specify which set to -use. - -By default rows of cards are rendered with the =CENTERED= variant but you can -specify the variant with the =variant= keyword. - -*Centered* rows allocate 25% of the available width for each image. Beyond 4 -cards, images start shrinking so that they all fit on one line. - -#+BEGIN_SRC markdown -:::row{variant=CENTERED} -Lion's Eye Diamond | MIR -Edge of Autumn -Thassa's Oracle -::: -#+END_SRC - -*Pile* rows are rendered using a unique style to make them stand out to the -reader. In addition, they use a fixed width of 20% for each image. - -#+BEGIN_SRC markdown -:::row{variant=PILE} -Lion's Eye Diamond | MIR -Edge of Autumn -Ideas Unbound -Lotus Petal -Thassa's Oracle -::: -#+END_SRC - *** Decklists You can add decklists within your Markdown content, they will be rendered as a @@ -221,93 +119,6 @@ column for the sideboard. In doubt, follow existing conventions. For more details about color symbols, see the [[#mana][Mana section]]. -*** Media Embeds - -Media embeds are also supported: - -*SoundCloud* embeds. Use the following directive and provide the media path as -found in the address bar. - -#+BEGIN_SRC markdown -::soundcloud{url=ddftwiki/a-history-of-doomsday} -#+END_SRC - -*Twitter* embeds. Provide the ID found in a tweet URL. They can easily introduce -[[https://web.dev/cls/][CLS issues]] in pages where they are rendered /too -early/ ie. too high in the document: don't overuse them. - -#+BEGIN_SRC markdown -::tweet{id=1574576125535129600} -#+END_SRC - -*YouTube* embeds. Provide the ID typically found in the URL behind the =v= -parameter in the address bar. - -#+BEGIN_SRC markdown -::youtube{id=3LLIFHv5kbo} -#+END_SRC - -*** Accordions - -Collapsible blocks can be stacked against one another or used alone. Provide a -title for the clickable element as well as content for it. - -The content can be Markdown text directly, or even directives. - -#+BEGIN_SRC markdown -Note the `:::` to delimit a *container* block. - -:::accordion[Click to expand] -*Always* be **casting** :card[Doomsday]. -::: -#+END_SRC - -Or pulled from a partial: - -#+BEGIN_SRC markdown -Note the `::` to mean a *leaf* block with no children. - -::accordion[Click to expand]{path=path/to/partial/one/sans/extension} -::accordion[Click to expand]{path=path/to/partial/two/sans/extension} -#+END_SRC - -Do not specify the extension for the partial, =.md= is always assumed. - -*** Mana - -You can inline mana symbols /almost/ everywhere. - -#+BEGIN_SRC markdown -{W} {U} {B} {R} {G} -#+END_SRC - -When used collectively, for instance to indicate the color identity of an -archetype, use the same order as found on the back of a /Magic: the Gathering/ -card. This makes searching for guilds and clans much easier later on. As an -exception to this rule and when referring to Doomsday colors, start with blue -and black as it makes it easier for the eyes to parse quickly the differences -from one wedge to the next. - -The syntax that was chosen for the implementation can be found -[[https://mana.andrewgioia.com/icons.html][here]]. Currently only the mana costs -are available but loyalty and other color indicators may come soon :tm:. - -*** Spoilers - -Transient spoilers are supported through the `spoiler` directive. - -#+BEGIN_SRC markdown -Always be casting :spoiler[Doomsday]. -#+END_SRC - -But also support block-level children, and nesting. - -#+BEGIN_SRC markdown -:::spoiler -Always be casting :spoiler[Doomsday]. -::: -#+END_SRC - *** Spoils Calculator Insert a /Spoils of the Vault/ widget to let the reader run success rate diff --git a/eslint.config.mjs b/eslint.config.mjs index 3aee4643..f77c1ada 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -20,6 +20,7 @@ export default [ plugins: { import: PluginImport }, rules: { '@typescript-eslint/consistent-type-definitions': ['error', 'type'], + '@typescript-eslint/consistent-type-imports': 'error', '@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/no-unused-vars': [ 'error', diff --git a/markdown/partials/license.md b/markdown/partials/license.md index 8b165996..76bebd27 100644 --- a/markdown/partials/license.md +++ b/markdown/partials/license.md @@ -10,6 +10,9 @@ _Wizard of the Coast_ or their respective artist for older sets. For cropped arts where the artist line of a card is not visible, the artists are mentioned in the accessible text. +Mana symbols are rendered using the _Mana_ icon font made available by [Andrew +Gioia][mana]. See their section about licensing for more details. + Phyrexian scripture and the corresponding unofficial font assets were provided from the work of [Stas][stas]. @@ -30,6 +33,7 @@ adapted from one icon to another. [code:repository]: https://github.com/angrybacon/doomsday-wiki [icons:mdi]: https://pictogrammers.com/library/mdi/ [icons:simple-icons]: https://simpleicons.org +[mana]: https://mana.andrewgioia.com/ [scryfall:api]: https://scryfall.com/docs/api [stas]: http://stas.tk/ [wiki:license]: https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode diff --git a/markdown/partials/sandbox.md b/markdown/partials/sandbox.md index 9ffe8bdb..58fb548d 100644 --- a/markdown/partials/sandbox.md +++ b/markdown/partials/sandbox.md @@ -9,148 +9,124 @@ document in order to see how Markdown is rendered through the Wiki. It relies directly on components implemented within the Wiki so that the preview is as faithful as can be. -## Typography +In addition to `markdownlint` and `prettier` enforcing some basic rules, here +are a few more conventions: + +- Fill your paragraphs to 80 columns +- If your title oppose to the above rule, think of a better heading for your + document. In addition to annoy users with terminal-based clients, it also + might not look that good either on the Wiki itself +- Heading levels start at 2 in order to account for the page title +- Don't use unicode quote characters eg. `‘’` and `“”`. They might not render + properly for everyone so ASCII quotes should be preferred +- A colon right in front of a word will be interpreted as a Markdown /directive/ + so make sure you have a space right after `:` when it is used as punctuation +- A dot right after a number character ie. when you end your sentence with a + digit, will sometimes render as a numbered list item. To avoid this behavior, + escape the dot with a backslash: `Brainstorm is good, you might want all 4\.` +- Depending on one's Markdown client, a dot at the end of a link can be + considered part of said link eg. when you end your sentences with a link. + Avoid bare links, wrap them with angled brackets `<` and `>` -### Lists - -```md -- Aliquam at _pretium_ eros, vitae congue orci -- Fusce **bibendum** ac mauris eu malesuada - - Aliquam aliquet sed tortor ac laoreet - - Aenean vel nulla et ipsum consequat consequat sed eget justo - - Donec dictum felis auctor :spoiler[semper] porttitor - - Duis felis quam, ornare non tempor a, accumsan sed orci -- Vivamus a facilisis est -``` - -- Aliquam at _pretium_ eros, vitae congue orci -- Fusce **bibendum** ac mauris eu malesuada - - Aliquam aliquet sed tortor ac laoreet - - Aenean vel nulla et ipsum consequat consequat sed eget justo - - Donec dictum felis auctor :spoiler[semper] porttitor - - Duis felis quam, ornare non tempor a, accumsan sed orci -- Vivamus a facilisis est - -```md -1. Aliquam at _pretium_ eros, vitae congue orci -1. Fusce **bibendum** ac mauris eu malesuada - 1. Aliquam aliquet sed tortor ac laoreet - 1. Aenean vel nulla et ipsum consequat consequat sed eget justo - 1. Donec dictum felis auctor :spoiler[semper] porttitor - 1. Duis felis quam, ornare non tempor a, accumsan sed orci -1. Vivamus a facilisis est -``` - -1. Aliquam at _pretium_ eros, vitae congue orci -1. Fusce **bibendum** ac mauris eu malesuada - 1. Aliquam aliquet sed tortor ac laoreet - 1. Aenean vel nulla et ipsum consequat consequat sed eget justo - 1. Donec dictum felis auctor :spoiler[semper] porttitor - 1. Duis felis quam, ornare non tempor a, accumsan sed orci -1. Vivamus a facilisis est - -### Mana +## Accordions -You can inline mana symbols _almost_ everywhere. +### Simple ```md -{W} {U} {B} {R} {G} {WP} {UP} {BP} {RP} {GP} {2W} {2U} {2B} {2R} {2G} - -{WU} {UB} {BR} {RG} {GW} {WB} {UR} {BG} {RW} {GU} +:::accordion[Click to expand] +Lorem ipsum _dolor_ sit amet, consectetur **adipiscing** elit. Ut sed +tincidunter diam, sed tempor neque. Cras pulvinar, nisi at fermentum congue, +libero elit rutrum orci, et congue `sapien` turpis quis purus. -{0} {1} {2} … {20} {S} {C} {X} {Y} {Z} +Suspendisse :card[Underground Sea] ex ligula, elementum elementum arcu eu, +:spoiler[efficitur pharetra] quam. +::: ``` -{W} {U} {B} {R} {G} {WP} {UP} {BP} {RP} {GP} {2W} {2U} {2B} {2R} {2G} - -{WU} {UB} {BR} {RG} {GW} {WB} {UR} {BG} {RW} {GU} - -{0} {1} {2} … {20} {S} {C} {X} {Y} {Z} +:::accordion[Click to expand] +Lorem ipsum _dolor_ sit amet, consectetur **adipiscing** elit. Ut sed +tincidunter diam, sed tempor neque. Cras pulvinar, nisi at fermentum congue, +libero elit rutrum orci, et congue `sapien` turpis quis purus. -When used collectively, for instance to indicate the color identity of an -archetype, use the same order as found on the back of a _Magic: the Gathering_ -card. This makes searching for guilds and clans much easier later on. As an -exception to this rule and when referring to Doomsday colors, start with blue -and black as it makes it easier for the eyes to parse quickly the differences -from one wedge to the next. +Suspendisse :card[Underground Sea] ex ligula, elementum elementum arcu eu, +:spoiler[efficitur pharetra] quam. +::: -The syntax that was chosen for the implementation can be found -[here](https://mana.andrewgioia.com/icons.html). Currently only the mana costs -are available but loyalty and other color indicators may come soon ™. +### Multiple -### Paragraphs +Consecutive accordions stack against one another. ```md +:::accordion[Click to expand] Lorem ipsum _dolor_ sit amet, consectetur **adipiscing** elit. Ut sed tincidunter diam, sed tempor neque. Cras pulvinar, nisi at fermentum congue, -libero elit rutrum orci, et congue sapien turpis quis purus. Suspendisse -:card[Underground Sea] ex ligula, elementum elementum arcu eu, +libero elit rutrum orci, et congue `sapien` turpis quis purus. +::: + +:::accordion[Click to expand] +Suspendisse :card[Underground Sea] ex ligula, elementum elementum arcu eu, :spoiler[efficitur pharetra] quam. +::: ``` +:::accordion[Click to expand] Lorem ipsum _dolor_ sit amet, consectetur **adipiscing** elit. Ut sed tincidunter diam, sed tempor neque. Cras pulvinar, nisi at fermentum congue, -libero elit rutrum orci, et congue sapien turpis quis purus. Suspendisse -:card[Underground Sea] ex ligula, elementum elementum arcu eu, -:spoiler[efficitur pharetra] quam. - -### Quotes - -```md -> Lorem ipsum _dolor_ sit amet, consectetur **adipiscing** elit. Ut sed -> tincidunter diam, sed tempor neque. Cras pulvinar, nisi at fermentum congue, -> libero elit rutrum orci, et congue sapien turpis quis purus. Suspendisse -> :card[Underground Sea] ex ligula, elementum elementum arcu eu, -> :spoiler[efficitur pharetra] quam. -``` +libero elit rutrum orci, et congue `sapien` turpis quis purus. +::: -> Lorem ipsum _dolor_ sit amet, consectetur **adipiscing** elit. Ut sed -> tincidunter diam, sed tempor neque. Cras pulvinar, nisi at fermentum congue, -> libero elit rutrum orci, et congue sapien turpis quis purus. Suspendisse -> :card[Underground Sea] ex ligula, elementum elementum arcu eu, -> :spoiler[efficitur pharetra] quam. +:::accordion[Click to expand] +Suspendisse :card[Underground Sea] ex ligula, elementum elementum arcu eu, +:spoiler[efficitur pharetra] quam. +::: -### Spoilers +### Nested Directives ```md +::::accordion[Click to expand] :::spoiler Lorem ipsum _dolor_ sit amet, consectetur **adipiscing** elit. Ut sed tincidunter diam, sed tempor neque. Cras pulvinar, nisi at fermentum congue, -libero elit rutrum orci, et congue sapien turpis quis purus. Suspendisse -:card[Underground Sea] ex ligula, elementum elementum arcu eu, +libero elit rutrum orci, et congue `sapien` turpis quis purus. + +Suspendisse :card[Underground Sea] ex ligula, elementum elementum arcu eu, :spoiler[efficitur pharetra] quam. ::: + +:::row +DD | WTH +DD | PRM | 61058 +DD | MP2 +DD | A25 +DD | PLST +DD | SLD | 1115 +::: +:::: ``` +::::accordion[Click to expand] :::spoiler Lorem ipsum _dolor_ sit amet, consectetur **adipiscing** elit. Ut sed tincidunter diam, sed tempor neque. Cras pulvinar, nisi at fermentum congue, -libero elit rutrum orci, et congue sapien turpis quis purus. Suspendisse -:card[Underground Sea] ex ligula, elementum elementum arcu eu, +libero elit rutrum orci, et congue `sapien` turpis quis purus. + +Suspendisse :card[Underground Sea] ex ligula, elementum elementum arcu eu, :spoiler[efficitur pharetra] quam. ::: -### Tables - -```md -| One | Two | Three | -| --------------------------- | ---------------- | ------------------------- | -| Morbi consectetur non velit | Tempor a massa | Orci varius natoque | -| Sed pulvinar sapien in odio | Cras nec nisl | Nascetur ridiculus mus | -| Quisque libero elit | Aliquet sem vel | Quisque commodo urna | -| Ultrices a faucibus eget | Ultricies lectus | Curabitur lobortis dictum | -``` - -| One | Two | Three | -| --------------------------- | ---------------- | ------------------------- | -| Morbi consectetur non velit | Tempor a massa | Orci varius natoque | -| Sed pulvinar sapien in odio | Cras nec nisl | Nascetur ridiculus mus | -| Quisque libero elit | Aliquet sem vel | Quisque commodo urna | -| Ultrices a faucibus eget | Ultricies lectus | Curabitur lobortis dictum | +:::row +DD | WTH +DD | PRM | 61058 +DD | MP2 +DD | A25 +DD | PLST +DD | SLD | 1115 +::: +:::: -### Code Blocks +## Code -````md +````text ```ts import { MANA_RE } from '@/tools/mana/constants'; @@ -172,151 +148,181 @@ export const toDirective = (text: string): string => { }; ``` -## Accordions +## Decklists -### Simple +Coming soon ™ -````md -:::accordion[Click to expand] +## Footnotes -Lorem ipsum _dolor_ sit amet, consectetur **adipiscing** elit. Ut sed -tincidunter diam, sed tempor neque. Cras pulvinar, nisi at fermentum congue, -libero elit rutrum orci, et congue sapien turpis quis purus. Suspendisse -:card[Underground Sea] ex ligula, elementum elementum arcu eu, -:spoiler[efficitur pharetra] quam. +Coming soon ™ -> Lorem ipsum _dolor_ sit amet, consectetur **adipiscing** elit. Ut sed -> tincidunter diam, sed tempor neque. Cras pulvinar, nisi at fermentum congue, -> libero elit rutrum orci, et congue sapien turpis quis purus. Suspendisse -> :card[Underground Sea] ex ligula, elementum elementum arcu eu, -> :spoiler[efficitur pharetra] quam. +## Frontmatter -- Aliquam at _pretium_ eros, vitae congue orci -- Fusce **bibendum** ac mauris eu malesuada - - Aliquam aliquet sed tortor ac laoreet - - Aenean vel nulla et ipsum consequat consequat sed eget justo - - Donec dictum felis auctor :spoiler[semper] porttitor - - Duis felis quam, ornare non tempor a, accumsan sed orci -- Vivamus a facilisis est +The header of a Markdown document can be referred to as the _frontmatter_. It is +used to hold a body of YAML metadata for the current document without polluting +its actual content. + +### Chapters + +- `authors`: Comma-separated list of authors that should be credited for the + current chapter. Currently unused +- `banner`: (mandatory) Configure a benner for the page. Scryfall syntax is + supported +- `order`: A index number to specify the order of your chapter under its + collapsible group within the sidebar. By default chapters are alpha-sorted + using their slug ie. their path +- `title`: (mandatory) A string to serve as page title. Wrap it with double + quotes to allow special characters such as `:` and `'` + +### Articles + +Article documents don't have an `order` property but support other fields. Use +existing articles for inspiration. + +- `authors`: Comma-separated list of authors that should be credited for the + current chapter +- `banner`: (mandatory) Set a banner for the article to display in the homepage + as well as at the top of the article in its own dedicated page. Scryfall + syntax is supported +- `kind`: (mandatory) A kind symbol. Available values can be found in the keys + at [Kind.ts][constants:kind] +- `title`: (mandatory) The string used for your article page title. Note that + this does not have any effect on the URL for your article +- `tags`: An array of tag symbols. Available values can be found in the keys at + [Tag.ts][constants:tag]. Tags are used to dictate which card abbreviations + should be documented in the sidebar + +[constants:kind]: https://github.com/angrybacon/doomsday-wiki/blob/master/src/tools/markdown/constants/Kind.ts +[constants:tag]: https://github.com/angrybacon/doomsday-wiki/blob/master/src/tools/markdown/constants/Tag.ts + +## Images +Prefer smaller images in resolution. Most users don't need a 4K screenshot of +the game. Make them as tall as you actually need but not taller since those +typically prevent users to read a page comfortably especially on mobile devices. + +Both the accessible text (between square brackets) and the title (between single +quotes) are mandatory for a proper accessibility of your images within the page. + +```md +![A large placeholder image](https://www.placehold.co/1600x320 'High resolution') + +![A medium placeholder image](https://www.placehold.co/800x160 'Medium resolution') + +![A small placeholder image](https://www.placehold.co/400x80 'Low resolution') +``` + +![A large placeholder image](https://www.placehold.co/1600x320 'High resolution') + +![A medium placeholder image](https://www.placehold.co/800x160 'Medium resolution') + +![A small placeholder image](https://www.placehold.co/400x80 'Low resolution') + +## Lists + +### Ordered Lists + +```md 1. Aliquam at _pretium_ eros, vitae congue orci 1. Fusce **bibendum** ac mauris eu malesuada 1. Aliquam aliquet sed tortor ac laoreet - 1. Aenean vel nulla et ipsum consequat consequat sed eget justo + 1. Aenean vel nulla et `ipsum` consequat consequat sed eget justo 1. Donec dictum felis auctor :spoiler[semper] porttitor 1. Duis felis quam, ornare non tempor a, accumsan sed orci 1. Vivamus a facilisis est - -| One | Two | Three | -| --------------------------- | ---------------- | ------------------------- | -| Morbi consectetur non velit | Tempor a massa | Orci varius natoque | -| Sed pulvinar sapien in odio | Cras nec nisl | Nascetur ridiculus mus | -| Quisque libero elit | Aliquet sem vel | Quisque commodo urna | -| Ultrices a faucibus eget | Ultricies lectus | Curabitur lobortis dictum | - -```ts -import { MANA_RE } from '@/tools/mana/constants'; - -/** Find mana symbols in `text` and replace them with the directive syntax. */ -export const toDirective = (text: string): string => { - const result = text.replace(MANA_RE, ':mana[$1]'); - return result; -}; ``` -::: -```` - -:::accordion[Click to expand] +1. Aliquam at _pretium_ eros, vitae congue orci +1. Fusce **bibendum** ac mauris eu malesuada + 1. Aliquam aliquet sed tortor ac laoreet + 1. Aenean vel nulla et `ipsum` consequat consequat sed eget justo + 1. Donec dictum felis auctor :spoiler[semper] porttitor + 1. Duis felis quam, ornare non tempor a, accumsan sed orci +1. Vivamus a facilisis est -Lorem ipsum _dolor_ sit amet, consectetur **adipiscing** elit. Ut sed -tincidunter diam, sed tempor neque. Cras pulvinar, nisi at fermentum congue, -libero elit rutrum orci, et congue sapien turpis quis purus. Suspendisse -:card[Underground Sea] ex ligula, elementum elementum arcu eu, -:spoiler[efficitur pharetra] quam. +### Unordered Lists -> Lorem ipsum _dolor_ sit amet, consectetur **adipiscing** elit. Ut sed -> tincidunter diam, sed tempor neque. Cras pulvinar, nisi at fermentum congue, -> libero elit rutrum orci, et congue sapien turpis quis purus. Suspendisse -> :card[Underground Sea] ex ligula, elementum elementum arcu eu, -> :spoiler[efficitur pharetra] quam. +```md +- Aliquam at _pretium_ eros, vitae congue orci +- Fusce **bibendum** ac mauris eu malesuada + - Aliquam aliquet sed tortor ac laoreet + - Aenean vel nulla et `ipsum` consequat consequat sed eget justo + - Donec dictum felis auctor :spoiler[semper] porttitor + - Duis felis quam, ornare non tempor a, accumsan sed orci +- Vivamus a facilisis est +``` - Aliquam at _pretium_ eros, vitae congue orci - Fusce **bibendum** ac mauris eu malesuada - Aliquam aliquet sed tortor ac laoreet - - Aenean vel nulla et ipsum consequat consequat sed eget justo + - Aenean vel nulla et `ipsum` consequat consequat sed eget justo - Donec dictum felis auctor :spoiler[semper] porttitor - Duis felis quam, ornare non tempor a, accumsan sed orci - Vivamus a facilisis est -1. Aliquam at _pretium_ eros, vitae congue orci -1. Fusce **bibendum** ac mauris eu malesuada - 1. Aliquam aliquet sed tortor ac laoreet - 1. Aenean vel nulla et ipsum consequat consequat sed eget justo - 1. Donec dictum felis auctor :spoiler[semper] porttitor - 1. Duis felis quam, ornare non tempor a, accumsan sed orci -1. Vivamus a facilisis est +## Mana -| One | Two | Three | -| --------------------------- | ---------------- | ------------------------- | -| Morbi consectetur non velit | Tempor a massa | Orci varius natoque | -| Sed pulvinar sapien in odio | Cras nec nisl | Nascetur ridiculus mus | -| Quisque libero elit | Aliquet sem vel | Quisque commodo urna | -| Ultrices a faucibus eget | Ultricies lectus | Curabitur lobortis dictum | +You can inline mana symbols _almost_ everywhere. -```ts -import { MANA_RE } from '@/tools/mana/constants'; +```md +{W} {U} {B} {R} {G} {WP} {UP} {BP} {RP} {GP} {2W} {2U} {2B} {2R} {2G} -/** Find mana symbols in `text` and replace them with the directive syntax. */ -export const toDirective = (text: string): string => { - const result = text.replace(MANA_RE, ':mana[$1]'); - return result; -}; +{WU} {UB} {BR} {RG} {GW} {WB} {UR} {BG} {RW} {GU} + +{0} {1} {2} … {20} {S} {C} {X} {Y} {Z} ``` -::: +{W} {U} {B} {R} {G} {WP} {UP} {BP} {RP} {GP} {2W} {2U} {2B} {2R} {2G} -### Nested Directives +{WU} {UB} {BR} {RG} {GW} {WB} {UR} {BG} {RW} {GU} + +{0} {1} {2} … {20} {S} {C} {X} {Y} {Z} + +When used collectively, for instance to indicate the color identity of an +archetype, use the same order as found on the back of a _Magic: the Gathering_ +card. This makes searching for guilds and clans much easier later on. As an +exception to this rule and when referring to Doomsday colors, start with blue +and black as it makes it easier for the eyes to parse quickly the differences +from one wedge to the next. + +Currently only the mana costs are available but loyalty and other color +indicators may come soon ™. + +## Paragraphs ```md -::::accordion[Click to expand] -:::spoiler Lorem ipsum _dolor_ sit amet, consectetur **adipiscing** elit. Ut sed tincidunter diam, sed tempor neque. Cras pulvinar, nisi at fermentum congue, -libero elit rutrum orci, et congue sapien turpis quis purus. Suspendisse -:card[Underground Sea] ex ligula, elementum elementum arcu eu, -:spoiler[efficitur pharetra] quam. -::: +libero elit rutrum orci, et congue `sapien` turpis quis purus. -:::row -DD | WTH -DD | PRM | 61058 -DD | MP2 -DD | A25 -DD | PLST -DD | SLD | 1115 -::: -:::: +Suspendisse :card[Underground Sea] ex ligula, elementum elementum arcu eu, +:spoiler[efficitur pharetra] quam. ``` -::::accordion[Click to expand] -:::spoiler Lorem ipsum _dolor_ sit amet, consectetur **adipiscing** elit. Ut sed tincidunter diam, sed tempor neque. Cras pulvinar, nisi at fermentum congue, -libero elit rutrum orci, et congue sapien turpis quis purus. Suspendisse -:card[Underground Sea] ex ligula, elementum elementum arcu eu, +libero elit rutrum orci, et congue `sapien` turpis quis purus. + +Suspendisse :card[Underground Sea] ex ligula, elementum elementum arcu eu, :spoiler[efficitur pharetra] quam. -::: -:::row -DD | WTH -DD | PRM | 61058 -DD | MP2 -DD | A25 -DD | PLST -DD | SLD | 1115 -::: -:::: +## Quotes + +```md +> Lorem ipsum _dolor_ sit amet, consectetur **adipiscing** elit. Ut sed +> tincidunter diam, sed tempor neque. Cras pulvinar, nisi at fermentum congue, +> libero elit rutrum orci, et congue `sapien` turpis quis purus. +> +> Suspendisse :card[Underground Sea] ex ligula, elementum elementum arcu eu, +> :spoiler[efficitur pharetra] quam. +``` + +> Lorem ipsum _dolor_ sit amet, consectetur **adipiscing** elit. Ut sed +> tincidunter diam, sed tempor neque. Cras pulvinar, nisi at fermentum congue, +> libero elit rutrum orci, et congue `sapien` turpis quis purus. +> +> Suspendisse :card[Underground Sea] ex ligula, elementum elementum arcu eu, +> :spoiler[efficitur pharetra] quam. ## Rows @@ -432,44 +438,96 @@ TO TO ::: -## Media +## Scryfall + +Coming soon ™ -### Images +## SoundCloud ```md -![A large placeholder image](https://www.placehold.co/1600x320 'High resolution') +::soundcloud{url=ddftwiki/a-history-of-doomsday} +``` -![A medium placeholder image](https://www.placehold.co/800x160 'Medium resolution') +::soundcloud{url=ddftwiki/a-history-of-doomsday} -![A small placeholder image](https://www.placehold.co/400x80 'Low resolution') +## Spoilers + +Inline verbatim content is not supported within spoiler blocks. + +```md +:::spoiler +Lorem ipsum _dolor_ sit amet, consectetur **adipiscing** elit. Ut sed +tincidunter diam, sed tempor neque. Cras pulvinar, nisi at fermentum congue, +libero elit rutrum orci, et congue `sapien` turpis quis purus. + +Suspendisse :card[Underground Sea] ex ligula, elementum elementum arcu eu, +:spoiler[efficitur pharetra] quam. +::: ``` -![A large placeholder image](https://www.placehold.co/1600x320 'High resolution') +:::spoiler +Lorem ipsum _dolor_ sit amet, consectetur **adipiscing** elit. Ut sed +tincidunter diam, sed tempor neque. Cras pulvinar, nisi at fermentum congue, +libero elit rutrum orci, et congue `sapien` turpis quis purus. -![A medium placeholder image](https://www.placehold.co/800x160 'Medium resolution') +Suspendisse :card[Underground Sea] ex ligula, elementum elementum arcu eu, +:spoiler[efficitur pharetra] quam. +::: -![A small placeholder image](https://www.placehold.co/400x80 'Low resolution') +## Tables -### YouTube +### Default Alignement ```md -::youtube{id=3LLIFHv5kbo} +| One | Two | Three | +| --------------------------- | ---------------- | ------------------------- | +| Ultrices a _faucibus_ eget | Ultricies lectus | Curabitur lobortis dictum | +| Quisque **libero** elit | Aliquet sem vel | Quisque commodo urna | +| Morbi consectetur non velit | Tempor a massa | Orci varius natoque | +| Sed pulvinar sapien in odio | Cras nec nisl | Nascetur ridiculus mus | ``` -::youtube{id=3LLIFHv5kbo} +| One | Two | Three | +| --------------------------- | ---------------- | ------------------------- | +| Ultrices a _faucibus_ eget | Ultricies lectus | Curabitur lobortis dictum | +| Quisque **libero** elit | Aliquet sem vel | Quisque commodo urna | +| Morbi consectetur non velit | Tempor a massa | Orci varius natoque | +| Sed pulvinar sapien in odio | Cras nec nisl | Nascetur ridiculus mus | + +### Custom Alignement -### SoundCloud + ```md -::soundcloud{url=ddftwiki/a-history-of-doomsday} +| One | Two | Three | +| :-------------------------- | :--------------: | ------------------------: | +| Ultrices a _faucibus_ eget | Ultricies lectus | Curabitur lobortis dictum | +| Quisque **libero** elit | Aliquet sem vel | Quisque commodo urna | +| Morbi consectetur non velit | Tempor a massa | Orci varius natoque | +| Sed pulvinar sapien in odio | Cras nec nisl | Nascetur ridiculus mus | ``` -::soundcloud{url=ddftwiki/a-history-of-doomsday} + + +| One | Two | Three | +| :-------------------------- | :--------------: | ------------------------: | +| Ultrices a _faucibus_ eget | Ultricies lectus | Curabitur lobortis dictum | +| Quisque **libero** elit | Aliquet sem vel | Quisque commodo urna | +| Morbi consectetur non velit | Tempor a massa | Orci varius natoque | +| Sed pulvinar sapien in odio | Cras nec nisl | Nascetur ridiculus mus | -### Twitter +## Twitter ```md ::tweet{id=1574576125535129600} ``` ::tweet{id=1574576125535129600} + +## YouTube + +```md +::youtube{id=3LLIFHv5kbo} +``` + +::youtube{id=3LLIFHv5kbo} diff --git a/package.json b/package.json index 1f0125b3..19e89029 100644 --- a/package.json +++ b/package.json @@ -69,8 +69,8 @@ "@testing-library/jest-dom": "6.4.5", "@testing-library/react": "15.0.7", "@types/jest": "29.5.12", - "@types/mdast": "4.0.3", - "@types/node": "20.12.11", + "@types/mdast": "4.0.4", + "@types/node": "20.12.12", "@types/react": "18.3.2", "@types/react-dom": "18.3.0", "@types/react-syntax-highlighter": "15.5.13", @@ -81,13 +81,13 @@ "husky": "9.0.11", "jest": "29.7.0", "jest-environment-jsdom": "29.7.0", - "knip": "5.15.0", + "knip": "5.16.0", "lint-staged": "15.2.2", "markdownlint-cli": "0.40.0", "mdast-util-directive": "3.0.0", "prettier": "3.2.5", "ts-node": "10.9.2", "typescript": "5.4.5", - "typescript-eslint": "7.8.0" + "typescript-eslint": "7.9.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4ab15142..d51732c2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -119,7 +119,7 @@ importers: version: 4.2.1(prettier@3.2.5) '@testing-library/jest-dom': specifier: 6.4.5 - version: 6.4.5(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.12.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5))) + version: 6.4.5(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.12.12)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5))) '@testing-library/react': specifier: 15.0.7 version: 15.0.7(@types/react@18.3.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -127,11 +127,11 @@ importers: specifier: 29.5.12 version: 29.5.12 '@types/mdast': - specifier: 4.0.3 - version: 4.0.3 + specifier: 4.0.4 + version: 4.0.4 '@types/node': - specifier: 20.12.11 - version: 20.12.11 + specifier: 20.12.12 + version: 20.12.12 '@types/react': specifier: 18.3.2 version: 18.3.2 @@ -152,19 +152,19 @@ importers: version: 9.2.0 eslint-plugin-import: specifier: 2.29.1 - version: 2.29.1(@typescript-eslint/parser@7.8.0(eslint@9.2.0)(typescript@5.4.5))(eslint@9.2.0) + version: 2.29.1(@typescript-eslint/parser@7.9.0(eslint@9.2.0)(typescript@5.4.5))(eslint@9.2.0) husky: specifier: 9.0.11 version: 9.0.11 jest: specifier: 29.7.0 - version: 29.7.0(@types/node@20.12.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)) + version: 29.7.0(@types/node@20.12.12)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5)) jest-environment-jsdom: specifier: 29.7.0 version: 29.7.0 knip: - specifier: 5.15.0 - version: 5.15.0(@types/node@20.12.11)(typescript@5.4.5) + specifier: 5.16.0 + version: 5.16.0(@types/node@20.12.12)(typescript@5.4.5) lint-staged: specifier: 15.2.2 version: 15.2.2 @@ -179,13 +179,13 @@ importers: version: 3.2.5 ts-node: specifier: 10.9.2 - version: 10.9.2(@types/node@20.12.11)(typescript@5.4.5) + version: 10.9.2(@types/node@20.12.12)(typescript@5.4.5) typescript: specifier: 5.4.5 version: 5.4.5 typescript-eslint: - specifier: 7.8.0 - version: 7.8.0(eslint@9.2.0)(typescript@5.4.5) + specifier: 7.9.0 + version: 7.9.0(eslint@9.2.0)(typescript@5.4.5) packages: @@ -450,8 +450,8 @@ packages: resolution: {integrity: sha512-ESiIudvhoYni+MdsI8oD7skpprZ89qKocwRM2KEvhhBJ9nl5MRh7BXU5GTod7Mdygq+AUl+QzId6iWJKR/wABA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@floating-ui/core@1.6.1': - resolution: {integrity: sha512-42UH54oPZHPdRHdw6BgoBD6cg/eVTmVrFcgeRDM3jbO7uxSoipVcmcIGFcA5jmOHO5apcyvBhkSKES3fQJnu7A==} + '@floating-ui/core@1.6.2': + resolution: {integrity: sha512-+2XpQV9LLZeanU4ZevzRnGFg2neDeKHgFLjP6YLW+tly0IvrhqT4u8enLGjLH3qeh85g19xY5rsAusfwTdn5lg==} '@floating-ui/dom@1.6.5': resolution: {integrity: sha512-Nsdud2X65Dz+1RHjAIP0t8z5e2ff/IRbei6BqFrl1urT8sDVzM1HMQ+R0XcU5ceRfyO3I6ayeqIfh+6Wb8LGTw==} @@ -1009,20 +1009,20 @@ packages: '@types/jsdom@20.0.1': resolution: {integrity: sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==} - '@types/json-schema@7.0.15': - resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - '@types/json5@0.0.29': resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} '@types/mdast@4.0.3': resolution: {integrity: sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==} + '@types/mdast@4.0.4': + resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} + '@types/ms@0.7.34': resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} - '@types/node@20.12.11': - resolution: {integrity: sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==} + '@types/node@20.12.12': + resolution: {integrity: sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==} '@types/parse-json@4.0.2': resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} @@ -1042,9 +1042,6 @@ packages: '@types/react@18.3.2': resolution: {integrity: sha512-Btgg89dAnqD4vV7R3hlwOxgqobUQKgx3MmrQRi0yYbs/P0ym8XozIAlkqVilPqHQwXs4e9Tf63rrCgl58BcO4w==} - '@types/semver@7.5.8': - resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} - '@types/stack-utils@2.0.3': resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} @@ -1066,8 +1063,8 @@ packages: '@types/yargs@17.0.32': resolution: {integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==} - '@typescript-eslint/eslint-plugin@7.8.0': - resolution: {integrity: sha512-gFTT+ezJmkwutUPmB0skOj3GZJtlEGnlssems4AjkVweUPGj7jRwwqg0Hhg7++kPGJqKtTYx+R05Ftww372aIg==} + '@typescript-eslint/eslint-plugin@7.9.0': + resolution: {integrity: sha512-6e+X0X3sFe/G/54aC3jt0txuMTURqLyekmEHViqyA2VnxhLMpvA6nqmcjIy+Cr9tLDHPssA74BP5Mx9HQIxBEA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: '@typescript-eslint/parser': ^7.0.0 @@ -1077,8 +1074,8 @@ packages: typescript: optional: true - '@typescript-eslint/parser@7.8.0': - resolution: {integrity: sha512-KgKQly1pv0l4ltcftP59uQZCi4HUYswCLbTqVZEJu7uLX8CTLyswqMLqLN+2QFz4jCptqWVV4SB7vdxcH2+0kQ==} + '@typescript-eslint/parser@7.9.0': + resolution: {integrity: sha512-qHMJfkL5qvgQB2aLvhUSXxbK7OLnDkwPzFalg458pxQgfxKDfT1ZDbHQM/I6mDIf/svlMkj21kzKuQ2ixJlatQ==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -1087,12 +1084,12 @@ packages: typescript: optional: true - '@typescript-eslint/scope-manager@7.8.0': - resolution: {integrity: sha512-viEmZ1LmwsGcnr85gIq+FCYI7nO90DVbE37/ll51hjv9aG+YZMb4WDE2fyWpUR4O/UrhGRpYXK/XajcGTk2B8g==} + '@typescript-eslint/scope-manager@7.9.0': + resolution: {integrity: sha512-ZwPK4DeCDxr3GJltRz5iZejPFAAr4Wk3+2WIBaj1L5PYK5RgxExu/Y68FFVclN0y6GGwH8q+KgKRCvaTmFBbgQ==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/type-utils@7.8.0': - resolution: {integrity: sha512-H70R3AefQDQpz9mGv13Uhi121FNMh+WEaRqcXTX09YEDky21km4dV1ZXJIp8QjXc4ZaVkXVdohvWDzbnbHDS+A==} + '@typescript-eslint/type-utils@7.9.0': + resolution: {integrity: sha512-6Qy8dfut0PFrFRAZsGzuLoM4hre4gjzWJB6sUvdunCYZsYemTkzZNwF1rnGea326PHPT3zn5Lmg32M/xfJfByA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -1101,12 +1098,12 @@ packages: typescript: optional: true - '@typescript-eslint/types@7.8.0': - resolution: {integrity: sha512-wf0peJ+ZGlcH+2ZS23aJbOv+ztjeeP8uQ9GgwMJGVLx/Nj9CJt17GWgWWoSmoRVKAX2X+7fzEnAjxdvK2gqCLw==} + '@typescript-eslint/types@7.9.0': + resolution: {integrity: sha512-oZQD9HEWQanl9UfsbGVcZ2cGaR0YT5476xfWE0oE5kQa2sNK2frxOlkeacLOTh9po4AlUT5rtkGyYM5kew0z5w==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/typescript-estree@7.8.0': - resolution: {integrity: sha512-5pfUCOwK5yjPaJQNy44prjCwtr981dO8Qo9J9PwYXZ0MosgAbfEMB008dJ5sNo3+/BN6ytBPuSvXUg9SAqB0dg==} + '@typescript-eslint/typescript-estree@7.9.0': + resolution: {integrity: sha512-zBCMCkrb2YjpKV3LA0ZJubtKCDxLttxfdGmwZvTqqWevUPN0FZvSI26FalGFFUZU/9YQK/A4xcQF9o/VVaCKAg==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: typescript: '*' @@ -1114,14 +1111,14 @@ packages: typescript: optional: true - '@typescript-eslint/utils@7.8.0': - resolution: {integrity: sha512-L0yFqOCflVqXxiZyXrDr80lnahQfSOfc9ELAAZ75sqicqp2i36kEZZGuUymHNFoYOqxRT05up760b4iGsl02nQ==} + '@typescript-eslint/utils@7.9.0': + resolution: {integrity: sha512-5KVRQCzZajmT4Ep+NEgjXCvjuypVvYHUW7RHlXzNPuak2oWpVoD1jf5xCP0dPAuNIchjC7uQyvbdaSTFaLqSdA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 - '@typescript-eslint/visitor-keys@7.8.0': - resolution: {integrity: sha512-q4/gibTNBQNA0lGyYQCmWRS5D15n8rXh4QjK3KV+MBPlTYHpfBUT3D3PaPR/HeNiI9W6R7FvlkcGhNyAoP+caA==} + '@typescript-eslint/visitor-keys@7.9.0': + resolution: {integrity: sha512-iESPx2TNLDNGQLyjKhUvIKprlP49XNEK+MvIf9nIO7ZZaZdbnfWKHnXAgufpxqfA0YryH8XToi4+CjBgVnFTSQ==} engines: {node: ^18.18.0 || >=20.0.0} '@ungap/structured-clone@1.2.0': @@ -1346,8 +1343,8 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} - caniuse-lite@1.0.30001617: - resolution: {integrity: sha512-mLyjzNI9I+Pix8zwcrpxEbGlfqOkF9kM3ptzmKNw5tizSyYwMe+nGLTqMK9cO+0E+Bh6TsBxNAaHWEM8xwSsmA==} + caniuse-lite@1.0.30001618: + resolution: {integrity: sha512-p407+D1tIkDvsEAPS22lJxLQQaG8OTBEqo0KhzfABGk0TU4juBNDSfH0hyAp/HRyx+M8L17z/ltyhxh27FTfQg==} ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} @@ -1662,8 +1659,8 @@ packages: easy-table@1.2.0: resolution: {integrity: sha512-OFzVOv03YpvtcWGe5AayU5G2hgybsg3iqA6drU8UaoZyB9jLGMTrz9+asnLp/E+6qPh88yEI1gvyZFZ41dmgww==} - electron-to-chromium@1.4.763: - resolution: {integrity: sha512-k4J8NrtJ9QrvHLRo8Q18OncqBCB7tIUyqxRcJnlonQ0ioHKYB988GcDFF3ZePmnb8eHEopDs/wPHR/iGAFgoUQ==} + electron-to-chromium@1.4.771: + resolution: {integrity: sha512-b/CmBh1c5SXZy5oFu4a0o+2TdM0AYStiwoQebEoImGAINstCsS/s/MOvPKMoxu1nA2BJtEOJI1nC/VoVRzdXWA==} emittery@0.13.1: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} @@ -1980,9 +1977,9 @@ packages: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} - glob@10.3.14: - resolution: {integrity: sha512-4fkAqu93xe9Mk7le9v0y3VrPDqLKHarNi2s4Pv7f2yOvfhWfhc7hRPHC/JyqMqb8B/Dt/eGS4n7ykwf3fOsl8g==} - engines: {node: '>=16 || 14 >=14.17'} + glob@10.3.15: + resolution: {integrity: sha512-0c6RlJt1TICLyvJYIApxb8GsXoai0KUP7AxKKAtsYXdgJR1mGEUa7DgwShbdk1nly0PYoZj01xd4hzbq3fsjpw==} + engines: {node: '>=16 || 14 >=14.18'} hasBin: true glob@7.2.3: @@ -2540,8 +2537,8 @@ packages: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} - knip@5.15.0: - resolution: {integrity: sha512-RB1Unv8NWrIAyNTNGA1z+uDSnHEp78BtGhkJxyg/Ie2lPHx6k+6kZOx+AZeE6J9/ZDvQ8nEg+BkRmB++7NIrDA==} + knip@5.16.0: + resolution: {integrity: sha512-kdHfTRZuOqsMnvYYNT+pwefyBUNUYTqgyeGM8k4hfw++GZ3TMRGSPZoSl8IxQTy56AkxEDWyj1/P/mYv1vu/Gw==} engines: {node: '>=18.6.0'} hasBin: true peerDependencies: @@ -2902,8 +2899,8 @@ packages: nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} - nwsapi@2.2.9: - resolution: {integrity: sha512-2f3F0SEEer8bBu0dsNCFF50N0cTThV1nWFYcEYFZttdW0lDAoybv9cQoK7X7/68Z89S7FoRrVjP1LPX4XRf9vg==} + nwsapi@2.2.10: + resolution: {integrity: sha512-QK0sRs7MKv0tKe1+5uZIQk/C8XGza4DAnztJG8iD+TpJIORARrCxczA738awHrZoHeTjSSoHqao2teO0dC/gFQ==} object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} @@ -3018,9 +3015,9 @@ packages: path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - path-scurry@1.11.0: - resolution: {integrity: sha512-LNHTaVkzaYaLGlO+0u3rQTz7QrHTFOuKyba9JMTQutkmtNew8dw8wOD7mTU/5fCPZzCWpfW0XnQKzY61P0aTaw==} - engines: {node: '>=16 || 14 >=14.17'} + path-scurry@1.11.1: + resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} + engines: {node: '>=16 || 14 >=14.18'} path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} @@ -3029,6 +3026,9 @@ packages: picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + picocolors@1.0.1: + resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} + picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} @@ -3616,8 +3616,8 @@ packages: resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} engines: {node: '>= 0.4'} - typescript-eslint@7.8.0: - resolution: {integrity: sha512-sheFG+/D8N/L7gC3WT0Q8sB97Nm573Yfr+vZFzl/4nBdYcmviBPtwGSX9TJ7wpVg28ocerKVOt+k2eGmHzcgVA==} + typescript-eslint@7.9.0: + resolution: {integrity: sha512-7iTn9c10teHHCys5Ud/yaJntXZrjt3h2mrx3feJGBOLgQkF3TB1X89Xs3aVQ/GgdXRAXpk2bPTdpRwHP4YkUow==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -3674,8 +3674,8 @@ packages: resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==} engines: {node: '>= 4.0.0'} - update-browserslist-db@1.0.15: - resolution: {integrity: sha512-K9HWH62x3/EalU1U6sjSZiylm9C8tgq2mSvshZpqc7QE69RaA2qjhkW2HlNA0tFpEbtyFz7HTqbSdN4MSwUodA==} + update-browserslist-db@1.0.16: + resolution: {integrity: sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' @@ -3849,7 +3849,7 @@ snapshots: '@babel/code-frame@7.24.2': dependencies: '@babel/highlight': 7.24.5 - picocolors: 1.0.0 + picocolors: 1.0.1 '@babel/compat-data@7.24.4': {} @@ -3941,7 +3941,7 @@ snapshots: '@babel/helper-validator-identifier': 7.24.5 chalk: 2.4.2 js-tokens: 4.0.0 - picocolors: 1.0.0 + picocolors: 1.0.1 '@babel/parser@7.24.5': dependencies: @@ -4181,13 +4181,13 @@ snapshots: '@eslint/js@9.2.0': {} - '@floating-ui/core@1.6.1': + '@floating-ui/core@1.6.2': dependencies: '@floating-ui/utils': 0.2.2 '@floating-ui/dom@1.6.5': dependencies: - '@floating-ui/core': 1.6.1 + '@floating-ui/core': 1.6.2 '@floating-ui/utils': 0.2.2 '@floating-ui/react-dom@2.0.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': @@ -4323,27 +4323,27 @@ snapshots: '@jest/console@29.7.0': dependencies: '@jest/types': 29.6.3 - '@types/node': 20.12.11 + '@types/node': 20.12.12 chalk: 4.1.2 jest-message-util: 29.7.0 jest-util: 29.7.0 slash: 3.0.0 - '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5))': + '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5))': dependencies: '@jest/console': 29.7.0 '@jest/reporters': 29.7.0 '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.12.11 + '@types/node': 20.12.12 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.9.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.12.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)) + jest-config: 29.7.0(@types/node@20.12.12)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5)) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -4368,7 +4368,7 @@ snapshots: dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.12.11 + '@types/node': 20.12.12 jest-mock: 29.7.0 '@jest/expect-utils@29.7.0': @@ -4386,7 +4386,7 @@ snapshots: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 20.12.11 + '@types/node': 20.12.12 jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -4408,7 +4408,7 @@ snapshots: '@jest/transform': 29.7.0 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.25 - '@types/node': 20.12.11 + '@types/node': 20.12.12 chalk: 4.1.2 collect-v8-coverage: 1.0.2 exit: 0.1.2 @@ -4478,7 +4478,7 @@ snapshots: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 20.12.11 + '@types/node': 20.12.12 '@types/yargs': 17.0.32 chalk: 4.1.2 @@ -4699,7 +4699,7 @@ snapshots: lz-string: 1.5.0 pretty-format: 27.5.1 - '@testing-library/jest-dom@6.4.5(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.12.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)))': + '@testing-library/jest-dom@6.4.5(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.12.12)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5)))': dependencies: '@adobe/css-tools': 4.3.3 '@babel/runtime': 7.24.5 @@ -4712,7 +4712,7 @@ snapshots: optionalDependencies: '@jest/globals': 29.7.0 '@types/jest': 29.5.12 - jest: 29.7.0(@types/node@20.12.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)) + jest: 29.7.0(@types/node@20.12.12)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5)) '@testing-library/react@15.0.7(@types/react@18.3.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: @@ -4769,7 +4769,7 @@ snapshots: '@types/graceful-fs@4.1.9': dependencies: - '@types/node': 20.12.11 + '@types/node': 20.12.12 '@types/hast@2.3.10': dependencies: @@ -4796,21 +4796,23 @@ snapshots: '@types/jsdom@20.0.1': dependencies: - '@types/node': 20.12.11 + '@types/node': 20.12.12 '@types/tough-cookie': 4.0.5 parse5: 7.1.2 - '@types/json-schema@7.0.15': {} - '@types/json5@0.0.29': {} '@types/mdast@4.0.3': dependencies: '@types/unist': 3.0.2 + '@types/mdast@4.0.4': + dependencies: + '@types/unist': 3.0.2 + '@types/ms@0.7.34': {} - '@types/node@20.12.11': + '@types/node@20.12.12': dependencies: undici-types: 5.26.5 @@ -4835,8 +4837,6 @@ snapshots: '@types/prop-types': 15.7.12 csstype: 3.1.3 - '@types/semver@7.5.8': {} - '@types/stack-utils@2.0.3': {} '@types/tough-cookie@4.0.5': {} @@ -4853,32 +4853,30 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@7.8.0(@typescript-eslint/parser@7.8.0(eslint@9.2.0)(typescript@5.4.5))(eslint@9.2.0)(typescript@5.4.5)': + '@typescript-eslint/eslint-plugin@7.9.0(@typescript-eslint/parser@7.9.0(eslint@9.2.0)(typescript@5.4.5))(eslint@9.2.0)(typescript@5.4.5)': dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.8.0(eslint@9.2.0)(typescript@5.4.5) - '@typescript-eslint/scope-manager': 7.8.0 - '@typescript-eslint/type-utils': 7.8.0(eslint@9.2.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.8.0(eslint@9.2.0)(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.8.0 - debug: 4.3.4 + '@typescript-eslint/parser': 7.9.0(eslint@9.2.0)(typescript@5.4.5) + '@typescript-eslint/scope-manager': 7.9.0 + '@typescript-eslint/type-utils': 7.9.0(eslint@9.2.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.9.0(eslint@9.2.0)(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 7.9.0 eslint: 9.2.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 - semver: 7.6.2 ts-api-utils: 1.3.0(typescript@5.4.5) optionalDependencies: typescript: 5.4.5 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.8.0(eslint@9.2.0)(typescript@5.4.5)': + '@typescript-eslint/parser@7.9.0(eslint@9.2.0)(typescript@5.4.5)': dependencies: - '@typescript-eslint/scope-manager': 7.8.0 - '@typescript-eslint/types': 7.8.0 - '@typescript-eslint/typescript-estree': 7.8.0(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.8.0 + '@typescript-eslint/scope-manager': 7.9.0 + '@typescript-eslint/types': 7.9.0 + '@typescript-eslint/typescript-estree': 7.9.0(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 7.9.0 debug: 4.3.4 eslint: 9.2.0 optionalDependencies: @@ -4886,15 +4884,15 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@7.8.0': + '@typescript-eslint/scope-manager@7.9.0': dependencies: - '@typescript-eslint/types': 7.8.0 - '@typescript-eslint/visitor-keys': 7.8.0 + '@typescript-eslint/types': 7.9.0 + '@typescript-eslint/visitor-keys': 7.9.0 - '@typescript-eslint/type-utils@7.8.0(eslint@9.2.0)(typescript@5.4.5)': + '@typescript-eslint/type-utils@7.9.0(eslint@9.2.0)(typescript@5.4.5)': dependencies: - '@typescript-eslint/typescript-estree': 7.8.0(typescript@5.4.5) - '@typescript-eslint/utils': 7.8.0(eslint@9.2.0)(typescript@5.4.5) + '@typescript-eslint/typescript-estree': 7.9.0(typescript@5.4.5) + '@typescript-eslint/utils': 7.9.0(eslint@9.2.0)(typescript@5.4.5) debug: 4.3.4 eslint: 9.2.0 ts-api-utils: 1.3.0(typescript@5.4.5) @@ -4903,12 +4901,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/types@7.8.0': {} + '@typescript-eslint/types@7.9.0': {} - '@typescript-eslint/typescript-estree@7.8.0(typescript@5.4.5)': + '@typescript-eslint/typescript-estree@7.9.0(typescript@5.4.5)': dependencies: - '@typescript-eslint/types': 7.8.0 - '@typescript-eslint/visitor-keys': 7.8.0 + '@typescript-eslint/types': 7.9.0 + '@typescript-eslint/visitor-keys': 7.9.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -4920,23 +4918,20 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@7.8.0(eslint@9.2.0)(typescript@5.4.5)': + '@typescript-eslint/utils@7.9.0(eslint@9.2.0)(typescript@5.4.5)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.2.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 7.8.0 - '@typescript-eslint/types': 7.8.0 - '@typescript-eslint/typescript-estree': 7.8.0(typescript@5.4.5) + '@typescript-eslint/scope-manager': 7.9.0 + '@typescript-eslint/types': 7.9.0 + '@typescript-eslint/typescript-estree': 7.9.0(typescript@5.4.5) eslint: 9.2.0 - semver: 7.6.2 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/visitor-keys@7.8.0': + '@typescript-eslint/visitor-keys@7.9.0': dependencies: - '@typescript-eslint/types': 7.8.0 + '@typescript-eslint/types': 7.9.0 eslint-visitor-keys: 3.4.3 '@ungap/structured-clone@1.2.0': {} @@ -5165,10 +5160,10 @@ snapshots: browserslist@4.23.0: dependencies: - caniuse-lite: 1.0.30001617 - electron-to-chromium: 1.4.763 + caniuse-lite: 1.0.30001618 + electron-to-chromium: 1.4.771 node-releases: 2.0.14 - update-browserslist-db: 1.0.15(browserslist@4.23.0) + update-browserslist-db: 1.0.16(browserslist@4.23.0) bser@2.1.1: dependencies: @@ -5194,7 +5189,7 @@ snapshots: camelcase@6.3.0: {} - caniuse-lite@1.0.30001617: {} + caniuse-lite@1.0.30001618: {} ccount@2.0.1: {} @@ -5332,13 +5327,13 @@ snapshots: path-type: 4.0.0 yaml: 1.10.2 - create-jest@29.7.0(@types/node@20.12.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)): + create-jest@29.7.0(@types/node@20.12.12)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5)): dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@20.12.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)) + jest-config: 29.7.0(@types/node@20.12.12)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5)) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -5485,7 +5480,7 @@ snapshots: optionalDependencies: wcwidth: 1.0.1 - electron-to-chromium@1.4.763: {} + electron-to-chromium@1.4.771: {} emittery@0.13.1: {} @@ -5602,17 +5597,17 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@7.8.0(eslint@9.2.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint@9.2.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@7.9.0(eslint@9.2.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint@9.2.0): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 7.8.0(eslint@9.2.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.9.0(eslint@9.2.0)(typescript@5.4.5) eslint: 9.2.0 eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color - eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.8.0(eslint@9.2.0)(typescript@5.4.5))(eslint@9.2.0): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.9.0(eslint@9.2.0)(typescript@5.4.5))(eslint@9.2.0): dependencies: array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 @@ -5622,7 +5617,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.2.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.8.0(eslint@9.2.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint@9.2.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.9.0(eslint@9.2.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint@9.2.0) hasown: 2.0.2 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -5633,7 +5628,7 @@ snapshots: semver: 6.3.1 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 7.8.0(eslint@9.2.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.9.0(eslint@9.2.0)(typescript@5.4.5) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -5883,13 +5878,13 @@ snapshots: dependencies: is-glob: 4.0.3 - glob@10.3.14: + glob@10.3.15: dependencies: foreground-child: 3.1.1 jackspeak: 2.3.6 minimatch: 9.0.4 minipass: 7.1.1 - path-scurry: 1.11.0 + path-scurry: 1.11.1 glob@7.2.3: dependencies: @@ -6257,7 +6252,7 @@ snapshots: '@jest/expect': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.12.11 + '@types/node': 20.12.12 chalk: 4.1.2 co: 4.6.0 dedent: 1.5.3(babel-plugin-macros@3.1.0) @@ -6277,16 +6272,16 @@ snapshots: - babel-plugin-macros - supports-color - jest-cli@29.7.0(@types/node@20.12.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)): + jest-cli@29.7.0(@types/node@20.12.12)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5)): dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)) + '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5)) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@20.12.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)) + create-jest: 29.7.0(@types/node@20.12.12)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5)) exit: 0.1.2 import-local: 3.1.0 - jest-config: 29.7.0(@types/node@20.12.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)) + jest-config: 29.7.0(@types/node@20.12.12)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5)) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -6296,7 +6291,7 @@ snapshots: - supports-color - ts-node - jest-config@29.7.0(@types/node@20.12.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)): + jest-config@29.7.0(@types/node@20.12.12)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5)): dependencies: '@babel/core': 7.24.5 '@jest/test-sequencer': 29.7.0 @@ -6321,8 +6316,8 @@ snapshots: slash: 3.0.0 strip-json-comments: 3.1.1 optionalDependencies: - '@types/node': 20.12.11 - ts-node: 10.9.2(@types/node@20.12.11)(typescript@5.4.5) + '@types/node': 20.12.12 + ts-node: 10.9.2(@types/node@20.12.12)(typescript@5.4.5) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -6352,7 +6347,7 @@ snapshots: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 '@types/jsdom': 20.0.1 - '@types/node': 20.12.11 + '@types/node': 20.12.12 jest-mock: 29.7.0 jest-util: 29.7.0 jsdom: 20.0.3 @@ -6366,7 +6361,7 @@ snapshots: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.12.11 + '@types/node': 20.12.12 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -6376,7 +6371,7 @@ snapshots: dependencies: '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.9 - '@types/node': 20.12.11 + '@types/node': 20.12.12 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -6415,7 +6410,7 @@ snapshots: jest-mock@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 20.12.11 + '@types/node': 20.12.12 jest-util: 29.7.0 jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): @@ -6450,7 +6445,7 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.12.11 + '@types/node': 20.12.12 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 @@ -6478,7 +6473,7 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.12.11 + '@types/node': 20.12.12 chalk: 4.1.2 cjs-module-lexer: 1.3.1 collect-v8-coverage: 1.0.2 @@ -6524,7 +6519,7 @@ snapshots: jest-util@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 20.12.11 + '@types/node': 20.12.12 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -6543,7 +6538,7 @@ snapshots: dependencies: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.12.11 + '@types/node': 20.12.12 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -6552,17 +6547,17 @@ snapshots: jest-worker@29.7.0: dependencies: - '@types/node': 20.12.11 + '@types/node': 20.12.12 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 - jest@29.7.0(@types/node@20.12.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)): + jest@29.7.0(@types/node@20.12.12)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5)): dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)) + '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5)) '@jest/types': 29.6.3 import-local: 3.1.0 - jest-cli: 29.7.0(@types/node@20.12.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)) + jest-cli: 29.7.0(@types/node@20.12.12)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5)) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -6598,7 +6593,7 @@ snapshots: http-proxy-agent: 5.0.0 https-proxy-agent: 5.0.1 is-potential-custom-element-name: 1.0.1 - nwsapi: 2.2.9 + nwsapi: 2.2.10 parse5: 7.1.2 saxes: 6.0.0 symbol-tree: 3.2.4 @@ -6643,12 +6638,12 @@ snapshots: kleur@3.0.3: {} - knip@5.15.0(@types/node@20.12.11)(typescript@5.4.5): + knip@5.16.0(@types/node@20.12.12)(typescript@5.4.5): dependencies: '@ericcornelissen/bash-parser': 0.5.2 '@nodelib/fs.walk': 2.0.0 '@snyk/github-codeowners': 1.1.0 - '@types/node': 20.12.11 + '@types/node': 20.12.12 easy-table: 1.2.0 fast-glob: 3.3.2 file-entry-cache: 8.0.0 @@ -6779,7 +6774,7 @@ snapshots: dependencies: commander: 12.0.0 get-stdin: 9.0.0 - glob: 10.3.14 + glob: 10.3.15 ignore: 5.3.1 js-yaml: 4.1.0 jsonc-parser: 3.2.1 @@ -6798,7 +6793,7 @@ snapshots: mdast-util-directive@3.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 '@types/unist': 3.0.2 devlop: 1.1.0 mdast-util-from-markdown: 2.0.0 @@ -6811,14 +6806,14 @@ snapshots: mdast-util-find-and-replace@3.0.1: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 escape-string-regexp: 5.0.0 unist-util-is: 6.0.0 unist-util-visit-parents: 6.0.1 mdast-util-from-markdown@2.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 '@types/unist': 3.0.2 decode-named-character-reference: 1.0.2 devlop: 1.1.0 @@ -6835,7 +6830,7 @@ snapshots: mdast-util-frontmatter@2.0.1: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 devlop: 1.1.0 escape-string-regexp: 5.0.0 mdast-util-from-markdown: 2.0.0 @@ -6846,7 +6841,7 @@ snapshots: mdast-util-gfm-autolink-literal@2.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 ccount: 2.0.1 devlop: 1.1.0 mdast-util-find-and-replace: 3.0.1 @@ -6854,7 +6849,7 @@ snapshots: mdast-util-gfm-footnote@2.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 devlop: 1.1.0 mdast-util-from-markdown: 2.0.0 mdast-util-to-markdown: 2.1.0 @@ -6864,7 +6859,7 @@ snapshots: mdast-util-gfm-strikethrough@2.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 mdast-util-from-markdown: 2.0.0 mdast-util-to-markdown: 2.1.0 transitivePeerDependencies: @@ -6872,7 +6867,7 @@ snapshots: mdast-util-gfm-table@2.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 devlop: 1.1.0 markdown-table: 3.0.3 mdast-util-from-markdown: 2.0.0 @@ -6882,7 +6877,7 @@ snapshots: mdast-util-gfm-task-list-item@2.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 devlop: 1.1.0 mdast-util-from-markdown: 2.0.0 mdast-util-to-markdown: 2.1.0 @@ -6905,7 +6900,7 @@ snapshots: dependencies: '@types/estree-jsx': 1.0.5 '@types/hast': 3.0.4 - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 devlop: 1.1.0 mdast-util-from-markdown: 2.0.0 mdast-util-to-markdown: 2.1.0 @@ -6916,7 +6911,7 @@ snapshots: dependencies: '@types/estree-jsx': 1.0.5 '@types/hast': 3.0.4 - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 '@types/unist': 3.0.2 ccount: 2.0.1 devlop: 1.1.0 @@ -6934,7 +6929,7 @@ snapshots: dependencies: '@types/estree-jsx': 1.0.5 '@types/hast': 3.0.4 - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 devlop: 1.1.0 mdast-util-from-markdown: 2.0.0 mdast-util-to-markdown: 2.1.0 @@ -6943,13 +6938,13 @@ snapshots: mdast-util-phrasing@4.1.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 unist-util-is: 6.0.0 mdast-util-to-hast@13.1.0: dependencies: '@types/hast': 3.0.4 - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 '@ungap/structured-clone': 1.2.0 devlop: 1.1.0 micromark-util-sanitize-uri: 2.0.0 @@ -6960,7 +6955,7 @@ snapshots: mdast-util-to-markdown@2.1.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 '@types/unist': 3.0.2 longest-streak: 3.1.0 mdast-util-phrasing: 4.1.0 @@ -6971,11 +6966,11 @@ snapshots: mdast-util-to-string@4.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 mdast-util-toc@7.0.1: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 '@types/ungap__structured-clone': 1.2.0 '@ungap/structured-clone': 1.2.0 github-slugger: 2.0.0 @@ -7239,7 +7234,7 @@ snapshots: '@next/env': 14.2.3 '@swc/helpers': 0.5.5 busboy: 1.6.0 - caniuse-lite: 1.0.30001617 + caniuse-lite: 1.0.30001618 graceful-fs: 4.2.11 postcss: 8.4.31 react: 18.3.1 @@ -7277,7 +7272,7 @@ snapshots: dependencies: boolbase: 1.0.0 - nwsapi@2.2.9: {} + nwsapi@2.2.10: {} object-assign@4.1.1: {} @@ -7405,7 +7400,7 @@ snapshots: path-parse@1.0.7: {} - path-scurry@1.11.0: + path-scurry@1.11.1: dependencies: lru-cache: 10.2.2 minipass: 7.1.1 @@ -7414,6 +7409,8 @@ snapshots: picocolors@1.0.0: {} + picocolors@1.0.1: {} + picomatch@2.3.1: {} picomatch@4.0.2: {} @@ -7435,7 +7432,7 @@ snapshots: postcss@8.4.31: dependencies: nanoid: 3.3.7 - picocolors: 1.0.0 + picocolors: 1.0.1 source-map-js: 1.2.0 prelude-ls@1.2.1: {} @@ -7580,7 +7577,7 @@ snapshots: remark-directive@3.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 mdast-util-directive: 3.0.0 micromark-extension-directive: 3.0.0 unified: 11.0.4 @@ -7589,7 +7586,7 @@ snapshots: remark-frontmatter@5.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 mdast-util-frontmatter: 2.0.1 micromark-extension-frontmatter: 2.0.0 unified: 11.0.4 @@ -7598,7 +7595,7 @@ snapshots: remark-gfm@4.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 mdast-util-gfm: 3.0.0 micromark-extension-gfm: 3.0.0 remark-parse: 11.0.0 @@ -7609,7 +7606,7 @@ snapshots: remark-parse@11.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 mdast-util-from-markdown: 2.0.0 micromark-util-types: 2.0.0 unified: 11.0.4 @@ -7619,25 +7616,25 @@ snapshots: remark-rehype@11.1.0: dependencies: '@types/hast': 3.0.4 - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 mdast-util-to-hast: 13.1.0 unified: 11.0.4 vfile: 6.0.1 remark-stringify@11.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 mdast-util-to-markdown: 2.1.0 unified: 11.0.4 remark-toc@9.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 mdast-util-toc: 7.0.1 remark@15.0.1: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 remark-parse: 11.0.0 remark-stringify: 11.0.0 unified: 11.0.4 @@ -7992,14 +7989,14 @@ snapshots: dependencies: typescript: 5.4.5 - ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5): + ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.12.11 + '@types/node': 20.12.12 acorn: 8.11.3 acorn-walk: 8.3.2 arg: 4.1.3 @@ -8059,11 +8056,11 @@ snapshots: is-typed-array: 1.1.13 possible-typed-array-names: 1.0.0 - typescript-eslint@7.8.0(eslint@9.2.0)(typescript@5.4.5): + typescript-eslint@7.9.0(eslint@9.2.0)(typescript@5.4.5): dependencies: - '@typescript-eslint/eslint-plugin': 7.8.0(@typescript-eslint/parser@7.8.0(eslint@9.2.0)(typescript@5.4.5))(eslint@9.2.0)(typescript@5.4.5) - '@typescript-eslint/parser': 7.8.0(eslint@9.2.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.8.0(eslint@9.2.0)(typescript@5.4.5) + '@typescript-eslint/eslint-plugin': 7.9.0(@typescript-eslint/parser@7.9.0(eslint@9.2.0)(typescript@5.4.5))(eslint@9.2.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.9.0(eslint@9.2.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.9.0(eslint@9.2.0)(typescript@5.4.5) eslint: 9.2.0 optionalDependencies: typescript: 5.4.5 @@ -8141,11 +8138,11 @@ snapshots: universalify@0.2.0: {} - update-browserslist-db@1.0.15(browserslist@4.23.0): + update-browserslist-db@1.0.16(browserslist@4.23.0): dependencies: browserslist: 4.23.0 escalade: 3.1.2 - picocolors: 1.0.0 + picocolors: 1.0.1 uri-js@4.4.1: dependencies: diff --git a/src/components/ArticleCard/ArticleCard.test.tsx b/src/components/ArticleCard/ArticleCard.test.tsx index e206f3ac..d8c27589 100644 --- a/src/components/ArticleCard/ArticleCard.test.tsx +++ b/src/components/ArticleCard/ArticleCard.test.tsx @@ -1,6 +1,7 @@ import { render, screen } from '@testing-library/react'; +import { type ComponentProps } from 'react'; -import { ArticleCard, Props } from '@/components/ArticleCard/ArticleCard'; +import { ArticleCard } from '@/components/ArticleCard/ArticleCard'; import { Kind } from '@/tools/markdown/constants/Kind'; jest.mock('@/components/ArticleChip/ArticleChip', () => ({ @@ -8,7 +9,7 @@ jest.mock('@/components/ArticleChip/ArticleChip', () => ({ })); describe(ArticleCard.name, () => { - let props: Props; + let props: ComponentProps; beforeEach(() => { props = { diff --git a/src/components/ArticleCard/ArticleCard.tsx b/src/components/ArticleCard/ArticleCard.tsx index f67b1870..0254c983 100644 --- a/src/components/ArticleCard/ArticleCard.tsx +++ b/src/components/ArticleCard/ArticleCard.tsx @@ -9,7 +9,7 @@ import { type ArticleCard as ArticleCardModel } from '@/tools/markdown/types'; /** Vertical height that should be added for the banner. */ const BANNER_OFFSET = 90; -export type Props = ArticleCardModel; +type Props = ArticleCardModel; export const ArticleCard: FunctionComponent = ({ banner, diff --git a/src/components/ArticleChip/ArticleChip.tsx b/src/components/ArticleChip/ArticleChip.tsx index f060edc8..8c4bb5c4 100644 --- a/src/components/ArticleChip/ArticleChip.tsx +++ b/src/components/ArticleChip/ArticleChip.tsx @@ -1,4 +1,4 @@ -import Chip, { ChipProps } from '@mui/material/Chip'; +import { Chip, type ChipProps } from '@mui/material'; import { alpha } from '@mui/material/styles'; import { type FunctionComponent } from 'react'; diff --git a/src/components/Card/Card.test.tsx b/src/components/Card/Card.test.tsx index 0c0838fb..1818e225 100644 --- a/src/components/Card/Card.test.tsx +++ b/src/components/Card/Card.test.tsx @@ -1,10 +1,12 @@ import { render, screen } from '@testing-library/react'; +import { type ComponentProps } from 'react'; -import { Card, Props } from '@/components/Card/Card'; +import { Card } from '@/components/Card/Card'; import { type ScryCard } from '@/tools/scryfall/types'; describe(Card.name, () => { - let props: Props; + let props: ComponentProps; + const dummyCard = { artist: 'Firstname Lastname', images: { full: 'protocol://path/to/resource.png' }, diff --git a/src/components/Card/Card.tsx b/src/components/Card/Card.tsx index 3a9c7cf6..bf722e7f 100644 --- a/src/components/Card/Card.tsx +++ b/src/components/Card/Card.tsx @@ -7,7 +7,7 @@ import { useState, type FunctionComponent, type ReactNode } from 'react'; import { CardFace } from '@/components/Card/CardFace'; import { type ScryCard } from '@/tools/scryfall/types'; -export type Props = { +type Props = { data: ScryCard[]; }; diff --git a/src/components/Card/CardFace.test.tsx b/src/components/Card/CardFace.test.tsx index 10c2043d..0a5b12d0 100644 --- a/src/components/Card/CardFace.test.tsx +++ b/src/components/Card/CardFace.test.tsx @@ -1,10 +1,11 @@ import { render, screen } from '@testing-library/react'; +import { type ComponentProps } from 'react'; -import { CardFace, Props } from '@/components/Card/CardFace'; +import { CardFace } from '@/components/Card/CardFace'; import { type ScryCard } from '@/tools/scryfall/types'; describe(CardFace.name, () => { - let props: Props; + let props: ComponentProps; beforeEach(() => { props = { diff --git a/src/components/Card/CardFace.tsx b/src/components/Card/CardFace.tsx index b76a2e4a..6de4f194 100644 --- a/src/components/Card/CardFace.tsx +++ b/src/components/Card/CardFace.tsx @@ -5,7 +5,7 @@ import { type FunctionComponent, type ReactNode } from 'react'; import { type ScryCard } from '@/tools/scryfall/types'; -export type Props = { +type Props = { active: boolean; data: ScryCard; sx?: SxProps; diff --git a/src/components/Decklist/Column.test.tsx b/src/components/Decklist/Column.test.tsx index 9b7faa14..56754428 100644 --- a/src/components/Decklist/Column.test.tsx +++ b/src/components/Decklist/Column.test.tsx @@ -1,9 +1,10 @@ import { render, screen } from '@testing-library/react'; +import { type ComponentProps } from 'react'; -import { Column, Props } from '@/components/Decklist/Column'; +import { Column } from '@/components/Decklist/Column'; describe(Column.name, () => { - let props: Props; + let props: ComponentProps; beforeEach(() => { props = { cards: [] }; diff --git a/src/components/Decklist/Column.tsx b/src/components/Decklist/Column.tsx index 5eb6d163..c17bd9b0 100644 --- a/src/components/Decklist/Column.tsx +++ b/src/components/Decklist/Column.tsx @@ -3,7 +3,7 @@ import { type FunctionComponent } from 'react'; import { type Card } from '@/tools/decklists/types'; -export type Props = { +type Props = { cards: Card[]; }; diff --git a/src/components/Link/Link.tsx b/src/components/Link/Link.tsx index 659dd4af..a1b2e4e7 100644 --- a/src/components/Link/Link.tsx +++ b/src/components/Link/Link.tsx @@ -1,6 +1,6 @@ import { Link as MuiLink } from '@mui/material'; import NextLink from 'next/link'; -import { FunctionComponent, PropsWithChildren } from 'react'; +import { type FunctionComponent, type PropsWithChildren } from 'react'; type Props = PropsWithChildren & { external?: boolean; diff --git a/src/components/Remark/Remark.tsx b/src/components/Markdown/Markdown.tsx similarity index 65% rename from src/components/Remark/Remark.tsx rename to src/components/Markdown/Markdown.tsx index 50fbb531..ad829229 100644 --- a/src/components/Remark/Remark.tsx +++ b/src/components/Markdown/Markdown.tsx @@ -1,25 +1,81 @@ import { accordionClasses, Box, tableClasses } from '@mui/material'; import { useEffect, type FunctionComponent } from 'react'; -import Markdown from 'react-markdown'; +import ReactMarkdown, { type Components } from 'react-markdown'; import rehypeSlug from 'rehype-slug'; import remarkDirective from 'remark-directive'; import remarkGfm from 'remark-gfm'; import remarkToc from 'remark-toc'; import { type PluggableList } from 'unified'; -import { COMPONENTS, COMPONENTS_EXTRA } from '@/components/Remark/constants'; +import { + Accordion, + Card, + Code, + Decklist, + Divider, + Heading, + Image, + Link, + Mana, + Quote, + Row, + Soundcloud, + Spoiler, + Table, + TableBody, + TableCell, + TableHead, + TableRow, + Tweet, + Youtube, +} from '@/components/Markdown/renderers'; +import { SpoilsCalculator } from '@/components/SpoilsCalculator/SpoilsCalculator'; import { type Decklists } from '@/tools/decklists/types'; import { type Article, type Chapter, type Partial, } from '@/tools/markdown/types'; -import { remarkAccordion } from '@/tools/remark/remarkAccordion.client'; import { remarkBase } from '@/tools/remark/remarkBase.client'; import { remarkCard } from '@/tools/remark/remarkCard.client'; import { remarkDecklist } from '@/tools/remark/remarkDecklist.client'; import { remarkRow } from '@/tools/remark/remarkRow.client'; +const COMPONENTS = { + a: Link, + blockquote: Quote, + code: Code, + h1: Heading<'h1'>, + h2: Heading<'h2'>, + h3: Heading<'h3'>, + h4: Heading<'h4'>, + h5: Heading<'h5'>, + h6: Heading<'h6'>, + hr: Divider, + img: Image, + // NOTE The `code` entries handle both block and inline code markup + pre: ({ children }) => <>{children}, + table: Table, + tbody: TableBody, + td: TableCell<'td'>, + th: TableCell<'th'>, + thead: TableHead, + tr: TableRow, +} as const satisfies Components; + +const COMPONENTS_EXTRA = { + accordion: Accordion, + card: Card, + decklist: Decklist, + mana: Mana, + row: Row, + soundcloud: Soundcloud, + spoiler: Spoiler, + spoils: SpoilsCalculator, + tweet: Tweet, + youtube: Youtube, +} as const; + type Props = { decklists: Decklists; markdown: Article | Chapter | Partial; @@ -28,7 +84,7 @@ type Props = { withWrapper?: boolean; }; -export const Remark: FunctionComponent = ({ +export const Markdown: FunctionComponent = ({ decklists, markdown, withScroll = true, @@ -43,7 +99,6 @@ export const Remark: FunctionComponent = ({ [remarkToc, { maxDepth: 3, ordered: true, tight: true }], // NOTE Our own remarkers remarkBase, - [remarkAccordion, { decklists }], remarkCard, [remarkDecklist, { decklists }], [remarkRow, { scries: markdown.scries }], @@ -51,13 +106,13 @@ export const Remark: FunctionComponent = ({ } as const satisfies Record; const children = ( - {markdown.text} - + ); useEffect(() => { diff --git a/src/components/Remark/renderers/RemarkAccordion.tsx b/src/components/Markdown/renderers/Accordion.tsx similarity index 59% rename from src/components/Remark/renderers/RemarkAccordion.tsx rename to src/components/Markdown/renderers/Accordion.tsx index 0e936971..c8ee5020 100644 --- a/src/components/Remark/renderers/RemarkAccordion.tsx +++ b/src/components/Markdown/renderers/Accordion.tsx @@ -1,62 +1,45 @@ import { mdiChevronDown } from '@mdi/js'; import { Icon } from '@mdi/react'; import { - Accordion, accordionClasses, - AccordionDetails, - AccordionSummary, alpha, + Accordion as MuiAccordion, + AccordionDetails as MuiAccordionDetails, + AccordionSummary as MuiAccordionSummary, } from '@mui/material'; import { - PropsWithChildren, type FunctionComponent, + type PropsWithChildren, type ReactNode, } from 'react'; -import { type ExtraProps } from 'react-markdown'; -import { type Decklists } from '@/tools/decklists/types'; - -type Props = ExtraProps & - PropsWithChildren & { - decklists?: Decklists; - }; - -export const RemarkAccordion: FunctionComponent = ({ +export const Accordion: FunctionComponent = ({ children, - decklists, - node, }) => { - if (!decklists) { - console.error('Missing decklists in accordion', node); - return null; - } - const [title, ...content] = Array.isArray(children) ? (children as ReactNode[]) : [children]; - return ( - ({ ...mixins.barf, borderBottom: 1, + borderBottomColor: 'divider', borderTop: 1, - borderColor: 'divider', - // NOTE Remove the default border for accordions within papers + borderTopColor: 'divider', '&:before': { display: 'none' }, - '& + &': { borderTop: 0 }, [`&.${accordionClasses.expanded}`]: { ...mixins.barf, my: 0 }, + '& + &': { borderTop: 0 }, })} > - } sx={({ mixins }) => mixins.gutters} > {title} - - + ({ ...mixins.gutters, bgcolor: alpha(palette.primary.light, 0.1), @@ -64,11 +47,11 @@ export const RemarkAccordion: FunctionComponent = ({ borderTopColor: 'divider', display: 'grid', gap: 3, - py: 2, + py: 3, })} > {content} - - + + ); }; diff --git a/src/components/Remark/renderers/RemarkCard.tsx b/src/components/Markdown/renderers/Card.tsx similarity index 81% rename from src/components/Remark/renderers/RemarkCard.tsx rename to src/components/Markdown/renderers/Card.tsx index 6f9c1f85..07602938 100644 --- a/src/components/Remark/renderers/RemarkCard.tsx +++ b/src/components/Markdown/renderers/Card.tsx @@ -9,7 +9,9 @@ type Props = ExtraProps & { name?: string; }; -export const RemarkCard: FunctionComponent = ({ name, node }) => { +// TODO Rename to `CardLink`? + +export const Card: FunctionComponent = ({ name, node }) => { if (!name) { console.error('Missing card name', node); return null; diff --git a/src/components/Remark/renderers/RemarkCode.tsx b/src/components/Markdown/renderers/Code.tsx similarity index 94% rename from src/components/Remark/renderers/RemarkCode.tsx rename to src/components/Markdown/renderers/Code.tsx index 47184464..7e3909e1 100644 --- a/src/components/Remark/renderers/RemarkCode.tsx +++ b/src/components/Markdown/renderers/Code.tsx @@ -1,6 +1,10 @@ import { Box, type PaletteMode } from '@mui/material'; import { alpha, useTheme } from '@mui/material/styles'; -import { FunctionComponent, PropsWithChildren, type Component } from 'react'; +import { + type Component, + type FunctionComponent, + type PropsWithChildren, +} from 'react'; import { type Components } from 'react-markdown'; import { Prism, type SyntaxHighlighterProps } from 'react-syntax-highlighter'; import { @@ -73,7 +77,7 @@ const CodeInline: FunctionComponent = ({ children }) => ( ); -export const RemarkCode: Components['code'] = ({ +export const Code: Components['code'] = ({ children, className = '', node, diff --git a/src/components/Remark/renderers/RemarkDecklist.tsx b/src/components/Markdown/renderers/Decklist.tsx similarity index 73% rename from src/components/Remark/renderers/RemarkDecklist.tsx rename to src/components/Markdown/renderers/Decklist.tsx index 0151a14a..d264112d 100644 --- a/src/components/Remark/renderers/RemarkDecklist.tsx +++ b/src/components/Markdown/renderers/Decklist.tsx @@ -1,7 +1,7 @@ import { type FunctionComponent } from 'react'; -import { ExtraProps } from 'react-markdown'; +import { type ExtraProps } from 'react-markdown'; -import { Decklist } from '@/components/Decklist/Decklist'; +import { Decklist as DecklistAccordion } from '@/components/Decklist/Decklist'; import { type DecklistExtra, type Decklist as DecklistModel, @@ -11,16 +11,13 @@ type Props = ExtraProps & { decklist?: DecklistModel & DecklistExtra; }; -export const RemarkDecklist: FunctionComponent = ({ - decklist, - node, -}) => { +export const Decklist: FunctionComponent = ({ decklist, node }) => { if (!decklist) { console.error('Missing card list in decklist', node); return null; } return ( - ( + ({ ...mixins.barf, my: 0 })} /> +); diff --git a/src/components/Remark/renderers/RemarkHeading.tsx b/src/components/Markdown/renderers/Heading.tsx similarity index 86% rename from src/components/Remark/renderers/RemarkHeading.tsx rename to src/components/Markdown/renderers/Heading.tsx index c1840f42..50cc59af 100644 --- a/src/components/Remark/renderers/RemarkHeading.tsx +++ b/src/components/Markdown/renderers/Heading.tsx @@ -2,9 +2,7 @@ import { Typography } from '@mui/material'; import { type ReactElement } from 'react'; import { type ExtraProps } from 'react-markdown'; -export const RemarkHeading = < - TLevel extends `h${1 | 2 | 3 | 4 | 5 | 6}` = never, ->({ +export const Heading = ({ children, id, node, diff --git a/src/components/Remark/renderers/RemarkImage.tsx b/src/components/Markdown/renderers/Image.tsx similarity index 91% rename from src/components/Remark/renderers/RemarkImage.tsx rename to src/components/Markdown/renderers/Image.tsx index 1e851272..048622f8 100644 --- a/src/components/Remark/renderers/RemarkImage.tsx +++ b/src/components/Markdown/renderers/Image.tsx @@ -1,7 +1,7 @@ import { Box, Typography } from '@mui/material'; import { type Components } from 'react-markdown'; -export const RemarkImage: Components['img'] = ({ alt, node, src, title }) => { +export const Image: Components['img'] = ({ alt, node, src, title }) => { if (!src) { console.error('Missing image source', node); return null; diff --git a/src/components/Markdown/renderers/Link.tsx b/src/components/Markdown/renderers/Link.tsx new file mode 100644 index 00000000..255cbb2b --- /dev/null +++ b/src/components/Markdown/renderers/Link.tsx @@ -0,0 +1,15 @@ +import { type Components } from 'react-markdown'; + +import { Link as Linkk } from '@/components/Link/Link'; + +export const Link: Components['a'] = ({ children, href, node }) => { + if (!href) { + console.error('Missing target for link', node); + return <>{children}; + } + return ( + + {children} + + ); +}; diff --git a/src/components/Remark/renderers/RemarkMana.tsx b/src/components/Markdown/renderers/Mana.tsx similarity index 62% rename from src/components/Remark/renderers/RemarkMana.tsx rename to src/components/Markdown/renderers/Mana.tsx index 2c16d224..8261cdc9 100644 --- a/src/components/Remark/renderers/RemarkMana.tsx +++ b/src/components/Markdown/renderers/Mana.tsx @@ -1,18 +1,14 @@ import { type FunctionComponent, type PropsWithChildren } from 'react'; import { type ExtraProps } from 'react-markdown'; -import { Mana } from '@/components/Mana/Mana'; +import { Mana as Manaa } from '@/components/Mana/Mana'; type Props = ExtraProps & PropsWithChildren & { pattern?: string }; -export const RemarkMana: FunctionComponent = ({ - children, - node, - pattern, -}) => { +export const Mana: FunctionComponent = ({ children, node, pattern }) => { if (!pattern) { console.error('Missing pattern in mana', node); return children; } - return ; + return ; }; diff --git a/src/components/Remark/renderers/RemarkQuote.tsx b/src/components/Markdown/renderers/Quote.tsx similarity index 90% rename from src/components/Remark/renderers/RemarkQuote.tsx rename to src/components/Markdown/renderers/Quote.tsx index 958e1583..722da43c 100644 --- a/src/components/Remark/renderers/RemarkQuote.tsx +++ b/src/components/Markdown/renderers/Quote.tsx @@ -1,7 +1,7 @@ import { Box } from '@mui/material'; import { type Components } from 'react-markdown'; -export const RemarkQuote: Components['blockquote'] = ({ children }) => ( +export const Quote: Components['blockquote'] = ({ children }) => ( = ({ node, row, variant }) => { +export const Row: FunctionComponent = ({ node, row, variant }) => { if (!row?.cards) { console.error('Missing cards for row', node); return null; diff --git a/src/components/Remark/renderers/RemarkSoundcloud.tsx b/src/components/Markdown/renderers/Soundcloud.tsx similarity index 90% rename from src/components/Remark/renderers/RemarkSoundcloud.tsx rename to src/components/Markdown/renderers/Soundcloud.tsx index c30e1eb6..c62bb0da 100644 --- a/src/components/Remark/renderers/RemarkSoundcloud.tsx +++ b/src/components/Markdown/renderers/Soundcloud.tsx @@ -6,7 +6,7 @@ type Props = ExtraProps & { url?: string; }; -export const RemarkSoundcloud: FunctionComponent = ({ node, url }) => { +export const Soundcloud: FunctionComponent = ({ node, url }) => { if (!url) { console.error('Missing URL for SoundCloud widget', node); return null; diff --git a/src/components/Remark/renderers/RemarkSpoiler.tsx b/src/components/Markdown/renderers/Spoiler.tsx similarity index 80% rename from src/components/Remark/renderers/RemarkSpoiler.tsx rename to src/components/Markdown/renderers/Spoiler.tsx index dd6b049f..2676f31d 100644 --- a/src/components/Remark/renderers/RemarkSpoiler.tsx +++ b/src/components/Markdown/renderers/Spoiler.tsx @@ -1,10 +1,14 @@ import { Box } from '@mui/material'; -import { PropsWithChildren, useState, type FunctionComponent } from 'react'; -import { ExtraProps } from 'react-markdown'; +import { + useState, + type FunctionComponent, + type PropsWithChildren, +} from 'react'; +import { type ExtraProps } from 'react-markdown'; type Props = PropsWithChildren & ExtraProps; -export const RemarkSpoiler: FunctionComponent = ({ children, node }) => { +export const Spoiler: FunctionComponent = ({ children, node }) => { const [isSpoiled, setIsSpoiled] = useState(false); if (!node?.position) return <>{children}; diff --git a/src/components/Markdown/renderers/Table.tsx b/src/components/Markdown/renderers/Table.tsx new file mode 100644 index 00000000..85caaf79 --- /dev/null +++ b/src/components/Markdown/renderers/Table.tsx @@ -0,0 +1,56 @@ +import { + Table as MuiTable, + TableBody as MuiTableBody, + TableCell as MuiTableCell, + TableContainer as MuiTableContainer, + TableHead as MuiTableHead, + TableRow as MuiTableRow, +} from '@mui/material'; +import { alpha } from '@mui/material/styles'; +import { type ReactElement } from 'react'; +import { type Components, type ExtraProps } from 'react-markdown'; + +export const Table: Components['table'] = ({ children }) => ( + ({ + ...mixins.barf, + borderTop: 1, + borderTopColor: 'divider', + overflowX: 'auto', + '& + &': { borderTop: 0 }, + })} + > + {children} + +); + +export const TableBody: Components['tbody'] = ({ children }) => ( + {children} +); + +export const TableCell = ({ + children, + style, +}: JSX.IntrinsicElements[T] & ExtraProps): ReactElement => ( + mixins.gutters, + style?.textAlign === 'left' && { whiteSpace: 'nowrap' }, + ]} + > + {children} + +); + +export const TableHead: Components['thead'] = ({ children }) => ( + alpha(palette.primary.light, 0.1) }} + > + {children} + +); + +export const TableRow: Components['tr'] = ({ children }) => ( + {children} +); diff --git a/src/components/Remark/renderers/RemarkTweet.tsx b/src/components/Markdown/renderers/Tweet.tsx similarity index 93% rename from src/components/Remark/renderers/RemarkTweet.tsx rename to src/components/Markdown/renderers/Tweet.tsx index fd98f44b..e3fc1324 100644 --- a/src/components/Remark/renderers/RemarkTweet.tsx +++ b/src/components/Markdown/renderers/Tweet.tsx @@ -1,8 +1,8 @@ import { Box, CircularProgress, Typography } from '@mui/material'; import Script from 'next/script'; -import { FunctionComponent, useRef, useState } from 'react'; +import { useRef, useState, type FunctionComponent } from 'react'; import { useInView } from 'react-intersection-observer'; -import { ExtraProps } from 'react-markdown'; +import { type ExtraProps } from 'react-markdown'; type CreateTweet = ( id: string, @@ -21,7 +21,7 @@ type Props = ExtraProps & { id?: string; }; -export const RemarkTweet: FunctionComponent = ({ id, node }) => { +export const Tweet: FunctionComponent = ({ id, node }) => { const [hasError, setHasError] = useState(false); const [height, setHeight] = useState(700); const [isLoading, setIsLoading] = useState(true); diff --git a/src/components/Remark/renderers/RemarkYoutube.tsx b/src/components/Markdown/renderers/Youtube.tsx similarity index 94% rename from src/components/Remark/renderers/RemarkYoutube.tsx rename to src/components/Markdown/renderers/Youtube.tsx index 96f38ce6..94148948 100644 --- a/src/components/Remark/renderers/RemarkYoutube.tsx +++ b/src/components/Markdown/renderers/Youtube.tsx @@ -16,7 +16,7 @@ type Props = ExtraProps & { id?: string; }; -export const RemarkYoutube: FunctionComponent = ({ id, node }) => { +export const Youtube: FunctionComponent = ({ id, node }) => { if (!id) { console.error('Missing ID for YouTube widget', node); return null; diff --git a/src/components/Markdown/renderers/index.ts b/src/components/Markdown/renderers/index.ts new file mode 100644 index 00000000..73f57154 --- /dev/null +++ b/src/components/Markdown/renderers/index.ts @@ -0,0 +1,16 @@ +export * from './Accordion'; +export * from './Card'; +export * from './Code'; +export * from './Decklist'; +export * from './Divider'; +export * from './Heading'; +export * from './Image'; +export * from './Link'; +export * from './Mana'; +export * from './Quote'; +export * from './Row'; +export * from './Soundcloud'; +export * from './Spoiler'; +export * from './Table'; +export * from './Tweet'; +export * from './Youtube'; diff --git a/src/components/Remark/constants.tsx b/src/components/Remark/constants.tsx deleted file mode 100644 index 9f88f8de..00000000 --- a/src/components/Remark/constants.tsx +++ /dev/null @@ -1,70 +0,0 @@ -import { type Components } from 'react-markdown'; - -import { RemarkAccordion } from '@/components/Remark/renderers/RemarkAccordion'; -import { RemarkCard } from '@/components/Remark/renderers/RemarkCard'; -import { RemarkCode } from '@/components/Remark/renderers/RemarkCode'; -import { RemarkDecklist } from '@/components/Remark/renderers/RemarkDecklist'; -import { RemarkDivider } from '@/components/Remark/renderers/RemarkDivider'; -import { RemarkHeading } from '@/components/Remark/renderers/RemarkHeading'; -import { RemarkImage } from '@/components/Remark/renderers/RemarkImage'; -import { RemarkLink } from '@/components/Remark/renderers/RemarkLink'; -import { - RemarkListOrdered, - RemarkListUnordered, -} from '@/components/Remark/renderers/RemarkList'; -import { RemarkMana } from '@/components/Remark/renderers/RemarkMana'; -import { RemarkParagraph } from '@/components/Remark/renderers/RemarkParagraph'; -import { RemarkQuote } from '@/components/Remark/renderers/RemarkQuote'; -import { RemarkRow } from '@/components/Remark/renderers/RemarkRow'; -import { RemarkSoundcloud } from '@/components/Remark/renderers/RemarkSoundcloud'; -import { RemarkSpoiler } from '@/components/Remark/renderers/RemarkSpoiler'; -import { - RemarkTable, - RemarkTableBody, - RemarkTableCell, - RemarkTableHead, - RemarkTableRow, -} from '@/components/Remark/renderers/RemarkTable'; -import { RemarkTweet } from '@/components/Remark/renderers/RemarkTweet'; -import { RemarkYoutube } from '@/components/Remark/renderers/RemarkYoutube'; -import { SpoilsCalculator } from '@/components/SpoilsCalculator/SpoilsCalculator'; - -export const COMPONENTS = - // prettier-ignore - { - a: RemarkLink, - blockquote: RemarkQuote, - code: RemarkCode, - h1: RemarkHeading<'h1'>, - h2: RemarkHeading<'h2'>, - h3: RemarkHeading<'h3'>, - h4: RemarkHeading<'h4'>, - h5: RemarkHeading<'h5'>, - h6: RemarkHeading<'h6'>, - hr: RemarkDivider, - img: RemarkImage, - ol: RemarkListOrdered, - p: RemarkParagraph, - // NOTE The `code` entries handle both block and inline code markup - pre: ({children}) => <>{children}, - table: RemarkTable, - tbody: RemarkTableBody, - td: RemarkTableCell<'td'>, - th: RemarkTableCell<'th'>, - thead: RemarkTableHead, - tr: RemarkTableRow, - ul: RemarkListUnordered, -} as const satisfies Components; - -export const COMPONENTS_EXTRA = { - accordion: RemarkAccordion, - card: RemarkCard, - decklist: RemarkDecklist, - mana: RemarkMana, - row: RemarkRow, - soundcloud: RemarkSoundcloud, - spoiler: RemarkSpoiler, - spoils: SpoilsCalculator, - tweet: RemarkTweet, - youtube: RemarkYoutube, -} as const; diff --git a/src/components/Remark/renderers/RemarkDivider.tsx b/src/components/Remark/renderers/RemarkDivider.tsx deleted file mode 100644 index 3b07d4e4..00000000 --- a/src/components/Remark/renderers/RemarkDivider.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import Divider from '@mui/material/Divider'; -import { Components } from 'react-markdown'; - -export const RemarkDivider: Components['hr'] = () => ( - ({ ...mixins.barf, my: 0 })} /> -); diff --git a/src/components/Remark/renderers/RemarkLink.tsx b/src/components/Remark/renderers/RemarkLink.tsx deleted file mode 100644 index 69e4b9cc..00000000 --- a/src/components/Remark/renderers/RemarkLink.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { type Components } from 'react-markdown'; - -import { Link } from '@/components/Link/Link'; - -export const RemarkLink: Components['a'] = ({ children, href, node }) => { - if (!href) { - console.error('Missing target for link', node); - return <>{children}; - } - return ( - - {children} - - ); -}; diff --git a/src/components/Remark/renderers/RemarkList.tsx b/src/components/Remark/renderers/RemarkList.tsx deleted file mode 100644 index 5e1f9652..00000000 --- a/src/components/Remark/renderers/RemarkList.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import Typography from '@mui/material/Typography'; -import { type Components } from 'react-markdown'; - -export const RemarkListOrdered: Components['ol'] = ({ children }) => ( - {children} -); - -export const RemarkListUnordered: Components['ul'] = ({ children }) => ( - {children} -); diff --git a/src/components/Remark/renderers/RemarkParagraph.tsx b/src/components/Remark/renderers/RemarkParagraph.tsx deleted file mode 100644 index 4362cedc..00000000 --- a/src/components/Remark/renderers/RemarkParagraph.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import Typography from '@mui/material/Typography'; -import { type Components } from 'react-markdown'; - -export const RemarkParagraph: Components['p'] = ({ children }) => ( - {children} -); diff --git a/src/components/Remark/renderers/RemarkTable.tsx b/src/components/Remark/renderers/RemarkTable.tsx deleted file mode 100644 index 0bf0810d..00000000 --- a/src/components/Remark/renderers/RemarkTable.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { - Table, - TableBody, - TableCell, - TableContainer, - TableHead, - TableRow, -} from '@mui/material'; -import { alpha } from '@mui/material/styles'; -import { ReactElement } from 'react'; -import { ExtraProps, type Components } from 'react-markdown'; - -export const RemarkTable: Components['table'] = ({ children }) => ( - ({ - ...mixins.barf, - borderTop: 1, - borderTopColor: 'divider', - overflowX: 'auto', - '& + &': { borderTop: 0 }, - })} - > - {children}
-
-); - -export const RemarkTableBody: Components['tbody'] = ({ children }) => ( - {children} -); - -export const RemarkTableCell = ({ - children, - style, -}: JSX.IntrinsicElements[T] & ExtraProps): ReactElement => ( - mixins.gutters, - style?.textAlign === 'left' && { whiteSpace: 'nowrap' }, - ]} - > - {children} - -); - -export const RemarkTableHead: Components['thead'] = ({ children }) => ( - alpha(palette.primary.light, 0.1) }} - > - {children} - -); - -export const RemarkTableRow: Components['tr'] = ({ children }) => ( - {children} -); diff --git a/src/components/Sidebar/Sidebar.tsx b/src/components/Sidebar/Sidebar.tsx index ebb47817..c5d7e6df 100644 --- a/src/components/Sidebar/Sidebar.tsx +++ b/src/components/Sidebar/Sidebar.tsx @@ -3,8 +3,8 @@ import { Divider, Drawer, drawerClasses, - DrawerProps, List, + type DrawerProps, } from '@mui/material'; import { ThemeProvider as MuiThemeProvider, diff --git a/src/components/Sidebar/SidebarEntry.tsx b/src/components/Sidebar/SidebarEntry.tsx index f1a30b0b..b86f8abf 100644 --- a/src/components/Sidebar/SidebarEntry.tsx +++ b/src/components/Sidebar/SidebarEntry.tsx @@ -16,7 +16,7 @@ import { type FunctionComponent, } from 'react'; -import { Category } from '@/tools/markdown/constants/Category'; +import { type Category } from '@/tools/markdown/constants/Category'; import { type ChapterCard, type MenuEntry } from '@/tools/markdown/types'; type Props = Omit & { diff --git a/src/components/Sidebar/SidebarHeader.tsx b/src/components/Sidebar/SidebarHeader.tsx index c0912cda..05c780aa 100644 --- a/src/components/Sidebar/SidebarHeader.tsx +++ b/src/components/Sidebar/SidebarHeader.tsx @@ -4,7 +4,7 @@ import { Box, Button, IconButton, Toolbar, Tooltip } from '@mui/material'; import { type Theme } from '@mui/material/styles'; import { type SxProps } from '@mui/system'; import NextLink from 'next/link'; -import { FunctionComponent, useContext } from 'react'; +import { useContext, type FunctionComponent } from 'react'; import { siDiscord } from 'simple-icons'; import { ThemeContext } from '@/theme/ThemeContext'; diff --git a/src/components/SpoilsCalculator/SpoilsCalculator.tsx b/src/components/SpoilsCalculator/SpoilsCalculator.tsx index 728d9732..e1017994 100644 --- a/src/components/SpoilsCalculator/SpoilsCalculator.tsx +++ b/src/components/SpoilsCalculator/SpoilsCalculator.tsx @@ -16,7 +16,12 @@ import { Tooltip, Typography, } from '@mui/material'; -import { ChangeEvent, FunctionComponent, useEffect, useState } from 'react'; +import { + useEffect, + useState, + type ChangeEvent, + type FunctionComponent, +} from 'react'; type Input = { copies: number; diff --git a/src/pages/404.tsx b/src/pages/404.tsx index 07e0dd77..94f9a810 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -1,5 +1,5 @@ import { Box } from '@mui/material'; -import { GetStaticProps, NextPage } from 'next'; +import { type GetStaticProps, type NextPage } from 'next'; import { Layout } from '@/components/Layout/Layout'; import { getMenu } from '@/tools/markdown/getMenu'; diff --git a/src/pages/[category]/[chapter].tsx b/src/pages/[category]/[chapter].tsx index 21b4b09d..5f70d5c9 100644 --- a/src/pages/[category]/[chapter].tsx +++ b/src/pages/[category]/[chapter].tsx @@ -1,4 +1,4 @@ -import { ParsedUrlQuery } from 'querystring'; +import { type ParsedUrlQuery } from 'querystring'; import { Card, CardContent } from '@mui/material'; import { type GetStaticPaths, @@ -9,7 +9,7 @@ import { import { Banner } from '@/components/Banner/Banner'; import { Layout } from '@/components/Layout/Layout'; -import { Remark } from '@/components/Remark/Remark'; +import { Markdown } from '@/components/Markdown/Markdown'; import { getDecklists } from '@/tools/decklists/getDecklists'; import { type Decklists } from '@/tools/decklists/types'; import { getChapterCards } from '@/tools/markdown/getChapterCards'; @@ -32,7 +32,7 @@ const ChapterPage: NextPage = ({ chapter, decklists, menu }) => ( - + diff --git a/src/pages/articles.tsx b/src/pages/articles.tsx index dc210aa9..d2c79314 100644 --- a/src/pages/articles.tsx +++ b/src/pages/articles.tsx @@ -5,7 +5,7 @@ import { ListItemText, Typography, } from '@mui/material'; -import { GetStaticProps, NextPage } from 'next'; +import { type GetStaticProps, type NextPage } from 'next'; import NextLink from 'next/link'; import { ArticleMeta } from '@/components/ArticleMeta/ArticleMeta'; diff --git a/src/pages/articles/[year]/[month]/[day]/[article].tsx b/src/pages/articles/[year]/[month]/[day]/[article].tsx index ae7ae674..8cec7a25 100644 --- a/src/pages/articles/[year]/[month]/[day]/[article].tsx +++ b/src/pages/articles/[year]/[month]/[day]/[article].tsx @@ -1,4 +1,4 @@ -import { ParsedUrlQuery } from 'querystring'; +import { type ParsedUrlQuery } from 'querystring'; import { Card, CardContent, Divider } from '@mui/material'; import { type GetStaticPaths, @@ -9,7 +9,7 @@ import { import { Banner } from '@/components/Banner/Banner'; import { Layout } from '@/components/Layout/Layout'; -import { Remark } from '@/components/Remark/Remark'; +import { Markdown } from '@/components/Markdown/Markdown'; import { getDecklists } from '@/tools/decklists/getDecklists'; import { type Decklists } from '@/tools/decklists/types'; import { getArticleCards } from '@/tools/markdown/getArticleCards'; @@ -41,11 +41,11 @@ const ArticlePage: NextPage = ({ article, decklists, footer, menu }) => ( title={article.matter.title} /> - + - + diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 980dc727..ad84fab4 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,10 +1,10 @@ import { Button, ButtonGroup, Card, CardContent, Grid } from '@mui/material'; -import { GetStaticProps, NextPage } from 'next'; +import { type GetStaticProps, type NextPage } from 'next'; import { useEffect, useRef, useState } from 'react'; import { ArticleCard } from '@/components/ArticleCard/ArticleCard'; import { Layout } from '@/components/Layout/Layout'; -import { Remark } from '@/components/Remark/Remark'; +import { Markdown } from '@/components/Markdown/Markdown'; import { getDecklists } from '@/tools/decklists/getDecklists'; import { type Decklists } from '@/tools/decklists/types'; import { getArticleCards } from '@/tools/markdown/getArticleCards'; @@ -49,7 +49,7 @@ const HomePage: NextPage = ({ articles, decklists, menu, welcome }) => { - + diff --git a/src/pages/license.tsx b/src/pages/license.tsx index 6995bf87..0c1c375c 100644 --- a/src/pages/license.tsx +++ b/src/pages/license.tsx @@ -1,10 +1,8 @@ -import Card from '@mui/material/Card'; -import CardContent from '@mui/material/CardContent'; -import Typography from '@mui/material/Typography'; -import { GetStaticProps, NextPage } from 'next'; +import { Card, CardContent, Typography } from '@mui/material'; +import { type GetStaticProps, type NextPage } from 'next'; import { Layout } from '@/components/Layout/Layout'; -import { Remark } from '@/components/Remark/Remark'; +import { Markdown } from '@/components/Markdown/Markdown'; import { getDecklists } from '@/tools/decklists/getDecklists'; import { type Decklists } from '@/tools/decklists/types'; import { getPartial } from '@/tools/markdown/getMarkdown'; @@ -24,7 +22,7 @@ const LicensePage: NextPage = ({ decklists, license, menu }) => ( License - + diff --git a/src/pages/sandbox/index.tsx b/src/pages/sandbox/index.tsx index c2d7e240..557ba97a 100644 --- a/src/pages/sandbox/index.tsx +++ b/src/pages/sandbox/index.tsx @@ -7,7 +7,7 @@ import { Typography, } from '@mui/material'; import { Stack } from '@mui/system'; -import { GetStaticProps, NextPage } from 'next'; +import { type GetStaticProps, type NextPage } from 'next'; import { useEffect, useState, type ChangeEvent } from 'react'; import { Layout } from '@/components/Layout/Layout'; diff --git a/src/pages/sandbox/markdown.tsx b/src/pages/sandbox/markdown.tsx index 04d5303f..2c8cda05 100644 --- a/src/pages/sandbox/markdown.tsx +++ b/src/pages/sandbox/markdown.tsx @@ -1,10 +1,10 @@ import { Card, CardContent } from '@mui/material'; -import { GetStaticProps, NextPage } from 'next'; +import { type GetStaticProps, type NextPage } from 'next'; import { Layout } from '@/components/Layout/Layout'; -import { Remark } from '@/components/Remark/Remark'; +import { Markdown } from '@/components/Markdown/Markdown'; import { getDecklists } from '@/tools/decklists/getDecklists'; -import { Decklists } from '@/tools/decklists/types'; +import { type Decklists } from '@/tools/decklists/types'; import { getPartial } from '@/tools/markdown/getMarkdown'; import { getMenu } from '@/tools/markdown/getMenu'; import { type MenuEntry, type Partial } from '@/tools/markdown/types'; @@ -19,7 +19,7 @@ const Page: NextPage = ({ decklists, markdown, menu }) => ( - + diff --git a/src/theme/ThemeContext.tsx b/src/theme/ThemeContext.tsx index 5281ac06..3e8a086a 100644 --- a/src/theme/ThemeContext.tsx +++ b/src/theme/ThemeContext.tsx @@ -28,9 +28,7 @@ export const ThemeProvider: FunctionComponent = ({ }) => { const [isDark, setIsDark] = useState(initial.isDark); - const toggle = () => { - setIsDark((previous) => !previous); - }; + const toggle = () => setIsDark((previous) => !previous); useEffect(() => { if (isDark !== null) { diff --git a/src/theme/constants.ts b/src/theme/constants.ts index 99de24f0..af7353a3 100644 --- a/src/theme/constants.ts +++ b/src/theme/constants.ts @@ -1,6 +1,7 @@ export const THEME_STORAGE_KEY = 'ddftwiki:theme'; export enum Theme { + // TODO Migrate to a union of strings DARK = 'dark', LIGHT = 'light', } diff --git a/src/theme/theme.ts b/src/theme/theme.ts index be992de3..e421ed06 100644 --- a/src/theme/theme.ts +++ b/src/theme/theme.ts @@ -112,7 +112,7 @@ const customizeTheme = (options: ThemeOptions): Theme => { scrollBehavior: 'smooth', scrollPadding: spacing(2), }, - blockquote: { margin: 0 }, + 'blockquote, ol, p, pre, ul': { margin: 0 }, em: { fontDisplay: 'swap', fontFamily: 'Libre Baskerville, serif', diff --git a/src/tools/markdown/constants/Category.ts b/src/tools/markdown/constants/Category.ts index d13d90db..0961dfe1 100644 --- a/src/tools/markdown/constants/Category.ts +++ b/src/tools/markdown/constants/Category.ts @@ -1,4 +1,5 @@ export enum Category { + // TODO Migrate to a union of strings APPENDICES = 'appendices', DDEFT = 'ddeft', DDFT = 'ddft', diff --git a/src/tools/markdown/constants/Kind.ts b/src/tools/markdown/constants/Kind.ts index ad6061c7..fc5592ec 100644 --- a/src/tools/markdown/constants/Kind.ts +++ b/src/tools/markdown/constants/Kind.ts @@ -1,4 +1,5 @@ export enum Kind { + // TODO Migrate to a union of strings ARTICLE = 'article', PRIMER = 'primer', REPORT = 'report', diff --git a/src/tools/markdown/constants/Tag.ts b/src/tools/markdown/constants/Tag.ts index bf21ad2e..651bc0fe 100644 --- a/src/tools/markdown/constants/Tag.ts +++ b/src/tools/markdown/constants/Tag.ts @@ -1,4 +1,5 @@ export enum Tag { + // TODO Migrate to a union of strings DDEFT = 'DDEFT', DDFT = 'DDFT', LEGACY = 'LEGACY', diff --git a/src/tools/markdown/types.ts b/src/tools/markdown/types.ts index 2dbee23f..cb2e5a36 100644 --- a/src/tools/markdown/types.ts +++ b/src/tools/markdown/types.ts @@ -1,4 +1,4 @@ -import { Category } from '@/tools/markdown/constants/Category'; +import { type Category } from '@/tools/markdown/constants/Category'; import { type Kind } from '@/tools/markdown/constants/Kind'; import { type Tag } from '@/tools/markdown/constants/Tag'; import { type Scries } from '@/tools/scryfall/types'; diff --git a/src/tools/remark/remarkAccordion.client.ts b/src/tools/remark/remarkAccordion.client.ts deleted file mode 100644 index d3974f25..00000000 --- a/src/tools/remark/remarkAccordion.client.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { hastify } from '@korumite/kiwi/client'; -import { type ContainerDirective } from 'mdast-util-directive'; -import { type Node } from 'unist'; -import { Test, visit } from 'unist-util-visit'; - -import { type Decklists } from '@/tools/decklists/types'; -import { Remarker } from '@/tools/remark/typings'; - -/** - * Augment accordion tree with data necessary to render the collapsible - * components. - */ -export const remarkAccordion: Remarker<[{ decklists: Decklists }]> = - ({ decklists }) => - (tree) => { - const tests = [{ name: 'accordion', type: 'containerDirective' }]; - visit(tree, tests, (node) => { - const directive = node as ContainerDirective; - const { column: c, line: l } = directive.position?.start ?? {}; - const location = `for accordion at ${l}:${c}`; - if (!directive.children.length) { - console.error(`[remark] Missing title ${location}`); - } else if (directive.children.length === 1) { - console.error(`[remark] Missing content ${location}`); - } else { - hastify(directive, { decklists }); - } - }); - return tree; - }; diff --git a/src/tools/remark/remarkBase.client.ts b/src/tools/remark/remarkBase.client.ts index 124140ea..7daac1d8 100644 --- a/src/tools/remark/remarkBase.client.ts +++ b/src/tools/remark/remarkBase.client.ts @@ -1,9 +1,9 @@ import { hastify } from '@korumite/kiwi/client'; import { type Directives } from 'mdast-util-directive'; import { type Node } from 'unist'; -import { Test, visit } from 'unist-util-visit'; +import { visit, type Test } from 'unist-util-visit'; -import { Remarker } from '@/tools/remark/typings'; +import { type Remarker } from '@/tools/remark/typings'; /** Preliminary visit to mark directives by name for future remarkers. */ export const remarkBase: Remarker = () => (tree) => { diff --git a/src/tools/remark/remarkCard.client.ts b/src/tools/remark/remarkCard.client.ts index cd521b1e..394a8dae 100644 --- a/src/tools/remark/remarkCard.client.ts +++ b/src/tools/remark/remarkCard.client.ts @@ -3,7 +3,7 @@ import { type Text } from 'mdast'; import { type TextDirective } from 'mdast-util-directive'; import { type Node } from 'unist'; import { select } from 'unist-util-select'; -import { Test, visit } from 'unist-util-visit'; +import { visit, type Test } from 'unist-util-visit'; import { getCard } from '@/tools/game/getCard'; import { type Remarker } from '@/tools/remark/typings'; diff --git a/src/tools/remark/remarkDecklist.client.ts b/src/tools/remark/remarkDecklist.client.ts index f7322ada..5fb2d30c 100644 --- a/src/tools/remark/remarkDecklist.client.ts +++ b/src/tools/remark/remarkDecklist.client.ts @@ -1,7 +1,7 @@ import { hastify } from '@korumite/kiwi/client'; import { type LeafDirective } from 'mdast-util-directive'; import { type Node } from 'unist'; -import { Test, visit } from 'unist-util-visit'; +import { visit, type Test } from 'unist-util-visit'; import { type Decklists } from '@/tools/decklists/types'; import { type Remarker } from '@/tools/remark/typings'; diff --git a/src/tools/remark/remarkRow.client.ts b/src/tools/remark/remarkRow.client.ts index 20a10d8b..def71b27 100644 --- a/src/tools/remark/remarkRow.client.ts +++ b/src/tools/remark/remarkRow.client.ts @@ -3,7 +3,7 @@ import { type Text } from 'mdast'; import { type ContainerDirective } from 'mdast-util-directive'; import { type Node } from 'unist'; import { select } from 'unist-util-select'; -import { Test, visit } from 'unist-util-visit'; +import { visit, type Test } from 'unist-util-visit'; import { type Remarker } from '@/tools/remark/typings'; import { type Scries } from '@/tools/scryfall/types'; diff --git a/src/tools/remark/remarkScries.server.ts b/src/tools/remark/remarkScries.server.ts index 0cb16bb1..ab9a9900 100644 --- a/src/tools/remark/remarkScries.server.ts +++ b/src/tools/remark/remarkScries.server.ts @@ -3,7 +3,7 @@ import { type ContainerDirective } from 'mdast-util-directive'; import { type Plugin } from 'unified'; import { type Node } from 'unist'; import { select } from 'unist-util-select'; -import { Test, visit } from 'unist-util-visit'; +import { visit, type Test } from 'unist-util-visit'; import { readFaces } from '@/tools/scryfall/read'; import { scry } from '@/tools/scryfall/scry'; diff --git a/src/tools/scryfall/read.ts b/src/tools/scryfall/read.ts index f9645859..aeda1ffd 100644 --- a/src/tools/scryfall/read.ts +++ b/src/tools/scryfall/read.ts @@ -1,9 +1,9 @@ import { parse } from '@/tools/scryfall/parse'; import { - ScryCard, - ScryData, - ScryDataItem, - ScryDataList, + type ScryCard, + type ScryData, + type ScryDataItem, + type ScryDataList, } from '@/tools/scryfall/types'; /** Data can contain a list of objects in case of non-deterministic searches. */