@camunda8/docusaurus-theme-openapi-docs 4.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. package/babel.config.js +35 -0
  2. package/lib/index.d.ts +2 -0
  3. package/lib/index.js +81 -0
  4. package/lib/markdown/createDescription.d.ts +1 -0
  5. package/lib/markdown/createDescription.js +15 -0
  6. package/lib/markdown/schema.d.ts +3 -0
  7. package/lib/markdown/schema.js +154 -0
  8. package/lib/markdown/utils.d.ts +10 -0
  9. package/lib/markdown/utils.js +49 -0
  10. package/lib/markdown/utils.test.d.ts +1 -0
  11. package/lib/markdown/utils.test.js +43 -0
  12. package/lib/theme/ApiExplorer/Accept/index.d.ts +3 -0
  13. package/lib/theme/ApiExplorer/Accept/index.js +38 -0
  14. package/lib/theme/ApiExplorer/Accept/slice.d.ts +11 -0
  15. package/lib/theme/ApiExplorer/Accept/slice.js +22 -0
  16. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
  17. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.d.ts +4 -0
  18. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.js +35 -0
  19. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.d.ts +3 -0
  20. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +41 -0
  21. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.d.ts +3 -0
  22. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.js +153 -0
  23. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
  24. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
  25. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.d.ts +7 -0
  26. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +147 -0
  27. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
  28. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.d.ts +6 -0
  29. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +58 -0
  30. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
  31. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.d.ts +14 -0
  32. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +248 -0
  33. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +34 -0
  34. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.d.ts +3 -0
  35. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.js +59 -0
  36. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
  37. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.d.ts +7 -0
  38. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +51 -0
  39. package/lib/theme/ApiExplorer/ApiCodeBlock/index.d.ts +3 -0
  40. package/lib/theme/ApiExplorer/ApiCodeBlock/index.js +110 -0
  41. package/lib/theme/ApiExplorer/Authorization/auth-types.d.ts +3 -0
  42. package/lib/theme/ApiExplorer/Authorization/auth-types.js +28 -0
  43. package/lib/theme/ApiExplorer/Authorization/index.d.ts +3 -0
  44. package/lib/theme/ApiExplorer/Authorization/index.js +201 -0
  45. package/lib/theme/ApiExplorer/Authorization/slice.d.ts +40 -0
  46. package/lib/theme/ApiExplorer/Authorization/slice.js +102 -0
  47. package/lib/theme/ApiExplorer/Body/index.d.ts +10 -0
  48. package/lib/theme/ApiExplorer/Body/index.js +394 -0
  49. package/lib/theme/ApiExplorer/Body/json2xml.js +43 -0
  50. package/lib/theme/ApiExplorer/Body/slice.d.ts +82 -0
  51. package/lib/theme/ApiExplorer/Body/slice.js +97 -0
  52. package/lib/theme/ApiExplorer/CodeSnippets/code-snippets-types.d.ts +21 -0
  53. package/lib/theme/ApiExplorer/CodeSnippets/code-snippets-types.js +8 -0
  54. package/lib/theme/ApiExplorer/CodeSnippets/index.d.ts +11 -0
  55. package/lib/theme/ApiExplorer/CodeSnippets/index.js +435 -0
  56. package/lib/theme/ApiExplorer/CodeSnippets/languages.d.ts +5 -0
  57. package/lib/theme/ApiExplorer/CodeSnippets/languages.js +133 -0
  58. package/lib/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
  59. package/lib/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +505 -0
  60. package/lib/theme/ApiExplorer/CodeTabs/index.d.ts +15 -0
  61. package/lib/theme/ApiExplorer/CodeTabs/index.js +283 -0
  62. package/lib/theme/ApiExplorer/ContentType/index.d.ts +3 -0
  63. package/lib/theme/ApiExplorer/ContentType/index.js +40 -0
  64. package/lib/theme/ApiExplorer/ContentType/slice.d.ts +11 -0
  65. package/lib/theme/ApiExplorer/ContentType/slice.js +22 -0
  66. package/lib/theme/ApiExplorer/Export/index.d.ts +3 -0
  67. package/lib/theme/ApiExplorer/Export/index.js +57 -0
  68. package/lib/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +27 -0
  69. package/lib/theme/ApiExplorer/FloatingButton/index.d.ts +8 -0
  70. package/lib/theme/ApiExplorer/FloatingButton/index.js +28 -0
  71. package/lib/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss +74 -0
  72. package/lib/theme/ApiExplorer/FormFileUpload/index.d.ts +7 -0
  73. package/lib/theme/ApiExplorer/FormFileUpload/index.js +178 -0
  74. package/lib/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
  75. package/lib/theme/ApiExplorer/FormItem/index.d.ts +10 -0
  76. package/lib/theme/ApiExplorer/FormItem/index.js +49 -0
  77. package/lib/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
  78. package/lib/theme/ApiExplorer/FormMultiSelect/index.d.ts +9 -0
  79. package/lib/theme/ApiExplorer/FormMultiSelect/index.js +51 -0
  80. package/lib/theme/ApiExplorer/FormSelect/_FormSelect.scss +43 -0
  81. package/lib/theme/ApiExplorer/FormSelect/index.d.ts +8 -0
  82. package/lib/theme/ApiExplorer/FormSelect/index.js +35 -0
  83. package/lib/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
  84. package/lib/theme/ApiExplorer/FormTextInput/index.d.ts +11 -0
  85. package/lib/theme/ApiExplorer/FormTextInput/index.js +80 -0
  86. package/lib/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
  87. package/lib/theme/ApiExplorer/LiveEditor/index.d.ts +6 -0
  88. package/lib/theme/ApiExplorer/LiveEditor/index.js +176 -0
  89. package/lib/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
  90. package/lib/theme/ApiExplorer/MethodEndpoint/index.d.ts +8 -0
  91. package/lib/theme/ApiExplorer/MethodEndpoint/index.js +86 -0
  92. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.d.ts +6 -0
  93. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.js +230 -0
  94. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.d.ts +6 -0
  95. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +71 -0
  96. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.d.ts +6 -0
  97. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +97 -0
  98. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.d.ts +6 -0
  99. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +72 -0
  100. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.d.ts +6 -0
  101. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.js +38 -0
  102. package/lib/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +123 -0
  103. package/lib/theme/ApiExplorer/ParamOptions/index.d.ts +7 -0
  104. package/lib/theme/ApiExplorer/ParamOptions/index.js +233 -0
  105. package/lib/theme/ApiExplorer/ParamOptions/slice.d.ts +17 -0
  106. package/lib/theme/ApiExplorer/ParamOptions/slice.js +25 -0
  107. package/lib/theme/ApiExplorer/Request/_Request.scss +129 -0
  108. package/lib/theme/ApiExplorer/Request/index.d.ts +6 -0
  109. package/lib/theme/ApiExplorer/Request/index.js +443 -0
  110. package/lib/theme/ApiExplorer/Request/makeRequest.d.ts +4 -0
  111. package/lib/theme/ApiExplorer/Request/makeRequest.js +223 -0
  112. package/lib/theme/ApiExplorer/Response/_Response.scss +121 -0
  113. package/lib/theme/ApiExplorer/Response/index.d.ts +6 -0
  114. package/lib/theme/ApiExplorer/Response/index.js +207 -0
  115. package/lib/theme/ApiExplorer/Response/slice.d.ts +17 -0
  116. package/lib/theme/ApiExplorer/Response/slice.js +51 -0
  117. package/lib/theme/ApiExplorer/SecuritySchemes/index.d.ts +3 -0
  118. package/lib/theme/ApiExplorer/SecuritySchemes/index.js +519 -0
  119. package/lib/theme/ApiExplorer/Server/_Server.scss +26 -0
  120. package/lib/theme/ApiExplorer/Server/index.d.ts +3 -0
  121. package/lib/theme/ApiExplorer/Server/index.js +213 -0
  122. package/lib/theme/ApiExplorer/Server/slice.d.ts +13 -0
  123. package/lib/theme/ApiExplorer/Server/slice.js +33 -0
  124. package/lib/theme/ApiExplorer/buildPostmanRequest.d.ts +20 -0
  125. package/lib/theme/ApiExplorer/buildPostmanRequest.js +511 -0
  126. package/lib/theme/ApiExplorer/index.d.ts +7 -0
  127. package/lib/theme/ApiExplorer/index.js +107 -0
  128. package/lib/theme/ApiExplorer/persistanceMiddleware.d.ts +19 -0
  129. package/lib/theme/ApiExplorer/persistanceMiddleware.js +54 -0
  130. package/lib/theme/ApiExplorer/storage-utils.d.ts +4 -0
  131. package/lib/theme/ApiExplorer/storage-utils.js +41 -0
  132. package/lib/theme/ApiItem/Layout/index.d.ts +3 -0
  133. package/lib/theme/ApiItem/Layout/index.js +121 -0
  134. package/lib/theme/ApiItem/Layout/styles.module.css +17 -0
  135. package/lib/theme/ApiItem/hooks.d.ts +12 -0
  136. package/lib/theme/ApiItem/hooks.js +13 -0
  137. package/lib/theme/ApiItem/index.d.ts +2 -0
  138. package/lib/theme/ApiItem/index.js +238 -0
  139. package/lib/theme/ApiItem/store.d.ts +58 -0
  140. package/lib/theme/ApiItem/store.js +53 -0
  141. package/lib/theme/ApiLogo/index.d.ts +2 -0
  142. package/lib/theme/ApiLogo/index.js +51 -0
  143. package/lib/theme/ApiTabs/_ApiTabs.scss +142 -0
  144. package/lib/theme/ApiTabs/index.d.ts +7 -0
  145. package/lib/theme/ApiTabs/index.js +275 -0
  146. package/lib/theme/ArrayBrackets/index.d.ts +3 -0
  147. package/lib/theme/ArrayBrackets/index.js +50 -0
  148. package/lib/theme/CodeSamples/_CodeSamples.scss +3 -0
  149. package/lib/theme/CodeSamples/index.d.ts +8 -0
  150. package/lib/theme/CodeSamples/index.js +27 -0
  151. package/lib/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +98 -0
  152. package/lib/theme/DiscriminatorTabs/index.d.ts +3 -0
  153. package/lib/theme/DiscriminatorTabs/index.js +258 -0
  154. package/lib/theme/Markdown/Details/_Details.scss +122 -0
  155. package/lib/theme/Markdown/index.js +179 -0
  156. package/lib/theme/MimeTabs/_MimeTabs.scss +70 -0
  157. package/lib/theme/MimeTabs/index.d.ts +6 -0
  158. package/lib/theme/MimeTabs/index.js +286 -0
  159. package/lib/theme/OperationTabs/_OperationTabs.scss +72 -0
  160. package/lib/theme/OperationTabs/index.d.ts +3 -0
  161. package/lib/theme/OperationTabs/index.js +248 -0
  162. package/lib/theme/ParamsDetails/index.d.ts +6 -0
  163. package/lib/theme/ParamsDetails/index.js +93 -0
  164. package/lib/theme/ParamsItem/_ParamsItem.scss +54 -0
  165. package/lib/theme/ParamsItem/index.d.ts +22 -0
  166. package/lib/theme/ParamsItem/index.js +281 -0
  167. package/lib/theme/RequestSchema/index.d.ts +15 -0
  168. package/lib/theme/RequestSchema/index.js +208 -0
  169. package/lib/theme/ResponseExamples/index.d.ts +18 -0
  170. package/lib/theme/ResponseExamples/index.js +213 -0
  171. package/lib/theme/ResponseHeaders/index.d.ts +13 -0
  172. package/lib/theme/ResponseHeaders/index.js +39 -0
  173. package/lib/theme/ResponseSchema/index.d.ts +15 -0
  174. package/lib/theme/ResponseSchema/index.js +165 -0
  175. package/lib/theme/Schema/index.d.ts +8 -0
  176. package/lib/theme/Schema/index.js +853 -0
  177. package/lib/theme/SchemaItem/_SchemaItem.scss +89 -0
  178. package/lib/theme/SchemaItem/index.d.ts +12 -0
  179. package/lib/theme/SchemaItem/index.js +314 -0
  180. package/lib/theme/SchemaTabs/_SchemaTabs.scss +61 -0
  181. package/lib/theme/SchemaTabs/index.d.ts +3 -0
  182. package/lib/theme/SchemaTabs/index.js +255 -0
  183. package/lib/theme/SkeletonLoader/index.d.ts +6 -0
  184. package/lib/theme/SkeletonLoader/index.js +20 -0
  185. package/lib/theme/StatusCodes/index.d.ts +9 -0
  186. package/lib/theme/StatusCodes/index.js +90 -0
  187. package/lib/theme/styles.scss +215 -0
  188. package/lib/theme/translationIds.d.ts +83 -0
  189. package/lib/theme/translationIds.js +106 -0
  190. package/lib/types.d.ts +46 -0
  191. package/lib/types.js +8 -0
  192. package/package.json +85 -0
  193. package/src/index.ts +85 -0
  194. package/src/markdown/createDescription.ts +13 -0
  195. package/src/markdown/schema.ts +186 -0
  196. package/src/markdown/utils.test.ts +49 -0
  197. package/src/markdown/utils.ts +59 -0
  198. package/src/plugin-content-docs.d.ts +20 -0
  199. package/src/postman-code-generators.d.ts +9 -0
  200. package/src/react-magic-dropzone.d.ts +9 -0
  201. package/src/theme/ApiExplorer/Accept/index.tsx +36 -0
  202. package/src/theme/ApiExplorer/Accept/slice.ts +29 -0
  203. package/src/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
  204. package/src/theme/ApiExplorer/ApiCodeBlock/Container/index.tsx +32 -0
  205. package/src/theme/ApiExplorer/ApiCodeBlock/Content/Element.tsx +34 -0
  206. package/src/theme/ApiExplorer/ApiCodeBlock/Content/String.tsx +134 -0
  207. package/src/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
  208. package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
  209. package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.tsx +83 -0
  210. package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
  211. package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.tsx +55 -0
  212. package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
  213. package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.tsx +166 -0
  214. package/src/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +34 -0
  215. package/src/theme/ApiExplorer/ApiCodeBlock/Line/index.tsx +48 -0
  216. package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
  217. package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.tsx +54 -0
  218. package/src/theme/ApiExplorer/ApiCodeBlock/index.tsx +45 -0
  219. package/src/theme/ApiExplorer/Authorization/auth-types.ts +30 -0
  220. package/src/theme/ApiExplorer/Authorization/index.tsx +199 -0
  221. package/src/theme/ApiExplorer/Authorization/slice.ts +146 -0
  222. package/src/theme/ApiExplorer/Body/index.tsx +388 -0
  223. package/src/theme/ApiExplorer/Body/json2xml.d.ts +8 -0
  224. package/src/theme/ApiExplorer/Body/json2xml.js +43 -0
  225. package/src/theme/ApiExplorer/Body/slice.ts +133 -0
  226. package/src/theme/ApiExplorer/CodeSnippets/code-snippets-types.ts +57 -0
  227. package/src/theme/ApiExplorer/CodeSnippets/index.tsx +383 -0
  228. package/src/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
  229. package/src/theme/ApiExplorer/CodeSnippets/languages.ts +139 -0
  230. package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +505 -0
  231. package/src/theme/ApiExplorer/CodeTabs/index.tsx +261 -0
  232. package/src/theme/ApiExplorer/ContentType/index.tsx +38 -0
  233. package/src/theme/ApiExplorer/ContentType/slice.ts +29 -0
  234. package/src/theme/ApiExplorer/Export/index.tsx +47 -0
  235. package/src/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +27 -0
  236. package/src/theme/ApiExplorer/FloatingButton/index.tsx +29 -0
  237. package/src/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss +74 -0
  238. package/src/theme/ApiExplorer/FormFileUpload/index.tsx +124 -0
  239. package/src/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
  240. package/src/theme/ApiExplorer/FormItem/index.tsx +40 -0
  241. package/src/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
  242. package/src/theme/ApiExplorer/FormMultiSelect/index.tsx +57 -0
  243. package/src/theme/ApiExplorer/FormSelect/_FormSelect.scss +43 -0
  244. package/src/theme/ApiExplorer/FormSelect/index.tsx +38 -0
  245. package/src/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
  246. package/src/theme/ApiExplorer/FormTextInput/index.tsx +89 -0
  247. package/src/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
  248. package/src/theme/ApiExplorer/LiveEditor/index.tsx +122 -0
  249. package/src/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
  250. package/src/theme/ApiExplorer/MethodEndpoint/index.tsx +91 -0
  251. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +185 -0
  252. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +72 -0
  253. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +94 -0
  254. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +74 -0
  255. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.tsx +38 -0
  256. package/src/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +123 -0
  257. package/src/theme/ApiExplorer/ParamOptions/index.tsx +154 -0
  258. package/src/theme/ApiExplorer/ParamOptions/slice.ts +37 -0
  259. package/src/theme/ApiExplorer/Request/_Request.scss +129 -0
  260. package/src/theme/ApiExplorer/Request/index.tsx +352 -0
  261. package/src/theme/ApiExplorer/Request/makeRequest.ts +255 -0
  262. package/src/theme/ApiExplorer/Response/_Response.scss +121 -0
  263. package/src/theme/ApiExplorer/Response/index.tsx +173 -0
  264. package/src/theme/ApiExplorer/Response/slice.ts +52 -0
  265. package/src/theme/ApiExplorer/SecuritySchemes/index.tsx +375 -0
  266. package/src/theme/ApiExplorer/Server/_Server.scss +26 -0
  267. package/src/theme/ApiExplorer/Server/index.tsx +138 -0
  268. package/src/theme/ApiExplorer/Server/slice.ts +39 -0
  269. package/src/theme/ApiExplorer/buildPostmanRequest.ts +524 -0
  270. package/src/theme/ApiExplorer/index.tsx +52 -0
  271. package/src/theme/ApiExplorer/persistanceMiddleware.ts +73 -0
  272. package/src/theme/ApiExplorer/storage-utils.ts +39 -0
  273. package/src/theme/ApiItem/Layout/index.tsx +85 -0
  274. package/src/theme/ApiItem/Layout/styles.module.css +17 -0
  275. package/src/theme/ApiItem/hooks.ts +13 -0
  276. package/src/theme/ApiItem/index.tsx +222 -0
  277. package/src/theme/ApiItem/store.ts +51 -0
  278. package/src/theme/ApiLogo/index.tsx +52 -0
  279. package/src/theme/ApiTabs/_ApiTabs.scss +142 -0
  280. package/src/theme/ApiTabs/index.tsx +243 -0
  281. package/src/theme/ArrayBrackets/index.tsx +37 -0
  282. package/src/theme/CodeSamples/_CodeSamples.scss +3 -0
  283. package/src/theme/CodeSamples/index.tsx +26 -0
  284. package/src/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +98 -0
  285. package/src/theme/DiscriminatorTabs/index.tsx +229 -0
  286. package/src/theme/Markdown/Details/_Details.scss +122 -0
  287. package/src/theme/Markdown/index.d.ts +8 -0
  288. package/src/theme/Markdown/index.js +179 -0
  289. package/src/theme/MimeTabs/_MimeTabs.scss +70 -0
  290. package/src/theme/MimeTabs/index.tsx +257 -0
  291. package/src/theme/OperationTabs/_OperationTabs.scss +72 -0
  292. package/src/theme/OperationTabs/index.tsx +220 -0
  293. package/src/theme/ParamsDetails/index.tsx +90 -0
  294. package/src/theme/ParamsItem/_ParamsItem.scss +54 -0
  295. package/src/theme/ParamsItem/index.tsx +246 -0
  296. package/src/theme/RequestSchema/index.tsx +172 -0
  297. package/src/theme/ResponseExamples/index.tsx +209 -0
  298. package/src/theme/ResponseHeaders/index.tsx +49 -0
  299. package/src/theme/ResponseSchema/index.tsx +150 -0
  300. package/src/theme/Schema/index.tsx +938 -0
  301. package/src/theme/SchemaItem/_SchemaItem.scss +89 -0
  302. package/src/theme/SchemaItem/index.tsx +273 -0
  303. package/src/theme/SchemaTabs/_SchemaTabs.scss +61 -0
  304. package/src/theme/SchemaTabs/index.tsx +224 -0
  305. package/src/theme/SkeletonLoader/index.tsx +18 -0
  306. package/src/theme/StatusCodes/index.tsx +83 -0
  307. package/src/theme/styles.scss +215 -0
  308. package/src/theme/translationIds.ts +103 -0
  309. package/src/theme-classic.d.ts +80 -0
  310. package/src/theme-openapi.d.ts +20 -0
  311. package/src/types.ts +72 -0
  312. package/tsconfig.json +16 -0
