@chaibuilder/sdk 2.0.0-beta.105 → 2.0.0-beta.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.
- package/dist/core.cjs +10 -5
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1049 -823
- package/dist/sdk.css +1 -6
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +92 -88
- package/package.json +8 -2
package/dist/web-blocks.js
CHANGED
|
@@ -5,13 +5,13 @@ import { createElement as L } from "react";
|
|
|
5
5
|
import { c as C, G as A, g as I } from "./iconBase-DHfFLkem.js";
|
|
6
6
|
import { ButtonIcon as T, CodeIcon as H, HeadingIcon as z, TextIcon as F, CursorTextIcon as j, DividerHorizontalIcon as D, SketchLogoIcon as q, ImageIcon as $, Link1Icon as G, RowsIcon as U, ColumnsIcon as V, SpaceBetweenVerticallyIcon as O, VideoIcon as W, CheckboxIcon as X, InputIcon as E, LetterCaseToggleIcon as Y, RadiobuttonIcon as Z, DropdownMenuIcon as J } from "@radix-ui/react-icons";
|
|
7
7
|
import { isEmpty as w, get as h, isNull as K, pick as Q, omit as ee, map as P } from "lodash-es";
|
|
8
|
-
import { GlobeIcon as te, GroupIcon as le, Columns as oe, Rows as
|
|
9
|
-
const v = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ i("div", { className: C("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,
|
|
10
|
-
const { blockProps: l, inBuilder: t, backgroundImage:
|
|
8
|
+
import { GlobeIcon as te, GroupIcon as le, Columns as oe, Rows as re } from "lucide-react";
|
|
9
|
+
const v = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ i("div", { className: C("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, ne = (e) => {
|
|
10
|
+
const { blockProps: l, inBuilder: t, backgroundImage: r, children: o, tag: n = "div", styles: s } = e;
|
|
11
11
|
let a = o;
|
|
12
12
|
o || (a = /* @__PURE__ */ i(v, { inBuilder: t }));
|
|
13
13
|
let c = {};
|
|
14
|
-
return
|
|
14
|
+
return r && (c = { backgroundImage: `url(${r})` }), f.createElement(n, { ...l, ...s, style: c }, a);
|
|
15
15
|
}, ie = {
|
|
16
16
|
type: "Box",
|
|
17
17
|
label: "Box",
|
|
@@ -54,7 +54,7 @@ const v = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ i("div",
|
|
|
54
54
|
}),
|
|
55
55
|
canAcceptBlock: () => !0
|
|
56
56
|
}, se = (e) => {
|
|
57
|
-
const { blockProps: l, iconSize: t, icon:
|
|
57
|
+
const { blockProps: l, iconSize: t, icon: r, content: o, styles: n, children: s, iconPos: a, link: c, inBuilder: y } = e, g = r, k = s || /* @__PURE__ */ b(R, { children: [
|
|
58
58
|
/* @__PURE__ */ i("span", { "data-ai-key": "content", children: o }),
|
|
59
59
|
g && /* @__PURE__ */ i(
|
|
60
60
|
"div",
|
|
@@ -68,7 +68,7 @@ const v = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ i("div",
|
|
|
68
68
|
"button",
|
|
69
69
|
{
|
|
70
70
|
...l,
|
|
71
|
-
...
|
|
71
|
+
...n,
|
|
72
72
|
type: "button",
|
|
73
73
|
"aria-label": o
|
|
74
74
|
},
|
|
@@ -127,17 +127,17 @@ const v = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ i("div",
|
|
|
127
127
|
i18nProps: ["content"],
|
|
128
128
|
aiProps: ["content"]
|
|
129
129
|
}, ce = (e) => {
|
|
130
|
-
const { blockProps: l, styles: t, htmlCode:
|
|
130
|
+
const { blockProps: l, styles: t, htmlCode: r, inBuilder: o } = e;
|
|
131
131
|
return o ? /* @__PURE__ */ b("div", { className: "relative", children: [
|
|
132
132
|
o ? /* @__PURE__ */ i("div", { ...l, ...t, className: "absolute z-20 h-full w-full" }) : null,
|
|
133
133
|
f.createElement("div", {
|
|
134
134
|
...t,
|
|
135
|
-
dangerouslySetInnerHTML: { __html:
|
|
135
|
+
dangerouslySetInnerHTML: { __html: r.replace(/<script.*?>.*?<\/script>/g, "") }
|
|
136
136
|
})
|
|
137
137
|
] }) : f.createElement("div", {
|
|
138
138
|
...l,
|
|
139
139
|
...t,
|
|
140
|
-
dangerouslySetInnerHTML: { __html:
|
|
140
|
+
dangerouslySetInnerHTML: { __html: r }
|
|
141
141
|
});
|
|
142
142
|
}, pe = {
|
|
143
143
|
type: "CustomHTML",
|
|
@@ -156,9 +156,9 @@ const v = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ i("div",
|
|
|
156
156
|
}
|
|
157
157
|
})
|
|
158
158
|
}, ue = (e) => {
|
|
159
|
-
const { blockProps: l, styles: t, backgroundImage:
|
|
159
|
+
const { blockProps: l, styles: t, backgroundImage: r } = e;
|
|
160
160
|
let o = {};
|
|
161
|
-
return
|
|
161
|
+
return r && (o = { backgroundImage: `url(${r})` }), f.createElement("div", { ...l, ...t, style: o });
|
|
162
162
|
}, de = {
|
|
163
163
|
type: "EmptyBox",
|
|
164
164
|
label: "Empty Box",
|
|
@@ -176,11 +176,11 @@ const v = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ i("div",
|
|
|
176
176
|
}
|
|
177
177
|
})
|
|
178
178
|
}, me = (e) => {
|
|
179
|
-
const { blockProps: l, styles: t, content:
|
|
180
|
-
return
|
|
179
|
+
const { blockProps: l, styles: t, content: r, tag: o = "h1", children: n = null } = e;
|
|
180
|
+
return n ? f.createElement(o, { ...t, ...l }, n) : f.createElement(o, {
|
|
181
181
|
...t,
|
|
182
182
|
...l,
|
|
183
|
-
dangerouslySetInnerHTML: { __html:
|
|
183
|
+
dangerouslySetInnerHTML: { __html: r }
|
|
184
184
|
});
|
|
185
185
|
}, ye = {
|
|
186
186
|
type: "Heading",
|
|
@@ -209,11 +209,11 @@ const v = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ i("div",
|
|
|
209
209
|
i18nProps: ["content"],
|
|
210
210
|
canAcceptBlock: (e) => e === "Span" || e === "Text"
|
|
211
211
|
}, ge = (e) => {
|
|
212
|
-
const { blockProps: l, styles: t, content:
|
|
212
|
+
const { blockProps: l, styles: t, content: r } = e;
|
|
213
213
|
return K(e.children) ? f.createElement("p", {
|
|
214
214
|
...t,
|
|
215
215
|
...l,
|
|
216
|
-
dangerouslySetInnerHTML: { __html:
|
|
216
|
+
dangerouslySetInnerHTML: { __html: r }
|
|
217
217
|
}) : f.createElement("p", { ...t, ...l }, e.children);
|
|
218
218
|
}, fe = {
|
|
219
219
|
type: "Paragraph",
|
|
@@ -241,7 +241,11 @@ const v = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ i("div",
|
|
|
241
241
|
...e,
|
|
242
242
|
className: C(e.className, ...l)
|
|
243
243
|
}), be = (e) => {
|
|
244
|
-
const { blockProps: l, content: t, styles:
|
|
244
|
+
const { blockProps: l, content: t, styles: r } = e, o = _(
|
|
245
|
+
r,
|
|
246
|
+
"prose dark:prose-invert prose-p:m-0 prose-p:min-h-[1rem] prose-blockquote:m-2 prose-blockquote:ml-4 prose-ul:m-0 prose-ol:m-0 prose-li:m-0",
|
|
247
|
+
"max-w-full"
|
|
248
|
+
);
|
|
245
249
|
return /* @__PURE__ */ i("div", { ...l, ...o, dangerouslySetInnerHTML: { __html: t } });
|
|
246
250
|
}, he = {
|
|
247
251
|
type: "RichText",
|
|
@@ -263,11 +267,11 @@ const v = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ i("div",
|
|
|
263
267
|
aiProps: ["content"],
|
|
264
268
|
i18nProps: ["content"]
|
|
265
269
|
}, ke = (e) => {
|
|
266
|
-
const { blockProps: l, styles: t, content:
|
|
267
|
-
return o ? f.createElement("span", { ...t, ...l }, o) : f.createElement(
|
|
270
|
+
const { blockProps: l, styles: t, content: r, children: o = null, tag: n } = e;
|
|
271
|
+
return o ? f.createElement("span", { ...t, ...l }, o) : f.createElement(n || "span", {
|
|
268
272
|
...t,
|
|
269
273
|
...l,
|
|
270
|
-
dangerouslySetInnerHTML: { __html:
|
|
274
|
+
dangerouslySetInnerHTML: { __html: r || "" }
|
|
271
275
|
});
|
|
272
276
|
}, we = {
|
|
273
277
|
type: "Span",
|
|
@@ -293,8 +297,8 @@ function xe(e) {
|
|
|
293
297
|
return A({ 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);
|
|
294
298
|
}
|
|
295
299
|
const Le = (e) => {
|
|
296
|
-
const { scripts: l, inBuilder: t, blockProps:
|
|
297
|
-
return t ? /* @__PURE__ */ i("div", { ...
|
|
300
|
+
const { scripts: l, inBuilder: t, blockProps: r } = e;
|
|
301
|
+
return t ? /* @__PURE__ */ i("div", { ...r, children: /* @__PURE__ */ i("div", { className: C("pointer-events-none flex flex-col items-center justify-center p-2", ""), children: /* @__PURE__ */ i("div", { className: "h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800", children: /* @__PURE__ */ i("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__ */ i("div", { dangerouslySetInnerHTML: { __html: l } });
|
|
298
302
|
}, ve = {
|
|
299
303
|
type: "CustomScript",
|
|
300
304
|
label: "web_blocks.custom_script",
|
|
@@ -327,7 +331,7 @@ const Le = (e) => {
|
|
|
327
331
|
}
|
|
328
332
|
})
|
|
329
333
|
}, Be = (e) => {
|
|
330
|
-
const { blockProps: l, inBuilder: t, children:
|
|
334
|
+
const { blockProps: l, inBuilder: t, children: r, globalBlock: o } = e;
|
|
331
335
|
return t && !o ? /* @__PURE__ */ b(
|
|
332
336
|
"div",
|
|
333
337
|
{
|
|
@@ -341,7 +345,7 @@ const Le = (e) => {
|
|
|
341
345
|
/* @__PURE__ */ i("p", { children: "Choose a block from the sidebar to add it to this page." })
|
|
342
346
|
]
|
|
343
347
|
}
|
|
344
|
-
) : f.createElement("span", { ...l },
|
|
348
|
+
) : f.createElement("span", { ...l }, r);
|
|
345
349
|
}, _e = {
|
|
346
350
|
type: "GlobalBlock",
|
|
347
351
|
label: "Global Block",
|
|
@@ -359,9 +363,9 @@ const Le = (e) => {
|
|
|
359
363
|
}
|
|
360
364
|
})
|
|
361
365
|
}, Pe = (e) => {
|
|
362
|
-
const { blockProps: l, icon: t, styles:
|
|
366
|
+
const { blockProps: l, icon: t, styles: r, width: o, inBuilder: n, height: s } = e, a = _(r, "");
|
|
363
367
|
if (w(t))
|
|
364
|
-
return /* @__PURE__ */ i(v, { inBuilder:
|
|
368
|
+
return /* @__PURE__ */ i(v, { inBuilder: n, className: "h-8 w-14" });
|
|
365
369
|
const c = t.replace(/<svg /g, '<svg class="w-[inherit] h-[inherit]" ');
|
|
366
370
|
return f.createElement("span", {
|
|
367
371
|
...l,
|
|
@@ -400,16 +404,16 @@ const Le = (e) => {
|
|
|
400
404
|
}
|
|
401
405
|
})
|
|
402
406
|
}, Ne = (e) => {
|
|
403
|
-
const { blockProps: l, image: t, mobileImage:
|
|
407
|
+
const { blockProps: l, image: t, mobileImage: r, styles: o, alt: n, height: s, width: a, lazyLoading: c } = e;
|
|
404
408
|
return w(t) ? /* @__PURE__ */ i(v, { className: "h-36" }) : /* @__PURE__ */ b("picture", { children: [
|
|
405
|
-
|
|
409
|
+
r && /* @__PURE__ */ i("source", { srcSet: r, media: "(max-width: 480px)" }),
|
|
406
410
|
/* @__PURE__ */ i(
|
|
407
411
|
"img",
|
|
408
412
|
{
|
|
409
413
|
...l,
|
|
410
414
|
...o,
|
|
411
415
|
src: t,
|
|
412
|
-
alt:
|
|
416
|
+
alt: n,
|
|
413
417
|
loading: c ? "lazy" : "eager",
|
|
414
418
|
width: a,
|
|
415
419
|
height: s
|
|
@@ -465,23 +469,23 @@ const Le = (e) => {
|
|
|
465
469
|
aiProps: ["alt"],
|
|
466
470
|
i18nProps: ["alt"]
|
|
467
471
|
}, Te = (e) => {
|
|
468
|
-
const { blockProps: l, children: t, styles:
|
|
469
|
-
if (!t && w(
|
|
472
|
+
const { blockProps: l, children: t, styles: r, inBuilder: o, content: n, href: s } = e, { hrefType: a, autoplay: c, maxWidth: y, backdropColor: g, galleryName: k } = e, p = _(r, "cb-lightbox vbox-item");
|
|
473
|
+
if (!t && w(r == null ? void 0 : r.className) && w(n))
|
|
470
474
|
return /* @__PURE__ */ i(v, { inBuilder: o });
|
|
471
475
|
if (o)
|
|
472
476
|
return t ? /* @__PURE__ */ i("span", { ...l, ...p, children: t }) : L("span", {
|
|
473
477
|
...l,
|
|
474
478
|
...p,
|
|
475
|
-
dangerouslySetInnerHTML: { __html:
|
|
479
|
+
dangerouslySetInnerHTML: { __html: n }
|
|
476
480
|
});
|
|
477
481
|
const x = {};
|
|
478
|
-
return a !== "image" && (x["data-vbtype"] = a), c && (x["data-autoplay"] = "true"), y && (x["data-maxwidth"] = y + "px"), g && (x["data-overlay"] = g), k && (x["data-gall"] = k), t ? /* @__PURE__ */ i("a", { "aria-label":
|
|
482
|
+
return a !== "image" && (x["data-vbtype"] = a), c && (x["data-autoplay"] = "true"), y && (x["data-maxwidth"] = y + "px"), g && (x["data-overlay"] = g), k && (x["data-gall"] = k), t ? /* @__PURE__ */ i("a", { "aria-label": n, ...x, href: s || "#/", ...l, ...p, children: t }) : L("a", {
|
|
479
483
|
...l,
|
|
480
484
|
...p,
|
|
481
485
|
...x,
|
|
482
486
|
href: s || "#",
|
|
483
|
-
dangerouslySetInnerHTML: { __html:
|
|
484
|
-
"aria-label":
|
|
487
|
+
dangerouslySetInnerHTML: { __html: n },
|
|
488
|
+
"aria-label": n
|
|
485
489
|
});
|
|
486
490
|
}, $e = {
|
|
487
491
|
type: "LightBoxLink",
|
|
@@ -538,9 +542,9 @@ const Le = (e) => {
|
|
|
538
542
|
aiProps: ["content"],
|
|
539
543
|
canAcceptBlock: (e) => e !== "Link" && e !== "LightBoxLink"
|
|
540
544
|
}, Ee = (e) => {
|
|
541
|
-
const { blockProps: l, link: t, children:
|
|
545
|
+
const { blockProps: l, link: t, children: r, styles: o, inBuilder: n, content: s } = e;
|
|
542
546
|
let a = {};
|
|
543
|
-
return !
|
|
547
|
+
return !r && w(s) && (a = { minHeight: "50px", display: "flex", alignItems: "center", justifyContent: "center" }), n ? r ? /* @__PURE__ */ i("span", { ...l, style: a, ...o, children: r }) : L(
|
|
544
548
|
"span",
|
|
545
549
|
{
|
|
546
550
|
...l,
|
|
@@ -548,7 +552,7 @@ const Le = (e) => {
|
|
|
548
552
|
style: a
|
|
549
553
|
},
|
|
550
554
|
s
|
|
551
|
-
) :
|
|
555
|
+
) : r ? /* @__PURE__ */ i("a", { "aria-label": s, href: (t == null ? void 0 : t.href) || "#/", target: t == null ? void 0 : t.target, ...l, ...o, children: r }) : L(
|
|
552
556
|
"a",
|
|
553
557
|
{
|
|
554
558
|
...l,
|
|
@@ -595,9 +599,9 @@ const Le = (e) => {
|
|
|
595
599
|
i18nProps: ["content"],
|
|
596
600
|
canAcceptBlock: (e) => e !== "Link"
|
|
597
601
|
}, Ae = (e) => {
|
|
598
|
-
const { blockProps: l, children: t, listType:
|
|
602
|
+
const { blockProps: l, children: t, listType: r, styles: o, tag: n, inBuilder: s } = e, a = C(h(o, "className", ""), r);
|
|
599
603
|
return !t && w(o == null ? void 0 : o.className) ? /* @__PURE__ */ i(v, { inBuilder: s }) : f.createElement(
|
|
600
|
-
|
|
604
|
+
n || (r === "list-decimal" ? "ol" : "ul"),
|
|
601
605
|
{ ...l, ...o, className: a },
|
|
602
606
|
t
|
|
603
607
|
);
|
|
@@ -648,9 +652,9 @@ const Le = (e) => {
|
|
|
648
652
|
}
|
|
649
653
|
]
|
|
650
654
|
}, ze = (e) => {
|
|
651
|
-
const { blockProps: l, content: t, styles:
|
|
652
|
-
return o ? f.createElement(
|
|
653
|
-
...
|
|
655
|
+
const { blockProps: l, content: t, styles: r, children: o, tag: n } = e;
|
|
656
|
+
return o ? f.createElement(n || "li", { ...r, ...l }, o) : f.createElement(n || "li", {
|
|
657
|
+
...r,
|
|
654
658
|
...l,
|
|
655
659
|
dangerouslySetInnerHTML: { __html: t }
|
|
656
660
|
});
|
|
@@ -710,13 +714,13 @@ const Le = (e) => {
|
|
|
710
714
|
}
|
|
711
715
|
return null;
|
|
712
716
|
}, Ge = f.memo((e) => {
|
|
713
|
-
const { blockProps: l, inBuilder: t, styles:
|
|
717
|
+
const { blockProps: l, inBuilder: t, styles: r, url: o, controls: n } = e, s = h(n, "autoPlay", !1), a = h(n, "controls", !1), c = s || h(n, "muted", !0), y = h(n, "loop", !1);
|
|
714
718
|
if (w(o)) return /* @__PURE__ */ i(v, { inBuilder: t, className: "h-36" });
|
|
715
719
|
let g = qe(o), k = null;
|
|
716
720
|
if (g) {
|
|
717
721
|
if (!w(g)) {
|
|
718
722
|
const p = [];
|
|
719
|
-
p.push(`autoplay=${s ? 1 : 0}`), p.push(`controls=${
|
|
723
|
+
p.push(`autoplay=${s ? 1 : 0}`), p.push(`controls=${n ? 1 : 0}`), p.push(`mute=${c ? 1 : 0}&muted=${c ? 1 : 0}`), p.push(`loop=${y ? 1 : 0}`), g = `${g}?${p.join("&")}`;
|
|
720
724
|
}
|
|
721
725
|
k = f.createElement("iframe", {
|
|
722
726
|
...l,
|
|
@@ -736,8 +740,8 @@ const Le = (e) => {
|
|
|
736
740
|
autoPlay: t ? !1 : s,
|
|
737
741
|
loop: y
|
|
738
742
|
});
|
|
739
|
-
return /* @__PURE__ */ i("div", { ...Q(
|
|
740
|
-
t ? /* @__PURE__ */ i("div", { ...l, ...ee(
|
|
743
|
+
return /* @__PURE__ */ i("div", { ...Q(r, ["className"]), children: /* @__PURE__ */ b("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
|
|
744
|
+
t ? /* @__PURE__ */ i("div", { ...l, ...ee(r, ["className"]), className: "absolute inset-0 z-20 h-full w-full" }) : null,
|
|
741
745
|
k
|
|
742
746
|
] }) });
|
|
743
747
|
}), Ue = {
|
|
@@ -790,12 +794,12 @@ const Le = (e) => {
|
|
|
790
794
|
}),
|
|
791
795
|
i18nProps: ["url"]
|
|
792
796
|
}, Ve = (e) => {
|
|
793
|
-
const { blockProps: l, fieldName: t, label:
|
|
797
|
+
const { blockProps: l, fieldName: t, label: r, styles: o, inputStyles: n, required: s, checked: a, showLabel: c = !0 } = e, y = I();
|
|
794
798
|
return c ? /* @__PURE__ */ b("div", { ...o, ...l, children: [
|
|
795
799
|
/* @__PURE__ */ i(
|
|
796
800
|
"input",
|
|
797
801
|
{
|
|
798
|
-
...
|
|
802
|
+
...n,
|
|
799
803
|
name: t,
|
|
800
804
|
id: y,
|
|
801
805
|
type: "checkbox",
|
|
@@ -803,13 +807,13 @@ const Le = (e) => {
|
|
|
803
807
|
defaultChecked: a
|
|
804
808
|
}
|
|
805
809
|
),
|
|
806
|
-
|
|
810
|
+
r && /* @__PURE__ */ i("label", { htmlFor: y, children: r })
|
|
807
811
|
] }) : /* @__PURE__ */ i(
|
|
808
812
|
"input",
|
|
809
813
|
{
|
|
810
814
|
id: y,
|
|
811
815
|
...l,
|
|
812
|
-
...
|
|
816
|
+
...n,
|
|
813
817
|
...o,
|
|
814
818
|
type: "checkbox",
|
|
815
819
|
required: s,
|
|
@@ -856,7 +860,7 @@ const Le = (e) => {
|
|
|
856
860
|
aiProps: ["label"],
|
|
857
861
|
i18nProps: ["label"]
|
|
858
862
|
}, We = (e) => {
|
|
859
|
-
const { children: l, blockProps: t, errorMessage:
|
|
863
|
+
const { children: l, blockProps: t, errorMessage: r, successMessage: o, action: n, styles: s, inBuilder: a } = e;
|
|
860
864
|
let c = l;
|
|
861
865
|
return l || (c = /* @__PURE__ */ i(v, { inBuilder: a })), /* @__PURE__ */ b(
|
|
862
866
|
"form",
|
|
@@ -865,10 +869,10 @@ const Le = (e) => {
|
|
|
865
869
|
"x-data": "{}",
|
|
866
870
|
"x-on:submit.prevent": "post"
|
|
867
871
|
},
|
|
868
|
-
"data-error":
|
|
872
|
+
"data-error": r,
|
|
869
873
|
"data-success": o,
|
|
870
874
|
method: "post",
|
|
871
|
-
action:
|
|
875
|
+
action: n,
|
|
872
876
|
...t,
|
|
873
877
|
...s,
|
|
874
878
|
children: [
|
|
@@ -922,7 +926,7 @@ const Le = (e) => {
|
|
|
922
926
|
aiProps: ["errorMessage", "successMessage"],
|
|
923
927
|
canAcceptBlock: () => !0
|
|
924
928
|
}, Ye = (e) => {
|
|
925
|
-
const { blockProps: l, inBuilder: t, label:
|
|
929
|
+
const { blockProps: l, inBuilder: t, label: r, styles: o, inputStyles: n, icon: s, iconSize: a, iconPos: c } = e, y = I();
|
|
926
930
|
return /* @__PURE__ */ b(
|
|
927
931
|
"button",
|
|
928
932
|
{
|
|
@@ -930,13 +934,13 @@ const Le = (e) => {
|
|
|
930
934
|
...{
|
|
931
935
|
"x-bind:disabled": "formLoading"
|
|
932
936
|
},
|
|
933
|
-
...
|
|
937
|
+
...n,
|
|
934
938
|
...o,
|
|
935
939
|
...l || {},
|
|
936
940
|
type: t ? "button" : "submit",
|
|
937
|
-
"aria-label":
|
|
941
|
+
"aria-label": r,
|
|
938
942
|
children: [
|
|
939
|
-
|
|
943
|
+
r,
|
|
940
944
|
s && /* @__PURE__ */ i(
|
|
941
945
|
"div",
|
|
942
946
|
{
|
|
@@ -989,9 +993,9 @@ const Le = (e) => {
|
|
|
989
993
|
i18nProps: ["label"],
|
|
990
994
|
aiProps: ["label"]
|
|
991
995
|
}, Je = (e) => {
|
|
992
|
-
const { blockProps: l, fieldName: t, label:
|
|
993
|
-
return a ? /* @__PURE__ */ b("div", { ...
|
|
994
|
-
a && /* @__PURE__ */ i("label", { htmlFor: g, children:
|
|
996
|
+
const { blockProps: l, fieldName: t, label: r, placeholder: o, styles: n, inputStyles: s, showLabel: a, required: c, inputType: y } = e, g = I();
|
|
997
|
+
return a ? /* @__PURE__ */ b("div", { ...n, ...l, children: [
|
|
998
|
+
a && /* @__PURE__ */ i("label", { htmlFor: g, children: r }),
|
|
995
999
|
/* @__PURE__ */ i(
|
|
996
1000
|
"input",
|
|
997
1001
|
{
|
|
@@ -1010,7 +1014,7 @@ const Le = (e) => {
|
|
|
1010
1014
|
name: t,
|
|
1011
1015
|
...l,
|
|
1012
1016
|
...s,
|
|
1013
|
-
...
|
|
1017
|
+
...n,
|
|
1014
1018
|
type: y,
|
|
1015
1019
|
placeholder: o,
|
|
1016
1020
|
required: c
|
|
@@ -1077,9 +1081,9 @@ const Le = (e) => {
|
|
|
1077
1081
|
aiProps: ["label", "placeholder"],
|
|
1078
1082
|
i18nProps: ["label", "placeholder"]
|
|
1079
1083
|
}, Qe = (e) => {
|
|
1080
|
-
const { blockProps: l, content: t, styles:
|
|
1081
|
-
return o ? f.createElement("label",
|
|
1082
|
-
...
|
|
1084
|
+
const { blockProps: l, content: t, styles: r, children: o } = e, n = { ...r, ...l };
|
|
1085
|
+
return o ? f.createElement("label", n, o) : f.createElement("label", {
|
|
1086
|
+
...n,
|
|
1083
1087
|
dangerouslySetInnerHTML: { __html: t }
|
|
1084
1088
|
});
|
|
1085
1089
|
}, et = {
|
|
@@ -1101,16 +1105,16 @@ const Le = (e) => {
|
|
|
1101
1105
|
aiProps: ["content"],
|
|
1102
1106
|
i18nProps: ["content"]
|
|
1103
1107
|
}, tt = (e) => {
|
|
1104
|
-
const { blockProps: l, fieldName: t, label:
|
|
1108
|
+
const { blockProps: l, fieldName: t, label: r, styles: o, inputStyles: n, required: s, checked: a, showLabel: c = !0 } = e, y = I();
|
|
1105
1109
|
return c ? /* @__PURE__ */ b("div", { ...o, ...l, children: [
|
|
1106
|
-
/* @__PURE__ */ i("input", { ...
|
|
1107
|
-
|
|
1110
|
+
/* @__PURE__ */ i("input", { ...n, name: t, id: y, type: "radio", required: s, defaultChecked: a }),
|
|
1111
|
+
r && /* @__PURE__ */ i("label", { htmlFor: y, children: r })
|
|
1108
1112
|
] }) : /* @__PURE__ */ i(
|
|
1109
1113
|
"input",
|
|
1110
1114
|
{
|
|
1111
1115
|
id: y,
|
|
1112
1116
|
...l,
|
|
1113
|
-
...
|
|
1117
|
+
...n,
|
|
1114
1118
|
...o,
|
|
1115
1119
|
type: "radio",
|
|
1116
1120
|
required: s,
|
|
@@ -1158,18 +1162,18 @@ const Le = (e) => {
|
|
|
1158
1162
|
aiProps: ["label"],
|
|
1159
1163
|
i18nProps: ["label"]
|
|
1160
1164
|
}, ot = (e) => {
|
|
1161
|
-
const { blockProps: l, fieldName: t, label:
|
|
1162
|
-
return c ? /* @__PURE__ */ b("div", { ...
|
|
1163
|
-
c && /* @__PURE__ */ i("label", { htmlFor: k, children:
|
|
1165
|
+
const { blockProps: l, fieldName: t, label: r, placeholder: o, styles: n, inputStyles: s, required: a, showLabel: c, _multiple: y, options: g } = e, k = I();
|
|
1166
|
+
return c ? /* @__PURE__ */ b("div", { ...n, ...l, children: [
|
|
1167
|
+
c && /* @__PURE__ */ i("label", { htmlFor: k, children: r }),
|
|
1164
1168
|
/* @__PURE__ */ b("select", { ...s, id: k, required: a, multiple: y, name: t, children: [
|
|
1165
1169
|
/* @__PURE__ */ i("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: o }),
|
|
1166
1170
|
P(g, (p) => /* @__PURE__ */ i("option", { value: p == null ? void 0 : p.value, children: p == null ? void 0 : p.label }, p == null ? void 0 : p.value))
|
|
1167
1171
|
] })
|
|
1168
|
-
] }) : /* @__PURE__ */ b("select", { id: k, ...
|
|
1172
|
+
] }) : /* @__PURE__ */ b("select", { id: k, ...n, ...l, required: a, multiple: y, name: t, children: [
|
|
1169
1173
|
/* @__PURE__ */ i("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: o }),
|
|
1170
1174
|
P(g, (p) => /* @__PURE__ */ i("option", { value: p == null ? void 0 : p.value, children: p == null ? void 0 : p.label }, p == null ? void 0 : p.value))
|
|
1171
1175
|
] });
|
|
1172
|
-
},
|
|
1176
|
+
}, rt = {
|
|
1173
1177
|
type: "Select",
|
|
1174
1178
|
label: "web_blocks.select",
|
|
1175
1179
|
category: "core",
|
|
@@ -1233,10 +1237,10 @@ const Le = (e) => {
|
|
|
1233
1237
|
}),
|
|
1234
1238
|
aiProps: ["label", "placeholder"],
|
|
1235
1239
|
i18nProps: ["label", "placeholder"]
|
|
1236
|
-
},
|
|
1237
|
-
const { blockProps: l, fieldName: t, label:
|
|
1238
|
-
return c ? /* @__PURE__ */ b("div", { ...
|
|
1239
|
-
c && /* @__PURE__ */ i("label", { htmlFor: y, children:
|
|
1240
|
+
}, nt = (e) => {
|
|
1241
|
+
const { blockProps: l, fieldName: t, label: r, placeholder: o, styles: n, inputStyles: s, _rows: a, showLabel: c } = e, y = I();
|
|
1242
|
+
return c ? /* @__PURE__ */ b("div", { ...n, ...l, children: [
|
|
1243
|
+
c && /* @__PURE__ */ i("label", { htmlFor: y, children: r }),
|
|
1240
1244
|
/* @__PURE__ */ i("textarea", { name: t, ...s, id: y, placeholder: o, rows: a })
|
|
1241
1245
|
] }) : /* @__PURE__ */ i(
|
|
1242
1246
|
"textarea",
|
|
@@ -1245,7 +1249,7 @@ const Le = (e) => {
|
|
|
1245
1249
|
name: t,
|
|
1246
1250
|
...l,
|
|
1247
1251
|
...s,
|
|
1248
|
-
...
|
|
1252
|
+
...n,
|
|
1249
1253
|
placeholder: o,
|
|
1250
1254
|
rows: a
|
|
1251
1255
|
}
|
|
@@ -1352,13 +1356,13 @@ const Le = (e) => {
|
|
|
1352
1356
|
12: "lg:col-span-12"
|
|
1353
1357
|
}
|
|
1354
1358
|
}, ct = (e) => {
|
|
1355
|
-
const { blockProps: l, children: t, styles:
|
|
1356
|
-
h(
|
|
1359
|
+
const { blockProps: l, children: t, styles: r, colSpan: o, tabletColSpan: n, desktopColSpan: s } = e, c = { className: [
|
|
1360
|
+
h(r, "className", ""),
|
|
1357
1361
|
h(B, ["SMALL", isNaN(o) || !o ? 6 : o], ""),
|
|
1358
|
-
|
|
1359
|
-
s ? h(B, ["LARGE",
|
|
1362
|
+
n ? h(B, ["MEDIUM", n || o], "") : "",
|
|
1363
|
+
s ? h(B, ["LARGE", n || o], "") : ""
|
|
1360
1364
|
].join(" ") };
|
|
1361
|
-
return /* @__PURE__ */ i("div", { ...l, ...
|
|
1365
|
+
return /* @__PURE__ */ i("div", { ...l, ...r, ...c, children: t || /* @__PURE__ */ i("div", { className: "h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900" }) });
|
|
1362
1366
|
}, pt = {
|
|
1363
1367
|
type: "Column",
|
|
1364
1368
|
label: "Column",
|
|
@@ -1395,13 +1399,13 @@ const Le = (e) => {
|
|
|
1395
1399
|
}
|
|
1396
1400
|
})
|
|
1397
1401
|
}, ut = (e) => {
|
|
1398
|
-
const { blockProps: l, children: t, styles:
|
|
1399
|
-
return typeof (
|
|
1402
|
+
const { blockProps: l, children: t, styles: r, gutter: o } = e, s = { className: [h(r, "className", ""), " grid grid-cols-12"].join() };
|
|
1403
|
+
return typeof (r == null ? void 0 : r.style) == "object" ? r.style.gap = `${o}px` : s.style = { gap: `${o}px` }, /* @__PURE__ */ i("div", { ...l, ...r, ...s, children: t });
|
|
1400
1404
|
}, dt = {
|
|
1401
1405
|
type: "Row",
|
|
1402
1406
|
label: "Row",
|
|
1403
1407
|
group: "basic",
|
|
1404
|
-
icon:
|
|
1408
|
+
icon: re,
|
|
1405
1409
|
blocks: () => [
|
|
1406
1410
|
{ _type: "Row", _id: "row", styles: "#styles:,p-1" },
|
|
1407
1411
|
{ _type: "Column", id: "column", _parent: "row", styles: "#styles:," },
|
|
@@ -1428,7 +1432,7 @@ const Le = (e) => {
|
|
|
1428
1432
|
}
|
|
1429
1433
|
})
|
|
1430
1434
|
}, wt = () => {
|
|
1431
|
-
d(
|
|
1435
|
+
d(ne, ie), d(ue, de), d(se, ae), d(me, ye), d(ge, fe), d(ke, we), d(be, he), d(Ee, Re), d(Te, $e), d(Ae, He), d(ze, Fe), d(Pe, Se), d(Ne, Me), d(Ge, Ue), d(ce, pe), d(Le, ve), d(je, De), d(We, Xe), d(Ye, Ze), d(Je, Ke), d(Ve, Oe), d(tt, lt), d(ot, rt), d(nt, it), d(Qe, et), d(st, at), d(Ie, Ce), d(Be, _e), d(ut, dt), d(ct, pt);
|
|
1432
1436
|
};
|
|
1433
1437
|
export {
|
|
1434
1438
|
wt 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": "2.0.0-beta.
|
|
8
|
+
"version": "2.0.0-beta.107",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -102,6 +102,13 @@
|
|
|
102
102
|
"@tailwindcss/forms": "^0.5.10",
|
|
103
103
|
"@tailwindcss/line-clamp": "^0.4.4",
|
|
104
104
|
"@tailwindcss/typography": "^0.5.16",
|
|
105
|
+
"@tiptap/extension-bubble-menu": "^2.11.5",
|
|
106
|
+
"@tiptap/extension-link": "^2.11.5",
|
|
107
|
+
"@tiptap/extension-text-align": "^2.11.5",
|
|
108
|
+
"@tiptap/extension-underline": "^2.11.5",
|
|
109
|
+
"@tiptap/pm": "^2.11.5",
|
|
110
|
+
"@tiptap/react": "^2.11.5",
|
|
111
|
+
"@tiptap/starter-kit": "^2.11.5",
|
|
105
112
|
"class-variance-authority": "0.6.1",
|
|
106
113
|
"clsx": "2.1.1",
|
|
107
114
|
"cmdk": "0.2.0",
|
|
@@ -125,7 +132,6 @@
|
|
|
125
132
|
"react-icons": "5.4.0",
|
|
126
133
|
"react-icons-picker": "^1.0.9",
|
|
127
134
|
"react-json-view-lite": "^2.3.0",
|
|
128
|
-
"react-quill": "^2.0.0",
|
|
129
135
|
"react-wrap-balancer": "^1.1.1",
|
|
130
136
|
"sonner": "^2.0.1",
|
|
131
137
|
"tailwind-merge": "^2.6.0",
|