@mittwald/flow-remote-react-components 0.2.0-alpha.45 → 0.2.0-alpha.47

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.
@@ -2,13 +2,15 @@
2
2
  /* */
3
3
  "use client";
4
4
  import { jsx } from "react/jsx-runtime";
5
- import React, { Suspense } from "react";
6
5
  import { useIsMounted } from "./hooks/useIsMounted.mjs";
6
+ import React, { Suspense } from "react";
7
7
  const ClientComponent = React.lazy(() => import("./components/RemoteRootClient.mjs"));
8
8
  const RemoteRoot = (props) => {
9
- const { children, ...rest } = props;
10
9
  const isMounted = useIsMounted();
11
- return isMounted ? /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(ClientComponent, { ...rest, children }) }) : null;
10
+ if (!isMounted) {
11
+ return null;
12
+ }
13
+ return /* @__PURE__ */ jsx(Suspense, { fallback: props.fallback, children: /* @__PURE__ */ jsx(ClientComponent, { ...props }) });
12
14
  };
13
15
  export {
14
16
  RemoteRoot,
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteRoot.mjs","sources":["../../src/components/RemoteRoot.tsx"],"sourcesContent":["\"use client\";\nimport { type FC, Suspense } from \"react\";\nimport React from \"react\";\nimport { useIsMounted } from \"@/hooks/useIsMounted\";\nimport type { RootClientProps } from \"@/components/RemoteRootClient\";\n\nconst ClientComponent = React.lazy(() => import(\"./RemoteRootClient\"));\n\nexport const RemoteRoot: FC<RootClientProps> = (props) => {\n const { children, ...rest } = props;\n const isMounted = useIsMounted();\n return isMounted ? (\n <Suspense>\n <ClientComponent {...rest}>{children}</ClientComponent>\n </Suspense>\n ) : null;\n};\n\nexport default RemoteRoot;\n"],"names":[],"mappings":";;;;AAMA,MAAM,kBAAkB,MAAM,KAAK,MAAM,OAAO,mCAAoB,CAAC;AAExD,MAAA,aAAkC,CAAC,UAAU;AACxD,QAAM,EAAE,UAAU,GAAG,KAAA,IAAS;AAC9B,QAAM,YAAY,aAAa;AACxB,SAAA,gCACJ,UACC,EAAA,UAAA,oBAAC,mBAAiB,GAAG,MAAO,UAAS,EAAA,CACvC,IACE;AACN;"}
1
+ {"version":3,"file":"RemoteRoot.mjs","sources":["../../src/components/RemoteRoot.tsx"],"sourcesContent":["\"use client\";\nimport type { RootClientProps } from \"@/components/RemoteRootClient\";\nimport { useIsMounted } from \"@/hooks/useIsMounted\";\nimport React, { type FC, Suspense } 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 (\n <Suspense fallback={props.fallback}>\n <ClientComponent {...props} />\n </Suspense>\n );\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;AAIP,SAAA,oBAAC,YAAS,UAAU,MAAM,UACxB,UAAC,oBAAA,iBAAA,EAAiB,GAAG,MAAA,CAAO,EAC9B,CAAA;AAEJ;"}
@@ -10,10 +10,10 @@ const RemoteRenderer = React.lazy(async () => {
10
10
  return { default: Fallback };
11
11
  }
12
12
  });
