@elliemae/pui-app-sdk 3.0.0-beta.20 → 3.0.0-beta.24

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.
Files changed (31) hide show
  1. package/dist/cjs/index.js +4 -4
  2. package/dist/cjs/utils/auth/index.js +2 -1
  3. package/dist/cjs/view/app-root/hosted-app.js +9 -6
  4. package/dist/cjs/view/app-root/stand-alone-app.js +7 -3
  5. package/dist/cjs/view/{media-breakpoint/index.js → breakpoint/use-breakpoint.js} +7 -8
  6. package/dist/cjs/view/{useMediaBreakpoints/index.js → breakpoint/use-media-query-list.js} +7 -7
  7. package/dist/cjs/view/modals/wait-message/index.js +4 -5
  8. package/dist/cjs/view/modals/wait-message/{html-wait-message.js → use-html-wait-message.js} +6 -7
  9. package/dist/cjs/view/require-auth.js +1 -5
  10. package/dist/cjs/view/{window-size/index.js → use-window-size-change.js} +6 -7
  11. package/dist/es/index.js +4 -4
  12. package/dist/es/utils/auth/index.js +2 -1
  13. package/dist/es/view/app-root/hosted-app.js +9 -6
  14. package/dist/es/view/app-root/stand-alone-app.js +7 -3
  15. package/dist/es/view/{media-breakpoint/index.js → breakpoint/use-breakpoint.js} +4 -5
  16. package/dist/es/view/{useMediaBreakpoints/index.js → breakpoint/use-media-query-list.js} +4 -4
  17. package/dist/es/view/modals/wait-message/index.js +4 -5
  18. package/dist/es/view/modals/wait-message/{html-wait-message.js → use-html-wait-message.js} +4 -5
  19. package/dist/es/view/require-auth.js +1 -5
  20. package/dist/es/view/{window-size/index.js → use-window-size-change.js} +3 -4
  21. package/dist/types/index.d.ts +2 -2
  22. package/dist/types/view/{media-breakpoint → breakpoint}/index.stories.d.ts +0 -0
  23. package/dist/types/view/breakpoint/use-breakpoint.d.ts +1 -0
  24. package/dist/types/view/breakpoint/use-media-query-list.d.ts +1 -0
  25. package/dist/types/view/modals/wait-message/use-html-wait-message.d.ts +1 -0
  26. package/dist/types/view/use-window-size-change.d.ts +1 -0
  27. package/package.json +34 -33
  28. package/dist/types/view/media-breakpoint/index.d.ts +0 -1
  29. package/dist/types/view/modals/wait-message/html-wait-message.d.ts +0 -6
  30. package/dist/types/view/useMediaBreakpoints/index.d.ts +0 -1
  31. package/dist/types/view/window-size/index.d.ts +0 -1
