@apify/docs-theme 1.0.114 → 1.0.116

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/docs-theme",
3
- "version": "1.0.114",
3
+ "version": "1.0.116",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "files": [
package/src/config.js CHANGED
@@ -43,6 +43,9 @@ const themeConfig = ({
43
43
  {
44
44
  label: 'API',
45
45
  type: 'dropdown',
46
+ to: `${absoluteUrl}/api`,
47
+ target: '_self',
48
+ rel: 'dofollow',
46
49
  activeBasePath: 'api',
47
50
  position: 'left',
48
51
  items: [
@@ -69,8 +72,11 @@ const themeConfig = ({
69
72
  {
70
73
  label: 'SDK',
71
74
  type: 'dropdown',
75
+ to: '/sdk',
72
76
  activeBasePath: 'sdk',
73
77
  position: 'left',
78
+ target: '_self',
79
+ rel: 'dofollow',
74
80
  items: [
75
81
  {
76
82
  label: 'SDK for JavaScript',
@@ -90,6 +96,7 @@ const themeConfig = ({
90
96
  label: 'CLI',
91
97
  href: `${absoluteUrl}/cli/`, // we need a trailing slash here, we'd get redirected there anyway
92
98
  position: 'left',
99
+ activeBasePath: 'cli',
93
100
  target: '_self',
94
101
  rel: 'dofollow',
95
102
  },
@@ -1,22 +1,23 @@
1
- import React from 'react';
1
+ import { useLocation } from '@docusaurus/router';
2
2
  import { useThemeConfig, isRegexpStringMatch } from '@docusaurus/theme-common';
3
- import { usePluginData } from '@docusaurus/useGlobalData';
4
3
  import {
5
4
  splitNavbarItems,
6
5
  } from '@docusaurus/theme-common/internal';
7
- import NavbarLogo from '@theme/Navbar/Logo';
8
- import NavbarItem from '@theme/NavbarItem';
6
+ import { usePluginData } from '@docusaurus/useGlobalData';
9
7
  import NavbarColorModeToggle from '@theme/Navbar/ColorModeToggle';
10
- import NavbarSearch from '@theme/Navbar/Search';
8
+ import NavbarLogo from '@theme/Navbar/Logo';
11
9
  import NavbarMobileSidebarToggle from '@theme/Navbar/MobileSidebar/Toggle';
12
- import { useLocation } from '@docusaurus/router';
13
- import SearchBar from '../../SearchBar';
10
+ import NavbarSearch from '@theme/Navbar/Search';
11
+ import NavbarItem from '@theme/NavbarItem';
12
+ import React from 'react';
13
+
14
14
  import styles from './styles.module.css';
15
+ import SearchBar from '../../SearchBar';
15
16
 
16
17
  function NavbarItems({ items }) {
17
18
  return (
18
19
  <>
19
- {items.map((item, i) => <NavbarItem {...item} key={i}/>)}
20
+ {items.map((item, i) => <NavbarItem {...item} key={i} />)}
20
21
  </>
21
22
  );
22
23
  }
@@ -35,6 +36,14 @@ function NavbarContentLayout({
35
36
  );
36
37
  }
37
38
 
39
+ function SubNavbarTitle({ titleIcon, title }) {
40
+ return titleIcon
41
+ ? <div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>
42
+ <img src={`img/${titleIcon}`} width={24} height={24} /> {title}
43
+ </div>
44
+ : title;
45
+ }
46
+
38
47
  function SubNavbar() {
39
48
  const { options: { subNavbar } } = usePluginData('@apify/docs-theme');
40
49
  const location = useLocation();
@@ -45,9 +54,13 @@ function SubNavbar() {
45
54
  <div className="navbar__container">
46
55
  <div className="navbar__items">
47
56
  <div className="navbar__sub--title">
48
- <NavbarItem label={subNavbar.title} to={subNavbar.to ?? '/'} activeBaseRegex='(?!)' />
57
+ <NavbarItem
58
+ label={<SubNavbarTitle title={subNavbar.title} titleIcon={subNavbar.titleIcon} />}
59
+ to={subNavbar.to ?? '/'}
60
+ activeBaseRegex='(?!)'
61
+ />
49
62
  </div>
50
- <NavbarItems items={subNavbar.items}/>
63
+ <NavbarItems items={subNavbar.items} />
51
64
  </div>
52
65
  </div>
53
66
  </div>
@@ -72,24 +85,24 @@ export default function NavbarContent() {
72
85
  <NavbarContentLayout
73
86
  left={
74
87
  <>
75
- <NavbarMobileSidebarToggle/>
76
- <NavbarLogo/>
77
- <NavbarItems items={leftItems}/>
88
+ <NavbarMobileSidebarToggle />
89
+ <NavbarLogo />
90
+ <NavbarItems items={leftItems} />
78
91
  </>
79
92
  }
80
93
  right={
81
94
  <>
82
- <NavbarColorModeToggle className={styles.colorModeToggle}/>
83
- <NavbarItems items={rightItems}/>
95
+ <NavbarColorModeToggle className={styles.colorModeToggle} />
96
+ <NavbarItems items={rightItems} />
84
97
  {!searchBarItem && (
85
98
  <NavbarSearch>
86
- <SearchBar/>
99
+ <SearchBar />
87
100
  </NavbarSearch>
88
101
  )}
89
102
  </>
90
103
  }
91
104
  />
92
- <SubNavbar/>
105
+ <SubNavbar />
93
106
  </div>
94
107
  );
95
108
  }
@@ -1,12 +1,12 @@
1
- import React from 'react';
2
- import Link from '@docusaurus/Link';
3
- import useBaseUrl from '@docusaurus/useBaseUrl';
4
1
  import isInternalUrl_ from '@docusaurus/isInternalUrl';
5
- import IconExternalLink from '@theme/Icon/ExternalLink';
2
+ import Link from '@docusaurus/Link';
6
3
  import { useLocation } from '@docusaurus/router';
7
4
  import { isRegexpStringMatch, useThemeConfig } from '@docusaurus/theme-common';
8
- import { usePluginData } from '@docusaurus/useGlobalData';
5
+ import useBaseUrl from '@docusaurus/useBaseUrl';
9
6
  import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
7
+ import { usePluginData } from '@docusaurus/useGlobalData';
8
+ import IconExternalLink from '@theme/Icon/ExternalLink';
9
+ import React from 'react';
10
10
 
11
11
  export default function NavbarNavLink({
12
12
  activeBasePath,
@@ -83,7 +83,8 @@ export default function NavbarNavLink({
83
83
  // eslint-disable-next-line no-shadow
84
84
  isActive: (_match, location) => (activeBaseRegex
85
85
  ? isRegexpStringMatch(activeBaseRegex, location.pathname) || dropDownHasActiveItem
86
- : location.pathname.startsWith(activeBaseUrl)),
86
+ : location.pathname.startsWith(`/${activeBasePath}`)),
87
+ activeClassName: 'navbar__link--active',
87
88
  })}
88
89
  {...props}
89
90
  {...linkContentProps}
@@ -0,0 +1,11 @@
1
+ <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_1502_2544)">
3
+ <path d="M0 4C0 1.79086 1.79086 0 4 0H36C38.2091 0 40 1.79086 40 4V36C40 38.2091 38.2091 40 36 40H4C1.79086 40 0 38.2091 0 36V4Z" fill="#F7DF1E"/>
4
+ <path d="M25.3125 28.9062C26.0938 30.2344 27.1875 31.1719 28.9844 31.1719C30.5469 31.1719 31.5625 30.3906 31.5625 29.2969C31.5625 28.0469 30.5469 27.5781 28.8281 26.7969L27.8906 26.4062C25.1562 25.2344 23.3594 23.8281 23.3594 20.7812C23.3594 17.9688 25.4688 15.7812 28.8281 15.7812C31.25 15.7812 32.9688 16.6406 34.1406 18.8281L31.25 20.7031C30.625 19.5312 29.9219 19.0625 28.8281 19.0625C27.7344 19.0625 27.0312 19.7656 27.0312 20.7031C27.0312 21.7969 27.7344 22.2656 29.375 22.9688L30.3125 23.3594C33.5156 24.7656 35.3125 26.0938 35.3125 29.2969C35.3125 32.6562 32.6562 34.5312 29.0625 34.5312C25.5469 34.5312 23.2812 32.8906 22.1875 30.7031L25.3125 28.9062ZM12.0312 29.2188C12.6562 30.2344 13.125 31.1719 14.4531 31.1719C15.7031 31.1719 16.4844 30.7031 16.4844 28.8281V15.8594H20.2344V28.6719C20.2344 32.5781 17.9688 34.2969 14.6094 34.2969C11.5625 34.2969 9.84375 32.7344 8.98438 30.8594L12.0312 29.2188Z" fill="black"/>
5
+ </g>
6
+ <defs>
7
+ <clipPath id="clip0_1502_2544">
8
+ <rect width="40" height="40" fill="white"/>
9
+ </clipPath>
10
+ </defs>
11
+ </svg>
@@ -0,0 +1,19 @@
1
+ <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_1502_2456)">
3
+ <path d="M19.7906 0.000328312C18.1388 0.00793474 16.5614 0.147549 15.1734 0.390953C11.0847 1.10685 10.3424 2.60528 10.3424 5.36863V9.01819H20.0045V10.2347H10.3424H6.71623C3.90814 10.2347 1.44929 11.9075 0.680193 15.0896C-0.206949 18.7371 -0.246299 21.0132 0.680193 24.8218C1.36701 27.6567 3.00724 29.6767 5.81533 29.6767H9.1374V25.3017C9.1374 22.141 11.8967 19.353 15.1734 19.353H24.8243C27.5108 19.353 29.6554 17.1608 29.6554 14.4869V5.36863C29.6554 2.77351 27.4464 0.824069 24.8243 0.390953C23.1645 0.117123 21.4423 -0.00727823 19.7906 0.000328312ZM14.5653 2.9356C15.5634 2.9356 16.3784 3.75654 16.3784 4.76595C16.3784 5.77179 15.5634 6.58515 14.5653 6.58515C13.5637 6.58515 12.7523 5.77179 12.7523 4.76595C12.7523 3.75654 13.5637 2.9356 14.5653 2.9356Z" fill="url(#paint0_linear_1502_2456)"/>
4
+ <path d="M30.8607 10.2348V14.487C30.8607 17.7837 28.0405 20.5585 24.8246 20.5585H15.1737C12.5302 20.5585 10.3427 22.8008 10.3427 25.4245V34.5428C10.3427 37.138 12.6196 38.6644 15.1737 39.4089C18.2322 40.3002 21.1652 40.4613 24.8246 39.4089C27.2571 38.7109 29.6557 37.3062 29.6557 34.5428V30.8933H20.0048V29.6768H29.6557H34.4868C37.2949 29.6768 38.3413 27.7355 39.3179 24.8219C40.3266 21.8223 40.2837 18.9377 39.3179 15.0897C38.6239 12.3192 37.2985 10.2348 34.4868 10.2348H30.8607ZM25.4327 33.3263C26.4344 33.3263 27.2458 34.1397 27.2458 35.1455C27.2458 36.1549 26.4344 36.9759 25.4327 36.9759C24.4347 36.9759 23.6197 36.1549 23.6197 35.1455C23.6197 34.1397 24.4347 33.3263 25.4327 33.3263Z" fill="url(#paint1_linear_1502_2456)"/>
5
+ </g>
6
+ <defs>
7
+ <linearGradient id="paint0_linear_1502_2456" x1="-1.20371e-07" y1="-1.03629e-07" x2="22.1115" y2="19.0118" gradientUnits="userSpaceOnUse">
8
+ <stop stop-color="#5A9FD4"/>
9
+ <stop offset="1" stop-color="#306998"/>
10
+ </linearGradient>
11
+ <linearGradient id="paint1_linear_1502_2456" x1="25.2005" y1="34.8387" x2="17.3021" y2="23.6709" gradientUnits="userSpaceOnUse">
12
+ <stop stop-color="#FFD43B"/>
13
+ <stop offset="1" stop-color="#FFE873"/>
14
+ </linearGradient>
15
+ <clipPath id="clip0_1502_2456">
16
+ <rect width="40" height="40" fill="white"/>
17
+ </clipPath>
18
+ </defs>
19
+ </svg>