@looker/extension-sdk-react 21.14.0 → 21.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/lib/components/ErrorMessage/ErrorMessage.d.ts +1 -1
  3. package/lib/components/ErrorMessage/ErrorMessage.js.map +1 -1
  4. package/lib/components/ExtensionConnector/ExtensionConnector.d.ts +1 -1
  5. package/lib/components/ExtensionConnector/ExtensionConnector.js.map +1 -1
  6. package/lib/components/ExtensionConnector/types.d.ts +2 -1
  7. package/lib/components/ExtensionProvider/ExtensionProvider.d.ts +2 -2
  8. package/lib/components/ExtensionProvider/ExtensionProvider.js.map +1 -1
  9. package/lib/components/ExtensionProvider/types.d.ts +2 -2
  10. package/lib/components/ExtensionProvider2/ExtensionProvider2.d.ts +3 -2
  11. package/lib/components/ExtensionProvider2/ExtensionProvider2.js.map +1 -1
  12. package/lib/components/ExtensionProviderBase/ExtensionProviderBase.d.ts +1 -1
  13. package/lib/components/ExtensionProviderBase/ExtensionProviderBase.js.map +1 -1
  14. package/lib/components/RouteChangeListener/RouteChangeListener.d.ts +1 -1
  15. package/lib/components/RouteChangeListener/RouteChangeListener.js.map +1 -1
  16. package/lib/components/RouteChangeListener/types.d.ts +1 -1
  17. package/lib/components/utils/get_initial_route_entries.d.ts +1 -1
  18. package/lib/components/utils/get_initial_route_entries.js.map +1 -1
  19. package/lib/components/utils/setup_close_popovers.d.ts +1 -1
  20. package/lib/components/utils/setup_close_popovers.js.map +1 -1
  21. package/lib/esm/components/ErrorMessage/ErrorMessage.js.map +1 -1
  22. package/lib/esm/components/ExtensionConnector/ExtensionConnector.js.map +1 -1
  23. package/lib/esm/components/ExtensionProvider/ExtensionProvider.js.map +1 -1
  24. package/lib/esm/components/ExtensionProvider2/ExtensionProvider2.js.map +1 -1
  25. package/lib/esm/components/ExtensionProviderBase/ExtensionProviderBase.js.map +1 -1
  26. package/lib/esm/components/RouteChangeListener/RouteChangeListener.js.map +1 -1
  27. package/lib/esm/components/utils/get_initial_route_entries.js.map +1 -1
  28. package/lib/esm/components/utils/setup_close_popovers.js.map +1 -1
  29. package/lib/esm/sdk/core_sdk_31.js.map +1 -1
  30. package/lib/esm/sdk/core_sdk_40.js.map +1 -1
  31. package/lib/sdk/core_sdk_31.d.ts +1 -1
  32. package/lib/sdk/core_sdk_31.js.map +1 -1
  33. package/lib/sdk/core_sdk_40.d.ts +1 -1
  34. package/lib/sdk/core_sdk_40.js.map +1 -1
  35. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -5,6 +5,73 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ### [21.20.1](https://www.github.com/looker-open-source/sdk-codegen/compare/extension-sdk-react-v21.20.0...extension-sdk-react-v21.20.1) (2022-01-27)
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @looker/extension-sdk bumped from ^21.20.0 to ^21.20.1
16
+ * @looker/sdk bumped from ^21.20.0 to ^21.20.1
17
+
18
+ ## [21.20.1](https://www.github.com/looker-open-source/sdk-codegen/compare/extension-sdk-react-v21.20.0...extension-sdk-react-v21.20.1) (2021-12-20)
19
+
20
+
21
+ ### Dependencies
22
+
23
+ * The following workspace dependencies were updated
24
+ * dependencies
25
+ * @looker/sdk-rtl bumped from ^21.2.0 to ^21.3.1
26
+
27
+ ## [21.20.0](https://www.github.com/looker-open-source/sdk-codegen/compare/extension-sdk-react-v21.18.1...extension-sdk-react-v21.20.0) (2021-11-10)
28
+
29
+
30
+ ### Features
31
+
32
+ * create @looker/extension-utils ([#886](https://www.github.com/looker-open-source/sdk-codegen/issues/886)) ([9d1720d](https://www.github.com/looker-open-source/sdk-codegen/commit/9d1720d9a4cec00c45195dd9c716d9a2a929264f))
33
+
34
+
35
+ ### Dependencies
36
+
37
+ * The following workspace dependencies were updated
38
+ * dependencies
39
+ * @looker/extension-sdk bumped from ^21.18.1 to ^21.20.0
40
+ * @looker/sdk bumped from ^21.18.1 to ^21.20.0
41
+ * @looker/sdk-rtl bumped from ^21.1.1 to ^21.2.0
42
+
43
+ ### [21.18.1](https://www.github.com/looker-open-source/sdk-codegen/compare/extension-sdk-react-v21.18.0...extension-sdk-react-v21.18.1) (2021-10-27)
44
+
45
+
46
+ ### Dependencies
47
+
48
+ * The following workspace dependencies were updated
49
+ * dependencies
50
+ * @looker/extension-sdk bumped from ^21.18.0 to ^21.18.1
51
+ * @looker/sdk bumped from ^21.18.0 to ^21.18.1
52
+ * @looker/sdk-rtl bumped from ^21.1.0 to ^21.1.1
53
+
54
+ ## [21.18.0](https://www.github.com/looker-open-source/sdk-codegen/compare/extension-sdk-react-v21.16.0...extension-sdk-react-v21.18.0) (2021-10-24)
55
+
56
+
57
+ ### Dependencies
58
+
59
+ * The following workspace dependencies were updated
60
+ * dependencies
61
+ * @looker/extension-sdk bumped from ^21.16.0 to ^21.18.0
62
+ * @looker/sdk bumped from ^21.16.0 to ^21.18.0
63
+
64
+ ## [21.16.0](https://www.github.com/looker-open-source/sdk-codegen/compare/extension-sdk-react-v21.14.0...extension-sdk-react-v21.16.0) (2021-10-19)
65
+
66
+
67
+ ### Dependencies
68
+
69
+ * The following workspace dependencies were updated
70
+ * dependencies
71
+ * @looker/extension-sdk bumped from ^21.14.0 to ^21.16.0
72
+ * @looker/sdk bumped from ^21.14.0 to ^21.16.0
73
+ * @looker/sdk-rtl bumped from ^21.0.20 to ^21.1.0
74
+
8
75
  ## [21.14.0](https://www.github.com/looker-open-source/sdk-codegen/compare/extension-sdk-react-v21.12.0...extension-sdk-react-v21.14.0) (2021-09-01)
9
76
 
10
77
 
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { ErrorMessageProps } from './types';
2
+ import type { ErrorMessageProps } from './types';
3
3
  export declare const ErrorMessage: React.FC<ErrorMessageProps>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ErrorMessage/ErrorMessage.tsx"],"names":["ErrorMessage","errorMessage","width","margin","padding","background","borderRadius","font"],"mappings":";;;;;;;AA0BA;;;;AAGO,IAAMA,YAAyC,GAAG;AAAA,MAAC;AAAEC,IAAAA;AAAF,GAAD;AAAA,SACvD;AACE,IAAA,EAAE,EAAC,gCADL;AAEE,iBAAU,QAFZ;AAGE,IAAA,IAAI,EAAC,QAHP;AAIE,IAAA,KAAK,EAAE;AACLC,MAAAA,KAAK,EAAE,MADF;AAELC,MAAAA,MAAM,EAAE,MAFH;AAGLC,MAAAA,OAAO,EAAE,WAHJ;AAILC,MAAAA,UAAU,EAAE,SAJP;AAKLC,MAAAA,YAAY,EAAE,KALT;AAMLC,MAAAA,IAAI,EAAE;AAND;AAJT,KAaGN,YAbH,CADuD;AAAA,CAAlD","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 from 'react'\nimport { ErrorMessageProps } from './types'\n\nexport const ErrorMessage: React.FC<ErrorMessageProps> = ({ errorMessage }) => (\n <div\n id=\"extension-initialization-error\"\n aria-live=\"polite\"\n role=\"status\"\n style={{\n width: '100%',\n margin: '-8px',\n padding: '12px 16px',\n background: '#FFE5E9',\n borderRadius: '4px',\n font: '0.875rem \"Helvetica\", san-serif',\n }}\n >\n {errorMessage}\n </div>\n)\n"],"file":"ErrorMessage.js"}
1
+ {"version":3,"sources":["../../../src/components/ErrorMessage/ErrorMessage.tsx"],"names":["ErrorMessage","errorMessage","width","margin","padding","background","borderRadius","font"],"mappings":";;;;;;;AA0BA;;;;AAGO,IAAMA,YAAyC,GAAG;AAAA,MAAC;AAAEC,IAAAA;AAAF,GAAD;AAAA,SACvD;AACE,IAAA,EAAE,EAAC,gCADL;AAEE,iBAAU,QAFZ;AAGE,IAAA,IAAI,EAAC,QAHP;AAIE,IAAA,KAAK,EAAE;AACLC,MAAAA,KAAK,EAAE,MADF;AAELC,MAAAA,MAAM,EAAE,MAFH;AAGLC,MAAAA,OAAO,EAAE,WAHJ;AAILC,MAAAA,UAAU,EAAE,SAJP;AAKLC,MAAAA,YAAY,EAAE,KALT;AAMLC,MAAAA,IAAI,EAAE;AAND;AAJT,KAaGN,YAbH,CADuD;AAAA,CAAlD","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 from 'react'\nimport type { ErrorMessageProps } from './types'\n\nexport const ErrorMessage: React.FC<ErrorMessageProps> = ({ errorMessage }) => (\n <div\n id=\"extension-initialization-error\"\n aria-live=\"polite\"\n role=\"status\"\n style={{\n width: '100%',\n margin: '-8px',\n padding: '12px 16px',\n background: '#FFE5E9',\n borderRadius: '4px',\n font: '0.875rem \"Helvetica\", san-serif',\n }}\n >\n {errorMessage}\n </div>\n)\n"],"file":"ErrorMessage.js"}
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { ExtensionConnectorProps } from './types';
2
+ import type { ExtensionConnectorProps } from './types';
3
3
  export declare const ExtensionConnector: React.FC<ExtensionConnectorProps>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ExtensionConnector/ExtensionConnector.tsx"],"names":["ExtensionConnector","contextData","updateContextData","connectedCallback","unloadedCallback","onPathnameChange","onRouteChange","hostTracksRoute","loadingComponent","requiredLookerVersion","chattyTimeout","children","initialRouteData","setInitialRouteData","hostRouteData","setHostRouteData","route","initializing","setInitializing","initializeError","setInitializeError","setInitialRouteAndRouteState","routeState","hostChangedRoute","_route","startsWith","React","useEffect","initialize","extensionHost","setInitialRoute","error","console","message","undefined","extensionSDK"],"mappings":"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","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 isEqual from 'lodash/isEqual'\nimport React, { useState } from 'react'\nimport { MemoryRouter } from 'react-router-dom'\nimport { connectExtensionHost } from '@looker/extension-sdk'\nimport { ErrorMessage } from '../ErrorMessage'\nimport { RouteChangeListener } from '../RouteChangeListener'\nimport { getInitialRouteEntries } from '../utils/get_initial_route_entries'\nimport { setupClosePopoversListener } from '../utils/setup_close_popovers'\nimport { ExtensionConnectorProps, RouteData } from './types'\n\n/**\n * ExtensionConnector component. Provides access to the extension API and SDK (use\n * ExtensionContext) and react routing services.\n */\nexport const ExtensionConnector: React.FC<ExtensionConnectorProps> = ({\n contextData,\n updateContextData,\n connectedCallback,\n unloadedCallback,\n onPathnameChange,\n onRouteChange,\n hostTracksRoute = true,\n loadingComponent,\n requiredLookerVersion,\n chattyTimeout,\n children,\n}) => {\n const [initialRouteData, setInitialRouteData] = useState<RouteData>()\n const [hostRouteData, setHostRouteData] = useState<RouteData>({ route: '' })\n const [initializing, setInitializing] = useState(true)\n const [initializeError, setInitializeError] = useState<string>()\n\n const setInitialRouteAndRouteState = (route: string, routeState?: any) => {\n if (hostTracksRoute) {\n setInitialRouteData({ route, routeState })\n }\n }\n\n const hostChangedRoute = (_route: string, routeState?: any) => {\n const route = _route.startsWith('/') ? _route : '/' + _route\n if (\n route !== hostRouteData.route ||\n !isEqual(routeState, hostRouteData.routeState)\n ) {\n setHostRouteData({ route, routeState })\n updateContextData({\n ...contextData,\n route,\n routeState,\n })\n }\n }\n\n React.useEffect(() => {\n const initialize = async () => {\n try {\n const extensionHost = await connectExtensionHost({\n setInitialRoute: setInitialRouteAndRouteState,\n requiredLookerVersion,\n hostChangedRoute,\n chattyTimeout,\n })\n connectedCallback(extensionHost)\n setInitializing(false)\n } catch (error) {\n console.error(error)\n setInitializeError(error.message || 'Extension failed to initialize.')\n setInitializing(false)\n }\n }\n initialize()\n return () => {\n unloadedCallback()\n }\n }, [])\n\n React.useEffect(() => {\n return initializing\n ? undefined\n : setupClosePopoversListener(contextData.extensionSDK)\n }, [initializing])\n\n return (\n <>\n {initializing ? (\n loadingComponent\n ) : (\n <>\n {initializeError ? (\n <ErrorMessage errorMessage={initializeError} />\n ) : (\n <>\n {hostTracksRoute ? (\n <MemoryRouter\n initialEntries={getInitialRouteEntries(initialRouteData)}\n >\n <RouteChangeListener\n onRouteChange={onRouteChange}\n onPathnameChange={onPathnameChange}\n extensionHost={contextData!.extensionSDK}\n hostRoute={hostRouteData.route}\n hostRouteState={hostRouteData.routeState}\n />\n {children}\n </MemoryRouter>\n ) : (\n <>{children}</>\n )}\n </>\n )}\n </>\n )}\n </>\n )\n}\n"],"file":"ExtensionConnector.js"}
1
+ {"version":3,"sources":["../../../src/components/ExtensionConnector/ExtensionConnector.tsx"],"names":["ExtensionConnector","contextData","updateContextData","connectedCallback","unloadedCallback","onPathnameChange","onRouteChange","hostTracksRoute","loadingComponent","requiredLookerVersion","chattyTimeout","children","initialRouteData","setInitialRouteData","hostRouteData","setHostRouteData","route","initializing","setInitializing","initializeError","setInitializeError","setInitialRouteAndRouteState","routeState","hostChangedRoute","_route","startsWith","React","useEffect","initialize","extensionHost","setInitialRoute","error","console","message","undefined","extensionSDK"],"mappings":"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","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 isEqual from 'lodash/isEqual'\nimport React, { useState } from 'react'\nimport { MemoryRouter } from 'react-router-dom'\nimport { connectExtensionHost } from '@looker/extension-sdk'\nimport { ErrorMessage } from '../ErrorMessage'\nimport { RouteChangeListener } from '../RouteChangeListener'\nimport { getInitialRouteEntries } from '../utils/get_initial_route_entries'\nimport { setupClosePopoversListener } from '../utils/setup_close_popovers'\nimport type { ExtensionConnectorProps, RouteData } from './types'\n\n/**\n * ExtensionConnector component. Provides access to the extension API and SDK (use\n * ExtensionContext) and react routing services.\n */\nexport const ExtensionConnector: React.FC<ExtensionConnectorProps> = ({\n contextData,\n updateContextData,\n connectedCallback,\n unloadedCallback,\n onPathnameChange,\n onRouteChange,\n hostTracksRoute = true,\n loadingComponent,\n requiredLookerVersion,\n chattyTimeout,\n children,\n}) => {\n const [initialRouteData, setInitialRouteData] = useState<RouteData>()\n const [hostRouteData, setHostRouteData] = useState<RouteData>({ route: '' })\n const [initializing, setInitializing] = useState(true)\n const [initializeError, setInitializeError] = useState<string>()\n\n const setInitialRouteAndRouteState = (route: string, routeState?: any) => {\n if (hostTracksRoute) {\n setInitialRouteData({ route, routeState })\n }\n }\n\n const hostChangedRoute = (_route: string, routeState?: any) => {\n const route = _route.startsWith('/') ? _route : '/' + _route\n if (\n route !== hostRouteData.route ||\n !isEqual(routeState, hostRouteData.routeState)\n ) {\n setHostRouteData({ route, routeState })\n updateContextData({\n ...contextData,\n route,\n routeState,\n })\n }\n }\n\n React.useEffect(() => {\n const initialize = async () => {\n try {\n const extensionHost = await connectExtensionHost({\n setInitialRoute: setInitialRouteAndRouteState,\n requiredLookerVersion,\n hostChangedRoute,\n chattyTimeout,\n })\n connectedCallback(extensionHost)\n setInitializing(false)\n } catch (error: any) {\n // eslint-disable-next-line no-console\n console.error(error)\n setInitializeError(error.message || 'Extension failed to initialize.')\n setInitializing(false)\n }\n }\n initialize()\n return () => {\n unloadedCallback()\n }\n }, [])\n\n React.useEffect(() => {\n return initializing\n ? undefined\n : setupClosePopoversListener(contextData.extensionSDK)\n }, [initializing])\n\n return (\n <>\n {initializing ? (\n loadingComponent\n ) : (\n <>\n {initializeError ? (\n <ErrorMessage errorMessage={initializeError} />\n ) : (\n <>\n {hostTracksRoute ? (\n <MemoryRouter\n initialEntries={getInitialRouteEntries(initialRouteData)}\n >\n <RouteChangeListener\n onRouteChange={onRouteChange}\n onPathnameChange={onPathnameChange}\n extensionHost={contextData!.extensionSDK}\n hostRoute={hostRouteData.route}\n hostRouteState={hostRouteData.routeState}\n />\n {children}\n </MemoryRouter>\n ) : (\n <>{children}</>\n )}\n </>\n )}\n </>\n )}\n </>\n )\n}\n"],"file":"ExtensionConnector.js"}
@@ -1,4 +1,5 @@
1
- import { ExtensionHostApi, ExtensionSDK } from '@looker/extension-sdk';
1
+ /// <reference types="react" />
2
+ import type { ExtensionHostApi, ExtensionSDK } from '@looker/extension-sdk';
2
3
  export interface BaseExtensionContextData {
3
4
  extensionSDK: ExtensionSDK;
4
5
  initializeError?: string;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ExtensionProviderProps } from '../ExtensionConnector';
