@looker/extension-sdk-react 22.20.2-alpha.1650 → 23.2.0

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 (101) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +0 -14
  3. package/lib/components/ErrorMessage/ErrorMessage.js +0 -4
  4. package/lib/components/ErrorMessage/ErrorMessage.js.map +1 -1
  5. package/lib/components/ErrorMessage/index.js +0 -4
  6. package/lib/components/ErrorMessage/index.js.map +1 -1
  7. package/lib/components/ErrorMessage/types.js +1 -1
  8. package/lib/components/ErrorMessage/types.js.map +1 -1
  9. package/lib/components/ExtensionConnector/ExtensionConnector.js +14 -49
  10. package/lib/components/ExtensionConnector/ExtensionConnector.js.map +1 -1
  11. package/lib/components/ExtensionConnector/index.js +0 -4
  12. package/lib/components/ExtensionConnector/index.js.map +1 -1
  13. package/lib/components/ExtensionConnector/types.d.ts +2 -7
  14. package/lib/components/ExtensionConnector/types.js +1 -1
  15. package/lib/components/ExtensionConnector/types.js.map +1 -1
  16. package/lib/components/ExtensionProvider/ExtensionProvider.js +11 -48
  17. package/lib/components/ExtensionProvider/ExtensionProvider.js.map +1 -1
  18. package/lib/components/ExtensionProvider/index.js +0 -4
  19. package/lib/components/ExtensionProvider/index.js.map +1 -1
  20. package/lib/components/ExtensionProvider/types.js +1 -1
  21. package/lib/components/ExtensionProvider/types.js.map +1 -1
  22. package/lib/components/ExtensionProvider2/ExtensionProvider2.js +13 -49
  23. package/lib/components/ExtensionProvider2/ExtensionProvider2.js.map +1 -1
  24. package/lib/components/ExtensionProvider2/index.js +0 -2
  25. package/lib/components/ExtensionProvider2/index.js.map +1 -1
  26. package/lib/components/ExtensionProvider40/ExtensionProvider40.js +12 -46
  27. package/lib/components/ExtensionProvider40/ExtensionProvider40.js.map +1 -1
  28. package/lib/components/ExtensionProvider40/index.js +0 -2
  29. package/lib/components/ExtensionProvider40/index.js.map +1 -1
  30. package/lib/components/ExtensionProviderBase/ExtensionProviderBase.js +12 -44
  31. package/lib/components/ExtensionProviderBase/ExtensionProviderBase.js.map +1 -1
  32. package/lib/components/ExtensionProviderBase/index.js +0 -2
  33. package/lib/components/ExtensionProviderBase/index.js.map +1 -1
  34. package/lib/components/RouteChangeListener/RouteChangeListener.js +0 -10
  35. package/lib/components/RouteChangeListener/RouteChangeListener.js.map +1 -1
  36. package/lib/components/RouteChangeListener/index.js +0 -4
  37. package/lib/components/RouteChangeListener/index.js.map +1 -1
  38. package/lib/components/RouteChangeListener/types.js +1 -1
  39. package/lib/components/RouteChangeListener/types.js.map +1 -1
  40. package/lib/components/utils/get_initial_route_entries.js +5 -13
  41. package/lib/components/utils/get_initial_route_entries.js.map +1 -1
  42. package/lib/components/utils/setup_close_popovers.js +0 -5
  43. package/lib/components/utils/setup_close_popovers.js.map +1 -1
  44. package/lib/esm/components/ErrorMessage/ErrorMessage.js +11 -3
  45. package/lib/esm/components/ErrorMessage/ErrorMessage.js.map +1 -1
  46. package/lib/esm/components/ErrorMessage/index.js +27 -2
  47. package/lib/esm/components/ErrorMessage/index.js.map +1 -1
  48. package/lib/esm/components/ErrorMessage/types.js.map +1 -1
  49. package/lib/esm/components/ExtensionConnector/ExtensionConnector.js +45 -57
  50. package/lib/esm/components/ExtensionConnector/ExtensionConnector.js.map +1 -1
  51. package/lib/esm/components/ExtensionConnector/index.js +27 -2
  52. package/lib/esm/components/ExtensionConnector/index.js.map +1 -1
  53. package/lib/esm/components/ExtensionConnector/types.js.map +1 -1
  54. package/lib/esm/components/ExtensionProvider/ExtensionProvider.js +36 -50
  55. package/lib/esm/components/ExtensionProvider/ExtensionProvider.js.map +1 -1
  56. package/lib/esm/components/ExtensionProvider/index.js +27 -2
  57. package/lib/esm/components/ExtensionProvider/index.js.map +1 -1
  58. package/lib/esm/components/ExtensionProvider/types.js.map +1 -1
  59. package/lib/esm/components/ExtensionProvider2/ExtensionProvider2.js +34 -50
  60. package/lib/esm/components/ExtensionProvider2/ExtensionProvider2.js.map +1 -1
  61. package/lib/esm/components/ExtensionProvider2/index.js +16 -1
  62. package/lib/esm/components/ExtensionProvider2/index.js.map +1 -1
  63. package/lib/esm/components/ExtensionProvider40/ExtensionProvider40.js +33 -47
  64. package/lib/esm/components/ExtensionProvider40/ExtensionProvider40.js.map +1 -1
  65. package/lib/esm/components/ExtensionProvider40/index.js +16 -1
  66. package/lib/esm/components/ExtensionProvider40/index.js.map +1 -1
  67. package/lib/esm/components/ExtensionProviderBase/ExtensionProviderBase.js +29 -43
  68. package/lib/esm/components/ExtensionProviderBase/ExtensionProviderBase.js.map +1 -1
  69. package/lib/esm/components/ExtensionProviderBase/index.js +16 -1
  70. package/lib/esm/components/ExtensionProviderBase/index.js.map +1 -1
  71. package/lib/esm/components/RouteChangeListener/RouteChangeListener.js +20 -12
  72. package/lib/esm/components/RouteChangeListener/RouteChangeListener.js.map +1 -1
  73. package/lib/esm/components/RouteChangeListener/index.js +27 -2
  74. package/lib/esm/components/RouteChangeListener/index.js.map +1 -1
  75. package/lib/esm/components/RouteChangeListener/types.js.map +1 -1
  76. package/lib/esm/components/utils/get_initial_route_entries.js +15 -9
  77. package/lib/esm/components/utils/get_initial_route_entries.js.map +1 -1
  78. package/lib/esm/components/utils/setup_close_popovers.js +8 -4
  79. package/lib/esm/components/utils/setup_close_popovers.js.map +1 -1
  80. package/lib/esm/index.js +115 -10
  81. package/lib/esm/index.js.map +1 -1
  82. package/lib/esm/sdk/core_sdk.js +13 -4
  83. package/lib/esm/sdk/core_sdk.js.map +1 -1
  84. package/lib/esm/sdk/core_sdk2.js +11 -7
  85. package/lib/esm/sdk/core_sdk2.js.map +1 -1
  86. package/lib/esm/sdk/core_sdk_31.js +12 -6
  87. package/lib/esm/sdk/core_sdk_31.js.map +1 -1
  88. package/lib/esm/sdk/core_sdk_40.js +12 -6
  89. package/lib/esm/sdk/core_sdk_40.js.map +1 -1
  90. package/lib/index.d.ts +1 -1
  91. package/lib/index.js +2 -22
  92. package/lib/index.js.map +1 -1
  93. package/lib/sdk/core_sdk.js +1 -3
  94. package/lib/sdk/core_sdk.js.map +1 -1
  95. package/lib/sdk/core_sdk2.js +1 -7
  96. package/lib/sdk/core_sdk2.js.map +1 -1
  97. package/lib/sdk/core_sdk_31.js +1 -10
  98. package/lib/sdk/core_sdk_31.js.map +1 -1
  99. package/lib/sdk/core_sdk_40.js +1 -10
  100. package/lib/sdk/core_sdk_40.js.map +1 -1
  101. package/package.json +11 -11
