@looker/api-explorer 0.9.22 → 0.9.27

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 (353) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/e2e/e2e.spec.ts +1 -1
  3. package/lib/ApiExplorer.d.ts +4 -43
  4. package/lib/ApiExplorer.js +71 -93
  5. package/lib/ApiExplorer.js.map +1 -1
  6. package/lib/App.d.ts +1 -0
  7. package/lib/App.js +29 -0
  8. package/lib/App.js.map +1 -0
  9. package/lib/StandaloneApiExplorer.js +36 -53
  10. package/lib/StandaloneApiExplorer.js.map +1 -1
  11. package/lib/components/Banner/Banner.d.ts +8 -0
  12. package/lib/components/Banner/Banner.js +70 -0
  13. package/lib/components/Banner/Banner.js.map +1 -0
  14. package/lib/components/Banner/index.d.ts +1 -0
  15. package/lib/components/Banner/index.js +14 -0
  16. package/lib/components/Banner/index.js.map +1 -0
  17. package/lib/components/DocMarkdown/DocMarkdown.js +5 -5
  18. package/lib/components/DocMarkdown/DocMarkdown.js.map +1 -1
  19. package/lib/components/DocSDKs/DocSDKs.js +3 -3
  20. package/lib/components/DocSDKs/DocSDKs.js.map +1 -1
  21. package/lib/components/DocSdkUsage/DocSdkUsage.js +3 -6
  22. package/lib/components/DocSdkUsage/DocSdkUsage.js.map +1 -1
  23. package/lib/components/DocSource/DocSource.js +5 -7
  24. package/lib/components/DocSource/DocSource.js.map +1 -1
  25. package/lib/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.d.ts +1 -1
  26. package/lib/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.js +152 -8
  27. package/lib/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.js.map +1 -1
  28. package/lib/components/ExploreType/ExploreType.js +3 -5
  29. package/lib/components/ExploreType/ExploreType.js.map +1 -1
  30. package/lib/components/Header/Header.d.ts +2 -5
  31. package/lib/components/Header/Header.js +1 -5
  32. package/lib/components/Header/Header.js.map +1 -1
  33. package/lib/components/SelectorContainer/ApiSpecSelector.d.ts +2 -5
  34. package/lib/components/SelectorContainer/ApiSpecSelector.js +5 -5
  35. package/lib/components/SelectorContainer/ApiSpecSelector.js.map +1 -1
  36. package/lib/components/SelectorContainer/SdkLanguageSelector.js +1 -1
  37. package/lib/components/SelectorContainer/SdkLanguageSelector.js.map +1 -1
  38. package/lib/components/SelectorContainer/SelectorContainer.d.ts +2 -5
  39. package/lib/components/SelectorContainer/SelectorContainer.js +3 -7
  40. package/lib/components/SelectorContainer/SelectorContainer.js.map +1 -1
  41. package/lib/components/SideNav/SideNav.d.ts +2 -5
  42. package/lib/components/SideNav/SideNav.js +1 -1
  43. package/lib/components/SideNav/SideNav.js.map +1 -1
  44. package/lib/components/common/Loader.d.ts +1 -1
  45. package/lib/components/common/Loader.js.map +1 -1
  46. package/lib/components/index.d.ts +1 -0
  47. package/lib/components/index.js +8 -0
  48. package/lib/components/index.js.map +1 -1
  49. package/lib/esm/ApiExplorer.js +71 -92
  50. package/lib/esm/ApiExplorer.js.map +1 -1
  51. package/lib/esm/App.js +19 -0
  52. package/lib/esm/App.js.map +1 -0
  53. package/lib/esm/StandaloneApiExplorer.js +36 -53
  54. package/lib/esm/StandaloneApiExplorer.js.map +1 -1
  55. package/lib/esm/components/Banner/Banner.js +54 -0
  56. package/lib/esm/components/Banner/Banner.js.map +1 -0
  57. package/lib/esm/components/Banner/index.js +2 -0
  58. package/lib/esm/{test-utils/envAdaptor.js.map → components/Banner/index.js.map} +1 -1
  59. package/lib/esm/components/DocMarkdown/DocMarkdown.js +3 -3
  60. package/lib/esm/components/DocMarkdown/DocMarkdown.js.map +1 -1
  61. package/lib/esm/components/DocSDKs/DocSDKs.js +2 -2
  62. package/lib/esm/components/DocSDKs/DocSDKs.js.map +1 -1
  63. package/lib/esm/components/DocSdkUsage/DocSdkUsage.js +5 -7
  64. package/lib/esm/components/DocSdkUsage/DocSdkUsage.js.map +1 -1
  65. package/lib/esm/components/DocSource/DocSource.js +4 -5
  66. package/lib/esm/components/DocSource/DocSource.js.map +1 -1
  67. package/lib/esm/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.js +153 -6
  68. package/lib/esm/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.js.map +1 -1
  69. package/lib/esm/components/ExploreType/ExploreType.js +3 -4
  70. package/lib/esm/components/ExploreType/ExploreType.js.map +1 -1
  71. package/lib/esm/components/Header/Header.js +1 -5
  72. package/lib/esm/components/Header/Header.js.map +1 -1
  73. package/lib/esm/components/SelectorContainer/ApiSpecSelector.js +4 -5
  74. package/lib/esm/components/SelectorContainer/ApiSpecSelector.js.map +1 -1
  75. package/lib/esm/components/SelectorContainer/SdkLanguageSelector.js +2 -2
  76. package/lib/esm/components/SelectorContainer/SdkLanguageSelector.js.map +1 -1
  77. package/lib/esm/components/SelectorContainer/SelectorContainer.js +3 -7
  78. package/lib/esm/components/SelectorContainer/SelectorContainer.js.map +1 -1
  79. package/lib/esm/components/SideNav/SideNav.js +2 -2
  80. package/lib/esm/components/SideNav/SideNav.js.map +1 -1
  81. package/lib/esm/components/common/Loader.js.map +1 -1
  82. package/lib/esm/components/index.js +1 -0
  83. package/lib/esm/components/index.js.map +1 -1
  84. package/lib/esm/index.js +5 -18
  85. package/lib/esm/index.js.map +1 -1
  86. package/lib/esm/routes/AppRouter.js +3 -7
  87. package/lib/esm/routes/AppRouter.js.map +1 -1
  88. package/lib/esm/scenes/DiffScene/DiffScene.js +43 -99
  89. package/lib/esm/scenes/DiffScene/DiffScene.js.map +1 -1
  90. package/lib/esm/scenes/DiffScene/DocDiff/DiffItem.js +9 -13
  91. package/lib/esm/scenes/DiffScene/DocDiff/DiffItem.js.map +1 -1
  92. package/lib/esm/scenes/DiffScene/DocDiff/DocDiff.js +2 -2
  93. package/lib/esm/scenes/DiffScene/DocDiff/DocDiff.js.map +1 -1
  94. package/lib/esm/scenes/MethodScene/MethodScene.js +12 -15
  95. package/lib/esm/scenes/MethodScene/MethodScene.js.map +1 -1
  96. package/lib/esm/state/index.js +2 -0
  97. package/lib/esm/state/index.js.map +1 -1
  98. package/lib/esm/state/lodes/index.js +3 -0
  99. package/lib/{test-utils/envAdaptor.js.map → esm/state/lodes/index.js.map} +1 -1
  100. package/lib/esm/state/lodes/sagas.js +25 -0
  101. package/lib/esm/state/lodes/sagas.js.map +1 -0
  102. package/lib/esm/state/lodes/selectors.js +5 -0
  103. package/lib/esm/state/lodes/selectors.js.map +1 -0
  104. package/lib/esm/state/lodes/slice.js +30 -0
  105. package/lib/esm/state/lodes/slice.js.map +1 -0
  106. package/lib/esm/state/settings/sagas.js +28 -16
  107. package/lib/esm/state/settings/sagas.js.map +1 -1
  108. package/lib/esm/state/settings/selectors.js +5 -5
  109. package/lib/esm/state/settings/selectors.js.map +1 -1
  110. package/lib/esm/state/settings/slice.js +8 -8
  111. package/lib/esm/state/settings/slice.js.map +1 -1
  112. package/lib/esm/state/specs/index.js +3 -0
  113. package/lib/esm/state/specs/index.js.map +1 -0
  114. package/lib/esm/state/specs/sagas.js +58 -0
  115. package/lib/esm/state/specs/sagas.js.map +1 -0
  116. package/lib/esm/state/specs/selectors.js +8 -0
  117. package/lib/esm/state/specs/selectors.js.map +1 -0
  118. package/lib/esm/state/specs/slice.js +55 -0
  119. package/lib/esm/state/specs/slice.js.map +1 -0
  120. package/lib/esm/state/store.js +57 -3
  121. package/lib/esm/state/store.js.map +1 -1
  122. package/lib/esm/test-utils/index.js +1 -2
  123. package/lib/esm/test-utils/index.js.map +1 -1
  124. package/lib/esm/test-utils/lodes.js +12 -0
  125. package/lib/esm/test-utils/lodes.js.map +1 -0
  126. package/lib/esm/test-utils/redux.js +16 -9
  127. package/lib/esm/test-utils/redux.js.map +1 -1
  128. package/lib/esm/utils/adaptorUtils.js +101 -0
  129. package/lib/esm/utils/adaptorUtils.js.map +1 -0
  130. package/lib/esm/utils/apixAdaptor.js +48 -0
  131. package/lib/esm/utils/apixAdaptor.js.map +1 -0
  132. package/lib/esm/utils/index.js +3 -2
  133. package/lib/esm/utils/index.js.map +1 -1
  134. package/lib/esm/utils/lodeUtils.js +3 -7
  135. package/lib/esm/utils/lodeUtils.js.map +1 -1
  136. package/lib/esm/utils/path.js +27 -2
  137. package/lib/esm/utils/path.js.map +1 -1
  138. package/lib/index.d.ts +5 -1
  139. package/lib/index.js +59 -17
  140. package/lib/index.js.map +1 -1
  141. package/lib/routes/AppRouter.d.ts +1 -5
  142. package/lib/routes/AppRouter.js +3 -7
  143. package/lib/routes/AppRouter.js.map +1 -1
  144. package/lib/scenes/DiffScene/DiffScene.js +45 -100
  145. package/lib/scenes/DiffScene/DiffScene.js.map +1 -1
  146. package/lib/scenes/DiffScene/DocDiff/DiffItem.js +9 -13
  147. package/lib/scenes/DiffScene/DocDiff/DiffItem.js.map +1 -1
  148. package/lib/scenes/DiffScene/DocDiff/DocDiff.js +2 -2
  149. package/lib/scenes/DiffScene/DocDiff/DocDiff.js.map +1 -1
  150. package/lib/scenes/MethodScene/MethodScene.d.ts +0 -4
  151. package/lib/scenes/MethodScene/MethodScene.js +11 -13
  152. package/lib/scenes/MethodScene/MethodScene.js.map +1 -1
  153. package/lib/state/index.d.ts +2 -0
  154. package/lib/state/index.js +26 -0
  155. package/lib/state/index.js.map +1 -1
  156. package/lib/state/lodes/index.d.ts +2 -0
  157. package/lib/state/lodes/index.js +32 -0
  158. package/lib/state/lodes/index.js.map +1 -0
  159. package/lib/state/lodes/sagas.d.ts +1 -0
  160. package/lib/state/lodes/sagas.js +34 -0
  161. package/lib/state/lodes/sagas.js.map +1 -0
  162. package/lib/state/lodes/selectors.d.ts +3 -0
  163. package/lib/state/lodes/selectors.js +17 -0
  164. package/lib/state/lodes/selectors.js.map +1 -0
  165. package/lib/state/lodes/slice.d.ts +29 -0
  166. package/lib/state/lodes/slice.js +45 -0
  167. package/lib/state/lodes/slice.js.map +1 -0
  168. package/lib/state/settings/sagas.js +28 -15
  169. package/lib/state/settings/sagas.js.map +1 -1
  170. package/lib/state/settings/selectors.d.ts +1 -1
  171. package/lib/state/settings/selectors.js +5 -5
  172. package/lib/state/settings/selectors.js.map +1 -1
  173. package/lib/state/settings/slice.d.ts +14 -14
  174. package/lib/state/settings/slice.js +13 -13
  175. package/lib/state/settings/slice.js.map +1 -1
  176. package/lib/state/specs/index.d.ts +2 -0
  177. package/lib/state/specs/index.js +32 -0
  178. package/lib/state/specs/index.js.map +1 -0
  179. package/lib/state/specs/sagas.d.ts +1 -0
  180. package/lib/state/specs/sagas.js +67 -0
  181. package/lib/state/specs/sagas.js.map +1 -0
  182. package/lib/state/specs/selectors.d.ts +4 -0
  183. package/lib/state/specs/selectors.js +20 -0
  184. package/lib/state/specs/selectors.js.map +1 -0
  185. package/lib/state/specs/slice.d.ts +49 -0
  186. package/lib/state/specs/slice.js +70 -0
  187. package/lib/state/specs/slice.js.map +1 -0
  188. package/lib/state/store.d.ts +6 -0
  189. package/lib/state/store.js +60 -2
  190. package/lib/state/store.js.map +1 -1
  191. package/lib/test-data/declarations.d.ts +2 -0
  192. package/lib/test-data/declarations.js +24 -0
  193. package/lib/test-data/declarations.js.map +1 -0
  194. package/lib/test-data/examples.d.ts +2 -0
  195. package/lib/test-data/index.d.ts +3 -0
  196. package/lib/test-data/index.js +29 -36
  197. package/lib/test-data/index.js.map +1 -1
  198. package/lib/test-data/specs.d.ts +10 -0
  199. package/lib/test-data/specs.js +6 -6
  200. package/lib/test-data/specs.js.map +1 -1
  201. package/lib/test-utils/index.d.ts +1 -2
  202. package/lib/test-utils/index.js +12 -28
  203. package/lib/test-utils/index.js.map +1 -1
  204. package/lib/test-utils/lodes.d.ts +4 -0
  205. package/lib/test-utils/lodes.js +23 -0
  206. package/lib/test-utils/lodes.js.map +1 -0
  207. package/lib/test-utils/redux.d.ts +4 -1
  208. package/lib/test-utils/redux.js +18 -9
  209. package/lib/test-utils/redux.js.map +1 -1
  210. package/lib/utils/adaptorUtils.d.ts +30 -0
  211. package/lib/utils/adaptorUtils.js +124 -0
  212. package/lib/utils/adaptorUtils.js.map +1 -0
  213. package/lib/utils/apixAdaptor.d.ts +15 -0
  214. package/lib/utils/apixAdaptor.js +67 -0
  215. package/lib/utils/apixAdaptor.js.map +1 -0
  216. package/lib/utils/index.d.ts +3 -2
  217. package/lib/utils/index.js +30 -39
  218. package/lib/utils/index.js.map +1 -1
  219. package/lib/utils/lodeUtils.d.ts +2 -2
  220. package/lib/utils/lodeUtils.js +3 -7
  221. package/lib/utils/lodeUtils.js.map +1 -1
  222. package/lib/utils/path.d.ts +3 -0
  223. package/lib/utils/path.js +32 -2
  224. package/lib/utils/path.js.map +1 -1
  225. package/package.json +11 -10
  226. package/public/Looker.3.1.json +1343 -412
  227. package/public/Looker.4.0.json +3305 -661
  228. package/src/ApiExplorer.tsx +114 -144
  229. package/src/{index.tsx → App.tsx} +0 -0
  230. package/src/StandaloneApiExplorer.tsx +38 -61
  231. package/src/components/Banner/Banner.spec.tsx +99 -0
  232. package/src/components/Banner/Banner.tsx +87 -0
  233. package/src/{reducers → components/Banner}/index.ts +1 -1
  234. package/src/components/DocMarkdown/DocMarkdown.tsx +3 -3
  235. package/src/components/DocSDKs/DocSDKs.tsx +4 -5
  236. package/src/components/DocSdkUsage/DocSdkUsage.spec.tsx +2 -2
  237. package/src/components/DocSdkUsage/DocSdkUsage.tsx +5 -5
  238. package/src/components/DocSource/DocSource.tsx +4 -3
  239. package/src/components/ErrorBoundary/components/SomethingWentWrong/SomethingWentWrong.spec.tsx +1 -1
  240. package/src/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.tsx +170 -6
  241. package/src/components/ExploreType/ExploreType.spec.tsx +0 -23
  242. package/src/components/ExploreType/ExploreType.tsx +5 -6
  243. package/src/components/ExploreType/exploreUtils.spec.tsx +1 -1
  244. package/src/components/Header/Header.spec.tsx +9 -30
  245. package/src/components/Header/Header.tsx +3 -10
  246. package/src/components/SelectorContainer/ApiSpecSelector.spec.tsx +31 -44
  247. package/src/components/SelectorContainer/ApiSpecSelector.tsx +6 -12
  248. package/src/components/SelectorContainer/SdkLanguageSelector.spec.tsx +3 -5
  249. package/src/components/SelectorContainer/SdkLanguageSelector.tsx +2 -2
  250. package/src/components/SelectorContainer/SelectorContainer.spec.tsx +7 -26
  251. package/src/components/SelectorContainer/SelectorContainer.tsx +4 -10
  252. package/src/components/SideNav/SideNav.spec.tsx +12 -45
  253. package/src/components/SideNav/SideNav.tsx +3 -9
  254. package/src/components/common/Loader.tsx +1 -1
  255. package/src/components/index.ts +1 -0
  256. package/src/{reducers/spec/index.ts → index.ts} +4 -2
  257. package/src/routes/AppRouter.tsx +26 -37
  258. package/src/scenes/DiffScene/DiffScene.tsx +47 -84
  259. package/src/scenes/DiffScene/DocDiff/DiffItem.spec.tsx +9 -16
  260. package/src/scenes/DiffScene/DocDiff/DiffItem.tsx +11 -12
  261. package/src/scenes/DiffScene/DocDiff/DocDiff.tsx +2 -2
  262. package/src/scenes/MethodScene/MethodScene.tsx +12 -18
  263. package/src/state/index.ts +2 -0
  264. package/src/{context → state/lodes}/index.ts +2 -1
  265. package/src/state/lodes/sagas.spec.ts +92 -0
  266. package/src/state/lodes/sagas.ts +51 -0
  267. package/src/state/lodes/selectors.spec.ts +42 -0
  268. package/src/{reducers/spec/actions.spec.ts → state/lodes/selectors.ts} +9 -11
  269. package/src/{test-utils/render_with_lode.tsx → state/lodes/slice.ts} +37 -37
  270. package/src/state/settings/sagas.spec.ts +25 -21
  271. package/src/state/settings/sagas.ts +16 -16
  272. package/src/state/settings/selectors.spec.ts +1 -5
  273. package/src/state/settings/selectors.ts +5 -5
  274. package/src/state/settings/slice.ts +12 -7
  275. package/src/{context/lode → state/specs}/index.ts +2 -1
  276. package/src/state/specs/sagas.spec.ts +135 -0
  277. package/src/state/specs/sagas.ts +81 -0
  278. package/src/{test-utils/envAdaptor.ts → state/specs/selectors.ts} +10 -4
  279. package/src/state/specs/slice.ts +109 -0
  280. package/src/state/store.ts +65 -2
  281. package/src/{context/lode/LodeContext.ts → test-data/declarations.ts} +17 -14
  282. package/src/test-data/index.ts +2 -8
  283. package/src/test-data/specs.ts +6 -6
  284. package/src/test-utils/index.ts +1 -5
  285. package/src/{reducers/spec/reducer.spec.ts → test-utils/lodes.tsx} +16 -19
  286. package/src/test-utils/redux.tsx +31 -8
  287. package/src/utils/adaptorUtils.ts +181 -0
  288. package/src/utils/apixAdaptor.ts +72 -0
  289. package/src/utils/index.ts +3 -8
  290. package/src/utils/lodeUtils.ts +4 -6
  291. package/src/utils/path.ts +25 -2
  292. package/webpack.dev.config.js +3 -0
  293. package/webpack.prod.config.js +4 -0
  294. package/lib/context/index.d.ts +0 -1
  295. package/lib/context/index.js +0 -20
  296. package/lib/context/index.js.map +0 -1
  297. package/lib/context/lode/LodeContext.d.ts +0 -9
  298. package/lib/context/lode/LodeContext.js +0 -21
  299. package/lib/context/lode/LodeContext.js.map +0 -1
  300. package/lib/context/lode/index.d.ts +0 -1
  301. package/lib/context/lode/index.js +0 -20
  302. package/lib/context/lode/index.js.map +0 -1
  303. package/lib/esm/context/index.js +0 -2
  304. package/lib/esm/context/index.js.map +0 -1
  305. package/lib/esm/context/lode/LodeContext.js +0 -11
  306. package/lib/esm/context/lode/LodeContext.js.map +0 -1
  307. package/lib/esm/context/lode/index.js +0 -2
  308. package/lib/esm/context/lode/index.js.map +0 -1
  309. package/lib/esm/reducers/index.js +0 -2
  310. package/lib/esm/reducers/index.js.map +0 -1
  311. package/lib/esm/reducers/spec/actions.js +0 -19
  312. package/lib/esm/reducers/spec/actions.js.map +0 -1
  313. package/lib/esm/reducers/spec/index.js +0 -4
  314. package/lib/esm/reducers/spec/index.js.map +0 -1
  315. package/lib/esm/reducers/spec/reducer.js +0 -62
  316. package/lib/esm/reducers/spec/reducer.js.map +0 -1
  317. package/lib/esm/reducers/spec/utils.js +0 -74
  318. package/lib/esm/reducers/spec/utils.js.map +0 -1
  319. package/lib/esm/test-utils/envAdaptor.js +0 -5
  320. package/lib/esm/test-utils/render_with_lode.js +0 -19
  321. package/lib/esm/test-utils/render_with_lode.js.map +0 -1
  322. package/lib/esm/utils/envAdaptor.js +0 -84
  323. package/lib/esm/utils/envAdaptor.js.map +0 -1
  324. package/lib/reducers/index.d.ts +0 -1
  325. package/lib/reducers/index.js +0 -19
  326. package/lib/reducers/index.js.map +0 -1
  327. package/lib/reducers/spec/actions.d.ts +0 -20
  328. package/lib/reducers/spec/actions.js +0 -31
  329. package/lib/reducers/spec/actions.js.map +0 -1
  330. package/lib/reducers/spec/index.d.ts +0 -3
  331. package/lib/reducers/spec/index.js +0 -45
  332. package/lib/reducers/spec/index.js.map +0 -1
  333. package/lib/reducers/spec/reducer.d.ts +0 -7
  334. package/lib/reducers/spec/reducer.js +0 -73
  335. package/lib/reducers/spec/reducer.js.map +0 -1
  336. package/lib/reducers/spec/utils.d.ts +0 -7
  337. package/lib/reducers/spec/utils.js +0 -91
  338. package/lib/reducers/spec/utils.js.map +0 -1
  339. package/lib/test-utils/envAdaptor.d.ts +0 -2
  340. package/lib/test-utils/envAdaptor.js +0 -15
  341. package/lib/test-utils/render_with_lode.d.ts +0 -7
  342. package/lib/test-utils/render_with_lode.js +0 -36
  343. package/lib/test-utils/render_with_lode.js.map +0 -1
  344. package/lib/utils/envAdaptor.d.ts +0 -31
  345. package/lib/utils/envAdaptor.js +0 -106
  346. package/lib/utils/envAdaptor.js.map +0 -1
  347. package/src/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/somethingWentWrong.svg +0 -45
  348. package/src/reducers/spec/actions.ts +0 -62
  349. package/src/reducers/spec/reducer.ts +0 -69
  350. package/src/reducers/spec/utils.spec.ts +0 -138
  351. package/src/reducers/spec/utils.ts +0 -123
  352. package/src/utils/envAdaptor.spec.ts +0 -50
  353. package/src/utils/envAdaptor.ts +0 -147
