docusaurus-theme-openapi-docs 3.0.0-beta.1 → 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 (142) hide show
  1. package/lib/markdown/utils.d.ts +3 -2
  2. package/lib/markdown/utils.js +1 -1
  3. package/lib/markdown/utils.test.d.ts +1 -0
  4. package/lib/markdown/utils.test.js +43 -0
  5. package/lib/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/index.d.ts +13 -0
  6. package/lib/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/index.js +199 -124
  7. package/lib/theme/ApiExplorer/Accept/index.d.ts +2 -2
  8. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.d.ts +4 -0
  9. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.js +25 -19
  10. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.d.ts +4 -0
  11. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +27 -16
  12. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.d.ts +4 -0
  13. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.js +115 -96
  14. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.d.ts +3 -0
  15. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +115 -54
  16. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.d.ts +6 -0
  17. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +41 -30
  18. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.d.ts +14 -0
  19. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +200 -120
  20. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.d.ts +3 -0
  21. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.js +36 -24
  22. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.d.ts +7 -0
  23. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +35 -28
  24. package/lib/theme/ApiExplorer/ApiCodeBlock/index.d.ts +3 -0
  25. package/lib/theme/ApiExplorer/ApiCodeBlock/index.js +72 -14
  26. package/lib/theme/ApiExplorer/Authorization/index.d.ts +2 -2
  27. package/lib/theme/ApiExplorer/Authorization/slice.d.ts +1 -1
  28. package/lib/theme/ApiExplorer/Body/index.d.ts +2 -2
  29. package/lib/theme/ApiExplorer/Body/index.js +8 -1
  30. package/lib/theme/ApiExplorer/Body/slice.d.ts +3 -3
  31. package/lib/theme/ApiExplorer/CodeSnippets/code-snippets-types.d.ts +21 -0
  32. package/lib/theme/ApiExplorer/CodeSnippets/code-snippets-types.js +8 -0
  33. package/lib/theme/ApiExplorer/CodeSnippets/index.d.ts +4 -14
  34. package/lib/theme/ApiExplorer/CodeSnippets/index.js +86 -8
  35. package/lib/theme/ApiExplorer/CodeSnippets/languages.d.ts +3 -0
  36. package/lib/theme/ApiExplorer/CodeSnippets/languages.js +48 -0
  37. package/lib/theme/ApiExplorer/CodeSnippets/languages.json +0 -96
  38. package/lib/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +18 -2
  39. package/lib/theme/ApiExplorer/CodeTabs/index.d.ts +15 -0
  40. package/lib/theme/ApiExplorer/CodeTabs/index.js +131 -76
  41. package/lib/theme/ApiExplorer/ContentType/index.d.ts +2 -2
  42. package/lib/theme/ApiExplorer/Export/index.d.ts +2 -2
  43. package/lib/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +3 -1
  44. package/lib/theme/ApiExplorer/FloatingButton/index.d.ts +1 -1
  45. package/lib/theme/ApiExplorer/FormFileUpload/index.d.ts +2 -2
  46. package/lib/theme/ApiExplorer/FormItem/index.d.ts +1 -1
  47. package/lib/theme/ApiExplorer/FormMultiSelect/index.d.ts +1 -1
  48. package/lib/theme/ApiExplorer/FormSelect/index.d.ts +1 -1
  49. package/lib/theme/ApiExplorer/FormTextInput/index.d.ts +1 -1
  50. package/lib/theme/ApiExplorer/MethodEndpoint/index.d.ts +2 -2
  51. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.d.ts +2 -2
  52. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.d.ts +2 -2
  53. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.d.ts +2 -2
  54. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +4 -4
  55. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.d.ts +2 -2
  56. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.d.ts +2 -2
  57. package/lib/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +2 -1
  58. package/lib/theme/ApiExplorer/ParamOptions/index.d.ts +2 -2
  59. package/lib/theme/ApiExplorer/ParamOptions/slice.d.ts +1 -1
  60. package/lib/theme/ApiExplorer/Request/_Request.scss +4 -2
  61. package/lib/theme/ApiExplorer/Request/index.d.ts +2 -2
  62. package/lib/theme/ApiExplorer/Request/makeRequest.js +50 -1
  63. package/lib/theme/ApiExplorer/Response/_Response.scss +4 -2
  64. package/lib/theme/ApiExplorer/Response/index.d.ts +2 -2
  65. package/lib/theme/ApiExplorer/Response/index.js +19 -19
  66. package/lib/theme/ApiExplorer/SecuritySchemes/index.d.ts +2 -2
  67. package/lib/theme/ApiExplorer/Server/index.d.ts +2 -2
  68. package/lib/theme/ApiExplorer/buildPostmanRequest.d.ts +1 -1
  69. package/lib/theme/ApiExplorer/index.d.ts +2 -2
  70. package/lib/theme/ApiExplorer/index.js +1 -1
  71. package/lib/theme/ApiExplorer/storage-utils.d.ts +1 -1
  72. package/lib/theme/ApiItem/index.js +28 -3
  73. package/lib/theme/ApiItem/store.d.ts +6 -6
  74. package/lib/theme/ApiLogo/index.d.ts +2 -2
  75. package/lib/theme/ApiTabs/_ApiTabs.scss +3 -1
  76. package/lib/theme/ApiTabs/index.d.ts +7 -0
  77. package/lib/theme/ApiTabs/index.js +167 -103
  78. package/lib/theme/DiscriminatorTabs/index.d.ts +3 -0
  79. package/lib/theme/DiscriminatorTabs/index.js +152 -98
  80. package/lib/theme/Markdown/index.js +37 -0
  81. package/lib/theme/MimeTabs/index.d.ts +6 -0
  82. package/lib/theme/MimeTabs/index.js +169 -118
  83. package/lib/theme/OperationTabs/_OperationTabs.scss +71 -0
  84. package/lib/theme/OperationTabs/index.d.ts +3 -0
  85. package/lib/theme/OperationTabs/index.js +234 -0
  86. package/lib/theme/ParamsItem/index.d.ts +23 -0
  87. package/lib/theme/ParamsItem/index.js +170 -111
  88. package/lib/theme/ResponseSamples/index.d.ts +8 -0
  89. package/lib/theme/ResponseSamples/index.js +18 -13
  90. package/lib/theme/SchemaItem/index.d.ts +12 -0
  91. package/lib/theme/SchemaItem/index.js +121 -89
  92. package/lib/theme/SchemaTabs/_SchemaTabs.scss +0 -4
  93. package/lib/theme/SchemaTabs/index.d.ts +3 -0
  94. package/lib/theme/SchemaTabs/index.js +148 -95
  95. package/lib/theme/styles.scss +5 -0
  96. package/lib/types.d.ts +4 -4
  97. package/package.json +8 -7
  98. package/src/markdown/utils.test.ts +49 -0
  99. package/src/markdown/utils.ts +5 -3
  100. package/src/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/{index.js → index.tsx} +21 -8
  101. package/src/theme/ApiExplorer/ApiCodeBlock/Container/{index.js → index.tsx} +6 -3
  102. package/src/theme/ApiExplorer/ApiCodeBlock/Content/{Element.js → Element.tsx} +5 -1
  103. package/src/theme/ApiExplorer/ApiCodeBlock/Content/{String.js → String.tsx} +4 -4
  104. package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/{index.js → index.tsx} +8 -3
  105. package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/{index.js → index.tsx} +9 -1
  106. package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/{index.js → index.tsx} +12 -2
  107. package/src/theme/ApiExplorer/ApiCodeBlock/Line/{index.js → index.tsx} +2 -1
  108. package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/{index.js → index.tsx} +11 -1
  109. package/src/theme/ApiExplorer/ApiCodeBlock/{index.js → index.tsx} +10 -5
  110. package/src/theme/ApiExplorer/Body/index.tsx +3 -1
  111. package/src/theme/ApiExplorer/CodeSnippets/code-snippets-types.ts +55 -0
  112. package/src/theme/ApiExplorer/CodeSnippets/index.tsx +94 -21
  113. package/src/theme/ApiExplorer/CodeSnippets/languages.json +0 -96
  114. package/src/theme/ApiExplorer/CodeSnippets/languages.ts +53 -0
  115. package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +18 -2
  116. package/src/theme/ApiExplorer/CodeTabs/{index.js → index.tsx} +64 -25
  117. package/src/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +3 -1
  118. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +4 -4
  119. package/src/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +2 -1
  120. package/src/theme/ApiExplorer/Request/_Request.scss +4 -2
  121. package/src/theme/ApiExplorer/Request/makeRequest.ts +59 -4
  122. package/src/theme/ApiExplorer/Response/_Response.scss +4 -2
  123. package/src/theme/ApiExplorer/Response/index.tsx +2 -2
  124. package/src/theme/ApiExplorer/index.tsx +1 -1
  125. package/src/theme/ApiItem/index.tsx +22 -3
  126. package/src/theme/ApiLogo/index.tsx +1 -1
  127. package/src/theme/ApiTabs/_ApiTabs.scss +3 -1
  128. package/src/theme/ApiTabs/{index.js → index.tsx} +75 -31
  129. package/src/theme/DiscriminatorTabs/{index.js → index.tsx} +63 -28
  130. package/src/theme/Markdown/index.js +37 -0
  131. package/src/theme/MimeTabs/{index.js → index.tsx} +64 -30
  132. package/src/theme/OperationTabs/_OperationTabs.scss +71 -0
  133. package/src/theme/OperationTabs/index.tsx +218 -0
  134. package/src/theme/ParamsItem/{index.js → index.tsx} +48 -17
  135. package/src/theme/ResponseSamples/{index.js → index.tsx} +10 -1
  136. package/src/theme/SchemaItem/{index.js → index.tsx} +24 -18
  137. package/src/theme/SchemaTabs/_SchemaTabs.scss +0 -4
  138. package/src/theme/SchemaTabs/{index.js → index.tsx} +62 -29
  139. package/src/theme/styles.scss +5 -0
  140. package/src/theme-classic.d.ts +69 -2
  141. package/src/theme-openapi.d.ts +6 -0
  142. package/tsconfig.json +4 -1