13
- const Preview = () => {
13
+ const Preview = (props) => {
14
14
  const previewUrl = new URL(document.location.href);
15
15
  previewUrl.searchParams.set("preview", "");
16
- return /* @__PURE__ */ jsx(RemoteRenderer, { src: previewUrl.toString() });
16
+ return /* @__PURE__ */ jsx(RemoteRenderer, { src: previewUrl.toString(), ...props });
17
17
  };
18
18
  export {
19
19
  Preview,
@@ -1 +1 @@
1
- {"version":3,"file":"Preview.mjs","sources":["../../../src/components/Preview.tsx"],"sourcesContent":["import React, { type FC } from \"react\";\n\nconst Fallback: FC = () => null;\n\nconst RemoteRenderer = React.lazy(async () => {\n try {\n return await import(\"@mittwald/flow-remote-react-renderer/RemoteRenderer\");\n } catch {\n return { default: Fallback };\n }\n});\n\nexport const Preview: FC = () => {\n const previewUrl = new URL(document.location.href);\n previewUrl.searchParams.set(\"preview\", \"\");\n return <RemoteRenderer src={previewUrl.toString()} />;\n};\n\nexport default Preview;\n"],"names":[],"mappings":";;AAEA,MAAM,WAAe,MAAM;AAE3B,MAAM,iBAAiB,MAAM,KAAK,YAAY;AACxC,MAAA;AACK,WAAA,MAAM,OAAO,qDAAqD;AAAA,EAAA,QACnE;AACC,WAAA,EAAE,SAAS,SAAS;AAAA,EAAA;AAE/B,CAAC;AAEM,MAAM,UAAc,MAAM;AAC/B,QAAM,aAAa,IAAI,IAAI,SAAS,SAAS,IAAI;AACtC,aAAA,aAAa,IAAI,WAAW,EAAE;AACzC,SAAQ,oBAAA,gBAAA,EAAe,KAAK,WAAW,YAAY;AACrD;"}
1
+ {"version":3,"file":"Preview.mjs","sources":["../../../src/components/Preview.tsx"],"sourcesContent":["import React, { type FC, type ReactNode } from \"react\";\n\nconst Fallback: FC = () => null;\n\nconst RemoteRenderer = React.lazy(async () => {\n try {\n return await import(\"@mittwald/flow-remote-react-renderer/RemoteRenderer\");\n } catch {\n return { default: Fallback };\n }\n});\n\ninterface Props {\n fallback?: ReactNode;\n}\n\nexport const Preview: FC<Props> = (props) => {\n const previewUrl = new URL(document.location.href);\n previewUrl.searchParams.set(\"preview\", \"\");\n return <RemoteRenderer src={previewUrl.toString()} {...props} />;\n};\n\nexport default Preview;\n"],"names":[],"mappings":";;AAEA,MAAM,WAAe,MAAM;AAE3B,MAAM,iBAAiB,MAAM,KAAK,YAAY;AACxC,MAAA;AACK,WAAA,MAAM,OAAO,qDAAqD;AAAA,EAAA,QACnE;AACC,WAAA,EAAE,SAAS,SAAS;AAAA,EAAA;AAE/B,CAAC;AAMY,MAAA,UAAqB,CAAC,UAAU;AAC3C,QAAM,aAAa,IAAI,IAAI,SAAS,SAAS,IAAI;AACtC,aAAA,aAAa,IAAI,WAAW,EAAE;AACzC,6BAAQ,gBAAe,EAAA,KAAK,WAAW,SAAS,GAAI,GAAG,OAAO;AAChE;"}
@@ -2,38 +2,26 @@
2
2
  /* */
3
3
  "use client";
4
4
  import { jsx } from "react/jsx-runtime";
5
- import "react";
6
- import { connectHostIframeRef } from "@mittwald/flow-remote-core";
7
- import { ViewComponentContextProvider } from "@mittwald/flow-react-components/internal";
8
5
  import * as index from "../auto-generated/index.mjs";
9
6
  import { Preview } from "./Preview.mjs";
7
+ import { ViewComponentContextProvider } from "@mittwald/flow-react-components/internal";
8
+ import { connectHostRenderRootRef } from "@mittwald/flow-remote-core";
9
+ import "react";
10
10
  const RemoteRootClient = (props) => {
11
- const { children, showPreview = false } = props;
11
+ const { children, showPreview = false, ...previewProps } = props;
12
12
  const params = new URLSearchParams(document.location.search);
13
13
  const isInPreviewFrame = params.has("preview");
14
- const root = /* @__PURE__ */ jsx(
15
- "div",
14
+ const root = /* @__PURE__ */ jsx("div", { ref: connectHostRenderRootRef, children: /* @__PURE__ */ jsx(
15
+ ViewComponentContextProvider,
16
16
  {
17
- ref: connectHostIframeRef,
18
- style: {
19
- height: 0,
20
- width: 0,
21
- left: -9999,
22
- position: "absolute"
23
- },
24
- children: /* @__PURE__ */ jsx(
25
- ViewComponentContextProvider,
26
- {
27
- components: index,
28
- children
29
- }
30
- )
17
+ components: index,
18
+ children
31
19
  }
32
- );
20
+ ) });
33
21
  if (isInPreviewFrame || !showPreview) {
34
22
  return root;
35
23
  }
36
- return /* @__PURE__ */ jsx(Preview, {});
24
+ return /* @__PURE__ */ jsx(Preview, { ...previewProps });
37
25
  };
38
26
  export {
39
27
  RemoteRootClient,
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteRootClient.mjs","sources":["../../../src/components/RemoteRootClient.tsx"],"sourcesContent":["\"use client\";\nimport type { FC, PropsWithChildren } from \"react\";\nimport React from \"react\";\nimport { connectHostIframeRef } from \"@mittwald/flow-remote-core\";\nimport { ViewComponentContextProvider } from \"@mittwald/flow-react-components/internal\";\nimport * as viewComponents from \"@/auto-generated\";\nimport Preview from \"@/components/Preview\";\n\nexport interface RootClientProps extends PropsWithChildren {\n showPreview?: boolean;\n}\n\nexport const RemoteRootClient: FC<RootClientProps> = (props) => {\n const { children, showPreview = false } = props;\n\n const params = new URLSearchParams(document.location.search);\n const isInPreviewFrame = params.has(\"preview\");\n\n const root = (\n <div\n ref={connectHostIframeRef}\n style={{\n height: 0,\n width: 0,\n left: -9999,\n position: \"absolute\",\n }}\n >\n <ViewComponentContextProvider\n components={viewComponents as FlowViewComponents}\n >\n {children}\n </ViewComponentContextProvider>\n </div>\n );\n\n if (isInPreviewFrame || !showPreview) {\n return root;\n }\n\n return <Preview />;\n};\n\nexport default RemoteRootClient;\n"],"names":["viewComponents"],"mappings":";;;;;;;AAYa,MAAA,mBAAwC,CAAC,UAAU;AAC9D,QAAM,EAAE,UAAU,cAAc,MAAU,IAAA;AAE1C,QAAM,SAAS,IAAI,gBAAgB,SAAS,SAAS,MAAM;AACrD,QAAA,mBAAmB,OAAO,IAAI,SAAS;AAE7C,QAAM,OACJ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,OAAO;AAAA,QACL,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,MAAM;AAAA,QACN,UAAU;AAAA,MACZ;AAAA,MAEA,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,YAAYA;AAAAA,UAEX;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EACF;AAGE,MAAA,oBAAoB,CAAC,aAAa;AAC7B,WAAA;AAAA,EAAA;AAGT,6BAAQ,SAAQ,EAAA;AAClB;"}
1
+ {"version":3,"file":"RemoteRootClient.mjs","sources":["../../../src/components/RemoteRootClient.tsx"],"sourcesContent":["\"use client\";\nimport * as viewComponents from \"@/auto-generated\";\nimport Preview from \"@/components/Preview\";\nimport { ViewComponentContextProvider } from \"@mittwald/flow-react-components/internal\";\nimport { connectHostRenderRootRef } from \"@mittwald/flow-remote-core\";\nimport { type FC, type PropsWithChildren, type ReactNode } from \"react\";\n\nexport interface RootClientProps extends PropsWithChildren {\n showPreview?: boolean;\n fallback?: ReactNode;\n}\n\nexport const RemoteRootClient: FC<RootClientProps> = (props) => {\n const { children, showPreview = false, ...previewProps } = props;\n\n const params = new URLSearchParams(document.location.search);\n const isInPreviewFrame = params.has(\"preview\");\n\n const root = (\n <div ref={connectHostRenderRootRef}>\n <ViewComponentContextProvider\n components={viewComponents as FlowViewComponents}\n >\n {children}\n </ViewComponentContextProvider>\n </div>\n );\n\n if (isInPreviewFrame || !showPreview) {\n return root;\n }\n\n return <Preview {...previewProps} />;\n};\n\nexport default RemoteRootClient;\n"],"names":["viewComponents"],"mappings":";;;;;;;AAYa,MAAA,mBAAwC,CAAC,UAAU;AAC9D,QAAM,EAAE,UAAU,cAAc,OAAO,GAAG,aAAiB,IAAA;AAE3D,QAAM,SAAS,IAAI,gBAAgB,SAAS,SAAS,MAAM;AACrD,QAAA,mBAAmB,OAAO,IAAI,SAAS;AAE7C,QAAM,OACJ,oBAAC,OAAI,EAAA,KAAK,0BACR,UAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,YAAYA;AAAAA,MAEX;AAAA,IAAA;AAAA,EAAA,GAEL;AAGE,MAAA,oBAAoB,CAAC,aAAa;AAC7B,WAAA;AAAA,EAAA;AAGF,SAAA,oBAAC,SAAS,EAAA,GAAG,aAAc,CAAA;AACpC;"}
package/dist/js/index.mjs CHANGED
@@ -94,8 +94,8 @@ import { TextField } from "./auto-generated/TextField.mjs";
94
94
  import { TimeField } from "./auto-generated/TimeField.mjs";
95
95
  import { Tooltip } from "./auto-generated/Tooltip.mjs";
96
96
  import { TooltipTrigger } from "./auto-generated/TooltipTrigger.mjs";
97
- import { Form } from "./components/Form.mjs";
98
97
  export * from "@mittwald/flow-react-components/flr-universal";
98
+ import { Form } from "./components/Form.mjs";
99
99
  export {
100
100
  Accordion,
101
101
  ActionGroup,
@@ -1,4 +1,7 @@
1
- import { FC } from 'react';
2
- export declare const Preview: FC;
1
+ import { FC, ReactNode } from 'react';
2
+ interface Props {
3
+ fallback?: ReactNode;
4
+ }
5
+ export declare const Preview: FC<Props>;
3
6
  export default Preview;
4
7
  //# sourceMappingURL=Preview.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Preview.d.ts","sourceRoot":"","sources":["../../../src/components/Preview.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAYvC,eAAO,MAAM,OAAO,EAAE,EAIrB,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Preview.d.ts","sourceRoot":"","sources":["../../../src/components/Preview.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAYvD,UAAU,KAAK;IACb,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,KAAK,CAI7B,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -1,5 +1,5 @@
1
- import { FC } from 'react';
2
1
  import { RootClientProps } from './RemoteRootClient';
2
+ import { FC } from 'react';
3
3
  export declare const RemoteRoot: FC<RootClientProps>;
4
4
  export default RemoteRoot;
5
5
  //# sourceMappingURL=RemoteRoot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteRoot.d.ts","sourceRoot":"","sources":["../../../src/components/RemoteRoot.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAY,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAIrE,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAQ1C,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"RemoteRoot.d.ts","sourceRoot":"","sources":["../../../src/components/RemoteRoot.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAc,EAAE,KAAK,EAAE,EAAY,MAAM,OAAO,CAAC;AAIjD,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAY1C,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,6 +1,7 @@
1
- import { FC, PropsWithChildren } from 'react';
1
+ import { FC, PropsWithChildren, ReactNode } from 'react';
2
2
  export interface RootClientProps extends PropsWithChildren {
3
3
  showPreview?: boolean;
4
+ fallback?: ReactNode;
4
5
  }
5
6
  export declare const RemoteRootClient: FC<RootClientProps>;
6
7
  export default RemoteRootClient;
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteRootClient.d.ts","sourceRoot":"","sources":["../../../src/components/RemoteRootClient.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAOnD,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACxD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,eAAe,CA6BhD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"RemoteRootClient.d.ts","sourceRoot":"","sources":["../../../src/components/RemoteRootClient.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAExE,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACxD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,eAAe,CAqBhD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,3 +1,3 @@
1
- export * from './Form';
2
1
  export * from './FlowRemoteUniversal';
2
+ export * from './Form';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,QAAQ,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.45",
3
+ "version": "0.2.0-alpha.47",
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,17 +32,17 @@
32
32
  "test:compile": "tsc --noEmit"
33
33
  },
34
34
  "dependencies": {
35
- "@mittwald/flow-react-components": "0.2.0-alpha.45",
36
- "@mittwald/flow-remote-core": "0.2.0-alpha.45",
37
- "@mittwald/flow-remote-elements": "0.2.0-alpha.45",
35
+ "@mittwald/flow-react-components": "0.2.0-alpha.47",
36
+ "@mittwald/flow-remote-core": "0.2.0-alpha.47",
37
+ "@mittwald/flow-remote-elements": "0.2.0-alpha.47",
38
38
  "@remote-dom/react": "^1.2.1",
39
39
  "@types/react": "^19.0.10"
40
40
  },
41
41
  "devDependencies": {
42
- "@mittwald/flow-remote-react-renderer": "0.2.0-alpha.45",
42
+ "@mittwald/flow-remote-react-renderer": "0.2.0-alpha.47",
43
43
  "@mittwald/typescript-config": "",
44
44
  "@types/node": "^22.13.4",
45
- "nx": "^20.4.4",
45
+ "nx": "^20.4.5",
46
46
  "prettier": "^3.5.1",
47
47
  "react": "^19.0.0",
48
48
  "react-hook-form": "^7.54.2",
@@ -50,7 +50,7 @@
50
50
  "rollup-plugin-auto-named-exports": "1.0.0-beta.3",
51
51
  "rollup-preserve-directives": "^1.1.3",
52
52
  "typescript": "^5.7.3",
53
- "vite": "^6.1.0",
53
+ "vite": "^6.1.1",
54
54
  "vite-plugin-banner": "^0.8.0",
55
55
  "vite-plugin-checker": "^0.8.0",
56
56
  "vite-plugin-dts": "^4.5.0",
@@ -69,5 +69,5 @@
69
69
  "optional": true
70
70
  }
71
71
  },
72
- "gitHead": "ec17c69f6103b6f015eab5aa833145fda68ea058"
72
+ "gitHead": "dfd43a192d6b3755906d3632a93a2725ed898ea0"
73
73
  }