docusaurus-theme-openapi-docs 0.0.0-beta.729 → 0.0.0-beta.733
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/ApiExplorer/persistanceMiddleware.js +7 -6
- package/lib/theme/ApiItem/Layout/index.js +19 -6
- package/lib/theme/ApiItem/index.js +1 -1
- package/lib/theme/MimeTabs/index.js +2 -2
- package/package.json +3 -3
- package/src/theme/ApiExplorer/persistanceMiddleware.ts +7 -6
- package/src/theme/ApiItem/Layout/index.tsx +8 -4
- package/src/theme/ApiItem/index.tsx +1 -1
- package/src/theme/MimeTabs/index.tsx +1 -1
- package/src/theme-openapi.d.ts +1 -0
|
@@ -11,6 +11,7 @@ const slice_1 = require("@theme/ApiExplorer/Authorization/slice");
|
|
|
11
11
|
const storage_utils_1 = require("./storage-utils");
|
|
12
12
|
function createPersistanceMiddleware(options) {
|
|
13
13
|
const persistanceMiddleware = (storeAPI) => (next) => (action) => {
|
|
14
|
+
console.log(action);
|
|
14
15
|
const result = next(action);
|
|
15
16
|
const state = storeAPI.getState();
|
|
16
17
|
const storage = (0, storage_utils_1.createStorage)("sessionStorage");
|
|
@@ -32,12 +33,12 @@ function createPersistanceMiddleware(options) {
|
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
// TODO: determine way to rehydrate without flashing
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
if (action.type === "contentType/setContentType") {
|
|
37
|
+
storage.setItem("contentType", action.payload);
|
|
38
|
+
}
|
|
39
|
+
if (action.type === "accept/setAccept") {
|
|
40
|
+
storage.setItem("accept", action.payload);
|
|
41
|
+
}
|
|
41
42
|
if (action.type === "server/setServer") {
|
|
42
43
|
storage.setItem("server", action.payload);
|
|
43
44
|
}
|
|
@@ -77,16 +77,29 @@ function DocItemLayout({ children }) {
|
|
|
77
77
|
react_1.default.createElement(Content_1.default, null, children),
|
|
78
78
|
react_1.default.createElement(
|
|
79
79
|
"div",
|
|
80
|
-
{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
{ className: "row" },
|
|
81
|
+
react_1.default.createElement(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
className: (0, clsx_1.default)(
|
|
85
|
+
"col",
|
|
86
|
+
api ? "col--7" : "col--12"
|
|
87
|
+
),
|
|
88
|
+
},
|
|
89
|
+
react_1.default.createElement(Footer_1.default, null)
|
|
90
|
+
)
|
|
84
91
|
)
|
|
85
92
|
),
|
|
86
93
|
react_1.default.createElement(
|
|
87
94
|
"div",
|
|
88
|
-
{ className:
|
|
89
|
-
react_1.default.createElement(
|
|
95
|
+
{ className: "row" },
|
|
96
|
+
react_1.default.createElement(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
className: (0, clsx_1.default)("col", api ? "col--7" : "col--12"),
|
|
100
|
+
},
|
|
101
|
+
react_1.default.createElement(Paginator_1.default, null)
|
|
102
|
+
)
|
|
90
103
|
)
|
|
91
104
|
)
|
|
92
105
|
),
|
|
@@ -58,7 +58,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
58
58
|
const react_1 = __importStar(require("react"));
|
|
59
59
|
const internal_1 = require("@docusaurus/theme-common/internal");
|
|
60
60
|
const useIsBrowser_1 = __importDefault(require("@docusaurus/useIsBrowser"));
|
|
61
|
-
const slice_1 =
|
|
61
|
+
const slice_1 = require("@theme/ApiExplorer/Accept/slice");
|
|
62
62
|
const slice_2 = require("@theme/ApiExplorer/ContentType/slice");
|
|
63
63
|
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
64
64
|
const clsx_1 = __importDefault(require("clsx"));
|
|
@@ -105,7 +105,7 @@ function TabList({
|
|
|
105
105
|
if (isRequestSchema) {
|
|
106
106
|
dispatch((0, slice_2.setContentType)(newTabValue));
|
|
107
107
|
} else {
|
|
108
|
-
dispatch((0, slice_1.
|
|
108
|
+
dispatch((0, slice_1.setAccept)(newTabValue));
|
|
109
109
|
}
|
|
110
110
|
blockElementScrollPositionUntilNextRender(newTab);
|
|
111
111
|
selectValue(newTabValue);
|
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": "0.0.0-beta.
|
|
4
|
+
"version": "0.0.0-beta.733",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"clsx": "^1.1.1",
|
|
45
45
|
"copy-text-to-clipboard": "^3.1.0",
|
|
46
46
|
"crypto-js": "^4.1.1",
|
|
47
|
-
"docusaurus-plugin-openapi-docs": "0.0.0-beta.
|
|
47
|
+
"docusaurus-plugin-openapi-docs": "0.0.0-beta.733",
|
|
48
48
|
"docusaurus-plugin-sass": "^0.2.3",
|
|
49
49
|
"file-saver": "^2.0.5",
|
|
50
50
|
"lodash": "^4.17.20",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"engines": {
|
|
70
70
|
"node": ">=14"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "e547aed28416c0020bbf830317cce6eeeeacee4d"
|
|
73
73
|
}
|
|
@@ -19,6 +19,7 @@ import { createStorage, hashArray } from "./storage-utils";
|
|
|
19
19
|
export function createPersistanceMiddleware(options: ThemeConfig["api"]) {
|
|
20
20
|
const persistanceMiddleware: Middleware<{}, RootState, AppDispatch> =
|
|
21
21
|
(storeAPI) => (next) => (action) => {
|
|
22
|
+
console.log(action);
|
|
22
23
|
const result = next(action);
|
|
23
24
|
|
|
24
25
|
const state = storeAPI.getState();
|
|
@@ -45,13 +46,13 @@ export function createPersistanceMiddleware(options: ThemeConfig["api"]) {
|
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
// TODO: determine way to rehydrate without flashing
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
if (action.type === "contentType/setContentType") {
|
|
50
|
+
storage.setItem("contentType", action.payload);
|
|
51
|
+
}
|
|
51
52
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
if (action.type === "accept/setAccept") {
|
|
54
|
+
storage.setItem("accept", action.payload);
|
|
55
|
+
}
|
|
55
56
|
|
|
56
57
|
if (action.type === "server/setServer") {
|
|
57
58
|
storage.setItem("server", action.payload);
|
|
@@ -65,12 +65,16 @@ export default function DocItemLayout({ children }: Props): JSX.Element {
|
|
|
65
65
|
<DocVersionBadge />
|
|
66
66
|
{docTOC.mobile}
|
|
67
67
|
<DocItemContent>{children}</DocItemContent>
|
|
68
|
-
<div className=
|
|
69
|
-
<
|
|
68
|
+
<div className="row">
|
|
69
|
+
<div className={clsx("col", api ? "col--7" : "col--12")}>
|
|
70
|
+
<DocItemFooter />
|
|
71
|
+
</div>
|
|
70
72
|
</div>
|
|
71
73
|
</article>
|
|
72
|
-
<div className=
|
|
73
|
-
<
|
|
74
|
+
<div className="row">
|
|
75
|
+
<div className={clsx("col", api ? "col--7" : "col--12")}>
|
|
76
|
+
<DocItemPaginator />
|
|
77
|
+
</div>
|
|
74
78
|
</div>
|
|
75
79
|
</div>
|
|
76
80
|
</div>
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "@docusaurus/theme-common/internal";
|
|
22
22
|
import { TabItemProps } from "@docusaurus/theme-common/lib/utils/tabsUtils";
|
|
23
23
|
import useIsBrowser from "@docusaurus/useIsBrowser";
|
|
24
|
-
import setAccept from "@theme/ApiExplorer/Accept/slice";
|
|
24
|
+
import { setAccept } from "@theme/ApiExplorer/Accept/slice";
|
|
25
25
|
import { setContentType } from "@theme/ApiExplorer/ContentType/slice";
|
|
26
26
|
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
27
27
|
import { RootState } from "@theme/ApiItem/store";
|