@nextlyhq/plugin-form-builder 0.0.2-alpha.26 → 0.0.2-alpha.28

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.
@@ -64,7 +64,7 @@ function EmailFieldEditor({
64
64
  type: "text",
65
65
  value: field.placeholder || "",
66
66
  onChange: (e) => onUpdate({ placeholder: e.target.value }),
67
- placeholder: "email@example.com"
67
+ placeholder: "email@nextly.local"
68
68
  }
69
69
  )
70
70
  ] }),
@@ -107,7 +107,7 @@ function EmailFieldEditor({
107
107
  type: "text",
108
108
  value: field.validation?.pattern || "",
109
109
  onChange: (e) => updateValidation("pattern", e.target.value || void 0),
110
- placeholder: ".*@company\\.com$",
110
+ placeholder: ".*@nextly\\.local$",
111
111
  className: "email-field-editor__input--mono"
112
112
  }
113
113
  ),
@@ -135,4 +135,4 @@ export {
135
135
  EmailFieldEditor,
136
136
  EmailFieldEditor_default as default
137
137
  };
138
- //# sourceMappingURL=EmailFieldEditor-MMOXXL7P.js.map
138
+ //# sourceMappingURL=EmailFieldEditor-ZZ4VSKKB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/admin/fields/EmailFieldEditor.tsx"],"sourcesContent":["/**\n * Email Field Editor\n *\n * Editor component for configuring email field properties.\n * Includes general settings (label, name, placeholder, required) and\n * validation options (pattern, error message).\n *\n * Email validation is automatic - the browser enforces email format.\n * Custom pattern allows additional restrictions (e.g., corporate domains only).\n *\n * @module admin/fields/EmailFieldEditor\n * @since 0.1.0\n */\n\n\"use client\";\n\nimport { Input } from \"@nextlyhq/ui\";\n\nimport type { EmailFormField } from \"../../types\";\n\nimport type { FieldEditorProps } from \"./index\";\n\n// ============================================================================\n// Main Component\n// ============================================================================\n\n/**\n * EmailFieldEditor - Configure email field properties\n *\n * Provides configuration options for:\n * - Label: Display text shown above the field\n * - Field Name: Key used in submission data (auto-formatted)\n * - Placeholder: Hint text shown when field is empty\n * - Help Text: Additional guidance shown below the field\n * - Required: Whether the field must be filled\n * - Validation: pattern (optional extra regex), error message\n *\n * Note: Basic email format validation is automatic via HTML5 email input type.\n *\n * @example\n * ```tsx\n * <EmailFieldEditor\n * field={emailField}\n * allFields={formFields}\n * onUpdate={(updates) => handleUpdate(updates)}\n * />\n * ```\n */\nexport function EmailFieldEditor({\n field,\n onUpdate,\n}: FieldEditorProps<EmailFormField>) {\n // Helper to update validation properties\n const updateValidation = (key: string, value: unknown) => {\n onUpdate({\n validation: {\n ...field.validation,\n [key]: value,\n },\n });\n };\n\n return (\n <div className=\"email-field-editor\">\n {/* General Settings Section */}\n <div className=\"email-field-editor__section\">\n <h4 className=\"email-field-editor__section-title\">General</h4>\n\n {/* Label */}\n <div className=\"email-field-editor__field\">\n <label className=\"email-field-editor__label\" htmlFor=\"field-label\">\n Label\n </label>\n <Input\n id=\"field-label\"\n type=\"text\"\n value={field.label || \"\"}\n onChange={e => onUpdate({ label: e.target.value })}\n placeholder=\"Enter field label\"\n />\n </div>\n\n {/* Field Name */}\n <div className=\"email-field-editor__field\">\n <label className=\"email-field-editor__label\" htmlFor=\"field-name\">\n Field Name\n </label>\n <Input\n id=\"field-name\"\n type=\"text\"\n value={field.name || \"\"}\n onChange={e =>\n onUpdate({\n name: e.target.value\n .replace(/\\s+/g, \"_\")\n .replace(/[^a-zA-Z0-9_]/g, \"\")\n .toLowerCase(),\n })\n }\n placeholder=\"field_name\"\n className=\"email-field-editor__input--mono\"\n />\n <p className=\"email-field-editor__hint\">\n Used as the key in submission data. Only letters, numbers, and\n underscores.\n </p>\n </div>\n\n {/* Placeholder */}\n <div className=\"email-field-editor__field\">\n <label\n className=\"email-field-editor__label\"\n htmlFor=\"field-placeholder\"\n >\n Placeholder\n </label>\n <Input\n id=\"field-placeholder\"\n type=\"text\"\n value={field.placeholder || \"\"}\n onChange={e => onUpdate({ placeholder: e.target.value })}\n placeholder=\"email@nextly.local\"\n />\n </div>\n\n {/* Help Text */}\n <div className=\"email-field-editor__field\">\n <label className=\"email-field-editor__label\" htmlFor=\"field-help\">\n Help Text\n </label>\n <Input\n id=\"field-help\"\n type=\"text\"\n value={field.helpText || \"\"}\n onChange={e => onUpdate({ helpText: e.target.value })}\n placeholder=\"Additional guidance for users\"\n />\n <p className=\"email-field-editor__hint\">Displayed below the field</p>\n </div>\n\n {/* Required */}\n <div className=\"email-field-editor__field email-field-editor__field--inline\">\n <label className=\"email-field-editor__checkbox-label\">\n <input\n type=\"checkbox\"\n checked={field.required || false}\n onChange={e => onUpdate({ required: e.target.checked })}\n className=\"email-field-editor__checkbox\"\n />\n <span>Required field</span>\n </label>\n </div>\n </div>\n\n {/* Validation Section */}\n <div className=\"email-field-editor__section\">\n <h4 className=\"email-field-editor__section-title\">Validation</h4>\n\n {/* Info about automatic validation */}\n <div className=\"email-field-editor__info\">\n <p className=\"email-field-editor__info-text\">\n Email format validation is automatic. Use the pattern field below\n for additional restrictions (e.g., corporate domains only).\n </p>\n </div>\n\n {/* Pattern */}\n <div className=\"email-field-editor__field\">\n <label className=\"email-field-editor__label\" htmlFor=\"field-pattern\">\n Pattern (Regex)\n </label>\n <Input\n id=\"field-pattern\"\n type=\"text\"\n value={field.validation?.pattern || \"\"}\n onChange={e =>\n updateValidation(\"pattern\", e.target.value || undefined)\n }\n placeholder=\".*@nextly\\.local$\"\n className=\"email-field-editor__input--mono\"\n />\n <p className=\"email-field-editor__hint\">\n Optional: Additional regex pattern (e.g., restrict to specific\n domains)\n </p>\n </div>\n\n {/* Error Message */}\n <div className=\"email-field-editor__field\">\n <label className=\"email-field-editor__label\" htmlFor=\"field-error\">\n Error Message\n </label>\n <Input\n id=\"field-error\"\n type=\"text\"\n value={field.validation?.errorMessage || \"\"}\n onChange={e =>\n updateValidation(\"errorMessage\", e.target.value || undefined)\n }\n placeholder=\"Please enter a valid email address\"\n />\n <p className=\"email-field-editor__hint\">\n Custom message shown when validation fails\n </p>\n </div>\n </div>\n </div>\n );\n}\n\nexport default EmailFieldEditor;\n"],"mappings":";;;AAgBA,SA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MAAS;AAAA,YAEzD,aAAY;AAAA,YACZ,WAAU;AAAA;AAAA,QACZ;AAAA,QACA,oBAAC,OAAE,WAAU,4BAA2B,qFAGxC;AAAA,SACF;AAAA,MAGA,qBAAC,SAAI,WAAU,6BACb;AAAA,4BAAC,WAAM,WAAU,6BAA4B,SAAQ,eAAc,2BAEnE;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,IAAG;AAAA,YACH,MAAK;AAAA,YACL,OAAO,MAAM,YAAY,gBAAgB;AAAA,YACzC,UAAU,OACR,iBAAiB,gBAAgB,EAAE,OAAO,SAAS,MAAS;AAAA,YAE9D,aAAY;AAAA;AAAA,QACd;AAAA,QACA,oBAAC,OAAE,WAAU,4BAA2B,wDAExC;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAEJ;AAEA,IAAO,2BAAQ;","names":[]}
@@ -2164,7 +2164,7 @@ function IntegrationModal({
2164
2164
  type: "email",
2165
2165
  value: form.senderEmail ?? "",
2166
2166
  onChange: (e) => update("senderEmail", e.target.value || void 0),
2167
- placeholder: "noreply@example.com"
2167
+ placeholder: "noreply@nextly.local"
2168
2168
  }
2169
2169
  ),
