@evlop/commons 1.0.150 → 1.0.151

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,4 +5,5 @@ export * from './themeHelpers';
5
5
  export * from './base64';
6
6
  export * from './i18nHelpers';
7
7
  export * from './analytics';
8
+ export * from './remoteAction';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC"}
@@ -17,4 +17,5 @@ __exportStar(require("./themeHelpers"), exports);
17
17
  __exportStar(require("./base64"), exports);
18
18
  __exportStar(require("./i18nHelpers"), exports);
19
19
  __exportStar(require("./analytics"), exports);
20
+ __exportStar(require("./remoteAction"), exports);
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmC;AACnC,8CAA4B;AAC5B,iDAA+B;AAC/B,iDAA+B;AAC/B,2CAAyB;AACzB,gDAA8B;AAC9B,8CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmC;AACnC,8CAA4B;AAC5B,iDAA+B;AAC/B,iDAA+B;AAC/B,2CAAyB;AACzB,gDAA8B;AAC9B,8CAA4B;AAC5B,iDAA+B"}
@@ -0,0 +1,11 @@
1
+ import { Action } from '../hooks';
2
+ declare type ActionHandeller = (Action: any) => void;
3
+ declare type UnsubscribeActionHandeller = () => void;
4
+ declare class RemoteAction {
5
+ private eventEmitter;
6
+ do(action: Action): void;
7
+ onAction(actionHandeller: ActionHandeller): UnsubscribeActionHandeller;
8
+ }
9
+ export declare const remoteAction: RemoteAction;
10
+ export default remoteAction;
11
+ //# sourceMappingURL=remoteAction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remoteAction.d.ts","sourceRoot":"","sources":["../../../src/helpers/remoteAction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,aAAK,eAAe,GAAG,CAAC,MAAM,KAAA,KAAK,IAAI,CAAC;AACxC,aAAK,0BAA0B,GAAG,MAAM,IAAI,CAAC;AAE7C,cAAM,YAAY;IACd,OAAO,CAAC,YAAY,CAAsB;IAE1C,EAAE,CAAC,MAAM,EAAE,MAAM;IAIjB,QAAQ,CAAC,eAAe,EAAE,eAAe,GAAG,0BAA0B;CAMzE;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC;AAE/C,eAAe,YAAY,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.remoteAction = void 0;
4
+ const events_1 = require("events");
5
+ class RemoteAction {
6
+ constructor() {
7
+ this.eventEmitter = new events_1.EventEmitter();
8
+ }
9
+ do(action) {
10
+ this.eventEmitter.emit('executeAction', action);
11
+ }
12
+ onAction(actionHandeller) {
13
+ const handleAction = (action) => actionHandeller(action);
14
+ this.eventEmitter.addListener('executeAction', handleAction);
15
+ return () => this.eventEmitter.removeListener('executeAction', handleAction);
16
+ }
17
+ }
18
+ exports.remoteAction = new RemoteAction();
19
+ exports.default = exports.remoteAction;
20
+ //# sourceMappingURL=remoteAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remoteAction.js","sourceRoot":"","sources":["../../../src/helpers/remoteAction.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAMtC,MAAM,YAAY;IAAlB;QACY,iBAAY,GAAG,IAAI,qBAAY,EAAE,CAAC;IAY9C,CAAC;IAVG,EAAE,CAAC,MAAc;QACb,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;IAED,QAAQ,CAAC,eAAgC;QACrC,MAAM,YAAY,GAAG,CAAC,MAAc,EAAC,EAAE,CAAA,eAAe,CAAC,MAAM,CAAC,CAAC;QAC/D,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,eAAe,EAAC,YAAY,CAAC,CAAC;QAC5D,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;IACjF,CAAC;CAEJ;AAEY,QAAA,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;AAE/C,kBAAe,oBAAY,CAAC"}
@@ -5,7 +5,7 @@ exports.platformEventsMiddleware = void 0;
5
5
  const platformEventsMiddleware = (store) => {
6
6
  window.addEventListener('message', (message) => {
7
7
  try {
8
- const messageObject = JSON.parse(message.data);
8
+ const messageObject = typeof message.data === 'string' ? JSON.parse(message.data) : message.data;
9
9
  if (messageObject.type === 'REDUX_ACTION') {
10
10
  store.dispatch(messageObject.action);
11
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"platformEventsMiddleware.web.js","sourceRoot":"","sources":["../../../src/middlewares/platformEventsMiddleware.web.tsx"],"names":[],"mappings":";;;AAAA,oDAAoD;AAC7C,MAAM,wBAAwB,GAAG,CAAC,KAAyC,EAAE,EAAE;IAClF,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,OAAO,EAAC,EAAE;QAC1C,IAAG;YACC,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YAC9C,IAAG,aAAa,CAAC,IAAI,KAAK,cAAc,EAAC;gBACrC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;aACxC;SACJ;QAAC,OAAM,CAAC,EAAC,GAAE;IAChB,CAAC,CAAC,CAAC;IAGH,OAAO,CAAC,IAAS,EAAE,EAAE,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACxD,CAAC,CAAC;AAZW,QAAA,wBAAwB,4BAYnC;AAEF,kBAAe,gCAAwB,CAAC"}
1
+ {"version":3,"file":"platformEventsMiddleware.web.js","sourceRoot":"","sources":["../../../src/middlewares/platformEventsMiddleware.web.tsx"],"names":[],"mappings":";;;AAAA,oDAAoD;AAC7C,MAAM,wBAAwB,GAAG,CAAC,KAAyC,EAAE,EAAE;IAClF,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,OAAO,EAAC,EAAE;QAC1C,IAAG;YACC,MAAM,aAAa,GAAG,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;YACjG,IAAG,aAAa,CAAC,IAAI,KAAK,cAAc,EAAC;gBACrC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;aACxC;SACJ;QAAC,OAAM,CAAC,EAAC,GAAE;IAChB,CAAC,CAAC,CAAC;IAGH,OAAO,CAAC,IAAS,EAAE,EAAE,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACxD,CAAC,CAAC;AAZW,QAAA,wBAAwB,4BAYnC;AAEF,kBAAe,gCAAwB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evlop/commons",
3
- "version": "1.0.150",
3
+ "version": "1.0.151",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "peerDependencies": {