@looker/extension-utils 0.1.20-alpha.1650 → 0.1.20

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 (58) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/lib/APIErrorDisplay/APIErrorContent.js +0 -15
  3. package/lib/APIErrorDisplay/APIErrorContent.js.map +1 -1
  4. package/lib/APIErrorDisplay/APIErrorDetails.js +0 -5
  5. package/lib/APIErrorDisplay/APIErrorDetails.js.map +1 -1
  6. package/lib/APIErrorDisplay/APIErrorDialog.js +0 -7
  7. package/lib/APIErrorDisplay/APIErrorDialog.js.map +1 -1
  8. package/lib/APIErrorDisplay/APIErrorDisplay.js +0 -7
  9. package/lib/APIErrorDisplay/APIErrorDisplay.js.map +1 -1
  10. package/lib/APIErrorDisplay/APIErrorDocLink.js +0 -8
  11. package/lib/APIErrorDisplay/APIErrorDocLink.js.map +1 -1
  12. package/lib/APIErrorDisplay/index.js +0 -5
  13. package/lib/APIErrorDisplay/index.js.map +1 -1
  14. package/lib/APIErrorDisplay/utils.js +1 -10
  15. package/lib/APIErrorDisplay/utils.js.map +1 -1
  16. package/lib/ExtMarkdown.js +0 -8
  17. package/lib/ExtMarkdown.js.map +1 -1
  18. package/lib/OAuthScene.js +0 -14
  19. package/lib/OAuthScene.js.map +1 -1
  20. package/lib/adaptorUtils.js +1 -17
  21. package/lib/adaptorUtils.js.map +1 -1
  22. package/lib/authUtils.js +5 -23
  23. package/lib/authUtils.js.map +1 -1
  24. package/lib/browserAdaptor.js +4 -26
  25. package/lib/browserAdaptor.js.map +1 -1
  26. package/lib/esm/APIErrorDisplay/APIErrorContent.js +25 -20
  27. package/lib/esm/APIErrorDisplay/APIErrorContent.js.map +1 -1
  28. package/lib/esm/APIErrorDisplay/APIErrorDetails.js +21 -13
  29. package/lib/esm/APIErrorDisplay/APIErrorDetails.js.map +1 -1
  30. package/lib/esm/APIErrorDisplay/APIErrorDialog.js +18 -10
  31. package/lib/esm/APIErrorDisplay/APIErrorDialog.js.map +1 -1
  32. package/lib/esm/APIErrorDisplay/APIErrorDisplay.js +15 -7
  33. package/lib/esm/APIErrorDisplay/APIErrorDisplay.js.map +1 -1
  34. package/lib/esm/APIErrorDisplay/APIErrorDocLink.js +15 -9
  35. package/lib/esm/APIErrorDisplay/APIErrorDocLink.js.map +1 -1
  36. package/lib/esm/APIErrorDisplay/index.js +39 -3
  37. package/lib/esm/APIErrorDisplay/index.js.map +1 -1
  38. package/lib/esm/APIErrorDisplay/utils.js +10 -7
  39. package/lib/esm/APIErrorDisplay/utils.js.map +1 -1
  40. package/lib/esm/ExtMarkdown.js +14 -8
  41. package/lib/esm/ExtMarkdown.js.map +1 -1
  42. package/lib/esm/OAuthScene.js +23 -20
  43. package/lib/esm/OAuthScene.js.map +1 -1
  44. package/lib/esm/adaptorUtils.js +22 -10
  45. package/lib/esm/adaptorUtils.js.map +1 -1
  46. package/lib/esm/authUtils.js +14 -22
  47. package/lib/esm/authUtils.js.map +1 -1
  48. package/lib/esm/browserAdaptor.js +15 -24
  49. package/lib/esm/browserAdaptor.js.map +1 -1
  50. package/lib/esm/extensionAdaptor.js +15 -26
  51. package/lib/esm/extensionAdaptor.js.map +1 -1
  52. package/lib/esm/index.js +82 -7
  53. package/lib/esm/index.js.map +1 -1
  54. package/lib/extensionAdaptor.js +4 -28
  55. package/lib/extensionAdaptor.js.map +1 -1
  56. package/lib/index.js +0 -14
  57. package/lib/index.js.map +1 -1
  58. package/package.json +8 -9
