@evlop/commons 1.0.78 → 1.0.82

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. package/dist/src/constants/index.d.ts +1 -2
  2. package/dist/src/constants/index.d.ts.map +1 -1
  3. package/dist/src/constants/index.js +12 -3
  4. package/dist/src/constants/index.js.map +1 -1
  5. package/dist/src/constants/platformSpecific.d.ts +4 -0
  6. package/dist/src/constants/platformSpecific.d.ts.map +1 -0
  7. package/dist/src/constants/platformSpecific.js +7 -0
  8. package/dist/src/constants/platformSpecific.js.map +1 -0
  9. package/dist/src/constants/platformSpecific.native.d.ts +4 -0
  10. package/dist/src/constants/platformSpecific.native.d.ts.map +1 -0
  11. package/dist/src/constants/platformSpecific.native.js +9 -0
  12. package/dist/src/constants/platformSpecific.native.js.map +1 -0
  13. package/dist/src/hooks/useAction.d.ts.map +1 -1
  14. package/dist/src/hooks/useAction.js +4 -2
  15. package/dist/src/hooks/useAction.js.map +1 -1
  16. package/dist/src/middlewares/index.d.ts +1 -0
  17. package/dist/src/middlewares/index.d.ts.map +1 -1
  18. package/dist/src/middlewares/index.js +1 -0
  19. package/dist/src/middlewares/index.js.map +1 -1
  20. package/dist/src/middlewares/platformEventsMiddleware.d.ts +3 -0
  21. package/dist/src/middlewares/platformEventsMiddleware.d.ts.map +1 -0
  22. package/dist/src/middlewares/platformEventsMiddleware.js +7 -0
  23. package/dist/src/middlewares/platformEventsMiddleware.js.map +1 -0
  24. package/dist/src/middlewares/platformEventsMiddleware.web.d.ts +5 -0
  25. package/dist/src/middlewares/platformEventsMiddleware.web.d.ts.map +1 -0
  26. package/dist/src/middlewares/platformEventsMiddleware.web.js +19 -0
  27. package/dist/src/middlewares/platformEventsMiddleware.web.js.map +1 -0
  28. package/dist/src/reducers/index.d.ts +3 -1
  29. package/dist/src/reducers/index.d.ts.map +1 -1
  30. package/dist/src/reducers/index.js +5 -2
  31. package/dist/src/reducers/index.js.map +1 -1
  32. package/dist/src/reducers/pages.d.ts +3 -0
  33. package/dist/src/reducers/pages.d.ts.map +1 -0
  34. package/dist/src/reducers/pages.js +97 -0
  35. package/dist/src/reducers/pages.js.map +1 -0
  36. package/package.json +1 -1
@@ -1,5 +1,3 @@
1
- export declare const API_BASE_URL: string;
2
- export declare const SOCKET_URL: string;
3
1
  export declare const IS_SSR: boolean;
4
2
  export declare const DIRECTION_TOP = "direction/Top";
5
3
  export declare const DIRECTION_RIGHT = "direction/Right";
@@ -9,4 +7,5 @@ export declare const VERTICAL_LAYOUT = "layout/vertical";
9
7
  export declare const HORIZONTAL_LAYOUT = "layout/horizontal";
10
8
  export declare const TYPE_COMPONENT = "type/component";
11
9
  export { default as iconInfo } from './iconInfo';
10
+ export * from './platformSpecific';
12
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/index.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,QAAiE,CAAC;AAC3F,eAAO,MAAM,UAAU,QAA6E,CAAC;AACrG,eAAO,MAAM,MAAM,SAAgE,CAAC;AAEpF,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAG/C,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/index.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,SAAgE,CAAC;AAEpF,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAG/C,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,cAAc,oBAAoB,CAAC"}
@@ -1,11 +1,19 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
2
12
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
13
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
14
  };
