@elliemae/pui-app-sdk 2.20.1 → 2.21.3

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.
@@ -28,7 +28,9 @@ const setAppDynamicsUserData = params => {
28
28
  };
29
29
 
30
30
  if (brum) {
31
- brum.setCustomUserData(() => ({
31
+ var _brum$setCustomUserDa;
32
+
33
+ (_brum$setCustomUserDa = brum.setCustomUserData) === null || _brum$setCustomUserDa === void 0 ? void 0 : _brum$setCustomUserDa.call(brum, () => ({
32
34
  userData
33
35
  }));
34
36
  }
@@ -53,20 +53,21 @@ const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
53
53
  // @ts-ignore
54
54
  preloadedState: initialState,
55
55
  enhancers
56
- });
57
- let hotModule = null;
58
-
59
- try {
60
- var _module;
61
-
62
- hotModule = (_module = module) === null || _module === void 0 ? void 0 : _module.hot;
63
- } catch (err) {}
64
-
65
- if (hotModule) {
66
- hotModule.accept('./reducers', () => {
67
- (0, _reduxInjectors.forceReducerReload)(baseStore);
68
- });
69
- }
56
+ }); // let hotModule = null;
57
+ // try {
58
+ // hotModule = module?.hot;
59
+ // } catch (err) {
60
+ // // eslint-disable-next-line @typescript-eslint/ban-ts-comment
61
+ // // @ts-ignore
62
+ // // block:start
63
+ // hotModule = import.meta?.webpackHot;
64
+ // // block:end
65
+ // }
66
+ // if (hotModule) {
67
+ // hotModule.accept('./reducers', () => {
68
+ // forceReducerReload(baseStore);
69
+ // });
70
+ // }
70
71
 
71
72
  return baseStore;
72
73
  };
package/dist/cjs/index.js CHANGED
@@ -43,6 +43,7 @@ var _exportNames = {
43
43
  setAppConfigValue: true,
44
44
  setAppConfig: true,
45
45
  getMicroFrontEndAppConfig: true,
46
+ getLogger: true,
46
47
  loadAppConfig: true,
47
48
  AppRoot: true,
48
49
  ErrorBoundary: true,
@@ -379,6 +380,12 @@ Object.defineProperty(exports, "getHostAppDataByKey", {
379
380
  return _store2.getHostAppDataByKey;
380
381
  }
381
382
  });