@@ -9,9 +9,13 @@ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _runIt = require("@looker/run-it");
11
11
 
12
+ var _extensionUtils = require("@looker/extension-utils");
13
+
12
14
  var _reactRedux = require("react-redux");
13
15
 
14
- var _ApiExplorer = _interopRequireDefault(require("./ApiExplorer"));
16
+ var _reactRouter = require("react-router");
17
+
18
+ var _ApiExplorer = require("./ApiExplorer");
15
19
 
16
20
  var _state = require("./state");
17
21
 
@@ -19,8 +23,6 @@ var _utils = require("./utils");
19
23
 
20
24
  var _components = require("./components");
21
25
 
22
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
-
24
26
  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); }
25
27
 
26
28
  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; }
@@ -29,64 +31,45 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
29
31
 
30
32
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
31
33
 
32
- var standaloneEnvAdaptor = new _utils.StandaloneEnvAdaptor();
33
-
34
- var loadVersions = function () {
35
- var _ref = _asyncToGenerator(function* (current) {
36
- var data = yield standaloneEnvAdaptor.localStorageGetItem(_runIt.RunItConfigKey);
37
- var config = data ? JSON.parse(data) : _runIt.RunItNoConfig;
38
- var url = config.base_url ? "".concat(config.base_url, "/versions") : current;
39
- var response = yield (0, _runIt.loadSpecsFromVersions)(url);
40
-
41
- if (response.fetchResult) {
42
- console.error("Reverting to ".concat(current, " due to ").concat(url, " error: ").concat(response.fetchResult));
43
- url = current;
44
- response = yield (0, _runIt.loadSpecsFromVersions)(url);
45
- }
46
-
47
- return {
48
- url,
49
- response
50
- };
51
- });
52
-
53
- return function loadVersions(_x) {
54
- return _ref.apply(this, arguments);
55
- };
56
- }();
57
-
58
- var StandaloneApiExplorer = _ref2 => {
34
+ var StandaloneApiExplorer = _ref => {
59
35
  var {
60
- headless = false,
61
- versionsUrl = ''
62
- } = _ref2;
63
- var [specs, setSpecs] = (0, _react.useState)();
64
- var [currentVersionsUrl, setCurrentVersionsUrl] = (0, _react.useState)(versionsUrl);
36
+ headless = false
37
+ } = _ref;
38
+ var [browserAdaptor] = (0, _react.useState)(new _utils.ApixAdaptor((0, _runIt.initRunItSdk)(), window.origin));
39
+ var location = (0, _reactRouter.useLocation)();
40
+ var oauthReturn = location.pathname === "/".concat(_utils.oAuthPath);
41
+ var sdk = browserAdaptor.sdk;
42
+ var canLogin = sdk.authSession.settings.authIsConfigured() && !sdk.authSession.isAuthenticated() && !oauthReturn;
65
43
  (0, _react.useEffect)(() => {
66
- if (currentVersionsUrl) {
67
- loadVersions(currentVersionsUrl).then(result => {
68
- setCurrentVersionsUrl(result.url);
69
- var response = result.response;
70
- setSpecs(response.specs);
44
+ var login = function () {
45
+ var _ref2 = _asyncToGenerator(function* () {
46
+ return yield browserAdaptor.login();
71
47
  });
72
- } else {
73
- setSpecs(undefined);
48
+
49
+ return function login() {
50
+ return _ref2.apply(this, arguments);
51
+ };
52
+ }();
53
+
54
+ if (canLogin) {
55
+ login();
74
56
  }
75
- }, [versionsUrl, currentVersionsUrl]);
76
- var chosenSdk = (0, _runIt.initRunItSdk)(_runIt.defaultConfigurator);
57
+ }, []);
58
+ var {
59
+ looker_url
60
+ } = sdk.authSession.settings.getStoredConfig();
77
61
  return _react.default.createElement(_reactRedux.Provider, {
78
62
  store: _state.store
79
63
  }, _react.default.createElement(_runIt.RunItProvider, {
80
- sdk: chosenSdk,
81
- configurator: _runIt.defaultConfigurator,
82
64
  basePath: "/api/4.0"
83
- }, _react.default.createElement(_react.default.Fragment, null, specs ? _react.default.createElement(_ApiExplorer.default, {
84
- specs: specs,
85
- envAdaptor: standaloneEnvAdaptor,
86
- headless: headless,
87
- setVersionsUrl: setCurrentVersionsUrl
88
- }) : _react.default.createElement(_components.Loader, {
89
- themeOverrides: standaloneEnvAdaptor.themeOverrides()
65
+ }, canLogin ? _react.default.createElement(_components.Loader, {
66
+ themeOverrides: browserAdaptor.themeOverrides(),
67
+ message: "Configuration found. Logging into ".concat(looker_url)
68
+ }) : _react.default.createElement(_react.default.Fragment, null, oauthReturn ? _react.default.createElement(_extensionUtils.OAuthScene, {
69
+ adaptor: browserAdaptor
70
+ }) : _react.default.createElement(_ApiExplorer.ApiExplorer, {
71
+ adaptor: browserAdaptor,
72
+ headless: headless
90
73
  }))));
91
74
  };
92
75
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/StandaloneApiExplorer.tsx"],"names":["standaloneEnvAdaptor","StandaloneEnvAdaptor","loadVersions","current","data","localStorageGetItem","RunItConfigKey","config","JSON","parse","RunItNoConfig","url","base_url","response","fetchResult","console","error","StandaloneApiExplorer","headless","versionsUrl","specs","setSpecs","currentVersionsUrl","setCurrentVersionsUrl","then","result","undefined","chosenSdk","defaultConfigurator","store","themeOverrides"],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d,GAAR,CAArB;AACA,YAAME,QAAQ,GAAGY,MAAM,CAACZ,QAAxB;AACAQ,QAAAA,QAAQ,CAACR,QAAQ,CAACO,KAAV,CAAR;AACD,OAJD;AAKD,KAND,MAMO;AACLC,MAAAA,QAAQ,CAACK,SAAD,CAAR;AACD;AACF,GAVD,EAUG,CAACP,WAAD,EAAcG,kBAAd,CAVH;AAYA,MAAMK,SAAsB,GAAG,yBAAaC,0BAAb,CAA/B;AAEA,SACE,6BAAC,oBAAD;AAAU,IAAA,KAAK,EAAEC;AAAjB,KACE,6BAAC,oBAAD;AACE,IAAA,GAAG,EAAEF,SADP;AAEE,IAAA,YAAY,EAAEC,0BAFhB;AAGE,IAAA,QAAQ,EAAC;AAHX,KAKE,4DACGR,KAAK,GACJ,6BAAC,oBAAD;AACE,IAAA,KAAK,EAAEA,KADT;AAEE,IAAA,UAAU,EAAEpB,oBAFd;AAGE,IAAA,QAAQ,EAAEkB,QAHZ;AAIE,IAAA,cAAc,EAAEK;AAJlB,IADI,GAQJ,6BAAC,kBAAD;AAAQ,IAAA,cAAc,EAAEvB,oBAAoB,CAAC8B,cAArB;AAAxB,IATJ,CALF,CADF,CADF;AAsBD,CA5CM","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, { useEffect, useState } from 'react'\nimport {\n RunItProvider,\n defaultConfigurator,\n initRunItSdk,\n loadSpecsFromVersions,\n RunItConfigKey,\n RunItNoConfig,\n} from '@looker/run-it'\nimport type { IAPIMethods } from '@looker/sdk-rtl'\nimport type { SpecList } from '@looker/sdk-codegen'\nimport { Provider } from 'react-redux'\n\nimport ApiExplorer from './ApiExplorer'\nimport { store } from './state'\nimport { StandaloneEnvAdaptor } from './utils'\nimport { Loader } from './components'\n\nexport interface StandaloneApiExplorerProps {\n headless?: boolean\n versionsUrl: string\n}\n\nconst standaloneEnvAdaptor = new StandaloneEnvAdaptor()\n\nconst loadVersions = async (current: string) => {\n const data = await standaloneEnvAdaptor.localStorageGetItem(RunItConfigKey)\n const config = data ? JSON.parse(data) : RunItNoConfig\n let url = config.base_url ? `${config.base_url}/versions` : current\n let response = await loadSpecsFromVersions(url)\n if (response.fetchResult) {\n console.error(\n `Reverting to ${current} due to ${url} error: ${response.fetchResult}`\n )\n // The stored server location has an error so default to current\n url = current\n response = await loadSpecsFromVersions(url)\n }\n return { url, response }\n}\n\nexport const StandaloneApiExplorer: FC<StandaloneApiExplorerProps> = ({\n headless = false,\n versionsUrl = '',\n}) => {\n const [specs, setSpecs] = useState<SpecList | undefined>()\n const [currentVersionsUrl, setCurrentVersionsUrl] =\n useState<string>(versionsUrl)\n\n useEffect(() => {\n if (currentVersionsUrl) {\n loadVersions(currentVersionsUrl).then((result) => {\n setCurrentVersionsUrl(result.url)\n const response = result.response\n setSpecs(response.specs)\n })\n } else {\n setSpecs(undefined)\n }\n }, [versionsUrl, currentVersionsUrl])\n\n const chosenSdk: IAPIMethods = initRunItSdk(defaultConfigurator)\n\n return (\n <Provider store={store}>\n <RunItProvider\n sdk={chosenSdk}\n configurator={defaultConfigurator}\n basePath=\"/api/4.0\"\n >\n <>\n {specs ? (\n <ApiExplorer\n specs={specs}\n envAdaptor={standaloneEnvAdaptor}\n headless={headless}\n setVersionsUrl={setCurrentVersionsUrl}\n />\n ) : (\n <Loader themeOverrides={standaloneEnvAdaptor.themeOverrides()} />\n )}\n </>\n </RunItProvider>\n </Provider>\n )\n}\n"],"file":"StandaloneApiExplorer.js"}
1
+ {"version":3,"sources":["../src/StandaloneApiExplorer.tsx"],"names":["StandaloneApiExplorer","headless","browserAdaptor","ApixAdaptor","window","origin","location","oauthReturn","pathname","oAuthPath","sdk","canLogin","authSession","settings","authIsConfigured","isAuthenticated","login","looker_url","getStoredConfig","store","themeOverrides"],"mappings":";;;;;;;AA2BA;;AACA;;AAEA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;AAOO,IAAMA,qBAAqD,GAAG,QAE/D;AAAA,MAFgE;AACpEC,IAAAA,QAAQ,GAAG;AADyD,GAEhE;AACJ,MAAM,CAACC,cAAD,IAAmB,qBACvB,IAAIC,kBAAJ,CAAgB,0BAAhB,EAAgCC,MAAM,CAACC,MAAvC,CADuB,CAAzB;AAGA,MAAMC,QAAQ,GAAG,+BAAjB;AACA,MAAMC,WAAW,GAAGD,QAAQ,CAACE,QAAT,gBAA0BC,gBAA1B,CAApB;AACA,MAAMC,GAAG,GAAGR,cAAc,CAACQ,GAA3B;AACA,MAAMC,QAAQ,GACXD,GAAG,CAACE,WAAJ,CAAgBC,QAAjB,CAAkDC,gBAAlD,MACA,CAACJ,GAAG,CAACE,WAAJ,CAAgBG,eAAhB,EADD,IAEA,CAACR,WAHH;AAKA,wBAAU,MAAM;AACd,QAAMS,KAAK;AAAA,oCAAG;AAAA,qBAAkBd,cAAc,CAACc,KAAf,EAAlB;AAAA,OAAH;;AAAA,sBAALA,KAAK;AAAA;AAAA;AAAA,OAAX;;AACA,QAAIL,QAAJ,EAAc;AACZK,MAAAA,KAAK;AACN;AACF,GALD,EAKG,EALH;AAOA,MAAM;AAAEC,IAAAA;AAAF,MACJP,GAAG,CAACE,WAAJ,CAAgBC,QADK,CAErBK,eAFqB,EAAvB;AAIA,SACE,6BAAC,oBAAD;AAAU,IAAA,KAAK,EAAEC;AAAjB,KACE,6BAAC,oBAAD;AAAe,IAAA,QAAQ,EAAC;AAAxB,KACGR,QAAQ,GACP,6BAAC,kBAAD;AACE,IAAA,cAAc,EAAET,cAAc,CAACkB,cAAf,EADlB;AAEE,IAAA,OAAO,8CAAuCH,UAAvC;AAFT,IADO,GAMP,4DACGV,WAAW,GACV,6BAAC,0BAAD;AAAY,IAAA,OAAO,EAAEL;AAArB,IADU,GAGV,6BAAC,wBAAD;AAAa,IAAA,OAAO,EAAEA,cAAtB;AAAsC,IAAA,QAAQ,EAAED;AAAhD,IAJJ,CAPJ,CADF,CADF;AAoBD,CA7CM","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, { useEffect, useState } from 'react'\nimport { initRunItSdk, RunItProvider } from '@looker/run-it'\nimport type { OAuthConfigProvider } from '@looker/extension-utils'\nimport { OAuthScene } from '@looker/extension-utils'\nimport { Provider } from 'react-redux'\nimport { useLocation } from 'react-router'\n\nimport { ApiExplorer } from './ApiExplorer'\nimport { store } from './state'\nimport { oAuthPath, ApixAdaptor } from './utils'\nimport { Loader } from './components'\n\nexport interface StandaloneApiExplorerProps {\n headless?: boolean\n versionsUrl: string\n}\n\nexport const StandaloneApiExplorer: FC<StandaloneApiExplorerProps> = ({\n headless = false,\n}) => {\n const [browserAdaptor] = useState(\n new ApixAdaptor(initRunItSdk(), window.origin)\n )\n const location = useLocation()\n const oauthReturn = location.pathname === `/${oAuthPath}`\n const sdk = browserAdaptor.sdk\n const canLogin =\n (sdk.authSession.settings as OAuthConfigProvider).authIsConfigured() &&\n !sdk.authSession.isAuthenticated() &&\n !oauthReturn\n\n useEffect(() => {\n const login = async () => await browserAdaptor.login()\n if (canLogin) {\n login()\n }\n }, [])\n\n const { looker_url } = (\n sdk.authSession.settings as OAuthConfigProvider\n ).getStoredConfig()\n\n return (\n <Provider store={store}>\n <RunItProvider basePath=\"/api/4.0\">\n {canLogin ? (\n <Loader\n themeOverrides={browserAdaptor.themeOverrides()}\n message={`Configuration found. Logging into ${looker_url}`}\n />\n ) : (\n <>\n {oauthReturn ? (\n <OAuthScene adaptor={browserAdaptor} />\n ) : (\n <ApiExplorer adaptor={browserAdaptor} headless={headless} />\n )}\n </>\n )}\n </RunItProvider>\n </Provider>\n )\n}\n"],"file":"StandaloneApiExplorer.js"}
@@ -0,0 +1,8 @@
1
+ import type { IEnvironmentAdaptor } from '@looker/extension-utils';
2
+ import type { SpecList } from '@looker/sdk-codegen';
3
+ import type { FC } from 'react';
4
+ export interface BannerProps {
5
+ adaptor: IEnvironmentAdaptor;
6
+ specs: SpecList;
7
+ }
8
+ export declare const Banner: FC<BannerProps>;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Banner = void 0;
7
+
8
+ var _components = require("@looker/components");
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ 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); }
13
+
14
+ 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; }
15
+
16
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
17
+
18
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
19
+
20
+ var LOCAL_STORAGE_KEY = 'api-40-ga-apix-banner';
21
+ var LOCAL_STORAGE_VALUE = 'dismissed';
22
+
23
+ var Banner = _ref => {
24
+ var {
25
+ adaptor,
26
+ specs
27
+ } = _ref;
28
+ var [isOpen, setOpen] = (0, _react.useState)(false);
29
+ (0, _react.useEffect)(onLoad, []);
30
+
31
+ if (isOpen) {
32
+ return _react.default.createElement(_components.MessageBar, {
33
+ intent: "inform",
34
+ onPrimaryClick: onClose,
35
+ secondaryAction: _react.default.createElement(_components.Link, {
36
+ href: "https://developers.looker.com/api/advanced-usage/version-4-ga",
37
+ target: "_blank"
38
+ }, _react.default.createElement(_components.ButtonOutline, {
39
+ size: "small"
40
+ }, "Announcement"))
41
+ }, "API 4.0 moves from Beta to General Availability in Looker 22.4 with additions and possible breaking changes. Read the announcement to see how this affects you.");
42
+ } else {
43
+ return null;
44
+ }
45
+
46
+ function onLoad() {
47
+ function innerOnLoad() {
48
+ return _innerOnLoad.apply(this, arguments);
49
+ }
50
+
51
+ function _innerOnLoad() {
52
+ _innerOnLoad = _asyncToGenerator(function* () {
53
+ var is40Stable = specs['4.0'].status === 'stable' || specs['4.0'].status === 'current';
54
+ var wasDismissed = (yield adaptor.localStorageGetItem(LOCAL_STORAGE_KEY)) === LOCAL_STORAGE_VALUE;
55
+ setOpen(!is40Stable && !wasDismissed && adaptor.isExtension());
56
+ });
57
+ return _innerOnLoad.apply(this, arguments);
58
+ }
59
+
60
+ innerOnLoad();
61
+ }
62
+
63
+ function onClose() {
64
+ adaptor.localStorageSetItem(LOCAL_STORAGE_KEY, LOCAL_STORAGE_VALUE);
65
+ setOpen(false);
66
+ }
67
+ };
68
+
69
+ exports.Banner = Banner;
70
+ //# sourceMappingURL=Banner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Banner/Banner.tsx"],"names":["LOCAL_STORAGE_KEY","LOCAL_STORAGE_VALUE","Banner","adaptor","specs","isOpen","setOpen","onLoad","onClose","innerOnLoad","is40Stable","status","wasDismissed","localStorageGetItem","isExtension","localStorageSetItem"],"mappings":";;;;;;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/*\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 { ButtonOutline, Link, MessageBar } from '@looker/components'\nimport type { IEnvironmentAdaptor } from '@looker/extension-utils'\nimport type { SpecList } from '@looker/sdk-codegen'\nimport type { FC } from 'react'\nimport React, { useState, useEffect } from 'react'\n\nconst LOCAL_STORAGE_KEY = 'api-40-ga-apix-banner'\nconst LOCAL_STORAGE_VALUE = 'dismissed'\n\nexport interface BannerProps {\n adaptor: IEnvironmentAdaptor\n specs: SpecList\n}\n\nexport const Banner: FC<BannerProps> = ({ adaptor, specs }) => {\n const [isOpen, setOpen] = useState(false)\n useEffect(onLoad, [])\n\n if (isOpen) {\n return (\n <MessageBar\n intent=\"inform\"\n onPrimaryClick={onClose}\n secondaryAction={\n <Link\n href=\"https://developers.looker.com/api/advanced-usage/version-4-ga\"\n target=\"_blank\"\n >\n <ButtonOutline size=\"small\">Announcement</ButtonOutline>\n </Link>\n }\n >\n API 4.0 moves from Beta to General Availability in Looker 22.4 with\n additions and possible breaking changes. Read the announcement to see\n how this affects you.\n </MessageBar>\n )\n } else {\n return null\n }\n\n function onLoad() {\n // Following best practice with inner async function\n // https://github.com/facebook/react/issues/14326\n async function innerOnLoad() {\n // 4.0 is stable in Looker 22.4+. 4.0 is default or `current` in 22.4+.\n // Still check for `stable` just in case new version comes along.\n const is40Stable =\n specs['4.0'].status === 'stable' || specs['4.0'].status === 'current'\n const wasDismissed =\n (await adaptor.localStorageGetItem(LOCAL_STORAGE_KEY)) ===\n LOCAL_STORAGE_VALUE\n setOpen(!is40Stable && !wasDismissed && adaptor.isExtension())\n }\n innerOnLoad()\n }\n\n function onClose() {\n adaptor.localStorageSetItem(LOCAL_STORAGE_KEY, LOCAL_STORAGE_VALUE)\n setOpen(false)\n }\n}\n"],"file":"Banner.js"}
@@ -0,0 +1 @@
1
+ export { Banner } from './Banner';
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Banner", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _Banner.Banner;
10
+ }
11
+ });
12
+
13
+ var _Banner = require("./Banner");
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Banner/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAyBA","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 { Banner } from './Banner'\n"],"file":"index.js"}
@@ -13,11 +13,11 @@ var _codeEditor = require("@looker/code-editor");
13
13
 
