@chaibuilder/sdk 1.2.9 → 1.2.10

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.
Files changed (78) hide show
  1. package/dist/{AddBlocks-tMxKPoen.js → AddBlocks-GiMnBMeQ.js} +28 -29
  2. package/dist/AddBlocks-SzURo9Bj.cjs +1 -0
  3. package/dist/{BrandingOptions-QJJ1y5ez.js → BrandingOptions-10jJO8mG.js} +3 -4
  4. package/dist/BrandingOptions-yK-54R-c.cjs +1 -0
  5. package/dist/CanvasArea-6O8dMPug.cjs +60 -0
  6. package/dist/{CanvasArea-mlNKmCOh.js → CanvasArea-jgBDM5Qd.js} +459 -474
  7. package/dist/CurrentPage-1y62Ne77.cjs +1 -0
  8. package/dist/{CurrentPage-lBy25sZn.js → CurrentPage-lakeZviD.js} +4 -5
  9. package/dist/{Layers-3Xs4A5i8.js → Layers-R7TfREUd.js} +115 -148
  10. package/dist/Layers-Z4nmm9xK.cjs +1 -0
  11. package/dist/{PagesPanel--BZhafnt.js → PagesPanel-4mqxCFHq.js} +4 -5
  12. package/dist/PagesPanel-ouHdxyOH.cjs +1 -0
  13. package/dist/{ProjectPanel-YcLkM-DW.js → ProjectPanel-Wy2nw-1w.js} +11 -12
  14. package/dist/ProjectPanel-hHolYZjt.cjs +1 -0
  15. package/dist/Settings-EYOw02iE.cjs +1 -0
  16. package/dist/{Settings-TAgX4hov.js → Settings-_K28Ontt.js} +532 -554
  17. package/dist/{SidePanels-btVQQkVK.js → SidePanels-6slnxdSj.js} +45 -41
  18. package/dist/SidePanels-U-_O1QN8.cjs +1 -0
  19. package/dist/{Topbar-j4t4AgCq.js → Topbar-bwt6HjlL.js} +4 -5
  20. package/dist/Topbar-dQEoY2P8.cjs +1 -0
  21. package/dist/{UnsplashImages-41Y3q5_Q.js → UnsplashImages-V29UE-57.js} +16 -17
  22. package/dist/UnsplashImages-pGgaUPQy.cjs +1 -0
  23. package/dist/UploadImages-7oLycdSh.cjs +1 -0
  24. package/dist/{UploadImages-xBg-kbKv.js → UploadImages-E0mi_qn8.js} +3 -4
  25. package/dist/{add-page-modal-cm8damU2.js → add-page-modal-FJEAqfD3.js} +9 -10
  26. package/dist/add-page-modal-In6XI-vZ.cjs +1 -0
  27. package/dist/{confirm-alert-i4pM3mOt.js → confirm-alert-5hfE116f.js} +3 -4
  28. package/dist/{confirm-alert-U7-NcG7G.cjs → confirm-alert-Vwd3OzL9.cjs} +1 -1
  29. package/dist/core.cjs +1 -1
  30. package/dist/core.d.ts +12 -8
  31. package/dist/core.js +46 -46
  32. package/dist/delete-page-modal-tl7FLK9J.cjs +1 -0
  33. package/dist/{delete-page-modal-YrIBvfFA.js → delete-page-modal-wH0yLiQI.js} +17 -18
  34. package/dist/{form-VbouZlAW.cjs → form-1j01gADS.cjs} +1 -1
  35. package/dist/{form-OVmsLOrc.js → form-UVHCD9N3.js} +18 -18
  36. package/dist/index-7ogwGh39.cjs +1 -0
  37. package/dist/index-B4sL0YTN.js +3124 -0
  38. package/dist/{index-pZhGT8uT.js → index-c2VLKuhY.js} +4886 -4884
  39. package/dist/{index-N50dZnlC.cjs → index-xbQL0wpz.cjs} +25 -25
  40. package/dist/page-viewer-SfQUe0SI.cjs +1 -0
  41. package/dist/{page-viewer-feqJr1QI.js → page-viewer-TcK0I240.js} +6 -7
  42. package/dist/{project-general-setting-SgagORzW.js → project-general-setting-4ruKl033.js} +5 -6
  43. package/dist/project-general-setting-t7E2Y_w9.cjs +1 -0
  44. package/dist/{project-seo-setting-Snn2nZgS.cjs → project-seo-setting-4b_BJZDF.cjs} +1 -1
  45. package/dist/{project-seo-setting-wxAGEkd_.js → project-seo-setting-d1EZlacB.js} +7 -8
  46. package/dist/single-page-detail-KuXd9Mur.cjs +1 -0
  47. package/dist/{single-page-detail-dnWMyg6P.js → single-page-detail-PihQi-dP.js} +6 -7
  48. package/dist/studio.cjs +1 -1
  49. package/dist/studio.js +3 -4
  50. package/dist/ui.cjs +1 -1
  51. package/dist/ui.d.ts +1 -1
  52. package/dist/ui.js +110 -111
  53. package/dist/{useAddBlockByDrop-inkD7Lck.cjs → useAddBlockByDrop-nLzs79He.cjs} +1 -1
  54. package/dist/{useAddBlockByDrop-_nwI4W3q.js → useAddBlockByDrop-rcDR-z9_.js} +1 -1
  55. package/dist/web-blocks.cjs +1 -9
  56. package/dist/web-blocks.js +397 -399
  57. package/package.json +1 -1
  58. package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
  59. package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
  60. package/dist/CanvasArea-xs4wM64L.cjs +0 -60
  61. package/dist/CurrentPage-aaU4F7wi.cjs +0 -1
  62. package/dist/Layers-eaHy5PK9.cjs +0 -1
  63. package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
  64. package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
  65. package/dist/PagesPanel-gGKCV394.cjs +0 -1
  66. package/dist/ProjectPanel-yFJRy0_E.cjs +0 -1
  67. package/dist/Settings-7wlLcvoh.cjs +0 -1
  68. package/dist/SidePanels-5H4j0mIs.cjs +0 -1
  69. package/dist/Topbar-V8xCetWF.cjs +0 -1
  70. package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
  71. package/dist/UploadImages-DnQ95_NW.cjs +0 -1
  72. package/dist/add-page-modal-MwS7iXn_.cjs +0 -1
  73. package/dist/delete-page-modal-5o4jXu-z.cjs +0 -1
  74. package/dist/index-H6vIwGfD.cjs +0 -1
  75. package/dist/index-niHREMmR.js +0 -2938
  76. package/dist/page-viewer-SLt8XgYv.cjs +0 -1
  77. package/dist/project-general-setting-ym0yCdOq.cjs +0 -1
  78. package/dist/single-page-detail-IPod1o5P.cjs +0 -1
@@ -1,44 +1,28 @@
1
- import { omit as F, isEmpty as k, isNull as z, get as v, map as _, noop as D } from "lodash-es";
1
+ import { omit as H, isEmpty as k, isNull as D, get as v, pick as $, map as j, noop as q } from "lodash-es";
2
+ import { j as r } from "./jsx-runtime-WbnYoNE9.js";
2
3
  import * as d from "react";
3
- import { S as c, o as j, f as I, g as L, m as T, u as f, T as E, c as M, q, b as $, r as h, h as O } from "./controls-XPXGHKht.js";
4
+ import { S as i, f as I, o as E, g as L, m as T, u as f, T as P, c as w, q as z, b as O, r as h, h as V } from "./controls-XPXGHKht.js";
4
5
  import { registerChaiBlock as u } from "@chaibuilder/runtime";
5
- import { j as s } from "./jsx-runtime-WbnYoNE9.js";
6
- import { c as w, g as x } from "./Functions-7jnEwJyw.js";
7
- import { HeadingIcon as V, TextIcon as U, CursorTextIcon as W, ButtonIcon as H, Link1Icon as G, RowsIcon as Y, ColumnsIcon as X, SketchLogoIcon as Z, ImageIcon as J, VideoIcon as K, CodeIcon as Q, DividerHorizontalIcon as ee, SpaceBetweenVerticallyIcon as R, TableIcon as te, BorderTopIcon as le, BorderAllIcon as oe, ViewHorizontalIcon as re, DragHandleHorizontalIcon as ae, GroupIcon as se, LetterCaseToggleIcon as ne, InputIcon as A, DropdownMenuIcon as ie, CheckboxIcon as ce, RadiobuttonIcon as de } from "@radix-ui/react-icons";
6
+ import { c as S, g as x } from "./Functions-7jnEwJyw.js";
7
+ import { HeadingIcon as U, TextIcon as G, CursorTextIcon as W, ButtonIcon as R, Link1Icon as Y, RowsIcon as X, ColumnsIcon as Z, SketchLogoIcon as J, ImageIcon as K, VideoIcon as Q, CodeIcon as ee, DividerHorizontalIcon as te, SpaceBetweenVerticallyIcon as A, TableIcon as le, BorderTopIcon as oe, BorderAllIcon as ae, ViewHorizontalIcon as se, DragHandleHorizontalIcon as re, GroupIcon as ne, LetterCaseToggleIcon as ce, CheckboxIcon as ie, InputIcon as F, RadiobuttonIcon as de, DropdownMenuIcon as ue } from "@radix-ui/react-icons";
8
8
  import "./_commonjsHelpers-UyOWmZb0.js";
