@chaibuilder/sdk 1.2.114 → 1.2.116

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 (51) hide show
  1. package/README.md +2 -6
  2. package/dist/CodeEditor-Bl58eelM.cjs +1 -0
  3. package/dist/CodeEditor-C1ImRmIp.js +77 -0
  4. package/dist/Topbar-BpMZTZKz.cjs +1 -0
  5. package/dist/Topbar-tRFEAMbG.js +113 -0
  6. package/dist/UnsplashImages-BXarNGDE.cjs +1 -0
  7. package/dist/{UnsplashImages-chQ74Yzq.js → UnsplashImages-Ds_3IihK.js} +38 -90
  8. package/dist/UploadImages-DPMndPNm.cjs +1 -0
  9. package/dist/UploadImages-VZ7-y0rA.js +101 -0
  10. package/dist/cdn.js +25283 -0
  11. package/dist/{context-menu-FPX89OKr.js → context-menu-BbqLeYFX.js} +1 -1
  12. package/dist/{context-menu-sQn7ryJ6.cjs → context-menu-DfAXjmc8.cjs} +1 -1
  13. package/dist/core.cjs +1 -1
  14. package/dist/core.d.ts +50 -17
  15. package/dist/core.js +74 -127
  16. package/dist/{iconBase-Ief2hJUZ.js → iconBase-DHfFLkem.js} +6 -12
  17. package/dist/index-B_be_Or7.cjs +63 -0
  18. package/dist/{index-IZpHf_8d.js → index-Bn53BEJy.js} +1631 -1658
  19. package/dist/jsx-runtime-BYECrxsp.cjs +30 -0
  20. package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-DGlMoOmv.js} +241 -242
  21. package/dist/{plugin-UiUFs2fK.js → plugin-BOEoR5jk.js} +1 -1
  22. package/dist/{plugin-xOpS-UNV.cjs → plugin-COMQcYlW.cjs} +1 -1
  23. package/dist/{plugin-f6SDZ_Or.js → plugin-Dw854zFv.js} +7 -8
  24. package/dist/{plugin-jum1MjXp.cjs → plugin-I9XxF65G.cjs} +1 -1
  25. package/dist/render.cjs +1 -1
  26. package/dist/render.js +10 -14
  27. package/dist/runtime.cjs +1 -1
  28. package/dist/runtime.js +12 -13
  29. package/dist/style.css +1 -1
  30. package/dist/tailwind.cjs +1 -1
  31. package/dist/tailwind.js +5 -7
  32. package/dist/ui.cjs +1 -1
  33. package/dist/ui.d.ts +3 -6
  34. package/dist/ui.js +145 -163
  35. package/dist/web-blocks.cjs +19 -2
  36. package/dist/web-blocks.js +116 -102
  37. package/package.json +3 -1
  38. package/dist/CodeEditor-BWHGysUw.cjs +0 -1
  39. package/dist/CodeEditor-q9he9IC8.js +0 -129
  40. package/dist/Topbar-86JxE7Uw.js +0 -163
  41. package/dist/Topbar-8LnyJF7S.cjs +0 -1
  42. package/dist/UnsplashImages-MLEjengP.cjs +0 -1
  43. package/dist/UploadImages--77rHMEx.cjs +0 -1
  44. package/dist/UploadImages-Auy8ZPBl.js +0 -153
  45. package/dist/index-KsZZcMSu.cjs +0 -63
  46. package/dist/jsx-runtime-JYMCiFoE.cjs +0 -27
  47. /package/dist/{STRINGS-Xxstm-7I.js → STRINGS-eiGM83kj.js} +0 -0
  48. /package/dist/{STRINGS-Yl7cSWDc.cjs → STRINGS-ew98weUe.cjs} +0 -0
  49. /package/dist/{controls-p9IwFnPx.cjs → controls-C4n5ycp4.cjs} +0 -0
  50. /package/dist/{controls-lEwMTdPQ.js → controls-Com-zYCq.js} +0 -0
  51. /package/dist/{iconBase-aZzpqff_.cjs → iconBase-Cn2BsTrq.cjs} +0 -0
@@ -1,20 +1,18 @@
1
1
  import { registerChaiBlock as u } from "@chaibuilder/runtime";
2
- import { j as s } from "./jsx-runtime-Sp0orL4X.js";
2
+ import { j as s } from "./jsx-runtime-DGlMoOmv.js";
3
3
  import * as b from "react";
