@chaibuilder/sdk 1.2.114 → 1.2.116
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -6
- package/dist/CodeEditor-Bl58eelM.cjs +1 -0
- package/dist/CodeEditor-C1ImRmIp.js +77 -0
- package/dist/Topbar-BpMZTZKz.cjs +1 -0
- package/dist/Topbar-tRFEAMbG.js +113 -0
- package/dist/UnsplashImages-BXarNGDE.cjs +1 -0
- package/dist/{UnsplashImages-chQ74Yzq.js → UnsplashImages-Ds_3IihK.js} +38 -90
- package/dist/UploadImages-DPMndPNm.cjs +1 -0
- package/dist/UploadImages-VZ7-y0rA.js +101 -0
- package/dist/cdn.js +25283 -0
- package/dist/{context-menu-FPX89OKr.js → context-menu-BbqLeYFX.js} +1 -1
- package/dist/{context-menu-sQn7ryJ6.cjs → context-menu-DfAXjmc8.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +50 -17
- package/dist/core.js +74 -127
- package/dist/{iconBase-Ief2hJUZ.js → iconBase-DHfFLkem.js} +6 -12
- package/dist/index-B_be_Or7.cjs +63 -0
- package/dist/{index-IZpHf_8d.js → index-Bn53BEJy.js} +1631 -1658
- package/dist/jsx-runtime-BYECrxsp.cjs +30 -0
- package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-DGlMoOmv.js} +241 -242
- package/dist/{plugin-UiUFs2fK.js → plugin-BOEoR5jk.js} +1 -1
- package/dist/{plugin-xOpS-UNV.cjs → plugin-COMQcYlW.cjs} +1 -1
- package/dist/{plugin-f6SDZ_Or.js → plugin-Dw854zFv.js} +7 -8
- package/dist/{plugin-jum1MjXp.cjs → plugin-I9XxF65G.cjs} +1 -1
- package/dist/render.cjs +1 -1
- package/dist/render.js +10 -14
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.js +12 -13
- package/dist/style.css +1 -1
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.js +5 -7
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +3 -6
- package/dist/ui.js +145 -163
- package/dist/web-blocks.cjs +19 -2
- package/dist/web-blocks.js +116 -102
- package/package.json +3 -1
- package/dist/CodeEditor-BWHGysUw.cjs +0 -1
- package/dist/CodeEditor-q9he9IC8.js +0 -129
- package/dist/Topbar-86JxE7Uw.js +0 -163
- package/dist/Topbar-8LnyJF7S.cjs +0 -1
- package/dist/UnsplashImages-MLEjengP.cjs +0 -1
- package/dist/UploadImages--77rHMEx.cjs +0 -1
- package/dist/UploadImages-Auy8ZPBl.js +0 -153
- package/dist/index-KsZZcMSu.cjs +0 -63
- package/dist/jsx-runtime-JYMCiFoE.cjs +0 -27
- /package/dist/{STRINGS-Xxstm-7I.js → STRINGS-eiGM83kj.js} +0 -0
- /package/dist/{STRINGS-Yl7cSWDc.cjs → STRINGS-ew98weUe.cjs} +0 -0
- /package/dist/{controls-p9IwFnPx.cjs → controls-C4n5ycp4.cjs} +0 -0
- /package/dist/{controls-lEwMTdPQ.js → controls-Com-zYCq.js} +0 -0
- /package/dist/{iconBase-aZzpqff_.cjs → iconBase-Cn2BsTrq.cjs} +0 -0
package/dist/ui.js
CHANGED
|
@@ -1,30 +1,12 @@
|
|
|
1
|
-
import { j as o } from "./jsx-runtime-
|
|
1
|
+
import { j as o } from "./jsx-runtime-DGlMoOmv.js";
|
|
2
2
|
import * as n from "react";
|
|
3
3
|
import * as m from "@radix-ui/react-toggle";
|
|
4
4
|
import { cva as c } from "class-variance-authority";
|
|
5
|
-
import { c as r } from "./context-menu-
|
|
6
|
-
import { A as
|
|
5
|
+
import { c as r } from "./context-menu-BbqLeYFX.js";
|
|
6
|
+
import { A as te, f as oe, d as se, e as re, i as ne, p as de, q as ie, k as le, o as ce, m as me, l as ue, n as pe, j as fe, g as ge, B as xe, C as be, F as he, E as Ce, y as ye, x as Ne, z as ve, ar as we, as as Se, av as Me, aw as je, at as De, ax as Te, au as Re, az as Ie, ay as Ae, aA as ke, aE as Pe, aC as ze, aJ as Ge, aD as Le, aG as He, aK as Ve, aO as Fe, aF as Be, aH as Oe, aI as Ee, aL as qe, aM as Je, aN as Ke, aB as _e, D as Qe, s as Ue, w as We, u as Xe, t as Ye, v as Ze, r as $e, a6 as ea, aa, a8 as ta, af as oa, a9 as sa, ac as ra, ag as na, ak as da, ab as ia, ad as la, ae as ca, ah as ma, ai as ua, aj as pa, a7 as fa, X as ga, Z as xa, Y as ba, I as ha, L as Ca, U as ya, W as Na, V as va, S as wa, G as Sa, _ as Ma, a2 as ja, $ as Da, a4 as Ta, a3 as Ra, a5 as Ia, a1 as Aa, a0 as ka, al as Pa, aq as za, a as Ga, H as La, M as Ha, J as Va, K as Fa, T as Ba, ap as Oa, N as Ea, P as qa, R as Ja, Q as Ka, O as _a, h as Qa, b as Ua, am as Wa, ao as Xa, an as Ya } from "./context-menu-BbqLeYFX.js";
|
|
7
7
|
import { ChevronRightIcon as g, CheckIcon as x, DotFilledIcon as b, Cross2Icon as h } from "@radix-ui/react-icons";
|
|
8
8
|
import * as s from "@radix-ui/react-menubar";
|
|
9
|
-
import * as
|
|
10
|
-
import "@radix-ui/react-switch";
|
|
11
|
-
import "@radix-ui/react-accordion";
|
|
12
|
-
import "@radix-ui/react-alert-dialog";
|
|
13
|
-
import "@radix-ui/react-slot";
|
|
14
|
-
import "@radix-ui/react-label";
|
|
15
|
-
import "@radix-ui/react-scroll-area";
|
|
16
|
-
import "@radix-ui/react-tabs";
|
|
17
|
-
import "@radix-ui/react-tooltip";
|
|
18
|
-
import "@radix-ui/react-popover";
|
|
19
|
-
import "@radix-ui/react-hover-card";
|
|
20
|
-
import "@radix-ui/react-select";
|
|
21
|
-
import "@radix-ui/react-dropdown-menu";
|
|
22
|
-
import "@radix-ui/react-separator";
|
|
23
|
-
import "@radix-ui/react-toast";
|
|
24
|
-
import "cmdk";
|
|
25
|
-
import "@radix-ui/react-context-menu";
|
|
26
|
-
import "clsx";
|
|
27
|
-
import "tailwind-merge";
|
|
9
|
+
import * as i from "@radix-ui/react-dialog";
|
|
28
10
|
const C = c(
|
|
29
11
|
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
|
|
30
12
|
{
|
|
@@ -44,7 +26,7 @@ const C = c(
|
|
|
44
26
|
size: "default"
|
|
45
27
|
}
|
|
46
28
|
}
|
|
47
|
-
), y = n.forwardRef(({ className: e, variant: a, size: t, ...
|
|
29
|
+
), y = n.forwardRef(({ className: e, variant: a, size: t, ...d }, l) => /* @__PURE__ */ o.jsx(m.Root, { ref: l, className: r(C({ variant: a, size: t, className: e })), ...d }));
|
|
48
30
|
y.displayName = m.Root.displayName;
|
|
49
31
|
const N = c(
|
|
50
32
|
"relative w-full rounded-lg border px-4 py-3 text-sm [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
|
@@ -59,7 +41,7 @@ const N = c(
|
|
|
59
41
|
variant: "default"
|
|
60
42
|
}
|
|
61
43
|
}
|
|
62
|
-
), v = n.forwardRef(({ className: e, variant: a, ...t },
|
|
44
|
+
), v = n.forwardRef(({ className: e, variant: a, ...t }, d) => /* @__PURE__ */ o.jsx("div", { ref: d, role: "alert", className: r(N({ variant: a }), e), ...t }));
|
|
63
45
|
v.displayName = "Alert";
|
|
64
46
|
const w = n.forwardRef(
|
|
65
47
|
({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx("h5", { ref: t, className: r("mb-1 font-medium leading-none tracking-tight", e), ...a })
|
|
@@ -69,7 +51,7 @@ const S = n.forwardRef(
|
|
|
69
51
|
({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx("div", { ref: t, className: r("text-sm [&_p]:leading-relaxed", e), ...a })
|
|
70
52
|
);
|
|
71
53
|
S.displayName = "AlertDescription";
|
|
72
|
-
const
|
|
54
|
+
const _ = s.Menu, Q = s.Group, U = s.Portal, W = s.Sub, X = s.RadioGroup, M = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx(
|
|
73
55
|
s.Root,
|
|
74
56
|
{
|
|
75
57
|
ref: t,
|
|
@@ -90,7 +72,7 @@ const j = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx(
|
|
|
90
72
|
}
|
|
91
73
|
));
|
|
92
74
|
j.displayName = s.Trigger.displayName;
|
|
93
|
-
const D = n.forwardRef(({ className: e, inset: a, children: t, ...
|
|
75
|
+
const D = n.forwardRef(({ className: e, inset: a, children: t, ...d }, l) => /* @__PURE__ */ o.jsxs(
|
|
94
76
|
s.SubTrigger,
|
|
95
77
|
{
|
|
96
78
|
ref: l,
|
|
@@ -99,7 +81,7 @@ const D = n.forwardRef(({ className: e, inset: a, children: t, ...i }, l) => /*
|
|
|
99
81
|
a && "pl-8",
|
|
100
82
|
e
|
|
101
83
|
),
|
|
102
|
-
...
|
|
84
|
+
...d,
|
|
103
85
|
children: [
|
|
104
86
|
t,
|
|
105
87
|
/* @__PURE__ */ o.jsx(g, { className: "ml-auto h-4 w-4" })
|
|
@@ -119,13 +101,13 @@ const T = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx(
|
|
|
119
101
|
}
|
|
120
102
|
));
|
|
121
103
|
T.displayName = s.SubContent.displayName;
|
|
122
|
-
const R = n.forwardRef(({ className: e, align: a = "start", alignOffset: t = -4, sideOffset:
|
|
104
|
+
const R = n.forwardRef(({ className: e, align: a = "start", alignOffset: t = -4, sideOffset: d = 8, ...l }, f) => /* @__PURE__ */ o.jsx(s.Portal, { children: /* @__PURE__ */ o.jsx(
|
|
123
105
|
s.Content,
|
|
124
106
|
{
|
|
125
107
|
ref: f,
|
|
126
108
|
align: a,
|
|
127
109
|
alignOffset: t,
|
|
128
|
-
sideOffset:
|
|
110
|
+
sideOffset: d,
|
|
129
111
|
className: r(
|
|
130
112
|
"z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
131
113
|
e
|
|
@@ -134,10 +116,10 @@ const R = n.forwardRef(({ className: e, align: a = "start", alignOffset: t = -4,
|
|
|
134
116
|
}
|
|
135
117
|
) }));
|
|
136
118
|
R.displayName = s.Content.displayName;
|
|
137
|
-
const I = n.forwardRef(({ className: e, inset: a, ...t },
|
|
119
|
+
const I = n.forwardRef(({ className: e, inset: a, ...t }, d) => /* @__PURE__ */ o.jsx(
|
|
138
120
|
s.Item,
|
|
139
121
|
{
|
|
140
|
-
ref:
|
|
122
|
+
ref: d,
|
|
141
123
|
className: r(
|
|
142
124
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
143
125
|
a && "pl-8",
|
|
@@ -147,7 +129,7 @@ const I = n.forwardRef(({ className: e, inset: a, ...t }, i) => /* @__PURE__ */
|
|
|
147
129
|
}
|
|
148
130
|
));
|
|
149
131
|
I.displayName = s.Item.displayName;
|
|
150
|
-
const A = n.forwardRef(({ className: e, children: a, checked: t, ...
|
|
132
|
+
const A = n.forwardRef(({ className: e, children: a, checked: t, ...d }, l) => /* @__PURE__ */ o.jsxs(
|
|
151
133
|
s.CheckboxItem,
|
|
152
134
|
{
|
|
153
135
|
ref: l,
|
|
@@ -156,7 +138,7 @@ const A = n.forwardRef(({ className: e, children: a, checked: t, ...i }, l) => /
|
|
|
156
138
|
e
|
|
157
139
|
),
|
|
158
140
|
checked: t,
|
|
159
|
-
...
|
|
141
|
+
...d,
|
|
160
142
|
children: [
|
|
161
143
|
/* @__PURE__ */ o.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o.jsx(s.ItemIndicator, { children: /* @__PURE__ */ o.jsx(x, { className: "h-4 w-4" }) }) }),
|
|
162
144
|
a
|
|
@@ -164,10 +146,10 @@ const A = n.forwardRef(({ className: e, children: a, checked: t, ...i }, l) => /
|
|
|
164
146
|
}
|
|
165
147
|
));
|
|
166
148
|
A.displayName = s.CheckboxItem.displayName;
|
|
167
|
-
const k = n.forwardRef(({ className: e, children: a, ...t },
|
|
149
|
+
const k = n.forwardRef(({ className: e, children: a, ...t }, d) => /* @__PURE__ */ o.jsxs(
|
|
168
150
|
s.RadioItem,
|
|
169
151
|
{
|
|
170
|
-
ref:
|
|
152
|
+
ref: d,
|
|
171
153
|
className: r(
|
|
172
154
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
173
155
|
e
|
|
@@ -180,10 +162,10 @@ const k = n.forwardRef(({ className: e, children: a, ...t }, i) => /* @__PURE__
|
|
|
180
162
|
}
|
|
181
163
|
));
|
|
182
164
|
k.displayName = s.RadioItem.displayName;
|
|
183
|
-
const P = n.forwardRef(({ className: e, inset: a, ...t },
|
|
165
|
+
const P = n.forwardRef(({ className: e, inset: a, ...t }, d) => /* @__PURE__ */ o.jsx(
|
|
184
166
|
s.Label,
|
|
185
167
|
{
|
|
186
|
-
ref:
|
|
168
|
+
ref: d,
|
|
187
169
|
className: r("px-2 py-1.5 text-sm font-semibold", a && "pl-8", e),
|
|
188
170
|
...t
|
|
189
171
|
}
|
|
@@ -193,10 +175,10 @@ const z = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx(s.Se
|
|
|
193
175
|
z.displayName = s.Separator.displayName;
|
|
194
176
|
const G = ({ className: e, ...a }) => /* @__PURE__ */ o.jsx("span", { className: r("ml-auto text-xs tracking-widest text-muted-foreground", e), ...a });
|
|
195
177
|
G.displayname = "MenubarShortcut";
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
const
|
|
199
|
-
|
|
178
|
+
const Y = i.Root, Z = i.Trigger, $ = i.Close, u = ({ className: e, ...a }) => /* @__PURE__ */ o.jsx(i.Portal, { className: r(e), ...a });
|
|
179
|
+
u.displayName = i.Portal.displayName;
|
|
180
|
+
const p = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx(
|
|
181
|
+
i.Overlay,
|
|
200
182
|
{
|
|
201
183
|
className: r(
|
|
202
184
|
"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
@@ -206,7 +188,7 @@ const u = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx(
|
|
|
206
188
|
ref: t
|
|
207
189
|
}
|
|
208
190
|
));
|
|
209
|
-
|
|
191
|
+
p.displayName = i.Overlay.displayName;
|
|
210
192
|
const L = c(
|
|
211
193
|
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
212
194
|
{
|
|
@@ -223,158 +205,158 @@ const L = c(
|
|
|
223
205
|
}
|
|
224
206
|
}
|
|
225
207
|
), H = n.forwardRef(
|
|
226
|
-
({ side: e = "right", className: a, children: t, ...
|
|
227
|
-
/* @__PURE__ */ o.jsx(
|
|
228
|
-
/* @__PURE__ */ o.jsxs(
|
|
208
|
+
({ side: e = "right", className: a, children: t, ...d }, l) => /* @__PURE__ */ o.jsxs(u, { children: [
|
|
209
|
+
/* @__PURE__ */ o.jsx(p, {}),
|
|
210
|
+
/* @__PURE__ */ o.jsxs(i.Content, { ref: l, className: r(L({ side: e }), a), ...d, children: [
|
|
229
211
|
t,
|
|
230
|
-
/* @__PURE__ */ o.jsxs(
|
|
212
|
+
/* @__PURE__ */ o.jsxs(i.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
231
213
|
/* @__PURE__ */ o.jsx(h, { className: "h-4 w-4" }),
|
|
232
214
|
/* @__PURE__ */ o.jsx("span", { className: "sr-only", children: "Close" })
|
|
233
215
|
] })
|
|
234
216
|
] })
|
|
235
217
|
] })
|
|
236
218
|
);
|
|
237
|
-
H.displayName =
|
|
219
|
+
H.displayName = i.Content.displayName;
|
|
238
220
|
const V = ({ className: e, ...a }) => /* @__PURE__ */ o.jsx("div", { className: r("flex flex-col space-y-2 text-center sm:text-left", e), ...a });
|
|
239
221
|
V.displayName = "SheetHeader";
|
|
240
222
|
const F = ({ className: e, ...a }) => /* @__PURE__ */ o.jsx("div", { className: r("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...a });
|
|
241
223
|
F.displayName = "SheetFooter";
|
|
242
|
-
const B = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx(
|
|
243
|
-
B.displayName =
|
|
244
|
-
const O = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx(
|
|
245
|
-
O.displayName =
|
|
224
|
+
const B = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx(i.Title, { ref: t, className: r("text-lg font-semibold text-foreground", e), ...a }));
|
|
225
|
+
B.displayName = i.Title.displayName;
|
|
226
|
+
const O = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx(i.Description, { ref: t, className: r("text-sm text-muted-foreground", e), ...a }));
|
|
227
|
+
O.displayName = i.Description.displayName;
|
|
246
228
|
export {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
229
|
+
te as Accordion,
|
|
230
|
+
oe as AccordionContent,
|
|
231
|
+
se as AccordionItem,
|
|
232
|
+
re as AccordionTrigger,
|
|
251
233
|
v as Alert,
|
|
252
234
|
S as AlertDescription,
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
235
|
+
ne as AlertDialog,
|
|
236
|
+
de as AlertDialogAction,
|
|
237
|
+
ie as AlertDialogCancel,
|
|
238
|
+
le as AlertDialogContent,
|
|
239
|
+
ce as AlertDialogDescription,
|
|
240
|
+
me as AlertDialogFooter,
|
|
241
|
+
ue as AlertDialogHeader,
|
|
242
|
+
pe as AlertDialogTitle,
|
|
243
|
+
fe as AlertDialogTrigger,
|
|
262
244
|
w as AlertTitle,
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
245
|
+
ge as Badge,
|
|
246
|
+
xe as Button,
|
|
247
|
+
be as Card,
|
|
248
|
+
he as CardContent,
|
|
249
|
+
Ce as CardDescription,
|
|
250
|
+
ye as CardFooter,
|
|
251
|
+
Ne as CardHeader,
|
|
252
|
+
ve as CardTitle,
|
|
253
|
+
we as Command,
|
|
254
|
+
Se as CommandDialog,
|
|
255
|
+
Me as CommandEmpty,
|
|
256
|
+
je as CommandGroup,
|
|
257
|
+
De as CommandInput,
|
|
258
|
+
Te as CommandItem,
|
|
259
|
+
Re as CommandList,
|
|
260
|
+
Ie as CommandSeparator,
|
|
261
|
+
Ae as CommandShortcut,
|
|
262
|
+
ke as ContextMenu,
|
|
263
|
+
Pe as ContextMenuCheckboxItem,
|
|
264
|
+
ze as ContextMenuContent,
|
|
265
|
+
Ge as ContextMenuGroup,
|
|
266
|
+
Le as ContextMenuItem,
|
|
267
|
+
He as ContextMenuLabel,
|
|
268
|
+
Ve as ContextMenuPortal,
|
|
269
|
+
Fe as ContextMenuRadioGroup,
|
|
270
|
+
Be as ContextMenuRadioItem,
|
|
271
|
+
Oe as ContextMenuSeparator,
|
|
272
|
+
Ee as ContextMenuShortcut,
|
|
273
|
+
qe as ContextMenuSub,
|
|
274
|
+
Je as ContextMenuSubContent,
|
|
275
|
+
Ke as ContextMenuSubTrigger,
|
|
276
|
+
_e as ContextMenuTrigger,
|
|
277
|
+
Qe as Dialog,
|
|
278
|
+
Ue as DialogContent,
|
|
279
|
+
We as DialogDescription,
|
|
280
|
+
Xe as DialogFooter,
|
|
281
|
+
Ye as DialogHeader,
|
|
282
|
+
Ze as DialogTitle,
|
|
283
|
+
$e as DialogTrigger,
|
|
284
|
+
ea as DropdownMenu,
|
|
285
|
+
aa as DropdownMenuCheckboxItem,
|
|
286
|
+
ta as DropdownMenuContent,
|
|
287
|
+
oa as DropdownMenuGroup,
|
|
288
|
+
sa as DropdownMenuItem,
|
|
289
|
+
ra as DropdownMenuLabel,
|
|
290
|
+
na as DropdownMenuPortal,
|
|
291
|
+
da as DropdownMenuRadioGroup,
|
|
292
|
+
ia as DropdownMenuRadioItem,
|
|
293
|
+
la as DropdownMenuSeparator,
|
|
294
|
+
ca as DropdownMenuShortcut,
|
|
295
|
+
ma as DropdownMenuSub,
|
|
296
|
+
ua as DropdownMenuSubContent,
|
|
297
|
+
pa as DropdownMenuSubTrigger,
|
|
298
|
+
fa as DropdownMenuTrigger,
|
|
299
|
+
ga as HoverCard,
|
|
300
|
+
xa as HoverCardContent,
|
|
301
|
+
ba as HoverCardTrigger,
|
|
302
|
+
ha as Input,
|
|
303
|
+
Ca as Label,
|
|
322
304
|
M as Menubar,
|
|
323
305
|
A as MenubarCheckboxItem,
|
|
324
306
|
R as MenubarContent,
|
|
325
|
-
|
|
307
|
+
Q as MenubarGroup,
|
|
326
308
|
I as MenubarItem,
|
|
327
309
|
P as MenubarLabel,
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
310
|
+
_ as MenubarMenu,
|
|
311
|
+
U as MenubarPortal,
|
|
312
|
+
X as MenubarRadioGroup,
|
|
331
313
|
k as MenubarRadioItem,
|
|
332
314
|
z as MenubarSeparator,
|
|
333
315
|
G as MenubarShortcut,
|
|
334
|
-
|
|
316
|
+
W as MenubarSub,
|
|
335
317
|
T as MenubarSubContent,
|
|
336
318
|
D as MenubarSubTrigger,
|
|
337
319
|
j as MenubarTrigger,
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
320
|
+
ya as Popover,
|
|
321
|
+
Na as PopoverContent,
|
|
322
|
+
va as PopoverTrigger,
|
|
323
|
+
wa as ScrollArea,
|
|
324
|
+
Sa as ScrollBar,
|
|
325
|
+
Ma as Select,
|
|
326
|
+
ja as SelectContent,
|
|
327
|
+
Da as SelectGroup,
|
|
328
|
+
Ta as SelectItem,
|
|
329
|
+
Ra as SelectLabel,
|
|
330
|
+
Ia as SelectSeparator,
|
|
331
|
+
Aa as SelectTrigger,
|
|
332
|
+
ka as SelectValue,
|
|
333
|
+
Pa as Separator,
|
|
334
|
+
Y as Sheet,
|
|
335
|
+
$ as SheetClose,
|
|
354
336
|
H as SheetContent,
|
|
355
337
|
O as SheetDescription,
|
|
356
338
|
F as SheetFooter,
|
|
357
339
|
V as SheetHeader,
|
|
358
340
|
B as SheetTitle,
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
341
|
+
Z as SheetTrigger,
|
|
342
|
+
za as Skeleton,
|
|
343
|
+
Ga as Switch,
|
|
344
|
+
La as Tabs,
|
|
345
|
+
Ha as TabsContent,
|
|
346
|
+
Va as TabsList,
|
|
347
|
+
Fa as TabsTrigger,
|
|
348
|
+
Ba as Textarea,
|
|
349
|
+
Oa as Toaster,
|
|
368
350
|
y as Toggle,
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
351
|
+
Ea as Tooltip,
|
|
352
|
+
qa as TooltipContent,
|
|
353
|
+
Ja as TooltipPortal,
|
|
354
|
+
Ka as TooltipProvider,
|
|
355
|
+
_a as TooltipTrigger,
|
|
356
|
+
Qa as badgeVariants,
|
|
357
|
+
Ua as buttonVariants,
|
|
358
|
+
Wa as reducer,
|
|
359
|
+
Xa as toast,
|
|
378
360
|
C as toggleVariants,
|
|
379
|
-
|
|
361
|
+
Ya as useToast
|
|
380
362
|
};
|
package/dist/web-blocks.cjs
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@chaibuilder/runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@chaibuilder/runtime"),n=require("./jsx-runtime-BYECrxsp.cjs"),E=require("react"),t=require("./controls-C4n5ycp4.cjs"),y=require("./iconBase-Cn2BsTrq.cjs"),g=require("@radix-ui/react-icons"),h=require("lodash-es"),C=require("lucide-react");function I(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const s=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(o,l,s.get?s:{enumerable:!0,get:()=>e[l]})}}return o.default=e,Object.freeze(o)}const m=I(E),w=({className:e="",inBuilder:o})=>o?n.jsxRuntimeExports.jsx("div",{className:y.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",e),children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:n.jsxRuntimeExports.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,R=e=>{const{blockProps:o,inBuilder:l,backgroundImage:s,children:r,tag:a="div",styles:i}=e;let c=r;r||(c=n.jsxRuntimeExports.jsx(w,{inBuilder:l}));let u={};return s&&(u={backgroundImage:`url(${s})`}),m.createElement(a,{...o,...i,style:u},c)},L={type:"Box",label:"web_blocks.box",category:"core",group:"basic",props:{styles:t.T({default:""}),tag:t.y({title:"web_blocks.tag",default:"div",options:[{value:"div",title:"web_blocks.div"},{value:"header",title:"web_blocks.header"},{value:"footer",title:"web_blocks.footer"},{value:"section",title:"web_blocks.section"},{value:"article",title:"web_blocks.article"},{value:"aside",title:"web_blocks.aside"},{value:"main",title:"web_blocks.main"},{value:"nav",title:"web_blocks.nav"},{value:"figure",title:"web_blocks.figure"},{value:"details",title:"web_blocks.details"},{value:"summary",title:"web_blocks.summary"},{value:"dialog",title:"web_blocks.dialog"},{value:"strike",title:"web_blocks.strike"},{value:"caption",title:"web_blocks.caption"},{value:"legend",title:"web_blocks.legend"},{value:"figcaption",title:"web_blocks.figcaption"},{value:"mark",title:"web_blocks.mark"}]}),backgroundImage:t.x({title:"web_blocks.background_image"})},canAcceptBlock:()=>!0},S=e=>{const{blockProps:o,iconSize:l,icon:s,content:r,iconPos:a,styles:i,children:c}=e,u=s,d=c||n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:r}),u&&n.jsxRuntimeExports.jsx("div",{style:{width:l+"px"},className:a+" "+(a==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:u}})]});return m.createElement("button",{...o,...i,type:"button"},d)},T={type:"Button",label:"web_blocks.button",category:"core",icon:g.ButtonIcon,group:"basic",props:{content:t.g({title:"web_blocks.label",default:"Button",ai:!0,i18n:!0}),styles:t.T({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:t.q({title:"web_blocks.icon",default:""}),iconSize:t.s({title:"web_blocks.icon_size",default:24}),iconPos:t.y({title:"web_blocks.icon_position",default:"order-last",options:[{title:"web_blocks.start",value:"order-first"},{title:"web_blocks.end",value:"order-last"}]})}},M=e=>{const{blockProps:o,styles:l,htmlCode:s,inBuilder:r}=e;return r?n.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r?n.jsxRuntimeExports.jsx("div",{...o,...l,className:"absolute z-20 h-full w-full"}):null,m.createElement("div",{...l,dangerouslySetInnerHTML:{__html:s.replace(/<script.*?>.*?<\/script>/g,"")}})]}):m.createElement("div",{...o,...l,dangerouslySetInnerHTML:{__html:s}})},$={type:"CustomHTML",label:"web_blocks.custom_html",category:"core",icon:g.CodeIcon,group:"advanced",props:{styles:t.T({default:""}),htmlCode:t.l({title:"web_blocks.html_code",default:"<div><p>Enter your HTML code here...</p></div>",placeholder:"web_blocks.placeholder"})}},P=m.memo(e=>{const{blockProps:o,styles:l,backgroundImage:s}=e;let r={};return s&&(r={backgroundImage:`url(${s})`}),m.createElement("div",{...o,...l,style:r})}),N={type:"EmptyBox",label:"web_blocks.empty_box",category:"core",group:"basic",props:{styles:t.T({default:""}),backgroundImage:t.x({title:"Background Image"})}},q=e=>{const{blockProps:o,styles:l,content:s,level:r="h1",children:a=null}=e;return a?m.createElement(r,{...l,...o},a):m.createElement(r,{...l,...o,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}})},H={type:"Heading",label:"web_blocks.heading",category:"core",icon:g.HeadingIcon,group:"typography",props:{level:t.y({title:"web_blocks.level",default:"h2",binding:!1,options:[{value:"h1",title:"h1"},{value:"h2",title:"h2"},{value:"h3",title:"h3"},{value:"h4",title:"h4"},{value:"h5",title:"h5"},{value:"h6",title:"h6"}]}),styles:t.T({default:"text-3xl"}),content:t.f({title:"Content",default:"Heading goes here",ai:!0,i18n:!0})},canAcceptBlock:e=>e==="Span"||e==="Text"},D=e=>{const{blockProps:o,styles:l,content:s}=e;return h.isNull(e.children)?m.createElement("p",{...l,...o,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}}):m.createElement("p",{...l,...o},e.children)},z={type:"Paragraph",label:"Paragraph",category:"core",icon:g.TextIcon,group:"typography",props:{styles:t.T({default:""}),content:t.f({title:"Content",default:`Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.
|
|
2
2
|
Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus
|
|
3
|
-
nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.`,ai:!0,i18n:!0})},canAcceptBlock:e=>e==="Span"||e==="Link"||e==="Text"},U=e=>{const{blockProps:o,styles:l,content:s,children:r=null,tag:n}=e;return r?m.createElement("span",{...l,...o},r):m.createElement(n||"span",{...l,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:s||""}})},F={type:"Span",label:"Span",category:"core",group:"typography",props:{styles:t.T({default:""}),content:t.f({title:"Content",default:"",ai:!0,i18n:!0})},canAcceptBlock:()=>!0},O=e=>{const{blockProps:o,content:l,styles:s}=e;return i.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:i.jsxRuntimeExports.jsx("div",{"data-ai-key":"content","data-ai-type":"richtext",...o,...s,dangerouslySetInnerHTML:{__html:l}})})},V={type:"RichText",label:"Rich Text",category:"core",icon:g.CursorTextIcon,group:"typography",props:{styles:t.T({default:""}),content:t.m({title:"Content",ai:!0,i18n:!0,default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}},G=e=>{const{blockProps:o,link:l,children:s,styles:r,inBuilder:n,content:a}=e;let c={};return!s&&h.isEmpty(a)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),n?s?i.jsxRuntimeExports.jsx("span",{...o,style:c,...r,children:s}):m.createElement("span",{...o,...r,style:c,"data-ai-key":"content"},a):s?i.jsxRuntimeExports.jsx("a",{href:(l==null?void 0:l.href)||"#/",target:l==null?void 0:l.target,...o,...r,children:s}):m.createElement("a",{...o,...r,"data-ai-key":"content",href:(l==null?void 0:l.href)||"#",target:(l==null?void 0:l.target)||"_self"},a)},W={type:"Link",label:"Link",category:"core",icon:g.Link1Icon,group:"basic",props:{styles:t.T({default:""}),content:t.g({title:"Content",default:"",ai:!0,i18n:!0}),link:t.w({title:"Link",default:{type:"collection",target:"_self",href:""}})},canAcceptBlock:e=>e!=="Link"},B=(e,...o)=>({...e,className:y.cn(e.className,...o)}),X=e=>{const{blockProps:o,children:l,styles:s,inBuilder:r,content:n,href:a}=e,{hrefType:c,autoplay:u,maxWidth:d,backdropColor:f,galleryName:b}=e,x=B(s,"cb-lightbox");if(!l&&h.isEmpty(s==null?void 0:s.className)&&h.isEmpty(n))return i.jsxRuntimeExports.jsx(w,{inBuilder:r});if(r)return l?i.jsxRuntimeExports.jsx("span",{...o,...x,children:l}):m.createElement("span",{...o,...x,dangerouslySetInnerHTML:{__html:n}});const k={};return k["data-vbtype"]=c,u&&(k["data-autoplay"]="true"),d&&(k["data-maxwidth"]=d+"px"),f&&(k["data-overlay"]=f),b&&(k["data-gall"]=b),l?i.jsxRuntimeExports.jsx("a",{...k,href:a||"#/",...o,...x,children:l}):m.createElement("a",{...o,...x,...k,href:a||"#",dangerouslySetInnerHTML:{__html:n}})},Y={type:"LightBoxLink",label:"Lightbox Link",category:"core",icon:g.ImageIcon,group:"basic",props:{styles:t.T({default:""}),content:t.g({title:"Content",default:"Link text or drop blocks inside",ai:!0,i18n:!0}),href:t.g({title:"Href",default:""}),hrefType:t.y({title:"Type",default:"video",options:[{value:"video",title:"Video"},{value:"iframe",title:"Iframe"},{value:"inline",title:"Inline"},{value:"ajax",title:"Ajax"}]}),autoplay:t.c({title:"Autoplay",default:!1}),maxWidth:t.s({title:"Max Width",default:""}),backdropColor:t.g({title:"Backdrop Color",default:""}),galleryName:t.g({title:"Gallery Name",default:""})},canAcceptBlock:e=>e!=="Link"&&e!=="LightBoxLink"},Z=e=>{const{blockProps:o,children:l,listType:s,styles:r,tag:n,inBuilder:a}=e,c=y.cn(h.get(r,"className",""),s);return!l&&h.isEmpty(r==null?void 0:r.className)?i.jsxRuntimeExports.jsx(w,{inBuilder:a}):m.createElement(n||(s==="list-decimal"?"ol":"ul"),{...o,...r,className:c},l)},J={type:"List",label:"web_blocks.list",icon:g.RowsIcon,category:"core",group:"basic",props:{styles:t.T({default:""}),listType:t.y({title:"web_blocks.list_type",default:"list-none",options:[{value:"list-none",title:"web_blocks.none"},{value:"list-disc",title:"web_blocks.disc"},{value:"list-decimal",title:"web_blocks.number"}]})},canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",listType:"list-none",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]},K=e=>{const{blockProps:o,content:l,styles:s,children:r,tag:n}=e;return r?m.createElement(n||"li",{...s,...o},r):m.createElement(n||"li",{...s,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:l}})},Q={type:"ListItem",label:"List Item",icon:g.ColumnsIcon,category:"core",group:"basic",props:{styles:t.T({default:""}),content:t.f({title:"Content",default:"List item",ai:!0,i18n:!0})},canAcceptBlock:e=>e!=="ListItem",canBeNested:e=>e==="List"},ee=e=>{const{blockProps:o,icon:l,styles:s,width:r,inBuilder:n,height:a}=e,c=B(s,y.cn(r?`w-[${r}px]`:"",a?`h-[${a}px]`:""));if(h.isEmpty(l))return i.jsxRuntimeExports.jsx(w,{inBuilder:n,className:"h-8 w-14"});const u=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return m.createElement("span",{...o,...c,dangerouslySetInnerHTML:{__html:u}})},te={type:"Icon",label:"web_blocks.icon",category:"core",icon:g.SketchLogoIcon,group:"media",props:{styles:t.T({default:"text-black"}),icon:t.q({title:"web_blocks.icon",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>'}),width:t.s({title:"web_blocks.width",default:""}),height:t.s({title:"web_blocks.height",default:""})}},le=e=>{const{blockProps:o,image:l,styles:s,alt:r,height:n,width:a,lazyLoading:c}=e;return h.isEmpty(l)?i.jsxRuntimeExports.jsx(w,{className:"h-36"}):m.createElement("img",{...o,...s,src:l,alt:r,loading:c?"lazy":"eager",height:n,width:a})},oe={type:"Image",label:"Image",category:"core",icon:g.ImageIcon,group:"media",props:{styles:t.T({default:""}),image:t.x({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:t.g({title:"Alt text",default:"",ai:!0,i18n:!0}),width:t.g({title:"Width",default:""}),height:t.g({title:"Height",default:""}),lazyLoading:t.c({title:"Lazy Load",default:!0})}},v=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,_=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,j=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,se=e=>{if(v.test(e)){const o=e.match(v);return o?`https://www.youtube.com/embed/${o[4]}`:e}if(_.test(e)){const o=e.match(_);return o?`https://player.vimeo.com/video/${o[3]}`:e}if(j.test(e)){const o=e.match(j);return o?`https://www.dailymotion.com/embed/video/${o[4]}`:e}return null},re=m.memo(e=>{const{blockProps:o,inBuilder:l,styles:s,url:r,controls:n}=e,a=h.get(n,"autoPlay",!1),c=h.get(n,"controls",!1),u=a||h.get(n,"muted",!0),d=h.get(n,"loop",!1);if(h.isEmpty(r))return i.jsxRuntimeExports.jsx(w,{inBuilder:l,className:"h-36"});let f=se(r),b=null;if(f){if(!h.isEmpty(f)){const x=[];x.push(`autoplay=${a?1:0}`),x.push(`controls=${n?1:0}`),x.push(`mute=${u?1:0}&muted=${u?1:0}`),x.push(`loop=${d?1:0}`),f=`${f}?${x.join("&")}`}b=m.createElement("iframe",{...o,className:"absolute inset-0 w-full h-full",src:f,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else b=m.createElement("video",{...o,className:"absolute inset-0 w-full h-full",src:r,controls:c,muted:u,autoPlay:l?!1:a,loop:d});return i.jsxRuntimeExports.jsx("div",{...h.pick(s,["className"]),children:i.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?i.jsxRuntimeExports.jsx("div",{...o,...h.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,b]})})}),ie={type:"Video",label:"Video",category:"core",icon:g.VideoIcon,group:"media",props:{styles:t.T({default:""}),url:t.g({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann",i18n:!0}),controls:t.b({title:"Controls",properties:{autoPlay:t.c({title:"Autoplay",default:!0}),controls:t.c({title:"Controls",default:!1}),loop:t.c({title:"Loop",default:!1}),muted:t.c({title:"Muted",default:!0})}})}};function ne(e){return y.GenIcon({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)}const ae=e=>{const{scripts:o,inBuilder:l,blockProps:s}=e;return l?i.jsxRuntimeExports.jsx("div",{...s,children:i.jsxRuntimeExports.jsx("div",{className:y.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:i.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:i.jsxRuntimeExports.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"})})})}):i.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},ce={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:ne,group:"advanced",props:{scripts:t.l({title:"Script",default:"",placeholder:"<script>console.log('Hello, world!');<\/script>"})}},ue=e=>{const{blockProps:o,styles:l}=e;return m.createElement("hr",{...l,...o})},de={type:"Divider",label:"web_blocks.divider",category:"core",icon:g.DividerHorizontalIcon,group:"basic",props:{styles:t.T({default:"bg-gray-900 h-0.5 py-2 my-1"})}},pe=()=>null,me={type:"Dark Mode",label:"web_blocks.dark_mode",category:"core",icon:g.MoonIcon,group:"advanced",props:{},blocks:()=>[{_id:"ultqCh",_type:"Span",tag:"span",styles:"#styles:,",_name:"Dark Mode Switcher"},{_id:"vroabi",_parent:"ultqCh",_type:"Button",styles_attrs:{type:"button","x-on:click":"darkMode = 'dark'","x-show":"darkMode === 'light'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Dark Mode Btn"},{_id:"eweibk",_parent:"vroabi",_type:"Span",tag:"span",styles:"#styles:,group inline-flex shrink-0 justify-center items-center size-9"},{_id:"nltBrv",_parent:"eweibk",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'></path></svg>"},{_id:"gesydi",_parent:"ultqCh",_type:"Button",styles_attrs:{type:"button","x-on:click":"darkMode = 'light'","x-show":"darkMode === 'dark'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Light Mode Btn"},{_id:"sgbhDo",_parent:"gesydi",_type:"Span",tag:"span",styles:"#styles:,group inline-flex shrink-0 justify-center items-center size-9"},{_id:"AdDwBC",_parent:"sgbhDo",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'></circle><path d='M12 2v2'></path><path d='M12 20v2'></path><path d='m4.93 4.93 1.41 1.41'></path><path d='m17.66 17.66 1.41 1.41'></path><path d='M2 12h2'></path><path d='M20 12h2'></path><path d='m6.34 17.66-1.41 1.41'></path><path d='m19.07 4.93-1.41 1.41'></path></svg>"}]},ge=e=>{const{blockProps:o,inBuilder:l,children:s,globalBlock:r}=e;return l&&!r?i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...o,children:[i.jsxRuntimeExports.jsxs("h1",{children:["Global Block - ",r]}),i.jsxRuntimeExports.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):m.createElement("div",{...o},s)},be={type:"GlobalBlock",label:"Global Block",icon:C.GlobeIcon,category:"core",group:"advanced",props:{globalBlock:t.g({title:"global block",default:"",hidden:!0})}},he=e=>e.inBuilder||e.forceWrapper?i.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",...e.blockProps,children:e.content}):`${e.content}`,fe={type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:g.SpaceBetweenVerticallyIcon,props:{content:t.f({title:"Content",default:"",ai:!0,i18n:!0})}},ye=e=>{const{blockProps:o,backgroundImage:l,children:s,styles:r}=e;let n={};return l&&(n={backgroundImage:`url(${l})`}),m.createElement("div",{...o,...r,style:n},s)},xe={type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:t.T({default:"font-body antialiased"}),backgroundImage:t.x({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},ke=e=>{const{blockProps:o,styles:l}=e;return m.createElement("br",{...o,...l})},we={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:g.SpaceBetweenVerticallyIcon,props:{styles:t.T({default:""})}},ve=e=>{const{blockProps:o,errorMessage:l,name:s,_type:r,successMessage:n,action:a,styles:c,children:u}=e;let d=u;u||(d=i.jsxRuntimeExports.jsx(w,{}));const f={"x-data":"{}","x-on:submit.prevent":"post"},b={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return i.jsxRuntimeExports.jsxs("form",{...f,"data-error":l,"data-success":n,method:"post",action:a,...o,...c,children:[i.jsxRuntimeExports.jsx("div",{...b}),i.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||r}),d]})},_e={type:"Form",label:"Form",category:"core",icon:g.GroupIcon,group:"form",props:{styles:t.T({default:""}),action:t.g({title:"Submit URL",default:"/api/form/submit"}),errorMessage:t.m({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:t.m({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0},je=e=>{const{blockProps:o,inBuilder:l,label:s,styles:r,inputStyles:n,icon:a,iconPos:c}=e,u=y.generateUUID(),d={"x-bind:disabled":"formLoading"};return i.jsxRuntimeExports.jsxs("button",{id:u,...d,...n,...r,...o||{},type:l?"button":"submit",children:[s,a&&i.jsxRuntimeExports.jsx("span",{className:c,dangerouslySetInnerHTML:{__html:a}})]})},Be={type:"FormButton",label:"Submit Button",category:"core",icon:g.ButtonIcon,group:"form",props:{label:t.g({title:"Label",default:"Submit",ai:!0,i18n:!0}),styles:t.T({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:t.q({title:"Icon",default:""}),iconPos:t.y({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}},Ee=e=>{const{blockProps:o,label:l,placeholder:s,styles:r,inputStyles:n,showLabel:a,required:c,inputType:u="text",inBuilder:d,fieldName:f}=e,b=y.generateUUID();return!a||u==="submit"?(u==="submit"&&(o.value=l),i.jsxRuntimeExports.jsx("input",{id:b,name:f,readOnly:d,...o,...n,...r,type:u,placeholder:s,required:c})):i.jsxRuntimeExports.jsxs("div",{...r,...o,children:[a&&i.jsxRuntimeExports.jsx("label",{htmlFor:b,children:l}),i.jsxRuntimeExports.jsx("input",{name:f,readOnly:d,...n,id:b,type:u,placeholder:s,required:c})]})},Ce={type:"Input",label:"Input",category:"core",icon:g.InputIcon,group:"form",props:{styles:t.T({default:""}),fieldName:t.g({title:"Field Name",default:"input"}),inputType:t.y({title:"Type",options:h.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],e=>({value:e,title:e})),default:"text"}),value:t.g({title:"Value",default:"",ai:!0,i18n:!0}),showLabel:t.c({title:"Show Label",default:!0}),inputStyles:t.T({default:"w-full p-1"}),label:t.g({title:"Label",default:"Label",ai:!0,i18n:!0}),placeholder:t.g({title:"Placeholder",default:"Placeholder"}),required:t.c({title:"Required",default:!1})}},Ie=e=>{const{blockProps:o,fieldName:l,label:s,styles:r,inputStyles:n,checked:a,required:c,showLabel:u=!0}=e,d=y.generateUUID();return u?i.jsxRuntimeExports.jsxs("div",{...r,...o,children:[i.jsxRuntimeExports.jsx("input",{...n,name:l,id:d,type:"radio",required:c,defaultChecked:a}),s&&i.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s})]}):i.jsxRuntimeExports.jsx("input",{id:d,...o,...n,...r,type:"radio",required:c,checked:a,name:l})},Re={type:"Radio",label:"web_blocks.radio",category:"core",icon:g.RadiobuttonIcon,group:"form",props:{styles:t.T({default:"flex items-center w-max gap-x-2"}),fieldName:t.g({title:"web_blocks.field_name",default:"radio"}),label:t.g({title:"web_blocks.label",default:"Label"}),checked:t.c({title:"web_blocks.checked",default:!1}),required:t.c({title:"web_blocks.required",default:!1})}},Le=e=>{const{blockProps:o,fieldName:l,label:s,placeholder:r,styles:n,inputStyles:a,required:c,showLabel:u,_multiple:d=!1}=e,f=y.generateUUID();return u?i.jsxRuntimeExports.jsxs("div",{...n,children:[u&&i.jsxRuntimeExports.jsx("label",{htmlFor:f,children:s}),i.jsxRuntimeExports.jsxs("select",{...a,id:f,required:c,multiple:d,name:l,children:[i.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(e.options,b=>i.jsxRuntimeExports.jsx("option",{selected:h.get(b,"selected",!1),value:b.value,dangerouslySetInnerHTML:{__html:b.label}},b.value))]})]}):i.jsxRuntimeExports.jsxs("select",{id:f,...n,...o,required:c,multiple:d,name:l,children:[i.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(e.options,b=>i.jsxRuntimeExports.jsx("option",{selected:h.get(b,"selected",!1),value:b.value,dangerouslySetInnerHTML:{__html:b.label}},b.value))]})},Se={type:"Select",label:"web_blocks.select",category:"core",icon:g.DropdownMenuIcon,group:"form",props:{styles:t.T({default:""}),fieldName:t.g({title:"Field Name",default:"select"}),showLabel:t.c({title:"Show Label",default:!0}),inputStyles:t.T({default:"w-full p-1"}),label:t.g({title:"Label",default:"Label",ai:!0,i18n:!0}),placeholder:t.g({title:"Placeholder",default:"Placeholder"}),required:t.c({title:"Required",default:!1}),_multiple:t.c({title:"Multiple",default:!1}),options:t.S({title:"Options",itemProperties:{label:t.g({title:"Label",default:"",ai:!0,i18n:!0}),value:t.g({title:"Value",default:""})}})}},Te=e=>{const{blockProps:o,fieldName:l,label:s,placeholder:r,styles:n,inputStyles:a,_rows:c,showLabel:u}=e,d=y.generateUUID();return u?i.jsxRuntimeExports.jsxs("div",{...n,...o,children:[u&&i.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s}),i.jsxRuntimeExports.jsx("textarea",{name:l,...a,id:d,placeholder:r,rows:c})]}):i.jsxRuntimeExports.jsx("textarea",{id:d,name:l,...o,...a,...n,placeholder:r,rows:c})},Me={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:g.InputIcon,group:"form",props:{fieldName:t.g({title:"Field Name",default:"textarea"}),showLabel:t.c({title:"Show Label",default:!0}),styles:t.T({default:""}),inputStyles:t.T({default:"w-full p-1"}),label:t.g({title:"Label",default:"Label",ai:!0,i18n:!0}),placeholder:t.g({title:"Placeholder",default:"Placeholder"}),_rows:t.s({title:"Rows",default:3})}},Pe=e=>{const{blockProps:o,fieldName:l,label:s,styles:r,inputStyles:n,required:a,checked:c,showLabel:u=!0}=e,d=y.generateUUID();return u?i.jsxRuntimeExports.jsxs("div",{...r,...o,children:[i.jsxRuntimeExports.jsx("input",{...n,name:l,id:d,type:"checkbox",required:a,defaultChecked:c}),s&&s!=="Label"&&i.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s})]}):i.jsxRuntimeExports.jsx("input",{id:d,...o,...n,...r,type:"checkbox",required:a,name:l})},Ne={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:g.CheckboxIcon,group:"form",props:{fieldName:t.g({title:"Field Name",default:"checkbox"}),styles:t.T({default:"flex items-center gap-x-2"}),label:t.g({title:"web_blocks.label",default:"Label"}),checked:t.c({title:"web_blocks.checked",default:!1}),required:t.c({title:"web_blocks.required",default:!1})}},$e=()=>{p.registerChaiBlock(L,S),p.registerChaiBlock($,q),p.registerChaiBlock(T,M),p.registerChaiBlock(H,z),p.registerChaiBlock(D,A),p.registerChaiBlock(U,F),p.registerChaiBlock(O,V),p.registerChaiBlock(G,W),p.registerChaiBlock(X,Y),p.registerChaiBlock(Z,J),p.registerChaiBlock(K,Q),p.registerChaiBlock(ee,te),p.registerChaiBlock(le,oe),p.registerChaiBlock(re,ie),p.registerChaiBlock(P,N),p.registerChaiBlock(he,fe),p.registerChaiBlock(ve,_e),p.registerChaiBlock(je,Be),p.registerChaiBlock(Ee,Ce),p.registerChaiBlock(Pe,Ne),p.registerChaiBlock(Ie,Re),p.registerChaiBlock(Le,Se),p.registerChaiBlock(Te,Me),p.registerChaiBlock(ke,we),p.registerChaiBlock(ye,xe),p.registerChaiBlock(ae,ce),p.registerChaiBlock(ue,de),p.registerChaiBlock(pe,me),p.registerChaiBlock(ge,be)};exports.loadWebBlocks=$e;
|
|
3
|
+
nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.`,ai:!0,i18n:!0})},canAcceptBlock:e=>e==="Span"||e==="Link"||e==="Text"},A=e=>{const{blockProps:o,styles:l,content:s,children:r=null,tag:a}=e;return r?m.createElement("span",{...l,...o},r):m.createElement(a||"span",{...l,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:s||""}})},U={type:"Span",label:"Span",category:"core",group:"typography",props:{styles:t.T({default:""}),content:t.f({title:"Content",default:"",ai:!0,i18n:!0})},canAcceptBlock:()=>!0},F=e=>{const{blockProps:o,content:l,styles:s}=e;return n.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:n.jsxRuntimeExports.jsx("div",{"data-ai-key":"content","data-ai-type":"richtext",...o,...s,dangerouslySetInnerHTML:{__html:l}})})},O={type:"RichText",label:"Rich Text",category:"core",icon:g.CursorTextIcon,group:"typography",props:{styles:t.T({default:""}),content:t.m({title:"Content",ai:!0,i18n:!0,default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}},V=e=>{const{blockProps:o,link:l,children:s,styles:r,inBuilder:a,content:i}=e;let c={};return!s&&h.isEmpty(i)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),a?s?n.jsxRuntimeExports.jsx("span",{...o,style:c,...r,children:s}):m.createElement("span",{...o,...r,style:c,"data-ai-key":"content"},i):s?n.jsxRuntimeExports.jsx("a",{href:(l==null?void 0:l.href)||"#/",target:l==null?void 0:l.target,...o,...r,children:s}):m.createElement("a",{...o,...r,"data-ai-key":"content",href:(l==null?void 0:l.href)||"#",target:(l==null?void 0:l.target)||"_self"},i)},G={type:"Link",label:"Link",category:"core",icon:g.Link1Icon,group:"basic",props:{styles:t.T({default:""}),content:t.g({title:"Content",default:"",ai:!0,i18n:!0}),link:t.w({title:"Link",default:{type:"collection",target:"_self",href:""}})},canAcceptBlock:e=>e!=="Link"},B=(e,...o)=>({...e,className:y.cn(e.className,...o)}),W=e=>{const{blockProps:o,children:l,styles:s,inBuilder:r,content:a,href:i}=e,{hrefType:c,autoplay:u,maxWidth:d,backdropColor:f,galleryName:b}=e,x=B(s,"cb-lightbox");if(!l&&h.isEmpty(s==null?void 0:s.className)&&h.isEmpty(a))return n.jsxRuntimeExports.jsx(w,{inBuilder:r});if(r)return l?n.jsxRuntimeExports.jsx("span",{...o,...x,children:l}):m.createElement("span",{...o,...x,dangerouslySetInnerHTML:{__html:a}});const k={};return k["data-vbtype"]=c,u&&(k["data-autoplay"]="true"),d&&(k["data-maxwidth"]=d+"px"),f&&(k["data-overlay"]=f),b&&(k["data-gall"]=b),l?n.jsxRuntimeExports.jsx("a",{...k,href:i||"#/",...o,...x,children:l}):m.createElement("a",{...o,...x,...k,href:i||"#",dangerouslySetInnerHTML:{__html:a}})},X={type:"LightBoxLink",label:"Lightbox Link",category:"core",icon:g.ImageIcon,group:"basic",props:{styles:t.T({default:""}),content:t.g({title:"Content",default:"Link text or drop blocks inside",ai:!0,i18n:!0}),href:t.g({title:"Href",default:""}),hrefType:t.y({title:"Type",default:"video",options:[{value:"video",title:"Video"},{value:"iframe",title:"Iframe"},{value:"inline",title:"Inline"},{value:"ajax",title:"Ajax"}]}),autoplay:t.c({title:"Autoplay",default:!1}),maxWidth:t.s({title:"Max Width",default:""}),backdropColor:t.g({title:"Backdrop Color",default:""}),galleryName:t.g({title:"Gallery Name",default:""})},canAcceptBlock:e=>e!=="Link"&&e!=="LightBoxLink"},Y=e=>{const{blockProps:o,children:l,listType:s,styles:r,tag:a,inBuilder:i}=e,c=y.cn(h.get(r,"className",""),s);return!l&&h.isEmpty(r==null?void 0:r.className)?n.jsxRuntimeExports.jsx(w,{inBuilder:i}):m.createElement(a||(s==="list-decimal"?"ol":"ul"),{...o,...r,className:c},l)},Z={type:"List",label:"web_blocks.list",icon:g.RowsIcon,category:"core",group:"basic",props:{styles:t.T({default:""}),listType:t.y({title:"web_blocks.list_type",default:"list-none",options:[{value:"list-none",title:"web_blocks.none"},{value:"list-disc",title:"web_blocks.disc"},{value:"list-decimal",title:"web_blocks.number"}]})},canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",listType:"list-none",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]},J=e=>{const{blockProps:o,content:l,styles:s,children:r,tag:a}=e;return r?m.createElement(a||"li",{...s,...o},r):m.createElement(a||"li",{...s,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:l}})},K={type:"ListItem",label:"List Item",icon:g.ColumnsIcon,category:"core",group:"basic",props:{styles:t.T({default:""}),content:t.f({title:"Content",default:"List item",ai:!0,i18n:!0})},canAcceptBlock:e=>e!=="ListItem",canBeNested:e=>e==="List"},Q=e=>{const{blockProps:o,icon:l,styles:s,width:r,inBuilder:a,height:i}=e,c=B(s,y.cn(r?`w-[${r}px]`:"",i?`h-[${i}px]`:""));if(h.isEmpty(l))return n.jsxRuntimeExports.jsx(w,{inBuilder:a,className:"h-8 w-14"});const u=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return m.createElement("span",{...o,...c,dangerouslySetInnerHTML:{__html:u}})},ee={type:"Icon",label:"web_blocks.icon",category:"core",icon:g.SketchLogoIcon,group:"media",props:{styles:t.T({default:"text-black"}),icon:t.q({title:"web_blocks.icon",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>'}),width:t.s({title:"web_blocks.width",default:""}),height:t.s({title:"web_blocks.height",default:""})}},te=e=>{const{blockProps:o,image:l,styles:s,alt:r,height:a,width:i,lazyLoading:c}=e;return h.isEmpty(l)?n.jsxRuntimeExports.jsx(w,{className:"h-36"}):m.createElement("img",{...o,...s,src:l,alt:r,loading:c?"lazy":"eager",height:a,width:i})},le={type:"Image",label:"Image",category:"core",icon:g.ImageIcon,group:"media",props:{styles:t.T({default:""}),image:t.x({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:t.g({title:"Alt text",default:"",ai:!0,i18n:!0}),width:t.g({title:"Width",default:""}),height:t.g({title:"Height",default:""}),lazyLoading:t.c({title:"Lazy Load",default:!0})}},v=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,_=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,j=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,oe=e=>{if(v.test(e)){const o=e.match(v);return o?`https://www.youtube.com/embed/${o[4]}`:e}if(_.test(e)){const o=e.match(_);return o?`https://player.vimeo.com/video/${o[3]}`:e}if(j.test(e)){const o=e.match(j);return o?`https://www.dailymotion.com/embed/video/${o[4]}`:e}return null},se=m.memo(e=>{const{blockProps:o,inBuilder:l,styles:s,url:r,controls:a}=e,i=h.get(a,"autoPlay",!1),c=h.get(a,"controls",!1),u=i||h.get(a,"muted",!0),d=h.get(a,"loop",!1);if(h.isEmpty(r))return n.jsxRuntimeExports.jsx(w,{inBuilder:l,className:"h-36"});let f=oe(r),b=null;if(f){if(!h.isEmpty(f)){const x=[];x.push(`autoplay=${i?1:0}`),x.push(`controls=${a?1:0}`),x.push(`mute=${u?1:0}&muted=${u?1:0}`),x.push(`loop=${d?1:0}`),f=`${f}?${x.join("&")}`}b=m.createElement("iframe",{...o,className:"absolute inset-0 w-full h-full",src:f,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else b=m.createElement("video",{...o,className:"absolute inset-0 w-full h-full",src:r,controls:c,muted:u,autoPlay:l?!1:i,loop:d});return n.jsxRuntimeExports.jsx("div",{...h.pick(s,["className"]),children:n.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?n.jsxRuntimeExports.jsx("div",{...o,...h.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,b]})})}),re={type:"Video",label:"Video",category:"core",icon:g.VideoIcon,group:"media",props:{styles:t.T({default:""}),url:t.g({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann",i18n:!0}),controls:t.b({title:"Controls",properties:{autoPlay:t.c({title:"Autoplay",default:!0}),controls:t.c({title:"Controls",default:!1}),loop:t.c({title:"Loop",default:!1}),muted:t.c({title:"Muted",default:!0})}})}};function ne(e){return y.GenIcon({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)}const ae=e=>{const{scripts:o,inBuilder:l,blockProps:s}=e;return l?n.jsxRuntimeExports.jsx("div",{...s,children:n.jsxRuntimeExports.jsx("div",{className:y.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:n.jsxRuntimeExports.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"})})})}):n.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},ie={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:ne,group:"advanced",props:{scripts:t.l({title:"Script",default:"",placeholder:"<script>console.log('Hello, world!');<\/script>"})}},ce=e=>{const{blockProps:o,styles:l}=e;return m.createElement("hr",{...l,...o})},ue={type:"Divider",label:"web_blocks.divider",category:"core",icon:g.DividerHorizontalIcon,group:"basic",props:{styles:t.T({default:"bg-gray-900 h-0.5 py-2 my-1"})}},de=()=>null,pe={type:"Dark Mode",label:"web_blocks.dark_mode",category:"core",icon:g.MoonIcon,group:"advanced",props:{},blocks:()=>[{_id:"ultqCh",_type:"Span",tag:"span",styles:"#styles:,",_name:"Dark Mode Switcher"},{_id:"vroabi",_parent:"ultqCh",_type:"Button",styles_attrs:{type:"button","x-on:click":"darkMode = 'dark'","x-show":"darkMode === 'light'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Dark Mode Btn"},{_id:"eweibk",_parent:"vroabi",_type:"Span",tag:"span",styles:"#styles:,group inline-flex shrink-0 justify-center items-center size-9"},{_id:"nltBrv",_parent:"eweibk",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'></path></svg>"},{_id:"gesydi",_parent:"ultqCh",_type:"Button",styles_attrs:{type:"button","x-on:click":"darkMode = 'light'","x-show":"darkMode === 'dark'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Light Mode Btn"},{_id:"sgbhDo",_parent:"gesydi",_type:"Span",tag:"span",styles:"#styles:,group inline-flex shrink-0 justify-center items-center size-9"},{_id:"AdDwBC",_parent:"sgbhDo",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'></circle><path d='M12 2v2'></path><path d='M12 20v2'></path><path d='m4.93 4.93 1.41 1.41'></path><path d='m17.66 17.66 1.41 1.41'></path><path d='M2 12h2'></path><path d='M20 12h2'></path><path d='m6.34 17.66-1.41 1.41'></path><path d='m19.07 4.93-1.41 1.41'></path></svg>"}]},me=e=>{const{blockProps:o,inBuilder:l,children:s,globalBlock:r}=e;return l&&!r?n.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...o,children:[n.jsxRuntimeExports.jsxs("h1",{children:["Global Block - ",r]}),n.jsxRuntimeExports.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):m.createElement("div",{...o},s)},ge={type:"GlobalBlock",label:"Global Block",icon:C.GlobeIcon,category:"core",group:"advanced",props:{globalBlock:t.g({title:"global block",default:"",hidden:!0})}},be=e=>e.inBuilder||e.forceWrapper?n.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",...e.blockProps,children:e.content}):`${e.content}`,he={type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:g.SpaceBetweenVerticallyIcon,props:{content:t.f({title:"Content",default:"",ai:!0,i18n:!0})}},fe=e=>{const{blockProps:o,backgroundImage:l,children:s,styles:r}=e;let a={};return l&&(a={backgroundImage:`url(${l})`}),m.createElement("div",{...o,...r,style:a},s)},ye={type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:t.T({default:"font-body antialiased"}),backgroundImage:t.x({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},xe=e=>{const{blockProps:o,styles:l}=e;return m.createElement("br",{...o,...l})},ke={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:g.SpaceBetweenVerticallyIcon,props:{styles:t.T({default:""})}},we=e=>{const{blockProps:o,errorMessage:l,name:s,_type:r,successMessage:a,action:i,styles:c,children:u}=e;let d=u;u||(d=n.jsxRuntimeExports.jsx(w,{}));const f={"x-data":`{
|
|
4
|
+
formStatus: '',
|
|
5
|
+
async post() {
|
|
6
|
+
try {
|
|
7
|
+
const formData = new FormData($el);
|
|
8
|
+
const response = await fetch($el.action, {
|
|
9
|
+
method: $el.method,
|
|
10
|
+
body: formData
|
|
11
|
+
});
|
|
12
|
+
if (!response.ok) throw new Error();
|
|
13
|
+
this.formStatus = 'SUCCESS';
|
|
14
|
+
$el.querySelector('[x-html]').innerHTML = $el.dataset.success;
|
|
15
|
+
} catch (error) {
|
|
16
|
+
this.formStatus = 'ERROR';
|
|
17
|
+
$el.querySelector('[x-html]').innerHTML = $el.dataset.error;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}`,"x-on:submit.prevent":"post"},b={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return n.jsxRuntimeExports.jsxs("form",{...f,"data-error":l,"data-success":a,method:"post",action:i,...o,...c,children:[n.jsxRuntimeExports.jsx("div",{...b}),n.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||r}),d]})},ve={type:"Form",label:"Form",category:"core",icon:g.GroupIcon,group:"form",props:{styles:t.T({default:""}),action:t.g({title:"Submit URL",default:"/api/form/submit"}),errorMessage:t.m({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:t.m({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0},_e=e=>{const{blockProps:o,inBuilder:l,label:s,styles:r,inputStyles:a,icon:i,iconPos:c}=e,u=y.generateUUID(),d={"x-bind:disabled":"formLoading"};return n.jsxRuntimeExports.jsxs("button",{id:u,...d,...a,...r,...o||{},type:l?"button":"submit",children:[s,i&&n.jsxRuntimeExports.jsx("span",{className:c,dangerouslySetInnerHTML:{__html:i}})]})},je={type:"FormButton",label:"Submit Button",category:"core",icon:g.ButtonIcon,group:"form",props:{label:t.g({title:"Label",default:"Submit",ai:!0,i18n:!0}),styles:t.T({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:t.q({title:"Icon",default:""}),iconPos:t.y({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}},Be=e=>{const{blockProps:o,label:l,placeholder:s,styles:r,inputStyles:a,showLabel:i,required:c,inputType:u="text",inBuilder:d,fieldName:f}=e,b=y.generateUUID();return!i||u==="submit"?(u==="submit"&&(o.value=l),n.jsxRuntimeExports.jsx("input",{id:b,name:f,readOnly:d,...o,...a,...r,type:u,placeholder:s,required:c})):n.jsxRuntimeExports.jsxs("div",{...r,...o,children:[i&&n.jsxRuntimeExports.jsx("label",{htmlFor:b,children:l}),n.jsxRuntimeExports.jsx("input",{name:f,readOnly:d,...a,id:b,type:u,placeholder:s,required:c})]})},Ee={type:"Input",label:"Input",category:"core",icon:g.InputIcon,group:"form",props:{styles:t.T({default:""}),fieldName:t.g({title:"Field Name",default:"input"}),inputType:t.y({title:"Type",options:h.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],e=>({value:e,title:e})),default:"text"}),value:t.g({title:"Value",default:"",ai:!0,i18n:!0}),showLabel:t.c({title:"Show Label",default:!0}),inputStyles:t.T({default:"w-full p-1"}),label:t.g({title:"Label",default:"Label",ai:!0,i18n:!0}),placeholder:t.g({title:"Placeholder",default:"Placeholder"}),required:t.c({title:"Required",default:!1})}},Ce=e=>{const{blockProps:o,fieldName:l,label:s,styles:r,inputStyles:a,checked:i,required:c,showLabel:u=!0}=e,d=y.generateUUID();return u?n.jsxRuntimeExports.jsxs("div",{...r,...o,children:[n.jsxRuntimeExports.jsx("input",{...a,name:l,id:d,type:"radio",required:c,defaultChecked:i}),s&&n.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:d,...o,...a,...r,type:"radio",required:c,checked:i,name:l})},Ie={type:"Radio",label:"web_blocks.radio",category:"core",icon:g.RadiobuttonIcon,group:"form",props:{styles:t.T({default:"flex items-center w-max gap-x-2"}),fieldName:t.g({title:"web_blocks.field_name",default:"radio"}),label:t.g({title:"web_blocks.label",default:"Label"}),checked:t.c({title:"web_blocks.checked",default:!1}),required:t.c({title:"web_blocks.required",default:!1})}},Re=e=>{const{blockProps:o,fieldName:l,label:s,placeholder:r,styles:a,inputStyles:i,required:c,showLabel:u,_multiple:d=!1}=e,f=y.generateUUID();return u?n.jsxRuntimeExports.jsxs("div",{...a,children:[u&&n.jsxRuntimeExports.jsx("label",{htmlFor:f,children:s}),n.jsxRuntimeExports.jsxs("select",{...i,id:f,required:c,multiple:d,name:l,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(e.options,b=>n.jsxRuntimeExports.jsx("option",{selected:h.get(b,"selected",!1),value:b.value,dangerouslySetInnerHTML:{__html:b.label}},b.value))]})]}):n.jsxRuntimeExports.jsxs("select",{id:f,...a,...o,required:c,multiple:d,name:l,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(e.options,b=>n.jsxRuntimeExports.jsx("option",{selected:h.get(b,"selected",!1),value:b.value,dangerouslySetInnerHTML:{__html:b.label}},b.value))]})},Le={type:"Select",label:"web_blocks.select",category:"core",icon:g.DropdownMenuIcon,group:"form",props:{styles:t.T({default:""}),fieldName:t.g({title:"Field Name",default:"select"}),showLabel:t.c({title:"Show Label",default:!0}),inputStyles:t.T({default:"w-full p-1"}),label:t.g({title:"Label",default:"Label",ai:!0,i18n:!0}),placeholder:t.g({title:"Placeholder",default:"Placeholder"}),required:t.c({title:"Required",default:!1}),_multiple:t.c({title:"Multiple",default:!1}),options:t.S({title:"Options",itemProperties:{label:t.g({title:"Label",default:"",ai:!0,i18n:!0}),value:t.g({title:"Value",default:""})}})}},Se=e=>{const{blockProps:o,fieldName:l,label:s,placeholder:r,styles:a,inputStyles:i,_rows:c,showLabel:u}=e,d=y.generateUUID();return u?n.jsxRuntimeExports.jsxs("div",{...a,...o,children:[u&&n.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s}),n.jsxRuntimeExports.jsx("textarea",{name:l,...i,id:d,placeholder:r,rows:c})]}):n.jsxRuntimeExports.jsx("textarea",{id:d,name:l,...o,...i,...a,placeholder:r,rows:c})},Te={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:g.InputIcon,group:"form",props:{fieldName:t.g({title:"Field Name",default:"textarea"}),showLabel:t.c({title:"Show Label",default:!0}),styles:t.T({default:""}),inputStyles:t.T({default:"w-full p-1"}),label:t.g({title:"Label",default:"Label",ai:!0,i18n:!0}),placeholder:t.g({title:"Placeholder",default:"Placeholder"}),_rows:t.s({title:"Rows",default:3})}},Me=e=>{const{blockProps:o,fieldName:l,label:s,styles:r,inputStyles:a,required:i,checked:c,showLabel:u=!0}=e,d=y.generateUUID();return u?n.jsxRuntimeExports.jsxs("div",{...r,...o,children:[n.jsxRuntimeExports.jsx("input",{...a,name:l,id:d,type:"checkbox",required:i,defaultChecked:c}),s&&s!=="Label"&&n.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:d,...o,...a,...r,type:"checkbox",required:i,name:l})},$e={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:g.CheckboxIcon,group:"form",props:{fieldName:t.g({title:"Field Name",default:"checkbox"}),styles:t.T({default:"flex items-center gap-x-2"}),label:t.g({title:"web_blocks.label",default:"Label"}),checked:t.c({title:"web_blocks.checked",default:!1}),required:t.c({title:"web_blocks.required",default:!1})}},Pe=()=>{p.registerChaiBlock(R,L),p.registerChaiBlock(P,N),p.registerChaiBlock(S,T),p.registerChaiBlock(q,H),p.registerChaiBlock(D,z),p.registerChaiBlock(A,U),p.registerChaiBlock(F,O),p.registerChaiBlock(V,G),p.registerChaiBlock(W,X),p.registerChaiBlock(Y,Z),p.registerChaiBlock(J,K),p.registerChaiBlock(Q,ee),p.registerChaiBlock(te,le),p.registerChaiBlock(se,re),p.registerChaiBlock(M,$),p.registerChaiBlock(be,he),p.registerChaiBlock(we,ve),p.registerChaiBlock(_e,je),p.registerChaiBlock(Be,Ee),p.registerChaiBlock(Me,$e),p.registerChaiBlock(Ce,Ie),p.registerChaiBlock(Re,Le),p.registerChaiBlock(Se,Te),p.registerChaiBlock(xe,ke),p.registerChaiBlock(fe,ye),p.registerChaiBlock(ae,ie),p.registerChaiBlock(ce,ue),p.registerChaiBlock(de,pe),p.registerChaiBlock(me,ge)};exports.loadWebBlocks=Pe;
|