package/dist/cjs/index.js CHANGED
@@ -39,12 +39,12 @@ __export(lib_exports, {
39
39
  ErrorToast: () => import_error_toast.ErrorToast,
40
40
  Form: () => import_form.Form,
41
41
  FormItemLayout: () => import_form_item_layout.FormItemLayout,
42
+ FormLayoutBlockItem: () => import_form_layout_block_item.FormLayoutBlockItem,
42
43
  FormSubmitButton: () => import_submit_button.FormSubmitButton,
43
44
  InputMask: () => import_input_mask.InputMask,
44
45
  LargeTextBox: () => import_large_text_box.LargeTextBox,
45
46
  MASK_PIPES: () => import_input_mask.MASK_PIPES,
46
47
  MASK_TYPES: () => import_input_mask.MASK_TYPES,
47
- MediaBreakpoint: () => import_media_breakpoint.MediaBreakpoint,
48
48
  MicroApp: () => import_micro_app.MicroApp,
49
49
  MicroIFrameApp: () => import_micro_iframe_app.MicroIFrameApp,
50
50
  NavigationPromptActions: () => import_actions2.ACTIONS,
@@ -115,7 +115,7 @@ __export(lib_exports, {
115
115
  useAppSelector: () => import_react_redux.useAppSelector,
116
116
  useInjectReducer: () => import_redux_injectors.useInjectReducer,
117
117
  useInjectSaga: () => import_redux_injectors.useInjectSaga,
118
- useMediaBreakpoints: () => import_useMediaBreakpoints.useMediaBreakpoints,
118
+ useMediaQueryList: () => import_use_media_query_list.useMediaQueryList,
119
119
  waitMessageAction: () => import_actions3.waitMessage,
120
120
  withAppDecorator: () => import_decorator.withAppDecorator
121
121
  });
@@ -162,12 +162,12 @@ var import_render_with_router = require("./utils/testing/render-with-router.js")
162
162
  var import_render_with_state_addons = require("./utils/testing/render-with-state-addons.js");
163
163
  var import_helpers2 = require("./api/helpers.js");
164
164
  var import_users = require("./api/users/index.js");
165
- var import_useMediaBreakpoints = require("./view/useMediaBreakpoints/index.js");
166
165
  var import_decorator = require("./view/storybook/decorator.js");
167
166
  var import_error_toast = require("./view/error-toast/index.js");
168
167
  var import_form = require("./view/form/index.js");
169
168
  var import_connect_form = require("./view/fields/connect-form.js");
170
169
  var import_form_item_layout = require("./view/fields/form-item-layout/index.js");
170
+ var import_form_layout_block_item = require("./view/fields/form-layout-block-item/index.js");
171
171
  var import_text_box = require("./view/fields/text-box/index.js");
172
172
  var import_large_text_box = require("./view/fields/large-text-box/index.js");
173
173
  var import_input_mask = require("./view/fields/input-mask/index.js");
@@ -178,7 +178,7 @@ var import_radio_group = require("./view/fields/radio-group/index.js");
178
178
  var import_date_input = require("./view/fields/date-input/index.js");
179
179
  var import_date_picker = require("./view/fields/date-picker/index.js");
180
180
  var import_submit_button = require("./view/form/submit-button/index.js");
181
- var import_media_breakpoint = require("./view/media-breakpoint/index.js");
181
+ var import_use_media_query_list = require("./view/breakpoint/use-media-query-list.js");
182
182
  var import_visually_hidden = require("./view/visually-hidden/index.js");
183
183
  var import_live_message = require("./data/live-message/index.js");
184
184
  var import_error = require("./data/error/index.js");
@@ -140,7 +140,8 @@ const authorize = async ({
140
140
  (0, import_appdynamics.setAppDynamicsUserData)({ instanceId, userId: userName });
141
141
  const data = await (0, import_users.getUser)({ userName });
142
142
  sessionStorage.setItem("userSettings", JSON.stringify(data));
143
- import_history.browserHistory.push(new URL(redirectUri).pathname);
143
+ import_history.browserHistory.push(`${new URL(redirectUri).pathname}/rerender`);
144
+ import_history.browserHistory.replace(new URL(redirectUri).pathname);
144
145
  } catch (err) {
145
146
  const code = err?.response?.data?.code;
146
147
  await endSession({ clientId, redirectUri, code, scope, responseType });
@@ -31,14 +31,17 @@ __export(hosted_app_exports, {
31
31
  });
32
32
  var React = __toESM(require("react"));
33
33
  var import_styled_components = __toESM(require("styled-components"));
34
- var import_media_breakpoint = require("../media-breakpoint/index.js");
35
- var import_window_size = require("../window-size/index.js");
36
- var import_html_wait_message = require("../modals/wait-message/html-wait-message.js");
34
+ var import_use_breakpoint = require("../breakpoint/use-breakpoint.js");
35
+ var import_use_window_size_change = require("../use-window-size-change.js");
36
+ var import_use_html_wait_message = require("../modals/wait-message/use-html-wait-message.js");
37
37
  var import_style = __toESM(require("./style.js"));
38
38
  const Div = import_styled_components.default.div`
39
39
  height: 100%;
40
40
  `;
41
- const HostedApp = ({ children }) => /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(import_style.default, null), /* @__PURE__ */ React.createElement(import_media_breakpoint.MediaBreakpoint, null), /* @__PURE__ */ React.createElement(import_window_size.WindowSize, null), /* @__PURE__ */ React.createElement(import_html_wait_message.HTMLWaitMessage, {
42
- close: true
43
- }), children);
41
+ const HostedApp = ({ children }) => {
42
+ (0, import_use_breakpoint.useBreakpoint)();
43
+ (0, import_use_html_wait_message.useHTMLWaitMessage)(true);
44
+ (0, import_use_window_size_change.useWindowSizeChange)();
45
+ return /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(import_style.default, null), children);
46
+ };
44
47
  module.exports = __toCommonJS(hosted_app_exports);
@@ -32,8 +32,8 @@ __export(stand_alone_app_exports, {
32
32
  var React = __toESM(require("react"));
33
33
  var import_styled_components = __toESM(require("styled-components"));
34
34
  var import_react_aria_live = require("react-aria-live");
35
- var import_media_breakpoint = require("../media-breakpoint/index.js");
36
- var import_window_size = require("../window-size/index.js");
35
+ var import_use_breakpoint = require("../breakpoint/use-breakpoint.js");
36
+ var import_use_window_size_change = require("../use-window-size-change.js");
37
37
  var import_session_timeout = require("../session-timeout/index.js");
38
38
  var import_live_message = require("../live-message/index.js");
39
39
  var import_error_toast = require("../error-toast/index.js");
@@ -46,5 +46,9 @@ const StandAloneApp = ({
46
46
  manageSession,
47
47
  WaitMessage,
48
48
  children
49
- }) => /* @__PURE__ */ React.createElement(import_react_aria_live.LiveAnnouncer, null, /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(import_style.default, null), manageSession && /* @__PURE__ */ React.createElement(import_session_timeout.SessionTimeout, null), /* @__PURE__ */ React.createElement(import_media_breakpoint.MediaBreakpoint, null), /* @__PURE__ */ React.createElement(import_window_size.WindowSize, null), /* @__PURE__ */ React.createElement(import_live_message.LiveMessage, null), WaitMessage || /* @__PURE__ */ React.createElement(import_wait_message.WaitMessage, null), /* @__PURE__ */ React.createElement(import_error_toast.ErrorToast, null), children));
49
+ }) => {
50
+ (0, import_use_breakpoint.useBreakpoint)();
51
+ (0, import_use_window_size_change.useWindowSizeChange)();
52
+ return /* @__PURE__ */ React.createElement(import_react_aria_live.LiveAnnouncer, null, /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(import_style.default, null), manageSession && /* @__PURE__ */ React.createElement(import_session_timeout.SessionTimeout, null), /* @__PURE__ */ React.createElement(import_live_message.LiveMessage, null), WaitMessage || /* @__PURE__ */ React.createElement(import_wait_message.WaitMessage, null), /* @__PURE__ */ React.createElement(import_error_toast.ErrorToast, null), children));
53
+ };
50
54
  module.exports = __toCommonJS(stand_alone_app_exports);