@@ -3,91 +3,55 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ExtensionProvider2 = ExtensionProvider2;
7
6
  exports.ExtensionContext2 = void 0;
8
-
7
+ exports.ExtensionProvider2 = ExtensionProvider2;
9
8
  var _react = _interopRequireWildcard(require("react"));
10
-
11
9
  var _extensionSdk = require("@looker/extension-sdk");
12
-
13
10
  var _sdk = require("@looker/sdk");
14
-
15
11
  var _ExtensionConnector = require("../ExtensionConnector");
16
-
17
12
  var _core_sdk = require("../../sdk/core_sdk2");
18
-
13
+ var _excluded = ["children", "type"];
19
14
  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); }
20
-
21
15
  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; }
22
-
23
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
24
-
25
- 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; }
26
-
27
- 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; }
28
-
29
- 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; }
30
-
16
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
+ 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; }
18
+ 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; }
19
+ 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; }
20
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
21
+ 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); }
31
22
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
32
-
33
23
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
34
-
35
24
  var ExtensionContext2 = _react.default.createContext(undefined);
36
-
37
25
  exports.ExtensionContext2 = ExtensionContext2;
38
-
39
26
  function ExtensionProvider2(props) {
40
27
  var {
41
- children,
42
- type
43
- } = props,
44
- rest = _objectWithoutProperties(props, ["children", "type"]);
45
-
28
+ children,
29
+ type
30
+ } = props,
31
+ rest = _objectWithoutProperties(props, _excluded);
46
32
  var [extensionData, setExtensionData] = (0, _react.useState)({});
47
33
  var apiVersion = type.ApiVersion;
48
-
49
34
  var connectedCallback = extensionHost => {
50
35
  var coreSDK;
51
-
52
36
  if (apiVersion) {
53
37
  coreSDK = _sdk.LookerExtensionSDK.createClient(new _extensionSdk.SdkConnection(extensionHost, apiVersion), type);
54
38
  }
55
-
56
39
  (0, _core_sdk.registerCoreSDK2)(coreSDK);
57
- var {
58
- visualizationSDK,
59
- tileSDK,
60
- lookerHostData
61
- } = extensionHost;
62
- var {
63
- visualizationData
64
- } = visualizationSDK;
65
- var {
66
- tileHostData
67
- } = tileSDK;
68
40
  setExtensionData(previousState => {
69
41
  return _objectSpread(_objectSpread({}, previousState), {}, {
70
42
  extensionSDK: extensionHost,
71
- coreSDK,
72
- visualizationSDK,
73
- tileSDK,
74
- visualizationData,
75
- tileHostData,
76
- lookerHostData
43
+ coreSDK
77
44
  });
78
45
  });
79
46
  };
80
-
81
47
  var unloadedCallback = () => {
82
48
  (0, _core_sdk.unregisterCoreSDK2)();
83
49
  };
84
-
85
50
  var updateContextData = updatedContextData => {
86
51
  setExtensionData(previousState => {
87
52
  return _objectSpread(_objectSpread({}, previousState), updatedContextData);
88
53
  });
89
54
  };
