docusaurus-theme-openapi-docs 1.3.0 → 1.3.2
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/ApiDemoPanel/LiveEditor/index.js +3 -1
- package/lib/theme/ParamsItem/index.js +6 -1
- package/lib/theme/SchemaItem/index.js +6 -1
- package/lib-next/theme/ApiDemoPanel/LiveEditor/index.js +4 -2
- package/lib-next/theme/ParamsItem/index.js +6 -1
- package/lib-next/theme/SchemaItem/index.js +6 -1
- package/package.json +4 -3
- package/src/theme/ApiDemoPanel/LiveEditor/index.tsx +6 -2
- package/src/theme/ParamsItem/index.js +6 -1
- package/src/theme/SchemaItem/index.js +6 -1
|
@@ -61,7 +61,9 @@ function App({
|
|
|
61
61
|
|
|
62
62
|
const [code, setCode] = _react.default.useState(children);
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
(0, _react.useEffect)(() => {
|
|
65
|
+
action((0, _slice.setStringRawBody)(code));
|
|
66
|
+
}, [action, code]);
|
|
65
67
|
return <div className={_stylesModule.default.playgroundContainer}>
|
|
66
68
|
<_reactLive.LiveProvider code={children.replace(/\n$/, "")} transformCode={transformCode !== null && transformCode !== void 0 ? transformCode : code => `${code};`} theme={prismTheme} language={language} {...props}>
|
|
67
69
|
<LiveComponent onEdit={setCode} />
|
|
@@ -9,6 +9,7 @@ import React from "react";
|
|
|
9
9
|
|
|
10
10
|
import CodeBlock from "@theme/CodeBlock";
|
|
11
11
|
import ReactMarkdown from "react-markdown";
|
|
12
|
+
import rehypeRaw from "rehype-raw";
|
|
12
13
|
|
|
13
14
|
import { createDescription } from "../../markdown/createDescription";
|
|
14
15
|
import { getQualifierMessage, getSchemaName } from "../../markdown/schema";
|
|
@@ -28,7 +29,10 @@ function ParamsItem({
|
|
|
28
29
|
|
|
29
30
|
const renderSchema = guard(getQualifierMessage(schema), (message) => (
|
|
30
31
|
<div>
|
|
31
|
-
<ReactMarkdown
|
|
32
|
+
<ReactMarkdown
|
|
33
|
+
children={createDescription(message)}
|
|
34
|
+
rehypePlugins={[rehypeRaw]}
|
|
35
|
+
/>
|
|
32
36
|
</div>
|
|
33
37
|
));
|
|
34
38
|
|
|
@@ -48,6 +52,7 @@ function ParamsItem({
|
|
|
48
52
|
);
|
|
49
53
|
},
|
|
50
54
|
}}
|
|
55
|
+
rehypePlugins={[rehypeRaw]}
|
|
51
56
|
/>
|
|
52
57
|
</div>
|
|
53
58
|
));
|
|
@@ -9,6 +9,7 @@ import React from "react";
|
|
|
9
9
|
|
|
10
10
|
import CodeBlock from "@theme/CodeBlock";
|
|
11
11
|
import ReactMarkdown from "react-markdown";
|
|
12
|
+
import rehypeRaw from "rehype-raw";
|
|
12
13
|
|
|
13
14
|
import { createDescription } from "../../markdown/createDescription";
|
|
14
15
|
import { guard } from "../../markdown/utils";
|
|
@@ -45,13 +46,17 @@ function SchemaItem({
|
|
|
45
46
|
);
|
|
46
47
|
},
|
|
47
48
|
}}
|
|
49
|
+
rehypePlugins={[rehypeRaw]}
|
|
48
50
|
/>
|
|
49
51
|
</div>
|
|
50
52
|
));
|
|
51
53
|
|
|
52
54
|
const renderQualifierMessage = guard(qualifierMessage, (message) => (
|
|
53
55
|
<div className={styles.schemaQualifierMessage}>
|
|
54
|
-
<ReactMarkdown
|
|
56
|
+
<ReactMarkdown
|
|
57
|
+
children={createDescription(message)}
|
|
58
|
+
rehypePlugins={[rehypeRaw]}
|
|
59
|
+
/>
|
|
55
60
|
</div>
|
|
56
61
|
));
|
|
57
62
|
|
|
@@ -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
|
-
import React, { useState } from "react";
|
|
7
|
+
import React, { useEffect, useState } from "react";
|
|
8
8
|
import { usePrismTheme } from "@docusaurus/theme-common";
|
|
9
9
|
import useIsBrowser from "@docusaurus/useIsBrowser";
|
|
10
10
|
import { LiveProvider, LiveEditor, withLive } from "react-live";
|
|
@@ -40,7 +40,9 @@ const LiveComponent = withLive(Live);
|
|
|
40
40
|
function App({ children, transformCode, value, language, action, ...props }) {
|
|
41
41
|
const prismTheme = usePrismTheme();
|
|
42
42
|
const [code, setCode] = React.useState(children);
|
|
43
|
-
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
action(setStringRawBody(code));
|
|
45
|
+
}, [action, code]);
|
|
44
46
|
return (
|
|
45
47
|
<div className={styles.playgroundContainer}>
|
|
46
48
|
<LiveProvider
|
|
@@ -9,6 +9,7 @@ import React from "react";
|
|
|
9
9
|
|
|
10
10
|
import CodeBlock from "@theme/CodeBlock";
|
|
11
11
|
import ReactMarkdown from "react-markdown";
|
|
12
|
+
import rehypeRaw from "rehype-raw";
|
|
12
13
|
|
|
13
14
|
import { createDescription } from "../../markdown/createDescription";
|
|
14
15
|
import { getQualifierMessage, getSchemaName } from "../../markdown/schema";
|
|
@@ -28,7 +29,10 @@ function ParamsItem({
|
|
|
28
29
|
|
|
29
30
|
const renderSchema = guard(getQualifierMessage(schema), (message) => (
|
|
30
31
|
<div>
|
|
31
|
-
<ReactMarkdown
|
|
32
|
+
<ReactMarkdown
|
|
33
|
+
children={createDescription(message)}
|
|
34
|
+
rehypePlugins={[rehypeRaw]}
|
|
35
|
+
/>
|
|
32
36
|
</div>
|
|
33
37
|
));
|
|
34
38
|
|
|
@@ -48,6 +52,7 @@ function ParamsItem({
|
|
|
48
52
|
);
|
|
49
53
|
},
|
|
50
54
|
}}
|
|
55
|
+
rehypePlugins={[rehypeRaw]}
|
|
51
56
|
/>
|
|
52
57
|
</div>
|
|
53
58
|
));
|
|
@@ -9,6 +9,7 @@ import React from "react";
|
|
|
9
9
|
|
|
10
10
|
import CodeBlock from "@theme/CodeBlock";
|
|
11
11
|
import ReactMarkdown from "react-markdown";
|
|
12
|
+
import rehypeRaw from "rehype-raw";
|
|
12
13
|
|
|
13
14
|
import { createDescription } from "../../markdown/createDescription";
|
|
14
15
|
import { guard } from "../../markdown/utils";
|
|
@@ -45,13 +46,17 @@ function SchemaItem({
|
|
|
45
46
|
);
|
|
46
47
|
},
|
|
47
48
|
}}
|
|
49
|
+
rehypePlugins={[rehypeRaw]}
|
|
48
50
|
/>
|
|
49
51
|
</div>
|
|
50
52
|
));
|
|
51
53
|
|
|
52
54
|
const renderQualifierMessage = guard(qualifierMessage, (message) => (
|
|
53
55
|
<div className={styles.schemaQualifierMessage}>
|
|
54
|
-
<ReactMarkdown
|
|
56
|
+
<ReactMarkdown
|
|
57
|
+
children={createDescription(message)}
|
|
58
|
+
rehypePlugins={[rehypeRaw]}
|
|
59
|
+
/>
|
|
55
60
|
</div>
|
|
56
61
|
));
|
|
57
62
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-theme-openapi-docs",
|
|
3
3
|
"description": "OpenAPI theme for Docusaurus.",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"buffer": "^6.0.3",
|
|
51
51
|
"clsx": "^1.1.1",
|
|
52
52
|
"crypto-js": "^4.1.1",
|
|
53
|
-
"docusaurus-plugin-openapi-docs": "^1.3.
|
|
53
|
+
"docusaurus-plugin-openapi-docs": "^1.3.2",
|
|
54
54
|
"immer": "^9.0.7",
|
|
55
55
|
"lodash": "^4.17.20",
|
|
56
56
|
"process": "^0.11.10",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"react-modal": "^3.15.1",
|
|
61
61
|
"react-redux": "^7.2.0",
|
|
62
62
|
"redux-devtools-extension": "^2.13.8",
|
|
63
|
+
"rehype-raw": "^6.1.1",
|
|
63
64
|
"webpack": "^5.61.0",
|
|
64
65
|
"xml-formatter": "^2.6.1"
|
|
65
66
|
},
|
|
@@ -70,5 +71,5 @@
|
|
|
70
71
|
"engines": {
|
|
71
72
|
"node": ">=14"
|
|
72
73
|
},
|
|
73
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "761a89172da04573369441cf7342f6c643bc3ecd"
|
|
74
75
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
* ========================================================================== */
|
|
7
7
|
|
|
8
|
-
import React, { useState } from "react";
|
|
8
|
+
import React, { useEffect, useState } from "react";
|
|
9
9
|
|
|
10
10
|
import { usePrismTheme } from "@docusaurus/theme-common";
|
|
11
11
|
import useIsBrowser from "@docusaurus/useIsBrowser";
|
|
@@ -51,7 +51,11 @@ function App({
|
|
|
51
51
|
}: any): JSX.Element {
|
|
52
52
|
const prismTheme = usePrismTheme();
|
|
53
53
|
const [code, setCode] = React.useState(children);
|
|
54
|
-
|
|
54
|
+
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
action(setStringRawBody(code));
|
|
57
|
+
}, [action, code]);
|
|
58
|
+
|
|
55
59
|
return (
|
|
56
60
|
<div className={styles.playgroundContainer}>
|
|
57
61
|
<LiveProvider
|
|
@@ -9,6 +9,7 @@ import React from "react";
|
|
|
9
9
|
|
|
10
10
|
import CodeBlock from "@theme/CodeBlock";
|
|
11
11
|
import ReactMarkdown from "react-markdown";
|
|
12
|
+
import rehypeRaw from "rehype-raw";
|
|
12
13
|
|
|
13
14
|
import { createDescription } from "../../markdown/createDescription";
|
|
14
15
|
import { getQualifierMessage, getSchemaName } from "../../markdown/schema";
|
|
@@ -28,7 +29,10 @@ function ParamsItem({
|
|
|
28
29
|
|
|
29
30
|
const renderSchema = guard(getQualifierMessage(schema), (message) => (
|
|
30
31
|
<div>
|
|
31
|
-
<ReactMarkdown
|
|
32
|
+
<ReactMarkdown
|
|
33
|
+
children={createDescription(message)}
|
|
34
|
+
rehypePlugins={[rehypeRaw]}
|
|
35
|
+
/>
|
|
32
36
|
</div>
|
|
33
37
|
));
|
|
34
38
|
|
|
@@ -48,6 +52,7 @@ function ParamsItem({
|
|
|
48
52
|
);
|
|
49
53
|
},
|
|
50
54
|
}}
|
|
55
|
+
rehypePlugins={[rehypeRaw]}
|
|
51
56
|
/>
|
|
52
57
|
</div>
|
|
53
58
|
));
|
|
@@ -9,6 +9,7 @@ import React from "react";
|
|
|
9
9
|
|
|
10
10
|
import CodeBlock from "@theme/CodeBlock";
|
|
11
11
|
import ReactMarkdown from "react-markdown";
|
|
12
|
+
import rehypeRaw from "rehype-raw";
|
|
12
13
|
|
|
13
14
|
import { createDescription } from "../../markdown/createDescription";
|
|
14
15
|
import { guard } from "../../markdown/utils";
|
|
@@ -45,13 +46,17 @@ function SchemaItem({
|
|
|
45
46
|
);
|
|
46
47
|
},
|
|
47
48
|
}}
|
|
49
|
+
rehypePlugins={[rehypeRaw]}
|
|
48
50
|
/>
|
|
49
51
|
</div>
|
|
50
52
|
));
|
|
51
53
|
|
|
52
54
|
const renderQualifierMessage = guard(qualifierMessage, (message) => (
|
|
53
55
|
<div className={styles.schemaQualifierMessage}>
|
|
54
|
-
<ReactMarkdown
|
|
56
|
+
<ReactMarkdown
|
|
57
|
+
children={createDescription(message)}
|
|
58
|
+
rehypePlugins={[rehypeRaw]}
|
|
59
|
+
/>
|
|
55
60
|
</div>
|
|
56
61
|
));
|
|
57
62
|
|