docusaurus-theme-openapi-docs 2.0.0-beta.2 → 2.0.0-beta.4

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 (361) hide show
  1. package/lib/index.d.ts +2 -0
  2. package/lib/index.js +53 -55
  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 +360 -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-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/CodeTabs/index.js +26 -8
  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/{src/theme/ApiDemoPanel → lib/theme/ApiExplorer}/FloatingButton/_FloatingButton.scss +4 -4
  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 → lib/theme/ApiExplorer}/FormFileUpload/_FormFileUpload.scss +6 -6
  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/{ApiDemoPanel → ApiExplorer}/FormMultiSelect/_FormMultiSelect.scss +9 -5
  61. package/lib/theme/ApiExplorer/FormMultiSelect/index.d.ts +9 -0
  62. package/lib/theme/ApiExplorer/FormMultiSelect/index.js +51 -0
  63. package/lib/theme/{ApiDemoPanel → ApiExplorer}/FormSelect/_FormSelect.scss +5 -5
  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/{src/theme/ApiDemoPanel → lib/theme/ApiExplorer}/LiveEditor/_LiveEditor.scss +2 -2
  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 +82 -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 → lib/theme/ApiExplorer}/ParamOptions/_ParamOptions.scss +15 -34
  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 +363 -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 +9 -8
  95. package/lib/theme/ApiExplorer/Response/_Response.scss +81 -0
  96. package/lib/theme/ApiExplorer/Response/index.d.ts +6 -0
  97. package/lib/theme/ApiExplorer/Response/index.js +184 -0
  98. package/lib/theme/ApiExplorer/Response/slice.d.ts +17 -0
  99. package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Response/slice.js +21 -12
  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 → lib/theme/ApiExplorer}/Server/_Server.scss +11 -1
  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 +36 -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 +144 -116
  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 +29 -22
  126. package/lib/theme/ApiTabs/index.js +4 -3
  127. package/lib/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +16 -13
  128. package/lib/theme/Markdown/Details/_Details.scss +82 -3
  129. package/lib/theme/MimeTabs/_MimeTabs.scss +13 -8
  130. package/lib/theme/MimeTabs/index.js +2 -2
  131. package/lib/theme/ParamsItem/_ParamsItem.scss +24 -9
  132. package/lib/theme/ParamsItem/index.js +9 -6
  133. package/lib/theme/SchemaItem/_SchemaItem.scss +47 -11
  134. package/lib/theme/SchemaItem/index.js +23 -12
  135. package/lib/theme/SchemaTabs/_SchemaTabs.scss +23 -17
  136. package/lib/theme/SchemaTabs/index.js +50 -54
  137. package/lib/theme/styles.scss +55 -18
  138. package/lib/types.d.ts +157 -0
  139. package/lib/types.js +8 -1
  140. package/package.json +13 -21
  141. package/src/index.ts +31 -40
  142. package/src/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/index.js +165 -0
  143. package/src/theme/ApiDemoPanel/ApiCodeBlock/Line/_Line.scss +46 -0
  144. package/src/theme/{ApiDemoPanel → ApiExplorer}/Accept/index.tsx +2 -2
  145. package/src/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
  146. package/src/theme/ApiExplorer/ApiCodeBlock/Container/index.js +29 -0
  147. package/src/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +30 -0
  148. package/src/theme/ApiExplorer/ApiCodeBlock/Content/String.js +134 -0
  149. package/src/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
  150. package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
  151. package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +74 -0
  152. package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
  153. package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +47 -0
  154. package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
  155. package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +156 -0
  156. package/src/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +46 -0
  157. package/src/theme/ApiExplorer/ApiCodeBlock/Line/index.js +47 -0
  158. package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
  159. package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +44 -0
  160. package/src/theme/ApiExplorer/ApiCodeBlock/index.js +40 -0
  161. package/src/theme/{ApiDemoPanel → ApiExplorer}/Authorization/index.tsx +3 -3
  162. package/src/theme/{ApiDemoPanel → ApiExplorer}/Authorization/slice.ts +1 -1
  163. package/src/theme/{ApiDemoPanel → ApiExplorer}/Body/index.tsx +54 -37
  164. package/src/theme/{ApiDemoPanel/Curl → ApiExplorer/CodeSnippets}/index.tsx +90 -25
  165. package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +291 -0
  166. package/{lib/theme/ApiDemoPanel → src/theme/ApiExplorer}/CodeTabs/index.js +26 -8
  167. package/src/theme/{ApiDemoPanel → ApiExplorer}/ContentType/index.tsx +2 -2
  168. package/{lib/theme/ApiDemoPanel → src/theme/ApiExplorer}/FloatingButton/_FloatingButton.scss +4 -4
  169. package/src/theme/{ApiDemoPanel → ApiExplorer}/FloatingButton/index.tsx +1 -1
  170. package/src/theme/{ApiDemoPanel → ApiExplorer}/FormFileUpload/_FormFileUpload.scss +6 -6
  171. package/src/theme/{ApiDemoPanel → ApiExplorer}/FormFileUpload/index.tsx +8 -4
  172. package/src/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
  173. package/src/theme/{ApiDemoPanel → ApiExplorer}/FormItem/index.tsx +9 -11
  174. package/{lib-next/theme/ApiDemoPanel → src/theme/ApiExplorer}/FormMultiSelect/_FormMultiSelect.scss +9 -5
  175. package/src/theme/{ApiDemoPanel → ApiExplorer}/FormMultiSelect/index.tsx +7 -2
  176. package/src/theme/{ApiDemoPanel → ApiExplorer}/FormSelect/_FormSelect.scss +5 -5
  177. package/src/theme/{ApiDemoPanel → ApiExplorer}/FormSelect/index.tsx +1 -1
  178. package/src/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
  179. package/src/theme/ApiExplorer/FormTextInput/index.tsx +80 -0
  180. package/{lib/theme/ApiDemoPanel → src/theme/ApiExplorer}/LiveEditor/_LiveEditor.scss +2 -2
  181. package/src/theme/ApiExplorer/LiveEditor/index.tsx +112 -0
  182. package/src/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
  183. package/src/theme/{ApiDemoPanel → ApiExplorer}/MethodEndpoint/index.tsx +12 -9
  184. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +156 -0
  185. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +64 -0
  186. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +86 -0
  187. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +65 -0
  188. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.tsx +38 -0
  189. package/{lib-next/theme/ApiDemoPanel → src/theme/ApiExplorer}/ParamOptions/_ParamOptions.scss +15 -34
  190. package/src/theme/ApiExplorer/ParamOptions/index.tsx +145 -0
  191. package/src/theme/ApiExplorer/Request/_Request.scss +122 -0
  192. package/src/theme/ApiExplorer/Request/index.tsx +286 -0
  193. package/src/theme/{ApiDemoPanel/Execute → ApiExplorer/Request}/makeRequest.ts +8 -5
  194. package/src/theme/ApiExplorer/Response/_Response.scss +81 -0
  195. package/src/theme/{ApiDemoPanel → ApiExplorer}/Response/index.tsx +53 -33
  196. package/src/theme/{ApiDemoPanel → ApiExplorer}/SecuritySchemes/index.tsx +5 -3
  197. package/{lib-next/theme/ApiDemoPanel → src/theme/ApiExplorer}/Server/_Server.scss +11 -1
  198. package/src/theme/{ApiDemoPanel → ApiExplorer}/Server/index.tsx +13 -16
  199. package/src/theme/{ApiDemoPanel → ApiExplorer}/buildPostmanRequest.ts +2 -2
  200. package/src/theme/{ApiDemoPanel → ApiExplorer}/index.tsx +10 -12
  201. package/src/theme/{ApiDemoPanel → ApiExplorer}/persistanceMiddleware.ts +1 -1
  202. package/src/theme/ApiItem/index.tsx +17 -8
  203. package/src/theme/ApiItem/store.ts +7 -7
  204. package/src/theme/ApiTabs/_ApiTabs.scss +29 -22
  205. package/src/theme/ApiTabs/index.js +4 -3
  206. package/src/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +16 -13
  207. package/src/theme/Markdown/Details/_Details.scss +82 -3
  208. package/src/theme/MimeTabs/_MimeTabs.scss +13 -8
  209. package/src/theme/MimeTabs/index.js +2 -2
  210. package/src/theme/ParamsItem/_ParamsItem.scss +24 -9
  211. package/src/theme/ParamsItem/index.js +9 -6
  212. package/src/theme/SchemaItem/_SchemaItem.scss +47 -11
  213. package/src/theme/SchemaItem/index.js +23 -12
  214. package/src/theme/SchemaTabs/_SchemaTabs.scss +23 -17
  215. package/src/theme/SchemaTabs/index.js +50 -54
  216. package/src/theme/styles.scss +55 -18
  217. package/src/theme-openapi.d.ts +89 -46
  218. package/tsconfig.json +6 -3
  219. package/lib/postman-code-generators.d.ts +0 -9
  220. package/lib/react-magic-dropzone.d.ts +0 -9
  221. package/lib/theme/ApiDemoPanel/Accept/index.js +0 -32
  222. package/lib/theme/ApiDemoPanel/Accept/slice.js +0 -31
  223. package/lib/theme/ApiDemoPanel/Authorization/index.js +0 -107
  224. package/lib/theme/ApiDemoPanel/Authorization/slice.js +0 -123
  225. package/lib/theme/ApiDemoPanel/Body/index.js +0 -262
  226. package/lib/theme/ApiDemoPanel/Body/slice.js +0 -102
  227. package/lib/theme/ApiDemoPanel/CodeTabs/_CodeTabs.scss +0 -238
  228. package/lib/theme/ApiDemoPanel/ContentType/index.js +0 -32
  229. package/lib/theme/ApiDemoPanel/ContentType/slice.js +0 -31
  230. package/lib/theme/ApiDemoPanel/Curl/index.js +0 -238
  231. package/lib/theme/ApiDemoPanel/Execute/index.js +0 -155
  232. package/lib/theme/ApiDemoPanel/Execute/makeRequest.js +0 -181
  233. package/lib/theme/ApiDemoPanel/Export/index.js +0 -47
  234. package/lib/theme/ApiDemoPanel/FloatingButton/index.js +0 -29
  235. package/lib/theme/ApiDemoPanel/FormFileUpload/_FormFileUpload.scss +0 -72
  236. package/lib/theme/ApiDemoPanel/FormFileUpload/index.js +0 -82
  237. package/lib/theme/ApiDemoPanel/FormItem/_FormItem.scss +0 -12
  238. package/lib/theme/ApiDemoPanel/FormItem/index.js +0 -37
  239. package/lib/theme/ApiDemoPanel/FormMultiSelect/index.js +0 -44
  240. package/lib/theme/ApiDemoPanel/FormSelect/index.js +0 -33
  241. package/lib/theme/ApiDemoPanel/FormTextInput/_FormTextInput.scss +0 -15
  242. package/lib/theme/ApiDemoPanel/FormTextInput/index.js +0 -27
  243. package/lib/theme/ApiDemoPanel/LiveEditor/index.js +0 -61
  244. package/lib/theme/ApiDemoPanel/MethodEndpoint/_MethodEndpoint.scss +0 -6
  245. package/lib/theme/ApiDemoPanel/MethodEndpoint/index.js +0 -73
  246. package/lib/theme/ApiDemoPanel/ParamOptions/_ParamOptions.scss +0 -141
  247. package/lib/theme/ApiDemoPanel/ParamOptions/index.js +0 -215
  248. package/lib/theme/ApiDemoPanel/ParamOptions/slice.js +0 -34
  249. package/lib/theme/ApiDemoPanel/Request/_Request.scss +0 -48
  250. package/lib/theme/ApiDemoPanel/Request/index.js +0 -66
  251. package/lib/theme/ApiDemoPanel/Response/_Response.scss +0 -27
  252. package/lib/theme/ApiDemoPanel/Response/index.js +0 -100
  253. package/lib/theme/ApiDemoPanel/Response/slice.js +0 -56
  254. package/lib/theme/ApiDemoPanel/SecuritySchemes/index.js +0 -257
  255. package/lib/theme/ApiDemoPanel/Server/_Server.scss +0 -16
  256. package/lib/theme/ApiDemoPanel/Server/index.js +0 -103
  257. package/lib/theme/ApiDemoPanel/Server/slice.js +0 -40
  258. package/lib/theme/ApiDemoPanel/buildPostmanRequest.js +0 -303
  259. package/lib/theme/ApiDemoPanel/index.js +0 -35
  260. package/lib/theme/ApiDemoPanel/persistanceMiddleware.js +0 -59
  261. package/lib/theme/ApiDemoPanel/postman-collection.d.ts +0 -10
  262. package/lib/theme/ApiDemoPanel/react-modal.d.ts +0 -8
  263. package/lib/theme-classic.d.ts +0 -13
  264. package/lib/theme-openapi.d.ts +0 -234
  265. package/lib/theme-translations.d.ts +0 -9
  266. package/lib-next/index.js +0 -68
  267. package/lib-next/markdown/createDescription.js +0 -13
  268. package/lib-next/markdown/schema.js +0 -153
  269. package/lib-next/markdown/utils.js +0 -44
  270. package/lib-next/postman-code-generators.d.ts +0 -9
  271. package/lib-next/react-magic-dropzone.d.ts +0 -9
  272. package/lib-next/theme/ApiDemoPanel/Accept/index.js +0 -30
  273. package/lib-next/theme/ApiDemoPanel/Authorization/auth-types.js +0 -29
  274. package/lib-next/theme/ApiDemoPanel/Authorization/index.js +0 -142
  275. package/lib-next/theme/ApiDemoPanel/Body/index.js +0 -328
  276. package/lib-next/theme/ApiDemoPanel/CodeTabs/_CodeTabs.scss +0 -238
  277. package/lib-next/theme/ApiDemoPanel/ContentType/index.js +0 -30
  278. package/lib-next/theme/ApiDemoPanel/Curl/index.js +0 -281
  279. package/lib-next/theme/ApiDemoPanel/Execute/index.js +0 -178
  280. package/lib-next/theme/ApiDemoPanel/Export/index.js +0 -45
  281. package/lib-next/theme/ApiDemoPanel/FloatingButton/_FloatingButton.scss +0 -25
  282. package/lib-next/theme/ApiDemoPanel/FloatingButton/index.js +0 -21
  283. package/lib-next/theme/ApiDemoPanel/FormFileUpload/index.js +0 -107
  284. package/lib-next/theme/ApiDemoPanel/FormItem/_FormItem.scss +0 -12
  285. package/lib-next/theme/ApiDemoPanel/FormItem/index.js +0 -35
  286. package/lib-next/theme/ApiDemoPanel/FormMultiSelect/index.js +0 -44
  287. package/lib-next/theme/ApiDemoPanel/FormSelect/_FormSelect.scss +0 -43
  288. package/lib-next/theme/ApiDemoPanel/FormSelect/index.js +0 -29
  289. package/lib-next/theme/ApiDemoPanel/FormTextInput/_FormTextInput.scss +0 -15
  290. package/lib-next/theme/ApiDemoPanel/FormTextInput/index.js +0 -23
  291. package/lib-next/theme/ApiDemoPanel/LiveEditor/_LiveEditor.scss +0 -15
  292. package/lib-next/theme/ApiDemoPanel/LiveEditor/index.js +0 -58
  293. package/lib-next/theme/ApiDemoPanel/MethodEndpoint/_MethodEndpoint.scss +0 -6
  294. package/lib-next/theme/ApiDemoPanel/MethodEndpoint/index.js +0 -68
  295. package/lib-next/theme/ApiDemoPanel/ParamOptions/index.js +0 -299
  296. package/lib-next/theme/ApiDemoPanel/Request/_Request.scss +0 -48
  297. package/lib-next/theme/ApiDemoPanel/Request/index.js +0 -59
  298. package/lib-next/theme/ApiDemoPanel/Response/_Response.scss +0 -27
  299. package/lib-next/theme/ApiDemoPanel/Response/index.js +0 -122
  300. package/lib-next/theme/ApiDemoPanel/SecuritySchemes/index.js +0 -274
  301. package/lib-next/theme/ApiDemoPanel/Server/index.js +0 -131
  302. package/lib-next/theme/ApiDemoPanel/index.js +0 -25
  303. package/lib-next/theme/ApiDemoPanel/storage-utils.js +0 -33
  304. package/lib-next/theme/ApiItem/Layout/index.js +0 -68
  305. package/lib-next/theme/ApiItem/Layout/styles.module.css +0 -17
  306. package/lib-next/theme/ApiItem/hooks.js +0 -10
  307. package/lib-next/theme/ApiItem/index.js +0 -150
  308. package/lib-next/theme/ApiItem/store.js +0 -38
  309. package/lib-next/theme/ApiLogo/index.js +0 -48
  310. package/lib-next/theme/ApiTabs/_ApiTabs.scss +0 -133
  311. package/lib-next/theme/ApiTabs/index.js +0 -191
  312. package/lib-next/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +0 -94
  313. package/lib-next/theme/DiscriminatorTabs/index.js +0 -185
  314. package/lib-next/theme/Markdown/Details/_Details.scss +0 -40
  315. package/lib-next/theme/MimeTabs/_MimeTabs.scss +0 -64
  316. package/lib-next/theme/MimeTabs/index.js +0 -221
  317. package/lib-next/theme/ParamsItem/_ParamsItem.scss +0 -39
  318. package/lib-next/theme/ParamsItem/index.js +0 -133
  319. package/lib-next/theme/ResponseSamples/_ResponseSamples.scss +0 -3
  320. package/lib-next/theme/ResponseSamples/index.js +0 -22
  321. package/lib-next/theme/SchemaItem/_SchemaItem.scss +0 -53
  322. package/lib-next/theme/SchemaItem/index.js +0 -112
  323. package/lib-next/theme/SchemaTabs/_SchemaTabs.scss +0 -58
  324. package/lib-next/theme/SchemaTabs/index.js +0 -186
  325. package/lib-next/theme/styles.scss +0 -123
  326. package/lib-next/theme-classic.d.ts +0 -13
  327. package/lib-next/theme-openapi.d.ts +0 -234
  328. package/lib-next/theme-translations.d.ts +0 -9
  329. package/lib-next/types.js +0 -1
  330. package/src/theme/ApiDemoPanel/Body/json2xml.js +0 -43
  331. package/src/theme/ApiDemoPanel/CodeTabs/_CodeTabs.scss +0 -238
  332. package/src/theme/ApiDemoPanel/CodeTabs/index.js +0 -156
  333. package/src/theme/ApiDemoPanel/Curl/languages.json +0 -1386
  334. package/src/theme/ApiDemoPanel/Execute/index.tsx +0 -200
  335. package/src/theme/ApiDemoPanel/FormItem/_FormItem.scss +0 -12
  336. package/src/theme/ApiDemoPanel/FormMultiSelect/_FormMultiSelect.scss +0 -26
  337. package/src/theme/ApiDemoPanel/FormTextInput/_FormTextInput.scss +0 -15
  338. package/src/theme/ApiDemoPanel/FormTextInput/index.tsx +0 -32
  339. package/src/theme/ApiDemoPanel/LiveEditor/index.tsx +0 -73
  340. package/src/theme/ApiDemoPanel/MethodEndpoint/_MethodEndpoint.scss +0 -6
  341. package/src/theme/ApiDemoPanel/ParamOptions/index.tsx +0 -333
  342. package/src/theme/ApiDemoPanel/Request/_Request.scss +0 -48
  343. package/src/theme/ApiDemoPanel/Request/index.tsx +0 -69
  344. package/src/theme/ApiDemoPanel/Response/_Response.scss +0 -27
  345. package/src/theme/ApiDemoPanel/postman-collection.d.ts +0 -10
  346. package/src/theme/ApiDemoPanel/react-modal.d.ts +0 -8
  347. /package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Body/json2xml.js +0 -0
  348. /package/{lib-next/theme/ApiDemoPanel/Curl → lib/theme/ApiExplorer/CodeSnippets}/languages.json +0 -0
  349. /package/src/theme/{ApiDemoPanel → ApiExplorer}/Accept/slice.ts +0 -0
  350. /package/src/theme/{ApiDemoPanel → ApiExplorer}/Authorization/auth-types.ts +0 -0
  351. /package/{lib/theme/ApiDemoPanel → src/theme/ApiExplorer}/Body/json2xml.js +0 -0
  352. /package/src/theme/{ApiDemoPanel → ApiExplorer}/Body/slice.ts +0 -0
  353. /package/{lib/theme/ApiDemoPanel/Curl → src/theme/ApiExplorer/CodeSnippets}/languages.json +0 -0
  354. /package/src/theme/{ApiDemoPanel → ApiExplorer}/ContentType/slice.ts +0 -0
  355. /package/src/theme/{ApiDemoPanel → ApiExplorer}/Export/index.tsx +0 -0
  356. /package/src/theme/{ApiDemoPanel → ApiExplorer}/ParamOptions/slice.ts +0 -0
  357. /package/src/theme/{ApiDemoPanel → ApiExplorer}/Response/slice.ts +0 -0
  358. /package/src/theme/{ApiDemoPanel → ApiExplorer}/Server/slice.ts +0 -0
  359. /package/{lib-next/theme/ApiDemoPanel → src/theme/ApiExplorer}/postman-collection.d.ts +0 -0
  360. /package/{lib-next/theme/ApiDemoPanel → src/theme/ApiExplorer}/react-modal.d.ts +0 -0
  361. /package/src/theme/{ApiDemoPanel → ApiExplorer}/storage-utils.ts +0 -0
