@elliemae/pui-app-sdk 4.2.1 → 4.2.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/view/micro-app/resources/script.js +4 -9
- package/dist/cjs/view/micro-app/resources/style.js +4 -9
- package/dist/cjs/view/micro-iframe-app/app.js +1 -1
- package/dist/cjs/view/micro-iframe-app/{iframe/index.html → iframe.html} +0 -0
- package/dist/cjs/view/micro-iframe-app/index.js +5 -5
- package/dist/esm/view/micro-app/resources/script.js +4 -9
- package/dist/esm/view/micro-app/resources/style.js +4 -9
- package/dist/esm/view/micro-iframe-app/app.js +1 -1
- package/dist/esm/view/micro-iframe-app/{iframe/index.html → iframe.html} +0 -0
- package/dist/types/lib/view/micro-app/resources/script.d.ts +1 -1
- package/dist/types/lib/view/micro-app/resources/style.d.ts +1 -1
- package/package.json +2 -2
|
@@ -29,20 +29,15 @@ var import_url = require("../../../utils/url.js");
|
|
|
29
29
|
const APP_SCRIPT_ID_PREFIX = "emui-script-";
|
|
30
30
|
const HEAD_SCRIPTS = /(?:emuiDiagnostics|global|global-prod|emuiUserMonitoring)(?:..*)?.js/;
|
|
31
31
|
const isHeadScript = (scriptSrc) => HEAD_SCRIPTS.test(scriptSrc);
|
|
32
|
-
const addScriptToDOM = ({ name, hostUrl, documentEle
|
|
33
|
-
if (!hostUrl
|
|
34
|
-
throw new Error(
|
|
35
|
-
"Unable to add scripts to DOM. hostUrl and manifestPath are required."
|
|
36
|
-
);
|
|
32
|
+
const addScriptToDOM = ({ name, hostUrl, documentEle }, fileName, index) => {
|
|
33
|
+
if (!hostUrl)
|
|
34
|
+
throw new Error("Unable to add scripts to DOM. hostUrl is required.");
|
|
37
35
|
return new Promise((resolve, reject) => {
|
|
38
36
|
const ele = documentEle.createElement("script");
|
|
39
37
|
if (!ele)
|
|
40
38
|
reject(new Error("Unable to insert Application scripts."));
|
|
41
39
|
ele.id = `${APP_SCRIPT_ID_PREFIX}${name}-${index}`;
|
|
42
|
-
const url = new URL(
|
|
43
|
-
`${manifestPath.replace(/\/?$/, "/")}${fileName}`,
|
|
44
|
-
hostUrl
|
|
45
|
-
);
|
|
40
|
+
const url = new URL(fileName, hostUrl);
|
|
46
41
|
ele.src = (0, import_url.removeDoubleSlash)(url.href);
|
|
47
42
|
ele.onload = resolve.bind(null, ele.id);
|
|
48
43
|
ele.onerror = reject.bind(null, ele.id);
|
|
@@ -26,21 +26,16 @@ __export(style_exports, {
|
|
|
26
26
|
module.exports = __toCommonJS(style_exports);
|
|
27
27
|
var import_url = require("../../../utils/url.js");
|
|
28
28
|
const APP_STYLE_ID_PREFIX = "emui-style-";
|
|
29
|
-
const addStylesToDOM = ({ name, hostUrl, documentEle
|
|
30
|
-
if (!hostUrl
|
|
31
|
-
throw new Error(
|
|
32
|
-
"Unable to add styles to DOM. hostUrl and manifestPath are required."
|
|
33
|
-
);
|
|
29
|
+
const addStylesToDOM = ({ name, hostUrl, documentEle }, fileName, index) => {
|
|
30
|
+
if (!hostUrl)
|
|
31
|
+
throw new Error("Unable to add styles to DOM. hostUrl is required.");
|
|
34
32
|
return new Promise((resolve, reject) => {
|
|
35
33
|
const ele = documentEle.createElement("link");
|
|
36
34
|
if (!ele)
|
|
37
35
|
reject(new Error("Unable to insert Application styles."));
|
|
38
36
|
ele.id = `${APP_STYLE_ID_PREFIX}${name}-${index}`;
|
|
39
37
|
ele.rel = "stylesheet";
|
|
40
|
-
const url = new URL(
|
|
41
|
-
`${manifestPath.replace(/\/?$/, "/")}${fileName}`,
|
|
42
|
-
hostUrl
|
|
43
|
-
);
|
|
38
|
+
const url = new URL(fileName, hostUrl);
|
|
44
39
|
ele.href = (0, import_url.removeDoubleSlash)(url.href);
|
|
45
40
|
ele.onload = resolve.bind(null, ele.id);
|
|
46
41
|
documentEle.head.appendChild(ele);
|
|
@@ -29,7 +29,7 @@ __export(app_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(app_exports);
|
|
30
30
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
31
|
var import_react = require("react");
|
|
32
|
-
var import_iframe = __toESM(require("./iframe
|
|
32
|
+
var import_iframe = __toESM(require("./iframe.html?resource"));
|
|
33
33
|
var import_iframe2 = require("./iframe/index.js");
|
|
34
34
|
var import_use_frame_loaded = require("./use-frame-loaded.js");
|
|
35
35
|
var import_use_app_will_render = require("../micro-app/use-app-will-render.js");
|
|
File without changes
|
|
@@ -22,14 +22,14 @@ __export(micro_iframe_app_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(micro_iframe_app_exports);
|
|
24
24
|
var import_react = require("react");
|
|
25
|
-
var
|
|
25
|
+
var import_react2 = require("react");
|
|
26
26
|
var import_use_previous = require("../use-previous.js");
|
|
27
27
|
var import_app = require("./app.js");
|
|
28
|
-
const MicroIFrameApp = (0,
|
|
29
|
-
const [disposePrevApp, setDisposePrevApp] = (0,
|
|
30
|
-
const [appKey, setAppKey] = (0,
|
|
28
|
+
const MicroIFrameApp = (0, import_react2.memo)(({ entityId = null, ...rest }) => {
|
|
29
|
+
const [disposePrevApp, setDisposePrevApp] = (0, import_react2.useState)(false);
|
|
30
|
+
const [appKey, setAppKey] = (0, import_react2.useState)(Date.now());
|
|
31
31
|
const prevEntityId = (0, import_use_previous.usePrevious)(entityId);
|
|
32
|
-
(0,
|
|
32
|
+
(0, import_react2.useEffect)(() => {
|
|
33
33
|
if (prevEntityId !== entityId && prevEntityId) {
|
|
34
34
|
setDisposePrevApp(true);
|
|
35
35
|
}
|
|
@@ -2,20 +2,15 @@ import { removeDoubleSlash } from "../../../utils/url.js";
|
|
|
2
2
|
const APP_SCRIPT_ID_PREFIX = "emui-script-";
|
|
3
3
|
const HEAD_SCRIPTS = /(?:emuiDiagnostics|global|global-prod|emuiUserMonitoring)(?:..*)?.js/;
|
|
4
4
|
const isHeadScript = (scriptSrc) => HEAD_SCRIPTS.test(scriptSrc);
|
|
5
|
-
const addScriptToDOM = ({ name, hostUrl, documentEle
|
|
6
|
-
if (!hostUrl
|
|
7
|
-
throw new Error(
|
|
8
|
-
"Unable to add scripts to DOM. hostUrl and manifestPath are required."
|
|
9
|
-
);
|
|
5
|
+
const addScriptToDOM = ({ name, hostUrl, documentEle }, fileName, index) => {
|
|
6
|
+
if (!hostUrl)
|
|
7
|
+
throw new Error("Unable to add scripts to DOM. hostUrl is required.");
|
|
10
8
|
return new Promise((resolve, reject) => {
|
|
11
9
|
const ele = documentEle.createElement("script");
|
|
12
10
|
if (!ele)
|
|
13
11
|
reject(new Error("Unable to insert Application scripts."));
|
|
14
12
|
ele.id = `${APP_SCRIPT_ID_PREFIX}${name}-${index}`;
|
|
15
|
-
const url = new URL(
|
|
16
|
-
`${manifestPath.replace(/\/?$/, "/")}${fileName}`,
|
|
17
|
-
hostUrl
|
|
18
|
-
);
|
|
13
|
+
const url = new URL(fileName, hostUrl);
|
|
19
14
|
ele.src = removeDoubleSlash(url.href);
|
|
20
15
|
ele.onload = resolve.bind(null, ele.id);
|
|
21
16
|
ele.onerror = reject.bind(null, ele.id);
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { removeDoubleSlash } from "../../../utils/url.js";
|
|
2
2
|
const APP_STYLE_ID_PREFIX = "emui-style-";
|
|
3
|
-
const addStylesToDOM = ({ name, hostUrl, documentEle
|
|
4
|
-
if (!hostUrl
|
|
5
|
-
throw new Error(
|
|
6
|
-
"Unable to add styles to DOM. hostUrl and manifestPath are required."
|
|
7
|
-
);
|
|
3
|
+
const addStylesToDOM = ({ name, hostUrl, documentEle }, fileName, index) => {
|
|
4
|
+
if (!hostUrl)
|
|
5
|
+
throw new Error("Unable to add styles to DOM. hostUrl is required.");
|
|
8
6
|
return new Promise((resolve, reject) => {
|
|
9
7
|
const ele = documentEle.createElement("link");
|
|
10
8
|
if (!ele)
|
|
11
9
|
reject(new Error("Unable to insert Application styles."));
|
|
12
10
|
ele.id = `${APP_STYLE_ID_PREFIX}${name}-${index}`;
|
|
13
11
|
ele.rel = "stylesheet";
|
|
14
|
-
const url = new URL(
|
|
15
|
-
`${manifestPath.replace(/\/?$/, "/")}${fileName}`,
|
|
16
|
-
hostUrl
|
|
17
|
-
);
|
|
12
|
+
const url = new URL(fileName, hostUrl);
|
|
18
13
|
ele.href = removeDoubleSlash(url.href);
|
|
19
14
|
ele.onload = resolve.bind(null, ele.id);
|
|
20
15
|
documentEle.head.appendChild(ele);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useState } from "react";
|
|
3
|
-
import frameHtml from "./iframe
|
|
3
|
+
import frameHtml from "./iframe.html?resource";
|
|
4
4
|
import { IFrame } from "./iframe/index.js";
|
|
5
5
|
import { useFrameLoaded } from "./use-frame-loaded.js";
|
|
6
6
|
import {
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MicroAppConfig } from '../../../utils/micro-frontend/types.js';
|
|
2
2
|
export declare const APP_SCRIPT_ID_PREFIX = "emui-script-";
|
|
3
|
-
export declare const addScriptToDOM: ({ name, hostUrl, documentEle
|
|
3
|
+
export declare const addScriptToDOM: ({ name, hostUrl, documentEle }: MicroAppConfig, fileName: string, index: number) => Promise<string>;
|
|
4
4
|
export declare const removeScriptFromDOM: (elementId?: string, documentEle?: Document) => Promise<void>;
|
|
5
5
|
export declare const removeDynamicImportedScripts: (hostUrl: string, documentEle: HTMLDocument) => void;
|
|
6
6
|
export declare const removePrefetchLinks: (hostUrl: string, documentEle: HTMLDocument) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MicroAppConfig } from '../../../utils/micro-frontend/types.js';
|
|
2
2
|
export declare const APP_STYLE_ID_PREFIX = "emui-style-";
|
|
3
|
-
export declare const addStylesToDOM: ({ name, hostUrl, documentEle
|
|
3
|
+
export declare const addStylesToDOM: ({ name, hostUrl, documentEle }: MicroAppConfig, fileName: string, index: number) => Promise<string>;
|
|
4
4
|
export declare const removeStyleFromDOM: (elementId?: string, documentEle?: Document) => Promise<void>;
|
|
5
5
|
export declare const removeDynamicImportedStyles: (hostUrl: string, documentEle: Document) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/pui-app-sdk",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.3",
|
|
4
4
|
"description": "ICE MT UI Platform Application SDK ",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"@elliemae/ds-popperjs": "~3.9.0",
|
|
145
145
|
"@elliemae/ds-toast": "~3.9.0",
|
|
146
146
|
"@elliemae/em-ssf-guest": "~1.11.2",
|
|
147
|
-
"@elliemae/pui-cli": "~7.
|
|
147
|
+
"@elliemae/pui-cli": "~7.8.1",
|
|
148
148
|
"@elliemae/pui-diagnostics": "~2.7.4",
|
|
149
149
|
"@elliemae/pui-e2e-test-sdk": "~7.5.0",
|
|
150
150
|
"@elliemae/pui-micro-frontend-base": "~1.13.0",
|