@chaibuilder/sdk 1.2.76 → 1.2.78
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/{CodeEditor-QaDlSeLr.js → CodeEditor-GsTOzMVg.js} +5 -4
- package/dist/CodeEditor-jefVJM0J.cjs +1 -0
- package/dist/STRINGS-TDN5UhWi.js +7 -0
- package/dist/STRINGS-Yl7cSWDc.cjs +1 -0
- package/dist/{Topbar-wHQxajBp.js → Topbar-Nc6eEWWP.js} +5 -4
- package/dist/Topbar-XyIs0-bw.cjs +1 -0
- package/dist/UnsplashImages-CXv1GzLl.cjs +1 -0
- package/dist/{UnsplashImages-fsj0Hn0B.js → UnsplashImages-SUnc-2ZG.js} +5 -4
- package/dist/UploadImages-h-IZsdZq.cjs +1 -0
- package/dist/{UploadImages-lDHrM-Jw.js → UploadImages-iewW_N13.js} +14 -13
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +26 -3
- package/dist/core.js +70 -66
- package/dist/{index-qHOh12Rg.js → index-5TMff_bN.js} +694 -755
- package/dist/index-QtgjVIUR.cjs +223 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +111 -112
- package/package.json +3 -2
- package/dist/CodeEditor-Z7_R7BRg.cjs +0 -1
- package/dist/STRINGS-hZpwIZMT.cjs +0 -1
- package/dist/STRINGS-rPGH65PW.js +0 -8
- package/dist/Topbar-DAK9vNL3.cjs +0 -1
- package/dist/UnsplashImages-4uUS8SMq.cjs +0 -1
- package/dist/UploadImages-lnaTQHCD.cjs +0 -1
- package/dist/index-VVV4PtIa.cjs +0 -223
package/dist/web-blocks.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { registerChaiBlock as u } from "@chaibuilder/runtime";
|
|
2
2
|
import { j as a } from "./jsx-runtime-Sp0orL4X.js";
|
|
3
3
|
import * as m from "react";
|
|
4
|
-
import { c as
|
|
4
|
+
import { c as j, o as p, f as v, v as C, b, T as N, y as B, u as T, r as L, d as S, q as D, e as k, h as F, G as O, g as I, S as U } from "./iconBase-zweRWSz0.js";
|
|
5
5
|
import "i18next";
|
|
6
|
-
import { ButtonIcon as H, CodeIcon as V, HeadingIcon as G, TextIcon as W, CursorTextIcon as X, Link1Icon as Y, ImageIcon as
|
|
7
|
-
import { isNull as ne, isEmpty as g, get as x, pick as
|
|
6
|
+
import { ButtonIcon as H, CodeIcon as V, HeadingIcon as G, TextIcon as W, CursorTextIcon as X, Link1Icon as Y, ImageIcon as z, RowsIcon as Z, ColumnsIcon as J, SketchLogoIcon as K, VideoIcon as Q, DividerHorizontalIcon as ee, MoonIcon as te, SpaceBetweenVerticallyIcon as q, GroupIcon as le, InputIcon as A, RadiobuttonIcon as oe, DropdownMenuIcon as se, CheckboxIcon as ae } from "@radix-ui/react-icons";
|
|
7
|
+
import { isNull as ne, isEmpty as g, get as x, pick as re, omit as ce, map as M } from "lodash-es";
|
|
8
8
|
import "clsx";
|
|
9
9
|
import "tailwind-merge";
|
|
10
|
-
const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("div", { className:
|
|
11
|
-
const { blockProps: l, inBuilder: t, backgroundImage: s, children: o, tag: n = "div", styles:
|
|
10
|
+
const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("div", { className: j("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ a.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ a.jsx("div", { className: "flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700" }) }) }) : null, _ = ie, de = (e) => {
|
|
11
|
+
const { blockProps: l, inBuilder: t, backgroundImage: s, children: o, tag: n = "div", styles: r } = e;
|
|
12
12
|
let i = o;
|
|
13
13
|
o || (i = /* @__PURE__ */ a.jsx(_, { inBuilder: t }));
|
|
14
|
-
let
|
|
15
|
-
return s && (
|
|
14
|
+
let c = {};
|
|
15
|
+
return s && (c = { backgroundImage: `url(${s})` }), m.createElement(n, { ...l, ...r, style: c }, i);
|
|
16
16
|
}, ue = {
|
|
17
17
|
type: "Box",
|
|
18
18
|
label: "web_blocks.box",
|
|
@@ -43,18 +43,18 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
43
43
|
{ value: "mark", title: "web_blocks.mark" }
|
|
44
44
|
]
|
|
45
45
|
}),
|
|
46
|
-
backgroundImage:
|
|
46
|
+
backgroundImage: C({ title: "web_blocks.background_image" })
|
|
47
47
|
},
|
|
48
48
|
canAcceptBlock: () => !0
|
|
49
49
|
}, be = (e) => {
|
|
50
|
-
const { blockProps: l, iconSize: t, icon: s, content: o, iconPos: n, styles:
|
|
50
|
+
const { blockProps: l, iconSize: t, icon: s, content: o, iconPos: n, styles: r, children: i } = e, c = s, d = i || /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
51
51
|
/* @__PURE__ */ a.jsx("span", { "data-ai-key": "content", children: o }),
|
|
52
|
-
|
|
52
|
+
c && /* @__PURE__ */ a.jsx(
|
|
53
53
|
"div",
|
|
54
54
|
{
|
|
55
55
|
style: { width: t + "px" },
|
|
56
56
|
className: n + " " + (n === "order-first" ? "mr-2" : "ml-2") || "",
|
|
57
|
-
dangerouslySetInnerHTML: { __html:
|
|
57
|
+
dangerouslySetInnerHTML: { __html: c }
|
|
58
58
|
}
|
|
59
59
|
)
|
|
60
60
|
] });
|
|
@@ -62,7 +62,7 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
62
62
|
"button",
|
|
63
63
|
{
|
|
64
64
|
...l,
|
|
65
|
-
...
|
|
65
|
+
...r,
|
|
66
66
|
type: "button"
|
|
67
67
|
},
|
|
68
68
|
d
|
|
@@ -76,7 +76,7 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
76
76
|
props: {
|
|
77
77
|
content: b({ title: "web_blocks.label", default: "Button" }),
|
|
78
78
|
styles: p({ default: "text-white bg-primary px-4 py-2 rounded-global flex items-center" }),
|
|
79
|
-
icon:
|
|
79
|
+
icon: N({ title: "web_blocks.icon", default: "" }),
|
|
80
80
|
iconSize: B({ title: "web_blocks.icon_size", default: 24 }),
|
|
81
81
|
iconPos: v({
|
|
82
82
|
title: "web_blocks.icon_position",
|
|
@@ -108,13 +108,12 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
108
108
|
group: "advanced",
|
|
109
109
|
props: {
|
|
110
110
|
styles: p({ default: "" }),
|
|
111
|
-
htmlCode:
|
|
111
|
+
htmlCode: T({
|
|
112
112
|
title: "web_blocks.html_code",
|
|
113
113
|
default: "<div><p>Enter your HTML code here...</p></div>",
|
|
114
114
|
placeholder: "web_blocks.placeholder"
|
|
115
115
|
})
|
|
116
|
-
}
|
|
117
|
-
canAcceptBlock: () => !1
|
|
116
|
+
}
|
|
118
117
|
}, he = m.memo(
|
|
119
118
|
(e) => {
|
|
120
119
|
const { blockProps: l, styles: t } = e;
|
|
@@ -126,7 +125,8 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
126
125
|
category: "core",
|
|
127
126
|
group: "basic",
|
|
128
127
|
props: {
|
|
129
|
-
styles: p({ default: "" })
|
|
128
|
+
styles: p({ default: "" }),
|
|
129
|
+
backgroundImage: C({ title: "web_blocks.background_image" })
|
|
130
130
|
}
|
|
131
131
|
}, ye = (e) => {
|
|
132
132
|
const { blockProps: l, styles: t, content: s, level: o = "h1", children: n = null } = e;
|
|
@@ -158,7 +158,7 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
158
158
|
]
|
|
159
159
|
}),
|
|
160
160
|
styles: p({ default: "text-3xl" }),
|
|
161
|
-
content:
|
|
161
|
+
content: L({ title: "web_blocks.content", default: "Heading goes here" })
|
|
162
162
|
},
|
|
163
163
|
canAcceptBlock: (e) => e === "Span" || e === "Text"
|
|
164
164
|
}, _e = (e) => {
|
|
@@ -178,7 +178,7 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
178
178
|
group: "typography",
|
|
179
179
|
props: {
|
|
180
180
|
styles: p({ default: "" }),
|
|
181
|
-
content:
|
|
181
|
+
content: L({
|
|
182
182
|
title: "web_blocks.content",
|
|
183
183
|
default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere."
|
|
184
184
|
})
|
|
@@ -199,7 +199,7 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
199
199
|
group: "typography",
|
|
200
200
|
props: {
|
|
201
201
|
styles: p({ default: "" }),
|
|
202
|
-
content:
|
|
202
|
+
content: L({ title: "web_blocks.content", default: "" })
|
|
203
203
|
},
|
|
204
204
|
canAcceptBlock: () => !0
|
|
205
205
|
}, Ie = (e) => {
|
|
@@ -222,24 +222,24 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
222
222
|
group: "typography",
|
|
223
223
|
props: {
|
|
224
224
|
styles: p({ default: "" }),
|
|
225
|
-
content:
|
|
225
|
+
content: S({
|
|
226
226
|
title: "web_blocks.content",
|
|
227
227
|
default: "<p>This is a rich text block. You can add text, and other content here.</p>"
|
|
228
228
|
})
|
|
229
229
|
}
|
|
230
230
|
}, je = (e) => {
|
|
231
|
-
const { blockProps: l, link: t, children: s, styles: o, inBuilder: n, content:
|
|
232
|
-
return !s && g(o == null ? void 0 : o.className) && g(
|
|
231
|
+
const { blockProps: l, link: t, children: s, styles: o, inBuilder: n, content: r } = e;
|
|
232
|
+
return !s && g(o == null ? void 0 : o.className) && g(r) ? /* @__PURE__ */ a.jsx(_, { inBuilder: n }) : n ? s ? /* @__PURE__ */ a.jsx("span", { ...l, ...o, children: s }) : m.createElement("span", {
|
|
233
233
|
...l,
|
|
234
234
|
...o,
|
|
235
|
-
dangerouslySetInnerHTML: { __html:
|
|
235
|
+
dangerouslySetInnerHTML: { __html: r }
|
|
236
236
|
}) : s ? /* @__PURE__ */ a.jsx("a", { href: (t == null ? void 0 : t.href) || "#/", target: t == null ? void 0 : t.target, ...l, ...o, children: s }) : m.createElement("a", {
|
|
237
237
|
...l,
|
|
238
238
|
...o,
|
|
239
239
|
"data-ai-key": "content",
|
|
240
240
|
href: (t == null ? void 0 : t.href) || "#",
|
|
241
241
|
target: (t == null ? void 0 : t.target) || "_self",
|
|
242
|
-
dangerouslySetInnerHTML: { __html:
|
|
242
|
+
dangerouslySetInnerHTML: { __html: r }
|
|
243
243
|
});
|
|
244
244
|
}, Le = {
|
|
245
245
|
type: "Link",
|
|
@@ -258,9 +258,9 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
258
258
|
canAcceptBlock: (e) => e !== "Link"
|
|
259
259
|
}, R = (e, ...l) => ({
|
|
260
260
|
...e,
|
|
261
|
-
className:
|
|
261
|
+
className: j(e.className, ...l)
|
|
262
262
|
}), Ce = (e) => {
|
|
263
|
-
const { blockProps: l, children: t, styles: s, inBuilder: o, content: n, href:
|
|
263
|
+
const { blockProps: l, children: t, styles: s, inBuilder: o, content: n, href: r } = e, { hrefType: i, autoplay: c, maxWidth: d, backdropColor: h, galleryName: f } = e, y = R(s, "cb-lightbox");
|
|
264
264
|
if (!t && g(s == null ? void 0 : s.className) && g(n))
|
|
265
265
|
return /* @__PURE__ */ a.jsx(_, { inBuilder: o });
|
|
266
266
|
if (o)
|
|
@@ -270,18 +270,18 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
270
270
|
dangerouslySetInnerHTML: { __html: n }
|
|
271
271
|
});
|
|
272
272
|
const w = {};
|
|
273
|
-
return w["data-vbtype"] = i,
|
|
273
|
+
return w["data-vbtype"] = i, c && (w["data-autoplay"] = "true"), d && (w["data-maxwidth"] = d + "px"), h && (w["data-overlay"] = h), f && (w["data-gall"] = f), t ? /* @__PURE__ */ a.jsx("a", { ...w, href: r || "#/", ...l, ...y, children: t }) : m.createElement("a", {
|
|
274
274
|
...l,
|
|
275
275
|
...y,
|
|
276
276
|
...w,
|
|
277
|
-
href:
|
|
277
|
+
href: r || "#",
|
|
278
278
|
dangerouslySetInnerHTML: { __html: n }
|
|
279
279
|
});
|
|
280
280
|
}, Se = {
|
|
281
281
|
type: "LightBoxLink",
|
|
282
282
|
label: "web_blocks.lightbox_link",
|
|
283
283
|
category: "core",
|
|
284
|
-
icon:
|
|
284
|
+
icon: z,
|
|
285
285
|
group: "basic",
|
|
286
286
|
props: {
|
|
287
287
|
styles: p({ default: "" }),
|
|
@@ -304,13 +304,13 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
304
304
|
},
|
|
305
305
|
canAcceptBlock: (e) => e !== "Link" && e !== "LightBoxLink"
|
|
306
306
|
}, Me = (e) => {
|
|
307
|
-
const { blockProps: l, children: t, listType: s, styles: o, tag: n, inBuilder:
|
|
308
|
-
return !t && g(o == null ? void 0 : o.className) ? /* @__PURE__ */ a.jsx(_, { inBuilder:
|
|
307
|
+
const { blockProps: l, children: t, listType: s, styles: o, tag: n, inBuilder: r } = e, i = j(x(o, "className", ""), s);
|
|
308
|
+
return !t && g(o == null ? void 0 : o.className) ? /* @__PURE__ */ a.jsx(_, { inBuilder: r }) : m.createElement(
|
|
309
309
|
n || (s === "list-decimal" ? "ol" : "ul"),
|
|
310
310
|
{ ...l, ...o, className: i },
|
|
311
311
|
t
|
|
312
312
|
);
|
|
313
|
-
},
|
|
313
|
+
}, Ne = {
|
|
314
314
|
type: "List",
|
|
315
315
|
label: "web_blocks.list",
|
|
316
316
|
icon: Z,
|
|
@@ -353,7 +353,7 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
353
353
|
content: "Item 3"
|
|
354
354
|
}
|
|
355
355
|
]
|
|
356
|
-
},
|
|
356
|
+
}, Ee = (e) => {
|
|
357
357
|
const { blockProps: l, content: t, styles: s, children: o, tag: n } = e;
|
|
358
358
|
return o ? m.createElement(n || "li", { ...s, ...l }, o) : m.createElement(n || "li", {
|
|
359
359
|
...s,
|
|
@@ -361,7 +361,7 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
361
361
|
"data-ai-key": "content",
|
|
362
362
|
dangerouslySetInnerHTML: { __html: t }
|
|
363
363
|
});
|
|
364
|
-
},
|
|
364
|
+
}, $e = {
|
|
365
365
|
type: "ListItem",
|
|
366
366
|
label: "web_blocks.listitem",
|
|
367
367
|
icon: J,
|
|
@@ -369,21 +369,21 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
369
369
|
group: "basic",
|
|
370
370
|
props: {
|
|
371
371
|
styles: p({ default: "" }),
|
|
372
|
-
content:
|
|
372
|
+
content: L({ title: "web_blocks.content", default: "List item" })
|
|
373
373
|
},
|
|
374
374
|
canAcceptBlock: (e) => e !== "ListItem",
|
|
375
375
|
canBeNested: (e) => e === "List"
|
|
376
|
-
},
|
|
377
|
-
const { blockProps: l, icon: t, styles: s, width: o, inBuilder: n, height:
|
|
376
|
+
}, Pe = (e) => {
|
|
377
|
+
const { blockProps: l, icon: t, styles: s, width: o, inBuilder: n, height: r } = e, i = R(s, j(o ? `w-[${o}px]` : "", r ? `h-[${r}px]` : ""));
|
|
378
378
|
if (g(t))
|
|
379
379
|
return /* @__PURE__ */ a.jsx(_, { inBuilder: n, className: "h-8 w-14" });
|
|
380
|
-
const
|
|
380
|
+
const c = t.replace(/<svg /g, '<svg class="w-[inherit] h-[inherit]" ');
|
|
381
381
|
return m.createElement("span", {
|
|
382
382
|
...l,
|
|
383
383
|
...i,
|
|
384
|
-
dangerouslySetInnerHTML: { __html:
|
|
384
|
+
dangerouslySetInnerHTML: { __html: c }
|
|
385
385
|
});
|
|
386
|
-
},
|
|
386
|
+
}, Te = {
|
|
387
387
|
type: "Icon",
|
|
388
388
|
label: "web_blocks.icon",
|
|
389
389
|
category: "core",
|
|
@@ -391,7 +391,7 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
391
391
|
group: "media",
|
|
392
392
|
props: {
|
|
393
393
|
styles: p({ default: "text-black" }),
|
|
394
|
-
icon:
|
|
394
|
+
icon: N({
|
|
395
395
|
title: "web_blocks.icon",
|
|
396
396
|
default: '<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>'
|
|
397
397
|
}),
|
|
@@ -399,7 +399,7 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
399
399
|
height: B({ title: "web_blocks.height", default: "" })
|
|
400
400
|
}
|
|
401
401
|
}, He = (e) => {
|
|
402
|
-
const { blockProps: l, image: t, styles: s, alt: o, height: n, width:
|
|
402
|
+
const { blockProps: l, image: t, styles: s, alt: o, height: n, width: r } = e;
|
|
403
403
|
return g(t) ? /* @__PURE__ */ a.jsx(_, { className: "h-36" }) : m.createElement("img", {
|
|
404
404
|
...l,
|
|
405
405
|
...s,
|
|
@@ -407,17 +407,17 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
407
407
|
alt: o,
|
|
408
408
|
loading: "lazy",
|
|
409
409
|
height: n,
|
|
410
|
-
width:
|
|
410
|
+
width: r
|
|
411
411
|
});
|
|
412
|
-
},
|
|
412
|
+
}, ze = {
|
|
413
413
|
type: "Image",
|
|
414
414
|
label: "web_blocks.image",
|
|
415
415
|
category: "core",
|
|
416
|
-
icon:
|
|
416
|
+
icon: z,
|
|
417
417
|
group: "media",
|
|
418
418
|
props: {
|
|
419
419
|
styles: p({ default: "" }),
|
|
420
|
-
image:
|
|
420
|
+
image: C({
|
|
421
421
|
title: "Image",
|
|
422
422
|
default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
|
|
423
423
|
}),
|
|
@@ -425,30 +425,30 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
425
425
|
width: b({ title: "web_blocks.width", default: "" }),
|
|
426
426
|
height: b({ title: "web_blocks.height", default: "" })
|
|
427
427
|
}
|
|
428
|
-
},
|
|
429
|
-
if (
|
|
430
|
-
const l = e.match(
|
|
428
|
+
}, E = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, $ = /^(https?:\/\/)?(www\.)?player.vimeo\.com/, P = /^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/, qe = (e) => {
|
|
429
|
+
if (E.test(e)) {
|
|
430
|
+
const l = e.match(E);
|
|
431
431
|
return l ? `https://www.youtube.com/embed/${l[4]}` : e;
|
|
432
432
|
}
|
|
433
|
-
if (
|
|
434
|
-
const l = e.match(
|
|
433
|
+
if ($.test(e)) {
|
|
434
|
+
const l = e.match($);
|
|
435
435
|
return l ? `https://player.vimeo.com/video/${l[3]}` : e;
|
|
436
436
|
}
|
|
437
|
-
if (
|
|
438
|
-
const l = e.match(
|
|
437
|
+
if (P.test(e)) {
|
|
438
|
+
const l = e.match(P);
|
|
439
439
|
return l ? `https://www.dailymotion.com/embed/video/${l[4]}` : e;
|
|
440
440
|
}
|
|
441
441
|
return null;
|
|
442
|
-
},
|
|
442
|
+
}, Ae = m.memo(
|
|
443
443
|
(e) => {
|
|
444
|
-
const { blockProps: l, inBuilder: t, styles: s, url: o, controls: n } = e,
|
|
444
|
+
const { blockProps: l, inBuilder: t, styles: s, url: o, controls: n } = e, r = x(n, "autoPlay", !1), i = x(n, "controls", !1), c = r || x(n, "muted", !0), d = x(n, "loop", !1);
|
|
445
445
|
if (g(o))
|
|
446
446
|
return /* @__PURE__ */ a.jsx(_, { inBuilder: t, className: "h-36" });
|
|
447
|
-
let h =
|
|
447
|
+
let h = qe(o), f = null;
|
|
448
448
|
if (h) {
|
|
449
449
|
if (!g(h)) {
|
|
450
450
|
const y = [];
|
|
451
|
-
y.push(`autoplay=${
|
|
451
|
+
y.push(`autoplay=${r ? 1 : 0}`), y.push(`controls=${n ? 1 : 0}`), y.push(`mute=${c ? 1 : 0}&muted=${c ? 1 : 0}`), y.push(`loop=${d ? 1 : 0}`), h = `${h}?${y.join("&")}`;
|
|
452
452
|
}
|
|
453
453
|
f = m.createElement("iframe", {
|
|
454
454
|
...l,
|
|
@@ -464,12 +464,12 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
464
464
|
className: "absolute inset-0 w-full h-full",
|
|
465
465
|
src: o,
|
|
466
466
|
controls: i,
|
|
467
|
-
muted:
|
|
468
|
-
autoPlay: t ? !1 :
|
|
467
|
+
muted: c,
|
|
468
|
+
autoPlay: t ? !1 : r,
|
|
469
469
|
loop: d
|
|
470
470
|
});
|
|
471
|
-
return /* @__PURE__ */ a.jsx("div", { ...
|
|
472
|
-
t ? /* @__PURE__ */ a.jsx("div", { ...l, ...
|
|
471
|
+
return /* @__PURE__ */ a.jsx("div", { ...re(s, ["className"]), children: /* @__PURE__ */ a.jsxs("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
|
|
472
|
+
t ? /* @__PURE__ */ a.jsx("div", { ...l, ...ce(s, ["className"]), className: "absolute inset-0 z-20 h-full w-full" }) : null,
|
|
473
473
|
f
|
|
474
474
|
] }) });
|
|
475
475
|
}
|
|
@@ -501,7 +501,7 @@ function De(e) {
|
|
|
501
501
|
}
|
|
502
502
|
const Fe = (e) => {
|
|
503
503
|
const { scripts: l, inBuilder: t, blockProps: s } = e;
|
|
504
|
-
return t ? /* @__PURE__ */ a.jsx("div", { ...s }) : /* @__PURE__ */ a.jsx("div", { dangerouslySetInnerHTML: { __html: l } });
|
|
504
|
+
return t ? /* @__PURE__ */ a.jsx("div", { ...s, children: /* @__PURE__ */ a.jsx("div", { className: j("pointer-events-none flex flex-col items-center justify-center p-2", ""), children: /* @__PURE__ */ a.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800", children: /* @__PURE__ */ a.jsx("p", { className: "text-left text-xs text-gray-400", children: "Scripts will be only executed in preview and live mode. Place your script at the bottom of the" }) }) }) }) : /* @__PURE__ */ a.jsx("div", { dangerouslySetInnerHTML: { __html: l } });
|
|
505
505
|
}, Oe = {
|
|
506
506
|
type: "CustomScript",
|
|
507
507
|
label: "web_blocks.custom_script",
|
|
@@ -509,13 +509,12 @@ const Fe = (e) => {
|
|
|
509
509
|
icon: De,
|
|
510
510
|
group: "advanced",
|
|
511
511
|
props: {
|
|
512
|
-
scripts:
|
|
512
|
+
scripts: T({
|
|
513
513
|
title: "Script",
|
|
514
514
|
default: "",
|
|
515
515
|
placeholder: "<script>console.log('Hello, world!');<\/script>"
|
|
516
516
|
})
|
|
517
|
-
}
|
|
518
|
-
canAcceptBlock: () => !1
|
|
517
|
+
}
|
|
519
518
|
}, Ue = (e) => {
|
|
520
519
|
const { blockProps: l, styles: t } = e;
|
|
521
520
|
return m.createElement("hr", { ...t, ...l });
|
|
@@ -590,9 +589,9 @@ const Fe = (e) => {
|
|
|
590
589
|
hidden: !0,
|
|
591
590
|
category: "core",
|
|
592
591
|
group: "typography",
|
|
593
|
-
icon:
|
|
592
|
+
icon: q,
|
|
594
593
|
props: {
|
|
595
|
-
content:
|
|
594
|
+
content: L({ title: "web_blocks.content", defaultValue: "" })
|
|
596
595
|
}
|
|
597
596
|
}, Ze = (e) => {
|
|
598
597
|
const { blockProps: l, backgroundImage: t, children: s, styles: o } = e;
|
|
@@ -606,7 +605,7 @@ const Fe = (e) => {
|
|
|
606
605
|
hidden: !0,
|
|
607
606
|
props: {
|
|
608
607
|
styles: p({ default: "font-body antialiased" }),
|
|
609
|
-
backgroundImage:
|
|
608
|
+
backgroundImage: C({ title: "Background Image" })
|
|
610
609
|
},
|
|
611
610
|
canAcceptBlock: () => !0,
|
|
612
611
|
canDelete: () => !1,
|
|
@@ -621,14 +620,14 @@ const Fe = (e) => {
|
|
|
621
620
|
category: "core",
|
|
622
621
|
group: "basic",
|
|
623
622
|
hidden: !0,
|
|
624
|
-
icon:
|
|
623
|
+
icon: q,
|
|
625
624
|
props: {
|
|
626
625
|
styles: p({ default: "" })
|
|
627
626
|
}
|
|
628
627
|
}, et = (e) => {
|
|
629
|
-
const { blockProps: l, errorMessage: t, name: s, _type: o, successMessage: n, action:
|
|
630
|
-
let d =
|
|
631
|
-
|
|
628
|
+
const { blockProps: l, errorMessage: t, name: s, _type: o, successMessage: n, action: r, styles: i, children: c } = e;
|
|
629
|
+
let d = c;
|
|
630
|
+
c || (d = /* @__PURE__ */ a.jsx(_, {}));
|
|
632
631
|
const h = {
|
|
633
632
|
"x-data": "useForm",
|
|
634
633
|
"x-on:submit.prevent": "post"
|
|
@@ -643,7 +642,7 @@ const Fe = (e) => {
|
|
|
643
642
|
"data-error": t,
|
|
644
643
|
"data-success": n,
|
|
645
644
|
method: "post",
|
|
646
|
-
action:
|
|
645
|
+
action: r,
|
|
647
646
|
...l,
|
|
648
647
|
...i,
|
|
649
648
|
children: [
|
|
@@ -665,24 +664,24 @@ const Fe = (e) => {
|
|
|
665
664
|
title: "web_blocks.submit_url",
|
|
666
665
|
default: "/api/form/submit"
|
|
667
666
|
}),
|
|
668
|
-
errorMessage:
|
|
667
|
+
errorMessage: S({
|
|
669
668
|
title: "web_blocks.error_message",
|
|
670
669
|
default: "Something went wrong. Please try again"
|
|
671
670
|
}),
|
|
672
|
-
successMessage:
|
|
671
|
+
successMessage: S({
|
|
673
672
|
title: "web_blocks.success_message",
|
|
674
673
|
default: "Thank you for your submission."
|
|
675
674
|
})
|
|
676
675
|
},
|
|
677
676
|
canAcceptBlock: () => !0
|
|
678
677
|
}, lt = (e) => {
|
|
679
|
-
const { blockProps: l, inBuilder: t, label: s, styles: o, inputStyles: n, icon:
|
|
678
|
+
const { blockProps: l, inBuilder: t, label: s, styles: o, inputStyles: n, icon: r, iconPos: i } = e, c = I(), d = {
|
|
680
679
|
"x-bind:disabled": "formLoading"
|
|
681
680
|
};
|
|
682
681
|
return /* @__PURE__ */ a.jsxs(
|
|
683
682
|
"button",
|
|
684
683
|
{
|
|
685
|
-
id:
|
|
684
|
+
id: c,
|
|
686
685
|
...d,
|
|
687
686
|
...n,
|
|
688
687
|
...o,
|
|
@@ -690,7 +689,7 @@ const Fe = (e) => {
|
|
|
690
689
|
type: t ? "button" : "submit",
|
|
691
690
|
children: [
|
|
692
691
|
s,
|
|
693
|
-
|
|
692
|
+
r && /* @__PURE__ */ a.jsx("span", { className: i, dangerouslySetInnerHTML: { __html: r } })
|
|
694
693
|
]
|
|
695
694
|
}
|
|
696
695
|
);
|
|
@@ -705,7 +704,7 @@ const Fe = (e) => {
|
|
|
705
704
|
styles: p({
|
|
706
705
|
default: "text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"
|
|
707
706
|
}),
|
|
708
|
-
icon:
|
|
707
|
+
icon: N({ title: "Icon", default: "" }),
|
|
709
708
|
iconPos: v({
|
|
710
709
|
title: "web_blocks.icon_position",
|
|
711
710
|
default: "order-last",
|
|
@@ -722,13 +721,13 @@ const Fe = (e) => {
|
|
|
722
721
|
placeholder: s,
|
|
723
722
|
styles: o,
|
|
724
723
|
inputStyles: n,
|
|
725
|
-
showLabel:
|
|
724
|
+
showLabel: r,
|
|
726
725
|
required: i,
|
|
727
|
-
inputType:
|
|
726
|
+
inputType: c = "text",
|
|
728
727
|
inBuilder: d,
|
|
729
728
|
fieldName: h
|
|
730
729
|
} = e, f = I();
|
|
731
|
-
return !
|
|
730
|
+
return !r || c === "submit" ? (c === "submit" && (l.value = t), /* @__PURE__ */ a.jsx(
|
|
732
731
|
"input",
|
|
733
732
|
{
|
|
734
733
|
id: f,
|
|
@@ -737,12 +736,12 @@ const Fe = (e) => {
|
|
|
737
736
|
...l,
|
|
738
737
|
...n,
|
|
739
738
|
...o,
|
|
740
|
-
type:
|
|
739
|
+
type: c,
|
|
741
740
|
placeholder: s,
|
|
742
741
|
required: i
|
|
743
742
|
}
|
|
744
743
|
)) : /* @__PURE__ */ a.jsxs("div", { ...o, ...l, children: [
|
|
745
|
-
|
|
744
|
+
r && /* @__PURE__ */ a.jsx("label", { htmlFor: f, children: t }),
|
|
746
745
|
/* @__PURE__ */ a.jsx(
|
|
747
746
|
"input",
|
|
748
747
|
{
|
|
@@ -750,7 +749,7 @@ const Fe = (e) => {
|
|
|
750
749
|
readOnly: d,
|
|
751
750
|
...n,
|
|
752
751
|
id: f,
|
|
753
|
-
type:
|
|
752
|
+
type: c,
|
|
754
753
|
placeholder: s,
|
|
755
754
|
required: i
|
|
756
755
|
}
|
|
@@ -760,14 +759,14 @@ const Fe = (e) => {
|
|
|
760
759
|
type: "Input",
|
|
761
760
|
label: "web_blocks.input",
|
|
762
761
|
category: "core",
|
|
763
|
-
icon:
|
|
762
|
+
icon: A,
|
|
764
763
|
group: "form",
|
|
765
764
|
props: {
|
|
766
765
|
styles: p({ default: "" }),
|
|
767
766
|
fieldName: b({ title: "Field Name", default: "input" }),
|
|
768
767
|
inputType: v({
|
|
769
768
|
title: "web_blocks.type",
|
|
770
|
-
options:
|
|
769
|
+
options: M(
|
|
771
770
|
["text", "email", "password", "number", "tel", "file", "hidden", "range", "submit", "color", "date", "time"],
|
|
772
771
|
(e) => ({
|
|
773
772
|
value: e,
|
|
@@ -787,9 +786,9 @@ const Fe = (e) => {
|
|
|
787
786
|
required: k({ title: "web_blocks.required", default: !1 })
|
|
788
787
|
}
|
|
789
788
|
}, nt = (e) => {
|
|
790
|
-
const { blockProps: l, fieldName: t, label: s, styles: o, inputStyles: n, checked:
|
|
791
|
-
return
|
|
792
|
-
/* @__PURE__ */ a.jsx("input", { ...n, name: t, id: d, type: "radio", required: i, defaultChecked:
|
|
789
|
+
const { blockProps: l, fieldName: t, label: s, styles: o, inputStyles: n, checked: r, required: i, showLabel: c = !0 } = e, d = I();
|
|
790
|
+
return c ? /* @__PURE__ */ a.jsxs("div", { ...o, ...l, children: [
|
|
791
|
+
/* @__PURE__ */ a.jsx("input", { ...n, name: t, id: d, type: "radio", required: i, defaultChecked: r }),
|
|
793
792
|
s && /* @__PURE__ */ a.jsx("label", { htmlFor: d, children: s })
|
|
794
793
|
] }) : /* @__PURE__ */ a.jsx(
|
|
795
794
|
"input",
|
|
@@ -800,11 +799,11 @@ const Fe = (e) => {
|
|
|
800
799
|
...o,
|
|
801
800
|
type: "radio",
|
|
802
801
|
required: i,
|
|
803
|
-
checked:
|
|
802
|
+
checked: r,
|
|
804
803
|
name: t
|
|
805
804
|
}
|
|
806
805
|
);
|
|
807
|
-
},
|
|
806
|
+
}, rt = {
|
|
808
807
|
type: "Radio",
|
|
809
808
|
label: "web_blocks.radio",
|
|
810
809
|
category: "core",
|
|
@@ -817,23 +816,23 @@ const Fe = (e) => {
|
|
|
817
816
|
checked: k({ title: "web_blocks.checked", default: !1 }),
|
|
818
817
|
required: k({ title: "web_blocks.required", default: !1 })
|
|
819
818
|
}
|
|
820
|
-
},
|
|
819
|
+
}, ct = (e) => {
|
|
821
820
|
const {
|
|
822
821
|
blockProps: l,
|
|
823
822
|
fieldName: t,
|
|
824
823
|
label: s,
|
|
825
824
|
placeholder: o,
|
|
826
825
|
styles: n,
|
|
827
|
-
inputStyles:
|
|
826
|
+
inputStyles: r,
|
|
828
827
|
required: i,
|
|
829
|
-
showLabel:
|
|
828
|
+
showLabel: c,
|
|
830
829
|
_multiple: d = !1
|
|
831
830
|
} = e, h = I();
|
|
832
|
-
return
|
|
833
|
-
|
|
834
|
-
/* @__PURE__ */ a.jsxs("select", { ...
|
|
831
|
+
return c ? /* @__PURE__ */ a.jsxs("div", { ...n, children: [
|
|
832
|
+
c && /* @__PURE__ */ a.jsx("label", { htmlFor: h, children: s }),
|
|
833
|
+
/* @__PURE__ */ a.jsxs("select", { ...r, id: h, required: i, multiple: d, name: t, children: [
|
|
835
834
|
/* @__PURE__ */ a.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: o }),
|
|
836
|
-
|
|
835
|
+
M(e.options, (f) => /* @__PURE__ */ a.jsx(
|
|
837
836
|
"option",
|
|
838
837
|
{
|
|
839
838
|
selected: x(f, "selected", !1),
|
|
@@ -854,7 +853,7 @@ const Fe = (e) => {
|
|
|
854
853
|
name: t,
|
|
855
854
|
children: [
|
|
856
855
|
/* @__PURE__ */ a.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: o }),
|
|
857
|
-
|
|
856
|
+
M(e.options, (f) => /* @__PURE__ */ a.jsx(
|
|
858
857
|
"option",
|
|
859
858
|
{
|
|
860
859
|
selected: x(f, "selected", !1),
|
|
@@ -893,17 +892,17 @@ const Fe = (e) => {
|
|
|
893
892
|
})
|
|
894
893
|
}
|
|
895
894
|
}, dt = (e) => {
|
|
896
|
-
const { blockProps: l, fieldName: t, label: s, placeholder: o, styles: n, inputStyles:
|
|
897
|
-
return
|
|
898
|
-
|
|
899
|
-
/* @__PURE__ */ a.jsx("textarea", { name: t, ...
|
|
895
|
+
const { blockProps: l, fieldName: t, label: s, placeholder: o, styles: n, inputStyles: r, _rows: i, showLabel: c } = e, d = I();
|
|
896
|
+
return c ? /* @__PURE__ */ a.jsxs("div", { ...n, ...l, children: [
|
|
897
|
+
c && /* @__PURE__ */ a.jsx("label", { htmlFor: d, children: s }),
|
|
898
|
+
/* @__PURE__ */ a.jsx("textarea", { name: t, ...r, id: d, placeholder: o, rows: i })
|
|
900
899
|
] }) : /* @__PURE__ */ a.jsx(
|
|
901
900
|
"textarea",
|
|
902
901
|
{
|
|
903
902
|
id: d,
|
|
904
903
|
name: t,
|
|
905
904
|
...l,
|
|
906
|
-
...
|
|
905
|
+
...r,
|
|
907
906
|
...n,
|
|
908
907
|
placeholder: o,
|
|
909
908
|
rows: i
|
|
@@ -913,7 +912,7 @@ const Fe = (e) => {
|
|
|
913
912
|
type: "TextArea",
|
|
914
913
|
label: "web_blocks.textarea",
|
|
915
914
|
category: "core",
|
|
916
|
-
icon:
|
|
915
|
+
icon: A,
|
|
917
916
|
group: "form",
|
|
918
917
|
props: {
|
|
919
918
|
fieldName: b({ title: "web_blocks.field_name", default: "textarea" }),
|
|
@@ -928,8 +927,8 @@ const Fe = (e) => {
|
|
|
928
927
|
_rows: B({ title: "web_blocks.rows", default: 3 })
|
|
929
928
|
}
|
|
930
929
|
}, bt = (e) => {
|
|
931
|
-
const { blockProps: l, fieldName: t, label: s, styles: o, inputStyles: n, required:
|
|
932
|
-
return
|
|
930
|
+
const { blockProps: l, fieldName: t, label: s, styles: o, inputStyles: n, required: r, checked: i, showLabel: c = !0 } = e, d = I();
|
|
931
|
+
return c ? /* @__PURE__ */ a.jsxs("div", { ...o, ...l, children: [
|
|
933
932
|
/* @__PURE__ */ a.jsx(
|
|
934
933
|
"input",
|
|
935
934
|
{
|
|
@@ -937,7 +936,7 @@ const Fe = (e) => {
|
|
|
937
936
|
name: t,
|
|
938
937
|
id: d,
|
|
939
938
|
type: "checkbox",
|
|
940
|
-
required:
|
|
939
|
+
required: r,
|
|
941
940
|
defaultChecked: i
|
|
942
941
|
}
|
|
943
942
|
),
|
|
@@ -950,7 +949,7 @@ const Fe = (e) => {
|
|
|
950
949
|
...n,
|
|
951
950
|
...o,
|
|
952
951
|
type: "checkbox",
|
|
953
|
-
required:
|
|
952
|
+
required: r,
|
|
954
953
|
name: t
|
|
955
954
|
}
|
|
956
955
|
);
|
|
@@ -968,7 +967,7 @@ const Fe = (e) => {
|
|
|
968
967
|
required: k({ title: "web_blocks.required", default: !1 })
|
|
969
968
|
}
|
|
970
969
|
}, xt = () => {
|
|
971
|
-
u(de, ue), u(he, ke), u(be, pe), u(ye, ge), u(_e, we), u(xe, ve), u(Ie, Be), u(je, Le), u(Ce, Se), u(Me,
|
|
970
|
+
u(de, ue), u(he, ke), u(be, pe), u(ye, ge), u(_e, we), u(xe, ve), u(Ie, Be), u(je, Le), u(Ce, Se), u(Me, Ne), u(Ee, $e), u(Pe, Te), u(He, ze), u(Ae, Re), u(me, fe), u(Xe, Ye), u(et, tt), u(lt, ot), u(st, at), u(bt, pt), u(nt, rt), u(ct, it), u(dt, ut), u(Ke, Qe), u(Ze, Je), u(Fe, Oe), u(Ue, Ve), u(Ge, We);
|
|
972
971
|
};
|
|
973
972
|
export {
|
|
974
973
|
xt as loadWebBlocks
|