3
- import { ExtensionContextData } from './types';
2
+ import type { ExtensionProviderProps } from '../ExtensionConnector';
3
+ import type { ExtensionContextData } from './types';
4
4
  export declare const ExtensionContext: React.Context<ExtensionContextData>;
5
5
  export declare const ExtensionProvider: React.FC<ExtensionProviderProps>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ExtensionProvider/ExtensionProvider.tsx"],"names":["ExtensionContext","React","createContext","undefined","ExtensionProvider","children","props","extensionData","setExtensionData","connectedCallback","extensionHost","core31SDK","LookerExtensionSDK","create31Client","core40SDK","create40Client","previousState","extensionSDK","coreSDK","unloadedCallback","updateContextData","updatedContextData"],"mappings":";;;;;;;AA0BA;;AACA;;AAEA;;AAKA;;AACA;;;;;;;;;;;;;;;;;;AAMO,IAAMA,gBAAgB,GAAGC,eAAMC,aAAN,CAC9BC,SAD8B,CAAzB;;;;AAQA,IAAMC,iBAAmD,GAAG,QAG7D;AAAA,MAH8D;AAClEC,IAAAA;AADkE,GAG9D;AAAA,MADDC,KACC;;AACJ,MAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoC,qBACxC,EADwC,CAA1C;;AAGA,MAAMC,iBAAiB,GAAIC,aAAD,IAAqC;AAC7D,QAAMC,SAAsB,GAC1BC,iCAAmBC,cAAnB,CAAkCH,aAAlC,CADF;;AAEA,QAAMI,SAAsB,GAC1BF,iCAAmBG,cAAnB,CAAkCL,aAAlC,CADF;;AAGA,sCAAkBC,SAAlB;AACA,uCAAkBG,SAAlB;AACAN,IAAAA,gBAAgB,CAAEQ,aAAD,IAAyC;AACxD,6CACKA,aADL;AAEEC,QAAAA,YAAY,EAAEP,aAFhB;AAGEQ,QAAAA,OAAO,EAAEP,SAHX;AAIEA,QAAAA,SAJF;AAKEG,QAAAA;AALF;AAOD,KARe,CAAhB;AASD,GAjBD;;AAmBA,MAAMK,gBAAgB,GAAG,MAAM;AAC7B;AACA;AACD,GAHD;;AAKA,MAAMC,iBAAiB,GAAIC,kBAAD,IAAkD;AAC1Eb,IAAAA,gBAAgB,CAAEQ,aAAD,IAAyC;AACxD,6CACKA,aADL,GAEKK,kBAFL;AAID,KALe,CAAhB;AAMD,GAPD;;AASA,SACE,6BAAC,gBAAD,CAAkB,QAAlB;AAA2B,IAAA,KAAK,EAAEd;AAAlC,KACE,6BAAC,sCAAD,eACMD,KADN;AAEE,IAAA,WAAW,EAAEC,aAFf;AAGE,IAAA,iBAAiB,EAAEE,iBAHrB;AAIE,IAAA,iBAAiB,EAAEW,iBAJrB;AAKE,IAAA,gBAAgB,EAAED;AALpB,MAOGd,QAPH,CADF,CADF;AAaD,CArDM","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, { useState } from 'react'\nimport { ExtensionHostApi, LookerExtensionSDK } from '@looker/extension-sdk'\nimport { Looker31SDK, Looker40SDK } from '@looker/sdk'\nimport {\n BaseExtensionContextData,\n ExtensionProviderProps,\n ExtensionConnector,\n} from '../ExtensionConnector'\nimport { registerCore31SDK, unregisterCore31SDK } from '../../sdk/core_sdk_31'\nimport { registerCore40SDK, unregisterCore40SDK } from '../../sdk/core_sdk_40'\nimport { ExtensionContextData } from './types'\n\n/**\n * React context provider for extension API and SDK\n */\nexport const ExtensionContext = React.createContext<ExtensionContextData>(\n undefined as any // no one will ever see this undefined!\n)\n\n/**\n * ExtensionProvider component. Provides access to the extension API and SDK (use\n * ExtensionContext) and react routing services.\n */\nexport const ExtensionProvider: React.FC<ExtensionProviderProps> = ({\n children,\n ...props\n}) => {\n const [extensionData, setExtensionData] = useState<ExtensionContextData>(\n {} as ExtensionContextData\n )\n const connectedCallback = (extensionHost: ExtensionHostApi) => {\n const core31SDK: Looker31SDK =\n LookerExtensionSDK.create31Client(extensionHost)\n const core40SDK: Looker40SDK =\n LookerExtensionSDK.create40Client(extensionHost)\n // Provide global access for use by redux if needed\n registerCore31SDK(core31SDK)\n registerCore40SDK(core40SDK)\n setExtensionData((previousState: ExtensionContextData) => {\n return {\n ...previousState,\n extensionSDK: extensionHost,\n coreSDK: core31SDK,\n core31SDK,\n core40SDK,\n }\n })\n }\n\n const unloadedCallback = () => {\n unregisterCore31SDK()\n unregisterCore40SDK()\n }\n\n const updateContextData = (updatedContextData: BaseExtensionContextData) => {\n setExtensionData((previousState: ExtensionContextData) => {\n return {\n ...previousState,\n ...updatedContextData,\n }\n })\n }\n\n return (\n <ExtensionContext.Provider value={extensionData!}>\n <ExtensionConnector\n {...props}\n contextData={extensionData}\n connectedCallback={connectedCallback}\n updateContextData={updateContextData}\n unloadedCallback={unloadedCallback}\n >\n {children}\n </ExtensionConnector>\n </ExtensionContext.Provider>\n )\n}\n"],"file":"ExtensionProvider.js"}
1
+ {"version":3,"sources":["../../../src/components/ExtensionProvider/ExtensionProvider.tsx"],"names":["ExtensionContext","React","createContext","undefined","ExtensionProvider","children","props","extensionData","setExtensionData","connectedCallback","extensionHost","core31SDK","LookerExtensionSDK","create31Client","core40SDK","create40Client","previousState","extensionSDK","coreSDK","unloadedCallback","updateContextData","updatedContextData"],"mappings":";;;;;;;AA0BA;;AAEA;;AAMA;;AACA;;AACA;;;;;;;;;;;;;;;;;;AAMO,IAAMA,gBAAgB,GAAGC,eAAMC,aAAN,CAC9BC,SAD8B,CAAzB;;;;AAQA,IAAMC,iBAAmD,GAAG,QAG7D;AAAA,MAH8D;AAClEC,IAAAA;AADkE,GAG9D;AAAA,MADDC,KACC;;AACJ,MAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoC,qBACxC,EADwC,CAA1C;;AAGA,MAAMC,iBAAiB,GAAIC,aAAD,IAAqC;AAC7D,QAAMC,SAAsB,GAC1BC,iCAAmBC,cAAnB,CAAkCH,aAAlC,CADF;;AAEA,QAAMI,SAAsB,GAC1BF,iCAAmBG,cAAnB,CAAkCL,aAAlC,CADF;;AAGA,sCAAkBC,SAAlB;AACA,uCAAkBG,SAAlB;AACAN,IAAAA,gBAAgB,CAAEQ,aAAD,IAAyC;AACxD,6CACKA,aADL;AAEEC,QAAAA,YAAY,EAAEP,aAFhB;AAGEQ,QAAAA,OAAO,EAAEP,SAHX;AAIEA,QAAAA,SAJF;AAKEG,QAAAA;AALF;AAOD,KARe,CAAhB;AASD,GAjBD;;AAmBA,MAAMK,gBAAgB,GAAG,MAAM;AAC7B;AACA;AACD,GAHD;;AAKA,MAAMC,iBAAiB,GAAIC,kBAAD,IAAkD;AAC1Eb,IAAAA,gBAAgB,CAAEQ,aAAD,IAAyC;AACxD,6CACKA,aADL,GAEKK,kBAFL;AAID,KALe,CAAhB;AAMD,GAPD;;AASA,SACE,6BAAC,gBAAD,CAAkB,QAAlB;AAA2B,IAAA,KAAK,EAAEd;AAAlC,KACE,6BAAC,sCAAD,eACMD,KADN;AAEE,IAAA,WAAW,EAAEC,aAFf;AAGE,IAAA,iBAAiB,EAAEE,iBAHrB;AAIE,IAAA,iBAAiB,EAAEW,iBAJrB;AAKE,IAAA,gBAAgB,EAAED;AALpB,MAOGd,QAPH,CADF,CADF;AAaD,CArDM","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, { useState } from 'react'\nimport type { ExtensionHostApi } from '@looker/extension-sdk'\nimport { LookerExtensionSDK } from '@looker/extension-sdk'\nimport type { Looker31SDK, Looker40SDK } from '@looker/sdk'\nimport type {\n BaseExtensionContextData,\n ExtensionProviderProps,\n} from '../ExtensionConnector'\nimport { ExtensionConnector } from '../ExtensionConnector'\nimport { registerCore31SDK, unregisterCore31SDK } from '../../sdk/core_sdk_31'\nimport { registerCore40SDK, unregisterCore40SDK } from '../../sdk/core_sdk_40'\nimport type { ExtensionContextData } from './types'\n\n/**\n * React context provider for extension API and SDK\n */\nexport const ExtensionContext = React.createContext<ExtensionContextData>(\n undefined as any // no one will ever see this undefined!\n)\n\n/**\n * ExtensionProvider component. Provides access to the extension API and SDK (use\n * ExtensionContext) and react routing services.\n */\nexport const ExtensionProvider: React.FC<ExtensionProviderProps> = ({\n children,\n ...props\n}) => {\n const [extensionData, setExtensionData] = useState<ExtensionContextData>(\n {} as ExtensionContextData\n )\n const connectedCallback = (extensionHost: ExtensionHostApi) => {\n const core31SDK: Looker31SDK =\n LookerExtensionSDK.create31Client(extensionHost)\n const core40SDK: Looker40SDK =\n LookerExtensionSDK.create40Client(extensionHost)\n // Provide global access for use by redux if needed\n registerCore31SDK(core31SDK)\n registerCore40SDK(core40SDK)\n setExtensionData((previousState: ExtensionContextData) => {\n return {\n ...previousState,\n extensionSDK: extensionHost,\n coreSDK: core31SDK,\n core31SDK,\n core40SDK,\n }\n })\n }\n\n const unloadedCallback = () => {\n unregisterCore31SDK()\n unregisterCore40SDK()\n }\n\n const updateContextData = (updatedContextData: BaseExtensionContextData) => {\n setExtensionData((previousState: ExtensionContextData) => {\n return {\n ...previousState,\n ...updatedContextData,\n }\n })\n }\n\n return (\n <ExtensionContext.Provider value={extensionData!}>\n <ExtensionConnector\n {...props}\n contextData={extensionData}\n connectedCallback={connectedCallback}\n updateContextData={updateContextData}\n unloadedCallback={unloadedCallback}\n >\n {children}\n </ExtensionConnector>\n </ExtensionContext.Provider>\n )\n}\n"],"file":"ExtensionProvider.js"}
@@ -1,5 +1,5 @@
1
- import { Looker31SDK, Looker40SDK } from '@looker/sdk';
2
- import { BaseExtensionContextData } from '../ExtensionConnector';
1
+ import type { Looker31SDK, Looker40SDK } from '@looker/sdk';
2
+ import type { BaseExtensionContextData } from '../ExtensionConnector';
3
3
  export interface ExtensionContextData extends BaseExtensionContextData {
4
4
  coreSDK: Looker31SDK;
5
5
  core31SDK: Looker31SDK;
@@ -1,5 +1,6 @@
1
- import React, { ReactNode } from 'react';
2
- import { BaseExtensionContextData, ExtensionProviderProps } from '../ExtensionConnector';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
3
+ import type { BaseExtensionContextData, ExtensionProviderProps } from '../ExtensionConnector';
3
4
  export interface ExtensionContextData2<T> extends BaseExtensionContextData {
4
5
  coreSDK: T;
5
6
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ExtensionProvider2/ExtensionProvider2.tsx"],"names":["ExtensionContext2","React","createContext","undefined","ExtensionProvider2","props","children","type","rest","extensionData","setExtensionData","apiVersion","ApiVersion","connectedCallback","extensionHost","coreSDK","LookerExtensionSDK","createClient","SdkConnection","previousState","extensionSDK","unloadedCallback","updateContextData","updatedContextData"],"mappings":";;;;;;;;AA0BA;;AACA;;AACA;;AACA;;AAKA;;;;;;;;;;;;;;;;;;AASO,IAAMA,iBAAiB,GAAGC,eAAMC,aAAN,CAG/BC,SAH+B,CAA1B;;;;AAeA,SAASC,kBAAT,CAA+BC,KAA/B,EAAkE;AACvE,MAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAA8BF,KAApC;AAAA,MAA2BG,IAA3B,4BAAoCH,KAApC;;AACA,MAAM,CAACI,aAAD,EAAgBC,gBAAhB,IAAoC,qBACxC,EADwC,CAA1C;AAGA,MAAMC,UAAU,GAAIJ,IAAD,CAAcK,UAAjC;;AAEA,MAAMC,iBAAiB,GAAIC,aAAD,IAAqC;AAC7D,QAAIC,OAAJ;;AACA,QAAIJ,UAAJ,EAAgB;AACdI,MAAAA,OAAO,GAAGC,wBAAmBC,YAAnB,CACR,IAAIC,2BAAJ,CAAkBJ,aAAlB,EAAiCH,UAAjC,CADQ,EAERJ,IAFQ,CAAV;AAID;;AACD,oCAAiBQ,OAAjB;AACAL,IAAAA,gBAAgB,CAAES,aAAD,IAAwB;AACvC,6CACKA,aADL;AAEEC,QAAAA,YAAY,EAAEN,aAFhB;AAGEC,QAAAA;AAHF;AAKD,KANe,CAAhB;AAOD,GAhBD;;AAkBA,MAAMM,gBAAgB,GAAG,MAAM;AAC7B;AACD,GAFD;;AAIA,MAAMC,iBAAiB,GAAIC,kBAAD,IAAkD;AAC1Eb,IAAAA,gBAAgB,CAAES,aAAD,IAA6C;AAC5D,6CACKA,aADL,GAEKI,kBAFL;AAID,KALe,CAAhB;AAMD,GAPD;;AASA,SACE,6BAAC,iBAAD,CAAmB,QAAnB;AAA4B,IAAA,KAAK,EAAEd;AAAnC,KACE,6BAAC,sCAAD,eACMD,IADN;AAEE,IAAA,WAAW,EAAEC,aAFf;AAGE,IAAA,iBAAiB,EAAEI,iBAHrB;AAIE,IAAA,iBAAiB,EAAES,iBAJrB;AAKE,IAAA,gBAAgB,EAAED;AALpB,MAOGf,QAPH,CADF,CADF;AAaD","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, { useState, ReactNode } from 'react'\nimport { ExtensionHostApi, SdkConnection } from '@looker/extension-sdk'\nimport { LookerExtensionSDK } from '@looker/sdk'\nimport {\n BaseExtensionContextData,\n ExtensionConnector,\n ExtensionProviderProps,\n} from '../ExtensionConnector'\nimport { registerCoreSDK2, unregisterCoreSDK2 } from '../../sdk/core_sdk2'\n\nexport interface ExtensionContextData2<T> extends BaseExtensionContextData {\n coreSDK: T\n}\n\n/**\n * React context provider for extension API and SDK\n */\nexport const ExtensionContext2 = React.createContext<\n ExtensionContextData2<any>\n>(\n undefined as any // no one will ever see this undefined!\n)\n\nexport interface ExtensionProvider2Props<T> extends ExtensionProviderProps {\n type: T\n children?: ReactNode\n}\n\n/**\n * ExtensionProvider component. Provides access to the extension API and SDK (use\n * ExtensionContext) and react routing services.\n */\nexport function ExtensionProvider2<T>(props: ExtensionProvider2Props<T>) {\n const { children, type, ...rest } = props\n const [extensionData, setExtensionData] = useState<ExtensionContextData2<T>>(\n {} as ExtensionContextData2<T>\n )\n const apiVersion = (type as any).ApiVersion\n\n const connectedCallback = (extensionHost: ExtensionHostApi) => {\n let coreSDK: any\n if (apiVersion) {\n coreSDK = LookerExtensionSDK.createClient(\n new SdkConnection(extensionHost, apiVersion),\n type as any\n )\n }\n registerCoreSDK2(coreSDK)\n setExtensionData((previousState: any) => {\n return {\n ...previousState,\n extensionSDK: extensionHost,\n coreSDK,\n }\n })\n }\n\n const unloadedCallback = () => {\n unregisterCoreSDK2()\n }\n\n const updateContextData = (updatedContextData: BaseExtensionContextData) => {\n setExtensionData((previousState: ExtensionContextData2<T>) => {\n return {\n ...previousState,\n ...updatedContextData,\n }\n })\n }\n\n return (\n <ExtensionContext2.Provider value={extensionData!}>\n <ExtensionConnector\n {...rest}\n contextData={extensionData}\n connectedCallback={connectedCallback}\n updateContextData={updateContextData}\n unloadedCallback={unloadedCallback}\n >\n {children}\n </ExtensionConnector>\n </ExtensionContext2.Provider>\n )\n}\n"],"file":"ExtensionProvider2.js"}
1
+ {"version":3,"sources":["../../../src/components/ExtensionProvider2/ExtensionProvider2.tsx"],"names":["ExtensionContext2","React","createContext","undefined","ExtensionProvider2","props","children","type","rest","extensionData","setExtensionData","apiVersion","ApiVersion","connectedCallback","extensionHost","coreSDK","LookerExtensionSDK","createClient","SdkConnection","previousState","extensionSDK","unloadedCallback","updateContextData","updatedContextData"],"mappings":";;;;;;;;AA2BA;;AAEA;;AACA;;AAKA;;AACA;;;;;;;;;;;;;;;;;;AASO,IAAMA,iBAAiB,GAAGC,eAAMC,aAAN,CAG/BC,SAH+B,CAA1B;;;;AAeA,SAASC,kBAAT,CAA+BC,KAA/B,EAAkE;AACvE,MAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAA8BF,KAApC;AAAA,MAA2BG,IAA3B,4BAAoCH,KAApC;;AACA,MAAM,CAACI,aAAD,EAAgBC,gBAAhB,IAAoC,qBACxC,EADwC,CAA1C;AAGA,MAAMC,UAAU,GAAIJ,IAAD,CAAcK,UAAjC;;AAEA,MAAMC,iBAAiB,GAAIC,aAAD,IAAqC;AAC7D,QAAIC,OAAJ;;AACA,QAAIJ,UAAJ,EAAgB;AACdI,MAAAA,OAAO,GAAGC,wBAAmBC,YAAnB,CACR,IAAIC,2BAAJ,CAAkBJ,aAAlB,EAAiCH,UAAjC,CADQ,EAERJ,IAFQ,CAAV;AAID;;AACD,oCAAiBQ,OAAjB;AACAL,IAAAA,gBAAgB,CAAES,aAAD,IAAwB;AACvC,6CACKA,aADL;AAEEC,QAAAA,YAAY,EAAEN,aAFhB;AAGEC,QAAAA;AAHF;AAKD,KANe,CAAhB;AAOD,GAhBD;;AAkBA,MAAMM,gBAAgB,GAAG,MAAM;AAC7B;AACD,GAFD;;AAIA,MAAMC,iBAAiB,GAAIC,kBAAD,IAAkD;AAC1Eb,IAAAA,gBAAgB,CAAES,aAAD,IAA6C;AAC5D,6CACKA,aADL,GAEKI,kBAFL;AAID,KALe,CAAhB;AAMD,GAPD;;AASA,SACE,6BAAC,iBAAD,CAAmB,QAAnB;AAA4B,IAAA,KAAK,EAAEd;AAAnC,KACE,6BAAC,sCAAD,eACMD,IADN;AAEE,IAAA,WAAW,EAAEC,aAFf;AAGE,IAAA,iBAAiB,EAAEI,iBAHrB;AAIE,IAAA,iBAAiB,EAAES,iBAJrB;AAKE,IAAA,gBAAgB,EAAED;AALpB,MAOGf,QAPH,CADF,CADF;AAaD","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 { ReactNode } from 'react'\nimport React, { useState } from 'react'\nimport type { ExtensionHostApi } from '@looker/extension-sdk'\nimport { SdkConnection } from '@looker/extension-sdk'\nimport { LookerExtensionSDK } from '@looker/sdk'\nimport type {\n BaseExtensionContextData,\n ExtensionProviderProps,\n} from '../ExtensionConnector'\nimport { ExtensionConnector } from '../ExtensionConnector'\nimport { registerCoreSDK2, unregisterCoreSDK2 } from '../../sdk/core_sdk2'\n\nexport interface ExtensionContextData2<T> extends BaseExtensionContextData {\n coreSDK: T\n}\n\n/**\n * React context provider for extension API and SDK\n */\nexport const ExtensionContext2 = React.createContext<\n ExtensionContextData2<any>\n>(\n undefined as any // no one will ever see this undefined!\n)\n\nexport interface ExtensionProvider2Props<T> extends ExtensionProviderProps {\n type: T\n children?: ReactNode\n}\n\n/**\n * ExtensionProvider component. Provides access to the extension API and SDK (use\n * ExtensionContext) and react routing services.\n */\nexport function ExtensionProvider2<T>(props: ExtensionProvider2Props<T>) {\n const { children, type, ...rest } = props\n const [extensionData, setExtensionData] = useState<ExtensionContextData2<T>>(\n {} as ExtensionContextData2<T>\n )\n const apiVersion = (type as any).ApiVersion\n\n const connectedCallback = (extensionHost: ExtensionHostApi) => {\n let coreSDK: any\n if (apiVersion) {\n coreSDK = LookerExtensionSDK.createClient(\n new SdkConnection(extensionHost, apiVersion),\n type as any\n )\n }\n registerCoreSDK2(coreSDK)\n setExtensionData((previousState: any) => {\n return {\n ...previousState,\n extensionSDK: extensionHost,\n coreSDK,\n }\n })\n }\n\n const unloadedCallback = () => {\n unregisterCoreSDK2()\n }\n\n const updateContextData = (updatedContextData: BaseExtensionContextData) => {\n setExtensionData((previousState: ExtensionContextData2<T>) => {\n return {\n ...previousState,\n ...updatedContextData,\n }\n })\n }\n\n return (\n <ExtensionContext2.Provider value={extensionData!}>\n <ExtensionConnector\n {...rest}\n contextData={extensionData}\n connectedCallback={connectedCallback}\n updateContextData={updateContextData}\n unloadedCallback={unloadedCallback}\n >\n {children}\n </ExtensionConnector>\n </ExtensionContext2.Provider>\n )\n}\n"],"file":"ExtensionProvider2.js"}
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { BaseExtensionContextData, ExtensionProviderProps } from '../ExtensionConnector';
2
+ import type { BaseExtensionContextData, ExtensionProviderProps } from '../ExtensionConnector';
3
3
  export declare const ExtensionContextBase: React.Context<BaseExtensionContextData>;
4
4
  export declare const ExtensionProviderBase: React.FC<ExtensionProviderProps>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ExtensionProviderBase/ExtensionProviderBase.tsx"],"names":["ExtensionContextBase","React","createContext","undefined","ExtensionProviderBase","children","props","extensionData","setExtensionData","connectedCallback","extensionHost","previousState","extensionSDK","unloadedCallback","updateContextData","contextData"],"mappings":";;;;;;;AA0BA;;AAEA;;;;;;;;;;;;;;;;;;AASO,IAAMA,oBAAoB,GAC/BC,eAAMC,aAAN,CACEC,SADF,CADK;;;;AASA,IAAMC,qBAAuD,GAAG,QAGjE;AAAA,MAHkE;AACtEC,IAAAA;AADsE,GAGlE;AAAA,MADDC,KACC;;AACJ,MAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoC,qBACxC,EADwC,CAA1C;;AAIA,MAAMC,iBAAiB,GAAIC,aAAD,IAAqC;AAC7DF,IAAAA,gBAAgB,CAAEG,aAAD,IAA6C;AAC5D,6CACKA,aADL;AAEEC,QAAAA,YAAY,EAAEF;AAFhB;AAID,KALe,CAAhB;AAMD,GAPD;;AASA,MAAMG,gBAAgB,GAAG,MAAM,CAE9B,CAFD;;AAIA,MAAMC,iBAAiB,GAAIC,WAAD,IAA2C;AACnEP,IAAAA,gBAAgB,CAACO,WAAD,CAAhB;AACD,GAFD;;AAIA,SACE,6BAAC,oBAAD,CAAsB,QAAtB;AAA+B,IAAA,KAAK,EAAER;AAAtC,KACE,6BAAC,sCAAD,eACMD,KADN;AAEE,IAAA,WAAW,EAAEC,aAFf;AAGE,IAAA,iBAAiB,EAAEE,iBAHrB;AAIE,IAAA,iBAAiB,EAAEK,iBAJrB;AAKE,IAAA,gBAAgB,EAAED;AALpB,MAOGR,QAPH,CADF,CADF;AAaD,CAtCM","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, { useState } from 'react'\nimport { ExtensionHostApi } from '@looker/extension-sdk'\nimport {\n BaseExtensionContextData,\n ExtensionConnector,\n ExtensionProviderProps,\n} from '../ExtensionConnector'\n\n/**\n * React context provider for extension API and SDK\n */\nexport const ExtensionContextBase =\n React.createContext<BaseExtensionContextData>(\n undefined as any // no one will ever see this undefined!\n )\n\n/**\n * ExtensionProviderBase component. Provides access to the extension API but no SDK is\n * provided.\n */\nexport const ExtensionProviderBase: React.FC<ExtensionProviderProps> = ({\n children,\n ...props\n}) => {\n const [extensionData, setExtensionData] = useState<BaseExtensionContextData>(\n {} as BaseExtensionContextData\n )\n\n const connectedCallback = (extensionHost: ExtensionHostApi) => {\n setExtensionData((previousState: BaseExtensionContextData) => {\n return {\n ...previousState,\n extensionSDK: extensionHost,\n }\n })\n }\n\n const unloadedCallback = () => {\n // noop\n }\n\n const updateContextData = (contextData: BaseExtensionContextData) => {\n setExtensionData(contextData)\n }\n\n return (\n <ExtensionContextBase.Provider value={extensionData!}>\n <ExtensionConnector\n {...props}\n contextData={extensionData}\n connectedCallback={connectedCallback}\n updateContextData={updateContextData}\n unloadedCallback={unloadedCallback}\n >\n {children}\n </ExtensionConnector>\n </ExtensionContextBase.Provider>\n )\n}\n"],"file":"ExtensionProviderBase.js"}
1
+ {"version":3,"sources":["../../../src/components/ExtensionProviderBase/ExtensionProviderBase.tsx"],"names":["ExtensionContextBase","React","createContext","undefined","ExtensionProviderBase","children","props","extensionData","setExtensionData","connectedCallback","extensionHost","previousState","extensionSDK","unloadedCallback","updateContextData","contextData"],"mappings":";;;;;;;AA0BA;;AAMA;;;;;;;;;;;;;;;;;;AAKO,IAAMA,oBAAoB,GAC/BC,eAAMC,aAAN,CACEC,SADF,CADK;;;;AASA,IAAMC,qBAAuD,GAAG,QAGjE;AAAA,MAHkE;AACtEC,IAAAA;AADsE,GAGlE;AAAA,MADDC,KACC;;AACJ,MAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoC,qBACxC,EADwC,CAA1C;;AAIA,MAAMC,iBAAiB,GAAIC,aAAD,IAAqC;AAC7DF,IAAAA,gBAAgB,CAAEG,aAAD,IAA6C;AAC5D,6CACKA,aADL;AAEEC,QAAAA,YAAY,EAAEF;AAFhB;AAID,KALe,CAAhB;AAMD,GAPD;;AASA,MAAMG,gBAAgB,GAAG,MAAM,CAE9B,CAFD;;AAIA,MAAMC,iBAAiB,GAAIC,WAAD,IAA2C;AACnEP,IAAAA,gBAAgB,CAACO,WAAD,CAAhB;AACD,GAFD;;AAIA,SACE,6BAAC,oBAAD,CAAsB,QAAtB;AAA+B,IAAA,KAAK,EAAER;AAAtC,KACE,6BAAC,sCAAD,eACMD,KADN;AAEE,IAAA,WAAW,EAAEC,aAFf;AAGE,IAAA,iBAAiB,EAAEE,iBAHrB;AAIE,IAAA,iBAAiB,EAAEK,iBAJrB;AAKE,IAAA,gBAAgB,EAAED;AALpB,MAOGR,QAPH,CADF,CADF;AAaD,CAtCM","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, { useState } from 'react'\nimport type { ExtensionHostApi } from '@looker/extension-sdk'\nimport type {\n BaseExtensionContextData,\n ExtensionProviderProps,\n} from '../ExtensionConnector'\nimport { ExtensionConnector } from '../ExtensionConnector'\n\n/**\n * React context provider for extension API and SDK\n */\nexport const ExtensionContextBase =\n React.createContext<BaseExtensionContextData>(\n undefined as any // no one will ever see this undefined!\n )\n\n/**\n * ExtensionProviderBase component. Provides access to the extension API but no SDK is\n * provided.\n */\nexport const ExtensionProviderBase: React.FC<ExtensionProviderProps> = ({\n children,\n ...props\n}) => {\n const [extensionData, setExtensionData] = useState<BaseExtensionContextData>(\n {} as BaseExtensionContextData\n )\n\n const connectedCallback = (extensionHost: ExtensionHostApi) => {\n setExtensionData((previousState: BaseExtensionContextData) => {\n return {\n ...previousState,\n extensionSDK: extensionHost,\n }\n })\n }\n\n const unloadedCallback = () => {\n // noop\n }\n\n const updateContextData = (contextData: BaseExtensionContextData) => {\n setExtensionData(contextData)\n }\n\n return (\n <ExtensionContextBase.Provider value={extensionData!}>\n <ExtensionConnector\n {...props}\n contextData={extensionData}\n connectedCallback={connectedCallback}\n updateContextData={updateContextData}\n unloadedCallback={unloadedCallback}\n >\n {children}\n </ExtensionConnector>\n </ExtensionContextBase.Provider>\n )\n}\n"],"file":"ExtensionProviderBase.js"}
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { RouteChangeListenerProps } from './types';
2
+ import type { RouteChangeListenerProps } from './types';
3
3
  export declare const RouteChangeListener: React.FC<RouteChangeListenerProps>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/RouteChangeListener/RouteChangeListener.tsx"],"names":["RouteChangeListener","onPathnameChange","onRouteChange","extensionHost","hostRoute","hostRouteState","history","location","pathname","search","state","clientRouteChanged","push"],"mappings":";;;;;;;AA0BA;;AACA;;AAEA;;;;;;;;AAGO,IAAMA,mBAAuD,GAAG,QAMjE;AAAA,MANkE;AACtEC,IAAAA,gBADsE;AAEtEC,IAAAA,aAFsE;AAGtEC,IAAAA,aAHsE;AAItEC,IAAAA,SAJsE;AAKtEC,IAAAA;AALsE,GAMlE;AACJ,MAAMC,OAAO,GAAG,iCAAhB;AACA,MAAMC,QAAQ,GAAG,kCAAjB;AAEA,wBAAU,MAAM;AACd,QAAIN,gBAAJ,EAAsB;AACpBA,MAAAA,gBAAgB,CAACM,QAAQ,CAACC,QAAV,CAAhB;AACD;;AACD,QAAIN,aAAJ,EAAmB;AACjBA,MAAAA,aAAa,CAACK,QAAQ,CAACC,QAAT,GAAoBD,QAAQ,CAACE,MAA9B,EAAsC,oBAAMF,QAAQ,CAACG,KAAf,CAAtC,CAAb;AACD;;AACD;AAAEP,IAAAA,aAAD,CAAoCQ,kBAApC,CACCJ,QAAQ,CAACC,QAAT,GAAoBD,QAAQ,CAACE,MAD9B,EAECF,QAAQ,CAACG,KAFV;AAIF,GAXD,EAWG,CAACH,QAAD,CAXH;AAaA,wBAAU,MAAM;AACd,QAAIH,SAAJ,EAAe;AACbE,MAAAA,OAAO,CAACM,IAAR,CAAaR,SAAb,EAAwBC,cAAxB;AACD;AACF,GAJD,EAIG,CAACD,SAAD,CAJH;AAKA,SAAO,2DAAP;AACD,CA7BM","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 } from 'react'\nimport { useLocation, useHistory } from 'react-router-dom'\nimport { ExtensionHostApi } from '@looker/extension-sdk'\nimport clone from 'lodash/clone'\nimport { RouteChangeListenerProps } from './types'\n\nexport const RouteChangeListener: React.FC<RouteChangeListenerProps> = ({\n onPathnameChange,\n onRouteChange,\n extensionHost,\n hostRoute,\n hostRouteState,\n}) => {\n const history = useHistory()\n const location = useLocation()\n\n useEffect(() => {\n if (onPathnameChange) {\n onPathnameChange(location.pathname)\n }\n if (onRouteChange) {\n onRouteChange(location.pathname + location.search, clone(location.state))\n }\n ;(extensionHost as ExtensionHostApi).clientRouteChanged(\n location.pathname + location.search,\n location.state\n )\n }, [location])\n\n useEffect(() => {\n if (hostRoute) {\n history.push(hostRoute, hostRouteState)\n }\n }, [hostRoute])\n return <></>\n}\n"],"file":"RouteChangeListener.js"}
1
+ {"version":3,"sources":["../../../src/components/RouteChangeListener/RouteChangeListener.tsx"],"names":["RouteChangeListener","onPathnameChange","onRouteChange","extensionHost","hostRoute","hostRouteState","history","location","pathname","search","state","clientRouteChanged","push"],"mappings":";;;;;;;AA0BA;;AACA;;AAEA;;;;;;;;AAGO,IAAMA,mBAAuD,GAAG,QAMjE;AAAA,MANkE;AACtEC,IAAAA,gBADsE;AAEtEC,IAAAA,aAFsE;AAGtEC,IAAAA,aAHsE;AAItEC,IAAAA,SAJsE;AAKtEC,IAAAA;AALsE,GAMlE;AACJ,MAAMC,OAAO,GAAG,iCAAhB;AACA,MAAMC,QAAQ,GAAG,kCAAjB;AAEA,wBAAU,MAAM;AACd,QAAIN,gBAAJ,EAAsB;AACpBA,MAAAA,gBAAgB,CAACM,QAAQ,CAACC,QAAV,CAAhB;AACD;;AACD,QAAIN,aAAJ,EAAmB;AACjBA,MAAAA,aAAa,CAACK,QAAQ,CAACC,QAAT,GAAoBD,QAAQ,CAACE,MAA9B,EAAsC,oBAAMF,QAAQ,CAACG,KAAf,CAAtC,CAAb;AACD;;AACD;AAAEP,IAAAA,aAAD,CAAoCQ,kBAApC,CACCJ,QAAQ,CAACC,QAAT,GAAoBD,QAAQ,CAACE,MAD9B,EAECF,QAAQ,CAACG,KAFV;AAIF,GAXD,EAWG,CAACH,QAAD,CAXH;AAaA,wBAAU,MAAM;AACd,QAAIH,SAAJ,EAAe;AACbE,MAAAA,OAAO,CAACM,IAAR,CAAaR,SAAb,EAAwBC,cAAxB;AACD;AACF,GAJD,EAIG,CAACD,SAAD,CAJH;AAKA,SAAO,2DAAP;AACD,CA7BM","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 } from 'react'\nimport { useLocation, useHistory } from 'react-router-dom'\nimport type { ExtensionHostApi } from '@looker/extension-sdk'\nimport clone from 'lodash/clone'\nimport type { RouteChangeListenerProps } from './types'\n\nexport const RouteChangeListener: React.FC<RouteChangeListenerProps> = ({\n onPathnameChange,\n onRouteChange,\n extensionHost,\n hostRoute,\n hostRouteState,\n}) => {\n const history = useHistory()\n const location = useLocation()\n\n useEffect(() => {\n if (onPathnameChange) {\n onPathnameChange(location.pathname)\n }\n if (onRouteChange) {\n onRouteChange(location.pathname + location.search, clone(location.state))\n }\n ;(extensionHost as ExtensionHostApi).clientRouteChanged(\n location.pathname + location.search,\n location.state\n )\n }, [location])\n\n useEffect(() => {\n if (hostRoute) {\n history.push(hostRoute, hostRouteState)\n }\n }, [hostRoute])\n return <></>\n}\n"],"file":"RouteChangeListener.js"}
@@ -1,4 +1,4 @@
1
- import { ExtensionSDK } from '@looker/extension-sdk';
1
+ import type { ExtensionSDK } from '@looker/extension-sdk';
2
2
  export interface RouteChangeListenerProps {
3
3
  onPathnameChange?: (pathname: string) => void;
4
4
  onRouteChange?: (route: string, routeState?: any) => void;
@@ -1,3 +1,3 @@
1
1
  import * as H from 'history';
2
- import { RouteData } from '../ExtensionConnector/types';
2
+ import type { RouteData } from '../ExtensionConnector/types';
3
3
  export declare const getInitialRouteEntries: (initialRouteData?: RouteData | undefined) => H.LocationDescriptor<unknown>[] | undefined;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/utils/get_initial_route_entries.ts"],"names":["getInitialRouteEntries","initialRouteData","initialEntries","route","routeState","H","parsePath","state"],"mappings":";;;;;;;AA0BA;;;;;;;;;;;;AAGO,IAAMA,sBAAsB,GAAIC,gBAAD,IAAkC;AACtE,MAAIC,cAAJ;;AACA,MAAID,gBAAJ,EAAsB;AACpB,QAAM;AAAEE,MAAAA,KAAF;AAASC,MAAAA;AAAT,QAAwBH,gBAA9B;AACAC,IAAAA,cAAc,GAAG,iCAAMG,CAAC,CAACC,SAAF,CAAYH,KAAZ,CAAN;AAA0BI,MAAAA,KAAK,EAAEH;AAAjC,OAAjB;AACD;;AACD,SAAOF,cAAP;AACD,CAPM","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 * as H from 'history'\nimport { RouteData } from '../ExtensionConnector/types'\n\nexport const getInitialRouteEntries = (initialRouteData?: RouteData) => {\n let initialEntries: H.LocationDescriptor[] | undefined\n if (initialRouteData) {\n const { route, routeState } = initialRouteData\n initialEntries = [{ ...H.parsePath(route), state: routeState }]\n }\n return initialEntries\n}\n"],"file":"get_initial_route_entries.js"}
1
+ {"version":3,"sources":["../../../src/components/utils/get_initial_route_entries.ts"],"names":["getInitialRouteEntries","initialRouteData","initialEntries","route","routeState","H","parsePath","state"],"mappings":";;;;;;;AA0BA;;;;;;;;;;;;AAGO,IAAMA,sBAAsB,GAAIC,gBAAD,IAAkC;AACtE,MAAIC,cAAJ;;AACA,MAAID,gBAAJ,EAAsB;AACpB,QAAM;AAAEE,MAAAA,KAAF;AAASC,MAAAA;AAAT,QAAwBH,gBAA9B;AACAC,IAAAA,cAAc,GAAG,iCAAMG,CAAC,CAACC,SAAF,CAAYH,KAAZ,CAAN;AAA0BI,MAAAA,KAAK,EAAEH;AAAjC,OAAjB;AACD;;AACD,SAAOF,cAAP;AACD,CAPM","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 * as H from 'history'\nimport type { RouteData } from '../ExtensionConnector/types'\n\nexport const getInitialRouteEntries = (initialRouteData?: RouteData) => {\n let initialEntries: H.LocationDescriptor[] | undefined\n if (initialRouteData) {\n const { route, routeState } = initialRouteData\n initialEntries = [{ ...H.parsePath(route), state: routeState }]\n }\n return initialEntries\n}\n"],"file":"get_initial_route_entries.js"}
@@ -1,2 +1,2 @@
1
- import { ExtensionSDK } from '@looker/extension-sdk';
1
+ import type { ExtensionSDK } from '@looker/extension-sdk';
2
2
  export declare const setupClosePopoversListener: (extensionSDK?: ExtensionSDK | undefined) => () => void;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/utils/setup_close_popovers.ts"],"names":["setupClosePopoversListener","extensionSDK","onBodyMousedown","closeHostPopovers","body","document","querySelector","addEventListener","removeEventListener"],"mappings":";;;;;;;AA4BO,IAAMA,0BAA0B,GAAIC,YAAD,IAAiC;AACzE,MAAMC,eAAe,GAAG,MAAM;AAC5B,QAAID,YAAJ,EAAkB;AAChBA,MAAAA,YAAY,CAACE,iBAAb;AACD;AACF,GAJD;;AAKA,MAAMC,IAAwC,GAC5CC,QAAQ,CAACC,aAAT,CAAuB,MAAvB,CADF;;AAEA,MAAIF,IAAJ,EAAU;AACRA,IAAAA,IAAI,CAACG,gBAAL,CAAsB,WAAtB,EAAmCL,eAAnC;AACD;;AACD,SAAO,MAAM;AACX,QAAIE,IAAJ,EAAU;AACRA,MAAAA,IAAI,CAACI,mBAAL,CAAyB,WAAzB,EAAsCN,eAAtC;AACD;AACF,GAJD;AAKD,CAhBM","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 { ExtensionSDK } from '@looker/extension-sdk'\n\nexport const setupClosePopoversListener = (extensionSDK?: ExtensionSDK) => {\n const onBodyMousedown = () => {\n if (extensionSDK) {\n extensionSDK.closeHostPopovers()\n }\n }\n const body: HTMLBodyElement | undefined | null =\n document.querySelector('body')\n if (body) {\n body.addEventListener('mousedown', onBodyMousedown)\n }\n return () => {\n if (body) {\n body.removeEventListener('mousedown', onBodyMousedown)\n }\n }\n}\n"],"file":"setup_close_popovers.js"}
