@chaibuilder/sdk 3.1.28 → 3.1.30

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,16 +1,16 @@
1
1
  import { registerChaiBlockSchema as p, StylesProp as u, registerChaiBlock as d, getRegisteredChaiBlock as U, stylesProp as L, closestBlockProp as Z } from "@chaibuilder/runtime";
2
- import { jsx as i, jsxs as g, Fragment as N } from "react/jsx-runtime";
2
+ import { jsx as i, jsxs as h, Fragment as N } from "react/jsx-runtime";
3
3
  import { c as _, g as I } from "./common-functions-D2lMFR6K.js";
4
- import * as y from "react";
5
- import { createElement as w } from "react";
6
- import { ButtonIcon as M, CodeIcon as H, FrameIcon as $, SketchLogoIcon as q, LayoutIcon as G, RowsIcon as j, DividerHorizontalIcon as W, CheckboxIcon as O, FileTextIcon as Y, InputIcon as D, LetterCaseToggleIcon as Q, RadiobuttonIcon as J, DropdownMenuIcon as X, HeadingIcon as K, TableIcon as ee, BorderTopIcon as te, BorderAllIcon as oe, ViewHorizontalIcon as le, DragHandleHorizontalIcon as re, ImageIcon as ne, Link1Icon as ie, ColumnsIcon as ae, TextIcon as se, CursorTextIcon as ce, SpaceBetweenVerticallyIcon as de, VideoIcon as pe, ChevronLeftIcon as ue, ChevronRightIcon as me, LoopIcon as z } from "@radix-ui/react-icons";
7
- import { isEmpty as v, get as k, map as R, isNull as ye, omit as V, pick as F } from "lodash-es";
4
+ import * as b from "react";
5
+ import { createElement as x } from "react";
6
+ import { ButtonIcon as M, CodeIcon as H, FrameIcon as $, SketchLogoIcon as q, LayoutIcon as G, RowsIcon as j, DividerHorizontalIcon as W, CheckboxIcon as O, FileTextIcon as Y, InputIcon as D, LetterCaseToggleIcon as Q, RadiobuttonIcon as J, DropdownMenuIcon as X, HeadingIcon as K, TableIcon as ee, BorderTopIcon as te, BorderAllIcon as oe, ViewHorizontalIcon as le, DragHandleHorizontalIcon as re, ImageIcon as ne, Link1Icon as ie, ColumnsIcon as ae, TextIcon as se, CursorTextIcon as ce, SpaceBetweenVerticallyIcon as de, VideoIcon as pe, ChevronLeftIcon as ue, ChevronRightIcon as me, LoopIcon as V } from "@radix-ui/react-icons";
7
+ import { isEmpty as w, get as k, map as R, isNull as ye, omit as z, pick as F } from "lodash-es";
8
8
  const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div", { className: _("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ i("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ i("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, ge = (e) => {
9
9
  const { blockProps: o, inBuilder: t, backgroundImage: l, children: r, tag: n = "div", styles: a } = e;
10
10
  let s = r;
11
11
  r || (s = /* @__PURE__ */ i(C, { inBuilder: t }));
12
12
  let c = {};
13
- return l && (c = { backgroundImage: `url(${l})` }), y.createElement(n, { ...o, ...a, style: c }, s);
13
+ return l && (c = { backgroundImage: `url(${l})` }), b.createElement(n, { ...o, ...a, style: c }, s);
14
14
  }, be = {
15
15
  type: "Box",
16
16
  description: "Similar to a div or section elements in HTML",
@@ -54,17 +54,17 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
54
54
  }),
55
55
  canAcceptBlock: () => !0
