@elliemae/pui-app-sdk 3.0.0-beta.2 → 3.0.0-beta.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.
- package/dist/cjs/analytics/page-view-event.js +11 -2
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/view/micro-app/use-app-will-render.js +4 -2
- package/dist/cjs/view/window-size/index.js +9 -5
- package/dist/es/analytics/page-view-event.js +11 -2
- package/dist/es/index.js +2 -0
- package/dist/es/view/micro-app/use-app-will-render.js +4 -2
- package/dist/es/view/window-size/index.js +9 -5
- package/dist/types/index.d.ts +1 -0
- package/dist/types/view/micro-app/types.d.ts +1 -0
- package/dist/types/view/micro-app/use-app-will-render.d.ts +1 -1
- package/package.json +1 -1
|
@@ -25,9 +25,18 @@ __export(exports, {
|
|
|
25
25
|
pageViewEvent: () => pageViewEvent
|
|
26
26
|
});
|
|
27
27
|
var import__ = __toModule(require("."));
|
|
28
|
+
const getWindow = () => {
|
|
29
|
+
try {
|
|
30
|
+
window.top?.document;
|
|
31
|
+
return window.top || window.self;
|
|
32
|
+
} catch (e) {
|
|
33
|
+
return window.self;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
28
36
|
const pageViewEvent = ({ pageTitle }) => {
|
|
29
|
-
const
|
|
30
|
-
const {
|
|
37
|
+
const pageWindow = getWindow();
|
|
38
|
+
const { pathname, href } = pageWindow.location;
|
|
39
|
+
const { title } = pageWindow.document;
|
|
31
40
|
const { pathname: guestPagePath, href: guestPageUrl } = window.location;
|
|
32
41
|
const { title: guestPageTitle } = document;
|
|
33
42
|
(0, import__.sendBAEvent)({
|
package/dist/cjs/index.js
CHANGED
|
@@ -62,6 +62,7 @@ __export(exports, {
|
|
|
62
62
|
enableReactAppForHostIntegration: () => import_react.enableReactAppForHostIntegration,
|
|
63
63
|
error: () => import_error.actions,
|
|
64
64
|
fetchHostAppData: () => import_fetch_host_app_data.fetchHostAppData,
|
|
65
|
+
fetchUserSettings: () => import_users.getUser,
|
|
65
66
|
getApiActionCreator: () => import_helpers2.getApiActionCreator,
|
|
66
67
|
getAppConfigValue: () => import_config.getAppConfigValue,
|
|
67
68
|
getAuthHTTPClient: () => import_http_client.getAuthHTTPClient,
|
|
@@ -156,6 +157,7 @@ var import_render_with_redux = __toModule(require("./utils/testing/render-with-r
|
|
|
156
157
|
var import_render_with_router = __toModule(require("./utils/testing/render-with-router"));
|
|
157
158
|
var import_render_with_state_addons = __toModule(require("./utils/testing/render-with-state-addons"));
|
|
158
159
|
var import_helpers2 = __toModule(require("./api/helpers"));
|
|
160
|
+
var import_users = __toModule(require("./api/users"));
|
|
159
161
|
var import_useMediaBreakpoints = __toModule(require("./view/useMediaBreakpoints"));
|
|
160
162
|
var import_decorator = __toModule(require("./view/storybook/decorator"));
|
|
161
163
|
var import_header = __toModule(require("./view/header"));
|
|
@@ -36,6 +36,7 @@ const useAppWillRender = ({
|
|
|
36
36
|
documentEle,
|
|
37
37
|
history,
|
|
38
38
|
theme,
|
|
39
|
+
homeRoute,
|
|
39
40
|
onUnloadComplete
|
|
40
41
|
}) => {
|
|
41
42
|
const dispatch = import_react_redux.useDispatch ? (0, import_react_redux.useDispatch)() : null;
|
|
@@ -75,11 +76,12 @@ const useAppWillRender = ({
|
|
|
75
76
|
const appConfig = (0, import_lodash.merge)(getConfig(), {
|
|
76
77
|
documentEle,
|
|
77
78
|
history,
|
|
78
|
-
theme
|
|
79
|
+
theme,
|
|
80
|
+
homeRoute
|
|
79
81
|
});
|
|
80
82
|
load(appConfig);
|
|
81
83
|
return () => {
|
|
82
84
|
ref.current = unload(appConfig);
|
|
83
85
|
};
|
|
84
|
-
}, [documentEle, getConfig, history, theme, load, unload]);
|
|
86
|
+
}, [documentEle, getConfig, history, theme, homeRoute, load, unload]);
|
|
85
87
|
};
|
|
@@ -29,12 +29,16 @@ var import_pubsub_js = __toModule(require("pubsub-js"));
|
|
|
29
29
|
var import_constants = __toModule(require("../../utils/constants"));
|
|
30
30
|
const WindowSize = () => {
|
|
31
31
|
(0, import_react.useEffect)(() => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
if (window.ResizeObserver) {
|
|
33
|
+
const observer = new ResizeObserver((entries) => {
|
|
34
|
+
(0, import_pubsub_js.publish)(import_constants.HOST_WINDOW_RESIZED, entries && entries[0]);
|
|
35
|
+
});
|
|
36
|
+
observer.observe(window.document.documentElement);
|
|
37
|
+
return () => {
|
|
38
|
+
observer.unobserve(window.document.documentElement);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
36
41
|
return () => {
|
|
37
|
-
observer.unobserve(window.document.documentElement);
|
|
38
42
|
};
|
|
39
43
|
}, []);
|
|
40
44
|
return /* @__PURE__ */ React.createElement(React.Fragment, null);
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { sendBAEvent } from ".";
|
|
2
|
+
const getWindow = () => {
|
|
3
|
+
try {
|
|
4
|
+
window.top?.document;
|
|
5
|
+
return window.top || window.self;
|
|
6
|
+
} catch (e) {
|
|
7
|
+
return window.self;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
2
10
|
const pageViewEvent = ({ pageTitle }) => {
|
|
3
|
-
const
|
|
4
|
-
const {
|
|
11
|
+
const pageWindow = getWindow();
|
|
12
|
+
const { pathname, href } = pageWindow.location;
|
|
13
|
+
const { title } = pageWindow.document;
|
|
5
14
|
const { pathname: guestPagePath, href: guestPageUrl } = window.location;
|
|
6
15
|
const { title: guestPageTitle } = document;
|
|
7
16
|
sendBAEvent({
|
package/dist/es/index.js
CHANGED
|
@@ -55,6 +55,7 @@ import { renderWithRedux } from "./utils/testing/render-with-redux";
|
|
|
55
55
|
import { renderWithRouter } from "./utils/testing/render-with-router";
|
|
56
56
|
import { RenderWithStateAddOns } from "./utils/testing/render-with-state-addons";
|
|
57
57
|
import { getApiActionCreator, getSelectField } from "./api/helpers";
|
|
58
|
+
import { getUser } from "./api/users";
|
|
58
59
|
import { useMediaBreakpoints } from "./view/useMediaBreakpoints";
|
|
59
60
|
import { withAppDecorator } from "./view/storybook/decorator";
|
|
60
61
|
import { Header } from "./view/header";
|
|
@@ -127,6 +128,7 @@ export {
|
|
|
127
128
|
enableReactAppForHostIntegration,
|
|
128
129
|
actions2 as error,
|
|
129
130
|
fetchHostAppData,
|
|
131
|
+
getUser as fetchUserSettings,
|
|
130
132
|
getApiActionCreator,
|
|
131
133
|
getAppConfigValue,
|
|
132
134
|
getAuthHTTPClient,
|
|
@@ -13,6 +13,7 @@ const useAppWillRender = ({
|
|
|
13
13
|
documentEle,
|
|
14
14
|
history,
|
|
15
15
|
theme,
|
|
16
|
+
homeRoute,
|
|
16
17
|
onUnloadComplete
|
|
17
18
|
}) => {
|
|
18
19
|
const dispatch = useDispatch ? useDispatch() : null;
|
|
@@ -52,13 +53,14 @@ const useAppWillRender = ({
|
|
|
52
53
|
const appConfig = merge(getConfig(), {
|
|
53
54
|
documentEle,
|
|
54
55
|
history,
|
|
55
|
-
theme
|
|
56
|
+
theme,
|
|
57
|
+
homeRoute
|
|
56
58
|
});
|
|
57
59
|
load(appConfig);
|
|
58
60
|
return () => {
|
|
59
61
|
ref.current = unload(appConfig);
|
|
60
62
|
};
|
|
61
|
-
}, [documentEle, getConfig, history, theme, load, unload]);
|
|
63
|
+
}, [documentEle, getConfig, history, theme, homeRoute, load, unload]);
|
|
62
64
|
};
|
|
63
65
|
export {
|
|
64
66
|
useAppWillRender
|
|
@@ -3,12 +3,16 @@ import { publish } from "pubsub-js";
|
|
|
3
3
|
import { HOST_WINDOW_RESIZED } from "../../utils/constants";
|
|
4
4
|
const WindowSize = () => {
|
|
5
5
|
useEffect(() => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
if (window.ResizeObserver) {
|
|
7
|
+
const observer = new ResizeObserver((entries) => {
|
|
8
|
+
publish(HOST_WINDOW_RESIZED, entries && entries[0]);
|
|
9
|
+
});
|
|
10
|
+
observer.observe(window.document.documentElement);
|
|
11
|
+
return () => {
|
|
12
|
+
observer.unobserve(window.document.documentElement);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
10
15
|
return () => {
|
|
11
|
-
observer.unobserve(window.document.documentElement);
|
|
12
16
|
};
|
|
13
17
|
}, []);
|
|
14
18
|
return /* @__PURE__ */ React.createElement(React.Fragment, null);
|
package/dist/types/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export { renderWithRedux } from './utils/testing/render-with-redux';
|
|
|
40
40
|
export { renderWithRouter } from './utils/testing/render-with-router';
|
|
41
41
|
export { RenderWithStateAddOns } from './utils/testing/render-with-state-addons';
|
|
42
42
|
export { getApiActionCreator, getSelectField } from './api/helpers';
|
|
43
|
+
export { getUser as fetchUserSettings } from './api/users';
|
|
43
44
|
export { useMediaBreakpoints } from './view/useMediaBreakpoints';
|
|
44
45
|
export { withAppDecorator } from './view/storybook/decorator';
|
|
45
46
|
export { Header } from './view/header';
|
|
@@ -3,5 +3,5 @@ export declare type OnUnloadCompleteFn = () => void;
|
|
|
3
3
|
declare type UseAppWillRenderArgs = MicroAppProps & {
|
|
4
4
|
onUnloadComplete?: OnUnloadCompleteFn;
|
|
5
5
|
};
|
|
6
|
-
export declare const useAppWillRender: ({ id, documentEle, history, theme, onUnloadComplete, }: UseAppWillRenderArgs) => void;
|
|
6
|
+
export declare const useAppWillRender: ({ id, documentEle, history, theme, homeRoute, onUnloadComplete, }: UseAppWillRenderArgs) => void;
|
|
7
7
|
export {};
|