14
14
  var _reactRedux = require("react-redux");
15
15
 
16
- var _utils = require("../../utils");
16
+ var _extensionUtils = require("@looker/extension-utils");
17
17
 
18
18
  var _state = require("../../state");
19
19
 
20
- var _utils2 = require("./utils");
20
+ var _utils = require("./utils");
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
@@ -35,8 +35,8 @@ var DocMarkdown = _ref => {
35
35
  } else if (url.startsWith("/".concat(specKey))) {
36
36
  history.push(url);
37
37
  } else if (url.startsWith('https://')) {
38
- var envAdaptor = (0, _utils.getEnvAdaptor)();
39
- envAdaptor.openBrowserWindow(url);
38
+ var adaptor = (0, _extensionUtils.getEnvAdaptor)();
39
+ adaptor.openBrowserWindow(url);
40
40
  }
41
41
  };
42
42
 
@@ -44,7 +44,7 @@ var DocMarkdown = _ref => {
44
44
  source: source,
45
45
  pattern: searchPattern,
46
46
  linkClickHandler: linkClickHandler,
47
- transformLinkUri: _utils2.transformURL.bind(null, specKey)
47
+ transformLinkUri: _utils.transformURL.bind(null, specKey)
48
48
  });
49
49
  };
50
50
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/DocMarkdown/DocMarkdown.tsx"],"names":["DocMarkdown","source","specKey","searchPattern","selectSearchPattern","history","linkClickHandler","pathname","url","startsWith","push","envAdaptor","openBrowserWindow","transformURL","bind"],"mappings":";;;;;;;AA2BA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAOO,IAAMA,WAAiC,GAAG,QAAyB;AAAA,MAAxB;AAAEC,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAAwB;AACxE,MAAMC,aAAa,GAAG,6BAAYC,0BAAZ,CAAtB;AACA,MAAMC,OAAO,GAAG,iCAAhB;;AAEA,MAAMC,gBAAgB,GAAG,CAACC,QAAD,EAAmBC,GAAnB,KAAmC;AAC1D,QAAID,QAAQ,CAACE,UAAT,YAAwBP,OAAxB,EAAJ,EAAwC;AACtCG,MAAAA,OAAO,CAACK,IAAR,CAAaH,QAAb;AACD,KAFD,MAEO,IAAIC,GAAG,CAACC,UAAJ,YAAmBP,OAAnB,EAAJ,EAAmC;AACxCG,MAAAA,OAAO,CAACK,IAAR,CAAaF,GAAb;AACD,KAFM,MAEA,IAAIA,GAAG,CAACC,UAAJ,CAAe,UAAf,CAAJ,EAAgC;AACrC,UAAME,UAAU,GAAG,2BAAnB;AACAA,MAAAA,UAAU,CAACC,iBAAX,CAA6BJ,GAA7B;AACD;AACF,GATD;;AAUA,SACE,6BAAC,oBAAD;AACE,IAAA,MAAM,EAAEP,MADV;AAEE,IAAA,OAAO,EAAEE,aAFX;AAGE,IAAA,gBAAgB,EAAEG,gBAHpB;AAIE,IAAA,gBAAgB,EAAEO,qBAAaC,IAAb,CAAkB,IAAlB,EAAwBZ,OAAxB;AAJpB,IADF;AAQD,CAtBM","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'\nimport { useHistory } from 'react-router-dom'\nimport { Markdown } from '@looker/code-editor'\nimport { useSelector } from 'react-redux'\nimport { getEnvAdaptor } from '../../utils'\nimport { selectSearchPattern } from '../../state'\nimport { transformURL } from './utils'\n\ninterface DocMarkdownProps {\n source: string\n specKey: string\n}\n\nexport const DocMarkdown: FC<DocMarkdownProps> = ({ source, specKey }) => {\n const searchPattern = useSelector(selectSearchPattern)\n const history = useHistory()\n\n const linkClickHandler = (pathname: string, url: string) => {\n if (pathname.startsWith(`/${specKey}`)) {\n history.push(pathname)\n } else if (url.startsWith(`/${specKey}`)) {\n history.push(url)\n } else if (url.startsWith('https://')) {\n const envAdaptor = getEnvAdaptor()\n envAdaptor.openBrowserWindow(url)\n }\n }\n return (\n <Markdown\n source={source}\n pattern={searchPattern}\n linkClickHandler={linkClickHandler}\n transformLinkUri={transformURL.bind(null, specKey)}\n />\n )\n}\n"],"file":"DocMarkdown.js"}
1
+ {"version":3,"sources":["../../../src/components/DocMarkdown/DocMarkdown.tsx"],"names":["DocMarkdown","source","specKey","searchPattern","selectSearchPattern","history","linkClickHandler","pathname","url","startsWith","push","adaptor","openBrowserWindow","transformURL","bind"],"mappings":";;;;;;;AA2BA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAOO,IAAMA,WAAiC,GAAG,QAAyB;AAAA,MAAxB;AAAEC,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAAwB;AACxE,MAAMC,aAAa,GAAG,6BAAYC,0BAAZ,CAAtB;AACA,MAAMC,OAAO,GAAG,iCAAhB;;AAEA,MAAMC,gBAAgB,GAAG,CAACC,QAAD,EAAmBC,GAAnB,KAAmC;AAC1D,QAAID,QAAQ,CAACE,UAAT,YAAwBP,OAAxB,EAAJ,EAAwC;AACtCG,MAAAA,OAAO,CAACK,IAAR,CAAaH,QAAb;AACD,KAFD,MAEO,IAAIC,GAAG,CAACC,UAAJ,YAAmBP,OAAnB,EAAJ,EAAmC;AACxCG,MAAAA,OAAO,CAACK,IAAR,CAAaF,GAAb;AACD,KAFM,MAEA,IAAIA,GAAG,CAACC,UAAJ,CAAe,UAAf,CAAJ,EAAgC;AACrC,UAAME,OAAO,GAAG,oCAAhB;AACAA,MAAAA,OAAO,CAACC,iBAAR,CAA0BJ,GAA1B;AACD;AACF,GATD;;AAUA,SACE,6BAAC,oBAAD;AACE,IAAA,MAAM,EAAEP,MADV;AAEE,IAAA,OAAO,EAAEE,aAFX;AAGE,IAAA,gBAAgB,EAAEG,gBAHpB;AAIE,IAAA,gBAAgB,EAAEO,oBAAaC,IAAb,CAAkB,IAAlB,EAAwBZ,OAAxB;AAJpB,IADF;AAQD,CAtBM","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'\nimport { useHistory } from 'react-router-dom'\nimport { Markdown } from '@looker/code-editor'\nimport { useSelector } from 'react-redux'\nimport { getEnvAdaptor } from '@looker/extension-utils'\nimport { selectSearchPattern } from '../../state'\nimport { transformURL } from './utils'\n\ninterface DocMarkdownProps {\n source: string\n specKey: string\n}\n\nexport const DocMarkdown: FC<DocMarkdownProps> = ({ source, specKey }) => {\n const searchPattern = useSelector(selectSearchPattern)\n const history = useHistory()\n\n const linkClickHandler = (pathname: string, url: string) => {\n if (pathname.startsWith(`/${specKey}`)) {\n history.push(pathname)\n } else if (url.startsWith(`/${specKey}`)) {\n history.push(url)\n } else if (url.startsWith('https://')) {\n const adaptor = getEnvAdaptor()\n adaptor.openBrowserWindow(url)\n }\n }\n return (\n <Markdown\n source={source}\n pattern={searchPattern}\n linkClickHandler={linkClickHandler}\n transformLinkUri={transformURL.bind(null, specKey)}\n />\n )\n}\n"],"file":"DocMarkdown.js"}
@@ -9,14 +9,14 @@ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _reactRedux = require("react-redux");
11
11
 
