docusaurus-theme-openapi-docs 0.0.0-beta.732 → 0.0.0-beta.734

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.
@@ -101,7 +101,10 @@ function Response({ item }) {
101
101
  "div",
102
102
  {
103
103
  style: {
104
- backgroundColor: prismTheme.plain.backgroundColor,
104
+ backgroundColor:
105
+ code && prettyResponse !== "Fetching..."
106
+ ? prismTheme.plain.backgroundColor
107
+ : "transparent",
105
108
  paddingLeft: "1rem",
106
109
  paddingTop: "1rem",
107
110
  ...((prettyResponse === "Fetching..." || !code) && {
@@ -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
- // if (action.type === "contentType/setContentType") {
36
- // storage.setItem("contentType", action.payload);
37
- // }
38
- // if (action.type === "accept/setAccept") {
39
- // storage.setItem("accept", action.payload);
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
  }
@@ -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 = __importDefault(require("@theme/ApiExplorer/Accept/slice"));
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.default)(newTabValue));
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.732",
4
+ "version": "0.0.0-beta.734",
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.732",
47
+ "docusaurus-plugin-openapi-docs": "0.0.0-beta.734",
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": "5064146aec8b53df3643bc02fd5357ca7592ad80"
72
+ "gitHead": "0abb3024ce2916b118112072b11dd407512b6da2"
73
73
  }
@@ -88,7 +88,10 @@ function Response({ item }: { item: NonNullable<ApiItem> }) {
88
88
  </div>
89
89
  <div
90
90
  style={{
91
- backgroundColor: prismTheme.plain.backgroundColor,
91
+ backgroundColor:
92
+ code && prettyResponse !== "Fetching..."
93
+ ? prismTheme.plain.backgroundColor
94
+ : "transparent",
92
95
  paddingLeft: "1rem",
93
96
  paddingTop: "1rem",
94
97
  ...((prettyResponse === "Fetching..." || !code) && {
@@ -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
- // if (action.type === "contentType/setContentType") {
49
- // storage.setItem("contentType", action.payload);
50
- // }
49
+ if (action.type === "contentType/setContentType") {
50
+ storage.setItem("contentType", action.payload);
51
+ }
51
52
 
52
- // if (action.type === "accept/setAccept") {
53
- // storage.setItem("accept", action.payload);
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);
@@ -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";
@@ -74,6 +74,7 @@ declare module "@theme/ApiExplorer/Accept" {
74
74
  }
75
75
 
76
76
  declare module "@theme/ApiExplorer/Accept/slice" {
77
+ export { setAccept };
77
78
  export default accept as Reducer<State, AnyAction>;
78
79
  }
79
80