@apify/docs-theme 1.0.244 → 1.0.245
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/package.json +48 -48
- package/src/config.js +1 -3
- package/src/markdown.js +8 -6
- package/src/roa-loader/index.js +16 -14
- package/src/theme/ColorModeToggle/index.jsx +14 -27
- package/src/theme/DocBreadcrumbs/Items/Home/index.js +2 -1
- package/src/theme/DocBreadcrumbs/index.js +10 -20
- package/src/theme/DocItemContent/index.js +42 -43
- package/src/theme/DocItemContent/styles.module.css +1 -3
- package/src/theme/DocSidebarItem/Category/index.js +36 -54
- package/src/theme/DocSidebarItem/Link/index.jsx +9 -23
- package/src/theme/DocSidebarItem/Link/styles.module.css +1 -1
- package/src/theme/Footer/LinkItem/index.js +7 -12
- package/src/theme/Footer/index.jsx +2 -3
- package/src/theme/Heading/index.jsx +3 -4
- package/src/theme/Heading/styles.module.css +23 -23
- package/src/theme/Icon/DarkMode/index.jsx +7 -1
- package/src/theme/Icon/LightMode/index.jsx +28 -10
- package/src/theme/LLMButtons/index.jsx +7 -37
- package/src/theme/Layout/index.jsx +10 -9
- package/src/theme/Logo/index.js +3 -16
- package/src/theme/MDXComponents/A.js +11 -6
- package/src/theme/MDXComponents/Code.js +3 -2
- package/src/theme/MDXComponents/Details.js +1 -3
- package/src/theme/MDXComponents/Head.js +2 -1
- package/src/theme/MDXComponents/Img/index.js +1 -7
- package/src/theme/MDXComponents/Img/styles.module.css +1 -1
- package/src/theme/MDXComponents/Ul/index.js +1 -1
- package/src/theme/MDXComponents/Ul/styles.module.css +2 -2
- package/src/theme/Navbar/CTA/index.jsx +3 -1
- package/src/theme/Navbar/CTA/styles.module.css +45 -45
- package/src/theme/Navbar/Content/index.jsx +29 -28
- package/src/theme/Navbar/MobileSidebar/Header/index.jsx +3 -1
- package/src/theme/Navbar/MobileSidebar/PrimaryMenu/index.jsx +15 -29
- package/src/theme/NavbarItem/ComponentTypes.jsx +3 -22
- package/src/theme/NavbarItem/NavbarNavLink.jsx +28 -24
- package/src/theme/NotFound.jsx +2 -6
- package/src/theme/RunnableCodeBlock/RunnableCodeBlock.jsx +43 -9
- package/src/theme/SearchBar/index.js +21 -21
- package/src/theme/SearchBar/styles.css +84 -83
- package/src/theme/SearchMetadata/index.js +8 -8
- package/src/theme/SearchPage/index.js +173 -230
- package/src/theme/SearchPage/styles.module.css +59 -59
- package/src/theme/TOCItems/Tree.jsx +2 -12
- package/src/theme/TOCItems/index.jsx +2 -12
- package/src/theme/custom.css +73 -75
- package/src/theme.js +15 -19
- package/src/utils.js +1 -5
- package/static/js/custom.js +7 -5
package/src/theme.js
CHANGED
|
@@ -50,9 +50,11 @@ function copyChangelogFromRoot(paths, hasDefaultChangelog, { displayedSidebar }
|
|
|
50
50
|
for (const docsPath of paths) {
|
|
51
51
|
const targetChangelogPath = path.join(docsPath, 'changelog.md');
|
|
52
52
|
|
|
53
|
-
if (
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
if (
|
|
54
|
+
fs.existsSync(targetChangelogPath) &&
|
|
55
|
+
fs.statSync(targetChangelogPath).mtime >= fs.statSync(sourceChangelogPath).mtime &&
|
|
56
|
+
!hasDefaultChangelog.get(docsPath)
|
|
57
|
+
) {
|
|
56
58
|
continue;
|
|
57
59
|
}
|
|
58
60
|
|
|
@@ -61,10 +63,7 @@ function copyChangelogFromRoot(paths, hasDefaultChangelog, { displayedSidebar }
|
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
65
|
|
|
64
|
-
function theme(
|
|
65
|
-
context,
|
|
66
|
-
options,
|
|
67
|
-
) {
|
|
66
|
+
function theme(context, options) {
|
|
68
67
|
return {
|
|
69
68
|
name: '@apify/docs-theme',
|
|
70
69
|
getPathsToWatch() {
|
|
@@ -81,28 +80,27 @@ function theme(
|
|
|
81
80
|
const versioned = findPathInParent('website/versioned_docs');
|
|
82
81
|
const pathsToCopyChangelog = [
|
|
83
82
|
findPathInParentOrThrow('docs'),
|
|
84
|
-
...(versioned
|
|
85
|
-
? fs.readdirSync(versioned).map((version) => path.join(versioned, version))
|
|
86
|
-
: []
|
|
87
|
-
),
|
|
83
|
+
...(versioned ? fs.readdirSync(versioned).map((version) => path.join(versioned, version)) : []),
|
|
88
84
|
];
|
|
89
85
|
|
|
90
86
|
const { changelogDisplayedSidebar: displayedSidebar } = options;
|
|
91
|
-
const displayedSidebarLine =
|
|
92
|
-
? `displayed_sidebar: ${displayedSidebar}\n`
|
|
93
|
-
: '';
|
|
87
|
+
const displayedSidebarLine =
|
|
88
|
+
displayedSidebar !== undefined ? `displayed_sidebar: ${displayedSidebar}\n` : '';
|
|
94
89
|
const hasDefaultChangelog = new Map();
|
|
95
90
|
|
|
96
91
|
for (const p of pathsToCopyChangelog) {
|
|
97
92
|
// the changelog page has to exist for the sidebar to work - async loadContent() is (apparently) not awaited for by sidebar
|
|
98
93
|
if (fs.existsSync(path.join(p, 'changelog.md'))) continue;
|
|
99
|
-
fs.writeFileSync(
|
|
94
|
+
fs.writeFileSync(
|
|
95
|
+
`${p}/changelog.md`,
|
|
96
|
+
`---
|
|
100
97
|
title: Changelog
|
|
101
98
|
sidebar_label: Changelog
|
|
102
99
|
${displayedSidebarLine}---
|
|
103
100
|
It seems that the changelog is not available.
|
|
104
101
|
This either means that your Docusaurus setup is misconfigured, or that your GitHub repository contains no releases yet.
|
|
105
|
-
|
|
102
|
+
`,
|
|
103
|
+
);
|
|
106
104
|
hasDefaultChangelog.set(p, true);
|
|
107
105
|
}
|
|
108
106
|
|
|
@@ -126,9 +124,7 @@ This either means that your Docusaurus setup is misconfigured, or that your GitH
|
|
|
126
124
|
});
|
|
127
125
|
},
|
|
128
126
|
getClientModules() {
|
|
129
|
-
return [
|
|
130
|
-
require.resolve('./theme/custom.css'),
|
|
131
|
-
];
|
|
127
|
+
return [require.resolve('./theme/custom.css')];
|
|
132
128
|
},
|
|
133
129
|
configureWebpack() {
|
|
134
130
|
return {
|
package/src/utils.js
CHANGED
|
@@ -4,11 +4,7 @@
|
|
|
4
4
|
export function isDifferentInstance(input) {
|
|
5
5
|
const simplified = input.startsWith('/') ? input.slice(1) : input;
|
|
6
6
|
|
|
7
|
-
const instanceUrls = [
|
|
8
|
-
'api/client',
|
|
9
|
-
'sdk',
|
|
10
|
-
'cli',
|
|
11
|
-
];
|
|
7
|
+
const instanceUrls = ['api/client', 'sdk', 'cli'];
|
|
12
8
|
|
|
13
9
|
return instanceUrls.some((url) => simplified.startsWith(url));
|
|
14
10
|
}
|
package/static/js/custom.js
CHANGED
|
@@ -148,10 +148,12 @@ function clearMcpRedirectCache() {
|
|
|
148
148
|
headers: {
|
|
149
149
|
Accept: 'text/html',
|
|
150
150
|
},
|
|
151
|
-
})
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
})
|
|
152
|
+
.then(() => {
|
|
153
|
+
// Cache cleared successfully
|
|
154
|
+
})
|
|
155
|
+
.catch(() => {
|
|
156
|
+
// Failed to clear cache - silent fail
|
|
157
|
+
});
|
|
156
158
|
}
|
|
157
159
|
}
|