1
+ {"version":3,"sources":["../../../src/components/utils/setup_close_popovers.ts"],"names":["setupClosePopoversListener","extensionSDK","onBodyMousedown","closeHostPopovers","body","document","querySelector","addEventListener","removeEventListener"],"mappings":";;;;;;;AA4BO,IAAMA,0BAA0B,GAAIC,YAAD,IAAiC;AACzE,MAAMC,eAAe,GAAG,MAAM;AAC5B,QAAID,YAAJ,EAAkB;AAChBA,MAAAA,YAAY,CAACE,iBAAb;AACD;AACF,GAJD;;AAKA,MAAMC,IAAwC,GAC5CC,QAAQ,CAACC,aAAT,CAAuB,MAAvB,CADF;;AAEA,MAAIF,IAAJ,EAAU;AACRA,IAAAA,IAAI,CAACG,gBAAL,CAAsB,WAAtB,EAAmCL,eAAnC;AACD;;AACD,SAAO,MAAM;AACX,QAAIE,IAAJ,EAAU;AACRA,MAAAA,IAAI,CAACI,mBAAL,CAAyB,WAAzB,EAAsCN,eAAtC;AACD;AACF,GAJD;AAKD,CAhBM","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 { ExtensionSDK } from '@looker/extension-sdk'\n\nexport const setupClosePopoversListener = (extensionSDK?: ExtensionSDK) => {\n const onBodyMousedown = () => {\n if (extensionSDK) {\n extensionSDK.closeHostPopovers()\n }\n }\n const body: HTMLBodyElement | undefined | null =\n document.querySelector('body')\n if (body) {\n body.addEventListener('mousedown', onBodyMousedown)\n }\n return () => {\n if (body) {\n body.removeEventListener('mousedown', onBodyMousedown)\n }\n }\n}\n"],"file":"setup_close_popovers.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/ErrorMessage/ErrorMessage.tsx"],"names":["React","ErrorMessage","errorMessage","width","margin","padding","background","borderRadius","font"],"mappings":"AA0BA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,OAAO,IAAMC,YAAyC,GAAG;AAAA,MAAC;AAAEC,IAAAA;AAAF,GAAD;AAAA,SACvD;AACE,IAAA,EAAE,EAAC,gCADL;AAEE,iBAAU,QAFZ;AAGE,IAAA,IAAI,EAAC,QAHP;AAIE,IAAA,KAAK,EAAE;AACLC,MAAAA,KAAK,EAAE,MADF;AAELC,MAAAA,MAAM,EAAE,MAFH;AAGLC,MAAAA,OAAO,EAAE,WAHJ;AAILC,MAAAA,UAAU,EAAE,SAJP;AAKLC,MAAAA,YAAY,EAAE,KALT;AAMLC,MAAAA,IAAI,EAAE;AAND;AAJT,KAaGN,YAbH,CADuD;AAAA,CAAlD","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 from 'react'\nimport { ErrorMessageProps } from './types'\n\nexport const ErrorMessage: React.FC<ErrorMessageProps> = ({ errorMessage }) => (\n <div\n id=\"extension-initialization-error\"\n aria-live=\"polite\"\n role=\"status\"\n style={{\n width: '100%',\n margin: '-8px',\n padding: '12px 16px',\n background: '#FFE5E9',\n borderRadius: '4px',\n font: '0.875rem \"Helvetica\", san-serif',\n }}\n >\n {errorMessage}\n </div>\n)\n"],"file":"ErrorMessage.js"}
1
+ {"version":3,"sources":["../../../../src/components/ErrorMessage/ErrorMessage.tsx"],"names":["React","ErrorMessage","errorMessage","width","margin","padding","background","borderRadius","font"],"mappings":"AA0BA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,OAAO,IAAMC,YAAyC,GAAG;AAAA,MAAC;AAAEC,IAAAA;AAAF,GAAD;AAAA,SACvD;AACE,IAAA,EAAE,EAAC,gCADL;AAEE,iBAAU,QAFZ;AAGE,IAAA,IAAI,EAAC,QAHP;AAIE,IAAA,KAAK,EAAE;AACLC,MAAAA,KAAK,EAAE,MADF;AAELC,MAAAA,MAAM,EAAE,MAFH;AAGLC,MAAAA,OAAO,EAAE,WAHJ;AAILC,MAAAA,UAAU,EAAE,SAJP;AAKLC,MAAAA,YAAY,EAAE,KALT;AAMLC,MAAAA,IAAI,EAAE;AAND;AAJT,KAaGN,YAbH,CADuD;AAAA,CAAlD","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 from 'react'\nimport type { ErrorMessageProps } from './types'\n\nexport const ErrorMessage: React.FC<ErrorMessageProps> = ({ errorMessage }) => (\n <div\n id=\"extension-initialization-error\"\n aria-live=\"polite\"\n role=\"status\"\n style={{\n width: '100%',\n margin: '-8px',\n padding: '12px 16px',\n background: '#FFE5E9',\n borderRadius: '4px',\n font: '0.875rem \"Helvetica\", san-serif',\n }}\n >\n {errorMessage}\n </div>\n)\n"],"file":"ErrorMessage.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/ExtensionConnector/ExtensionConnector.tsx"],"names":["isEqual","React","useState","MemoryRouter","connectExtensionHost","ErrorMessage","RouteChangeListener","getInitialRouteEntries","setupClosePopoversListener","ExtensionConnector","contextData","updateContextData","connectedCallback","unloadedCallback","onPathnameChange","onRouteChange","hostTracksRoute","loadingComponent","requiredLookerVersion","chattyTimeout","children","initialRouteData","setInitialRouteData","hostRouteData","setHostRouteData","route","initializing","setInitializing","initializeError","setInitializeError","setInitialRouteAndRouteState","routeState","hostChangedRoute","_route","startsWith","useEffect","initialize","extensionHost","setInitialRoute","error","console","message","undefined","extensionSDK"],"mappings":"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","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 isEqual from 'lodash/isEqual'\nimport React, { useState } from 'react'\nimport { MemoryRouter } from 'react-router-dom'\nimport { connectExtensionHost } from '@looker/extension-sdk'\nimport { ErrorMessage } from '../ErrorMessage'\nimport { RouteChangeListener } from '../RouteChangeListener'\nimport { getInitialRouteEntries } from '../utils/get_initial_route_entries'\nimport { setupClosePopoversListener } from '../utils/setup_close_popovers'\nimport { ExtensionConnectorProps, RouteData } from './types'\n\n/**\n * ExtensionConnector component. Provides access to the extension API and SDK (use\n * ExtensionContext) and react routing services.\n */\nexport const ExtensionConnector: React.FC<ExtensionConnectorProps> = ({\n contextData,\n updateContextData,\n connectedCallback,\n unloadedCallback,\n onPathnameChange,\n onRouteChange,\n hostTracksRoute = true,\n loadingComponent,\n requiredLookerVersion,\n chattyTimeout,\n children,\n}) => {\n const [initialRouteData, setInitialRouteData] = useState<RouteData>()\n const [hostRouteData, setHostRouteData] = useState<RouteData>({ route: '' })\n const [initializing, setInitializing] = useState(true)\n const [initializeError, setInitializeError] = useState<string>()\n\n const setInitialRouteAndRouteState = (route: string, routeState?: any) => {\n if (hostTracksRoute) {\n setInitialRouteData({ route, routeState })\n }\n }\n\n const hostChangedRoute = (_route: string, routeState?: any) => {\n const route = _route.startsWith('/') ? _route : '/' + _route\n if (\n route !== hostRouteData.route ||\n !isEqual(routeState, hostRouteData.routeState)\n ) {\n setHostRouteData({ route, routeState })\n updateContextData({\n ...contextData,\n route,\n routeState,\n })\n }\n }\n\n React.useEffect(() => {\n const initialize = async () => {\n try {\n const extensionHost = await connectExtensionHost({\n setInitialRoute: setInitialRouteAndRouteState,\n requiredLookerVersion,\n hostChangedRoute,\n chattyTimeout,\n })\n connectedCallback(extensionHost)\n setInitializing(false)\n } catch (error) {\n console.error(error)\n setInitializeError(error.message || 'Extension failed to initialize.')\n setInitializing(false)\n }\n }\n initialize()\n return () => {\n unloadedCallback()\n }\n }, [])\n\n React.useEffect(() => {\n return initializing\n ? undefined\n : setupClosePopoversListener(contextData.extensionSDK)\n }, [initializing])\n\n return (\n <>\n {initializing ? (\n loadingComponent\n ) : (\n <>\n {initializeError ? (\n <ErrorMessage errorMessage={initializeError} />\n ) : (\n <>\n {hostTracksRoute ? (\n <MemoryRouter\n initialEntries={getInitialRouteEntries(initialRouteData)}\n >\n <RouteChangeListener\n onRouteChange={onRouteChange}\n onPathnameChange={onPathnameChange}\n extensionHost={contextData!.extensionSDK}\n hostRoute={hostRouteData.route}\n hostRouteState={hostRouteData.routeState}\n />\n {children}\n </MemoryRouter>\n ) : (\n <>{children}</>\n )}\n </>\n )}\n </>\n )}\n </>\n )\n}\n"],"file":"ExtensionConnector.js"}
1
+ {"version":3,"sources":["../../../../src/components/ExtensionConnector/ExtensionConnector.tsx"],"names":["isEqual","React","useState","MemoryRouter","connectExtensionHost","ErrorMessage","RouteChangeListener","getInitialRouteEntries","setupClosePopoversListener","ExtensionConnector","contextData","updateContextData","connectedCallback","unloadedCallback","onPathnameChange","onRouteChange","hostTracksRoute","loadingComponent","requiredLookerVersion","chattyTimeout","children","initialRouteData","setInitialRouteData","hostRouteData","setHostRouteData","route","initializing","setInitializing","initializeError","setInitializeError","setInitialRouteAndRouteState","routeState","hostChangedRoute","_route","startsWith","useEffect","initialize","extensionHost","setInitialRoute","error","console","message","undefined","extensionSDK"],"mappings":"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","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 isEqual from 'lodash/isEqual'\nimport React, { useState } from 'react'\nimport { MemoryRouter } from 'react-router-dom'\nimport { connectExtensionHost } from '@looker/extension-sdk'\nimport { ErrorMessage } from '../ErrorMessage'\nimport { RouteChangeListener } from '../RouteChangeListener'\nimport { getInitialRouteEntries } from '../utils/get_initial_route_entries'\nimport { setupClosePopoversListener } from '../utils/setup_close_popovers'\nimport type { ExtensionConnectorProps, RouteData } from './types'\n\n/**\n * ExtensionConnector component. Provides access to the extension API and SDK (use\n * ExtensionContext) and react routing services.\n */\nexport const ExtensionConnector: React.FC<ExtensionConnectorProps> = ({\n contextData,\n updateContextData,\n connectedCallback,\n unloadedCallback,\n onPathnameChange,\n onRouteChange,\n hostTracksRoute = true,\n loadingComponent,\n requiredLookerVersion,\n chattyTimeout,\n children,\n}) => {\n const [initialRouteData, setInitialRouteData] = useState<RouteData>()\n const [hostRouteData, setHostRouteData] = useState<RouteData>({ route: '' })\n const [initializing, setInitializing] = useState(true)\n const [initializeError, setInitializeError] = useState<string>()\n\n const setInitialRouteAndRouteState = (route: string, routeState?: any) => {\n if (hostTracksRoute) {\n setInitialRouteData({ route, routeState })\n }\n }\n\n const hostChangedRoute = (_route: string, routeState?: any) => {\n const route = _route.startsWith('/') ? _route : '/' + _route\n if (\n route !== hostRouteData.route ||\n !isEqual(routeState, hostRouteData.routeState)\n ) {\n setHostRouteData({ route, routeState })\n updateContextData({\n ...contextData,\n route,\n routeState,\n })\n }\n }\n\n React.useEffect(() => {\n const initialize = async () => {\n try {\n const extensionHost = await connectExtensionHost({\n setInitialRoute: setInitialRouteAndRouteState,\n requiredLookerVersion,\n hostChangedRoute,\n chattyTimeout,\n })\n connectedCallback(extensionHost)\n setInitializing(false)\n } catch (error: any) {\n // eslint-disable-next-line no-console\n console.error(error)\n setInitializeError(error.message || 'Extension failed to initialize.')\n setInitializing(false)\n }\n }\n initialize()\n return () => {\n unloadedCallback()\n }\n }, [])\n\n React.useEffect(() => {\n return initializing\n ? undefined\n : setupClosePopoversListener(contextData.extensionSDK)\n }, [initializing])\n\n return (\n <>\n {initializing ? (\n loadingComponent\n ) : (\n <>\n {initializeError ? (\n <ErrorMessage errorMessage={initializeError} />\n ) : (\n <>\n {hostTracksRoute ? (\n <MemoryRouter\n initialEntries={getInitialRouteEntries(initialRouteData)}\n >\n <RouteChangeListener\n onRouteChange={onRouteChange}\n onPathnameChange={onPathnameChange}\n extensionHost={contextData!.extensionSDK}\n hostRoute={hostRouteData.route}\n hostRouteState={hostRouteData.routeState}\n />\n {children}\n </MemoryRouter>\n ) : (\n <>{children}</>\n )}\n </>\n )}\n </>\n )}\n </>\n )\n}\n"],"file":"ExtensionConnector.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/ExtensionProvider/ExtensionProvider.tsx"],"names":["React","useState","LookerExtensionSDK","ExtensionConnector","registerCore31SDK","unregisterCore31SDK","registerCore40SDK","unregisterCore40SDK","ExtensionContext","createContext","undefined","ExtensionProvider","children","props","extensionData","setExtensionData","connectedCallback","extensionHost","core31SDK","create31Client","core40SDK","create40Client","previousState","extensionSDK","coreSDK","unloadedCallback","updateContextData","updatedContextData"],"mappings":";;;;;;;;;;;;AA0BA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,SAA2BC,kBAA3B,QAAqD,uBAArD;AAEA,SAGEC,kBAHF,QAIO,uBAJP;AAKA,SAASC,iBAAT,EAA4BC,mBAA5B,QAAuD,uBAAvD;AACA,SAASC,iBAAT,EAA4BC,mBAA5B,QAAuD,uBAAvD;AAMA,OAAO,IAAMC,gBAAgB,GAAGR,KAAK,CAACS,aAAN,CAC9BC,SAD8B,CAAzB;AAQP,OAAO,IAAMC,iBAAmD,GAAG,QAG7D;AAAA,MAH8D;AAClEC,IAAAA;AADkE,GAG9D;AAAA,MADDC,KACC;;AACJ,MAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoCd,QAAQ,CAChD,EADgD,CAAlD;;AAGA,MAAMe,iBAAiB,GAAIC,aAAD,IAAqC;AAC7D,QAAMC,SAAsB,GAC1BhB,kBAAkB,CAACiB,cAAnB,CAAkCF,aAAlC,CADF;AAEA,QAAMG,SAAsB,GAC1BlB,kBAAkB,CAACmB,cAAnB,CAAkCJ,aAAlC,CADF;AAGAb,IAAAA,iBAAiB,CAACc,SAAD,CAAjB;AACAZ,IAAAA,iBAAiB,CAACc,SAAD,CAAjB;AACAL,IAAAA,gBAAgB,CAAEO,aAAD,IAAyC;AACxD,6CACKA,aADL;AAEEC,QAAAA,YAAY,EAAEN,aAFhB;AAGEO,QAAAA,OAAO,EAAEN,SAHX;AAIEA,QAAAA,SAJF;AAKEE,QAAAA;AALF;AAOD,KARe,CAAhB;AASD,GAjBD;;AAmBA,MAAMK,gBAAgB,GAAG,MAAM;AAC7BpB,IAAAA,mBAAmB;AACnBE,IAAAA,mBAAmB;AACpB,GAHD;;AAKA,MAAMmB,iBAAiB,GAAIC,kBAAD,IAAkD;AAC1EZ,IAAAA,gBAAgB,CAAEO,aAAD,IAAyC;AACxD,6CACKA,aADL,GAEKK,kBAFL;AAID,KALe,CAAhB;AAMD,GAPD;;AASA,SACE,oBAAC,gBAAD,CAAkB,QAAlB;AAA2B,IAAA,KAAK,EAAEb;AAAlC,KACE,oBAAC,kBAAD,eACMD,KADN;AAEE,IAAA,WAAW,EAAEC,aAFf;AAGE,IAAA,iBAAiB,EAAEE,iBAHrB;AAIE,IAAA,iBAAiB,EAAEU,iBAJrB;AAKE,IAAA,gBAAgB,EAAED;AALpB,MAOGb,QAPH,CADF,CADF;AAaD,CArDM","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, { useState } from 'react'\nimport { ExtensionHostApi, LookerExtensionSDK } from '@looker/extension-sdk'\nimport { Looker31SDK, Looker40SDK } from '@looker/sdk'\nimport {\n BaseExtensionContextData,\n ExtensionProviderProps,\n ExtensionConnector,\n} from '../ExtensionConnector'\nimport { registerCore31SDK, unregisterCore31SDK } from '../../sdk/core_sdk_31'\nimport { registerCore40SDK, unregisterCore40SDK } from '../../sdk/core_sdk_40'\nimport { ExtensionContextData } from './types'\n\n/**\n * React context provider for extension API and SDK\n */\nexport const ExtensionContext = React.createContext<ExtensionContextData>(\n undefined as any // no one will ever see this undefined!\n)\n\n/**\n * ExtensionProvider component. Provides access to the extension API and SDK (use\n * ExtensionContext) and react routing services.\n */\nexport const ExtensionProvider: React.FC<ExtensionProviderProps> = ({\n children,\n ...props\n}) => {\n const [extensionData, setExtensionData] = useState<ExtensionContextData>(\n {} as ExtensionContextData\n )\n const connectedCallback = (extensionHost: ExtensionHostApi) => {\n const core31SDK: Looker31SDK =\n LookerExtensionSDK.create31Client(extensionHost)\n const core40SDK: Looker40SDK =\n LookerExtensionSDK.create40Client(extensionHost)\n // Provide global access for use by redux if needed\n registerCore31SDK(core31SDK)\n registerCore40SDK(core40SDK)\n setExtensionData((previousState: ExtensionContextData) => {\n return {\n ...previousState,\n extensionSDK: extensionHost,\n coreSDK: core31SDK,\n core31SDK,\n core40SDK,\n }\n })\n }\n\n const unloadedCallback = () => {\n unregisterCore31SDK()\n unregisterCore40SDK()\n }\n\n const updateContextData = (updatedContextData: BaseExtensionContextData) => {\n setExtensionData((previousState: ExtensionContextData) => {\n return {\n ...previousState,\n ...updatedContextData,\n }\n })\n }\n\n return (\n <ExtensionContext.Provider value={extensionData!}>\n <ExtensionConnector\n {...props}\n contextData={extensionData}\n connectedCallback={connectedCallback}\n updateContextData={updateContextData}\n unloadedCallback={unloadedCallback}\n >\n {children}\n </ExtensionConnector>\n </ExtensionContext.Provider>\n )\n}\n"],"file":"ExtensionProvider.js"}
1
+ {"version":3,"sources":["../../../../src/components/ExtensionProvider/ExtensionProvider.tsx"],"names":["React","useState","LookerExtensionSDK","ExtensionConnector","registerCore31SDK","unregisterCore31SDK","registerCore40SDK","unregisterCore40SDK","ExtensionContext","createContext","undefined","ExtensionProvider","children","props","extensionData","setExtensionData","connectedCallback","extensionHost","core31SDK","create31Client","core40SDK","create40Client","previousState","extensionSDK","coreSDK","unloadedCallback","updateContextData","updatedContextData"],"mappings":";;;;;;;;;;;;AA0BA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AAEA,SAASC,kBAAT,QAAmC,uBAAnC;AAMA,SAASC,kBAAT,QAAmC,uBAAnC;AACA,SAASC,iBAAT,EAA4BC,mBAA5B,QAAuD,uBAAvD;AACA,SAASC,iBAAT,EAA4BC,mBAA5B,QAAuD,uBAAvD;AAMA,OAAO,IAAMC,gBAAgB,GAAGR,KAAK,CAACS,aAAN,CAC9BC,SAD8B,CAAzB;AAQP,OAAO,IAAMC,iBAAmD,GAAG,QAG7D;AAAA,MAH8D;AAClEC,IAAAA;AADkE,GAG9D;AAAA,MADDC,KACC;;AACJ,MAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoCd,QAAQ,CAChD,EADgD,CAAlD;;AAGA,MAAMe,iBAAiB,GAAIC,aAAD,IAAqC;AAC7D,QAAMC,SAAsB,GAC1BhB,kBAAkB,CAACiB,cAAnB,CAAkCF,aAAlC,CADF;AAEA,QAAMG,SAAsB,GAC1BlB,kBAAkB,CAACmB,cAAnB,CAAkCJ,aAAlC,CADF;AAGAb,IAAAA,iBAAiB,CAACc,SAAD,CAAjB;AACAZ,IAAAA,iBAAiB,CAACc,SAAD,CAAjB;AACAL,IAAAA,gBAAgB,CAAEO,aAAD,IAAyC;AACxD,6CACKA,aADL;AAEEC,QAAAA,YAAY,EAAEN,aAFhB;AAGEO,QAAAA,OAAO,EAAEN,SAHX;AAIEA,QAAAA,SAJF;AAKEE,QAAAA;AALF;AAOD,KARe,CAAhB;AASD,GAjBD;;AAmBA,MAAMK,gBAAgB,GAAG,MAAM;AAC7BpB,IAAAA,mBAAmB;AACnBE,IAAAA,mBAAmB;AACpB,GAHD;;AAKA,MAAMmB,iBAAiB,GAAIC,kBAAD,IAAkD;AAC1EZ,IAAAA,gBAAgB,CAAEO,aAAD,IAAyC;AACxD,6CACKA,aADL,GAEKK,kBAFL;AAID,KALe,CAAhB;AAMD,GAPD;;AASA,SACE,oBAAC,gBAAD,CAAkB,QAAlB;AAA2B,IAAA,KAAK,EAAEb;AAAlC,KACE,oBAAC,kBAAD,eACMD,KADN;AAEE,IAAA,WAAW,EAAEC,aAFf;AAGE,IAAA,iBAAiB,EAAEE,iBAHrB;AAIE,IAAA,iBAAiB,EAAEU,iBAJrB;AAKE,IAAA,gBAAgB,EAAED;AALpB,MAOGb,QAPH,CADF,CADF;AAaD,CArDM","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, { useState } from 'react'\nimport type { ExtensionHostApi } from '@looker/extension-sdk'\nimport { LookerExtensionSDK } from '@looker/extension-sdk'\nimport type { Looker31SDK, Looker40SDK } from '@looker/sdk'\nimport type {\n BaseExtensionContextData,\n ExtensionProviderProps,\n} from '../ExtensionConnector'\nimport { ExtensionConnector } from '../ExtensionConnector'\nimport { registerCore31SDK, unregisterCore31SDK } from '../../sdk/core_sdk_31'\nimport { registerCore40SDK, unregisterCore40SDK } from '../../sdk/core_sdk_40'\nimport type { ExtensionContextData } from './types'\n\n/**\n * React context provider for extension API and SDK\n */\nexport const ExtensionContext = React.createContext<ExtensionContextData>(\n undefined as any // no one will ever see this undefined!\n)\n\n/**\n * ExtensionProvider component. Provides access to the extension API and SDK (use\n * ExtensionContext) and react routing services.\n */\nexport const ExtensionProvider: React.FC<ExtensionProviderProps> = ({\n children,\n ...props\n}) => {\n const [extensionData, setExtensionData] = useState<ExtensionContextData>(\n {} as ExtensionContextData\n )\n const connectedCallback = (extensionHost: ExtensionHostApi) => {\n const core31SDK: Looker31SDK =\n LookerExtensionSDK.create31Client(extensionHost)\n const core40SDK: Looker40SDK =\n LookerExtensionSDK.create40Client(extensionHost)\n // Provide global access for use by redux if needed\n registerCore31SDK(core31SDK)\n registerCore40SDK(core40SDK)\n setExtensionData((previousState: ExtensionContextData) => {\n return {\n ...previousState,\n extensionSDK: extensionHost,\n coreSDK: core31SDK,\n core31SDK,\n core40SDK,\n }\n })\n }\n\n const unloadedCallback = () => {\n unregisterCore31SDK()\n unregisterCore40SDK()\n }\n\n const updateContextData = (updatedContextData: BaseExtensionContextData) => {\n setExtensionData((previousState: ExtensionContextData) => {\n return {\n ...previousState,\n ...updatedContextData,\n }\n })\n }\n\n return (\n <ExtensionContext.Provider value={extensionData!}>\n <ExtensionConnector\n {...props}\n contextData={extensionData}\n connectedCallback={connectedCallback}\n updateContextData={updateContextData}\n unloadedCallback={unloadedCallback}\n >\n {children}\n </ExtensionConnector>\n </ExtensionContext.Provider>\n )\n}\n"],"file":"ExtensionProvider.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/ExtensionProvider2/ExtensionProvider2.tsx"],"names":["React","useState","SdkConnection","LookerExtensionSDK","ExtensionConnector","registerCoreSDK2","unregisterCoreSDK2","ExtensionContext2","createContext","undefined","ExtensionProvider2","props","children","type","rest","extensionData","setExtensionData","apiVersion","ApiVersion","connectedCallback","extensionHost","coreSDK","createClient","previousState","extensionSDK","unloadedCallback","updateContextData","updatedContextData"],"mappings":";;;;;;;;;;;;AA0BA,OAAOA,KAAP,IAAgBC,QAAhB,QAA2C,OAA3C;AACA,SAA2BC,aAA3B,QAAgD,uBAAhD;AACA,SAASC,kBAAT,QAAmC,aAAnC;AACA,SAEEC,kBAFF,QAIO,uBAJP;AAKA,SAASC,gBAAT,EAA2BC,kBAA3B,QAAqD,qBAArD;AASA,OAAO,IAAMC,iBAAiB,GAAGP,KAAK,CAACQ,aAAN,CAG/BC,SAH+B,CAA1B;AAeP,OAAO,SAASC,kBAAT,CAA+BC,KAA/B,EAAkE;AACvE,MAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAA8BF,KAApC;AAAA,MAA2BG,IAA3B,4BAAoCH,KAApC;;AACA,MAAM,CAACI,aAAD,EAAgBC,gBAAhB,IAAoCf,QAAQ,CAChD,EADgD,CAAlD;AAGA,MAAMgB,UAAU,GAAIJ,IAAD,CAAcK,UAAjC;;AAEA,MAAMC,iBAAiB,GAAIC,aAAD,IAAqC;AAC7D,QAAIC,OAAJ;;AACA,QAAIJ,UAAJ,EAAgB;AACdI,MAAAA,OAAO,GAAGlB,kBAAkB,CAACmB,YAAnB,CACR,IAAIpB,aAAJ,CAAkBkB,aAAlB,EAAiCH,UAAjC,CADQ,EAERJ,IAFQ,CAAV;AAID;;AACDR,IAAAA,gBAAgB,CAACgB,OAAD,CAAhB;AACAL,IAAAA,gBAAgB,CAAEO,aAAD,IAAwB;AACvC,6CACKA,aADL;AAEEC,QAAAA,YAAY,EAAEJ,aAFhB;AAGEC,QAAAA;AAHF;AAKD,KANe,CAAhB;AAOD,GAhBD;;AAkBA,MAAMI,gBAAgB,GAAG,MAAM;AAC7BnB,IAAAA,kBAAkB;AACnB,GAFD;;AAIA,MAAMoB,iBAAiB,GAAIC,kBAAD,IAAkD;AAC1EX,IAAAA,gBAAgB,CAAEO,aAAD,IAA6C;AAC5D,6CACKA,aADL,GAEKI,kBAFL;AAID,KALe,CAAhB;AAMD,GAPD;;AASA,SACE,oBAAC,iBAAD,CAAmB,QAAnB;AAA4B,IAAA,KAAK,EAAEZ;AAAnC,KACE,oBAAC,kBAAD,eACMD,IADN;AAEE,IAAA,WAAW,EAAEC,aAFf;AAGE,IAAA,iBAAiB,EAAEI,iBAHrB;AAIE,IAAA,iBAAiB,EAAEO,iBAJrB;AAKE,IAAA,gBAAgB,EAAED;AALpB,MAOGb,QAPH,CADF,CADF;AAaD","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, { useState, ReactNode } from 'react'\nimport { ExtensionHostApi, SdkConnection } from '@looker/extension-sdk'\nimport { LookerExtensionSDK } from '@looker/sdk'\nimport {\n BaseExtensionContextData,\n ExtensionConnector,\n ExtensionProviderProps,\n} from '../ExtensionConnector'\nimport { registerCoreSDK2, unregisterCoreSDK2 } from '../../sdk/core_sdk2'\n\nexport interface ExtensionContextData2<T> extends BaseExtensionContextData {\n coreSDK: T\n}\n\n/**\n * React context provider for extension API and SDK\n */\nexport const ExtensionContext2 = React.createContext<\n ExtensionContextData2<any>\n>(\n undefined as any // no one will ever see this undefined!\n)\n\nexport interface ExtensionProvider2Props<T> extends ExtensionProviderProps {\n type: T\n children?: ReactNode\n}\n\n/**\n * ExtensionProvider component. Provides access to the extension API and SDK (use\n * ExtensionContext) and react routing services.\n */\nexport function ExtensionProvider2<T>(props: ExtensionProvider2Props<T>) {\n const { children, type, ...rest } = props\n const [extensionData, setExtensionData] = useState<ExtensionContextData2<T>>(\n {} as ExtensionContextData2<T>\n )\n const apiVersion = (type as any).ApiVersion\n\n const connectedCallback = (extensionHost: ExtensionHostApi) => {\n let coreSDK: any\n if (apiVersion) {\n coreSDK = LookerExtensionSDK.createClient(\n new SdkConnection(extensionHost, apiVersion),\n type as any\n )\n }\n registerCoreSDK2(coreSDK)\n setExtensionData((previousState: any) => {\n return {\n ...previousState,\n extensionSDK: extensionHost,\n coreSDK,\n }\n })\n }\n\n const unloadedCallback = () => {\n unregisterCoreSDK2()\n }\n\n const updateContextData = (updatedContextData: BaseExtensionContextData) => {\n setExtensionData((previousState: ExtensionContextData2<T>) => {\n return {\n ...previousState,\n ...updatedContextData,\n }\n })\n }\n\n return (\n <ExtensionContext2.Provider value={extensionData!}>\n <ExtensionConnector\n {...rest}\n contextData={extensionData}\n connectedCallback={connectedCallback}\n updateContextData={updateContextData}\n unloadedCallback={unloadedCallback}\n >\n {children}\n </ExtensionConnector>\n </ExtensionContext2.Provider>\n )\n}\n"],"file":"ExtensionProvider2.js"}
1
+ {"version":3,"sources":["../../../../src/components/ExtensionProvider2/ExtensionProvider2.tsx"],"names":["React","useState","SdkConnection","LookerExtensionSDK","ExtensionConnector","registerCoreSDK2","unregisterCoreSDK2","ExtensionContext2","createContext","undefined","ExtensionProvider2","props","children","type","rest","extensionData","setExtensionData","apiVersion","ApiVersion","connectedCallback","extensionHost","coreSDK","createClient","previousState","extensionSDK","unloadedCallback","updateContextData","updatedContextData"],"mappings":";;;;;;;;;;;;AA2BA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AAEA,SAASC,aAAT,QAA8B,uBAA9B;AACA,SAASC,kBAAT,QAAmC,aAAnC;AAKA,SAASC,kBAAT,QAAmC,uBAAnC;AACA,SAASC,gBAAT,EAA2BC,kBAA3B,QAAqD,qBAArD;AASA,OAAO,IAAMC,iBAAiB,GAAGP,KAAK,CAACQ,aAAN,CAG/BC,SAH+B,CAA1B;AAeP,OAAO,SAASC,kBAAT,CAA+BC,KAA/B,EAAkE;AACvE,MAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAA8BF,KAApC;AAAA,MAA2BG,IAA3B,4BAAoCH,KAApC;;AACA,MAAM,CAACI,aAAD,EAAgBC,gBAAhB,IAAoCf,QAAQ,CAChD,EADgD,CAAlD;AAGA,MAAMgB,UAAU,GAAIJ,IAAD,CAAcK,UAAjC;;AAEA,MAAMC,iBAAiB,GAAIC,aAAD,IAAqC;AAC7D,QAAIC,OAAJ;;AACA,QAAIJ,UAAJ,EAAgB;AACdI,MAAAA,OAAO,GAAGlB,kBAAkB,CAACmB,YAAnB,CACR,IAAIpB,aAAJ,CAAkBkB,aAAlB,EAAiCH,UAAjC,CADQ,EAERJ,IAFQ,CAAV;AAID;;AACDR,IAAAA,gBAAgB,CAACgB,OAAD,CAAhB;AACAL,IAAAA,gBAAgB,CAAEO,aAAD,IAAwB;AACvC,6CACKA,aADL;AAEEC,QAAAA,YAAY,EAAEJ,aAFhB;AAGEC,QAAAA;AAHF;AAKD,KANe,CAAhB;AAOD,GAhBD;;AAkBA,MAAMI,gBAAgB,GAAG,MAAM;AAC7BnB,IAAAA,kBAAkB;AACnB,GAFD;;AAIA,MAAMoB,iBAAiB,GAAIC,kBAAD,IAAkD;AAC1EX,IAAAA,gBAAgB,CAAEO,aAAD,IAA6C;AAC5D,6CACKA,aADL,GAEKI,kBAFL;AAID,KALe,CAAhB;AAMD,GAPD;;AASA,SACE,oBAAC,iBAAD,CAAmB,QAAnB;AAA4B,IAAA,KAAK,EAAEZ;AAAnC,KACE,oBAAC,kBAAD,eACMD,IADN;AAEE,IAAA,WAAW,EAAEC,aAFf;AAGE,IAAA,iBAAiB,EAAEI,iBAHrB;AAIE,IAAA,iBAAiB,EAAEO,iBAJrB;AAKE,IAAA,gBAAgB,EAAED;AALpB,MAOGb,QAPH,CADF,CADF;AAaD","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 { ReactNode } from 'react'\nimport React, { useState } from 'react'\nimport type { ExtensionHostApi } from '@looker/extension-sdk'\nimport { SdkConnection } from '@looker/extension-sdk'\nimport { LookerExtensionSDK } from '@looker/sdk'\nimport type {\n BaseExtensionContextData,\n ExtensionProviderProps,\n} from '../ExtensionConnector'\nimport { ExtensionConnector } from '../ExtensionConnector'\nimport { registerCoreSDK2, unregisterCoreSDK2 } from '../../sdk/core_sdk2'\n\nexport interface ExtensionContextData2<T> extends BaseExtensionContextData {\n coreSDK: T\n}\n\n/**\n * React context provider for extension API and SDK\n */\nexport const ExtensionContext2 = React.createContext<\n ExtensionContextData2<any>\n>(\n undefined as any // no one will ever see this undefined!\n)\n\nexport interface ExtensionProvider2Props<T> extends ExtensionProviderProps {\n type: T\n children?: ReactNode\n}\n\n/**\n * ExtensionProvider component. Provides access to the extension API and SDK (use\n * ExtensionContext) and react routing services.\n */\nexport function ExtensionProvider2<T>(props: ExtensionProvider2Props<T>) {\n const { children, type, ...rest } = props\n const [extensionData, setExtensionData] = useState<ExtensionContextData2<T>>(\n {} as ExtensionContextData2<T>\n )\n const apiVersion = (type as any).ApiVersion\n\n const connectedCallback = (extensionHost: ExtensionHostApi) => {\n let coreSDK: any\n if (apiVersion) {\n coreSDK = LookerExtensionSDK.createClient(\n new SdkConnection(extensionHost, apiVersion),\n type as any\n )\n }\n registerCoreSDK2(coreSDK)\n setExtensionData((previousState: any) => {\n return {\n ...previousState,\n extensionSDK: extensionHost,\n coreSDK,\n }\n })\n }\n\n const unloadedCallback = () => {\n unregisterCoreSDK2()\n }\n\n const updateContextData = (updatedContextData: BaseExtensionContextData) => {\n setExtensionData((previousState: ExtensionContextData2<T>) => {\n return {\n ...previousState,\n ...updatedContextData,\n }\n })\n }\n\n return (\n <ExtensionContext2.Provider value={extensionData!}>\n <ExtensionConnector\n {...rest}\n contextData={extensionData}\n connectedCallback={connectedCallback}\n updateContextData={updateContextData}\n unloadedCallback={unloadedCallback}\n >\n {children}\n </ExtensionConnector>\n </ExtensionContext2.Provider>\n )\n}\n"],"file":"ExtensionProvider2.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/ExtensionProviderBase/ExtensionProviderBase.tsx"],"names":["React","useState","ExtensionConnector","ExtensionContextBase","createContext","undefined","ExtensionProviderBase","children","props","extensionData","setExtensionData","connectedCallback","extensionHost","previousState","extensionSDK","unloadedCallback","updateContextData","contextData"],"mappings":";;;;;;;;;;;;AA0BA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AAEA,SAEEC,kBAFF,QAIO,uBAJP;AASA,OAAO,IAAMC,oBAAoB,GAC/BH,KAAK,CAACI,aAAN,CACEC,SADF,CADK;AASP,OAAO,IAAMC,qBAAuD,GAAG,QAGjE;AAAA,MAHkE;AACtEC,IAAAA;AADsE,GAGlE;AAAA,MADDC,KACC;;AACJ,MAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoCT,QAAQ,CAChD,EADgD,CAAlD;;AAIA,MAAMU,iBAAiB,GAAIC,aAAD,IAAqC;AAC7DF,IAAAA,gBAAgB,CAAEG,aAAD,IAA6C;AAC5D,6CACKA,aADL;AAEEC,QAAAA,YAAY,EAAEF;AAFhB;AAID,KALe,CAAhB;AAMD,GAPD;;AASA,MAAMG,gBAAgB,GAAG,MAAM,CAE9B,CAFD;;AAIA,MAAMC,iBAAiB,GAAIC,WAAD,IAA2C;AACnEP,IAAAA,gBAAgB,CAACO,WAAD,CAAhB;AACD,GAFD;;AAIA,SACE,oBAAC,oBAAD,CAAsB,QAAtB;AAA+B,IAAA,KAAK,EAAER;AAAtC,KACE,oBAAC,kBAAD,eACMD,KADN;AAEE,IAAA,WAAW,EAAEC,aAFf;AAGE,IAAA,iBAAiB,EAAEE,iBAHrB;AAIE,IAAA,iBAAiB,EAAEK,iBAJrB;AAKE,IAAA,gBAAgB,EAAED;AALpB,MAOGR,QAPH,CADF,CADF;AAaD,CAtCM","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, { useState } from 'react'\nimport { ExtensionHostApi } from '@looker/extension-sdk'\nimport {\n BaseExtensionContextData,\n ExtensionConnector,\n ExtensionProviderProps,\n} from '../ExtensionConnector'\n\n/**\n * React context provider for extension API and SDK\n */\nexport const ExtensionContextBase =\n React.createContext<BaseExtensionContextData>(\n undefined as any // no one will ever see this undefined!\n )\n\n/**\n * ExtensionProviderBase component. Provides access to the extension API but no SDK is\n * provided.\n */\nexport const ExtensionProviderBase: React.FC<ExtensionProviderProps> = ({\n children,\n ...props\n}) => {\n const [extensionData, setExtensionData] = useState<BaseExtensionContextData>(\n {} as BaseExtensionContextData\n )\n\n const connectedCallback = (extensionHost: ExtensionHostApi) => {\n setExtensionData((previousState: BaseExtensionContextData) => {\n return {\n ...previousState,\n extensionSDK: extensionHost,\n }\n })\n }\n\n const unloadedCallback = () => {\n // noop\n }\n\n const updateContextData = (contextData: BaseExtensionContextData) => {\n setExtensionData(contextData)\n }\n\n return (\n <ExtensionContextBase.Provider value={extensionData!}>\n <ExtensionConnector\n {...props}\n contextData={extensionData}\n connectedCallback={connectedCallback}\n updateContextData={updateContextData}\n unloadedCallback={unloadedCallback}\n >\n {children}\n </ExtensionConnector>\n </ExtensionContextBase.Provider>\n )\n}\n"],"file":"ExtensionProviderBase.js"}
1
+ {"version":3,"sources":["../../../../src/components/ExtensionProviderBase/ExtensionProviderBase.tsx"],"names":["React","useState","ExtensionConnector","ExtensionContextBase","createContext","undefined","ExtensionProviderBase","children","props","extensionData","setExtensionData","connectedCallback","extensionHost","previousState","extensionSDK","unloadedCallback","updateContextData","contextData"],"mappings":";;;;;;;;;;;;AA0BA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AAMA,SAASC,kBAAT,QAAmC,uBAAnC;AAKA,OAAO,IAAMC,oBAAoB,GAC/BH,KAAK,CAACI,aAAN,CACEC,SADF,CADK;AASP,OAAO,IAAMC,qBAAuD,GAAG,QAGjE;AAAA,MAHkE;AACtEC,IAAAA;AADsE,GAGlE;AAAA,MADDC,KACC;;AACJ,MAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoCT,QAAQ,CAChD,EADgD,CAAlD;;AAIA,MAAMU,iBAAiB,GAAIC,aAAD,IAAqC;AAC7DF,IAAAA,gBAAgB,CAAEG,aAAD,IAA6C;AAC5D,6CACKA,aADL;AAEEC,QAAAA,YAAY,EAAEF;AAFhB;AAID,KALe,CAAhB;AAMD,GAPD;;AASA,MAAMG,gBAAgB,GAAG,MAAM,CAE9B,CAFD;;AAIA,MAAMC,iBAAiB,GAAIC,WAAD,IAA2C;AACnEP,IAAAA,gBAAgB,CAACO,WAAD,CAAhB;AACD,GAFD;;AAIA,SACE,oBAAC,oBAAD,CAAsB,QAAtB;AAA+B,IAAA,KAAK,EAAER;AAAtC,KACE,oBAAC,kBAAD,eACMD,KADN;AAEE,IAAA,WAAW,EAAEC,aAFf;AAGE,IAAA,iBAAiB,EAAEE,iBAHrB;AAIE,IAAA,iBAAiB,EAAEK,iBAJrB;AAKE,IAAA,gBAAgB,EAAED;AALpB,MAOGR,QAPH,CADF,CADF;AAaD,CAtCM","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, { useState } from 'react'\nimport type { ExtensionHostApi } from '@looker/extension-sdk'\nimport type {\n BaseExtensionContextData,\n ExtensionProviderProps,\n} from '../ExtensionConnector'\nimport { ExtensionConnector } from '../ExtensionConnector'\n\n/**\n * React context provider for extension API and SDK\n */\nexport const ExtensionContextBase =\n React.createContext<BaseExtensionContextData>(\n undefined as any // no one will ever see this undefined!\n )\n\n/**\n * ExtensionProviderBase component. Provides access to the extension API but no SDK is\n * provided.\n */\nexport const ExtensionProviderBase: React.FC<ExtensionProviderProps> = ({\n children,\n ...props\n}) => {\n const [extensionData, setExtensionData] = useState<BaseExtensionContextData>(\n {} as BaseExtensionContextData\n )\n\n const connectedCallback = (extensionHost: ExtensionHostApi) => {\n setExtensionData((previousState: BaseExtensionContextData) => {\n return {\n ...previousState,\n extensionSDK: extensionHost,\n }\n })\n }\n\n const unloadedCallback = () => {\n // noop\n }\n\n const updateContextData = (contextData: BaseExtensionContextData) => {\n setExtensionData(contextData)\n }\n\n return (\n <ExtensionContextBase.Provider value={extensionData!}>\n <ExtensionConnector\n {...props}\n contextData={extensionData}\n connectedCallback={connectedCallback}\n updateContextData={updateContextData}\n unloadedCallback={unloadedCallback}\n >\n {children}\n </ExtensionConnector>\n </ExtensionContextBase.Provider>\n )\n}\n"],"file":"ExtensionProviderBase.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/RouteChangeListener/RouteChangeListener.tsx"],"names":["React","useEffect","useLocation","useHistory","clone","RouteChangeListener","onPathnameChange","onRouteChange","extensionHost","hostRoute","hostRouteState","history","location","pathname","search","state","clientRouteChanged","push"],"mappings":"AA0BA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SAASC,WAAT,EAAsBC,UAAtB,QAAwC,kBAAxC;AAEA,OAAOC,KAAP,MAAkB,cAAlB;AAGA,OAAO,IAAMC,mBAAuD,GAAG,QAMjE;AAAA,MANkE;AACtEC,IAAAA,gBADsE;AAEtEC,IAAAA,aAFsE;AAGtEC,IAAAA,aAHsE;AAItEC,IAAAA,SAJsE;AAKtEC,IAAAA;AALsE,GAMlE;AACJ,MAAMC,OAAO,GAAGR,UAAU,EAA1B;AACA,MAAMS,QAAQ,GAAGV,WAAW,EAA5B;AAEAD,EAAAA,SAAS,CAAC,MAAM;AACd,QAAIK,gBAAJ,EAAsB;AACpBA,MAAAA,gBAAgB,CAACM,QAAQ,CAACC,QAAV,CAAhB;AACD;;AACD,QAAIN,aAAJ,EAAmB;AACjBA,MAAAA,aAAa,CAACK,QAAQ,CAACC,QAAT,GAAoBD,QAAQ,CAACE,MAA9B,EAAsCV,KAAK,CAACQ,QAAQ,CAACG,KAAV,CAA3C,CAAb;AACD;;AACD;AAAEP,IAAAA,aAAD,CAAoCQ,kBAApC,CACCJ,QAAQ,CAACC,QAAT,GAAoBD,QAAQ,CAACE,MAD9B,EAECF,QAAQ,CAACG,KAFV;AAIF,GAXQ,EAWN,CAACH,QAAD,CAXM,CAAT;AAaAX,EAAAA,SAAS,CAAC,MAAM;AACd,QAAIQ,SAAJ,EAAe;AACbE,MAAAA,OAAO,CAACM,IAAR,CAAaR,SAAb,EAAwBC,cAAxB;AACD;AACF,GAJQ,EAIN,CAACD,SAAD,CAJM,CAAT;AAKA,SAAO,yCAAP;AACD,CA7BM","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 } from 'react'\nimport { useLocation, useHistory } from 'react-router-dom'\nimport { ExtensionHostApi } from '@looker/extension-sdk'\nimport clone from 'lodash/clone'\nimport { RouteChangeListenerProps } from './types'\n\nexport const RouteChangeListener: React.FC<RouteChangeListenerProps> = ({\n onPathnameChange,\n onRouteChange,\n extensionHost,\n hostRoute,\n hostRouteState,\n}) => {\n const history = useHistory()\n const location = useLocation()\n\n useEffect(() => {\n if (onPathnameChange) {\n onPathnameChange(location.pathname)\n }\n if (onRouteChange) {\n onRouteChange(location.pathname + location.search, clone(location.state))\n }\n ;(extensionHost as ExtensionHostApi).clientRouteChanged(\n location.pathname + location.search,\n location.state\n )\n }, [location])\n\n useEffect(() => {\n if (hostRoute) {\n history.push(hostRoute, hostRouteState)\n }\n }, [hostRoute])\n return <></>\n}\n"],"file":"RouteChangeListener.js"}
1
+ {"version":3,"sources":["../../../../src/components/RouteChangeListener/RouteChangeListener.tsx"],"names":["React","useEffect","useLocation","useHistory","clone","RouteChangeListener","onPathnameChange","onRouteChange","extensionHost","hostRoute","hostRouteState","history","location","pathname","search","state","clientRouteChanged","push"],"mappings":"AA0BA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SAASC,WAAT,EAAsBC,UAAtB,QAAwC,kBAAxC;AAEA,OAAOC,KAAP,MAAkB,cAAlB;AAGA,OAAO,IAAMC,mBAAuD,GAAG,QAMjE;AAAA,MANkE;AACtEC,IAAAA,gBADsE;AAEtEC,IAAAA,aAFsE;AAGtEC,IAAAA,aAHsE;AAItEC,IAAAA,SAJsE;AAKtEC,IAAAA;AALsE,GAMlE;AACJ,MAAMC,OAAO,GAAGR,UAAU,EAA1B;AACA,MAAMS,QAAQ,GAAGV,WAAW,EAA5B;AAEAD,EAAAA,SAAS,CAAC,MAAM;AACd,QAAIK,gBAAJ,EAAsB;AACpBA,MAAAA,gBAAgB,CAACM,QAAQ,CAACC,QAAV,CAAhB;AACD;;AACD,QAAIN,aAAJ,EAAmB;AACjBA,MAAAA,aAAa,CAACK,QAAQ,CAACC,QAAT,GAAoBD,QAAQ,CAACE,MAA9B,EAAsCV,KAAK,CAACQ,QAAQ,CAACG,KAAV,CAA3C,CAAb;AACD;;AACD;AAAEP,IAAAA,aAAD,CAAoCQ,kBAApC,CACCJ,QAAQ,CAACC,QAAT,GAAoBD,QAAQ,CAACE,MAD9B,EAECF,QAAQ,CAACG,KAFV;AAIF,GAXQ,EAWN,CAACH,QAAD,CAXM,CAAT;AAaAX,EAAAA,SAAS,CAAC,MAAM;AACd,QAAIQ,SAAJ,EAAe;AACbE,MAAAA,OAAO,CAACM,IAAR,CAAaR,SAAb,EAAwBC,cAAxB;AACD;AACF,GAJQ,EAIN,CAACD,SAAD,CAJM,CAAT;AAKA,SAAO,yCAAP;AACD,CA7BM","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 } from 'react'\nimport { useLocation, useHistory } from 'react-router-dom'\nimport type { ExtensionHostApi } from '@looker/extension-sdk'\nimport clone from 'lodash/clone'\nimport type { RouteChangeListenerProps } from './types'\n\nexport const RouteChangeListener: React.FC<RouteChangeListenerProps> = ({\n onPathnameChange,\n onRouteChange,\n extensionHost,\n hostRoute,\n hostRouteState,\n}) => {\n const history = useHistory()\n const location = useLocation()\n\n useEffect(() => {\n if (onPathnameChange) {\n onPathnameChange(location.pathname)\n }\n if (onRouteChange) {\n onRouteChange(location.pathname + location.search, clone(location.state))\n }\n ;(extensionHost as ExtensionHostApi).clientRouteChanged(\n location.pathname + location.search,\n location.state\n )\n }, [location])\n\n useEffect(() => {\n if (hostRoute) {\n history.push(hostRoute, hostRouteState)\n }\n }, [hostRoute])\n return <></>\n}\n"],"file":"RouteChangeListener.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/utils/get_initial_route_entries.ts"],"names":["H","getInitialRouteEntries","initialRouteData","initialEntries","route","routeState","parsePath","state"],"mappings":";;;;;;AA0BA,OAAO,KAAKA,CAAZ,MAAmB,SAAnB;AAGA,OAAO,IAAMC,sBAAsB,GAAIC,gBAAD,IAAkC;AACtE,MAAIC,cAAJ;;AACA,MAAID,gBAAJ,EAAsB;AACpB,QAAM;AAAEE,MAAAA,KAAF;AAASC,MAAAA;AAAT,QAAwBH,gBAA9B;AACAC,IAAAA,cAAc,GAAG,iCAAMH,CAAC,CAACM,SAAF,CAAYF,KAAZ,CAAN;AAA0BG,MAAAA,KAAK,EAAEF;AAAjC,OAAjB;AACD;;AACD,SAAOF,cAAP;AACD,CAPM","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 * as H from 'history'\nimport { RouteData } from '../ExtensionConnector/types'\n\nexport const getInitialRouteEntries = (initialRouteData?: RouteData) => {\n let initialEntries: H.LocationDescriptor[] | undefined\n if (initialRouteData) {\n const { route, routeState } = initialRouteData\n initialEntries = [{ ...H.parsePath(route), state: routeState }]\n }\n return initialEntries\n}\n"],"file":"get_initial_route_entries.js"}
1
+ {"version":3,"sources":["../../../../src/components/utils/get_initial_route_entries.ts"],"names":["H","getInitialRouteEntries","initialRouteData","initialEntries","route","routeState","parsePath","state"],"mappings":";;;;;;AA0BA,OAAO,KAAKA,CAAZ,MAAmB,SAAnB;AAGA,OAAO,IAAMC,sBAAsB,GAAIC,gBAAD,IAAkC;AACtE,MAAIC,cAAJ;;AACA,MAAID,gBAAJ,EAAsB;AACpB,QAAM;AAAEE,MAAAA,KAAF;AAASC,MAAAA;AAAT,QAAwBH,gBAA9B;AACAC,IAAAA,cAAc,GAAG,iCAAMH,CAAC,CAACM,SAAF,CAAYF,KAAZ,CAAN;AAA0BG,MAAAA,KAAK,EAAEF;AAAjC,OAAjB;AACD;;AACD,SAAOF,cAAP;AACD,CAPM","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 * as H from 'history'\nimport type { RouteData } from '../ExtensionConnector/types'\n\nexport const getInitialRouteEntries = (initialRouteData?: RouteData) => {\n let initialEntries: H.LocationDescriptor[] | undefined\n if (initialRouteData) {\n const { route, routeState } = initialRouteData\n initialEntries = [{ ...H.parsePath(route), state: routeState }]\n }\n return initialEntries\n}\n"],"file":"get_initial_route_entries.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/utils/setup_close_popovers.ts"],"names":["setupClosePopoversListener","extensionSDK","onBodyMousedown","closeHostPopovers","body","document","querySelector","addEventListener","removeEventListener"],"mappings":"AA4BA,OAAO,IAAMA,0BAA0B,GAAIC,YAAD,IAAiC;AACzE,MAAMC,eAAe,GAAG,MAAM;AAC5B,QAAID,YAAJ,EAAkB;AAChBA,MAAAA,YAAY,CAACE,iBAAb;AACD;AACF,GAJD;;AAKA,MAAMC,IAAwC,GAC5CC,QAAQ,CAACC,aAAT,CAAuB,MAAvB,CADF;;AAEA,MAAIF,IAAJ,EAAU;AACRA,IAAAA,IAAI,CAACG,gBAAL,CAAsB,WAAtB,EAAmCL,eAAnC;AACD;;AACD,SAAO,MAAM;AACX,QAAIE,IAAJ,EAAU;AACRA,MAAAA,IAAI,CAACI,mBAAL,CAAyB,WAAzB,EAAsCN,eAAtC;AACD;AACF,GAJD;AAKD,CAhBM","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 { ExtensionSDK } from '@looker/extension-sdk'\n\nexport const setupClosePopoversListener = (extensionSDK?: ExtensionSDK) => {\n const onBodyMousedown = () => {\n if (extensionSDK) {\n extensionSDK.closeHostPopovers()\n }\n }\n const body: HTMLBodyElement | undefined | null =\n document.querySelector('body')\n if (body) {\n body.addEventListener('mousedown', onBodyMousedown)\n }\n return () => {\n if (body) {\n body.removeEventListener('mousedown', onBodyMousedown)\n }\n }\n}\n"],"file":"setup_close_popovers.js"}
1
+ {"version":3,"sources":["../../../../src/components/utils/setup_close_popovers.ts"],"names":["setupClosePopoversListener","extensionSDK","onBodyMousedown","closeHostPopovers","body","document","querySelector","addEventListener","removeEventListener"],"mappings":"AA4BA,OAAO,IAAMA,0BAA0B,GAAIC,YAAD,IAAiC;AACzE,MAAMC,eAAe,GAAG,MAAM;AAC5B,QAAID,YAAJ,EAAkB;AAChBA,MAAAA,YAAY,CAACE,iBAAb;AACD;AACF,GAJD;;AAKA,MAAMC,IAAwC,GAC5CC,QAAQ,CAACC,aAAT,CAAuB,MAAvB,CADF;;AAEA,MAAIF,IAAJ,EAAU;AACRA,IAAAA,IAAI,CAACG,gBAAL,CAAsB,WAAtB,EAAmCL,eAAnC;AACD;;AACD,SAAO,MAAM;AACX,QAAIE,IAAJ,EAAU;AACRA,MAAAA,IAAI,CAACI,mBAAL,CAAyB,WAAzB,EAAsCN,eAAtC;AACD;AACF,GAJD;AAKD,CAhBM","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 { ExtensionSDK } from '@looker/extension-sdk'\n\nexport const setupClosePopoversListener = (extensionSDK?: ExtensionSDK) => {\n const onBodyMousedown = () => {\n if (extensionSDK) {\n extensionSDK.closeHostPopovers()\n }\n }\n const body: HTMLBodyElement | undefined | null =\n document.querySelector('body')\n if (body) {\n body.addEventListener('mousedown', onBodyMousedown)\n }\n return () => {\n if (body) {\n body.removeEventListener('mousedown', onBodyMousedown)\n }\n }\n}\n"],"file":"setup_close_popovers.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/sdk/core_sdk_31.ts"],"names":["_core31SDK","registerCore31SDK","coreSDK","Error","unregisterCore31SDK","undefined","getCore31SDK"],"mappings":"AA4BA,IAAIA,UAAJ;;AAQA,OAAO,IAAMC,iBAAiB,GAAIC,OAAD,IAA0B;AACzD,MAAIF,UAAJ,EAAgB;AACd,UAAM,IAAIG,KAAJ,CAAU,qCAAV,CAAN;AACD;;AACDH,EAAAA,UAAU,GAAGE,OAAb;AACD,CALM;AAYP,OAAO,IAAME,mBAAmB,GAAG,MAAOJ,UAAU,GAAGK,SAAhD;AAKP,OAAO,IAAMC,YAAY,GAAG,MAAM;AAChC,MAAI,CAACN,UAAL,EAAiB;AACf,UAAM,IAAIG,KAAJ,CAAU,wCAAV,CAAN;AACD;;AACD,SAAOH,UAAP;AACD,CALM","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 { Looker31SDK } from '@looker/sdk'\n\nlet _core31SDK: Looker31SDK | undefined\n\n/**\n * Register the core 3.1 SDK. The ExtensionProvider will automatically\n * call this when connection with the host suceeds. An extension using\n * the ExtensionProvider should never call this.\n * @param coreSDK core sdk\n */\nexport const registerCore31SDK = (coreSDK: Looker31SDK) => {\n if (_core31SDK) {\n throw new Error('coreSDK can only be registered once')\n }\n _core31SDK = coreSDK\n}\n\n/**\n * Unregister the core 3.1 SDK. The ExtensionProvider will automatically\n * call this when it is unloaded. An extension using\n * the ExtensionProvider should never call this.\n */\nexport const unregisterCore31SDK = () => (_core31SDK = undefined)\n\n/**\n * Global access to the coreSDK. An error will be thrown if accessed prematurely.\n */\nexport const getCore31SDK = () => {\n if (!_core31SDK) {\n throw new Error('Looker host connection not established')\n }\n return _core31SDK\n}\n"],"file":"core_sdk_31.js"}
1
+ {"version":3,"sources":["../../../src/sdk/core_sdk_31.ts"],"names":["_core31SDK","registerCore31SDK","coreSDK","Error","unregisterCore31SDK","undefined","getCore31SDK"],"mappings":"AA4BA,IAAIA,UAAJ;;AAQA,OAAO,IAAMC,iBAAiB,GAAIC,OAAD,IAA0B;AACzD,MAAIF,UAAJ,EAAgB;AACd,UAAM,IAAIG,KAAJ,CAAU,qCAAV,CAAN;AACD;;AACDH,EAAAA,UAAU,GAAGE,OAAb;AACD,CALM;AAYP,OAAO,IAAME,mBAAmB,GAAG,MAAOJ,UAAU,GAAGK,SAAhD;AAKP,OAAO,IAAMC,YAAY,GAAG,MAAM;AAChC,MAAI,CAACN,UAAL,EAAiB;AACf,UAAM,IAAIG,KAAJ,CAAU,wCAAV,CAAN;AACD;;AACD,SAAOH,UAAP;AACD,CALM","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 { Looker31SDK } from '@looker/sdk'\n\nlet _core31SDK: Looker31SDK | undefined\n\n/**\n * Register the core 3.1 SDK. The ExtensionProvider will automatically\n * call this when connection with the host suceeds. An extension using\n * the ExtensionProvider should never call this.\n * @param coreSDK core sdk\n */\nexport const registerCore31SDK = (coreSDK: Looker31SDK) => {\n if (_core31SDK) {\n throw new Error('coreSDK can only be registered once')\n }\n _core31SDK = coreSDK\n}\n\n/**\n * Unregister the core 3.1 SDK. The ExtensionProvider will automatically\n * call this when it is unloaded. An extension using\n * the ExtensionProvider should never call this.\n */\nexport const unregisterCore31SDK = () => (_core31SDK = undefined)\n\n/**\n * Global access to the coreSDK. An error will be thrown if accessed prematurely.\n */\nexport const getCore31SDK = () => {\n if (!_core31SDK) {\n throw new Error('Looker host connection not established')\n }\n return _core31SDK\n}\n"],"file":"core_sdk_31.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/sdk/core_sdk_40.ts"],"names":["_core40SDK","registerCore40SDK","coreSDK","Error","unregisterCore40SDK","undefined","getCore40SDK"],"mappings":"AA4BA,IAAIA,UAAJ;;AAQA,OAAO,IAAMC,iBAAiB,GAAIC,OAAD,IAA0B;AACzD,MAAIF,UAAJ,EAAgB;AACd,UAAM,IAAIG,KAAJ,CAAU,sCAAV,CAAN;AACD;;AACDH,EAAAA,UAAU,GAAGE,OAAb;AACD,CALM;AAYP,OAAO,IAAME,mBAAmB,GAAG,MAAOJ,UAAU,GAAGK,SAAhD;AAKP,OAAO,IAAMC,YAAY,GAAG,MAAM;AAChC,MAAI,CAACN,UAAL,EAAiB;AACf,UAAM,IAAIG,KAAJ,CAAU,wCAAV,CAAN;AACD;;AACD,SAAOH,UAAP;AACD,CALM","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 { Looker40SDK } from '@looker/sdk'\n\nlet _core40SDK: Looker40SDK | undefined\n\n/**\n * Register the core 4.0 SDK. The ExtensionProvider will automatically\n * call this when connection with the host suceeds. An extension using\n * the ExtensionProvider should never call this.\n * @param coreSDK core sdk\n */\nexport const registerCore40SDK = (coreSDK: Looker40SDK) => {\n if (_core40SDK) {\n throw new Error('coreSDK can only be registered onces')\n }\n _core40SDK = coreSDK\n}\n\n/**\n * Unregister the core 4.0 SDK. The ExtensionProvider will automatically\n * call this when it is unloaded. An extension using\n * the ExtensionProvider should never call this.\n */\nexport const unregisterCore40SDK = () => (_core40SDK = undefined)\n\n/**\n * Global access to the core40SDK. An error will be thrown if accessed prematurely.\n */\nexport const getCore40SDK = () => {\n if (!_core40SDK) {\n throw new Error('Looker host connection not established')\n }\n return _core40SDK\n}\n"],"file":"core_sdk_40.js"}
1
+ {"version":3,"sources":["../../../src/sdk/core_sdk_40.ts"],"names":["_core40SDK","registerCore40SDK","coreSDK","Error","unregisterCore40SDK","undefined","getCore40SDK"],"mappings":"AA4BA,IAAIA,UAAJ;;AAQA,OAAO,IAAMC,iBAAiB,GAAIC,OAAD,IAA0B;AACzD,MAAIF,UAAJ,EAAgB;AACd,UAAM,IAAIG,KAAJ,CAAU,sCAAV,CAAN;AACD;;AACDH,EAAAA,UAAU,GAAGE,OAAb;AACD,CALM;AAYP,OAAO,IAAME,mBAAmB,GAAG,MAAOJ,UAAU,GAAGK,SAAhD;AAKP,OAAO,IAAMC,YAAY,GAAG,MAAM;AAChC,MAAI,CAACN,UAAL,EAAiB;AACf,UAAM,IAAIG,KAAJ,CAAU,wCAAV,CAAN;AACD;;AACD,SAAOH,UAAP;AACD,CALM","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 { Looker40SDK } from '@looker/sdk'\n\nlet _core40SDK: Looker40SDK | undefined\n\n/**\n * Register the core 4.0 SDK. The ExtensionProvider will automatically\n * call this when connection with the host suceeds. An extension using\n * the ExtensionProvider should never call this.\n * @param coreSDK core sdk\n */\nexport const registerCore40SDK = (coreSDK: Looker40SDK) => {\n if (_core40SDK) {\n throw new Error('coreSDK can only be registered onces')\n }\n _core40SDK = coreSDK\n}\n\n/**\n * Unregister the core 4.0 SDK. The ExtensionProvider will automatically\n * call this when it is unloaded. An extension using\n * the ExtensionProvider should never call this.\n */\nexport const unregisterCore40SDK = () => (_core40SDK = undefined)\n\n/**\n * Global access to the core40SDK. An error will be thrown if accessed prematurely.\n */\nexport const getCore40SDK = () => {\n if (!_core40SDK) {\n throw new Error('Looker host connection not established')\n }\n return _core40SDK\n}\n"],"file":"core_sdk_40.js"}
@@ -1,4 +1,4 @@
1
- import { Looker31SDK } from '@looker/sdk';
1
+ import type { Looker31SDK } from '@looker/sdk';
2
2
  export declare const registerCore31SDK: (coreSDK: Looker31SDK) => void;