5
15
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.iconInfo = exports.TYPE_COMPONENT = exports.HORIZONTAL_LAYOUT = exports.VERTICAL_LAYOUT = exports.DIRECTION_LEFT = exports.DIRECTION_BOTTOM = exports.DIRECTION_RIGHT = exports.DIRECTION_TOP = exports.IS_SSR = exports.SOCKET_URL = exports.API_BASE_URL = void 0;
7
- exports.API_BASE_URL = process.env.API_BASE_URL || process.env.REACT_APP_API_BASE_URL;
8
- exports.SOCKET_URL = process.env.SOCKET_URL || process.env.REACT_APP_SOCKET_URL || exports.API_BASE_URL;
16
+ exports.iconInfo = exports.TYPE_COMPONENT = exports.HORIZONTAL_LAYOUT = exports.VERTICAL_LAYOUT = exports.DIRECTION_LEFT = exports.DIRECTION_BOTTOM = exports.DIRECTION_RIGHT = exports.DIRECTION_TOP = exports.IS_SSR = void 0;
9
17
  exports.IS_SSR = ['true', '1'].includes(String(process.env.SSR).toLowerCase());
10
18
  exports.DIRECTION_TOP = "direction/Top";
11
19
  exports.DIRECTION_RIGHT = "direction/Right";
@@ -16,4 +24,5 @@ exports.HORIZONTAL_LAYOUT = 'layout/horizontal';
16
24
  exports.TYPE_COMPONENT = "type/component";
17
25
  var iconInfo_1 = require("./iconInfo");
18
26
  Object.defineProperty(exports, "iconInfo", { enumerable: true, get: function () { return __importDefault(iconInfo_1).default; } });
27
+ __exportStar(require("./platformSpecific"), exports);
19
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.tsx"],"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;AACxF,QAAA,MAAM,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAEvE,QAAA,aAAa,GAAG,eAAe,CAAC;AAChC,QAAA,eAAe,GAAG,iBAAiB,CAAC;AACpC,QAAA,gBAAgB,GAAG,kBAAkB,CAAC;AACtC,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAGlC,QAAA,eAAe,GAAG,iBAAiB,CAAC;AACpC,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AAExC,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAE/C,uCAAiD;AAAxC,qHAAA,OAAO,OAAY"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAa,QAAA,MAAM,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAEvE,QAAA,aAAa,GAAG,eAAe,CAAC;AAChC,QAAA,eAAe,GAAG,iBAAiB,CAAC;AACpC,QAAA,gBAAgB,GAAG,kBAAkB,CAAC;AACtC,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAGlC,QAAA,eAAe,GAAG,iBAAiB,CAAC;AACpC,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AAExC,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAE/C,uCAAiD;AAAxC,qHAAA,OAAO,OAAY;AAC5B,qDAAmC"}
@@ -0,0 +1,4 @@
1
+ export declare const API_BASE_URL: string;
2
+ export declare const SOCKET_URL: string;
3
+ export declare const APP_NAME = "";
4
+ //# sourceMappingURL=platformSpecific.d.ts.map
@@ -0,0 +1 @@
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;AACrG,eAAO,MAAM,QAAQ,KAAK,CAAC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.APP_NAME = exports.SOCKET_URL = exports.API_BASE_URL = void 0;
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;
6
+ exports.APP_NAME = "";
7
+ //# sourceMappingURL=platformSpecific.js.map
@@ -0,0 +1 @@
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;AACxF,QAAA,QAAQ,GAAG,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const API_BASE_URL: any;
2
+ export declare const SOCKET_URL: any;
3
+ export declare const APP_NAME: any;
4
+ //# sourceMappingURL=platformSpecific.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platformSpecific.native.d.ts","sourceRoot":"","sources":["../../../src/constants/platformSpecific.native.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,KAAiG,CAAC;AAC3H,eAAO,MAAM,UAAU,KAA6E,CAAC;AACrG,eAAO,MAAM,QAAQ,KAA4B,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.APP_NAME = exports.SOCKET_URL = exports.API_BASE_URL = void 0;
4
+ const react_native_1 = require("react-native");
5
+ const { AppConstants } = react_native_1.NativeModules;
6
+ exports.API_BASE_URL = AppConstants.getApiBaseUrl() || process.env.API_BASE_URL || process.env.REACT_APP_API_BASE_URL;
7
+ exports.SOCKET_URL = process.env.SOCKET_URL || process.env.REACT_APP_SOCKET_URL || exports.API_BASE_URL;
8
+ exports.APP_NAME = AppConstants.getAppName();
9
+ //# sourceMappingURL=platformSpecific.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platformSpecific.native.js","sourceRoot":"","sources":["../../../src/constants/platformSpecific.native.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAC3C,MAAM,EAAC,YAAY,EAAC,GAAG,4BAAa,CAAC;AAExB,QAAA,YAAY,GAAG,YAAY,CAAC,aAAa,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC;AAC9G,QAAA,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,oBAAY,CAAC;AACxF,QAAA,QAAQ,GAAG,YAAY,CAAC,UAAU,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useAction.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAction.tsx"],"names":[],"mappings":"AASA;;;;GAIG;AAEF,UAAU,YAAY;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IACjC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IAC7B,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,QAAQ,EAAE,QAAQ,CAAC;CACtB;AAED,aAAK,MAAM,GAAG,YAAY,GAAG,QAAQ,GAAG,GAAG,CAAA;AAE5C,eAAO,MAAM,SAAS,WAAY,MAAM,QA+BvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"useAction.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAction.tsx"],"names":[],"mappings":"AASA;;;;GAIG;AAEF,UAAU,YAAY;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IACjC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IAC7B,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,QAAQ,EAAE,QAAQ,CAAC;CACtB;AAED,aAAK,MAAM,GAAG,YAAY,GAAG,QAAQ,GAAG,GAAG,CAAA;AAE5C,eAAO,MAAM,SAAS,WAAY,MAAM,QAgCvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -24,11 +24,13 @@ const useAction = (action) => {
24
24
  if (typeof actionToUse === 'function')
