@nextlyhq/plugin-form-builder 0.0.2-alpha.68 → 0.0.2-alpha.69
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/README.md +5 -5
- package/dist/admin/index.d.ts +218 -250
- package/dist/admin/index.js +4662 -4785
- package/dist/admin/index.js.map +1 -1
- package/dist/field-references-BshlgMcn.js +1048 -0
- package/dist/field-references-BshlgMcn.js.map +1 -0
- package/dist/index.d.ts +304 -513
- package/dist/index.js +3753 -2916
- package/dist/index.js.map +1 -1
- package/dist/types-BHReIA0j.d.ts +986 -0
- package/package.json +22 -23
- package/dist/chunk-X5WLJLAR.js +0 -703
- package/dist/chunk-X5WLJLAR.js.map +0 -1
- package/dist/types-Bo4lk9BD.d.ts +0 -997
package/README.md
CHANGED
|
@@ -104,11 +104,11 @@ See the [Field types reference](https://nextlyhq.com/docs/plugins/form-builder#f
|
|
|
104
104
|
|
|
105
105
|
## Compatibility
|
|
106
106
|
|
|
107
|
-
| Tool | Version
|
|
108
|
-
| ----------------- |
|
|
109
|
-
| Node.js |
|
|
110
|
-
| `nextly` | 0.0.x
|
|
111
|
-
| `@nextlyhq/admin` | 0.0.x
|
|
107
|
+
| Tool | Version |
|
|
108
|
+
| ----------------- | ------------- |
|
|
109
|
+
| Node.js | 22.12+ or 24+ |
|
|
110
|
+
| `nextly` | 0.0.x |
|
|
111
|
+
| `@nextlyhq/admin` | 0.0.x |
|
|
112
112
|
|
|
113
113
|
Plugins can break across minor versions during alpha. Pin exact versions of `nextly`, `@nextlyhq/admin`, and this plugin together.
|
|
114
114
|
|
package/dist/admin/index.d.ts
CHANGED
|
@@ -1,122 +1,114 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { ReactNode } from 'react';
|
|
6
|
-
import 'nextly';
|
|
7
|
-
|
|
1
|
+
import { S as FormNotification, T as FormSettings, _ as FormField, t as AnyFormField, y as FormFieldTypeId } from "../types-BHReIA0j.js";
|
|
2
|
+
import { ComponentPath, DocumentLockGates } from "@nextlyhq/plugin-sdk/admin";
|
|
3
|
+
import React, { JSX, ReactNode } from "react";
|
|
4
|
+
import { FieldTypeCatalogEntry, FormFieldCatalogType } from "nextly/field-catalog";
|
|
8
5
|
interface FormBuilderViewProps {
|
|
6
|
+
id?: string;
|
|
7
|
+
entryId?: string;
|
|
8
|
+
collection?: string;
|
|
9
|
+
collectionSlug?: string;
|
|
10
|
+
isCreating?: boolean;
|
|
11
|
+
initialData?: {
|
|
9
12
|
id?: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
* The strip above this builder says in words that unsaved changes cannot be
|
|
33
|
-
* saved while someone else holds the document. Committing anyway would make
|
|
34
|
-
* that sentence false and would overwrite the holder's row, so the save reads
|
|
35
|
-
* it too.
|
|
36
|
-
*/
|
|
37
|
-
documentLock?: DocumentLockGates;
|
|
13
|
+
name?: string;
|
|
14
|
+
slug?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
status?: "draft" | "published" | "closed";
|
|
17
|
+
closedMessage?: string;
|
|
18
|
+
fields?: unknown[];
|
|
19
|
+
settings?: Record<string, unknown>;
|
|
20
|
+
notifications?: unknown[];
|
|
21
|
+
};
|
|
22
|
+
onSave?: (data: unknown) => void;
|
|
23
|
+
onSuccess?: (entry?: Record<string, unknown>) => void;
|
|
24
|
+
onCancel?: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* What a colleague's claim on this form withholds, handed over by the admin
|
|
27
|
+
* page that renders this view.
|
|
28
|
+
*
|
|
29
|
+
* The strip above this builder says in words that unsaved changes cannot be
|
|
30
|
+
* saved while someone else holds the document. Committing anyway would make
|
|
31
|
+
* that sentence false and would overwrite the holder's row, so the save reads
|
|
32
|
+
* it too.
|
|
33
|
+
*/
|
|
34
|
+
documentLock?: DocumentLockGates;
|
|
38
35
|
}
|
|
39
|
-
declare function FormBuilderView({ id, entryId, collection, collectionSlug, isCreating, initialData, onSave, onSuccess, onCancel, documentLock
|
|
40
|
-
|
|
36
|
+
export declare function FormBuilderView({ id, entryId, collection, collectionSlug, isCreating, initialData, onSave, onSuccess, onCancel, documentLock }: FormBuilderViewProps): JSX.Element;
|
|
41
37
|
interface SubmissionRow {
|
|
38
|
+
id: string;
|
|
39
|
+
form: string | {
|
|
42
40
|
id: string;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
editedAt?: string | null;
|
|
55
|
-
editedBy?: string | null;
|
|
41
|
+
name?: string;
|
|
42
|
+
};
|
|
43
|
+
data: Record<string, unknown>;
|
|
44
|
+
status: string;
|
|
45
|
+
spamReason?: string | null;
|
|
46
|
+
notes?: string | null;
|
|
47
|
+
ipAddress?: string | null;
|
|
48
|
+
userAgent?: string | null;
|
|
49
|
+
submittedAt?: string | null;
|
|
50
|
+
editedAt?: string | null;
|
|
51
|
+
editedBy?: string | null;
|
|
56
52
|
}
|
|
57
53
|
interface FormOption {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
fields: FormField[];
|
|
61
57
|
}
|
|
62
58
|
interface SubmissionsViewProps {
|
|
63
|
-
|
|
59
|
+
collectionSlug?: string;
|
|
64
60
|
}
|
|
65
|
-
declare function SubmissionsView({ collectionSlug }: SubmissionsViewProps):
|
|
66
|
-
|
|
61
|
+
export declare function SubmissionsView({ collectionSlug }: SubmissionsViewProps): JSX.Element;
|
|
67
62
|
interface SubmissionSheetProps {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
submission: SubmissionRow;
|
|
64
|
+
form: FormOption;
|
|
65
|
+
canUpdate: boolean;
|
|
66
|
+
onClose: () => void;
|
|
67
|
+
onPrev?: () => void;
|
|
68
|
+
onNext?: () => void;
|
|
69
|
+
onSave: (changes: Record<string, unknown>) => Promise<void>;
|
|
75
70
|
}
|
|
76
|
-
declare function SubmissionSheet({ submission, form, canUpdate, onClose, onPrev, onNext, onSave
|
|
77
|
-
|
|
71
|
+
export declare function SubmissionSheet({ submission, form, canUpdate, onClose, onPrev, onNext, onSave }: SubmissionSheetProps): JSX.Element;
|
|
78
72
|
interface FieldCardsProps {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Form-surface types the host has NOT excluded (the plugin's field
|
|
75
|
+
* enable/disable option). `null` while the host configuration is still
|
|
76
|
+
* loading — the Add dialog waits rather than flashing the unfiltered set.
|
|
77
|
+
* Types outside this set stay renderable on existing fields but cannot be
|
|
78
|
+
* added.
|
|
79
|
+
*/
|
|
80
|
+
enabledTypes: readonly FormFieldCatalogType[] | null;
|
|
81
|
+
/**
|
|
82
|
+
* Type ids the host disabled (`config.fields[type] === false`). Applied to
|
|
83
|
+
* plugin field types too, so the host exclude layer is not bypassed for
|
|
84
|
+
* contributed types.
|
|
85
|
+
*/
|
|
86
|
+
disabledFieldTypes?: ReadonlySet<string>;
|
|
87
|
+
/** Creates a field of the given type and returns it (context helper). */
|
|
88
|
+
onAddField: (type: FormFieldTypeId) => void;
|
|
95
89
|
}
|
|
96
|
-
declare function FieldCards({ enabledTypes, disabledFieldTypes, onAddField
|
|
97
|
-
|
|
90
|
+
export declare function FieldCards({ enabledTypes, disabledFieldTypes, onAddField }: FieldCardsProps): JSX.Element;
|
|
98
91
|
interface AddFieldDialogProps {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
92
|
+
open: boolean;
|
|
93
|
+
onOpenChange: (open: boolean) => void;
|
|
94
|
+
/**
|
|
95
|
+
* The form surface's catalog — built-ins already filtered by the host's
|
|
96
|
+
* excludes plus any plugin field types that opted into the forms surface;
|
|
97
|
+
* `null` while the host configuration is still loading. `type` is the open
|
|
98
|
+
* `FormFieldTypeId` so a plugin entry shares this shape with the built-ins.
|
|
99
|
+
*/
|
|
100
|
+
entries: readonly FieldTypeCatalogEntry<FormFieldTypeId>[] | null;
|
|
101
|
+
/** Called with the chosen type; the parent creates and selects the field. */
|
|
102
|
+
onAdd: (type: FormFieldTypeId) => void;
|
|
110
103
|
}
|
|
111
|
-
declare function AddFieldDialog({ open, onOpenChange, entries, onAdd
|
|
112
|
-
|
|
104
|
+
export declare function AddFieldDialog({ open, onOpenChange, entries, onAdd }: AddFieldDialogProps): JSX.Element;
|
|
113
105
|
interface FieldEditorProps {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
106
|
+
/** The field being edited (built-in or plugin-contributed). */
|
|
107
|
+
field: AnyFormField;
|
|
108
|
+
/** All fields in the form (for conditional logic references) */
|
|
109
|
+
allFields: AnyFormField[];
|
|
110
|
+
/** Callback when field is updated */
|
|
111
|
+
onUpdate: (updates: Partial<AnyFormField>) => void;
|
|
120
112
|
}
|
|
121
113
|
/**
|
|
122
114
|
* FieldEditor - Field properties configuration panel
|
|
@@ -137,128 +129,125 @@ interface FieldEditorProps {
|
|
|
137
129
|
* />
|
|
138
130
|
* ```
|
|
139
131
|
*/
|
|
140
|
-
declare function FieldEditor({ field, allFields, onUpdate }: FieldEditorProps):
|
|
141
|
-
|
|
132
|
+
export declare function FieldEditor({ field, allFields, onUpdate }: FieldEditorProps): JSX.Element;
|
|
142
133
|
interface FormPreviewProps {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
134
|
+
/** Array of form fields to preview (built-in or plugin-contributed). */
|
|
135
|
+
fields: AnyFormField[];
|
|
136
|
+
/** Form metadata */
|
|
137
|
+
formData?: {
|
|
138
|
+
name?: string;
|
|
139
|
+
slug?: string;
|
|
140
|
+
description?: string;
|
|
141
|
+
};
|
|
151
142
|
}
|
|
152
|
-
declare function FormPreview({ fields, formData }: FormPreviewProps):
|
|
153
|
-
|
|
143
|
+
export declare function FormPreview({ fields, formData }: FormPreviewProps): JSX.Element;
|
|
154
144
|
interface FormBuilderState {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
145
|
+
/** Form fields array */
|
|
146
|
+
fields: AnyFormField[];
|
|
147
|
+
/** Currently selected field ID (name) */
|
|
148
|
+
selectedFieldId: string | null;
|
|
149
|
+
/** Active tab: builder, preview, settings, or notifications */
|
|
150
|
+
activeTab: "builder" | "preview" | "settings" | "notifications";
|
|
151
|
+
/** Whether form has unsaved changes */
|
|
152
|
+
isDirty: boolean;
|
|
153
|
+
/** Form metadata */
|
|
154
|
+
formData: {
|
|
155
|
+
id?: string;
|
|
156
|
+
name: string;
|
|
157
|
+
slug: string;
|
|
158
|
+
description?: string;
|
|
159
|
+
status: "draft" | "published" | "closed";
|
|
160
|
+
/** What a closed form tells a visitor who reaches it. */
|
|
161
|
+
closedMessage?: string;
|
|
162
|
+
};
|
|
163
|
+
/** Form settings */
|
|
164
|
+
settings: FormSettings;
|
|
165
|
+
/** Email notifications */
|
|
166
|
+
notifications: FormNotification[];
|
|
177
167
|
}
|
|
178
168
|
interface FormBuilderActions {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
interface FormBuilderContextValue extends FormBuilderState, FormBuilderActions {
|
|
169
|
+
/** Set all fields */
|
|
170
|
+
setFields: (fields: AnyFormField[]) => void;
|
|
171
|
+
/** Add a new field */
|
|
172
|
+
addField: (field: AnyFormField, index?: number) => void;
|
|
173
|
+
/** Update a field by name */
|
|
174
|
+
updateField: (fieldName: string, updates: Partial<AnyFormField>) => void;
|
|
175
|
+
/** Delete a field by name */
|
|
176
|
+
deleteField: (fieldName: string) => void;
|
|
177
|
+
/** Move a field from one index to another */
|
|
178
|
+
moveField: (fromIndex: number, toIndex: number) => void;
|
|
179
|
+
/** Duplicate a field */
|
|
180
|
+
duplicateField: (fieldName: string) => void;
|
|
181
|
+
/** Select a field */
|
|
182
|
+
selectField: (fieldName: string | null) => void;
|
|
183
|
+
/** Set active tab */
|
|
184
|
+
setActiveTab: (tab: "builder" | "preview" | "settings" | "notifications") => void;
|
|
185
|
+
/** Update form metadata */
|
|
186
|
+
updateFormData: (updates: Partial<FormBuilderState["formData"]>) => void;
|
|
187
|
+
/** Update form settings */
|
|
188
|
+
updateSettings: (updates: Partial<FormSettings>) => void;
|
|
189
|
+
/** Add a notification */
|
|
190
|
+
addNotification: (notification: FormNotification) => void;
|
|
191
|
+
/** Duplicate a notification (the copy starts disabled) */
|
|
192
|
+
duplicateNotification: (id: string) => void;
|
|
193
|
+
/** Update a notification */
|
|
194
|
+
updateNotification: (id: string, updates: Partial<FormNotification>) => void;
|
|
195
|
+
/** Delete a notification */
|
|
196
|
+
deleteNotification: (id: string) => void;
|
|
197
|
+
/** Seed default notifications into an empty list without dirtying the form */
|
|
198
|
+
seedNotifications: (rules: FormNotification[]) => void;
|
|
199
|
+
/** Mark form as saved (clears dirty flag) */
|
|
200
|
+
markAsSaved: () => void;
|
|
213
201
|
}
|
|
202
|
+
interface FormBuilderContextValue extends FormBuilderState, FormBuilderActions {}
|
|
214
203
|
interface FormBuilderProviderProps {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
204
|
+
/** Initial form data (for editing existing forms) */
|
|
205
|
+
initialData?: {
|
|
206
|
+
id?: string;
|
|
207
|
+
name?: string;
|
|
208
|
+
slug?: string;
|
|
209
|
+
description?: string;
|
|
210
|
+
status?: "draft" | "published" | "closed";
|
|
211
|
+
closedMessage?: string;
|
|
212
|
+
fields?: AnyFormField[];
|
|
213
|
+
settings?: Partial<FormSettings>;
|
|
214
|
+
notifications?: FormNotification[];
|
|
215
|
+
};
|
|
216
|
+
/** Child components */
|
|
217
|
+
children: ReactNode;
|
|
218
|
+
/**
|
|
219
|
+
* The document belongs to someone else right now, so nothing here may change
|
|
220
|
+
* it.
|
|
221
|
+
*
|
|
222
|
+
* Held here rather than at each control because the builder has dozens of
|
|
223
|
+
* them across four tabs, and a rule spelled at every one is a rule one new
|
|
224
|
+
* control forgets. Reading is untouched: the editor still browses fields,
|
|
225
|
+
* switches tabs and opens settings, which is exactly what the strip above
|
|
226
|
+
* offers them.
|
|
227
|
+
*/
|
|
228
|
+
readOnly?: boolean;
|
|
240
229
|
}
|
|
241
230
|
/** Default form settings (the canonical defaults from the settings reader) */
|
|
242
|
-
declare const DEFAULT_SETTINGS: FormSettings;
|
|
231
|
+
export declare const DEFAULT_SETTINGS: FormSettings;
|
|
243
232
|
/** Create a new notification rule with default values */
|
|
244
|
-
declare function createNotification(): FormNotification;
|
|
233
|
+
export declare function createNotification(): FormNotification;
|
|
245
234
|
/**
|
|
246
235
|
* Generate a readable unique field name: the type itself for the first
|
|
247
236
|
* field of that type, then a numeric suffix (`email`, `email_2`, ...).
|
|
248
237
|
* Names key submission data, so they should read like keys a developer
|
|
249
238
|
* would have chosen, not timestamps.
|
|
250
239
|
*/
|
|
251
|
-
declare function generateFieldName(type: FormFieldTypeId, existingNames?: readonly string[]): string;
|
|
240
|
+
export declare function generateFieldName(type: FormFieldTypeId, existingNames?: readonly string[]): string;
|
|
252
241
|
/**
|
|
253
242
|
* Generate a human-readable label from field type, using the shared catalog
|
|
254
243
|
* so a new field's default label matches what the picker called the type. A
|
|
255
244
|
* plugin type not in the built-in catalog falls back to a title-cased id.
|
|
256
245
|
*/
|
|
257
|
-
declare function generateFieldLabel(type: FormFieldTypeId): string;
|
|
246
|
+
export declare function generateFieldLabel(type: FormFieldTypeId): string;
|
|
258
247
|
/**
|
|
259
248
|
* Create a new field from a field type with default values.
|
|
260
249
|
*/
|
|
261
|
-
declare function createFieldFromType(type: FormFieldTypeId, existingNames?: readonly string[]): AnyFormField;
|
|
250
|
+
export declare function createFieldFromType(type: FormFieldTypeId, existingNames?: readonly string[]): AnyFormField;
|
|
262
251
|
/**
|
|
263
252
|
* FormBuilderProvider - Provides form builder state to child components
|
|
264
253
|
*
|
|
@@ -272,7 +261,7 @@ declare function createFieldFromType(type: FormFieldTypeId, existingNames?: read
|
|
|
272
261
|
* </FormBuilderProvider>
|
|
273
262
|
* ```
|
|
274
263
|
*/
|
|
275
|
-
declare function FormBuilderProvider({ initialData, children, readOnly
|
|
264
|
+
export declare function FormBuilderProvider({ initialData, children, readOnly }: FormBuilderProviderProps): JSX.Element;
|
|
276
265
|
/**
|
|
277
266
|
* useFormBuilder - Access form builder context
|
|
278
267
|
*
|
|
@@ -300,7 +289,7 @@ declare function FormBuilderProvider({ initialData, children, readOnly, }: FormB
|
|
|
300
289
|
* }
|
|
301
290
|
* ```
|
|
302
291
|
*/
|
|
303
|
-
declare function useFormBuilder(): FormBuilderContextValue;
|
|
292
|
+
export declare function useFormBuilder(): FormBuilderContextValue;
|
|
304
293
|
/**
|
|
305
294
|
* useOptionalFormBuilder - Access form builder context safely
|
|
306
295
|
*
|
|
@@ -309,38 +298,36 @@ declare function useFormBuilder(): FormBuilderContextValue;
|
|
|
309
298
|
*
|
|
310
299
|
* @returns Form builder context value or null
|
|
311
300
|
*/
|
|
312
|
-
declare function useOptionalFormBuilder(): FormBuilderContextValue | null;
|
|
313
|
-
|
|
301
|
+
export declare function useOptionalFormBuilder(): FormBuilderContextValue | null;
|
|
314
302
|
interface SpamDefaults {
|
|
315
|
-
|
|
316
|
-
|
|
303
|
+
honeypot?: boolean;
|
|
304
|
+
recaptchaEnabled?: boolean;
|
|
317
305
|
}
|
|
318
306
|
interface FormSettingsTabProps {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
307
|
+
/** Plugin-level spam defaults (from builder-config); null while loading. */
|
|
308
|
+
spamDefaults: SpamDefaults | null;
|
|
309
|
+
/**
|
|
310
|
+
* Collections a form may redirect to (from builder-config); null while
|
|
311
|
+
* loading. Empty means the site configured none, and the option is not
|
|
312
|
+
* offered — choosing it could only ever produce a form with no destination.
|
|
313
|
+
*/
|
|
314
|
+
redirectCollections: string[] | null;
|
|
315
|
+
/**
|
|
316
|
+
* The configuration request failed, as distinct from returning nothing. An
|
|
317
|
+
* empty list is a valid answer; a failure is not an answer at all, and
|
|
318
|
+
* saying "no collection is configured" on a 403 states something false.
|
|
319
|
+
*/
|
|
320
|
+
redirectConfigFailed: boolean;
|
|
333
321
|
}
|
|
334
|
-
declare function FormSettingsTab({ spamDefaults, redirectCollections, redirectConfigFailed
|
|
335
|
-
|
|
322
|
+
export declare function FormSettingsTab({ spamDefaults, redirectCollections, redirectConfigFailed }: FormSettingsTabProps): React.JSX.Element;
|
|
336
323
|
/** Host-level notification defaults surfaced by the builder-config route. */
|
|
337
324
|
interface NotificationDefaults {
|
|
338
|
-
|
|
339
|
-
|
|
325
|
+
defaultFrom?: string;
|
|
326
|
+
defaultToEmail?: string;
|
|
340
327
|
}
|
|
341
328
|
interface FormNotificationsTabProps {
|
|
342
|
-
|
|
343
|
-
|
|
329
|
+
/** `null` while the builder-config request is still settling. */
|
|
330
|
+
defaults: NotificationDefaults | null;
|
|
344
331
|
}
|
|
345
332
|
/**
|
|
346
333
|
* FormNotificationsTab - the form's notification rules.
|
|
@@ -348,29 +335,10 @@ interface FormNotificationsTabProps {
|
|
|
348
335
|
* Each rule references an existing email provider and template rather than
|
|
349
336
|
* duplicating provider credentials or embedding a second template editor.
|
|
350
337
|
*/
|
|
351
|
-
declare function FormNotificationsTab({ defaults }: FormNotificationsTabProps):
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* Form Builder Admin Components
|
|
355
|
-
*
|
|
356
|
-
* Entry point for admin UI components used by the Nextly admin panel.
|
|
357
|
-
* These components are referenced via component paths in collection configs.
|
|
358
|
-
*
|
|
359
|
-
* Component paths use the format: "@nextlyhq/plugin-form-builder/admin#ExportName"
|
|
360
|
-
*
|
|
361
|
-
* ## Auto-Registration
|
|
362
|
-
*
|
|
363
|
-
* This module automatically registers its components with the admin panel
|
|
364
|
-
* when imported. No manual registration is required - just add the plugin
|
|
365
|
-
* to your Nextly config and the admin will detect and load the components.
|
|
366
|
-
*
|
|
367
|
-
* @module admin
|
|
368
|
-
* @since 0.1.0
|
|
369
|
-
*/
|
|
370
|
-
|
|
338
|
+
export declare function FormNotificationsTab({ defaults }: FormNotificationsTabProps): JSX.Element;
|
|
371
339
|
/** Component path for FormBuilderView */
|
|
372
|
-
declare const FORM_BUILDER_VIEW_PATH: ComponentPath;
|
|
340
|
+
export declare const FORM_BUILDER_VIEW_PATH: ComponentPath;
|
|
373
341
|
/** Component path for SubmissionsView */
|
|
374
|
-
declare const SUBMISSIONS_VIEW_PATH: ComponentPath;
|
|
375
|
-
|
|
376
|
-
|
|
342
|
+
export declare const SUBMISSIONS_VIEW_PATH: ComponentPath;
|
|
343
|
+
export type { AddFieldDialogProps, FieldCardsProps, FieldEditorProps, FormBuilderActions, FormBuilderContextValue, FormBuilderProviderProps, FormBuilderState, FormBuilderViewProps, FormNotification, FormPreviewProps, FormSettings };
|
|
344
|
+
//# sourceMappingURL=index.d.ts.map
|