90
-
91
55
  return _react.default.createElement(ExtensionContext2.Provider, {
92
56
  value: extensionData
93
57
  }, _react.default.createElement(_ExtensionConnector.ExtensionConnector, _extends({}, rest, {
@@ -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","visualizationSDK","tileSDK","lookerHostData","visualizationData","tileHostData","previousState","extensionSDK","unloadedCallback","updateContextData","updatedContextData"],"mappings":";;;;;;;;AA0BA;;AAEA;;AACA;;AAKA;;AACA;;;;;;;;;;;;;;;;;;AASO,IAAMA,iBAAiB,GAAGC,eAAMC,aAAN,CAG/BC,SAH+B,CAA1B;;;;AAcA,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;AACA,QAAM;AAAEI,MAAAA,gBAAF;AAAoBC,MAAAA,OAApB;AAA6BC,MAAAA;AAA7B,QAAgDP,aAAtD;AACA,QAAM;AAAEQ,MAAAA;AAAF,QAAwBH,gBAA9B;AACA,QAAM;AAAEI,MAAAA;AAAF,QAAmBH,OAAzB;AACAV,IAAAA,gBAAgB,CAAEc,aAAD,IAAwB;AACvC,6CACKA,aADL;AAEEC,QAAAA,YAAY,EAAEX,aAFhB;AAGEC,QAAAA,OAHF;AAIEI,QAAAA,gBAJF;AAKEC,QAAAA,OALF;AAMEE,QAAAA,iBANF;AAOEC,QAAAA,YAPF;AAQEF,QAAAA;AARF;AAUD,KAXe,CAAhB;AAYD,GAxBD;;AA0BA,MAAMK,gBAAgB,GAAG,MAAM;AAC7B;AACD,GAFD;;AAIA,MAAMC,iBAAiB,GACrBC,kBADwB,IAErB;AACHlB,IAAAA,gBAAgB,CAAEc,aAAD,IAA6C;AAC5D,6CACKA,aADL,GAEKI,kBAFL;AAID,KALe,CAAhB;AAMD,GATD;;AAWA,SACE,6BAAC,iBAAD,CAAmB,QAAnB;AAA4B,IAAA,KAAK,EAAEnB;AAAnC,KACE,6BAAC,sCAAD,eACMD,IADN;AAEE,IAAA,WAAW,EAAEC,aAFf;AAGE,IAAA,iBAAiB,EAAEI,iBAHrB;AAIE,IAAA,iBAAiB,EAAEc,iBAJrB;AAKE,IAAA,gBAAgB,EAAED;AALpB,MAOGpB,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 } 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}\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 const { visualizationSDK, tileSDK, lookerHostData } = extensionHost\n const { visualizationData } = visualizationSDK\n const { tileHostData } = tileSDK\n setExtensionData((previousState: any) => {\n return {\n ...previousState,\n extensionSDK: extensionHost,\n coreSDK,\n visualizationSDK,\n tileSDK,\n visualizationData,\n tileHostData,\n lookerHostData,\n }\n })\n }\n\n const unloadedCallback = () => {\n unregisterCoreSDK2()\n }\n\n const updateContextData = (\n updatedContextData: Partial<BaseExtensionContextData>\n ) => {\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,"file":"ExtensionProvider2.js","names":["ExtensionContext2","React","createContext","undefined","ExtensionProvider2","props","children","type","rest","extensionData","setExtensionData","useState","apiVersion","ApiVersion","connectedCallback","extensionHost","coreSDK","LookerExtensionSDK","createClient","SdkConnection","registerCoreSDK2","previousState","extensionSDK","unloadedCallback","unregisterCoreSDK2","updateContextData","updatedContextData"],"sources":["../../../src/components/ExtensionProvider2/ExtensionProvider2.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 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}\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"],"mappings":";;;;;;;AA0BA;AAEA;AACA;AAKA;AACA;AAA0E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASnE,IAAMA,iBAAiB,GAAGC,cAAK,CAACC,aAAa,CAGlDC,SAAS,CACV;AAAA;AAUM,SAASC,kBAAkB,CAAIC,KAAiC,EAAE;EACvE,IAAM;MAAEC,QAAQ;MAAEC;IAAc,CAAC,GAAGF,KAAK;IAAdG,IAAI,4BAAKH,KAAK;EACzC,IAAM,CAACI,aAAa,EAAEC,gBAAgB,CAAC,GAAG,IAAAC,eAAQ,EAChD,CAAC,CAAC,CACH;EACD,IAAMC,UAAU,GAAIL,IAAI,CAASM,UAAU;EAE3C,IAAMC,iBAAiB,GAAIC,aAA+B,IAAK;IAC7D,IAAIC,OAAY;IAChB,IAAIJ,UAAU,EAAE;MACdI,OAAO,GAAGC,uBAAkB,CAACC,YAAY,CACvC,IAAIC,2BAAa,CAACJ,aAAa,EAAEH,UAAU,CAAC,EAC5CL,IAAI,CACL;IACH;IACA,IAAAa,0BAAgB,EAACJ,OAAO,CAAC;IACzBN,gBAAgB,CAAEW,aAAkB,IAAK;MACvC,uCACKA,aAAa;QAChBC,YAAY,EAAEP,aAAa;QAC3BC;MAAO;IAEX,CAAC,CAAC;EACJ,CAAC;EAED,IAAMO,gBAAgB,GAAG,MAAM;IAC7B,IAAAC,4BAAkB,GAAE;EACtB,CAAC;EAED,IAAMC,iBAAiB,GAAIC,kBAA4C,IAAK;IAC1EhB,gBAAgB,CAAEW,aAAuC,IAAK;MAC5D,uCACKA,aAAa,GACbK,kBAAkB;IAEzB,CAAC,CAAC;EACJ,CAAC;EAED,OACE,6BAAC,iBAAiB,CAAC,QAAQ;IAAC,KAAK,EAAEjB;EAAe,GAChD,6BAAC,sCAAkB,eACbD,IAAI;IACR,WAAW,EAAEC,aAAc;IAC3B,iBAAiB,EAAEK,iBAAkB;IACrC,iBAAiB,EAAEW,iBAAkB;IACrC,gBAAgB,EAAEF;EAAiB,IAElCjB,QAAQ,CACU,CACM;AAEjC"}
@@ -3,9 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
-
7
6
  var _ExtensionProvider = require("./ExtensionProvider2");
8
-
9
7
  Object.keys(_ExtensionProvider).forEach(function (key) {
10
8
  if (key === "default" || key === "__esModule") return;
11
9
  if (key in exports && exports[key] === _ExtensionProvider[key]) return;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ExtensionProvider2/index.ts"],"names":[],"mappings":";;;;;;AA0BA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './ExtensionProvider2'\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/ExtensionProvider2/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './ExtensionProvider2'\n"],"mappings":";;;;;AA0BA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -3,83 +3,49 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ExtensionProvider40 = ExtensionProvider40;
7
6
  exports.ExtensionContext40 = void 0;
8
-
7
+ exports.ExtensionProvider40 = ExtensionProvider40;
9
8
  var _react = _interopRequireWildcard(require("react"));
10
-
11
9
  var _extensionSdk = require("@looker/extension-sdk");
12
-
13
10
  var _ExtensionConnector = require("../ExtensionConnector");
14
-
15
11
  var _core_sdk_ = require("../../sdk/core_sdk_40");
16
-
12
+ var _excluded = ["children"];
17
13
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
18
-
19
14
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
20
-
21
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
22
-
23
- 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; }
24
-
25
- 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; }
26
-
27
- 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; }
28
-
15
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
16
+ 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; }
17
+ 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; }
18
+ 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; }
19
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
20
+ 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); }
29
21
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
30
-
31
22
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
32
-
33
23
  var ExtensionContext40 = _react.default.createContext(undefined);
