docusaurus-theme-openapi-docs 0.0.0-618 → 0.0.0-684

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 (390) hide show
  1. package/lib/index.d.ts +2 -0
  2. package/lib/index.js +53 -27
  3. package/lib/markdown/createDescription.d.ts +1 -0
  4. package/lib/markdown/createDescription.js +8 -11
  5. package/lib/markdown/schema.d.ts +3 -0
  6. package/lib/markdown/schema.js +138 -139
  7. package/lib/markdown/utils.d.ts +8 -0
  8. package/lib/markdown/utils.js +36 -42
  9. package/lib/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/index.js +165 -0
  10. package/lib/theme/ApiDemoPanel/ApiCodeBlock/Line/_Line.scss +46 -0
  11. package/lib/theme/ApiExplorer/Accept/index.d.ts +3 -0
  12. package/lib/theme/ApiExplorer/Accept/index.js +38 -0
  13. package/lib/theme/ApiExplorer/Accept/slice.d.ts +11 -0
  14. package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Accept/slice.js +7 -5
  15. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
  16. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.js +29 -0
  17. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +30 -0
  18. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.js +134 -0
  19. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
  20. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
  21. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +74 -0
  22. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
  23. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +47 -0
  24. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
  25. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +156 -0
  26. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +46 -0
  27. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.js +47 -0
  28. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
  29. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +44 -0
  30. package/lib/theme/ApiExplorer/ApiCodeBlock/index.js +40 -0
  31. package/lib/theme/ApiExplorer/Authorization/auth-types.d.ts +3 -0
  32. package/lib/theme/{ApiDemoPanel → ApiExplorer}/Authorization/auth-types.js +4 -10
  33. package/lib/theme/ApiExplorer/Authorization/index.d.ts +3 -0
  34. package/lib/theme/ApiExplorer/Authorization/index.js +157 -0
  35. package/lib/theme/ApiExplorer/Authorization/slice.d.ts +40 -0
  36. package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Authorization/slice.js +23 -16
  37. package/lib/theme/ApiExplorer/Body/index.d.ts +10 -0
  38. package/lib/theme/ApiExplorer/Body/index.js +363 -0
  39. package/lib/theme/ApiExplorer/Body/slice.d.ts +82 -0
  40. package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Body/slice.js +21 -12
  41. package/lib/theme/ApiExplorer/CodeSnippets/index.d.ts +20 -0
  42. package/lib/theme/ApiExplorer/CodeSnippets/index.js +406 -0
  43. package/lib/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +291 -0
  44. package/lib/theme/ApiExplorer/CodeTabs/index.js +174 -0
  45. package/lib/theme/ApiExplorer/ContentType/index.d.ts +3 -0
  46. package/lib/theme/ApiExplorer/ContentType/index.js +40 -0
  47. package/lib/theme/ApiExplorer/ContentType/slice.d.ts +11 -0
  48. package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/ContentType/slice.js +7 -5
  49. package/lib/theme/ApiExplorer/Export/index.d.ts +3 -0
  50. package/lib/theme/ApiExplorer/Export/index.js +57 -0
  51. package/lib/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +25 -0
  52. package/lib/theme/ApiExplorer/FloatingButton/index.d.ts +8 -0
  53. package/lib/theme/ApiExplorer/FloatingButton/index.js +28 -0
  54. package/{lib-next/theme/ApiDemoPanel/FormFileUpload/styles.module.css → lib/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss} +32 -35
  55. package/lib/theme/ApiExplorer/FormFileUpload/index.d.ts +7 -0
  56. package/lib/theme/ApiExplorer/FormFileUpload/index.js +161 -0
  57. package/lib/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
  58. package/lib/theme/ApiExplorer/FormItem/index.d.ts +10 -0
  59. package/lib/theme/ApiExplorer/FormItem/index.js +44 -0
  60. package/lib/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
  61. package/lib/theme/ApiExplorer/FormMultiSelect/index.d.ts +9 -0
  62. package/lib/theme/ApiExplorer/FormMultiSelect/index.js +51 -0
  63. package/{src/theme/ApiDemoPanel/FormSelect/styles.module.css → lib/theme/ApiExplorer/FormSelect/_FormSelect.scss} +15 -23
  64. package/lib/theme/ApiExplorer/FormSelect/index.d.ts +8 -0
  65. package/lib/theme/ApiExplorer/FormSelect/index.js +35 -0
  66. package/lib/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
  67. package/lib/theme/ApiExplorer/FormTextInput/index.d.ts +9 -0
  68. package/lib/theme/ApiExplorer/FormTextInput/index.js +73 -0
  69. package/lib/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
  70. package/lib/theme/ApiExplorer/LiveEditor/index.d.ts +6 -0
  71. package/lib/theme/ApiExplorer/LiveEditor/index.js +154 -0
  72. package/lib/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
  73. package/lib/theme/ApiExplorer/MethodEndpoint/index.d.ts +7 -0
  74. package/lib/theme/ApiExplorer/MethodEndpoint/index.js +83 -0
  75. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.d.ts +6 -0
  76. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.js +194 -0
  77. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.d.ts +6 -0
  78. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +63 -0
  79. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.d.ts +6 -0
  80. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +89 -0
  81. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.d.ts +6 -0
  82. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +63 -0
  83. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.d.ts +6 -0
  84. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.js +38 -0
  85. package/{src/theme/ApiDemoPanel/ParamOptions/styles.module.css → lib/theme/ApiExplorer/ParamOptions/_ParamOptions.scss} +38 -92
  86. package/lib/theme/ApiExplorer/ParamOptions/index.d.ts +7 -0
  87. package/lib/theme/ApiExplorer/ParamOptions/index.js +210 -0
  88. package/lib/theme/ApiExplorer/ParamOptions/slice.d.ts +17 -0
  89. package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/ParamOptions/slice.js +7 -5
  90. package/lib/theme/ApiExplorer/Request/_Request.scss +122 -0
  91. package/lib/theme/ApiExplorer/Request/index.d.ts +6 -0
  92. package/lib/theme/ApiExplorer/Request/index.js +365 -0
  93. package/lib/theme/ApiExplorer/Request/makeRequest.d.ts +4 -0
  94. package/{lib-next/theme/ApiDemoPanel/Execute → lib/theme/ApiExplorer/Request}/makeRequest.js +10 -9
  95. package/lib/theme/ApiExplorer/Response/_Response.scss +119 -0
  96. package/lib/theme/ApiExplorer/Response/index.d.ts +6 -0
  97. package/lib/theme/ApiExplorer/Response/index.js +190 -0
  98. package/lib/theme/ApiExplorer/Response/slice.d.ts +17 -0
  99. package/lib/theme/ApiExplorer/Response/slice.js +51 -0
  100. package/lib/theme/ApiExplorer/SecuritySchemes/index.d.ts +3 -0
  101. package/lib/theme/ApiExplorer/SecuritySchemes/index.js +380 -0
  102. package/{src/theme/ApiDemoPanel/Request/styles.module.css → lib/theme/ApiExplorer/Server/_Server.scss} +15 -7
  103. package/lib/theme/ApiExplorer/Server/index.d.ts +3 -0
  104. package/lib/theme/ApiExplorer/Server/index.js +187 -0
  105. package/lib/theme/ApiExplorer/Server/slice.d.ts +13 -0
  106. package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Server/slice.js +10 -5
  107. package/lib/theme/ApiExplorer/buildPostmanRequest.d.ts +20 -0
  108. package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/buildPostmanRequest.js +27 -40
  109. package/lib/theme/ApiExplorer/index.d.ts +7 -0
  110. package/lib/theme/ApiExplorer/index.js +37 -0
  111. package/lib/theme/ApiExplorer/persistanceMiddleware.d.ts +3 -0
  112. package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/persistanceMiddleware.js +11 -14
  113. package/lib/theme/ApiExplorer/storage-utils.d.ts +4 -0
  114. package/lib/theme/{ApiDemoPanel → ApiExplorer}/storage-utils.js +14 -13
  115. package/lib/theme/ApiItem/Layout/index.d.ts +4 -0
  116. package/lib/theme/ApiItem/Layout/index.js +78 -56
  117. package/lib/theme/ApiItem/hooks.d.ts +12 -0
  118. package/lib/theme/ApiItem/hooks.js +5 -10
  119. package/lib/theme/ApiItem/index.d.ts +4 -0
  120. package/lib/theme/ApiItem/index.js +141 -118
  121. package/lib/theme/ApiItem/store.d.ts +46 -0
  122. package/lib/theme/ApiItem/store.js +44 -34
  123. package/lib/theme/ApiLogo/index.d.ts +2 -0
  124. package/lib/theme/ApiLogo/index.js +34 -32
  125. package/lib/theme/ApiTabs/_ApiTabs.scss +140 -0
  126. package/lib/theme/ApiTabs/index.js +105 -190
  127. package/lib/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +97 -0
  128. package/lib/theme/DiscriminatorTabs/index.js +102 -189
  129. package/lib/theme/Markdown/Details/_Details.scss +119 -0
  130. package/lib/theme/MimeTabs/_MimeTabs.scss +69 -0
  131. package/lib/theme/MimeTabs/index.js +125 -199
  132. package/lib/theme/ParamsItem/_ParamsItem.scss +54 -0
  133. package/lib/theme/ParamsItem/index.js +9 -8
  134. package/lib/theme/ResponseSamples/_ResponseSamples.scss +3 -0
  135. package/lib/theme/ResponseSamples/index.js +2 -7
  136. package/lib/theme/SchemaItem/_SchemaItem.scss +89 -0
  137. package/lib/theme/SchemaItem/index.js +31 -22
  138. package/lib/theme/SchemaTabs/_SchemaTabs.scss +64 -0
  139. package/lib/theme/SchemaTabs/index.js +97 -185
  140. package/lib/theme/styles.scss +160 -0
  141. package/lib/types.d.ts +157 -0
  142. package/lib/types.js +8 -1
  143. package/package.json +17 -23
  144. package/src/index.ts +33 -3
  145. package/src/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/index.js +165 -0
  146. package/src/theme/ApiDemoPanel/ApiCodeBlock/Line/_Line.scss +46 -0
  147. package/src/theme/{ApiDemoPanel → ApiExplorer}/Accept/index.tsx +2 -2
  148. package/src/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
  149. package/src/theme/ApiExplorer/ApiCodeBlock/Container/index.js +29 -0
  150. package/src/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +30 -0
  151. package/src/theme/ApiExplorer/ApiCodeBlock/Content/String.js +134 -0
  152. package/src/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
  153. package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
  154. package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +74 -0
  155. package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
  156. package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +47 -0
  157. package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
  158. package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +156 -0
  159. package/src/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +46 -0
  160. package/src/theme/ApiExplorer/ApiCodeBlock/Line/index.js +47 -0
  161. package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
  162. package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +44 -0
  163. package/src/theme/ApiExplorer/ApiCodeBlock/index.js +40 -0
  164. package/src/theme/{ApiDemoPanel → ApiExplorer}/Authorization/index.tsx +3 -3
  165. package/src/theme/{ApiDemoPanel → ApiExplorer}/Authorization/slice.ts +1 -1
  166. package/src/theme/{ApiDemoPanel → ApiExplorer}/Body/index.tsx +64 -41
  167. package/src/theme/{ApiDemoPanel/Curl → ApiExplorer/CodeSnippets}/index.tsx +94 -34
  168. package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +291 -0
  169. package/src/theme/ApiExplorer/CodeTabs/index.js +174 -0
  170. package/src/theme/{ApiDemoPanel → ApiExplorer}/ContentType/index.tsx +2 -2
  171. package/src/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +25 -0
  172. package/src/theme/{ApiDemoPanel → ApiExplorer}/FloatingButton/index.tsx +1 -3
  173. package/src/theme/{ApiDemoPanel/FormFileUpload/styles.module.css → ApiExplorer/FormFileUpload/_FormFileUpload.scss} +32 -35
  174. package/src/theme/{ApiDemoPanel → ApiExplorer}/FormFileUpload/index.tsx +10 -6
  175. package/src/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
  176. package/src/theme/{ApiDemoPanel → ApiExplorer}/FormItem/index.tsx +8 -12
  177. package/src/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
  178. package/src/theme/{ApiDemoPanel → ApiExplorer}/FormMultiSelect/index.tsx +6 -3
  179. package/{lib/theme/ApiDemoPanel/FormSelect/styles.module.css → src/theme/ApiExplorer/FormSelect/_FormSelect.scss} +15 -23
  180. package/src/theme/{ApiDemoPanel → ApiExplorer}/FormSelect/index.tsx +5 -3
  181. package/src/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
  182. package/src/theme/ApiExplorer/FormTextInput/index.tsx +80 -0
  183. package/src/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
  184. package/src/theme/ApiExplorer/LiveEditor/index.tsx +112 -0
  185. package/src/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
  186. package/src/theme/ApiExplorer/MethodEndpoint/index.tsx +87 -0
  187. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +156 -0
  188. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +64 -0
  189. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +86 -0
  190. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +65 -0
  191. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.tsx +38 -0
  192. package/{lib-next/theme/ApiDemoPanel/ParamOptions/styles.module.css → src/theme/ApiExplorer/ParamOptions/_ParamOptions.scss} +38 -92
  193. package/src/theme/ApiExplorer/ParamOptions/index.tsx +145 -0
  194. package/src/theme/ApiExplorer/Request/_Request.scss +122 -0
  195. package/src/theme/ApiExplorer/Request/index.tsx +286 -0
  196. package/src/theme/{ApiDemoPanel/Execute → ApiExplorer/Request}/makeRequest.ts +9 -6
  197. package/src/theme/ApiExplorer/Response/_Response.scss +119 -0
  198. package/src/theme/ApiExplorer/Response/index.tsx +154 -0
  199. package/src/theme/{ApiDemoPanel → ApiExplorer}/Response/slice.ts +22 -1
  200. package/src/theme/{ApiDemoPanel → ApiExplorer}/SecuritySchemes/index.tsx +5 -3
  201. package/{lib/theme/ApiDemoPanel/Request/styles.module.css → src/theme/ApiExplorer/Server/_Server.scss} +15 -7
  202. package/src/theme/{ApiDemoPanel → ApiExplorer}/Server/index.tsx +13 -17
  203. package/src/theme/{ApiDemoPanel → ApiExplorer}/buildPostmanRequest.ts +2 -2
  204. package/src/theme/{ApiDemoPanel → ApiExplorer}/index.tsx +14 -17
  205. package/src/theme/{ApiDemoPanel → ApiExplorer}/persistanceMiddleware.ts +1 -1
  206. package/src/theme/ApiItem/index.tsx +7 -7
  207. package/src/theme/ApiItem/store.ts +7 -7
  208. package/src/theme/ApiTabs/_ApiTabs.scss +140 -0
  209. package/src/theme/ApiTabs/index.js +105 -190
  210. package/src/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +97 -0
  211. package/src/theme/DiscriminatorTabs/index.js +102 -189
  212. package/src/theme/Markdown/Details/_Details.scss +119 -0
  213. package/src/theme/MimeTabs/_MimeTabs.scss +69 -0
  214. package/src/theme/MimeTabs/index.js +125 -199
  215. package/src/theme/ParamsItem/_ParamsItem.scss +54 -0
  216. package/src/theme/ParamsItem/index.js +9 -8
  217. package/src/theme/ResponseSamples/_ResponseSamples.scss +3 -0
  218. package/src/theme/ResponseSamples/index.js +2 -7
  219. package/src/theme/SchemaItem/_SchemaItem.scss +89 -0
  220. package/src/theme/SchemaItem/index.js +31 -22
  221. package/src/theme/SchemaTabs/_SchemaTabs.scss +64 -0
  222. package/src/theme/SchemaTabs/index.js +97 -185
  223. package/src/theme/styles.scss +160 -0
  224. package/src/theme-openapi.d.ts +90 -47
  225. package/tsconfig.json +6 -3
  226. package/lib/postman-code-generators.d.ts +0 -9
  227. package/lib/react-magic-dropzone.d.ts +0 -9
  228. package/lib/theme/ApiDemoPanel/Accept/index.js +0 -32
  229. package/lib/theme/ApiDemoPanel/Accept/slice.js +0 -31
  230. package/lib/theme/ApiDemoPanel/Authorization/index.js +0 -107
  231. package/lib/theme/ApiDemoPanel/Authorization/slice.js +0 -123
  232. package/lib/theme/ApiDemoPanel/Body/index.js +0 -256
  233. package/lib/theme/ApiDemoPanel/Body/slice.js +0 -102
  234. package/lib/theme/ApiDemoPanel/CodeTabs/index.js +0 -161
  235. package/lib/theme/ApiDemoPanel/CodeTabs/styles.module.css +0 -17
  236. package/lib/theme/ApiDemoPanel/ContentType/index.js +0 -32
  237. package/lib/theme/ApiDemoPanel/ContentType/slice.js +0 -31
  238. package/lib/theme/ApiDemoPanel/Curl/index.js +0 -240
  239. package/lib/theme/ApiDemoPanel/Curl/styles.module.css +0 -84
  240. package/lib/theme/ApiDemoPanel/Execute/index.js +0 -151
  241. package/lib/theme/ApiDemoPanel/Execute/makeRequest.js +0 -181
  242. package/lib/theme/ApiDemoPanel/Export/index.js +0 -47
  243. package/lib/theme/ApiDemoPanel/FloatingButton/index.js +0 -30
  244. package/lib/theme/ApiDemoPanel/FloatingButton/styles.module.css +0 -26
  245. package/lib/theme/ApiDemoPanel/FormFileUpload/index.js +0 -83
  246. package/lib/theme/ApiDemoPanel/FormFileUpload/styles.module.css +0 -75
  247. package/lib/theme/ApiDemoPanel/FormItem/index.js +0 -38
  248. package/lib/theme/ApiDemoPanel/FormItem/styles.module.css +0 -12
  249. package/lib/theme/ApiDemoPanel/FormMultiSelect/index.js +0 -45
  250. package/lib/theme/ApiDemoPanel/FormMultiSelect/styles.module.css +0 -38
  251. package/lib/theme/ApiDemoPanel/FormSelect/index.js +0 -34
  252. package/lib/theme/ApiDemoPanel/FormTextInput/index.js +0 -28
  253. package/lib/theme/ApiDemoPanel/FormTextInput/styles.module.css +0 -21
  254. package/lib/theme/ApiDemoPanel/LiveEditor/index.js +0 -62
  255. package/lib/theme/ApiDemoPanel/LiveEditor/styles.module.css +0 -35
  256. package/lib/theme/ApiDemoPanel/MethodEndpoint/index.js +0 -56
  257. package/lib/theme/ApiDemoPanel/ParamOptions/index.js +0 -216
  258. package/lib/theme/ApiDemoPanel/ParamOptions/slice.js +0 -34
  259. package/lib/theme/ApiDemoPanel/ParamOptions/styles.module.css +0 -176
  260. package/lib/theme/ApiDemoPanel/Request/index.js +0 -67
  261. package/lib/theme/ApiDemoPanel/Response/index.js +0 -66
  262. package/lib/theme/ApiDemoPanel/Response/slice.js +0 -36
  263. package/lib/theme/ApiDemoPanel/SecuritySchemes/index.js +0 -257
  264. package/lib/theme/ApiDemoPanel/Server/index.js +0 -104
  265. package/lib/theme/ApiDemoPanel/Server/slice.js +0 -40
  266. package/lib/theme/ApiDemoPanel/Server/styles.module.css +0 -56
  267. package/lib/theme/ApiDemoPanel/buildPostmanRequest.js +0 -303
  268. package/lib/theme/ApiDemoPanel/index.js +0 -41
  269. package/lib/theme/ApiDemoPanel/persistanceMiddleware.js +0 -59
  270. package/lib/theme/ApiDemoPanel/postman-collection.d.ts +0 -10
  271. package/lib/theme/ApiDemoPanel/react-modal.d.ts +0 -8
  272. package/lib/theme/ApiTabs/styles.module.css +0 -120
  273. package/lib/theme/DiscriminatorTabs/styles.module.css +0 -119
  274. package/lib/theme/MimeTabs/styles.module.css +0 -126
  275. package/lib/theme/ParamsItem/styles.module.css +0 -24
  276. package/lib/theme/ResponseSamples/styles.module.css +0 -7
  277. package/lib/theme/SchemaItem/styles.module.css +0 -38
  278. package/lib/theme/SchemaTabs/styles.module.css +0 -110
  279. package/lib/theme/styles.css +0 -520
  280. package/lib/theme-classic.d.ts +0 -13
  281. package/lib/theme-openapi.d.ts +0 -234
  282. package/lib/theme-translations.d.ts +0 -9
  283. package/lib-next/index.js +0 -29
  284. package/lib-next/markdown/createDescription.js +0 -13
  285. package/lib-next/markdown/schema.js +0 -153
  286. package/lib-next/markdown/utils.js +0 -44
  287. package/lib-next/postman-code-generators.d.ts +0 -9
  288. package/lib-next/react-magic-dropzone.d.ts +0 -9
  289. package/lib-next/theme/ApiDemoPanel/Accept/index.js +0 -30
  290. package/lib-next/theme/ApiDemoPanel/Authorization/auth-types.js +0 -29
  291. package/lib-next/theme/ApiDemoPanel/Authorization/index.js +0 -142
  292. package/lib-next/theme/ApiDemoPanel/Body/index.js +0 -324
  293. package/lib-next/theme/ApiDemoPanel/CodeTabs/index.js +0 -201
  294. package/lib-next/theme/ApiDemoPanel/CodeTabs/styles.module.css +0 -17
  295. package/lib-next/theme/ApiDemoPanel/ContentType/index.js +0 -30
  296. package/lib-next/theme/ApiDemoPanel/Curl/index.js +0 -283
  297. package/lib-next/theme/ApiDemoPanel/Curl/styles.module.css +0 -84
  298. package/lib-next/theme/ApiDemoPanel/Execute/index.js +0 -167
  299. package/lib-next/theme/ApiDemoPanel/Export/index.js +0 -45
  300. package/lib-next/theme/ApiDemoPanel/FloatingButton/index.js +0 -22
  301. package/lib-next/theme/ApiDemoPanel/FloatingButton/styles.module.css +0 -26
  302. package/lib-next/theme/ApiDemoPanel/FormFileUpload/index.js +0 -106
  303. package/lib-next/theme/ApiDemoPanel/FormItem/index.js +0 -36
  304. package/lib-next/theme/ApiDemoPanel/FormItem/styles.module.css +0 -12
  305. package/lib-next/theme/ApiDemoPanel/FormMultiSelect/index.js +0 -45
  306. package/lib-next/theme/ApiDemoPanel/FormMultiSelect/styles.module.css +0 -38
  307. package/lib-next/theme/ApiDemoPanel/FormSelect/index.js +0 -26
  308. package/lib-next/theme/ApiDemoPanel/FormSelect/styles.module.css +0 -51
  309. package/lib-next/theme/ApiDemoPanel/FormTextInput/index.js +0 -24
  310. package/lib-next/theme/ApiDemoPanel/FormTextInput/styles.module.css +0 -21
  311. package/lib-next/theme/ApiDemoPanel/LiveEditor/index.js +0 -59
  312. package/lib-next/theme/ApiDemoPanel/LiveEditor/styles.module.css +0 -35
  313. package/lib-next/theme/ApiDemoPanel/MethodEndpoint/index.js +0 -53
  314. package/lib-next/theme/ApiDemoPanel/ParamOptions/index.js +0 -292
  315. package/lib-next/theme/ApiDemoPanel/Request/index.js +0 -60
  316. package/lib-next/theme/ApiDemoPanel/Request/styles.module.css +0 -18
  317. package/lib-next/theme/ApiDemoPanel/Response/index.js +0 -67
  318. package/lib-next/theme/ApiDemoPanel/Response/slice.js +0 -23
  319. package/lib-next/theme/ApiDemoPanel/SecuritySchemes/index.js +0 -274
  320. package/lib-next/theme/ApiDemoPanel/Server/index.js +0 -132
  321. package/lib-next/theme/ApiDemoPanel/Server/styles.module.css +0 -56
  322. package/lib-next/theme/ApiDemoPanel/index.js +0 -28
  323. package/lib-next/theme/ApiDemoPanel/storage-utils.js +0 -33
  324. package/lib-next/theme/ApiItem/Layout/index.js +0 -68
  325. package/lib-next/theme/ApiItem/Layout/styles.module.css +0 -17
  326. package/lib-next/theme/ApiItem/hooks.js +0 -10
  327. package/lib-next/theme/ApiItem/index.js +0 -155
  328. package/lib-next/theme/ApiItem/store.js +0 -38
  329. package/lib-next/theme/ApiLogo/index.js +0 -48
  330. package/lib-next/theme/ApiTabs/index.js +0 -277
  331. package/lib-next/theme/ApiTabs/styles.module.css +0 -120
  332. package/lib-next/theme/DiscriminatorTabs/index.js +0 -272
  333. package/lib-next/theme/DiscriminatorTabs/styles.module.css +0 -119
  334. package/lib-next/theme/MimeTabs/index.js +0 -295
  335. package/lib-next/theme/MimeTabs/styles.module.css +0 -126
  336. package/lib-next/theme/ParamsItem/index.js +0 -135
  337. package/lib-next/theme/ParamsItem/styles.module.css +0 -24
  338. package/lib-next/theme/ResponseSamples/index.js +0 -27
  339. package/lib-next/theme/ResponseSamples/styles.module.css +0 -7
  340. package/lib-next/theme/SchemaItem/index.js +0 -114
  341. package/lib-next/theme/SchemaItem/styles.module.css +0 -38
  342. package/lib-next/theme/SchemaTabs/index.js +0 -270
  343. package/lib-next/theme/SchemaTabs/styles.module.css +0 -110
  344. package/lib-next/theme/styles.css +0 -520
  345. package/lib-next/theme-classic.d.ts +0 -13
  346. package/lib-next/theme-openapi.d.ts +0 -234
  347. package/lib-next/theme-translations.d.ts +0 -9
  348. package/lib-next/types.js +0 -1
  349. package/src/theme/ApiDemoPanel/Body/json2xml.js +0 -43
  350. package/src/theme/ApiDemoPanel/CodeTabs/index.tsx +0 -239
  351. package/src/theme/ApiDemoPanel/CodeTabs/styles.module.css +0 -17
  352. package/src/theme/ApiDemoPanel/Curl/languages.json +0 -1386
  353. package/src/theme/ApiDemoPanel/Curl/styles.module.css +0 -84
  354. package/src/theme/ApiDemoPanel/Execute/index.tsx +0 -189
  355. package/src/theme/ApiDemoPanel/FloatingButton/styles.module.css +0 -26
  356. package/src/theme/ApiDemoPanel/FormItem/styles.module.css +0 -12
  357. package/src/theme/ApiDemoPanel/FormMultiSelect/styles.module.css +0 -38
  358. package/src/theme/ApiDemoPanel/FormTextInput/index.tsx +0 -34
  359. package/src/theme/ApiDemoPanel/FormTextInput/styles.module.css +0 -21
  360. package/src/theme/ApiDemoPanel/LiveEditor/index.tsx +0 -75
  361. package/src/theme/ApiDemoPanel/LiveEditor/styles.module.css +0 -35
  362. package/src/theme/ApiDemoPanel/MethodEndpoint/index.tsx +0 -62
  363. package/src/theme/ApiDemoPanel/ParamOptions/index.tsx +0 -326
  364. package/src/theme/ApiDemoPanel/Request/index.tsx +0 -71
  365. package/src/theme/ApiDemoPanel/Response/index.tsx +0 -75
  366. package/src/theme/ApiDemoPanel/Server/styles.module.css +0 -56
  367. package/src/theme/ApiDemoPanel/postman-collection.d.ts +0 -10
  368. package/src/theme/ApiDemoPanel/react-modal.d.ts +0 -8
  369. package/src/theme/ApiTabs/styles.module.css +0 -120
  370. package/src/theme/DiscriminatorTabs/styles.module.css +0 -119
  371. package/src/theme/MimeTabs/styles.module.css +0 -126
  372. package/src/theme/ParamsItem/styles.module.css +0 -24
  373. package/src/theme/ResponseSamples/styles.module.css +0 -7
  374. package/src/theme/SchemaItem/styles.module.css +0 -38
  375. package/src/theme/SchemaTabs/styles.module.css +0 -110
  376. package/src/theme/styles.css +0 -520
  377. /package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Body/json2xml.js +0 -0
  378. /package/{lib-next/theme/ApiDemoPanel/Curl → lib/theme/ApiExplorer/CodeSnippets}/languages.json +0 -0
  379. /package/src/theme/{ApiDemoPanel → ApiExplorer}/Accept/slice.ts +0 -0
  380. /package/src/theme/{ApiDemoPanel → ApiExplorer}/Authorization/auth-types.ts +0 -0
  381. /package/{lib/theme/ApiDemoPanel → src/theme/ApiExplorer}/Body/json2xml.js +0 -0
  382. /package/src/theme/{ApiDemoPanel → ApiExplorer}/Body/slice.ts +0 -0
  383. /package/{lib/theme/ApiDemoPanel/Curl → src/theme/ApiExplorer/CodeSnippets}/languages.json +0 -0
  384. /package/src/theme/{ApiDemoPanel → ApiExplorer}/ContentType/slice.ts +0 -0
  385. /package/src/theme/{ApiDemoPanel → ApiExplorer}/Export/index.tsx +0 -0
  386. /package/src/theme/{ApiDemoPanel → ApiExplorer}/ParamOptions/slice.ts +0 -0
  387. /package/src/theme/{ApiDemoPanel → ApiExplorer}/Server/slice.ts +0 -0
  388. /package/{lib-next/theme/ApiDemoPanel → src/theme/ApiExplorer}/postman-collection.d.ts +0 -0
  389. /package/{lib-next/theme/ApiDemoPanel → src/theme/ApiExplorer}/react-modal.d.ts +0 -0
  390. /package/src/theme/{ApiDemoPanel → ApiExplorer}/storage-utils.ts +0 -0