3
3
  export declare const unregisterCore31SDK: () => undefined;
4
4
  export declare const getCore31SDK: () => Looker31SDK;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/sdk/core_sdk_31.ts"],"names":["_core31SDK","registerCore31SDK","coreSDK","Error","unregisterCore31SDK","undefined","getCore31SDK"],"mappings":";;;;;;;AA4BA,IAAIA,UAAJ;;AAQO,IAAMC,iBAAiB,GAAIC,OAAD,IAA0B;AACzD,MAAIF,UAAJ,EAAgB;AACd,UAAM,IAAIG,KAAJ,CAAU,qCAAV,CAAN;AACD;;AACDH,EAAAA,UAAU,GAAGE,OAAb;AACD,CALM;;;;AAYA,IAAME,mBAAmB,GAAG,MAAOJ,UAAU,GAAGK,SAAhD;;;;AAKA,IAAMC,YAAY,GAAG,MAAM;AAChC,MAAI,CAACN,UAAL,EAAiB;AACf,UAAM,IAAIG,KAAJ,CAAU,wCAAV,CAAN;AACD;;AACD,SAAOH,UAAP;AACD,CALM","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 { Looker31SDK } from '@looker/sdk'\n\nlet _core31SDK: Looker31SDK | undefined\n\n/**\n * Register the core 3.1 SDK. The ExtensionProvider will automatically\n * call this when connection with the host suceeds. An extension using\n * the ExtensionProvider should never call this.\n * @param coreSDK core sdk\n */\nexport const registerCore31SDK = (coreSDK: Looker31SDK) => {\n if (_core31SDK) {\n throw new Error('coreSDK can only be registered once')\n }\n _core31SDK = coreSDK\n}\n\n/**\n * Unregister the core 3.1 SDK. The ExtensionProvider will automatically\n * call this when it is unloaded. An extension using\n * the ExtensionProvider should never call this.\n */\nexport const unregisterCore31SDK = () => (_core31SDK = undefined)\n\n/**\n * Global access to the coreSDK. An error will be thrown if accessed prematurely.\n */\nexport const getCore31SDK = () => {\n if (!_core31SDK) {\n throw new Error('Looker host connection not established')\n }\n return _core31SDK\n}\n"],"file":"core_sdk_31.js"}
