docusaurus-live-brython 3.0.0-beta.9 → 3.0.1
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/.devcontainer/devcontainer.json +38 -0
- package/.prettierignore +17 -0
- package/.prettierrc +9 -8
- package/CHANGELOG.md +5 -0
- package/README.md +7 -4
- package/lib/assets/py_back_trace.py +2 -1
- package/lib/index.d.ts +1 -7
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +94 -16
- package/lib/options.d.ts +1 -0
- package/lib/options.d.ts.map +1 -0
- package/lib/options.js +2 -2
- package/lib/theme/CodeBlock/index.d.ts +3 -3
- package/lib/theme/CodeBlock/index.d.ts.map +1 -0
- package/lib/theme/CodeBlock/index.jsx +24 -14
- package/lib/theme/CodeEditor/Actions/DownloadCode.d.ts +1 -0
- package/lib/theme/CodeEditor/Actions/DownloadCode.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Actions/DownloadCode.jsx +8 -8
- package/lib/theme/CodeEditor/Actions/Reset.d.ts +1 -0
- package/lib/theme/CodeEditor/Actions/Reset.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Actions/Reset.jsx +5 -5
- package/lib/theme/CodeEditor/Actions/RunCode.d.ts +2 -1
- package/lib/theme/CodeEditor/Actions/RunCode.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Actions/RunCode.jsx +4 -4
- package/lib/theme/CodeEditor/Actions/ShowRaw.d.ts +1 -0
- package/lib/theme/CodeEditor/Actions/ShowRaw.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Actions/ShowRaw.jsx +13 -7
- package/lib/theme/CodeEditor/Actions/ShowSyncStatus.d.ts +1 -0
- package/lib/theme/CodeEditor/Actions/ShowSyncStatus.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Actions/ShowSyncStatus.jsx +21 -16
- package/lib/theme/CodeEditor/Actions/styles.module.css +2 -3
- package/lib/theme/CodeEditor/BrythonCommunicator.d.ts +2 -1
- package/lib/theme/CodeEditor/BrythonCommunicator.d.ts.map +1 -0
- package/lib/theme/CodeEditor/BrythonCommunicator.jsx +13 -9
- package/lib/theme/CodeEditor/Button/index.d.ts +3 -2
- package/lib/theme/CodeEditor/Button/index.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Button/index.jsx +1 -1
- package/lib/theme/CodeEditor/Button/styles.module.css +1 -1
- package/lib/theme/CodeEditor/CodeHistory/index.d.ts +1 -0
- package/lib/theme/CodeEditor/CodeHistory/index.d.ts.map +1 -0
- package/lib/theme/CodeEditor/CodeHistory/index.jsx +26 -15
- package/lib/theme/CodeEditor/CodeHistory/styles.module.css +31 -31
- package/lib/theme/CodeEditor/ContextEditor/index.d.ts +22 -0
- package/lib/theme/CodeEditor/ContextEditor/index.d.ts.map +1 -0
- package/lib/theme/CodeEditor/ContextEditor/index.jsx +36 -0
- package/lib/theme/CodeEditor/Editor/EditorAce.d.ts +2 -1
- package/lib/theme/CodeEditor/Editor/EditorAce.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Editor/EditorAce.jsx +17 -14
- package/lib/theme/CodeEditor/Editor/Header/index.d.ts +2 -1
- package/lib/theme/CodeEditor/Editor/Header/index.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Editor/Header/index.jsx +12 -12
- package/lib/theme/CodeEditor/Editor/Header/styles.module.css +7 -7
- package/lib/theme/CodeEditor/Editor/HiddenCode/index.d.ts +8 -0
- package/lib/theme/CodeEditor/Editor/HiddenCode/index.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Editor/HiddenCode/index.jsx +27 -0
- package/lib/theme/CodeEditor/Editor/HiddenCode/styles.module.css +52 -0
- package/lib/theme/CodeEditor/Editor/Result/Graphics/Canvas.d.ts +1 -0
- package/lib/theme/CodeEditor/Editor/Result/Graphics/Canvas.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Editor/Result/Graphics/Canvas.jsx +8 -9
- package/lib/theme/CodeEditor/Editor/Result/Graphics/Turtle.d.ts +1 -0
- package/lib/theme/CodeEditor/Editor/Result/Graphics/Turtle.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Editor/Result/Graphics/Turtle.jsx +11 -11
- package/lib/theme/CodeEditor/Editor/Result/Graphics/index.d.ts +4 -3
- package/lib/theme/CodeEditor/Editor/Result/Graphics/index.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Editor/Result/Graphics/index.jsx +12 -10
- package/lib/theme/CodeEditor/Editor/Result/Graphics/styles.module.css +2 -2
- package/lib/theme/CodeEditor/Editor/Result/index.d.ts +2 -3
- package/lib/theme/CodeEditor/Editor/Result/index.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Editor/Result/index.jsx +6 -9
- package/lib/theme/CodeEditor/Editor/Result/styles.module.css +15 -10
- package/lib/theme/CodeEditor/Editor/index.d.ts +6 -3
- package/lib/theme/CodeEditor/Editor/index.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Editor/index.jsx +34 -28
- package/lib/theme/CodeEditor/Editor/styles.module.css +15 -7
- package/lib/theme/CodeEditor/Editor/utils/checkForButtonClick.d.ts +1 -0
- package/lib/theme/CodeEditor/Editor/utils/checkForButtonClick.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Editor/utils/saveSvg.d.ts +1 -0
- package/lib/theme/CodeEditor/Editor/utils/saveSvg.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Editor/utils/saveSvg.js +19 -8
- package/lib/theme/CodeEditor/Editor/utils/svgWithoutAnimations.d.ts +1 -0
- package/lib/theme/CodeEditor/Editor/utils/svgWithoutAnimations.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Editor/utils/svgWithoutAnimations.js +43 -49
- package/lib/theme/CodeEditor/Icon/icons.d.ts +4 -1
- package/lib/theme/CodeEditor/Icon/icons.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Icon/icons.js +3 -1
- package/lib/theme/CodeEditor/Icon/index.d.ts +4 -2
- package/lib/theme/CodeEditor/Icon/index.d.ts.map +1 -0
- package/lib/theme/CodeEditor/Icon/index.jsx +10 -3
- package/lib/theme/CodeEditor/Icon/styles.module.css +1 -1
- package/lib/theme/CodeEditor/WithScript/ScriptContext.d.ts +8 -0
- package/lib/theme/CodeEditor/WithScript/ScriptContext.d.ts.map +1 -0
- package/lib/theme/CodeEditor/WithScript/ScriptContext.jsx +27 -0
- package/lib/theme/CodeEditor/WithScript/Storage.d.ts +2 -1
- package/lib/theme/CodeEditor/WithScript/Storage.d.ts.map +1 -0
- package/lib/theme/CodeEditor/WithScript/Types.d.ts +12 -4
- package/lib/theme/CodeEditor/WithScript/Types.d.ts.map +1 -0
- package/lib/theme/CodeEditor/WithScript/bryRunner.d.ts +3 -0
- package/lib/theme/CodeEditor/WithScript/bryRunner.d.ts.map +1 -0
- package/lib/theme/CodeEditor/WithScript/bryRunner.js +29 -0
- package/lib/theme/CodeEditor/WithScript/createStore.d.ts +4 -0
- package/lib/theme/CodeEditor/WithScript/createStore.d.ts.map +1 -0
- package/lib/theme/CodeEditor/WithScript/{Store.jsx → createStore.js} +62 -74
- package/lib/theme/CodeEditor/WithScript/helpers.d.ts +1 -4
- package/lib/theme/CodeEditor/WithScript/helpers.d.ts.map +1 -0
- package/lib/theme/CodeEditor/WithScript/helpers.js +4 -14
- package/lib/theme/CodeEditor/constants.d.ts +1 -0
- package/lib/theme/CodeEditor/constants.d.ts.map +1 -0
- package/lib/theme/CodeEditor/hooks/index.d.ts +3 -0
- package/lib/theme/CodeEditor/hooks/index.d.ts.map +1 -0
- package/lib/theme/CodeEditor/hooks/index.js +2 -0
- package/lib/theme/CodeEditor/hooks/useScript.d.ts +3 -0
- package/lib/theme/CodeEditor/hooks/useScript.d.ts.map +1 -0
- package/lib/theme/CodeEditor/hooks/useScript.js +4 -0
- package/lib/theme/CodeEditor/hooks/useStore.d.ts +3 -0
- package/lib/theme/CodeEditor/hooks/useStore.d.ts.map +1 -0
- package/lib/theme/CodeEditor/hooks/useStore.js +10 -0
- package/lib/theme/CodeEditor/index.d.ts +24 -5
- package/lib/theme/CodeEditor/index.d.ts.map +1 -0
- package/lib/theme/CodeEditor/index.jsx +17 -16
- package/lib/theme/CodeEditor/styles.module.css +28 -30
- package/og-image.md +23 -0
- package/package.json +35 -20
- package/src/assets/py_back_trace.py +2 -1
- package/src/index.ts +96 -25
- package/src/options.ts +12 -12
- package/src/theme/CodeBlock/index.tsx +44 -68
- package/src/theme/CodeEditor/Actions/DownloadCode.tsx +23 -22
- package/src/theme/CodeEditor/Actions/Reset.tsx +14 -12
- package/src/theme/CodeEditor/Actions/RunCode.tsx +14 -11
- package/src/theme/CodeEditor/Actions/ShowRaw.tsx +17 -11
- package/src/theme/CodeEditor/Actions/ShowSyncStatus.tsx +32 -27
- package/src/theme/CodeEditor/Actions/styles.module.css +2 -3
- package/src/theme/CodeEditor/BrythonCommunicator.tsx +16 -19
- package/src/theme/CodeEditor/Button/index.tsx +17 -13
- package/src/theme/CodeEditor/Button/styles.module.css +1 -1
- package/src/theme/CodeEditor/CodeHistory/index.tsx +32 -20
- package/src/theme/CodeEditor/CodeHistory/styles.module.css +31 -31
- package/src/theme/CodeEditor/ContextEditor/index.tsx +74 -0
- package/src/theme/CodeEditor/Editor/EditorAce.tsx +20 -16
- package/src/theme/CodeEditor/Editor/Header/index.tsx +13 -19
- package/src/theme/CodeEditor/Editor/Header/styles.module.css +7 -7
- package/src/theme/CodeEditor/Editor/HiddenCode/index.tsx +49 -0
- package/src/theme/CodeEditor/Editor/HiddenCode/styles.module.css +52 -0
- package/src/theme/CodeEditor/Editor/Result/Graphics/Canvas.tsx +25 -22
- package/src/theme/CodeEditor/Editor/Result/Graphics/Turtle.tsx +23 -19
- package/src/theme/CodeEditor/Editor/Result/Graphics/index.tsx +16 -16
- package/src/theme/CodeEditor/Editor/Result/Graphics/styles.module.css +2 -2
- package/src/theme/CodeEditor/Editor/Result/index.tsx +7 -13
- package/src/theme/CodeEditor/Editor/Result/styles.module.css +15 -10
- package/src/theme/CodeEditor/Editor/index.tsx +67 -65
- package/src/theme/CodeEditor/Editor/styles.module.css +15 -7
- package/src/theme/CodeEditor/Editor/utils/checkForButtonClick.ts +5 -5
- package/src/theme/CodeEditor/Editor/utils/saveSvg.ts +63 -53
- package/src/theme/CodeEditor/Editor/utils/svgWithoutAnimations.ts +182 -201
- package/src/theme/CodeEditor/Icon/icons.ts +27 -13
- package/src/theme/CodeEditor/Icon/index.tsx +31 -11
- package/src/theme/CodeEditor/Icon/styles.module.css +1 -1
- package/src/theme/CodeEditor/WithScript/ScriptContext.tsx +36 -0
- package/src/theme/CodeEditor/WithScript/Storage.ts +3 -3
- package/src/theme/CodeEditor/WithScript/Types.ts +17 -11
- package/src/theme/CodeEditor/WithScript/bryRunner.ts +39 -0
- package/src/theme/CodeEditor/WithScript/createStore.ts +276 -0
- package/src/theme/CodeEditor/WithScript/helpers.ts +16 -26
- package/src/theme/CodeEditor/constants.ts +9 -11
- package/src/theme/CodeEditor/hooks/index.ts +2 -0
- package/src/theme/CodeEditor/hooks/useScript.ts +9 -0
- package/src/theme/CodeEditor/hooks/useStore.ts +15 -0
- package/src/theme/CodeEditor/index.tsx +45 -31
- package/src/theme/CodeEditor/styles.module.css +28 -30
- package/src/typings.d.ts +11 -0
- package/lib/theme/CodeEditor/WithScript/Store.d.ts +0 -15
- package/lib/types.d.ts +0 -28
- package/lib/types.js +0 -1
- package/src/theme/CodeEditor/WithScript/Store.tsx +0 -294
- package/src/types.ts +0 -29
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrythonCommunicator.d.ts","sourceRoot":"","sources":["../../../src/theme/CodeEditor/BrythonCommunicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,QAAA,MAAM,mBAAmB,yBAsCxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { BRYTHON_NOTIFICATION_EVENT, DOM_ELEMENT_IDS } from
|
|
3
|
-
import {
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BRYTHON_NOTIFICATION_EVENT, DOM_ELEMENT_IDS } from '@theme/CodeEditor/constants';
|
|
3
|
+
import { useStore, useScript } from '@theme/CodeEditor/hooks';
|
|
4
4
|
const BrythonCommunicator = () => {
|
|
5
|
-
const
|
|
6
|
-
const codeId =
|
|
5
|
+
const store = useStore();
|
|
6
|
+
const codeId = useScript(store, 'codeId');
|
|
7
7
|
const ref = React.useRef(null);
|
|
8
8
|
React.useEffect(() => {
|
|
9
9
|
const { current } = ref;
|
|
@@ -14,15 +14,19 @@ const BrythonCommunicator = () => {
|
|
|
14
14
|
if (event.detail) {
|
|
15
15
|
const data = event.detail;
|
|
16
16
|
switch (data.type) {
|
|
17
|
-
case
|
|
17
|
+
case 'start':
|
|
18
18
|
store.clearLogMessages();
|
|
19
19
|
store.setExecuting(true);
|
|
20
20
|
break;
|
|
21
|
-
case
|
|
21
|
+
case 'done':
|
|
22
22
|
store.setExecuting(false);
|
|
23
23
|
break;
|
|
24
24
|
default:
|
|
25
|
-
store.addLogMessage(
|
|
25
|
+
store.addLogMessage({
|
|
26
|
+
type: data.type,
|
|
27
|
+
output: data.output,
|
|
28
|
+
timeStamp: data.timeStamp
|
|
29
|
+
});
|
|
26
30
|
break;
|
|
27
31
|
}
|
|
28
32
|
}
|
|
@@ -32,6 +36,6 @@ const BrythonCommunicator = () => {
|
|
|
32
36
|
current.removeEventListener(BRYTHON_NOTIFICATION_EVENT, onBryNotify);
|
|
33
37
|
};
|
|
34
38
|
}, [ref, store]);
|
|
35
|
-
return
|
|
39
|
+
return <div id={DOM_ELEMENT_IDS.communicator(codeId)} ref={ref}></div>;
|
|
36
40
|
};
|
|
37
41
|
export default BrythonCommunicator;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import * as Icons from '
|
|
2
|
+
import * as Icons from '@theme/CodeEditor/Icon/icons';
|
|
3
3
|
export declare enum Color {
|
|
4
4
|
Primary = "button--primary",
|
|
5
5
|
Secondary = "button--secondary",
|
|
@@ -13,7 +13,7 @@ export declare enum Size {
|
|
|
13
13
|
Small = "button--sm",
|
|
14
14
|
Large = "button--lg"
|
|
15
15
|
}
|
|
16
|
-
interface Props {
|
|
16
|
+
export interface Props {
|
|
17
17
|
icon: keyof typeof Icons;
|
|
18
18
|
title?: string;
|
|
19
19
|
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
@@ -25,3 +25,4 @@ interface Props {
|
|
|
25
25
|
}
|
|
26
26
|
declare const Button: (props: Props) => React.JSX.Element;
|
|
27
27
|
export default Button;
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,8BAA8B,CAAC;AAKtD,oBAAY,KAAK;IACb,OAAO,oBAAoB;IAC3B,SAAS,sBAAsB;IAC/B,OAAO,oBAAoB;IAC3B,IAAI,iBAAiB;IACrB,OAAO,oBAAoB;IAC3B,MAAM,mBAAmB;IACzB,IAAI,iBAAiB;CACxB;AACD,oBAAY,IAAI;IACZ,KAAK,eAAe;IACpB,KAAK,eAAe;CACvB;AAED,MAAM,WAAW,KAAK;IAClB,IAAI,EAAE,MAAM,OAAO,KAAK,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACrD,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,MAAM,GAAI,OAAO,KAAK,sBAqB3B,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import styles from './styles.module.css';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
import Icon from '
|
|
4
|
+
import Icon from '@theme/CodeEditor/Icon';
|
|
5
5
|
export var Color;
|
|
6
6
|
(function (Color) {
|
|
7
7
|
Color["Primary"] = "button--primary";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/CodeHistory/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,4BAA4B,CAAC;AAoBpC,QAAA,MAAM,WAAW,yBA2GhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -4,24 +4,24 @@ import styles from './styles.module.css';
|
|
|
4
4
|
import { Prism } from 'prism-react-renderer';
|
|
5
5
|
import Slider from 'rc-slider';
|
|
6
6
|
import 'rc-slider/assets/index.css';
|
|
7
|
-
import {
|
|
7
|
+
import { useStore, useScript } from '@theme/CodeEditor/hooks';
|
|
8
8
|
import Translate, { translate } from '@docusaurus/Translate';
|
|
9
|
-
import Button from '
|
|
10
|
-
import DiffViewer from 'react-diff-viewer';
|
|
9
|
+
import Button from '@theme/CodeEditor/Button';
|
|
10
|
+
import DiffViewer from 'react-diff-viewer-continued';
|
|
11
11
|
import Details from '@theme/Details';
|
|
12
12
|
const highlightSyntax = (str) => {
|
|
13
13
|
if (!str) {
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
return (<span dangerouslySetInnerHTML={{
|
|
17
|
-
__html: Prism.highlight(str, Prism.languages.python, 'python')
|
|
17
|
+
__html: Prism.highlight(str, Prism.languages.python, 'python')
|
|
18
18
|
}}/>);
|
|
19
19
|
};
|
|
20
20
|
const CodeHistory = () => {
|
|
21
21
|
const [version, setVersion] = React.useState(1);
|
|
22
|
-
const
|
|
23
|
-
const versions =
|
|
24
|
-
const versionsLoaded =
|
|
22
|
+
const store = useStore();
|
|
23
|
+
const versions = useScript(store, 'versions');
|
|
24
|
+
const versionsLoaded = useScript(store, 'versionsLoaded');
|
|
25
25
|
if (versions?.length < 2) {
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
@@ -30,11 +30,20 @@ const CodeHistory = () => {
|
|
|
30
30
|
<div className={clsx(styles.summary)}>
|
|
31
31
|
<span className="badge badge--secondary">
|
|
32
32
|
{versionsLoaded
|
|
33
|
-
? translate({
|
|
34
|
-
|
|
33
|
+
? translate({
|
|
34
|
+
message: '{n} Versions',
|
|
35
|
+
id: 'CodeHistory.nVersions.text'
|
|
36
|
+
}, { n: versions.length })
|
|
37
|
+
: translate({
|
|
38
|
+
message: 'Load Versions',
|
|
39
|
+
id: 'CodeHistory.LoadVersions.text'
|
|
40
|
+
})}
|
|
35
41
|
</span>
|
|
36
42
|
<span className={clsx(styles.spacer)}></span>
|
|
37
|
-
<Button icon=
|
|
43
|
+
<Button icon="Sync" title={translate({
|
|
44
|
+
message: 'Sync Versions',
|
|
45
|
+
id: 'CodeHistory.LoadVersions.text'
|
|
46
|
+
})} onClick={(e) => {
|
|
38
47
|
e.preventDefault();
|
|
39
48
|
e.stopPropagation();
|
|
40
49
|
store.loadVersions();
|
|
@@ -52,20 +61,22 @@ const CodeHistory = () => {
|
|
|
52
61
|
}
|
|
53
62
|
setVersion(c);
|
|
54
63
|
}} min={1} max={versions.length - 1} dots={versions.length < 50}/>
|
|
55
|
-
<span className="badge badge--primary">
|
|
56
|
-
V{version}
|
|
57
|
-
</span>
|
|
64
|
+
<span className="badge badge--primary">V{version}</span>
|
|
58
65
|
</div>
|
|
59
66
|
<div className={clsx(styles.diffViewer)}>
|
|
60
67
|
{versions.length > 1 && (<DiffViewer splitView oldValue={versions[version - 1].code} newValue={versions[version].code} leftTitle={<div className={clsx(styles.diffHeader)}>
|
|
61
68
|
{`V${version}`}
|
|
62
69
|
{versions[version].pasted && (<span className={clsx('badge', 'badge--danger')}>
|
|
63
|
-
<Translate id="CodeHistory.PastedBadge.Text">
|
|
70
|
+
<Translate id="CodeHistory.PastedBadge.Text">
|
|
71
|
+
Pasted
|
|
72
|
+
</Translate>
|
|
64
73
|
</span>)}
|
|
65
74
|
</div>} rightTitle={<div className={clsx(styles.diffHeader)}>
|
|
66
75
|
{`V${version}`}
|
|
67
76
|
{versions[version].pasted && (<span className={clsx('badge', 'badge--danger')}>
|
|
68
|
-
<Translate id="CodeHistory.PastedBadge.Text">
|
|
77
|
+
<Translate id="CodeHistory.PastedBadge.Text">
|
|
78
|
+
Pasted
|
|
79
|
+
</Translate>
|
|
69
80
|
</span>)}
|
|
70
81
|
</div>} renderContent={highlightSyntax}/>)}
|
|
71
82
|
</div>
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
.codeHistory
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
.codeHistory > .historyDetails {
|
|
2
|
+
cursor: pointer;
|
|
3
|
+
margin-bottom: 0;
|
|
4
|
+
border-top-left-radius: 0;
|
|
5
|
+
border-top-right-radius: 0;
|
|
6
6
|
}
|
|
7
7
|
.summary {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
10
|
}
|
|
11
11
|
.spacer {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
12
|
+
flex-grow: 1;
|
|
13
|
+
flex-shrink: 1;
|
|
14
|
+
flex-basis: 0;
|
|
15
|
+
}
|
|
16
16
|
|
|
17
17
|
.versionControl {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
padding: 1em 2em;
|
|
19
|
+
box-shadow: var(--ifm-global-shadow-lw);
|
|
20
|
+
border-radius: var(--ifm-global-radius);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.faButton {
|
|
24
|
-
|
|
24
|
+
margin-left: 1em;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.faButton:hover {
|
|
28
|
-
|
|
28
|
+
transform: scale(1.2);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.diffViewer {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
--ifm-pre-background: rgba(255, 255, 255, 0);
|
|
33
|
+
--ifm-alert-background-color: rgba(255, 255, 255, 0);
|
|
34
|
+
--ifm-alert-background-color-highlight: rgba(255, 255, 255, 0);
|
|
35
|
+
--ifm-table-stripe-background: rgba(255, 255, 255, 0);
|
|
36
|
+
font-family: monospace;
|
|
37
|
+
overflow: auto;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.diffViewer table tbody tr td {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
padding-top: 0;
|
|
42
|
+
padding-bottom: 0;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.diffViewer table tbody tr td pre {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
white-space: nowrap;
|
|
47
|
+
padding-top: 0;
|
|
48
|
+
padding-bottom: 0;
|
|
49
|
+
line-height: 18px;
|
|
50
50
|
}
|
|
51
51
|
.diffHeader {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
52
|
+
display: flex;
|
|
53
|
+
justify-content: space-between;
|
|
54
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MetaProps } from '@theme/CodeEditor';
|
|
3
|
+
interface Props extends MetaProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
children: string | React.ReactNode;
|
|
7
|
+
onChange?: (code: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const splitCode: (rawCode: string) => {
|
|
10
|
+
pre: string;
|
|
11
|
+
code: string;
|
|
12
|
+
post: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Use this component when you want a working CodeEditor.
|
|
16
|
+
* The CodeEditor must be wrapped in a ScriptContext - this component does that.
|
|
17
|
+
* wraps it in a ScriptContext and initializes the CodeEditor with the given
|
|
18
|
+
* params.
|
|
19
|
+
*/
|
|
20
|
+
declare const ContextEditor: (props: Props) => React.JSX.Element;
|
|
21
|
+
export default ContextEditor;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/ContextEditor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI/D,UAAU,KAAM,SAAQ,SAAS;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAGD,eAAO,MAAM,SAAS,GAAI,SAAS,MAAM;;;;CAOxC,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,aAAa,GAAI,OAAO,KAAK,sBA0ClC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
|
|
3
|
+
import CodeEditor from '@theme/CodeEditor';
|
|
4
|
+
import ScriptContext from '@theme/CodeEditor/WithScript/ScriptContext';
|
|
5
|
+
import CodeBlock from '@theme/CodeBlock';
|
|
6
|
+
const SPLIT_CODE_REGEX = /^(?:(?<pre>.*?)\n###\s*PRE\s*)?(?<code>.*?)(?:\n###\s*POST\s*(?<post>.*))?$/s;
|
|
7
|
+
export const splitCode = (rawCode) => {
|
|
8
|
+
const { pre, code, post } = rawCode.replace(/\s*\n$/, '').match(SPLIT_CODE_REGEX).groups || {};
|
|
9
|
+
return {
|
|
10
|
+
pre: pre || '',
|
|
11
|
+
code: code || '',
|
|
12
|
+
post: post || ''
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Use this component when you want a working CodeEditor.
|
|
17
|
+
* The CodeEditor must be wrapped in a ScriptContext - this component does that.
|
|
18
|
+
* wraps it in a ScriptContext and initializes the CodeEditor with the given
|
|
19
|
+
* params.
|
|
20
|
+
*/
|
|
21
|
+
const ContextEditor = (props) => {
|
|
22
|
+
const langMatch = (props.className || '').match(/language-(?<lang>\w*)/);
|
|
23
|
+
let lang = langMatch?.groups?.lang?.toLocaleLowerCase() ?? '';
|
|
24
|
+
if (lang === 'py') {
|
|
25
|
+
lang = 'python';
|
|
26
|
+
}
|
|
27
|
+
if (ExecutionEnvironment.canUseDOM) {
|
|
28
|
+
const title = props.title || lang;
|
|
29
|
+
const { pre, code, post } = splitCode(props.children || '');
|
|
30
|
+
return (<ScriptContext id={props.id} lang={lang} title={title} code={code} preCode={pre} postCode={post} readonly={!!props.readonly} versioned={!!props.versioned}>
|
|
31
|
+
<CodeEditor code={code} lang={lang} preCode={pre} postCode={post} maxLines={props.maxLines && Number.parseInt(props.maxLines, 10)} readonly={!!props.readonly} resettable={!props.noReset} download={!props.versioned && !props.noDownload} slim={!!props.slim} showLineNumbers={!(!!props.slim && !/\n/.test(code))} versioned={!!props.versioned} noHistory={!!props.noHistory} noCompare={!!props.noCompare} title={title} className={props.className} onChange={props.onChange}/>
|
|
32
|
+
</ScriptContext>);
|
|
33
|
+
}
|
|
34
|
+
return <CodeBlock {...props}/>;
|
|
35
|
+
};
|
|
36
|
+
export default ContextEditor;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="ace-builds/ace-modules" />
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import 'ace-builds/src-noconflict/ext-searchbox';
|
|
4
3
|
import 'ace-builds/src-noconflict/mode-python';
|
|
@@ -11,6 +10,8 @@ export interface Props {
|
|
|
11
10
|
versioned?: boolean;
|
|
12
11
|
showLineNumbers: boolean;
|
|
13
12
|
maxLines?: number;
|
|
13
|
+
onChange?: (code: string) => void;
|
|
14
14
|
}
|
|
15
15
|
declare const EditorAce: (props: Props) => React.JSX.Element;
|
|
16
16
|
export default EditorAce;
|
|
17
|
+
//# sourceMappingURL=EditorAce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorAce.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/Editor/EditorAce.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,yCAAyC,CAAC;AACjD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,yCAAyC,CAAC;AACjD,OAAO,8CAA8C,CAAC;AACtD,OAAO,6BAA6B,CAAC;AAKrC,MAAM,WAAW,KAAK;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAMD,QAAA,MAAM,SAAS,GAAI,OAAO,KAAK,sBA6F9B,CAAC;AACF,eAAe,SAAS,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import styles from './styles.module.css';
|
|
4
|
-
import { DOM_ELEMENT_IDS } from '
|
|
4
|
+
import { DOM_ELEMENT_IDS } from '@theme/CodeEditor/constants';
|
|
5
5
|
import AceEditor from 'react-ace';
|
|
6
6
|
import 'ace-builds/src-noconflict/ext-searchbox';
|
|
7
7
|
import 'ace-builds/src-noconflict/mode-python';
|
|
@@ -10,18 +10,18 @@ import 'ace-builds/src-noconflict/mode-svg';
|
|
|
10
10
|
import 'ace-builds/src-noconflict/theme-dracula';
|
|
11
11
|
import 'ace-builds/src-noconflict/ext-language_tools';
|
|
12
12
|
import 'ace-builds/webpack-resolver';
|
|
13
|
-
import {
|
|
13
|
+
import { useStore, useScript } from '@theme/CodeEditor/hooks';
|
|
14
14
|
const ALIAS_LANG_MAP_ACE = {
|
|
15
|
-
mpy: 'python'
|
|
15
|
+
mpy: 'python'
|
|
16
16
|
};
|
|
17
17
|
const EditorAce = (props) => {
|
|
18
18
|
const eRef = React.useRef(null);
|
|
19
|
-
const
|
|
20
|
-
const code =
|
|
21
|
-
const pristineCode =
|
|
22
|
-
const lang =
|
|
23
|
-
const codeId =
|
|
24
|
-
const showRaw =
|
|
19
|
+
const store = useStore();
|
|
20
|
+
const code = useScript(store, 'code');
|
|
21
|
+
const pristineCode = useScript(store, 'pristineCode');
|
|
22
|
+
const lang = useScript(store, 'lang');
|
|
23
|
+
const codeId = useScript(store, 'codeId');
|
|
24
|
+
const showRaw = useScript(store, 'showRaw');
|
|
25
25
|
React.useEffect(() => {
|
|
26
26
|
if (eRef && eRef.current) {
|
|
27
27
|
const node = eRef.current;
|
|
@@ -30,7 +30,7 @@ const EditorAce = (props) => {
|
|
|
30
30
|
// commands is array of key bindings.
|
|
31
31
|
name: 'execute',
|
|
32
32
|
bindKey: { win: 'Ctrl-Enter', mac: 'Command-Enter' },
|
|
33
|
-
exec: () => store.execScript()
|
|
33
|
+
exec: () => store.execScript()
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
node.editor.commands.addCommand({
|
|
@@ -39,7 +39,7 @@ const EditorAce = (props) => {
|
|
|
39
39
|
bindKey: { win: 'Ctrl-s', mac: 'Command-s' },
|
|
40
40
|
exec: () => {
|
|
41
41
|
store.saveNow();
|
|
42
|
-
}
|
|
42
|
+
}
|
|
43
43
|
});
|
|
44
44
|
return () => {
|
|
45
45
|
if (node && node.editor) {
|
|
@@ -54,7 +54,7 @@ const EditorAce = (props) => {
|
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
}, [eRef, lang]);
|
|
57
|
+
}, [eRef, lang, store]);
|
|
58
58
|
return (<div className={clsx(styles.editor)}>
|
|
59
59
|
<AceEditor className={clsx(styles.brythonEditor, !props.showLineNumbers && styles.noGutter)} style={{
|
|
60
60
|
width: '100%',
|
|
@@ -66,14 +66,17 @@ const EditorAce = (props) => {
|
|
|
66
66
|
/**
|
|
67
67
|
* Save immediately as pasted content
|
|
68
68
|
*/
|
|
69
|
-
store.
|
|
69
|
+
store.setIsPasted(true);
|
|
70
70
|
}
|
|
71
71
|
}} focus={false} navigateToFileEnd={false} maxLines={props.maxLines || 25} ref={eRef} mode={ALIAS_LANG_MAP_ACE[lang] ?? lang} theme="dracula" onChange={(value, e) => {
|
|
72
72
|
store.setCode(value, e.action);
|
|
73
|
+
if (props.onChange) {
|
|
74
|
+
props.onChange(value);
|
|
75
|
+
}
|
|
73
76
|
}} readOnly={showRaw} value={showRaw ? pristineCode : code} defaultValue={code || '\n'} name={DOM_ELEMENT_IDS.aceEditor(codeId)} editorProps={{ $blockScrolling: true }} setOptions={{
|
|
74
77
|
displayIndentGuides: true,
|
|
75
78
|
vScrollBarAlwaysVisible: false,
|
|
76
|
-
highlightGutterLine: false
|
|
79
|
+
highlightGutterLine: false
|
|
77
80
|
}} showPrintMargin={false} highlightActiveLine={false} enableBasicAutocompletion enableLiveAutocompletion={false} enableSnippets={false} showGutter={props.showLineNumbers}/>
|
|
78
81
|
</div>);
|
|
79
82
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
interface Props {
|
|
2
|
+
export interface Props {
|
|
3
3
|
slim: boolean;
|
|
4
4
|
title: string;
|
|
5
5
|
resettable: boolean;
|
|
@@ -8,3 +8,4 @@ interface Props {
|
|
|
8
8
|
}
|
|
9
9
|
declare const Header: (props: Props) => React.JSX.Element;
|
|
10
10
|
export default Header;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/theme/CodeEditor/Editor/Header/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,WAAW,KAAK;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACtB;AAED,QAAA,MAAM,MAAM,GAAI,OAAO,KAAK,sBAmB3B,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import styles from './styles.module.css';
|
|
4
|
-
import {
|
|
5
|
-
import ShowSyncStatus from '
|
|
6
|
-
import Reset from '
|
|
7
|
-
import DownloadCode from '
|
|
8
|
-
import ShowRaw from '
|
|
9
|
-
import RunCode from '
|
|
4
|
+
import { useStore, useScript } from '@theme/CodeEditor/hooks';
|
|
5
|
+
import ShowSyncStatus from '@theme/CodeEditor/Actions/ShowSyncStatus';
|
|
6
|
+
import Reset from '@theme/CodeEditor/Actions/Reset';
|
|
7
|
+
import DownloadCode from '@theme/CodeEditor/Actions/DownloadCode';
|
|
8
|
+
import ShowRaw from '@theme/CodeEditor/Actions/ShowRaw';
|
|
9
|
+
import RunCode from '@theme/CodeEditor/Actions/RunCode';
|
|
10
10
|
const Header = (props) => {
|
|
11
|
-
const
|
|
12
|
-
const hasEdits =
|
|
13
|
-
const lang =
|
|
11
|
+
const store = useStore();
|
|
12
|
+
const hasEdits = useScript(store, 'hasEdits');
|
|
13
|
+
const lang = useScript(store, 'lang');
|
|
14
14
|
return (<div className={clsx(styles.controls, props.slim && styles.slim)}>
|
|
15
15
|
{!props.slim && (<React.Fragment>
|
|
16
16
|
<div className={styles.title}>{props.title}</div>
|
|
17
17
|
<ShowSyncStatus />
|
|
18
|
-
{hasEdits && props.resettable &&
|
|
19
|
-
{props.download &&
|
|
20
|
-
{hasEdits && !props.noCompare &&
|
|
18
|
+
{hasEdits && props.resettable && <Reset />}
|
|
19
|
+
{props.download && <DownloadCode title={props.title}/>}
|
|
20
|
+
{hasEdits && !props.noCompare && <ShowRaw />}
|
|
21
21
|
</React.Fragment>)}
|
|
22
22
|
{lang === 'python' && <RunCode title={props.title} slim={props.slim}/>}
|
|
23
23
|
</div>);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
display: flex;
|
|
4
4
|
align-items: center;
|
|
5
5
|
letter-spacing: 0.08em;
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
z-index: calc(var(--ifm-z-index-fixed) - 2);
|
|
8
8
|
padding: 0.2em;
|
|
9
9
|
padding-left: 0.5em;
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.controls > .title {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
flex-shrink: 1;
|
|
19
|
+
flex-grow: 1;
|
|
20
|
+
overflow-x: hidden;
|
|
21
|
+
text-overflow: ellipsis;
|
|
22
|
+
white-space: nowrap;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.controls.slim {
|
|
26
26
|
padding: 0;
|
|
27
|
-
}
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/theme/CodeEditor/Editor/HiddenCode/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,UAAU,KAAK;IACX,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,UAAU,GAAI,OAAO,KAAK,sBAkC/B,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import styles from './styles.module.css';
|
|
3
|
+
import CodeBlock from '@theme/CodeBlock';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import Icon from '@theme/CodeEditor/Icon';
|
|
6
|
+
import { translate } from '@docusaurus/Translate';
|
|
7
|
+
const HiddenCode = (props) => {
|
|
8
|
+
const [show, setShow] = React.useState(false);
|
|
9
|
+
const { code } = props;
|
|
10
|
+
if (code.length === 0) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return (<div className={clsx(styles.container)}>
|
|
14
|
+
{show && (<div>
|
|
15
|
+
<CodeBlock language="python" showLineNumbers={false} className={clsx(styles.hiddenCode, styles.pre, show && styles.open)}>
|
|
16
|
+
{code}
|
|
17
|
+
</CodeBlock>
|
|
18
|
+
</div>)}
|
|
19
|
+
<button className={clsx(styles.toggleButton, show && styles.open, styles[props.type])} onClick={() => setShow(!show)} title={translate({
|
|
20
|
+
id: 'theme.CodeEditor.Editor.HiddenCode.toggleButtonTitle',
|
|
21
|
+
message: 'Toggle hidden code'
|
|
22
|
+
})}>
|
|
23
|
+
<Icon icon={show ? 'TrayMinus' : 'TrayPlus'} rotate={(show ? 180 : 0) + (props.type === 'post' ? 180 : 0)}/>
|
|
24
|
+
</button>
|
|
25
|
+
</div>);
|
|
26
|
+
};
|
|
27
|
+
export default HiddenCode;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.container > .toggleButton {
|
|
2
|
+
position: absolute;
|
|
3
|
+
left: 50%;
|
|
4
|
+
top: 0px;
|
|
5
|
+
z-index: var(--ifm-z-index-dropdown);
|
|
6
|
+
opacity: var(--show-hidden-code-toggle-opacity);
|
|
7
|
+
transition: opacity 0.6s ease; /* Adjust timing as needed */
|
|
8
|
+
padding: 0;
|
|
9
|
+
background: transparent;
|
|
10
|
+
border: 0;
|
|
11
|
+
color: var(--ifm-color-info-darkest);
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
}
|
|
14
|
+
.container > .toggleButton:hover {
|
|
15
|
+
color: var(--ifm-color-info);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.container > .toggleButton.post {
|
|
19
|
+
left: 50%;
|
|
20
|
+
top: unset;
|
|
21
|
+
bottom: 0px;
|
|
22
|
+
}
|
|
23
|
+
.toggleButton > svg {
|
|
24
|
+
transition: all 0.1s ease; /* Adjust timing as needed */
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.container > .toggleButton.open {
|
|
28
|
+
color: var(--ifm-color-danger);
|
|
29
|
+
}
|
|
30
|
+
.container > .toggleButton.open:hover {
|
|
31
|
+
color: var(--ifm-color-danger-darkest);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.hiddenCode {
|
|
35
|
+
margin-bottom: 0;
|
|
36
|
+
--ifm-pre-padding: 0 3em;
|
|
37
|
+
}
|
|
38
|
+
.hiddenCode pre {
|
|
39
|
+
border-radius: 0;
|
|
40
|
+
}
|
|
41
|
+
.hiddenCode pre > code {
|
|
42
|
+
background-color: var(--ifm-color-secondary-dark);
|
|
43
|
+
border-radius: 0;
|
|
44
|
+
}
|
|
45
|
+
.hiddenCode > div[class^='codeBlockContent'] > div[class^='buttonGroup'] {
|
|
46
|
+
right: 0;
|
|
47
|
+
top: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
html[data-theme='dark'] .hiddenCode pre > code {
|
|
51
|
+
background-color: var(--ifm-card-background-color);
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Canvas.d.ts","sourceRoot":"","sources":["../../../../../../src/theme/CodeEditor/Editor/Result/Graphics/Canvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA8B/B,QAAA,MAAM,MAAM,yBA+BX,CAAC;AAEF,eAAe,MAAM,CAAC"}
|