@@ -1,44 +0,0 @@
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
- function FormMultiSelect({ value, options, onChange }) {
10
- if (options.length === 0) {
11
- return null;
12
- }
13
- let height;
14
- if (options.length < 6) {
15
- const selectPadding = 12 * 2;
16
- const rawHeight = options.length * 29;
17
- const innerMargins = 4 * options.length - 1;
18
- const outerMargins = 4 * 2;
19
- const mysteryScroll = 1;
20
- height =
21
- rawHeight + innerMargins + outerMargins + selectPadding + mysteryScroll;
22
- }
23
- return (
24
- <select
25
- style={{
26
- height: height,
27
- }}
28
- className="openapi-demo__multi-select-input"
29
- value={value}
30
- onChange={onChange}
31
- size={Math.min(6, options.length + 1)}
32
- multiple
33
- >
34
- {options.map((option) => {
35
- return (
36
- <option key={option} value={option}>
37
- {option}
38
- </option>
39
- );
40
- })}
41
- </select>
42
- );
43
- }
44
- export default FormMultiSelect;
@@ -1,43 +0,0 @@
1
- html[data-theme="dark"] .openapi-demo__select-input {
2
- margin-top: calc(var(--ifm-pre-padding) / 2);
3
- background-color: var(--openapi-input-background);
4
- border: none;
5
- outline: none;
6
- width: 100%;
7
- font-size: var(--ifm-code-font-size);
8
- color: var(--ifm-pre-color);
9
-
10
- border-radius: 4px;
11
- -moz-appearance: none;
12
- -webkit-appearance: none;
13
- appearance: none;
14
-
15
- background-image: url('data:image/svg+xml;charset=US-ASCII,<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" fill="white"><path d="M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"></path></svg>');
16
- background-repeat: no-repeat;
17
- background-position: right var(--ifm-pre-padding) top 50%;
18
- background-size: auto auto;
19
- }
20
-
21
- .openapi-demo__select-input {
22
- width: 100%;
23
- margin-top: calc(var(--ifm-pre-padding) / 2);
24
- padding: 12px 48px 12px var(--ifm-pre-padding);
25
- border: none;
26
- outline: none;
27
- border-radius: 4px;
28
- background-color: var(--openapi-input-background);
29
- font-size: var(--ifm-code-font-size);
30
- color: var(--ifm-pre-color);
31
- -moz-appearance: none;
32
- -webkit-appearance: none;
33
- appearance: none;
34
-
35
- background-image: url('data:image/svg+xml;charset=US-ASCII,<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"></path></svg>');
36
- background-repeat: no-repeat;
37
- background-position: right var(--ifm-pre-padding) top 50%;
38
- background-size: auto auto;
39
-
40
- &:focus {
41
- box-shadow: inset 0px 0px 0px 2px var(--openapi-input-border);
42
- }
43
- }
@@ -1,29 +0,0 @@
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
- function FormSelect({ value, options, onChange }) {
10
- if (!Array.isArray(options) || options.length === 0) {
11
- return null;
12
- }
13
- return (
14
- <select
15
- className="openapi-demo__select-input"
16
- value={value}
17
- onChange={onChange}
18
- >
19
- {options.map((option) => {
20
- return (
21
- <option key={option} value={option}>
22
- {option}
23
- </option>
24
- );
25
- })}
26
- </select>
27
- );
28
- }
29
- export default FormSelect;
@@ -1,15 +0,0 @@
1
- .openapi-demo__input {
2
- margin-top: calc(var(--ifm-pre-padding) / 2);
3
- background-color: var(--openapi-input-background);
4
- border: none;
5
- outline: none;
6
- width: 100%;
7
- font-size: var(--ifm-code-font-size);
8
- color: var(--ifm-pre-color);
9
- padding: 12px var(--ifm-pre-padding);
10
- border-radius: 4px;
11
-
12
- &:focus {
13
- box-shadow: inset 0px 0px 0px 2px var(--openapi-input-border);
14
- }
15
- }
@@ -1,23 +0,0 @@
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
- function FormTextInput({ value, placeholder, password, onChange }) {
10
- placeholder = placeholder?.split("\n")[0];
11
- return (
12
- <input
13
- className="openapi-demo__input"
14
- type={password ? "password" : "text"}
15
- placeholder={placeholder}
16
- title={placeholder}
17
- value={value}
18
- onChange={onChange}
19
- autoComplete="off"
20
- />
21
- );
22
- }
23
- export default FormTextInput;
@@ -1,15 +0,0 @@
1
- .openapi-demo__playground-container {
2
- margin-top: 1rem;
3
- margin-bottom: var(--ifm-leading);
4
- border-radius: var(--ifm-global-radius);
5
- box-shadow: var(--ifm-global-shadow-lw);
6
- overflow: auto;
7
- max-height: 500px;
8
- }
9
-
10
- .openapi-demo__playground-editor {
11
- font: var(--ifm-code-font-size) / var(--ifm-pre-line-height)
12
- var(--ifm-font-family-monospace) !important;
13
- /* rtl:ignore */
14
- direction: ltr;
15
- }
@@ -1,58 +0,0 @@
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, { useEffect, useState } from "react";
9
- import { usePrismTheme } from "@docusaurus/theme-common";
10
- import useIsBrowser from "@docusaurus/useIsBrowser";
11
- import { setStringRawBody } from "@theme/ApiDemoPanel/Body/slice";
12
- import { LiveProvider, LiveEditor, withLive } from "react-live";
13
- function Live({ onEdit }) {
14
- const isBrowser = useIsBrowser();
15
- const [editorDisabled, setEditorDisabled] = useState(false);
16
-
17
- // TODO: Temporary solution for disabling tab key
18
- const handleKeydown = (event) => {
19
- if (event.key === "Tab") {
20
- event.preventDefault();
21
- setEditorDisabled(true);
22
- }
23
- };
24
- return (
25
- <div onClick={() => setEditorDisabled(false)}>
26
- <LiveEditor
27
- key={String(isBrowser)}
28
- className="openapi-demo__playground-editor"
29
- onChange={onEdit}
30
- disabled={editorDisabled}
31
- onKeyDown={handleKeydown}
32
- />
33
- </div>
34
- );
35
- }
36
- const LiveComponent = withLive(Live);
37
- function App({ children, transformCode, value, language, action, ...props }) {
38
- const prismTheme = usePrismTheme();
39
- const [code, setCode] = React.useState(children);
40
- useEffect(() => {
41
- action(setStringRawBody(code));
42
- }, [action, code]);
43
- return (
44
- <div className="openapi-demo__playground-container">
45
- <LiveProvider
46
- code={children.replace(/\n$/, "")}
47
- transformCode={transformCode ?? ((code) => `${code};`)}
48
- theme={prismTheme}
49
- language={language}
50
- {...props}
51
- >
52
- <LiveComponent onEdit={setCode} />
53
- </LiveProvider>
54
- </div>
55
- );
56
- }
57
- const LiveApp = withLive(App);
58
- export default LiveApp;
@@ -1,6 +0,0 @@
1
- .openapi__method-endpoint {
2
- max-width: 100%;
3
- width: fit-content;
4
- padding: 0.65rem;
5
- border: 1px solid var(--ifm-toc-border-color);
6
- }
@@ -1,68 +0,0 @@
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
- import BrowserOnly from "@docusaurus/BrowserOnly";
10
- import { useTypedSelector } from "../../ApiItem/hooks";
11
- function colorForMethod(method) {
12
- switch (method.toLowerCase()) {
13
- case "get":
14
- return "primary";
15
- case "post":
16
- return "success";
17
- case "delete":
18
- return "danger";
19
- case "put":
20
- return "info";
21
- case "patch":
22
- return "warning";
23
- case "head":
24
- return "secondary";
25
- case "event":
26
- return "secondary";
27
- default:
28
- return undefined;
29
- }
30
- }
31
- function MethodEndpoint({ method, path }) {
32
- let serverValue = useTypedSelector((state) => state.server.value);
33
- let serverUrlWithVariables = "";
34
- const renderServerUrl = () => {
35
- if (serverValue && serverValue.variables) {
36
- serverUrlWithVariables = serverValue.url.replace(/\/$/, "");
37
- Object.keys(serverValue.variables).forEach((variable) => {
38
- serverUrlWithVariables = serverUrlWithVariables.replace(
39
- `{${variable}}`,
40
- serverValue.variables?.[variable].default ?? ""
41
- );
42
- });
43
- }
44
- return (
45
- <BrowserOnly>
46
- {() => {
47
- if (serverUrlWithVariables.length) {
48
- return serverUrlWithVariables;
49
- } else if (serverValue && serverValue.url) {
50
- return serverValue.url;
51
- }
52
- }}
53
- </BrowserOnly>
54
- );
55
- };
56
- return (
57
- <pre className="openapi__method-endpoint">
58
- <span className={"badge badge--" + colorForMethod(method)}>
59
- {method.toUpperCase()}
60
- </span>{" "}
61
- <span>
62
- {renderServerUrl()}
63
- {`${path.replace(/{([a-z0-9-_]+)}/gi, ":$1")}`}
64
- </span>
65
- </pre>
66
- );
67
- }
68
- export default MethodEndpoint;
@@ -1,299 +0,0 @@
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, { useState, useEffect } from "react";
9
- import { nanoid } from "@reduxjs/toolkit";
10
- import FormItem from "@theme/ApiDemoPanel/FormItem";
11
- import FormMultiSelect from "@theme/ApiDemoPanel/FormMultiSelect";
12
- import FormSelect from "@theme/ApiDemoPanel/FormSelect";
13
- import FormTextInput from "@theme/ApiDemoPanel/FormTextInput";
14
- import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
15
- import { setParam } from "./slice";
16
- function ParamOption({ param }) {
17
- if (param.schema?.type === "array" && param.schema.items?.enum) {
18
- return <ParamMultiSelectFormItem param={param} />;
19
- }
20
- if (param.schema?.type === "array") {
21
- return <ParamArrayFormItem param={param} />;
22
- }
23
- if (param.schema?.enum) {
24
- return <ParamSelectFormItem param={param} />;
25
- }
26
- if (param.schema?.type === "boolean") {
27
- return <ParamBooleanFormItem param={param} />;
28
- }
29
-
30
- // integer, number, string, int32, int64, float, double, object, byte, binary,
31
- // date-time, date, password
32
- return <ParamTextFormItem param={param} />;
33
- }
34
- function ParamOptionWrapper({ param }) {
35
- return (
36
- <FormItem label={param.name} type={param.in} required={param.required}>
37
- <ParamOption param={param} />
38
- </FormItem>
39
- );
40
- }
41
- function ParamOptions() {
42
- const [showOptional, setShowOptional] = useState(false);
43
- const pathParams = useTypedSelector((state) => state.params.path);
44
- const queryParams = useTypedSelector((state) => state.params.query);
45
- const cookieParams = useTypedSelector((state) => state.params.cookie);
46
- const headerParams = useTypedSelector((state) => state.params.header);
47
- const allParams = [
48
- ...pathParams,
49
- ...queryParams,
50
- ...cookieParams,
51
- ...headerParams,
52
- ];
53
- const requiredParams = allParams.filter((p) => p.required);
54
- const optionalParams = allParams.filter((p) => !p.required);
55
- return (
56
- <>
57
- {/* Required Parameters */}
58
- {requiredParams.map((param) => (
59
- <ParamOptionWrapper key={`${param.in}-${param.name}`} param={param} />
60
- ))}
61
-
62
- {/* Optional Parameters */}
63
- {optionalParams.length > 0 && (
64
- <>
65
- <button
66
- className="openapi-demo__show-more-btn"
67
- onClick={() => setShowOptional((prev) => !prev)}
68
- >
69
- <span
70
- style={{
71
- width: "1.5em",
72
- display: "inline-block",
73
- textAlign: "center",
74
- }}
75
- >
76
- <span
77
- className={
78
- showOptional
79
- ? "openapi-demo__plus-btn--expanded"
80
- : "openapi-demo__plus-btn"
81
- }
82
- >
83
- <div>
84
- <svg
85
- style={{
86
- fill: "currentColor",
87
- width: "10px",
88
- height: "10px",
89
- }}
90
- height="16"
91
- viewBox="0 0 16 16"
92
- width="16"
93
- xmlns="http://www.w3.org/2000/svg"
94
- >
95
- <path
96
- d="M9 7h6a1 1 0 0 1 0 2H9v6a1 1 0 0 1-2 0V9H1a1 1 0 1 1 0-2h6V1a1 1 0 1 1 2 0z"
97
- fillRule="evenodd"
98
- ></path>
99
- </svg>
100
- </div>
101
- </span>
102
- </span>
103
- {showOptional
104
- ? "Hide optional parameters"
105
- : "Show optional parameters"}
106
- </button>
107
-
108
- <div
109
- className={
110
- showOptional
111
- ? "openapi-demo__show-options"
112
- : "openapi-demo__hide-options"
113
- }
114
- >
115
- {optionalParams.map((param) => (
116
- <ParamOptionWrapper
117
- key={`${param.in}-${param.name}`}
118
- param={param}
119
- />
120
- ))}
121
- </div>
122
- </>
123
- )}
124
- </>
125
- );
126
- }
127
- function ArrayItem({ param, onChange }) {
128
- if (param.schema?.items?.type === "boolean") {
129
- return (
130
- <FormSelect
131
- options={["---", "true", "false"]}
132
- onChange={(e) => {
133
- const val = e.target.value;
134
- onChange(val === "---" ? undefined : val);
135
- }}
136
- />
137
- );
138
- }
139
- return (
140
- <FormTextInput
141
- placeholder={param.description || param.name}
142
- onChange={(e) => {
143
- onChange(e.target.value);
144
- }}
145
- />
146
- );
147
- }
148
- function ParamArrayFormItem({ param }) {
149
- const [items, setItems] = useState([]);
150
- const dispatch = useTypedDispatch();
151
- function handleAddItem() {
152
- setItems((i) => [
153
- ...i,
154
- {
155
- id: nanoid(),
156
- },
157
- ]);
158
- }
159
- useEffect(() => {
160
- const values = items.map((item) => item.value).filter((item) => !!item);
161
- dispatch(
162
- setParam({
163
- ...param,
164
- value: values.length > 0 ? values : undefined,
165
- })
166
- );
167
- // eslint-disable-next-line react-hooks/exhaustive-deps
168
- }, [items]);
169
- function handleDeleteItem(itemToDelete) {
170
- return () => {
171
- const newItems = items.filter((i) => i.id !== itemToDelete.id);
172
- setItems(newItems);
173
- };
174
- }
175
- function handleChangeItem(itemToUpdate) {
176
- return (value) => {
177
- const newItems = items.map((i) => {
178
- if (i.id === itemToUpdate.id) {
179
- return {
180
- ...i,
181
- value: value,
182
- };
183
- }
184
- return i;
185
- });
186
- setItems(newItems);
187
- };
188
- }
189
- return (
190
- <>
191
- {items.map((item) => (
192
- <div
193
- key={item.id}
194
- style={{
195
- display: "flex",
196
- }}
197
- >
198
- <ArrayItem param={param} onChange={handleChangeItem(item)} />
199
- <button
200
- className="openapi-demo__delete-btn"
201
- onClick={handleDeleteItem(item)}
202
- >
203
- <svg
204
- focusable="false"
205
- preserveAspectRatio="xMidYMid meet"
206
- xmlns="http://www.w3.org/2000/svg"
207
- fill="currentColor"
208
- width="16"
209
- height="16"
210
- viewBox="0 0 32 32"
211
- aria-hidden="true"
212
- >
213
- <path d="M24 9.4L22.6 8 16 14.6 9.4 8 8 9.4 14.6 16 8 22.6 9.4 24 16 17.4 22.6 24 24 22.6 17.4 16 24 9.4z"></path>
214
- <title>Delete</title>
215
- </svg>
216
- </button>
217
- </div>
218
- ))}
219
- <button className="openapi-demo__thin-btn" onClick={handleAddItem}>
220
- Add item
221
- </button>
222
- </>
223
- );
224
- }
225
- function ParamSelectFormItem({ param }) {
226
- const dispatch = useTypedDispatch();
227
- const options = param.schema?.enum ?? [];
228
- return (
229
- <FormSelect
230
- options={["---", ...options]}
231
- onChange={(e) => {
232
- const val = e.target.value;
233
- dispatch(
234
- setParam({
235
- ...param,
236
- value: val === "---" ? undefined : val,
237
- })
238
- );
239
- }}
240
- />
241
- );
242
- }
243
- function ParamBooleanFormItem({ param }) {
244
- const dispatch = useTypedDispatch();
245
- return (
246
- <FormSelect
247
- options={["---", "true", "false"]}
248
- onChange={(e) => {
249
- const val = e.target.value;
250
- dispatch(
251
- setParam({
252
- ...param,
253
- value: val === "---" ? undefined : val,
254
- })
255
- );
256
- }}
257
- />
258
- );
259
- }
260
- function ParamMultiSelectFormItem({ param }) {
261
- const dispatch = useTypedDispatch();
262
- const options = param.schema?.items?.enum ?? [];
263
- return (
264
- <FormMultiSelect
265
- options={options}
266
- onChange={(e) => {
267
- const values = Array.prototype.filter
268
- .call(e.target.options, (o) => o.selected)
269
- .map((o) => o.value);
270
- dispatch(
271
- setParam({
272
- ...param,
273
- value: values.length > 0 ? values : undefined,
274
- })
275
- );
276
- }}
277
- />
278
- );
279
- }
280
- function ParamTextFormItem({ param }) {
281
- const dispatch = useTypedDispatch();
282
- return (
283
- <FormTextInput
284
- placeholder={param.description || param.name}
285
- onChange={(e) =>
286
- dispatch(
287
- setParam({
288
- ...param,
289
- value:
290
- param.in === "path" || param.in === "query"
291
- ? e.target.value.replace(/\s/g, "%20")
292
- : e.target.value,
293
- })
294
- )
295
- }
296
- />
297
- );
298
- }
299
- export default ParamOptions;
@@ -1,48 +0,0 @@
1
- .openapi-demo__options-panel {
2
- background: var(--openapi-card-background-color);
3
- border-radius: var(--openapi-card-border-radius);
4
- color: var(--ifm-pre-color);
5
- line-height: var(--ifm-pre-line-height);
6
- margin-bottom: var(--ifm-spacing-vertical);
7
- margin-top: 0;
8
- overflow: auto;
9
- padding-top: 0 !important;
10
- padding: var(--ifm-pre-padding);
11
-
12
- /* hack for view calculation when monaco is hidden */
13
- position: relative;
14
-
15
- &:empty {
16
- display: none;
17
- }
18
- }
19
-
20
- .openapi-demo__details {
21
- margin-bottom: 1rem;
22
- background: var(--openapi-card-background-color);
23
- border-radius: var(--openapi-card-border-radius);
24
- }
25
-
26
- .openapi-demo__summary-container {
27
- padding: 1rem;
28
- list-style-type: none;
29
-
30
- &:hover {
31
- cursor: pointer;
32
- }
33
- }
34
-
35
- .openapi-demo__summary-content {
36
- display: flex;
37
- justify-content: space-between;
38
- align-items: center;
39
- }
40
-
41
- .openapi-demo__summary-header {
42
- margin-bottom: 0;
43
- }
44
-
45
- .openapi-demo__summary-header > button {
46
- margin-bottom: 1rem;
47
- margin-right: 1rem;
48
- }