@mittwald/flow-remote-react-components 0.2.0-alpha.353 → 0.2.0-alpha.354

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.
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  /* */
3
3
  import { jsx } from 'react/jsx-runtime';
4
- import 'react';
4
+ import { useId, useMemo } from 'react';
5
5
  import { Form as Form$1 } from '@mittwald/flow-react-components/react-hook-form';
6
6
  import { createRemoteComponent } from '../../../lib/createRemoteComponent.mjs';
7
7
  import { RemoteRhfFormElement } from '@mittwald/flow-remote-elements/react-hook-form';
@@ -13,13 +13,12 @@ const BaseForm = createRemoteComponent("flr-rhf-form", RemoteRhfFormElement, {
13
13
  });
14
14
  const Form = (props) => {
15
15
  const { ...rest } = props;
16
- return /* @__PURE__ */ jsx(
17
- Form$1,
18
- {
19
- formComponent: (props2) => /* @__PURE__ */ jsx(BaseForm, { ...props2 }),
20
- ...rest
21
- }
16
+ const id = useId();
17
+ const form = useMemo(
18
+ () => (props2) => /* @__PURE__ */ jsx(BaseForm, { ...props2 }),
19
+ [id]
22
20
  );
21
+ return /* @__PURE__ */ jsx(Form$1, { ...rest, formComponent: form }, id);
23
22
  };
24
23
 
25
24
  export { Form, Form as default };
@@ -1 +1 @@
1
- {"version":3,"file":"Form.mjs","sources":["../../../../../src/integrations/react-hook-form/Form/Form.tsx"],"sourcesContent":["import React, { type ComponentProps } from \"react\";\nimport { Form as RhfForm } from \"@mittwald/flow-react-components/react-hook-form\";\nimport type { FormProps } from \"@mittwald/flow-react-components/react-hook-form\";\nimport type { FieldValues } from \"react-hook-form\";\nimport { createRemoteComponent } from \"@/lib/createRemoteComponent\";\nexport { type RemoteRhfFormElement } from \"@mittwald/flow-remote-elements/react-hook-form\";\nimport { RemoteRhfFormElement } from \"@mittwald/flow-remote-elements/react-hook-form\";\n\nconst BaseForm = createRemoteComponent(\"flr-rhf-form\", RemoteRhfFormElement, {\n eventProps: {\n onSubmit: { event: \"submit\" } as never,\n },\n});\n\nexport const Form = <F extends FieldValues>(props: FormProps<F>) => {\n const { ...rest } = props;\n\n return (\n <RhfForm\n formComponent={(props: ComponentProps<typeof BaseForm>) => (\n <BaseForm {...props} />\n )}\n {...rest}\n />\n );\n};\n\nexport default Form;\n"],"names":["RhfForm","props"],"mappings":";;;;;;AAQA,MAAM,QAAA,GAAW,qBAAsB,CAAA,cAAA,EAAgB,oBAAsB,EAAA;AAAA,EAC3E,UAAY,EAAA;AAAA,IACV,QAAA,EAAU,EAAE,KAAA,EAAO,QAAS;AAAA;AAEhC,CAAC,CAAA;AAEY,MAAA,IAAA,GAAO,CAAwB,KAAwB,KAAA;AAClE,EAAM,MAAA,EAAE,GAAG,IAAA,EAAS,GAAA,KAAA;AAEpB,EACE,uBAAA,GAAA;AAAA,IAACA,MAAA;AAAA,IAAA;AAAA,MACC,eAAe,CAACC,MAAAA,qBACb,GAAA,CAAA,QAAA,EAAA,EAAU,GAAGA,MAAO,EAAA,CAAA;AAAA,MAEtB,GAAG;AAAA;AAAA,GACN;AAEJ;;;;"}
1
+ {"version":3,"file":"Form.mjs","sources":["../../../../../src/integrations/react-hook-form/Form/Form.tsx"],"sourcesContent":["import React, { type ComponentProps, useId, useMemo } from \"react\";\nimport { Form as RhfForm } from \"@mittwald/flow-react-components/react-hook-form\";\nimport type { FormProps } from \"@mittwald/flow-react-components/react-hook-form\";\nimport type { FieldValues } from \"react-hook-form\";\nimport { createRemoteComponent } from \"@/lib/createRemoteComponent\";\nexport { type RemoteRhfFormElement } from \"@mittwald/flow-remote-elements/react-hook-form\";\nimport { RemoteRhfFormElement } from \"@mittwald/flow-remote-elements/react-hook-form\";\n\nconst BaseForm = createRemoteComponent(\"flr-rhf-form\", RemoteRhfFormElement, {\n eventProps: {\n onSubmit: { event: \"submit\" } as never,\n },\n});\n\nexport const Form = <F extends FieldValues>(props: FormProps<F>) => {\n const { ...rest } = props;\n const id = useId();\n\n const form = useMemo(\n () => (props: ComponentProps<typeof BaseForm>) => <BaseForm {...props} />,\n [id],\n );\n\n return <RhfForm key={id} {...rest} formComponent={form} />;\n};\n\nexport default Form;\n"],"names":["props","RhfForm"],"mappings":";;;;;;AAQA,MAAM,QAAA,GAAW,qBAAsB,CAAA,cAAA,EAAgB,oBAAsB,EAAA;AAAA,EAC3E,UAAY,EAAA;AAAA,IACV,QAAA,EAAU,EAAE,KAAA,EAAO,QAAS;AAAA;AAEhC,CAAC,CAAA;AAEY,MAAA,IAAA,GAAO,CAAwB,KAAwB,KAAA;AAClE,EAAM,MAAA,EAAE,GAAG,IAAA,EAAS,GAAA,KAAA;AACpB,EAAA,MAAM,KAAK,KAAM,EAAA;AAEjB,EAAA,MAAM,IAAO,GAAA,OAAA;AAAA,IACX,MAAM,CAACA,MAAAA,qBAA4C,GAAA,CAAA,QAAA,EAAA,EAAU,GAAGA,MAAO,EAAA,CAAA;AAAA,IACvE,CAAC,EAAE;AAAA,GACL;AAEA,EAAA,2BAAQC,MAAkB,EAAA,EAAA,GAAG,IAAM,EAAA,aAAA,EAAe,QAA7B,EAAmC,CAAA;AAC1D;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/react-hook-form/Form/Form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAS3F,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,WAAW,EAAE,OAAO,SAAS,CAAC,CAAC,CAAC,4CAW9D,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/react-hook-form/Form/Form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAS3F,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,WAAW,EAAE,OAAO,SAAS,CAAC,CAAC,CAAC,4CAU9D,CAAC;AAEF,eAAe,IAAI,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.353",
3
+ "version": "0.2.0-alpha.354",
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",
@@ -36,9 +36,9 @@
36
36
  "test:unit": "exit 0"
37
37
  },
38
38
  "dependencies": {
39
- "@mittwald/flow-react-components": "0.2.0-alpha.353",
40
- "@mittwald/flow-remote-core": "0.2.0-alpha.353",
41
- "@mittwald/flow-remote-elements": "0.2.0-alpha.353",
39
+ "@mittwald/flow-react-components": "0.2.0-alpha.354",
40
+ "@mittwald/flow-remote-core": "0.2.0-alpha.354",
41
+ "@mittwald/flow-remote-elements": "0.2.0-alpha.354",
42
42
  "@mittwald/remote-dom-react": "1.2.2-mittwald.10",
43
43
  "@testing-library/jest-dom": "6.6.3",
44
44
  "@types/react": "^19.1.8",
@@ -46,8 +46,8 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@internationalized/date": "^3.8.2",
49
- "@mittwald/ext-bridge": "0.2.0-alpha.353",
50
- "@mittwald/flow-remote-react-renderer": "0.2.0-alpha.353",
49
+ "@mittwald/ext-bridge": "0.2.0-alpha.354",
50
+ "@mittwald/flow-remote-react-renderer": "0.2.0-alpha.354",
51
51
  "@mittwald/typescript-config": "",
52
52
  "@testing-library/dom": "^10.4.0",
53
53
  "@testing-library/jest-dom": "6.6.3",
@@ -93,5 +93,5 @@
93
93
  "optional": true
94
94
  }
95
95
  },
96
- "gitHead": "4981aae1f96f1a68e04026bdb96197a5c86f5bb1"
96
+ "gitHead": "d8d8f99c54fc47b81d8a303abe6a59d4f5343258"
97
97
  }