34
-
35
24
  exports.ExtensionContext40 = ExtensionContext40;
36
-
37
25
  function ExtensionProvider40(props) {
38
26
  var {
39
- children
40
- } = props,
41
- rest = _objectWithoutProperties(props, ["children"]);
42
-
27
+ children
28
+ } = props,
29
+ rest = _objectWithoutProperties(props, _excluded);
43
30
  var [extensionData, setExtensionData] = (0, _react.useState)({});
44
-
45
31
  var connectedCallback = extensionHost => {
46
32
  var coreSDK = _extensionSdk.LookerExtensionSDK.create40Client(extensionHost);
47
-
48
33
  (0, _core_sdk_.registerCore40SDK)(coreSDK);
49
- var {
50
- visualizationSDK,
51
- tileSDK,
52
- lookerHostData
53
- } = extensionHost;
54
- var {
55
- visualizationData
56
- } = visualizationSDK;
57
- var {
58
- tileHostData
59
- } = tileSDK;
60
34
  setExtensionData(previousState => {
61
35
  return _objectSpread(_objectSpread({}, previousState), {}, {
62
36
  extensionSDK: extensionHost,
63
- coreSDK,
64
- visualizationSDK,
65
- tileSDK,
66
- visualizationData,
67
- tileHostData,
68
- lookerHostData
37
+ coreSDK
69
38
  });
70
39
  });
71
40
  };
72
-
73
41
  var unloadedCallback = () => {
74
42
  (0, _core_sdk_.unregisterCore40SDK)();
75
43
  };
76
-
77
44
  var updateContextData = updatedContextData => {
78
45
  setExtensionData(previousState => {
79
46
  return _objectSpread(_objectSpread({}, previousState), updatedContextData);
80
47
  });
81
48
  };