1
+ {"version":3,"sources":["../../src/sdk/core_sdk_31.ts"],"names":["_core31SDK","registerCore31SDK","coreSDK","Error","unregisterCore31SDK","undefined","getCore31SDK"],"mappings":";;;;;;;AA4BA,IAAIA,UAAJ;;AAQO,IAAMC,iBAAiB,GAAIC,OAAD,IAA0B;AACzD,MAAIF,UAAJ,EAAgB;AACd,UAAM,IAAIG,KAAJ,CAAU,qCAAV,CAAN;AACD;;AACDH,EAAAA,UAAU,GAAGE,OAAb;AACD,CALM;;;;AAYA,IAAME,mBAAmB,GAAG,MAAOJ,UAAU,GAAGK,SAAhD;;;;AAKA,IAAMC,YAAY,GAAG,MAAM;AAChC,MAAI,CAACN,UAAL,EAAiB;AACf,UAAM,IAAIG,KAAJ,CAAU,wCAAV,CAAN;AACD;;AACD,SAAOH,UAAP;AACD,CALM","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 { Looker31SDK } from '@looker/sdk'\n\nlet _core31SDK: Looker31SDK | undefined\n\n/**\n * Register the core 3.1 SDK. The ExtensionProvider will automatically\n * call this when connection with the host suceeds. An extension using\n * the ExtensionProvider should never call this.\n * @param coreSDK core sdk\n */\nexport const registerCore31SDK = (coreSDK: Looker31SDK) => {\n if (_core31SDK) {\n throw new Error('coreSDK can only be registered once')\n }\n _core31SDK = coreSDK\n}\n\n/**\n * Unregister the core 3.1 SDK. The ExtensionProvider will automatically\n * call this when it is unloaded. An extension using\n * the ExtensionProvider should never call this.\n */\nexport const unregisterCore31SDK = () => (_core31SDK = undefined)\n\n/**\n * Global access to the coreSDK. An error will be thrown if accessed prematurely.\n */\nexport const getCore31SDK = () => {\n if (!_core31SDK) {\n throw new Error('Looker host connection not established')\n }\n return _core31SDK\n}\n"],"file":"core_sdk_31.js"}
@@ -1,4 +1,4 @@
1
- import { Looker40SDK } from '@looker/sdk';
1
+ import type { Looker40SDK } from '@looker/sdk';
2
2
  export declare const registerCore40SDK: (coreSDK: Looker40SDK) => void;
