@chaibuilder/sdk 1.2.105 → 1.2.107

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.
@@ -1,19 +1,19 @@
1
1
  import { registerChaiBlock as u } from "@chaibuilder/runtime";
2
- import { j as a } from "./jsx-runtime-Sp0orL4X.js";
2
+ import { j as s } from "./jsx-runtime-Sp0orL4X.js";
3
3
  import * as b from "react";
4
- import { T as m, y as _, x as C, g as p, q as N, s as L, l as $, f as B, m as S, w as D, c as g, b as F, S as G } from "./controls-lEwMTdPQ.js";
4
+ import { T as m, y as _, x as C, g as p, q as N, s as L, l as T, f as B, m as S, w as D, c as g, b as F, S as G } from "./controls-lEwMTdPQ.js";
5
5
  import { c as j, G as V, g as I } from "./iconBase-Ief2hJUZ.js";
6
6
  import { ButtonIcon as H, CodeIcon as U, HeadingIcon as O, 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 A, GroupIcon as le, InputIcon as R, RadiobuttonIcon as oe, DropdownMenuIcon as ae, CheckboxIcon as se } from "@radix-ui/react-icons";
7
7
  import { isNull as re, isEmpty as k, get as v, pick as ne, omit as ie, map as M } from "lodash-es";
8
8
  import { GlobeIcon as ce } from "lucide-react";
9
9
  import "clsx";
10
10
  import "tailwind-merge";