56
56
  }, fe = (e) => {
57
- const { blockProps: o, iconSize: t, icon: l, content: r, styles: n, children: a, iconPos: s, link: c, inBuilder: m } = e, h = l, b = a || /* @__PURE__ */ g(N, { children: [
57
+ const { blockProps: o, iconSize: t, icon: l, content: r, styles: n, children: a, iconPos: s, link: c, inBuilder: y } = e, g = l, v = a || /* @__PURE__ */ h(N, { children: [
58
58
  r && /* @__PURE__ */ i("span", { children: r }),
59
- h && /* @__PURE__ */ i(
59
+ g && /* @__PURE__ */ i(
60
60
  "div",
61
61
  {
62
62
  style: { width: t + "px" },
63
63
  className: s + " " + (r ? s === "order-first" ? "mr-2" : "ml-2" : "") || "",
64
- dangerouslySetInnerHTML: { __html: h }
64
+ dangerouslySetInnerHTML: { __html: g }
65
65
  }
66
66
  )
67
- ] }), x = w(
67
+ ] }), f = x(
68
68
  "button",
69
69
  {
70
70
  ...o,
@@ -72,9 +72,9 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
72
72
  type: "button",
73
73
  "aria-label": r
74
74
  },
75
- b
75
+ v
76
76
  );
77
- return v(k(c, "href")) ? x : m ? /* @__PURE__ */ i("span", { children: x }) : /* @__PURE__ */ i("a", { "aria-label": r, href: k(c, "href") || "/", target: k(c, "target", "_self"), children: x });
77
+ return w(k(c, "href")) ? f : y ? /* @__PURE__ */ i("span", { children: f }) : /* @__PURE__ */ i("a", { "aria-label": r, href: k(c, "href") || "/", target: k(c, "target", "_self"), children: f });
78
78
  }, he = {
79
79
  type: "Button",
80
80
  description: "similar to a button element in HTML",
@@ -133,13 +133,13 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
133
133
  aiProps: ["content"]
134
134
  }, ke = (e) => {
135
135
  const { blockProps: o, styles: t, htmlCode: l, inBuilder: r } = e;
136
- return r ? /* @__PURE__ */ g("div", { className: "relative", ...o, children: [
136
+ return r ? /* @__PURE__ */ h("div", { className: "relative", ...o, children: [
137
137
  r ? /* @__PURE__ */ i("div", { ...t, className: "absolute z-20 h-full w-full" }) : null,
138
- y.createElement("div", {
138
+ b.createElement("div", {
139
139
  ...t,
140
140
  dangerouslySetInnerHTML: { __html: l.replace(/<script.*?>.*?<\/script>/g, "") }
141
141
  })
142
- ] }) : y.createElement("div", {
142
+ ] }) : b.createElement("div", {
143
143
  ...o,
144
144
  ...t,
145
145
  dangerouslySetInnerHTML: { __html: l }
@@ -186,20 +186,20 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
186
186
  })
187
187
  }, Ce = (e) => {
188
188
  const { blockProps: o, inBuilder: t, children: l, globalBlock: r } = e;
189
- return t && !r ? /* @__PURE__ */ g(
189
+ return t && !r ? /* @__PURE__ */ h(
190
190
  "div",
191
191
  {
192
192
  className: "flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",
193
193
  ...o,
194
194
  children: [
195
- /* @__PURE__ */ g("h1", { children: [
195
+ /* @__PURE__ */ h("h1", { children: [
196
196
  "Global Block - ",
197
197
  r
198
198
  ] }),
199
199
  /* @__PURE__ */ i("p", { children: "Choose a block from the sidebar to add it to this page." })
200
200
  ]
201
201
  }
202
- ) : y.createElement("span", { ...o }, l);
202
+ ) : b.createElement("span", { ...o }, l);
203
203
  }, Ie = {
204
204
  type: "GlobalBlock",
205
205
  description: "A global block component",
@@ -223,10 +223,10 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
223
223
  className: _(e.className, ...o)
224
224
  }), Pe = (e) => {
225
225
  const { blockProps: o, icon: t, styles: l, width: r, inBuilder: n, height: a } = e, s = T(l, "");
226
- if (v(t))
226
+ if (w(t))
227
227
  return /* @__PURE__ */ i(C, { inBuilder: n, className: "h-8 w-14" });
228
228
  const c = t.replace(/<svg /g, '<svg class="w-[inherit] h-[inherit]" ');
229
- return y.createElement("span", {
229
+ return b.createElement("span", {
230
230
  ...o,
231
231
  ...s,
232
232
  style: {
@@ -265,20 +265,20 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
265
265
  })
266
266
  }, Be = (e) => {
267
267
  const { blockProps: o, inBuilder: t, children: l, partialBlockId: r } = e;
268
- return t && !r ? /* @__PURE__ */ g(
268
+ return t && !r ? /* @__PURE__ */ h(
269
269
  "div",
270
270
  {
271
271
  className: "flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",
272
272
  ...o,
273
273
  children: [
274
- /* @__PURE__ */ g("h1", { children: [
274
+ /* @__PURE__ */ h("h1", { children: [
275
275
  "Partial Block - ",
276
276
  r
277
277
  ] }),
278
278
  /* @__PURE__ */ i("p", { children: "Choose a block from the sidebar to add it to this page." })
279
279
  ]
280
280
  }
281
- ) : y.createElement("span", { ...o }, l);
281
+ ) : b.createElement("span", { ...o }, l);
282
282
  }, Se = {
283
283
  type: "PartialBlock",
284
284
  description: "A partial block component. Partial blocks are global blocks that can be used in multiple pages.",
@@ -422,7 +422,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
422
422
  })
423
423
  }, Ae = (e) => {
424
424
  const { blockProps: o, styles: t } = e;
425
- return w("hr", { ...t, ...o });
425
+ return x("hr", { ...t, ...o });
426
426
  }, Ee = {
427
427
  type: "Divider",
428
428
  description: "A horizontal line component",
@@ -438,7 +438,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
438
438
  }, Me = (e) => {
439
439
  const { blockProps: o, styles: t, backgroundImage: l } = e;
440
440
  let r = {};
441
- return l && (r = { backgroundImage: `url(${l})` }), y.createElement("div", { ...o, ...t, style: r });
441
+ return l && (r = { backgroundImage: `url(${l})` }), b.createElement("div", { ...o, ...t, style: r });
442
442
  }, He = {
443
443
  type: "EmptyBox",
444
444
  description: "A box component with no children",
@@ -458,7 +458,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
458
458
  })
459
459
  }, $e = (e) => {
460
460
  const { blockProps: o, fieldName: t, label: l, styles: r, inputStyles: n, required: a, checked: s, showLabel: c = !0 } = e;
461
- return c ? /* @__PURE__ */ g("div", { ...r, ...o, children: [
461
+ return c ? /* @__PURE__ */ h("div", { ...r, ...o, children: [
462
462
  /* @__PURE__ */ i("input", { ...n, name: t, type: "checkbox", required: a, defaultChecked: s }),
463
463
  l && /* @__PURE__ */ i("label", { htmlFor: t, children: l })
464
464
  ] }) : /* @__PURE__ */ i(
@@ -515,7 +515,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
515
515
  }, De = (e) => {
516
516
  const { children: o, blockProps: t, errorMessage: l, successMessage: r, action: n, styles: a, inBuilder: s } = e;
517
517
  let c = o;
518
- return o || (c = /* @__PURE__ */ i(C, { inBuilder: s })), /* @__PURE__ */ g(
518
+ return o || (c = /* @__PURE__ */ i(C, { inBuilder: s })), /* @__PURE__ */ h(
519
519
  "form",
520
520
  {
521
521
  ...{
@@ -537,7 +537,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
537
537
  ]
538
538
  }
539
539
  );
540
- }, ze = {
540
+ }, Ve = {
541
541
  type: "Form",
542
542
  label: "Form",
543
543
  category: "core",
@@ -578,9 +578,9 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
578
578
  i18nProps: ["errorMessage", "successMessage"],
579
579
  aiProps: ["errorMessage", "successMessage"],
580
580
  canAcceptBlock: () => !0
581
- }, Ve = (e) => {
581
+ }, ze = (e) => {
582
582
  const { blockProps: o, inBuilder: t, label: l, styles: r, icon: n, iconSize: a, iconPos: s } = e;
583
- return /* @__PURE__ */ g("button", { ...r, ...o || {}, type: t ? "button" : "submit", "aria-label": l, children: [
583
+ return /* @__PURE__ */ h("button", { ...r, ...o || {}, type: t ? "button" : "submit", "aria-label": l, children: [
584
584
  l,
585
585
  n && /* @__PURE__ */ i(
586
586
  "div",
@@ -708,21 +708,21 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
708
708
  inputStyles: a,
709
709
  showLabel: s,
710
710
  required: c,
711
- inputType: m,
712
- defaultValue: h
713
- } = e, { type: b, autocomplete: x } = Ue(m);
714
- return s ? /* @__PURE__ */ g("div", { ...n, ...o, children: [
711
+ inputType: y,
712
+ defaultValue: g
713
+ } = e, { type: v, autocomplete: f } = Ue(y);
714
+ return s ? /* @__PURE__ */ h("div", { ...n, ...o, children: [
715
715
  s && /* @__PURE__ */ i("label", { htmlFor: t, children: l }),
716
716
  /* @__PURE__ */ i(
717
717
  "input",
718
718
  {
719
719
  name: t,
720
- defaultValue: h,
720
+ defaultValue: g,
721
721
  ...a,
722
- type: b,
722
+ type: v,
723
723
  placeholder: r,
724
724
  required: c,
725
- autoComplete: x
725
+ autoComplete: f
726
726
  }
727
727
  )
728
728
  ] }) : /* @__PURE__ */ i(
@@ -732,11 +732,11 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
732
732
  ...o,
733
733
  ...a,
734
734
  ...n,
735
- type: b,
735
+ type: v,
736
736
  placeholder: r,
737
737
  required: c,
738
- autoComplete: x,
739
- defaultValue: h
738
+ autoComplete: f,
739
+ defaultValue: g
740
740
  }
741
741
  );
742
742
  }, qe = {
@@ -856,7 +856,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
856
856
  i18nProps: ["label", "placeholder"]
857
857
  }, Ge = (e) => {
858
858
  const { blockProps: o, content: t, styles: l, children: r } = e, n = { ...l, ...o };
859
- return r ? y.createElement("label", n, r) : y.createElement("label", {
859
+ return r ? b.createElement("label", n, r) : b.createElement("label", {
860
860
  ...n,
861
861
  dangerouslySetInnerHTML: { __html: t }
862
862
  });
@@ -880,7 +880,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
880
880
  i18nProps: ["content"]
881
881
  }, Oe = (e) => {
882
882
  const { blockProps: o, fieldName: t, label: l, styles: r, inputStyles: n, required: a, checked: s, showLabel: c = !0 } = e;
883
- return c ? /* @__PURE__ */ g("div", { ...r, ...o, children: [
883
+ return c ? /* @__PURE__ */ h("div", { ...r, ...o, children: [
884
884
  /* @__PURE__ */ i("input", { ...n, name: t, type: "radio", required: a, defaultChecked: s }),
885
885
  l && /* @__PURE__ */ i("label", { htmlFor: t, children: l })
886
886
  ] }) : /* @__PURE__ */ i(
@@ -944,38 +944,38 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
944
944
  inputStyles: a,
945
945
  required: s,
946
946
  showLabel: c,
947
- _multiple: m,
948
- options: h,
949
- defaultValue: b
950
- } = e, x = m && b ? b.split(",").map((f) => f.trim()) : b || "";
951
- return c ? /* @__PURE__ */ g("div", { ...n, ...o, children: [
947
+ _multiple: y,
948
+ options: g,
949
+ defaultValue: v
950
+ } = e, f = y && v ? v.split(",").map((m) => m.trim()) : v || "";
951
+ return c ? /* @__PURE__ */ h("div", { ...n, ...o, children: [
952
952
  c && /* @__PURE__ */ i("label", { htmlFor: t, children: l }),
953
- /* @__PURE__ */ g(
953
+ /* @__PURE__ */ h(
954
954
  "select",
955
955
  {
956
956
  ...a,
957
957
  required: s,
958
- multiple: m,
958
+ multiple: y,
959
959
  name: t,
960
- defaultValue: x,
960
+ defaultValue: f,
961
961
  children: [
962
962
  /* @__PURE__ */ i("option", { value: "", disabled: !0, hidden: !0, children: r }),
963
- R(h, (f) => /* @__PURE__ */ i("option", { value: f == null ? void 0 : f.value, children: f == null ? void 0 : f.label }, f == null ? void 0 : f.value))
963
+ R(g, (m) => /* @__PURE__ */ i("option", { value: m == null ? void 0 : m.value, children: m == null ? void 0 : m.label }, m == null ? void 0 : m.value))
964
964
  ]
965
965
  }
966
966
  )
967
- ] }) : /* @__PURE__ */ g(
967
+ ] }) : /* @__PURE__ */ h(
968
968
  "select",
969
969
  {
970
970
  ...n,
971
971
  ...o,
972
972
  required: s,
973
- multiple: m,
973
+ multiple: y,
974
974
  name: t,
975
- defaultValue: x,
975
+ defaultValue: f,
976
976
  children: [
977
977
  /* @__PURE__ */ i("option", { value: "", disabled: !0, hidden: !0, children: r }),
978
- R(h, (f) => /* @__PURE__ */ i("option", { value: f == null ? void 0 : f.value, children: f == null ? void 0 : f.label }, f == null ? void 0 : f.value))
978
+ R(g, (m) => /* @__PURE__ */ i("option", { value: m == null ? void 0 : m.value, children: m == null ? void 0 : m.label }, m == null ? void 0 : m.value))
979
979
  ]
980
980
  }
981
981
  );
@@ -1049,8 +1049,8 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
1049
1049
  aiProps: ["label", "placeholder"],
1050
1050
  i18nProps: ["label", "placeholder"]
1051
1051
  }, Xe = (e) => {
1052
- const { blockProps: o, fieldName: t, label: l, placeholder: r, styles: n, inputStyles: a, rows: s, showLabel: c, required: m, defaultValue: h } = e;
1053
- return c ? /* @__PURE__ */ g("div", { ...n, ...o, children: [
1052
+ const { blockProps: o, fieldName: t, label: l, placeholder: r, styles: n, inputStyles: a, rows: s, showLabel: c, required: y, defaultValue: g } = e;
1053
+ return c ? /* @__PURE__ */ h("div", { ...n, ...o, children: [
1054
1054
  c && /* @__PURE__ */ i("label", { htmlFor: t, children: l }),
1055
1055
  /* @__PURE__ */ i(
1056
1056
  "textarea",
@@ -1059,8 +1059,8 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
1059
1059
  ...a,
1060
1060
  placeholder: r,
1061
1061
  rows: s,
1062
- required: m,
1063
- defaultValue: h
1062
+ required: y,
1063
+ defaultValue: g
1064
1064
  }
1065
1065
  )
1066
1066
  ] }) : /* @__PURE__ */ i(
@@ -1072,8 +1072,8 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
1072
1072
  ...n,
1073
1073
  placeholder: r,
1074
1074
  rows: s,
1075
- required: m,
1076
- defaultValue: h
1075
+ required: y,
1076
+ defaultValue: g
1077
1077
  }
1078
1078
  );
1079
1079
  }, Ke = {
@@ -1129,7 +1129,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
1129
1129
  i18nProps: ["label", "placeholder"]
1130
1130
  }, et = (e) => {
1131
1131
  const { blockProps: o, styles: t, content: l, tag: r = "h1", children: n = null } = e;
1132
- return n ? y.createElement(r, { ...t, ...o }, n) : y.createElement(r, {
1132
+ return n ? b.createElement(r, { ...t, ...o }, n) : b.createElement(r, {
1133
1133
  ...t,
1134
1134
  ...o,
1135
1135
  dangerouslySetInnerHTML: { __html: l }
@@ -1163,7 +1163,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
1163
1163
  canAcceptBlock: () => !0
1164
1164
  }, ot = (e) => {
1165
1165
  const { blockProps: o, styles: t } = e;
1166
- return w("br", { ...o, ...t });
1166
+ return x("br", { ...o, ...t });
1167
1167
  }, lt = {
1168
1168
  type: "LineBreak",
1169
1169
  label: "Line Break",
@@ -1181,19 +1181,19 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
1181
1181
  canDuplicate: () => !1
1182
1182
  }, rt = (e) => {
1183
1183
  const { blockProps: o, children: t, styles: l } = e;
1184
- return t ? w("table", { ...o, ...l }, t) : /* @__PURE__ */ i(C, {});
1184
+ return t ? x("table", { ...o, ...l }, t) : /* @__PURE__ */ i(C, {});
1185
1185
  }, nt = (e) => {
1186
1186
  const { blockProps: o, children: t, styles: l } = e;
1187
- return t ? w("thead", { ...o, ...l }, t) : /* @__PURE__ */ i(C, {});
1187
+ return t ? x("thead", { ...o, ...l }, t) : /* @__PURE__ */ i(C, {});
1188
1188
  }, it = (e) => {
1189
1189
  const { blockProps: o, children: t, styles: l } = e;
1190
- return t ? w("tbody", { ...o, ...l }, t) : /* @__PURE__ */ i(C, {});
1190
+ return t ? x("tbody", { ...o, ...l }, t) : /* @__PURE__ */ i(C, {});
1191
1191
  }, at = (e) => {
1192
1192
  const { blockProps: o, children: t, styles: l } = e;
1193
- return t ? w("tr", { ...o, ...l }, t) : /* @__PURE__ */ i(C, {});
1193
+ return t ? x("tr", { ...o, ...l }, t) : /* @__PURE__ */ i(C, {});
1194
1194
  }, st = (e) => {
1195
1195
  const { blockProps: o, children: t, content: l, styles: r } = e;
1196
- return !t && v(l) ? /* @__PURE__ */ i(C, {}) : t ? w("td", { ...o, ...r }, t) : w("td", {
1196
+ return !t && w(l) ? /* @__PURE__ */ i(C, {}) : t ? x("td", { ...o, ...r }, t) : x("td", {
1197
1197
  ...o,
1198
1198
  ...r,
1199
1199
  dangerouslySetInnerHTML: { __html: l }
@@ -1321,9 +1321,9 @@ function P(e) {
1321
1321
  return e === "TableRow" ? t() : e === "TableHead" ? l() : e === "TableBody" ? r() : [];
1322
1322
  }
1323
1323
  const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjZjNmNGY2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNiIgZmlsbD0iI2Q1ZDdkYSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPkltYWdlIFBsYWNlaG9sZGVyPC90ZXh0Pjwvc3ZnPg==", dt = (e) => {
1324
- const { blockProps: o, image: t, mobileImage: l, styles: r, alt: n, height: a, width: s, lazyLoading: c, mobileWidth: m, mobileHeight: h } = e;
1325
- return v(t) ? /* @__PURE__ */ i(C, { className: "h-36" }) : /* @__PURE__ */ g("picture", { children: [
1326
- l && /* @__PURE__ */ i("source", { srcSet: l, media: "(max-width: 480px)", width: m, height: h }),
1324
+ const { blockProps: o, image: t, mobileImage: l, styles: r, alt: n, height: a, width: s, lazyLoading: c, mobileWidth: y, mobileHeight: g } = e;
1325
+ return w(t) ? /* @__PURE__ */ i(C, { className: "h-36" }) : /* @__PURE__ */ h("picture", { children: [
1326
+ l && /* @__PURE__ */ i("source", { srcSet: l, media: "(max-width: 480px)", width: y, height: g }),
1327
1327
  /* @__PURE__ */ i(
1328
1328
  "img",
1329
1329
  {
@@ -1401,7 +1401,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1401
1401
  }, ut = (e) => {
1402
1402
  const { blockProps: o, link: t, children: l, styles: r, inBuilder: n, content: a } = e;
1403
1403
  let s = {};
1404
- return !l && v(a) && (s = { minHeight: "50px", display: "flex", alignItems: "center", justifyContent: "center" }), n ? l ? /* @__PURE__ */ i("span", { role: "link", ...o, style: s, ...r, children: l }) : w(
1404
+ return !l && w(a) && (s = { minHeight: "50px", display: "flex", alignItems: "center", justifyContent: "center" }), n ? l ? /* @__PURE__ */ i("span", { role: "link", ...o, style: s, ...r, children: l }) : x(
1405
1405
  "span",
1406
1406
  {
1407
1407
  ...o,
@@ -1410,7 +1410,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1410
1410
  role: "link"
1411
1411
  },
1412
1412
  a
1413
- ) : l ? /* @__PURE__ */ i("a", { "aria-label": a, href: (t == null ? void 0 : t.href) || "#/", target: t == null ? void 0 : t.target, ...o, ...r, children: l }) : w(
1413
+ ) : l ? /* @__PURE__ */ i("a", { "aria-label": a, href: (t == null ? void 0 : t.href) || "#/", target: t == null ? void 0 : t.target, ...o, ...r, children: l }) : x(
1414
1414
  "a",
1415
1415
  {
1416
1416
  ...o,
@@ -1464,7 +1464,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1464
1464
  canAcceptBlock: (e) => e !== "Link"
1465
1465
  }, yt = (e) => {
1466
1466
  const { blockProps: o, children: t, styles: l, tag: r, inBuilder: n } = e;
1467
- return !t && v(l == null ? void 0 : l.className) ? /* @__PURE__ */ i(C, { inBuilder: n }) : y.createElement(r || "ul", { ...o, ...l }, t);
1467
+ return !t && w(l == null ? void 0 : l.className) ? /* @__PURE__ */ i(C, { inBuilder: n }) : b.createElement(r || "ul", { ...o, ...l }, t);
1468
1468
  }, gt = {
1469
1469
  type: "List",
1470
1470
  description: "A list component",
@@ -1504,7 +1504,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1504
1504
  ]
1505
1505
  }, bt = (e) => {
1506
1506
  const { blockProps: o, content: t, styles: l, children: r, tag: n } = e;
1507
- return r ? y.createElement(n || "li", { ...l, ...o }, r) : y.createElement(n || "li", {
1507
+ return r ? b.createElement(n || "li", { ...l, ...o }, r) : b.createElement(n || "li", {
1508
1508
  ...l,
1509
1509
  ...o,
1510
1510
  dangerouslySetInnerHTML: { __html: t }
@@ -1535,9 +1535,9 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1535
1535
  canBeNested: (e) => e === "List" || e === "Repeater"
1536
1536
  }, ht = (e) => {
1537
1537
  const { blockProps: o, styles: t, content: l } = e;
1538
- if (!ye(e.children)) return y.createElement("p", { ...t, ...o }, e.children);
1538
+ if (!ye(e.children)) return b.createElement("p", { ...t, ...o }, e.children);
1539
1539
  const r = T(t, "rte");
1540
- return y.createElement("div", {
1540
+ return b.createElement("div", {
1541
1541
  ...r,
1542
1542
  ...o,
1543
1543
  dangerouslySetInnerHTML: { __html: l }
@@ -1589,7 +1589,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1589
1589
  i18nProps: ["content"]
1590
1590
  }, vt = (e) => {
1591
1591
  const { blockProps: o, styles: t, content: l, children: r = null, tag: n } = e;
1592
- return r ? y.createElement("span", { ...t, ...o }, r) : y.createElement(n || "span", {
1592
+ return r ? b.createElement("span", { ...t, ...o }, r) : b.createElement(n || "span", {
1593
1593
  ...t,
1594
1594
  ...o,
1595
1595
  dangerouslySetInnerHTML: { __html: l || "" }
@@ -1671,8 +1671,8 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1671
1671
  const a = e.match(A);
1672
1672
  if (a) {
1673
1673
  const s = a[4];
1674
- let c = `https://www.youtube.com/embed/${s}`, m = t ? "autoplay=1" : "";
1675
- return m += r ? `&loop=1&playlist=${s}` : "", m += n ? "&mute=1&muted=1" : "", m += l ? "&controls=1" : "&controls=0", `${c}?${m}`;
1674
+ let c = `https://www.youtube.com/embed/${s}`, y = t ? "autoplay=1" : "";
1675
+ return y += r ? `&loop=1&playlist=${s}` : "", y += n ? "&mute=1&muted=1" : "", y += l ? "&controls=1" : "&controls=0", `${c}?${y}`;
1676
1676
  }
1677
1677
  }
1678
1678
  if (E.test(e)) {
@@ -1685,41 +1685,42 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1685
1685
  }
1686
1686
  return null;
1687
1687
  }, Bt = (e) => {
1688
- const { url: o, blockProps: t, styles: l, controls: r, videoSource: n, inBuilder: a } = e, s = Lt(o, r);
1689
- return /* @__PURE__ */ g("div", { ...V(l, "className"), className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
1690
- !s && a ? /* @__PURE__ */ i("div", { className: "absolute flex h-full w-full items-center justify-center bg-gray-300 text-center", children: v(o) ? `Provided ${n} video link in settings Video URL.` : `Provided ${n} video link is invalid.` }) : /* @__PURE__ */ i("iframe", { width: "100%", src: s, ...F(l, "className") }),
1688
+ const { url: o, blockProps: t, styles: l, controls: r, videoSource: n, inBuilder: a, title: s } = e, c = Lt(o, r);
1689
+ return /* @__PURE__ */ h("div", { ...z(l, "className"), className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
1690
+ !c && a ? /* @__PURE__ */ i("div", { className: "absolute flex h-full w-full items-center justify-center bg-gray-300 text-center", children: w(o) ? `Provided ${n} video link in settings Video URL.` : `Provided ${n} video link is invalid.` }) : /* @__PURE__ */ i("iframe", { width: "100%", src: c, title: s || "Video player", ...F(l, "className") }),
1691
1691
  a && /* @__PURE__ */ i("div", { ...t, className: "absolute top-0 h-full w-full" })
1692
1692
  ] });
1693
1693
  }, St = (e) => {
1694
- const { url: o, styles: t, controls: l, sources: r, poster: n, blockProps: a } = e;
1695
- let s = n;
1696
- const c = [...k(r, "srcsets", []) || []];
1697
- o && typeof o == "string" && c.push({ url: o, width: "9999" });
1698
- const m = c.sort((b, x) => parseInt(b.width) - parseInt(x.width)).filter((b) => !v(b.url) && !v(b.width));
1699
- m.length === 0 && !s && (s = "https://placehold.co/300x200/EEE/ccc?text=Choose%20Video");
1700
- const h = k(l, "autoplay", !1) || k(l, "muted", !0);
1701
- return (s || !v(m)) && /* @__PURE__ */ i("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: /* @__PURE__ */ w(
1694
+ const { url: o, styles: t, controls: l, sources: r, poster: n, blockProps: a, title: s } = e;
1695
+ let c = n;
1696
+ const y = [...k(r, "srcsets", []) || []];
1697
+ o && typeof o == "string" && y.push({ url: o, width: "9999" });
1698
+ const g = y.sort((f, m) => parseInt(f.width) - parseInt(m.width)).filter((f) => !w(f.url) && !w(f.width));
1699
+ g.length === 0 && !c && (c = "https://placehold.co/300x200/EEE/ccc?text=Choose%20Video");
1700
+ const v = k(l, "autoplay", !1) || k(l, "muted", !0);
1701
+ return (c || !w(g)) && /* @__PURE__ */ i("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: /* @__PURE__ */ x(
1702
1702
  "video",
1703
1703
  {
1704
1704
  ...t,
1705
1705
  ...a,
1706
- key: JSON.stringify(m),
1706
+ title: s || "Video player",
1707
+ key: JSON.stringify(g),
1707
1708
  controls: k(l, "controls", !1),
1708
1709
  autoPlay: k(l, "autoplay", !1),
1709
1710
  loop: k(l, "loop", !1),
1710
- poster: s,
1711
- ...h ? { muted: !0 } : {}
1711
+ poster: c,
1712
+ ...v ? { muted: !0 } : {}
1712
1713
  },
1713
- m.map((b) => {
1714
- if (!b.url || b.url.length < 4 || isNaN(b.width)) return null;
1715
- const x = `(max-width: ${b.width}px)`;
1716
- return /* @__PURE__ */ i("source", { src: b.url, media: x, type: b.type }, b.url);
1714
+ g.map((f) => {
1715
+ if (!f.url || f.url.length < 4 || isNaN(f.width)) return null;
1716
+ const m = `(max-width: ${f.width}px)`;
1717
+ return /* @__PURE__ */ i("source", { src: f.url, media: m, type: f.type }, f.url);
1717
1718
  }),
1718
1719
  "Your browser does not support the video tag."
1719
1720
  ) });
1720
1721
  }, Nt = (e) => {
1721
1722
  const { videoSource: o } = e;
1722
- return o === "Custom" ? /* @__PURE__ */ i(St, { ...e }) : o === "Youtube" || o === "Vimeo" ? /* @__PURE__ */ i(Bt, { ...e }) : /* @__PURE__ */ g("div", { children: [
1723
+ return o === "Custom" ? /* @__PURE__ */ i(St, { ...e }) : o === "Youtube" || o === "Vimeo" ? /* @__PURE__ */ i(Bt, { ...e }) : /* @__PURE__ */ h("div", { children: [
1723
1724
  "Invalid video source : ",
1724
1725
  o
1725
1726
  ] });
@@ -1737,6 +1738,11 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1737
1738
  default: "Custom",
1738
1739
  enum: ["Custom", "Youtube", "Vimeo"],
1739
1740
  title: "Video source"
1741
+ },
1742
+ title: {
1743
+ type: "string",
1744
+ title: "Video Title",
1745
+ default: "Video player"
1740
1746
  }
1741
1747
  },
1742
1748
  allOf: [
@@ -1807,10 +1813,10 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1807
1813
  poster: { "ui:placeholder": "Enter poster URL" }
1808
1814
  }
1809
1815
  }),
1810
- i18nProps: ["url"]
1816
+ i18nProps: ["url", "title"]
1811
1817
  }, Tt = (e) => {
1812
1818
  const { paginationStyles: o } = e, t = U("Pagination");
1813
- return /* @__PURE__ */ i("div", { ...o, children: t ? y.createElement(t.component, { ...V(e, ["paginationStyles"]), blockProps: {} }) : /* @__PURE__ */ g(N, { children: [
1819
+ return /* @__PURE__ */ i("div", { ...o, children: t ? b.createElement(t.component, { ...z(e, ["paginationStyles"]), blockProps: {} }) : /* @__PURE__ */ h(N, { children: [
1814
1820
  /* @__PURE__ */ i(
1815
1821
  "button",
1816
1822
  {
@@ -1829,17 +1835,17 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1829
1835
  }, Rt = (e) => {
1830
1836
  const { children: o, tag: t, styles: l, blockProps: r, $loading: n } = e, { pagination: a, inBuilder: s } = e;
1831
1837
  let c = o;
1832
- return v(c) && s && (c = /* @__PURE__ */ i("div", { className: "col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground", children: "Choose a collection to display items" })), t === "none" ? n && s ? Array.from({ length: 2 }).map((m, h) => /* @__PURE__ */ g("div", { className: "animate-pulse rounded-md bg-primary/10 p-5", children: [
1838
+ return w(c) && s && (c = /* @__PURE__ */ i("div", { className: "col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground", children: "Choose a collection to display items" })), t === "none" ? n && s ? Array.from({ length: 2 }).map((y, g) => /* @__PURE__ */ h("div", { className: "animate-pulse rounded-md bg-primary/10 p-5", children: [
1833
1839
  /* @__PURE__ */ i("div", { className: "h-6 w-1/2 rounded-md bg-primary/10" }),
1834
1840
  /* @__PURE__ */ i("div", { className: "mt-2 h-4 w-1/2 rounded-md bg-primary/10" })
1835
- ] }, h)) : c : /* @__PURE__ */ g(N, { children: [
1836
- y.createElement(
1841
+ ] }, g)) : c : /* @__PURE__ */ h(N, { children: [
1842
+ b.createElement(
1837
1843
  t,
1838
1844
  { ...r, ...l },
1839
- n && s ? Array.from({ length: 2 }).map((m, h) => /* @__PURE__ */ g("div", { className: "animate-pulse rounded-md bg-primary/10 p-5", children: [
1845
+ n && s ? Array.from({ length: 2 }).map((y, g) => /* @__PURE__ */ h("div", { className: "animate-pulse rounded-md bg-primary/10 p-5", children: [
1840
1846
  /* @__PURE__ */ i("div", { className: "h-6 w-1/2 rounded-md bg-primary/10" }),
1841
1847
  /* @__PURE__ */ i("div", { className: "mt-2 h-4 w-1/2 rounded-md bg-primary/10" })
1842
- ] }, h)) : c
1848
+ ] }, g)) : c
1843
1849
  ),
1844
1850
  a && /* @__PURE__ */ i(
1845
1851
  Tt,
@@ -1859,7 +1865,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1859
1865
  }, At = {
1860
1866
  type: "Repeater",
1861
1867
  label: "Repeater",
1862
- icon: z,
1868
+ icon: V,
1863
1869
  group: "basic",
1864
1870
  description: "Repeater block is used to display a list of items based on data binding in repeaterItems",
1865
1871
  dataProviderMode: "live",
@@ -1969,15 +1975,15 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1969
1975
  default:
1970
1976
  n = "div";
1971
1977
  }
1972
- return !e && r ? y.createElement(
1978
+ return !e && r ? b.createElement(
1973
1979
  n,
1974
1980
  { ...o, ...t },
1975
1981
  /* @__PURE__ */ i("div", { className: "col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground", children: "Add children to repeater item" })
1976
- ) : y.createElement(n, { ...o, ...t }, e);
1982
+ ) : b.createElement(n, { ...o, ...t }, e);
1977
1983
  }, Mt = {
1978
1984
  type: "RepeaterItem",
1979
1985
  label: "Repeater Item",
1980
- icon: z,
1986
+ icon: V,
1981
1987
  hidden: !0,
1982
1988
  group: "basic",
1983
1989
  ...p({
@@ -1994,7 +2000,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1994
2000
  children: e,
1995
2001
  blockProps: o,
1996
2002
  styles: t
1997
- }) => y.createElement("div", { ...o, ...t }, e), $t = {
2003
+ }) => b.createElement("div", { ...o, ...t }, e), $t = {
1998
2004
  type: "RepeaterEmptyState",
1999
2005
  label: "Empty State",
2000
2006
  hidden: !0,
@@ -2007,7 +2013,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
2007
2013
  canMove: () => !1,
2008
2014
  canDuplicate: () => !1
2009
2015
  }, Zt = () => {
2010
- d(ge, be), d(Me, He), d(fe, he), d(et, tt), d(ht, kt), d(vt, Ct), d(xt, wt), d(ut, mt), d(yt, gt), d(bt, ft), d(Pe, Le), d(dt, pt), d(Nt, _t), d(ke, xe), d(we, ve), d(It, Pt), d(De, ze), d(Ve, Fe), d(Ze, qe), d($e, je), d(Oe, Ye), d(Qe, Je), d(Xe, Ke), d(Ge, We), d(ot, lt), d(Ae, Ee), d(Ce, Ie), d(Be, Se), d(Te, Re), d(Ne, _e), d(Rt, At), d(Et, Mt), d(Ht, $t);
2016
+ d(ge, be), d(Me, He), d(fe, he), d(et, tt), d(ht, kt), d(vt, Ct), d(xt, wt), d(ut, mt), d(yt, gt), d(bt, ft), d(Pe, Le), d(dt, pt), d(Nt, _t), d(ke, xe), d(we, ve), d(It, Pt), d(De, Ve), d(ze, Fe), d(Ze, qe), d($e, je), d(Oe, Ye), d(Qe, Je), d(Xe, Ke), d(Ge, We), d(ot, lt), d(Ae, Ee), d(Ce, Ie), d(Be, Se), d(Te, Re), d(Ne, _e), d(Rt, At), d(Et, Mt), d(Ht, $t);
2011
2017
  };
2012
2018
  export {
2013
2019
  Zt 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": "3.1.28",
8
+ "version": "3.1.30",
9
9
  "type": "module",
10
10
  "repository": {
11
11
  "type": "git",