@nextlyhq/plugin-form-builder 0.0.2-alpha.3 → 0.0.2-alpha.30

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":[]}
@@ -1,7 +1,7 @@
1
- import { ComponentPath } from '@nextlyhq/admin/lib/component-registry';
1
+ import { ComponentPath } from '@nextlyhq/plugin-sdk/admin';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
- import { i as FormField, p as FormFieldType } from '../index-C0kBvYjm.js';
4
- export { J as SubmissionDetail, t as SubmissionDetailProps, K as SubmissionList, u as SubmissionListProps } from '../index-C0kBvYjm.js';
3
+ import { i as FormField, p as FormFieldType } from '../index-BRumOEsE.js';
4
+ export { J as SubmissionDetail, t as SubmissionDetailProps, K as SubmissionList, u as SubmissionListProps } from '../index-BRumOEsE.js';
5
5
  import { ReactNode } from 'react';
6
6
  import 'nextly';
7
7
 
@@ -528,20 +528,5 @@ declare function FormNotificationsTab(): react_jsx_runtime.JSX.Element;
528
528
  declare const FORM_BUILDER_VIEW_PATH: ComponentPath;
529
529
  /** Component path for SubmissionsFilter */
530
530
  declare const SUBMISSIONS_FILTER_PATH: ComponentPath;
531
- /**
532
- * Register Form Builder admin components with the Nextly admin panel.
533
- *
534
- * @deprecated This function is no longer needed. Components are auto-registered
535
- * when the admin detects the Form Builder plugin's component paths in collection configs.
536
- *
537
- * @example
538
- * ```typescript
539
- * // No manual registration needed! Just add the plugin to your config:
540
- * export default defineConfig({
541
- * plugins: [formBuilderPlugin.plugin],
542
- * });
543
- * ```
544
- */
545
- declare function registerFormBuilderAdminComponents(): void;
546
531
 
547
- export { AddFieldButton, type AddFieldButtonProps, DEFAULT_SETTINGS, FORM_BUILDER_VIEW_PATH, FieldEditor, FieldEditorPanel, type FieldEditorPanelProps, type FieldEditorProps, FieldLibrary, type FormBuilderActions, type FormBuilderContextValue, FormBuilderProvider, type FormBuilderProviderProps, type FormBuilderState, FormBuilderView, type FormBuilderViewProps, FormCanvas, type FormCanvasProps, FormFieldList, type FormFieldListProps, type FormNotification, FormNotificationsTab, FormPreview, type FormPreviewProps, type FormSettings, FormSettingsTab, SUBMISSIONS_FILTER_PATH, SortableFieldRow, type SortableFieldRowProps, SubmissionsFilter, type SubmissionsFilterProps, createFieldFromType, createNotification, generateFieldLabel, generateFieldName, registerFormBuilderAdminComponents, useFormBuilder, useOptionalFormBuilder };
532
+ export { AddFieldButton, type AddFieldButtonProps, DEFAULT_SETTINGS, FORM_BUILDER_VIEW_PATH, FieldEditor, FieldEditorPanel, type FieldEditorPanelProps, type FieldEditorProps, FieldLibrary, type FormBuilderActions, type FormBuilderContextValue, FormBuilderProvider, type FormBuilderProviderProps, type FormBuilderState, FormBuilderView, type FormBuilderViewProps, FormCanvas, type FormCanvasProps, FormFieldList, type FormFieldListProps, type FormNotification, FormNotificationsTab, FormPreview, type FormPreviewProps, type FormSettings, FormSettingsTab, SUBMISSIONS_FILTER_PATH, SortableFieldRow, type SortableFieldRowProps, SubmissionsFilter, type SubmissionsFilterProps, createFieldFromType, createNotification, generateFieldLabel, generateFieldName, useFormBuilder, useOptionalFormBuilder };
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  registerComponents,
9
9
  registerKnownPlugin
10
- } from "@nextlyhq/admin/lib/component-registry";
10
+ } from "@nextlyhq/plugin-sdk/admin";
11
11
 
12
12
  // src/admin/components/SubmissionsFilter.tsx
13
13
  import { useRouter, useSearchParams } from "next/navigation";
@@ -128,8 +128,8 @@ import { useQueryClient } from "@tanstack/react-query";
128
128
  import { useCallback as useCallback6, useState as useState6 } from "react";
129
129
 
130
130
  // src/admin/components/builder/FieldEditor.tsx
131
- import { FormLabelWithTooltip as FormLabelWithTooltip2 } from "@nextlyhq/admin";
132
131
  import {
132
+ FormLabelWithTooltip as FormLabelWithTooltip2,
133
133
  Input as Input2,
134
134
  Button as Button2,
135
135
  Checkbox as Checkbox2,
@@ -146,8 +146,8 @@ import {
146
146
  import { useState as useState2, useCallback as useCallback3, useMemo as useMemo2 } from "react";
147
147
 
148
148
  // src/admin/components/builder/ConditionalLogicEditor.tsx
149
- import { FormLabelWithTooltip } from "@nextlyhq/admin";
150
149
  import {
150
+ FormLabelWithTooltip,
151
151
  Input,
152
152
  Button,
153
153
  Checkbox,
@@ -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
  },
@@ -3981,11 +3981,6 @@ function FieldEditorPanel({
3981
3981
  // src/admin/index.ts
3982
3982
  var FORM_BUILDER_VIEW_PATH = "@nextlyhq/plugin-form-builder/admin#FormBuilderView";
3983
3983
  var SUBMISSIONS_FILTER_PATH = "@nextlyhq/plugin-form-builder/admin#SubmissionsFilter";
3984
- function registerFormBuilderAdminComponents() {
3985
- registerComponents({
3986
- [FORM_BUILDER_VIEW_PATH]: FormBuilderView
3987
- });
3988
- }
3989
3984
  registerComponents({
3990
3985
  [FORM_BUILDER_VIEW_PATH]: FormBuilderView,
3991
3986
  [SUBMISSIONS_FILTER_PATH]: SubmissionsFilter
@@ -4023,7 +4018,6 @@ export {
4023
4018
  createNotification,
4024
4019
  generateFieldLabel,
4025
4020
  generateFieldName,
4026
- registerFormBuilderAdminComponents,
4027
4021
  useFormBuilder,
4028
4022
  useOptionalFormBuilder
4029
4023
  };