@@ -0,0 +1,47 @@
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 clsx from "clsx";
11
+
12
+ export default function CodeBlockLine({
13
+ line,
14
+ classNames,
15
+ showLineNumbers,
16
+ getLineProps,
17
+ getTokenProps,
18
+ }) {
19
+ if (line.length === 1 && line[0].content === "\n") {
20
+ line[0].content = "";
21
+ }
22
+ const lineProps = getLineProps({
23
+ line,
24
+ className: clsx(
25
+ classNames,
26
+ showLineNumbers && "openapi-explorer__code-block-code-line"
27
+ ),
28
+ });
29
+ const lineTokens = line.map((token, key) => (
30
+ <span key={key} {...getTokenProps({ token, key })} />
31
+ ));
32
+ return (
33
+ <span {...lineProps}>
34
+ {showLineNumbers ? (
35
+ <>
36
+ <span className="openapi-explorer__code-block-code-line-number" />
37
+ <span className="openapi-explorer__code-block-code-line-content">
38
+ {lineTokens}
39
+ </span>
40
+ </>
41
+ ) : (
42
+ lineTokens
43
+ )}
44
+ <br />
45
+ </span>
46
+ );
47
+ }
@@ -0,0 +1,10 @@
1
+ .openapi-explorer__code-block-word-wrap-btn-icon {
2
+ width: 1.2rem;
3
+ height: 1.2rem;
4
+ }
5
+
6
+ .openapi-explorer__code-block-word-wrap-btn--enabled {
7
+ .openapi-explorer__code-block-word-wrap-btn-icon {
8
+ color: var(--ifm-color-primary);
9
+ }
10
+ }
@@ -0,0 +1,44 @@
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 { translate } from "@docusaurus/Translate";
11
+ import clsx from "clsx";
12
+
13
+ export default function WordWrapButton({ className, onClick, isEnabled }) {
14
+ const title = translate({
15
+ id: "theme.CodeBlock.wordWrapToggle",
16
+ message: "Toggle word wrap",
17
+ description:
18
+ "The title attribute for toggle word wrapping button of code block lines",
19
+ });
20
+ return (
21
+ <button
22
+ type="button"
23
+ onClick={onClick}
24
+ className={clsx(
25
+ "clean-btn",
26
+ className,
27
+ isEnabled && "openapi-explorer__code-block-word-wrap-btn--enabled"
28
+ )}
29
+ aria-label={title}
30
+ title={title}
31
+ >
32
+ <svg
33
+ className="openapi-explorer__code-block-word-wrap-btn-icon"
34
+ viewBox="0 0 24 24"
35
+ aria-hidden="true"
36
+ >
37
+ <path
38
+ fill="currentColor"
39
+ d="M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"
40
+ />
41
+ </svg>
42
+ </button>
43
+ );
44
+ }
@@ -0,0 +1,40 @@
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, { isValidElement } from "react";
9
+
10
+ import useIsBrowser from "@docusaurus/useIsBrowser";
11
+ import ElementContent from "@theme/ApiExplorer/ApiCodeBlock/Content/Element";
12
+ import StringContent from "@theme/ApiExplorer/ApiCodeBlock/Content/String";
13
+ /**
14
+ * Best attempt to make the children a plain string so it is copyable. If there
15
+ * are react elements, we will not be able to copy the content, and it will
16
+ * return `children` as-is; otherwise, it concatenates the string children
17
+ * together.
18
+ */
19
+ function maybeStringifyChildren(children) {
20
+ if (React.Children.toArray(children).some((el) => isValidElement(el))) {
21
+ return children;
22
+ }
23
+ // The children is now guaranteed to be one/more plain strings
24
+ return Array.isArray(children) ? children.join("") : children;
25
+ }
26
+ export default function ApiCodeBlock({ children: rawChildren, ...props }) {
27
+ // The Prism theme on SSR is always the default theme but the site theme can
28
+ // be in a different mode. React hydration doesn't update DOM styles that come
29
+ // from SSR. Hence force a re-render after mounting to apply the current
30
+ // relevant styles.
31
+ const isBrowser = useIsBrowser();
32
+ const children = maybeStringifyChildren(rawChildren);
33
+ const CodeBlockComp =
34
+ typeof children === "string" ? StringContent : ElementContent;
35
+ return (
36
+ <CodeBlockComp key={String(isBrowser)} {...props}>
37
+ {children}
38
+ </CodeBlockComp>
39
+ );
40
+ }
@@ -7,9 +7,9 @@
7
7
 
