@apify/docs-theme 1.0.2 → 1.0.3
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/package.json +6 -5
- package/{img → src/img}/footer-apify-logo.svg +0 -0
- package/{img → src/img}/footer-open-source.svg +0 -0
- package/src/index.js +40 -0
- package/src/theme/ColorModeToggle/index.jsx +64 -0
- package/{theme → src/theme}/ColorModeToggle/styles.module.css +0 -0
- package/src/theme/DocSidebarItem/Link/index.jsx +62 -0
- package/src/theme/DocSidebarItem/Link/styles.module.css +3 -0
- package/src/theme/Footer/index.jsx +72 -0
- package/{theme → src/theme}/Footer/index.module.css +0 -0
- package/src/theme/Icon/DarkMode/index.jsx +11 -0
- package/src/theme/Icon/LightMode/index.jsx +28 -0
- package/src/theme/Navbar/Content/index.jsx +95 -0
- package/{theme → src/theme}/Navbar/Content/styles.module.css +0 -0
- package/src/theme/NavbarItem/ComponentTypes.jsx +101 -0
- package/src/theme/NavbarItem/NavbarNavLink.jsx +69 -0
- package/src/theme/NotFound.jsx +77 -0
- package/src/theme/custom.css +378 -0
- package/index.d.ts +0 -9
- package/index.js +0 -20
- package/theme/ColorModeToggle/index.d.ts +0 -8
- package/theme/ColorModeToggle/index.js +0 -38
- package/theme/Footer/index.d.ts +0 -4
- package/theme/Footer/index.js +0 -49
- package/theme/Icon/DarkMode/index.d.ts +0 -4
- package/theme/Icon/DarkMode/index.js +0 -11
- package/theme/Icon/LightMode/index.d.ts +0 -4
- package/theme/Icon/LightMode/index.js +0 -23
- package/theme/Navbar/Content/index.d.ts +0 -1
- package/theme/Navbar/Content/index.js +0 -60
- package/theme/NavbarItem/ComponentTypes.d.ts +0 -20
- package/theme/NavbarItem/ComponentTypes.js +0 -64
- package/theme/NavbarItem/NavbarNavLink.d.ts +0 -11
- package/theme/NavbarItem/NavbarNavLink.js +0 -42
- package/theme/NotFound.d.ts +0 -1
- package/theme/NotFound.js +0 -69
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const DefaultNavbarItem_1 = __importDefault(require("@theme/NavbarItem/DefaultNavbarItem"));
|
|
7
|
-
const DropdownNavbarItem_1 = __importDefault(require("@theme/NavbarItem/DropdownNavbarItem"));
|
|
8
|
-
const LocaleDropdownNavbarItem_1 = __importDefault(require("@theme/NavbarItem/LocaleDropdownNavbarItem"));
|
|
9
|
-
const SearchNavbarItem_1 = __importDefault(require("@theme/NavbarItem/SearchNavbarItem"));
|
|
10
|
-
const HtmlNavbarItem_1 = __importDefault(require("@theme/NavbarItem/HtmlNavbarItem"));
|
|
11
|
-
const DocSidebarNavbarItem_1 = __importDefault(require("@theme/NavbarItem/DocSidebarNavbarItem"));
|
|
12
|
-
const DocsVersionNavbarItem_1 = __importDefault(require("@theme/NavbarItem/DocsVersionNavbarItem"));
|
|
13
|
-
const DocsVersionDropdownNavbarItem_1 = __importDefault(require("@theme/NavbarItem/DocsVersionDropdownNavbarItem"));
|
|
14
|
-
const internal_1 = require("@docusaurus/theme-common/internal");
|
|
15
|
-
const useDocusaurusContext_1 = __importDefault(require("@docusaurus/useDocusaurusContext"));
|
|
16
|
-
const react_1 = __importDefault(require("react"));
|
|
17
|
-
// const versions = require('../../../versions.json');
|
|
18
|
-
//
|
|
19
|
-
// const stable = versions[0];
|
|
20
|
-
const stable = '1';
|
|
21
|
-
function DocNavbarItem({ docId, label: staticLabel, docsPluginId, ...props }) {
|
|
22
|
-
const doc = (0, internal_1.useLayoutDoc)(docId, docsPluginId);
|
|
23
|
-
// Draft items are not displayed in the navbar.
|
|
24
|
-
if (doc === null) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
return (react_1.default.createElement(DefaultNavbarItem_1.default, { exact: true, ...props, label: staticLabel ?? doc.id, to: doc.path }));
|
|
28
|
-
}
|
|
29
|
-
function ApiNavbarItem(ctx) {
|
|
30
|
-
let version = {};
|
|
31
|
-
try {
|
|
32
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
33
|
-
version = (0, internal_1.useDocsVersion)();
|
|
34
|
-
}
|
|
35
|
-
catch {
|
|
36
|
-
version.version = stable;
|
|
37
|
-
}
|
|
38
|
-
const { siteConfig } = (0, useDocusaurusContext_1.default)();
|
|
39
|
-
if (siteConfig.presets[0][1].docs.disableVersioning || version.version === stable) {
|
|
40
|
-
return (react_1.default.createElement(DefaultNavbarItem_1.default, { exact: true, ...ctx, label: ctx.label, to: `api/${ctx.to}` }));
|
|
41
|
-
}
|
|
42
|
-
// skip changelog button for older versions
|
|
43
|
-
if (+version.version < 3 && ctx.className === 'changelog') {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
// link directly to the old API docs under /docs/x.x/api
|
|
47
|
-
if (+version.version < 3) {
|
|
48
|
-
return (react_1.default.createElement(DefaultNavbarItem_1.default, { exact: true, ...ctx, label: ctx.label, to: `docs/${version.version === 'current' ? 'next' : version.version}/api/${ctx.to}` }));
|
|
49
|
-
}
|
|
50
|
-
return (react_1.default.createElement(DefaultNavbarItem_1.default, { exact: true, ...ctx, label: ctx.label, to: `api/${version.version === 'current' ? 'next' : version.version}/${ctx.to}` }));
|
|
51
|
-
}
|
|
52
|
-
const ComponentTypes = {
|
|
53
|
-
'default': DefaultNavbarItem_1.default,
|
|
54
|
-
'localeDropdown': LocaleDropdownNavbarItem_1.default,
|
|
55
|
-
'search': SearchNavbarItem_1.default,
|
|
56
|
-
'dropdown': DropdownNavbarItem_1.default,
|
|
57
|
-
'html': HtmlNavbarItem_1.default,
|
|
58
|
-
'custom-api': ApiNavbarItem,
|
|
59
|
-
'doc': DocNavbarItem,
|
|
60
|
-
'docSidebar': DocSidebarNavbarItem_1.default,
|
|
61
|
-
'docsVersion': DocsVersionNavbarItem_1.default,
|
|
62
|
-
'docsVersionDropdown': DocsVersionDropdownNavbarItem_1.default,
|
|
63
|
-
};
|
|
64
|
-
exports.default = ComponentTypes;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export default function NavbarNavLink({ activeBasePath, activeBaseRegex, to, href, label, html, isDropdownLink, prependBaseUrlToHref, ...props }: {
|
|
2
|
-
[x: string]: any;
|
|
3
|
-
activeBasePath: any;
|
|
4
|
-
activeBaseRegex: any;
|
|
5
|
-
to: any;
|
|
6
|
-
href: any;
|
|
7
|
-
label: any;
|
|
8
|
-
html: any;
|
|
9
|
-
isDropdownLink: any;
|
|
10
|
-
prependBaseUrlToHref: any;
|
|
11
|
-
}): JSX.Element;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const Link_1 = __importDefault(require("@docusaurus/Link"));
|
|
8
|
-
const useBaseUrl_1 = __importDefault(require("@docusaurus/useBaseUrl"));
|
|
9
|
-
const isInternalUrl_1 = __importDefault(require("@docusaurus/isInternalUrl"));
|
|
10
|
-
const router_1 = require("@docusaurus/router");
|
|
11
|
-
const theme_common_1 = require("@docusaurus/theme-common");
|
|
12
|
-
function NavbarNavLink({ activeBasePath, activeBaseRegex, to, href, label, html, isDropdownLink, prependBaseUrlToHref, ...props }) {
|
|
13
|
-
const location = (0, router_1.useLocation)();
|
|
14
|
-
// TODO all this seems hacky
|
|
15
|
-
// {to: 'version'} should probably be forbidden, in favor of {to: '/version'}
|
|
16
|
-
const toUrl = (0, useBaseUrl_1.default)(to);
|
|
17
|
-
const activeBaseUrl = (0, useBaseUrl_1.default)(activeBasePath);
|
|
18
|
-
const normalizedHref = (0, useBaseUrl_1.default)(href, { forcePrependBaseUrl: true });
|
|
19
|
-
// const isExternalLink = label && href && !isInternalUrl(href);
|
|
20
|
-
const isExternalLink = false;
|
|
21
|
-
// Link content is set through html XOR label
|
|
22
|
-
const linkContentProps = html
|
|
23
|
-
? { dangerouslySetInnerHTML: { __html: html } }
|
|
24
|
-
: {
|
|
25
|
-
children: (react_1.default.createElement(react_1.default.Fragment, null,
|
|
26
|
-
label,
|
|
27
|
-
isExternalLink && (react_1.default.createElement(IconExternalLink, { ...(isDropdownLink && { width: 12, height: 12 }) })))),
|
|
28
|
-
};
|
|
29
|
-
if (href) {
|
|
30
|
-
return (react_1.default.createElement(Link_1.default, { href: prependBaseUrlToHref ? normalizedHref : href, ...props, ...(activeBaseUrl && {
|
|
31
|
-
className: location.pathname.startsWith(`/${activeBasePath}`)
|
|
32
|
-
? 'navbar__item navbar__link navbar__link--active'
|
|
33
|
-
: 'navbar__item navbar__link',
|
|
34
|
-
}), ...linkContentProps }));
|
|
35
|
-
}
|
|
36
|
-
return (react_1.default.createElement(Link_1.default, { to: toUrl, isNavLink: true, ...((activeBasePath || activeBaseRegex) && {
|
|
37
|
-
isActive: (_match, location) => (activeBaseRegex
|
|
38
|
-
? (0, theme_common_1.isRegexpStringMatch)(activeBaseRegex, location.pathname)
|
|
39
|
-
: location.pathname.startsWith(activeBaseUrl)),
|
|
40
|
-
}), ...props, ...linkContentProps }));
|
|
41
|
-
}
|
|
42
|
-
exports.default = NavbarNavLink;
|
package/theme/NotFound.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function NotFound(): JSX.Element;
|
package/theme/NotFound.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const useBaseUrl_1 = __importDefault(require("@docusaurus/useBaseUrl"));
|
|
8
|
-
const useIsBrowser_1 = __importDefault(require("@docusaurus/useIsBrowser"));
|
|
9
|
-
const theme_common_1 = require("@docusaurus/theme-common");
|
|
10
|
-
const Link_1 = __importDefault(require("@docusaurus/Link"));
|
|
11
|
-
const Layout_1 = __importDefault(require("@theme/Layout"));
|
|
12
|
-
function NotFound() {
|
|
13
|
-
const redirectedV2Url = (0, useBaseUrl_1.default)('/docs/api');
|
|
14
|
-
const redirectedV1Url = (0, useBaseUrl_1.default)('/docs/1.3.1/api');
|
|
15
|
-
const baseUrlForV2Redirect = (0, useBaseUrl_1.default)(`/docs/2.3/api/`);
|
|
16
|
-
const baseUrlForV1Redirect = (0, useBaseUrl_1.default)(`/docs/1.3/api/`);
|
|
17
|
-
const isBrowser = (0, useIsBrowser_1.default)();
|
|
18
|
-
if (isBrowser) {
|
|
19
|
-
const path = window.location.pathname;
|
|
20
|
-
let href = '';
|
|
21
|
-
let redirect = false;
|
|
22
|
-
if (path.startsWith(redirectedV2Url)) {
|
|
23
|
-
href = baseUrlForV2Redirect + path.substring(redirectedV2Url.length + 1);
|
|
24
|
-
redirect = true;
|
|
25
|
-
}
|
|
26
|
-
if (path.match(/\/docs\/2\.\d+\.\d+\/api/)) {
|
|
27
|
-
href = baseUrlForV2Redirect + path.substring(redirectedV1Url.length + 1);
|
|
28
|
-
redirect = true;
|
|
29
|
-
}
|
|
30
|
-
if (path.match(/\/api\/[12]\.\d+\/\w+/)) {
|
|
31
|
-
const [, v, id] = path.match(/\/api\/([12])\.\d+\/(.*)/);
|
|
32
|
-
href = (v === '1' ? baseUrlForV1Redirect : baseUrlForV2Redirect) + id;
|
|
33
|
-
redirect = true;
|
|
34
|
-
}
|
|
35
|
-
if (path.match(/\/docs\/[01]\.\d+\.\d+\/api\/(.*)/)) {
|
|
36
|
-
const id = path.match(/\/docs\/[01]\.\d+\.\d+\/api\/(.*)/)[1];
|
|
37
|
-
href = baseUrlForV1Redirect + id;
|
|
38
|
-
redirect = true;
|
|
39
|
-
}
|
|
40
|
-
if (redirect && window.location.href !== href) {
|
|
41
|
-
window.location.href = href;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
45
|
-
react_1.default.createElement(theme_common_1.PageMetadata, { title: 'Page Not Found' }),
|
|
46
|
-
react_1.default.createElement(Layout_1.default, null,
|
|
47
|
-
react_1.default.createElement("main", { className: "container margin-vert--xl" },
|
|
48
|
-
react_1.default.createElement("div", { className: "row" },
|
|
49
|
-
react_1.default.createElement("div", { className: "col col--6 col--offset-3" },
|
|
50
|
-
react_1.default.createElement("h1", { className: "hero__title" }, "Page Not Found"),
|
|
51
|
-
react_1.default.createElement("p", null, "We could not find what you were looking for \uD83D\uDE22"),
|
|
52
|
-
react_1.default.createElement("p", null,
|
|
53
|
-
"Recently we ",
|
|
54
|
-
react_1.default.createElement("b", null, "released Apify SDK v3 "),
|
|
55
|
-
"and we significantly upgraded the documentation."),
|
|
56
|
-
react_1.default.createElement("p", null,
|
|
57
|
-
"If you're looking for documentation of ",
|
|
58
|
-
react_1.default.createElement("b", null, "Apify SDK v2"),
|
|
59
|
-
",",
|
|
60
|
-
react_1.default.createElement(Link_1.default, { to: '/docs/2.3/guides/apify-platform' }, " you can find it here"),
|
|
61
|
-
"."),
|
|
62
|
-
react_1.default.createElement("p", null,
|
|
63
|
-
"For ",
|
|
64
|
-
react_1.default.createElement("b", null, "Apify SDK v3 docs"),
|
|
65
|
-
", go to the ",
|
|
66
|
-
react_1.default.createElement(Link_1.default, { to: '/' }, "homepage"),
|
|
67
|
-
".")))))));
|
|
68
|
-
}
|
|
69
|
-
exports.default = NotFound;
|