383
+ Object.defineProperty(exports, "getLogger", {
384
+ enumerable: true,
385
+ get: function () {
386
+ return _index8.getLogger;
387
+ }
388
+ });
382
389
  Object.defineProperty(exports, "getMicroFrontEndAppConfig", {
383
390
  enumerable: true,
384
391
  get: function () {
@@ -16,8 +16,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
16
16
  const onPageView = pageTitle => {
17
17
  try {
18
18
  if (brum && pageTitle) {
19
- brum.setCustomVirtualPageName(pageTitle);
20
- brum.startVirtualPageMonitoringWithAutoEnd(pageTitle);
19
+ var _brum$setCustomVirtua, _brum$startVirtualPag;
20
+
21
+ (_brum$setCustomVirtua = brum.setCustomVirtualPageName) === null || _brum$setCustomVirtua === void 0 ? void 0 : _brum$setCustomVirtua.call(brum, pageTitle);
22
+ (_brum$startVirtualPag = brum.startVirtualPageMonitoringWithAutoEnd) === null || _brum$startVirtualPag === void 0 ? void 0 : _brum$startVirtualPag.call(brum, pageTitle);
21
23
  }
22
24
  } catch {// eslint-disable-next-line no-empty
23
25
  }
@@ -23,12 +23,12 @@ let sessionExpiryWarningNotified = false;
23
23
  let timerHandle;
24
24
  let sessionExpiryWarningNotifiedAt;
25
25
 
26
- const resetUserIdleTime = () => {
26
+ const resetUserIdleTime = (resetWarningModal = false) => {
27
27
  sessionExpiryWarningNotified = false;
28
28
  sessionExpiryWarningNotifiedAt = null;
29
29
  lastUserActivityTimeStamp = Date.now();
30
30
  Promise.resolve().then(() => {
31
- resetListeners.forEach(listener => listener());
31
+ resetListeners.forEach(listener => listener(resetWarningModal));
32
32
  }).catch(() => {});
33
33
  };
34
34
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getParameters = exports.decorators = void 0;
6
+ exports.loaders = exports.getParameters = exports.decorators = void 0;
7
7
 
8
8
  var _addonConsole = require("@storybook/addon-console");
9
9
 
@@ -21,11 +21,6 @@ var _history = require("../history.js");
21
21
 
22
22
  require("@elliemae/ds-basic/css/dimsum.css");
23
23
 
24
- (async () => {
25
- // eslint-disable-next-line no-undef
26
- await (0, _index.loadAppConfig)(__webpack_public_path__);
27
- })();
28
-
29
24
  const theme = (0, _puiTheme.getDefaultTheme)();
30
25
  const store = (0, _store.createAppStore)({}, _history.browserHistory);
31
26
 
@@ -59,4 +54,9 @@ const getParameters = storyBookTheme => ({
59
54
 
60
55
  exports.getParameters = getParameters;
61
56
  const decorators = [consoleDecorator, appDecorator];
62
- exports.decorators = decorators;
57
+ exports.decorators = decorators;
58
+ const loaders = [async () => {
59
+ // eslint-disable-next-line no-undef, camelcase
60
+ await (0, _index.loadAppConfig)(__webpack_public_path__ || './');
61
+ }];
62
+ exports.loaders = loaders;
@@ -35,10 +35,13 @@ const SessionExpiry = /*#__PURE__*/(0, _react.memo)(({
35
35
  const [isOpen, setIsOpen] = (0, _react.useState)(open);
36
36
  const timeLeft = (0, _customHooks.useTrackSessionExpiry)(warningNotifiedAt);
37
37
  const dispatch = (0, _reactRedux.useAppDispatch)();
38
+ (0, _react.useEffect)(() => {
39
+ setIsOpen(open);
40
+ }, [open]);
38
41
 
39
42
  const resetSession = () => {
40
43
  setIsOpen(false);
41
- (0, _session.resetUserIdleTime)();
44
+ (0, _session.resetUserIdleTime)(true);
42
45
  dispatch(_actions.logout.cancel());
43
46
  };
44
47
 
@@ -30,7 +30,11 @@ const SessionTimeout = () => {
30
30
  setwarningNotifiedAt(sessionExpiryWarningNotifiedAt);
31
31
  setSessionExpiryWarning(true);
32
32
  });
33
- const resetCb = (0, _session.subscribeToResetSession)(setSessionExpiryWarning.bind(null, false));
33
+ const resetCb = (0, _session.subscribeToResetSession)(resetWarningModal => {
34
+ if (resetWarningModal === true) {
35
+ setSessionExpiryWarning(false);
36
+ }
37
+ });
34
38
  const sessionExpiredCb = (0, _session.subscribeToSessionExpiry)(() => {
35
39
  dispatch(_actions.logout.confirm());
36
40
  setSessionExpiryWarning(false);
@@ -12,7 +12,9 @@ export const setAppDynamicsUserData = params => {
12
12
  };
13
13
 
14
14
  if (brum) {
15
- brum.setCustomUserData(() => ({
15
+ var _brum$setCustomUserDa;
16
+
17
+ (_brum$setCustomUserDa = brum.setCustomUserData) === null || _brum$setCustomUserDa === void 0 ? void 0 : _brum$setCustomUserDa.call(brum, () => ({
16
18
  userData
17
19
  }));
18
20
  }
@@ -1,7 +1,6 @@
1
1
  /* eslint-disable max-params */
2
- // @strip-block
3
2
  import { configureStore } from '@reduxjs/toolkit';
4
- import { createInjectorsEnhancer, forceReducerReload } from 'redux-injectors';
3
+ import { createInjectorsEnhancer } from 'redux-injectors';
5
4
  import { routerMiddleware } from 'connected-react-router';
6
5
  import createSagaMiddleware from 'redux-saga';
7
6
  import { createReducer } from "./reducers.js";
@@ -34,27 +33,21 @@ const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
34
33
  // @ts-ignore
35
34
  preloadedState: initialState,
36
35
  enhancers
37
- });
38
- let hotModule = null;
39
-
40
- try {
41
- var _module;
42
-
43
- hotModule = (_module = module) === null || _module === void 0 ? void 0 : _module.hot;
44
- } catch (err) {
45
- var _import$meta;
46
-
47
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
48
- // @ts-ignore
49
- // block:start
50
- hotModule = (_import$meta = import.meta) === null || _import$meta === void 0 ? void 0 : _import$meta.webpackHot; // block:end
51
- }
52
-
53
- if (hotModule) {
54
- hotModule.accept('./reducers', () => {
55
- forceReducerReload(baseStore);
56
- });
57
- }
36
+ }); // let hotModule = null;
37
+ // try {
38
+ // hotModule = module?.hot;
39
+ // } catch (err) {
40
+ // // eslint-disable-next-line @typescript-eslint/ban-ts-comment
41
+ // // @ts-ignore
42
+ // // block:start
43
+ // hotModule = import.meta?.webpackHot;
44
+ // // block:end
45
+ // }
46
+ // if (hotModule) {
47
+ // hotModule.accept('./reducers', () => {
48
+ // forceReducerReload(baseStore);
49
+ // });
50
+ // }
58
51
 
59
52
  return baseStore;
60
53
  };
package/dist/es/index.js CHANGED
@@ -24,7 +24,7 @@ export { CMicroAppGuest } from "./utils/micro-frontend/guest.js";
24
24
  export { CMicroAppHost } from "./utils/micro-frontend/host.js";
25
25
  export { enableReactAppForHostIntegration } from "./utils/app-host-integration/react.js";
26
26
  export { getAppConfigValue, setAppConfigValue, setAppConfig } from "./utils/app-config/config.js";
27
- export { getMicroFrontEndAppConfig } from "./utils/micro-frontend/index.js";
27
+ export { getMicroFrontEndAppConfig, getLogger } from "./utils/micro-frontend/index.js";
28
28
  export { loadAppConfig } from "./utils/app-config/index.js";
29
29
  export { AppRoot } from "./view/app-root/index.js";
30
30
  export { ErrorBoundary } from "./view/error-boundary/index.js";
@@ -3,8 +3,10 @@ import { pageViewEvent } from "../analytics/page-view-event.js";
3
3
  export const onPageView = pageTitle => {
4
4
  try {
5
5
  if (brum && pageTitle) {
6
- brum.setCustomVirtualPageName(pageTitle);
7
- brum.startVirtualPageMonitoringWithAutoEnd(pageTitle);
6
+ var _brum$setCustomVirtua, _brum$startVirtualPag;
7
+
8
+ (_brum$setCustomVirtua = brum.setCustomVirtualPageName) === null || _brum$setCustomVirtua === void 0 ? void 0 : _brum$setCustomVirtua.call(brum, pageTitle);
9
+ (_brum$startVirtualPag = brum.startVirtualPageMonitoringWithAutoEnd) === null || _brum$startVirtualPag === void 0 ? void 0 : _brum$startVirtualPag.call(brum, pageTitle);
8
10
  }
9
11
  } catch {// eslint-disable-next-line no-empty
10
12
  }
@@ -10,12 +10,12 @@ const userInteractionEvents = ['click', 'scroll', 'keypress', 'touchstart'];
10
10
  let sessionExpiryWarningNotified = false;
11
11
  let timerHandle;
12
12
  let sessionExpiryWarningNotifiedAt;
13
- export const resetUserIdleTime = () => {
13
+ export const resetUserIdleTime = (resetWarningModal = false) => {
14
14
  sessionExpiryWarningNotified = false;
15
15
  sessionExpiryWarningNotifiedAt = null;
16
16
  lastUserActivityTimeStamp = Date.now();
17
17
  Promise.resolve().then(() => {
18
- resetListeners.forEach(listener => listener());
18
+ resetListeners.forEach(listener => listener(resetWarningModal));
19
19
  }).catch(() => {});
20
20
  };
21
21
 
@@ -6,12 +6,6 @@ import { loadAppConfig } from "../app-config/index.js";
6
6
  import { createTheme } from "./theme.js";
7
7
  import { browserHistory } from "../history.js";
8
8
  import '@elliemae/ds-basic/css/dimsum.css';
9
-
10
- (async () => {
11
- // eslint-disable-next-line no-undef
12
- await loadAppConfig(__webpack_public_path__);
13
- })();
14
-
15
9
  const theme = getDefaultTheme();
16
10
  const store = createAppStore({}, browserHistory);
17
11
  const appDecorator = withAppDecorator.bind(null, theme, store);
@@ -41,4 +35,8 @@ export const getParameters = storyBookTheme => ({
41
35
  hideEmpty: true
42
36
  }
43
37
  });
44
- export const decorators = [consoleDecorator, appDecorator];
38
+ export const decorators = [consoleDecorator, appDecorator];
39
+ export const loaders = [async () => {
40
+ // eslint-disable-next-line no-undef, camelcase
41
+ await loadAppConfig(__webpack_public_path__ || './');
42
+ }];
@@ -2,7 +2,7 @@ import _jsx from "@babel/runtime/helpers/jsx";
2
2
 
3
3
  var _p;
4
4
 
5
- import { memo, useState } from 'react';
5
+ import { memo, useEffect, useState } from 'react';
6
6
  import DSModal, { MODAL_SUB_TYPE_V2, MODAL_TYPE_V2 } from '@elliemae/ds-modal';
7
7
  import { useAppDispatch } from "../../../data/react-redux.js";
8
8
  import { logout } from "../../../data/logout/actions.js";
@@ -16,10 +16,13 @@ export const SessionExpiry = /*#__PURE__*/memo(({
16
16
  const [isOpen, setIsOpen] = useState(open);
17
17
  const timeLeft = useTrackSessionExpiry(warningNotifiedAt);
18
18
  const dispatch = useAppDispatch();
19
+ useEffect(() => {
20
+ setIsOpen(open);
21
+ }, [open]);
19
22
 
20
23
  const resetSession = () => {
21
24
  setIsOpen(false);
22
- resetUserIdleTime();
25
+ resetUserIdleTime(true);
23
26
  dispatch(logout.cancel());
24
27
  };
25
28
 
@@ -15,7 +15,11 @@ export const SessionTimeout = () => {
15
15
  setwarningNotifiedAt(sessionExpiryWarningNotifiedAt);
16
16
  setSessionExpiryWarning(true);
17
17
  });
18
- const resetCb = subscribeToResetSession(setSessionExpiryWarning.bind(null, false));
18
+ const resetCb = subscribeToResetSession(resetWarningModal => {
19
+ if (resetWarningModal === true) {
20
+ setSessionExpiryWarning(false);
21
+ }
22
+ });
19
23
  const sessionExpiredCb = subscribeToSessionExpiry(() => {
20
24
  dispatch(logout.confirm());
21
25
  setSessionExpiryWarning(false);
@@ -1,6 +1,12 @@
1
1
  import { TypedUseSelectorHook } from 'react-redux';
2
2
  import { RootState } from './store';
3
- export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<import("redux").CombinedState<{
3
+ export declare const useAppDispatch: () => import("redux").Dispatch<{
4
+ payload: import("./wait-message/reducer").WaitMessageState;
5
+ type: string;
6
+ } | import("redux").AnyAction | {
7
+ payload: import("./breakpoint").Breakpoints;
8
+ type: string;
9
+ }> & import("redux-thunk").ThunkDispatch<import("redux").CombinedState<{
4
10
  waitMessage: import("./wait-message/reducer").WaitMessageState;
5
11
  error: import("./error").ErrorState;
6
12
  breakpoint: import("./breakpoint").BreakpointState;
@@ -10,11 +16,5 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<i
10
16
  error: import("./error").ErrorState;
11
17
  breakpoint: import("./breakpoint").BreakpointState;
12
18
  liveMessage: import("./live-message").LiveMessageState;
13
- }>, undefined, import("redux").AnyAction> & import("redux").Dispatch<{
14
- payload: import("./wait-message/reducer").WaitMessageState;
15
- type: string;
16
- } | import("redux").AnyAction | {
17
- payload: import("./breakpoint").Breakpoints;
18
- type: string;
19
- }>;
19
+ }>, undefined, import("redux").AnyAction>;
20
20
  export declare const useAppSelector: TypedUseSelectorHook<RootState>;
@@ -23,7 +23,7 @@ export { CMicroAppGuest } from './utils/micro-frontend/guest';
23
23
  export { CMicroAppHost } from './utils/micro-frontend/host';
24
24
  export { enableReactAppForHostIntegration } from './utils/app-host-integration/react';
25
25
  export { getAppConfigValue, setAppConfigValue, setAppConfig, } from './utils/app-config/config';
26
- export { getMicroFrontEndAppConfig } from './utils/micro-frontend';
26
+ export { getMicroFrontEndAppConfig, getLogger } from './utils/micro-frontend';
27
27
  export { loadAppConfig } from './utils/app-config';
28
28
  export { AppRoot } from './view/app-root';
29
29
  export { ErrorBoundary } from './view/error-boundary';
@@ -1,14 +1,17 @@
1
1
  declare type WARNLISTENER = {
2
2
  (sessionExpiryWarningNotifiedAt: number | null): void;
3
3
  };
4
+ declare type RESETLISTENER = {
5
+ (resetWarningModal: unknown): void;
6
+ };
4
7
  declare type LISTENER = {
5
8
  (): void;
6
9
  };
7
- export declare const resetUserIdleTime: () => void;
10
+ export declare const resetUserIdleTime: (resetWarningModal?: unknown) => void;
8
11
  export declare const stopSessionMonitoring: () => void;
9
12
  export declare const initSessionMonitoring: () => void;
10
13
  export declare const subscribeToSessionExpiryWarning: (onSessionExpiryWarn: WARNLISTENER) => () => void;
11
14
  export declare const subscribeToSessionExpiry: (onSessionExpiry: LISTENER) => () => void;
12
- export declare const subscribeToResetSession: (onResetListener: LISTENER) => () => void;
15
+ export declare const subscribeToResetSession: (onResetListener: RESETLISTENER) => () => void;
13
16
  export declare const trackActivity: (element: Document | null, cb: (...args: unknown[]) => void) => () => void;
14
17
  export {};
@@ -22,3 +22,4 @@ export function getParameters(storyBookTheme: any): {
22
22
  };
23
23
  };
24
24
  export const decorators: (((story: () => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => JSX.Element) | ((storyFn: any, context: any) => any))[];
25
+ export const loaders: (() => Promise<void>)[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-app-sdk",
3
- "version": "2.20.1",
3
+ "version": "2.21.3",
4
4
  "description": "ICE MT UI Platform Application SDK ",
5
5
  "sideEffects": [
6
6
  "*.css",
@@ -72,7 +72,7 @@
72
72
  "storybook:docs": "pui-cli storybook --docs",
73
73
  "storybook:docs:build": "pui-cli storybook -b --docs",
74
74
  "storybook:build": "pui-cli storybook -b",
75
- "storybook:prod": "npm run storybook:build && http-server -g -p 11000 demo",
75
+ "storybook:prod": "http-server -g -p 11000 demo",
76
76
  "setup": "rimraf -r node_modules && rimraf package-lock.json && npm i",
77
77
  "test": "pui-cli test -p",
78
78
  "test:fix": "pui-cli test -f",
@@ -89,37 +89,37 @@
89
89
  },
90
90
  "peerDependencies": {
91
91
  "@elliemae/app-react-dependencies": "^2.10.0",
92
- "@elliemae/ds-basic": "^1.60.0",
93
- "@elliemae/ds-button": "^1.60.0",
94
- "@elliemae/ds-form": "^1.60.0",
95
- "@elliemae/ds-loading-indicator": "^1.60.0",
96
- "@elliemae/ds-date-picker": "^1.60.0",
97
- "@elliemae/ds-modal": "^1.60.0",
98
- "@elliemae/ds-popperjs": "^1.60.0",
99
- "@elliemae/ds-toast": "^1.60.0",
92
+ "@elliemae/ds-basic": "^2.2.2",
93
+ "@elliemae/ds-button": "^2.2.2",
94
+ "@elliemae/ds-form": "^2.2.2",
95
+ "@elliemae/ds-loading-indicator": "^2.2.2",
96
+ "@elliemae/ds-date-picker": "^2.2.2",
97
+ "@elliemae/ds-modal": "^2.2.2",
98
+ "@elliemae/ds-popperjs": "^2.2.2",
99
+ "@elliemae/ds-toast": "^2.2.2",
100
100
  "@elliemae/em-ssf-guest": "^1.11.1",
101
- "@elliemae/pui-diagnostics": "^2.7.2",
102
- "@elliemae/pui-micro-frontend-base": "^1.10.0",
101
+ "@elliemae/pui-diagnostics": "^2.7.3",
102
+ "@elliemae/pui-micro-frontend-base": "^1.10.1",
103
103
  "@elliemae/pui-theme": "^2.3.0",
104
- "@elliemae/pui-user-monitoring": "^1.12.1"
104
+ "@elliemae/pui-user-monitoring": "^1.13.0"
105
105
  },
106
106
  "devDependencies": {
107
107
  "@elliemae/app-react-dependencies": "~2.10.0",
108
108
  "@elliemae/browserslist-config-elliemae-latest-browsers": "~1.2.1",
109
- "@elliemae/ds-basic": "~1.60.0",
110
- "@elliemae/ds-button": "~1.60.0",
111
- "@elliemae/ds-form": "~1.60.0",
112
- "@elliemae/ds-loading-indicator": "~1.60.0",
113
- "@elliemae/ds-date-picker": "~1.60.0",
114
- "@elliemae/ds-modal": "~1.60.0",
115
- "@elliemae/ds-popperjs": "~1.60.0",
116
- "@elliemae/ds-toast": "~1.60.0",
109
+ "@elliemae/ds-basic": "~2.2.2",
110
+ "@elliemae/ds-button": "~2.2.2",
111
+ "@elliemae/ds-form": "~2.2.2",
112
+ "@elliemae/ds-loading-indicator": "~2.2.2",
113
+ "@elliemae/ds-date-picker": "~2.2.2",
114
+ "@elliemae/ds-modal": "~2.2.2",
115
+ "@elliemae/ds-popperjs": "~2.2.2",
116
+ "@elliemae/ds-toast": "~2.2.2",
117
117
  "@elliemae/em-ssf-guest": "~1.11.1",
118
- "@elliemae/pui-cli": "~5.21.3",
119
- "@elliemae/pui-diagnostics": "~2.7.2",
120
- "@elliemae/pui-e2e-test-sdk": "~6.8.0",
121
- "@elliemae/pui-micro-frontend-base": "~1.10.0",
118
+ "@elliemae/pui-cli": "~5.25.2",
119
+ "@elliemae/pui-diagnostics": "~2.7.3",
120
+ "@elliemae/pui-e2e-test-sdk": "~6.10.0",
121
+ "@elliemae/pui-micro-frontend-base": "~1.10.1",
122
122
  "@elliemae/pui-theme": "~2.3.0",
123
- "@elliemae/pui-user-monitoring": "~1.12.1"
123
+ "@elliemae/pui-user-monitoring": "~1.13.0"
124
124
  }
125
125
  }