8
8
  import React from "react";
9
9
 
10
- import FormItem from "@theme/ApiDemoPanel/FormItem";
11
- import FormSelect from "@theme/ApiDemoPanel/FormSelect";
12
- import FormTextInput from "@theme/ApiDemoPanel/FormTextInput";
10
+ import FormItem from "@theme/ApiExplorer/FormItem";
11
+ import FormSelect from "@theme/ApiExplorer/FormSelect";
12
+ import FormTextInput from "@theme/ApiExplorer/FormTextInput";
13
13
  import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
14
14
 
15
15
  import { setAuthData, setSelectedAuth } from "./slice";
@@ -6,7 +6,7 @@
6
6
  * ========================================================================== */
7
7
 
8
8
  import { createSlice, PayloadAction } from "@reduxjs/toolkit";
9
- import { createStorage, hashArray } from "@theme/ApiDemoPanel/storage-utils";
9
+ import { createStorage, hashArray } from "@theme/ApiExplorer/storage-utils";
10
10
  import {
11
11
  SecurityRequirementObject,
12
12
  SecuritySchemeObject,
@@ -7,13 +7,12 @@
7
7
 
8
8
  import React from "react";
9
9
 
10
- import json2xml from "@theme/ApiDemoPanel/Body/json2xml";
11
- import ContentType from "@theme/ApiDemoPanel/ContentType";
12
- import FormFileUpload from "@theme/ApiDemoPanel/FormFileUpload";
13
- import FormItem from "@theme/ApiDemoPanel/FormItem";
14
- import FormSelect from "@theme/ApiDemoPanel/FormSelect";
15
- import FormTextInput from "@theme/ApiDemoPanel/FormTextInput";
16
- import LiveApp from "@theme/ApiDemoPanel/LiveEditor";
10
+ import json2xml from "@theme/ApiExplorer/Body/json2xml";
11
+ import FormFileUpload from "@theme/ApiExplorer/FormFileUpload";
12
+ import FormItem from "@theme/ApiExplorer/FormItem";
13
+ import FormSelect from "@theme/ApiExplorer/FormSelect";
14
+ import FormTextInput from "@theme/ApiExplorer/FormTextInput";
15
+ import LiveApp from "@theme/ApiExplorer/LiveEditor";
17
16
  import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
18
17
  import SchemaTabs from "@theme/SchemaTabs";
19
18
  import TabItem from "@theme/TabItem";
@@ -31,9 +30,16 @@ import {
31
30
  export interface Props {
32
31
  jsonRequestBodyExample: string;
33
32
  requestBodyMetadata?: RequestBodyObject;
33
+ methods?: any;
34
+ required?: boolean;
34
35
  }
35
36
 
36
- function BodyWrap({ requestBodyMetadata, jsonRequestBodyExample }: Props) {
37
+ function BodyWrap({
38
+ requestBodyMetadata,
39
+ jsonRequestBodyExample,
40
+ methods,
41
+ required,
42
+ }: Props) {
37
43
  const contentType = useTypedSelector((state: any) => state.contentType.value);
38
44
 
39
45
  // NOTE: We used to check if body was required, but opted to always show the request body
@@ -45,20 +51,21 @@ function BodyWrap({ requestBodyMetadata, jsonRequestBodyExample }: Props) {
45
51
  }
46
52
 
47
53
  return (
48
- <>
49
- <ContentType />
50
- <Body
51
- requestBodyMetadata={requestBodyMetadata}
52
- jsonRequestBodyExample={jsonRequestBodyExample}
53
- />
54
- </>
54
+ <Body
55
+ requestBodyMetadata={requestBodyMetadata}
56
+ jsonRequestBodyExample={jsonRequestBodyExample}
57
+ required={required}
58
+ />
55
59
  );
56
60
  }
57
61
 
58
- function Body({ requestBodyMetadata, jsonRequestBodyExample }: Props) {
62
+ function Body({
63
+ requestBodyMetadata,
64
+ jsonRequestBodyExample,
65
+ methods,
66
+ required,
67
+ }: Props) {
59
68
  const contentType = useTypedSelector((state: any) => state.contentType.value);
60
- const required = requestBodyMetadata?.required;
61
-
62
69
  const dispatch = useTypedDispatch();
63
70
 
64
71
  // Lot's of possible content-types:
@@ -88,7 +95,7 @@ function Body({ requestBodyMetadata, jsonRequestBodyExample }: Props) {
88
95
 
89
96
  if (schema?.format === "binary") {
90
97
  return (
91
- <FormItem label="Body" required={required}>
98
+ <FormItem>
92
99
  <FormFileUpload
93
100
  placeholder={schema.description || "Body"}
94
101
  onChange={(file: any) => {
@@ -107,22 +114,14 @@ function Body({ requestBodyMetadata, jsonRequestBodyExample }: Props) {
107
114
  </FormItem>
108
115
  );
109
116
  }
110
-
111
117
  if (
112
118
  (contentType === "multipart/form-data" ||
113
119
  contentType === "application/x-www-form-urlencoded") &&
114
120
  schema?.type === "object"
115
121
  ) {
116
122
  return (
117
- <FormItem label="Body" required={required}>
118
- <div
119
- style={{
120
- marginTop: "calc(var(--ifm-pre-padding) / 2)",
121
- borderRadius: "4px",
122
- padding: "var(--ifm-pre-padding)",
123
- border: "1px solid var(--openapi-monaco-border-color)",
124
- }}
125
- >
123
+ <FormItem className="openapi-explorer__form-item-body-container">
124
+ <div>
126
125
  {Object.entries(schema.properties ?? {}).map(([key, val]: any) => {
127
126
  if (val.format === "binary") {
128
127
  return (
@@ -196,6 +195,11 @@ function Body({ requestBodyMetadata, jsonRequestBodyExample }: Props) {
196
195
  }
197
196
  >
198
197
  <FormTextInput
198
+ paramName={key}
199
+ isRequired={
200
+ Array.isArray(schema.required) &&
201
+ schema.required.includes(key)
202
+ }
199
203
  placeholder={val.description || key}
200
204
  onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
201
205
  dispatch(
@@ -216,7 +220,10 @@ function Body({ requestBodyMetadata, jsonRequestBodyExample }: Props) {
216
220
  let exampleBody;
217
221
  let examplesBodies = [] as any;
218
222
 
219
- if (contentType === "application/json" || contentType.endsWith("+json")) {
223
+ if (
224
+ contentType.includes("application/json") ||
225
+ contentType.endsWith("+json")
226
+ ) {
220
227
  if (jsonRequestBodyExample) {
221
228
  defaultBody = JSON.stringify(jsonRequestBodyExample, null, 2);
222
229
  }
@@ -282,16 +289,26 @@ function Body({ requestBodyMetadata, jsonRequestBodyExample }: Props) {
282
289
 
283
290
  if (exampleBody) {
284
291
  return (
285
- <FormItem label="Body" required={required}>
286
- <SchemaTabs lazy>
287
- <TabItem label="Default" value="default" default>
288
- <LiveApp action={dispatch} language={language}>
292
+ <FormItem>
293
+ <SchemaTabs className="openapi-tabs__schema" lazy>
294
+ {/* @ts-ignore */}
295
+ <TabItem
296
+ label="Example (from schema)"
297
+ value="Example (from schema)"
298
+ default
299
+ >
300
+ <LiveApp action={dispatch} language={language} required={required}>
289
301
  {defaultBody}
290
302
  </LiveApp>
291
303
  </TabItem>
304
+ {/* @ts-ignore */}
292
305
  <TabItem label="Example" value="example">
293
306
  {exampleBody && (
294
- <LiveApp action={dispatch} language={language}>
307
+ <LiveApp
308
+ action={dispatch}
309
+ language={language}
310
+ required={required}
311
+ >
295
312
  {exampleBody}
296
313
  </LiveApp>
297
314
  )}
@@ -303,15 +320,21 @@ function Body({ requestBodyMetadata, jsonRequestBodyExample }: Props) {
303
320
 
304
321
  if (examplesBodies && examplesBodies.length > 0) {
305
322
  return (
306
- <FormItem label="Body" required={required}>
307
- <SchemaTabs lazy>
308
- <TabItem label="Default" value="default" default>
309
- <LiveApp action={dispatch} language={language}>
323
+ <FormItem className="openapi-explorer__form-item-body-container">
324
+ <SchemaTabs className="openapi-tabs__schema" lazy>
325
+ {/* @ts-ignore */}
326
+ <TabItem
327
+ label="Example (from schema)"
328
+ value="Example (from schema)"
329
+ default
330
+ >
331
+ <LiveApp action={dispatch} language={language} required={required}>
310
332
  {defaultBody}
311
333
  </LiveApp>
312
334
  </TabItem>
313
335
  {examplesBodies.map((example: any) => {
314
336
  return (
337
+ // @ts-ignore
315
338
  <TabItem
316
339
  label={example.label}
317
340
  value={example.label}
@@ -332,8 +355,8 @@ function Body({ requestBodyMetadata, jsonRequestBodyExample }: Props) {
332
355
  }
333
356
 
334
357
  return (
335
- <FormItem label="Body" required={required}>
336
- <LiveApp action={dispatch} language={language}>
358
+ <FormItem>
359
+ <LiveApp action={dispatch} language={language} required={required}>
337
360
  {defaultBody}
338
361
  </LiveApp>
339
362
  </FormItem>
@@ -10,21 +10,19 @@ import React, { useState, useEffect } from "react";
10
10
  import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
11
11
  import codegen from "@paloaltonetworks/postman-code-generators";
12
12
  import sdk from "@paloaltonetworks/postman-collection";
13
- import buildPostmanRequest from "@theme/ApiDemoPanel/buildPostmanRequest";
14
- import CodeTabs from "@theme/ApiDemoPanel/CodeTabs";
13
+ import ApiCodeBlock from "@theme/ApiExplorer/ApiCodeBlock";
14
+ import buildPostmanRequest from "@theme/ApiExplorer/buildPostmanRequest";
15
+ import CodeTabs from "@theme/ApiExplorer/CodeTabs";
15
16
  import { useTypedSelector } from "@theme/ApiItem/hooks";
16
- import CodeBlock from "@theme/CodeBlock";
17
- import clsx from "clsx";
18
17
  import merge from "lodash/merge";
19
18
 
20
- import styles from "./styles.module.css";
21
-
22
19
  export interface Language {
23
- highlight?: string;
20
+ highlight: string;
24
21
  language: string;
25
- logoClass?: string;
26
- variant?: string;
27
- options?: { [key: string]: boolean };
22
+ logoClass: string;
23
+ variant: string;
24
+ variants: string[];
25
+ options: { [key: string]: boolean };
28
26
  source?: string;
29
27
  }
30
28
 
@@ -39,6 +37,7 @@ export const languageSet: Language[] = [
39
37
  trimRequestBody: true,
40
38
  },
41
39
  variant: "cURL",
40
+ variants: ["curl"],
42
41
  },
43
42
  {
44
43
  highlight: "python",
@@ -49,6 +48,7 @@ export const languageSet: Language[] = [
49
48
  trimRequestBody: true,
50
49
  },
51
50
  variant: "requests",
51
+ variants: ["requests", "http.client"],
52
52
  },
53
53
  {
54
54
  highlight: "go",
@@ -59,6 +59,7 @@ export const languageSet: Language[] = [
59
59
  trimRequestBody: true,
60
60
  },
61
61
  variant: "native",
62
+ variants: ["native"],
62
63
  },
63
64
  {
64
65
  highlight: "javascript",
@@ -70,6 +71,7 @@ export const languageSet: Language[] = [
70
71
  trimRequestBody: true,
71
72
  },
72
73
  variant: "axios",
74
+ variants: ["axios", "native", "request", "unirest"],
73
75
  },
74
76
  {
75
77
  highlight: "ruby",
@@ -80,6 +82,7 @@ export const languageSet: Language[] = [
80
82
  trimRequestBody: true,
81
83
  },
82
84
  variant: "Net::HTTP",
85
+ variants: ["net::http"],
83
86
  },
84
87
  {
85
88
  highlight: "csharp",
@@ -90,6 +93,7 @@ export const languageSet: Language[] = [
90
93
  trimRequestBody: true,
91
94
  },
92
95
  variant: "RestSharp",
96
+ variants: ["restsharp", "httpclient"],
93
97
  },
94
98
  {
95
99
  highlight: "php",
@@ -100,6 +104,7 @@ export const languageSet: Language[] = [
100
104
  trimRequestBody: true,
101
105
  },
102
106
  variant: "cURL",
107
+ variants: ["curl", "guzzle", "pecl_http", "http_request2"],
103
108
  },
104
109
  {
105
110
  highlight: "java",
@@ -110,6 +115,7 @@ export const languageSet: Language[] = [
110
115
  trimRequestBody: true,
111
116
  },
112
117
  variant: "OkHttp",
118
+ variants: ["okhttp", "unirest"],
113
119
  },
114
120
  {
115
121
  highlight: "powershell",
@@ -120,6 +126,7 @@ export const languageSet: Language[] = [
120
126
  trimRequestBody: true,
121
127
  },
122
128
  variant: "RestMethod",
129
+ variants: ["restmethod"],
123
130
  },
124
131
  ];
125
132
 
@@ -130,17 +137,13 @@ export interface Props {
130
137
 
131
138
  function CodeTab({ children, hidden, className, onClick }: any): JSX.Element {
132
139
  return (
133
- <div
134
- role="tabpanel"
135
- className={clsx(styles.tabItem, className)}
136
- {...{ hidden }}
137
- >
140
+ <div role="tabpanel" className={className} {...{ hidden }}>
138
141
  {children}
139
142
  </div>
140
143
  );
141
144
  }
142
145
 
143
- function Curl({ postman, codeSamples }: Props) {
146
+ function CodeSnippets({ postman, codeSamples }: Props) {
144
147
  // TODO: match theme for vscode.
145
148
 
146
149
  const { siteConfig } = useDocusaurusContext();
@@ -180,7 +183,7 @@ function Curl({ postman, codeSamples }: Props) {
180
183
  (lang) =>
181
184
  lang.language === localStorage.getItem("docusaurus.tab.code-samples")
182
185
  );
183
-
186
+ const [selectedVariant, setSelectedVariant] = useState();
184
187
  const [language, setLanguage] = useState(() => {
185
188
  // Return first index if only 1 user-defined language exists
186
189
  if (mergedLangs.length === 1) {
@@ -189,7 +192,6 @@ function Curl({ postman, codeSamples }: Props) {
189
192
  // Fall back to language in localStorage or first user-defined language
190
193
  return defaultLang[0] ?? mergedLangs[0];
191
194
  });
192
-
193
195
  const [codeText, setCodeText] = useState("");
194
196
 
195
197
  useEffect(() => {
@@ -205,7 +207,6 @@ function Curl({ postman, codeSamples }: Props) {
205
207
  server,
206
208
  auth,
207
209
  });
208
-
209
210
  codegen.convert(
210
211
  language.language,
211
212
  language.variant,
@@ -271,32 +272,91 @@ function Curl({ postman, codeSamples }: Props) {
271
272
  mergedLangs,
272
273
  ]);
273
274
 
275
+ useEffect(() => {
276
+ if (selectedVariant && selectedVariant !== language.variant) {
277
+ const postmanRequest = buildPostmanRequest(postman, {
278
+ queryParams,
279
+ pathParams,
280
+ cookieParams,
281
+ contentType,
282
+ accept,
283
+ headerParams,
284
+ body,
285
+ server,
286
+ auth,
287
+ });
288
+ codegen.convert(
289
+ language.language,
290
+ selectedVariant,
291
+ postmanRequest,
292
+ language.options,
293
+ (error: any, snippet: string) => {
294
+ if (error) {
295
+ return;
296
+ }
297
+ setCodeText(snippet);
298
+ }
299
+ );
300
+ }
301
+ });
302
+
274
303
  if (language === undefined) {
275
304
  return null;
276
305
  }
277
306
 
278
307
  return (
279
308
  <>
280
- <CodeTabs groupId="code-samples" action={setLanguage}>
309
+ <CodeTabs
310
+ groupId="code-samples"
311
+ action={{
312
+ setLanguage: setLanguage,
313
+ setSelectedVariant: setSelectedVariant,
314
+ }}
315
+ lazy
316
+ >
281
317
  {mergedLangs.map((lang) => {
282
318
  return (
283
319
  <CodeTab
284
320
  value={lang.language}
285
- label={""}
286
- key={
287
- lang.variant
288
- ? `${lang.language}-${lang.variant}`
289
- : lang.language
290
- }
291
- attributes={{ className: `code__tab--${lang.logoClass}` }}
321
+ label={lang.language}
322
+ key={lang.language}
323
+ attributes={{
324
+ className: `openapi-tabs__code-item--${lang.logoClass}`,
325
+ }}
292
326
  >
293
- <CodeBlock
294
- language={lang.highlight}
295
- className={styles.codeBlock}
296
- title={`${lang.language} / ${lang.variant}`}
327
+ <CodeTabs
328
+ className="openapi-tabs__code-container-inner"
329
+ action={{
330
+ setLanguage: setLanguage,
331
+ setSelectedVariant: setSelectedVariant,
332
+ }}
333
+ includeVariant={true}
334
+ currentLanguage={lang.language}
335
+ defaultValue={selectedVariant}
336
+ lazy
297
337
  >
298
- {codeText}
299
- </CodeBlock>
338
+ {lang.variants.map((variant) => {
339
+ return (
340
+ <CodeTab
341
+ value={variant.toLowerCase()}
342
+ label={variant.toUpperCase()}
343
+ key={`${lang.language}-${lang.variant}`}
344
+ attributes={{
345
+ className: `openapi-tabs__code-item--variant`,
346
+ }}
347
+ >
348
+ {/* @ts-ignore */}
349
+ <ApiCodeBlock
350
+ language={lang.highlight}
351
+ className="openapi-explorer__code-block"
352
+ showLineNumbers={true}
353
+ >
354
+ {codeText}
355
+ </ApiCodeBlock>
356
+ </CodeTab>
357
+ );
358
+ })}
359
+ </CodeTabs>
300
360
  </CodeTab>
301
361
  );
302
362
  })}
@@ -305,4 +365,4 @@ function Curl({ postman, codeSamples }: Props) {
305
365
  );
306
366
  }
307
367
 
308
- export default Curl;
368
+ export default CodeSnippets;