@@ -1,24 +1,69 @@
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, { cloneElement, useRef, useEffect, useState } from "react";
9
-
10
- import {
11
- useScrollPositionBlocker,
12
- useTabs,
13
- } from "@docusaurus/theme-common/internal";
14
- import useIsBrowser from "@docusaurus/useIsBrowser";
15
- import clsx from "clsx";
16
- import flatten from "lodash/flatten";
17
-
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 internal_1 = require("@docusaurus/theme-common/internal");
60
+ const useIsBrowser_1 = __importDefault(require("@docusaurus/useIsBrowser"));
61
+ const clsx_1 = __importDefault(require("clsx"));
62
+ const flatten_1 = __importDefault(require("lodash/flatten"));
18
63
  function TabList({ className, block, selectedValue, selectValue, tabValues }) {
19
64
  const tabRefs = [];
20
- const { blockElementScrollPositionUntilNextRender } =
21
- useScrollPositionBlocker();
65
+ const { blockElementScrollPositionUntilNextRender } = (0,
66
+ internal_1.useScrollPositionBlocker)();
22
67
  const handleTabChange = (event) => {
23
68
  const newTab = event.currentTarget;
24
69
  const newTabIndex = tabRefs.indexOf(newTab);
@@ -50,136 +95,145 @@ function TabList({ className, block, selectedValue, selectValue, tabValues }) {
50
95
  }
51
96
  focusElement?.focus();
52
97
  };
53
-
54
- const tabItemListContainerRef = useRef(null);
55
- const [showTabArrows, setShowTabArrows] = useState(false);
56
-
57
- useEffect(() => {
98
+ const tabItemListContainerRef = (0, react_1.useRef)(null);
99
+ const [showTabArrows, setShowTabArrows] = (0, react_1.useState)(false);
100
+ (0, react_1.useEffect)(() => {
58
101
  const resizeObserver = new ResizeObserver((entries) => {
59
102
  for (let entry of entries) {
60
- if (entry.target.offsetWidth < entry.target.scrollWidth) {
61
- setShowTabArrows(true);
62
- } else {
63
- setShowTabArrows(false);
64
- }
103
+ requestAnimationFrame(() => {
104
+ if (entry.target.clientWidth < entry.target.scrollWidth) {
105
+ setShowTabArrows(true);
106
+ } else {
107
+ setShowTabArrows(false);
108
+ }
109
+ });
65
110
  }
66
111
  });
67
-
68
112
  resizeObserver.observe(tabItemListContainerRef.current);
69
-
70
113
  return () => {
71
114
  resizeObserver.disconnect();
72
115
  };
73
116
  }, []);
74
-
75
117
  const handleRightClick = () => {
76
118
  tabItemListContainerRef.current.scrollLeft += 90;
77
119
  };
78
-
79
120
  const handleLeftClick = () => {
80
121
  tabItemListContainerRef.current.scrollLeft -= 90;
81
122
  };
82
-
83
- return (
84
- <div className="openapi-tabs__discriminator-top-section">
85
- <div className="openapi-tabs__discriminator-container">
86
- {showTabArrows && (
87
- <button
88
- className="openapi-tabs__arrow left"
89
- onClick={handleLeftClick}
90
- />
91
- )}
92
- <ul
93
- ref={tabItemListContainerRef}
94
- role="tablist"
95
- aria-orientation="horizontal"
96
- className={clsx(
123
+ return react_1.default.createElement(
124
+ "div",
125
+ { className: "openapi-tabs__discriminator-top-section" },
126
+ react_1.default.createElement(
127
+ "div",
128
+ { className: "openapi-tabs__discriminator-container" },
129
+ showTabArrows &&
130
+ react_1.default.createElement("button", {
131
+ className: "openapi-tabs__arrow left",
132
+ onClick: handleLeftClick,
133
+ }),
134
+ react_1.default.createElement(
135
+ "ul",
136
+ {
137
+ ref: tabItemListContainerRef,
138
+ role: "tablist",
139
+ "aria-orientation": "horizontal",
140
+ className: (0, clsx_1.default)(
97
141
  "openapi-tabs__discriminator-list-container",
98
142
  "tabs",
99
143
  {
100
144
  "tabs--block": block,
101
145
  },
102
146
  className
103
- )}
104
- >
105
- {tabValues.map(({ value, label, attributes }) => (
106
- <li
147
+ ),
148
+ },
149
+ tabValues.map(({ value, label, attributes }) =>
150
+ react_1.default.createElement(
151
+ "li",
152
+ {
107
153
  // TODO extract TabListItem
108
- role="tab"
109
- tabIndex={selectedValue === value ? 0 : -1}
110
- aria-selected={selectedValue === value}
111
- key={value}
112
- ref={(tabControl) => tabRefs.push(tabControl)}
113
- onKeyDown={handleKeydown}
114
- onClick={handleTabChange}
115
- {...attributes}
116
- className={clsx(
154
+ role: "tab",
155
+ tabIndex: selectedValue === value ? 0 : -1,
156
+ "aria-selected": selectedValue === value,
157
+ key: value,
158
+ ref: (tabControl) => tabRefs.push(tabControl),
159
+ onKeyDown: handleKeydown,
160
+ onClick: handleTabChange,
161
+ ...attributes,
162
+ className: (0, clsx_1.default)(
117
163
  "tabs__item",
118
164
  "openapi-tabs__discriminator-item",
119
165
  attributes?.className,
120
166
  {
121
167
  active: selectedValue === value,
122
168
  }
123
- )}
124
- >
125
- <span className="openapi-tabs__discriminator-tab-label">
126
- {label ?? value}
127
- </span>
128
- </li>
129
- ))}
130
- </ul>
131
- {showTabArrows && (
132
- <button
133
- className="openapi-tabs__arrow right"
134
- onClick={handleRightClick}
135
- />
136
- )}
137
- </div>
138
- </div>
169
+ ),
170
+ },
171
+ react_1.default.createElement(
172
+ "span",
173
+ { className: "openapi-tabs__discriminator-tab-label" },
174
+ label ?? value
175
+ )
176
+ )
177
+ )
178
+ ),
179
+ showTabArrows &&
180
+ react_1.default.createElement("button", {
181
+ className: "openapi-tabs__arrow right",
182
+ onClick: handleRightClick,
183
+ })
184
+ )
139
185
  );
140
186
  }
141
187
  function TabContent({ lazy, children, selectedValue }) {
142
- // eslint-disable-next-line no-param-reassign
143
- children = Array.isArray(children) ? children : [children];
144
- const flattenedChildren = flatten(children);
188
+ const childTabs = (Array.isArray(children) ? children : [children]).filter(
189
+ Boolean
190
+ );
191
+ const flattenedChildTabs = (0, flatten_1.default)(childTabs);
145
192
  if (lazy) {
146
- const selectedTabItem = flattenedChildren.find(
193
+ const selectedTabItem = flattenedChildTabs.find(
147
194
  (tabItem) => tabItem.props.value === selectedValue
148
195
  );
149
196
  if (!selectedTabItem) {
150
197
  // fail-safe or fail-fast? not sure what's best here
151
198
  return null;
152
199
  }
153
- return cloneElement(selectedTabItem, { className: "margin-top--md" });
200
+ return (0, react_1.cloneElement)(selectedTabItem, {
201
+ className: "margin-top--md",
202
+ });
154
203
  }
155
- return (
156
- <div className="margin-top--md">
157
- {children.map((tabItem, i) =>
158
- cloneElement(tabItem, {
159
- key: i,
160
- hidden: tabItem.props.value !== selectedValue,
161
- })
162
- )}
163
- </div>
204
+ return react_1.default.createElement(
205
+ "div",
206
+ { className: "margin-top--md" },
207
+ childTabs.map((tabItem, i) =>
208
+ (0, react_1.cloneElement)(tabItem, {
209
+ key: i,
210
+ hidden: tabItem.props.value !== selectedValue,
211
+ })
212
+ )
164
213
  );
165
214
  }
166
215
  function TabsComponent(props) {
167
- const tabs = useTabs(props);
168
- return (
169
- <div className="openapi-tabs__container">
170
- <TabList {...props} {...tabs} />
171
- <TabContent {...props} {...tabs} />
172
- </div>
216
+ const tabs = (0, internal_1.useTabs)(props);
217
+ return react_1.default.createElement(
218
+ "div",
219
+ { className: "openapi-tabs__container" },
220
+ react_1.default.createElement(TabList, { ...props, ...tabs }),
221
+ react_1.default.createElement(TabContent, { ...props, ...tabs })
173
222
  );
174
223
  }
175
- export default function DiscriminatorTabs(props) {
176
- const isBrowser = useIsBrowser();
177
- return (
178
- <TabsComponent
224
+ function DiscriminatorTabs(props) {
225
+ const isBrowser = (0, useIsBrowser_1.default)();
226
+ return react_1.default.createElement(
227
+ TabsComponent,
228
+ // Remount tabs after hydration
229
+ // Temporary fix for https://github.com/facebook/docusaurus/issues/5653
230
+ {
179
231
  // Remount tabs after hydration
180
232
  // Temporary fix for https://github.com/facebook/docusaurus/issues/5653
181
- key={String(isBrowser)}
182
- {...props}
183
- />
233
+ key: String(isBrowser),
234
+ ...props,
235
+ },
236
+ (0, internal_1.sanitizeTabsChildren)(props.children)
184
237
  );
185
238
  }
239
+ exports.default = DiscriminatorTabs;
@@ -0,0 +1,37 @@
1
+ /* ============================================================================
2
+ * Copyright (c) Palo Alto Networks
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ * ========================================================================== */
7
+
8
+ import React from "react";
9
+
10
+ import CodeBlock from "@theme/CodeBlock";
11
+ import ReactMarkdown from "react-markdown";
12
+ import rehypeRaw from "rehype-raw";
13
+
14
+ function Markdown({ children }) {
15
+ return (
16
+ <div>
17
+ <ReactMarkdown
18
+ children={children}
19
+ rehypePlugins={[rehypeRaw]}
20
+ components={{
21
+ pre: "div",
22
+ code({ node, inline, className, children, ...props }) {
23
+ const match = /language-(\w+)/.exec(className || "");
24
+ if (inline) return <code>{children}</code>;
25
+ return !inline && match ? (
26
+ <CodeBlock className={className}>{children}</CodeBlock>
27
+ ) : (
28
+ <CodeBlock>{children}</CodeBlock>
29
+ );
30
+ },
31
+ }}
32
+ />
33
+ </div>
34
+ );
35
+ }
36
+
37
+ export default Markdown;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import { TabProps } from "@docusaurus/theme-common/internal";
3
+ export interface Props {
4
+ schemaType: any;
5
+ }
6
+ export default function MimeTabs(props: Props & TabProps): React.JSX.Element;