docusaurus-theme-openapi-docs 0.0.0-1000

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 (312) hide show
  1. package/LICENSE +21 -0
  2. package/babel.config.js +35 -0
  3. package/lib/index.d.ts +2 -0
  4. package/lib/index.js +81 -0
  5. package/lib/markdown/createDescription.d.ts +1 -0
  6. package/lib/markdown/createDescription.js +15 -0
  7. package/lib/markdown/schema.d.ts +3 -0
  8. package/lib/markdown/schema.js +149 -0
  9. package/lib/markdown/utils.d.ts +10 -0
  10. package/lib/markdown/utils.js +49 -0
  11. package/lib/markdown/utils.test.d.ts +1 -0
  12. package/lib/markdown/utils.test.js +43 -0
  13. package/lib/theme/ApiExplorer/Accept/index.d.ts +3 -0
  14. package/lib/theme/ApiExplorer/Accept/index.js +38 -0
  15. package/lib/theme/ApiExplorer/Accept/slice.d.ts +11 -0
  16. package/lib/theme/ApiExplorer/Accept/slice.js +22 -0
  17. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
  18. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.d.ts +4 -0
  19. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.js +35 -0
  20. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.d.ts +3 -0
  21. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +41 -0
  22. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.d.ts +3 -0
  23. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.js +153 -0
  24. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
  25. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
  26. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.d.ts +3 -0
  27. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +147 -0
  28. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
  29. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.d.ts +6 -0
  30. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +58 -0
  31. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
  32. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.d.ts +14 -0
  33. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +248 -0
  34. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +34 -0
  35. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.d.ts +3 -0
  36. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.js +59 -0
  37. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
  38. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.d.ts +7 -0
  39. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +51 -0
  40. package/lib/theme/ApiExplorer/ApiCodeBlock/index.d.ts +3 -0
  41. package/lib/theme/ApiExplorer/ApiCodeBlock/index.js +110 -0
  42. package/lib/theme/ApiExplorer/Authorization/auth-types.d.ts +3 -0
  43. package/lib/theme/ApiExplorer/Authorization/auth-types.js +28 -0
  44. package/lib/theme/ApiExplorer/Authorization/index.d.ts +3 -0
  45. package/lib/theme/ApiExplorer/Authorization/index.js +160 -0
  46. package/lib/theme/ApiExplorer/Authorization/slice.d.ts +40 -0
  47. package/lib/theme/ApiExplorer/Authorization/slice.js +102 -0
  48. package/lib/theme/ApiExplorer/Body/index.d.ts +10 -0
  49. package/lib/theme/ApiExplorer/Body/index.js +381 -0
  50. package/lib/theme/ApiExplorer/Body/json2xml.js +43 -0
  51. package/lib/theme/ApiExplorer/Body/slice.d.ts +82 -0
  52. package/lib/theme/ApiExplorer/Body/slice.js +97 -0
  53. package/lib/theme/ApiExplorer/CodeSnippets/code-snippets-types.d.ts +21 -0
  54. package/lib/theme/ApiExplorer/CodeSnippets/code-snippets-types.js +8 -0
  55. package/lib/theme/ApiExplorer/CodeSnippets/index.d.ts +10 -0
  56. package/lib/theme/ApiExplorer/CodeSnippets/index.js +389 -0
  57. package/lib/theme/ApiExplorer/CodeSnippets/languages.d.ts +5 -0
  58. package/lib/theme/ApiExplorer/CodeSnippets/languages.js +95 -0
  59. package/lib/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
  60. package/lib/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +501 -0
  61. package/lib/theme/ApiExplorer/CodeTabs/index.d.ts +15 -0
  62. package/lib/theme/ApiExplorer/CodeTabs/index.js +271 -0
  63. package/lib/theme/ApiExplorer/ContentType/index.d.ts +3 -0
  64. package/lib/theme/ApiExplorer/ContentType/index.js +40 -0
  65. package/lib/theme/ApiExplorer/ContentType/slice.d.ts +11 -0
  66. package/lib/theme/ApiExplorer/ContentType/slice.js +22 -0
  67. package/lib/theme/ApiExplorer/Export/index.d.ts +3 -0
  68. package/lib/theme/ApiExplorer/Export/index.js +57 -0
  69. package/lib/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +27 -0
  70. package/lib/theme/ApiExplorer/FloatingButton/index.d.ts +8 -0
  71. package/lib/theme/ApiExplorer/FloatingButton/index.js +28 -0
  72. package/lib/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss +74 -0
  73. package/lib/theme/ApiExplorer/FormFileUpload/index.d.ts +7 -0
  74. package/lib/theme/ApiExplorer/FormFileUpload/index.js +173 -0
  75. package/lib/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
  76. package/lib/theme/ApiExplorer/FormItem/index.d.ts +10 -0
  77. package/lib/theme/ApiExplorer/FormItem/index.js +44 -0
  78. package/lib/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
  79. package/lib/theme/ApiExplorer/FormMultiSelect/index.d.ts +9 -0
  80. package/lib/theme/ApiExplorer/FormMultiSelect/index.js +51 -0
  81. package/lib/theme/ApiExplorer/FormSelect/_FormSelect.scss +43 -0
  82. package/lib/theme/ApiExplorer/FormSelect/index.d.ts +8 -0
  83. package/lib/theme/ApiExplorer/FormSelect/index.js +35 -0
  84. package/lib/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
  85. package/lib/theme/ApiExplorer/FormTextInput/index.d.ts +9 -0
  86. package/lib/theme/ApiExplorer/FormTextInput/index.js +73 -0
  87. package/lib/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
  88. package/lib/theme/ApiExplorer/LiveEditor/index.d.ts +6 -0
  89. package/lib/theme/ApiExplorer/LiveEditor/index.js +168 -0
  90. package/lib/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
  91. package/lib/theme/ApiExplorer/MethodEndpoint/index.d.ts +8 -0
  92. package/lib/theme/ApiExplorer/MethodEndpoint/index.js +86 -0
  93. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.d.ts +6 -0
  94. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.js +220 -0
  95. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.d.ts +6 -0
  96. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +63 -0
  97. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.d.ts +6 -0
  98. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +89 -0
  99. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.d.ts +6 -0
  100. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +63 -0
  101. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.d.ts +6 -0
  102. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.js +38 -0
  103. package/lib/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +123 -0
  104. package/lib/theme/ApiExplorer/ParamOptions/index.d.ts +7 -0
  105. package/lib/theme/ApiExplorer/ParamOptions/index.js +223 -0
  106. package/lib/theme/ApiExplorer/ParamOptions/slice.d.ts +17 -0
  107. package/lib/theme/ApiExplorer/ParamOptions/slice.js +25 -0
  108. package/lib/theme/ApiExplorer/Request/_Request.scss +129 -0
  109. package/lib/theme/ApiExplorer/Request/index.d.ts +6 -0
  110. package/lib/theme/ApiExplorer/Request/index.js +396 -0
  111. package/lib/theme/ApiExplorer/Request/makeRequest.d.ts +4 -0
  112. package/lib/theme/ApiExplorer/Request/makeRequest.js +222 -0
  113. package/lib/theme/ApiExplorer/Response/_Response.scss +121 -0
  114. package/lib/theme/ApiExplorer/Response/index.d.ts +6 -0
  115. package/lib/theme/ApiExplorer/Response/index.js +193 -0
  116. package/lib/theme/ApiExplorer/Response/slice.d.ts +17 -0
  117. package/lib/theme/ApiExplorer/Response/slice.js +51 -0
  118. package/lib/theme/ApiExplorer/SecuritySchemes/index.d.ts +3 -0
  119. package/lib/theme/ApiExplorer/SecuritySchemes/index.js +380 -0
  120. package/lib/theme/ApiExplorer/Server/_Server.scss +26 -0
  121. package/lib/theme/ApiExplorer/Server/index.d.ts +3 -0
  122. package/lib/theme/ApiExplorer/Server/index.js +199 -0
  123. package/lib/theme/ApiExplorer/Server/slice.d.ts +13 -0
  124. package/lib/theme/ApiExplorer/Server/slice.js +33 -0
  125. package/lib/theme/ApiExplorer/buildPostmanRequest.d.ts +20 -0
  126. package/lib/theme/ApiExplorer/buildPostmanRequest.js +465 -0
  127. package/lib/theme/ApiExplorer/index.d.ts +7 -0
  128. package/lib/theme/ApiExplorer/index.js +41 -0
  129. package/lib/theme/ApiExplorer/persistanceMiddleware.d.ts +3 -0
  130. package/lib/theme/ApiExplorer/persistanceMiddleware.js +54 -0
  131. package/lib/theme/ApiExplorer/storage-utils.d.ts +4 -0
  132. package/lib/theme/ApiExplorer/storage-utils.js +41 -0
  133. package/lib/theme/ApiItem/Layout/index.d.ts +3 -0
  134. package/lib/theme/ApiItem/Layout/index.js +121 -0
  135. package/lib/theme/ApiItem/Layout/styles.module.css +17 -0
  136. package/lib/theme/ApiItem/hooks.d.ts +12 -0
  137. package/lib/theme/ApiItem/hooks.js +13 -0
  138. package/lib/theme/ApiItem/index.d.ts +2 -0
  139. package/lib/theme/ApiItem/index.js +238 -0
  140. package/lib/theme/ApiItem/store.d.ts +46 -0
  141. package/lib/theme/ApiItem/store.js +53 -0
  142. package/lib/theme/ApiLogo/index.d.ts +2 -0
  143. package/lib/theme/ApiLogo/index.js +51 -0
  144. package/lib/theme/ApiTabs/_ApiTabs.scss +142 -0
  145. package/lib/theme/ApiTabs/index.d.ts +7 -0
  146. package/lib/theme/ApiTabs/index.js +270 -0
  147. package/lib/theme/ArrayBrackets/index.d.ts +3 -0
  148. package/lib/theme/ArrayBrackets/index.js +50 -0
  149. package/lib/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +98 -0
  150. package/lib/theme/DiscriminatorTabs/index.d.ts +3 -0
  151. package/lib/theme/DiscriminatorTabs/index.js +258 -0
  152. package/lib/theme/Markdown/Details/_Details.scss +122 -0
  153. package/lib/theme/Markdown/index.js +179 -0
  154. package/lib/theme/MimeTabs/_MimeTabs.scss +70 -0
  155. package/lib/theme/MimeTabs/index.d.ts +6 -0
  156. package/lib/theme/MimeTabs/index.js +286 -0
  157. package/lib/theme/OperationTabs/_OperationTabs.scss +72 -0
  158. package/lib/theme/OperationTabs/index.d.ts +3 -0
  159. package/lib/theme/OperationTabs/index.js +248 -0
  160. package/lib/theme/ParamsDetails/index.d.ts +6 -0
  161. package/lib/theme/ParamsDetails/index.js +85 -0
  162. package/lib/theme/ParamsItem/_ParamsItem.scss +54 -0
  163. package/lib/theme/ParamsItem/index.d.ts +25 -0
  164. package/lib/theme/ParamsItem/index.js +218 -0
  165. package/lib/theme/RequestSchema/index.d.ts +15 -0
  166. package/lib/theme/RequestSchema/index.js +194 -0
  167. package/lib/theme/ResponseExamples/index.d.ts +18 -0
  168. package/lib/theme/ResponseExamples/index.js +193 -0
  169. package/lib/theme/ResponseHeaders/index.d.ts +13 -0
  170. package/lib/theme/ResponseHeaders/index.js +39 -0
  171. package/lib/theme/ResponseSamples/_ResponseSamples.scss +3 -0
  172. package/lib/theme/ResponseSamples/index.d.ts +8 -0
  173. package/lib/theme/ResponseSamples/index.js +27 -0
  174. package/lib/theme/ResponseSchema/index.d.ts +15 -0
  175. package/lib/theme/ResponseSchema/index.js +159 -0
  176. package/lib/theme/Schema/index.d.ts +8 -0
  177. package/lib/theme/Schema/index.js +885 -0
  178. package/lib/theme/SchemaItem/_SchemaItem.scss +89 -0
  179. package/lib/theme/SchemaItem/index.d.ts +12 -0
  180. package/lib/theme/SchemaItem/index.js +213 -0
  181. package/lib/theme/SchemaTabs/_SchemaTabs.scss +61 -0
  182. package/lib/theme/SchemaTabs/index.d.ts +3 -0
  183. package/lib/theme/SchemaTabs/index.js +255 -0
  184. package/lib/theme/SkeletonLoader/index.d.ts +6 -0
  185. package/lib/theme/SkeletonLoader/index.js +20 -0
  186. package/lib/theme/StatusCodes/index.d.ts +9 -0
  187. package/lib/theme/StatusCodes/index.js +81 -0
  188. package/lib/theme/styles.scss +212 -0
  189. package/lib/types.d.ts +157 -0
  190. package/lib/types.js +8 -0
  191. package/package.json +83 -0
  192. package/src/index.ts +85 -0
  193. package/src/markdown/createDescription.ts +13 -0
  194. package/src/markdown/schema.ts +181 -0
  195. package/src/markdown/utils.test.ts +49 -0
  196. package/src/markdown/utils.ts +59 -0
  197. package/src/plugin-content-docs.d.ts +20 -0
  198. package/src/postman-code-generators.d.ts +9 -0
  199. package/src/react-magic-dropzone.d.ts +9 -0
  200. package/src/theme/ApiExplorer/Accept/index.tsx +36 -0
  201. package/src/theme/ApiExplorer/Accept/slice.ts +29 -0
  202. package/src/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
  203. package/src/theme/ApiExplorer/ApiCodeBlock/Container/index.tsx +32 -0
  204. package/src/theme/ApiExplorer/ApiCodeBlock/Content/Element.tsx +34 -0
  205. package/src/theme/ApiExplorer/ApiCodeBlock/Content/String.tsx +134 -0
  206. package/src/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
  207. package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
  208. package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.tsx +79 -0
  209. package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
  210. package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.tsx +55 -0
  211. package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
  212. package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.tsx +166 -0
  213. package/src/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +34 -0
  214. package/src/theme/ApiExplorer/ApiCodeBlock/Line/index.tsx +48 -0
  215. package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
  216. package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.tsx +54 -0
  217. package/src/theme/ApiExplorer/ApiCodeBlock/index.tsx +45 -0
  218. package/src/theme/ApiExplorer/Authorization/auth-types.ts +30 -0
  219. package/src/theme/ApiExplorer/Authorization/index.tsx +158 -0
  220. package/src/theme/ApiExplorer/Authorization/slice.ts +146 -0
  221. package/src/theme/ApiExplorer/Body/index.tsx +376 -0
  222. package/src/theme/ApiExplorer/Body/json2xml.js +43 -0
  223. package/src/theme/ApiExplorer/Body/slice.ts +133 -0
  224. package/src/theme/ApiExplorer/CodeSnippets/code-snippets-types.ts +57 -0
  225. package/src/theme/ApiExplorer/CodeSnippets/index.tsx +338 -0
  226. package/src/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
  227. package/src/theme/ApiExplorer/CodeSnippets/languages.ts +96 -0
  228. package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +501 -0
  229. package/src/theme/ApiExplorer/CodeTabs/index.tsx +248 -0
  230. package/src/theme/ApiExplorer/ContentType/index.tsx +38 -0
  231. package/src/theme/ApiExplorer/ContentType/slice.ts +29 -0
  232. package/src/theme/ApiExplorer/Export/index.tsx +47 -0
  233. package/src/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +27 -0
  234. package/src/theme/ApiExplorer/FloatingButton/index.tsx +29 -0
  235. package/src/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss +74 -0
  236. package/src/theme/ApiExplorer/FormFileUpload/index.tsx +119 -0
  237. package/src/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
  238. package/src/theme/ApiExplorer/FormItem/index.tsx +33 -0
  239. package/src/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
  240. package/src/theme/ApiExplorer/FormMultiSelect/index.tsx +57 -0
  241. package/src/theme/ApiExplorer/FormSelect/_FormSelect.scss +43 -0
  242. package/src/theme/ApiExplorer/FormSelect/index.tsx +38 -0
  243. package/src/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
  244. package/src/theme/ApiExplorer/FormTextInput/index.tsx +80 -0
  245. package/src/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
  246. package/src/theme/ApiExplorer/LiveEditor/index.tsx +114 -0
  247. package/src/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
  248. package/src/theme/ApiExplorer/MethodEndpoint/index.tsx +91 -0
  249. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +175 -0
  250. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +64 -0
  251. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +86 -0
  252. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +65 -0
  253. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.tsx +38 -0
  254. package/src/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +123 -0
  255. package/src/theme/ApiExplorer/ParamOptions/index.tsx +146 -0
  256. package/src/theme/ApiExplorer/ParamOptions/slice.ts +37 -0
  257. package/src/theme/ApiExplorer/Request/_Request.scss +129 -0
  258. package/src/theme/ApiExplorer/Request/index.tsx +309 -0
  259. package/src/theme/ApiExplorer/Request/makeRequest.ts +254 -0
  260. package/src/theme/ApiExplorer/Response/_Response.scss +121 -0
  261. package/src/theme/ApiExplorer/Response/index.tsx +157 -0
  262. package/src/theme/ApiExplorer/Response/slice.ts +52 -0
  263. package/src/theme/ApiExplorer/SecuritySchemes/index.tsx +287 -0
  264. package/src/theme/ApiExplorer/Server/_Server.scss +26 -0
  265. package/src/theme/ApiExplorer/Server/index.tsx +130 -0
  266. package/src/theme/ApiExplorer/Server/slice.ts +39 -0
  267. package/src/theme/ApiExplorer/buildPostmanRequest.ts +526 -0
  268. package/src/theme/ApiExplorer/index.tsx +41 -0
  269. package/src/theme/ApiExplorer/persistanceMiddleware.ts +71 -0
  270. package/src/theme/ApiExplorer/postman-collection.d.ts +10 -0
  271. package/src/theme/ApiExplorer/react-modal.d.ts +8 -0
  272. package/src/theme/ApiExplorer/storage-utils.ts +39 -0
  273. package/src/theme/ApiItem/Layout/index.tsx +85 -0
  274. package/src/theme/ApiItem/Layout/styles.module.css +17 -0
  275. package/src/theme/ApiItem/hooks.ts +13 -0
  276. package/src/theme/ApiItem/index.tsx +222 -0
  277. package/src/theme/ApiItem/store.ts +51 -0
  278. package/src/theme/ApiLogo/index.tsx +52 -0
  279. package/src/theme/ApiTabs/_ApiTabs.scss +142 -0
  280. package/src/theme/ApiTabs/index.tsx +238 -0
  281. package/src/theme/ArrayBrackets/index.tsx +37 -0
  282. package/src/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +98 -0
  283. package/src/theme/DiscriminatorTabs/index.tsx +229 -0
  284. package/src/theme/Markdown/Details/_Details.scss +122 -0
  285. package/src/theme/Markdown/index.js +179 -0
  286. package/src/theme/MimeTabs/_MimeTabs.scss +70 -0
  287. package/src/theme/MimeTabs/index.tsx +257 -0
  288. package/src/theme/OperationTabs/_OperationTabs.scss +72 -0
  289. package/src/theme/OperationTabs/index.tsx +220 -0
  290. package/src/theme/ParamsDetails/index.tsx +81 -0
  291. package/src/theme/ParamsItem/_ParamsItem.scss +54 -0
  292. package/src/theme/ParamsItem/index.tsx +205 -0
  293. package/src/theme/RequestSchema/index.tsx +157 -0
  294. package/src/theme/ResponseExamples/index.tsx +192 -0
  295. package/src/theme/ResponseHeaders/index.tsx +49 -0
  296. package/src/theme/ResponseSamples/_ResponseSamples.scss +3 -0
  297. package/src/theme/ResponseSamples/index.tsx +31 -0
  298. package/src/theme/ResponseSchema/index.tsx +144 -0
  299. package/src/theme/Schema/index.tsx +939 -0
  300. package/src/theme/SchemaItem/_SchemaItem.scss +89 -0
  301. package/src/theme/SchemaItem/index.tsx +198 -0
  302. package/src/theme/SchemaTabs/_SchemaTabs.scss +61 -0
  303. package/src/theme/SchemaTabs/index.tsx +224 -0
  304. package/src/theme/SkeletonLoader/index.tsx +18 -0
  305. package/src/theme/StatusCodes/index.tsx +72 -0
  306. package/src/theme/styles.scss +212 -0
  307. package/src/theme-classic.d.ts +80 -0
  308. package/src/theme-openapi.d.ts +288 -0
  309. package/src/theme-translations.d.ts +9 -0
  310. package/src/types.ts +182 -0
  311. package/tsconfig.json +16 -0
  312. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,238 @@
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, {
9
+ cloneElement,
10
+ useRef,
11
+ useState,
12
+ useEffect,
13
+ ReactElement,
14
+ } from "react";
15
+
16
+ import {
17
+ sanitizeTabsChildren,
18
+ TabProps,
19
+ useScrollPositionBlocker,
20
+ useTabs,
21
+ } from "@docusaurus/theme-common/internal";
22
+ import { TabItemProps } from "@docusaurus/theme-common/lib/utils/tabsUtils";
23
+ import useIsBrowser from "@docusaurus/useIsBrowser";
24
+ import Heading from "@theme/Heading";
25
+ import clsx from "clsx";
26
+
27
+ export interface TabListProps extends TabProps {
28
+ label: string;
29
+ id: string;
30
+ }
31
+
32
+ function TabList({
33
+ className,
34
+ block,
35
+ selectedValue,
36
+ selectValue,
37
+ tabValues,
38
+ label = "Responses",
39
+ id = "responses",
40
+ }: TabListProps & ReturnType<typeof useTabs>) {
41
+ const tabRefs: (HTMLLIElement | null)[] = [];
42
+ const { blockElementScrollPositionUntilNextRender } =
43
+ useScrollPositionBlocker();
44
+
45
+ const handleTabChange = (
46
+ event:
47
+ | React.FocusEvent<HTMLLIElement>
48
+ | React.MouseEvent<HTMLLIElement>
49
+ | React.KeyboardEvent<HTMLLIElement>
50
+ ) => {
51
+ const newTab = event.currentTarget;
52
+ const newTabIndex = tabRefs.indexOf(newTab);
53
+ const newTabValue = tabValues[newTabIndex].value;
54
+
55
+ if (newTabValue !== selectedValue) {
56
+ blockElementScrollPositionUntilNextRender(newTab);
57
+ selectValue(newTabValue);
58
+ }
59
+ };
60
+
61
+ const handleKeydown = (event: React.KeyboardEvent<HTMLLIElement>) => {
62
+ let focusElement: HTMLLIElement | null = null;
63
+
64
+ switch (event.key) {
65
+ case "Enter": {
66
+ handleTabChange(event);
67
+ break;
68
+ }
69
+ case "ArrowRight": {
70
+ const nextTab = tabRefs.indexOf(event.currentTarget) + 1;
71
+ focusElement = tabRefs[nextTab] ?? tabRefs[0]!;
72
+ break;
73
+ }
74
+ case "ArrowLeft": {
75
+ const prevTab = tabRefs.indexOf(event.currentTarget) - 1;
76
+ focusElement = tabRefs[prevTab] ?? tabRefs[tabRefs.length - 1]!;
77
+ break;
78
+ }
79
+ default:
80
+ break;
81
+ }
82
+
83
+ focusElement?.focus();
84
+ };
85
+
86
+ const tabItemListContainerRef = useRef<HTMLUListElement>(null);
87
+ const [showTabArrows, setShowTabArrows] = useState<boolean>(false);
88
+
89
+ useEffect(() => {
90
+ const resizeObserver = new ResizeObserver((entries) => {
91
+ for (let entry of entries) {
92
+ requestAnimationFrame(() => {
93
+ if (entry.target.clientWidth < entry.target.scrollWidth) {
94
+ setShowTabArrows(true);
95
+ } else {
96
+ setShowTabArrows(false);
97
+ }
98
+ });
99
+ }
100
+ });
101
+
102
+ resizeObserver.observe(tabItemListContainerRef.current!);
103
+
104
+ return () => {
105
+ resizeObserver.disconnect();
106
+ };
107
+ }, []);
108
+
109
+ const handleRightClick = () => {
110
+ tabItemListContainerRef.current!.scrollLeft += 90;
111
+ };
112
+
113
+ const handleLeftClick = () => {
114
+ tabItemListContainerRef.current!.scrollLeft -= 90;
115
+ };
116
+
117
+ return (
118
+ <div className="openapi-tabs__response-header-section">
119
+ <Heading
120
+ as="h2"
121
+ id={id}
122
+ className="openapi-tabs__heading openapi-tabs__response-header"
123
+ >
124
+ {label}
125
+ </Heading>
126
+ <div className="openapi-tabs__response-container">
127
+ {showTabArrows && (
128
+ <button
129
+ className="openapi-tabs__arrow left"
130
+ onClick={handleLeftClick}
131
+ />
132
+ )}
133
+ <ul
134
+ ref={tabItemListContainerRef}
135
+ role="tablist"
136
+ aria-orientation="horizontal"
137
+ className={clsx(
138
+ "openapi-tabs__response-list-container",
139
+ "tabs",
140
+ {
141
+ "tabs--block": block,
142
+ },
143
+ className
144
+ )}
145
+ >
146
+ {tabValues.map(({ value, label, attributes }) => (
147
+ <li
148
+ // TODO extract TabListItem
149
+ role="tab"
150
+ tabIndex={selectedValue === value ? 0 : -1}
151
+ aria-selected={selectedValue === value}
152
+ key={value}
153
+ ref={(tabControl) => {
154
+ tabRefs.push(tabControl);
155
+ }}
156
+ onKeyDown={handleKeydown}
157
+ onClick={handleTabChange}
158
+ {...attributes}
159
+ className={clsx(
160
+ "tabs__item",
161
+ "openapi-tabs__response-code-item",
162
+ attributes?.className as string,
163
+ parseInt(value) >= 400
164
+ ? "danger"
165
+ : parseInt(value) >= 200 && parseInt(value) < 300
166
+ ? "success"
167
+ : "info",
168
+ {
169
+ active: selectedValue === value,
170
+ }
171
+ )}
172
+ >
173
+ {label ?? value}
174
+ </li>
175
+ ))}
176
+ </ul>
177
+ {showTabArrows && (
178
+ <button
179
+ className="openapi-tabs__arrow right"
180
+ onClick={handleRightClick}
181
+ />
182
+ )}
183
+ </div>
184
+ </div>
185
+ );
186
+ }
187
+
188
+ function TabContent({
189
+ lazy,
190
+ children,
191
+ selectedValue,
192
+ }: TabProps & ReturnType<typeof useTabs>): React.JSX.Element | null {
193
+ const childTabs = (Array.isArray(children) ? children : [children]).filter(
194
+ Boolean
195
+ ) as ReactElement<TabItemProps>[];
196
+ if (lazy) {
197
+ const selectedTabItem = childTabs.find(
198
+ (tabItem) => tabItem.props.value === selectedValue
199
+ );
200
+ if (!selectedTabItem) {
201
+ // fail-safe or fail-fast? not sure what's best here
202
+ return null;
203
+ }
204
+ return cloneElement(selectedTabItem, { className: "margin-top--md" });
205
+ }
206
+ return (
207
+ <div className="margin-top--md">
208
+ {childTabs.map((tabItem, i) =>
209
+ cloneElement(tabItem, {
210
+ key: i,
211
+ hidden: tabItem.props.value !== selectedValue,
212
+ })
213
+ )}
214
+ </div>
215
+ );
216
+ }
217
+ function TabsComponent(props: TabListProps): React.JSX.Element {
218
+ const tabs = useTabs(props);
219
+ return (
220
+ <div className="openapi-tabs__container">
221
+ <TabList {...props} {...tabs} />
222
+ <TabContent {...props} {...tabs} />
223
+ </div>
224
+ );
225
+ }
226
+ export default function ApiTabs(props: TabListProps): React.JSX.Element {
227
+ const isBrowser = useIsBrowser();
228
+ return (
229
+ <TabsComponent
230
+ // Remount tabs after hydration
231
+ // Temporary fix for https://github.com/facebook/docusaurus/issues/5653
232
+ key={String(isBrowser)}
233
+ {...props}
234
+ >
235
+ {sanitizeTabsChildren(props.children)}
236
+ </TabsComponent>
237
+ );
238
+ }
@@ -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
+ export const OpeningArrayBracket = () => (
11
+ <li>
12
+ <div
13
+ style={{
14
+ fontSize: "var(--ifm-code-font-size)",
15
+ opacity: 0.6,
16
+ marginLeft: "-.5rem",
17
+ paddingBottom: ".5rem",
18
+ }}
19
+ >
20
+ Array [
21
+ </div>
22
+ </li>
23
+ );
24
+
25
+ export const ClosingArrayBracket = () => (
26
+ <li>
27
+ <div
28
+ style={{
29
+ fontSize: "var(--ifm-code-font-size)",
30
+ opacity: 0.6,
31
+ marginLeft: "-.5rem",
32
+ }}
33
+ >
34
+ ]
35
+ </div>
36
+ </li>
37
+ );
@@ -0,0 +1,98 @@
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
+ .openapi-tabs__discriminator-item {
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ padding: 0.35rem 0.7rem;
12
+ border: 1px solid transparent;
13
+ margin-top: 0 !important;
14
+ margin-right: 0.5rem;
15
+ font-weight: var(--ifm-font-weight-bold);
16
+ font-size: 10px;
17
+ font-family: var(--ifm-font-family-monospace);
18
+ white-space: nowrap;
19
+ transition: 300ms;
20
+
21
+ &:hover {
22
+ background-color: transparent;
23
+ border: 1px solid var(--ifm-toc-border-color);
24
+ }
25
+
26
+ &.active {
27
+ border: 1px solid var(--ifm-color-primary);
28
+ color: var(--ifm-color-primary);
29
+ }
30
+
31
+ &:last-child {
32
+ margin-right: 0 !important;
33
+ }
34
+ }
35
+
36
+ /* Open API Discriminator Tabs */
37
+ .openapi-tabs__discriminator-top-section {
38
+ margin-top: 1rem;
39
+ margin-left: 0.9rem;
40
+ display: flex;
41
+ justify-content: space-between;
42
+ align-items: center;
43
+ }
44
+
45
+ .openapi-tabs__discriminator-top-section + hr {
46
+ display: none;
47
+ }
48
+
49
+ .openapi-tabs__discriminator-container {
50
+ display: flex;
51
+ align-items: center;
52
+ max-width: 600px;
53
+ padding-left: 3px;
54
+ overflow: hidden;
55
+ }
56
+
57
+ .openapi-tabs__discriminator-list-container {
58
+ padding: 0 0.25rem;
59
+ overflow-y: hidden;
60
+ overflow-x: scroll;
61
+ scroll-behavior: smooth;
62
+ scrollbar-width: none;
63
+ }
64
+
65
+ .openapi-tabs__discriminator-list-container::-webkit-scrollbar {
66
+ display: none;
67
+ }
68
+
69
+ .openapi-tabs__discriminator-tab-label {
70
+ white-space: nowrap;
71
+ }
72
+
73
+ .openapi-discriminator__item {
74
+ list-style: none;
75
+ position: relative;
76
+ margin: 0 !important;
77
+ padding: 5px 0 5px 0 !important;
78
+ border-left: thin solid var(--openapi-tree-line-color) !important;
79
+ }
80
+
81
+ .openapi-discriminator__name {
82
+ padding-left: 1rem;
83
+ }
84
+
85
+ @media screen and (max-width: 500px) {
86
+ .openapi-tabs__discriminator-top-section {
87
+ flex-direction: column;
88
+ align-items: flex-start;
89
+ }
90
+
91
+ .openapi-tabs__discriminator-container {
92
+ width: 100%;
93
+ }
94
+
95
+ .openapi-tabs__discriminator-item {
96
+ height: 100%;
97
+ }
98
+ }
@@ -0,0 +1,229 @@
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, {
9
+ cloneElement,
10
+ useRef,
11
+ useEffect,
12
+ useState,
13
+ ReactElement,
14
+ } from "react";
15
+
16
+ import {
17
+ sanitizeTabsChildren,
18
+ TabProps,
19
+ useScrollPositionBlocker,
20
+ useTabs,
21
+ } from "@docusaurus/theme-common/internal";
22
+ import { TabItemProps } from "@docusaurus/theme-common/lib/utils/tabsUtils";
23
+ import useIsBrowser from "@docusaurus/useIsBrowser";
24
+ import clsx from "clsx";
25
+ import flatten from "lodash/flatten";
26
+
27
+ function TabList({
28
+ className,
29
+ block,
30
+ selectedValue,
31
+ selectValue,
32
+ tabValues,
33
+ }: TabProps & ReturnType<typeof useTabs>) {
34
+ const tabRefs: (HTMLLIElement | null)[] = [];
35
+ const { blockElementScrollPositionUntilNextRender } =
36
+ useScrollPositionBlocker();
37
+
38
+ const handleTabChange = (
39
+ event:
40
+ | React.FocusEvent<HTMLLIElement>
41
+ | React.MouseEvent<HTMLLIElement>
42
+ | React.KeyboardEvent<HTMLLIElement>
43
+ ) => {
44
+ const newTab = event.currentTarget;
45
+ const newTabIndex = tabRefs.indexOf(newTab);
46
+ const newTabValue = tabValues[newTabIndex]!.value;
47
+
48
+ if (newTabValue !== selectedValue) {
49
+ blockElementScrollPositionUntilNextRender(newTab);
50
+ selectValue(newTabValue);
51
+ }
52
+ };
53
+
54
+ const handleKeydown = (event: React.KeyboardEvent<HTMLLIElement>) => {
55
+ let focusElement = null;
56
+
57
+ switch (event.key) {
58
+ case "Enter": {
59
+ handleTabChange(event);
60
+ break;
61
+ }
62
+ case "ArrowRight": {
63
+ const nextTab = tabRefs.indexOf(event.currentTarget) + 1;
64
+ focusElement = tabRefs[nextTab] ?? tabRefs[0]!;
65
+ break;
66
+ }
67
+ case "ArrowLeft": {
68
+ const prevTab = tabRefs.indexOf(event.currentTarget) - 1;
69
+ focusElement = tabRefs[prevTab] ?? tabRefs[tabRefs.length - 1]!;
70
+ break;
71
+ }
72
+ default:
73
+ break;
74
+ }
75
+
76
+ focusElement?.focus();
77
+ };
78
+
79
+ const tabItemListContainerRef = useRef<HTMLUListElement>(null);
80
+ const [showTabArrows, setShowTabArrows] = useState<boolean>(false);
81
+
82
+ useEffect(() => {
83
+ const resizeObserver = new ResizeObserver((entries) => {
84
+ for (let entry of entries) {
85
+ requestAnimationFrame(() => {
86
+ if (entry.target.clientWidth < entry.target.scrollWidth) {
87
+ setShowTabArrows(true);
88
+ } else {
89
+ setShowTabArrows(false);
90
+ }
91
+ });
92
+ }
93
+ });
94
+
95
+ resizeObserver.observe(tabItemListContainerRef.current!);
96
+
97
+ return () => {
98
+ resizeObserver.disconnect();
99
+ };
100
+ }, []);
101
+
102
+ const handleRightClick = () => {
103
+ tabItemListContainerRef.current!.scrollLeft += 90;
104
+ };
105
+
106
+ const handleLeftClick = () => {
107
+ tabItemListContainerRef.current!.scrollLeft -= 90;
108
+ };
109
+
110
+ return (
111
+ <div className="openapi-tabs__discriminator-top-section">
112
+ <div className="openapi-tabs__discriminator-container">
113
+ {showTabArrows && (
114
+ <button
115
+ className="openapi-tabs__arrow left"
116
+ onClick={handleLeftClick}
117
+ />
118
+ )}
119
+ <ul
120
+ ref={tabItemListContainerRef}
121
+ role="tablist"
122
+ aria-orientation="horizontal"
123
+ className={clsx(
124
+ "openapi-tabs__discriminator-list-container",
125
+ "tabs",
126
+ {
127
+ "tabs--block": block,
128
+ },
129
+ className
130
+ )}
131
+ >
132
+ {tabValues.map(({ value, label, attributes }) => (
133
+ <li
134
+ // TODO extract TabListItem
135
+ role="tab"
136
+ tabIndex={selectedValue === value ? 0 : -1}
137
+ aria-selected={selectedValue === value}
138
+ key={value}
139
+ ref={(tabControl) => {
140
+ tabRefs.push(tabControl);
141
+ }}
142
+ onKeyDown={handleKeydown}
143
+ onClick={handleTabChange}
144
+ {...attributes}
145
+ className={clsx(
146
+ "tabs__item",
147
+ "openapi-tabs__discriminator-item",
148
+ attributes?.className as string,
149
+ {
150
+ active: selectedValue === value,
151
+ }
152
+ )}
153
+ >
154
+ <span className="openapi-tabs__discriminator-tab-label">
155
+ {label ?? value}
156
+ </span>
157
+ </li>
158
+ ))}
159
+ </ul>
160
+ {showTabArrows && (
161
+ <button
162
+ className="openapi-tabs__arrow right"
163
+ onClick={handleRightClick}
164
+ />
165
+ )}
166
+ </div>
167
+ </div>
168
+ );
169
+ }
170
+
171
+ function TabContent({
172
+ lazy,
173
+ children,
174
+ selectedValue,
175
+ }: TabProps & ReturnType<typeof useTabs>): React.JSX.Element | null {
176
+ const childTabs = (Array.isArray(children) ? children : [children]).filter(
177
+ Boolean
178
+ ) as ReactElement<TabItemProps>[];
179
+ const flattenedChildTabs = flatten(childTabs);
180
+ if (lazy) {
181
+ const selectedTabItem = flattenedChildTabs.find(
182
+ (tabItem) => tabItem.props.value === selectedValue
183
+ );
184
+ if (!selectedTabItem) {
185
+ // fail-safe or fail-fast? not sure what's best here
186
+ return null;
187
+ }
188
+ return cloneElement(selectedTabItem, { className: "margin-top--md" });
189
+ }
190
+ return (
191
+ <div className="margin-top--md">
192
+ {childTabs.map((tabItem, i) =>
193
+ cloneElement(tabItem, {
194
+ key: i,
195
+ hidden: tabItem.props.value !== selectedValue,
196
+ })
197
+ )}
198
+ </div>
199
+ );
200
+ }
201
+ function TabsComponent(props: TabProps): React.JSX.Element {
202
+ const tabs = useTabs(props);
203
+ return (
204
+ <div className="openapi-tabs__container">
205
+ <TabList {...props} {...tabs} />
206
+ <TabContent {...props} {...tabs} />
207
+ </div>
208
+ );
209
+ }
210
+ export default function DiscriminatorTabs(props: TabProps): React.JSX.Element {
211
+ const isBrowser = useIsBrowser();
212
+
213
+ if (
214
+ !props.children ||
215
+ (Array.isArray(props.children) && props.children.length === 0)
216
+ )
217
+ return <React.Fragment />;
218
+
219
+ return (
220
+ <TabsComponent
221
+ // Remount tabs after hydration
222
+ // Temporary fix for https://github.com/facebook/docusaurus/issues/5653
223
+ key={String(isBrowser)}
224
+ {...props}
225
+ >
226
+ {sanitizeTabsChildren(props.children)}
227
+ </TabsComponent>
228
+ );
229
+ }