82
-
83
49
  return _react.default.createElement(ExtensionContext40.Provider, {
84
50
  value: extensionData
85
51
  }, _react.default.createElement(_ExtensionConnector.ExtensionConnector, _extends({}, rest, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ExtensionProvider40/ExtensionProvider40.tsx"],"names":["ExtensionContext40","React","createContext","undefined","ExtensionProvider40","props","children","rest","extensionData","setExtensionData","connectedCallback","extensionHost","coreSDK","LookerExtensionSDK","create40Client","visualizationSDK","tileSDK","lookerHostData","visualizationData","tileHostData","previousState","extensionSDK","unloadedCallback","updateContextData","updatedContextData"],"mappings":";;;;;;;;AA0BA;;AAEA;;AAMA;;AACA;;;;;;;;;;;;;;;;;;AASO,IAAMA,kBAAkB,GAAGC,eAAMC,aAAN,CAChCC,SADgC,CAA3B;;;;AAUA,SAASC,mBAAT,CAA6BC,KAA7B,EAA8D;AACnE,MAAM;AAAEC,IAAAA;AAAF,MAAwBD,KAA9B;AAAA,MAAqBE,IAArB,4BAA8BF,KAA9B;;AACA,MAAM,CAACG,aAAD,EAAgBC,gBAAhB,IAAoC,qBACxC,EADwC,CAA1C;;AAIA,MAAMC,iBAAiB,GAAIC,aAAD,IAAqC;AAC7D,QAAMC,OAAqB,GACzBC,iCAAmBC,cAAnB,CAAkCH,aAAlC,CADF;;AAEA,sCAAkBC,OAAlB;AACA,QAAM;AAAEG,MAAAA,gBAAF;AAAoBC,MAAAA,OAApB;AAA6BC,MAAAA;AAA7B,QAAgDN,aAAtD;AACA,QAAM;AAAEO,MAAAA;AAAF,QAAwBH,gBAA9B;AACA,QAAM;AAAEI,MAAAA;AAAF,QAAmBH,OAAzB;AACAP,IAAAA,gBAAgB,CAAEW,aAAD,IAAwB;AACvC,6CACKA,aADL;AAEEC,QAAAA,YAAY,EAAEV,aAFhB;AAGEC,QAAAA,OAHF;AAIEG,QAAAA,gBAJF;AAKEC,QAAAA,OALF;AAMEE,QAAAA,iBANF;AAOEC,QAAAA,YAPF;AAQEF,QAAAA;AARF;AAUD,KAXe,CAAhB;AAYD,GAnBD;;AAqBA,MAAMK,gBAAgB,GAAG,MAAM;AAC7B;AACD,GAFD;;AAIA,MAAMC,iBAAiB,GACrBC,kBADwB,IAErB;AACHf,IAAAA,gBAAgB,CAAEW,aAAD,IAA2C;AAC1D,6CACKA,aADL,GAEKI,kBAFL;AAID,KALe,CAAhB;AAMD,GATD;;AAWA,SACE,6BAAC,kBAAD,CAAoB,QAApB;AAA6B,IAAA,KAAK,EAAEhB;AAApC,KACE,6BAAC,sCAAD,eACMD,IADN;AAEE,IAAA,WAAW,EAAEC,aAFf;AAGE,IAAA,iBAAiB,EAAEE,iBAHrB;AAIE,IAAA,iBAAiB,EAAEa,iBAJrB;AAKE,IAAA,gBAAgB,EAAED;AALpB,MAOGhB,QAPH,CADF,CADF;AAaD","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 React, { useState } from 'react'\nimport type { ExtensionHostApi } from '@looker/extension-sdk'\nimport { LookerExtensionSDK } from '@looker/extension-sdk'\nimport type { ILooker40SDK, Looker40SDK } from '@looker/sdk'\nimport type {\n BaseExtensionContextData,\n ExtensionProviderProps,\n} from '../ExtensionConnector'\nimport { ExtensionConnector } from '../ExtensionConnector'\nimport { registerCore40SDK, unregisterCore40SDK } from '../../sdk/core_sdk_40'\n\nexport interface ExtensionContextData40 extends BaseExtensionContextData {\n coreSDK: ILooker40SDK\n}\n\n/**\n * React context provider for extension API and Looker SDK 4.0.\n */\nexport const ExtensionContext40 = React.createContext<ExtensionContextData40>(\n undefined as any // no one will ever see this undefined!\n)\n\nexport interface ExtensionProvider40Props extends ExtensionProviderProps {}\n\n/**\n * ExtensionProvider40 component. Provides access to the extension API and SDK (use\n * ExtensionContext40) and react routing services.\n */\nexport function ExtensionProvider40(props: ExtensionProvider40Props) {\n const { children, ...rest } = props\n const [extensionData, setExtensionData] = useState<ExtensionContextData40>(\n {} as ExtensionContextData40\n )\n\n const connectedCallback = (extensionHost: ExtensionHostApi) => {\n const coreSDK: ILooker40SDK =\n LookerExtensionSDK.create40Client(extensionHost)\n registerCore40SDK(coreSDK as Looker40SDK)\n const { visualizationSDK, tileSDK, lookerHostData } = extensionHost\n const { visualizationData } = visualizationSDK\n const { tileHostData } = tileSDK\n setExtensionData((previousState: any) => {\n return {\n ...previousState,\n extensionSDK: extensionHost,\n coreSDK,\n visualizationSDK,\n tileSDK,\n visualizationData,\n tileHostData,\n lookerHostData,\n }\n })\n }\n\n const unloadedCallback = () => {\n unregisterCore40SDK()\n }\n\n const updateContextData = (\n updatedContextData: Partial<BaseExtensionContextData>\n ) => {\n setExtensionData((previousState: ExtensionContextData40) => {\n return {\n ...previousState,\n ...updatedContextData,\n }\n })\n }\n\n return (\n <ExtensionContext40.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 </ExtensionContext40.Provider>\n )\n}\n"],"file":"ExtensionProvider40.js"}
1
+ {"version":3,"file":"ExtensionProvider40.js","names":["ExtensionContext40","React","createContext","undefined","ExtensionProvider40","props","children","rest","extensionData","setExtensionData","useState","connectedCallback","extensionHost","coreSDK","LookerExtensionSDK","create40Client","registerCore40SDK","previousState","extensionSDK","unloadedCallback","unregisterCore40SDK","updateContextData","updatedContextData"],"sources":["../../../src/components/ExtensionProvider40/ExtensionProvider40.tsx"],"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 React, { useState } from 'react'\nimport type { ExtensionHostApi } from '@looker/extension-sdk'\nimport { LookerExtensionSDK } from '@looker/extension-sdk'\nimport type { ILooker40SDK, Looker40SDK } from '@looker/sdk'\nimport type {\n BaseExtensionContextData,\n ExtensionProviderProps,\n} from '../ExtensionConnector'\nimport { ExtensionConnector } from '../ExtensionConnector'\nimport { registerCore40SDK, unregisterCore40SDK } from '../../sdk/core_sdk_40'\n\nexport interface ExtensionContextData40 extends BaseExtensionContextData {\n coreSDK: ILooker40SDK\n}\n\n/**\n * React context provider for extension API and Looker SDK 4.0.\n */\nexport const ExtensionContext40 = React.createContext<ExtensionContextData40>(\n undefined as any // no one will ever see this undefined!\n)\n\nexport interface ExtensionProvider40Props extends ExtensionProviderProps {}\n\n/**\n * ExtensionProvider40 component. Provides access to the extension API and SDK (use\n * ExtensionContext40) and react routing services.\n */\nexport function ExtensionProvider40(props: ExtensionProvider40Props) {\n const { children, ...rest } = props\n const [extensionData, setExtensionData] = useState<ExtensionContextData40>(\n {} as ExtensionContextData40\n )\n\n const connectedCallback = (extensionHost: ExtensionHostApi) => {\n const coreSDK: ILooker40SDK =\n LookerExtensionSDK.create40Client(extensionHost)\n registerCore40SDK(coreSDK as Looker40SDK)\n setExtensionData((previousState: any) => {\n return {\n ...previousState,\n extensionSDK: extensionHost,\n coreSDK,\n }\n })\n }\n\n const unloadedCallback = () => {\n unregisterCore40SDK()\n }\n\n const updateContextData = (updatedContextData: BaseExtensionContextData) => {\n setExtensionData((previousState: ExtensionContextData40) => {\n return {\n ...previousState,\n ...updatedContextData,\n }\n })\n }\n\n return (\n <ExtensionContext40.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 </ExtensionContext40.Provider>\n )\n}\n"],"mappings":";;;;;;;AA0BA;AAEA;AAMA;AACA;AAA8E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASvE,IAAMA,kBAAkB,GAAGC,cAAK,CAACC,aAAa,CACnDC,SAAS,CACV;AAAA;AAQM,SAASC,mBAAmB,CAACC,KAA+B,EAAE;EACnE,IAAM;MAAEC;IAAkB,CAAC,GAAGD,KAAK;IAAdE,IAAI,4BAAKF,KAAK;EACnC,IAAM,CAACG,aAAa,EAAEC,gBAAgB,CAAC,GAAG,IAAAC,eAAQ,EAChD,CAAC,CAAC,CACH;EAED,IAAMC,iBAAiB,GAAIC,aAA+B,IAAK;IAC7D,IAAMC,OAAqB,GACzBC,gCAAkB,CAACC,cAAc,CAACH,aAAa,CAAC;IAClD,IAAAI,4BAAiB,EAACH,OAAO,CAAgB;IACzCJ,gBAAgB,CAAEQ,aAAkB,IAAK;MACvC,uCACKA,aAAa;QAChBC,YAAY,EAAEN,aAAa;QAC3BC;MAAO;IAEX,CAAC,CAAC;EACJ,CAAC;EAED,IAAMM,gBAAgB,GAAG,MAAM;IAC7B,IAAAC,8BAAmB,GAAE;EACvB,CAAC;EAED,IAAMC,iBAAiB,GAAIC,kBAA4C,IAAK;IAC1Eb,gBAAgB,CAAEQ,aAAqC,IAAK;MAC1D,uCACKA,aAAa,GACbK,kBAAkB;IAEzB,CAAC,CAAC;EACJ,CAAC;EAED,OACE,6BAAC,kBAAkB,CAAC,QAAQ;IAAC,KAAK,EAAEd;EAAc,GAChD,6BAAC,sCAAkB,eACbD,IAAI;IACR,WAAW,EAAEC,aAAc;IAC3B,iBAAiB,EAAEG,iBAAkB;IACrC,iBAAiB,EAAEU,iBAAkB;IACrC,gBAAgB,EAAEF;EAAiB,IAElCb,QAAQ,CACU,CACO;AAElC"}
@@ -3,9 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
-
7
6
  var _ExtensionProvider = require("./ExtensionProvider40");
8
-
9
7
  Object.keys(_ExtensionProvider).forEach(function (key) {
10
8
  if (key === "default" || key === "__esModule") return;
11
9
  if (key in exports && exports[key] === _ExtensionProvider[key]) return;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ExtensionProvider40/index.ts"],"names":[],"mappings":";;;;;;AA0BA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","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 './ExtensionProvider40'\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/ExtensionProvider40/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 './ExtensionProvider40'\n"],"mappings":";;;;;AA0BA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -4,69 +4,38 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ExtensionProviderBase = exports.ExtensionContextBase = void 0;
7
-
8
7
  var _react = _interopRequireWildcard(require("react"));
9
-
10
8
  var _ExtensionConnector = require("../ExtensionConnector");
11
-
9
+ var _excluded = ["children"];
12
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
-
14
11
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
-
16
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
-
18
- 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; }
19
-
20
- 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; }
21
-
22
- 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; }
23
-
12
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
13
+ 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; }
14
+ 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; }
15
+ 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; }
16
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
17
+ 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); }
24
18
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
25
-
26
19
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
27
-
28
20
  var ExtensionContextBase = _react.default.createContext(undefined);