4
- import { T as m, y as v, x as C, g as p, q as N, s as B, l as T, f as L, m as S, w as D, c as y, b as F, S as G } from "./controls-lEwMTdPQ.js";
5
- import { c as j, G as V, g as I } from "./iconBase-Ief2hJUZ.js";
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";
4
+ import { T as m, y as v, x as j, g as p, q as $, s as L, l as T, f as B, m as S, w as D, c as y, b as F, S as G } from "./controls-Com-zYCq.js";
5
+ import { c as C, G as V, g as I } from "./iconBase-DHfFLkem.js";
6
+ import { ButtonIcon as H, CodeIcon as U, HeadingIcon as O, TextIcon as W, CursorTextIcon as X, Link1Icon as Y, ImageIcon as R, RowsIcon as Z, ColumnsIcon as J, SketchLogoIcon as K, VideoIcon as Q, DividerHorizontalIcon as ee, MoonIcon as te, SpaceBetweenVerticallyIcon as z, GroupIcon as le, InputIcon as A, 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 w, pick as ne, omit as ie, map as M } from "lodash-es";
8
8
  import { GlobeIcon as ce } from "lucide-react";
9
- import "clsx";
10
- import "tailwind-merge";
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, _ = de, ue = (e) => {
9
+ const _ = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("div", { className: C("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, de = (e) => {
12
10
  const { blockProps: l, inBuilder: t, backgroundImage: o, children: a, tag: r = "div", styles: n } = e;
13
11
  let i = a;
14
12
  a || (i = /* @__PURE__ */ s.jsx(_, { inBuilder: t }));
15
13
  let c = {};
16
14
  return o && (c = { backgroundImage: `url(${o})` }), b.createElement(r, { ...l, ...n, style: c }, i);
17
- }, pe = {
15
+ }, ue = {
18
16
  type: "Box",
19
17
  label: "web_blocks.box",
20
18
  category: "core",
@@ -44,10 +42,10 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
44
42
  { value: "mark", title: "web_blocks.mark" }
45
43
  ]
46
44
  }),
47
- backgroundImage: C({ title: "web_blocks.background_image" })
45
+ backgroundImage: j({ title: "web_blocks.background_image" })
48
46
  },
49
47
  canAcceptBlock: () => !0
50
- }, be = (e) => {
48
+ }, pe = (e) => {
51
49
  const { blockProps: l, iconSize: t, icon: o, content: a, iconPos: r, styles: n, children: i } = e, c = o, d = i || /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
52
50
  /* @__PURE__ */ s.jsx("span", { "data-ai-key": "content", children: a }),
53
51
  c && /* @__PURE__ */ s.jsx(
@@ -68,7 +66,7 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
68
66
  },
69
67
  d
70
68
  );
71
- }, me = {
69
+ }, be = {
72
70
  type: "Button",
73
71
  label: "web_blocks.button",
74
72
  category: "core",
@@ -77,8 +75,8 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
77
75
  props: {
78
76
  content: p({ title: "web_blocks.label", default: "Button", ai: !0, i18n: !0 }),
79
77
  styles: m({ default: "text-white bg-primary px-4 py-2 rounded-global flex items-center" }),
80
- icon: N({ title: "web_blocks.icon", default: "" }),
81
- iconSize: B({ title: "web_blocks.icon_size", default: 24 }),
78
+ icon: $({ title: "web_blocks.icon", default: "" }),
79
+ iconSize: L({ title: "web_blocks.icon_size", default: 24 }),
82
80
  iconPos: v({
83
81
  title: "web_blocks.icon_position",
84
82
  default: "order-last",
@@ -88,7 +86,7 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
88
86
  ]
89
87
  })
90
88
  }
91
- }, fe = (e) => {
89
+ }, me = (e) => {
92
90
  const { blockProps: l, styles: t, htmlCode: o, inBuilder: a } = e;
93
91
  return a ? /* @__PURE__ */ s.jsxs("div", { className: "relative", children: [
94
92
  a ? /* @__PURE__ */ s.jsx("div", { ...l, ...t, className: "absolute z-20 h-full w-full" }) : null,
@@ -101,7 +99,7 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
101
99
  ...t,
102
100
  dangerouslySetInnerHTML: { __html: o }
103
101
  });
104
- }, he = {
102
+ }, fe = {
105
103
  type: "CustomHTML",
106
104
  label: "web_blocks.custom_html",
107
105
  category: "core",
@@ -115,22 +113,22 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
115
113
  placeholder: "web_blocks.placeholder"
116
114
  })
117
115
  }
