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,258 @@
1
+ "use strict";
2
+ /* ============================================================================
3
+ * Copyright (c) Palo Alto Networks
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ * ========================================================================== */
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 () {
43
+ var ownKeys = function (o) {
44
+ ownKeys =
45
+ Object.getOwnPropertyNames ||
46
+ function (o) {
47
+ var ar = [];
48
+ for (var k in o)
49
+ if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
50
+ return ar;
51
+ };
52
+ return ownKeys(o);
53
+ };
54
+ return function (mod) {
55
+ if (mod && mod.__esModule) return mod;
56
+ var result = {};
57
+ if (mod != null)
58
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++)
59
+ if (k[i] !== "default") __createBinding(result, mod, k[i]);
60
+ __setModuleDefault(result, mod);
61
+ return result;
62
+ };
63
+ })();
64
+ var __importDefault =
65
+ (this && this.__importDefault) ||
66
+ function (mod) {
67
+ return mod && mod.__esModule ? mod : { default: mod };
68
+ };
69
+ Object.defineProperty(exports, "__esModule", { value: true });
70
+ exports.default = DiscriminatorTabs;
71
+ const react_1 = __importStar(require("react"));
72
+ const internal_1 = require("@docusaurus/theme-common/internal");
73
+ const useIsBrowser_1 = __importDefault(require("@docusaurus/useIsBrowser"));
74
+ const clsx_1 = __importDefault(require("clsx"));
75
+ const flatten_1 = __importDefault(require("lodash/flatten"));
76
+ function TabList({ className, block, selectedValue, selectValue, tabValues }) {
77
+ const tabRefs = [];
78
+ const { blockElementScrollPositionUntilNextRender } = (0,
79
+ internal_1.useScrollPositionBlocker)();
80
+ const handleTabChange = (event) => {
81
+ const newTab = event.currentTarget;
82
+ const newTabIndex = tabRefs.indexOf(newTab);
83
+ const newTabValue = tabValues[newTabIndex].value;
84
+ if (newTabValue !== selectedValue) {
85
+ blockElementScrollPositionUntilNextRender(newTab);
86
+ selectValue(newTabValue);
87
+ }
88
+ };
89
+ const handleKeydown = (event) => {
90
+ let focusElement = null;
91
+ switch (event.key) {
92
+ case "Enter": {
93
+ handleTabChange(event);
94
+ break;
95
+ }
96
+ case "ArrowRight": {
97
+ const nextTab = tabRefs.indexOf(event.currentTarget) + 1;
98
+ focusElement = tabRefs[nextTab] ?? tabRefs[0];
99
+ break;
100
+ }
101
+ case "ArrowLeft": {
102
+ const prevTab = tabRefs.indexOf(event.currentTarget) - 1;
103
+ focusElement = tabRefs[prevTab] ?? tabRefs[tabRefs.length - 1];
104
+ break;
105
+ }
106
+ default:
107
+ break;
108
+ }
109
+ focusElement?.focus();
110
+ };
111
+ const tabItemListContainerRef = (0, react_1.useRef)(null);
112
+ const [showTabArrows, setShowTabArrows] = (0, react_1.useState)(false);
113
+ (0, react_1.useEffect)(() => {
114
+ const resizeObserver = new ResizeObserver((entries) => {
115
+ for (let entry of entries) {
116
+ requestAnimationFrame(() => {
117
+ if (entry.target.clientWidth < entry.target.scrollWidth) {
118
+ setShowTabArrows(true);
119
+ } else {
120
+ setShowTabArrows(false);
121
+ }
122
+ });
123
+ }
124
+ });
125
+ resizeObserver.observe(tabItemListContainerRef.current);
126
+ return () => {
127
+ resizeObserver.disconnect();
128
+ };
129
+ }, []);
130
+ const handleRightClick = () => {
131
+ tabItemListContainerRef.current.scrollLeft += 90;
132
+ };
133
+ const handleLeftClick = () => {
134
+ tabItemListContainerRef.current.scrollLeft -= 90;
135
+ };
136
+ return react_1.default.createElement(
137
+ "div",
138
+ { className: "openapi-tabs__discriminator-top-section" },
139
+ react_1.default.createElement(
140
+ "div",
141
+ { className: "openapi-tabs__discriminator-container" },
142
+ showTabArrows &&
143
+ react_1.default.createElement("button", {
144
+ className: "openapi-tabs__arrow left",
145
+ onClick: handleLeftClick,
146
+ }),
147
+ react_1.default.createElement(
148
+ "ul",
149
+ {
150
+ ref: tabItemListContainerRef,
151
+ role: "tablist",
152
+ "aria-orientation": "horizontal",
153
+ className: (0, clsx_1.default)(
154
+ "openapi-tabs__discriminator-list-container",
155
+ "tabs",
156
+ {
157
+ "tabs--block": block,
158
+ },
159
+ className
160
+ ),
161
+ },
162
+ tabValues.map(({ value, label, attributes }) =>
163
+ react_1.default.createElement(
164
+ "li",
165
+ {
166
+ // TODO extract TabListItem
167
+ role: "tab",
168
+ tabIndex: selectedValue === value ? 0 : -1,
169
+ "aria-selected": selectedValue === value,
170
+ key: value,
171
+ ref: (tabControl) => {
172
+ tabRefs.push(tabControl);
173
+ },
174
+ onKeyDown: handleKeydown,
175
+ onClick: handleTabChange,
176
+ ...attributes,
177
+ className: (0, clsx_1.default)(
178
+ "tabs__item",
179
+ "openapi-tabs__discriminator-item",
180
+ attributes?.className,
181
+ {
182
+ active: selectedValue === value,
183
+ }
184
+ ),
185
+ },
186
+ react_1.default.createElement(
187
+ "span",
188
+ { className: "openapi-tabs__discriminator-tab-label" },
189
+ label ?? value
190
+ )
191
+ )
192
+ )
193
+ ),
194
+ showTabArrows &&
195
+ react_1.default.createElement("button", {
196
+ className: "openapi-tabs__arrow right",
197
+ onClick: handleRightClick,
198
+ })
199
+ )
200
+ );
201
+ }
202
+ function TabContent({ lazy, children, selectedValue }) {
203
+ const childTabs = (Array.isArray(children) ? children : [children]).filter(
204
+ Boolean
205
+ );
206
+ const flattenedChildTabs = (0, flatten_1.default)(childTabs);
207
+ if (lazy) {
208
+ const selectedTabItem = flattenedChildTabs.find(
209
+ (tabItem) => tabItem.props.value === selectedValue
210
+ );
211
+ if (!selectedTabItem) {
212
+ // fail-safe or fail-fast? not sure what's best here
213
+ return null;
214
+ }
215
+ return (0, react_1.cloneElement)(selectedTabItem, {
216
+ className: "margin-top--md",
217
+ });
218
+ }
219
+ return react_1.default.createElement(
220
+ "div",
221
+ { className: "margin-top--md" },
222
+ childTabs.map((tabItem, i) =>
223
+ (0, react_1.cloneElement)(tabItem, {
224
+ key: i,
225
+ hidden: tabItem.props.value !== selectedValue,
226
+ })
227
+ )
228
+ );
229
+ }
230
+ function TabsComponent(props) {
231
+ const tabs = (0, internal_1.useTabs)(props);
232
+ return react_1.default.createElement(
233
+ "div",
234
+ { className: "openapi-tabs__container" },
235
+ react_1.default.createElement(TabList, { ...props, ...tabs }),
236
+ react_1.default.createElement(TabContent, { ...props, ...tabs })
237
+ );
238
+ }
239
+ function DiscriminatorTabs(props) {
240
+ const isBrowser = (0, useIsBrowser_1.default)();
241
+ if (
242
+ !props.children ||
243
+ (Array.isArray(props.children) && props.children.length === 0)
244
+ )
245
+ return react_1.default.createElement(react_1.default.Fragment, null);
246
+ return react_1.default.createElement(
247
+ TabsComponent,
248
+ // Remount tabs after hydration
249
+ // Temporary fix for https://github.com/facebook/docusaurus/issues/5653
250
+ {
251
+ // Remount tabs after hydration
252
+ // Temporary fix for https://github.com/facebook/docusaurus/issues/5653
253
+ key: String(isBrowser),
254
+ ...props,
255
+ },
256
+ (0, internal_1.sanitizeTabsChildren)(props.children)
257
+ );
258
+ }
@@ -0,0 +1,122 @@
1
+ /* Markdown Details Styling */
2
+
3
+ /* Top-Level Details Styling */
4
+ .openapi-left-panel__container > .openapi-markdown__details > summary,
5
+ .openapi-markdown__details.mime > summary,
6
+ .openapi-markdown__details.response > summary {
7
+ text-transform: uppercase;
8
+ font-size: 12px;
9
+ }
10
+
11
+ .openapi-left-panel__container > .openapi-markdown__details,
12
+ .openapi-markdown__details.mime,
13
+ .openapi-markdown__details.response {
14
+ margin-bottom: 1rem !important;
15
+ }
16
+
17
+ .openapi-markdown__details-summary-header-params,
18
+ .openapi-markdown__details-summary-header-body {
19
+ font-size: 12px;
20
+ margin-bottom: 0;
21
+ }
22
+ /* End of Top-Level Details Styling */
23
+
24
+ /* Top-Level Details Caret Styling */
25
+ .openapi-left-panel__container > .openapi-markdown__details > summary::before,
26
+ .openapi-markdown__details.mime > summary::before {
27
+ top: 0.1rem;
28
+ }
29
+
30
+ .openapi-markdown__details.response > summary::before {
31
+ top: 0.25rem; /* TODO: figure out why this is necessary */
32
+ }
33
+ /* End of Top-Level Details Caret Styling */
34
+
35
+ .openapi-markdown__details {
36
+ margin: unset !important;
37
+ background-color: transparent;
38
+ color: var(--ifm-font-color-base);
39
+ padding: unset;
40
+ border: unset !important;
41
+ box-shadow: unset !important;
42
+ --docusaurus-details-decoration-color: var(--ifm-font-color-base) !important;
43
+ }
44
+
45
+ .openapi-markdown__details > summary::before {
46
+ content: "";
47
+ background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path></svg>')
48
+ 50% / 1.2rem 1.2rem;
49
+ filter: var(--ifm-menu-link-sublist-icon-filter);
50
+ height: 0.75rem;
51
+ transform: rotate(90deg) !important;
52
+ width: 0.75rem;
53
+ transition: transform var(--ifm-transition-fast) linear !important;
54
+ border: none !important;
55
+ transform-origin: unset !important;
56
+ }
57
+
58
+ .openapi-markdown__details ul {
59
+ padding-left: 0;
60
+ font-size: 14px;
61
+ }
62
+
63
+ .openapi-markdown__details li {
64
+ list-style: none;
65
+ padding-top: 5px;
66
+ }
67
+
68
+ .theme-api-markdown details[data-collapsed="false"] > summary::before {
69
+ transform: rotate(180deg) !important;
70
+ }
71
+
72
+ .openapi-markdown__details > div > div {
73
+ padding-top: unset !important;
74
+ border-top: unset !important;
75
+ }
76
+
77
+ .openapi-markdown__details p {
78
+ margin-bottom: 0;
79
+ }
80
+
81
+ .openapi-markdown__details-summary-mime {
82
+ display: flex;
83
+ }
84
+
85
+ /* Hide defaul details marker by default */
86
+ details summary::-webkit-details-marker {
87
+ display: none;
88
+ }
89
+
90
+ .openapi-security__details {
91
+ font-size: 12px;
92
+ margin-bottom: 1rem;
93
+ background-color: transparent;
94
+ color: var(--ifm-font-color-base);
95
+ padding: unset;
96
+ border: thin solid var(--ifm-toc-border-color);
97
+ border-radius: var(--ifm-pre-border-radius);
98
+ box-shadow: unset !important;
99
+ --docusaurus-details-decoration-color: var(--ifm-font-color-base) !important;
100
+ }
101
+
102
+ .openapi-security__details pre {
103
+ margin-bottom: unset;
104
+ border-top-left-radius: 0;
105
+ border-top: thin solid var(--ifm-toc-border-color);
106
+ border-top-right-radius: 0;
107
+ }
108
+
109
+ .openapi-security__summary-header {
110
+ font-size: 12px;
111
+ text-transform: uppercase;
112
+ margin-bottom: unset;
113
+ }
114
+
115
+ .openapi-security__summary-container {
116
+ padding: 1rem;
117
+ list-style-type: none;
118
+
119
+ &:hover {
120
+ cursor: pointer;
121
+ }
122
+ }
@@ -0,0 +1,179 @@
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 Admonition from "@theme/Admonition";
11
+ import CodeBlock from "@theme/CodeBlock";
12
+ import ReactMarkdown from "react-markdown";
13
+ import rehypeRaw from "rehype-raw";
14
+ import remarkGfm from "remark-gfm";
15
+
16
+ function remarkAdmonition() {
17
+ return (tree) => {
18
+ const openingTagRegex = /^:::(\w+)(?:\[(.*?)\])?\s*$/;
19
+ const closingTagRegex = /^:::\s*$/;
20
+ const textOnlyAdmonition = /^:::(\w+)(?:\[(.*?)\])?\s*([\s\S]*?)\s*:::$/;
21
+
22
+ const nodes = [];
23
+ let bufferedChildren = [];
24
+
25
+ let insideAdmonition = false;
26
+ let type = null;
27
+ let title = null;
28
+
29
+ tree.children.forEach((node) => {
30
+ if (
31
+ node.type === "paragraph" &&
32
+ node.children.length === 1 &&
33
+ node.children[0].type === "text"
34
+ ) {
35
+ const text = node.children[0].value.trim();
36
+ const openingMatch = text.match(openingTagRegex);
37
+ const closingMatch = text.match(closingTagRegex);
38
+ const textOnlyAdmonitionMatch = text.match(textOnlyAdmonition);
39
+
40
+ if (textOnlyAdmonitionMatch) {
41
+ const type = textOnlyAdmonitionMatch[1];
42
+ const title = textOnlyAdmonitionMatch[2]
43
+ ? textOnlyAdmonitionMatch[2]?.trim()
44
+ : undefined;
45
+ const content = textOnlyAdmonitionMatch[3];
46
+
47
+ const admonitionNode = {
48
+ type: "admonition",
49
+ data: {
50
+ hName: "Admonition", // Tells ReactMarkdown to replace the node with Admonition component
51
+ hProperties: {
52
+ type, // Passed as a prop to the Admonition component
53
+ title,
54
+ },
55
+ },
56
+ children: [
57
+ {
58
+ type: "text",
59
+ value: content?.trim(), // Trim leading/trailing whitespace
60
+ },
61
+ ],
62
+ };
63
+ nodes.push(admonitionNode);
64
+ return;
65
+ }
66
+
67
+ if (openingMatch) {
68
+ type = openingMatch[1];
69
+ title = openingMatch[2] || type;
70
+ insideAdmonition = true;
71
+ return;
72
+ }
73
+
74
+ if (closingMatch && insideAdmonition) {
75
+ nodes.push({
76
+ type: "admonition",
77
+ data: {
78
+ hName: "Admonition",
79
+ hProperties: { type: type, title: title },
80
+ },
81
+ children: bufferedChildren,
82
+ });
83
+ bufferedChildren = [];
84
+ insideAdmonition = false;
85
+ type = null;
86
+ title = null;
87
+ return;
88
+ }
89
+ }
90
+
91
+ if (insideAdmonition) {
92
+ bufferedChildren.push(node);
93
+ } else {
94
+ nodes.push(node);
95
+ }
96
+ });
97
+
98
+ if (bufferedChildren.length > 0 && type) {
99
+ nodes.push({
100
+ type: "admonition",
101
+ data: {
102
+ hName: "Admonition",
103
+ hProperties: { type: type, title: title },
104
+ },
105
+ children: bufferedChildren,
106
+ });
107
+ }
108
+ tree.children = nodes;
109
+ };
110
+ }
111
+
112
+ function convertAstToHtmlStr(ast) {
113
+ if (!ast || !Array.isArray(ast)) {
114
+ return "";
115
+ }
116
+
117
+ const convertNode = (node) => {
118
+ switch (node.type) {
119
+ case "text":
120
+ return node.value;
121
+ case "element":
122
+ const { tagName, properties, children } = node;
123
+
124
+ // Convert attributes to a string
125
+ const attrs = properties
126
+ ? Object.entries(properties)
127
+ .map(([key, value]) => `${key}="${value}"`)
128
+ .join(" ")
129
+ : "";
130
+
131
+ // Convert children to HTML
132
+ const childrenHtml = children ? children.map(convertNode).join("") : "";
133
+
134
+ return `<${tagName} ${attrs}>${childrenHtml}</${tagName}>`;
135
+ default:
136
+ return "";
137
+ }
138
+ };
139
+
140
+ return ast.map(convertNode).join("");
141
+ }
142
+
143
+ function Markdown({ children }) {
144
+ return (
145
+ <ReactMarkdown
146
+ rehypePlugins={[rehypeRaw]}
147
+ remarkPlugins={[remarkGfm, remarkAdmonition]}
148
+ components={{
149
+ pre: (props) => <div {...props} />,
150
+ code({ node, inline, className, children, ...props }) {
151
+ const match = /language-(\w+)/.exec(className || "");
152
+ return match ? (
153
+ <CodeBlock className={className} language={match[1]} {...props}>
154
+ {children}
155
+ </CodeBlock>
156
+ ) : (
157
+ <code className={className} {...props}>
158
+ {children}
159
+ </code>
160
+ );
161
+ },
162
+ admonition: ({ node, ...props }) => {
163
+ const type = node.data?.hProperties?.type || "note";
164
+ const title = node.data?.hProperties?.title || type;
165
+ const content = convertAstToHtmlStr(node.children);
166
+ return (
167
+ <Admonition type={type} title={title} {...props}>
168
+ <div dangerouslySetInnerHTML={{ __html: content }} />
169
+ </Admonition>
170
+ );
171
+ },
172
+ }}
173
+ >
174
+ {children}
175
+ </ReactMarkdown>
176
+ );
177
+ }
178
+
179
+ export default Markdown;
@@ -0,0 +1,70 @@
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
+ .openapi-tabs__mime-container {
9
+ display: flex;
10
+ align-items: center;
11
+ margin-top: 1rem;
12
+ overflow: hidden;
13
+ }
14
+
15
+ .openapi-tabs__mime-item {
16
+ display: flex;
17
+ align-items: center;
18
+ justify-content: center;
19
+ padding: 0.35rem 0.7rem;
20
+ border: 1px solid transparent;
21
+ margin-top: 0 !important;
22
+ margin-right: 0.5rem;
23
+ font-weight: var(--ifm-font-weight-bold);
24
+ font-size: 10px;
25
+ text-transform: uppercase;
26
+ white-space: nowrap;
27
+ transition: 300ms;
28
+
29
+ &:hover {
30
+ background-color: transparent;
31
+ border: 1px solid var(--ifm-toc-border-color);
32
+ }
33
+
34
+ &.active {
35
+ border: 1px solid var(--ifm-tabs-color-active-border);
36
+ color: var(--ifm-tabs-color-active);
37
+ }
38
+
39
+ &:last-child {
40
+ margin-right: 0 !important;
41
+ }
42
+ }
43
+
44
+ .openapi-tabs__mime-list-container {
45
+ overflow-y: hidden;
46
+ overflow-x: scroll;
47
+ scroll-behavior: smooth;
48
+ scrollbar-width: none;
49
+
50
+ &::-webkit-scrollbar {
51
+ display: none;
52
+ }
53
+ }
54
+
55
+ .openapi-tabs__mime-schema-container {
56
+ max-width: 600px;
57
+ }
58
+
59
+ @media screen and (max-width: 500px) {
60
+ .mimeTabsTopSection {
61
+ flex-direction: column;
62
+ align-items: flex-start;
63
+ }
64
+
65
+ .mimeTabsContainer {
66
+ width: 100%;
67
+ margin-top: var(--ifm-spacing-vertical);
68
+ padding: 0;
69
+ }
70
+ }
@@ -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;