12
- var _sdkCodegen = require("@looker/sdk-codegen");
13
-
14
12
  var _runIt = require("@looker/run-it");
15
13
 
16
14
  var _DocCode = require("../DocCode");
17
15
 
18
16
  var _state = require("../../state");
19
17
 
18
+ var _path = require("../../utils/path");
19
+
20
20
  var _utils = require("./utils");
21
21
 
22
22
  var _DocDeclarations = require("./DocDeclarations");
@@ -31,7 +31,7 @@ var getDeclarations = (generators, sdkLanguage, item) => {
31
31
  var [language, gen] = _ref;
32
32
 
33
33
  if (sdkLanguage === 'All' || language === sdkLanguage) {
34
- var code = item instanceof _sdkCodegen.Method ? gen.declareMethod('', item) : gen.declareType('', item);
34
+ var code = (0, _path.isMethod)(item) ? gen.declareMethod('', item) : gen.declareType('', item);
35
35
  declarations[language] = code;
36
36
  }
37
37
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/DocSDKs/DocSDKs.tsx"],"names":["getDeclarations","generators","sdkLanguage","item","declarations","Object","entries","forEach","language","gen","code","Method","declareMethod","declareType","DocSDKs","api","method","type","selectSdkLanguage","setItem","setDeclarations","header","setHeader","languages","keys","length","values"],"mappings":";;;;;;;AA2BA;;AACA;;AAQA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;AAWA,IAAMA,eAAe,GAAG,CACtBC,UADsB,EAEtBC,WAFsB,EAGtBC,IAHsB,KAInB;AACH,MAAMC,YAAqC,GAAG,EAA9C;AACAC,EAAAA,MAAM,CAACC,OAAP,CAAeL,UAAf,EAA2BM,OAA3B,CAAmC,QAAqB;AAAA,QAApB,CAACC,QAAD,EAAWC,GAAX,CAAoB;;AACtD,QAAIP,WAAW,KAAK,KAAhB,IAAyBM,QAAQ,KAAKN,WAA1C,EAAuD;AACrD,UAAMQ,IAAI,GACRP,IAAI,YAAYQ,kBAAhB,GACIF,GAAG,CAACG,aAAJ,CAAkB,EAAlB,EAAsBT,IAAtB,CADJ,GAEIM,GAAG,CAACI,WAAJ,CAAgB,EAAhB,EAAoBV,IAApB,CAHN;AAIAC,MAAAA,YAAY,CAACI,QAAD,CAAZ,GAAyBE,IAAzB;AACD;AACF,GARD;AASA,SAAON,YAAP;AACD,CAhBD;;AAqBO,IAAMU,OAA6B,GAAG,SAA2B;AAAA,MAA1B;AAAEC,IAAAA,GAAF;AAAOC,IAAAA,MAAP;AAAeC,IAAAA;AAAf,GAA0B;AACtE,MAAMf,WAAW,GAAG,6BAAYgB,wBAAZ,CAApB;AACA,MAAMjB,UAAU,GAAG,0BAAcc,GAAd,CAAn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,CAActB,YAAd,EAA4B,CAA5B;AAFR,IAJJ,CADF;AAYD,CApCM","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 { Method } from '@looker/sdk-codegen'\nimport { CollapserCard, getGenerators } from '@looker/run-it'\n\nimport { DocCode } from '../DocCode'\nimport { selectSdkLanguage } from '../../state'\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 =\n item instanceof Method\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"],"file":"DocSDKs.js"}
1
+ {"version":3,"sources":["../../../src/components/DocSDKs/DocSDKs.tsx"],"names":["getDeclarations","generators","sdkLanguage","item","declarations","Object","entries","forEach","language","gen","code","declareMethod","declareType","DocSDKs","api","method","type","selectSdkLanguage","setItem","setDeclarations","header","setHeader","languages","keys","length","values"],"mappings":";;;;;;;AA2BA;;AACA;;AAQA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;AAWA,IAAMA,eAAe,GAAG,CACtBC,UADsB,EAEtBC,WAFsB,EAGtBC,IAHsB,KAInB;AACH,MAAMC,YAAqC,GAAG,EAA9C;AACAC,EAAAA,MAAM,CAACC,OAAP,CAAeL,UAAf,EAA2BM,OAA3B,CAAmC,QAA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lB;;AACA,QAAIkB,SAAS,CAACE,MAAV,GAAmB,CAAvB,EAA0B;AACxBH,MAAAA,SAAS,CAAC,cAAD,CAAT;AACD,KAFD,MAEO;AACLA,MAAAA,SAAS,WAAIC,SAAS,CAAC,CAAD,CAAb,kBAAT;AACD;AACF,GATD,EASG,CAACpB,WAAD,EAAcC,IAAd,CATH;AAWA,SACE,6BAAC,oBAAD;AAAe,IAAA,OAAO,EAAEiB,MAAxB;AAAgC,IAAA,EAAE,EAAC;AAAnC,KACGf,MAAM,CAACkB,IAAP,CAAYnB,YAAZ,EAA0BoB,MAA1B,GAAmC,CAAnC,GACC,6BAAC,gCAAD;AAAiB,IAAA,YAAY,EAAEpB;AAA/B,IADD,GAGC,6BAAC,gBAAD;AACE,IAAA,QAAQ,EAAEC,MAAM,CAACkB,IAAP,CAAYnB,YAAZ,EAA0B,CAA1B,CADZ;AAEE,IAAA,IAAI,EAAEC,MAAM,CAACoB,MAAP,CAAcrB,YAAd,EAA4B,CAA5B;AAFR,IAJJ,CADF;AAYD,CApCM","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"],"file":"DocSDKs.js"}
@@ -19,8 +19,6 @@ var _reactRedux = require("react-redux");
19
19
 
