docusaurus-theme-openapi-docs 2.1.3 → 3.0.0-beta.10

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.
Files changed (95) hide show
  1. package/lib/markdown/utils.d.ts +2 -1
  2. package/lib/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/index.d.ts +13 -0
  3. package/lib/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/index.js +199 -124
  4. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.d.ts +4 -0
  5. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.js +25 -19
  6. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.d.ts +4 -0
  7. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +27 -16
  8. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.d.ts +4 -0
  9. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.js +116 -97
  10. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.d.ts +3 -0
  11. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +115 -54
  12. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.d.ts +6 -0
  13. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +41 -30
  14. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.d.ts +14 -0
  15. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +201 -121
  16. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.d.ts +3 -0
  17. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.js +36 -24
  18. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.d.ts +7 -0
  19. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +35 -28
  20. package/lib/theme/ApiExplorer/ApiCodeBlock/index.d.ts +3 -0
  21. package/lib/theme/ApiExplorer/ApiCodeBlock/index.js +72 -14
  22. package/lib/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
  23. package/lib/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +4 -2
  24. package/lib/theme/ApiExplorer/CodeTabs/index.d.ts +15 -0
  25. package/lib/theme/ApiExplorer/CodeTabs/index.js +122 -76
  26. package/lib/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +3 -1
  27. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +4 -4
  28. package/lib/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +2 -1
  29. package/lib/theme/ApiExplorer/Request/_Request.scss +4 -6
  30. package/lib/theme/ApiExplorer/Response/_Response.scss +4 -2
  31. package/lib/theme/ApiExplorer/Response/index.js +19 -19
  32. package/lib/theme/ApiExplorer/index.js +0 -4
  33. package/lib/theme/ApiItem/Layout/index.js +3 -0
  34. package/lib/theme/ApiItem/index.js +6 -5
  35. package/lib/theme/ApiLogo/index.d.ts +2 -2
  36. package/lib/theme/ApiTabs/_ApiTabs.scss +3 -1
  37. package/lib/theme/ApiTabs/index.d.ts +7 -0
  38. package/lib/theme/ApiTabs/index.js +152 -98
  39. package/lib/theme/DiscriminatorTabs/index.d.ts +3 -0
  40. package/lib/theme/DiscriminatorTabs/index.js +146 -94
  41. package/lib/theme/MimeTabs/index.d.ts +6 -0
  42. package/lib/theme/MimeTabs/index.js +163 -114
  43. package/lib/theme/OperationTabs/_OperationTabs.scss +4 -1
  44. package/lib/theme/OperationTabs/index.d.ts +3 -0
  45. package/lib/theme/OperationTabs/index.js +148 -103
  46. package/lib/theme/ParamsItem/index.d.ts +23 -0
  47. package/lib/theme/ParamsItem/index.js +168 -123
  48. package/lib/theme/ResponseSamples/index.d.ts +8 -0
  49. package/lib/theme/ResponseSamples/index.js +18 -13
  50. package/lib/theme/SchemaItem/index.d.ts +12 -0
  51. package/lib/theme/SchemaItem/index.js +123 -88
  52. package/lib/theme/SchemaTabs/_SchemaTabs.scss +0 -4
  53. package/lib/theme/SchemaTabs/index.d.ts +3 -0
  54. package/lib/theme/SchemaTabs/index.js +142 -91
  55. package/lib/theme/styles.scss +4 -0
  56. package/package.json +8 -7
  57. package/src/markdown/utils.ts +4 -2
  58. package/src/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/{index.js → index.tsx} +21 -8
  59. package/src/theme/ApiExplorer/ApiCodeBlock/Container/{index.js → index.tsx} +6 -3
  60. package/src/theme/ApiExplorer/ApiCodeBlock/Content/{Element.js → Element.tsx} +5 -1
  61. package/src/theme/ApiExplorer/ApiCodeBlock/Content/{String.js → String.tsx} +5 -5
  62. package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/{index.js → index.tsx} +8 -3
  63. package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/{index.js → index.tsx} +9 -1
  64. package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/{index.js → index.tsx} +13 -3
  65. package/src/theme/ApiExplorer/ApiCodeBlock/Line/{index.js → index.tsx} +2 -1
  66. package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/{index.js → index.tsx} +11 -1
  67. package/src/theme/ApiExplorer/ApiCodeBlock/{index.js → index.tsx} +10 -5
  68. package/src/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
  69. package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +4 -2
  70. package/src/theme/ApiExplorer/CodeTabs/{index.js → index.tsx} +56 -26
  71. package/src/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +3 -1
  72. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +4 -4
  73. package/src/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +2 -1
  74. package/src/theme/ApiExplorer/Request/_Request.scss +4 -6
  75. package/src/theme/ApiExplorer/Response/_Response.scss +4 -2
  76. package/src/theme/ApiExplorer/Response/index.tsx +2 -2
  77. package/src/theme/ApiExplorer/index.tsx +0 -3
  78. package/src/theme/ApiItem/Layout/index.tsx +3 -0
  79. package/src/theme/ApiItem/index.tsx +3 -4
  80. package/src/theme/ApiLogo/index.tsx +1 -1
  81. package/src/theme/ApiTabs/_ApiTabs.scss +3 -1
  82. package/src/theme/ApiTabs/{index.js → index.tsx} +60 -26
  83. package/src/theme/DiscriminatorTabs/{index.js → index.tsx} +57 -24
  84. package/src/theme/MimeTabs/{index.js → index.tsx} +58 -26
  85. package/src/theme/OperationTabs/_OperationTabs.scss +4 -1
  86. package/src/theme/OperationTabs/{index.js → index.tsx} +54 -25
  87. package/src/theme/ParamsItem/{index.js → index.tsx} +31 -14
  88. package/src/theme/ResponseSamples/{index.js → index.tsx} +10 -1
  89. package/src/theme/SchemaItem/{index.js → index.tsx} +18 -9
  90. package/src/theme/SchemaTabs/_SchemaTabs.scss +0 -4
  91. package/src/theme/SchemaTabs/{index.js → index.tsx} +56 -25
  92. package/src/theme/styles.scss +4 -0
  93. package/src/theme-classic.d.ts +69 -2
  94. package/src/theme-openapi.d.ts +2 -0
  95. package/tsconfig.json +4 -1
