@chaibuilder/sdk 1.2.91 → 1.2.92

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 (44) hide show
  1. package/dist/CodeEditor-awVVPqel.cjs +1 -0
  2. package/dist/{CodeEditor-_Pim7pDO.js → CodeEditor-orTEdw7a.js} +30 -28
  3. package/dist/Topbar--KOfsR94.cjs +1 -0
  4. package/dist/{Topbar-4ejjKoRn.js → Topbar-OPlOc1Ha.js} +21 -19
  5. package/dist/{UnsplashImages-fpbR9Jbs.js → UnsplashImages-WaGyNL1z.js} +35 -33
  6. package/dist/UnsplashImages-g-8MvB9W.cjs +1 -0
  7. package/dist/{UploadImages-9hzL5Hu1.js → UploadImages-GiKofaXX.js} +37 -62
  8. package/dist/UploadImages-Ic_iZgWY.cjs +1 -0
  9. package/dist/_commonjsHelpers-f3sTPFkQ.js +8 -0
  10. package/dist/_commonjsHelpers-f52AuuUj.cjs +1 -0
  11. package/dist/button-9Duvj2dH.js +42 -0
  12. package/dist/button-oQgWN0j0.cjs +1 -0
  13. package/dist/context-menu-8MWP_Ikf.cjs +1 -0
  14. package/dist/{context-menu-9cWJcKdh.js → context-menu-yLeOsx9j.js} +427 -463
  15. package/dist/core.cjs +1 -1
  16. package/dist/core.d.ts +34 -11
  17. package/dist/core.js +79 -75
  18. package/dist/iconBase-BnEC5_qG.js +1583 -0
  19. package/dist/iconBase-_bgMuxa5.cjs +1 -0
  20. package/dist/index-Hj8wMhx_.cjs +223 -0
  21. package/dist/{index-ry3B_D93.js → index-yJ1H6b2C.js} +9626 -10795
  22. package/dist/plugin-02QsHeBE.cjs +1 -0
  23. package/dist/{plugin-P0tpo_XZ.cjs → plugin-BXpjdQxx.cjs} +1 -1
  24. package/dist/{plugin-f5uJtdXY.js → plugin-DdKuAR7p.js} +1 -1
  25. package/dist/plugin-VDzc8jUO.js +52 -0
  26. package/dist/render.cjs +2 -2
  27. package/dist/render.js +7 -6
  28. package/dist/tailwind.cjs +1 -1
  29. package/dist/tailwind.js +7 -6
  30. package/dist/ui.cjs +1 -1
  31. package/dist/ui.js +113 -112
  32. package/dist/web-blocks.cjs +1 -1
  33. package/dist/web-blocks.js +344 -289
  34. package/package.json +2 -2
  35. package/dist/CodeEditor-Imjgt7mh.cjs +0 -1
  36. package/dist/Topbar-irIirqy7.cjs +0 -1
  37. package/dist/UnsplashImages-NfwOtGHo.cjs +0 -1
  38. package/dist/UploadImages-OVHnYeiL.cjs +0 -1
  39. package/dist/context-menu-sQn7ryJ6.cjs +0 -1
  40. package/dist/iconBase-vJD0OXxU.cjs +0 -1
  41. package/dist/iconBase-zweRWSz0.js +0 -323
  42. package/dist/index-VBJLJ6fO.cjs +0 -223
  43. package/dist/plugin-_F-KZp1i.cjs +0 -1
  44. package/dist/plugin-sJ3Hzvpv.js +0 -57
@@ -1,25 +1,34 @@
1
1
  import { registerChaiBlock as u } from "@chaibuilder/runtime";
2
- import { j as a } from "./jsx-runtime-Sp0orL4X.js";
3
- import * as m from "react";
4
- import { c as j, o as p, f as v, v as C, b, T as N, y as B, u as T, r as L, d as S, q as R, e as k, h as F, G as O, g as I, S as U } from "./iconBase-zweRWSz0.js";
2
+ import { j as o } from "./jsx-runtime-Sp0orL4X.js";
3
+ import * as p from "react";
4
+ import { B as I, W as m, y as v, X as C, Y as b, Z as N, z as j, _ as T, $ as L, a0 as S, a1 as D, a2 as g, a3 as F, G, v as U, U as O, n as V, g as B, a4 as W } from "./iconBase-BnEC5_qG.js";
5
5
  import "i18next";
6
- import { ButtonIcon as H, CodeIcon as V, HeadingIcon as G, TextIcon as W, CursorTextIcon as X, Link1Icon as Y, ImageIcon as z, RowsIcon as Z, ColumnsIcon as J, SketchLogoIcon as K, VideoIcon as Q, DividerHorizontalIcon as ee, MoonIcon as te, SpaceBetweenVerticallyIcon as q, GroupIcon as le, InputIcon as A, RadiobuttonIcon as oe, DropdownMenuIcon as se, CheckboxIcon as ae } from "@radix-ui/react-icons";
7
- import { isNull as ne, isEmpty as g, get as x, pick as re, omit as ce, map as M } from "lodash-es";
6
+ import { ButtonIcon as H, CodeIcon as X, HeadingIcon as Y, TextIcon as Z, CursorTextIcon as J, Link1Icon as K, ImageIcon as z, RowsIcon as Q, ColumnsIcon as ee, SketchLogoIcon as te, VideoIcon as le, DividerHorizontalIcon as oe, MoonIcon as se, SpaceBetweenVerticallyIcon as q, GroupIcon as ae, InputIcon as A, RadiobuttonIcon as re, DropdownMenuIcon as ne, CheckboxIcon as ce } from "@radix-ui/react-icons";
7
+ import { isNull as ie, isEmpty as y, get as x, pick as de, omit as ue, map as M } from "lodash-es";
8
+ import { GlobeIcon as be } from "lucide-react";
9
+ import "react-i18next";
10
+ import { B as pe } from "./button-9Duvj2dH.js";
11
+ import "jotai";
8
12
  import "clsx";
9
13
  import "tailwind-merge";