29
-
30
21
  exports.ExtensionContextBase = ExtensionContextBase;
31
-
32
22
  var ExtensionProviderBase = _ref => {
33
23
  var {
34
- children
35
- } = _ref,
36
- props = _objectWithoutProperties(_ref, ["children"]);
37
-
24
+ children
25
+ } = _ref,
26
+ props = _objectWithoutProperties(_ref, _excluded);
38
27
  var [extensionData, setExtensionData] = (0, _react.useState)({});
39
-
40
28
  var connectedCallback = extensionHost => {
41
- var {
42
- visualizationSDK,
43
- tileSDK,
44
- lookerHostData
45
- } = extensionHost;
46
- var {
47
- visualizationData
48
- } = visualizationSDK;
49
- var {
50
- tileHostData
51
- } = tileSDK;
52
29
  setExtensionData(previousState => {
53
30
  return _objectSpread(_objectSpread({}, previousState), {}, {
54
- extensionSDK: extensionHost,
55
- visualizationSDK,
56
- tileSDK,
57
- visualizationData,
58
- tileHostData,
59
- lookerHostData
31
+ extensionSDK: extensionHost
60
32
  });
61
33
  });
62
34
  };
63
-
64
35
  var unloadedCallback = () => {};
65
-
66
36
  var updateContextData = contextData => {
67
- setExtensionData(previousContextData => _objectSpread(_objectSpread({}, previousContextData), contextData));
37
+ setExtensionData(contextData);
68
38
  };