3
3
  export declare const unregisterCore40SDK: () => undefined;
4
4
  export declare const getCore40SDK: () => Looker40SDK;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/sdk/core_sdk_40.ts"],"names":["_core40SDK","registerCore40SDK","coreSDK","Error","unregisterCore40SDK","undefined","getCore40SDK"],"mappings":";;;;;;;AA4BA,IAAIA,UAAJ;;AAQO,IAAMC,iBAAiB,GAAIC,OAAD,IAA0B;AACzD,MAAIF,UAAJ,EAAgB;AACd,UAAM,IAAIG,KAAJ,CAAU,sCAAV,CAAN;AACD;;AACDH,EAAAA,UAAU,GAAGE,OAAb;AACD,CALM;;;;AAYA,IAAME,mBAAmB,GAAG,MAAOJ,UAAU,GAAGK,SAAhD;;;;AAKA,IAAMC,YAAY,GAAG,MAAM;AAChC,MAAI,CAACN,UAAL,EAAiB;AACf,UAAM,IAAIG,KAAJ,CAAU,wCAAV,CAAN;AACD;;AACD,SAAOH,UAAP;AACD,CALM","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 { Looker40SDK } from '@looker/sdk'\n\nlet _core40SDK: Looker40SDK | undefined\n\n/**\n * Register the core 4.0 SDK. The ExtensionProvider will automatically\n * call this when connection with the host suceeds. An extension using\n * the ExtensionProvider should never call this.\n * @param coreSDK core sdk\n */\nexport const registerCore40SDK = (coreSDK: Looker40SDK) => {\n if (_core40SDK) {\n throw new Error('coreSDK can only be registered onces')\n }\n _core40SDK = coreSDK\n}\n\n/**\n * Unregister the core 4.0 SDK. The ExtensionProvider will automatically\n * call this when it is unloaded. An extension using\n * the ExtensionProvider should never call this.\n */\nexport const unregisterCore40SDK = () => (_core40SDK = undefined)\n\n/**\n * Global access to the core40SDK. An error will be thrown if accessed prematurely.\n */\nexport const getCore40SDK = () => {\n if (!_core40SDK) {\n throw new Error('Looker host connection not established')\n }\n return _core40SDK\n}\n"],"file":"core_sdk_40.js"}
