@apify/docs-theme 1.0.158 → 1.0.160
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 +1 -1
- package/src/theme/MDXComponents/A.js +4 -0
- package/src/theme/custom.css +20 -0
- package/static/js/custom.js +5 -5
package/package.json
CHANGED
|
@@ -7,6 +7,10 @@ import { isDifferentInstance } from '../../utils';
|
|
|
7
7
|
export default function MDXA(props) {
|
|
8
8
|
const { siteConfig } = useDocusaurusContext();
|
|
9
9
|
|
|
10
|
+
if (props.href?.startsWith(siteConfig.url)) {
|
|
11
|
+
props.target = '_self';
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
// absolute links in README, e.g. in the SDK or API Client docs, need to be converted to local `to` links
|
|
11
15
|
if (props.href?.startsWith(siteConfig.url) && isDifferentInstance(siteConfig.baseUrl)) {
|
|
12
16
|
const { href, ...rest } = props;
|
package/src/theme/custom.css
CHANGED
|
@@ -1021,6 +1021,10 @@ aside li.section-header > .menu__list {
|
|
|
1021
1021
|
background: inherit !important;
|
|
1022
1022
|
}
|
|
1023
1023
|
|
|
1024
|
+
.theme-doc-sidebar-menu > li.section-header > ul > li.theme-doc-sidebar-item-category-level-2 {
|
|
1025
|
+
margin-bottom: 1rem;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1024
1028
|
.beta-chip {
|
|
1025
1029
|
display: inline-block;
|
|
1026
1030
|
border: 1px solid #ccc;
|
|
@@ -1698,6 +1702,7 @@ iframe[src*="youtube"] {
|
|
|
1698
1702
|
justify-content: start;
|
|
1699
1703
|
}
|
|
1700
1704
|
|
|
1705
|
+
.openapi-endpoint.api-method::before,
|
|
1701
1706
|
.api-method > .menu__link::before,
|
|
1702
1707
|
.schema > .menu__link::before {
|
|
1703
1708
|
width: 55px;
|
|
@@ -1726,73 +1731,88 @@ iframe[src*="youtube"] {
|
|
|
1726
1731
|
}
|
|
1727
1732
|
|
|
1728
1733
|
.get > .menu__link::before,
|
|
1734
|
+
.openapi-endpoint.api-method.get::before,
|
|
1729
1735
|
.theme-api-markdown .openapi__method-endpoint .badge--primary {
|
|
1730
1736
|
background-color: var(--ifm-color-info-contrast-background);
|
|
1731
1737
|
color: var(--ifm-color-info-contrast-foreground);
|
|
1732
1738
|
border-color: var(--ifm-color-info-dark);
|
|
1733
1739
|
}
|
|
1734
1740
|
|
|
1741
|
+
.openapi-endpoint.api-method.get::before,
|
|
1735
1742
|
.get > .menu__link::before {
|
|
1736
1743
|
content: 'get';
|
|
1737
1744
|
}
|
|
1738
1745
|
|
|
1746
|
+
.openapi-endpoint.api-method.post::before,
|
|
1739
1747
|
.post > .menu__link::before {
|
|
1740
1748
|
content: 'post';
|
|
1741
1749
|
}
|
|
1742
1750
|
|
|
1743
1751
|
.post > .menu__link::before,
|
|
1752
|
+
.openapi-endpoint.api-method.post::before,
|
|
1744
1753
|
.theme-api-markdown .openapi__method-endpoint .badge--success {
|
|
1745
1754
|
background-color: var(--ifm-color-success-contrast-background);
|
|
1746
1755
|
color: var(--ifm-color-success-contrast-foreground);
|
|
1747
1756
|
border-color: var(--ifm-color-success-dark);
|
|
1748
1757
|
}
|
|
1749
1758
|
|
|
1759
|
+
.openapi-endpoint.api-method.delete::before,
|
|
1750
1760
|
.delete > .menu__link::before {
|
|
1751
1761
|
content: 'del';
|
|
1752
1762
|
}
|
|
1753
1763
|
|
|
1754
1764
|
.delete > .menu__link::before,
|
|
1765
|
+
.openapi-endpoint.api-method.delete::before,
|
|
1755
1766
|
.theme-api-markdown .openapi__method-endpoint .badge--danger {
|
|
1756
1767
|
background-color: var(--ifm-color-danger-contrast-background);
|
|
1757
1768
|
color: var(--ifm-color-danger-contrast-foreground);
|
|
1758
1769
|
border-color: var(--ifm-color-danger-dark);
|
|
1759
1770
|
}
|
|
1760
1771
|
|
|
1772
|
+
.openapi-endpoint.api-method.put::before,
|
|
1761
1773
|
.put > .menu__link::before {
|
|
1762
1774
|
content: 'put';
|
|
1763
1775
|
}
|
|
1764
1776
|
|
|
1765
1777
|
.put > .menu__link::before,
|
|
1778
|
+
.openapi-endpoint.api-method.put::before,
|
|
1766
1779
|
.theme-api-markdown .openapi__method-endpoint .badge--info {
|
|
1767
1780
|
background-color: var(--ifm-color-warning-contrast-background);
|
|
1768
1781
|
color: var(--ifm-color-warning-contrast-foreground);
|
|
1769
1782
|
border-color: var(--ifm-color-warning-dark);
|
|
1770
1783
|
}
|
|
1771
1784
|
|
|
1785
|
+
.openapi-endpoint.api-method.patch::before,
|
|
1772
1786
|
.patch > .menu__link::before {
|
|
1773
1787
|
content: 'patch';
|
|
1774
1788
|
}
|
|
1775
1789
|
|
|
1776
1790
|
.patch > .menu__link::before,
|
|
1791
|
+
.openapi-endpoint.api-method.patch::before,
|
|
1777
1792
|
.theme-api-markdown .openapi__method-endpoint .badge--warning {
|
|
1778
1793
|
background-color: var(--ifm-color-success-contrast-background);
|
|
1779
1794
|
color: var(--ifm-color-success-contrast-foreground);
|
|
1780
1795
|
border-color: var(--ifm-color-success-dark);
|
|
1781
1796
|
}
|
|
1782
1797
|
|
|
1798
|
+
.openapi-endpoint.api-method.head::before,
|
|
1783
1799
|
.head > .menu__link::before {
|
|
1784
1800
|
content: 'head';
|
|
1785
1801
|
}
|
|
1786
1802
|
|
|
1787
1803
|
.head > .menu__link::before,
|
|
1804
|
+
.openapi-endpoint.api-method.head::before,
|
|
1788
1805
|
.event > .menu__link::before,
|
|
1806
|
+
.openapi-endpoint.api-method.event::before,
|
|
1789
1807
|
.schema > .menu__link::before,
|
|
1808
|
+
.openapi-endpoint.api-method.schema::before,
|
|
1790
1809
|
.theme-api-markdown .openapi__method-endpoint .badge--secondary {
|
|
1791
1810
|
background-color: var(--ifm-color-secondary-contrast-background);
|
|
1792
1811
|
color: var(--ifm-color-secondary-contrast-foreground);
|
|
1793
1812
|
border-color: var(--ifm-color-secondary-dark);
|
|
1794
1813
|
}
|
|
1795
1814
|
|
|
1815
|
+
.openapi-endpoint.api-method.event::before,
|
|
1796
1816
|
.event > .menu__link::before {
|
|
1797
1817
|
content: 'event';
|
|
1798
1818
|
}
|
package/static/js/custom.js
CHANGED
|
@@ -63,13 +63,13 @@ function scrollSidebarItemIntoView() {
|
|
|
63
63
|
|
|
64
64
|
// handles automatic scrolling of the API reference sidebar (openapi-docs)
|
|
65
65
|
function scrollOpenApiSidebarItemIntoView() {
|
|
66
|
-
const $li = document.
|
|
66
|
+
const $li = document.querySelectorAll(`ul.theme-doc-sidebar-menu a.menu__link--active[href]`);
|
|
67
67
|
|
|
68
|
-
if (
|
|
68
|
+
if ($li.length === 0) {
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
$li.scrollIntoView({
|
|
72
|
+
$li[$li.length - 1].scrollIntoView({
|
|
73
73
|
block: 'nearest',
|
|
74
74
|
inline: 'center',
|
|
75
75
|
});
|
|
@@ -78,8 +78,7 @@ function scrollOpenApiSidebarItemIntoView() {
|
|
|
78
78
|
function redirectOpenApiDocs() {
|
|
79
79
|
const { hash, pathname, origin } = new URL(window.location.href);
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
if (pathname.replace(/\/$/, '') !== '/api/v2-new') {
|
|
81
|
+
if (!pathname.startsWith('/api/v2') || pathname.startsWith('/api/v2-')) {
|
|
83
82
|
return;
|
|
84
83
|
}
|
|
85
84
|
|
|
@@ -129,5 +128,6 @@ window.addEventListener('load', () => {
|
|
|
129
128
|
});
|
|
130
129
|
|
|
131
130
|
window.addEventListener('popstate', () => {
|
|
131
|
+
setTimeout(() => redirectOpenApiDocs(), 50);
|
|
132
132
|
setTimeout(() => scrollOpenApiSidebarItemIntoView(), 50);
|
|
133
133
|
});
|