@@ -20,20 +20,20 @@ var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
20
  return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
21
21
  };
22
22
  })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
23
- var media_breakpoint_exports = {};
24
- __export(media_breakpoint_exports, {
25
- MediaBreakpoint: () => MediaBreakpoint
23
+ var use_breakpoint_exports = {};
24
+ __export(use_breakpoint_exports, {
25
+ useBreakpoint: () => useBreakpoint
26
26
  });
27
27
  var import_react = require("react");
28
28
  var import_styled_components = require("styled-components");
29
29
  var import_pubsub_js = require("pubsub-js");
30
30
  var import_react_redux = require("../../data/react-redux.js");
31
31
  var import_breakpoint = require("../../data/breakpoint/index.js");
32
- var import_useMediaBreakpoints = require("../useMediaBreakpoints/index.js");
32
+ var import_use_media_query_list = require("./use-media-query-list.js");
33
33
  var import_constants = require("../../utils/constants.js");
34
- const MediaBreakpoint = () => {
34
+ const useBreakpoint = () => {
35
35
  const theme = (0, import_react.useContext)(import_styled_components.ThemeContext);
36
- const currentBreakpoint = (0, import_useMediaBreakpoints.useMediaBreakpoints)([
36
+ const currentBreakpoint = (0, import_use_media_query_list.useMediaQueryList)([
37
37
  `(max-width: ${theme.breakpoints.small})`,
38
38
  `(max-width: ${theme.breakpoints.medium})`,
39
39
  `(max-width: ${theme.breakpoints.large})`
@@ -43,6 +43,5 @@ const MediaBreakpoint = () => {
43
43
  dispatch({ type: import_breakpoint.breakpoint.change, payload: currentBreakpoint });
44
44
  (0, import_pubsub_js.publish)(import_constants.HOST_WINDOW_BREAKPOINT_CHANGED, currentBreakpoint);
45
45
  }, [currentBreakpoint, dispatch]);
46
- return null;
47
46
  };
48
- module.exports = __toCommonJS(media_breakpoint_exports);
47
+ module.exports = __toCommonJS(use_breakpoint_exports);
@@ -20,12 +20,12 @@ var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
20
  return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
21
21
  };
22
22
  })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
23
- var useMediaBreakpoints_exports = {};
24
- __export(useMediaBreakpoints_exports, {
25
- useMediaBreakpoints: () => useMediaBreakpoints
23
+ var use_media_query_list_exports = {};
24
+ __export(use_media_query_list_exports, {
25
+ useMediaQueryList: () => useMediaQueryList
26
26
  });
27
27
  var import_react = require("react");
28
- const useMediaBreakpoints = (queries, values, defaultValue) => {
28
+ const useMediaQueryList = (queries, values, defaultValue) => {
29
29
  const mediaQueryLists = queries.map((q) => window.matchMedia(q));
30
30
  const getValue = (0, import_react.useCallback)(() => {
31
31
  const index = mediaQueryLists.findIndex((mql) => mql.matches);
@@ -34,9 +34,9 @@ const useMediaBreakpoints = (queries, values, defaultValue) => {
34
34
  const [value, setValue] = (0, import_react.useState)(getValue);
35
35
  (0, import_react.useEffect)(() => {
36
36
  const handler = () => setValue(getValue);
37
- mediaQueryLists.forEach((mql) => mql.addListener(handler));
38
- return () => mediaQueryLists.forEach((mql) => mql.removeListener(handler));
37
+ mediaQueryLists.forEach((mql) => mql.addEventListener("change", handler));
38
+ return () => mediaQueryLists.forEach((mql) => mql.removeEventListener("change", handler));
39
39
  }, [getValue, mediaQueryLists]);
40
40
  return value;
41
41
  };
42
- module.exports = __toCommonJS(useMediaBreakpoints_exports);
42
+ module.exports = __toCommonJS(use_media_query_list_exports);
@@ -33,7 +33,7 @@ var React = __toESM(require("react"));
33
33
  var import_react = require("react");
34
34
  var import_ds_loading_indicator = require("@elliemae/ds-loading-indicator");
35
35
  var import_react_redux = require("../../../data/react-redux.js");
36
- var import_html_wait_message = require("./html-wait-message.js");
36
+ var import_use_html_wait_message = require("./use-html-wait-message.js");
37
37
  var import_user_wait_event = require("../../../analytics/user-wait-event.js");
38
38
  const WaitMessage = (0, import_react.memo)(({
39
39
  size = "m",
@@ -48,15 +48,14 @@ const WaitMessage = (0, import_react.memo)(({
48
48
  else
49
49
  (0, import_user_wait_event.waitEndEvent)();
50
50
  }, [isOpen]);
51
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(import_html_wait_message.HTMLWaitMessage, {
52
- close: isOpen !== null
53
- }), /* @__PURE__ */ React.createElement(import_ds_loading_indicator.DSLoadingIndicator, {
51
+ (0, import_use_html_wait_message.useHTMLWaitMessage)(isOpen !== null);
52
+ return /* @__PURE__ */ React.createElement(import_ds_loading_indicator.DSLoadingIndicator, {
54
53
  id: "em-loading",
55
54
  size,
56
55
  style,
57
56
  ...rest,
58
57
  loading: isOpen,
59
58
  message
60
- }));
59
+ });
61
60
  });
62
61
  module.exports = __toCommonJS(wait_message_exports);
@@ -20,17 +20,16 @@ var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
20
  return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
21
21
  };
22
22
  })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
23
- var html_wait_message_exports = {};
24
- __export(html_wait_message_exports, {
25
- HTMLWaitMessage: () => HTMLWaitMessage
23
+ var use_html_wait_message_exports = {};
24
+ __export(use_html_wait_message_exports, {
25
+ useHTMLWaitMessage: () => useHTMLWaitMessage
26
26
  });
27
27
  var import_react = require("react");
28
- const HTMLWaitMessage = (0, import_react.memo)(({ close }) => {
28
+ const useHTMLWaitMessage = (close) => {
29
29
  (0, import_react.useEffect)(() => {
30
30
  const htmlWaitMsgElement = document.getElementById("em-wait-message");
31
31
  if (htmlWaitMsgElement && close)
32
32
  htmlWaitMsgElement.remove();
33
33
  }, [close]);
34
- return null;
35
- });
36
- module.exports = __toCommonJS(html_wait_message_exports);
34
+ };
35
+ module.exports = __toCommonJS(use_html_wait_message_exports);
@@ -32,7 +32,6 @@ __export(require_auth_exports, {
32
32
  var React = __toESM(require("react"));
33
33
  var import_redux_injectors = require("redux-injectors");
34
34
  var import_constants = __toESM(require("../utils/constants.js"));
35
- var import_render_with_delay = require("./render-with-delay/index.js");
36
35
  var import_reducer = require("../data/auth/reducer.js");
37
36
  var import_auth = require("../sideeffect/auth/index.js");
38
37
  var import_login = require("./login/index.js");
@@ -50,13 +49,10 @@ const RequireAuth = ({
50
49
  if (userAuthorized) {
51
50
  return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
52
51
  }
53
- const renderLogin = () => /* @__PURE__ */ React.createElement(import_login.Login, {
52
+ return /* @__PURE__ */ React.createElement(import_login.Login, {
54
53
  clientId,
55
54
  scope,
56
55
  responseType
57
56
  });
58
- return /* @__PURE__ */ React.createElement(import_render_with_delay.RenderWithDelay, {
59
- render: renderLogin
60
- });
61
57
  };
62
58
  module.exports = __toCommonJS(require_auth_exports);
@@ -20,14 +20,14 @@ var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
20
  return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
21
21
  };
22
22
  })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
23
- var window_size_exports = {};
24
- __export(window_size_exports, {
25
- WindowSize: () => WindowSize
23
+ var use_window_size_change_exports = {};
24
+ __export(use_window_size_change_exports, {
25
+ useWindowSizeChange: () => useWindowSizeChange
26
26
  });
27
27
  var import_react = require("react");
28
28
  var import_pubsub_js = require("pubsub-js");
29
- var import_constants = require("../../utils/constants.js");
30
- const WindowSize = () => {
29
+ var import_constants = require("../utils/constants.js");
30
+ const useWindowSizeChange = () => {
31
31
  (0, import_react.useEffect)(() => {
32
32
  if (window.ResizeObserver) {
33
33
  const observer = new ResizeObserver((entries) => {
@@ -41,6 +41,5 @@ const WindowSize = () => {
41
41
  return () => {
42
42
  };
43
43
  }, []);
44
- return null;
45
44
  };
46
- module.exports = __toCommonJS(window_size_exports);
45
+ module.exports = __toCommonJS(use_window_size_change_exports);
package/dist/es/index.js CHANGED
@@ -62,12 +62,12 @@ import { renderWithRouter } from "./utils/testing/render-with-router.js";
62
62
  import { RenderWithStateAddOns } from "./utils/testing/render-with-state-addons.js";
63
63
  import { getApiActionCreator, getSelectField } from "./api/helpers.js";
64
64
  import { getUser } from "./api/users/index.js";
65
- import { useMediaBreakpoints } from "./view/useMediaBreakpoints/index.js";
66
65
  import { withAppDecorator } from "./view/storybook/decorator.js";
67
66
  import { ErrorToast } from "./view/error-toast/index.js";
68
67
  import { Form } from "./view/form/index.js";
69
68
  import { ConnectForm } from "./view/fields/connect-form.js";
70
69
  import { FormItemLayout } from "./view/fields/form-item-layout/index.js";
70
+ import { FormLayoutBlockItem } from "./view/fields/form-layout-block-item/index.js";
71
71
  import { TextBox } from "./view/fields/text-box/index.js";
72
72
  import { LargeTextBox } from "./view/fields/large-text-box/index.js";
73
73
  import {
@@ -82,7 +82,7 @@ import { RadioGroup } from "./view/fields/radio-group/index.js";
82
82
  import { DateInput } from "./view/fields/date-input/index.js";
83
83
  import { DatePicker } from "./view/fields/date-picker/index.js";
84
84
  import { FormSubmitButton } from "./view/form/submit-button/index.js";
85
- import { MediaBreakpoint } from "./view/media-breakpoint/index.js";
85
+ import { useMediaQueryList } from "./view/breakpoint/use-media-query-list.js";
86
86
  import { VisuallyHidden } from "./view/visually-hidden/index.js";
87
87
  import { actions } from "./data/live-message/index.js";
88
88
  import { actions as actions2 } from "./data/error/index.js";
@@ -109,12 +109,12 @@ export {
109
109
  ErrorToast,
110
110
  Form,
111
111
  FormItemLayout,
112
+ FormLayoutBlockItem,
112
113
  FormSubmitButton,
113
114
  InputMask,
114
115
  LargeTextBox,
115
116
  MASK_PIPES,
116
117
  MASK_TYPES,
117
- MediaBreakpoint,
118
118
  MicroApp,
119
119
  MicroIFrameApp,
120
120
  ACTIONS as NavigationPromptActions,
@@ -185,7 +185,7 @@ export {
185
185
  useAppSelector,
186
186
  useInjectReducer,
187
187
  useInjectSaga,
188
- useMediaBreakpoints,
188
+ useMediaQueryList,
189
189
  waitMessage as waitMessageAction,
190
190
  withAppDecorator
191
191
  };
@@ -113,7 +113,8 @@ const authorize = async ({
113
113
  setAppDynamicsUserData({ instanceId, userId: userName });
114
114
  const data = await getUser({ userName });
115
115
  sessionStorage.setItem("userSettings", JSON.stringify(data));
116
- history.push(new URL(redirectUri).pathname);
116
+ history.push(`${new URL(redirectUri).pathname}/rerender`);
117
+ history.replace(new URL(redirectUri).pathname);
117
118
  } catch (err) {
118
119
  const code = err?.response?.data?.code;
119
120
  await endSession({ clientId, redirectUri, code, scope, responseType });
@@ -1,15 +1,18 @@
1
1
  import * as React from "react";
2
2
  import styled from "styled-components";
3
- import { MediaBreakpoint } from "../media-breakpoint/index.js";
4
- import { WindowSize } from "../window-size/index.js";
5
- import { HTMLWaitMessage } from "../modals/wait-message/html-wait-message.js";
3
+ import { useBreakpoint } from "../breakpoint/use-breakpoint.js";
4
+ import { useWindowSizeChange } from "../use-window-size-change.js";
5
+ import { useHTMLWaitMessage } from "../modals/wait-message/use-html-wait-message.js";
6
6
  import GlobalStyle from "./style.js";
7
7
  const Div = styled.div`
8
8
  height: 100%;
9
9
  `;
10
- const HostedApp = ({ children }) => /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(GlobalStyle, null), /* @__PURE__ */ React.createElement(MediaBreakpoint, null), /* @__PURE__ */ React.createElement(WindowSize, null), /* @__PURE__ */ React.createElement(HTMLWaitMessage, {
11
- close: true
12
- }), children);
10
+ const HostedApp = ({ children }) => {
11
+ useBreakpoint();
12
+ useHTMLWaitMessage(true);
13
+ useWindowSizeChange();
14
+ return /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(GlobalStyle, null), children);
15
+ };
13
16
  export {
14
17
  HostedApp
15
18
  };
@@ -1,8 +1,8 @@
1
1
  import * as React from "react";
2
2
  import styled from "styled-components";
3
3
  import { LiveAnnouncer } from "react-aria-live";
4
- import { MediaBreakpoint } from "../media-breakpoint/index.js";
5
- import { WindowSize } from "../window-size/index.js";
4
+ import { useBreakpoint } from "../breakpoint/use-breakpoint.js";
5
+ import { useWindowSizeChange } from "../use-window-size-change.js";
6
6
  import { SessionTimeout } from "../session-timeout/index.js";
7
7
  import { LiveMessage } from "../live-message/index.js";
8
8
  import { ErrorToast } from "../error-toast/index.js";
@@ -15,7 +15,11 @@ const StandAloneApp = ({
15
15
  manageSession,
16
16
  WaitMessage,
17
17
  children
18
- }) => /* @__PURE__ */ React.createElement(LiveAnnouncer, null, /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(GlobalStyle, null), manageSession && /* @__PURE__ */ React.createElement(SessionTimeout, null), /* @__PURE__ */ React.createElement(MediaBreakpoint, null), /* @__PURE__ */ React.createElement(WindowSize, null), /* @__PURE__ */ React.createElement(LiveMessage, null), WaitMessage || /* @__PURE__ */ React.createElement(DefaultWaitMessage, null), /* @__PURE__ */ React.createElement(ErrorToast, null), children));
18
+ }) => {
19
+ useBreakpoint();
20
+ useWindowSizeChange();
21
+ return /* @__PURE__ */ React.createElement(LiveAnnouncer, null, /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(GlobalStyle, null), manageSession && /* @__PURE__ */ React.createElement(SessionTimeout, null), /* @__PURE__ */ React.createElement(LiveMessage, null), WaitMessage || /* @__PURE__ */ React.createElement(DefaultWaitMessage, null), /* @__PURE__ */ React.createElement(ErrorToast, null), children));
22
+ };
19
23
  export {
20
24
  StandAloneApp
21
25
  };
@@ -3,11 +3,11 @@ import { ThemeContext } from "styled-components";
3
3
  import { publish } from "pubsub-js";
4
4
  import { useAppDispatch } from "../../data/react-redux.js";
5
5
  import { breakpoint } from "../../data/breakpoint/index.js";
6
- import { useMediaBreakpoints } from "../useMediaBreakpoints/index.js";
6
+ import { useMediaQueryList } from "./use-media-query-list.js";
7
7
  import { HOST_WINDOW_BREAKPOINT_CHANGED } from "../../utils/constants.js";
8
- const MediaBreakpoint = () => {
8
+ const useBreakpoint = () => {
9
9
  const theme = useContext(ThemeContext);
10
- const currentBreakpoint = useMediaBreakpoints([
10
+ const currentBreakpoint = useMediaQueryList([
11
11
  `(max-width: ${theme.breakpoints.small})`,
12
12
  `(max-width: ${theme.breakpoints.medium})`,
13
13
  `(max-width: ${theme.breakpoints.large})`
@@ -17,8 +17,7 @@ const MediaBreakpoint = () => {
17
17
  dispatch({ type: breakpoint.change, payload: currentBreakpoint });
18
18
  publish(HOST_WINDOW_BREAKPOINT_CHANGED, currentBreakpoint);
19
19
  }, [currentBreakpoint, dispatch]);
20
- return null;
21
20
  };
22
21
  export {
23
- MediaBreakpoint
22
+ useBreakpoint
24
23
  };
@@ -1,5 +1,5 @@
1
1
  import { useState, useEffect, useCallback } from "react";
2
- const useMediaBreakpoints = (queries, values, defaultValue) => {
2
+ const useMediaQueryList = (queries, values, defaultValue) => {
3
3
  const mediaQueryLists = queries.map((q) => window.matchMedia(q));
4
4
  const getValue = useCallback(() => {
5
5
  const index = mediaQueryLists.findIndex((mql) => mql.matches);
@@ -8,11 +8,11 @@ const useMediaBreakpoints = (queries, values, defaultValue) => {
8
8
  const [value, setValue] = useState(getValue);
9
9
  useEffect(() => {
10
10
  const handler = () => setValue(getValue);
11
- mediaQueryLists.forEach((mql) => mql.addListener(handler));
12
- return () => mediaQueryLists.forEach((mql) => mql.removeListener(handler));
11
+ mediaQueryLists.forEach((mql) => mql.addEventListener("change", handler));
12
+ return () => mediaQueryLists.forEach((mql) => mql.removeEventListener("change", handler));
13
13
  }, [getValue, mediaQueryLists]);
14
14
  return value;
15
15
  };
16
16
  export {
17
- useMediaBreakpoints
17
+ useMediaQueryList
18
18
  };
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import { memo, useEffect } from "react";
3
3
  import { DSLoadingIndicator } from "@elliemae/ds-loading-indicator";
4
4
  import { useAppSelector } from "../../../data/react-redux.js";
5
- import { HTMLWaitMessage } from "./html-wait-message.js";
5
+ import { useHTMLWaitMessage } from "./use-html-wait-message.js";
6
6
  import {
7
7
  waitStartEvent,
8
8
  waitEndEvent
@@ -20,16 +20,15 @@ const WaitMessage = memo(({
20
20
  else
21
21
  waitEndEvent();
22
22
  }, [isOpen]);
23
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(HTMLWaitMessage, {
24
- close: isOpen !== null
25
- }), /* @__PURE__ */ React.createElement(DSLoadingIndicator, {
23
+ useHTMLWaitMessage(isOpen !== null);
24
+ return /* @__PURE__ */ React.createElement(DSLoadingIndicator, {
26
25
  id: "em-loading",
27
26
  size,
28
27
  style,
29
28
  ...rest,
30
29
  loading: isOpen,
31
30
  message
32
- }));
31
+ });
33
32
  });
34
33
  export {
35
34
  WaitMessage
@@ -1,12 +1,11 @@
1
- import { memo, useEffect } from "react";
2
- const HTMLWaitMessage = memo(({ close }) => {
1
+ import { useEffect } from "react";
2
+ const useHTMLWaitMessage = (close) => {
3
3
  useEffect(() => {
4
4
  const htmlWaitMsgElement = document.getElementById("em-wait-message");
5
5
  if (htmlWaitMsgElement && close)
6
6
  htmlWaitMsgElement.remove();
7
7
  }, [close]);
8
- return null;
9
- });
8
+ };
10
9
  export {
11
- HTMLWaitMessage
10
+ useHTMLWaitMessage
12
11
  };
@@ -1,7 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { useInjectReducer, useInjectSaga } from "redux-injectors";
3
3
  import enums from "../utils/constants.js";
4
- import { RenderWithDelay } from "./render-with-delay/index.js";
5
4
  import { authReducer } from "../data/auth/reducer.js";
6
5
  import { authentication } from "../sideeffect/auth/index.js";
7
6
  import { Login } from "./login/index.js";
@@ -19,14 +18,11 @@ const RequireAuth = ({
19
18
  if (userAuthorized) {
20
19
  return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
21
20
  }
22
- const renderLogin = () => /* @__PURE__ */ React.createElement(Login, {
21
+ return /* @__PURE__ */ React.createElement(Login, {
23
22
  clientId,
24
23
  scope,
25
24
  responseType
26
25
  });
27
- return /* @__PURE__ */ React.createElement(RenderWithDelay, {
28
- render: renderLogin
29
- });
30
26
  };
31
27
  export {
32
28
  RequireAuth
@@ -1,7 +1,7 @@
1
1
  import { useEffect } from "react";
2
2
  import { publish } from "pubsub-js";
3
- import { HOST_WINDOW_RESIZED } from "../../utils/constants.js";
4
- const WindowSize = () => {
3
+ import { HOST_WINDOW_RESIZED } from "../utils/constants.js";
4
+ const useWindowSizeChange = () => {
5
5
  useEffect(() => {
6
6
  if (window.ResizeObserver) {
7
7
  const observer = new ResizeObserver((entries) => {
@@ -15,8 +15,7 @@ const WindowSize = () => {
15
15
  return () => {
16
16
  };
17
17
  }, []);
18
- return null;
19
18
  };
20
19
  export {
21
- WindowSize
20
+ useWindowSizeChange
22
21
  };
@@ -41,12 +41,12 @@ export { renderWithRouter } from './utils/testing/render-with-router.js';
41
41
  export { RenderWithStateAddOns } from './utils/testing/render-with-state-addons.js';
42
42
  export { getApiActionCreator, getSelectField } from './api/helpers.js';
43
43
  export { getUser as fetchUserSettings } from './api/users/index.js';
44
- export { useMediaBreakpoints } from './view/useMediaBreakpoints/index.js';
45
44
  export { withAppDecorator } from './view/storybook/decorator.js';
46
45
  export { ErrorToast } from './view/error-toast/index.js';
47
46
  export { Form } from './view/form/index.js';
48
47
  export { ConnectForm } from './view/fields/connect-form.js';
49
48
  export { FormItemLayout } from './view/fields/form-item-layout/index.js';
49
+ export { FormLayoutBlockItem } from './view/fields/form-layout-block-item/index.js';
50
50
  export { TextBox } from './view/fields/text-box/index.js';
51
51
  export { LargeTextBox } from './view/fields/large-text-box/index.js';
52
52
  export { InputMask, MASK_TYPES, MASK_PIPES, } from './view/fields/input-mask/index.js';
@@ -57,7 +57,7 @@ export { RadioGroup } from './view/fields/radio-group/index.js';
57
57
  export { DateInput } from './view/fields/date-input/index.js';
58
58
  export { DatePicker } from './view/fields/date-picker/index.js';
59
59
  export { FormSubmitButton } from './view/form/submit-button/index.js';
60
- export { MediaBreakpoint } from './view/media-breakpoint/index.js';
60
+ export { useMediaQueryList } from './view/breakpoint/use-media-query-list.js';
61
61
  export { VisuallyHidden } from './view/visually-hidden/index.js';
62
62
  export { actions as ariaLive } from './data/live-message/index.js';
63
63
  export { actions as error } from './data/error/index.js';
@@ -0,0 +1 @@
1
+ export declare const useBreakpoint: () => void;
@@ -0,0 +1 @@
1
+ export declare const useMediaQueryList: (queries: Array<string>, values: Array<string>, defaultValue: string) => string;
@@ -0,0 +1 @@
1
+ export declare const useHTMLWaitMessage: (close: boolean) => void;
@@ -0,0 +1 @@
1
+ export declare const useWindowSizeChange: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-app-sdk",
3
- "version": "3.0.0-beta.20",
3
+ "version": "3.0.0-beta.24",
4
4
  "description": "ICE MT UI Platform Application SDK ",
5
5
  "sideEffects": [
6
6
  "*.css",
@@ -62,7 +62,7 @@
62
62
  "url": "http://git.elliemae.io/platform-ui/pui-app-sdk.git"
63
63
  },
64
64
  "engines": {
65
- "npm": ">=8",
65
+ "pnpm": ">=6",
66
66
  "node": ">=16"
67
67
  },
68
68
  "author": "ICE MT",
@@ -94,7 +94,8 @@
94
94
  "test:watch": "pui-cli test -w",
95
95
  "test:staged": "jest --coverage --passWithNoTests --bail --findRelatedTests",
96
96
  "upgrade": "ncu -u && npm run setup",
97
- "prepare": "husky install"
97
+ "preinstall": "npx only-allow pnpm",
98
+ "prepare": "[ -n \"$CI\" ] || husky install"
98
99
  },
99
100
  "jestSonar": {
100
101
  "sonar56x": true,
@@ -103,20 +104,20 @@
103
104
  "indent": 4
104
105
  },
105
106
  "peerDependencies": {
106
- "@elliemae/app-react-dependencies": "^3.0.0-beta.3",
107
- "@elliemae/ds-basic": "^2.3.0-alpha.2",
108
- "@elliemae/ds-button": "^2.3.0-alpha.2",
109
- "@elliemae/ds-controlled-form": "^2.3.0-alpha.2",
110
- "@elliemae/ds-date-picker": "^2.3.0-alpha.2",
111
- "@elliemae/ds-date-range-picker": "^2.3.0-alpha.2",
112
- "@elliemae/ds-dialog": "^2.3.0-alpha.2",
113
- "@elliemae/ds-form": "^2.3.0-alpha.2",
114
- "@elliemae/ds-form-layout-blocks": "^2.3.0-alpha.2",
115
- "@elliemae/ds-grid": "^2.3.0-alpha.2",
116
- "@elliemae/ds-loading-indicator": "^2.3.0-alpha.2",
117
- "@elliemae/ds-modal": "^2.3.0-alpha.2",
118
- "@elliemae/ds-popperjs": "^2.3.0-alpha.2",
119
- "@elliemae/ds-toast": "^2.3.0-alpha.2",
107
+ "@elliemae/app-react-dependencies": "^3.0.0-beta.4",
108
+ "@elliemae/ds-basic": "^3.0.0-alpha.0",
109
+ "@elliemae/ds-button": "^3.0.0-alpha.0",
110
+ "@elliemae/ds-controlled-form": "^3.0.0-alpha.0",
111
+ "@elliemae/ds-date-picker": "^3.0.0-alpha.0",
112
+ "@elliemae/ds-date-range-picker": "^3.0.0-alpha.0",
113
+ "@elliemae/ds-dialog": "^3.0.0-alpha.0",
114
+ "@elliemae/ds-form": "^3.0.0-alpha.0",
115
+ "@elliemae/ds-form-layout-blocks": "^3.0.0-alpha.0",
116
+ "@elliemae/ds-grid": "^3.0.0-alpha.0",
117
+ "@elliemae/ds-loading-indicator": "^3.0.0-alpha.0",
118
+ "@elliemae/ds-modal": "^3.0.0-alpha.0",
119
+ "@elliemae/ds-popperjs": "^3.0.0-alpha.0",
120
+ "@elliemae/ds-toast": "^3.0.0-alpha.0",
120
121
  "@elliemae/em-ssf-guest": "^1.11.1",
121
122
  "@elliemae/pui-diagnostics": "^2.7.3",
122
123
  "@elliemae/pui-micro-frontend-base": "^1.10.1",
@@ -124,25 +125,25 @@
124
125
  "@elliemae/pui-user-monitoring": "^1.12.2"
125
126
  },
126
127
  "devDependencies": {
127
- "@elliemae/app-react-dependencies": "~3.0.0-beta.3",
128
+ "@elliemae/app-react-dependencies": "~3.0.0-beta.4",
128
129
  "@elliemae/browserslist-config-elliemae-latest-browsers": "~1.2.1",
129
- "@elliemae/ds-basic": "~2.3.0-alpha.2",
130
- "@elliemae/ds-button": "~2.3.0-alpha.2",
131
- "@elliemae/ds-controlled-form": "~2.3.0-alpha.2",
132
- "@elliemae/ds-date-picker": "~2.3.0-alpha.2",
133
- "@elliemae/ds-date-range-picker": "~2.3.0-alpha.2",
134
- "@elliemae/ds-dialog": "~2.3.0-alpha.2",
135
- "@elliemae/ds-form": "~2.3.0-alpha.2",
136
- "@elliemae/ds-form-layout-blocks": "~2.3.0-alpha.2",
137
- "@elliemae/ds-grid": "~2.3.0-alpha.2",
138
- "@elliemae/ds-loading-indicator": "~2.3.0-alpha.2",
139
- "@elliemae/ds-modal": "~2.3.0-alpha.2",
140
- "@elliemae/ds-popperjs": "~2.3.0-alpha.2",
141
- "@elliemae/ds-toast": "~2.3.0-alpha.2",
130
+ "@elliemae/ds-basic": "3.0.0-alpha.0",
131
+ "@elliemae/ds-button": "3.0.0-alpha.0",
132
+ "@elliemae/ds-controlled-form": "3.0.0-alpha.0",
133
+ "@elliemae/ds-date-picker": "3.0.0-alpha.0",
134
+ "@elliemae/ds-date-range-picker": "3.0.0-alpha.0",
135
+ "@elliemae/ds-dialog": "3.0.0-alpha.0",
136
+ "@elliemae/ds-form": "3.0.0-alpha.0",
137
+ "@elliemae/ds-form-layout-blocks": "3.0.0-alpha.0",
138
+ "@elliemae/ds-grid": "3.0.0-alpha.0",
139
+ "@elliemae/ds-loading-indicator": "3.0.0-alpha.0",
140
+ "@elliemae/ds-modal": "3.0.0-alpha.0",
141
+ "@elliemae/ds-popperjs": "3.0.0-alpha.0",
142
+ "@elliemae/ds-toast": "3.0.0-alpha.0",
142
143
  "@elliemae/em-ssf-guest": "~1.11.1",
143
- "@elliemae/pui-cli": "~6.0.0-beta.37",
144
+ "@elliemae/pui-cli": "~6.0.0-beta.41",
144
145
  "@elliemae/pui-diagnostics": "~2.7.3",
145
- "@elliemae/pui-e2e-test-sdk": "~6.9.0",
146
+ "@elliemae/pui-e2e-test-sdk": "~6.10.0",
146
147
  "@elliemae/pui-micro-frontend-base": "~1.10.1",
147
148
  "@elliemae/pui-theme": "~2.3.0",
148
149
  "@elliemae/pui-user-monitoring": "~1.12.2"
@@ -1 +0,0 @@
1
- export declare const MediaBreakpoint: () => null;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- declare type HTMLWaitMessageProps = {
3
- close: boolean;
4
- };
5
- export declare const HTMLWaitMessage: import("react").NamedExoticComponent<HTMLWaitMessageProps>;
6
- export {};
@@ -1 +0,0 @@
1
- export declare const useMediaBreakpoints: (queries: Array<string>, values: Array<string>, defaultValue: string) => string;
@@ -1 +0,0 @@
1
- export declare const WindowSize: () => null;