2170
2170
  /* @__PURE__ */ jsx7("p", { className: "text-xs text-muted-foreground", children: "Leave blank to use the provider's default configured address." })
@@ -2213,7 +2213,7 @@ function IntegrationModal({
2213
2213
  type: "email",
2214
2214
  value: form.to,
2215
2215
  onChange: (e) => update("to", e.target.value),
2216
- placeholder: "admin@example.com"
2216
+ placeholder: "admin@nextly.local"
2217
2217
  }
2218
2218
  )
2219
2219
  ] })
@@ -2268,7 +2268,7 @@ function IntegrationModal({
2268
2268
  addCc();
2269
2269
  }
2270
2270
  },
2271
- placeholder: "cc@example.com"
2271
+ placeholder: "cc@nextly.local"
2272
2272
  }
2273
2273
  ),
2274
2274
  /* @__PURE__ */ jsx7(
@@ -2333,7 +2333,7 @@ function IntegrationModal({
2333
2333
  addBcc();
2334
2334
  }
2335
2335
  },
2336
- placeholder: "bcc@example.com"
2336
+ placeholder: "bcc@nextly.local"
2337
2337
  }
2338
2338
  ),
2339
2339
  /* @__PURE__ */ jsx7(
@@ -3458,11 +3458,11 @@ var FIELD_TYPES2 = [
3458
3458
  icon: "Mail",
3459
3459
  description: "Email address with validation",
3460
3460
  category: "core",
3461
- EditorComponent: () => import("../EmailFieldEditor-MMOXXL7P.js"),
3461
+ EditorComponent: () => import("../EmailFieldEditor-ZZ4VSKKB.js"),
3462
3462
  defaultConfig: {
3463
3463
  type: "email",
3464
3464
  label: "Email",
3465
- placeholder: "email@example.com",
3465
+ placeholder: "email@nextly.local",
3466
3466
  required: false
3467
3467
  }
3468
3468
  },