@fluid-app/fluid-cli-portal 0.1.15 → 0.1.17
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/index.d.mts +6 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +45 -7
- package/dist/index.mjs.map +1 -1
- package/dist/{pull-p1mSVa5W.mjs → pull-BS1a3pUP.mjs} +2 -2
- package/dist/{pull-p1mSVa5W.mjs.map → pull-BS1a3pUP.mjs.map} +1 -1
- package/package.json +4 -4
- package/templates/base/.fluidrc.template +3 -0
- package/templates/base/src/screens/ExampleForm.tsx +2 -5
- package/templates/starter/.env.example +5 -0
- package/templates/starter/README.md.template +2 -5
- package/templates/starter/package.json.template +9 -4
|
@@ -7,9 +7,8 @@
|
|
|
7
7
|
* Uncomment the nav entry and import in portal.config.ts to enable.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { useForm } from "react-hook-form";
|
|
11
10
|
import { z } from "zod";
|
|
12
|
-
import {
|
|
11
|
+
import { useZodForm } from "@fluid-app/ui-primitives";
|
|
13
12
|
|
|
14
13
|
// =============================================================================
|
|
15
14
|
// Zod Schema
|
|
@@ -41,9 +40,7 @@ export function ExampleFormScreen() {
|
|
|
41
40
|
handleSubmit,
|
|
42
41
|
reset,
|
|
43
42
|
formState: { errors, isSubmitting, isSubmitSuccessful },
|
|
44
|
-
} =
|
|
45
|
-
resolver: zodResolver(contactFormSchema),
|
|
46
|
-
});
|
|
43
|
+
} = useZodForm<ContactFormData>(contactFormSchema);
|
|
47
44
|
|
|
48
45
|
const onSubmit = async (_data: ContactFormData) => {
|
|
49
46
|
// Replace with your API call, e.g.:
|
|
@@ -156,9 +156,8 @@ pnpm add react-hook-form zod @hookform/resolvers
|
|
|
156
156
|
### Example
|
|
157
157
|
|
|
158
158
|
```tsx
|
|
159
|
-
import { useForm } from "react-hook-form";
|
|
160
159
|
import { z } from "zod";
|
|
161
|
-
import {
|
|
160
|
+
import { useZodForm } from "@fluid-app/ui-primitives";
|
|
162
161
|
|
|
163
162
|
const schema = z.object({
|
|
164
163
|
name: z.string().min(1, "Name is required"),
|
|
@@ -172,9 +171,7 @@ export function MyFormScreen() {
|
|
|
172
171
|
register,
|
|
173
172
|
handleSubmit,
|
|
174
173
|
formState: { errors, isSubmitting },
|
|
175
|
-
} =
|
|
176
|
-
resolver: zodResolver(schema),
|
|
177
|
-
});
|
|
174
|
+
} = useZodForm<FormData>(schema);
|
|
178
175
|
|
|
179
176
|
const onSubmit = async (data: FormData) => {
|
|
180
177
|
// Call your API here
|
|
@@ -8,20 +8,25 @@
|
|
|
8
8
|
"build": "tsc -b && vite build",
|
|
9
9
|
"preview": "vite preview",
|
|
10
10
|
"typecheck": "tsc --noEmit",
|
|
11
|
-
"lint": "oxlint"
|
|
11
|
+
"lint": "oxlint",
|
|
12
|
+
"pull": "fluid portal pull",
|
|
13
|
+
"push": "fluid portal push",
|
|
14
|
+
"widget:create": "fluid portal widget create"
|
|
12
15
|
},
|
|
13
16
|
"dependencies": {
|
|
14
|
-
"@fluid-app/portal-preview": "{{sdkVersion}}",
|
|
15
17
|
"@fluid-app/portal-sdk": "{{sdkVersion}}",
|
|
18
|
+
"@fluid-app/ui-primitives": "^0.1.0",
|
|
16
19
|
"@tanstack/react-query": "^5.90.0",
|
|
17
20
|
"react": "^19.0.0",
|
|
18
21
|
"react-dom": "^19.0.0",
|
|
19
22
|
"react-hook-form": "^7.55.0",
|
|
20
23
|
"@hookform/resolvers": "^4.1.3",
|
|
21
|
-
"zod": "^3.24.0"
|
|
24
|
+
"zod": "^3.24.0",
|
|
25
|
+
"zustand": "^5.0.0"
|
|
22
26
|
},
|
|
23
27
|
"devDependencies": {
|
|
24
|
-
"@fluid-app/fluid-cli
|
|
28
|
+
"@fluid-app/fluid-cli": "{{cliVersion}}",
|
|
29
|
+
"@fluid-app/fluid-cli-portal": "{{cliVersion}}",
|
|
25
30
|
"@tailwindcss/vite": "^4.0.0",
|
|
26
31
|
"@types/react": "^19.0.0",
|
|
27
32
|
"@types/react-dom": "^19.0.0",
|