@evlop/commons 1.0.163 → 1.0.165

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,5 @@
1
- export declare const platformEventsMiddleware: (store: any) => (next: any) => (action: any) => any;
1
+ export declare const platformEventsMiddleware: (store: {
2
+ dispatch: (arg0: any) => void;
3
+ }) => (next: any) => (action: any) => any;
2
4
  export default platformEventsMiddleware;
3
5
  //# sourceMappingURL=platformEventsMiddleware.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"platformEventsMiddleware.d.ts","sourceRoot":"","sources":["../../../src/middlewares/platformEventsMiddleware.tsx"],"names":[],"mappings":"AACA,eAAO,MAAM,wBAAwB,UAAU,GAAG,YAAY,GAAG,cAAc,GAAG,QAAiB,CAAC;AAEpG,eAAe,wBAAwB,CAAC"}
1
+ {"version":3,"file":"platformEventsMiddleware.d.ts","sourceRoot":"","sources":["../../../src/middlewares/platformEventsMiddleware.tsx"],"names":[],"mappings":"AACA,eAAO,MAAM,wBAAwB;qBAA8B,GAAG,KAAK,IAAI;aAa7D,GAAG,cAAc,GAAG,QACrC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
@@ -1,7 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.platformEventsMiddleware = void 0;
4
- const platformEventsMiddleware = (store) => (next) => (action) => next(action);
4
+ // listen to window message events and pass to redux
5
+ const platformEventsMiddleware = (store) => {
6
+ if (typeof window.addEventListener === 'function') {
7
+ window.addEventListener('message', (message) => {
8
+ try {
9
+ const messageObject = typeof message.data === 'string' ? JSON.parse(message.data) : message.data;
10
+ if (messageObject.type === 'REDUX_ACTION') {
11
+ store.dispatch(messageObject.action);
12
+ }
13
+ }
14
+ catch (e) { }
15
+ });
16
+ }
17
+ return (next) => (action) => next(action);
18
+ };
5
19
  exports.platformEventsMiddleware = platformEventsMiddleware;
6
20
  exports.default = exports.platformEventsMiddleware;
7
21
  //# sourceMappingURL=platformEventsMiddleware.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"platformEventsMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/platformEventsMiddleware.tsx"],"names":[],"mappings":";;;AACO,MAAM,wBAAwB,GAAG,CAAC,KAAS,EAAE,EAAE,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAAvF,QAAA,wBAAwB,4BAA+D;AAEpG,kBAAe,gCAAwB,CAAC"}
1
+ {"version":3,"file":"platformEventsMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/platformEventsMiddleware.tsx"],"names":[],"mappings":";;;AAAA,oDAAoD;AAC7C,MAAM,wBAAwB,GAAG,CAAC,KAAyC,EAAE,EAAE;IAClF,IAAG,OAAO,MAAM,CAAC,gBAAgB,KAAK,UAAU,EAAC;QAC7C,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,OAAO,EAAC,EAAE;YAC1C,IAAG;gBACC,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;gBACjG,IAAG,aAAa,CAAC,IAAI,KAAK,cAAc,EAAC;oBACrC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;iBACxC;aACJ;YAAC,OAAM,CAAC,EAAC,GAAE;QAChB,CAAC,CAAC,CAAC;KACN;IAGD,OAAO,CAAC,IAAS,EAAE,EAAE,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACxD,CAAC,CAAC;AAdW,QAAA,wBAAwB,4BAcnC;AAEF,kBAAe,gCAAwB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const platformEventsMiddleware: (store: any) => (next: any) => (action: any) => any;
2
+ export default platformEventsMiddleware;
3
+ //# sourceMappingURL=platformEventsMiddleware.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platformEventsMiddleware.native.d.ts","sourceRoot":"","sources":["../../../src/middlewares/platformEventsMiddleware.native.tsx"],"names":[],"mappings":"AACA,eAAO,MAAM,wBAAwB,UAAU,GAAG,YAAY,GAAG,cAAc,GAAG,QAAiB,CAAC;AAEpG,eAAe,wBAAwB,CAAC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.platformEventsMiddleware = void 0;
4
+ const platformEventsMiddleware = (store) => (next) => (action) => next(action);
5
+ exports.platformEventsMiddleware = platformEventsMiddleware;
6
+ exports.default = exports.platformEventsMiddleware;
7
+ //# sourceMappingURL=platformEventsMiddleware.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platformEventsMiddleware.native.js","sourceRoot":"","sources":["../../../src/middlewares/platformEventsMiddleware.native.tsx"],"names":[],"mappings":";;;AACO,MAAM,wBAAwB,GAAG,CAAC,KAAS,EAAE,EAAE,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAAvF,QAAA,wBAAwB,4BAA+D;AAEpG,kBAAe,gCAAwB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evlop/commons",
3
- "version": "1.0.163",
3
+ "version": "1.0.165",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "peerDependencies": {
@@ -1,5 +0,0 @@
1
- export declare const platformEventsMiddleware: (store: {
2
- dispatch: (arg0: any) => void;
3
- }) => (next: any) => (action: any) => any;
4
- export default platformEventsMiddleware;
5
- //# sourceMappingURL=platformEventsMiddleware.web.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platformEventsMiddleware.web.d.ts","sourceRoot":"","sources":["../../../src/middlewares/platformEventsMiddleware.web.tsx"],"names":[],"mappings":"AACA,eAAO,MAAM,wBAAwB;qBAA8B,GAAG,KAAK,IAAI;aAW7D,GAAG,cAAc,GAAG,QACrC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.platformEventsMiddleware = void 0;
4
- // listen to window message events and pass to redux
5
- const platformEventsMiddleware = (store) => {
6
- window.addEventListener('message', (message) => {
7
- try {
8
- const messageObject = typeof message.data === 'string' ? JSON.parse(message.data) : message.data;
9
- if (messageObject.type === 'REDUX_ACTION') {
10
- store.dispatch(messageObject.action);
11
- }
12
- }
13
- catch (e) { }
14
- });
15
- return (next) => (action) => next(action);
16
- };
17
- exports.platformEventsMiddleware = platformEventsMiddleware;
18
- exports.default = exports.platformEventsMiddleware;
19
- //# sourceMappingURL=platformEventsMiddleware.web.js.map
@@ -1 +0,0 @@
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"}