10
- const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("div", { className: j("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ a.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ a.jsx("div", { className: "flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700" }) }) }) : null, _ = ie, de = (e) => {
11
- const { blockProps: l, inBuilder: t, backgroundImage: s, children: o, tag: n = "div", styles: r } = e;
12
- let i = o;
13
- o || (i = /* @__PURE__ */ a.jsx(_, { inBuilder: t }));
14
+ import "./_commonjsHelpers-f3sTPFkQ.js";
15
+ import "@react-hookz/web";
16
+ import "tree-model";
17
+ import "@radix-ui/react-slot";
18
+ import "class-variance-authority";
19
+ const me = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ o.jsx("div", { className: I("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ o.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ o.jsx("div", { className: "flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700" }) }) }) : null, _ = me, fe = (e) => {
20
+ const { blockProps: l, inBuilder: t, backgroundImage: a, children: s, tag: r = "div", styles: n } = e;
21
+ let i = s;
22
+ s || (i = /* @__PURE__ */ o.jsx(_, { inBuilder: t }));
14
23
  let c = {};
15
- return s && (c = { backgroundImage: `url(${s})` }), m.createElement(n, { ...l, ...r, style: c }, i);
16
- }, ue = {
24
+ return a && (c = { backgroundImage: `url(${a})` }), p.createElement(r, { ...l, ...n, style: c }, i);
25
+ }, he = {
17
26
  type: "Box",
18
27
  label: "web_blocks.box",
19
28
  category: "core",
20
29
  group: "basic",
21
30
  props: {
22
- styles: p({ default: "" }),
31
+ styles: m({ default: "" }),
23
32
  tag: v({
24
33
  title: "web_blocks.tag",
25
34
  default: "div",
@@ -46,28 +55,28 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
46
55
  backgroundImage: C({ title: "web_blocks.background_image" })
47
56
  },
48
57
  canAcceptBlock: () => !0
49
- }, be = (e) => {
50
- const { blockProps: l, iconSize: t, icon: s, content: o, iconPos: n, styles: r, children: i } = e, c = s, d = i || /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
51
- /* @__PURE__ */ a.jsx("span", { "data-ai-key": "content", children: o }),
52
- c && /* @__PURE__ */ a.jsx(
58
+ }, ge = (e) => {
59
+ const { blockProps: l, iconSize: t, icon: a, content: s, iconPos: r, styles: n, children: i } = e, c = a, d = i || /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
60
+ /* @__PURE__ */ o.jsx("span", { "data-ai-key": "content", children: s }),
61
+ c && /* @__PURE__ */ o.jsx(
53
62
  "div",
54
63
  {
55
64
  style: { width: t + "px" },
56
- className: n + " " + (n === "order-first" ? "mr-2" : "ml-2") || "",
65
+ className: r + " " + (r === "order-first" ? "mr-2" : "ml-2") || "",
57
66
  dangerouslySetInnerHTML: { __html: c }
58
67
  }
59
68
  )
60
69
  ] });
61
- return m.createElement(
70
+ return p.createElement(
62
71
  "button",
63
72
  {
64
73
  ...l,
65
- ...r,
74
+ ...n,
66
75
  type: "button"
67
76
  },
68
77
  d
69
78
  );
70
- }, pe = {
79
+ }, ke = {
71
80
  type: "Button",
72
81
  label: "web_blocks.button",
73
82
  category: "core",
@@ -75,9 +84,9 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
75
84
  group: "basic",
76
85
  props: {
77
86
  content: b({ title: "web_blocks.label", default: "Button" }),
78
- styles: p({ default: "text-white bg-primary px-4 py-2 rounded-global flex items-center" }),
87
+ styles: m({ default: "text-white bg-primary px-4 py-2 rounded-global flex items-center" }),
79
88
  icon: N({ title: "web_blocks.icon", default: "" }),
80
- iconSize: B({ title: "web_blocks.icon_size", default: 24 }),
89
+ iconSize: j({ title: "web_blocks.icon_size", default: 24 }),
81
90
  iconPos: v({
82
91
  title: "web_blocks.icon_position",
83
92
  default: "order-last",
@@ -87,61 +96,61 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
87
96
  ]
88
97
  })
89
98
  }
90
- }, me = (e) => {
91
- const { blockProps: l, styles: t, htmlCode: s, inBuilder: o } = e;
92
- return o ? /* @__PURE__ */ a.jsxs("div", { className: "relative", children: [
93
- o ? /* @__PURE__ */ a.jsx("div", { ...l, ...t, className: "absolute z-20 h-full w-full" }) : null,
94
- m.createElement("div", {
99
+ }, ye = (e) => {
100
+ const { blockProps: l, styles: t, htmlCode: a, inBuilder: s } = e;
101
+ return s ? /* @__PURE__ */ o.jsxs("div", { className: "relative", children: [
102
+ s ? /* @__PURE__ */ o.jsx("div", { ...l, ...t, className: "absolute z-20 h-full w-full" }) : null,
103
+ p.createElement("div", {
95
104
  ...t,
96
- dangerouslySetInnerHTML: { __html: s.replace(/<script.*?>.*?<\/script>/g, "") }
105
+ dangerouslySetInnerHTML: { __html: a.replace(/<script.*?>.*?<\/script>/g, "") }
97
106
  })
98
- ] }) : m.createElement("div", {
107
+ ] }) : p.createElement("div", {
99
108
  ...l,
100
109
  ...t,
101
- dangerouslySetInnerHTML: { __html: s }
110
+ dangerouslySetInnerHTML: { __html: a }
102
111
  });
103
- }, fe = {
112
+ }, _e = {
104
113
  type: "CustomHTML",
105
114
  label: "web_blocks.custom_html",
106
115
  category: "core",
107
- icon: V,
116
+ icon: X,
108
117
  group: "advanced",
109
118
  props: {
110
- styles: p({ default: "" }),
119
+ styles: m({ default: "" }),
111
120
  htmlCode: T({
112
121
  title: "web_blocks.html_code",
113
122
  default: "<div><p>Enter your HTML code here...</p></div>",
114
123
  placeholder: "web_blocks.placeholder"
115
124
  })
116
125
  }
117
- }, he = m.memo(
126
+ }, we = p.memo(
118
127
  (e) => {
119
128
  const { blockProps: l, styles: t } = e;
120
- return m.createElement("div", { ...l, ...t });
129
+ return p.createElement("div", { ...l, ...t });
121
130
  }
122
- ), ke = {
131
+ ), xe = {
123
132
  type: "EmptyBox",
124
133
  label: "web_blocks.empty_box",
125
134
  category: "core",
126
135
  group: "basic",
127
136
  props: {
128
- styles: p({ default: "" }),
137
+ styles: m({ default: "" }),
129
138
  backgroundImage: C({ title: "web_blocks.background_image" })
130
139
  }
131
- }, ye = (e) => {
132
- const { blockProps: l, styles: t, content: s, level: o = "h1", children: n = null } = e;
133
- return n ? m.createElement(o, { ...t, ...l }, n) : m.createElement(o, {
140
+ }, ve = (e) => {
141
+ const { blockProps: l, styles: t, content: a, level: s = "h1", children: r = null } = e;
142
+ return r ? p.createElement(s, { ...t, ...l }, r) : p.createElement(s, {
134
143
  ...t,
135
144
  ...l,
136
145
  "data-ai-key": "content",
137
146
  "data-ai-type": "html",
138
- dangerouslySetInnerHTML: { __html: s }
147
+ dangerouslySetInnerHTML: { __html: a }
139
148
  });
140
- }, ge = {
149
+ }, Be = {
141
150
  type: "Heading",
142
151
  label: "web_blocks.heading",
143
152
  category: "core",
144
- icon: G,
153
+ icon: Y,
145
154
  group: "typography",
146
155
  props: {
147
156
  level: v({
@@ -157,134 +166,134 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
157
166
  { value: "h6", title: "h6" }
158
167
  ]
159
168
  }),
160
- styles: p({ default: "text-3xl" }),
169
+ styles: m({ default: "text-3xl" }),
161
170
  content: L({ title: "web_blocks.content", default: "Heading goes here" })
162
171
  },
163
172
  canAcceptBlock: (e) => e === "Span" || e === "Text"
164
- }, _e = (e) => {
165
- const { blockProps: l, styles: t, content: s } = e;
166
- return ne(e.children) ? m.createElement("p", {
173
+ }, je = (e) => {
174
+ const { blockProps: l, styles: t, content: a } = e;
175
+ return ie(e.children) ? p.createElement("p", {
167
176
  ...t,
168
177
  ...l,
169
178
  "data-ai-key": "content",
170
179
  "data-ai-type": "html",
171
- dangerouslySetInnerHTML: { __html: s }
172
- }) : m.createElement("p", { ...t, ...l }, e.children);
173
- }, we = {
180
+ dangerouslySetInnerHTML: { __html: a }
181
+ }) : p.createElement("p", { ...t, ...l }, e.children);
182
+ }, Ie = {
174
183
  type: "Paragraph",
175
184
  label: "web_blocks.paragraph",
176
185
  category: "core",
177
- icon: W,
186
+ icon: Z,
178
187
  group: "typography",
179
188
  props: {
180
- styles: p({ default: "" }),
189
+ styles: m({ default: "" }),
181
190
  content: L({
182
191
  title: "web_blocks.content",
183
192
  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."
184
193
  })
185
194
  },
186
195
  canAcceptBlock: (e) => e === "Span" || e === "Link" || e === "Text"
187
- }, xe = (e) => {
188
- const { blockProps: l, styles: t, content: s, children: o = null, tag: n } = e;
189
- return o ? m.createElement("span", { ...t, ...l }, o) : m.createElement(n || "span", {
196
+ }, Le = (e) => {
197
+ const { blockProps: l, styles: t, content: a, children: s = null, tag: r } = e;
198
+ return s ? p.createElement("span", { ...t, ...l }, s) : p.createElement(r || "span", {
190
199
  ...t,
191
200
  ...l,
192
201
  "data-ai-key": "content",
193
- dangerouslySetInnerHTML: { __html: s }
202
+ dangerouslySetInnerHTML: { __html: a }
194
203
  });
195
- }, ve = {
204
+ }, Ce = {
196
205
  type: "Span",
197
206
  label: "web_blocks.span",
198
207
  category: "core",
199
208
  group: "typography",
200
209
  props: {
201
- styles: p({ default: "" }),
210
+ styles: m({ default: "" }),
202
211
  content: L({ title: "web_blocks.content", default: "" })
203
212
  },
204
213
  canAcceptBlock: () => !0
205
- }, Ie = (e) => {
206
- const { blockProps: l, content: t, styles: s } = e;
207
- return /* @__PURE__ */ a.jsx("div", { className: "max-w-full", children: /* @__PURE__ */ a.jsx(
214
+ }, Se = (e) => {
215
+ const { blockProps: l, content: t, styles: a } = e;
216
+ return /* @__PURE__ */ o.jsx("div", { className: "max-w-full", children: /* @__PURE__ */ o.jsx(
208
217
  "div",
209
218
  {
210
219
  "data-ai-key": "content",
211
220
  "data-ai-type": "richtext",
212
221
  ...l,
213
- ...s,
222
+ ...a,
214
223
  dangerouslySetInnerHTML: { __html: t }
215
224
  }
216
225
  ) });
217
- }, Be = {
226
+ }, Me = {
218
227
  type: "RichText",
219
228
  label: "web_blocks.richtext",
220
229
  category: "core",
221
- icon: X,
230
+ icon: J,
222
231
  group: "typography",
223
232
  props: {
224
- styles: p({ default: "" }),
233
+ styles: m({ default: "" }),
225
234
  content: S({
226
235
  title: "web_blocks.content",
227
236
  default: "<p>This is a rich text block. You can add text, and other content here.</p>"
228
237
  })
229
238
  }
230
- }, je = (e) => {
231
- const { blockProps: l, link: t, children: s, styles: o, inBuilder: n, content: r } = e;
232
- return !s && g(o == null ? void 0 : o.className) && g(r) ? /* @__PURE__ */ a.jsx(_, { inBuilder: n }) : n ? s ? /* @__PURE__ */ a.jsx("span", { ...l, ...o, children: s }) : m.createElement("span", {
239
+ }, Ne = (e) => {
240
+ const { blockProps: l, link: t, children: a, styles: s, inBuilder: r, content: n } = e;
241
+ return !a && y(s == null ? void 0 : s.className) && y(n) ? /* @__PURE__ */ o.jsx(_, { inBuilder: r }) : r ? a ? /* @__PURE__ */ o.jsx("span", { ...l, ...s, children: a }) : p.createElement("span", {
233
242
  ...l,
234
- ...o,
235
- dangerouslySetInnerHTML: { __html: r }
236
- }) : s ? /* @__PURE__ */ a.jsx("a", { href: (t == null ? void 0 : t.href) || "#/", target: t == null ? void 0 : t.target, ...l, ...o, children: s }) : m.createElement("a", {
243
+ ...s,
244
+ dangerouslySetInnerHTML: { __html: n }
245
+ }) : a ? /* @__PURE__ */ o.jsx("a", { href: (t == null ? void 0 : t.href) || "#/", target: t == null ? void 0 : t.target, ...l, ...s, children: a }) : p.createElement("a", {
237
246
  ...l,
238
- ...o,
247
+ ...s,
239
248
  "data-ai-key": "content",
240
249
  href: (t == null ? void 0 : t.href) || "#",
241
250
  target: (t == null ? void 0 : t.target) || "_self",
242
- dangerouslySetInnerHTML: { __html: r }
251
+ dangerouslySetInnerHTML: { __html: n }
243
252
  });
244
- }, Le = {
253
+ }, $e = {
245
254
  type: "Link",
246
255
  label: "web_blocks.link",
247
256
  category: "core",
248
- icon: Y,
257
+ icon: K,
249
258
  group: "basic",
250
259
  props: {
251
- styles: p({ default: "" }),
260
+ styles: m({ default: "" }),
252
261
  content: b({ title: "web_blocks.content", default: "" }),
253
- link: R({
262
+ link: D({
254
263
  title: "web_blocks.link",
255
264
  default: { type: "page", target: "_self", href: "#" }
256
265
  })
257
266
  },
258
267
  canAcceptBlock: (e) => e !== "Link"
259
- }, D = (e, ...l) => ({
268
+ }, R = (e, ...l) => ({
260
269
  ...e,
261
- className: j(e.className, ...l)
262
- }), Ce = (e) => {
263
- const { blockProps: l, children: t, styles: s, inBuilder: o, content: n, href: r } = e, { hrefType: i, autoplay: c, maxWidth: d, backdropColor: h, galleryName: f } = e, y = D(s, "cb-lightbox");
264
- if (!t && g(s == null ? void 0 : s.className) && g(n))
265
- return /* @__PURE__ */ a.jsx(_, { inBuilder: o });
266
- if (o)
267
- return t ? /* @__PURE__ */ a.jsx("span", { ...l, ...y, children: t }) : m.createElement("span", {
270
+ className: I(e.className, ...l)
271
+ }), Ee = (e) => {
272
+ const { blockProps: l, children: t, styles: a, inBuilder: s, content: r, href: n } = e, { hrefType: i, autoplay: c, maxWidth: d, backdropColor: h, galleryName: f } = e, k = R(a, "cb-lightbox");
273
+ if (!t && y(a == null ? void 0 : a.className) && y(r))
274
+ return /* @__PURE__ */ o.jsx(_, { inBuilder: s });
275
+ if (s)
276
+ return t ? /* @__PURE__ */ o.jsx("span", { ...l, ...k, children: t }) : p.createElement("span", {
268
277
  ...l,
269
- ...y,
270
- dangerouslySetInnerHTML: { __html: n }
278
+ ...k,
279
+ dangerouslySetInnerHTML: { __html: r }
271
280
  });
272
281
  const w = {};
273
- return w["data-vbtype"] = i, c && (w["data-autoplay"] = "true"), d && (w["data-maxwidth"] = d + "px"), h && (w["data-overlay"] = h), f && (w["data-gall"] = f), t ? /* @__PURE__ */ a.jsx("a", { ...w, href: r || "#/", ...l, ...y, children: t }) : m.createElement("a", {
282
+ return w["data-vbtype"] = i, c && (w["data-autoplay"] = "true"), d && (w["data-maxwidth"] = d + "px"), h && (w["data-overlay"] = h), f && (w["data-gall"] = f), t ? /* @__PURE__ */ o.jsx("a", { ...w, href: n || "#/", ...l, ...k, children: t }) : p.createElement("a", {
274
283
  ...l,
275
- ...y,
284
+ ...k,
276
285
  ...w,
277
- href: r || "#",
278
- dangerouslySetInnerHTML: { __html: n }
286
+ href: n || "#",
287
+ dangerouslySetInnerHTML: { __html: r }
279
288
  });
280
- }, Se = {
289
+ }, Pe = {
281
290
  type: "LightBoxLink",
282
291
  label: "web_blocks.lightbox_link",
283
292
  category: "core",
284
293
  icon: z,
285
294
  group: "basic",
286
295
  props: {
287
- styles: p({ default: "" }),
296
+ styles: m({ default: "" }),
288
297
  content: b({ title: "web_blocks.content", default: "Link text or drop blocks inside" }),
289
298
  href: b({ title: "web_blocks.href", default: "" }),
290
299
  hrefType: v({
@@ -297,27 +306,27 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
297
306
  { value: "ajax", title: "web_blocks.ajax" }
298
307
  ]
299
308
  }),
300
- autoplay: k({ title: "web_blocks.autoplay", default: !1 }),
301
- maxWidth: B({ title: "web_blocks.max_width", default: "" }),
309
+ autoplay: g({ title: "web_blocks.autoplay", default: !1 }),
310
+ maxWidth: j({ title: "web_blocks.max_width", default: "" }),
302
311
  backdropColor: b({ title: "backdrop_color", default: "" }),
303
312
  galleryName: b({ title: "web_blocks.gallery_name", default: "" })
304
313
  },
305
314
  canAcceptBlock: (e) => e !== "Link" && e !== "LightBoxLink"
306
- }, Me = (e) => {
307
- const { blockProps: l, children: t, listType: s, styles: o, tag: n, inBuilder: r } = e, i = j(x(o, "className", ""), s);
308
- return !t && g(o == null ? void 0 : o.className) ? /* @__PURE__ */ a.jsx(_, { inBuilder: r }) : m.createElement(
309
- n || (s === "list-decimal" ? "ol" : "ul"),
310
- { ...l, ...o, className: i },
315
+ }, Te = (e) => {
316
+ const { blockProps: l, children: t, listType: a, styles: s, tag: r, inBuilder: n } = e, i = I(x(s, "className", ""), a);
317
+ return !t && y(s == null ? void 0 : s.className) ? /* @__PURE__ */ o.jsx(_, { inBuilder: n }) : p.createElement(
318
+ r || (a === "list-decimal" ? "ol" : "ul"),
319
+ { ...l, ...s, className: i },
311
320
  t
312
321
  );
313
- }, Ne = {
322
+ }, He = {
314
323
  type: "List",
315
324
  label: "web_blocks.list",
316
- icon: Z,
325
+ icon: Q,
317
326
  category: "core",
318
327
  group: "basic",
319
328
  props: {
320
- styles: p({ default: "" }),
329
+ styles: m({ default: "" }),
321
330
  listType: v({
322
331
  title: "web_blocks.list_type",
323
332
  default: "list-none",
@@ -353,70 +362,70 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
353
362
  content: "Item 3"
354
363
  }
355
364
  ]
356
- }, Ee = (e) => {
357
- const { blockProps: l, content: t, styles: s, children: o, tag: n } = e;
358
- return o ? m.createElement(n || "li", { ...s, ...l }, o) : m.createElement(n || "li", {
359
- ...s,
365
+ }, ze = (e) => {
366
+ const { blockProps: l, content: t, styles: a, children: s, tag: r } = e;
367
+ return s ? p.createElement(r || "li", { ...a, ...l }, s) : p.createElement(r || "li", {
368
+ ...a,
360
369
  ...l,
361
370
  "data-ai-key": "content",
362
371
  dangerouslySetInnerHTML: { __html: t }
363
372
  });
364
- }, $e = {
373
+ }, qe = {
365
374
  type: "ListItem",
366
375
  label: "web_blocks.listitem",
367
- icon: J,
376
+ icon: ee,
368
377
  category: "core",
369
378
  group: "basic",
370
379
  props: {
371
- styles: p({ default: "" }),
380
+ styles: m({ default: "" }),
372
381
  content: L({ title: "web_blocks.content", default: "List item" })
373
382
  },
374
383
  canAcceptBlock: (e) => e !== "ListItem",
375
384
  canBeNested: (e) => e === "List"
376
- }, Pe = (e) => {
377
- const { blockProps: l, icon: t, styles: s, width: o, inBuilder: n, height: r } = e, i = D(s, j(o ? `w-[${o}px]` : "", r ? `h-[${r}px]` : ""));
378
- if (g(t))
379
- return /* @__PURE__ */ a.jsx(_, { inBuilder: n, className: "h-8 w-14" });
385
+ }, Ae = (e) => {
386
+ const { blockProps: l, icon: t, styles: a, width: s, inBuilder: r, height: n } = e, i = R(a, I(s ? `w-[${s}px]` : "", n ? `h-[${n}px]` : ""));
387
+ if (y(t))
388
+ return /* @__PURE__ */ o.jsx(_, { inBuilder: r, className: "h-8 w-14" });
380
389
  const c = t.replace(/<svg /g, '<svg class="w-[inherit] h-[inherit]" ');
381
- return m.createElement("span", {
390
+ return p.createElement("span", {
382
391
  ...l,
383
392
  ...i,
384
393
  dangerouslySetInnerHTML: { __html: c }
385
394
  });
386
- }, Te = {
395
+ }, Re = {
387
396
  type: "Icon",
388
397
  label: "web_blocks.icon",
389
398
  category: "core",
390
- icon: K,
399
+ icon: te,
391
400
  group: "media",
392
401
  props: {
393
- styles: p({ default: "text-black" }),
402
+ styles: m({ default: "text-black" }),
394
403
  icon: N({
395
404
  title: "web_blocks.icon",
396
405
  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>'
397
406
  }),
398
- width: B({ title: "web_blocks.width", default: "" }),
399
- height: B({ title: "web_blocks.height", default: "" })
407
+ width: j({ title: "web_blocks.width", default: "" }),
408
+ height: j({ title: "web_blocks.height", default: "" })
400
409
  }
401
- }, He = (e) => {
402
- const { blockProps: l, image: t, styles: s, alt: o, height: n, width: r } = e;
403
- return g(t) ? /* @__PURE__ */ a.jsx(_, { className: "h-36" }) : m.createElement("img", {
410
+ }, De = (e) => {
411
+ const { blockProps: l, image: t, styles: a, alt: s, height: r, width: n } = e;
412
+ return y(t) ? /* @__PURE__ */ o.jsx(_, { className: "h-36" }) : p.createElement("img", {
404
413
  ...l,
405
- ...s,
414
+ ...a,
406
415
  src: t,
407
- alt: o,
416
+ alt: s,
408
417
  loading: "lazy",
409
- height: n,
410
- width: r
418
+ height: r,
419
+ width: n
411
420
  });
412
- }, ze = {
421
+ }, Fe = {
413
422
  type: "Image",
414
423
  label: "web_blocks.image",
415
424
  category: "core",
416
425
  icon: z,
417
426
  group: "media",
418
427
  props: {
419
- styles: p({ default: "" }),
428
+ styles: m({ default: "" }),
420
429
  image: C({
421
430
  title: "Image",
422
431
  default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
@@ -425,13 +434,13 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
425
434
  width: b({ title: "web_blocks.width", default: "" }),
426
435
  height: b({ title: "web_blocks.height", default: "" })
427
436
  }
428
- }, E = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, $ = /^(https?:\/\/)?(www\.)?player.vimeo\.com/, P = /^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/, qe = (e) => {
429
- if (E.test(e)) {
430
- const l = e.match(E);
431
- return l ? `https://www.youtube.com/embed/${l[4]}` : e;
432
- }
437
+ }, $ = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, E = /^(https?:\/\/)?(www\.)?player.vimeo\.com/, P = /^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/, Ge = (e) => {
433
438
  if ($.test(e)) {
434
439
  const l = e.match($);
440
+ return l ? `https://www.youtube.com/embed/${l[4]}` : e;
441
+ }
442
+ if (E.test(e)) {
443
+ const l = e.match(E);
435
444
  return l ? `https://player.vimeo.com/video/${l[3]}` : e;
436
445
  }
437
446
  if (P.test(e)) {
@@ -439,18 +448,18 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
439
448
  return l ? `https://www.dailymotion.com/embed/video/${l[4]}` : e;
440
449
  }
441
450
  return null;
442
- }, Ae = m.memo(
451
+ }, Ue = p.memo(
443
452
  (e) => {
444
- const { blockProps: l, inBuilder: t, styles: s, url: o, controls: n } = e, r = x(n, "autoPlay", !1), i = x(n, "controls", !1), c = r || x(n, "muted", !0), d = x(n, "loop", !1);
445
- if (g(o))
446
- return /* @__PURE__ */ a.jsx(_, { inBuilder: t, className: "h-36" });
447
- let h = qe(o), f = null;
453
+ const { blockProps: l, inBuilder: t, styles: a, url: s, controls: r } = e, n = x(r, "autoPlay", !1), i = x(r, "controls", !1), c = n || x(r, "muted", !0), d = x(r, "loop", !1);
454
+ if (y(s))
455
+ return /* @__PURE__ */ o.jsx(_, { inBuilder: t, className: "h-36" });
456
+ let h = Ge(s), f = null;
448
457
  if (h) {
449
- if (!g(h)) {
450
- const y = [];
451
- y.push(`autoplay=${r ? 1 : 0}`), y.push(`controls=${n ? 1 : 0}`), y.push(`mute=${c ? 1 : 0}&muted=${c ? 1 : 0}`), y.push(`loop=${d ? 1 : 0}`), h = `${h}?${y.join("&")}`;
458
+ if (!y(h)) {
459
+ const k = [];
460
+ k.push(`autoplay=${n ? 1 : 0}`), k.push(`controls=${r ? 1 : 0}`), k.push(`mute=${c ? 1 : 0}&muted=${c ? 1 : 0}`), k.push(`loop=${d ? 1 : 0}`), h = `${h}?${k.join("&")}`;
452
461
  }
453
- f = m.createElement("iframe", {
462
+ f = p.createElement("iframe", {
454
463
  ...l,
455
464
  className: "absolute inset-0 w-full h-full",
456
465
  src: h,
@@ -459,28 +468,28 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
459
468
  frameBorder: 0
460
469
  });
461
470
  } else
462
- f = m.createElement("video", {
471
+ f = p.createElement("video", {
463
472
  ...l,
464
473
  className: "absolute inset-0 w-full h-full",
465
- src: o,
474
+ src: s,
466
475
  controls: i,
467
476
  muted: c,
468
- autoPlay: t ? !1 : r,
477
+ autoPlay: t ? !1 : n,
469
478
  loop: d
470
479
  });
471
- return /* @__PURE__ */ a.jsx("div", { ...re(s, ["className"]), children: /* @__PURE__ */ a.jsxs("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
472
- t ? /* @__PURE__ */ a.jsx("div", { ...l, ...ce(s, ["className"]), className: "absolute inset-0 z-20 h-full w-full" }) : null,
480
+ return /* @__PURE__ */ o.jsx("div", { ...de(a, ["className"]), children: /* @__PURE__ */ o.jsxs("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
481
+ t ? /* @__PURE__ */ o.jsx("div", { ...l, ...ue(a, ["className"]), className: "absolute inset-0 z-20 h-full w-full" }) : null,
473
482
  f
474
483
  ] }) });
475
484
  }
476
- ), De = {
485
+ ), Oe = {
477
486
  type: "Video",
478
487
  label: "web_blocks.video",
479
488
  category: "core",
480
- icon: Q,
489
+ icon: le,
481
490
  group: "media",
482
491
  props: {
483
- styles: p({ default: "" }),
492
+ styles: m({ default: "" }),
484
493
  url: b({
485
494
  title: "web_blocks.video_url",
486
495
  default: "https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"
@@ -488,25 +497,25 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
488
497
  controls: F({
489
498
  title: "web_blocks.controls",
490
499
  properties: {
491
- autoPlay: k({ title: "web_blocks.autoplay", default: !0 }),
492
- controls: k({ title: "web_blocks.controls", default: !1 }),
493
- loop: k({ title: "web_blocks.loop", default: !1 }),
494
- muted: k({ title: "web_blocks.muted", default: !0 })
500
+ autoPlay: g({ title: "web_blocks.autoplay", default: !0 }),
501
+ controls: g({ title: "web_blocks.controls", default: !1 }),
502
+ loop: g({ title: "web_blocks.loop", default: !1 }),
503
+ muted: g({ title: "web_blocks.muted", default: !0 })
495
504
  }
496
505
  })
497
506
  }
498
507
  };
499
- function Re(e) {
500
- return O({ tag: "svg", attr: { version: "1.1", viewBox: "0 0 32 32" }, child: [{ tag: "path", attr: { d: "M4.698 3.419l2.057 23.073 9.231 2.563 9.256-2.566 2.059-23.069h-22.604zM13.226 9.394l-0.409 4.441 9.671 0.001-0.069 0.76-0.665 7.45-0.042 0.478-5.804 1.609-5.796-1.609-0.396-4.443h2.84l0.202 2.257 3.154 0.85 3.156-0.852 0.328-3.67-9.671-0.001 0.069-0.76 0.665-7.45 0.209-2.086h11.287l0.131 1.598 0.403 4.453h-2.841l-0.262-2.922-2.889-0.174h-0.515v-0.004l-2.755 0.074z" }, child: [] }] })(e);
508
+ function Ve(e) {
509
+ return G({ tag: "svg", attr: { version: "1.1", viewBox: "0 0 32 32" }, child: [{ tag: "path", attr: { d: "M4.698 3.419l2.057 23.073 9.231 2.563 9.256-2.566 2.059-23.069h-22.604zM13.226 9.394l-0.409 4.441 9.671 0.001-0.069 0.76-0.665 7.45-0.042 0.478-5.804 1.609-5.796-1.609-0.396-4.443h2.84l0.202 2.257 3.154 0.85 3.156-0.852 0.328-3.67-9.671-0.001 0.069-0.76 0.665-7.45 0.209-2.086h11.287l0.131 1.598 0.403 4.453h-2.841l-0.262-2.922-2.889-0.174h-0.515v-0.004l-2.755 0.074z" }, child: [] }] })(e);
501
510
  }
502
- const Fe = (e) => {
503
- const { scripts: l, inBuilder: t, blockProps: s } = e;
504
- return t ? /* @__PURE__ */ a.jsx("div", { ...s, children: /* @__PURE__ */ a.jsx("div", { className: j("pointer-events-none flex flex-col items-center justify-center p-2", ""), children: /* @__PURE__ */ a.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800", children: /* @__PURE__ */ a.jsx("p", { className: "text-left text-xs text-gray-400", children: "Scripts will be only executed in preview and live mode. Place your script at the bottom of the" }) }) }) }) : /* @__PURE__ */ a.jsx("div", { dangerouslySetInnerHTML: { __html: l } });
505
- }, Oe = {
511
+ const We = (e) => {
512
+ const { scripts: l, inBuilder: t, blockProps: a } = e;
513
+ return t ? /* @__PURE__ */ o.jsx("div", { ...a, children: /* @__PURE__ */ o.jsx("div", { className: I("pointer-events-none flex flex-col items-center justify-center p-2", ""), children: /* @__PURE__ */ o.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800", children: /* @__PURE__ */ o.jsx("p", { className: "text-left text-xs text-gray-400", children: "Scripts will be only executed in preview and live mode. Place your script at the bottom of the" }) }) }) }) : /* @__PURE__ */ o.jsx("div", { dangerouslySetInnerHTML: { __html: l } });
514
+ }, Xe = {
506
515
  type: "CustomScript",
507
516
  label: "web_blocks.custom_script",
508
517
  category: "core",
509
- icon: Re,
518
+ icon: Ve,
510
519
  group: "advanced",
511
520
  props: {
512
521
  scripts: T({
@@ -515,23 +524,23 @@ const Fe = (e) => {
515
524
  placeholder: "<script>console.log('Hello, world!');<\/script>"
516
525
  })
517
526
  }
518
- }, Ue = (e) => {
527
+ }, Ye = (e) => {
519
528
  const { blockProps: l, styles: t } = e;
520
- return m.createElement("hr", { ...t, ...l });
521
- }, Ve = {
529
+ return p.createElement("hr", { ...t, ...l });
530
+ }, Ze = {
522
531
  type: "Divider",
523
532
  label: "web_blocks.divider",
524
533
  category: "core",
525
- icon: ee,
534
+ icon: oe,
526
535
  group: "basic",
527
536
  props: {
528
- styles: p({ default: "bg-gray-900 h-0.5 py-2 my-1" })
537
+ styles: m({ default: "bg-gray-900 h-0.5 py-2 my-1" })
529
538
  }
530
- }, Ge = () => null, We = {
539
+ }, Je = () => null, Ke = {
531
540
  type: "Dark Mode",
532
541
  label: "web_blocks.dark_mode",
533
542
  category: "core",
534
- icon: te,
543
+ icon: se,
535
544
  group: "advanced",
536
545
  props: {},
537
546
  blocks: () => [
@@ -583,7 +592,53 @@ const Fe = (e) => {
583
592
  icon: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'></circle><path d='M12 2v2'></path><path d='M12 20v2'></path><path d='m4.93 4.93 1.41 1.41'></path><path d='m17.66 17.66 1.41 1.41'></path><path d='M2 12h2'></path><path d='M20 12h2'></path><path d='m6.34 17.66-1.41 1.41'></path><path d='m19.07 4.93-1.41 1.41'></path></svg>"
584
593
  }
585
594
  ]
586
- }, Xe = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ a.jsx("span", { "data-ai-key": "content", ...e.blockProps, children: e.content }) : `${e.content}`, Ye = {
595
+ }, Qe = () => {
596
+ const e = U(), { data: l, refetch: t, isLoading: a } = O(), s = V();
597
+ return /* @__PURE__ */ o.jsxs("div", { children: [
598
+ /* @__PURE__ */ o.jsx("label", { className: "text-sm", children: "Choose a global block" }),
599
+ /* @__PURE__ */ o.jsxs(
600
+ "select",
601
+ {
602
+ className: "h-8 w-full rounded-md border border-gray-300 p-0 px-2 text-xs dark:border-gray-600",
603
+ value: (e == null ? void 0 : e.globalBlock) || "",
604
+ onChange: (r) => {
605
+ s([e._id], { globalBlock: r.target.value });
606
+ },
607
+ children: [
608
+ /* @__PURE__ */ o.jsx("option", { value: "", children: "Select a global block" }),
609
+ Object.keys(l).map((r) => /* @__PURE__ */ o.jsx("option", { value: r, children: l[r].name || r }, r))
610
+ ]
611
+ }
612
+ ),
613
+ /* @__PURE__ */ o.jsx("div", { className: "mt-2 text-xs", children: /* @__PURE__ */ o.jsx(pe, { size: "sm", variant: "outline", onClick: t, className: "text-xs", children: a ? "Loading..." : "Refresh List" }) })
614
+ ] });
615
+ }, et = (e) => {
616
+ const { blockProps: l, inBuilder: t, children: a, globalBlock: s } = e;
617
+ return t && !s ? /* @__PURE__ */ o.jsxs(
618
+ "div",
619
+ {
620
+ className: "flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",
621
+ ...l,
622
+ children: [
623
+ /* @__PURE__ */ o.jsxs("h1", { children: [
624
+ "Global Block - ",
625
+ s
626
+ ] }),
627
+ /* @__PURE__ */ o.jsx("p", { children: "Choose a block from the sidebar to add it to this page." })
628
+ ]
629
+ }
630
+ ) : p.createElement("div", { ...l }, a);
631
+ }, tt = {
632
+ type: "GlobalBlock",
633
+ label: "Global Block",
634
+ icon: be,
635
+ category: "core",
636
+ group: "advanced",
637
+ props: {
638
+ globalBlock: b({ title: "global block", default: "", hidden: !0 })
639
+ },
640
+ propsEditor: Qe
641
+ }, lt = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ o.jsx("span", { "data-ai-key": "content", ...e.blockProps, children: e.content }) : `${e.content}`, ot = {
587
642
  type: "Text",
588
643
  label: "web_blocks.text",
589
644
  hidden: !0,
@@ -593,28 +648,28 @@ const Fe = (e) => {
593
648
  props: {
594
649
  content: L({ title: "web_blocks.content", defaultValue: "" })
595
650
  }
596
- }, Ze = (e) => {
597
- const { blockProps: l, backgroundImage: t, children: s, styles: o } = e;
598
- let n = {};
599
- return t && (n = { backgroundImage: `url(${t})` }), m.createElement("div", { ...l, ...o, style: n }, s);
600
- }, Je = {
651
+ }, st = (e) => {
652
+ const { blockProps: l, backgroundImage: t, children: a, styles: s } = e;
653
+ let r = {};
654
+ return t && (r = { backgroundImage: `url(${t})` }), p.createElement("div", { ...l, ...s, style: r }, a);
655
+ }, at = {
601
656
  type: "Body",
602
657
  label: "Body",
603
658
  category: "core",
604
659
  group: "basic",
605
660
  hidden: !0,
606
661
  props: {
607
- styles: p({ default: "font-body antialiased" }),
662
+ styles: m({ default: "font-body antialiased" }),
608
663
  backgroundImage: C({ title: "Background Image" })
609
664
  },
610
665
  canAcceptBlock: () => !0,
611
666
  canDelete: () => !1,
612
667
  canMove: () => !1,
613
668
  canDuplicate: () => !1
614
- }, Ke = (e) => {
669
+ }, rt = (e) => {
615
670
  const { blockProps: l, styles: t } = e;
616
- return m.createElement("br", { ...l, ...t });
617
- }, Qe = {
671
+ return p.createElement("br", { ...l, ...t });
672
+ }, nt = {
618
673
  type: "LineBreak",
619
674
  label: "Line Break",
620
675
  category: "core",
@@ -622,12 +677,12 @@ const Fe = (e) => {
622
677
  hidden: !0,
623
678
  icon: q,
624
679
  props: {
625
- styles: p({ default: "" })
680
+ styles: m({ default: "" })
626
681
  }
627
- }, et = (e) => {
628
- const { blockProps: l, errorMessage: t, name: s, _type: o, successMessage: n, action: r, styles: i, children: c } = e;
682
+ }, ct = (e) => {
683
+ const { blockProps: l, errorMessage: t, name: a, _type: s, successMessage: r, action: n, styles: i, children: c } = e;
629
684
  let d = c;
630
- c || (d = /* @__PURE__ */ a.jsx(_, {}));
685
+ c || (d = /* @__PURE__ */ o.jsx(_, {}));
631
686
  const h = {
632
687
  "x-data": "{}",
633
688
  "x-on:submit.prevent": "post"
@@ -635,31 +690,31 @@ const Fe = (e) => {
635
690
  "x-html": "",
636
691
  ":class": "{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"
637
692
  };
638
- return /* @__PURE__ */ a.jsxs(
693
+ return /* @__PURE__ */ o.jsxs(
639
694
  "form",
640
695
  {
641
696
  ...h,
642
697
  "data-error": t,
643
- "data-success": n,
698
+ "data-success": r,
644
699
  method: "post",
645
- action: r,
700
+ action: n,
646
701
  ...l,
647
702
  ...i,
648
703
  children: [
649
- /* @__PURE__ */ a.jsx("div", { ...f }),
650
- /* @__PURE__ */ a.jsx("input", { name: "formname", type: "hidden", value: s || o }),
704
+ /* @__PURE__ */ o.jsx("div", { ...f }),
705
+ /* @__PURE__ */ o.jsx("input", { name: "formname", type: "hidden", value: a || s }),
651
706
  d
652
707
  ]
653
708
  }
654
709
  );
655
- }, tt = {
710
+ }, it = {
656
711
  type: "Form",
657
712
  label: "web_blocks.form",
658
713
  category: "core",
659
- icon: le,
714
+ icon: ae,
660
715
  group: "form",
661
716
  props: {
662
- styles: p({ default: "" }),
717
+ styles: m({ default: "" }),
663
718
  action: b({
664
719
  title: "web_blocks.submit_url",
665
720
  default: "/api/form/submit"
@@ -674,26 +729,26 @@ const Fe = (e) => {
674
729
  })
675
730
  },
676
731
  canAcceptBlock: () => !0
677
- }, lt = (e) => {
678
- const { blockProps: l, inBuilder: t, label: s, styles: o, inputStyles: n, icon: r, iconPos: i } = e, c = I(), d = {
732
+ }, dt = (e) => {
733
+ const { blockProps: l, inBuilder: t, label: a, styles: s, inputStyles: r, icon: n, iconPos: i } = e, c = B(), d = {
679
734
  "x-bind:disabled": "formLoading"
680
735
  };
681
- return /* @__PURE__ */ a.jsxs(
736
+ return /* @__PURE__ */ o.jsxs(
682
737
  "button",
683
738
  {
684
739
  id: c,
685
740
  ...d,
686
- ...n,
687
- ...o,
741
+ ...r,
742
+ ...s,
688
743
  ...l || {},
689
744
  type: t ? "button" : "submit",
690
745
  children: [
691
- s,
692
- r && /* @__PURE__ */ a.jsx("span", { className: i, dangerouslySetInnerHTML: { __html: r } })
746
+ a,
747
+ n && /* @__PURE__ */ o.jsx("span", { className: i, dangerouslySetInnerHTML: { __html: n } })
693
748
  ]
694
749
  }
695
750
  );
696
- }, ot = {
751
+ }, ut = {
697
752
  type: "FormButton",
698
753
  label: "web_blocks.submit_button",
699
754
  category: "core",
@@ -701,7 +756,7 @@ const Fe = (e) => {
701
756
  group: "form",
702
757
  props: {
703
758
  label: b({ title: "web_blocks.label", default: "Submit" }),
704
- styles: p({
759
+ styles: m({
705
760
  default: "text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"
706
761
  }),
707
762
  icon: N({ title: "Icon", default: "" }),
@@ -714,55 +769,55 @@ const Fe = (e) => {
714
769
  ]
715
770
  })
716
771
  }
717
- }, st = (e) => {
772
+ }, bt = (e) => {
718
773
  const {
719
774
  blockProps: l,
720
775
  label: t,
721
- placeholder: s,
722
- styles: o,
723
- inputStyles: n,
724
- showLabel: r,
776
+ placeholder: a,
777
+ styles: s,
778
+ inputStyles: r,
779
+ showLabel: n,
725
780
  required: i,
726
781
  inputType: c = "text",
727
782
  inBuilder: d,
728
783
  fieldName: h
729
- } = e, f = I();
730
- return !r || c === "submit" ? (c === "submit" && (l.value = t), /* @__PURE__ */ a.jsx(
784
+ } = e, f = B();
785
+ return !n || c === "submit" ? (c === "submit" && (l.value = t), /* @__PURE__ */ o.jsx(
731
786
  "input",
732
787
  {
733
788
  id: f,
734
789
  name: h,
735
790
  readOnly: d,
736
791
  ...l,
737
- ...n,
738
- ...o,
792
+ ...r,
793
+ ...s,
739
794
  type: c,
740
- placeholder: s,
795
+ placeholder: a,
741
796
  required: i
742
797
  }
743
- )) : /* @__PURE__ */ a.jsxs("div", { ...o, ...l, children: [
744
- r && /* @__PURE__ */ a.jsx("label", { htmlFor: f, children: t }),
745
- /* @__PURE__ */ a.jsx(
798
+ )) : /* @__PURE__ */ o.jsxs("div", { ...s, ...l, children: [
799
+ n && /* @__PURE__ */ o.jsx("label", { htmlFor: f, children: t }),
800
+ /* @__PURE__ */ o.jsx(
746
801
  "input",
747
802
  {
748
803
  name: h,
749
804
  readOnly: d,
750
- ...n,
805
+ ...r,
751
806
  id: f,
752
807
  type: c,
753
- placeholder: s,
808
+ placeholder: a,
754
809
  required: i
755
810
  }
756
811
  )
757
812
  ] });
758
- }, at = {
813
+ }, pt = {
759
814
  type: "Input",
760
815
  label: "web_blocks.input",
761
816
  category: "core",
762
817
  icon: A,
763
818
  group: "form",
764
819
  props: {
765
- styles: p({ default: "" }),
820
+ styles: m({ default: "" }),
766
821
  fieldName: b({ title: "Field Name", default: "input" }),
767
822
  inputType: v({
768
823
  title: "web_blocks.type",
@@ -776,63 +831,63 @@ const Fe = (e) => {
776
831
  default: "text"
777
832
  }),
778
833
  value: b({ title: "web_blocks.value", default: "" }),
779
- showLabel: k({ title: "web_blocks.show_label", default: !0 }),
780
- inputStyles: p({ default: "w-full p-1" }),
834
+ showLabel: g({ title: "web_blocks.show_label", default: !0 }),
835
+ inputStyles: m({ default: "w-full p-1" }),
781
836
  label: b({ title: "web_blocks.label", default: "Label" }),
782
837
  placeholder: b({
783
838
  title: "web_blocks.placeholder",
784
839
  default: "Placeholder"
785
840
  }),
786
- required: k({ title: "web_blocks.required", default: !1 })
841
+ required: g({ title: "web_blocks.required", default: !1 })
787
842
  }
788
- }, nt = (e) => {
789
- const { blockProps: l, fieldName: t, label: s, styles: o, inputStyles: n, checked: r, required: i, showLabel: c = !0 } = e, d = I();
790
- return c ? /* @__PURE__ */ a.jsxs("div", { ...o, ...l, children: [
791
- /* @__PURE__ */ a.jsx("input", { ...n, name: t, id: d, type: "radio", required: i, defaultChecked: r }),
792
- s && /* @__PURE__ */ a.jsx("label", { htmlFor: d, children: s })
793
- ] }) : /* @__PURE__ */ a.jsx(
843
+ }, mt = (e) => {
844
+ const { blockProps: l, fieldName: t, label: a, styles: s, inputStyles: r, checked: n, required: i, showLabel: c = !0 } = e, d = B();
845
+ return c ? /* @__PURE__ */ o.jsxs("div", { ...s, ...l, children: [
846
+ /* @__PURE__ */ o.jsx("input", { ...r, name: t, id: d, type: "radio", required: i, defaultChecked: n }),
847
+ a && /* @__PURE__ */ o.jsx("label", { htmlFor: d, children: a })
848
+ ] }) : /* @__PURE__ */ o.jsx(
794
849
  "input",
795
850
  {
796
851
  id: d,
797
852
  ...l,
798
- ...n,
799
- ...o,
853
+ ...r,
854
+ ...s,
800
855
  type: "radio",
801
856
  required: i,
802
- checked: r,
857
+ checked: n,
803
858
  name: t
804
859
  }
805
860
  );
806
- }, rt = {
861
+ }, ft = {
807
862
  type: "Radio",
808
863
  label: "web_blocks.radio",
809
864
  category: "core",
810
- icon: oe,
865
+ icon: re,
811
866
  group: "form",
812
867
  props: {
813
- styles: p({ default: "flex items-center w-max gap-x-2" }),
868
+ styles: m({ default: "flex items-center w-max gap-x-2" }),
814
869
  fieldName: b({ title: "web_blocks.field_name", default: "radio" }),
815
870
  label: b({ title: "web_blocks.label", default: "Label" }),
816
- checked: k({ title: "web_blocks.checked", default: !1 }),
817
- required: k({ title: "web_blocks.required", default: !1 })
871
+ checked: g({ title: "web_blocks.checked", default: !1 }),
872
+ required: g({ title: "web_blocks.required", default: !1 })
818
873
  }
819
- }, ct = (e) => {
874
+ }, ht = (e) => {
820
875
  const {
821
876
  blockProps: l,
822
877
  fieldName: t,
823
- label: s,
824
- placeholder: o,
825
- styles: n,
826
- inputStyles: r,
878
+ label: a,
879
+ placeholder: s,
880
+ styles: r,
881
+ inputStyles: n,
827
882
  required: i,
828
883
  showLabel: c,
829
884
  _multiple: d = !1
830
- } = e, h = I();
831
- return c ? /* @__PURE__ */ a.jsxs("div", { ...n, children: [
832
- c && /* @__PURE__ */ a.jsx("label", { htmlFor: h, children: s }),
833
- /* @__PURE__ */ a.jsxs("select", { ...r, id: h, required: i, multiple: d, name: t, children: [
834
- /* @__PURE__ */ a.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: o }),
835
- M(e.options, (f) => /* @__PURE__ */ a.jsx(
885
+ } = e, h = B();
886
+ return c ? /* @__PURE__ */ o.jsxs("div", { ...r, children: [
887
+ c && /* @__PURE__ */ o.jsx("label", { htmlFor: h, children: a }),
888
+ /* @__PURE__ */ o.jsxs("select", { ...n, id: h, required: i, multiple: d, name: t, children: [
889
+ /* @__PURE__ */ o.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: s }),
890
+ M(e.options, (f) => /* @__PURE__ */ o.jsx(
836
891
  "option",
837
892
  {
838
893
  selected: x(f, "selected", !1),
@@ -842,18 +897,18 @@ const Fe = (e) => {
842
897
  f.value
843
898
  ))
844
899
  ] })
845
- ] }) : /* @__PURE__ */ a.jsxs(
900
+ ] }) : /* @__PURE__ */ o.jsxs(
846
901
  "select",
847
902
  {
848
903
  id: h,
849
- ...n,
904
+ ...r,
850
905
  ...l,
851
906
  required: i,
852
907
  multiple: d,
853
908
  name: t,
854
909
  children: [
855
- /* @__PURE__ */ a.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: o }),
856
- M(e.options, (f) => /* @__PURE__ */ a.jsx(
910
+ /* @__PURE__ */ o.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: s }),
911
+ M(e.options, (f) => /* @__PURE__ */ o.jsx(
857
912
  "option",
858
913
  {
859
914
  selected: x(f, "selected", !1),
@@ -865,25 +920,25 @@ const Fe = (e) => {
865
920
  ]
866
921
  }
867
922
  );
868
- }, it = {
923
+ }, gt = {
869
924
  type: "Select",
870
925
  label: "web_blocks.select",
871
926
  category: "core",
872
- icon: se,
927
+ icon: ne,
873
928
  group: "form",
874
929
  props: {
875
- styles: p({ default: "" }),
930
+ styles: m({ default: "" }),
876
931
  fieldName: b({ title: "web_blocks.field_name", default: "select" }),
877
- showLabel: k({ title: "web_blocks.show_label", default: !0 }),
878
- inputStyles: p({ default: "w-full p-1" }),
932
+ showLabel: g({ title: "web_blocks.show_label", default: !0 }),
933
+ inputStyles: m({ default: "w-full p-1" }),
879
934
  label: b({ title: "web_blocks.label", default: "Label" }),
880
935
  placeholder: b({
881
936
  title: "web_blocks.placeholder",
882
937
  default: "Placeholder"
883
938
  }),
884
- required: k({ title: "web_blocks.required", default: !1 }),
885
- _multiple: k({ title: "web_blocks.multiple", default: !1 }),
886
- options: U({
939
+ required: g({ title: "web_blocks.required", default: !1 }),
940
+ _multiple: g({ title: "web_blocks.multiple", default: !1 }),
941
+ options: W({
887
942
  title: "web_blocks.options",
888
943
  itemProperties: {
889
944
  label: b({ title: "web_blocks.label", default: "" }),
@@ -891,24 +946,24 @@ const Fe = (e) => {
891
946
  }
892
947
  })
893
948
  }
894
- }, dt = (e) => {
895
- const { blockProps: l, fieldName: t, label: s, placeholder: o, styles: n, inputStyles: r, _rows: i, showLabel: c } = e, d = I();
896
- return c ? /* @__PURE__ */ a.jsxs("div", { ...n, ...l, children: [
897
- c && /* @__PURE__ */ a.jsx("label", { htmlFor: d, children: s }),
898
- /* @__PURE__ */ a.jsx("textarea", { name: t, ...r, id: d, placeholder: o, rows: i })
899
- ] }) : /* @__PURE__ */ a.jsx(
949
+ }, kt = (e) => {
950
+ const { blockProps: l, fieldName: t, label: a, placeholder: s, styles: r, inputStyles: n, _rows: i, showLabel: c } = e, d = B();
951
+ return c ? /* @__PURE__ */ o.jsxs("div", { ...r, ...l, children: [
952
+ c && /* @__PURE__ */ o.jsx("label", { htmlFor: d, children: a }),
953
+ /* @__PURE__ */ o.jsx("textarea", { name: t, ...n, id: d, placeholder: s, rows: i })
954
+ ] }) : /* @__PURE__ */ o.jsx(
900
955
  "textarea",
901
956
  {
902
957
  id: d,
903
958
  name: t,
904
959
  ...l,
905
- ...r,
906
960
  ...n,
907
- placeholder: o,
961
+ ...r,
962
+ placeholder: s,
908
963
  rows: i
909
964
  }
910
965
  );
911
- }, ut = {
966
+ }, yt = {
912
967
  type: "TextArea",
913
968
  label: "web_blocks.textarea",
914
969
  category: "core",
@@ -916,59 +971,59 @@ const Fe = (e) => {
916
971
  group: "form",
917
972
  props: {
918
973
  fieldName: b({ title: "web_blocks.field_name", default: "textarea" }),
919
- showLabel: k({ title: "web_blocks.show_label", default: !0 }),
920
- styles: p({ default: "" }),
921
- inputStyles: p({ default: "w-full p-1" }),
974
+ showLabel: g({ title: "web_blocks.show_label", default: !0 }),
975
+ styles: m({ default: "" }),
976
+ inputStyles: m({ default: "w-full p-1" }),
922
977
  label: b({ title: "web_blocks.label", default: "Label" }),
923
978
  placeholder: b({
924
979
  title: "web_blocks.placeholder",
925
980
  default: "Placeholder"
926
981
  }),
927
- _rows: B({ title: "web_blocks.rows", default: 3 })
982
+ _rows: j({ title: "web_blocks.rows", default: 3 })
928
983
  }
929
- }, bt = (e) => {
930
- const { blockProps: l, fieldName: t, label: s, styles: o, inputStyles: n, required: r, checked: i, showLabel: c = !0 } = e, d = I();
931
- return c ? /* @__PURE__ */ a.jsxs("div", { ...o, ...l, children: [
932
- /* @__PURE__ */ a.jsx(
984
+ }, _t = (e) => {
985
+ const { blockProps: l, fieldName: t, label: a, styles: s, inputStyles: r, required: n, checked: i, showLabel: c = !0 } = e, d = B();
986
+ return c ? /* @__PURE__ */ o.jsxs("div", { ...s, ...l, children: [
987
+ /* @__PURE__ */ o.jsx(
933
988
  "input",
934
989
  {
935
- ...n,
990
+ ...r,
936
991
  name: t,
937
992
  id: d,
938
993
  type: "checkbox",
939
- required: r,
994
+ required: n,
940
995
  defaultChecked: i
941
996
  }
942
997
  ),
943
- s && s !== "Label" && /* @__PURE__ */ a.jsx("label", { htmlFor: d, children: s })
944
- ] }) : /* @__PURE__ */ a.jsx(
998
+ a && a !== "Label" && /* @__PURE__ */ o.jsx("label", { htmlFor: d, children: a })
999
+ ] }) : /* @__PURE__ */ o.jsx(
945
1000
  "input",
946
1001
  {
947
1002
  id: d,
948
1003
  ...l,
949
- ...n,
950
- ...o,
1004
+ ...r,
1005
+ ...s,
951
1006
  type: "checkbox",
952
- required: r,
1007
+ required: n,
953
1008
  name: t
954
1009
  }
955
1010
  );
956
- }, pt = {
1011
+ }, wt = {
957
1012
  type: "Checkbox",
958
1013
  label: "web_blocks.checkbox",
959
1014
  category: "core",
960
- icon: ae,
1015
+ icon: ce,
961
1016
  group: "form",
962
1017
  props: {
963
1018
  fieldName: b({ title: "Field Name", default: "checkbox" }),
964
- styles: p({ default: "flex items-center gap-x-2" }),
1019
+ styles: m({ default: "flex items-center gap-x-2" }),
965
1020
  label: b({ title: "web_blocks.label", default: "Label" }),
966
- checked: k({ title: "web_blocks.checked", default: !1 }),
967
- required: k({ title: "web_blocks.required", default: !1 })
1021
+ checked: g({ title: "web_blocks.checked", default: !1 }),
1022
+ required: g({ title: "web_blocks.required", default: !1 })
968
1023
  }
969
- }, xt = () => {
970
- u(de, ue), u(he, ke), u(be, pe), u(ye, ge), u(_e, we), u(xe, ve), u(Ie, Be), u(je, Le), u(Ce, Se), u(Me, Ne), u(Ee, $e), u(Pe, Te), u(He, ze), u(Ae, De), u(me, fe), u(Xe, Ye), u(et, tt), u(lt, ot), u(st, at), u(bt, pt), u(nt, rt), u(ct, it), u(dt, ut), u(Ke, Qe), u(Ze, Je), u(Fe, Oe), u(Ue, Ve), u(Ge, We);
1024
+ }, At = () => {
1025
+ u(fe, he), u(we, xe), u(ge, ke), u(ve, Be), u(je, Ie), u(Le, Ce), u(Se, Me), u(Ne, $e), u(Ee, Pe), u(Te, He), u(ze, qe), u(Ae, Re), u(De, Fe), u(Ue, Oe), u(ye, _e), u(lt, ot), u(ct, it), u(dt, ut), u(bt, pt), u(_t, wt), u(mt, ft), u(ht, gt), u(kt, yt), u(rt, nt), u(st, at), u(We, Xe), u(Ye, Ze), u(Je, Ke), u(et, tt);
971
1026
  };
972
1027
  export {
973
- xt as loadWebBlocks
1028
+ At as loadWebBlocks
974
1029
  };