docusaurus-theme-openapi-docs 0.0.0-361 → 0.0.0-362

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/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-361",
4
+ "version": "0.0.0-362",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "openapi",
@@ -31,8 +31,8 @@
31
31
  "format:lib-next": "prettier --config ../../.prettierrc.json --write \"lib-next/**/*.{js,ts,jsx,tsc}\""
32
32
  },
33
33
  "devDependencies": {
34
- "@docusaurus/module-type-aliases": "2.0.0-beta.18",
35
- "@docusaurus/types": "2.0.0-beta.18",
34
+ "@docusaurus/module-type-aliases": "2.0.0-beta.21",
35
+ "@docusaurus/types": "2.0.0-beta.21",
36
36
  "@types/concurrently": "^6.3.0",
37
37
  "@types/crypto-js": "^4.1.0",
38
38
  "@types/fs-extra": "^9.0.13",
@@ -42,7 +42,7 @@
42
42
  "concurrently": "^5.2.0"
43
43
  },
44
44
  "dependencies": {
45
- "@docusaurus/theme-common": "2.0.0-beta.18",
45
+ "@docusaurus/theme-common": "2.0.0-beta.21",
46
46
  "@mdx-js/react": "^1.6.21",
47
47
  "@monaco-editor/react": "^4.3.1",
48
48
  "@paloaltonetworks/postman-code-generators": "1.1.5-hotfix.5",
@@ -51,7 +51,7 @@
51
51
  "buffer": "^6.0.3",
52
52
  "clsx": "^1.1.1",
53
53
  "crypto-js": "^4.1.1",
54
- "docusaurus-plugin-openapi-docs": "0.0.0-361",
54
+ "docusaurus-plugin-openapi-docs": "0.0.0-362",
55
55
  "immer": "^9.0.7",
56
56
  "lodash": "^4.17.20",
57
57
  "monaco-editor": "^0.31.1",
@@ -70,5 +70,5 @@
70
70
  "engines": {
71
71
  "node": ">=14"
72
72
  },
73
- "gitHead": "e87c5db5b36a32b85f7ba0aaea0a0280be498954"
73
+ "gitHead": "b887778ce634dfbc7f723721ffacef03679cec7e"
74
74
  }
@@ -15,7 +15,7 @@ import {
15
15
  useWindowSize,
16
16
  } from "@docusaurus/theme-common";
17
17
  import DocBreadcrumbs from "@theme/DocBreadcrumbs";
18
- import type { Props, FrontMatter } from "@theme/DocItem";
18
+ import type { Props } from "@theme/DocItem";
19
19
  import DocItemFooter from "@theme/DocItemFooter";
20
20
  import DocPaginator from "@theme/DocPaginator";
21
21
  import DocVersionBadge from "@theme/DocVersionBadge";
@@ -27,6 +27,7 @@ import TOCCollapsible from "@theme/TOCCollapsible";
27
27
  import clsx from "clsx";
28
28
  import type { ApiItem as ApiItemType } from "docusaurus-plugin-openapi-docs/lib/types";
29
29
 
30
+ import { DocFrontMatter } from "../../types";
30
31
  import styles from "./styles.module.css";
31
32
 
32
33
  let ApiDemoPanel = (_: { item: any }) => <div style={{ marginTop: "3.5em" }} />;
@@ -34,7 +35,7 @@ if (ExecutionEnvironment.canUseDOM) {
34
35
  ApiDemoPanel = require("@theme/ApiDemoPanel").default;
35
36
  }
36
37
 
