@mittwald/flow-remote-react-components 0.2.0-alpha.145 → 0.2.0-alpha.147
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/js/RemoteRoot.mjs +1 -1
- package/dist/js/RemoteRoot.mjs.map +1 -1
- package/dist/js/components/Preview.mjs +5 -0
- package/dist/js/components/Preview.mjs.map +1 -1
- package/dist/types/components/Preview.d.ts.map +1 -1
- package/package.json +7 -7
- package/dist/js/hooks/useIsMounted.mjs +0 -14
- package/dist/js/hooks/useIsMounted.mjs.map +0 -1
- package/dist/types/hooks/useIsMounted.d.ts +0 -2
- package/dist/types/hooks/useIsMounted.d.ts.map +0 -1
package/dist/js/RemoteRoot.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
"use client";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import { useIsMounted } from "
|
|
5
|
+
import { useIsMounted } from "@mittwald/flow-react-components";
|
|
6
6
|
import React from "react";
|
|
7
7
|
const ClientComponent = React.lazy(() => import("./components/RemoteRootClient.mjs"));
|
|
8
8
|
const RemoteRoot = (props) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteRoot.mjs","sources":["../../src/components/RemoteRoot.tsx"],"sourcesContent":["\"use client\";\nimport type { RootClientProps } from \"@/components/RemoteRootClient\";\nimport { useIsMounted } from \"
|
|
1
|
+
{"version":3,"file":"RemoteRoot.mjs","sources":["../../src/components/RemoteRoot.tsx"],"sourcesContent":["\"use client\";\nimport type { RootClientProps } from \"@/components/RemoteRootClient\";\nimport { useIsMounted } from \"@mittwald/flow-react-components\";\nimport React, { type FC } from \"react\";\n\nconst ClientComponent = React.lazy(() => import(\"./RemoteRootClient\"));\n\nexport const RemoteRoot: FC<RootClientProps> = (props) => {\n const isMounted = useIsMounted();\n\n if (!isMounted) {\n return null;\n }\n\n return <ClientComponent {...props} />;\n};\n\nexport default RemoteRoot;\n"],"names":[],"mappings":";;;;AAKA,MAAM,kBAAkB,MAAM,KAAK,MAAM,OAAO,mCAAoB,CAAC;AAExD,MAAA,aAAkC,CAAC,UAAU;AACxD,QAAM,YAAY,aAAa;AAE/B,MAAI,CAAC,WAAW;AACP,WAAA;AAAA,EAAA;AAGF,SAAA,oBAAC,iBAAiB,EAAA,GAAG,MAAO,CAAA;AACrC;"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { useIsMounted } from "@mittwald/flow-react-components";
|
|
4
5
|
import React from "react";
|
|
5
6
|
const LazyRemoteRenderer = React.lazy(
|
|
6
7
|
() => import("@mittwald/flow-remote-react-renderer/RemoteRenderer")
|
|
7
8
|
);
|
|
8
9
|
const Preview = (props) => {
|
|
10
|
+
const isMounted = useIsMounted();
|
|
11
|
+
if (!isMounted) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
9
14
|
const previewUrl = new URL(document.location.href);
|
|
10
15
|
previewUrl.searchParams.set("preview", "");
|
|
11
16
|
return /* @__PURE__ */ jsx(LazyRemoteRenderer, { src: previewUrl.toString(), ...props });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Preview.mjs","sources":["../../../src/components/Preview.tsx"],"sourcesContent":["import type { ExtBridgeRemoteApi } from \"@mittwald/ext-bridge\";\nimport React, { type FC } from \"react\";\n\nconst LazyRemoteRenderer = React.lazy(\n () => import(\"@mittwald/flow-remote-react-renderer/RemoteRenderer\"),\n);\n\ninterface Props {\n extBridgeImplementation?: ExtBridgeRemoteApi;\n}\n\nexport const Preview: FC<Props> = (props) => {\n const previewUrl = new URL(document.location.href);\n previewUrl.searchParams.set(\"preview\", \"\");\n return <LazyRemoteRenderer src={previewUrl.toString()} {...props} />;\n};\n\nexport default Preview;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Preview.mjs","sources":["../../../src/components/Preview.tsx"],"sourcesContent":["import type { ExtBridgeRemoteApi } from \"@mittwald/ext-bridge\";\nimport { useIsMounted } from \"@mittwald/flow-react-components\";\nimport React, { type FC } from \"react\";\n\nconst LazyRemoteRenderer = React.lazy(\n () => import(\"@mittwald/flow-remote-react-renderer/RemoteRenderer\"),\n);\n\ninterface Props {\n extBridgeImplementation?: ExtBridgeRemoteApi;\n}\n\nexport const Preview: FC<Props> = (props) => {\n const isMounted = useIsMounted();\n if (!isMounted) {\n return null;\n }\n\n const previewUrl = new URL(document.location.href);\n previewUrl.searchParams.set(\"preview\", \"\");\n return <LazyRemoteRenderer src={previewUrl.toString()} {...props} />;\n};\n\nexport default Preview;\n"],"names":[],"mappings":";;;AAIA,MAAM,qBAAqB,MAAM;AAAA,EAC/B,MAAM,OAAO,qDAAqD;AACpE;AAMa,MAAA,UAAqB,CAAC,UAAU;AAC3C,QAAM,YAAY,aAAa;AAC/B,MAAI,CAAC,WAAW;AACP,WAAA;AAAA,EAAA;AAGT,QAAM,aAAa,IAAI,IAAI,SAAS,SAAS,IAAI;AACtC,aAAA,aAAa,IAAI,WAAW,EAAE;AACzC,6BAAQ,oBAAmB,EAAA,KAAK,WAAW,SAAS,GAAI,GAAG,OAAO;AACpE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Preview.d.ts","sourceRoot":"","sources":["../../../src/components/Preview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"Preview.d.ts","sourceRoot":"","sources":["../../../src/components/Preview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAMvC,UAAU,KAAK;IACb,uBAAuB,CAAC,EAAE,kBAAkB,CAAC;CAC9C;AAED,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,KAAK,CAS7B,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-remote-react-components",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.147",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React components that can be used in a remote environment",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
"test:compile": "tsc --noEmit"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@mittwald/flow-react-components": "0.2.0-alpha.
|
|
36
|
-
"@mittwald/flow-remote-core": "0.2.0-alpha.
|
|
37
|
-
"@mittwald/flow-remote-elements": "0.2.0-alpha.
|
|
35
|
+
"@mittwald/flow-react-components": "0.2.0-alpha.147",
|
|
36
|
+
"@mittwald/flow-remote-core": "0.2.0-alpha.147",
|
|
37
|
+
"@mittwald/flow-remote-elements": "0.2.0-alpha.147",
|
|
38
38
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.3",
|
|
39
39
|
"@types/react": "^19",
|
|
40
40
|
"react-error-boundary": "^5.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@mittwald/ext-bridge": "0.2.0-alpha.
|
|
44
|
-
"@mittwald/flow-remote-react-renderer": "0.2.0-alpha.
|
|
43
|
+
"@mittwald/ext-bridge": "0.2.0-alpha.147",
|
|
44
|
+
"@mittwald/flow-remote-react-renderer": "0.2.0-alpha.147",
|
|
45
45
|
"@mittwald/typescript-config": "",
|
|
46
46
|
"@types/node": "^22.13.10",
|
|
47
47
|
"nx": "^20.5.0",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"optional": true
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "0e48e8f8b5dd7dfab8dda0c8ac768fecf7317fc4"
|
|
79
79
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
/* */
|
|
3
|
-
import { useState, useEffect } from "react";
|
|
4
|
-
const useIsMounted = () => {
|
|
5
|
-
const [isMounted, setIsMounted] = useState(false);
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
setIsMounted(true);
|
|
8
|
-
}, []);
|
|
9
|
-
return isMounted;
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
useIsMounted
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=useIsMounted.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useIsMounted.mjs","sources":["../../../src/hooks/useIsMounted.ts"],"sourcesContent":["import { useEffect, useState } from \"react\";\n\nexport const useIsMounted = () => {\n const [isMounted, setIsMounted] = useState(false);\n useEffect(() => {\n setIsMounted(true);\n }, []);\n return isMounted;\n};\n"],"names":[],"mappings":";AAEO,MAAM,eAAe,MAAM;AAChC,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAChD,YAAU,MAAM;AACd,iBAAa,IAAI;AAAA,EACnB,GAAG,EAAE;AACE,SAAA;AACT;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useIsMounted.d.ts","sourceRoot":"","sources":["../../../src/hooks/useIsMounted.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,eAMxB,CAAC"}
|