1
+ {"version":3,"sources":["../../src/sdk/core_sdk_40.ts"],"names":["_core40SDK","registerCore40SDK","coreSDK","Error","unregisterCore40SDK","undefined","getCore40SDK"],"mappings":";;;;;;;AA4BA,IAAIA,UAAJ;;AAQO,IAAMC,iBAAiB,GAAIC,OAAD,IAA0B;AACzD,MAAIF,UAAJ,EAAgB;AACd,UAAM,IAAIG,KAAJ,CAAU,sCAAV,CAAN;AACD;;AACDH,EAAAA,UAAU,GAAGE,OAAb;AACD,CALM;;;;AAYA,IAAME,mBAAmB,GAAG,MAAOJ,UAAU,GAAGK,SAAhD;;;;AAKA,IAAMC,YAAY,GAAG,MAAM;AAChC,MAAI,CAACN,UAAL,EAAiB;AACf,UAAM,IAAIG,KAAJ,CAAU,wCAAV,CAAN;AACD;;AACD,SAAOH,UAAP;AACD,CALM","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 { Looker40SDK } from '@looker/sdk'\n\nlet _core40SDK: Looker40SDK | undefined\n\n/**\n * Register the core 4.0 SDK. The ExtensionProvider will automatically\n * call this when connection with the host suceeds. An extension using\n * the ExtensionProvider should never call this.\n * @param coreSDK core sdk\n */\nexport const registerCore40SDK = (coreSDK: Looker40SDK) => {\n if (_core40SDK) {\n throw new Error('coreSDK can only be registered onces')\n }\n _core40SDK = coreSDK\n}\n\n/**\n * Unregister the core 4.0 SDK. The ExtensionProvider will automatically\n * call this when it is unloaded. An extension using\n * the ExtensionProvider should never call this.\n */\nexport const unregisterCore40SDK = () => (_core40SDK = undefined)\n\n/**\n * Global access to the core40SDK. An error will be thrown if accessed prematurely.\n */\nexport const getCore40SDK = () => {\n if (!_core40SDK) {\n throw new Error('Looker host connection not established')\n }\n return _core40SDK\n}\n"],"file":"core_sdk_40.js"}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@looker/extension-sdk-react",
3
- "version": "21.14.0",
3
+ "version": "21.20.1",
4
4
  "description": "Looker Extension SDK for React",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",