20
20
  var _state = require("../../state");
21
21
 
22
- var _context = require("../../context");
23
-
24
22
  var _utils = require("./utils");
25
23
 
26
24
  var _DocSdkExampleCell = require("./DocSdkExampleCell");
@@ -33,15 +31,14 @@ var DocSdkUsage = _ref => {
33
31
  var {
34
32
  method
35
33
  } = _ref;
36
- var {
37
- examples
38
- } = (0, _react.useContext)(_context.LodeContext);
34
+ var examples = (0, _reactRedux.useSelector)(_state.selectExamplesLode);
39
35
  var sdkLanguage = (0, _reactRedux.useSelector)(_state.selectSdkLanguage);
40
- var languages = (0, _sdkCodegen.findExampleLanguages)(examples, method.name);
41
36
  var [page, setPage] = (0, _react.useState)(1);
42
37
  (0, _react.useEffect)(() => {
43
38
  setPage(1);
44
39
  }, [method]);
40
+ if (!examples) return _react.default.createElement(_react.default.Fragment, null);
41
+ var languages = (0, _sdkCodegen.findExampleLanguages)(examples, method.name);
45
42
  if (languages.length === 0) return _react.default.createElement(_react.default.Fragment, null);
46
43
  languages = (0, _utils.sortLanguagesByPreference)(languages, sdkLanguage);
47
44
  var {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/DocSdkUsage/DocSdkUsage.tsx"],"names":["DocSdkUsage","method","examples","LodeContext","sdkLanguage","selectSdkLanguage","languages","name","page","setPage","length","pageExamples","pageLimit","paginate","operationId","exampleColumns","map","exampleRow","i","isEmptyItem","filename","EMPTY_STRING","isLastItem","PER_PAGE_COUNT","nextItemEmpty","hidden","permalink","language","description","line","nextPage"],"mappings":";;;;;;;AA0BA;;AACA;;AAWA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAOA;;;;;;AAUO,IAAMA,WAAiC,GAAG,QAAgB;A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AQ,EAAGkB,QAAD,IAAc;AACtBrB,MAAAA,OAAO,CAACqB,QAAD,CAAP;AACD;AALH,IADF,CA7CJ,CADF,CADF;AA4DD,CAnFM","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, { useContext, 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 } from '../../state'\nimport { LodeContext } from '../../context'\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 } = useContext(LodeContext)\n const sdkLanguage = useSelector(selectSdkLanguage)\n let languages = findExampleLanguages(examples, method.name)\n const [page, setPage] = useState(1)\n\n useEffect(() => {\n setPage(1)\n }, [method])\n\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"],"file":"DocSdkUsage.js"}
1
+ {"version":3,"sources":["../../../src/components/DocSdkUsage/DocSdkUsage.tsx"],"names":["DocSdkUsage","method","examples","selectExamplesLode","sdkLanguage","selectSdkLanguage","page","setPage","languages","name","length","pageExamples","pageLimit","paginate","operationId","exampleColumns","map","exampleRow","i","isEmptyItem","filename","EMPTY_STRING","isLastItem","PER_PAGE_COUNT","nextItemEmpty","hidden","permalink","language","description","line","nextPage"],"mappings":";;;;;;;AA0BA;;AACA;;AAWA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAOA;;;;;;AAUO,IAAMA,WAAiC,GAAG,QAAgB;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AAC/D,MAAMC,QAAQ,GAAG,6BAAYC,yBAAZ,CAAjB;AACA,MAAMC,WAAW,GAAG,6BAAYC,wBAAZ,CAApB;AACA,MAAM,CAACC,IAAD,EAAOC,OAAP,IAAkB,qBAAS,CAAT,CAAxB;AAEA,wBAAU,MAAM;AACdA,IAAAA,OAAO,CAAC,CAAD,CAAP;AACD,GAFD,EAEG,CAACN,MAAD,CAFH;AAIA,MAAI,CAACC,QAAL,EAAe,OAAO,2DAAP;AACf,MAAIM,SAAS,GAAG,sCAAqBN,QAArB,EAA+BD,MAAM,CAACQ,IAAtC,CAAhB;AACA,MAAID,SAAS,CAACE,MAAV,KAAqB,CAAzB,EAA4B,OAAO,2DAAP;AAE5BF,EAAAA,SAAS,GAAG,sCAA0BA,SAA1B,EAAqCJ,WAArC,CAAZ;AAEA,MAAM;AAAEO,IAAAA,YAAF;AAAgBC,IAAAA,SAAhB;AAA2BC,IAAAA;AAA3B,MAAwC,oCAC5CL,SAD4C,EAE5CN,QAF4C,EAG5CD,MAAM,CAACa,WAHqC,EAI5CR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F,UAAU,CAACS,SADnB;AAEE,MAAA,MAAM,EAAE,QAFV;AAGE,MAAA,IAAI,EAAC;AAHP,OAKGT,UAAU,CAACG,QALd,CARF,CADF,CAJF,EAsBE,6BAAC,oCAAD;AAAmB,MAAA,gBAAgB,EAAEK;AAArC,OACGR,UAAU,CAACU,QADd,CAtBF,EAyBE,6BAAC,oCAAD;AAAmB,MAAA,gBAAgB,EAAEF;AAArC,OACGR,UAAU,CAACW,WADd,CAzBF,EA4BE,6BAAC,oCAAD;AAAmB,MAAA,gBAAgB,EAAEH;AAArC,OACGR,UAAU,CAACY,IADd,CA5BF,CADF;AAkCD,GAxCA,CADH,CADF,EA4CGhB,QAAQ,IACP,6BAAC,eAAD;AAAK,IAAA,SAAS,EAAC;AAAf,KACE,6BAAC,sBAAD;AACE,IAAA,OAAO,EAAEP,IADX;AAEE,IAAA,KAAK,EAAEM,SAFT;AAGE,IAAA,QAAQ,EAAGkB,QAAD,IAAc;AACtBvB,MAAAA,OAAO,CAACuB,QAAD,CAAP;AACD;AALH,IADF,CA7CJ,CADF,CADF;AA4DD,CApFM","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"],"file":"DocSdkUsage.js"}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.DocSource = void 0;
7
7
 
