form-builder-pro 1.3.0 → 1.3.1
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 +29 -21
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -863,21 +863,21 @@ body {
|
|
|
863
863
|
.inset-0 {
|
|
864
864
|
inset: 0px;
|
|
865
865
|
}
|
|
866
|
-
.right-1 {
|
|
867
|
-
right: 0.25rem;
|
|
868
|
-
}
|
|
869
866
|
.right-2 {
|
|
870
867
|
right: 0.5rem;
|
|
871
868
|
}
|
|
872
|
-
.right-
|
|
873
|
-
right:
|
|
869
|
+
.right-8 {
|
|
870
|
+
right: 2rem;
|
|
874
871
|
}
|
|
875
|
-
.
|
|
876
|
-
|
|
872
|
+
.right-\[16\%\] {
|
|
873
|
+
right: 16%;
|
|
877
874
|
}
|
|
878
875
|
.top-2 {
|
|
879
876
|
top: 0.5rem;
|
|
880
877
|
}
|
|
878
|
+
.top-\[6px\] {
|
|
879
|
+
top: 6px;
|
|
880
|
+
}
|
|
881
881
|
.z-10 {
|
|
882
882
|
z-index: 10;
|
|
883
883
|
}
|
|
@@ -1005,9 +1005,6 @@ body {
|
|
|
1005
1005
|
.min-h-\[100px\] {
|
|
1006
1006
|
min-height: 100px;
|
|
1007
1007
|
}
|
|
1008
|
-
.min-h-\[120px\] {
|
|
1009
|
-
min-height: 120px;
|
|
1010
|
-
}
|
|
1011
1008
|
.min-h-\[200px\] {
|
|
1012
1009
|
min-height: 200px;
|
|
1013
1010
|
}
|
|
@@ -1035,6 +1032,9 @@ body {
|
|
|
1035
1032
|
.w-8 {
|
|
1036
1033
|
width: 2rem;
|
|
1037
1034
|
}
|
|
1035
|
+
.w-\[256px\] {
|
|
1036
|
+
width: 256px;
|
|
1037
|
+
}
|
|
1038
1038
|
.w-\[300px\] {
|
|
1039
1039
|
width: 300px;
|
|
1040
1040
|
}
|
|
@@ -1044,8 +1044,8 @@ body {
|
|
|
1044
1044
|
.max-w-2xl {
|
|
1045
1045
|
max-width: 42rem;
|
|
1046
1046
|
}
|
|
1047
|
-
.max-w-\[
|
|
1048
|
-
max-width:
|
|
1047
|
+
.max-w-\[140px\] {
|
|
1048
|
+
max-width: 140px;
|
|
1049
1049
|
}
|
|
1050
1050
|
.max-w-full {
|
|
1051
1051
|
max-width: 100%;
|
|
@@ -1254,17 +1254,10 @@ body {
|
|
|
1254
1254
|
--tw-bg-opacity: 1;
|
|
1255
1255
|
background-color: rgb(1 159 162 / var(--tw-bg-opacity, 1));
|
|
1256
1256
|
}
|
|
1257
|
-
.bg-\[\#3b497e\] {
|
|
1258
|
-
--tw-bg-opacity: 1;
|
|
1259
|
-
background-color: rgb(59 73 126 / var(--tw-bg-opacity, 1));
|
|
1260
|
-
}
|
|
1261
1257
|
.bg-\[\#635bff\] {
|
|
1262
1258
|
--tw-bg-opacity: 1;
|
|
1263
1259
|
background-color: rgb(99 91 255 / var(--tw-bg-opacity, 1));
|
|
1264
1260
|
}
|
|
1265
|
-
.bg-\[\#847dff1a\] {
|
|
1266
|
-
background-color: #847dff1a;
|
|
1267
|
-
}
|
|
1268
1261
|
.bg-\[\#e7e7ff\] {
|
|
1269
1262
|
--tw-bg-opacity: 1;
|
|
1270
1263
|
background-color: rgb(231 231 255 / var(--tw-bg-opacity, 1));
|
|
@@ -1331,8 +1324,8 @@ body {
|
|
|
1331
1324
|
.p-8 {
|
|
1332
1325
|
padding: 2rem;
|
|
1333
1326
|
}
|
|
1334
|
-
.p-\[
|
|
1335
|
-
padding:
|
|
1327
|
+
.p-\[2px\] {
|
|
1328
|
+
padding: 2px;
|
|
1336
1329
|
}
|
|
1337
1330
|
.px-1 {
|
|
1338
1331
|
padding-left: 0.25rem;
|
|
@@ -1757,6 +1750,16 @@ input[type="radio"]:checked::after {
|
|
|
1757
1750
|
background-color: rgb(1 138 141 / var(--tw-bg-opacity, 1));
|
|
1758
1751
|
}
|
|
1759
1752
|
|
|
1753
|
+
.hover\:bg-\[\#635bff\]:hover {
|
|
1754
|
+
--tw-bg-opacity: 1;
|
|
1755
|
+
background-color: rgb(99 91 255 / var(--tw-bg-opacity, 1));
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
.hover\:bg-\[\#ef2f2f\]:hover {
|
|
1759
|
+
--tw-bg-opacity: 1;
|
|
1760
|
+
background-color: rgb(239 47 47 / var(--tw-bg-opacity, 1));
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1760
1763
|
.hover\:bg-blue-200:hover {
|
|
1761
1764
|
--tw-bg-opacity: 1;
|
|
1762
1765
|
background-color: rgb(191 219 254 / var(--tw-bg-opacity, 1));
|
|
@@ -1821,6 +1824,11 @@ input[type="radio"]:checked::after {
|
|
|
1821
1824
|
color: rgb(239 68 68 / var(--tw-text-opacity, 1));
|
|
1822
1825
|
}
|
|
1823
1826
|
|
|
1827
|
+
.hover\:text-white:hover {
|
|
1828
|
+
--tw-text-opacity: 1;
|
|
1829
|
+
color: rgb(255 255 255 / var(--tw-text-opacity, 1));
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1824
1832
|
.hover\:shadow-sm:hover {
|
|
1825
1833
|
--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
1826
1834
|
--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
|
package/dist/index.js
CHANGED
|
@@ -6279,7 +6279,7 @@ var FieldRenderer = class {
|
|
|
6279
6279
|
const MAX_SIZE_BYTES = MAX_SIZE_MB * 1024 * 1024;
|
|
6280
6280
|
const container = createElement("div", { className: "image-field-wrapper flex flex-col gap-3 w-full" });
|
|
6281
6281
|
const previewWrap = createElement("div", {
|
|
6282
|
-
className: "relative rounded-md border border-input bg-gray-50 dark:bg-gray-800 overflow-hidden min-h-[
|
|
6282
|
+
className: "relative rounded-md border border-input bg-gray-50 dark:bg-gray-800 overflow-hidden min-h-[100px] flex items-center justify-center"
|
|
6283
6283
|
});
|
|
6284
6284
|
if (imageValue) {
|
|
6285
6285
|
const img = createElement("img", {
|
|
@@ -8936,13 +8936,13 @@ var FieldWrapper = class {
|
|
|
8936
8936
|
});
|
|
8937
8937
|
}
|
|
8938
8938
|
if (isSelected) {
|
|
8939
|
-
fieldWrapper.classList.add("ring-2", "bg-
|
|
8939
|
+
fieldWrapper.classList.add("ring-2", "bg-transparent", "dark:bg-blue-900/20");
|
|
8940
8940
|
}
|
|
8941
8941
|
fieldWrapper.appendChild(createElement("div", {
|
|
8942
|
-
className: `absolute top-
|
|
8943
|
-
}, [getIcon("GripVertical",
|
|
8942
|
+
className: `absolute top-[6px] bg-[#e7e7ff] hover:bg-[#635bff] hover:text-white right-8 cursor-move p-1 rounded p-[2px] mr-1 text-[#635bff] group-hover:opacity-100 transition-opacity field-handle z-10 ${isSelected ? "opacity-100" : ""}`
|
|
8943
|
+
}, [getIcon("GripVertical", 20)]));
|
|
8944
8944
|
fieldWrapper.appendChild(createElement("button", {
|
|
8945
|
-
className: `absolute top-
|
|
8945
|
+
className: `absolute top-[6px] right-2 rounded text-red-600 bg-[#f7a1a14d] text-red-500 p-1 hover:bg-[#ef2f2f] hover:text-white group-hover:opacity-100 transition-opacity z-10 ${isSelected ? "opacity-100" : ""}`,
|
|
8946
8946
|
onclick: (e) => {
|
|
8947
8947
|
e.stopPropagation();
|
|
8948
8948
|
if (confirm("Delete this field?")) {
|
|
@@ -8950,7 +8950,7 @@ var FieldWrapper = class {
|
|
|
8950
8950
|
}
|
|
8951
8951
|
}
|
|
8952
8952
|
}, [getIcon("Trash2", 16)]));
|
|
8953
|
-
const content = createElement("div", { className: "p-
|
|
8953
|
+
const content = createElement("div", { className: "p-2 pointer-events-none " });
|
|
8954
8954
|
content.appendChild(FieldRenderer.render(field, null, void 0, true));
|
|
8955
8955
|
fieldWrapper.appendChild(content);
|
|
8956
8956
|
return fieldWrapper;
|
|
@@ -9117,7 +9117,7 @@ var SectionList = class {
|
|
|
9117
9117
|
}
|
|
9118
9118
|
render() {
|
|
9119
9119
|
const listContainer = createElement("div", {
|
|
9120
|
-
className: "space-y-6
|
|
9120
|
+
className: "space-y-6 ",
|
|
9121
9121
|
// pb-20 for extra scrolling space
|
|
9122
9122
|
id: "sections-list",
|
|
9123
9123
|
"data-drop-zone": "sections"
|
|
@@ -9636,7 +9636,7 @@ var FormBuilder = class {
|
|
|
9636
9636
|
}, [getIcon("Cog", 20)]);
|
|
9637
9637
|
right.appendChild(settingsBtn);
|
|
9638
9638
|
const clearBtn = createElement("button", {
|
|
9639
|
-
className: "flex items-center px-3 py-2 text-sm font-medium text-red-600 bg-[#f7a1a14d] text-red-500 rounded-md transition-colors",
|
|
9639
|
+
className: "flex items-center px-3 py-2 text-sm font-medium text-red-600 bg-[#f7a1a14d] text-red-500 hover:bg-[#ef2f2f] hover:text-white rounded-md transition-colors",
|
|
9640
9640
|
onclick: () => {
|
|
9641
9641
|
if (confirm("Are you sure?")) {
|
|
9642
9642
|
formStore.getState().setSchema({ id: "new", title: "New Form", formName: "newForm", sections: [] });
|
|
@@ -9644,7 +9644,7 @@ var FormBuilder = class {
|
|
|
9644
9644
|
}
|
|
9645
9645
|
}, [getIcon("Trash2", 16), createElement("span", { className: "", title: "Clear" })]);
|
|
9646
9646
|
const previewBtn = createElement("button", {
|
|
9647
|
-
className: `flex items-center justify-center px-3 py-2 text-sm font-medium rounded-md transition-colors ${state.isPreviewMode ? "text-[#635bff] bg-[#e7e7ff] " : "text-[#635bff] bg-[#e7e7ff]"}`,
|
|
9647
|
+
className: `flex items-center justify-center px-3 py-2 text-sm font-medium rounded-md transition-colors ${state.isPreviewMode ? "text-[#635bff] bg-[#e7e7ff] hover:bg-[#635bff] hover:text-white" : "text-[#635bff] bg-[#e7e7ff] hover:bg-[#635bff] hover:text-white"}`,
|
|
9648
9648
|
onclick: (e) => {
|
|
9649
9649
|
e.preventDefault();
|
|
9650
9650
|
e.stopPropagation();
|
|
@@ -9653,7 +9653,7 @@ var FormBuilder = class {
|
|
|
9653
9653
|
title: state.isPreviewMode ? "Exit Preview" : "Preview Form"
|
|
9654
9654
|
}, [getIcon(state.isPreviewMode ? "X" : "Eye", 16)]);
|
|
9655
9655
|
const saveBtn = createElement("button", {
|
|
9656
|
-
className: "flex items-center px-3 py-2 text-sm font-medium text-[#635bff] bg-[#e7e7ff] rounded-md shadow-sm transition-colors",
|
|
9656
|
+
className: "flex items-center px-3 py-2 text-sm font-medium text-[#635bff] bg-[#e7e7ff] hover:bg-[#635bff] hover:text-white rounded-md shadow-sm transition-colors",
|
|
9657
9657
|
onclick: () => {
|
|
9658
9658
|
const schema = formStore.getState().schema;
|
|
9659
9659
|
const numericFields = schema.sections.flatMap((s) => s.fields).filter((f) => f.type === "number");
|
|
@@ -9824,7 +9824,7 @@ var FormBuilder = class {
|
|
|
9824
9824
|
const sectionList = new SectionList(state.schema, state.selectedFieldId);
|
|
9825
9825
|
inner.appendChild(sectionList.getElement());
|
|
9826
9826
|
const addSectionBtn = createElement("button", {
|
|
9827
|
-
className: "w-full mt-6 py-3 dark:border-gray-700 rounded-md text-sm text-gray-500 bg-[#635bff] max-w-[
|
|
9827
|
+
className: "w-full mt-6 py-3 dark:border-gray-700 rounded-md text-sm text-gray-500 bg-[#635bff] max-w-[140px] text-white transition-colors flex items-center justify-center font-medium",
|
|
9828
9828
|
onclick: () => formStore.getState().addSection()
|
|
9829
9829
|
}, [getIcon("Plus", 20), createElement("span", { className: "ml-2", text: "Add Section" })]);
|
|
9830
9830
|
inner.appendChild(addSectionBtn);
|
|
@@ -10492,10 +10492,10 @@ var FormBuilder = class {
|
|
|
10492
10492
|
};
|
|
10493
10493
|
const optionsList = createElement("div", { className: "space-y-2 mb-3" });
|
|
10494
10494
|
options.forEach((opt, index2) => {
|
|
10495
|
-
const optionRow = createElement("div", { className: "flex gap-2 items-center" });
|
|
10495
|
+
const optionRow = createElement("div", { className: "flex gap-2 items-center w-[256px]" });
|
|
10496
10496
|
const labelInput = createElement("input", {
|
|
10497
10497
|
type: "text",
|
|
10498
|
-
className: "flex-1 px-2 py-1.5 border border-gray-300 dark:border-gray-700 rounded-md bg-transparent text-sm",
|
|
10498
|
+
className: "flex-1 px-2 py-1.5 border border-gray-300 w-full dark:border-gray-700 rounded-md bg-transparent text-sm",
|
|
10499
10499
|
value: opt.label,
|
|
10500
10500
|
placeholder: "Option label",
|
|
10501
10501
|
"data-focus-id": `field-option-label-${selectedField.id}-${index2}`,
|
|
@@ -10510,7 +10510,7 @@ var FormBuilder = class {
|
|
|
10510
10510
|
});
|
|
10511
10511
|
const valueInput = createElement("input", {
|
|
10512
10512
|
type: "text",
|
|
10513
|
-
className: "flex-1 px-2 py-1.5 border border-gray-300 dark:border-gray-700 rounded-md bg-transparent text-sm",
|
|
10513
|
+
className: "flex-1 px-2 py-1.5 border border-gray-300 w-full dark:border-gray-700 rounded-md bg-transparent text-sm",
|
|
10514
10514
|
value: opt.value,
|
|
10515
10515
|
placeholder: "Option value",
|
|
10516
10516
|
"data-focus-id": `field-option-value-${selectedField.id}-${index2}`,
|
|
@@ -10544,7 +10544,7 @@ var FormBuilder = class {
|
|
|
10544
10544
|
body.appendChild(optionsList);
|
|
10545
10545
|
const addOptionBtn = createElement("button", {
|
|
10546
10546
|
type: "button",
|
|
10547
|
-
className: "w-full
|
|
10547
|
+
className: "w-full mt-6 py-2 dark:border-gray-700 rounded-md text-sm text-gray-500 bg-[#635bff] text-white transition-colors flex items-center justify-center font-medium transition-colors",
|
|
10548
10548
|
text: "Add Option",
|
|
10549
10549
|
onclick: () => {
|
|
10550
10550
|
const currentOptions = getCurrentOptions();
|