docusaurus-theme-openapi-docs 0.0.0-1000

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. package/LICENSE +21 -0
  2. package/babel.config.js +35 -0
  3. package/lib/index.d.ts +2 -0
  4. package/lib/index.js +81 -0
  5. package/lib/markdown/createDescription.d.ts +1 -0
  6. package/lib/markdown/createDescription.js +15 -0
  7. package/lib/markdown/schema.d.ts +3 -0
  8. package/lib/markdown/schema.js +149 -0
  9. package/lib/markdown/utils.d.ts +10 -0
  10. package/lib/markdown/utils.js +49 -0
  11. package/lib/markdown/utils.test.d.ts +1 -0
  12. package/lib/markdown/utils.test.js +43 -0
  13. package/lib/theme/ApiExplorer/Accept/index.d.ts +3 -0
  14. package/lib/theme/ApiExplorer/Accept/index.js +38 -0
  15. package/lib/theme/ApiExplorer/Accept/slice.d.ts +11 -0
  16. package/lib/theme/ApiExplorer/Accept/slice.js +22 -0
  17. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
  18. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.d.ts +4 -0
  19. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.js +35 -0
  20. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.d.ts +3 -0
  21. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +41 -0
  22. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.d.ts +3 -0
  23. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.js +153 -0
  24. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
  25. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
  26. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.d.ts +3 -0
  27. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +147 -0
  28. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
  29. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.d.ts +6 -0
  30. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +58 -0
  31. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
  32. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.d.ts +14 -0
  33. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +248 -0
  34. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +34 -0
  35. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.d.ts +3 -0
  36. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.js +59 -0
  37. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
  38. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.d.ts +7 -0
  39. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +51 -0
  40. package/lib/theme/ApiExplorer/ApiCodeBlock/index.d.ts +3 -0
  41. package/lib/theme/ApiExplorer/ApiCodeBlock/index.js +110 -0
  42. package/lib/theme/ApiExplorer/Authorization/auth-types.d.ts +3 -0
  43. package/lib/theme/ApiExplorer/Authorization/auth-types.js +28 -0
  44. package/lib/theme/ApiExplorer/Authorization/index.d.ts +3 -0
  45. package/lib/theme/ApiExplorer/Authorization/index.js +160 -0
  46. package/lib/theme/ApiExplorer/Authorization/slice.d.ts +40 -0
  47. package/lib/theme/ApiExplorer/Authorization/slice.js +102 -0
  48. package/lib/theme/ApiExplorer/Body/index.d.ts +10 -0
  49. package/lib/theme/ApiExplorer/Body/index.js +381 -0
  50. package/lib/theme/ApiExplorer/Body/json2xml.js +43 -0
  51. package/lib/theme/ApiExplorer/Body/slice.d.ts +82 -0
  52. package/lib/theme/ApiExplorer/Body/slice.js +97 -0
  53. package/lib/theme/ApiExplorer/CodeSnippets/code-snippets-types.d.ts +21 -0
  54. package/lib/theme/ApiExplorer/CodeSnippets/code-snippets-types.js +8 -0
  55. package/lib/theme/ApiExplorer/CodeSnippets/index.d.ts +10 -0
  56. package/lib/theme/ApiExplorer/CodeSnippets/index.js +389 -0
  57. package/lib/theme/ApiExplorer/CodeSnippets/languages.d.ts +5 -0
  58. package/lib/theme/ApiExplorer/CodeSnippets/languages.js +95 -0
  59. package/lib/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
  60. package/lib/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +501 -0
  61. package/lib/theme/ApiExplorer/CodeTabs/index.d.ts +15 -0
  62. package/lib/theme/ApiExplorer/CodeTabs/index.js +271 -0
  63. package/lib/theme/ApiExplorer/ContentType/index.d.ts +3 -0
  64. package/lib/theme/ApiExplorer/ContentType/index.js +40 -0
  65. package/lib/theme/ApiExplorer/ContentType/slice.d.ts +11 -0
  66. package/lib/theme/ApiExplorer/ContentType/slice.js +22 -0
  67. package/lib/theme/ApiExplorer/Export/index.d.ts +3 -0
  68. package/lib/theme/ApiExplorer/Export/index.js +57 -0
  69. package/lib/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +27 -0
  70. package/lib/theme/ApiExplorer/FloatingButton/index.d.ts +8 -0
  71. package/lib/theme/ApiExplorer/FloatingButton/index.js +28 -0
  72. package/lib/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss +74 -0
  73. package/lib/theme/ApiExplorer/FormFileUpload/index.d.ts +7 -0
  74. package/lib/theme/ApiExplorer/FormFileUpload/index.js +173 -0
  75. package/lib/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
  76. package/lib/theme/ApiExplorer/FormItem/index.d.ts +10 -0
  77. package/lib/theme/ApiExplorer/FormItem/index.js +44 -0
  78. package/lib/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
  79. package/lib/theme/ApiExplorer/FormMultiSelect/index.d.ts +9 -0
  80. package/lib/theme/ApiExplorer/FormMultiSelect/index.js +51 -0
  81. package/lib/theme/ApiExplorer/FormSelect/_FormSelect.scss +43 -0
  82. package/lib/theme/ApiExplorer/FormSelect/index.d.ts +8 -0
  83. package/lib/theme/ApiExplorer/FormSelect/index.js +35 -0
  84. package/lib/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
  85. package/lib/theme/ApiExplorer/FormTextInput/index.d.ts +9 -0
  86. package/lib/theme/ApiExplorer/FormTextInput/index.js +73 -0
  87. package/lib/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
  88. package/lib/theme/ApiExplorer/LiveEditor/index.d.ts +6 -0
  89. package/lib/theme/ApiExplorer/LiveEditor/index.js +168 -0
  90. package/lib/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
  91. package/lib/theme/ApiExplorer/MethodEndpoint/index.d.ts +8 -0
  92. package/lib/theme/ApiExplorer/MethodEndpoint/index.js +86 -0
  93. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.d.ts +6 -0
  94. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.js +220 -0
  95. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.d.ts +6 -0
  96. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +63 -0
  97. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.d.ts +6 -0
  98. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +89 -0
  99. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.d.ts +6 -0
  100. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +63 -0
  101. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.d.ts +6 -0
  102. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.js +38 -0
  103. package/lib/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +123 -0
  104. package/lib/theme/ApiExplorer/ParamOptions/index.d.ts +7 -0
  105. package/lib/theme/ApiExplorer/ParamOptions/index.js +223 -0
  106. package/lib/theme/ApiExplorer/ParamOptions/slice.d.ts +17 -0
  107. package/lib/theme/ApiExplorer/ParamOptions/slice.js +25 -0
  108. package/lib/theme/ApiExplorer/Request/_Request.scss +129 -0
  109. package/lib/theme/ApiExplorer/Request/index.d.ts +6 -0
  110. package/lib/theme/ApiExplorer/Request/index.js +396 -0
  111. package/lib/theme/ApiExplorer/Request/makeRequest.d.ts +4 -0
  112. package/lib/theme/ApiExplorer/Request/makeRequest.js +222 -0
  113. package/lib/theme/ApiExplorer/Response/_Response.scss +121 -0
  114. package/lib/theme/ApiExplorer/Response/index.d.ts +6 -0
  115. package/lib/theme/ApiExplorer/Response/index.js +193 -0
  116. package/lib/theme/ApiExplorer/Response/slice.d.ts +17 -0
  117. package/lib/theme/ApiExplorer/Response/slice.js +51 -0
  118. package/lib/theme/ApiExplorer/SecuritySchemes/index.d.ts +3 -0
  119. package/lib/theme/ApiExplorer/SecuritySchemes/index.js +380 -0
  120. package/lib/theme/ApiExplorer/Server/_Server.scss +26 -0
  121. package/lib/theme/ApiExplorer/Server/index.d.ts +3 -0
  122. package/lib/theme/ApiExplorer/Server/index.js +199 -0
  123. package/lib/theme/ApiExplorer/Server/slice.d.ts +13 -0
  124. package/lib/theme/ApiExplorer/Server/slice.js +33 -0
  125. package/lib/theme/ApiExplorer/buildPostmanRequest.d.ts +20 -0
  126. package/lib/theme/ApiExplorer/buildPostmanRequest.js +465 -0
  127. package/lib/theme/ApiExplorer/index.d.ts +7 -0
  128. package/lib/theme/ApiExplorer/index.js +41 -0
  129. package/lib/theme/ApiExplorer/persistanceMiddleware.d.ts +3 -0
  130. package/lib/theme/ApiExplorer/persistanceMiddleware.js +54 -0
  131. package/lib/theme/ApiExplorer/storage-utils.d.ts +4 -0
  132. package/lib/theme/ApiExplorer/storage-utils.js +41 -0
  133. package/lib/theme/ApiItem/Layout/index.d.ts +3 -0
  134. package/lib/theme/ApiItem/Layout/index.js +121 -0
  135. package/lib/theme/ApiItem/Layout/styles.module.css +17 -0
  136. package/lib/theme/ApiItem/hooks.d.ts +12 -0
  137. package/lib/theme/ApiItem/hooks.js +13 -0
  138. package/lib/theme/ApiItem/index.d.ts +2 -0
  139. package/lib/theme/ApiItem/index.js +238 -0
  140. package/lib/theme/ApiItem/store.d.ts +46 -0
  141. package/lib/theme/ApiItem/store.js +53 -0
  142. package/lib/theme/ApiLogo/index.d.ts +2 -0
  143. package/lib/theme/ApiLogo/index.js +51 -0
  144. package/lib/theme/ApiTabs/_ApiTabs.scss +142 -0
  145. package/lib/theme/ApiTabs/index.d.ts +7 -0
  146. package/lib/theme/ApiTabs/index.js +270 -0
  147. package/lib/theme/ArrayBrackets/index.d.ts +3 -0
  148. package/lib/theme/ArrayBrackets/index.js +50 -0
  149. package/lib/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +98 -0
  150. package/lib/theme/DiscriminatorTabs/index.d.ts +3 -0
  151. package/lib/theme/DiscriminatorTabs/index.js +258 -0
  152. package/lib/theme/Markdown/Details/_Details.scss +122 -0
  153. package/lib/theme/Markdown/index.js +179 -0
  154. package/lib/theme/MimeTabs/_MimeTabs.scss +70 -0
  155. package/lib/theme/MimeTabs/index.d.ts +6 -0
  156. package/lib/theme/MimeTabs/index.js +286 -0
  157. package/lib/theme/OperationTabs/_OperationTabs.scss +72 -0
  158. package/lib/theme/OperationTabs/index.d.ts +3 -0
  159. package/lib/theme/OperationTabs/index.js +248 -0
  160. package/lib/theme/ParamsDetails/index.d.ts +6 -0
  161. package/lib/theme/ParamsDetails/index.js +85 -0
  162. package/lib/theme/ParamsItem/_ParamsItem.scss +54 -0
  163. package/lib/theme/ParamsItem/index.d.ts +25 -0
  164. package/lib/theme/ParamsItem/index.js +218 -0
  165. package/lib/theme/RequestSchema/index.d.ts +15 -0
  166. package/lib/theme/RequestSchema/index.js +194 -0
  167. package/lib/theme/ResponseExamples/index.d.ts +18 -0
  168. package/lib/theme/ResponseExamples/index.js +193 -0
  169. package/lib/theme/ResponseHeaders/index.d.ts +13 -0
  170. package/lib/theme/ResponseHeaders/index.js +39 -0
  171. package/lib/theme/ResponseSamples/_ResponseSamples.scss +3 -0
  172. package/lib/theme/ResponseSamples/index.d.ts +8 -0
  173. package/lib/theme/ResponseSamples/index.js +27 -0
  174. package/lib/theme/ResponseSchema/index.d.ts +15 -0
  175. package/lib/theme/ResponseSchema/index.js +159 -0
  176. package/lib/theme/Schema/index.d.ts +8 -0
  177. package/lib/theme/Schema/index.js +885 -0
  178. package/lib/theme/SchemaItem/_SchemaItem.scss +89 -0
  179. package/lib/theme/SchemaItem/index.d.ts +12 -0
  180. package/lib/theme/SchemaItem/index.js +213 -0
  181. package/lib/theme/SchemaTabs/_SchemaTabs.scss +61 -0
  182. package/lib/theme/SchemaTabs/index.d.ts +3 -0
  183. package/lib/theme/SchemaTabs/index.js +255 -0
  184. package/lib/theme/SkeletonLoader/index.d.ts +6 -0
  185. package/lib/theme/SkeletonLoader/index.js +20 -0
  186. package/lib/theme/StatusCodes/index.d.ts +9 -0
  187. package/lib/theme/StatusCodes/index.js +81 -0
  188. package/lib/theme/styles.scss +212 -0
  189. package/lib/types.d.ts +157 -0
  190. package/lib/types.js +8 -0
  191. package/package.json +83 -0
  192. package/src/index.ts +85 -0
  193. package/src/markdown/createDescription.ts +13 -0
  194. package/src/markdown/schema.ts +181 -0
  195. package/src/markdown/utils.test.ts +49 -0
  196. package/src/markdown/utils.ts +59 -0
  197. package/src/plugin-content-docs.d.ts +20 -0
  198. package/src/postman-code-generators.d.ts +9 -0
  199. package/src/react-magic-dropzone.d.ts +9 -0
  200. package/src/theme/ApiExplorer/Accept/index.tsx +36 -0
  201. package/src/theme/ApiExplorer/Accept/slice.ts +29 -0
  202. package/src/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
  203. package/src/theme/ApiExplorer/ApiCodeBlock/Container/index.tsx +32 -0
  204. package/src/theme/ApiExplorer/ApiCodeBlock/Content/Element.tsx +34 -0
  205. package/src/theme/ApiExplorer/ApiCodeBlock/Content/String.tsx +134 -0
  206. package/src/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
  207. package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
  208. package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.tsx +79 -0
  209. package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
  210. package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.tsx +55 -0
  211. package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
  212. package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.tsx +166 -0
  213. package/src/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +34 -0
  214. package/src/theme/ApiExplorer/ApiCodeBlock/Line/index.tsx +48 -0
  215. package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
  216. package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.tsx +54 -0
  217. package/src/theme/ApiExplorer/ApiCodeBlock/index.tsx +45 -0
  218. package/src/theme/ApiExplorer/Authorization/auth-types.ts +30 -0
  219. package/src/theme/ApiExplorer/Authorization/index.tsx +158 -0
  220. package/src/theme/ApiExplorer/Authorization/slice.ts +146 -0
  221. package/src/theme/ApiExplorer/Body/index.tsx +376 -0
  222. package/src/theme/ApiExplorer/Body/json2xml.js +43 -0
  223. package/src/theme/ApiExplorer/Body/slice.ts +133 -0
  224. package/src/theme/ApiExplorer/CodeSnippets/code-snippets-types.ts +57 -0
  225. package/src/theme/ApiExplorer/CodeSnippets/index.tsx +338 -0
  226. package/src/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
  227. package/src/theme/ApiExplorer/CodeSnippets/languages.ts +96 -0
  228. package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +501 -0
  229. package/src/theme/ApiExplorer/CodeTabs/index.tsx +248 -0
  230. package/src/theme/ApiExplorer/ContentType/index.tsx +38 -0
  231. package/src/theme/ApiExplorer/ContentType/slice.ts +29 -0
  232. package/src/theme/ApiExplorer/Export/index.tsx +47 -0
  233. package/src/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +27 -0
  234. package/src/theme/ApiExplorer/FloatingButton/index.tsx +29 -0
  235. package/src/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss +74 -0
  236. package/src/theme/ApiExplorer/FormFileUpload/index.tsx +119 -0
  237. package/src/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
  238. package/src/theme/ApiExplorer/FormItem/index.tsx +33 -0
  239. package/src/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
  240. package/src/theme/ApiExplorer/FormMultiSelect/index.tsx +57 -0
  241. package/src/theme/ApiExplorer/FormSelect/_FormSelect.scss +43 -0
  242. package/src/theme/ApiExplorer/FormSelect/index.tsx +38 -0
  243. package/src/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
  244. package/src/theme/ApiExplorer/FormTextInput/index.tsx +80 -0
  245. package/src/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
  246. package/src/theme/ApiExplorer/LiveEditor/index.tsx +114 -0
  247. package/src/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
  248. package/src/theme/ApiExplorer/MethodEndpoint/index.tsx +91 -0
  249. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +175 -0
  250. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +64 -0
  251. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +86 -0
  252. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +65 -0
  253. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.tsx +38 -0
  254. package/src/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +123 -0
  255. package/src/theme/ApiExplorer/ParamOptions/index.tsx +146 -0
  256. package/src/theme/ApiExplorer/ParamOptions/slice.ts +37 -0
  257. package/src/theme/ApiExplorer/Request/_Request.scss +129 -0
  258. package/src/theme/ApiExplorer/Request/index.tsx +309 -0
  259. package/src/theme/ApiExplorer/Request/makeRequest.ts +254 -0
  260. package/src/theme/ApiExplorer/Response/_Response.scss +121 -0
  261. package/src/theme/ApiExplorer/Response/index.tsx +157 -0
  262. package/src/theme/ApiExplorer/Response/slice.ts +52 -0
  263. package/src/theme/ApiExplorer/SecuritySchemes/index.tsx +287 -0
  264. package/src/theme/ApiExplorer/Server/_Server.scss +26 -0
  265. package/src/theme/ApiExplorer/Server/index.tsx +130 -0
  266. package/src/theme/ApiExplorer/Server/slice.ts +39 -0
  267. package/src/theme/ApiExplorer/buildPostmanRequest.ts +526 -0
  268. package/src/theme/ApiExplorer/index.tsx +41 -0
  269. package/src/theme/ApiExplorer/persistanceMiddleware.ts +71 -0
  270. package/src/theme/ApiExplorer/postman-collection.d.ts +10 -0
  271. package/src/theme/ApiExplorer/react-modal.d.ts +8 -0
  272. package/src/theme/ApiExplorer/storage-utils.ts +39 -0
  273. package/src/theme/ApiItem/Layout/index.tsx +85 -0
  274. package/src/theme/ApiItem/Layout/styles.module.css +17 -0
  275. package/src/theme/ApiItem/hooks.ts +13 -0
  276. package/src/theme/ApiItem/index.tsx +222 -0
  277. package/src/theme/ApiItem/store.ts +51 -0
  278. package/src/theme/ApiLogo/index.tsx +52 -0
  279. package/src/theme/ApiTabs/_ApiTabs.scss +142 -0
  280. package/src/theme/ApiTabs/index.tsx +238 -0
  281. package/src/theme/ArrayBrackets/index.tsx +37 -0
  282. package/src/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +98 -0
  283. package/src/theme/DiscriminatorTabs/index.tsx +229 -0
  284. package/src/theme/Markdown/Details/_Details.scss +122 -0
  285. package/src/theme/Markdown/index.js +179 -0
  286. package/src/theme/MimeTabs/_MimeTabs.scss +70 -0
  287. package/src/theme/MimeTabs/index.tsx +257 -0
  288. package/src/theme/OperationTabs/_OperationTabs.scss +72 -0
  289. package/src/theme/OperationTabs/index.tsx +220 -0
  290. package/src/theme/ParamsDetails/index.tsx +81 -0
  291. package/src/theme/ParamsItem/_ParamsItem.scss +54 -0
  292. package/src/theme/ParamsItem/index.tsx +205 -0
  293. package/src/theme/RequestSchema/index.tsx +157 -0
  294. package/src/theme/ResponseExamples/index.tsx +192 -0
  295. package/src/theme/ResponseHeaders/index.tsx +49 -0
  296. package/src/theme/ResponseSamples/_ResponseSamples.scss +3 -0
  297. package/src/theme/ResponseSamples/index.tsx +31 -0
  298. package/src/theme/ResponseSchema/index.tsx +144 -0
  299. package/src/theme/Schema/index.tsx +939 -0
  300. package/src/theme/SchemaItem/_SchemaItem.scss +89 -0
  301. package/src/theme/SchemaItem/index.tsx +198 -0
  302. package/src/theme/SchemaTabs/_SchemaTabs.scss +61 -0
  303. package/src/theme/SchemaTabs/index.tsx +224 -0
  304. package/src/theme/SkeletonLoader/index.tsx +18 -0
  305. package/src/theme/StatusCodes/index.tsx +72 -0
  306. package/src/theme/styles.scss +212 -0
  307. package/src/theme-classic.d.ts +80 -0
  308. package/src/theme-openapi.d.ts +288 -0
  309. package/src/theme-translations.d.ts +9 -0
  310. package/src/types.ts +182 -0
  311. package/tsconfig.json +16 -0
  312. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,91 @@