118
- }, ye = b.memo(
116
+ }, he = b.memo(
119
117
  (e) => {
120
118
  const { blockProps: l, styles: t, backgroundImage: o } = e;
121
119
  let a = {};
122
120
  return o && (a = { backgroundImage: `url(${o})` }), b.createElement("div", { ...l, ...t, style: a });
123
121
  }
124
- ), ge = {
122
+ ), ye = {
125
123
  type: "EmptyBox",
126
124
  label: "web_blocks.empty_box",
127
125
  category: "core",
128
126
  group: "basic",
129
127
  props: {
130
128
  styles: m({ default: "" }),
131
- backgroundImage: C({ title: "Background Image" })
129
+ backgroundImage: j({ title: "Background Image" })
132
130
  }
133
- }, ke = (e) => {
131
+ }, ge = (e) => {
134
132
  const { blockProps: l, styles: t, content: o, level: a = "h1", children: r = null } = e;
135
133
  return r ? b.createElement(a, { ...t, ...l }, r) : b.createElement(a, {
136
134
  ...t,
@@ -139,7 +137,7 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
139
137
  "data-ai-type": "html",
140
138
  dangerouslySetInnerHTML: { __html: o }
141
139
  });
142
- }, xe = {
140
+ }, ke = {
143
141
  type: "Heading",
144
142
  label: "web_blocks.heading",
145
143
  category: "core",
@@ -160,10 +158,10 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
160
158
  ]
161
159
  }),
162
160
  styles: m({ default: "text-3xl" }),
163
- content: L({ title: "Content", default: "Heading goes here", ai: !0, i18n: !0 })
161
+ content: B({ title: "Content", default: "Heading goes here", ai: !0, i18n: !0 })
164
162
  },
165
163
  canAcceptBlock: (e) => e === "Span" || e === "Text"