8
- var _react = _interopRequireWildcard(require("react"));
8
+ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _sdkCodegen = require("@looker/sdk-codegen");
11
11
 
@@ -13,20 +13,18 @@ var _components = require("@looker/components");
13
13
 
14
14
  var _icons = require("@looker/icons");
15
15
 
16
- var _context = require("../../context");
16
+ var _reactRedux = require("react-redux");
17
17
 
18
- 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); }
18
+ var _state = require("../../state");
19
19
 
20
- 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; }
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
22
22
  var DocSource = _ref => {
23
23
  var {
24
24
  method,
25
25
  type
26
26
  } = _ref;
27
- var {
28
- declarations
29
- } = (0, _react.useContext)(_context.LodeContext);
27
+ var declarations = (0, _reactRedux.useSelector)(_state.selectDeclarationsLode);
30
28
  var sourceLink;
31
29
  var declaration;
32
30
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/DocSource/DocSource.tsx"],"names":["DocSource","method","type","declarations","LodeContext","sourceLink","declaration","link","id","name","sourceFile","line"],"mappings":";;;;;;;AA0BA;;AAEA;;AACA;;AACA;;AAEA;;;;;;AAOO,IAAMA,SAA6B,GAAG,QAAsB;AAAA,MAArB;AAAEC,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAAqB;AACjE,MAAM;AAAEC,IAAAA;AAAF,MAAmB,uBAAWC,oBAAX,CAAzB;AACA,MAAIC,UAAJ;AACA,MAAIC,WAAJ;;AACA,MAAIH,YAAJ,EAAkB;AAChB;AAAC,KAAC;AAAEG,MAAAA,WAAF;AAAeC,MAAAA,IAAI,EAAEF;AAArB,QAAoC,iCACpCF,YADoC,EAEpCF,MAFoC,aAEpCA,MAFoC,uBAEpCA,MAAM,CAAEO,EAF4B,EAGpCN,IAHoC,aAGpCA,IAHoC,uBAGpCA,IAAI,CAAEO,IAH8B,CAArC;AAKF;;AAED,SACE,4DACGJ,UAAU,IAAIC,WAAd,IACC,6BAAC,mBAAD;AACE,IAAA,OAAO,YAAKA,WAAW,CAACI,UAAjB,eAAgCJ,WAAW,CAACK,IAA5C,CADT;AAEE,IAAA,KAAK,EAAC;AAFR,KAIE,6BAAC,gBAAD;AAAM,IAAA,IAAI,EAAEN,UAAZ;AAAwB,IAAA,MAAM,EAAC;AAA/B,KACE,6BAAC,gBAAD;AAAM,IAAA,IAAI,EAAE,6BAAC,sBAAD;AAAZ,IADF,CAJF,CAFJ,CADF;AAcD,CA1BM","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, { useContext } from 'react'\nimport type { IMethod, IType } from '@looker/sdk-codegen'\nimport { findDeclaration } from '@looker/sdk-codegen'\nimport { Icon, Link, Tooltip } from '@looker/components'\nimport { IdeFileDocument } from '@looker/icons'\n\nimport { LodeContext } from '../../context'\n\ninterface DocSourceProps {\n method?: IMethod\n type?: IType\n}\n\nexport const DocSource: FC<DocSourceProps> = ({ method, type }) => {\n const { declarations } = useContext(LodeContext)\n let sourceLink\n let declaration\n if (declarations) {\n ;({ declaration, link: sourceLink } = findDeclaration(\n declarations,\n method?.id,\n type?.name\n ))\n }\n\n return (\n <>\n {sourceLink && declaration && (\n <Tooltip\n content={`${declaration.sourceFile}#L${declaration.line}`}\n width=\"none\"\n >\n <Link href={sourceLink} target=\"_blank\">\n <Icon icon={<IdeFileDocument />} />\n </Link>\n </Tooltip>\n )}\n </>\n )\n}\n"],"file":"DocSource.js"}
1
+ {"version":3,"sources":["../../../src/components/DocSource/DocSource.tsx"],"names":["DocSource","method","type","declarations","selectDeclarationsLode","sourceLink","declaration","link","id","name","sourceFile","line"],"mappings":";;;;;;;AA0BA;;AAEA;;AACA;;AACA;;AACA;;AAEA;;;;AAOO,IAAMA,SAA6B,GAAG,QAAsB;AAAA,MAArB;AAAEC,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAAqB;AACjE,MAAMC,YAAY,GAAG,6BAAYC,6BAAZ,CAArB;AACA,MAAIC,UAAJ;AACA,MAAIC,WAAJ;;AACA,MAAIH,YAAJ,EAAkB;AAChB;AAAC,KAAC;AAAEG,MAAAA,WAAF;AAAeC,MAAAA,IAAI,EAAEF;AAArB,QAAoC,iCACpCF,YADoC,EAEpCF,MAFoC,aAEpCA,MAFoC,uBAEpCA,MAAM,CAAEO,EAF4B,EAGpCN,IAHoC,aAGpCA,IAHoC,uBAGpCA,IAAI,CAAEO,IAH8B,CAArC;AAKF;;AAED,SACE,4DACGJ,UAAU,IAAIC,WAAd,IACC,6BAAC,mBAAD;AACE,IAAA,OAAO,YAAKA,WAAW,CAACI,UAAjB,eAAgCJ,WAAW,CAACK,IAA5C,CADT;AAEE,IAAA,KAAK,EAAC;AAFR,KAIE,6BAAC,gBAAD;AAAM,IAAA,IAAI,EAAEN,UAAZ;AAAwB,IAAA,MAAM,EAAC;AAA/B,KACE,6BAAC,gBAAD;AAAM,IAAA,IAAI,EAAE,6BAAC,sBAAD;AAAZ,IADF,CAJF,CAFJ,CADF;AAcD,CA1BM","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 from 'react'\nimport type { IMethod, IType } from '@looker/sdk-codegen'\nimport { findDeclaration } from '@looker/sdk-codegen'\nimport { Icon, Link, Tooltip } from '@looker/components'\nimport { IdeFileDocument } from '@looker/icons'\nimport { useSelector } from 'react-redux'\n\nimport { selectDeclarationsLode } from '../../state'\n\ninterface DocSourceProps {\n method?: IMethod\n type?: IType\n}\n\nexport const DocSource: FC<DocSourceProps> = ({ method, type }) => {\n const declarations = useSelector(selectDeclarationsLode)\n let sourceLink\n let declaration\n if (declarations) {\n ;({ declaration, link: sourceLink } = findDeclaration(\n declarations,\n method?.id,\n type?.name\n ))\n }\n\n return (\n <>\n {sourceLink && declaration && (\n <Tooltip\n content={`${declaration.sourceFile}#L${declaration.line}`}\n width=\"none\"\n >\n <Link href={sourceLink} target=\"_blank\">\n <Icon icon={<IdeFileDocument />} />\n </Link>\n </Tooltip>\n )}\n </>\n )\n}\n"],"file":"DocSource.js"}
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  interface SomethingWentWrongGraphicProps {
3
3
  altText?: string;
4
4
  }
5
- export declare const SomethingWentWrongGraphic: React.FC<SomethingWentWrongGraphicProps>;
5
+ export declare const SomethingWentWrongGraphic: React.NamedExoticComponent<SomethingWentWrongGraphicProps>;
6
6
  export {};