1
+ .openapi-explorer__code-block-content {
2
+ height: 100%;
3
+ position: relative;
4
+ /* rtl:ignore */
5
+ direction: ltr;
6
+ border-radius: inherit;
7
+ }
8
+
9
+ .openapi-explorer__code-block-title {
10
+ border-bottom: 1px solid var(--ifm-color-emphasis-300);
11
+ font-size: var(--ifm-code-font-size);
12
+ font-weight: 500;
13
+ padding: 0.75rem var(--ifm-pre-padding);
14
+ border-top-left-radius: inherit;
15
+ border-top-right-radius: inherit;
16
+ }
17
+
18
+ .openapi-explorer__code-block {
19
+ height: 100%;
20
+ border-radius: var(--ifm-global-radius);
21
+ --ifm-pre-background: var(--prism-background-color);
22
+ margin: 0;
23
+ padding: 0;
24
+ }
25
+
26
+ .openapi-explorer__code-block-title
27
+ + .openapi-explorer__code-block-content
28
+ .openapi-explorer__code-block {
29
+ border-top-left-radius: 0;
30
+ border-top-right-radius: 0;
31
+ }
32
+
33
+ .openapi-explorer__code-block-standalone {
34
+ padding: 0;
35
+ }
36
+
37
+ .openapi-explorer__code-block-lines {
38
+ font: inherit;
39
+ /* rtl:ignore */
40
+ float: left;
41
+ min-width: 100%;
42
+ padding: var(--ifm-pre-padding);
43
+ }
44
+
45
+ .openapi-explorer__code-block-lines-numbering {
46
+ // This causes max-height to unset
47
+ // display: table;
48
+ padding: var(--ifm-pre-padding) 0;
49
+ }
50
+
51
+ @media print {
52
+ .openapi-explorer__code-block-lines {
53
+ white-space: pre-wrap;
54
+ }
55
+ }
56
+
57
+ .openapi-explorer__code-block-btn-group {
58
+ display: flex;
59
+ column-gap: 0.2rem;
60
+ position: absolute;
61
+ right: calc(var(--ifm-pre-padding) / 2);
62
+ top: calc(var(--ifm-pre-padding) / 2);
63
+ }
64
+
65
+ .openapi-explorer__code-block-btn-group button {
66
+ display: flex;
67
+ align-items: center;
68
+ background: var(--prism-background-color);
69
+ color: var(--prism-color);
70
+ border: 1px solid var(--ifm-color-emphasis-300);
71
+ border-radius: var(--ifm-global-radius);
72
+ padding: 0.4rem;
73
+ line-height: 0;
74
+ transition: opacity 200ms ease-in-out;
75
+ opacity: 0;
76
+ }
77
+
78
+ .openapi-explorer__code-block-btn-group button:focus-visible,
79
+ .openapi-explorer__code-block-btn-group button:hover {
80
+ opacity: 1 !important;
81
+ }
82
+
83
+ .theme-code-block:hover .openapi-explorer__code-block-btn-group button {
84
+ opacity: 0.4;
85
+ }
86
+
87
+ @media screen and (max-width: 996px) {
88
+ .openapi-explorer__expand-btn {
89
+ display: none !important;
90
+ }
91
+ }
@@ -0,0 +1,44 @@
1
+ .theme-code-block:hover {
2
+ .openapi-explorer__code-block-copy-btn--copied {
3
+ opacity: 1 !important;
4
+ }
5
+ }
6
+
7
+ .openapi-explorer__code-block-copy-btn-icons {
8
+ position: relative;
9
+ width: 1.125rem;
10
+ height: 1.125rem;
11
+ }
12
+
13
+ .openapi-explorer__code-block-copy-btn-icon,
14
+ .openapi-explorer__code-block-copy-btn-icon--success {
15
+ position: absolute;
16
+ top: 0;
17
+ left: 0;
18
+ fill: currentColor;
19
+ opacity: inherit;
20
+ width: inherit;
21
+ height: inherit;
22
+ transition: all 0.15s ease;
23
+ }
24
+
25
+ .openapi-explorer__code-block-copy-btn-icon--success {
26
+ top: 50%;
27
+ left: 50%;
28
+ transform: translate(-50%, -50%) scale(0.33);
29
+ opacity: 0;
30
+ color: #00d600;
31
+ }
32
+
33
+ .openapi-explorer__code-block-copy-btn--copied {
34
+ .openapi-explorer__code-block-copy-btn-icon {
35
+ transform: scale(0.33);
36
+ opacity: 0;
37
+ }
38
+
39
+ .openapi-explorer__code-block-copy-btn-icon--success {
40
+ transform: translate(-50%, -50%) scale(1);
41
+ opacity: 1;
42
+ transition-delay: 0.075s;
43
+ }
44
+ }
@@ -0,0 +1,79 @@
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, { useCallback, useState, useRef, useEffect } from "react";
9
+
10
+ import { CopyButtonProps } from "@docusaurus/theme-common/internal";
11
+ import { translate } from "@docusaurus/Translate";
12
+ import clsx from "clsx";
13
+ import copy from "copy-text-to-clipboard";
14
+
15
+ export default function CopyButton({
16
+ code,
17
+ className,
18
+ }: CopyButtonProps): React.JSX.Element {
19
+ const [isCopied, setIsCopied] = useState(false);
20
+ const copyTimeout = useRef<number | undefined>(undefined);
21
+ const handleCopyCode = useCallback(() => {
22
+ copy(code);
23
+ setIsCopied(true);
24
+ copyTimeout.current = window.setTimeout(() => {
25
+ setIsCopied(false);
26
+ }, 1000);
27
+ }, [code]);
28
+
29
+ useEffect(() => () => window.clearTimeout(copyTimeout.current), []);
30
+
31
+ return (
32
+ <button
33
+ type="button"
34
+ aria-label={
35
+ isCopied
36
+ ? translate({
37
+ id: "theme.CodeBlock.copied",
38
+ message: "Copied",
39
+ description: "The copied button label on code blocks",
40
+ })
41
+ : translate({
42
+ id: "theme.CodeBlock.copyButtonAriaLabel",
43
+ message: "Copy code to clipboard",
44
+ description: "The ARIA label for copy code blocks button",
45
+ })
46
+ }
47
+ title={translate({
48
+ id: "theme.CodeBlock.copy",
49
+ message: "Copy",
50
+ description: "The copy button label on code blocks",
51
+ })}
52
+ className={clsx(
53
+ "clean-btn",
54
+ className,
55
+ "openapi-explorer__code-block-copy-btn",
56
+ isCopied && "openapi-explorer__code-block-copy-btn--copied"
57
+ )}
58
+ onClick={handleCopyCode}
59
+ >
60
+ <span
61
+ className="openapi-explorer__code-block-copy-btn-icons"
62
+ aria-hidden="true"
63
+ >
64
+ <svg
65
+ className="openapi-explorer__code-block-copy-btn-icon"
66
+ viewBox="0 0 24 24"
67
+ >
68
+ <path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" />
69
+ </svg>
70
+ <svg
71
+ className="openapi-explorer__code-block-copy-btn-icon--success"
72
+ viewBox="0 0 24 24"
73
+ >
74
+ <path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" />
75
+ </svg>
76
+ </span>
77
+ </button>
78
+ );
79
+ }
@@ -0,0 +1,16 @@
1
+ .openapi-explorer__code-block-exit-btn-icons {
2
+ position: relative;
3
+ width: 1.125rem;
4
+ height: 1.125rem;
5
+ }
6
+
7
+ .openapi-explorer__code-block-exit-btn-icon {
8
+ position: absolute;
9
+ top: 0;
10
+ left: 0;
11
+ fill: currentColor;
12
+ opacity: inherit;
13
+ width: inherit;
14
+ height: inherit;
15
+ transition: all 0.15s ease;
16
+ }
@@ -0,0 +1,55 @@
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 interface Props {
14
+ readonly className: string;
15
+ readonly handler: () => void;
16
+ }
17
+
18
+ export default function ExitButton({
19
+ className,
20
+ handler,
21
+ }: Props): React.JSX.Element {
22
+ return (
23
+ <button
24
+ type="button"
25
+ aria-label={translate({
26
+ id: "theme.CodeBlock.exitButtonAriaLabel",
27
+ message: "Exit expanded view",
28
+ description: "The ARIA label for exit expanded view button",
29
+ })}
30
+ title={translate({
31
+ id: "theme.CodeBlock.copy",
32
+ message: "Copy",
33
+ description: "The exit button label on code blocks",
34
+ })}
35
+ className={clsx(
36
+ "clean-btn",
37
+ "openapi-explorer__code-block-exit-btn",
38
+ className
39
+ )}
40
+ onClick={handler}
41
+ >
42
+ <span
43
+ className="openapi-explorer__code-block-exit-btn-icons"
44
+ aria-hidden="true"
45
+ >
46
+ <svg
47
+ className="openapi-explorer__code-block-exit-btn-icon"
48
+ viewBox="0 0 384 512"
49
+ >
50
+ <path d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z" />
51
+ </svg>
52
+ </span>
53
+ </button>
54
+ );
55
+ }
@@ -0,0 +1,62 @@
1
+ .openapi-explorer__expand-modal-content {
2
+ padding: none;
3
+ border: thin solid var(--ifm-toc-border-color);
4
+ border-radius: var(--ifm-global-radius);
5
+ max-width: 95%;
6
+ width: 65vw;
7
+ height: 65vh;
8
+ overflow: auto;
9
+ }
10
+
11
+ .openapi-explorer__expand-modal-overlay {
12
+ display: flex;
13
+ align-items: center;
14
+ justify-content: center;
15
+ position: fixed;
16
+ inset: 0px;
17
+ background-color: rgba(0, 0, 0, 0.9);
18
+ z-index: 201;
19
+ }
20
+
21
+ .theme-code-block:hover .openapi-explorer__code-block-expand-btn--copied {
22
+ opacity: 1 !important;
23
+ }
24
+
25
+ .openapi-explorer__code-block-expand-btn-icons {
26
+ position: relative;
27
+ width: 1.125rem;
28
+ height: 1.125rem;
29
+ }
30
+
31
+ .openapi-explorer__code-block-expand-btn-icon,
32
+ .openapi-explorer__code-block-expand-btn-icon--success {
33
+ position: absolute;
34
+ top: 0;
35
+ left: 0;
36
+ fill: currentColor;
37
+ opacity: inherit;
38
+ width: inherit;
39
+ height: inherit;
40
+ transition: all 0.15s ease;
41
+ }
42
+
43
+ .openapi-explorer__code-block-expand-btn-icon--success {
44
+ top: 50%;
45
+ left: 50%;
46
+ transform: translate(-50%, -50%) scale(0.33);
47
+ opacity: 0;
48
+ color: #00d600;
49
+ }
50
+
51
+ .openapi-explorer__code-block-expand-btn--copied
52
+ .openapi-explorer__code-block-expand-btn-icon {
53
+ transform: scale(0.33);
54
+ opacity: 0;
55
+ }
56
+
57
+ .openapi-explorer__code-block-expand-btn--copied
58
+ .openapi-explorer__code-block-expand-btn-icon--success {
59
+ transform: translate(-50%, -50%) scale(1);
60
+ opacity: 1;
61
+ transition-delay: 0.075s;
62
+ }
@@ -0,0 +1,166 @@
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
+
10
+ import { usePrismTheme } from "@docusaurus/theme-common";
11
+ import { translate } from "@docusaurus/Translate";
12
+ import Container from "@theme/ApiExplorer/ApiCodeBlock/Container";
13
+ import CopyButton from "@theme/ApiExplorer/ApiCodeBlock/CopyButton";
14
+ import ExitButton from "@theme/ApiExplorer/ApiCodeBlock/ExitButton";
15
+ import Line from "@theme/ApiExplorer/ApiCodeBlock/Line";
16
+ import clsx from "clsx";
17
+ import { Highlight, Language } from "prism-react-renderer";
18
+ import Modal from "react-modal";
19
+
20
+ export interface Props {
21
+ readonly code: string;
22
+ readonly className: string;
23
+ readonly language: Language;
24
+ readonly showLineNumbers: boolean;
25
+ readonly blockClassName: string;
26
+ readonly title: string | undefined;
27
+ readonly lineClassNames: { [lineIndex: number]: string[] };
28
+ }
29
+
30
+ export default function ExpandButton({
31
+ code,
32
+ className,
33
+ language,
34
+ showLineNumbers,
35
+ blockClassName,
36
+ title,
37
+ lineClassNames,
38
+ }: Props): React.JSX.Element {
39
+ const [isModalOpen, setIsModalOpen] = useState(false);
40
+ const prismTheme = usePrismTheme();
41
+
42
+ useEffect(() => {
43
+ Modal.setAppElement("body");
44
+ }, []);
45
+
46
+ return (
47
+ <>
48
+ <button
49
+ type="button"
50
+ aria-label={
51
+ isModalOpen
52
+ ? translate({
53
+ id: "theme.CodeBlock.expanded",
54
+ message: "Expanded",
55
+ description: "The expanded button label on code blocks",
56
+ })
57
+ : translate({
58
+ id: "theme.CodeBlock.expandButtonAriaLabel",
59
+ message: "Expand code to fullscreen",
60
+ description: "The ARIA label for expand code blocks button",
61
+ })
62
+ }
63
+ title={translate({
64
+ id: "theme.CodeBlock.expand",
65
+ message: "Expand",
66
+ description: "The expand button label on code blocks",
67
+ })}
68
+ className={clsx(
69
+ "clean-btn",
70
+ className,
71
+ "openapi-explorer__code-block-expand-btn",
72
+ isModalOpen && "openapi-explorer__code-block-expand-btn--copied"
73
+ )}
74
+ onClick={() => setIsModalOpen(true)}
75
+ >
76
+ <span
77
+ className="openapi-explorer__code-block-expand-btn-icons"
78
+ aria-hidden="true"
79
+ >
80
+ <svg
81
+ className="openapi-explorer__code-block-expand-btn-icon"
82
+ viewBox="0 0 448 512"
83
+ >
84
+ <path d="M32 32C14.3 32 0 46.3 0 64v96c0 17.7 14.3 32 32 32s32-14.3 32-32V96h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H32zM64 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H64V352zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32h64v64c0 17.7 14.3 32 32 32s32-14.3 32-32V64c0-17.7-14.3-32-32-32H320zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v64H320c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32V352z" />
85
+ </svg>
86
+ <svg
87
+ className="openapi-explorer__code-block-expand-btn-icon--success"
88
+ viewBox="0 0 24 24"
89
+ >
90
+ <path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" />
91
+ </svg>
92
+ </span>
93
+ </button>
94
+ <Modal
95
+ className="openapi-explorer__expand-modal-content"
96
+ overlayClassName="openapi-explorer__expand-modal-overlay"
97
+ isOpen={isModalOpen}
98
+ onRequestClose={() => setIsModalOpen(false)}
99
+ contentLabel="Code Snippet"
100
+ >
101
+ <Container
102
+ as="div"
103
+ className={clsx(
104
+ "openapi-explorer__code-block-container",
105
+ language &&
106
+ !blockClassName.includes(`language-${language}`) &&
107
+ `language-${language}`
108
+ )}
109
+ >
110
+ {title && (
111
+ <div className="openapi-explorer__code-block-title">{title}</div>
112
+ )}
113
+ <div className="openapi-explorer__code-block-content">
114
+ <Highlight
115
+ // {...defaultProps}
116
+ theme={prismTheme}
117
+ code={code}
118
+ language={language ?? "text"}
119
+ >
120
+ {({ className, tokens, getLineProps, getTokenProps }) => (
121
+ <pre
122
+ /* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */
123
+ tabIndex={0}
124
+ className={clsx(
125
+ className,
126
+ "openapi-explorer__code-block",
127
+ "thin-scrollbar"
128
+ )}
129
+ >
130
+ <code
131
+ className={clsx(
132
+ "openapi-explorer__code-block-lines",
133
+ showLineNumbers &&
134
+ "openapi-explorer__code-block-lines-numbers"
135
+ )}
136
+ >
137
+ {tokens.map((line, i) => (
138
+ <Line
139
+ key={i}
140
+ line={line}
141
+ getLineProps={getLineProps}
142
+ getTokenProps={getTokenProps}
143
+ classNames={lineClassNames[i]}
144
+ showLineNumbers={showLineNumbers}
145
+ />
146
+ ))}
147
+ </code>
148
+ </pre>
149
+ )}
150
+ </Highlight>
151
+ <div className="openapi-explorer__code-block-btn-group">
152
+ <CopyButton
153
+ className="openapi-explorer__code-block-code-btn"
154
+ code={code}
155
+ />
156
+ <ExitButton
157
+ className="openapi-explorer__code-block-code-btn"
158
+ handler={() => setIsModalOpen(false)}
159
+ />
160
+ </div>
161
+ </div>
162
+ </Container>
163
+ </Modal>
164
+ </>
165
+ );
166
+ }
@@ -0,0 +1,34 @@
1
+ /* Intentionally has zero specificity, so that to be able to override
2
+ the background in custom CSS file due bug https://github.com/facebook/docusaurus/issues/3678 */
3
+ :where(:root) {
4
+ --docusaurus-highlighted-code-line-bg: rgb(72 77 91);
5
+ }
6
+
7
+ :where([data-theme="dark"]) {
8
+ --docusaurus-highlighted-code-line-bg: rgb(100 100 100);
9
+ }
10
+
11
+ .openapi-explorer__code-block-code-line {
12
+ display: table-row;
13
+ counter-increment: line-count;
14
+ }
15
+
16
+ .openapi-explorer__code-block-code-line-number {
17
+ display: table-cell;
18
+ text-align: right;
19
+ width: 1%;
20
+ position: sticky;
21
+ left: 0;
22
+ padding: 0 var(--ifm-pre-padding);
23
+ background: var(--ifm-pre-background);
24
+ overflow-wrap: normal;
25
+ }
26
+
27
+ .openapi-explorer__code-block-code-line-number::before {
28
+ content: counter(line-count);
29
+ opacity: 0.4;
30
+ }
31
+
32
+ .openapi-explorer__code-block-code-line-number {
33
+ padding-right: var(--ifm-pre-padding);
34
+ }
@@ -0,0 +1,48 @@
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 { LineProps } from "@docusaurus/theme-common/internal";
11
+ import clsx from "clsx";
12
+
13
+ export default function CodeBlockLine({
14
+ line,
15
+ classNames,
16
+ showLineNumbers,
17
+ getLineProps,
18
+ getTokenProps,
19
+ }: LineProps): React.JSX.Element {
20
+ if (line.length === 1 && line[0].content === "\n") {
21
+ line[0].content = "";
22
+ }
23
+ const lineProps = getLineProps({
24
+ line,
25
+ className: clsx(
26
+ classNames,
27
+ showLineNumbers && "openapi-explorer__code-block-code-line"
28
+ ),
29
+ });
30
+ const lineTokens = line.map((token, key) => (
31
+ <span key={key} {...getTokenProps({ token, key })} />
32
+ ));
33
+ return (
34
+ <span {...lineProps}>
35
+ {showLineNumbers ? (
36
+ <>
37
+ <span className="openapi-explorer__code-block-code-line-number" />
38
+ <span className="openapi-explorer__code-block-code-line-content">
39
+ {lineTokens}
40
+ </span>
41
+ </>
42
+ ) : (
43
+ lineTokens
44
+ )}
45
+ <br />
46
+ </span>
47
+ );
48
+ }
@@ -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,54 @@
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 interface Props {
14
+ readonly className?: string;
15
+ readonly onClick: React.MouseEventHandler;
16
+ readonly isEnabled: boolean;
17
+ }
18
+
19
+ export default function WordWrapButton({
20
+ className,
21
+ onClick,
22
+ isEnabled,
23
+ }: Props): React.JSX.Element | null {
24
+ const title = translate({
25
+ id: "theme.CodeBlock.wordWrapToggle",
26
+ message: "Toggle word wrap",
27
+ description:
28
+ "The title attribute for toggle word wrapping button of code block lines",
29
+ });
30
+ return (
31
+ <button
32
+ type="button"
33
+ onClick={onClick}
34
+ className={clsx(
35
+ "clean-btn",
36
+ className,
37
+ isEnabled && "openapi-explorer__code-block-word-wrap-btn--enabled"
38
+ )}
39
+ aria-label={title}
40
+ title={title}
41
+ >
42
+ <svg
43
+ className="openapi-explorer__code-block-word-wrap-btn-icon"
44
+ viewBox="0 0 24 24"
45
+ aria-hidden="true"
46
+ >
47
+ <path
48
+ fill="currentColor"
49
+ 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"
50
+ />
51
+ </svg>
52
+ </button>
53
+ );
54
+ }