@chaibuilder/sdk 1.2.19 → 1.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AddBlocks-157fSrJX.cjs +1 -0
- package/dist/{AddBlocks-gcTaEIKO.js → AddBlocks-WgpssWmQ.js} +25 -27
- package/dist/{BrandingOptions-bfiFY0VR.js → BrandingOptions-4961TxX2.js} +13 -15
- package/dist/BrandingOptions-nwXR9TMl.cjs +1 -0
- package/dist/CanvasArea-_BFTu_8b.js +908 -0
- package/dist/CanvasArea-eOKWgAXR.cjs +55 -0
- package/dist/{CurrentPage-0Ap2N0uc.js → CurrentPage-VAuh7F6E.js} +13 -16
- package/dist/CurrentPage-iB6nD9Rr.cjs +1 -0
- package/dist/ListTree-dvxHTXs4.js +167 -0
- package/dist/ListTree-gTmusfso.cjs +1 -0
- package/dist/Outline-g8XFGm2t.cjs +1 -0
- package/dist/Outline-jTFv40r5.js +294 -0
- package/dist/PagesPanel-Wx9JG5qR.cjs +1 -0
- package/dist/{PagesPanel-Pk-C1956.js → PagesPanel-oky0X1Ww.js} +5 -8
- package/dist/ProjectPanel-64Xg3Y_p.cjs +1 -0
- package/dist/{ProjectPanel-_KQBhuPO.js → ProjectPanel-WjVBiB-e.js} +15 -18
- package/dist/Settings-Tlqq4mqN.cjs +1 -0
- package/dist/{Settings-XtAatoiu.js → Settings-mNRbprbx.js} +761 -709
- package/dist/SidePanels-ZF4Q2R29.cjs +1 -0
- package/dist/{SidePanels-O52zKXbH.js → SidePanels-pQImwDI6.js} +7 -10
- package/dist/Topbar-NMvzqQHW.cjs +1 -0
- package/dist/{Topbar-oTx7a12r.js → Topbar-Ny9T-7Zb.js} +3 -5
- package/dist/TypeIcon-ElNNPazl.cjs +1 -0
- package/dist/TypeIcon-qO96rNbV.js +69 -0
- package/dist/UnsplashImages-6tZv1q2_.cjs +1 -0
- package/dist/{UnsplashImages-5A21uzMK.js → UnsplashImages-Y8RGFVSh.js} +13 -15
- package/dist/UploadImages-VLlVg9Ur.cjs +1 -0
- package/dist/{UploadImages-V_54lCAO.js → UploadImages-dd8LfyFr.js} +8 -10
- package/dist/{add-page-modal-dKQLw7RQ.js → add-page-modal-1mGGtAB_.js} +16 -19
- package/dist/add-page-modal-xCUKJiZv.cjs +1 -0
- package/dist/confirm-alert-f26zJ7Js.cjs +1 -0
- package/dist/{confirm-alert-8GP3bKH_.js → confirm-alert-sc8RaWvD.js} +3 -5
- package/dist/{controls-Dy1qa8Dc.cjs → controls-KK2oLIa8.cjs} +1 -1
- package/dist/{controls-XPXGHKht.js → controls-OfJWSEqC.js} +29 -28
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +45 -48
- package/dist/delete-page-modal-Qa0YqBRl.cjs +1 -0
- package/dist/{delete-page-modal-Zb5ld6O-.js → delete-page-modal-yAJNstCa.js} +8 -11
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +5 -5
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +1 -0
- package/dist/email.js +4 -7
- package/dist/{form-yyU2x7So.js → form-Nj6Kdn3g.js} +1 -1
- package/dist/{form-o6_55v8F.cjs → form-n1Q6u16z.cjs} +1 -1
- package/dist/index-9PHdn80L.cjs +1 -0
- package/dist/{index-JdnF6lYP.cjs → index-9YNkdni8.cjs} +51 -51
- package/dist/{index-WP7IRkij.js → index-IPJAbzzO.js} +1178 -1133
- package/dist/{index-BMZLAJUV.cjs → index-PlZjGTTr.cjs} +1 -1
- package/dist/{index-lFcrvDFC.js → index-iQEapw2W.js} +3 -3
- package/dist/{index-yILWlilS.js → index-kAjyc_KA.js} +8306 -8170
- package/dist/{page-viewer-3QXwPGpg.js → page-viewer-SU_BqZDK.js} +9 -12
- package/dist/page-viewer-ZA-sJD82.cjs +1 -0
- package/dist/project-general-setting-GuQyvAHS.cjs +1 -0
- package/dist/{project-general-setting-UalRmyHm.js → project-general-setting-eEmhoFvb.js} +7 -10
- package/dist/project-seo-setting-3-vBkx2v.cjs +1 -0
- package/dist/{project-seo-setting-8FsvPSPl.js → project-seo-setting-NNvAGt4T.js} +5 -7
- package/dist/single-page-detail-Z677SWqt.cjs +1 -0
- package/dist/{single-page-detail-GaB85dNv.js → single-page-detail-nxWIy6e7.js} +36 -39
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +1 -0
- package/dist/studio.js +4 -7
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +138 -140
- package/dist/{useAddBlockByDrop-BIK2fdgj.js → useAddBlockByDrop-V8xo-PNQ.js} +1 -1
- package/dist/{useAddBlockByDrop-6EbioQV4.cjs → useAddBlockByDrop-qRHgy8_0.cjs} +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +1 -1
- package/package.json +26 -38
- package/dist/AddBlocks-KeHVFaIr.cjs +0 -1
- package/dist/BrandingOptions-I2I8w6E9.cjs +0 -1
- package/dist/CanvasArea-JfHkTnQD.cjs +0 -60
- package/dist/CanvasArea-xvMCbQDL.js +0 -1404
- package/dist/CurrentPage-vj52UxMA.cjs +0 -1
- package/dist/ListTree-Vq0_s1wC.cjs +0 -1
- package/dist/ListTree-k-QMO740.js +0 -96
- package/dist/Outline-HI6-c9nf.js +0 -359
- package/dist/Outline-fAflJ_lN.cjs +0 -1
- package/dist/PagesPanel-ug8Tmva6.cjs +0 -1
- package/dist/ProjectPanel-o8-6cPX-.cjs +0 -1
- package/dist/Settings-Cc9eV4VG.cjs +0 -1
- package/dist/SidePanels-ugRobm34.cjs +0 -1
- package/dist/Topbar-e5MGWX9n.cjs +0 -1
- package/dist/UnsplashImages-KSbKGs91.cjs +0 -1
- package/dist/UploadImages-V42YSRVO.cjs +0 -1
- package/dist/add-page-modal-xMedOdsp.cjs +0 -1
- package/dist/confirm-alert-KtW-4OjG.cjs +0 -1
- package/dist/delete-page-modal-lebJCBBe.cjs +0 -1
- package/dist/index-thKfFhmr.cjs +0 -1
- package/dist/page-viewer-DTIblLiz.cjs +0 -1
- package/dist/project-general-setting-g7WhM3hc.cjs +0 -1
- package/dist/project-seo-setting-xoeLQVj3.cjs +0 -1
- package/dist/single-page-detail-XdBysrE_.cjs +0 -1
package/dist/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b9 as
|
|
1
|
+
import { b9 as q, bc as y, ba as z, bb as J, bp as K, bC as W, A as X, ai as Y, g as Z, b as _, e as $, f as N, c as O, d as Q, a as U, bq as aa, as as ea, B as oa, bj as ta, bm as ra, bl as sa, bo as na, bk as ia, bE as ba, aY as pa, cc as ua, a$ as la, b0 as ma, aZ as ca, b1 as da, a_ as ga, ce as Ca, cd as Ma, bu as Sa, cf as Da, bt as Ta, ck as xa, bs as Aa, ch as ha, cl as Ia, cp as wa, cg as Pa, ci as ka, cj as Fa, cm as Ga, cn as La, co as va, bv as Ha, ad as Ra, ae as Ba, ah as Va, b2 as fa, af as Ea, ag as ja, ao as qa, aG as ya, aL as za, aI as Ja, bg as Ka, bh as Wa, aJ as Xa, c4 as Ya, c8 as Za, c3 as _a, aK as $a, bi as Na, c5 as Oa, c6 as Qa, c7 as Ua, aH as ae, aD as ee, aF as oe, aE as te, b6 as re, b7 as se, bd as ne, aB as ie, b8 as be, bG as pe, bN as ue, bJ as le, bT as me, bK as ce, bM as de, bH as ge, bQ as Ce, bO as Me, bP as Se, bL as De, bV as Te, bU as xe, bR as Ae, bS as he, bI as Ie, aV as we, aX as Pe, aW as ke, b5 as Fe, bf as Ge, bF as Le, aj as ve, am as He, ay as Re, an as Be, az as Ve, bW as fe, ak as Ee, al as je, aA as qe, bX as ye, bZ as ze, b_ as Je, c2 as Ke, c0 as We, b$ as Xe, c1 as Ye, bY as Ze, S as _e, aC as $e, au as Ne, ax as Oe, av as Qe, aw as Ue, bn as ao, I as eo, bz as oo, ap as to, ar as ro, be as so, T as no, aq as io, bD as bo, bB as po, c9 as uo, cb as lo, bA as mo, ca as co } from "./index-IPJAbzzO.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "lodash-es";
|
|
4
4
|
import "./Functions-7jnEwJyw.js";
|
|
@@ -9,7 +9,6 @@ import "jotai";
|
|
|
9
9
|
import "./MODIFIERS-WQdaNvb8.js";
|
|
10
10
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
11
11
|
import "@react-hookz/web";
|
|
12
|
-
import "flat-to-nested";
|
|
13
12
|
import "./jsx-runtime-WbnYoNE9.js";
|
|
14
13
|
import "@radix-ui/react-toggle";
|
|
15
14
|
import "class-variance-authority";
|
|
@@ -36,144 +35,143 @@ import "@radix-ui/react-context-menu";
|
|
|
36
35
|
import "react-icons-picker";
|
|
37
36
|
import "react-dom";
|
|
38
37
|
import "react-quill";
|
|
39
|
-
import "lodash";
|
|
40
38
|
import "react-i18next";
|
|
41
39
|
export {
|
|
42
|
-
|
|
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
|
-
|
|
40
|
+
q as Accordion,
|
|
41
|
+
y as AccordionContent,
|
|
42
|
+
z as AccordionItem,
|
|
43
|
+
J as AccordionTrigger,
|
|
44
|
+
K as Alert,
|
|
45
|
+
W as AlertDescription,
|
|
46
|
+
X as AlertDialog,
|
|
47
|
+
Y as AlertDialogAction,
|
|
48
|
+
Z as AlertDialogCancel,
|
|
49
|
+
_ as AlertDialogContent,
|
|
50
|
+
$ as AlertDialogDescription,
|
|
51
|
+
N as AlertDialogFooter,
|
|
52
|
+
O as AlertDialogHeader,
|
|
53
|
+
Q as AlertDialogTitle,
|
|
54
|
+
U as AlertDialogTrigger,
|
|
55
|
+
aa as AlertTitle,
|
|
56
|
+
ea as Badge,
|
|
57
|
+
oa as Button,
|
|
58
|
+
ta as Card,
|
|
59
|
+
ra as CardContent,
|
|
60
|
+
sa as CardDescription,
|
|
61
|
+
na as CardFooter,
|
|
62
|
+
ia as CardHeader,
|
|
63
|
+
ba as CardTitle,
|
|
64
|
+
pa as Command,
|
|
65
|
+
ua as CommandDialog,
|
|
66
|
+
la as CommandEmpty,
|
|
67
|
+
ma as CommandGroup,
|
|
68
|
+
ca as CommandInput,
|
|
69
|
+
da as CommandItem,
|
|
70
|
+
ga as CommandList,
|
|
71
|
+
Ca as CommandSeparator,
|
|
72
|
+
Ma as CommandShortcut,
|
|
73
|
+
Sa as ContextMenu,
|
|
74
|
+
Da as ContextMenuCheckboxItem,
|
|
75
|
+
Ta as ContextMenuContent,
|
|
76
|
+
xa as ContextMenuGroup,
|
|
77
|
+
Aa as ContextMenuItem,
|
|
78
|
+
ha as ContextMenuLabel,
|
|
79
|
+
Ia as ContextMenuPortal,
|
|
80
|
+
wa as ContextMenuRadioGroup,
|
|
81
|
+
Pa as ContextMenuRadioItem,
|
|
82
|
+
ka as ContextMenuSeparator,
|
|
83
|
+
Fa as ContextMenuShortcut,
|
|
84
|
+
Ga as ContextMenuSub,
|
|
85
|
+
La as ContextMenuSubContent,
|
|
86
|
+
va as ContextMenuSubTrigger,
|
|
87
|
+
Ha as ContextMenuTrigger,
|
|
88
|
+
Ra as Dialog,
|
|
89
|
+
Ba as DialogContent,
|
|
90
|
+
Va as DialogDescription,
|
|
91
|
+
fa as DialogFooter,
|
|
92
|
+
Ea as DialogHeader,
|
|
93
|
+
ja as DialogTitle,
|
|
94
|
+
qa as DialogTrigger,
|
|
95
|
+
ya as DropdownMenu,
|
|
96
|
+
za as DropdownMenuCheckboxItem,
|
|
97
|
+
Ja as DropdownMenuContent,
|
|
98
|
+
Ka as DropdownMenuGroup,
|
|
99
|
+
Wa as DropdownMenuItem,
|
|
100
|
+
Xa as DropdownMenuLabel,
|
|
101
|
+
Ya as DropdownMenuPortal,
|
|
102
|
+
Za as DropdownMenuRadioGroup,
|
|
103
|
+
_a as DropdownMenuRadioItem,
|
|
104
|
+
$a as DropdownMenuSeparator,
|
|
105
|
+
Na as DropdownMenuShortcut,
|
|
106
|
+
Oa as DropdownMenuSub,
|
|
107
|
+
Qa as DropdownMenuSubContent,
|
|
108
|
+
Ua as DropdownMenuSubTrigger,
|
|
109
|
+
ae as DropdownMenuTrigger,
|
|
110
|
+
ee as HoverCard,
|
|
111
|
+
oe as HoverCardContent,
|
|
112
|
+
te as HoverCardTrigger,
|
|
113
|
+
re as IconPickerField,
|
|
114
|
+
se as ImagePickerField,
|
|
115
|
+
ne as Input,
|
|
116
|
+
ie as Label,
|
|
117
|
+
be as LinkField,
|
|
118
|
+
pe as Menubar,
|
|
119
|
+
ue as MenubarCheckboxItem,
|
|
120
|
+
le as MenubarContent,
|
|
121
|
+
me as MenubarGroup,
|
|
122
|
+
ce as MenubarItem,
|
|
123
|
+
de as MenubarLabel,
|
|
124
|
+
ge as MenubarMenu,
|
|
125
|
+
Ce as MenubarPortal,
|
|
126
|
+
Me as MenubarRadioGroup,
|
|
127
|
+
Se as MenubarRadioItem,
|
|
128
|
+
De as MenubarSeparator,
|
|
129
|
+
Te as MenubarShortcut,
|
|
130
|
+
xe as MenubarSub,
|
|
131
|
+
Ae as MenubarSubContent,
|
|
132
|
+
he as MenubarSubTrigger,
|
|
133
|
+
Ie as MenubarTrigger,
|
|
134
|
+
we as Popover,
|
|
135
|
+
Pe as PopoverContent,
|
|
136
|
+
ke as PopoverTrigger,
|
|
137
|
+
Fe as RTEField,
|
|
138
|
+
Ge as ScrollArea,
|
|
139
|
+
Le as ScrollBar,
|
|
140
|
+
ve as Select,
|
|
141
|
+
He as SelectContent,
|
|
142
|
+
Re as SelectGroup,
|
|
143
|
+
Be as SelectItem,
|
|
144
|
+
Ve as SelectLabel,
|
|
145
|
+
fe as SelectSeparator,
|
|
146
|
+
Ee as SelectTrigger,
|
|
147
|
+
je as SelectValue,
|
|
148
|
+
qe as Separator,
|
|
149
|
+
ye as Sheet,
|
|
150
|
+
ze as SheetClose,
|
|
151
|
+
Je as SheetContent,
|
|
152
|
+
Ke as SheetDescription,
|
|
153
|
+
We as SheetFooter,
|
|
154
|
+
Xe as SheetHeader,
|
|
155
|
+
Ye as SheetTitle,
|
|
156
|
+
Ze as SheetTrigger,
|
|
157
|
+
_e as Skeleton,
|
|
158
|
+
$e as Switch,
|
|
159
|
+
Ne as Tabs,
|
|
160
|
+
Oe as TabsContent,
|
|
161
|
+
Qe as TabsList,
|
|
162
|
+
Ue as TabsTrigger,
|
|
163
|
+
ao as Textarea,
|
|
164
|
+
eo as Toaster,
|
|
165
|
+
oo as Toggle,
|
|
166
|
+
to as Tooltip,
|
|
167
|
+
ro as TooltipContent,
|
|
168
|
+
so as TooltipPortal,
|
|
169
|
+
no as TooltipProvider,
|
|
170
|
+
io as TooltipTrigger,
|
|
171
|
+
bo as badgeVariants,
|
|
172
|
+
po as buttonVariants,
|
|
173
|
+
uo as reducer,
|
|
174
|
+
lo as toast,
|
|
175
|
+
mo as toggleVariants,
|
|
176
|
+
co as useToast
|
|
179
177
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback as d } from "react";
|
|
2
2
|
import { noop as s, has as a } from "lodash-es";
|
|
3
|
-
import { L as u, h as i } from "./index-
|
|
3
|
+
import { L as u, h as i } from "./index-IPJAbzzO.js";
|
|
4
4
|
const f = () => {
|
|
5
5
|
const { addCoreBlock: r } = u(), l = i("getExternalPredefinedBlock", s);
|
|
6
6
|
return d(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const u=require("react"),t=require("lodash-es"),l=require("./index-
|
|
1
|
+
"use strict";const u=require("react"),t=require("lodash-es"),l=require("./index-9PHdn80L.cjs"),a=()=>{const{addCoreBlock:o}=l.useAddBlock(),s=l.useBuilderProp("getExternalPredefinedBlock",t.noop);return u.useCallback(async n=>{const{block:r,dropTargetId:e,relativeIndex:c}=n;if(t.has(r,"format")){const d=await s(r);return o({blocks:d},e===0?null:e,c)}return o(r,e===0?null:e,c)},[o])};exports.useAddBlockByDrop=a;
|
package/dist/web-blocks.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("lodash-es"),a=require("./jsx-runtime-Z_BpKhVy.cjs"),I=require("react"),t=require("./controls-Dy1qa8Dc.cjs"),d=require("@chaibuilder/runtime"),g=require("./empty-slot-nzYOgZuS.cjs"),y=require("@radix-ui/react-icons"),x=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("tailwind-merge");function v(e){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(l,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return l.default=e,Object.freeze(l)}const u=v(I),R=u.memo(e=>{const{blockProps:l,inBuilder:o,backgroundImage:r,children:s,tag:n="div",styles:i}=e;let c=s;s||(c=a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:{},styles:{},inBuilder:o}));let p={};return r&&(p={backgroundImage:`url(${r})`}),u.createElement(n,{...l,...i,style:p},c)});d.registerChaiBlock(R,{type:"Box",label:"Box",category:"core",group:"basic",props:{styles:t.S({default:""}),tag:t.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:t.o({title:"Background Image"})},canAcceptBlock:()=>!0});const L=e=>{const{blockProps:l,styles:o,content:r,level:s="h1",children:n=null}=e;return n?u.createElement(s,{...o,...l},n):u.createElement(s,{...o,...l,dangerouslySetInnerHTML:{__html:r}})};d.registerChaiBlock(L,{type:"Heading",label:"Heading",category:"core",icon:y.HeadingIcon,group:"typography",props:{level:t.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:t.S({default:"text-3xl"}),content:t.g({title:"Content",default:"Heading goes here"})},canAcceptBlock:e=>e==="Span"||e==="Text"});const T=e=>{const{blockProps:l,styles:o,content:r}=e;return f.isNull(e.children)?u.createElement("div",{...o,...l,dangerouslySetInnerHTML:{__html:r}}):u.createElement("p",{...o,...l},e.children)};d.registerChaiBlock(T,{type:"Paragraph",label:"Paragraph",category:"core",icon:y.TextIcon,group:"typography",props:{styles:t.S({default:""}),content:t.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 w=e=>{const{blockProps:l,styles:o,content:r,children:s=null,tag:n}=e;return s?u.createElement("span",{...o,...l},s):u.createElement(n||"span",{...o,...l,dangerouslySetInnerHTML:{__html:r}})};d.registerChaiBlock(w,{type:"Span",label:"Span",category:"core",group:"typography",props:{styles:t.S({default:""}),content:t.g({title:"Content",default:"Enter your content"})}});const C=e=>{const{blockProps:l,content:o,styles:r}=e;return a.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:a.jsxRuntimeExports.jsx("div",{...l,...r,dangerouslySetInnerHTML:{__html:o}})})};d.registerChaiBlock(C,{type:"RichText",label:"Rich Text",category:"core",icon:y.CursorTextIcon,group:"typography",props:{styles:t.S({default:""}),content:t.m({title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}});const _=e=>{const{blockProps:l,iconSize:o,icon:r,content:s,iconPos:n,styles:i,children:c}=e,p=r,m=c||a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[a.jsxRuntimeExports.jsx("span",{children:s}),p&&a.jsxRuntimeExports.jsx("div",{style:{width:o+"px"},className:n+" "+(n==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:p}})]});return u.createElement("button",{...l,...i,type:"button"},m)};d.registerChaiBlock(_,{type:"Button",label:"Button",category:"core",icon:y.ButtonIcon,group:"basic",props:{content:t.u({title:"Label",default:"Button",multiLingual:!0}),styles:t.S({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:t.T({title:"Icon",default:""}),iconSize:t.c({title:"Icon Size",default:24}),iconPos:t.f({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const P=e=>{const{blockProps:l,link:o,children:r,styles:s,inBuilder:n,content:i}=e;return!r&&f.isEmpty(s==null?void 0:s.className)&&f.isEmpty(i)?a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:l,inBuilder:n}):n?r?a.jsxRuntimeExports.jsx("span",{"data-simulate":"a",...l,...s,children:r}):u.createElement("span",{...l,...s,dangerouslySetInnerHTML:{__html:i},"data-simulate":"a"}):r?a.jsxRuntimeExports.jsx("a",{href:o.href||"#/",target:o.target,...l,...s,children:r}):u.createElement("a",{...l,...s,href:o.href||"#",target:o.target||"_self",dangerouslySetInnerHTML:{__html:i}})};d.registerChaiBlock(P,{type:"Link",label:"Link",category:"core",icon:y.Link1Icon,group:"basic",props:{styles:t.S({default:""}),content:t.u({title:"Content",default:""}),link:t.q({title:"Link",default:{type:"page",target:"_self",href:""}})},canAcceptBlock:()=>!0});const N=e=>{const{blockProps:l,children:o,listType:r,styles:s,tag:n,inBuilder:i}=e,c=x.cn(f.get(s,"className",""),r);return!o&&f.isEmpty(s==null?void 0:s.className)?a.jsxRuntimeExports.jsx(g.EmptySlot,{inBuilder:i,blockProps:l,text:"LIST ITEM"}):u.createElement(n||(r==="list-decimal"?"ol":"ul"),{...l,...s,className:c},o)};d.registerChaiBlock(N,{type:"List",label:"List",icon:y.RowsIcon,category:"core",group:"basic",props:{styles:t.S({default:""}),listType:t.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 M=e=>{const{blockProps:l,content:o,styles:r,children:s,tag:n}=e;return s?u.createElement(n||"li",{...r,...l},s):u.createElement(n||"li",{...r,...l,dangerouslySetInnerHTML:{__html:o}})};d.registerChaiBlock(M,{type:"ListItem",label:"List Item",icon:y.ColumnsIcon,category:"core",group:"basic",props:{styles:t.S({default:""}),content:t.g({title:"Content",default:"List item"})},canAcceptBlock:()=>!0,canBeNested:e=>e==="List"});const H=e=>{const{blockProps:l,icon:o,styles:r,width:s,inBuilder:n,height:i}=e,c={...r,className:x.cn(r.className,"inline-block c-inline-block",`w-[${s}px]`,`h-[${i}px]`)};return f.isEmpty(o)?a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:l,text:"",inBuilder:n,className:"h-8 w-14"}):u.createElement("span",{...l,...c,dangerouslySetInnerHTML:{__html:o}})};d.registerChaiBlock(H,{type:"Icon",label:"Icon",category:"core",icon:y.SketchLogoIcon,group:"media",props:{styles:t.S({default:"text-black"}),icon:t.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:t.c({title:"Width",default:40}),height:t.c({title:"Height",default:40})}});const U=e=>{const{blockProps:l,image:o,styles:r,alt:s,height:n,width:i}=e;return f.isEmpty(o)?a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:l,text:"IMAGE URL",className:"h-36"}):u.createElement("img",{...l,...r,src:o,alt:s,height:n,width:i})};d.registerChaiBlock(U,{type:"Image",label:"Image",category:"core",icon:y.ImageIcon,group:"media",props:{styles:t.S({default:""}),image:t.o({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:t.u({title:"Alt",default:""}),width:t.u({title:"Width",default:""}),height:t.u({title:"Height",default:""})}});const D=e=>{var i;const{blockProps:l,inBuilder:o,styles:r,children:s}=e;let n=null;return!s&&o&&(n=a.jsxRuntimeExports.jsx("div",{className:x.cn("flex flex-col items-center justify-center",(i=e.emptyStyles)==null?void 0:i.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",{...r,...l,droppable:"yes"},s||n)};d.registerChaiBlock(D,{type:"Slot",label:"Slot",group:"basic",category:"core",hidden:!0,props:{styles:t.S({default:""}),emptyStyles:t.S({default:""})},canAcceptBlock:()=>!0});const B=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,j=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,S=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,q=e=>{if(B.test(e)){const l=e.match(B);return l?`https://www.youtube.com/embed/${l[4]}`:e}if(j.test(e)){const l=e.match(j);return l?`https://player.vimeo.com/video/${l[3]}`:e}if(S.test(e)){const l=e.match(S);return l?`https://www.dailymotion.com/embed/video/${l[4]}`:e}return null},A=u.memo(e=>{const{blockProps:l,inBuilder:o,styles:r,url:s,controls:n}=e,i=f.get(n,"autoPlay",!1),c=f.get(n,"controls",!1),p=i||f.get(n,"muted",!0),m=f.get(n,"loop",!1);if(f.isEmpty(s))return a.jsxRuntimeExports.jsx(g.EmptySlot,{inBuilder:o,blockProps:l,text:"VIDEO URL",className:"h-36"});let b=q(s),h=null;if(b){if(!f.isEmpty(b)){const k=[];k.push(`autoplay=${i?1:0}`),k.push(`controls=${n?1:0}`),k.push(`mute=${p?1:0}&muted=${p?1:0}`),k.push(`loop=${m?1:0}`),b=`${b}?${k.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:s,controls:c,muted:p,autoPlay:o?!1:i,loop:m});return a.jsxRuntimeExports.jsx("div",{...f.pick(r,["className"]),children:a.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[o?a.jsxRuntimeExports.jsx("div",{...l,...f.omit(r,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,h]})})});d.registerChaiBlock(A,{type:"Video",label:"Video",category:"core",icon:y.VideoIcon,group:"media",props:{styles:t.S({default:""}),url:t.u({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:t.b({title:"Controls",properties:{autoPlay:t.r({title:"Autoplay",default:!0}),controls:t.r({title:"Show controls",default:!1}),loop:t.r({title:"Loop",default:!1}),muted:t.r({title:"Muted",default:!0})}})}});const F=u.memo(e=>{const{blockProps:l,styles:o,content:r,inBuilder:s}=e;return a.jsxRuntimeExports.jsxs("div",{className:"relative",children:[s?a.jsxRuntimeExports.jsx("div",{...l,...o,className:"absolute z-20 h-full w-full"}):null,u.createElement("div",{...o,dangerouslySetInnerHTML:{__html:r}})]})});d.registerChaiBlock(F,{type:"CustomHTML",label:"Custom HTML",category:"core",icon:y.CodeIcon,group:"advanced",props:{styles:t.S({default:""}),content:t.g({title:"HTML Content",default:"<div><p>HTML Snippet goes here...</p></div>",placeholder:"Enter custom HTML code here"})}});const O=e=>{const{blockProps:l,styles:o}=e;return u.createElement("hr",{...o,...l})};d.registerChaiBlock(O,{type:"Divider",label:"Divider",category:"core",icon:y.DividerHorizontalIcon,group:"basic",props:{styles:t.S({default:"bg-gray-900 h-0.5 py-2 my-1"})}});const z=e=>e.inBuilder?a.jsxRuntimeExports.jsx("span",{className:"inline",...e.blockProps,children:e.content}):`${e.content}`;d.registerChaiBlock(z,{type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:y.SpaceBetweenVerticallyIcon,props:{content:t.g({title:"Content",defaultValue:""})}});const $=e=>{const{blockProps:l,backgroundImage:o,children:r,styles:s}=e;let n={};return o&&(n={backgroundImage:`url(${o})`}),u.createElement("div",{...l,...s,style:n},r)};d.registerChaiBlock($,{type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:t.S({default:"font-body antialiased"}),backgroundImage:t.o({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const V=e=>{const{blockProps:l,styles:o}=e;return u.createElement("br",{...l,...o})};d.registerChaiBlock(V,{type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:y.SpaceBetweenVerticallyIcon,props:{styles:t.S({default:""})}});const E=e=>{const l=(n,i)=>({_id:x.generateUUID(),_parent:n,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+i}`}),o=n=>{const i=x.generateUUID(),c={_type:"TableRow",_id:i,styles:"#styles:,border-b"};return n&&(c._parent=n),[c,l(i,"1"),l(i,"2"),l(i,"3")]},r=n=>{const i=x.generateUUID(),c={_id:i,_type:"TableHead",styles:"#styles:,font-medium"};return n&&(c._parent=n),[c,...o(i)]},s=n=>{const i=x.generateUUID(),c={_id:i,_type:"TableBody",styles:"#styles:,"};return n&&(c._parent=n),[c,...o(i),...o(i)]};if(e==="Table"){const n=x.generateUUID();return[{_id:n,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...r(n),...s(n)]}return e==="TableRow"?o():e==="TableHead"?r():e==="TableBody"?s():[]},W=e=>{const{blockProps:l,children:o,styles:r}=e;return o?u.createElement("table",{...l,...r},o):a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:l,text:"TABLE HEAD / BODY"})};d.registerChaiBlock(W,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:y.TableIcon,props:{styles:t.S({default:""})},blocks:E("Table")});const G=e=>{const{blockProps:l,children:o,styles:r}=e;return o?u.createElement("thead",{...l,...r},o):a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:l,text:"TABLE ROW"})};d.registerChaiBlock(G,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:y.BorderTopIcon,props:{styles:t.S({default:""})},blocks:E("TableHead")});const Y=e=>{const{blockProps:l,children:o,styles:r}=e;return o?u.createElement("tbody",{...l,...r},o):a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:l,text:"TABLE ROW"})};d.registerChaiBlock(Y,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:y.BorderAllIcon,props:{styles:t.S({default:""})},blocks:E("TableBody")});const X=e=>{const{blockProps:l,children:o,styles:r}=e;return o?u.createElement("tr",{...l,...r},o):a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:l,text:"TABLE CELL"})};d.registerChaiBlock(X,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:y.ViewHorizontalIcon,props:{styles:t.S({default:"w-full"})},blocks:E("TableRow")});const Z=e=>{const{blockProps:l,children:o,content:r,styles:s}=e;return!o&&f.isEmpty(r)?a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:l}):o?u.createElement("td",{...l,...s},o):u.createElement("td",{...l,...s,dangerouslySetInnerHTML:{__html:r}})};d.registerChaiBlock(Z,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:y.DragHandleHorizontalIcon,props:{styles:t.S({default:""}),content:t.m({title:"Content",default:"Table cell item"})}});const J=e=>{const{blockProps:l,errorMessage:o,name:r,_type:s,successMessage:n,action:i,styles:c,children:p}=e;let m=p;p||(m=a.jsxRuntimeExports.jsx(g.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 a.jsxRuntimeExports.jsxs("form",{...b,"data-error":o,"data-success":n,method:"post",action:i,...l,...c,children:[a.jsxRuntimeExports.jsx("div",{...h}),a.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:r||s}),m]})};d.registerChaiBlock(J,{type:"Form",label:"Form",category:"core",icon:y.GroupIcon,group:"form",hidden:!0,props:{styles:t.S({default:""}),action:t.u({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});const K=e=>{const{blockProps:l,content:o,styles:r,children:s}=e,n={...r,...l};return s?u.createElement("label",n,s):u.createElement("label",{...n,dangerouslySetInnerHTML:{__html:o}})};d.registerChaiBlock(K,{type:"Label",label:"Label",category:"core",icon:y.LetterCaseToggleIcon,group:"form",hidden:!0,props:{styles:t.S({default:""}),content:t.u({title:"Content",default:"Label"})}});const Q=e=>{const{blockProps:l,inBuilder:o,label:r,placeholder:s,styles:n,inputStyles:i,icon:c,iconPos:p}=e,m=x.generateUUID(),b={"x-bind:disabled":"formLoading"};return a.jsxRuntimeExports.jsxs("button",{id:m,...b,...i,...n,...l||{},type:o?"button":"submit",placeholder:s,children:[r,c&&a.jsxRuntimeExports.jsx("span",{className:p,dangerouslySetInnerHTML:{__html:c}})]})};d.registerChaiBlock(Q,{type:"FormButton",label:"Submit Button",category:"core",icon:y.ButtonIcon,group:"form",hidden:!0,props:{label:t.u({title:"Label",default:"Submit"}),styles:t.S({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:t.T({title:"Icon",default:""}),iconPos:t.f({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const ee=e=>{const{blockProps:l,fieldName:o,label:r,styles:s,inputStyles:n,required:i,checked:c,showLabel:p=!0}=e,m=x.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...s,...l,children:[a.jsxRuntimeExports.jsx("input",{...n,name:o,id:m,type:"checkbox",required:i,defaultChecked:c}),r&&r!=="Label"&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:r})]}):a.jsxRuntimeExports.jsx("input",{id:m,...l,...n,...s,type:"checkbox",required:i,name:o})};d.registerChaiBlock(ee,{type:"Checkbox",label:"Checkbox",category:"core",icon:y.CheckboxIcon,group:"form",hidden:!0,props:{fieldName:t.u({title:"Field Name",default:"checkbox"}),styles:t.S({default:"flex items-center gap-x-2"}),label:t.u({title:"Label",default:"Label"}),checked:t.r({title:"Checked",default:!1}),required:t.r({title:"Required",default:!1})}});const te=e=>{const{blockProps:l,label:o,placeholder:r,styles:s,inputStyles:n,showLabel:i,required:c,inputType:p="text",inBuilder:m,fieldName:b}=e,h=x.generateUUID();return!i||p==="submit"?(p==="submit"&&(l.value=o),a.jsxRuntimeExports.jsx("input",{id:h,name:b,readOnly:m,...l,...n,...s,type:p,placeholder:r,required:c})):a.jsxRuntimeExports.jsxs("div",{...s,...l,children:[i&&a.jsxRuntimeExports.jsx("label",{htmlFor:h,children:o}),a.jsxRuntimeExports.jsx("input",{name:b,readOnly:m,...n,id:h,type:p,placeholder:r,required:c})]})};d.registerChaiBlock(te,{type:"Input",label:"Input",category:"core",icon:y.InputIcon,group:"form",hidden:!0,props:{styles:t.S({default:""}),fieldName:t.u({title:"Field Name",default:"input"}),inputType:t.f({title:"Type",options:f.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],e=>({value:e,title:e})),default:"text"}),value:t.u({title:"Value",default:""}),showLabel:t.r({title:"Show label",default:!0}),inputStyles:t.S({default:"w-full p-1"}),label:t.u({title:"Label",default:"Label"}),placeholder:t.u({title:"Placeholder",default:"Placeholder"}),required:t.r({title:"Required",default:!1})}});const le=e=>{const{blockProps:l,fieldName:o,label:r,styles:s,inputStyles:n,checked:i,required:c,showLabel:p=!0}=e,m=x.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...s,...l,children:[a.jsxRuntimeExports.jsx("input",{...n,name:o,id:m,type:"radio",required:c,defaultChecked:i}),r&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:r})]}):a.jsxRuntimeExports.jsx("input",{id:m,...l,...n,...s,type:"radio",required:c,checked:i,name:o})};d.registerChaiBlock(le,{type:"Radio",label:"Radio",category:"core",icon:y.RadiobuttonIcon,group:"form",hidden:!0,props:{styles:t.S({default:"flex items-center w-max gap-x-2"}),fieldName:t.u({title:"Field Name",default:"radio"}),label:t.u({title:"Label",default:"Label"}),checked:t.r({title:"Checked",default:!1}),required:t.r({title:"Required",default:!1})}});const oe=e=>{const{blockProps:l,fieldName:o,label:r,placeholder:s,styles:n,inputStyles:i,required:c,showLabel:p,_multiple:m=!1}=e,b=x.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...n,children:[p&&a.jsxRuntimeExports.jsx("label",{htmlFor:b,children:r}),a.jsxRuntimeExports.jsxs("select",{...i,id:b,placeholder:s,required:c,multiple:m,name:o,children:[a.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:s}),f.map(e.options,h=>a.jsxRuntimeExports.jsx("option",{selected:f.get(h,"selected",!1),value:h.value,dangerouslySetInnerHTML:{__html:h.label}},h.value))]})]}):a.jsxRuntimeExports.jsxs("select",{id:b,...n,...l,placeholder:s,required:c,multiple:m,name:o,children:[a.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:s}),f.map(e.options,h=>a.jsxRuntimeExports.jsx("option",{selected:f.get(h,"selected",!1),value:h.value,dangerouslySetInnerHTML:{__html:h.label}},h.value))]})};d.registerChaiBlock(oe,{type:"Select",label:"Select",category:"core",icon:y.DropdownMenuIcon,group:"form",hidden:!0,props:{styles:t.S({default:""}),fieldName:t.u({title:"Field Name",default:"select"}),showLabel:t.r({title:"Show label",default:!0}),inputStyles:t.S({default:"w-full p-1"}),label:t.u({title:"Label",default:"Label"}),placeholder:t.u({title:"Placeholder",default:"Placeholder"}),required:t.r({title:"Required",default:!1}),_multiple:t.r({title:"Multiple Choice",default:!1}),options:t.h({title:"Options",itemProperties:{label:t.u({title:"Label",default:""}),value:t.u({title:"Value",default:""})}})}});const re=e=>{const{blockProps:l,fieldName:o,label:r,placeholder:s,styles:n,inputStyles:i,_rows:c,showLabel:p}=e,m=x.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...n,...l,children:[p&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:r}),a.jsxRuntimeExports.jsx("textarea",{name:o,...i,id:m,placeholder:s,rows:c})]}):a.jsxRuntimeExports.jsx("textarea",{id:m,name:o,...l,...i,...n,placeholder:s,rows:c})};d.registerChaiBlock(re,{type:"TextArea",label:"TextArea",category:"core",icon:y.InputIcon,group:"form",hidden:!0,props:{fieldName:t.u({title:"Field Name",default:"textarea"}),showLabel:t.r({title:"Show label",default:!0}),styles:t.S({default:""}),inputStyles:t.S({default:"w-full p-1"}),label:t.u({title:"Label",default:"Label"}),placeholder:t.u({title:"Placeholder",default:"Placeholder"}),_rows:t.c({title:"Rows",default:3})}});const se=f.noop;exports.loadWebBlocks=se;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("lodash-es"),a=require("./jsx-runtime-Z_BpKhVy.cjs"),I=require("react"),t=require("./controls-KK2oLIa8.cjs"),d=require("@chaibuilder/runtime"),g=require("./empty-slot-nzYOgZuS.cjs"),y=require("@radix-ui/react-icons"),x=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("tailwind-merge");function v(e){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(l,o,s.get?s:{enumerable:!0,get:()=>e[o]})}}return l.default=e,Object.freeze(l)}const u=v(I),R=u.memo(e=>{const{blockProps:l,inBuilder:o,backgroundImage:s,children:r,tag:n="div",styles:i}=e;let c=r;r||(c=a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:{},styles:{},inBuilder:o}));let p={};return s&&(p={backgroundImage:`url(${s})`}),u.createElement(n,{...l,...i,style:p},c)});d.registerChaiBlock(R,{type:"Box",label:"Box",category:"core",group:"basic",props:{styles:t.S({default:""}),tag:t.s({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:t.o({title:"Background Image"})},canAcceptBlock:()=>!0});const L=e=>{const{blockProps:l,styles:o,content:s,level:r="h1",children:n=null}=e;return n?u.createElement(r,{...o,...l},n):u.createElement(r,{...o,...l,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(L,{type:"Heading",label:"Heading",category:"core",icon:y.HeadingIcon,group:"typography",props:{level:t.s({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:t.S({default:"text-3xl"}),content:t.g({title:"Content",default:"Heading goes here"})},canAcceptBlock:e=>e==="Span"||e==="Text"});const T=e=>{const{blockProps:l,styles:o,content:s}=e;return h.isNull(e.children)?u.createElement("div",{...o,...l,dangerouslySetInnerHTML:{__html:s}}):u.createElement("p",{...o,...l},e.children)};d.registerChaiBlock(T,{type:"Paragraph",label:"Paragraph",category:"core",icon:y.TextIcon,group:"typography",props:{styles:t.S({default:""}),content:t.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 w=e=>{const{blockProps:l,styles:o,content:s,children:r=null,tag:n}=e;return r?u.createElement("span",{...o,...l},r):u.createElement(n||"span",{...o,...l,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(w,{type:"Span",label:"Span",category:"core",group:"typography",props:{styles:t.S({default:""}),content:t.g({title:"Content",default:"Enter your content"})}});const C=e=>{const{blockProps:l,content:o,styles:s}=e;return a.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:a.jsxRuntimeExports.jsx("div",{...l,...s,dangerouslySetInnerHTML:{__html:o}})})};d.registerChaiBlock(C,{type:"RichText",label:"Rich Text",category:"core",icon:y.CursorTextIcon,group:"typography",props:{styles:t.S({default:""}),content:t.m({title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}});const _=e=>{const{blockProps:l,iconSize:o,icon:s,content:r,iconPos:n,styles:i,children:c}=e,p=s,m=c||a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[a.jsxRuntimeExports.jsx("span",{children:r}),p&&a.jsxRuntimeExports.jsx("div",{style:{width:o+"px"},className:n+" "+(n==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:p}})]});return u.createElement("button",{...l,...i,type:"button"},m)};d.registerChaiBlock(_,{type:"Button",label:"Button",category:"core",icon:y.ButtonIcon,group:"basic",props:{content:t.u({title:"Label",default:"Button",multiLingual:!0}),styles:t.S({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:t.T({title:"Icon",default:""}),iconSize:t.c({title:"Icon Size",default:24}),iconPos:t.s({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const P=e=>{const{blockProps:l,link:o,children:s,styles:r,inBuilder:n,content:i}=e;return!s&&h.isEmpty(r==null?void 0:r.className)&&h.isEmpty(i)?a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:l,inBuilder:n}):n?s?a.jsxRuntimeExports.jsx("span",{"data-simulate":"a",...l,...r,children:s}):u.createElement("span",{...l,...r,dangerouslySetInnerHTML:{__html:i},"data-simulate":"a"}):s?a.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(P,{type:"Link",label:"Link",category:"core",icon:y.Link1Icon,group:"basic",props:{styles:t.S({default:""}),content:t.u({title:"Content",default:""}),link:t.q({title:"Link",default:{type:"page",target:"_self",href:""}})},canAcceptBlock:()=>!0});const N=e=>{const{blockProps:l,children:o,listType:s,styles:r,tag:n,inBuilder:i}=e,c=x.cn(h.get(r,"className",""),s);return!o&&h.isEmpty(r==null?void 0:r.className)?a.jsxRuntimeExports.jsx(g.EmptySlot,{inBuilder:i,blockProps:l,text:"LIST ITEM"}):u.createElement(n||(s==="list-decimal"?"ol":"ul"),{...l,...r,className:c},o)};d.registerChaiBlock(N,{type:"List",label:"List",icon:y.RowsIcon,category:"core",group:"basic",props:{styles:t.S({default:""}),listType:t.s({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 M=e=>{const{blockProps:l,content:o,styles:s,children:r,tag:n}=e;return r?u.createElement(n||"li",{...s,...l},r):u.createElement(n||"li",{...s,...l,dangerouslySetInnerHTML:{__html:o}})};d.registerChaiBlock(M,{type:"ListItem",label:"List Item",icon:y.ColumnsIcon,category:"core",group:"basic",props:{styles:t.S({default:""}),content:t.g({title:"Content",default:"List item"})},canAcceptBlock:()=>!0,canBeNested:e=>e==="List"});const H=e=>{const{blockProps:l,icon:o,styles:s,width:r,inBuilder:n,height:i}=e,c={...s,className:x.cn(s.className,"inline-block c-inline-block",`w-[${r}px]`,`h-[${i}px]`)};return h.isEmpty(o)?a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:l,text:"",inBuilder:n,className:"h-8 w-14"}):u.createElement("span",{...l,...c,dangerouslySetInnerHTML:{__html:o}})};d.registerChaiBlock(H,{type:"Icon",label:"Icon",category:"core",icon:y.SketchLogoIcon,group:"media",props:{styles:t.S({default:"text-black"}),icon:t.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:t.c({title:"Width",default:40}),height:t.c({title:"Height",default:40})}});const U=e=>{const{blockProps:l,image:o,styles:s,alt:r,height:n,width:i}=e;return h.isEmpty(o)?a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:l,text:"IMAGE URL",className:"h-36"}):u.createElement("img",{...l,...s,src:o,alt:r,height:n,width:i})};d.registerChaiBlock(U,{type:"Image",label:"Image",category:"core",icon:y.ImageIcon,group:"media",props:{styles:t.S({default:""}),image:t.o({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:t.u({title:"Alt",default:""}),width:t.u({title:"Width",default:""}),height:t.u({title:"Height",default:""})}});const D=e=>{var i;const{blockProps:l,inBuilder:o,styles:s,children:r}=e;let n=null;return!r&&o&&(n=a.jsxRuntimeExports.jsx("div",{className:x.cn("flex flex-col items-center justify-center",(i=e.emptyStyles)==null?void 0:i.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",{...s,...l,droppable:"yes"},r||n)};d.registerChaiBlock(D,{type:"Slot",label:"Slot",group:"basic",category:"core",hidden:!0,props:{styles:t.S({default:""}),emptyStyles:t.S({default:""})},canAcceptBlock:()=>!0});const B=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,j=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,S=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,q=e=>{if(B.test(e)){const l=e.match(B);return l?`https://www.youtube.com/embed/${l[4]}`:e}if(j.test(e)){const l=e.match(j);return l?`https://player.vimeo.com/video/${l[3]}`:e}if(S.test(e)){const l=e.match(S);return l?`https://www.dailymotion.com/embed/video/${l[4]}`:e}return null},A=u.memo(e=>{const{blockProps:l,inBuilder:o,styles:s,url:r,controls:n}=e,i=h.get(n,"autoPlay",!1),c=h.get(n,"controls",!1),p=i||h.get(n,"muted",!0),m=h.get(n,"loop",!1);if(h.isEmpty(r))return a.jsxRuntimeExports.jsx(g.EmptySlot,{inBuilder:o,blockProps:l,text:"VIDEO URL",className:"h-36"});let b=q(r),f=null;if(b){if(!h.isEmpty(b)){const k=[];k.push(`autoplay=${i?1:0}`),k.push(`controls=${n?1:0}`),k.push(`mute=${p?1:0}&muted=${p?1:0}`),k.push(`loop=${m?1:0}`),b=`${b}?${k.join("&")}`}f=u.createElement("iframe",{...l,className:"absolute inset-0 w-full h-full",src:b,allow:o?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else f=u.createElement("video",{...l,className:"absolute inset-0 w-full h-full",src:r,controls:c,muted:p,autoPlay:o?!1:i,loop:m});return a.jsxRuntimeExports.jsx("div",{...h.pick(s,["className"]),children:a.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[o?a.jsxRuntimeExports.jsx("div",{...l,...h.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,f]})})});d.registerChaiBlock(A,{type:"Video",label:"Video",category:"core",icon:y.VideoIcon,group:"media",props:{styles:t.S({default:""}),url:t.u({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:t.b({title:"Controls",properties:{autoPlay:t.r({title:"Autoplay",default:!0}),controls:t.r({title:"Show controls",default:!1}),loop:t.r({title:"Loop",default:!1}),muted:t.r({title:"Muted",default:!0})}})}});const F=u.memo(e=>{const{blockProps:l,styles:o,content:s,inBuilder:r}=e;return a.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r?a.jsxRuntimeExports.jsx("div",{...l,...o,className:"absolute z-20 h-full w-full"}):null,u.createElement("div",{...o,dangerouslySetInnerHTML:{__html:s}})]})});d.registerChaiBlock(F,{type:"CustomHTML",label:"Custom HTML",category:"core",icon:y.CodeIcon,group:"advanced",props:{styles:t.S({default:""}),content:t.g({title:"HTML Content",default:"<div><p>HTML Snippet goes here...</p></div>",placeholder:"Enter custom HTML code here"})}});const O=e=>{const{blockProps:l,styles:o}=e;return u.createElement("hr",{...o,...l})};d.registerChaiBlock(O,{type:"Divider",label:"Divider",category:"core",icon:y.DividerHorizontalIcon,group:"basic",props:{styles:t.S({default:"bg-gray-900 h-0.5 py-2 my-1"})}});const z=e=>e.inBuilder?a.jsxRuntimeExports.jsx("span",{className:"inline",...e.blockProps,children:e.content}):`${e.content}`;d.registerChaiBlock(z,{type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:y.SpaceBetweenVerticallyIcon,props:{content:t.g({title:"Content",defaultValue:""})}});const $=e=>{const{blockProps:l,backgroundImage:o,children:s,styles:r}=e;let n={};return o&&(n={backgroundImage:`url(${o})`}),u.createElement("div",{...l,...r,style:n},s)};d.registerChaiBlock($,{type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:t.S({default:"font-body antialiased"}),backgroundImage:t.o({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const V=e=>{const{blockProps:l,styles:o}=e;return u.createElement("br",{...l,...o})};d.registerChaiBlock(V,{type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:y.SpaceBetweenVerticallyIcon,props:{styles:t.S({default:""})}});const E=e=>{const l=(n,i)=>({_id:x.generateUUID(),_parent:n,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+i}`}),o=n=>{const i=x.generateUUID(),c={_type:"TableRow",_id:i,styles:"#styles:,border-b"};return n&&(c._parent=n),[c,l(i,"1"),l(i,"2"),l(i,"3")]},s=n=>{const i=x.generateUUID(),c={_id:i,_type:"TableHead",styles:"#styles:,font-medium"};return n&&(c._parent=n),[c,...o(i)]},r=n=>{const i=x.generateUUID(),c={_id:i,_type:"TableBody",styles:"#styles:,"};return n&&(c._parent=n),[c,...o(i),...o(i)]};if(e==="Table"){const n=x.generateUUID();return[{_id:n,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...s(n),...r(n)]}return e==="TableRow"?o():e==="TableHead"?s():e==="TableBody"?r():[]},W=e=>{const{blockProps:l,children:o,styles:s}=e;return o?u.createElement("table",{...l,...s},o):a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:l,text:"TABLE HEAD / BODY"})};d.registerChaiBlock(W,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:y.TableIcon,props:{styles:t.S({default:""})},blocks:E("Table")});const G=e=>{const{blockProps:l,children:o,styles:s}=e;return o?u.createElement("thead",{...l,...s},o):a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:l,text:"TABLE ROW"})};d.registerChaiBlock(G,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:y.BorderTopIcon,props:{styles:t.S({default:""})},blocks:E("TableHead")});const Y=e=>{const{blockProps:l,children:o,styles:s}=e;return o?u.createElement("tbody",{...l,...s},o):a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:l,text:"TABLE ROW"})};d.registerChaiBlock(Y,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:y.BorderAllIcon,props:{styles:t.S({default:""})},blocks:E("TableBody")});const X=e=>{const{blockProps:l,children:o,styles:s}=e;return o?u.createElement("tr",{...l,...s},o):a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:l,text:"TABLE CELL"})};d.registerChaiBlock(X,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:y.ViewHorizontalIcon,props:{styles:t.S({default:"w-full"})},blocks:E("TableRow")});const Z=e=>{const{blockProps:l,children:o,content:s,styles:r}=e;return!o&&h.isEmpty(s)?a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:l}):o?u.createElement("td",{...l,...r},o):u.createElement("td",{...l,...r,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(Z,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:y.DragHandleHorizontalIcon,props:{styles:t.S({default:""}),content:t.m({title:"Content",default:"Table cell item"})}});const J=e=>{const{blockProps:l,errorMessage:o,name:s,_type:r,successMessage:n,action:i,styles:c,children:p}=e;let m=p;p||(m=a.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:{},text:"FORM FIELDS"}));const b={"x-data":"useForm","x-on:submit.prevent":"post"},f={"x-html":"formResponse",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return a.jsxRuntimeExports.jsxs("form",{...b,"data-error":o,"data-success":n,method:"post",action:i,...l,...c,children:[a.jsxRuntimeExports.jsx("div",{...f}),a.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||r}),m]})};d.registerChaiBlock(J,{type:"Form",label:"Form",category:"core",icon:y.GroupIcon,group:"form",hidden:!0,props:{styles:t.S({default:""}),action:t.u({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});const K=e=>{const{blockProps:l,content:o,styles:s,children:r}=e,n={...s,...l};return r?u.createElement("label",n,r):u.createElement("label",{...n,dangerouslySetInnerHTML:{__html:o}})};d.registerChaiBlock(K,{type:"Label",label:"Label",category:"core",icon:y.LetterCaseToggleIcon,group:"form",hidden:!0,props:{styles:t.S({default:""}),content:t.u({title:"Content",default:"Label"})}});const Q=e=>{const{blockProps:l,inBuilder:o,label:s,placeholder:r,styles:n,inputStyles:i,icon:c,iconPos:p}=e,m=x.generateUUID(),b={"x-bind:disabled":"formLoading"};return a.jsxRuntimeExports.jsxs("button",{id:m,...b,...i,...n,...l||{},type:o?"button":"submit",placeholder:r,children:[s,c&&a.jsxRuntimeExports.jsx("span",{className:p,dangerouslySetInnerHTML:{__html:c}})]})};d.registerChaiBlock(Q,{type:"FormButton",label:"Submit Button",category:"core",icon:y.ButtonIcon,group:"form",hidden:!0,props:{label:t.u({title:"Label",default:"Submit"}),styles:t.S({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:t.T({title:"Icon",default:""}),iconPos:t.s({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const ee=e=>{const{blockProps:l,fieldName:o,label:s,styles:r,inputStyles:n,required:i,checked:c,showLabel:p=!0}=e,m=x.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...r,...l,children:[a.jsxRuntimeExports.jsx("input",{...n,name:o,id:m,type:"checkbox",required:i,defaultChecked:c}),s&&s!=="Label"&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s})]}):a.jsxRuntimeExports.jsx("input",{id:m,...l,...n,...r,type:"checkbox",required:i,name:o})};d.registerChaiBlock(ee,{type:"Checkbox",label:"Checkbox",category:"core",icon:y.CheckboxIcon,group:"form",hidden:!0,props:{fieldName:t.u({title:"Field Name",default:"checkbox"}),styles:t.S({default:"flex items-center gap-x-2"}),label:t.u({title:"Label",default:"Label"}),checked:t.r({title:"Checked",default:!1}),required:t.r({title:"Required",default:!1})}});const te=e=>{const{blockProps:l,label:o,placeholder:s,styles:r,inputStyles:n,showLabel:i,required:c,inputType:p="text",inBuilder:m,fieldName:b}=e,f=x.generateUUID();return!i||p==="submit"?(p==="submit"&&(l.value=o),a.jsxRuntimeExports.jsx("input",{id:f,name:b,readOnly:m,...l,...n,...r,type:p,placeholder:s,required:c})):a.jsxRuntimeExports.jsxs("div",{...r,...l,children:[i&&a.jsxRuntimeExports.jsx("label",{htmlFor:f,children:o}),a.jsxRuntimeExports.jsx("input",{name:b,readOnly:m,...n,id:f,type:p,placeholder:s,required:c})]})};d.registerChaiBlock(te,{type:"Input",label:"Input",category:"core",icon:y.InputIcon,group:"form",hidden:!0,props:{styles:t.S({default:""}),fieldName:t.u({title:"Field Name",default:"input"}),inputType:t.s({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.u({title:"Value",default:""}),showLabel:t.r({title:"Show label",default:!0}),inputStyles:t.S({default:"w-full p-1"}),label:t.u({title:"Label",default:"Label"}),placeholder:t.u({title:"Placeholder",default:"Placeholder"}),required:t.r({title:"Required",default:!1})}});const le=e=>{const{blockProps:l,fieldName:o,label:s,styles:r,inputStyles:n,checked:i,required:c,showLabel:p=!0}=e,m=x.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...r,...l,children:[a.jsxRuntimeExports.jsx("input",{...n,name:o,id:m,type:"radio",required:c,defaultChecked:i}),s&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s})]}):a.jsxRuntimeExports.jsx("input",{id:m,...l,...n,...r,type:"radio",required:c,checked:i,name:o})};d.registerChaiBlock(le,{type:"Radio",label:"Radio",category:"core",icon:y.RadiobuttonIcon,group:"form",hidden:!0,props:{styles:t.S({default:"flex items-center w-max gap-x-2"}),fieldName:t.u({title:"Field Name",default:"radio"}),label:t.u({title:"Label",default:"Label"}),checked:t.r({title:"Checked",default:!1}),required:t.r({title:"Required",default:!1})}});const oe=e=>{const{blockProps:l,fieldName:o,label:s,placeholder:r,styles:n,inputStyles:i,required:c,showLabel:p,_multiple:m=!1}=e,b=x.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...n,children:[p&&a.jsxRuntimeExports.jsx("label",{htmlFor:b,children:s}),a.jsxRuntimeExports.jsxs("select",{...i,id:b,placeholder:r,required:c,multiple:m,name:o,children:[a.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(e.options,f=>a.jsxRuntimeExports.jsx("option",{selected:h.get(f,"selected",!1),value:f.value,dangerouslySetInnerHTML:{__html:f.label}},f.value))]})]}):a.jsxRuntimeExports.jsxs("select",{id:b,...n,...l,placeholder:r,required:c,multiple:m,name:o,children:[a.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(e.options,f=>a.jsxRuntimeExports.jsx("option",{selected:h.get(f,"selected",!1),value:f.value,dangerouslySetInnerHTML:{__html:f.label}},f.value))]})};d.registerChaiBlock(oe,{type:"Select",label:"Select",category:"core",icon:y.DropdownMenuIcon,group:"form",hidden:!0,props:{styles:t.S({default:""}),fieldName:t.u({title:"Field Name",default:"select"}),showLabel:t.r({title:"Show label",default:!0}),inputStyles:t.S({default:"w-full p-1"}),label:t.u({title:"Label",default:"Label"}),placeholder:t.u({title:"Placeholder",default:"Placeholder"}),required:t.r({title:"Required",default:!1}),_multiple:t.r({title:"Multiple Choice",default:!1}),options:t.h({title:"Options",itemProperties:{label:t.u({title:"Label",default:""}),value:t.u({title:"Value",default:""})}})}});const se=e=>{const{blockProps:l,fieldName:o,label:s,placeholder:r,styles:n,inputStyles:i,_rows:c,showLabel:p}=e,m=x.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...n,...l,children:[p&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s}),a.jsxRuntimeExports.jsx("textarea",{name:o,...i,id:m,placeholder:r,rows:c})]}):a.jsxRuntimeExports.jsx("textarea",{id:m,name:o,...l,...i,...n,placeholder:r,rows:c})};d.registerChaiBlock(se,{type:"TextArea",label:"TextArea",category:"core",icon:y.InputIcon,group:"form",hidden:!0,props:{fieldName:t.u({title:"Field Name",default:"textarea"}),showLabel:t.r({title:"Show label",default:!0}),styles:t.S({default:""}),inputStyles:t.S({default:"w-full p-1"}),label:t.u({title:"Label",default:"Label"}),placeholder:t.u({title:"Placeholder",default:"Placeholder"}),_rows:t.c({title:"Rows",default:3})}});const re=h.noop;exports.loadWebBlocks=re;
|
package/dist/web-blocks.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isNull as F, isEmpty as k, get as v, pick as D, omit as $, map as _, noop as q } from "lodash-es";
|
|
2
2
|
import { j as s } from "./jsx-runtime-WbnYoNE9.js";
|
|
3
3
|
import * as d from "react";
|
|
4
|
-
import { S as c,
|
|
4
|
+
import { S as c, s as I, o as j, g as B, m as T, u as f, T as E, c as w, q as z, b as O, r as h, h as V } from "./controls-OfJWSEqC.js";
|
|
5
5
|
import { registerChaiBlock as u } from "@chaibuilder/runtime";
|
|
6
6
|
import { E as g } from "./empty-slot-ZBlsQi6m.js";
|
|
7
7
|
import { HeadingIcon as U, TextIcon as G, CursorTextIcon as W, ButtonIcon as H, Link1Icon as Y, RowsIcon as X, ColumnsIcon as Z, SketchLogoIcon as J, ImageIcon as K, VideoIcon as Q, CodeIcon as ee, DividerHorizontalIcon as te, SpaceBetweenVerticallyIcon as R, TableIcon as le, BorderTopIcon as oe, BorderAllIcon as ae, ViewHorizontalIcon as re, DragHandleHorizontalIcon as se, GroupIcon as ne, LetterCaseToggleIcon as ie, CheckboxIcon as ce, InputIcon as A, RadiobuttonIcon as de, DropdownMenuIcon as ue } from "@radix-ui/react-icons";
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"author": "Suraj Air",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"homepage": "https://chaibuilder.com",
|
|
8
|
-
"version": "1.2.
|
|
8
|
+
"version": "1.2.21",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -61,7 +61,6 @@
|
|
|
61
61
|
"require": "./dist/web-blocks.cjs",
|
|
62
62
|
"types": "./dist/web-blocks.d.ts"
|
|
63
63
|
},
|
|
64
|
-
|
|
65
64
|
"./email": {
|
|
66
65
|
"import": "./dist/email.js",
|
|
67
66
|
"require": "./dist/email.cjs",
|
|
@@ -89,31 +88,31 @@
|
|
|
89
88
|
},
|
|
90
89
|
"dependencies": {
|
|
91
90
|
"@bobthered/tailwindcss-palette-generator": "3.1.1",
|
|
92
|
-
"@chaibuilder/runtime": "0.2.
|
|
91
|
+
"@chaibuilder/runtime": "0.2.5",
|
|
93
92
|
"@floating-ui/dom": "1.4.5",
|
|
94
93
|
"@floating-ui/react-dom": "2.0.1",
|
|
95
94
|
"@mhsdesign/jit-browser-tailwindcss": "0.4.0",
|
|
96
95
|
"@minoru/react-dnd-treeview": "3.4.4",
|
|
97
96
|
"@radix-ui/react-accordion": "^1.1.2",
|
|
98
|
-
"@radix-ui/react-alert-dialog": "^1.0.
|
|
99
|
-
"@radix-ui/react-context-menu": "^2.1.
|
|
100
|
-
"@radix-ui/react-dialog": "^1.0.
|
|
101
|
-
"@radix-ui/react-dropdown-menu": "^2.0.
|
|
102
|
-
"@radix-ui/react-hover-card": "^1.0.
|
|
97
|
+
"@radix-ui/react-alert-dialog": "^1.0.5",
|
|
98
|
+
"@radix-ui/react-context-menu": "^2.1.5",
|
|
99
|
+
"@radix-ui/react-dialog": "^1.0.5",
|
|
100
|
+
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
|
101
|
+
"@radix-ui/react-hover-card": "^1.0.7",
|
|
103
102
|
"@radix-ui/react-icons": "^1.3.0",
|
|
104
103
|
"@radix-ui/react-label": "^2.0.2",
|
|
105
|
-
"@radix-ui/react-menubar": "^1.0.
|
|
106
|
-
"@radix-ui/react-navigation-menu": "^1.1.
|
|
107
|
-
"@radix-ui/react-popover": "^1.0.
|
|
108
|
-
"@radix-ui/react-scroll-area": "^1.0.
|
|
104
|
+
"@radix-ui/react-menubar": "^1.0.4",
|
|
105
|
+
"@radix-ui/react-navigation-menu": "^1.1.4",
|
|
106
|
+
"@radix-ui/react-popover": "^1.0.7",
|
|
107
|
+
"@radix-ui/react-scroll-area": "^1.0.5",
|
|
109
108
|
"@radix-ui/react-select": "^1.2.2",
|
|
110
109
|
"@radix-ui/react-separator": "^1.0.3",
|
|
111
110
|
"@radix-ui/react-slot": "^1.0.2",
|
|
112
111
|
"@radix-ui/react-switch": "^1.0.3",
|
|
113
112
|
"@radix-ui/react-tabs": "^1.0.4",
|
|
114
|
-
"@radix-ui/react-toast": "^1.1.
|
|
113
|
+
"@radix-ui/react-toast": "^1.1.5",
|
|
115
114
|
"@radix-ui/react-toggle": "^1.0.3",
|
|
116
|
-
"@radix-ui/react-tooltip": "^1.0.
|
|
115
|
+
"@radix-ui/react-tooltip": "^1.0.7",
|
|
117
116
|
"@react-email/components": "^0.0.18",
|
|
118
117
|
"@react-email/render": "^0.0.14",
|
|
119
118
|
"@react-hookz/web": "23.1.0",
|
|
@@ -128,45 +127,34 @@
|
|
|
128
127
|
"class-variance-authority": "0.6.1",
|
|
129
128
|
"clsx": "1.2.1",
|
|
130
129
|
"cmdk": "0.2.0",
|
|
131
|
-
"date-fns": "^2.30.0",
|
|
132
130
|
"flagged": "2.0.9",
|
|
133
|
-
"flat-to-nested": "1.1.1",
|
|
134
|
-
"focus-trap-react": "^10.2.1",
|
|
135
|
-
"forgiving-xml-parser": "1.4.0",
|
|
136
|
-
"framer-motion": "^10.12.18",
|
|
137
131
|
"fuse.js": "6.6.2",
|
|
138
|
-
"gray-matter": "^4.0.3",
|
|
139
132
|
"himalaya": "^1.1.0",
|
|
140
133
|
"html-formatter": "0.1.9",
|
|
141
|
-
"i18next": "^23.
|
|
134
|
+
"i18next": "^23.6.0",
|
|
142
135
|
"jotai": "2.2.2",
|
|
143
136
|
"lodash": "^4.17.21",
|
|
144
137
|
"lodash-es": "4.17.21",
|
|
145
138
|
"lucide-react": "^0.244.0",
|
|
146
|
-
"
|
|
147
|
-
"post-robot": "10.0.46",
|
|
148
|
-
"react": "^18",
|
|
139
|
+
"react": "^18.2.0",
|
|
149
140
|
"react-arborist": "^3.4.0",
|
|
150
141
|
"react-autosuggest": "10.1.0",
|
|
151
142
|
"react-colorful": "5.6.1",
|
|
152
143
|
"react-dnd": "16.0.1",
|
|
153
144
|
"react-dnd-html5-backend": "16.0.1",
|
|
154
|
-
"react-dom": "^18",
|
|
145
|
+
"react-dom": "^18.2.0",
|
|
155
146
|
"react-email": "^2.1.3",
|
|
156
147
|
"react-hotkeys-hook": "4.4.1",
|
|
157
148
|
"react-i18next": "13.0.1",
|
|
158
|
-
"react-icons": "^4.
|
|
149
|
+
"react-icons": "^4.11.0",
|
|
159
150
|
"react-icons-picker": "^1.0.9",
|
|
160
151
|
"react-json-view-lite": "^1.4.0",
|
|
161
152
|
"react-quill": "^2.0.0",
|
|
162
|
-
"react-
|
|
163
|
-
"react-wrap-balancer": "^1.0.0",
|
|
164
|
-
"redux-undo": "1.1.0",
|
|
153
|
+
"react-wrap-balancer": "^1.1.0",
|
|
165
154
|
"sonner": "^1.2.0",
|
|
166
|
-
"tailwind-merge": "
|
|
155
|
+
"tailwind-merge": "2.3.0",
|
|
167
156
|
"tippy.js": "^6.3.7",
|
|
168
157
|
"undo-manager": "^1.1.1",
|
|
169
|
-
"unist-util-visit": "^4.1.2",
|
|
170
158
|
"unsplash-js": "^7.0.18"
|
|
171
159
|
},
|
|
172
160
|
"devDependencies": {
|
|
@@ -182,19 +170,19 @@
|
|
|
182
170
|
"@types/jest": "^29.5.7",
|
|
183
171
|
"@types/lodash": "^4.14.200",
|
|
184
172
|
"@types/node": "^20.8.10",
|
|
185
|
-
"@types/react": "^18.2.
|
|
186
|
-
"@types/react-dom": "^18.2.
|
|
187
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
188
|
-
"@typescript-eslint/parser": "^6.
|
|
189
|
-
"@vitejs/plugin-react-swc": "^3.
|
|
173
|
+
"@types/react": "^18.2.34",
|
|
174
|
+
"@types/react-dom": "^18.2.14",
|
|
175
|
+
"@typescript-eslint/eslint-plugin": "^6.9.1",
|
|
176
|
+
"@typescript-eslint/parser": "^6.9.1",
|
|
177
|
+
"@vitejs/plugin-react-swc": "^3.4.1",
|
|
190
178
|
"autoprefixer": "^10.4.16",
|
|
191
179
|
"better-docs": "^2.7.2",
|
|
192
180
|
"better-sqlite3": "^9.1.1",
|
|
193
181
|
"drizzle-kit": "^0.20.4",
|
|
194
182
|
"drizzle-orm": "^0.29.0",
|
|
195
|
-
"eslint": "^8.
|
|
183
|
+
"eslint": "^8.53.0",
|
|
196
184
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
197
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
185
|
+
"eslint-plugin-react-refresh": "^0.4.4",
|
|
198
186
|
"husky": "^9.0.10",
|
|
199
187
|
"jest": "^29.7.0",
|
|
200
188
|
"jest-environment-jsdom": "^29.7.0",
|