@evlop/commons 1.0.147 → 1.0.150
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/constants/platformSpecific.d.ts.map +1 -1
- package/dist/src/constants/platformSpecific.js +2 -3
- package/dist/src/constants/platformSpecific.js.map +1 -1
- package/dist/src/helpers/analytics.d.ts +10 -0
- package/dist/src/helpers/analytics.d.ts.map +1 -0
- package/dist/src/helpers/analytics.js +23 -0
- package/dist/src/helpers/analytics.js.map +1 -0
- package/dist/src/helpers/index.d.ts +1 -0
- package/dist/src/helpers/index.d.ts.map +1 -1
- package/dist/src/helpers/index.js +1 -0
- package/dist/src/helpers/index.js.map +1 -1
- package/dist/src/middlewares/platformEventsMiddleware.web.js +3 -3
- package/dist/src/middlewares/platformEventsMiddleware.web.js.map +1 -1
- package/dist/src/reducers/notifications.d.ts +11 -4
- package/dist/src/reducers/notifications.d.ts.map +1 -1
- package/dist/src/reducers/notifications.js.map +1 -1
- package/package.json +2 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"platformSpecific.d.ts","sourceRoot":"","sources":["../../../src/constants/platformSpecific.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"platformSpecific.d.ts","sourceRoot":"","sources":["../../../src/constants/platformSpecific.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,QAAiE,CAAC;AAC3F,eAAO,MAAM,UAAU,QAA6E,CAAC"}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.SOCKET_URL = exports.API_BASE_URL = void 0;
|
4
|
-
|
5
|
-
exports.
|
6
|
-
exports.SOCKET_URL = isNode ? process.env.SOCKET_URL || process.env.REACT_APP_SOCKET_URL || exports.API_BASE_URL : undefined;
|
4
|
+
exports.API_BASE_URL = process.env.API_BASE_URL || process.env.REACT_APP_API_BASE_URL;
|
5
|
+
exports.SOCKET_URL = process.env.SOCKET_URL || process.env.REACT_APP_SOCKET_URL || exports.API_BASE_URL;
|
7
6
|
//# sourceMappingURL=platformSpecific.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"platformSpecific.js","sourceRoot":"","sources":["../../../src/constants/platformSpecific.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"platformSpecific.js","sourceRoot":"","sources":["../../../src/constants/platformSpecific.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC;AAC9E,QAAA,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,oBAAY,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
declare type TrackListener = (eventName: string, properties: Object) => void;
|
2
|
+
declare type UnsubscribeTrackListener = () => void;
|
3
|
+
declare class Analytics {
|
4
|
+
private eventEmitter;
|
5
|
+
track(eventName: string, properties: Object): void;
|
6
|
+
onTrack(handleTrack: TrackListener): UnsubscribeTrackListener;
|
7
|
+
}
|
8
|
+
export declare const analytics: Analytics;
|
9
|
+
export default analytics;
|
10
|
+
//# sourceMappingURL=analytics.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../src/helpers/analytics.ts"],"names":[],"mappings":"AAEA,aAAK,aAAa,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;AACrE,aAAK,wBAAwB,GAAG,MAAM,IAAI,CAAC;AAE3C,cAAM,SAAS;IACX,OAAO,CAAC,YAAY,CAAsB;IAE1C,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAO3C,OAAO,CAAC,WAAW,EAAE,aAAa,GAAG,wBAAwB;CAMhE;AAED,eAAO,MAAM,SAAS,WAAkB,CAAC;AAEzC,eAAe,SAAS,CAAC"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.analytics = void 0;
|
4
|
+
const events_1 = require("events");
|
5
|
+
class Analytics {
|
6
|
+
constructor() {
|
7
|
+
this.eventEmitter = new events_1.EventEmitter();
|
8
|
+
}
|
9
|
+
track(eventName, properties) {
|
10
|
+
this.eventEmitter.emit('track', {
|
11
|
+
eventName,
|
12
|
+
properties,
|
13
|
+
});
|
14
|
+
}
|
15
|
+
onTrack(handleTrack) {
|
16
|
+
const handleEvent = ({ eventName, properties }) => handleTrack(eventName, properties);
|
17
|
+
this.eventEmitter.addListener('track', handleEvent);
|
18
|
+
return () => this.eventEmitter.removeListener('track', handleEvent);
|
19
|
+
}
|
20
|
+
}
|
21
|
+
exports.analytics = new Analytics();
|
22
|
+
exports.default = exports.analytics;
|
23
|
+
//# sourceMappingURL=analytics.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../../src/helpers/analytics.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAKtC,MAAM,SAAS;IAAf;QACY,iBAAY,GAAG,IAAI,qBAAY,EAAE,CAAC;IAe9C,CAAC;IAbG,KAAK,CAAC,SAAiB,EAAE,UAAkB;QACvC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE;YAC5B,SAAS;YACT,UAAU;SACb,CAAC,CAAC;IACP,CAAC;IAED,OAAO,CAAC,WAA0B;QAC9B,MAAM,WAAW,GAAG,CAAC,EAAC,SAAS,EAAE,UAAU,EAAC,EAAC,EAAE,CAAA,WAAW,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;QACjF,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,EAAC,WAAW,CAAC,CAAC;QACnD,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACxE,CAAC;CAEJ;AAEY,QAAA,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;AAEzC,kBAAe,iBAAS,CAAC"}
|
@@ -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"}
|
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"}
|
@@ -16,4 +16,5 @@ __exportStar(require("./commonStyles"), exports);
|
|
16
16
|
__exportStar(require("./themeHelpers"), exports);
|
17
17
|
__exportStar(require("./base64"), exports);
|
18
18
|
__exportStar(require("./i18nHelpers"), exports);
|
19
|
+
__exportStar(require("./analytics"), exports);
|
19
20
|
//# 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"}
|
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"}
|
@@ -5,9 +5,9 @@ exports.platformEventsMiddleware = void 0;
|
|
5
5
|
const platformEventsMiddleware = (store) => {
|
6
6
|
window.addEventListener('message', (message) => {
|
7
7
|
try {
|
8
|
-
const
|
9
|
-
if (
|
10
|
-
store.dispatch(
|
8
|
+
const messageObject = JSON.parse(message.data);
|
9
|
+
if (messageObject.type === 'REDUX_ACTION') {
|
10
|
+
store.dispatch(messageObject.action);
|
11
11
|
}
|
12
12
|
}
|
13
13
|
catch (e) { }
|
@@ -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,
|
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,3 +1,6 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { IconIdentifier } from "../constants";
|
3
|
+
import { Action } from "../hooks";
|
1
4
|
export declare const SHOW_NOTIFICATION = "notification/show";
|
2
5
|
export declare const REMOVE_NOTIFICATION = "notification/remove";
|
3
6
|
export interface Notification {
|
@@ -8,16 +11,19 @@ export interface Notification {
|
|
8
11
|
/**
|
9
12
|
* @description notification title
|
10
13
|
*/
|
11
|
-
title: string;
|
14
|
+
title: string | React.ReactNode;
|
12
15
|
/**
|
13
16
|
* @description notification message
|
14
17
|
*/
|
15
|
-
message?: string;
|
18
|
+
message?: string | React.ReactNode;
|
19
|
+
/**
|
20
|
+
* @description notification type
|
21
|
+
*/
|
16
22
|
type?: 'info' | 'success' | 'error' | 'warning';
|
17
23
|
/**
|
18
24
|
* @description icon for notification
|
19
25
|
*/
|
20
|
-
icon?:
|
26
|
+
icon?: IconIdentifier | React.ReactNode;
|
21
27
|
/**
|
22
28
|
* @description where should the notification be displayed
|
23
29
|
*/
|
@@ -27,7 +33,8 @@ export interface Notification {
|
|
27
33
|
*/
|
28
34
|
buttons?: Array<{
|
29
35
|
title: string;
|
30
|
-
|
36
|
+
type: 'primary' | 'secondary' | 'danger';
|
37
|
+
action: Action;
|
31
38
|
}>;
|
32
39
|
/**
|
33
40
|
* @description for how long should the notification be displayed (in millisseconds)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/reducers/notifications.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/reducers/notifications.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AACrD,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAEzD,MAAM,WAAW,YAAY;IACzB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACnC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAC,SAAS,GAAC,OAAO,GAAC,SAAS,CAAC;IAC1C;;OAEG;IACH,IAAI,CAAC,EAAE,cAAc,GAAG,KAAK,CAAC,SAAS,CAAC;IACxC;;OAEG;IACH,QAAQ,EAAE,KAAK,GAAC,WAAW,GAAC,cAAc,GAAC,QAAQ,GAAC,aAAa,GAAC,UAAU,CAAC;IAC7E;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;QACzC,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC,CAAA;IACF;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,iBAAkB,YAAY;;;;;;;;CAGzD,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;CAG7B,CAAC;gCAIoB,MAAM,YAAY,CAAC;AAA1C,wBAgBC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../src/reducers/notifications.tsx"],"names":[],"mappings":";;;AAAA,mCAAgE;
|
1
|
+
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../src/reducers/notifications.tsx"],"names":[],"mappings":";;;AAAA,mCAAgE;AAKnD,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AACxC,QAAA,mBAAmB,GAAG,qBAAqB,CAAC;AA0CzD;;;;GAIG;AACI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AAC;KACpB;AACL,CAAC,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@evlop/commons",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.150",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/main.js",
|
6
6
|
"peerDependencies": {
|
@@ -28,6 +28,7 @@
|
|
28
28
|
"optionalDependencies": {},
|
29
29
|
"dependencies": {
|
30
30
|
"axios-retry": "^3.3.1",
|
31
|
+
"events": "^3.3.0",
|
31
32
|
"moment": "^2.29.1",
|
32
33
|
"react-native-base64": "^0.2.1"
|
33
34
|
},
|