Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Docusaurus 3.7.0 #203

Merged
merged 6 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,240 changes: 2,155 additions & 2,085 deletions package-lock.json

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,40 @@
"fix-lint": "npm run lint -- --fix"
},
"dependencies": {
"@docusaurus/core": "^3.6.3",
"@docusaurus/faster": "^3.6.3",
"@docusaurus/plugin-client-redirects": "^3.6.3",
"@docusaurus/preset-classic": "^3.6.3",
"@docusaurus/core": "^3.7.0",
"@docusaurus/faster": "^3.7.0",
"@docusaurus/plugin-client-redirects": "^3.7.0",
"@docusaurus/preset-classic": "^3.7.0",
"@mdx-js/react": "^3.1.0",
"@webcoder49/code-input": "^2.2.1",
"clsx": "^2.1.1",
"docusaurus-plugin-openapi-docs": "^4.3.0",
"docusaurus-theme-openapi-docs": "^4.3.0",
"docusaurus-plugin-openapi-docs": "^4.3.3",
"docusaurus-theme-openapi-docs": "^4.3.3",
"prism-react-renderer": "^2.4.1",
"prismjs": "^1.29.0",
"react": "^18.3.1",
"react-aria-components": "^1.5.0",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-aria-components": "^1.6.0",
"react-dom": "^19.0.0",
"url": "^0.11.4"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.6.3",
"@docusaurus/tsconfig": "^3.6.3",
"@docusaurus/types": "^3.6.3",
"@docusaurus/module-type-aliases": "^3.7.0",
"@docusaurus/tsconfig": "^3.7.0",
"@docusaurus/types": "^3.7.0",
"@eslint/js": "^9.15.0",
"dotenv": "^16.4.7",
"eslint": "^9.17.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-compiler": "19.0.0-beta-201e55d-20241215",
"eslint": "^9.19.0",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-compiler": "19.0.0-beta-714736e-20250131",
"eslint-plugin-react-hooks": "^5.1.0",
"exports-loader": "^5.0.0",
"globals": "^15.13.0",
"globals": "^15.14.0",
"imports-loader": "^5.0.0",
"prettier": "^3.4.2",
"raw-loader": "^4.0.2",
"serve-handler": "^6.1.6",
"typescript": "^5.7.2",
"typescript-eslint": "^8.18.1",
"typescript": "^5.7.3",
"typescript-eslint": "^8.23.0",
"unist-util-visit": "^5.0.0"
},
"overrides": {
Expand Down
38 changes: 20 additions & 18 deletions src/theme/DocCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { type ReactNode } from 'react';
import clsx from 'clsx';
import Link from '@docusaurus/Link';
import { findFirstSidebarItemLink, useDocById } from '@docusaurus/plugin-content-docs/client';
import { usePluralForm } from '@docusaurus/theme-common';
import isInternalUrl from '@docusaurus/isInternalUrl';
import { translate } from '@docusaurus/Translate';
import type { Props } from '@theme/DocCard';
Expand All @@ -10,6 +11,22 @@ import Heading from '@theme/Heading';
import Icon from '@site/src/components/Icon';
import styles from './styles.module.css';

function useCategoryItemsPlural() {
const { selectMessage } = usePluralForm();
return (count: number) =>
selectMessage(
count,
translate(
{
message: '1 item|{count} items',
id: 'theme.docs.DocCard.categoryDescription.plurals',
description: 'The default description for a category card in the generated index about how many items this category includes',
},
{ count }
)
);
}

function CardContainer({ href, children }: { href: string; children: ReactNode }) {
return (
<Link href={href} className={clsx('card padding--lg', styles.cardContainer)}>
Expand Down Expand Up @@ -45,28 +62,13 @@ function CardIcon({ item, defaultIcon }: SidebarItemCardIconProps): JSX.Element
function CardCategory({ item }: { item: PropSidebarItemCategory }) {
const icon = <CardIcon item={item} defaultIcon="🗃️" />;
const href = findFirstSidebarItemLink(item);
const categoryItemsPlural = useCategoryItemsPlural();

// Unexpected: categories that don't have a link have been filtered upfront
if (!href) {
return null;
}
return (
<CardLayout
href={href}
icon={icon}
title={item.label}
description={
item.description ??
translate(
{
message: '{count} items',
id: 'theme.docs.DocCard.categoryDescription',
description: 'The default description for a category card in the generated index about how many items this category includes',
},
{ count: item.items.length }
)
}
/>
);
return <CardLayout href={href} icon={icon} title={item.label} description={item.description ?? categoryItemsPlural(item.items.length)} />;
}

function CardLink({ item }: { item: PropSidebarItemLink }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ If you just installed Cocoapods or are already up-to-date, then this step can be

Add `pod 'THEOplayerSDK-core', '~> 5'` similar to the following to your Podfile:

```swift
```ruby
target 'MyApp' do
pod 'THEOplayerSDK-core', '~> 5'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and the changes needed in your code.

Update THEOplayer iOS/tvOS SDK to version 8 in your Podfile:

```swift
```ruby
target 'MyApp' do
pod 'THEOplayerSDK-core', '~> 8'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ If you just installed Cocoapods or are already up-to-date, then this step can be

Add `pod 'THEOplayerSDK-core', '~> 5'` similar to the following to your Podfile:

```swift
```ruby
target 'MyApp' do
pod 'THEOplayerSDK-core', '~> 5'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ If you just installed Cocoapods or are already up-to-date, then this step can be

Add `pod 'THEOplayerSDK-core', '~> 5'` similar to the following to your Podfile:

```swift
```ruby
target 'MyApp' do
pod 'THEOplayerSDK-core', '~> 5'
end
Expand Down