25
25
  return actionToUse;
26
26
  if (actionToUse) {
27
- const { link, navigate, page, params, dispatch: dispatchAction, route, callback } = actionToUse;
27
+ const { link, navigate, push, page, params, dispatch: dispatchAction, route, callback } = actionToUse;
28
28
  if (link)
29
29
  return () => navigator.openURL(template(link));
30
30
  if (navigate)
31
- return () => navigator.navigate(...lodash_1.castArray(navigate));
31
+ return () => navigator.navigate(...lodash_1.castArray(JSON.parse(template(JSON.stringify(navigate)))));
32
+ if (push)
33
+ return () => navigator.push(...lodash_1.castArray(JSON.parse(template(JSON.stringify(navigate)))));
32
34
  if (page)
33
35
  return () => {
34
36
  console.log(page, params);
@@ -1 +1 @@
1
- {"version":3,"file":"useAction.js","sourceRoot":"","sources":["../../../src/hooks/useAction.tsx"],"names":[],"mappings":";;;;;;AAAA,iCAAgC;AAChC,6CAA0C;AAC1C,mCAAwC;AACxC,iDAA4C;AAC5C,yCAAoC;AACpC,gEAAwC;AACxC,mCAAiC;AAqB1B,MAAM,SAAS,GAAG,CAAC,MAAc,EAAC,EAAE;IAEvC,MAAM,SAAS,GAAG,2BAAY,EAAE,CAAC;IACjC,MAAM,QAAQ,GAAG,yBAAW,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAG,mBAAQ,EAAE,CAAC;IACzB,MAAM,QAAQ,GAAG,qBAAW,EAAE,CAAC;IAE/B,OAAO,eAAO,CAAC,GAAE,EAAE;QACf,IAAI,WAAW,GAAG,MAAM,CAAC;QAEzB,OAAO,WAAW,IAAI,WAAW,CAAC,OAAO,EAAC;YACtC,WAAW,GAAG,YAAG,CAAC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;SACjD;QAED,IAAG,OAAO,WAAW,KAAK,UAAU;YAAE,OAAO,WAAW,CAAC;QAEzD,IAAG,WAAW,EAAE;YACZ,MAAM,E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,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACpG,IAAI,IAAI;gBAAE,OAAO,GAAG,EAAE;oBAClB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;oBAC1B,MAAM,WAAW,GAAG,kBAAS,CAAC,MAAM,EAAE,CAAC,UAAiB,EAAC,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;oBAC5F,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,CAAA;gBACzC,CAAC,CAAC;YACF,IAAI,KAAK;gBAAE,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;YAC7D,IAAI,cAAc;gBAAE,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;YAC1D,IAAI,QAAQ;gBAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAC,CAAC,CAAC;SAC1E;IACL,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AACtC,CAAC,CAAC;AAhCW,QAAA,SAAS,aAgCpB;AAEF,kBAAe,iBAAS,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from './restApiMiddleware';
2
2
  export * from './socketMiddleware';
3
3
  export * from './dataSourceMiddleware';
4
+ export * from './platformEventsMiddleware';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/middlewares/index.tsx"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/middlewares/index.tsx"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC"}
@@ -13,4 +13,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./restApiMiddleware"), exports);
14
14
  __exportStar(require("./socketMiddleware"), exports);
15
15
  __exportStar(require("./dataSourceMiddleware"), exports);
16
+ __exportStar(require("./platformEventsMiddleware"), exports);
16
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/middlewares/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sDAAoC;AACpC,qDAAmC;AACnC,yDAAuC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/middlewares/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sDAAoC;AACpC,qDAAmC;AACnC,yDAAuC;AACvC,6DAA2C"}
@@ -0,0 +1,3 @@
1
+ export declare const platformEventsMiddleware: (store: any) => (next: any) => (action: any) => any;
2
+ export default platformEventsMiddleware;
3
+ //# sourceMappingURL=platformEventsMiddleware.d.ts.map
@@ -0,0 +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"}
@@ -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.js.map
@@ -0,0 +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"}
@@ -0,0 +1,5 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,19 @@
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 messageJson = JSON.parse(message.data);
9
+ if (messageJson.type) {
10
+ store.dispatch(messageJson);
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
@@ -0,0 +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,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YAC5C,IAAG,WAAW,CAAC,IAAI,EAAC;gBAChB,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;aAC/B;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,10 +1,11 @@
1
1
  export declare const pagesCollection: any;
2
2
  export declare const pluginsCollection: any;
3
+ export declare const collectionsCollection: any;
3
4
  export declare const menusCollection: any;
4
5
  export declare const layoutsCollection: any;
5
6
  export declare const domainCollection: any;
6
7
  export declare const reducers: {
7
- pages: any;
8
+ pages: (state: any, action: any) => any;
8
9
  menus: any;
9
10
  plugins: any;
10
11
  domains: any;
@@ -31,6 +32,7 @@ export * from './config';
31
32
  export * from './context';
32
33
  export * from './files';
33
34
  export * from './fonts';
35
+ export * from './pages';
34
36
  export * from './icons';
35
37
  export * from './modals';
36
38
  export * from './routes';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/reducers/index.tsx"],"names":[],"mappings":"AAiBA,eAAO,MAAM,eAAe,KAAyB,CAAC;AACtD,eAAO,MAAM,iBAAiB,KAA2B,CAAC;AAC1D,eAAO,MAAM,eAAe,KAAyB,CAAC;AACtD,eAAO,MAAM,iBAAiB,KAA2B,CAAC;AAC1D,eAAO,MAAM,gBAAgB,KAA2B,CAAC;AAEzD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;CAmBpB,CAAC;AAEF,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AAEvB,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/reducers/index.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,eAAe,KAAyB,CAAC;AACtD,eAAO,MAAM,iBAAiB,KAA2B,CAAC;AAC1D,eAAO,MAAM,qBAAqB,KAAgC,CAAC;AACnE,eAAO,MAAM,eAAe,KAAyB,CAAC;AACtD,eAAO,MAAM,iBAAiB,KAA2B,CAAC;AAC1D,eAAO,MAAM,gBAAgB,KAA2B,CAAC;AAEzD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;CAmBpB,CAAC;AAEF,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AAEvB,eAAe,QAAQ,CAAC"}
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  return (mod && mod.__esModule) ? mod : { "default": mod };
14
14
  };
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.reducers = exports.domainCollection = exports.layoutsCollection = exports.menusCollection = exports.pluginsCollection = exports.pagesCollection = void 0;
16
+ exports.reducers = exports.domainCollection = exports.layoutsCollection = exports.menusCollection = exports.collectionsCollection = exports.pluginsCollection = exports.pagesCollection = void 0;
17
17
  const redux_form_1 = require("redux-form");
18
18
  const redux_rest_1 = require("@mukti107/redux-rest");
19
19
  const config_1 = __importDefault(require("./config"));
@@ -25,17 +25,19 @@ const icons_1 = __importDefault(require("./icons"));
25
25
  const modals_1 = __importDefault(require("./modals"));
26
26
  const files_1 = __importDefault(require("./files"));
27
27
  const fonts_1 = __importDefault(require("./fonts"));
28
+ const pages_1 = __importDefault(require("./pages"));
28
29
  const collection_1 = __importDefault(require("./collection"));
29
30
  const dataSource_1 = __importDefault(require("./dataSource"));
30
31
  const adminMenus_1 = __importDefault(require("./adminMenus"));
31
32
  const restCollection = redux_rest_1.restApiCollection;
32
33
  exports.pagesCollection = restCollection('Page');
33
34
  exports.pluginsCollection = restCollection('Plugin');
35
+ exports.collectionsCollection = restCollection('collections');
34
36
  exports.menusCollection = restCollection('Menu');
35
37
  exports.layoutsCollection = restCollection('Layout');
36
38
  exports.domainCollection = restCollection('Domain');
37
39
  exports.reducers = {
38
- pages: exports.pagesCollection.reducer,
40
+ pages: pages_1.default,
39
41
  menus: exports.menusCollection.reducer,
40
42
  plugins: exports.pluginsCollection.reducer,
41
43
  domains: exports.domainCollection.reducer,
@@ -62,6 +64,7 @@ __exportStar(require("./config"), exports);
62
64
  __exportStar(require("./context"), exports);
63
65
  __exportStar(require("./files"), exports);
64
66
  __exportStar(require("./fonts"), exports);
67
+ __exportStar(require("./pages"), exports);
65
68
  __exportStar(require("./icons"), exports);
66
69
  __exportStar(require("./modals"), exports);
67
70
  __exportStar(require("./routes"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/reducers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAkD;AAClD,qDAAuD;AACvD,sD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ACR,CAAC;AAEF,+CAA6B;AAC7B,+CAA6B;AAC7B,+CAA6B;AAC7B,+CAA6B;AAC7B,2CAAyB;AACzB,4CAA0B;AAC1B,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AAEvB,kBAAe,gBAAQ,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const pages: (state: any, action: any) => any;
2
+ export default pages;
3
+ //# sourceMappingURL=pages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../../src/reducers/pages.tsx"],"names":[],"mappings":"AAcA,QAAA,MAAM,KAAK,uBAA2C,GAAG,QA0HxD,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ const REST_LIST_PAGES_SUCCESS = "REST_LIST_PAGES_SUCCESS";
15
+ const REST_FIND_PAGE_SUCCESS = "REST_FIND_PAGE_SUCCESS";
16
+ const REST_FIND_ID_PAGE_SUCCESS = "REST_FIND_ID_PAGE_SUCCESS";
17
+ const REST_ADD_PAGE_SUCCESS = "REST_ADD_PAGE_SUCCESS";
18
+ const REST_UPDATE_PAGE_SUCCESS = "REST_UPDATE_PAGE_SUCCESS";
19
+ const REST_DELETE_PAGE_SUCCESS = "REST_DELETE_PAGE_SUCCESS";
20
+ const REST_QUERY_PAGE_RUNNING = "REST_QUERY_PAGE_RUNNING";
21
+ const REST_QUERY_PAGE_FAILED = "REST_QUERY_PAGE_FAILED";
22
+ const PAGE_BLOCKS_UPDATED = "PAGE_BLOCKS_UPDATED";
23
+ // reducer copied from @mukti107/redux-rest
24
+ const initialState = { records: { data: [], isLoading: false }, collection: {}, isLoading: 0 };
25
+ const pages = function (state = initialState, action) {
26
+ switch (action.type) {
27
+ case REST_FIND_PAGE_SUCCESS:
28
+ case REST_LIST_PAGES_SUCCESS: {
29
+ const _a = action.response, { data } = _a, metaData = __rest(_a, ["data"]);
30
+ const records = data.map(item => (Object.assign({ id: item._id }, item)));
31
+ const { [action.identifier]: oldRecordState = {}, collection = {} } = state;
32
+ const newCollection = Object.assign({}, collection);
33
+ records.forEach(item => {
34
+ newCollection[item.id] = item;
35
+ });
36
+ return Object.assign(Object.assign({}, state), { collection: newCollection, [action.identifier]: Object.assign({ isLoading: false, data: records }, metaData), isLoading: state.isLoading - 1 });
37
+ }
38
+ case REST_FIND_ID_PAGE_SUCCESS:
39
+ case REST_UPDATE_PAGE_SUCCESS:
40
+ case REST_ADD_PAGE_SUCCESS: {
41
+ const { [action.identifier]: oldRecordState = {}, collection = {} } = state;
42
+ const { data: oldData = [] } = oldRecordState;
43
+ const newData = [...oldData];
44
+ const newCollection = Object.assign({}, collection);
45
+ const record = action.response;
46
+ const item = Object.assign({ id: record._id }, record);
47
+ const itemIndex = newData.findIndex(_item => _item.id === item.id);
48
+ if (itemIndex > -1) {
49
+ newData.splice(itemIndex, 1, item);
50
+ }
51
+ else {
52
+ newData.splice(0, 0, item);
53
+ }
54
+ newCollection[item.id] = item;
55
+ return Object.assign(Object.assign({}, state), { collection: newCollection, [action.identifier]: Object.assign(Object.assign({}, oldRecordState), { data: newData }), isLoading: state.isLoading - 1 });
56
+ }
57
+ case REST_DELETE_PAGE_SUCCESS: {
58
+ const { [action.identifier]: oldRecordState = {}, collection = {} } = state;
59
+ const { data: oldData = [] } = oldRecordState;
60
+ const newData = [...oldData];
61
+ const itemIndex = newData.findIndex(item => item.id === action.pathParams.id);
62
+ if (itemIndex > -1) {
63
+ newData.splice(itemIndex, 1);
64
+ }
65
+ const newCollection = Object.assign({}, collection);
66
+ delete newCollection[action.pathParams.id];
67
+ return Object.assign(Object.assign({}, state), { collection: newCollection, [action.identifier]: Object.assign(Object.assign({}, oldRecordState), { data: newData }), isLoading: state.isLoading - 1 });
68
+ }
69
+ case REST_QUERY_PAGE_RUNNING: {
70
+ const { [action.identifier]: oldRecordState = {} } = state;
71
+ return Object.assign(Object.assign({}, state), { [action.identifier]: Object.assign(Object.assign({}, oldRecordState), { isLoading: true }), isLoading: state.isLoading + 1 });
72
+ }
73
+ case REST_QUERY_PAGE_FAILED: {
74
+ const { [action.identifier]: oldRecordState = {} } = state;
75
+ return Object.assign(Object.assign({}, state), { [action.identifier]: Object.assign(Object.assign({}, oldRecordState), { isLoading: false }), isLoading: state.isLoading - 1 });
76
+ }
77
+ case PAGE_BLOCKS_UPDATED: {
78
+ const { records: oldRecordState = {}, collection = {} } = state;
79
+ const { data: oldData = [] } = oldRecordState;
80
+ const newData = [...oldData];
81
+ const newCollection = Object.assign({}, collection);
82
+ const newBlocks = action.blocks;
83
+ const pageId = action.pageId;
84
+ const itemIndex = newData.findIndex(_item => _item.id === pageId);
85
+ if (itemIndex > -1) {
86
+ const newItem = Object.assign(Object.assign({}, newData[itemIndex]), { blocks: newBlocks });
87
+ newData.splice(itemIndex, 1, newItem);
88
+ newCollection[pageId] = newItem;
89
+ }
90
+ return Object.assign(Object.assign({}, state), { collection: newCollection, records: Object.assign(Object.assign({}, oldRecordState), { data: newData }) });
91
+ }
92
+ default:
93
+ return state;
94
+ }
95
+ };
96
+ exports.default = pages;
97
+ //# sourceMappingURL=pages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pages.js","sourceRoot":"","sources":["../../../src/reducers/pages.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AACA,MAAM,uBAAuB,G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4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "peerDependencies": {