@@ -0,0 +1,220 @@
1
+ /* ============================================================================
2
+ * Copyright (c) Palo Alto Networks
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ * ========================================================================== */
7
+
8
+ import React, {
9
+ cloneElement,
10
+ useEffect,
11
+ useState,
12
+ useRef,
13
+ ReactElement,
14
+ } from "react";
15
+
16
+ import {
17
+ sanitizeTabsChildren,
18
+ TabProps,
19
+ useScrollPositionBlocker,
20
+ useTabs,
21
+ } from "@docusaurus/theme-common/internal";
22
+ import { TabItemProps } from "@docusaurus/theme-common/lib/utils/tabsUtils";
23
+ import useIsBrowser from "@docusaurus/useIsBrowser";
24
+ import clsx from "clsx";
25
+
26
+ function TabList({
27
+ className,
28
+ block,
29
+ selectedValue,
30
+ selectValue,
31
+ tabValues,
32
+ }: TabProps & ReturnType<typeof useTabs>) {
33
+ const tabRefs: (HTMLLIElement | null)[] = [];
34
+ const { blockElementScrollPositionUntilNextRender } =
35
+ useScrollPositionBlocker();
36
+
37
+ const handleTabChange = (
38
+ event:
39
+ | React.FocusEvent<HTMLLIElement>
40
+ | React.MouseEvent<HTMLLIElement>
41
+ | React.KeyboardEvent<HTMLLIElement>
42
+ ) => {
43
+ const newTab = event.currentTarget;
44
+ const newTabIndex = tabRefs.indexOf(newTab);
45
+ const newTabValue = tabValues[newTabIndex].value;
46
+
47
+ if (newTabValue !== selectedValue) {
48
+ blockElementScrollPositionUntilNextRender(newTab);
49
+ selectValue(newTabValue);
50
+ }
51
+ };
52
+
53
+ const handleKeydown = (event: React.KeyboardEvent<HTMLLIElement>) => {
54
+ let focusElement: HTMLLIElement | null = null;
55
+
56
+ switch (event.key) {
57
+ case "Enter": {
58
+ handleTabChange(event);
59
+ break;
60
+ }
61
+ case "ArrowRight": {
62
+ const nextTab = tabRefs.indexOf(event.currentTarget) + 1;
63
+ focusElement = tabRefs[nextTab] ?? tabRefs[0]!;
64
+ break;
65
+ }
66
+ case "ArrowLeft": {
67
+ const prevTab = tabRefs.indexOf(event.currentTarget) - 1;
68
+ focusElement = tabRefs[prevTab] ?? tabRefs[tabRefs.length - 1]!;
69
+ break;
70
+ }
71
+ default:
72
+ break;
73
+ }
74
+
75
+ focusElement?.focus();
76
+ };
77
+
78
+ const tabItemListContainerRef = useRef<HTMLUListElement>(null);
79
+ const [showTabArrows, setShowTabArrows] = useState<boolean>(false);
80
+
81
+ useEffect(() => {
82
+ const resizeObserver = new ResizeObserver((entries) => {
83
+ for (let entry of entries) {
84
+ requestAnimationFrame(() => {
85
+ if (entry.target.clientWidth < entry.target.scrollWidth) {
86
+ setShowTabArrows(true);
87
+ } else {
88
+ setShowTabArrows(false);
89
+ }
90
+ });
91
+ }
92
+ });
93
+
94
+ resizeObserver.observe(tabItemListContainerRef.current!);
95
+
96
+ return () => {
97
+ resizeObserver.disconnect();
98
+ };
99
+ }, []);
100
+
101
+ const handleRightClick = () => {
102
+ tabItemListContainerRef.current!.scrollLeft += 90;
103
+ };
104
+
105
+ const handleLeftClick = () => {
106
+ tabItemListContainerRef.current!.scrollLeft -= 90;
107
+ };
108
+
109
+ return (
110
+ <div className="tabs__container">
111
+ <div className="openapi-tabs__operation-container">
112
+ {showTabArrows && (
113
+ <button
114
+ className={clsx("openapi-tabs__arrow", "left")}
115
+ onClick={handleLeftClick}
116
+ />
117
+ )}
118
+ <ul
119
+ ref={tabItemListContainerRef}
120
+ role="tablist"
121
+ aria-orientation="horizontal"
122
+ className={clsx(
123
+ "openapi-tabs__operation-list-container",
124
+ "tabs",
125
+ {
126
+ "tabs--block": block,
127
+ },
128
+ className
129
+ )}
130
+ >
131
+ {tabValues.map(({ value, label, attributes }) => {
132
+ return (
133
+ <li
134
+ // TODO extract TabListItem
135
+ role="tab"
136
+ tabIndex={selectedValue === value ? 0 : -1}
137
+ aria-selected={selectedValue === value}
138
+ key={value}
139
+ ref={(tabControl) => {
140
+ tabRefs.push(tabControl);
141
+ }}
142
+ onKeyDown={handleKeydown}
143
+ onFocus={handleTabChange}
144
+ onClick={(e) => handleTabChange(e)}
145
+ {...attributes}
146
+ className={clsx(
147
+ "tabs__item",
148
+ "openapi-tabs__operation-item",
149
+ attributes?.className as string,
150
+ {
151
+ active: selectedValue === value,
152
+ }
153
+ )}
154
+ >
155
+ {label ?? value}
156
+ </li>
157
+ );
158
+ })}
159
+ </ul>
160
+ {showTabArrows && (
161
+ <button
162
+ className={clsx("openapi-tabs__arrow", "right")}
163
+ onClick={handleRightClick}
164
+ />
165
+ )}
166
+ </div>
167
+ </div>
168
+ );
169
+ }
170
+ function TabContent({
171
+ lazy,
172
+ children,
173
+ selectedValue,
174
+ }: TabProps & ReturnType<typeof useTabs>): React.JSX.Element | null {
175
+ const childTabs = (Array.isArray(children) ? children : [children]).filter(
176
+ Boolean
177
+ ) as ReactElement<TabItemProps>[];
178
+ if (lazy) {
179
+ const selectedTabItem = childTabs.find(
180
+ (tabItem) => tabItem.props.value === selectedValue
181
+ );
182
+ if (!selectedTabItem) {
183
+ // fail-safe or fail-fast? not sure what's best here
184
+ return null;
185
+ }
186
+ return cloneElement(selectedTabItem, { className: "margin-top--md" });
187
+ }
188
+ return (
189
+ <div className="margin-top--md">
190
+ {childTabs.map((tabItem, i) =>
191
+ cloneElement(tabItem, {
192
+ key: i,
193
+ hidden: tabItem.props.value !== selectedValue,
194
+ })
195
+ )}
196
+ </div>
197
+ );
198
+ }
199
+ function TabsComponent(props: TabProps): React.JSX.Element {
200
+ const tabs = useTabs(props);
201
+ return (
202
+ <div className="tabs-container">
203
+ <TabList {...props} {...tabs} />
204
+ <TabContent {...props} {...tabs} />
205
+ </div>
206
+ );
207
+ }
208
+ export default function OperationTabs(props: TabProps): React.JSX.Element {
209
+ const isBrowser = useIsBrowser();
210
+ return (
211
+ <TabsComponent
212
+ // Remount tabs after hydration
213
+ // Temporary fix for https://github.com/facebook/docusaurus/issues/5653
214
+ key={String(isBrowser)}
215
+ {...props}
216
+ >
217
+ {sanitizeTabsChildren(props.children)}
218
+ </TabsComponent>
219
+ );
220
+ }
@@ -0,0 +1,90 @@
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 { OPENAPI_PARAMS_DETAILS } from "@theme/translationIds";
12
+
13
+ import BrowserOnly from "@docusaurus/BrowserOnly";
14
+ import Details from "@theme/Details";
15
+ import ParamsItem from "@theme/ParamsItem";
16
+ import SkeletonLoader from "@theme/SkeletonLoader";
17
+
18
+ interface Props {
19
+ parameters: any[];
20
+ }
21
+
22
+ const ParamsDetailsComponent: React.FC<Props> = ({ parameters }) => {
23
+ const types = ["path", "query", "header", "cookie"];
24
+
25
+ return (
26
+ <>
27
+ {types.map((type) => {
28
+ const params = parameters?.filter((param: any) => param?.in === type);
29
+
30
+ if (!params || params.length === 0) {
31
+ return null;
32
+ }
33
+
34
+ const summaryElement = (
35
+ <summary>
36
+ <h3 className="openapi-markdown__details-summary-header-params">
37
+ {translate(
38
+ {
39
+ id: OPENAPI_PARAMS_DETAILS.PARAMETERS_TITLE,
40
+ message: "{type} Parameters",
41
+ },
42
+ { type: type.charAt(0).toUpperCase() + type.slice(1) }
43
+ )}
44
+ </h3>
45
+ </summary>
46
+ );
47
+
48
+ return (
49
+ <Details
50
+ key={type}
51
+ className="openapi-markdown__details"
52
+ style={{ marginBottom: "1rem" }}
53
+ data-collapsed={false}
54
+ open={true}
55
+ summary={summaryElement}
56
+ >
57
+ <ul>
58
+ {params.map((param: any, index: number) => (
59
+ <ParamsItem
60
+ key={index}
61
+ className="paramsItem"
62
+ param={{
63
+ ...param,
64
+ enumDescriptions: Object.entries(
65
+ param?.schema?.["x-enumDescriptions"] ??
66
+ param?.schema?.items?.["x-enumDescriptions"] ??
67
+ {}
68
+ ),
69
+ }}
70
+ />
71
+ ))}
72
+ </ul>
73
+ </Details>
74
+ );
75
+ })}
76
+ </>
77
+ );
78
+ };
79
+
80
+ const ParamsDetails: React.FC<Props> = (props) => {
81
+ return (
82
+ <BrowserOnly fallback={<SkeletonLoader size="sm" />}>
83
+ {() => {
84
+ return <ParamsDetailsComponent {...props} />;
85
+ }}
86
+ </BrowserOnly>
87
+ );
88
+ };
89
+
90
+ export default ParamsDetails;
@@ -0,0 +1,54 @@
1
+ .openapi-params__list-item {
2
+ margin: 0 0 0 1rem !important;
3
+ position: relative;
4
+ padding-left: 1rem;
5
+ border-left: thin solid var(--openapi-tree-line-color) !important;
6
+ margin-top: unset !important;
7
+
8
+ // Horizonal line styling for param attributes
9
+ &::before {
10
+ position: absolute;
11
+ top: 5px;
12
+ left: 0;
13
+ width: 0.7rem;
14
+ /* width of horizontal line */
15
+ height: 0.5rem;
16
+ /* vertical position of line */
17
+ vertical-align: top;
18
+ border-bottom: thin solid var(--openapi-tree-line-color);
19
+ content: "";
20
+ display: inline-block;
21
+ }
22
+
23
+ &:hover {
24
+ .openapi-schema__property {
25
+ color: var(--ifm-color-primary);
26
+ }
27
+ }
28
+ }
29
+
30
+ .openapi-schema__type {
31
+ opacity: 0.6;
32
+ padding-left: 0.3rem;
33
+ }
34
+
35
+ .openapi-schema__required {
36
+ display: inline-flex;
37
+ align-items: center;
38
+ font-size: 10.5px;
39
+ font-weight: bold;
40
+ color: var(--openapi-required);
41
+ margin-left: 1%;
42
+ background-color: transparent;
43
+ text-transform: uppercase;
44
+ }
45
+
46
+ .openapi-schema__divider {
47
+ flex-grow: 1;
48
+ border-bottom: thin solid var(--ifm-toc-border-color);
49
+ margin: 10px;
50
+ }
51
+
52
+ .openapi-schema__container {
53
+ display: flex;
54
+ }
@@ -0,0 +1,246 @@
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
+
12
+ import Markdown from "@theme/Markdown";
13
+ import SchemaTabs from "@theme/SchemaTabs";
14
+ import TabItem from "@theme/TabItem";
15
+ /* eslint-disable import/no-extraneous-dependencies*/
16
+ import clsx from "clsx";
17
+ import { OPENAPI_SCHEMA_ITEM } from "@theme/translationIds";
18
+
19
+ import { getQualifierMessage, getSchemaName } from "../../markdown/schema";
20
+ import { guard, toString } from "../../markdown/utils";
21
+
22
+ export interface ExampleObject {
23
+ summary?: string;
24
+ description?: string;
25
+ value?: any;
26
+ externalValue?: string;
27
+ }
28
+
29
+ export interface Props {
30
+ className: string;
31
+ param: {
32
+ description: string;
33
+ example: any;
34
+ examples: Record<string, ExampleObject>;
35
+ name: string;
36
+ required: boolean;
37
+ deprecated: boolean;
38
+ schema: any;
39
+ enumDescriptions?: [string, string][];
40
+ };
41
+ }
42
+
43
+ const getEnumDescriptionMarkdown = (enumDescriptions?: [string, string][]) => {
44
+ if (enumDescriptions?.length) {
45
+ const enumValue = translate({
46
+ id: OPENAPI_SCHEMA_ITEM.ENUM_VALUE,
47
+ message: "Enum Value",
48
+ });
49
+ const description = translate({
50
+ id: OPENAPI_SCHEMA_ITEM.ENUM_DESCRIPTION,
51
+ message: "Description",
52
+ });
53
+ return `| ${enumValue} | ${description} |
54
+ | ---- | ----- |
55
+ ${enumDescriptions
56
+ .map((desc) => {
57
+ return `| ${desc[0]} | ${desc[1]} | `.replaceAll("\n", "<br/>");
58
+ })
59
+ .join("\n")}
60
+ `;
61
+ }
62
+
63
+ return "";
64
+ };
65
+
66
+ function ParamsItem({ param, ...rest }: Props) {
67
+ const {
68
+ description,
69
+ example,
70
+ examples,
71
+ name,
72
+ required,
73
+ deprecated,
74
+ enumDescriptions,
75
+ } = param;
76
+
77
+ let schema = param.schema;
78
+ let defaultValue: string | undefined;
79
+
80
+ if (!schema) {
81
+ schema = { type: "any" };
82
+ }
83
+
84
+ if (!schema.type) {
85
+ schema.type = "any";
86
+ }
87
+
88
+ if (schema) {
89
+ if (schema.items) {
90
+ defaultValue = schema.items.default;
91
+ } else {
92
+ defaultValue = schema.default;
93
+ }
94
+ }
95
+
96
+ const renderSchemaName = guard(schema, (schema) => (
97
+ <span className="openapi-schema__type"> {getSchemaName(schema)}</span>
98
+ ));
99
+
100
+ const renderSchemaRequired = guard(required, () => (
101
+ <span className="openapi-schema__required">
102
+ {translate({ id: OPENAPI_SCHEMA_ITEM.REQUIRED, message: "required" })}
103
+ </span>
104
+ ));
105
+
106
+ const renderDeprecated = guard(deprecated, () => (
107
+ <span className="openapi-schema__deprecated">
108
+ {translate({ id: OPENAPI_SCHEMA_ITEM.DEPRECATED, message: "deprecated" })}
109
+ </span>
110
+ ));
111
+
112
+ const renderQualifier = guard(getQualifierMessage(schema), (qualifier) => (
113
+ <Markdown>{qualifier}</Markdown>
114
+ ));
115
+
116
+ const renderDescription = guard(description, (description) => (
117
+ <Markdown>{description}</Markdown>
118
+ ));
119
+
120
+ const renderEnumDescriptions = guard(
121
+ getEnumDescriptionMarkdown(enumDescriptions),
122
+ (value) => {
123
+ return (
124
+ <div style={{ marginTop: ".5rem" }}>
125
+ <Markdown>{value}</Markdown>
126
+ </div>
127
+ );
128
+ }
129
+ );
130
+
131
+ function renderDefaultValue() {
132
+ if (defaultValue !== undefined) {
133
+ if (typeof defaultValue === "string") {
134
+ return (
135
+ <div>
136
+ <strong>
137
+ {translate({
138
+ id: OPENAPI_SCHEMA_ITEM.DEFAULT_VALUE,
139
+ message: "Default value:",
140
+ })}{" "}
141
+ </strong>
142
+ <span>
143
+ <code>{defaultValue}</code>
144
+ </span>
145
+ </div>
146
+ );
147
+ }
148
+ return (
149
+ <div>
150
+ <strong>
151
+ {translate({
152
+ id: OPENAPI_SCHEMA_ITEM.DEFAULT_VALUE,
153
+ message: "Default value:",
154
+ })}{" "}
155
+ </strong>
156
+ <span>
157
+ <code>{JSON.stringify(defaultValue)}</code>
158
+ </span>
159
+ </div>
160
+ );
161
+ }
162
+ return undefined;
163
+ }
164
+
165
+ const renderExample = guard(toString(example), (example) => (
166
+ <div>
167
+ <strong>
168
+ {translate({
169
+ id: OPENAPI_SCHEMA_ITEM.EXAMPLE,
170
+ message: "Example:",
171
+ })}{" "}
172
+ </strong>
173
+ {example}
174
+ </div>
175
+ ));
176
+
177
+ const renderExamples = guard(examples, (examples) => {
178
+ const exampleEntries = Object.entries(examples);
179
+ return (
180
+ <>
181
+ <strong>
182
+ {translate({
183
+ id: OPENAPI_SCHEMA_ITEM.EXAMPLES,
184
+ message: "Examples:",
185
+ })}
186
+ </strong>
187
+ <SchemaTabs>
188
+ {exampleEntries.map(([exampleName, exampleProperties]) => (
189
+ // @ts-ignore
190
+ <TabItem value={exampleName} label={exampleName}>
191
+ {exampleProperties.summary && <p>{exampleProperties.summary}</p>}
192
+ {exampleProperties.description && (
193
+ <p>
194
+ <strong>
195
+ {translate({
196
+ id: OPENAPI_SCHEMA_ITEM.DESCRIPTION,
197
+ message: "Description:",
198
+ })}{" "}
199
+ </strong>
200
+ <span>{exampleProperties.description}</span>
201
+ </p>
202
+ )}
203
+ <p>
204
+ <strong>
205
+ {translate({
206
+ id: OPENAPI_SCHEMA_ITEM.EXAMPLE,
207
+ message: "Example:",
208
+ })}{" "}
209
+ </strong>
210
+ <code>{exampleProperties.value}</code>
211
+ </p>
212
+ </TabItem>
213
+ ))}
214
+ </SchemaTabs>
215
+ </>
216
+ );
217
+ });
218
+
219
+ return (
220
+ <div className="openapi-params__list-item">
221
+ <span className="openapi-schema__container">
222
+ <strong
223
+ className={clsx("openapi-schema__property", {
224
+ "openapi-schema__strikethrough": deprecated,
225
+ })}
226
+ >
227
+ {name}
228
+ </strong>
229
+ {renderSchemaName}
230
+ {(required || deprecated) && (
231
+ <span className="openapi-schema__divider"></span>
232
+ )}
233
+ {renderSchemaRequired}
234
+ {renderDeprecated}
235
+ </span>
236
+ {renderQualifier}
237
+ {renderDescription}
238
+ {renderEnumDescriptions}
239
+ {renderDefaultValue()}
240
+ {renderExample}
241
+ {renderExamples}
242
+ </div>
243
+ );
244
+ }
245
+
246
+ export default ParamsItem;