@looker/api-explorer 0.9.52 → 0.9.53

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 (397) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/e2e/diffScene.spec.ts +1 -1
  3. package/lib/ApiExplorer.js.map +1 -1
  4. package/lib/App.js.map +1 -1
  5. package/lib/StandaloneApiExplorer.js.map +1 -1
  6. package/lib/components/Banner/Banner.js.map +1 -1
  7. package/lib/components/DocActivityType/DocActivityType.js.map +1 -1
  8. package/lib/components/DocCode/DocCode.js.map +1 -1
  9. package/lib/components/DocMarkdown/DocMarkdown.js.map +1 -1
  10. package/lib/components/DocMarkdown/utils.js.map +1 -1
  11. package/lib/components/DocMethodSummary/DocMethodSummary.js.map +1 -1
  12. package/lib/components/DocMethodSummary/DocSummaryStatus.js.map +1 -1
  13. package/lib/components/DocMethodSummary/utils.js.map +1 -1
  14. package/lib/components/DocPseudo/DocParam.js.map +1 -1
  15. package/lib/components/DocPseudo/DocParams.js.map +1 -1
  16. package/lib/components/DocPseudo/DocPrimaryResponse.js.map +1 -1
  17. package/lib/components/DocPseudo/DocPseudo.js.map +1 -1
  18. package/lib/components/DocRateLimited/DocRateLimited.js.map +1 -1
  19. package/lib/components/DocReferences/DocReferences.js.map +1 -1
  20. package/lib/components/DocReferences/utils.js.map +1 -1
  21. package/lib/components/DocSDKs/DocDeclarations.js.map +1 -1
  22. package/lib/components/DocSDKs/DocSDKs.js.map +1 -1
  23. package/lib/components/DocSchema/DocSchema.js.map +1 -1
  24. package/lib/components/DocSdkUsage/DocSdkExampleCell.js.map +1 -1
  25. package/lib/components/DocSdkUsage/DocSdkUsage.js.map +1 -1
  26. package/lib/components/DocSdkUsage/utils.js.map +1 -1
  27. package/lib/components/DocSource/DocSource.js.map +1 -1
  28. package/lib/components/DocStatus/DocStatus.js.map +1 -1
  29. package/lib/components/DocTitle/DocTitle.js.map +1 -1
  30. package/lib/components/DocTypeSummary/DocTypeSummary.js.map +1 -1
  31. package/lib/components/ErrorBoundary/ErrorBoundary.js.map +1 -1
  32. package/lib/components/ErrorBoundary/components/SomethingWentWrong/SomethingWentWrong.js.map +1 -1
  33. package/lib/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.js.map +1 -1
  34. package/lib/components/ExploreType/ExploreProperty.js.map +1 -1
  35. package/lib/components/ExploreType/ExploreType.js.map +1 -1
  36. package/lib/components/ExploreType/exploreUtils.js.map +1 -1
  37. package/lib/components/Header/Header.js.map +1 -1
  38. package/lib/components/SelectorContainer/ApiSpecSelector.js.map +1 -1
  39. package/lib/components/SelectorContainer/SdkLanguageSelector.js.map +1 -1
  40. package/lib/components/SelectorContainer/SelectorContainer.js.map +1 -1
  41. package/lib/components/SelectorContainer/utils.js.map +1 -1
  42. package/lib/components/SideNav/SearchMessage.js.map +1 -1
  43. package/lib/components/SideNav/SideNav.js.map +1 -1
  44. package/lib/components/SideNav/SideNavMethodTags.js.map +1 -1
  45. package/lib/components/SideNav/SideNavMethods.js.map +1 -1
  46. package/lib/components/SideNav/SideNavTypeTags.js.map +1 -1
  47. package/lib/components/SideNav/SideNavTypes.js.map +1 -1
  48. package/lib/components/common/Loader.js.map +1 -1
  49. package/lib/components/common/common.js.map +1 -1
  50. package/lib/esm/ApiExplorer.js +55 -64
  51. package/lib/esm/ApiExplorer.js.map +1 -1
  52. package/lib/esm/App.js +9 -12
  53. package/lib/esm/App.js.map +1 -1
  54. package/lib/esm/StandaloneApiExplorer.js +20 -29
  55. package/lib/esm/StandaloneApiExplorer.js.map +1 -1
  56. package/lib/esm/components/Banner/Banner.js +8 -17
  57. package/lib/esm/components/Banner/Banner.js.map +1 -1
  58. package/lib/esm/components/Banner/index.js +1 -12
  59. package/lib/esm/components/Banner/index.js.map +1 -1
  60. package/lib/esm/components/DocActivityType/DocActivityType.js +7 -15
  61. package/lib/esm/components/DocActivityType/DocActivityType.js.map +1 -1
  62. package/lib/esm/components/DocActivityType/index.js +1 -12
  63. package/lib/esm/components/DocActivityType/index.js.map +1 -1
  64. package/lib/esm/components/DocCode/DocCode.js +9 -17
  65. package/lib/esm/components/DocCode/DocCode.js.map +1 -1
  66. package/lib/esm/components/DocCode/index.js +1 -12
  67. package/lib/esm/components/DocCode/index.js.map +1 -1
  68. package/lib/esm/components/DocMarkdown/DocMarkdown.js +13 -21
  69. package/lib/esm/components/DocMarkdown/DocMarkdown.js.map +1 -1
  70. package/lib/esm/components/DocMarkdown/index.js +1 -12
  71. package/lib/esm/components/DocMarkdown/index.js.map +1 -1
  72. package/lib/esm/components/DocMarkdown/utils.js +2 -10
  73. package/lib/esm/components/DocMarkdown/utils.js.map +1 -1
  74. package/lib/esm/components/DocMethodSummary/DocMethodSummary.js +15 -23
  75. package/lib/esm/components/DocMethodSummary/DocMethodSummary.js.map +1 -1
  76. package/lib/esm/components/DocMethodSummary/DocSummaryStatus.js +7 -15
  77. package/lib/esm/components/DocMethodSummary/DocSummaryStatus.js.map +1 -1
  78. package/lib/esm/components/DocMethodSummary/index.js +3 -26
  79. package/lib/esm/components/DocMethodSummary/index.js.map +1 -1
  80. package/lib/esm/components/DocMethodSummary/utils.js +18 -27
  81. package/lib/esm/components/DocMethodSummary/utils.js.map +1 -1
  82. package/lib/esm/components/DocPseudo/DocParam.js +7 -15
  83. package/lib/esm/components/DocPseudo/DocParam.js.map +1 -1
  84. package/lib/esm/components/DocPseudo/DocParams.js +5 -14
  85. package/lib/esm/components/DocPseudo/DocParams.js.map +1 -1
  86. package/lib/esm/components/DocPseudo/DocPrimaryResponse.js +5 -13
  87. package/lib/esm/components/DocPseudo/DocPrimaryResponse.js.map +1 -1
  88. package/lib/esm/components/DocPseudo/DocPseudo.js +9 -17
  89. package/lib/esm/components/DocPseudo/DocPseudo.js.map +1 -1
  90. package/lib/esm/components/DocPseudo/index.js +1 -12
  91. package/lib/esm/components/DocPseudo/index.js.map +1 -1
  92. package/lib/esm/components/DocRateLimited/DocRateLimited.js +5 -13
  93. package/lib/esm/components/DocRateLimited/DocRateLimited.js.map +1 -1
  94. package/lib/esm/components/DocRateLimited/index.js +1 -12
  95. package/lib/esm/components/DocRateLimited/index.js.map +1 -1
  96. package/lib/esm/components/DocReferences/DocReferences.js +10 -18
  97. package/lib/esm/components/DocReferences/DocReferences.js.map +1 -1
  98. package/lib/esm/components/DocReferences/index.js +1 -12
  99. package/lib/esm/components/DocReferences/index.js.map +1 -1
  100. package/lib/esm/components/DocReferences/utils.js +11 -19
  101. package/lib/esm/components/DocReferences/utils.js.map +1 -1
  102. package/lib/esm/components/DocSDKs/DocDeclarations.js +7 -15
  103. package/lib/esm/components/DocSDKs/DocDeclarations.js.map +1 -1
  104. package/lib/esm/components/DocSDKs/DocSDKs.js +21 -30
  105. package/lib/esm/components/DocSDKs/DocSDKs.js.map +1 -1
  106. package/lib/esm/components/DocSDKs/index.js +1 -12
  107. package/lib/esm/components/DocSDKs/index.js.map +1 -1
  108. package/lib/esm/components/DocSDKs/utils.js +3 -11
  109. package/lib/esm/components/DocSDKs/utils.js.map +1 -1
  110. package/lib/esm/components/DocSchema/DocSchema.js +7 -15
  111. package/lib/esm/components/DocSchema/DocSchema.js.map +1 -1
  112. package/lib/esm/components/DocSchema/index.js +1 -12
  113. package/lib/esm/components/DocSchema/index.js.map +1 -1
  114. package/lib/esm/components/DocSdkUsage/DocSdkExampleCell.js +6 -14
  115. package/lib/esm/components/DocSdkUsage/DocSdkExampleCell.js.map +1 -1
  116. package/lib/esm/components/DocSdkUsage/DocSdkUsage.js +38 -47
  117. package/lib/esm/components/DocSdkUsage/DocSdkUsage.js.map +1 -1
  118. package/lib/esm/components/DocSdkUsage/index.js +1 -12
  119. package/lib/esm/components/DocSdkUsage/index.js.map +1 -1
  120. package/lib/esm/components/DocSdkUsage/utils.js +11 -24
  121. package/lib/esm/components/DocSdkUsage/utils.js.map +1 -1
  122. package/lib/esm/components/DocSource/DocSource.js +13 -21
  123. package/lib/esm/components/DocSource/DocSource.js.map +1 -1
  124. package/lib/esm/components/DocSource/index.js +1 -12
  125. package/lib/esm/components/DocSource/index.js.map +1 -1
  126. package/lib/esm/components/DocStatus/DocStatus.js +8 -16
  127. package/lib/esm/components/DocStatus/DocStatus.js.map +1 -1
  128. package/lib/esm/components/DocStatus/index.js +1 -12
  129. package/lib/esm/components/DocStatus/index.js.map +1 -1
  130. package/lib/esm/components/DocTitle/DocTitle.js +3 -11
  131. package/lib/esm/components/DocTitle/DocTitle.js.map +1 -1
  132. package/lib/esm/components/DocTitle/index.js +1 -12
  133. package/lib/esm/components/DocTitle/index.js.map +1 -1
  134. package/lib/esm/components/DocTypeSummary/DocTypeSummary.js +11 -19
  135. package/lib/esm/components/DocTypeSummary/DocTypeSummary.js.map +1 -1
  136. package/lib/esm/components/DocTypeSummary/index.js +1 -12
  137. package/lib/esm/components/DocTypeSummary/index.js.map +1 -1
  138. package/lib/esm/components/ErrorBoundary/ErrorBoundary.js +5 -14
  139. package/lib/esm/components/ErrorBoundary/ErrorBoundary.js.map +1 -1
  140. package/lib/esm/components/ErrorBoundary/components/SomethingWentWrong/SomethingWentWrong.js +11 -19
  141. package/lib/esm/components/ErrorBoundary/components/SomethingWentWrong/SomethingWentWrong.js.map +1 -1
  142. package/lib/esm/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.js +46 -54
  143. package/lib/esm/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.js.map +1 -1
  144. package/lib/esm/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/index.js +1 -12
  145. package/lib/esm/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/index.js.map +1 -1
  146. package/lib/esm/components/ErrorBoundary/components/SomethingWentWrong/components/index.js +1 -12
  147. package/lib/esm/components/ErrorBoundary/components/SomethingWentWrong/components/index.js.map +1 -1
  148. package/lib/esm/components/ErrorBoundary/components/SomethingWentWrong/index.js +1 -12
  149. package/lib/esm/components/ErrorBoundary/components/SomethingWentWrong/index.js.map +1 -1
  150. package/lib/esm/components/ErrorBoundary/index.js +1 -12
  151. package/lib/esm/components/ErrorBoundary/index.js.map +1 -1
  152. package/lib/esm/components/ExploreType/ExploreProperty.js +48 -63
  153. package/lib/esm/components/ExploreType/ExploreProperty.js.map +1 -1
  154. package/lib/esm/components/ExploreType/ExploreType.js +23 -32
  155. package/lib/esm/components/ExploreType/ExploreType.js.map +1 -1
  156. package/lib/esm/components/ExploreType/exploreUtils.js +38 -51
  157. package/lib/esm/components/ExploreType/exploreUtils.js.map +1 -1
  158. package/lib/esm/components/ExploreType/index.js +3 -80
  159. package/lib/esm/components/ExploreType/index.js.map +1 -1
  160. package/lib/esm/components/Header/Header.js +20 -31
  161. package/lib/esm/components/Header/Header.js.map +1 -1
  162. package/lib/esm/components/Header/index.js +1 -24
  163. package/lib/esm/components/Header/index.js.map +1 -1
  164. package/lib/esm/components/Link/Link.js +3 -11
  165. package/lib/esm/components/Link/Link.js.map +1 -1
  166. package/lib/esm/components/Link/index.js +1 -12
  167. package/lib/esm/components/Link/index.js.map +1 -1
  168. package/lib/esm/components/SelectorContainer/ApiSpecSelector.js +11 -19
  169. package/lib/esm/components/SelectorContainer/ApiSpecSelector.js.map +1 -1
  170. package/lib/esm/components/SelectorContainer/SdkLanguageSelector.js +16 -25
  171. package/lib/esm/components/SelectorContainer/SdkLanguageSelector.js.map +1 -1
  172. package/lib/esm/components/SelectorContainer/SelectorContainer.js +16 -25
  173. package/lib/esm/components/SelectorContainer/SelectorContainer.js.map +1 -1
  174. package/lib/esm/components/SelectorContainer/index.js +1 -12
  175. package/lib/esm/components/SelectorContainer/index.js.map +1 -1
  176. package/lib/esm/components/SelectorContainer/utils.js +4 -11
  177. package/lib/esm/components/SelectorContainer/utils.js.map +1 -1
  178. package/lib/esm/components/SideNav/SearchMessage.js +8 -16
  179. package/lib/esm/components/SideNav/SearchMessage.js.map +1 -1
  180. package/lib/esm/components/SideNav/SideNav.js +41 -50
  181. package/lib/esm/components/SideNav/SideNav.js.map +1 -1
  182. package/lib/esm/components/SideNav/SideNavMethodTags.js +6 -14
  183. package/lib/esm/components/SideNav/SideNavMethodTags.js.map +1 -1
  184. package/lib/esm/components/SideNav/SideNavMethods.js +22 -32
  185. package/lib/esm/components/SideNav/SideNavMethods.js.map +1 -1
  186. package/lib/esm/components/SideNav/SideNavTypeTags.js +6 -14
  187. package/lib/esm/components/SideNav/SideNavTypeTags.js.map +1 -1
  188. package/lib/esm/components/SideNav/SideNavTypes.js +22 -32
  189. package/lib/esm/components/SideNav/SideNavTypes.js.map +1 -1
  190. package/lib/esm/components/SideNav/index.js +1 -12
  191. package/lib/esm/components/SideNav/index.js.map +1 -1
  192. package/lib/esm/components/SideNav/searchUtils.js +6 -15
  193. package/lib/esm/components/SideNav/searchUtils.js.map +1 -1
  194. package/lib/esm/components/common/Loader.js +8 -16
  195. package/lib/esm/components/common/Loader.js.map +1 -1
  196. package/lib/esm/components/common/common.js +11 -21
  197. package/lib/esm/components/common/common.js.map +1 -1
  198. package/lib/esm/components/common/index.js +2 -27
  199. package/lib/esm/components/common/index.js.map +1 -1
  200. package/lib/esm/components/index.js +22 -183
  201. package/lib/esm/components/index.js.map +1 -1
  202. package/lib/esm/index.js +5 -60
  203. package/lib/esm/index.js.map +1 -1
  204. package/lib/esm/routes/AppRouter.js +22 -30
  205. package/lib/esm/routes/AppRouter.js.map +1 -1
  206. package/lib/esm/routes/index.js +1 -12
  207. package/lib/esm/routes/index.js.map +1 -1
  208. package/lib/esm/scenes/DiffScene/DiffScene.js +43 -52
  209. package/lib/esm/scenes/DiffScene/DiffScene.js.map +1 -1
  210. package/lib/esm/scenes/DiffScene/DocDiff/DiffBanner.js +9 -17
  211. package/lib/esm/scenes/DiffScene/DocDiff/DiffBanner.js.map +1 -1
  212. package/lib/esm/scenes/DiffScene/DocDiff/DiffItem.js +33 -44
  213. package/lib/esm/scenes/DiffScene/DocDiff/DiffItem.js.map +1 -1
  214. package/lib/esm/scenes/DiffScene/DocDiff/DiffLegend.js +18 -26
  215. package/lib/esm/scenes/DiffScene/DocDiff/DiffLegend.js.map +1 -1
  216. package/lib/esm/scenes/DiffScene/DocDiff/DocDiff.js +11 -20
  217. package/lib/esm/scenes/DiffScene/DocDiff/DocDiff.js.map +1 -1
  218. package/lib/esm/scenes/DiffScene/DocDiff/docDiffUtils.js +5 -13
  219. package/lib/esm/scenes/DiffScene/DocDiff/docDiffUtils.js.map +1 -1
  220. package/lib/esm/scenes/DiffScene/DocDiff/index.js +1 -12
  221. package/lib/esm/scenes/DiffScene/DocDiff/index.js.map +1 -1
  222. package/lib/esm/scenes/DiffScene/diffUtils.js +8 -19
  223. package/lib/esm/scenes/DiffScene/diffUtils.js.map +1 -1
  224. package/lib/esm/scenes/DiffScene/index.js +1 -12
  225. package/lib/esm/scenes/DiffScene/index.js.map +1 -1
  226. package/lib/esm/scenes/ErrorDetailScene/ErrorDetailScene.js +11 -19
  227. package/lib/esm/scenes/ErrorDetailScene/ErrorDetailScene.js.map +1 -1
  228. package/lib/esm/scenes/ErrorDetailScene/index.js +1 -12
  229. package/lib/esm/scenes/ErrorDetailScene/index.js.map +1 -1
  230. package/lib/esm/scenes/HomeScene/HomeScene.js +9 -17
  231. package/lib/esm/scenes/HomeScene/HomeScene.js.map +1 -1
  232. package/lib/esm/scenes/HomeScene/index.js +1 -12
  233. package/lib/esm/scenes/HomeScene/index.js.map +1 -1
  234. package/lib/esm/scenes/MethodScene/MethodScene.js +47 -56
  235. package/lib/esm/scenes/MethodScene/MethodScene.js.map +1 -1
  236. package/lib/esm/scenes/MethodScene/components/DocOperation.js +12 -20
  237. package/lib/esm/scenes/MethodScene/components/DocOperation.js.map +1 -1
  238. package/lib/esm/scenes/MethodScene/components/DocRequestBody.js +7 -15
  239. package/lib/esm/scenes/MethodScene/components/DocRequestBody.js.map +1 -1
  240. package/lib/esm/scenes/MethodScene/components/DocResponses/DocResponseTypes.js +11 -20
  241. package/lib/esm/scenes/MethodScene/components/DocResponses/DocResponseTypes.js.map +1 -1
  242. package/lib/esm/scenes/MethodScene/components/DocResponses/DocResponses.js +19 -28
  243. package/lib/esm/scenes/MethodScene/components/DocResponses/DocResponses.js.map +1 -1
  244. package/lib/esm/scenes/MethodScene/components/DocResponses/index.js +1 -12
  245. package/lib/esm/scenes/MethodScene/components/DocResponses/index.js.map +1 -1
  246. package/lib/esm/scenes/MethodScene/components/DocResponses/utils.js +1 -8
  247. package/lib/esm/scenes/MethodScene/components/DocResponses/utils.js.map +1 -1
  248. package/lib/esm/scenes/MethodScene/components/index.js +3 -26
  249. package/lib/esm/scenes/MethodScene/components/index.js.map +1 -1
  250. package/lib/esm/scenes/MethodScene/index.js +1 -12
  251. package/lib/esm/scenes/MethodScene/index.js.map +1 -1
  252. package/lib/esm/scenes/MethodTagScene/MethodTagScene.js +31 -40
  253. package/lib/esm/scenes/MethodTagScene/MethodTagScene.js.map +1 -1
  254. package/lib/esm/scenes/MethodTagScene/index.js +1 -12
  255. package/lib/esm/scenes/MethodTagScene/index.js.map +1 -1
  256. package/lib/esm/scenes/MethodTagScene/utils.js +1 -8
  257. package/lib/esm/scenes/MethodTagScene/utils.js.map +1 -1
  258. package/lib/esm/scenes/TypeScene/TypeScene.js +20 -29
  259. package/lib/esm/scenes/TypeScene/TypeScene.js.map +1 -1
  260. package/lib/esm/scenes/TypeScene/index.js +1 -12
  261. package/lib/esm/scenes/TypeScene/index.js.map +1 -1
  262. package/lib/esm/scenes/TypeTagScene/TypeTagScene.js +30 -39
  263. package/lib/esm/scenes/TypeTagScene/TypeTagScene.js.map +1 -1
  264. package/lib/esm/scenes/TypeTagScene/index.js +1 -12
  265. package/lib/esm/scenes/TypeTagScene/index.js.map +1 -1
  266. package/lib/esm/scenes/TypeTagScene/utils.js +1 -8
  267. package/lib/esm/scenes/TypeTagScene/utils.js.map +1 -1
  268. package/lib/esm/scenes/index.js +6 -47
  269. package/lib/esm/scenes/index.js.map +1 -1
  270. package/lib/esm/scenes/utils/hooks/index.js +1 -12
  271. package/lib/esm/scenes/utils/hooks/index.js.map +1 -1
  272. package/lib/esm/scenes/utils/hooks/tagStoreSync.js +14 -21
  273. package/lib/esm/scenes/utils/hooks/tagStoreSync.js.map +1 -1
  274. package/lib/esm/scenes/utils/index.js +1 -12
  275. package/lib/esm/scenes/utils/index.js.map +1 -1
  276. package/lib/esm/state/index.js +4 -49
  277. package/lib/esm/state/index.js.map +1 -1
  278. package/lib/esm/state/lodes/index.js +2 -27
  279. package/lib/esm/state/lodes/index.js.map +1 -1
  280. package/lib/esm/state/lodes/sagas.js +10 -16
  281. package/lib/esm/state/lodes/sagas.js.map +1 -1
  282. package/lib/esm/state/lodes/selectors.js +2 -10
  283. package/lib/esm/state/lodes/selectors.js.map +1 -1
  284. package/lib/esm/state/lodes/slice.js +8 -19
  285. package/lib/esm/state/lodes/slice.js.map +1 -1
  286. package/lib/esm/state/settings/index.js +2 -27
  287. package/lib/esm/state/settings/index.js.map +1 -1
  288. package/lib/esm/state/settings/sagas.js +18 -24
  289. package/lib/esm/state/settings/sagas.js.map +1 -1
  290. package/lib/esm/state/settings/selectors.js +5 -16
  291. package/lib/esm/state/settings/selectors.js.map +1 -1
  292. package/lib/esm/state/settings/slice.js +11 -23
  293. package/lib/esm/state/settings/slice.js.map +1 -1
  294. package/lib/esm/state/specs/index.js +2 -27
  295. package/lib/esm/state/specs/index.js.map +1 -1
  296. package/lib/esm/state/specs/sagas.js +21 -25
  297. package/lib/esm/state/specs/sagas.js.map +1 -1
  298. package/lib/esm/state/specs/selectors.js +2 -10
  299. package/lib/esm/state/specs/selectors.js.map +1 -1
  300. package/lib/esm/state/specs/slice.js +8 -19
  301. package/lib/esm/state/specs/slice.js.map +1 -1
  302. package/lib/esm/state/store.js +13 -21
  303. package/lib/esm/state/store.js.map +1 -1
  304. package/lib/esm/test-data/declarations.js +1 -8
  305. package/lib/esm/test-data/declarations.js.map +1 -1
  306. package/lib/esm/test-data/examples.js +1 -8
  307. package/lib/esm/test-data/examples.js.map +1 -1
  308. package/lib/esm/test-data/index.js +4 -51
  309. package/lib/esm/test-data/index.js.map +1 -1
  310. package/lib/esm/test-data/sdkLanguages.js +2 -10
  311. package/lib/esm/test-data/sdkLanguages.js.map +1 -1
  312. package/lib/esm/test-data/specs.js +7 -18
  313. package/lib/esm/test-data/specs.js.map +1 -1
  314. package/lib/esm/test-utils/index.js +3 -38
  315. package/lib/esm/test-utils/index.js.map +1 -1
  316. package/lib/esm/test-utils/lodes.js +5 -12
  317. package/lib/esm/test-utils/lodes.js.map +1 -1
  318. package/lib/esm/test-utils/redux.js +25 -37
  319. package/lib/esm/test-utils/redux.js.map +1 -1
  320. package/lib/esm/test-utils/router.js +6 -15
  321. package/lib/esm/test-utils/router.js.map +1 -1
  322. package/lib/esm/utils/adaptorUtils.js +15 -26
  323. package/lib/esm/utils/adaptorUtils.js.map +1 -1
  324. package/lib/esm/utils/apixAdaptor.js +13 -22
  325. package/lib/esm/utils/apixAdaptor.js.map +1 -1
  326. package/lib/esm/utils/highlight.js +3 -11
  327. package/lib/esm/utils/highlight.js.map +1 -1
  328. package/lib/esm/utils/hooks/globalStoreSync.js +15 -22
  329. package/lib/esm/utils/hooks/globalStoreSync.js.map +1 -1
  330. package/lib/esm/utils/hooks/index.js +3 -26
  331. package/lib/esm/utils/hooks/index.js.map +1 -1
  332. package/lib/esm/utils/hooks/navigation.js +3 -10
  333. package/lib/esm/utils/hooks/navigation.js.map +1 -1
  334. package/lib/esm/utils/hooks/useQuery.js +5 -12
  335. package/lib/esm/utils/hooks/useQuery.js.map +1 -1
  336. package/lib/esm/utils/index.js +8 -101
  337. package/lib/esm/utils/index.js.map +1 -1
  338. package/lib/esm/utils/lodeUtils.js +2 -10
  339. package/lib/esm/utils/lodeUtils.js.map +1 -1
  340. package/lib/esm/utils/path.js +15 -32
  341. package/lib/esm/utils/path.js.map +1 -1
  342. package/lib/esm/utils/sdkLanguage.js +5 -14
  343. package/lib/esm/utils/sdkLanguage.js.map +1 -1
  344. package/lib/esm/utils/useWindowSize.js +4 -10
  345. package/lib/esm/utils/useWindowSize.js.map +1 -1
  346. package/lib/routes/AppRouter.js.map +1 -1
  347. package/lib/scenes/DiffScene/DiffScene.js.map +1 -1
  348. package/lib/scenes/DiffScene/DocDiff/DiffBanner.js.map +1 -1
  349. package/lib/scenes/DiffScene/DocDiff/DiffItem.js.map +1 -1
  350. package/lib/scenes/DiffScene/DocDiff/DiffLegend.js.map +1 -1
  351. package/lib/scenes/DiffScene/DocDiff/DocDiff.js.map +1 -1
  352. package/lib/scenes/DiffScene/DocDiff/docDiffUtils.js.map +1 -1
  353. package/lib/scenes/ErrorDetailScene/ErrorDetailScene.js.map +1 -1
  354. package/lib/scenes/HomeScene/HomeScene.js.map +1 -1
  355. package/lib/scenes/MethodScene/MethodScene.js.map +1 -1
  356. package/lib/scenes/MethodScene/components/DocOperation.js.map +1 -1
  357. package/lib/scenes/MethodScene/components/DocRequestBody.js.map +1 -1
  358. package/lib/scenes/MethodScene/components/DocResponses/DocResponseTypes.js.map +1 -1
  359. package/lib/scenes/MethodScene/components/DocResponses/DocResponses.js.map +1 -1
  360. package/lib/scenes/MethodTagScene/MethodTagScene.js.map +1 -1
  361. package/lib/scenes/MethodTagScene/utils.js.map +1 -1
  362. package/lib/scenes/TypeScene/TypeScene.js.map +1 -1
  363. package/lib/scenes/TypeTagScene/TypeTagScene.js.map +1 -1
  364. package/lib/scenes/TypeTagScene/utils.js.map +1 -1
  365. package/lib/scenes/utils/hooks/tagStoreSync.js.map +1 -1
  366. package/lib/state/lodes/sagas.js.map +1 -1
  367. package/lib/state/settings/sagas.js.map +1 -1
  368. package/lib/state/specs/sagas.js +2 -0
  369. package/lib/state/specs/sagas.js.map +1 -1
  370. package/lib/test-data/specs.js.map +1 -1
  371. package/lib/test-utils/redux.js.map +1 -1
  372. package/lib/test-utils/router.js.map +1 -1
  373. package/lib/utils/adaptorUtils.js.map +1 -1
  374. package/lib/utils/apixAdaptor.js.map +1 -1
  375. package/lib/utils/highlight.js.map +1 -1
  376. package/lib/utils/hooks/globalStoreSync.js.map +1 -1
  377. package/lib/utils/hooks/navigation.js.map +1 -1
  378. package/lib/utils/hooks/useQuery.js.map +1 -1
  379. package/lib/utils/lodeUtils.js.map +1 -1
  380. package/lib/utils/path.js.map +1 -1
  381. package/lib/utils/sdkLanguage.js.map +1 -1
  382. package/lib/utils/useWindowSize.js.map +1 -1
  383. package/package.json +7 -7
  384. package/public/Looker.4.0.json +5181 -1075
  385. package/public/versions.json +4 -10
  386. package/src/components/DocMarkdown/DocMarkdown.spec.tsx +10 -10
  387. package/src/components/DocMarkdown/utils.spec.ts +11 -11
  388. package/src/components/DocReferences/DocReferences.spec.tsx +6 -6
  389. package/src/components/ExploreType/ExploreType.spec.tsx +0 -12
  390. package/src/components/SelectorContainer/ApiSpecSelector.spec.tsx +2 -2
  391. package/src/components/SideNav/SideNav.spec.tsx +6 -6
  392. package/src/components/SideNav/SideNavMethodTags.spec.tsx +4 -4
  393. package/src/components/SideNav/SideNavMethods.spec.tsx +1 -1
  394. package/src/components/SideNav/SideNavTypeTags.spec.tsx +4 -4
  395. package/src/components/SideNav/SideNavTypes.spec.tsx +1 -1
  396. package/src/scenes/DiffScene/DocDiff/DocDiff.spec.tsx +1 -1
  397. package/src/state/specs/sagas.ts +4 -0
