@elliemae/pui-app-sdk 5.2.6 → 5.3.0

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.
@@ -43,7 +43,10 @@ const getHTTPClient = ({
43
43
  baseURL = (0, import_config.getAppConfigValue)("serviceEndpoints.api", ""),
44
44
  headers = {}
45
45
  } = {}) => {
46
- const client = import_axios.default.create({ baseURL, headers });
46
+ const client = import_axios.default.create({
47
+ baseURL,
48
+ headers: { "Content-Type": "application/json", ...headers }
49
+ });
47
50
  if (client?.defaults?.timeout)
48
51
  client.defaults.timeout = REQUEST_TIMEOUT;
49
52
  (0, import_retry.default)(client);
@@ -54,16 +54,25 @@ const WaitMessage = (0, import_react.memo)(
54
54
  tooltipStartPlacementPreference = "center",
55
55
  ...rest
56
56
  }) => {
57
+ const ref = (0, import_react.useRef)(false);
58
+ const [show, setShow] = (0, import_react.useState)(false);
57
59
  const isOpen = (0, import_react2.useAppSelector)((state) => state.waitMessage?.isOpen);
60
+ ref.current = isOpen ?? false;
58
61
  const message = (0, import_react2.useAppSelector)((state) => state.waitMessage?.message);
59
62
  (0, import_react.useEffect)(() => {
60
- if (isOpen)
61
- (0, import_user_wait_event.waitStartEvent)();
62
- else
63
+ setTimeout(() => {
64
+ if (isOpen && ref.current) {
65
+ setShow(true);
66
+ (0, import_user_wait_event.waitStartEvent)();
67
+ }
68
+ }, 1e3);
69
+ if (!isOpen) {
70
+ setShow(false);
63
71
  (0, import_user_wait_event.waitEndEvent)();
72
+ }
64
73
  }, [isOpen]);
65
74
  (0, import_use_html_wait_message.useHTMLWaitMessage)(isOpen !== null);
66
- return isOpen ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
75
+ return show ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
67
76
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_backdrop.DSBackdrop, {}),
68
77
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
69
78
  StyledCircularIndicator,