166
- }, we = (e) => {
164
+ }, xe = (e) => {
167
165
  const { blockProps: l, styles: t, content: o } = e;
168
166
  return re(e.children) ? b.createElement("p", {
169
167
  ...t,
@@ -172,7 +170,7 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
172
170
  "data-ai-type": "html",
173
171
  dangerouslySetInnerHTML: { __html: o }
174
172
  }) : b.createElement("p", { ...t, ...l }, e.children);
175
- }, ve = {
173
+ }, we = {
176
174
  type: "Paragraph",
177
175
  label: "Paragraph",
178
176
  category: "core",
@@ -180,7 +178,7 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
180
178
  group: "typography",
181
179
  props: {
182
180
  styles: m({ default: "" }),
183
- content: L({
181
+ content: B({
184
182
  title: "Content",
185
183
  default: `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.
186
184
  Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus
@@ -190,7 +188,7 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
190
188
  })
191
189
  },
192
190
  canAcceptBlock: (e) => e === "Span" || e === "Link" || e === "Text"
193
- }, _e = (e) => {
191
+ }, ve = (e) => {
194
192
  const { blockProps: l, styles: t, content: o, children: a = null, tag: r } = e;
195
193
  return a ? b.createElement("span", { ...t, ...l }, a) : b.createElement(r || "span", {
196
194
  ...t,
@@ -198,17 +196,17 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
198
196
  "data-ai-key": "content",
199
197
  dangerouslySetInnerHTML: { __html: o || "" }
200
198
  });
201
- }, Ie = {
199
+ }, _e = {
202
200
  type: "Span",
203
201
  label: "Span",
204
202
  category: "core",
205
203
  group: "typography",
206
204
  props: {
207
205
  styles: m({ default: "" }),
208
- content: L({ title: "Content", default: "", ai: !0, i18n: !0 })
206
+ content: B({ title: "Content", default: "", ai: !0, i18n: !0 })
209
207
  },
210
208
  canAcceptBlock: () => !0
211
- }, Be = (e) => {
209
+ }, Ie = (e) => {
212
210
  const { blockProps: l, content: t, styles: o } = e;
213
211
  return /* @__PURE__ */ s.jsx("div", { className: "max-w-full", children: /* @__PURE__ */ s.jsx(
214
212
  "div",
@@ -235,7 +233,7 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
235
233
  default: "<p>This is a rich text block. You can add text, and other content here.</p>"
236
234
  })
237
235
  }
238
- }, je = (e) => {
236
+ }, Be = (e) => {
239
237
  const { blockProps: l, link: t, children: o, styles: a, inBuilder: r, content: n } = e;
240
238
  let i = {};
241
239
  return !o && k(n) && (i = { minHeight: "50px", display: "flex", alignItems: "center", justifyContent: "center" }), r ? o ? /* @__PURE__ */ s.jsx("span", { ...l, style: i, ...a, children: o }) : b.createElement(
@@ -275,8 +273,8 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
275
273
  canAcceptBlock: (e) => e !== "Link"
276
274
  }, q = (e, ...l) => ({
277
275
  ...e,
278
- className: j(e.className, ...l)
279
- }), Se = (e) => {
276
+ className: C(e.className, ...l)
277
+ }), je = (e) => {
280
278
  const { blockProps: l, children: t, styles: o, inBuilder: a, content: r, href: n } = e, { hrefType: i, autoplay: c, maxWidth: d, backdropColor: h, galleryName: f } = e, g = q(o, "cb-lightbox");
281
279
  if (!t && k(o == null ? void 0 : o.className) && k(r))
282
280
  return /* @__PURE__ */ s.jsx(_, { inBuilder: a });
@@ -294,11 +292,11 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
294
292
  href: n || "#",
295
293
  dangerouslySetInnerHTML: { __html: r }
296
294
  });
297
- }, Me = {
295
+ }, Se = {
298
296
  type: "LightBoxLink",
299
297
  label: "Lightbox Link",
300
298
  category: "core",
301
- icon: z,
299
+ icon: R,
302
300
  group: "basic",
303
301
  props: {
304
302
  styles: m({ default: "" }),
@@ -315,19 +313,19 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
315
313
  ]
316
314
  }),
317
315
  autoplay: y({ title: "Autoplay", default: !1 }),
318
- maxWidth: B({ title: "Max Width", default: "" }),
316
+ maxWidth: L({ title: "Max Width", default: "" }),
319
317
  backdropColor: p({ title: "Backdrop Color", default: "" }),
320
318
  galleryName: p({ title: "Gallery Name", default: "" })
321
319
  },
322
320
  canAcceptBlock: (e) => e !== "Link" && e !== "LightBoxLink"
323
- }, Ne = (e) => {
324
- const { blockProps: l, children: t, listType: o, styles: a, tag: r, inBuilder: n } = e, i = j(w(a, "className", ""), o);
321
+ }, Me = (e) => {
322
+ const { blockProps: l, children: t, listType: o, styles: a, tag: r, inBuilder: n } = e, i = C(w(a, "className", ""), o);
325
323
  return !t && k(a == null ? void 0 : a.className) ? /* @__PURE__ */ s.jsx(_, { inBuilder: n }) : b.createElement(
326
324
  r || (o === "list-decimal" ? "ol" : "ul"),
327
325
  { ...l, ...a, className: i },
328
326
  t
329
327
  );
330
- }, Pe = {
328
+ }, $e = {
331
329
  type: "List",
332
330
  label: "web_blocks.list",
333
331
  icon: Z,
@@ -378,7 +376,7 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
378
376
  "data-ai-key": "content",
379
377
  dangerouslySetInnerHTML: { __html: t }
380
378
  });
381
- }, $e = {
379
+ }, Ne = {
382
380
  type: "ListItem",
383
381
  label: "List Item",
384
382
  icon: J,
@@ -386,12 +384,12 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
386
384
  group: "basic",
387
385
  props: {
388
386
  styles: m({ default: "" }),
389
- content: L({ title: "Content", default: "List item", ai: !0, i18n: !0 })
387
+ content: B({ title: "Content", default: "List item", ai: !0, i18n: !0 })
390
388
  },
391
389
  canAcceptBlock: (e) => e !== "ListItem",
392
390
  canBeNested: (e) => e === "List"
393
- }, Te = (e) => {
394
- const { blockProps: l, icon: t, styles: o, width: a, inBuilder: r, height: n } = e, i = q(o, j(a ? `w-[${a}px]` : "", n ? `h-[${n}px]` : ""));
391
+ }, Pe = (e) => {
392
+ const { blockProps: l, icon: t, styles: o, width: a, inBuilder: r, height: n } = e, i = q(o, C(a ? `w-[${a}px]` : "", n ? `h-[${n}px]` : ""));
395
393
  if (k(t))
396
394
  return /* @__PURE__ */ s.jsx(_, { inBuilder: r, className: "h-8 w-14" });
397
395
  const c = t.replace(/<svg /g, '<svg class="w-[inherit] h-[inherit]" ');
@@ -400,7 +398,7 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
400
398
  ...i,
401
399
  dangerouslySetInnerHTML: { __html: c }
402
400
  });
403
- }, He = {
401
+ }, Te = {
404
402
  type: "Icon",
405
403
  label: "web_blocks.icon",
406
404
  category: "core",
@@ -408,14 +406,14 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
408
406
  group: "media",
409
407
  props: {
410
408
  styles: m({ default: "text-black" }),
411
- icon: N({
409
+ icon: $({
412
410
  title: "web_blocks.icon",
413
411
  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>'
414
412
  }),
415
- width: B({ title: "web_blocks.width", default: "" }),
416
- height: B({ title: "web_blocks.height", default: "" })
413
+ width: L({ title: "web_blocks.width", default: "" }),
414
+ height: L({ title: "web_blocks.height", default: "" })
417
415
  }
418
- }, ze = (e) => {
416
+ }, He = (e) => {
419
417
  const { blockProps: l, image: t, styles: o, alt: a, height: r, width: n, lazyLoading: i } = e;
420
418
  return k(t) ? /* @__PURE__ */ s.jsx(_, { className: "h-36" }) : b.createElement("img", {
421
419
  ...l,
@@ -426,15 +424,15 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
426
424
  height: r,
427
425
  width: n
428
426
  });
429
- }, Ae = {
427
+ }, Re = {
430
428
  type: "Image",
431
429
  label: "Image",
432
430
  category: "core",
433
- icon: z,
431
+ icon: R,
434
432
  group: "media",
435
433
  props: {
436
434
  styles: m({ default: "" }),
437
- image: C({
435
+ image: j({
438
436
  title: "Image",
439
437
  default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
440
438
  }),
@@ -443,26 +441,25 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
443
441
  height: p({ title: "Height", default: "" }),
444
442
  lazyLoading: y({ title: "Lazy Load", default: !0 })
445
443
  }
446
- }, 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) => {
447
- if (P.test(e)) {
448
- const l = e.match(P);
449
- return l ? `https://www.youtube.com/embed/${l[4]}` : e;
450
- }
444
+ }, E = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, N = /^(https?:\/\/)?(www\.)?player.vimeo\.com/, P = /^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/, ze = (e) => {
451
445
  if (E.test(e)) {
452
446
  const l = e.match(E);
447
+ return l ? `https://www.youtube.com/embed/${l[4]}` : e;
448
+ }
449
+ if (N.test(e)) {
450
+ const l = e.match(N);
453
451
  return l ? `https://player.vimeo.com/video/${l[3]}` : e;
454
452
  }
455
- if ($.test(e)) {
456
- const l = e.match($);
453
+ if (P.test(e)) {
454
+ const l = e.match(P);
457
455
  return l ? `https://www.dailymotion.com/embed/video/${l[4]}` : e;
458
456
  }
459
457
  return null;
460
- }, qe = b.memo(
458
+ }, Ae = b.memo(
461
459
  (e) => {
462
460
  const { blockProps: l, inBuilder: t, styles: o, url: a, controls: r } = e, n = w(r, "autoPlay", !1), i = w(r, "controls", !1), c = n || w(r, "muted", !0), d = w(r, "loop", !1);
463
- if (k(a))
464
- return /* @__PURE__ */ s.jsx(_, { inBuilder: t, className: "h-36" });
465
- let h = Re(a), f = null;
461
+ if (k(a)) return /* @__PURE__ */ s.jsx(_, { inBuilder: t, className: "h-36" });
462
+ let h = ze(a), f = null;
466
463
  if (h) {
467
464
  if (!k(h)) {
468
465
  const g = [];
@@ -491,7 +488,7 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
491
488
  f
492
489
  ] }) });
493
490
  }
494
- ), De = {
491
+ ), qe = {
495
492
  type: "Video",
496
493
  label: "Video",
497
494
  category: "core",
@@ -515,17 +512,17 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
515
512
  })
516
513
  }
