@chaibuilder/sdk 2.2.18 → 2.2.20
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/{apply-binding-Z9D6RXG4.js → apply-binding-CkrtJykq.js} +65 -68
- package/dist/apply-binding-DpBwzIf9.cjs +1 -0
- package/dist/core.cjs +12 -13
- package/dist/core.d.ts +38 -6
- package/dist/core.js +1614 -1196
- package/dist/{get-chai-builder-theme-CeaKvOZ8.cjs → get-chai-builder-theme-B1tr_NJB.cjs} +1 -1
- package/dist/{get-chai-builder-theme-ByeXCyGx.js → get-chai-builder-theme-BarMkcGH.js} +1 -1
- package/dist/{plugin-fnBB3TCm.js → plugin-BOcGV_IY.js} +15 -14
- package/dist/{plugin-C01tjI6V.cjs → plugin-CSgw-f78.cjs} +5 -5
- package/dist/render.cjs +2 -2
- package/dist/render.js +57 -60
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.js +2 -2
- package/dist/web-blocks.cjs +2 -2
- package/dist/web-blocks.js +241 -172
- package/package.json +6 -3
- package/dist/apply-binding-k6PclyA3.cjs +0 -1
package/dist/web-blocks.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { registerChaiBlockSchema as u, StylesProp as
|
|
2
|
-
import { jsx as s, jsxs as
|
|
3
|
-
import { c as
|
|
1
|
+
import { registerChaiBlockSchema as u, StylesProp as d, registerChaiBlock as p, stylesProp as P, closestBlockProp as H } from "@chaibuilder/runtime";
|
|
2
|
+
import { jsx as s, jsxs as f, Fragment as N } from "react/jsx-runtime";
|
|
3
|
+
import { c as B, g as v } from "./common-functions-BGzDsf1z.js";
|
|
4
4
|
import * as b from "react";
|
|
5
5
|
import { createElement as w } from "react";
|
|
6
|
-
import { ButtonIcon as R, CopyIcon as z, CodeIcon as
|
|
7
|
-
import { isEmpty as
|
|
8
|
-
import { FileCode as ce, GroupIcon as pe, GlobeIcon as
|
|
9
|
-
const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div", { className:
|
|
6
|
+
import { ButtonIcon as R, CopyIcon as z, CodeIcon as D, DividerHorizontalIcon as j, CheckboxIcon as V, InputIcon as M, LetterCaseToggleIcon as q, RadiobuttonIcon as F, DropdownMenuIcon as U, HeadingIcon as G, TableIcon as O, BorderTopIcon as Y, BorderAllIcon as W, ViewHorizontalIcon as X, DragHandleHorizontalIcon as J, SketchLogoIcon as Q, ImageIcon as Z, Link1Icon as K, RowsIcon as ee, ColumnsIcon as te, TextIcon as oe, CursorTextIcon as le, SpaceBetweenVerticallyIcon as re, VideoIcon as ne, LoopIcon as E } from "@radix-ui/react-icons";
|
|
7
|
+
import { isEmpty as C, get as h, map as S, isNull as ie, omit as se, pick as ae } from "lodash-es";
|
|
8
|
+
import { FileCode as ce, GroupIcon as pe, GlobeIcon as $, Columns as de, Rows as ue } from "lucide-react";
|
|
9
|
+
const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div", { className: B("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ s("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ s("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, me = (e) => {
|
|
10
10
|
const { blockProps: o, inBuilder: t, backgroundImage: l, children: r, tag: n = "div", styles: i } = e;
|
|
11
11
|
let a = r;
|
|
12
12
|
r || (a = /* @__PURE__ */ s(I, { inBuilder: t }));
|
|
13
13
|
let c = {};
|
|
14
14
|
return l && (c = { backgroundImage: `url(${l})` }), b.createElement(n, { ...o, ...i, style: c }, a);
|
|
15
|
-
},
|
|
15
|
+
}, ye = {
|
|
16
16
|
type: "Box",
|
|
17
17
|
description: "Similar to a div or section elements in HTML",
|
|
18
18
|
label: "Box",
|
|
@@ -20,7 +20,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
20
20
|
group: "basic",
|
|
21
21
|
...u({
|
|
22
22
|
properties: {
|
|
23
|
-
styles:
|
|
23
|
+
styles: d(""),
|
|
24
24
|
backgroundImage: {
|
|
25
25
|
type: "string",
|
|
26
26
|
default: "",
|
|
@@ -55,7 +55,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
55
55
|
}),
|
|
56
56
|
canAcceptBlock: () => !0
|
|
57
57
|
}, ge = (e) => {
|
|
58
|
-
const { blockProps: o, iconSize: t, icon: l, content: r, styles: n, children: i, iconPos: a, link: c, inBuilder:
|
|
58
|
+
const { blockProps: o, iconSize: t, icon: l, content: r, styles: n, children: i, iconPos: a, link: c, inBuilder: m } = e, k = l, g = i || /* @__PURE__ */ f(N, { children: [
|
|
59
59
|
/* @__PURE__ */ s("span", { "data-ai-key": "content", children: r }),
|
|
60
60
|
k && /* @__PURE__ */ s(
|
|
61
61
|
"div",
|
|
@@ -65,7 +65,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
65
65
|
dangerouslySetInnerHTML: { __html: k }
|
|
66
66
|
}
|
|
67
67
|
)
|
|
68
|
-
] }),
|
|
68
|
+
] }), y = w(
|
|
69
69
|
"button",
|
|
70
70
|
{
|
|
71
71
|
...o,
|
|
@@ -75,7 +75,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
75
75
|
},
|
|
76
76
|
g
|
|
77
77
|
);
|
|
78
|
-
return
|
|
78
|
+
return C(h(c, "href")) ? y : m ? /* @__PURE__ */ s("span", { children: y }) : /* @__PURE__ */ s("a", { "aria-label": r, href: h(c, "href") || "/", target: h(c, "target", "_self"), children: y });
|
|
79
79
|
}, be = {
|
|
80
80
|
type: "Button",
|
|
81
81
|
description: "similar to a button element in HTML",
|
|
@@ -85,7 +85,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
85
85
|
group: "basic",
|
|
86
86
|
...u({
|
|
87
87
|
properties: {
|
|
88
|
-
styles:
|
|
88
|
+
styles: d("text-primary-foreground bg-primary px-4 py-2 rounded-lg flex items-center"),
|
|
89
89
|
content: {
|
|
90
90
|
type: "string",
|
|
91
91
|
title: "Button label",
|
|
@@ -129,7 +129,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
129
129
|
i18nProps: ["content"],
|
|
130
130
|
aiProps: ["content"]
|
|
131
131
|
}, fe = (e) => {
|
|
132
|
-
const { blockProps: o, iconSize: t, icon: l, content: r, styles: n } = e, i = l, a = /* @__PURE__ */
|
|
132
|
+
const { blockProps: o, iconSize: t, icon: l, content: r, styles: n } = e, i = l, a = /* @__PURE__ */ f(N, { children: [
|
|
133
133
|
/* @__PURE__ */ s("span", { "data-ai-key": "content", children: r }),
|
|
134
134
|
i && /* @__PURE__ */ s("div", { style: { width: t + "px" }, dangerouslySetInnerHTML: { __html: i } })
|
|
135
135
|
] });
|
|
@@ -152,7 +152,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
152
152
|
group: "basic",
|
|
153
153
|
...u({
|
|
154
154
|
properties: {
|
|
155
|
-
styles:
|
|
155
|
+
styles: d("p-2 rounded-md flex items-center"),
|
|
156
156
|
content: {
|
|
157
157
|
type: "string",
|
|
158
158
|
title: "Button label",
|
|
@@ -175,7 +175,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
175
175
|
aiProps: ["content"]
|
|
176
176
|
}, ke = (e) => {
|
|
177
177
|
const { blockProps: o, styles: t, htmlCode: l, inBuilder: r } = e;
|
|
178
|
-
return r ? /* @__PURE__ */
|
|
178
|
+
return r ? /* @__PURE__ */ f("div", { className: "relative", children: [
|
|
179
179
|
r ? /* @__PURE__ */ s("div", { ...o, ...t, className: "absolute z-20 h-full w-full" }) : null,
|
|
180
180
|
b.createElement("div", {
|
|
181
181
|
...t,
|
|
@@ -191,11 +191,11 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
191
191
|
description: "similar to a div or section elements in HTML",
|
|
192
192
|
label: "Custom HTML",
|
|
193
193
|
category: "core",
|
|
194
|
-
icon:
|
|
194
|
+
icon: D,
|
|
195
195
|
group: "advanced",
|
|
196
196
|
...u({
|
|
197
197
|
properties: {
|
|
198
|
-
styles:
|
|
198
|
+
styles: d(""),
|
|
199
199
|
htmlCode: {
|
|
200
200
|
type: "string",
|
|
201
201
|
default: "<div><p>Enter your HTML code here...</p></div>",
|
|
@@ -203,10 +203,10 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
})
|
|
206
|
-
},
|
|
206
|
+
}, ve = (e) => {
|
|
207
207
|
const { scripts: o, inBuilder: t, blockProps: l } = e;
|
|
208
|
-
return t ? /* @__PURE__ */ s("div", { ...l, children: /* @__PURE__ */ s("div", { className:
|
|
209
|
-
},
|
|
208
|
+
return t ? /* @__PURE__ */ s("div", { ...l, children: /* @__PURE__ */ s("div", { className: B("pointer-events-none flex flex-col items-center justify-center p-2", ""), children: /* @__PURE__ */ s("div", { className: "h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800", children: /* @__PURE__ */ s("p", { className: "text-left text-xs text-gray-400", children: "Scripts will be only executed in preview and live mode. Place your script at the bottom of the" }) }) }) }) : /* @__PURE__ */ s("div", { dangerouslySetInnerHTML: { __html: o } });
|
|
209
|
+
}, Ce = {
|
|
210
210
|
type: "CustomScript",
|
|
211
211
|
description: "similar to a script element in HTML",
|
|
212
212
|
label: "Custom Script",
|
|
@@ -227,19 +227,19 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
227
227
|
}, Ie = (e) => {
|
|
228
228
|
const { blockProps: o, styles: t } = e;
|
|
229
229
|
return w("hr", { ...t, ...o });
|
|
230
|
-
},
|
|
230
|
+
}, xe = {
|
|
231
231
|
type: "Divider",
|
|
232
232
|
description: "A horizontal line component",
|
|
233
233
|
label: "Divider",
|
|
234
234
|
category: "core",
|
|
235
|
-
icon:
|
|
235
|
+
icon: j,
|
|
236
236
|
group: "basic",
|
|
237
237
|
...u({
|
|
238
238
|
properties: {
|
|
239
|
-
styles:
|
|
239
|
+
styles: d("bg-gray-900 h-0.5 py-2 my-1")
|
|
240
240
|
}
|
|
241
241
|
})
|
|
242
|
-
},
|
|
242
|
+
}, Be = (e) => {
|
|
243
243
|
const { blockProps: o, styles: t, backgroundImage: l } = e;
|
|
244
244
|
let r = {};
|
|
245
245
|
return l && (r = { backgroundImage: `url(${l})` }), b.createElement("div", { ...o, ...t, style: r });
|
|
@@ -251,7 +251,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
251
251
|
group: "basic",
|
|
252
252
|
...u({
|
|
253
253
|
properties: {
|
|
254
|
-
styles:
|
|
254
|
+
styles: d(""),
|
|
255
255
|
backgroundImage: {
|
|
256
256
|
type: "string",
|
|
257
257
|
title: "Background Image",
|
|
@@ -261,24 +261,24 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
261
261
|
}
|
|
262
262
|
})
|
|
263
263
|
}, Pe = (e) => {
|
|
264
|
-
const { blockProps: o, fieldName: t, label: l, styles: r, inputStyles: n, required: i, checked: a, showLabel: c = !0 } = e,
|
|
265
|
-
return c ? /* @__PURE__ */
|
|
264
|
+
const { blockProps: o, fieldName: t, label: l, styles: r, inputStyles: n, required: i, checked: a, showLabel: c = !0 } = e, m = v();
|
|
265
|
+
return c ? /* @__PURE__ */ f("div", { ...r, ...o, children: [
|
|
266
266
|
/* @__PURE__ */ s(
|
|
267
267
|
"input",
|
|
268
268
|
{
|
|
269
269
|
...n,
|
|
270
270
|
name: t,
|
|
271
|
-
id:
|
|
271
|
+
id: m,
|
|
272
272
|
type: "checkbox",
|
|
273
273
|
required: i,
|
|
274
274
|
defaultChecked: a
|
|
275
275
|
}
|
|
276
276
|
),
|
|
277
|
-
l && /* @__PURE__ */ s("label", { htmlFor:
|
|
277
|
+
l && /* @__PURE__ */ s("label", { htmlFor: m, children: l })
|
|
278
278
|
] }) : /* @__PURE__ */ s(
|
|
279
279
|
"input",
|
|
280
280
|
{
|
|
281
|
-
id:
|
|
281
|
+
id: m,
|
|
282
282
|
...o,
|
|
283
283
|
...n,
|
|
284
284
|
...r,
|
|
@@ -287,16 +287,16 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
287
287
|
name: t
|
|
288
288
|
}
|
|
289
289
|
);
|
|
290
|
-
},
|
|
290
|
+
}, Se = {
|
|
291
291
|
type: "Checkbox",
|
|
292
292
|
label: "web_blocks.checkbox",
|
|
293
293
|
category: "core",
|
|
294
|
-
icon:
|
|
294
|
+
icon: V,
|
|
295
295
|
group: "form",
|
|
296
296
|
...u({
|
|
297
297
|
properties: {
|
|
298
|
-
styles:
|
|
299
|
-
inputStyles:
|
|
298
|
+
styles: d("flex items-center gap-x-2"),
|
|
299
|
+
inputStyles: d(""),
|
|
300
300
|
fieldName: {
|
|
301
301
|
type: "string",
|
|
302
302
|
title: "Field Name",
|
|
@@ -326,10 +326,10 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
326
326
|
}),
|
|
327
327
|
aiProps: ["label"],
|
|
328
328
|
i18nProps: ["label"]
|
|
329
|
-
},
|
|
329
|
+
}, _e = (e) => {
|
|
330
330
|
const { children: o, blockProps: t, errorMessage: l, successMessage: r, action: n, styles: i, inBuilder: a } = e;
|
|
331
331
|
let c = o;
|
|
332
|
-
return o || (c = /* @__PURE__ */ s(I, { inBuilder: a })), /* @__PURE__ */
|
|
332
|
+
return o || (c = /* @__PURE__ */ s(I, { inBuilder: a })), /* @__PURE__ */ f(
|
|
333
333
|
"form",
|
|
334
334
|
{
|
|
335
335
|
...{
|
|
@@ -369,7 +369,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
369
369
|
],
|
|
370
370
|
...u({
|
|
371
371
|
properties: {
|
|
372
|
-
styles:
|
|
372
|
+
styles: d(""),
|
|
373
373
|
action: {
|
|
374
374
|
type: "string",
|
|
375
375
|
title: "Submit URL",
|
|
@@ -393,11 +393,11 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
393
393
|
aiProps: ["errorMessage", "successMessage"],
|
|
394
394
|
canAcceptBlock: () => !0
|
|
395
395
|
}, Ne = (e) => {
|
|
396
|
-
const { blockProps: o, inBuilder: t, label: l, styles: r, inputStyles: n, icon: i, iconSize: a, iconPos: c } = e,
|
|
397
|
-
return /* @__PURE__ */
|
|
396
|
+
const { blockProps: o, inBuilder: t, label: l, styles: r, inputStyles: n, icon: i, iconSize: a, iconPos: c } = e, m = v();
|
|
397
|
+
return /* @__PURE__ */ f(
|
|
398
398
|
"button",
|
|
399
399
|
{
|
|
400
|
-
id:
|
|
400
|
+
id: m,
|
|
401
401
|
...{
|
|
402
402
|
"x-bind:disabled": "formLoading"
|
|
403
403
|
},
|
|
@@ -427,10 +427,10 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
427
427
|
group: "form",
|
|
428
428
|
...u({
|
|
429
429
|
properties: {
|
|
430
|
-
styles:
|
|
430
|
+
styles: d(
|
|
431
431
|
"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"
|
|
432
432
|
),
|
|
433
|
-
inputStyles:
|
|
433
|
+
inputStyles: d(""),
|
|
434
434
|
label: {
|
|
435
435
|
type: "string",
|
|
436
436
|
title: "Label",
|
|
@@ -469,10 +469,10 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
469
469
|
inputStyles: i,
|
|
470
470
|
showLabel: a,
|
|
471
471
|
required: c,
|
|
472
|
-
inputType:
|
|
472
|
+
inputType: m,
|
|
473
473
|
autocomplete: k
|
|
474
|
-
} = e, g =
|
|
475
|
-
return a ? /* @__PURE__ */
|
|
474
|
+
} = e, g = v();
|
|
475
|
+
return a ? /* @__PURE__ */ f("div", { ...n, ...o, children: [
|
|
476
476
|
a && /* @__PURE__ */ s("label", { htmlFor: g, children: l }),
|
|
477
477
|
/* @__PURE__ */ s(
|
|
478
478
|
"input",
|
|
@@ -480,7 +480,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
480
480
|
name: t,
|
|
481
481
|
...i,
|
|
482
482
|
id: g,
|
|
483
|
-
type:
|
|
483
|
+
type: m,
|
|
484
484
|
placeholder: r,
|
|
485
485
|
required: c,
|
|
486
486
|
autoComplete: k ? "on" : "off"
|
|
@@ -494,13 +494,13 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
494
494
|
...o,
|
|
495
495
|
...i,
|
|
496
496
|
...n,
|
|
497
|
-
type:
|
|
497
|
+
type: m,
|
|
498
498
|
placeholder: r,
|
|
499
499
|
required: c,
|
|
500
500
|
autoComplete: k ? "on" : "off"
|
|
501
501
|
}
|
|
502
502
|
);
|
|
503
|
-
},
|
|
503
|
+
}, Ee = {
|
|
504
504
|
type: "Input",
|
|
505
505
|
label: "web_blocks.input",
|
|
506
506
|
category: "core",
|
|
@@ -508,8 +508,8 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
508
508
|
group: "form",
|
|
509
509
|
...u({
|
|
510
510
|
properties: {
|
|
511
|
-
styles:
|
|
512
|
-
inputStyles:
|
|
511
|
+
styles: d(""),
|
|
512
|
+
inputStyles: d("w-full p-1"),
|
|
513
513
|
fieldName: {
|
|
514
514
|
type: "string",
|
|
515
515
|
title: "Field Name",
|
|
@@ -536,7 +536,20 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
536
536
|
type: "string",
|
|
537
537
|
title: "Input Type",
|
|
538
538
|
default: "text",
|
|
539
|
-
enum: [
|
|
539
|
+
enum: [
|
|
540
|
+
"text",
|
|
541
|
+
"email",
|
|
542
|
+
"password",
|
|
543
|
+
"number",
|
|
544
|
+
"tel",
|
|
545
|
+
"hidden",
|
|
546
|
+
"range",
|
|
547
|
+
"color",
|
|
548
|
+
"date",
|
|
549
|
+
"time",
|
|
550
|
+
"name",
|
|
551
|
+
"postal-code"
|
|
552
|
+
]
|
|
540
553
|
},
|
|
541
554
|
required: {
|
|
542
555
|
type: "boolean",
|
|
@@ -552,7 +565,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
552
565
|
}),
|
|
553
566
|
aiProps: ["label", "placeholder"],
|
|
554
567
|
i18nProps: ["label", "placeholder"]
|
|
555
|
-
},
|
|
568
|
+
}, $e = (e) => {
|
|
556
569
|
const { blockProps: o, content: t, styles: l, children: r } = e, n = { ...l, ...o };
|
|
557
570
|
return r ? b.createElement("label", n, r) : b.createElement("label", {
|
|
558
571
|
...n,
|
|
@@ -566,7 +579,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
566
579
|
group: "form",
|
|
567
580
|
...u({
|
|
568
581
|
properties: {
|
|
569
|
-
styles:
|
|
582
|
+
styles: d(),
|
|
570
583
|
content: {
|
|
571
584
|
type: "string",
|
|
572
585
|
title: "Content",
|
|
@@ -577,14 +590,14 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
577
590
|
aiProps: ["content"],
|
|
578
591
|
i18nProps: ["content"]
|
|
579
592
|
}, He = (e) => {
|
|
580
|
-
const { blockProps: o, fieldName: t, label: l, styles: r, inputStyles: n, required: i, checked: a, showLabel: c = !0 } = e,
|
|
581
|
-
return c ? /* @__PURE__ */
|
|
582
|
-
/* @__PURE__ */ s("input", { ...n, name: t, id:
|
|
583
|
-
l && /* @__PURE__ */ s("label", { htmlFor:
|
|
593
|
+
const { blockProps: o, fieldName: t, label: l, styles: r, inputStyles: n, required: i, checked: a, showLabel: c = !0 } = e, m = v();
|
|
594
|
+
return c ? /* @__PURE__ */ f("div", { ...r, ...o, children: [
|
|
595
|
+
/* @__PURE__ */ s("input", { ...n, name: t, id: m, type: "radio", required: i, defaultChecked: a }),
|
|
596
|
+
l && /* @__PURE__ */ s("label", { htmlFor: m, children: l })
|
|
584
597
|
] }) : /* @__PURE__ */ s(
|
|
585
598
|
"input",
|
|
586
599
|
{
|
|
587
|
-
id:
|
|
600
|
+
id: m,
|
|
588
601
|
...o,
|
|
589
602
|
...n,
|
|
590
603
|
...r,
|
|
@@ -602,8 +615,8 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
602
615
|
group: "form",
|
|
603
616
|
...u({
|
|
604
617
|
properties: {
|
|
605
|
-
styles:
|
|
606
|
-
inputStyles:
|
|
618
|
+
styles: d("flex items-center gap-x-2"),
|
|
619
|
+
inputStyles: d(""),
|
|
607
620
|
fieldName: {
|
|
608
621
|
type: "string",
|
|
609
622
|
title: "Field Name",
|
|
@@ -633,19 +646,19 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
633
646
|
}),
|
|
634
647
|
aiProps: ["label"],
|
|
635
648
|
i18nProps: ["label"]
|
|
636
|
-
},
|
|
637
|
-
const { blockProps: o, fieldName: t, label: l, placeholder: r, styles: n, inputStyles: i, required: a, showLabel: c, _multiple:
|
|
638
|
-
return c ? /* @__PURE__ */
|
|
649
|
+
}, De = (e) => {
|
|
650
|
+
const { blockProps: o, fieldName: t, label: l, placeholder: r, styles: n, inputStyles: i, required: a, showLabel: c, _multiple: m, options: k } = e, g = v();
|
|
651
|
+
return c ? /* @__PURE__ */ f("div", { ...n, ...o, children: [
|
|
639
652
|
c && /* @__PURE__ */ s("label", { htmlFor: g, children: l }),
|
|
640
|
-
/* @__PURE__ */
|
|
653
|
+
/* @__PURE__ */ f("select", { ...i, id: g, required: a, multiple: m, name: t, children: [
|
|
641
654
|
/* @__PURE__ */ s("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: r }),
|
|
642
|
-
|
|
655
|
+
S(k, (y) => /* @__PURE__ */ s("option", { value: y == null ? void 0 : y.value, children: y == null ? void 0 : y.label }, y == null ? void 0 : y.value))
|
|
643
656
|
] })
|
|
644
|
-
] }) : /* @__PURE__ */
|
|
657
|
+
] }) : /* @__PURE__ */ f("select", { id: g, ...n, ...o, required: a, multiple: m, name: t, children: [
|
|
645
658
|
/* @__PURE__ */ s("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: r }),
|
|
646
|
-
|
|
659
|
+
S(k, (y) => /* @__PURE__ */ s("option", { value: y == null ? void 0 : y.value, children: y == null ? void 0 : y.label }, y == null ? void 0 : y.value))
|
|
647
660
|
] });
|
|
648
|
-
},
|
|
661
|
+
}, je = {
|
|
649
662
|
type: "Select",
|
|
650
663
|
label: "web_blocks.select",
|
|
651
664
|
category: "core",
|
|
@@ -653,8 +666,8 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
653
666
|
group: "form",
|
|
654
667
|
...u({
|
|
655
668
|
properties: {
|
|
656
|
-
styles:
|
|
657
|
-
inputStyles:
|
|
669
|
+
styles: d(""),
|
|
670
|
+
inputStyles: d("w-full p-1"),
|
|
658
671
|
fieldName: {
|
|
659
672
|
type: "string",
|
|
660
673
|
title: "Field Name",
|
|
@@ -709,9 +722,9 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
709
722
|
}),
|
|
710
723
|
aiProps: ["label", "placeholder"],
|
|
711
724
|
i18nProps: ["label", "placeholder"]
|
|
712
|
-
},
|
|
713
|
-
const { blockProps: o, fieldName: t, label: l, placeholder: r, styles: n, inputStyles: i, rows: a, showLabel: c, required:
|
|
714
|
-
return c ? /* @__PURE__ */
|
|
725
|
+
}, Ve = (e) => {
|
|
726
|
+
const { blockProps: o, fieldName: t, label: l, placeholder: r, styles: n, inputStyles: i, rows: a, showLabel: c, required: m } = e, k = v();
|
|
727
|
+
return c ? /* @__PURE__ */ f("div", { ...n, ...o, children: [
|
|
715
728
|
c && /* @__PURE__ */ s("label", { htmlFor: k, children: l }),
|
|
716
729
|
/* @__PURE__ */ s(
|
|
717
730
|
"textarea",
|
|
@@ -721,7 +734,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
721
734
|
id: k,
|
|
722
735
|
placeholder: r,
|
|
723
736
|
rows: a,
|
|
724
|
-
required:
|
|
737
|
+
required: m
|
|
725
738
|
}
|
|
726
739
|
)
|
|
727
740
|
] }) : /* @__PURE__ */ s(
|
|
@@ -734,7 +747,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
734
747
|
...n,
|
|
735
748
|
placeholder: r,
|
|
736
749
|
rows: a,
|
|
737
|
-
required:
|
|
750
|
+
required: m
|
|
738
751
|
}
|
|
739
752
|
);
|
|
740
753
|
}, qe = {
|
|
@@ -750,8 +763,8 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
750
763
|
title: "Field Name",
|
|
751
764
|
default: "fieldName"
|
|
752
765
|
},
|
|
753
|
-
styles:
|
|
754
|
-
inputStyles:
|
|
766
|
+
styles: d(""),
|
|
767
|
+
inputStyles: d("w-full p-1"),
|
|
755
768
|
showLabel: {
|
|
756
769
|
type: "boolean",
|
|
757
770
|
title: "Show Label",
|
|
@@ -784,13 +797,13 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
784
797
|
i18nProps: ["label", "placeholder"]
|
|
785
798
|
}, Fe = (e) => {
|
|
786
799
|
const { blockProps: o, inBuilder: t, children: l, globalBlock: r } = e;
|
|
787
|
-
return t && !r ? /* @__PURE__ */
|
|
800
|
+
return t && !r ? /* @__PURE__ */ f(
|
|
788
801
|
"div",
|
|
789
802
|
{
|
|
790
803
|
className: "flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",
|
|
791
804
|
...o,
|
|
792
805
|
children: [
|
|
793
|
-
/* @__PURE__ */
|
|
806
|
+
/* @__PURE__ */ f("h1", { children: [
|
|
794
807
|
"Global Block - ",
|
|
795
808
|
r
|
|
796
809
|
] }),
|
|
@@ -802,7 +815,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
802
815
|
type: "GlobalBlock",
|
|
803
816
|
description: "A global block component",
|
|
804
817
|
label: "Global Block",
|
|
805
|
-
icon:
|
|
818
|
+
icon: $,
|
|
806
819
|
category: "core",
|
|
807
820
|
group: "basic",
|
|
808
821
|
hidden: !0,
|
|
@@ -838,7 +851,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
838
851
|
title: "Level",
|
|
839
852
|
enum: ["h1", "h2", "h3", "h4", "h5", "h6"]
|
|
840
853
|
},
|
|
841
|
-
styles:
|
|
854
|
+
styles: d("text-3xl"),
|
|
842
855
|
content: {
|
|
843
856
|
type: "string",
|
|
844
857
|
default: "Heading goes here",
|
|
@@ -861,7 +874,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
861
874
|
hidden: !0,
|
|
862
875
|
...u({
|
|
863
876
|
properties: {
|
|
864
|
-
styles:
|
|
877
|
+
styles: d("")
|
|
865
878
|
}
|
|
866
879
|
}),
|
|
867
880
|
canAcceptBlock: () => !0,
|
|
@@ -882,13 +895,13 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
|
|
|
882
895
|
return t ? w("tr", { ...o, ...l }, t) : /* @__PURE__ */ s(I, {});
|
|
883
896
|
}, Ke = (e) => {
|
|
884
897
|
const { blockProps: o, children: t, content: l, styles: r } = e;
|
|
885
|
-
return !t &&
|
|
898
|
+
return !t && C(l) ? /* @__PURE__ */ s(I, {}) : t ? w("td", { ...o, ...r }, t) : w("td", {
|
|
886
899
|
...o,
|
|
887
900
|
...r,
|
|
888
901
|
dangerouslySetInnerHTML: { __html: l }
|
|
889
902
|
});
|
|
890
903
|
};
|
|
891
|
-
|
|
904
|
+
p(Xe, {
|
|
892
905
|
type: "Table",
|
|
893
906
|
label: "Table",
|
|
894
907
|
category: "core",
|
|
@@ -897,12 +910,12 @@ d(Xe, {
|
|
|
897
910
|
icon: O,
|
|
898
911
|
...u({
|
|
899
912
|
properties: {
|
|
900
|
-
styles:
|
|
913
|
+
styles: d("")
|
|
901
914
|
}
|
|
902
915
|
}),
|
|
903
|
-
blocks:
|
|
916
|
+
blocks: x("Table")
|
|
904
917
|
});
|
|
905
|
-
|
|
918
|
+
p(Je, {
|
|
906
919
|
type: "TableHead",
|
|
907
920
|
label: "Table Head",
|
|
908
921
|
category: "core",
|
|
@@ -911,12 +924,12 @@ d(Je, {
|
|
|
911
924
|
icon: Y,
|
|
912
925
|
...u({
|
|
913
926
|
properties: {
|
|
914
|
-
styles:
|
|
927
|
+
styles: d("")
|
|
915
928
|
}
|
|
916
929
|
}),
|
|
917
|
-
blocks:
|
|
930
|
+
blocks: x("TableHead")
|
|
918
931
|
});
|
|
919
|
-
|
|
932
|
+
p(Qe, {
|
|
920
933
|
type: "TableBody",
|
|
921
934
|
label: "Table Body",
|
|
922
935
|
category: "core",
|
|
@@ -925,12 +938,12 @@ d(Qe, {
|
|
|
925
938
|
icon: W,
|
|
926
939
|
...u({
|
|
927
940
|
properties: {
|
|
928
|
-
styles:
|
|
941
|
+
styles: d("")
|
|
929
942
|
}
|
|
930
943
|
}),
|
|
931
|
-
blocks:
|
|
944
|
+
blocks: x("TableBody")
|
|
932
945
|
});
|
|
933
|
-
|
|
946
|
+
p(Ze, {
|
|
934
947
|
type: "TableRow",
|
|
935
948
|
label: "Table Row",
|
|
936
949
|
category: "core",
|
|
@@ -939,12 +952,12 @@ d(Ze, {
|
|
|
939
952
|
icon: X,
|
|
940
953
|
...u({
|
|
941
954
|
properties: {
|
|
942
|
-
styles:
|
|
955
|
+
styles: d("")
|
|
943
956
|
}
|
|
944
957
|
}),
|
|
945
|
-
blocks:
|
|
958
|
+
blocks: x("TableRow")
|
|
946
959
|
});
|
|
947
|
-
|
|
960
|
+
p(Ke, {
|
|
948
961
|
type: "TableCell",
|
|
949
962
|
label: "Table Cell",
|
|
950
963
|
category: "core",
|
|
@@ -953,7 +966,7 @@ d(Ke, {
|
|
|
953
966
|
icon: J,
|
|
954
967
|
...u({
|
|
955
968
|
properties: {
|
|
956
|
-
styles:
|
|
969
|
+
styles: d(""),
|
|
957
970
|
content: {
|
|
958
971
|
type: "string",
|
|
959
972
|
default: "Heading goes here",
|
|
@@ -962,33 +975,33 @@ d(Ke, {
|
|
|
962
975
|
}
|
|
963
976
|
}
|
|
964
977
|
}),
|
|
965
|
-
blocks:
|
|
978
|
+
blocks: x("TableCell"),
|
|
966
979
|
i18nProps: ["content"],
|
|
967
980
|
aiProps: ["content"]
|
|
968
981
|
});
|
|
969
|
-
function
|
|
982
|
+
function x(e) {
|
|
970
983
|
const o = (n, i) => ({
|
|
971
|
-
_id:
|
|
984
|
+
_id: v(),
|
|
972
985
|
_parent: n,
|
|
973
986
|
_type: "TableCell",
|
|
974
987
|
styles: "#styles:,",
|
|
975
988
|
content: `${e === "TableHead" ? "Table Head" : "Table Cell " + i}`
|
|
976
989
|
}), t = (n) => {
|
|
977
|
-
const i =
|
|
990
|
+
const i = v(), a = {
|
|
978
991
|
_type: "TableRow",
|
|
979
992
|
_id: i,
|
|
980
993
|
styles: "#styles:,border-b"
|
|
981
994
|
};
|
|
982
995
|
return n && (a._parent = n), [a, o(i, "1"), o(i, "2"), o(i, "3")];
|
|
983
996
|
}, l = (n) => {
|
|
984
|
-
const i =
|
|
997
|
+
const i = v(), a = {
|
|
985
998
|
_id: i,
|
|
986
999
|
_type: "TableHead",
|
|
987
1000
|
styles: "#styles:,font-medium"
|
|
988
1001
|
};
|
|
989
1002
|
return n && (a._parent = n), [a, ...t(i)];
|
|
990
1003
|
}, r = (n) => {
|
|
991
|
-
const i =
|
|
1004
|
+
const i = v(), a = {
|
|
992
1005
|
_id: i,
|
|
993
1006
|
_type: "TableBody",
|
|
994
1007
|
styles: "#styles:,"
|
|
@@ -996,7 +1009,7 @@ function B(e) {
|
|
|
996
1009
|
return n && (a._parent = n), [a, ...t(i), ...t(i)];
|
|
997
1010
|
};
|
|
998
1011
|
if (e === "Table") {
|
|
999
|
-
const n =
|
|
1012
|
+
const n = v();
|
|
1000
1013
|
return [
|
|
1001
1014
|
{
|
|
1002
1015
|
_id: n,
|
|
@@ -1011,10 +1024,10 @@ function B(e) {
|
|
|
1011
1024
|
}
|
|
1012
1025
|
const A = (e, ...o) => ({
|
|
1013
1026
|
...e,
|
|
1014
|
-
className:
|
|
1027
|
+
className: B(e.className, ...o)
|
|
1015
1028
|
}), et = (e) => {
|
|
1016
1029
|
const { blockProps: o, icon: t, styles: l, width: r, inBuilder: n, height: i } = e, a = A(l, "");
|
|
1017
|
-
if (
|
|
1030
|
+
if (C(t))
|
|
1018
1031
|
return /* @__PURE__ */ s(I, { inBuilder: n, className: "h-8 w-14" });
|
|
1019
1032
|
const c = t.replace(/<svg /g, '<svg class="w-[inherit] h-[inherit]" ');
|
|
1020
1033
|
return b.createElement("span", {
|
|
@@ -1034,7 +1047,7 @@ const A = (e, ...o) => ({
|
|
|
1034
1047
|
group: "media",
|
|
1035
1048
|
...u({
|
|
1036
1049
|
properties: {
|
|
1037
|
-
styles:
|
|
1050
|
+
styles: d(""),
|
|
1038
1051
|
icon: {
|
|
1039
1052
|
type: "string",
|
|
1040
1053
|
title: "Icon",
|
|
@@ -1055,7 +1068,7 @@ const A = (e, ...o) => ({
|
|
|
1055
1068
|
})
|
|
1056
1069
|
}, ot = (e) => {
|
|
1057
1070
|
const { blockProps: o, image: t, mobileImage: l, styles: r, alt: n, height: i, width: a, lazyLoading: c } = e;
|
|
1058
|
-
return
|
|
1071
|
+
return C(t) ? /* @__PURE__ */ s(I, { className: "h-36" }) : /* @__PURE__ */ f("picture", { children: [
|
|
1059
1072
|
l && /* @__PURE__ */ s("source", { srcSet: l, media: "(max-width: 480px)" }),
|
|
1060
1073
|
/* @__PURE__ */ s(
|
|
1061
1074
|
"img",
|
|
@@ -1079,7 +1092,7 @@ const A = (e, ...o) => ({
|
|
|
1079
1092
|
group: "media",
|
|
1080
1093
|
...u({
|
|
1081
1094
|
properties: {
|
|
1082
|
-
styles:
|
|
1095
|
+
styles: d(""),
|
|
1083
1096
|
image: {
|
|
1084
1097
|
type: "string",
|
|
1085
1098
|
title: "Image",
|
|
@@ -1128,7 +1141,7 @@ const A = (e, ...o) => ({
|
|
|
1128
1141
|
}, rt = (e) => {
|
|
1129
1142
|
const { blockProps: o, link: t, children: l, styles: r, inBuilder: n, content: i } = e;
|
|
1130
1143
|
let a = {};
|
|
1131
|
-
return !l &&
|
|
1144
|
+
return !l && C(i) && (a = { minHeight: "50px", display: "flex", alignItems: "center", justifyContent: "center" }), n ? l ? /* @__PURE__ */ s("span", { ...o, style: a, ...r, children: l }) : w(
|
|
1132
1145
|
"span",
|
|
1133
1146
|
{
|
|
1134
1147
|
...o,
|
|
@@ -1156,7 +1169,7 @@ const A = (e, ...o) => ({
|
|
|
1156
1169
|
group: "basic",
|
|
1157
1170
|
...u({
|
|
1158
1171
|
properties: {
|
|
1159
|
-
styles:
|
|
1172
|
+
styles: d(""),
|
|
1160
1173
|
content: {
|
|
1161
1174
|
type: "string",
|
|
1162
1175
|
default: "Link goes here",
|
|
@@ -1184,8 +1197,8 @@ const A = (e, ...o) => ({
|
|
|
1184
1197
|
i18nProps: ["content"],
|
|
1185
1198
|
canAcceptBlock: (e) => e !== "Link"
|
|
1186
1199
|
}, it = (e) => {
|
|
1187
|
-
const { blockProps: o, children: t, listType: l, styles: r, tag: n, inBuilder: i } = e, a =
|
|
1188
|
-
return !t &&
|
|
1200
|
+
const { blockProps: o, children: t, listType: l, styles: r, tag: n, inBuilder: i } = e, a = B(h(r, "className", ""), l);
|
|
1201
|
+
return !t && C(r == null ? void 0 : r.className) ? /* @__PURE__ */ s(I, { inBuilder: i }) : b.createElement(
|
|
1189
1202
|
n || (l === "list-decimal" ? "ol" : "ul"),
|
|
1190
1203
|
{ ...o, ...r, className: a },
|
|
1191
1204
|
t
|
|
@@ -1199,7 +1212,7 @@ const A = (e, ...o) => ({
|
|
|
1199
1212
|
group: "basic",
|
|
1200
1213
|
...u({
|
|
1201
1214
|
properties: {
|
|
1202
|
-
styles:
|
|
1215
|
+
styles: d(""),
|
|
1203
1216
|
listType: {
|
|
1204
1217
|
type: "string",
|
|
1205
1218
|
title: "List Type",
|
|
@@ -1253,7 +1266,7 @@ const A = (e, ...o) => ({
|
|
|
1253
1266
|
group: "basic",
|
|
1254
1267
|
...u({
|
|
1255
1268
|
properties: {
|
|
1256
|
-
styles:
|
|
1269
|
+
styles: d(""),
|
|
1257
1270
|
content: {
|
|
1258
1271
|
type: "string",
|
|
1259
1272
|
default: "List item",
|
|
@@ -1284,7 +1297,7 @@ const A = (e, ...o) => ({
|
|
|
1284
1297
|
group: "typography",
|
|
1285
1298
|
...u({
|
|
1286
1299
|
properties: {
|
|
1287
|
-
styles:
|
|
1300
|
+
styles: d(""),
|
|
1288
1301
|
content: {
|
|
1289
1302
|
type: "string",
|
|
1290
1303
|
title: "Content",
|
|
@@ -1300,13 +1313,13 @@ const A = (e, ...o) => ({
|
|
|
1300
1313
|
canAcceptBlock: (e) => e === "Span" || e === "Link" || e === "Text"
|
|
1301
1314
|
}, ut = (e) => {
|
|
1302
1315
|
const { blockProps: o, inBuilder: t, children: l, partialBlockId: r } = e;
|
|
1303
|
-
return t && !r ? /* @__PURE__ */
|
|
1316
|
+
return t && !r ? /* @__PURE__ */ f(
|
|
1304
1317
|
"div",
|
|
1305
1318
|
{
|
|
1306
1319
|
className: "flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",
|
|
1307
1320
|
...o,
|
|
1308
1321
|
children: [
|
|
1309
|
-
/* @__PURE__ */
|
|
1322
|
+
/* @__PURE__ */ f("h1", { children: [
|
|
1310
1323
|
"Partial Block - ",
|
|
1311
1324
|
r
|
|
1312
1325
|
] }),
|
|
@@ -1314,11 +1327,11 @@ const A = (e, ...o) => ({
|
|
|
1314
1327
|
]
|
|
1315
1328
|
}
|
|
1316
1329
|
) : b.createElement("span", { ...o }, l);
|
|
1317
|
-
},
|
|
1330
|
+
}, mt = {
|
|
1318
1331
|
type: "PartialBlock",
|
|
1319
1332
|
description: "A partial block component",
|
|
1320
1333
|
label: "Partial Block",
|
|
1321
|
-
icon:
|
|
1334
|
+
icon: $,
|
|
1322
1335
|
category: "core",
|
|
1323
1336
|
group: "basic",
|
|
1324
1337
|
hidden: !0,
|
|
@@ -1375,12 +1388,12 @@ const A = (e, ...o) => ({
|
|
|
1375
1388
|
11: "lg:col-span-11",
|
|
1376
1389
|
12: "lg:col-span-12"
|
|
1377
1390
|
}
|
|
1378
|
-
},
|
|
1391
|
+
}, yt = (e) => {
|
|
1379
1392
|
const { blockProps: o, children: t, styles: l, colSpan: r, tabletColSpan: n, desktopColSpan: i } = e, c = { className: [
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
n ?
|
|
1383
|
-
i ?
|
|
1393
|
+
h(l, "className", ""),
|
|
1394
|
+
h(L, ["SMALL", isNaN(r) || !r ? 6 : r], ""),
|
|
1395
|
+
n ? h(L, ["MEDIUM", n || r], "") : "",
|
|
1396
|
+
i ? h(L, ["LARGE", n || r], "") : ""
|
|
1384
1397
|
].join(" ") };
|
|
1385
1398
|
return /* @__PURE__ */ s("div", { ...o, ...l, ...c, children: t || /* @__PURE__ */ s("div", { className: "h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900" }) });
|
|
1386
1399
|
}, gt = {
|
|
@@ -1396,7 +1409,7 @@ const A = (e, ...o) => ({
|
|
|
1396
1409
|
canBeNested: (e) => e === "Row",
|
|
1397
1410
|
...u({
|
|
1398
1411
|
properties: {
|
|
1399
|
-
styles:
|
|
1412
|
+
styles: d(""),
|
|
1400
1413
|
colSpan: {
|
|
1401
1414
|
type: "number",
|
|
1402
1415
|
title: "Column Span",
|
|
@@ -1420,7 +1433,7 @@ const A = (e, ...o) => ({
|
|
|
1420
1433
|
}
|
|
1421
1434
|
})
|
|
1422
1435
|
}, bt = (e) => {
|
|
1423
|
-
const { blockProps: o, children: t, styles: l, gutter: r } = e, i = { className: [
|
|
1436
|
+
const { blockProps: o, children: t, styles: l, gutter: r } = e, i = { className: [h(l, "className", ""), " grid grid-cols-12"].join() };
|
|
1424
1437
|
return typeof (l == null ? void 0 : l.style) == "object" ? l.style.gap = `${r}px` : i.style = { gap: `${r}px` }, /* @__PURE__ */ s("div", { ...o, ...l, ...i, children: t });
|
|
1425
1438
|
}, ft = {
|
|
1426
1439
|
type: "Row",
|
|
@@ -1438,7 +1451,7 @@ const A = (e, ...o) => ({
|
|
|
1438
1451
|
canAcceptBlock: (e) => e === "Column",
|
|
1439
1452
|
...u({
|
|
1440
1453
|
properties: {
|
|
1441
|
-
styles:
|
|
1454
|
+
styles: d(""),
|
|
1442
1455
|
colCount: {
|
|
1443
1456
|
type: "number",
|
|
1444
1457
|
default: 2,
|
|
@@ -1469,7 +1482,7 @@ const A = (e, ...o) => ({
|
|
|
1469
1482
|
group: "typography",
|
|
1470
1483
|
...u({
|
|
1471
1484
|
properties: {
|
|
1472
|
-
styles:
|
|
1485
|
+
styles: d(""),
|
|
1473
1486
|
content: {
|
|
1474
1487
|
type: "string",
|
|
1475
1488
|
title: "Content",
|
|
@@ -1487,7 +1500,7 @@ const A = (e, ...o) => ({
|
|
|
1487
1500
|
...o,
|
|
1488
1501
|
dangerouslySetInnerHTML: { __html: l || "" }
|
|
1489
1502
|
});
|
|
1490
|
-
},
|
|
1503
|
+
}, vt = {
|
|
1491
1504
|
type: "Span",
|
|
1492
1505
|
description: "A span component",
|
|
1493
1506
|
label: "Span",
|
|
@@ -1495,7 +1508,7 @@ const A = (e, ...o) => ({
|
|
|
1495
1508
|
group: "typography",
|
|
1496
1509
|
...u({
|
|
1497
1510
|
properties: {
|
|
1498
|
-
styles:
|
|
1511
|
+
styles: d(""),
|
|
1499
1512
|
content: {
|
|
1500
1513
|
type: "string",
|
|
1501
1514
|
title: "Content",
|
|
@@ -1507,7 +1520,7 @@ const A = (e, ...o) => ({
|
|
|
1507
1520
|
aiProps: ["content"],
|
|
1508
1521
|
i18nProps: ["content"],
|
|
1509
1522
|
canAcceptBlock: () => !0
|
|
1510
|
-
},
|
|
1523
|
+
}, Ct = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ s("span", { ...e.blockProps, children: e.content }) : `${e.content}`, It = {
|
|
1511
1524
|
type: "Text",
|
|
1512
1525
|
description: "A text component with no styling",
|
|
1513
1526
|
label: "Text",
|
|
@@ -1517,7 +1530,7 @@ const A = (e, ...o) => ({
|
|
|
1517
1530
|
icon: re,
|
|
1518
1531
|
...u({
|
|
1519
1532
|
properties: {
|
|
1520
|
-
styles:
|
|
1533
|
+
styles: d("text-black"),
|
|
1521
1534
|
content: {
|
|
1522
1535
|
title: "Content",
|
|
1523
1536
|
type: "string",
|
|
@@ -1527,7 +1540,7 @@ const A = (e, ...o) => ({
|
|
|
1527
1540
|
}),
|
|
1528
1541
|
aiProps: ["content"],
|
|
1529
1542
|
i18nProps: ["content"]
|
|
1530
|
-
},
|
|
1543
|
+
}, xt = {
|
|
1531
1544
|
type: "object",
|
|
1532
1545
|
title: "Controls",
|
|
1533
1546
|
default: {
|
|
@@ -1558,18 +1571,18 @@ const A = (e, ...o) => ({
|
|
|
1558
1571
|
default: !1
|
|
1559
1572
|
}
|
|
1560
1573
|
}
|
|
1561
|
-
}, _ = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,
|
|
1562
|
-
const t =
|
|
1574
|
+
}, _ = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, T = /(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com\/(?:channels\/[\w]+\/|groups\/[^\/]+\/videos\/|album\/\d+\/video\/|video\/)?|player\.vimeo\.com\/video\/)(\d+)/, Bt = (e, o) => {
|
|
1575
|
+
const t = h(o, "autoplay", !1), l = h(o, "controls", !1), r = h(o, "loop", !1), n = t || h(o, "muted", !0);
|
|
1563
1576
|
if (_.test(e)) {
|
|
1564
1577
|
const i = e.match(_);
|
|
1565
1578
|
if (i) {
|
|
1566
1579
|
const a = i[4];
|
|
1567
|
-
let c = `https://www.youtube.com/embed/${a}`,
|
|
1568
|
-
return
|
|
1580
|
+
let c = `https://www.youtube.com/embed/${a}`, m = t ? "autoplay=1" : "";
|
|
1581
|
+
return m += r ? `&loop=1&playlist=${a}` : "", m += n ? "&mute=1&muted=1" : "", m += l ? "&controls=1" : "&controls=0", `${c}?${m}`;
|
|
1569
1582
|
}
|
|
1570
1583
|
}
|
|
1571
|
-
if (
|
|
1572
|
-
const i = e.match(
|
|
1584
|
+
if (T.test(e)) {
|
|
1585
|
+
const i = e.match(T);
|
|
1573
1586
|
if (i) {
|
|
1574
1587
|
const a = i[1];
|
|
1575
1588
|
let c = "";
|
|
@@ -1578,45 +1591,45 @@ const A = (e, ...o) => ({
|
|
|
1578
1591
|
}
|
|
1579
1592
|
return null;
|
|
1580
1593
|
}, Lt = (e) => {
|
|
1581
|
-
const { url: o, blockProps: t, styles: l, controls: r, videoSource: n, inBuilder: i } = e, a =
|
|
1582
|
-
return /* @__PURE__ */
|
|
1583
|
-
!a && i ? /* @__PURE__ */ s("div", { className: "absolute flex h-full w-full items-center justify-center bg-gray-300 text-center", children:
|
|
1594
|
+
const { url: o, blockProps: t, styles: l, controls: r, videoSource: n, inBuilder: i } = e, a = Bt(o, r);
|
|
1595
|
+
return /* @__PURE__ */ f("div", { ...se(l, "className"), className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
|
|
1596
|
+
!a && i ? /* @__PURE__ */ s("div", { className: "absolute flex h-full w-full items-center justify-center bg-gray-300 text-center", children: C(o) ? `Provided ${n} video link in settings Video URL.` : `Provided ${n} video link is invalid.` }) : /* @__PURE__ */ s("iframe", { width: "100%", src: a, ...ae(l, "className") }),
|
|
1584
1597
|
i && /* @__PURE__ */ s("div", { ...t, className: "absolute top-0 h-full w-full" })
|
|
1585
1598
|
] });
|
|
1586
1599
|
}, Pt = (e) => {
|
|
1587
1600
|
const { url: o, styles: t, controls: l, sources: r, poster: n, blockProps: i } = e;
|
|
1588
1601
|
let a = n;
|
|
1589
|
-
const c = [...
|
|
1602
|
+
const c = [...h(r, "srcsets", []) || []];
|
|
1590
1603
|
o && typeof o == "string" && c.push({ url: o, width: "9999" });
|
|
1591
|
-
const
|
|
1592
|
-
|
|
1593
|
-
const k =
|
|
1594
|
-
return (a || !
|
|
1604
|
+
const m = c.sort((g, y) => parseInt(g.width) - parseInt(y.width)).filter((g) => !C(g.url) && !C(g.width));
|
|
1605
|
+
m.length === 0 && !a && (a = "https://placehold.co/300x200/EEE/ccc?text=Choose%20Video");
|
|
1606
|
+
const k = h(l, "autoplay", !1) || h(l, "muted", !0);
|
|
1607
|
+
return (a || !C(m)) && /* @__PURE__ */ s("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: /* @__PURE__ */ w(
|
|
1595
1608
|
"video",
|
|
1596
1609
|
{
|
|
1597
1610
|
...t,
|
|
1598
1611
|
...i,
|
|
1599
|
-
key: JSON.stringify(
|
|
1600
|
-
controls:
|
|
1601
|
-
autoPlay:
|
|
1602
|
-
loop:
|
|
1612
|
+
key: JSON.stringify(m),
|
|
1613
|
+
controls: h(l, "controls", !1),
|
|
1614
|
+
autoPlay: h(l, "autoplay", !1),
|
|
1615
|
+
loop: h(l, "loop", !1),
|
|
1603
1616
|
poster: a,
|
|
1604
1617
|
...k ? { muted: !0 } : {}
|
|
1605
1618
|
},
|
|
1606
|
-
|
|
1619
|
+
m.map((g) => {
|
|
1607
1620
|
if (!g.url || g.url.length < 4 || isNaN(g.width)) return null;
|
|
1608
|
-
const
|
|
1609
|
-
return /* @__PURE__ */ s("source", { src: g.url, media:
|
|
1621
|
+
const y = `(max-width: ${g.width}px)`;
|
|
1622
|
+
return /* @__PURE__ */ s("source", { src: g.url, media: y, type: g.type }, g.url);
|
|
1610
1623
|
}),
|
|
1611
1624
|
"Your browser does not support the video tag."
|
|
1612
1625
|
) });
|
|
1613
|
-
},
|
|
1626
|
+
}, St = (e) => {
|
|
1614
1627
|
const { videoSource: o } = e;
|
|
1615
|
-
return o === "Custom" ? /* @__PURE__ */ s(Pt, { ...e }) : o === "Youtube" || o === "Vimeo" ? /* @__PURE__ */ s(Lt, { ...e }) : /* @__PURE__ */
|
|
1628
|
+
return o === "Custom" ? /* @__PURE__ */ s(Pt, { ...e }) : o === "Youtube" || o === "Vimeo" ? /* @__PURE__ */ s(Lt, { ...e }) : /* @__PURE__ */ f("div", { children: [
|
|
1616
1629
|
"Invalid video source : ",
|
|
1617
1630
|
o
|
|
1618
1631
|
] });
|
|
1619
|
-
},
|
|
1632
|
+
}, _t = {
|
|
1620
1633
|
type: "Video",
|
|
1621
1634
|
label: "Video",
|
|
1622
1635
|
category: "core",
|
|
@@ -1624,7 +1637,7 @@ const A = (e, ...o) => ({
|
|
|
1624
1637
|
group: "media",
|
|
1625
1638
|
...u({
|
|
1626
1639
|
properties: {
|
|
1627
|
-
styles:
|
|
1640
|
+
styles: d("absolute h-full w-full object-cover"),
|
|
1628
1641
|
videoSource: {
|
|
1629
1642
|
type: "string",
|
|
1630
1643
|
default: "Custom",
|
|
@@ -1655,7 +1668,7 @@ const A = (e, ...o) => ({
|
|
|
1655
1668
|
type: "object",
|
|
1656
1669
|
default: { srcsets: [] }
|
|
1657
1670
|
},
|
|
1658
|
-
controls: { ...
|
|
1671
|
+
controls: { ...xt }
|
|
1659
1672
|
}
|
|
1660
1673
|
}
|
|
1661
1674
|
},
|
|
@@ -1699,22 +1712,51 @@ const A = (e, ...o) => ({
|
|
|
1699
1712
|
}
|
|
1700
1713
|
}),
|
|
1701
1714
|
i18nProps: ["url"]
|
|
1702
|
-
}, Tt = ({
|
|
1715
|
+
}, Tt = ({
|
|
1716
|
+
children: e,
|
|
1717
|
+
tag: o,
|
|
1718
|
+
blockProps: t,
|
|
1719
|
+
styles: l,
|
|
1720
|
+
inBuilder: r,
|
|
1721
|
+
$loading: n
|
|
1722
|
+
}) => {
|
|
1723
|
+
let i = e;
|
|
1724
|
+
return C(i) && r && (i = /* @__PURE__ */ s("div", { className: "col-span-3 flex items-center justify-center bg-orange-50 p-5", children: "No items found" })), b.createElement(
|
|
1725
|
+
o,
|
|
1726
|
+
{ ...t, ...l },
|
|
1727
|
+
n ? Array.from({ length: 2 }).map((a, c) => /* @__PURE__ */ f("div", { className: "animate-pulse rounded-md bg-primary/10 p-5", children: [
|
|
1728
|
+
/* @__PURE__ */ s("div", { className: "h-6 w-1/2 rounded-md bg-primary/10" }),
|
|
1729
|
+
/* @__PURE__ */ s("div", { className: "mt-2 h-4 w-1/2 rounded-md bg-primary/10" })
|
|
1730
|
+
] }, c)) : i
|
|
1731
|
+
);
|
|
1732
|
+
}, Nt = {
|
|
1703
1733
|
type: "Repeater",
|
|
1704
1734
|
label: "Repeater",
|
|
1705
|
-
icon:
|
|
1735
|
+
icon: E,
|
|
1706
1736
|
group: "basic",
|
|
1737
|
+
dataProviderDependencies: ["filter", "sort", "limit", "repeaterItems"],
|
|
1707
1738
|
blocks: () => [
|
|
1708
1739
|
{ _id: "A", _type: "Repeater", tag: "ul" },
|
|
1709
|
-
{ _id: "B", _type: "RepeaterItem", parentTag: "ul", _parent: "A" }
|
|
1740
|
+
{ _id: "B", _name: "Repeater Item", _type: "RepeaterItem", parentTag: "ul", _parent: "A" }
|
|
1741
|
+
// { _id: "C", _name: "Empty State", _type: "RepeaterEmptyState", _parent: "A" },
|
|
1742
|
+
// {
|
|
1743
|
+
// _id: "D",
|
|
1744
|
+
// _name: "Empty State Heading",
|
|
1745
|
+
// _type: "Heading",
|
|
1746
|
+
// _parent: "C",
|
|
1747
|
+
// styles: "#styles:,text-2xl text-center",
|
|
1748
|
+
// content: "No items",
|
|
1749
|
+
// },
|
|
1710
1750
|
],
|
|
1711
1751
|
...u({
|
|
1712
1752
|
properties: {
|
|
1753
|
+
styles: P("grid gap-4 md:grid-cols-2 xl:grid-cols-3"),
|
|
1713
1754
|
repeaterItems: {
|
|
1714
1755
|
title: "Items",
|
|
1715
1756
|
type: "string",
|
|
1716
1757
|
binding: "array",
|
|
1717
|
-
default: ""
|
|
1758
|
+
default: "",
|
|
1759
|
+
ui: { "ui:readonly": !0 }
|
|
1718
1760
|
},
|
|
1719
1761
|
tag: {
|
|
1720
1762
|
title: "Tag",
|
|
@@ -1722,11 +1764,22 @@ const A = (e, ...o) => ({
|
|
|
1722
1764
|
default: "ul",
|
|
1723
1765
|
enum: ["div", "ul", "ol"]
|
|
1724
1766
|
},
|
|
1725
|
-
styles: T(""),
|
|
1726
1767
|
limit: {
|
|
1727
1768
|
title: "Limit",
|
|
1728
1769
|
type: "number",
|
|
1729
|
-
default:
|
|
1770
|
+
default: 3
|
|
1771
|
+
},
|
|
1772
|
+
filter: {
|
|
1773
|
+
title: "Filter by",
|
|
1774
|
+
type: "string",
|
|
1775
|
+
default: "",
|
|
1776
|
+
ui: { "ui:widget": "collectionSelect" }
|
|
1777
|
+
},
|
|
1778
|
+
sort: {
|
|
1779
|
+
title: "Sort by",
|
|
1780
|
+
type: "string",
|
|
1781
|
+
default: "",
|
|
1782
|
+
ui: { "ui:widget": "collectionSelect" }
|
|
1730
1783
|
}
|
|
1731
1784
|
}
|
|
1732
1785
|
})
|
|
@@ -1751,12 +1804,12 @@ const A = (e, ...o) => ({
|
|
|
1751
1804
|
}, Mt = {
|
|
1752
1805
|
type: "RepeaterItem",
|
|
1753
1806
|
label: "Repeater Item",
|
|
1754
|
-
icon:
|
|
1807
|
+
icon: E,
|
|
1755
1808
|
hidden: !0,
|
|
1756
1809
|
group: "basic",
|
|
1757
1810
|
...u({
|
|
1758
1811
|
properties: {
|
|
1759
|
-
styles:
|
|
1812
|
+
styles: P(""),
|
|
1760
1813
|
parentTag: H("Repeater", "tag")
|
|
1761
1814
|
}
|
|
1762
1815
|
}),
|
|
@@ -1764,9 +1817,25 @@ const A = (e, ...o) => ({
|
|
|
1764
1817
|
canDelete: () => !1,
|
|
1765
1818
|
canMove: () => !1,
|
|
1766
1819
|
canDuplicate: () => !1
|
|
1767
|
-
},
|
|
1768
|
-
|
|
1820
|
+
}, Et = ({
|
|
1821
|
+
children: e,
|
|
1822
|
+
blockProps: o,
|
|
1823
|
+
styles: t
|
|
1824
|
+
}) => b.createElement("div", { ...o, ...t }, e), $t = {
|
|
1825
|
+
type: "RepeaterEmptyState",
|
|
1826
|
+
label: "Empty State",
|
|
1827
|
+
hidden: !0,
|
|
1828
|
+
group: "basic",
|
|
1829
|
+
...u({
|
|
1830
|
+
properties: { styles: P("p-5 flex items-center justify-center") }
|
|
1831
|
+
}),
|
|
1832
|
+
canAcceptBlock: () => !0,
|
|
1833
|
+
canDelete: () => !1,
|
|
1834
|
+
canMove: () => !1,
|
|
1835
|
+
canDuplicate: () => !1
|
|
1836
|
+
}, Ft = () => {
|
|
1837
|
+
p(me, ye), p(Be, Le), p(ge, be), p(Ge, Oe), p(pt, dt), p(wt, vt), p(ht, kt), p(rt, nt), p(it, st), p(at, ct), p(et, tt), p(ot, lt), p(St, _t), p(ke, we), p(ve, Ce), p(Ct, It), p(_e, Te), p(Ne, Re), p(Me, Ee), p(Pe, Se), p(He, ze), p(De, je), p(Ve, qe), p($e, Ae), p(Ye, We), p(Ie, xe), p(Fe, Ue), p(ut, mt), p(bt, ft), p(yt, gt), p(fe, he), p(Tt, Nt), p(Rt, Mt), p(Et, $t);
|
|
1769
1838
|
};
|
|
1770
1839
|
export {
|
|
1771
|
-
|
|
1840
|
+
Ft as loadWebBlocks
|
|
1772
1841
|
};
|