9
9
  import "clsx";
10
10
  import "tailwind-merge";
11
- const ue = (t) => {
12
- const { blockProps: e, backgroundImage: l, children: o, styles: a } = t;
13
- let r = {};
14
- return l && (r = { backgroundImage: `url(${l})` }), d.createElement("div", { ...e, ...a, style: r }, o);
15
- };
16
- u(ue, {
17
- type: "Body",
18
- label: "Body",
19
- category: "core",
20
- group: "basic",
21
- hidden: !0,
22
- props: {
23
- styles: c({ default: "font-body antialiased" }),
24
- backgroundImage: j({ title: "Background Image" })
25
- }
26
- });
27
- const g = ({ blockProps: t, className: e = "", styles: l = {} }) => /* @__PURE__ */ s.jsx(
11
+ const g = ({ blockProps: t, className: e = "", styles: l = {} }) => /* @__PURE__ */ r.jsx(
28
12
  "div",
29
13
  {
30
14
  ...t,
31
- className: w("flex h-20 flex-col items-center justify-center", e),
32
- ...F(l, ["className"]),
33
- children: /* @__PURE__ */ s.jsx("div", { className: "flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300", children: /* @__PURE__ */ s.jsx("span", { className: "opacit flex items-center gap-x-1.5 text-xs font-semibold text-gray-400" }) })
15
+ className: S("flex h-20 flex-col items-center justify-center", e),
16
+ ...H(l, ["className"]),
17
+ children: /* @__PURE__ */ r.jsx("div", { className: "flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300", children: /* @__PURE__ */ r.jsx("span", { className: "opacit flex items-center gap-x-1.5 text-xs font-semibold text-gray-400" }) })
34
18
  }
35
19
  ), pe = d.memo(
36
20
  (t) => {
37
- const { blockProps: e, backgroundImage: l, children: o, tag: a = "div", styles: r } = t;
38
- if (!o && k(r == null ? void 0 : r.className))
39
- return /* @__PURE__ */ s.jsx(g, { blockProps: e, styles: r });
21
+ const { blockProps: e, backgroundImage: l, children: a, tag: s = "div", styles: o } = t;
22
+ if (!a && k(o == null ? void 0 : o.className))
23
+ return /* @__PURE__ */ r.jsx(g, { blockProps: e, styles: o });
40
24
  let n = {};
41
- return l && (n = { backgroundImage: `url(${l})` }), d.createElement(a, { ...e, ...r, style: n }, o);
25
+ return l && (n = { backgroundImage: `url(${l})` }), d.createElement(s, { ...e, ...o, style: n }, a);
42
26
  }
43
27
  );
44
28
  u(pe, {
@@ -47,7 +31,7 @@ u(pe, {
47
31
  category: "core",
48
32
  group: "basic",
49
33
  props: {
50
- styles: c({ default: "" }),
34
+ styles: i({ default: "" }),
51
35
  tag: I({
52
36
  title: "Tag",
53
37
  default: "div",
@@ -71,23 +55,23 @@ u(pe, {
71
55
  { value: "mark", title: "mark" }
72
56
  ]
73
57
  }),
74
- backgroundImage: j({ title: "Background Image" })
58
+ backgroundImage: E({ title: "Background Image" })
75
59
  },
76
60
  canAcceptBlock: () => !0
77
61
  });
78
62
  const me = (t) => {
79
- const { blockProps: e, styles: l, content: o, level: a = "h1", children: r = null } = t;
80
- return r ? d.createElement(a, { ...l, ...e }, r) : d.createElement(a, {
63
+ const { blockProps: e, styles: l, content: a, level: s = "h1", children: o = null } = t;
64
+ return o ? d.createElement(s, { ...l, ...e }, o) : d.createElement(s, {
81
65
  ...l,
82
66
  ...e,
83
- dangerouslySetInnerHTML: { __html: o }
67
+ dangerouslySetInnerHTML: { __html: a }
84
68
  });
85
69
  };
86
70
  u(me, {
87
71
  type: "Heading",
88
72
  label: "Heading",
89
73
  category: "core",
90
- icon: V,
74
+ icon: U,
91
75
  group: "basic",
92
76
  props: {
93
77
  level: I({
@@ -103,27 +87,27 @@ u(me, {
103
87
  { value: "h6", title: "h6" }
104
88
  ]
105
89
  }),
106
- styles: c({ default: "text-3xl" }),
90
+ styles: i({ default: "text-3xl" }),
107
91
  content: L({ title: "Content", default: "Heading goes here" })
108
92
  },
109
93
  canAcceptBlock: (t) => t === "Span" || t === "Text"
110
94
  });
111
95
  const fe = (t) => {
112
- const { blockProps: e, styles: l, content: o } = t;
113
- return z(t.children) ? d.createElement("div", {
96
+ const { blockProps: e, styles: l, content: a } = t;
97
+ return D(t.children) ? d.createElement("div", {
114
98
  ...l,
115
99
  ...e,
116
- dangerouslySetInnerHTML: { __html: o }
100
+ dangerouslySetInnerHTML: { __html: a }
117
101
  }) : d.createElement("p", { ...l, ...e }, t.children);
118
102
  };
119
103
  u(fe, {
120
104
  type: "Paragraph",
121
105
  label: "Paragraph",
122
106
  category: "core",
123
- icon: U,
107
+ icon: G,
124
108
  group: "basic",
125
109
  props: {
126
- styles: c({ default: "" }),
110
+ styles: i({ default: "" }),
127
111
  content: L({
128
112
  title: "Content",
129
113
  default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere."
@@ -132,11 +116,11 @@ u(fe, {
132
116
  canAcceptBlock: (t) => t === "Span" || t === "Link"
133
117
  });
134
118
  const be = (t) => {
135
- const { blockProps: e, styles: l, content: o, children: a = null, tag: r } = t;
136
- return a ? d.createElement("span", { ...l, ...e }, a) : d.createElement(r || "span", {
119
+ const { blockProps: e, styles: l, content: a, children: s = null, tag: o } = t;
120
+ return s ? d.createElement("span", { ...l, ...e }, s) : d.createElement(o || "span", {
137
121
  ...l,
138
122
  ...e,
139
- dangerouslySetInnerHTML: { __html: o }
123
+ dangerouslySetInnerHTML: { __html: a }
140
124
  });
141
125
  };
142
126
  u(be, {
@@ -145,13 +129,13 @@ u(be, {
145
129
  category: "core",
146
130
  group: "basic",
147
131
  props: {
148
- styles: c({ default: "" }),
132
+ styles: i({ default: "" }),
149
133
  content: L({ title: "Content", default: "Enter your content" })
150
134
  }
151
135
  });
152
136
  const ye = (t) => {
153
- const { blockProps: e, content: l, styles: o } = t;
154
- return /* @__PURE__ */ s.jsx("div", { className: "prose max-w-full", children: /* @__PURE__ */ s.jsx("div", { ...e, ...o, dangerouslySetInnerHTML: { __html: l } }) });
137
+ const { blockProps: e, content: l, styles: a } = t;
138
+ return /* @__PURE__ */ r.jsx("div", { className: "max-w-full", children: /* @__PURE__ */ r.jsx("div", { ...e, ...a, dangerouslySetInnerHTML: { __html: l } }) });
155
139
  };
156
140
  u(ye, {
157
141
  type: "RichText",
@@ -160,29 +144,21 @@ u(ye, {
160
144
  icon: W,
161
145
  group: "basic",
162
146
  props: {
163
- styles: c({ default: "" }),
147
+ styles: i({ default: "" }),
164
148
  content: T({
165
149
  title: "Content",
166
- default: `Lorem Ipsum Rich Text Editor Demo
167
-
168
- Welcome to our rich text editor demo! With our powerful editor, you can create stunning documents with ease. Let's explore some of its features:
169
-
170
- Text Formatting: You can make text bold, italic, or underline it.
171
- Lists:
172
- Create ordered lists.
173
- Craft unordered lists.
174
- Utilize nested lists for organization.`
150
+ default: "<p>This is a rich text block. You can add text, and other content here.</p>"
175
151
  })
176
152
  }
177
153
  });
178
154
  const he = (t) => {
179
- const { blockProps: e, iconSize: l, icon: o, content: a, iconPos: r, styles: n, children: i } = t, p = o, m = i || /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
180
- a,
181
- p && /* @__PURE__ */ s.jsx(
155
+ const { blockProps: e, iconSize: l, icon: a, content: s, iconPos: o, styles: n, children: c } = t, p = a, m = c || /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
156
+ /* @__PURE__ */ r.jsx("span", { children: s }),
157
+ p && /* @__PURE__ */ r.jsx(
182
158
  "div",
183
159
  {
184
160
  style: { width: l + "px" },
185
- className: r + (r === "order-first" ? "mr-2" : "ml-2") || "",
161
+ className: o + " " + (o === "order-first" ? "mr-2" : "ml-2") || "",
186
162
  dangerouslySetInnerHTML: { __html: p }
187
163
  }
188
164
  )
@@ -193,13 +169,13 @@ u(he, {
193
169
  type: "Button",
194
170
  label: "Button",
195
171
  category: "core",
196
- icon: H,
172
+ icon: R,
197
173
  group: "basic",
198
174
  props: {
199
175
  content: f({ title: "Label", default: "Button", multiLingual: !0 }),
200
- styles: c({ default: "text-white bg-primary px-4 py-2 rounded-global flex items-center" }),
201
- icon: E({ title: "Icon", default: "" }),
202
- iconSize: M({ title: "Icon Size", default: 24 }),
176
+ styles: i({ default: "text-white bg-primary px-4 py-2 rounded-global flex items-center" }),
177
+ icon: P({ title: "Icon", default: "" }),
178
+ iconSize: w({ title: "Icon Size", default: 24 }),
203
179
  iconPos: I({
204
180
  title: "Icon Position",
205
181
  default: "order-last",
@@ -211,17 +187,17 @@ u(he, {
211
187
  }
212
188
  });
213
189
  const ge = (t) => {
214
- const { blockProps: e, link: l, children: o, styles: a, inBuilder: r, content: n } = t;
215
- return !o && k(a == null ? void 0 : a.className) && k(n) ? /* @__PURE__ */ s.jsx(g, { blockProps: e }) : r ? o ? /* @__PURE__ */ s.jsx("span", { "data-simulate": "a", ...e, ...a, children: o }) : d.createElement("span", {
190
+ const { blockProps: e, link: l, children: a, styles: s, inBuilder: o, content: n } = t;
191
+ return !a && k(s == null ? void 0 : s.className) && k(n) ? /* @__PURE__ */ r.jsx(g, { blockProps: e }) : o ? a ? /* @__PURE__ */ r.jsx("span", { "data-simulate": "a", ...e, ...s, children: a }) : d.createElement("span", {
216
192
  ...e,
217
- ...a,
193
+ ...s,
218
194
  href: l.href || "#",
219
195
  target: l.target || "_self",
220
196
  dangerouslySetInnerHTML: { __html: n },
221
197
  "data-simulate": "a"
222
- }) : o ? /* @__PURE__ */ s.jsx("a", { href: l.href || "#/", target: l.target, ...e, ...a, children: o }) : d.createElement("a", {
198
+ }) : a ? /* @__PURE__ */ r.jsx("a", { href: l.href || "#/", target: l.target, ...e, ...s, children: a }) : d.createElement("a", {
223
199
  ...e,
224
- ...a,
200
+ ...s,
225
201
  href: l.href || "#",
226
202
  target: l.target || "_self",
227
203
  dangerouslySetInnerHTML: { __html: n }
@@ -231,12 +207,12 @@ u(ge, {
231
207
  type: "Link",
232
208
  label: "Link",
233
209
  category: "core",
234
- icon: G,
210
+ icon: Y,
235
211
  group: "basic",
236
212
  props: {
237
- styles: c({ default: "" }),
213
+ styles: i({ default: "" }),
238
214
  content: f({ title: "Content", default: "" }),
239
- link: q({
215
+ link: z({
240
216
  title: "Link",
241
217
  default: { type: "page", target: "_self", href: "" }
242
218
  })
@@ -244,21 +220,21 @@ u(ge, {
244
220
  canAcceptBlock: () => !0
245
221
  });
246
222
  const xe = (t) => {
247
- const { blockProps: e, children: l, listType: o, styles: a, tag: r } = t, n = w(v(a, "className", ""), o);
248
- return !l && k(a == null ? void 0 : a.className) ? /* @__PURE__ */ s.jsx(g, { blockProps: e, text: "LIST ITEM" }) : d.createElement(
249
- r || (o === "list-decimal" ? "ol" : "ul"),
250
- { ...e, ...a, className: n },
223
+ const { blockProps: e, children: l, listType: a, styles: s, tag: o } = t, n = S(v(s, "className", ""), a);
224
+ return !l && k(s == null ? void 0 : s.className) ? /* @__PURE__ */ r.jsx(g, { blockProps: e, text: "LIST ITEM" }) : d.createElement(
225
+ o || (a === "list-decimal" ? "ol" : "ul"),
226
+ { ...e, ...s, className: n },
251
227
  l
252
228
  );
253
229
  };
254
230
  u(xe, {
255
231
  type: "List",
256
232
  label: "List",
257
- icon: Y,
233
+ icon: X,
258
234
  category: "core",
259
235
  group: "basic",
260
236
  props: {
261
- styles: c({ default: "" }),
237
+ styles: i({ default: "" }),
262
238
  listType: I({
263
239
  title: "List type",
264
240
  default: "list-disc",
@@ -296,9 +272,9 @@ u(xe, {
296
272
  ]
297
273
  });
298
274
  const ke = (t) => {
299
- const { blockProps: e, content: l, styles: o, children: a, tag: r } = t;
300
- return a ? d.createElement(r || "li", { ...o, ...e }, a) : d.createElement(r || "li", {
301
- ...o,
275
+ const { blockProps: e, content: l, styles: a, children: s, tag: o } = t;
276
+ return s ? d.createElement(o || "li", { ...a, ...e }, s) : d.createElement(o || "li", {
277
+ ...a,
302
278
  ...e,
303
279
  dangerouslySetInnerHTML: { __html: l }
304
280
  });
@@ -306,23 +282,23 @@ const ke = (t) => {
306
282
  u(ke, {
307
283
  type: "ListItem",
308
284
  label: "List Item",
309
- icon: X,
285
+ icon: Z,
310
286
  category: "core",
311
287
  group: "basic",
312
288
  props: {
313
- styles: c({ default: "" }),
289
+ styles: i({ default: "" }),
314
290
  content: L({ title: "Content", default: "List item" })
315
291
  },
316
292
  canAcceptBlock: () => !0
317
293
  });
318
294
  const ve = (t) => {
319
- const { blockProps: e, icon: l, styles: o } = t, a = {
320
- ...o,
321
- className: w(o.className, "inline-block c-inline-block")
295
+ const { blockProps: e, icon: l, styles: a, width: s, height: o } = t, n = {
296
+ ...a,
297
+ className: S(a.className, "inline-block c-inline-block", `w-[${s}px]`, `h-[${o}px]`)
322
298
  };
323
- return k(l) ? /* @__PURE__ */ s.jsx(g, { blockProps: e, text: "", className: "h-8 w-14" }) : d.createElement("span", {
299
+ return k(l) ? /* @__PURE__ */ r.jsx(g, { blockProps: e, text: "", className: "h-8 w-14" }) : d.createElement("span", {
324
300
  ...e,
325
- ...a,
301
+ ...n,
326
302
  dangerouslySetInnerHTML: { __html: l }
327
303
  });
328
304
  };
@@ -330,24 +306,26 @@ u(ve, {
330
306
  type: "Icon",
331
307
  label: "Icon",
332
308
  category: "core",
333
- icon: Z,
309
+ icon: J,
334
310
  group: "basic",
335
311
  props: {
336
- styles: c({ default: "text-black" }),
337
- icon: E({
312
+ styles: i({ default: "text-black" }),
313
+ icon: P({
338
314
  title: "Icon",
339
- default: '<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>'
340
- })
315
+ default: '<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>'
316
+ }),
317
+ width: w({ title: "Width", default: 40 }),
318
+ height: w({ title: "Height", default: 40 })
341
319
  }
342
320
  });
343
321
  const Ie = (t) => {
344
- const { blockProps: e, image: l, styles: o, alt: a, height: r = 200, width: n = 200 } = t;
345
- return k(l) ? /* @__PURE__ */ s.jsx(g, { blockProps: e, text: "IMAGE URL", className: "h-36" }) : d.createElement("img", {
322
+ const { blockProps: e, image: l, styles: a, alt: s, height: o, width: n } = t;
323
+ return k(l) ? /* @__PURE__ */ r.jsx(g, { blockProps: e, text: "IMAGE URL", className: "h-36" }) : d.createElement("img", {
346
324
  ...e,
347
- ...o,
325
+ ...a,
348
326
  src: l,
349
- alt: a,
350
- height: r,
327
+ alt: s,
328
+ height: o,
351
329
  width: n
352
330
  });
353
331
  };
@@ -355,11 +333,11 @@ u(Ie, {
355
333
  type: "Image",
356
334
  label: "Image",
357
335
  category: "core",
358
- icon: J,
336
+ icon: K,
359
337
  group: "basic",
360
338
  props: {
361
- styles: c({ default: "" }),
362
- image: j({
339
+ styles: i({ default: "" }),
340
+ image: E({
363
341
  title: "Image",
364
342
  default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
365
343
  }),
@@ -369,14 +347,14 @@ u(Ie, {
369
347
  }
370
348
  });
371
349
  const Le = (t) => {
372
- var r;
373
- const { blockProps: e, styles: l, children: o } = t;
374
- let a = null;
375
- return o || (a = // @ts-ignore
376
- /* @__PURE__ */ s.jsx("div", { className: w("flex flex-col items-center justify-center", (r = t.emptyStyles) == null ? void 0 : r.className), children: /* @__PURE__ */ s.jsx("div", { className: "h-full w-full rounded-md border-4 border-dashed", children: /* @__PURE__ */ s.jsxs("p", { className: "truncate p-1 text-left text-xs text-gray-400", children: [
350
+ var o;
351
+ const { blockProps: e, styles: l, children: a } = t;
352
+ let s = null;
353
+ return a || (s = // @ts-ignore
354
+ /* @__PURE__ */ r.jsx("div", { className: S("flex flex-col items-center justify-center", (o = t.emptyStyles) == null ? void 0 : o.className), children: /* @__PURE__ */ r.jsx("div", { className: "h-full w-full rounded-md border-4 border-dashed", children: /* @__PURE__ */ r.jsxs("p", { className: "truncate p-1 text-left text-xs text-gray-400", children: [
377
355
  "Slot: ",
378
356
  t.name
379
- ] }) }) })), d.createElement("div", { ...l, ...e, droppable: "yes" }, o || a);
357
+ ] }) }) })), d.createElement("div", { ...l, ...e, droppable: "yes" }, a || s);
380
358
  };
381
359
  u(Le, {
382
360
  type: "Slot",
@@ -385,18 +363,18 @@ u(Le, {
385
363
  category: "core",
386
364
  hidden: !0,
387
365
  props: {
388
- styles: c({ default: "" }),
389
- emptyStyles: c({ default: "" })
366
+ styles: i({ default: "" }),
367
+ emptyStyles: i({ default: "" })
390
368
  },
391
369
  canAcceptBlock: () => !0
392
370
  });
393
- const P = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, N = /^(https?:\/\/)?(www\.)?player.vimeo\.com/, C = /^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/, Be = (t) => {
394
- if (P.test(t)) {
395
- const e = t.match(P);
396
- return e ? `https://www.youtube.com/embed/${e[4]}` : t;
397
- }
371
+ const N = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, M = /^(https?:\/\/)?(www\.)?player.vimeo\.com/, C = /^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/, Be = (t) => {
398
372
  if (N.test(t)) {
399
373
  const e = t.match(N);
374
+ return e ? `https://www.youtube.com/embed/${e[4]}` : t;
375
+ }
376
+ if (M.test(t)) {
377
+ const e = t.match(M);
400
378
  return e ? `https://player.vimeo.com/video/${e[3]}` : t;
401
379
  }
402
380
  if (C.test(t)) {
@@ -406,18 +384,18 @@ const P = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-
406
384
  return null;
407
385
  }, Te = d.memo(
408
386
  (t) => {
409
- const { blockProps: e, inBuilder: l, styles: o, url: a, controls: r } = t, n = v(r, "autoPlay", !1), i = v(r, "controls", !1), p = n || v(r, "muted", !0), m = v(r, "loop", !1);
410
- if (k(a))
411
- return /* @__PURE__ */ s.jsx(g, { blockProps: e, text: "VIDEO URL", className: "h-36" });
412
- let y = Be(a), b = null;
387
+ const { blockProps: e, inBuilder: l, styles: a, url: s, controls: o } = t, n = v(o, "autoPlay", !1), c = v(o, "controls", !1), p = n || v(o, "muted", !0), m = v(o, "loop", !1);
388
+ if (k(s))
389
+ return /* @__PURE__ */ r.jsx(g, { blockProps: e, text: "VIDEO URL", className: "h-36" });
390
+ let y = Be(s), b = null;
413
391
  if (y) {
414
392
  if (!k(y)) {
415
393
  const B = [];
416
- B.push(`autoplay=${n ? 1 : 0}`), B.push(`controls=${r ? 1 : 0}`), B.push(`mute=${p ? 1 : 0}&muted=${p ? 1 : 0}`), B.push(`loop=${m ? 1 : 0}`), y = `${y}?${B.join("&")}`;
394
+ B.push(`autoplay=${n ? 1 : 0}`), B.push(`controls=${o ? 1 : 0}`), B.push(`mute=${p ? 1 : 0}&muted=${p ? 1 : 0}`), B.push(`loop=${m ? 1 : 0}`), y = `${y}?${B.join("&")}`;
417
395
  }
418
396
  b = d.createElement("iframe", {
419
397
  ...e,
420
- ...o,
398
+ className: "absolute inset-0 w-full h-full",
421
399
  src: y,
422
400
  allow: l ? "" : "autoplay *; fullscreen *",
423
401
  allowFullScreen: !0,
@@ -426,36 +404,36 @@ const P = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-
426
404
  } else
427
405
  b = d.createElement("video", {
428
406
  ...e,
429
- ...o,
430
- src: a,
431
- controls: i,
407
+ className: "absolute inset-0 w-full h-full",
408
+ src: s,
409
+ controls: c,
432
410
  muted: p,
433
411
  autoPlay: l ? !1 : n,
434
412
  loop: m
435
413
  });
436
- return /* @__PURE__ */ s.jsxs("div", { className: "relative h-full w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
437
- l ? /* @__PURE__ */ s.jsx("div", { ...e, ...o, className: "absolute z-20 h-full w-full" }) : null,
414
+ return /* @__PURE__ */ r.jsx("div", { ...$(a, ["className"]), children: /* @__PURE__ */ r.jsxs("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
415
+ l ? /* @__PURE__ */ r.jsx("div", { ...e, ...H(a, ["className"]), className: "absolute inset-0 z-20 h-full w-full" }) : null,
438
416
  b
439
- ] });
417
+ ] }) });
440
418
  }
441
419
  );
442
420
  u(Te, {
443
421
  type: "Video",
444
422
  label: "Video",
445
423
  category: "core",
446
- icon: K,
424
+ icon: Q,
447
425
  group: "basic",
448
426
  props: {
449
- styles: c({ default: "absolute top-0 left-0 w-full h-full" }),
427
+ styles: i({ default: "" }),
450
428
  url: f({
451
429
  title: "Video URL",
452
430
  default: "https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"
453
431
  }),
454
- controls: $({
432
+ controls: O({
455
433
  title: "Controls",
456
434
  properties: {
457
435
  autoPlay: h({ title: "Autoplay", default: !0 }),
458
- controls: h({ title: "Show widgets", default: !1 }),
436
+ controls: h({ title: "Show controls", default: !1 }),
459
437
  loop: h({ title: "Loop", default: !1 }),
460
438
  muted: h({ title: "Muted", default: !0 })
461
439
  }
@@ -464,12 +442,12 @@ u(Te, {
464
442
  });
465
443
  const we = d.memo(
466
444
  (t) => {
467
- const { blockProps: e, styles: l, content: o, inBuilder: a } = t;
468
- return /* @__PURE__ */ s.jsxs("div", { className: "relative", children: [
469
- a ? /* @__PURE__ */ s.jsx("div", { ...e, ...l, className: "absolute h-full w-full z-20" }) : null,
445
+ const { blockProps: e, styles: l, content: a, inBuilder: s } = t;
446
+ return /* @__PURE__ */ r.jsxs("div", { className: "relative", children: [
447
+ s ? /* @__PURE__ */ r.jsx("div", { ...e, ...l, className: "absolute h-full w-full z-20" }) : null,
470
448
  d.createElement("div", {
471
449
  ...l,
472
- dangerouslySetInnerHTML: { __html: o }
450
+ dangerouslySetInnerHTML: { __html: a }
473
451
  })
474
452
  ] });
475
453
  }
@@ -478,10 +456,10 @@ u(we, {
478
456
  type: "CustomHTML",
479
457
  label: "CustomHTML",
480
458
  category: "core",
481
- icon: Q,
459
+ icon: ee,
482
460
  group: "basic",
483
461
  props: {
484
- styles: c({ default: "" }),
462
+ styles: i({ default: "" }),
485
463
  content: L({
486
464
  title: "HTML Content",
487
465
  default: "<div><p>HTML Snippet goes here...</p></div>",
@@ -497,132 +475,152 @@ u(Se, {
497
475
  type: "Divider",
498
476
  label: "Divider",
499
477
  category: "core",
500
- icon: ee,
478
+ icon: te,
501
479
  group: "basic",
502
480
  props: {
503
- styles: c({ default: "bg-gray-900 h-0.5 py-2 my-1" })
481
+ styles: i({ default: "bg-gray-900 h-0.5 py-2 my-1" })
504
482
  }
505
483
  });
506
- const _e = (t) => {
507
- const { blockProps: e, styles: l } = t;
508
- return d.createElement("br", { ...e, ...l });
509
- };
484
+ const _e = (t) => t.inBuilder ? /* @__PURE__ */ r.jsx("span", { className: "inline", ...t.blockProps, children: t.content }) : `${t.content}`;
510
485
  u(_e, {
511
- type: "LineBreak",
512
- label: "Line Break",
486
+ type: "Text",
487
+ label: "Text",
488
+ hidden: !0,
513
489
  category: "core",
514
490
  group: "basic",
515
- hidden: !0,
516
- icon: R,
491
+ icon: A,
517
492
  props: {
518
- styles: c({ default: "" })
493
+ content: L({ title: "Content", defaultValue: "" })
519
494
  }
520
495
  });
521
- const je = (t) => t.inBuilder ? /* @__PURE__ */ s.jsx("span", { className: "inline", ...t.blockProps, children: t.content }) : `${t.content}`;
496
+ const je = (t) => {
497
+ const { blockProps: e, backgroundImage: l, children: a, styles: s } = t;
498
+ let o = {};
499
+ return l && (o = { backgroundImage: `url(${l})` }), d.createElement("div", { ...e, ...s, style: o }, a);
500
+ };
522
501
  u(je, {
523
- type: "Text",
524
- label: "Text",
502
+ type: "Body",
503
+ label: "Body",
504
+ category: "core",
505
+ group: "basic",
525
506
  hidden: !0,
507
+ props: {
508
+ styles: i({ default: "font-body antialiased" }),
509
+ backgroundImage: E({ title: "Background Image" })
510
+ },
511
+ canAcceptBlock: () => !0,
512
+ canDelete: () => !1,
513
+ canMove: () => !1,
514
+ canDuplicate: () => !1
515
+ });
516
+ const Ee = (t) => {
517
+ const { blockProps: e, styles: l } = t;
518
+ return d.createElement("br", { ...e, ...l });
519
+ };
520
+ u(Ee, {
521
+ type: "LineBreak",
522
+ label: "Line Break",
526
523
  category: "core",
527
524
  group: "basic",
528
- icon: R,
525
+ hidden: !0,
526
+ icon: A,
529
527
  props: {
530
- content: L({ title: "Content", defaultValue: "" })
528
+ styles: i({ default: "" })
531
529
  }
532
530
  });
533
- const S = (t) => {
534
- const e = (r, n) => ({
531
+ const _ = (t) => {
532
+ const e = (o, n) => ({
535
533
  _id: x(),
536
- _parent: r,
534
+ _parent: o,
537
535
  _type: "TableCell",
538
536
  styles: "#styles:,",
539
537
  content: `${t === "TableHead" ? "Table Head" : "Table Cell " + n}`
540
- }), l = (r) => {
541
- const n = x(), i = {
538
+ }), l = (o) => {
539
+ const n = x(), c = {
542
540
  _type: "TableRow",
543
541
  _id: n,
544
542
  styles: "#styles:,border-b"
545
543
  };
546
- return r && (i._parent = r), [i, e(n, "1"), e(n, "2"), e(n, "3")];
547
- }, o = (r) => {
548
- const n = x(), i = {
544
+ return o && (c._parent = o), [c, e(n, "1"), e(n, "2"), e(n, "3")];
545
+ }, a = (o) => {
546
+ const n = x(), c = {
549
547
  _id: n,
550
548
  _type: "TableHead",
551
549
  styles: "#styles:,font-medium"
552
550
  };
553
- return r && (i._parent = r), [i, ...l(n)];
554
- }, a = (r) => {
555
- const n = x(), i = {
551
+ return o && (c._parent = o), [c, ...l(n)];
552
+ }, s = (o) => {
553
+ const n = x(), c = {
556
554
  _id: n,
557
555
  _type: "TableBody",
558
556
  styles: "#styles:,"
559
557
  };
560
- return r && (i._parent = r), [i, ...l(n), ...l(n)];
558
+ return o && (c._parent = o), [c, ...l(n), ...l(n)];
561
559
  };
562
560
  if (t === "Table") {
563
- const r = x();
561
+ const o = x();
564
562
  return [
565
563
  {
566
- _id: r,
564
+ _id: o,
567
565
  _type: "Table",
568
566
  styles: "#styles:,w-full text-left text-gray-500 dark:text-gray-400"
569
567
  },
570
- ...o(r),
571
- ...a(r)
568
+ ...a(o),
569
+ ...s(o)
572
570
  ];
573
571
  }
574
- return t === "TableRow" ? l() : t === "TableHead" ? o() : t === "TableBody" ? a() : [];
575
- }, Ee = (t) => {
576
- const { blockProps: e, children: l, styles: o } = t;
577
- return l ? d.createElement("table", { ...e, ...o }, l) : /* @__PURE__ */ s.jsx(g, { blockProps: e, text: "TABLE HEAD / BODY" });
572
+ return t === "TableRow" ? l() : t === "TableHead" ? a() : t === "TableBody" ? s() : [];
573
+ }, Pe = (t) => {
574
+ const { blockProps: e, children: l, styles: a } = t;
575
+ return l ? d.createElement("table", { ...e, ...a }, l) : /* @__PURE__ */ r.jsx(g, { blockProps: e, text: "TABLE HEAD / BODY" });
578
576
  };
579
- u(Ee, {
577
+ u(Pe, {
580
578
  type: "Table",
581
579
  label: "Table",
582
580
  category: "core",
583
581
  group: "table",
584
582
  hidden: !0,
585
- icon: te,
583
+ icon: le,
586
584
  props: {
587
- styles: c({ default: "" })
585
+ styles: i({ default: "" })
588
586
  },
589
- blocks: S("Table")
587
+ blocks: _("Table")
590
588
  });
591
- const Pe = (t) => {
592
- const { blockProps: e, children: l, styles: o } = t;
593
- return l ? d.createElement("thead", { ...e, ...o }, l) : /* @__PURE__ */ s.jsx(g, { blockProps: e, text: "TABLE ROW" });
589
+ const Ne = (t) => {
590
+ const { blockProps: e, children: l, styles: a } = t;
591
+ return l ? d.createElement("thead", { ...e, ...a }, l) : /* @__PURE__ */ r.jsx(g, { blockProps: e, text: "TABLE ROW" });
594
592
  };
595
- u(Pe, {
593
+ u(Ne, {
596
594
  type: "TableHead",
597
595
  label: "Table Head",
598
596
  category: "core",
599
597
  group: "table",
600
598
  hidden: !0,
601
- icon: le,
599
+ icon: oe,
602
600
  props: {
603
- styles: c({ default: "" })
601
+ styles: i({ default: "" })
604
602
  },
605
- blocks: S("TableHead")
603
+ blocks: _("TableHead")
606
604
  });
607
- const Ne = (t) => {
608
- const { blockProps: e, children: l, styles: o } = t;
609
- return l ? d.createElement("tbody", { ...e, ...o }, l) : /* @__PURE__ */ s.jsx(g, { blockProps: e, text: "TABLE ROW" });
605
+ const Me = (t) => {
606
+ const { blockProps: e, children: l, styles: a } = t;
607
+ return l ? d.createElement("tbody", { ...e, ...a }, l) : /* @__PURE__ */ r.jsx(g, { blockProps: e, text: "TABLE ROW" });
610
608
  };
611
- u(Ne, {
609
+ u(Me, {
612
610
  type: "TableBody",
613
611
  label: "Table Body",
614
612
  category: "core",
615
613
  group: "table",
616
614
  hidden: !0,
617
- icon: oe,
615
+ icon: ae,
618
616
  props: {
619
- styles: c({ default: "" })
617
+ styles: i({ default: "" })
620
618
  },
621
- blocks: S("TableBody")
619
+ blocks: _("TableBody")
622
620
  });
623
621
  const Ce = (t) => {
624
- const { blockProps: e, children: l, styles: o } = t;
625
- return l ? d.createElement("tr", { ...e, ...o }, l) : /* @__PURE__ */ s.jsx(g, { blockProps: e, text: "TABLE CELL" });
622
+ const { blockProps: e, children: l, styles: a } = t;
623
+ return l ? d.createElement("tr", { ...e, ...a }, l) : /* @__PURE__ */ r.jsx(g, { blockProps: e, text: "TABLE CELL" });
626
624
  };
627
625
  u(Ce, {
628
626
  type: "TableRow",
@@ -630,36 +628,36 @@ u(Ce, {
630
628
  category: "core",
631
629
  group: "table",
632
630
  hidden: !0,
633
- icon: re,
631
+ icon: se,
634
632
  props: {
635
- styles: c({ default: "w-full" })
633
+ styles: i({ default: "w-full" })
636
634
  },
637
- blocks: S("TableRow")
635
+ blocks: _("TableRow")
638
636
  });
639
- const Me = (t) => {
640
- const { blockProps: e, children: l, content: o, styles: a } = t;
641
- return !l && k(o) ? /* @__PURE__ */ s.jsx(g, { blockProps: e }) : l ? d.createElement("td", { ...e, ...a }, l) : d.createElement("td", {
637
+ const He = (t) => {
638
+ const { blockProps: e, children: l, content: a, styles: s } = t;
639
+ return !l && k(a) ? /* @__PURE__ */ r.jsx(g, { blockProps: e }) : l ? d.createElement("td", { ...e, ...s }, l) : d.createElement("td", {
642
640
  ...e,
643
- ...a,
644
- dangerouslySetInnerHTML: { __html: o }
641
+ ...s,
642
+ dangerouslySetInnerHTML: { __html: a }
645
643
  });
646
644
  };
647
- u(Me, {
645
+ u(He, {
648
646
  type: "TableCell",
649
647
  label: "Table Cell",
650
648
  category: "core",
651
649
  group: "table",
652
650
  hidden: !0,
653
- icon: ae,
651
+ icon: re,
654
652
  props: {
655
- styles: c({ default: "" }),
653
+ styles: i({ default: "" }),
656
654
  content: T({ title: "Content", default: "Table cell item" })
657
655
  }
658
656
  });
659
- const He = (t) => {
660
- const { blockProps: e, errorMessage: l, name: o, _type: a, successMessage: r, action: n, styles: i, children: p } = t;
661
- if (!p && k(i == null ? void 0 : i.className))
662
- return /* @__PURE__ */ s.jsx(g, { blockProps: e, text: "FORM FIELDS" });
657
+ const Re = (t) => {
658
+ const { blockProps: e, errorMessage: l, name: a, _type: s, successMessage: o, action: n, styles: c, children: p } = t;
659
+ if (!p && k(c == null ? void 0 : c.className))
660
+ return /* @__PURE__ */ r.jsx(g, { blockProps: e, text: "FORM FIELDS" });
663
661
  const m = {
664
662
  "x-data": "useForm",
665
663
  "x-on:submit.prevent": "post"
@@ -667,33 +665,33 @@ const He = (t) => {
667
665
  "x-html": "formResponse",
668
666
  ":class": "{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"
669
667
  };
670
- return /* @__PURE__ */ s.jsxs(
668
+ return /* @__PURE__ */ r.jsxs(
671
669
  "form",
672
670
  {
673
671
  ...m,
674
672
  "data-error": l,
675
- "data-success": r,
673
+ "data-success": o,
676
674
  method: "post",
677
675
  action: n,
678
676
  ...e,
679
- ...i,
677
+ ...c,
680
678
  children: [
681
- /* @__PURE__ */ s.jsx("div", { ...y }),
682
- /* @__PURE__ */ s.jsx("input", { name: "formname", type: "hidden", value: o || a }),
679
+ /* @__PURE__ */ r.jsx("div", { ...y }),
680
+ /* @__PURE__ */ r.jsx("input", { name: "formname", type: "hidden", value: a || s }),
683
681
  p
684
682
  ]
685
683
  }
686
684
  );
687
685
  };
688
- u(He, {
686
+ u(Re, {
689
687
  type: "Form",
690
688
  label: "Form",
691
689
  category: "core",
692
- icon: se,
690
+ icon: ne,
693
691
  group: "form",
694
692
  hidden: !0,
695
693
  props: {
696
- styles: c({ default: "" }),
694
+ styles: i({ default: "" }),
697
695
  action: f({
698
696
  title: "Submit URL",
699
697
  default: "/api/form/submit"
@@ -709,80 +707,167 @@ u(He, {
709
707
  },
710
708
  canAcceptBlock: () => !0
711
709
  });
712
- const Re = (t) => {
713
- const { blockProps: e, content: l, styles: o, children: a } = t, r = { ...o, ...e };
714
- return a ? d.createElement("label", r, a) : d.createElement("label", {
715
- ...r,
710
+ const Ae = (t) => {
711
+ const { blockProps: e, content: l, styles: a, children: s } = t, o = { ...a, ...e };
712
+ return s ? d.createElement("label", o, s) : d.createElement("label", {
713
+ ...o,
716
714
  dangerouslySetInnerHTML: { __html: l }
717
715
  });
718
716
  };
719
- u(Re, {
717
+ u(Ae, {
720
718
  type: "Label",
721
719
  label: "Label",
722
720
  category: "core",
723
- icon: ne,
721
+ icon: ce,
724
722
  group: "form",
725
723
  hidden: !0,
726
724
  props: {
727
- styles: c({ default: "" }),
725
+ styles: i({ default: "" }),
728
726
  content: f({ title: "Content", default: "Label" })
729
727
  }
730
728
  });
731
- const Ae = (t) => {
729
+ const Fe = (t) => {
730
+ const { blockProps: e, inBuilder: l, label: a, placeholder: s, styles: o, inputStyles: n, icon: c, iconPos: p } = t, m = x(), y = {
731
+ "x-bind:disabled": "formLoading"
732
+ };
733
+ return /* @__PURE__ */ r.jsxs(
734
+ "button",
735
+ {
736
+ id: m,
737
+ ...y,
738
+ ...n,
739
+ ...o,
740
+ ...e || {},
741
+ type: l ? "button" : "submit",
742
+ placeholder: s,
743
+ children: [
744
+ a,
745
+ c && /* @__PURE__ */ r.jsx("span", { className: p, dangerouslySetInnerHTML: { __html: c } })
746
+ ]
747
+ }
748
+ );
749
+ };
750
+ u(Fe, {
751
+ type: "FormButton",
752
+ label: "Submit Button",
753
+ category: "core",
754
+ icon: R,
755
+ group: "form",
756
+ hidden: !0,
757
+ props: {
758
+ label: f({ title: "Label", default: "Submit" }),
759
+ styles: i({
760
+ default: "text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"
761
+ }),
762
+ icon: P({ title: "Icon", default: "" }),
763
+ iconPos: I({
764
+ title: "Icon Position",
765
+ default: "order-last",
766
+ options: [
767
+ { title: "Start", value: "order-first" },
768
+ { title: "End", value: "order-last" }
769
+ ]
770
+ })
771
+ }
772
+ });
773
+ const De = (t) => {
774
+ const { blockProps: e, fieldName: l, label: a, styles: s, inputStyles: o, required: n, checked: c, showLabel: p = !0 } = t, m = x();
775
+ return p ? /* @__PURE__ */ r.jsxs("div", { ...s, ...e, children: [
776
+ /* @__PURE__ */ r.jsx(
777
+ "input",
778
+ {
779
+ ...o,
780
+ name: l,
781
+ id: m,
782
+ type: "checkbox",
783
+ required: n,
784
+ defaultChecked: c
785
+ }
786
+ ),
787
+ a && a !== "Label" && /* @__PURE__ */ r.jsx("label", { htmlFor: m, children: a })
788
+ ] }) : /* @__PURE__ */ r.jsx(
789
+ "input",
790
+ {
791
+ id: m,
792
+ ...e,
793
+ ...o,
794
+ ...s,
795
+ type: "checkbox",
796
+ required: n,
797
+ name: l
798
+ }
799
+ );
800
+ };
801
+ u(De, {
802
+ type: "Checkbox",
803
+ label: "Checkbox",
804
+ category: "core",
805
+ icon: ie,
806
+ group: "form",
807
+ hidden: !0,
808
+ props: {
809
+ fieldName: f({ title: "Field Name", default: "checkbox" }),
810
+ styles: i({ default: "flex items-center gap-x-2" }),
811
+ label: f({ title: "Label", default: "Label" }),
812
+ checked: h({ title: "Checked", default: !1 }),
813
+ required: h({ title: "Required", default: !1 })
814
+ }
815
+ });
816
+ const $e = (t) => {
732
817
  const {
733
818
  blockProps: e,
734
819
  label: l,
735
- placeholder: o,
736
- styles: a,
737
- inputStyles: r,
820
+ placeholder: a,
821
+ styles: s,
822
+ inputStyles: o,
738
823
  showLabel: n,
739
- required: i,
824
+ required: c,
740
825
  inputType: p = "text",
741
826
  inBuilder: m,
742
827
  fieldName: y
743
828
  } = t, b = x();
744
- return !n || p === "submit" ? (p === "submit" && (e.value = l), /* @__PURE__ */ s.jsx(
829
+ return !n || p === "submit" ? (p === "submit" && (e.value = l), /* @__PURE__ */ r.jsx(
745
830
  "input",
746
831
  {
747
832
  id: b,
748
833
  name: y,
749
834
  readOnly: m,
750
835
  ...e,
751
- ...r,
752
- ...a,
836
+ ...o,
837
+ ...s,
753
838
  type: p,
754
- placeholder: o,
755
- required: i
839
+ placeholder: a,
840
+ required: c
756
841
  }
757
- )) : /* @__PURE__ */ s.jsxs("div", { ...a, ...e, children: [
758
- n && /* @__PURE__ */ s.jsx("label", { htmlFor: b, children: l }),
759
- /* @__PURE__ */ s.jsx(
842
+ )) : /* @__PURE__ */ r.jsxs("div", { ...s, ...e, children: [
843
+ n && /* @__PURE__ */ r.jsx("label", { htmlFor: b, children: l }),
844
+ /* @__PURE__ */ r.jsx(
760
845
  "input",
761
846
  {
762
847
  name: y,
763
848
  readOnly: m,
764
- ...r,
849
+ ...o,
765
850
  id: b,
766
851
  type: p,
767
- placeholder: o,
768
- required: i
852
+ placeholder: a,
853
+ required: c
769
854
  }
770
855
  )
771
856
  ] });
772
857
  };
773
- u(Ae, {
858
+ u($e, {
774
859
  type: "Input",
775
860
  label: "Input",
776
861
  category: "core",
777
- icon: A,
862
+ icon: F,
778
863
  group: "form",
779
864
  hidden: !0,
780
865
  props: {
781
- styles: c({ default: "" }),
866
+ styles: i({ default: "" }),
782
867
  fieldName: f({ title: "Field Name", default: "input" }),
783
868
  inputType: I({
784
869
  title: "Type",
785
- options: _(
870
+ options: j(
786
871
  ["text", "email", "password", "number", "tel", "file", "hidden", "range", "submit", "color", "date", "time"],
787
872
  (t) => ({
788
873
  value: t,
@@ -793,7 +878,7 @@ u(Ae, {
793
878
  }),
794
879
  value: f({ title: "Value", default: "" }),
795
880
  showLabel: h({ title: "Show label", default: !0 }),
796
- inputStyles: c({ default: "w-full p-1" }),
881
+ inputStyles: i({ default: "w-full p-1" }),
797
882
  label: f({ title: "Label", default: "Label" }),
798
883
  placeholder: f({
799
884
  title: "Placeholder",
@@ -802,70 +887,66 @@ u(Ae, {
802
887
  required: h({ title: "Required", default: !1 })
803
888
  }
804
889
  });
805
- const Fe = (t) => {
806
- const { blockProps: e, fieldName: l, label: o, placeholder: a, styles: r, inputStyles: n, _rows: i, showLabel: p } = t, m = x();
807
- return p ? /* @__PURE__ */ s.jsxs("div", { ...r, ...e, children: [
808
- p && /* @__PURE__ */ s.jsx("label", { htmlFor: m, children: o }),
809
- /* @__PURE__ */ s.jsx("textarea", { name: l, ...n, id: m, placeholder: a, rows: i })
810
- ] }) : /* @__PURE__ */ s.jsx(
811
- "textarea",
890
+ const qe = (t) => {
891
+ const { blockProps: e, fieldName: l, label: a, styles: s, inputStyles: o, checked: n, required: c, showLabel: p = !0 } = t, m = x();
892
+ return p ? /* @__PURE__ */ r.jsxs("div", { ...s, ...e, children: [
893
+ /* @__PURE__ */ r.jsx("input", { ...o, name: l, id: m, type: "radio", required: c, defaultChecked: n }),
894
+ a && /* @__PURE__ */ r.jsx("label", { htmlFor: m, children: a })
895
+ ] }) : /* @__PURE__ */ r.jsx(
896
+ "input",
812
897
  {
813
898
  id: m,
814
- name: l,
815
899
  ...e,
816
- ...n,
817
- ...r,
818
- placeholder: a,
819
- rows: i
900
+ ...o,
901
+ ...s,
902
+ type: "radio",
903
+ required: c,
904
+ checked: n,
905
+ name: l
820
906
  }
821
907
  );
822
908
  };
823
- u(Fe, {
824
- type: "TextArea",
825
- label: "TextArea",
909
+ u(qe, {
910
+ type: "Radio",
911
+ label: "Radio",
826
912
  category: "core",
827
- icon: A,
913
+ icon: de,
828
914
  group: "form",
829
915
  hidden: !0,
830
916
  props: {
831
- fieldName: f({ title: "Field Name", default: "textarea" }),
832
- showLabel: h({ title: "Show label", default: !0 }),
833
- styles: c({ default: "" }),
834
- inputStyles: c({ default: "w-full p-1" }),
917
+ styles: i({ default: "flex items-center w-max gap-x-2" }),
918
+ fieldName: f({ title: "Field Name", default: "radio" }),
835
919
  label: f({ title: "Label", default: "Label" }),
836
- placeholder: f({
837
- title: "Placeholder",
838
- default: "Placeholder"
839
- }),
840
- _rows: M({ title: "Rows", default: 3 })
920
+ checked: h({ title: "Checked", default: !1 }),
921
+ required: h({ title: "Required", default: !1 })
841
922
  }
842
923
  });
843
924
  const ze = (t) => {
844
925
  const {
845
926
  blockProps: e,
846
927
  fieldName: l,
847
- label: o,
848
- placeholder: a,
849
- styles: r,
928
+ label: a,
929
+ placeholder: s,
930
+ styles: o,
850
931
  inputStyles: n,
851
- required: i,
932
+ required: c,
852
933
  showLabel: p,
853
934
  _multiple: m = !1
854
935
  } = t, y = x();
855
- return p ? /* @__PURE__ */ s.jsxs("div", { ...r, children: [
856
- p && /* @__PURE__ */ s.jsx("label", { htmlFor: y, children: o }),
857
- /* @__PURE__ */ s.jsxs(
936
+ return p ? /* @__PURE__ */ r.jsxs("div", { ...o, children: [
937
+ p && /* @__PURE__ */ r.jsx("label", { htmlFor: y, children: a }),
938
+ /* @__PURE__ */ r.jsxs(
858
939
  "select",
859
940
  {
860
941
  ...n,
861
942
  id: y,
862
- placeholder: a,
863
- required: i,
943
+ placeholder: s,
944
+ required: c,
864
945
  multiple: m,
865
946
  name: l,
866
947
  children: [
867
- /* @__PURE__ */ s.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: a }),
868
- _(t.options, (b) => /* @__PURE__ */ s.jsx(
948
+ /* @__PURE__ */ r.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: s }),
949
+ j(t.options, (b) => /* @__PURE__ */ r.jsx(
869
950
  "option",
870
951
  {
871
952
  selected: v(b, "selected", !1),
@@ -877,19 +958,19 @@ const ze = (t) => {
877
958
  ]
878
959
  }
879
960
  )
880
- ] }) : /* @__PURE__ */ s.jsxs(
961
+ ] }) : /* @__PURE__ */ r.jsxs(
881
962
  "select",
882
963
  {
883
964
  id: y,
884
- ...r,
965
+ ...o,
885
966
  ...e,
886
- placeholder: a,
887
- required: i,
967
+ placeholder: s,
968
+ required: c,
888
969
  multiple: m,
889
970
  name: l,
890
971
  children: [
891
- /* @__PURE__ */ s.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: a }),
892
- _(t.options, (b) => /* @__PURE__ */ s.jsx(
972
+ /* @__PURE__ */ r.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: s }),
973
+ j(t.options, (b) => /* @__PURE__ */ r.jsx(
893
974
  "option",
894
975
  {
895
976
  selected: v(b, "selected", !1),
@@ -906,14 +987,14 @@ u(ze, {
906
987
  type: "Select",
907
988
  label: "Select",
908
989
  category: "core",
909
- icon: ie,
990
+ icon: ue,
910
991
  group: "form",
911
992
  hidden: !0,
912
993
  props: {
913
- styles: c({ default: "" }),
994
+ styles: i({ default: "" }),
914
995
  fieldName: f({ title: "Field Name", default: "select" }),
915
996
  showLabel: h({ title: "Show label", default: !0 }),
916
- inputStyles: c({ default: "w-full p-1" }),
997
+ inputStyles: i({ default: "w-full p-1" }),
917
998
  label: f({ title: "Label", default: "Label" }),
918
999
  placeholder: f({
919
1000
  title: "Placeholder",
@@ -921,7 +1002,7 @@ u(ze, {
921
1002
  }),
922
1003
  required: h({ title: "Required", default: !1 }),
923
1004
  _multiple: h({ title: "Multiple Choice", default: !1 }),
924
- options: O({
1005
+ options: V({
925
1006
  title: "Options",
926
1007
  itemProperties: {
927
1008
  label: f({ title: "Label", default: "" }),
@@ -930,128 +1011,45 @@ u(ze, {
930
1011
  })
931
1012
  }
932
1013
  });
933
- const De = (t) => {
934
- const { blockProps: e, fieldName: l, label: o, styles: a, inputStyles: r, required: n, checked: i, showLabel: p = !0 } = t, m = x();
935
- return p ? /* @__PURE__ */ s.jsxs("div", { ...a, ...e, children: [
936
- /* @__PURE__ */ s.jsx(
937
- "input",
938
- {
939
- ...r,
940
- name: l,
941
- id: m,
942
- type: "checkbox",
943
- required: n,
944
- defaultChecked: i
945
- }
946
- ),
947
- o && o !== "Label" && /* @__PURE__ */ s.jsx("label", { htmlFor: m, children: o })
948
- ] }) : /* @__PURE__ */ s.jsx(
949
- "input",
950
- {
951
- id: m,
952
- ...e,
953
- ...r,
954
- ...a,
955
- type: "checkbox",
956
- required: n,
957
- name: l
958
- }
959
- );
960
- };
961
- u(De, {
962
- type: "Checkbox",
963
- label: "Checkbox",
964
- category: "core",
965
- icon: ce,
966
- group: "form",
967
- hidden: !0,
968
- props: {
969
- fieldName: f({ title: "Field Name", default: "checkbox" }),
970
- styles: c({ default: "flex items-center gap-x-2" }),
971
- label: f({ title: "Label", default: "Label" }),
972
- checked: h({ title: "Checked", default: !1 }),
973
- required: h({ title: "Required", default: !1 })
974
- }
975
- });
976
- const qe = (t) => {
977
- const { blockProps: e, fieldName: l, label: o, styles: a, inputStyles: r, checked: n, required: i, showLabel: p = !0 } = t, m = x();
978
- return p ? /* @__PURE__ */ s.jsxs("div", { ...a, ...e, children: [
979
- /* @__PURE__ */ s.jsx("input", { ...r, name: l, id: m, type: "radio", required: i, defaultChecked: n }),
980
- o && /* @__PURE__ */ s.jsx("label", { htmlFor: m, children: o })
981
- ] }) : /* @__PURE__ */ s.jsx(
982
- "input",
1014
+ const Oe = (t) => {
1015
+ const { blockProps: e, fieldName: l, label: a, placeholder: s, styles: o, inputStyles: n, _rows: c, showLabel: p } = t, m = x();
1016
+ return p ? /* @__PURE__ */ r.jsxs("div", { ...o, ...e, children: [
1017
+ p && /* @__PURE__ */ r.jsx("label", { htmlFor: m, children: a }),
1018
+ /* @__PURE__ */ r.jsx("textarea", { name: l, ...n, id: m, placeholder: s, rows: c })
1019
+ ] }) : /* @__PURE__ */ r.jsx(
1020
+ "textarea",
983
1021
  {
984
1022
  id: m,
1023
+ name: l,
985
1024
  ...e,
986
- ...r,
987
- ...a,
988
- type: "radio",
989
- required: i,
990
- checked: n,
991
- name: l
992
- }
993
- );
994
- };
995
- u(qe, {
996
- type: "Radio",
997
- label: "Radio",
998
- category: "core",
999
- icon: de,
1000
- group: "form",
1001
- hidden: !0,
1002
- props: {
1003
- styles: c({ default: "flex items-center w-max gap-x-2" }),
1004
- fieldName: f({ title: "Field Name", default: "radio" }),
1005
- label: f({ title: "Label", default: "Label" }),
1006
- checked: h({ title: "Checked", default: !1 }),
1007
- required: h({ title: "Required", default: !1 })
1008
- }
1009
- });
1010
- const $e = (t) => {
1011
- const { blockProps: e, inBuilder: l, label: o, placeholder: a, styles: r, inputStyles: n, icon: i, iconPos: p } = t, m = x(), y = {
1012
- "x-bind:disabled": "formLoading"
1013
- };
1014
- return /* @__PURE__ */ s.jsxs(
1015
- "button",
1016
- {
1017
- id: m,
1018
- ...y,
1019
1025
  ...n,
1020
- ...r,
1021
- ...e || {},
1022
- type: l ? "button" : "submit",
1023
- placeholder: a,
1024
- children: [
1025
- o,
1026
- i && /* @__PURE__ */ s.jsx("span", { className: p, dangerouslySetInnerHTML: { __html: i } })
1027
- ]
1026
+ ...o,
1027
+ placeholder: s,
1028
+ rows: c
1028
1029
  }
1029
1030
  );
1030
1031
  };
1031
- u($e, {
1032
- type: "FormButton",
1033
- label: "Submit Button",
1032
+ u(Oe, {
1033
+ type: "TextArea",
1034
+ label: "TextArea",
1034
1035
  category: "core",
1035
- icon: H,
1036
+ icon: F,
1036
1037
  group: "form",
1037
1038
  hidden: !0,
1038
1039
  props: {
1039
- label: f({ title: "Label", default: "Submit" }),
1040
- styles: c({
1041
- default: "text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"
1040
+ fieldName: f({ title: "Field Name", default: "textarea" }),
1041
+ showLabel: h({ title: "Show label", default: !0 }),
1042
+ styles: i({ default: "" }),
1043
+ inputStyles: i({ default: "w-full p-1" }),
1044
+ label: f({ title: "Label", default: "Label" }),
1045
+ placeholder: f({
1046
+ title: "Placeholder",
1047
+ default: "Placeholder"
1042
1048
  }),
1043
- icon: E({ title: "Icon", default: "" }),
1044
- iconPos: I({
1045
- title: "Icon Position",
1046
- default: "order-last",
1047
- options: [
1048
- { title: "Start", value: "order-first" },
1049
- { title: "End", value: "order-last" }
1050
- ]
1051
- })
1049
+ _rows: w({ title: "Rows", default: 3 })
1052
1050
  }
1053
1051
  });
1054
- const Ke = D;
1052
+ const Qe = q;
1055
1053
  export {
1056
- Ke as loadWebBlocks
1054
+ Qe as loadWebBlocks
1057
1055
  };