@docusaurus/theme-classic 3.8.1 → 3.9.0-canary-6406
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/lib/index.js +0 -1
- package/lib/inlineScripts.d.ts +1 -1
- package/lib/inlineScripts.js +21 -20
- package/lib/theme/Blog/Components/Author/Socials/index.js +3 -1
- package/lib/theme/Blog/Components/Author/index.js +6 -2
- package/lib/theme/CodeBlock/Buttons/CopyButton/index.js +6 -6
- package/lib/theme/DocSidebarItem/Category/index.d.ts +1 -1
- package/lib/theme/DocSidebarItem/Category/index.js +96 -33
- package/lib/theme/DocSidebarItem/Category/styles.module.css +26 -0
- package/lib/theme/DocSidebarItem/Link/index.js +8 -1
- package/lib/theme/DocSidebarItem/Link/styles.module.css +8 -0
- package/lib/theme/Heading/index.js +2 -1
- package/lib/theme/Icon/ExternalLink/index.js +6 -1
- package/lib/theme/Icon/Socials/Bluesky/index.js +6 -5
- package/lib/theme/{MDXComponents/A.js → Icon/Socials/Bluesky/styles.module.css} +7 -4
- package/lib/theme/Icon/Socials/Default/index.js +6 -6
- package/lib/theme/Icon/Socials/Email/index.d.ts +9 -0
- package/lib/theme/Icon/Socials/Email/index.js +25 -0
- package/lib/theme/Icon/Socials/LinkedIn/index.d.ts +1 -1
- package/lib/theme/Icon/Socials/LinkedIn/index.js +6 -5
- package/lib/theme/Icon/Socials/LinkedIn/styles.module.css +14 -0
- package/lib/theme/MDXComponents/A/index.js +36 -0
- package/lib/theme/MDXComponents/A/styles.module.css +20 -0
- package/lib/theme/Navbar/Search/styles.module.css +1 -2
- package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +3 -2
- package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.js +61 -15
- package/lib/theme/Tabs/index.js +9 -1
- package/package.json +16 -17
- package/src/index.ts +0 -1
- package/src/inlineScripts.ts +27 -20
- package/src/theme/Blog/Components/Author/Socials/index.tsx +3 -1
- package/src/theme/Blog/Components/Author/index.tsx +6 -2
- package/src/theme/CodeBlock/Buttons/CopyButton/index.tsx +6 -6
- package/src/theme/DocSidebarItem/Category/index.tsx +104 -32
- package/src/theme/DocSidebarItem/Category/styles.module.css +26 -0
- package/src/theme/DocSidebarItem/Link/index.tsx +9 -1
- package/src/theme/DocSidebarItem/Link/styles.module.css +8 -0
- package/src/theme/Heading/index.tsx +2 -1
- package/src/theme/Icon/ExternalLink/index.tsx +6 -1
- package/src/theme/Icon/Socials/Bluesky/index.tsx +7 -6
- package/src/theme/Icon/Socials/Bluesky/styles.module.css +14 -0
- package/src/theme/Icon/Socials/Default/index.tsx +6 -6
- package/src/theme/Icon/Socials/Email/index.tsx +28 -0
- package/src/theme/Icon/Socials/LinkedIn/index.tsx +7 -6
- package/src/theme/Icon/Socials/LinkedIn/styles.module.css +14 -0
- package/src/theme/MDXComponents/A/index.tsx +42 -0
- package/src/theme/MDXComponents/A/styles.module.css +20 -0
- package/src/theme/Navbar/Search/styles.module.css +1 -2
- package/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +3 -2
- package/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx +66 -16
- package/src/theme/Tabs/index.tsx +9 -1
- package/src/theme-classic.d.ts +11 -1
- package/src/theme/MDXComponents/A.tsx +0 -14
- /package/lib/theme/MDXComponents/{A.d.ts → A/index.d.ts} +0 -0
package/lib/index.js
CHANGED
package/lib/inlineScripts.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { SiteStorage } from '@docusaurus/types';
|
|
8
8
|
import type { ThemeConfig } from '@docusaurus/theme-common';
|
|
9
|
-
export declare function getThemeInlineScript({ colorMode: { defaultMode, respectPrefersColorScheme }, siteStorage, }: {
|
|
9
|
+
export declare function getThemeInlineScript({ colorMode: { disableSwitch, defaultMode, respectPrefersColorScheme }, siteStorage, }: {
|
|
10
10
|
colorMode: ThemeConfig['colorMode'];
|
|
11
11
|
siteStorage: SiteStorage;
|
|
12
12
|
}): string;
|
package/lib/inlineScripts.js
CHANGED
|
@@ -13,32 +13,33 @@ exports.getAnnouncementBarInlineScript = getAnnouncementBarInlineScript;
|
|
|
13
13
|
const ThemeQueryStringKey = 'docusaurus-theme';
|
|
14
14
|
// Support for ?docusaurus-data-mode=embed&docusaurus-data-myAttr=42
|
|
15
15
|
const DataQueryStringPrefixKey = 'docusaurus-data-';
|
|
16
|
-
function getThemeInlineScript({ colorMode: { defaultMode, respectPrefersColorScheme }, siteStorage, }) {
|
|
16
|
+
function getThemeInlineScript({ colorMode: { disableSwitch, defaultMode, respectPrefersColorScheme }, siteStorage, }) {
|
|
17
17
|
// Need to be inlined to prevent dark mode FOUC
|
|
18
18
|
// Make sure the key is the same as the one in the color mode React context
|
|
19
19
|
// Currently defined in: `docusaurus-theme-common/src/contexts/colorMode.tsx`
|
|
20
20
|
const themeStorageKey = `theme${siteStorage.namespace}`;
|
|
21
|
+
const isThemeUserConfigurable = !disableSwitch;
|
|
21
22
|
/* language=js */
|
|
22
23
|
return `(function() {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
function getSystemColorMode() {
|
|
25
|
+
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
26
|
+
}
|
|
27
|
+
${isThemeUserConfigurable
|
|
28
|
+
? ` function getQueryStringTheme() {
|
|
29
|
+
try {
|
|
30
|
+
return new URLSearchParams(window.location.search).get('${ThemeQueryStringKey}')
|
|
31
|
+
} catch (e) {}
|
|
32
|
+
}
|
|
33
|
+
function getStoredTheme() {
|
|
34
|
+
try {
|
|
35
|
+
return window['${siteStorage.type}'].getItem('${themeStorageKey}');
|
|
36
|
+
} catch (err) {}
|
|
37
|
+
}
|
|
38
|
+
var initialTheme = getQueryStringTheme() || getStoredTheme();`
|
|
39
|
+
: ' var initialTheme;'}
|
|
40
|
+
document.documentElement.setAttribute('data-theme', initialTheme || ${respectPrefersColorScheme ? 'getSystemColorMode()' : `'${defaultMode}'`});
|
|
41
|
+
document.documentElement.setAttribute('data-theme-choice', initialTheme || ${respectPrefersColorScheme ? `'system'` : `'${defaultMode}'`});
|
|
42
|
+
})();`;
|
|
42
43
|
}
|
|
43
44
|
/* language=js */
|
|
44
45
|
exports.DataAttributeQueryStringInlineJavaScript = `
|
|
@@ -19,6 +19,7 @@ import Threads from '@theme/Icon/Socials/Threads';
|
|
|
19
19
|
import Youtube from '@theme/Icon/Socials/YouTube';
|
|
20
20
|
import Mastodon from '@theme/Icon/Socials/Mastodon';
|
|
21
21
|
import Twitch from '@theme/Icon/Socials/Twitch';
|
|
22
|
+
import Email from '@theme/Icon/Socials/Email';
|
|
22
23
|
import styles from './styles.module.css';
|
|
23
24
|
const SocialPlatformConfigs = {
|
|
24
25
|
twitter: {Icon: Twitter, label: 'Twitter'},
|
|
@@ -32,6 +33,7 @@ const SocialPlatformConfigs = {
|
|
|
32
33
|
mastodon: {Icon: Mastodon, label: 'Mastodon'},
|
|
33
34
|
youtube: {Icon: Youtube, label: 'YouTube'},
|
|
34
35
|
twitch: {Icon: Twitch, label: 'Twitch'},
|
|
36
|
+
email: {Icon: Email, label: 'Email'},
|
|
35
37
|
};
|
|
36
38
|
function getSocialPlatformConfig(platformKey) {
|
|
37
39
|
return (
|
|
@@ -45,7 +47,7 @@ function SocialLink({platform, link}) {
|
|
|
45
47
|
const {Icon, label} = getSocialPlatformConfig(platform);
|
|
46
48
|
return (
|
|
47
49
|
<Link className={styles.authorSocialLink} href={link} title={label}>
|
|
48
|
-
<Icon className={clsx(styles.
|
|
50
|
+
<Icon className={clsx(styles.authorSocialIcon)} />
|
|
49
51
|
</Link>
|
|
50
52
|
);
|
|
51
53
|
}
|
|
@@ -25,10 +25,14 @@ function AuthorTitle({title}) {
|
|
|
25
25
|
}
|
|
26
26
|
function AuthorName({name, as}) {
|
|
27
27
|
if (!as) {
|
|
28
|
-
return
|
|
28
|
+
return (
|
|
29
|
+
<span className={styles.authorName} translate="no">
|
|
30
|
+
{name}
|
|
31
|
+
</span>
|
|
32
|
+
);
|
|
29
33
|
} else {
|
|
30
34
|
return (
|
|
31
|
-
<Heading as={as} className={styles.authorName}>
|
|
35
|
+
<Heading as={as} className={styles.authorName} translate="no">
|
|
32
36
|
{name}
|
|
33
37
|
</Heading>
|
|
34
38
|
);
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React, {useCallback, useState, useRef, useEffect} from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
-
import copy from 'copy-text-to-clipboard';
|
|
10
9
|
import {translate} from '@docusaurus/Translate';
|
|
11
10
|
import {useCodeBlockContext} from '@docusaurus/theme-common/internal';
|
|
12
11
|
import Button from '@theme/CodeBlock/Buttons/Button';
|
|
@@ -40,11 +39,12 @@ function useCopyButton() {
|
|
|
40
39
|
const [isCopied, setIsCopied] = useState(false);
|
|
41
40
|
const copyTimeout = useRef(undefined);
|
|
42
41
|
const copyCode = useCallback(() => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
navigator.clipboard.writeText(code).then(() => {
|
|
43
|
+
setIsCopied(true);
|
|
44
|
+
copyTimeout.current = window.setTimeout(() => {
|
|
45
|
+
setIsCopied(false);
|
|
46
|
+
}, 1000);
|
|
47
|
+
});
|
|
48
48
|
}, [code]);
|
|
49
49
|
useEffect(() => () => window.clearTimeout(copyTimeout.current), []);
|
|
50
50
|
return {copyCode, isCopied};
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { type ReactNode } from 'react';
|
|
8
8
|
import type { Props } from '@theme/DocSidebarItem/Category';
|
|
9
|
-
export default function DocSidebarItemCategory(
|
|
9
|
+
export default function DocSidebarItemCategory(props: Props): ReactNode;
|
|
@@ -18,21 +18,39 @@ import {
|
|
|
18
18
|
isActiveSidebarItem,
|
|
19
19
|
findFirstSidebarItemLink,
|
|
20
20
|
useDocSidebarItemsExpandedState,
|
|
21
|
+
useVisibleSidebarItems,
|
|
21
22
|
} from '@docusaurus/plugin-content-docs/client';
|
|
22
23
|
import Link from '@docusaurus/Link';
|
|
23
24
|
import {translate} from '@docusaurus/Translate';
|
|
24
25
|
import useIsBrowser from '@docusaurus/useIsBrowser';
|
|
25
26
|
import DocSidebarItems from '@theme/DocSidebarItems';
|
|
27
|
+
import DocSidebarItemLink from '@theme/DocSidebarItem/Link';
|
|
28
|
+
import styles from './styles.module.css';
|
|
26
29
|
// If we navigate to a category and it becomes active, it should automatically
|
|
27
30
|
// expand itself
|
|
28
|
-
function useAutoExpandActiveCategory({
|
|
31
|
+
function useAutoExpandActiveCategory({
|
|
32
|
+
isActive,
|
|
33
|
+
collapsed,
|
|
34
|
+
updateCollapsed,
|
|
35
|
+
activePath,
|
|
36
|
+
}) {
|
|
29
37
|
const wasActive = usePrevious(isActive);
|
|
38
|
+
const previousActivePath = usePrevious(activePath);
|
|
30
39
|
useEffect(() => {
|
|
31
40
|
const justBecameActive = isActive && !wasActive;
|
|
32
|
-
|
|
41
|
+
const stillActiveButPathChanged =
|
|
42
|
+
isActive && wasActive && activePath !== previousActivePath;
|
|
43
|
+
if ((justBecameActive || stillActiveButPathChanged) && collapsed) {
|
|
33
44
|
updateCollapsed(false);
|
|
34
45
|
}
|
|
35
|
-
}, [
|
|
46
|
+
}, [
|
|
47
|
+
isActive,
|
|
48
|
+
wasActive,
|
|
49
|
+
collapsed,
|
|
50
|
+
updateCollapsed,
|
|
51
|
+
activePath,
|
|
52
|
+
previousActivePath,
|
|
53
|
+
]);
|
|
36
54
|
}
|
|
37
55
|
/**
|
|
38
56
|
* When a collapsible category has no link, we still link it to its first child
|
|
@@ -85,7 +103,50 @@ function CollapseButton({collapsed, categoryLabel, onClick}) {
|
|
|
85
103
|
/>
|
|
86
104
|
);
|
|
87
105
|
}
|
|
88
|
-
|
|
106
|
+
function CategoryLinkLabel({label}) {
|
|
107
|
+
return (
|
|
108
|
+
<span title={label} className={styles.categoryLinkLabel}>
|
|
109
|
+
{label}
|
|
110
|
+
</span>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
export default function DocSidebarItemCategory(props) {
|
|
114
|
+
const visibleChildren = useVisibleSidebarItems(
|
|
115
|
+
props.item.items,
|
|
116
|
+
props.activePath,
|
|
117
|
+
);
|
|
118
|
+
if (visibleChildren.length === 0) {
|
|
119
|
+
return <DocSidebarItemCategoryEmpty {...props} />;
|
|
120
|
+
} else {
|
|
121
|
+
return <DocSidebarItemCategoryCollapsible {...props} />;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function isCategoryWithHref(category) {
|
|
125
|
+
return typeof category.href === 'string';
|
|
126
|
+
}
|
|
127
|
+
// If a category doesn't have any visible children, we render it as a link
|
|
128
|
+
function DocSidebarItemCategoryEmpty({item, ...props}) {
|
|
129
|
+
// If the category has no link, we don't render anything
|
|
130
|
+
// It's not super useful to render a category you can't open nor click
|
|
131
|
+
if (!isCategoryWithHref(item)) {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
// We remove props that don't make sense for a link and forward the rest
|
|
135
|
+
const {
|
|
136
|
+
type,
|
|
137
|
+
collapsed,
|
|
138
|
+
collapsible,
|
|
139
|
+
items,
|
|
140
|
+
linkUnlisted,
|
|
141
|
+
...forwardableProps
|
|
142
|
+
} = item;
|
|
143
|
+
const linkItem = {
|
|
144
|
+
type: 'link',
|
|
145
|
+
...forwardableProps,
|
|
146
|
+
};
|
|
147
|
+
return <DocSidebarItemLink item={linkItem} {...props} />;
|
|
148
|
+
}
|
|
149
|
+
function DocSidebarItemCategoryCollapsible({
|
|
89
150
|
item,
|
|
90
151
|
onItemClick,
|
|
91
152
|
activePath,
|
|
@@ -118,7 +179,12 @@ export default function DocSidebarItemCategory({
|
|
|
118
179
|
setExpandedItem(toCollapsed ? null : index);
|
|
119
180
|
setCollapsed(toCollapsed);
|
|
120
181
|
};
|
|
121
|
-
useAutoExpandActiveCategory({
|
|
182
|
+
useAutoExpandActiveCategory({
|
|
183
|
+
isActive,
|
|
184
|
+
collapsed,
|
|
185
|
+
updateCollapsed,
|
|
186
|
+
activePath,
|
|
187
|
+
});
|
|
122
188
|
useEffect(() => {
|
|
123
189
|
if (
|
|
124
190
|
collapsible &&
|
|
@@ -129,6 +195,28 @@ export default function DocSidebarItemCategory({
|
|
|
129
195
|
setCollapsed(true);
|
|
130
196
|
}
|
|
131
197
|
}, [collapsible, expandedItem, index, setCollapsed, autoCollapseCategories]);
|
|
198
|
+
const handleItemClick = (e) => {
|
|
199
|
+
onItemClick?.(item);
|
|
200
|
+
if (collapsible) {
|
|
201
|
+
if (href) {
|
|
202
|
+
// When already on the category's page, we collapse it
|
|
203
|
+
// We don't use "isActive" because it would collapse the
|
|
204
|
+
// category even when we browse a children element
|
|
205
|
+
// See https://github.com/facebook/docusaurus/issues/11213
|
|
206
|
+
if (isCurrentPage) {
|
|
207
|
+
e.preventDefault();
|
|
208
|
+
updateCollapsed();
|
|
209
|
+
} else {
|
|
210
|
+
// When navigating to a new category, we always expand
|
|
211
|
+
// see https://github.com/facebook/docusaurus/issues/10854#issuecomment-2609616182
|
|
212
|
+
updateCollapsed(false);
|
|
213
|
+
}
|
|
214
|
+
} else {
|
|
215
|
+
e.preventDefault();
|
|
216
|
+
updateCollapsed();
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
};
|
|
132
220
|
return (
|
|
133
221
|
<li
|
|
134
222
|
className={clsx(
|
|
@@ -145,43 +233,18 @@ export default function DocSidebarItemCategory({
|
|
|
145
233
|
'menu__list-item-collapsible--active': isCurrentPage,
|
|
146
234
|
})}>
|
|
147
235
|
<Link
|
|
148
|
-
className={clsx('menu__link', {
|
|
236
|
+
className={clsx(styles.categoryLink, 'menu__link', {
|
|
149
237
|
'menu__link--sublist': collapsible,
|
|
150
238
|
'menu__link--sublist-caret': !href && collapsible,
|
|
151
239
|
'menu__link--active': isActive,
|
|
152
240
|
})}
|
|
153
|
-
onClick={
|
|
154
|
-
collapsible
|
|
155
|
-
? (e) => {
|
|
156
|
-
onItemClick?.(item);
|
|
157
|
-
if (href) {
|
|
158
|
-
// When already on the category's page, we collapse it
|
|
159
|
-
// We don't use "isActive" because it would collapse the
|
|
160
|
-
// category even when we browse a children element
|
|
161
|
-
// See https://github.com/facebook/docusaurus/issues/11213
|
|
162
|
-
if (isCurrentPage) {
|
|
163
|
-
e.preventDefault();
|
|
164
|
-
updateCollapsed();
|
|
165
|
-
} else {
|
|
166
|
-
// When navigating to a new category, we always expand
|
|
167
|
-
// see https://github.com/facebook/docusaurus/issues/10854#issuecomment-2609616182
|
|
168
|
-
updateCollapsed(false);
|
|
169
|
-
}
|
|
170
|
-
} else {
|
|
171
|
-
e.preventDefault();
|
|
172
|
-
updateCollapsed();
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
: () => {
|
|
176
|
-
onItemClick?.(item);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
241
|
+
onClick={handleItemClick}
|
|
179
242
|
aria-current={isCurrentPage ? 'page' : undefined}
|
|
180
243
|
role={collapsible && !href ? 'button' : undefined}
|
|
181
244
|
aria-expanded={collapsible && !href ? !collapsed : undefined}
|
|
182
245
|
href={collapsible ? hrefWithSSRFallback ?? '#' : hrefWithSSRFallback}
|
|
183
246
|
{...props}>
|
|
184
|
-
{label}
|
|
247
|
+
<CategoryLinkLabel label={label} />
|
|
185
248
|
</Link>
|
|
186
249
|
{href && collapsible && (
|
|
187
250
|
<CollapseButton
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
.categoryLink {
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
TODO merge this logic back in Infima?
|
|
14
|
+
*/
|
|
15
|
+
:global(.menu__link--sublist-caret)::after {
|
|
16
|
+
margin-left: var(--ifm-menu-link-padding-vertical);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.categoryLinkLabel {
|
|
20
|
+
flex: 1;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
display: -webkit-box;
|
|
23
|
+
line-clamp: 2;
|
|
24
|
+
-webkit-box-orient: vertical;
|
|
25
|
+
-webkit-line-clamp: 2;
|
|
26
|
+
}
|
|
@@ -12,6 +12,13 @@ import Link from '@docusaurus/Link';
|
|
|
12
12
|
import isInternalUrl from '@docusaurus/isInternalUrl';
|
|
13
13
|
import IconExternalLink from '@theme/Icon/ExternalLink';
|
|
14
14
|
import styles from './styles.module.css';
|
|
15
|
+
function LinkLabel({label}) {
|
|
16
|
+
return (
|
|
17
|
+
<span title={label} className={styles.linkLabel}>
|
|
18
|
+
{label}
|
|
19
|
+
</span>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
15
22
|
export default function DocSidebarItemLink({
|
|
16
23
|
item,
|
|
17
24
|
onItemClick,
|
|
@@ -47,7 +54,7 @@ export default function DocSidebarItemLink({
|
|
|
47
54
|
onClick: onItemClick ? () => onItemClick(item) : undefined,
|
|
48
55
|
})}
|
|
49
56
|
{...props}>
|
|
50
|
-
{label}
|
|
57
|
+
<LinkLabel label={label} />
|
|
51
58
|
{!isInternalLink && <IconExternalLink />}
|
|
52
59
|
</Link>
|
|
53
60
|
</li>
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import {translate} from '@docusaurus/Translate';
|
|
8
9
|
import styles from './styles.module.css';
|
|
9
10
|
// References symbol in docusaurus-theme-classic/src/inlineSvgSprites.ts
|
|
10
11
|
// See why: https://github.com/facebook/docusaurus/issues/5865
|
|
@@ -14,7 +15,11 @@ export default function IconExternalLink({width = 13.5, height = 13.5}) {
|
|
|
14
15
|
<svg
|
|
15
16
|
width={width}
|
|
16
17
|
height={height}
|
|
17
|
-
aria-
|
|
18
|
+
aria-label={translate({
|
|
19
|
+
id: 'theme.IconExternalLink.ariaLabel',
|
|
20
|
+
message: '(opens in new tab)',
|
|
21
|
+
description: 'The ARIA label for the external link icon',
|
|
22
|
+
})}
|
|
18
23
|
className={styles.iconExternalLink}>
|
|
19
24
|
<use href={svgSprite} />
|
|
20
25
|
</svg>
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
+
import clsx from 'clsx';
|
|
8
|
+
import styles from './styles.module.css';
|
|
7
9
|
// SVG Source: https://svgl.app/
|
|
8
10
|
function Bluesky(props) {
|
|
9
11
|
return (
|
|
@@ -13,11 +15,10 @@ function Bluesky(props) {
|
|
|
13
15
|
height="1em"
|
|
14
16
|
preserveAspectRatio="xMidYMid"
|
|
15
17
|
viewBox="0 0 256 226"
|
|
16
|
-
{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/>
|
|
18
|
+
style={{'--dark': '#0085ff', '--light': '#0085ff'}}
|
|
19
|
+
{...props}
|
|
20
|
+
className={clsx(props.className, styles.blueskySvg)}>
|
|
21
|
+
<path d="M55.491 15.172c29.35 22.035 60.917 66.712 72.509 90.686 11.592-23.974 43.159-68.651 72.509-90.686C221.686-.727 256-13.028 256 26.116c0 7.818-4.482 65.674-7.111 75.068-9.138 32.654-42.436 40.983-72.057 35.942 51.775 8.812 64.946 38 36.501 67.187-54.021 55.433-77.644-13.908-83.696-31.676-1.11-3.257-1.63-4.78-1.637-3.485-.008-1.296-.527.228-1.637 3.485-6.052 17.768-29.675 87.11-83.696 31.676-28.445-29.187-15.274-58.375 36.5-67.187-29.62 5.041-62.918-3.288-72.056-35.942C4.482 91.79 0 33.934 0 26.116 0-13.028 34.314-.727 55.491 15.172Z" />
|
|
21
22
|
</svg>
|
|
22
23
|
);
|
|
23
24
|
}
|
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
|
|
8
|
+
[data-theme='dark'] .blueskySvg {
|
|
9
|
+
fill: var(--light);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
[data-theme='light'] .blueskySvg {
|
|
13
|
+
fill: var(--dark);
|
|
11
14
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
// SVG Source: https://
|
|
7
|
+
// SVG Source: https://github.com/tabler/tabler-icons
|
|
8
8
|
function DefaultSocial(props) {
|
|
9
9
|
return (
|
|
10
10
|
<svg
|
|
@@ -19,11 +19,11 @@ function DefaultSocial(props) {
|
|
|
19
19
|
strokeLinejoin="round"
|
|
20
20
|
{...props}>
|
|
21
21
|
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
22
|
-
<path d="
|
|
23
|
-
<path d="
|
|
24
|
-
<path d="
|
|
25
|
-
<path d="M11.
|
|
26
|
-
<path d="M12.
|
|
22
|
+
<path d="M1.2 12a10.8 10.8 0 1 0 21.6 0a10.8 10.8 0 0 0 -21.6 0" />
|
|
23
|
+
<path d="M1.92 8.4h20.16" />
|
|
24
|
+
<path d="M1.92 15.6h20.16" />
|
|
25
|
+
<path d="M11.4 1.2a20.4 20.4 0 0 0 0 21.6" />
|
|
26
|
+
<path d="M12.6 1.2a20.4 20.4 0 0 1 0 21.6" />
|
|
27
27
|
</svg>
|
|
28
28
|
);
|
|
29
29
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode, SVGProps } from 'react';
|
|
8
|
+
declare function Email(props: SVGProps<SVGSVGElement>): ReactNode;
|
|
9
|
+
export default Email;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
// SVG Source: https://github.com/tabler/tabler-icons
|
|
8
|
+
function Email(props) {
|
|
9
|
+
return (
|
|
10
|
+
<svg
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
viewBox="0 0 24 24"
|
|
13
|
+
fill="none"
|
|
14
|
+
stroke="currentColor"
|
|
15
|
+
strokeLinecap="round"
|
|
16
|
+
strokeLinejoin="round"
|
|
17
|
+
strokeWidth={2}
|
|
18
|
+
{...props}>
|
|
19
|
+
<path stroke="none" d="M0 0h24v24H0z" />
|
|
20
|
+
<path d="M7.2 12a4.8 4.8 0 1 0 9.6 0 4.8 4.8 0 1 0-9.6 0" />
|
|
21
|
+
<path d="M16.8 12v1.8a3 3 0 0 0 6 0V12a10.8 10.8 0 1 0-6.6 9.936" />
|
|
22
|
+
</svg>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
export default Email;
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
7
|
+
import type { SVGProps, ReactNode } from 'react';
|
|
8
8
|
declare function LinkedIn(props: SVGProps<SVGSVGElement>): ReactNode;
|
|
9
9
|
export default LinkedIn;
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
+
import clsx from 'clsx';
|
|
8
|
+
import styles from './styles.module.css';
|
|
7
9
|
// SVG Source: https://svgl.app/
|
|
8
10
|
function LinkedIn(props) {
|
|
9
11
|
return (
|
|
@@ -13,11 +15,10 @@ function LinkedIn(props) {
|
|
|
13
15
|
height="1em"
|
|
14
16
|
preserveAspectRatio="xMidYMid"
|
|
15
17
|
viewBox="0 0 256 256"
|
|
16
|
-
{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/>
|
|
18
|
+
style={{'--dark': '#0a66c2', '--light': '#ffffffe6'}}
|
|
19
|
+
{...props}
|
|
20
|
+
className={clsx(props.className, styles.linkedinSvg)}>
|
|
21
|
+
<path d="M218.123 218.127h-37.931v-59.403c0-14.165-.253-32.4-19.728-32.4-19.756 0-22.779 15.434-22.779 31.369v60.43h-37.93V95.967h36.413v16.694h.51a39.907 39.907 0 0 1 35.928-19.733c38.445 0 45.533 25.288 45.533 58.186l-.016 67.013ZM56.955 79.27c-12.157.002-22.014-9.852-22.016-22.009-.002-12.157 9.851-22.014 22.008-22.016 12.157-.003 22.014 9.851 22.016 22.008A22.013 22.013 0 0 1 56.955 79.27m18.966 138.858H37.95V95.967h37.97v122.16ZM237.033.018H18.89C8.58-.098.125 8.161-.001 18.471v219.053c.122 10.315 8.576 18.582 18.89 18.474h218.144c10.336.128 18.823-8.139 18.966-18.474V18.454c-.147-10.33-8.635-18.588-18.966-18.453" />
|
|
21
22
|
</svg>
|
|
22
23
|
);
|
|
23
24
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
[data-theme='dark'] .linkedinSvg {
|
|
9
|
+
fill: var(--light);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
[data-theme='light'] .linkedinSvg {
|
|
13
|
+
fill: var(--dark);
|
|
14
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import clsx from 'clsx';
|
|
9
|
+
import Link from '@docusaurus/Link';
|
|
10
|
+
import {useThemeConfig} from '@docusaurus/theme-common';
|
|
11
|
+
import styles from './styles.module.css';
|
|
12
|
+
function isFootnoteRef(props) {
|
|
13
|
+
return props['data-footnote-ref'] === true;
|
|
14
|
+
}
|
|
15
|
+
function FootnoteRefLink(props) {
|
|
16
|
+
const {
|
|
17
|
+
navbar: {hideOnScroll},
|
|
18
|
+
} = useThemeConfig();
|
|
19
|
+
return (
|
|
20
|
+
<Link
|
|
21
|
+
{...props}
|
|
22
|
+
className={clsx(
|
|
23
|
+
hideOnScroll
|
|
24
|
+
? styles.footnoteRefHideOnScrollNavbar
|
|
25
|
+
: styles.footnoteRefStickyNavbar,
|
|
26
|
+
props.className,
|
|
27
|
+
)}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export default function MDXA(props) {
|
|
32
|
+
if (isFootnoteRef(props)) {
|
|
33
|
+
return <FootnoteRefLink {...props} />;
|
|
34
|
+
}
|
|
35
|
+
return <Link {...props} />;
|
|
36
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
When the navbar is sticky, ensure that on footnote click,
|
|
10
|
+
the browser does not scroll to the ref behind the navbar
|
|
11
|
+
See https://github.com/facebook/docusaurus/issues/11232
|
|
12
|
+
See also headings case https://x.com/JoshWComeau/status/1332015868725891076
|
|
13
|
+
*/
|
|
14
|
+
.footnoteRefStickyNavbar {
|
|
15
|
+
scroll-margin-top: calc(var(--ifm-navbar-height) + 0.5rem);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.footnoteRefHideOnScrollNavbar {
|
|
19
|
+
scroll-margin-top: 0.5rem;
|
|
20
|
+
}
|
|
@@ -22,7 +22,6 @@ See https://github.com/facebook/docusaurus/pull/9385
|
|
|
22
22
|
|
|
23
23
|
@media (min-width: 997px) {
|
|
24
24
|
.navbarSearchContainer {
|
|
25
|
-
padding: var(--ifm-navbar-item-padding-
|
|
26
|
-
var(--ifm-navbar-item-padding-horizontal);
|
|
25
|
+
padding: 0 var(--ifm-navbar-item-padding-horizontal);
|
|
27
26
|
}
|
|
28
27
|
}
|