@docusaurus/theme-classic 0.0.0-5536 → 0.0.0-5537
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/theme/CodeBlock/CopyButton/index.js +4 -6
- package/lib/theme/CodeBlock/WordWrapButton/index.js +2 -9
- package/lib/theme/Icon/Copy/index.d.ts +9 -0
- package/lib/theme/Icon/Copy/index.js +17 -0
- package/lib/theme/Icon/Success/index.d.ts +9 -0
- package/lib/theme/Icon/Success/index.js +17 -0
- package/lib/theme/Icon/WordWrap/index.d.ts +9 -0
- package/lib/theme/Icon/WordWrap/index.js +17 -0
- package/package.json +14 -14
- package/src/theme/CodeBlock/CopyButton/index.tsx +4 -6
- package/src/theme/CodeBlock/WordWrapButton/index.tsx +2 -9
- package/src/theme/Icon/Copy/index.tsx +20 -0
- package/src/theme/Icon/Success/index.tsx +20 -0
- package/src/theme/Icon/WordWrap/index.tsx +20 -0
- package/src/theme-classic.d.ts +24 -0
|
@@ -9,6 +9,8 @@ import clsx from 'clsx';
|
|
|
9
9
|
// @ts-expect-error: TODO, we need to make theme-classic have type: module
|
|
10
10
|
import copy from 'copy-text-to-clipboard';
|
|
11
11
|
import {translate} from '@docusaurus/Translate';
|
|
12
|
+
import IconCopy from '@theme/Icon/Copy';
|
|
13
|
+
import IconSuccess from '@theme/Icon/Success';
|
|
12
14
|
import styles from './styles.module.css';
|
|
13
15
|
export default function CopyButton({code, className}) {
|
|
14
16
|
const [isCopied, setIsCopied] = useState(false);
|
|
@@ -50,12 +52,8 @@ export default function CopyButton({code, className}) {
|
|
|
50
52
|
)}
|
|
51
53
|
onClick={handleCopyCode}>
|
|
52
54
|
<span className={styles.copyButtonIcons} aria-hidden="true">
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
</svg>
|
|
56
|
-
<svg className={styles.copyButtonSuccessIcon} viewBox="0 0 24 24">
|
|
57
|
-
<path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" />
|
|
58
|
-
</svg>
|
|
55
|
+
<IconCopy className={styles.copyButtonIcon} />
|
|
56
|
+
<IconSuccess className={styles.copyButtonSuccessIcon} />
|
|
59
57
|
</span>
|
|
60
58
|
</button>
|
|
61
59
|
);
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import {translate} from '@docusaurus/Translate';
|
|
10
|
+
import IconWordWrap from '@theme/Icon/WordWrap';
|
|
10
11
|
import styles from './styles.module.css';
|
|
11
12
|
export default function WordWrapButton({className, onClick, isEnabled}) {
|
|
12
13
|
const title = translate({
|
|
@@ -26,15 +27,7 @@ export default function WordWrapButton({className, onClick, isEnabled}) {
|
|
|
26
27
|
)}
|
|
27
28
|
aria-label={title}
|
|
28
29
|
title={title}>
|
|
29
|
-
<
|
|
30
|
-
className={styles.wordWrapButtonIcon}
|
|
31
|
-
viewBox="0 0 24 24"
|
|
32
|
-
aria-hidden="true">
|
|
33
|
-
<path
|
|
34
|
-
fill="currentColor"
|
|
35
|
-
d="M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"
|
|
36
|
-
/>
|
|
37
|
-
</svg>
|
|
30
|
+
<IconWordWrap className={styles.wordWrapButtonIcon} aria-hidden="true" />
|
|
38
31
|
</button>
|
|
39
32
|
);
|
|
40
33
|
}
|
|
@@ -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
|
+
/// <reference types="react" />
|
|
8
|
+
import type { Props } from '@theme/Icon/Copy';
|
|
9
|
+
export default function IconCopy(props: Props): JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
export default function IconCopy(props) {
|
|
9
|
+
return (
|
|
10
|
+
<svg viewBox="0 0 24 24" {...props}>
|
|
11
|
+
<path
|
|
12
|
+
fill="currentColor"
|
|
13
|
+
d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -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
|
+
/// <reference types="react" />
|
|
8
|
+
import type { Props } from '@theme/Icon/Success';
|
|
9
|
+
export default function IconSuccess(props: Props): JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
export default function IconSuccess(props) {
|
|
9
|
+
return (
|
|
10
|
+
<svg viewBox="0 0 24 24" {...props}>
|
|
11
|
+
<path
|
|
12
|
+
fill="currentColor"
|
|
13
|
+
d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -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
|
+
/// <reference types="react" />
|
|
8
|
+
import type { Props } from '@theme/Icon/WordWrap';
|
|
9
|
+
export default function IconWordWrap(props: Props): JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
export default function IconWordWrap(props) {
|
|
9
|
+
return (
|
|
10
|
+
<svg viewBox="0 0 24 24" {...props}>
|
|
11
|
+
<path
|
|
12
|
+
fill="currentColor"
|
|
13
|
+
d="M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/theme-classic",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-5537",
|
|
4
4
|
"description": "Classic theme for Docusaurus",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/theme-classic.d.ts",
|
|
@@ -20,18 +20,18 @@
|
|
|
20
20
|
"copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@docusaurus/core": "0.0.0-
|
|
24
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
25
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
26
|
-
"@docusaurus/plugin-content-blog": "0.0.0-
|
|
27
|
-
"@docusaurus/plugin-content-docs": "0.0.0-
|
|
28
|
-
"@docusaurus/plugin-content-pages": "0.0.0-
|
|
29
|
-
"@docusaurus/theme-common": "0.0.0-
|
|
30
|
-
"@docusaurus/theme-translations": "0.0.0-
|
|
31
|
-
"@docusaurus/types": "0.0.0-
|
|
32
|
-
"@docusaurus/utils": "0.0.0-
|
|
33
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
34
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
23
|
+
"@docusaurus/core": "0.0.0-5537",
|
|
24
|
+
"@docusaurus/mdx-loader": "0.0.0-5537",
|
|
25
|
+
"@docusaurus/module-type-aliases": "0.0.0-5537",
|
|
26
|
+
"@docusaurus/plugin-content-blog": "0.0.0-5537",
|
|
27
|
+
"@docusaurus/plugin-content-docs": "0.0.0-5537",
|
|
28
|
+
"@docusaurus/plugin-content-pages": "0.0.0-5537",
|
|
29
|
+
"@docusaurus/theme-common": "0.0.0-5537",
|
|
30
|
+
"@docusaurus/theme-translations": "0.0.0-5537",
|
|
31
|
+
"@docusaurus/types": "0.0.0-5537",
|
|
32
|
+
"@docusaurus/utils": "0.0.0-5537",
|
|
33
|
+
"@docusaurus/utils-common": "0.0.0-5537",
|
|
34
|
+
"@docusaurus/utils-validation": "0.0.0-5537",
|
|
35
35
|
"@mdx-js/react": "^1.6.22",
|
|
36
36
|
"clsx": "^1.2.1",
|
|
37
37
|
"copy-text-to-clipboard": "^3.0.1",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=16.14"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "0d741c45967525fefc8f471d88371aefe8a0ad86"
|
|
66
66
|
}
|
|
@@ -11,6 +11,8 @@ import clsx from 'clsx';
|
|
|
11
11
|
import copy from 'copy-text-to-clipboard';
|
|
12
12
|
import {translate} from '@docusaurus/Translate';
|
|
13
13
|
import type {Props} from '@theme/CodeBlock/CopyButton';
|
|
14
|
+
import IconCopy from '@theme/Icon/Copy';
|
|
15
|
+
import IconSuccess from '@theme/Icon/Success';
|
|
14
16
|
|
|
15
17
|
import styles from './styles.module.css';
|
|
16
18
|
|
|
@@ -56,12 +58,8 @@ export default function CopyButton({code, className}: Props): JSX.Element {
|
|
|
56
58
|
)}
|
|
57
59
|
onClick={handleCopyCode}>
|
|
58
60
|
<span className={styles.copyButtonIcons} aria-hidden="true">
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
</svg>
|
|
62
|
-
<svg className={styles.copyButtonSuccessIcon} viewBox="0 0 24 24">
|
|
63
|
-
<path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" />
|
|
64
|
-
</svg>
|
|
61
|
+
<IconCopy className={styles.copyButtonIcon} />
|
|
62
|
+
<IconSuccess className={styles.copyButtonSuccessIcon} />
|
|
65
63
|
</span>
|
|
66
64
|
</button>
|
|
67
65
|
);
|
|
@@ -9,6 +9,7 @@ import React from 'react';
|
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import {translate} from '@docusaurus/Translate';
|
|
11
11
|
import type {Props} from '@theme/CodeBlock/WordWrapButton';
|
|
12
|
+
import IconWordWrap from '@theme/Icon/WordWrap';
|
|
12
13
|
|
|
13
14
|
import styles from './styles.module.css';
|
|
14
15
|
|
|
@@ -35,15 +36,7 @@ export default function WordWrapButton({
|
|
|
35
36
|
)}
|
|
36
37
|
aria-label={title}
|
|
37
38
|
title={title}>
|
|
38
|
-
<
|
|
39
|
-
className={styles.wordWrapButtonIcon}
|
|
40
|
-
viewBox="0 0 24 24"
|
|
41
|
-
aria-hidden="true">
|
|
42
|
-
<path
|
|
43
|
-
fill="currentColor"
|
|
44
|
-
d="M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"
|
|
45
|
-
/>
|
|
46
|
-
</svg>
|
|
39
|
+
<IconWordWrap className={styles.wordWrapButtonIcon} aria-hidden="true" />
|
|
47
40
|
</button>
|
|
48
41
|
);
|
|
49
42
|
}
|
|
@@ -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
|
+
import React from 'react';
|
|
9
|
+
import type {Props} from '@theme/Icon/Copy';
|
|
10
|
+
|
|
11
|
+
export default function IconCopy(props: Props): JSX.Element {
|
|
12
|
+
return (
|
|
13
|
+
<svg viewBox="0 0 24 24" {...props}>
|
|
14
|
+
<path
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -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
|
+
import React from 'react';
|
|
9
|
+
import type {Props} from '@theme/Icon/Success';
|
|
10
|
+
|
|
11
|
+
export default function IconSuccess(props: Props): JSX.Element {
|
|
12
|
+
return (
|
|
13
|
+
<svg viewBox="0 0 24 24" {...props}>
|
|
14
|
+
<path
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -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
|
+
import React from 'react';
|
|
9
|
+
import type {Props} from '@theme/Icon/WordWrap';
|
|
10
|
+
|
|
11
|
+
export default function IconWordWrap(props: Props): JSX.Element {
|
|
12
|
+
return (
|
|
13
|
+
<svg viewBox="0 0 24 24" {...props}>
|
|
14
|
+
<path
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
d="M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
}
|
package/src/theme-classic.d.ts
CHANGED
|
@@ -1431,6 +1431,14 @@ declare module '@theme/Icon/Close' {
|
|
|
1431
1431
|
export default function IconClose(props: Props): JSX.Element;
|
|
1432
1432
|
}
|
|
1433
1433
|
|
|
1434
|
+
declare module '@theme/Icon/Copy' {
|
|
1435
|
+
import type {ComponentProps} from 'react';
|
|
1436
|
+
|
|
1437
|
+
export interface Props extends ComponentProps<'svg'> {}
|
|
1438
|
+
|
|
1439
|
+
export default function IconCopy(props: Props): JSX.Element;
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1434
1442
|
declare module '@theme/Icon/Language' {
|
|
1435
1443
|
import type {ComponentProps} from 'react';
|
|
1436
1444
|
|
|
@@ -1439,6 +1447,14 @@ declare module '@theme/Icon/Language' {
|
|
|
1439
1447
|
export default function IconLanguage(props: Props): JSX.Element;
|
|
1440
1448
|
}
|
|
1441
1449
|
|
|
1450
|
+
declare module '@theme/Icon/Success' {
|
|
1451
|
+
import type {ComponentProps} from 'react';
|
|
1452
|
+
|
|
1453
|
+
export interface Props extends ComponentProps<'svg'> {}
|
|
1454
|
+
|
|
1455
|
+
export default function IconSuccess(props: Props): JSX.Element;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1442
1458
|
declare module '@theme/Icon/ExternalLink' {
|
|
1443
1459
|
import type {ComponentProps} from 'react';
|
|
1444
1460
|
|
|
@@ -1447,6 +1463,14 @@ declare module '@theme/Icon/ExternalLink' {
|
|
|
1447
1463
|
export default function IconExternalLink(props: Props): JSX.Element;
|
|
1448
1464
|
}
|
|
1449
1465
|
|
|
1466
|
+
declare module '@theme/Icon/WordWrap' {
|
|
1467
|
+
import type {ComponentProps} from 'react';
|
|
1468
|
+
|
|
1469
|
+
export interface Props extends ComponentProps<'svg'> {}
|
|
1470
|
+
|
|
1471
|
+
export default function IconWordWrap(props: Props): JSX.Element;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1450
1474
|
declare module '@theme/TagsListByLetter' {
|
|
1451
1475
|
import type {TagsListItem} from '@docusaurus/utils';
|
|
1452
1476
|
|