@@ -9,7 +9,10 @@ const getHTTPClient = ({
9
9
  baseURL = getAppConfigValue("serviceEndpoints.api", ""),
10
10
  headers = {}
11
11
  } = {}) => {
12
- const client = axios.create({ baseURL, headers });
12
+ const client = axios.create({
13
+ baseURL,
14
+ headers: { "Content-Type": "application/json", ...headers }
15
+ });
13
16
  if (client?.defaults?.timeout)
14
17
  client.defaults.timeout = REQUEST_TIMEOUT;
15
18
  setupRetry(client);
@@ -1,5 +1,5 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { memo, useEffect } from "react";
2
+ import { memo, useEffect, useState, useRef } from "react";
3
3
  import styled from "styled-components";
4
4
  import { DSBackdrop } from "@elliemae/ds-backdrop";
5
5
  import { DSCircularIndeterminateIndicator } from "@elliemae/ds-circular-progress-indicator";
@@ -24,16 +24,25 @@ const WaitMessage = memo(
24
24
  tooltipStartPlacementPreference = "center",
25
25
  ...rest
26
26
  }) => {
27
+ const ref = useRef(false);
28
+ const [show, setShow] = useState(false);
27
29
  const isOpen = useAppSelector((state) => state.waitMessage?.isOpen);
30
+ ref.current = isOpen ?? false;
28
31
  const message = useAppSelector((state) => state.waitMessage?.message);
29
32
  useEffect(() => {
30
- if (isOpen)
31
- waitStartEvent();
32
- else
33
+ setTimeout(() => {
34
+ if (isOpen && ref.current) {
35
+ setShow(true);
36
+ waitStartEvent();
37
+ }
38
+ }, 1e3);
39
+ if (!isOpen) {
40
+ setShow(false);
33
41
  waitEndEvent();
42
+ }
34
43
  }, [isOpen]);
35
44
  useHTMLWaitMessage(isOpen !== null);
36
- return isOpen ? /* @__PURE__ */ jsxs(Fragment, { children: [
45
+ return show ? /* @__PURE__ */ jsxs(Fragment, { children: [
37
46
  /* @__PURE__ */ jsx(DSBackdrop, {}),
38
47
  /* @__PURE__ */ jsx(
39
48
  StyledCircularIndicator,
@@ -37,7 +37,6 @@ export declare const getApiActionCreator: (api: string) => (operation: string) =
37
37
  *
38
38
  * For this to work as expected, ensure you always select ONLY what you need. Don't select state objects that contain fields that you won't use, if you do so
39
39
  * then everytime any of those gets updated it will trigger a rerender even though you're not actually using that field.
40
- *
41
40
  * @description Generic Redux State Selector Helper.
42
41
  * ### Example
43
42
  * ```javascript
@@ -25,14 +25,12 @@ export interface SDKAxiosInstance extends Omit<AxiosInstance, 'defaults'> {
25
25
  }
26
26
  /**
27
27
  * Eject the Axios interceptor that is providing retry capabilities.
28
- *
29
28
  * @param interceptorId The interceptorId provided in the config.
30
29
  * @param instance The axios instance using this interceptor.
31
30
  */
32
31
  export declare const detach: (interceptorId: number, instance: typeof axios) => void;
33
32
  /**
34
33
  * Attach the interceptor to the Axios instance.
35
- *
36
34
  * @param instance The optional Axios instance on which to attach the
37
35
  * interceptor.
38
36
  * @returns The id of the interceptor attached to the axios instance.
@@ -40,7 +38,6 @@ export declare const detach: (interceptorId: number, instance: typeof axios) =>
40
38
  export declare const attach: (instance: AxiosInstance) => number | null;
41
39
  /**
42
40
  * Acquire the retryConfig object from an AxiosError if available.
43
- *
44
41
  * @param err The Axios error with a config object.
45
42
  */
46
43
  export declare const getConfig: (err: SDKAxiosError) => RetryConfig | Partial<RetryConfig> | null;
@@ -23,12 +23,12 @@ export declare const createAppStore: (initialState: import("redux").CombinedStat
23
23
  error: import("./error/index.js").ErrorState;
24
24
  breakpoint: import("./breakpoint/index.js").BreakpointState;
25
25
  liveMessage: import("./live-message/index.js").LiveMessageState;
26
- }> | undefined, history: History, middlewareConfig?: MiddlewareConfig) => import("@reduxjs/toolkit/dist/configureStore.js").ToolkitStore<import("redux").CombinedState<{
26
+ }> | undefined, history: History, middlewareConfig?: MiddlewareConfig) => import("@reduxjs/toolkit/dist/configureStore.js").ToolkitStore<import("redux").EmptyObject & {
27
27
  waitMessage: import("./wait-message/reducer.js").WaitMessageState;
28
28
  error: import("./error/index.js").ErrorState;
29
29
  breakpoint: import("./breakpoint/index.js").BreakpointState;
30
30
  liveMessage: import("./live-message/index.js").LiveMessageState;
31
- }>, {
31
+ }, {
32
32
  payload: import("./wait-message/reducer.js").WaitMessageState;
33
33
  type: string;
34
34
  } | import("redux").AnyAction | {
@@ -5,12 +5,12 @@ interface Args {
5
5
  store: AppStore;
6
6
  }
7
7
  export declare const renderWithRedux: (ui: React.ReactElement, { initialState, store, }?: Args) => {
8
- store: import("@reduxjs/toolkit/dist/configureStore.js").ToolkitStore<import("redux").CombinedState<{
8
+ store: import("@reduxjs/toolkit/dist/configureStore.js").ToolkitStore<import("redux").EmptyObject & {
9
9
  waitMessage: import("../../data/wait-message/reducer.js").WaitMessageState;
10
10
  error: import("../../data/error/index.js").ErrorState;
11
11
  breakpoint: import("../../data/breakpoint/index.js").BreakpointState;
12
12
  liveMessage: import("../../data/live-message/index.js").LiveMessageState;
13
- }>, {
13
+ }, {
14
14
  payload: import("../../data/wait-message/reducer.js").WaitMessageState;
15
15
  type: string;
16
16
  } | import("redux").AnyAction | {
@@ -8,12 +8,12 @@ interface Args {
8
8
  history: History;
9
9
  }
10
10
  export declare const renderWithRouterRedux: (ui: React.ReactElement, { route, history, initialState, store, }?: Args) => {
11
- store: import("@reduxjs/toolkit/dist/configureStore.js").ToolkitStore<import("redux").CombinedState<{
11
+ store: import("@reduxjs/toolkit/dist/configureStore.js").ToolkitStore<import("redux").EmptyObject & {
12
12
  waitMessage: import("../../data/wait-message/reducer.js").WaitMessageState;
13
13
  error: import("../../data/error/index.js").ErrorState;
14
14
  breakpoint: import("../../data/breakpoint/index.js").BreakpointState;
15
15
  liveMessage: import("../../data/live-message/index.js").LiveMessageState;
16
- }>, {
16
+ }, {
17
17
  payload: import("../../data/wait-message/reducer.js").WaitMessageState;
18
18
  type: string;
19
19
  } | import("redux").AnyAction | {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-app-sdk",
3
- "version": "5.2.6",
3
+ "version": "5.3.0",
4
4
  "description": "ICE MT UI Platform Application SDK ",
5
5
  "sideEffects": [
6
6
  "*.css",
@@ -63,8 +63,8 @@
63
63
  "url": "https://git.elliemae.io/platform-ui/pui-app-sdk.git"
64
64
  },
65
65
  "engines": {
66
- "pnpm": ">=6",
67
- "node": ">=16"
66
+ "pnpm": ">=8",
67
+ "node": ">=18"
68
68
  },
69
69
  "author": "ICE MT",
70
70
  "license": "MIT",
@@ -112,53 +112,53 @@
112
112
  },
113
113
  "peerDependencies": {
114
114
  "@elliemae/app-react-dependencies": "^4.9.0",
115
- "@elliemae/ds-backdrop": "^3.14.13",
116
- "@elliemae/ds-basic": "^3.14.13",
117
- "@elliemae/ds-button": "^3.14.13",
118
- "@elliemae/ds-circular-progress-indicator": "^3.14.13",
119
- "@elliemae/ds-controlled-form": "^3.14.13",
120
- "@elliemae/ds-date-picker": "^3.14.13",
121
- "@elliemae/ds-date-range-picker": "^3.14.13",
122
- "@elliemae/ds-dialog": "^3.14.13",
123
- "@elliemae/ds-form": "^3.14.13",
124
- "@elliemae/ds-form-layout-blocks": "^3.14.13",
125
- "@elliemae/ds-grid": "^3.14.13",
126
- "@elliemae/ds-modal": "^3.14.13",
127
- "@elliemae/ds-popperjs": "^3.14.13",
128
- "@elliemae/ds-toast": "^3.14.13",
115
+ "@elliemae/ds-backdrop": "^3.14.16",
116
+ "@elliemae/ds-basic": "^3.14.16",
117
+ "@elliemae/ds-button": "^3.14.16",
118
+ "@elliemae/ds-circular-progress-indicator": "^3.14.16",
119
+ "@elliemae/ds-controlled-form": "^3.14.16",
120
+ "@elliemae/ds-date-picker": "^3.14.16",
121
+ "@elliemae/ds-date-range-picker": "^3.14.16",
122
+ "@elliemae/ds-dialog": "^3.14.16",
123
+ "@elliemae/ds-form": "^3.14.16",
124
+ "@elliemae/ds-form-layout-blocks": "^3.14.16",
125
+ "@elliemae/ds-grid": "^3.14.16",
126
+ "@elliemae/ds-modal": "^3.14.16",
127
+ "@elliemae/ds-popperjs": "^3.14.16",
128
+ "@elliemae/ds-toast": "^3.14.16",
129
129
  "@elliemae/em-ssf-guest": "^1.11.3",
130
- "@elliemae/pui-diagnostics": "^3.1.0",
130
+ "@elliemae/pui-diagnostics": "^3.2.0",
131
131
  "@elliemae/pui-micro-frontend-base": "^1.14.0",
132
- "@elliemae/pui-scripting-object": "^1.19.1",
132
+ "@elliemae/pui-scripting-object": "^1.20.0",
133
133
  "@elliemae/pui-theme": "^2.7.0",
134
- "@elliemae/pui-user-monitoring": "^1.19.0"
134
+ "@elliemae/pui-user-monitoring": "^1.20.0"
135
135
  },
136
136
  "devDependencies": {
137
137
  "@elliemae/app-react-dependencies": "~4.9.0",
138
138
  "@elliemae/browserslist-config-elliemae-latest-browsers": "~1.7.0",
139
- "@elliemae/ds-backdrop": "~3.14.13",
140
- "@elliemae/ds-basic": "~3.14.13",
141
- "@elliemae/ds-button": "~3.14.13",
142
- "@elliemae/ds-circular-progress-indicator": "~3.14.13",
143
- "@elliemae/ds-controlled-form": "~3.14.13",
144
- "@elliemae/ds-date-picker": "~3.14.13",
145
- "@elliemae/ds-date-range-picker": "~3.14.13",
146
- "@elliemae/ds-dialog": "~3.14.13",
147
- "@elliemae/ds-form": "~3.14.13",
148
- "@elliemae/ds-form-layout-blocks": "~3.14.13",
149
- "@elliemae/ds-grid": "~3.14.13",
150
- "@elliemae/ds-modal": "~3.14.13",
151
- "@elliemae/ds-popperjs": "~3.14.13",
152
- "@elliemae/ds-toast": "~3.14.13",
139
+ "@elliemae/ds-backdrop": "~3.14.16",
140
+ "@elliemae/ds-basic": "~3.14.16",
141
+ "@elliemae/ds-button": "~3.14.16",
142
+ "@elliemae/ds-circular-progress-indicator": "~3.14.16",
143
+ "@elliemae/ds-controlled-form": "~3.14.16",
144
+ "@elliemae/ds-date-picker": "~3.14.16",
145
+ "@elliemae/ds-date-range-picker": "~3.14.16",
146
+ "@elliemae/ds-dialog": "~3.14.16",
147
+ "@elliemae/ds-form": "~3.14.16",
148
+ "@elliemae/ds-form-layout-blocks": "~3.14.16",
149
+ "@elliemae/ds-grid": "~3.14.16",
150
+ "@elliemae/ds-modal": "~3.14.16",
151
+ "@elliemae/ds-popperjs": "~3.14.16",
152
+ "@elliemae/ds-toast": "~3.14.16",
153
153
  "@elliemae/em-ssf-guest": "~1.11.3",
154
- "@elliemae/pui-cli": "~8.5.0",
155
- "@elliemae/pui-diagnostics": "~3.1.0",
154
+ "@elliemae/pui-cli": "~8.6.0",
155
+ "@elliemae/pui-diagnostics": "~3.2.0",
156
156
  "@elliemae/pui-doc-gen": "~1.6.4",
157
157
  "@elliemae/pui-e2e-test-sdk": "~8.0.0",
158
158
  "@elliemae/pui-micro-frontend-base": "~1.14.0",
159
- "@elliemae/pui-scripting-object": "~1.19.1",
159
+ "@elliemae/pui-scripting-object": "~1.20.0",
160
160
  "@elliemae/pui-theme": "~2.7.0",
161
- "@elliemae/pui-user-monitoring": "~1.19.0",
161
+ "@elliemae/pui-user-monitoring": "~1.20.0",
162
162
  "@types/react-aria-live": "~2.0.2"
163
163
  }
164
164
  }