@@ -1,4 +1,5 @@
1
- export type Children = string | undefined | (string | undefined)[];
1
+ import { ReactNode } from "react";
2
+ export type Children = ReactNode | string | undefined | (string | undefined)[];
2
3
  export type Props = Record<string, any> & {
3
4
  children?: Children;
4
5
  };
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { type Language } from "prism-react-renderer";
3
+ interface Props {
4
+ code: string;
5
+ className: string;
6
+ language: Language;
7
+ showLineNumbers: boolean;
8
+ blockClassName: string;
9
+ title: string;
10
+ lineClassNames: string[];
11
+ }
12
+ export default function ExpandButton({ code, className, language, showLineNumbers, blockClassName, title, lineClassNames, }: Props): React.JSX.Element;
13
+ export {};
@@ -1,23 +1,81 @@
1
+ "use strict";
1
2
  /* ============================================================================
2
3
  * Copyright (c) Palo Alto Networks
3
4
  *
4
5
  * This source code is licensed under the MIT license found in the
5
6
  * LICENSE file in the root directory of this source tree.
6
7
  * ========================================================================== */
7
-
8
- import React, { useEffect } from "react";
9
-
10
- import { usePrismTheme } from "@docusaurus/theme-common";
11
- import { translate } from "@docusaurus/Translate";
12
- import Container from "@theme/ApiDemoPanel/ApiCodeBlock/Container";
13
- import CopyButton from "@theme/ApiDemoPanel/ApiCodeBlock/CopyButton";
14
- import ExitButton from "@theme/ApiDemoPanel/ApiCodeBlock/ExitButton";
15
- import Line from "@theme/ApiDemoPanel/ApiCodeBlock/Line";
16
- import clsx from "clsx";
17
- import Highlight, { defaultProps } from "prism-react-renderer";
18
- import Modal from "react-modal";
19
-
20
- export default function ExpandButton({
8
+ var __createBinding =
9
+ (this && this.__createBinding) ||
10
+ (Object.create
11
+ ? function (o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ var desc = Object.getOwnPropertyDescriptor(m, k);
14
+ if (
15
+ !desc ||
16
+ ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
17
+ ) {
18
+ desc = {
19
+ enumerable: true,
20
+ get: function () {
21
+ return m[k];
22
+ },
23
+ };
24
+ }
25
+ Object.defineProperty(o, k2, desc);
26
+ }
27
+ : function (o, m, k, k2) {
28
+ if (k2 === undefined) k2 = k;
29
+ o[k2] = m[k];
30
+ });
31
+ var __setModuleDefault =
32
+ (this && this.__setModuleDefault) ||
33
+ (Object.create
34
+ ? function (o, v) {
35
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
36
+ }
37
+ : function (o, v) {
38
+ o["default"] = v;
39
+ });
40
+ var __importStar =
41
+ (this && this.__importStar) ||
42
+ function (mod) {
43
+ if (mod && mod.__esModule) return mod;
44
+ var result = {};
45
+ if (mod != null)
46
+ for (var k in mod)
47
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
48
+ __createBinding(result, mod, k);
49
+ __setModuleDefault(result, mod);
50
+ return result;
51
+ };
52
+ var __importDefault =
53
+ (this && this.__importDefault) ||
54
+ function (mod) {
55
+ return mod && mod.__esModule ? mod : { default: mod };
56
+ };
57
+ Object.defineProperty(exports, "__esModule", { value: true });
58
+ const react_1 = __importStar(require("react"));
59
+ const theme_common_1 = require("@docusaurus/theme-common");
60
+ const Translate_1 = require("@docusaurus/Translate");
61
+ // @ts-ignore
62
+ const Container_1 = __importDefault(
63
+ require("@theme/ApiExplorer/ApiCodeBlock/Container")
64
+ );
65
+ // @ts-ignore
66
+ const CopyButton_1 = __importDefault(
67
+ require("@theme/ApiExplorer/ApiCodeBlock/CopyButton")
68
+ );
69
+ // @ts-ignore
70
+ const ExitButton_1 = __importDefault(
71
+ require("@theme/ApiExplorer/ApiCodeBlock/ExitButton")
72
+ );
73
+ // @ts-ignore
74
+ const Line_1 = __importDefault(require("@theme/ApiExplorer/ApiCodeBlock/Line"));
75
+ const clsx_1 = __importDefault(require("clsx"));
76
+ const prism_react_renderer_1 = require("prism-react-renderer");
77
+ const react_modal_1 = __importDefault(require("react-modal"));
78
+ function ExpandButton({
21
79
  code,
22
80
  className,
23
81
  language,
@@ -26,140 +84,157 @@ export default function ExpandButton({
26
84
  title,
27
85
  lineClassNames,
28
86
  }) {
29
- const prismTheme = usePrismTheme();
30
-
87
+ const prismTheme = (0, theme_common_1.usePrismTheme)();
31
88
  function openModal() {
32
89
  setIsOpen(true);
33
90
  }
34
-
35
91
  function closeModal() {
36
92
  setIsOpen(false);
37
93
  }
38
-
39
- const [modalIsOpen, setIsOpen] = React.useState(false);
40
-
41
- useEffect(() => {
42
- Modal.setAppElement("body");
94
+ const [modalIsOpen, setIsOpen] = react_1.default.useState(false);
95
+ (0, react_1.useEffect)(() => {
96
+ react_modal_1.default.setAppElement("body");
43
97
  });
44
-
45
- return (
46
- <>
47
- <button
48
- type="button"
49
- aria-label={
50
- modalIsOpen
51
- ? translate({
52
- id: "theme.CodeBlock.expanded",
53
- message: "Expanded",
54
- description: "The expanded button label on code blocks",
55
- })
56
- : translate({
57
- id: "theme.CodeBlock.expandButtonAriaLabel",
58
- message: "Expand code to fullscreen",
59
- description: "The ARIA label for expand code blocks button",
60
- })
61
- }
62
- title={translate({
98
+ return react_1.default.createElement(
99
+ react_1.default.Fragment,
100
+ null,
101
+ react_1.default.createElement(
102
+ "button",
103
+ {
104
+ type: "button",
105
+ "aria-label": modalIsOpen
106
+ ? (0, Translate_1.translate)({
107
+ id: "theme.CodeBlock.expanded",
108
+ message: "Expanded",
109
+ description: "The expanded button label on code blocks",
110
+ })
111
+ : (0, Translate_1.translate)({
112
+ id: "theme.CodeBlock.expandButtonAriaLabel",
113
+ message: "Expand code to fullscreen",
114
+ description: "The ARIA label for expand code blocks button",
115
+ }),
116
+ title: (0, Translate_1.translate)({
63
117
  id: "theme.CodeBlock.expand",
64
118
  message: "Expand",
65
119
  description: "The expand button label on code blocks",
66
- })}
67
- className={clsx(
120
+ }),
121
+ className: (0, clsx_1.default)(
68
122
  "clean-btn",
69
123
  className,
70
124
  "openapi-explorer__code-block-expand-btn",
71
125
  modalIsOpen && "openapi-explorer__code-block-expand-btn--copied"
72
- )}
73
- onClick={openModal}
74
- >
75
- <span
76
- className="openapi-explorer__code-block-expand-btn-icons"
77
- aria-hidden="true"
78
- >
79
- <svg
80
- className="openapi-explorer__code-block-expand-btn-icon"
81
- viewBox="0 0 448 512"
82
- >
83
- <path d="M32 32C14.3 32 0 46.3 0 64v96c0 17.7 14.3 32 32 32s32-14.3 32-32V96h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H32zM64 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H64V352zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32h64v64c0 17.7 14.3 32 32 32s32-14.3 32-32V64c0-17.7-14.3-32-32-32H320zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v64H320c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32V352z" />
84
- </svg>
85
- <svg
86
- className="openapi-explorer__code-block-expand-btn-icon--success"
87
- viewBox="0 0 24 24"
88
- >
89
- <path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" />
90
- </svg>
91
- </span>
92
- </button>
93
- <Modal
94
- className="openapi-explorer__expand-modal-content"
95
- overlayClassName="openapi-explorer__expand-modal-overlay"
96
- isOpen={modalIsOpen}
97
- onRequestClose={closeModal}
98
- contentLabel="Code Snippet"
99
- >
100
- <Container
101
- as="div"
102
- className={clsx(
126
+ ),
127
+ onClick: openModal,
128
+ },
129
+ react_1.default.createElement(
130
+ "span",
131
+ {
132
+ className: "openapi-explorer__code-block-expand-btn-icons",
133
+ "aria-hidden": "true",
134
+ },
135
+ react_1.default.createElement(
136
+ "svg",
137
+ {
138
+ className: "openapi-explorer__code-block-expand-btn-icon",
139
+ viewBox: "0 0 448 512",
140
+ },
141
+ react_1.default.createElement("path", {
142
+ d: "M32 32C14.3 32 0 46.3 0 64v96c0 17.7 14.3 32 32 32s32-14.3 32-32V96h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H32zM64 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H64V352zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32h64v64c0 17.7 14.3 32 32 32s32-14.3 32-32V64c0-17.7-14.3-32-32-32H320zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v64H320c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32V352z",
143
+ })
144
+ ),
145
+ react_1.default.createElement(
146
+ "svg",
147
+ {
148
+ className: "openapi-explorer__code-block-expand-btn-icon--success",
149
+ viewBox: "0 0 24 24",
150
+ },
151
+ react_1.default.createElement("path", {
152
+ d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",
153
+ })
154
+ )
155
+ )
156
+ ),
157
+ react_1.default.createElement(
158
+ react_modal_1.default,
159
+ {
160
+ className: "openapi-explorer__expand-modal-content",
161
+ overlayClassName: "openapi-explorer__expand-modal-overlay",
162
+ isOpen: modalIsOpen,
163
+ onRequestClose: closeModal,
164
+ contentLabel: "Code Snippet",
165
+ },
166
+ react_1.default.createElement(
167
+ Container_1.default,
168
+ {
169
+ as: "div",
170
+ className: (0, clsx_1.default)(
103
171
  "openapi-explorer__code-block-container",
104
172
  language &&
105
173
  !blockClassName.includes(`language-${language}`) &&
106
174
  `language-${language}`
107
- )}
108
- >
109
- {title && (
110
- <div className="openapi-explorer__code-block-title">{title}</div>
111
- )}
112
- <div className="openapi-explorer__code-block-content">
113
- <Highlight
114
- {...defaultProps}
115
- theme={prismTheme}
116
- code={code}
117
- language={language ?? "text"}
118
- >
119
- {({ className, tokens, getLineProps, getTokenProps }) => (
120
- <pre
175
+ ),
176
+ },
177
+ title &&
178
+ react_1.default.createElement(
179
+ "div",
180
+ { className: "openapi-explorer__code-block-title" },
181
+ title
182
+ ),
183
+ react_1.default.createElement(
184
+ "div",
185
+ { className: "openapi-explorer__code-block-content" },
186
+ react_1.default.createElement(
187
+ prism_react_renderer_1.Highlight,
188
+ { theme: prismTheme, code: code, language: language ?? "text" },
189
+ ({ className, tokens, getLineProps, getTokenProps }) =>
190
+ react_1.default.createElement(
191
+ "pre",
192
+ {
121
193
  /* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */
122
- tabIndex={0}
123
- className={clsx(
194
+ tabIndex: 0,
195
+ className: (0, clsx_1.default)(
124
196
  className,
125
197
  "openapi-explorer__code-block",
126
198
  "thin-scrollbar"
127
- )}
128
- >
129
- <code
130
- className={clsx(
199
+ ),
200
+ },
201
+ react_1.default.createElement(
202
+ "code",
203
+ {
204
+ className: (0, clsx_1.default)(
131
205
  "openapi-explorer__code-block-lines",
132
206
  showLineNumbers &&
133
207
  "openapi-explorer__code-block-lines-numbers"
134
- )}
135
- >
136
- {tokens.map((line, i) => (
137
- <Line
138
- key={i}
139
- line={line}
140
- getLineProps={getLineProps}
141
- getTokenProps={getTokenProps}
142
- classNames={lineClassNames[i]}
143
- showLineNumbers={showLineNumbers}
144
- />
145
- ))}
146
- </code>
147
- </pre>
148
- )}
149
- </Highlight>
150
- <div className="openapi-explorer__code-block-btn-group">
151
- <CopyButton
152
- className="openapi-explorer__code-block-code-btn"
153
- code={code}
154
- />
155
- <ExitButton
156
- className="openapi-dmeo__code-block-code-btn"
157
- handler={closeModal}
158
- />
159
- </div>
160
- </div>
161
- </Container>
162
- </Modal>
163
- </>
208
+ ),
209
+ },
210
+ tokens.map((line, i) =>
211
+ react_1.default.createElement(Line_1.default, {
212
+ key: i,
213
+ line: line,
214
+ getLineProps: getLineProps,
215
+ getTokenProps: getTokenProps,
216
+ classNames: lineClassNames,
217
+ showLineNumbers: showLineNumbers,
218
+ })
219
+ )
220
+ )
221
+ )
222
+ ),
223
+ react_1.default.createElement(
224
+ "div",
225
+ { className: "openapi-explorer__code-block-btn-group" },
226
+ react_1.default.createElement(CopyButton_1.default, {
227
+ className: "openapi-explorer__code-block-code-btn",
228
+ code: code,
229
+ }),
230
+ react_1.default.createElement(ExitButton_1.default, {
231
+ className: "openapi-dmeo__code-block-code-btn",
232
+ handler: closeModal,
233
+ })
234
+ )
235
+ )
236
+ )
237
+ )
164
238
  );
165
239
  }
240
+ exports.default = ExpandButton;
@@ -0,0 +1,4 @@
1
+ import React, { ComponentProps } from "react";
2
+ export default function CodeBlockContainer<T extends "div" | "pre">({ as: As, ...props }: {
3
+ as: T;
4
+ } & ComponentProps<T>): React.JSX.Element;
@@ -1,29 +1,35 @@
1
+ "use strict";
1
2
  /* ============================================================================
2
3
  * Copyright (c) Palo Alto Networks
3
4
  *
4
5
  * This source code is licensed under the MIT license found in the
5
6
  * LICENSE file in the root directory of this source tree.
6
7
  * ========================================================================== */
7
-
8
- import React from "react";
9
-
10
- import { ThemeClassNames, usePrismTheme } from "@docusaurus/theme-common";
11
- import { getPrismCssVariables } from "@docusaurus/theme-common/internal";
12
- import clsx from "clsx";
13
-
14
- export default function CodeBlockContainer({ as: As, ...props }) {
15
- const prismTheme = usePrismTheme();
16
- const prismCssVariables = getPrismCssVariables(prismTheme);
17
- return (
18
- <As
19
- // Polymorphic components are hard to type, without `oneOf` generics
20
- {...props}
21
- style={prismCssVariables}
22
- className={clsx(
8
+ var __importDefault =
9
+ (this && this.__importDefault) ||
10
+ function (mod) {
11
+ return mod && mod.__esModule ? mod : { default: mod };
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ const react_1 = __importDefault(require("react"));
15
+ const theme_common_1 = require("@docusaurus/theme-common");
16
+ const internal_1 = require("@docusaurus/theme-common/internal");
17
+ const clsx_1 = __importDefault(require("clsx"));
18
+ function CodeBlockContainer({ as: As, ...props }) {
19
+ const prismTheme = (0, theme_common_1.usePrismTheme)();
20
+ const prismCssVariables = (0, internal_1.getPrismCssVariables)(prismTheme);
21
+ return react_1.default.createElement(
22
+ As,
23
+ // Polymorphic components are hard to type, without `oneOf` generics
24
+ {
25
+ ...props,
26
+ style: prismCssVariables,
27
+ className: (0, clsx_1.default)(
23
28
  "openapi-explorer__code-block-container",
24
29
  props.className,
25
- ThemeClassNames.common.codeBlock
26
- )}
27
- />
30
+ theme_common_1.ThemeClassNames.common.codeBlock
31
+ ),
32
+ }
28
33
  );
29
34
  }
35
+ exports.default = CodeBlockContainer;
@@ -0,0 +1,4 @@
1
+ /// <reference types="@docusaurus/theme-classic" />
2
+ import React from "react";
3
+ import type { Props } from "@theme/CodeBlock/Content/Element";
4
+ export default function CodeBlockJSX({ children, className, }: Props): React.JSX.Element;
@@ -1,30 +1,41 @@
1
+ "use strict";
1
2
  /* ============================================================================
2
3
  * Copyright (c) Palo Alto Networks
3
4
  *
4
5
  * This source code is licensed under the MIT license found in the
5
6
  * LICENSE file in the root directory of this source tree.
6
7
  * ========================================================================== */
7
-
8
- import React from "react";
9
-
10
- import Container from "@theme/ApiExplorer/ApiCodeBlock/Container";
11
- import clsx from "clsx";
12
-
8
+ var __importDefault =
9
+ (this && this.__importDefault) ||
10
+ function (mod) {
11
+ return mod && mod.__esModule ? mod : { default: mod };
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ const react_1 = __importDefault(require("react"));
15
+ const Container_1 = __importDefault(
16
+ require("@theme/ApiExplorer/ApiCodeBlock/Container")
17
+ );
18
+ const clsx_1 = __importDefault(require("clsx"));
13
19
  // <pre> tags in markdown map to CodeBlocks. They may contain JSX children. When
14
20
  // the children is not a simple string, we just return a styled block without
15
21
  // actually highlighting.
16
- export default function CodeBlockJSX({ children, className }) {
17
- return (
18
- <Container
19
- as="pre"
20
- tabIndex={0}
21
- className={clsx(
22
+ function CodeBlockJSX({ children, className }) {
23
+ return react_1.default.createElement(
24
+ Container_1.default,
25
+ {
26
+ as: "pre",
27
+ tabIndex: 0,
28
+ className: (0, clsx_1.default)(
22
29
  "openapi-explorer__code-block-standalone",
23
30
  "thin-scrollbar",
24
31
  className
25
- )}
26
- >
27
- <code className="openapi-explorer__code-block-lines">{children}</code>
28
- </Container>
32
+ ),
33
+ },
34
+ react_1.default.createElement(
35
+ "code",
36
+ { className: "openapi-explorer__code-block-lines" },
37
+ children
38
+ )
29
39
  );
30
40
  }
41
+ exports.default = CodeBlockJSX;
@@ -0,0 +1,4 @@
1
+ /// <reference types="@docusaurus/theme-classic" />
2
+ import React from "react";
3
+ import type { Props } from "@theme/CodeBlock/Content/String";
4
+ export default function CodeBlockString({ children, className: blockClassName, metastring, title: titleProp, showLineNumbers: showLineNumbersProp, language: languageProp, }: Props): React.JSX.Element;