517
514
  };
518
- function Fe(e) {
515
+ function De(e) {
519
516
  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);
520
517
  }
521
- const Ge = (e) => {
518
+ const Fe = (e) => {
522
519
  const { scripts: l, inBuilder: t, blockProps: o } = e;
523
- return t ? /* @__PURE__ */ s.jsx("div", { ...o, 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 } });
524
- }, Ve = {
520
+ return t ? /* @__PURE__ */ s.jsx("div", { ...o, children: /* @__PURE__ */ s.jsx("div", { className: C("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 } });
521
+ }, Ge = {
525
522
  type: "CustomScript",
526
523
  label: "web_blocks.custom_script",
527
524
  category: "core",
528
- icon: Fe,
525
+ icon: De,
529
526
  group: "advanced",
530
527
  props: {
531
528
  scripts: T({
@@ -534,10 +531,10 @@ const Ge = (e) => {
534
531
  placeholder: "<script>console.log('Hello, world!');<\/script>"
535
532
  })
536
533
  }
537
- }, Ue = (e) => {
534
+ }, Ve = (e) => {
538
535
  const { blockProps: l, styles: t } = e;
539
536
  return b.createElement("hr", { ...t, ...l });
540
- }, Oe = {
537
+ }, Ue = {
541
538
  type: "Divider",
542
539
  label: "web_blocks.divider",
543
540
  category: "core",
@@ -546,7 +543,7 @@ const Ge = (e) => {
546
543
  props: {
547
544
  styles: m({ default: "bg-gray-900 h-0.5 py-2 my-1" })
548
545
  }
549
- }, We = () => null, Xe = {
546
+ }, Oe = () => null, We = {
550
547
  type: "Dark Mode",
551
548
  label: "web_blocks.dark_mode",
552
549
  category: "core",
@@ -602,7 +599,7 @@ const Ge = (e) => {
602
599
  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>"
603
600
  }
604
601
  ]
605
- }, Ye = (e) => {
602
+ }, Xe = (e) => {
606
603
  const { blockProps: l, inBuilder: t, children: o, globalBlock: a } = e;
607
604
  return t && !a ? /* @__PURE__ */ s.jsxs(
608
605
  "div",
@@ -618,7 +615,7 @@ const Ge = (e) => {
618
615
  ]
619
616
  }
620
617
  ) : b.createElement("div", { ...l }, o);
621
- }, Ze = {
618
+ }, Ye = {
622
619
  type: "GlobalBlock",
623
620
  label: "Global Block",
624
621
  icon: ce,
@@ -627,21 +624,21 @@ const Ge = (e) => {
627
624
  props: {
628
625
  globalBlock: p({ title: "global block", default: "", hidden: !0 })
629
626
  }
630
- }, Je = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ s.jsx("span", { "data-ai-key": "content", ...e.blockProps, children: e.content }) : `${e.content}`, Ke = {
627
+ }, Ze = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ s.jsx("span", { "data-ai-key": "content", ...e.blockProps, children: e.content }) : `${e.content}`, Je = {
631
628
  type: "Text",
632
629
  label: "Text",
633
630
  hidden: !0,
634
631
  category: "core",
635
632
  group: "typography",
636
- icon: A,
633
+ icon: z,
637
634
  props: {
638
- content: L({ title: "Content", default: "", ai: !0, i18n: !0 })
635
+ content: B({ title: "Content", default: "", ai: !0, i18n: !0 })
639
636
  }
640
- }, Qe = (e) => {
637
+ }, Ke = (e) => {
641
638
  const { blockProps: l, backgroundImage: t, children: o, styles: a } = e;
642
639
  let r = {};
643
640
  return t && (r = { backgroundImage: `url(${t})` }), b.createElement("div", { ...l, ...a, style: r }, o);
644
- }, et = {
641
+ }, Qe = {
645
642
  type: "Body",
646
643
  label: "Body",
647
644
  category: "core",
@@ -649,31 +646,48 @@ const Ge = (e) => {
649
646
  hidden: !0,
650
647
  props: {
651
648
  styles: m({ default: "font-body antialiased" }),
652
- backgroundImage: C({ title: "Background Image" })
649
+ backgroundImage: j({ title: "Background Image" })
653
650
  },
654
651
  canAcceptBlock: () => !0,
655
652
  canDelete: () => !1,
656
653
  canMove: () => !1,
657
654
  canDuplicate: () => !1
658
- }, tt = (e) => {
655
+ }, et = (e) => {
659
656
  const { blockProps: l, styles: t } = e;
660
657
  return b.createElement("br", { ...l, ...t });
661
- }, lt = {
658
+ }, tt = {
662
659
  type: "LineBreak",
663
660
  label: "Line Break",
664
661
  category: "core",
665
662
  group: "basic",
666
663
  hidden: !0,
667
- icon: A,
664
+ icon: z,
668
665
  props: {
669
666
  styles: m({ default: "" })
670
667
  }
671
- }, ot = (e) => {
668
+ }, lt = (e) => {
672
669
  const { blockProps: l, errorMessage: t, name: o, _type: a, successMessage: r, action: n, styles: i, children: c } = e;
673
670
  let d = c;
674
671
  c || (d = /* @__PURE__ */ s.jsx(_, {}));
675
672
  const h = {
676
- "x-data": "{}",
673
+ "x-data": `{
674
+ formStatus: '',
675
+ async post() {
676
+ try {
677
+ const formData = new FormData($el);
678
+ const response = await fetch($el.action, {
679
+ method: $el.method,
680
+ body: formData
681
+ });
682
+ if (!response.ok) throw new Error();
683
+ this.formStatus = 'SUCCESS';
684
+ $el.querySelector('[x-html]').innerHTML = $el.dataset.success;
685
+ } catch (error) {
686
+ this.formStatus = 'ERROR';
687
+ $el.querySelector('[x-html]').innerHTML = $el.dataset.error;
688
+ }
689
+ }
690
+ }`,
677
691
  "x-on:submit.prevent": "post"
678
692
  }, f = {
679
693
  "x-html": "",
@@ -696,7 +710,7 @@ const Ge = (e) => {
696
710
  ]
697
711
  }
698
712
  );
699
- }, at = {
713
+ }, ot = {
700
714
  type: "Form",
701
715
  label: "Form",
702
716
  category: "core",
@@ -718,7 +732,7 @@ const Ge = (e) => {
718
732
  })
719
733
  },
720
734
  canAcceptBlock: () => !0
721
- }, st = (e) => {
735
+ }, at = (e) => {
722
736
  const { blockProps: l, inBuilder: t, label: o, styles: a, inputStyles: r, icon: n, iconPos: i } = e, c = I(), d = {
723
737
  "x-bind:disabled": "formLoading"
724
738
  };
@@ -737,7 +751,7 @@ const Ge = (e) => {
737
751
  ]
738
752
  }
739
753
  );
740
- }, rt = {
754
+ }, st = {
741
755
  type: "FormButton",
742
756
  label: "Submit Button",
743
757
  category: "core",
@@ -748,7 +762,7 @@ const Ge = (e) => {
748
762
  styles: m({
749
763
  default: "text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"
750
764
  }),
751
- icon: N({ title: "Icon", default: "" }),
765
+ icon: $({ title: "Icon", default: "" }),
752
766
  iconPos: v({
753
767
  title: "Icon Position",
754
768
  default: "order-last",
@@ -758,7 +772,7 @@ const Ge = (e) => {
758
772
  ]
759
773
  })
760
774
  }
761
- }, nt = (e) => {
775
+ }, rt = (e) => {
762
776
  const {
763
777
  blockProps: l,
764
778
  label: t,
@@ -799,11 +813,11 @@ const Ge = (e) => {
799
813
  }
800
814
  )
801
815
  ] });