7
- "sideEffects": "false",
7
+ "sideEffects": false,
8
8
  "typings": "lib/index.d.ts",
9
9
  "files": [
10
10
  "lib"
@@ -16,7 +16,7 @@
16
16
  "repository": {
17
17
  "type": "git",
18
18
  "url": "git+https://github.com/looker-open-source/sdk-codegen.git",
19
- "directory": "packages/sdk-rtl"
19
+ "directory": "packages/extension-sdk-react"
20
20
  },
21
21
  "author": "Looker",
22
22
  "license": "MIT",
@@ -43,9 +43,9 @@
43
43
  "react-router-dom": "^5.1.2"
44
44
  },
45
45
  "dependencies": {
46
- "@looker/extension-sdk": "^21.14.0",
47
- "@looker/sdk": "^21.14.0",
48
- "@looker/sdk-rtl": "^21.0.20",
46
+ "@looker/extension-sdk": "^21.20.1",
47
+ "@looker/sdk": "^21.20.1",
48
+ "@looker/sdk-rtl": "^21.3.1",
49
49
  "history": "^4.9.0",
50
50
  "lodash": "^4.17.20"
51
51
  },
@@ -58,5 +58,5 @@
58
58
  "Looker",
59
59
  "extension-sdk"
60
60
  ],
61
- "gitHead": "7ef973a011fba2ef9c587578165ba78e8c03f921"
61
+ "gitHead": "86e7173f6c9e7b50f6b6474bafdf5780183152db"
62
62
  }