@looker/api-explorer 0.9.21 → 0.9.26
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.
- package/CHANGELOG.md +101 -0
- package/lib/ApiExplorer.d.ts +4 -39
- package/lib/ApiExplorer.js +23 -30
- package/lib/ApiExplorer.js.map +1 -1
- package/lib/App.d.ts +1 -0
- package/lib/App.js +29 -0
- package/lib/App.js.map +1 -0
- package/lib/StandaloneApiExplorer.js +8 -13
- package/lib/StandaloneApiExplorer.js.map +1 -1
- package/lib/components/DocCode/DocCode.js +6 -10
- package/lib/components/DocCode/DocCode.js.map +1 -1
- package/lib/components/DocMarkdown/DocMarkdown.js +11 -15
- package/lib/components/DocMarkdown/DocMarkdown.js.map +1 -1
- package/lib/components/DocReferences/DocReferences.js +7 -11
- package/lib/components/DocReferences/DocReferences.js.map +1 -1
- package/lib/components/DocSdkUsage/DocSdkUsage.js +3 -6
- package/lib/components/DocSdkUsage/DocSdkUsage.js.map +1 -1
- package/lib/components/DocSource/DocSource.js +5 -7
- package/lib/components/DocSource/DocSource.js.map +1 -1
- package/lib/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.d.ts +1 -1
- package/lib/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.js +152 -8
- package/lib/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.js.map +1 -1
- package/lib/components/SelectorContainer/SdkLanguageSelector.js +1 -1
- package/lib/components/SelectorContainer/SdkLanguageSelector.js.map +1 -1
- package/lib/components/SideNav/SideNav.js +39 -26
- package/lib/components/SideNav/SideNav.js.map +1 -1
- package/lib/components/SideNav/SideNavMethods.js +7 -9
- package/lib/components/SideNav/SideNavMethods.js.map +1 -1
- package/lib/components/SideNav/SideNavTypes.js +6 -8
- package/lib/components/SideNav/SideNavTypes.js.map +1 -1
- package/lib/components/SideNav/searchUtils.d.ts +1 -1
- package/lib/components/SideNav/searchUtils.js +1 -1
- package/lib/components/SideNav/searchUtils.js.map +1 -1
- package/lib/components/common/Loader.d.ts +1 -1
- package/lib/components/common/Loader.js.map +1 -1
- package/lib/esm/ApiExplorer.js +26 -33
- package/lib/esm/ApiExplorer.js.map +1 -1
- package/lib/esm/App.js +19 -0
- package/lib/esm/App.js.map +1 -0
- package/lib/esm/StandaloneApiExplorer.js +7 -10
- package/lib/esm/StandaloneApiExplorer.js.map +1 -1
- package/lib/esm/components/DocCode/DocCode.js +5 -8
- package/lib/esm/components/DocCode/DocCode.js.map +1 -1
- package/lib/esm/components/DocMarkdown/DocMarkdown.js +8 -11
- package/lib/esm/components/DocMarkdown/DocMarkdown.js.map +1 -1
- package/lib/esm/components/DocReferences/DocReferences.js +5 -8
- package/lib/esm/components/DocReferences/DocReferences.js.map +1 -1
- package/lib/esm/components/DocSdkUsage/DocSdkUsage.js +5 -7
- package/lib/esm/components/DocSdkUsage/DocSdkUsage.js.map +1 -1
- package/lib/esm/components/DocSource/DocSource.js +4 -5
- package/lib/esm/components/DocSource/DocSource.js.map +1 -1
- package/lib/esm/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.js +153 -6
- package/lib/esm/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.js.map +1 -1
- package/lib/esm/components/SelectorContainer/SdkLanguageSelector.js +2 -2
- package/lib/esm/components/SelectorContainer/SdkLanguageSelector.js.map +1 -1
- package/lib/esm/components/SideNav/SideNav.js +40 -27
- package/lib/esm/components/SideNav/SideNav.js.map +1 -1
- package/lib/esm/components/SideNav/SideNavMethods.js +7 -10
- package/lib/esm/components/SideNav/SideNavMethods.js.map +1 -1
- package/lib/esm/components/SideNav/SideNavTypes.js +6 -9
- package/lib/esm/components/SideNav/SideNavTypes.js.map +1 -1
- package/lib/esm/components/SideNav/searchUtils.js +1 -1
- package/lib/esm/components/SideNav/searchUtils.js.map +1 -1
- package/lib/esm/components/common/Loader.js.map +1 -1
- package/lib/esm/index.js +4 -18
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/reducers/index.js +0 -1
- package/lib/esm/reducers/index.js.map +1 -1
- package/lib/esm/routes/AppRouter.js +2 -2
- package/lib/esm/routes/AppRouter.js.map +1 -1
- package/lib/esm/scenes/MethodScene/MethodScene.js +9 -11
- package/lib/esm/scenes/MethodScene/MethodScene.js.map +1 -1
- package/lib/esm/state/index.js +1 -0
- package/lib/esm/state/index.js.map +1 -1
- package/lib/esm/state/lodes/index.js +3 -0
- package/lib/{test-utils/envAdaptor.js.map → esm/state/lodes/index.js.map} +1 -1
- package/lib/esm/state/lodes/sagas.js +25 -0
- package/lib/esm/state/lodes/sagas.js.map +1 -0
- package/lib/esm/state/lodes/selectors.js +5 -0
- package/lib/esm/state/lodes/selectors.js.map +1 -0
- package/lib/esm/state/lodes/slice.js +30 -0
- package/lib/esm/state/lodes/slice.js.map +1 -0
- package/lib/esm/state/settings/sagas.js +28 -16
- package/lib/esm/state/settings/sagas.js.map +1 -1
- package/lib/esm/state/settings/selectors.js +5 -3
- package/lib/esm/state/settings/selectors.js.map +1 -1
- package/lib/esm/state/settings/slice.js +16 -9
- package/lib/esm/state/settings/slice.js.map +1 -1
- package/lib/esm/state/store.js +6 -3
- package/lib/esm/state/store.js.map +1 -1
- package/lib/esm/test-utils/index.js +2 -4
- package/lib/esm/test-utils/index.js.map +1 -1
- package/lib/esm/test-utils/lodes.js +12 -0
- package/lib/esm/test-utils/lodes.js.map +1 -0
- package/lib/esm/test-utils/redux.js +12 -9
- package/lib/esm/test-utils/redux.js.map +1 -1
- package/lib/esm/utils/index.js +0 -1
- package/lib/esm/utils/index.js.map +1 -1
- package/lib/esm/utils/lodeUtils.js +3 -7
- package/lib/esm/utils/lodeUtils.js.map +1 -1
- package/lib/index.d.ts +4 -1
- package/lib/index.js +52 -23
- package/lib/index.js.map +1 -1
- package/lib/reducers/index.d.ts +0 -1
- package/lib/reducers/index.js +0 -13
- package/lib/reducers/index.js.map +1 -1
- package/lib/routes/AppRouter.d.ts +2 -2
- package/lib/routes/AppRouter.js +2 -2
- package/lib/routes/AppRouter.js.map +1 -1
- package/lib/scenes/MethodScene/MethodScene.d.ts +2 -2
- package/lib/scenes/MethodScene/MethodScene.js +7 -9
- package/lib/scenes/MethodScene/MethodScene.js.map +1 -1
- package/lib/state/index.d.ts +1 -0
- package/lib/state/index.js +13 -0
- package/lib/state/index.js.map +1 -1
- package/lib/state/lodes/index.d.ts +2 -0
- package/lib/{reducers/search → state/lodes}/index.js +8 -8
- package/lib/state/lodes/index.js.map +1 -0
- package/lib/state/lodes/sagas.d.ts +1 -0
- package/lib/state/lodes/sagas.js +34 -0
- package/lib/state/lodes/sagas.js.map +1 -0
- package/lib/state/lodes/selectors.d.ts +3 -0
- package/lib/state/lodes/selectors.js +17 -0
- package/lib/state/lodes/selectors.js.map +1 -0
- package/lib/state/lodes/slice.d.ts +29 -0
- package/lib/state/lodes/slice.js +45 -0
- package/lib/state/lodes/slice.js.map +1 -0
- package/lib/state/settings/sagas.js +28 -15
- package/lib/state/settings/sagas.js.map +1 -1
- package/lib/state/settings/selectors.d.ts +2 -0
- package/lib/state/settings/selectors.js +12 -4
- package/lib/state/settings/selectors.js.map +1 -1
- package/lib/state/settings/slice.d.ts +24 -16
- package/lib/state/settings/slice.js +22 -14
- package/lib/state/settings/slice.js.map +1 -1
- package/lib/state/store.d.ts +3 -0
- package/lib/state/store.js +6 -2
- package/lib/state/store.js.map +1 -1
- package/lib/test-data/declarations.js +24 -0
- package/lib/test-data/declarations.js.map +1 -0
- package/lib/test-data/index.js +23 -0
- package/lib/test-data/index.js.map +1 -1
- package/lib/test-utils/index.d.ts +2 -4
- package/lib/test-utils/index.js +22 -56
- package/lib/test-utils/index.js.map +1 -1
- package/lib/test-utils/lodes.d.ts +4 -0
- package/lib/test-utils/lodes.js +23 -0
- package/lib/test-utils/lodes.js.map +1 -0
- package/lib/test-utils/redux.d.ts +9 -3
- package/lib/test-utils/redux.js +14 -10
- package/lib/test-utils/redux.js.map +1 -1
- package/lib/utils/index.d.ts +0 -1
- package/lib/utils/index.js +0 -24
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/lodeUtils.d.ts +2 -2
- package/lib/utils/lodeUtils.js +3 -7
- package/lib/utils/lodeUtils.js.map +1 -1
- package/package.json +11 -10
- package/public/Looker.3.1.json +1343 -412
- package/public/Looker.4.0.json +3305 -661
- package/src/ApiExplorer.tsx +100 -119
- package/src/{index.tsx → App.tsx} +0 -0
- package/src/StandaloneApiExplorer.tsx +8 -16
- package/src/components/DocCode/DocCode.tsx +6 -6
- package/src/components/DocMarkdown/DocMarkdown.spec.tsx +16 -11
- package/src/components/DocMarkdown/DocMarkdown.tsx +8 -10
- package/src/components/DocReferences/DocReferences.spec.tsx +11 -4
- package/src/components/DocReferences/DocReferences.tsx +8 -9
- package/src/components/DocSdkUsage/DocSdkUsage.spec.tsx +2 -2
- package/src/components/DocSdkUsage/DocSdkUsage.tsx +5 -5
- package/src/components/DocSource/DocSource.tsx +4 -3
- package/src/components/ErrorBoundary/components/SomethingWentWrong/SomethingWentWrong.spec.tsx +1 -1
- package/src/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.tsx +170 -6
- package/src/components/ExploreType/ExploreProperty.spec.tsx +7 -12
- package/src/components/ExploreType/ExploreType.spec.tsx +9 -27
- package/src/components/Header/Header.spec.tsx +30 -38
- package/src/components/SelectorContainer/ApiSpecSelector.spec.tsx +2 -2
- package/src/components/SelectorContainer/SdkLanguageSelector.spec.tsx +3 -5
- package/src/components/SelectorContainer/SdkLanguageSelector.tsx +2 -2
- package/src/components/SelectorContainer/SelectorContainer.spec.tsx +20 -26
- package/src/components/SideNav/SideNav.spec.tsx +24 -29
- package/src/components/SideNav/SideNav.tsx +45 -24
- package/src/components/SideNav/SideNavMethodTags.spec.tsx +8 -6
- package/src/components/SideNav/SideNavMethods.spec.tsx +9 -5
- package/src/components/SideNav/SideNavMethods.tsx +8 -8
- package/src/components/SideNav/SideNavTypeTags.spec.tsx +8 -6
- package/src/components/SideNav/SideNavTypes.spec.tsx +9 -4
- package/src/components/SideNav/SideNavTypes.tsx +7 -7
- package/src/components/SideNav/{searchUtils.tsx → searchUtils.ts} +2 -2
- package/src/components/common/Loader.tsx +1 -1
- package/src/{context/lode/index.ts → index.ts} +4 -1
- package/src/reducers/index.ts +0 -1
- package/src/routes/AppRouter.tsx +5 -4
- package/src/scenes/MethodScene/MethodScene.tsx +11 -11
- package/src/scenes/TypeTagScene/TypeTagScene.spec.tsx +4 -4
- package/src/state/index.ts +1 -0
- package/src/{reducers/search → state/lodes}/index.ts +2 -2
- package/src/state/lodes/sagas.spec.ts +92 -0
- package/src/state/lodes/sagas.ts +51 -0
- package/src/{context/search/SearchContext.ts → state/lodes/selectors.spec.ts} +13 -15
- package/src/{test-utils/envAdaptor.ts → state/lodes/selectors.ts} +8 -5
- package/src/{test-utils/render_with_lode.tsx → state/lodes/slice.ts} +37 -37
- package/src/state/settings/sagas.spec.ts +29 -24
- package/src/state/settings/sagas.ts +16 -16
- package/src/state/settings/selectors.spec.ts +1 -5
- package/src/state/settings/selectors.ts +9 -3
- package/src/state/settings/slice.ts +27 -10
- package/src/state/store.ts +7 -2
- package/src/{reducers/search/actions.ts → test-data/declarations.ts} +16 -15
- package/src/test-data/index.ts +1 -0
- package/src/test-utils/index.ts +2 -10
- package/src/{context/lode/LodeContext.ts → test-utils/lodes.tsx} +14 -13
- package/src/test-utils/redux.tsx +29 -10
- package/src/utils/index.ts +0 -1
- package/src/utils/lodeUtils.ts +4 -6
- package/webpack.dev.config.js +3 -0
- package/webpack.prod.config.js +4 -0
- package/lib/components/SideNav/SearchCriteriaSelector.d.ts +0 -2
- package/lib/components/SideNav/SearchCriteriaSelector.js +0 -57
- package/lib/components/SideNav/SearchCriteriaSelector.js.map +0 -1
- package/lib/context/index.d.ts +0 -2
- package/lib/context/index.js +0 -34
- package/lib/context/index.js.map +0 -1
- package/lib/context/lode/LodeContext.d.ts +0 -9
- package/lib/context/lode/LodeContext.js +0 -21
- package/lib/context/lode/LodeContext.js.map +0 -1
- package/lib/context/lode/index.d.ts +0 -1
- package/lib/context/lode/index.js +0 -20
- package/lib/context/lode/index.js.map +0 -1
- package/lib/context/search/SearchContext.d.ts +0 -9
- package/lib/context/search/SearchContext.js +0 -19
- package/lib/context/search/SearchContext.js.map +0 -1
- package/lib/context/search/index.d.ts +0 -1
- package/lib/context/search/index.js +0 -20
- package/lib/context/search/index.js.map +0 -1
- package/lib/esm/components/SideNav/SearchCriteriaSelector.js +0 -38
- package/lib/esm/components/SideNav/SearchCriteriaSelector.js.map +0 -1
- package/lib/esm/context/index.js +0 -3
- package/lib/esm/context/index.js.map +0 -1
- package/lib/esm/context/lode/LodeContext.js +0 -11
- package/lib/esm/context/lode/LodeContext.js.map +0 -1
- package/lib/esm/context/lode/index.js +0 -2
- package/lib/esm/context/lode/index.js.map +0 -1
- package/lib/esm/context/search/SearchContext.js +0 -8
- package/lib/esm/context/search/SearchContext.js.map +0 -1
- package/lib/esm/context/search/index.js +0 -2
- package/lib/esm/context/search/index.js.map +0 -1
- package/lib/esm/reducers/search/actions.js +0 -13
- package/lib/esm/reducers/search/actions.js.map +0 -1
- package/lib/esm/reducers/search/index.js +0 -3
- package/lib/esm/reducers/search/index.js.map +0 -1
- package/lib/esm/reducers/search/reducer.js +0 -31
- package/lib/esm/reducers/search/reducer.js.map +0 -1
- package/lib/esm/test-utils/envAdaptor.js +0 -5
- package/lib/esm/test-utils/envAdaptor.js.map +0 -1
- package/lib/esm/test-utils/render_with_lode.js +0 -19
- package/lib/esm/test-utils/render_with_lode.js.map +0 -1
- package/lib/esm/test-utils/render_with_search.js +0 -34
- package/lib/esm/test-utils/render_with_search.js.map +0 -1
- package/lib/esm/utils/envAdaptor.js +0 -84
- package/lib/esm/utils/envAdaptor.js.map +0 -1
- package/lib/reducers/search/actions.d.ts +0 -4
- package/lib/reducers/search/actions.js +0 -25
- package/lib/reducers/search/actions.js.map +0 -1
- package/lib/reducers/search/index.d.ts +0 -2
- package/lib/reducers/search/index.js.map +0 -1
- package/lib/reducers/search/reducer.d.ts +0 -11
- package/lib/reducers/search/reducer.js +0 -43
- package/lib/reducers/search/reducer.js.map +0 -1
- package/lib/test-utils/envAdaptor.d.ts +0 -2
- package/lib/test-utils/envAdaptor.js +0 -15
- package/lib/test-utils/render_with_lode.d.ts +0 -7
- package/lib/test-utils/render_with_lode.js +0 -36
- package/lib/test-utils/render_with_lode.js.map +0 -1
- package/lib/test-utils/render_with_search.d.ts +0 -4
- package/lib/test-utils/render_with_search.js +0 -52
- package/lib/test-utils/render_with_search.js.map +0 -1
- package/lib/utils/envAdaptor.d.ts +0 -31
- package/lib/utils/envAdaptor.js +0 -106
- package/lib/utils/envAdaptor.js.map +0 -1
- package/src/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/somethingWentWrong.svg +0 -45
- package/src/components/SideNav/SearchCriteriaSelector.tsx +0 -76
- package/src/context/index.ts +0 -27
- package/src/context/search/index.ts +0 -26
- package/src/reducers/search/actions.spec.ts +0 -50
- package/src/reducers/search/reducer.spec.ts +0 -69
- package/src/reducers/search/reducer.ts +0 -63
- package/src/test-utils/render_with_search.tsx +0 -71
- package/src/utils/envAdaptor.spec.ts +0 -50
- package/src/utils/envAdaptor.ts +0 -147
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/SideNav/SideNavMethods.tsx"],"names":["React","
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/SideNav/SideNavMethods.tsx"],"names":["React","useEffect","useState","styled","Accordion2","Heading","useSelector","useHistory","useRouteMatch","Link","buildMethodPath","highlightHTML","selectSearchPattern","SideNavMethods","className","methods","tag","specKey","defaultOpen","searchPattern","match","isOpen","setIsOpen","history","handleOpen","_isOpen","push","status","params","methodTag","Object","values","map","method","name","summary","theme","fonts","brand","colors","key","fontWeights","semiBold","ui2","space","xxsmall","ui1","radii","medium","xsmall"],"mappings":"AA0BA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,QAA3B,QAA2C,OAA3C;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,SAASC,UAAT,EAAqBC,OAArB,QAAoC,oBAApC;AAEA,SAASC,WAAT,QAA4B,aAA5B;AACA,SAASC,UAAT,EAAqBC,aAArB,QAA0C,kBAA1C;AAEA,SAASC,IAAT,QAAqB,SAArB;AACA,SAASC,eAAT,EAA0BC,aAA1B,QAA+C,aAA/C;AACA,SAASC,mBAAT,QAAoC,aAApC;AAUA,OAAO,IAAMC,cAAc,GAAGV,MAAM,CAClC,QAA6E;AAAA,MAA5E;AAAEW,IAAAA,SAAF;AAAaC,IAAAA,OAAb;AAAsBC,IAAAA,GAAtB;AAA2BC,IAAAA,OAA3B;AAAoCC,IAAAA,WAAW,GAAG;AAAlD,GAA4E;AAC3E,MAAMC,aAAa,GAAGb,WAAW,CAACM,mBAAD,CAAjC;AACA,MAAMQ,KAAK,GAAGZ,aAAa,6CAA3B;AAGA,MAAM,CAACa,MAAD,EAASC,SAAT,IAAsBpB,QAAQ,CAACgB,WAAD,CAApC;AACA,MAAMK,OAAO,GAAGhB,UAAU,EAA1B;;AAEA,MAAMiB,UAAU,GAAG,MAAM;AACvB,QAAMC,OAAO,GAAG,CAACJ,MAAjB;;AACAC,IAAAA,SAAS,CAACG,OAAD,CAAT;AACA,QAAIA,OAAJ,EAAaF,OAAO,CAACG,IAAR,YAAiBT,OAAjB,sBAAoCD,GAApC;AACd,GAJD;;AAMAf,EAAAA,SAAS,CAAC,MAAM;AACd,QAAM0B,MAAM,GAAGP,KAAK,GAChBF,WAAW,IAAIE,KAAK,CAACQ,MAAN,CAAaC,SAAb,KAA2Bb,GAD1B,GAEhBE,WAFJ;AAGAI,IAAAA,SAAS,CAACK,MAAD,CAAT;AACD,GALQ,EAKN,CAACT,WAAD,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AlEO,EAmER;AAAA,MAAC;AAAET,IAAAA;AAAF,GAAD;AAAA,SAAeA,KAAK,CAACQ,KAAN,CAAYC,OAA3B;AAAA,CAnEQ,EAuET;AAAA,MAAC;AAAET,IAAAA;AAAF,GAAD;AAAA,SAAeA,KAAK,CAACG,MAAN,CAAaO,GAA5B;AAAA,CAvES,EAwER;AAAA,MAAC;AAAEV,IAAAA;AAAF,GAAD;AAAA,SAAeA,KAAK,CAACK,WAAN,CAAkBC,QAAjC;AAAA,CAxEQ,EA2EvBjC,IA3EuB,EA4EN;AAAA,MAAC;AAAE2B,IAAAA;AAAF,GAAD;AAAA,SAAeA,KAAK,CAACW,KAAN,CAAYC,MAA3B;AAAA,CA5EM,EA+EZ;AAAA,MAAC;AAAEZ,IAAAA;AAAF,GAAD;AAAA,SAAeA,KAAK,CAACQ,KAAN,CAAYK,MAA3B;AAAA,CA/EY,EAsFP;AAAA,MAAC;AAAEb,IAAAA;AAAF,GAAD;AAAA,SAAeA,KAAK,CAACG,MAAN,CAAaO,GAA5B;AAAA,CAtFO,CAApB","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 React, { useEffect, useState } from 'react'\nimport styled from 'styled-components'\nimport { Accordion2, Heading } from '@looker/components'\nimport type { MethodList } from '@looker/sdk-codegen'\nimport { useSelector } from 'react-redux'\nimport { useHistory, useRouteMatch } from 'react-router-dom'\n\nimport { Link } from '../Link'\nimport { buildMethodPath, highlightHTML } from '../../utils'\nimport { selectSearchPattern } from '../../state'\n\ninterface MethodsProps {\n methods: MethodList\n tag: string\n specKey: string\n className?: string\n defaultOpen?: boolean\n}\n\nexport const SideNavMethods = styled(\n ({ className, methods, tag, specKey, defaultOpen = false }: MethodsProps) => {\n const searchPattern = useSelector(selectSearchPattern)\n const match = useRouteMatch<{ methodTag: string }>(\n `/:specKey/methods/:methodTag/:methodName?`\n )\n const [isOpen, setIsOpen] = useState(defaultOpen)\n const history = useHistory()\n\n const handleOpen = () => {\n const _isOpen = !isOpen\n setIsOpen(_isOpen)\n if (_isOpen) history.push(`/${specKey}/methods/${tag}`)\n }\n\n useEffect(() => {\n const status = match\n ? defaultOpen || match.params.methodTag === tag\n : defaultOpen\n setIsOpen(status)\n }, [defaultOpen, match, tag])\n\n /* TODO: Fix highlighting. It is applied but it is somehow being overridden */\n return (\n <Accordion2\n isOpen={isOpen}\n toggleOpen={handleOpen}\n className={className}\n label={\n <Heading as=\"h4\" fontSize=\"small\" py=\"xsmall\">\n {highlightHTML(searchPattern, tag)}\n </Heading>\n }\n >\n <ul>\n {Object.values(methods).map((method) => (\n <li key={method.name}>\n <Link to={`${buildMethodPath(specKey, tag, method.name)}`}>\n {highlightHTML(searchPattern, method.summary)}\n </Link>\n </li>\n ))}\n </ul>\n </Accordion2>\n )\n }\n)`\n font-family: ${({ theme }) => theme.fonts.brand};\n\n [aria-controls]:hover,\n [aria-expanded='true'] {\n h4,\n svg {\n color: ${({ theme }) => theme.colors.key};\n }\n }\n\n [aria-expanded='true'] h4 {\n font-weight: ${({ theme }) => theme.fontWeights.semiBold};\n }\n\n ul {\n border-left: dashed 1px ${({ theme }) => theme.colors.ui2};\n list-style: none;\n margin: 0;\n padding: 0;\n padding-left: ${({ theme }) => theme.space.xxsmall};\n padding-top: ${({ theme }) => theme.space.xxsmall};\n }\n\n [aria-current] {\n background: ${({ theme }) => theme.colors.ui1};\n font-weight: ${({ theme }) => theme.fontWeights.semiBold};\n }\n\n ${Link} {\n border-radius: ${({ theme }) => theme.radii.medium};\n display: block;\n overflow: hidden;\n padding: ${({ theme }) => theme.space.xsmall};\n text-overflow: ellipsis;\n white-space: nowrap;\n\n &:hover,\n &:focus,\n &.active {\n background: ${({ theme }) => theme.colors.ui1};\n }\n }\n`\n"],"file":"SideNavMethods.js"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { Accordion2, Heading } from '@looker/components';
|
|
4
4
|
import { useHistory, useRouteMatch } from 'react-router-dom';
|
|
5
|
+
import { useSelector } from 'react-redux';
|
|
5
6
|
import { Link } from '../Link';
|
|
6
7
|
import { buildTypePath, highlightHTML } from '../../utils';
|
|
7
|
-
import {
|
|
8
|
+
import { selectSearchPattern } from '../../state';
|
|
8
9
|
export var SideNavTypes = styled(_ref => {
|
|
9
10
|
var {
|
|
10
11
|
className,
|
|
@@ -13,11 +14,7 @@ export var SideNavTypes = styled(_ref => {
|
|
|
13
14
|
specKey,
|
|
14
15
|
defaultOpen = false
|
|
15
16
|
} = _ref;
|
|
16
|
-
var
|
|
17
|
-
searchSettings: {
|
|
18
|
-
pattern
|
|
19
|
-
}
|
|
20
|
-
} = useContext(SearchContext);
|
|
17
|
+
var searchPattern = useSelector(selectSearchPattern);
|
|
21
18
|
var match = useRouteMatch("/:specKey/types/:typeTag/:typeName?");
|
|
22
19
|
var [isOpen, setIsOpen] = useState(defaultOpen);
|
|
23
20
|
var history = useHistory();
|
|
@@ -41,12 +38,12 @@ export var SideNavTypes = styled(_ref => {
|
|
|
41
38
|
as: "h4",
|
|
42
39
|
fontSize: "small",
|
|
43
40
|
py: "xsmall"
|
|
44
|
-
}, highlightHTML(
|
|
41
|
+
}, highlightHTML(searchPattern, tag))
|
|
45
42
|
}, React.createElement("ul", null, Object.values(types).map(type => React.createElement("li", {
|
|
46
43
|
key: type.name
|
|
47
44
|
}, React.createElement(Link, {
|
|
48
45
|
to: "".concat(buildTypePath(specKey, tag, type.name))
|
|
49
|
-
}, highlightHTML(
|
|
46
|
+
}, highlightHTML(searchPattern, type.name))))));
|
|
50
47
|
}).withConfig({
|
|
51
48
|
displayName: "SideNavTypes",
|
|
52
49
|
componentId: "vqik31-0"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/SideNav/SideNavTypes.tsx"],"names":["React","
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/SideNav/SideNavTypes.tsx"],"names":["React","useEffect","useState","styled","Accordion2","Heading","useHistory","useRouteMatch","useSelector","Link","buildTypePath","highlightHTML","selectSearchPattern","SideNavTypes","className","types","tag","specKey","defaultOpen","searchPattern","match","isOpen","setIsOpen","history","handleOpen","_isOpen","push","status","params","typeTag","Object","values","map","type","name","theme","fonts","brand","colors","key","fontWeights","semiBold","ui2","space","xxsmall","ui1","radii","medium","xsmall"],"mappings":"AA0BA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,QAA3B,QAA2C,OAA3C;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,SAASC,UAAT,EAAqBC,OAArB,QAAoC,oBAApC;AAEA,SAASC,UAAT,EAAqBC,aAArB,QAA0C,kBAA1C;AACA,SAASC,WAAT,QAA4B,aAA5B;AAEA,SAASC,IAAT,QAAqB,SAArB;AACA,SAASC,aAAT,EAAwBC,aAAxB,QAA6C,aAA7C;AACA,SAASC,mBAAT,QAAoC,aAApC;AAUA,OAAO,I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AAAEZ,IAAAA;AAAF,GAAD;AAAA,SAAeA,KAAK,CAACQ,KAAN,CAAYK,MAA3B;AAAA,CA/EU,EAsFL;AAAA,MAAC;AAAEb,IAAAA;AAAF,GAAD;AAAA,SAAeA,KAAK,CAACG,MAAN,CAAaO,GAA5B;AAAA,CAtFK,CAAlB","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 React, { useEffect, useState } from 'react'\nimport styled from 'styled-components'\nimport { Accordion2, Heading } from '@looker/components'\nimport type { TypeList } from '@looker/sdk-codegen'\nimport { useHistory, useRouteMatch } from 'react-router-dom'\nimport { useSelector } from 'react-redux'\n\nimport { Link } from '../Link'\nimport { buildTypePath, highlightHTML } from '../../utils'\nimport { selectSearchPattern } from '../../state'\n\ninterface TypesProps {\n types: TypeList\n tag: string\n specKey: string\n className?: string\n defaultOpen?: boolean\n}\n\nexport const SideNavTypes = styled(\n ({ className, types, tag, specKey, defaultOpen = false }: TypesProps) => {\n const searchPattern = useSelector(selectSearchPattern)\n const match = useRouteMatch<{ typeTag: string }>(\n `/:specKey/types/:typeTag/:typeName?`\n )\n const [isOpen, setIsOpen] = useState(defaultOpen)\n const history = useHistory()\n\n const handleOpen = () => {\n const _isOpen = !isOpen\n setIsOpen(_isOpen)\n if (_isOpen) history.push(`/${specKey}/types/${tag}`)\n }\n\n useEffect(() => {\n const status = match\n ? defaultOpen || match.params.typeTag === tag\n : defaultOpen\n setIsOpen(status)\n }, [defaultOpen])\n\n /* TODO: Fix highlighting. It is applied but it is somehow being overridden */\n return (\n <Accordion2\n isOpen={isOpen}\n toggleOpen={handleOpen}\n className={className}\n label={\n <Heading as=\"h4\" fontSize=\"small\" py=\"xsmall\">\n {highlightHTML(searchPattern, tag)}\n </Heading>\n }\n >\n <ul>\n {Object.values(types).map((type) => (\n <li key={type.name}>\n <Link to={`${buildTypePath(specKey, tag, type.name)}`}>\n {highlightHTML(searchPattern, type.name)}\n </Link>\n </li>\n ))}\n </ul>\n </Accordion2>\n )\n }\n)`\n font-family: ${({ theme }) => theme.fonts.brand};\n\n [aria-controls]:hover,\n [aria-expanded='true'] {\n h4,\n svg {\n color: ${({ theme }) => theme.colors.key};\n }\n }\n\n [aria-expanded='true'] h4 {\n font-weight: ${({ theme }) => theme.fontWeights.semiBold};\n }\n\n ul {\n border-left: dashed 1px ${({ theme }) => theme.colors.ui2};\n list-style: none;\n margin: 0;\n padding: 0;\n padding-left: ${({ theme }) => theme.space.xxsmall};\n padding-top: ${({ theme }) => theme.space.xxsmall};\n }\n\n [aria-current] {\n background: ${({ theme }) => theme.colors.ui1};\n font-weight: ${({ theme }) => theme.fontWeights.semiBold};\n }\n\n ${Link} {\n border-radius: ${({ theme }) => theme.radii.medium};\n display: block;\n overflow: hidden;\n padding: ${({ theme }) => theme.space.xsmall};\n text-overflow: ellipsis;\n white-space: nowrap;\n\n &:hover,\n &:focus,\n &.active {\n background: ${({ theme }) => theme.colors.ui1};\n }\n }\n`\n"],"file":"SideNavTypes.js"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
2
|
export var useDebounce = (value, delay) => {
|
|
3
|
-
var [debouncedValue, setDebouncedValue] = useState();
|
|
3
|
+
var [debouncedValue, setDebouncedValue] = useState(value);
|
|
4
4
|
useEffect(() => {
|
|
5
5
|
var handler = setTimeout(() => {
|
|
6
6
|
setDebouncedValue(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/SideNav/searchUtils.
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/SideNav/searchUtils.ts"],"names":["useState","useEffect","useDebounce","value","delay","debouncedValue","setDebouncedValue","handler","setTimeout","clearTimeout","countMethods","tags","result","Object","values","forEach","methods","entries","length","countTypes","types"],"mappings":"AA0BA,SAASA,QAAT,EAAmBC,SAAnB,QAAoC,OAApC;AAGA,OAAO,IAAMC,WAAW,GAAG,CAAIC,KAAJ,EAAcC,KAAd,KAAmC;AAC5D,MAAM,CAACC,cAAD,EAAiBC,iBAAjB,IAAsCN,QAAQ,CAACG,KAAD,CAApD;AACAF,EAAAA,SAAS,CAAC,MAAM;AAEd,QAAMM,OAAO,GAAGC,UAAU,CAAC,MAAM;AAC/BF,MAAAA,iBAAiB,CAACH,KAAD,CAAjB;AACD,KAFyB,EAEvBC,KAFuB,CAA1B;AAIA,WAAO,MAAM;AACXK,MAAAA,YAAY,CAACF,OAAD,CAAZ;AACD,KAFD;AAGD,GATQ,EASN,CAACJ,KAAD,CATM,CAAT;AAUA,SAAOE,cAAP;AACD,CAbM;AAeP,OAAO,IAAMK,YAAY,GAAIC,IAAD,IAAmB;AAC7C,MAAIC,MAAM,GAAG,CAAb;AACAC,EAAAA,MAAM,CAACC,MAAP,CAAcH,IAAd,EAAoBI,OAApB,CAA6BC,OAAD,IAAa;AACvCJ,IAAAA,MAAM,IAAIC,MAAM,CAACI,OAAP,CAAeD,OAAf,EAAwBE,MAAlC;AACD,GAFD;AAGA,SAAON,MAAP;AACD,CANM;AAQP,OAAO,IAAMO,UAAU,GAAIC,KAAD,IAAqBP,MAAM,CAACI,OAAP,CAAeG,KAAf,EAAsBF,MAA9D","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 { useState, useEffect } from 'react'\nimport type { TagList, TypeList } from '@looker/sdk-codegen'\n\nexport const useDebounce = <T>(value: T, delay: number): T => {\n const [debouncedValue, setDebouncedValue] = useState(value)\n useEffect(() => {\n // Update debounced value only once delay has been elapsed\n const handler = setTimeout(() => {\n setDebouncedValue(value)\n }, delay)\n // Reset the timeout on receiving a new keyword\n return () => {\n clearTimeout(handler)\n }\n }, [value])\n return debouncedValue\n}\n\nexport const countMethods = (tags: TagList) => {\n let result = 0\n Object.values(tags).forEach((methods) => {\n result += Object.entries(methods).length\n })\n return result\n}\n\nexport const countTypes = (types: TypeList) => Object.entries(types).length\n"],"file":"searchUtils.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/common/Loader.tsx"],"names":["React","ComponentsProvider","Flex","FlexItem","Heading","ProgressCircular","Loader","themeOverrides","message"],"mappings":"AA0BA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SACEC,kBADF,EAEEC,IAFF,EAGEC,QAHF,EAIEC,OAJF,EAKEC,gBALF,QAMO,oBANP;AAcA,OAAO,IAAMC,MAAuB,GAAG;AAAA,MAAC;AACtCC,IAAAA,cADsC;AAEtCC,IAAAA,OAAO,GAAG;AAF4B,GAAD;AAAA,SAIrC,oBAAC,kBAAD,EAAwBD,cAAxB,EACE,oBAAC,IAAD;AAAM,IAAA,aAAa,EAAC,QAApB;AAA6B,IAAA,cAAc,EAAC,QAA5C;AAAqD,IAAA,EAAE,EAAC;AAAxD,KACE,oBAAC,QAAD;AAAU,IAAA,SAAS,EAAC;AAApB,KACE,oBAAC,gBAAD;AAAkB,IAAA,IAAI,EAAC;AAAvB,IADF,CADF,EAIE,oBAAC,QAAD;AAAU,IAAA,EAAE,EAAC,OAAb;AAAqB,IAAA,SAAS,EAAC;AAA/B,KACE,oBAAC,OAAD;AAAS,IAAA,KAAK,EAAC,KAAf;AAAqB,IAAA,EAAE,EAAC;AAAxB,KACGC,OADH,CADF,CAJF,CADF,CAJqC;AAAA,CAAhC","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 {\n ComponentsProvider,\n Flex,\n FlexItem,\n Heading,\n ProgressCircular,\n} from '@looker/components'\nimport type { ThemeOverrides } from '
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/common/Loader.tsx"],"names":["React","ComponentsProvider","Flex","FlexItem","Heading","ProgressCircular","Loader","themeOverrides","message"],"mappings":"AA0BA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SACEC,kBADF,EAEEC,IAFF,EAGEC,QAHF,EAIEC,OAJF,EAKEC,gBALF,QAMO,oBANP;AAcA,OAAO,IAAMC,MAAuB,GAAG;AAAA,MAAC;AACtCC,IAAAA,cADsC;AAEtCC,IAAAA,OAAO,GAAG;AAF4B,GAAD;AAAA,SAIrC,oBAAC,kBAAD,EAAwBD,cAAxB,EACE,oBAAC,IAAD;AAAM,IAAA,aAAa,EAAC,QAApB;AAA6B,IAAA,cAAc,EAAC,QAA5C;AAAqD,IAAA,EAAE,EAAC;AAAxD,KACE,oBAAC,QAAD;AAAU,IAAA,SAAS,EAAC;AAApB,KACE,oBAAC,gBAAD;AAAkB,IAAA,IAAI,EAAC;AAAvB,IADF,CADF,EAIE,oBAAC,QAAD;AAAU,IAAA,EAAE,EAAC,OAAb;AAAqB,IAAA,SAAS,EAAC;AAA/B,KACE,oBAAC,OAAD;AAAS,IAAA,KAAK,EAAC,KAAf;AAAqB,IAAA,EAAE,EAAC;AAAxB,KACGC,OADH,CADF,CAJF,CADF,CAJqC;AAAA,CAAhC","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 {\n ComponentsProvider,\n Flex,\n FlexItem,\n Heading,\n ProgressCircular,\n} from '@looker/components'\nimport type { ThemeOverrides } from '@looker/extension-utils'\n\nexport interface LoaderProps {\n themeOverrides: ThemeOverrides\n message?: string\n}\n\nexport const Loader: FC<LoaderProps> = ({\n themeOverrides,\n message = 'Loading API Specifications',\n}) => (\n <ComponentsProvider {...themeOverrides}>\n <Flex flexDirection=\"column\" justifyContent=\"center\" mt=\"25%\">\n <FlexItem alignSelf=\"center\">\n <ProgressCircular size=\"large\" />\n </FlexItem>\n <FlexItem mt=\"large\" alignSelf=\"center\">\n <Heading color=\"key\" as=\"h2\">\n {message}\n </Heading>\n </FlexItem>\n </Flex>\n </ComponentsProvider>\n)\n"],"file":"Loader.js"}
|
package/lib/esm/index.js
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { BrowserRouter as Router } from 'react-router-dom';
|
|
7
|
-
import ReactDOM from 'react-dom';
|
|
8
|
-
import { createGlobalStyle } from 'styled-components';
|
|
9
|
-
import { StandaloneApiExplorer } from './StandaloneApiExplorer';
|
|
10
|
-
var BodyReset = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n body {\n margin: 0;\n }\n"])));
|
|
11
|
-
var basename = window.LOOKER_DEV_PORTAL ? window.LOOKER_DEV_PORTAL.basename : undefined;
|
|
12
|
-
var versionsUrl = new URL('versions.json', window.location.origin).toString();
|
|
13
|
-
ReactDOM.render(React.createElement(Router, {
|
|
14
|
-
basename: basename
|
|
15
|
-
}, React.createElement(StandaloneApiExplorer, {
|
|
16
|
-
versionsUrl: versionsUrl,
|
|
17
|
-
headless: !!basename
|
|
18
|
-
}), React.createElement(BodyReset, null)), document.getElementById('container'));
|
|
1
|
+
export * from './ApiExplorer';
|
|
2
|
+
export * from './StandaloneApiExplorer';
|
|
3
|
+
export * from './components';
|
|
4
|
+
export * from './state';
|
|
19
5
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":"AAyBA,cAAc,eAAd;AACA,cAAc,yBAAd;AACA,cAAc,cAAd;AACA,cAAc,SAAd","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 * from './ApiExplorer'\nexport * from './StandaloneApiExplorer'\nexport * from './components'\nexport * from './state'\n"],"file":"index.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/reducers/index.ts"],"names":[],"mappings":"AAyBA,cAAc,QAAd
|
|
1
|
+
{"version":3,"sources":["../../../src/reducers/index.ts"],"names":[],"mappings":"AAyBA,cAAc,QAAd","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 * from './spec'\n"],"file":"index.js"}
|
|
@@ -9,7 +9,7 @@ export var AppRouter = _ref => {
|
|
|
9
9
|
api,
|
|
10
10
|
specs,
|
|
11
11
|
toggleNavigation,
|
|
12
|
-
|
|
12
|
+
adaptor,
|
|
13
13
|
setVersionsUrl
|
|
14
14
|
} = _ref;
|
|
15
15
|
return React.createElement(Switch, null, React.createElement(Redirect, {
|
|
@@ -35,7 +35,7 @@ export var AppRouter = _ref => {
|
|
|
35
35
|
path: "/:specKey/methods/:methodTag/:methodName"
|
|
36
36
|
}, React.createElement(MethodScene, {
|
|
37
37
|
api: api,
|
|
38
|
-
|
|
38
|
+
adaptor: adaptor,
|
|
39
39
|
setVersionsUrl: setVersionsUrl
|
|
40
40
|
})), React.createElement(Route, {
|
|
41
41
|
path: "/:specKey/types/:typeTag",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/routes/AppRouter.tsx"],"names":["React","Redirect","Route","Switch","HomeScene","MethodScene","MethodTagScene","TypeScene","TypeTagScene","DiffScene","diffPath","AppRouter","specKey","api","specs","toggleNavigation","
|
|
1
|
+
{"version":3,"sources":["../../../src/routes/AppRouter.tsx"],"names":["React","Redirect","Route","Switch","HomeScene","MethodScene","MethodTagScene","TypeScene","TypeTagScene","DiffScene","diffPath","AppRouter","specKey","api","specs","toggleNavigation","adaptor","setVersionsUrl"],"mappings":"AA2BA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,QAAT,EAAmBC,KAAnB,EAA0BC,MAA1B,QAAwC,kBAAxC;AAKA,SACEC,SADF,EAEEC,WAFF,EAGEC,cAHF,EAIEC,SAJF,EAKEC,YALF,QAMO,WANP;AAOA,SAASC,SAAT,QAA0B,qBAA1B;AACA,SAASC,QAAT,QAAyB,UAAzB;AAWA,OAAO,IAAMC,SAA6B,GAAG,QAOvC;AAAA,MAPwC;AAC5CC,IAAAA,OAD4C;AAE5CC,IAAAA,GAF4C;AAG5CC,IAAAA,KAH4C;AAI5CC,IAAAA,gBAJ4C;AAK5CC,IAAAA,OAL4C;AAM5CC,IAAAA;AAN4C,GAOxC;AACJ,SACE,oBAAC,MAAD,QACE,oBAAC,QAAD;AAAU,IAAA,IAAI,EAAC,GAAf;AAAmB,IAAA,EAAE,aAAML,OAAN,MAArB;AAAuC,IAAA,KAAK;AAA5C,IADF,EAEE,oBAAC,KAAD;AAAO,IAAA,IAAI,aAAMF,QAAN;AAAX,KACE,oBAAC,SAAD;AAAW,IAAA,KAAK,EAAEI,KAAlB;AAAyB,IAAA,gBAAgB,EAAEC;AAA3C,IADF,CAFF,EAKE,oBAAC,KAAD;AAAO,IAAA,IAAI,EAAC,4BAAZ;AAAyC,IAAA,KAAK;AAA9C,KACE,oBAAC,SAAD;AAAW,IAAA,GAAG,EAAEF;AAAhB,IADF,CALF,EAQE,oBAAC,KAAD;AAAO,IAAA,IAAI,EAAC,8BAAZ;AAA2C,IAAA,KAAK;AAAhD,KACE,oBAAC,cAAD;AAAgB,IAAA,GAAG,EAAEA;AAArB,IADF,CARF,EAWE,oBAAC,KAAD;AAAO,IAAA,IAAI,EAAC;AAAZ,KACE,oBAAC,WAAD;AACE,IAAA,GAAG,EAAEA,GADP;AAEE,IAAA,OAAO,EAAEG,OAFX;AAGE,IAAA,cAAc,EAAEC;AAHlB,IADF,CAXF,EAkBE,oBAAC,KAAD;AAAO,IAAA,IAAI,EAAC,0BAAZ;AAAuC,IAAA,KAAK;AAA5C,KACE,oBAAC,YAAD;AAAc,IAAA,GAAG,EAAEJ;AAAnB,IADF,CAlBF,EAqBE,oBAAC,KAAD;AAAO,IAAA,IAAI,EAAC;AAAZ,KACE,oBAAC,SAAD;AAAW,IAAA,GAAG,EAAEA;AAAhB,IADF,CArBF,CADF;AA2BD,CAnCM","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 { Redirect, Route, Switch } from 'react-router-dom'\nimport type { ApiModel, SpecList } from '@looker/sdk-codegen'\nimport type { RunItSetter } from '@looker/run-it'\nimport type { IEnvironmentAdaptor } from '@looker/extension-utils'\n\nimport {\n HomeScene,\n MethodScene,\n MethodTagScene,\n TypeScene,\n TypeTagScene,\n} from '../scenes'\nimport { DiffScene } from '../scenes/DiffScene'\nimport { diffPath } from '../utils'\n\ninterface AppRouterProps {\n api: ApiModel\n specKey: string\n specs: SpecList\n toggleNavigation: (target?: boolean) => void\n adaptor: IEnvironmentAdaptor\n setVersionsUrl: RunItSetter\n}\n\nexport const AppRouter: FC<AppRouterProps> = ({\n specKey,\n api,\n specs,\n toggleNavigation,\n adaptor,\n setVersionsUrl,\n}) => {\n return (\n <Switch>\n <Redirect from=\"/\" to={`/${specKey}/`} exact />\n <Route path={`/${diffPath}/:l?/:r?`}>\n <DiffScene specs={specs} toggleNavigation={toggleNavigation} />\n </Route>\n <Route path=\"/:specKey/(methods|types)?\" exact>\n <HomeScene api={api} />\n </Route>\n <Route path=\"/:specKey/methods/:methodTag\" exact>\n <MethodTagScene api={api} />\n </Route>\n <Route path=\"/:specKey/methods/:methodTag/:methodName\">\n <MethodScene\n api={api}\n adaptor={adaptor}\n setVersionsUrl={setVersionsUrl}\n />\n </Route>\n <Route path=\"/:specKey/types/:typeTag\" exact>\n <TypeTagScene api={api} />\n </Route>\n <Route path=\"/:specKey/types/:typeTag/:typeName\">\n <TypeScene api={api} />\n </Route>\n </Switch>\n )\n}\n"],"file":"AppRouter.js"}
|
|
@@ -2,11 +2,11 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
2
2
|
|
|
3
3
|
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); }); }; }
|
|
4
4
|
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { useState, useEffect } from 'react';
|
|
6
6
|
import { Aside, Button, ButtonOutline, Space, useToggle, ExtendComponentsThemeProvider } from '@looker/components';
|
|
7
7
|
import { Beaker } from '@looker/icons';
|
|
8
8
|
import { useHistory, useParams } from 'react-router-dom';
|
|
9
|
-
import { RunIt,
|
|
9
|
+
import { RunIt, RunItFormKey } from '@looker/run-it';
|
|
10
10
|
import { typeRefs } from '@looker/sdk-codegen';
|
|
11
11
|
import { useSelector } from 'react-redux';
|
|
12
12
|
import { ApixSection, DocActivityType, DocMarkdown, DocRateLimited, DocReferences, DocResponses, DocSDKs, DocSdkUsage, DocSource, DocStatus, DocTitle, DocSchema } from '../../components';
|
|
@@ -14,8 +14,8 @@ import { selectSdkLanguage } from '../../state';
|
|
|
14
14
|
import { DocOperation, DocRequestBody } from './components';
|
|
15
15
|
|
|
16
16
|
var showRunIt = function () {
|
|
17
|
-
var _ref = _asyncToGenerator(function* (
|
|
18
|
-
var data = yield
|
|
17
|
+
var _ref = _asyncToGenerator(function* (adaptor) {
|
|
18
|
+
var data = yield adaptor.localStorageGetItem(RunItFormKey);
|
|
19
19
|
return !!data;
|
|
20
20
|
});
|
|
21
21
|
|
|
@@ -27,13 +27,10 @@ var showRunIt = function () {
|
|
|
27
27
|
export var MethodScene = _ref2 => {
|
|
28
28
|
var {
|
|
29
29
|
api,
|
|
30
|
-
|
|
30
|
+
adaptor,
|
|
31
31
|
setVersionsUrl
|
|
32
32
|
} = _ref2;
|
|
33
33
|
var history = useHistory();
|
|
34
|
-
var {
|
|
35
|
-
sdk
|
|
36
|
-
} = useContext(RunItContext);
|
|
37
34
|
var sdkLanguage = useSelector(selectSdkLanguage);
|
|
38
35
|
var {
|
|
39
36
|
specKey,
|
|
@@ -65,7 +62,7 @@ export var MethodScene = _ref2 => {
|
|
|
65
62
|
var checkRunIt = function () {
|
|
66
63
|
var _ref3 = _asyncToGenerator(function* () {
|
|
67
64
|
try {
|
|
68
|
-
var show = yield showRunIt(
|
|
65
|
+
var show = yield showRunIt(adaptor);
|
|
69
66
|
|
|
70
67
|
if (show) {
|
|
71
68
|
setOn();
|
|
@@ -81,7 +78,7 @@ export var MethodScene = _ref2 => {
|
|
|
81
78
|
}();
|
|
82
79
|
|
|
83
80
|
checkRunIt();
|
|
84
|
-
}, [
|
|
81
|
+
}, [adaptor, setOn]);
|
|
85
82
|
var runItToggle = React.createElement(RunItButton, {
|
|
86
83
|
color: value ? 'key' : 'neutral',
|
|
87
84
|
iconBefore: React.createElement(Beaker, null),
|
|
@@ -122,7 +119,7 @@ export var MethodScene = _ref2 => {
|
|
|
122
119
|
responses: method.responses
|
|
123
120
|
}), React.createElement(DocSchema, {
|
|
124
121
|
object: method.schema
|
|
125
|
-
})),
|
|
122
|
+
})), value && React.createElement(Aside, {
|
|
126
123
|
width: "50rem"
|
|
127
124
|
}, React.createElement(ExtendComponentsThemeProvider, {
|
|
128
125
|
themeCustomizations: {
|
|
@@ -135,6 +132,7 @@ export var MethodScene = _ref2 => {
|
|
|
135
132
|
}
|
|
136
133
|
}
|
|
137
134
|
}, React.createElement(RunIt, {
|
|
135
|
+
adaptor: adaptor,
|
|
138
136
|
key: method.operationId,
|
|
139
137
|
sdkLanguage: sdkLanguage,
|
|
140
138
|
api: api,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/scenes/MethodScene/MethodScene.tsx"],"names":["React","useContext","useState","useEffect","Aside","Button","ButtonOutline","Space","useToggle","ExtendComponentsThemeProvider","Beaker","useHistory","useParams","RunIt","RunItContext","RunItFormKey","typeRefs","useSelector","ApixSection","DocActivityType","DocMarkdown","DocRateLimited","DocReferences","DocResponses","DocSDKs","DocSdkUsage","DocSource","DocStatus","DocTitle","DocSchema","selectSdkLanguage","DocOperation","DocRequestBody","showRunIt","envAdaptor","data","localStorageGetItem","MethodScene","api","setVersionsUrl","history","sdk","sdkLanguage","specKey","methodTag","methodName","value","toggle","setOn","method","setMethod","methods","seeTypes","customTypes","RunItButton","foundMethod","tags","push","checkRunIt","show","error","console","runItToggle","summary","description","responses","schema","colors","background","key","text","link","critical","operationId"],"mappings":";;;;AA2BA,OAAOA,KAAP,IAAgBC,UAAhB,EAA4BC,QAA5B,EAAsCC,SAAtC,QAAuD,OAAvD;AACA,SACEC,KADF,EAEEC,MAFF,EAGEC,aAHF,EAIEC,KAJF,EAKEC,SALF,EAMEC,6BANF,QAOO,oBAPP;AAQA,SAASC,MAAT,QAAuB,eAAvB;AACA,SAASC,UAAT,EAAqBC,SAArB,QAAsC,kBAAtC;AAEA,SAASC,KAAT,EAAgBC,YAAhB,EAA8BC,YAA9B,QAAkD,gBAAlD;AAEA,SAASC,QAAT,QAAyB,qBAAzB;AACA,SAASC,WAAT,QAA4B,aAA5B;AAEA,SACEC,WADF,EAEEC,eAFF,EAGEC,WAHF,EAIEC,cAJF,EAKEC,aALF,EAMEC,YANF,EAOEC,OAPF,EAQEC,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SAJA;AAKNC,QAAAA,QAAQ,EAAE;AALJ;AADW;AADvB,KAWE,oBAAC,KAAD;AACE,IAAA,GAAG,EAAEvB,MAAM,CAACwB,WADd;AAEE,IAAA,WAAW,EAAE/B,WAFf;AAGE,IAAA,GAAG,EAAEJ,GAHP;AAIE,IAAA,MAAM,EAAEW,MAJV;AAKE,IAAA,cAAc,EAAEV;AALlB,IAXF,CADF,CA1BJ,CADF;AAmDD,CAzGM","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, { useContext, useState, useEffect } from 'react'\nimport {\n Aside,\n Button,\n ButtonOutline,\n Space,\n useToggle,\n ExtendComponentsThemeProvider,\n} from '@looker/components'\nimport { Beaker } from '@looker/icons'\nimport { useHistory, useParams } from 'react-router-dom'\nimport type { RunItSetter } from '@looker/run-it'\nimport { RunIt, RunItContext, RunItFormKey } from '@looker/run-it'\nimport type { ApiModel } from '@looker/sdk-codegen'\nimport { typeRefs } from '@looker/sdk-codegen'\nimport { useSelector } from 'react-redux'\n\nimport {\n ApixSection,\n DocActivityType,\n DocMarkdown,\n DocRateLimited,\n DocReferences,\n DocResponses,\n DocSDKs,\n DocSdkUsage,\n DocSource,\n DocStatus,\n DocTitle,\n DocSchema,\n} from '../../components'\nimport { selectSdkLanguage } from '../../state'\nimport type { IApixEnvAdaptor } from '../../utils'\nimport { DocOperation, DocRequestBody } from './components'\n\ninterface MethodSceneProps {\n api: ApiModel\n envAdaptor: IApixEnvAdaptor\n setVersionsUrl: RunItSetter\n}\n\ninterface MethodSceneParams {\n methodName: string\n methodTag: string\n specKey: string\n}\n\nconst showRunIt = async (envAdaptor: IApixEnvAdaptor) => {\n const data = await envAdaptor.localStorageGetItem(RunItFormKey)\n return !!data\n}\n\nexport const MethodScene: FC<MethodSceneProps> = ({\n api,\n envAdaptor,\n setVersionsUrl,\n}) => {\n const history = useHistory()\n const { sdk } = useContext(RunItContext)\n const sdkLanguage = useSelector(selectSdkLanguage)\n const { specKey, methodTag, methodName } = useParams<MethodSceneParams>()\n const { value, toggle, setOn } = useToggle()\n const [method, setMethod] = useState(api.methods[methodName])\n const seeTypes = typeRefs(api, method?.customTypes)\n\n const RunItButton = value ? Button : ButtonOutline\n\n useEffect(() => {\n const foundMethod = api.methods[methodName]\n if (foundMethod) {\n setMethod(api.methods[methodName])\n } else {\n // Invalid method\n if (api.tags[methodTag]) {\n // Found tag though\n history.push(`/${specKey}/methods/${methodTag}`)\n } else {\n history.push(`/${specKey}/methods`)\n }\n }\n }, [api, history, methodName, methodTag, specKey])\n\n useEffect(() => {\n const checkRunIt = async () => {\n try {\n const show = await showRunIt(envAdaptor)\n if (show) {\n setOn()\n }\n } catch (error) {\n console.error(error)\n }\n }\n checkRunIt()\n }, [envAdaptor, setOn])\n\n const runItToggle = (\n <RunItButton\n color={value ? 'key' : 'neutral'}\n iconBefore={<Beaker />}\n onClick={toggle}\n >\n Run It\n </RunItButton>\n )\n\n return (\n <>\n {method && (\n <ApixSection>\n <Space between>\n <Space>\n <DocTitle>{method.summary}</DocTitle>\n <DocSource method={method} />\n </Space>\n {runItToggle}\n </Space>\n <Space mb=\"large\" gap=\"small\">\n <DocStatus method={method} />\n <DocActivityType method={method} />\n <DocRateLimited method={method} />\n </Space>\n <DocOperation method={method} />\n <DocMarkdown source={method.description} specKey={specKey} />\n <DocSDKs api={api} method={method} />\n <DocRequestBody api={api} method={method} />\n <DocSdkUsage method={method} />\n <DocReferences typesUsed={seeTypes} api={api} specKey={specKey} />\n <DocResponses api={api} responses={method.responses} />\n <DocSchema object={method.schema} />\n </ApixSection>\n )}\n {sdk && value && (\n <Aside width=\"50rem\">\n <ExtendComponentsThemeProvider\n themeCustomizations={{\n colors: {\n background: '#262D33',\n key: '#8AB4F8',\n text: '#fff',\n link: '#8AB4F8',\n critical: '#FF877C',\n },\n }}\n >\n <RunIt\n key={method.operationId}\n sdkLanguage={sdkLanguage}\n api={api}\n method={method}\n setVersionsUrl={setVersionsUrl}\n />\n </ExtendComponentsThemeProvider>\n </Aside>\n )}\n </>\n )\n}\n"],"file":"MethodScene.js"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/scenes/MethodScene/MethodScene.tsx"],"names":["React","useState","useEffect","Aside","Button","ButtonOutline","Space","useToggle","ExtendComponentsThemeProvider","Beaker","useHistory","useParams","RunIt","RunItFormKey","typeRefs","useSelector","ApixSection","DocActivityType","DocMarkdown","DocRateLimited","DocReferences","DocResponses","DocSDKs","DocSdkUsage","DocSource","DocStatus","DocTitle","DocSchema","selectSdkLanguage","DocOperation","DocRequestBody","showRunIt","adaptor","data","localStorageGetItem","MethodScene","api","setVersionsUrl","history","sdkLanguage","specKey","methodTag","methodName","value","toggle","setOn","method","setMethod","methods","seeTypes","customTypes","RunItButton","foundMethod","tags","push","checkRunIt","show","error","console","runItToggle","summary","description","responses","schema","colors","background","key","text","link","critical","operationId"],"mappings":";;;;AA2BA,OAAOA,KAAP,IAAgBC,QAAhB,E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EAoBE,oBAAC,SAAD;AAAW,IAAA,MAAM,EAAEhB,MAAM,CAACiB;AAA1B,IApBF,CAFJ,EAyBGpB,KAAK,IACJ,oBAAC,KAAD;AAAO,IAAA,KAAK,EAAC;AAAb,KACE,oBAAC,6BAAD;AACE,IAAA,mBAAmB,EAAE;AACnBqB,MAAAA,MAAM,EAAE;AACNC,QAAAA,UAAU,EAAE,SADN;AAENC,QAAAA,GAAG,EAAE,SAFC;AAGNC,QAAAA,IAAI,EAAE,MAHA;AAINC,QAAAA,IAAI,EAAE,SAJA;AAKNC,QAAAA,QAAQ,EAAE;AALJ;AADW;AADvB,KAWE,oBAAC,KAAD;AACE,IAAA,OAAO,EAAErC,OADX;AAEE,IAAA,GAAG,EAAEc,MAAM,CAACwB,WAFd;AAGE,IAAA,WAAW,EAAE/B,WAHf;AAIE,IAAA,GAAG,EAAEH,GAJP;AAKE,IAAA,MAAM,EAAEU,MALV;AAME,IAAA,cAAc,EAAET;AANlB,IAXF,CADF,CA1BJ,CADF;AAoDD,CAzGM","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 {\n Aside,\n Button,\n ButtonOutline,\n Space,\n useToggle,\n ExtendComponentsThemeProvider,\n} from '@looker/components'\nimport { Beaker } from '@looker/icons'\nimport { useHistory, useParams } from 'react-router-dom'\nimport type { RunItSetter } from '@looker/run-it'\nimport { RunIt, RunItFormKey } from '@looker/run-it'\nimport type { ApiModel } from '@looker/sdk-codegen'\nimport { typeRefs } from '@looker/sdk-codegen'\nimport { useSelector } from 'react-redux'\n\nimport type { IEnvironmentAdaptor } from '@looker/extension-utils'\nimport {\n ApixSection,\n DocActivityType,\n DocMarkdown,\n DocRateLimited,\n DocReferences,\n DocResponses,\n DocSDKs,\n DocSdkUsage,\n DocSource,\n DocStatus,\n DocTitle,\n DocSchema,\n} from '../../components'\nimport { selectSdkLanguage } from '../../state'\nimport { DocOperation, DocRequestBody } from './components'\n\ninterface MethodSceneProps {\n api: ApiModel\n adaptor: IEnvironmentAdaptor\n setVersionsUrl: RunItSetter\n}\n\ninterface MethodSceneParams {\n methodName: string\n methodTag: string\n specKey: string\n}\n\nconst showRunIt = async (adaptor: IEnvironmentAdaptor) => {\n const data = await adaptor.localStorageGetItem(RunItFormKey)\n return !!data\n}\n\nexport const MethodScene: FC<MethodSceneProps> = ({\n api,\n adaptor,\n setVersionsUrl,\n}) => {\n const history = useHistory()\n const sdkLanguage = useSelector(selectSdkLanguage)\n const { specKey, methodTag, methodName } = useParams<MethodSceneParams>()\n const { value, toggle, setOn } = useToggle()\n const [method, setMethod] = useState(api.methods[methodName])\n const seeTypes = typeRefs(api, method?.customTypes)\n\n const RunItButton = value ? Button : ButtonOutline\n\n useEffect(() => {\n const foundMethod = api.methods[methodName]\n if (foundMethod) {\n setMethod(api.methods[methodName])\n } else {\n // Invalid method\n if (api.tags[methodTag]) {\n // Found tag though\n history.push(`/${specKey}/methods/${methodTag}`)\n } else {\n history.push(`/${specKey}/methods`)\n }\n }\n }, [api, history, methodName, methodTag, specKey])\n\n useEffect(() => {\n const checkRunIt = async () => {\n try {\n const show = await showRunIt(adaptor)\n if (show) {\n setOn()\n }\n } catch (error) {\n console.error(error)\n }\n }\n checkRunIt()\n }, [adaptor, setOn])\n\n const runItToggle = (\n <RunItButton\n color={value ? 'key' : 'neutral'}\n iconBefore={<Beaker />}\n onClick={toggle}\n >\n Run It\n </RunItButton>\n )\n\n return (\n <>\n {method && (\n <ApixSection>\n <Space between>\n <Space>\n <DocTitle>{method.summary}</DocTitle>\n <DocSource method={method} />\n </Space>\n {runItToggle}\n </Space>\n <Space mb=\"large\" gap=\"small\">\n <DocStatus method={method} />\n <DocActivityType method={method} />\n <DocRateLimited method={method} />\n </Space>\n <DocOperation method={method} />\n <DocMarkdown source={method.description} specKey={specKey} />\n <DocSDKs api={api} method={method} />\n <DocRequestBody api={api} method={method} />\n <DocSdkUsage method={method} />\n <DocReferences typesUsed={seeTypes} api={api} specKey={specKey} />\n <DocResponses api={api} responses={method.responses} />\n <DocSchema object={method.schema} />\n </ApixSection>\n )}\n {value && (\n <Aside width=\"50rem\">\n <ExtendComponentsThemeProvider\n themeCustomizations={{\n colors: {\n background: '#262D33',\n key: '#8AB4F8',\n text: '#fff',\n link: '#8AB4F8',\n critical: '#FF877C',\n },\n }}\n >\n <RunIt\n adaptor={adaptor}\n key={method.operationId}\n sdkLanguage={sdkLanguage}\n api={api}\n method={method}\n setVersionsUrl={setVersionsUrl}\n />\n </ExtendComponentsThemeProvider>\n </Aside>\n )}\n </>\n )\n}\n"],"file":"MethodScene.js"}
|
package/lib/esm/state/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/state/index.ts"],"names":[],"mappings":"AAyBA,cAAc,SAAd;AACA,cAAc,YAAd","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 * from './store'\nexport * from './settings'\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/state/index.ts"],"names":[],"mappings":"AAyBA,cAAc,SAAd;AACA,cAAc,YAAd;AACA,cAAc,SAAd","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 * from './store'\nexport * from './settings'\nexport * from './lodes'\n"],"file":"index.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../../src/state/lodes/index.ts"],"names":[],"mappings":"AAyBA,cAAc,aAAd;AACA,cAAc,SAAd","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 * from './selectors'\nexport * from './slice'\n"],"file":"index.js"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { call, put, takeEvery } from 'typed-redux-saga';
|
|
2
|
+
import { getLoded } from '../../utils';
|
|
3
|
+
import { lodeActions } from './slice';
|
|
4
|
+
|
|
5
|
+
function* initSaga(action) {
|
|
6
|
+
var {
|
|
7
|
+
initLodesSuccessAction,
|
|
8
|
+
initLodesFailureAction
|
|
9
|
+
} = lodeActions;
|
|
10
|
+
|
|
11
|
+
try {
|
|
12
|
+
var lode = yield* call(getLoded, action.payload.examplesLodeUrl, action.payload.declarationsLodeUrl);
|
|
13
|
+
yield* put(initLodesSuccessAction(lode));
|
|
14
|
+
} catch (error) {
|
|
15
|
+
yield* put(initLodesFailureAction(error));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function* saga() {
|
|
20
|
+
var {
|
|
21
|
+
initLodesAction
|
|
22
|
+
} = lodeActions;
|
|
23
|
+
yield* takeEvery(initLodesAction, initSaga);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=sagas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/state/lodes/sagas.ts"],"names":["call","put","takeEvery","getLoded","lodeActions","initSaga","action","initLodesSuccessAction","initLodesFailureAction","lode","payload","examplesLodeUrl","declarationsLodeUrl","error","saga","initLodesAction"],"mappings":"AAyBA,SAASA,IAAT,EAAeC,GAAf,EAAoBC,SAApB,QAAqC,kBAArC;AAGA,SAASC,QAAT,QAAyB,aAAzB;AAEA,SAASC,WAAT,QAA4B,SAA5B;;AAEA,UAAUC,QAAV,CAAmBC,MAAnB,EAAuD;AACrD,MAAM;AAAEC,IAAAA,sBAAF;AAA0BC,IAAAA;AAA1B,MAAqDJ,WAA3D;;AACA,MAAI;AACF,QAAMK,IAAI,GAAG,OAAOT,IAAI,CACtBG,QADsB,EAEtBG,MAAM,CAACI,OAAP,CAAeC,eAFO,EAGtBL,MAAM,CAACI,OAAP,CAAeE,mBAHO,CAAxB;AAKA,WAAOX,GAAG,CAACM,sBAAsB,CAACE,IAAD,CAAvB,CAAV;AACD,GAPD,CAOE,OAAOI,KAAP,EAAmB;AACnB,WAAOZ,GAAG,CAACO,sBAAsB,CAACK,KAAD,CAAvB,CAAV;AACD;AACF;;AAED,OAAO,UAAUC,IAAV,GAAiB;AACtB,MAAM;AAAEC,IAAAA;AAAF,MAAsBX,WAA5B;AAEA,SAAOF,SAAS,CAACa,eAAD,EAAkBV,QAAlB,CAAhB;AACD","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 { call, put, takeEvery } from 'typed-redux-saga'\nimport type { PayloadAction } from '@reduxjs/toolkit'\n\nimport { getLoded } from '../../utils'\nimport type { InitPayload } from './slice'\nimport { lodeActions } from './slice'\n\nfunction* initSaga(action: PayloadAction<InitPayload>) {\n const { initLodesSuccessAction, initLodesFailureAction } = lodeActions\n try {\n const lode = yield* call(\n getLoded,\n action.payload.examplesLodeUrl,\n action.payload.declarationsLodeUrl\n )\n yield* put(initLodesSuccessAction(lode))\n } catch (error: any) {\n yield* put(initLodesFailureAction(error))\n }\n}\n\nexport function* saga() {\n const { initLodesAction } = lodeActions\n\n yield* takeEvery(initLodesAction, initSaga)\n}\n"],"file":"sagas.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/state/lodes/selectors.ts"],"names":["selectLodeState","state","lodes","selectExamplesLode","examples","selectDeclarationsLode","declarations"],"mappings":"AA2BA,IAAMA,eAAe,GAAIC,KAAD,IAAsBA,KAAK,CAACC,KAApD;;AAEA,OAAO,IAAMC,kBAAkB,GAAIF,KAAD,IAChCD,eAAe,CAACC,KAAD,CAAf,CAAuBG,QADlB;AAGP,OAAO,IAAMC,sBAAsB,GAAIJ,KAAD,IACpCD,eAAe,CAACC,KAAD,CAAf,CAAuBK,YADlB","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 { RootState } from '../store'\n\nconst selectLodeState = (state: RootState) => state.lodes\n\nexport const selectExamplesLode = (state: RootState) =>\n selectLodeState(state).examples\n\nexport const selectDeclarationsLode = (state: RootState) =>\n selectLodeState(state).declarations\n"],"file":"selectors.js"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createSliceHooks } from '@looker/redux';
|
|
2
|
+
import { createSlice } from '@reduxjs/toolkit';
|
|
3
|
+
import { saga } from './sagas';
|
|
4
|
+
export var defaultLodesState = {
|
|
5
|
+
examples: undefined,
|
|
6
|
+
declarations: undefined
|
|
7
|
+
};
|
|
8
|
+
export var lodesSlice = createSlice({
|
|
9
|
+
name: 'lodes',
|
|
10
|
+
initialState: defaultLodesState,
|
|
11
|
+
reducers: {
|
|
12
|
+
initLodesAction(_state, _action) {},
|
|
13
|
+
|
|
14
|
+
initLodesSuccessAction(state, action) {
|
|
15
|
+
state.examples = action.payload.examples;
|
|
16
|
+
state.declarations = action.payload.declarations;
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
initLodesFailureAction(state, action) {
|
|
20
|
+
state.error = action.payload;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export var lodeActions = lodesSlice.actions;
|
|
26
|
+
export var {
|
|
27
|
+
useActions: useLodeActions,
|
|
28
|
+
useStoreState: useLodesStoreState
|
|
29
|
+
} = createSliceHooks(lodesSlice, saga);
|
|
30
|
+
//# sourceMappingURL=slice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/state/lodes/slice.ts"],"names":["createSliceHooks","createSlice","saga","defaultLodesState","examples","undefined","declarations","lodesSlice","name","initialState","reducers","initLodesAction","_state","_action","initLodesSuccessAction","state","action","payload","initLodesFailureAction","error","lodeActions","actions","useActions","useLodeActions","useStoreState","useLodesStoreState"],"mappings":"AAyBA,SAASA,gBAAT,QAAiC,eAAjC;AAGA,SAASC,WAAT,QAA4B,kBAA5B;AAEA,SAASC,IAAT,QAAqB,SAArB;AAQA,OAAO,IAAMC,iBAA6B,GAAG;AAC3CC,EAAAA,QAAQ,EAAEC,SADiC;AAE3CC,EAAAA,YAAY,EAAED;AAF6B,CAAtC;AAYP,OAAO,IAAME,UAAU,GAAGN,WAAW,CAAC;AACpCO,EAAAA,IAAI,EAAE,OAD8B;AAEpCC,EAAAA,YAAY,EAAEN,iBAFsB;AAGpCO,EAAAA,QAAQ,EAAE;AAERC,IAAAA,eAAe,CAACC,MAAD,EAASC,OAAT,EAA8C,CAAE,CAFvD;;AAGRC,IAAAA,sBAAsB,CAACC,KAAD,EAAQC,MAAR,EAAkD;AACtED,MAAAA,KAAK,CAACX,QAAN,GAAiBY,MAAM,CAACC,OAAP,CAAeb,QAAhC;AACAW,MAAAA,KAAK,CAACT,YAAN,GAAqBU,MAAM,CAACC,OAAP,CAAeX,YAApC;AACD,KANO;;AAORY,IAAAA,sBAAsB,CAACH,KAAD,EAAQC,MAAR,EAAsC;AAC1DD,MAAAA,KAAK,CAACI,KAAN,GAAcH,MAAM,CAACC,OAArB;AACD;;AATO;AAH0B,CAAD,CAA9B;AAgBP,OAAO,IAAMG,WAAW,GAAGb,UAAU,CAACc,OAA/B;AACP,OAAO,IAAM;AAAEC,EAAAA,UAAU,EAAEC,cAAd;AAA8BC,EAAAA,aAAa,EAAEC;AAA7C,IACXzB,gBAAgB,CAACO,UAAD,EAAaL,IAAb,CADX","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 { createSliceHooks } from '@looker/redux'\nimport type { IDeclarationMine, IExampleMine } from '@looker/sdk-codegen'\nimport type { PayloadAction } from '@reduxjs/toolkit'\nimport { createSlice } from '@reduxjs/toolkit'\n\nimport { saga } from './sagas'\n\nexport interface LodesState {\n examples?: IExampleMine\n declarations?: IDeclarationMine\n error?: Error\n}\n\nexport const defaultLodesState: LodesState = {\n examples: undefined,\n declarations: undefined,\n}\n\nexport interface InitPayload {\n examplesLodeUrl?: string\n declarationsLodeUrl?: string\n}\n\ntype InitSuccessAction = LodesState\n\nexport const lodesSlice = createSlice({\n name: 'lodes',\n initialState: defaultLodesState,\n reducers: {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n initLodesAction(_state, _action: PayloadAction<InitPayload>) {},\n initLodesSuccessAction(state, action: PayloadAction<InitSuccessAction>) {\n state.examples = action.payload.examples\n state.declarations = action.payload.declarations\n },\n initLodesFailureAction(state, action: PayloadAction<Error>) {\n state.error = action.payload\n },\n },\n})\n\nexport const lodeActions = lodesSlice.actions\nexport const { useActions: useLodeActions, useStoreState: useLodesStoreState } =\n createSliceHooks(lodesSlice, saga)\n"],"file":"slice.js"}
|