802
- }, it = {
816
+ }, nt = {
803
817
  type: "Input",
804
818
  label: "Input",
805
819
  category: "core",
806
- icon: R,
820
+ icon: A,
807
821
  group: "form",
808
822
  props: {
809
823
  styles: m({ default: "" }),
@@ -829,7 +843,7 @@ const Ge = (e) => {
829
843
  }),
830
844
  required: y({ title: "Required", default: !1 })
831
845
  }
832
- }, ct = (e) => {
846
+ }, it = (e) => {
833
847
  const { blockProps: l, fieldName: t, label: o, styles: a, inputStyles: r, checked: n, required: i, showLabel: c = !0 } = e, d = I();
834
848
  return c ? /* @__PURE__ */ s.jsxs("div", { ...a, ...l, children: [
835
849
  /* @__PURE__ */ s.jsx("input", { ...r, name: t, id: d, type: "radio", required: i, defaultChecked: n }),
@@ -847,7 +861,7 @@ const Ge = (e) => {
847
861
  name: t
848
862
  }
849
863
  );
850
- }, dt = {
864
+ }, ct = {
851
865
  type: "Radio",
852
866
  label: "web_blocks.radio",
853
867
  category: "core",
@@ -860,7 +874,7 @@ const Ge = (e) => {
860
874
  checked: y({ title: "web_blocks.checked", default: !1 }),
861
875
  required: y({ title: "web_blocks.required", default: !1 })
862
876
  }
863
- }, ut = (e) => {
877
+ }, dt = (e) => {
864
878
  const {
865
879
  blockProps: l,
866
880
  fieldName: t,
@@ -909,7 +923,7 @@ const Ge = (e) => {
909
923
  ]
910
924
  }
911
925
  );
912
- }, pt = {
926
+ }, ut = {
913
927
  type: "Select",
914
928
  label: "web_blocks.select",
915
929
  category: "core",
@@ -935,7 +949,7 @@ const Ge = (e) => {
935
949
  }
936
950
  })
