From 860b9b9965631f90de5694ce6c19a7698474a2e9 Mon Sep 17 00:00:00 2001 From: HonzaTuron Date: Fri, 22 Aug 2025 10:50:56 +0200 Subject: [PATCH 1/2] fix: Move LLMButtons component to theme --- .../src/theme}/LLMButtons/CopyForLLM/index.tsx | 9 +++++---- .../src/theme}/LLMButtons/ViewAsMarkdown/index.tsx | 0 .../src/theme}/LLMButtons/index.tsx | 0 .../src/theme}/LLMButtons/styles.module.css | 0 apify-docs-theme/src/theme/MDXComponents/index.js | 2 +- package-lock.json | 2 +- src/theme/DocItem/Content/index.js | 3 +-- 7 files changed, 8 insertions(+), 8 deletions(-) rename {src/components => apify-docs-theme/src/theme}/LLMButtons/CopyForLLM/index.tsx (92%) rename {src/components => apify-docs-theme/src/theme}/LLMButtons/ViewAsMarkdown/index.tsx (100%) rename {src/components => apify-docs-theme/src/theme}/LLMButtons/index.tsx (100%) rename {src/components => apify-docs-theme/src/theme}/LLMButtons/styles.module.css (100%) diff --git a/src/components/LLMButtons/CopyForLLM/index.tsx b/apify-docs-theme/src/theme/LLMButtons/CopyForLLM/index.tsx similarity index 92% rename from src/components/LLMButtons/CopyForLLM/index.tsx rename to apify-docs-theme/src/theme/LLMButtons/CopyForLLM/index.tsx index 94dbc578c2..3d59643f46 100644 --- a/src/components/LLMButtons/CopyForLLM/index.tsx +++ b/apify-docs-theme/src/theme/LLMButtons/CopyForLLM/index.tsx @@ -1,16 +1,17 @@ -import React, { useState } from 'react'; +import type React from 'react'; +import { useState } from 'react'; import styles from '../styles.module.css'; // Custom component for button text function ButtonText({ isLoading, isCopied }: { isLoading: boolean; isCopied: boolean }) { if (isLoading) { - return <>Copying...; + return 'Copying...'; } if (isCopied) { - return <>Copied!; + return 'Copied!'; } - return <>Copy for LLM; + return 'Copy for LLM'; } export default function CopyForLLM() { diff --git a/src/components/LLMButtons/ViewAsMarkdown/index.tsx b/apify-docs-theme/src/theme/LLMButtons/ViewAsMarkdown/index.tsx similarity index 100% rename from src/components/LLMButtons/ViewAsMarkdown/index.tsx rename to apify-docs-theme/src/theme/LLMButtons/ViewAsMarkdown/index.tsx diff --git a/src/components/LLMButtons/index.tsx b/apify-docs-theme/src/theme/LLMButtons/index.tsx similarity index 100% rename from src/components/LLMButtons/index.tsx rename to apify-docs-theme/src/theme/LLMButtons/index.tsx diff --git a/src/components/LLMButtons/styles.module.css b/apify-docs-theme/src/theme/LLMButtons/styles.module.css similarity index 100% rename from src/components/LLMButtons/styles.module.css rename to apify-docs-theme/src/theme/LLMButtons/styles.module.css diff --git a/apify-docs-theme/src/theme/MDXComponents/index.js b/apify-docs-theme/src/theme/MDXComponents/index.js index dd24cd8770..70e23984c4 100644 --- a/apify-docs-theme/src/theme/MDXComponents/index.js +++ b/apify-docs-theme/src/theme/MDXComponents/index.js @@ -1,5 +1,5 @@ -import LLMButtons from '@site/src/components/LLMButtons'; import Admonition from '@theme/Admonition'; +import LLMButtons from '@theme/LLMButtons'; import MDXA from '@theme/MDXComponents/A'; import MDXCode from '@theme/MDXComponents/Code'; import MDXDetails from '@theme/MDXComponents/Details'; diff --git a/package-lock.json b/package-lock.json index f5ef6ded04..bba74baa27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -74,7 +74,7 @@ }, "apify-docs-theme": { "name": "@apify/docs-theme", - "version": "1.0.198", + "version": "1.0.199", "license": "ISC", "dependencies": { "@apify/docs-search-modal": "^1.2.2", diff --git a/src/theme/DocItem/Content/index.js b/src/theme/DocItem/Content/index.js index 14855855b6..2d773b6f18 100644 --- a/src/theme/DocItem/Content/index.js +++ b/src/theme/DocItem/Content/index.js @@ -2,12 +2,11 @@ import { useDoc } from '@docusaurus/plugin-content-docs/client'; import { useLocation } from '@docusaurus/router'; import { ThemeClassNames } from '@docusaurus/theme-common'; import Heading from '@theme/Heading'; +import LLMButtons from '@theme/LLMButtons'; import MDXContent from '@theme/MDXContent'; import clsx from 'clsx'; import React from 'react'; -import LLMButtons from '../../../components/LLMButtons'; - function useSyntheticTitle() { const { metadata, frontMatter, contentTitle } = useDoc(); const shouldRender = !frontMatter.hide_title && typeof contentTitle === 'undefined'; From c4f192cefe49b75930479362c3172b003ca901f1 Mon Sep 17 00:00:00 2001 From: HonzaTuron Date: Fri, 22 Aug 2025 11:01:11 +0200 Subject: [PATCH 2/2] fix: Add docs theme to eslint tsconfig --- tsconfig.eslint.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index 598944479f..f095088fb0 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -6,6 +6,7 @@ "src/**/*.js", "src/**/*.ts", "src/**/*.jsx", - "src/**/*.tsx" + "src/**/*.tsx", + "apify-docs-theme/**/*.tsx" ] }