69
-
70
39
  return _react.default.createElement(ExtensionContextBase.Provider, {
71
40
  value: extensionData
72
41
  }, _react.default.createElement(_ExtensionConnector.ExtensionConnector, _extends({}, props, {
@@ -76,6 +45,5 @@ var ExtensionProviderBase = _ref => {
76
45
  unloadedCallback: unloadedCallback
77
46
  }), children));
78
47
  };
79
-
80
48
  exports.ExtensionProviderBase = ExtensionProviderBase;
81
49
  //# sourceMappingURL=ExtensionProviderBase.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ExtensionProviderBase/ExtensionProviderBase.tsx"],"names":["ExtensionContextBase","React","createContext","undefined","ExtensionProviderBase","children","props","extensionData","setExtensionData","connectedCallback","extensionHost","visualizationSDK","tileSDK","lookerHostData","visualizationData","tileHostData","previousState","extensionSDK","unloadedCallback","updateContextData","contextData","previousContextData"],"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;AAC7D,QAAM;AAAEC,MAAAA,gBAAF;AAAoBC,MAAAA,OAApB;AAA6BC,MAAAA;AAA7B,QAAgDH,aAAtD;AACA,QAAM;AAAEI,MAAAA;AAAF,QAAwBH,gBAA9B;AACA,QAAM;AAAEI,MAAAA;AAAF,QAAmBH,OAAzB;AACAJ,IAAAA,gBAAgB,CAAEQ,aAAD,IAA6C;AAC5D,6CACKA,aADL;AAEEC,QAAAA,YAAY,EAAEP,aAFhB;AAGEC,QAAAA,gBAHF;AAIEC,QAAAA,OAJF;AAKEE,QAAAA,iBALF;AAMEC,QAAAA,YANF;AAOEF,QAAAA;AAPF;AASD,KAVe,CAAhB;AAWD,GAfD;;AAiBA,MAAMK,gBAAgB,GAAG,MAAM,CAE9B,CAFD;;AAIA,MAAMC,iBAAiB,GACrBC,WADwB,IAErB;AACHZ,IAAAA,gBAAgB,CAAEa,mBAAD,oCACZA,mBADY,GAEZD,WAFY,CAAD,CAAhB;AAID,GAPD;;AASA,SACE,6BAAC,oBAAD,CAAsB,QAAtB;AAA+B,IAAA,KAAK,EAAEb;AAAtC,KACE,6BAAC,sCAAD,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,CAnDM","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 const { visualizationSDK, tileSDK, lookerHostData } = extensionHost\n const { visualizationData } = visualizationSDK\n const { tileHostData } = tileSDK\n setExtensionData((previousState: BaseExtensionContextData) => {\n return {\n ...previousState,\n extensionSDK: extensionHost,\n visualizationSDK,\n tileSDK,\n visualizationData,\n tileHostData,\n lookerHostData,\n }\n })\n }\n\n const unloadedCallback = () => {\n // noop\n }\n\n const updateContextData = (\n contextData: Partial<BaseExtensionContextData>\n ) => {\n setExtensionData((previousContextData) => ({\n ...previousContextData,\n ...contextData,\n }))\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,"file":"ExtensionProviderBase.js","names":["ExtensionContextBase","React","createContext","undefined","ExtensionProviderBase","children","props","extensionData","setExtensionData","useState","connectedCallback","extensionHost","previousState","extensionSDK","unloadedCallback","updateContextData","contextData"],"sources":["../../../src/components/ExtensionProviderBase/ExtensionProviderBase.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 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"],"mappings":";;;;;;AA0BA;AAMA;AAA0D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKnD,IAAMA,oBAAoB,GAC/BC,cAAK,CAACC,aAAa,CACjBC,SAAS,CACV;AAAA;AAMI,IAAMC,qBAAuD,GAAG,QAGjE;EAAA,IAHkE;MACtEC;IAEF,CAAC;IADIC,KAAK;EAER,IAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAG,IAAAC,eAAQ,EAChD,CAAC,CAAC,CACH;EAED,IAAMC,iBAAiB,GAAIC,aAA+B,IAAK;IAC7DH,gBAAgB,CAAEI,aAAuC,IAAK;MAC5D,uCACKA,aAAa;QAChBC,YAAY,EAAEF;MAAa;IAE/B,CAAC,CAAC;EACJ,CAAC;EAED,IAAMG,gBAAgB,GAAG,MAAM,CAE/B,CAAC;EAED,IAAMC,iBAAiB,GAAIC,WAAqC,IAAK;IACnER,gBAAgB,CAACQ,WAAW,CAAC;EAC/B,CAAC;EAED,OACE,6BAAC,oBAAoB,CAAC,QAAQ;IAAC,KAAK,EAAET;EAAe,GACnD,6BAAC,sCAAkB,eACbD,KAAK;IACT,WAAW,EAAEC,aAAc;IAC3B,iBAAiB,EAAEG,iBAAkB;IACrC,iBAAiB,EAAEK,iBAAkB;IACrC,gBAAgB,EAAED;EAAiB,IAElCT,QAAQ,CACU,CACS;AAEpC,CAAC;AAAA"}
