@chaibuilder/sdk 1.2.34 → 1.2.36
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-RmEkZXdE.js → AddBlocks-NSDb7WP1.js} +6 -6
- package/dist/{AddBlocks-XYCWUol8.cjs → AddBlocks-_wOcyJY6.cjs} +1 -1
- package/dist/{BrandingOptions-qnaKl27s.cjs → BrandingOptions-D0NIsUGf.cjs} +1 -1
- package/dist/{BrandingOptions-TnzCIC7A.js → BrandingOptions-cTHORxqQ.js} +1 -1
- package/dist/{CanvasArea-SeSRWHy0.js → CanvasArea-6nE635uC.js} +4 -4
- package/dist/{CanvasArea-iIwERFUC.cjs → CanvasArea-D1TUKvIF.cjs} +2 -2
- package/dist/{ChaiBuilderEditor-y1NxvXJ7.js → ChaiBuilderEditor-rPo8yLDm.js} +22974 -22885
- package/dist/{ChaiBuilderEditor-YqEKonJ_.cjs → ChaiBuilderEditor-xecsXt0z.cjs} +68 -68
- package/dist/{CurrentPage-TNff16tH.cjs → CurrentPage-V5uHSGUJ.cjs} +1 -1
- package/dist/{CurrentPage-9KDre_9q.js → CurrentPage-qw0ucVmW.js} +3 -3
- package/dist/ListTree-8K5aSjSH.js +396 -0
- package/dist/ListTree-aamIu2qf.cjs +1 -0
- package/dist/{PagesPanel-jHMmJEtv.js → PagesPanel-31uE12Z7.js} +4 -4
- package/dist/{PagesPanel-5DRsqV-G.cjs → PagesPanel-RXZ-q8Ut.cjs} +1 -1
- package/dist/{ProjectPanel-CDnnGpVo.cjs → ProjectPanel-LMe85RwX.cjs} +1 -1
- package/dist/{ProjectPanel-uxhq_D3j.js → ProjectPanel-oYC1szxp.js} +4 -4
- package/dist/{Settings-nGnVavh4.cjs → Settings-eufW6-XQ.cjs} +1 -1
- package/dist/{Settings-yqZksAbO.js → Settings-o3wnp8uI.js} +2 -2
- package/dist/{SidePanels-33KNaSS3.cjs → SidePanels-bmrMhSWl.cjs} +1 -1
- package/dist/{SidePanels-1gwirESt.js → SidePanels-nIiJwfQ7.js} +2 -2
- package/dist/Topbar--8q83rcZ.js +133 -0
- package/dist/Topbar-CVXB8DGf.cjs +1 -0
- package/dist/{UnsplashImages-LLu2wFeN.js → UnsplashImages-SDBkrhpm.js} +4 -4
- package/dist/{UnsplashImages-lnz6NfSD.cjs → UnsplashImages-aOVqzTK6.cjs} +1 -1
- package/dist/{UploadImages-FtvaDyk9.js → UploadImages-e3dCOlqV.js} +1 -1
- package/dist/{UploadImages-3nl_4mDf.cjs → UploadImages-vGCEvksG.cjs} +1 -1
- package/dist/{add-page-modal-V9DTBMmY.js → add-page-modal-Co1d8dlm.js} +4 -4
- package/dist/{add-page-modal-sIZk552b.cjs → add-page-modal-VMs_u3IX.cjs} +1 -1
- package/dist/{confirm-alert-sI4pItIN.js → confirm-alert-N9xn7uVF.js} +1 -1
- package/dist/{confirm-alert-Uzq5XNGt.cjs → confirm-alert-t1ESMHKf.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-XrIpujav.js → delete-page-modal-GxRd1jPl.js} +3 -3
- package/dist/{delete-page-modal-UminFzYh.cjs → delete-page-modal-MK--z13p.cjs} +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +1 -1
- package/dist/{form-dQQ2tTRZ.js → form-IoNGO0Ov.js} +1 -1
- package/dist/{form-q7lxaK3j.cjs → form-UuH4B151.cjs} +1 -1
- package/dist/html-to-json-VPWiWWGH.cjs +1 -0
- package/dist/{html-to-json-ZV4QjSww.js → html-to-json-Z6R2o_fA.js} +68 -76
- package/dist/{index-eYwpNzUl.cjs → index-Jy9Zfhj_.cjs} +1 -1
- package/dist/{index-OsS2_gM8.js → index-ntl3hbnf.js} +3 -3
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +1 -1
- package/dist/{page-viewer-AoJ5HU6j.js → page-viewer-eIxEA6s_.js} +4 -4
- package/dist/{page-viewer-FzhqSyNO.cjs → page-viewer-inM0HSLv.cjs} +1 -1
- package/dist/{project-general-setting-WzJ8U1OW.cjs → project-general-setting-N_Cg6F3x.cjs} +1 -1
- package/dist/{project-general-setting-g3YJYszB.js → project-general-setting-VDnseYOn.js} +4 -4
- package/dist/{project-seo-setting-1sLmV-wv.js → project-seo-setting-9nwQDhti.js} +2 -2
- package/dist/{project-seo-setting-GuObNafp.cjs → project-seo-setting-crFlVR2_.cjs} +1 -1
- package/dist/{single-page-detail-sQ3BH6Rc.js → single-page-detail-DMm5KvFV.js} +5 -5
- package/dist/{single-page-detail-WGars7Tl.cjs → single-page-detail-W2AlRYUx.cjs} +1 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +3 -3
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +101 -101
- package/dist/{useCanvasSettings-QcsmJd9b.cjs → useCanvasSettings-W54LZ1wt.cjs} +1 -1
- package/dist/useCanvasSettings-zsHMTgls.js +6 -0
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +1 -1
- package/package.json +1 -1
- package/dist/ListTree-GxCAsv2Y.cjs +0 -1
- package/dist/ListTree-H2WaKwOs.js +0 -319
- package/dist/Topbar-NHF8D1di.js +0 -137
- package/dist/Topbar-Wwdd9Flx.cjs +0 -1
- package/dist/html-to-json-Xhu27KFD.cjs +0 -1
- package/dist/useCanvasSettings-XwFRrknO.js +0 -6
package/dist/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b3 as U, b6 as W, b4 as X, b5 as Z, bm as J, bz as K, A as N, a3 as Y, g as aa, b as ea, e as oa, f as ta, c as ra, d as sa, a as na, bn as ia, af as ba, B as pa, bg as ma, bj as ua, bi as la, bl as ca, bh as da, bB as ga, aR as Ca, ca as Ma, aU as Sa, aV as Da, aS as Ta, aW as xa, aT as Aa, cc as ha, cb as wa, br as Ia, cd as Pa, bq as ka, ci as Fa, bp as Ga, cf as La, cj as Ra, cn as va, ce as Ha, cg as Va, ch as Ba, ck as fa, cl as ja, cm as ya, bs as Ea, Z as _a, _ as $a, a1 as qa, aX as za, $ as Oa, a0 as Qa, ab as Ua, av as Wa, aA as Xa, ax as Za, bb as Ja, bc as Ka, ay as Na, c2 as Ya, c6 as ae, c1 as ee, az as oe, bd as te, c3 as re, c4 as se, c5 as ne, aw as ie, as as be, au as pe, at as me, a$ as ue, b0 as le, b8 as ce, aq as de, b1 as ge, bE as Ce, bL as Me, bH as Se, bR as De, bI as Te, bK as xe, bF as Ae, bO as he, bM as we, bN as Ie, bJ as Pe, bT as ke, bS as Fe, bP as Ge, bQ as Le, bG as Re, aO as ve, aQ as He, aP as Ve, a_ as Be, ba as fe, bC as je, a6 as ye, a9 as Ee, am as _e, aa as $e, an as qe, bU as ze, a7 as Oe, a8 as Qe, ap as Ue, bV as We, bX as Xe, bY as Ze, c0 as Je, b_ as Ke, bZ as Ne, b$ as Ye, bW as ao, ah as eo, ar as oo, ai as to, al as ro, aj as so, ak as no, bk as io, c9 as bo, bw as po, ac as mo, ae as uo, b9 as lo, bD as co, ad as go, bA as Co, by as Mo, c7 as So, c8 as Do, bx as To, b7 as xo } from "./ChaiBuilderEditor-rPo8yLDm.js";
|
|
2
2
|
import "./jsx-runtime-WbnYoNE9.js";
|
|
3
3
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
4
4
|
import "react";
|
|
@@ -44,17 +44,17 @@ import "react-hotkeys-hook";
|
|
|
44
44
|
import "lodash";
|
|
45
45
|
import "lucide-react";
|
|
46
46
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
U as Accordion,
|
|
48
|
+
W as AccordionContent,
|
|
49
|
+
X as AccordionItem,
|
|
50
|
+
Z as AccordionTrigger,
|
|
51
51
|
J as Alert,
|
|
52
52
|
K as AlertDescription,
|
|
53
|
-
|
|
53
|
+
N as AlertDialog,
|
|
54
54
|
Y as AlertDialogAction,
|
|
55
55
|
aa as AlertDialogCancel,
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
ea as AlertDialogContent,
|
|
57
|
+
oa as AlertDialogDescription,
|
|
58
58
|
ta as AlertDialogFooter,
|
|
59
59
|
ra as AlertDialogHeader,
|
|
60
60
|
sa as AlertDialogTitle,
|
|
@@ -80,105 +80,105 @@ export {
|
|
|
80
80
|
Ia as ContextMenu,
|
|
81
81
|
Pa as ContextMenuCheckboxItem,
|
|
82
82
|
ka as ContextMenuContent,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
Fa as ContextMenuGroup,
|
|
84
|
+
Ga as ContextMenuItem,
|
|
85
|
+
La as ContextMenuLabel,
|
|
86
|
+
Ra as ContextMenuPortal,
|
|
87
|
+
va as ContextMenuRadioGroup,
|
|
88
88
|
Ha as ContextMenuRadioItem,
|
|
89
89
|
Va as ContextMenuSeparator,
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
Ba as ContextMenuShortcut,
|
|
91
|
+
fa as ContextMenuSub,
|
|
92
92
|
ja as ContextMenuSubContent,
|
|
93
93
|
ya as ContextMenuSubTrigger,
|
|
94
94
|
Ea as ContextMenuTrigger,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
95
|
+
_a as Dialog,
|
|
96
|
+
$a as DialogContent,
|
|
97
|
+
qa as DialogDescription,
|
|
98
|
+
za as DialogFooter,
|
|
99
|
+
Oa as DialogHeader,
|
|
100
|
+
Qa as DialogTitle,
|
|
101
|
+
Ua as DialogTrigger,
|
|
102
|
+
Wa as DropdownMenu,
|
|
103
|
+
Xa as DropdownMenuCheckboxItem,
|
|
104
|
+
Za as DropdownMenuContent,
|
|
105
105
|
Ja as DropdownMenuGroup,
|
|
106
106
|
Ka as DropdownMenuItem,
|
|
107
|
-
|
|
107
|
+
Na as DropdownMenuLabel,
|
|
108
108
|
Ya as DropdownMenuPortal,
|
|
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
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
109
|
+
ae as DropdownMenuRadioGroup,
|
|
110
|
+
ee as DropdownMenuRadioItem,
|
|
111
|
+
oe as DropdownMenuSeparator,
|
|
112
|
+
te as DropdownMenuShortcut,
|
|
113
|
+
re as DropdownMenuSub,
|
|
114
|
+
se as DropdownMenuSubContent,
|
|
115
|
+
ne as DropdownMenuSubTrigger,
|
|
116
|
+
ie as DropdownMenuTrigger,
|
|
117
|
+
be as HoverCard,
|
|
118
|
+
pe as HoverCardContent,
|
|
119
|
+
me as HoverCardTrigger,
|
|
120
|
+
ue as IconPickerField,
|
|
121
|
+
le as ImagePickerField,
|
|
122
|
+
ce as Input,
|
|
123
|
+
de as Label,
|
|
124
|
+
ge as LinkField,
|
|
125
|
+
Ce as Menubar,
|
|
126
|
+
Me as MenubarCheckboxItem,
|
|
127
|
+
Se as MenubarContent,
|
|
128
|
+
De as MenubarGroup,
|
|
129
|
+
Te as MenubarItem,
|
|
130
|
+
xe as MenubarLabel,
|
|
131
|
+
Ae as MenubarMenu,
|
|
132
|
+
he as MenubarPortal,
|
|
133
|
+
we as MenubarRadioGroup,
|
|
134
|
+
Ie as MenubarRadioItem,
|
|
135
|
+
Pe as MenubarSeparator,
|
|
136
|
+
ke as MenubarShortcut,
|
|
137
|
+
Fe as MenubarSub,
|
|
138
|
+
Ge as MenubarSubContent,
|
|
139
|
+
Le as MenubarSubTrigger,
|
|
140
|
+
Re as MenubarTrigger,
|
|
141
|
+
ve as Popover,
|
|
142
|
+
He as PopoverContent,
|
|
143
|
+
Ve as PopoverTrigger,
|
|
144
|
+
Be as RTEField,
|
|
145
|
+
fe as ScrollArea,
|
|
146
|
+
je as ScrollBar,
|
|
147
|
+
ye as Select,
|
|
148
|
+
Ee as SelectContent,
|
|
149
|
+
_e as SelectGroup,
|
|
150
|
+
$e as SelectItem,
|
|
151
|
+
qe as SelectLabel,
|
|
152
|
+
ze as SelectSeparator,
|
|
153
|
+
Oe as SelectTrigger,
|
|
154
|
+
Qe as SelectValue,
|
|
155
|
+
Ue as Separator,
|
|
156
|
+
We as Sheet,
|
|
157
|
+
Xe as SheetClose,
|
|
158
|
+
Ze as SheetContent,
|
|
159
|
+
Je as SheetDescription,
|
|
160
|
+
Ke as SheetFooter,
|
|
161
|
+
Ne as SheetHeader,
|
|
162
|
+
Ye as SheetTitle,
|
|
163
|
+
ao as SheetTrigger,
|
|
164
|
+
eo as Skeleton,
|
|
165
|
+
oo as Switch,
|
|
166
|
+
to as Tabs,
|
|
167
|
+
ro as TabsContent,
|
|
168
|
+
so as TabsList,
|
|
169
|
+
no as TabsTrigger,
|
|
170
|
+
io as Textarea,
|
|
171
|
+
bo as Toaster,
|
|
172
|
+
po as Toggle,
|
|
173
|
+
mo as Tooltip,
|
|
174
|
+
uo as TooltipContent,
|
|
175
|
+
lo as TooltipPortal,
|
|
176
|
+
co as TooltipProvider,
|
|
177
|
+
go as TooltipTrigger,
|
|
178
|
+
Co as badgeVariants,
|
|
179
|
+
Mo as buttonVariants,
|
|
180
|
+
So as reducer,
|
|
181
|
+
Do as toast,
|
|
182
|
+
To as toggleVariants,
|
|
183
|
+
xo as useToast
|
|
184
184
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("jotai"),s=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";const t=require("jotai"),s=require("./ChaiBuilderEditor-xecsXt0z.cjs"),e=()=>t.useAtom(s.canvasSettingsAtom);exports.useCanvasSettings=e;
|
package/dist/web-blocks.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("lodash-es"),n=require("./jsx-runtime-Z_BpKhVy.cjs"),w=require("react"),o=require("./controls-jWJDao88.cjs"),d=require("@chaibuilder/runtime"),b=require("./empty-slot-nzYOgZuS.cjs"),h=require("@radix-ui/react-icons"),f=require("./Functions-N3yhPYKY.cjs"),E=require("./html-to-json-Xhu27KFD.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("tailwind-merge");require("himalaya");require("./STRINGS-gPz7CUOk.cjs");function R(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const s=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,s.get?s:{enumerable:!0,get:()=>e[l]})}}return t.default=e,Object.freeze(t)}const u=R(w),T=u.memo(e=>{const{blockProps:t,inBuilder:l,backgroundImage:s,children:r,tag:a="div",styles:i}=e;let c=r;r||(c=n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:{},styles:{},inBuilder:l}));let p={};return s&&(p={backgroundImage:`url(${s})`}),u.createElement(a,{...t,...i,style:p},c)});d.registerChaiBlock(T,{type:"Box",label:"Box",category:"core",group:"basic",props:{styles:o.S({default:""}),tag:o.y({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.q({title:"Background Image"})},canAcceptBlock:()=>!0});const C=u.memo(e=>{const{blockProps:t,styles:l}=e;return u.createElement("div",{...t,...l})});d.registerChaiBlock(C,{type:"EmptyBox",label:"Empty Box",category:"core",group:"basic",props:{styles:o.S({default:""})},canAcceptBlock:()=>!1});const L=e=>{const{blockProps:t,styles:l,content:s,level:r="h1",children:a=null}=e;return a?u.createElement(r,{...l,...t},a):u.createElement(r,{...l,...t,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(L,{type:"Heading",label:"Heading",category:"core",icon:h.HeadingIcon,group:"typography",props:{level:o.y({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 _=e=>{const{blockProps:t,styles:l,content:s}=e;return y.isNull(e.children)?u.createElement("p",{...l,...t,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}}):u.createElement("p",{...l,...t},e.children)};d.registerChaiBlock(_,{type:"Paragraph",label:"Paragraph",category:"core",icon:h.TextIcon,group:"typography",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 P=e=>{const{blockProps:t,styles:l,content:s,children:r=null,tag:a}=e;return r?u.createElement("span",{...l,...t},r):u.createElement(a||"span",{...l,...t,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(P,{type:"Span",label:"Span",category:"core",group:"typography",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"Enter your content"})},canAcceptBlock:()=>!0});const A=e=>{const{blockProps:t,content:l,styles:s}=e;return n.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:n.jsxRuntimeExports.jsx("div",{"data-ai-key":"content","data-ai-type":"richtext",...t,...s,dangerouslySetInnerHTML:{__html:l}})})};d.registerChaiBlock(A,{type:"RichText",label:"Rich Text",category:"core",icon:h.CursorTextIcon,group:"typography",props:{styles:o.S({default:""}),content:o.m({title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}});const M=e=>{const{blockProps:t,iconSize:l,icon:s,content:r,iconPos:a,styles:i,children:c}=e,p=s,m=c||n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:r}),p&&n.jsxRuntimeExports.jsx("div",{style:{width:l+"px"},className:a+" "+(a==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:p}})]});return u.createElement("button",{...t,...i,type:"button"},m)};d.registerChaiBlock(M,{type:"Button",label:"Button",category:"core",icon:h.ButtonIcon,group:"basic",props:{content:o.l({title:"Label",default:"Button"}),styles:o.S({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:o.o({title:"Icon",default:""}),iconSize:o.c({title:"Icon Size",default:24}),iconPos:o.y({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:s,styles:r,inBuilder:a,content:i}=e;return!s&&y.isEmpty(r==null?void 0:r.className)&&y.isEmpty(i)?n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,inBuilder:a}):a?s?n.jsxRuntimeExports.jsx("span",{"data-simulate":"a",...t,...r,children:s}):u.createElement("span",{...t,...r,dangerouslySetInnerHTML:{__html:i},"data-simulate":"a"}):s?n.jsxRuntimeExports.jsx("a",{href:l.href||"#/",target:l.target,...t,...r,children:s}):u.createElement("a",{...t,...r,"data-ai-key":"content",href:l.href||"#",target:l.target||"_self",dangerouslySetInnerHTML:{__html:i}})};d.registerChaiBlock(N,{type:"Link",label:"Link",category:"core",icon:h.Link1Icon,group:"basic",props:{styles:o.S({default:""}),content:o.l({title:"Content",default:""}),link:o.T({title:"Link",default:{type:"page",target:"_self",href:""}})},canAcceptBlock:()=>!0});const H=e=>{const{blockProps:t,children:l,listType:s,styles:r,tag:a,inBuilder:i}=e,c=f.cn(y.get(r,"className",""),s);return!l&&y.isEmpty(r==null?void 0:r.className)?n.jsxRuntimeExports.jsx(b.EmptySlot,{inBuilder:i,blockProps:t,text:"LIST ITEM"}):u.createElement(a||(s==="list-decimal"?"ol":"ul"),{...t,...r,className:c},l)};d.registerChaiBlock(H,{type:"List",label:"List",icon:h.RowsIcon,category:"core",group:"basic",props:{styles:o.S({default:""}),listType:o.y({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 D=e=>{const{blockProps:t,content:l,styles:s,children:r,tag:a}=e;return r?u.createElement(a||"li",{...s,...t},r):u.createElement(a||"li",{...s,...t,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(D,{type:"ListItem",label:"List Item",icon:h.ColumnsIcon,category:"core",group:"basic",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"List item"})},canAcceptBlock:()=>!0,canBeNested:e=>e==="List"});const k=(e,...t)=>({...e,className:f.cn(e.className,...t)}),U=e=>{const{blockProps:t,icon:l,styles:s,width:r,inBuilder:a,height:i}=e,c=k(s,f.cn(r?`w-[${r}px]`:"",i?`h-[${i}px]`:""));if(y.isEmpty(l))return n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"",inBuilder:a,className:"h-8 w-14"});const p=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return u.createElement("span",{...t,...c,dangerouslySetInnerHTML:{__html:p}})};d.registerChaiBlock(U,{type:"Icon",label:"Icon",category:"core",icon:h.SketchLogoIcon,group:"media",props:{styles:o.S({default:"text-black"}),icon:o.o({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:o.c({title:"Width",default:""}),height:o.c({title:"Height",default:""})}});const q=e=>{const{blockProps:t,image:l,styles:s,alt:r,height:a,width:i}=e;return y.isEmpty(l)?n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"IMAGE URL",className:"h-36"}):u.createElement("img",{...t,...s,src:l,alt:r,height:a,width:i})};d.registerChaiBlock(q,{type:"Image",label:"Image",category:"core",icon:h.ImageIcon,group:"media",props:{styles:o.S({default:""}),image:o.q({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:o.l({title:"Alt",default:""}),width:o.l({title:"Width",default:""}),height:o.l({title:"Height",default:""})}});const F=e=>{var i;const{blockProps:t,inBuilder:l,styles:s,children:r}=e;let a=null;return!r&&l&&(a=n.jsxRuntimeExports.jsx("div",{className:f.cn("flex flex-col items-center justify-center",(i=e.emptyStyles)==null?void 0:i.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: ",e.name]})})})),u.createElement("div",{...s,...t,droppable:"yes"},r||a)};d.registerChaiBlock(F,{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})/,S=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,I=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,O=e=>{if(j.test(e)){const t=e.match(j);return t?`https://www.youtube.com/embed/${t[4]}`:e}if(S.test(e)){const t=e.match(S);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},z=u.memo(e=>{const{blockProps:t,inBuilder:l,styles:s,url:r,controls:a}=e,i=y.get(a,"autoPlay",!1),c=y.get(a,"controls",!1),p=i||y.get(a,"muted",!0),m=y.get(a,"loop",!1);if(y.isEmpty(r))return n.jsxRuntimeExports.jsx(b.EmptySlot,{inBuilder:l,blockProps:t,text:"VIDEO URL",className:"h-36"});let x=O(r),g=null;if(x){if(!y.isEmpty(x)){const v=[];v.push(`autoplay=${i?1:0}`),v.push(`controls=${a?1:0}`),v.push(`mute=${p?1:0}&muted=${p?1:0}`),v.push(`loop=${m?1:0}`),x=`${x}?${v.join("&")}`}g=u.createElement("iframe",{...t,className:"absolute inset-0 w-full h-full",src:x,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else g=u.createElement("video",{...t,className:"absolute inset-0 w-full h-full",src:r,controls:c,muted:p,autoPlay:l?!1:i,loop:m});return n.jsxRuntimeExports.jsx("div",{...y.pick(s,["className"]),children:n.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?n.jsxRuntimeExports.jsx("div",{...t,...y.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,g]})})});d.registerChaiBlock(z,{type:"Video",label:"Video",category:"core",icon:h.VideoIcon,group:"media",props:{styles:o.S({default:""}),url:o.l({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 controls",default:!1}),loop:o.r({title:"Loop",default:!1}),muted:o.r({title:"Muted",default:!0})}})}});const $=u.memo(e=>{const{blockProps:t,styles:l,content:s,inBuilder:r}=e;return n.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r?n.jsxRuntimeExports.jsx("div",{...t,...l,className:"absolute z-20 h-full w-full"}):null,u.createElement("div",{...l,dangerouslySetInnerHTML:{__html:s}})]})});d.registerChaiBlock($,{type:"CustomHTML",label:"Custom HTML",category:"core",icon:h.CodeIcon,group:"advanced",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 V=e=>{const{blockProps:t,styles:l}=e;return u.createElement("hr",{...l,...t})};d.registerChaiBlock(V,{type:"Divider",label:"Divider",category:"core",icon:h.DividerHorizontalIcon,group:"basic",props:{styles:o.S({default:"bg-gray-900 h-0.5 py-2 my-1"})}});const G=e=>e.inBuilder||e.forceWrapper?n.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",...e.blockProps,children:e.content}):`${e.content}`;d.registerChaiBlock(G,{type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:h.SpaceBetweenVerticallyIcon,props:{content:o.g({title:"Content",defaultValue:""})}});const W=({children:e,blockProps:t,styles:l})=>{const s=k(l,"hs-accordion-group");return n.jsxRuntimeExports.jsx("div",{...t,...s,children:e})};d.registerChaiBlock(W,{type:"AccordionGroup",label:"Accordion Group",category:"core",group:"advanced",props:{styles:o.S({default:""})},blocks:()=>{const e="dnd-accordion-"+f.generateUUID();return E.getBlocksFromHTML(`<div class="hs-accordion-group">
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("lodash-es"),n=require("./jsx-runtime-Z_BpKhVy.cjs"),w=require("react"),o=require("./controls-jWJDao88.cjs"),d=require("@chaibuilder/runtime"),b=require("./empty-slot-nzYOgZuS.cjs"),h=require("@radix-ui/react-icons"),f=require("./Functions-N3yhPYKY.cjs"),E=require("./html-to-json-VPWiWWGH.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("tailwind-merge");require("himalaya");require("./STRINGS-gPz7CUOk.cjs");function R(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const s=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,s.get?s:{enumerable:!0,get:()=>e[l]})}}return t.default=e,Object.freeze(t)}const u=R(w),T=u.memo(e=>{const{blockProps:t,inBuilder:l,backgroundImage:s,children:r,tag:a="div",styles:i}=e;let c=r;r||(c=n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:{},styles:{},inBuilder:l}));let p={};return s&&(p={backgroundImage:`url(${s})`}),u.createElement(a,{...t,...i,style:p},c)});d.registerChaiBlock(T,{type:"Box",label:"Box",category:"core",group:"basic",props:{styles:o.S({default:""}),tag:o.y({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.q({title:"Background Image"})},canAcceptBlock:()=>!0});const C=u.memo(e=>{const{blockProps:t,styles:l}=e;return u.createElement("div",{...t,...l})});d.registerChaiBlock(C,{type:"EmptyBox",label:"Empty Box",category:"core",group:"basic",props:{styles:o.S({default:""})},canAcceptBlock:()=>!1});const L=e=>{const{blockProps:t,styles:l,content:s,level:r="h1",children:a=null}=e;return a?u.createElement(r,{...l,...t},a):u.createElement(r,{...l,...t,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(L,{type:"Heading",label:"Heading",category:"core",icon:h.HeadingIcon,group:"typography",props:{level:o.y({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 _=e=>{const{blockProps:t,styles:l,content:s}=e;return y.isNull(e.children)?u.createElement("p",{...l,...t,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}}):u.createElement("p",{...l,...t},e.children)};d.registerChaiBlock(_,{type:"Paragraph",label:"Paragraph",category:"core",icon:h.TextIcon,group:"typography",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 P=e=>{const{blockProps:t,styles:l,content:s,children:r=null,tag:a}=e;return r?u.createElement("span",{...l,...t},r):u.createElement(a||"span",{...l,...t,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(P,{type:"Span",label:"Span",category:"core",group:"typography",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"Enter your content"})},canAcceptBlock:()=>!0});const A=e=>{const{blockProps:t,content:l,styles:s}=e;return n.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:n.jsxRuntimeExports.jsx("div",{"data-ai-key":"content","data-ai-type":"richtext",...t,...s,dangerouslySetInnerHTML:{__html:l}})})};d.registerChaiBlock(A,{type:"RichText",label:"Rich Text",category:"core",icon:h.CursorTextIcon,group:"typography",props:{styles:o.S({default:""}),content:o.m({title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}});const M=e=>{const{blockProps:t,iconSize:l,icon:s,content:r,iconPos:a,styles:i,children:c}=e,p=s,m=c||n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:r}),p&&n.jsxRuntimeExports.jsx("div",{style:{width:l+"px"},className:a+" "+(a==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:p}})]});return u.createElement("button",{...t,...i,type:"button"},m)};d.registerChaiBlock(M,{type:"Button",label:"Button",category:"core",icon:h.ButtonIcon,group:"basic",props:{content:o.l({title:"Label",default:"Button"}),styles:o.S({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:o.o({title:"Icon",default:""}),iconSize:o.c({title:"Icon Size",default:24}),iconPos:o.y({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:s,styles:r,inBuilder:a,content:i}=e;return!s&&y.isEmpty(r==null?void 0:r.className)&&y.isEmpty(i)?n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,inBuilder:a}):a?s?n.jsxRuntimeExports.jsx("span",{"data-simulate":"a",...t,...r,children:s}):u.createElement("span",{...t,...r,dangerouslySetInnerHTML:{__html:i},"data-simulate":"a"}):s?n.jsxRuntimeExports.jsx("a",{href:l.href||"#/",target:l.target,...t,...r,children:s}):u.createElement("a",{...t,...r,"data-ai-key":"content",href:l.href||"#",target:l.target||"_self",dangerouslySetInnerHTML:{__html:i}})};d.registerChaiBlock(N,{type:"Link",label:"Link",category:"core",icon:h.Link1Icon,group:"basic",props:{styles:o.S({default:""}),content:o.l({title:"Content",default:""}),link:o.T({title:"Link",default:{type:"page",target:"_self",href:""}})},canAcceptBlock:()=>!0});const H=e=>{const{blockProps:t,children:l,listType:s,styles:r,tag:a,inBuilder:i}=e,c=f.cn(y.get(r,"className",""),s);return!l&&y.isEmpty(r==null?void 0:r.className)?n.jsxRuntimeExports.jsx(b.EmptySlot,{inBuilder:i,blockProps:t,text:"LIST ITEM"}):u.createElement(a||(s==="list-decimal"?"ol":"ul"),{...t,...r,className:c},l)};d.registerChaiBlock(H,{type:"List",label:"List",icon:h.RowsIcon,category:"core",group:"basic",props:{styles:o.S({default:""}),listType:o.y({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 D=e=>{const{blockProps:t,content:l,styles:s,children:r,tag:a}=e;return r?u.createElement(a||"li",{...s,...t},r):u.createElement(a||"li",{...s,...t,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(D,{type:"ListItem",label:"List Item",icon:h.ColumnsIcon,category:"core",group:"basic",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"List item"})},canAcceptBlock:()=>!0,canBeNested:e=>e==="List"});const k=(e,...t)=>({...e,className:f.cn(e.className,...t)}),U=e=>{const{blockProps:t,icon:l,styles:s,width:r,inBuilder:a,height:i}=e,c=k(s,f.cn(r?`w-[${r}px]`:"",i?`h-[${i}px]`:""));if(y.isEmpty(l))return n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"",inBuilder:a,className:"h-8 w-14"});const p=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return u.createElement("span",{...t,...c,dangerouslySetInnerHTML:{__html:p}})};d.registerChaiBlock(U,{type:"Icon",label:"Icon",category:"core",icon:h.SketchLogoIcon,group:"media",props:{styles:o.S({default:"text-black"}),icon:o.o({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:o.c({title:"Width",default:""}),height:o.c({title:"Height",default:""})}});const q=e=>{const{blockProps:t,image:l,styles:s,alt:r,height:a,width:i}=e;return y.isEmpty(l)?n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"IMAGE URL",className:"h-36"}):u.createElement("img",{...t,...s,src:l,alt:r,height:a,width:i})};d.registerChaiBlock(q,{type:"Image",label:"Image",category:"core",icon:h.ImageIcon,group:"media",props:{styles:o.S({default:""}),image:o.q({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:o.l({title:"Alt",default:""}),width:o.l({title:"Width",default:""}),height:o.l({title:"Height",default:""})}});const F=e=>{var i;const{blockProps:t,inBuilder:l,styles:s,children:r}=e;let a=null;return!r&&l&&(a=n.jsxRuntimeExports.jsx("div",{className:f.cn("flex flex-col items-center justify-center",(i=e.emptyStyles)==null?void 0:i.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: ",e.name]})})})),u.createElement("div",{...s,...t,droppable:"yes"},r||a)};d.registerChaiBlock(F,{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})/,S=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,I=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,O=e=>{if(j.test(e)){const t=e.match(j);return t?`https://www.youtube.com/embed/${t[4]}`:e}if(S.test(e)){const t=e.match(S);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},z=u.memo(e=>{const{blockProps:t,inBuilder:l,styles:s,url:r,controls:a}=e,i=y.get(a,"autoPlay",!1),c=y.get(a,"controls",!1),p=i||y.get(a,"muted",!0),m=y.get(a,"loop",!1);if(y.isEmpty(r))return n.jsxRuntimeExports.jsx(b.EmptySlot,{inBuilder:l,blockProps:t,text:"VIDEO URL",className:"h-36"});let x=O(r),g=null;if(x){if(!y.isEmpty(x)){const v=[];v.push(`autoplay=${i?1:0}`),v.push(`controls=${a?1:0}`),v.push(`mute=${p?1:0}&muted=${p?1:0}`),v.push(`loop=${m?1:0}`),x=`${x}?${v.join("&")}`}g=u.createElement("iframe",{...t,className:"absolute inset-0 w-full h-full",src:x,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else g=u.createElement("video",{...t,className:"absolute inset-0 w-full h-full",src:r,controls:c,muted:p,autoPlay:l?!1:i,loop:m});return n.jsxRuntimeExports.jsx("div",{...y.pick(s,["className"]),children:n.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?n.jsxRuntimeExports.jsx("div",{...t,...y.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,g]})})});d.registerChaiBlock(z,{type:"Video",label:"Video",category:"core",icon:h.VideoIcon,group:"media",props:{styles:o.S({default:""}),url:o.l({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 controls",default:!1}),loop:o.r({title:"Loop",default:!1}),muted:o.r({title:"Muted",default:!0})}})}});const $=u.memo(e=>{const{blockProps:t,styles:l,content:s,inBuilder:r}=e;return n.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r?n.jsxRuntimeExports.jsx("div",{...t,...l,className:"absolute z-20 h-full w-full"}):null,u.createElement("div",{...l,dangerouslySetInnerHTML:{__html:s}})]})});d.registerChaiBlock($,{type:"CustomHTML",label:"Custom HTML",category:"core",icon:h.CodeIcon,group:"advanced",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 V=e=>{const{blockProps:t,styles:l}=e;return u.createElement("hr",{...l,...t})};d.registerChaiBlock(V,{type:"Divider",label:"Divider",category:"core",icon:h.DividerHorizontalIcon,group:"basic",props:{styles:o.S({default:"bg-gray-900 h-0.5 py-2 my-1"})}});const G=e=>e.inBuilder||e.forceWrapper?n.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",...e.blockProps,children:e.content}):`${e.content}`;d.registerChaiBlock(G,{type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:h.SpaceBetweenVerticallyIcon,props:{content:o.g({title:"Content",defaultValue:""})}});const W=({children:e,blockProps:t,styles:l})=>{const s=k(l,"hs-accordion-group");return n.jsxRuntimeExports.jsx("div",{...t,...s,children:e})};d.registerChaiBlock(W,{type:"AccordionGroup",label:"Accordion Group",category:"core",group:"advanced",props:{styles:o.S({default:""})},blocks:()=>{const e="dnd-accordion-"+f.generateUUID();return E.getBlocksFromHTML(`<div class="hs-accordion-group">
|
|
2
2
|
<div class="hs-accordion active" id="hs-unstyled-heading-one">
|
|
3
3
|
<button class="hs-accordion-toggle" aria-controls="hs-unstyled-collapse-one">
|
|
4
4
|
Accordion #1
|
package/dist/web-blocks.js
CHANGED
|
@@ -6,7 +6,7 @@ import { registerChaiBlock as d } from "@chaibuilder/runtime";
|
|
|
6
6
|
import { E as v } from "./empty-slot-ZBlsQi6m.js";
|
|
7
7
|
import { HeadingIcon as Y, TextIcon as X, CursorTextIcon as Z, ButtonIcon as R, Link1Icon as J, RowsIcon as K, ColumnsIcon as Q, SketchLogoIcon as ee, ImageIcon as te, VideoIcon as le, CodeIcon as oe, DividerHorizontalIcon as ae, SpaceBetweenVerticallyIcon as F, TableIcon as se, BorderTopIcon as ne, BorderAllIcon as re, ViewHorizontalIcon as ce, DragHandleHorizontalIcon as ie, GroupIcon as de, LetterCaseToggleIcon as ue, CheckboxIcon as pe, InputIcon as D, RadiobuttonIcon as he, DropdownMenuIcon as ye } from "@radix-ui/react-icons";
|
|
8
8
|
import { c as S, g } from "./Functions-7jnEwJyw.js";
|
|
9
|
-
import { g as A } from "./html-to-json-
|
|
9
|
+
import { g as A } from "./html-to-json-Z6R2o_fA.js";
|
|
10
10
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
11
11
|
import "clsx";
|
|
12
12
|
import "tailwind-merge";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),v=require("jotai"),q=require("@react-hookz/web"),C=require("react-arborist"),r=require("./ChaiBuilderEditor-YqEKonJ_.cjs"),k=require("./Functions-N3yhPYKY.cjs"),s=require("@radix-ui/react-icons"),T=require("lucide-react"),I=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("i18next");require("react-i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("@chaibuilder/runtime");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("react-hotkeys-hook");require("lodash");const B=t=>{switch(t.type){case"Image":return e.jsxRuntimeExports.jsx(s.ImageIcon,{});case"Heading":return e.jsxRuntimeExports.jsx(s.HeadingIcon,{});case"Text":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Link":return e.jsxRuntimeExports.jsx(s.Link1Icon,{});case"Video":return e.jsxRuntimeExports.jsx(s.VideoIcon,{});case"RichText":return e.jsxRuntimeExports.jsx(s.CursorTextIcon,{});case"Button":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"CustomHTML":return e.jsxRuntimeExports.jsx(s.CodeIcon,{});case"Divider":return e.jsxRuntimeExports.jsx(s.DividerHorizontalIcon,{});case"Icon":return e.jsxRuntimeExports.jsx(s.SketchLogoIcon,{});case"List":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"Paragraph":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Row":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"ListItem":return e.jsxRuntimeExports.jsx(s.ColumnsIcon,{});case"LineBreak":return e.jsxRuntimeExports.jsx(s.SpaceBetweenVerticallyIcon,{});case"Form":return e.jsxRuntimeExports.jsx(s.GroupIcon,{});case"Checkbox":return e.jsxRuntimeExports.jsx(s.CheckboxIcon,{});case"FormButton":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"Input":case"TextArea":return e.jsxRuntimeExports.jsx(s.InputIcon,{});case"Radio":return e.jsxRuntimeExports.jsx(s.RadiobuttonIcon,{});case"Select":return e.jsxRuntimeExports.jsx(s.DropdownMenuIcon,{});case"Table":return e.jsxRuntimeExports.jsx(s.TableIcon,{});case"TableHead":return e.jsxRuntimeExports.jsx(s.BorderTopIcon,{});case"TableBody":return e.jsxRuntimeExports.jsx(s.BorderAllIcon,{});case"TableRow":return e.jsxRuntimeExports.jsx(s.ViewHorizontalIcon,{});case"TableCell":return e.jsxRuntimeExports.jsx(s.DragHandleHorizontalIcon,{});case"DataProvider":return e.jsxRuntimeExports.jsx(T.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}},w={display:"flex",alignItems:"center",zIndex:1},D=a.memo(function({top:i,left:n}){const l={position:"absolute",pointerEvents:"none",top:i+"px",left:n+"px",right:0};return e.jsxRuntimeExports.jsx("div",{style:{...w,...l},children:e.jsxRuntimeExports.jsx("div",{className:"h-0.5 flex-1 rounded-[1px] bg-green-500"})})}),S=a.memo(function({children:i,isDragging:n}){return n?e.jsxRuntimeExports.jsx("div",{className:"pointer-events-none fixed left-0 top-0 z-[100] h-full w-full",children:i}):null}),N=a.memo(({id:t,isDragging:i,mouse:n})=>{const[l]=r.useBlocksStore(),c=a.useMemo(()=>l.find(p=>p._id===t),[l,t]),m=a.useMemo(()=>({transform:`translate(${(n==null?void 0:n.x)-10}px, ${(n==null?void 0:n.y)-10}px)`}),[n]);return n?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(S,{isDragging:i,children:e.jsxRuntimeExports.jsx("div",{className:"pointer-events-none absolute z-50 rounded border border-gray-200 bg-gray-100/80 font-semibold text-blue-600 shadow-md dark:border-gray-700 dark:bg-gray-800",style:m,children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex !cursor-grab items-center p-0.5","aria-label":`Type: ${c==null?void 0:c._type}`,children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-0.5 h-3 w-3",children:e.jsxRuntimeExports.jsx(B,{type:c==null?void 0:c._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:(c==null?void 0:c._name)||(c==null?void 0:c._type)})]})})})}):e.jsxRuntimeExports.jsx("div",{className:"hidden"})}),_=()=>{const[t]=r.useSelectedBlockIds(),i=r.useRemoveBlocks(),n=r.useSelectedBlock();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{disabled:!r.canDeleteBlock(n==null?void 0:n._type),className:"flex items-center gap-x-4 text-xs",onClick:()=>i(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},M=()=>{const[t]=r.useSelectedBlockIds(),i=r.useDuplicateBlocks(),n=r.useSelectedBlock(),l=a.useCallback(()=>{i(t)},[t,i]);return e.jsxRuntimeExports.jsxs(r.ContextMenuContent,{className:"text-xs",children:[e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{disabled:!r.canDuplicateBlock(n==null?void 0:n._type),className:"flex items-center gap-x-4 text-xs",onClick:l,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(_,{})]})},A=({children:t})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(r.ContextMenu,{children:[e.jsxRuntimeExports.jsx(r.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx(M,{})]})}),P=a.memo(({node:t,style:i,dragHandle:n})=>{const l=r.useBuilderProp("outlineMenuItems",[]),[,c]=r.useHighlightBlockId(),m=t.children.length>0,{id:p,data:x,isSelected:R,willReceiveDrop:j,isDragging:h,isEditing:g,handleClick:E}=t,f=q.useDebouncedCallback(o=>c(o),[],300),b=o=>{o.stopPropagation(),t.toggle()},u=o=>{o.stopPropagation(),t.isOpen||t.toggle(),E(o)};return a.useEffect(()=>{const o=setTimeout(()=>{j&&!t.isOpen&&t.toggle()},500);return()=>clearTimeout(o)},[j,t]),e.jsxRuntimeExports.jsx(A,{id:p,children:e.jsxRuntimeExports.jsxs("div",{onClick:u,onMouseEnter:()=>f(p),style:i,"data-node-id":p,ref:n,className:k.cn("group flex !h-fit w-full items-center justify-between space-x-px py-px outline-none",R?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800",j&&r.canAcceptChildBlock(x._type,"Icon")?"bg-green-200":"",h&&"opacity-20"),children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:`flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${t.isOpen?"rotate-90":""}`,children:m&&e.jsxRuntimeExports.jsx("button",{onClick:b,type:"button",children:e.jsxRuntimeExports.jsx(s.TriangleRightIcon,{})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-0.5 h-3 w-3",children:e.jsxRuntimeExports.jsx(B,{type:x==null?void 0:x._type})}),g?e.jsxRuntimeExports.jsx(H,{node:t}):e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",onDoubleClick:o=>{o.stopPropagation(),t.edit(),t.deselect()},children:(x==null?void 0:x._name)||(x==null?void 0:x._type.split("/").pop())})]})]}),e.jsxRuntimeExports.jsx("div",{className:"invisible flex items-center space-x-1 pr-2 group-hover:visible",children:l.map(o=>e.jsxRuntimeExports.jsxs(r.Tooltip,{children:[e.jsxRuntimeExports.jsx(r.TooltipTrigger,{className:"cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",asChild:!0,children:a.createElement(o.item,{blockId:p})}),e.jsxRuntimeExports.jsx(r.TooltipContent,{className:"z-[9999]",children:o.tooltip})]}))})]})})}),H=({node:t})=>e.jsxRuntimeExports.jsx("input",{autoFocus:!0,className:"ml-2 w-full rounded-sm border border-black/30 bg-transparent px-1 text-[11px] outline-none",type:"text",defaultValue:t.data.name,onFocus:i=>i.currentTarget.select(),onBlur:i=>t.submit(i.currentTarget.value),onKeyDown:i=>{i.key==="Enter"&&t.submit(i.currentTarget.value)}}),z=()=>{const[t]=r.useBlocksStore();return(i,n)=>{var m;const l=(m=I.find(t,{_id:n}))==null?void 0:m._type,c=I.first(i.map(p=>{var x;return(x=I.find(t,{_id:p}))==null?void 0:x._type}));return r.canAcceptChildBlock(l,c)}},L=()=>{const[t]=v.useAtom(r.treeDSBlocks),[i,n]=r.useSelectedBlockIds(),l=r.useUpdateBlocksProps(),[,c]=r.useSelectedStylingBlocks(),{moveBlocks:m}=r.useBlocksStoreUndoableActions(),p=z(),x=a.useRef(null),[,R]=v.useAtom(r.treeRefAtom),j=()=>{n([]),c([])};a.useEffect(()=>{R(x.current)},[x.current]);const h=({id:u,name:o,node:d})=>{l([u],{_name:o},d.data._name)},g=({dragIds:u,parentId:o,index:d})=>{p(u,o)&&m(u,o,d)},E=u=>{if(u.length===0)return;const o=u[0]?u[0].id:"";c([]),n([o])},f=u=>{var y;u.preventDefault();const o=u.target,d=o.getAttribute("data-node-id")||((y=o.closest("[data-node-id]"))==null?void 0:y.getAttribute("data-node-id"));d&&(c([]),n([d]))},b=q.useDebouncedCallback(({parentNode:u,dragNodes:o})=>{var d;return!r.canAcceptChildBlock(u==null?void 0:u.data._type,(d=o[0])==null?void 0:d.data._type)},[],300);return e.jsxRuntimeExports.jsx("div",{className:k.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1"),onClick:()=>j(),children:e.jsxRuntimeExports.jsx("div",{id:"outline-view",className:"no-scrollbar h-full overflow-y-auto p-1 px-2 text-xs",children:e.jsxRuntimeExports.jsx(C.Tree,{ref:x,height:800,className:"no-scrollbar !h-full max-w-full !overflow-y-auto !overflow-x-hidden",selection:i[0]||"",onRename:h,openByDefault:!1,onMove:g,rowHeight:20,data:t,renderCursor:D,onSelect:E,childrenAccessor:u=>u.children,width:"100%",renderDragPreview:N,indent:10,onContextMenu:f,disableDrop:b,idAccessor:"_id",children:P})})})};exports.default=L;
|