@@ -1,28 +1,20 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DocDeclarations = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _components = require("@looker/components");
9
- var _DocCode = require("../DocCode");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- var DocDeclarations = _ref => {
1
+ import React from 'react';
2
+ import { Tab2, Tabs2 } from '@looker/components';
3
+ import { DocCode } from '../DocCode';
4
+ export var DocDeclarations = _ref => {
12
5
  var {
13
6
  declarations
14
7
  } = _ref;
15
- return _react.default.createElement(_components.Tabs2, null, Object.entries(declarations).map(_ref2 => {
8
+ return React.createElement(Tabs2, null, Object.entries(declarations).map(_ref2 => {
16
9
  var [language, code] = _ref2;
17
- return _react.default.createElement(_components.Tab2, {
10
+ return React.createElement(Tab2, {
18
11
  key: language,
19
12
  id: language,
20
13
  label: language
21
- }, _react.default.createElement(_DocCode.DocCode, {
14
+ }, React.createElement(DocCode, {
22
15
  code: code,
23
16
  language: language
24
17
  }));
25
18
  }));
26
19
  };
27
- exports.DocDeclarations = DocDeclarations;
28
20
  //# sourceMappingURL=DocDeclarations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocDeclarations.js","names":["_react","_interopRequireDefault","require","_components","_DocCode","obj","__esModule","default","DocDeclarations","_ref","declarations","createElement","Tabs2","Object","entries","map","_ref2","language","code","Tab2","key","id","label","DocCode","exports"],"sources":["../../../../src/components/DocSDKs/DocDeclarations.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport React from 'react'\nimport { Tab2, Tabs2 } from '@looker/components'\nimport type { KeyedCollection } from '@looker/sdk-codegen'\nimport type { FC } from 'react'\nimport { DocCode } from '../DocCode'\n\ninterface DocDeclarationsProps {\n declarations: KeyedCollection<string>\n}\n\n/**\n * Renders all provided declarations\n * @param declarations A collection of SDK declarations in various languages\n */\nexport const DocDeclarations: FC<DocDeclarationsProps> = ({ declarations }) => (\n <Tabs2>\n {Object.entries(declarations).map(([language, code]) => (\n <Tab2 key={language} id={language} label={language}>\n <DocCode code={code} language={language} />\n </Tab2>\n ))}\n </Tabs2>\n)\n"],"mappings":";;;;;;AAyBA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAGA,IAAAE,QAAA,GAAAF,OAAA;AAAoC,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAU7B,IAAMG,eAAyC,GAAGC,IAAA;EAAA,IAAC;IAAEC;EAAa,CAAC,GAAAD,IAAA;EAAA,OACxET,MAAA,CAAAO,OAAA,CAAAI,aAAA,CAACR,WAAA,CAAAS,KAAK,QACHC,MAAM,CAACC,OAAO,CAACJ,YAAY,CAAC,CAACK,GAAG,CAACC,KAAA;IAAA,IAAC,CAACC,QAAQ,EAAEC,IAAI,CAAC,GAAAF,KAAA;IAAA,OACjDhB,MAAA,CAAAO,OAAA,CAAAI,aAAA,CAACR,WAAA,CAAAgB,IAAI;MAACC,GAAG,EAAEH,QAAS;MAACI,EAAE,EAAEJ,QAAS;MAACK,KAAK,EAAEL;IAAS,GACjDjB,MAAA,CAAAO,OAAA,CAAAI,aAAA,CAACP,QAAA,CAAAmB,OAAO;MAACL,IAAI,EAAEA,IAAK;MAACD,QAAQ,EAAEA;IAAS,EAAG,CACtC;EAAA,CACR,CAAC,CACI;AAAA,CACT;AAAAO,OAAA,CAAAhB,eAAA,GAAAA,eAAA"}
1
+ {"version":3,"file":"DocDeclarations.js","names":["React","Tab2","Tabs2","DocCode","DocDeclarations","_ref","declarations","createElement","Object","entries","map","_ref2","language","code","key","id","label"],"sources":["../../../../src/components/DocSDKs/DocDeclarations.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport React from 'react'\nimport { Tab2, Tabs2 } from '@looker/components'\nimport type { KeyedCollection } from '@looker/sdk-codegen'\nimport type { FC } from 'react'\nimport { DocCode } from '../DocCode'\n\ninterface DocDeclarationsProps {\n declarations: KeyedCollection<string>\n}\n\n/**\n * Renders all provided declarations\n * @param declarations A collection of SDK declarations in various languages\n */\nexport const DocDeclarations: FC<DocDeclarationsProps> = ({ declarations }) => (\n <Tabs2>\n {Object.entries(declarations).map(([language, code]) => (\n <Tab2 key={language} id={language} label={language}>\n <DocCode code={code} language={language} />\n </Tab2>\n ))}\n </Tabs2>\n)\n"],"mappings":"AAyBA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,KAAK,QAAQ,oBAAoB;AAGhD,SAASC,OAAO,QAAQ,YAAY;AAUpC,OAAO,IAAMC,eAAyC,GAAGC,IAAA;EAAA,IAAC;IAAEC;EAAa,CAAC,GAAAD,IAAA;EAAA,OACxEL,KAAA,CAAAO,aAAA,CAACL,KAAK,QACHM,MAAM,CAACC,OAAO,CAACH,YAAY,CAAC,CAACI,GAAG,CAACC,KAAA;IAAA,IAAC,CAACC,QAAQ,EAAEC,IAAI,CAAC,GAAAF,KAAA;IAAA,OACjDX,KAAA,CAAAO,aAAA,CAACN,IAAI;MAACa,GAAG,EAAEF,QAAS;MAACG,EAAE,EAAEH,QAAS;MAACI,KAAK,EAAEJ;IAAS,GACjDZ,KAAA,CAAAO,aAAA,CAACJ,OAAO;MAACU,IAAI,EAAEA,IAAK;MAACD,QAAQ,EAAEA;IAAS,CAAE,CACtC,CAAC;EAAA,CACR,CACI,CAAC;AAAA,CACT"}
@@ -1,45 +1,37 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DocSDKs = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _reactRedux = require("react-redux");
9
- var _runIt = require("@looker/run-it");
10
- var _DocCode = require("../DocCode");
11
- var _state = require("../../state");
12
- var _path = require("../../utils/path");
13
- var _utils = require("./utils");
14
- var _DocDeclarations = require("./DocDeclarations");
15
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
1
+ import React, { useState, useEffect } from 'react';
2
+ import { useSelector } from 'react-redux';
3
+ import { CollapserCard, getGenerators } from '@looker/run-it';
4
+ import { DocCode } from '../DocCode';
5
+ import { selectSdkLanguage } from '../../state';
6
+ import { isMethod } from '../../utils/path';
7
+ import { noComment } from './utils';
8
+ import { DocDeclarations } from './DocDeclarations';
17
9
  var getDeclarations = (generators, sdkLanguage, item) => {
18
10
  var declarations = {};
19
11
  Object.entries(generators).forEach(_ref => {
20
12
  var [language, gen] = _ref;
21
13
  if (sdkLanguage === 'All' || language === sdkLanguage) {
22
- var code = (0, _path.isMethod)(item) ? gen.declareMethod('', item) : gen.declareType('', item);
14
+ var code = isMethod(item) ? gen.declareMethod('', item) : gen.declareType('', item);
23
15
  declarations[language] = code;
24
16
  }
25
17
  });
26
18
  return declarations;
27
19
  };
28
- var DocSDKs = _ref2 => {
20
+ export var DocSDKs = _ref2 => {
29
21
  var {
30
22
  api,
31
23
  method,
32
24
  type
33
25
  } = _ref2;
34
- var sdkLanguage = (0, _reactRedux.useSelector)(_state.selectSdkLanguage);
35
- var generators = (0, _runIt.getGenerators)(api);
36
- var [item, setItem] = (0, _react.useState)(method ? (0, _utils.noComment)(method) : type);
37
- var [declarations, setDeclarations] = (0, _react.useState)(getDeclarations(generators, sdkLanguage, item));
38
- var [header, setHeader] = (0, _react.useState)("".concat(sdkLanguage, " Declaration"));
39
- (0, _react.useEffect)(() => {
40
- setItem(method ? (0, _utils.noComment)(method) : type);
26
+ var sdkLanguage = useSelector(selectSdkLanguage);
27
+ var generators = getGenerators(api);
28
+ var [item, setItem] = useState(method ? noComment(method) : type);
29
+ var [declarations, setDeclarations] = useState(getDeclarations(generators, sdkLanguage, item));
30
+ var [header, setHeader] = useState("".concat(sdkLanguage, " Declaration"));
31
+ useEffect(() => {
32
+ setItem(method ? noComment(method) : type);
41
33
  }, [method, type]);
42
- (0, _react.useEffect)(() => {
34
+ useEffect(() => {
43
35
  var declarations = getDeclarations(generators, sdkLanguage, item);
44
36
  setDeclarations(declarations);
45
37
  var languages = Object.keys(declarations);
@@ -49,15 +41,14 @@ var DocSDKs = _ref2 => {
49
41
  setHeader("".concat(languages[0], " Declaration"));
50
42
  }
51
43
  }, [sdkLanguage, item]);
52
- return _react.default.createElement(_runIt.CollapserCard, {
44
+ return React.createElement(CollapserCard, {
53
45
  heading: header,
54
46
  id: "sdk declarations"
55
- }, Object.keys(declarations).length > 1 ? _react.default.createElement(_DocDeclarations.DocDeclarations, {
47
+ }, Object.keys(declarations).length > 1 ? React.createElement(DocDeclarations, {
56
48
  declarations: declarations
57
- }) : _react.default.createElement(_DocCode.DocCode, {
49
+ }) : React.createElement(DocCode, {
58
50
  language: Object.keys(declarations)[0],
59
51
  code: Object.values(declarations)[0]
60
52
  }));
61
53
  };
62
- exports.DocSDKs = DocSDKs;
63
54
  //# sourceMappingURL=DocSDKs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocSDKs.js","names":["_react","_interopRequireWildcard","require","_reactRedux","_runIt","_DocCode","_state","_path","_utils","_DocDeclarations","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","getDeclarations","generators","sdkLanguage","item","declarations","entries","forEach","_ref","language","gen","code","isMethod","declareMethod","declareType","DocSDKs","_ref2","api","method","type","useSelector","selectSdkLanguage","getGenerators","setItem","useState","noComment","setDeclarations","header","setHeader","concat","useEffect","languages","keys","length","createElement","CollapserCard","heading","id","DocDeclarations","DocCode","values","exports"],"sources":["../../../../src/components/DocSDKs/DocSDKs.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { FC } from 'react'\nimport React, { useState, useEffect } from 'react'\nimport { useSelector } from 'react-redux'\nimport type {\n IMethod,\n IType,\n ApiModel,\n KeyedCollection,\n CodeGen,\n} from '@looker/sdk-codegen'\nimport { CollapserCard, getGenerators } from '@looker/run-it'\n\nimport { DocCode } from '../DocCode'\nimport { selectSdkLanguage } from '../../state'\nimport { isMethod } from '../../utils/path'\nimport { noComment } from './utils'\nimport { DocDeclarations } from './DocDeclarations'\n\ninterface LanguageSDKProps {\n /** API spec */\n api: ApiModel\n /** An SDK method */\n method?: IMethod\n /** An SDK type */\n type?: IType\n}\n\nconst getDeclarations = (\n generators: KeyedCollection<CodeGen>,\n sdkLanguage: string,\n item: IMethod | IType\n) => {\n const declarations: KeyedCollection<string> = {}\n Object.entries(generators).forEach(([language, gen]) => {\n if (sdkLanguage === 'All' || language === sdkLanguage) {\n const code = isMethod(item)\n ? gen.declareMethod('', item as IMethod)\n : gen.declareType('', item as IType)\n declarations[language] = code\n }\n })\n return declarations\n}\n\n/**\n * Given a method or a type, it renders its SDK declaration in all supported languages.\n */\nexport const DocSDKs: FC<LanguageSDKProps> = ({ api, method, type }) => {\n const sdkLanguage = useSelector(selectSdkLanguage)\n const generators = getGenerators(api)\n const [item, setItem] = useState(method ? noComment(method) : type!)\n const [declarations, setDeclarations] = useState(\n getDeclarations(generators, sdkLanguage, item)\n )\n const [header, setHeader] = useState(`${sdkLanguage} Declaration`)\n\n useEffect(() => {\n setItem(method ? noComment(method) : type!)\n }, [method, type])\n\n useEffect(() => {\n const declarations = getDeclarations(generators, sdkLanguage, item)\n setDeclarations(declarations)\n const languages = Object.keys(declarations)\n if (languages.length > 1) {\n setHeader('Declarations')\n } else {\n setHeader(`${languages[0]} Declaration`)\n }\n }, [sdkLanguage, item])\n\n return (\n <CollapserCard heading={header} id=\"sdk declarations\">\n {Object.keys(declarations).length > 1 ? (\n <DocDeclarations declarations={declarations} />\n ) : (\n <DocCode\n language={Object.keys(declarations)[0]}\n code={Object.values(declarations)[0]}\n />\n )}\n </CollapserCard>\n )\n}\n"],"mappings":";;;;;;AA2BA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAQA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,gBAAA,GAAAP,OAAA;AAAmD,SAAAQ,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAA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AC;IAC7B,IAAM0B,SAAS,GAAGvC,MAAM,CAACwC,IAAI,CAAC3B,YAAY,CAAC;IAC3C,IAAI0B,SAAS,CAACE,MAAM,GAAG,CAAC,EAAE;MACxBL,SAAS,CAAC,cAAc,CAAC;IAC3B,CAAC,MAAM;MACLA,SAAS,IAAAC,MAAA,CAAIE,SAAS,CAAC,CAAC,CAAC,kBAAe;IAC1C;EACF,CAAC,EAAE,CAAC5B,WAAW,EAAEC,IAAI,CAAC,CAAC;EAEvB,OACEnC,MAAA,CAAAiB,OAAA,CAAAgD,aAAA,CAAC7D,MAAA,CAAA8D,aAAa;IAACC,OAAO,EAAET,MAAO;IAACU,EAAE,EAAC;EAAkB,GAClD7C,MAAM,CAACwC,IAAI,CAAC3B,YAAY,CAAC,CAAC4B,MAAM,GAAG,CAAC,GACnChE,MAAA,CAAAiB,OAAA,CAAAgD,aAAA,CAACxD,gBAAA,CAAA4D,eAAe;IAACjC,YAAY,EAAEA;EAAa,EAAG,GAE/CpC,MAAA,CAAAiB,OAAA,CAAAgD,aAAA,CAAC5D,QAAA,CAAAiE,OAAO;IACN9B,QAAQ,EAAEjB,MAAM,CAACwC,IAAI,CAAC3B,YAAY,CAAC,CAAC,CAAC,CAAE;IACvCM,IAAI,EAAEnB,MAAM,CAACgD,MAAM,CAACnC,YAAY,CAAC,CAAC,CAAC;EAAE,EAExC,CACa;AAEpB,CAAC;AAAAoC,OAAA,CAAA1B,OAAA,GAAAA,OAAA"}
1
+ {"version":3,"file":"DocSDKs.js","names":["React","useState","useEffect","useSelector","CollapserCard","getGenerators","DocCode","selectSdkLanguage","isMethod","noComment","DocDeclarations","getDeclarations","generators","sdkLanguage","item","declarations","Object","entries","forEach","_ref","language","gen","code","declareMethod","declareType","DocSDKs","_ref2","api","method","type","setItem","setDeclarations","header","setHeader","concat","languages","keys","length","createElement","heading","id","values"],"sources":["../../../../src/components/DocSDKs/DocSDKs.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { FC } from 'react'\nimport React, { useState, useEffect } from 'react'\nimport { useSelector } from 'react-redux'\nimport type {\n IMethod,\n IType,\n ApiModel,\n KeyedCollection,\n CodeGen,\n} from '@looker/sdk-codegen'\nimport { CollapserCard, getGenerators } from '@looker/run-it'\n\nimport { DocCode } from '../DocCode'\nimport { selectSdkLanguage } from '../../state'\nimport { isMethod } from '../../utils/path'\nimport { noComment } from './utils'\nimport { DocDeclarations } from './DocDeclarations'\n\ninterface LanguageSDKProps {\n /** API spec */\n api: ApiModel\n /** An SDK method */\n method?: IMethod\n /** An SDK type */\n type?: IType\n}\n\nconst getDeclarations = (\n generators: KeyedCollection<CodeGen>,\n sdkLanguage: string,\n item: IMethod | IType\n) => {\n const declarations: KeyedCollection<string> = {}\n Object.entries(generators).forEach(([language, gen]) => {\n if (sdkLanguage === 'All' || language === sdkLanguage) {\n const code = isMethod(item)\n ? gen.declareMethod('', item as IMethod)\n : gen.declareType('', item as IType)\n declarations[language] = code\n }\n })\n return declarations\n}\n\n/**\n * Given a method or a type, it renders its SDK declaration in all supported languages.\n */\nexport const DocSDKs: FC<LanguageSDKProps> = ({ api, method, type }) => {\n const sdkLanguage = useSelector(selectSdkLanguage)\n const generators = getGenerators(api)\n const [item, setItem] = useState(method ? noComment(method) : type!)\n const [declarations, setDeclarations] = useState(\n getDeclarations(generators, sdkLanguage, item)\n )\n const [header, setHeader] = useState(`${sdkLanguage} Declaration`)\n\n useEffect(() => {\n setItem(method ? noComment(method) : type!)\n }, [method, type])\n\n useEffect(() => {\n const declarations = getDeclarations(generators, sdkLanguage, item)\n setDeclarations(declarations)\n const languages = Object.keys(declarations)\n if (languages.length > 1) {\n setHeader('Declarations')\n } else {\n setHeader(`${languages[0]} Declaration`)\n }\n }, [sdkLanguage, item])\n\n return (\n <CollapserCard heading={header} id=\"sdk declarations\">\n {Object.keys(declarations).length > 1 ? (\n <DocDeclarations declarations={declarations} />\n ) : (\n <DocCode\n language={Object.keys(declarations)[0]}\n code={Object.values(declarations)[0]}\n />\n )}\n </CollapserCard>\n )\n}\n"],"mappings":"AA2BA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,SAASC,WAAW,QAAQ,aAAa;AAQzC,SAASC,aAAa,EAAEC,aAAa,QAAQ,gBAAgB;AAE7D,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,QAAQ,QAAQ,kBAAkB;AAC3C,SAASC,SAAS,QAAQ,SAAS;AACnC,SAASC,eAAe,QAAQ,mBAAmB;AAWnD,IAAMC,eAAe,GAAGA,CACtBC,UAAoC,EACpCC,WAAmB,EACnBC,IAAqB,KAClB;EACH,IAAMC,YAAqC,GAAG,CAAC,CAAC;EAChDC,MAAM,CAACC,OAAO,CAACL,UAAU,CAAC,CAACM,OAAO,CAACC,IAAA,IAAqB;IAAA,IAApB,CAACC,QAAQ,EAAEC,GAAG,CAAC,GAA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AS,GAAGnB,MAAM,CAACoB,IAAI,CAACrB,YAAY,CAAC;IAC3C,IAAIoB,SAAS,CAACE,MAAM,GAAG,CAAC,EAAE;MACxBJ,SAAS,CAAC,cAAc,CAAC;IAC3B,CAAC,MAAM;MACLA,SAAS,IAAAC,MAAA,CAAIC,SAAS,CAAC,CAAC,CAAC,iBAAc,CAAC;IAC1C;EACF,CAAC,EAAE,CAACtB,WAAW,EAAEC,IAAI,CAAC,CAAC;EAEvB,OACEd,KAAA,CAAAsC,aAAA,CAAClC,aAAa;IAACmC,OAAO,EAAEP,MAAO;IAACQ,EAAE,EAAC;EAAkB,GAClDxB,MAAM,CAACoB,IAAI,CAACrB,YAAY,CAAC,CAACsB,MAAM,GAAG,CAAC,GACnCrC,KAAA,CAAAsC,aAAA,CAAC5B,eAAe;IAACK,YAAY,EAAEA;EAAa,CAAE,CAAC,GAE/Cf,KAAA,CAAAsC,aAAA,CAAChC,OAAO;IACNc,QAAQ,EAAEJ,MAAM,CAACoB,IAAI,CAACrB,YAAY,CAAC,CAAC,CAAC,CAAE;IACvCO,IAAI,EAAEN,MAAM,CAACyB,MAAM,CAAC1B,YAAY,CAAC,CAAC,CAAC;EAAE,CACtC,CAEU,CAAC;AAEpB,CAAC"}
@@ -1,13 +1,2 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "DocSDKs", {
7
- enumerable: true,
8
- get: function get() {
9
- return _DocSDKs.DocSDKs;
10
- }
11
- });
12
- var _DocSDKs = require("./DocSDKs");
1
+ export { DocSDKs } from './DocSDKs';
13
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_DocSDKs","require"],"sources":["../../../../src/components/DocSDKs/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { DocSDKs } from './DocSDKs'\n"],"mappings":";;;;;;;;;;;AAyBA,IAAAA,QAAA,GAAAC,OAAA"}
1
+ {"version":3,"file":"index.js","names":["DocSDKs"],"sources":["../../../../src/components/DocSDKs/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { DocSDKs } from './DocSDKs'\n"],"mappings":"AAyBA,SAASA,OAAO,QAAQ,WAAW"}
@@ -1,15 +1,7 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.noComment = void 0;
7
- var _clone = _interopRequireDefault(require("lodash/clone"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- var noComment = method => {
10
- var copy = (0, _clone.default)(method);
1
+ import clone from 'lodash/clone';
2
+ export var noComment = method => {
3
+ var copy = clone(method);
11
4
  copy.description = '';
12
5
  return copy;
13
6
  };
14
- exports.noComment = noComment;
15
7
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["_clone","_interopRequireDefault","require","obj","__esModule","default","noComment","method","copy","clone","description","exports"],"sources":["../../../../src/components/DocSDKs/utils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport type { IMethod } from '@looker/sdk-codegen'\nimport clone from 'lodash/clone'\n\n/**\n * Given a method create a copy and remove its description\n * @param method An SDK method\n */\nexport const noComment = (method: IMethod): IMethod => {\n const copy = clone(method)\n copy.description = ''\n return copy\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAgC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAMzB,IAAMG,SAAS,GAAIC,MAAe,IAAc;EACrD,IAAMC,IAAI,GAAG,IAAAC,cAAK,EAACF,MAAM,CAAC;EAC1BC,IAAI,CAACE,WAAW,GAAG,EAAE;EACrB,OAAOF,IAAI;AACb,CAAC;AAAAG,OAAA,CAAAL,SAAA,GAAAA,SAAA"}
1
+ {"version":3,"file":"utils.js","names":["clone","noComment","method","copy","description"],"sources":["../../../../src/components/DocSDKs/utils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport type { IMethod } from '@looker/sdk-codegen'\nimport clone from 'lodash/clone'\n\n/**\n * Given a method create a copy and remove its description\n * @param method An SDK method\n */\nexport const noComment = (method: IMethod): IMethod => {\n const copy = clone(method)\n copy.description = ''\n return copy\n}\n"],"mappings":"AA0BA,OAAOA,KAAK,MAAM,cAAc;AAMhC,OAAO,IAAMC,SAAS,GAAIC,MAAe,IAAc;EACrD,IAAMC,IAAI,GAAGH,KAAK,CAACE,MAAM,CAAC;EAC1BC,IAAI,CAACC,WAAW,GAAG,EAAE;EACrB,OAAOD,IAAI;AACb,CAAC"}
@@ -1,27 +1,19 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DocSchema = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _codeEditor = require("@looker/code-editor");
9
- var _runIt = require("@looker/run-it");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- var DocSchema = _ref => {
1
+ import React from 'react';
2
+ import { CodeDisplay } from '@looker/code-editor';
3
+ import { CollapserCard } from '@looker/run-it';
4
+ export var DocSchema = _ref => {
12
5
  var {
13
6
  object
14
7
  } = _ref;
15
- if (!object) return _react.default.createElement(_react.default.Fragment, null);
8
+ if (!object) return React.createElement(React.Fragment, null);
16
9
  var json = JSON.stringify(object, null, 2);
17
- return _react.default.createElement(_runIt.CollapserCard, {
10
+ return React.createElement(CollapserCard, {
18
11
  heading: "Original Schema",
19
12
  defaultOpen: false,
20
13
  id: "original schema"
21
- }, _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_codeEditor.CodeDisplay, {
14
+ }, React.createElement(React.Fragment, null, React.createElement(CodeDisplay, {
22
15
  language: "json",
23
16
  code: json
24
17
  })));
25
18
  };
26
- exports.DocSchema = DocSchema;
27
19
  //# sourceMappingURL=DocSchema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocSchema.js","names":["_react","_interopRequireDefault","require","_codeEditor","_runIt","obj","__esModule","default","DocSchema","_ref","object","createElement","Fragment","json","JSON","stringify","CollapserCard","heading","defaultOpen","id","CodeDisplay","language","code","exports"],"sources":["../../../../src/components/DocSchema/DocSchema.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { FC } from 'react'\nimport React from 'react'\n\nimport { CodeDisplay } from '@looker/code-editor'\nimport { CollapserCard } from '@looker/run-it'\n\ninterface DocSchemaProps {\n object: any\n}\n\n/**\n * It renders links to the given types and/or methods references\n */\nexport const DocSchema: FC<DocSchemaProps> = ({ object }) => {\n if (!object) return <></>\n const json = JSON.stringify(object, null, 2)\n\n return (\n <CollapserCard\n heading=\"Original Schema\"\n defaultOpen={false}\n id=\"original schema\"\n >\n <>\n <CodeDisplay language=\"json\" code={json} />\n </>\n </CollapserCard>\n )\n}\n"],"mappings":";;;;;;AA2BA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAA8C,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AASvC,IAAMG,SAA6B,GAAGC,IAAA,IAAgB;EAAA,IAAf;IAAEC;EAAO,CAAC,GAAAD,IAAA;EACtD,IAAI,CAACC,MAAM,EAAE,OAAOV,MAAA,CAAAO,OAAA,CAAAI,aAAA,CAAAX,MAAA,CAAAO,OAAA,CAAAK,QAAA,OAAK;EACzB,IAAMC,IAAI,GAAGC,IAAI,CAACC,SAAS,CAACL,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;EAE5C,OACEV,MAAA,CAAAO,OAAA,CAAAI,aAAA,CAACP,MAAA,CAAAY,aAAa;IACZC,OAAO,EAAC,iBAAiB;IACzBC,WAAW,EAAE,KAAM;IACnBC,EAAE,EAAC;EAAiB,GAEpBnB,MAAA,CAAAO,OAAA,CAAAI,aAAA,CAAAX,MAAA,CAAAO,OAAA,CAAAK,QAAA,QACEZ,MAAA,CAAAO,OAAA,CAAAI,aAAA,CAACR,WAAA,CAAAiB,WAAW;IAACC,QAAQ,EAAC,MAAM;IAACC,IAAI,EAAET;EAAK,EAAG,CAC1C,CACW;AAEpB,CAAC;AAAAU,OAAA,CAAAf,SAAA,GAAAA,SAAA"}
1
+ {"version":3,"file":"DocSchema.js","names":["React","CodeDisplay","CollapserCard","DocSchema","_ref","object","createElement","Fragment","json","JSON","stringify","heading","defaultOpen","id","language","code"],"sources":["../../../../src/components/DocSchema/DocSchema.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { FC } from 'react'\nimport React from 'react'\n\nimport { CodeDisplay } from '@looker/code-editor'\nimport { CollapserCard } from '@looker/run-it'\n\ninterface DocSchemaProps {\n object: any\n}\n\n/**\n * It renders links to the given types and/or methods references\n */\nexport const DocSchema: FC<DocSchemaProps> = ({ object }) => {\n if (!object) return <></>\n const json = JSON.stringify(object, null, 2)\n\n return (\n <CollapserCard\n heading=\"Original Schema\"\n defaultOpen={false}\n id=\"original schema\"\n >\n <>\n <CodeDisplay language=\"json\" code={json} />\n </>\n </CollapserCard>\n )\n}\n"],"mappings":"AA2BA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,WAAW,QAAQ,qBAAqB;AACjD,SAASC,aAAa,QAAQ,gBAAgB;AAS9C,OAAO,IAAMC,SAA6B,GAAGC,IAAA,IAAgB;EAAA,IAAf;IAAEC;EAAO,CAAC,GAAAD,IAAA;EACtD,IAAI,CAACC,MAAM,EAAE,OAAOL,KAAA,CAAAM,aAAA,CAAAN,KAAA,CAAAO,QAAA,MAAI,CAAC;EACzB,IAAMC,IAAI,GAAGC,IAAI,CAACC,SAAS,CAACL,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;EAE5C,OACEL,KAAA,CAAAM,aAAA,CAACJ,aAAa;IACZS,OAAO,EAAC,iBAAiB;IACzBC,WAAW,EAAE,KAAM;IACnBC,EAAE,EAAC;EAAiB,GAEpBb,KAAA,CAAAM,aAAA,CAAAN,KAAA,CAAAO,QAAA,QACEP,KAAA,CAAAM,aAAA,CAACL,WAAW;IAACa,QAAQ,EAAC,MAAM;IAACC,IAAI,EAAEP;EAAK,CAAE,CAC1C,CACW,CAAC;AAEpB,CAAC"}
@@ -1,13 +1,2 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "DocSchema", {
7
- enumerable: true,
8
- get: function get() {
9
- return _DocSchema.DocSchema;
10
- }
11
- });
12
- var _DocSchema = require("./DocSchema");
1
+ export { DocSchema } from './DocSchema';
13
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_DocSchema","require"],"sources":["../../../../src/components/DocSchema/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport { DocSchema } from './DocSchema'\n"],"mappings":";;;;;;;;;;;AA0BA,IAAAA,UAAA,GAAAC,OAAA"}
1
+ {"version":3,"file":"index.js","names":["DocSchema"],"sources":["../../../../src/components/DocSchema/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport { DocSchema } from './DocSchema'\n"],"mappings":"AA0BA,SAASA,SAAS,QAAQ,aAAa"}
@@ -1,23 +1,15 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DocSdkExampleCell = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _components = require("@looker/components");
9
- var _utils = require("./utils");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- var DocSdkExampleCell = props => _react.default.createElement(_components.DataTableCell, {
1
+ import React from 'react';
2
+ import { DataTableCell, Span } from '@looker/components';
3
+ import { getTableItemBottomBorder } from './utils';
4
+ export var DocSdkExampleCell = props => React.createElement(DataTableCell, {
12
5
  style: {
13
- borderBottom: (0, _utils.getTableItemBottomBorder)(props.hideBorderBottom)
6
+ borderBottom: getTableItemBottomBorder(props.hideBorderBottom)
14
7
  }
15
- }, _react.default.createElement(_components.Span, {
8
+ }, React.createElement(Span, {
16
9
  style: {
17
10
  overflow: 'hidden',
18
11
  width: '100%',
19
12
  display: 'block'
20
13
  }
21
14
  }, props.children));
22
- exports.DocSdkExampleCell = DocSdkExampleCell;
23
15
  //# sourceMappingURL=DocSdkExampleCell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocSdkExampleCell.js","names":["_react","_interopRequireDefault","require","_components","_utils","obj","__esModule","default","DocSdkExampleCell","props","createElement","DataTableCell","style","borderBottom","getTableItemBottomBorder","hideBorderBottom","Span","overflow","width","display","children","exports"],"sources":["../../../../src/components/DocSdkUsage/DocSdkExampleCell.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport type { FC, PropsWithChildren } from 'react'\nimport React from 'react'\nimport { DataTableCell, Span } from '@looker/components'\n\nimport { getTableItemBottomBorder } from './utils'\n\nexport const DocSdkExampleCell: FC<PropsWithChildren<any>> = (props) => (\n <DataTableCell\n style={{ borderBottom: getTableItemBottomBorder(props.hideBorderBottom) }}\n >\n <Span style={{ overflow: 'hidden', width: '100%', display: 'block' }}>\n {props.children}\n </Span>\n </DataTableCell>\n)\n"],"mappings":";;;;;;AA0BA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAAkD,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C,IAAMG,iBAA6C,GAAIC,KAAK,IACjET,MAAA,CAAAO,OAAA,CAAAG,aAAA,CAACP,WAAA,CAAAQ,aAAa;EACZC,KAAK,EAAE;IAAEC,YAAY,EAAE,IAAAC,+BAAwB,EAACL,KAAK,CAACM,gBAAgB;EAAE;AAAE,GAE1Ef,MAAA,CAAAO,OAAA,CAAAG,aAAA,CAACP,WAAA,CAAAa,IAAI;EAACJ,KAAK,EAAE;IAAEK,QAAQ,EAAE,QAAQ;IAAEC,KAAK,EAAE,MAAM;IAAEC,OAAO,EAAE;EAAQ;AAAE,GAClEV,KAAK,CAACW,QAAQ,CACV,CAEV;AAAAC,OAAA,CAAAb,iBAAA,GAAAA,iBAAA"}
1
+ {"version":3,"file":"DocSdkExampleCell.js","names":["React","DataTableCell","Span","getTableItemBottomBorder","DocSdkExampleCell","props","createElement","style","borderBottom","hideBorderBottom","overflow","width","display","children"],"sources":["../../../../src/components/DocSdkUsage/DocSdkExampleCell.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport type { FC, PropsWithChildren } from 'react'\nimport React from 'react'\nimport { DataTableCell, Span } from '@looker/components'\n\nimport { getTableItemBottomBorder } from './utils'\n\nexport const DocSdkExampleCell: FC<PropsWithChildren<any>> = (props) => (\n <DataTableCell\n style={{ borderBottom: getTableItemBottomBorder(props.hideBorderBottom) }}\n >\n <Span style={{ overflow: 'hidden', width: '100%', display: 'block' }}>\n {props.children}\n </Span>\n </DataTableCell>\n)\n"],"mappings":"AA0BA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,EAAEC,IAAI,QAAQ,oBAAoB;AAExD,SAASC,wBAAwB,QAAQ,SAAS;AAElD,OAAO,IAAMC,iBAA6C,GAAIC,KAAK,IACjEL,KAAA,CAAAM,aAAA,CAACL,aAAa;EACZM,KAAK,EAAE;IAAEC,YAAY,EAAEL,wBAAwB,CAACE,KAAK,CAACI,gBAAgB;EAAE;AAAE,GAE1ET,KAAA,CAAAM,aAAA,CAACJ,IAAI;EAACK,KAAK,EAAE;IAAEG,QAAQ,EAAE,QAAQ;IAAEC,KAAK,EAAE,MAAM;IAAEC,OAAO,EAAE;EAAQ;AAAE,GAClEP,KAAK,CAACQ,QACH,CACO,CAChB"}
@@ -1,82 +1,74 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DocSdkUsage = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _components = require("@looker/components");
9
- var _sdkCodegen = require("@looker/sdk-codegen");
10
- var _runIt = require("@looker/run-it");
11
- var _InsertDriveFile = require("@styled-icons/material-outlined/InsertDriveFile");
12
- var _reactRedux = require("react-redux");
13
- var _state = require("../../state");
14
- var _utils = require("./utils");
15
- var _DocSdkExampleCell = require("./DocSdkExampleCell");
16
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
- var DocSdkUsage = _ref => {
1
+ import React, { useState, useEffect } from 'react';
2
+ import { Box, Card, DataTable, DataTableItem, Icon, Link, Space, Pagination } from '@looker/components';
3
+ import { findExampleLanguages } from '@looker/sdk-codegen';
4
+ import { CollapserCard } from '@looker/run-it';
5
+ import { InsertDriveFile } from '@styled-icons/material-outlined/InsertDriveFile';
6
+ import { useSelector } from 'react-redux';
7
+ import { selectSdkLanguage, selectExamplesLode } from '../../state';
8
+ import { exampleColumns, EMPTY_STRING, prepareExampleDataTable, PER_PAGE_COUNT, sortLanguagesByPreference } from './utils';
9
+ import { DocSdkExampleCell } from './DocSdkExampleCell';
10
+ export var DocSdkUsage = _ref => {
19
11
  var {
20
12
  method
21
13
  } = _ref;
22
- var examples = (0, _reactRedux.useSelector)(_state.selectExamplesLode);
23
- var sdkLanguage = (0, _reactRedux.useSelector)(_state.selectSdkLanguage);
24
- var [page, setPage] = (0, _react.useState)(1);
25
- (0, _react.useEffect)(() => {
14
+ var examples = useSelector(selectExamplesLode);
15
+ var sdkLanguage = useSelector(selectSdkLanguage);
16
+ var [page, setPage] = useState(1);
17
+ useEffect(() => {
26
18
  setPage(1);
27
19
  }, [method]);
28
- if (!examples) return _react.default.createElement(_react.default.Fragment, null);
29
- var languages = (0, _sdkCodegen.findExampleLanguages)(examples, method.name);
30
- if (languages.length === 0) return _react.default.createElement(_react.default.Fragment, null);
31
- languages = (0, _utils.sortLanguagesByPreference)(languages, sdkLanguage);
20
+ if (!examples) return React.createElement(React.Fragment, null);
21
+ var languages = findExampleLanguages(examples, method.name);
22
+ if (languages.length === 0) return React.createElement(React.Fragment, null);
23
+ languages = sortLanguagesByPreference(languages, sdkLanguage);
32
24
  var {
33
25
  pageExamples,
34
26
  pageLimit,
35
27
  paginate
36
- } = (0, _utils.prepareExampleDataTable)(languages, examples, method.operationId, page);
37
- if (pageExamples.length === 0) return _react.default.createElement(_react.default.Fragment, null);
38
- return _react.default.createElement(_runIt.CollapserCard, {
28
+ } = prepareExampleDataTable(languages, examples, method.operationId, page);
29
+ if (pageExamples.length === 0) return React.createElement(React.Fragment, null);
30
+ return React.createElement(CollapserCard, {
39
31
  id: "examples",
40
32
  heading: "SDK Examples"
41
- }, _react.default.createElement(_components.Card, {
33
+ }, React.createElement(Card, {
42
34
  height: "auto",
43
35
  px: "small",
44
36
  py: "xsmall",
45
37
  mt: "small"
46
- }, _react.default.createElement(_components.DataTable, {
38
+ }, React.createElement(DataTable, {
47
39
  caption: "SDK Examples",
48
- columns: _utils.exampleColumns
40
+ columns: exampleColumns
49
41
  }, pageExamples.map((exampleRow, i) => {
50
42
  var _pageExamples;
51
- var isEmptyItem = exampleRow.filename === _utils.EMPTY_STRING;
52
- var isLastItem = (i + 1) % _utils.PER_PAGE_COUNT === 0 || i + 1 === pageExamples.length;
53
- var nextItemEmpty = ((_pageExamples = pageExamples[i + 1]) === null || _pageExamples === void 0 ? void 0 : _pageExamples.filename) === _utils.EMPTY_STRING;
43
+ var isEmptyItem = exampleRow.filename === EMPTY_STRING;
44
+ var isLastItem = (i + 1) % PER_PAGE_COUNT === 0 || i + 1 === pageExamples.length;
45
+ var nextItemEmpty = ((_pageExamples = pageExamples[i + 1]) === null || _pageExamples === void 0 ? void 0 : _pageExamples.filename) === EMPTY_STRING;
54
46
  var hidden = isEmptyItem || isLastItem || nextItemEmpty;
55
- return _react.default.createElement(_components.DataTableItem, {
47
+ return React.createElement(DataTableItem, {
56
48
  id: exampleRow.permalink,
57
49
  key: exampleRow.permalink
58
- }, _react.default.createElement(_DocSdkExampleCell.DocSdkExampleCell, {
50
+ }, React.createElement(DocSdkExampleCell, {
59
51
  hideBorderBottom: hidden
60
- }, _react.default.createElement(_components.Space, {
52
+ }, React.createElement(Space, {
61
53
  gap: "xsmall"
62
- }, !isEmptyItem && _react.default.createElement(_components.Icon, {
63
- icon: _react.default.createElement(_InsertDriveFile.InsertDriveFile, null),
54
+ }, !isEmptyItem && React.createElement(Icon, {
55
+ icon: React.createElement(InsertDriveFile, null),
64
56
  color: "text1",
65
57
  size: "small"
66
- }), _react.default.createElement(_components.Link, {
58
+ }), React.createElement(Link, {
67
59
  href: exampleRow.permalink,
68
60
  target: '_blank',
69
61
  role: "link"
70
- }, exampleRow.filename))), _react.default.createElement(_DocSdkExampleCell.DocSdkExampleCell, {
62
+ }, exampleRow.filename))), React.createElement(DocSdkExampleCell, {
71
63
  hideBorderBottom: hidden
72
- }, exampleRow.language), _react.default.createElement(_DocSdkExampleCell.DocSdkExampleCell, {
64
+ }, exampleRow.language), React.createElement(DocSdkExampleCell, {
73
65
  hideBorderBottom: hidden
74
- }, exampleRow.description), _react.default.createElement(_DocSdkExampleCell.DocSdkExampleCell, {
66
+ }, exampleRow.description), React.createElement(DocSdkExampleCell, {
75
67
  hideBorderBottom: hidden
76
68
  }, exampleRow.line));
77
- })), paginate && _react.default.createElement(_components.Box, {
69
+ })), paginate && React.createElement(Box, {
78
70
  alignSelf: "center"
79
- }, _react.default.createElement(_components.Pagination, {
71
+ }, React.createElement(Pagination, {
80
72
  current: page,
81
73
  pages: pageLimit,
82
74
  onChange: nextPage => {
@@ -84,5 +76,4 @@ var DocSdkUsage = _ref => {
84
76
  }
85
77
  }))));
86
78
  };
87
- exports.DocSdkUsage = DocSdkUsage;
88
79
  //# sourceMappingURL=DocSdkUsage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocSdkUsage.js","names":["_react","_interopRequireWildcard","require","_components","_sdkCodegen","_runIt","_InsertDriveFile","_reactRedux","_state","_utils","_DocSdkExampleCell","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DocSdkUsage","_ref","method","examples","useSelector","selectExamplesLode","sdkLanguage","selectSdkLanguage","page","setPage","useState","useEffect","createElement","Fragment","languages","findExampleLanguages","name","length","sortLanguagesByPreference","pageExamples","pageLimit","paginate","prepareExampleDataTable","operationId","CollapserCard","id","heading","Card","height","px","py","mt","DataTable","caption","columns","exampleColumns","map","exampleRow","i","_pageExamples","isEmptyItem","filename","EMPTY_STRING","isLastItem","PER_PAGE_COUNT","nextItemEmpty","hidden","DataTableItem","permalink","DocSdkExampleCell","hideBorderBottom","Space","gap","Icon","icon","InsertDriveFile","color","size","Link","href","target","role","language","description","line","Box","alignSelf","Pagination","current","pages","onChange","nextPage","exports"],"sources":["../../../../src/components/DocSdkUsage/DocSdkUsage.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport type { FC } from 'react'\nimport React, { useState, useEffect } from 'react'\nimport {\n Box,\n Card,\n DataTable,\n DataTableItem,\n Icon,\n Link,\n Space,\n Pagination,\n} from '@looker/components'\nimport type { IMethod } from '@looker/sdk-codegen'\nimport { findExampleLanguages } from '@looker/sdk-codegen'\nimport { CollapserCard } from '@looker/run-it'\nimport { InsertDriveFile } from '@styled-icons/material-outlined/InsertDriveFile'\nimport { useSelector } from 'react-redux'\n\nimport { selectSdkLanguage, selectExamplesLode } from '../../state'\nimport {\n exampleColumns,\n EMPTY_STRING,\n prepareExampleDataTable,\n PER_PAGE_COUNT,\n sortLanguagesByPreference,\n} from './utils'\nimport { DocSdkExampleCell } from './DocSdkExampleCell'\n\ninterface DocSdkUsageProps {\n method: IMethod\n}\n\n/**\n * Given an SDK method, searches the examples index for its usages in various languages and renders\n * links to the source files\n */\nexport const DocSdkUsage: FC<DocSdkUsageProps> = ({ method }) => {\n const examples = useSelector(selectExamplesLode)\n const sdkLanguage = useSelector(selectSdkLanguage)\n const [page, setPage] = useState(1)\n\n useEffect(() => {\n setPage(1)\n }, [method])\n\n if (!examples) return <></>\n let languages = findExampleLanguages(examples, method.name)\n if (languages.length === 0) return <></>\n\n languages = sortLanguagesByPreference(languages, sdkLanguage)\n\n const { pageExamples, pageLimit, paginate } = prepareExampleDataTable(\n languages,\n examples,\n method.operationId,\n page\n )\n\n if (pageExamples.length === 0) return <></>\n\n return (\n <CollapserCard id=\"examples\" heading=\"SDK Examples\">\n <Card height=\"auto\" px=\"small\" py=\"xsmall\" mt=\"small\">\n <DataTable caption=\"SDK Examples\" columns={exampleColumns}>\n {pageExamples.map((exampleRow, i) => {\n const isEmptyItem = exampleRow.filename === EMPTY_STRING\n const isLastItem =\n (i + 1) % PER_PAGE_COUNT === 0 || i + 1 === pageExamples.length\n const nextItemEmpty = pageExamples[i + 1]?.filename === EMPTY_STRING\n const hidden = isEmptyItem || isLastItem || nextItemEmpty\n return (\n <DataTableItem\n id={exampleRow.permalink}\n key={exampleRow.permalink}\n >\n <DocSdkExampleCell hideBorderBottom={hidden}>\n <Space gap=\"xsmall\">\n {!isEmptyItem && (\n <Icon\n icon={<InsertDriveFile />}\n color=\"text1\"\n size=\"small\"\n />\n )}\n <Link\n href={exampleRow.permalink}\n target={'_blank'}\n role=\"link\"\n >\n {exampleRow.filename}\n </Link>\n </Space>\n </DocSdkExampleCell>\n <DocSdkExampleCell hideBorderBottom={hidden}>\n {exampleRow.language}\n </DocSdkExampleCell>\n <DocSdkExampleCell hideBorderBottom={hidden}>\n {exampleRow.description}\n </DocSdkExampleCell>\n <DocSdkExampleCell hideBorderBottom={hidden}>\n {exampleRow.line}\n </DocSdkExampleCell>\n </DataTableItem>\n )\n })}\n </DataTable>\n {paginate && (\n <Box alignSelf=\"center\">\n <Pagination\n current={page}\n pages={pageLimit}\n onChange={(nextPage) => {\n setPage(nextPage)\n }}\n />\n </Box>\n )}\n </Card>\n </CollapserCard>\n )\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAWA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAOA,IAAAQ,kBAAA,GAAAR,OAAA;AAAuD,SAAAS,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAX,wBAAAe,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CA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A,CAAA2B,aAAA,CAACnC,kBAAA,CAAAwE,iBAAiB;MAACC,gBAAgB,EAAEJ;IAAO,GACzCT,UAAU,CAAC2B,IAAI,CACE,CACN;EAEpB,CAAC,CAAC,CACQ,EACX3C,QAAQ,IACPtD,MAAA,CAAAkB,OAAA,CAAA2B,aAAA,CAAC1C,WAAA,CAAA+F,GAAG;IAACC,SAAS,EAAC;EAAQ,GACrBnG,MAAA,CAAAkB,OAAA,CAAA2B,aAAA,CAAC1C,WAAA,CAAAiG,UAAU;IACTC,OAAO,EAAE5D,IAAK;IACd6D,KAAK,EAAEjD,SAAU;IACjBkD,QAAQ,EAAGC,QAAQ,IAAK;MACtB9D,OAAO,CAAC8D,QAAQ,CAAC;IACnB;EAAE,EACF,CAEL,CACI,CACO;AAEpB,CAAC;AAAAC,OAAA,CAAAxE,WAAA,GAAAA,WAAA"}
1
+ {"version":3,"file":"DocSdkUsage.js","names":["React","useState","useEffect","Box","Card","DataTable","DataTableItem","Icon","Link","Space","Pagination","findExampleLanguages","CollapserCard","InsertDriveFile","useSelector","selectSdkLanguage","selectExamplesLode","exampleColumns","EMPTY_STRING","prepareExampleDataTable","PER_PAGE_COUNT","sortLanguagesByPreference","DocSdkExampleCell","DocSdkUsage","_ref","method","examples","sdkLanguage","page","setPage","createElement","Fragment","languages","name","length","pageExamples","pageLimit","paginate","operationId","id","heading","height","px","py","mt","caption","columns","map","exampleRow","i","_pageExamples","isEmptyItem","filename","isLastItem","nextItemEmpty","hidden","permalink","key","hideBorderBottom","gap","icon","color","size","href","target","role","language","description","line","alignSelf","current","pages","onChange","nextPage"],"sources":["../../../../src/components/DocSdkUsage/DocSdkUsage.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport type { FC } from 'react'\nimport React, { useState, useEffect } from 'react'\nimport {\n Box,\n Card,\n DataTable,\n DataTableItem,\n Icon,\n Link,\n Space,\n Pagination,\n} from '@looker/components'\nimport type { IMethod } from '@looker/sdk-codegen'\nimport { findExampleLanguages } from '@looker/sdk-codegen'\nimport { CollapserCard } from '@looker/run-it'\nimport { InsertDriveFile } from '@styled-icons/material-outlined/InsertDriveFile'\nimport { useSelector } from 'react-redux'\n\nimport { selectSdkLanguage, selectExamplesLode } from '../../state'\nimport {\n exampleColumns,\n EMPTY_STRING,\n prepareExampleDataTable,\n PER_PAGE_COUNT,\n sortLanguagesByPreference,\n} from './utils'\nimport { DocSdkExampleCell } from './DocSdkExampleCell'\n\ninterface DocSdkUsageProps {\n method: IMethod\n}\n\n/**\n * Given an SDK method, searches the examples index for its usages in various languages and renders\n * links to the source files\n */\nexport const DocSdkUsage: FC<DocSdkUsageProps> = ({ method }) => {\n const examples = useSelector(selectExamplesLode)\n const sdkLanguage = useSelector(selectSdkLanguage)\n const [page, setPage] = useState(1)\n\n useEffect(() => {\n setPage(1)\n }, [method])\n\n if (!examples) return <></>\n let languages = findExampleLanguages(examples, method.name)\n if (languages.length === 0) return <></>\n\n languages = sortLanguagesByPreference(languages, sdkLanguage)\n\n const { pageExamples, pageLimit, paginate } = prepareExampleDataTable(\n languages,\n examples,\n method.operationId,\n page\n )\n\n if (pageExamples.length === 0) return <></>\n\n return (\n <CollapserCard id=\"examples\" heading=\"SDK Examples\">\n <Card height=\"auto\" px=\"small\" py=\"xsmall\" mt=\"small\">\n <DataTable caption=\"SDK Examples\" columns={exampleColumns}>\n {pageExamples.map((exampleRow, i) => {\n const isEmptyItem = exampleRow.filename === EMPTY_STRING\n const isLastItem =\n (i + 1) % PER_PAGE_COUNT === 0 || i + 1 === pageExamples.length\n const nextItemEmpty = pageExamples[i + 1]?.filename === EMPTY_STRING\n const hidden = isEmptyItem || isLastItem || nextItemEmpty\n return (\n <DataTableItem\n id={exampleRow.permalink}\n key={exampleRow.permalink}\n >\n <DocSdkExampleCell hideBorderBottom={hidden}>\n <Space gap=\"xsmall\">\n {!isEmptyItem && (\n <Icon\n icon={<InsertDriveFile />}\n color=\"text1\"\n size=\"small\"\n />\n )}\n <Link\n href={exampleRow.permalink}\n target={'_blank'}\n role=\"link\"\n >\n {exampleRow.filename}\n </Link>\n </Space>\n </DocSdkExampleCell>\n <DocSdkExampleCell hideBorderBottom={hidden}>\n {exampleRow.language}\n </DocSdkExampleCell>\n <DocSdkExampleCell hideBorderBottom={hidden}>\n {exampleRow.description}\n </DocSdkExampleCell>\n <DocSdkExampleCell hideBorderBottom={hidden}>\n {exampleRow.line}\n </DocSdkExampleCell>\n </DataTableItem>\n )\n })}\n </DataTable>\n {paginate && (\n <Box alignSelf=\"center\">\n <Pagination\n current={page}\n pages={pageLimit}\n onChange={(nextPage) => {\n setPage(nextPage)\n }}\n />\n </Box>\n )}\n </Card>\n </CollapserCard>\n )\n}\n"],"mappings":"AA0BA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,SACEC,GAAG,EACHC,IAAI,EACJC,SAAS,EACTC,aAAa,EACbC,IAAI,EACJC,IAAI,EACJC,KA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AA,CAACvB,IAAI;MACHqD,IAAI,EAAE5D,KAAA,CAAA8B,aAAA,CAACjB,eAAe,MAAE,CAAE;MAC1BgD,KAAK,EAAC,OAAO;MACbC,IAAI,EAAC;IAAO,CACb,CACF,EACD9D,KAAA,CAAA8B,aAAA,CAACtB,IAAI;MACHuD,IAAI,EAAEf,UAAU,CAACQ,SAAU;MAC3BQ,MAAM,EAAE,QAAS;MACjBC,IAAI,EAAC;IAAM,GAEVjB,UAAU,CAACI,QACR,CACD,CACU,CAAC,EACpBpD,KAAA,CAAA8B,aAAA,CAACR,iBAAiB;MAACoC,gBAAgB,EAAEH;IAAO,GACzCP,UAAU,CAACkB,QACK,CAAC,EACpBlE,KAAA,CAAA8B,aAAA,CAACR,iBAAiB;MAACoC,gBAAgB,EAAEH;IAAO,GACzCP,UAAU,CAACmB,WACK,CAAC,EACpBnE,KAAA,CAAA8B,aAAA,CAACR,iBAAiB;MAACoC,gBAAgB,EAAEH;IAAO,GACzCP,UAAU,CAACoB,IACK,CACN,CAAC;EAEpB,CAAC,CACQ,CAAC,EACX/B,QAAQ,IACPrC,KAAA,CAAA8B,aAAA,CAAC3B,GAAG;IAACkE,SAAS,EAAC;EAAQ,GACrBrE,KAAA,CAAA8B,aAAA,CAACpB,UAAU;IACT4D,OAAO,EAAE1C,IAAK;IACd2C,KAAK,EAAEnC,SAAU;IACjBoC,QAAQ,EAAGC,QAAQ,IAAK;MACtB5C,OAAO,CAAC4C,QAAQ,CAAC;IACnB;EAAE,CACH,CACE,CAEH,CACO,CAAC;AAEpB,CAAC"}
@@ -1,13 +1,2 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "DocSdkUsage", {
7
- enumerable: true,
8
- get: function get() {
9
- return _DocSdkUsage.DocSdkUsage;
10
- }
11
- });
12
- var _DocSdkUsage = require("./DocSdkUsage");
1
+ export { DocSdkUsage } from './DocSdkUsage';
13
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_DocSdkUsage","require"],"sources":["../../../../src/components/DocSdkUsage/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { DocSdkUsage } from './DocSdkUsage'\n"],"mappings":";;;;;;;;;;;AAyBA,IAAAA,YAAA,GAAAC,OAAA"}
1
+ {"version":3,"file":"index.js","names":["DocSdkUsage"],"sources":["../../../../src/components/DocSdkUsage/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { DocSdkUsage } from './DocSdkUsage'\n"],"mappings":"AAyBA,SAASA,WAAW,QAAQ,eAAe"}