@@ -3,9 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
-
7
6
  var _ExtensionProviderBase = require("./ExtensionProviderBase");
8
-
9
7
  Object.keys(_ExtensionProviderBase).forEach(function (key) {
10
8
  if (key === "default" || key === "__esModule") return;
11
9
  if (key in exports && exports[key] === _ExtensionProviderBase[key]) return;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ExtensionProviderBase/index.ts"],"names":[],"mappings":";;;;;;AA0BA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './ExtensionProviderBase'\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/ExtensionProviderBase/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './ExtensionProviderBase'\n"],"mappings":";;;;;AA0BA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.RouteChangeListener = void 0;
7
-
8
7
  var _react = _interopRequireWildcard(require("react"));
9
-
10
8
  var _reactRouterDom = require("react-router-dom");
11
-
12
9
  var _clone = _interopRequireDefault(require("lodash/clone"));
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
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); }
17
-
18
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; }
19
-
20
13
  var RouteChangeListener = _ref => {
21
14
  var {
22
15
  onPathnameChange,
@@ -31,11 +24,9 @@ var RouteChangeListener = _ref => {
31
24
  if (onPathnameChange) {
32
25
  onPathnameChange(location.pathname);
33
26
  }
34
-
35
27
  if (onRouteChange) {
36
28
  onRouteChange(location.pathname + location.search, (0, _clone.default)(location.state));
37
29
  }
38
-
39
30
  ;
40
31
  extensionHost.clientRouteChanged(location.pathname + location.search, location.state);
41
32
  }, [location]);
@@ -46,6 +37,5 @@ var RouteChangeListener = _ref => {
46
37
  }, [hostRoute]);
47
38
  return _react.default.createElement(_react.default.Fragment, null);
48
39
  };
49
-
50
40
  exports.RouteChangeListener = RouteChangeListener;
51
41
  //# sourceMappingURL=RouteChangeListener.js.map
@@ -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 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
+ {"version":3,"file":"RouteChangeListener.js","names":["RouteChangeListener","onPathnameChange","onRouteChange","extensionHost","hostRoute","hostRouteState","history","useHistory","location","useLocation","useEffect","pathname","search","clone","state","clientRouteChanged","push"],"sources":["../../../src/components/RouteChangeListener/RouteChangeListener.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 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"],"mappings":";;;;;;AA0BA;AACA;AAEA;AAAgC;AAAA;AAAA;AAGzB,IAAMA,mBAAuD,GAAG,QAMjE;EAAA,IANkE;IACtEC,gBAAgB;IAChBC,aAAa;IACbC,aAAa;IACbC,SAAS;IACTC;EACF,CAAC;EACC,IAAMC,OAAO,GAAG,IAAAC,0BAAU,GAAE;EAC5B,IAAMC,QAAQ,GAAG,IAAAC,2BAAW,GAAE;EAE9B,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAIT,gBAAgB,EAAE;MACpBA,gBAAgB,CAACO,QAAQ,CAACG,QAAQ,CAAC;IACrC;IACA,IAAIT,aAAa,EAAE;MACjBA,aAAa,CAACM,QAAQ,CAACG,QAAQ,GAAGH,QAAQ,CAACI,MAAM,EAAE,IAAAC,cAAK,EAACL,QAAQ,CAACM,KAAK,CAAC,CAAC;IAC3E;IACA;IAAEX,aAAa,CAAsBY,kBAAkB,CACrDP,QAAQ,CAACG,QAAQ,GAAGH,QAAQ,CAACI,MAAM,EACnCJ,QAAQ,CAACM,KAAK,CACf;EACH,CAAC,EAAE,CAACN,QAAQ,CAAC,CAAC;EAEd,IAAAE,gBAAS,EAAC,MAAM;IACd,IAAIN,SAAS,EAAE;MACbE,OAAO,CAACU,IAAI,CAACZ,SAAS,EAAEC,cAAc,CAAC;IACzC;EACF,CAAC,EAAE,CAACD,SAAS,CAAC,CAAC;EACf,OAAO,2DAAK;AACd,CAAC;AAAA"}
@@ -3,9 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
-
7
6
  var _types = require("./types");
8
-
9
7
  Object.keys(_types).forEach(function (key) {
10
8
  if (key === "default" || key === "__esModule") return;
11
9
  if (key in exports && exports[key] === _types[key]) return;
@@ -16,9 +14,7 @@ Object.keys(_types).forEach(function (key) {
16
14
  }
17
15
  });
18
16
  });
19
-
20
17
  var _RouteChangeListener = require("./RouteChangeListener");
21
-
22
18
  Object.keys(_RouteChangeListener).forEach(function (key) {
23
19
  if (key === "default" || key === "__esModule") return;
24
20
  if (key in exports && exports[key] === _RouteChangeListener[key]) return;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/RouteChangeListener/index.ts"],"names":[],"mappings":";;;;;;AA0BA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './types'\nexport * from './RouteChangeListener'\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/RouteChangeListener/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './types'\nexport * from './RouteChangeListener'\n"],"mappings":";;;;;AA0BA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -1,2 +1,2 @@
1
- "use strict";
1
+
2
2
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"types.js"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/components/RouteChangeListener/types.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 { ExtensionSDK } from '@looker/extension-sdk'\n\nexport interface RouteChangeListenerProps {\n onPathnameChange?: (pathname: string) => void\n onRouteChange?: (route: string, routeState?: any) => void\n extensionHost?: ExtensionSDK\n hostRoute?: string\n hostRouteState?: any\n}\n"],"mappings":""}