37
- interface ApiFrontMatter extends FrontMatter {
38
+ interface ApiFrontMatter extends DocFrontMatter {
38
39
  readonly api?: ApiItemType;
39
40
  }
40
41
 
package/src/types.ts CHANGED
@@ -5,6 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  * ========================================================================== */
7
7
 
8
+ import type { FrontMatterTag } from "@docusaurus/utils";
8
9
  import type { JSONSchema4, JSONSchema6, JSONSchema7 } from "json-schema";
9
10
 
10
11
  export interface ThemeConfig {
@@ -68,3 +69,112 @@ export interface ExternalDocumentationObject {
68
69
  description?: string;
69
70
  url: string;
70
71
  }
72
+
73
+ export type FileChange = {
74
+ author?: string;
75
+ /** Date can be any
76
+ * [parsable date string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).
77
+ */
78
+ date?: Date | string;
79
+ };
80
+
81
+ export type DocFrontMatter = {
82
+ /**
83
+ * The last part of the doc ID (will be refactored in the future to be the
84
+ * full ID instead)
85
+ * @see {@link DocMetadata.id}
86
+ */
87
+ id?: string;
88
+ /**
89
+ * Will override the default title collected from h1 heading.
90
+ * @see {@link DocMetadata.title}
91
+ */
92
+ title?: string;
93
+ /**
94
+ * Front matter tags, unnormalized.
95
+ * @see {@link DocMetadata.tags}
96
+ */
97
+ tags?: FrontMatterTag[];
98
+ /**
99
+ * If there isn't a Markdown h1 heading (which, if there is, we don't
100
+ * remove), this front matter will cause the front matter title to not be
101
+ * displayed in the doc page.
102
+ */
103
+ hide_title?: boolean;
104
+ /** Hide the TOC on the right. */
105
+ hide_table_of_contents?: boolean;
106
+ /** Used in the head meta. */
107
+ keywords?: string[];
108
+ /** Used in the head meta. Should use `assets.image` in priority. */
109
+ image?: string;
110
+ /**
111
+ * Will override the default excerpt.
112
+ * @see {@link DocMetadata.description}
113
+ */
114
+ description?: string;
115
+ /**
116
+ * Custom slug appended after /<baseUrl>/<routeBasePath>/<versionPath>
117
+ * @see {@link DocMetadata.slug}
118
+ */
119
+ slug?: string;
120
+ /** Customizes the sidebar label for this doc. Will default to its title. */
121
+ sidebar_label?: string;
122
+ /**
123
+ * Controls the position of a doc inside the generated sidebar slice when
124
+ * using autogenerated sidebar items.
125
+ *
126
+ * @see https://docusaurus.io/docs/sidebar#autogenerated-sidebar-metadata
127
+ */
128
+ sidebar_position?: number;
129
+ /**
130
+ * Gives the corresponding sidebar label a special class name when using
131
+ * autogenerated sidebars.
132
+ */
133
+ sidebar_class_name?: string;
134
+ /**
135
+ * Will be propagated to the final sidebars data structure. Useful if you
136
+ * have swizzled sidebar-related code or simply querying doc data through
137
+ * sidebars.
138
+ */
139
+ sidebar_custom_props?: { [key: string]: unknown };
140
+ /**
141
+ * Changes the sidebar association of the current doc. Use `null` to make
142
+ * the current doc not associated to any sidebar.
143
+ */
144
+ displayed_sidebar?: string | null;
145
+ /**
146
+ * Customizes the pagination label for this doc. Will default to the sidebar
147
+ * label.
148
+ */
149
+ pagination_label?: string;
150
+ /** Overrides the default URL computed for this doc. */
151
+ custom_edit_url?: string | null;
152
+ /**
153
+ * Whether number prefix parsing is disabled on this doc.
154
+ * @see https://docusaurus.io/docs/sidebar#using-number-prefixes
155
+ */
156
+ parse_number_prefixes?: boolean;
157
+ /**
158
+ * Minimum TOC heading level. Must be between 2 and 6 and lower or equal to
159
+ * the max value.
160
+ */
161
+ toc_min_heading_level?: number;
162
+ /** Maximum TOC heading level. Must be between 2 and 6. */
163
+ toc_max_heading_level?: number;
164
+ /**
165
+ * The ID of the documentation you want the "Next" pagination to link to.
166
+ * Use `null` to disable showing "Next" for this page.
167
+ * @see {@link DocMetadata.next}
168
+ */
169
+ pagination_next?: string | null;
170
+ /**
171
+ * The ID of the documentation you want the "Previous" pagination to link
172
+ * to. Use `null` to disable showing "Previous" for this page.
173
+ * @see {@link DocMetadata.prev}
174
+ */
175
+ pagination_prev?: string | null;
176
+ /** Should this doc be excluded from production builds? */
177
+ draft?: boolean;
178
+ /** Allows overriding the last updated author and/or date. */
179
+ last_update?: FileChange;
180
+ };