@chaibuilder/sdk 1.2.9 → 1.2.11
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 +10 -12
- package/dist/AddBlocks-TSt8uJY4.js +218 -0
- package/dist/AddBlocks-k2p8Hy1n.cjs +1 -0
- package/dist/BrandingOptions-WyVWfFVz.cjs +1 -0
- package/dist/{BrandingOptions-QJJ1y5ez.js → BrandingOptions-uFTyYJZj.js} +18 -22
- package/dist/CanvasArea-5erOZYLy.cjs +60 -0
- package/dist/{CanvasArea-mlNKmCOh.js → CanvasArea-iRQqpOak.js} +465 -481
- package/dist/{utils-AvyFzbPC.js → Class-17XFhL48.js} +15 -16
- package/dist/Class-5ARpH_Tu.cjs +1 -0
- package/dist/CurrentPage-NzmJloN7.cjs +1 -0
- package/dist/{CurrentPage-lBy25sZn.js → CurrentPage-RCxTz9Mc.js} +24 -26
- package/dist/{Layers-3Xs4A5i8.js → Layers-tXB5Pwid.js} +124 -158
- package/dist/Layers-xDG7oltg.cjs +1 -0
- package/dist/PagesPanel-72nzYB1k.cjs +1 -0
- package/dist/{PagesPanel--BZhafnt.js → PagesPanel-Jaz9jvye.js} +14 -16
- package/dist/{ProjectPanel-YcLkM-DW.js → ProjectPanel--S014Xx3.js} +22 -24
- package/dist/ProjectPanel-RU0QvH6e.cjs +1 -0
- package/dist/Settings-5EuwaVb3.cjs +1 -0
- package/dist/{Settings-TAgX4hov.js → Settings-gjvl5V1k.js} +556 -579
- package/dist/{SidePanels-btVQQkVK.js → SidePanels-Fq3kRwR0.js} +54 -51
- package/dist/SidePanels-uNCxnGte.cjs +1 -0
- package/dist/Topbar-JqW89xI5.cjs +1 -0
- package/dist/{Topbar-j4t4AgCq.js → Topbar-m5dbbI1f.js} +15 -17
- package/dist/{UnsplashImages-41Y3q5_Q.js → UnsplashImages-GhBD6owT.js} +24 -26
- package/dist/UnsplashImages-vACw5hbK.cjs +1 -0
- package/dist/UploadImages-PzHdEKHT.cjs +1 -0
- package/dist/{UploadImages-xBg-kbKv.js → UploadImages-S1HgxeGb.js} +23 -25
- package/dist/{add-page-modal-cm8damU2.js → add-page-modal-2P5hGXOQ.js} +15 -17
- package/dist/add-page-modal-GAizM2Jw.cjs +1 -0
- package/dist/{confirm-alert-i4pM3mOt.js → confirm-alert-57Xq5foA.js} +12 -14
- package/dist/confirm-alert-Uf84DpdR.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +13 -58
- package/dist/core.js +47 -58
- package/dist/defaultTheme-IH19g4fv.cjs +1 -0
- package/dist/defaultTheme-YY8mlQS3.js +1055 -0
- package/dist/delete-page-modal-MG42FdnU.cjs +1 -0
- package/dist/{delete-page-modal-YrIBvfFA.js → delete-page-modal-ix5IjaFW.js} +27 -29
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +100 -81
- package/dist/email.cjs +1 -0
- package/dist/email.d.ts +116 -0
- package/dist/email.js +79 -0
- package/dist/{controls-XPXGHKht.js → empty-slot-MWycClTb.js} +61 -50
- package/dist/empty-slot-TF2kd-0X.cjs +1 -0
- package/dist/{form-VbouZlAW.cjs → form-KBb3kA8g.cjs} +1 -1
- package/dist/{form-OVmsLOrc.js → form-SYcFyACJ.js} +18 -18
- package/dist/{index-pZhGT8uT.js → index-Fj3ead-J.js} +4886 -4884
- package/dist/index-aiHDvS5v.cjs +1 -0
- package/dist/{index-N50dZnlC.cjs → index-cM3eKmlx.cjs} +25 -25
- package/dist/index-pNYv0oAF.js +2994 -0
- package/dist/lib.cjs +3 -3
- package/dist/lib.js +95 -1125
- package/dist/page-viewer-Sh99FGYk.cjs +1 -0
- package/dist/{page-viewer-feqJr1QI.js → page-viewer-VxqOevr4.js} +15 -17
- package/dist/project-general-setting-VTLHa-Ik.cjs +1 -0
- package/dist/{project-general-setting-SgagORzW.js → project-general-setting-nWOjPiin.js} +15 -17
- package/dist/{project-seo-setting-wxAGEkd_.js → project-seo-setting-70bWTwsB.js} +17 -19
- package/dist/project-seo-setting-ENAKc2Dl.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +2 -0
- package/dist/render.js +111 -70
- package/dist/{single-page-detail-dnWMyg6P.js → single-page-detail-3z7TF-Yy.js} +44 -46
- package/dist/single-page-detail-6L38HJC4.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +13 -15
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +4 -4
- package/dist/ui.js +149 -151
- package/dist/{useAddBlockByDrop-inkD7Lck.cjs → useAddBlockByDrop-7mUMwNSG.cjs} +1 -1
- package/dist/{useAddBlockByDrop-_nwI4W3q.js → useAddBlockByDrop-tjQ5DgiO.js} +1 -1
- package/dist/web-blocks.cjs +1 -9
- package/dist/web-blocks.js +431 -442
- package/package.json +8 -2
- package/dist/AddBlocks-tMxKPoen.js +0 -225
- package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
- package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
- package/dist/CanvasArea-xs4wM64L.cjs +0 -60
- package/dist/CurrentPage-aaU4F7wi.cjs +0 -1
- package/dist/Layers-eaHy5PK9.cjs +0 -1
- package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
- package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
- package/dist/PagesPanel-gGKCV394.cjs +0 -1
- package/dist/ProjectPanel-yFJRy0_E.cjs +0 -1
- package/dist/Settings-7wlLcvoh.cjs +0 -1
- package/dist/SidePanels-5H4j0mIs.cjs +0 -1
- package/dist/Topbar-V8xCetWF.cjs +0 -1
- package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
- package/dist/UploadImages-DnQ95_NW.cjs +0 -1
- package/dist/add-page-modal-MwS7iXn_.cjs +0 -1
- package/dist/confirm-alert-U7-NcG7G.cjs +0 -1
- package/dist/controls-Dy1qa8Dc.cjs +0 -1
- package/dist/delete-page-modal-5o4jXu-z.cjs +0 -1
- package/dist/functions-Ox_svtKm.cjs +0 -1
- package/dist/functions-xIebp8Aw.js +0 -23
- package/dist/index-H6vIwGfD.cjs +0 -1
- package/dist/index-niHREMmR.js +0 -2938
- package/dist/page-viewer-SLt8XgYv.cjs +0 -1
- package/dist/project-general-setting-ym0yCdOq.cjs +0 -1
- package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
- package/dist/single-page-detail-IPod1o5P.cjs +0 -1
- package/dist/utils-PTxFk6qT.cjs +0 -1
package/dist/ui.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./jsx-runtime-WbnYoNE9.js";
|
|
3
|
-
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
1
|
+
import { b7 as z, ba as q, b8 as U, b9 as W, bl as X, bx as Y, A as Z, ah as _, H as $, C as J, F as K, G as N, D as O, E as Q, z as aa, bm as ea, by as oa, B as ta, bf as ra, bi as sa, bh as na, bk as ia, bg as ba, bA as pa, aV as ua, cb as ma, aY as la, aZ as ca, aW as da, a_ as ga, aX as Ca, cd as Ma, cc as Sa, bq as Da, ce as Ta, bp as xa, cj as Aa, bo as ha, cg as wa, ck as Ia, co as Fa, cf as Ga, ch as Pa, ci as ka, cl as Ha, cm as va, cn as La, br as Ra, ac as Ba, ad as Va, ag as Ea, a$ as fa, ae as ya, af as ja, b0 as za, aD as qa, aI as Ua, aF as Wa, c2 as Xa, b$ as Ya, aG as Za, c3 as _a, c7 as $a, c0 as Ja, aH as Ka, c1 as Na, c4 as Oa, c5 as Qa, c6 as ae, aE as ee, aA as oe, aC as te, aB as re, b4 as se, b5 as ne, bb as ie, ay as be, b6 as pe, bC as ue, bJ as me, bF as le, bP as ce, bG as de, bI as ge, bD as Ce, bM as Me, bK as Se, bL as De, bH as Te, bR as xe, bQ as Ae, bN as he, bO as we, bE as Ie, aS as Fe, aU as Ge, aT as Pe, b3 as ke, be as He, bB as ve, ai as Le, al as Re, as as Be, am as Ve, at as Ee, bS as fe, aj as ye, ak as je, ax as ze, bT as qe, bV as Ue, bW as We, b_ as Xe, bY as Ye, bX as Ze, bZ as _e, bU as $e, S as Je, az as Ke, ao as Ne, ar as Oe, ap as Qe, aq as ao, bj as eo, y as oo, bu as to, au as ro, aw as so, bc as no, T as io, av as bo, bz as po, bw as uo, c8 as mo, ca as lo, bv as co, c9 as go } from "./index-pNYv0oAF.js";
|
|
4
2
|
import "react";
|
|
5
|
-
import "@radix-ui/react-toggle";
|
|
6
|
-
import "class-variance-authority";
|
|
7
|
-
import "./utils-AvyFzbPC.js";
|
|
8
3
|
import "lodash-es";
|
|
9
|
-
import "./
|
|
4
|
+
import "./Functions-7jnEwJyw.js";
|
|
10
5
|
import "clsx";
|
|
11
6
|
import "tailwind-merge";
|
|
7
|
+
import "@chaibuilder/runtime";
|
|
8
|
+
import "jotai";
|
|
9
|
+
import "flat-to-nested";
|
|
10
|
+
import "./MODIFIERS-RiXS5Mn1.js";
|
|
11
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
12
|
+
import "@react-hookz/web";
|
|
13
|
+
import "./jsx-runtime-WbnYoNE9.js";
|
|
14
|
+
import "@radix-ui/react-toggle";
|
|
15
|
+
import "class-variance-authority";
|
|
16
|
+
import "./Class-17XFhL48.js";
|
|
12
17
|
import "@radix-ui/react-switch";
|
|
13
18
|
import "@radix-ui/react-slot";
|
|
14
19
|
import "@radix-ui/react-accordion";
|
|
@@ -31,150 +36,143 @@ import "@radix-ui/react-context-menu";
|
|
|
31
36
|
import "react-icons-picker";
|
|
32
37
|
import "react-dom";
|
|
33
38
|
import "react-quill";
|
|
34
|
-
import "jotai";
|
|
35
|
-
import "flat-to-nested";
|
|
36
|
-
import "./Functions-7jnEwJyw.js";
|
|
37
|
-
import "redux-undo";
|
|
38
|
-
import "@chaibuilder/runtime";
|
|
39
|
-
import "lodash";
|
|
40
|
-
import "@react-hookz/web";
|
|
41
39
|
import "react-i18next";
|
|
42
40
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
41
|
+
z as Accordion,
|
|
42
|
+
q as AccordionContent,
|
|
43
|
+
U as AccordionItem,
|
|
44
|
+
W as AccordionTrigger,
|
|
45
|
+
X as Alert,
|
|
46
|
+
Y as AlertDescription,
|
|
47
|
+
Z as AlertDialog,
|
|
48
|
+
_ as AlertDialogAction,
|
|
49
|
+
$ as AlertDialogCancel,
|
|
50
|
+
J as AlertDialogContent,
|
|
51
|
+
K as AlertDialogDescription,
|
|
52
|
+
N as AlertDialogFooter,
|
|
53
|
+
O as AlertDialogHeader,
|
|
54
|
+
Q as AlertDialogTitle,
|
|
55
|
+
aa as AlertDialogTrigger,
|
|
56
|
+
ea as AlertTitle,
|
|
57
|
+
oa as Badge,
|
|
58
|
+
ta as Button,
|
|
59
|
+
ra as Card,
|
|
60
|
+
sa as CardContent,
|
|
61
|
+
na as CardDescription,
|
|
62
|
+
ia as CardFooter,
|
|
63
|
+
ba as CardHeader,
|
|
64
|
+
pa as CardTitle,
|
|
65
|
+
ua as Command,
|
|
66
|
+
ma as CommandDialog,
|
|
67
|
+
la as CommandEmpty,
|
|
68
|
+
ca as CommandGroup,
|
|
69
|
+
da as CommandInput,
|
|
70
|
+
ga as CommandItem,
|
|
71
|
+
Ca as CommandList,
|
|
72
|
+
Ma as CommandSeparator,
|
|
73
|
+
Sa as CommandShortcut,
|
|
74
|
+
Da as ContextMenu,
|
|
75
|
+
Ta as ContextMenuCheckboxItem,
|
|
76
|
+
xa as ContextMenuContent,
|
|
77
|
+
Aa as ContextMenuGroup,
|
|
78
|
+
ha as ContextMenuItem,
|
|
79
|
+
wa as ContextMenuLabel,
|
|
80
|
+
Ia as ContextMenuPortal,
|
|
81
|
+
Fa as ContextMenuRadioGroup,
|
|
82
|
+
Ga as ContextMenuRadioItem,
|
|
83
|
+
Pa as ContextMenuSeparator,
|
|
84
|
+
ka as ContextMenuShortcut,
|
|
85
|
+
Ha as ContextMenuSub,
|
|
86
|
+
va as ContextMenuSubContent,
|
|
87
|
+
La as ContextMenuSubTrigger,
|
|
88
|
+
Ra as ContextMenuTrigger,
|
|
89
|
+
Ba as Dialog,
|
|
90
|
+
Va as DialogContent,
|
|
91
|
+
Ea as DialogDescription,
|
|
92
|
+
fa as DialogFooter,
|
|
93
|
+
ya as DialogHeader,
|
|
94
|
+
ja as DialogTitle,
|
|
95
|
+
za as DialogTrigger,
|
|
96
|
+
qa as DropdownMenu,
|
|
97
|
+
Ua as DropdownMenuCheckboxItem,
|
|
98
|
+
Wa as DropdownMenuContent,
|
|
99
|
+
Xa as DropdownMenuGroup,
|
|
100
|
+
Ya as DropdownMenuItem,
|
|
101
|
+
Za as DropdownMenuLabel,
|
|
102
|
+
_a as DropdownMenuPortal,
|
|
103
|
+
$a as DropdownMenuRadioGroup,
|
|
104
|
+
Ja as DropdownMenuRadioItem,
|
|
105
|
+
Ka as DropdownMenuSeparator,
|
|
106
|
+
Na as DropdownMenuShortcut,
|
|
107
|
+
Oa as DropdownMenuSub,
|
|
108
|
+
Qa as DropdownMenuSubContent,
|
|
109
|
+
ae as DropdownMenuSubTrigger,
|
|
110
|
+
ee as DropdownMenuTrigger,
|
|
111
|
+
oe as HoverCard,
|
|
112
|
+
te as HoverCardContent,
|
|
113
|
+
re as HoverCardTrigger,
|
|
114
|
+
se as IconPickerField,
|
|
115
|
+
ne as ImagePickerField,
|
|
116
|
+
ie as Input,
|
|
117
|
+
be as Label,
|
|
118
|
+
pe as LinkField,
|
|
119
|
+
ue as Menubar,
|
|
120
|
+
me as MenubarCheckboxItem,
|
|
121
|
+
le as MenubarContent,
|
|
122
|
+
ce as MenubarGroup,
|
|
123
|
+
de as MenubarItem,
|
|
124
|
+
ge as MenubarLabel,
|
|
125
|
+
Ce as MenubarMenu,
|
|
126
|
+
Me as MenubarPortal,
|
|
127
|
+
Se as MenubarRadioGroup,
|
|
128
|
+
De as MenubarRadioItem,
|
|
129
|
+
Te as MenubarSeparator,
|
|
130
|
+
xe as MenubarShortcut,
|
|
131
|
+
Ae as MenubarSub,
|
|
132
|
+
he as MenubarSubContent,
|
|
133
|
+
we as MenubarSubTrigger,
|
|
134
|
+
Ie as MenubarTrigger,
|
|
135
|
+
Fe as Popover,
|
|
136
|
+
Ge as PopoverContent,
|
|
137
|
+
Pe as PopoverTrigger,
|
|
138
|
+
ke as RTEField,
|
|
139
|
+
He as ScrollArea,
|
|
140
|
+
ve as ScrollBar,
|
|
141
|
+
Le as Select,
|
|
142
|
+
Re as SelectContent,
|
|
143
|
+
Be as SelectGroup,
|
|
144
|
+
Ve as SelectItem,
|
|
145
|
+
Ee as SelectLabel,
|
|
146
|
+
fe as SelectSeparator,
|
|
147
|
+
ye as SelectTrigger,
|
|
148
|
+
je as SelectValue,
|
|
149
|
+
ze as Separator,
|
|
150
|
+
qe as Sheet,
|
|
151
|
+
Ue as SheetClose,
|
|
152
|
+
We as SheetContent,
|
|
153
|
+
Xe as SheetDescription,
|
|
154
|
+
Ye as SheetFooter,
|
|
155
|
+
Ze as SheetHeader,
|
|
156
|
+
_e as SheetTitle,
|
|
157
|
+
$e as SheetTrigger,
|
|
158
|
+
Je as Skeleton,
|
|
159
|
+
Ke as Switch,
|
|
160
|
+
Ne as Tabs,
|
|
161
|
+
Oe as TabsContent,
|
|
162
|
+
Qe as TabsList,
|
|
163
|
+
ao as TabsTrigger,
|
|
164
|
+
eo as Textarea,
|
|
165
|
+
oo as Toaster,
|
|
166
|
+
to as Toggle,
|
|
167
|
+
ro as Tooltip,
|
|
168
|
+
so as TooltipContent,
|
|
169
|
+
no as TooltipPortal,
|
|
170
|
+
io as TooltipProvider,
|
|
171
|
+
bo as TooltipTrigger,
|
|
172
|
+
po as badgeVariants,
|
|
173
|
+
uo as buttonVariants,
|
|
174
|
+
mo as reducer,
|
|
175
|
+
lo as toast,
|
|
176
|
+
co as toggleVariants,
|
|
177
|
+
go as useToast
|
|
180
178
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("react"),u=require("lodash-es"),t=require("./index-
|
|
1
|
+
"use strict";const n=require("react"),u=require("lodash-es"),t=require("./index-aiHDvS5v.cjs"),a=()=>{const{addCoreBlock:r}=t.useAddBlock(),l=t.useBuilderProp("getExternalPredefinedBlock");return n.useCallback(async s=>{const{block:o,dropTargetId:e,relativeIndex:c}=s;if(u.has(o,"format")){const d=await l(o);return r({blocks:d},e===0?null:e,c)}return r(o,e===0?null:e,c)},[r])};exports.useAddBlockByDrop=a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback as n } from "react";
|
|
2
2
|
import { has as s } from "lodash-es";
|
|
3
|
-
import {
|
|
3
|
+
import { K as a, i as u } from "./index-pNYv0oAF.js";
|
|
4
4
|
const B = () => {
|
|
5
5
|
const { addCoreBlock: r } = a(), l = u("getExternalPredefinedBlock");
|
|
6
6
|
return n(
|
package/dist/web-blocks.cjs
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("lodash-es"),v=require("react"),o=require("./controls-Dy1qa8Dc.cjs"),d=require("@chaibuilder/runtime"),a=require("./jsx-runtime-Z_BpKhVy.cjs"),y=require("./Functions-N3yhPYKY.cjs"),p=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("tailwind-merge");function S(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const r=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,r.get?r:{enumerable:!0,get:()=>e[l]})}}return t.default=e,Object.freeze(t)}const u=S(v),R=e=>{const{blockProps:t,backgroundImage:l,children:r,styles:n}=e;let s={};return l&&(s={backgroundImage:`url(${l})`}),u.createElement("div",{...t,...n,style:s},r)};d.registerChaiBlock(R,{type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:o.S({default:"font-body antialiased"}),backgroundImage:o.o({title:"Background Image"})}});const g=({blockProps:e,className:t="",styles:l={}})=>a.jsxRuntimeExports.jsx("div",{...e,className:y.cn("flex h-20 flex-col items-center justify-center",t),...x.omit(l,["className"]),children:a.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",children:a.jsxRuntimeExports.jsx("span",{className:"opacit flex items-center gap-x-1.5 text-xs font-semibold text-gray-400"})})}),L=u.memo(e=>{const{blockProps:t,backgroundImage:l,children:r,tag:n="div",styles:s}=e;if(!r&&x.isEmpty(s==null?void 0:s.className))return a.jsxRuntimeExports.jsx(g,{blockProps:t,styles:s});let i={};return l&&(i={backgroundImage:`url(${l})`}),u.createElement(n,{...t,...s,style:i},r)});d.registerChaiBlock(L,{type:"Box",label:"Box",category:"core",group:"basic",props:{styles:o.S({default:""}),tag:o.f({title:"Tag",default:"div",options:[{value:"div",title:"div"},{value:"header",title:"header"},{value:"footer",title:"footer"},{value:"section",title:"section"},{value:"article",title:"article"},{value:"aside",title:"aside"},{value:"main",title:"main"},{value:"nav",title:"nav"},{value:"figure",title:"figure"},{value:"details",title:"details"},{value:"summary",title:"summary"},{value:"dialog",title:"dialog"},{value:"strike",title:"strike"},{value:"caption",title:"caption"},{value:"legend",title:"legend"},{value:"figcaption",title:"figcaption"},{value:"mark",title:"mark"}]}),backgroundImage:o.o({title:"Background Image"})},canAcceptBlock:()=>!0});const T=e=>{const{blockProps:t,styles:l,content:r,level:n="h1",children:s=null}=e;return s?u.createElement(n,{...l,...t},s):u.createElement(n,{...l,...t,dangerouslySetInnerHTML:{__html:r}})};d.registerChaiBlock(T,{type:"Heading",label:"Heading",category:"core",icon:p.HeadingIcon,group:"basic",props:{level:o.f({title:"Level",default:"h1",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:o.S({default:"text-3xl"}),content:o.g({title:"Content",default:"Heading goes here"})},canAcceptBlock:e=>e==="Span"||e==="Text"});const w=e=>{const{blockProps:t,styles:l,content:r}=e;return x.isNull(e.children)?u.createElement("div",{...l,...t,dangerouslySetInnerHTML:{__html:r}}):u.createElement("p",{...l,...t},e.children)};d.registerChaiBlock(w,{type:"Paragraph",label:"Paragraph",category:"core",icon:p.TextIcon,group:"basic",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere."})},canAcceptBlock:e=>e==="Span"||e==="Link"});const _=e=>{const{blockProps:t,styles:l,content:r,children:n=null,tag:s}=e;return n?u.createElement("span",{...l,...t},n):u.createElement(s||"span",{...l,...t,dangerouslySetInnerHTML:{__html:r}})};d.registerChaiBlock(_,{type:"Span",label:"Span",category:"core",group:"basic",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"Enter your content"})}});const C=e=>{const{blockProps:t,content:l,styles:r}=e;return a.jsxRuntimeExports.jsx("div",{className:"prose max-w-full",children:a.jsxRuntimeExports.jsx("div",{...t,...r,dangerouslySetInnerHTML:{__html:l}})})};d.registerChaiBlock(C,{type:"RichText",label:"Rich Text",category:"core",icon:p.CursorTextIcon,group:"basic",props:{styles:o.S({default:""}),content:o.m({title:"Content",default:`Lorem Ipsum Rich Text Editor Demo
|
|
2
|
-
|
|
3
|
-
Welcome to our rich text editor demo! With our powerful editor, you can create stunning documents with ease. Let's explore some of its features:
|
|
4
|
-
|
|
5
|
-
Text Formatting: You can make text bold, italic, or underline it.
|
|
6
|
-
Lists:
|
|
7
|
-
Create ordered lists.
|
|
8
|
-
Craft unordered lists.
|
|
9
|
-
Utilize nested lists for organization.`})}});const P=e=>{const{blockProps:t,iconSize:l,icon:r,content:n,iconPos:s,styles:i,children:c}=e,m=r,f=c||a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[n,m&&a.jsxRuntimeExports.jsx("div",{style:{width:l+"px"},className:s+(s==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:m}})]});return u.createElement("button",{...t,...i,type:"button"},f)};d.registerChaiBlock(P,{type:"Button",label:"Button",category:"core",icon:p.ButtonIcon,group:"basic",props:{content:o.u({title:"Label",default:"Button",multiLingual:!0}),styles:o.S({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:o.T({title:"Icon",default:""}),iconSize:o.c({title:"Icon Size",default:24}),iconPos:o.f({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const N=e=>{const{blockProps:t,link:l,children:r,styles:n,inBuilder:s,content:i}=e;return!r&&x.isEmpty(n==null?void 0:n.className)&&x.isEmpty(i)?a.jsxRuntimeExports.jsx(g,{blockProps:t}):s?r?a.jsxRuntimeExports.jsx("span",{"data-simulate":"a",...t,...n,children:r}):u.createElement("span",{...t,...n,href:l.href||"#",target:l.target||"_self",dangerouslySetInnerHTML:{__html:i},"data-simulate":"a"}):r?a.jsxRuntimeExports.jsx("a",{href:l.href||"#/",target:l.target,...t,...n,children:r}):u.createElement("a",{...t,...n,href:l.href||"#",target:l.target||"_self",dangerouslySetInnerHTML:{__html:i}})};d.registerChaiBlock(N,{type:"Link",label:"Link",category:"core",icon:p.Link1Icon,group:"basic",props:{styles:o.S({default:""}),content:o.u({title:"Content",default:""}),link:o.q({title:"Link",default:{type:"page",target:"_self",href:""}})},canAcceptBlock:()=>!0});const M=e=>{const{blockProps:t,children:l,listType:r,styles:n,tag:s}=e,i=y.cn(x.get(n,"className",""),r);return!l&&x.isEmpty(n==null?void 0:n.className)?a.jsxRuntimeExports.jsx(g,{blockProps:t,text:"LIST ITEM"}):u.createElement(s||(r==="list-decimal"?"ol":"ul"),{...t,...n,className:i},l)};d.registerChaiBlock(M,{type:"List",label:"List",icon:p.RowsIcon,category:"core",group:"basic",props:{styles:o.S({default:""}),listType:o.f({title:"List type",default:"list-disc",options:[{value:"list-none",title:"None"},{value:"list-disc",title:"Disc"},{value:"list-decimal",title:"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"}]});const H=e=>{const{blockProps:t,content:l,styles:r,children:n,tag:s}=e;return n?u.createElement(s||"li",{...r,...t},n):u.createElement(s||"li",{...r,...t,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(H,{type:"ListItem",label:"List Item",icon:p.ColumnsIcon,category:"core",group:"basic",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"List item"})},canAcceptBlock:()=>!0});const U=e=>{const{blockProps:t,icon:l,styles:r}=e,n={...r,className:y.cn(r.className,"inline-block c-inline-block")};return x.isEmpty(l)?a.jsxRuntimeExports.jsx(g,{blockProps:t,text:"",className:"h-8 w-14"}):u.createElement("span",{...t,...n,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(U,{type:"Icon",label:"Icon",category:"core",icon:p.SketchLogoIcon,group:"basic",props:{styles:o.S({default:"text-black"}),icon:o.T({title:"Icon",default:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" height="1em" width="1em" 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>'})}});const D=e=>{const{blockProps:t,image:l,styles:r,alt:n,height:s=200,width:i=200}=e;return x.isEmpty(l)?a.jsxRuntimeExports.jsx(g,{blockProps:t,text:"IMAGE URL",className:"h-36"}):u.createElement("img",{...t,...r,src:l,alt:n,height:s,width:i})};d.registerChaiBlock(D,{type:"Image",label:"Image",category:"core",icon:p.ImageIcon,group:"basic",props:{styles:o.S({default:""}),image:o.o({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:o.u({title:"Alt",default:""}),width:o.u({title:"Width",default:""}),height:o.u({title:"Height",default:""})}});const q=e=>{var s;const{blockProps:t,styles:l,children:r}=e;let n=null;return r||(n=a.jsxRuntimeExports.jsx("div",{className:y.cn("flex flex-col items-center justify-center",(s=e.emptyStyles)==null?void 0:s.className),children:a.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded-md border-4 border-dashed",children:a.jsxRuntimeExports.jsxs("p",{className:"truncate p-1 text-left text-xs text-gray-400",children:["Slot: ",e.name]})})})),u.createElement("div",{...l,...t,droppable:"yes"},r||n)};d.registerChaiBlock(q,{type:"Slot",label:"Slot",group:"basic",category:"core",hidden:!0,props:{styles:o.S({default:""}),emptyStyles:o.S({default:""})},canAcceptBlock:()=>!0});const j=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,B=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,I=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,A=e=>{if(j.test(e)){const t=e.match(j);return t?`https://www.youtube.com/embed/${t[4]}`:e}if(B.test(e)){const t=e.match(B);return t?`https://player.vimeo.com/video/${t[3]}`:e}if(I.test(e)){const t=e.match(I);return t?`https://www.dailymotion.com/embed/video/${t[4]}`:e}return null},F=u.memo(e=>{const{blockProps:t,inBuilder:l,styles:r,url:n,controls:s}=e,i=x.get(s,"autoPlay",!1),c=x.get(s,"controls",!1),m=i||x.get(s,"muted",!0),f=x.get(s,"loop",!1);if(x.isEmpty(n))return a.jsxRuntimeExports.jsx(g,{blockProps:t,text:"VIDEO URL",className:"h-36"});let h=A(n),b=null;if(h){if(!x.isEmpty(h)){const k=[];k.push(`autoplay=${i?1:0}`),k.push(`controls=${s?1:0}`),k.push(`mute=${m?1:0}&muted=${m?1:0}`),k.push(`loop=${f?1:0}`),h=`${h}?${k.join("&")}`}b=u.createElement("iframe",{...t,...r,src:h,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else b=u.createElement("video",{...t,...r,src:n,controls:c,muted:m,autoPlay:l?!1:i,loop:f});return a.jsxRuntimeExports.jsxs("div",{className:"relative h-full w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?a.jsxRuntimeExports.jsx("div",{...t,...r,className:"absolute z-20 h-full w-full"}):null,b]})});d.registerChaiBlock(F,{type:"Video",label:"Video",category:"core",icon:p.VideoIcon,group:"basic",props:{styles:o.S({default:"absolute top-0 left-0 w-full h-full"}),url:o.u({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:o.b({title:"Controls",properties:{autoPlay:o.r({title:"Autoplay",default:!0}),controls:o.r({title:"Show widgets",default:!1}),loop:o.r({title:"Loop",default:!1}),muted:o.r({title:"Muted",default:!0})}})}});const z=u.memo(e=>{const{blockProps:t,styles:l,content:r,inBuilder:n}=e;return a.jsxRuntimeExports.jsxs("div",{className:"relative",children:[n?a.jsxRuntimeExports.jsx("div",{...t,...l,className:"absolute h-full w-full z-20"}):null,u.createElement("div",{...l,dangerouslySetInnerHTML:{__html:r}})]})});d.registerChaiBlock(z,{type:"CustomHTML",label:"CustomHTML",category:"core",icon:p.CodeIcon,group:"basic",props:{styles:o.S({default:""}),content:o.g({title:"HTML Content",default:"<div><p>HTML Snippet goes here...</p></div>",placeholder:"Enter custom HTML code here"})}});const O=e=>{const{blockProps:t,styles:l}=e;return u.createElement("hr",{...l,...t})};d.registerChaiBlock(O,{type:"Divider",label:"Divider",category:"core",icon:p.DividerHorizontalIcon,group:"basic",props:{styles:o.S({default:"bg-gray-900 h-0.5 py-2 my-1"})}});const $=e=>{const{blockProps:t,styles:l}=e;return u.createElement("br",{...t,...l})};d.registerChaiBlock($,{type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:p.SpaceBetweenVerticallyIcon,props:{styles:o.S({default:""})}});const V=e=>e.inBuilder?a.jsxRuntimeExports.jsx("span",{className:"inline",...e.blockProps,children:e.content}):`${e.content}`;d.registerChaiBlock(V,{type:"Text",label:"Text",hidden:!0,category:"core",group:"basic",icon:p.SpaceBetweenVerticallyIcon,props:{content:o.g({title:"Content",defaultValue:""})}});const E=e=>{const t=(s,i)=>({_id:y.generateUUID(),_parent:s,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+i}`}),l=s=>{const i=y.generateUUID(),c={_type:"TableRow",_id:i,styles:"#styles:,border-b"};return s&&(c._parent=s),[c,t(i,"1"),t(i,"2"),t(i,"3")]},r=s=>{const i=y.generateUUID(),c={_id:i,_type:"TableHead",styles:"#styles:,font-medium"};return s&&(c._parent=s),[c,...l(i)]},n=s=>{const i=y.generateUUID(),c={_id:i,_type:"TableBody",styles:"#styles:,"};return s&&(c._parent=s),[c,...l(i),...l(i)]};if(e==="Table"){const s=y.generateUUID();return[{_id:s,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...r(s),...n(s)]}return e==="TableRow"?l():e==="TableHead"?r():e==="TableBody"?n():[]},W=e=>{const{blockProps:t,children:l,styles:r}=e;return l?u.createElement("table",{...t,...r},l):a.jsxRuntimeExports.jsx(g,{blockProps:t,text:"TABLE HEAD / BODY"})};d.registerChaiBlock(W,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:p.TableIcon,props:{styles:o.S({default:""})},blocks:E("Table")});const G=e=>{const{blockProps:t,children:l,styles:r}=e;return l?u.createElement("thead",{...t,...r},l):a.jsxRuntimeExports.jsx(g,{blockProps:t,text:"TABLE ROW"})};d.registerChaiBlock(G,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:p.BorderTopIcon,props:{styles:o.S({default:""})},blocks:E("TableHead")});const Y=e=>{const{blockProps:t,children:l,styles:r}=e;return l?u.createElement("tbody",{...t,...r},l):a.jsxRuntimeExports.jsx(g,{blockProps:t,text:"TABLE ROW"})};d.registerChaiBlock(Y,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:p.BorderAllIcon,props:{styles:o.S({default:""})},blocks:E("TableBody")});const X=e=>{const{blockProps:t,children:l,styles:r}=e;return l?u.createElement("tr",{...t,...r},l):a.jsxRuntimeExports.jsx(g,{blockProps:t,text:"TABLE CELL"})};d.registerChaiBlock(X,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:p.ViewHorizontalIcon,props:{styles:o.S({default:"w-full"})},blocks:E("TableRow")});const Z=e=>{const{blockProps:t,children:l,content:r,styles:n}=e;return!l&&x.isEmpty(r)?a.jsxRuntimeExports.jsx(g,{blockProps:t}):l?u.createElement("td",{...t,...n},l):u.createElement("td",{...t,...n,dangerouslySetInnerHTML:{__html:r}})};d.registerChaiBlock(Z,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:p.DragHandleHorizontalIcon,props:{styles:o.S({default:""}),content:o.m({title:"Content",default:"Table cell item"})}});const J=e=>{const{blockProps:t,errorMessage:l,name:r,_type:n,successMessage:s,action:i,styles:c,children:m}=e;if(!m&&x.isEmpty(c==null?void 0:c.className))return a.jsxRuntimeExports.jsx(g,{blockProps:t,text:"FORM FIELDS"});const f={"x-data":"useForm","x-on:submit.prevent":"post"},h={"x-html":"formResponse",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return a.jsxRuntimeExports.jsxs("form",{...f,"data-error":l,"data-success":s,method:"post",action:i,...t,...c,children:[a.jsxRuntimeExports.jsx("div",{...h}),a.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:r||n}),m]})};d.registerChaiBlock(J,{type:"Form",label:"Form",category:"core",icon:p.GroupIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),action:o.u({title:"Submit URL",default:"/api/form/submit"}),errorMessage:o.m({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:o.m({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0});const K=e=>{const{blockProps:t,content:l,styles:r,children:n}=e,s={...r,...t};return n?u.createElement("label",s,n):u.createElement("label",{...s,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(K,{type:"Label",label:"Label",category:"core",icon:p.LetterCaseToggleIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),content:o.u({title:"Content",default:"Label"})}});const Q=e=>{const{blockProps:t,label:l,placeholder:r,styles:n,inputStyles:s,showLabel:i,required:c,inputType:m="text",inBuilder:f,fieldName:h}=e,b=y.generateUUID();return!i||m==="submit"?(m==="submit"&&(t.value=l),a.jsxRuntimeExports.jsx("input",{id:b,name:h,readOnly:f,...t,...s,...n,type:m,placeholder:r,required:c})):a.jsxRuntimeExports.jsxs("div",{...n,...t,children:[i&&a.jsxRuntimeExports.jsx("label",{htmlFor:b,children:l}),a.jsxRuntimeExports.jsx("input",{name:h,readOnly:f,...s,id:b,type:m,placeholder:r,required:c})]})};d.registerChaiBlock(Q,{type:"Input",label:"Input",category:"core",icon:p.InputIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),fieldName:o.u({title:"Field Name",default:"input"}),inputType:o.f({title:"Type",options:x.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],e=>({value:e,title:e})),default:"text"}),value:o.u({title:"Value",default:""}),showLabel:o.r({title:"Show label",default:!0}),inputStyles:o.S({default:"w-full p-1"}),label:o.u({title:"Label",default:"Label"}),placeholder:o.u({title:"Placeholder",default:"Placeholder"}),required:o.r({title:"Required",default:!1})}});const ee=e=>{const{blockProps:t,fieldName:l,label:r,placeholder:n,styles:s,inputStyles:i,_rows:c,showLabel:m}=e,f=y.generateUUID();return m?a.jsxRuntimeExports.jsxs("div",{...s,...t,children:[m&&a.jsxRuntimeExports.jsx("label",{htmlFor:f,children:r}),a.jsxRuntimeExports.jsx("textarea",{name:l,...i,id:f,placeholder:n,rows:c})]}):a.jsxRuntimeExports.jsx("textarea",{id:f,name:l,...t,...i,...s,placeholder:n,rows:c})};d.registerChaiBlock(ee,{type:"TextArea",label:"TextArea",category:"core",icon:p.InputIcon,group:"form",hidden:!0,props:{fieldName:o.u({title:"Field Name",default:"textarea"}),showLabel:o.r({title:"Show label",default:!0}),styles:o.S({default:""}),inputStyles:o.S({default:"w-full p-1"}),label:o.u({title:"Label",default:"Label"}),placeholder:o.u({title:"Placeholder",default:"Placeholder"}),_rows:o.c({title:"Rows",default:3})}});const te=e=>{const{blockProps:t,fieldName:l,label:r,placeholder:n,styles:s,inputStyles:i,required:c,showLabel:m,_multiple:f=!1}=e,h=y.generateUUID();return m?a.jsxRuntimeExports.jsxs("div",{...s,children:[m&&a.jsxRuntimeExports.jsx("label",{htmlFor:h,children:r}),a.jsxRuntimeExports.jsxs("select",{...i,id:h,placeholder:n,required:c,multiple:f,name:l,children:[a.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:n}),x.map(e.options,b=>a.jsxRuntimeExports.jsx("option",{selected:x.get(b,"selected",!1),value:b.value,dangerouslySetInnerHTML:{__html:b.label}},b.value))]})]}):a.jsxRuntimeExports.jsxs("select",{id:h,...s,...t,placeholder:n,required:c,multiple:f,name:l,children:[a.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:n}),x.map(e.options,b=>a.jsxRuntimeExports.jsx("option",{selected:x.get(b,"selected",!1),value:b.value,dangerouslySetInnerHTML:{__html:b.label}},b.value))]})};d.registerChaiBlock(te,{type:"Select",label:"Select",category:"core",icon:p.DropdownMenuIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),fieldName:o.u({title:"Field Name",default:"select"}),showLabel:o.r({title:"Show label",default:!0}),inputStyles:o.S({default:"w-full p-1"}),label:o.u({title:"Label",default:"Label"}),placeholder:o.u({title:"Placeholder",default:"Placeholder"}),required:o.r({title:"Required",default:!1}),_multiple:o.r({title:"Multiple Choice",default:!1}),options:o.h({title:"Options",itemProperties:{label:o.u({title:"Label",default:""}),value:o.u({title:"Value",default:""})}})}});const le=e=>{const{blockProps:t,fieldName:l,label:r,styles:n,inputStyles:s,required:i,checked:c,showLabel:m=!0}=e,f=y.generateUUID();return m?a.jsxRuntimeExports.jsxs("div",{...n,...t,children:[a.jsxRuntimeExports.jsx("input",{...s,name:l,id:f,type:"checkbox",required:i,defaultChecked:c}),r&&r!=="Label"&&a.jsxRuntimeExports.jsx("label",{htmlFor:f,children:r})]}):a.jsxRuntimeExports.jsx("input",{id:f,...t,...s,...n,type:"checkbox",required:i,name:l})};d.registerChaiBlock(le,{type:"Checkbox",label:"Checkbox",category:"core",icon:p.CheckboxIcon,group:"form",hidden:!0,props:{fieldName:o.u({title:"Field Name",default:"checkbox"}),styles:o.S({default:"flex items-center gap-x-2"}),label:o.u({title:"Label",default:"Label"}),checked:o.r({title:"Checked",default:!1}),required:o.r({title:"Required",default:!1})}});const oe=e=>{const{blockProps:t,fieldName:l,label:r,styles:n,inputStyles:s,checked:i,required:c,showLabel:m=!0}=e,f=y.generateUUID();return m?a.jsxRuntimeExports.jsxs("div",{...n,...t,children:[a.jsxRuntimeExports.jsx("input",{...s,name:l,id:f,type:"radio",required:c,defaultChecked:i}),r&&a.jsxRuntimeExports.jsx("label",{htmlFor:f,children:r})]}):a.jsxRuntimeExports.jsx("input",{id:f,...t,...s,...n,type:"radio",required:c,checked:i,name:l})};d.registerChaiBlock(oe,{type:"Radio",label:"Radio",category:"core",icon:p.RadiobuttonIcon,group:"form",hidden:!0,props:{styles:o.S({default:"flex items-center w-max gap-x-2"}),fieldName:o.u({title:"Field Name",default:"radio"}),label:o.u({title:"Label",default:"Label"}),checked:o.r({title:"Checked",default:!1}),required:o.r({title:"Required",default:!1})}});const re=e=>{const{blockProps:t,inBuilder:l,label:r,placeholder:n,styles:s,inputStyles:i,icon:c,iconPos:m}=e,f=y.generateUUID(),h={"x-bind:disabled":"formLoading"};return a.jsxRuntimeExports.jsxs("button",{id:f,...h,...i,...s,...t||{},type:l?"button":"submit",placeholder:n,children:[r,c&&a.jsxRuntimeExports.jsx("span",{className:m,dangerouslySetInnerHTML:{__html:c}})]})};d.registerChaiBlock(re,{type:"FormButton",label:"Submit Button",category:"core",icon:p.ButtonIcon,group:"form",hidden:!0,props:{label:o.u({title:"Label",default:"Submit"}),styles:o.S({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:o.T({title:"Icon",default:""}),iconPos:o.f({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const se=x.noop;exports.loadWebBlocks=se;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("lodash-es"),n=require("./jsx-runtime-Z_BpKhVy.cjs"),S=require("react"),e=require("./empty-slot-TF2kd-0X.cjs"),d=require("@chaibuilder/runtime"),m=require("@radix-ui/react-icons"),x=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("tailwind-merge");function I(t){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(l,o,s.get?s:{enumerable:!0,get:()=>t[o]})}}return l.default=t,Object.freeze(l)}const u=I(S),v=u.memo(t=>{const{blockProps:l,backgroundImage:o,children:s,tag:r="div",styles:a}=t;let i=s;s||(i=n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:{},styles:{}}));let c={};return o&&(c={backgroundImage:`url(${o})`}),u.createElement(r,{...l,...a,style:c},i)});d.registerChaiBlock(v,{type:"Box",label:"Box",category:"core",group:"basic",props:{styles:e.S({default:""}),tag:e.f({title:"Tag",default:"div",options:[{value:"div",title:"div"},{value:"header",title:"header"},{value:"footer",title:"footer"},{value:"section",title:"section"},{value:"article",title:"article"},{value:"aside",title:"aside"},{value:"main",title:"main"},{value:"nav",title:"nav"},{value:"figure",title:"figure"},{value:"details",title:"details"},{value:"summary",title:"summary"},{value:"dialog",title:"dialog"},{value:"strike",title:"strike"},{value:"caption",title:"caption"},{value:"legend",title:"legend"},{value:"figcaption",title:"figcaption"},{value:"mark",title:"mark"}]}),backgroundImage:e.o({title:"Background Image"})},canAcceptBlock:()=>!0});const R=t=>{const{blockProps:l,styles:o,content:s,level:r="h1",children:a=null}=t;return a?u.createElement(r,{...o,...l},a):u.createElement(r,{...o,...l,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(R,{type:"Heading",label:"Heading",category:"core",icon:m.HeadingIcon,group:"typography",props:{level:e.f({title:"Level",default:"h1",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:e.S({default:"text-3xl"}),content:e.g({title:"Content",default:"Heading goes here"})},canAcceptBlock:t=>t==="Span"||t==="Text"});const L=t=>{const{blockProps:l,styles:o,content:s}=t;return f.isNull(t.children)?u.createElement("div",{...o,...l,dangerouslySetInnerHTML:{__html:s}}):u.createElement("p",{...o,...l},t.children)};d.registerChaiBlock(L,{type:"Paragraph",label:"Paragraph",category:"core",icon:m.TextIcon,group:"typography",props:{styles:e.S({default:""}),content:e.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere."})},canAcceptBlock:t=>t==="Span"||t==="Link"});const T=t=>{const{blockProps:l,styles:o,content:s,children:r=null,tag:a}=t;return r?u.createElement("span",{...o,...l},r):u.createElement(a||"span",{...o,...l,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(T,{type:"Span",label:"Span",category:"core",group:"typography",props:{styles:e.S({default:""}),content:e.g({title:"Content",default:"Enter your content"})}});const w=t=>{const{blockProps:l,content:o,styles:s}=t;return n.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:n.jsxRuntimeExports.jsx("div",{...l,...s,dangerouslySetInnerHTML:{__html:o}})})};d.registerChaiBlock(w,{type:"RichText",label:"Rich Text",category:"core",icon:m.CursorTextIcon,group:"typography",props:{styles:e.S({default:""}),content:e.m({title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}});const C=t=>{const{blockProps:l,iconSize:o,icon:s,content:r,iconPos:a,styles:i,children:c}=t,y=s,p=c||n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{children:r}),y&&n.jsxRuntimeExports.jsx("div",{style:{width:o+"px"},className:a+" "+(a==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:y}})]});return u.createElement("button",{...l,...i,type:"button"},p)};d.registerChaiBlock(C,{type:"Button",label:"Button",category:"core",icon:m.ButtonIcon,group:"basic",props:{content:e.u({title:"Label",default:"Button",multiLingual:!0}),styles:e.S({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:e.T({title:"Icon",default:""}),iconSize:e.c({title:"Icon Size",default:24}),iconPos:e.f({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const _=t=>{const{blockProps:l,link:o,children:s,styles:r,inBuilder:a,content:i}=t;return!s&&f.isEmpty(r==null?void 0:r.className)&&f.isEmpty(i)?n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l}):a?s?n.jsxRuntimeExports.jsx("span",{"data-simulate":"a",...l,...r,children:s}):u.createElement("span",{...l,...r,dangerouslySetInnerHTML:{__html:i},"data-simulate":"a"}):s?n.jsxRuntimeExports.jsx("a",{href:o.href||"#/",target:o.target,...l,...r,children:s}):u.createElement("a",{...l,...r,href:o.href||"#",target:o.target||"_self",dangerouslySetInnerHTML:{__html:i}})};d.registerChaiBlock(_,{type:"Link",label:"Link",category:"core",icon:m.Link1Icon,group:"basic",props:{styles:e.S({default:""}),content:e.u({title:"Content",default:""}),link:e.q({title:"Link",default:{type:"page",target:"_self",href:""}})},canAcceptBlock:()=>!0});const P=t=>{const{blockProps:l,children:o,listType:s,styles:r,tag:a}=t,i=x.cn(f.get(r,"className",""),s);return!o&&f.isEmpty(r==null?void 0:r.className)?n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l,text:"LIST ITEM"}):u.createElement(a||(s==="list-decimal"?"ol":"ul"),{...l,...r,className:i},o)};d.registerChaiBlock(P,{type:"List",label:"List",icon:m.RowsIcon,category:"core",group:"basic",props:{styles:e.S({default:""}),listType:e.f({title:"List type",default:"list-disc",options:[{value:"list-none",title:"None"},{value:"list-disc",title:"Disc"},{value:"list-decimal",title:"Number"}]})},canAcceptBlock:t=>t==="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"}]});const N=t=>{const{blockProps:l,content:o,styles:s,children:r,tag:a}=t;return r?u.createElement(a||"li",{...s,...l},r):u.createElement(a||"li",{...s,...l,dangerouslySetInnerHTML:{__html:o}})};d.registerChaiBlock(N,{type:"ListItem",label:"List Item",icon:m.ColumnsIcon,category:"core",group:"basic",props:{styles:e.S({default:""}),content:e.g({title:"Content",default:"List item"})},canAcceptBlock:()=>!0,canBeNested:t=>t==="List"});const M=t=>{const{blockProps:l,icon:o,styles:s,width:r,height:a}=t,i={...s,className:x.cn(s.className,"inline-block c-inline-block",`w-[${r}px]`,`h-[${a}px]`)};return f.isEmpty(o)?n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l,text:"",className:"h-8 w-14"}):u.createElement("span",{...l,...i,dangerouslySetInnerHTML:{__html:o}})};d.registerChaiBlock(M,{type:"Icon",label:"Icon",category:"core",icon:m.SketchLogoIcon,group:"media",props:{styles:e.S({default:"text-black"}),icon:e.T({title:"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:e.c({title:"Width",default:40}),height:e.c({title:"Height",default:40})}});const H=t=>{const{blockProps:l,image:o,styles:s,alt:r,height:a,width:i}=t;return f.isEmpty(o)?n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l,text:"IMAGE URL",className:"h-36"}):u.createElement("img",{...l,...s,src:o,alt:r,height:a,width:i})};d.registerChaiBlock(H,{type:"Image",label:"Image",category:"core",icon:m.ImageIcon,group:"media",props:{styles:e.S({default:""}),image:e.o({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:e.u({title:"Alt",default:""}),width:e.u({title:"Width",default:""}),height:e.u({title:"Height",default:""})}});const U=t=>{var a;const{blockProps:l,styles:o,children:s}=t;let r=null;return s||(r=n.jsxRuntimeExports.jsx("div",{className:x.cn("flex flex-col items-center justify-center",(a=t.emptyStyles)==null?void 0:a.className),children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded-md border-4 border-dashed",children:n.jsxRuntimeExports.jsxs("p",{className:"truncate p-1 text-left text-xs text-gray-400",children:["Slot: ",t.name]})})})),u.createElement("div",{...o,...l,droppable:"yes"},s||r)};d.registerChaiBlock(U,{type:"Slot",label:"Slot",group:"basic",category:"core",hidden:!0,props:{styles:e.S({default:""}),emptyStyles:e.S({default:""})},canAcceptBlock:()=>!0});const E=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,j=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,B=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,D=t=>{if(E.test(t)){const l=t.match(E);return l?`https://www.youtube.com/embed/${l[4]}`:t}if(j.test(t)){const l=t.match(j);return l?`https://player.vimeo.com/video/${l[3]}`:t}if(B.test(t)){const l=t.match(B);return l?`https://www.dailymotion.com/embed/video/${l[4]}`:t}return null},q=u.memo(t=>{const{blockProps:l,inBuilder:o,styles:s,url:r,controls:a}=t,i=f.get(a,"autoPlay",!1),c=f.get(a,"controls",!1),y=i||f.get(a,"muted",!0),p=f.get(a,"loop",!1);if(f.isEmpty(r))return n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l,text:"VIDEO URL",className:"h-36"});let b=D(r),h=null;if(b){if(!f.isEmpty(b)){const g=[];g.push(`autoplay=${i?1:0}`),g.push(`controls=${a?1:0}`),g.push(`mute=${y?1:0}&muted=${y?1:0}`),g.push(`loop=${p?1:0}`),b=`${b}?${g.join("&")}`}h=u.createElement("iframe",{...l,className:"absolute inset-0 w-full h-full",src:b,allow:o?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else h=u.createElement("video",{...l,className:"absolute inset-0 w-full h-full",src:r,controls:c,muted:y,autoPlay:o?!1:i,loop:p});return n.jsxRuntimeExports.jsx("div",{...f.pick(s,["className"]),children:n.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[o?n.jsxRuntimeExports.jsx("div",{...l,...f.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,h]})})});d.registerChaiBlock(q,{type:"Video",label:"Video",category:"core",icon:m.VideoIcon,group:"media",props:{styles:e.S({default:""}),url:e.u({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:e.b({title:"Controls",properties:{autoPlay:e.r({title:"Autoplay",default:!0}),controls:e.r({title:"Show controls",default:!1}),loop:e.r({title:"Loop",default:!1}),muted:e.r({title:"Muted",default:!0})}})}});const A=u.memo(t=>{const{blockProps:l,styles:o,content:s,inBuilder:r}=t;return n.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r?n.jsxRuntimeExports.jsx("div",{...l,...o,className:"absolute z-20 h-full w-full"}):null,u.createElement("div",{...o,dangerouslySetInnerHTML:{__html:s}})]})});d.registerChaiBlock(A,{type:"CustomHTML",label:"Custom HTML",category:"core",icon:m.CodeIcon,group:"advanced",props:{styles:e.S({default:""}),content:e.g({title:"HTML Content",default:"<div><p>HTML Snippet goes here...</p></div>",placeholder:"Enter custom HTML code here"})}});const F=t=>{const{blockProps:l,styles:o}=t;return u.createElement("hr",{...o,...l})};d.registerChaiBlock(F,{type:"Divider",label:"Divider",category:"core",icon:m.DividerHorizontalIcon,group:"basic",props:{styles:e.S({default:"bg-gray-900 h-0.5 py-2 my-1"})}});const O=t=>t.inBuilder?n.jsxRuntimeExports.jsx("span",{className:"inline",...t.blockProps,children:t.content}):`${t.content}`;d.registerChaiBlock(O,{type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:m.SpaceBetweenVerticallyIcon,props:{content:e.g({title:"Content",defaultValue:""})}});const z=t=>{const{blockProps:l,backgroundImage:o,children:s,styles:r}=t;let a={};return o&&(a={backgroundImage:`url(${o})`}),u.createElement("div",{...l,...r,style:a},s)};d.registerChaiBlock(z,{type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:e.S({default:"font-body antialiased"}),backgroundImage:e.o({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const $=t=>{const{blockProps:l,styles:o}=t;return u.createElement("br",{...l,...o})};d.registerChaiBlock($,{type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:m.SpaceBetweenVerticallyIcon,props:{styles:e.S({default:""})}});const k=t=>{const l=(a,i)=>({_id:x.generateUUID(),_parent:a,_type:"TableCell",styles:"#styles:,",content:`${t==="TableHead"?"Table Head":"Table Cell "+i}`}),o=a=>{const i=x.generateUUID(),c={_type:"TableRow",_id:i,styles:"#styles:,border-b"};return a&&(c._parent=a),[c,l(i,"1"),l(i,"2"),l(i,"3")]},s=a=>{const i=x.generateUUID(),c={_id:i,_type:"TableHead",styles:"#styles:,font-medium"};return a&&(c._parent=a),[c,...o(i)]},r=a=>{const i=x.generateUUID(),c={_id:i,_type:"TableBody",styles:"#styles:,"};return a&&(c._parent=a),[c,...o(i),...o(i)]};if(t==="Table"){const a=x.generateUUID();return[{_id:a,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...s(a),...r(a)]}return t==="TableRow"?o():t==="TableHead"?s():t==="TableBody"?r():[]},V=t=>{const{blockProps:l,children:o,styles:s}=t;return o?u.createElement("table",{...l,...s},o):n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l,text:"TABLE HEAD / BODY"})};d.registerChaiBlock(V,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:m.TableIcon,props:{styles:e.S({default:""})},blocks:k("Table")});const W=t=>{const{blockProps:l,children:o,styles:s}=t;return o?u.createElement("thead",{...l,...s},o):n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l,text:"TABLE ROW"})};d.registerChaiBlock(W,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:m.BorderTopIcon,props:{styles:e.S({default:""})},blocks:k("TableHead")});const G=t=>{const{blockProps:l,children:o,styles:s}=t;return o?u.createElement("tbody",{...l,...s},o):n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l,text:"TABLE ROW"})};d.registerChaiBlock(G,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:m.BorderAllIcon,props:{styles:e.S({default:""})},blocks:k("TableBody")});const Y=t=>{const{blockProps:l,children:o,styles:s}=t;return o?u.createElement("tr",{...l,...s},o):n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l,text:"TABLE CELL"})};d.registerChaiBlock(Y,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:m.ViewHorizontalIcon,props:{styles:e.S({default:"w-full"})},blocks:k("TableRow")});const X=t=>{const{blockProps:l,children:o,content:s,styles:r}=t;return!o&&f.isEmpty(s)?n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l}):o?u.createElement("td",{...l,...r},o):u.createElement("td",{...l,...r,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(X,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:m.DragHandleHorizontalIcon,props:{styles:e.S({default:""}),content:e.m({title:"Content",default:"Table cell item"})}});const Z=t=>{const{blockProps:l,errorMessage:o,name:s,_type:r,successMessage:a,action:i,styles:c,children:y}=t;let p=y;y||(p=n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:{},text:"FORM FIELDS"}));const b={"x-data":"useForm","x-on:submit.prevent":"post"},h={"x-html":"formResponse",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return n.jsxRuntimeExports.jsxs("form",{...b,"data-error":o,"data-success":a,method:"post",action:i,...l,...c,children:[n.jsxRuntimeExports.jsx("div",{...h}),n.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||r}),p]})};d.registerChaiBlock(Z,{type:"Form",label:"Form",category:"core",icon:m.GroupIcon,group:"form",hidden:!0,props:{styles:e.S({default:""}),action:e.u({title:"Submit URL",default:"/api/form/submit"}),errorMessage:e.m({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:e.m({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0});const J=t=>{const{blockProps:l,content:o,styles:s,children:r}=t,a={...s,...l};return r?u.createElement("label",a,r):u.createElement("label",{...a,dangerouslySetInnerHTML:{__html:o}})};d.registerChaiBlock(J,{type:"Label",label:"Label",category:"core",icon:m.LetterCaseToggleIcon,group:"form",hidden:!0,props:{styles:e.S({default:""}),content:e.u({title:"Content",default:"Label"})}});const K=t=>{const{blockProps:l,inBuilder:o,label:s,placeholder:r,styles:a,inputStyles:i,icon:c,iconPos:y}=t,p=x.generateUUID(),b={"x-bind:disabled":"formLoading"};return n.jsxRuntimeExports.jsxs("button",{id:p,...b,...i,...a,...l||{},type:o?"button":"submit",placeholder:r,children:[s,c&&n.jsxRuntimeExports.jsx("span",{className:y,dangerouslySetInnerHTML:{__html:c}})]})};d.registerChaiBlock(K,{type:"FormButton",label:"Submit Button",category:"core",icon:m.ButtonIcon,group:"form",hidden:!0,props:{label:e.u({title:"Label",default:"Submit"}),styles:e.S({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:e.T({title:"Icon",default:""}),iconPos:e.f({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const Q=t=>{const{blockProps:l,fieldName:o,label:s,styles:r,inputStyles:a,required:i,checked:c,showLabel:y=!0}=t,p=x.generateUUID();return y?n.jsxRuntimeExports.jsxs("div",{...r,...l,children:[n.jsxRuntimeExports.jsx("input",{...a,name:o,id:p,type:"checkbox",required:i,defaultChecked:c}),s&&s!=="Label"&&n.jsxRuntimeExports.jsx("label",{htmlFor:p,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:p,...l,...a,...r,type:"checkbox",required:i,name:o})};d.registerChaiBlock(Q,{type:"Checkbox",label:"Checkbox",category:"core",icon:m.CheckboxIcon,group:"form",hidden:!0,props:{fieldName:e.u({title:"Field Name",default:"checkbox"}),styles:e.S({default:"flex items-center gap-x-2"}),label:e.u({title:"Label",default:"Label"}),checked:e.r({title:"Checked",default:!1}),required:e.r({title:"Required",default:!1})}});const ee=t=>{const{blockProps:l,label:o,placeholder:s,styles:r,inputStyles:a,showLabel:i,required:c,inputType:y="text",inBuilder:p,fieldName:b}=t,h=x.generateUUID();return!i||y==="submit"?(y==="submit"&&(l.value=o),n.jsxRuntimeExports.jsx("input",{id:h,name:b,readOnly:p,...l,...a,...r,type:y,placeholder:s,required:c})):n.jsxRuntimeExports.jsxs("div",{...r,...l,children:[i&&n.jsxRuntimeExports.jsx("label",{htmlFor:h,children:o}),n.jsxRuntimeExports.jsx("input",{name:b,readOnly:p,...a,id:h,type:y,placeholder:s,required:c})]})};d.registerChaiBlock(ee,{type:"Input",label:"Input",category:"core",icon:m.InputIcon,group:"form",hidden:!0,props:{styles:e.S({default:""}),fieldName:e.u({title:"Field Name",default:"input"}),inputType:e.f({title:"Type",options:f.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],t=>({value:t,title:t})),default:"text"}),value:e.u({title:"Value",default:""}),showLabel:e.r({title:"Show label",default:!0}),inputStyles:e.S({default:"w-full p-1"}),label:e.u({title:"Label",default:"Label"}),placeholder:e.u({title:"Placeholder",default:"Placeholder"}),required:e.r({title:"Required",default:!1})}});const te=t=>{const{blockProps:l,fieldName:o,label:s,styles:r,inputStyles:a,checked:i,required:c,showLabel:y=!0}=t,p=x.generateUUID();return y?n.jsxRuntimeExports.jsxs("div",{...r,...l,children:[n.jsxRuntimeExports.jsx("input",{...a,name:o,id:p,type:"radio",required:c,defaultChecked:i}),s&&n.jsxRuntimeExports.jsx("label",{htmlFor:p,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:p,...l,...a,...r,type:"radio",required:c,checked:i,name:o})};d.registerChaiBlock(te,{type:"Radio",label:"Radio",category:"core",icon:m.RadiobuttonIcon,group:"form",hidden:!0,props:{styles:e.S({default:"flex items-center w-max gap-x-2"}),fieldName:e.u({title:"Field Name",default:"radio"}),label:e.u({title:"Label",default:"Label"}),checked:e.r({title:"Checked",default:!1}),required:e.r({title:"Required",default:!1})}});const le=t=>{const{blockProps:l,fieldName:o,label:s,placeholder:r,styles:a,inputStyles:i,required:c,showLabel:y,_multiple:p=!1}=t,b=x.generateUUID();return y?n.jsxRuntimeExports.jsxs("div",{...a,children:[y&&n.jsxRuntimeExports.jsx("label",{htmlFor:b,children:s}),n.jsxRuntimeExports.jsxs("select",{...i,id:b,placeholder:r,required:c,multiple:p,name:o,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),f.map(t.options,h=>n.jsxRuntimeExports.jsx("option",{selected:f.get(h,"selected",!1),value:h.value,dangerouslySetInnerHTML:{__html:h.label}},h.value))]})]}):n.jsxRuntimeExports.jsxs("select",{id:b,...a,...l,placeholder:r,required:c,multiple:p,name:o,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),f.map(t.options,h=>n.jsxRuntimeExports.jsx("option",{selected:f.get(h,"selected",!1),value:h.value,dangerouslySetInnerHTML:{__html:h.label}},h.value))]})};d.registerChaiBlock(le,{type:"Select",label:"Select",category:"core",icon:m.DropdownMenuIcon,group:"form",hidden:!0,props:{styles:e.S({default:""}),fieldName:e.u({title:"Field Name",default:"select"}),showLabel:e.r({title:"Show label",default:!0}),inputStyles:e.S({default:"w-full p-1"}),label:e.u({title:"Label",default:"Label"}),placeholder:e.u({title:"Placeholder",default:"Placeholder"}),required:e.r({title:"Required",default:!1}),_multiple:e.r({title:"Multiple Choice",default:!1}),options:e.h({title:"Options",itemProperties:{label:e.u({title:"Label",default:""}),value:e.u({title:"Value",default:""})}})}});const oe=t=>{const{blockProps:l,fieldName:o,label:s,placeholder:r,styles:a,inputStyles:i,_rows:c,showLabel:y}=t,p=x.generateUUID();return y?n.jsxRuntimeExports.jsxs("div",{...a,...l,children:[y&&n.jsxRuntimeExports.jsx("label",{htmlFor:p,children:s}),n.jsxRuntimeExports.jsx("textarea",{name:o,...i,id:p,placeholder:r,rows:c})]}):n.jsxRuntimeExports.jsx("textarea",{id:p,name:o,...l,...i,...a,placeholder:r,rows:c})};d.registerChaiBlock(oe,{type:"TextArea",label:"TextArea",category:"core",icon:m.InputIcon,group:"form",hidden:!0,props:{fieldName:e.u({title:"Field Name",default:"textarea"}),showLabel:e.r({title:"Show label",default:!0}),styles:e.S({default:""}),inputStyles:e.S({default:"w-full p-1"}),label:e.u({title:"Label",default:"Label"}),placeholder:e.u({title:"Placeholder",default:"Placeholder"}),_rows:e.c({title:"Rows",default:3})}});const se=f.noop;exports.loadWebBlocks=se;
|