@@ -1,4 +1,40 @@
1
- export * from './APIErrorDialog';
2
- export * from './APIErrorDisplay';
3
- export { apiErrorDisplayFetch } from './utils';
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ apiErrorDisplayFetch: true
8
+ };
9
+ Object.defineProperty(exports, "apiErrorDisplayFetch", {
10
+ enumerable: true,
11
+ get: function get() {
12
+ return _utils.apiErrorDisplayFetch;
13
+ }
14
+ });
15
+ var _APIErrorDialog = require("./APIErrorDialog");
16
+ Object.keys(_APIErrorDialog).forEach(function (key) {
17
+ if (key === "default" || key === "__esModule") return;
18
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
19
+ if (key in exports && exports[key] === _APIErrorDialog[key]) return;
20
+ Object.defineProperty(exports, key, {
21
+ enumerable: true,
22
+ get: function get() {
23
+ return _APIErrorDialog[key];
24
+ }
25
+ });
26
+ });
27
+ var _APIErrorDisplay = require("./APIErrorDisplay");
28
+ Object.keys(_APIErrorDisplay).forEach(function (key) {
29
+ if (key === "default" || key === "__esModule") return;
30
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
31
+ if (key in exports && exports[key] === _APIErrorDisplay[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function get() {
35
+ return _APIErrorDisplay[key];
36
+ }
37
+ });
38
+ });
39
+ var _utils = require("./utils");
4
40
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/APIErrorDisplay/index.ts"],"names":["apiErrorDisplayFetch"],"mappings":"AA0BA,cAAc,kBAAd;AACA,cAAc,mBAAd;AACA,SAASA,oBAAT,QAAqC,SAArC","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2022 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './APIErrorDialog'\nexport * from './APIErrorDisplay'\nexport { apiErrorDisplayFetch } from './utils'\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/APIErrorDisplay/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2022 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './APIErrorDialog'\nexport * from './APIErrorDisplay'\nexport { apiErrorDisplayFetch } from './utils'\n"],"mappings":";;;;;;;;;;;;;;AA0BA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA"}
@@ -1,25 +1,28 @@
1
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
1
+ "use strict";
2
2
 
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.errorHeading = exports.apiErrorDisplayFetch = void 0;
7
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
3
8
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
4
-
5
- export var errorHeading = error => error.message || 'Unknown error';
6
- export var apiErrorDisplayFetch = function () {
9
+ var errorHeading = error => error.message || 'Unknown error';
10
+ exports.errorHeading = errorHeading;
11
+ var apiErrorDisplayFetch = function () {
7
12
  var _ref = _asyncToGenerator(function* (_sdk, url) {
8
13
  var fetched = yield fetch(url, {
9
14
  mode: 'cors'
10
15
  });
11
16
  var result = yield fetched.text();
12
17
  var stop = result.indexOf('## API Response Type');
13
-
14
18
  if (stop > 0) {
15
19
  result = result.substring(0, stop - 1).trim();
16
20
  }
17
-
18
21
  return result;
19
22
  });
20
-
21
23
  return function apiErrorDisplayFetch(_x, _x2) {
22
24
  return _ref.apply(this, arguments);
23
25
  };
24
26
  }();
27
+ exports.apiErrorDisplayFetch = apiErrorDisplayFetch;
25
28
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/APIErrorDisplay/utils.ts"],"names":["errorHeading","error","message","apiErrorDisplayFetch","_sdk","url","fetched","fetch","mode","result","text","stop","indexOf","substring","trim"],"mappings":";;;;AAgCA,OAAO,IAAMA,YAAY,GAAIC,KAAD,IAC1BA,KAAK,CAACC,OAAN,IAAiB,eADZ;AASP,OAAO,IAAMC,oBAAoB;AAAA,+BAAG,WAAOC,IAAP,EAA0BC,GAA1B,EAA0C;AAC5E,QAAMC,OAAO,SAASC,KAAK,CAACF,GAAD,EAAM;AAAEG,MAAAA,IAAI,EAAE;AAAR,KAAN,CAA3B;AACA,QAAIC,MAAM,SAASH,OAAO,CAACI,IAAR,EAAnB;AACA,QAAMC,IAAI,GAAGF,MAAM,CAACG,OAAP,CAAe,sBAAf,CAAb;;AACA,QAAID,IAAI,GAAG,CAAX,EAAc;AACZF,MAAAA,MAAM,GAAGA,MAAM,CAACI,SAAP,CAAiB,CAAjB,EAAoBF,IAAI,GAAG,CAA3B,EAA8BG,IAA9B,EAAT;AACD;;AACD,WAAOL,MAAP;AACD,GARgC;;AAAA,kBAApBN,oBAAoB;AAAA;AAAA;AAAA,GAA1B","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2022 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 { LookerSDKError, IAPIMethods } from '@looker/sdk-rtl'\n\n/**\n * Default the heading to 'Unknown error' if error.message is blank for any reason\n * @param error for heading\n */\nexport const errorHeading = (error: LookerSDKError) =>\n error.message || 'Unknown error'\n\n/**\n * this callback function used by the ErrorDoc constructor gets and truncates\n * API error documents for use within API Explorer\n * @param _sdk required as a parameter, but it's ignored in this function\n * @param url of document (either index.json or md) to fetch\n */\nexport const apiErrorDisplayFetch = async (_sdk: IAPIMethods, url: string) => {\n const fetched = await fetch(url, { mode: 'cors' })\n let result = await fetched.text()\n const stop = result.indexOf('## API Response Type')\n if (stop > 0) {\n result = result.substring(0, stop - 1).trim()\n }\n return result\n}\n"],"file":"utils.js"}
1
+ {"version":3,"file":"utils.js","names":["errorHeading","error","message","apiErrorDisplayFetch","_sdk","url","fetched","fetch","mode","result","text","stop","indexOf","substring","trim"],"sources":["../../../src/APIErrorDisplay/utils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2022 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 { LookerSDKError, IAPIMethods } from '@looker/sdk-rtl'\n\n/**\n * Default the heading to 'Unknown error' if error.message is blank for any reason\n * @param error for heading\n */\nexport const errorHeading = (error: LookerSDKError) =>\n error.message || 'Unknown error'\n\n/**\n * this callback function used by the ErrorDoc constructor gets and truncates\n * API error documents for use within API Explorer\n * @param _sdk required as a parameter, but it's ignored in this function\n * @param url of document (either index.json or md) to fetch\n */\nexport const apiErrorDisplayFetch = async (_sdk: IAPIMethods, url: string) => {\n const fetched = await fetch(url, { mode: 'cors' })\n let result = await fetched.text()\n const stop = result.indexOf('## API Response Type')\n if (stop > 0) {\n result = result.substring(0, stop - 1).trim()\n }\n return result\n}\n"],"mappings":";;;;;;;;AAgCO,IAAMA,YAAY,GAAIC,KAAqB,IAChDA,KAAK,CAACC,OAAO,IAAI,eAAe;AAAA;AAQ3B,IAAMC,oBAAoB;EAAA,6BAAG,WAAOC,IAAiB,EAAEC,GAAW,EAAK;IAC5E,IAAMC,OAAO,SAASC,KAAK,CAACF,GAAG,EAAE;MAAEG,IAAI,EAAE;IAAO,CAAC,CAAC;IAClD,IAAIC,MAAM,SAASH,OAAO,CAACI,IAAI,EAAE;IACjC,IAAMC,IAAI,GAAGF,MAAM,CAACG,OAAO,CAAC,sBAAsB,CAAC;IACnD,IAAID,IAAI,GAAG,CAAC,EAAE;MACZF,MAAM,GAAGA,MAAM,CAACI,SAAS,CAAC,CAAC,EAAEF,IAAI,GAAG,CAAC,CAAC,CAACG,IAAI,EAAE;IAC/C;IACA,OAAOL,MAAM;EACf,CAAC;EAAA,gBARYN,oBAAoB;IAAA;EAAA;AAAA,GAQhC;AAAA"}
@@ -1,7 +1,14 @@
1
- import React from 'react';
2
- import { Markdown } from '@looker/code-editor';
3
- import { getEnvAdaptor } from './adaptorUtils';
4
- export var ExtMarkdown = _ref => {
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ExtMarkdown = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _codeEditor = require("@looker/code-editor");
9
+ var _adaptorUtils = require("./adaptorUtils");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ var ExtMarkdown = _ref => {
5
12
  var {
6
13
  source,
7
14
  pattern = '',
@@ -9,13 +16,11 @@ export var ExtMarkdown = _ref => {
9
16
  linkClickHandler,
10
17
  paragraphOverride
11
18
  } = _ref;
12
-
13
19
  var openBrowserWindow = (_pathname, href) => {
14
- var adaptor = getEnvAdaptor();
20
+ var adaptor = (0, _adaptorUtils.getEnvAdaptor)();
15
21
  adaptor.openBrowserWindow(href);
16
22
  };
17
-
18
- return React.createElement(Markdown, {
23
+ return _react.default.createElement(_codeEditor.Markdown, {
19
24
  source: source,
20
25
  pattern: pattern,
21
26
  transformLinkUri: transformLinkUri,
@@ -23,4 +28,5 @@ export var ExtMarkdown = _ref => {
23
28
  paragraphOverride: paragraphOverride
24
29
  });
25
30
  };
31
+ exports.ExtMarkdown = ExtMarkdown;
26
32
  //# sourceMappingURL=ExtMarkdown.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ExtMarkdown.tsx"],"names":["React","Markdown","getEnvAdaptor","ExtMarkdown","source","pattern","transformLinkUri","linkClickHandler","paragraphOverride","openBrowserWindow","_pathname","href","adaptor"],"mappings":"AA2BA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,QAAT,QAAyB,qBAAzB;AACA,SAASC,aAAT,QAA8B,gBAA9B;AAkBA,OAAO,IAAMC,WAAiC,GAAG,QAM3C;AAAA,MAN4C;AAChDC,IAAAA,MADgD;AAEhDC,IAAAA,OAAO,GAAG,EAFsC;AAGhDC,IAAAA,gBAHgD;AAIhDC,IAAAA,gBAJgD;AAKhDC,IAAAA;AALgD,GAM5C;;AACJ,MAAMC,iBAAiB,GAAG,CAACC,SAAD,EAAoBC,IAApB,KAAqC;AAC7D,QAAMC,OAAO,GAAGV,aAAa,EAA7B;AACAU,IAAAA,OAAO,CAACH,iBAAR,CAA0BE,IAA1B;AACD,GAHD;;AAKA,SACE,oBAAC,QAAD;AACE,IAAA,MAAM,EAAEP,MADV;AAEE,IAAA,OAAO,EAAEC,OAFX;AAGE,IAAA,gBAAgB,EAAEC,gBAHpB;AAIE,IAAA,gBAAgB,EAAEC,gBAAgB,IAAIE,iBAJxC;AAKE,IAAA,iBAAiB,EAAED;AALrB,IADF;AASD,CArBM","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { FC, ReactNode } from 'react'\nimport React from 'react'\nimport { Markdown } from '@looker/code-editor'\nimport { getEnvAdaptor } from './adaptorUtils'\n\ninterface ExtMarkdownProps {\n source: string\n pattern?: string\n transformLinkUri?: (url: string) => string\n linkClickHandler?: (pathname: string, href: string) => void\n paragraphOverride?: ({ children }: { children: ReactNode }) => ReactNode\n}\n\n/**\n * Simple wrapper on the standard Markdown component to handle link clicks in an extension\n * @param source markdown to render\n * @param pattern search pattern\n * @param transformLinkUri link pattern transformer override\n * @param linkClickHandler defaults to ExtensionSDK.openBrowserWindow()\n * @param paragraphOverride override paragraph display handling\n */\nexport const ExtMarkdown: FC<ExtMarkdownProps> = ({\n source,\n pattern = '',\n transformLinkUri,\n linkClickHandler,\n paragraphOverride,\n}) => {\n const openBrowserWindow = (_pathname: string, href: string) => {\n const adaptor = getEnvAdaptor()\n adaptor.openBrowserWindow(href)\n }\n\n return (\n <Markdown\n source={source}\n pattern={pattern}\n transformLinkUri={transformLinkUri}\n linkClickHandler={linkClickHandler || openBrowserWindow}\n paragraphOverride={paragraphOverride}\n />\n )\n}\n"],"file":"ExtMarkdown.js"}
1
+ {"version":3,"file":"ExtMarkdown.js","names":["ExtMarkdown","source","pattern","transformLinkUri","linkClickHandler","paragraphOverride","openBrowserWindow","_pathname","href","adaptor","getEnvAdaptor"],"sources":["../../src/ExtMarkdown.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { FC, ReactNode } from 'react'\nimport React from 'react'\nimport { Markdown } from '@looker/code-editor'\nimport { getEnvAdaptor } from './adaptorUtils'\n\ninterface ExtMarkdownProps {\n source: string\n pattern?: string\n transformLinkUri?: (url: string) => string\n linkClickHandler?: (pathname: string, href: string) => void\n paragraphOverride?: ({ children }: { children: ReactNode }) => ReactNode\n}\n\n/**\n * Simple wrapper on the standard Markdown component to handle link clicks in an extension\n * @param source markdown to render\n * @param pattern search pattern\n * @param transformLinkUri link pattern transformer override\n * @param linkClickHandler defaults to ExtensionSDK.openBrowserWindow()\n * @param paragraphOverride override paragraph display handling\n */\nexport const ExtMarkdown: FC<ExtMarkdownProps> = ({\n source,\n pattern = '',\n transformLinkUri,\n linkClickHandler,\n paragraphOverride,\n}) => {\n const openBrowserWindow = (_pathname: string, href: string) => {\n const adaptor = getEnvAdaptor()\n adaptor.openBrowserWindow(href)\n }\n\n return (\n <Markdown\n source={source}\n pattern={pattern}\n transformLinkUri={transformLinkUri}\n linkClickHandler={linkClickHandler || openBrowserWindow}\n paragraphOverride={paragraphOverride}\n />\n )\n}\n"],"mappings":";;;;;;AA2BA;AACA;AACA;AAA8C;AAkBvC,IAAMA,WAAiC,GAAG,QAM3C;EAAA,IAN4C;IAChDC,MAAM;IACNC,OAAO,GAAG,EAAE;IACZC,gBAAgB;IAChBC,gBAAgB;IAChBC;EACF,CAAC;EACC,IAAMC,iBAAiB,GAAG,CAACC,SAAiB,EAAEC,IAAY,KAAK;IAC7D,IAAMC,OAAO,GAAG,IAAAC,2BAAa,GAAE;IAC/BD,OAAO,CAACH,iBAAiB,CAACE,IAAI,CAAC;EACjC,CAAC;EAED,OACE,6BAAC,oBAAQ;IACP,MAAM,EAAEP,MAAO;IACf,OAAO,EAAEC,OAAQ;IACjB,gBAAgB,EAAEC,gBAAiB;IACnC,gBAAgB,EAAEC,gBAAgB,IAAIE,iBAAkB;IACxD,iBAAiB,EAAED;EAAkB,EACrC;AAEN,CAAC;AAAA"}
@@ -1,30 +1,34 @@
1
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
1
+ "use strict";
2
2
 
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.OAuthScene = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _components = require("@looker/components");
9
+ var _reactRouter = require("react-router");
10
+ var _reactRouterDom = require("react-router-dom");
11
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
3
14
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
4
-
5
- import React, { useEffect } from 'react';
6
- import { ComponentsProvider, Flex, FlexItem, Heading, ProgressCircular } from '@looker/components';
7
- import { useHistory } from 'react-router';
8
- import { useLocation } from 'react-router-dom';
9
- export var OAuthScene = _ref => {
15
+ var OAuthScene = _ref => {
10
16
  var _authSession$returnUr;
11
-
12
17
  var {
13
18
  adaptor
14
19
  } = _ref;
15
- var history = useHistory();
16
- var location = useLocation();
20
+ var history = (0, _reactRouter.useHistory)();
21
+ var location = (0, _reactRouterDom.useLocation)();
17
22
  var reactPath = location.pathname;
18
23
  var fullPath = window.location.pathname;
19
24
  var extraPath = fullPath.substr(0, fullPath.indexOf(reactPath));
20
25
  var authSession = adaptor.sdk.authSession;
21
26
  var retPath = (_authSession$returnUr = authSession.returnUrl) !== null && _authSession$returnUr !== void 0 ? _authSession$returnUr : '/';
22
27
  var oldUrl = retPath.replace(extraPath, '');
23
- useEffect(() => {
28
+ (0, _react.useEffect)(() => {
24
29
  var maybeLogin = function () {
25
30
  var _ref2 = _asyncToGenerator(function* () {
26
31
  var token = yield adaptor.login();
27
-
28
32
  if (token) {
29
33
  console.error({
30
34
  push: oldUrl,
@@ -35,32 +39,31 @@ export var OAuthScene = _ref => {
35
39
  history.push(oldUrl);
36
40
  }
37
41
  });
38
-
39
42
  return function maybeLogin() {
40
43
  return _ref2.apply(this, arguments);
41
44
  };
42
45
  }();
43
-
44
46
  maybeLogin();
45
47
  }, []);
46
48
  var themeOverrides = adaptor.themeOverrides();
47
- return React.createElement(ComponentsProvider, {
49
+ return _react.default.createElement(_components.ComponentsProvider, {
48
50
  loadGoogleFonts: themeOverrides.loadGoogleFonts,
49
51
  themeCustomizations: themeOverrides.themeCustomizations
50
- }, React.createElement(Flex, {
52
+ }, _react.default.createElement(_components.Flex, {
51
53
  flexDirection: "column",
52
54
  justifyContent: "center",
53
55
  mt: "25%"
54
- }, React.createElement(FlexItem, {
56
+ }, _react.default.createElement(_components.FlexItem, {
55
57
  alignSelf: "center"
56
- }, React.createElement(ProgressCircular, {
58
+ }, _react.default.createElement(_components.ProgressCircular, {
57
59
  size: "large"
58
- })), React.createElement(FlexItem, {
60
+ })), _react.default.createElement(_components.FlexItem, {
59
61
  mt: "large",
60
62
  alignSelf: "center"
61
- }, React.createElement(Heading, {
63
+ }, _react.default.createElement(_components.Heading, {
62
64
  color: "key",
63
65
  as: "h2"
64
66
  }, "Returning to ".concat(oldUrl, " after OAuth login ...")))));
65
67
  };
68
+ exports.OAuthScene = OAuthScene;
66
69
  //# sourceMappingURL=OAuthScene.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/OAuthScene.tsx"],"names":["React","useEffect","ComponentsProvider","Flex","FlexItem","Heading","ProgressCircular","useHistory","useLocation","OAuthScene","adaptor","history","location","reactPath","pathname","fullPath","window","extraPath","substr","indexOf","authSession","sdk","retPath","returnUrl","oldUrl","replace","maybeLogin","token","login","console","error","push","themeOverrides","loadGoogleFonts","themeCustomizations"],"mappings":";;;;AA2BA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AAEA,SACEC,kBADF,EAEEC,IAFF,EAGEC,QAHF,EAIEC,OAJF,EAKEC,gBALF,QAMO,oBANP;AAOA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,WAAT,QAA4B,kBAA5B;AAWA,OAAO,IAAMC,UAA+B,GAAG,QAAiB;AAAA;;AAAA,MAAhB;AAAEC,IAAAA;AAAF,GAAgB;AAC9D,MAAMC,OAAO,GAAGJ,UAAU,EAA1B;AACA,MAAMK,QAAQ,GAAGJ,WAAW,EAA5B;AACA,MAAMK,SAAS,GAAGD,QAAQ,CAACE,QAA3B;AACA,MAAMC,QAAQ,GAAIC,MAAD,CAAgBJ,QAAhB,CAAyBE,QAA1C;AACA,MAAMG,SAAS,GAAGF,QAAQ,CAACG,MAAT,CAAgB,CAAhB,EAAmBH,QAAQ,CAACI,OAAT,CAAiBN,SAAjB,CAAnB,CAAlB;AACA,MAAMO,WAAW,GAAGV,OAAO,CAACW,GAAR,CAAYD,WAAhC;AACA,MAAME,OAAO,4BAAGF,WAAW,CAACG,SAAf,yEAA4B,GAAzC;AAEA,MAAMC,MAAM,GAAGF,OAAO,CAACG,OAAR,CAAgBR,SAAhB,EAA2B,EAA3B,CAAf;AAEAhB,EAAAA,SAAS,CAAC,MAAM;AACd,QAAMyB,UAAU;AAAA,oCAAG,aAAY;AAC7B,YAAMC,KAAK,SAASjB,OAAO,CAACkB,KAAR,EAApB;;AACA,YAAID,KAAJ,EAAW;AACTE,UAAAA,OAAO,CAACC,KAAR,CAAc;AAAEC,YAAAA,IAAI,EAAEP,MAAR;AAAgBF,YAAAA,OAAhB;AAAyBL,YAAAA,SAAzB;AAAoCL,YAAAA;AAApC,WAAd;AACAD,UAAAA,OAAO,CAACoB,IAAR,CAAaP,MAAb;AACD;AACF,OANe;;AAAA,sBAAVE,UAAU;AAAA;AAAA;AAAA,OAAhB;;AAOAA,IAAAA,UAAU;AACX,GATQ,EASN,EATM,CAAT;AAWA,MAAMM,cAAc,GAAGtB,OAAO,CAACsB,cAAR,EAAvB;AACA,SACE,oBAAC,kBAAD;AACE,IAAA,eAAe,EAAEA,cAAc,CAACC,eADlC;AAEE,IAAA,mBAAmB,EAAED,cAAc,CAACE;AAFtC,KAIE,oBAAC,IAAD;AAAM,IAAA,aAAa,EAAC,QAApB;AAA6B,IAAA,cAAc,EAAC,QAA5C;AAAqD,IAAA,EAAE,EAAC;AAAxD,KACE,oBAAC,QAAD;AAAU,IAAA,SAAS,EAAC;AAApB,KACE,oBAAC,gBAAD;AAAkB,IAAA,IAAI,EAAC;AAAvB,IADF,CADF,EAIE,oBAAC,QAAD;AAAU,IAAA,EAAE,EAAC,OAAb;AAAqB,IAAA,SAAS,EAAC;AAA/B,KACE,oBAAC,OAAD;AAAS,IAAA,KAAK,EAAC,KAAf;AAAqB,IAAA,EAAE,EAAC;AAAxB,4BACmBV,MADnB,4BADF,CAJF,CAJF,CADF;AAiBD,CAxCM","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { FC } from 'react'\nimport React, { useEffect } from 'react'\nimport type { BrowserSession } from '@looker/sdk-rtl'\nimport {\n ComponentsProvider,\n Flex,\n FlexItem,\n Heading,\n ProgressCircular,\n} from '@looker/components'\nimport { useHistory } from 'react-router'\nimport { useLocation } from 'react-router-dom'\nimport type { IEnvironmentAdaptor } from './adaptorUtils'\n\ninterface OAuthSceneProps {\n adaptor: IEnvironmentAdaptor\n}\n\n/**\n * OAuth scene for sdk session handling and redirection to OAuth flow initiation\n * route\n */\nexport const OAuthScene: FC<OAuthSceneProps> = ({ adaptor }) => {\n const history = useHistory()\n const location = useLocation()\n const reactPath = location.pathname\n const fullPath = (window as any).location.pathname\n const extraPath = fullPath.substr(0, fullPath.indexOf(reactPath))\n const authSession = adaptor.sdk.authSession as BrowserSession\n const retPath = authSession.returnUrl ?? '/'\n /** If this is a nested React app, remove extraPath to prevent recursive return pathing */\n const oldUrl = retPath.replace(extraPath, '')\n\n useEffect(() => {\n const maybeLogin = async () => {\n const token = await adaptor.login()\n if (token) {\n console.error({ push: oldUrl, retPath, extraPath, location })\n history.push(oldUrl)\n }\n }\n maybeLogin()\n }, [])\n\n const themeOverrides = adaptor.themeOverrides()\n return (\n <ComponentsProvider\n loadGoogleFonts={themeOverrides.loadGoogleFonts}\n themeCustomizations={themeOverrides.themeCustomizations}\n >\n <Flex flexDirection=\"column\" justifyContent=\"center\" mt=\"25%\">\n <FlexItem alignSelf=\"center\">\n <ProgressCircular size=\"large\" />\n </FlexItem>\n <FlexItem mt=\"large\" alignSelf=\"center\">\n <Heading color=\"key\" as=\"h2\">\n {`Returning to ${oldUrl} after OAuth login ...`}\n </Heading>\n </FlexItem>\n </Flex>\n </ComponentsProvider>\n )\n}\n"],"file":"OAuthScene.js"}
1
+ {"version":3,"file":"OAuthScene.js","names":["OAuthScene","adaptor","history","useHistory","location","useLocation","reactPath","pathname","fullPath","window","extraPath","substr","indexOf","authSession","sdk","retPath","returnUrl","oldUrl","replace","useEffect","maybeLogin","token","login","console","error","push","themeOverrides","loadGoogleFonts","themeCustomizations"],"sources":["../../src/OAuthScene.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { FC } from 'react'\nimport React, { useEffect } from 'react'\nimport type { BrowserSession } from '@looker/sdk-rtl'\nimport {\n ComponentsProvider,\n Flex,\n FlexItem,\n Heading,\n ProgressCircular,\n} from '@looker/components'\nimport { useHistory } from 'react-router'\nimport { useLocation } from 'react-router-dom'\nimport type { IEnvironmentAdaptor } from './adaptorUtils'\n\ninterface OAuthSceneProps {\n adaptor: IEnvironmentAdaptor\n}\n\n/**\n * OAuth scene for sdk session handling and redirection to OAuth flow initiation\n * route\n */\nexport const OAuthScene: FC<OAuthSceneProps> = ({ adaptor }) => {\n const history = useHistory()\n const location = useLocation()\n const reactPath = location.pathname\n const fullPath = (window as any).location.pathname\n const extraPath = fullPath.substr(0, fullPath.indexOf(reactPath))\n const authSession = adaptor.sdk.authSession as BrowserSession\n const retPath = authSession.returnUrl ?? '/'\n /** If this is a nested React app, remove extraPath to prevent recursive return pathing */\n const oldUrl = retPath.replace(extraPath, '')\n\n useEffect(() => {\n const maybeLogin = async () => {\n const token = await adaptor.login()\n if (token) {\n console.error({ push: oldUrl, retPath, extraPath, location })\n history.push(oldUrl)\n }\n }\n maybeLogin()\n }, [])\n\n const themeOverrides = adaptor.themeOverrides()\n return (\n <ComponentsProvider\n loadGoogleFonts={themeOverrides.loadGoogleFonts}\n themeCustomizations={themeOverrides.themeCustomizations}\n >\n <Flex flexDirection=\"column\" justifyContent=\"center\" mt=\"25%\">\n <FlexItem alignSelf=\"center\">\n <ProgressCircular size=\"large\" />\n </FlexItem>\n <FlexItem mt=\"large\" alignSelf=\"center\">\n <Heading color=\"key\" as=\"h2\">\n {`Returning to ${oldUrl} after OAuth login ...`}\n </Heading>\n </FlexItem>\n </Flex>\n </ComponentsProvider>\n )\n}\n"],"mappings":";;;;;;AA2BA;AAEA;AAOA;AACA;AAA8C;AAAA;AAAA;AAAA;AAWvC,IAAMA,UAA+B,GAAG,QAAiB;EAAA;EAAA,IAAhB;IAAEC;EAAQ,CAAC;EACzD,IAAMC,OAAO,GAAG,IAAAC,uBAAU,GAAE;EAC5B,IAAMC,QAAQ,GAAG,IAAAC,2BAAW,GAAE;EAC9B,IAAMC,SAAS,GAAGF,QAAQ,CAACG,QAAQ;EACnC,IAAMC,QAAQ,GAAIC,MAAM,CAASL,QAAQ,CAACG,QAAQ;EAClD,IAAMG,SAAS,GAAGF,QAAQ,CAACG,MAAM,CAAC,CAAC,EAAEH,QAAQ,CAACI,OAAO,CAACN,SAAS,CAAC,CAAC;EACjE,IAAMO,WAAW,GAAGZ,OAAO,CAACa,GAAG,CAACD,WAA6B;EAC7D,IAAME,OAAO,4BAAGF,WAAW,CAACG,SAAS,yEAAI,GAAG;EAE5C,IAAMC,MAAM,GAAGF,OAAO,CAACG,OAAO,CAACR,SAAS,EAAE,EAAE,CAAC;EAE7C,IAAAS,gBAAS,EAAC,MAAM;IACd,IAAMC,UAAU;MAAA,8BAAG,aAAY;QAC7B,IAAMC,KAAK,SAASpB,OAAO,CAACqB,KAAK,EAAE;QACnC,IAAID,KAAK,EAAE;UACTE,OAAO,CAACC,KAAK,CAAC;YAAEC,IAAI,EAAER,MAAM;YAAEF,OAAO;YAAEL,SAAS;YAAEN;UAAS,CAAC,CAAC;UAC7DF,OAAO,CAACuB,IAAI,CAACR,MAAM,CAAC;QACtB;MACF,CAAC;MAAA,gBANKG,UAAU;QAAA;MAAA;IAAA,GAMf;IACDA,UAAU,EAAE;EACd,CAAC,EAAE,EAAE,CAAC;EAEN,IAAMM,cAAc,GAAGzB,OAAO,CAACyB,cAAc,EAAE;EAC/C,OACE,6BAAC,8BAAkB;IACjB,eAAe,EAAEA,cAAc,CAACC,eAAgB;IAChD,mBAAmB,EAAED,cAAc,CAACE;EAAoB,GAExD,6BAAC,gBAAI;IAAC,aAAa,EAAC,QAAQ;IAAC,cAAc,EAAC,QAAQ;IAAC,EAAE,EAAC;EAAK,GAC3D,6BAAC,oBAAQ;IAAC,SAAS,EAAC;EAAQ,GAC1B,6BAAC,4BAAgB;IAAC,IAAI,EAAC;EAAO,EAAG,CACxB,EACX,6BAAC,oBAAQ;IAAC,EAAE,EAAC,OAAO;IAAC,SAAS,EAAC;EAAQ,GACrC,6BAAC,mBAAO;IAAC,KAAK,EAAC,KAAK;IAAC,EAAE,EAAC;EAAI,0BACTX,MAAM,4BACf,CACD,CACN,CACY;AAEzB,CAAC;AAAA"}
@@ -1,6 +1,13 @@
1
- import { BrowserAdaptor } from './browserAdaptor';
2
- export var hostedInternally = hostname => hostname.endsWith('.looker.com') || hostname.endsWith('.google.com') || hostname === 'localhost' || hostname.startsWith('looker-developer-portal') && hostname.endsWith('.web.app');
3
- export var getThemeOverrides = internalTheming => internalTheming ? {
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.unregisterEnvAdaptor = exports.registerTestEnvAdaptor = exports.registerEnvAdaptor = exports.hostedInternally = exports.getThemeOverrides = exports.getEnvAdaptor = exports.appPath = void 0;
7
+ var _browserAdaptor = require("./browserAdaptor");
8
+ var hostedInternally = hostname => hostname.endsWith('.looker.com') || hostname.endsWith('.google.com') || hostname === 'localhost' || hostname.startsWith('looker-developer-portal') && hostname.endsWith('.web.app');
9
+ exports.hostedInternally = hostedInternally;
10
+ var getThemeOverrides = internalTheming => internalTheming ? {
4
11
  loadGoogleFonts: true,
5
12
  themeCustomizations: {
6
13
  fontFamilies: {
@@ -17,25 +24,29 @@ export var getThemeOverrides = internalTheming => internalTheming ? {
17
24
  }
18
25
  }
19
26
  };
27
+ exports.getThemeOverrides = getThemeOverrides;
20
28
  var extensionAdaptor;
21
- export var registerEnvAdaptor = adaptor => {
29
+ var registerEnvAdaptor = adaptor => {
22
30
  extensionAdaptor = adaptor;
23
31
  };
24
- export var unregisterEnvAdaptor = () => {
32
+ exports.registerEnvAdaptor = registerEnvAdaptor;
33
+ var unregisterEnvAdaptor = () => {
25
34
  extensionAdaptor = undefined;
26
35
  };
27
- export var getEnvAdaptor = () => {
36
+ exports.unregisterEnvAdaptor = unregisterEnvAdaptor;
37
+ var getEnvAdaptor = () => {
28
38
  if (!extensionAdaptor) {
29
39
  throw new Error('Environment adaptor not initialized.');
30
40
  }
31
-
32
41
  return extensionAdaptor;
33
42
  };
34
- export var registerTestEnvAdaptor = adaptor => {
43
+ exports.getEnvAdaptor = getEnvAdaptor;
44
+ var registerTestEnvAdaptor = adaptor => {
35
45
  var mockSdk = {};
36
- registerEnvAdaptor(adaptor || new BrowserAdaptor(mockSdk));
46
+ registerEnvAdaptor(adaptor || new _browserAdaptor.BrowserAdaptor(mockSdk));
37
47
  };
38
- export var appPath = (location, newPath) => {
48
+ exports.registerTestEnvAdaptor = registerTestEnvAdaptor;
49
+ var appPath = (location, newPath) => {
39
50
  var reactPath = location.pathname;
40
51
  var wloc = window.location;
41
52
  var base = wloc.origin;
@@ -43,4 +54,5 @@ export var appPath = (location, newPath) => {
43
54
  var result = "".concat(base).concat(wpath.substring(0, wpath.indexOf(reactPath))).concat(newPath);
44
55
  return result;
45
56
  };
57
+ exports.appPath = appPath;
46
58
  //# sourceMappingURL=adaptorUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/adaptorUtils.ts"],"names":["BrowserAdaptor","hostedInternally","hostname","endsWith","startsWith","getThemeOverrides","internalTheming","loadGoogleFonts","themeCustomizations","fontFamilies","brand","colors","key","extensionAdaptor","registerEnvAdaptor","adaptor","unregisterEnvAdaptor","undefined","getEnvAdaptor","Error","registerTestEnvAdaptor","mockSdk","appPath","location","newPath","reactPath","pathname","wloc","window","base","origin","wpath","result","substring","indexOf"],"mappings":"AA6BA,SAASA,cAAT,QAA+B,kBAA/B;AAoDA,OAAO,IAAMC,gBAAgB,GAAIC,QAAD,IAC9BA,QAAQ,CAACC,QAAT,CAAkB,aAAlB,KACAD,QAAQ,CAACC,QAAT,CAAkB,aAAlB,CADA,IAEAD,QAAQ,KAAK,WAFb,IAMCA,QAAQ,CAACE,UAAT,CAAoB,yBAApB,KACCF,QAAQ,CAACC,QAAT,CAAkB,UAAlB,CARG;AAcP,OAAO,IAAME,iBAAiB,GAAIC,eAAD,IAC/BA,eAAe,GACX;AACEC,EAAAA,eAAe,EAAE,IADnB;AAEEC,EAAAA,mBAAmB,EAAE;AACnBC,IAAAA,YAAY,EAAE;AAAEC,MAAAA,KAAK,EAAE;AAAT,KADK;AAEnBC,IAAAA,MAAM,EAAE;AAAEC,MAAAA,GAAG,EAAE;AAAP;AAFW;AAFvB,CADW,GAQX;AACEJ,EAAAA,mBAAmB,EAAE;AACnBG,IAAAA,MAAM,EAAE;AAAEC,MAAAA,GAAG,EAAE;AAAP;AADW;AADvB,CATC;AAeP,IAAIC,gBAAJ;AAMA,OAAO,IAAMC,kBAAkB,GAC7BC,OADgC,IAE7B;AACHF,EAAAA,gBAAgB,GAAGE,OAAnB;AACD,CAJM;AASP,OAAO,IAAMC,oBAAoB,GAAG,MAAM;AACxCH,EAAAA,gBAAgB,GAAGI,SAAnB;AACD,CAFM;AAOP,OAAO,IAAMC,aAAa,GAAG,MAAM;AACjC,MAAI,CAACL,gBAAL,EAAuB;AACrB,UAAM,IAAIM,KAAJ,CAAU,sCAAV,CAAN;AACD;;AACD,SAAON,gBAAP;AACD,CALM;AAWP,OAAO,IAAMO,sBAAsB,GACjCL,OADoC,IAEjC;AACH,MAAMM,OAAO,GAAG,EAAhB;AACAP,EAAAA,kBAAkB,CAACC,OAAO,IAAI,IAAIf,cAAJ,CAAmBqB,OAAnB,CAAZ,CAAlB;AACD,CALM;AAgBP,OAAO,IAAMC,OAAO,GAAG,CAACC,QAAD,EAAsBC,OAAtB,KAA0C;AAC/D,MAAMC,SAAS,GAAGF,QAAQ,CAACG,QAA3B;AACA,MAAMC,IAAI,GAAIC,MAAD,CAAgBL,QAA7B;AACA,MAAMM,IAAI,GAAGF,IAAI,CAACG,MAAlB;AACA,MAAMC,KAAK,GAAGJ,IAAI,CAACD,QAAnB;AACA,MAAMM,MAAM,aAAMH,IAAN,SAAaE,KAAK,CAACE,SAAN,CACvB,CADuB,EAEvBF,KAAK,CAACG,OAAN,CAAcT,SAAd,CAFuB,CAAb,SAGRD,OAHQ,CAAZ;AAIA,SAAOQ,MAAP;AACD,CAVM","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 { ThemeCustomizations } from '@looker/design-tokens'\nimport type { IAPIMethods } from '@looker/sdk-rtl'\nimport type { Location as HLocation } from 'history'\nimport { BrowserAdaptor } from './browserAdaptor'\n\nexport interface IAuthAdaptor {\n /** Method for retrieving an instantiated SDK */\n get sdk(): IAPIMethods\n /** Method for authenticating against the API server. Auth mechanism is dependent on the authSession implementation\n * used for the sdk. */\n login(): Promise<boolean>\n}\n\n/**\n * NOTE: This interface should describe all methods that require an adaptor when running in standalone vs extension mode\n * Examples include: local storage operations and various link navigation functions\n */\nexport interface IEnvironmentAdaptor extends IAuthAdaptor {\n /** Copy page URL to clipboard */\n copyToClipboard: (location?: {\n pathname: string\n search: string\n }) => Promise<void>\n /** Method for determining whether running in a browser or extension environment */\n isExtension(): boolean\n /** Method for retrieving a keyed value from local storage */\n localStorageGetItem(key: string): Promise<string | null>\n /** Method for setting a keyed value in local storage */\n localStorageSetItem(key: string, value: string): void\n /** Method for removing a keyed value from local storage */\n localStorageRemoveItem(key: string): void\n /** Theme settings for extension */\n themeOverrides(): ThemeOverrides\n /** Open a new browser window with the given url and target */\n openBrowserWindow: (url: string, target?: string) => void\n /** error logger */\n logError: (error: Error, componentStack: string) => void\n}\n\n/**\n * Theme overrides used to load google fonts in Google environments only.\n * Google fonts should NOT be used when it is not obvious that a Google\n * system is being used (for example an embedded extension).\n */\nexport interface ThemeOverrides {\n /** Should Google-specific fonts be used for the theme? */\n loadGoogleFonts?: boolean\n /** Property bag overrides for Looker component theming */\n themeCustomizations?: ThemeCustomizations\n}\n\n/**\n * Is this an \"internal\" host that will use internal branding?\n * @param hostname to check\n */\nexport const hostedInternally = (hostname: string): boolean =>\n hostname.endsWith('.looker.com') ||\n hostname.endsWith('.google.com') ||\n hostname === 'localhost' ||\n // Include firebase staging dev portal for now. Can be removed\n // when dev portal gets its own APIX project. Also includes\n // PRs.\n (hostname.startsWith('looker-developer-portal') &&\n hostname.endsWith('.web.app'))\n\n/**\n * Return theme overrides that make apply \"internal\" or external theming\n * @param internalTheming true if \"internal\" theme should be used\n */\nexport const getThemeOverrides = (internalTheming: boolean): ThemeOverrides =>\n internalTheming\n ? {\n loadGoogleFonts: true,\n themeCustomizations: {\n fontFamilies: { brand: 'Google Sans' },\n colors: { key: '#1A73E8' },\n },\n }\n : {\n themeCustomizations: {\n colors: { key: '#1A73E8' },\n },\n }\n\nlet extensionAdaptor: IEnvironmentAdaptor | undefined\n\n/**\n * Register the environment adaptor. Used when initializing the application\n * @param adaptor to register\n */\nexport const registerEnvAdaptor = <T extends IEnvironmentAdaptor>(\n adaptor: T\n) => {\n extensionAdaptor = adaptor\n}\n\n/**\n * Unregister the environment adaptor. Extensions should call this when unmounted\n */\nexport const unregisterEnvAdaptor = () => {\n extensionAdaptor = undefined\n}\n\n/**\n * Global access to the environment adaptor. An error will be thrown if accessed prematurely.\n */\nexport const getEnvAdaptor = () => {\n if (!extensionAdaptor) {\n throw new Error('Environment adaptor not initialized.')\n }\n return extensionAdaptor\n}\n\n/**\n * Used by some unit tests\n * @param adaptor to use for testing\n */\nexport const registerTestEnvAdaptor = <T extends IEnvironmentAdaptor>(\n adaptor?: T\n) => {\n const mockSdk = {} as unknown as IAPIMethods\n registerEnvAdaptor(adaptor || new BrowserAdaptor(mockSdk))\n}\n\n/**\n * Get new application-level base path for react application\n * This function compares the react-based location with the browser window location\n * pathname to ensure that the newPath variable is assigned at the root of the\n * React app path rather than potentially recursive nesting\n *\n * @param location which is usually from useLocation()\n * @param newPath new path to assign, like `/oauth`\n */\nexport const appPath = (location: HLocation, newPath: string) => {\n const reactPath = location.pathname\n const wloc = (window as any).location\n const base = wloc.origin\n const wpath = wloc.pathname\n const result = `${base}${wpath.substring(\n 0,\n wpath.indexOf(reactPath)\n )}${newPath}`\n return result\n}\n"],"file":"adaptorUtils.js"}
1
+ {"version":3,"file":"adaptorUtils.js","names":["hostedInternally","hostname","endsWith","startsWith","getThemeOverrides","internalTheming","loadGoogleFonts","themeCustomizations","fontFamilies","brand","colors","key","extensionAdaptor","registerEnvAdaptor","adaptor","unregisterEnvAdaptor","undefined","getEnvAdaptor","Error","registerTestEnvAdaptor","mockSdk","BrowserAdaptor","appPath","location","newPath","reactPath","pathname","wloc","window","base","origin","wpath","result","substring","indexOf"],"sources":["../../src/adaptorUtils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { ThemeCustomizations } from '@looker/design-tokens'\nimport type { IAPIMethods } from '@looker/sdk-rtl'\nimport type { Location as HLocation } from 'history'\nimport { BrowserAdaptor } from './browserAdaptor'\n\nexport interface IAuthAdaptor {\n /** Method for retrieving an instantiated SDK */\n get sdk(): IAPIMethods\n /** Method for authenticating against the API server. Auth mechanism is dependent on the authSession implementation\n * used for the sdk. */\n login(): Promise<boolean>\n}\n\n/**\n * NOTE: This interface should describe all methods that require an adaptor when running in standalone vs extension mode\n * Examples include: local storage operations and various link navigation functions\n */\nexport interface IEnvironmentAdaptor extends IAuthAdaptor {\n /** Copy page URL to clipboard */\n copyToClipboard: (location?: {\n pathname: string\n search: string\n }) => Promise<void>\n /** Method for determining whether running in a browser or extension environment */\n isExtension(): boolean\n /** Method for retrieving a keyed value from local storage */\n localStorageGetItem(key: string): Promise<string | null>\n /** Method for setting a keyed value in local storage */\n localStorageSetItem(key: string, value: string): void\n /** Method for removing a keyed value from local storage */\n localStorageRemoveItem(key: string): void\n /** Theme settings for extension */\n themeOverrides(): ThemeOverrides\n /** Open a new browser window with the given url and target */\n openBrowserWindow: (url: string, target?: string) => void\n /** error logger */\n logError: (error: Error, componentStack: string) => void\n}\n\n/**\n * Theme overrides used to load google fonts in Google environments only.\n * Google fonts should NOT be used when it is not obvious that a Google\n * system is being used (for example an embedded extension).\n */\nexport interface ThemeOverrides {\n /** Should Google-specific fonts be used for the theme? */\n loadGoogleFonts?: boolean\n /** Property bag overrides for Looker component theming */\n themeCustomizations?: ThemeCustomizations\n}\n\n/**\n * Is this an \"internal\" host that will use internal branding?\n * @param hostname to check\n */\nexport const hostedInternally = (hostname: string): boolean =>\n hostname.endsWith('.looker.com') ||\n hostname.endsWith('.google.com') ||\n hostname === 'localhost' ||\n // Include firebase staging dev portal for now. Can be removed\n // when dev portal gets its own APIX project. Also includes\n // PRs.\n (hostname.startsWith('looker-developer-portal') &&\n hostname.endsWith('.web.app'))\n\n/**\n * Return theme overrides that make apply \"internal\" or external theming\n * @param internalTheming true if \"internal\" theme should be used\n */\nexport const getThemeOverrides = (internalTheming: boolean): ThemeOverrides =>\n internalTheming\n ? {\n loadGoogleFonts: true,\n themeCustomizations: {\n fontFamilies: { brand: 'Google Sans' },\n colors: { key: '#1A73E8' },\n },\n }\n : {\n themeCustomizations: {\n colors: { key: '#1A73E8' },\n },\n }\n\nlet extensionAdaptor: IEnvironmentAdaptor | undefined\n\n/**\n * Register the environment adaptor. Used when initializing the application\n * @param adaptor to register\n */\nexport const registerEnvAdaptor = <T extends IEnvironmentAdaptor>(\n adaptor: T\n) => {\n extensionAdaptor = adaptor\n}\n\n/**\n * Unregister the environment adaptor. Extensions should call this when unmounted\n */\nexport const unregisterEnvAdaptor = () => {\n extensionAdaptor = undefined\n}\n\n/**\n * Global access to the environment adaptor. An error will be thrown if accessed prematurely.\n */\nexport const getEnvAdaptor = () => {\n if (!extensionAdaptor) {\n throw new Error('Environment adaptor not initialized.')\n }\n return extensionAdaptor\n}\n\n/**\n * Used by some unit tests\n * @param adaptor to use for testing\n */\nexport const registerTestEnvAdaptor = <T extends IEnvironmentAdaptor>(\n adaptor?: T\n) => {\n const mockSdk = {} as unknown as IAPIMethods\n registerEnvAdaptor(adaptor || new BrowserAdaptor(mockSdk))\n}\n\n/**\n * Get new application-level base path for react application\n * This function compares the react-based location with the browser window location\n * pathname to ensure that the newPath variable is assigned at the root of the\n * React app path rather than potentially recursive nesting\n *\n * @param location which is usually from useLocation()\n * @param newPath new path to assign, like `/oauth`\n */\nexport const appPath = (location: HLocation, newPath: string) => {\n const reactPath = location.pathname\n const wloc = (window as any).location\n const base = wloc.origin\n const wpath = wloc.pathname\n const result = `${base}${wpath.substring(\n 0,\n wpath.indexOf(reactPath)\n )}${newPath}`\n return result\n}\n"],"mappings":";;;;;;AA6BA;AAoDO,IAAMA,gBAAgB,GAAIC,QAAgB,IAC/CA,QAAQ,CAACC,QAAQ,CAAC,aAAa,CAAC,IAChCD,QAAQ,CAACC,QAAQ,CAAC,aAAa,CAAC,IAChCD,QAAQ,KAAK,WAAW,IAIvBA,QAAQ,CAACE,UAAU,CAAC,yBAAyB,CAAC,IAC7CF,QAAQ,CAACC,QAAQ,CAAC,UAAU,CAAE;AAAA;AAM3B,IAAME,iBAAiB,GAAIC,eAAwB,IACxDA,eAAe,GACX;EACEC,eAAe,EAAE,IAAI;EACrBC,mBAAmB,EAAE;IACnBC,YAAY,EAAE;MAAEC,KAAK,EAAE;IAAc,CAAC;IACtCC,MAAM,EAAE;MAAEC,GAAG,EAAE;IAAU;EAC3B;AACF,CAAC,GACD;EACEJ,mBAAmB,EAAE;IACnBG,MAAM,EAAE;MAAEC,GAAG,EAAE;IAAU;EAC3B;AACF,CAAC;AAAA;AAEP,IAAIC,gBAAiD;AAM9C,IAAMC,kBAAkB,GAC7BC,OAAU,IACP;EACHF,gBAAgB,GAAGE,OAAO;AAC5B,CAAC;AAAA;AAKM,IAAMC,oBAAoB,GAAG,MAAM;EACxCH,gBAAgB,GAAGI,SAAS;AAC9B,CAAC;AAAA;AAKM,IAAMC,aAAa,GAAG,MAAM;EACjC,IAAI,CAACL,gBAAgB,EAAE;IACrB,MAAM,IAAIM,KAAK,CAAC,sCAAsC,CAAC;EACzD;EACA,OAAON,gBAAgB;AACzB,CAAC;AAAA;AAMM,IAAMO,sBAAsB,GACjCL,OAAW,IACR;EACH,IAAMM,OAAO,GAAG,CAAC,CAA2B;EAC5CP,kBAAkB,CAACC,OAAO,IAAI,IAAIO,8BAAc,CAACD,OAAO,CAAC,CAAC;AAC5D,CAAC;AAAA;AAWM,IAAME,OAAO,GAAG,CAACC,QAAmB,EAAEC,OAAe,KAAK;EAC/D,IAAMC,SAAS,GAAGF,QAAQ,CAACG,QAAQ;EACnC,IAAMC,IAAI,GAAIC,MAAM,CAASL,QAAQ;EACrC,IAAMM,IAAI,GAAGF,IAAI,CAACG,MAAM;EACxB,IAAMC,KAAK,GAAGJ,IAAI,CAACD,QAAQ;EAC3B,IAAMM,MAAM,aAAMH,IAAI,SAAGE,KAAK,CAACE,SAAS,CACtC,CAAC,EACDF,KAAK,CAACG,OAAO,CAACT,SAAS,CAAC,CACzB,SAAGD,OAAO,CAAE;EACb,OAAOQ,MAAM;AACf,CAAC;AAAA"}
@@ -1,46 +1,44 @@
1
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
2
-
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
4
-
5
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
-
7
- import { ApiSettings } from '@looker/sdk-rtl';
8
- export class OAuthConfigProvider extends ApiSettings {
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.OAuthConfigProvider = void 0;
7
+ var _sdkRtl = require("@looker/sdk-rtl");
8
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
12
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
+ class OAuthConfigProvider extends _sdkRtl.ApiSettings {
9
14
  constructor(settings, configKey) {
10
15
  super(settings);
11
16
  this.configKey = configKey;
12
17
  }
13
-
14
18
  getStorage(key) {
15
19
  var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
16
20
  var value = sessionStorage.getItem(key);
17
-
18
21
  if (value) {
19
22
  return {
20
23
  location: 'session',
21
24
  value
22
25
  };
23
26
  }
24
-
25
27
  value = localStorage.getItem(key);
26
-
27
28
  if (value) {
28
29
  return {
29
30
  location: 'local',
30
31
  value
31
32
  };
32
33
  }
33
-
34
34
  return {
35
35
  location: 'session',
36
36
  value: defaultValue
37
37
  };
38
38
  }
39
-
40
39
  isConfigured() {
41
40
  return true;
42
41
  }
43
-
44
42
  getStoredConfig() {
45
43
  var storage = this.getStorage(this.configKey);
46
44
  var config = {
@@ -49,22 +47,17 @@ export class OAuthConfigProvider extends ApiSettings {
49
47
  client_id: '',
50
48
  redirect_uri: ''
51
49
  };
52
-
53
50
  if (storage.value) {
54
51
  config = JSON.parse(storage.value);
55
52
  }
56
-
57
53
  return config;
58
54
  }
59
-
60
55
  authIsConfigured() {
61
56
  var config = this.getStoredConfig();
62
57
  return config.base_url !== '' && config.looker_url !== '';
63
58
  }
64
-
65
59
  readConfig(_section) {
66
60
  var config = this.getStoredConfig();
67
-
68
61
  if (!this.authIsConfigured()) {
69
62
  var url = new URL(this.base_url);
70
63
  var authServer = "".concat(url.protocol, "//").concat(url.hostname);
@@ -75,7 +68,6 @@ export class OAuthConfigProvider extends ApiSettings {
75
68
  redirect_uri: "".concat(window.location.origin, "/oauth")
76
69
  };
77
70
  }
78
-
79
71
  var {
80
72
  base_url,
81
73
  looker_url,
@@ -90,6 +82,6 @@ export class OAuthConfigProvider extends ApiSettings {
90
82
  redirect_uri
91
83
  });
92
84
  }
93
-
94
85
  }
86
+ exports.OAuthConfigProvider = OAuthConfigProvider;
95
87
  //# sourceMappingURL=authUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/authUtils.ts"],"names":["ApiSettings","OAuthConfigProvider","constructor","settings","configKey","getStorage","key","defaultValue","value","sessionStorage","getItem","location","localStorage","isConfigured","getStoredConfig","storage","config","base_url","looker_url","client_id","redirect_uri","JSON","parse","authIsConfigured","readConfig","_section","url","URL","authServer","protocol","hostname","window","origin"],"mappings":";;;;;;AA0BA,SAASA,WAAT,QAA4B,iBAA5B;AAeA,OAAO,MAAMC,mBAAN,SAAkCD,WAAlC,CAA8C;AACnDE,EAAAA,WAAW,CACTC,QADS,EAEQC,SAFR,EAGT;AACA,UAAMD,QAAN;AADA,SADiBC,SACjB,GADiBA,SACjB;AAED;;AAEOC,EAAAA,UAAU,CAACC,GAAD,EAAgD;AAAA,QAAlCC,YAAkC,uEAAnB,EAAmB;AAChE,QAAIC,KAAK,GAAGC,cAAc,CAACC,OAAf,CAAuBJ,GAAvB,CAAZ;;AACA,QAAIE,KAAJ,EAAW;AACT,aAAO;AACLG,QAAAA,QAAQ,EAAE,SADL;AAELH,QAAAA;AAFK,OAAP;AAID;;AACDA,IAAAA,KAAK,GAAGI,YAAY,CAACF,OAAb,CAAqBJ,GAArB,CAAR;;AACA,QAAIE,KAAJ,EAAW;AACT,aAAO;AACLG,QAAAA,QAAQ,EAAE,OADL;AAELH,QAAAA;AAFK,OAAP;AAID;;AACD,WAAO;AACLG,MAAAA,QAAQ,EAAE,SADL;AAELH,MAAAA,KAAK,EAAED;AAFF,KAAP;AAID;;AAEDM,EAAAA,YAAY,GAAY;AAEtB,WAAO,IAAP;AACD;;AAEDC,EAAAA,eAAe,GAAG;AAChB,QAAMC,OAAO,GAAG,KAAKV,UAAL,CAAgB,KAAKD,SAArB,CAAhB;AACA,QAAIY,MAAM,GAAG;AACXC,MAAAA,QAAQ,EAAE,EADC;AAEXC,MAAAA,UAAU,EAAE,EAFD;AAGXC,MAAAA,SAAS,EAAE,EAHA;AAIXC,MAAAA,YAAY,EAAE;AAJH,KAAb;;AAMA,QAAIL,OAAO,CAACP,KAAZ,EAAmB;AACjBQ,MAAAA,MAAM,GAAGK,IAAI,CAACC,KAAL,CAAWP,OAAO,CAACP,KAAnB,CAAT;AACD;;AACD,WAAOQ,MAAP;AACD;;AAEDO,EAAAA,gBAAgB,GAAY;AAC1B,QAAMP,MAAM,GAAG,KAAKF,eAAL,EAAf;AACA,WAAOE,MAAM,CAACC,QAAP,KAAoB,EAApB,IAA0BD,MAAM,CAACE,UAAP,KAAsB,EAAvD;AACD;;AAEDM,EAAAA,UAAU,CAACC,QAAD,EAAiC;AAEzC,QAAIT,MAAM,GAAG,KAAKF,eAAL,EAAb;;AACA,QAAI,CAAC,KAAKS,gBAAL,EAAL,EAA8B;AAE5B,UAAMG,GAAG,GAAG,IAAIC,GAAJ,CAAQ,KAAKV,QAAb,CAAZ;AACA,UAAMW,UAAU,aAAMF,GAAG,CAACG,QAAV,eAAuBH,GAAG,CAACI,QAA3B,CAAhB;AACAd,MAAAA,MAAM,GAAG;AACPC,QAAAA,QAAQ,EAAE,KAAKA,QADR;AAEPC,QAAAA,UAAU,YAAKU,UAAL,UAFH;AAGPT,QAAAA,SAAS,EAAE,qBAHJ;AAIPC,QAAAA,YAAY,YAAKW,MAAM,CAACpB,QAAP,CAAgBqB,MAArB;AAJL,OAAT;AAMD;;AAED,QAAM;AAAEf,MAAAA,QAAF;AAAYC,MAAAA,UAAZ;AAAwBC,MAAAA,SAAxB;AAAmCC,MAAAA;AAAnC,QAAoDJ,MAA1D;AAEA,SAAKC,QAAL,GAAgBA,QAAhB;AACA,2CACK,MAAMO,UAAN,CAAiBC,QAAjB,CADL,GAEK;AACDR,MAAAA,QADC;AAEDC,MAAAA,UAFC;AAGDC,MAAAA,SAHC;AAIDC,MAAAA;AAJC,KAFL;AASD;;AAhFkD","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport type { IApiSection, IApiSettings } from '@looker/sdk-rtl'\nimport { ApiSettings } from '@looker/sdk-rtl'\n\nexport type StorageLocation = 'session' | 'local'\n\n/** Object returned from storage service */\nexport interface IStorageValue {\n /** Location of the stored object */\n location: StorageLocation\n /** Stored string representation of the value (usually JSON) */\n value: string\n}\n\n/**\n * An OAuth Session configuration provider\n */\nexport class OAuthConfigProvider extends ApiSettings {\n constructor(\n settings: Partial<IApiSettings>,\n private readonly configKey: string\n ) {\n super(settings)\n }\n\n private getStorage(key: string, defaultValue = ''): IStorageValue {\n let value = sessionStorage.getItem(key)\n if (value) {\n return {\n location: 'session',\n value,\n }\n }\n value = localStorage.getItem(key)\n if (value) {\n return {\n location: 'local',\n value,\n }\n }\n return {\n location: 'session',\n value: defaultValue,\n }\n }\n\n isConfigured(): boolean {\n // Required to be true otherwise SDK initialization fails\n return true\n }\n\n getStoredConfig() {\n const storage = this.getStorage(this.configKey)\n let config = {\n base_url: '',\n looker_url: '',\n client_id: '',\n redirect_uri: '',\n }\n if (storage.value) {\n config = JSON.parse(storage.value)\n }\n return config\n }\n\n authIsConfigured(): boolean {\n const config = this.getStoredConfig()\n return config.base_url !== '' && config.looker_url !== ''\n }\n\n readConfig(_section?: string): IApiSection {\n // Read server url values from storage\n let config = this.getStoredConfig()\n if (!this.authIsConfigured()) {\n // derive Looker server URL from base_url\n const url = new URL(this.base_url)\n const authServer = `${url.protocol}//${url.hostname}`\n config = {\n base_url: this.base_url,\n looker_url: `${authServer}:9999`,\n client_id: 'looker.api-explorer',\n redirect_uri: `${window.location.origin}/oauth`,\n }\n }\n\n const { base_url, looker_url, client_id, redirect_uri } = config\n /* update base_url to the dynamically determined value for standard transport requests */\n this.base_url = base_url\n return {\n ...super.readConfig(_section),\n ...{\n base_url,\n looker_url,\n client_id,\n redirect_uri,\n },\n }\n }\n}\n"],"file":"authUtils.js"}
1
+ {"version":3,"file":"authUtils.js","names":["OAuthConfigProvider","ApiSettings","constructor","settings","configKey","getStorage","key","defaultValue","value","sessionStorage","getItem","location","localStorage","isConfigured","getStoredConfig","storage","config","base_url","looker_url","client_id","redirect_uri","JSON","parse","authIsConfigured","readConfig","_section","url","URL","authServer","protocol","hostname","window","origin"],"sources":["../../src/authUtils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport type { IApiSection, IApiSettings } from '@looker/sdk-rtl'\nimport { ApiSettings } from '@looker/sdk-rtl'\n\nexport type StorageLocation = 'session' | 'local'\n\n/** Object returned from storage service */\nexport interface IStorageValue {\n /** Location of the stored object */\n location: StorageLocation\n /** Stored string representation of the value (usually JSON) */\n value: string\n}\n\n/**\n * An OAuth Session configuration provider\n */\nexport class OAuthConfigProvider extends ApiSettings {\n constructor(\n settings: Partial<IApiSettings>,\n private readonly configKey: string\n ) {\n super(settings)\n }\n\n private getStorage(key: string, defaultValue = ''): IStorageValue {\n let value = sessionStorage.getItem(key)\n if (value) {\n return {\n location: 'session',\n value,\n }\n }\n value = localStorage.getItem(key)\n if (value) {\n return {\n location: 'local',\n value,\n }\n }\n return {\n location: 'session',\n value: defaultValue,\n }\n }\n\n isConfigured(): boolean {\n // Required to be true otherwise SDK initialization fails\n return true\n }\n\n getStoredConfig() {\n const storage = this.getStorage(this.configKey)\n let config = {\n base_url: '',\n looker_url: '',\n client_id: '',\n redirect_uri: '',\n }\n if (storage.value) {\n config = JSON.parse(storage.value)\n }\n return config\n }\n\n authIsConfigured(): boolean {\n const config = this.getStoredConfig()\n return config.base_url !== '' && config.looker_url !== ''\n }\n\n readConfig(_section?: string): IApiSection {\n // Read server url values from storage\n let config = this.getStoredConfig()\n if (!this.authIsConfigured()) {\n // derive Looker server URL from base_url\n const url = new URL(this.base_url)\n const authServer = `${url.protocol}//${url.hostname}`\n config = {\n base_url: this.base_url,\n looker_url: `${authServer}:9999`,\n client_id: 'looker.api-explorer',\n redirect_uri: `${window.location.origin}/oauth`,\n }\n }\n\n const { base_url, looker_url, client_id, redirect_uri } = config\n /* update base_url to the dynamically determined value for standard transport requests */\n this.base_url = base_url\n return {\n ...super.readConfig(_section),\n ...{\n base_url,\n looker_url,\n client_id,\n redirect_uri,\n },\n }\n }\n}\n"],"mappings":";;;;;;AA0BA;AAA6C;AAAA;AAAA;AAAA;AAAA;AAetC,MAAMA,mBAAmB,SAASC,mBAAW,CAAC;EACnDC,WAAW,CACTC,QAA+B,EACdC,SAAiB,EAClC;IACA,KAAK,CAACD,QAAQ,CAAC;IAAA,KAFEC,SAAiB,GAAjBA,SAAiB;EAGpC;EAEQC,UAAU,CAACC,GAAW,EAAoC;IAAA,IAAlCC,YAAY,uEAAG,EAAE;IAC/C,IAAIC,KAAK,GAAGC,cAAc,CAACC,OAAO,CAACJ,GAAG,CAAC;IACvC,IAAIE,KAAK,EAAE;MACT,OAAO;QACLG,QAAQ,EAAE,SAAS;QACnBH;MACF,CAAC;IACH;IACAA,KAAK,GAAGI,YAAY,CAACF,OAAO,CAACJ,GAAG,CAAC;IACjC,IAAIE,KAAK,EAAE;MACT,OAAO;QACLG,QAAQ,EAAE,OAAO;QACjBH;MACF,CAAC;IACH;IACA,OAAO;MACLG,QAAQ,EAAE,SAAS;MACnBH,KAAK,EAAED;IACT,CAAC;EACH;EAEAM,YAAY,GAAY;IAEtB,OAAO,IAAI;EACb;EAEAC,eAAe,GAAG;IAChB,IAAMC,OAAO,GAAG,IAAI,CAACV,UAAU,CAAC,IAAI,CAACD,SAAS,CAAC;IAC/C,IAAIY,MAAM,GAAG;MACXC,QAAQ,EAAE,EAAE;MACZC,UAAU,EAAE,EAAE;MACdC,SAAS,EAAE,EAAE;MACbC,YAAY,EAAE;IAChB,CAAC;IACD,IAAIL,OAAO,CAACP,KAAK,EAAE;MACjBQ,MAAM,GAAGK,IAAI,CAACC,KAAK,CAACP,OAAO,CAACP,KAAK,CAAC;IACpC;IACA,OAAOQ,MAAM;EACf;EAEAO,gBAAgB,GAAY;IAC1B,IAAMP,MAAM,GAAG,IAAI,CAACF,eAAe,EAAE;IACrC,OAAOE,MAAM,CAACC,QAAQ,KAAK,EAAE,IAAID,MAAM,CAACE,UAAU,KAAK,EAAE;EAC3D;EAEAM,UAAU,CAACC,QAAiB,EAAe;IAEzC,IAAIT,MAAM,GAAG,IAAI,CAACF,eAAe,EAAE;IACnC,IAAI,CAAC,IAAI,CAACS,gBAAgB,EAAE,EAAE;MAE5B,IAAMG,GAAG,GAAG,IAAIC,GAAG,CAAC,IAAI,CAACV,QAAQ,CAAC;MAClC,IAAMW,UAAU,aAAMF,GAAG,CAACG,QAAQ,eAAKH,GAAG,CAACI,QAAQ,CAAE;MACrDd,MAAM,GAAG;QACPC,QAAQ,EAAE,IAAI,CAACA,QAAQ;QACvBC,UAAU,YAAKU,UAAU,UAAO;QAChCT,SAAS,EAAE,qBAAqB;QAChCC,YAAY,YAAKW,MAAM,CAACpB,QAAQ,CAACqB,MAAM;MACzC,CAAC;IACH;IAEA,IAAM;MAAEf,QAAQ;MAAEC,UAAU;MAAEC,SAAS;MAAEC;IAAa,CAAC,GAAGJ,MAAM;IAEhE,IAAI,CAACC,QAAQ,GAAGA,QAAQ;IACxB,uCACK,KAAK,CAACO,UAAU,CAACC,QAAQ,CAAC,GAC1B;MACDR,QAAQ;MACRC,UAAU;MACVC,SAAS;MACTC;IACF,CAAC;EAEL;AACF;AAAC"}
@@ -1,80 +1,71 @@
1
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
-
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.BrowserAuthAdaptor = exports.BrowserAdaptor = void 0;
7
+ var _adaptorUtils = require("./adaptorUtils");
8
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
10
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
3
11
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
-
5
12
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
6
-
7
- import { getThemeOverrides, hostedInternally } from './adaptorUtils';
8
- export class BrowserAuthAdaptor {
13
+ class BrowserAuthAdaptor {
9
14
  constructor(sdk) {
10
15
  this.sdk = sdk;
11
16
  }
12
-
13
17
  login() {
14
18
  var _this = this;
15
-
16
19
  return _asyncToGenerator(function* () {
17
20
  var token;
18
21
  var settings = _this.sdk.authSession.settings;
19
-
20
22
  if (settings.authIsConfigured()) {
21
23
  token = yield _this.sdk.authSession.login();
22
24
  }
23
-
24
25
  return !!token;
25
26
  })();
26
27
  }
27
-
28
28
  }
29
- export class BrowserAdaptor extends BrowserAuthAdaptor {
29
+ exports.BrowserAuthAdaptor = BrowserAuthAdaptor;
30
+ class BrowserAdaptor extends BrowserAuthAdaptor {
30
31
  constructor(sdk) {
31
32
  super(sdk);
32
-
33
33
  _defineProperty(this, "_themeOverrides", void 0);
34
-
35
34
  var {
36
35
  hostname
37
36
  } = location;
38
- this._themeOverrides = getThemeOverrides(hostedInternally(hostname));
37
+ this._themeOverrides = (0, _adaptorUtils.getThemeOverrides)((0, _adaptorUtils.hostedInternally)(hostname));
39
38
  }
40
-
41
39
  copyToClipboard() {
42
40
  return _asyncToGenerator(function* () {
43
41
  yield navigator.clipboard.writeText(location.href);
44
42
  })();
45
43
  }
46
-
47
44
  isExtension() {
48
45
  return false;
49
46
  }
50
-
51
47
  localStorageGetItem(key) {
52
48
  return _asyncToGenerator(function* () {
53
49
  return localStorage.getItem(key);
54
50
  })();
55
51
  }
56
-
57
52
  localStorageSetItem(key, value) {
58
53
  return _asyncToGenerator(function* () {
59
54
  yield localStorage.setItem(key, value);
60
55
  })();
61
56
  }
62
-
63
57
  localStorageRemoveItem(key) {
64
58
  return _asyncToGenerator(function* () {
65
59
  yield localStorage.removeItem(key);
66
60
  })();
67
61
  }
68
-
69
62
  themeOverrides() {
70
63
  return this._themeOverrides;
71
64
  }
72
-
73
65
  openBrowserWindow(url, target) {
74
66
  window.open(url, target);
75
67
  }
76
-
77
68
  logError(_error, _componentStack) {}
78
-
79
69
  }
70
+ exports.BrowserAdaptor = BrowserAdaptor;
80
71
  //# sourceMappingURL=browserAdaptor.js.map