@hopara/iframe 0.3.38 → 0.3.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ import Hopara from 'hopara'
|
|
|
26
26
|
class MyComponent extends React.Component {
|
|
27
27
|
componentDidMount(): void {
|
|
28
28
|
const hopara = Hopara.init({
|
|
29
|
-
|
|
29
|
+
visualizationId: 'my-hopara-viz',
|
|
30
30
|
accessToken: 'my-hopara-token',
|
|
31
31
|
targetElementId: 'my-target-element',
|
|
32
32
|
})
|
|
@@ -53,7 +53,7 @@ class MyComponent extends React.Component {
|
|
|
53
53
|
<script>
|
|
54
54
|
document.addEventListener("DOMContentLoaded", function(){
|
|
55
55
|
const hopara = Hopara.init({
|
|
56
|
-
|
|
56
|
+
visualizationId: 'my-hopara-viz',
|
|
57
57
|
accessToken: 'my-hopara-token',
|
|
58
58
|
targetElementId: 'my-target-element',
|
|
59
59
|
})
|
|
@@ -101,7 +101,7 @@ hopara.update({accessToken: 'newAccessToken'})
|
|
|
101
101
|
```typescript
|
|
102
102
|
{
|
|
103
103
|
// The vizualization
|
|
104
|
-
|
|
104
|
+
visualizationId: string
|
|
105
105
|
|
|
106
106
|
// The accessToken provided by auth API
|
|
107
107
|
accessToken: string
|
|
@@ -183,7 +183,7 @@ const customDataLoaders = [{
|
|
|
183
183
|
}]
|
|
184
184
|
|
|
185
185
|
Hopara.init({
|
|
186
|
-
|
|
186
|
+
visualizationId: 'my-hopara-viz',
|
|
187
187
|
accessToken: 'my-hopara-token',
|
|
188
188
|
targetElementId: 'my-target-element',
|
|
189
189
|
dataLoaders: customDataLoaders,
|
|
@@ -220,7 +220,7 @@ const customDataUpdaters = [{
|
|
|
220
220
|
|
|
221
221
|
|
|
222
222
|
Hopara.init({
|
|
223
|
-
|
|
223
|
+
visualizationId: 'my-hopara-viz',
|
|
224
224
|
accessToken: 'my-hopara-token',
|
|
225
225
|
targetElementId: 'my-target-element',
|
|
226
226
|
dataUpdaters: customDataUpdaters,
|
|
@@ -257,7 +257,7 @@ You can manually trigger a data refresh by calling the refresh method. This will
|
|
|
257
257
|
|
|
258
258
|
```html
|
|
259
259
|
const hopara = Hopara.init({
|
|
260
|
-
|
|
260
|
+
visualizationId: 'my-hopara-viz',
|
|
261
261
|
accessToken: 'my-hopara-token',
|
|
262
262
|
targetElementId: 'my-target-element',
|
|
263
263
|
})
|
|
@@ -276,7 +276,7 @@ The available options are `'none'`, `'building'`, `'dark'`, `'light'`, `'light-s
|
|
|
276
276
|
|
|
277
277
|
```jsx
|
|
278
278
|
Hopara.init({
|
|
279
|
-
|
|
279
|
+
visualizationId: 'my-hopara-viz',
|
|
280
280
|
accessToken: 'my-hopara-token',
|
|
281
281
|
targetElementId: 'my-target-element',
|
|
282
282
|
mapStyle: 'building',
|
|
@@ -295,7 +295,7 @@ type CallbackFunction = {
|
|
|
295
295
|
|
|
296
296
|
```jsx
|
|
297
297
|
Hopara.init({
|
|
298
|
-
|
|
298
|
+
visualizationId: 'my-hopara-viz',
|
|
299
299
|
accessToken: 'my-hopara-token',
|
|
300
300
|
targetElementId: 'my-target-element',
|
|
301
301
|
callbacks: [
|
package/build/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function webpackUniversalModuleDefinition(root,factory){if(typeof exports==="object"&&typeof module==="object")module.exports=factory();else if(typeof define==="function"&&define.amd)define([],factory);else{var a=factory();for(var i in a)(typeof exports==="object"?exports:root)[i]=a[i]}})(this,(function(){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId]){return installedModules[moduleId].exports}var module=installedModules[moduleId]={i:moduleId,l:false,exports:{}};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.l=true;return module.exports}__webpack_require__.m=modules;__webpack_require__.c=installedModules;__webpack_require__.d=function(exports,name,getter){if(!__webpack_require__.o(exports,name)){Object.defineProperty(exports,name,{enumerable:true,get:getter})}};__webpack_require__.r=function(exports){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(exports,"__esModule",{value:true})};__webpack_require__.t=function(value,mode){if(mode&1)value=__webpack_require__(value);if(mode&8)return value;if(mode&4&&typeof value==="object"&&value&&value.__esModule)return value;var ns=Object.create(null);__webpack_require__.r(ns);Object.defineProperty(ns,"default",{enumerable:true,value});if(mode&2&&typeof value!="string")for(var key in value)__webpack_require__.d(ns,key,function(key){return value[key]}.bind(null,key));return ns};__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module["default"]}:function getModuleExports(){return module};__webpack_require__.d(getter,"a",getter);return getter};__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)};__webpack_require__.p="";return __webpack_require__(__webpack_require__.s=1)}([function(module){module.exports=JSON.parse('{"name":"@hopara/iframe","version":"0.3.38","main":"build/client.js","scripts":{"start":"NODE_OPTIONS=\\"--openssl-legacy-provider ${NODE_OPTIONS}\\" REACT_APP_IS_EMBEDDED=true ESLINT_NO_DEV_ERRORS=true react-app-rewired start","build":"NODE_OPTIONS=\\"--openssl-legacy-provider ${NODE_OPTIONS}\\" REACT_APP_IS_EMBEDDED=true react-app-rewired build","eject":"react-app-rewired eject","lint":"eslint --fix \'src/**/*.{ts,js,tsx,jsx}\' && tsc --noEmit","check-types":"tsc --noEmit","test":"echo \\"not implemented\\""},"eslintConfig":{"extends":"react-app","overrides":[{"files":["**/*.stories.*"],"rules":{"import/no-anonymous-default-export":"off"}}]},"browserslist":["defaults, not ie 11"],"devDependencies":{"@babel/register":"^7.15.3","@datadog/browser-rum":"^4.24.0","@hopara/components":"^0.3.38","@hopara/config":"^0.3.38","@hopara/design-system":"^0.3.38","@hopara/system-test":"^0.3.38","babel-loader":"8.1.0","customize-cra":"^1.0.0","react":"^18.2.0","react-app-rewired":"^2.2.1","react-dom":"^18.2.0","react-router-dom":"^6.10.0","typescript":"^4.5.2"}}')},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,"Hopara",(function(){return client_Hopara}));let EventType;(function(EventType){EventType["INIT"]="init";EventType["READY"]="ready";EventType["UPDATE"]="update";EventType["LOAD_DATA"]="loadData";EventType["LOAD_DATA_RESPONSE"]="loadDataResponse";EventType["UPDATE_DATA"]="updateData";EventType["UPDATE_DATA_RESPONSE"]="updateDataResponse";EventType["REFRESH"]="refresh";EventType["FUNCTION_CALLBACK"]="functionCallback"})(EventType||(EventType={}));const HOPARA_EVENT_TYPE="__hopara__eventType__";const isReadyEvent=event=>event.data[HOPARA_EVENT_TYPE]===EventType.READY;const isLoadDataEvent=event=>event.data[HOPARA_EVENT_TYPE]===EventType.LOAD_DATA;const isUpdateDataEvent=event=>event.data[HOPARA_EVENT_TYPE]===EventType.UPDATE_DATA;const isCallbackFunctionEvent=event=>event.data[HOPARA_EVENT_TYPE]===EventType.FUNCTION_CALLBACK;class EventEmitter_EventEmitter{static sendMessage(data,targetWindow){const target=targetWindow||window.parent||window.top;if(!window||window===target)return;target.postMessage(data,"*")}static ready(){this.sendMessage({[HOPARA_EVENT_TYPE]:EventType.READY})}static init(config,targetWindow){this.sendMessage(Object.assign(config,{[HOPARA_EVENT_TYPE]:EventType.INIT}),targetWindow)}static loadDataRequest(dataLoader,filterSet){this.sendMessage({[HOPARA_EVENT_TYPE]:EventType.LOAD_DATA,data:{name:dataLoader.name,source:dataLoader.source},filterSet})}static loadDataResponse(config,dataLoader,rows,targetWindow){this.sendMessage(Object.assign(config,{[HOPARA_EVENT_TYPE]:EventType.LOAD_DATA_RESPONSE},{data:{name:dataLoader.name,source:dataLoader.source},rows}),targetWindow)}static updateDataRequest(dataUpdater,newRow,oldRow,diff){this.sendMessage({[HOPARA_EVENT_TYPE]:EventType.UPDATE_DATA,data:{name:dataUpdater.name,source:dataUpdater.source},newRow,oldRow,diff})}static refresh(config,targetWindow){this.sendMessage({...config,[HOPARA_EVENT_TYPE]:EventType.REFRESH},targetWindow)}static update(config,targetWindow){this.sendMessage({...config,[HOPARA_EVENT_TYPE]:EventType.UPDATE},targetWindow)}static callback(name,row){this.sendMessage({[HOPARA_EVENT_TYPE]:EventType.FUNCTION_CALLBACK,name,row})}}class EventReceiver_EventReceiver{static isHoparaMessage(event){return event.data[HOPARA_EVENT_TYPE]!==undefined}static loadDataResponse(dataLoader){return new Promise((resolve=>{const callback=event=>{if(event.data[HOPARA_EVENT_TYPE]===EventType.LOAD_DATA_RESPONSE&&event.data.data.name===dataLoader.name&&event.data.data.source===dataLoader.source){window.removeEventListener("message",callback,false);resolve(event.data.rows)}};window.addEventListener("message",callback,false)}))}}var package_0=__webpack_require__(0);const embeddedEnvUrl={test:"https://statics.test.hopara.app/embedded",production:"https://statics.hopara.app/embedded"};class client_Hopara{constructor(config){this.config=void 0;this.iframe=void 0;this.doInit=()=>{const targetElement=this.config.targetElementId?document.getElementById(this.config.targetElementId):this.config.targetElement;if(!targetElement){console&&console.warn("Hopara: targetElement not found");return this}const iframe=this.createIframe();targetElement.appendChild(iframe);this.iframe=iframe;this.createListeners();return this};this.config=config}getIframeSrc(){var _embeddedEnvUrl,_this$config$env;const envUrl=(_embeddedEnvUrl=embeddedEnvUrl[(_this$config$env=this.config.env)!==null&&_this$config$env!==void 0?_this$config$env:"production"])!==null&&_embeddedEnvUrl!==void 0?_embeddedEnvUrl:embeddedEnvUrl.production;const url=this.config.embeddedUrl?this.config.embeddedUrl:`${envUrl}/${this.config.version?this.config.version:"latest"}/index.html`;return`${url}${this.config.debug?"?debug=true":""}`}getIframeStyle(){return"background-color: transparent; border: 0px none transparent; padding: 0px; overflow: hidden; width: 100%; height: 100%;"}createIframe(){const iframe=document.createElement("iframe");iframe.src=this.getIframeSrc();iframe.style=this.getIframeStyle();return iframe}getEventData(){var _ref,_this$config$visualiz,_this$config$dataLoad,_this$config$dataUpda,_this$config$callback;return{accessToken:this.config.accessToken,visualizationId:(_ref=(_this$config$visualiz=this.config.visualizationId)!==null&&_this$config$visualiz!==void 0?_this$config$visualiz:this.config.visualization)!==null&&_ref!==void 0?_ref:this.config.app,fallbackVisualizationId:this.config.fallbackVisualizationId,env:this.config.env,tenant:this.config.tenant,initialPosition:this.config.initialPosition,initialRow:this.config.initialRow,dataLoaders:(_this$config$dataLoad=this.config.dataLoaders)===null||_this$config$dataLoad===void 0?void 0:_this$config$dataLoad.map((dataLoader=>({name:dataLoader.name,source:dataLoader.source}))),dataUpdaters:(_this$config$dataUpda=this.config.dataUpdaters)===null||_this$config$dataUpda===void 0?void 0:_this$config$dataUpda.map((dataUpdater=>({name:dataUpdater.name,source:dataUpdater.source}))),darkMode:this.config.darkMode,toolbar:this.config.toolbar,mapStyle:this.config.mapStyle,callbackNames:(_this$config$callback=this.config.callbacks)===null||_this$config$callback===void 0?void 0:_this$config$callback.map((callback=>callback.name)),filters:this.config.filters}}createListeners(){window.addEventListener("message",(event=>{var _this$iframe$contentW,_this$iframe;const targetWindow=(_this$iframe$contentW=(_this$iframe=this.iframe)===null||_this$iframe===void 0?void 0:_this$iframe.contentWindow)!==null&&_this$iframe$contentW!==void 0?_this$iframe$contentW:event.source;if(!targetWindow&&EventReceiver_EventReceiver.isHoparaMessage(event)){throw new Error("Hopara: targetWindow is not available")}if(isReadyEvent(event)){return EventEmitter_EventEmitter.init(this.getEventData(),targetWindow)}if(isLoadDataEvent(event)){var _this$config$dataLoad2;const dataLoader=(_this$config$dataLoad2=this.config.dataLoaders)===null||_this$config$dataLoad2===void 0?void 0:_this$config$dataLoad2.find((dataLoader=>dataLoader.name===event.data.data.name&&dataLoader.source===event.data.data.source));if(dataLoader)return dataLoader.loader(event.data.filterSet).then((data=>EventEmitter_EventEmitter.loadDataResponse(this.getEventData(),dataLoader,data,targetWindow)))}if(isUpdateDataEvent(event)){var _this$config$dataUpda2;const dataUpdater=(_this$config$dataUpda2=this.config.dataUpdaters)===null||_this$config$dataUpda2===void 0?void 0:_this$config$dataUpda2.find((dataUpdater=>dataUpdater.name===event.data.data.name&&dataUpdater.source===event.data.data.source));if(dataUpdater)return dataUpdater.updater(event.data.newRow,event.data.oldRow,event.data.diff)}if(isCallbackFunctionEvent(event)){var _this$config$callback2;const callbackFunc=(_this$config$callback2=this.config.callbacks)===null||_this$config$callback2===void 0?void 0:_this$config$callback2.find((callback=>callback.name===event.data.name));if(callbackFunc)callbackFunc===null||callbackFunc===void 0?void 0:callbackFunc.callback(event.data.row)}}))}refresh(){if(!this.iframe)throw new Error("Hopara: iframe is not available");if(this.iframe.contentWindow){EventEmitter_EventEmitter.refresh(this.getEventData(),this.iframe.contentWindow)}}update(config){var _this$iframe2;this.config=Object.assign({},this.config,config);if((_this$iframe2=this.iframe)!==null&&_this$iframe2!==void 0&&_this$iframe2.contentWindow){EventEmitter_EventEmitter.update(this.getEventData(),this.iframe.contentWindow)}}static init(config){if(!config&&console){console.warn("Hopara: init config not present");return}if((!window||!window.document)&&console){console.warn("Hopara: window is not available");return}const client=new client_Hopara(config);return client.doInit()}static moduleVersion(){return this._version}moduleVersion(){return client_Hopara._version}}client_Hopara._version=package_0.version;var client=__webpack_exports__["default"]=client_Hopara}])}));
|
|
1
|
+
(function webpackUniversalModuleDefinition(root,factory){if(typeof exports==="object"&&typeof module==="object")module.exports=factory();else if(typeof define==="function"&&define.amd)define([],factory);else{var a=factory();for(var i in a)(typeof exports==="object"?exports:root)[i]=a[i]}})(this,(function(){return function(){"use strict";var __webpack_require__={};!function(){__webpack_require__.d=function(exports,definition){for(var key in definition){if(__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)){Object.defineProperty(exports,key,{enumerable:true,get:definition[key]})}}}}();!function(){__webpack_require__.o=function(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}();!function(){__webpack_require__.r=function(exports){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(exports,"__esModule",{value:true})}}();var __webpack_exports__={};__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{Hopara:function(){return Hopara},default:function(){return client}});let EventType=function(EventType){EventType["INIT"]="init";EventType["READY"]="ready";EventType["UPDATE"]="update";EventType["LOAD_DATA"]="loadData";EventType["LOAD_DATA_RESPONSE"]="loadDataResponse";EventType["UPDATE_DATA"]="updateData";EventType["UPDATE_DATA_RESPONSE"]="updateDataResponse";EventType["REFRESH"]="refresh";EventType["FUNCTION_CALLBACK"]="functionCallback";return EventType}({});const HOPARA_EVENT_TYPE="__hopara__eventType__";const isReadyEvent=event=>event.data[HOPARA_EVENT_TYPE]===EventType.READY;const isLoadDataEvent=event=>event.data[HOPARA_EVENT_TYPE]===EventType.LOAD_DATA;const isUpdateDataEvent=event=>event.data[HOPARA_EVENT_TYPE]===EventType.UPDATE_DATA;const isCallbackFunctionEvent=event=>event.data[HOPARA_EVENT_TYPE]===EventType.FUNCTION_CALLBACK;class EventEmitter{static sendMessage(data,targetWindow){const target=targetWindow||window.parent||window.top;if(!window||window===target)return;target.postMessage(data,"*")}static ready(){this.sendMessage({[HOPARA_EVENT_TYPE]:EventType.READY})}static init(config,targetWindow){this.sendMessage(Object.assign(config,{[HOPARA_EVENT_TYPE]:EventType.INIT}),targetWindow)}static loadDataRequest(dataLoader,filterSet){this.sendMessage({[HOPARA_EVENT_TYPE]:EventType.LOAD_DATA,data:{name:dataLoader.name,source:dataLoader.source},filterSet})}static loadDataResponse(config,dataLoader,rows,targetWindow){this.sendMessage(Object.assign(config,{[HOPARA_EVENT_TYPE]:EventType.LOAD_DATA_RESPONSE},{data:{name:dataLoader.name,source:dataLoader.source},rows}),targetWindow)}static updateDataRequest(dataUpdater,newRow,oldRow,diff){this.sendMessage({[HOPARA_EVENT_TYPE]:EventType.UPDATE_DATA,data:{name:dataUpdater.name,source:dataUpdater.source},newRow,oldRow,diff})}static refresh(config,targetWindow){this.sendMessage({...config,[HOPARA_EVENT_TYPE]:EventType.REFRESH},targetWindow)}static update(config,targetWindow){this.sendMessage({...config,[HOPARA_EVENT_TYPE]:EventType.UPDATE},targetWindow)}static callback(name,row){this.sendMessage({[HOPARA_EVENT_TYPE]:EventType.FUNCTION_CALLBACK,name,row})}}class EventReceiver{static isHoparaMessage(event){return event.data[HOPARA_EVENT_TYPE]!==undefined}static loadDataResponse(dataLoader){return new Promise((resolve=>{const callback=event=>{if(event.data[HOPARA_EVENT_TYPE]===EventType.LOAD_DATA_RESPONSE&&event.data.data.name===dataLoader.name&&event.data.data.source===dataLoader.source){window.removeEventListener("message",callback,false);resolve(event.data.rows)}};window.addEventListener("message",callback,false)}))}}var package_namespaceObject={i8:"0.3.39"};const embeddedEnvUrl={test:"https://statics.test.hopara.app/embedded",production:"https://statics.hopara.app/embedded"};class Hopara{constructor(config){this.config=void 0;this.iframe=void 0;this.doInit=()=>{const targetElement=this.config.targetElementId?document.getElementById(this.config.targetElementId):this.config.targetElement;if(!targetElement){console&&console.warn("Hopara: targetElement not found");return this}const iframe=this.createIframe();targetElement.appendChild(iframe);this.iframe=iframe;this.createListeners();return this};this.config=config}getIframeSrc(){var _embeddedEnvUrl,_this$config$env;const envUrl=(_embeddedEnvUrl=embeddedEnvUrl[(_this$config$env=this.config.env)!==null&&_this$config$env!==void 0?_this$config$env:"production"])!==null&&_embeddedEnvUrl!==void 0?_embeddedEnvUrl:embeddedEnvUrl.production;const url=this.config.embeddedUrl?this.config.embeddedUrl:`${envUrl}/${this.config.version?this.config.version:"latest"}/index.html`;return`${url}${this.config.debug?"?debug=true":""}`}getIframeStyle(){return"background-color: transparent; border: 0px none transparent; padding: 0px; overflow: hidden; width: 100%; height: 100%;"}createIframe(){const iframe=document.createElement("iframe");iframe.src=this.getIframeSrc();iframe.style=this.getIframeStyle();return iframe}getEventData(){var _ref,_this$config$visualiz,_this$config$dataLoad,_this$config$dataUpda,_this$config$callback;return{accessToken:this.config.accessToken,visualizationId:(_ref=(_this$config$visualiz=this.config.visualizationId)!==null&&_this$config$visualiz!==void 0?_this$config$visualiz:this.config.visualization)!==null&&_ref!==void 0?_ref:this.config.app,fallbackVisualizationId:this.config.fallbackVisualizationId,env:this.config.env,tenant:this.config.tenant,initialPosition:this.config.initialPosition,initialRow:this.config.initialRow,dataLoaders:(_this$config$dataLoad=this.config.dataLoaders)===null||_this$config$dataLoad===void 0?void 0:_this$config$dataLoad.map((dataLoader=>({name:dataLoader.name,source:dataLoader.source}))),dataUpdaters:(_this$config$dataUpda=this.config.dataUpdaters)===null||_this$config$dataUpda===void 0?void 0:_this$config$dataUpda.map((dataUpdater=>({name:dataUpdater.name,source:dataUpdater.source}))),darkMode:this.config.darkMode,toolbar:this.config.toolbar,mapStyle:this.config.mapStyle,callbackNames:(_this$config$callback=this.config.callbacks)===null||_this$config$callback===void 0?void 0:_this$config$callback.map((callback=>callback.name)),filters:this.config.filters}}createListeners(){window.addEventListener("message",(event=>{var _this$iframe$contentW,_this$iframe;const targetWindow=(_this$iframe$contentW=(_this$iframe=this.iframe)===null||_this$iframe===void 0?void 0:_this$iframe.contentWindow)!==null&&_this$iframe$contentW!==void 0?_this$iframe$contentW:event.source;if(!targetWindow&&EventReceiver.isHoparaMessage(event)){throw new Error("Hopara: targetWindow is not available")}if(isReadyEvent(event)){return EventEmitter.init(this.getEventData(),targetWindow)}if(isLoadDataEvent(event)){var _this$config$dataLoad2;const dataLoader=(_this$config$dataLoad2=this.config.dataLoaders)===null||_this$config$dataLoad2===void 0?void 0:_this$config$dataLoad2.find((dataLoader=>dataLoader.name===event.data.data.name&&dataLoader.source===event.data.data.source));if(dataLoader)return dataLoader.loader(event.data.filterSet).then((data=>EventEmitter.loadDataResponse(this.getEventData(),dataLoader,data,targetWindow)))}if(isUpdateDataEvent(event)){var _this$config$dataUpda2;const dataUpdater=(_this$config$dataUpda2=this.config.dataUpdaters)===null||_this$config$dataUpda2===void 0?void 0:_this$config$dataUpda2.find((dataUpdater=>dataUpdater.name===event.data.data.name&&dataUpdater.source===event.data.data.source));if(dataUpdater)return dataUpdater.updater(event.data.newRow,event.data.oldRow,event.data.diff)}if(isCallbackFunctionEvent(event)){var _this$config$callback2;const callbackFunc=(_this$config$callback2=this.config.callbacks)===null||_this$config$callback2===void 0?void 0:_this$config$callback2.find((callback=>callback.name===event.data.name));if(callbackFunc)callbackFunc===null||callbackFunc===void 0?void 0:callbackFunc.callback(event.data.row)}}))}refresh(){if(!this.iframe)throw new Error("Hopara: iframe is not available");if(this.iframe.contentWindow){EventEmitter.refresh(this.getEventData(),this.iframe.contentWindow)}}update(config){var _this$iframe2;this.config=Object.assign({},this.config,config);if((_this$iframe2=this.iframe)!==null&&_this$iframe2!==void 0&&_this$iframe2.contentWindow){EventEmitter.update(this.getEventData(),this.iframe.contentWindow)}}static init(config){if(!config&&console){console.warn("Hopara: init config not present");return}if((!window||!window.document)&&console){console.warn("Hopara: window is not available");return}const client=new Hopara(config);return client.doInit()}static moduleVersion(){return this._version}moduleVersion(){return Hopara._version}}Hopara._version=package_namespaceObject.i8;var client=Hopara;return __webpack_exports__}()}));
|
package/package.json
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hopara/iframe",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.39",
|
|
4
4
|
"main": "build/client.js",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"start": "
|
|
7
|
-
"build": "
|
|
6
|
+
"start": "REACT_APP_IS_EMBEDDED=true ESLINT_NO_DEV_ERRORS=true react-app-rewired start",
|
|
7
|
+
"build": "REACT_APP_IS_EMBEDDED=true react-app-rewired build",
|
|
8
8
|
"eject": "react-app-rewired eject",
|
|
9
9
|
"lint": "eslint --fix 'src/**/*.{ts,js,tsx,jsx}' && tsc --noEmit",
|
|
10
10
|
"check-types": "tsc --noEmit",
|
|
11
11
|
"test": "echo \"not implemented\""
|
|
12
12
|
},
|
|
13
13
|
"eslintConfig": {
|
|
14
|
-
"extends": "react
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
"extends": "@hopara/eslint-config/react",
|
|
15
|
+
"rules": {
|
|
16
|
+
"guard-for-in": "off",
|
|
17
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
18
|
+
"@typescript-eslint/ban-types": "off",
|
|
19
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
20
|
+
"@typescript-eslint/indent": "off",
|
|
21
|
+
"import/no-extraneous-dependencies": "off",
|
|
22
|
+
"no-invalid-this": "off",
|
|
23
|
+
"no-console": "off",
|
|
24
|
+
"import/prefer-default-export": "off",
|
|
25
|
+
"chai-friendly/no-unused-expressions": "off"
|
|
26
|
+
}
|
|
25
27
|
},
|
|
26
28
|
"browserslist": [
|
|
27
29
|
"defaults, not ie 11"
|
|
@@ -29,10 +31,10 @@
|
|
|
29
31
|
"devDependencies": {
|
|
30
32
|
"@babel/register": "^7.15.3",
|
|
31
33
|
"@datadog/browser-rum": "^4.24.0",
|
|
32
|
-
"@hopara/components": "^0.3.
|
|
33
|
-
"@hopara/config": "^0.3.
|
|
34
|
-
"@hopara/design-system": "^0.3.
|
|
35
|
-
"@hopara/system-test": "^0.3.
|
|
34
|
+
"@hopara/components": "^0.3.39",
|
|
35
|
+
"@hopara/config": "^0.3.39",
|
|
36
|
+
"@hopara/design-system": "^0.3.39",
|
|
37
|
+
"@hopara/system-test": "^0.3.39",
|
|
36
38
|
"babel-loader": "8.1.0",
|
|
37
39
|
"customize-cra": "^1.0.0",
|
|
38
40
|
"react": "^18.2.0",
|
|
Binary file
|
|
Binary file
|