@maxischmaxi/maxforms-embed 0.0.5
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/components/FileUpload.d.ts +11 -0
- package/dist/components/FileUpload.d.ts.map +1 -0
- package/dist/components/Form.d.ts +28 -0
- package/dist/components/Form.d.ts.map +1 -0
- package/dist/components/blocks/DividerBlock.d.ts +5 -0
- package/dist/components/blocks/DividerBlock.d.ts.map +1 -0
- package/dist/components/blocks/HeadingBlock.d.ts +10 -0
- package/dist/components/blocks/HeadingBlock.d.ts.map +1 -0
- package/dist/components/blocks/RowBlock.d.ts +13 -0
- package/dist/components/blocks/RowBlock.d.ts.map +1 -0
- package/dist/components/blocks/TextBlock.d.ts +10 -0
- package/dist/components/blocks/TextBlock.d.ts.map +1 -0
- package/dist/components/blocks/index.d.ts +5 -0
- package/dist/components/blocks/index.d.ts.map +1 -0
- package/dist/hooks/useMaxForm.d.ts +53 -0
- package/dist/hooks/useMaxForm.d.ts.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/lib/validation.d.ts +22 -0
- package/dist/lib/validation.d.ts.map +1 -0
- package/dist/maxforms-embed.css +1 -0
- package/dist/maxforms-embed.js +21769 -0
- package/dist/maxforms-embed.js.map +1 -0
- package/dist/maxforms-embed.umd.cjs +73 -0
- package/dist/maxforms-embed.umd.cjs.map +1 -0
- package/dist/types.d.ts +214 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +78 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { FieldError, UseFormRegister, UseFormReturn } from 'react-hook-form';
|
|
3
|
+
import { FormField, FormBlock } from '@maxischmaxi/maxforms-api-client';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
/**
|
|
6
|
+
* Form settings as a plain object.
|
|
7
|
+
* This is a simplified version that doesn't include Protobuf methods.
|
|
8
|
+
*/
|
|
9
|
+
export interface FormSettingsData {
|
|
10
|
+
submitButtonText: string;
|
|
11
|
+
successMessage: string;
|
|
12
|
+
redirectUrl: string;
|
|
13
|
+
notifyOnSubmission: boolean;
|
|
14
|
+
notificationEmail: string;
|
|
15
|
+
}
|
|
16
|
+
export type FormData = Record<string, string>;
|
|
17
|
+
/**
|
|
18
|
+
* Context passed to custom field render functions.
|
|
19
|
+
* Provides all necessary data and callbacks for rendering a field.
|
|
20
|
+
*/
|
|
21
|
+
export interface FieldRenderContext {
|
|
22
|
+
/** The field definition from the form */
|
|
23
|
+
field: FormField;
|
|
24
|
+
/** React Hook Form register function */
|
|
25
|
+
register: UseFormRegister<FormData>;
|
|
26
|
+
/** Field error if validation failed */
|
|
27
|
+
error?: FieldError;
|
|
28
|
+
/** Current field value */
|
|
29
|
+
value: string;
|
|
30
|
+
/** Callback to update the field value */
|
|
31
|
+
onChange: (value: string) => void;
|
|
32
|
+
/** Callback triggered on blur */
|
|
33
|
+
onBlur: () => void;
|
|
34
|
+
/** Field name for form registration */
|
|
35
|
+
name: string;
|
|
36
|
+
/** Whether the field is disabled */
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Extended context for file upload fields.
|
|
41
|
+
*/
|
|
42
|
+
export interface FileFieldRenderContext extends FieldRenderContext {
|
|
43
|
+
/** Form ID for upload URL generation */
|
|
44
|
+
formId: string;
|
|
45
|
+
/** API key for authentication */
|
|
46
|
+
apiKey: string;
|
|
47
|
+
/** Base URL for API calls */
|
|
48
|
+
baseUrl: string;
|
|
49
|
+
}
|
|
50
|
+
/** Render function for text input fields */
|
|
51
|
+
export type RenderInputFn = (ctx: FieldRenderContext) => ReactNode;
|
|
52
|
+
/** Render function for textarea fields */
|
|
53
|
+
export type RenderTextareaFn = (ctx: FieldRenderContext) => ReactNode;
|
|
54
|
+
/** Render function for select/dropdown fields */
|
|
55
|
+
export type RenderSelectFn = (ctx: FieldRenderContext) => ReactNode;
|
|
56
|
+
/** Render function for checkbox group fields */
|
|
57
|
+
export type RenderCheckboxFn = (ctx: FieldRenderContext) => ReactNode;
|
|
58
|
+
/** Render function for radio group fields */
|
|
59
|
+
export type RenderRadioFn = (ctx: FieldRenderContext) => ReactNode;
|
|
60
|
+
/** Render function for email input fields */
|
|
61
|
+
export type RenderEmailFn = (ctx: FieldRenderContext) => ReactNode;
|
|
62
|
+
/** Render function for number input fields */
|
|
63
|
+
export type RenderNumberFn = (ctx: FieldRenderContext) => ReactNode;
|
|
64
|
+
/** Render function for date input fields */
|
|
65
|
+
export type RenderDateFn = (ctx: FieldRenderContext) => ReactNode;
|
|
66
|
+
/** Render function for file upload fields */
|
|
67
|
+
export type RenderFileFn = (ctx: FileFieldRenderContext) => ReactNode;
|
|
68
|
+
/** Render function for heading blocks */
|
|
69
|
+
export type RenderHeadingFn = (block: FormBlock) => ReactNode;
|
|
70
|
+
/** Render function for text/paragraph blocks */
|
|
71
|
+
export type RenderTextBlockFn = (block: FormBlock) => ReactNode;
|
|
72
|
+
/** Render function for divider blocks */
|
|
73
|
+
export type RenderDividerFn = () => ReactNode;
|
|
74
|
+
/** Render function for row/column layout blocks */
|
|
75
|
+
export type RenderRowFn = (block: FormBlock, children: ReactNode[]) => ReactNode;
|
|
76
|
+
/** Props for custom submit button render function */
|
|
77
|
+
export interface SubmitRenderProps {
|
|
78
|
+
/** Whether the form is currently submitting */
|
|
79
|
+
isSubmitting: boolean;
|
|
80
|
+
/** The configured button text */
|
|
81
|
+
buttonText: string;
|
|
82
|
+
/** Whether the form has validation errors */
|
|
83
|
+
hasErrors: boolean;
|
|
84
|
+
}
|
|
85
|
+
/** Render function for submit button */
|
|
86
|
+
export type RenderSubmitFn = (props: SubmitRenderProps) => ReactNode;
|
|
87
|
+
/** Render function for form error display */
|
|
88
|
+
export type RenderFormErrorFn = (error: string) => ReactNode;
|
|
89
|
+
/** Render function for field error display */
|
|
90
|
+
export type RenderFieldErrorFn = (error: FieldError) => ReactNode;
|
|
91
|
+
/** Render function for loading state */
|
|
92
|
+
export type RenderLoadingFn = () => ReactNode;
|
|
93
|
+
/** Render function for success state */
|
|
94
|
+
export type RenderSuccessFn = (message: string) => ReactNode;
|
|
95
|
+
/** Render function for field wrapper/container */
|
|
96
|
+
export type RenderFieldWrapperFn = (field: FormField, children: ReactNode, error?: FieldError) => ReactNode;
|
|
97
|
+
/**
|
|
98
|
+
* Props for the Form component.
|
|
99
|
+
*/
|
|
100
|
+
export interface FormProps {
|
|
101
|
+
/** ID of the form to load */
|
|
102
|
+
formId: string;
|
|
103
|
+
/** API key for authentication */
|
|
104
|
+
apiKey: string;
|
|
105
|
+
/** Base URL for API calls (defaults to window.location.origin) */
|
|
106
|
+
baseUrl?: string;
|
|
107
|
+
/** Callback fired on successful submission */
|
|
108
|
+
onSubmit?: (data: FormData) => void;
|
|
109
|
+
/** Callback fired on submission error */
|
|
110
|
+
onError?: (error: Error) => void;
|
|
111
|
+
/** Additional CSS class for the form */
|
|
112
|
+
className?: string;
|
|
113
|
+
/** Custom renderer for text input fields */
|
|
114
|
+
renderInput?: RenderInputFn;
|
|
115
|
+
/** Custom renderer for textarea fields */
|
|
116
|
+
renderTextarea?: RenderTextareaFn;
|
|
117
|
+
/** Custom renderer for select/dropdown fields */
|
|
118
|
+
renderSelect?: RenderSelectFn;
|
|
119
|
+
/** Custom renderer for checkbox group fields */
|
|
120
|
+
renderCheckbox?: RenderCheckboxFn;
|
|
121
|
+
/** Custom renderer for radio group fields */
|
|
122
|
+
renderRadio?: RenderRadioFn;
|
|
123
|
+
/** Custom renderer for email input fields */
|
|
124
|
+
renderEmail?: RenderEmailFn;
|
|
125
|
+
/** Custom renderer for number input fields */
|
|
126
|
+
renderNumber?: RenderNumberFn;
|
|
127
|
+
/** Custom renderer for date input fields */
|
|
128
|
+
renderDate?: RenderDateFn;
|
|
129
|
+
/** Custom renderer for file upload fields */
|
|
130
|
+
renderFile?: RenderFileFn;
|
|
131
|
+
/** Custom renderer for heading blocks */
|
|
132
|
+
renderHeading?: RenderHeadingFn;
|
|
133
|
+
/** Custom renderer for text/paragraph blocks */
|
|
134
|
+
renderTextBlock?: RenderTextBlockFn;
|
|
135
|
+
/** Custom renderer for divider blocks */
|
|
136
|
+
renderDivider?: RenderDividerFn;
|
|
137
|
+
/** Custom renderer for row/column layout blocks */
|
|
138
|
+
renderRow?: RenderRowFn;
|
|
139
|
+
/** Custom renderer for submit button */
|
|
140
|
+
renderSubmit?: RenderSubmitFn;
|
|
141
|
+
/** Custom renderer for form-level errors */
|
|
142
|
+
renderFormError?: RenderFormErrorFn;
|
|
143
|
+
/** Custom renderer for field-level errors */
|
|
144
|
+
renderFieldError?: RenderFieldErrorFn;
|
|
145
|
+
/** Custom renderer for loading state */
|
|
146
|
+
renderLoading?: RenderLoadingFn;
|
|
147
|
+
/** Custom renderer for success state */
|
|
148
|
+
renderSuccess?: RenderSuccessFn;
|
|
149
|
+
/** Custom renderer for field wrapper/container */
|
|
150
|
+
renderFieldWrapper?: RenderFieldWrapperFn;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Options for the useMaxForm hook.
|
|
154
|
+
*/
|
|
155
|
+
export interface UseMaxFormOptions {
|
|
156
|
+
/** ID of the form to load */
|
|
157
|
+
formId: string;
|
|
158
|
+
/** API key for authentication */
|
|
159
|
+
apiKey: string;
|
|
160
|
+
/** Base URL for API calls (defaults to window.location.origin) */
|
|
161
|
+
baseUrl?: string;
|
|
162
|
+
/** When to trigger validation */
|
|
163
|
+
mode?: "onBlur" | "onChange" | "onSubmit" | "all";
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Return value of the useMaxForm hook.
|
|
167
|
+
* Provides everything needed for fully custom form rendering.
|
|
168
|
+
*/
|
|
169
|
+
export interface UseMaxFormReturn {
|
|
170
|
+
/** React Hook Form instance for full control */
|
|
171
|
+
form: UseFormReturn<FormData>;
|
|
172
|
+
/** Array of form fields */
|
|
173
|
+
fields: FormField[];
|
|
174
|
+
/** Layout blocks for rendering */
|
|
175
|
+
layout: FormBlock[];
|
|
176
|
+
/** Form settings (button text, success message, etc.) */
|
|
177
|
+
settings: FormSettingsData;
|
|
178
|
+
/** Generated Zod validation schema */
|
|
179
|
+
schema: z.ZodObject<Record<string, z.ZodType>> | null;
|
|
180
|
+
/** Whether the form is loading */
|
|
181
|
+
isLoading: boolean;
|
|
182
|
+
/** Whether the form is submitting */
|
|
183
|
+
isSubmitting: boolean;
|
|
184
|
+
/** Whether submission was successful */
|
|
185
|
+
isSuccess: boolean;
|
|
186
|
+
/** Form-level error message */
|
|
187
|
+
error: string | null;
|
|
188
|
+
/** Submit the form */
|
|
189
|
+
submitForm: (data: FormData) => Promise<void>;
|
|
190
|
+
/** Reset the form to initial state */
|
|
191
|
+
resetForm: () => void;
|
|
192
|
+
/** Get error message for a specific field */
|
|
193
|
+
getFieldError: (fieldName: string) => string | undefined;
|
|
194
|
+
/** Get field definition by ID */
|
|
195
|
+
getFieldById: (fieldId: string) => FormField | undefined;
|
|
196
|
+
/** Get field definition by name */
|
|
197
|
+
getFieldByName: (fieldName: string) => FormField | undefined;
|
|
198
|
+
/** API key for file upload authentication */
|
|
199
|
+
apiKey: string;
|
|
200
|
+
/** Base URL for API calls */
|
|
201
|
+
baseUrl: string;
|
|
202
|
+
/** Form ID */
|
|
203
|
+
formId: string;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Internal form state during loading.
|
|
207
|
+
*/
|
|
208
|
+
export interface FormConfig {
|
|
209
|
+
fields: FormField[];
|
|
210
|
+
layout: FormBlock[];
|
|
211
|
+
settings: FormSettingsData;
|
|
212
|
+
schema: z.ZodObject<Record<string, z.ZodType>>;
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EA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ED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxischmaxi/maxforms-embed",
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Embeddable form component for MaxForms with Zod validation and React Hook Form",
|
|
6
|
+
"author": "maxischmaxi",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/maxischmaxi/maxforms.git",
|
|
11
|
+
"directory": "packages/embed"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/maxischmaxi/maxforms#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/maxischmaxi/maxforms/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"maxforms",
|
|
19
|
+
"embed",
|
|
20
|
+
"forms",
|
|
21
|
+
"react",
|
|
22
|
+
"zod",
|
|
23
|
+
"react-hook-form",
|
|
24
|
+
"validation"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public",
|
|
28
|
+
"registry": "https://registry.npmjs.org/"
|
|
29
|
+
},
|
|
30
|
+
"main": "./dist/maxforms-embed.umd.cjs",
|
|
31
|
+
"module": "./dist/maxforms-embed.js",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/maxforms-embed.js",
|
|
37
|
+
"require": "./dist/maxforms-embed.umd.cjs"
|
|
38
|
+
},
|
|
39
|
+
"./styles.css": "./dist/maxforms-embed.css"
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"dist"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"dev": "vite build --watch",
|
|
46
|
+
"build": "tsc -b && vite build",
|
|
47
|
+
"clean": "rm -rf dist",
|
|
48
|
+
"typecheck": "tsc --noEmit"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@hookform/resolvers": "^5.2.2",
|
|
52
|
+
"@maxischmaxi/maxforms-api-client": "workspace:*",
|
|
53
|
+
"react": "^19.0.0",
|
|
54
|
+
"react-dom": "^19.0.0",
|
|
55
|
+
"react-hook-form": "^7.54.0",
|
|
56
|
+
"zod": "^4.3.0"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@types/react": "^19.0.0",
|
|
60
|
+
"@types/react-dom": "^19.0.0",
|
|
61
|
+
"@vitejs/plugin-react": "^4.3.0",
|
|
62
|
+
"typescript": "^5.7.0",
|
|
63
|
+
"vite": "^6.0.0",
|
|
64
|
+
"vite-plugin-dts": "^4.3.0"
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
68
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
69
|
+
},
|
|
70
|
+
"peerDependenciesMeta": {
|
|
71
|
+
"react": {
|
|
72
|
+
"optional": true
|
|
73
|
+
},
|
|
74
|
+
"react-dom": {
|
|
75
|
+
"optional": true
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|