937
951
  }
938
- }, bt = (e) => {
952
+ }, pt = (e) => {
939
953
  const { blockProps: l, fieldName: t, label: o, placeholder: a, styles: r, inputStyles: n, _rows: i, showLabel: c } = e, d = I();
940
954
  return c ? /* @__PURE__ */ s.jsxs("div", { ...r, ...l, children: [
941
955
  c && /* @__PURE__ */ s.jsx("label", { htmlFor: d, children: o }),
@@ -952,11 +966,11 @@ const Ge = (e) => {
952
966
  rows: i
953
967
  }
954
968
  );
955
- }, mt = {
969
+ }, bt = {
956
970
  type: "TextArea",
957
971
  label: "web_blocks.textarea",
958
972
  category: "core",
959
- icon: R,
973
+ icon: A,
960
974
  group: "form",
961
975
  props: {
962
976
  fieldName: p({ title: "Field Name", default: "textarea" }),
@@ -968,9 +982,9 @@ const Ge = (e) => {
968
982
  title: "Placeholder",
969
983
  default: "Placeholder"
970
984
  }),
971
- _rows: B({ title: "Rows", default: 3 })
985
+ _rows: L({ title: "Rows", default: 3 })
972
986
  }
973
- }, ft = (e) => {
987
+ }, mt = (e) => {
974
988
  const { blockProps: l, fieldName: t, label: o, styles: a, inputStyles: r, required: n, checked: i, showLabel: c = !0 } = e, d = I();
975
989
  return c ? /* @__PURE__ */ s.jsxs("div", { ...a, ...l, children: [
976
990
  /* @__PURE__ */ s.jsx(
@@ -997,7 +1011,7 @@ const Ge = (e) => {
997
1011
  name: t
998
1012
  }
999
1013
  );
1000
- }, ht = {
1014
+ }, ft = {
1001
1015
  type: "Checkbox",
1002
1016
  label: "web_blocks.checkbox",
1003
1017
  category: "core",
@@ -1010,9 +1024,9 @@ const Ge = (e) => {
1010
1024
  checked: y({ title: "web_blocks.checked", default: !1 }),
1011
1025
  required: y({ title: "web_blocks.required", default: !1 })
1012
1026
  }
1013
- }, Lt = () => {
1014
- u(ue, pe), u(ye, ge), u(be, me), u(ke, xe), u(we, ve), u(_e, Ie), u(Be, Le), 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);
1027
+ }, _t = () => {
1028
+ u(de, ue), u(he, ye), u(pe, be), u(ge, ke), u(xe, we), u(ve, _e), u(Ie, Le), u(Be, Ce), u(je, Se), u(Me, $e), u(Ee, Ne), u(Pe, Te), u(He, Re), u(Ae, qe), u(me, fe), u(Ze, Je), u(lt, ot), u(at, st), u(rt, nt), u(mt, ft), u(it, ct), u(dt, ut), u(pt, bt), u(et, tt), u(Ke, Qe), u(Fe, Ge), u(Ve, Ue), u(Oe, We), u(Xe, Ye);
1015
1029
  };
1016
1030
  export {
1017
- Lt as loadWebBlocks
1031
+ _t as loadWebBlocks
1018
1032
  };
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.114",
8
+ "version": "1.2.116",
9
9
  "type": "module",
10
10
  "repository": {
11
11
  "type": "git",
@@ -103,6 +103,7 @@
103
103
  "@tailwindcss/forms": "^0.5.6",
104
104
  "@tailwindcss/line-clamp": "^0.4.4",
105
105
  "@tailwindcss/typography": "^0.5.10",
106
+ "animate.css": "^4.1.1",
106
107
  "class-variance-authority": "0.6.1",
107
108
  "clsx": "1.2.1",
108
109
  "cmdk": "0.2.0",
@@ -131,6 +132,7 @@
131
132
  "react-json-view-lite": "^1.4.0",
132
133
  "react-quill": "^2.0.0",
133
134
  "react-wrap-balancer": "^1.1.0",
135
+ "tailwind-animatecss": "^1.0.0",
134
136
  "tailwind-merge": "2.3.0",
135
137
  "tree-model": "^1.0.7",
136
138
  "undo-manager": "^1.1.1",