form-builder-pro 0.0.3 → 0.0.4
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/index.css +8 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4053,6 +4053,7 @@ var NEVER = INVALID;
|
|
|
4053
4053
|
var FormSchemaValidation = external_exports.object({
|
|
4054
4054
|
id: external_exports.string(),
|
|
4055
4055
|
title: external_exports.string(),
|
|
4056
|
+
formName: external_exports.string(),
|
|
4056
4057
|
sections: external_exports.array(external_exports.object({
|
|
4057
4058
|
id: external_exports.string(),
|
|
4058
4059
|
title: external_exports.string(),
|
|
@@ -4127,6 +4128,7 @@ var DEFAULT_FIELD_CONFIG = {
|
|
|
4127
4128
|
var INITIAL_SCHEMA = {
|
|
4128
4129
|
id: "form_1",
|
|
4129
4130
|
title: "My New Form",
|
|
4131
|
+
formName: "myNewForm",
|
|
4130
4132
|
sections: [
|
|
4131
4133
|
{
|
|
4132
4134
|
id: generateId(),
|
|
@@ -25237,7 +25239,7 @@ var FormBuilder = class {
|
|
|
25237
25239
|
className: "flex items-center px-3 py-2 text-sm font-medium text-red-600 hover:bg-red-50 rounded-md transition-colors",
|
|
25238
25240
|
onclick: () => {
|
|
25239
25241
|
if (confirm("Are you sure?")) {
|
|
25240
|
-
formStore.getState().setSchema({ id: "new", title: "New Form", sections: [] });
|
|
25242
|
+
formStore.getState().setSchema({ id: "new", title: "New Form", formName: "newForm", sections: [] });
|
|
25241
25243
|
}
|
|
25242
25244
|
}
|
|
25243
25245
|
}, [getIcon("Trash2", 16), createElement("span", { className: "ml-2", text: "Clear" })]);
|
|
@@ -25287,14 +25289,14 @@ var FormBuilder = class {
|
|
|
25287
25289
|
}
|
|
25288
25290
|
});
|
|
25289
25291
|
const inner = createElement("div", { className: "max-w-3xl mx-auto" });
|
|
25290
|
-
const
|
|
25291
|
-
className: "text-
|
|
25292
|
-
value: state.schema.
|
|
25293
|
-
placeholder: "
|
|
25294
|
-
"data-focus-id": "form-
|
|
25295
|
-
oninput: (e) => formStore.getState().setSchema({ ...state.schema,
|
|
25292
|
+
const formNameInput = createElement("input", {
|
|
25293
|
+
className: "text-lg text-center bg-transparent border-none focus:outline-none focus:ring-0 w-full text-gray-600 dark:text-gray-400 mb-8",
|
|
25294
|
+
value: state.schema.formName,
|
|
25295
|
+
placeholder: "formName (e.g., contactForm)",
|
|
25296
|
+
"data-focus-id": "form-name",
|
|
25297
|
+
oninput: (e) => formStore.getState().setSchema({ ...state.schema, formName: e.target.value })
|
|
25296
25298
|
});
|
|
25297
|
-
inner.appendChild(
|
|
25299
|
+
inner.appendChild(formNameInput);
|
|
25298
25300
|
const sectionsContainer = createElement("div", { className: "space-y-6 min-h-[200px]", id: "sections-list" });
|
|
25299
25301
|
state.schema.sections.forEach((section) => {
|
|
25300
25302
|
const sectionEl = createElement("div", {
|