docusaurus-theme-openapi-docs 1.0.4 → 1.1.0
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/Body/index.js +11 -9
- package/lib/theme/ApiDemoPanel/Body/json2xml.js +43 -0
- package/lib/theme/ApiDemoPanel/CodeTabs/index.js +193 -0
- package/lib/theme/ApiDemoPanel/CodeTabs/styles.module.css +11 -0
- package/lib/theme/ApiDemoPanel/Curl/index.js +41 -110
- package/lib/theme/ApiDemoPanel/FloatingButton/index.js +4 -2
- package/lib/theme/ApiDemoPanel/FloatingButton/styles.module.css +3 -2
- package/lib/theme/ApiDemoPanel/LiveEditor/index.js +74 -0
- package/lib/theme/ApiDemoPanel/LiveEditor/styles.module.css +35 -0
- package/lib/theme/ApiDemoPanel/ParamOptions/styles.module.css +0 -4
- package/lib/theme/ApiDemoPanel/Server/index.js +1 -1
- package/lib/theme/ApiDemoPanel/Server/styles.module.css +0 -4
- package/lib/theme/ApiItem/Content/index.js +65 -0
- package/lib/theme/ApiItem/Footer/index.js +78 -0
- package/lib/theme/ApiItem/Footer/styles.module.css +18 -0
- package/lib/theme/ApiItem/Layout/icons/bash-original.svg +1 -0
- package/lib/theme/ApiItem/Layout/icons/go-original-wordmark.svg +1 -0
- package/lib/theme/ApiItem/Layout/icons/javascript-original.svg +1 -0
- package/lib/theme/ApiItem/Layout/icons/linux-original.svg +1 -0
- package/lib/theme/ApiItem/Layout/icons/python-original.svg +1 -0
- package/lib/theme/ApiItem/Layout/index.js +93 -0
- package/lib/theme/ApiItem/{styles.module.css → Layout/styles.module.css} +114 -4
- package/lib/theme/ApiItem/Metadata/index.js +32 -0
- package/lib/theme/ApiItem/Paginator/index.js +33 -0
- package/lib/theme/ApiItem/TOC/Desktop/index.js +31 -0
- package/lib/theme/ApiItem/TOC/Mobile/index.js +35 -0
- package/lib/theme/ApiItem/TOC/Mobile/styles.module.css +19 -0
- package/lib/theme/ApiItem/index.js +37 -126
- package/lib/theme/ApiTabs/index.js +17 -6
- package/lib/theme/ApiTabs/styles.module.css +0 -1
- package/lib/theme/SchemaTabs/index.js +258 -0
- package/lib/theme/SchemaTabs/styles.module.css +110 -0
- package/lib-next/theme/ApiDemoPanel/Body/index.js +11 -15
- package/lib-next/theme/ApiDemoPanel/Body/json2xml.js +43 -0
- package/lib-next/theme/ApiDemoPanel/CodeTabs/index.js +215 -0
- package/lib-next/theme/ApiDemoPanel/CodeTabs/styles.module.css +11 -0
- package/lib-next/theme/ApiDemoPanel/Curl/index.js +46 -135
- package/lib-next/theme/ApiDemoPanel/FloatingButton/index.js +6 -2
- package/lib-next/theme/ApiDemoPanel/FloatingButton/styles.module.css +3 -2
- package/lib-next/theme/ApiDemoPanel/LiveEditor/index.js +60 -0
- package/lib-next/theme/ApiDemoPanel/LiveEditor/styles.module.css +35 -0
- package/lib-next/theme/ApiDemoPanel/ParamOptions/styles.module.css +0 -4
- package/lib-next/theme/ApiDemoPanel/Server/index.js +1 -0
- package/lib-next/theme/ApiDemoPanel/Server/styles.module.css +0 -4
- package/lib-next/theme/ApiItem/Content/index.js +55 -0
- package/lib-next/theme/ApiItem/Footer/index.js +88 -0
- package/lib-next/theme/ApiItem/Footer/styles.module.css +18 -0
- package/lib-next/theme/ApiItem/Layout/icons/bash-original.svg +1 -0
- package/lib-next/theme/ApiItem/Layout/icons/go-original-wordmark.svg +1 -0
- package/lib-next/theme/ApiItem/Layout/icons/javascript-original.svg +1 -0
- package/lib-next/theme/ApiItem/Layout/icons/linux-original.svg +1 -0
- package/lib-next/theme/ApiItem/Layout/icons/python-original.svg +1 -0
- package/lib-next/theme/ApiItem/Layout/index.js +69 -0
- package/{src/theme/ApiItem → lib-next/theme/ApiItem/Layout}/styles.module.css +114 -4
- package/lib-next/theme/ApiItem/Metadata/index.js +21 -0
- package/lib-next/theme/ApiItem/Paginator/index.js +19 -0
- package/lib-next/theme/ApiItem/TOC/Desktop/index.js +22 -0
- package/lib-next/theme/ApiItem/TOC/Mobile/index.js +24 -0
- package/lib-next/theme/ApiItem/TOC/Mobile/styles.module.css +19 -0
- package/lib-next/theme/ApiItem/index.js +31 -133
- package/lib-next/theme/ApiTabs/index.js +17 -6
- package/lib-next/theme/ApiTabs/styles.module.css +0 -1
- package/lib-next/theme/SchemaTabs/index.js +258 -0
- package/lib-next/theme/SchemaTabs/styles.module.css +110 -0
- package/package.json +7 -9
- package/src/theme/ApiDemoPanel/Body/index.tsx +9 -13
- package/src/theme/ApiDemoPanel/Body/json2xml.js +43 -0
- package/src/theme/ApiDemoPanel/CodeTabs/index.tsx +238 -0
- package/src/theme/ApiDemoPanel/CodeTabs/styles.module.css +11 -0
- package/src/theme/ApiDemoPanel/Curl/index.tsx +45 -124
- package/src/theme/ApiDemoPanel/FloatingButton/index.tsx +6 -2
- package/src/theme/ApiDemoPanel/FloatingButton/styles.module.css +3 -2
- package/src/theme/ApiDemoPanel/LiveEditor/index.tsx +71 -0
- package/src/theme/ApiDemoPanel/LiveEditor/styles.module.css +35 -0
- package/src/theme/ApiDemoPanel/ParamOptions/styles.module.css +0 -4
- package/src/theme/ApiDemoPanel/Server/index.tsx +1 -0
- package/src/theme/ApiDemoPanel/Server/styles.module.css +0 -4
- package/src/theme/ApiItem/Content/index.tsx +57 -0
- package/src/theme/ApiItem/Footer/index.tsx +101 -0
- package/src/theme/ApiItem/Footer/styles.module.css +18 -0
- package/src/theme/ApiItem/Layout/icons/bash-original.svg +1 -0
- package/src/theme/ApiItem/Layout/icons/go-original-wordmark.svg +1 -0
- package/src/theme/ApiItem/Layout/icons/javascript-original.svg +1 -0
- package/src/theme/ApiItem/Layout/icons/linux-original.svg +1 -0
- package/src/theme/ApiItem/Layout/icons/python-original.svg +1 -0
- package/src/theme/ApiItem/Layout/index.tsx +78 -0
- package/{lib-next/theme/ApiItem → src/theme/ApiItem/Layout}/styles.module.css +114 -4
- package/src/theme/ApiItem/Metadata/index.tsx +24 -0
- package/src/theme/ApiItem/Paginator/index.tsx +21 -0
- package/src/theme/ApiItem/TOC/Desktop/index.tsx +25 -0
- package/src/theme/ApiItem/TOC/Mobile/index.tsx +28 -0
- package/src/theme/ApiItem/TOC/Mobile/styles.module.css +19 -0
- package/src/theme/ApiItem/index.tsx +31 -130
- package/src/theme/ApiTabs/index.js +17 -6
- package/src/theme/ApiTabs/styles.module.css +0 -1
- package/src/theme/SchemaTabs/index.js +258 -0
- package/src/theme/SchemaTabs/styles.module.css +110 -0
- package/lib/theme/ApiDemoPanel/VSCode/index.js +0 -252
- package/lib/theme/ApiDemoPanel/VSCode/styles.module.css +0 -19
- package/lib-next/theme/ApiDemoPanel/VSCode/index.js +0 -265
- package/lib-next/theme/ApiDemoPanel/VSCode/styles.module.css +0 -19
- package/src/theme/ApiDemoPanel/VSCode/index.tsx +0 -205
- package/src/theme/ApiDemoPanel/VSCode/styles.module.css +0 -19
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
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
|
+
|
|
1
8
|
:root {
|
|
2
9
|
--openapi-required: var(--ifm-color-danger);
|
|
3
10
|
--openapi-code-blue: var(--ifm-color-info);
|
|
@@ -6,6 +13,21 @@
|
|
|
6
13
|
--openapi-code-green: var(--ifm-color-success);
|
|
7
14
|
}
|
|
8
15
|
|
|
16
|
+
:global(.docs-wrapper) {
|
|
17
|
+
height: 100%;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.docItemContainer header + *,
|
|
21
|
+
.docItemContainer article > *:first-child {
|
|
22
|
+
margin-top: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@media (min-width: 997px) {
|
|
26
|
+
.docItemCol {
|
|
27
|
+
max-width: 75% !important;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
9
31
|
.apiItemContainer article > *:first-child,
|
|
10
32
|
.apiItemContainer header + * {
|
|
11
33
|
margin-top: 0;
|
|
@@ -70,10 +92,6 @@
|
|
|
70
92
|
padding-top: 5px;
|
|
71
93
|
}
|
|
72
94
|
|
|
73
|
-
:global(.theme-api-markdown details li:last-child) {
|
|
74
|
-
border-left: none;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
95
|
:global(.theme-api-markdown details p) {
|
|
78
96
|
margin-bottom: 0;
|
|
79
97
|
}
|
|
@@ -128,3 +146,95 @@
|
|
|
128
146
|
margin-top: 0 !important;
|
|
129
147
|
padding-left: 2px;
|
|
130
148
|
}
|
|
149
|
+
|
|
150
|
+
:global(.code__tab--python::after) {
|
|
151
|
+
content: "";
|
|
152
|
+
width: 32px;
|
|
153
|
+
height: 32px;
|
|
154
|
+
background: url(./icons/python-original.svg);
|
|
155
|
+
margin-block: auto;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
:global(.code__tab--python) {
|
|
159
|
+
color: var(--ifm-color-success);
|
|
160
|
+
padding-left: 2rem;
|
|
161
|
+
padding-right: 2rem;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:global(.code__tab--python.tabs__item--active) {
|
|
165
|
+
border-bottom-color: var(--ifm-color-success);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:global(.language-python) {
|
|
169
|
+
max-height: 500px;
|
|
170
|
+
overflow: auto;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
:global(.code__tab--go::after) {
|
|
174
|
+
content: "";
|
|
175
|
+
width: 32px;
|
|
176
|
+
height: 32px;
|
|
177
|
+
background: url(./icons/go-original-wordmark.svg);
|
|
178
|
+
margin-block: auto;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
:global(.code__tab--go) {
|
|
182
|
+
color: var(--ifm-color-info);
|
|
183
|
+
padding-left: 2rem;
|
|
184
|
+
padding-right: 2rem;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
:global(.code__tab--go.tabs__item--active) {
|
|
188
|
+
border-bottom-color: var(--ifm-color-info);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
:global(.language-go) {
|
|
192
|
+
max-height: 500px;
|
|
193
|
+
overflow: auto;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
:global(.code__tab--javascript::after) {
|
|
197
|
+
content: "";
|
|
198
|
+
width: 32px;
|
|
199
|
+
height: 32px;
|
|
200
|
+
background: url(./icons/javascript-original.svg);
|
|
201
|
+
margin-block: auto;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
:global(.code__tab--javascript) {
|
|
205
|
+
color: var(--ifm-color-warning);
|
|
206
|
+
padding-left: 2rem;
|
|
207
|
+
padding-right: 2rem;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
:global(.code__tab--javascript.tabs__item--active) {
|
|
211
|
+
border-bottom-color: var(--ifm-color-warning);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
:global(.language-javascript) {
|
|
215
|
+
max-height: 500px;
|
|
216
|
+
overflow: auto;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
:global(.code__tab--bash::after) {
|
|
220
|
+
content: "";
|
|
221
|
+
width: 32px;
|
|
222
|
+
height: 32px;
|
|
223
|
+
background: url(./icons/linux-original.svg);
|
|
224
|
+
margin-block: auto;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
:global(.code__tab--bash) {
|
|
228
|
+
color: var(--ifm-color-danger);
|
|
229
|
+
padding-left: 2rem;
|
|
230
|
+
padding-right: 2rem;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
:global(.code__tab--bash.tabs__item--active) {
|
|
234
|
+
border-bottom-color: var(--ifm-color-danger);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
:global(.language-bash) {
|
|
238
|
+
max-height: 500px;
|
|
239
|
+
overflow: auto;
|
|
240
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = DocItemMetadata;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _themeCommon = require("@docusaurus/theme-common");
|
|
11
|
+
|
|
12
|
+
var _internal = require("@docusaurus/theme-common/internal");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
/* ============================================================================
|
|
17
|
+
* Copyright (c) Palo Alto Networks
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the MIT license found in the
|
|
20
|
+
* LICENSE file in the root directory of this source tree.
|
|
21
|
+
* ========================================================================== */
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
function DocItemMetadata() {
|
|
24
|
+
var _assets$image;
|
|
25
|
+
|
|
26
|
+
const {
|
|
27
|
+
metadata,
|
|
28
|
+
frontMatter,
|
|
29
|
+
assets
|
|
30
|
+
} = (0, _internal.useDoc)();
|
|
31
|
+
return <_themeCommon.PageMetadata title={metadata.title} description={metadata.description} keywords={frontMatter.keywords} image={(_assets$image = assets.image) !== null && _assets$image !== void 0 ? _assets$image : frontMatter.image} />;
|
|
32
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = DocItemPaginator;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _internal = require("@docusaurus/theme-common/internal");
|
|
11
|
+
|
|
12
|
+
var _DocPaginator = _interopRequireDefault(require("@theme/DocPaginator"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
/* ============================================================================
|
|
17
|
+
* Copyright (c) Palo Alto Networks
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the MIT license found in the
|
|
20
|
+
* LICENSE file in the root directory of this source tree.
|
|
21
|
+
* ========================================================================== */
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* This extra component is needed, because <DocPaginator> should remain generic.
|
|
26
|
+
* DocPaginator is used in non-docs contexts too: generated-index pages...
|
|
27
|
+
*/
|
|
28
|
+
function DocItemPaginator() {
|
|
29
|
+
const {
|
|
30
|
+
metadata
|
|
31
|
+
} = (0, _internal.useDoc)();
|
|
32
|
+
return <_DocPaginator.default previous={metadata.previous} next={metadata.next} />;
|
|
33
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = DocItemTOCDesktop;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _themeCommon = require("@docusaurus/theme-common");
|
|
11
|
+
|
|
12
|
+
var _internal = require("@docusaurus/theme-common/internal");
|
|
13
|
+
|
|
14
|
+
var _TOC = _interopRequireDefault(require("@theme/TOC"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
/* ============================================================================
|
|
19
|
+
* Copyright (c) Palo Alto Networks
|
|
20
|
+
*
|
|
21
|
+
* This source code is licensed under the MIT license found in the
|
|
22
|
+
* LICENSE file in the root directory of this source tree.
|
|
23
|
+
* ========================================================================== */
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
function DocItemTOCDesktop() {
|
|
26
|
+
const {
|
|
27
|
+
toc,
|
|
28
|
+
frontMatter
|
|
29
|
+
} = (0, _internal.useDoc)();
|
|
30
|
+
return <_TOC.default toc={toc} minHeadingLevel={frontMatter.toc_min_heading_level} maxHeadingLevel={frontMatter.toc_max_heading_level} className={_themeCommon.ThemeClassNames.docs.docTocDesktop} />;
|
|
31
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = DocItemTOCMobile;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _themeCommon = require("@docusaurus/theme-common");
|
|
11
|
+
|
|
12
|
+
var _internal = require("@docusaurus/theme-common/internal");
|
|
13
|
+
|
|
14
|
+
var _TOCCollapsible = _interopRequireDefault(require("@theme/TOCCollapsible"));
|
|
15
|
+
|
|
16
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
17
|
+
|
|
18
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.css"));
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
/* ============================================================================
|
|
23
|
+
* Copyright (c) Palo Alto Networks
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the MIT license found in the
|
|
26
|
+
* LICENSE file in the root directory of this source tree.
|
|
27
|
+
* ========================================================================== */
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
function DocItemTOCMobile() {
|
|
30
|
+
const {
|
|
31
|
+
toc,
|
|
32
|
+
frontMatter
|
|
33
|
+
} = (0, _internal.useDoc)();
|
|
34
|
+
return <_TOCCollapsible.default toc={toc} minHeadingLevel={frontMatter.toc_min_heading_level} maxHeadingLevel={frontMatter.toc_max_heading_level} className={(0, _clsx.default)(_themeCommon.ThemeClassNames.docs.docTocMobile, _stylesModule.default.tocMobile)} />;
|
|
35
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
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
|
+
@media (min-width: 997px) {
|
|
9
|
+
/* Prevent hydration FOUC, as the mobile TOC needs to be server-rendered */
|
|
10
|
+
.tocMobile {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@media print {
|
|
16
|
+
.tocMobile {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -11,27 +11,11 @@ var _ExecutionEnvironment = _interopRequireDefault(require("@docusaurus/Executio
|
|
|
11
11
|
|
|
12
12
|
var _themeCommon = require("@docusaurus/theme-common");
|
|
13
13
|
|
|
14
|
-
var _DocBreadcrumbs = _interopRequireDefault(require("@theme/DocBreadcrumbs"));
|
|
15
|
-
|
|
16
|
-
var _DocItemFooter = _interopRequireDefault(require("@theme/DocItemFooter"));
|
|
17
|
-
|
|
18
|
-
var _DocPaginator = _interopRequireDefault(require("@theme/DocPaginator"));
|
|
19
|
-
|
|
20
|
-
var _DocVersionBadge = _interopRequireDefault(require("@theme/DocVersionBadge"));
|
|
21
|
-
|
|
22
|
-
var _DocVersionBanner = _interopRequireDefault(require("@theme/DocVersionBanner"));
|
|
23
|
-
|
|
24
|
-
var _Heading = _interopRequireDefault(require("@theme/Heading"));
|
|
25
|
-
|
|
26
|
-
var _MDXContent = _interopRequireDefault(require("@theme/MDXContent"));
|
|
27
|
-
|
|
28
|
-
var _TOC = _interopRequireDefault(require("@theme/TOC"));
|
|
29
|
-
|
|
30
|
-
var _TOCCollapsible = _interopRequireDefault(require("@theme/TOCCollapsible"));
|
|
31
|
-
|
|
32
14
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
33
15
|
|
|
34
|
-
var
|
|
16
|
+
var _Layout = _interopRequireDefault(require("./Layout"));
|
|
17
|
+
|
|
18
|
+
var _Metadata = _interopRequireDefault(require("./Metadata"));
|
|
35
19
|
|
|
36
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
21
|
|
|
@@ -41,6 +25,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
41
25
|
* This source code is licensed under the MIT license found in the
|
|
42
26
|
* LICENSE file in the root directory of this source tree.
|
|
43
27
|
* ========================================================================== */
|
|
28
|
+
const {
|
|
29
|
+
DocProvider
|
|
30
|
+
} = require("@docusaurus/theme-common/internal");
|
|
31
|
+
|
|
44
32
|
let ApiDemoPanel = _ => <div style={{
|
|
45
33
|
marginTop: "3.5em"
|
|
46
34
|
}} />;
|
|
@@ -49,113 +37,36 @@ if (_ExecutionEnvironment.default.canUseDOM) {
|
|
|
49
37
|
ApiDemoPanel = require("@theme/ApiDemoPanel").default;
|
|
50
38
|
}
|
|
51
39
|
|
|
52
|
-
function DocItemMetadata(props) {
|
|
53
|
-
var _assets$image;
|
|
54
|
-
|
|
55
|
-
const {
|
|
56
|
-
content: DocContent
|
|
57
|
-
} = props;
|
|
58
|
-
const {
|
|
59
|
-
metadata,
|
|
60
|
-
frontMatter,
|
|
61
|
-
assets
|
|
62
|
-
} = DocContent;
|
|
63
|
-
const {
|
|
64
|
-
keywords
|
|
65
|
-
} = frontMatter;
|
|
66
|
-
const {
|
|
67
|
-
description,
|
|
68
|
-
title
|
|
69
|
-
} = metadata;
|
|
70
|
-
const image = (_assets$image = assets.image) !== null && _assets$image !== void 0 ? _assets$image : frontMatter.image;
|
|
71
|
-
return <_themeCommon.PageMetadata {...{
|
|
72
|
-
title,
|
|
73
|
-
description,
|
|
74
|
-
keywords,
|
|
75
|
-
image
|
|
76
|
-
}} />;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function DocItemContent(props) {
|
|
80
|
-
const {
|
|
81
|
-
content: DocContent
|
|
82
|
-
} = props;
|
|
83
|
-
const {
|
|
84
|
-
metadata,
|
|
85
|
-
frontMatter
|
|
86
|
-
} = DocContent;
|
|
87
|
-
const {
|
|
88
|
-
info_path: infoPath,
|
|
89
|
-
hide_title: hideTitle,
|
|
90
|
-
hide_table_of_contents: hideTableOfContents,
|
|
91
|
-
toc_min_heading_level: tocMinHeadingLevel,
|
|
92
|
-
toc_max_heading_level: tocMaxHeadingLevel
|
|
93
|
-
} = frontMatter;
|
|
94
|
-
const {
|
|
95
|
-
title
|
|
96
|
-
} = metadata;
|
|
97
|
-
const {
|
|
98
|
-
api
|
|
99
|
-
} = frontMatter; // We only add a title if:
|
|
100
|
-
// - user doesn't ask to hide it with front matter
|
|
101
|
-
// - the markdown content does not already contain a top-level h1 heading
|
|
102
|
-
|
|
103
|
-
const shouldAddTitle = !hideTitle && typeof DocContent.contentTitle === "undefined";
|
|
104
|
-
const windowSize = (0, _themeCommon.useWindowSize)();
|
|
105
|
-
const canRenderTOC = !hideTableOfContents && DocContent.toc && DocContent.toc.length > 0;
|
|
106
|
-
const renderTocDesktop = canRenderTOC && (windowSize === "desktop" || windowSize === "ssr");
|
|
107
|
-
return <div className="row">
|
|
108
|
-
<div className={(0, _clsx.default)("col", !hideTableOfContents && _stylesModule.default.docItemCol)}>
|
|
109
|
-
<_DocVersionBanner.default />
|
|
110
|
-
<div className={_stylesModule.default.docItemContainer}>
|
|
111
|
-
<article>
|
|
112
|
-
<_DocBreadcrumbs.default />
|
|
113
|
-
<_DocVersionBadge.default />
|
|
114
|
-
|
|
115
|
-
{canRenderTOC && <_TOCCollapsible.default toc={DocContent.toc} minHeadingLevel={tocMinHeadingLevel} maxHeadingLevel={tocMaxHeadingLevel} className={(0, _clsx.default)(_themeCommon.ThemeClassNames.docs.docTocMobile, _stylesModule.default.tocMobile)} />}
|
|
116
|
-
|
|
117
|
-
<div className={(0, _clsx.default)(_themeCommon.ThemeClassNames.docs.docMarkdown, "theme-api-markdown", "markdown")}>
|
|
118
|
-
{
|
|
119
|
-
/*
|
|
120
|
-
Title can be declared inside md content or declared through
|
|
121
|
-
front matter and added manually. To make both cases consistent,
|
|
122
|
-
the added title is added under the same div.markdown block
|
|
123
|
-
See https://github.com/facebook/docusaurus/pull/4882#issuecomment-853021120
|
|
124
|
-
*/
|
|
125
|
-
}
|
|
126
|
-
{shouldAddTitle && <header>
|
|
127
|
-
<_Heading.default as="h1">{title}</_Heading.default>
|
|
128
|
-
</header>}
|
|
129
|
-
<_MDXContent.default>
|
|
130
|
-
<div className="row">
|
|
131
|
-
<div className={(0, _clsx.default)("col", api ? "col--7" : "col--12")}>
|
|
132
|
-
<DocContent />
|
|
133
|
-
</div>
|
|
134
|
-
{api && <div className="col col--5">
|
|
135
|
-
<ApiDemoPanel item={api} infoPath={infoPath} />
|
|
136
|
-
</div>}
|
|
137
|
-
</div>
|
|
138
|
-
</_MDXContent.default>
|
|
139
|
-
</div>
|
|
140
|
-
<div className={(0, _clsx.default)("col", api ? "col--7" : "col--12")}>
|
|
141
|
-
<_DocItemFooter.default {...props} />
|
|
142
|
-
</div>
|
|
143
|
-
</article>
|
|
144
|
-
<div className={(0, _clsx.default)("col", api ? "col--7" : "col--12")}>
|
|
145
|
-
<_DocPaginator.default previous={metadata.previous} next={metadata.next} />
|
|
146
|
-
</div>
|
|
147
|
-
</div>
|
|
148
|
-
</div>
|
|
149
|
-
{renderTocDesktop && <div className="col col--3">
|
|
150
|
-
<_TOC.default toc={DocContent.toc} minHeadingLevel={tocMinHeadingLevel} maxHeadingLevel={tocMaxHeadingLevel} className={_themeCommon.ThemeClassNames.docs.docTocDesktop} />
|
|
151
|
-
</div>}
|
|
152
|
-
</div>;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
40
|
function DocItem(props) {
|
|
156
41
|
const docHtmlClassName = `docs-doc-id-${props.content.metadata.unversionedId}`;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
42
|
+
|
|
43
|
+
const DocContent = () => {
|
|
44
|
+
const MDXComponent = props.content;
|
|
45
|
+
const {
|
|
46
|
+
frontMatter
|
|
47
|
+
} = MDXComponent;
|
|
48
|
+
const {
|
|
49
|
+
info_path: infoPath
|
|
50
|
+
} = frontMatter;
|
|
51
|
+
const {
|
|
52
|
+
api
|
|
53
|
+
} = frontMatter;
|
|
54
|
+
return <div className="row">
|
|
55
|
+
<div className={(0, _clsx.default)("col", api ? "col--7" : "col--12")}>
|
|
56
|
+
<MDXComponent />
|
|
57
|
+
</div>
|
|
58
|
+
{api && <div className="col col--5">
|
|
59
|
+
<ApiDemoPanel item={api} infoPath={infoPath} />
|
|
60
|
+
</div>}
|
|
61
|
+
</div>;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
return <DocProvider content={props.content}>
|
|
65
|
+
<_themeCommon.HtmlClassNameProvider className={docHtmlClassName}>
|
|
66
|
+
<_Metadata.default />
|
|
67
|
+
<_Layout.default>
|
|
68
|
+
<DocContent />
|
|
69
|
+
</_Layout.default>
|
|
70
|
+
</_themeCommon.HtmlClassNameProvider>
|
|
71
|
+
</DocProvider>;
|
|
161
72
|
}
|
|
@@ -9,20 +9,22 @@ import React, {
|
|
|
9
9
|
Children,
|
|
10
10
|
cloneElement,
|
|
11
11
|
isValidElement,
|
|
12
|
+
useEffect,
|
|
12
13
|
useRef,
|
|
13
14
|
useState,
|
|
14
15
|
} from "react";
|
|
15
16
|
|
|
16
|
-
import {
|
|
17
|
-
duplicates,
|
|
18
|
-
useScrollPositionBlocker,
|
|
19
|
-
useTabGroupChoice,
|
|
20
|
-
} from "@docusaurus/theme-common";
|
|
17
|
+
import { duplicates } from "@docusaurus/theme-common";
|
|
21
18
|
import useIsBrowser from "@docusaurus/useIsBrowser";
|
|
22
19
|
import clsx from "clsx";
|
|
23
20
|
|
|
24
21
|
import styles from "./styles.module.css"; // A very rough duck type, but good enough to guard against mistakes while
|
|
25
22
|
|
|
23
|
+
const {
|
|
24
|
+
useScrollPositionBlocker,
|
|
25
|
+
useTabGroupChoice,
|
|
26
|
+
} = require("@docusaurus/theme-common/internal");
|
|
27
|
+
|
|
26
28
|
// allowing customization
|
|
27
29
|
|
|
28
30
|
function isTabItem(comp) {
|
|
@@ -142,7 +144,16 @@ function ApiTabsComponent(props) {
|
|
|
142
144
|
};
|
|
143
145
|
|
|
144
146
|
const tabItemListContainerRef = useRef(null);
|
|
145
|
-
const showTabArrows =
|
|
147
|
+
const [showTabArrows, setShowTabArrows] = useState(false);
|
|
148
|
+
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
const tabOffsetWidth = tabItemListContainerRef.current.offsetWidth;
|
|
151
|
+
const tabScrollWidth = tabItemListContainerRef.current.scrollWidth;
|
|
152
|
+
|
|
153
|
+
if (tabOffsetWidth < tabScrollWidth) {
|
|
154
|
+
setShowTabArrows(true);
|
|
155
|
+
}
|
|
156
|
+
}, []);
|
|
146
157
|
|
|
147
158
|
const handleRightClick = () => {
|
|
148
159
|
tabItemListContainerRef.current.scrollLeft += 90;
|