@nextlyhq/plugin-form-builder 0.0.2-alpha.75 → 0.0.2-alpha.76
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/admin/index.d.ts +38 -24
- package/dist/admin/index.js +9155 -6116
- package/dist/admin/index.js.map +1 -1
- package/dist/index.d.ts +35 -5
- package/dist/index.js +2790 -263
- package/dist/index.js.map +1 -1
- package/dist/{field-references-oCuFEwkr.js → submission-title-CVixn15Z.js} +715 -66
- package/dist/submission-title-CVixn15Z.js.map +1 -0
- package/dist/{new-submissions-DGiIhdBF.d.ts → types-XdBrUfi1.d.ts} +108 -41
- package/package.json +10 -10
- package/dist/field-references-oCuFEwkr.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as NumberFormField, B as ValidationRules, C as FormHooks, D as FormSettings, E as FormNotifications, F as SubmissionDocument, G as isFormFieldType, H as isEmailFormField, I as TextFormField, J as isTextFormField, K as isKnownFormField, L as TextareaFormField, M as RadioFormField, N as ResolvedFormBuilderConfig, O as FormSubmission, P as SelectFormField, R as TimeFormField, S as FormHookContext, T as FormNotificationItem, U as isFileFormField, V as isCheckboxFormField, W as isFormField, X as NewSubmissionRow, Y as NEW_SUBMISSIONS_WIDGET_ID, Z as NewSubmissionsData, _ as FormConfig, a as ConditionalLogic, b as FormFieldType, c as ConsentFormField, d as EmailConfig, f as EmailFormField, g as FormBuilderPluginOptions, h as FormAccess, i as CheckboxFormField, j as PhoneFormField, k as HiddenFormField, l as CustomFormField, m as FileFormField, n as BUILT_IN_FORM_FIELD_TYPES, o as ConditionalLogicCondition, p as FieldBlockConfig, q as isSelectFormField, r as BaseFormField, s as ConsentAnswer, t as AnyFormField, u as DateFormField, v as FormDocument, w as FormNotification, x as FormFieldTypeId, y as FormField, z as UrlFormField } from "./types-XdBrUfi1.js";
|
|
2
2
|
import { PluginDefinition } from "@nextlyhq/plugin-sdk";
|
|
3
3
|
import { CollectionConfig, PluginContext } from "nextly";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -47,7 +47,7 @@ export declare function getFormBuilderConfig(nextly: unknown): ResolvedFormBuild
|
|
|
47
47
|
* Error codes for form validation failures.
|
|
48
48
|
* Used for programmatic error handling.
|
|
49
49
|
*/
|
|
50
|
-
type FormValidationErrorCode = "SLUG_REQUIRED" | "SLUG_INVALID_TYPE" | "SLUG_TOO_SHORT" | "SLUG_TOO_LONG" | "SLUG_INVALID_FORMAT" | "SLUG_RESERVED" | "FIELDS_REQUIRED" | "FIELDS_INVALID_TYPE" | "FIELDS_EMPTY" | "FIELD_NAME_REQUIRED" | "FIELD_NAME_INVALID_FORMAT" | "FIELD_NAME_DUPLICATE" | "FIELD_TYPE_REQUIRED" | "FIELD_TYPE_INVALID" | "FIELD_LABEL_REQUIRED" | "OPTIONS_REQUIRED" | "OPTIONS_EMPTY" | "MIN_GREATER_THAN_MAX" | "MIN_LENGTH_GREATER_THAN_MAX" | "FILE_MAX_SIZE_INVALID" | "CONDITIONS_REQUIRED" | "CONDITION_FIELD_REQUIRED" | "CONDITION_COMPARISON_REQUIRED" | "SETTINGS_INVALID_TYPE" | "REDIRECT_URL_REQUIRED" | "REDIRECT_PAGE_REQUIRED" | "ACCESS_INVALID_TYPE" | "ACCESS_FUNCTION_INVALID";
|
|
50
|
+
type FormValidationErrorCode = "SLUG_REQUIRED" | "SLUG_INVALID_TYPE" | "SLUG_TOO_SHORT" | "SLUG_TOO_LONG" | "SLUG_INVALID_FORMAT" | "SLUG_RESERVED" | "FIELDS_REQUIRED" | "FIELDS_INVALID_TYPE" | "FIELDS_EMPTY" | "FIELD_NAME_REQUIRED" | "FIELD_NAME_INVALID_FORMAT" | "FIELD_NAME_DUPLICATE" | "FIELD_TYPE_REQUIRED" | "FIELD_TYPE_INVALID" | "FIELD_LABEL_REQUIRED" | "OPTIONS_REQUIRED" | "OPTIONS_EMPTY" | "MIN_GREATER_THAN_MAX" | "MIN_LENGTH_GREATER_THAN_MAX" | "FILE_MAX_SIZE_INVALID" | "CONSENT_TEXT_REQUIRED" | "CONDITIONS_REQUIRED" | "CONDITION_FIELD_REQUIRED" | "CONDITION_COMPARISON_REQUIRED" | "SETTINGS_INVALID_TYPE" | "REDIRECT_URL_REQUIRED" | "REDIRECT_PAGE_REQUIRED" | "ACCESS_INVALID_TYPE" | "ACCESS_FUNCTION_INVALID";
|
|
51
51
|
/**
|
|
52
52
|
* A single validation error with path and context.
|
|
53
53
|
*
|
|
@@ -649,6 +649,27 @@ export declare const time: (config: Omit<TimeFormField, "type">) => TimeFormFiel
|
|
|
649
649
|
* ```
|
|
650
650
|
*/
|
|
651
651
|
export declare const hidden: (config: Omit<HiddenFormField, "type">) => HiddenFormField;
|
|
652
|
+
/**
|
|
653
|
+
* Creates a consent field configuration.
|
|
654
|
+
*
|
|
655
|
+
* A box the visitor ticks to agree to `agreementText`. It is always required,
|
|
656
|
+
* and the stored answer keeps the text the visitor was shown, so a later
|
|
657
|
+
* change to the text leaves what earlier visitors agreed to as it was. Staff
|
|
658
|
+
* can never edit a submitted consent.
|
|
659
|
+
*
|
|
660
|
+
* @param config - Field configuration without the `type` property
|
|
661
|
+
* @returns Complete consent field configuration
|
|
662
|
+
*
|
|
663
|
+
* @example
|
|
664
|
+
* ```typescript
|
|
665
|
+
* consent({
|
|
666
|
+
* name: 'privacy',
|
|
667
|
+
* label: 'Privacy',
|
|
668
|
+
* agreementText: 'I agree to the privacy policy',
|
|
669
|
+
* })
|
|
670
|
+
* ```
|
|
671
|
+
*/
|
|
672
|
+
export declare const consent: (config: Omit<ConsentFormField, "type" | "required">) => ConsentFormField;
|
|
652
673
|
/**
|
|
653
674
|
* Comparison operators supported by the conditional logic system.
|
|
654
675
|
*/
|
|
@@ -887,12 +908,15 @@ interface ExportedJSON {
|
|
|
887
908
|
* formatExportValue(new Date(), { type: 'date' }); // "2024-01-15"
|
|
888
909
|
* ```
|
|
889
910
|
*/
|
|
890
|
-
export declare function formatExportValue(value: unknown, field?:
|
|
911
|
+
export declare function formatExportValue(value: unknown, field?: {
|
|
912
|
+
readonly type: string;
|
|
913
|
+
}): string;
|
|
891
914
|
/**
|
|
892
915
|
* Export submissions to CSV format.
|
|
893
916
|
*
|
|
894
917
|
* Generates an RFC 4180 compliant CSV string with:
|
|
895
|
-
* - Form field values as columns (in form definition order)
|
|
918
|
+
* - Form field values as columns (in form definition order), headed by the
|
|
919
|
+
* fields' labels, a choice answer by its option's label
|
|
896
920
|
* - Optional metadata columns at the end (_id, _status, _submittedAt, etc.)
|
|
897
921
|
* - Proper escaping of special characters
|
|
898
922
|
* - Optional UTF-8 BOM for Excel compatibility
|
|
@@ -1011,6 +1035,12 @@ interface SubmitFormOptions {
|
|
|
1011
1035
|
ipAddress?: string;
|
|
1012
1036
|
/** Submitter's user agent string */
|
|
1013
1037
|
userAgent?: string;
|
|
1038
|
+
/**
|
|
1039
|
+
* The page it was sent from, such as the request's `Referer`. Kept as
|
|
1040
|
+
* its origin and path only, and only when it is a web page
|
|
1041
|
+
* (`pageFromReferer`).
|
|
1042
|
+
*/
|
|
1043
|
+
page?: string;
|
|
1014
1044
|
};
|
|
1015
1045
|
/**
|
|
1016
1046
|
* The HTTP request this submission arrived on.
|
|
@@ -1391,5 +1421,5 @@ interface ExtendedCollectionConfig extends Omit<CollectionConfig, "admin"> {
|
|
|
1391
1421
|
*/
|
|
1392
1422
|
export declare function submissionsCollection(pluginConfig: ResolvedFormBuilderConfig): ExtendedCollectionConfig;
|
|
1393
1423
|
export declare const formBuilderPlugin: ReturnType<typeof formBuilder>["plugin"];
|
|
1394
|
-
export { type AnyFormField, BUILT_IN_FORM_FIELD_TYPES, type BaseFormField, type CSVExportOptions, type CheckboxFormField, type ComparisonOperator, type ConditionalLogic, type ConditionalLogicCondition, type CustomFormField, type DateFormField, type EmailConfig, type EmailFormField, type ExportedJSON, type FieldBlockConfig, type FileFormField, type FormAccess, type FormBuilderPluginOptions, type FormBuilderPluginResult, type FormConfig, type FormDocument, type FormField, type FormFieldOption, type FormFieldType, type FormFieldTypeId, type FormHookContext, type FormHooks, type FormNotification, type FormNotificationItem, type FormNotifications, type FormSettings, type FormSubmission, type FormValidationError, type FormValidationErrorCode, type FormValidationResult, type HiddenFormField, type JSONExportOptions, NEW_SUBMISSIONS_WIDGET_ID, type NewSubmissionRow, type NewSubmissionsData, type NextlyPlugin, type NumberFormField, type PhoneFormField, type RadioFormField, type ResolvedFormBuilderConfig, type SelectFormField, type SpamCheckConfig, type SpamCheckOptions, type SpamCheckResult, type SubmissionDocument, type SubmitFormContext, type SubmitFormOptions, type SubmitFormResult, type TextFormField, type TextareaFormField, type TimeFormField, type UrlFormField, type ValidationRules, isCheckboxFormField, isEmailFormField, isFileFormField, isFormField, isFormFieldType, isKnownFormField, isSelectFormField, isTextFormField };
|
|
1424
|
+
export { type AnyFormField, BUILT_IN_FORM_FIELD_TYPES, type BaseFormField, type CSVExportOptions, type CheckboxFormField, type ComparisonOperator, type ConditionalLogic, type ConditionalLogicCondition, type ConsentAnswer, type ConsentFormField, type CustomFormField, type DateFormField, type EmailConfig, type EmailFormField, type ExportedJSON, type FieldBlockConfig, type FileFormField, type FormAccess, type FormBuilderPluginOptions, type FormBuilderPluginResult, type FormConfig, type FormDocument, type FormField, type FormFieldOption, type FormFieldType, type FormFieldTypeId, type FormHookContext, type FormHooks, type FormNotification, type FormNotificationItem, type FormNotifications, type FormSettings, type FormSubmission, type FormValidationError, type FormValidationErrorCode, type FormValidationResult, type HiddenFormField, type JSONExportOptions, NEW_SUBMISSIONS_WIDGET_ID, type NewSubmissionRow, type NewSubmissionsData, type NextlyPlugin, type NumberFormField, type PhoneFormField, type RadioFormField, type ResolvedFormBuilderConfig, type SelectFormField, type SpamCheckConfig, type SpamCheckOptions, type SpamCheckResult, type SubmissionDocument, type SubmitFormContext, type SubmitFormOptions, type SubmitFormResult, type TextFormField, type TextareaFormField, type TimeFormField, type UrlFormField, type ValidationRules, isCheckboxFormField, isEmailFormField, isFileFormField, isFormField, isFormFieldType, isKnownFormField, isSelectFormField, isTextFormField };
|
|
1395
1425
|
//# sourceMappingURL=index.d.ts.map
|