11
- const de = ({ 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, x = de, ue = (e) => {
12
- const { blockProps: l, inBuilder: t, backgroundImage: s, children: o, tag: r = "div", styles: n } = e;
11
+ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("div", { className: j("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ s.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", 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 dark:outline-gray-700" }) }) }) : null, x = de, ue = (e) => {
12
+ const { blockProps: l, inBuilder: t, backgroundImage: a, children: o, tag: r = "div", styles: n } = e;
13
13
  let c = o;
14
- o || (c = /* @__PURE__ */ a.jsx(x, { inBuilder: t }));
14
+ o || (c = /* @__PURE__ */ s.jsx(x, { inBuilder: t }));
15
15
  let i = {};
16
- return s && (i = { backgroundImage: `url(${s})` }), b.createElement(r, { ...l, ...n, style: i }, c);
16
+ return a && (i = { backgroundImage: `url(${a})` }), b.createElement(r, { ...l, ...n, style: i }, c);
17
17
  }, pe = {
18
18
  type: "Box",
19
19
  label: "web_blocks.box",
@@ -48,9 +48,9 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
48
48
  },
49
49
  canAcceptBlock: () => !0
50
50
  }, be = (e) => {
51
- const { blockProps: l, iconSize: t, icon: s, content: o, iconPos: r, styles: n, children: c } = e, i = s, d = c || /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
52
- /* @__PURE__ */ a.jsx("span", { "data-ai-key": "content", children: o }),
53
- i && /* @__PURE__ */ a.jsx(
51
+ const { blockProps: l, iconSize: t, icon: a, content: o, iconPos: r, styles: n, children: c } = e, i = a, d = c || /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
52
+ /* @__PURE__ */ s.jsx("span", { "data-ai-key": "content", children: o }),
53
+ i && /* @__PURE__ */ s.jsx(
54
54
  "div",
55
55
  {
56
56
  style: { width: t + "px" },
@@ -89,17 +89,17 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
89
89
  })
90
90
  }
91
91
  }, fe = (e) => {
92
- const { blockProps: l, styles: t, htmlCode: s, inBuilder: o } = e;
93
- return o ? /* @__PURE__ */ a.jsxs("div", { className: "relative", children: [
94
- o ? /* @__PURE__ */ a.jsx("div", { ...l, ...t, className: "absolute z-20 h-full w-full" }) : null,
92
+ const { blockProps: l, styles: t, htmlCode: a, inBuilder: o } = e;
93
+ return o ? /* @__PURE__ */ s.jsxs("div", { className: "relative", children: [
94
+ o ? /* @__PURE__ */ s.jsx("div", { ...l, ...t, className: "absolute z-20 h-full w-full" }) : null,
95
95
  b.createElement("div", {
96
96
  ...t,
97
- dangerouslySetInnerHTML: { __html: s.replace(/<script.*?>.*?<\/script>/g, "") }
97
+ dangerouslySetInnerHTML: { __html: a.replace(/<script.*?>.*?<\/script>/g, "") }
98
98
  })
99
99
  ] }) : b.createElement("div", {
100
100
  ...l,
101
101
  ...t,
102
- dangerouslySetInnerHTML: { __html: s }
102
+ dangerouslySetInnerHTML: { __html: a }
103
103
  });
104
104
  }, he = {
105
105
  type: "CustomHTML",
@@ -109,7 +109,7 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
109
109
  group: "advanced",
110
110
  props: {
111
111
  styles: m({ default: "" }),
112
- htmlCode: $({
112
+ htmlCode: T({
113
113
  title: "web_blocks.html_code",
114
114
  default: "<div><p>Enter your HTML code here...</p></div>",
115
115
  placeholder: "web_blocks.placeholder"
@@ -117,8 +117,9 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
117
117
  }
118
118
  }, ge = b.memo(
119
119
  (e) => {
120
- const { blockProps: l, styles: t } = e;
121
- return b.createElement("div", { ...l, ...t });
120
+ const { blockProps: l, styles: t, backgroundImage: a } = e;
121
+ let o = {};
122
+ return a && (o = { backgroundImage: `url(${a})` }), b.createElement("div", { ...l, ...t, style: o });
122
123
  }
123
124
  ), ye = {
124
125
  type: "EmptyBox",
@@ -127,16 +128,16 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
127
128
  group: "basic",
128
129
  props: {
129
130
  styles: m({ default: "" }),
130
- backgroundImage: C({ title: "web_blocks.background_image" })
131
+ backgroundImage: C({ title: "Background Image" })
131
132
  }
132
133
  }, ke = (e) => {
133
- const { blockProps: l, styles: t, content: s, level: o = "h1", children: r = null } = e;
134
+ const { blockProps: l, styles: t, content: a, level: o = "h1", children: r = null } = e;
134
135
  return r ? b.createElement(o, { ...t, ...l }, r) : b.createElement(o, {
135
136
  ...t,
136
137
  ...l,
137
138
  "data-ai-key": "content",
138
139
  "data-ai-type": "html",
139
- dangerouslySetInnerHTML: { __html: s }
140
+ dangerouslySetInnerHTML: { __html: a }
140
141
  });
141
142
  }, xe = {
142
143
  type: "Heading",
@@ -163,13 +164,13 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
163
164
  },
164
165
  canAcceptBlock: (e) => e === "Span" || e === "Text"
165
166
  }, we = (e) => {
166
- const { blockProps: l, styles: t, content: s } = e;
167
+ const { blockProps: l, styles: t, content: a } = e;
167
168
  return re(e.children) ? b.createElement("p", {
168
169
  ...t,
169
170
  ...l,
170
171
  "data-ai-key": "content",
171
172
  "data-ai-type": "html",
172
- dangerouslySetInnerHTML: { __html: s }
173
+ dangerouslySetInnerHTML: { __html: a }
173
174
  }) : b.createElement("p", { ...t, ...l }, e.children);
174
175
  }, ve = {
175
176
  type: "Paragraph",
@@ -190,12 +191,12 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
190
191
  },
191
192
  canAcceptBlock: (e) => e === "Span" || e === "Link" || e === "Text"
192
193
  }, _e = (e) => {
193
- const { blockProps: l, styles: t, content: s, children: o = null, tag: r } = e;
194
+ const { blockProps: l, styles: t, content: a, children: o = null, tag: r } = e;
194
195
  return o ? b.createElement("span", { ...t, ...l }, o) : b.createElement(r || "span", {
195
196
  ...t,
196
197
  ...l,
197
198
  "data-ai-key": "content",
198
- dangerouslySetInnerHTML: { __html: s || "" }
199
+ dangerouslySetInnerHTML: { __html: a || "" }
199
200
  });
200
201
  }, Ie = {
201
202
  type: "Span",
@@ -208,14 +209,14 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
208
209
  },
209
210
  canAcceptBlock: () => !0
210
211
  }, Le = (e) => {
211
- const { blockProps: l, content: t, styles: s } = e;
212
- return /* @__PURE__ */ a.jsx("div", { className: "max-w-full", children: /* @__PURE__ */ a.jsx(
212
+ const { blockProps: l, content: t, styles: a } = e;
213
+ return /* @__PURE__ */ s.jsx("div", { className: "max-w-full", children: /* @__PURE__ */ s.jsx(
213
214
  "div",
214
215
  {
215
216
  "data-ai-key": "content",
216
217
  "data-ai-type": "richtext",
217
218
  ...l,
218
- ...s,
219
+ ...a,
219
220
  dangerouslySetInnerHTML: { __html: t }
220
221
  }
221
222
  ) });
@@ -235,12 +236,12 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
235
236
  })
236
237
  }
237
238
  }, je = (e) => {
238
- const { blockProps: l, link: t, children: s, styles: o, inBuilder: r, content: n } = e;
239
- return !s && k(o == null ? void 0 : o.className) && k(n) ? /* @__PURE__ */ a.jsx(x, { inBuilder: r }) : r ? s ? /* @__PURE__ */ a.jsx("span", { ...l, ...o, children: s }) : b.createElement("span", {
239
+ const { blockProps: l, link: t, children: a, styles: o, inBuilder: r, content: n } = e;
240
+ return !a && k(o == null ? void 0 : o.className) && k(n) ? /* @__PURE__ */ s.jsx(x, { inBuilder: r }) : r ? a ? /* @__PURE__ */ s.jsx("span", { ...l, ...o, children: a }) : b.createElement("span", {
240
241
  ...l,
241
242
  ...o,
242
243
  dangerouslySetInnerHTML: { __html: n }
243
- }) : s ? /* @__PURE__ */ a.jsx("a", { href: (t == null ? void 0 : t.href) || "#/", target: t == null ? void 0 : t.target, ...l, ...o, children: s }) : b.createElement("a", {
244
+ }) : a ? /* @__PURE__ */ s.jsx("a", { href: (t == null ? void 0 : t.href) || "#/", target: t == null ? void 0 : t.target, ...l, ...o, children: a }) : b.createElement("a", {
244
245
  ...l,
245
246
  ...o,
246
247
  "data-ai-key": "content",
@@ -267,17 +268,17 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
267
268
  ...e,
268
269
  className: j(e.className, ...l)
269
270
  }), Se = (e) => {
270
- const { blockProps: l, children: t, styles: s, inBuilder: o, content: r, href: n } = e, { hrefType: c, autoplay: i, maxWidth: d, backdropColor: h, galleryName: f } = e, y = q(s, "cb-lightbox");
271
- if (!t && k(s == null ? void 0 : s.className) && k(r))
272
- return /* @__PURE__ */ a.jsx(x, { inBuilder: o });
271
+ const { blockProps: l, children: t, styles: a, inBuilder: o, content: r, href: n } = e, { hrefType: c, autoplay: i, maxWidth: d, backdropColor: h, galleryName: f } = e, y = q(a, "cb-lightbox");
272
+ if (!t && k(a == null ? void 0 : a.className) && k(r))
273
+ return /* @__PURE__ */ s.jsx(x, { inBuilder: o });
273
274
  if (o)
274
- return t ? /* @__PURE__ */ a.jsx("span", { ...l, ...y, children: t }) : b.createElement("span", {
275
+ return t ? /* @__PURE__ */ s.jsx("span", { ...l, ...y, children: t }) : b.createElement("span", {
275
276
  ...l,
276
277
  ...y,
277
278
  dangerouslySetInnerHTML: { __html: r }
278
279
  });
279
280
  const w = {};
280
- return w["data-vbtype"] = c, i && (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: n || "#/", ...l, ...y, children: t }) : b.createElement("a", {
281
+ return w["data-vbtype"] = c, i && (w["data-autoplay"] = "true"), d && (w["data-maxwidth"] = d + "px"), h && (w["data-overlay"] = h), f && (w["data-gall"] = f), t ? /* @__PURE__ */ s.jsx("a", { ...w, href: n || "#/", ...l, ...y, children: t }) : b.createElement("a", {
281
282
  ...l,
282
283
  ...y,
283
284
  ...w,
@@ -311,9 +312,9 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
311
312
  },
312
313
  canAcceptBlock: (e) => e !== "Link" && e !== "LightBoxLink"
313
314
  }, Ne = (e) => {
314
- const { blockProps: l, children: t, listType: s, styles: o, tag: r, inBuilder: n } = e, c = j(v(o, "className", ""), s);
315
- return !t && k(o == null ? void 0 : o.className) ? /* @__PURE__ */ a.jsx(x, { inBuilder: n }) : b.createElement(
316
- r || (s === "list-decimal" ? "ol" : "ul"),
315
+ const { blockProps: l, children: t, listType: a, styles: o, tag: r, inBuilder: n } = e, c = j(v(o, "className", ""), a);
316
+ return !t && k(o == null ? void 0 : o.className) ? /* @__PURE__ */ s.jsx(x, { inBuilder: n }) : b.createElement(
317
+ r || (a === "list-decimal" ? "ol" : "ul"),
317
318
  { ...l, ...o, className: c },
318
319
  t
319
320
  );
@@ -361,14 +362,14 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
361
362
  }
362
363
  ]
363
364
  }, Ee = (e) => {
364
- const { blockProps: l, content: t, styles: s, children: o, tag: r } = e;
365
- return o ? b.createElement(r || "li", { ...s, ...l }, o) : b.createElement(r || "li", {
366
- ...s,
365
+ const { blockProps: l, content: t, styles: a, children: o, tag: r } = e;
366
+ return o ? b.createElement(r || "li", { ...a, ...l }, o) : b.createElement(r || "li", {
367
+ ...a,
367
368
  ...l,
368
369
  "data-ai-key": "content",
369
370
  dangerouslySetInnerHTML: { __html: t }
370
371
  });
371
- }, Te = {
372
+ }, $e = {
372
373
  type: "ListItem",
373
374
  label: "List Item",
374
375
  icon: J,
@@ -380,10 +381,10 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
380
381
  },
381
382
  canAcceptBlock: (e) => e !== "ListItem",
382
383
  canBeNested: (e) => e === "List"
383
- }, $e = (e) => {
384
- const { blockProps: l, icon: t, styles: s, width: o, inBuilder: r, height: n } = e, c = q(s, j(o ? `w-[${o}px]` : "", n ? `h-[${n}px]` : ""));
384
+ }, Te = (e) => {
385
+ const { blockProps: l, icon: t, styles: a, width: o, inBuilder: r, height: n } = e, c = q(a, j(o ? `w-[${o}px]` : "", n ? `h-[${n}px]` : ""));
385
386
  if (k(t))
386
- return /* @__PURE__ */ a.jsx(x, { inBuilder: r, className: "h-8 w-14" });
387
+ return /* @__PURE__ */ s.jsx(x, { inBuilder: r, className: "h-8 w-14" });
387
388
  const i = t.replace(/<svg /g, '<svg class="w-[inherit] h-[inherit]" ');
388
389
  return b.createElement("span", {
389
390
  ...l,
@@ -406,10 +407,10 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
406
407
  height: L({ title: "web_blocks.height", default: "" })
407
408
  }
408
409
  }, ze = (e) => {
409
- const { blockProps: l, image: t, styles: s, alt: o, height: r, width: n, lazyLoading: c } = e;
410
- return k(t) ? /* @__PURE__ */ a.jsx(x, { className: "h-36" }) : b.createElement("img", {
410
+ const { blockProps: l, image: t, styles: a, alt: o, height: r, width: n, lazyLoading: c } = e;
411
+ return k(t) ? /* @__PURE__ */ s.jsx(x, { className: "h-36" }) : b.createElement("img", {
411
412
  ...l,
412
- ...s,
413
+ ...a,
413
414
  src: t,
414
415
  alt: o,
415
416
  loading: c ? "lazy" : "eager",
@@ -433,7 +434,7 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
433
434
  height: p({ title: "Height", default: "" }),
434
435
  lazyLoading: g({ title: "Lazy Load", default: !0 })
435
436
  }
436
- }, P = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, E = /^(https?:\/\/)?(www\.)?player.vimeo\.com/, T = /^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/, Re = (e) => {
437
+ }, P = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, E = /^(https?:\/\/)?(www\.)?player.vimeo\.com/, $ = /^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/, Re = (e) => {
437
438
  if (P.test(e)) {
438
439
  const l = e.match(P);
439
440
  return l ? `https://www.youtube.com/embed/${l[4]}` : e;
@@ -442,16 +443,16 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
442
443
  const l = e.match(E);
443
444
  return l ? `https://player.vimeo.com/video/${l[3]}` : e;
444
445
  }
445
- if (T.test(e)) {
446
- const l = e.match(T);
446
+ if ($.test(e)) {
447
+ const l = e.match($);
447
448
  return l ? `https://www.dailymotion.com/embed/video/${l[4]}` : e;
448
449
  }
449
450
  return null;
450
451
  }, qe = b.memo(
451
452
  (e) => {
452
- const { blockProps: l, inBuilder: t, styles: s, url: o, controls: r } = e, n = v(r, "autoPlay", !1), c = v(r, "controls", !1), i = n || v(r, "muted", !0), d = v(r, "loop", !1);
453
+ const { blockProps: l, inBuilder: t, styles: a, url: o, controls: r } = e, n = v(r, "autoPlay", !1), c = v(r, "controls", !1), i = n || v(r, "muted", !0), d = v(r, "loop", !1);
453
454
  if (k(o))
454
- return /* @__PURE__ */ a.jsx(x, { inBuilder: t, className: "h-36" });
455
+ return /* @__PURE__ */ s.jsx(x, { inBuilder: t, className: "h-36" });
455
456
  let h = Re(o), f = null;
456
457
  if (h) {
457
458
  if (!k(h)) {
@@ -476,8 +477,8 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
476
477
  autoPlay: t ? !1 : n,
477
478
  loop: d
478
479
  });
479
- return /* @__PURE__ */ a.jsx("div", { ...ne(s, ["className"]), children: /* @__PURE__ */ a.jsxs("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
480
- t ? /* @__PURE__ */ a.jsx("div", { ...l, ...ie(s, ["className"]), className: "absolute inset-0 z-20 h-full w-full" }) : null,
480
+ return /* @__PURE__ */ s.jsx("div", { ...ne(a, ["className"]), children: /* @__PURE__ */ s.jsxs("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
481
+ t ? /* @__PURE__ */ s.jsx("div", { ...l, ...ie(a, ["className"]), className: "absolute inset-0 z-20 h-full w-full" }) : null,
481
482
  f
482
483
  ] }) });
483
484
  }
@@ -509,8 +510,8 @@ function Fe(e) {
509
510
  return V({ 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);
510
511
  }
511
512
  const Ge = (e) => {
512
- const { scripts: l, inBuilder: t, blockProps: s } = e;
513
- 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 } });
513
+ const { scripts: l, inBuilder: t, blockProps: a } = e;
514
+ return t ? /* @__PURE__ */ s.jsx("div", { ...a, children: /* @__PURE__ */ s.jsx("div", { className: j("pointer-events-none flex flex-col items-center justify-center p-2", ""), children: /* @__PURE__ */ s.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800", children: /* @__PURE__ */ s.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__ */ s.jsx("div", { dangerouslySetInnerHTML: { __html: l } });
514
515
  }, Ve = {
515
516
  type: "CustomScript",
516
517
  label: "web_blocks.custom_script",
@@ -518,7 +519,7 @@ const Ge = (e) => {
518
519
  icon: Fe,
519
520
  group: "advanced",
520
521
  props: {
521
- scripts: $({
522
+ scripts: T({
522
523
  title: "Script",
523
524
  default: "",
524
525
  placeholder: "<script>console.log('Hello, world!');<\/script>"
@@ -593,21 +594,21 @@ const Ge = (e) => {
593
594
  }
594
595
  ]
595
596
  }, Ye = (e) => {
596
- const { blockProps: l, inBuilder: t, children: s, globalBlock: o } = e;
597
- return t && !o ? /* @__PURE__ */ a.jsxs(
597
+ const { blockProps: l, inBuilder: t, children: a, globalBlock: o } = e;
598
+ return t && !o ? /* @__PURE__ */ s.jsxs(
598
599
  "div",
599
600
  {
600
601
  className: "flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",
601
602
  ...l,
602
603
  children: [
603
- /* @__PURE__ */ a.jsxs("h1", { children: [
604
+ /* @__PURE__ */ s.jsxs("h1", { children: [
604
605
  "Global Block - ",
605
606
  o
606
607
  ] }),
607
- /* @__PURE__ */ a.jsx("p", { children: "Choose a block from the sidebar to add it to this page." })
608
+ /* @__PURE__ */ s.jsx("p", { children: "Choose a block from the sidebar to add it to this page." })
608
609
  ]
609
610
  }
610
- ) : b.createElement("div", { ...l }, s);
611
+ ) : b.createElement("div", { ...l }, a);
611
612
  }, Ze = {
612
613
  type: "GlobalBlock",
613
614
  label: "Global Block",
@@ -617,7 +618,7 @@ const Ge = (e) => {
617
618
  props: {
618
619
  globalBlock: p({ title: "global block", default: "", hidden: !0 })
619
620
  }
620
- }, Je = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ a.jsx("span", { "data-ai-key": "content", ...e.blockProps, children: e.content }) : `${e.content}`, Ke = {
621
+ }, Je = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ s.jsx("span", { "data-ai-key": "content", ...e.blockProps, children: e.content }) : `${e.content}`, Ke = {
621
622
  type: "Text",
622
623
  label: "Text",
623
624
  hidden: !0,
@@ -628,9 +629,9 @@ const Ge = (e) => {
628
629
  content: B({ title: "Content", default: "", ai: !0, i18n: !0 })
629
630
  }
630
631
  }, Qe = (e) => {
631
- const { blockProps: l, backgroundImage: t, children: s, styles: o } = e;
632
+ const { blockProps: l, backgroundImage: t, children: a, styles: o } = e;
632
633
  let r = {};
633
- return t && (r = { backgroundImage: `url(${t})` }), b.createElement("div", { ...l, ...o, style: r }, s);
634
+ return t && (r = { backgroundImage: `url(${t})` }), b.createElement("div", { ...l, ...o, style: r }, a);
634
635
  }, et = {
635
636
  type: "Body",
636
637
  label: "Body",
@@ -659,9 +660,9 @@ const Ge = (e) => {
659
660
  styles: m({ default: "" })
660
661
  }
661
662
  }, ot = (e) => {
662
- const { blockProps: l, errorMessage: t, name: s, _type: o, successMessage: r, action: n, styles: c, children: i } = e;
663
+ const { blockProps: l, errorMessage: t, name: a, _type: o, successMessage: r, action: n, styles: c, children: i } = e;
663
664
  let d = i;
664
- i || (d = /* @__PURE__ */ a.jsx(x, {}));
665
+ i || (d = /* @__PURE__ */ s.jsx(x, {}));
665
666
  const h = {
666
667
  "x-data": "{}",
667
668
  "x-on:submit.prevent": "post"
@@ -669,7 +670,7 @@ const Ge = (e) => {
669
670
  "x-html": "",
670
671
  ":class": "{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"
671
672
  };
672
- return /* @__PURE__ */ a.jsxs(
673
+ return /* @__PURE__ */ s.jsxs(
673
674
  "form",
674
675
  {
675
676
  ...h,
@@ -680,8 +681,8 @@ const Ge = (e) => {
680
681
  ...l,
681
682
  ...c,
682
683
  children: [
683
- /* @__PURE__ */ a.jsx("div", { ...f }),
684
- /* @__PURE__ */ a.jsx("input", { name: "formname", type: "hidden", value: s || o }),
684
+ /* @__PURE__ */ s.jsx("div", { ...f }),
685
+ /* @__PURE__ */ s.jsx("input", { name: "formname", type: "hidden", value: a || o }),
685
686
  d
686
687
  ]
687
688
  }
@@ -709,10 +710,10 @@ const Ge = (e) => {
709
710
  },
710
711
  canAcceptBlock: () => !0
711
712
  }, st = (e) => {
712
- const { blockProps: l, inBuilder: t, label: s, styles: o, inputStyles: r, icon: n, iconPos: c } = e, i = I(), d = {
713
+ const { blockProps: l, inBuilder: t, label: a, styles: o, inputStyles: r, icon: n, iconPos: c } = e, i = I(), d = {
713
714
  "x-bind:disabled": "formLoading"
714
715
  };
715
- return /* @__PURE__ */ a.jsxs(
716
+ return /* @__PURE__ */ s.jsxs(
716
717
  "button",
717
718
  {
718
719
  id: i,
@@ -722,8 +723,8 @@ const Ge = (e) => {
722
723
  ...l || {},
723
724
  type: t ? "button" : "submit",
724
725
  children: [
725
- s,
726
- n && /* @__PURE__ */ a.jsx("span", { className: c, dangerouslySetInnerHTML: { __html: n } })
726
+ a,
727
+ n && /* @__PURE__ */ s.jsx("span", { className: c, dangerouslySetInnerHTML: { __html: n } })
727
728
  ]
728
729
  }
729
730
  );
@@ -752,7 +753,7 @@ const Ge = (e) => {
752
753
  const {
753
754
  blockProps: l,
754
755
  label: t,
755
- placeholder: s,
756
+ placeholder: a,
756
757
  styles: o,
757
758
  inputStyles: r,
758
759
  showLabel: n,
@@ -761,7 +762,7 @@ const Ge = (e) => {
761
762
  inBuilder: d,
762
763
  fieldName: h
763
764
  } = e, f = I();
764
- return !n || i === "submit" ? (i === "submit" && (l.value = t), /* @__PURE__ */ a.jsx(
765
+ return !n || i === "submit" ? (i === "submit" && (l.value = t), /* @__PURE__ */ s.jsx(
765
766
  "input",
766
767
  {
767
768
  id: f,
@@ -771,12 +772,12 @@ const Ge = (e) => {
771
772
  ...r,
772
773
  ...o,
773
774
  type: i,
774
- placeholder: s,
775
+ placeholder: a,
775
776
  required: c
776
777
  }
777
- )) : /* @__PURE__ */ a.jsxs("div", { ...o, ...l, children: [
778
- n && /* @__PURE__ */ a.jsx("label", { htmlFor: f, children: t }),
779
- /* @__PURE__ */ a.jsx(
778
+ )) : /* @__PURE__ */ s.jsxs("div", { ...o, ...l, children: [
779
+ n && /* @__PURE__ */ s.jsx("label", { htmlFor: f, children: t }),
780
+ /* @__PURE__ */ s.jsx(
780
781
  "input",
781
782
  {
782
783
  name: h,
@@ -784,7 +785,7 @@ const Ge = (e) => {
784
785
  ...r,
785
786
  id: f,
786
787
  type: i,
787
- placeholder: s,
788
+ placeholder: a,
788
789
  required: c
789
790
  }
790
791
  )
@@ -820,11 +821,11 @@ const Ge = (e) => {
820
821
  required: g({ title: "Required", default: !1 })
821
822
  }
822
823
  }, ct = (e) => {
823
- const { blockProps: l, fieldName: t, label: s, styles: o, inputStyles: r, checked: n, required: c, showLabel: i = !0 } = e, d = I();
824
- return i ? /* @__PURE__ */ a.jsxs("div", { ...o, ...l, children: [
825
- /* @__PURE__ */ a.jsx("input", { ...r, name: t, id: d, type: "radio", required: c, defaultChecked: n }),
826
- s && /* @__PURE__ */ a.jsx("label", { htmlFor: d, children: s })
827
- ] }) : /* @__PURE__ */ a.jsx(
824
+ const { blockProps: l, fieldName: t, label: a, styles: o, inputStyles: r, checked: n, required: c, showLabel: i = !0 } = e, d = I();
825
+ return i ? /* @__PURE__ */ s.jsxs("div", { ...o, ...l, children: [
826
+ /* @__PURE__ */ s.jsx("input", { ...r, name: t, id: d, type: "radio", required: c, defaultChecked: n }),
827
+ a && /* @__PURE__ */ s.jsx("label", { htmlFor: d, children: a })
828
+ ] }) : /* @__PURE__ */ s.jsx(
828
829
  "input",
829
830
  {
830
831
  id: d,
@@ -854,7 +855,7 @@ const Ge = (e) => {
854
855
  const {
855
856
  blockProps: l,
856
857
  fieldName: t,
857
- label: s,
858
+ label: a,
858
859
  placeholder: o,
859
860
  styles: r,
860
861
  inputStyles: n,
@@ -862,11 +863,11 @@ const Ge = (e) => {
862
863
  showLabel: i,
863
864
  _multiple: d = !1
864
865
  } = e, h = I();
865
- return i ? /* @__PURE__ */ a.jsxs("div", { ...r, children: [
866
- i && /* @__PURE__ */ a.jsx("label", { htmlFor: h, children: s }),
867
- /* @__PURE__ */ a.jsxs("select", { ...n, id: h, required: c, multiple: d, name: t, children: [
868
- /* @__PURE__ */ a.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: o }),
869
- M(e.options, (f) => /* @__PURE__ */ a.jsx(
866
+ return i ? /* @__PURE__ */ s.jsxs("div", { ...r, children: [
867
+ i && /* @__PURE__ */ s.jsx("label", { htmlFor: h, children: a }),
868
+ /* @__PURE__ */ s.jsxs("select", { ...n, id: h, required: c, multiple: d, name: t, children: [
869
+ /* @__PURE__ */ s.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: o }),
870
+ M(e.options, (f) => /* @__PURE__ */ s.jsx(
870
871
  "option",
871
872
  {
872
873
  selected: v(f, "selected", !1),
@@ -876,7 +877,7 @@ const Ge = (e) => {
876
877
  f.value
877
878
  ))
878
879
  ] })
879
- ] }) : /* @__PURE__ */ a.jsxs(
880
+ ] }) : /* @__PURE__ */ s.jsxs(
880
881
  "select",
881
882
  {
882
883
  id: h,
@@ -886,8 +887,8 @@ const Ge = (e) => {
886
887
  multiple: d,
887
888
  name: t,
888
889
  children: [
889
- /* @__PURE__ */ a.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: o }),
890
- M(e.options, (f) => /* @__PURE__ */ a.jsx(
890
+ /* @__PURE__ */ s.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: o }),
891
+ M(e.options, (f) => /* @__PURE__ */ s.jsx(
891
892
  "option",
892
893
  {
893
894
  selected: v(f, "selected", !1),
@@ -926,11 +927,11 @@ const Ge = (e) => {
926
927
  })
927
928
  }
928
929
  }, bt = (e) => {
929
- const { blockProps: l, fieldName: t, label: s, placeholder: o, styles: r, inputStyles: n, _rows: c, showLabel: i } = e, d = I();
930
- return i ? /* @__PURE__ */ a.jsxs("div", { ...r, ...l, children: [
931
- i && /* @__PURE__ */ a.jsx("label", { htmlFor: d, children: s }),
932
- /* @__PURE__ */ a.jsx("textarea", { name: t, ...n, id: d, placeholder: o, rows: c })
933
- ] }) : /* @__PURE__ */ a.jsx(
930
+ const { blockProps: l, fieldName: t, label: a, placeholder: o, styles: r, inputStyles: n, _rows: c, showLabel: i } = e, d = I();
931
+ return i ? /* @__PURE__ */ s.jsxs("div", { ...r, ...l, children: [
932
+ i && /* @__PURE__ */ s.jsx("label", { htmlFor: d, children: a }),
933
+ /* @__PURE__ */ s.jsx("textarea", { name: t, ...n, id: d, placeholder: o, rows: c })
934
+ ] }) : /* @__PURE__ */ s.jsx(
934
935
  "textarea",
935
936
  {
936
937
  id: d,
@@ -961,9 +962,9 @@ const Ge = (e) => {
961
962
  _rows: L({ title: "Rows", default: 3 })
962
963
  }
963
964
  }, ft = (e) => {
964
- const { blockProps: l, fieldName: t, label: s, styles: o, inputStyles: r, required: n, checked: c, showLabel: i = !0 } = e, d = I();
965
- return i ? /* @__PURE__ */ a.jsxs("div", { ...o, ...l, children: [
966
- /* @__PURE__ */ a.jsx(
965
+ const { blockProps: l, fieldName: t, label: a, styles: o, inputStyles: r, required: n, checked: c, showLabel: i = !0 } = e, d = I();
966
+ return i ? /* @__PURE__ */ s.jsxs("div", { ...o, ...l, children: [
967
+ /* @__PURE__ */ s.jsx(
967
968
  "input",
968
969
  {
969
970
  ...r,
@@ -974,8 +975,8 @@ const Ge = (e) => {
974
975
  defaultChecked: c
975
976
  }
976
977
  ),
977
- s && s !== "Label" && /* @__PURE__ */ a.jsx("label", { htmlFor: d, children: s })
978
- ] }) : /* @__PURE__ */ a.jsx(
978
+ a && a !== "Label" && /* @__PURE__ */ s.jsx("label", { htmlFor: d, children: a })
979
+ ] }) : /* @__PURE__ */ s.jsx(
979
980
  "input",
980
981
  {
981
982
  id: d,
@@ -1001,7 +1002,7 @@ const Ge = (e) => {
1001
1002
  required: g({ title: "web_blocks.required", default: !1 })
1002
1003
  }
1003
1004
  }, Bt = () => {
1004
- u(ue, pe), u(ge, ye), u(be, me), u(ke, xe), u(we, ve), u(_e, Ie), u(Le, Be), u(je, Ce), u(Se, Me), u(Ne, Pe), u(Ee, Te), u($e, He), u(ze, Ae), u(qe, De), u(fe, he), u(Je, Ke), u(ot, at), u(st, rt), u(nt, it), u(ft, ht), u(ct, dt), u(ut, pt), u(bt, mt), u(tt, lt), u(Qe, et), u(Ge, Ve), u(Ue, Oe), u(We, Xe), u(Ye, Ze);
1005
+ u(ue, pe), u(ge, ye), u(be, me), u(ke, xe), u(we, ve), u(_e, Ie), u(Le, Be), u(je, Ce), u(Se, Me), u(Ne, Pe), u(Ee, $e), u(Te, He), u(ze, Ae), u(qe, De), u(fe, he), u(Je, Ke), u(ot, at), u(st, rt), u(nt, it), u(ft, ht), u(ct, dt), u(ut, pt), u(bt, mt), u(tt, lt), u(Qe, et), u(Ge, Ve), u(Ue, Oe), u(We, Xe), u(Ye, Ze);
1005
1006
  };
1006
1007
  export {
1007
1008
  Bt as loadWebBlocks
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "author": "Suraj Air",
6
6
  "license": "BSD-3-Clause",
7
7
  "homepage": "https://chaibuilder.com",
8
- "version": "1.2.105",
8
+ "version": "1.2.107",
9
9
  "type": "module",
10
10
  "repository": {
11
11
  "type": "git",